Repository: nazrulworld/fhir.resources Branch: main Commit: 77d06e76a369 Files: 1210 Total size: 28.7 MB Directory structure: gitextract_dpfxjzfy/ ├── .editorconfig ├── .flake8 ├── .github/ │ ├── ISSUE_TEMPLATE.md │ └── workflows/ │ └── ci.yaml ├── .gitignore ├── .isort.cfg ├── .travis.yml ├── AUTHORS.rst ├── CONTRIBUTING.rst ├── HISTORY.rst ├── LICENSE ├── MANIFEST.in ├── Makefile ├── README.rst ├── appveyor.yml ├── fhir/ │ ├── __init__.py │ └── resources/ │ ├── R4B/ │ │ ├── __init__.py │ │ ├── account.py │ │ ├── activitydefinition.py │ │ ├── address.py │ │ ├── administrableproductdefinition.py │ │ ├── adverseevent.py │ │ ├── age.py │ │ ├── allergyintolerance.py │ │ ├── annotation.py │ │ ├── appointment.py │ │ ├── appointmentresponse.py │ │ ├── attachment.py │ │ ├── auditevent.py │ │ ├── backboneelement.py │ │ ├── basic.py │ │ ├── binary.py │ │ ├── biologicallyderivedproduct.py │ │ ├── bodystructure.py │ │ ├── bundle.py │ │ ├── capabilitystatement.py │ │ ├── careplan.py │ │ ├── careteam.py │ │ ├── catalogentry.py │ │ ├── chargeitem.py │ │ ├── chargeitemdefinition.py │ │ ├── citation.py │ │ ├── claim.py │ │ ├── claimresponse.py │ │ ├── clinicalimpression.py │ │ ├── clinicalusedefinition.py │ │ ├── codeableconcept.py │ │ ├── codeablereference.py │ │ ├── codesystem.py │ │ ├── coding.py │ │ ├── communication.py │ │ ├── communicationrequest.py │ │ ├── compartmentdefinition.py │ │ ├── composition.py │ │ ├── conceptmap.py │ │ ├── condition.py │ │ ├── consent.py │ │ ├── contactdetail.py │ │ ├── contactpoint.py │ │ ├── contract.py │ │ ├── contributor.py │ │ ├── count.py │ │ ├── coverage.py │ │ ├── coverageeligibilityrequest.py │ │ ├── coverageeligibilityresponse.py │ │ ├── datarequirement.py │ │ ├── detectedissue.py │ │ ├── device.py │ │ ├── devicedefinition.py │ │ ├── devicemetric.py │ │ ├── devicerequest.py │ │ ├── deviceusestatement.py │ │ ├── diagnosticreport.py │ │ ├── distance.py │ │ ├── documentmanifest.py │ │ ├── documentreference.py │ │ ├── domainresource.py │ │ ├── dosage.py │ │ ├── duration.py │ │ ├── element.py │ │ ├── elementdefinition.py │ │ ├── encounter.py │ │ ├── endpoint.py │ │ ├── enrollmentrequest.py │ │ ├── enrollmentresponse.py │ │ ├── episodeofcare.py │ │ ├── eventdefinition.py │ │ ├── evidence.py │ │ ├── evidencereport.py │ │ ├── evidencevariable.py │ │ ├── examplescenario.py │ │ ├── explanationofbenefit.py │ │ ├── expression.py │ │ ├── extension.py │ │ ├── familymemberhistory.py │ │ ├── fhirprimitiveextension.py │ │ ├── fhirresourcemodel.py │ │ ├── fhirtypes.py │ │ ├── flag.py │ │ ├── goal.py │ │ ├── graphdefinition.py │ │ ├── group.py │ │ ├── guidanceresponse.py │ │ ├── healthcareservice.py │ │ ├── humanname.py │ │ ├── identifier.py │ │ ├── imagingstudy.py │ │ ├── immunization.py │ │ ├── immunizationevaluation.py │ │ ├── immunizationrecommendation.py │ │ ├── implementationguide.py │ │ ├── ingredient.py │ │ ├── insuranceplan.py │ │ ├── invoice.py │ │ ├── library.py │ │ ├── linkage.py │ │ ├── list.py │ │ ├── location.py │ │ ├── manufactureditemdefinition.py │ │ ├── marketingstatus.py │ │ ├── measure.py │ │ ├── measurereport.py │ │ ├── media.py │ │ ├── medication.py │ │ ├── medicationadministration.py │ │ ├── medicationdispense.py │ │ ├── medicationknowledge.py │ │ ├── medicationrequest.py │ │ ├── medicationstatement.py │ │ ├── medicinalproductdefinition.py │ │ ├── messagedefinition.py │ │ ├── messageheader.py │ │ ├── meta.py │ │ ├── molecularsequence.py │ │ ├── money.py │ │ ├── namingsystem.py │ │ ├── narrative.py │ │ ├── nutritionorder.py │ │ ├── nutritionproduct.py │ │ ├── observation.py │ │ ├── observationdefinition.py │ │ ├── operationdefinition.py │ │ ├── operationoutcome.py │ │ ├── organization.py │ │ ├── organizationaffiliation.py │ │ ├── packagedproductdefinition.py │ │ ├── parameterdefinition.py │ │ ├── parameters.py │ │ ├── patient.py │ │ ├── paymentnotice.py │ │ ├── paymentreconciliation.py │ │ ├── period.py │ │ ├── person.py │ │ ├── plandefinition.py │ │ ├── population.py │ │ ├── practitioner.py │ │ ├── practitionerrole.py │ │ ├── procedure.py │ │ ├── prodcharacteristic.py │ │ ├── productshelflife.py │ │ ├── provenance.py │ │ ├── quantity.py │ │ ├── questionnaire.py │ │ ├── questionnaireresponse.py │ │ ├── range.py │ │ ├── ratio.py │ │ ├── ratiorange.py │ │ ├── reference.py │ │ ├── regulatedauthorization.py │ │ ├── relatedartifact.py │ │ ├── relatedperson.py │ │ ├── requestgroup.py │ │ ├── researchdefinition.py │ │ ├── researchelementdefinition.py │ │ ├── researchstudy.py │ │ ├── researchsubject.py │ │ ├── resource.py │ │ ├── riskassessment.py │ │ ├── sampleddata.py │ │ ├── schedule.py │ │ ├── searchparameter.py │ │ ├── servicerequest.py │ │ ├── signature.py │ │ ├── slot.py │ │ ├── specimen.py │ │ ├── specimendefinition.py │ │ ├── structuredefinition.py │ │ ├── structuremap.py │ │ ├── subscription.py │ │ ├── subscriptionstatus.py │ │ ├── subscriptiontopic.py │ │ ├── substance.py │ │ ├── substancedefinition.py │ │ ├── supplydelivery.py │ │ ├── supplyrequest.py │ │ ├── task.py │ │ ├── terminologycapabilities.py │ │ ├── testreport.py │ │ ├── tests/ │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── test_account.py │ │ │ ├── test_activitydefinition.py │ │ │ ├── test_administrableproductdefinition.py │ │ │ ├── test_adverseevent.py │ │ │ ├── test_allergyintolerance.py │ │ │ ├── test_appointment.py │ │ │ ├── test_appointmentresponse.py │ │ │ ├── test_auditevent.py │ │ │ ├── test_basic.py │ │ │ ├── test_binary.py │ │ │ ├── test_biologicallyderivedproduct.py │ │ │ ├── test_bodystructure.py │ │ │ ├── test_bundle.py │ │ │ ├── test_capabilitystatement.py │ │ │ ├── test_careplan.py │ │ │ ├── test_careteam.py │ │ │ ├── test_catalogentry.py │ │ │ ├── test_chargeitem.py │ │ │ ├── test_chargeitemdefinition.py │ │ │ ├── test_citation.py │ │ │ ├── test_claim.py │ │ │ ├── test_claimresponse.py │ │ │ ├── test_clinicalimpression.py │ │ │ ├── test_clinicalusedefinition.py │ │ │ ├── test_codesystem.py │ │ │ ├── test_communication.py │ │ │ ├── test_communicationrequest.py │ │ │ ├── test_compartmentdefinition.py │ │ │ ├── test_composition.py │ │ │ ├── test_conceptmap.py │ │ │ ├── test_condition.py │ │ │ ├── test_consent.py │ │ │ ├── test_contract.py │ │ │ ├── test_coverage.py │ │ │ ├── test_coverageeligibilityrequest.py │ │ │ ├── test_coverageeligibilityresponse.py │ │ │ ├── test_detectedissue.py │ │ │ ├── test_device.py │ │ │ ├── test_devicedefinition.py │ │ │ ├── test_devicemetric.py │ │ │ ├── test_devicerequest.py │ │ │ ├── test_deviceusestatement.py │ │ │ ├── test_diagnosticreport.py │ │ │ ├── test_documentmanifest.py │ │ │ ├── test_documentreference.py │ │ │ ├── test_encounter.py │ │ │ ├── test_endpoint.py │ │ │ ├── test_enrollmentrequest.py │ │ │ ├── test_enrollmentresponse.py │ │ │ ├── test_episodeofcare.py │ │ │ ├── test_eventdefinition.py │ │ │ ├── test_evidence.py │ │ │ ├── test_evidencereport.py │ │ │ ├── test_evidencevariable.py │ │ │ ├── test_examplescenario.py │ │ │ ├── test_explanationofbenefit.py │ │ │ ├── test_familymemberhistory.py │ │ │ ├── test_flag.py │ │ │ ├── test_goal.py │ │ │ ├── test_graphdefinition.py │ │ │ ├── test_group.py │ │ │ ├── test_guidanceresponse.py │ │ │ ├── test_healthcareservice.py │ │ │ ├── test_imagingstudy.py │ │ │ ├── test_immunization.py │ │ │ ├── test_immunizationevaluation.py │ │ │ ├── test_immunizationrecommendation.py │ │ │ ├── test_implementationguide.py │ │ │ ├── test_ingredient.py │ │ │ ├── test_insuranceplan.py │ │ │ ├── test_invoice.py │ │ │ ├── test_library.py │ │ │ ├── test_linkage.py │ │ │ ├── test_list.py │ │ │ ├── test_location.py │ │ │ ├── test_manufactureditemdefinition.py │ │ │ ├── test_measure.py │ │ │ ├── test_measurereport.py │ │ │ ├── test_media.py │ │ │ ├── test_medication.py │ │ │ ├── test_medicationadministration.py │ │ │ ├── test_medicationdispense.py │ │ │ ├── test_medicationknowledge.py │ │ │ ├── test_medicationrequest.py │ │ │ ├── test_medicationstatement.py │ │ │ ├── test_medicinalproductdefinition.py │ │ │ ├── test_messagedefinition.py │ │ │ ├── test_messageheader.py │ │ │ ├── test_molecularsequence.py │ │ │ ├── test_namingsystem.py │ │ │ ├── test_nutritionorder.py │ │ │ ├── test_nutritionproduct.py │ │ │ ├── test_observation.py │ │ │ ├── test_observationdefinition.py │ │ │ ├── test_operationdefinition.py │ │ │ ├── test_operationoutcome.py │ │ │ ├── test_organization.py │ │ │ ├── test_organizationaffiliation.py │ │ │ ├── test_packagedproductdefinition.py │ │ │ ├── test_parameters.py │ │ │ ├── test_patient.py │ │ │ ├── test_paymentnotice.py │ │ │ ├── test_paymentreconciliation.py │ │ │ ├── test_person.py │ │ │ ├── test_plandefinition.py │ │ │ ├── test_practitioner.py │ │ │ ├── test_practitionerrole.py │ │ │ ├── test_procedure.py │ │ │ ├── test_provenance.py │ │ │ ├── test_questionnaire.py │ │ │ ├── test_questionnaireresponse.py │ │ │ ├── test_regulatedauthorization.py │ │ │ ├── test_relatedperson.py │ │ │ ├── test_requestgroup.py │ │ │ ├── test_researchdefinition.py │ │ │ ├── test_researchelementdefinition.py │ │ │ ├── test_researchstudy.py │ │ │ ├── test_researchsubject.py │ │ │ ├── test_riskassessment.py │ │ │ ├── test_schedule.py │ │ │ ├── test_searchparameter.py │ │ │ ├── test_servicerequest.py │ │ │ ├── test_slot.py │ │ │ ├── test_specimen.py │ │ │ ├── test_specimendefinition.py │ │ │ ├── test_structuremap.py │ │ │ ├── test_subscription.py │ │ │ ├── test_subscriptionstatus.py │ │ │ ├── test_subscriptiontopic.py │ │ │ ├── test_substance.py │ │ │ ├── test_substancedefinition.py │ │ │ ├── test_supplydelivery.py │ │ │ ├── test_supplyrequest.py │ │ │ ├── test_task.py │ │ │ ├── test_terminologycapabilities.py │ │ │ ├── test_testreport.py │ │ │ ├── test_testscript.py │ │ │ ├── test_valueset.py │ │ │ ├── test_verificationresult.py │ │ │ └── test_visionprescription.py │ │ ├── testscript.py │ │ ├── timing.py │ │ ├── triggerdefinition.py │ │ ├── usagecontext.py │ │ ├── valueset.py │ │ ├── verificationresult.py │ │ └── visionprescription.py │ ├── STU3/ │ │ ├── __init__.py │ │ ├── account.py │ │ ├── activitydefinition.py │ │ ├── address.py │ │ ├── adverseevent.py │ │ ├── age.py │ │ ├── allergyintolerance.py │ │ ├── annotation.py │ │ ├── appointment.py │ │ ├── appointmentresponse.py │ │ ├── attachment.py │ │ ├── auditevent.py │ │ ├── backboneelement.py │ │ ├── basic.py │ │ ├── binary.py │ │ ├── bodysite.py │ │ ├── bundle.py │ │ ├── capabilitystatement.py │ │ ├── careplan.py │ │ ├── careteam.py │ │ ├── chargeitem.py │ │ ├── claim.py │ │ ├── claimresponse.py │ │ ├── clinicalimpression.py │ │ ├── codeableconcept.py │ │ ├── codesystem.py │ │ ├── coding.py │ │ ├── communication.py │ │ ├── communicationrequest.py │ │ ├── compartmentdefinition.py │ │ ├── composition.py │ │ ├── conceptmap.py │ │ ├── condition.py │ │ ├── consent.py │ │ ├── contactdetail.py │ │ ├── contactpoint.py │ │ ├── contract.py │ │ ├── contributor.py │ │ ├── count.py │ │ ├── coverage.py │ │ ├── dataelement.py │ │ ├── datarequirement.py │ │ ├── detectedissue.py │ │ ├── device.py │ │ ├── devicecomponent.py │ │ ├── devicemetric.py │ │ ├── devicerequest.py │ │ ├── deviceusestatement.py │ │ ├── diagnosticreport.py │ │ ├── distance.py │ │ ├── documentmanifest.py │ │ ├── documentreference.py │ │ ├── domainresource.py │ │ ├── dosage.py │ │ ├── duration.py │ │ ├── element.py │ │ ├── elementdefinition.py │ │ ├── eligibilityrequest.py │ │ ├── eligibilityresponse.py │ │ ├── encounter.py │ │ ├── endpoint.py │ │ ├── enrollmentrequest.py │ │ ├── enrollmentresponse.py │ │ ├── episodeofcare.py │ │ ├── expansionprofile.py │ │ ├── explanationofbenefit.py │ │ ├── extension.py │ │ ├── familymemberhistory.py │ │ ├── fhirprimitiveextension.py │ │ ├── fhirresourcemodel.py │ │ ├── fhirtypes.py │ │ ├── flag.py │ │ ├── goal.py │ │ ├── graphdefinition.py │ │ ├── group.py │ │ ├── guidanceresponse.py │ │ ├── healthcareservice.py │ │ ├── humanname.py │ │ ├── identifier.py │ │ ├── imagingmanifest.py │ │ ├── imagingstudy.py │ │ ├── immunization.py │ │ ├── immunizationrecommendation.py │ │ ├── implementationguide.py │ │ ├── library.py │ │ ├── linkage.py │ │ ├── list.py │ │ ├── location.py │ │ ├── measure.py │ │ ├── measurereport.py │ │ ├── media.py │ │ ├── medication.py │ │ ├── medicationadministration.py │ │ ├── medicationdispense.py │ │ ├── medicationrequest.py │ │ ├── medicationstatement.py │ │ ├── messagedefinition.py │ │ ├── messageheader.py │ │ ├── meta.py │ │ ├── metadataresource.py │ │ ├── money.py │ │ ├── namingsystem.py │ │ ├── narrative.py │ │ ├── nutritionorder.py │ │ ├── observation.py │ │ ├── operationdefinition.py │ │ ├── operationoutcome.py │ │ ├── organization.py │ │ ├── parameterdefinition.py │ │ ├── parameters.py │ │ ├── patient.py │ │ ├── paymentnotice.py │ │ ├── paymentreconciliation.py │ │ ├── period.py │ │ ├── person.py │ │ ├── plandefinition.py │ │ ├── practitioner.py │ │ ├── practitionerrole.py │ │ ├── procedure.py │ │ ├── procedurerequest.py │ │ ├── processrequest.py │ │ ├── processresponse.py │ │ ├── provenance.py │ │ ├── quantity.py │ │ ├── questionnaire.py │ │ ├── questionnaireresponse.py │ │ ├── range.py │ │ ├── ratio.py │ │ ├── reference.py │ │ ├── referralrequest.py │ │ ├── relatedartifact.py │ │ ├── relatedperson.py │ │ ├── requestgroup.py │ │ ├── researchstudy.py │ │ ├── researchsubject.py │ │ ├── resource.py │ │ ├── riskassessment.py │ │ ├── sampleddata.py │ │ ├── schedule.py │ │ ├── searchparameter.py │ │ ├── sequence.py │ │ ├── servicedefinition.py │ │ ├── signature.py │ │ ├── slot.py │ │ ├── specimen.py │ │ ├── structuredefinition.py │ │ ├── structuremap.py │ │ ├── subscription.py │ │ ├── substance.py │ │ ├── supplydelivery.py │ │ ├── supplyrequest.py │ │ ├── task.py │ │ ├── testreport.py │ │ ├── tests/ │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── test_bundle.py │ │ │ ├── test_capabilitystatement.py │ │ │ ├── test_codesystem.py │ │ │ ├── test_compartmentdefinition.py │ │ │ ├── test_conceptmap.py │ │ │ ├── test_operationdefinition.py │ │ │ ├── test_questionnaire.py │ │ │ ├── test_searchparameter.py │ │ │ └── test_valueset.py │ │ ├── testscript.py │ │ ├── timing.py │ │ ├── triggerdefinition.py │ │ ├── usagecontext.py │ │ ├── valueset.py │ │ └── visionprescription.py │ ├── __init__.py │ ├── account.py │ ├── activitydefinition.py │ ├── actordefinition.py │ ├── address.py │ ├── administrableproductdefinition.py │ ├── adverseevent.py │ ├── age.py │ ├── allergyintolerance.py │ ├── annotation.py │ ├── appointment.py │ ├── appointmentresponse.py │ ├── artifactassessment.py │ ├── attachment.py │ ├── auditevent.py │ ├── availability.py │ ├── backboneelement.py │ ├── backbonetype.py │ ├── base.py │ ├── basic.py │ ├── binary.py │ ├── biologicallyderivedproduct.py │ ├── biologicallyderivedproductdispense.py │ ├── bodystructure.py │ ├── bundle.py │ ├── canonicalresource.py │ ├── capabilitystatement.py │ ├── careplan.py │ ├── careteam.py │ ├── chargeitem.py │ ├── chargeitemdefinition.py │ ├── citation.py │ ├── claim.py │ ├── claimresponse.py │ ├── clinicalimpression.py │ ├── clinicalusedefinition.py │ ├── codeableconcept.py │ ├── codeablereference.py │ ├── codesystem.py │ ├── coding.py │ ├── communication.py │ ├── communicationrequest.py │ ├── compartmentdefinition.py │ ├── composition.py │ ├── conceptmap.py │ ├── condition.py │ ├── conditiondefinition.py │ ├── consent.py │ ├── contactdetail.py │ ├── contactpoint.py │ ├── contract.py │ ├── contributor.py │ ├── count.py │ ├── coverage.py │ ├── coverageeligibilityrequest.py │ ├── coverageeligibilityresponse.py │ ├── datarequirement.py │ ├── datatype.py │ ├── detectedissue.py │ ├── device.py │ ├── deviceassociation.py │ ├── devicedefinition.py │ ├── devicedispense.py │ ├── devicemetric.py │ ├── devicerequest.py │ ├── deviceusage.py │ ├── diagnosticreport.py │ ├── distance.py │ ├── documentreference.py │ ├── domainresource.py │ ├── dosage.py │ ├── duration.py │ ├── element.py │ ├── elementdefinition.py │ ├── encounter.py │ ├── encounterhistory.py │ ├── endpoint.py │ ├── enrollmentrequest.py │ ├── enrollmentresponse.py │ ├── episodeofcare.py │ ├── eventdefinition.py │ ├── evidence.py │ ├── evidencereport.py │ ├── evidencevariable.py │ ├── examplescenario.py │ ├── explanationofbenefit.py │ ├── expression.py │ ├── extendedcontactdetail.py │ ├── extension.py │ ├── familymemberhistory.py │ ├── fhirprimitiveextension.py │ ├── fhirresourcemodel.py │ ├── fhirtypes.py │ ├── flag.py │ ├── formularyitem.py │ ├── genomicstudy.py │ ├── goal.py │ ├── graphdefinition.py │ ├── group.py │ ├── guidanceresponse.py │ ├── healthcareservice.py │ ├── humanname.py │ ├── identifier.py │ ├── imagingselection.py │ ├── imagingstudy.py │ ├── immunization.py │ ├── immunizationevaluation.py │ ├── immunizationrecommendation.py │ ├── implementationguide.py │ ├── ingredient.py │ ├── insuranceplan.py │ ├── integer64.py │ ├── inventoryitem.py │ ├── inventoryreport.py │ ├── invoice.py │ ├── library.py │ ├── linkage.py │ ├── list.py │ ├── location.py │ ├── manufactureditemdefinition.py │ ├── marketingstatus.py │ ├── measure.py │ ├── measurereport.py │ ├── medication.py │ ├── medicationadministration.py │ ├── medicationdispense.py │ ├── medicationknowledge.py │ ├── medicationrequest.py │ ├── medicationstatement.py │ ├── medicinalproductdefinition.py │ ├── messagedefinition.py │ ├── messageheader.py │ ├── meta.py │ ├── metadataresource.py │ ├── molecularsequence.py │ ├── monetarycomponent.py │ ├── money.py │ ├── namingsystem.py │ ├── narrative.py │ ├── nutritionintake.py │ ├── nutritionorder.py │ ├── nutritionproduct.py │ ├── observation.py │ ├── observationdefinition.py │ ├── operationdefinition.py │ ├── operationoutcome.py │ ├── organization.py │ ├── organizationaffiliation.py │ ├── packagedproductdefinition.py │ ├── parameterdefinition.py │ ├── parameters.py │ ├── patient.py │ ├── paymentnotice.py │ ├── paymentreconciliation.py │ ├── period.py │ ├── permission.py │ ├── person.py │ ├── plandefinition.py │ ├── practitioner.py │ ├── practitionerrole.py │ ├── primitivetype.py │ ├── procedure.py │ ├── productshelflife.py │ ├── provenance.py │ ├── py.typed │ ├── quantity.py │ ├── questionnaire.py │ ├── questionnaireresponse.py │ ├── range.py │ ├── ratio.py │ ├── ratiorange.py │ ├── reference.py │ ├── regulatedauthorization.py │ ├── relatedartifact.py │ ├── relatedperson.py │ ├── requestorchestration.py │ ├── requirements.py │ ├── researchstudy.py │ ├── researchsubject.py │ ├── resource.py │ ├── riskassessment.py │ ├── sampleddata.py │ ├── schedule.py │ ├── searchparameter.py │ ├── servicerequest.py │ ├── signature.py │ ├── slot.py │ ├── specimen.py │ ├── specimendefinition.py │ ├── structuredefinition.py │ ├── structuremap.py │ ├── subscription.py │ ├── subscriptionstatus.py │ ├── subscriptiontopic.py │ ├── substance.py │ ├── substancedefinition.py │ ├── substancenucleicacid.py │ ├── substancepolymer.py │ ├── substanceprotein.py │ ├── substancereferenceinformation.py │ ├── substancesourcematerial.py │ ├── supplydelivery.py │ ├── supplyrequest.py │ ├── task.py │ ├── terminologycapabilities.py │ ├── testplan.py │ ├── testreport.py │ ├── tests/ │ │ ├── __init__.py │ │ ├── conftest.py │ │ ├── test_account.py │ │ ├── test_activitydefinition.py │ │ ├── test_actordefinition.py │ │ ├── test_administrableproductdefinition.py │ │ ├── test_allergyintolerance.py │ │ ├── test_appointment.py │ │ ├── test_appointmentresponse.py │ │ ├── test_artifactassessment.py │ │ ├── test_auditevent.py │ │ ├── test_basic.py │ │ ├── test_binary.py │ │ ├── test_biologicallyderivedproduct.py │ │ ├── test_biologicallyderivedproductdispense.py │ │ ├── test_bodystructure.py │ │ ├── test_bundle.py │ │ ├── test_capabilitystatement.py │ │ ├── test_careplan.py │ │ ├── test_careteam.py │ │ ├── test_chargeitem.py │ │ ├── test_chargeitemdefinition.py │ │ ├── test_citation.py │ │ ├── test_claim.py │ │ ├── test_claimresponse.py │ │ ├── test_clinicalimpression.py │ │ ├── test_clinicalusedefinition.py │ │ ├── test_codesystem.py │ │ ├── test_communication.py │ │ ├── test_communicationrequest.py │ │ ├── test_compartmentdefinition.py │ │ ├── test_composition.py │ │ ├── test_conceptmap.py │ │ ├── test_condition.py │ │ ├── test_conditiondefinition.py │ │ ├── test_consent.py │ │ ├── test_contract.py │ │ ├── test_coverage.py │ │ ├── test_coverageeligibilityrequest.py │ │ ├── test_coverageeligibilityresponse.py │ │ ├── test_detectedissue.py │ │ ├── test_device.py │ │ ├── test_deviceassociation.py │ │ ├── test_devicedefinition.py │ │ ├── test_devicedispense.py │ │ ├── test_devicemetric.py │ │ ├── test_devicerequest.py │ │ ├── test_deviceusage.py │ │ ├── test_diagnosticreport.py │ │ ├── test_documentreference.py │ │ ├── test_encounter.py │ │ ├── test_encounterhistory.py │ │ ├── test_endpoint.py │ │ ├── test_enrollmentrequest.py │ │ ├── test_enrollmentresponse.py │ │ ├── test_episodeofcare.py │ │ ├── test_eventdefinition.py │ │ ├── test_evidence.py │ │ ├── test_evidencereport.py │ │ ├── test_evidencevariable.py │ │ ├── test_examplescenario.py │ │ ├── test_explanationofbenefit.py │ │ ├── test_familymemberhistory.py │ │ ├── test_flag.py │ │ ├── test_formularyitem.py │ │ ├── test_genomicstudy.py │ │ ├── test_goal.py │ │ ├── test_graphdefinition.py │ │ ├── test_group.py │ │ ├── test_guidanceresponse.py │ │ ├── test_healthcareservice.py │ │ ├── test_imagingselection.py │ │ ├── test_imagingstudy.py │ │ ├── test_immunization.py │ │ ├── test_immunizationevaluation.py │ │ ├── test_immunizationrecommendation.py │ │ ├── test_implementationguide.py │ │ ├── test_ingredient.py │ │ ├── test_insuranceplan.py │ │ ├── test_inventoryitem.py │ │ ├── test_inventoryreport.py │ │ ├── test_invoice.py │ │ ├── test_library.py │ │ ├── test_linkage.py │ │ ├── test_list.py │ │ ├── test_location.py │ │ ├── test_manufactureditemdefinition.py │ │ ├── test_measure.py │ │ ├── test_measurereport.py │ │ ├── test_medication.py │ │ ├── test_medicationadministration.py │ │ ├── test_medicationdispense.py │ │ ├── test_medicationknowledge.py │ │ ├── test_medicationrequest.py │ │ ├── test_medicationstatement.py │ │ ├── test_medicinalproductdefinition.py │ │ ├── test_messagedefinition.py │ │ ├── test_messageheader.py │ │ ├── test_molecularsequence.py │ │ ├── test_namingsystem.py │ │ ├── test_nutritionintake.py │ │ ├── test_nutritionorder.py │ │ ├── test_nutritionproduct.py │ │ ├── test_observation.py │ │ ├── test_observationdefinition.py │ │ ├── test_operationdefinition.py │ │ ├── test_operationoutcome.py │ │ ├── test_organization.py │ │ ├── test_organizationaffiliation.py │ │ ├── test_packagedproductdefinition.py │ │ ├── test_parameters.py │ │ ├── test_patient.py │ │ ├── test_paymentnotice.py │ │ ├── test_paymentreconciliation.py │ │ ├── test_permission.py │ │ ├── test_person.py │ │ ├── test_plandefinition.py │ │ ├── test_practitioner.py │ │ ├── test_practitionerrole.py │ │ ├── test_procedure.py │ │ ├── test_provenance.py │ │ ├── test_questionnaire.py │ │ ├── test_questionnaireresponse.py │ │ ├── test_regulatedauthorization.py │ │ ├── test_relatedperson.py │ │ ├── test_requestorchestration.py │ │ ├── test_requirements.py │ │ ├── test_researchstudy.py │ │ ├── test_researchsubject.py │ │ ├── test_riskassessment.py │ │ ├── test_schedule.py │ │ ├── test_searchparameter.py │ │ ├── test_servicerequest.py │ │ ├── test_slot.py │ │ ├── test_specimen.py │ │ ├── test_specimendefinition.py │ │ ├── test_structuremap.py │ │ ├── test_subscription.py │ │ ├── test_subscriptionstatus.py │ │ ├── test_subscriptiontopic.py │ │ ├── test_substance.py │ │ ├── test_substancedefinition.py │ │ ├── test_substancenucleicacid.py │ │ ├── test_substancepolymer.py │ │ ├── test_substanceprotein.py │ │ ├── test_substancereferenceinformation.py │ │ ├── test_substancesourcematerial.py │ │ ├── test_supplydelivery.py │ │ ├── test_supplyrequest.py │ │ ├── test_task.py │ │ ├── test_terminologycapabilities.py │ │ ├── test_testplan.py │ │ ├── test_testreport.py │ │ ├── test_testscript.py │ │ ├── test_transport.py │ │ ├── test_valueset.py │ │ ├── test_verificationresult.py │ │ └── test_visionprescription.py │ ├── testscript.py │ ├── timing.py │ ├── transport.py │ ├── triggerdefinition.py │ ├── usagecontext.py │ ├── valueset.py │ ├── verificationresult.py │ ├── virtualservicedetail.py │ └── visionprescription.py ├── pyproject.toml ├── script/ │ ├── base_local.py │ ├── generate.py │ └── static/ │ └── .gitignore ├── setup.cfg ├── setup.py ├── tests/ │ ├── __init__.py │ ├── conftest.py │ ├── patch_r4b_test.py │ ├── static/ │ │ ├── R4B/ │ │ │ ├── Observation.json │ │ │ ├── Patient-with-ext.json │ │ │ └── Patient-with-ext.xml │ │ ├── STU3-Bundle-Issue-144.xml │ │ ├── example1-Provenance.json │ │ ├── patient-example-animal(animal).xml │ │ └── xsd/ │ │ └── fhir/ │ │ ├── account.sch │ │ ├── account.xsd │ │ ├── activitydefinition.sch │ │ ├── activitydefinition.xsd │ │ ├── adverseevent.sch │ │ ├── adverseevent.xsd │ │ ├── allergyintolerance.sch │ │ ├── allergyintolerance.xsd │ │ ├── appointment.sch │ │ ├── appointment.xsd │ │ ├── appointmentresponse.sch │ │ ├── appointmentresponse.xsd │ │ ├── auditevent.sch │ │ ├── auditevent.xsd │ │ ├── basic.sch │ │ ├── basic.xsd │ │ ├── binary.sch │ │ ├── binary.xsd │ │ ├── biologicallyderivedproduct.sch │ │ ├── biologicallyderivedproduct.xsd │ │ ├── bodystructure.sch │ │ ├── bodystructure.xsd │ │ ├── bundle.sch │ │ ├── bundle.xsd │ │ ├── capabilitystatement.sch │ │ ├── capabilitystatement.xsd │ │ ├── careplan.sch │ │ ├── careplan.xsd │ │ ├── careteam.sch │ │ ├── careteam.xsd │ │ ├── catalogentry.sch │ │ ├── catalogentry.xsd │ │ ├── chargeitem.sch │ │ ├── chargeitem.xsd │ │ ├── chargeitemdefinition.sch │ │ ├── chargeitemdefinition.xsd │ │ ├── claim.sch │ │ ├── claim.xsd │ │ ├── claimresponse.sch │ │ ├── claimresponse.xsd │ │ ├── clinicalimpression.sch │ │ ├── clinicalimpression.xsd │ │ ├── codesystem.sch │ │ ├── codesystem.xsd │ │ ├── communication.sch │ │ ├── communication.xsd │ │ ├── communicationrequest.sch │ │ ├── communicationrequest.xsd │ │ ├── compartmentdefinition.sch │ │ ├── compartmentdefinition.xsd │ │ ├── composition.sch │ │ ├── composition.xsd │ │ ├── conceptmap.sch │ │ ├── conceptmap.xsd │ │ ├── condition.sch │ │ ├── condition.xsd │ │ ├── consent.sch │ │ ├── consent.xsd │ │ ├── contract.sch │ │ ├── contract.xsd │ │ ├── coverage.sch │ │ ├── coverage.xsd │ │ ├── coverageeligibilityrequest.sch │ │ ├── coverageeligibilityrequest.xsd │ │ ├── coverageeligibilityresponse.sch │ │ ├── coverageeligibilityresponse.xsd │ │ ├── detectedissue.sch │ │ ├── detectedissue.xsd │ │ ├── device.sch │ │ ├── device.xsd │ │ ├── devicedefinition.sch │ │ ├── devicedefinition.xsd │ │ ├── devicemetric.sch │ │ ├── devicemetric.xsd │ │ ├── devicerequest.sch │ │ ├── devicerequest.xsd │ │ ├── deviceusestatement.sch │ │ ├── deviceusestatement.xsd │ │ ├── diagnosticreport.sch │ │ ├── diagnosticreport.xsd │ │ ├── documentmanifest.sch │ │ ├── documentmanifest.xsd │ │ ├── documentreference.sch │ │ ├── documentreference.xsd │ │ ├── effectevidencesynthesis.sch │ │ ├── effectevidencesynthesis.xsd │ │ ├── encounter.sch │ │ ├── encounter.xsd │ │ ├── endpoint.sch │ │ ├── endpoint.xsd │ │ ├── enrollmentrequest.sch │ │ ├── enrollmentrequest.xsd │ │ ├── enrollmentresponse.sch │ │ ├── enrollmentresponse.xsd │ │ ├── episodeofcare.sch │ │ ├── episodeofcare.xsd │ │ ├── eventdefinition.sch │ │ ├── eventdefinition.xsd │ │ ├── evidence.sch │ │ ├── evidence.xsd │ │ ├── evidencevariable.sch │ │ ├── evidencevariable.xsd │ │ ├── examplescenario.sch │ │ ├── examplescenario.xsd │ │ ├── explanationofbenefit.sch │ │ ├── explanationofbenefit.xsd │ │ ├── familymemberhistory.sch │ │ ├── familymemberhistory.xsd │ │ ├── fhir-all.xsd │ │ ├── fhir-base.xsd │ │ ├── fhir-invariants.sch │ │ ├── fhir-single.xsd │ │ ├── fhir-xhtml.xsd │ │ ├── flag.sch │ │ ├── flag.xsd │ │ ├── goal.sch │ │ ├── goal.xsd │ │ ├── graphdefinition.sch │ │ ├── graphdefinition.xsd │ │ ├── group.sch │ │ ├── group.xsd │ │ ├── guidanceresponse.sch │ │ ├── guidanceresponse.xsd │ │ ├── healthcareservice.sch │ │ ├── healthcareservice.xsd │ │ ├── imagingstudy.sch │ │ ├── imagingstudy.xsd │ │ ├── immunization.sch │ │ ├── immunization.xsd │ │ ├── immunizationevaluation.sch │ │ ├── immunizationevaluation.xsd │ │ ├── immunizationrecommendation.sch │ │ ├── immunizationrecommendation.xsd │ │ ├── implementationguide.sch │ │ ├── implementationguide.xsd │ │ ├── insuranceplan.sch │ │ ├── insuranceplan.xsd │ │ ├── invoice.sch │ │ ├── invoice.xsd │ │ ├── library.sch │ │ ├── library.xsd │ │ ├── linkage.sch │ │ ├── linkage.xsd │ │ ├── list.sch │ │ ├── list.xsd │ │ ├── location.sch │ │ ├── location.xsd │ │ ├── measure.sch │ │ ├── measure.xsd │ │ ├── measurereport.sch │ │ ├── measurereport.xsd │ │ ├── media.sch │ │ ├── media.xsd │ │ ├── medication.sch │ │ ├── medication.xsd │ │ ├── medicationadministration.sch │ │ ├── medicationadministration.xsd │ │ ├── medicationdispense.sch │ │ ├── medicationdispense.xsd │ │ ├── medicationknowledge.sch │ │ ├── medicationknowledge.xsd │ │ ├── medicationrequest.sch │ │ ├── medicationrequest.xsd │ │ ├── medicationstatement.sch │ │ ├── medicationstatement.xsd │ │ ├── medicinalproduct.sch │ │ ├── medicinalproduct.xsd │ │ ├── medicinalproductauthorization.sch │ │ ├── medicinalproductauthorization.xsd │ │ ├── medicinalproductcontraindication.sch │ │ ├── medicinalproductcontraindication.xsd │ │ ├── medicinalproductindication.sch │ │ ├── medicinalproductindication.xsd │ │ ├── medicinalproductingredient.sch │ │ ├── medicinalproductingredient.xsd │ │ ├── medicinalproductinteraction.sch │ │ ├── medicinalproductinteraction.xsd │ │ ├── medicinalproductmanufactured.sch │ │ ├── medicinalproductmanufactured.xsd │ │ ├── medicinalproductpackaged.sch │ │ ├── medicinalproductpackaged.xsd │ │ ├── medicinalproductpharmaceutical.sch │ │ ├── medicinalproductpharmaceutical.xsd │ │ ├── medicinalproductundesirableeffect.sch │ │ ├── medicinalproductundesirableeffect.xsd │ │ ├── messagedefinition.sch │ │ ├── messagedefinition.xsd │ │ ├── messageheader.sch │ │ ├── messageheader.xsd │ │ ├── molecularsequence.sch │ │ ├── molecularsequence.xsd │ │ ├── namingsystem.sch │ │ ├── namingsystem.xsd │ │ ├── nutritionorder.sch │ │ ├── nutritionorder.xsd │ │ ├── observation.sch │ │ ├── observation.xsd │ │ ├── observationdefinition.sch │ │ ├── observationdefinition.xsd │ │ ├── operationdefinition.sch │ │ ├── operationdefinition.xsd │ │ ├── operationoutcome.sch │ │ ├── operationoutcome.xsd │ │ ├── organization.sch │ │ ├── organization.xsd │ │ ├── organizationaffiliation.sch │ │ ├── organizationaffiliation.xsd │ │ ├── parameters.sch │ │ ├── parameters.xsd │ │ ├── patient.sch │ │ ├── patient.xsd │ │ ├── paymentnotice.sch │ │ ├── paymentnotice.xsd │ │ ├── paymentreconciliation.sch │ │ ├── paymentreconciliation.xsd │ │ ├── person.sch │ │ ├── person.xsd │ │ ├── plandefinition.sch │ │ ├── plandefinition.xsd │ │ ├── practitioner.sch │ │ ├── practitioner.xsd │ │ ├── practitionerrole.sch │ │ ├── practitionerrole.xsd │ │ ├── procedure.sch │ │ ├── procedure.xsd │ │ ├── provenance.sch │ │ ├── provenance.xsd │ │ ├── questionnaire.sch │ │ ├── questionnaire.xsd │ │ ├── questionnaireresponse.sch │ │ ├── questionnaireresponse.xsd │ │ ├── relatedperson.sch │ │ ├── relatedperson.xsd │ │ ├── requestgroup.sch │ │ ├── requestgroup.xsd │ │ ├── researchdefinition.sch │ │ ├── researchdefinition.xsd │ │ ├── researchelementdefinition.sch │ │ ├── researchelementdefinition.xsd │ │ ├── researchstudy.sch │ │ ├── researchstudy.xsd │ │ ├── researchsubject.sch │ │ ├── researchsubject.xsd │ │ ├── riskassessment.sch │ │ ├── riskassessment.xsd │ │ ├── riskevidencesynthesis.sch │ │ ├── riskevidencesynthesis.xsd │ │ ├── schedule.sch │ │ ├── schedule.xsd │ │ ├── searchparameter.sch │ │ ├── searchparameter.xsd │ │ ├── servicerequest.sch │ │ ├── servicerequest.xsd │ │ ├── slot.sch │ │ ├── slot.xsd │ │ ├── specimen.sch │ │ ├── specimen.xsd │ │ ├── specimendefinition.sch │ │ ├── specimendefinition.xsd │ │ ├── structuredefinition.sch │ │ ├── structuredefinition.xsd │ │ ├── structuremap.sch │ │ ├── structuremap.xsd │ │ ├── subscription.sch │ │ ├── subscription.xsd │ │ ├── substance.sch │ │ ├── substance.xsd │ │ ├── substancenucleicacid.sch │ │ ├── substancenucleicacid.xsd │ │ ├── substancepolymer.sch │ │ ├── substancepolymer.xsd │ │ ├── substanceprotein.sch │ │ ├── substanceprotein.xsd │ │ ├── substancereferenceinformation.sch │ │ ├── substancereferenceinformation.xsd │ │ ├── substancesourcematerial.sch │ │ ├── substancesourcematerial.xsd │ │ ├── substancespecification.sch │ │ ├── substancespecification.xsd │ │ ├── supplydelivery.sch │ │ ├── supplydelivery.xsd │ │ ├── supplyrequest.sch │ │ ├── supplyrequest.xsd │ │ ├── task.sch │ │ ├── task.xsd │ │ ├── terminologycapabilities.sch │ │ ├── terminologycapabilities.xsd │ │ ├── testreport.sch │ │ ├── testreport.xsd │ │ ├── testscript.sch │ │ ├── testscript.xsd │ │ ├── valueset.sch │ │ ├── valueset.xsd │ │ ├── verificationresult.sch │ │ ├── verificationresult.xsd │ │ ├── visionprescription.sch │ │ ├── visionprescription.xsd │ │ ├── xml.xsd │ │ └── xmldsig-core-schema.xsd │ ├── test_summary_mode_serialization.py │ ├── test_xml_validate_and_dump.py │ ├── test_yaml_validate_and_dump.py │ └── utils.py └── tox.ini ================================================ FILE CONTENTS ================================================ ================================================ FILE: .editorconfig ================================================ # http://editorconfig.org root = true [*] indent_style = space indent_size = 4 trim_trailing_whitespace = true insert_final_newline = true charset = utf-8 end_of_line = lf [*.bat] indent_style = tab end_of_line = crlf [LICENSE] insert_final_newline = false [Makefile] indent_style = tab ================================================ FILE: .flake8 ================================================ [flake8] max-line-length = 88 select = C,E,F,W,B,B950 ignore = E203, E501, W503, B950 ================================================ FILE: .github/ISSUE_TEMPLATE.md ================================================ * fhir.resources version: * Python version: * Operating System: ### Description Describe what you were trying to get done. Tell us what happened, what went wrong, and what you expected to happen. ### What I Did ``` Paste the command(s) you ran and the output. If there was a crash, please include the traceback here. ``` ================================================ FILE: .github/workflows/ci.yaml ================================================ name: CI on: push: branches: - main pull_request: workflow_dispatch: merge_group: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} cancel-in-progress: true permissions: contents: read jobs: lint: runs-on: ubuntu-latest strategy: fail-fast: true max-parallel: 4 matrix: python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: persist-credentials: false - name: Install uv uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0 id: setup-uv with: python-version: ${{ matrix.python-version }} activate-environment: true - name: Install dependencies run: | uv run python --version uv pip install -e .[test] - run: uv run flake8 ./fhir/resources/ - run: uv run black --check fhir/resources/ # monthly cache updates - run: echo "cache_id=$(date --utc '+%m')" >> "$GITHUB_ENV" - uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 with: key: fhir-resources-${{ env.cache_id }} path: .cache restore-keys: | fhir-resources- - name: Run main tests with Python ${{ matrix.python-version }} run: | which pytest uv run pytest tests - name: Run STU3 tests with Python ${{ matrix.python-version }} run: | uv run pytest fhir/resources/STU3/tests - name: Run R4B tests with Python ${{ matrix.python-version }} run: | uv run pytest -s --cov=fhir/resources/R4B/tests -s --tb=native -v --cov-report term-missing --cov-append fhir/resources/R4B/tests - name: Run R5 tests with Python ${{ matrix.python-version }} run: | uv run pytest -s --cov=fhir/resources/tests -s --tb=native -v --cov-report term-missing --cov-append fhir/resources/tests ================================================ FILE: .gitignore ================================================ # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class # C extensions *.so # Distribution / packaging .Python env/ build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ wheels/ *.egg-info/ .installed.cfg *.egg # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ .coverage .coverage.* .cache nosetests.xml coverage.xml *.cover .hypothesis/ .pytest_cache/ # Translations *.mo *.pot # Django stuff: *.log local_settings.py # Flask stuff: instance/ .webassets-cache # Scrapy stuff: .scrapy # Sphinx documentation docs/_build/ # PyBuilder target/ # Jupyter Notebook .ipynb_checkpoints # pyenv .python-version # celery beat schedule file celerybeat-schedule # SageMath parsed files *.sage.py # dotenv .env # virtualenv .venv venv/ ENV/ # Spyder project settings .spyderproject .spyproject # Rope project settings .ropeproject # mkdocs documentation /site # mypy .mypy_cache/ # editor .idea .vscode # Others /pip-wheel-metadata /fhir-parser .DS_Store ================================================ FILE: .isort.cfg ================================================ [settings] multi_line_output=3 include_trailing_comma=True force_grid_wrap=0 use_parentheses=True line_length=88 ================================================ FILE: .travis.yml ================================================ # Config file for automatic testing at travis-ci.org language: python jobs: include: - name: "Python 3.8 on Linux (dist:jammy)" os: linux dist: jammy language: python python: 3.8 env: python_version=3.8 - name: "Python 3.9 on Linux (dist:jammy)" os: linux dist: jammy language: python python: 3.9 env: python_version=3.9 - name: "Python 3.10 on Linux (dist:jammy)" os: linux dist: jammy language: python python: 3.10 env: python_version=3.10 - name: "Python 3.11 on Linux (dist:jammy)" os: linux dist: jammy language: python python: 3.11 env: python_version=3.11 - name: "Python 3.12 on Linux (dist:jammy)" os: linux dist: jammy language: python python: 3.12 env: python_version=3.12 - name: "Python 3.13 on Linux (dist:jammy)" os: linux dist: jammy language: python python: 3.13 env: python_version=3.13 allow_failures: - python: 3.12 - python: 3.13 cache: directories: - eggs - $HOME/.cache/pip install: - pip install -U pip - pip install -e .[test] - pip install codecov - sleep 1 script: - make clean - make lint - black --check --verbose fhir/resources/ - pytest tests - pytest fhir/resources/STU3/tests - pytest -s --cov=fhir/resources/R4B/tests -s --tb=native -v --cov-report term-missing --cov-append fhir/resources/R4B/tests - pytest -s --cov=fhir/resources/tests -s --tb=native -v --cov-report term-missing --cov-append fhir/resources/tests after_success: - codecov ================================================ FILE: AUTHORS.rst ================================================ ======= Credits ======= Development Lead ---------------- * Md Nazrul Islam Contributors ------------ * Mike Mabey[mmabey] * Simon Vadée [simonvadee] * [iatechicken] * Itay Goren * Melvin Hazeleger [melvio] * Bidimpata-Kerim Aramyan-Tshimanga [Tshimanga] * Alexander Essenwanger [cybernop] * Matthias Schoettle [mschoettle] ================================================ FILE: CONTRIBUTING.rst ================================================ .. highlight:: shell ============ Contributing ============ Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given. You can contribute in many ways: Types of Contributions ---------------------- Report Bugs ~~~~~~~~~~~ Report bugs at https://github.com/nazrulworld/fhir.resources/issues. If you are reporting a bug, please include: * Your operating system name and version. * Any details about your local setup that might be helpful in troubleshooting. * Detailed steps to reproduce the bug. Fix Bugs ~~~~~~~~ Look through the GitHub issues for bugs. Anything tagged with "bug" and "help wanted" is open to whoever wants to implement it. Implement Features ~~~~~~~~~~~~~~~~~~ Look through the GitHub issues for features. Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it. Write Documentation ~~~~~~~~~~~~~~~~~~~ fhir.resources could always use more documentation, whether as part of the official fhir.resources docs, in docstrings, or even on the web in blog posts, articles, and such. Submit Feedback ~~~~~~~~~~~~~~~ The best way to send feedback is to file an issue at https://github.com/nazrulworld/fhir.resources/issues. If you are proposing a feature: * Explain in detail how it would work. * Keep the scope as narrow as possible, to make it easier to implement. * Remember that this is a volunteer-driven project, and that contributions are welcome :) Get Started! ------------ Ready to contribute? Here's how to set up `fhir.resources` for local development. 1. Fork the `fhir.resources` repo on GitHub. 2. Clone your fork locally:: $ git clone git@github.com:your_name_here/fhir.resources.git 3. Install your local copy into a virtualenv. Assuming you have pipenv installed (but don't worry you could use simply virtualenv and install from ``requirements_dev.txt ), this is how you set up your fork for local development:: $ cd fhir.resources/ $ pipenv install --dev 4. Create a branch for local development:: $ git checkout -b name-of-your-bugfix-or-feature Now you can make your changes locally. 5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox:: $ flake8 fhir.resources tests $ python setup.py test or py.test $ tox To get flake8 and tox, just pip install them into your virtualenv. 6. Commit your changes and push your branch to GitHub:: $ git add . $ git commit -m "Your detailed description of your changes." $ git push origin name-of-your-bugfix-or-feature 7. Submit a pull request through the GitHub website. Pull Request Guidelines ----------------------- Before you submit a pull request, check that it meets these guidelines: 1. The pull request should include tests. 2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.rst. 3. The pull request should work for Python 2.7, 3.4, 3.5 and 3.6, and for PyPy. Check https://travis-ci.org/nazrulworld/fhir.resources/pull_requests and make sure that the tests pass for all supported Python versions. Tips ---- To run a subset of tests:: $ py.test tests.test_fhir.resources Deploying --------- A reminder for the maintainers on how to deploy. Make sure all your changes are committed (including an entry in HISTORY.rst). Then run:: $ bumpversion patch # possible: major / minor / patch $ git push $ git push --tags Travis will then deploy to PyPI if tests pass. Adding a new resource --------------------- Adding a new resource should be done under the relevant directory. For R4, the directory is `fhir/resources/` and for DSTU2 and STU3 the directories are `fhir/resources/DSTU2/` and `fhir/resources/STU3/`. After adding you resource, you need to add it to couple of additional places: 1. `fhirtypes.py` in the FHIR version your resource belongs to. This includes both the resource and the inner elements you created for it. 2. Add relevant entries inside the list `MODEL_CLASSES` at `fhirtypesvalidators.py`. Probably you will need to add `(None, .your_resource_module_name)`. 3. Add validator functions in `fhirtypesvalidators.py` for both your resource and the inner resources you created. 4. Add the validator methods you created to the list at the bottom of the file. Lastly, add your tests into the `tests` directory inside the relevant directory where you created your resource. ================================================ FILE: HISTORY.rst ================================================ ======= History ======= 8.2.1 (unreleased) ------------------ - Nothing changed yet. 8.2.0 (2026-02-02) ------------------ - Type aliases are added for all types during type checking. [mschoettle] - Minimum requirement for ``fhir-core`` version is now ``1.1.5`` which naturally comes with some bug fixes. See here https://github.com/nazrulworld/fhir-core/blob/main/HISTORY.rst#115-2026-01-29 8.1.0 (2025-07-10) ------------------ New features - Issue #181 ``summary`` (https://www.hl7.org/fhir/search.html#_summary) mode feature added. Fixes - Issue #184 pyright struggles with default position args. - Issue #186 missing py.typed marker, causing mypy import errors. - Issue #183 Pydantic 2.11+ Deprecation Warnings: model_fields Should Be Accessed on Class, Not Instance. 8.0.0 (2024-12-25) ------------------ - The minimum required version for ``fhir-core`` is ``1.0.0``, which obviously comes with new features and bug fixes. For example xml serialization/deserialization. `See changes log here `_ - Issue #168 https://github.com/nazrulworld/fhir.resources/issues/166 8.0.0b4 (2024-10-24) -------------------- - `PR#160 `_ switch the type of Element.id from id to string for R4B [cybernop] 8.0.0b3 (2024-10-10) -------------------- - Minimum version of ``fhir-core`` package have been updated. - All of fhir resources are regenerated for to comply with the optionality of fhir model's field. Issue https://github.com/nazrulworld/fhir.resources/issues/164 8.0.0b2 (2024-10-02) -------------------- - `Issue #164 `_ ``get_fhir_model_class`` is now available and can be imported from base package. For example ``from fhir.resources import get_fhir_model_class`` or ``from fhir.resources.STU3 import get_fhir_model_class`` 8.0.0b1 (2024-08-05) -------------------- Breaking - Drop support for python 3.7 - FHIR DTU2 packages are no longer available. 7.1.0 (2023-12-14) ------------------ New features See migration guide. Breaking - Drop support for python 3.6. - Drop support for pydantic v1. - The function ``FHIRAbstractModel::add_root_validator`` is no longer available. Deprecations Some of functions from ``FHIRAbstractModel`` are deprecated to comply with Pydantic V2. Some are - ``FHIRAbstractModel::dict`` - ``FHIRAbstractModel::json`` - ``FHIRAbstractModel::parse_obj`` - ``FHIRAbstractModel::parse_raw``: no longer supports xml and yaml data. - ``FHIRAbstractModel::parse_file``: no longer supports xml and yaml file. Improvements - `Issue 133 `_ Pydantic 2.0 migration plan. It's not fully migration though, instead of using of Pydantic V1 API. - `Issue 144 `_ Parsing XML byte string MESH acknowledgment response. 7.0.2 (2023-07-03) ------------------ - `Issue 124 `_ on the wake of 2.x pydantic release, pydantic's max version restriction added. 7.0.1 (2023-05-29) ------------------ Fixes - Issue #128 `pkg_resources.declare_namespace deprecation `_ - Issue #129 `urn not supported in Url `_ 7.0.0 (2023-04-08) ------------------ New Feature - Support for `FHIR version R5 `_ has been added under root package. Breaking - All root resources (FHIR version R4B) are moved under sub-package ``R4B``. Have a look at the migration guide. 6.5.0 (2023-01-01) ------------------ Breaking - FHIR R4B release has been overlapped on current R4 as default release. See changes (Release R4B: May 28, 2022) http://hl7.org/fhir/R4B/history.html. More detail at http://hl7.org/fhir/R4B/diff.html Improvements - Issue #90 logging level downgraded from warning to debug. - Primitive `URL` type is now accepting the relative path without prefix "/". 6.4.0 (2022-05-11) ------------------ Bugfixes - Fix, primitive extension was not included if primitive field value is null. [nazrulworld] - Issue `#101 ElementDefinition.id typing is incorrect `_ Improvements - Issue `#97 `_ Now null value accepted as a member of String List. - Primitive DataType `Ùrl`` is now accepting relative path. Breaking - ``Element.id`` & ``Resource.id`` don't have any extension. See https://chat.fhir.org/#narrow/stream/179166-implementers/topic/Resource.2Eid.20and.20primitive.20extension. 6.2.2 (2022-04-02) ------------------ - Issue `#96 `_, fixes datetime's ISO format representation for YAML. [nazrulworld] 6.2.1 (2022-01-14) ------------------ - Issues `#89 `_ & `#90 `_ possible breaking for ``FHIRAbstractModel.dict`` (if pydnatic specific extra argument has been provided) is neutralized.[nazrulworld] 6.2.0 (2022-01-01) ------------------ Bugfixes - Issue #88 fixes typo mistake. Resource name const was wrong. [nazrulworld] 6.2.0b3 (2021-06-26) -------------------- New Feature - String type class is now configurable, it is possible to allow empty str value. Bugfixes - Issue #75 Remove "tests" from installed package. - Issue `#74 When are Falsy values evaluated as None? `_ - Fixes some issues for DSTU2 https://github.com/nazrulworld/fhir.resources/pull/71 & https://github.com/nazrulworld/fhir.resources/pull/70 [ItayGoren] 6.2.0b2 (2021-04-05) -------------------- New Feature - Parsing YAML file or string/bytes contents, now accept extra parameter ``loader`` class. - Parsing from XML file or string/bytes contents are now supported. With possible to provide xmlparser for schema validation purpose. Bugfixes - Added correct fhir version name into Primitive Type Base class for ``STU3`` and ``DSTU2``. 6.2.0b1 (2021-03-31) -------------------- New Feature - `Issue #47 `_ add YAML support. - `Issue #51 `_ Help on converting XML to FHIR format. - `Issue #63 `_ Now JSON output key's sequence is matching with original FHIR specification. Breaking - ``FHIRAbstractModel.json()`` and ``FHIRAbstractModel.dict()`` parameters signatures are more FHIR specific and additional parameters are removed (pydantic specific). Bugfixes - Added missing ``element_property`` field attribute for class ``FHIRPrimitiveExtension``. 6.1.0 (2021-02-13) ------------------ - Breaking/Fixes: `PR#48 `_ ``Resource.id`` type has been replaced with ``fhirtypes.Id`` from ``fhirtypes.String`` (only for R4) [ItayGoren] - Fixes: constraints regex for fhirtypes ``Id``, ``Code``, ``Integer``, ``Decimal``, ``UnsignedInt``, ``PositiveInt`` and so on. [nazrulworld] 6.0.0 (2020-12-17) ------------------ - Issue #21 Remaining resources are added. [iatechicken] 6.0.0b11 (2020-11-25) --------------------- - Fixes: wrong ``ClaimResponseAddItemAdjudicationType`` resource type name into ``DTSU2``. 6.0.0b10 (2020-11-15) --------------------- Improvements - ``FHIRAbstractModel::add_root_validator`` is more improved and practical with proper validation, more now possible provide class method as root validator. Bugfixes - `Issue #41 `_ pydantic.errors.ConfigError: duplicate validator function. 6.0.0b9 (2020-11-05) -------------------- Improvements - Now supports of ``simplejson`` is available automatically (depends on importable) along side with ``orjson`` and default ``json`` library. Order of json serializer available (orjson -> simplejson(as fallback) -> json(as default)). Breaking - ``orjson`` is not available by default, have to use extra_require ``orjson`` to available that. 6.0.0b8 (2020-11-02) -------------------- - ``pydantic`` minimum version has been set to ``1.7.2``. 6.0.0b7 (2020-10-31) -------------------- *If you face import error ``from pydantic.utils import ROOT_KEY``, please upgrade your pydnatic version to <1.7* Fixes - `Issue #39 `_ added compatibility with ``pydantic`` version between ``1.6.x`` and ``1.7.x`` [nazrulworld] Improvements - Issue #40 `Make fhir primitive element field optional if extension value is provided. `_ 6.0.0b6 (2020-10-24) -------------------- Improvements - ``FHIRAbstractModel::json`` now takes additional parameter ``return_bytes``, indicates json string would be bytes. [nazrulworld] - Issue#38 Add support for FHIR comments. As per suggestion of comments in json from `Grahame Grieve `_, now ``fhir_comments`` is accepted. [nazrulworld] - FHIR comments filter option is added in ``FHIRAbstractModel::json``, means it is possible to exclude any comments while generating json string by providing parameter ``exclude_comments`` value. [nazrulworld] - More FHIR DSTU2 resources have been added. [Itay Goren] 6.0.0b5 (2020-10-04) -------------------- Improvements - ``visionprescription`` and ``supplyrequest`` resources added for DSTU2 [iatechicken] Fixes - Issue #28 `'construct_fhir_element' change the given dict `_ 6.0.0b4 (2020-09-24) -------------------- Improvements - orjson_ supports have been available as default json ``dumps`` and ``loads`` for Model. - ``FHIRAbstractModel::get_json_encoder`` class method now available, which return pydantic compatible json encoder callable, can be used with any json serializer. - More DSTU2 FHIR Resources have added, https://github.com/nazrulworld/fhir.resources/issues/21. Thanks to [mmabey]. Fixes - Fixes URL validation in the case where a primitive type is used as URL (which is allowed in StructureDefinition). [simonvadee] - Fixes `Issue#19 `_ Getting validation errors that don't make sense. 6.0.0b3 (2020-08-07) -------------------- - ``FHIRAbstractModel::get_resource_type`` class method now available, which returning name of the resource. 6.0.0b2 (2020-07-09) -------------------- - ``FHIRAbstractModel::element_properties`` class method now available, which returning generator of ``ModelField``, those are elements of the resource. - Minor fixes on ``enum_values``. 6.0.0b1 (2020-07-05) -------------------- Revolutionary evolution has been made, now fully rewritten with modern python, underlying APIs (almost all) have been changed. Please have look at readme section, for howto. Improvements - Full support of FHIR `Extensibility `_ for `Primitive Data Types `_ Breaking - Drop support for python 2.7. 5.1.0 (2020-04-11) ------------------ Improvements - FHIR ``STU3`` release version upgraded from ``3.0.1`` to ``3.0.2``, Please find changes history here https://www.hl7.org/fhir/history.html. - FHIR ``R4`` release version upgraded from ``4.0.0`` to ``4.0.1``, find changes history here https://www.hl7.org/fhir/history.html. 5.0.1 (2019-07-18) ------------------ Bugfixes: - `Issue#5 `_ confusing error message "name 'self' is not defined" [nazrulworld] 5.0.0 (2019-06-08) ------------------ - Nothing but release stable version. 5.0.0b3 (2019-05-14) -------------------- New features - Isuue#1 `Add DSTU2 Support `_ 5.0.0b2 (2019-05-13) -------------------- Breaking or Improvments - ``elementProperties``: element now has extra property ``type_name``. Now format like ``(name, json_name, type, type_name, is_list, "of_many", not_optional)`` The ``type_name`` refers original type name (code) from FHIR Structure Definition and it would be very helpful while making fhir search, fhirpath navigator. 5.0.0b1 (2019-01-19) -------------------- New features - Implemented own build policy, now previous version of FHIR® resources are available as python sub-package. Build info - Default version is ``R4`` (see version info at `4.0.0b1 (2019-01-13)` section) - ``STU3`` (see version info at `3.0.1 (2019-01-13)` section) 4.0.0 (2019-01-14) ------------------ - see version info at ``4.0.0b1`` section. 4.0.0b1 (2019-01-13) -------------------- `Version Info (R4)`_ :: [FHIR] FhirVersion=4.0.0-a53ec6ee1b version=4.0.0 buildId=a53ec6ee1b date=20181227223754 3.0.1 (2019-01-13) ------------------ `Version Info (STU3)`_ :: [FHIR] FhirVersion=3.0.1.11917 version=3.0.1 revision=11917 date=20170419074443 .. _`Version Info (STU3)`: http://hl7.org/fhir/stu3/ .. _`Version Info (R4)`: http://hl7.org/fhir/R4/ ================================================ FILE: LICENSE ================================================ BSD License Copyright (c) 2019, Md Nazrul Islam All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: MANIFEST.in ================================================ graft fhir prune fhir/resources/tests prune fhir/resources/STU3/tests prune fhir/resources/R4B/tests prune script prune tests prune .github prune fhir-parser include AUTHORS.rst include CONTRIBUTING.rst include HISTORY.rst include LICENSE include README.rst exclude tox.ini exclude Makefile exclude .editorconfig exclude .gitmodules exclude pyproject.toml .flake8 .isort.cfg appveyor.yml .python-version recursive-exclude * __pycache__ recursive-exclude * *.py[co] ================================================ FILE: Makefile ================================================ .PHONY: clean clean-test clean-pyc clean-build docs help .DEFAULT_GOAL := help define BROWSER_PYSCRIPT import os, webbrowser, sys try: from urllib import pathname2url except: from urllib.request import pathname2url webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1]))) endef export BROWSER_PYSCRIPT define PRINT_HELP_PYSCRIPT import re, sys for line in sys.stdin: match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line) if match: target, help = match.groups() print("%-20s %s" % (target, help)) endef export PRINT_HELP_PYSCRIPT BROWSER := python -c "$$BROWSER_PYSCRIPT" help: @python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST) clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts clean-build: ## remove build artifacts rm -fr build/ rm -fr dist/ rm -fr .eggs/ find . -name '*.egg-info' -exec rm -fr {} + find . -name '*.egg' -exec rm -f {} + clean-pyc: ## remove Python file artifacts find . -name '*.pyc' -exec rm -f {} + find . -name '*.pyo' -exec rm -f {} + find . -name '*~' -exec rm -f {} + find . -name '__pycache__' -exec rm -fr {} + clean-test: ## remove test and coverage artifacts rm -fr .tox/ rm -f .coverage rm -fr htmlcov/ rm -fr .pytest_cache lint: ## check style with flake8 flake8 --exclude=*/DSTU2/tests/* fhir/resources test: ## run tests quickly with the default Python pytest fhir/resources/tests test-all: ## run tests on every Python version with tox tox coverage: ## check code coverage quickly with the default Python coverage run --source fhir.resources -m pytest coverage report -m coverage html $(BROWSER) htmlcov/index.html release: dist ## package and upload a release twine upload dist/* dist: clean ## builds source and wheel package python setup.py sdist python setup.py bdist_wheel ls -l dist install: clean ## install the package to the active Python's site-packages python setup.py install generate-resources: cd script && python generate.py style-all: isort --multi-line=3 --trailing-comma --force-grid-wrap=0 --use-parentheses --line-width=88 -rc fhir/resources black --exclude 'fhir/resources/DSTU2/tests/' fhir/resources ================================================ FILE: README.rst ================================================ =============================== FHIR® Resources (R5, R4B, STU3) =============================== .. image:: https://img.shields.io/pypi/v/fhir.resources.svg :target: https://pypi.python.org/pypi/fhir.resources .. image:: https://img.shields.io/pypi/pyversions/fhir.resources.svg :target: https://pypi.python.org/pypi/fhir.resources :alt: Supported Python Versions .. image:: https://img.shields.io/travis/com/nazrulworld/fhir.resources.svg :target: https://app.travis-ci.com/github/nazrulworld/fhir.resources .. image:: https://ci.appveyor.com/api/projects/status/0qu5vyue1jwxb4km?svg=true :target: https://ci.appveyor.com/project/nazrulworld/fhir-resources :alt: Windows Build .. image:: https://codecov.io/gh/nazrulworld/fhir.resources/branch/master/graph/badge.svg :target: https://codecov.io/gh/nazrulworld/fhir.resources .. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/psf/black .. image:: https://static.pepy.tech/personalized-badge/fhir-resources?period=total&units=international_system&left_color=black&right_color=green&left_text=Downloads :target: https://pepy.tech/project/fhir-resources :alt: Downloads .. image:: https://www.hl7.org/fhir/assets/images/fhir-logo-www.png :target: https://www.hl7.org/implement/standards/product_brief.cfm?product_id=449 :alt: HL7® FHIR® FHIR_ (Fast Healthcare Interoperability Resources) is a specification for exchanging healthcare information electronically. It is designed to facilitate the exchange of data between different healthcare systems and applications, and is commonly used to build APIs (Application Programming Interfaces) for healthcare data. It is based on modern web technologies, and is designed to be easy to use and implement. It uses a modular approach, with a set of "resources" that represent different types of healthcare data (such as patients, observations, and diagnoses). These resources can be combined and extended as needed to support a wide range of healthcare use cases. This "fhir.resources" package is powered by pydantic_ V2, so it become faster in performance. Obviously it is written in modern python and has data validation built-in. It provides tools and classes for all of the `FHIR Resources `_ defined in the FHIR specification, and allows you to create and manipulate FHIR resources in Python. You can then use these resources to build FHIR-based APIs or to work with FHIR data in other ways. * Easy to construct, easy to extended validation, easy to export. * By inheriting behaviour from pydantic_, compatible with `ORM `_. * Full support of FHIR® Extensibility for Primitive Data Types are available. * Previous release of FHIR® Resources are available. * Free software: BSD license **Experimental XML and YAML serialization and deserialization supports. See [Advanced Usages] section!** FHIR® Version Info ------------------ FHIR® (Release R5, version 5.0.0) is available as default. Also previous versions are available as Python sub-package (each release name string becomes sub-package name, i.e ``R4B`` ). From ``fhir.resources`` version 7.0.0; there is no FHIR ``R4`` instead of ``R4B`` is available as sub-package. **Available Previous Versions**: * ``R4B`` (4.3.0) * ``STU3`` (3.0.2) Installation ------------ Just a simple ``pip install fhir.resources`` is enough. But if you want development version, just clone from https://github.com/nazrulworld/fhir.resources and ``pip install -e .[dev]``. Usages ------ **Example: 1**: This example creates a new Organization resource with some of its attributes (id, active, name, address):: >>> from fhir.resources.organization import Organization >>> from fhir.resources.address import Address >>> data = { ... "id": "f001", ... "active": True, ... "name": "Acme Corporation", ... "address": [{"country": "Switzerland"}] ... } >>> org = Organization(**data) >>> org.get_resource_type() == "Organization" True >>> isinstance(org.address[0], Address) True >>> org.address[0].country == "Switzerland" True >>> org.model_dump()['active'] is True True **Example: 2**: This example creates a new Organization resource from json string:: >>> from fhir.resources.organization import Organization >>> from fhir.resources.address import Address >>> json_str = '''{"resourceType": "Organization", ... "id": "f001", ... "active": True, ... "name": "Acme Corporation", ... "address": [{"country": "Switzerland"}] ... }''' >>> org = Organization.model_validate_json(json_str) >>> isinstance(org.address[0], Address) True >>> org.address[0].country == "Switzerland" True >>> org.dict()['active'] is True True **Example: 3**: This example creates a new Patient resource from json object(py dict):: >>> from fhir.resources.patient import Patient >>> from fhir.resources.humanname import HumanName >>> from datetime import date >>> json_obj = {"resourceType": "Patient", ... "id": "p001", ... "active": True, ... "name": [ ... {"text": "Adam Smith"} ... ], ... "birthDate": "1985-06-12" ... } >>> pat = Patient.model_validate(json_obj) >>> isinstance(pat.name[0], HumanName) True >>> pat.birthDate == date(year=1985, month=6, day=12) True >>> pat.active is True True **Example: 4**: This example creates a new Patient resource from json file:: >>> from fhir.resources.patient import Patient >>> import os >>> import pathlib >>> filename = pathlib.Path("foo/bar.json") >>> pat = Patient.model_validate_json(filename.read_bytes()) >>> pat.get_resource_type() == "Patient" True **Example: 5**: This example creates a new Organization resource in python way:: >>> from fhir.resources.organization import Organization >>> from fhir.resources.address import Address >>> json_obj = {"resourceType": "Organization", ... "id": "f001", ... "active": True, ... "name": "Acme Corporation", ... "address": [{"country": "Switzerland"}] ... } >>> org = Organization.model_construct() >>> org.id = "f001" >>> org.active = True >>> org.name = "Acme Corporation" >>> org.address = list() >>> address = Address.model_construct() >>> address.country = "Switzerland" >>> org.address.append(address) >>> org.model_dump() == json_obj True .. note:: Please note that due to the way the validation works, you will run into issues if you are using ``model_construct()`` to create resources that have more than one mandatory field. See `this comment in issue#56 `_ for details. **Example: 5**: Auto validation while providing wrong datatype:: >>> try: ... org = Organization({"id": "fmk", "address": ["i am wrong type"]}) ... raise AssertionError("Code should not come here") ... except ValueError: ... pass Advanced Usages --------------- FHIR Comments (JSON) ~~~~~~~~~~~~~~~~~~~~ It is possible to add comments inside json like xml, but need to follow some convention, what is suggested by `Grahame Grieve `_; is implemented here. Also it is possible to generate json string output without comments. Examples:: >>> observation_str = b"""{ ... "resourceType": "Observation", ... "id": "f001", ... "fhir_comments": [ ... " a specimen identifier - e.g. assigned when the specimen was taken by the orderer/placer use the accession number for the filling lab ", ... " Placer ID " ... ], ... "text": { ... "fhir_comments": [ ... " a specimen identifier - e.g. assigned when the specimen was taken by the orderer/placer use the accession number for the filling lab ", ... " Placer ID " ... ], ... "status": "generated", ... "div": "
.........
" ... }, ... "identifier": [ ... { ... "use": "official", ... "system": "http://www.bmc.nl/zorgportal/identifiers/observations", ... "value": "6323" ... } ... ], ... "status": "final", ... "_status": { ... "fhir_comments": [ ... " EH: Note to balloters - lots of choices for whole blood I chose this. " ... ] ... }, ... "code": { ... "coding": [ ... { ... "system": "http://loinc.org", ... "code": "15074-8", ... "display": "Glucose [Moles/volume] in Blood" ... } ... ] ... }, ... "subject": { ... "reference": "Patient/f001", ... "display": "P. van de Heuvel" ... }, ... "effectivePeriod": { ... "start": "2013-04-02T09:30:10+01:00" ... }, ... "issued": "2013-04-03T15:30:10+01:00", ... "performer": [ ... { ... "reference": "Practitioner/f005", ... "display": "A. Langeveld" ... } ... ], ... "valueQuantity": { ... "value": 6.3, ... "unit": "mmol/l", ... "system": "http://unitsofmeasure.org", ... "code": "mmol/L" ... }, ... "interpretation": [ ... { ... "coding": [ ... { ... "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", ... "code": "H", ... "display": "High" ... } ... ] ... } ... ], ... "referenceRange": [ ... { ... "low": { ... "value": 3.1, ... "unit": "mmol/l", ... "system": "http://unitsofmeasure.org", ... "code": "mmol/L" ... }, ... "high": { ... "value": 6.2, ... "unit": "mmol/l", ... "system": "http://unitsofmeasure.org", ... "code": "mmol/L" ... } ... } ... ] ... }""" >>> from fhir.resources.observation import Observation >>> obj = Observation.model_validate_json(observation_str) >>> "fhir_comments" in obj.model_dump_json() >>> # Test comments filtering >>> "fhir_comments" not in obj.model_dump_json(exclude_comments=True) Special Case: Missing data ~~~~~~~~~~~~~~~~~~~~~~~~~~ `In some cases `_, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. Example (required ``intent`` element is missing but still valid because of extension):: >>> json_str = b"""{ ... "resourceType": "MedicationRequest", ... "id": "1620518", ... "meta": { ... "versionId": "1", ... "lastUpdated": "2020-10-27T11:04:42.215+00:00", ... "source": "#z072VeAlQWM94jpc", ... "tag": [ ... { ... "system": "http://www.alpha.alp/use-case", ... "code": "EX20" ... } ... ] ... }, ... "status": "completed", ... "_intent": { ... "extension": [ ... { ... "url": "http://hl7.org/fhir/StructureDefinition/data-absent-reason", ... "valueCode": "unknown" ... } ... ] ... }, ... "medicationReference": { ... "reference": "Medication/1620516", ... "display": "Erythromycin 250 MG Oral Tablet" ... }, ... "subject": { ... "reference": "Patient/1620472" ... }, ... "encounter": { ... "reference": "Encounter/1620506", ... "display": "Follow up encounter" ... }, ... "authoredOn": "2018-06-16", ... "requester": { ... "reference": "Practitioner/1620502", ... "display": "Dr. Harold Hippocrates" ... }, ... "reasonReference": [ ... { ... "reference": "Condition/1620514", ... "display": "Otitis Media" ... } ... ], ... "dosageInstruction": [ ... { ... "text": "250 mg 4 times per day for 10 days", ... "timing": { ... "repeat": { ... "boundsDuration": { ... "value": 10, ... "unit": "day", ... "system": "http://unitsofmeasure.org", ... "code": "d" ... }, ... "frequency": 4, ... "period": 1, ... "periodUnit": "d" ... } ... }, ... "doseAndRate": [ ... { ... "doseQuantity": { ... "value": 250, ... "unit": "mg", ... "system": "http://unitsofmeasure.org", ... "code": "mg" ... } ... } ... ] ... } ... ], ... "priorPrescription": { ... "reference": "MedicationRequest/1620517", ... "display": "Amoxicillin prescription" ... } ... }""" >>> from fhir.resources.medicationrequest import MedicationRequest >>> obj = MedicationRequest.model_validate_json(json_str) >>> "intent" not in obj.model_dump() Custom Validators ~~~~~~~~~~~~~~~~~ **This feature is not available** ``fhir.resources`` is providing the extensive API to create and attach custom validator into any model. See more `about root validator `_ Some convention you have to follow though, while creating a root validator. 1. Number of arguments are fixed, as well as names are also. i.e ``(cls, values)``. 2. Should return ``values``, unless any exception need to be raised. 3. Validator should be attached only one time for individual Model. Update [from now, it's not possible to attach multiple time same name validator on same class] Example 1: Validator for Patient:: from typing import Dict from fhir.resources.patient import Patient import datetime def validate_birthdate(cls, values: Dict): if not values: return values if "birthDate" not in values: raise ValueError("Patient's ``birthDate`` is required.") minimum_date = datetime.date(2002, 1, 1) if values["birthDate"] > minimum_date: raise ValueError("Minimum 18 years patient is allowed to use this system.") return values # we want this validator to execute after data evaluating by individual field validators. Patient.add_root_validator(validate_gender, pre=False) Example 2: Validator for Patient from Validator Class:: from typing import Dict from fhir.resources.patient import Patient import datetime class MyValidator: @classmethod def validate_birthdate(cls, values: Dict): if not values: return values if "birthDate" not in values: raise ValueError("Patient's ``birthDate`` is required.") minimum_date = datetime.date(2002, 1, 1) if values["birthDate"] > minimum_date: raise ValueError("Minimum 18 years patient is allowed to use this system.") return values # we want this validator to execute after data evaluating by individual field validators. Patient.add_root_validator(MyValidator.validate_gender, pre=False) **important notes** It is possible add root validator into any base class like ``DomainResource``. In this case you have to make sure root validator is attached before any import of derived class, other than validator will not trigger for successor class (if imported before) by nature. ENUM Validator ~~~~~~~~~~~~~~ ``fhir.resources`` is providing API for enum constraint for each field (where applicable), but it-self doesn't enforce enum based validation! see `discussion here `_. If you want to enforce enum constraint, you have to create a validator for that. Example: Gender Enum:: from typing import Dict from fhir.resources.patient import Patient def validate_gender(cls, values: Dict): if not values: return values enums = cls.model_fields["gender"].json_schema_extra["enum_values"] if "gender" in values and values["gender"] not in enums: raise ValueError("write your message") return values Patient.add_root_validator(validate_gender, pre=True) Reference Validator ~~~~~~~~~~~~~~~~~~~ ``fhir.resources`` is also providing enum like list of permitted resource types through json_schema_extra ``enum_reference_types``. You can get that list by following above (Enum) approaches ``resource_types = cls.model_fields["managingOrganization"].json_schema_extra["enum_reference_types"]`` pydantic_ Field Type Support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ All available fhir resources (types) can be use as pydantic_'s Field's value types. See issue#46 `Support for FastAPI pydantic response models `_. The module ``fhirtypes.py`` contains all fhir resources related types and should trigger validator automatically. ``Resource.id aka fhirtypes.Id`` constraint extensibility ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There are a lots of discussion here here i.) https://bit.ly/360HksL ii.) https://bit.ly/3o1fZgl about the length of ``Resource.Id``'s value. Based on those discussions, we recommend that keep your ``Resource.Id`` size within 64 letters (for the seek of intercompatibility with third party system), but we are also providing freedom about the length of Id, in respect with others opinion that 64 chr length is not sufficient, so default length is now 255. But it is offering to customize as your own requirement by doing a monkey patch. Examples:: # ``patch.py`` >>> import importlib >>> from fhir_core import constraints >>> from fhir_core import types as ftypes >>> constraints.TYPES_ID_MAX_LENGTH = 64 >>> importlib.reload(ftypes) Note: when you will change that behaviour, that would impact into your whole project. XML Supports ~~~~~~~~~~~~ Along side with JSON string export, it is possible to export as XML string! Before using this feature, make sure associated dependent library is installed. Use ``fhir.resources[xml]`` or ``fhir.resources[all]`` as your project requirements. **XML schema validator!** It is possible to provide custom xmlparser, during load from file or string, meaning that you can validate data against FHIR xml schema(and/or your custom schema). Example-1 Export:: >>> from fhir.resources.patient import Patient >>> data = {"active": True, "gender": "male", "birthDate": "2000-09-18", "name": [{"text": "Primal Kons"}]} >>> patient_obj = Patient(**data) >>> xml_str = patient_obj.model_dump_xml(pretty_print=True) >>> print(xml_str) Example-2 Import from string:: >>> from fhir.resources.patient import Patient >>> data = {"active": True, "gender": "male", "birthDate": "2000-09-18", "name": [{"text": "Primal Kons"}]} >>> patient_obj = Patient(**data) >>> xml_str = patient_obj.model_dump_xml(pretty_print=True) >>> print(xml_str) >>> data = b""" ... ... ... ... ... ... ... ... """ >>> patient = Patient.model_validate_xml(data) >>> print(patient.model_dump_json(indent=2)) { "resourceType": "Patient", "active": true, "name": [ { "text": "Primal Kons", "family": "Kons", "given": [ "Primal" ] } ], "gender": "male", "birthDate": "2000-09-18" } >>> with xml parser >>> import lxml >>> from fhir_core.xml_utils import xml_loads >>> schema = lxml.etree.XMLSchema(file=str(FHIR_XSD_DIR / "patient.xsd")) >>> xmlparser = lxml.etree.XMLParser(schema=schema) >>> patient2 = xml_loads(Patient, data, xmlparser=xmlparser) >>> patient2 == patient True Example-3 Import from file:: >>> import pathlib >>> patient3 = Patient.model_validate_xml(pathlib.Path("Patient.xml").read_bytes()) >>> patient3 == patient and patient3 == patient2 True **XML FAQ** - Although generated XML is validated against ``FHIR/patient.xsd`` and ``FHIR/observation.xsd`` in tests, but we suggest you check output of your production data. - Comment feature is included, but we recommend you check in your complex usages. YAML Supports ~~~~~~~~~~~~~ Although there is no official support for YAML documented in FHIR specification, but as an experimental feature, we add this support. Now it is possible export/import YAML strings. Before using this feature, make sure associated dependent library is installed. Use ``fhir.resources[yaml]`` or ``fhir.resources[all]`` as your project requirements. Example-1 Export:: >>> from fhir.resources.patient import Patient >>> data = {"active": True, "gender": "male", "birthDate": "2000-09-18", "name": [{"text": "Primal Kons", "family": "Kons", "given": ["Primal"]}]} >>> patient_obj = Patient(**data) >>> yml_str = patient_obj.model_dump_yaml(indent=2) >>> print(yml_str) resourceType: Patient active: true name: - text: Primal Kons family: Kons given: - Primal gender: male birthDate: 2000-09-18 Example-2 Import from YAML string:: >>> from fhir.resources.patient import Patient >>> data = b""" ... resourceType: Patient ... active: true ... name: ... - text: Primal Kons ... family: Kons ... given: ... - Primal ... gender: male ... birthDate: 2000-09-18 ... """ >>> patient_obj = Patient.model_validate_yaml(data) >>> json_str = patient_obj.model_dump_json(indent=2) >>> print(json_str) { "resourceType": "Patient", "active": true, "name": [ { "text": "Primal Kons", "family": "Kons", "given": [ "Primal" ] } ], "gender": "male", "birthDate": "2000-09-18" } Example-3 Import from YAML file:: >>> import pathlib >>> from fhir.resources.patient import Patient >>> patient_obj = Patient.model_validate_yaml(pathlib.Path("Patient.yml").read_bytes()) >>> json_str = patient_obj.model_dump_json(indent=2) >>> print(json_str) { "resourceType": "Patient", "active": true, "name": [ { "text": "Primal Kons", "family": "Kons", "given": [ "Primal" ] } ], "gender": "male", "birthDate": "2000-09-18" } **YAML FAQ** - We are using https://pyyaml.org/ PyYAML library, for serialization/deserialization but if we find more faster library, we could use that. you are welcome to provide us your suggestion. - YAML based comments is not supported yet, instead json comments syntax is used! Of course this comment feature is in our todo list. Allow Empty String ~~~~~~~~~~~~~~~~~~ Although this is not good practice to allow empty string value against FHIR primitive data type ``String``. But we in real life scenario, is it unavoidable sometimes. Examples:: Place this code inside your __init__.py module or any place, just to make sure that this fragment of codes is runtime executed. >>> # ``__init__.py`` >>> import importlib >>> from fhir_core import constraints >>> from fhir_core import types as ftypes >>> constraints.TYPES_STRING_ALLOW_EMPTY_STR = True >>> importlib.reload(ftypes) FHIR ``summary`` search support ------------------------------- This package is providing supporting ´´summary mode´´ activated serialization, meaning that you will not need to do extra, if you are planning to support `summary search `_ Example:: >>> from fhir.resources.organization import Organization >>> json_str = '''{"resourceType": "Organization", ... "text": {"status": "generated", "div": "

summary example

"} ... "id": "f001", ... "active": True, ... "name": "Acme Corporation" ... }''' >>> org = Organization.model_validate_json(json_str) >>> summary_dict = org.model_dump(summary_only=True) >>> "text" not in summary_dict True >>> "active" in summary_dict True >>> "name" in summary_dict FHIR release R4B over R4 ------------------------ FHIR release R4B is coming with not that much changes over the release of R4. So we decided not to create separate sub-package for R4 like STU3, instead there just overlaps on existing R4. This also means that in future, when we will work on R5; there will be sub-package for R4B and no R4. We suggest you to try make a plan to be upgraded to R4B. Here you could find related information dealing-strategy-R4-R4B_. You could find full discussion here https://github.com/nazrulworld/fhir.resources/discussions/116 Migration (from ``7.X.X`` to ``8.X.X``) --------------------------------------- There is no breaking changes in terms of api/functions. But it is recommended that you should use new functions from Pydantic V2 instead of using deprecated functions. Replacements and/or new functions. - From ``FHIRAbstractModel::dict`` to ``FHIRAbstractModel::model_dump`` - From ``FHIRAbstractModel::json`` to ``FHIRAbstractModel::model_dump_json`` - From ``FHIRAbstractModel::yaml`` to ``FHIRAbstractModel::model_dump_yaml`` - From ``FHIRAbstractModel::xml`` to ``FHIRAbstractModel::model_dump_xml`` - From ``FHIRAbstractModel::parse_obj`` to ``FHIRAbstractModel::model_validate`` - From ``FHIRAbstractModel::parse_raw`` to ``FHIRAbstractModel::model_validate_json`` - From ``FHIRAbstractModel::parse_file`` to no replacement, we suggest you use pathlib (see examples) - ``FHIRAbstractModel::model_validate_yaml`` parse YAML string to FHIRAbstractModel. - ``FHIRAbstractModel::model_validate_xml`` parse XML string to FHIRAbstractModel. Breaking: removed attributes and/or functions/methods. - The attribute ``resource_type`` has been removed from base FHIR class. For example no more ``Resource.resource_type`` attribute. Now you have to use Resource.get_resource_type() instead. Although "resource_type" key is available when you will serialize as json or python dict. Migration (from ``6.X.X`` to ``7.0.X``) --------------------------------------- First of all, you have to correct all imports path, if you wish to keep continue using FHIR release R4B or R4, as those resources are moved under sub-package named ``R4B``. Then if you wish to use current ``R5`` release, read carefully the following documents. 1. See the full changes history -> https://build.fhir.org/history.html 2. See complete lists of differences between R5 and R4B -> https://hl7.org/fhir/R5/diff.html 3. If you are planning to migrate direct from the release ``R4``, then it is important to look at the differences between R4B and R4 here -> https://hl7.org/fhir/R4B/diff.html Migration (from later than ``6.X.X``) ------------------------------------- This migration guide states some underlying changes of ``API`` and replacement, those are commonly used from later than ``6.X.X`` version. ``fhir.resources.fhirelementfactory.FHIRElementFactory::instantiate`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **Replacement:** ``fhir.resources.construct_fhir_element`` - First parameter value is same as previous, the Resource name. - Second parameter is more flexible than previous! it is possible to provide not only json ``dict`` but also json string or json file path. - No third parameter, what was in previous version. ``fhir.resources.fhirabstractbase.FHIRAbstractBase::__init__`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **Replacement:** ``fhir.resources.fhirabstractmodel.FHIRAbstractModel::parse_obj`` - First parameter value is same as previous, json dict. - No second parameter, what was in previous version. ``fhir.resources.fhirabstractbase.FHIRAbstractBase::as_json`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **Replacement:** ``fhir.resources.fhirabstractmodel.FHIRAbstractModel::dict`` - Output are almost same previous, but there has some difference in case of some date type, for example py date, datetime, Decimal are in object representation. - It is possible to use ``fhir.resources.fhirabstractmodel.FHIRAbstractModel::json`` as replacement, when json string is required (so not need further, json dumps from dict) Note: All resources/classes are derived from ``fhir.resources.fhirabstractmodel.FHIRAbstractModel`` what was previously from ``fhir.resources.fhirabstractbase.FHIRAbstractBase``. Release and Version Policy -------------------------- Starting from version ``5.0.0`` we are following our own release policy and we although follow Semantic Versioning scheme like FHIR® version. Unlike previous statement (below), releasing now is not dependent on FHIR®. **removed statement** This package is following `FHIR® release and versioning policy `_, for example say, FHIR releases next version 4.0.1, we also release same version here. Credits ------- All FHIR® Resources (python classes) are generated using fhir-parser_ which is forked from https://github.com/smart-on-fhir/fhir-parser.git. This package skeleton was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template. .. _Cookiecutter: https://github.com/audreyr/cookiecutter .. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage .. _`fhir-parser`: https://github.com/nazrulworld/fhir-parser .. _`pydantic`: https://pydantic-docs.helpmanual.io/ .. _`orjson`: https://pypi.org/project/orjson/ .. _`dealing-strategy-R4-R4B`: https://confluence.hl7.org/display/FHIR/Strategies+for+dealing+with+R4+and+R4B .. _`FHIR`: https://www.hl7.org/implement/standards/product_brief.cfm © Copyright HL7® logo, FHIR® logo and the flaming fire are registered trademarks owned by `Health Level Seven International `_ .. role:: strike :class: strike .. role:: raw-html(raw) :format: html ================================================ FILE: appveyor.yml ================================================ image: - Visual Studio 2022 matrix: allow_failures: - PYTHON: "C:\\Python312-x64" environment: matrix: - PYTHON: "C:\\Python38-x64" PYTHON_VERSION: "3.8.x" # currently 3.8.6 PYTHON_ARCH: "64" - PYTHON: "C:\\Python39-x64" PYTHON_VERSION: "3.9.x" # currently 3.9.0 PYTHON_ARCH: "64" - PYTHON: "C:\\Python310-x64" PYTHON_VERSION: "3.10.x" # currently 3.10.13 PYTHON_ARCH: "64" - PYTHON: "C:\\Python311-x64" PYTHON_VERSION: "3.11.x" # currently 3.11.9 PYTHON_ARCH: "64" - PYTHON: "C:\\Python312-x64" PYTHON_VERSION: "3.12.x" # currently 3.12.3 PYTHON_ARCH: "64" install: # If there is a newer build queued for the same PR, cancel this one. # The AppVeyor 'rollout builds' option is supposed to serve the same # purpose but it is problematic because it tends to cancel builds pushed # directly to master instead of just PR builds (or the converse). # credits: JuliaLang developers. - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` throw "There are newer queued builds for this pull request, failing early." } - ECHO "Filesystem root:" - ps: "ls \"C:/\"" - ECHO "Installed SDKs:" - ps: "ls \"C:/Program Files/Microsoft SDKs/Azure\"" # Prepend newly installed Python to the PATH of this build (this cannot be # done from inside the powershell script as it would require to restart # the parent CMD process). - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" # Check that we have the expected version and architecture for Python - "python --version" - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" # Upgrade to the latest version of pip to avoid it displaying warnings # about it being out of date. - "python -m pip install --upgrade pip wheel" # Install the build dependencies of the project. If some dependencies contain # compiled extensions and are not provided as pre-built wheel packages, # pip will build them from source using the MSVC compiler matching the # target Python version and architecture - "pip install -e .[test]" - "pip install codecov" build_script: # Build the compiled extension - "python setup.py build" test_script: # Run the project tests and store results in .xml log - "pytest fhir/resources/STU3/tests" - "pytest fhir/resources/R4B/tests" - "pytest fhir/resources/tests" after_test: # If tests are successful, create binary packages for the project. - "python setup.py bdist_wheel" - ps: "ls dist" artifacts: # Archive the generated packages in the ci.appveyor.com build report. - path: dist\* #on_success: # - TODO: upload the content of dist/*.whl to a public wheelhouse # # on_finish: # Upload test results to AppVeyor ================================================ FILE: fhir/__init__.py ================================================ ================================================ FILE: fhir/resources/R4B/__init__.py ================================================ from __future__ import annotations as _annotations from functools import lru_cache from typing import TYPE_CHECKING, cast from fhir_core.fhirabstractmodel import FHIRAbstractModel __author__ = "Md Nazrul Islam" __email__ = "email2nazrul@gmail.com" __fhir_version__ = "4.3.0" @lru_cache(maxsize=None, typed=True) def get_fhir_model_class(model_name: str) -> type[FHIRAbstractModel]: """ """ from . import fhirtypes as ft try: model_type = getattr(ft, model_name + "Type") if TYPE_CHECKING: from fhir_core.types import FhirBase model_type = cast(type[FhirBase], model_type) return model_type.get_model_klass() except AttributeError: raise ValueError(f"{model_name} is not a valid FHIR Model") ================================================ FILE: fhir/resources/R4B/account.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Account Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Account(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Tracks balance, charges, for patient or cost center. A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centers, etc. """ __resource_type__ = "Account" coverage: typing.List[fhirtypes.AccountCoverageType] | None = Field( default=None, alias="coverage", title=( "The party(s) that are responsible for covering the payment of this " "account, and what order should they be applied to the account" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Explanation of purpose/use", description=( "Provides additional information about what the account tracks and how " "it is used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) guarantor: typing.List[fhirtypes.AccountGuarantorType] | None = Field( default=None, alias="guarantor", title="The parties ultimately responsible for balancing the Account", description=( "The parties responsible for balancing the account if other payment " "options fall short." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Account number", description=( "Unique identifier used to reference the account. Might or might not " "be intended for human use (e.g. credit card number)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Human-readable label", description=( "Name used for the account when displaying it to humans in reports, " "etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) owner: fhirtypes.ReferenceType | None = Field( default=None, alias="owner", title="Entity managing the Account", description=( "Indicates the service area, hospital, department, etc. with " "responsibility for managing the Account." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) partOf: fhirtypes.ReferenceType | None = Field( default=None, alias="partOf", title="Reference to a parent Account", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Account"], }, ) servicePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="servicePeriod", title="Transaction window", description="The date range of services associated with this account.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | inactive | entered-in-error | on-hold | unknown", description="Indicates whether the account is presently used/usable or not.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "active", "inactive", "entered-in-error", "on-hold", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="subject", title="The entity that caused the expenses", description=( "Identifies the entity which incurs the expenses. While the immediate " "recipients of services or goods might be entities related to the " "subject, the expenses were ultimately incurred by the subject of the " "Account." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Device", "Practitioner", "PractitionerRole", "Location", "HealthcareService", "Organization", ], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="E.g. patient, expense, depreciation", description="Categorizes the account for reporting and searching purposes.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Account`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "type", "name", "subject", "servicePeriod", "coverage", "owner", "description", "guarantor", "partOf", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Account`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "type", "name", "subject", "servicePeriod", "coverage", "owner", "description", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class AccountCoverage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The party(s) that are responsible for covering the payment of this account, and what order should they be applied to the account. """ __resource_type__ = "AccountCoverage" coverage: fhirtypes.ReferenceType = Field( default=..., alias="coverage", title=( "The party(s), such as insurances, that may contribute to the payment " "of this account" ), description=( "The party(s) that contribute to payment (or part of) of the charges " "applied to this account (including self-pay). A coverage may only be " "responsible for specific types of charges, and the sequence of the " "coverages in the account could be important when processing billing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage"], }, ) priority: fhirtypes.PositiveIntType | None = Field( default=None, alias="priority", title="The priority of the coverage in the context of this account", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AccountCoverage`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "coverage", "priority"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AccountCoverage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "coverage", "priority"] class AccountGuarantor(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The parties ultimately responsible for balancing the Account. The parties responsible for balancing the account if other payment options fall short. """ __resource_type__ = "AccountGuarantor" onHold: bool | None = Field( default=None, alias="onHold", title="Credit or other hold applied", description=( "A guarantor may be placed on credit hold or otherwise have their role " "temporarily suspended." ), json_schema_extra={ "element_property": True, }, ) onHold__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onHold", title="Extension field for ``onHold``." ) party: fhirtypes.ReferenceType = Field( default=..., alias="party", title="Responsible entity", description="The entity who is responsible.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "RelatedPerson", "Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Guarantee account during", description=( "The timeframe during which the guarantor accepts responsibility for " "the account." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AccountGuarantor`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "party", "onHold", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AccountGuarantor`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/activitydefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ActivityDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ActivityDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The definition of a specific activity to be taken, independent of any particular patient or context. This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context. """ __resource_type__ = "ActivityDefinition" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the activity definition was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the content", description=( "An individiual or organization primarily involved in the creation and " "maintenance of the content." ), json_schema_extra={ "element_property": True, }, ) bodySite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="bodySite", title="What part of body to perform on", description=( "Indicates the sites on the subject's body where the procedure should " "be performed (I.e. the target sites)." ), json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Detail type of activity", description=( "Detailed description of the type of activity; e.g. What lab test, what" " procedure, what kind of encounter." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the activity definition and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the activity definition." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the activity definition was " "published. The date must change when the business version changes and " "it must change if the status code changes. In addition, it should " "change when the substantive content of the activity definition " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the activity definition", description=( "A free text natural language description of the activity definition " "from a consumer's perspective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) doNotPerform: bool | None = Field( default=None, alias="doNotPerform", title="True if the activity should not be performed", description=( "Set this to true if the definition is to indicate that a particular " "activity should NOT be performed. If true, this element should be " "interpreted to reinforce a negative coding. For example NPO as a code " "with a doNotPerform of true would still indicate to NOT perform the " "action." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doNotPerform", title="Extension field for ``doNotPerform``.", ) dosage: typing.List[fhirtypes.DosageType] | None = Field( default=None, alias="dosage", title="Detailed dosage instructions", description=( "Provides detailed dosage instructions in the same way that they are " "described for MedicationRequest resources." ), json_schema_extra={ "element_property": True, }, ) dynamicValue: typing.List[ fhirtypes.ActivityDefinitionDynamicValueType ] | None = Field( default=None, alias="dynamicValue", title="Dynamic aspects of the definition", description=( "Dynamic values that will be evaluated to produce values for elements " "of the resulting resource. For example, if the dosage of a medication " "must be computed based on the patient's weight, a dynamic value would " "be used to specify an expression that calculated the weight, and the " "path on the request resource that would contain the result." ), json_schema_extra={ "element_property": True, }, ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the content", description=( "An individual or organization primarily responsible for internal " "coherence of the content." ), json_schema_extra={ "element_property": True, }, ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the activity definition is expected to be used", description=( "The period during which the activity definition content was or is " "planned to be in active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the content", description=( "An individual or organization responsible for officially endorsing the" " content for use in some setting." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this activity definition is authored " "for testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the activity definition", description=( "A formal identifier that is used to identify this activity definition " "when it is represented in other formats, or referenced in a " "specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) intent: fhirtypes.CodeType | None = Field( default=None, alias="intent", title=( "proposal | plan | directive | order | original-order | reflex-order | " "filler-order | instance-order | option" ), description=( "Indicates the level of authority/intentionality associated with the " "activity and where the request should fit into the workflow chain." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "proposal", "plan", "directive", "order", "original-order", "reflex-order", "filler-order", "instance-order", "option", ], }, ) intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intent", title="Extension field for ``intent``." ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for activity definition (if applicable)", description=( "A legal or geographic region in which the activity definition is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title="Kind of resource", description=( "A description of the kind of resource the activity definition is " "representing. For example, a MedicationRequest, a ServiceRequest, or a" " CommunicationRequest. Typically, but not always, this is a Request " "resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the activity definition was last reviewed", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) library: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="library", title="Logic used by the activity definition", description=( "A reference to a Library resource containing any formal logic used by " "the activity definition." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Library"], }, ) library__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_library", title="Extension field for ``library``." ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where it should happen", description=( "Identifies the facility where the activity will occur; e.g. home, " "hospital, specific clinic, etc." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this activity definition (computer friendly)", description=( "A natural language name identifying the activity definition. This name" " should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) observationRequirement: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="observationRequirement", title="What observations are required to perform this action", description=( "Defines observation requirements for the action to be performed, such " "as body weight or surface area." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) observationResultRequirement: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="observationResultRequirement", title="What observations must be produced by this action", description=( "Defines the observations that are expected to be produced by the " "action." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) participant: typing.List[ fhirtypes.ActivityDefinitionParticipantType ] | None = Field( default=None, alias="participant", title="Who should participate in the action", description="Indicates who should participate in performing the action described.", json_schema_extra={ "element_property": True, }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Indicates how quickly the activity should be addressed with respect " "to other requests." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) productCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productCodeableConcept", title="What's administered/supplied", description=( "Identifies the food, drug or other product being consumed or supplied " "in the activity." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e product[x] "one_of_many": "product", "one_of_many_required": False, }, ) productReference: fhirtypes.ReferenceType | None = Field( default=None, alias="productReference", title="What's administered/supplied", description=( "Identifies the food, drug or other product being consumed or supplied " "in the activity." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e product[x] "one_of_many": "product", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication", "Substance", "Ingredient"], }, ) profile: fhirtypes.CanonicalType | None = Field( default=None, alias="profile", title="What profile the resource needs to conform to", description=( "A profile to which the target of the activity definition is expected " "to conform." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the activity" " definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this activity definition is defined", description=( "Explanation of why this activity definition is needed and why it has " "been designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="How much is administered/consumed/supplied", description=( "Identifies the quantity expected to be consumed at once (per dose, per" " meal, etc.)." ), json_schema_extra={ "element_property": True, }, ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Additional documentation, citations, etc.", description=( "Related artifacts such as additional documentation, justification, or " "bibliographic references." ), json_schema_extra={ "element_property": True, }, ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the content", description=( "An individual or organization primarily responsible for review of some" " aspect of the content." ), json_schema_extra={ "element_property": True, }, ) specimenRequirement: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="specimenRequirement", title="What specimens are required to perform this action", description=( "Defines specimen requirements for the action to be performed, such as " "required specimens for a lab test." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SpecimenDefinition"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this activity definition. Enables tracking the life-" "cycle of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subjectCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="subjectCanonical", title="Type of individual the activity definition is intended for", description=( "A code, group definition, or canonical reference that describes or " "identifies the intended subject of the activity being defined. " "Canonical references are allowed to support the definition of " "protocols for drug and substance quality specifications, and is " "allowed to reference a MedicinalProductDefinition, " "SubstanceDefinition, AdministrableProductDefinition, " "ManufacturedItemDefinition, or PackagedProductDefinition resource." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, }, ) subjectCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subjectCanonical", title="Extension field for ``subjectCanonical``.", ) subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subjectCodeableConcept", title="Type of individual the activity definition is intended for", description=( "A code, group definition, or canonical reference that describes or " "identifies the intended subject of the activity being defined. " "Canonical references are allowed to support the definition of " "protocols for drug and substance quality specifications, and is " "allowed to reference a MedicinalProductDefinition, " "SubstanceDefinition, AdministrableProductDefinition, " "ManufacturedItemDefinition, or PackagedProductDefinition resource." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, }, ) subjectReference: fhirtypes.ReferenceType | None = Field( default=None, alias="subjectReference", title="Type of individual the activity definition is intended for", description=( "A code, group definition, or canonical reference that describes or " "identifies the intended subject of the activity being defined. " "Canonical references are allowed to support the definition of " "protocols for drug and substance quality specifications, and is " "allowed to reference a MedicinalProductDefinition, " "SubstanceDefinition, AdministrableProductDefinition, " "ManufacturedItemDefinition, or PackagedProductDefinition resource." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) subtitle: fhirtypes.StringType | None = Field( default=None, alias="subtitle", title="Subordinate title of the activity definition", description=( "An explanatory or alternate title for the activity definition giving " "additional information about its content." ), json_schema_extra={ "element_property": True, }, ) subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subtitle", title="Extension field for ``subtitle``." ) timingAge: fhirtypes.AgeType | None = Field( default=None, alias="timingAge", title="When activity is to occur", description=( "The period, timing or frequency upon which the described activity is " "to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="timingDateTime", title="When activity is to occur", description=( "The period, timing or frequency upon which the described activity is " "to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timingDateTime", title="Extension field for ``timingDateTime``.", ) timingDuration: fhirtypes.DurationType | None = Field( default=None, alias="timingDuration", title="When activity is to occur", description=( "The period, timing or frequency upon which the described activity is " "to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="timingPeriod", title="When activity is to occur", description=( "The period, timing or frequency upon which the described activity is " "to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingRange: fhirtypes.RangeType | None = Field( default=None, alias="timingRange", title="When activity is to occur", description=( "The period, timing or frequency upon which the described activity is " "to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingTiming: fhirtypes.TimingType | None = Field( default=None, alias="timingTiming", title="When activity is to occur", description=( "The period, timing or frequency upon which the described activity is " "to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this activity definition (human friendly)", description="A short, descriptive, user-friendly title for the activity definition.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) topic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="topic", title="E.g. Education, Treatment, Assessment, etc.", description=( "Descriptive topics related to the content of the activity. Topics " "provide a high-level categorization of the activity that can be useful" " for filtering and searching." ), json_schema_extra={ "element_property": True, }, ) transform: fhirtypes.CanonicalType | None = Field( default=None, alias="transform", title="Transform to apply the template", description=( "A reference to a StructureMap resource that defines a transform that " "can be executed to produce the intent resource using the " "ActivityDefinition instance as the input." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureMap"], }, ) transform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_transform", title="Extension field for ``transform``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this activity definition, represented as a " "URI (globally unique)" ), description=( "An absolute URI that is used to identify this activity definition when" " it is referenced in a specification, model, design or an instance; " "also called its canonical identifier. This SHOULD be globally unique " "and SHOULD be a literal address at which at which an authoritative " "instance of this activity definition is (or will be) published. This " "URL can be the target of a canonical reference. It SHALL remain the " "same when the activity definition is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) usage: fhirtypes.StringType | None = Field( default=None, alias="usage", title="Describes the clinical usage of the activity definition", description=( "A detailed description of how the activity definition is used from a " "clinical perspective." ), json_schema_extra={ "element_property": True, }, ) usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usage", title="Extension field for ``usage``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate activity definition instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the activity definition", description=( "The identifier that is used to identify this version of the activity " "definition when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the activity " "definition author and is not expected to be globally unique. For " "example, it might be a timestamp (e.g. yyyymmdd) if a managed version " "is not available. There is also no expectation that versions can be " "placed in a lexicographical sequence. To provide a version consistent " "with the Decision Support Service specification, use the format " "Major.Minor.Revision (e.g. 1.0.0). For more information on versioning " "knowledge assets, refer to the Decision Support Service specification." " Note that a version is required for non-experimental active assets." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ActivityDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "subtitle", "status", "experimental", "subjectCodeableConcept", "subjectReference", "subjectCanonical", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "usage", "copyright", "approvalDate", "lastReviewDate", "effectivePeriod", "topic", "author", "editor", "reviewer", "endorser", "relatedArtifact", "library", "kind", "profile", "code", "intent", "priority", "doNotPerform", "timingTiming", "timingDateTime", "timingAge", "timingPeriod", "timingRange", "timingDuration", "location", "participant", "productReference", "productCodeableConcept", "quantity", "dosage", "bodySite", "specimenRequirement", "observationRequirement", "observationResultRequirement", "transform", "dynamicValue", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ActivityDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "effectivePeriod", "kind", "code", "doNotPerform", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "product": ["productCodeableConcept", "productReference"], "subject": [ "subjectCanonical", "subjectCodeableConcept", "subjectReference", ], "timing": [ "timingAge", "timingDateTime", "timingDuration", "timingPeriod", "timingRange", "timingTiming", ], } return one_of_many_fields class ActivityDefinitionDynamicValue(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Dynamic aspects of the definition. Dynamic values that will be evaluated to produce values for elements of the resulting resource. For example, if the dosage of a medication must be computed based on the patient's weight, a dynamic value would be used to specify an expression that calculated the weight, and the path on the request resource that would contain the result. """ __resource_type__ = "ActivityDefinitionDynamicValue" expression: fhirtypes.ExpressionType = Field( default=..., alias="expression", title="An expression that provides the dynamic value for the customization", description="An expression specifying the value of the customized element.", json_schema_extra={ "element_property": True, }, ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="The path to the element to be set dynamically", description=( "The path to the element to be customized. This is the path on the " "resource that will hold the result of the calculation defined by the " "expression. The specified path SHALL be a FHIRPath resolveable on the " "specified target type of the ActivityDefinition, and SHALL consist " "only of identifiers, constant indexers, and a restricted subset of " "functions. The path is allowed to contain qualifiers (.) to traverse " "sub-elements, as well as indexers ([x]) to traverse multiple-" "cardinality sub-elements (see the [Simple FHIRPath " "Profile](fhirpath.html#simple) for full details)." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ActivityDefinitionDynamicValue`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "path", "expression"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ActivityDefinitionDynamicValue`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("path", "path__ext")] return required_fields class ActivityDefinitionParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who should participate in the action. Indicates who should participate in performing the action described. """ __resource_type__ = "ActivityDefinitionParticipant" role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="E.g. Nurse, Surgeon, Parent, etc.", description=( "The role the participant should play in performing the described " "action." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="patient | practitioner | related-person | device", description="The type of participant in the action.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["patient", "practitioner", "related-person", "device"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ActivityDefinitionParticipant`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "role"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ActivityDefinitionParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/address.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Address Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Address(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An address expressed using postal conventions (as opposed to GPS or other location definition formats). An address expressed using postal conventions (as opposed to GPS or other location definition formats). This data type may be used to convey addresses for use in delivering mail as well as for visiting locations which might not be valid for mail delivery. There are a variety of postal address formats defined around the world. """ __resource_type__ = "Address" city: fhirtypes.StringType | None = Field( default=None, alias="city", title="Name of city, town etc.", description=( "The name of the city, town, suburb, village or other community or " "delivery center." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) city__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_city", title="Extension field for ``city``." ) country: fhirtypes.StringType | None = Field( default=None, alias="country", title="Country (e.g. can be ISO 3166 2 or 3 letter code)", description="Country - a nation as commonly understood or generally accepted.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) country__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_country", title="Extension field for ``country``." ) district: fhirtypes.StringType | None = Field( default=None, alias="district", title="District name (aka county)", description="The name of the administrative area (county).", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) district__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_district", title="Extension field for ``district``." ) line: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="line", title="Street name, number, direction & P.O. Box etc.", description=( "This component contains the house number, apartment number, street " "name, street direction, P.O. Box number, delivery hints, and similar " "address information." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) line__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_line", title="Extension field for ``line``." ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period when address was/is in use", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) postalCode: fhirtypes.StringType | None = Field( default=None, alias="postalCode", title="Postal code for area", description="A postal code designating a region defined by the postal service.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) postalCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_postalCode", title="Extension field for ``postalCode``." ) state: fhirtypes.StringType | None = Field( default=None, alias="state", title="Sub-unit of country (abbreviations ok)", description=( "Sub-unit of a country with limited sovereignty in a federally " "organized country. A code may be used if codes are in common use (e.g." " US 2 letter state codes)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) state__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_state", title="Extension field for ``state``." ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Text representation of the address", description=( "Specifies the entire address as it should be displayed e.g. on a " "postal label. This may be provided instead of or as well as the " "specific parts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="postal | physical | both", description=( "Distinguishes between physical addresses (those you can visit) and " "mailing addresses (e.g. PO Boxes and care-of addresses). Most " "addresses are both." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["postal", "physical", "both"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="home | work | temp | old | billing - purpose of this address", description="The purpose of this address.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["home", "work", "temp", "old", "billing"], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Address`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "use", "type", "text", "line", "city", "district", "state", "postalCode", "country", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Address`` according to specification, with preserving the original sequence order. """ return [ "use", "type", "text", "line", "city", "district", "state", "postalCode", "country", "period", ] ================================================ FILE: fhir/resources/R4B/administrableproductdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/AdministrableProductDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class AdministrableProductDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A medicinal product in the final form, suitable for administration - after any mixing of multiple components. A medicinal product in the final form which is suitable for administering to a patient (after any mixing of multiple components, dissolution etc. has been performed). """ __resource_type__ = "AdministrableProductDefinition" administrableDoseForm: fhirtypes.CodeableConceptType | None = Field( default=None, alias="administrableDoseForm", title=( "The dose form of the final product after necessary reconstitution or " "processing" ), description=( "The dose form of the final product after necessary reconstitution or " "processing. Contrasts to the manufactured dose form (see " "ManufacturedItemDefinition). If the manufactured form was 'powder for " "solution for injection', the administrable dose form could be " "'solution for injection' (once mixed with another item having " "manufactured form 'solvent for solution for injection')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) device: fhirtypes.ReferenceType | None = Field( default=None, alias="device", title=( "A device that is integral to the medicinal product, in effect being " 'considered as an "ingredient" of the medicinal product' ), description=( "A device that is integral to the medicinal product, in effect being " 'considered as an "ingredient" of the medicinal product. This is not ' "intended for devices that are just co-packaged." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DeviceDefinition"], }, ) formOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="formOf", title=( "References a product from which one or more of the constituent parts " "of that product can be prepared and used as described by this " "administrable product" ), description=( "References a product from which one or more of the constituent parts " "of that product can be prepared and used as described by this " "administrable product. If this administrable product describes the " "administration of a crushed tablet, the 'formOf' would be the product " "representing a distribution containing tablets and possibly also a " "cream. This is distinct from the 'producedFrom' which refers to the " "specific components of the product that are used in this preparation, " "rather than the product as a whole." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicinalProductDefinition"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="An identifier for the administrable product", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ingredient: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="ingredient", title=( "The ingredients of this administrable medicinal product. This is only " "needed if the ingredients are not specified either using " "ManufacturedItemDefiniton, or using by incoming references from the " "Ingredient resource" ), description=( "The ingredients of this administrable medicinal product. This is only " "needed if the ingredients are not specified either using " "ManufacturedItemDefiniton (via " "AdministrableProductDefinition.producedFrom) to state which component " "items are used to make this, or using by incoming references from the " "Ingredient resource, to state in detail which substances exist within " "this. This element allows a basic coded ingredient to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) producedFrom: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="producedFrom", title=( "Indicates the specific manufactured items that are part of the " "'formOf' product that are used in the preparation of this specific " "administrable form" ), description=( "Indicates the specific manufactured items that are part of the " "'formOf' product that are used in the preparation of this specific " "administrable form. In some cases, an administrable form might use " "all of the items from the overall product (or there might only be one " "item), while in other cases, an administrable form might use only a " "subset of the items available in the overall product. For example, an" " administrable form might involve combining a liquid and a powder " "available as part of an overall product, but not involve applying the " "also supplied cream." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ManufacturedItemDefinition"], }, ) property: typing.List[ fhirtypes.AdministrableProductDefinitionPropertyType ] | None = Field( default=None, alias="property", title="Characteristics e.g. a product's onset of action", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) routeOfAdministration: typing.List[ fhirtypes.AdministrableProductDefinitionRouteOfAdministrationType ] = Field( default=..., alias="routeOfAdministration", title=( "The path by which the product is taken into or makes contact with the " "body" ), description=( "The path by which the product is taken into or makes contact with the " "body. In some regions this is referred to as the licenced or approved " "route. RouteOfAdministration cannot be used when the 'formOf' product " "already uses MedicinalProductDefinition.route (and vice versa)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this administrable product. Enables tracking the life-" "cycle of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) unitOfPresentation: fhirtypes.CodeableConceptType | None = Field( default=None, alias="unitOfPresentation", title=( "The presentation type in which this item is given to a patient. e.g. " "for a spray - 'puff'" ), description=( "The presentation type in which this item is given to a patient. e.g. " "for a spray - 'puff' (as in 'contains 100 mcg per puff'), or for a " "liquid - 'vial' (as in 'contains 5 ml per vial')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AdministrableProductDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "formOf", "administrableDoseForm", "unitOfPresentation", "producedFrom", "ingredient", "device", "property", "routeOfAdministration", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AdministrableProductDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "formOf", "administrableDoseForm", "unitOfPresentation", "producedFrom", "ingredient", "device", "property", "routeOfAdministration", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class AdministrableProductDefinitionProperty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Characteristics e.g. a product's onset of action. """ __resource_type__ = "AdministrableProductDefinitionProperty" status: fhirtypes.CodeableConceptType | None = Field( default=None, alias="status", title="The status of characteristic e.g. assigned or pending", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="A code expressing the type of characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AdministrableProductDefinitionProperty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueCodeableConcept", "valueQuantity", "valueDate", "valueBoolean", "valueAttachment", "status", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AdministrableProductDefinitionProperty`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "valueCodeableConcept", "valueQuantity", "valueDate", "valueBoolean", "valueAttachment", "status", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueBoolean", "valueCodeableConcept", "valueDate", "valueQuantity", ] } return one_of_many_fields class AdministrableProductDefinitionRouteOfAdministration( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The path by which the product is taken into or makes contact with the body. The path by which the product is taken into or makes contact with the body. In some regions this is referred to as the licenced or approved route. RouteOfAdministration cannot be used when the 'formOf' product already uses MedicinalProductDefinition.route (and vice versa). """ __resource_type__ = "AdministrableProductDefinitionRouteOfAdministration" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Coded expression for the route", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) firstDose: fhirtypes.QuantityType | None = Field( default=None, alias="firstDose", title=( "The first dose (dose quantity) administered can be specified for the " "product" ), description=( "The first dose (dose quantity) administered can be specified for the " "product, using a numerical value and its unit of measurement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maxDosePerDay: fhirtypes.QuantityType | None = Field( default=None, alias="maxDosePerDay", title="The maximum dose quantity to be administered in any one 24-h period", description=( "The maximum dose per day (maximum dose quantity to be administered in " "any one 24-h period) that can be administered." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maxDosePerTreatmentPeriod: fhirtypes.RatioType | None = Field( default=None, alias="maxDosePerTreatmentPeriod", title="The maximum dose per treatment period that can be administered", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maxSingleDose: fhirtypes.QuantityType | None = Field( default=None, alias="maxSingleDose", title="The maximum single dose that can be administered", description=( "The maximum single dose that can be administered, specified using a " "numerical value and its unit of measurement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maxTreatmentPeriod: fhirtypes.DurationType | None = Field( default=None, alias="maxTreatmentPeriod", title=( "The maximum treatment period during which the product can be " "administered" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) targetSpecies: typing.List[ fhirtypes.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesType ] | None = Field( default=None, alias="targetSpecies", title="A species for which this route applies", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AdministrableProductDefinitionRouteOfAdministration`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "firstDose", "maxSingleDose", "maxDosePerDay", "maxDosePerTreatmentPeriod", "maxTreatmentPeriod", "targetSpecies", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AdministrableProductDefinitionRouteOfAdministration`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "code", "firstDose", "maxSingleDose", "maxDosePerDay", "maxDosePerTreatmentPeriod", "maxTreatmentPeriod", "targetSpecies", ] class AdministrableProductDefinitionRouteOfAdministrationTargetSpecies( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A species for which this route applies. """ __resource_type__ = ( "AdministrableProductDefinitionRouteOfAdministrationTargetSpecies" ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Coded expression for the species", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) withdrawalPeriod: typing.List[ fhirtypes.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodType ] | None = Field( default=None, alias="withdrawalPeriod", title=( "A species specific time during which consumption of animal product is " "not appropriate" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AdministrableProductDefinitionRouteOfAdministrationTargetSpecies`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "withdrawalPeriod"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AdministrableProductDefinitionRouteOfAdministrationTargetSpecies`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "withdrawalPeriod"] class AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriod( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A species specific time during which consumption of animal product is not appropriate. """ __resource_type__ = "AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriod" supportingInformation: fhirtypes.StringType | None = Field( default=None, alias="supportingInformation", title="Extra information about the withdrawal period", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) supportingInformation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_supportingInformation", title="Extension field for ``supportingInformation``.", ) tissue: fhirtypes.CodeableConceptType = Field( default=..., alias="tissue", title=( "The type of tissue for which the withdrawal period applies, e.g. meat," " milk" ), description=( "Coded expression for the type of tissue for which the withdrawal " "period applies, e.g. meat, milk." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) value: fhirtypes.QuantityType = Field( default=..., alias="value", title="A value for the time", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriod`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "tissue", "value", "supportingInformation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriod`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "tissue", "value", "supportingInformation"] ================================================ FILE: fhir/resources/R4B/adverseevent.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/AdverseEvent Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class AdverseEvent(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Medical care, research study or other healthcare event causing physical injury. Actual or potential/avoided event causing unintended physical injury resulting from or contributed to by medical care, a research study or other healthcare setting factors that requires additional monitoring, treatment, or hospitalization, or that results in death. """ __resource_type__ = "AdverseEvent" actuality: fhirtypes.CodeType | None = Field( default=None, alias="actuality", title="actual | potential", description=( "Whether the event actually happened, or just had the potential to. " "Note that this is independent of whether anyone was affected or harmed" " or how severely." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["actual", "potential"], }, ) actuality__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_actuality", title="Extension field for ``actuality``." ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title=( "product-problem | product-quality | product-use-error | wrong-dose | " "incorrect-prescribing-information | wrong-technique | wrong-route-of-" "administration | wrong-rate | wrong-duration | wrong-time | expired-" "drug | medical-device-use-error | problem-different-manufacturer | " "unsafe-physical-environment" ), description="The overall type of event, intended for search and filtering purposes.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contributor: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="contributor", title="Who was involved in the adverse event or the potential adverse event", description=( "Parties that may or should contribute or have contributed information " "to the adverse event, which can consist of one or more activities. " "Such information includes information leading to the decision to " "perform the activity and how to perform the activity (e.g. " "consultant), information that the activity itself seeks to reveal " "(e.g. informant of clinical history), or information about what " "activity was performed (e.g. informant witness)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole", "Device"], }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When the event occurred", description="The date (and perhaps time) when the adverse event occurred.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) detected: fhirtypes.DateTimeType | None = Field( default=None, alias="detected", title="When the event was detected", description=( "Estimated or actual date the AdverseEvent began, in the opinion of the" " reporter." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) detected__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detected", title="Extension field for ``detected``." ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter created as part of", description=( "The Encounter during which AdverseEvent was created or to which the " "creation of this record is tightly associated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) event: fhirtypes.CodeableConceptType | None = Field( default=None, alias="event", title="Type of the event itself in relation to the subject", description=( "This element defines the specific type of event that occurred or that " "was prevented from occurring." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Business identifier for the event", description=( "Business identifiers assigned to this adverse event by the performer " "or other systems which remain constant as the resource is updated and " "propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Location where adverse event occurred", description="The information about where the adverse event occurred.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) outcome: fhirtypes.CodeableConceptType | None = Field( default=None, alias="outcome", title=( "resolved | recovering | ongoing | resolvedWithSequelae | fatal | " "unknown" ), description="Describes the type of outcome from the adverse event.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) recordedDate: fhirtypes.DateTimeType | None = Field( default=None, alias="recordedDate", title="When the event was recorded", description=( "The date on which the existence of the AdverseEvent was first " "recorded." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) recordedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recordedDate", title="Extension field for ``recordedDate``.", ) recorder: fhirtypes.ReferenceType | None = Field( default=None, alias="recorder", title="Who recorded the adverse event", description=( "Information on who recorded the adverse event. May be the patient or " "a practitioner." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", ], }, ) referenceDocument: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="referenceDocument", title="AdverseEvent.referenceDocument", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) resultingCondition: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="resultingCondition", title="Effect on the subject due to this event", description=( "Includes information about the reaction that occurred as a result of " "exposure to a substance (for example, a drug or a chemical)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) seriousness: fhirtypes.CodeableConceptType | None = Field( default=None, alias="seriousness", title="Seriousness of the event", description="Assessment whether this event was of real importance.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) severity: fhirtypes.CodeableConceptType | None = Field( default=None, alias="severity", title="mild | moderate | severe", description=( "Describes the severity of the adverse event, in relation to the " "subject. Contrast to AdverseEvent.seriousness - a severe rash might " "not be serious, but a mild heart problem is." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) study: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="study", title="AdverseEvent.study", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ResearchStudy"], }, ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Subject impacted by event", description="This subject or group impacted by the event.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Group", "Practitioner", "RelatedPerson", ], }, ) subjectMedicalHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="subjectMedicalHistory", title="AdverseEvent.subjectMedicalHistory", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "AllergyIntolerance", "FamilyMemberHistory", "Immunization", "Procedure", "Media", "DocumentReference", ], }, ) suspectEntity: typing.List[fhirtypes.AdverseEventSuspectEntityType] | None = Field( default=None, alias="suspectEntity", title="The suspected agent causing the adverse event", description=( "Describes the entity that is suspected to have caused the adverse " "event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AdverseEvent`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "actuality", "category", "event", "subject", "encounter", "date", "detected", "recordedDate", "resultingCondition", "location", "seriousness", "severity", "outcome", "recorder", "contributor", "suspectEntity", "subjectMedicalHistory", "referenceDocument", "study", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AdverseEvent`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "actuality", "category", "event", "subject", "encounter", "date", "detected", "recordedDate", "resultingCondition", "location", "seriousness", "severity", "outcome", "recorder", "contributor", "suspectEntity", "subjectMedicalHistory", "referenceDocument", "study", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("actuality", "actuality__ext")] return required_fields class AdverseEventSuspectEntity(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The suspected agent causing the adverse event. Describes the entity that is suspected to have caused the adverse event. """ __resource_type__ = "AdverseEventSuspectEntity" causality: typing.List[ fhirtypes.AdverseEventSuspectEntityCausalityType ] | None = Field( default=None, alias="causality", title="Information on the possible cause of the event", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instance: fhirtypes.ReferenceType = Field( default=..., alias="instance", title="Refers to the specific entity that caused the adverse event", description=( "Identifies the actual instance of what caused the adverse event. May " "be a substance, medication, medication administration, medication " "statement or a device." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Immunization", "Procedure", "Substance", "Medication", "MedicationAdministration", "MedicationStatement", "Device", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AdverseEventSuspectEntity`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "instance", "causality"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AdverseEventSuspectEntity`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "instance", "causality"] class AdverseEventSuspectEntityCausality(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information on the possible cause of the event. """ __resource_type__ = "AdverseEventSuspectEntityCausality" assessment: fhirtypes.CodeableConceptType | None = Field( default=None, alias="assessment", title="Assessment of if the entity caused the event", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="AdverseEvent.suspectEntity.causalityAuthor", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="ProbabilityScale | Bayesian | Checklist", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) productRelatedness: fhirtypes.StringType | None = Field( default=None, alias="productRelatedness", title="AdverseEvent.suspectEntity.causalityProductRelatedness", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) productRelatedness__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_productRelatedness", title="Extension field for ``productRelatedness``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AdverseEventSuspectEntityCausality`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "assessment", "productRelatedness", "author", "method", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AdverseEventSuspectEntityCausality`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "assessment", "productRelatedness", "author", "method", ] ================================================ FILE: fhir/resources/R4B/age.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Age Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from . import quantity class Age(quantity.Quantity): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A duration of time during which an organism (or a process) has existed. """ __resource_type__ = "Age" @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Age`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "value", "comparator", "unit", "system", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Age`` according to specification, with preserving the original sequence order. """ return ["value", "comparator", "unit", "system", "code"] ================================================ FILE: fhir/resources/R4B/allergyintolerance.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/AllergyIntolerance Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class AllergyIntolerance(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Allergy or Intolerance (generally: Risk of adverse reaction to a substance). Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance. """ __resource_type__ = "AllergyIntolerance" asserter: fhirtypes.ReferenceType | None = Field( default=None, alias="asserter", title="Source of the information about the allergy", description="The source of the information about the allergy that is recorded.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "RelatedPerson", "Practitioner", "PractitionerRole", ], }, ) category: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="category", title="food | medication | environment | biologic", description="Category of the identified substance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["food", "medication", "environment", "biologic"], }, ) category__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_category", title="Extension field for ``category``." ) clinicalStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="clinicalStatus", title="active | inactive | resolved", description="The clinical status of the allergy or intolerance.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Code that identifies the allergy or intolerance", description=( "Code for an allergy or intolerance statement (either a positive or a " "negated/excluded statement). This may be a code for a substance or " "pharmaceutical product that is considered to be responsible for the " 'adverse reaction risk (e.g., "Latex"), an allergy or intolerance ' 'condition (e.g., "Latex allergy"), or a negated/excluded code for a ' 'specific substance or class (e.g., "No latex allergy") or a general or' ' categorical negated statement (e.g., "No known allergy", "No known ' 'drug allergies"). Note: the substance for a specific reaction may be ' "different from the substance identified as the cause of the risk, but " "it must be consistent with it. For instance, it may be a more specific" " substance (e.g. a brand medication) or a composite product that " "includes the identified substance. It must be clinically safe to only " "process the 'code' and ignore the 'reaction.substance'. If a " "receiving system is unable to confirm that " "AllergyIntolerance.reaction.substance falls within the semantic scope " "of AllergyIntolerance.code, then the receiving system should ignore " "AllergyIntolerance.reaction.substance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) criticality: fhirtypes.CodeType | None = Field( default=None, alias="criticality", title="low | high | unable-to-assess", description=( "Estimate of the potential clinical harm, or seriousness, of the " "reaction to the identified substance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["low", "high", "unable-to-assess"], }, ) criticality__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_criticality", title="Extension field for ``criticality``." ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter when the allergy or intolerance was asserted", description="The encounter when the allergy or intolerance was asserted.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External ids for this item", description=( "Business identifiers assigned to this AllergyIntolerance by the " "performer or other systems which remain constant as the resource is " "updated and propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastOccurrence: fhirtypes.DateTimeType | None = Field( default=None, alias="lastOccurrence", title="Date(/time) of last known occurrence of a reaction", description=( "Represents the date and/or time of the last known occurrence of a " "reaction event." ), json_schema_extra={ "element_property": True, }, ) lastOccurrence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastOccurrence", title="Extension field for ``lastOccurrence``.", ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Additional text not captured in other fields", description=( "Additional narrative about the propensity for the Adverse Reaction, " "not captured in other fields." ), json_schema_extra={ "element_property": True, }, ) onsetAge: fhirtypes.AgeType | None = Field( default=None, alias="onsetAge", title="When allergy or intolerance was identified", description=( "Estimated or actual date, date-time, or age when allergy or " "intolerance was identified." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="onsetDateTime", title="When allergy or intolerance was identified", description=( "Estimated or actual date, date-time, or age when allergy or " "intolerance was identified." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onsetDateTime", title="Extension field for ``onsetDateTime``.", ) onsetPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="onsetPeriod", title="When allergy or intolerance was identified", description=( "Estimated or actual date, date-time, or age when allergy or " "intolerance was identified." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetRange: fhirtypes.RangeType | None = Field( default=None, alias="onsetRange", title="When allergy or intolerance was identified", description=( "Estimated or actual date, date-time, or age when allergy or " "intolerance was identified." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetString: fhirtypes.StringType | None = Field( default=None, alias="onsetString", title="When allergy or intolerance was identified", description=( "Estimated or actual date, date-time, or age when allergy or " "intolerance was identified." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onsetString", title="Extension field for ``onsetString``." ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Who the sensitivity is for", description="The patient who has the allergy or intolerance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) reaction: typing.List[fhirtypes.AllergyIntoleranceReactionType] | None = Field( default=None, alias="reaction", title="Adverse Reaction Events linked to exposure to substance", description=( "Details about each adverse reaction event linked to exposure to the " "identified substance." ), json_schema_extra={ "element_property": True, }, ) recordedDate: fhirtypes.DateTimeType | None = Field( default=None, alias="recordedDate", title="Date first version of the resource instance was recorded", description=( "The recordedDate represents when this particular AllergyIntolerance " "record was created in the system, which is often a system-generated " "date." ), json_schema_extra={ "element_property": True, }, ) recordedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recordedDate", title="Extension field for ``recordedDate``.", ) recorder: fhirtypes.ReferenceType | None = Field( default=None, alias="recorder", title="Who recorded the sensitivity", description=( "Individual who recorded the record and takes responsibility for its " "content." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Patient", "RelatedPerson", ], }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="allergy | intolerance - Underlying mechanism (if known)", description=( "Identification of the underlying physiological mechanism for the " "reaction risk." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["allergy", "intolerance"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) verificationStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="verificationStatus", title="unconfirmed | confirmed | refuted | entered-in-error", description=( "Assertion about certainty associated with the propensity, or potential" " risk, of a reaction to the identified substance (including " "pharmaceutical product)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AllergyIntolerance`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "clinicalStatus", "verificationStatus", "type", "category", "criticality", "code", "patient", "encounter", "onsetDateTime", "onsetAge", "onsetPeriod", "onsetRange", "onsetString", "recordedDate", "recorder", "asserter", "lastOccurrence", "note", "reaction", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AllergyIntolerance`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "clinicalStatus", "verificationStatus", "type", "category", "criticality", "code", "patient", "asserter", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "onset": [ "onsetAge", "onsetDateTime", "onsetPeriod", "onsetRange", "onsetString", ] } return one_of_many_fields class AllergyIntoleranceReaction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Adverse Reaction Events linked to exposure to substance. Details about each adverse reaction event linked to exposure to the identified substance. """ __resource_type__ = "AllergyIntoleranceReaction" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Description of the event as a whole", description=( "Text description about the reaction as a whole, including details of " "the manifestation if required." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) exposureRoute: fhirtypes.CodeableConceptType | None = Field( default=None, alias="exposureRoute", title="How the subject was exposed to the substance", description=( "Identification of the route by which the subject was exposed to the " "substance." ), json_schema_extra={ "element_property": True, }, ) manifestation: typing.List[fhirtypes.CodeableConceptType] = Field( default=..., alias="manifestation", title="Clinical symptoms/signs associated with the Event", description=( "Clinical symptoms and/or signs that are observed or associated with " "the adverse reaction event." ), json_schema_extra={ "element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Text about event not captured in other fields", description=( "Additional text about the adverse reaction event not captured in other" " fields." ), json_schema_extra={ "element_property": True, }, ) onset: fhirtypes.DateTimeType | None = Field( default=None, alias="onset", title="Date(/time) when manifestations showed", description="Record of the date and/or time of the onset of the Reaction.", json_schema_extra={ "element_property": True, }, ) onset__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onset", title="Extension field for ``onset``." ) severity: fhirtypes.CodeType | None = Field( default=None, alias="severity", title="mild | moderate | severe (of event as a whole)", description=( "Clinical assessment of the severity of the reaction event as a whole, " "potentially considering multiple different manifestations." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["mild", "moderate", "severe"], }, ) severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_severity", title="Extension field for ``severity``." ) substance: fhirtypes.CodeableConceptType | None = Field( default=None, alias="substance", title=( "Specific substance or pharmaceutical product considered to be " "responsible for event" ), description=( "Identification of the specific substance (or pharmaceutical product) " "considered to be responsible for the Adverse Reaction event. Note: the" " substance for a specific reaction may be different from the substance" " identified as the cause of the risk, but it must be consistent with " "it. For instance, it may be a more specific substance (e.g. a brand " "medication) or a composite product that includes the identified " "substance. It must be clinically safe to only process the 'code' and " "ignore the 'reaction.substance'. If a receiving system is unable to " "confirm that AllergyIntolerance.reaction.substance falls within the " "semantic scope of AllergyIntolerance.code, then the receiving system " "should ignore AllergyIntolerance.reaction.substance." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AllergyIntoleranceReaction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "substance", "manifestation", "description", "onset", "severity", "exposureRoute", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AllergyIntoleranceReaction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/annotation.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Annotation Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Annotation(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Text node with attribution. A text note which also contains information about who made the statement and when. """ __resource_type__ = "Annotation" authorReference: fhirtypes.ReferenceType | None = Field( default=None, alias="authorReference", title="Individual responsible for the annotation", description="The individual responsible for making the annotation.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e author[x] "one_of_many": "author", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Patient", "RelatedPerson", "Organization", ], }, ) authorString: fhirtypes.StringType | None = Field( default=None, alias="authorString", title="Individual responsible for the annotation", description="The individual responsible for making the annotation.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e author[x] "one_of_many": "author", "one_of_many_required": False, }, ) authorString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authorString", title="Extension field for ``authorString``.", ) text: fhirtypes.MarkdownType | None = Field( default=None, alias="text", title="The annotation - text content (as markdown)", description="The text of the annotation in markdown format.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) time: fhirtypes.DateTimeType | None = Field( default=None, alias="time", title="When the annotation was made", description="Indicates when this particular annotation was made.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) time__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_time", title="Extension field for ``time``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Annotation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "authorReference", "authorString", "time", "text"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Annotation`` according to specification, with preserving the original sequence order. """ return ["authorReference", "authorString", "time", "text"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("text", "text__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"author": ["authorReference", "authorString"]} return one_of_many_fields ================================================ FILE: fhir/resources/R4B/appointment.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Appointment Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Appointment(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s). """ __resource_type__ = "Appointment" appointmentType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="appointmentType", title=( "The style of appointment or patient that has been booked in the slot " "(not service type)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="The service request this appointment is allocated to assess", description=( "The service request this appointment is allocated to assess (e.g. " "incoming referral or procedure request)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ServiceRequest"], }, ) cancelationReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="cancelationReason", title="The coded reason for the appointment being cancelled", description=( "The coded reason for the appointment being cancelled. This is often " "used in reporting/billing/futher processing to determine if further " "actions are required, or specific fees apply." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Additional comments", description="Additional comments about the appointment.", json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="The date that this appointment was initially created", description=( "The date that this appointment was initially created. This could be " "different to the meta.lastModified value on the initial entry, as this" " could have been before the resource was created on the FHIR server, " "and should remain unchanged over the lifespan of the appointment." ), json_schema_extra={ "element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Shown on a subject line in a meeting request, or appointment list", description=( "The brief description of the appointment as would be shown on a " "subject line in a meeting request, or appointment list. Detailed or " "expanded information should be put in the comment field." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) end: fhirtypes.InstantType | None = Field( default=None, alias="end", title="When appointment is to conclude", description="Date/Time that the appointment is to conclude.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_end", title="Extension field for ``end``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Ids for this item", description=( "This records identifiers associated with this appointment concern that" " are defined by business processes and/or used to refer to it when a " "direct URL reference to the resource itself is not appropriate (e.g. " "in CDA documents, or in written / printed documentation)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) minutesDuration: fhirtypes.PositiveIntType | None = Field( default=None, alias="minutesDuration", title="Can be less than start/end (e.g. estimate)", description=( "Number of minutes that the appointment is to take. This can be less " "than the duration between the start and end times. For example, where" " the actual time of appointment is only an estimate or if a 30 minute " "appointment is being requested, but any time would work. Also, if " "there is, for example, a planned 15 minute break in the middle of a " "long appointment, the duration may be 15 minutes less than the " "difference between the start and end." ), json_schema_extra={ "element_property": True, }, ) minutesDuration__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minutesDuration", title="Extension field for ``minutesDuration``.", ) participant: typing.List[fhirtypes.AppointmentParticipantType] = Field( default=..., alias="participant", title="Participants involved in appointment", description="List of participants involved in the appointment.", json_schema_extra={ "element_property": True, }, ) patientInstruction: fhirtypes.StringType | None = Field( default=None, alias="patientInstruction", title="Detailed information and instructions for the patient", description=( "While Appointment.comment contains information for internal use, " "Appointment.patientInstructions is used to capture patient facing " "information about the Appointment (e.g. please bring your referral or " "fast from 8pm night before)." ), json_schema_extra={ "element_property": True, }, ) patientInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patientInstruction", title="Extension field for ``patientInstruction``.", ) priority: fhirtypes.UnsignedIntType | None = Field( default=None, alias="priority", title="Used to make informed decisions if needing to re-prioritize", description=( "The priority of the appointment. Can be used to make informed " "decisions if needing to re-prioritize appointments. (The iCal Standard" " specifies 0 as undefined, 1 as highest, 9 as lowest priority)." ), json_schema_extra={ "element_property": True, }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Coded reason this appointment is scheduled", description=( "The coded reason that this appointment is being scheduled. This is " "more clinical than administrative." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Reason the appointment is to take place (resource)", description=( "Reason the appointment has been scheduled to take place, as specified " "using information from another resource. When the patient arrives and " "the encounter begins it may be used as the admission diagnosis. The " "indication will typically be a Condition (with other resources " "referenced in the evidence.detail), or a Procedure." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Procedure", "Observation", "ImmunizationRecommendation", ], }, ) requestedPeriod: typing.List[fhirtypes.PeriodType] | None = Field( default=None, alias="requestedPeriod", title=( "Potential date/time interval(s) requested to allocate the appointment " "within" ), description=( "A set of date ranges (potentially including times) that the " "appointment is preferred to be scheduled within. The duration " "(usually in minutes) could also be provided to indicate the length of " "the appointment to fill and populate the start/end times for the " "actual allocated time. However, in other situations the duration may " "be calculated by the scheduling system." ), json_schema_extra={ "element_property": True, }, ) serviceCategory: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="serviceCategory", title=( "A broad categorization of the service that is to be performed during " "this appointment" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) serviceType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="serviceType", title="The specific service that is to be performed during this appointment", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) slot: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="slot", title="The slots that this appointment is filling", description=( "The slots from the participants' schedules that will be filled by the " "appointment." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Slot"], }, ) specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialty", title=( "The specialty of a practitioner that would be required to perform the " "service requested in this appointment" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) start: fhirtypes.InstantType | None = Field( default=None, alias="start", title="When appointment is to take place", description="Date/Time that the appointment is to take place.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_start", title="Extension field for ``start``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "proposed | pending | booked | arrived | fulfilled | cancelled | noshow" " | entered-in-error | checked-in | waitlist" ), description=( "The overall status of the Appointment. Each of the participants has " "their own participation status which indicates their involvement in " "the process, however this status indicates the shared status." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "proposed", "pending", "booked", "arrived", "fulfilled", "cancelled", "noshow", "entered-in-error", "checked-in", "waitlist", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInformation", title="Additional information to support the appointment", description=( "Additional information to support the appointment provided when making" " the appointment." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Appointment`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "cancelationReason", "serviceCategory", "serviceType", "specialty", "appointmentType", "reasonCode", "reasonReference", "priority", "description", "supportingInformation", "start", "end", "minutesDuration", "slot", "created", "comment", "patientInstruction", "basedOn", "participant", "requestedPeriod", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Appointment`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "cancelationReason", "serviceCategory", "serviceType", "specialty", "appointmentType", "reasonCode", "start", "end", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class AppointmentParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Participants involved in appointment. List of participants involved in the appointment. """ __resource_type__ = "AppointmentParticipant" actor: fhirtypes.ReferenceType | None = Field( default=None, alias="actor", title="Person, Location/HealthcareService or Device", description=( "A Person, Location/HealthcareService or Device that is participating " "in the appointment." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Device", "HealthcareService", "Location", ], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Participation period of the actor", description=None, json_schema_extra={ "element_property": True, }, ) required: fhirtypes.CodeType | None = Field( default=None, alias="required", title="required | optional | information-only", description=( "Whether this participant is required to be present at the meeting. " "This covers a use-case where two doctors need to meet to discuss the " "results for a specific patient, and the patient is not required to be " "present." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["required", "optional", "information-only"], }, ) required__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_required", title="Extension field for ``required``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="accepted | declined | tentative | needs-action", description="Participation status of the actor.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["accepted", "declined", "tentative", "needs-action"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Role of participant in the appointment", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AppointmentParticipant`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "actor", "required", "status", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AppointmentParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "actor", "required", "status"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/appointmentresponse.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/AppointmentResponse Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class AppointmentResponse(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection. """ __resource_type__ = "AppointmentResponse" actor: fhirtypes.ReferenceType | None = Field( default=None, alias="actor", title="Person, Location, HealthcareService, or Device", description=( "A Person, Location, HealthcareService, or Device that is participating" " in the appointment." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Device", "HealthcareService", "Location", ], }, ) appointment: fhirtypes.ReferenceType = Field( default=..., alias="appointment", title="Appointment this response relates to", description="Appointment that this response is replying to.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Appointment"], }, ) comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Additional comments", description="Additional comments about the appointment.", json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) end: fhirtypes.InstantType | None = Field( default=None, alias="end", title="Time from appointment, or requested new end time", description=( "This may be either the same as the appointment request to confirm the " "details of the appointment, or alternately a new time to request a re-" "negotiation of the end time." ), json_schema_extra={ "element_property": True, }, ) end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_end", title="Extension field for ``end``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Ids for this item", description=( "This records identifiers associated with this appointment response " "concern that are defined by business processes and/ or used to refer " "to it when a direct URL reference to the resource itself is not " "appropriate." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) participantStatus: fhirtypes.CodeType | None = Field( default=None, alias="participantStatus", title="accepted | declined | tentative | needs-action", description=( "Participation status of the participant. When the status is declined " "or tentative if the start/end times are different to the appointment, " "then these times should be interpreted as a requested time change. " "When the status is accepted, the times can either be the time of the " "appointment (as a confirmation of the time) or can be empty." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["accepted", "declined", "tentative", "needs-action"], }, ) participantStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_participantStatus", title="Extension field for ``participantStatus``.", ) participantType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="participantType", title="Role of participant in the appointment", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) start: fhirtypes.InstantType | None = Field( default=None, alias="start", title="Time from appointment, or requested new start time", description=( "Date/Time that the appointment is to take place, or requested new " "start time." ), json_schema_extra={ "element_property": True, }, ) start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_start", title="Extension field for ``start``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AppointmentResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "appointment", "start", "end", "participantType", "actor", "participantStatus", "comment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AppointmentResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "appointment", "participantType", "actor", "participantStatus", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("participantStatus", "participantStatus__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/attachment.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Attachment Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Attachment(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Content in a format defined elsewhere. For referring to data content defined in other formats. """ __resource_type__ = "Attachment" contentType: fhirtypes.CodeType | None = Field( default=None, alias="contentType", title="Mime type of the content, with charset etc.", description=( "Identifies the type of the data in the attachment and allows a method " "to be chosen to interpret or render the data. Includes mime type " "parameters such as charset where appropriate." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contentType", title="Extension field for ``contentType``." ) creation: fhirtypes.DateTimeType | None = Field( default=None, alias="creation", title="Date attachment was first created", description="The date that the attachment was first created.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) creation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_creation", title="Extension field for ``creation``." ) data: fhirtypes.Base64BinaryType | None = Field( default=None, alias="data", title="Data inline, base64ed", description=( "The actual data of the attachment - a sequence of bytes, base64 " "encoded." ), json_schema_extra={ "element_property": True, }, ) data__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_data", title="Extension field for ``data``." ) hash: fhirtypes.Base64BinaryType | None = Field( default=None, alias="hash", title="Hash of the data (sha-1, base64ed)", description="The calculated hash of the data using SHA-1. Represented using base64.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) hash__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_hash", title="Extension field for ``hash``." ) language: fhirtypes.CodeType | None = Field( default=None, alias="language", title="Human language of the content (BCP-47)", description=( "The human language of the content. The value can be any valid value " "according to BCP 47." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) size: fhirtypes.UnsignedIntType | None = Field( default=None, alias="size", title="Number of bytes of content (if url provided)", description=( "The number of bytes of data that make up this attachment (before " "base64 encoding, if that is done)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) size__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_size", title="Extension field for ``size``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Label to display in place of the data", description="A label or set of text to display in place of the data.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UrlType | None = Field( default=None, alias="url", title="Uri where the data can be found", description="A location where the data can be accessed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Attachment`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "contentType", "language", "data", "url", "size", "hash", "title", "creation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Attachment`` according to specification, with preserving the original sequence order. """ return ["contentType", "language", "url", "size", "hash", "title", "creation"] ================================================ FILE: fhir/resources/R4B/auditevent.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/AuditEvent Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class AuditEvent(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Event record kept for security purposes. A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. """ __resource_type__ = "AuditEvent" action: fhirtypes.CodeType | None = Field( default=None, alias="action", title="Type of action performed during the event", description=( "Indicator for type of action performed during the event that generated" " the audit." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) action__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_action", title="Extension field for ``action``." ) agent: typing.List[fhirtypes.AuditEventAgentType] = Field( default=..., alias="agent", title="Actor involved in the event", description=( "An actor taking an active role in the event or activity that is " "logged." ), json_schema_extra={ "element_property": True, }, ) entity: typing.List[fhirtypes.AuditEventEntityType] | None = Field( default=None, alias="entity", title="Data or objects used", description="Specific instances of data or objects that have been accessed.", json_schema_extra={ "element_property": True, }, ) outcome: fhirtypes.CodeType | None = Field( default=None, alias="outcome", title="Whether the event succeeded or failed", description="Indicates whether the event succeeded or failed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) outcome__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_outcome", title="Extension field for ``outcome``." ) outcomeDesc: fhirtypes.StringType | None = Field( default=None, alias="outcomeDesc", title="Description of the event outcome", description="A free text description of the outcome of the event.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) outcomeDesc__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_outcomeDesc", title="Extension field for ``outcomeDesc``." ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="When the activity occurred", description="The period during which the activity occurred.", json_schema_extra={ "element_property": True, }, ) purposeOfEvent: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="purposeOfEvent", title="The purposeOfUse of the event", description=( "The purposeOfUse (reason) that was used during the event being " "recorded." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) recorded: fhirtypes.InstantType | None = Field( default=None, alias="recorded", title="Time when the event was recorded", description="The time when the event was recorded.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) recorded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recorded", title="Extension field for ``recorded``." ) source: fhirtypes.AuditEventSourceType = Field( default=..., alias="source", title="Audit Event Reporter", description="The system that is reporting the event.", json_schema_extra={ "element_property": True, }, ) subtype: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="subtype", title="More specific type/id for the event", description="Identifier for the category of event.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodingType = Field( default=..., alias="type", title="Type/identifier of event", description=( "Identifier for a family of the event. For example, a menu item, " "program, rule, policy, function code, application name or URL. It " "identifies the performed function." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AuditEvent`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "type", "subtype", "action", "period", "recorded", "outcome", "outcomeDesc", "purposeOfEvent", "agent", "source", "entity", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AuditEvent`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "type", "subtype", "action", "recorded", "outcome", "outcomeDesc", "purposeOfEvent", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("recorded", "recorded__ext")] return required_fields class AuditEventAgent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Actor involved in the event. An actor taking an active role in the event or activity that is logged. """ __resource_type__ = "AuditEventAgent" altId: fhirtypes.StringType | None = Field( default=None, alias="altId", title="Alternative User identity", description=( "Alternative agent Identifier. For a human, this should be a user " "identifier text string from authentication system. This identifier " "would be one known to a common authentication system (e.g. single " "sign-on), if available." ), json_schema_extra={ "element_property": True, }, ) altId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_altId", title="Extension field for ``altId``." ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where", description="Where the event occurred.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) media: fhirtypes.CodingType | None = Field( default=None, alias="media", title="Type of media", description=( "Type of media involved. Used when the event is about " "exporting/importing onto media." ), json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Human friendly name for the agent", description="Human-meaningful name for the agent.", json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) network: fhirtypes.AuditEventAgentNetworkType | None = Field( default=None, alias="network", title="Logical network location for application activity", description=( "Logical network location for application activity, if the activity has" " a network location." ), json_schema_extra={ "element_property": True, }, ) policy: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="policy", title="Policy that authorized event", description=( "The policy or plan that authorized the activity being recorded. " "Typically, a single activity may have multiple applicable policies, " "such as patient consent, guarantor funding, etc. The policy would also" " indicate the security token used." ), json_schema_extra={ "element_property": True, }, ) policy__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_policy", title="Extension field for ``policy``." ) purposeOfUse: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="purposeOfUse", title="Reason given for this user", description=( "The reason (purpose of use), specific to this agent, that was used " "during the event being recorded." ), json_schema_extra={ "element_property": True, }, ) requestor: bool | None = Field( default=None, alias="requestor", title="Whether user is initiator", description=( "Indicator that the user is or is not the requestor, or initiator, for " "the event being audited." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) requestor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requestor", title="Extension field for ``requestor``." ) role: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="role", title="Agent role in the event", description=( "The security role that the user was acting under, that come from local" " codes defined by the access control security system (e.g. RBAC, ABAC)" " used in the local context." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="How agent participated", description=( "Specification of the participation type the user plays when performing" " the event." ), json_schema_extra={ "element_property": True, }, ) who: fhirtypes.ReferenceType | None = Field( default=None, alias="who", title="Identifier of who", description="Reference to who this agent is that was involved in the event.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "PractitionerRole", "Practitioner", "Organization", "Device", "Patient", "RelatedPerson", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AuditEventAgent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "role", "who", "altId", "name", "requestor", "location", "policy", "media", "network", "purposeOfUse", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AuditEventAgent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "who", "requestor"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("requestor", "requestor__ext")] return required_fields class AuditEventAgentNetwork(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Logical network location for application activity. Logical network location for application activity, if the activity has a network location. """ __resource_type__ = "AuditEventAgentNetwork" address: fhirtypes.StringType | None = Field( default=None, alias="address", title="Identifier for the network access point of the user device", description=( "An identifier for the network access point of the user device for the " "audit event." ), json_schema_extra={ "element_property": True, }, ) address__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_address", title="Extension field for ``address``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="The type of network access point", description=( "An identifier for the type of network access point that originated the" " audit event." ), json_schema_extra={ "element_property": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AuditEventAgentNetwork`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "address", "type"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AuditEventAgentNetwork`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class AuditEventEntity(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Data or objects used. Specific instances of data or objects that have been accessed. """ __resource_type__ = "AuditEventEntity" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Descriptive text", description="Text that describes the entity in more detail.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) detail: typing.List[fhirtypes.AuditEventEntityDetailType] | None = Field( default=None, alias="detail", title="Additional Information about the entity", description=( "Tagged value pairs for conveying additional information about the " "entity." ), json_schema_extra={ "element_property": True, }, ) lifecycle: fhirtypes.CodingType | None = Field( default=None, alias="lifecycle", title="Life-cycle stage for the entity", description="Identifier for the data life-cycle stage for the entity.", json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Descriptor for entity", description="A name of the entity in the audit event.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) query: fhirtypes.Base64BinaryType | None = Field( default=None, alias="query", title="Query parameters", description="The query parameters for a query-type entities.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) query__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_query", title="Extension field for ``query``." ) role: fhirtypes.CodingType | None = Field( default=None, alias="role", title="What role the entity played", description=( "Code representing the role the entity played in the event being " "audited." ), json_schema_extra={ "element_property": True, }, ) securityLabel: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="securityLabel", title="Security labels on the entity", description="Security labels for the identified entity.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodingType | None = Field( default=None, alias="type", title="Type of entity involved", description="The type of the object that was involved in this audit event.", json_schema_extra={ "element_property": True, }, ) what: fhirtypes.ReferenceType | None = Field( default=None, alias="what", title="Specific instance of resource", description=( "Identifies a specific instance of the entity. The reference should be " "version specific." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AuditEventEntity`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "what", "type", "role", "lifecycle", "securityLabel", "name", "description", "query", "detail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AuditEventEntity`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "what", "name", "query"] class AuditEventEntityDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional Information about the entity. Tagged value pairs for conveying additional information about the entity. """ __resource_type__ = "AuditEventEntityDetail" type: fhirtypes.StringType | None = Field( default=None, alias="type", title="Name of the property", description="The type of extra detail provided in the value.", json_schema_extra={ "element_property": True, "element_required": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) valueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="valueBase64Binary", title="Property value", description="The value of the extra detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBase64Binary", title="Extension field for ``valueBase64Binary``.", ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Property value", description="The value of the extra detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AuditEventEntityDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueString", "valueBase64Binary", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AuditEventEntityDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"value": ["valueBase64Binary", "valueString"]} return one_of_many_fields class AuditEventSource(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Audit Event Reporter. The system that is reporting the event. """ __resource_type__ = "AuditEventSource" observer: fhirtypes.ReferenceType = Field( default=..., alias="observer", title="The identity of source detecting the event", description="Identifier of the source where the event was detected.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "PractitionerRole", "Practitioner", "Organization", "Device", "Patient", "RelatedPerson", ], }, ) site: fhirtypes.StringType | None = Field( default=None, alias="site", title="Logical source location within the enterprise", description=( "Logical source location within the healthcare enterprise network. For" " example, a hospital or other provider location within a multi-entity " "provider group." ), json_schema_extra={ "element_property": True, }, ) site__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_site", title="Extension field for ``site``." ) type: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="type", title="The type of source where event originated", description="Code specifying the type of source where event originated.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AuditEventSource`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "site", "observer", "type"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AuditEventSource`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "observer"] ================================================ FILE: fhir/resources/R4B/backboneelement.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/BackboneElement Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class BackboneElement(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Base for elements defined inside a resource. Base definition for all elements that are defined inside a resource - but not those in a data type. """ __resource_type__ = "BackboneElement" modifierExtension: typing.List[fhirtypes.ExtensionType] | None = Field( default=None, alias="modifierExtension", title="Extensions that cannot be ignored even if unrecognized", description=( "May be used to represent additional information that is not part of " "the basic definition of the element and that modifies the " "understanding of the element in which it is contained and/or the " "understanding of the containing element's descendants. Usually " "modifier elements provide negation or qualification. To make the use " "of extensions safe and manageable, there is a strict set of governance" " applied to the definition and use of extensions. Though any " "implementer can define an extension, there is a set of requirements " "that SHALL be met as part of the definition of the extension. " "Applications processing a resource are required to check for modifier " "extensions. Modifier extensions SHALL NOT change the meaning of any " "elements on Resource or DomainResource (including cannot change the " "meaning of modifierExtension itself)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BackboneElement`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BackboneElement`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/basic.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Basic Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class Basic(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Resource for non-supported content. Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification. """ __resource_type__ = "Basic" author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="Who created", description="Indicates who was responsible for creating the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Patient", "RelatedPerson", "Organization", ], }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Kind of Resource", description=( "Identifies the 'type' of resource - equivalent to the resource name " "for other resources." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) created: fhirtypes.DateType | None = Field( default=None, alias="created", title="When created", description="Identifies when the resource was first created.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description=( "Identifier assigned to the resource for business purposes, outside the" " context of FHIR." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Identifies the focus of this resource", description=( "Identifies the patient, practitioner, device or any other resource " 'that is the "focus" of this resource.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Basic`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "code", "subject", "created", "author", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Basic`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "code", "subject", "created", "author", ] ================================================ FILE: fhir/resources/R4B/binary.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Binary Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import fhirtypes, resource class Binary(resource.Resource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Pure binary content defined by a format other than FHIR. A resource that represents the data of a single raw artifact as digital content accessible in its native format. A Binary resource can contain any content, whether text, image, pdf, zip archive, etc. """ __resource_type__ = "Binary" contentType: fhirtypes.CodeType | None = Field( default=None, alias="contentType", title="MimeType of the binary content", description=( "MimeType of the binary content represented as a standard MimeType (BCP" " 13)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contentType", title="Extension field for ``contentType``." ) data: fhirtypes.Base64BinaryType | None = Field( default=None, alias="data", title="The actual content", description="The actual content, base64 encoded.", json_schema_extra={ "element_property": True, }, ) data__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_data", title="Extension field for ``data``." ) securityContext: fhirtypes.ReferenceType | None = Field( default=None, alias="securityContext", title=( "Identifies another resource to use as proxy when enforcing access " "control" ), description=( "This element identifies another resource that can be used as a proxy " "of the security sensitivity to use when deciding and enforcing access " "control rules for the Binary resource. Given that the Binary resource " "contains very few elements that can be used to determine the " "sensitivity of the data and relationships to individuals, the " "referenced resource stands in as a proxy equivalent for this purpose. " "This referenced resource may be related to the Binary (e.g. Media, " "DocumentReference), or may be some non-related Resource purely as a " "security proxy. E.g. to identify that the binary resource relates to a" " patient, and access should only be granted to applications that have " "access to the patient." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Binary`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "contentType", "securityContext", "data", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Binary`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "contentType", "securityContext"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("contentType", "contentType__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/biologicallyderivedproduct.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/BiologicallyDerivedProduct Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class BiologicallyDerivedProduct(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A material substance originating from a biological entity. A material substance originating from a biological entity intended to be transplanted or infused into another (possibly the same) biological entity. """ __resource_type__ = "BiologicallyDerivedProduct" collection: fhirtypes.BiologicallyDerivedProductCollectionType | None = Field( default=None, alias="collection", title="How this product was collected", description=None, json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External ids for this item", description=( "This records identifiers associated with this biologically derived " "product instance that are defined by business processes and/or used to" " refer to it when a direct URL reference to the resource itself is not" " appropriate (e.g. in CDA documents, or in written / printed " "documentation)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) manipulation: fhirtypes.BiologicallyDerivedProductManipulationType | None = Field( default=None, alias="manipulation", title="Any manipulation of product post-collection", description=( "Any manipulation of product post-collection that is intended to alter " "the product. For example a buffy-coat enrichment or CD8 reduction of " "Peripheral Blood Stem Cells to make it more suitable for infusion." ), json_schema_extra={ "element_property": True, }, ) parent: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="parent", title="BiologicallyDerivedProduct parent", description="Parent product (if any).", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["BiologicallyDerivedProduct"], }, ) processing: typing.List[ fhirtypes.BiologicallyDerivedProductProcessingType ] | None = Field( default=None, alias="processing", title="Any processing of the product during collection", description=( "Any processing of the product during collection that does not change " "the fundamental nature of the product. For example adding anti-" "coagulants during the collection of Peripheral Blood Stem Cells." ), json_schema_extra={ "element_property": True, }, ) productCategory: fhirtypes.CodeType | None = Field( default=None, alias="productCategory", title="organ | tissue | fluid | cells | biologicalAgent", description="Broad category of this product.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["organ", "tissue", "fluid", "cells", "biologicalAgent"], }, ) productCategory__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_productCategory", title="Extension field for ``productCategory``.", ) productCode: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productCode", title="What this biologically derived product is", description=( "A code that identifies the kind of this biologically derived product " "(SNOMED Ctcode)." ), json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.IntegerType | None = Field( default=None, alias="quantity", title="The amount of this biologically derived product", description="Number of discrete units within this product.", json_schema_extra={ "element_property": True, }, ) quantity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_quantity", title="Extension field for ``quantity``." ) request: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="request", title="Procedure request", description="Procedure request to obtain this biologically derived product.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ServiceRequest"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="available | unavailable", description="Whether the product is currently available.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["available", "unavailable"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) storage: typing.List[ fhirtypes.BiologicallyDerivedProductStorageType ] | None = Field( default=None, alias="storage", title="Product storage", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BiologicallyDerivedProduct`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "productCategory", "productCode", "status", "request", "quantity", "parent", "collection", "processing", "manipulation", "storage", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BiologicallyDerivedProduct`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "identifier"] class BiologicallyDerivedProductCollection(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. How this product was collected. """ __resource_type__ = "BiologicallyDerivedProductCollection" collectedDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="collectedDateTime", title="Time of product collection", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e collected[x] "one_of_many": "collected", "one_of_many_required": False, }, ) collectedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_collectedDateTime", title="Extension field for ``collectedDateTime``.", ) collectedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="collectedPeriod", title="Time of product collection", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e collected[x] "one_of_many": "collected", "one_of_many_required": False, }, ) collector: fhirtypes.ReferenceType | None = Field( default=None, alias="collector", title="Individual performing collection", description="Healthcare professional who is performing the collection.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) source: fhirtypes.ReferenceType | None = Field( default=None, alias="source", title="Who is product from", description=( "The patient or entity, such as a hospital or vendor in the case of a " "processed/manipulated/manufactured product, providing the product." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Organization"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BiologicallyDerivedProductCollection`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "collector", "source", "collectedDateTime", "collectedPeriod", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BiologicallyDerivedProductCollection`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"collected": ["collectedDateTime", "collectedPeriod"]} return one_of_many_fields class BiologicallyDerivedProductManipulation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Any manipulation of product post-collection. Any manipulation of product post-collection that is intended to alter the product. For example a buffy-coat enrichment or CD8 reduction of Peripheral Blood Stem Cells to make it more suitable for infusion. """ __resource_type__ = "BiologicallyDerivedProductManipulation" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Description of manipulation", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) timeDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="timeDateTime", title="Time of manipulation", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e time[x] "one_of_many": "time", "one_of_many_required": False, }, ) timeDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timeDateTime", title="Extension field for ``timeDateTime``.", ) timePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="timePeriod", title="Time of manipulation", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e time[x] "one_of_many": "time", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BiologicallyDerivedProductManipulation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "timeDateTime", "timePeriod", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BiologicallyDerivedProductManipulation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"time": ["timeDateTime", "timePeriod"]} return one_of_many_fields class BiologicallyDerivedProductProcessing(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Any processing of the product during collection. Any processing of the product during collection that does not change the fundamental nature of the product. For example adding anti-coagulants during the collection of Peripheral Blood Stem Cells. """ __resource_type__ = "BiologicallyDerivedProductProcessing" additive: fhirtypes.ReferenceType | None = Field( default=None, alias="additive", title="Substance added during processing", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Substance"], }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Description of of processing", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) procedure: fhirtypes.CodeableConceptType | None = Field( default=None, alias="procedure", title="Procesing code", description=None, json_schema_extra={ "element_property": True, }, ) timeDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="timeDateTime", title="Time of processing", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e time[x] "one_of_many": "time", "one_of_many_required": False, }, ) timeDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timeDateTime", title="Extension field for ``timeDateTime``.", ) timePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="timePeriod", title="Time of processing", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e time[x] "one_of_many": "time", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BiologicallyDerivedProductProcessing`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "procedure", "additive", "timeDateTime", "timePeriod", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BiologicallyDerivedProductProcessing`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"time": ["timeDateTime", "timePeriod"]} return one_of_many_fields class BiologicallyDerivedProductStorage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Product storage. """ __resource_type__ = "BiologicallyDerivedProductStorage" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Description of storage", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) duration: fhirtypes.PeriodType | None = Field( default=None, alias="duration", title="Storage timeperiod", description=None, json_schema_extra={ "element_property": True, }, ) scale: fhirtypes.CodeType | None = Field( default=None, alias="scale", title="farenheit | celsius | kelvin", description="Temperature scale used.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["farenheit", "celsius", "kelvin"], }, ) scale__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_scale", title="Extension field for ``scale``." ) temperature: fhirtypes.DecimalType | None = Field( default=None, alias="temperature", title="Storage temperature", description=None, json_schema_extra={ "element_property": True, }, ) temperature__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_temperature", title="Extension field for ``temperature``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BiologicallyDerivedProductStorage`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "temperature", "scale", "duration", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BiologicallyDerivedProductStorage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/bodystructure.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/BodyStructure Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class BodyStructure(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specific and identified anatomical structure. Record details about an anatomical structure. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. """ __resource_type__ = "BodyStructure" active: bool | None = Field( default=None, alias="active", title="Whether this record is in active use", description="Whether this body site is in active use.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Text description", description="A summary, characterization or explanation of the body structure.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Bodystructure identifier", description="Identifier for this instance of the anatomical structure.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) image: typing.List[fhirtypes.AttachmentType] | None = Field( default=None, alias="image", title="Attached images", description="Image or images used to identify a location.", json_schema_extra={ "element_property": True, }, ) location: fhirtypes.CodeableConceptType | None = Field( default=None, alias="location", title="Body site", description=( "The anatomical location or region of the specimen, lesion, or body " "structure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) locationQualifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="locationQualifier", title="Body site modifier", description=( "Qualifier to refine the anatomical location. These include qualifiers" " for laterality, relative location, directionality, number, and plane." ), json_schema_extra={ "element_property": True, }, ) morphology: fhirtypes.CodeableConceptType | None = Field( default=None, alias="morphology", title="Kind of Structure", description=( "The kind of structure being represented by the body structure at " "`BodyStructure.location`. This can define both normal and abnormal " "morphologies." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Who this is about", description="The person to which the body site belongs.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BodyStructure`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "morphology", "location", "locationQualifier", "description", "image", "patient", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BodyStructure`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "active", "morphology", "location", "description", "patient", ] ================================================ FILE: fhir/resources/R4B/bundle.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Bundle Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, fhirtypes, resource class Bundle(resource.Resource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contains a collection of resources. A container for a collection of resources. """ __resource_type__ = "Bundle" entry: typing.List[fhirtypes.BundleEntryType] | None = Field( default=None, alias="entry", title="Entry in the bundle - will have a resource or information", description=( "An entry in a bundle resource - will either contain a resource or " "information about a resource (transactions and history only)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Persistent identifier for the bundle", description=( "A persistent identifier for the bundle that won't change as a bundle " "is copied from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) link: typing.List[fhirtypes.BundleLinkType] | None = Field( default=None, alias="link", title="Links related to this Bundle", description="A series of links that provide context to this bundle.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) signature: fhirtypes.SignatureType | None = Field( default=None, alias="signature", title="Digital Signature", description="Digital Signature - base64 encoded. XML-DSig or a JWT.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) timestamp: fhirtypes.InstantType | None = Field( default=None, alias="timestamp", title="When the bundle was assembled", description=( "The date/time that the bundle was assembled - i.e. when the resources " "were placed in the bundle." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) timestamp__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timestamp", title="Extension field for ``timestamp``." ) total: fhirtypes.UnsignedIntType | None = Field( default=None, alias="total", title="If search, the total number of matches", description=( "If a set of search matches, this is the total number of entries of " "type 'match' across all pages in the search. It does not include " "search.mode = 'include' or 'outcome' entries and it does not provide a" " count of the number of entries in the Bundle." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) total__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_total", title="Extension field for ``total``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "document | message | transaction | transaction-response | batch | " "batch-response | history | searchset | collection" ), description="Indicates the purpose of this bundle - how it is intended to be used.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "document", "message", "transaction", "transaction-response", "batch", "batch-response", "history", "searchset", "collection", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Bundle`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "identifier", "type", "timestamp", "total", "link", "entry", "signature", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Bundle`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "type", "timestamp", "total", "link", "entry", "signature", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields class BundleEntry(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Entry in the bundle - will have a resource or information. An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only). """ __resource_type__ = "BundleEntry" fullUrl: fhirtypes.UriType | None = Field( default=None, alias="fullUrl", title="URI for resource (Absolute URL server address or URI for UUID/OID)", description=( "The Absolute URL for the resource. The fullUrl SHALL NOT disagree " "with the id in the resource - i.e. if the fullUrl is not a urn:uuid, " "the URL shall be version-independent URL consistent with the " "Resource.id. The fullUrl is a version independent reference to the " "resource. The fullUrl element SHALL have a value except that: * " "fullUrl can be empty on a POST (although it does not need to when " "specifying a temporary id for reference in the bundle) * Results from " "operations might involve resources that are not identified." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) fullUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fullUrl", title="Extension field for ``fullUrl``." ) link: typing.List[fhirtypes.BundleLinkType] | None = Field( default=None, alias="link", title="Links related to this entry", description="A series of links that provide context to this entry.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) request: fhirtypes.BundleEntryRequestType | None = Field( default=None, alias="request", title="Additional execution information (transaction/batch/history)", description=( "Additional information about how this entry should be processed as " "part of a transaction or batch. For history, it shows how the entry " "was processed to create the version contained in the entry." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) resource: fhirtypes.ResourceType | None = Field( default=None, alias="resource", title="A resource in the bundle", description=( "The Resource for the entry. The purpose/meaning of the resource is " "determined by the Bundle.type." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) response: fhirtypes.BundleEntryResponseType | None = Field( default=None, alias="response", title="Results of execution (transaction/batch/history)", description=( "Indicates the results of processing the corresponding 'request' entry " "in the batch or transaction being responded to or what the results of " "an operation where when returning history." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) search: fhirtypes.BundleEntrySearchType | None = Field( default=None, alias="search", title="Search related information", description=( "Information about the search process that lead to the creation of this" " entry." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BundleEntry`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "link", "fullUrl", "resource", "search", "request", "response", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BundleEntry`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "link", "fullUrl", "resource", "search", "request", "response", ] class BundleEntryRequest(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional execution information (transaction/batch/history). Additional information about how this entry should be processed as part of a transaction or batch. For history, it shows how the entry was processed to create the version contained in the entry. """ __resource_type__ = "BundleEntryRequest" ifMatch: fhirtypes.StringType | None = Field( default=None, alias="ifMatch", title="For managing update contention", description=( "Only perform the operation if the Etag value matches. For more " 'information, see the API section ["Managing Resource ' 'Contention"](http.html#concurrency).' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ifMatch__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_ifMatch", title="Extension field for ``ifMatch``." ) ifModifiedSince: fhirtypes.InstantType | None = Field( default=None, alias="ifModifiedSince", title="For managing cache currency", description=( "Only perform the operation if the last updated date matches. See the " 'API documentation for ["Conditional Read"](http.html#cread).' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ifModifiedSince__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_ifModifiedSince", title="Extension field for ``ifModifiedSince``.", ) ifNoneExist: fhirtypes.StringType | None = Field( default=None, alias="ifNoneExist", title="For conditional creates", description=( "Instruct the server not to perform the create if a specified resource " "already exists. For further information, see the API documentation for" ' ["Conditional Create"](http.html#ccreate). This is just the query ' 'portion of the URL - what follows the "?" (not including the "?").' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ifNoneExist__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_ifNoneExist", title="Extension field for ``ifNoneExist``." ) ifNoneMatch: fhirtypes.StringType | None = Field( default=None, alias="ifNoneMatch", title="For managing cache currency", description=( "If the ETag values match, return a 304 Not Modified status. See the " 'API documentation for ["Conditional Read"](http.html#cread).' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ifNoneMatch__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_ifNoneMatch", title="Extension field for ``ifNoneMatch``." ) method: fhirtypes.CodeType | None = Field( default=None, alias="method", title="GET | HEAD | POST | PUT | DELETE | PATCH", description=( "In a transaction or batch, this is the HTTP action to be executed for " "this entry. In a history bundle, this indicates the HTTP action that " "occurred." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["GET", "HEAD", "POST", "PUT", "DELETE", "PATCH"], }, ) method__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_method", title="Extension field for ``method``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="URL for HTTP equivalent of this entry", description=( "The URL for this entry, relative to the root (the address to which the" " request is posted)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BundleEntryRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "method", "url", "ifNoneMatch", "ifModifiedSince", "ifMatch", "ifNoneExist", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BundleEntryRequest`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "method", "url", "ifNoneMatch", "ifModifiedSince", "ifMatch", "ifNoneExist", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("method", "method__ext"), ("url", "url__ext")] return required_fields class BundleEntryResponse(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Results of execution (transaction/batch/history). Indicates the results of processing the corresponding 'request' entry in the batch or transaction being responded to or what the results of an operation where when returning history. """ __resource_type__ = "BundleEntryResponse" etag: fhirtypes.StringType | None = Field( default=None, alias="etag", title="The Etag for the resource (if relevant)", description=( "The Etag for the resource, if the operation for the entry produced a " "versioned resource (see [Resource Metadata and " "Versioning](http.html#versioning) and [Managing Resource " "Contention](http.html#concurrency))." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) etag__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_etag", title="Extension field for ``etag``." ) lastModified: fhirtypes.InstantType | None = Field( default=None, alias="lastModified", title="Server's date time modified", description="The date/time that the resource was modified on the server.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastModified__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastModified", title="Extension field for ``lastModified``.", ) location: fhirtypes.UriType | None = Field( default=None, alias="location", title="The location (if the operation returns a location)", description=( "The location header created by processing this operation, populated if" " the operation returns a location." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) location__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_location", title="Extension field for ``location``." ) outcome: fhirtypes.ResourceType | None = Field( default=None, alias="outcome", title="OperationOutcome with hints and warnings (for batch/transaction)", description=( "An OperationOutcome containing hints and warnings produced as part of " "processing this entry in a batch or transaction." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.StringType | None = Field( default=None, alias="status", title="Status response code (text optional)", description=( "The status code returned by processing this entry. The status SHALL " "start with a 3 digit HTTP code (e.g. 404) and may contain the standard" " HTTP description associated with the status code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BundleEntryResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "status", "location", "etag", "lastModified", "outcome", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BundleEntryResponse`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "status", "location", "etag", "lastModified", "outcome", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class BundleEntrySearch(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Search related information. Information about the search process that lead to the creation of this entry. """ __resource_type__ = "BundleEntrySearch" mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="match | include | outcome - why this is in the result set", description=( "Why this entry is in the result set - whether it's included as a match" " or because of an _include requirement, or to convey information or " "warning information about the search process." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["match", "include", "outcome"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) score: fhirtypes.DecimalType | None = Field( default=None, alias="score", title="Search ranking (between 0 and 1)", description="When searching, the server's search ranking score for the entry.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) score__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_score", title="Extension field for ``score``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BundleEntrySearch`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "mode", "score"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BundleEntrySearch`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "mode", "score"] class BundleLink(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Links related to this Bundle. A series of links that provide context to this bundle. """ __resource_type__ = "BundleLink" relation: fhirtypes.StringType | None = Field( default=None, alias="relation", title=( "See http://www.iana.org/assignments/link-relations/link-" "relations.xhtml#link-relations-1" ), description=( "A name which details the functional use for this link - see " "[http://www.iana.org/assignments/link-relations/link-" "relations.xhtml#link-" "relations-1](http://www.iana.org/assignments/link-relations/link-" "relations.xhtml#link-relations-1)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) relation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_relation", title="Extension field for ``relation``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Reference details for the link", description="The reference details for the link.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BundleLink`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "relation", "url"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BundleLink`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "relation", "url"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("relation", "relation__ext"), ("url", "url__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/capabilitystatement.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CapabilityStatement Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class CapabilityStatement(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A statement of system capabilities. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. """ __resource_type__ = "CapabilityStatement" contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the capability statement and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the capability statement." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the capability statement was " "published. The date must change when the business version changes and " "it must change if the status code changes. In addition, it should " "change when the substantive content of the capability statement " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the capability statement", description=( "A free text natural language description of the capability statement " "from a consumer's perspective. Typically, this is used when the " "capability statement describes a desired rather than an actual " "solution, for example as a formal expression of requirements as part " "of an RFP." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) document: typing.List[fhirtypes.CapabilityStatementDocumentType] | None = Field( default=None, alias="document", title="Document definition", description="A document definition.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this capability statement is authored" " for testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) fhirVersion: fhirtypes.CodeType | None = Field( default=None, alias="fhirVersion", title="FHIR Version the system supports", description=( "The version of the FHIR specification that this CapabilityStatement " "describes (which SHALL be the same as the FHIR version of the " "CapabilityStatement itself). There is no default value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) fhirVersion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fhirVersion", title="Extension field for ``fhirVersion``." ) format: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="format", title="formats supported (xml | json | ttl | mime type)", description=( "A list of the formats supported by this implementation using their " "content types." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["formats", "json", "ttl", "mime"], }, ) format__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_format", title="Extension field for ``format``." ) implementation: fhirtypes.CapabilityStatementImplementationType | None = Field( default=None, alias="implementation", title="If this describes a specific instance", description=( "Identifies a specific implementation instance that is described by the" " capability statement - i.e. a particular installation, rather than " "the capabilities of a software program." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) implementationGuide: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="implementationGuide", title="Implementation guides supported", description=( "A list of implementation guides that the server does (or should) " "support in their entirety." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ImplementationGuide"], }, ) implementationGuide__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_implementationGuide", title="Extension field for ``implementationGuide``.", ) imports: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="imports", title="Canonical URL of another capability statement this adds to", description=( "Reference to a canonical URL of another CapabilityStatement that this " "software adds to. The capability statement automatically includes " "everything in the other statement, and it is not duplicated, though " "the server may repeat the same resources, interactions and operations " "to add additional details to them." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CapabilityStatement"], }, ) imports__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_imports", title="Extension field for ``imports``." ) instantiates: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="instantiates", title="Canonical URL of another capability statement this implements", description=( "Reference to a canonical URL of another CapabilityStatement that this " "software implements. This capability statement is a published API " "description that corresponds to a business service. The server may " "actually implement a subset of the capability statement it claims to " "implement, so the capability statement must specify the full " "capability details." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CapabilityStatement"], }, ) instantiates__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiates", title="Extension field for ``instantiates``.", ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for capability statement (if applicable)", description=( "A legal or geographic region in which the capability statement is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title="instance | capability | requirements", description=( "The way that this statement is intended to be used, to describe an " "actual running instance of software, a particular product (kind, not " "instance of software) or a class of implementation (e.g. a desired " "purchase)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["instance", "capability", "requirements"], }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) messaging: typing.List[fhirtypes.CapabilityStatementMessagingType] | None = Field( default=None, alias="messaging", title="If messaging is supported", description="A description of the messaging capabilities of the solution.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this capability statement (computer friendly)", description=( "A natural language name identifying the capability statement. This " "name should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) patchFormat: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="patchFormat", title="Patch formats supported", description=( "A list of the patch formats supported by this implementation using " "their content types." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patchFormat__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_patchFormat", title="Extension field for ``patchFormat``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the " "capability statement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this capability statement is defined", description=( "Explanation of why this capability statement is needed and why it has " "been designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) rest: typing.List[fhirtypes.CapabilityStatementRestType] | None = Field( default=None, alias="rest", title="If the endpoint is a RESTful one", description="A definition of the restful capabilities of the solution, if any.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) software: fhirtypes.CapabilityStatementSoftwareType | None = Field( default=None, alias="software", title="Software that is covered by this capability statement", description=( "Software that is covered by this capability statement. It is used " "when the capability statement describes the capabilities of a " "particular software version, independent of an installation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this capability statement. Enables tracking the life-" "cycle of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this capability statement (human friendly)", description=( "A short, descriptive, user-friendly title for the capability " "statement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this capability statement, represented as a " "URI (globally unique)" ), description=( "An absolute URI that is used to identify this capability statement " "when it is referenced in a specification, model, design or an " "instance; also called its canonical identifier. This SHOULD be " "globally unique and SHOULD be a literal address at which at which an " "authoritative instance of this capability statement is (or will be) " "published. This URL can be the target of a canonical reference. It " "SHALL remain the same when the capability statement is stored on " "different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate capability statement instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the capability statement", description=( "The identifier that is used to identify this version of the capability" " statement when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the capability " "statement author and is not expected to be globally unique. For " "example, it might be a timestamp (e.g. yyyymmdd) if a managed version " "is not available. There is also no expectation that versions can be " "placed in a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatement`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "kind", "instantiates", "imports", "software", "implementation", "fhirVersion", "format", "patchFormat", "implementationGuide", "rest", "messaging", "document", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatement`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "kind", "instantiates", "imports", "software", "implementation", "fhirVersion", "format", "patchFormat", "implementationGuide", "rest", "messaging", "document", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("date", "date__ext"), ("fhirVersion", "fhirVersion__ext"), ("format", "format__ext"), ("kind", "kind__ext"), ("status", "status__ext"), ] return required_fields class CapabilityStatementDocument(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Document definition. A document definition. """ __resource_type__ = "CapabilityStatementDocument" documentation: fhirtypes.MarkdownType | None = Field( default=None, alias="documentation", title="Description of document support", description=( "A description of how the application supports or uses the specified " "document profile. For example, when documents are created, what " "action is taken with consumed documents, etc." ), json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="producer | consumer", description=( "Mode of this document declaration - whether an application is a " "producer or consumer." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["producer", "consumer"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) profile: fhirtypes.CanonicalType | None = Field( default=None, alias="profile", title="Constraint on the resources used in the document", description=( "A profile on the document Bundle that constrains which resources are " "present, and their contents." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementDocument`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "mode", "documentation", "profile", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementDocument`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "mode", "profile"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("mode", "mode__ext"), ("profile", "profile__ext")] return required_fields class CapabilityStatementImplementation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. If this describes a specific instance. Identifies a specific implementation instance that is described by the capability statement - i.e. a particular installation, rather than the capabilities of a software program. """ __resource_type__ = "CapabilityStatementImplementation" custodian: fhirtypes.ReferenceType | None = Field( default=None, alias="custodian", title="Organization that manages the data", description=( "The organization responsible for the management of the instance and " "oversight of the data on the server at the specified URL." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Describes this specific instance", description=( "Information about the specific installation that this capability " "statement relates to." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) url: fhirtypes.UrlType | None = Field( default=None, alias="url", title="Base URL for the installation", description=( "An absolute base URL for the implementation. This forms the base for " "REST interfaces as well as the mailbox and document interfaces." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementImplementation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "url", "custodian", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementImplementation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "description", "url", "custodian"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("description", "description__ext")] return required_fields class CapabilityStatementMessaging(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. If messaging is supported. A description of the messaging capabilities of the solution. """ __resource_type__ = "CapabilityStatementMessaging" documentation: fhirtypes.MarkdownType | None = Field( default=None, alias="documentation", title="Messaging interface behavior details", description=( "Documentation about the system's messaging capabilities for this " "endpoint not otherwise documented by the capability statement. For " "example, the process for becoming an authorized messaging exchange " "partner." ), json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) endpoint: typing.List[ fhirtypes.CapabilityStatementMessagingEndpointType ] | None = Field( default=None, alias="endpoint", title="Where messages should be sent", description=( "An endpoint (network accessible address) to which messages and/or " "replies are to be sent." ), json_schema_extra={ "element_property": True, }, ) reliableCache: fhirtypes.UnsignedIntType | None = Field( default=None, alias="reliableCache", title="Reliable Message Cache Length (min)", description=( "Length if the receiver's reliable messaging cache in minutes (if a " "receiver) or how long the cache length on the receiver should be (if a" " sender)." ), json_schema_extra={ "element_property": True, }, ) reliableCache__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reliableCache", title="Extension field for ``reliableCache``.", ) supportedMessage: typing.List[ fhirtypes.CapabilityStatementMessagingSupportedMessageType ] | None = Field( default=None, alias="supportedMessage", title="Messages supported by this system", description=( "References to message definitions for messages this system can send or" " receive." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementMessaging`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "endpoint", "reliableCache", "documentation", "supportedMessage", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementMessaging`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "supportedMessage"] class CapabilityStatementMessagingEndpoint(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Where messages should be sent. An endpoint (network accessible address) to which messages and/or replies are to be sent. """ __resource_type__ = "CapabilityStatementMessagingEndpoint" address: fhirtypes.UrlType | None = Field( default=None, alias="address", title="Network address or identifier of the end-point", description=( "The network address of the endpoint. For solutions that do not use " "network addresses for routing, it can be just an identifier." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) address__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_address", title="Extension field for ``address``." ) protocol: fhirtypes.CodingType = Field( default=..., alias="protocol", title="http | ftp | mllp +", description=( "A list of the messaging transport protocol(s) identifiers, supported " "by this endpoint." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementMessagingEndpoint`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "protocol", "address"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementMessagingEndpoint`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("address", "address__ext")] return required_fields class CapabilityStatementMessagingSupportedMessage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Messages supported by this system. References to message definitions for messages this system can send or receive. """ __resource_type__ = "CapabilityStatementMessagingSupportedMessage" definition: fhirtypes.CanonicalType | None = Field( default=None, alias="definition", title="Message supported by this system", description=( "Points to a message definition that identifies the messaging event, " "message structure, allowed responses, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MessageDefinition"], }, ) definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="sender | receiver", description=( "The mode of this event declaration - whether application is sender or " "receiver." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["sender", "receiver"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementMessagingSupportedMessage`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "mode", "definition"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementMessagingSupportedMessage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "mode", "definition"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("definition", "definition__ext"), ("mode", "mode__ext")] return required_fields class CapabilityStatementRest(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. If the endpoint is a RESTful one. A definition of the restful capabilities of the solution, if any. """ __resource_type__ = "CapabilityStatementRest" compartment: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="compartment", title="Compartments served/used by system", description=( "An absolute URI which is a reference to the definition of a " "compartment that the system supports. The reference is to a " "CompartmentDefinition resource by its canonical URL ." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CompartmentDefinition"], }, ) compartment__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_compartment", title="Extension field for ``compartment``." ) documentation: fhirtypes.MarkdownType | None = Field( default=None, alias="documentation", title="General description of implementation", description=( "Information about the system's restful capabilities that apply across " "all applications, such as security." ), json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) interaction: typing.List[ fhirtypes.CapabilityStatementRestInteractionType ] | None = Field( default=None, alias="interaction", title="What operations are supported?", description="A specification of restful operations supported by the system.", json_schema_extra={ "element_property": True, }, ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="client | server", description=( "Identifies whether this portion of the statement is describing the " "ability to initiate or receive restful operations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["client", "server"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) operation: typing.List[ fhirtypes.CapabilityStatementRestResourceOperationType ] | None = Field( default=None, alias="operation", title="Definition of a system level operation", description=( "Definition of an operation or a named query together with its " "parameters and their meaning and type." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) resource: typing.List[fhirtypes.CapabilityStatementRestResourceType] | None = Field( default=None, alias="resource", title="Resource served on the REST interface", description=( "A specification of the restful capabilities of the solution for a " "specific resource type." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) searchParam: typing.List[ fhirtypes.CapabilityStatementRestResourceSearchParamType ] | None = Field( default=None, alias="searchParam", title="Search parameters for searching all resources", description=( "Search parameters that are supported for searching all resources for " "implementations to support and/or make use of - either references to " "ones defined in the specification, or additional ones defined for/by " "the implementation." ), json_schema_extra={ "element_property": True, }, ) security: fhirtypes.CapabilityStatementRestSecurityType | None = Field( default=None, alias="security", title="Information about security of implementation", description=( "Information about security implementation from an interface " "perspective - what a client needs to know." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementRest`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "mode", "documentation", "security", "resource", "interaction", "searchParam", "operation", "compartment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementRest`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "mode", "security", "resource", "operation"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("mode", "mode__ext")] return required_fields class CapabilityStatementRestInteraction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What operations are supported?. A specification of restful operations supported by the system. """ __resource_type__ = "CapabilityStatementRestInteraction" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="transaction | batch | search-system | history-system", description="A coded identifier of the operation, supported by the system.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["transaction", "batch", "search-system", "history-system"], }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) documentation: fhirtypes.MarkdownType | None = Field( default=None, alias="documentation", title="Anything special about operation behavior", description=( "Guidance specific to the implementation of this operation, such as " "limitations on the kind of transactions allowed, or information about " "system wide search is implemented." ), json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementRestInteraction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "documentation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestInteraction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields class CapabilityStatementRestResource(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Resource served on the REST interface. A specification of the restful capabilities of the solution for a specific resource type. """ __resource_type__ = "CapabilityStatementRestResource" conditionalCreate: bool | None = Field( default=None, alias="conditionalCreate", title="If allows/uses conditional create", description="A flag that indicates that the server supports conditional create.", json_schema_extra={ "element_property": True, }, ) conditionalCreate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_conditionalCreate", title="Extension field for ``conditionalCreate``.", ) conditionalDelete: fhirtypes.CodeType | None = Field( default=None, alias="conditionalDelete", title=( "not-supported | single | multiple - how conditional delete is " "supported" ), description="A code that indicates how the server supports conditional delete.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["not-supported", "single", "multiple"], }, ) conditionalDelete__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_conditionalDelete", title="Extension field for ``conditionalDelete``.", ) conditionalRead: fhirtypes.CodeType | None = Field( default=None, alias="conditionalRead", title="not-supported | modified-since | not-match | full-support", description="A code that indicates how the server supports conditional read.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "not-supported", "modified-since", "not-match", "full-support", ], }, ) conditionalRead__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_conditionalRead", title="Extension field for ``conditionalRead``.", ) conditionalUpdate: bool | None = Field( default=None, alias="conditionalUpdate", title="If allows/uses conditional update", description="A flag that indicates that the server supports conditional update.", json_schema_extra={ "element_property": True, }, ) conditionalUpdate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_conditionalUpdate", title="Extension field for ``conditionalUpdate``.", ) documentation: fhirtypes.MarkdownType | None = Field( default=None, alias="documentation", title="Additional information about the use of the resource type", description="Additional information about the resource type used by the system.", json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) interaction: typing.List[ fhirtypes.CapabilityStatementRestResourceInteractionType ] | None = Field( default=None, alias="interaction", title="What operations are supported?", description="Identifies a restful operation supported by the solution.", json_schema_extra={ "element_property": True, }, ) operation: typing.List[ fhirtypes.CapabilityStatementRestResourceOperationType ] | None = Field( default=None, alias="operation", title="Definition of a resource operation", description=( "Definition of an operation or a named query together with its " "parameters and their meaning and type. Consult the definition of the " "operation for details about how to invoke the operation, and the " "parameters." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) profile: fhirtypes.CanonicalType | None = Field( default=None, alias="profile", title="Base System profile for all uses of resource", description=( "A specification of the profile that describes the solution's overall " "support for the resource, including any constraints on cardinality, " "bindings, lengths or other limitations. See further discussion in " "[Using Profiles](profiling.html#profile-uses)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) readHistory: bool | None = Field( default=None, alias="readHistory", title="Whether vRead can return past versions", description=( "A flag for whether the server is able to return past versions as part " "of the vRead operation." ), json_schema_extra={ "element_property": True, }, ) readHistory__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_readHistory", title="Extension field for ``readHistory``." ) referencePolicy: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="referencePolicy", title="literal | logical | resolves | enforced | local", description="A set of flags that defines how references are supported.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["literal", "logical", "resolves", "enforced", "local"], }, ) referencePolicy__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_referencePolicy", title="Extension field for ``referencePolicy``.", ) searchInclude: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="searchInclude", title="_include values supported by the server", description="A list of _include values supported by the server.", json_schema_extra={ "element_property": True, }, ) searchInclude__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_searchInclude", title="Extension field for ``searchInclude``.", ) searchParam: typing.List[ fhirtypes.CapabilityStatementRestResourceSearchParamType ] | None = Field( default=None, alias="searchParam", title="Search parameters supported by implementation", description=( "Search parameters for implementations to support and/or make use of - " "either references to ones defined in the specification, or additional " "ones defined for/by the implementation." ), json_schema_extra={ "element_property": True, }, ) searchRevInclude: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="searchRevInclude", title="_revinclude values supported by the server", description=( "A list of _revinclude (reverse include) values supported by the " "server." ), json_schema_extra={ "element_property": True, }, ) searchRevInclude__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_searchRevInclude", title="Extension field for ``searchRevInclude``.", ) supportedProfile: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="supportedProfile", title="Profiles for use cases supported", description=( "A list of profiles that represent different use cases supported by the" ' system. For a server, "supported by the system" means the system ' "hosts/produces a set of resources that are conformant to a particular " "profile, and allows clients that use its services to search using this" " profile and to find appropriate data. For a client, it means the " "system will search by this profile and process data according to the " "guidance implicit in the profile. See further discussion in [Using " "Profiles](profiling.html#profile-uses)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) supportedProfile__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_supportedProfile", title="Extension field for ``supportedProfile``.", ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="A resource type that is supported", description="A type of resource exposed via the restful interface.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) updateCreate: bool | None = Field( default=None, alias="updateCreate", title="If update can commit to a new identity", description=( "A flag to indicate that the server allows or needs to allow the client" " to create new identities on the server (that is, the client PUTs to a" " location where there is no existing resource). Allowing this " "operation means that the server allows the client to create new " "identities on the server." ), json_schema_extra={ "element_property": True, }, ) updateCreate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_updateCreate", title="Extension field for ``updateCreate``.", ) versioning: fhirtypes.CodeType | None = Field( default=None, alias="versioning", title="no-version | versioned | versioned-update", description=( "This field is set to no-version to specify that the system does not " "support (server) or use (client) versioning for this resource type. If" " this has some other value, the server must at least correctly track " "and populate the versionId meta-property on resources. If the value is" " 'versioned-update', then the server supports all the versioning " "features, including using e-tags for version integrity in the API." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["no-version", "versioned", "versioned-update"], }, ) versioning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versioning", title="Extension field for ``versioning``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementRestResource`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "profile", "supportedProfile", "documentation", "interaction", "versioning", "readHistory", "updateCreate", "conditionalCreate", "conditionalRead", "conditionalUpdate", "conditionalDelete", "referencePolicy", "searchInclude", "searchRevInclude", "searchParam", "operation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestResource`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "profile", "supportedProfile", "operation"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields class CapabilityStatementRestResourceInteraction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What operations are supported?. Identifies a restful operation supported by the solution. """ __resource_type__ = "CapabilityStatementRestResourceInteraction" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title=( "read | vread | update | patch | delete | history-instance | history-" "type | create | search-type" ), description="Coded identifier of the operation, supported by the system resource.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "read", "vread", "update", "patch", "delete", "history-instance", "history-type", "create", "search-type", ], }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) documentation: fhirtypes.MarkdownType | None = Field( default=None, alias="documentation", title="Anything special about operation behavior", description=( "Guidance specific to the implementation of this operation, such as " "'delete is a logical delete' or 'updates are only allowed with version" " id' or 'creates permitted from pre-authorized certificates only'." ), json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementRestResourceInteraction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "documentation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestResourceInteraction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields class CapabilityStatementRestResourceOperation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of a resource operation. Definition of an operation or a named query together with its parameters and their meaning and type. Consult the definition of the operation for details about how to invoke the operation, and the parameters. """ __resource_type__ = "CapabilityStatementRestResourceOperation" definition: fhirtypes.CanonicalType | None = Field( default=None, alias="definition", title="The defined operation/query", description=( "Where the formal definition can be found. If a server references the " "base definition of an Operation (i.e. from the specification itself " "such as ```http://hl7.org/fhir/OperationDefinition/ValueSet-" "expand```), that means it supports the full capabilities of the " "operation - e.g. both GET and POST invocation. If it only supports a " "subset, it must define its own custom " "[OperationDefinition](operationdefinition.html#) with a 'base' of the " "original OperationDefinition. The custom definition would describe " "the specific subset of functionality supported." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["OperationDefinition"], }, ) definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) documentation: fhirtypes.MarkdownType | None = Field( default=None, alias="documentation", title="Specific details about operation behavior", description=( "Documentation that describes anything special about the operation " "behavior, possibly detailing different behavior for system, type and " "instance-level invocation of the operation." ), json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name by which the operation/query is invoked", description=( "The name of the operation or query. For an operation, this is the name" " prefixed with $ and used in the URL. For a query, this is the name " "used in the _query parameter when the query is called." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementRestResourceOperation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "definition", "documentation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestResourceOperation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "name", "definition"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("definition", "definition__ext"), ("name", "name__ext")] return required_fields class CapabilityStatementRestResourceSearchParam(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Search parameters supported by implementation. Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation. """ __resource_type__ = "CapabilityStatementRestResourceSearchParam" definition: fhirtypes.CanonicalType | None = Field( default=None, alias="definition", title="Source of definition for parameter", description=( "An absolute URI that is a formal reference to where this parameter was" " first defined, so that a client can be confident of the meaning of " "the search parameter (a reference to " "[SearchParameter.url](searchparameter-" "definitions.html#SearchParameter.url)). This element SHALL be " "populated if the search parameter refers to a SearchParameter defined " "by the FHIR core specification or externally defined IGs." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SearchParameter"], }, ) definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) documentation: fhirtypes.MarkdownType | None = Field( default=None, alias="documentation", title="Server-specific usage", description=( "This allows documentation of any distinct behaviors about how the " "search parameter is used. For example, text matching algorithms." ), json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name of search parameter", description="The name of the search parameter used in the interface.", json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "number | date | string | token | reference | composite | quantity | " "uri | special" ), description=( "The type of value a search parameter refers to, and how the content is" " interpreted." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "number", "date", "string", "token", "reference", "composite", "quantity", "uri", "special", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementRestResourceSearchParam`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "definition", "type", "documentation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestResourceSearchParam`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext"), ("type", "type__ext")] return required_fields class CapabilityStatementRestSecurity(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about security of implementation. Information about security implementation from an interface perspective - what a client needs to know. """ __resource_type__ = "CapabilityStatementRestSecurity" cors: bool | None = Field( default=None, alias="cors", title="Adds CORS Headers (http://enable-cors.org/)", description=( "Server adds CORS headers when responding to requests - this enables " "Javascript applications to use the server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) cors__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_cors", title="Extension field for ``cors``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="General description of how security works", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) service: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="service", title="OAuth | SMART-on-FHIR | NTLM | Basic | Kerberos | Certificates", description="Types of security services that are supported/required by the system.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementRestSecurity`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "cors", "service", "description", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestSecurity`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "cors", "service"] class CapabilityStatementSoftware(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Software that is covered by this capability statement. Software that is covered by this capability statement. It is used when the capability statement describes the capabilities of a particular software version, independent of an installation. """ __resource_type__ = "CapabilityStatementSoftware" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="A name the software is known by", description="Name the software is known by.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) releaseDate: fhirtypes.DateTimeType | None = Field( default=None, alias="releaseDate", title="Date this version was released", description="Date this version of the software was released.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) releaseDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_releaseDate", title="Extension field for ``releaseDate``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Version covered by this statement", description="The version identifier for the software covered by this statement.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementSoftware`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "version", "releaseDate", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementSoftware`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "name", "version", "releaseDate"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/careplan.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CarePlan Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class CarePlan(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Healthcare plan for patient or group. Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions. """ __resource_type__ = "CarePlan" activity: typing.List[fhirtypes.CarePlanActivityType] | None = Field( default=None, alias="activity", title="Action to occur as part of plan", description=( "Identifies a planned action to occur as part of the plan. For " "example, a medication to be used, lab tests to perform, self-" "monitoring, education, etc." ), json_schema_extra={ "element_property": True, }, ) addresses: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="addresses", title="Health issues this plan addresses", description=( "Identifies the conditions/problems/concerns/diagnoses/etc. whose " "management and/or mitigation are handled by this plan." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="Who is the designated responsible party", description=( "When populated, the author is responsible for the care plan. The care" " plan is attributed to the author." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "Device", "RelatedPerson", "Organization", "CareTeam", ], }, ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Fulfills CarePlan", description="A care plan that is fulfilled in whole or in part by this care plan.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CarePlan"], }, ) careTeam: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="careTeam", title="Who's involved in plan?", description=( "Identifies all people and organizations who are expected to be " "involved in the care envisioned by this plan." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CareTeam"], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Type of plan", description=( 'Identifies what "kind" of plan this is to support differentiation ' 'between multiple co-existing plans; e.g. "Home health", "psychiatric",' ' "asthma", "disease management", "wellness plan", etc.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contributor: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="contributor", title="Who provided the content of the care plan", description=( "Identifies the individual(s) or organization who provided the contents" " of the care plan." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "Device", "RelatedPerson", "Organization", "CareTeam", ], }, ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Date record was first recorded", description=( "Represents when this particular CarePlan record was created in the " "system, which is often a system-generated date." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Summary of nature of plan", description="A description of the scope and nature of the plan.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter created as part of", description=( "The Encounter during which this CarePlan was created or to which the " "creation of this record is tightly associated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) goal: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="goal", title="Desired outcome of plan", description="Describes the intended objective(s) of carrying out the care plan.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Goal"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Ids for this plan", description=( "Business identifiers assigned to this care plan by the performer or " "other systems which remain constant as the resource is updated and " "propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="instantiatesCanonical", title="Instantiates FHIR protocol or definition", description=( "The URL pointing to a FHIR-defined protocol, guideline, questionnaire " "or other definition that is adhered to in whole or in part by this " "CarePlan." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "PlanDefinition", "Questionnaire", "Measure", "ActivityDefinition", "OperationDefinition", ], }, ) instantiatesCanonical__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="instantiatesUri", title="Instantiates external protocol or definition", description=( "The URL pointing to an externally maintained protocol, guideline, " "questionnaire or other definition that is adhered to in whole or in " "part by this CarePlan." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) intent: fhirtypes.CodeType | None = Field( default=None, alias="intent", title="proposal | plan | order | option", description=( "Indicates the level of authority/intentionality associated with the " "care plan and where the care plan fits into the workflow chain." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["proposal", "plan", "order", "option"], }, ) intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intent", title="Extension field for ``intent``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments about the plan", description="General notes about the care plan not covered elsewhere.", json_schema_extra={ "element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced CarePlan", description=( "A larger care plan of which this particular care plan is a component " "or step." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CarePlan"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period plan covers", description=( "Indicates when the plan did (or is intended to) come into effect and " "end." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) replaces: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="replaces", title="CarePlan replaced by this CarePlan", description=( "Completed or terminated care plan whose function is taken by this new " "care plan." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CarePlan"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "draft | active | on-hold | revoked | completed | entered-in-error | " "unknown" ), description=( "Indicates whether the plan is currently being acted upon, represents " "future intentions or is now a historical record." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "draft", "active", "on-hold", "revoked", "completed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who the care plan is for", description=( "Identifies the patient or group whose intended care is described by " "the plan." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInfo", title="Information considered as part of plan", description=( "Identifies portions of the patient's record that specifically " "influenced the formation of the plan. These might include " "comorbidities, recent procedures, limitations, recent assessments, " "etc." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Human-friendly name for the care plan", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CarePlan`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "replaces", "partOf", "status", "intent", "category", "title", "description", "subject", "encounter", "period", "created", "author", "contributor", "careTeam", "addresses", "supportingInfo", "goal", "activity", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CarePlan`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "replaces", "partOf", "status", "intent", "category", "title", "description", "subject", "encounter", "period", "created", "author", "addresses", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("intent", "intent__ext"), ("status", "status__ext")] return required_fields class CarePlanActivity(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Action to occur as part of plan. Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc. """ __resource_type__ = "CarePlanActivity" detail: fhirtypes.CarePlanActivityDetailType | None = Field( default=None, alias="detail", title="In-line definition of activity", description=( "A simple summary of a planned activity suitable for a general care " "plan system (e.g. form driven) that doesn't know about specific " "resources such as procedure etc." ), json_schema_extra={ "element_property": True, }, ) outcomeCodeableConcept: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="outcomeCodeableConcept", title="Results of the activity", description=( "Identifies the outcome at the point when the status of the activity is" " assessed. For example, the outcome of an education activity could be" " patient understands (or not)." ), json_schema_extra={ "element_property": True, }, ) outcomeReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="outcomeReference", title="Appointment, Encounter, Procedure, etc.", description=( "Details of the outcome or action resulting from the activity. The " 'reference to an "event" resource, such as Procedure or Encounter or ' "Observation, is the result/outcome of the activity itself. The " "activity can be conveyed using CarePlan.activity.detail OR using the " "CarePlan.activity.reference (a reference to a \u201crequest\u201d resource)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) progress: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="progress", title="Comments about the activity status/progress", description="Notes about the adherence/status/progress of the activity.", json_schema_extra={ "element_property": True, }, ) reference: fhirtypes.ReferenceType | None = Field( default=None, alias="reference", title="Activity details defined in specific resource", description=( "The details of the proposed activity represented in a specific " "resource." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Appointment", "CommunicationRequest", "DeviceRequest", "MedicationRequest", "NutritionOrder", "Task", "ServiceRequest", "VisionPrescription", "RequestGroup", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CarePlanActivity`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "outcomeCodeableConcept", "outcomeReference", "progress", "reference", "detail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CarePlanActivity`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CarePlanActivityDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. In-line definition of activity. A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc. """ __resource_type__ = "CarePlanActivityDetail" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Detail type of activity", description=( "Detailed description of the type of planned activity; e.g. what lab " "test, what procedure, what kind of encounter." ), json_schema_extra={ "element_property": True, }, ) dailyAmount: fhirtypes.QuantityType | None = Field( default=None, alias="dailyAmount", title="How to consume/day?", description="Identifies the quantity expected to be consumed in a given day.", json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Extra info describing activity to perform", description=( "This provides a textual description of constraints on the intended " "activity occurrence, including relation to other activities. It may " "also include objectives, pre-conditions and end-conditions. Finally, " "it may convey specifics about the activity such as body site, method, " "route, etc." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) doNotPerform: bool | None = Field( default=None, alias="doNotPerform", title="If true, activity is prohibiting action", description=( "If true, indicates that the described activity is one that must NOT be" " engaged in when following the plan. If false, or missing, indicates " "that the described activity is one that should be engaged in when " "following the plan." ), json_schema_extra={ "element_property": True, }, ) doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doNotPerform", title="Extension field for ``doNotPerform``.", ) goal: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="goal", title="Goals this activity relates to", description=( "Internal reference that identifies the goals that this activity is " "intended to contribute towards meeting." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Goal"], }, ) instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="instantiatesCanonical", title="Instantiates FHIR protocol or definition", description=( "The URL pointing to a FHIR-defined protocol, guideline, questionnaire " "or other definition that is adhered to in whole or in part by this " "CarePlan activity." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "PlanDefinition", "ActivityDefinition", "Questionnaire", "Measure", "OperationDefinition", ], }, ) instantiatesCanonical__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="instantiatesUri", title="Instantiates external protocol or definition", description=( "The URL pointing to an externally maintained protocol, guideline, " "questionnaire or other definition that is adhered to in whole or in " "part by this CarePlan activity." ), json_schema_extra={ "element_property": True, }, ) instantiatesUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title=( "Appointment | CommunicationRequest | DeviceRequest | MedicationRequest" " | NutritionOrder | Task | ServiceRequest | VisionPrescription" ), description=( "A description of the kind of resource the in-line definition of a care" " plan activity is representing. The CarePlan.activity.detail is an " "in-line definition when a resource is not referenced using " "CarePlan.activity.reference. For example, a MedicationRequest, a " "ServiceRequest, or a CommunicationRequest." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "Appointment", "CommunicationRequest", "DeviceRequest", "MedicationRequest", "NutritionOrder", "Task", "ServiceRequest", "VisionPrescription", ], }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where it should happen", description=( "Identifies the facility where the activity will occur; e.g. home, " "hospital, specific clinic, etc." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) performer: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="performer", title="Who will be responsible?", description="Identifies who's expected to be involved in the activity.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "RelatedPerson", "Patient", "CareTeam", "HealthcareService", "Device", ], }, ) productCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productCodeableConcept", title="What is to be administered/supplied", description=( "Identifies the food, drug or other product to be consumed or supplied " "in the activity." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e product[x] "one_of_many": "product", "one_of_many_required": False, }, ) productReference: fhirtypes.ReferenceType | None = Field( default=None, alias="productReference", title="What is to be administered/supplied", description=( "Identifies the food, drug or other product to be consumed or supplied " "in the activity." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e product[x] "one_of_many": "product", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication", "Substance"], }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="How much to administer/supply/consume", description=( "Identifies the quantity expected to be supplied, administered or " "consumed by the subject." ), json_schema_extra={ "element_property": True, }, ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Why activity should be done or why activity was prohibited", description=( "Provides the rationale that drove the inclusion of this particular " "activity as part of the plan or the reason why the activity was " "prohibited." ), json_schema_extra={ "element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Why activity is needed", description=( "Indicates another resource, such as the health condition(s), whose " "existence justifies this request and drove the inclusion of this " "particular activity as part of the plan." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "DiagnosticReport", "DocumentReference", ], }, ) scheduledPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="scheduledPeriod", title="When activity is to occur", description=( "The period, timing or frequency upon which the described activity is " "to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e scheduled[x] "one_of_many": "scheduled", "one_of_many_required": False, }, ) scheduledString: fhirtypes.StringType | None = Field( default=None, alias="scheduledString", title="When activity is to occur", description=( "The period, timing or frequency upon which the described activity is " "to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e scheduled[x] "one_of_many": "scheduled", "one_of_many_required": False, }, ) scheduledString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_scheduledString", title="Extension field for ``scheduledString``.", ) scheduledTiming: fhirtypes.TimingType | None = Field( default=None, alias="scheduledTiming", title="When activity is to occur", description=( "The period, timing or frequency upon which the described activity is " "to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e scheduled[x] "one_of_many": "scheduled", "one_of_many_required": False, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "not-started | scheduled | in-progress | on-hold | completed | " "cancelled | stopped | unknown | entered-in-error" ), description="Identifies what progress is being made for the specific activity.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "not-started", "scheduled", "in-progress", "on-hold", "completed", "cancelled", "stopped", "unknown", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="statusReason", title="Reason for current status", description=( "Provides reason why the activity isn't yet started, is on hold, was " "cancelled, etc." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CarePlanActivityDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "kind", "instantiatesCanonical", "instantiatesUri", "code", "reasonCode", "reasonReference", "goal", "status", "statusReason", "doNotPerform", "scheduledTiming", "scheduledPeriod", "scheduledString", "location", "performer", "productCodeableConcept", "productReference", "dailyAmount", "quantity", "description", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CarePlanActivityDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "product": ["productCodeableConcept", "productReference"], "scheduled": ["scheduledPeriod", "scheduledString", "scheduledTiming"], } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/careteam.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CareTeam Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class CareTeam(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Planned participants in the coordination and delivery of care for a patient or group. The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient. """ __resource_type__ = "CareTeam" category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Type of team", description=( "Identifies what kind of team. This is to support differentiation " "between multiple co-existing teams, such as care plan team, episode of" " care team, longitudinal care team." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter created as part of", description=( "The Encounter during which this CareTeam was created or to which the " "creation of this record is tightly associated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Ids for this team", description=( "Business identifiers assigned to this care team by the performer or " "other systems which remain constant as the resource is updated and " "propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) managingOrganization: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="managingOrganization", title="Organization responsible for the care team", description="The organization responsible for the care team.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name of the team, such as crisis assessment team", description=( "A label for human use intended to distinguish like teams. E.g. the " '"red" vs. "green" trauma teams.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the CareTeam", description=None, json_schema_extra={ "element_property": True, }, ) participant: typing.List[fhirtypes.CareTeamParticipantType] | None = Field( default=None, alias="participant", title="Members of the team", description=( "Identifies all people and organizations who are expected to be " "involved in the care team." ), json_schema_extra={ "element_property": True, }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period team covers", description=( "Indicates when the team did (or is intended to) come into effect and " "end." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Why the care team exists", description="Describes why the care team exists.", json_schema_extra={ "element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Why the care team exists", description="Condition(s) that this care team addresses.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="proposed | active | suspended | inactive | entered-in-error", description="Indicates the current state of the care team.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "proposed", "active", "suspended", "inactive", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Who care team is for", description=( "Identifies the patient or group whose intended care is handled by the " "team." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="A contact detail for the care team (that applies to all members)", description=( "A central contact detail for the care team (that applies to all " "members)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CareTeam`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "category", "name", "subject", "encounter", "period", "participant", "reasonCode", "reasonReference", "managingOrganization", "telecom", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CareTeam`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "category", "name", "subject", "encounter", "period", "managingOrganization", ] class CareTeamParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Members of the team. Identifies all people and organizations who are expected to be involved in the care team. """ __resource_type__ = "CareTeamParticipant" member: fhirtypes.ReferenceType | None = Field( default=None, alias="member", title="Who is involved", description=( "The specific person or organization who is participating/expected to " "participate in the care team." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "RelatedPerson", "Patient", "Organization", "CareTeam", ], }, ) onBehalfOf: fhirtypes.ReferenceType | None = Field( default=None, alias="onBehalfOf", title="Organization of the practitioner", description="The organization of the practitioner.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period of participant", description=( "Indicates when the specific member or organization did (or is intended" " to) come into effect and end." ), json_schema_extra={ "element_property": True, }, ) role: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="role", title="Type of involvement", description=( "Indicates specific responsibility of an individual within the care " 'team, such as "Primary care physician", "Trained social worker ' 'counselor", "Caregiver", etc.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CareTeamParticipant`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "role", "member", "onBehalfOf", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CareTeamParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "role", "member", "onBehalfOf"] ================================================ FILE: fhir/resources/R4B/catalogentry.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CatalogEntry Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class CatalogEntry(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An entry in a catalog. Catalog entries are wrappers that contextualize items included in a catalog. """ __resource_type__ = "CatalogEntry" additionalCharacteristic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="additionalCharacteristic", title="Additional characteristics of the catalog entry", description="Used for examplefor Out of Formulary, or any specifics.", json_schema_extra={ "element_property": True, }, ) additionalClassification: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="additionalClassification", title="Additional classification of the catalog entry", description="User for example for ATC classification, or.", json_schema_extra={ "element_property": True, }, ) additionalIdentifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="additionalIdentifier", title=( "Any additional identifier(s) for the catalog item, in the same " "granularity or concept" ), description="Used in supporting related concepts, e.g. NDC to RxNorm.", json_schema_extra={ "element_property": True, }, ) classification: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="classification", title="Classification (category or class) of the item entry", description="Classes of devices, or ATC for medication.", json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique identifier of the catalog item", description=( "Used in supporting different identifiers for the same product, e.g. " "manufacturer code and retailer code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastUpdated: fhirtypes.DateTimeType | None = Field( default=None, alias="lastUpdated", title="When was this catalog last updated", description=( "Typically date of issue is different from the beginning of the " "validity. This can be used to see when an item was last updated." ), json_schema_extra={ "element_property": True, }, ) lastUpdated__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastUpdated", title="Extension field for ``lastUpdated``." ) orderable: bool | None = Field( default=None, alias="orderable", title="Whether the entry represents an orderable item", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) orderable__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_orderable", title="Extension field for ``orderable``." ) referencedItem: fhirtypes.ReferenceType = Field( default=..., alias="referencedItem", title="The item that is being defined", description="The item in a catalog or definition.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Medication", "Device", "Organization", "Practitioner", "PractitionerRole", "HealthcareService", "ActivityDefinition", "PlanDefinition", "SpecimenDefinition", "ObservationDefinition", "Binary", ], }, ) relatedEntry: typing.List[fhirtypes.CatalogEntryRelatedEntryType] | None = Field( default=None, alias="relatedEntry", title="An item that this catalog entry is related to", description=( "Used for example, to point to a substance, or to a device used to " "administer a medication." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "Used to support catalog exchange even for unsupported products, e.g. " "getting list of medications even if not prescribable." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The type of item - medication, device, service, protocol or other", description=None, json_schema_extra={ "element_property": True, }, ) validTo: fhirtypes.DateTimeType | None = Field( default=None, alias="validTo", title="The date until which this catalog entry is expected to be active", description=None, json_schema_extra={ "element_property": True, }, ) validTo__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_validTo", title="Extension field for ``validTo``." ) validityPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="validityPeriod", title="The time period in which this catalog entry is expected to be active", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CatalogEntry`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "type", "orderable", "referencedItem", "additionalIdentifier", "classification", "status", "validityPeriod", "validTo", "lastUpdated", "additionalCharacteristic", "additionalClassification", "relatedEntry", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CatalogEntry`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "orderable", "referencedItem", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("orderable", "orderable__ext")] return required_fields class CatalogEntryRelatedEntry(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An item that this catalog entry is related to. Used for example, to point to a substance, or to a device used to administer a medication. """ __resource_type__ = "CatalogEntryRelatedEntry" item: fhirtypes.ReferenceType = Field( default=..., alias="item", title="The reference to the related item", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CatalogEntry"], }, ) relationtype: fhirtypes.CodeType | None = Field( default=None, alias="relationtype", title="triggers | is-replaced-by", description=( "The type of relation to the related item: child, parent, " "packageContent, containerPackage, usedIn, uses, requires, etc." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["triggers", "is-replaced-by"], }, ) relationtype__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_relationtype", title="Extension field for ``relationtype``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CatalogEntryRelatedEntry`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "relationtype", "item"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CatalogEntryRelatedEntry`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("relationtype", "relationtype__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/chargeitem.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ChargeItem Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ChargeItem(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Item containing charge code(s) associated with the provision of healthcare provider products. The resource ChargeItem describes the provision of healthcare provider products for a certain patient, therefore referring not only to the product, but containing in addition details of the provision, like date, time, amounts and participating organizations and persons. Main Usage of the ChargeItem is to enable the billing process and internal cost allocation. """ __resource_type__ = "ChargeItem" account: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="account", title="Account to place this charge", description="Account into which this ChargeItems belongs.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Account"], }, ) bodysite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="bodysite", title="Anatomical location, if relevant", description="The anatomical location where the related service has been applied.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="A code that identifies the charge, like a billing code", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Encounter / Episode associated with event", description=( "The encounter or episode of care that establishes the context for this" " event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) costCenter: fhirtypes.ReferenceType | None = Field( default=None, alias="costCenter", title="Organization that has ownership of the (potential, future) revenue", description="The financial cost center permits the tracking of charge attribution.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) definitionCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="definitionCanonical", title="Resource defining the code of this ChargeItem", description=( "References the source of pricing information, rules of application for" " the code this ChargeItem uses." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ChargeItemDefinition"], }, ) definitionCanonical__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_definitionCanonical", title="Extension field for ``definitionCanonical``.", ) definitionUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="definitionUri", title="Defining information about the code of this charge item", description=( "References the (external) source of pricing information, rules of " "application for the code this ChargeItem uses." ), json_schema_extra={ "element_property": True, }, ) definitionUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_definitionUri", title="Extension field for ``definitionUri``.", ) enteredDate: fhirtypes.DateTimeType | None = Field( default=None, alias="enteredDate", title="Date the charge item was entered", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) enteredDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_enteredDate", title="Extension field for ``enteredDate``." ) enterer: fhirtypes.ReferenceType | None = Field( default=None, alias="enterer", title="Individual who was entering", description="The device, practitioner, etc. who entered the charge item.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Patient", "Device", "RelatedPerson", ], }, ) factorOverride: fhirtypes.DecimalType | None = Field( default=None, alias="factorOverride", title="Factor overriding the associated rules", description=( "Factor overriding the factor determined by the rules associated with " "the code." ), json_schema_extra={ "element_property": True, }, ) factorOverride__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factorOverride", title="Extension field for ``factorOverride``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for item", description="Identifiers assigned to this event performer or other systems.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the ChargeItem", description=( "Comments made about the event by the performer, subject or other " "participants." ), json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When the charged service was applied", description="Date/time(s) or duration when the charged service was applied.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="When the charged service was applied", description="Date/time(s) or duration when the charged service was applied.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceTiming: fhirtypes.TimingType | None = Field( default=None, alias="occurrenceTiming", title="When the charged service was applied", description="Date/time(s) or duration when the charged service was applied.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) overrideReason: fhirtypes.StringType | None = Field( default=None, alias="overrideReason", title="Reason for overriding the list price/factor", description=( "If the list price or the rule-based factor associated with the code is" " overridden, this attribute can capture a text to indicate the reason" " for this action." ), json_schema_extra={ "element_property": True, }, ) overrideReason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_overrideReason", title="Extension field for ``overrideReason``.", ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced ChargeItem", description=( "ChargeItems can be grouped to larger ChargeItems covering the whole " "set." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ChargeItem"], }, ) performer: typing.List[fhirtypes.ChargeItemPerformerType] | None = Field( default=None, alias="performer", title="Who performed charged service", description=( "Indicates who or what performed or participated in the charged " "service." ), json_schema_extra={ "element_property": True, }, ) performingOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="performingOrganization", title="Organization providing the charged service", description="The organization requesting the service.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) priceOverride: fhirtypes.MoneyType | None = Field( default=None, alias="priceOverride", title="Price overriding the associated rules", description=( "Total price of the charge overriding the list price associated with " "the code." ), json_schema_extra={ "element_property": True, }, ) productCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productCodeableConcept", title="Product charged", description=( "Identifies the device, food, drug or other product being charged " "either by type code or reference to an instance." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e product[x] "one_of_many": "product", "one_of_many_required": False, }, ) productReference: fhirtypes.ReferenceType | None = Field( default=None, alias="productReference", title="Product charged", description=( "Identifies the device, food, drug or other product being charged " "either by type code or reference to an instance." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e product[x] "one_of_many": "product", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device", "Medication", "Substance"], }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Quantity of which the charge item has been serviced", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reason", title="Why was the charged service rendered?", description="Describes why the event occurred in coded or textual form.", json_schema_extra={ "element_property": True, }, ) requestingOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="requestingOrganization", title="Organization requesting the charged service", description="The organization performing the service.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) service: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="service", title="Which rendered service is being charged?", description="Indicated the rendered service that caused this charge.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "DiagnosticReport", "ImagingStudy", "Immunization", "MedicationAdministration", "MedicationDispense", "Observation", "Procedure", "SupplyDelivery", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "planned | billable | not-billable | aborted | billed | entered-in-" "error | unknown" ), description="The current state of the ChargeItem.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "planned", "billable", "not-billable", "aborted", "billed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Individual service was done for/to", description=( "The individual or set of individuals the action is being or was " "performed on." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInformation", title="Further information supporting this charge", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ChargeItem`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "definitionUri", "definitionCanonical", "status", "partOf", "code", "subject", "context", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "performer", "performingOrganization", "requestingOrganization", "costCenter", "quantity", "bodysite", "factorOverride", "priceOverride", "overrideReason", "enterer", "enteredDate", "reason", "service", "productReference", "productCodeableConcept", "account", "note", "supportingInformation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ChargeItem`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "code", "subject", "context", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "quantity", "bodysite", "enterer", "enteredDate", "account", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "occurrence": [ "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", ], "product": ["productCodeableConcept", "productReference"], } return one_of_many_fields class ChargeItemPerformer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who performed charged service. Indicates who or what performed or participated in the charged service. """ __resource_type__ = "ChargeItemPerformer" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Individual who was performing", description=( "The device, practitioner, etc. who performed or participated in the " "service." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", "Patient", "Device", "RelatedPerson", ], }, ) function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="What type of performance was done", description=( "Describes the type of performance or participation(e.g. primary " "surgeon, anesthesiologiest, etc.)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ChargeItemPerformer`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "function", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ChargeItemPerformer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/chargeitemdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ChargeItemDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ChargeItemDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of properties and rules about how the price and the applicability of a ChargeItem can be determined. The ChargeItemDefinition resource provides the properties that apply to the (billing) codes necessary to calculate costs and prices. The properties may differ largely depending on type and realm, therefore this resource gives only a rough structure and requires profiling for each type of billing code system. """ __resource_type__ = "ChargeItemDefinition" applicability: typing.List[ fhirtypes.ChargeItemDefinitionApplicabilityType ] | None = Field( default=None, alias="applicability", title="Whether or not the billing code is applicable", description="Expressions that describe applicability criteria for the billing code.", json_schema_extra={ "element_property": True, }, ) approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the charge item definition was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Billing codes or product types this definition applies to", description=( "The defined billing details in this resource pertain to the given " "billing code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the charge item definition and/or " "its contents. Copyright statements are generally legal restrictions on" " the use and publishing of the charge item definition." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the charge item definition was " "published. The date must change when the business version changes and " "it must change if the status code changes. In addition, it should " "change when the substantive content of the charge item definition " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) derivedFromUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="derivedFromUri", title="Underlying externally-defined charge item definition", description=( "The URL pointing to an externally-defined charge item definition that " "is adhered to in whole or in part by this definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) derivedFromUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_derivedFromUri", title="Extension field for ``derivedFromUri``.", ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the charge item definition", description=( "A free text natural language description of the charge item definition" " from a consumer's perspective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the charge item definition is expected to be used", description=( "The period during which the charge item definition content was or is " "planned to be in active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this charge item definition is " "authored for testing purposes (or education/evaluation/marketing) and " "is not intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the charge item definition", description=( "A formal identifier that is used to identify this charge item " "definition when it is represented in other formats, or referenced in a" " specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instance: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="instance", title="Instances this definition applies to", description=( "The defined billing details in this resource pertain to the given " "product instance(s)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication", "Substance", "Device"], }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for charge item definition (if applicable)", description=( "A legal or geographic region in which the charge item definition is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the charge item definition was last reviewed", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) partOf: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="partOf", title=( "A larger definition of which this particular definition is a component" " or step" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ChargeItemDefinition"], }, ) partOf__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_partOf", title="Extension field for ``partOf``." ) propertyGroup: typing.List[ fhirtypes.ChargeItemDefinitionPropertyGroupType ] | None = Field( default=None, alias="propertyGroup", title="Group of properties which are applicable under the same conditions", description=( "Group of properties which are applicable under the same conditions. If" " no applicability rules are established for the group, then all " "properties always apply." ), json_schema_extra={ "element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the charge " "item definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) replaces: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="replaces", title=( "Completed or terminated request(s) whose function is taken by this new" " request" ), description=( "As new versions of a protocol or guideline are defined, allows " "identification of what versions are replaced by a new instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ChargeItemDefinition"], }, ) replaces__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_replaces", title="Extension field for ``replaces``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description="The current state of the ChargeItemDefinition.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this charge item definition (human friendly)", description=( "A short, descriptive, user-friendly title for the charge item " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this charge item definition, represented as a" " URI (globally unique)" ), description=( "An absolute URI that is used to identify this charge item definition " "when it is referenced in a specification, model, design or an " "instance; also called its canonical identifier. This SHOULD be " "globally unique and SHOULD be a literal address at which at which an " "authoritative instance of this charge item definition is (or will be) " "published. This URL can be the target of a canonical reference. It " "SHALL remain the same when the charge item definition is stored on " "different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate charge item definition " "instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the charge item definition", description=( "The identifier that is used to identify this version of the charge " "item definition when it is referenced in a specification, model, " "design or instance. This is an arbitrary value managed by the charge " "item definition author and is not expected to be globally unique. For " "example, it might be a timestamp (e.g. yyyymmdd) if a managed version " "is not available. There is also no expectation that versions can be " "placed in a lexicographical sequence. To provide a version consistent " "with the Decision Support Service specification, use the format " "Major.Minor.Revision (e.g. 1.0.0). For more information on versioning " "knowledge assets, refer to the Decision Support Service specification." " Note that a version is required for non-experimental active assets." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ChargeItemDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "title", "derivedFromUri", "partOf", "replaces", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "copyright", "approvalDate", "lastReviewDate", "effectivePeriod", "code", "instance", "applicability", "propertyGroup", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ChargeItemDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "title", "derivedFromUri", "partOf", "replaces", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "effectivePeriod", "code", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext"), ("url", "url__ext")] return required_fields class ChargeItemDefinitionApplicability(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Whether or not the billing code is applicable. Expressions that describe applicability criteria for the billing code. """ __resource_type__ = "ChargeItemDefinitionApplicability" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Natural language description of the condition", description=( "A brief, natural language description of the condition that " "effectively communicates the intended semantics." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="Boolean-valued expression", description=( "An expression that returns true or false, indicating whether the " "condition is satisfied. When using FHIRPath expressions, the %context " "environment variable must be replaced at runtime with the ChargeItem " "resource to which this definition is applied." ), json_schema_extra={ "element_property": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) language: fhirtypes.StringType | None = Field( default=None, alias="language", title="Language of the expression", description=( 'The media type of the language for the expression, e.g. "text/cql" for' ' Clinical Query Language expressions or "text/fhirpath" for FHIRPath ' "expressions." ), json_schema_extra={ "element_property": True, }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ChargeItemDefinitionApplicability`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "language", "expression", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ChargeItemDefinitionApplicability`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ChargeItemDefinitionPropertyGroup(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Group of properties which are applicable under the same conditions. Group of properties which are applicable under the same conditions. If no applicability rules are established for the group, then all properties always apply. """ __resource_type__ = "ChargeItemDefinitionPropertyGroup" applicability: typing.List[ fhirtypes.ChargeItemDefinitionApplicabilityType ] | None = Field( default=None, alias="applicability", title="Conditions under which the priceComponent is applicable", description=( "Expressions that describe applicability criteria for the " "priceComponent." ), json_schema_extra={ "element_property": True, }, ) priceComponent: typing.List[ fhirtypes.ChargeItemDefinitionPropertyGroupPriceComponentType ] | None = Field( default=None, alias="priceComponent", title="Components of total line item price", description=( "The price for a ChargeItem may be calculated as a base price with " "surcharges/deductions that apply in certain conditions. A " "ChargeItemDefinition resource that defines the prices, factors and " "conditions that apply to a billing code is currently under " "development. The priceComponent element can be used to offer " "transparency to the recipient of the Invoice of how the prices have " "been calculated." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ChargeItemDefinitionPropertyGroup`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "applicability", "priceComponent", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ChargeItemDefinitionPropertyGroup`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ChargeItemDefinitionPropertyGroupPriceComponent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Components of total line item price. The price for a ChargeItem may be calculated as a base price with surcharges/deductions that apply in certain conditions. A ChargeItemDefinition resource that defines the prices, factors and conditions that apply to a billing code is currently under development. The priceComponent element can be used to offer transparency to the recipient of the Invoice of how the prices have been calculated. """ __resource_type__ = "ChargeItemDefinitionPropertyGroupPriceComponent" amount: fhirtypes.MoneyType | None = Field( default=None, alias="amount", title="Monetary amount associated with this component", description="The amount calculated for this component.", json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Code identifying the specific component", description=( "A code that identifies the component. Codes may be used to " "differentiate between kinds of taxes, surcharges, discounts etc." ), json_schema_extra={ "element_property": True, }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Factor used for calculating this component", description=( "The factor that has been applied on the base price for calculating " "this component." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="base | surcharge | deduction | discount | tax | informational", description="This code identifies the type of the component.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "base", "surcharge", "deduction", "discount", "tax", "informational", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ChargeItemDefinitionPropertyGroupPriceComponent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "code", "factor", "amount", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ChargeItemDefinitionPropertyGroupPriceComponent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/citation.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Citation Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Citation(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A description of identification, location, or contributorship of a publication (article or artifact). The Citation Resource enables reference to any knowledge artifact for purposes of identification and attribution. The Citation Resource supports existing reference structures and developing publication practices such as versioning, expressing complex contributorship roles, and referencing computable resources. """ __resource_type__ = "Citation" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the citation was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the Citation", description=None, json_schema_extra={ "element_property": True, }, ) citedArtifact: fhirtypes.CitationCitedArtifactType | None = Field( default=None, alias="citedArtifact", title="The article or artifact being described", description=None, json_schema_extra={ "element_property": True, }, ) classification: typing.List[fhirtypes.CitationClassificationType] | None = Field( default=None, alias="classification", title="The assignment to an organizing scheme", description=None, json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher of the Citation Resource", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title=( "Use and/or publishing restrictions for the Citation, not for the cited" " artifact" ), description=None, json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) currentState: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="currentState", title="The status of the citation", description=None, json_schema_extra={ "element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the citation was published. The " "date must change when the business version changes and it must change " "if the status code changes. In addition, it should change when the " "substantive content of the citation changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the citation", description=( "A free text natural language description of the citation from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the Citation", description=None, json_schema_extra={ "element_property": True, }, ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the citation is expected to be used", description=( "The period during which the citation content was or is planned to be " "in active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the Citation", description=None, json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this citation is authored for testing" " purposes (or education/evaluation/marketing) and is not intended to " "be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifier for the Citation resource itself", description=( "A formal identifier that is used to identify this citation when it is " "represented in other formats, or referenced in a specification, model," " design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for citation (if applicable)", description=( "A legal or geographic region in which the citation is intended to be " "used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the citation was last reviewed", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this citation (computer friendly)", description=( "A natural language name identifying the citation. This name should be " "usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Used for general notes and annotations not coded elsewhere", description=None, json_schema_extra={ "element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title=( "The publisher of the Citation, not the publisher of the article or " "artifact being cited" ), description=( "The name of the organization or individual that published the " "citation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this citation is defined", description=( "Explanation of why this citation is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) relatesTo: typing.List[fhirtypes.CitationRelatesToType] | None = Field( default=None, alias="relatesTo", title="Artifact related to the Citation Resource", description=None, json_schema_extra={ "element_property": True, }, ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the Citation", description=None, json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this summary. Enables tracking the life-cycle of the " "content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusDate: typing.List[fhirtypes.CitationStatusDateType] | None = Field( default=None, alias="statusDate", title="An effective date or period for a status of the citation", description=None, json_schema_extra={ "element_property": True, }, ) summary: typing.List[fhirtypes.CitationSummaryType] | None = Field( default=None, alias="summary", title="A human-readable display of the citation", description=None, json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this citation (human friendly)", description="A short, descriptive, user-friendly title for the citation.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this citation, represented as a globally " "unique URI" ), description=( "An absolute URI that is used to identify this citation when it is " "referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which at which an authoritative " "instance of this summary is (or will be) published. This URL can be " "the target of a canonical reference. It SHALL remain the same when the" " summary is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the Citation Resource content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate citation instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the citation", description=( "The identifier that is used to identify this version of the citation " "when it is referenced in a specification, model, design or instance. " "This is an arbitrary value managed by the citation author and is not " "expected to be globally unique. For example, it might be a timestamp " "(e.g. yyyymmdd) if a managed version is not available. There is also " "no expectation that versions can be placed in a lexicographical " "sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Citation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "approvalDate", "lastReviewDate", "effectivePeriod", "author", "editor", "reviewer", "endorser", "summary", "classification", "note", "currentState", "statusDate", "relatesTo", "citedArtifact", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Citation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "effectivePeriod", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class CitationCitedArtifact(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The article or artifact being described. """ __resource_type__ = "CitationCitedArtifact" abstract: typing.List[fhirtypes.CitationCitedArtifactAbstractType] | None = Field( default=None, alias="abstract", title="Summary of the article or artifact", description=None, json_schema_extra={ "element_property": True, }, ) classification: typing.List[ fhirtypes.CitationCitedArtifactClassificationType ] | None = Field( default=None, alias="classification", title="The assignment to an organizing scheme", description=None, json_schema_extra={ "element_property": True, }, ) contributorship: fhirtypes.CitationCitedArtifactContributorshipType | None = Field( default=None, alias="contributorship", title="Attribution of authors and other contributors", description=( "This element is used to list authors and other contributors, their " "contact information, specific contributions, and summary statements." ), json_schema_extra={ "element_property": True, }, ) currentState: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="currentState", title="The status of the cited artifact", description=None, json_schema_extra={ "element_property": True, }, ) dateAccessed: fhirtypes.DateTimeType | None = Field( default=None, alias="dateAccessed", title="When the cited artifact was accessed", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dateAccessed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dateAccessed", title="Extension field for ``dateAccessed``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="May include DOI, PMID, PMCID, etc.", description=( "A formal identifier that is used to identify this citation when it is " "represented in other formats, or referenced in a specification, model," " design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Any additional information or content for the article or artifact", description=None, json_schema_extra={ "element_property": True, }, ) part: fhirtypes.CitationCitedArtifactPartType | None = Field( default=None, alias="part", title="The component of the article or artifact", description=None, json_schema_extra={ "element_property": True, }, ) publicationForm: typing.List[ fhirtypes.CitationCitedArtifactPublicationFormType ] | None = Field( default=None, alias="publicationForm", title=( "If multiple, used to represent alternative forms of the article that " "are not separate citations" ), description=None, json_schema_extra={ "element_property": True, }, ) relatedIdentifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="relatedIdentifier", title="May include trial registry identifiers", description=( "A formal identifier that is used to identify things closely related to" " this citation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) relatesTo: typing.List[fhirtypes.CitationCitedArtifactRelatesToType] | None = Field( default=None, alias="relatesTo", title="The artifact related to the cited artifact", description=None, json_schema_extra={ "element_property": True, }, ) statusDate: typing.List[ fhirtypes.CitationCitedArtifactStatusDateType ] | None = Field( default=None, alias="statusDate", title="An effective date or period for a status of the cited artifact", description=None, json_schema_extra={ "element_property": True, }, ) title: typing.List[fhirtypes.CitationCitedArtifactTitleType] | None = Field( default=None, alias="title", title="The title details of the article or artifact", description=None, json_schema_extra={ "element_property": True, }, ) version: fhirtypes.CitationCitedArtifactVersionType | None = Field( default=None, alias="version", title="The defined version of the cited artifact", description=None, json_schema_extra={ "element_property": True, }, ) webLocation: typing.List[ fhirtypes.CitationCitedArtifactWebLocationType ] | None = Field( default=None, alias="webLocation", title="Used for any URL for the article or artifact cited", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifact`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "relatedIdentifier", "dateAccessed", "version", "currentState", "statusDate", "title", "abstract", "part", "relatesTo", "publicationForm", "webLocation", "classification", "contributorship", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifact`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "identifier", "relatedIdentifier", "dateAccessed"] class CitationCitedArtifactAbstract(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Summary of the article or artifact. """ __resource_type__ = "CitationCitedArtifactAbstract" copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Copyright notice for the abstract", description=None, json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) language: fhirtypes.CodeableConceptType | None = Field( default=None, alias="language", title="Used to express the specific language", description=None, json_schema_extra={ "element_property": True, }, ) text: fhirtypes.MarkdownType | None = Field( default=None, alias="text", title="Abstract content", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The kind of abstract", description="Used to express the reason or specific aspect for the abstract.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactAbstract`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "language", "text", "copyright", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactAbstract`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("text", "text__ext")] return required_fields class CitationCitedArtifactClassification(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The assignment to an organizing scheme. """ __resource_type__ = "CitationCitedArtifactClassification" classifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="classifier", title="The specific classification value", description=None, json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The kind of classifier (e.g. publication type, keyword)", description=None, json_schema_extra={ "element_property": True, }, ) whoClassified: fhirtypes.CitationCitedArtifactClassificationWhoClassifiedType | None = Field( default=None, alias="whoClassified", title="Provenance and copyright of classification", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactClassification`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "classifier", "whoClassified", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactClassification`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationCitedArtifactClassificationWhoClassified(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Provenance and copyright of classification. """ __resource_type__ = "CitationCitedArtifactClassificationWhoClassified" classifierCopyright: fhirtypes.StringType | None = Field( default=None, alias="classifierCopyright", title="Rights management statement for the classification", description=None, json_schema_extra={ "element_property": True, }, ) classifierCopyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_classifierCopyright", title="Extension field for ``classifierCopyright``.", ) freeToShare: bool | None = Field( default=None, alias="freeToShare", title="Acceptable to re-use the classification", description=None, json_schema_extra={ "element_property": True, }, ) freeToShare__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_freeToShare", title="Extension field for ``freeToShare``." ) organization: fhirtypes.ReferenceType | None = Field( default=None, alias="organization", title="Organization who created the classification", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) person: fhirtypes.ReferenceType | None = Field( default=None, alias="person", title="Person who created the classification", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Person", "Practitioner"], }, ) publisher: fhirtypes.ReferenceType | None = Field( default=None, alias="publisher", title=( "The publisher of the classification, not the publisher of the article " "or artifact being cited" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactClassificationWhoClassified`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "person", "organization", "publisher", "classifierCopyright", "freeToShare", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactClassificationWhoClassified`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationCitedArtifactContributorship(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Attribution of authors and other contributors. This element is used to list authors and other contributors, their contact information, specific contributions, and summary statements. """ __resource_type__ = "CitationCitedArtifactContributorship" complete: bool | None = Field( default=None, alias="complete", title="Indicates if the list includes all authors and/or contributors", description=None, json_schema_extra={ "element_property": True, }, ) complete__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_complete", title="Extension field for ``complete``." ) entry: typing.List[ fhirtypes.CitationCitedArtifactContributorshipEntryType ] | None = Field( default=None, alias="entry", title="An individual entity named in the list", description="An individual entity named in the author list or contributor list.", json_schema_extra={ "element_property": True, }, ) summary: typing.List[ fhirtypes.CitationCitedArtifactContributorshipSummaryType ] | None = Field( default=None, alias="summary", title=( "Used to record a display of the author/contributor list without " "separate coding for each list member" ), description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactContributorship`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "complete", "entry", "summary"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactContributorship`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationCitedArtifactContributorshipEntry(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An individual entity named in the list. An individual entity named in the author list or contributor list. """ __resource_type__ = "CitationCitedArtifactContributorshipEntry" address: typing.List[fhirtypes.AddressType] | None = Field( default=None, alias="address", title="Physical mailing address", description="Physical mailing address for the author or contributor.", json_schema_extra={ "element_property": True, }, ) affiliationInfo: typing.List[ fhirtypes.CitationCitedArtifactContributorshipEntryAffiliationInfoType ] | None = Field( default=None, alias="affiliationInfo", title="Organizational affiliation", description="Organization affiliated with the entity.", json_schema_extra={ "element_property": True, }, ) collectiveName: fhirtypes.StringType | None = Field( default=None, alias="collectiveName", title="Used for collective or corporate name as an author", description=None, json_schema_extra={ "element_property": True, }, ) collectiveName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_collectiveName", title="Extension field for ``collectiveName``.", ) contributionInstance: typing.List[ fhirtypes.CitationCitedArtifactContributorshipEntryContributionInstanceType ] | None = Field( default=None, alias="contributionInstance", title="Contributions with accounting for time or number", description=None, json_schema_extra={ "element_property": True, }, ) contributionType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="contributionType", title="The specific contribution", description=( "This element identifies the specific nature of an individual\u2019s " "contribution with respect to the cited work." ), json_schema_extra={ "element_property": True, }, ) correspondingContact: bool | None = Field( default=None, alias="correspondingContact", title=( "Indication of which contributor is the corresponding contributor for " "the role" ), description=None, json_schema_extra={ "element_property": True, }, ) correspondingContact__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_correspondingContact", title="Extension field for ``correspondingContact``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Author identifier, eg ORCID", description="Unique person identifier.", json_schema_extra={ "element_property": True, }, ) initials: fhirtypes.StringType | None = Field( default=None, alias="initials", title="Initials for forename", description=None, json_schema_extra={ "element_property": True, }, ) initials__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_initials", title="Extension field for ``initials``." ) listOrder: fhirtypes.PositiveIntType | None = Field( default=None, alias="listOrder", title="Used to code order of authors", description=None, json_schema_extra={ "element_property": True, }, ) listOrder__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_listOrder", title="Extension field for ``listOrder``." ) name: fhirtypes.HumanNameType | None = Field( default=None, alias="name", title="A name associated with the person", description="A name associated with the individual.", json_schema_extra={ "element_property": True, }, ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="The role of the contributor (e.g. author, editor, reviewer)", description=None, json_schema_extra={ "element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="Email or telephone contact methods for the author or contributor", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactContributorshipEntry`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "initials", "collectiveName", "identifier", "affiliationInfo", "address", "telecom", "contributionType", "role", "contributionInstance", "correspondingContact", "listOrder", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactContributorshipEntry`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationCitedArtifactContributorshipEntryAffiliationInfo( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Organizational affiliation. Organization affiliated with the entity. """ __resource_type__ = "CitationCitedArtifactContributorshipEntryAffiliationInfo" affiliation: fhirtypes.StringType | None = Field( default=None, alias="affiliation", title="Display for the organization", description=None, json_schema_extra={ "element_property": True, }, ) affiliation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_affiliation", title="Extension field for ``affiliation``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifier for the organization", description=None, json_schema_extra={ "element_property": True, }, ) role: fhirtypes.StringType | None = Field( default=None, alias="role", title="Role within the organization, such as professional title", description=None, json_schema_extra={ "element_property": True, }, ) role__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_role", title="Extension field for ``role``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactContributorshipEntryAffiliationInfo`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "affiliation", "role", "identifier", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactContributorshipEntryAffiliationInfo`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationCitedArtifactContributorshipEntryContributionInstance( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contributions with accounting for time or number. """ __resource_type__ = "CitationCitedArtifactContributorshipEntryContributionInstance" time: fhirtypes.DateTimeType | None = Field( default=None, alias="time", title="The time that the contribution was made", description=None, json_schema_extra={ "element_property": True, }, ) time__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_time", title="Extension field for ``time``." ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="The specific contribution", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactContributorshipEntryContributionInstance`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "time"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactContributorshipEntryContributionInstance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationCitedArtifactContributorshipSummary(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Used to record a display of the author/contributor list without separate coding for each list member. """ __resource_type__ = "CitationCitedArtifactContributorshipSummary" source: fhirtypes.CodeableConceptType | None = Field( default=None, alias="source", title="Used to code the producer or rule for creating the display string", description=None, json_schema_extra={ "element_property": True, }, ) style: fhirtypes.CodeableConceptType | None = Field( default=None, alias="style", title="The format for the display string", description=None, json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Either authorList or contributorshipStatement", description=( "Used most commonly to express an author list or a contributorship " "statement." ), json_schema_extra={ "element_property": True, }, ) value: fhirtypes.MarkdownType | None = Field( default=None, alias="value", title=( "The display string for the author list, contributor list, or " "contributorship statement" ), description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactContributorshipSummary`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "style", "source", "value", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactContributorshipSummary`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("value", "value__ext")] return required_fields class CitationCitedArtifactPart(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The component of the article or artifact. """ __resource_type__ = "CitationCitedArtifactPart" baseCitation: fhirtypes.ReferenceType | None = Field( default=None, alias="baseCitation", title="The citation for the full article or artifact", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Citation"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The kind of component", description=None, json_schema_extra={ "element_property": True, }, ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The specification of the component", description=None, json_schema_extra={ "element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactPart`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "value", "baseCitation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactPart`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationCitedArtifactPublicationForm(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. If multiple, used to represent alternative forms of the article that are not separate citations. """ __resource_type__ = "CitationCitedArtifactPublicationForm" accessionNumber: fhirtypes.StringType | None = Field( default=None, alias="accessionNumber", title="Entry number or identifier for inclusion in a database", description=None, json_schema_extra={ "element_property": True, }, ) accessionNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_accessionNumber", title="Extension field for ``accessionNumber``.", ) articleDate: fhirtypes.DateTimeType | None = Field( default=None, alias="articleDate", title=( "The date the article was added to the database, or the date the " "article was released" ), description=( "The date the article was added to the database, or the date the " "article was released (which may differ from the journal issue " "publication date)." ), json_schema_extra={ "element_property": True, }, ) articleDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_articleDate", title="Extension field for ``articleDate``." ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Copyright notice for the full article or artifact", description=None, json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) firstPage: fhirtypes.StringType | None = Field( default=None, alias="firstPage", title="Used for isolated representation of first page", description=None, json_schema_extra={ "element_property": True, }, ) firstPage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_firstPage", title="Extension field for ``firstPage``." ) language: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="language", title="Language in which this form of the article is published", description=None, json_schema_extra={ "element_property": True, }, ) lastPage: fhirtypes.StringType | None = Field( default=None, alias="lastPage", title="Used for isolated representation of last page", description=None, json_schema_extra={ "element_property": True, }, ) lastPage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastPage", title="Extension field for ``lastPage``." ) lastRevisionDate: fhirtypes.DateTimeType | None = Field( default=None, alias="lastRevisionDate", title="The date the article was last revised or updated in the database", description=None, json_schema_extra={ "element_property": True, }, ) lastRevisionDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastRevisionDate", title="Extension field for ``lastRevisionDate``.", ) pageCount: fhirtypes.StringType | None = Field( default=None, alias="pageCount", title="Number of pages or screens", description="Actual or approximate number of pages or screens.", json_schema_extra={ "element_property": True, }, ) pageCount__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_pageCount", title="Extension field for ``pageCount``." ) pageString: fhirtypes.StringType | None = Field( default=None, alias="pageString", title="Used for full display of pagination", description=None, json_schema_extra={ "element_property": True, }, ) pageString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_pageString", title="Extension field for ``pageString``." ) periodicRelease: fhirtypes.CitationCitedArtifactPublicationFormPeriodicReleaseType | None = Field( default=None, alias="periodicRelease", title="The specific issue in which the cited article resides", description=None, json_schema_extra={ "element_property": True, }, ) publishedIn: fhirtypes.CitationCitedArtifactPublicationFormPublishedInType | None = Field( default=None, alias="publishedIn", title="The collection the cited article or artifact is published in", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactPublicationForm`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "publishedIn", "periodicRelease", "articleDate", "lastRevisionDate", "language", "accessionNumber", "pageString", "firstPage", "lastPage", "pageCount", "copyright", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactPublicationForm`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationCitedArtifactPublicationFormPeriodicRelease( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The specific issue in which the cited article resides. """ __resource_type__ = "CitationCitedArtifactPublicationFormPeriodicRelease" citedMedium: fhirtypes.CodeableConceptType | None = Field( default=None, alias="citedMedium", title="Internet or Print", description=( 'Describes the form of the medium cited. Common codes are "Internet" or' ' "Print".' ), json_schema_extra={ "element_property": True, }, ) dateOfPublication: fhirtypes.CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationType | None = Field( default=None, alias="dateOfPublication", title="Defining the date on which the issue of the journal was published", description=None, json_schema_extra={ "element_property": True, }, ) issue: fhirtypes.StringType | None = Field( default=None, alias="issue", title="Issue, part or supplement of journal in which the article is published", description=None, json_schema_extra={ "element_property": True, }, ) issue__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issue", title="Extension field for ``issue``." ) volume: fhirtypes.StringType | None = Field( default=None, alias="volume", title="Volume number of journal in which the article is published", description=None, json_schema_extra={ "element_property": True, }, ) volume__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_volume", title="Extension field for ``volume``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactPublicationFormPeriodicRelease`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "citedMedium", "volume", "issue", "dateOfPublication", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactPublicationFormPeriodicRelease`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublication( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Defining the date on which the issue of the journal was published. """ __resource_type__ = ( "CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublication" ) date: fhirtypes.DateType | None = Field( default=None, alias="date", title="Date on which the issue of the journal was published", description=None, json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) day: fhirtypes.StringType | None = Field( default=None, alias="day", title="Day on which the issue of the journal was published", description=None, json_schema_extra={ "element_property": True, }, ) day__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_day", title="Extension field for ``day``." ) month: fhirtypes.StringType | None = Field( default=None, alias="month", title="Month on which the issue of the journal was published", description=None, json_schema_extra={ "element_property": True, }, ) month__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_month", title="Extension field for ``month``." ) season: fhirtypes.StringType | None = Field( default=None, alias="season", title="Season on which the issue of the journal was published", description="Spring, Summer, Fall/Autumn, Winter.", json_schema_extra={ "element_property": True, }, ) season__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_season", title="Extension field for ``season``." ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title=( "Text representation of the date of which the issue of the journal was " "published" ), description=None, json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) year: fhirtypes.StringType | None = Field( default=None, alias="year", title="Year on which the issue of the journal was published", description=None, json_schema_extra={ "element_property": True, }, ) year__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_year", title="Extension field for ``year``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublication`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "date", "year", "month", "day", "season", "text", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublication`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationCitedArtifactPublicationFormPublishedIn(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The collection the cited article or artifact is published in. """ __resource_type__ = "CitationCitedArtifactPublicationFormPublishedIn" identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title=( "Journal identifiers include ISSN, ISO Abbreviation and NLMuniqueID; " "Book identifiers include ISBN" ), description=None, json_schema_extra={ "element_property": True, }, ) publisher: fhirtypes.ReferenceType | None = Field( default=None, alias="publisher", title="Name of the publisher", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) publisherLocation: fhirtypes.StringType | None = Field( default=None, alias="publisherLocation", title="Geographic location of the publisher", description=None, json_schema_extra={ "element_property": True, }, ) publisherLocation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisherLocation", title="Extension field for ``publisherLocation``.", ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name of the database or title of the book or journal", description=None, json_schema_extra={ "element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Kind of container (e.g. Periodical, database, or book)", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactPublicationFormPublishedIn`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "identifier", "title", "publisher", "publisherLocation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactPublicationFormPublishedIn`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationCitedArtifactRelatesTo(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The artifact related to the cited artifact. """ __resource_type__ = "CitationCitedArtifactRelatesTo" relationshipType: fhirtypes.CodeableConceptType = Field( default=..., alias="relationshipType", title="How the cited artifact relates to the target artifact", description=None, json_schema_extra={ "element_property": True, }, ) targetAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="targetAttachment", title="The article or artifact that the cited artifact is related to", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e target[x] "one_of_many": "target", "one_of_many_required": True, }, ) targetClassifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="targetClassifier", title="The clasification of the related artifact", description=None, json_schema_extra={ "element_property": True, }, ) targetIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="targetIdentifier", title="The article or artifact that the cited artifact is related to", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e target[x] "one_of_many": "target", "one_of_many_required": True, }, ) targetReference: fhirtypes.ReferenceType | None = Field( default=None, alias="targetReference", title="The article or artifact that the cited artifact is related to", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e target[x] "one_of_many": "target", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) targetUri: fhirtypes.UriType | None = Field( default=None, alias="targetUri", title="The article or artifact that the cited artifact is related to", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e target[x] "one_of_many": "target", "one_of_many_required": True, }, ) targetUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_targetUri", title="Extension field for ``targetUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactRelatesTo`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "relationshipType", "targetClassifier", "targetUri", "targetIdentifier", "targetReference", "targetAttachment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactRelatesTo`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "target": [ "targetAttachment", "targetIdentifier", "targetReference", "targetUri", ] } return one_of_many_fields class CitationCitedArtifactStatusDate(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An effective date or period for a status of the cited artifact. """ __resource_type__ = "CitationCitedArtifactStatusDate" activity: fhirtypes.CodeableConceptType = Field( default=..., alias="activity", title="Classification of the status", description=None, json_schema_extra={ "element_property": True, }, ) actual: bool | None = Field( default=None, alias="actual", title="Either occurred or expected", description=None, json_schema_extra={ "element_property": True, }, ) actual__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_actual", title="Extension field for ``actual``." ) period: fhirtypes.PeriodType = Field( default=..., alias="period", title="When the status started and/or ended", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactStatusDate`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "activity", "actual", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactStatusDate`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationCitedArtifactTitle(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The title details of the article or artifact. """ __resource_type__ = "CitationCitedArtifactTitle" language: fhirtypes.CodeableConceptType | None = Field( default=None, alias="language", title="Used to express the specific language", description=None, json_schema_extra={ "element_property": True, }, ) text: fhirtypes.MarkdownType | None = Field( default=None, alias="text", title="The title of the article or artifact", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="The kind of title", description="Used to express the reason or specific aspect for the title.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactTitle`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "language", "text"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactTitle`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("text", "text__ext")] return required_fields class CitationCitedArtifactVersion(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The defined version of the cited artifact. """ __resource_type__ = "CitationCitedArtifactVersion" baseCitation: fhirtypes.ReferenceType | None = Field( default=None, alias="baseCitation", title="Citation for the main version of the cited artifact", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Citation"], }, ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The version number or other version identifier", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactVersion`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "value", "baseCitation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactVersion`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("value", "value__ext")] return required_fields class CitationCitedArtifactWebLocation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Used for any URL for the article or artifact cited. """ __resource_type__ = "CitationCitedArtifactWebLocation" type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Code the reason for different URLs, e.g. abstract and full-text", description=None, json_schema_extra={ "element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="The specific URL", description=None, json_schema_extra={ "element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactWebLocation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "url"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactWebLocation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationClassification(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The assignment to an organizing scheme. """ __resource_type__ = "CitationClassification" classifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="classifier", title="The specific classification value", description=None, json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The kind of classifier (e.g. publication type, keyword)", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationClassification`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "classifier"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationClassification`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationRelatesTo(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Artifact related to the Citation Resource. """ __resource_type__ = "CitationRelatesTo" relationshipType: fhirtypes.CodeableConceptType = Field( default=..., alias="relationshipType", title="How the Citation resource relates to the target artifact", description=None, json_schema_extra={ "element_property": True, }, ) targetAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="targetAttachment", title="The article or artifact that the Citation Resource is related to", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e target[x] "one_of_many": "target", "one_of_many_required": True, }, ) targetClassifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="targetClassifier", title="The clasification of the related artifact", description=None, json_schema_extra={ "element_property": True, }, ) targetIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="targetIdentifier", title="The article or artifact that the Citation Resource is related to", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e target[x] "one_of_many": "target", "one_of_many_required": True, }, ) targetReference: fhirtypes.ReferenceType | None = Field( default=None, alias="targetReference", title="The article or artifact that the Citation Resource is related to", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e target[x] "one_of_many": "target", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) targetUri: fhirtypes.UriType | None = Field( default=None, alias="targetUri", title="The article or artifact that the Citation Resource is related to", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e target[x] "one_of_many": "target", "one_of_many_required": True, }, ) targetUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_targetUri", title="Extension field for ``targetUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationRelatesTo`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "relationshipType", "targetClassifier", "targetUri", "targetIdentifier", "targetReference", "targetAttachment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationRelatesTo`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "target": [ "targetAttachment", "targetIdentifier", "targetReference", "targetUri", ] } return one_of_many_fields class CitationStatusDate(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An effective date or period for a status of the citation. """ __resource_type__ = "CitationStatusDate" activity: fhirtypes.CodeableConceptType = Field( default=..., alias="activity", title="Classification of the status", description=None, json_schema_extra={ "element_property": True, }, ) actual: bool | None = Field( default=None, alias="actual", title="Either occurred or expected", description=None, json_schema_extra={ "element_property": True, }, ) actual__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_actual", title="Extension field for ``actual``." ) period: fhirtypes.PeriodType = Field( default=..., alias="period", title="When the status started and/or ended", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationStatusDate`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "activity", "actual", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationStatusDate`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationSummary(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A human-readable display of the citation. """ __resource_type__ = "CitationSummary" style: fhirtypes.CodeableConceptType | None = Field( default=None, alias="style", title="Format for display of the citation", description=None, json_schema_extra={ "element_property": True, }, ) text: fhirtypes.MarkdownType | None = Field( default=None, alias="text", title="The human-readable display of the citation", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationSummary`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "style", "text"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationSummary`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "text"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("text", "text__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/claim.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Claim Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Claim(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Claim, Pre-determination or Pre-authorization. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. """ __resource_type__ = "Claim" accident: fhirtypes.ClaimAccidentType | None = Field( default=None, alias="accident", title="Details of the event", description=( "Details of an accident which resulted in injuries which required the " "products and services listed in the claim." ), json_schema_extra={ "element_property": True, }, ) billablePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="billablePeriod", title="Relevant time frame for the claim", description="The period for which charges are being submitted.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) careTeam: typing.List[fhirtypes.ClaimCareTeamType] | None = Field( default=None, alias="careTeam", title="Members of the care team", description="The members of the team who provided the products and services.", json_schema_extra={ "element_property": True, }, ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Resource creation date", description="The date this resource was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) diagnosis: typing.List[fhirtypes.ClaimDiagnosisType] | None = Field( default=None, alias="diagnosis", title="Pertinent diagnosis information", description="Information about diagnoses relevant to the claim items.", json_schema_extra={ "element_property": True, }, ) enterer: fhirtypes.ReferenceType | None = Field( default=None, alias="enterer", title="Author of the claim", description=( "Individual who created the claim, predetermination or " "preauthorization." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) facility: fhirtypes.ReferenceType | None = Field( default=None, alias="facility", title="Servicing facility", description="Facility where the services were provided.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) fundsReserve: fhirtypes.CodeableConceptType | None = Field( default=None, alias="fundsReserve", title="For whom to reserve funds", description=( "A code to indicate whether and for whom funds are to be reserved for " "future claims." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for claim", description="A unique identifier assigned to this claim.", json_schema_extra={ "element_property": True, }, ) insurance: typing.List[fhirtypes.ClaimInsuranceType] = Field( default=..., alias="insurance", title="Patient insurance information", description=( "Financial instruments for reimbursement for the health care products " "and services specified on the claim." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) insurer: fhirtypes.ReferenceType | None = Field( default=None, alias="insurer", title="Target", description="The Insurer who is target of the request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) item: typing.List[fhirtypes.ClaimItemType] | None = Field( default=None, alias="item", title="Product or service provided", description=( "A claim line. Either a simple product or service or a 'group' of " "details which can each be a simple items or groups of sub-details." ), json_schema_extra={ "element_property": True, }, ) originalPrescription: fhirtypes.ReferenceType | None = Field( default=None, alias="originalPrescription", title="Original prescription if superseded by fulfiller", description=( "Original prescription which has been superseded by this prescription " "to support the dispensing of pharmacy services, medications or " "products." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "DeviceRequest", "MedicationRequest", "VisionPrescription", ], }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="The recipient of the products and services", description=( "The party to whom the professional services and/or products have been " "supplied or are being considered and for whom actual or forecast " "reimbursement is sought." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) payee: fhirtypes.ClaimPayeeType | None = Field( default=None, alias="payee", title="Recipient of benefits payable", description=( "The party to be reimbursed for cost of the products and services " "according to the terms of the policy." ), json_schema_extra={ "element_property": True, }, ) prescription: fhirtypes.ReferenceType | None = Field( default=None, alias="prescription", title="Prescription authorizing services and products", description=( "Prescription to support the dispensing of pharmacy, device or vision " "products." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "DeviceRequest", "MedicationRequest", "VisionPrescription", ], }, ) priority: fhirtypes.CodeableConceptType = Field( default=..., alias="priority", title="Desired processing ugency", description=( "The provider-required urgency of processing the request. Typical " "values include: stat, routine deferred." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) procedure: typing.List[fhirtypes.ClaimProcedureType] | None = Field( default=None, alias="procedure", title="Clinical procedures performed", description=( "Procedures performed on the patient relevant to the billing items with" " the claim." ), json_schema_extra={ "element_property": True, }, ) provider: fhirtypes.ReferenceType = Field( default=..., alias="provider", title="Party responsible for the claim", description=( "The provider which is responsible for the claim, predetermination or " "preauthorization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) referral: fhirtypes.ReferenceType | None = Field( default=None, alias="referral", title="Treatment referral", description="A reference to a referral resource.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ServiceRequest"], }, ) related: typing.List[fhirtypes.ClaimRelatedType] | None = Field( default=None, alias="related", title="Prior or corollary claims", description=( "Other claims which are related to this claim such as prior submissions" " or claims for related services or for the same event." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subType", title="More granular claim type", description=( "A finer grained suite of claim type codes which may convey additional " "information such as Inpatient vs Outpatient and/or a specialty " "service." ), json_schema_extra={ "element_property": True, }, ) supportingInfo: typing.List[fhirtypes.ClaimSupportingInfoType] | None = Field( default=None, alias="supportingInfo", title="Supporting information", description=( "Additional information codes regarding exceptions, special " "considerations, the condition, situation, prior or concurrent issues." ), json_schema_extra={ "element_property": True, }, ) total: fhirtypes.MoneyType | None = Field( default=None, alias="total", title="Total claim cost", description="The total value of the all the items in the claim.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Category or discipline", description=( "The category of claim, e.g. oral, pharmacy, vision, institutional, " "professional." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="claim | preauthorization | predetermination", description=( "A code to indicate whether the nature of the request is: to request " "adjudication of products and services previously rendered; or " "requesting authorization and adjudication for provision in the future;" " or requesting the non-binding adjudication of the listed products and" " services which could be provided in the future." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["claim", "preauthorization", "predetermination"], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Claim`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "type", "subType", "use", "patient", "billablePeriod", "created", "enterer", "insurer", "provider", "priority", "fundsReserve", "related", "prescription", "originalPrescription", "payee", "referral", "facility", "careTeam", "supportingInfo", "diagnosis", "procedure", "insurance", "accident", "item", "total", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Claim`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "status", "type", "use", "patient", "billablePeriod", "created", "insurer", "provider", "priority", "insurance", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("created", "created__ext"), ("status", "status__ext"), ("use", "use__ext"), ] return required_fields class ClaimAccident(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details of the event. Details of an accident which resulted in injuries which required the products and services listed in the claim. """ __resource_type__ = "ClaimAccident" date: fhirtypes.DateType | None = Field( default=None, alias="date", title="When the incident occurred", description=( "Date of an accident event related to the products and services " "contained in the claim." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) locationAddress: fhirtypes.AddressType | None = Field( default=None, alias="locationAddress", title="Where the event occurred", description="The physical location of the accident event.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="locationReference", title="Where the event occurred", description="The physical location of the accident event.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The nature of the accident", description=( "The type or context of the accident event for the purposes of " "selection of potential insurance coverages and determination of " "coordination between insurers." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimAccident`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "date", "type", "locationAddress", "locationReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimAccident`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("date", "date__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"location": ["locationAddress", "locationReference"]} return one_of_many_fields class ClaimCareTeam(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Members of the care team. The members of the team who provided the products and services. """ __resource_type__ = "ClaimCareTeam" provider: fhirtypes.ReferenceType = Field( default=..., alias="provider", title="Practitioner or organization", description="Member of the team who provided the product or service.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) qualification: fhirtypes.CodeableConceptType | None = Field( default=None, alias="qualification", title="Practitioner credential or specialization", description=( "The qualification of the practitioner which is applicable for this " "service." ), json_schema_extra={ "element_property": True, }, ) responsible: bool | None = Field( default=None, alias="responsible", title="Indicator of the lead practitioner", description=( "The party who is billing and/or responsible for the claimed products " "or services." ), json_schema_extra={ "element_property": True, }, ) responsible__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_responsible", title="Extension field for ``responsible``." ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="Function within the team", description=( "The lead, assisting or supervising practitioner and their discipline " "if a multidisciplinary team." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Order of care team", description="A number to uniquely identify care team entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimCareTeam`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "provider", "responsible", "role", "qualification", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimCareTeam`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields class ClaimDiagnosis(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Pertinent diagnosis information. Information about diagnoses relevant to the claim items. """ __resource_type__ = "ClaimDiagnosis" diagnosisCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="diagnosisCodeableConcept", title="Nature of illness or problem", description=( "The nature of illness or problem in a coded form or as a reference to " "an external defined Condition." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e diagnosis[x] "one_of_many": "diagnosis", "one_of_many_required": True, }, ) diagnosisReference: fhirtypes.ReferenceType | None = Field( default=None, alias="diagnosisReference", title="Nature of illness or problem", description=( "The nature of illness or problem in a coded form or as a reference to " "an external defined Condition." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e diagnosis[x] "one_of_many": "diagnosis", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) onAdmission: fhirtypes.CodeableConceptType | None = Field( default=None, alias="onAdmission", title="Present on admission", description=( "Indication of whether the diagnosis was present on admission to a " "facility." ), json_schema_extra={ "element_property": True, }, ) packageCode: fhirtypes.CodeableConceptType | None = Field( default=None, alias="packageCode", title="Package billing code", description=( "A package billing code or bundle code used to group products and " "services to a particular health condition (such as heart attack) which" " is based on a predetermined grouping code system." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Diagnosis instance identifier", description="A number to uniquely identify diagnosis entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Timing or nature of the diagnosis", description="When the condition was observed or the relative ranking.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimDiagnosis`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "diagnosisCodeableConcept", "diagnosisReference", "type", "onAdmission", "packageCode", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimDiagnosis`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "diagnosis": ["diagnosisCodeableConcept", "diagnosisReference"] } return one_of_many_fields class ClaimInsurance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Patient insurance information. Financial instruments for reimbursement for the health care products and services specified on the claim. """ __resource_type__ = "ClaimInsurance" businessArrangement: fhirtypes.StringType | None = Field( default=None, alias="businessArrangement", title="Additional provider contract number", description=( "A business agreement number established between the provider and the " "insurer for special business processing purposes." ), json_schema_extra={ "element_property": True, }, ) businessArrangement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_businessArrangement", title="Extension field for ``businessArrangement``.", ) claimResponse: fhirtypes.ReferenceType | None = Field( default=None, alias="claimResponse", title="Adjudication results", description=( "The result of the adjudication of the line items for the Coverage " "specified in this insurance." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ClaimResponse"], }, ) coverage: fhirtypes.ReferenceType = Field( default=..., alias="coverage", title="Insurance information", description=( "Reference to the insurance card level information contained in the " "Coverage resource. The coverage issuing insurer will use these details" " to locate the patient's actual coverage within the insurer's " "information system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage"], }, ) focal: bool | None = Field( default=None, alias="focal", title="Coverage to be used for adjudication", description=( "A flag to indicate that this Coverage is to be used for adjudication " "of this claim when set to true." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) focal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_focal", title="Extension field for ``focal``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Pre-assigned Claim number", description=( "The business identifier to be used when the claim is sent for " "adjudication against this insurance policy." ), json_schema_extra={ "element_property": True, }, ) preAuthRef: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="preAuthRef", title="Prior authorization reference number", description=( "Reference numbers previously provided by the insurer to the provider " "to be quoted on subsequent claims containing services or products " "related to the prior authorization." ), json_schema_extra={ "element_property": True, }, ) preAuthRef__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_preAuthRef", title="Extension field for ``preAuthRef``." ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Insurance instance identifier", description=( "A number to uniquely identify insurance entries and provide a sequence" " of coverages to convey coordination of benefit order." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimInsurance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "focal", "identifier", "coverage", "businessArrangement", "preAuthRef", "claimResponse", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimInsurance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "sequence", "focal", "coverage"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("focal", "focal__ext"), ("sequence", "sequence__ext")] return required_fields class ClaimItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Product or service provided. A claim line. Either a simple product or service or a 'group' of details which can each be a simple items or groups of sub-details. """ __resource_type__ = "ClaimItem" bodySite: fhirtypes.CodeableConceptType | None = Field( default=None, alias="bodySite", title="Anatomical location", description="Physical service site on the patient (limb, tooth, etc.).", json_schema_extra={ "element_property": True, }, ) careTeamSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="careTeamSequence", title="Applicable careTeam members", description="CareTeam members related to this service or product.", json_schema_extra={ "element_property": True, }, ) careTeamSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_careTeamSequence", title="Extension field for ``careTeamSequence``.", ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Benefit classification", description=( "Code to identify the general type of benefits under which products and" " services are provided." ), json_schema_extra={ "element_property": True, }, ) detail: typing.List[fhirtypes.ClaimItemDetailType] | None = Field( default=None, alias="detail", title="Product or service provided", description=( "A claim detail line. Either a simple (a product or service) or a " "'group' of sub-details which are simple items." ), json_schema_extra={ "element_property": True, }, ) diagnosisSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="diagnosisSequence", title="Applicable diagnoses", description="Diagnosis applicable for this service or product.", json_schema_extra={ "element_property": True, }, ) diagnosisSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_diagnosisSequence", title="Extension field for ``diagnosisSequence``.", ) encounter: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="encounter", title="Encounters related to this billed item", description=( "The Encounters during which this Claim was created or to which the " "creation of this record is tightly associated." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) informationSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="informationSequence", title="Applicable exception and supporting information", description=( "Exceptions, special conditions and supporting information applicable " "for this service or product." ), json_schema_extra={ "element_property": True, }, ) informationSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_informationSequence", title="Extension field for ``informationSequence``.", ) locationAddress: fhirtypes.AddressType | None = Field( default=None, alias="locationAddress", title="Place of service or where product was supplied", description="Where the product or service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="locationCodeableConcept", title="Place of service or where product was supplied", description="Where the product or service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="locationReference", title="Place of service or where product was supplied", description="Where the product or service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Product or service billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The quantity times the unit price for an additional service or product" " or charge." ), json_schema_extra={ "element_property": True, }, ) procedureSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="procedureSequence", title="Applicable procedures", description="Procedures applicable for this service or product.", json_schema_extra={ "element_property": True, }, ) procedureSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_procedureSequence", title="Extension field for ``procedureSequence``.", ) productOrService: fhirtypes.CodeableConceptType = Field( default=..., alias="productOrService", title="Billing, service, product, or drug code", description=( "When the value is a group code then this item collects a set of " "related claim details, otherwise this contains the product, service, " "drug or other billing code for the item." ), json_schema_extra={ "element_property": True, }, ) programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="programCode", title="Program the product or service is provided under", description="Identifies the program under which this may be recovered.", json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of revenue or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Item instance identifier", description="A number to uniquely identify item entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) servicedDate: fhirtypes.DateType | None = Field( default=None, alias="servicedDate", title="Date or dates of service or product delivery", description=( "The date or dates when the service or product was supplied, performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_servicedDate", title="Extension field for ``servicedDate``.", ) servicedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="servicedPeriod", title="Date or dates of service or product delivery", description=( "The date or dates when the service or product was supplied, performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) subSite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="subSite", title="Anatomical sub-location", description=( "A region or surface of the bodySite, e.g. limb region or tooth " "surface(s)." ), json_schema_extra={ "element_property": True, }, ) udi: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="udi", title="Unique device identifier", description="Unique Device Identifiers associated with this line item.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description=( "If the item is not a group then this is the fee for the product or " "service, otherwise this is the total of the fees for the details of " "the group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "careTeamSequence", "diagnosisSequence", "procedureSequence", "informationSequence", "revenue", "category", "productOrService", "modifier", "programCode", "servicedDate", "servicedPeriod", "locationCodeableConcept", "locationAddress", "locationReference", "quantity", "unitPrice", "factor", "net", "udi", "bodySite", "subSite", "encounter", "detail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "location": [ "locationAddress", "locationCodeableConcept", "locationReference", ], "serviced": ["servicedDate", "servicedPeriod"], } return one_of_many_fields class ClaimItemDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Product or service provided. A claim detail line. Either a simple (a product or service) or a 'group' of sub-details which are simple items. """ __resource_type__ = "ClaimItemDetail" category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Benefit classification", description=( "Code to identify the general type of benefits under which products and" " services are provided." ), json_schema_extra={ "element_property": True, }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The quantity times the unit price for an additional service or product" " or charge." ), json_schema_extra={ "element_property": True, }, ) productOrService: fhirtypes.CodeableConceptType = Field( default=..., alias="productOrService", title="Billing, service, product, or drug code", description=( "When the value is a group code then this item collects a set of " "related claim details, otherwise this contains the product, service, " "drug or other billing code for the item." ), json_schema_extra={ "element_property": True, }, ) programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="programCode", title="Program the product or service is provided under", description="Identifies the program under which this may be recovered.", json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of revenue or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Item instance identifier", description="A number to uniquely identify item entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) subDetail: typing.List[fhirtypes.ClaimItemDetailSubDetailType] | None = Field( default=None, alias="subDetail", title="Product or service provided", description=( "A claim detail line. Either a simple (a product or service) or a " "'group' of sub-details which are simple items." ), json_schema_extra={ "element_property": True, }, ) udi: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="udi", title="Unique device identifier", description="Unique Device Identifiers associated with this line item.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description=( "If the item is not a group then this is the fee for the product or " "service, otherwise this is the total of the fees for the details of " "the group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimItemDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "revenue", "category", "productOrService", "modifier", "programCode", "quantity", "unitPrice", "factor", "net", "udi", "subDetail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimItemDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields class ClaimItemDetailSubDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Product or service provided. A claim detail line. Either a simple (a product or service) or a 'group' of sub-details which are simple items. """ __resource_type__ = "ClaimItemDetailSubDetail" category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Benefit classification", description=( "Code to identify the general type of benefits under which products and" " services are provided." ), json_schema_extra={ "element_property": True, }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The quantity times the unit price for an additional service or product" " or charge." ), json_schema_extra={ "element_property": True, }, ) productOrService: fhirtypes.CodeableConceptType = Field( default=..., alias="productOrService", title="Billing, service, product, or drug code", description=( "When the value is a group code then this item collects a set of " "related claim details, otherwise this contains the product, service, " "drug or other billing code for the item." ), json_schema_extra={ "element_property": True, }, ) programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="programCode", title="Program the product or service is provided under", description="Identifies the program under which this may be recovered.", json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of revenue or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Item instance identifier", description="A number to uniquely identify item entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) udi: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="udi", title="Unique device identifier", description="Unique Device Identifiers associated with this line item.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description=( "If the item is not a group then this is the fee for the product or " "service, otherwise this is the total of the fees for the details of " "the group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "revenue", "category", "productOrService", "modifier", "programCode", "quantity", "unitPrice", "factor", "net", "udi", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields class ClaimPayee(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Recipient of benefits payable. The party to be reimbursed for cost of the products and services according to the terms of the policy. """ __resource_type__ = "ClaimPayee" party: fhirtypes.ReferenceType | None = Field( default=None, alias="party", title="Recipient reference", description=( "Reference to the individual or organization to whom any payment will " "be made." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Patient", "RelatedPerson", ], }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Category of recipient", description="Type of Party to be reimbursed: subscriber, provider, other.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimPayee`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "party"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimPayee`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ClaimProcedure(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Clinical procedures performed. Procedures performed on the patient relevant to the billing items with the claim. """ __resource_type__ = "ClaimProcedure" date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When the procedure was performed", description="Date and optionally time the procedure was performed.", json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) procedureCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="procedureCodeableConcept", title="Specific clinical procedure", description=( "The code or reference to a Procedure resource which identifies the " "clinical intervention performed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e procedure[x] "one_of_many": "procedure", "one_of_many_required": True, }, ) procedureReference: fhirtypes.ReferenceType | None = Field( default=None, alias="procedureReference", title="Specific clinical procedure", description=( "The code or reference to a Procedure resource which identifies the " "clinical intervention performed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e procedure[x] "one_of_many": "procedure", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Procedure"], }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Procedure instance identifier", description="A number to uniquely identify procedure entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Category of Procedure", description="When the condition was observed or the relative ranking.", json_schema_extra={ "element_property": True, }, ) udi: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="udi", title="Unique device identifier", description="Unique Device Identifiers associated with this line item.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimProcedure`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "type", "date", "procedureCodeableConcept", "procedureReference", "udi", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimProcedure`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "procedure": ["procedureCodeableConcept", "procedureReference"] } return one_of_many_fields class ClaimRelated(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Prior or corollary claims. Other claims which are related to this claim such as prior submissions or claims for related services or for the same event. """ __resource_type__ = "ClaimRelated" claim: fhirtypes.ReferenceType | None = Field( default=None, alias="claim", title="Reference to the related claim", description="Reference to a related claim.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Claim"], }, ) reference: fhirtypes.IdentifierType | None = Field( default=None, alias="reference", title="File or case reference", description=( "An alternate organizational reference to the case or file to which " "this particular claim pertains." ), json_schema_extra={ "element_property": True, }, ) relationship: fhirtypes.CodeableConceptType | None = Field( default=None, alias="relationship", title="How the reference claim is related", description="A code to convey how the claims are related.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimRelated`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "claim", "relationship", "reference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimRelated`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ClaimSupportingInfo(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Supporting information. Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues. """ __resource_type__ = "ClaimSupportingInfo" category: fhirtypes.CodeableConceptType = Field( default=..., alias="category", title="Classification of the supplied information", description=( "The general class of the information supplied: information; exception;" " accident, employment; onset, etc." ), json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Type of information", description=( "System and code pertaining to the specific information regarding " "special conditions relating to the setting, treatment or patient for " "which care is sought." ), json_schema_extra={ "element_property": True, }, ) reason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reason", title="Explanation for the information", description=( "Provides the reason in the situation where a reason code is required " "in addition to the content." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Information instance identifier", description="A number to uniquely identify supporting information entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) timingDate: fhirtypes.DateType | None = Field( default=None, alias="timingDate", title="When it occurred", description="The date when or period to which this information refers.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timingDate", title="Extension field for ``timingDate``." ) timingPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="timingPeriod", title="When it occurred", description="The date when or period to which this information refers.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Data to be provided", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Data to be provided", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Data to be provided", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Data to be provided", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Data to be provided", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimSupportingInfo`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "category", "code", "timingDate", "timingPeriod", "valueBoolean", "valueString", "valueQuantity", "valueAttachment", "valueReference", "reason", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimSupportingInfo`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "timing": ["timingDate", "timingPeriod"], "value": [ "valueAttachment", "valueBoolean", "valueQuantity", "valueReference", "valueString", ], } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/claimresponse.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ClaimResponse Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ClaimResponse(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Response to a claim predetermination or preauthorization. This resource provides the adjudication details from the processing of a Claim resource. """ __resource_type__ = "ClaimResponse" addItem: typing.List[fhirtypes.ClaimResponseAddItemType] | None = Field( default=None, alias="addItem", title="Insurer added line items", description=( "The first-tier service adjudications for payor added product or " "service lines." ), json_schema_extra={ "element_property": True, }, ) adjudication: typing.List[ fhirtypes.ClaimResponseItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Header-level adjudication", description=( "The adjudication results which are presented at the header level " "rather than at the line-item or add-item levels." ), json_schema_extra={ "element_property": True, }, ) communicationRequest: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="communicationRequest", title="Request for additional information", description="Request for additional supporting or authorizing information.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CommunicationRequest"], }, ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Response creation date", description="The date this resource was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) disposition: fhirtypes.StringType | None = Field( default=None, alias="disposition", title="Disposition Message", description="A human readable description of the status of the adjudication.", json_schema_extra={ "element_property": True, }, ) disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_disposition", title="Extension field for ``disposition``." ) error: typing.List[fhirtypes.ClaimResponseErrorType] | None = Field( default=None, alias="error", title="Processing errors", description="Errors encountered during the processing of the adjudication.", json_schema_extra={ "element_property": True, }, ) form: fhirtypes.AttachmentType | None = Field( default=None, alias="form", title="Printed reference or actual form", description=( "The actual form, by reference or inclusion, for printing the content " "or an EOB." ), json_schema_extra={ "element_property": True, }, ) formCode: fhirtypes.CodeableConceptType | None = Field( default=None, alias="formCode", title="Printed form identifier", description="A code for the form to be used for printing the content.", json_schema_extra={ "element_property": True, }, ) fundsReserve: fhirtypes.CodeableConceptType | None = Field( default=None, alias="fundsReserve", title="Funds reserved status", description=( "A code, used only on a response to a preauthorization, to indicate " "whether the benefits payable have been reserved and for whom." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for a claim response", description="A unique identifier assigned to this claim response.", json_schema_extra={ "element_property": True, }, ) insurance: typing.List[fhirtypes.ClaimResponseInsuranceType] | None = Field( default=None, alias="insurance", title="Patient insurance information", description=( "Financial instruments for reimbursement for the health care products " "and services specified on the claim." ), json_schema_extra={ "element_property": True, }, ) insurer: fhirtypes.ReferenceType = Field( default=..., alias="insurer", title="Party responsible for reimbursement", description=( "The party responsible for authorization, adjudication and " "reimbursement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) item: typing.List[fhirtypes.ClaimResponseItemType] | None = Field( default=None, alias="item", title="Adjudication for claim line items", description=( "A claim line. Either a simple (a product or service) or a 'group' of " "details which can also be a simple items or groups of sub-details." ), json_schema_extra={ "element_property": True, }, ) outcome: fhirtypes.CodeType | None = Field( default=None, alias="outcome", title="queued | complete | error | partial", description=( "The outcome of the claim, predetermination, or preauthorization " "processing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["queued", "complete", "error", "partial"], }, ) outcome__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_outcome", title="Extension field for ``outcome``." ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="The recipient of the products and services", description=( "The party to whom the professional services and/or products have been " "supplied or are being considered and for whom actual for facast " "reimbursement is sought." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) payeeType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="payeeType", title="Party to be paid any benefits payable", description="Type of Party to be reimbursed: subscriber, provider, other.", json_schema_extra={ "element_property": True, }, ) payment: fhirtypes.ClaimResponsePaymentType | None = Field( default=None, alias="payment", title="Payment Details", description="Payment details for the adjudication of the claim.", json_schema_extra={ "element_property": True, }, ) preAuthPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="preAuthPeriod", title="Preauthorization reference effective period", description="The time frame during which this authorization is effective.", json_schema_extra={ "element_property": True, }, ) preAuthRef: fhirtypes.StringType | None = Field( default=None, alias="preAuthRef", title="Preauthorization reference", description=( "Reference from the Insurer which is used in later communications which" " refers to this adjudication." ), json_schema_extra={ "element_property": True, }, ) preAuthRef__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preAuthRef", title="Extension field for ``preAuthRef``." ) processNote: typing.List[fhirtypes.ClaimResponseProcessNoteType] | None = Field( default=None, alias="processNote", title="Note concerning adjudication", description=( "A note that describes or explains adjudication results in a human " "readable form." ), json_schema_extra={ "element_property": True, }, ) request: fhirtypes.ReferenceType | None = Field( default=None, alias="request", title="Id of resource triggering adjudication", description="Original request resource reference.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Claim"], }, ) requestor: fhirtypes.ReferenceType | None = Field( default=None, alias="requestor", title="Party responsible for the claim", description=( "The provider which is responsible for the claim, predetermination or " "preauthorization." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subType", title="More granular claim type", description=( "A finer grained suite of claim type codes which may convey additional " "information such as Inpatient vs Outpatient and/or a specialty " "service." ), json_schema_extra={ "element_property": True, }, ) total: typing.List[fhirtypes.ClaimResponseTotalType] | None = Field( default=None, alias="total", title="Adjudication totals", description="Categorized monetary totals for the adjudication.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="More granular claim type", description=( "A finer grained suite of claim type codes which may convey additional " "information such as Inpatient vs Outpatient and/or a specialty " "service." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="claim | preauthorization | predetermination", description=( "A code to indicate whether the nature of the request is: to request " "adjudication of products and services previously rendered; or " "requesting authorization and adjudication for provision in the future;" " or requesting the non-binding adjudication of the listed products and" " services which could be provided in the future." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["claim", "preauthorization", "predetermination"], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "type", "subType", "use", "patient", "created", "insurer", "requestor", "request", "outcome", "disposition", "preAuthRef", "preAuthPeriod", "payeeType", "item", "addItem", "adjudication", "total", "payment", "fundsReserve", "formCode", "form", "processNote", "communicationRequest", "insurance", "error", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "status", "type", "use", "patient", "created", "insurer", "request", "outcome", "total", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("created", "created__ext"), ("outcome", "outcome__ext"), ("status", "status__ext"), ("use", "use__ext"), ] return required_fields class ClaimResponseAddItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Insurer added line items. The first-tier service adjudications for payor added product or service lines. """ __resource_type__ = "ClaimResponseAddItem" adjudication: typing.List[fhirtypes.ClaimResponseItemAdjudicationType] = Field( default=..., alias="adjudication", title="Added items adjudication", description="The adjudication results.", json_schema_extra={ "element_property": True, }, ) bodySite: fhirtypes.CodeableConceptType | None = Field( default=None, alias="bodySite", title="Anatomical location", description="Physical service site on the patient (limb, tooth, etc.).", json_schema_extra={ "element_property": True, }, ) detail: typing.List[fhirtypes.ClaimResponseAddItemDetailType] | None = Field( default=None, alias="detail", title="Insurer added line details", description="The second-tier service adjudications for payor added services.", json_schema_extra={ "element_property": True, }, ) detailSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="detailSequence", title="Detail sequence number", description=( "The sequence number of the details within the claim item which this " "line is intended to replace." ), json_schema_extra={ "element_property": True, }, ) detailSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_detailSequence", title="Extension field for ``detailSequence``.", ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) itemSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="itemSequence", title="Item sequence number", description="Claim items which this service line is intended to replace.", json_schema_extra={ "element_property": True, }, ) itemSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_itemSequence", title="Extension field for ``itemSequence``.", ) locationAddress: fhirtypes.AddressType | None = Field( default=None, alias="locationAddress", title="Place of service or where product was supplied", description="Where the product or service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="locationCodeableConcept", title="Place of service or where product was supplied", description="Where the product or service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="locationReference", title="Place of service or where product was supplied", description="Where the product or service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The quantity times the unit price for an additional service or product" " or charge." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="Applicable note numbers", description=( "The numbers associated with notes below which apply to the " "adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) productOrService: fhirtypes.CodeableConceptType = Field( default=..., alias="productOrService", title="Billing, service, product, or drug code", description=( "When the value is a group code then this item collects a set of " "related claim details, otherwise this contains the product, service, " "drug or other billing code for the item." ), json_schema_extra={ "element_property": True, }, ) programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="programCode", title="Program the product or service is provided under", description="Identifies the program under which this may be recovered.", json_schema_extra={ "element_property": True, }, ) provider: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="provider", title="Authorized providers", description=( "The providers who are authorized for the services rendered to the " "patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) servicedDate: fhirtypes.DateType | None = Field( default=None, alias="servicedDate", title="Date or dates of service or product delivery", description=( "The date or dates when the service or product was supplied, performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_servicedDate", title="Extension field for ``servicedDate``.", ) servicedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="servicedPeriod", title="Date or dates of service or product delivery", description=( "The date or dates when the service or product was supplied, performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) subSite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="subSite", title="Anatomical sub-location", description=( "A region or surface of the bodySite, e.g. limb region or tooth " "surface(s)." ), json_schema_extra={ "element_property": True, }, ) subdetailSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="subdetailSequence", title="Subdetail sequence number", description=( "The sequence number of the sub-details within the details within the " "claim item which this line is intended to replace." ), json_schema_extra={ "element_property": True, }, ) subdetailSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_subdetailSequence", title="Extension field for ``subdetailSequence``.", ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description=( "If the item is not a group then this is the fee for the product or " "service, otherwise this is the total of the fees for the details of " "the group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseAddItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "itemSequence", "detailSequence", "subdetailSequence", "provider", "productOrService", "modifier", "programCode", "servicedDate", "servicedPeriod", "locationCodeableConcept", "locationAddress", "locationReference", "quantity", "unitPrice", "factor", "net", "bodySite", "subSite", "noteNumber", "adjudication", "detail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseAddItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "location": [ "locationAddress", "locationCodeableConcept", "locationReference", ], "serviced": ["servicedDate", "servicedPeriod"], } return one_of_many_fields class ClaimResponseAddItemDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Insurer added line details. The second-tier service adjudications for payor added services. """ __resource_type__ = "ClaimResponseAddItemDetail" adjudication: typing.List[fhirtypes.ClaimResponseItemAdjudicationType] = Field( default=..., alias="adjudication", title="Added items detail adjudication", description="The adjudication results.", json_schema_extra={ "element_property": True, }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The quantity times the unit price for an additional service or product" " or charge." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="Applicable note numbers", description=( "The numbers associated with notes below which apply to the " "adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) productOrService: fhirtypes.CodeableConceptType = Field( default=..., alias="productOrService", title="Billing, service, product, or drug code", description=( "When the value is a group code then this item collects a set of " "related claim details, otherwise this contains the product, service, " "drug or other billing code for the item." ), json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) subDetail: typing.List[ fhirtypes.ClaimResponseAddItemDetailSubDetailType ] | None = Field( default=None, alias="subDetail", title="Insurer added line items", description="The third-tier service adjudications for payor added services.", json_schema_extra={ "element_property": True, }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description=( "If the item is not a group then this is the fee for the product or " "service, otherwise this is the total of the fees for the details of " "the group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseAddItemDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "productOrService", "modifier", "quantity", "unitPrice", "factor", "net", "noteNumber", "adjudication", "subDetail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseAddItemDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ClaimResponseAddItemDetailSubDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Insurer added line items. The third-tier service adjudications for payor added services. """ __resource_type__ = "ClaimResponseAddItemDetailSubDetail" adjudication: typing.List[fhirtypes.ClaimResponseItemAdjudicationType] = Field( default=..., alias="adjudication", title="Added items detail adjudication", description="The adjudication results.", json_schema_extra={ "element_property": True, }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The quantity times the unit price for an additional service or product" " or charge." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="Applicable note numbers", description=( "The numbers associated with notes below which apply to the " "adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) productOrService: fhirtypes.CodeableConceptType = Field( default=..., alias="productOrService", title="Billing, service, product, or drug code", description=( "When the value is a group code then this item collects a set of " "related claim details, otherwise this contains the product, service, " "drug or other billing code for the item." ), json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description=( "If the item is not a group then this is the fee for the product or " "service, otherwise this is the total of the fees for the details of " "the group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseAddItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "productOrService", "modifier", "quantity", "unitPrice", "factor", "net", "noteNumber", "adjudication", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseAddItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ClaimResponseError(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Processing errors. Errors encountered during the processing of the adjudication. """ __resource_type__ = "ClaimResponseError" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Error code detailing processing issues", description=( "An error code, from a specified code system, which details why the " "claim could not be adjudicated." ), json_schema_extra={ "element_property": True, }, ) detailSequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="detailSequence", title="Detail sequence number", description=( "The sequence number of the detail within the line item submitted which" " contains the error. This value is omitted when the error occurs " "outside of the item structure." ), json_schema_extra={ "element_property": True, }, ) detailSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detailSequence", title="Extension field for ``detailSequence``.", ) itemSequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="itemSequence", title="Item sequence number", description=( "The sequence number of the line item submitted which contains the " "error. This value is omitted when the error occurs outside of the item" " structure." ), json_schema_extra={ "element_property": True, }, ) itemSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_itemSequence", title="Extension field for ``itemSequence``.", ) subDetailSequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="subDetailSequence", title="Subdetail sequence number", description=( "The sequence number of the sub-detail within the detail within the " "line item submitted which contains the error. This value is omitted " "when the error occurs outside of the item structure." ), json_schema_extra={ "element_property": True, }, ) subDetailSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subDetailSequence", title="Extension field for ``subDetailSequence``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseError`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "itemSequence", "detailSequence", "subDetailSequence", "code", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseError`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ClaimResponseInsurance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Patient insurance information. Financial instruments for reimbursement for the health care products and services specified on the claim. """ __resource_type__ = "ClaimResponseInsurance" businessArrangement: fhirtypes.StringType | None = Field( default=None, alias="businessArrangement", title="Additional provider contract number", description=( "A business agreement number established between the provider and the " "insurer for special business processing purposes." ), json_schema_extra={ "element_property": True, }, ) businessArrangement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_businessArrangement", title="Extension field for ``businessArrangement``.", ) claimResponse: fhirtypes.ReferenceType | None = Field( default=None, alias="claimResponse", title="Adjudication results", description=( "The result of the adjudication of the line items for the Coverage " "specified in this insurance." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ClaimResponse"], }, ) coverage: fhirtypes.ReferenceType = Field( default=..., alias="coverage", title="Insurance information", description=( "Reference to the insurance card level information contained in the " "Coverage resource. The coverage issuing insurer will use these details" " to locate the patient's actual coverage within the insurer's " "information system." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage"], }, ) focal: bool | None = Field( default=None, alias="focal", title="Coverage to be used for adjudication", description=( "A flag to indicate that this Coverage is to be used for adjudication " "of this claim when set to true." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) focal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_focal", title="Extension field for ``focal``." ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Insurance instance identifier", description=( "A number to uniquely identify insurance entries and provide a sequence" " of coverages to convey coordination of benefit order." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseInsurance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "focal", "coverage", "businessArrangement", "claimResponse", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseInsurance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("focal", "focal__ext"), ("sequence", "sequence__ext")] return required_fields class ClaimResponseItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Adjudication for claim line items. A claim line. Either a simple (a product or service) or a 'group' of details which can also be a simple items or groups of sub-details. """ __resource_type__ = "ClaimResponseItem" adjudication: typing.List[fhirtypes.ClaimResponseItemAdjudicationType] = Field( default=..., alias="adjudication", title="Adjudication details", description=( "If this item is a group then the values here are a summary of the " "adjudication of the detail items. If this item is a simple product or " "service then this is the result of the adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) detail: typing.List[fhirtypes.ClaimResponseItemDetailType] | None = Field( default=None, alias="detail", title="Adjudication for claim details", description=( "A claim detail. Either a simple (a product or service) or a 'group' of" " sub-details which are simple items." ), json_schema_extra={ "element_property": True, }, ) itemSequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="itemSequence", title="Claim item instance identifier", description="A number to uniquely reference the claim item entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) itemSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_itemSequence", title="Extension field for ``itemSequence``.", ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="Applicable note numbers", description=( "The numbers associated with notes below which apply to the " "adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "itemSequence", "noteNumber", "adjudication", "detail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("itemSequence", "itemSequence__ext")] return required_fields class ClaimResponseItemAdjudication(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Adjudication details. If this item is a group then the values here are a summary of the adjudication of the detail items. If this item is a simple product or service then this is the result of the adjudication of this item. """ __resource_type__ = "ClaimResponseItemAdjudication" amount: fhirtypes.MoneyType | None = Field( default=None, alias="amount", title="Monetary amount", description="Monetary amount associated with the category.", json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType = Field( default=..., alias="category", title="Type of adjudication information", description=( "A code to indicate the information type of this adjudication record. " "Information types may include the value submitted, maximum values or " "percentages allowed or payable under the plan, amounts that: the " "patient is responsible for in aggregate or pertaining to this item; " "amounts paid by other coverages; and, the benefit payable for this " "item." ), json_schema_extra={ "element_property": True, }, ) reason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reason", title="Explanation of adjudication outcome", description=( "A code supporting the understanding of the adjudication result and " "explaining variance from expected amount." ), json_schema_extra={ "element_property": True, }, ) value: fhirtypes.DecimalType | None = Field( default=None, alias="value", title="Non-monetary value", description=( "A non-monetary value associated with the category. Mutually exclusive " "to the amount element above." ), json_schema_extra={ "element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseItemAdjudication`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "category", "reason", "amount", "value", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseItemAdjudication`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ClaimResponseItemDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Adjudication for claim details. A claim detail. Either a simple (a product or service) or a 'group' of sub- details which are simple items. """ __resource_type__ = "ClaimResponseItemDetail" adjudication: typing.List[fhirtypes.ClaimResponseItemAdjudicationType] = Field( default=..., alias="adjudication", title="Detail level adjudication details", description="The adjudication results.", json_schema_extra={ "element_property": True, }, ) detailSequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="detailSequence", title="Claim detail instance identifier", description="A number to uniquely reference the claim detail entry.", json_schema_extra={ "element_property": True, "element_required": True, }, ) detailSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detailSequence", title="Extension field for ``detailSequence``.", ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="Applicable note numbers", description=( "The numbers associated with notes below which apply to the " "adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) subDetail: typing.List[ fhirtypes.ClaimResponseItemDetailSubDetailType ] | None = Field( default=None, alias="subDetail", title="Adjudication for claim sub-details", description="A sub-detail adjudication of a simple product or service.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseItemDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "detailSequence", "noteNumber", "adjudication", "subDetail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseItemDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("detailSequence", "detailSequence__ext")] return required_fields class ClaimResponseItemDetailSubDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Adjudication for claim sub-details. A sub-detail adjudication of a simple product or service. """ __resource_type__ = "ClaimResponseItemDetailSubDetail" adjudication: typing.List[ fhirtypes.ClaimResponseItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Subdetail level adjudication details", description="The adjudication results.", json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="Applicable note numbers", description=( "The numbers associated with notes below which apply to the " "adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) subDetailSequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="subDetailSequence", title="Claim sub-detail instance identifier", description="A number to uniquely reference the claim sub-detail entry.", json_schema_extra={ "element_property": True, "element_required": True, }, ) subDetailSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subDetailSequence", title="Extension field for ``subDetailSequence``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "subDetailSequence", "noteNumber", "adjudication", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("subDetailSequence", "subDetailSequence__ext")] return required_fields class ClaimResponsePayment(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Payment Details. Payment details for the adjudication of the claim. """ __resource_type__ = "ClaimResponsePayment" adjustment: fhirtypes.MoneyType | None = Field( default=None, alias="adjustment", title="Payment adjustment for non-claim issues", description=( "Total amount of all adjustments to this payment included in this " "transaction which are not related to this claim's adjudication." ), json_schema_extra={ "element_property": True, }, ) adjustmentReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="adjustmentReason", title="Explanation for the adjustment", description="Reason for the payment adjustment.", json_schema_extra={ "element_property": True, }, ) amount: fhirtypes.MoneyType = Field( default=..., alias="amount", title="Payable amount after adjustment", description="Benefits payable less any payment adjustment.", json_schema_extra={ "element_property": True, }, ) date: fhirtypes.DateType | None = Field( default=None, alias="date", title="Expected date of payment", description=( "Estimated date the payment will be issued or the actual issue date of " "payment." ), json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Business identifier for the payment", description="Issuer's unique identifier for the payment instrument.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Partial or complete payment", description=( "Whether this represents partial or complete payment of the benefits " "payable." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponsePayment`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "adjustment", "adjustmentReason", "date", "amount", "identifier", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponsePayment`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ClaimResponseProcessNote(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Note concerning adjudication. A note that describes or explains adjudication results in a human readable form. """ __resource_type__ = "ClaimResponseProcessNote" language: fhirtypes.CodeableConceptType | None = Field( default=None, alias="language", title="Language of the text", description="A code to define the language used in the text of the note.", json_schema_extra={ "element_property": True, }, ) number: fhirtypes.PositiveIntType | None = Field( default=None, alias="number", title="Note instance identifier", description="A number to uniquely identify a note entry.", json_schema_extra={ "element_property": True, }, ) number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_number", title="Extension field for ``number``." ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Note explanatory text", description="The explanation or description associated with the processing.", json_schema_extra={ "element_property": True, "element_required": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="display | print | printoper", description="The business purpose of the note text.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["display", "print", "printoper"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseProcessNote`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "number", "type", "text", "language", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseProcessNote`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("text", "text__ext")] return required_fields class ClaimResponseTotal(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Adjudication totals. Categorized monetary totals for the adjudication. """ __resource_type__ = "ClaimResponseTotal" amount: fhirtypes.MoneyType = Field( default=..., alias="amount", title="Financial total for the category", description="Monetary total amount associated with the category.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) category: fhirtypes.CodeableConceptType = Field( default=..., alias="category", title="Type of adjudication information", description=( "A code to indicate the information type of this adjudication record. " "Information types may include: the value submitted, maximum values or " "percentages allowed or payable under the plan, amounts that the " "patient is responsible for in aggregate or pertaining to this item, " "amounts paid by other coverages, and the benefit payable for this " "item." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseTotal`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "category", "amount"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseTotal`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "category", "amount"] ================================================ FILE: fhir/resources/R4B/clinicalimpression.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ClinicalImpression Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ClinicalImpression(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A clinical assessment performed when planning treatments and management strategies for a patient. A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. """ __resource_type__ = "ClinicalImpression" assessor: fhirtypes.ReferenceType | None = Field( default=None, alias="assessor", title="The clinician performing the assessment", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Kind of assessment performed", description="Categorizes the type of clinical assessment performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When the assessment was documented", description="Indicates when the documentation of the assessment was complete.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Why/how the assessment was performed", description=( "A summary of the context and/or cause of the assessment - why / where " "it was performed, and what patient events/status prompted it." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) effectiveDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="effectiveDateTime", title="Time of assessment", description="The point in time or period over which the subject was assessed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_effectiveDateTime", title="Extension field for ``effectiveDateTime``.", ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="Time of assessment", description="The point in time or period over which the subject was assessed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter created as part of", description=( "The Encounter during which this ClinicalImpression was created or to " "which the creation of this record is tightly associated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) finding: typing.List[fhirtypes.ClinicalImpressionFindingType] | None = Field( default=None, alias="finding", title="Possible or likely findings and diagnoses", description=( "Specific findings or diagnoses that were considered likely or relevant" " to ongoing treatment." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description=( "Business identifiers assigned to this clinical impression by the " "performer or other systems which remain constant as the resource is " "updated and propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) investigation: typing.List[ fhirtypes.ClinicalImpressionInvestigationType ] | None = Field( default=None, alias="investigation", title="One or more sets of investigations (signs, symptoms, etc.)", description=( "One or more sets of investigations (signs, symptoms, etc.). The actual" " grouping of investigations varies greatly depending on the type and " "context of the assessment. These investigations may include data " "generated during the assessment process, or data previously generated " "and recorded that is pertinent to the outcomes." ), json_schema_extra={ "element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the ClinicalImpression", description=( "Commentary about the impression, typically recorded after the " "impression itself was made, though supplemental notes by the original " "author could also appear." ), json_schema_extra={ "element_property": True, }, ) previous: fhirtypes.ReferenceType | None = Field( default=None, alias="previous", title="Reference to last assessment", description=( "A reference to the last assessment that was conducted on this patient." " Assessments are often/usually ongoing in nature; a care provider " "(practitioner or team) will make new assessments on an ongoing basis " "as new data arises or the patient's conditions changes." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ClinicalImpression"], }, ) problem: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="problem", title="Relevant impressions of patient state", description="A list of the relevant problems/conditions for a patient.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "AllergyIntolerance"], }, ) prognosisCodeableConcept: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="prognosisCodeableConcept", title="Estimate of likely outcome", description=None, json_schema_extra={ "element_property": True, }, ) prognosisReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="prognosisReference", title="RiskAssessment expressing likely outcome", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["RiskAssessment"], }, ) protocol: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="protocol", title="Clinical Protocol followed", description=( "Reference to a specific published clinical protocol that was followed " "during this assessment, and/or that provides evidence in support of " "the diagnosis." ), json_schema_extra={ "element_property": True, }, ) protocol__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_protocol", title="Extension field for ``protocol``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="in-progress | completed | entered-in-error", description="Identifies the workflow status of the assessment.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["in-progress", "completed", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="statusReason", title="Reason for current status", description="Captures the reason for the current state of the ClinicalImpression.", json_schema_extra={ "element_property": True, }, ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Patient or group assessed", description="The patient or group of individuals assessed as part of this record.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) summary: fhirtypes.StringType | None = Field( default=None, alias="summary", title="Summary of the assessment", description="A text summary of the investigations and the diagnosis.", json_schema_extra={ "element_property": True, }, ) summary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_summary", title="Extension field for ``summary``." ) supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInfo", title="Information supporting the clinical impression", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClinicalImpression`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "statusReason", "code", "description", "subject", "encounter", "effectiveDateTime", "effectivePeriod", "date", "assessor", "previous", "problem", "investigation", "protocol", "summary", "finding", "prognosisCodeableConcept", "prognosisReference", "supportingInfo", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClinicalImpression`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "code", "description", "subject", "encounter", "effectiveDateTime", "effectivePeriod", "date", "assessor", "problem", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"effective": ["effectiveDateTime", "effectivePeriod"]} return one_of_many_fields class ClinicalImpressionFinding(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Possible or likely findings and diagnoses. Specific findings or diagnoses that were considered likely or relevant to ongoing treatment. """ __resource_type__ = "ClinicalImpressionFinding" basis: fhirtypes.StringType | None = Field( default=None, alias="basis", title="Which investigations support finding", description="Which investigations support finding or diagnosis.", json_schema_extra={ "element_property": True, }, ) basis__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_basis", title="Extension field for ``basis``." ) itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="itemCodeableConcept", title="What was found", description=( "Specific text or code for finding or diagnosis, which may include " "ruled-out or resolved conditions." ), json_schema_extra={ "element_property": True, }, ) itemReference: fhirtypes.ReferenceType | None = Field( default=None, alias="itemReference", title="What was found", description=( "Specific reference for finding or diagnosis, which may include ruled-" "out or resolved conditions." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "Observation", "Media"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClinicalImpressionFinding`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "itemCodeableConcept", "itemReference", "basis", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClinicalImpressionFinding`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ClinicalImpressionInvestigation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. One or more sets of investigations (signs, symptoms, etc.). One or more sets of investigations (signs, symptoms, etc.). The actual grouping of investigations varies greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes. """ __resource_type__ = "ClinicalImpressionInvestigation" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="A name/code for the set", description=( 'A name/code for the group ("set") of investigations. Typically, this ' 'will be something like "signs", "symptoms", "clinical", "diagnostic", ' "but the list is not constrained, and others such groups such as " "(exposure|family|travel|nutritional) history may be used." ), json_schema_extra={ "element_property": True, }, ) item: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="item", title="Record of a specific investigation", description="A record of a specific investigation that was undertaken.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Observation", "QuestionnaireResponse", "FamilyMemberHistory", "DiagnosticReport", "RiskAssessment", "ImagingStudy", "Media", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClinicalImpressionInvestigation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "item"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClinicalImpressionInvestigation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/clinicalusedefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ClinicalUseDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ClinicalUseDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A single issue - either an indication, contraindication, interaction or an undesirable effect for a medicinal product, medication, device or procedure. """ __resource_type__ = "ClinicalUseDefinition" category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title=( "A categorisation of the issue, primarily for dividing warnings into " 'subject heading areas such as "Pregnancy", "Overdose"' ), description=( "A categorisation of the issue, primarily for dividing warnings into " 'subject heading areas such as "Pregnancy and Lactation", "Overdose", ' '"Effects on Ability to Drive and Use Machines".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contraindication: fhirtypes.ClinicalUseDefinitionContraindicationType | None = ( Field( default=None, alias="contraindication", title="Specifics for when this is a contraindication", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier for this issue", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) indication: fhirtypes.ClinicalUseDefinitionIndicationType | None = Field( default=None, alias="indication", title="Specifics for when this is an indication", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) interaction: fhirtypes.ClinicalUseDefinitionInteractionType | None = Field( default=None, alias="interaction", title="Specifics for when this is an interaction", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) population: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="population", title="The population group to which this applies", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) status: fhirtypes.CodeableConceptType | None = Field( default=None, alias="status", title="Whether this is a current issue or one that has been retired etc", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subject: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="subject", title="The medication or procedure for which this is an indication", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "MedicinalProductDefinition", "Medication", "ActivityDefinition", "PlanDefinition", "Device", "DeviceDefinition", "Substance", ], }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "indication | contraindication | interaction | undesirable-effect | " "warning" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "indication", "contraindication", "interaction", "undesirable-effect", "warning", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) undesirableEffect: fhirtypes.ClinicalUseDefinitionUndesirableEffectType | None = ( Field( default=None, alias="undesirableEffect", title="A possible negative outcome from the use of this treatment", description=( "Describe the possible undesirable effects (negative outcomes) from the" " use of the medicinal product as treatment." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ) warning: fhirtypes.ClinicalUseDefinitionWarningType | None = Field( default=None, alias="warning", title=( "Critical environmental, health or physical risks or hazards. For " "example 'Do not operate heavy machinery', 'May cause drowsiness'" ), description=( "A critical piece of information about environmental, health or " "physical risks or hazards that serve as caution to the user. For " "example 'Do not operate heavy machinery', 'May cause drowsiness', or " "'Get medical advice/attention if you feel unwell'." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClinicalUseDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "type", "category", "subject", "status", "contraindication", "indication", "interaction", "population", "undesirableEffect", "warning", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "type", "category", "subject", "status", "contraindication", "indication", "interaction", "population", "undesirableEffect", "warning", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields class ClinicalUseDefinitionContraindication(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specifics for when this is a contraindication. """ __resource_type__ = "ClinicalUseDefinitionContraindication" comorbidity: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="comorbidity", title="A comorbidity (concurrent condition) or coinfection", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) diseaseStatus: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="diseaseStatus", title="The status of the disease or symptom for the contraindication", description=( "The status of the disease or symptom for the contraindication, for " 'example "chronic" or "metastatic".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) diseaseSymptomProcedure: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="diseaseSymptomProcedure", title=( "The situation that is being documented as contraindicating against " "this item" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) indication: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="indication", title="The indication which this is a contraidication for", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ClinicalUseDefinition"], }, ) otherTherapy: typing.List[ fhirtypes.ClinicalUseDefinitionContraindicationOtherTherapyType ] | None = Field( default=None, alias="otherTherapy", title=( "Information about use of the product in relation to other therapies " "described as part of the contraindication" ), description=( "Information about the use of the medicinal product in relation to " "other therapies described as part of the contraindication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClinicalUseDefinitionContraindication`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "diseaseSymptomProcedure", "diseaseStatus", "comorbidity", "indication", "otherTherapy", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionContraindication`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "diseaseSymptomProcedure", "diseaseStatus", "comorbidity", "indication", "otherTherapy", ] class ClinicalUseDefinitionContraindicationOtherTherapy( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about use of the product in relation to other therapies described as part of the contraindication. Information about the use of the medicinal product in relation to other therapies described as part of the contraindication. """ __resource_type__ = "ClinicalUseDefinitionContraindicationOtherTherapy" relationshipType: fhirtypes.CodeableConceptType = Field( default=..., alias="relationshipType", title=( "The type of relationship between the product " "indication/contraindication and another therapy" ), description=( "The type of relationship between the medicinal product indication or " "contraindication and another therapy." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) therapy: fhirtypes.CodeableReferenceType = Field( default=..., alias="therapy", title=( "Reference to a specific medication as part of an indication or " "contraindication" ), description=( "Reference to a specific medication (active substance, medicinal " "product or class of products) as part of an indication or " "contraindication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "MedicinalProductDefinition", "Medication", "Substance", "SubstanceDefinition", "ActivityDefinition", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClinicalUseDefinitionContraindicationOtherTherapy`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "relationshipType", "therapy"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionContraindicationOtherTherapy`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "relationshipType", "therapy"] class ClinicalUseDefinitionIndication(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specifics for when this is an indication. """ __resource_type__ = "ClinicalUseDefinitionIndication" comorbidity: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="comorbidity", title="A comorbidity or coinfection as part of the indication", description=( "A comorbidity (concurrent condition) or coinfection as part of the " "indication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) diseaseStatus: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="diseaseStatus", title="The status of the disease or symptom for the indication", description=( "The status of the disease or symptom for the indication, for example " '"chronic" or "metastatic".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) diseaseSymptomProcedure: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="diseaseSymptomProcedure", title="The situation that is being documented as an indicaton for this item", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) durationRange: fhirtypes.RangeType | None = Field( default=None, alias="durationRange", title="Timing or duration information", description=( "Timing or duration information, that may be associated with use with " "the indicated condition e.g. Adult patients suffering from myocardial " "infarction (from a few days until less than 35 days), ischaemic stroke" " (from 7 days until less than 6 months)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e duration[x] "one_of_many": "duration", "one_of_many_required": False, }, ) durationString: fhirtypes.StringType | None = Field( default=None, alias="durationString", title="Timing or duration information", description=( "Timing or duration information, that may be associated with use with " "the indicated condition e.g. Adult patients suffering from myocardial " "infarction (from a few days until less than 35 days), ischaemic stroke" " (from 7 days until less than 6 months)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e duration[x] "one_of_many": "duration", "one_of_many_required": False, }, ) durationString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_durationString", title="Extension field for ``durationString``.", ) intendedEffect: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="intendedEffect", title="The intended effect, aim or strategy to be achieved", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) otherTherapy: typing.List[ fhirtypes.ClinicalUseDefinitionContraindicationOtherTherapyType ] | None = Field( default=None, alias="otherTherapy", title=( "The use of the medicinal product in relation to other therapies " "described as part of the indication" ), description=( "Information about the use of the medicinal product in relation to " "other therapies described as part of the indication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) undesirableEffect: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="undesirableEffect", title=( "An unwanted side effect or negative outcome of the subject of this " "resource when being used for this indication" ), description=( "An unwanted side effect or negative outcome that may happen if you use" " the drug (or other subject of this resource) for this indication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ClinicalUseDefinition"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClinicalUseDefinitionIndication`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "diseaseSymptomProcedure", "diseaseStatus", "comorbidity", "intendedEffect", "durationRange", "durationString", "undesirableEffect", "otherTherapy", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionIndication`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "diseaseSymptomProcedure", "diseaseStatus", "comorbidity", "intendedEffect", "durationRange", "durationString", "undesirableEffect", "otherTherapy", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"duration": ["durationRange", "durationString"]} return one_of_many_fields class ClinicalUseDefinitionInteraction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specifics for when this is an interaction. """ __resource_type__ = "ClinicalUseDefinitionInteraction" effect: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="effect", title=( 'The effect of the interaction, for example "reduced gastric absorption' ' of primary medication"' ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) incidence: fhirtypes.CodeableConceptType | None = Field( default=None, alias="incidence", title="The incidence of the interaction, e.g. theoretical, observed", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) interactant: typing.List[ fhirtypes.ClinicalUseDefinitionInteractionInteractantType ] | None = Field( default=None, alias="interactant", title=( "The specific medication, food, substance or laboratory test that " "interacts" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) management: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="management", title="Actions for managing the interaction", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title=( "The type of the interaction e.g. drug-drug interaction, drug-lab test " "interaction" ), description=( "The type of the interaction e.g. drug-drug interaction, drug-food " "interaction, drug-lab test interaction." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClinicalUseDefinitionInteraction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "interactant", "type", "effect", "incidence", "management", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionInteraction`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "interactant", "type", "effect", "incidence", "management", ] class ClinicalUseDefinitionInteractionInteractant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The specific medication, food, substance or laboratory test that interacts. """ __resource_type__ = "ClinicalUseDefinitionInteractionInteractant" itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="itemCodeableConcept", title="The specific medication, food or laboratory test that interacts", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": True, }, ) itemReference: fhirtypes.ReferenceType | None = Field( default=None, alias="itemReference", title="The specific medication, food or laboratory test that interacts", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "MedicinalProductDefinition", "Medication", "Substance", "ObservationDefinition", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClinicalUseDefinitionInteractionInteractant`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "itemReference", "itemCodeableConcept", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionInteractionInteractant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "itemReference", "itemCodeableConcept"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"item": ["itemCodeableConcept", "itemReference"]} return one_of_many_fields class ClinicalUseDefinitionUndesirableEffect(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A possible negative outcome from the use of this treatment. Describe the possible undesirable effects (negative outcomes) from the use of the medicinal product as treatment. """ __resource_type__ = "ClinicalUseDefinitionUndesirableEffect" classification: fhirtypes.CodeableConceptType | None = Field( default=None, alias="classification", title="High level classification of the effect", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) frequencyOfOccurrence: fhirtypes.CodeableConceptType | None = Field( default=None, alias="frequencyOfOccurrence", title="How often the effect is seen", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) symptomConditionEffect: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="symptomConditionEffect", title="The situation in which the undesirable effect may manifest", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClinicalUseDefinitionUndesirableEffect`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "symptomConditionEffect", "classification", "frequencyOfOccurrence", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionUndesirableEffect`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "symptomConditionEffect", "classification", "frequencyOfOccurrence", ] class ClinicalUseDefinitionWarning(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Critical environmental, health or physical risks or hazards. For example 'Do not operate heavy machinery', 'May cause drowsiness'. A critical piece of information about environmental, health or physical risks or hazards that serve as caution to the user. For example 'Do not operate heavy machinery', 'May cause drowsiness', or 'Get medical advice/attention if you feel unwell'. """ __resource_type__ = "ClinicalUseDefinitionWarning" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="A coded or unformatted textual definition of this warning", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="A textual definition of this warning, with formatting", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClinicalUseDefinitionWarning`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "description", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionWarning`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "description", "code"] ================================================ FILE: fhir/resources/R4B/codeableconcept.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CodeableConcept Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class CodeableConcept(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Concept - reference to a terminology or just text. A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. """ __resource_type__ = "CodeableConcept" coding: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="coding", title="Code defined by a terminology system", description="A reference to a code defined by a terminology system.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Plain text representation of the concept", description=( "A human language representation of the concept as " "seen/selected/uttered by the user who entered the data and/or which " "represents the intended meaning of the user." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CodeableConcept`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "coding", "text"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CodeableConcept`` according to specification, with preserving the original sequence order. """ return ["coding", "text"] ================================================ FILE: fhir/resources/R4B/codeablereference.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CodeableReference Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class CodeableReference(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Reference to a resource or a concept. A reference to a resource (by instance), or instead, a reference to a concept defined in a terminology or ontology (by class). """ __resource_type__ = "CodeableReference" concept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="concept", title="Reference to a concept (by class)", description=( "A reference to a concept - e.g. the information is identified by its " "general class to the degree of precision found in the terminology." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reference: fhirtypes.ReferenceType | None = Field( default=None, alias="reference", title="Reference to a resource (by instance)", description=( "A reference to a resource the provides exact details about the " "information being referenced." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CodeableReference`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "concept", "reference"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CodeableReference`` according to specification, with preserving the original sequence order. """ return ["concept", "reference"] ================================================ FILE: fhir/resources/R4B/codesystem.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CodeSystem Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class CodeSystem(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Declares the existence of and describes a code system or code system supplement. The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content. """ __resource_type__ = "CodeSystem" caseSensitive: bool | None = Field( default=None, alias="caseSensitive", title="If code comparison is case sensitive", description=( "If code comparison is case sensitive when codes within this system are" " compared to each other." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) caseSensitive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_caseSensitive", title="Extension field for ``caseSensitive``.", ) compositional: bool | None = Field( default=None, alias="compositional", title="If code system defines a compositional grammar", description="The code system defines a compositional (post-coordination) grammar.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) compositional__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_compositional", title="Extension field for ``compositional``.", ) concept: typing.List[fhirtypes.CodeSystemConceptType] | None = Field( default=None, alias="concept", title="Concepts in the code system", description=( "Concepts that are in the code system. The concept definitions are " "inherently hierarchical, but the definitions must be consulted to " "determine what the meanings of the hierarchical relationships are." ), json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) content: fhirtypes.CodeType | None = Field( default=None, alias="content", title="not-present | example | fragment | complete | supplement", description=( "The extent of the content of the code system (the concepts and codes " "it defines) are represented in this resource instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "not-present", "example", "fragment", "complete", "supplement", ], }, ) content__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_content", title="Extension field for ``content``." ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the code system and/or its contents." " Copyright statements are generally legal restrictions on the use and " "publishing of the code system." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) count: fhirtypes.UnsignedIntType | None = Field( default=None, alias="count", title="Total concepts in the code system", description=( "The total number of concepts defined by the code system. Where the " "code system has a compositional grammar, the basis of this count is " "defined by the system steward." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_count", title="Extension field for ``count``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the code system was published. " "The date must change when the business version changes and it must " "change if the status code changes. In addition, it should change when " "the substantive content of the code system changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the code system", description=( "A free text natural language description of the code system from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this code system is authored for " "testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) filter: typing.List[fhirtypes.CodeSystemFilterType] | None = Field( default=None, alias="filter", title="Filter that can be used in a value set", description=( "A filter that can be used in a value set compose statement when " "selecting concepts using a filter." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) hierarchyMeaning: fhirtypes.CodeType | None = Field( default=None, alias="hierarchyMeaning", title="grouped-by | is-a | part-of | classified-with", description=( "The meaning of the hierarchy of concepts as represented in this " "resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["grouped-by", "is-a", "part-of", "classified-with"], }, ) hierarchyMeaning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_hierarchyMeaning", title="Extension field for ``hierarchyMeaning``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the code system (business identifier)", description=( "A formal identifier that is used to identify this code system when it " "is represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for code system (if applicable)", description=( "A legal or geographic region in which the code system is intended to " "be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this code system (computer friendly)", description=( "A natural language name identifying the code system. This name should " "be usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) property: typing.List[fhirtypes.CodeSystemPropertyType] | None = Field( default=None, alias="property", title="Additional information supplied about each concept", description=( "A property defines an additional slot through which additional " "information can be provided about a concept." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the code " "system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this code system is defined", description=( "Explanation of why this code system is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The date (and optionally time) when the code system resource was " "created or revised." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) supplements: fhirtypes.CanonicalType | None = Field( default=None, alias="supplements", title="Canonical URL of Code System this adds designations and properties to", description=( "The canonical URL of the code system that this code system supplement " "is adding designations and properties to." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CodeSystem"], }, ) supplements__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_supplements", title="Extension field for ``supplements``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this code system (human friendly)", description="A short, descriptive, user-friendly title for the code system.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this code system, represented as a URI " "(globally unique) (Coding.system)" ), description=( "An absolute URI that is used to identify this code system when it is " "referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which at which an authoritative " "instance of this code system is (or will be) published. This URL can " "be the target of a canonical reference. It SHALL remain the same when " "the code system is stored on different servers. This is used in " "[Coding](datatypes.html#Coding).system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate code system instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueSet: fhirtypes.CanonicalType | None = Field( default=None, alias="valueSet", title="Canonical reference to the value set with entire code system", description=( "Canonical reference to the value set that contains the entire code " "system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueSet", title="Extension field for ``valueSet``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the code system (Coding.version)", description=( "The identifier that is used to identify this version of the code " "system when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the code system author" " and is not expected to be globally unique. For example, it might be a" " timestamp (e.g. yyyymmdd) if a managed version is not available. " "There is also no expectation that versions can be placed in a " "lexicographical sequence. This is used in " "[Coding](datatypes.html#Coding).version." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionNeeded: bool | None = Field( default=None, alias="versionNeeded", title="If definitions are not stable", description=( "This flag is used to signify that the code system does not commit to " "concept permanence across versions. If true, a version must be " "specified when referencing this code system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) versionNeeded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionNeeded", title="Extension field for ``versionNeeded``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CodeSystem`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "caseSensitive", "valueSet", "hierarchyMeaning", "compositional", "versionNeeded", "content", "supplements", "count", "filter", "property", "concept", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CodeSystem`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "caseSensitive", "valueSet", "hierarchyMeaning", "compositional", "versionNeeded", "content", "supplements", "count", "filter", "property", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("content", "content__ext"), ("status", "status__ext")] return required_fields class CodeSystemConcept(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Concepts in the code system. Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meanings of the hierarchical relationships are. """ __resource_type__ = "CodeSystemConcept" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Code that identifies concept", description=( "A code - a text symbol - that uniquely identifies the concept within " "the code system." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) concept: typing.List[fhirtypes.CodeSystemConceptType] | None = Field( default=None, alias="concept", title="Child Concepts (is-a/contains/categorizes)", description=( "Defines children of a concept to produce a hierarchy of concepts. The " "nature of the relationships is variable (is-a/contains/categorizes) - " "see hierarchyMeaning." ), json_schema_extra={ "element_property": True, }, ) definition: fhirtypes.StringType | None = Field( default=None, alias="definition", title="Formal definition", description=( "The formal definition of the concept. The code system resource does " "not make formal definitions required, because of the prevalence of " "legacy systems. However, they are highly recommended, as without them " "there is no formal meaning associated with the concept." ), json_schema_extra={ "element_property": True, }, ) definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) designation: typing.List[fhirtypes.CodeSystemConceptDesignationType] | None = Field( default=None, alias="designation", title="Additional representations for the concept", description=( "Additional representations for the concept - other languages, aliases," " specialized purposes, used for particular purposes, etc." ), json_schema_extra={ "element_property": True, }, ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Text to display to the user", description=( "A human readable string that is the recommended default way to present" " this concept to a user." ), json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) property: typing.List[fhirtypes.CodeSystemConceptPropertyType] | None = Field( default=None, alias="property", title="Property value for the concept", description="A property value for this concept.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CodeSystemConcept`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "display", "definition", "designation", "property", "concept", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CodeSystemConcept`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields class CodeSystemConceptDesignation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional representations for the concept. Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc. """ __resource_type__ = "CodeSystemConceptDesignation" language: fhirtypes.CodeType | None = Field( default=None, alias="language", title="Human language of the designation", description="The language this designation is defined for.", json_schema_extra={ "element_property": True, }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) use: fhirtypes.CodingType | None = Field( default=None, alias="use", title="Details how this designation would be used", description="A code that details how this designation would be used.", json_schema_extra={ "element_property": True, }, ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The text value for this designation", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CodeSystemConceptDesignation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "language", "use", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CodeSystemConceptDesignation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("value", "value__ext")] return required_fields class CodeSystemConceptProperty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Property value for the concept. A property value for this concept. """ __resource_type__ = "CodeSystemConceptProperty" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Reference to CodeSystem.property.code", description="A code that is a reference to CodeSystem.property.code.", json_schema_extra={ "element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CodeSystemConceptProperty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "valueCode", "valueCoding", "valueString", "valueInteger", "valueBoolean", "valueDateTime", "valueDecimal", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CodeSystemConceptProperty`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueCode", "valueCoding", "valueDateTime", "valueDecimal", "valueInteger", "valueString", ] } return one_of_many_fields class CodeSystemFilter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Filter that can be used in a value set. A filter that can be used in a value set compose statement when selecting concepts using a filter. """ __resource_type__ = "CodeSystemFilter" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Code that identifies the filter", description=( "The code that identifies this filter when it is used as a filter in " "[ValueSet](valueset.html#).compose.include.filter." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="How or why the filter is used", description="A description of how or why the filter is used.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) operator: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="operator", title=( "= | is-a | descendent-of | is-not-a | regex | in | not-in | " "generalizes | exists" ), description="A list of operators that can be used with the filter.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "=", "is-a", "descendent-of", "is-not-a", "regex", "in", "not-in", "generalizes", "exists", ], }, ) operator__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_operator", title="Extension field for ``operator``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="What to use for the value", description="A description of what the value for the filter should be.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CodeSystemFilter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "description", "operator", "value", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CodeSystemFilter`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "description", "operator", "value"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("code", "code__ext"), ("operator", "operator__ext"), ("value", "value__ext"), ] return required_fields class CodeSystemProperty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional information supplied about each concept. A property defines an additional slot through which additional information can be provided about a concept. """ __resource_type__ = "CodeSystemProperty" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title=( "Identifies the property on the concepts, and when referred to in " "operations" ), description=( "A code that is used to identify the property. The code is used " "internally (in CodeSystem.concept.property.code) and also externally, " "such as in property filters." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Why the property is defined, and/or what it conveys", description=( "A description of the property- why it is defined, and how its value " "might be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="code | Coding | string | integer | boolean | dateTime | decimal", description=( 'The type of the property value. Properties of type "code" contain a ' "code defined by the code system (e.g. a reference to another defined " "concept)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "code", "Coding", "string", "integer", "boolean", "dateTime", "decimal", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) uri: fhirtypes.UriType | None = Field( default=None, alias="uri", title="Formal identifier for the property", description=( "Reference to the formal meaning of the property. One possible source " "of meaning is the [Concept Properties](codesystem-concept-" "properties.html) code system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uri", title="Extension field for ``uri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CodeSystemProperty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "uri", "description", "type", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CodeSystemProperty`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "uri", "description", "type"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext"), ("type", "type__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/coding.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Coding Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Coding(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A reference to a code defined by a terminology system. """ __resource_type__ = "Coding" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Symbol in syntax defined by the system", description=( "A symbol in syntax defined by the system. The symbol may be a " "predefined code or an expression in a syntax defined by the coding " "system (e.g. post-coordination)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Representation defined by the system", description=( "A representation of the meaning of the code in the system, following " "the rules of the system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) system: fhirtypes.UriType | None = Field( default=None, alias="system", title="Identity of the terminology system", description=( "The identification of the code system that defines the meaning of the " "symbol in the code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) userSelected: bool | None = Field( default=None, alias="userSelected", title="If this coding was chosen directly by the user", description=( "Indicates that this coding was chosen by a user directly - e.g. off a " "pick list of available items (codes or displays)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) userSelected__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_userSelected", title="Extension field for ``userSelected``.", ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Version of the system - if relevant", description=( "The version of the code system which was used when choosing this code." " Note that a well-maintained code system does not need the version " "reported, because the meaning of codes is consistent across versions. " "However this cannot consistently be assured, and when the meaning is " "not guaranteed to be consistent, the version SHOULD be exchanged." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Coding`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "system", "version", "code", "display", "userSelected", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Coding`` according to specification, with preserving the original sequence order. """ return ["system", "version", "code", "display", "userSelected"] ================================================ FILE: fhir/resources/R4B/communication.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Communication Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Communication(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A record of information transmitted from a sender to a receiver. An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency that was notified about a reportable condition. """ __resource_type__ = "Communication" about: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="about", title="Resources that pertain to this communication", description=( "Other resources that pertain to this communication and to which this " "communication should be associated." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Request fulfilled by this communication", description=( "An order, proposal or plan fulfilled in whole or in part by this " "Communication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Message category", description=( "The type of message conveyed such as alert, notification, reminder, " "instruction, etc." ), json_schema_extra={ "element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter created as part of", description=( "The Encounter during which this Communication was created or to which " "the creation of this record is tightly associated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique identifier", description=( "Business identifiers assigned to this communication by the performer " "or other systems which remain constant as the resource is updated and " "propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) inResponseTo: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="inResponseTo", title="Reply to", description="Prior communication that this communication is in response to.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Communication"], }, ) instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="instantiatesCanonical", title="Instantiates FHIR protocol or definition", description=( "The URL pointing to a FHIR-defined protocol, guideline, orderset or " "other definition that is adhered to in whole or in part by this " "Communication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "PlanDefinition", "ActivityDefinition", "Measure", "OperationDefinition", "Questionnaire", ], }, ) instantiatesCanonical__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="instantiatesUri", title="Instantiates external protocol or definition", description=( "The URL pointing to an externally maintained protocol, guideline, " "orderset or other definition that is adhered to in whole or in part by" " this Communication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) medium: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="medium", title="A channel of communication", description="A channel that was used for this communication (e.g. email, fax).", json_schema_extra={ "element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the communication", description=( "Additional notes or commentary about the communication by the sender, " "receiver or other interested parties." ), json_schema_extra={ "element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of this action", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) payload: typing.List[fhirtypes.CommunicationPayloadType] | None = Field( default=None, alias="payload", title="Message payload", description=( "Text, attachment(s), or resource(s) that was communicated to the " "recipient." ), json_schema_extra={ "element_property": True, }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Characterizes how quickly the planned or in progress communication " "must be addressed. Includes concepts such as stat, urgent, routine." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Indication for message", description="The reason or justification for the communication.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Why was communication done?", description=( "Indicates another resource whose existence justifies this " "communication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "DiagnosticReport", "DocumentReference", ], }, ) received: fhirtypes.DateTimeType | None = Field( default=None, alias="received", title="When received", description="The time when this communication arrived at the destination.", json_schema_extra={ "element_property": True, }, ) received__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_received", title="Extension field for ``received``." ) recipient: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="recipient", title="Message recipient", description=( "The entity (e.g. person, organization, clinical information system, " "care team or device) which was the target of the communication. If " "receipts need to be tracked by an individual, a separate resource " "instance will need to be created for each recipient. Multiple " "recipient communications are intended where either receipts are not " "tracked (e.g. a mass mail-out) or a receipt is captured in aggregate " "(all emails confirmed received by a particular time)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Group", "CareTeam", "HealthcareService", ], }, ) sender: fhirtypes.ReferenceType | None = Field( default=None, alias="sender", title="Message sender", description=( "The entity (e.g. person, organization, clinical information system, or" " device) which was the source of the communication." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "HealthcareService", ], }, ) sent: fhirtypes.DateTimeType | None = Field( default=None, alias="sent", title="When sent", description="The time when this communication was sent.", json_schema_extra={ "element_property": True, }, ) sent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sent", title="Extension field for ``sent``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "preparation | in-progress | not-done | on-hold | stopped | completed |" " entered-in-error | unknown" ), description="The status of the transmission.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "preparation", "in-progress", "not-done", "on-hold", "stopped", "completed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="statusReason", title="Reason for current status", description="Captures the reason for the current state of the Communication.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Focus of message", description="The patient or group that was the focus of this communication.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) topic: fhirtypes.CodeableConceptType | None = Field( default=None, alias="topic", title="Description of the purpose/content", description=( "Description of the purpose/content, similar to a subject line in an " "email." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Communication`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "partOf", "inResponseTo", "status", "statusReason", "category", "priority", "medium", "subject", "topic", "about", "encounter", "sent", "received", "recipient", "sender", "reasonCode", "reasonReference", "payload", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Communication`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "partOf", "status", "statusReason", "priority", "subject", "encounter", "reasonCode", "reasonReference", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class CommunicationPayload(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Message payload. Text, attachment(s), or resource(s) that was communicated to the recipient. """ __resource_type__ = "CommunicationPayload" contentAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="contentAttachment", title="Message part content", description=( "A communicated content (or for multi-part communications, one portion " "of the communication)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, }, ) contentReference: fhirtypes.ReferenceType | None = Field( default=None, alias="contentReference", title="Message part content", description=( "A communicated content (or for multi-part communications, one portion " "of the communication)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) contentString: fhirtypes.StringType | None = Field( default=None, alias="contentString", title="Message part content", description=( "A communicated content (or for multi-part communications, one portion " "of the communication)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, }, ) contentString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contentString", title="Extension field for ``contentString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CommunicationPayload`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "contentString", "contentAttachment", "contentReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CommunicationPayload`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "content": ["contentAttachment", "contentReference", "contentString"] } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/communicationrequest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CommunicationRequest Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class CommunicationRequest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A request for information to be sent to a receiver. A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition. """ __resource_type__ = "CommunicationRequest" about: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="about", title="Resources that pertain to this communication request", description=( "Other resources that pertain to this communication request and to " "which this communication request should be associated." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) authoredOn: fhirtypes.DateTimeType | None = Field( default=None, alias="authoredOn", title="When request transitioned to being actionable", description=( "For draft requests, indicates the date of initial creation. For " "requests with other statuses, indicates the date of activation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoredOn", title="Extension field for ``authoredOn``." ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Fulfills plan or proposal", description=( "A plan or proposal that is fulfilled in whole or in part by this " "request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Message category", description=( "The type of message to be sent such as alert, notification, reminder, " "instruction, etc." ), json_schema_extra={ "element_property": True, }, ) doNotPerform: bool | None = Field( default=None, alias="doNotPerform", title="True if request is prohibiting action", description=( "If true indicates that the CommunicationRequest is asking for the " "specified action to *not* occur." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doNotPerform", title="Extension field for ``doNotPerform``.", ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter created as part of", description=( "The Encounter during which this CommunicationRequest was created or to" " which the creation of this record is tightly associated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) groupIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="groupIdentifier", title="Composite request this is part of", description=( "A shared identifier common to all requests that were authorized more " "or less simultaneously by a single author, representing the identifier" " of the requisition, prescription or similar form." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique identifier", description=( "Business identifiers assigned to this communication request by the " "performer or other systems which remain constant as the resource is " "updated and propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) medium: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="medium", title="A channel of communication", description="A channel that was used for this communication (e.g. email, fax).", json_schema_extra={ "element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about communication request", description=( "Comments made about the request by the requester, sender, recipient, " "subject or other participants." ), json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When scheduled", description="The time when this communication is to occur.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="When scheduled", description="The time when this communication is to occur.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) payload: typing.List[fhirtypes.CommunicationRequestPayloadType] | None = Field( default=None, alias="payload", title="Message payload", description=( "Text, attachment(s), or resource(s) to be communicated to the " "recipient." ), json_schema_extra={ "element_property": True, }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Characterizes how quickly the proposed act must be initiated. Includes" " concepts such as stat, urgent, routine." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Why is communication needed?", description="Describes why the request is being made in coded or textual form.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Why is communication needed?", description="Indicates another resource whose existence justifies this request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "DiagnosticReport", "DocumentReference", ], }, ) recipient: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="recipient", title="Message recipient", description=( "The entity (e.g. person, organization, clinical information system, " "device, group, or care team) which is the intended target of the " "communication." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Group", "CareTeam", "HealthcareService", ], }, ) replaces: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="replaces", title="Request(s) replaced by this request", description=( "Completed or terminated request(s) whose function is taken by this new" " request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CommunicationRequest"], }, ) requester: fhirtypes.ReferenceType | None = Field( default=None, alias="requester", title="Who/what is requesting service", description=( "The device, individual, or organization who initiated the request and " "has responsibility for its activation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Patient", "RelatedPerson", "Device", ], }, ) sender: fhirtypes.ReferenceType | None = Field( default=None, alias="sender", title="Message sender", description=( "The entity (e.g. person, organization, clinical information system, or" " device) which is to be the source of the communication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "HealthcareService", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "draft | active | on-hold | revoked | completed | entered-in-error | " "unknown" ), description="The status of the proposal or order.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "draft", "active", "on-hold", "revoked", "completed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="statusReason", title="Reason for current status", description="Captures the reason for the current state of the CommunicationRequest.", json_schema_extra={ "element_property": True, }, ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Focus of message", description="The patient or group that is the focus of this communication request.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CommunicationRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "replaces", "groupIdentifier", "status", "statusReason", "category", "priority", "doNotPerform", "medium", "subject", "about", "encounter", "payload", "occurrenceDateTime", "occurrencePeriod", "authoredOn", "requester", "recipient", "sender", "reasonCode", "reasonReference", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CommunicationRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "basedOn", "replaces", "groupIdentifier", "status", "priority", "doNotPerform", "encounter", "occurrenceDateTime", "occurrencePeriod", "authoredOn", "requester", "sender", "reasonCode", "reasonReference", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"occurrence": ["occurrenceDateTime", "occurrencePeriod"]} return one_of_many_fields class CommunicationRequestPayload(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Message payload. Text, attachment(s), or resource(s) to be communicated to the recipient. """ __resource_type__ = "CommunicationRequestPayload" contentAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="contentAttachment", title="Message part content", description=( "The communicated content (or for multi-part communications, one " "portion of the communication)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, }, ) contentReference: fhirtypes.ReferenceType | None = Field( default=None, alias="contentReference", title="Message part content", description=( "The communicated content (or for multi-part communications, one " "portion of the communication)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) contentString: fhirtypes.StringType | None = Field( default=None, alias="contentString", title="Message part content", description=( "The communicated content (or for multi-part communications, one " "portion of the communication)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, }, ) contentString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contentString", title="Extension field for ``contentString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CommunicationRequestPayload`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "contentString", "contentAttachment", "contentReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CommunicationRequestPayload`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "content": ["contentAttachment", "contentReference", "contentString"] } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/compartmentdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CompartmentDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class CompartmentDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Compartment Definition for a resource. A compartment definition that defines how resources are accessed on a server. """ __resource_type__ = "CompartmentDefinition" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Patient | Encounter | RelatedPerson | Practitioner | Device", description="Which compartment this definition describes.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "Patient", "Encounter", "RelatedPerson", "Practitioner", "Device", ], }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the compartment definition was " "published. The date must change when the business version changes and " "it must change if the status code changes. In addition, it should " "change when the substantive content of the compartment definition " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the compartment definition", description=( "A free text natural language description of the compartment definition" " from a consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this compartment definition is " "authored for testing purposes (or education/evaluation/marketing) and " "is not intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this compartment definition (computer friendly)", description=( "A natural language name identifying the compartment definition. This " "name should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the " "compartment definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this compartment definition is defined", description=( "Explanation of why this compartment definition is needed and why it " "has been designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) resource: typing.List[fhirtypes.CompartmentDefinitionResourceType] | None = Field( default=None, alias="resource", title="How a resource is related to the compartment", description="Information about how a resource is related to the compartment.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) search: bool | None = Field( default=None, alias="search", title="Whether the search syntax is supported", description="Whether the search syntax is supported,.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) search__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_search", title="Extension field for ``search``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this compartment definition. Enables tracking the life-" "cycle of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this compartment definition, represented as a" " URI (globally unique)" ), description=( "An absolute URI that is used to identify this compartment definition " "when it is referenced in a specification, model, design or an " "instance; also called its canonical identifier. This SHOULD be " "globally unique and SHOULD be a literal address at which at which an " "authoritative instance of this compartment definition is (or will be) " "published. This URL can be the target of a canonical reference. It " "SHALL remain the same when the compartment definition is stored on " "different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate compartment definition " "instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the compartment definition", description=( "The identifier that is used to identify this version of the " "compartment definition when it is referenced in a specification, " "model, design or instance. This is an arbitrary value managed by the " "compartment definition author and is not expected to be globally " "unique. For example, it might be a timestamp (e.g. yyyymmdd) if a " "managed version is not available. There is also no expectation that " "versions can be placed in a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CompartmentDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "version", "name", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "purpose", "code", "search", "resource", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CompartmentDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "version", "name", "status", "experimental", "date", "publisher", "contact", "useContext", "code", "search", "resource", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("code", "code__ext"), ("name", "name__ext"), ("search", "search__ext"), ("status", "status__ext"), ("url", "url__ext"), ] return required_fields class CompartmentDefinitionResource(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. How a resource is related to the compartment. Information about how a resource is related to the compartment. """ __resource_type__ = "CompartmentDefinitionResource" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Name of resource type", description="The name of a resource supported by the server.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Additional documentation about the resource and compartment", description=None, json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) param: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="param", title="Search Parameter Name, or chained parameters", description=( "The name of a search parameter that represents the link to the " "compartment. More than one may be listed because a resource may be " "linked to a compartment in more than one way,." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) param__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_param", title="Extension field for ``param``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CompartmentDefinitionResource`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "param", "documentation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CompartmentDefinitionResource`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "param"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/composition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Composition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Composition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A set of resources composed into a single coherent clinical statement with clinical attestation. A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.). """ __resource_type__ = "Composition" attester: typing.List[fhirtypes.CompositionAttesterType] | None = Field( default=None, alias="attester", title="Attests to accuracy of composition", description=( "A participant who has attested to the accuracy of the " "composition/document." ), json_schema_extra={ "element_property": True, }, ) author: typing.List[fhirtypes.ReferenceType] = Field( default=..., alias="author", title="Who and/or what authored the composition", description=( "Identifies who is responsible for the information in the composition, " "not necessarily who typed it in." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Device", "Patient", "RelatedPerson", "Organization", ], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Categorization of Composition", description=( "A categorization for the type of the composition - helps for indexing " "and searching. This may be implied by or derived from the code " "specified in the Composition Type." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) confidentiality: fhirtypes.CodeType | None = Field( default=None, alias="confidentiality", title="As defined by affinity domain", description="The code specifying the level of confidentiality of the Composition.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) confidentiality__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_confidentiality", title="Extension field for ``confidentiality``.", ) custodian: fhirtypes.ReferenceType | None = Field( default=None, alias="custodian", title="Organization which maintains the composition", description=( "Identifies the organization or group who is responsible for ongoing " "maintenance of and access to the composition/document information." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Composition editing time", description=( "The composition editing time, when the composition was last logically " "changed by the author." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Context of the Composition", description=( "Describes the clinical encounter or type of care this documentation is" " associated with." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) event: typing.List[fhirtypes.CompositionEventType] | None = Field( default=None, alias="event", title="The clinical service(s) being documented", description=( "The clinical service, such as a colonoscopy or an appendectomy, being " "documented." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Version-independent identifier for the Composition", description=( "A version-independent identifier for the Composition. This identifier " "stays constant as the composition is changed over time." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) relatesTo: typing.List[fhirtypes.CompositionRelatesToType] | None = Field( default=None, alias="relatesTo", title="Relationships to other compositions/documents", description=( "Relationships that this composition has with other compositions or " "documents that already exist." ), json_schema_extra={ "element_property": True, }, ) section: typing.List[fhirtypes.CompositionSectionType] | None = Field( default=None, alias="section", title="Composition is broken into sections", description="The root of the sections that make up the composition.", json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="preliminary | final | amended | entered-in-error", description=( "The workflow/clinical status of this composition. The status is a " "marker for the clinical standing of the document." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["preliminary", "final", "amended", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Who and/or what the composition is about", description=( "Who or what the composition is about. The composition can be about a " "person, (patient or healthcare practitioner), a device (e.g. a " "machine) or even a group of subjects (such as a document about a herd " "of livestock, or a set of patients that share a common exposure)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Human Readable name/title", description="Official human-readable label for the composition.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Kind of composition (LOINC if possible)", description=( "Specifies the particular kind of composition (e.g. History and " "Physical, Discharge Summary, Progress Note). This usually equates to " "the purpose of making the composition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Composition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "type", "category", "subject", "encounter", "date", "author", "title", "confidentiality", "attester", "custodian", "relatesTo", "event", "section", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Composition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "type", "category", "subject", "encounter", "date", "author", "title", "confidentiality", "custodian", "event", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("date", "date__ext"), ("status", "status__ext"), ("title", "title__ext"), ] return required_fields class CompositionAttester(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Attests to accuracy of composition. A participant who has attested to the accuracy of the composition/document. """ __resource_type__ = "CompositionAttester" mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="personal | professional | legal | official", description="The type of attestation the authenticator offers.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["personal", "professional", "legal", "official"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) party: fhirtypes.ReferenceType | None = Field( default=None, alias="party", title="Who attested the composition", description="Who attested the composition in the specified way.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "RelatedPerson", "Practitioner", "PractitionerRole", "Organization", ], }, ) time: fhirtypes.DateTimeType | None = Field( default=None, alias="time", title="When the composition was attested", description="When the composition was attested by the party.", json_schema_extra={ "element_property": True, }, ) time__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_time", title="Extension field for ``time``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CompositionAttester`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "mode", "time", "party"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CompositionAttester`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("mode", "mode__ext")] return required_fields class CompositionEvent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The clinical service(s) being documented. The clinical service, such as a colonoscopy or an appendectomy, being documented. """ __resource_type__ = "CompositionEvent" code: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="code", title="Code(s) that apply to the event being documented", description=( "This list of codes represents the main clinical acts, such as a " "colonoscopy or an appendectomy, being documented. In some cases, the " 'event is inherent in the typeCode, such as a "History and Physical ' 'Report" in which the procedure being documented is necessarily a ' '"History and Physical" act.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) detail: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="detail", title="The event(s) being documented", description=( "The description and/or reference of the event(s) being documented. For" " example, this could be used to document such a colonoscopy or an " "appendectomy." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="The period covered by the documentation", description=( "The period of time covered by the documentation. There is no assertion" " that the documentation is a complete representation for this period, " "only that it documents events during this time." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CompositionEvent`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "period", "detail"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CompositionEvent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "period", "detail"] class CompositionRelatesTo(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Relationships to other compositions/documents. Relationships that this composition has with other compositions or documents that already exist. """ __resource_type__ = "CompositionRelatesTo" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="replaces | transforms | signs | appends", description=( "The type of relationship that this composition has with anther " "composition or document." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["replaces", "transforms", "signs", "appends"], }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) targetIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="targetIdentifier", title="Target of the relationship", description="The target composition/document of this relationship.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e target[x] "one_of_many": "target", "one_of_many_required": True, }, ) targetReference: fhirtypes.ReferenceType | None = Field( default=None, alias="targetReference", title="Target of the relationship", description="The target composition/document of this relationship.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e target[x] "one_of_many": "target", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Composition"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CompositionRelatesTo`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "targetIdentifier", "targetReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CompositionRelatesTo`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"target": ["targetIdentifier", "targetReference"]} return one_of_many_fields class CompositionSection(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Composition is broken into sections. The root of the sections that make up the composition. """ __resource_type__ = "CompositionSection" author: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="author", title="Who and/or what authored the section", description=( "Identifies who is responsible for the information in this section, not" " necessarily who typed it in." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Device", "Patient", "RelatedPerson", "Organization", ], }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Classification of section (recommended)", description=( "A code identifying the kind of content contained within the section. " "This must be consistent with the section title." ), json_schema_extra={ "element_property": True, }, ) emptyReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="emptyReason", title="Why the section is empty", description=( "If the section is empty, why the list is empty. An empty section " "typically has some text explaining the empty reason." ), json_schema_extra={ "element_property": True, }, ) entry: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="entry", title="A reference to data that supports this section", description=( "A reference to the actual resource from which the narrative in the " "section is derived." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) focus: fhirtypes.ReferenceType | None = Field( default=None, alias="focus", title=( "Who/what the section is about, when it is not about the subject of " "composition" ), description=( "The actual focus of the section when it is not the subject of the " "composition, but instead represents something or someone associated " "with the subject such as (for a patient subject) a spouse, parent, " "fetus, or donor. If not focus is specified, the focus is assumed to be" " focus of the parent section, or, for a section in the Composition " "itself, the subject of the composition. Sections with a focus SHALL " "only include resources where the logical subject (patient, subject, " "focus, etc.) matches the section focus, or the resources have no " "logical subject (few resources)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="working | snapshot | changes", description=( "How the entry list was prepared - whether it is a working list that is" " suitable for being maintained on an ongoing basis, or if it " "represents a snapshot of a list of items from another source, or " "whether it is a prepared list where items may be marked as added, " "modified or deleted." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["working", "snapshot", "changes"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) orderedBy: fhirtypes.CodeableConceptType | None = Field( default=None, alias="orderedBy", title="Order of section entries", description="Specifies the order applied to the items in the section entries.", json_schema_extra={ "element_property": True, }, ) section: typing.List[fhirtypes.CompositionSectionType] | None = Field( default=None, alias="section", title="Nested Section", description="A nested sub-section within this section.", json_schema_extra={ "element_property": True, }, ) text: fhirtypes.NarrativeType | None = Field( default=None, alias="text", title="Text summary of the section, for human interpretation", description=( "A human-readable narrative that contains the attested content of the " "section, used to represent the content of the resource to a human. The" " narrative need not encode all the structured data, but is required to" ' contain sufficient detail to make it "clinically safe" for a human to' " just read the narrative." ), json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Label for section (e.g. for ToC)", description=( "The label for this particular section. This will be part of the " "rendered content for the document, and is often used to build a table " "of contents." ), json_schema_extra={ "element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CompositionSection`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "title", "code", "author", "focus", "text", "mode", "orderedBy", "entry", "emptyReason", "section", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CompositionSection`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/conceptmap.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ConceptMap Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ConceptMap(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A map from one set of concepts to one or more other concepts. A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models. """ __resource_type__ = "ConceptMap" contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the concept map and/or its contents." " Copyright statements are generally legal restrictions on the use and " "publishing of the concept map." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the concept map was published. " "The date must change when the business version changes and it must " "change if the status code changes. In addition, it should change when " "the substantive content of the concept map changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the concept map", description=( "A free text natural language description of the concept map from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this concept map is authored for " "testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) group: typing.List[fhirtypes.ConceptMapGroupType] | None = Field( default=None, alias="group", title="Same source and target systems", description="A group of mappings that all have the same source and target system.", json_schema_extra={ "element_property": True, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Additional identifier for the concept map", description=( "A formal identifier that is used to identify this concept map when it " "is represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for concept map (if applicable)", description=( "A legal or geographic region in which the concept map is intended to " "be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this concept map (computer friendly)", description=( "A natural language name identifying the concept map. This name should " "be usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the concept " "map." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this concept map is defined", description=( "Explanation of why this concept map is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) sourceCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="sourceCanonical", title="The source value set that contains the concepts that are being mapped", description=( "Identifier for the source value set that contains the concepts that " "are being mapped and provides context for the mappings." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e source[x] "one_of_many": "source", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) sourceCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceCanonical", title="Extension field for ``sourceCanonical``.", ) sourceUri: fhirtypes.UriType | None = Field( default=None, alias="sourceUri", title="The source value set that contains the concepts that are being mapped", description=( "Identifier for the source value set that contains the concepts that " "are being mapped and provides context for the mappings." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e source[x] "one_of_many": "source", "one_of_many_required": False, }, ) sourceUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceUri", title="Extension field for ``sourceUri``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this concept map. Enables tracking the life-cycle of the" " content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) targetCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="targetCanonical", title="The target value set which provides context for the mappings", description=( "The target value set provides context for the mappings. Note that the " "mapping is made between concepts, not between value sets, but the " "value set provides important context about how the concept mapping " "choices are made." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e target[x] "one_of_many": "target", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) targetCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_targetCanonical", title="Extension field for ``targetCanonical``.", ) targetUri: fhirtypes.UriType | None = Field( default=None, alias="targetUri", title="The target value set which provides context for the mappings", description=( "The target value set provides context for the mappings. Note that the " "mapping is made between concepts, not between value sets, but the " "value set provides important context about how the concept mapping " "choices are made." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e target[x] "one_of_many": "target", "one_of_many_required": False, }, ) targetUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_targetUri", title="Extension field for ``targetUri``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this concept map (human friendly)", description="A short, descriptive, user-friendly title for the concept map.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this concept map, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this concept map when it is " "referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which at which an authoritative " "instance of this concept map is (or will be) published. This URL can " "be the target of a canonical reference. It SHALL remain the same when " "the concept map is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate concept map instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the concept map", description=( "The identifier that is used to identify this version of the concept " "map when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the concept map author" " and is not expected to be globally unique. For example, it might be a" " timestamp (e.g. yyyymmdd) if a managed version is not available. " "There is also no expectation that versions can be placed in a " "lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConceptMap`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "sourceUri", "sourceCanonical", "targetUri", "targetCanonical", "group", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConceptMap`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "sourceUri", "sourceCanonical", "targetUri", "targetCanonical", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "source": ["sourceCanonical", "sourceUri"], "target": ["targetCanonical", "targetUri"], } return one_of_many_fields class ConceptMapGroup(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Same source and target systems. A group of mappings that all have the same source and target system. """ __resource_type__ = "ConceptMapGroup" element: typing.List[fhirtypes.ConceptMapGroupElementType] = Field( default=..., alias="element", title="Mappings for a concept from the source set", description=( "Mappings for an individual concept in the source to one or more " "concepts in the target." ), json_schema_extra={ "element_property": True, }, ) source: fhirtypes.UriType | None = Field( default=None, alias="source", title="Source system where concepts to be mapped are defined", description=( "An absolute URI that identifies the source system where the concepts " "to be mapped are defined." ), json_schema_extra={ "element_property": True, }, ) source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_source", title="Extension field for ``source``." ) sourceVersion: fhirtypes.StringType | None = Field( default=None, alias="sourceVersion", title="Specific version of the code system", description=( "The specific version of the code system, as determined by the code " "system authority." ), json_schema_extra={ "element_property": True, }, ) sourceVersion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceVersion", title="Extension field for ``sourceVersion``.", ) target: fhirtypes.UriType | None = Field( default=None, alias="target", title="Target system that the concepts are to be mapped to", description=( "An absolute URI that identifies the target system that the concepts " "will be mapped to." ), json_schema_extra={ "element_property": True, }, ) target__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_target", title="Extension field for ``target``." ) targetVersion: fhirtypes.StringType | None = Field( default=None, alias="targetVersion", title="Specific version of the code system", description=( "The specific version of the code system, as determined by the code " "system authority." ), json_schema_extra={ "element_property": True, }, ) targetVersion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_targetVersion", title="Extension field for ``targetVersion``.", ) unmapped: fhirtypes.ConceptMapGroupUnmappedType | None = Field( default=None, alias="unmapped", title="What to do when there is no mapping for the source concept", description=( 'What to do when there is no mapping for the source concept. "Unmapped"' " does not include codes that are unmatched, and the unmapped element " "is ignored in a code is specified to have equivalence = unmatched." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConceptMapGroup`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "source", "sourceVersion", "target", "targetVersion", "element", "unmapped", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConceptMapGroup`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ConceptMapGroupElement(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Mappings for a concept from the source set. Mappings for an individual concept in the source to one or more concepts in the target. """ __resource_type__ = "ConceptMapGroupElement" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Identifies element being mapped", description="Identity (code or path) or the element/item being mapped.", json_schema_extra={ "element_property": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Display for the code", description=( "The display for the code. The display is only provided to help editors" " when editing the concept map." ), json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) target: typing.List[fhirtypes.ConceptMapGroupElementTargetType] | None = Field( default=None, alias="target", title="Concept in target system for element", description="A concept from the target value set that this concept maps to.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConceptMapGroupElement`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "display", "target"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConceptMapGroupElement`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ConceptMapGroupElementTarget(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Concept in target system for element. A concept from the target value set that this concept maps to. """ __resource_type__ = "ConceptMapGroupElementTarget" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Code that identifies the target element", description="Identity (code or path) or the element/item that the map refers to.", json_schema_extra={ "element_property": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Description of status/issues in mapping", description=( "A description of status/issues in mapping that conveys additional " "information not represented in the structured data." ), json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) dependsOn: typing.List[ fhirtypes.ConceptMapGroupElementTargetDependsOnType ] | None = Field( default=None, alias="dependsOn", title="Other elements required for this mapping (from context)", description=( "A set of additional dependencies for this mapping to hold. This " "mapping is only applicable if the specified element can be resolved, " "and it has the specified value." ), json_schema_extra={ "element_property": True, }, ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Display for the code", description=( "The display for the code. The display is only provided to help editors" " when editing the concept map." ), json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) equivalence: fhirtypes.CodeType | None = Field( default=None, alias="equivalence", title=( "relatedto | equivalent | equal | wider | subsumes | narrower | " "specializes | inexact | unmatched | disjoint" ), description=( "The equivalence between the source and target concepts (counting for " "the dependencies and products). The equivalence is read from target to" " source (e.g. the target is 'wider' than the source)." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "relatedto", "equivalent", "equal", "wider", "subsumes", "narrower", "specializes", "inexact", "unmatched", "disjoint", ], }, ) equivalence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_equivalence", title="Extension field for ``equivalence``." ) product: typing.List[ fhirtypes.ConceptMapGroupElementTargetDependsOnType ] | None = Field( default=None, alias="product", title="Other concepts that this mapping also produces", description=( "A set of additional outcomes from this mapping to other elements. To " "properly execute this mapping, the specified element must be mapped to" " some data element or source that is in context. The mapping may still" " be useful without a place for the additional data elements, but the " "equivalence cannot be relied on." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConceptMapGroupElementTarget`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "display", "equivalence", "comment", "dependsOn", "product", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConceptMapGroupElementTarget`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("equivalence", "equivalence__ext")] return required_fields class ConceptMapGroupElementTargetDependsOn(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Other elements required for this mapping (from context). A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value. """ __resource_type__ = "ConceptMapGroupElementTargetDependsOn" display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Display for the code (if value is a code)", description=( "The display for the code. The display is only provided to help editors" " when editing the concept map." ), json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) property: fhirtypes.UriType | None = Field( default=None, alias="property", title="Reference to property mapping depends on", description=( "A reference to an element that holds a coded value that corresponds to" " a code system property. The idea is that the information model " "carries an element somewhere that is labeled to correspond with a code" " system property." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) property__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_property", title="Extension field for ``property``." ) system: fhirtypes.CanonicalType | None = Field( default=None, alias="system", title="Code System (if necessary)", description=( "An absolute URI that identifies the code system of the dependency code" " (if the source/dependency is a value set that crosses code systems)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CodeSystem"], }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="Value of the referenced element", description=( "Identity (code or path) or the element/item/ValueSet/text that the map" " depends on / refers to." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConceptMapGroupElementTargetDependsOn`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "property", "system", "value", "display", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConceptMapGroupElementTargetDependsOn`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("property", "property__ext"), ("value", "value__ext")] return required_fields class ConceptMapGroupUnmapped(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What to do when there is no mapping for the source concept. What to do when there is no mapping for the source concept. "Unmapped" does not include codes that are unmatched, and the unmapped element is ignored in a code is specified to have equivalence = unmatched. """ __resource_type__ = "ConceptMapGroupUnmapped" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Fixed code when mode = fixed", description=( "The fixed code to use when the mode = 'fixed' - all unmapped codes " "are mapped to a single fixed code." ), json_schema_extra={ "element_property": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Display for the code", description=( "The display for the code. The display is only provided to help editors" " when editing the concept map." ), json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="provided | fixed | other-map", description=( "Defines which action to take if there is no match for the source " "concept in the target system designated for the group. One of 3 " "actions are possible: use the unmapped code (this is useful when doing" " a mapping between versions, and only a few codes have changed), use a" " fixed code (a default code), or alternatively, a reference to a " "different concept map can be provided (by canonical URL)." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["provided", "fixed", "other-map"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) url: fhirtypes.CanonicalType | None = Field( default=None, alias="url", title=( "canonical reference to an additional ConceptMap to use for mapping if " "the source concept is unmapped" ), description=( "The canonical reference to an additional ConceptMap resource instance " "to use for mapping if this ConceptMap resource contains no matching " "mapping for the source concept." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ConceptMap"], }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConceptMapGroupUnmapped`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "mode", "code", "display", "url", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConceptMapGroupUnmapped`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("mode", "mode__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/condition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Condition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Condition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Detailed information about conditions, problems or diagnoses. A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern. """ __resource_type__ = "Condition" abatementAge: fhirtypes.AgeType | None = Field( default=None, alias="abatementAge", title="When in resolution/remission", description=( "The date or estimated date that the condition resolved or went into " 'remission. This is called "abatement" because of the many overloaded ' 'connotations associated with "remission" or "resolution" - Conditions ' "are never really resolved, but they can abate." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e abatement[x] "one_of_many": "abatement", "one_of_many_required": False, }, ) abatementDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="abatementDateTime", title="When in resolution/remission", description=( "The date or estimated date that the condition resolved or went into " 'remission. This is called "abatement" because of the many overloaded ' 'connotations associated with "remission" or "resolution" - Conditions ' "are never really resolved, but they can abate." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e abatement[x] "one_of_many": "abatement", "one_of_many_required": False, }, ) abatementDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_abatementDateTime", title="Extension field for ``abatementDateTime``.", ) abatementPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="abatementPeriod", title="When in resolution/remission", description=( "The date or estimated date that the condition resolved or went into " 'remission. This is called "abatement" because of the many overloaded ' 'connotations associated with "remission" or "resolution" - Conditions ' "are never really resolved, but they can abate." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e abatement[x] "one_of_many": "abatement", "one_of_many_required": False, }, ) abatementRange: fhirtypes.RangeType | None = Field( default=None, alias="abatementRange", title="When in resolution/remission", description=( "The date or estimated date that the condition resolved or went into " 'remission. This is called "abatement" because of the many overloaded ' 'connotations associated with "remission" or "resolution" - Conditions ' "are never really resolved, but they can abate." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e abatement[x] "one_of_many": "abatement", "one_of_many_required": False, }, ) abatementString: fhirtypes.StringType | None = Field( default=None, alias="abatementString", title="When in resolution/remission", description=( "The date or estimated date that the condition resolved or went into " 'remission. This is called "abatement" because of the many overloaded ' 'connotations associated with "remission" or "resolution" - Conditions ' "are never really resolved, but they can abate." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e abatement[x] "one_of_many": "abatement", "one_of_many_required": False, }, ) abatementString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_abatementString", title="Extension field for ``abatementString``.", ) asserter: fhirtypes.ReferenceType | None = Field( default=None, alias="asserter", title="Person who asserts this condition", description="Individual who is making the condition statement.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Patient", "RelatedPerson", ], }, ) bodySite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="bodySite", title="Anatomical location, if relevant", description="The anatomical location where this condition manifests itself.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="problem-list-item | encounter-diagnosis", description="A category assigned to the condition.", json_schema_extra={ "element_property": True, }, ) clinicalStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="clinicalStatus", title="active | recurrence | relapse | inactive | remission | resolved", description="The clinical status of the condition.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Identification of the condition, problem or diagnosis", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter created as part of", description=( "The Encounter during which this Condition was created or to which the " "creation of this record is tightly associated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) evidence: typing.List[fhirtypes.ConditionEvidenceType] | None = Field( default=None, alias="evidence", title="Supporting evidence", description=( "Supporting evidence / manifestations that are the basis of the " "Condition's verification status, such as evidence that confirmed or " "refuted the condition." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Ids for this condition", description=( "Business identifiers assigned to this condition by the performer or " "other systems which remain constant as the resource is updated and " "propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Additional information about the Condition", description=( "Additional information about the Condition. This is a general " "notes/comments entry for description of the Condition, its diagnosis " "and prognosis." ), json_schema_extra={ "element_property": True, }, ) onsetAge: fhirtypes.AgeType | None = Field( default=None, alias="onsetAge", title="Estimated or actual date, date-time, or age", description=( "Estimated or actual date or date-time the condition began, in the " "opinion of the clinician." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="onsetDateTime", title="Estimated or actual date, date-time, or age", description=( "Estimated or actual date or date-time the condition began, in the " "opinion of the clinician." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onsetDateTime", title="Extension field for ``onsetDateTime``.", ) onsetPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="onsetPeriod", title="Estimated or actual date, date-time, or age", description=( "Estimated or actual date or date-time the condition began, in the " "opinion of the clinician." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetRange: fhirtypes.RangeType | None = Field( default=None, alias="onsetRange", title="Estimated or actual date, date-time, or age", description=( "Estimated or actual date or date-time the condition began, in the " "opinion of the clinician." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetString: fhirtypes.StringType | None = Field( default=None, alias="onsetString", title="Estimated or actual date, date-time, or age", description=( "Estimated or actual date or date-time the condition began, in the " "opinion of the clinician." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onsetString", title="Extension field for ``onsetString``." ) recordedDate: fhirtypes.DateTimeType | None = Field( default=None, alias="recordedDate", title="Date record was first recorded", description=( "The recordedDate represents when this particular Condition record was " "created in the system, which is often a system-generated date." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) recordedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recordedDate", title="Extension field for ``recordedDate``.", ) recorder: fhirtypes.ReferenceType | None = Field( default=None, alias="recorder", title="Who recorded the condition", description=( "Individual who recorded the record and takes responsibility for its " "content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Patient", "RelatedPerson", ], }, ) severity: fhirtypes.CodeableConceptType | None = Field( default=None, alias="severity", title="Subjective severity of condition", description=( "A subjective assessment of the severity of the condition as evaluated " "by the clinician." ), json_schema_extra={ "element_property": True, }, ) stage: typing.List[fhirtypes.ConditionStageType] | None = Field( default=None, alias="stage", title="Stage/grade, usually assessed formally", description=( "Clinical stage or grade of a condition. May include formal severity " "assessments." ), json_schema_extra={ "element_property": True, }, ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who has the condition?", description=( "Indicates the patient or group who the condition record is associated " "with." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) verificationStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="verificationStatus", title=( "unconfirmed | provisional | differential | confirmed | refuted | " "entered-in-error" ), description=( "The verification status to support the clinical status of the " "condition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Condition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "clinicalStatus", "verificationStatus", "category", "severity", "code", "bodySite", "subject", "encounter", "onsetDateTime", "onsetAge", "onsetPeriod", "onsetRange", "onsetString", "abatementDateTime", "abatementAge", "abatementPeriod", "abatementRange", "abatementString", "recordedDate", "recorder", "asserter", "stage", "evidence", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Condition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "clinicalStatus", "verificationStatus", "code", "bodySite", "subject", "encounter", "onsetDateTime", "onsetAge", "onsetPeriod", "onsetRange", "onsetString", "recordedDate", "recorder", "asserter", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "abatement": [ "abatementAge", "abatementDateTime", "abatementPeriod", "abatementRange", "abatementString", ], "onset": [ "onsetAge", "onsetDateTime", "onsetPeriod", "onsetRange", "onsetString", ], } return one_of_many_fields class ConditionEvidence(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Supporting evidence. Supporting evidence / manifestations that are the basis of the Condition's verification status, such as evidence that confirmed or refuted the condition. """ __resource_type__ = "ConditionEvidence" code: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="code", title="Manifestation/symptom", description=( "A manifestation or symptom that led to the recording of this " "condition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) detail: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="detail", title="Supporting information found elsewhere", description="Links to other relevant information, including pathology reports.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConditionEvidence`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "detail"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConditionEvidence`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "detail"] class ConditionStage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Stage/grade, usually assessed formally. Clinical stage or grade of a condition. May include formal severity assessments. """ __resource_type__ = "ConditionStage" assessment: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="assessment", title="Formal record of assessment", description=( "Reference to a formal record of the evidence on which the staging " "assessment is based." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "ClinicalImpression", "DiagnosticReport", "Observation", ], }, ) summary: fhirtypes.CodeableConceptType | None = Field( default=None, alias="summary", title="Simple summary (disease specific)", description=( 'A simple summary of the stage such as "Stage 3". The determination of ' "the stage is disease-specific." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Kind of staging", description="The kind of staging, such as pathological or clinical staging.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConditionStage`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "summary", "assessment", "type"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConditionStage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/consent.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Consent Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Consent(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A healthcare consumer's choices to permit or deny recipients or roles to perform actions for specific purposes and periods of time. A record of a healthcare consumer’s choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time. """ __resource_type__ = "Consent" category: typing.List[fhirtypes.CodeableConceptType] = Field( default=..., alias="category", title="Classification of the consent statement - for indexing/retrieval", description=( "A classification of the type of consents found in the statement. This " "element supports indexing and retrieval of consent statements." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="dateTime", title="When this Consent was created or indexed", description="When this Consent was issued / created / indexed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dateTime", title="Extension field for ``dateTime``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifier for this record (external references)", description="Unique identifier for this copy of the Consent Statement.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) organization: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="organization", title="Custodian of the consent", description=( "The organization that manages the consent, and the framework within " "which it is executed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) patient: fhirtypes.ReferenceType | None = Field( default=None, alias="patient", title="Who the consent applies to", description="The patient/healthcare consumer to whom this consent applies.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) performer: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="performer", title="Who is agreeing to the policy and rules", description=( "Either the Grantor, which is the entity responsible for granting the " "rights listed in a Consent Directive or the Grantee, which is the " "entity responsible for complying with the Consent Directive, including" " any obligations or limitations on authorizations and enforcement of " "prohibitions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Organization", "Patient", "Practitioner", "RelatedPerson", "PractitionerRole", ], }, ) policy: typing.List[fhirtypes.ConsentPolicyType] | None = Field( default=None, alias="policy", title="Policies covered by this consent", description=( "The references to the policies that are included in this consent " "scope. Policies may be organizational, but are often defined " "jurisdictionally, or in law." ), json_schema_extra={ "element_property": True, }, ) policyRule: fhirtypes.CodeableConceptType | None = Field( default=None, alias="policyRule", title="Regulation that this consents to", description="A reference to the specific base computable regulation or policy.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) provision: fhirtypes.ConsentProvisionType | None = Field( default=None, alias="provision", title="Constraints to the base Consent.policyRule", description=( "An exception to the base policy of this consent. An exception can be " "an addition or removal of access permissions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) scope: fhirtypes.CodeableConceptType = Field( default=..., alias="scope", title="Which of the four areas this resource covers (extensible)", description=( "A selector of the type of consent being presented: ADR, Privacy, " "Treatment, Research. This list is now extensible." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sourceAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="sourceAttachment", title="Source from which this consent is taken", description=( "The source on which this consent statement is based. The source might " "be a scanned original paper form, or a reference to a consent that " "links back to such a source, a reference to a document repository " "(e.g. XDS) that stores the original consent document." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e source[x] "one_of_many": "source", "one_of_many_required": False, }, ) sourceReference: fhirtypes.ReferenceType | None = Field( default=None, alias="sourceReference", title="Source from which this consent is taken", description=( "The source on which this consent statement is based. The source might " "be a scanned original paper form, or a reference to a consent that " "links back to such a source, a reference to a document repository " "(e.g. XDS) that stores the original consent document." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e source[x] "one_of_many": "source", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Consent", "DocumentReference", "Contract", "QuestionnaireResponse", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | proposed | active | rejected | inactive | entered-in-error", description="Indicates the current state of this consent.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "draft", "proposed", "active", "rejected", "inactive", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) verification: typing.List[fhirtypes.ConsentVerificationType] | None = Field( default=None, alias="verification", title="Consent Verified by patient or family", description=( "Whether a treatment instruction (e.g. artificial respiration yes or " "no) was verified with the patient, his/her family or another " "authorized person." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Consent`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "scope", "category", "patient", "dateTime", "performer", "organization", "sourceAttachment", "sourceReference", "policy", "policyRule", "verification", "provision", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Consent`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "scope", "category", "patient", "dateTime", "performer", "organization", "sourceAttachment", "sourceReference", "policyRule", "verification", "provision", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"source": ["sourceAttachment", "sourceReference"]} return one_of_many_fields class ConsentPolicy(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Policies covered by this consent. The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law. """ __resource_type__ = "ConsentPolicy" authority: fhirtypes.UriType | None = Field( default=None, alias="authority", title="Enforcement source for policy", description=( "Entity or Organization having regulatory jurisdiction or " "accountability for enforcing policies pertaining to Consent " "Directives." ), json_schema_extra={ "element_property": True, }, ) authority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authority", title="Extension field for ``authority``." ) uri: fhirtypes.UriType | None = Field( default=None, alias="uri", title="Specific policy covered by this consent", description=( "The references to the policies that are included in this consent " "scope. Policies may be organizational, but are often defined " "jurisdictionally, or in law." ), json_schema_extra={ "element_property": True, }, ) uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uri", title="Extension field for ``uri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConsentPolicy`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "authority", "uri"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConsentPolicy`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ConsentProvision(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Constraints to the base Consent.policyRule. An exception to the base policy of this consent. An exception can be an addition or removal of access permissions. """ __resource_type__ = "ConsentProvision" action: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="action", title="Actions controlled by this rule", description="Actions controlled by this Rule.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) actor: typing.List[fhirtypes.ConsentProvisionActorType] | None = Field( default=None, alias="actor", title="Who|what controlled by this rule (or group, by role)", description=( "Who or what is controlled by this rule. Use group to identify a set of" " actors by some property they share (e.g. 'admitting officers')." ), json_schema_extra={ "element_property": True, }, ) class_fhir: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="class", title="e.g. Resource Type, Profile, CDA, etc.", description=( "The class of information covered by this rule. The type can be a FHIR " "resource type, a profile on a type, or a CDA document, or some other " "type that indicates what sort of information the consent relates to." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="code", title="e.g. LOINC or SNOMED CT code, etc. in the content", description="If this code is found in an instance, then the rule applies.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) data: typing.List[fhirtypes.ConsentProvisionDataType] | None = Field( default=None, alias="data", title="Data controlled by this rule", description=( "The resources controlled by this rule if specific resources are " "referenced." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dataPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="dataPeriod", title="Timeframe for data controlled by this rule", description=( "Clinical or Operational Relevant period of time that bounds the data " "controlled by this rule." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Timeframe for this rule", description="The timeframe in this rule is valid.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) provision: typing.List[fhirtypes.ConsentProvisionType] | None = Field( default=None, alias="provision", title="Nested Exception Rules", description="Rules which provide exceptions to the base rule or subrules.", json_schema_extra={ "element_property": True, }, ) purpose: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="purpose", title="Context of activities covered by this rule", description=( "The context of the activities a user is taking - why the user is " "accessing the data - that are controlled by this rule." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) securityLabel: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="securityLabel", title="Security Labels that define affected resources", description=( "A security label, comprised of 0..* security label fields (Privacy " "tags), which define which resources are controlled by this exception." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="deny | permit", description=( "Action to take - permit or deny - when the rule conditions are met. " "Not permitted in root rule, required in all nested rules." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["deny", "permit"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConsentProvision`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "period", "actor", "action", "securityLabel", "purpose", "class", "code", "dataPeriod", "data", "provision", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConsentProvision`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "period", "action", "securityLabel", "purpose", "class", "code", "dataPeriod", "data", ] class ConsentProvisionActor(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who|what controlled by this rule (or group, by role). Who or what is controlled by this rule. Use group to identify a set of actors by some property they share (e.g. 'admitting officers'). """ __resource_type__ = "ConsentProvisionActor" reference: fhirtypes.ReferenceType = Field( default=..., alias="reference", title="Resource for the actor (or group, by role)", description=( "The resource that identifies the actor. To identify actors by type, " "use group to identify a set of actors by some property they share " "(e.g. 'admitting officers')." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Group", "CareTeam", "Organization", "Patient", "Practitioner", "RelatedPerson", "PractitionerRole", ], }, ) role: fhirtypes.CodeableConceptType = Field( default=..., alias="role", title="How the actor is involved", description=( "How the individual is involved in the resources content that is " "described in the exception." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConsentProvisionActor`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "role", "reference"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConsentProvisionActor`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ConsentProvisionData(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Data controlled by this rule. The resources controlled by this rule if specific resources are referenced. """ __resource_type__ = "ConsentProvisionData" meaning: fhirtypes.CodeType | None = Field( default=None, alias="meaning", title="instance | related | dependents | authoredby", description=( "How the resource reference is interpreted when testing consent " "restrictions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["instance", "related", "dependents", "authoredby"], }, ) meaning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_meaning", title="Extension field for ``meaning``." ) reference: fhirtypes.ReferenceType = Field( default=..., alias="reference", title="The actual data reference", description=( "A reference to a specific resource that defines which resources are " "covered by this consent." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConsentProvisionData`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "meaning", "reference"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConsentProvisionData`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "meaning", "reference"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("meaning", "meaning__ext")] return required_fields class ConsentVerification(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Consent Verified by patient or family. Whether a treatment instruction (e.g. artificial respiration yes or no) was verified with the patient, his/her family or another authorized person. """ __resource_type__ = "ConsentVerification" verificationDate: fhirtypes.DateTimeType | None = Field( default=None, alias="verificationDate", title="When consent verified", description="Date verification was collected.", json_schema_extra={ "element_property": True, }, ) verificationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_verificationDate", title="Extension field for ``verificationDate``.", ) verified: bool | None = Field( default=None, alias="verified", title="Has been verified", description="Has the instruction been verified.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) verified__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_verified", title="Extension field for ``verified``." ) verifiedWith: fhirtypes.ReferenceType | None = Field( default=None, alias="verifiedWith", title="Person who verified", description=( "Who verified the instruction (Patient, Relative or other Authorized " "Person)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "RelatedPerson"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConsentVerification`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "verified", "verifiedWith", "verificationDate", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConsentVerification`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "verified"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("verified", "verified__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/contactdetail.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ContactDetail Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class ContactDetail(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contact information. Specifies contact information for a person or organization. """ __resource_type__ = "ContactDetail" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name of an individual to contact", description="The name of an individual to contact.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="Contact details for individual or organization", description=( "The contact details for the individual (if a name was provided) or the" " organization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContactDetail`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "name", "telecom"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContactDetail`` according to specification, with preserving the original sequence order. """ return ["name", "telecom"] ================================================ FILE: fhir/resources/R4B/contactpoint.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ContactPoint Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class ContactPoint(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details of a Technology mediated contact point (phone, fax, email, etc.). Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc. """ __resource_type__ = "ContactPoint" period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period when the contact point was/is in use", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) rank: fhirtypes.PositiveIntType | None = Field( default=None, alias="rank", title="Specify preferred order of use (1 = highest)", description=( "Specifies a preferred order in which to use a set of contacts. " "ContactPoints with lower rank values are more preferred than those " "with higher rank values." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) rank__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rank", title="Extension field for ``rank``." ) system: fhirtypes.CodeType | None = Field( default=None, alias="system", title="phone | fax | email | pager | url | sms | other", description=( "Telecommunications form for contact point - what communications system" " is required to make use of the contact." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["phone", "fax", "email", "pager", "url", "sms", "other"], }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="home | work | temp | old | mobile - purpose of this contact point", description="Identifies the purpose for the contact point.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["home", "work", "temp", "old", "mobile"], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The actual contact point details", description=( "The actual contact point details, in a form that is meaningful to the " "designated communication system (i.e. phone number or email address)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContactPoint`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "system", "value", "use", "rank", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContactPoint`` according to specification, with preserving the original sequence order. """ return ["system", "value", "use", "rank", "period"] ================================================ FILE: fhir/resources/R4B/contract.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Contract Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Contract(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Legal Agreement. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. """ __resource_type__ = "Contract" alias: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="alias", title="Acronym or short name", description=( "Alternative representation of the title for this Contract definition, " "derivative, or instance in any legal state., e.g., a domain specific " "contract number related to legislation." ), json_schema_extra={ "element_property": True, }, ) alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_alias", title="Extension field for ``alias``." ) applies: fhirtypes.PeriodType | None = Field( default=None, alias="applies", title="Effective time", description="Relevant time or time-period when this Contract is applicable.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="Source of Contract", description=( "The individual or organization that authored the Contract definition, " "derivative, or instance in any legal state." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "Organization", ], }, ) authority: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="authority", title="Authority under which this Contract has standing", description=( "A formally or informally recognized grouping of people, principals, " "organizations, or jurisdictions formed for the purpose of achieving " "some form of collective action such as the promulgation, " "administration and enforcement of contracts and policies." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) contentDefinition: fhirtypes.ContractContentDefinitionType | None = Field( default=None, alias="contentDefinition", title="Contract precursor content", description=( "Precusory content developed with a focus and intent of supporting the " "formation a Contract instance, which may be associated with and " "transformable into a Contract." ), json_schema_extra={ "element_property": True, }, ) contentDerivative: fhirtypes.CodeableConceptType | None = Field( default=None, alias="contentDerivative", title="Content derived from the basal information", description=( "The minimal content derived from the basal information source at a " "specific stage in its lifecycle." ), json_schema_extra={ "element_property": True, }, ) domain: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="domain", title=( "A sphere of control governed by an authoritative jurisdiction, " "organization, or person" ), description=( "Recognized governance framework or system operating with a " "circumscribed scope in accordance with specified principles, policies," " processes or procedures for managing rights, actions, or behaviors of" " parties or principals relative to resources." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) expirationType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="expirationType", title="Contract cessation cause", description=( "Event resulting in discontinuation or termination of this Contract " "instance by one or more parties to the contract." ), json_schema_extra={ "element_property": True, }, ) friendly: typing.List[fhirtypes.ContractFriendlyType] | None = Field( default=None, alias="friendly", title="Contract Friendly Language", description=( 'The "patient friendly language" versionof the Contract in whole or in ' 'parts. "Patient friendly language" means the representation of the ' "Contract and Contract Provisions in a manner that is readily " "accessible and understandable by a layperson in accordance with best " "practices for communication styles that ensure that those agreeing to " "or signing the Contract understand the roles, actions, obligations, " "responsibilities, and implication of the agreement." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Contract number", description=( "Unique identifier for this Contract or a derivative that references a " "Source Contract." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesCanonical: fhirtypes.ReferenceType | None = Field( default=None, alias="instantiatesCanonical", title="Source Contract Definition", description=( "The URL pointing to a FHIR-defined Contract Definition that is adhered" " to in whole or part by this Contract." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Contract"], }, ) instantiatesUri: fhirtypes.UriType | None = Field( default=None, alias="instantiatesUri", title="External Contract Definition", description=( "The URL pointing to an externally maintained definition that is " "adhered to in whole or in part by this Contract." ), json_schema_extra={ "element_property": True, }, ) instantiatesUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) issued: fhirtypes.DateTimeType | None = Field( default=None, alias="issued", title="When this Contract was issued", description="When this Contract was issued.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issued", title="Extension field for ``issued``." ) legal: typing.List[fhirtypes.ContractLegalType] | None = Field( default=None, alias="legal", title="Contract Legal Language", description="List of Legal expressions or representations of this Contract.", json_schema_extra={ "element_property": True, }, ) legalState: fhirtypes.CodeableConceptType | None = Field( default=None, alias="legalState", title="Negotiation status", description=( "Legal states of the formation of a legal instrument, which is a " "formally executed written document that can be formally attributed to " "its author, records and formally expresses a legally enforceable act, " "process, or contractual duty, obligation, or right, and therefore " "evidences that act, process, or agreement." ), json_schema_extra={ "element_property": True, }, ) legallyBindingAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="legallyBindingAttachment", title="Binding Contract", description=( "Legally binding Contract: This is the signed and legally recognized " 'representation of the Contract, which is considered the "source of ' 'truth" and which would be the basis for legal action related to ' "enforcement of this Contract." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e legallyBinding[x] "one_of_many": "legallyBinding", "one_of_many_required": False, }, ) legallyBindingReference: fhirtypes.ReferenceType | None = Field( default=None, alias="legallyBindingReference", title="Binding Contract", description=( "Legally binding Contract: This is the signed and legally recognized " 'representation of the Contract, which is considered the "source of ' 'truth" and which would be the basis for legal action related to ' "enforcement of this Contract." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e legallyBinding[x] "one_of_many": "legallyBinding", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Composition", "DocumentReference", "QuestionnaireResponse", "Contract", ], }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Computer friendly designation", description=( "A natural language name identifying this Contract definition, " "derivative, or instance in any legal state. Provides additional " "information about its content. This name should be usable as an " "identifier for the module by machine processing applications such as " "code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="relevantHistory", title="Key event in Contract History", description=( "Links to Provenance records for past versions of this Contract " "definition, derivative, or instance, which identify key state " "transitions or updates that are likely to be relevant to a user " "looking at the current version of the Contract. The Provence.entity " "indicates the target that was changed in the update. " "http://build.fhir.org/provenance-definitions.html#Provenance.entity." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Provenance"], }, ) rule: typing.List[fhirtypes.ContractRuleType] | None = Field( default=None, alias="rule", title="Computable Contract Language", description=( "List of Computable Policy Rule Language Representations of this " "Contract." ), json_schema_extra={ "element_property": True, }, ) scope: fhirtypes.CodeableConceptType | None = Field( default=None, alias="scope", title="Range of Legal Concerns", description=( "A selector of legal concerns for this Contract definition, derivative," " or instance in any legal state." ), json_schema_extra={ "element_property": True, }, ) signer: typing.List[fhirtypes.ContractSignerType] | None = Field( default=None, alias="signer", title="Contract Signatory", description=( "Parties with legal standing in the Contract, including the principal " "parties, the grantor(s) and grantee(s), which are any person or " "organization bound by the contract, and any ancillary parties, which " "facilitate the execution of the contract such as a notary or witness." ), json_schema_extra={ "element_property": True, }, ) site: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="site", title="Specific Location", description="Sites in which the contract is complied with, exercised, or in force.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "amended | appended | cancelled | disputed | entered-in-error | " "executable | executed | negotiable | offered | policy | rejected | " "renewed | revoked | resolved | terminated" ), description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "amended", "appended", "cancelled", "disputed", "entered-in-error", "executable", "executed", "negotiable", "offered", "policy", "rejected", "renewed", "revoked", "resolved", "terminated", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="subType", title="Subtype within the context of type", description=( "Sub-category for the Contract that distinguishes the kinds of systems " "that would be interested in the Contract within the context of the " "Contract's scope." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subject: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="subject", title="Contract Target Entity", description=( "The target entity impacted by or of interest to parties to the " "agreement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) subtitle: fhirtypes.StringType | None = Field( default=None, alias="subtitle", title="Subordinate Friendly name", description=( "An explanatory or alternate user-friendly title for this Contract " "definition, derivative, or instance in any legal state.t giving " "additional information about its content." ), json_schema_extra={ "element_property": True, }, ) subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subtitle", title="Extension field for ``subtitle``." ) supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInfo", title="Extra Information", description=( "Information that may be needed by/relevant to the performer in their " "execution of this term action." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) term: typing.List[fhirtypes.ContractTermType] | None = Field( default=None, alias="term", title="Contract Term List", description=( "One or more Contract Provisions, which may be related and conveyed as " "a group, and may contain nested groups." ), json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Human Friendly name", description=( "A short, descriptive, user-friendly title for this Contract " "definition, derivative, or instance in any legal state.t giving " "additional information about its content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) topicCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="topicCodeableConcept", title="Focus of contract interest", description=( "Narrows the range of legal concerns to focus on the achievement of " "specific contractual objectives." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e topic[x] "one_of_many": "topic", "one_of_many_required": False, }, ) topicReference: fhirtypes.ReferenceType | None = Field( default=None, alias="topicReference", title="Focus of contract interest", description=( "Narrows the range of legal concerns to focus on the achievement of " "specific contractual objectives." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e topic[x] "one_of_many": "topic", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Legal instrument category", description=( "A high-level category for the legal instrument, whether constructed as" " a Contract definition, derivative, or instance in any legal state. " "Provides additional information about its content within the context " "of the Contract's scope to distinguish the kinds of systems that would" " be interested in the contract." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Basal definition", description=( "Canonical identifier for this contract, represented as a URI (globally" " unique)." ), json_schema_extra={ "element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business edition", description=( "An edition identifier used for business purposes to label business " "significant variants." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Contract`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "url", "version", "status", "legalState", "instantiatesCanonical", "instantiatesUri", "contentDerivative", "issued", "applies", "expirationType", "subject", "authority", "domain", "site", "name", "title", "subtitle", "alias", "author", "scope", "topicCodeableConcept", "topicReference", "type", "subType", "contentDefinition", "term", "supportingInfo", "relevantHistory", "signer", "friendly", "legal", "rule", "legallyBindingAttachment", "legallyBindingReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Contract`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "version", "status", "issued", "applies", "subject", "name", "title", "type", "subType", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "legallyBinding": ["legallyBindingAttachment", "legallyBindingReference"], "topic": ["topicCodeableConcept", "topicReference"], } return one_of_many_fields class ContractContentDefinition(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contract precursor content. Precusory content developed with a focus and intent of supporting the formation a Contract instance, which may be associated with and transformable into a Contract. """ __resource_type__ = "ContractContentDefinition" copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Publication Ownership", description=( "A copyright statement relating to Contract precursor content. " "Copyright statements are generally legal restrictions on the use and " "publishing of the Contract precursor content." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) publicationDate: fhirtypes.DateTimeType | None = Field( default=None, alias="publicationDate", title="When published", description=( "The date (and optionally time) when the contract was published. The " "date must change when the business version changes and it must change " "if the status code changes. In addition, it should change when the " "substantive content of the contract changes." ), json_schema_extra={ "element_property": True, }, ) publicationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publicationDate", title="Extension field for ``publicationDate``.", ) publicationStatus: fhirtypes.CodeType | None = Field( default=None, alias="publicationStatus", title=( "amended | appended | cancelled | disputed | entered-in-error | " "executable | executed | negotiable | offered | policy | rejected | " "renewed | revoked | resolved | terminated" ), description=None, json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "amended", "appended", "cancelled", "disputed", "entered-in-error", "executable", "executed", "negotiable", "offered", "policy", "rejected", "renewed", "revoked", "resolved", "terminated", ], }, ) publicationStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publicationStatus", title="Extension field for ``publicationStatus``.", ) publisher: fhirtypes.ReferenceType | None = Field( default=None, alias="publisher", title="Publisher Entity", description=( "The individual or organization that published the Contract precursor " "content." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) subType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subType", title="Detailed Content Type Definition", description="Detailed Precusory content type.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Content structure and use", description=( "Precusory content structure and use, i.e., a boilerplate, template, " "application for a contract such as an insurance policy or benefits " "under a program, e.g., workers compensation." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractContentDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "subType", "publisher", "publicationDate", "publicationStatus", "copyright", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractContentDefinition`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("publicationStatus", "publicationStatus__ext")] return required_fields class ContractFriendly(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contract Friendly Language. The "patient friendly language" versionof the Contract in whole or in parts. "Patient friendly language" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement. """ __resource_type__ = "ContractFriendly" contentAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="contentAttachment", title="Easily comprehended representation of this Contract", description=( "Human readable rendering of this Contract in a format and " "representation intended to enhance comprehension and ensure " "understandability." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, }, ) contentReference: fhirtypes.ReferenceType | None = Field( default=None, alias="contentReference", title="Easily comprehended representation of this Contract", description=( "Human readable rendering of this Contract in a format and " "representation intended to enhance comprehension and ensure " "understandability." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Composition", "DocumentReference", "QuestionnaireResponse", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractFriendly`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "contentAttachment", "contentReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractFriendly`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"content": ["contentAttachment", "contentReference"]} return one_of_many_fields class ContractLegal(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contract Legal Language. List of Legal expressions or representations of this Contract. """ __resource_type__ = "ContractLegal" contentAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="contentAttachment", title="Contract Legal Text", description="Contract legal text in human renderable form.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, }, ) contentReference: fhirtypes.ReferenceType | None = Field( default=None, alias="contentReference", title="Contract Legal Text", description="Contract legal text in human renderable form.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Composition", "DocumentReference", "QuestionnaireResponse", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractLegal`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "contentAttachment", "contentReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractLegal`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"content": ["contentAttachment", "contentReference"]} return one_of_many_fields class ContractRule(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Computable Contract Language. List of Computable Policy Rule Language Representations of this Contract. """ __resource_type__ = "ContractRule" contentAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="contentAttachment", title="Computable Contract Rules", description=( "Computable Contract conveyed using a policy rule language (e.g. XACML," " DKAL, SecPal)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, }, ) contentReference: fhirtypes.ReferenceType | None = Field( default=None, alias="contentReference", title="Computable Contract Rules", description=( "Computable Contract conveyed using a policy rule language (e.g. XACML," " DKAL, SecPal)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractRule`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "contentAttachment", "contentReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractRule`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"content": ["contentAttachment", "contentReference"]} return one_of_many_fields class ContractSigner(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contract Signatory. Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness. """ __resource_type__ = "ContractSigner" party: fhirtypes.ReferenceType = Field( default=..., alias="party", title="Contract Signatory Party", description="Party which is a signator to this Contract.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", ], }, ) signature: typing.List[fhirtypes.SignatureType] = Field( default=..., alias="signature", title="Contract Documentation Signature", description="Legally binding Contract DSIG signature contents in Base64.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodingType = Field( default=..., alias="type", title="Contract Signatory Role", description="Role of this Contract signer, e.g. notary, grantee.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractSigner`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "party", "signature"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractSigner`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ContractTerm(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contract Term List. One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups. """ __resource_type__ = "ContractTerm" action: typing.List[fhirtypes.ContractTermActionType] | None = Field( default=None, alias="action", title="Entity being ascribed responsibility", description=( "An actor taking a role in an activity for which it can be assigned " "some degree of responsibility for the activity taking place." ), json_schema_extra={ "element_property": True, }, ) applies: fhirtypes.PeriodType | None = Field( default=None, alias="applies", title="Contract Term Effective Time", description=( "Relevant time or time-period when this Contract Provision is " "applicable." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) asset: typing.List[fhirtypes.ContractTermAssetType] | None = Field( default=None, alias="asset", title="Contract Term Asset List", description=None, json_schema_extra={ "element_property": True, }, ) group: typing.List[fhirtypes.ContractTermType] | None = Field( default=None, alias="group", title="Nested Contract Term Group", description="Nested group of Contract Provisions.", json_schema_extra={ "element_property": True, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Contract Term Number", description="Unique identifier for this particular Contract Provision.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued: fhirtypes.DateTimeType | None = Field( default=None, alias="issued", title="Contract Term Issue Date Time", description="When this Contract Provision was issued.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issued", title="Extension field for ``issued``." ) offer: fhirtypes.ContractTermOfferType = Field( default=..., alias="offer", title="Context of the Contract term", description=( "The matter of concern in the context of this provision of the " "agrement." ), json_schema_extra={ "element_property": True, }, ) securityLabel: typing.List[fhirtypes.ContractTermSecurityLabelType] | None = Field( default=None, alias="securityLabel", title="Protection for the Term", description=( "Security labels that protect the handling of information about the " "term and its elements, which may be specifically identified.." ), json_schema_extra={ "element_property": True, }, ) subType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subType", title="Contract Term Type specific classification", description=( "A specialized legal clause or condition based on overarching contract " "type." ), json_schema_extra={ "element_property": True, }, ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Term Statement", description="Statement of a provision in a policy or a contract.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) topicCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="topicCodeableConcept", title="Term Concern", description="The entity that the term applies to.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e topic[x] "one_of_many": "topic", "one_of_many_required": False, }, ) topicReference: fhirtypes.ReferenceType | None = Field( default=None, alias="topicReference", title="Term Concern", description="The entity that the term applies to.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e topic[x] "one_of_many": "topic", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Contract Term Type or Form", description=( "A legal clause or condition contained within a contract that requires " "one or both parties to perform a particular requirement by some " "specified time or prevents one or both parties from performing a " "particular requirement by some specified time." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractTerm`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "issued", "applies", "topicCodeableConcept", "topicReference", "type", "subType", "text", "securityLabel", "offer", "asset", "action", "group", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractTerm`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "identifier", "issued", "applies", "text"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"topic": ["topicCodeableConcept", "topicReference"]} return one_of_many_fields class ContractTermAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Entity being ascribed responsibility. An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place. """ __resource_type__ = "ContractTermAction" context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Episode associated with action", description=( "Encounter or Episode with primary association to specified term " "activity." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) contextLinkId: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="contextLinkId", title="Pointer to specific item", description=( "Id [identifier??] of the clause or question text related to the " "requester of this action in the referenced form or " "QuestionnaireResponse." ), json_schema_extra={ "element_property": True, }, ) contextLinkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_contextLinkId", title="Extension field for ``contextLinkId``.", ) doNotPerform: bool | None = Field( default=None, alias="doNotPerform", title="True if the term prohibits the action", description=None, json_schema_extra={ "element_property": True, }, ) doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doNotPerform", title="Extension field for ``doNotPerform``.", ) intent: fhirtypes.CodeableConceptType = Field( default=..., alias="intent", title="Purpose for the Contract Term Action", description=( "Reason or purpose for the action stipulated by this Contract " "Provision." ), json_schema_extra={ "element_property": True, }, ) linkId: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="linkId", title="Pointer to specific item", description=( "Id [identifier??] of the clause or question text related to this " "action in the referenced form or QuestionnaireResponse." ), json_schema_extra={ "element_property": True, }, ) linkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments about the action", description=( "Comments made about the term action made by the requester, performer, " "subject or other participants." ), json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When action happens", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="When action happens", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceTiming: fhirtypes.TimingType | None = Field( default=None, alias="occurrenceTiming", title="When action happens", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) performer: fhirtypes.ReferenceType | None = Field( default=None, alias="performer", title="Actor that wil execute (or not) the action", description=( "Indicates who or what is being asked to perform (or not perform) the " "ction." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "RelatedPerson", "Patient", "Practitioner", "PractitionerRole", "CareTeam", "Device", "Substance", "Organization", "Location", ], }, ) performerLinkId: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="performerLinkId", title="Pointer to specific item", description=( "Id [identifier??] of the clause or question text related to the reason" " type or reference of this action in the referenced form or " "QuestionnaireResponse." ), json_schema_extra={ "element_property": True, }, ) performerLinkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_performerLinkId", title="Extension field for ``performerLinkId``.", ) performerRole: fhirtypes.CodeableConceptType | None = Field( default=None, alias="performerRole", title="Competency of the performer", description=( "The type of role or competency of an individual desired or required to" " perform or not perform the action." ), json_schema_extra={ "element_property": True, }, ) performerType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="performerType", title="Kind of service performer", description=( "The type of individual that is desired or required to perform or not " "perform the action." ), json_schema_extra={ "element_property": True, }, ) reason: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="reason", title="Why action is to be performed", description=( "Describes why the action is to be performed or not performed in " "textual form." ), json_schema_extra={ "element_property": True, }, ) reason__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_reason", title="Extension field for ``reason``." ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Why is action (not) needed?", description=( "Rationale for the action to be performed or not performed. Describes " "why the action is permitted or prohibited." ), json_schema_extra={ "element_property": True, }, ) reasonLinkId: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="reasonLinkId", title="Pointer to specific item", description=( "Id [identifier??] of the clause or question text related to the reason" " type or reference of this action in the referenced form or " "QuestionnaireResponse." ), json_schema_extra={ "element_property": True, }, ) reasonLinkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_reasonLinkId", title="Extension field for ``reasonLinkId``.", ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Why is action (not) needed?", description=( "Indicates another resource whose existence justifies permitting or not" " permitting this action." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "DiagnosticReport", "DocumentReference", "Questionnaire", "QuestionnaireResponse", ], }, ) requester: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="requester", title="Who asked for action", description=( "Who or what initiated the action and has responsibility for its " "activation." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "RelatedPerson", "Practitioner", "PractitionerRole", "Device", "Group", "Organization", ], }, ) requesterLinkId: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="requesterLinkId", title="Pointer to specific item", description=( "Id [identifier??] of the clause or question text related to the " "requester of this action in the referenced form or " "QuestionnaireResponse." ), json_schema_extra={ "element_property": True, }, ) requesterLinkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_requesterLinkId", title="Extension field for ``requesterLinkId``.", ) securityLabelNumber: typing.List[fhirtypes.UnsignedIntType | None] | None = Field( default=None, alias="securityLabelNumber", title="Action restriction numbers", description="Security labels that protects the action.", json_schema_extra={ "element_property": True, }, ) securityLabelNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_securityLabelNumber", title="Extension field for ``securityLabelNumber``.", ) status: fhirtypes.CodeableConceptType = Field( default=..., alias="status", title="State of the action", description="Current state of the term action.", json_schema_extra={ "element_property": True, }, ) subject: typing.List[fhirtypes.ContractTermActionSubjectType] | None = Field( default=None, alias="subject", title="Entity of the action", description=None, json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Type or form of the action", description=( "Activity or service obligation to be done or not done, performed or " "not performed, effectuated or not by this Contract term." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractTermAction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "doNotPerform", "type", "subject", "intent", "linkId", "status", "context", "contextLinkId", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "requester", "requesterLinkId", "performerType", "performerRole", "performer", "performerLinkId", "reasonCode", "reasonReference", "reason", "reasonLinkId", "note", "securityLabelNumber", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractTermAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "occurrence": ["occurrenceDateTime", "occurrencePeriod", "occurrenceTiming"] } return one_of_many_fields class ContractTermActionSubject(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Entity of the action. """ __resource_type__ = "ContractTermActionSubject" reference: typing.List[fhirtypes.ReferenceType] = Field( default=..., alias="reference", title="Entity of the action", description="The entity the action is performed or not performed on or for.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "RelatedPerson", "Practitioner", "PractitionerRole", "Device", "Group", "Organization", ], }, ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="Role type of the agent", description="Role type of agent assigned roles in this Contract.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractTermActionSubject`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "reference", "role"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractTermActionSubject`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ContractTermAsset(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contract Term Asset List. """ __resource_type__ = "ContractTermAsset" answer: typing.List[fhirtypes.ContractTermOfferAnswerType] | None = Field( default=None, alias="answer", title="Response to assets", description=None, json_schema_extra={ "element_property": True, }, ) condition: fhirtypes.StringType | None = Field( default=None, alias="condition", title="Quality desctiption of asset", description=( "Description of the quality and completeness of the asset that imay be " "a factor in its valuation." ), json_schema_extra={ "element_property": True, }, ) condition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_condition", title="Extension field for ``condition``." ) context: typing.List[fhirtypes.ContractTermAssetContextType] | None = Field( default=None, alias="context", title="Circumstance of the asset", description=None, json_schema_extra={ "element_property": True, }, ) linkId: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="linkId", title="Pointer to asset text", description=( "Id [identifier??] of the clause or question text about the asset in " "the referenced form or QuestionnaireResponse." ), json_schema_extra={ "element_property": True, }, ) linkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) period: typing.List[fhirtypes.PeriodType] | None = Field( default=None, alias="period", title="Time period of the asset", description="Asset relevant contractual time period.", json_schema_extra={ "element_property": True, }, ) periodType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="periodType", title="Asset availability types", description="Type of Asset availability for use or ownership.", json_schema_extra={ "element_property": True, }, ) relationship: fhirtypes.CodingType | None = Field( default=None, alias="relationship", title="Kinship of the asset", description=( "Specifies the applicability of the term to an asset resource instance," " and instances it refers to orinstances that refer to it, and/or are " "owned by the offeree." ), json_schema_extra={ "element_property": True, }, ) scope: fhirtypes.CodeableConceptType | None = Field( default=None, alias="scope", title="Range of asset", description="Differentiates the kind of the asset .", json_schema_extra={ "element_property": True, }, ) securityLabelNumber: typing.List[fhirtypes.UnsignedIntType | None] | None = Field( default=None, alias="securityLabelNumber", title="Asset restriction numbers", description="Security labels that protects the asset.", json_schema_extra={ "element_property": True, }, ) securityLabelNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_securityLabelNumber", title="Extension field for ``securityLabelNumber``.", ) subtype: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="subtype", title="Asset sub-category", description="May be a subtype or part of an offered asset.", json_schema_extra={ "element_property": True, }, ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Asset clause or question text", description=( "Clause or question text (Prose Object) concerning the asset in a " "linked form, such as a QuestionnaireResponse used in the formation of " "the contract." ), json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Asset category", description="Target entity type about which the term may be concerned.", json_schema_extra={ "element_property": True, }, ) typeReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="typeReference", title="Associated entities", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) usePeriod: typing.List[fhirtypes.PeriodType] | None = Field( default=None, alias="usePeriod", title="Time period", description="Time period of asset use.", json_schema_extra={ "element_property": True, }, ) valuedItem: typing.List[fhirtypes.ContractTermAssetValuedItemType] | None = Field( default=None, alias="valuedItem", title="Contract Valued Item List", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractTermAsset`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "scope", "type", "typeReference", "subtype", "relationship", "context", "condition", "periodType", "period", "usePeriod", "text", "linkId", "answer", "securityLabelNumber", "valuedItem", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractTermAsset`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ContractTermAssetContext(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Circumstance of the asset. """ __resource_type__ = "ContractTermAssetContext" code: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="code", title="Codeable asset context", description=( "Coded representation of the context generally or of the Referenced " "entity, such as the asset holder type or location." ), json_schema_extra={ "element_property": True, }, ) reference: fhirtypes.ReferenceType | None = Field( default=None, alias="reference", title="Creator,custodian or owner", description=( "Asset context reference may include the creator, custodian, or owning " "Person or Organization (e.g., bank, repository), location held, e.g.," " building, jurisdiction." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Context description", description=None, json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractTermAssetContext`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "reference", "code", "text"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractTermAssetContext`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ContractTermAssetValuedItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contract Valued Item List. """ __resource_type__ = "ContractTermAssetValuedItem" effectiveTime: fhirtypes.DateTimeType | None = Field( default=None, alias="effectiveTime", title="Contract Valued Item Effective Tiem", description=( "Indicates the time during which this Contract ValuedItem information " "is effective." ), json_schema_extra={ "element_property": True, }, ) effectiveTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_effectiveTime", title="Extension field for ``effectiveTime``.", ) entityCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="entityCodeableConcept", title="Contract Valued Item Type", description="Specific type of Contract Valued Item that may be priced.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e entity[x] "one_of_many": "entity", "one_of_many_required": False, }, ) entityReference: fhirtypes.ReferenceType | None = Field( default=None, alias="entityReference", title="Contract Valued Item Type", description="Specific type of Contract Valued Item that may be priced.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e entity[x] "one_of_many": "entity", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Contract Valued Item Price Scaling Factor", description=( "A real number that represents a multiplier used in determining the " "overall value of the Contract Valued Item delivered. The concept of a " "Factor allows for a discount or surcharge multiplier to be applied to " "a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Contract Valued Item Number", description="Identifies a Contract Valued Item instance.", json_schema_extra={ "element_property": True, }, ) linkId: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="linkId", title="Pointer to specific item", description=( "Id of the clause or question text related to the context of this " "valuedItem in the referenced form or QuestionnaireResponse." ), json_schema_extra={ "element_property": True, }, ) linkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total Contract Valued Item Value", description=( "Expresses the product of the Contract Valued Item unitQuantity and the" " unitPriceAmt. For example, the formula: unit Quantity * unit Price " "(Cost per Point) * factor Number * points = net Amount. Quantity, " "factor and points are assumed to be 1 if not supplied." ), json_schema_extra={ "element_property": True, }, ) payment: fhirtypes.StringType | None = Field( default=None, alias="payment", title="Terms of valuation", description=None, json_schema_extra={ "element_property": True, }, ) payment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_payment", title="Extension field for ``payment``." ) paymentDate: fhirtypes.DateTimeType | None = Field( default=None, alias="paymentDate", title="When payment is due", description=None, json_schema_extra={ "element_property": True, }, ) paymentDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_paymentDate", title="Extension field for ``paymentDate``." ) points: fhirtypes.DecimalType | None = Field( default=None, alias="points", title="Contract Valued Item Difficulty Scaling Factor", description=( "An amount that expresses the weighting (based on difficulty, cost " "and/or resource intensiveness) associated with the Contract Valued " "Item delivered. The concept of Points allows for assignment of point " "values for a Contract Valued Item, such that a monetary amount can be " "assigned to each point." ), json_schema_extra={ "element_property": True, }, ) points__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_points", title="Extension field for ``points``." ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of Contract Valued Items", description=( "Specifies the units by which the Contract Valued Item is measured or " "counted, and quantifies the countable or measurable Contract Valued " "Item instances." ), json_schema_extra={ "element_property": True, }, ) recipient: fhirtypes.ReferenceType | None = Field( default=None, alias="recipient", title="Who will receive payment", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", ], }, ) responsible: fhirtypes.ReferenceType | None = Field( default=None, alias="responsible", title="Who will make payment", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", ], }, ) securityLabelNumber: typing.List[fhirtypes.UnsignedIntType | None] | None = Field( default=None, alias="securityLabelNumber", title="Security Labels that define affected terms", description=( "A set of security labels that define which terms are controlled by " "this condition." ), json_schema_extra={ "element_property": True, }, ) securityLabelNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_securityLabelNumber", title="Extension field for ``securityLabelNumber``.", ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Contract Valued Item fee, charge, or cost", description="A Contract Valued Item unit valuation measure.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractTermAssetValuedItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "entityCodeableConcept", "entityReference", "identifier", "effectiveTime", "quantity", "unitPrice", "factor", "points", "net", "payment", "paymentDate", "responsible", "recipient", "linkId", "securityLabelNumber", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractTermAssetValuedItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"entity": ["entityCodeableConcept", "entityReference"]} return one_of_many_fields class ContractTermOffer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Context of the Contract term. The matter of concern in the context of this provision of the agrement. """ __resource_type__ = "ContractTermOffer" answer: typing.List[fhirtypes.ContractTermOfferAnswerType] | None = Field( default=None, alias="answer", title="Response to offer text", description=None, json_schema_extra={ "element_property": True, }, ) decision: fhirtypes.CodeableConceptType | None = Field( default=None, alias="decision", title="Accepting party choice", description=( "Type of choice made by accepting party with respect to an offer made " "by an offeror/ grantee." ), json_schema_extra={ "element_property": True, }, ) decisionMode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="decisionMode", title="How decision is conveyed", description="How the decision about a Contract was conveyed.", json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Offer business ID", description="Unique identifier for this particular Contract Provision.", json_schema_extra={ "element_property": True, }, ) linkId: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="linkId", title="Pointer to text", description=( "The id of the clause or question text of the offer in the referenced " "questionnaire/response." ), json_schema_extra={ "element_property": True, }, ) linkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) party: typing.List[fhirtypes.ContractTermOfferPartyType] | None = Field( default=None, alias="party", title="Offer Recipient", description=None, json_schema_extra={ "element_property": True, }, ) securityLabelNumber: typing.List[fhirtypes.UnsignedIntType | None] | None = Field( default=None, alias="securityLabelNumber", title="Offer restriction numbers", description="Security labels that protects the offer.", json_schema_extra={ "element_property": True, }, ) securityLabelNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_securityLabelNumber", title="Extension field for ``securityLabelNumber``.", ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Human readable offer text", description="Human readable form of this Contract Offer.", json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) topic: fhirtypes.ReferenceType | None = Field( default=None, alias="topic", title="Negotiable offer asset", description=( "The owner of an asset has the residual control rights over the asset: " "the right to decide all usages of the asset in any way not " "inconsistent with a prior contract, custom, or law (Hart, 1995, p. " "30)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Contract Offer Type or Form", description=( "Type of Contract Provision such as specific requirements, purposes for" " actions, obligations, prohibitions, e.g. life time maximum benefit." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractTermOffer`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "party", "topic", "type", "decision", "decisionMode", "answer", "text", "linkId", "securityLabelNumber", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractTermOffer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "topic"] class ContractTermOfferAnswer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Response to offer text. """ __resource_type__ = "ContractTermOfferAnswer" valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="The actual answer response", description=( "Response to an offer clause or question text, which enables selection" " of values to be agreed to, e.g., the period of participation, the " "date of occupancy of a rental, warrently duration, or whether " "biospecimen may be used for further research." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="The actual answer response", description=( "Response to an offer clause or question text, which enables selection" " of values to be agreed to, e.g., the period of participation, the " "date of occupancy of a rental, warrently duration, or whether " "biospecimen may be used for further research." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="The actual answer response", description=( "Response to an offer clause or question text, which enables selection" " of values to be agreed to, e.g., the period of participation, the " "date of occupancy of a rental, warrently duration, or whether " "biospecimen may be used for further research." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="The actual answer response", description=( "Response to an offer clause or question text, which enables selection" " of values to be agreed to, e.g., the period of participation, the " "date of occupancy of a rental, warrently duration, or whether " "biospecimen may be used for further research." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="The actual answer response", description=( "Response to an offer clause or question text, which enables selection" " of values to be agreed to, e.g., the period of participation, the " "date of occupancy of a rental, warrently duration, or whether " "biospecimen may be used for further research." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="The actual answer response", description=( "Response to an offer clause or question text, which enables selection" " of values to be agreed to, e.g., the period of participation, the " "date of occupancy of a rental, warrently duration, or whether " "biospecimen may be used for further research." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="The actual answer response", description=( "Response to an offer clause or question text, which enables selection" " of values to be agreed to, e.g., the period of participation, the " "date of occupancy of a rental, warrently duration, or whether " "biospecimen may be used for further research." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="The actual answer response", description=( "Response to an offer clause or question text, which enables selection" " of values to be agreed to, e.g., the period of participation, the " "date of occupancy of a rental, warrently duration, or whether " "biospecimen may be used for further research." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="The actual answer response", description=( "Response to an offer clause or question text, which enables selection" " of values to be agreed to, e.g., the period of participation, the " "date of occupancy of a rental, warrently duration, or whether " "biospecimen may be used for further research." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="The actual answer response", description=( "Response to an offer clause or question text, which enables selection" " of values to be agreed to, e.g., the period of participation, the " "date of occupancy of a rental, warrently duration, or whether " "biospecimen may be used for further research." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="The actual answer response", description=( "Response to an offer clause or question text, which enables selection" " of values to be agreed to, e.g., the period of participation, the " "date of occupancy of a rental, warrently duration, or whether " "biospecimen may be used for further research." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="The actual answer response", description=( "Response to an offer clause or question text, which enables selection" " of values to be agreed to, e.g., the period of participation, the " "date of occupancy of a rental, warrently duration, or whether " "biospecimen may be used for further research." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractTermOfferAnswer`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "valueBoolean", "valueDecimal", "valueInteger", "valueDate", "valueDateTime", "valueTime", "valueString", "valueUri", "valueAttachment", "valueCoding", "valueQuantity", "valueReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractTermOfferAnswer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueBoolean", "valueCoding", "valueDate", "valueDateTime", "valueDecimal", "valueInteger", "valueQuantity", "valueReference", "valueString", "valueTime", "valueUri", ] } return one_of_many_fields class ContractTermOfferParty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Offer Recipient. """ __resource_type__ = "ContractTermOfferParty" reference: typing.List[fhirtypes.ReferenceType] = Field( default=..., alias="reference", title="Referenced entity", description="Participant in the offer.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "RelatedPerson", "Practitioner", "PractitionerRole", "Device", "Group", "Organization", ], }, ) role: fhirtypes.CodeableConceptType = Field( default=..., alias="role", title="Participant engagement type", description="How the party participates in the offer.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractTermOfferParty`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "reference", "role"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractTermOfferParty`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ContractTermSecurityLabel(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Protection for the Term. Security labels that protect the handling of information about the term and its elements, which may be specifically identified.. """ __resource_type__ = "ContractTermSecurityLabel" category: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="category", title="Applicable Policy", description=( "Security label privacy tag that species the applicable privacy and " "security policies governing this term and/or term elements." ), json_schema_extra={ "element_property": True, }, ) classification: fhirtypes.CodingType = Field( default=..., alias="classification", title="Confidentiality Protection", description=( "Security label privacy tag that species the level of confidentiality " "protection required for this term and/or term elements." ), json_schema_extra={ "element_property": True, }, ) control: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="control", title="Handling Instructions", description=( "Security label privacy tag that species the manner in which term " "and/or term elements are to be protected." ), json_schema_extra={ "element_property": True, }, ) number: typing.List[fhirtypes.UnsignedIntType | None] | None = Field( default=None, alias="number", title="Link to Security Labels", description=( "Number used to link this term or term element to the applicable " "Security Label." ), json_schema_extra={ "element_property": True, }, ) number__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_number", title="Extension field for ``number``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractTermSecurityLabel`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "number", "classification", "category", "control", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractTermSecurityLabel`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/contributor.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Contributor Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Contributor(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contributor information. A contributor to the content of a knowledge asset, including authors, editors, reviewers, and endorsers. """ __resource_type__ = "Contributor" contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details of the contributor", description=( "Contact details to assist a user in finding and communicating with the" " contributor." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Who contributed the content", description=( "The name of the individual or organization responsible for the " "contribution." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="author | editor | reviewer | endorser", description="The type of contributor.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["author", "editor", "reviewer", "endorser"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Contributor`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "type", "name", "contact"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Contributor`` according to specification, with preserving the original sequence order. """ return ["type", "name", "contact"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext"), ("type", "type__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/count.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Count Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from . import quantity class Count(quantity.Quantity): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A measured or measurable amount. A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. """ __resource_type__ = "Count" @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Count`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "value", "comparator", "unit", "system", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Count`` according to specification, with preserving the original sequence order. """ return ["value", "comparator", "unit", "system", "code"] ================================================ FILE: fhir/resources/R4B/coverage.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Coverage Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Coverage(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Insurance or medical plan or a payment agreement. Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment. """ __resource_type__ = "Coverage" beneficiary: fhirtypes.ReferenceType = Field( default=..., alias="beneficiary", title="Plan beneficiary", description=( "The party who benefits from the insurance coverage; the patient when " "products and/or services are provided." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) class_fhir: typing.List[fhirtypes.CoverageClassType] | None = Field( default=None, alias="class", title="Additional coverage classifications", description="A suite of underwriter specific classifiers.", json_schema_extra={ "element_property": True, }, ) contract: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="contract", title="Contract details", description="The policy(s) which constitute this insurance coverage.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Contract"], }, ) costToBeneficiary: typing.List[ fhirtypes.CoverageCostToBeneficiaryType ] | None = Field( default=None, alias="costToBeneficiary", title="Patient payments for services/products", description=( "A suite of codes indicating the cost category and associated amount " "which have been detailed in the policy and may have been included on " "the health card." ), json_schema_extra={ "element_property": True, }, ) dependent: fhirtypes.StringType | None = Field( default=None, alias="dependent", title="Dependent number", description="A unique identifier for a dependent under the coverage.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dependent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dependent", title="Extension field for ``dependent``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for the coverage", description="A unique identifier assigned to this coverage.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) network: fhirtypes.StringType | None = Field( default=None, alias="network", title="Insurer network", description=( "The insurer-specific identifier for the insurer-defined network of " "providers to which the beneficiary may seek treatment which will be " "covered at the 'in-network' rate, otherwise 'out of network' terms and" " conditions apply." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) network__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_network", title="Extension field for ``network``." ) order: fhirtypes.PositiveIntType | None = Field( default=None, alias="order", title="Relative order of the coverage", description=( "The order of applicability of this coverage relative to other " "coverages which are currently in force. Note, there may be gaps in the" " numbering and this does not imply primary, secondary etc. as the " "specific positioning of coverages depends upon the episode of care." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) order__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_order", title="Extension field for ``order``." ) payor: typing.List[fhirtypes.ReferenceType] = Field( default=..., alias="payor", title="Issuer of the policy", description=( "The program or plan underwriter or payor including both insurance and " "non-insurance agreements, such as patient-pay agreements." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization", "Patient", "RelatedPerson"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Coverage start and end dates", description=( "Time period during which the coverage is in force. A missing start " "date indicates the start date isn't known, a missing end date means " "the coverage is continuing to be in force." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) policyHolder: fhirtypes.ReferenceType | None = Field( default=None, alias="policyHolder", title="Owner of the policy", description="The party who 'owns' the insurance policy.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "RelatedPerson", "Organization"], }, ) relationship: fhirtypes.CodeableConceptType | None = Field( default=None, alias="relationship", title="Beneficiary relationship to the subscriber", description="The relationship of beneficiary (patient) to the subscriber.", json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subrogation: bool | None = Field( default=None, alias="subrogation", title="Reimbursement to insurer", description=( "When 'subrogation=true' this insurance instance has been included not " "for adjudication but to provide insurers with the details to recover " "costs." ), json_schema_extra={ "element_property": True, }, ) subrogation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subrogation", title="Extension field for ``subrogation``." ) subscriber: fhirtypes.ReferenceType | None = Field( default=None, alias="subscriber", title="Subscriber to the policy", description=( "The party who has signed-up for or 'owns' the contractual relationship" " to the policy or to whom the benefit of the policy for services " "rendered to them or their family is due." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "RelatedPerson"], }, ) subscriberId: fhirtypes.StringType | None = Field( default=None, alias="subscriberId", title="ID assigned to the subscriber", description="The insurer assigned ID for the Subscriber.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subscriberId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subscriberId", title="Extension field for ``subscriberId``.", ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Coverage category such as medical or accident", description=( "The type of coverage: social program, medical plan, accident coverage " "(workers compensation, auto), group health or payment by an individual" " or organization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Coverage`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "type", "policyHolder", "subscriber", "subscriberId", "beneficiary", "dependent", "relationship", "period", "payor", "class", "order", "network", "costToBeneficiary", "subrogation", "contract", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Coverage`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "type", "policyHolder", "subscriber", "subscriberId", "beneficiary", "dependent", "period", "payor", "order", "network", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class CoverageClass(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional coverage classifications. A suite of underwriter specific classifiers. """ __resource_type__ = "CoverageClass" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Human readable description of the type and value", description="A short description for the class.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Type of class such as 'group' or 'plan'", description=( "The type of classification for which an insurer-specific class label " "or number and optional name is provided, for example may be used to " "identify a class of coverage or employer group, Policy, Plan." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="Value associated with the type", description=( "The alphanumeric string value associated with the insurer issued " "label." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageClass`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "value", "name"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageClass`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "value", "name"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("value", "value__ext")] return required_fields class CoverageCostToBeneficiary(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Patient payments for services/products. A suite of codes indicating the cost category and associated amount which have been detailed in the policy and may have been included on the health card. """ __resource_type__ = "CoverageCostToBeneficiary" exception: typing.List[ fhirtypes.CoverageCostToBeneficiaryExceptionType ] | None = Field( default=None, alias="exception", title="Exceptions for patient payments", description=( "A suite of codes indicating exceptions or reductions to patient costs " "and their effective periods." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Cost category", description="The category of patient centric costs associated with treatment.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueMoney: fhirtypes.MoneyType | None = Field( default=None, alias="valueMoney", title="The amount or percentage due from the beneficiary", description="The amount due from the patient for the cost category.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="The amount or percentage due from the beneficiary", description="The amount due from the patient for the cost category.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageCostToBeneficiary`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueQuantity", "valueMoney", "exception", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageCostToBeneficiary`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "valueQuantity", "valueMoney"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"value": ["valueMoney", "valueQuantity"]} return one_of_many_fields class CoverageCostToBeneficiaryException(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Exceptions for patient payments. A suite of codes indicating exceptions or reductions to patient costs and their effective periods. """ __resource_type__ = "CoverageCostToBeneficiaryException" period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="The effective period of the exception", description="The timeframe during when the exception is in force.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Exception category", description="The code for the specific exception.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageCostToBeneficiaryException`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageCostToBeneficiaryException`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "period"] ================================================ FILE: fhir/resources/R4B/coverageeligibilityrequest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CoverageEligibilityRequest Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class CoverageEligibilityRequest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. CoverageEligibilityRequest resource. The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy. """ __resource_type__ = "CoverageEligibilityRequest" created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Creation date", description="The date when this resource was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) enterer: fhirtypes.ReferenceType | None = Field( default=None, alias="enterer", title="Author", description="Person who created the request.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) facility: fhirtypes.ReferenceType | None = Field( default=None, alias="facility", title="Servicing facility", description="Facility where the services are intended to be provided.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for coverage eligiblity request", description="A unique identifier assigned to this coverage eligiblity request.", json_schema_extra={ "element_property": True, }, ) insurance: typing.List[ fhirtypes.CoverageEligibilityRequestInsuranceType ] | None = Field( default=None, alias="insurance", title="Patient insurance information", description=( "Financial instruments for reimbursement for the health care products " "and services." ), json_schema_extra={ "element_property": True, }, ) insurer: fhirtypes.ReferenceType = Field( default=..., alias="insurer", title="Coverage issuer", description=( "The Insurer who issued the coverage in question and is the recipient " "of the request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) item: typing.List[fhirtypes.CoverageEligibilityRequestItemType] | None = Field( default=None, alias="item", title="Item to be evaluated for eligibiity", description=( "Service categories or billable services for which benefit details " "and/or an authorization prior to service delivery may be required by " "the payor." ), json_schema_extra={ "element_property": True, }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Intended recipient of products and services", description=( "The party who is the beneficiary of the supplied coverage and for whom" " eligibility is sought." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) priority: fhirtypes.CodeableConceptType | None = Field( default=None, alias="priority", title="Desired processing priority", description="When the requestor expects the processor to complete processing.", json_schema_extra={ "element_property": True, }, ) provider: fhirtypes.ReferenceType | None = Field( default=None, alias="provider", title="Party responsible for the request", description="The provider which is responsible for the request.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) purpose: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="purpose", title="auth-requirements | benefits | discovery | validation", description=( "Code to specify whether requesting: prior authorization requirements " "for some service categories or billing codes; benefits for coverages " "specified or discovered; discovery and return of coverages for the " "patient; and/or validation that the specified coverage is in-force at " "the date/period specified or 'now' if not specified." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["auth-requirements", "benefits", "discovery", "validation"], }, ) purpose__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) servicedDate: fhirtypes.DateType | None = Field( default=None, alias="servicedDate", title="Estimated date or dates of service", description=( "The date or dates when the enclosed suite of services were performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_servicedDate", title="Extension field for ``servicedDate``.", ) servicedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="servicedPeriod", title="Estimated date or dates of service", description=( "The date or dates when the enclosed suite of services were performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) supportingInfo: typing.List[ fhirtypes.CoverageEligibilityRequestSupportingInfoType ] | None = Field( default=None, alias="supportingInfo", title="Supporting information", description=( "Additional information codes regarding exceptions, special " "considerations, the condition, situation, prior or concurrent issues." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageEligibilityRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "priority", "purpose", "patient", "servicedDate", "servicedPeriod", "created", "enterer", "provider", "insurer", "facility", "supportingInfo", "insurance", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageEligibilityRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "status", "purpose", "patient", "created", "insurer", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("created", "created__ext"), ("purpose", "purpose__ext"), ("status", "status__ext"), ] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"serviced": ["servicedDate", "servicedPeriod"]} return one_of_many_fields class CoverageEligibilityRequestInsurance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Patient insurance information. Financial instruments for reimbursement for the health care products and services. """ __resource_type__ = "CoverageEligibilityRequestInsurance" businessArrangement: fhirtypes.StringType | None = Field( default=None, alias="businessArrangement", title="Additional provider contract number", description=( "A business agreement number established between the provider and the " "insurer for special business processing purposes." ), json_schema_extra={ "element_property": True, }, ) businessArrangement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_businessArrangement", title="Extension field for ``businessArrangement``.", ) coverage: fhirtypes.ReferenceType = Field( default=..., alias="coverage", title="Insurance information", description=( "Reference to the insurance card level information contained in the " "Coverage resource. The coverage issuing insurer will use these details" " to locate the patient's actual coverage within the insurer's " "information system." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage"], }, ) focal: bool | None = Field( default=None, alias="focal", title="Applicable coverage", description=( "A flag to indicate that this Coverage is to be used for evaluation of " "this request when set to true." ), json_schema_extra={ "element_property": True, }, ) focal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_focal", title="Extension field for ``focal``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageEligibilityRequestInsurance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "focal", "coverage", "businessArrangement", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageEligibilityRequestInsurance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CoverageEligibilityRequestItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Item to be evaluated for eligibiity. Service categories or billable services for which benefit details and/or an authorization prior to service delivery may be required by the payor. """ __resource_type__ = "CoverageEligibilityRequestItem" category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Benefit classification", description=( "Code to identify the general type of benefits under which products and" " services are provided." ), json_schema_extra={ "element_property": True, }, ) detail: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="detail", title="Product or service details", description="The plan/proposal/order describing the proposed service in detail.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) diagnosis: typing.List[ fhirtypes.CoverageEligibilityRequestItemDiagnosisType ] | None = Field( default=None, alias="diagnosis", title="Applicable diagnosis", description="Patient diagnosis for which care is sought.", json_schema_extra={ "element_property": True, }, ) facility: fhirtypes.ReferenceType | None = Field( default=None, alias="facility", title="Servicing facility", description="Facility where the services will be provided.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location", "Organization"], }, ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Product or service billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) productOrService: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrService", title="Billing, service, product, or drug code", description=( "This contains the product, service, drug or other billing code for the" " item." ), json_schema_extra={ "element_property": True, }, ) provider: fhirtypes.ReferenceType | None = Field( default=None, alias="provider", title="Perfoming practitioner", description=( "The practitioner who is responsible for the product or service to be " "rendered to the patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) supportingInfoSequence: typing.List[ fhirtypes.PositiveIntType | None ] | None = Field( default=None, alias="supportingInfoSequence", title="Applicable exception or supporting information", description=( "Exceptions, special conditions and supporting information applicable " "for this service or product line." ), json_schema_extra={ "element_property": True, }, ) supportingInfoSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_supportingInfoSequence", title="Extension field for ``supportingInfoSequence``.", ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description="The amount charged to the patient by the provider for a single unit.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageEligibilityRequestItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "supportingInfoSequence", "category", "productOrService", "modifier", "provider", "quantity", "unitPrice", "facility", "diagnosis", "detail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageEligibilityRequestItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CoverageEligibilityRequestItemDiagnosis(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Applicable diagnosis. Patient diagnosis for which care is sought. """ __resource_type__ = "CoverageEligibilityRequestItemDiagnosis" diagnosisCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="diagnosisCodeableConcept", title="Nature of illness or problem", description=( "The nature of illness or problem in a coded form or as a reference to " "an external defined Condition." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e diagnosis[x] "one_of_many": "diagnosis", "one_of_many_required": False, }, ) diagnosisReference: fhirtypes.ReferenceType | None = Field( default=None, alias="diagnosisReference", title="Nature of illness or problem", description=( "The nature of illness or problem in a coded form or as a reference to " "an external defined Condition." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e diagnosis[x] "one_of_many": "diagnosis", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageEligibilityRequestItemDiagnosis`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "diagnosisCodeableConcept", "diagnosisReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageEligibilityRequestItemDiagnosis`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "diagnosis": ["diagnosisCodeableConcept", "diagnosisReference"] } return one_of_many_fields class CoverageEligibilityRequestSupportingInfo(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Supporting information. Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues. """ __resource_type__ = "CoverageEligibilityRequestSupportingInfo" appliesToAll: bool | None = Field( default=None, alias="appliesToAll", title="Applies to all items", description=( "The supporting materials are applicable for all detail items, " "product/servce categories and specific billing codes." ), json_schema_extra={ "element_property": True, }, ) appliesToAll__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_appliesToAll", title="Extension field for ``appliesToAll``.", ) information: fhirtypes.ReferenceType = Field( default=..., alias="information", title="Data to be provided", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Information instance identifier", description="A number to uniquely identify supporting information entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageEligibilityRequestSupportingInfo`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "information", "appliesToAll", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageEligibilityRequestSupportingInfo`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/coverageeligibilityresponse.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CoverageEligibilityResponse Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class CoverageEligibilityResponse(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. CoverageEligibilityResponse resource. This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource. """ __resource_type__ = "CoverageEligibilityResponse" created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Response creation date", description="The date this resource was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) disposition: fhirtypes.StringType | None = Field( default=None, alias="disposition", title="Disposition Message", description="A human readable description of the status of the adjudication.", json_schema_extra={ "element_property": True, }, ) disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_disposition", title="Extension field for ``disposition``." ) error: typing.List[fhirtypes.CoverageEligibilityResponseErrorType] | None = Field( default=None, alias="error", title="Processing errors", description="Errors encountered during the processing of the request.", json_schema_extra={ "element_property": True, }, ) form: fhirtypes.CodeableConceptType | None = Field( default=None, alias="form", title="Printed form identifier", description="A code for the form to be used for printing the content.", json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for coverage eligiblity request", description="A unique identifier assigned to this coverage eligiblity request.", json_schema_extra={ "element_property": True, }, ) insurance: typing.List[ fhirtypes.CoverageEligibilityResponseInsuranceType ] | None = Field( default=None, alias="insurance", title="Patient insurance information", description=( "Financial instruments for reimbursement for the health care products " "and services." ), json_schema_extra={ "element_property": True, }, ) insurer: fhirtypes.ReferenceType = Field( default=..., alias="insurer", title="Coverage issuer", description=( "The Insurer who issued the coverage in question and is the author of " "the response." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) outcome: fhirtypes.CodeType | None = Field( default=None, alias="outcome", title="queued | complete | error | partial", description="The outcome of the request processing.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["queued", "complete", "error", "partial"], }, ) outcome__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_outcome", title="Extension field for ``outcome``." ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Intended recipient of products and services", description=( "The party who is the beneficiary of the supplied coverage and for whom" " eligibility is sought." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) preAuthRef: fhirtypes.StringType | None = Field( default=None, alias="preAuthRef", title="Preauthorization reference", description=( "A reference from the Insurer to which these services pertain to be " "used on further communication and as proof that the request occurred." ), json_schema_extra={ "element_property": True, }, ) preAuthRef__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preAuthRef", title="Extension field for ``preAuthRef``." ) purpose: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="purpose", title="auth-requirements | benefits | discovery | validation", description=( "Code to specify whether requesting: prior authorization requirements " "for some service categories or billing codes; benefits for coverages " "specified or discovered; discovery and return of coverages for the " "patient; and/or validation that the specified coverage is in-force at " "the date/period specified or 'now' if not specified." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["auth-requirements", "benefits", "discovery", "validation"], }, ) purpose__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) request: fhirtypes.ReferenceType = Field( default=..., alias="request", title="Eligibility request reference", description="Reference to the original request resource.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CoverageEligibilityRequest"], }, ) requestor: fhirtypes.ReferenceType | None = Field( default=None, alias="requestor", title="Party responsible for the request", description="The provider which is responsible for the request.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) servicedDate: fhirtypes.DateType | None = Field( default=None, alias="servicedDate", title="Estimated date or dates of service", description=( "The date or dates when the enclosed suite of services were performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_servicedDate", title="Extension field for ``servicedDate``.", ) servicedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="servicedPeriod", title="Estimated date or dates of service", description=( "The date or dates when the enclosed suite of services were performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageEligibilityResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "purpose", "patient", "servicedDate", "servicedPeriod", "created", "requestor", "request", "outcome", "disposition", "insurer", "insurance", "preAuthRef", "form", "error", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageEligibilityResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "status", "purpose", "patient", "created", "request", "outcome", "insurer", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("created", "created__ext"), ("outcome", "outcome__ext"), ("purpose", "purpose__ext"), ("status", "status__ext"), ] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"serviced": ["servicedDate", "servicedPeriod"]} return one_of_many_fields class CoverageEligibilityResponseError(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Processing errors. Errors encountered during the processing of the request. """ __resource_type__ = "CoverageEligibilityResponseError" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Error code detailing processing issues", description=( "An error code,from a specified code system, which details why the " "eligibility check could not be performed." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageEligibilityResponseError`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageEligibilityResponseError`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CoverageEligibilityResponseInsurance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Patient insurance information. Financial instruments for reimbursement for the health care products and services. """ __resource_type__ = "CoverageEligibilityResponseInsurance" benefitPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="benefitPeriod", title="When the benefits are applicable", description="The term of the benefits documented in this response.", json_schema_extra={ "element_property": True, }, ) coverage: fhirtypes.ReferenceType = Field( default=..., alias="coverage", title="Insurance information", description=( "Reference to the insurance card level information contained in the " "Coverage resource. The coverage issuing insurer will use these details" " to locate the patient's actual coverage within the insurer's " "information system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage"], }, ) inforce: bool | None = Field( default=None, alias="inforce", title="Coverage inforce indicator", description=( "Flag indicating if the coverage provided is inforce currently if no " "service date(s) specified or for the whole duration of the service " "dates." ), json_schema_extra={ "element_property": True, }, ) inforce__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_inforce", title="Extension field for ``inforce``." ) item: typing.List[ fhirtypes.CoverageEligibilityResponseInsuranceItemType ] | None = Field( default=None, alias="item", title="Benefits and authorization details", description=( "Benefits and optionally current balances, and authorization details by" " category or service." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageEligibilityResponseInsurance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "coverage", "inforce", "benefitPeriod", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageEligibilityResponseInsurance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "coverage"] class CoverageEligibilityResponseInsuranceItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Benefits and authorization details. Benefits and optionally current balances, and authorization details by category or service. """ __resource_type__ = "CoverageEligibilityResponseInsuranceItem" authorizationRequired: bool | None = Field( default=None, alias="authorizationRequired", title="Authorization required flag", description=( "A boolean flag indicating whether a preauthorization is required prior" " to actual service delivery." ), json_schema_extra={ "element_property": True, }, ) authorizationRequired__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authorizationRequired", title="Extension field for ``authorizationRequired``.", ) authorizationSupporting: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="authorizationSupporting", title="Type of required supporting materials", description=( "Codes or comments regarding information or actions associated with the" " preauthorization." ), json_schema_extra={ "element_property": True, }, ) authorizationUrl: fhirtypes.UriType | None = Field( default=None, alias="authorizationUrl", title="Preauthorization requirements endpoint", description=( "A web location for obtaining requirements or descriptive information " "regarding the preauthorization." ), json_schema_extra={ "element_property": True, }, ) authorizationUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authorizationUrl", title="Extension field for ``authorizationUrl``.", ) benefit: typing.List[ fhirtypes.CoverageEligibilityResponseInsuranceItemBenefitType ] | None = Field( default=None, alias="benefit", title="Benefit Summary", description="Benefits used to date.", json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Benefit classification", description=( "Code to identify the general type of benefits under which products and" " services are provided." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Description of the benefit or services covered", description="A richer description of the benefit or services covered.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) excluded: bool | None = Field( default=None, alias="excluded", title="Excluded from the plan", description=( "True if the indicated class of service is excluded from the plan, " "missing or False indicates the product or service is included in the " "coverage." ), json_schema_extra={ "element_property": True, }, ) excluded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_excluded", title="Extension field for ``excluded``." ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Product or service billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Short name for the benefit", description="A short name or tag for the benefit.", json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) network: fhirtypes.CodeableConceptType | None = Field( default=None, alias="network", title="In or out of network", description=( "Is a flag to indicate whether the benefits refer to in-network " "providers or out-of-network providers." ), json_schema_extra={ "element_property": True, }, ) productOrService: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrService", title="Billing, service, product, or drug code", description=( "This contains the product, service, drug or other billing code for the" " item." ), json_schema_extra={ "element_property": True, }, ) provider: fhirtypes.ReferenceType | None = Field( default=None, alias="provider", title="Performing practitioner", description=( "The practitioner who is eligible for the provision of the product or " "service." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) term: fhirtypes.CodeableConceptType | None = Field( default=None, alias="term", title="Annual or lifetime", description=( "The term or period of the values such as 'maximum lifetime benefit' or" " 'maximum annual visits'." ), json_schema_extra={ "element_property": True, }, ) unit: fhirtypes.CodeableConceptType | None = Field( default=None, alias="unit", title="Individual or family", description="Indicates if the benefits apply to an individual or to the family.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageEligibilityResponseInsuranceItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "category", "productOrService", "modifier", "provider", "excluded", "name", "description", "network", "unit", "term", "benefit", "authorizationRequired", "authorizationSupporting", "authorizationUrl", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageEligibilityResponseInsuranceItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CoverageEligibilityResponseInsuranceItemBenefit(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Benefit Summary. Benefits used to date. """ __resource_type__ = "CoverageEligibilityResponseInsuranceItemBenefit" allowedMoney: fhirtypes.MoneyType | None = Field( default=None, alias="allowedMoney", title="Benefits allowed", description="The quantity of the benefit which is permitted under the coverage.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e allowed[x] "one_of_many": "allowed", "one_of_many_required": False, }, ) allowedString: fhirtypes.StringType | None = Field( default=None, alias="allowedString", title="Benefits allowed", description="The quantity of the benefit which is permitted under the coverage.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e allowed[x] "one_of_many": "allowed", "one_of_many_required": False, }, ) allowedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allowedString", title="Extension field for ``allowedString``.", ) allowedUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="allowedUnsignedInt", title="Benefits allowed", description="The quantity of the benefit which is permitted under the coverage.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e allowed[x] "one_of_many": "allowed", "one_of_many_required": False, }, ) allowedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allowedUnsignedInt", title="Extension field for ``allowedUnsignedInt``.", ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Benefit classification", description="Classification of benefit being provided.", json_schema_extra={ "element_property": True, }, ) usedMoney: fhirtypes.MoneyType | None = Field( default=None, alias="usedMoney", title="Benefits used", description="The quantity of the benefit which have been consumed to date.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e used[x] "one_of_many": "used", "one_of_many_required": False, }, ) usedString: fhirtypes.StringType | None = Field( default=None, alias="usedString", title="Benefits used", description="The quantity of the benefit which have been consumed to date.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e used[x] "one_of_many": "used", "one_of_many_required": False, }, ) usedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usedString", title="Extension field for ``usedString``." ) usedUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="usedUnsignedInt", title="Benefits used", description="The quantity of the benefit which have been consumed to date.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e used[x] "one_of_many": "used", "one_of_many_required": False, }, ) usedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usedUnsignedInt", title="Extension field for ``usedUnsignedInt``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageEligibilityResponseInsuranceItemBenefit`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "allowedUnsignedInt", "allowedString", "allowedMoney", "usedUnsignedInt", "usedString", "usedMoney", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageEligibilityResponseInsuranceItemBenefit`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "allowed": ["allowedMoney", "allowedString", "allowedUnsignedInt"], "used": ["usedMoney", "usedString", "usedUnsignedInt"], } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/datarequirement.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DataRequirement Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class DataRequirement(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Describes a required data item. Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data. """ __resource_type__ = "DataRequirement" codeFilter: typing.List[fhirtypes.DataRequirementCodeFilterType] | None = Field( default=None, alias="codeFilter", title="What codes are expected", description=( "Code filters specify additional constraints on the data, specifying " "the value set of interest for a particular element of the data. Each " "code filter defines an additional constraint on the data, i.e. code " "filters are AND'ed, not OR'ed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dateFilter: typing.List[fhirtypes.DataRequirementDateFilterType] | None = Field( default=None, alias="dateFilter", title="What dates/date ranges are expected", description=( "Date filters specify additional constraints on the data in terms of " "the applicable date range for specific elements. Each date filter " "specifies an additional constraint on the data, i.e. date filters are " "AND'ed, not OR'ed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) limit: fhirtypes.PositiveIntType | None = Field( default=None, alias="limit", title="Number of results", description=( "Specifies a maximum number of results that are required (uses the " "_count search parameter)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) limit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_limit", title="Extension field for ``limit``." ) mustSupport: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="mustSupport", title=( "Indicates specific structure elements that are referenced by the " "knowledge module" ), description=( "Indicates that specific elements of the type are referenced by the " "knowledge module and must be supported by the consumer in order to " "obtain an effective evaluation. This does not mean that a value is " "required for this element, only that the consuming system must " "understand the element and be able to provide values for it if they " "are available. The value of mustSupport SHALL be a FHIRPath " "resolveable on the type of the DataRequirement. The path SHALL consist" " only of identifiers, constant indexers, and .resolve() (see the " "[Simple FHIRPath Profile](fhirpath.html#simple) for full details)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) mustSupport__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_mustSupport", title="Extension field for ``mustSupport``." ) profile: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="profile", title="The profile of the required data", description=( "The profile of the required data, specified as the uri of the profile " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) profile__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) sort: typing.List[fhirtypes.DataRequirementSortType] | None = Field( default=None, alias="sort", title="Order of the results", description="Specifies the order of the results to be returned.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subjectCodeableConcept", title=( "E.g. Patient, Practitioner, RelatedPerson, Organization, Location, " "Device" ), description=( "The intended subjects of the data requirement. If this element is not " "provided, a Patient subject is assumed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, }, ) subjectReference: fhirtypes.ReferenceType | None = Field( default=None, alias="subjectReference", title=( "E.g. Patient, Practitioner, RelatedPerson, Organization, Location, " "Device" ), description=( "The intended subjects of the data requirement. If this element is not " "provided, a Patient subject is assumed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="The type of the required data", description=( "The type of the required data, specified as the type name of a " "resource. For profiles, this value is set to the type of the base " "resource of the profile." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DataRequirement`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "type", "profile", "subjectCodeableConcept", "subjectReference", "mustSupport", "codeFilter", "dateFilter", "limit", "sort", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DataRequirement`` according to specification, with preserving the original sequence order. """ return [ "type", "profile", "subjectCodeableConcept", "subjectReference", "mustSupport", "codeFilter", "dateFilter", "limit", "sort", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"subject": ["subjectCodeableConcept", "subjectReference"]} return one_of_many_fields class DataRequirementCodeFilter(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What codes are expected. Code filters specify additional constraints on the data, specifying the value set of interest for a particular element of the data. Each code filter defines an additional constraint on the data, i.e. code filters are AND'ed, not OR'ed. """ __resource_type__ = "DataRequirementCodeFilter" code: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="code", title="What code is expected", description=( "The codes for the code filter. If values are given, the filter will " "return only those data items for which the code-valued attribute " "specified by the path has a value that is one of the specified codes. " "If codes are specified in addition to a value set, the filter returns " "items matching a code in the value set or one of the specified codes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="A code-valued attribute to filter on", description=( "The code-valued attribute of the filter. The specified path SHALL be a" " FHIRPath resolveable on the specified type of the DataRequirement, " "and SHALL consist only of identifiers, constant indexers, and " ".resolve(). The path is allowed to contain qualifiers (.) to traverse " "sub-elements, as well as indexers ([x]) to traverse multiple-" "cardinality sub-elements (see the [Simple FHIRPath " "Profile](fhirpath.html#simple) for full details). Note that the index " "must be an integer constant. The path must resolve to an element of " "type code, Coding, or CodeableConcept." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) searchParam: fhirtypes.StringType | None = Field( default=None, alias="searchParam", title="A coded (token) parameter to search on", description=( "A token parameter that refers to a search parameter defined on the " "specified type of the DataRequirement, and which searches on elements " "of type code, Coding, or CodeableConcept." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) searchParam__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_searchParam", title="Extension field for ``searchParam``." ) valueSet: fhirtypes.CanonicalType | None = Field( default=None, alias="valueSet", title="Valueset for the filter", description=( "The valueset for the code filter. The valueSet and code elements are " "additive. If valueSet is specified, the filter will return only those " "data items for which the value of the code-valued element specified in" " the path is a member of the specified valueset." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueSet", title="Extension field for ``valueSet``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DataRequirementCodeFilter`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "path", "searchParam", "valueSet", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DataRequirementCodeFilter`` according to specification, with preserving the original sequence order. """ return ["path", "searchParam", "valueSet", "code"] class DataRequirementDateFilter(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What dates/date ranges are expected. Date filters specify additional constraints on the data in terms of the applicable date range for specific elements. Each date filter specifies an additional constraint on the data, i.e. date filters are AND'ed, not OR'ed. """ __resource_type__ = "DataRequirementDateFilter" path: fhirtypes.StringType | None = Field( default=None, alias="path", title="A date-valued attribute to filter on", description=( "The date-valued attribute of the filter. The specified path SHALL be a" " FHIRPath resolveable on the specified type of the DataRequirement, " "and SHALL consist only of identifiers, constant indexers, and " ".resolve(). The path is allowed to contain qualifiers (.) to traverse " "sub-elements, as well as indexers ([x]) to traverse multiple-" "cardinality sub-elements (see the [Simple FHIRPath " "Profile](fhirpath.html#simple) for full details). Note that the index " "must be an integer constant. The path must resolve to an element of " "type date, dateTime, Period, Schedule, or Timing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) searchParam: fhirtypes.StringType | None = Field( default=None, alias="searchParam", title="A date valued parameter to search on", description=( "A date parameter that refers to a search parameter defined on the " "specified type of the DataRequirement, and which searches on elements " "of type date, dateTime, Period, Schedule, or Timing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) searchParam__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_searchParam", title="Extension field for ``searchParam``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="The value of the filter, as a Period, DateTime, or Duration value", description=( "The value of the filter. If period is specified, the filter will " "return only those data items that fall within the bounds determined by" " the Period, inclusive of the period boundaries. If dateTime is " "specified, the filter will return only those data items that are equal" " to the specified dateTime. If a Duration is specified, the filter " "will return only those data items that fall within Duration before " "now." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDuration: fhirtypes.DurationType | None = Field( default=None, alias="valueDuration", title="The value of the filter, as a Period, DateTime, or Duration value", description=( "The value of the filter. If period is specified, the filter will " "return only those data items that fall within the bounds determined by" " the Period, inclusive of the period boundaries. If dateTime is " "specified, the filter will return only those data items that are equal" " to the specified dateTime. If a Duration is specified, the filter " "will return only those data items that fall within Duration before " "now." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="The value of the filter, as a Period, DateTime, or Duration value", description=( "The value of the filter. If period is specified, the filter will " "return only those data items that fall within the bounds determined by" " the Period, inclusive of the period boundaries. If dateTime is " "specified, the filter will return only those data items that are equal" " to the specified dateTime. If a Duration is specified, the filter " "will return only those data items that fall within Duration before " "now." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DataRequirementDateFilter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "path", "searchParam", "valueDateTime", "valuePeriod", "valueDuration", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DataRequirementDateFilter`` according to specification, with preserving the original sequence order. """ return ["path", "searchParam", "valueDateTime", "valuePeriod", "valueDuration"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": ["valueDateTime", "valueDuration", "valuePeriod"] } return one_of_many_fields class DataRequirementSort(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Order of the results. Specifies the order of the results to be returned. """ __resource_type__ = "DataRequirementSort" direction: fhirtypes.CodeType | None = Field( default=None, alias="direction", title="ascending | descending", description="The direction of the sort, ascending or descending.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["ascending", "descending"], }, ) direction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_direction", title="Extension field for ``direction``." ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="The name of the attribute to perform the sort", description=( "The attribute of the sort. The specified path must be resolvable from " "the type of the required data. The path is allowed to contain " "qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to " "traverse multiple-cardinality sub-elements. Note that the index must " "be an integer constant." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DataRequirementSort`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "path", "direction"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DataRequirementSort`` according to specification, with preserving the original sequence order. """ return ["path", "direction"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("direction", "direction__ext"), ("path", "path__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/detectedissue.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DetectedIssue Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class DetectedIssue(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Clinical issue with action. Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. """ __resource_type__ = "DetectedIssue" author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="The provider or device that identified the issue", description=( "Individual or device responsible for the issue being raised. For " "example, a decision support application or a pharmacist conducting a " "medication review." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole", "Device"], }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Issue Category, e.g. drug-drug, duplicate therapy, etc.", description="Identifies the general type of issue identified.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) detail: fhirtypes.StringType | None = Field( default=None, alias="detail", title="Description and context", description="A textual explanation of the detected issue.", json_schema_extra={ "element_property": True, }, ) detail__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detail", title="Extension field for ``detail``." ) evidence: typing.List[fhirtypes.DetectedIssueEvidenceType] | None = Field( default=None, alias="evidence", title="Supporting evidence", description=( "Supporting evidence or manifestations that provide the basis for " "identifying the detected issue such as a GuidanceResponse or " "MeasureReport." ), json_schema_extra={ "element_property": True, }, ) identifiedDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="identifiedDateTime", title="When identified", description="The date or period when the detected issue was initially identified.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e identified[x] "one_of_many": "identified", "one_of_many_required": False, }, ) identifiedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_identifiedDateTime", title="Extension field for ``identifiedDateTime``.", ) identifiedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="identifiedPeriod", title="When identified", description="The date or period when the detected issue was initially identified.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e identified[x] "one_of_many": "identified", "one_of_many_required": False, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique id for the detected issue", description="Business identifier associated with the detected issue record.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) implicated: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="implicated", title="Problem resource", description=( "Indicates the resource representing the current activity or proposed " "activity that is potentially problematic." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) mitigation: typing.List[fhirtypes.DetectedIssueMitigationType] | None = Field( default=None, alias="mitigation", title="Step taken to address", description=( "Indicates an action that has been taken or is committed to reduce or " "eliminate the likelihood of the risk identified by the detected issue " "from manifesting. Can also reflect an observation of known mitigating" " factors that may reduce/eliminate the need for any action." ), json_schema_extra={ "element_property": True, }, ) patient: fhirtypes.ReferenceType | None = Field( default=None, alias="patient", title="Associated patient", description=( "Indicates the patient whose record the detected issue is associated " "with." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) reference: fhirtypes.UriType | None = Field( default=None, alias="reference", title="Authority for issue", description=( "The literature, knowledge-base or similar reference that describes the" " propensity for the detected issue identified." ), json_schema_extra={ "element_property": True, }, ) reference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reference", title="Extension field for ``reference``." ) severity: fhirtypes.CodeType | None = Field( default=None, alias="severity", title="high | moderate | low", description=( "Indicates the degree of importance associated with the identified " "issue based on the potential impact on the patient." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["high", "moderate", "low"], }, ) severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_severity", title="Extension field for ``severity``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="registered | preliminary | final | amended +", description="Indicates the status of the detected issue.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["registered", "preliminary", "final", "amended", "+"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DetectedIssue`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "code", "severity", "patient", "identifiedDateTime", "identifiedPeriod", "author", "implicated", "evidence", "detail", "reference", "mitigation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DetectedIssue`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "code", "severity", "patient", "identifiedDateTime", "identifiedPeriod", "author", "implicated", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"identified": ["identifiedDateTime", "identifiedPeriod"]} return one_of_many_fields class DetectedIssueEvidence(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Supporting evidence. Supporting evidence or manifestations that provide the basis for identifying the detected issue such as a GuidanceResponse or MeasureReport. """ __resource_type__ = "DetectedIssueEvidence" code: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="code", title="Manifestation", description="A manifestation that led to the recording of this detected issue.", json_schema_extra={ "element_property": True, }, ) detail: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="detail", title="Supporting information", description=( "Links to resources that constitute evidence for the detected issue " "such as a GuidanceResponse or MeasureReport." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DetectedIssueEvidence`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "detail"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DetectedIssueEvidence`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class DetectedIssueMitigation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Step taken to address. Indicates an action that has been taken or is committed to reduce or eliminate the likelihood of the risk identified by the detected issue from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action. """ __resource_type__ = "DetectedIssueMitigation" action: fhirtypes.CodeableConceptType = Field( default=..., alias="action", title="What mitigation?", description=( "Describes the action that was taken or the observation that was made " "that reduces/eliminates the risk associated with the identified issue." ), json_schema_extra={ "element_property": True, }, ) author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="Who is committing?", description=( "Identifies the practitioner who determined the mitigation and takes " "responsibility for the mitigation step occurring." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date committed", description="Indicates when the mitigating action was documented.", json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DetectedIssueMitigation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "action", "date", "author"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DetectedIssueMitigation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/device.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Device Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Device(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Item used in healthcare. A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. """ __resource_type__ = "Device" contact: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="contact", title="Details for human/organization for support", description=( "Contact details for an organization or a particular human that is " "responsible for the device." ), json_schema_extra={ "element_property": True, }, ) definition: fhirtypes.ReferenceType | None = Field( default=None, alias="definition", title="The reference to the definition for the device", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DeviceDefinition"], }, ) deviceName: typing.List[fhirtypes.DeviceDeviceNameType] | None = Field( default=None, alias="deviceName", title="The name of the device as given by the manufacturer", description=( "This represents the manufacturer's name of the device as provided by " "the device, from a UDI label, or by a person describing the Device. " "This typically would be used when a person provides the name(s) or " "when the device represents one of the names available from " "DeviceDefinition." ), json_schema_extra={ "element_property": True, }, ) distinctIdentifier: fhirtypes.StringType | None = Field( default=None, alias="distinctIdentifier", title="The distinct identification string", description=( "The distinct identification string as required by regulation for a " "human cell, tissue, or cellular and tissue-based product." ), json_schema_extra={ "element_property": True, }, ) distinctIdentifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_distinctIdentifier", title="Extension field for ``distinctIdentifier``.", ) expirationDate: fhirtypes.DateTimeType | None = Field( default=None, alias="expirationDate", title="Date and time of expiry of this device (if applicable)", description=( "The date and time beyond which this device is no longer valid or " "should not be used (if applicable)." ), json_schema_extra={ "element_property": True, }, ) expirationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expirationDate", title="Extension field for ``expirationDate``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Instance identifier", description=( "Unique instance identifiers assigned to a device by manufacturers " "other organizations or owners." ), json_schema_extra={ "element_property": True, }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where the device is found", description="The place where the device can be found.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) lotNumber: fhirtypes.StringType | None = Field( default=None, alias="lotNumber", title="Lot number of manufacture", description="Lot number assigned by the manufacturer.", json_schema_extra={ "element_property": True, }, ) lotNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lotNumber", title="Extension field for ``lotNumber``." ) manufactureDate: fhirtypes.DateTimeType | None = Field( default=None, alias="manufactureDate", title="Date when the device was made", description="The date and time when the device was manufactured.", json_schema_extra={ "element_property": True, }, ) manufactureDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_manufactureDate", title="Extension field for ``manufactureDate``.", ) manufacturer: fhirtypes.StringType | None = Field( default=None, alias="manufacturer", title="Name of device manufacturer", description="A name of the manufacturer.", json_schema_extra={ "element_property": True, }, ) manufacturer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_manufacturer", title="Extension field for ``manufacturer``.", ) modelNumber: fhirtypes.StringType | None = Field( default=None, alias="modelNumber", title="The manufacturer's model number for the device", description=None, json_schema_extra={ "element_property": True, }, ) modelNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_modelNumber", title="Extension field for ``modelNumber``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Device notes and comments", description=( "Descriptive information, usage information or implantation information" " that is not captured in an existing element." ), json_schema_extra={ "element_property": True, }, ) owner: fhirtypes.ReferenceType | None = Field( default=None, alias="owner", title="Organization responsible for device", description=( "An organization that is responsible for the provision and ongoing " "maintenance of the device." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) parent: fhirtypes.ReferenceType | None = Field( default=None, alias="parent", title="The device that this device is attached to or is part of", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) partNumber: fhirtypes.StringType | None = Field( default=None, alias="partNumber", title="The part number or catalog number of the device", description=None, json_schema_extra={ "element_property": True, }, ) partNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_partNumber", title="Extension field for ``partNumber``." ) patient: fhirtypes.ReferenceType | None = Field( default=None, alias="patient", title="Patient to whom Device is affixed", description="Patient information, If the device is affixed to a person.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) property: typing.List[fhirtypes.DevicePropertyType] | None = Field( default=None, alias="property", title=( "The actual configuration settings of a device as it actually operates," " e.g., regulation status, time properties" ), description=None, json_schema_extra={ "element_property": True, }, ) safety: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="safety", title="Safety Characteristics of Device", description=( "Provides additional safety characteristics about a medical device. " "For example devices containing latex." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) serialNumber: fhirtypes.StringType | None = Field( default=None, alias="serialNumber", title="Serial number assigned by the manufacturer", description=( "The serial number assigned by the organization when the device was " "manufactured." ), json_schema_extra={ "element_property": True, }, ) serialNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_serialNumber", title="Extension field for ``serialNumber``.", ) specialization: typing.List[fhirtypes.DeviceSpecializationType] | None = Field( default=None, alias="specialization", title=( "The capabilities supported on a device, the standards to which the " "device conforms for a particular purpose, and used for the " "communication" ), description=None, json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | inactive | entered-in-error | unknown", description="Status of the Device availability.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "inactive", "entered-in-error", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusReason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="statusReason", title=( "online | paused | standby | offline | not-ready | transduc-discon | " "hw-discon | off" ), description="Reason for the dtatus of the Device availability.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The kind or type of device", description=None, json_schema_extra={ "element_property": True, }, ) udiCarrier: typing.List[fhirtypes.DeviceUdiCarrierType] | None = Field( default=None, alias="udiCarrier", title="Unique Device Identifier (UDI) Barcode string", description=( "Unique device identifier (UDI) assigned to device label or package. " "Note that the Device may include multiple udiCarriers as it either may" " include just the udiCarrier for the jurisdiction it is sold, or for " "multiple jurisdictions it could have been sold." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Network address to contact device", description="A network address on which the device may be contacted directly.", json_schema_extra={ "element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) version: typing.List[fhirtypes.DeviceVersionType] | None = Field( default=None, alias="version", title=( "The actual design of the device or software version running on the " "device" ), description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Device`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "definition", "udiCarrier", "status", "statusReason", "distinctIdentifier", "manufacturer", "manufactureDate", "expirationDate", "lotNumber", "serialNumber", "deviceName", "modelNumber", "partNumber", "type", "specialization", "version", "property", "patient", "owner", "contact", "location", "url", "note", "safety", "parent", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Device`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "udiCarrier", "status", "safety"] class DeviceDeviceName(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The name of the device as given by the manufacturer. This represents the manufacturer's name of the device as provided by the device, from a UDI label, or by a person describing the Device. This typically would be used when a person provides the name(s) or when the device represents one of the names available from DeviceDefinition. """ __resource_type__ = "DeviceDeviceName" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="The name that identifies the device", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "udi-label-name | user-friendly-name | patient-reported-name | " "manufacturer-name | model-name | other" ), description=( "The type of deviceName. UDILabelName | UserFriendlyName | " "PatientReportedName | ManufactureDeviceName | ModelName." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "udi-label-name", "user-friendly-name", "patient-reported-name", "manufacturer-name", "model-name", "other", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDeviceName`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "type"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDeviceName`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext"), ("type", "type__ext")] return required_fields class DeviceProperty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties. """ __resource_type__ = "DeviceProperty" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title=( "Code that specifies the property DeviceDefinitionPropetyCode " "(Extensible)" ), description=None, json_schema_extra={ "element_property": True, }, ) valueCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="valueCode", title="Property value as a code, e.g., NTP4 (synced to NTP)", description=None, json_schema_extra={ "element_property": True, }, ) valueQuantity: typing.List[fhirtypes.QuantityType] | None = Field( default=None, alias="valueQuantity", title="Property value as a quantity", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceProperty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueQuantity", "valueCode", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceProperty`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class DeviceSpecialization(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The capabilities supported on a device, the standards to which the device conforms for a particular purpose, and used for the communication. """ __resource_type__ = "DeviceSpecialization" systemType: fhirtypes.CodeableConceptType = Field( default=..., alias="systemType", title="The standard that is used to operate and communicate", description=None, json_schema_extra={ "element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="The version of the standard that is used to operate and communicate", description=None, json_schema_extra={ "element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceSpecialization`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "systemType", "version"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceSpecialization`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class DeviceUdiCarrier(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Unique Device Identifier (UDI) Barcode string. Unique device identifier (UDI) assigned to device label or package. Note that the Device may include multiple udiCarriers as it either may include just the udiCarrier for the jurisdiction it is sold, or for multiple jurisdictions it could have been sold. """ __resource_type__ = "DeviceUdiCarrier" carrierAIDC: fhirtypes.Base64BinaryType | None = Field( default=None, alias="carrierAIDC", title="UDI Machine Readable Barcode String", description=( "The full UDI carrier of the Automatic Identification and Data Capture " "(AIDC) technology representation of the barcode string as printed on " "the packaging of the device - e.g., a barcode or RFID. Because of " "limitations on character sets in XML and the need to round-trip JSON " "data through XML, AIDC Formats *SHALL* be base64 encoded." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) carrierAIDC__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_carrierAIDC", title="Extension field for ``carrierAIDC``." ) carrierHRF: fhirtypes.StringType | None = Field( default=None, alias="carrierHRF", title="UDI Human Readable Barcode String", description=( "The full UDI carrier as the human readable form (HRF) representation " "of the barcode string as printed on the packaging of the device." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) carrierHRF__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_carrierHRF", title="Extension field for ``carrierHRF``." ) deviceIdentifier: fhirtypes.StringType | None = Field( default=None, alias="deviceIdentifier", title="Mandatory fixed portion of UDI", description=( "The device identifier (DI) is a mandatory, fixed portion of a UDI that" " identifies the labeler and the specific version or model of a device." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) deviceIdentifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deviceIdentifier", title="Extension field for ``deviceIdentifier``.", ) entryType: fhirtypes.CodeType | None = Field( default=None, alias="entryType", title="barcode | rfid | manual +", description="A coded entry to indicate how the data was entered.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["barcode", "rfid", "manual", "+"], }, ) entryType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_entryType", title="Extension field for ``entryType``." ) issuer: fhirtypes.UriType | None = Field( default=None, alias="issuer", title="UDI Issuing Organization", description=( "Organization that is charged with issuing UDIs for devices. For " "example, the US FDA issuers include : 1) GS1: " "http://hl7.org/fhir/NamingSystem/gs1-di, 2) HIBCC: " "http://hl7.org/fhir/NamingSystem/hibcc-dI, 3) ICCBBA for blood " "containers: http://hl7.org/fhir/NamingSystem/iccbba-blood-di, 4) " "ICCBA for other devices: http://hl7.org/fhir/NamingSystem/iccbba-" "other-di." ), json_schema_extra={ "element_property": True, }, ) issuer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issuer", title="Extension field for ``issuer``." ) jurisdiction: fhirtypes.UriType | None = Field( default=None, alias="jurisdiction", title="Regional UDI authority", description=( "The identity of the authoritative source for UDI generation within a " "jurisdiction. All UDIs are globally unique within a single namespace " "with the appropriate repository uri as the system. For example, UDIs" " of devices managed in the U.S. by the FDA, the value is " "http://hl7.org/fhir/NamingSystem/fda-udi." ), json_schema_extra={ "element_property": True, }, ) jurisdiction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_jurisdiction", title="Extension field for ``jurisdiction``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceUdiCarrier`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "deviceIdentifier", "issuer", "jurisdiction", "carrierAIDC", "carrierHRF", "entryType", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceUdiCarrier`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "deviceIdentifier", "carrierAIDC", "carrierHRF"] class DeviceVersion(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The actual design of the device or software version running on the device. """ __resource_type__ = "DeviceVersion" component: fhirtypes.IdentifierType | None = Field( default=None, alias="component", title="A single component of the device version", description=None, json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The type of the device version, e.g. manufacturer, approved, internal", description=None, json_schema_extra={ "element_property": True, }, ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The version text", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceVersion`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "component", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceVersion`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("value", "value__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/devicedefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DeviceDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class DeviceDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An instance of a medical-related component of a medical device. The characteristics, operational status and capabilities of a medical- related component of a medical device. """ __resource_type__ = "DeviceDefinition" capability: typing.List[fhirtypes.DeviceDefinitionCapabilityType] | None = Field( default=None, alias="capability", title="Device capabilities", description=None, json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="contact", title="Details for human/organization for support", description=( "Contact details for an organization or a particular human that is " "responsible for the device." ), json_schema_extra={ "element_property": True, }, ) deviceName: typing.List[fhirtypes.DeviceDefinitionDeviceNameType] | None = Field( default=None, alias="deviceName", title="A name given to the device to identify it", description=None, json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Instance identifier", description=( "Unique instance identifiers assigned to a device by the software, " "manufacturers, other organizations or owners. For example: handle ID." ), json_schema_extra={ "element_property": True, }, ) languageCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="languageCode", title=( "Language code for the human-readable text strings produced by the " "device (all supported)" ), description=None, json_schema_extra={ "element_property": True, }, ) manufacturerReference: fhirtypes.ReferenceType | None = Field( default=None, alias="manufacturerReference", title="Name of device manufacturer", description="A name of the manufacturer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e manufacturer[x] "one_of_many": "manufacturer", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) manufacturerString: fhirtypes.StringType | None = Field( default=None, alias="manufacturerString", title="Name of device manufacturer", description="A name of the manufacturer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e manufacturer[x] "one_of_many": "manufacturer", "one_of_many_required": False, }, ) manufacturerString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_manufacturerString", title="Extension field for ``manufacturerString``.", ) material: typing.List[fhirtypes.DeviceDefinitionMaterialType] | None = Field( default=None, alias="material", title="A substance used to create the material(s) of which the device is made", description=None, json_schema_extra={ "element_property": True, }, ) modelNumber: fhirtypes.StringType | None = Field( default=None, alias="modelNumber", title="The model number for the device", description=None, json_schema_extra={ "element_property": True, }, ) modelNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_modelNumber", title="Extension field for ``modelNumber``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Device notes and comments", description=( "Descriptive information, usage information or implantation information" " that is not captured in an existing element." ), json_schema_extra={ "element_property": True, }, ) onlineInformation: fhirtypes.UriType | None = Field( default=None, alias="onlineInformation", title="Access to on-line information", description="Access to on-line information about the device.", json_schema_extra={ "element_property": True, }, ) onlineInformation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onlineInformation", title="Extension field for ``onlineInformation``.", ) owner: fhirtypes.ReferenceType | None = Field( default=None, alias="owner", title="Organization responsible for device", description=( "An organization that is responsible for the provision and ongoing " "maintenance of the device." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) parentDevice: fhirtypes.ReferenceType | None = Field( default=None, alias="parentDevice", title="The parent device it can be part of", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DeviceDefinition"], }, ) physicalCharacteristics: fhirtypes.ProdCharacteristicType | None = Field( default=None, alias="physicalCharacteristics", title="Dimensions, color etc.", description="Dimensions, color etc.", json_schema_extra={ "element_property": True, }, ) property: typing.List[fhirtypes.DeviceDefinitionPropertyType] | None = Field( default=None, alias="property", title=( "The actual configuration settings of a device as it actually operates," " e.g., regulation status, time properties" ), description=None, json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title=( "The quantity of the device present in the packaging (e.g. the number " "of devices present in a pack, or the number of devices in the same " "package of the medicinal product)" ), description=None, json_schema_extra={ "element_property": True, }, ) safety: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="safety", title="Safety characteristics of the device", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) shelfLifeStorage: typing.List[fhirtypes.ProductShelfLifeType] | None = Field( default=None, alias="shelfLifeStorage", title="Shelf Life and storage information", description=None, json_schema_extra={ "element_property": True, }, ) specialization: typing.List[ fhirtypes.DeviceDefinitionSpecializationType ] | None = Field( default=None, alias="specialization", title=( "The capabilities supported on a device, the standards to which the " "device conforms for a particular purpose, and used for the " "communication" ), description=None, json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="What kind of device or device system this is", description=None, json_schema_extra={ "element_property": True, }, ) udiDeviceIdentifier: typing.List[ fhirtypes.DeviceDefinitionUdiDeviceIdentifierType ] | None = Field( default=None, alias="udiDeviceIdentifier", title="Unique Device Identifier (UDI) Barcode string", description=( "Unique device identifier (UDI) assigned to device label or package. " "Note that the Device may include multiple udiCarriers as it either may" " include just the udiCarrier for the jurisdiction it is sold, or for " "multiple jurisdictions it could have been sold." ), json_schema_extra={ "element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Network address to contact device", description="A network address on which the device may be contacted directly.", json_schema_extra={ "element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) version: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="version", title="Available versions", description="The available versions of the device, e.g., software versions.", json_schema_extra={ "element_property": True, }, ) version__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "udiDeviceIdentifier", "manufacturerString", "manufacturerReference", "deviceName", "modelNumber", "type", "specialization", "version", "safety", "shelfLifeStorage", "physicalCharacteristics", "languageCode", "capability", "property", "owner", "contact", "url", "onlineInformation", "note", "quantity", "parentDevice", "material", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDefinition`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "safety", "parentDevice"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "manufacturer": ["manufacturerReference", "manufacturerString"] } return one_of_many_fields class DeviceDefinitionCapability(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Device capabilities. """ __resource_type__ = "DeviceDefinitionCapability" description: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="description", title="Description of capability", description=None, json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Type of capability", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDefinitionCapability`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "description"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDefinitionCapability`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class DeviceDefinitionDeviceName(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A name given to the device to identify it. """ __resource_type__ = "DeviceDefinitionDeviceName" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="The name of the device", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "udi-label-name | user-friendly-name | patient-reported-name | " "manufacturer-name | model-name | other" ), description=( "The type of deviceName. UDILabelName | UserFriendlyName | " "PatientReportedName | ManufactureDeviceName | ModelName." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "udi-label-name", "user-friendly-name", "patient-reported-name", "manufacturer-name", "model-name", "other", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDefinitionDeviceName`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "type"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDefinitionDeviceName`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext"), ("type", "type__ext")] return required_fields class DeviceDefinitionMaterial(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A substance used to create the material(s) of which the device is made. """ __resource_type__ = "DeviceDefinitionMaterial" allergenicIndicator: bool | None = Field( default=None, alias="allergenicIndicator", title="Whether the substance is a known or suspected allergen", description=None, json_schema_extra={ "element_property": True, }, ) allergenicIndicator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allergenicIndicator", title="Extension field for ``allergenicIndicator``.", ) alternate: bool | None = Field( default=None, alias="alternate", title="Indicates an alternative material of the device", description=None, json_schema_extra={ "element_property": True, }, ) alternate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_alternate", title="Extension field for ``alternate``." ) substance: fhirtypes.CodeableConceptType = Field( default=..., alias="substance", title="The substance", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDefinitionMaterial`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "substance", "alternate", "allergenicIndicator", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDefinitionMaterial`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class DeviceDefinitionProperty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties. """ __resource_type__ = "DeviceDefinitionProperty" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title=( "Code that specifies the property DeviceDefinitionPropetyCode " "(Extensible)" ), description=None, json_schema_extra={ "element_property": True, }, ) valueCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="valueCode", title="Property value as a code, e.g., NTP4 (synced to NTP)", description=None, json_schema_extra={ "element_property": True, }, ) valueQuantity: typing.List[fhirtypes.QuantityType] | None = Field( default=None, alias="valueQuantity", title="Property value as a quantity", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDefinitionProperty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueQuantity", "valueCode", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDefinitionProperty`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class DeviceDefinitionSpecialization(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The capabilities supported on a device, the standards to which the device conforms for a particular purpose, and used for the communication. """ __resource_type__ = "DeviceDefinitionSpecialization" systemType: fhirtypes.StringType | None = Field( default=None, alias="systemType", title="The standard that is used to operate and communicate", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) systemType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_systemType", title="Extension field for ``systemType``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="The version of the standard that is used to operate and communicate", description=None, json_schema_extra={ "element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDefinitionSpecialization`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "systemType", "version"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDefinitionSpecialization`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("systemType", "systemType__ext")] return required_fields class DeviceDefinitionUdiDeviceIdentifier(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Unique Device Identifier (UDI) Barcode string. Unique device identifier (UDI) assigned to device label or package. Note that the Device may include multiple udiCarriers as it either may include just the udiCarrier for the jurisdiction it is sold, or for multiple jurisdictions it could have been sold. """ __resource_type__ = "DeviceDefinitionUdiDeviceIdentifier" deviceIdentifier: fhirtypes.StringType | None = Field( default=None, alias="deviceIdentifier", title=( "The identifier that is to be associated with every Device that " "references this DeviceDefintiion for the issuer and jurisdication " "porvided in the DeviceDefinition.udiDeviceIdentifier" ), description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) deviceIdentifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deviceIdentifier", title="Extension field for ``deviceIdentifier``.", ) issuer: fhirtypes.UriType | None = Field( default=None, alias="issuer", title="The organization that assigns the identifier algorithm", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) issuer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issuer", title="Extension field for ``issuer``." ) jurisdiction: fhirtypes.UriType | None = Field( default=None, alias="jurisdiction", title="The jurisdiction to which the deviceIdentifier applies", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) jurisdiction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_jurisdiction", title="Extension field for ``jurisdiction``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDefinitionUdiDeviceIdentifier`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "deviceIdentifier", "issuer", "jurisdiction", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDefinitionUdiDeviceIdentifier`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("deviceIdentifier", "deviceIdentifier__ext"), ("issuer", "issuer__ext"), ("jurisdiction", "jurisdiction__ext"), ] return required_fields ================================================ FILE: fhir/resources/R4B/devicemetric.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DeviceMetric Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class DeviceMetric(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Measurement, calculation or setting capability of a medical device. Describes a measurement, calculation or setting capability of a medical device. """ __resource_type__ = "DeviceMetric" calibration: typing.List[fhirtypes.DeviceMetricCalibrationType] | None = Field( default=None, alias="calibration", title=( "Describes the calibrations that have been performed or that are " "required to be performed" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) category: fhirtypes.CodeType | None = Field( default=None, alias="category", title="measurement | setting | calculation | unspecified", description=( "Indicates the category of the observation generation process. A " "DeviceMetric can be for example a setting, measurement, or " "calculation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["measurement", "setting", "calculation", "unspecified"], }, ) category__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_category", title="Extension field for ``category``." ) color: fhirtypes.CodeType | None = Field( default=None, alias="color", title="black | red | green | yellow | blue | magenta | cyan | white", description=( "Describes the color representation for the metric. This is often used " "to aid clinicians to track and identify parameter types by color. In " "practice, consider a Patient Monitor that has ECG/HR and Pleth for " "example; the parameters are displayed in different characteristic " "colors, such as HR-blue, BP-green, and PR and SpO2- magenta." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white", ], }, ) color__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_color", title="Extension field for ``color``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Instance identifier", description=( "Unique instance identifiers assigned to a device by the device or " "gateway software, manufacturers, other organizations or owners. For " "example: handle ID." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) measurementPeriod: fhirtypes.TimingType | None = Field( default=None, alias="measurementPeriod", title="Describes the measurement repetition time", description=( "Describes the measurement repetition time. This is not necessarily the" " same as the update period. The measurement repetition time can range " "from milliseconds up to hours. An example for a measurement repetition" " time in the range of milliseconds is the sampling rate of an ECG. An " "example for a measurement repetition time in the range of hours is a " "NIBP that is triggered automatically every hour. The update period may" " be different than the measurement repetition time, if the device does" " not update the published observed value with the same frequency as it" " was measured." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) operationalStatus: fhirtypes.CodeType | None = Field( default=None, alias="operationalStatus", title="on | off | standby | entered-in-error", description=( "Indicates current operational state of the device. For example: On, " "Off, Standby, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["on", "off", "standby", "entered-in-error"], }, ) operationalStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_operationalStatus", title="Extension field for ``operationalStatus``.", ) parent: fhirtypes.ReferenceType | None = Field( default=None, alias="parent", title="Describes the link to the parent Device", description=( "Describes the link to the Device that this DeviceMetric belongs to " "and that provide information about the location of this DeviceMetric " "in the containment structure of the parent Device. An example would be" " a Device that represents a Channel. This reference can be used by a " "client application to distinguish DeviceMetrics that have the same " "type, but should be interpreted based on their containment location." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) source: fhirtypes.ReferenceType | None = Field( default=None, alias="source", title="Describes the link to the source Device", description=( "Describes the link to the Device that this DeviceMetric belongs to " "and that contains administrative device information such as " "manufacturer, serial number, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Identity of metric, for example Heart Rate or PEEP Setting", description=( "Describes the type of the metric. For example: Heart Rate, PEEP " "Setting, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) unit: fhirtypes.CodeableConceptType | None = Field( default=None, alias="unit", title="Unit of Measure for the Metric", description=( "Describes the unit that an observed value determined for this metric " "will have. For example: Percent, Seconds, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceMetric`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "type", "unit", "source", "parent", "operationalStatus", "color", "category", "measurementPeriod", "calibration", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceMetric`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "type", "unit", "source", "parent", "operationalStatus", "color", "category", "measurementPeriod", "calibration", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("category", "category__ext")] return required_fields class DeviceMetricCalibration(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Describes the calibrations that have been performed or that are required to be performed. """ __resource_type__ = "DeviceMetricCalibration" state: fhirtypes.CodeType | None = Field( default=None, alias="state", title="not-calibrated | calibration-required | calibrated | unspecified", description="Describes the state of the calibration.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "not-calibrated", "calibration-required", "calibrated", "unspecified", ], }, ) state__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_state", title="Extension field for ``state``." ) time: fhirtypes.InstantType | None = Field( default=None, alias="time", title="Describes the time last calibration has been performed", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) time__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_time", title="Extension field for ``time``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="unspecified | offset | gain | two-point", description="Describes the type of the calibration method.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["unspecified", "offset", "gain", "two-point"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceMetricCalibration`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "state", "time"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceMetricCalibration`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "state", "time"] ================================================ FILE: fhir/resources/R4B/devicerequest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DeviceRequest Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class DeviceRequest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Medical device request. Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker. """ __resource_type__ = "DeviceRequest" authoredOn: fhirtypes.DateTimeType | None = Field( default=None, alias="authoredOn", title="When recorded", description="When the request transitioned to being actionable.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoredOn", title="Extension field for ``authoredOn``." ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="What request fulfills", description="Plan/proposal/order fulfilled by this request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) codeCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="codeCodeableConcept", title="Device requested", description="The details of the device to be used.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e code[x] "one_of_many": "code", "one_of_many_required": True, }, ) codeReference: fhirtypes.ReferenceType | None = Field( default=None, alias="codeReference", title="Device requested", description="The details of the device to be used.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e code[x] "one_of_many": "code", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter motivating request", description=( "An encounter that provides additional context in which this request is" " made." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) groupIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="groupIdentifier", title="Identifier of composite request", description="Composite request this is part of.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Request identifier", description="Identifiers assigned to this order by the orderer or by the receiver.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="instantiatesCanonical", title="Instantiates FHIR protocol or definition", description=( "The URL pointing to a FHIR-defined protocol, guideline, orderset or " "other definition that is adhered to in whole or in part by this " "DeviceRequest." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ActivityDefinition", "PlanDefinition"], }, ) instantiatesCanonical__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="instantiatesUri", title="Instantiates external protocol or definition", description=( "The URL pointing to an externally maintained protocol, guideline, " "orderset or other definition that is adhered to in whole or in part by" " this DeviceRequest." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) insurance: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="insurance", title="Associated insurance coverage", description=( "Insurance plans, coverage extensions, pre-authorizations and/or pre-" "determinations that may be required for delivering the requested " "service." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage", "ClaimResponse"], }, ) intent: fhirtypes.CodeType | None = Field( default=None, alias="intent", title=( "proposal | plan | directive | order | original-order | reflex-order | " "filler-order | instance-order | option" ), description=( "Whether the request is a proposal, plan, an original order or a reflex" " order." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "proposal", "plan", "directive", "order", "original-order", "reflex-order", "filler-order", "instance-order", "option", ], }, ) intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intent", title="Extension field for ``intent``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Notes or comments", description=( "Details about this request that were not represented at all or " "sufficiently in one of the attributes provided in a class. These may " "include for example a comment, an instruction, or a note associated " "with the statement." ), json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="Desired time or schedule for use", description=( "The timing schedule for the use of the device. The Schedule data type " 'allows many different expressions, for example. "Every 8 hours"; ' '"Three times a day"; "1/2 an hour before breakfast for 10 days from ' '23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="Desired time or schedule for use", description=( "The timing schedule for the use of the device. The Schedule data type " 'allows many different expressions, for example. "Every 8 hours"; ' '"Three times a day"; "1/2 an hour before breakfast for 10 days from ' '23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceTiming: fhirtypes.TimingType | None = Field( default=None, alias="occurrenceTiming", title="Desired time or schedule for use", description=( "The timing schedule for the use of the device. The Schedule data type " 'allows many different expressions, for example. "Every 8 hours"; ' '"Three times a day"; "1/2 an hour before breakfast for 10 days from ' '23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) parameter: typing.List[fhirtypes.DeviceRequestParameterType] | None = Field( default=None, alias="parameter", title="Device details", description=( "Specific parameters for the ordered item. For example, the prism " "value for lenses." ), json_schema_extra={ "element_property": True, }, ) performer: fhirtypes.ReferenceType | None = Field( default=None, alias="performer", title="Requested Filler", description="The desired performer for doing the diagnostic testing.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", "HealthcareService", "Patient", "Device", "RelatedPerson", ], }, ) performerType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="performerType", title="Filler role", description="Desired type of performer for doing the diagnostic testing.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) priorRequest: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="priorRequest", title="What request replaces", description=( "The request takes the place of the referenced completed or terminated " "request(s)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Indicates how quickly the {{title}} should be addressed with respect " "to other requests." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Coded Reason for request", description="Reason or justification for the use of this device.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Linked Reason for request", description="Reason or justification for the use of this device.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "DiagnosticReport", "DocumentReference", ], }, ) relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="relevantHistory", title="Request provenance", description="Key events in the history of the request.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Provenance"], }, ) requester: fhirtypes.ReferenceType | None = Field( default=None, alias="requester", title="Who/what is requesting diagnostics", description=( "The individual who initiated the request and has responsibility for " "its activation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Practitioner", "PractitionerRole", "Organization", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "draft | active | on-hold | revoked | completed | entered-in-error | " "unknown" ), description="The status of the request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "draft", "active", "on-hold", "revoked", "completed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Focus of request", description="The patient who will use the device.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group", "Location", "Device"], }, ) supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInfo", title="Additional clinical information", description=( "Additional clinical information about the patient that may influence " "the request fulfilment. For example, this may include where on the " "subject's body the device will be used (i.e. the target site)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "priorRequest", "groupIdentifier", "status", "intent", "priority", "codeReference", "codeCodeableConcept", "parameter", "subject", "encounter", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "authoredOn", "requester", "performerType", "performer", "reasonCode", "reasonReference", "insurance", "supportingInfo", "note", "relevantHistory", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "priorRequest", "groupIdentifier", "status", "intent", "priority", "codeReference", "codeCodeableConcept", "subject", "encounter", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "authoredOn", "requester", "performerType", "performer", "reasonCode", "reasonReference", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("intent", "intent__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "code": ["codeCodeableConcept", "codeReference"], "occurrence": [ "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", ], } return one_of_many_fields class DeviceRequestParameter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Device details. Specific parameters for the ordered item. For example, the prism value for lenses. """ __resource_type__ = "DeviceRequestParameter" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Device detail", description="A code or string that identifies the device detail being asserted.", json_schema_extra={ "element_property": True, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value of detail", description="The value of the device detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Value of detail", description="The value of the device detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Value of detail", description="The value of the device detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Value of detail", description="The value of the device detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceRequestParameter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "valueCodeableConcept", "valueQuantity", "valueRange", "valueBoolean", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceRequestParameter`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueCodeableConcept", "valueQuantity", "valueRange", ] } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/deviceusestatement.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DeviceUseStatement Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class DeviceUseStatement(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Record of use of a device. A record of a device being used by a patient where the record is the result of a report from the patient or another clinician. """ __resource_type__ = "DeviceUseStatement" basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Fulfills plan, proposal or order", description=( "A plan, proposal or order that is fulfilled in whole or in part by " "this DeviceUseStatement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ServiceRequest"], }, ) bodySite: fhirtypes.CodeableConceptType | None = Field( default=None, alias="bodySite", title="Target body site", description=( "Indicates the anotomic location on the subject's body where the device" " was used ( i.e. the target)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) derivedFrom: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="derivedFrom", title="Supporting information", description=( "Allows linking the DeviceUseStatement to the underlying Request, or to" " other information that supports or is used to derive the " "DeviceUseStatement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "ServiceRequest", "Procedure", "Claim", "Observation", "QuestionnaireResponse", "DocumentReference", ], }, ) device: fhirtypes.ReferenceType = Field( default=..., alias="device", title="Reference to device used", description="The details of the device used.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External identifier for this record", description="An external identifier for this statement such as an IRI.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Addition details (comments, instructions)", description=( "Details about the device statement that were not represented at all or" " sufficiently in one of the attributes provided in a class. These may " "include for example a comment, an instruction, or a note associated " "with the statement." ), json_schema_extra={ "element_property": True, }, ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Why device was used", description="Reason or justification for the use of the device.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Why was DeviceUseStatement performed?", description=( "Indicates another resource whose existence justifies this " "DeviceUseStatement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "DiagnosticReport", "DocumentReference", "Media", ], }, ) recordedOn: fhirtypes.DateTimeType | None = Field( default=None, alias="recordedOn", title="When statement was recorded", description="The time at which the statement was made/recorded.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) recordedOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recordedOn", title="Extension field for ``recordedOn``." ) source: fhirtypes.ReferenceType | None = Field( default=None, alias="source", title="Who made the statement", description="Who reported the device was being used by the patient.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | completed | entered-in-error +", description=( "A code representing the patient or other source's judgment about the " "state of the device used that this statement is about. Generally this" " will be active or completed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "completed", "entered-in-error", "+"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Patient using device", description="The patient who used the device.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) timingDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="timingDateTime", title="How often the device was used", description="How often the device was used.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timingDateTime", title="Extension field for ``timingDateTime``.", ) timingPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="timingPeriod", title="How often the device was used", description="How often the device was used.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingTiming: fhirtypes.TimingType | None = Field( default=None, alias="timingTiming", title="How often the device was used", description="How often the device was used.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceUseStatement`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "status", "subject", "derivedFrom", "timingTiming", "timingPeriod", "timingDateTime", "recordedOn", "source", "device", "reasonCode", "reasonReference", "bodySite", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceUseStatement`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "basedOn", "status", "subject", "derivedFrom", "timingTiming", "timingPeriod", "timingDateTime", "recordedOn", "source", "device", "reasonCode", "reasonReference", "bodySite", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "timing": ["timingDateTime", "timingPeriod", "timingTiming"] } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/diagnosticreport.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DiagnosticReport Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class DiagnosticReport(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A Diagnostic report - a combination of request information, atomic results, images, interpretation, as well as formatted reports. The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports. """ __resource_type__ = "DiagnosticReport" basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="What was requested", description="Details concerning a service requested.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CarePlan", "ImmunizationRecommendation", "MedicationRequest", "NutritionOrder", "ServiceRequest", ], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Service category", description=( "A code that classifies the clinical discipline, department or " "diagnostic service that created the report (e.g. cardiology, " "biochemistry, hematology, MRI). This is used for searching, sorting " "and display purposes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Name/Code for this diagnostic report", description="A code or name that describes this diagnostic report.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) conclusion: fhirtypes.StringType | None = Field( default=None, alias="conclusion", title="Clinical conclusion (interpretation) of test results", description=( "Concise and clinically contextualized summary conclusion " "(interpretation/impression) of the diagnostic report." ), json_schema_extra={ "element_property": True, }, ) conclusion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_conclusion", title="Extension field for ``conclusion``." ) conclusionCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="conclusionCode", title="Codes for the clinical conclusion of test results", description=( "One or more codes that represent the summary conclusion " "(interpretation/impression) of the diagnostic report." ), json_schema_extra={ "element_property": True, }, ) effectiveDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="effectiveDateTime", title="Clinically relevant time/time-period for report", description=( "The time or time-period the observed values are related to. When the " "subject of the report is a patient, this is usually either the time of" " the procedure or of specimen collection(s), but very often the source" " of the date/time is not known, only the date/time itself." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_effectiveDateTime", title="Extension field for ``effectiveDateTime``.", ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="Clinically relevant time/time-period for report", description=( "The time or time-period the observed values are related to. When the " "subject of the report is a patient, this is usually either the time of" " the procedure or of specimen collection(s), but very often the source" " of the date/time is not known, only the date/time itself." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Health care event when test ordered", description=( "The healthcare event (e.g. a patient and healthcare provider " "interaction) which this DiagnosticReport is about." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier for report", description="Identifiers assigned to this report by the performer or other systems.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) imagingStudy: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="imagingStudy", title=( "Reference to full details of imaging associated with the diagnostic " "report" ), description=( "One or more links to full details of any imaging performed during the " "diagnostic investigation. Typically, this is imaging performed by " "DICOM enabled modalities, but this is not required. A fully enabled " "PACS viewer can use this information to provide views of the source " "images." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ImagingStudy"], }, ) issued: fhirtypes.InstantType | None = Field( default=None, alias="issued", title="DateTime this version was made", description=( "The date and time that this version of the report was made available " "to providers, typically after the report was reviewed and verified." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issued", title="Extension field for ``issued``." ) media: typing.List[fhirtypes.DiagnosticReportMediaType] | None = Field( default=None, alias="media", title="Key images associated with this report", description=( "A list of key images associated with this report. The images are " "generally created during the diagnostic process, and may be directly " "of the patient, or of treated specimens (i.e. slides of interest)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) performer: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="performer", title="Responsible Diagnostic Service", description="The diagnostic service that is responsible for issuing the report.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", ], }, ) presentedForm: typing.List[fhirtypes.AttachmentType] | None = Field( default=None, alias="presentedForm", title="Entire report as issued", description=( "Rich text representation of the entire result as issued by the " "diagnostic service. Multiple formats are allowed but they SHALL be " "semantically equivalent." ), json_schema_extra={ "element_property": True, }, ) result: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="result", title="Observations", description=( "[Observations](observation.html) that are part of this diagnostic " "report." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Observation"], }, ) resultsInterpreter: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="resultsInterpreter", title="Primary result interpreter", description=( "The practitioner or organization that is responsible for the report's " "conclusions and interpretations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", ], }, ) specimen: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="specimen", title="Specimens this report is based on", description="Details about the specimens on which this diagnostic report is based.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Specimen"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="registered | partial | preliminary | final +", description="The status of the diagnostic report.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["registered", "partial", "preliminary", "final", "+"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="The subject of the report - usually, but not always, the patient", description=( "The subject of the report. Usually, but not always, this is a patient." " However, diagnostic services also perform analyses on specimens " "collected from a variety of other sources." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Group", "Device", "Location", "Organization", "Procedure", "Practitioner", "Medication", "Substance", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DiagnosticReport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "status", "category", "code", "subject", "encounter", "effectiveDateTime", "effectivePeriod", "issued", "performer", "resultsInterpreter", "specimen", "result", "imagingStudy", "media", "conclusion", "conclusionCode", "presentedForm", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DiagnosticReport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "category", "code", "subject", "encounter", "effectiveDateTime", "effectivePeriod", "issued", "performer", "resultsInterpreter", "media", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"effective": ["effectiveDateTime", "effectivePeriod"]} return one_of_many_fields class DiagnosticReportMedia(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Key images associated with this report. A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest). """ __resource_type__ = "DiagnosticReportMedia" comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Comment about the image (e.g. explanation)", description=( "A comment about the image. Typically, this is used to provide an " "explanation for why the image is included, or to draw the viewer's " "attention to important features." ), json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) link: fhirtypes.ReferenceType = Field( default=..., alias="link", title="Reference to the image source", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Media"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DiagnosticReportMedia`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "comment", "link"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DiagnosticReportMedia`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "link"] ================================================ FILE: fhir/resources/R4B/distance.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Distance Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from . import quantity class Distance(quantity.Quantity): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A length - a value with a unit that is a physical distance. """ __resource_type__ = "Distance" @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Distance`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "value", "comparator", "unit", "system", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Distance`` according to specification, with preserving the original sequence order. """ return ["value", "comparator", "unit", "system", "code"] ================================================ FILE: fhir/resources/R4B/documentmanifest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DocumentManifest Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class DocumentManifest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A list that defines a set of documents. A collection of documents compiled for a purpose together with metadata that applies to the collection. """ __resource_type__ = "DocumentManifest" author: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="author", title="Who and/or what authored the DocumentManifest", description=( "Identifies who is the author of the manifest. Manifest author is not " "necessarly the author of the references included." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Device", "Patient", "RelatedPerson", ], }, ) content: typing.List[fhirtypes.ReferenceType] = Field( default=..., alias="content", title="Items in manifest", description="The list of Resources that consist of the parts of this manifest.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="When this document manifest created", description=( "When the document manifest was created for submission to the server " "(not necessarily the same thing as the actual resource last modified " "time, since it may be modified, replicated, etc.)." ), json_schema_extra={ "element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Human-readable description (title)", description=( "Human-readable description of the source document. This is sometimes " 'known as the "title".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Other identifiers for the manifest", description=( "Other identifiers associated with the document manifest, including " "version independent identifiers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) masterIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="masterIdentifier", title="Unique Identifier for the set of documents", description=( "A single identifier that uniquely identifies this manifest. " "Principally used to refer to the manifest in non-FHIR contexts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) recipient: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="recipient", title="Intended to get notified about this set of documents", description=( "A patient, practitioner, or organization for which this set of " "documents is intended." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Organization", ], }, ) related: typing.List[fhirtypes.DocumentManifestRelatedType] | None = Field( default=None, alias="related", title="Related things", description="Related identifiers or resources associated with the DocumentManifest.", json_schema_extra={ "element_property": True, }, ) source: fhirtypes.UriType | None = Field( default=None, alias="source", title="The source system/application/software", description=( "Identifies the source system, application, or software that produced " "the document manifest." ), json_schema_extra={ "element_property": True, }, ) source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_source", title="Extension field for ``source``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="current | superseded | entered-in-error", description="The status of this document manifest.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["current", "superseded", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="The subject of the set of documents", description=( "Who or what the set of documents is about. The documents can be about " "a person, (patient or healthcare practitioner), a device (i.e. " "machine) or even a group of subjects (such as a document about a herd " "of farm animals, or a set of patients that share a common exposure). " "If the documents cross more than one subject, then more than one " "subject is allowed here (unusual use case)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Practitioner", "Group", "Device"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Kind of document set", description=( "The code specifying the type of clinical activity that resulted in " "placing the associated content into the DocumentManifest." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DocumentManifest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "masterIdentifier", "identifier", "status", "type", "subject", "created", "author", "recipient", "source", "description", "content", "related", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DocumentManifest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "masterIdentifier", "identifier", "status", "type", "subject", "author", "description", "content", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class DocumentManifestRelated(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Related things. Related identifiers or resources associated with the DocumentManifest. """ __resource_type__ = "DocumentManifestRelated" identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Identifiers of things that are related", description=( "Related identifier to this DocumentManifest. For example, Order " "numbers, accession numbers, XDW workflow numbers." ), json_schema_extra={ "element_property": True, }, ) ref: fhirtypes.ReferenceType | None = Field( default=None, alias="ref", title="Related Resource", description=( "Related Resource to this DocumentManifest. For example, Order, " "ServiceRequest, Procedure, EligibilityRequest, etc." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DocumentManifestRelated`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "identifier", "ref"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DocumentManifestRelated`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/documentreference.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DocumentReference Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class DocumentReference(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A reference to a document. A reference to a document of any kind for any purpose. Provides metadata about the document so that the document can be discovered and managed. The scope of a document is any seralized object with a mime-type, so includes formal patient centric documents (CDA), cliical notes, scanned paper, and non-patient specific documents like policy text. """ __resource_type__ = "DocumentReference" authenticator: fhirtypes.ReferenceType | None = Field( default=None, alias="authenticator", title="Who/what authenticated the document", description=( "Which person or organization authenticates that this document is " "valid." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) author: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="author", title="Who and/or what authored the document", description=( "Identifies who is responsible for adding the information to the " "document." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Device", "Patient", "RelatedPerson", ], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Categorization of document", description=( "A categorization for the type of document referenced - helps for " "indexing and searching. This may be implied by or derived from the " "code specified in the DocumentReference.type." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) content: typing.List[fhirtypes.DocumentReferenceContentType] = Field( default=..., alias="content", title="Document referenced", description=( "The document and format referenced. There may be multiple content " "element repetitions, each with a different format." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) context: fhirtypes.DocumentReferenceContextType | None = Field( default=None, alias="context", title="Clinical context of document", description="The clinical context in which the document was prepared.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) custodian: fhirtypes.ReferenceType | None = Field( default=None, alias="custodian", title="Organization which maintains the document", description=( "Identifies the organization or group who is responsible for ongoing " "maintenance of and access to the document." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) date: fhirtypes.InstantType | None = Field( default=None, alias="date", title="When this document reference was created", description="When the document reference was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Human-readable description", description="Human-readable description of the source document.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) docStatus: fhirtypes.CodeType | None = Field( default=None, alias="docStatus", title="preliminary | final | amended | entered-in-error", description="The status of the underlying document.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["preliminary", "final", "amended", "entered-in-error"], }, ) docStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_docStatus", title="Extension field for ``docStatus``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Other identifiers for the document", description=( "Other identifiers associated with the document, including version " "independent identifiers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) masterIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="masterIdentifier", title="Master Version Specific Identifier", description=( "Document identifier as assigned by the source of the document. This " "identifier is specific to this version of the document. This unique " "identifier may be used elsewhere to identify this version of the " "document." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) relatesTo: typing.List[fhirtypes.DocumentReferenceRelatesToType] | None = Field( default=None, alias="relatesTo", title="Relationships to other documents", description=( "Relationships that this document has with other document references " "that already exist." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) securityLabel: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="securityLabel", title="Document security-tags", description=( "A set of Security-Tag codes specifying the level of privacy/security " "of the Document. Note that DocumentReference.meta.security contains " 'the security labels of the "reference" to the document, while ' "DocumentReference.securityLabel contains a snapshot of the security " "labels on the document the reference refers to." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="current | superseded | entered-in-error", description="The status of this document reference.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["current", "superseded", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Who/what is the subject of the document", description=( "Who or what the document is about. The document can be about a person," " (patient or healthcare practitioner), a device (e.g. a machine) or " "even a group of subjects (such as a document about a herd of farm " "animals, or a set of patients that share a common exposure)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Practitioner", "Group", "Device"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Kind of document (LOINC if possible)", description=( "Specifies the particular kind of document referenced (e.g. History " "and Physical, Discharge Summary, Progress Note). This usually equates " "to the purpose of making the document referenced." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DocumentReference`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "masterIdentifier", "identifier", "status", "docStatus", "type", "category", "subject", "date", "author", "authenticator", "custodian", "relatesTo", "description", "securityLabel", "content", "context", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DocumentReference`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "masterIdentifier", "identifier", "status", "docStatus", "type", "category", "subject", "date", "author", "relatesTo", "description", "securityLabel", "content", "context", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class DocumentReferenceContent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Document referenced. The document and format referenced. There may be multiple content element repetitions, each with a different format. """ __resource_type__ = "DocumentReferenceContent" attachment: fhirtypes.AttachmentType = Field( default=..., alias="attachment", title="Where to access the document", description=( "The document or URL of the document along with critical metadata to " "prove content has integrity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) format: fhirtypes.CodingType | None = Field( default=None, alias="format", title="Format/content rules for the document", description=( "An identifier of the document encoding, structure, and template that " "the document conforms to beyond the base format indicated in the " "mimeType." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DocumentReferenceContent`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "attachment", "format"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DocumentReferenceContent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "attachment", "format"] class DocumentReferenceContext(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Clinical context of document. The clinical context in which the document was prepared. """ __resource_type__ = "DocumentReferenceContext" encounter: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="encounter", title="Context of the document content", description=( "Describes the clinical encounter or type of care that the document " "content is associated with." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) event: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="event", title="Main clinical acts documented", description=( "This list of codes represents the main clinical acts, such as a " "colonoscopy or an appendectomy, being documented. In some cases, the " 'event is inherent in the type Code, such as a "History and Physical ' 'Report" in which the procedure being documented is necessarily a ' '"History and Physical" act.' ), json_schema_extra={ "element_property": True, }, ) facilityType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="facilityType", title="Kind of facility where patient was seen", description="The kind of facility where the patient was seen.", json_schema_extra={ "element_property": True, }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time of service that is being documented", description=( "The time period over which the service that is described by the " "document was provided." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) practiceSetting: fhirtypes.CodeableConceptType | None = Field( default=None, alias="practiceSetting", title=( "Additional details about where the content was created (e.g. clinical " "specialty)" ), description=( "This property may convey specifics about the practice setting where " "the content was created, often reflecting the clinical specialty." ), json_schema_extra={ "element_property": True, }, ) related: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="related", title="Related identifiers or resources", description=( "Related identifiers or resources associated with the " "DocumentReference." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) sourcePatientInfo: fhirtypes.ReferenceType | None = Field( default=None, alias="sourcePatientInfo", title="Patient demographics from source", description=( "The Patient Information as known when the document was published. May " "be a reference to a version specific, or contained." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DocumentReferenceContext`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "encounter", "event", "period", "facilityType", "practiceSetting", "sourcePatientInfo", "related", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DocumentReferenceContext`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "period"] class DocumentReferenceRelatesTo(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Relationships to other documents. Relationships that this document has with other document references that already exist. """ __resource_type__ = "DocumentReferenceRelatesTo" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="replaces | transforms | signs | appends", description="The type of relationship that this document has with anther document.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["replaces", "transforms", "signs", "appends"], }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) target: fhirtypes.ReferenceType = Field( default=..., alias="target", title="Target of the relationship", description="The target document of this relationship.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DocumentReferenceRelatesTo`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "target"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DocumentReferenceRelatesTo`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "target"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/domainresource.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DomainResource Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import fhirtypes, resource class DomainResource(resource.Resource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A resource with narrative, extensions, and contained resources. A resource that includes narrative, extensions, and contained resources. """ __resource_type__ = "DomainResource" contained: typing.List[fhirtypes.ResourceType] | None = Field( default=None, alias="contained", title="Contained, inline Resources", description=( "These resources do not have an independent existence apart from the " "resource that contains them - they cannot be identified independently," " and nor can they have their own independent transaction scope." ), json_schema_extra={ "element_property": True, }, ) extension: typing.List[fhirtypes.ExtensionType] | None = Field( default=None, alias="extension", title="Additional content defined by implementations", description=( "May be used to represent additional information that is not part of " "the basic definition of the resource. To make the use of extensions " "safe and manageable, there is a strict set of governance applied to " "the definition and use of extensions. Though any implementer can " "define an extension, there is a set of requirements that SHALL be met " "as part of the definition of the extension." ), json_schema_extra={ "element_property": True, }, ) modifierExtension: typing.List[fhirtypes.ExtensionType] | None = Field( default=None, alias="modifierExtension", title="Extensions that cannot be ignored", description=( "May be used to represent additional information that is not part of " "the basic definition of the resource and that modifies the " "understanding of the element that contains it and/or the understanding" " of the containing element's descendants. Usually modifier elements " "provide negation or qualification. To make the use of extensions safe " "and manageable, there is a strict set of governance applied to the " "definition and use of extensions. Though any implementer is allowed to" " define an extension, there is a set of requirements that SHALL be met" " as part of the definition of the extension. Applications processing a" " resource are required to check for modifier extensions. Modifier " "extensions SHALL NOT change the meaning of any elements on Resource or" " DomainResource (including cannot change the meaning of " "modifierExtension itself)." ), json_schema_extra={ "element_property": True, }, ) text: fhirtypes.NarrativeType | None = Field( default=None, alias="text", title="Text summary of the resource, for human interpretation", description=( "A human-readable narrative that contains a summary of the resource and" " can be used to represent the content of the resource to a human. The " "narrative need not encode all the structured data, but is required to " 'contain sufficient detail to make it "clinically safe" for a human to ' "just read the narrative. Resource definitions may define what content " "should be represented in the narrative to ensure clinical safety." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DomainResource`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DomainResource`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules"] ================================================ FILE: fhir/resources/R4B/dosage.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Dosage Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, element, fhirtypes class Dosage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. How the medication is/was taken or should be taken. Indicates how the medication is/was taken or should be taken by the patient. """ __resource_type__ = "Dosage" additionalInstruction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="additionalInstruction", title=( 'Supplemental instruction or warnings to the patient - e.g. "with ' 'meals", "may cause drowsiness"' ), description=( "Supplemental instructions to the patient on how to take the medication" ' (e.g. "with meals" or"take half to one hour before food") or ' 'warnings for the patient about the medication (e.g. "may cause ' 'drowsiness" or "avoid exposure of skin to direct sunlight or ' 'sunlamps").' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) asNeededBoolean: bool | None = Field( default=None, alias="asNeededBoolean", title='Take "as needed" (for x)', description=( "Indicates whether the Medication is only taken when needed within a " "specific dosing schedule (Boolean option), or it indicates the " "precondition for taking the Medication (CodeableConcept)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e asNeeded[x] "one_of_many": "asNeeded", "one_of_many_required": False, }, ) asNeededBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_asNeededBoolean", title="Extension field for ``asNeededBoolean``.", ) asNeededCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="asNeededCodeableConcept", title='Take "as needed" (for x)', description=( "Indicates whether the Medication is only taken when needed within a " "specific dosing schedule (Boolean option), or it indicates the " "precondition for taking the Medication (CodeableConcept)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e asNeeded[x] "one_of_many": "asNeeded", "one_of_many_required": False, }, ) doseAndRate: typing.List[fhirtypes.DosageDoseAndRateType] | None = Field( default=None, alias="doseAndRate", title="Amount of medication administered", description="The amount of medication administered.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maxDosePerAdministration: fhirtypes.QuantityType | None = Field( default=None, alias="maxDosePerAdministration", title="Upper limit on medication per administration", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maxDosePerLifetime: fhirtypes.QuantityType | None = Field( default=None, alias="maxDosePerLifetime", title="Upper limit on medication per lifetime of the patient", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maxDosePerPeriod: fhirtypes.RatioType | None = Field( default=None, alias="maxDosePerPeriod", title="Upper limit on medication per unit of time", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="Technique for administering medication", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patientInstruction: fhirtypes.StringType | None = Field( default=None, alias="patientInstruction", title="Patient or consumer oriented instructions", description="Instructions in terms that are understood by the patient or consumer.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patientInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patientInstruction", title="Extension field for ``patientInstruction``.", ) route: fhirtypes.CodeableConceptType | None = Field( default=None, alias="route", title="How drug should enter body", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sequence: fhirtypes.IntegerType | None = Field( default=None, alias="sequence", title="The order of the dosage instructions", description=( "Indicates the order in which the dosage instructions should be applied" " or interpreted." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) site: fhirtypes.CodeableConceptType | None = Field( default=None, alias="site", title="Body site to administer to", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Free text dosage instructions e.g. SIG", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) timing: fhirtypes.TimingType | None = Field( default=None, alias="timing", title="When medication should be administered", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Dosage`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "text", "additionalInstruction", "patientInstruction", "timing", "asNeededBoolean", "asNeededCodeableConcept", "site", "route", "method", "doseAndRate", "maxDosePerPeriod", "maxDosePerAdministration", "maxDosePerLifetime", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Dosage`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "sequence", "text", "additionalInstruction", "patientInstruction", "timing", "asNeededBoolean", "asNeededCodeableConcept", "site", "route", "method", "doseAndRate", "maxDosePerPeriod", "maxDosePerAdministration", "maxDosePerLifetime", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "asNeeded": ["asNeededBoolean", "asNeededCodeableConcept"] } return one_of_many_fields class DosageDoseAndRate(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Amount of medication administered. The amount of medication administered. """ __resource_type__ = "DosageDoseAndRate" doseQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="doseQuantity", title="Amount of medication per dose", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e dose[x] "one_of_many": "dose", "one_of_many_required": False, }, ) doseRange: fhirtypes.RangeType | None = Field( default=None, alias="doseRange", title="Amount of medication per dose", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e dose[x] "one_of_many": "dose", "one_of_many_required": False, }, ) rateQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="rateQuantity", title="Amount of medication per unit of time", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e rate[x] "one_of_many": "rate", "one_of_many_required": False, }, ) rateRange: fhirtypes.RangeType | None = Field( default=None, alias="rateRange", title="Amount of medication per unit of time", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e rate[x] "one_of_many": "rate", "one_of_many_required": False, }, ) rateRatio: fhirtypes.RatioType | None = Field( default=None, alias="rateRatio", title="Amount of medication per unit of time", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e rate[x] "one_of_many": "rate", "one_of_many_required": False, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The kind of dose or rate specified", description=( "The kind of dose or rate specified, for example, ordered or " "calculated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DosageDoseAndRate`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "type", "doseRange", "doseQuantity", "rateRatio", "rateRange", "rateQuantity", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DosageDoseAndRate`` according to specification, with preserving the original sequence order. """ return [ "type", "doseRange", "doseQuantity", "rateRatio", "rateRange", "rateQuantity", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "dose": ["doseQuantity", "doseRange"], "rate": ["rateQuantity", "rateRange", "rateRatio"], } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/duration.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Duration Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from . import quantity class Duration(quantity.Quantity): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A length of time. """ __resource_type__ = "Duration" @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Duration`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "value", "comparator", "unit", "system", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Duration`` according to specification, with preserving the original sequence order. """ return ["value", "comparator", "unit", "system", "code"] ================================================ FILE: fhir/resources/R4B/element.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Element Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from fhir_core import fhirabstractmodel from pydantic import Field from . import fhirtypes class Element(fhirabstractmodel.FHIRAbstractModel): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Base for all elements. Base definition for all elements in a resource. """ __resource_type__ = "Element" extension: typing.List[fhirtypes.ExtensionType] | None = Field( default=None, alias="extension", title="Additional content defined by implementations", description=( "May be used to represent additional information that is not part of " "the basic definition of the element. To make the use of extensions " "safe and manageable, there is a strict set of governance applied to " "the definition and use of extensions. Though any implementer can " "define an extension, there is a set of requirements that SHALL be met " "as part of the definition of the extension." ), json_schema_extra={ "element_property": True, }, ) id: fhirtypes.StringType | None = Field( default=None, alias="id", title="Unique id for inter-element referencing", description=( "Unique id for the element within a resource (for internal references)." " This may be any string value that does not contain spaces." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Element`` according to specification, with preserving the original sequence order. """ return ["id", "extension"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Element`` according to specification, with preserving the original sequence order. """ return [] ================================================ FILE: fhir/resources/R4B/elementdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ElementDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, element, fhirtypes class ElementDefinition(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of an element in a resource or extension. Captures constraints on each element within the resource, profile, or extension. """ __resource_type__ = "ElementDefinition" alias: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="alias", title="Other names", description="Identifies additional names by which this element might also be known.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_alias", title="Extension field for ``alias``." ) base: fhirtypes.ElementDefinitionBaseType | None = Field( default=None, alias="base", title="Base definition information for tools", description=( "Information about the base definition of the element, provided to make" " it unnecessary for tools to trace the deviation of the element " "through the derived and related profiles. When the element definition " "is not the original definition of an element - i.g. either in a " "constraint on another type, or for elements from a super type in a " "snap shot - then the information in provided in the element definition" " may be different to the base definition. On the original definition " "of the element, it will be same." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) binding: fhirtypes.ElementDefinitionBindingType | None = Field( default=None, alias="binding", title="ValueSet details if this is coded", description=( "Binds to a value set if this element is coded (code, Coding, " "CodeableConcept, Quantity), or the data types (string, uri)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="code", title="Corresponding codes in terminologies", description=( "A code that has the same meaning as the element in a particular " "terminology." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comment: fhirtypes.MarkdownType | None = Field( default=None, alias="comment", title="Comments about the use of this element", description=( "Explanatory notes and implementation guidance about the data element, " "including notes about how to use the data properly, exceptions to " "proper use, etc. (Note: The text you are reading is specified in " "ElementDefinition.comment)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) condition: typing.List[fhirtypes.IdType | None] | None = Field( default=None, alias="condition", title="Reference to invariant about presence", description=( "A reference to an invariant that may make additional statements about " "the cardinality or value in the instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) condition__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_condition", title="Extension field for ``condition``." ) constraint: typing.List[fhirtypes.ElementDefinitionConstraintType] | None = Field( default=None, alias="constraint", title="Condition that must evaluate to true", description=( "Formal constraints such as co-occurrence and other constraints that " "can be computationally evaluated within the context of the instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contentReference: fhirtypes.UriType | None = Field( default=None, alias="contentReference", title="Reference to definition of content for the element", description=( "Identifies an element defined elsewhere in the definition whose " "content rules should be applied to the current element. " "ContentReferences bring across all the rules that are in the " "ElementDefinition for the element, including definitions, cardinality " "constraints, bindings, invariants etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contentReference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contentReference", title="Extension field for ``contentReference``.", ) defaultValueAddress: fhirtypes.AddressType | None = Field( default=None, alias="defaultValueAddress", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueAge: fhirtypes.AgeType | None = Field( default=None, alias="defaultValueAge", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="defaultValueAnnotation", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="defaultValueAttachment", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="defaultValueBase64Binary", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueBase64Binary", title="Extension field for ``defaultValueBase64Binary``.", ) defaultValueBoolean: bool | None = Field( default=None, alias="defaultValueBoolean", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueBoolean", title="Extension field for ``defaultValueBoolean``.", ) defaultValueCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="defaultValueCanonical", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueCanonical", title="Extension field for ``defaultValueCanonical``.", ) defaultValueCode: fhirtypes.CodeType | None = Field( default=None, alias="defaultValueCode", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueCode", title="Extension field for ``defaultValueCode``.", ) defaultValueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="defaultValueCodeableConcept", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueCodeableReference: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="defaultValueCodeableReference", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueCoding: fhirtypes.CodingType | None = Field( default=None, alias="defaultValueCoding", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueContactDetail: fhirtypes.ContactDetailType | None = Field( default=None, alias="defaultValueContactDetail", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="defaultValueContactPoint", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueContributor: fhirtypes.ContributorType | None = Field( default=None, alias="defaultValueContributor", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueCount: fhirtypes.CountType | None = Field( default=None, alias="defaultValueCount", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDataRequirement: fhirtypes.DataRequirementType | None = Field( default=None, alias="defaultValueDataRequirement", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDate: fhirtypes.DateType | None = Field( default=None, alias="defaultValueDate", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueDate", title="Extension field for ``defaultValueDate``.", ) defaultValueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="defaultValueDateTime", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueDateTime", title="Extension field for ``defaultValueDateTime``.", ) defaultValueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="defaultValueDecimal", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueDecimal", title="Extension field for ``defaultValueDecimal``.", ) defaultValueDistance: fhirtypes.DistanceType | None = Field( default=None, alias="defaultValueDistance", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDosage: fhirtypes.DosageType | None = Field( default=None, alias="defaultValueDosage", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDuration: fhirtypes.DurationType | None = Field( default=None, alias="defaultValueDuration", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueExpression: fhirtypes.ExpressionType | None = Field( default=None, alias="defaultValueExpression", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="defaultValueHumanName", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueId: fhirtypes.IdType | None = Field( default=None, alias="defaultValueId", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueId", title="Extension field for ``defaultValueId``.", ) defaultValueIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="defaultValueIdentifier", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueInstant: fhirtypes.InstantType | None = Field( default=None, alias="defaultValueInstant", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueInstant", title="Extension field for ``defaultValueInstant``.", ) defaultValueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="defaultValueInteger", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueInteger", title="Extension field for ``defaultValueInteger``.", ) defaultValueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="defaultValueMarkdown", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueMarkdown", title="Extension field for ``defaultValueMarkdown``.", ) defaultValueMoney: fhirtypes.MoneyType | None = Field( default=None, alias="defaultValueMoney", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueOid: fhirtypes.OidType | None = Field( default=None, alias="defaultValueOid", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueOid", title="Extension field for ``defaultValueOid``.", ) defaultValueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field( default=None, alias="defaultValueParameterDefinition", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="defaultValuePeriod", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="defaultValuePositiveInt", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValuePositiveInt", title="Extension field for ``defaultValuePositiveInt``.", ) defaultValueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="defaultValueQuantity", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueRange: fhirtypes.RangeType | None = Field( default=None, alias="defaultValueRange", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueRatio: fhirtypes.RatioType | None = Field( default=None, alias="defaultValueRatio", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueRatioRange: fhirtypes.RatioRangeType | None = Field( default=None, alias="defaultValueRatioRange", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="defaultValueReference", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field( default=None, alias="defaultValueRelatedArtifact", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="defaultValueSampledData", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueSignature: fhirtypes.SignatureType | None = Field( default=None, alias="defaultValueSignature", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueString: fhirtypes.StringType | None = Field( default=None, alias="defaultValueString", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueString", title="Extension field for ``defaultValueString``.", ) defaultValueTime: fhirtypes.TimeType | None = Field( default=None, alias="defaultValueTime", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueTime", title="Extension field for ``defaultValueTime``.", ) defaultValueTiming: fhirtypes.TimingType | None = Field( default=None, alias="defaultValueTiming", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field( default=None, alias="defaultValueTriggerDefinition", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="defaultValueUnsignedInt", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueUnsignedInt", title="Extension field for ``defaultValueUnsignedInt``.", ) defaultValueUri: fhirtypes.UriType | None = Field( default=None, alias="defaultValueUri", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueUri", title="Extension field for ``defaultValueUri``.", ) defaultValueUrl: fhirtypes.UrlType | None = Field( default=None, alias="defaultValueUrl", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueUrl", title="Extension field for ``defaultValueUrl``.", ) defaultValueUsageContext: fhirtypes.UsageContextType | None = Field( default=None, alias="defaultValueUsageContext", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueUuid: fhirtypes.UuidType | None = Field( default=None, alias="defaultValueUuid", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueUuid", title="Extension field for ``defaultValueUuid``.", ) definition: fhirtypes.MarkdownType | None = Field( default=None, alias="definition", title="Full formal definition as narrative text", description=( "Provides a complete explanation of the meaning of the data element for" " human readability. For the case of elements derived from existing " "elements (e.g. constraints), the definition SHALL be consistent with " "the base definition, but convey the meaning of the element in the " "particular context of use of the resource. (Note: The text you are " "reading is specified in ElementDefinition.definition)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) example: typing.List[fhirtypes.ElementDefinitionExampleType] | None = Field( default=None, alias="example", title="Example value (as defined for type)", description=( "A sample value for this element demonstrating the type of information " "that would typically be found in the element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) fixedAddress: fhirtypes.AddressType | None = Field( default=None, alias="fixedAddress", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedAge: fhirtypes.AgeType | None = Field( default=None, alias="fixedAge", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="fixedAnnotation", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="fixedAttachment", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="fixedBase64Binary", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedBase64Binary", title="Extension field for ``fixedBase64Binary``.", ) fixedBoolean: bool | None = Field( default=None, alias="fixedBoolean", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedBoolean", title="Extension field for ``fixedBoolean``.", ) fixedCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="fixedCanonical", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedCanonical", title="Extension field for ``fixedCanonical``.", ) fixedCode: fhirtypes.CodeType | None = Field( default=None, alias="fixedCode", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedCode", title="Extension field for ``fixedCode``." ) fixedCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="fixedCodeableConcept", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedCodeableReference: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="fixedCodeableReference", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedCoding: fhirtypes.CodingType | None = Field( default=None, alias="fixedCoding", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedContactDetail: fhirtypes.ContactDetailType | None = Field( default=None, alias="fixedContactDetail", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="fixedContactPoint", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedContributor: fhirtypes.ContributorType | None = Field( default=None, alias="fixedContributor", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedCount: fhirtypes.CountType | None = Field( default=None, alias="fixedCount", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedDataRequirement: fhirtypes.DataRequirementType | None = Field( default=None, alias="fixedDataRequirement", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedDate: fhirtypes.DateType | None = Field( default=None, alias="fixedDate", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedDate", title="Extension field for ``fixedDate``." ) fixedDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="fixedDateTime", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedDateTime", title="Extension field for ``fixedDateTime``.", ) fixedDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="fixedDecimal", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedDecimal", title="Extension field for ``fixedDecimal``.", ) fixedDistance: fhirtypes.DistanceType | None = Field( default=None, alias="fixedDistance", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedDosage: fhirtypes.DosageType | None = Field( default=None, alias="fixedDosage", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedDuration: fhirtypes.DurationType | None = Field( default=None, alias="fixedDuration", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedExpression: fhirtypes.ExpressionType | None = Field( default=None, alias="fixedExpression", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="fixedHumanName", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedId: fhirtypes.IdType | None = Field( default=None, alias="fixedId", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedId", title="Extension field for ``fixedId``." ) fixedIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="fixedIdentifier", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedInstant: fhirtypes.InstantType | None = Field( default=None, alias="fixedInstant", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedInstant", title="Extension field for ``fixedInstant``.", ) fixedInteger: fhirtypes.IntegerType | None = Field( default=None, alias="fixedInteger", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedInteger", title="Extension field for ``fixedInteger``.", ) fixedMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="fixedMarkdown", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedMarkdown", title="Extension field for ``fixedMarkdown``.", ) fixedMoney: fhirtypes.MoneyType | None = Field( default=None, alias="fixedMoney", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedOid: fhirtypes.OidType | None = Field( default=None, alias="fixedOid", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedOid", title="Extension field for ``fixedOid``." ) fixedParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field( default=None, alias="fixedParameterDefinition", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="fixedPeriod", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedPositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="fixedPositiveInt", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedPositiveInt", title="Extension field for ``fixedPositiveInt``.", ) fixedQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="fixedQuantity", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedRange: fhirtypes.RangeType | None = Field( default=None, alias="fixedRange", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedRatio: fhirtypes.RatioType | None = Field( default=None, alias="fixedRatio", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedRatioRange: fhirtypes.RatioRangeType | None = Field( default=None, alias="fixedRatioRange", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedReference: fhirtypes.ReferenceType | None = Field( default=None, alias="fixedReference", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field( default=None, alias="fixedRelatedArtifact", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="fixedSampledData", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedSignature: fhirtypes.SignatureType | None = Field( default=None, alias="fixedSignature", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedString: fhirtypes.StringType | None = Field( default=None, alias="fixedString", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedString", title="Extension field for ``fixedString``." ) fixedTime: fhirtypes.TimeType | None = Field( default=None, alias="fixedTime", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedTime", title="Extension field for ``fixedTime``." ) fixedTiming: fhirtypes.TimingType | None = Field( default=None, alias="fixedTiming", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field( default=None, alias="fixedTriggerDefinition", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="fixedUnsignedInt", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedUnsignedInt", title="Extension field for ``fixedUnsignedInt``.", ) fixedUri: fhirtypes.UriType | None = Field( default=None, alias="fixedUri", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedUri", title="Extension field for ``fixedUri``." ) fixedUrl: fhirtypes.UrlType | None = Field( default=None, alias="fixedUrl", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedUrl", title="Extension field for ``fixedUrl``." ) fixedUsageContext: fhirtypes.UsageContextType | None = Field( default=None, alias="fixedUsageContext", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedUuid: fhirtypes.UuidType | None = Field( default=None, alias="fixedUuid", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedUuid", title="Extension field for ``fixedUuid``." ) isModifier: bool | None = Field( default=None, alias="isModifier", title="If this modifies the meaning of other elements", description=( "If true, the value of this element affects the interpretation of the " "element or resource that contains it, and the value of the element " "cannot be ignored. Typically, this is used for status, negation and " "qualification codes. The effect of this is that the element cannot be " "ignored by systems: they SHALL either recognize the element and " "process it, and/or a pre-determination has been made that it is not " "relevant to their particular system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) isModifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isModifier", title="Extension field for ``isModifier``." ) isModifierReason: fhirtypes.StringType | None = Field( default=None, alias="isModifierReason", title="Reason that this element is marked as a modifier", description=( "Explains how that element affects the interpretation of the resource " "or element that contains it." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) isModifierReason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isModifierReason", title="Extension field for ``isModifierReason``.", ) isSummary: bool | None = Field( default=None, alias="isSummary", title="Include when _summary = true?", description=( "Whether the element should be included if a client requests a search " "with the parameter _summary=true." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) isSummary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isSummary", title="Extension field for ``isSummary``." ) label: fhirtypes.StringType | None = Field( default=None, alias="label", title="Name for element to display with or prompt for element", description=( "A single preferred label which is the text to display beside the " "element indicating its meaning or to use to prompt for the element in " "a user display or form." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_label", title="Extension field for ``label``." ) mapping: typing.List[fhirtypes.ElementDefinitionMappingType] | None = Field( default=None, alias="mapping", title="Map element to another set of definitions", description=( "Identifies a concept from an external specification that roughly " "corresponds to this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) max: fhirtypes.StringType | None = Field( default=None, alias="max", title="Maximum Cardinality (a number or *)", description=( "The maximum number of times this element is permitted to appear in the" " instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_max", title="Extension field for ``max``." ) maxLength: fhirtypes.IntegerType | None = Field( default=None, alias="maxLength", title="Max length for strings", description=( "Indicates the maximum length in characters that is permitted to be " "present in conformant instances and which is expected to be supported " "by conformant consumers that support the element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maxLength__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxLength", title="Extension field for ``maxLength``." ) maxValueDate: fhirtypes.DateType | None = Field( default=None, alias="maxValueDate", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValueDate", title="Extension field for ``maxValueDate``.", ) maxValueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="maxValueDateTime", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValueDateTime", title="Extension field for ``maxValueDateTime``.", ) maxValueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="maxValueDecimal", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValueDecimal", title="Extension field for ``maxValueDecimal``.", ) maxValueInstant: fhirtypes.InstantType | None = Field( default=None, alias="maxValueInstant", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValueInstant", title="Extension field for ``maxValueInstant``.", ) maxValueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="maxValueInteger", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValueInteger", title="Extension field for ``maxValueInteger``.", ) maxValuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="maxValuePositiveInt", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValuePositiveInt", title="Extension field for ``maxValuePositiveInt``.", ) maxValueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="maxValueQuantity", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueTime: fhirtypes.TimeType | None = Field( default=None, alias="maxValueTime", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValueTime", title="Extension field for ``maxValueTime``.", ) maxValueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="maxValueUnsignedInt", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValueUnsignedInt", title="Extension field for ``maxValueUnsignedInt``.", ) meaningWhenMissing: fhirtypes.MarkdownType | None = Field( default=None, alias="meaningWhenMissing", title="Implicit meaning when this element is missing", description=( "The Implicit meaning that is to be understood when this element is " "missing (e.g. 'when this element is missing, the period is ongoing')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) meaningWhenMissing__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_meaningWhenMissing", title="Extension field for ``meaningWhenMissing``.", ) min: fhirtypes.UnsignedIntType | None = Field( default=None, alias="min", title="Minimum Cardinality", description="The minimum number of times this element SHALL appear in the instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_min", title="Extension field for ``min``." ) minValueDate: fhirtypes.DateType | None = Field( default=None, alias="minValueDate", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValueDate", title="Extension field for ``minValueDate``.", ) minValueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="minValueDateTime", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValueDateTime", title="Extension field for ``minValueDateTime``.", ) minValueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="minValueDecimal", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValueDecimal", title="Extension field for ``minValueDecimal``.", ) minValueInstant: fhirtypes.InstantType | None = Field( default=None, alias="minValueInstant", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValueInstant", title="Extension field for ``minValueInstant``.", ) minValueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="minValueInteger", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValueInteger", title="Extension field for ``minValueInteger``.", ) minValuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="minValuePositiveInt", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValuePositiveInt", title="Extension field for ``minValuePositiveInt``.", ) minValueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="minValueQuantity", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueTime: fhirtypes.TimeType | None = Field( default=None, alias="minValueTime", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValueTime", title="Extension field for ``minValueTime``.", ) minValueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="minValueUnsignedInt", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValueUnsignedInt", title="Extension field for ``minValueUnsignedInt``.", ) mustSupport: bool | None = Field( default=None, alias="mustSupport", title="If the element must be supported", description=( "If true, implementations that produce or consume resources SHALL " 'provide "support" for the element in some meaningful way. If false, ' "the element may be ignored and not supported. If false, whether to " "populate or use the data element in any way is at the discretion of " "the implementation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) mustSupport__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mustSupport", title="Extension field for ``mustSupport``." ) orderMeaning: fhirtypes.StringType | None = Field( default=None, alias="orderMeaning", title="What the order of the elements means", description=( "If present, indicates that the order of the repeating element has " "meaning and describes what that meaning is. If absent, it means that " "the order of the element has no meaning." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) orderMeaning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_orderMeaning", title="Extension field for ``orderMeaning``.", ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="Path of the element in the hierarchy of elements", description=( 'The path identifies the element and is expressed as a "."-separated ' "list of ancestor elements, beginning with the name of the resource or " "extension." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) patternAddress: fhirtypes.AddressType | None = Field( default=None, alias="patternAddress", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternAge: fhirtypes.AgeType | None = Field( default=None, alias="patternAge", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="patternAnnotation", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="patternAttachment", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="patternBase64Binary", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternBase64Binary", title="Extension field for ``patternBase64Binary``.", ) patternBoolean: bool | None = Field( default=None, alias="patternBoolean", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternBoolean", title="Extension field for ``patternBoolean``.", ) patternCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="patternCanonical", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternCanonical", title="Extension field for ``patternCanonical``.", ) patternCode: fhirtypes.CodeType | None = Field( default=None, alias="patternCode", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternCode", title="Extension field for ``patternCode``." ) patternCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="patternCodeableConcept", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternCodeableReference: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="patternCodeableReference", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternCoding: fhirtypes.CodingType | None = Field( default=None, alias="patternCoding", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternContactDetail: fhirtypes.ContactDetailType | None = Field( default=None, alias="patternContactDetail", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="patternContactPoint", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternContributor: fhirtypes.ContributorType | None = Field( default=None, alias="patternContributor", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternCount: fhirtypes.CountType | None = Field( default=None, alias="patternCount", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternDataRequirement: fhirtypes.DataRequirementType | None = Field( default=None, alias="patternDataRequirement", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternDate: fhirtypes.DateType | None = Field( default=None, alias="patternDate", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternDate", title="Extension field for ``patternDate``." ) patternDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="patternDateTime", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternDateTime", title="Extension field for ``patternDateTime``.", ) patternDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="patternDecimal", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternDecimal", title="Extension field for ``patternDecimal``.", ) patternDistance: fhirtypes.DistanceType | None = Field( default=None, alias="patternDistance", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternDosage: fhirtypes.DosageType | None = Field( default=None, alias="patternDosage", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternDuration: fhirtypes.DurationType | None = Field( default=None, alias="patternDuration", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternExpression: fhirtypes.ExpressionType | None = Field( default=None, alias="patternExpression", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="patternHumanName", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternId: fhirtypes.IdType | None = Field( default=None, alias="patternId", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternId", title="Extension field for ``patternId``." ) patternIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="patternIdentifier", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternInstant: fhirtypes.InstantType | None = Field( default=None, alias="patternInstant", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternInstant", title="Extension field for ``patternInstant``.", ) patternInteger: fhirtypes.IntegerType | None = Field( default=None, alias="patternInteger", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternInteger", title="Extension field for ``patternInteger``.", ) patternMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="patternMarkdown", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternMarkdown", title="Extension field for ``patternMarkdown``.", ) patternMoney: fhirtypes.MoneyType | None = Field( default=None, alias="patternMoney", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternOid: fhirtypes.OidType | None = Field( default=None, alias="patternOid", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternOid", title="Extension field for ``patternOid``." ) patternParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field( default=None, alias="patternParameterDefinition", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="patternPeriod", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternPositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="patternPositiveInt", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternPositiveInt", title="Extension field for ``patternPositiveInt``.", ) patternQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="patternQuantity", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternRange: fhirtypes.RangeType | None = Field( default=None, alias="patternRange", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternRatio: fhirtypes.RatioType | None = Field( default=None, alias="patternRatio", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternRatioRange: fhirtypes.RatioRangeType | None = Field( default=None, alias="patternRatioRange", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternReference: fhirtypes.ReferenceType | None = Field( default=None, alias="patternReference", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field( default=None, alias="patternRelatedArtifact", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="patternSampledData", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternSignature: fhirtypes.SignatureType | None = Field( default=None, alias="patternSignature", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternString: fhirtypes.StringType | None = Field( default=None, alias="patternString", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternString", title="Extension field for ``patternString``.", ) patternTime: fhirtypes.TimeType | None = Field( default=None, alias="patternTime", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternTime", title="Extension field for ``patternTime``." ) patternTiming: fhirtypes.TimingType | None = Field( default=None, alias="patternTiming", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field( default=None, alias="patternTriggerDefinition", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="patternUnsignedInt", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternUnsignedInt", title="Extension field for ``patternUnsignedInt``.", ) patternUri: fhirtypes.UriType | None = Field( default=None, alias="patternUri", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternUri", title="Extension field for ``patternUri``." ) patternUrl: fhirtypes.UrlType | None = Field( default=None, alias="patternUrl", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternUrl", title="Extension field for ``patternUrl``." ) patternUsageContext: fhirtypes.UsageContextType | None = Field( default=None, alias="patternUsageContext", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternUuid: fhirtypes.UuidType | None = Field( default=None, alias="patternUuid", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. When pattern[x] is used to constrain a primitive, it means" " that the value provided in the pattern[x] must match the instance " "value exactly. When pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] array must " "(recursively) match at least one element from the instance array. " "When pattern[x] is used to constrain a complex object, it means that " "each property in the pattern must be present in the complex object, " "and its value must recursively match -- i.e., 1. If primitive: it " "must match exactly the pattern value 2. If a complex object: it must " "match (recursively) the pattern value 3. If an array: it must match " "(recursively) the pattern value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternUuid", title="Extension field for ``patternUuid``." ) representation: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="representation", title="xmlAttr | xmlText | typeAttr | cdaText | xhtml", description=( "Codes that define how this element is represented in instances, when " "the deviation varies from the normal case." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["xmlAttr", "xmlText", "typeAttr", "cdaText", "xhtml"], }, ) representation__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_representation", title="Extension field for ``representation``.", ) requirements: fhirtypes.MarkdownType | None = Field( default=None, alias="requirements", title="Why this resource has been created", description=( "This element is for traceability of why the element was created and " "why the constraints exist as they do. This may be used to point to " "source materials or specifications that drove the structure of this " "element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) requirements__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requirements", title="Extension field for ``requirements``.", ) short: fhirtypes.StringType | None = Field( default=None, alias="short", title="Concise definition for space-constrained presentation", description=( "A concise description of what this element means (e.g. for use in " "autogenerated summaries)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) short__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_short", title="Extension field for ``short``." ) sliceIsConstraining: bool | None = Field( default=None, alias="sliceIsConstraining", title=( "If this slice definition constrains an inherited slice definition (or " "not)" ), description=( "If true, indicates that this slice definition is constraining a slice " "definition with the same name in an inherited profile. If false, the " "slice is not overriding any slice in an inherited profile. If missing," " the slice might or might not be overriding a slice in an inherited " "profile, depending on the sliceName." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sliceIsConstraining__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sliceIsConstraining", title="Extension field for ``sliceIsConstraining``.", ) sliceName: fhirtypes.StringType | None = Field( default=None, alias="sliceName", title="Name for this particular element (in a set of slices)", description=( "The name of this element definition slice, when slicing is working. " "The name must be a token with no dots or spaces. This is a unique name" " referring to a specific set of constraints applied to this element, " "used to provide a name to different slices of the same element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sliceName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sliceName", title="Extension field for ``sliceName``." ) slicing: fhirtypes.ElementDefinitionSlicingType | None = Field( default=None, alias="slicing", title="This element is sliced - slices follow", description=( "Indicates that the element is sliced into a set of alternative " "definitions (i.e. in a structure definition, there are multiple " "different constraints on a single element in the base resource). " "Slicing can be used in any resource that has cardinality ..* on the " "base resource, or any resource with a choice of types. The set of " "slices is any elements that come after this in the element sequence " "that have the same path, until a shorter path occurs (the shorter path" " terminates the set)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: typing.List[fhirtypes.ElementDefinitionTypeType] | None = Field( default=None, alias="type", title="Data type and Profile for this element", description=( "The data type or resource that the value of this element is permitted " "to be." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "path", "representation", "sliceName", "sliceIsConstraining", "label", "code", "slicing", "short", "definition", "comment", "requirements", "alias", "min", "max", "base", "contentReference", "type", "defaultValueBase64Binary", "defaultValueBoolean", "defaultValueCanonical", "defaultValueCode", "defaultValueDate", "defaultValueDateTime", "defaultValueDecimal", "defaultValueId", "defaultValueInstant", "defaultValueInteger", "defaultValueMarkdown", "defaultValueOid", "defaultValuePositiveInt", "defaultValueString", "defaultValueTime", "defaultValueUnsignedInt", "defaultValueUri", "defaultValueUrl", "defaultValueUuid", "defaultValueAddress", "defaultValueAge", "defaultValueAnnotation", "defaultValueAttachment", "defaultValueCodeableConcept", "defaultValueCodeableReference", "defaultValueCoding", "defaultValueContactPoint", "defaultValueCount", "defaultValueDistance", "defaultValueDuration", "defaultValueHumanName", "defaultValueIdentifier", "defaultValueMoney", "defaultValuePeriod", "defaultValueQuantity", "defaultValueRange", "defaultValueRatio", "defaultValueRatioRange", "defaultValueReference", "defaultValueSampledData", "defaultValueSignature", "defaultValueTiming", "defaultValueContactDetail", "defaultValueContributor", "defaultValueDataRequirement", "defaultValueExpression", "defaultValueParameterDefinition", "defaultValueRelatedArtifact", "defaultValueTriggerDefinition", "defaultValueUsageContext", "defaultValueDosage", "meaningWhenMissing", "orderMeaning", "fixedBase64Binary", "fixedBoolean", "fixedCanonical", "fixedCode", "fixedDate", "fixedDateTime", "fixedDecimal", "fixedId", "fixedInstant", "fixedInteger", "fixedMarkdown", "fixedOid", "fixedPositiveInt", "fixedString", "fixedTime", "fixedUnsignedInt", "fixedUri", "fixedUrl", "fixedUuid", "fixedAddress", "fixedAge", "fixedAnnotation", "fixedAttachment", "fixedCodeableConcept", "fixedCodeableReference", "fixedCoding", "fixedContactPoint", "fixedCount", "fixedDistance", "fixedDuration", "fixedHumanName", "fixedIdentifier", "fixedMoney", "fixedPeriod", "fixedQuantity", "fixedRange", "fixedRatio", "fixedRatioRange", "fixedReference", "fixedSampledData", "fixedSignature", "fixedTiming", "fixedContactDetail", "fixedContributor", "fixedDataRequirement", "fixedExpression", "fixedParameterDefinition", "fixedRelatedArtifact", "fixedTriggerDefinition", "fixedUsageContext", "fixedDosage", "patternBase64Binary", "patternBoolean", "patternCanonical", "patternCode", "patternDate", "patternDateTime", "patternDecimal", "patternId", "patternInstant", "patternInteger", "patternMarkdown", "patternOid", "patternPositiveInt", "patternString", "patternTime", "patternUnsignedInt", "patternUri", "patternUrl", "patternUuid", "patternAddress", "patternAge", "patternAnnotation", "patternAttachment", "patternCodeableConcept", "patternCodeableReference", "patternCoding", "patternContactPoint", "patternCount", "patternDistance", "patternDuration", "patternHumanName", "patternIdentifier", "patternMoney", "patternPeriod", "patternQuantity", "patternRange", "patternRatio", "patternRatioRange", "patternReference", "patternSampledData", "patternSignature", "patternTiming", "patternContactDetail", "patternContributor", "patternDataRequirement", "patternExpression", "patternParameterDefinition", "patternRelatedArtifact", "patternTriggerDefinition", "patternUsageContext", "patternDosage", "example", "minValueDate", "minValueDateTime", "minValueInstant", "minValueTime", "minValueDecimal", "minValueInteger", "minValuePositiveInt", "minValueUnsignedInt", "minValueQuantity", "maxValueDate", "maxValueDateTime", "maxValueInstant", "maxValueTime", "maxValueDecimal", "maxValueInteger", "maxValuePositiveInt", "maxValueUnsignedInt", "maxValueQuantity", "maxLength", "condition", "constraint", "mustSupport", "isModifier", "isModifierReason", "isSummary", "binding", "mapping", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinition`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "path", "representation", "sliceName", "sliceIsConstraining", "label", "code", "slicing", "short", "definition", "comment", "requirements", "alias", "min", "max", "base", "contentReference", "type", "defaultValueBase64Binary", "defaultValueBoolean", "defaultValueCanonical", "defaultValueCode", "defaultValueDate", "defaultValueDateTime", "defaultValueDecimal", "defaultValueId", "defaultValueInstant", "defaultValueInteger", "defaultValueMarkdown", "defaultValueOid", "defaultValuePositiveInt", "defaultValueString", "defaultValueTime", "defaultValueUnsignedInt", "defaultValueUri", "defaultValueUrl", "defaultValueUuid", "defaultValueAddress", "defaultValueAge", "defaultValueAnnotation", "defaultValueAttachment", "defaultValueCodeableConcept", "defaultValueCodeableReference", "defaultValueCoding", "defaultValueContactPoint", "defaultValueCount", "defaultValueDistance", "defaultValueDuration", "defaultValueHumanName", "defaultValueIdentifier", "defaultValueMoney", "defaultValuePeriod", "defaultValueQuantity", "defaultValueRange", "defaultValueRatio", "defaultValueRatioRange", "defaultValueReference", "defaultValueSampledData", "defaultValueSignature", "defaultValueTiming", "defaultValueContactDetail", "defaultValueContributor", "defaultValueDataRequirement", "defaultValueExpression", "defaultValueParameterDefinition", "defaultValueRelatedArtifact", "defaultValueTriggerDefinition", "defaultValueUsageContext", "defaultValueDosage", "meaningWhenMissing", "orderMeaning", "fixedBase64Binary", "fixedBoolean", "fixedCanonical", "fixedCode", "fixedDate", "fixedDateTime", "fixedDecimal", "fixedId", "fixedInstant", "fixedInteger", "fixedMarkdown", "fixedOid", "fixedPositiveInt", "fixedString", "fixedTime", "fixedUnsignedInt", "fixedUri", "fixedUrl", "fixedUuid", "fixedAddress", "fixedAge", "fixedAnnotation", "fixedAttachment", "fixedCodeableConcept", "fixedCodeableReference", "fixedCoding", "fixedContactPoint", "fixedCount", "fixedDistance", "fixedDuration", "fixedHumanName", "fixedIdentifier", "fixedMoney", "fixedPeriod", "fixedQuantity", "fixedRange", "fixedRatio", "fixedRatioRange", "fixedReference", "fixedSampledData", "fixedSignature", "fixedTiming", "fixedContactDetail", "fixedContributor", "fixedDataRequirement", "fixedExpression", "fixedParameterDefinition", "fixedRelatedArtifact", "fixedTriggerDefinition", "fixedUsageContext", "fixedDosage", "patternBase64Binary", "patternBoolean", "patternCanonical", "patternCode", "patternDate", "patternDateTime", "patternDecimal", "patternId", "patternInstant", "patternInteger", "patternMarkdown", "patternOid", "patternPositiveInt", "patternString", "patternTime", "patternUnsignedInt", "patternUri", "patternUrl", "patternUuid", "patternAddress", "patternAge", "patternAnnotation", "patternAttachment", "patternCodeableConcept", "patternCodeableReference", "patternCoding", "patternContactPoint", "patternCount", "patternDistance", "patternDuration", "patternHumanName", "patternIdentifier", "patternMoney", "patternPeriod", "patternQuantity", "patternRange", "patternRatio", "patternRatioRange", "patternReference", "patternSampledData", "patternSignature", "patternTiming", "patternContactDetail", "patternContributor", "patternDataRequirement", "patternExpression", "patternParameterDefinition", "patternRelatedArtifact", "patternTriggerDefinition", "patternUsageContext", "patternDosage", "example", "minValueDate", "minValueDateTime", "minValueInstant", "minValueTime", "minValueDecimal", "minValueInteger", "minValuePositiveInt", "minValueUnsignedInt", "minValueQuantity", "maxValueDate", "maxValueDateTime", "maxValueInstant", "maxValueTime", "maxValueDecimal", "maxValueInteger", "maxValuePositiveInt", "maxValueUnsignedInt", "maxValueQuantity", "maxLength", "condition", "constraint", "mustSupport", "isModifier", "isModifierReason", "isSummary", "binding", "mapping", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("path", "path__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "defaultValue": [ "defaultValueAddress", "defaultValueAge", "defaultValueAnnotation", "defaultValueAttachment", "defaultValueBase64Binary", "defaultValueBoolean", "defaultValueCanonical", "defaultValueCode", "defaultValueCodeableConcept", "defaultValueCodeableReference", "defaultValueCoding", "defaultValueContactDetail", "defaultValueContactPoint", "defaultValueContributor", "defaultValueCount", "defaultValueDataRequirement", "defaultValueDate", "defaultValueDateTime", "defaultValueDecimal", "defaultValueDistance", "defaultValueDosage", "defaultValueDuration", "defaultValueExpression", "defaultValueHumanName", "defaultValueId", "defaultValueIdentifier", "defaultValueInstant", "defaultValueInteger", "defaultValueMarkdown", "defaultValueMoney", "defaultValueOid", "defaultValueParameterDefinition", "defaultValuePeriod", "defaultValuePositiveInt", "defaultValueQuantity", "defaultValueRange", "defaultValueRatio", "defaultValueRatioRange", "defaultValueReference", "defaultValueRelatedArtifact", "defaultValueSampledData", "defaultValueSignature", "defaultValueString", "defaultValueTime", "defaultValueTiming", "defaultValueTriggerDefinition", "defaultValueUnsignedInt", "defaultValueUri", "defaultValueUrl", "defaultValueUsageContext", "defaultValueUuid", ], "fixed": [ "fixedAddress", "fixedAge", "fixedAnnotation", "fixedAttachment", "fixedBase64Binary", "fixedBoolean", "fixedCanonical", "fixedCode", "fixedCodeableConcept", "fixedCodeableReference", "fixedCoding", "fixedContactDetail", "fixedContactPoint", "fixedContributor", "fixedCount", "fixedDataRequirement", "fixedDate", "fixedDateTime", "fixedDecimal", "fixedDistance", "fixedDosage", "fixedDuration", "fixedExpression", "fixedHumanName", "fixedId", "fixedIdentifier", "fixedInstant", "fixedInteger", "fixedMarkdown", "fixedMoney", "fixedOid", "fixedParameterDefinition", "fixedPeriod", "fixedPositiveInt", "fixedQuantity", "fixedRange", "fixedRatio", "fixedRatioRange", "fixedReference", "fixedRelatedArtifact", "fixedSampledData", "fixedSignature", "fixedString", "fixedTime", "fixedTiming", "fixedTriggerDefinition", "fixedUnsignedInt", "fixedUri", "fixedUrl", "fixedUsageContext", "fixedUuid", ], "maxValue": [ "maxValueDate", "maxValueDateTime", "maxValueDecimal", "maxValueInstant", "maxValueInteger", "maxValuePositiveInt", "maxValueQuantity", "maxValueTime", "maxValueUnsignedInt", ], "minValue": [ "minValueDate", "minValueDateTime", "minValueDecimal", "minValueInstant", "minValueInteger", "minValuePositiveInt", "minValueQuantity", "minValueTime", "minValueUnsignedInt", ], "pattern": [ "patternAddress", "patternAge", "patternAnnotation", "patternAttachment", "patternBase64Binary", "patternBoolean", "patternCanonical", "patternCode", "patternCodeableConcept", "patternCodeableReference", "patternCoding", "patternContactDetail", "patternContactPoint", "patternContributor", "patternCount", "patternDataRequirement", "patternDate", "patternDateTime", "patternDecimal", "patternDistance", "patternDosage", "patternDuration", "patternExpression", "patternHumanName", "patternId", "patternIdentifier", "patternInstant", "patternInteger", "patternMarkdown", "patternMoney", "patternOid", "patternParameterDefinition", "patternPeriod", "patternPositiveInt", "patternQuantity", "patternRange", "patternRatio", "patternRatioRange", "patternReference", "patternRelatedArtifact", "patternSampledData", "patternSignature", "patternString", "patternTime", "patternTiming", "patternTriggerDefinition", "patternUnsignedInt", "patternUri", "patternUrl", "patternUsageContext", "patternUuid", ], } return one_of_many_fields class ElementDefinitionBase(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Base definition information for tools. Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. When the element definition is not the original definition of an element - i.g. either in a constraint on another type, or for elements from a super type in a snap shot - then the information in provided in the element definition may be different to the base definition. On the original definition of the element, it will be same. """ __resource_type__ = "ElementDefinitionBase" max: fhirtypes.StringType | None = Field( default=None, alias="max", title="Max cardinality of the base element", description="Maximum cardinality of the base element identified by the path.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_max", title="Extension field for ``max``." ) min: fhirtypes.UnsignedIntType | None = Field( default=None, alias="min", title="Min cardinality of the base element", description="Minimum cardinality of the base element identified by the path.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_min", title="Extension field for ``min``." ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="Path that identifies the base element", description=( "The Path that identifies the base element - this matches the " "ElementDefinition.path for that element. Across FHIR, there is only " "one base definition of any element - that is, an element definition on" " a [StructureDefinition](structuredefinition.html#) without a " "StructureDefinition.base." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionBase`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "path", "min", "max"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionBase`` according to specification, with preserving the original sequence order. """ return ["path", "min", "max"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("max", "max__ext"), ("min", "min__ext"), ("path", "path__ext"), ] return required_fields class ElementDefinitionBinding(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. ValueSet details if this is coded. Binds to a value set if this element is coded (code, Coding, CodeableConcept, Quantity), or the data types (string, uri). """ __resource_type__ = "ElementDefinitionBinding" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Human explanation of the value set", description="Describes the intended use of this particular set of codes.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) strength: fhirtypes.CodeType | None = Field( default=None, alias="strength", title="required | extensible | preferred | example", description=( "Indicates the degree of conformance expectations associated with this " "binding - that is, the degree to which the provided value set must be " "adhered to in the instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["required", "extensible", "preferred", "example"], }, ) strength__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_strength", title="Extension field for ``strength``." ) valueSet: fhirtypes.CanonicalType | None = Field( default=None, alias="valueSet", title="Source of value set", description=( "Refers to the value set that identifies the set of codes the binding " "refers to." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueSet", title="Extension field for ``valueSet``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionBinding`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "strength", "description", "valueSet"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionBinding`` according to specification, with preserving the original sequence order. """ return ["strength", "description", "valueSet"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("strength", "strength__ext")] return required_fields class ElementDefinitionConstraint(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Condition that must evaluate to true. Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance. """ __resource_type__ = "ElementDefinitionConstraint" expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="FHIRPath expression of constraint", description=( "A [FHIRPath](fhirpath.html) expression of constraint that can be " "executed to see if this constraint is met." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) human: fhirtypes.StringType | None = Field( default=None, alias="human", title="Human description of constraint", description=( "Text that can be used to describe the constraint in messages " "identifying that the constraint has been violated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) human__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_human", title="Extension field for ``human``." ) key: fhirtypes.IdType | None = Field( default=None, alias="key", title="Target of 'condition' reference above", description=( "Allows identification of which elements have their cardinalities " "impacted by the constraint. Will not be referenced for constraints " "that do not affect cardinality." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) key__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_key", title="Extension field for ``key``." ) requirements: fhirtypes.StringType | None = Field( default=None, alias="requirements", title="Why this constraint is necessary or appropriate", description="Description of why this constraint is necessary or appropriate.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) requirements__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requirements", title="Extension field for ``requirements``.", ) severity: fhirtypes.CodeType | None = Field( default=None, alias="severity", title="error | warning", description=( "Identifies the impact constraint violation has on the conformance of " "the instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["error", "warning"], }, ) severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_severity", title="Extension field for ``severity``." ) source: fhirtypes.CanonicalType | None = Field( default=None, alias="source", title="Reference to original source of constraint", description=( "A reference to the original source of the constraint, for traceability" " purposes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_source", title="Extension field for ``source``." ) xpath: fhirtypes.StringType | None = Field( default=None, alias="xpath", title="XPath expression of constraint", description=( "An XPath expression of constraint that can be executed to see if this " "constraint is met." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) xpath__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_xpath", title="Extension field for ``xpath``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionConstraint`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "key", "requirements", "severity", "human", "expression", "xpath", "source", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionConstraint`` according to specification, with preserving the original sequence order. """ return [ "key", "requirements", "severity", "human", "expression", "xpath", "source", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("human", "human__ext"), ("key", "key__ext"), ("severity", "severity__ext"), ] return required_fields class ElementDefinitionExample(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Example value (as defined for type). A sample value for this element demonstrating the type of information that would typically be found in the element. """ __resource_type__ = "ElementDefinitionExample" label: fhirtypes.StringType | None = Field( default=None, alias="label", title="Describes the purpose of this example", description="Describes the purpose of this example amoung the set of examples.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_label", title="Extension field for ``label``." ) valueAddress: fhirtypes.AddressType | None = Field( default=None, alias="valueAddress", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAge: fhirtypes.AgeType | None = Field( default=None, alias="valueAge", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="valueAnnotation", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="valueBase64Binary", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBase64Binary", title="Extension field for ``valueBase64Binary``.", ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="valueCanonical", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCanonical", title="Extension field for ``valueCanonical``.", ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCodeableReference: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="valueCodeableReference", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueContactDetail: fhirtypes.ContactDetailType | None = Field( default=None, alias="valueContactDetail", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="valueContactPoint", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueContributor: fhirtypes.ContributorType | None = Field( default=None, alias="valueContributor", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCount: fhirtypes.CountType | None = Field( default=None, alias="valueCount", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDataRequirement: fhirtypes.DataRequirementType | None = Field( default=None, alias="valueDataRequirement", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueDistance: fhirtypes.DistanceType | None = Field( default=None, alias="valueDistance", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDosage: fhirtypes.DosageType | None = Field( default=None, alias="valueDosage", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDuration: fhirtypes.DurationType | None = Field( default=None, alias="valueDuration", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueExpression: fhirtypes.ExpressionType | None = Field( default=None, alias="valueExpression", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="valueHumanName", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId: fhirtypes.IdType | None = Field( default=None, alias="valueId", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueId", title="Extension field for ``valueId``." ) valueIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="valueIdentifier", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInstant: fhirtypes.InstantType | None = Field( default=None, alias="valueInstant", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInstant", title="Extension field for ``valueInstant``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="valueMarkdown", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueMarkdown", title="Extension field for ``valueMarkdown``.", ) valueMoney: fhirtypes.MoneyType | None = Field( default=None, alias="valueMoney", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueOid: fhirtypes.OidType | None = Field( default=None, alias="valueOid", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueOid", title="Extension field for ``valueOid``." ) valueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field( default=None, alias="valueParameterDefinition", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="valuePositiveInt", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valuePositiveInt", title="Extension field for ``valuePositiveInt``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRatioRange: fhirtypes.RatioRangeType | None = Field( default=None, alias="valueRatioRange", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field( default=None, alias="valueRelatedArtifact", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="valueSampledData", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueSignature: fhirtypes.SignatureType | None = Field( default=None, alias="valueSignature", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) valueTiming: fhirtypes.TimingType | None = Field( default=None, alias="valueTiming", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field( default=None, alias="valueTriggerDefinition", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="valueUnsignedInt", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUnsignedInt", title="Extension field for ``valueUnsignedInt``.", ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) valueUrl: fhirtypes.UrlType | None = Field( default=None, alias="valueUrl", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUrl", title="Extension field for ``valueUrl``." ) valueUsageContext: fhirtypes.UsageContextType | None = Field( default=None, alias="valueUsageContext", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUuid: fhirtypes.UuidType | None = Field( default=None, alias="valueUuid", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUuid", title="Extension field for ``valueUuid``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionExample`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "label", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInstant", "valueInteger", "valueMarkdown", "valueOid", "valuePositiveInt", "valueString", "valueTime", "valueUnsignedInt", "valueUri", "valueUrl", "valueUuid", "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueCodeableConcept", "valueCodeableReference", "valueCoding", "valueContactPoint", "valueCount", "valueDistance", "valueDuration", "valueHumanName", "valueIdentifier", "valueMoney", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueRatioRange", "valueReference", "valueSampledData", "valueSignature", "valueTiming", "valueContactDetail", "valueContributor", "valueDataRequirement", "valueExpression", "valueParameterDefinition", "valueRelatedArtifact", "valueTriggerDefinition", "valueUsageContext", "valueDosage", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionExample`` according to specification, with preserving the original sequence order. """ return [ "label", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInstant", "valueInteger", "valueMarkdown", "valueOid", "valuePositiveInt", "valueString", "valueTime", "valueUnsignedInt", "valueUri", "valueUrl", "valueUuid", "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueCodeableConcept", "valueCodeableReference", "valueCoding", "valueContactPoint", "valueCount", "valueDistance", "valueDuration", "valueHumanName", "valueIdentifier", "valueMoney", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueRatioRange", "valueReference", "valueSampledData", "valueSignature", "valueTiming", "valueContactDetail", "valueContributor", "valueDataRequirement", "valueExpression", "valueParameterDefinition", "valueRelatedArtifact", "valueTriggerDefinition", "valueUsageContext", "valueDosage", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("label", "label__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueCodeableConcept", "valueCodeableReference", "valueCoding", "valueContactDetail", "valueContactPoint", "valueContributor", "valueCount", "valueDataRequirement", "valueDate", "valueDateTime", "valueDecimal", "valueDistance", "valueDosage", "valueDuration", "valueExpression", "valueHumanName", "valueId", "valueIdentifier", "valueInstant", "valueInteger", "valueMarkdown", "valueMoney", "valueOid", "valueParameterDefinition", "valuePeriod", "valuePositiveInt", "valueQuantity", "valueRange", "valueRatio", "valueRatioRange", "valueReference", "valueRelatedArtifact", "valueSampledData", "valueSignature", "valueString", "valueTime", "valueTiming", "valueTriggerDefinition", "valueUnsignedInt", "valueUri", "valueUrl", "valueUsageContext", "valueUuid", ] } return one_of_many_fields class ElementDefinitionMapping(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Map element to another set of definitions. Identifies a concept from an external specification that roughly corresponds to this element. """ __resource_type__ = "ElementDefinitionMapping" comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Comments about the mapping or its use", description="Comments that provide information about the mapping or its use.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) identity: fhirtypes.IdType | None = Field( default=None, alias="identity", title="Reference to mapping declaration", description="An internal reference to the definition of a mapping.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) identity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_identity", title="Extension field for ``identity``." ) language: fhirtypes.CodeType | None = Field( default=None, alias="language", title="Computable language of mapping", description="Identifies the computable language in which mapping.map is expressed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) map: fhirtypes.StringType | None = Field( default=None, alias="map", title="Details of the mapping", description=( "Expresses what part of the target specification corresponds to this " "element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) map__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_map", title="Extension field for ``map``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionMapping`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "identity", "language", "map", "comment"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionMapping`` according to specification, with preserving the original sequence order. """ return ["identity", "language", "map", "comment"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("identity", "identity__ext"), ("map", "map__ext")] return required_fields class ElementDefinitionSlicing(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. This element is sliced - slices follow. Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set). """ __resource_type__ = "ElementDefinitionSlicing" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Text description of how slicing works (or not)", description=( "A human-readable text description of how the slicing works. If there " "is no discriminator, this is required to be present to provide " "whatever information is possible about how the slices can be " "differentiated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) discriminator: typing.List[ fhirtypes.ElementDefinitionSlicingDiscriminatorType ] | None = Field( default=None, alias="discriminator", title="Element values that are used to distinguish the slices", description=( "Designates which child elements are used to discriminate between the " "slices when processing an instance. If one or more discriminators are " "provided, the value of the child elements in the instance data SHALL " "completely distinguish which slice the element in the resource matches" " based on the allowed values for those elements in each of the slices." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ordered: bool | None = Field( default=None, alias="ordered", title="If elements must be in same order as slices", description=( "If the matching elements have to occur in the same order as defined in" " the profile." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ordered__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_ordered", title="Extension field for ``ordered``." ) rules: fhirtypes.CodeType | None = Field( default=None, alias="rules", title="closed | open | openAtEnd", description=( "Whether additional slices are allowed or not. When the slices are " "ordered, profile authors can also say that additional slices are only " "allowed at the end." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["closed", "open", "openAtEnd"], }, ) rules__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rules", title="Extension field for ``rules``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionSlicing`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "discriminator", "description", "ordered", "rules"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionSlicing`` according to specification, with preserving the original sequence order. """ return ["discriminator", "description", "ordered", "rules"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("rules", "rules__ext")] return required_fields class ElementDefinitionSlicingDiscriminator(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Element values that are used to distinguish the slices. Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices. """ __resource_type__ = "ElementDefinitionSlicingDiscriminator" path: fhirtypes.StringType | None = Field( default=None, alias="path", title="Path to element value", description=( "A FHIRPath expression, using [the simple subset of " "FHIRPath](fhirpath.html#simple), that is used to identify the element " "on which discrimination is based." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="value | exists | pattern | type | profile", description="How the element value is interpreted when discrimination is evaluated.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["value", "exists", "pattern", "type", "profile"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionSlicingDiscriminator`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "type", "path"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionSlicingDiscriminator`` according to specification, with preserving the original sequence order. """ return ["type", "path"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("path", "path__ext"), ("type", "type__ext")] return required_fields class ElementDefinitionType(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Data type and Profile for this element. The data type or resource that the value of this element is permitted to be. """ __resource_type__ = "ElementDefinitionType" aggregation: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="aggregation", title="contained | referenced | bundled - how aggregated", description=( "If the type is a reference to another resource, how the resource is or" " can be aggregated - is it a contained resource, or a reference, and " "if the context is a bundle, is it included in the bundle." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["contained", "referenced", "bundled"], }, ) aggregation__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_aggregation", title="Extension field for ``aggregation``." ) code: fhirtypes.UriType | None = Field( default=None, alias="code", title="Data type or Resource (reference to definition)", description=( "URL of Data type or Resource that is a(or the) type used for this " "element. References are URLs that are relative to " 'http://hl7.org/fhir/StructureDefinition e.g. "string" is a reference ' "to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are " "only allowed in logical models." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) profile: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="profile", title="Profiles (StructureDefinition or IG) - one must apply", description=( "Identifies a profile structure or implementation Guide that applies to" " the datatype this element refers to. If any profiles are specified, " "then the content must conform to at least one of them. The URL can be " "a local reference - to a contained StructureDefinition, or a reference" " to another StructureDefinition or Implementation Guide by a canonical" " URL. When an implementation guide is specified, the type SHALL " "conform to at least one profile defined in the implementation guide." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition", "ImplementationGuide"], }, ) profile__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) targetProfile: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="targetProfile", title=( "Profile (StructureDefinition or IG) on the Reference/canonical target " "- one must apply" ), description=( 'Used when the type is "Reference" or "canonical", and identifies a ' "profile structure or implementation Guide that applies to the target " "of the reference this element refers to. If any profiles are " "specified, then the content must conform to at least one of them. The " "URL can be a local reference - to a contained StructureDefinition, or " "a reference to another StructureDefinition or Implementation Guide by " "a canonical URL. When an implementation guide is specified, the target" " resource SHALL conform to at least one profile defined in the " "implementation guide." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition", "ImplementationGuide"], }, ) targetProfile__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_targetProfile", title="Extension field for ``targetProfile``.", ) versioning: fhirtypes.CodeType | None = Field( default=None, alias="versioning", title="either | independent | specific", description=( "Whether this reference needs to be version specific or version " "independent, or whether either can be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["either", "independent", "specific"], }, ) versioning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versioning", title="Extension field for ``versioning``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionType`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "code", "profile", "targetProfile", "aggregation", "versioning", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionType`` according to specification, with preserving the original sequence order. """ return ["code", "profile", "targetProfile", "aggregation", "versioning"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/encounter.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Encounter Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Encounter(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An interaction during which services are provided to the patient. An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. """ __resource_type__ = "Encounter" account: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="account", title="The set of accounts that may be used for billing for this Encounter", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Account"], }, ) appointment: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="appointment", title="The appointment that scheduled this encounter", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Appointment"], }, ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="The ServiceRequest that initiated this encounter", description=( "The request this encounter satisfies (e.g. incoming referral or " "procedure request)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ServiceRequest"], }, ) classHistory: typing.List[fhirtypes.EncounterClassHistoryType] | None = Field( default=None, alias="classHistory", title="List of past encounter classes", description=( "The class history permits the tracking of the encounters transitions " "without needing to go through the resource history. This would be " "used for a case where an admission starts of as an emergency " "encounter, then transitions into an inpatient scenario. Doing this and" " not restarting a new encounter ensures that any lab/diagnostic " "results can more easily follow the patient and not require re-" "processing and not get lost or cancelled during a kind of discharge " "from emergency to inpatient." ), json_schema_extra={ "element_property": True, }, ) class_fhir: fhirtypes.CodingType = Field( default=..., alias="class", title="Classification of patient encounter", description=( "Concepts representing classification of patient encounter such as " "ambulatory (outpatient), inpatient, emergency, home health or others " "due to local variations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) diagnosis: typing.List[fhirtypes.EncounterDiagnosisType] | None = Field( default=None, alias="diagnosis", title="The list of diagnosis relevant to this encounter", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) episodeOfCare: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="episodeOfCare", title="Episode(s) of care that this encounter should be recorded against", description=( "Where a specific encounter should be classified as a part of a " "specific episode(s) of care this field should be used. This " "association can facilitate grouping of related encounters together for" " a specific purpose, such as government reporting, issue tracking, " "association via a common problem. The association is recorded on the " "encounter as these are typically created after the episode of care and" " grouped on entry rather than editing the episode of care to append " "another encounter to it (the episode of care could span years)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["EpisodeOfCare"], }, ) hospitalization: fhirtypes.EncounterHospitalizationType | None = Field( default=None, alias="hospitalization", title="Details about the admission to a healthcare service", description=None, json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifier(s) by which this encounter is known", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) length: fhirtypes.DurationType | None = Field( default=None, alias="length", title="Quantity of time the encounter lasted (less time absent)", description=( "Quantity of time the encounter lasted. This excludes the time during " "leaves of absence." ), json_schema_extra={ "element_property": True, }, ) location: typing.List[fhirtypes.EncounterLocationType] | None = Field( default=None, alias="location", title="List of locations where the patient has been", description="List of locations where the patient has been during this encounter.", json_schema_extra={ "element_property": True, }, ) partOf: fhirtypes.ReferenceType | None = Field( default=None, alias="partOf", title="Another Encounter this encounter is part of", description=( "Another Encounter of which this encounter is a part of " "(administratively or in time)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) participant: typing.List[fhirtypes.EncounterParticipantType] | None = Field( default=None, alias="participant", title="List of participants involved in the encounter", description="The list of people responsible for providing the service.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="The start and end time of the encounter", description=None, json_schema_extra={ "element_property": True, }, ) priority: fhirtypes.CodeableConceptType | None = Field( default=None, alias="priority", title="Indicates the urgency of the encounter", description=None, json_schema_extra={ "element_property": True, }, ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Coded reason the encounter takes place", description=( "Reason the encounter takes place, expressed as a code. For admissions," " this can be used for a coded admission diagnosis." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Reason the encounter takes place (reference)", description=( "Reason the encounter takes place, expressed as a code. For admissions," " this can be used for a coded admission diagnosis." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Procedure", "Observation", "ImmunizationRecommendation", ], }, ) serviceProvider: fhirtypes.ReferenceType | None = Field( default=None, alias="serviceProvider", title="The organization (facility) responsible for this encounter", description=( "The organization that is primarily responsible for this Encounter's " "services. This MAY be the same as the organization on the Patient " "record, however it could be different, such as if the actor performing" " the services was from an external organization (which may be billed " "seperately) for an external consultation. Refer to the example bundle" " showing an abbreviated set of Encounters for a colonoscopy." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) serviceType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="serviceType", title="Specific type of service", description=( "Broad categorization of the service that is to be provided (e.g. " "cardiology)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "planned | arrived | triaged | in-progress | onleave | finished | " "cancelled +" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "planned", "arrived", "triaged", "in-progress", "onleave", "finished", "cancelled", "+", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusHistory: typing.List[fhirtypes.EncounterStatusHistoryType] | None = Field( default=None, alias="statusHistory", title="List of past encounter statuses", description=( "The status history permits the encounter resource to contain the " "status history without needing to read through the historical versions" " of the resource, or even have the server store them." ), json_schema_extra={ "element_property": True, }, ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="The patient or group present at the encounter", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Specific type of encounter", description=( "Specific type of encounter (e.g. e-mail consultation, surgical day-" "care, skilled nursing, rehabilitation)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Encounter`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "statusHistory", "class", "classHistory", "type", "serviceType", "priority", "subject", "episodeOfCare", "basedOn", "participant", "appointment", "period", "length", "reasonCode", "reasonReference", "diagnosis", "account", "hospitalization", "location", "serviceProvider", "partOf", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Encounter`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "class", "type", "serviceType", "subject", "episodeOfCare", "participant", "appointment", "reasonCode", "reasonReference", "diagnosis", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class EncounterClassHistory(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. List of past encounter classes. The class history permits the tracking of the encounters transitions without needing to go through the resource history. This would be used for a case where an admission starts of as an emergency encounter, then transitions into an inpatient scenario. Doing this and not restarting a new encounter ensures that any lab/diagnostic results can more easily follow the patient and not require re-processing and not get lost or cancelled during a kind of discharge from emergency to inpatient. """ __resource_type__ = "EncounterClassHistory" class_fhir: fhirtypes.CodingType = Field( default=..., alias="class", title="inpatient | outpatient | ambulatory | emergency +", description=None, json_schema_extra={ "element_property": True, }, ) period: fhirtypes.PeriodType = Field( default=..., alias="period", title="The time that the episode was in the specified class", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EncounterClassHistory`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "class", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EncounterClassHistory`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EncounterDiagnosis(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The list of diagnosis relevant to this encounter. """ __resource_type__ = "EncounterDiagnosis" condition: fhirtypes.ReferenceType = Field( default=..., alias="condition", title="The diagnosis or procedure relevant to the encounter", description=( "Reason the encounter takes place, as specified using information from " "another resource. For admissions, this is the admission diagnosis. The" " indication will typically be a Condition (with other resources " "referenced in the evidence.detail), or a Procedure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "Procedure"], }, ) rank: fhirtypes.PositiveIntType | None = Field( default=None, alias="rank", title="Ranking of the diagnosis (for each role type)", description=None, json_schema_extra={ "element_property": True, }, ) rank__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rank", title="Extension field for ``rank``." ) use: fhirtypes.CodeableConceptType | None = Field( default=None, alias="use", title=( "Role that this diagnosis has within the encounter (e.g. admission, " "billing, discharge \u2026)" ), description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EncounterDiagnosis`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "condition", "use", "rank"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EncounterDiagnosis`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "condition"] class EncounterHospitalization(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details about the admission to a healthcare service. """ __resource_type__ = "EncounterHospitalization" admitSource: fhirtypes.CodeableConceptType | None = Field( default=None, alias="admitSource", title="From where patient was admitted (physician referral, transfer)", description=None, json_schema_extra={ "element_property": True, }, ) destination: fhirtypes.ReferenceType | None = Field( default=None, alias="destination", title="Location/organization to which the patient is discharged", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location", "Organization"], }, ) dietPreference: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="dietPreference", title="Diet preferences reported by the patient", description=None, json_schema_extra={ "element_property": True, }, ) dischargeDisposition: fhirtypes.CodeableConceptType | None = Field( default=None, alias="dischargeDisposition", title="Category or kind of location after discharge", description=None, json_schema_extra={ "element_property": True, }, ) origin: fhirtypes.ReferenceType | None = Field( default=None, alias="origin", title="The location/organization from which the patient came before admission", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location", "Organization"], }, ) preAdmissionIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="preAdmissionIdentifier", title="Pre-admission identifier", description=None, json_schema_extra={ "element_property": True, }, ) reAdmission: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reAdmission", title=( "The type of hospital re-admission that has occurred (if any). If the " "value is absent, then this is not identified as a readmission" ), description="Whether this hospitalization is a readmission and why if known.", json_schema_extra={ "element_property": True, }, ) specialArrangement: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialArrangement", title="Wheelchair, translator, stretcher, etc.", description=( "Any special requests that have been made for this hospitalization " "encounter, such as the provision of specific equipment or other " "things." ), json_schema_extra={ "element_property": True, }, ) specialCourtesy: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialCourtesy", title="Special courtesies (VIP, board member)", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EncounterHospitalization`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "preAdmissionIdentifier", "origin", "admitSource", "reAdmission", "dietPreference", "specialCourtesy", "specialArrangement", "destination", "dischargeDisposition", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EncounterHospitalization`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EncounterLocation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. List of locations where the patient has been. List of locations where the patient has been during this encounter. """ __resource_type__ = "EncounterLocation" location: fhirtypes.ReferenceType = Field( default=..., alias="location", title="Location the encounter takes place", description="The location where the encounter takes place.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period during which the patient was present at the location", description=None, json_schema_extra={ "element_property": True, }, ) physicalType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="physicalType", title=( "The physical type of the location (usually the level in the location " "hierachy - bed room ward etc.)" ), description=( "This will be used to specify the required levels (bed/ward/room/etc.) " "desired to be recorded to simplify either messaging or query." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="planned | active | reserved | completed", description=( "The status of the participants' presence at the specified location " "during the period specified. If the participant is no longer at the " "location, then the period will have an end date/time." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["planned", "active", "reserved", "completed"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EncounterLocation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "location", "status", "physicalType", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EncounterLocation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EncounterParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. List of participants involved in the encounter. The list of people responsible for providing the service. """ __resource_type__ = "EncounterParticipant" individual: fhirtypes.ReferenceType | None = Field( default=None, alias="individual", title="Persons involved in the encounter other than the patient", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "RelatedPerson", ], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Period of time during the encounter that the participant participated", description=( "The period of time that the specified participant participated in the " "encounter. These can overlap or be sub-sets of the overall encounter's" " period." ), json_schema_extra={ "element_property": True, }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Role of participant in encounter", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EncounterParticipant`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "period", "individual"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EncounterParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "individual"] class EncounterStatusHistory(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. List of past encounter statuses. The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them. """ __resource_type__ = "EncounterStatusHistory" period: fhirtypes.PeriodType = Field( default=..., alias="period", title="The time that the episode was in the specified status", description=None, json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "planned | arrived | triaged | in-progress | onleave | finished | " "cancelled +" ), description=None, json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "planned", "arrived", "triaged", "in-progress", "onleave", "finished", "cancelled", "+", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EncounterStatusHistory`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "status", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EncounterStatusHistory`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/endpoint.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Endpoint Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class Endpoint(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The technical details of an endpoint that can be used for electronic services. The technical details of an endpoint that can be used for electronic services, such as for web services providing XDS.b or a REST endpoint for another FHIR server. This may include any security context information. """ __resource_type__ = "Endpoint" address: fhirtypes.UrlType | None = Field( default=None, alias="address", title="The technical base address for connecting to this endpoint", description="The uri that describes the actual end-point to connect to.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) address__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_address", title="Extension field for ``address``." ) connectionType: fhirtypes.CodingType = Field( default=..., alias="connectionType", title="Protocol/Profile/Standard to be used with this endpoint connection", description=( "A coded value that represents the technical details of the usage of " "this endpoint, such as what WSDLs should be used in what way. (e.g. " "XDS.b/DICOM/cds-hook)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="contact", title="Contact details for source (e.g. troubleshooting)", description=( "Contact details for a human to contact about the subscription. The " "primary use of this for system administrator troubleshooting." ), json_schema_extra={ "element_property": True, }, ) header: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="header", title="Usage depends on the channel type", description="Additional headers / information to send as part of the notification.", json_schema_extra={ "element_property": True, }, ) header__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_header", title="Extension field for ``header``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifies this endpoint across multiple systems", description=( "Identifier for the organization that is used to identify the endpoint " "across multiple disparate systems." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) managingOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="managingOrganization", title=( "Organization that manages this endpoint (might not be the organization" " that exposes the endpoint)" ), description=( "The organization that manages this endpoint (even if technically " "another organization is hosting this in the cloud, it is the " "organization associated with the data)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="A name that this endpoint can be identified by", description="A friendly name that this endpoint can be referred to with.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) payloadMimeType: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="payloadMimeType", title=( "Mimetype to send. If not specified, the content could be anything " "(including no payload, if the connectionType defined this)" ), description=( "The mime type to send the payload in - e.g. application/fhir+xml, " "application/fhir+json. If the mime type is not specified, then the " "sender could send any content (including no content depending on the " "connectionType)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) payloadMimeType__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_payloadMimeType", title="Extension field for ``payloadMimeType``.", ) payloadType: typing.List[fhirtypes.CodeableConceptType] = Field( default=..., alias="payloadType", title=( "The type of content that may be used at this endpoint (e.g. XDS " "Discharge summaries)" ), description=( "The payload type describes the acceptable content that can be " "communicated on the endpoint." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Interval the endpoint is expected to be operational", description="The interval during which the endpoint is expected to be operational.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | suspended | error | off | entered-in-error | test", description="active | suspended | error | off | test.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "active", "suspended", "error", "off", "entered-in-error", "test", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Endpoint`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "connectionType", "name", "managingOrganization", "contact", "period", "payloadType", "payloadMimeType", "address", "header", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Endpoint`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "connectionType", "name", "managingOrganization", "period", "payloadType", "payloadMimeType", "address", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("address", "address__ext"), ("status", "status__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/enrollmentrequest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/EnrollmentRequest Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class EnrollmentRequest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Enroll in coverage. This resource provides the insurance enrollment details to the insurer regarding a specified coverage. """ __resource_type__ = "EnrollmentRequest" candidate: fhirtypes.ReferenceType | None = Field( default=None, alias="candidate", title="The subject to be enrolled", description="Patient Resource.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) coverage: fhirtypes.ReferenceType | None = Field( default=None, alias="coverage", title="Insurance information", description="Reference to the program or plan identification, underwriter or payor.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage"], }, ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Creation date", description="The date when this resource was created.", json_schema_extra={ "element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier", description="The Response business identifier.", json_schema_extra={ "element_property": True, }, ) insurer: fhirtypes.ReferenceType | None = Field( default=None, alias="insurer", title="Target", description="The Insurer who is target of the request.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) provider: fhirtypes.ReferenceType | None = Field( default=None, alias="provider", title="Responsible practitioner", description=( "The practitioner who is responsible for the services rendered to the " "patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EnrollmentRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "created", "insurer", "provider", "candidate", "coverage", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EnrollmentRequest`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "status"] ================================================ FILE: fhir/resources/R4B/enrollmentresponse.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/EnrollmentResponse Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class EnrollmentResponse(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. EnrollmentResponse resource. This resource provides enrollment and plan details from the processing of an EnrollmentRequest resource. """ __resource_type__ = "EnrollmentResponse" created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Creation date", description=( "The date when the enclosed suite of services were performed or " "completed." ), json_schema_extra={ "element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) disposition: fhirtypes.StringType | None = Field( default=None, alias="disposition", title="Disposition Message", description="A description of the status of the adjudication.", json_schema_extra={ "element_property": True, }, ) disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_disposition", title="Extension field for ``disposition``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier", description="The Response business identifier.", json_schema_extra={ "element_property": True, }, ) organization: fhirtypes.ReferenceType | None = Field( default=None, alias="organization", title="Insurer", description="The Insurer who produced this adjudicated response.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) outcome: fhirtypes.CodeType | None = Field( default=None, alias="outcome", title="queued | complete | error | partial", description="Processing status: error, complete.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["queued", "complete", "error", "partial"], }, ) outcome__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_outcome", title="Extension field for ``outcome``." ) request: fhirtypes.ReferenceType | None = Field( default=None, alias="request", title="Claim reference", description="Original request resource reference.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["EnrollmentRequest"], }, ) requestProvider: fhirtypes.ReferenceType | None = Field( default=None, alias="requestProvider", title="Responsible practitioner", description=( "The practitioner who is responsible for the services rendered to the " "patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EnrollmentResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "request", "outcome", "disposition", "created", "organization", "requestProvider", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EnrollmentResponse`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "status"] ================================================ FILE: fhir/resources/R4B/episodeofcare.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/EpisodeOfCare Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class EpisodeOfCare(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An association of a Patient with an Organization and Healthcare Provider(s) for a period of time that the Organization assumes some level of responsibility. An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. """ __resource_type__ = "EpisodeOfCare" account: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="account", title=( "The set of accounts that may be used for billing for this " "EpisodeOfCare" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Account"], }, ) careManager: fhirtypes.ReferenceType | None = Field( default=None, alias="careManager", title="Care manager/care coordinator for the patient", description=( "The practitioner that is the care manager/care coordinator for this " "patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) diagnosis: typing.List[fhirtypes.EpisodeOfCareDiagnosisType] | None = Field( default=None, alias="diagnosis", title="The list of diagnosis relevant to this episode of care", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier(s) relevant for this EpisodeOfCare", description=( "The EpisodeOfCare may be known by different identifiers for different " "contexts of use, such as when an external agency is tracking the " "Episode for funding purposes." ), json_schema_extra={ "element_property": True, }, ) managingOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="managingOrganization", title="Organization that assumes care", description=( "The organization that has assumed the specific responsibilities for " "the specified duration." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="The patient who is the focus of this episode of care", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Interval during responsibility is assumed", description=( "The interval during which the managing organization assumes the " "defined responsibility." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) referralRequest: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="referralRequest", title="Originating Referral Request(s)", description=( "Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming" " referrals." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ServiceRequest"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "planned | waitlist | active | onhold | finished | cancelled | entered-" "in-error" ), description="planned | waitlist | active | onhold | finished | cancelled.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "planned", "waitlist", "active", "onhold", "finished", "cancelled", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusHistory: typing.List[fhirtypes.EpisodeOfCareStatusHistoryType] | None = Field( default=None, alias="statusHistory", title=( "Past list of status codes (the current status may be included to cover" " the start date of the status)" ), description=( "The history of statuses that the EpisodeOfCare has been through " "(without requiring processing the history of the resource)." ), json_schema_extra={ "element_property": True, }, ) team: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="team", title="Other practitioners facilitating this episode of care", description=( "The list of practitioners that may be facilitating this episode of " "care for specific purposes." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CareTeam"], }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Type/class - e.g. specialist referral, disease management", description=( "A classification of the type of episode of care; e.g. specialist " "referral, disease management, type of funded care." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EpisodeOfCare`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "statusHistory", "type", "diagnosis", "patient", "managingOrganization", "period", "referralRequest", "careManager", "team", "account", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EpisodeOfCare`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "status", "type", "diagnosis", "patient", "managingOrganization", "period", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class EpisodeOfCareDiagnosis(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The list of diagnosis relevant to this episode of care. """ __resource_type__ = "EpisodeOfCareDiagnosis" condition: fhirtypes.ReferenceType = Field( default=..., alias="condition", title="Conditions/problems/diagnoses this episode of care is for", description=( "A list of conditions/problems/diagnoses that this episode of care is " "intended to be providing care for." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) rank: fhirtypes.PositiveIntType | None = Field( default=None, alias="rank", title="Ranking of the diagnosis (for each role type)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) rank__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rank", title="Extension field for ``rank``." ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title=( "Role that this diagnosis has within the episode of care (e.g. " "admission, billing, discharge \u2026)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EpisodeOfCareDiagnosis`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "condition", "role", "rank"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EpisodeOfCareDiagnosis`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "condition", "role", "rank"] class EpisodeOfCareStatusHistory(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Past list of status codes (the current status may be included to cover the start date of the status). The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource). """ __resource_type__ = "EpisodeOfCareStatusHistory" period: fhirtypes.PeriodType = Field( default=..., alias="period", title="Duration the EpisodeOfCare was in the specified status", description="The period during this EpisodeOfCare that the specific status applied.", json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "planned | waitlist | active | onhold | finished | cancelled | entered-" "in-error" ), description="planned | waitlist | active | onhold | finished | cancelled.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "planned", "waitlist", "active", "onhold", "finished", "cancelled", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EpisodeOfCareStatusHistory`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "status", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EpisodeOfCareStatusHistory`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/eventdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/EventDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class EventDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A description of when an event can occur. The EventDefinition resource provides a reusable description of when a particular event can occur. """ __resource_type__ = "EventDefinition" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the event definition was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the content", description=( "An individiual or organization primarily involved in the creation and " "maintenance of the content." ), json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the event definition and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the event definition." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the event definition was " "published. The date must change when the business version changes and " "it must change if the status code changes. In addition, it should " "change when the substantive content of the event definition changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the event definition", description=( "A free text natural language description of the event definition from " "a consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the content", description=( "An individual or organization primarily responsible for internal " "coherence of the content." ), json_schema_extra={ "element_property": True, }, ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the event definition is expected to be used", description=( "The period during which the event definition content was or is planned" " to be in active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the content", description=( "An individual or organization responsible for officially endorsing the" " content for use in some setting." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this event definition is authored for" " testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the event definition", description=( "A formal identifier that is used to identify this event definition " "when it is represented in other formats, or referenced in a " "specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for event definition (if applicable)", description=( "A legal or geographic region in which the event definition is intended" " to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the event definition was last reviewed", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this event definition (computer friendly)", description=( "A natural language name identifying the event definition. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the event " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this event definition is defined", description=( "Explanation of why this event definition is needed and why it has been" " designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Additional documentation, citations, etc.", description=( "Related resources such as additional documentation, justification, or " "bibliographic references." ), json_schema_extra={ "element_property": True, }, ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the content", description=( "An individual or organization primarily responsible for review of some" " aspect of the content." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this event definition. Enables tracking the life-cycle " "of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subjectCodeableConcept", title="Type of individual the event definition is focused on", description=( "A code or group definition that describes the intended subject of the " "event definition." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, }, ) subjectReference: fhirtypes.ReferenceType | None = Field( default=None, alias="subjectReference", title="Type of individual the event definition is focused on", description=( "A code or group definition that describes the intended subject of the " "event definition." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) subtitle: fhirtypes.StringType | None = Field( default=None, alias="subtitle", title="Subordinate title of the event definition", description=( "An explanatory or alternate title for the event definition giving " "additional information about its content." ), json_schema_extra={ "element_property": True, }, ) subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subtitle", title="Extension field for ``subtitle``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this event definition (human friendly)", description="A short, descriptive, user-friendly title for the event definition.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) topic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="topic", title="E.g. Education, Treatment, Assessment, etc.", description=( "Descriptive topics related to the module. Topics provide a high-level " "categorization of the module that can be useful for filtering and " "searching." ), json_schema_extra={ "element_property": True, }, ) trigger: typing.List[fhirtypes.TriggerDefinitionType] = Field( default=..., alias="trigger", title="\"when\" the event occurs (multiple = 'or')", description=( "The trigger element defines when the event occurs. If more than one " "trigger condition is specified, the event fires whenever any one of " "the trigger conditions is met." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this event definition, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this event definition when it" " is referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which at which an authoritative " "instance of this event definition is (or will be) published. This URL " "can be the target of a canonical reference. It SHALL remain the same " "when the event definition is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) usage: fhirtypes.StringType | None = Field( default=None, alias="usage", title="Describes the clinical usage of the event definition", description=( "A detailed description of how the event definition is used from a " "clinical perspective." ), json_schema_extra={ "element_property": True, }, ) usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usage", title="Extension field for ``usage``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate event definition instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the event definition", description=( "The identifier that is used to identify this version of the event " "definition when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the event definition " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EventDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "subtitle", "status", "experimental", "subjectCodeableConcept", "subjectReference", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "usage", "copyright", "approvalDate", "lastReviewDate", "effectivePeriod", "topic", "author", "editor", "reviewer", "endorser", "relatedArtifact", "trigger", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EventDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "approvalDate", "lastReviewDate", "effectivePeriod", "trigger", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"subject": ["subjectCodeableConcept", "subjectReference"]} return one_of_many_fields ================================================ FILE: fhir/resources/R4B/evidence.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Evidence Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Evidence(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Single evidence bit. The Evidence Resource provides a machine-interpretable expression of an evidence concept including the evidence variables (eg population, exposures/interventions, comparators, outcomes, measured variables, confounding variables), the statistics, and the certainty of this evidence. """ __resource_type__ = "Evidence" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the summary was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) assertion: fhirtypes.MarkdownType | None = Field( default=None, alias="assertion", title="Declarative description of the Evidence", description=None, json_schema_extra={ "element_property": True, }, ) assertion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_assertion", title="Extension field for ``assertion``." ) author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the content", description=( "An individiual, organization, or device primarily involved in the " "creation and maintenance of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) certainty: typing.List[fhirtypes.EvidenceCertaintyType] | None = Field( default=None, alias="certainty", title="Certainty or quality of the evidence", description=( "Assessment of certainty, confidence in the estimates, or quality of " "the evidence." ), json_schema_extra={ "element_property": True, }, ) citeAsMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="citeAsMarkdown", title="Citation for this evidence", description="Citation Resource or display of suggested citation for this evidence.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e citeAs[x] "one_of_many": "citeAs", "one_of_many_required": False, }, ) citeAsMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_citeAsMarkdown", title="Extension field for ``citeAsMarkdown``.", ) citeAsReference: fhirtypes.ReferenceType | None = Field( default=None, alias="citeAsReference", title="Citation for this evidence", description="Citation Resource or display of suggested citation for this evidence.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e citeAs[x] "one_of_many": "citeAs", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Citation"], }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the summary was published. The " "date must change when the business version changes and it must change " "if the status code changes. In addition, it should change when the " "substantive content of the summary changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Description of the particular summary", description=( "A free text natural language description of the evidence from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the content", description=( "An individiual, organization, or device primarily responsible for " "internal coherence of the content." ), json_schema_extra={ "element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the content", description=( "An individiual, organization, or device responsible for officially " "endorsing the content for use in some setting." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the summary", description=( "A formal identifier that is used to identify this summary when it is " "represented in other formats, or referenced in a specification, model," " design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the summary was last reviewed", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Footnotes and/or explanatory notes", description=None, json_schema_extra={ "element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the " "evidence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Link or citation to artifact associated with the summary", description=None, json_schema_extra={ "element_property": True, }, ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the content", description=( "An individiual, organization, or device primarily responsible for " "review of some aspect of the content." ), json_schema_extra={ "element_property": True, }, ) statistic: typing.List[fhirtypes.EvidenceStatisticType] | None = Field( default=None, alias="statistic", title="Values and parameters for a single statistic", description=None, json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this summary. Enables tracking the life-cycle of the " "content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) studyType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="studyType", title="The type of study that produced this evidence", description=None, json_schema_extra={ "element_property": True, }, ) synthesisType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="synthesisType", title="The method to combine studies", description=None, json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this summary (human friendly)", description="A short, descriptive, user-friendly title for the summary.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this evidence, represented as a globally " "unique URI" ), description=( "An absolute URI that is used to identify this evidence when it is " "referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which at which an authoritative " "instance of this summary is (or will be) published. This URL can be " "the target of a canonical reference. It SHALL remain the same when the" " summary is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate evidence instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) variableDefinition: typing.List[fhirtypes.EvidenceVariableDefinitionType] = Field( default=..., alias="variableDefinition", title="Evidence variable such as population, exposure, or outcome", description=None, json_schema_extra={ "element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of this summary", description=( "The identifier that is used to identify this version of the summary " "when it is referenced in a specification, model, design or instance. " "This is an arbitrary value managed by the summary author and is not " "expected to be globally unique. For example, it might be a timestamp " "(e.g. yyyymmdd) if a managed version is not available. There is also " "no expectation that versions can be placed in a lexicographical " "sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Evidence`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "title", "citeAsReference", "citeAsMarkdown", "status", "date", "useContext", "approvalDate", "lastReviewDate", "publisher", "contact", "author", "editor", "reviewer", "endorser", "relatedArtifact", "description", "assertion", "note", "variableDefinition", "synthesisType", "studyType", "statistic", "certainty", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Evidence`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "title", "status", "date", "useContext", "publisher", "contact", "author", "endorser", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"citeAs": ["citeAsMarkdown", "citeAsReference"]} return one_of_many_fields class EvidenceCertainty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Certainty or quality of the evidence. Assessment of certainty, confidence in the estimates, or quality of the evidence. """ __resource_type__ = "EvidenceCertainty" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Textual description of certainty", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Footnotes and/or explanatory notes", description=None, json_schema_extra={ "element_property": True, }, ) rater: fhirtypes.StringType | None = Field( default=None, alias="rater", title="Individual or group who did the rating", description=None, json_schema_extra={ "element_property": True, }, ) rater__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rater", title="Extension field for ``rater``." ) rating: fhirtypes.CodeableConceptType | None = Field( default=None, alias="rating", title="Assessment or judgement of the aspect", description=None, json_schema_extra={ "element_property": True, }, ) subcomponent: typing.List[fhirtypes.EvidenceCertaintyType] | None = Field( default=None, alias="subcomponent", title="A domain or subdomain of certainty", description=None, json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Aspect of certainty being rated", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceCertainty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "note", "type", "rating", "rater", "subcomponent", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceCertainty`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EvidenceStatistic(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Values and parameters for a single statistic. """ __resource_type__ = "EvidenceStatistic" attributeEstimate: typing.List[ fhirtypes.EvidenceStatisticAttributeEstimateType ] | None = Field( default=None, alias="attributeEstimate", title="An attribute of the Statistic", description=( "A statistical attribute of the statistic such as a measure of " "heterogeneity." ), json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Associated category for categorical variable", description=( "When the measured variable is handled categorically, the category " "element is used to define which category the statistic is reporting." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Description of content", description="A description of the content value of the statistic.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) modelCharacteristic: typing.List[ fhirtypes.EvidenceStatisticModelCharacteristicType ] | None = Field( default=None, alias="modelCharacteristic", title="An aspect of the statistical model", description="A component of the method to generate the statistic.", json_schema_extra={ "element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Footnotes and/or explanatory notes", description=None, json_schema_extra={ "element_property": True, }, ) numberAffected: fhirtypes.UnsignedIntType | None = Field( default=None, alias="numberAffected", title="The number of participants affected", description=( "The number of participants affected where the unit of analysis is the " "same as sampleSize.knownDataCount and sampleSize.numberOfParticipants." ), json_schema_extra={ "element_property": True, }, ) numberAffected__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_numberAffected", title="Extension field for ``numberAffected``.", ) numberOfEvents: fhirtypes.UnsignedIntType | None = Field( default=None, alias="numberOfEvents", title="The number of events associated with the statistic", description=( "The number of events associated with the statistic, where the unit of " "analysis is different from numberAffected, sampleSize.knownDataCount " "and sampleSize.numberOfParticipants." ), json_schema_extra={ "element_property": True, }, ) numberOfEvents__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_numberOfEvents", title="Extension field for ``numberOfEvents``.", ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Statistic value", description=None, json_schema_extra={ "element_property": True, }, ) sampleSize: fhirtypes.EvidenceStatisticSampleSizeType | None = Field( default=None, alias="sampleSize", title="Number of samples in the statistic", description=None, json_schema_extra={ "element_property": True, }, ) statisticType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="statisticType", title="Type of statistic, eg relative risk", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceStatistic`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "note", "statisticType", "category", "quantity", "numberOfEvents", "numberAffected", "sampleSize", "attributeEstimate", "modelCharacteristic", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceStatistic`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EvidenceStatisticAttributeEstimate(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An attribute of the Statistic. A statistical attribute of the statistic such as a measure of heterogeneity. """ __resource_type__ = "EvidenceStatisticAttributeEstimate" attributeEstimate: typing.List[ fhirtypes.EvidenceStatisticAttributeEstimateType ] | None = Field( default=None, alias="attributeEstimate", title=( "A nested attribute estimate; which is the attribute estimate of an " "attribute estimate" ), description=None, json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Textual description of the attribute estimate", description="Human-readable summary of the estimate.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) level: fhirtypes.DecimalType | None = Field( default=None, alias="level", title="Level of confidence interval, eg 0.95 for 95% confidence interval", description="Use 95 for a 95% confidence interval.", json_schema_extra={ "element_property": True, }, ) level__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_level", title="Extension field for ``level``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Footnote or explanatory note about the estimate", description=None, json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title=( "The singular quantity of the attribute estimate, for attribute " "estimates represented as single values; also used to report unit of " "measure" ), description=None, json_schema_extra={ "element_property": True, }, ) range: fhirtypes.RangeType | None = Field( default=None, alias="range", title="Lower and upper bound values of the attribute estimate", description="Lower bound of confidence interval.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The type of attribute estimate, eg confidence interval or p value", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceStatisticAttributeEstimate`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "note", "type", "quantity", "level", "range", "attributeEstimate", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceStatisticAttributeEstimate`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EvidenceStatisticModelCharacteristic(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An aspect of the statistical model. A component of the method to generate the statistic. """ __resource_type__ = "EvidenceStatisticModelCharacteristic" attributeEstimate: typing.List[ fhirtypes.EvidenceStatisticAttributeEstimateType ] | None = Field( default=None, alias="attributeEstimate", title="An attribute of the statistic used as a model characteristic", description=None, json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Model specification", description="Description of a component of the method to generate the statistic.", json_schema_extra={ "element_property": True, }, ) value: fhirtypes.QuantityType | None = Field( default=None, alias="value", title="Numerical value to complete model specification", description=( "Further specification of the quantified value of the component of the " "method to generate the statistic." ), json_schema_extra={ "element_property": True, }, ) variable: typing.List[ fhirtypes.EvidenceStatisticModelCharacteristicVariableType ] | None = Field( default=None, alias="variable", title="A variable adjusted for in the adjusted analysis", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceStatisticModelCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "value", "variable", "attributeEstimate", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceStatisticModelCharacteristic`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EvidenceStatisticModelCharacteristicVariable(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A variable adjusted for in the adjusted analysis. """ __resource_type__ = "EvidenceStatisticModelCharacteristicVariable" handling: fhirtypes.CodeType | None = Field( default=None, alias="handling", title="continuous | dichotomous | ordinal | polychotomous", description="How the variable is classified for use in adjusted analysis.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["continuous", "dichotomous", "ordinal", "polychotomous"], }, ) handling__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_handling", title="Extension field for ``handling``." ) valueCategory: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="valueCategory", title="Description for grouping of ordinal or polychotomous variables", description=None, json_schema_extra={ "element_property": True, }, ) valueQuantity: typing.List[fhirtypes.QuantityType] | None = Field( default=None, alias="valueQuantity", title="Discrete value for grouping of ordinal or polychotomous variables", description=None, json_schema_extra={ "element_property": True, }, ) valueRange: typing.List[fhirtypes.RangeType] | None = Field( default=None, alias="valueRange", title="Range of values for grouping of ordinal or polychotomous variables", description=None, json_schema_extra={ "element_property": True, }, ) variableDefinition: fhirtypes.ReferenceType = Field( default=..., alias="variableDefinition", title="Description of the variable", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group", "EvidenceVariable"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceStatisticModelCharacteristicVariable`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "variableDefinition", "handling", "valueCategory", "valueQuantity", "valueRange", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceStatisticModelCharacteristicVariable`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EvidenceStatisticSampleSize(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Number of samples in the statistic. """ __resource_type__ = "EvidenceStatisticSampleSize" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Textual description of sample size for statistic", description="Human-readable summary of population sample size.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) knownDataCount: fhirtypes.UnsignedIntType | None = Field( default=None, alias="knownDataCount", title="Number of participants with known results for measured variables", description=None, json_schema_extra={ "element_property": True, }, ) knownDataCount__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_knownDataCount", title="Extension field for ``knownDataCount``.", ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Footnote or explanatory note about the sample size", description=None, json_schema_extra={ "element_property": True, }, ) numberOfParticipants: fhirtypes.UnsignedIntType | None = Field( default=None, alias="numberOfParticipants", title="Cumulative number of participants", description=( "A human-readable string to clarify or explain concepts about the " "sample size." ), json_schema_extra={ "element_property": True, }, ) numberOfParticipants__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_numberOfParticipants", title="Extension field for ``numberOfParticipants``.", ) numberOfStudies: fhirtypes.UnsignedIntType | None = Field( default=None, alias="numberOfStudies", title="Number of contributing studies", description="Number of participants in the population.", json_schema_extra={ "element_property": True, }, ) numberOfStudies__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_numberOfStudies", title="Extension field for ``numberOfStudies``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceStatisticSampleSize`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "note", "numberOfStudies", "numberOfParticipants", "knownDataCount", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceStatisticSampleSize`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EvidenceVariableDefinition(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Evidence variable such as population, exposure, or outcome. """ __resource_type__ = "EvidenceVariableDefinition" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="A text description or summary of the variable", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) directnessMatch: fhirtypes.CodeableConceptType | None = Field( default=None, alias="directnessMatch", title="low | moderate | high | exact", description=( "Indication of quality of match between intended variable to actual " "variable." ), json_schema_extra={ "element_property": True, }, ) intended: fhirtypes.ReferenceType | None = Field( default=None, alias="intended", title="Definition of the intended variable related to the Evidence", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group", "EvidenceVariable"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Footnotes and/or explanatory notes", description=None, json_schema_extra={ "element_property": True, }, ) observed: fhirtypes.ReferenceType | None = Field( default=None, alias="observed", title="Definition of the actual variable related to the statistic(s)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group", "EvidenceVariable"], }, ) variableRole: fhirtypes.CodeableConceptType = Field( default=..., alias="variableRole", title=( "population | subpopulation | exposure | referenceExposure | " "measuredVariable | confounder" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceVariableDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "note", "variableRole", "observed", "intended", "directnessMatch", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceVariableDefinition`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "variableRole", "observed"] ================================================ FILE: fhir/resources/R4B/evidencereport.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/EvidenceReport Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class EvidenceReport(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A EvidenceReport. The EvidenceReport Resource is a specialized container for a collection of resources and codable concepts, adapted to support compositions of Evidence, EvidenceVariable, and Citation resources and related concepts. """ __resource_type__ = "EvidenceReport" author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the content", description=( "An individiual, organization, or device primarily involved in the " "creation and maintenance of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) citeAsMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="citeAsMarkdown", title="Citation for this report", description="Citation Resource or display of suggested citation for this report.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e citeAs[x] "one_of_many": "citeAs", "one_of_many_required": False, }, ) citeAsMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_citeAsMarkdown", title="Extension field for ``citeAsMarkdown``.", ) citeAsReference: fhirtypes.ReferenceType | None = Field( default=None, alias="citeAsReference", title="Citation for this report", description="Citation Resource or display of suggested citation for this report.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e citeAs[x] "one_of_many": "citeAs", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Citation"], }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the content", description=( "An individiual, organization, or device primarily responsible for " "internal coherence of the content." ), json_schema_extra={ "element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the content", description=( "An individiual, organization, or device responsible for officially " "endorsing the content for use in some setting." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique identifier for the evidence report", description=( "A formal identifier that is used to identify this EvidenceReport when " "it is represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Used for footnotes and annotations", description=None, json_schema_extra={ "element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the evidence" " report." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Link, description or reference to artifact associated with the report", description=None, json_schema_extra={ "element_property": True, }, ) relatedIdentifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="relatedIdentifier", title=( "Identifiers for articles that may relate to more than one evidence " "report" ), description=( "A formal identifier that is used to identify things closely related to" " this EvidenceReport." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) relatesTo: typing.List[fhirtypes.EvidenceReportRelatesToType] | None = Field( default=None, alias="relatesTo", title="Relationships to other compositions/documents", description=( "Relationships that this composition has with other compositions or " "documents that already exist." ), json_schema_extra={ "element_property": True, }, ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the content", description=( "An individiual, organization, or device primarily responsible for " "review of some aspect of the content." ), json_schema_extra={ "element_property": True, }, ) section: typing.List[fhirtypes.EvidenceReportSectionType] | None = Field( default=None, alias="section", title="Composition is broken into sections", description="The root of the sections that make up the composition.", json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this summary. Enables tracking the life-cycle of the " "content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.EvidenceReportSubjectType = Field( default=..., alias="subject", title="Focus of the report", description=( 'Specifies the subject or focus of the report. Answers "What is this ' 'report about?".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Kind of report", description=( "Specifies the kind of report, such as grouping of classifiers, search " "results, or human-compiled expression." ), json_schema_extra={ "element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this EvidenceReport, represented as a " "globally unique URI" ), description=( "An absolute URI that is used to identify this EvidenceReport when it " "is referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which at which an authoritative " "instance of this summary is (or will be) published. This URL can be " "the target of a canonical reference. It SHALL remain the same when the" " summary is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate evidence report instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceReport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "status", "useContext", "identifier", "relatedIdentifier", "citeAsReference", "citeAsMarkdown", "type", "note", "relatedArtifact", "subject", "publisher", "contact", "author", "editor", "reviewer", "endorser", "relatesTo", "section", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceReport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "status", "useContext", "identifier", "relatedIdentifier", "subject", "publisher", "contact", "author", "endorser", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"citeAs": ["citeAsMarkdown", "citeAsReference"]} return one_of_many_fields class EvidenceReportRelatesTo(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Relationships to other compositions/documents. Relationships that this composition has with other compositions or documents that already exist. """ __resource_type__ = "EvidenceReportRelatesTo" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title=( "replaces | amends | appends | transforms | replacedWith | amendedWith " "| appendedWith | transformedWith" ), description=( "The type of relationship that this composition has with anther " "composition or document." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "replaces", "amends", "appends", "transforms", "replacedWith", "amendedWith", "appendedWith", "transformedWith", ], }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) targetIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="targetIdentifier", title="Target of the relationship", description="The target composition/document of this relationship.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e target[x] "one_of_many": "target", "one_of_many_required": True, }, ) targetReference: fhirtypes.ReferenceType | None = Field( default=None, alias="targetReference", title="Target of the relationship", description="The target composition/document of this relationship.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e target[x] "one_of_many": "target", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["EvidenceReport"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceReportRelatesTo`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "targetIdentifier", "targetReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceReportRelatesTo`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"target": ["targetIdentifier", "targetReference"]} return one_of_many_fields class EvidenceReportSection(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Composition is broken into sections. The root of the sections that make up the composition. """ __resource_type__ = "EvidenceReportSection" author: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="author", title="Who and/or what authored the section", description=( "Identifies who is responsible for the information in this section, not" " necessarily who typed it in." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Person", "Device", "Group", "Organization"], }, ) emptyReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="emptyReason", title="Why the section is empty", description=( "If the section is empty, why the list is empty. An empty section " "typically has some text explaining the empty reason." ), json_schema_extra={ "element_property": True, }, ) entryClassifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="entryClassifier", title="Extensible classifiers as content", description="Specifies any type of classification of the evidence report.", json_schema_extra={ "element_property": True, }, ) entryQuantity: typing.List[fhirtypes.QuantityType] | None = Field( default=None, alias="entryQuantity", title="Quantity as content", description=None, json_schema_extra={ "element_property": True, }, ) entryReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="entryReference", title="Reference to resources as content", description=( "A reference to the actual resource from which the narrative in the " "section is derived." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) focus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="focus", title="Classification of section (recommended)", description=( "A code identifying the kind of content contained within the section. " "This should be consistent with the section title." ), json_schema_extra={ "element_property": True, }, ) focusReference: fhirtypes.ReferenceType | None = Field( default=None, alias="focusReference", title="Classification of section by Resource", description=( "A definitional Resource identifying the kind of content contained " "within the section. This should be consistent with the section title." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="working | snapshot | changes", description=( "How the entry list was prepared - whether it is a working list that is" " suitable for being maintained on an ongoing basis, or if it " "represents a snapshot of a list of items from another source, or " "whether it is a prepared list where items may be marked as added, " "modified or deleted." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["working", "snapshot", "changes"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) orderedBy: fhirtypes.CodeableConceptType | None = Field( default=None, alias="orderedBy", title="Order of section entries", description="Specifies the order applied to the items in the section entries.", json_schema_extra={ "element_property": True, }, ) section: typing.List[fhirtypes.EvidenceReportSectionType] | None = Field( default=None, alias="section", title="Nested Section", description="A nested sub-section within this section.", json_schema_extra={ "element_property": True, }, ) text: fhirtypes.NarrativeType | None = Field( default=None, alias="text", title="Text summary of the section, for human interpretation", description=( "A human-readable narrative that contains the attested content of the " "section, used to represent the content of the resource to a human. The" " narrative need not encode all the structured data, but is peferred to" " contain sufficient detail to make it acceptable for a human to just " "read the narrative." ), json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Label for section (e.g. for ToC)", description=( "The label for this particular section. This will be part of the " "rendered content for the document, and is often used to build a table " "of contents." ), json_schema_extra={ "element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceReportSection`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "title", "focus", "focusReference", "author", "text", "mode", "orderedBy", "entryClassifier", "entryReference", "entryQuantity", "emptyReason", "section", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceReportSection`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EvidenceReportSubject(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Focus of the report. Specifies the subject or focus of the report. Answers "What is this report about?". """ __resource_type__ = "EvidenceReportSubject" characteristic: typing.List[ fhirtypes.EvidenceReportSubjectCharacteristicType ] | None = Field( default=None, alias="characteristic", title="Characteristic", description=None, json_schema_extra={ "element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Footnotes and/or explanatory notes", description="Used for general notes and annotations not coded elsewhere.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceReportSubject`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "characteristic", "note"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceReportSubject`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EvidenceReportSubjectCharacteristic(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Characteristic. """ __resource_type__ = "EvidenceReportSubjectCharacteristic" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Characteristic code", description=None, json_schema_extra={ "element_property": True, }, ) exclude: bool | None = Field( default=None, alias="exclude", title="Is used to express not the characteristic", description=None, json_schema_extra={ "element_property": True, }, ) exclude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_exclude", title="Extension field for ``exclude``." ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Timeframe for the characteristic", description=None, json_schema_extra={ "element_property": True, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Characteristic value", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Characteristic value", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Characteristic value", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Characteristic value", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Characteristic value", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceReportSubjectCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "valueReference", "valueCodeableConcept", "valueBoolean", "valueQuantity", "valueRange", "exclude", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceReportSubjectCharacteristic`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueCodeableConcept", "valueQuantity", "valueRange", "valueReference", ] } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/evidencevariable.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/EvidenceVariable Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class EvidenceVariable(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A definition of an exposure, outcome, or other variable. The EvidenceVariable resource describes an element that knowledge (Evidence) is about. """ __resource_type__ = "EvidenceVariable" actual: bool | None = Field( default=None, alias="actual", title="Actual or conceptual", description=( "True if the actual variable measured, false if a conceptual " "representation of the intended variable." ), json_schema_extra={ "element_property": True, }, ) actual__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_actual", title="Extension field for ``actual``." ) author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the content", description=( "An individiual or organization primarily involved in the creation and " "maintenance of the content." ), json_schema_extra={ "element_property": True, }, ) category: typing.List[fhirtypes.EvidenceVariableCategoryType] | None = Field( default=None, alias="category", title="A grouping for ordinal or polychotomous variables", description=( "A grouping (or set of values) described along with other groupings to " "specify the set of groupings allowed for the variable." ), json_schema_extra={ "element_property": True, }, ) characteristic: typing.List[ fhirtypes.EvidenceVariableCharacteristicType ] | None = Field( default=None, alias="characteristic", title="What defines the members of the evidence element", description=( "A characteristic that defines the members of the evidence element. " 'Multiple characteristics are applied with "and" semantics.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) characteristicCombination: fhirtypes.CodeType | None = Field( default=None, alias="characteristicCombination", title="intersection | union", description=( "Used to specify if two or more characteristics are combined with OR or" " AND." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["intersection", "union"], }, ) characteristicCombination__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_characteristicCombination", title="Extension field for ``characteristicCombination``.", ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the evidence variable was " "published. The date must change when the business version changes and " "it must change if the status code changes. In addition, it should " "change when the substantive content of the evidence variable changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the evidence variable", description=( "A free text natural language description of the evidence variable from" " a consumer's perspective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the content", description=( "An individual or organization primarily responsible for internal " "coherence of the content." ), json_schema_extra={ "element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the content", description=( "An individual or organization responsible for officially endorsing the" " content for use in some setting." ), json_schema_extra={ "element_property": True, }, ) handling: fhirtypes.CodeType | None = Field( default=None, alias="handling", title="continuous | dichotomous | ordinal | polychotomous", description="Used for an outcome to classify.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["continuous", "dichotomous", "ordinal", "polychotomous"], }, ) handling__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_handling", title="Extension field for ``handling``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the evidence variable", description=( "A formal identifier that is used to identify this evidence variable " "when it is represented in other formats, or referenced in a " "specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this evidence variable (computer friendly)", description=( "A natural language name identifying the evidence variable. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Used for footnotes or explanatory notes", description=( "A human-readable string to clarify or explain concepts about the " "resource." ), json_schema_extra={ "element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the evidence" " variable." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Additional documentation, citations, etc.", description=( "Related artifacts such as additional documentation, justification, or " "bibliographic references." ), json_schema_extra={ "element_property": True, }, ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the content", description=( "An individual or organization primarily responsible for review of some" " aspect of the content." ), json_schema_extra={ "element_property": True, }, ) shortTitle: fhirtypes.StringType | None = Field( default=None, alias="shortTitle", title="Title for use in informal contexts", description=( "The short title provides an alternate title for use in informal " "descriptive contexts where the full, formal title is not necessary." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) shortTitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_shortTitle", title="Extension field for ``shortTitle``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this evidence variable. Enables tracking the life-cycle " "of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subtitle: fhirtypes.StringType | None = Field( default=None, alias="subtitle", title="Subordinate title of the EvidenceVariable", description=( "An explanatory or alternate title for the EvidenceVariable giving " "additional information about its content." ), json_schema_extra={ "element_property": True, }, ) subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subtitle", title="Extension field for ``subtitle``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this evidence variable (human friendly)", description="A short, descriptive, user-friendly title for the evidence variable.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this evidence variable, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this evidence variable when " "it is referenced in a specification, model, design or an instance; " "also called its canonical identifier. This SHOULD be globally unique " "and SHOULD be a literal address at which at which an authoritative " "instance of this evidence variable is (or will be) published. This URL" " can be the target of a canonical reference. It SHALL remain the same " "when the evidence variable is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate evidence variable instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the evidence variable", description=( "The identifier that is used to identify this version of the evidence " "variable when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the evidence variable " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence. To provide a version consistent with the " "Decision Support Service specification, use the format " "Major.Minor.Revision (e.g. 1.0.0). For more information on versioning " "knowledge assets, refer to the Decision Support Service specification." " Note that a version is required for non-experimental active " "artifacts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceVariable`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "shortTitle", "subtitle", "status", "date", "description", "note", "useContext", "publisher", "contact", "author", "editor", "reviewer", "endorser", "relatedArtifact", "actual", "characteristicCombination", "characteristic", "handling", "category", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceVariable`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "shortTitle", "status", "date", "description", "useContext", "publisher", "contact", "characteristic", "handling", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class EvidenceVariableCategory(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A grouping for ordinal or polychotomous variables. A grouping (or set of values) described along with other groupings to specify the set of groupings allowed for the variable. """ __resource_type__ = "EvidenceVariableCategory" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Description of the grouping", description="A human-readable title or representation of the grouping.", json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Definition of the grouping", description="Value or set of values that define the grouping.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Definition of the grouping", description="Value or set of values that define the grouping.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Definition of the grouping", description="Value or set of values that define the grouping.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceVariableCategory`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "valueCodeableConcept", "valueQuantity", "valueRange", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceVariableCategory`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": ["valueCodeableConcept", "valueQuantity", "valueRange"] } return one_of_many_fields class EvidenceVariableCharacteristic(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What defines the members of the evidence element. A characteristic that defines the members of the evidence element. Multiple characteristics are applied with "and" semantics. """ __resource_type__ = "EvidenceVariableCharacteristic" definitionCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="definitionCanonical", title="What code or expression defines members?", description=( "Define members of the evidence element using Codes (such as condition," " medication, or observation), Expressions ( using an expression " "language such as FHIRPath or CQL) or DataRequirements (such as " "Diabetes diagnosis onset in the last year)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e definition[x] "one_of_many": "definition", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) definitionCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definitionCanonical", title="Extension field for ``definitionCanonical``.", ) definitionCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="definitionCodeableConcept", title="What code or expression defines members?", description=( "Define members of the evidence element using Codes (such as condition," " medication, or observation), Expressions ( using an expression " "language such as FHIRPath or CQL) or DataRequirements (such as " "Diabetes diagnosis onset in the last year)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e definition[x] "one_of_many": "definition", "one_of_many_required": True, }, ) definitionExpression: fhirtypes.ExpressionType | None = Field( default=None, alias="definitionExpression", title="What code or expression defines members?", description=( "Define members of the evidence element using Codes (such as condition," " medication, or observation), Expressions ( using an expression " "language such as FHIRPath or CQL) or DataRequirements (such as " "Diabetes diagnosis onset in the last year)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e definition[x] "one_of_many": "definition", "one_of_many_required": True, }, ) definitionReference: fhirtypes.ReferenceType | None = Field( default=None, alias="definitionReference", title="What code or expression defines members?", description=( "Define members of the evidence element using Codes (such as condition," " medication, or observation), Expressions ( using an expression " "language such as FHIRPath or CQL) or DataRequirements (such as " "Diabetes diagnosis onset in the last year)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e definition[x] "one_of_many": "definition", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group", "EvidenceVariable"], }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Natural language description of the characteristic", description=( "A short, natural language description of the characteristic that could" " be used to communicate the criteria to an end-user." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) device: fhirtypes.ReferenceType | None = Field( default=None, alias="device", title="Device used for determining characteristic", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device", "DeviceMetric"], }, ) exclude: bool | None = Field( default=None, alias="exclude", title="Whether the characteristic includes or excludes members", description=( "When true, members with this characteristic are excluded from the " "element." ), json_schema_extra={ "element_property": True, }, ) exclude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_exclude", title="Extension field for ``exclude``." ) groupMeasure: fhirtypes.CodeType | None = Field( default=None, alias="groupMeasure", title=( "mean | median | mean-of-mean | mean-of-median | median-of-mean | " "median-of-median" ), description=( "Indicates how elements are aggregated within the study effective " "period." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "mean", "median", "mean-of-mean", "mean-of-median", "median-of-mean", "median-of-median", ], }, ) groupMeasure__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_groupMeasure", title="Extension field for ``groupMeasure``.", ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="Method used for describing characteristic", description=None, json_schema_extra={ "element_property": True, }, ) timeFromStart: fhirtypes.EvidenceVariableCharacteristicTimeFromStartType | None = ( Field( default=None, alias="timeFromStart", title="Observation time from study start", description=( "Indicates duration, period, or point of observation from the " "participant's study entry." ), json_schema_extra={ "element_property": True, }, ) ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceVariableCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "definitionReference", "definitionCanonical", "definitionCodeableConcept", "definitionExpression", "method", "device", "exclude", "timeFromStart", "groupMeasure", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceVariableCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "definitionReference", "definitionCanonical", "definitionCodeableConcept", "definitionExpression", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "definition": [ "definitionCanonical", "definitionCodeableConcept", "definitionExpression", "definitionReference", ] } return one_of_many_fields class EvidenceVariableCharacteristicTimeFromStart(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Observation time from study start. Indicates duration, period, or point of observation from the participant's study entry. """ __resource_type__ = "EvidenceVariableCharacteristicTimeFromStart" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Human readable description", description="A short, natural language description.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Used for footnotes or explanatory notes", description=( "A human-readable string to clarify or explain concepts about the " "resource." ), json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title=( "Used to express the observation at a defined amount of time after the " "study start" ), description=None, json_schema_extra={ "element_property": True, }, ) range: fhirtypes.RangeType | None = Field( default=None, alias="range", title="Used to express the observation within a period after the study start", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceVariableCharacteristicTimeFromStart`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "quantity", "range", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceVariableCharacteristicTimeFromStart`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/examplescenario.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ExampleScenario Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ExampleScenario(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Example of workflow instance. """ __resource_type__ = "ExampleScenario" actor: typing.List[fhirtypes.ExampleScenarioActorType] | None = Field( default=None, alias="actor", title="Actor participating in the resource", description=None, json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the example scenario and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the example scenario." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the example scenario was " "published. The date must change when the business version changes and " "it must change if the status code changes. In addition, it should " "change when the substantive content of the example scenario changes. " "(e.g. the 'content logical definition')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this example scenario is authored for" " testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the example scenario", description=( "A formal identifier that is used to identify this example scenario " "when it is represented in other formats, or referenced in a " "specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instance: typing.List[fhirtypes.ExampleScenarioInstanceType] | None = Field( default=None, alias="instance", title="Each resource and each version that is present in the workflow", description=None, json_schema_extra={ "element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for example scenario (if applicable)", description=( "A legal or geographic region in which the example scenario is intended" " to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this example scenario (computer friendly)", description=( "A natural language name identifying the example scenario. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) process: typing.List[fhirtypes.ExampleScenarioProcessType] | None = Field( default=None, alias="process", title="Each major process - a group of operations", description=None, json_schema_extra={ "element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the example " "scenario." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="The purpose of the example, e.g. to illustrate a scenario", description=( "What the example scenario resource is created for. This should not be " "used to show the business purpose of the scenario itself, but the " "purpose of documenting a scenario." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this example scenario. Enables tracking the life-cycle " "of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this example scenario, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this example scenario when it" " is referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which at which an authoritative " "instance of this example scenario is (or will be) published. This URL " "can be the target of a canonical reference. It SHALL remain the same " "when the example scenario is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate example scenario instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the example scenario", description=( "The identifier that is used to identify this version of the example " "scenario when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the example scenario " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) workflow: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="workflow", title="Another nested workflow", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ExampleScenario"], }, ) workflow__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_workflow", title="Extension field for ``workflow``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExampleScenario`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "copyright", "purpose", "actor", "instance", "process", "workflow", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExampleScenario`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class ExampleScenarioActor(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Actor participating in the resource. """ __resource_type__ = "ExampleScenarioActor" actorId: fhirtypes.StringType | None = Field( default=None, alias="actorId", title="ID or acronym of the actor", description="ID or acronym of actor.", json_schema_extra={ "element_property": True, "element_required": True, }, ) actorId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_actorId", title="Extension field for ``actorId``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="The description of the actor", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="The name of the actor as shown in the page", description=None, json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="person | entity", description="The type of actor - person or system.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["person", "entity"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExampleScenarioActor`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "actorId", "type", "name", "description", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExampleScenarioActor`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("actorId", "actorId__ext"), ("type", "type__ext")] return required_fields class ExampleScenarioInstance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Each resource and each version that is present in the workflow. """ __resource_type__ = "ExampleScenarioInstance" containedInstance: typing.List[ fhirtypes.ExampleScenarioInstanceContainedInstanceType ] | None = Field( default=None, alias="containedInstance", title="Resources contained in the instance", description=( "Resources contained in the instance (e.g. the observations contained " "in a bundle)." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Human-friendly description of the resource instance", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="A short name for the resource instance", description=None, json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) resourceId: fhirtypes.StringType | None = Field( default=None, alias="resourceId", title="The id of the resource for referencing", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) resourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resourceId", title="Extension field for ``resourceId``." ) resourceType: fhirtypes.CodeType | None = Field( default=None, alias="resourceType", title="The type of the resource", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) resourceType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resourceType", title="Extension field for ``resourceType``.", ) version: typing.List[fhirtypes.ExampleScenarioInstanceVersionType] | None = Field( default=None, alias="version", title="A specific version of the resource", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExampleScenarioInstance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "resourceId", "resourceType", "name", "description", "version", "containedInstance", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExampleScenarioInstance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("resourceId", "resourceId__ext"), ("resourceType", "resourceType__ext"), ] return required_fields class ExampleScenarioInstanceContainedInstance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Resources contained in the instance. Resources contained in the instance (e.g. the observations contained in a bundle). """ __resource_type__ = "ExampleScenarioInstanceContainedInstance" resourceId: fhirtypes.StringType | None = Field( default=None, alias="resourceId", title="Each resource contained in the instance", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) resourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resourceId", title="Extension field for ``resourceId``." ) versionId: fhirtypes.StringType | None = Field( default=None, alias="versionId", title="A specific version of a resource contained in the instance", description=None, json_schema_extra={ "element_property": True, }, ) versionId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionId", title="Extension field for ``versionId``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExampleScenarioInstanceContainedInstance`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "resourceId", "versionId"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExampleScenarioInstanceContainedInstance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("resourceId", "resourceId__ext")] return required_fields class ExampleScenarioInstanceVersion(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A specific version of the resource. """ __resource_type__ = "ExampleScenarioInstanceVersion" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="The description of the resource version", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) versionId: fhirtypes.StringType | None = Field( default=None, alias="versionId", title="The identifier of a specific version of a resource", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) versionId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionId", title="Extension field for ``versionId``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExampleScenarioInstanceVersion`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "versionId", "description"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExampleScenarioInstanceVersion`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("description", "description__ext"), ("versionId", "versionId__ext"), ] return required_fields class ExampleScenarioProcess(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Each major process - a group of operations. """ __resource_type__ = "ExampleScenarioProcess" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="A longer description of the group of operations", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) postConditions: fhirtypes.MarkdownType | None = Field( default=None, alias="postConditions", title="Description of final status after the process ends", description=None, json_schema_extra={ "element_property": True, }, ) postConditions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_postConditions", title="Extension field for ``postConditions``.", ) preConditions: fhirtypes.MarkdownType | None = Field( default=None, alias="preConditions", title="Description of initial status before the process starts", description=None, json_schema_extra={ "element_property": True, }, ) preConditions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preConditions", title="Extension field for ``preConditions``.", ) step: typing.List[fhirtypes.ExampleScenarioProcessStepType] | None = Field( default=None, alias="step", title="Each step of the process", description=None, json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="The diagram title of the group of operations", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExampleScenarioProcess`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "title", "description", "preConditions", "postConditions", "step", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExampleScenarioProcess`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "title"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("title", "title__ext")] return required_fields class ExampleScenarioProcessStep(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Each step of the process. """ __resource_type__ = "ExampleScenarioProcessStep" alternative: typing.List[ fhirtypes.ExampleScenarioProcessStepAlternativeType ] | None = Field( default=None, alias="alternative", title="Alternate non-typical step action", description=( "Indicates an alternative step that can be taken instead of the " "operations on the base step in exceptional/atypical circumstances." ), json_schema_extra={ "element_property": True, }, ) operation: fhirtypes.ExampleScenarioProcessStepOperationType | None = Field( default=None, alias="operation", title="Each interaction or action", description=None, json_schema_extra={ "element_property": True, }, ) pause: bool | None = Field( default=None, alias="pause", title="If there is a pause in the flow", description=None, json_schema_extra={ "element_property": True, }, ) pause__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_pause", title="Extension field for ``pause``." ) process: typing.List[fhirtypes.ExampleScenarioProcessType] | None = Field( default=None, alias="process", title="Nested process", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExampleScenarioProcessStep`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "process", "pause", "operation", "alternative", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExampleScenarioProcessStep`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExampleScenarioProcessStepAlternative(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Alternate non-typical step action. Indicates an alternative step that can be taken instead of the operations on the base step in exceptional/atypical circumstances. """ __resource_type__ = "ExampleScenarioProcessStepAlternative" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="A human-readable description of each option", description=( "A human-readable description of the alternative explaining when the " "alternative should occur rather than the base step." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) step: typing.List[fhirtypes.ExampleScenarioProcessStepType] | None = Field( default=None, alias="step", title="What happens in each alternative option", description=None, json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Label for alternative", description=( "The label to display for the alternative that gives a sense of the " "circumstance in which the alternative should be invoked." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExampleScenarioProcessStepAlternative`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "title", "description", "step"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExampleScenarioProcessStepAlternative`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("title", "title__ext")] return required_fields class ExampleScenarioProcessStepOperation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Each interaction or action. """ __resource_type__ = "ExampleScenarioProcessStepOperation" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="A comment to be inserted in the diagram", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) initiator: fhirtypes.StringType | None = Field( default=None, alias="initiator", title="Who starts the transaction", description=None, json_schema_extra={ "element_property": True, }, ) initiator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_initiator", title="Extension field for ``initiator``." ) initiatorActive: bool | None = Field( default=None, alias="initiatorActive", title="Whether the initiator is deactivated right after the transaction", description=None, json_schema_extra={ "element_property": True, }, ) initiatorActive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_initiatorActive", title="Extension field for ``initiatorActive``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="The human-friendly name of the interaction", description=None, json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) number: fhirtypes.StringType | None = Field( default=None, alias="number", title="The sequential number of the interaction", description="The sequential number of the interaction, e.g. 1.2.5.", json_schema_extra={ "element_property": True, "element_required": True, }, ) number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_number", title="Extension field for ``number``." ) receiver: fhirtypes.StringType | None = Field( default=None, alias="receiver", title="Who receives the transaction", description=None, json_schema_extra={ "element_property": True, }, ) receiver__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_receiver", title="Extension field for ``receiver``." ) receiverActive: bool | None = Field( default=None, alias="receiverActive", title="Whether the receiver is deactivated right after the transaction", description=None, json_schema_extra={ "element_property": True, }, ) receiverActive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_receiverActive", title="Extension field for ``receiverActive``.", ) request: fhirtypes.ExampleScenarioInstanceContainedInstanceType | None = Field( default=None, alias="request", title="Each resource instance used by the initiator", description=None, json_schema_extra={ "element_property": True, }, ) response: fhirtypes.ExampleScenarioInstanceContainedInstanceType | None = Field( default=None, alias="response", title="Each resource instance used by the responder", description=None, json_schema_extra={ "element_property": True, }, ) type: fhirtypes.StringType | None = Field( default=None, alias="type", title="The type of operation - CRUD", description=None, json_schema_extra={ "element_property": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExampleScenarioProcessStepOperation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "number", "type", "name", "initiator", "receiver", "description", "initiatorActive", "receiverActive", "request", "response", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExampleScenarioProcessStepOperation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("number", "number__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/explanationofbenefit.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ExplanationOfBenefit Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ExplanationOfBenefit(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Explanation of Benefit resource. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. """ __resource_type__ = "ExplanationOfBenefit" accident: fhirtypes.ExplanationOfBenefitAccidentType | None = Field( default=None, alias="accident", title="Details of the event", description=( "Details of a accident which resulted in injuries which required the " "products and services listed in the claim." ), json_schema_extra={ "element_property": True, }, ) addItem: typing.List[fhirtypes.ExplanationOfBenefitAddItemType] | None = Field( default=None, alias="addItem", title="Insurer added line items", description=( "The first-tier service adjudications for payor added product or " "service lines." ), json_schema_extra={ "element_property": True, }, ) adjudication: typing.List[ fhirtypes.ExplanationOfBenefitItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Header-level adjudication", description=( "The adjudication results which are presented at the header level " "rather than at the line-item or add-item levels." ), json_schema_extra={ "element_property": True, }, ) benefitBalance: typing.List[ fhirtypes.ExplanationOfBenefitBenefitBalanceType ] | None = Field( default=None, alias="benefitBalance", title="Balance by Benefit Category", description=None, json_schema_extra={ "element_property": True, }, ) benefitPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="benefitPeriod", title="When the benefits are applicable", description="The term of the benefits documented in this response.", json_schema_extra={ "element_property": True, }, ) billablePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="billablePeriod", title="Relevant time frame for the claim", description="The period for which charges are being submitted.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) careTeam: typing.List[fhirtypes.ExplanationOfBenefitCareTeamType] | None = Field( default=None, alias="careTeam", title="Care Team members", description="The members of the team who provided the products and services.", json_schema_extra={ "element_property": True, }, ) claim: fhirtypes.ReferenceType | None = Field( default=None, alias="claim", title="Claim reference", description=( "The business identifier for the instance of the adjudication request: " "claim predetermination or preauthorization." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Claim"], }, ) claimResponse: fhirtypes.ReferenceType | None = Field( default=None, alias="claimResponse", title="Claim response reference", description=( "The business identifier for the instance of the adjudication response:" " claim, predetermination or preauthorization response." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ClaimResponse"], }, ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Response creation date", description="The date this resource was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) diagnosis: typing.List[fhirtypes.ExplanationOfBenefitDiagnosisType] | None = Field( default=None, alias="diagnosis", title="Pertinent diagnosis information", description="Information about diagnoses relevant to the claim items.", json_schema_extra={ "element_property": True, }, ) disposition: fhirtypes.StringType | None = Field( default=None, alias="disposition", title="Disposition Message", description="A human readable description of the status of the adjudication.", json_schema_extra={ "element_property": True, }, ) disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_disposition", title="Extension field for ``disposition``." ) enterer: fhirtypes.ReferenceType | None = Field( default=None, alias="enterer", title="Author of the claim", description=( "Individual who created the claim, predetermination or " "preauthorization." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) facility: fhirtypes.ReferenceType | None = Field( default=None, alias="facility", title="Servicing Facility", description="Facility where the services were provided.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) form: fhirtypes.AttachmentType | None = Field( default=None, alias="form", title="Printed reference or actual form", description=( "The actual form, by reference or inclusion, for printing the content " "or an EOB." ), json_schema_extra={ "element_property": True, }, ) formCode: fhirtypes.CodeableConceptType | None = Field( default=None, alias="formCode", title="Printed form identifier", description="A code for the form to be used for printing the content.", json_schema_extra={ "element_property": True, }, ) fundsReserve: fhirtypes.CodeableConceptType | None = Field( default=None, alias="fundsReserve", title="Funds reserved status", description=( "A code, used only on a response to a preauthorization, to indicate " "whether the benefits payable have been reserved and for whom." ), json_schema_extra={ "element_property": True, }, ) fundsReserveRequested: fhirtypes.CodeableConceptType | None = Field( default=None, alias="fundsReserveRequested", title="For whom to reserve funds", description=( "A code to indicate whether and for whom funds are to be reserved for " "future claims." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for the resource", description="A unique identifier assigned to this explanation of benefit.", json_schema_extra={ "element_property": True, }, ) insurance: typing.List[fhirtypes.ExplanationOfBenefitInsuranceType] = Field( default=..., alias="insurance", title="Patient insurance information", description=( "Financial instruments for reimbursement for the health care products " "and services specified on the claim." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) insurer: fhirtypes.ReferenceType = Field( default=..., alias="insurer", title="Party responsible for reimbursement", description=( "The party responsible for authorization, adjudication and " "reimbursement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) item: typing.List[fhirtypes.ExplanationOfBenefitItemType] | None = Field( default=None, alias="item", title="Product or service provided", description=( "A claim line. Either a simple (a product or service) or a 'group' of " "details which can also be a simple items or groups of sub-details." ), json_schema_extra={ "element_property": True, }, ) originalPrescription: fhirtypes.ReferenceType | None = Field( default=None, alias="originalPrescription", title="Original prescription if superceded by fulfiller", description=( "Original prescription which has been superseded by this prescription " "to support the dispensing of pharmacy services, medications or " "products." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicationRequest"], }, ) outcome: fhirtypes.CodeType | None = Field( default=None, alias="outcome", title="queued | complete | error | partial", description=( "The outcome of the claim, predetermination, or preauthorization " "processing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["queued", "complete", "error", "partial"], }, ) outcome__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_outcome", title="Extension field for ``outcome``." ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="The recipient of the products and services", description=( "The party to whom the professional services and/or products have been " "supplied or are being considered and for whom actual for forecast " "reimbursement is sought." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) payee: fhirtypes.ExplanationOfBenefitPayeeType | None = Field( default=None, alias="payee", title="Recipient of benefits payable", description=( "The party to be reimbursed for cost of the products and services " "according to the terms of the policy." ), json_schema_extra={ "element_property": True, }, ) payment: fhirtypes.ExplanationOfBenefitPaymentType | None = Field( default=None, alias="payment", title="Payment Details", description="Payment details for the adjudication of the claim.", json_schema_extra={ "element_property": True, }, ) preAuthRef: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="preAuthRef", title="Preauthorization reference", description=( "Reference from the Insurer which is used in later communications which" " refers to this adjudication." ), json_schema_extra={ "element_property": True, }, ) preAuthRef__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_preAuthRef", title="Extension field for ``preAuthRef``." ) preAuthRefPeriod: typing.List[fhirtypes.PeriodType] | None = Field( default=None, alias="preAuthRefPeriod", title="Preauthorization in-effect period", description=( "The timeframe during which the supplied preauthorization reference may" " be quoted on claims to obtain the adjudication as provided." ), json_schema_extra={ "element_property": True, }, ) precedence: fhirtypes.PositiveIntType | None = Field( default=None, alias="precedence", title="Precedence (primary, secondary, etc.)", description=( "This indicates the relative order of a series of EOBs related to " "different coverages for the same suite of services." ), json_schema_extra={ "element_property": True, }, ) precedence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_precedence", title="Extension field for ``precedence``." ) prescription: fhirtypes.ReferenceType | None = Field( default=None, alias="prescription", title="Prescription authorizing services or products", description=( "Prescription to support the dispensing of pharmacy, device or vision " "products." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicationRequest", "VisionPrescription"], }, ) priority: fhirtypes.CodeableConceptType | None = Field( default=None, alias="priority", title="Desired processing urgency", description=( "The provider-required urgency of processing the request. Typical " "values include: stat, routine deferred." ), json_schema_extra={ "element_property": True, }, ) procedure: typing.List[fhirtypes.ExplanationOfBenefitProcedureType] | None = Field( default=None, alias="procedure", title="Clinical procedures performed", description=( "Procedures performed on the patient relevant to the billing items with" " the claim." ), json_schema_extra={ "element_property": True, }, ) processNote: typing.List[ fhirtypes.ExplanationOfBenefitProcessNoteType ] | None = Field( default=None, alias="processNote", title="Note concerning adjudication", description=( "A note that describes or explains adjudication results in a human " "readable form." ), json_schema_extra={ "element_property": True, }, ) provider: fhirtypes.ReferenceType = Field( default=..., alias="provider", title="Party responsible for the claim", description=( "The provider which is responsible for the claim, predetermination or " "preauthorization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) referral: fhirtypes.ReferenceType | None = Field( default=None, alias="referral", title="Treatment Referral", description="A reference to a referral resource.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ServiceRequest"], }, ) related: typing.List[fhirtypes.ExplanationOfBenefitRelatedType] | None = Field( default=None, alias="related", title="Prior or corollary claims", description=( "Other claims which are related to this claim such as prior submissions" " or claims for related services or for the same event." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subType", title="More granular claim type", description=( "A finer grained suite of claim type codes which may convey additional " "information such as Inpatient vs Outpatient and/or a specialty " "service." ), json_schema_extra={ "element_property": True, }, ) supportingInfo: typing.List[ fhirtypes.ExplanationOfBenefitSupportingInfoType ] | None = Field( default=None, alias="supportingInfo", title="Supporting information", description=( "Additional information codes regarding exceptions, special " "considerations, the condition, situation, prior or concurrent issues." ), json_schema_extra={ "element_property": True, }, ) total: typing.List[fhirtypes.ExplanationOfBenefitTotalType] | None = Field( default=None, alias="total", title="Adjudication totals", description="Categorized monetary totals for the adjudication.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Category or discipline", description=( "The category of claim, e.g. oral, pharmacy, vision, institutional, " "professional." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="claim | preauthorization | predetermination", description=( "A code to indicate whether the nature of the request is: to request " "adjudication of products and services previously rendered; or " "requesting authorization and adjudication for provision in the future;" " or requesting the non-binding adjudication of the listed products and" " services which could be provided in the future." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["claim", "preauthorization", "predetermination"], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefit`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "type", "subType", "use", "patient", "billablePeriod", "created", "enterer", "insurer", "provider", "priority", "fundsReserveRequested", "fundsReserve", "related", "prescription", "originalPrescription", "payee", "referral", "facility", "claim", "claimResponse", "outcome", "disposition", "preAuthRef", "preAuthRefPeriod", "careTeam", "supportingInfo", "diagnosis", "procedure", "precedence", "insurance", "accident", "item", "addItem", "adjudication", "total", "payment", "formCode", "form", "processNote", "benefitPeriod", "benefitBalance", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefit`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "status", "type", "use", "patient", "billablePeriod", "created", "insurer", "provider", "outcome", "insurance", "total", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("created", "created__ext"), ("outcome", "outcome__ext"), ("status", "status__ext"), ("use", "use__ext"), ] return required_fields class ExplanationOfBenefitAccident(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details of the event. Details of a accident which resulted in injuries which required the products and services listed in the claim. """ __resource_type__ = "ExplanationOfBenefitAccident" date: fhirtypes.DateType | None = Field( default=None, alias="date", title="When the incident occurred", description=( "Date of an accident event related to the products and services " "contained in the claim." ), json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) locationAddress: fhirtypes.AddressType | None = Field( default=None, alias="locationAddress", title="Where the event occurred", description="The physical location of the accident event.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="locationReference", title="Where the event occurred", description="The physical location of the accident event.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The nature of the accident", description=( "The type or context of the accident event for the purposes of " "selection of potential insurance coverages and determination of " "coordination between insurers." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitAccident`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "date", "type", "locationAddress", "locationReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitAccident`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"location": ["locationAddress", "locationReference"]} return one_of_many_fields class ExplanationOfBenefitAddItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Insurer added line items. The first-tier service adjudications for payor added product or service lines. """ __resource_type__ = "ExplanationOfBenefitAddItem" adjudication: typing.List[ fhirtypes.ExplanationOfBenefitItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Added items adjudication", description="The adjudication results.", json_schema_extra={ "element_property": True, }, ) bodySite: fhirtypes.CodeableConceptType | None = Field( default=None, alias="bodySite", title="Anatomical location", description="Physical service site on the patient (limb, tooth, etc.).", json_schema_extra={ "element_property": True, }, ) detail: typing.List[fhirtypes.ExplanationOfBenefitAddItemDetailType] | None = Field( default=None, alias="detail", title="Insurer added line items", description="The second-tier service adjudications for payor added services.", json_schema_extra={ "element_property": True, }, ) detailSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="detailSequence", title="Detail sequence number", description=( "The sequence number of the details within the claim item which this " "line is intended to replace." ), json_schema_extra={ "element_property": True, }, ) detailSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_detailSequence", title="Extension field for ``detailSequence``.", ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) itemSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="itemSequence", title="Item sequence number", description="Claim items which this service line is intended to replace.", json_schema_extra={ "element_property": True, }, ) itemSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_itemSequence", title="Extension field for ``itemSequence``.", ) locationAddress: fhirtypes.AddressType | None = Field( default=None, alias="locationAddress", title="Place of service or where product was supplied", description="Where the product or service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="locationCodeableConcept", title="Place of service or where product was supplied", description="Where the product or service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="locationReference", title="Place of service or where product was supplied", description="Where the product or service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The quantity times the unit price for an additional service or product" " or charge." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="Applicable note numbers", description=( "The numbers associated with notes below which apply to the " "adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) productOrService: fhirtypes.CodeableConceptType = Field( default=..., alias="productOrService", title="Billing, service, product, or drug code", description=( "When the value is a group code then this item collects a set of " "related claim details, otherwise this contains the product, service, " "drug or other billing code for the item." ), json_schema_extra={ "element_property": True, }, ) programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="programCode", title="Program the product or service is provided under", description="Identifies the program under which this may be recovered.", json_schema_extra={ "element_property": True, }, ) provider: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="provider", title="Authorized providers", description=( "The providers who are authorized for the services rendered to the " "patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) servicedDate: fhirtypes.DateType | None = Field( default=None, alias="servicedDate", title="Date or dates of service or product delivery", description=( "The date or dates when the service or product was supplied, performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_servicedDate", title="Extension field for ``servicedDate``.", ) servicedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="servicedPeriod", title="Date or dates of service or product delivery", description=( "The date or dates when the service or product was supplied, performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) subDetailSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="subDetailSequence", title="Subdetail sequence number", description=( "The sequence number of the sub-details woithin the details within the " "claim item which this line is intended to replace." ), json_schema_extra={ "element_property": True, }, ) subDetailSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_subDetailSequence", title="Extension field for ``subDetailSequence``.", ) subSite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="subSite", title="Anatomical sub-location", description=( "A region or surface of the bodySite, e.g. limb region or tooth " "surface(s)." ), json_schema_extra={ "element_property": True, }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description=( "If the item is not a group then this is the fee for the product or " "service, otherwise this is the total of the fees for the details of " "the group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitAddItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "itemSequence", "detailSequence", "subDetailSequence", "provider", "productOrService", "modifier", "programCode", "servicedDate", "servicedPeriod", "locationCodeableConcept", "locationAddress", "locationReference", "quantity", "unitPrice", "factor", "net", "bodySite", "subSite", "noteNumber", "adjudication", "detail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitAddItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "location": [ "locationAddress", "locationCodeableConcept", "locationReference", ], "serviced": ["servicedDate", "servicedPeriod"], } return one_of_many_fields class ExplanationOfBenefitAddItemDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Insurer added line items. The second-tier service adjudications for payor added services. """ __resource_type__ = "ExplanationOfBenefitAddItemDetail" adjudication: typing.List[ fhirtypes.ExplanationOfBenefitItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Added items adjudication", description="The adjudication results.", json_schema_extra={ "element_property": True, }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The quantity times the unit price for an additional service or product" " or charge." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="Applicable note numbers", description=( "The numbers associated with notes below which apply to the " "adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) productOrService: fhirtypes.CodeableConceptType = Field( default=..., alias="productOrService", title="Billing, service, product, or drug code", description=( "When the value is a group code then this item collects a set of " "related claim details, otherwise this contains the product, service, " "drug or other billing code for the item." ), json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) subDetail: typing.List[ fhirtypes.ExplanationOfBenefitAddItemDetailSubDetailType ] | None = Field( default=None, alias="subDetail", title="Insurer added line items", description="The third-tier service adjudications for payor added services.", json_schema_extra={ "element_property": True, }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description=( "If the item is not a group then this is the fee for the product or " "service, otherwise this is the total of the fees for the details of " "the group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitAddItemDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "productOrService", "modifier", "quantity", "unitPrice", "factor", "net", "noteNumber", "adjudication", "subDetail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitAddItemDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitAddItemDetailSubDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Insurer added line items. The third-tier service adjudications for payor added services. """ __resource_type__ = "ExplanationOfBenefitAddItemDetailSubDetail" adjudication: typing.List[ fhirtypes.ExplanationOfBenefitItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Added items adjudication", description="The adjudication results.", json_schema_extra={ "element_property": True, }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The quantity times the unit price for an additional service or product" " or charge." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="Applicable note numbers", description=( "The numbers associated with notes below which apply to the " "adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) productOrService: fhirtypes.CodeableConceptType = Field( default=..., alias="productOrService", title="Billing, service, product, or drug code", description=( "When the value is a group code then this item collects a set of " "related claim details, otherwise this contains the product, service, " "drug or other billing code for the item." ), json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description=( "If the item is not a group then this is the fee for the product or " "service, otherwise this is the total of the fees for the details of " "the group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitAddItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "productOrService", "modifier", "quantity", "unitPrice", "factor", "net", "noteNumber", "adjudication", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitAddItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitBenefitBalance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Balance by Benefit Category. """ __resource_type__ = "ExplanationOfBenefitBenefitBalance" category: fhirtypes.CodeableConceptType = Field( default=..., alias="category", title="Benefit classification", description=( "Code to identify the general type of benefits under which products and" " services are provided." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Description of the benefit or services covered", description="A richer description of the benefit or services covered.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) excluded: bool | None = Field( default=None, alias="excluded", title="Excluded from the plan", description=( "True if the indicated class of service is excluded from the plan, " "missing or False indicates the product or service is included in the " "coverage." ), json_schema_extra={ "element_property": True, }, ) excluded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_excluded", title="Extension field for ``excluded``." ) financial: typing.List[ fhirtypes.ExplanationOfBenefitBenefitBalanceFinancialType ] | None = Field( default=None, alias="financial", title="Benefit Summary", description="Benefits Used to date.", json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Short name for the benefit", description="A short name or tag for the benefit.", json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) network: fhirtypes.CodeableConceptType | None = Field( default=None, alias="network", title="In or out of network", description=( "Is a flag to indicate whether the benefits refer to in-network " "providers or out-of-network providers." ), json_schema_extra={ "element_property": True, }, ) term: fhirtypes.CodeableConceptType | None = Field( default=None, alias="term", title="Annual or lifetime", description=( "The term or period of the values such as 'maximum lifetime benefit' or" " 'maximum annual visits'." ), json_schema_extra={ "element_property": True, }, ) unit: fhirtypes.CodeableConceptType | None = Field( default=None, alias="unit", title="Individual or family", description="Indicates if the benefits apply to an individual or to the family.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitBenefitBalance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "category", "excluded", "name", "description", "network", "unit", "term", "financial", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitBenefitBalance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitBenefitBalanceFinancial(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Benefit Summary. Benefits Used to date. """ __resource_type__ = "ExplanationOfBenefitBenefitBalanceFinancial" allowedMoney: fhirtypes.MoneyType | None = Field( default=None, alias="allowedMoney", title="Benefits allowed", description="The quantity of the benefit which is permitted under the coverage.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e allowed[x] "one_of_many": "allowed", "one_of_many_required": False, }, ) allowedString: fhirtypes.StringType | None = Field( default=None, alias="allowedString", title="Benefits allowed", description="The quantity of the benefit which is permitted under the coverage.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e allowed[x] "one_of_many": "allowed", "one_of_many_required": False, }, ) allowedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allowedString", title="Extension field for ``allowedString``.", ) allowedUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="allowedUnsignedInt", title="Benefits allowed", description="The quantity of the benefit which is permitted under the coverage.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e allowed[x] "one_of_many": "allowed", "one_of_many_required": False, }, ) allowedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allowedUnsignedInt", title="Extension field for ``allowedUnsignedInt``.", ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Benefit classification", description="Classification of benefit being provided.", json_schema_extra={ "element_property": True, }, ) usedMoney: fhirtypes.MoneyType | None = Field( default=None, alias="usedMoney", title="Benefits used", description="The quantity of the benefit which have been consumed to date.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e used[x] "one_of_many": "used", "one_of_many_required": False, }, ) usedUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="usedUnsignedInt", title="Benefits used", description="The quantity of the benefit which have been consumed to date.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e used[x] "one_of_many": "used", "one_of_many_required": False, }, ) usedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usedUnsignedInt", title="Extension field for ``usedUnsignedInt``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitBenefitBalanceFinancial`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "allowedUnsignedInt", "allowedString", "allowedMoney", "usedUnsignedInt", "usedMoney", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitBenefitBalanceFinancial`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "allowed": ["allowedMoney", "allowedString", "allowedUnsignedInt"], "used": ["usedMoney", "usedUnsignedInt"], } return one_of_many_fields class ExplanationOfBenefitCareTeam(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Care Team members. The members of the team who provided the products and services. """ __resource_type__ = "ExplanationOfBenefitCareTeam" provider: fhirtypes.ReferenceType = Field( default=..., alias="provider", title="Practitioner or organization", description="Member of the team who provided the product or service.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) qualification: fhirtypes.CodeableConceptType | None = Field( default=None, alias="qualification", title="Practitioner credential or specialization", description=( "The qualification of the practitioner which is applicable for this " "service." ), json_schema_extra={ "element_property": True, }, ) responsible: bool | None = Field( default=None, alias="responsible", title="Indicator of the lead practitioner", description=( "The party who is billing and/or responsible for the claimed products " "or services." ), json_schema_extra={ "element_property": True, }, ) responsible__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_responsible", title="Extension field for ``responsible``." ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="Function within the team", description=( "The lead, assisting or supervising practitioner and their discipline " "if a multidisciplinary team." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Order of care team", description="A number to uniquely identify care team entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitCareTeam`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "provider", "responsible", "role", "qualification", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitCareTeam`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields class ExplanationOfBenefitDiagnosis(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Pertinent diagnosis information. Information about diagnoses relevant to the claim items. """ __resource_type__ = "ExplanationOfBenefitDiagnosis" diagnosisCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="diagnosisCodeableConcept", title="Nature of illness or problem", description=( "The nature of illness or problem in a coded form or as a reference to " "an external defined Condition." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e diagnosis[x] "one_of_many": "diagnosis", "one_of_many_required": True, }, ) diagnosisReference: fhirtypes.ReferenceType | None = Field( default=None, alias="diagnosisReference", title="Nature of illness or problem", description=( "The nature of illness or problem in a coded form or as a reference to " "an external defined Condition." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e diagnosis[x] "one_of_many": "diagnosis", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) onAdmission: fhirtypes.CodeableConceptType | None = Field( default=None, alias="onAdmission", title="Present on admission", description=( "Indication of whether the diagnosis was present on admission to a " "facility." ), json_schema_extra={ "element_property": True, }, ) packageCode: fhirtypes.CodeableConceptType | None = Field( default=None, alias="packageCode", title="Package billing code", description=( "A package billing code or bundle code used to group products and " "services to a particular health condition (such as heart attack) which" " is based on a predetermined grouping code system." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Diagnosis instance identifier", description="A number to uniquely identify diagnosis entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Timing or nature of the diagnosis", description="When the condition was observed or the relative ranking.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitDiagnosis`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "diagnosisCodeableConcept", "diagnosisReference", "type", "onAdmission", "packageCode", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitDiagnosis`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "diagnosis": ["diagnosisCodeableConcept", "diagnosisReference"] } return one_of_many_fields class ExplanationOfBenefitInsurance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Patient insurance information. Financial instruments for reimbursement for the health care products and services specified on the claim. """ __resource_type__ = "ExplanationOfBenefitInsurance" coverage: fhirtypes.ReferenceType = Field( default=..., alias="coverage", title="Insurance information", description=( "Reference to the insurance card level information contained in the " "Coverage resource. The coverage issuing insurer will use these details" " to locate the patient's actual coverage within the insurer's " "information system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage"], }, ) focal: bool | None = Field( default=None, alias="focal", title="Coverage to be used for adjudication", description=( "A flag to indicate that this Coverage is to be used for adjudication " "of this claim when set to true." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) focal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_focal", title="Extension field for ``focal``." ) preAuthRef: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="preAuthRef", title="Prior authorization reference number", description=( "Reference numbers previously provided by the insurer to the provider " "to be quoted on subsequent claims containing services or products " "related to the prior authorization." ), json_schema_extra={ "element_property": True, }, ) preAuthRef__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_preAuthRef", title="Extension field for ``preAuthRef``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitInsurance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "focal", "coverage", "preAuthRef", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitInsurance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "focal", "coverage"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("focal", "focal__ext")] return required_fields class ExplanationOfBenefitItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Product or service provided. A claim line. Either a simple (a product or service) or a 'group' of details which can also be a simple items or groups of sub-details. """ __resource_type__ = "ExplanationOfBenefitItem" adjudication: typing.List[ fhirtypes.ExplanationOfBenefitItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Adjudication details", description=( "If this item is a group then the values here are a summary of the " "adjudication of the detail items. If this item is a simple product or " "service then this is the result of the adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) bodySite: fhirtypes.CodeableConceptType | None = Field( default=None, alias="bodySite", title="Anatomical location", description="Physical service site on the patient (limb, tooth, etc.).", json_schema_extra={ "element_property": True, }, ) careTeamSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="careTeamSequence", title="Applicable care team members", description="Care team members related to this service or product.", json_schema_extra={ "element_property": True, }, ) careTeamSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_careTeamSequence", title="Extension field for ``careTeamSequence``.", ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Benefit classification", description=( "Code to identify the general type of benefits under which products and" " services are provided." ), json_schema_extra={ "element_property": True, }, ) detail: typing.List[fhirtypes.ExplanationOfBenefitItemDetailType] | None = Field( default=None, alias="detail", title="Additional items", description="Second-tier of goods and services.", json_schema_extra={ "element_property": True, }, ) diagnosisSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="diagnosisSequence", title="Applicable diagnoses", description="Diagnoses applicable for this service or product.", json_schema_extra={ "element_property": True, }, ) diagnosisSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_diagnosisSequence", title="Extension field for ``diagnosisSequence``.", ) encounter: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="encounter", title="Encounters related to this billed item", description=( "A billed item may include goods or services provided in multiple " "encounters." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) informationSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="informationSequence", title="Applicable exception and supporting information", description=( "Exceptions, special conditions and supporting information applicable " "for this service or product." ), json_schema_extra={ "element_property": True, }, ) informationSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_informationSequence", title="Extension field for ``informationSequence``.", ) locationAddress: fhirtypes.AddressType | None = Field( default=None, alias="locationAddress", title="Place of service or where product was supplied", description="Where the product or service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="locationCodeableConcept", title="Place of service or where product was supplied", description="Where the product or service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="locationReference", title="Place of service or where product was supplied", description="Where the product or service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Product or service billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The quantity times the unit price for an additional service or product" " or charge." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="Applicable note numbers", description=( "The numbers associated with notes below which apply to the " "adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) procedureSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="procedureSequence", title="Applicable procedures", description="Procedures applicable for this service or product.", json_schema_extra={ "element_property": True, }, ) procedureSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_procedureSequence", title="Extension field for ``procedureSequence``.", ) productOrService: fhirtypes.CodeableConceptType = Field( default=..., alias="productOrService", title="Billing, service, product, or drug code", description=( "When the value is a group code then this item collects a set of " "related claim details, otherwise this contains the product, service, " "drug or other billing code for the item." ), json_schema_extra={ "element_property": True, }, ) programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="programCode", title="Program the product or service is provided under", description="Identifies the program under which this may be recovered.", json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of revenue or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Item instance identifier", description="A number to uniquely identify item entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) servicedDate: fhirtypes.DateType | None = Field( default=None, alias="servicedDate", title="Date or dates of service or product delivery", description=( "The date or dates when the service or product was supplied, performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_servicedDate", title="Extension field for ``servicedDate``.", ) servicedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="servicedPeriod", title="Date or dates of service or product delivery", description=( "The date or dates when the service or product was supplied, performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) subSite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="subSite", title="Anatomical sub-location", description=( "A region or surface of the bodySite, e.g. limb region or tooth " "surface(s)." ), json_schema_extra={ "element_property": True, }, ) udi: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="udi", title="Unique device identifier", description="Unique Device Identifiers associated with this line item.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description=( "If the item is not a group then this is the fee for the product or " "service, otherwise this is the total of the fees for the details of " "the group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "careTeamSequence", "diagnosisSequence", "procedureSequence", "informationSequence", "revenue", "category", "productOrService", "modifier", "programCode", "servicedDate", "servicedPeriod", "locationCodeableConcept", "locationAddress", "locationReference", "quantity", "unitPrice", "factor", "net", "udi", "bodySite", "subSite", "encounter", "noteNumber", "adjudication", "detail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "location": [ "locationAddress", "locationCodeableConcept", "locationReference", ], "serviced": ["servicedDate", "servicedPeriod"], } return one_of_many_fields class ExplanationOfBenefitItemAdjudication(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Adjudication details. If this item is a group then the values here are a summary of the adjudication of the detail items. If this item is a simple product or service then this is the result of the adjudication of this item. """ __resource_type__ = "ExplanationOfBenefitItemAdjudication" amount: fhirtypes.MoneyType | None = Field( default=None, alias="amount", title="Monetary amount", description="Monetary amount associated with the category.", json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType = Field( default=..., alias="category", title="Type of adjudication information", description=( "A code to indicate the information type of this adjudication record. " "Information types may include: the value submitted, maximum values or " "percentages allowed or payable under the plan, amounts that the " "patient is responsible for in-aggregate or pertaining to this item, " "amounts paid by other coverages, and the benefit payable for this " "item." ), json_schema_extra={ "element_property": True, }, ) reason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reason", title="Explanation of adjudication outcome", description=( "A code supporting the understanding of the adjudication result and " "explaining variance from expected amount." ), json_schema_extra={ "element_property": True, }, ) value: fhirtypes.DecimalType | None = Field( default=None, alias="value", title="Non-monitary value", description=( "A non-monetary value associated with the category. Mutually exclusive " "to the amount element above." ), json_schema_extra={ "element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitItemAdjudication`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "category", "reason", "amount", "value", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItemAdjudication`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitItemDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional items. Second-tier of goods and services. """ __resource_type__ = "ExplanationOfBenefitItemDetail" adjudication: typing.List[ fhirtypes.ExplanationOfBenefitItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Detail level adjudication details", description="The adjudication results.", json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Benefit classification", description=( "Code to identify the general type of benefits under which products and" " services are provided." ), json_schema_extra={ "element_property": True, }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The quantity times the unit price for an additional service or product" " or charge." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="Applicable note numbers", description=( "The numbers associated with notes below which apply to the " "adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) productOrService: fhirtypes.CodeableConceptType = Field( default=..., alias="productOrService", title="Billing, service, product, or drug code", description=( "When the value is a group code then this item collects a set of " "related claim details, otherwise this contains the product, service, " "drug or other billing code for the item." ), json_schema_extra={ "element_property": True, }, ) programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="programCode", title="Program the product or service is provided under", description="Identifies the program under which this may be recovered.", json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of revenue or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Product or service provided", description=( "A claim detail line. Either a simple (a product or service) or a " "'group' of sub-details which are simple items." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) subDetail: typing.List[ fhirtypes.ExplanationOfBenefitItemDetailSubDetailType ] | None = Field( default=None, alias="subDetail", title="Additional items", description="Third-tier of goods and services.", json_schema_extra={ "element_property": True, }, ) udi: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="udi", title="Unique device identifier", description="Unique Device Identifiers associated with this line item.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description=( "If the item is not a group then this is the fee for the product or " "service, otherwise this is the total of the fees for the details of " "the group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitItemDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "revenue", "category", "productOrService", "modifier", "programCode", "quantity", "unitPrice", "factor", "net", "udi", "noteNumber", "adjudication", "subDetail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItemDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields class ExplanationOfBenefitItemDetailSubDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional items. Third-tier of goods and services. """ __resource_type__ = "ExplanationOfBenefitItemDetailSubDetail" adjudication: typing.List[ fhirtypes.ExplanationOfBenefitItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Subdetail level adjudication details", description="The adjudication results.", json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Benefit classification", description=( "Code to identify the general type of benefits under which products and" " services are provided." ), json_schema_extra={ "element_property": True, }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The quantity times the unit price for an additional service or product" " or charge." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="Applicable note numbers", description=( "The numbers associated with notes below which apply to the " "adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) productOrService: fhirtypes.CodeableConceptType = Field( default=..., alias="productOrService", title="Billing, service, product, or drug code", description=( "When the value is a group code then this item collects a set of " "related claim details, otherwise this contains the product, service, " "drug or other billing code for the item." ), json_schema_extra={ "element_property": True, }, ) programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="programCode", title="Program the product or service is provided under", description="Identifies the program under which this may be recovered.", json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of revenue or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Product or service provided", description=( "A claim detail line. Either a simple (a product or service) or a " "'group' of sub-details which are simple items." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) udi: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="udi", title="Unique device identifier", description="Unique Device Identifiers associated with this line item.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description=( "If the item is not a group then this is the fee for the product or " "service, otherwise this is the total of the fees for the details of " "the group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "revenue", "category", "productOrService", "modifier", "programCode", "quantity", "unitPrice", "factor", "net", "udi", "noteNumber", "adjudication", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields class ExplanationOfBenefitPayee(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Recipient of benefits payable. The party to be reimbursed for cost of the products and services according to the terms of the policy. """ __resource_type__ = "ExplanationOfBenefitPayee" party: fhirtypes.ReferenceType | None = Field( default=None, alias="party", title="Recipient reference", description=( "Reference to the individual or organization to whom any payment will " "be made." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Patient", "RelatedPerson", ], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Category of recipient", description="Type of Party to be reimbursed: Subscriber, provider, other.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitPayee`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "party"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitPayee`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitPayment(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Payment Details. Payment details for the adjudication of the claim. """ __resource_type__ = "ExplanationOfBenefitPayment" adjustment: fhirtypes.MoneyType | None = Field( default=None, alias="adjustment", title="Payment adjustment for non-claim issues", description=( "Total amount of all adjustments to this payment included in this " "transaction which are not related to this claim's adjudication." ), json_schema_extra={ "element_property": True, }, ) adjustmentReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="adjustmentReason", title="Explanation for the variance", description="Reason for the payment adjustment.", json_schema_extra={ "element_property": True, }, ) amount: fhirtypes.MoneyType | None = Field( default=None, alias="amount", title="Payable amount after adjustment", description="Benefits payable less any payment adjustment.", json_schema_extra={ "element_property": True, }, ) date: fhirtypes.DateType | None = Field( default=None, alias="date", title="Expected date of payment", description=( "Estimated date the payment will be issued or the actual issue date of " "payment." ), json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Business identifier for the payment", description="Issuer's unique identifier for the payment instrument.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Partial or complete payment", description=( "Whether this represents partial or complete payment of the benefits " "payable." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitPayment`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "adjustment", "adjustmentReason", "date", "amount", "identifier", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitPayment`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitProcedure(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Clinical procedures performed. Procedures performed on the patient relevant to the billing items with the claim. """ __resource_type__ = "ExplanationOfBenefitProcedure" date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When the procedure was performed", description="Date and optionally time the procedure was performed.", json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) procedureCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="procedureCodeableConcept", title="Specific clinical procedure", description=( "The code or reference to a Procedure resource which identifies the " "clinical intervention performed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e procedure[x] "one_of_many": "procedure", "one_of_many_required": True, }, ) procedureReference: fhirtypes.ReferenceType | None = Field( default=None, alias="procedureReference", title="Specific clinical procedure", description=( "The code or reference to a Procedure resource which identifies the " "clinical intervention performed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e procedure[x] "one_of_many": "procedure", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Procedure"], }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Procedure instance identifier", description="A number to uniquely identify procedure entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Category of Procedure", description="When the condition was observed or the relative ranking.", json_schema_extra={ "element_property": True, }, ) udi: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="udi", title="Unique device identifier", description="Unique Device Identifiers associated with this line item.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitProcedure`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "type", "date", "procedureCodeableConcept", "procedureReference", "udi", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitProcedure`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "procedure": ["procedureCodeableConcept", "procedureReference"] } return one_of_many_fields class ExplanationOfBenefitProcessNote(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Note concerning adjudication. A note that describes or explains adjudication results in a human readable form. """ __resource_type__ = "ExplanationOfBenefitProcessNote" language: fhirtypes.CodeableConceptType | None = Field( default=None, alias="language", title="Language of the text", description="A code to define the language used in the text of the note.", json_schema_extra={ "element_property": True, }, ) number: fhirtypes.PositiveIntType | None = Field( default=None, alias="number", title="Note instance identifier", description="A number to uniquely identify a note entry.", json_schema_extra={ "element_property": True, }, ) number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_number", title="Extension field for ``number``." ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Note explanatory text", description="The explanation or description associated with the processing.", json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="display | print | printoper", description="The business purpose of the note text.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["display", "print", "printoper"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitProcessNote`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "number", "type", "text", "language", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitProcessNote`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitRelated(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Prior or corollary claims. Other claims which are related to this claim such as prior submissions or claims for related services or for the same event. """ __resource_type__ = "ExplanationOfBenefitRelated" claim: fhirtypes.ReferenceType | None = Field( default=None, alias="claim", title="Reference to the related claim", description="Reference to a related claim.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Claim"], }, ) reference: fhirtypes.IdentifierType | None = Field( default=None, alias="reference", title="File or case reference", description=( "An alternate organizational reference to the case or file to which " "this particular claim pertains." ), json_schema_extra={ "element_property": True, }, ) relationship: fhirtypes.CodeableConceptType | None = Field( default=None, alias="relationship", title="How the reference claim is related", description="A code to convey how the claims are related.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitRelated`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "claim", "relationship", "reference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitRelated`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitSupportingInfo(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Supporting information. Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues. """ __resource_type__ = "ExplanationOfBenefitSupportingInfo" category: fhirtypes.CodeableConceptType = Field( default=..., alias="category", title="Classification of the supplied information", description=( "The general class of the information supplied: information; exception;" " accident, employment; onset, etc." ), json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Type of information", description=( "System and code pertaining to the specific information regarding " "special conditions relating to the setting, treatment or patient for " "which care is sought." ), json_schema_extra={ "element_property": True, }, ) reason: fhirtypes.CodingType | None = Field( default=None, alias="reason", title="Explanation for the information", description=( "Provides the reason in the situation where a reason code is required " "in addition to the content." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Information instance identifier", description="A number to uniquely identify supporting information entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) timingDate: fhirtypes.DateType | None = Field( default=None, alias="timingDate", title="When it occurred", description="The date when or period to which this information refers.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timingDate", title="Extension field for ``timingDate``." ) timingPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="timingPeriod", title="When it occurred", description="The date when or period to which this information refers.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Data to be provided", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Data to be provided", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Data to be provided", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Data to be provided", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Data to be provided", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitSupportingInfo`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "category", "code", "timingDate", "timingPeriod", "valueBoolean", "valueString", "valueQuantity", "valueAttachment", "valueReference", "reason", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitSupportingInfo`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "timing": ["timingDate", "timingPeriod"], "value": [ "valueAttachment", "valueBoolean", "valueQuantity", "valueReference", "valueString", ], } return one_of_many_fields class ExplanationOfBenefitTotal(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Adjudication totals. Categorized monetary totals for the adjudication. """ __resource_type__ = "ExplanationOfBenefitTotal" amount: fhirtypes.MoneyType = Field( default=..., alias="amount", title="Financial total for the category", description="Monetary total amount associated with the category.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) category: fhirtypes.CodeableConceptType = Field( default=..., alias="category", title="Type of adjudication information", description=( "A code to indicate the information type of this adjudication record. " "Information types may include: the value submitted, maximum values or " "percentages allowed or payable under the plan, amounts that the " "patient is responsible for in aggregate or pertaining to this item, " "amounts paid by other coverages, and the benefit payable for this " "item." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitTotal`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "category", "amount"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitTotal`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "category", "amount"] ================================================ FILE: fhir/resources/R4B/expression.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Expression Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Expression(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An expression that can be used to generate a value. A expression that is evaluated in a specified context and returns a value. The context of use of the expression must specify the context in which the expression is evaluated, and how the result of the expression is used. """ __resource_type__ = "Expression" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Natural language description of the condition", description=( "A brief, natural language description of the condition that " "effectively communicates the intended semantics." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="Expression in specified language", description="An expression in the specified language that returns a value.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) language: fhirtypes.CodeType | None = Field( default=None, alias="language", title=( "text/cql | text/fhirpath | application/x-fhir-query | text/cql-" "identifier | text/cql-expression | etc." ), description="The media type of the language for the expression.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "text/cql", "text/fhirpath", "application/x-fhir-query", "text/cql-identifier", "text/cql-expression", "etc.", ], }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) name: fhirtypes.IdType | None = Field( default=None, alias="name", title="Short name assigned to expression for reuse", description=( "A short name assigned to the expression to allow for multiple reuse of" " the expression in the context where it is defined." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) reference: fhirtypes.UriType | None = Field( default=None, alias="reference", title="Where the expression is found", description="A URI that defines where the expression is found.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reference", title="Extension field for ``reference``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Expression`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "description", "name", "language", "expression", "reference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Expression`` according to specification, with preserving the original sequence order. """ return ["description", "name", "language", "expression", "reference"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("language", "language__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/extension.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Extension Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Extension(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Optional Extensions Element. Optional Extension Element - found in all resources. """ __resource_type__ = "Extension" url: fhirtypes.UriType | None = Field( default=None, alias="url", title="identifies the meaning of the extension", description=( "Source of the definition for the extension code - a logical name or a " "URL." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) valueAddress: fhirtypes.AddressType | None = Field( default=None, alias="valueAddress", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueAge: fhirtypes.AgeType | None = Field( default=None, alias="valueAge", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="valueAnnotation", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="valueBase64Binary", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="valueCanonical", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCodeableReference: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="valueCodeableReference", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueContactDetail: fhirtypes.ContactDetailType | None = Field( default=None, alias="valueContactDetail", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="valueContactPoint", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueContributor: fhirtypes.ContributorType | None = Field( default=None, alias="valueContributor", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCount: fhirtypes.CountType | None = Field( default=None, alias="valueCount", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDataRequirement: fhirtypes.DataRequirementType | None = Field( default=None, alias="valueDataRequirement", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDistance: fhirtypes.DistanceType | None = Field( default=None, alias="valueDistance", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDosage: fhirtypes.DosageType | None = Field( default=None, alias="valueDosage", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDuration: fhirtypes.DurationType | None = Field( default=None, alias="valueDuration", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueExpression: fhirtypes.ExpressionType | None = Field( default=None, alias="valueExpression", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="valueHumanName", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueId: fhirtypes.IdType | None = Field( default=None, alias="valueId", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="valueIdentifier", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInstant: fhirtypes.InstantType | None = Field( default=None, alias="valueInstant", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="valueMarkdown", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueMoney: fhirtypes.MoneyType | None = Field( default=None, alias="valueMoney", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueOid: fhirtypes.OidType | None = Field( default=None, alias="valueOid", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field( default=None, alias="valueParameterDefinition", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="valuePositiveInt", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRatioRange: fhirtypes.RatioRangeType | None = Field( default=None, alias="valueRatioRange", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field( default=None, alias="valueRelatedArtifact", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="valueSampledData", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueSignature: fhirtypes.SignatureType | None = Field( default=None, alias="valueSignature", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueTiming: fhirtypes.TimingType | None = Field( default=None, alias="valueTiming", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field( default=None, alias="valueTriggerDefinition", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="valueUnsignedInt", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUrl: fhirtypes.UrlType | None = Field( default=None, alias="valueUrl", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUsageContext: fhirtypes.UsageContextType | None = Field( default=None, alias="valueUsageContext", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUuid: fhirtypes.UuidType | None = Field( default=None, alias="valueUuid", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Extension`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "url", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInstant", "valueInteger", "valueMarkdown", "valueOid", "valuePositiveInt", "valueString", "valueTime", "valueUnsignedInt", "valueUri", "valueUrl", "valueUuid", "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueCodeableConcept", "valueCodeableReference", "valueCoding", "valueContactPoint", "valueCount", "valueDistance", "valueDuration", "valueHumanName", "valueIdentifier", "valueMoney", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueRatioRange", "valueReference", "valueSampledData", "valueSignature", "valueTiming", "valueContactDetail", "valueContributor", "valueDataRequirement", "valueExpression", "valueParameterDefinition", "valueRelatedArtifact", "valueTriggerDefinition", "valueUsageContext", "valueDosage", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Extension`` according to specification, with preserving the original sequence order. """ return [] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueCodeableConcept", "valueCodeableReference", "valueCoding", "valueContactDetail", "valueContactPoint", "valueContributor", "valueCount", "valueDataRequirement", "valueDate", "valueDateTime", "valueDecimal", "valueDistance", "valueDosage", "valueDuration", "valueExpression", "valueHumanName", "valueId", "valueIdentifier", "valueInstant", "valueInteger", "valueMarkdown", "valueMoney", "valueOid", "valueParameterDefinition", "valuePeriod", "valuePositiveInt", "valueQuantity", "valueRange", "valueRatio", "valueRatioRange", "valueReference", "valueRelatedArtifact", "valueSampledData", "valueSignature", "valueString", "valueTime", "valueTiming", "valueTriggerDefinition", "valueUnsignedInt", "valueUri", "valueUrl", "valueUsageContext", "valueUuid", ] } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/familymemberhistory.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/FamilyMemberHistory Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class FamilyMemberHistory(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about patient's relatives, relevant for patient. Significant health conditions for a person related to the patient relevant in the context of care for the patient. """ __resource_type__ = "FamilyMemberHistory" ageAge: fhirtypes.AgeType | None = Field( default=None, alias="ageAge", title="(approximate) age", description=( "The age of the relative at the time the family member history is " "recorded." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e age[x] "one_of_many": "age", "one_of_many_required": False, }, ) ageRange: fhirtypes.RangeType | None = Field( default=None, alias="ageRange", title="(approximate) age", description=( "The age of the relative at the time the family member history is " "recorded." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e age[x] "one_of_many": "age", "one_of_many_required": False, }, ) ageString: fhirtypes.StringType | None = Field( default=None, alias="ageString", title="(approximate) age", description=( "The age of the relative at the time the family member history is " "recorded." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e age[x] "one_of_many": "age", "one_of_many_required": False, }, ) ageString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_ageString", title="Extension field for ``ageString``." ) bornDate: fhirtypes.DateType | None = Field( default=None, alias="bornDate", title="(approximate) date of birth", description="The actual or approximate date of birth of the relative.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e born[x] "one_of_many": "born", "one_of_many_required": False, }, ) bornDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_bornDate", title="Extension field for ``bornDate``." ) bornPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="bornPeriod", title="(approximate) date of birth", description="The actual or approximate date of birth of the relative.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e born[x] "one_of_many": "born", "one_of_many_required": False, }, ) bornString: fhirtypes.StringType | None = Field( default=None, alias="bornString", title="(approximate) date of birth", description="The actual or approximate date of birth of the relative.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e born[x] "one_of_many": "born", "one_of_many_required": False, }, ) bornString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_bornString", title="Extension field for ``bornString``." ) condition: typing.List[fhirtypes.FamilyMemberHistoryConditionType] | None = Field( default=None, alias="condition", title="Condition that the related person had", description=( "The significant Conditions (or condition) that the family member had. " "This is a repeating section to allow a system to represent more than " "one condition per resource, though there is nothing stopping multiple " "resources - one per condition." ), json_schema_extra={ "element_property": True, }, ) dataAbsentReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="dataAbsentReason", title="subject-unknown | withheld | unable-to-obtain | deferred", description="Describes why the family member's history is not available.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When history was recorded or last updated", description=( "The date (and possibly time) when the family member history was " "recorded or last updated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) deceasedAge: fhirtypes.AgeType | None = Field( default=None, alias="deceasedAge", title="Dead? How old/when?", description=( "Deceased flag or the actual or approximate age of the relative at the " "time of death for the family member history record." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedBoolean: bool | None = Field( default=None, alias="deceasedBoolean", title="Dead? How old/when?", description=( "Deceased flag or the actual or approximate age of the relative at the " "time of death for the family member history record." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deceasedBoolean", title="Extension field for ``deceasedBoolean``.", ) deceasedDate: fhirtypes.DateType | None = Field( default=None, alias="deceasedDate", title="Dead? How old/when?", description=( "Deceased flag or the actual or approximate age of the relative at the " "time of death for the family member history record." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deceasedDate", title="Extension field for ``deceasedDate``.", ) deceasedRange: fhirtypes.RangeType | None = Field( default=None, alias="deceasedRange", title="Dead? How old/when?", description=( "Deceased flag or the actual or approximate age of the relative at the " "time of death for the family member history record." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedString: fhirtypes.StringType | None = Field( default=None, alias="deceasedString", title="Dead? How old/when?", description=( "Deceased flag or the actual or approximate age of the relative at the " "time of death for the family member history record." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deceasedString", title="Extension field for ``deceasedString``.", ) estimatedAge: bool | None = Field( default=None, alias="estimatedAge", title="Age is estimated?", description="If true, indicates that the age value specified is an estimated value.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) estimatedAge__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_estimatedAge", title="Extension field for ``estimatedAge``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Id(s) for this record", description=( "Business identifiers assigned to this family member history by the " "performer or other systems which remain constant as the resource is " "updated and propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="instantiatesCanonical", title="Instantiates FHIR protocol or definition", description=( "The URL pointing to a FHIR-defined protocol, guideline, orderset or " "other definition that is adhered to in whole or in part by this " "FamilyMemberHistory." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "PlanDefinition", "Questionnaire", "ActivityDefinition", "Measure", "OperationDefinition", ], }, ) instantiatesCanonical__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="instantiatesUri", title="Instantiates external protocol or definition", description=( "The URL pointing to an externally maintained protocol, guideline, " "orderset or other definition that is adhered to in whole or in part by" " this FamilyMemberHistory." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="The family member described", description=( 'This will either be a name or a description; e.g. "Aunt Susan", "my ' 'cousin with the red hair".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="General note about related person", description=( "This property allows a non condition-specific note to the made about " "the related person. Ideally, the note would be in the condition " "property, but this is not always possible." ), json_schema_extra={ "element_property": True, }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Patient history is about", description="The person who this history concerns.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Why was family member history performed?", description=( "Describes why the family member history occurred in coded or textual " "form." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Why was family member history performed?", description=( "Indicates a Condition, Observation, AllergyIntolerance, or " "QuestionnaireResponse that justifies this family member history event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "AllergyIntolerance", "QuestionnaireResponse", "DiagnosticReport", "DocumentReference", ], }, ) relationship: fhirtypes.CodeableConceptType = Field( default=..., alias="relationship", title="Relationship to the subject", description=( "The type of relationship this person has to the patient (father, " "mother, brother etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sex: fhirtypes.CodeableConceptType | None = Field( default=None, alias="sex", title="male | female | other | unknown", description="The birth sex of the family member.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="partial | completed | entered-in-error | health-unknown", description=( "A code specifying the status of the record of the family history of a " "specific family member." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "partial", "completed", "entered-in-error", "health-unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``FamilyMemberHistory`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "status", "dataAbsentReason", "patient", "date", "name", "relationship", "sex", "bornPeriod", "bornDate", "bornString", "ageAge", "ageRange", "ageString", "estimatedAge", "deceasedBoolean", "deceasedAge", "deceasedRange", "deceasedDate", "deceasedString", "reasonCode", "reasonReference", "note", "condition", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``FamilyMemberHistory`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "instantiatesCanonical", "instantiatesUri", "status", "dataAbsentReason", "patient", "date", "name", "relationship", "sex", "ageAge", "ageRange", "ageString", "estimatedAge", "deceasedBoolean", "deceasedAge", "deceasedRange", "deceasedDate", "deceasedString", "reasonCode", "reasonReference", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "age": ["ageAge", "ageRange", "ageString"], "born": ["bornDate", "bornPeriod", "bornString"], "deceased": [ "deceasedAge", "deceasedBoolean", "deceasedDate", "deceasedRange", "deceasedString", ], } return one_of_many_fields class FamilyMemberHistoryCondition(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Condition that the related person had. The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition. """ __resource_type__ = "FamilyMemberHistoryCondition" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Condition suffered by relation", description=( "The actual condition specified. Could be a coded condition (like MI or" " Diabetes) or a less specific string like 'cancer' depending on how " "much is known about the condition and the capabilities of the creating" " system." ), json_schema_extra={ "element_property": True, }, ) contributedToDeath: bool | None = Field( default=None, alias="contributedToDeath", title="Whether the condition contributed to the cause of death", description=( "This condition contributed to the cause of death of the related " "person. If contributedToDeath is not populated, then it is unknown." ), json_schema_extra={ "element_property": True, }, ) contributedToDeath__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contributedToDeath", title="Extension field for ``contributedToDeath``.", ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Extra information about condition", description=( "An area where general notes can be placed about this specific " "condition." ), json_schema_extra={ "element_property": True, }, ) onsetAge: fhirtypes.AgeType | None = Field( default=None, alias="onsetAge", title="When condition first manifested", description=( "Either the age of onset, range of approximate age or descriptive " "string can be recorded. For conditions with multiple occurrences, " "this describes the first known occurrence." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="onsetPeriod", title="When condition first manifested", description=( "Either the age of onset, range of approximate age or descriptive " "string can be recorded. For conditions with multiple occurrences, " "this describes the first known occurrence." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetRange: fhirtypes.RangeType | None = Field( default=None, alias="onsetRange", title="When condition first manifested", description=( "Either the age of onset, range of approximate age or descriptive " "string can be recorded. For conditions with multiple occurrences, " "this describes the first known occurrence." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetString: fhirtypes.StringType | None = Field( default=None, alias="onsetString", title="When condition first manifested", description=( "Either the age of onset, range of approximate age or descriptive " "string can be recorded. For conditions with multiple occurrences, " "this describes the first known occurrence." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onsetString", title="Extension field for ``onsetString``." ) outcome: fhirtypes.CodeableConceptType | None = Field( default=None, alias="outcome", title="deceased | permanent disability | etc.", description=( "Indicates what happened following the condition. If the condition " "resulted in death, deceased date is captured on the relation." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``FamilyMemberHistoryCondition`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "outcome", "contributedToDeath", "onsetAge", "onsetRange", "onsetPeriod", "onsetString", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``FamilyMemberHistoryCondition`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "onset": ["onsetAge", "onsetPeriod", "onsetRange", "onsetString"] } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/fhirprimitiveextension.py ================================================ from __future__ import annotations as _annotations import typing from fhir_core import fhirabstractmodel from pydantic import Field, model_validator from pydantic_core import PydanticCustomError from . import fhirtypes __author__ = "Md Nazrul Islam" __email__ = "email2nazrul@gmail.com" class FHIRPrimitiveExtension(fhirabstractmodel.FHIRAbstractModel): """@see: https://www.hl7.org/fhir/extensibility.html Extensibility feature for FHIR Primitive Data Types.""" __resource_type__ = "FHIRPrimitiveExtension" id: typing.Optional[fhirtypes.StringType] = Field( default=None, alias="id", title="Type `String`", description="Unique id for inter-element referencing", # if property is an element of this resource. json_schema_extra={"element_property": False}, ) extension: typing.Optional[typing.List[fhirtypes.ExtensionType]] = Field( None, alias="extension", title="List of `Extension` items (represented as `dict` in JSON)", description="Additional content defined by implementations", # if property is an element of this resource. json_schema_extra={"element_property": False}, ) @model_validator(mode="before") def validate_extension_or_fhir_comment_required( cls, values: typing.Dict[str, typing.Any] ) -> typing.Dict[str, typing.Any]: """Conditional Required Validation""" extension = values.get("extension", None) fhir_comments = values.get("fhir_comments", None) if ( values.get("id", None) is None and extension is None and fhir_comments is None ): raise PydanticCustomError( "model_validation_format", "One of field value is required.", {}, ) return values @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``FHIRPrimitiveExtension`` according to specification, with preserving original sequence order. """ return ["id", "extension"] ================================================ FILE: fhir/resources/R4B/fhirresourcemodel.py ================================================ from typing import Optional, Union from fhir_core.fhirabstractmodel import FHIRAbstractModel from .fhirtypes import IdType, StringType class FHIRResourceModel(FHIRAbstractModel): """Abstract base model class for all FHIR elements.""" __resource_type__ = "FHIRAbstractResource" id: Optional[Union[IdType, StringType]] = None def relative_base(self) -> str: """ """ return self.__resource_type__ def relative_path(self) -> str: if self.id is None: return self.relative_base() return "{0}/{1}".format(self.relative_base(), self.id) ================================================ FILE: fhir/resources/R4B/fhirtypes.py ================================================ from __future__ import annotations as _annotations from typing import TYPE_CHECKING from fhir_core.types import ( Base64BinaryType, BooleanType, CanonicalType, CodeType, DateTimeType, DateType, DecimalType, IdType, InstantType, Integer64Type, IntegerType, MarkdownType, OidType, PositiveIntType, StringType, TimeType, UnsignedIntType, UriType, UrlType, UuidType, XhtmlType, create_fhir_element_or_resource_type, create_fhir_type, ) __author__ = "Md Nazrul Islam" __email__ = "email2nazrul@gmail.com" # The dependency hierarchy is circular due to Extension being referenced in FHIRPrimitiveExtension # which itself is referenced in every resource. Extension is also referenced in several resources and refers to several resources. # Pydantic fields can not use forward references as this causes the "class not fully defined" error at runtime: https://docs.pydantic.dev/2.12/errors/usage_errors/#class-not-fully-defined # To properly allow type checkers to type check, use type aliases during type checking and the create_fhir_type workaround at runtime. if TYPE_CHECKING: from . import ( account, activitydefinition, address, administrableproductdefinition, adverseevent, age, allergyintolerance, annotation, appointment, appointmentresponse, attachment, auditevent, backboneelement, basic, binary, biologicallyderivedproduct, bodystructure, bundle, capabilitystatement, careplan, careteam, catalogentry, chargeitem, chargeitemdefinition, citation, claim, claimresponse, clinicalimpression, clinicalusedefinition, codeableconcept, codeablereference, codesystem, coding, communication, communicationrequest, compartmentdefinition, composition, conceptmap, condition, consent, contactdetail, contactpoint, contract, contributor, count, coverage, coverageeligibilityrequest, coverageeligibilityresponse, datarequirement, detectedissue, device, devicedefinition, devicemetric, devicerequest, deviceusestatement, diagnosticreport, distance, documentmanifest, documentreference, domainresource, dosage, duration, element, elementdefinition, encounter, endpoint, enrollmentrequest, enrollmentresponse, episodeofcare, eventdefinition, evidence, evidencereport, evidencevariable, examplescenario, explanationofbenefit, expression, extension, familymemberhistory, flag, goal, graphdefinition, group, guidanceresponse, healthcareservice, humanname, identifier, imagingstudy, immunization, immunizationevaluation, immunizationrecommendation, implementationguide, ingredient, insuranceplan, invoice, library, linkage, list, location, manufactureditemdefinition, marketingstatus, measure, measurereport, media, medication, medicationadministration, medicationdispense, medicationknowledge, medicationrequest, medicationstatement, medicinalproductdefinition, messagedefinition, messageheader, meta, molecularsequence, money, namingsystem, narrative, nutritionorder, nutritionproduct, observation, observationdefinition, operationdefinition, operationoutcome, organization, organizationaffiliation, packagedproductdefinition, parameterdefinition, parameters, patient, paymentnotice, paymentreconciliation, period, person, plandefinition, population, practitioner, practitionerrole, procedure, prodcharacteristic, productshelflife, provenance, quantity, questionnaire, questionnaireresponse, range, ratio, ratiorange, reference, regulatedauthorization, relatedartifact, relatedperson, requestgroup, researchdefinition, researchelementdefinition, researchstudy, researchsubject, resource, riskassessment, sampleddata, schedule, searchparameter, servicerequest, signature, slot, specimen, specimendefinition, structuredefinition, structuremap, subscription, subscriptionstatus, subscriptiontopic, substance, substancedefinition, supplydelivery, supplyrequest, task, terminologycapabilities, testreport, testscript, timing, triggerdefinition, usagecontext, valueset, verificationresult, visionprescription, ) from .fhirprimitiveextension import FHIRPrimitiveExtension FHIRPrimitiveExtensionType = FHIRPrimitiveExtension AccountType = account.Account AccountCoverageType = account.AccountCoverage AccountGuarantorType = account.AccountGuarantor ActivityDefinitionType = activitydefinition.ActivityDefinition ActivityDefinitionDynamicValueType = ( activitydefinition.ActivityDefinitionDynamicValue ) ActivityDefinitionParticipantType = activitydefinition.ActivityDefinitionParticipant AddressType = address.Address AdministrableProductDefinitionType = ( administrableproductdefinition.AdministrableProductDefinition ) AdministrableProductDefinitionPropertyType = ( administrableproductdefinition.AdministrableProductDefinitionProperty ) AdministrableProductDefinitionRouteOfAdministrationType = ( administrableproductdefinition.AdministrableProductDefinitionRouteOfAdministration ) AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesType = ( administrableproductdefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpecies ) AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodType = ( administrableproductdefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriod ) AdverseEventType = adverseevent.AdverseEvent AdverseEventSuspectEntityType = adverseevent.AdverseEventSuspectEntity AdverseEventSuspectEntityCausalityType = ( adverseevent.AdverseEventSuspectEntityCausality ) AgeType = age.Age AllergyIntoleranceType = allergyintolerance.AllergyIntolerance AllergyIntoleranceReactionType = allergyintolerance.AllergyIntoleranceReaction AnnotationType = annotation.Annotation AppointmentType = appointment.Appointment AppointmentParticipantType = appointment.AppointmentParticipant AppointmentResponseType = appointmentresponse.AppointmentResponse AttachmentType = attachment.Attachment AuditEventType = auditevent.AuditEvent AuditEventAgentType = auditevent.AuditEventAgent AuditEventAgentNetworkType = auditevent.AuditEventAgentNetwork AuditEventEntityType = auditevent.AuditEventEntity AuditEventEntityDetailType = auditevent.AuditEventEntityDetail AuditEventSourceType = auditevent.AuditEventSource BackboneElementType = backboneelement.BackboneElement BasicType = basic.Basic BinaryType = binary.Binary BiologicallyDerivedProductType = ( biologicallyderivedproduct.BiologicallyDerivedProduct ) BiologicallyDerivedProductCollectionType = ( biologicallyderivedproduct.BiologicallyDerivedProductCollection ) BiologicallyDerivedProductManipulationType = ( biologicallyderivedproduct.BiologicallyDerivedProductManipulation ) BiologicallyDerivedProductProcessingType = ( biologicallyderivedproduct.BiologicallyDerivedProductProcessing ) BiologicallyDerivedProductStorageType = ( biologicallyderivedproduct.BiologicallyDerivedProductStorage ) BodyStructureType = bodystructure.BodyStructure BundleType = bundle.Bundle BundleEntryType = bundle.BundleEntry BundleEntryRequestType = bundle.BundleEntryRequest BundleEntryResponseType = bundle.BundleEntryResponse BundleEntrySearchType = bundle.BundleEntrySearch BundleLinkType = bundle.BundleLink CapabilityStatementType = capabilitystatement.CapabilityStatement CapabilityStatementDocumentType = capabilitystatement.CapabilityStatementDocument CapabilityStatementImplementationType = ( capabilitystatement.CapabilityStatementImplementation ) CapabilityStatementMessagingType = capabilitystatement.CapabilityStatementMessaging CapabilityStatementMessagingEndpointType = ( capabilitystatement.CapabilityStatementMessagingEndpoint ) CapabilityStatementMessagingSupportedMessageType = ( capabilitystatement.CapabilityStatementMessagingSupportedMessage ) CapabilityStatementRestType = capabilitystatement.CapabilityStatementRest CapabilityStatementRestInteractionType = ( capabilitystatement.CapabilityStatementRestInteraction ) CapabilityStatementRestResourceType = ( capabilitystatement.CapabilityStatementRestResource ) CapabilityStatementRestResourceInteractionType = ( capabilitystatement.CapabilityStatementRestResourceInteraction ) CapabilityStatementRestResourceOperationType = ( capabilitystatement.CapabilityStatementRestResourceOperation ) CapabilityStatementRestResourceSearchParamType = ( capabilitystatement.CapabilityStatementRestResourceSearchParam ) CapabilityStatementRestSecurityType = ( capabilitystatement.CapabilityStatementRestSecurity ) CapabilityStatementSoftwareType = capabilitystatement.CapabilityStatementSoftware CarePlanType = careplan.CarePlan CarePlanActivityType = careplan.CarePlanActivity CarePlanActivityDetailType = careplan.CarePlanActivityDetail CareTeamType = careteam.CareTeam CareTeamParticipantType = careteam.CareTeamParticipant CatalogEntryType = catalogentry.CatalogEntry CatalogEntryRelatedEntryType = catalogentry.CatalogEntryRelatedEntry ChargeItemType = chargeitem.ChargeItem ChargeItemDefinitionType = chargeitemdefinition.ChargeItemDefinition ChargeItemDefinitionApplicabilityType = ( chargeitemdefinition.ChargeItemDefinitionApplicability ) ChargeItemDefinitionPropertyGroupType = ( chargeitemdefinition.ChargeItemDefinitionPropertyGroup ) ChargeItemDefinitionPropertyGroupPriceComponentType = ( chargeitemdefinition.ChargeItemDefinitionPropertyGroupPriceComponent ) ChargeItemPerformerType = chargeitem.ChargeItemPerformer CitationType = citation.Citation CitationCitedArtifactType = citation.CitationCitedArtifact CitationCitedArtifactAbstractType = citation.CitationCitedArtifactAbstract CitationCitedArtifactClassificationType = ( citation.CitationCitedArtifactClassification ) CitationCitedArtifactClassificationWhoClassifiedType = ( citation.CitationCitedArtifactClassificationWhoClassified ) CitationCitedArtifactContributorshipType = ( citation.CitationCitedArtifactContributorship ) CitationCitedArtifactContributorshipEntryType = ( citation.CitationCitedArtifactContributorshipEntry ) CitationCitedArtifactContributorshipEntryAffiliationInfoType = ( citation.CitationCitedArtifactContributorshipEntryAffiliationInfo ) CitationCitedArtifactContributorshipEntryContributionInstanceType = ( citation.CitationCitedArtifactContributorshipEntryContributionInstance ) CitationCitedArtifactContributorshipSummaryType = ( citation.CitationCitedArtifactContributorshipSummary ) CitationCitedArtifactPartType = citation.CitationCitedArtifactPart CitationCitedArtifactPublicationFormType = ( citation.CitationCitedArtifactPublicationForm ) CitationCitedArtifactPublicationFormPeriodicReleaseType = ( citation.CitationCitedArtifactPublicationFormPeriodicRelease ) CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationType = ( citation.CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublication ) CitationCitedArtifactPublicationFormPublishedInType = ( citation.CitationCitedArtifactPublicationFormPublishedIn ) CitationCitedArtifactRelatesToType = citation.CitationCitedArtifactRelatesTo CitationCitedArtifactStatusDateType = citation.CitationCitedArtifactStatusDate CitationCitedArtifactTitleType = citation.CitationCitedArtifactTitle CitationCitedArtifactVersionType = citation.CitationCitedArtifactVersion CitationCitedArtifactWebLocationType = citation.CitationCitedArtifactWebLocation CitationClassificationType = citation.CitationClassification CitationRelatesToType = citation.CitationRelatesTo CitationStatusDateType = citation.CitationStatusDate CitationSummaryType = citation.CitationSummary ClaimType = claim.Claim ClaimAccidentType = claim.ClaimAccident ClaimCareTeamType = claim.ClaimCareTeam ClaimDiagnosisType = claim.ClaimDiagnosis ClaimInsuranceType = claim.ClaimInsurance ClaimItemType = claim.ClaimItem ClaimItemDetailType = claim.ClaimItemDetail ClaimItemDetailSubDetailType = claim.ClaimItemDetailSubDetail ClaimPayeeType = claim.ClaimPayee ClaimProcedureType = claim.ClaimProcedure ClaimRelatedType = claim.ClaimRelated ClaimResponseType = claimresponse.ClaimResponse ClaimResponseAddItemType = claimresponse.ClaimResponseAddItem ClaimResponseAddItemDetailType = claimresponse.ClaimResponseAddItemDetail ClaimResponseAddItemDetailSubDetailType = ( claimresponse.ClaimResponseAddItemDetailSubDetail ) ClaimResponseErrorType = claimresponse.ClaimResponseError ClaimResponseInsuranceType = claimresponse.ClaimResponseInsurance ClaimResponseItemType = claimresponse.ClaimResponseItem ClaimResponseItemAdjudicationType = claimresponse.ClaimResponseItemAdjudication ClaimResponseItemDetailType = claimresponse.ClaimResponseItemDetail ClaimResponseItemDetailSubDetailType = ( claimresponse.ClaimResponseItemDetailSubDetail ) ClaimResponsePaymentType = claimresponse.ClaimResponsePayment ClaimResponseProcessNoteType = claimresponse.ClaimResponseProcessNote ClaimResponseTotalType = claimresponse.ClaimResponseTotal ClaimSupportingInfoType = claim.ClaimSupportingInfo ClinicalImpressionType = clinicalimpression.ClinicalImpression ClinicalImpressionFindingType = clinicalimpression.ClinicalImpressionFinding ClinicalImpressionInvestigationType = ( clinicalimpression.ClinicalImpressionInvestigation ) ClinicalUseDefinitionType = clinicalusedefinition.ClinicalUseDefinition ClinicalUseDefinitionContraindicationType = ( clinicalusedefinition.ClinicalUseDefinitionContraindication ) ClinicalUseDefinitionContraindicationOtherTherapyType = ( clinicalusedefinition.ClinicalUseDefinitionContraindicationOtherTherapy ) ClinicalUseDefinitionIndicationType = ( clinicalusedefinition.ClinicalUseDefinitionIndication ) ClinicalUseDefinitionInteractionType = ( clinicalusedefinition.ClinicalUseDefinitionInteraction ) ClinicalUseDefinitionInteractionInteractantType = ( clinicalusedefinition.ClinicalUseDefinitionInteractionInteractant ) ClinicalUseDefinitionUndesirableEffectType = ( clinicalusedefinition.ClinicalUseDefinitionUndesirableEffect ) ClinicalUseDefinitionWarningType = ( clinicalusedefinition.ClinicalUseDefinitionWarning ) CodeSystemType = codesystem.CodeSystem CodeSystemConceptType = codesystem.CodeSystemConcept CodeSystemConceptDesignationType = codesystem.CodeSystemConceptDesignation CodeSystemConceptPropertyType = codesystem.CodeSystemConceptProperty CodeSystemFilterType = codesystem.CodeSystemFilter CodeSystemPropertyType = codesystem.CodeSystemProperty CodeableConceptType = codeableconcept.CodeableConcept CodeableReferenceType = codeablereference.CodeableReference CodingType = coding.Coding CommunicationType = communication.Communication CommunicationPayloadType = communication.CommunicationPayload CommunicationRequestType = communicationrequest.CommunicationRequest CommunicationRequestPayloadType = communicationrequest.CommunicationRequestPayload CompartmentDefinitionType = compartmentdefinition.CompartmentDefinition CompartmentDefinitionResourceType = ( compartmentdefinition.CompartmentDefinitionResource ) CompositionType = composition.Composition CompositionAttesterType = composition.CompositionAttester CompositionEventType = composition.CompositionEvent CompositionRelatesToType = composition.CompositionRelatesTo CompositionSectionType = composition.CompositionSection ConceptMapType = conceptmap.ConceptMap ConceptMapGroupType = conceptmap.ConceptMapGroup ConceptMapGroupElementType = conceptmap.ConceptMapGroupElement ConceptMapGroupElementTargetType = conceptmap.ConceptMapGroupElementTarget ConceptMapGroupElementTargetDependsOnType = ( conceptmap.ConceptMapGroupElementTargetDependsOn ) ConceptMapGroupUnmappedType = conceptmap.ConceptMapGroupUnmapped ConditionType = condition.Condition ConditionEvidenceType = condition.ConditionEvidence ConditionStageType = condition.ConditionStage ConsentType = consent.Consent ConsentPolicyType = consent.ConsentPolicy ConsentProvisionType = consent.ConsentProvision ConsentProvisionActorType = consent.ConsentProvisionActor ConsentProvisionDataType = consent.ConsentProvisionData ConsentVerificationType = consent.ConsentVerification ContactDetailType = contactdetail.ContactDetail ContactPointType = contactpoint.ContactPoint ContractType = contract.Contract ContractContentDefinitionType = contract.ContractContentDefinition ContractFriendlyType = contract.ContractFriendly ContractLegalType = contract.ContractLegal ContractRuleType = contract.ContractRule ContractSignerType = contract.ContractSigner ContractTermType = contract.ContractTerm ContractTermActionType = contract.ContractTermAction ContractTermActionSubjectType = contract.ContractTermActionSubject ContractTermAssetType = contract.ContractTermAsset ContractTermAssetContextType = contract.ContractTermAssetContext ContractTermAssetValuedItemType = contract.ContractTermAssetValuedItem ContractTermOfferType = contract.ContractTermOffer ContractTermOfferAnswerType = contract.ContractTermOfferAnswer ContractTermOfferPartyType = contract.ContractTermOfferParty ContractTermSecurityLabelType = contract.ContractTermSecurityLabel ContributorType = contributor.Contributor CountType = count.Count CoverageType = coverage.Coverage CoverageClassType = coverage.CoverageClass CoverageCostToBeneficiaryType = coverage.CoverageCostToBeneficiary CoverageCostToBeneficiaryExceptionType = coverage.CoverageCostToBeneficiaryException CoverageEligibilityRequestType = ( coverageeligibilityrequest.CoverageEligibilityRequest ) CoverageEligibilityRequestInsuranceType = ( coverageeligibilityrequest.CoverageEligibilityRequestInsurance ) CoverageEligibilityRequestItemType = ( coverageeligibilityrequest.CoverageEligibilityRequestItem ) CoverageEligibilityRequestItemDiagnosisType = ( coverageeligibilityrequest.CoverageEligibilityRequestItemDiagnosis ) CoverageEligibilityRequestSupportingInfoType = ( coverageeligibilityrequest.CoverageEligibilityRequestSupportingInfo ) CoverageEligibilityResponseType = ( coverageeligibilityresponse.CoverageEligibilityResponse ) CoverageEligibilityResponseErrorType = ( coverageeligibilityresponse.CoverageEligibilityResponseError ) CoverageEligibilityResponseInsuranceType = ( coverageeligibilityresponse.CoverageEligibilityResponseInsurance ) CoverageEligibilityResponseInsuranceItemType = ( coverageeligibilityresponse.CoverageEligibilityResponseInsuranceItem ) CoverageEligibilityResponseInsuranceItemBenefitType = ( coverageeligibilityresponse.CoverageEligibilityResponseInsuranceItemBenefit ) DataRequirementType = datarequirement.DataRequirement DataRequirementCodeFilterType = datarequirement.DataRequirementCodeFilter DataRequirementDateFilterType = datarequirement.DataRequirementDateFilter DataRequirementSortType = datarequirement.DataRequirementSort DetectedIssueType = detectedissue.DetectedIssue DetectedIssueEvidenceType = detectedissue.DetectedIssueEvidence DetectedIssueMitigationType = detectedissue.DetectedIssueMitigation DeviceType = device.Device DeviceDefinitionType = devicedefinition.DeviceDefinition DeviceDefinitionCapabilityType = devicedefinition.DeviceDefinitionCapability DeviceDefinitionDeviceNameType = devicedefinition.DeviceDefinitionDeviceName DeviceDefinitionMaterialType = devicedefinition.DeviceDefinitionMaterial DeviceDefinitionPropertyType = devicedefinition.DeviceDefinitionProperty DeviceDefinitionSpecializationType = devicedefinition.DeviceDefinitionSpecialization DeviceDefinitionUdiDeviceIdentifierType = ( devicedefinition.DeviceDefinitionUdiDeviceIdentifier ) DeviceDeviceNameType = device.DeviceDeviceName DeviceMetricType = devicemetric.DeviceMetric DeviceMetricCalibrationType = devicemetric.DeviceMetricCalibration DevicePropertyType = device.DeviceProperty DeviceRequestType = devicerequest.DeviceRequest DeviceRequestParameterType = devicerequest.DeviceRequestParameter DeviceSpecializationType = device.DeviceSpecialization DeviceUdiCarrierType = device.DeviceUdiCarrier DeviceUseStatementType = deviceusestatement.DeviceUseStatement DeviceVersionType = device.DeviceVersion DiagnosticReportType = diagnosticreport.DiagnosticReport DiagnosticReportMediaType = diagnosticreport.DiagnosticReportMedia DistanceType = distance.Distance DocumentManifestType = documentmanifest.DocumentManifest DocumentManifestRelatedType = documentmanifest.DocumentManifestRelated DocumentReferenceType = documentreference.DocumentReference DocumentReferenceContentType = documentreference.DocumentReferenceContent DocumentReferenceContextType = documentreference.DocumentReferenceContext DocumentReferenceRelatesToType = documentreference.DocumentReferenceRelatesTo DomainResourceType = domainresource.DomainResource DosageType = dosage.Dosage DosageDoseAndRateType = dosage.DosageDoseAndRate DurationType = duration.Duration ElementType = element.Element ElementDefinitionType = elementdefinition.ElementDefinition ElementDefinitionBaseType = elementdefinition.ElementDefinitionBase ElementDefinitionBindingType = elementdefinition.ElementDefinitionBinding ElementDefinitionConstraintType = elementdefinition.ElementDefinitionConstraint ElementDefinitionExampleType = elementdefinition.ElementDefinitionExample ElementDefinitionMappingType = elementdefinition.ElementDefinitionMapping ElementDefinitionSlicingType = elementdefinition.ElementDefinitionSlicing ElementDefinitionSlicingDiscriminatorType = ( elementdefinition.ElementDefinitionSlicingDiscriminator ) ElementDefinitionTypeType = elementdefinition.ElementDefinitionType EncounterType = encounter.Encounter EncounterClassHistoryType = encounter.EncounterClassHistory EncounterDiagnosisType = encounter.EncounterDiagnosis EncounterHospitalizationType = encounter.EncounterHospitalization EncounterLocationType = encounter.EncounterLocation EncounterParticipantType = encounter.EncounterParticipant EncounterStatusHistoryType = encounter.EncounterStatusHistory EndpointType = endpoint.Endpoint EnrollmentRequestType = enrollmentrequest.EnrollmentRequest EnrollmentResponseType = enrollmentresponse.EnrollmentResponse EpisodeOfCareType = episodeofcare.EpisodeOfCare EpisodeOfCareDiagnosisType = episodeofcare.EpisodeOfCareDiagnosis EpisodeOfCareStatusHistoryType = episodeofcare.EpisodeOfCareStatusHistory EventDefinitionType = eventdefinition.EventDefinition EvidenceType = evidence.Evidence EvidenceCertaintyType = evidence.EvidenceCertainty EvidenceReportType = evidencereport.EvidenceReport EvidenceReportRelatesToType = evidencereport.EvidenceReportRelatesTo EvidenceReportSectionType = evidencereport.EvidenceReportSection EvidenceReportSubjectType = evidencereport.EvidenceReportSubject EvidenceReportSubjectCharacteristicType = ( evidencereport.EvidenceReportSubjectCharacteristic ) EvidenceStatisticType = evidence.EvidenceStatistic EvidenceStatisticAttributeEstimateType = evidence.EvidenceStatisticAttributeEstimate EvidenceStatisticModelCharacteristicType = ( evidence.EvidenceStatisticModelCharacteristic ) EvidenceStatisticModelCharacteristicVariableType = ( evidence.EvidenceStatisticModelCharacteristicVariable ) EvidenceStatisticSampleSizeType = evidence.EvidenceStatisticSampleSize EvidenceVariableType = evidencevariable.EvidenceVariable EvidenceVariableCategoryType = evidencevariable.EvidenceVariableCategory EvidenceVariableCharacteristicType = evidencevariable.EvidenceVariableCharacteristic EvidenceVariableCharacteristicTimeFromStartType = ( evidencevariable.EvidenceVariableCharacteristicTimeFromStart ) EvidenceVariableDefinitionType = evidence.EvidenceVariableDefinition ExampleScenarioType = examplescenario.ExampleScenario ExampleScenarioActorType = examplescenario.ExampleScenarioActor ExampleScenarioInstanceType = examplescenario.ExampleScenarioInstance ExampleScenarioInstanceContainedInstanceType = ( examplescenario.ExampleScenarioInstanceContainedInstance ) ExampleScenarioInstanceVersionType = examplescenario.ExampleScenarioInstanceVersion ExampleScenarioProcessType = examplescenario.ExampleScenarioProcess ExampleScenarioProcessStepType = examplescenario.ExampleScenarioProcessStep ExampleScenarioProcessStepAlternativeType = ( examplescenario.ExampleScenarioProcessStepAlternative ) ExampleScenarioProcessStepOperationType = ( examplescenario.ExampleScenarioProcessStepOperation ) ExplanationOfBenefitType = explanationofbenefit.ExplanationOfBenefit ExplanationOfBenefitAccidentType = explanationofbenefit.ExplanationOfBenefitAccident ExplanationOfBenefitAddItemType = explanationofbenefit.ExplanationOfBenefitAddItem ExplanationOfBenefitAddItemDetailType = ( explanationofbenefit.ExplanationOfBenefitAddItemDetail ) ExplanationOfBenefitAddItemDetailSubDetailType = ( explanationofbenefit.ExplanationOfBenefitAddItemDetailSubDetail ) ExplanationOfBenefitBenefitBalanceType = ( explanationofbenefit.ExplanationOfBenefitBenefitBalance ) ExplanationOfBenefitBenefitBalanceFinancialType = ( explanationofbenefit.ExplanationOfBenefitBenefitBalanceFinancial ) ExplanationOfBenefitCareTeamType = explanationofbenefit.ExplanationOfBenefitCareTeam ExplanationOfBenefitDiagnosisType = ( explanationofbenefit.ExplanationOfBenefitDiagnosis ) ExplanationOfBenefitInsuranceType = ( explanationofbenefit.ExplanationOfBenefitInsurance ) ExplanationOfBenefitItemType = explanationofbenefit.ExplanationOfBenefitItem ExplanationOfBenefitItemAdjudicationType = ( explanationofbenefit.ExplanationOfBenefitItemAdjudication ) ExplanationOfBenefitItemDetailType = ( explanationofbenefit.ExplanationOfBenefitItemDetail ) ExplanationOfBenefitItemDetailSubDetailType = ( explanationofbenefit.ExplanationOfBenefitItemDetailSubDetail ) ExplanationOfBenefitPayeeType = explanationofbenefit.ExplanationOfBenefitPayee ExplanationOfBenefitPaymentType = explanationofbenefit.ExplanationOfBenefitPayment ExplanationOfBenefitProcedureType = ( explanationofbenefit.ExplanationOfBenefitProcedure ) ExplanationOfBenefitProcessNoteType = ( explanationofbenefit.ExplanationOfBenefitProcessNote ) ExplanationOfBenefitRelatedType = explanationofbenefit.ExplanationOfBenefitRelated ExplanationOfBenefitSupportingInfoType = ( explanationofbenefit.ExplanationOfBenefitSupportingInfo ) ExplanationOfBenefitTotalType = explanationofbenefit.ExplanationOfBenefitTotal ExpressionType = expression.Expression ExtensionType = extension.Extension FamilyMemberHistoryType = familymemberhistory.FamilyMemberHistory FamilyMemberHistoryConditionType = familymemberhistory.FamilyMemberHistoryCondition FlagType = flag.Flag GoalType = goal.Goal GoalTargetType = goal.GoalTarget GraphDefinitionType = graphdefinition.GraphDefinition GraphDefinitionLinkType = graphdefinition.GraphDefinitionLink GraphDefinitionLinkTargetType = graphdefinition.GraphDefinitionLinkTarget GraphDefinitionLinkTargetCompartmentType = ( graphdefinition.GraphDefinitionLinkTargetCompartment ) GroupType = group.Group GroupCharacteristicType = group.GroupCharacteristic GroupMemberType = group.GroupMember GuidanceResponseType = guidanceresponse.GuidanceResponse HealthcareServiceType = healthcareservice.HealthcareService HealthcareServiceAvailableTimeType = ( healthcareservice.HealthcareServiceAvailableTime ) HealthcareServiceEligibilityType = healthcareservice.HealthcareServiceEligibility HealthcareServiceNotAvailableType = healthcareservice.HealthcareServiceNotAvailable HumanNameType = humanname.HumanName IdentifierType = identifier.Identifier ImagingStudyType = imagingstudy.ImagingStudy ImagingStudySeriesType = imagingstudy.ImagingStudySeries ImagingStudySeriesInstanceType = imagingstudy.ImagingStudySeriesInstance ImagingStudySeriesPerformerType = imagingstudy.ImagingStudySeriesPerformer ImmunizationType = immunization.Immunization ImmunizationEducationType = immunization.ImmunizationEducation ImmunizationEvaluationType = immunizationevaluation.ImmunizationEvaluation ImmunizationPerformerType = immunization.ImmunizationPerformer ImmunizationProtocolAppliedType = immunization.ImmunizationProtocolApplied ImmunizationReactionType = immunization.ImmunizationReaction ImmunizationRecommendationType = ( immunizationrecommendation.ImmunizationRecommendation ) ImmunizationRecommendationRecommendationType = ( immunizationrecommendation.ImmunizationRecommendationRecommendation ) ImmunizationRecommendationRecommendationDateCriterionType = ( immunizationrecommendation.ImmunizationRecommendationRecommendationDateCriterion ) ImplementationGuideType = implementationguide.ImplementationGuide ImplementationGuideDefinitionType = ( implementationguide.ImplementationGuideDefinition ) ImplementationGuideDefinitionGroupingType = ( implementationguide.ImplementationGuideDefinitionGrouping ) ImplementationGuideDefinitionPageType = ( implementationguide.ImplementationGuideDefinitionPage ) ImplementationGuideDefinitionParameterType = ( implementationguide.ImplementationGuideDefinitionParameter ) ImplementationGuideDefinitionResourceType = ( implementationguide.ImplementationGuideDefinitionResource ) ImplementationGuideDefinitionTemplateType = ( implementationguide.ImplementationGuideDefinitionTemplate ) ImplementationGuideDependsOnType = implementationguide.ImplementationGuideDependsOn ImplementationGuideGlobalType = implementationguide.ImplementationGuideGlobal ImplementationGuideManifestType = implementationguide.ImplementationGuideManifest ImplementationGuideManifestPageType = ( implementationguide.ImplementationGuideManifestPage ) ImplementationGuideManifestResourceType = ( implementationguide.ImplementationGuideManifestResource ) IngredientType = ingredient.Ingredient IngredientManufacturerType = ingredient.IngredientManufacturer IngredientSubstanceType = ingredient.IngredientSubstance IngredientSubstanceStrengthType = ingredient.IngredientSubstanceStrength IngredientSubstanceStrengthReferenceStrengthType = ( ingredient.IngredientSubstanceStrengthReferenceStrength ) InsurancePlanType = insuranceplan.InsurancePlan InsurancePlanContactType = insuranceplan.InsurancePlanContact InsurancePlanCoverageType = insuranceplan.InsurancePlanCoverage InsurancePlanCoverageBenefitType = insuranceplan.InsurancePlanCoverageBenefit InsurancePlanCoverageBenefitLimitType = ( insuranceplan.InsurancePlanCoverageBenefitLimit ) InsurancePlanPlanType = insuranceplan.InsurancePlanPlan InsurancePlanPlanGeneralCostType = insuranceplan.InsurancePlanPlanGeneralCost InsurancePlanPlanSpecificCostType = insuranceplan.InsurancePlanPlanSpecificCost InsurancePlanPlanSpecificCostBenefitType = ( insuranceplan.InsurancePlanPlanSpecificCostBenefit ) InsurancePlanPlanSpecificCostBenefitCostType = ( insuranceplan.InsurancePlanPlanSpecificCostBenefitCost ) InvoiceType = invoice.Invoice InvoiceLineItemType = invoice.InvoiceLineItem InvoiceLineItemPriceComponentType = invoice.InvoiceLineItemPriceComponent InvoiceParticipantType = invoice.InvoiceParticipant LibraryType = library.Library LinkageType = linkage.Linkage LinkageItemType = linkage.LinkageItem ListType = list.List ListEntryType = list.ListEntry LocationType = location.Location LocationHoursOfOperationType = location.LocationHoursOfOperation LocationPositionType = location.LocationPosition ManufacturedItemDefinitionType = ( manufactureditemdefinition.ManufacturedItemDefinition ) ManufacturedItemDefinitionPropertyType = ( manufactureditemdefinition.ManufacturedItemDefinitionProperty ) MarketingStatusType = marketingstatus.MarketingStatus MeasureType = measure.Measure MeasureGroupType = measure.MeasureGroup MeasureGroupPopulationType = measure.MeasureGroupPopulation MeasureGroupStratifierType = measure.MeasureGroupStratifier MeasureGroupStratifierComponentType = measure.MeasureGroupStratifierComponent MeasureReportType = measurereport.MeasureReport MeasureReportGroupType = measurereport.MeasureReportGroup MeasureReportGroupPopulationType = measurereport.MeasureReportGroupPopulation MeasureReportGroupStratifierType = measurereport.MeasureReportGroupStratifier MeasureReportGroupStratifierStratumType = ( measurereport.MeasureReportGroupStratifierStratum ) MeasureReportGroupStratifierStratumComponentType = ( measurereport.MeasureReportGroupStratifierStratumComponent ) MeasureReportGroupStratifierStratumPopulationType = ( measurereport.MeasureReportGroupStratifierStratumPopulation ) MeasureSupplementalDataType = measure.MeasureSupplementalData MediaType = media.Media MedicationType = medication.Medication MedicationAdministrationType = medicationadministration.MedicationAdministration MedicationAdministrationDosageType = ( medicationadministration.MedicationAdministrationDosage ) MedicationAdministrationPerformerType = ( medicationadministration.MedicationAdministrationPerformer ) MedicationBatchType = medication.MedicationBatch MedicationDispenseType = medicationdispense.MedicationDispense MedicationDispensePerformerType = medicationdispense.MedicationDispensePerformer MedicationDispenseSubstitutionType = ( medicationdispense.MedicationDispenseSubstitution ) MedicationIngredientType = medication.MedicationIngredient MedicationKnowledgeType = medicationknowledge.MedicationKnowledge MedicationKnowledgeAdministrationGuidelinesType = ( medicationknowledge.MedicationKnowledgeAdministrationGuidelines ) MedicationKnowledgeAdministrationGuidelinesDosageType = ( medicationknowledge.MedicationKnowledgeAdministrationGuidelinesDosage ) MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsType = ( medicationknowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristics ) MedicationKnowledgeCostType = medicationknowledge.MedicationKnowledgeCost MedicationKnowledgeDrugCharacteristicType = ( medicationknowledge.MedicationKnowledgeDrugCharacteristic ) MedicationKnowledgeIngredientType = ( medicationknowledge.MedicationKnowledgeIngredient ) MedicationKnowledgeKineticsType = medicationknowledge.MedicationKnowledgeKinetics MedicationKnowledgeMedicineClassificationType = ( medicationknowledge.MedicationKnowledgeMedicineClassification ) MedicationKnowledgeMonitoringProgramType = ( medicationknowledge.MedicationKnowledgeMonitoringProgram ) MedicationKnowledgeMonographType = medicationknowledge.MedicationKnowledgeMonograph MedicationKnowledgePackagingType = medicationknowledge.MedicationKnowledgePackaging MedicationKnowledgeRegulatoryType = ( medicationknowledge.MedicationKnowledgeRegulatory ) MedicationKnowledgeRegulatoryMaxDispenseType = ( medicationknowledge.MedicationKnowledgeRegulatoryMaxDispense ) MedicationKnowledgeRegulatoryScheduleType = ( medicationknowledge.MedicationKnowledgeRegulatorySchedule ) MedicationKnowledgeRegulatorySubstitutionType = ( medicationknowledge.MedicationKnowledgeRegulatorySubstitution ) MedicationKnowledgeRelatedMedicationKnowledgeType = ( medicationknowledge.MedicationKnowledgeRelatedMedicationKnowledge ) MedicationRequestType = medicationrequest.MedicationRequest MedicationRequestDispenseRequestType = ( medicationrequest.MedicationRequestDispenseRequest ) MedicationRequestDispenseRequestInitialFillType = ( medicationrequest.MedicationRequestDispenseRequestInitialFill ) MedicationRequestSubstitutionType = medicationrequest.MedicationRequestSubstitution MedicationStatementType = medicationstatement.MedicationStatement MedicinalProductDefinitionType = ( medicinalproductdefinition.MedicinalProductDefinition ) MedicinalProductDefinitionCharacteristicType = ( medicinalproductdefinition.MedicinalProductDefinitionCharacteristic ) MedicinalProductDefinitionContactType = ( medicinalproductdefinition.MedicinalProductDefinitionContact ) MedicinalProductDefinitionCrossReferenceType = ( medicinalproductdefinition.MedicinalProductDefinitionCrossReference ) MedicinalProductDefinitionNameType = ( medicinalproductdefinition.MedicinalProductDefinitionName ) MedicinalProductDefinitionNameCountryLanguageType = ( medicinalproductdefinition.MedicinalProductDefinitionNameCountryLanguage ) MedicinalProductDefinitionNameNamePartType = ( medicinalproductdefinition.MedicinalProductDefinitionNameNamePart ) MedicinalProductDefinitionOperationType = ( medicinalproductdefinition.MedicinalProductDefinitionOperation ) MessageDefinitionType = messagedefinition.MessageDefinition MessageDefinitionAllowedResponseType = ( messagedefinition.MessageDefinitionAllowedResponse ) MessageDefinitionFocusType = messagedefinition.MessageDefinitionFocus MessageHeaderType = messageheader.MessageHeader MessageHeaderDestinationType = messageheader.MessageHeaderDestination MessageHeaderResponseType = messageheader.MessageHeaderResponse MessageHeaderSourceType = messageheader.MessageHeaderSource MetaType = meta.Meta MolecularSequenceType = molecularsequence.MolecularSequence MolecularSequenceQualityType = molecularsequence.MolecularSequenceQuality MolecularSequenceQualityRocType = molecularsequence.MolecularSequenceQualityRoc MolecularSequenceReferenceSeqType = molecularsequence.MolecularSequenceReferenceSeq MolecularSequenceRepositoryType = molecularsequence.MolecularSequenceRepository MolecularSequenceStructureVariantType = ( molecularsequence.MolecularSequenceStructureVariant ) MolecularSequenceStructureVariantInnerType = ( molecularsequence.MolecularSequenceStructureVariantInner ) MolecularSequenceStructureVariantOuterType = ( molecularsequence.MolecularSequenceStructureVariantOuter ) MolecularSequenceVariantType = molecularsequence.MolecularSequenceVariant MoneyType = money.Money NamingSystemType = namingsystem.NamingSystem NamingSystemUniqueIdType = namingsystem.NamingSystemUniqueId NarrativeType = narrative.Narrative NutritionOrderType = nutritionorder.NutritionOrder NutritionOrderEnteralFormulaType = nutritionorder.NutritionOrderEnteralFormula NutritionOrderEnteralFormulaAdministrationType = ( nutritionorder.NutritionOrderEnteralFormulaAdministration ) NutritionOrderOralDietType = nutritionorder.NutritionOrderOralDiet NutritionOrderOralDietNutrientType = nutritionorder.NutritionOrderOralDietNutrient NutritionOrderOralDietTextureType = nutritionorder.NutritionOrderOralDietTexture NutritionOrderSupplementType = nutritionorder.NutritionOrderSupplement NutritionProductType = nutritionproduct.NutritionProduct NutritionProductIngredientType = nutritionproduct.NutritionProductIngredient NutritionProductInstanceType = nutritionproduct.NutritionProductInstance NutritionProductNutrientType = nutritionproduct.NutritionProductNutrient NutritionProductProductCharacteristicType = ( nutritionproduct.NutritionProductProductCharacteristic ) ObservationType = observation.Observation ObservationComponentType = observation.ObservationComponent ObservationDefinitionType = observationdefinition.ObservationDefinition ObservationDefinitionQualifiedIntervalType = ( observationdefinition.ObservationDefinitionQualifiedInterval ) ObservationDefinitionQuantitativeDetailsType = ( observationdefinition.ObservationDefinitionQuantitativeDetails ) ObservationReferenceRangeType = observation.ObservationReferenceRange OperationDefinitionType = operationdefinition.OperationDefinition OperationDefinitionOverloadType = operationdefinition.OperationDefinitionOverload OperationDefinitionParameterType = operationdefinition.OperationDefinitionParameter OperationDefinitionParameterBindingType = ( operationdefinition.OperationDefinitionParameterBinding ) OperationDefinitionParameterReferencedFromType = ( operationdefinition.OperationDefinitionParameterReferencedFrom ) OperationOutcomeType = operationoutcome.OperationOutcome OperationOutcomeIssueType = operationoutcome.OperationOutcomeIssue OrganizationType = organization.Organization OrganizationAffiliationType = organizationaffiliation.OrganizationAffiliation OrganizationContactType = organization.OrganizationContact PackagedProductDefinitionType = packagedproductdefinition.PackagedProductDefinition PackagedProductDefinitionLegalStatusOfSupplyType = ( packagedproductdefinition.PackagedProductDefinitionLegalStatusOfSupply ) PackagedProductDefinitionPackageType = ( packagedproductdefinition.PackagedProductDefinitionPackage ) PackagedProductDefinitionPackageContainedItemType = ( packagedproductdefinition.PackagedProductDefinitionPackageContainedItem ) PackagedProductDefinitionPackagePropertyType = ( packagedproductdefinition.PackagedProductDefinitionPackageProperty ) PackagedProductDefinitionPackageShelfLifeStorageType = ( packagedproductdefinition.PackagedProductDefinitionPackageShelfLifeStorage ) ParameterDefinitionType = parameterdefinition.ParameterDefinition ParametersType = parameters.Parameters ParametersParameterType = parameters.ParametersParameter PatientType = patient.Patient PatientCommunicationType = patient.PatientCommunication PatientContactType = patient.PatientContact PatientLinkType = patient.PatientLink PaymentNoticeType = paymentnotice.PaymentNotice PaymentReconciliationType = paymentreconciliation.PaymentReconciliation PaymentReconciliationDetailType = paymentreconciliation.PaymentReconciliationDetail PaymentReconciliationProcessNoteType = ( paymentreconciliation.PaymentReconciliationProcessNote ) PeriodType = period.Period PersonType = person.Person PersonLinkType = person.PersonLink PlanDefinitionType = plandefinition.PlanDefinition PlanDefinitionActionType = plandefinition.PlanDefinitionAction PlanDefinitionActionConditionType = plandefinition.PlanDefinitionActionCondition PlanDefinitionActionDynamicValueType = ( plandefinition.PlanDefinitionActionDynamicValue ) PlanDefinitionActionParticipantType = plandefinition.PlanDefinitionActionParticipant PlanDefinitionActionRelatedActionType = ( plandefinition.PlanDefinitionActionRelatedAction ) PlanDefinitionGoalType = plandefinition.PlanDefinitionGoal PlanDefinitionGoalTargetType = plandefinition.PlanDefinitionGoalTarget PopulationType = population.Population PractitionerType = practitioner.Practitioner PractitionerQualificationType = practitioner.PractitionerQualification PractitionerRoleType = practitionerrole.PractitionerRole PractitionerRoleAvailableTimeType = practitionerrole.PractitionerRoleAvailableTime PractitionerRoleNotAvailableType = practitionerrole.PractitionerRoleNotAvailable ProcedureType = procedure.Procedure ProcedureFocalDeviceType = procedure.ProcedureFocalDevice ProcedurePerformerType = procedure.ProcedurePerformer ProdCharacteristicType = prodcharacteristic.ProdCharacteristic ProductShelfLifeType = productshelflife.ProductShelfLife ProvenanceType = provenance.Provenance ProvenanceAgentType = provenance.ProvenanceAgent ProvenanceEntityType = provenance.ProvenanceEntity QuantityType = quantity.Quantity QuestionnaireType = questionnaire.Questionnaire QuestionnaireItemType = questionnaire.QuestionnaireItem QuestionnaireItemAnswerOptionType = questionnaire.QuestionnaireItemAnswerOption QuestionnaireItemEnableWhenType = questionnaire.QuestionnaireItemEnableWhen QuestionnaireItemInitialType = questionnaire.QuestionnaireItemInitial QuestionnaireResponseType = questionnaireresponse.QuestionnaireResponse QuestionnaireResponseItemType = questionnaireresponse.QuestionnaireResponseItem QuestionnaireResponseItemAnswerType = ( questionnaireresponse.QuestionnaireResponseItemAnswer ) RangeType = range.Range RatioType = ratio.Ratio RatioRangeType = ratiorange.RatioRange ReferenceType = reference.Reference RegulatedAuthorizationType = regulatedauthorization.RegulatedAuthorization RegulatedAuthorizationCaseType = regulatedauthorization.RegulatedAuthorizationCase RelatedArtifactType = relatedartifact.RelatedArtifact RelatedPersonType = relatedperson.RelatedPerson RelatedPersonCommunicationType = relatedperson.RelatedPersonCommunication RequestGroupType = requestgroup.RequestGroup RequestGroupActionType = requestgroup.RequestGroupAction RequestGroupActionConditionType = requestgroup.RequestGroupActionCondition RequestGroupActionRelatedActionType = requestgroup.RequestGroupActionRelatedAction ResearchDefinitionType = researchdefinition.ResearchDefinition ResearchElementDefinitionType = researchelementdefinition.ResearchElementDefinition ResearchElementDefinitionCharacteristicType = ( researchelementdefinition.ResearchElementDefinitionCharacteristic ) ResearchStudyType = researchstudy.ResearchStudy ResearchStudyArmType = researchstudy.ResearchStudyArm ResearchStudyObjectiveType = researchstudy.ResearchStudyObjective ResearchSubjectType = researchsubject.ResearchSubject ResourceType = resource.Resource RiskAssessmentType = riskassessment.RiskAssessment RiskAssessmentPredictionType = riskassessment.RiskAssessmentPrediction SampledDataType = sampleddata.SampledData ScheduleType = schedule.Schedule SearchParameterType = searchparameter.SearchParameter SearchParameterComponentType = searchparameter.SearchParameterComponent ServiceRequestType = servicerequest.ServiceRequest SignatureType = signature.Signature SlotType = slot.Slot SpecimenType = specimen.Specimen SpecimenCollectionType = specimen.SpecimenCollection SpecimenContainerType = specimen.SpecimenContainer SpecimenDefinitionType = specimendefinition.SpecimenDefinition SpecimenDefinitionTypeTestedType = specimendefinition.SpecimenDefinitionTypeTested SpecimenDefinitionTypeTestedContainerType = ( specimendefinition.SpecimenDefinitionTypeTestedContainer ) SpecimenDefinitionTypeTestedContainerAdditiveType = ( specimendefinition.SpecimenDefinitionTypeTestedContainerAdditive ) SpecimenDefinitionTypeTestedHandlingType = ( specimendefinition.SpecimenDefinitionTypeTestedHandling ) SpecimenProcessingType = specimen.SpecimenProcessing StructureDefinitionType = structuredefinition.StructureDefinition StructureDefinitionContextType = structuredefinition.StructureDefinitionContext StructureDefinitionDifferentialType = ( structuredefinition.StructureDefinitionDifferential ) StructureDefinitionMappingType = structuredefinition.StructureDefinitionMapping StructureDefinitionSnapshotType = structuredefinition.StructureDefinitionSnapshot StructureMapType = structuremap.StructureMap StructureMapGroupType = structuremap.StructureMapGroup StructureMapGroupInputType = structuremap.StructureMapGroupInput StructureMapGroupRuleType = structuremap.StructureMapGroupRule StructureMapGroupRuleDependentType = structuremap.StructureMapGroupRuleDependent StructureMapGroupRuleSourceType = structuremap.StructureMapGroupRuleSource StructureMapGroupRuleTargetType = structuremap.StructureMapGroupRuleTarget StructureMapGroupRuleTargetParameterType = ( structuremap.StructureMapGroupRuleTargetParameter ) StructureMapStructureType = structuremap.StructureMapStructure SubscriptionType = subscription.Subscription SubscriptionChannelType = subscription.SubscriptionChannel SubscriptionStatusType = subscriptionstatus.SubscriptionStatus SubscriptionStatusNotificationEventType = ( subscriptionstatus.SubscriptionStatusNotificationEvent ) SubscriptionTopicType = subscriptiontopic.SubscriptionTopic SubscriptionTopicCanFilterByType = subscriptiontopic.SubscriptionTopicCanFilterBy SubscriptionTopicEventTriggerType = subscriptiontopic.SubscriptionTopicEventTrigger SubscriptionTopicNotificationShapeType = ( subscriptiontopic.SubscriptionTopicNotificationShape ) SubscriptionTopicResourceTriggerType = ( subscriptiontopic.SubscriptionTopicResourceTrigger ) SubscriptionTopicResourceTriggerQueryCriteriaType = ( subscriptiontopic.SubscriptionTopicResourceTriggerQueryCriteria ) SubstanceType = substance.Substance SubstanceDefinitionType = substancedefinition.SubstanceDefinition SubstanceDefinitionCodeType = substancedefinition.SubstanceDefinitionCode SubstanceDefinitionMoietyType = substancedefinition.SubstanceDefinitionMoiety SubstanceDefinitionMolecularWeightType = ( substancedefinition.SubstanceDefinitionMolecularWeight ) SubstanceDefinitionNameType = substancedefinition.SubstanceDefinitionName SubstanceDefinitionNameOfficialType = ( substancedefinition.SubstanceDefinitionNameOfficial ) SubstanceDefinitionPropertyType = substancedefinition.SubstanceDefinitionProperty SubstanceDefinitionRelationshipType = ( substancedefinition.SubstanceDefinitionRelationship ) SubstanceDefinitionSourceMaterialType = ( substancedefinition.SubstanceDefinitionSourceMaterial ) SubstanceDefinitionStructureType = substancedefinition.SubstanceDefinitionStructure SubstanceDefinitionStructureRepresentationType = ( substancedefinition.SubstanceDefinitionStructureRepresentation ) SubstanceIngredientType = substance.SubstanceIngredient SubstanceInstanceType = substance.SubstanceInstance SupplyDeliveryType = supplydelivery.SupplyDelivery SupplyDeliverySuppliedItemType = supplydelivery.SupplyDeliverySuppliedItem SupplyRequestType = supplyrequest.SupplyRequest SupplyRequestParameterType = supplyrequest.SupplyRequestParameter TaskType = task.Task TaskInputType = task.TaskInput TaskOutputType = task.TaskOutput TaskRestrictionType = task.TaskRestriction TerminologyCapabilitiesType = terminologycapabilities.TerminologyCapabilities TerminologyCapabilitiesClosureType = ( terminologycapabilities.TerminologyCapabilitiesClosure ) TerminologyCapabilitiesCodeSystemType = ( terminologycapabilities.TerminologyCapabilitiesCodeSystem ) TerminologyCapabilitiesCodeSystemVersionType = ( terminologycapabilities.TerminologyCapabilitiesCodeSystemVersion ) TerminologyCapabilitiesCodeSystemVersionFilterType = ( terminologycapabilities.TerminologyCapabilitiesCodeSystemVersionFilter ) TerminologyCapabilitiesExpansionType = ( terminologycapabilities.TerminologyCapabilitiesExpansion ) TerminologyCapabilitiesExpansionParameterType = ( terminologycapabilities.TerminologyCapabilitiesExpansionParameter ) TerminologyCapabilitiesImplementationType = ( terminologycapabilities.TerminologyCapabilitiesImplementation ) TerminologyCapabilitiesSoftwareType = ( terminologycapabilities.TerminologyCapabilitiesSoftware ) TerminologyCapabilitiesTranslationType = ( terminologycapabilities.TerminologyCapabilitiesTranslation ) TerminologyCapabilitiesValidateCodeType = ( terminologycapabilities.TerminologyCapabilitiesValidateCode ) TestReportType = testreport.TestReport TestReportParticipantType = testreport.TestReportParticipant TestReportSetupType = testreport.TestReportSetup TestReportSetupActionType = testreport.TestReportSetupAction TestReportSetupActionAssertType = testreport.TestReportSetupActionAssert TestReportSetupActionOperationType = testreport.TestReportSetupActionOperation TestReportTeardownType = testreport.TestReportTeardown TestReportTeardownActionType = testreport.TestReportTeardownAction TestReportTestType = testreport.TestReportTest TestReportTestActionType = testreport.TestReportTestAction TestScriptType = testscript.TestScript TestScriptDestinationType = testscript.TestScriptDestination TestScriptFixtureType = testscript.TestScriptFixture TestScriptMetadataType = testscript.TestScriptMetadata TestScriptMetadataCapabilityType = testscript.TestScriptMetadataCapability TestScriptMetadataLinkType = testscript.TestScriptMetadataLink TestScriptOriginType = testscript.TestScriptOrigin TestScriptSetupType = testscript.TestScriptSetup TestScriptSetupActionType = testscript.TestScriptSetupAction TestScriptSetupActionAssertType = testscript.TestScriptSetupActionAssert TestScriptSetupActionOperationType = testscript.TestScriptSetupActionOperation TestScriptSetupActionOperationRequestHeaderType = ( testscript.TestScriptSetupActionOperationRequestHeader ) TestScriptTeardownType = testscript.TestScriptTeardown TestScriptTeardownActionType = testscript.TestScriptTeardownAction TestScriptTestType = testscript.TestScriptTest TestScriptTestActionType = testscript.TestScriptTestAction TestScriptVariableType = testscript.TestScriptVariable TimingType = timing.Timing TimingRepeatType = timing.TimingRepeat TriggerDefinitionType = triggerdefinition.TriggerDefinition UsageContextType = usagecontext.UsageContext ValueSetType = valueset.ValueSet ValueSetComposeType = valueset.ValueSetCompose ValueSetComposeIncludeType = valueset.ValueSetComposeInclude ValueSetComposeIncludeConceptType = valueset.ValueSetComposeIncludeConcept ValueSetComposeIncludeConceptDesignationType = ( valueset.ValueSetComposeIncludeConceptDesignation ) ValueSetComposeIncludeFilterType = valueset.ValueSetComposeIncludeFilter ValueSetExpansionType = valueset.ValueSetExpansion ValueSetExpansionContainsType = valueset.ValueSetExpansionContains ValueSetExpansionParameterType = valueset.ValueSetExpansionParameter VerificationResultType = verificationresult.VerificationResult VerificationResultAttestationType = verificationresult.VerificationResultAttestation VerificationResultPrimarySourceType = ( verificationresult.VerificationResultPrimarySource ) VerificationResultValidatorType = verificationresult.VerificationResultValidator VisionPrescriptionType = visionprescription.VisionPrescription VisionPrescriptionLensSpecificationType = ( visionprescription.VisionPrescriptionLensSpecification ) VisionPrescriptionLensSpecificationPrismType = ( visionprescription.VisionPrescriptionLensSpecificationPrism ) else: FHIRPrimitiveExtensionType = create_fhir_type( "FHIRPrimitiveExtensionType", "fhir.resources.R4B.fhirprimitiveextension.FHIRPrimitiveExtension", ) ElementType = create_fhir_element_or_resource_type( "ElementType", "fhir.resources.R4B.element.Element" ) ResourceType = create_fhir_element_or_resource_type( "ResourceType", "fhir.resources.R4B.resource.Resource" ) AccountType = create_fhir_type("AccountType", "fhir.resources.R4B.account.Account") AccountCoverageType = create_fhir_type( "AccountCoverageType", "fhir.resources.R4B.account.AccountCoverage" ) AccountGuarantorType = create_fhir_type( "AccountGuarantorType", "fhir.resources.R4B.account.AccountGuarantor" ) ActivityDefinitionType = create_fhir_type( "ActivityDefinitionType", "fhir.resources.R4B.activitydefinition.ActivityDefinition", ) ActivityDefinitionDynamicValueType = create_fhir_type( "ActivityDefinitionDynamicValueType", "fhir.resources.R4B.activitydefinition.ActivityDefinitionDynamicValue", ) ActivityDefinitionParticipantType = create_fhir_type( "ActivityDefinitionParticipantType", "fhir.resources.R4B.activitydefinition.ActivityDefinitionParticipant", ) AddressType = create_fhir_type("AddressType", "fhir.resources.R4B.address.Address") AdministrableProductDefinitionType = create_fhir_type( "AdministrableProductDefinitionType", "fhir.resources.R4B.administrableproductdefinition.AdministrableProductDefinition", ) AdministrableProductDefinitionPropertyType = create_fhir_type( "AdministrableProductDefinitionPropertyType", "fhir.resources.R4B.administrableproductdefinition.AdministrableProductDefinitionProperty", ) AdministrableProductDefinitionRouteOfAdministrationType = create_fhir_type( "AdministrableProductDefinitionRouteOfAdministrationType", "fhir.resources.R4B.administrableproductdefinition.AdministrableProductDefinitionRouteOfAdministration", ) AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesType = create_fhir_type( "AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesType", "fhir.resources.R4B.administrableproductdefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpecies", ) AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodType = create_fhir_type( "AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodType", "fhir.resources.R4B.administrableproductdefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriod", ) AdverseEventType = create_fhir_type( "AdverseEventType", "fhir.resources.R4B.adverseevent.AdverseEvent" ) AdverseEventSuspectEntityType = create_fhir_type( "AdverseEventSuspectEntityType", "fhir.resources.R4B.adverseevent.AdverseEventSuspectEntity", ) AdverseEventSuspectEntityCausalityType = create_fhir_type( "AdverseEventSuspectEntityCausalityType", "fhir.resources.R4B.adverseevent.AdverseEventSuspectEntityCausality", ) AgeType = create_fhir_type("AgeType", "fhir.resources.R4B.age.Age") AllergyIntoleranceType = create_fhir_type( "AllergyIntoleranceType", "fhir.resources.R4B.allergyintolerance.AllergyIntolerance", ) AllergyIntoleranceReactionType = create_fhir_type( "AllergyIntoleranceReactionType", "fhir.resources.R4B.allergyintolerance.AllergyIntoleranceReaction", ) AnnotationType = create_fhir_type( "AnnotationType", "fhir.resources.R4B.annotation.Annotation" ) AppointmentType = create_fhir_type( "AppointmentType", "fhir.resources.R4B.appointment.Appointment" ) AppointmentParticipantType = create_fhir_type( "AppointmentParticipantType", "fhir.resources.R4B.appointment.AppointmentParticipant", ) AppointmentResponseType = create_fhir_type( "AppointmentResponseType", "fhir.resources.R4B.appointmentresponse.AppointmentResponse", ) AttachmentType = create_fhir_type( "AttachmentType", "fhir.resources.R4B.attachment.Attachment" ) AuditEventType = create_fhir_type( "AuditEventType", "fhir.resources.R4B.auditevent.AuditEvent" ) AuditEventAgentType = create_fhir_type( "AuditEventAgentType", "fhir.resources.R4B.auditevent.AuditEventAgent" ) AuditEventAgentNetworkType = create_fhir_type( "AuditEventAgentNetworkType", "fhir.resources.R4B.auditevent.AuditEventAgentNetwork", ) AuditEventEntityType = create_fhir_type( "AuditEventEntityType", "fhir.resources.R4B.auditevent.AuditEventEntity" ) AuditEventEntityDetailType = create_fhir_type( "AuditEventEntityDetailType", "fhir.resources.R4B.auditevent.AuditEventEntityDetail", ) AuditEventSourceType = create_fhir_type( "AuditEventSourceType", "fhir.resources.R4B.auditevent.AuditEventSource" ) BackboneElementType = create_fhir_type( "BackboneElementType", "fhir.resources.R4B.backboneelement.BackboneElement" ) BasicType = create_fhir_type("BasicType", "fhir.resources.R4B.basic.Basic") BinaryType = create_fhir_type("BinaryType", "fhir.resources.R4B.binary.Binary") BiologicallyDerivedProductType = create_fhir_type( "BiologicallyDerivedProductType", "fhir.resources.R4B.biologicallyderivedproduct.BiologicallyDerivedProduct", ) BiologicallyDerivedProductCollectionType = create_fhir_type( "BiologicallyDerivedProductCollectionType", "fhir.resources.R4B.biologicallyderivedproduct.BiologicallyDerivedProductCollection", ) BiologicallyDerivedProductManipulationType = create_fhir_type( "BiologicallyDerivedProductManipulationType", "fhir.resources.R4B.biologicallyderivedproduct.BiologicallyDerivedProductManipulation", ) BiologicallyDerivedProductProcessingType = create_fhir_type( "BiologicallyDerivedProductProcessingType", "fhir.resources.R4B.biologicallyderivedproduct.BiologicallyDerivedProductProcessing", ) BiologicallyDerivedProductStorageType = create_fhir_type( "BiologicallyDerivedProductStorageType", "fhir.resources.R4B.biologicallyderivedproduct.BiologicallyDerivedProductStorage", ) BodyStructureType = create_fhir_type( "BodyStructureType", "fhir.resources.R4B.bodystructure.BodyStructure" ) BundleType = create_fhir_type("BundleType", "fhir.resources.R4B.bundle.Bundle") BundleEntryType = create_fhir_type( "BundleEntryType", "fhir.resources.R4B.bundle.BundleEntry" ) BundleEntryRequestType = create_fhir_type( "BundleEntryRequestType", "fhir.resources.R4B.bundle.BundleEntryRequest" ) BundleEntryResponseType = create_fhir_type( "BundleEntryResponseType", "fhir.resources.R4B.bundle.BundleEntryResponse" ) BundleEntrySearchType = create_fhir_type( "BundleEntrySearchType", "fhir.resources.R4B.bundle.BundleEntrySearch" ) BundleLinkType = create_fhir_type( "BundleLinkType", "fhir.resources.R4B.bundle.BundleLink" ) CapabilityStatementType = create_fhir_type( "CapabilityStatementType", "fhir.resources.R4B.capabilitystatement.CapabilityStatement", ) CapabilityStatementDocumentType = create_fhir_type( "CapabilityStatementDocumentType", "fhir.resources.R4B.capabilitystatement.CapabilityStatementDocument", ) CapabilityStatementImplementationType = create_fhir_type( "CapabilityStatementImplementationType", "fhir.resources.R4B.capabilitystatement.CapabilityStatementImplementation", ) CapabilityStatementMessagingType = create_fhir_type( "CapabilityStatementMessagingType", "fhir.resources.R4B.capabilitystatement.CapabilityStatementMessaging", ) CapabilityStatementMessagingEndpointType = create_fhir_type( "CapabilityStatementMessagingEndpointType", "fhir.resources.R4B.capabilitystatement.CapabilityStatementMessagingEndpoint", ) CapabilityStatementMessagingSupportedMessageType = create_fhir_type( "CapabilityStatementMessagingSupportedMessageType", "fhir.resources.R4B.capabilitystatement.CapabilityStatementMessagingSupportedMessage", ) CapabilityStatementRestType = create_fhir_type( "CapabilityStatementRestType", "fhir.resources.R4B.capabilitystatement.CapabilityStatementRest", ) CapabilityStatementRestInteractionType = create_fhir_type( "CapabilityStatementRestInteractionType", "fhir.resources.R4B.capabilitystatement.CapabilityStatementRestInteraction", ) CapabilityStatementRestResourceType = create_fhir_type( "CapabilityStatementRestResourceType", "fhir.resources.R4B.capabilitystatement.CapabilityStatementRestResource", ) CapabilityStatementRestResourceInteractionType = create_fhir_type( "CapabilityStatementRestResourceInteractionType", "fhir.resources.R4B.capabilitystatement.CapabilityStatementRestResourceInteraction", ) CapabilityStatementRestResourceOperationType = create_fhir_type( "CapabilityStatementRestResourceOperationType", "fhir.resources.R4B.capabilitystatement.CapabilityStatementRestResourceOperation", ) CapabilityStatementRestResourceSearchParamType = create_fhir_type( "CapabilityStatementRestResourceSearchParamType", "fhir.resources.R4B.capabilitystatement.CapabilityStatementRestResourceSearchParam", ) CapabilityStatementRestSecurityType = create_fhir_type( "CapabilityStatementRestSecurityType", "fhir.resources.R4B.capabilitystatement.CapabilityStatementRestSecurity", ) CapabilityStatementSoftwareType = create_fhir_type( "CapabilityStatementSoftwareType", "fhir.resources.R4B.capabilitystatement.CapabilityStatementSoftware", ) CarePlanType = create_fhir_type( "CarePlanType", "fhir.resources.R4B.careplan.CarePlan" ) CarePlanActivityType = create_fhir_type( "CarePlanActivityType", "fhir.resources.R4B.careplan.CarePlanActivity" ) CarePlanActivityDetailType = create_fhir_type( "CarePlanActivityDetailType", "fhir.resources.R4B.careplan.CarePlanActivityDetail", ) CareTeamType = create_fhir_type( "CareTeamType", "fhir.resources.R4B.careteam.CareTeam" ) CareTeamParticipantType = create_fhir_type( "CareTeamParticipantType", "fhir.resources.R4B.careteam.CareTeamParticipant" ) CatalogEntryType = create_fhir_type( "CatalogEntryType", "fhir.resources.R4B.catalogentry.CatalogEntry" ) CatalogEntryRelatedEntryType = create_fhir_type( "CatalogEntryRelatedEntryType", "fhir.resources.R4B.catalogentry.CatalogEntryRelatedEntry", ) ChargeItemType = create_fhir_type( "ChargeItemType", "fhir.resources.R4B.chargeitem.ChargeItem" ) ChargeItemDefinitionType = create_fhir_type( "ChargeItemDefinitionType", "fhir.resources.R4B.chargeitemdefinition.ChargeItemDefinition", ) ChargeItemDefinitionApplicabilityType = create_fhir_type( "ChargeItemDefinitionApplicabilityType", "fhir.resources.R4B.chargeitemdefinition.ChargeItemDefinitionApplicability", ) ChargeItemDefinitionPropertyGroupType = create_fhir_type( "ChargeItemDefinitionPropertyGroupType", "fhir.resources.R4B.chargeitemdefinition.ChargeItemDefinitionPropertyGroup", ) ChargeItemDefinitionPropertyGroupPriceComponentType = create_fhir_type( "ChargeItemDefinitionPropertyGroupPriceComponentType", "fhir.resources.R4B.chargeitemdefinition.ChargeItemDefinitionPropertyGroupPriceComponent", ) ChargeItemPerformerType = create_fhir_type( "ChargeItemPerformerType", "fhir.resources.R4B.chargeitem.ChargeItemPerformer" ) CitationType = create_fhir_type( "CitationType", "fhir.resources.R4B.citation.Citation" ) CitationCitedArtifactType = create_fhir_type( "CitationCitedArtifactType", "fhir.resources.R4B.citation.CitationCitedArtifact" ) CitationCitedArtifactAbstractType = create_fhir_type( "CitationCitedArtifactAbstractType", "fhir.resources.R4B.citation.CitationCitedArtifactAbstract", ) CitationCitedArtifactClassificationType = create_fhir_type( "CitationCitedArtifactClassificationType", "fhir.resources.R4B.citation.CitationCitedArtifactClassification", ) CitationCitedArtifactClassificationWhoClassifiedType = create_fhir_type( "CitationCitedArtifactClassificationWhoClassifiedType", "fhir.resources.R4B.citation.CitationCitedArtifactClassificationWhoClassified", ) CitationCitedArtifactContributorshipType = create_fhir_type( "CitationCitedArtifactContributorshipType", "fhir.resources.R4B.citation.CitationCitedArtifactContributorship", ) CitationCitedArtifactContributorshipEntryType = create_fhir_type( "CitationCitedArtifactContributorshipEntryType", "fhir.resources.R4B.citation.CitationCitedArtifactContributorshipEntry", ) CitationCitedArtifactContributorshipEntryAffiliationInfoType = create_fhir_type( "CitationCitedArtifactContributorshipEntryAffiliationInfoType", "fhir.resources.R4B.citation.CitationCitedArtifactContributorshipEntryAffiliationInfo", ) CitationCitedArtifactContributorshipEntryContributionInstanceType = create_fhir_type( "CitationCitedArtifactContributorshipEntryContributionInstanceType", "fhir.resources.R4B.citation.CitationCitedArtifactContributorshipEntryContributionInstance", ) CitationCitedArtifactContributorshipSummaryType = create_fhir_type( "CitationCitedArtifactContributorshipSummaryType", "fhir.resources.R4B.citation.CitationCitedArtifactContributorshipSummary", ) CitationCitedArtifactPartType = create_fhir_type( "CitationCitedArtifactPartType", "fhir.resources.R4B.citation.CitationCitedArtifactPart", ) CitationCitedArtifactPublicationFormType = create_fhir_type( "CitationCitedArtifactPublicationFormType", "fhir.resources.R4B.citation.CitationCitedArtifactPublicationForm", ) CitationCitedArtifactPublicationFormPeriodicReleaseType = create_fhir_type( "CitationCitedArtifactPublicationFormPeriodicReleaseType", "fhir.resources.R4B.citation.CitationCitedArtifactPublicationFormPeriodicRelease", ) CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationType = create_fhir_type( "CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationType", "fhir.resources.R4B.citation.CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublication", ) CitationCitedArtifactPublicationFormPublishedInType = create_fhir_type( "CitationCitedArtifactPublicationFormPublishedInType", "fhir.resources.R4B.citation.CitationCitedArtifactPublicationFormPublishedIn", ) CitationCitedArtifactRelatesToType = create_fhir_type( "CitationCitedArtifactRelatesToType", "fhir.resources.R4B.citation.CitationCitedArtifactRelatesTo", ) CitationCitedArtifactStatusDateType = create_fhir_type( "CitationCitedArtifactStatusDateType", "fhir.resources.R4B.citation.CitationCitedArtifactStatusDate", ) CitationCitedArtifactTitleType = create_fhir_type( "CitationCitedArtifactTitleType", "fhir.resources.R4B.citation.CitationCitedArtifactTitle", ) CitationCitedArtifactVersionType = create_fhir_type( "CitationCitedArtifactVersionType", "fhir.resources.R4B.citation.CitationCitedArtifactVersion", ) CitationCitedArtifactWebLocationType = create_fhir_type( "CitationCitedArtifactWebLocationType", "fhir.resources.R4B.citation.CitationCitedArtifactWebLocation", ) CitationClassificationType = create_fhir_type( "CitationClassificationType", "fhir.resources.R4B.citation.CitationClassification", ) CitationRelatesToType = create_fhir_type( "CitationRelatesToType", "fhir.resources.R4B.citation.CitationRelatesTo" ) CitationStatusDateType = create_fhir_type( "CitationStatusDateType", "fhir.resources.R4B.citation.CitationStatusDate" ) CitationSummaryType = create_fhir_type( "CitationSummaryType", "fhir.resources.R4B.citation.CitationSummary" ) ClaimType = create_fhir_type("ClaimType", "fhir.resources.R4B.claim.Claim") ClaimAccidentType = create_fhir_type( "ClaimAccidentType", "fhir.resources.R4B.claim.ClaimAccident" ) ClaimCareTeamType = create_fhir_type( "ClaimCareTeamType", "fhir.resources.R4B.claim.ClaimCareTeam" ) ClaimDiagnosisType = create_fhir_type( "ClaimDiagnosisType", "fhir.resources.R4B.claim.ClaimDiagnosis" ) ClaimInsuranceType = create_fhir_type( "ClaimInsuranceType", "fhir.resources.R4B.claim.ClaimInsurance" ) ClaimItemType = create_fhir_type( "ClaimItemType", "fhir.resources.R4B.claim.ClaimItem" ) ClaimItemDetailType = create_fhir_type( "ClaimItemDetailType", "fhir.resources.R4B.claim.ClaimItemDetail" ) ClaimItemDetailSubDetailType = create_fhir_type( "ClaimItemDetailSubDetailType", "fhir.resources.R4B.claim.ClaimItemDetailSubDetail", ) ClaimPayeeType = create_fhir_type( "ClaimPayeeType", "fhir.resources.R4B.claim.ClaimPayee" ) ClaimProcedureType = create_fhir_type( "ClaimProcedureType", "fhir.resources.R4B.claim.ClaimProcedure" ) ClaimRelatedType = create_fhir_type( "ClaimRelatedType", "fhir.resources.R4B.claim.ClaimRelated" ) ClaimResponseType = create_fhir_type( "ClaimResponseType", "fhir.resources.R4B.claimresponse.ClaimResponse" ) ClaimResponseAddItemType = create_fhir_type( "ClaimResponseAddItemType", "fhir.resources.R4B.claimresponse.ClaimResponseAddItem", ) ClaimResponseAddItemDetailType = create_fhir_type( "ClaimResponseAddItemDetailType", "fhir.resources.R4B.claimresponse.ClaimResponseAddItemDetail", ) ClaimResponseAddItemDetailSubDetailType = create_fhir_type( "ClaimResponseAddItemDetailSubDetailType", "fhir.resources.R4B.claimresponse.ClaimResponseAddItemDetailSubDetail", ) ClaimResponseErrorType = create_fhir_type( "ClaimResponseErrorType", "fhir.resources.R4B.claimresponse.ClaimResponseError" ) ClaimResponseInsuranceType = create_fhir_type( "ClaimResponseInsuranceType", "fhir.resources.R4B.claimresponse.ClaimResponseInsurance", ) ClaimResponseItemType = create_fhir_type( "ClaimResponseItemType", "fhir.resources.R4B.claimresponse.ClaimResponseItem" ) ClaimResponseItemAdjudicationType = create_fhir_type( "ClaimResponseItemAdjudicationType", "fhir.resources.R4B.claimresponse.ClaimResponseItemAdjudication", ) ClaimResponseItemDetailType = create_fhir_type( "ClaimResponseItemDetailType", "fhir.resources.R4B.claimresponse.ClaimResponseItemDetail", ) ClaimResponseItemDetailSubDetailType = create_fhir_type( "ClaimResponseItemDetailSubDetailType", "fhir.resources.R4B.claimresponse.ClaimResponseItemDetailSubDetail", ) ClaimResponsePaymentType = create_fhir_type( "ClaimResponsePaymentType", "fhir.resources.R4B.claimresponse.ClaimResponsePayment", ) ClaimResponseProcessNoteType = create_fhir_type( "ClaimResponseProcessNoteType", "fhir.resources.R4B.claimresponse.ClaimResponseProcessNote", ) ClaimResponseTotalType = create_fhir_type( "ClaimResponseTotalType", "fhir.resources.R4B.claimresponse.ClaimResponseTotal" ) ClaimSupportingInfoType = create_fhir_type( "ClaimSupportingInfoType", "fhir.resources.R4B.claim.ClaimSupportingInfo" ) ClinicalImpressionType = create_fhir_type( "ClinicalImpressionType", "fhir.resources.R4B.clinicalimpression.ClinicalImpression", ) ClinicalImpressionFindingType = create_fhir_type( "ClinicalImpressionFindingType", "fhir.resources.R4B.clinicalimpression.ClinicalImpressionFinding", ) ClinicalImpressionInvestigationType = create_fhir_type( "ClinicalImpressionInvestigationType", "fhir.resources.R4B.clinicalimpression.ClinicalImpressionInvestigation", ) ClinicalUseDefinitionType = create_fhir_type( "ClinicalUseDefinitionType", "fhir.resources.R4B.clinicalusedefinition.ClinicalUseDefinition", ) ClinicalUseDefinitionContraindicationType = create_fhir_type( "ClinicalUseDefinitionContraindicationType", "fhir.resources.R4B.clinicalusedefinition.ClinicalUseDefinitionContraindication", ) ClinicalUseDefinitionContraindicationOtherTherapyType = create_fhir_type( "ClinicalUseDefinitionContraindicationOtherTherapyType", "fhir.resources.R4B.clinicalusedefinition.ClinicalUseDefinitionContraindicationOtherTherapy", ) ClinicalUseDefinitionIndicationType = create_fhir_type( "ClinicalUseDefinitionIndicationType", "fhir.resources.R4B.clinicalusedefinition.ClinicalUseDefinitionIndication", ) ClinicalUseDefinitionInteractionType = create_fhir_type( "ClinicalUseDefinitionInteractionType", "fhir.resources.R4B.clinicalusedefinition.ClinicalUseDefinitionInteraction", ) ClinicalUseDefinitionInteractionInteractantType = create_fhir_type( "ClinicalUseDefinitionInteractionInteractantType", "fhir.resources.R4B.clinicalusedefinition.ClinicalUseDefinitionInteractionInteractant", ) ClinicalUseDefinitionUndesirableEffectType = create_fhir_type( "ClinicalUseDefinitionUndesirableEffectType", "fhir.resources.R4B.clinicalusedefinition.ClinicalUseDefinitionUndesirableEffect", ) ClinicalUseDefinitionWarningType = create_fhir_type( "ClinicalUseDefinitionWarningType", "fhir.resources.R4B.clinicalusedefinition.ClinicalUseDefinitionWarning", ) CodeSystemType = create_fhir_type( "CodeSystemType", "fhir.resources.R4B.codesystem.CodeSystem" ) CodeSystemConceptType = create_fhir_type( "CodeSystemConceptType", "fhir.resources.R4B.codesystem.CodeSystemConcept" ) CodeSystemConceptDesignationType = create_fhir_type( "CodeSystemConceptDesignationType", "fhir.resources.R4B.codesystem.CodeSystemConceptDesignation", ) CodeSystemConceptPropertyType = create_fhir_type( "CodeSystemConceptPropertyType", "fhir.resources.R4B.codesystem.CodeSystemConceptProperty", ) CodeSystemFilterType = create_fhir_type( "CodeSystemFilterType", "fhir.resources.R4B.codesystem.CodeSystemFilter" ) CodeSystemPropertyType = create_fhir_type( "CodeSystemPropertyType", "fhir.resources.R4B.codesystem.CodeSystemProperty" ) CodeableConceptType = create_fhir_type( "CodeableConceptType", "fhir.resources.R4B.codeableconcept.CodeableConcept" ) CodeableReferenceType = create_fhir_type( "CodeableReferenceType", "fhir.resources.R4B.codeablereference.CodeableReference", ) CodingType = create_fhir_type("CodingType", "fhir.resources.R4B.coding.Coding") CommunicationType = create_fhir_type( "CommunicationType", "fhir.resources.R4B.communication.Communication" ) CommunicationPayloadType = create_fhir_type( "CommunicationPayloadType", "fhir.resources.R4B.communication.CommunicationPayload", ) CommunicationRequestType = create_fhir_type( "CommunicationRequestType", "fhir.resources.R4B.communicationrequest.CommunicationRequest", ) CommunicationRequestPayloadType = create_fhir_type( "CommunicationRequestPayloadType", "fhir.resources.R4B.communicationrequest.CommunicationRequestPayload", ) CompartmentDefinitionType = create_fhir_type( "CompartmentDefinitionType", "fhir.resources.R4B.compartmentdefinition.CompartmentDefinition", ) CompartmentDefinitionResourceType = create_fhir_type( "CompartmentDefinitionResourceType", "fhir.resources.R4B.compartmentdefinition.CompartmentDefinitionResource", ) CompositionType = create_fhir_type( "CompositionType", "fhir.resources.R4B.composition.Composition" ) CompositionAttesterType = create_fhir_type( "CompositionAttesterType", "fhir.resources.R4B.composition.CompositionAttester" ) CompositionEventType = create_fhir_type( "CompositionEventType", "fhir.resources.R4B.composition.CompositionEvent" ) CompositionRelatesToType = create_fhir_type( "CompositionRelatesToType", "fhir.resources.R4B.composition.CompositionRelatesTo", ) CompositionSectionType = create_fhir_type( "CompositionSectionType", "fhir.resources.R4B.composition.CompositionSection" ) ConceptMapType = create_fhir_type( "ConceptMapType", "fhir.resources.R4B.conceptmap.ConceptMap" ) ConceptMapGroupType = create_fhir_type( "ConceptMapGroupType", "fhir.resources.R4B.conceptmap.ConceptMapGroup" ) ConceptMapGroupElementType = create_fhir_type( "ConceptMapGroupElementType", "fhir.resources.R4B.conceptmap.ConceptMapGroupElement", ) ConceptMapGroupElementTargetType = create_fhir_type( "ConceptMapGroupElementTargetType", "fhir.resources.R4B.conceptmap.ConceptMapGroupElementTarget", ) ConceptMapGroupElementTargetDependsOnType = create_fhir_type( "ConceptMapGroupElementTargetDependsOnType", "fhir.resources.R4B.conceptmap.ConceptMapGroupElementTargetDependsOn", ) ConceptMapGroupUnmappedType = create_fhir_type( "ConceptMapGroupUnmappedType", "fhir.resources.R4B.conceptmap.ConceptMapGroupUnmapped", ) ConditionType = create_fhir_type( "ConditionType", "fhir.resources.R4B.condition.Condition" ) ConditionEvidenceType = create_fhir_type( "ConditionEvidenceType", "fhir.resources.R4B.condition.ConditionEvidence" ) ConditionStageType = create_fhir_type( "ConditionStageType", "fhir.resources.R4B.condition.ConditionStage" ) ConsentType = create_fhir_type("ConsentType", "fhir.resources.R4B.consent.Consent") ConsentPolicyType = create_fhir_type( "ConsentPolicyType", "fhir.resources.R4B.consent.ConsentPolicy" ) ConsentProvisionType = create_fhir_type( "ConsentProvisionType", "fhir.resources.R4B.consent.ConsentProvision" ) ConsentProvisionActorType = create_fhir_type( "ConsentProvisionActorType", "fhir.resources.R4B.consent.ConsentProvisionActor" ) ConsentProvisionDataType = create_fhir_type( "ConsentProvisionDataType", "fhir.resources.R4B.consent.ConsentProvisionData" ) ConsentVerificationType = create_fhir_type( "ConsentVerificationType", "fhir.resources.R4B.consent.ConsentVerification" ) ContactDetailType = create_fhir_type( "ContactDetailType", "fhir.resources.R4B.contactdetail.ContactDetail" ) ContactPointType = create_fhir_type( "ContactPointType", "fhir.resources.R4B.contactpoint.ContactPoint" ) ContractType = create_fhir_type( "ContractType", "fhir.resources.R4B.contract.Contract" ) ContractContentDefinitionType = create_fhir_type( "ContractContentDefinitionType", "fhir.resources.R4B.contract.ContractContentDefinition", ) ContractFriendlyType = create_fhir_type( "ContractFriendlyType", "fhir.resources.R4B.contract.ContractFriendly" ) ContractLegalType = create_fhir_type( "ContractLegalType", "fhir.resources.R4B.contract.ContractLegal" ) ContractRuleType = create_fhir_type( "ContractRuleType", "fhir.resources.R4B.contract.ContractRule" ) ContractSignerType = create_fhir_type( "ContractSignerType", "fhir.resources.R4B.contract.ContractSigner" ) ContractTermType = create_fhir_type( "ContractTermType", "fhir.resources.R4B.contract.ContractTerm" ) ContractTermActionType = create_fhir_type( "ContractTermActionType", "fhir.resources.R4B.contract.ContractTermAction" ) ContractTermActionSubjectType = create_fhir_type( "ContractTermActionSubjectType", "fhir.resources.R4B.contract.ContractTermActionSubject", ) ContractTermAssetType = create_fhir_type( "ContractTermAssetType", "fhir.resources.R4B.contract.ContractTermAsset" ) ContractTermAssetContextType = create_fhir_type( "ContractTermAssetContextType", "fhir.resources.R4B.contract.ContractTermAssetContext", ) ContractTermAssetValuedItemType = create_fhir_type( "ContractTermAssetValuedItemType", "fhir.resources.R4B.contract.ContractTermAssetValuedItem", ) ContractTermOfferType = create_fhir_type( "ContractTermOfferType", "fhir.resources.R4B.contract.ContractTermOffer" ) ContractTermOfferAnswerType = create_fhir_type( "ContractTermOfferAnswerType", "fhir.resources.R4B.contract.ContractTermOfferAnswer", ) ContractTermOfferPartyType = create_fhir_type( "ContractTermOfferPartyType", "fhir.resources.R4B.contract.ContractTermOfferParty", ) ContractTermSecurityLabelType = create_fhir_type( "ContractTermSecurityLabelType", "fhir.resources.R4B.contract.ContractTermSecurityLabel", ) ContributorType = create_fhir_type( "ContributorType", "fhir.resources.R4B.contributor.Contributor" ) CountType = create_fhir_type("CountType", "fhir.resources.R4B.count.Count") CoverageType = create_fhir_type( "CoverageType", "fhir.resources.R4B.coverage.Coverage" ) CoverageClassType = create_fhir_type( "CoverageClassType", "fhir.resources.R4B.coverage.CoverageClass" ) CoverageCostToBeneficiaryType = create_fhir_type( "CoverageCostToBeneficiaryType", "fhir.resources.R4B.coverage.CoverageCostToBeneficiary", ) CoverageCostToBeneficiaryExceptionType = create_fhir_type( "CoverageCostToBeneficiaryExceptionType", "fhir.resources.R4B.coverage.CoverageCostToBeneficiaryException", ) CoverageEligibilityRequestType = create_fhir_type( "CoverageEligibilityRequestType", "fhir.resources.R4B.coverageeligibilityrequest.CoverageEligibilityRequest", ) CoverageEligibilityRequestInsuranceType = create_fhir_type( "CoverageEligibilityRequestInsuranceType", "fhir.resources.R4B.coverageeligibilityrequest.CoverageEligibilityRequestInsurance", ) CoverageEligibilityRequestItemType = create_fhir_type( "CoverageEligibilityRequestItemType", "fhir.resources.R4B.coverageeligibilityrequest.CoverageEligibilityRequestItem", ) CoverageEligibilityRequestItemDiagnosisType = create_fhir_type( "CoverageEligibilityRequestItemDiagnosisType", "fhir.resources.R4B.coverageeligibilityrequest.CoverageEligibilityRequestItemDiagnosis", ) CoverageEligibilityRequestSupportingInfoType = create_fhir_type( "CoverageEligibilityRequestSupportingInfoType", "fhir.resources.R4B.coverageeligibilityrequest.CoverageEligibilityRequestSupportingInfo", ) CoverageEligibilityResponseType = create_fhir_type( "CoverageEligibilityResponseType", "fhir.resources.R4B.coverageeligibilityresponse.CoverageEligibilityResponse", ) CoverageEligibilityResponseErrorType = create_fhir_type( "CoverageEligibilityResponseErrorType", "fhir.resources.R4B.coverageeligibilityresponse.CoverageEligibilityResponseError", ) CoverageEligibilityResponseInsuranceType = create_fhir_type( "CoverageEligibilityResponseInsuranceType", "fhir.resources.R4B.coverageeligibilityresponse.CoverageEligibilityResponseInsurance", ) CoverageEligibilityResponseInsuranceItemType = create_fhir_type( "CoverageEligibilityResponseInsuranceItemType", "fhir.resources.R4B.coverageeligibilityresponse.CoverageEligibilityResponseInsuranceItem", ) CoverageEligibilityResponseInsuranceItemBenefitType = create_fhir_type( "CoverageEligibilityResponseInsuranceItemBenefitType", "fhir.resources.R4B.coverageeligibilityresponse.CoverageEligibilityResponseInsuranceItemBenefit", ) DataRequirementType = create_fhir_type( "DataRequirementType", "fhir.resources.R4B.datarequirement.DataRequirement" ) DataRequirementCodeFilterType = create_fhir_type( "DataRequirementCodeFilterType", "fhir.resources.R4B.datarequirement.DataRequirementCodeFilter", ) DataRequirementDateFilterType = create_fhir_type( "DataRequirementDateFilterType", "fhir.resources.R4B.datarequirement.DataRequirementDateFilter", ) DataRequirementSortType = create_fhir_type( "DataRequirementSortType", "fhir.resources.R4B.datarequirement.DataRequirementSort", ) DetectedIssueType = create_fhir_type( "DetectedIssueType", "fhir.resources.R4B.detectedissue.DetectedIssue" ) DetectedIssueEvidenceType = create_fhir_type( "DetectedIssueEvidenceType", "fhir.resources.R4B.detectedissue.DetectedIssueEvidence", ) DetectedIssueMitigationType = create_fhir_type( "DetectedIssueMitigationType", "fhir.resources.R4B.detectedissue.DetectedIssueMitigation", ) DeviceType = create_fhir_type("DeviceType", "fhir.resources.R4B.device.Device") DeviceDefinitionType = create_fhir_type( "DeviceDefinitionType", "fhir.resources.R4B.devicedefinition.DeviceDefinition" ) DeviceDefinitionCapabilityType = create_fhir_type( "DeviceDefinitionCapabilityType", "fhir.resources.R4B.devicedefinition.DeviceDefinitionCapability", ) DeviceDefinitionDeviceNameType = create_fhir_type( "DeviceDefinitionDeviceNameType", "fhir.resources.R4B.devicedefinition.DeviceDefinitionDeviceName", ) DeviceDefinitionMaterialType = create_fhir_type( "DeviceDefinitionMaterialType", "fhir.resources.R4B.devicedefinition.DeviceDefinitionMaterial", ) DeviceDefinitionPropertyType = create_fhir_type( "DeviceDefinitionPropertyType", "fhir.resources.R4B.devicedefinition.DeviceDefinitionProperty", ) DeviceDefinitionSpecializationType = create_fhir_type( "DeviceDefinitionSpecializationType", "fhir.resources.R4B.devicedefinition.DeviceDefinitionSpecialization", ) DeviceDefinitionUdiDeviceIdentifierType = create_fhir_type( "DeviceDefinitionUdiDeviceIdentifierType", "fhir.resources.R4B.devicedefinition.DeviceDefinitionUdiDeviceIdentifier", ) DeviceDeviceNameType = create_fhir_type( "DeviceDeviceNameType", "fhir.resources.R4B.device.DeviceDeviceName" ) DeviceMetricType = create_fhir_type( "DeviceMetricType", "fhir.resources.R4B.devicemetric.DeviceMetric" ) DeviceMetricCalibrationType = create_fhir_type( "DeviceMetricCalibrationType", "fhir.resources.R4B.devicemetric.DeviceMetricCalibration", ) DevicePropertyType = create_fhir_type( "DevicePropertyType", "fhir.resources.R4B.device.DeviceProperty" ) DeviceRequestType = create_fhir_type( "DeviceRequestType", "fhir.resources.R4B.devicerequest.DeviceRequest" ) DeviceRequestParameterType = create_fhir_type( "DeviceRequestParameterType", "fhir.resources.R4B.devicerequest.DeviceRequestParameter", ) DeviceSpecializationType = create_fhir_type( "DeviceSpecializationType", "fhir.resources.R4B.device.DeviceSpecialization" ) DeviceUdiCarrierType = create_fhir_type( "DeviceUdiCarrierType", "fhir.resources.R4B.device.DeviceUdiCarrier" ) DeviceUseStatementType = create_fhir_type( "DeviceUseStatementType", "fhir.resources.R4B.deviceusestatement.DeviceUseStatement", ) DeviceVersionType = create_fhir_type( "DeviceVersionType", "fhir.resources.R4B.device.DeviceVersion" ) DiagnosticReportType = create_fhir_type( "DiagnosticReportType", "fhir.resources.R4B.diagnosticreport.DiagnosticReport" ) DiagnosticReportMediaType = create_fhir_type( "DiagnosticReportMediaType", "fhir.resources.R4B.diagnosticreport.DiagnosticReportMedia", ) DistanceType = create_fhir_type( "DistanceType", "fhir.resources.R4B.distance.Distance" ) DocumentManifestType = create_fhir_type( "DocumentManifestType", "fhir.resources.R4B.documentmanifest.DocumentManifest" ) DocumentManifestRelatedType = create_fhir_type( "DocumentManifestRelatedType", "fhir.resources.R4B.documentmanifest.DocumentManifestRelated", ) DocumentReferenceType = create_fhir_type( "DocumentReferenceType", "fhir.resources.R4B.documentreference.DocumentReference", ) DocumentReferenceContentType = create_fhir_type( "DocumentReferenceContentType", "fhir.resources.R4B.documentreference.DocumentReferenceContent", ) DocumentReferenceContextType = create_fhir_type( "DocumentReferenceContextType", "fhir.resources.R4B.documentreference.DocumentReferenceContext", ) DocumentReferenceRelatesToType = create_fhir_type( "DocumentReferenceRelatesToType", "fhir.resources.R4B.documentreference.DocumentReferenceRelatesTo", ) DomainResourceType = create_fhir_type( "DomainResourceType", "fhir.resources.R4B.domainresource.DomainResource" ) DosageType = create_fhir_type("DosageType", "fhir.resources.R4B.dosage.Dosage") DosageDoseAndRateType = create_fhir_type( "DosageDoseAndRateType", "fhir.resources.R4B.dosage.DosageDoseAndRate" ) DurationType = create_fhir_type( "DurationType", "fhir.resources.R4B.duration.Duration" ) ElementDefinitionType = create_fhir_type( "ElementDefinitionType", "fhir.resources.R4B.elementdefinition.ElementDefinition", ) ElementDefinitionBaseType = create_fhir_type( "ElementDefinitionBaseType", "fhir.resources.R4B.elementdefinition.ElementDefinitionBase", ) ElementDefinitionBindingType = create_fhir_type( "ElementDefinitionBindingType", "fhir.resources.R4B.elementdefinition.ElementDefinitionBinding", ) ElementDefinitionConstraintType = create_fhir_type( "ElementDefinitionConstraintType", "fhir.resources.R4B.elementdefinition.ElementDefinitionConstraint", ) ElementDefinitionExampleType = create_fhir_type( "ElementDefinitionExampleType", "fhir.resources.R4B.elementdefinition.ElementDefinitionExample", ) ElementDefinitionMappingType = create_fhir_type( "ElementDefinitionMappingType", "fhir.resources.R4B.elementdefinition.ElementDefinitionMapping", ) ElementDefinitionSlicingType = create_fhir_type( "ElementDefinitionSlicingType", "fhir.resources.R4B.elementdefinition.ElementDefinitionSlicing", ) ElementDefinitionSlicingDiscriminatorType = create_fhir_type( "ElementDefinitionSlicingDiscriminatorType", "fhir.resources.R4B.elementdefinition.ElementDefinitionSlicingDiscriminator", ) ElementDefinitionTypeType = create_fhir_type( "ElementDefinitionTypeType", "fhir.resources.R4B.elementdefinition.ElementDefinitionType", ) EncounterType = create_fhir_type( "EncounterType", "fhir.resources.R4B.encounter.Encounter" ) EncounterClassHistoryType = create_fhir_type( "EncounterClassHistoryType", "fhir.resources.R4B.encounter.EncounterClassHistory", ) EncounterDiagnosisType = create_fhir_type( "EncounterDiagnosisType", "fhir.resources.R4B.encounter.EncounterDiagnosis" ) EncounterHospitalizationType = create_fhir_type( "EncounterHospitalizationType", "fhir.resources.R4B.encounter.EncounterHospitalization", ) EncounterLocationType = create_fhir_type( "EncounterLocationType", "fhir.resources.R4B.encounter.EncounterLocation" ) EncounterParticipantType = create_fhir_type( "EncounterParticipantType", "fhir.resources.R4B.encounter.EncounterParticipant" ) EncounterStatusHistoryType = create_fhir_type( "EncounterStatusHistoryType", "fhir.resources.R4B.encounter.EncounterStatusHistory", ) EndpointType = create_fhir_type( "EndpointType", "fhir.resources.R4B.endpoint.Endpoint" ) EnrollmentRequestType = create_fhir_type( "EnrollmentRequestType", "fhir.resources.R4B.enrollmentrequest.EnrollmentRequest", ) EnrollmentResponseType = create_fhir_type( "EnrollmentResponseType", "fhir.resources.R4B.enrollmentresponse.EnrollmentResponse", ) EpisodeOfCareType = create_fhir_type( "EpisodeOfCareType", "fhir.resources.R4B.episodeofcare.EpisodeOfCare" ) EpisodeOfCareDiagnosisType = create_fhir_type( "EpisodeOfCareDiagnosisType", "fhir.resources.R4B.episodeofcare.EpisodeOfCareDiagnosis", ) EpisodeOfCareStatusHistoryType = create_fhir_type( "EpisodeOfCareStatusHistoryType", "fhir.resources.R4B.episodeofcare.EpisodeOfCareStatusHistory", ) EventDefinitionType = create_fhir_type( "EventDefinitionType", "fhir.resources.R4B.eventdefinition.EventDefinition" ) EvidenceType = create_fhir_type( "EvidenceType", "fhir.resources.R4B.evidence.Evidence" ) EvidenceCertaintyType = create_fhir_type( "EvidenceCertaintyType", "fhir.resources.R4B.evidence.EvidenceCertainty" ) EvidenceReportType = create_fhir_type( "EvidenceReportType", "fhir.resources.R4B.evidencereport.EvidenceReport" ) EvidenceReportRelatesToType = create_fhir_type( "EvidenceReportRelatesToType", "fhir.resources.R4B.evidencereport.EvidenceReportRelatesTo", ) EvidenceReportSectionType = create_fhir_type( "EvidenceReportSectionType", "fhir.resources.R4B.evidencereport.EvidenceReportSection", ) EvidenceReportSubjectType = create_fhir_type( "EvidenceReportSubjectType", "fhir.resources.R4B.evidencereport.EvidenceReportSubject", ) EvidenceReportSubjectCharacteristicType = create_fhir_type( "EvidenceReportSubjectCharacteristicType", "fhir.resources.R4B.evidencereport.EvidenceReportSubjectCharacteristic", ) EvidenceStatisticType = create_fhir_type( "EvidenceStatisticType", "fhir.resources.R4B.evidence.EvidenceStatistic" ) EvidenceStatisticAttributeEstimateType = create_fhir_type( "EvidenceStatisticAttributeEstimateType", "fhir.resources.R4B.evidence.EvidenceStatisticAttributeEstimate", ) EvidenceStatisticModelCharacteristicType = create_fhir_type( "EvidenceStatisticModelCharacteristicType", "fhir.resources.R4B.evidence.EvidenceStatisticModelCharacteristic", ) EvidenceStatisticModelCharacteristicVariableType = create_fhir_type( "EvidenceStatisticModelCharacteristicVariableType", "fhir.resources.R4B.evidence.EvidenceStatisticModelCharacteristicVariable", ) EvidenceStatisticSampleSizeType = create_fhir_type( "EvidenceStatisticSampleSizeType", "fhir.resources.R4B.evidence.EvidenceStatisticSampleSize", ) EvidenceVariableType = create_fhir_type( "EvidenceVariableType", "fhir.resources.R4B.evidencevariable.EvidenceVariable" ) EvidenceVariableCategoryType = create_fhir_type( "EvidenceVariableCategoryType", "fhir.resources.R4B.evidencevariable.EvidenceVariableCategory", ) EvidenceVariableCharacteristicType = create_fhir_type( "EvidenceVariableCharacteristicType", "fhir.resources.R4B.evidencevariable.EvidenceVariableCharacteristic", ) EvidenceVariableCharacteristicTimeFromStartType = create_fhir_type( "EvidenceVariableCharacteristicTimeFromStartType", "fhir.resources.R4B.evidencevariable.EvidenceVariableCharacteristicTimeFromStart", ) EvidenceVariableDefinitionType = create_fhir_type( "EvidenceVariableDefinitionType", "fhir.resources.R4B.evidence.EvidenceVariableDefinition", ) ExampleScenarioType = create_fhir_type( "ExampleScenarioType", "fhir.resources.R4B.examplescenario.ExampleScenario" ) ExampleScenarioActorType = create_fhir_type( "ExampleScenarioActorType", "fhir.resources.R4B.examplescenario.ExampleScenarioActor", ) ExampleScenarioInstanceType = create_fhir_type( "ExampleScenarioInstanceType", "fhir.resources.R4B.examplescenario.ExampleScenarioInstance", ) ExampleScenarioInstanceContainedInstanceType = create_fhir_type( "ExampleScenarioInstanceContainedInstanceType", "fhir.resources.R4B.examplescenario.ExampleScenarioInstanceContainedInstance", ) ExampleScenarioInstanceVersionType = create_fhir_type( "ExampleScenarioInstanceVersionType", "fhir.resources.R4B.examplescenario.ExampleScenarioInstanceVersion", ) ExampleScenarioProcessType = create_fhir_type( "ExampleScenarioProcessType", "fhir.resources.R4B.examplescenario.ExampleScenarioProcess", ) ExampleScenarioProcessStepType = create_fhir_type( "ExampleScenarioProcessStepType", "fhir.resources.R4B.examplescenario.ExampleScenarioProcessStep", ) ExampleScenarioProcessStepAlternativeType = create_fhir_type( "ExampleScenarioProcessStepAlternativeType", "fhir.resources.R4B.examplescenario.ExampleScenarioProcessStepAlternative", ) ExampleScenarioProcessStepOperationType = create_fhir_type( "ExampleScenarioProcessStepOperationType", "fhir.resources.R4B.examplescenario.ExampleScenarioProcessStepOperation", ) ExplanationOfBenefitType = create_fhir_type( "ExplanationOfBenefitType", "fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefit", ) ExplanationOfBenefitAccidentType = create_fhir_type( "ExplanationOfBenefitAccidentType", "fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitAccident", ) ExplanationOfBenefitAddItemType = create_fhir_type( "ExplanationOfBenefitAddItemType", "fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitAddItem", ) ExplanationOfBenefitAddItemDetailType = create_fhir_type( "ExplanationOfBenefitAddItemDetailType", "fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitAddItemDetail", ) ExplanationOfBenefitAddItemDetailSubDetailType = create_fhir_type( "ExplanationOfBenefitAddItemDetailSubDetailType", "fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitAddItemDetailSubDetail", ) ExplanationOfBenefitBenefitBalanceType = create_fhir_type( "ExplanationOfBenefitBenefitBalanceType", "fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitBenefitBalance", ) ExplanationOfBenefitBenefitBalanceFinancialType = create_fhir_type( "ExplanationOfBenefitBenefitBalanceFinancialType", "fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitBenefitBalanceFinancial", ) ExplanationOfBenefitCareTeamType = create_fhir_type( "ExplanationOfBenefitCareTeamType", "fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitCareTeam", ) ExplanationOfBenefitDiagnosisType = create_fhir_type( "ExplanationOfBenefitDiagnosisType", "fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitDiagnosis", ) ExplanationOfBenefitInsuranceType = create_fhir_type( "ExplanationOfBenefitInsuranceType", "fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitInsurance", ) ExplanationOfBenefitItemType = create_fhir_type( "ExplanationOfBenefitItemType", "fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitItem", ) ExplanationOfBenefitItemAdjudicationType = create_fhir_type( "ExplanationOfBenefitItemAdjudicationType", "fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitItemAdjudication", ) ExplanationOfBenefitItemDetailType = create_fhir_type( "ExplanationOfBenefitItemDetailType", "fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitItemDetail", ) ExplanationOfBenefitItemDetailSubDetailType = create_fhir_type( "ExplanationOfBenefitItemDetailSubDetailType", "fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitItemDetailSubDetail", ) ExplanationOfBenefitPayeeType = create_fhir_type( "ExplanationOfBenefitPayeeType", "fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitPayee", ) ExplanationOfBenefitPaymentType = create_fhir_type( "ExplanationOfBenefitPaymentType", "fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitPayment", ) ExplanationOfBenefitProcedureType = create_fhir_type( "ExplanationOfBenefitProcedureType", "fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitProcedure", ) ExplanationOfBenefitProcessNoteType = create_fhir_type( "ExplanationOfBenefitProcessNoteType", "fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitProcessNote", ) ExplanationOfBenefitRelatedType = create_fhir_type( "ExplanationOfBenefitRelatedType", "fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitRelated", ) ExplanationOfBenefitSupportingInfoType = create_fhir_type( "ExplanationOfBenefitSupportingInfoType", "fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitSupportingInfo", ) ExplanationOfBenefitTotalType = create_fhir_type( "ExplanationOfBenefitTotalType", "fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitTotal", ) ExpressionType = create_fhir_type( "ExpressionType", "fhir.resources.R4B.expression.Expression" ) ExtensionType = create_fhir_type( "ExtensionType", "fhir.resources.R4B.extension.Extension" ) FamilyMemberHistoryType = create_fhir_type( "FamilyMemberHistoryType", "fhir.resources.R4B.familymemberhistory.FamilyMemberHistory", ) FamilyMemberHistoryConditionType = create_fhir_type( "FamilyMemberHistoryConditionType", "fhir.resources.R4B.familymemberhistory.FamilyMemberHistoryCondition", ) FlagType = create_fhir_type("FlagType", "fhir.resources.R4B.flag.Flag") GoalType = create_fhir_type("GoalType", "fhir.resources.R4B.goal.Goal") GoalTargetType = create_fhir_type( "GoalTargetType", "fhir.resources.R4B.goal.GoalTarget" ) GraphDefinitionType = create_fhir_type( "GraphDefinitionType", "fhir.resources.R4B.graphdefinition.GraphDefinition" ) GraphDefinitionLinkType = create_fhir_type( "GraphDefinitionLinkType", "fhir.resources.R4B.graphdefinition.GraphDefinitionLink", ) GraphDefinitionLinkTargetType = create_fhir_type( "GraphDefinitionLinkTargetType", "fhir.resources.R4B.graphdefinition.GraphDefinitionLinkTarget", ) GraphDefinitionLinkTargetCompartmentType = create_fhir_type( "GraphDefinitionLinkTargetCompartmentType", "fhir.resources.R4B.graphdefinition.GraphDefinitionLinkTargetCompartment", ) GroupType = create_fhir_type("GroupType", "fhir.resources.R4B.group.Group") GroupCharacteristicType = create_fhir_type( "GroupCharacteristicType", "fhir.resources.R4B.group.GroupCharacteristic" ) GroupMemberType = create_fhir_type( "GroupMemberType", "fhir.resources.R4B.group.GroupMember" ) GuidanceResponseType = create_fhir_type( "GuidanceResponseType", "fhir.resources.R4B.guidanceresponse.GuidanceResponse" ) HealthcareServiceType = create_fhir_type( "HealthcareServiceType", "fhir.resources.R4B.healthcareservice.HealthcareService", ) HealthcareServiceAvailableTimeType = create_fhir_type( "HealthcareServiceAvailableTimeType", "fhir.resources.R4B.healthcareservice.HealthcareServiceAvailableTime", ) HealthcareServiceEligibilityType = create_fhir_type( "HealthcareServiceEligibilityType", "fhir.resources.R4B.healthcareservice.HealthcareServiceEligibility", ) HealthcareServiceNotAvailableType = create_fhir_type( "HealthcareServiceNotAvailableType", "fhir.resources.R4B.healthcareservice.HealthcareServiceNotAvailable", ) HumanNameType = create_fhir_type( "HumanNameType", "fhir.resources.R4B.humanname.HumanName" ) IdentifierType = create_fhir_type( "IdentifierType", "fhir.resources.R4B.identifier.Identifier" ) ImagingStudyType = create_fhir_type( "ImagingStudyType", "fhir.resources.R4B.imagingstudy.ImagingStudy" ) ImagingStudySeriesType = create_fhir_type( "ImagingStudySeriesType", "fhir.resources.R4B.imagingstudy.ImagingStudySeries" ) ImagingStudySeriesInstanceType = create_fhir_type( "ImagingStudySeriesInstanceType", "fhir.resources.R4B.imagingstudy.ImagingStudySeriesInstance", ) ImagingStudySeriesPerformerType = create_fhir_type( "ImagingStudySeriesPerformerType", "fhir.resources.R4B.imagingstudy.ImagingStudySeriesPerformer", ) ImmunizationType = create_fhir_type( "ImmunizationType", "fhir.resources.R4B.immunization.Immunization" ) ImmunizationEducationType = create_fhir_type( "ImmunizationEducationType", "fhir.resources.R4B.immunization.ImmunizationEducation", ) ImmunizationEvaluationType = create_fhir_type( "ImmunizationEvaluationType", "fhir.resources.R4B.immunizationevaluation.ImmunizationEvaluation", ) ImmunizationPerformerType = create_fhir_type( "ImmunizationPerformerType", "fhir.resources.R4B.immunization.ImmunizationPerformer", ) ImmunizationProtocolAppliedType = create_fhir_type( "ImmunizationProtocolAppliedType", "fhir.resources.R4B.immunization.ImmunizationProtocolApplied", ) ImmunizationReactionType = create_fhir_type( "ImmunizationReactionType", "fhir.resources.R4B.immunization.ImmunizationReaction", ) ImmunizationRecommendationType = create_fhir_type( "ImmunizationRecommendationType", "fhir.resources.R4B.immunizationrecommendation.ImmunizationRecommendation", ) ImmunizationRecommendationRecommendationType = create_fhir_type( "ImmunizationRecommendationRecommendationType", "fhir.resources.R4B.immunizationrecommendation.ImmunizationRecommendationRecommendation", ) ImmunizationRecommendationRecommendationDateCriterionType = create_fhir_type( "ImmunizationRecommendationRecommendationDateCriterionType", "fhir.resources.R4B.immunizationrecommendation.ImmunizationRecommendationRecommendationDateCriterion", ) ImplementationGuideType = create_fhir_type( "ImplementationGuideType", "fhir.resources.R4B.implementationguide.ImplementationGuide", ) ImplementationGuideDefinitionType = create_fhir_type( "ImplementationGuideDefinitionType", "fhir.resources.R4B.implementationguide.ImplementationGuideDefinition", ) ImplementationGuideDefinitionGroupingType = create_fhir_type( "ImplementationGuideDefinitionGroupingType", "fhir.resources.R4B.implementationguide.ImplementationGuideDefinitionGrouping", ) ImplementationGuideDefinitionPageType = create_fhir_type( "ImplementationGuideDefinitionPageType", "fhir.resources.R4B.implementationguide.ImplementationGuideDefinitionPage", ) ImplementationGuideDefinitionParameterType = create_fhir_type( "ImplementationGuideDefinitionParameterType", "fhir.resources.R4B.implementationguide.ImplementationGuideDefinitionParameter", ) ImplementationGuideDefinitionResourceType = create_fhir_type( "ImplementationGuideDefinitionResourceType", "fhir.resources.R4B.implementationguide.ImplementationGuideDefinitionResource", ) ImplementationGuideDefinitionTemplateType = create_fhir_type( "ImplementationGuideDefinitionTemplateType", "fhir.resources.R4B.implementationguide.ImplementationGuideDefinitionTemplate", ) ImplementationGuideDependsOnType = create_fhir_type( "ImplementationGuideDependsOnType", "fhir.resources.R4B.implementationguide.ImplementationGuideDependsOn", ) ImplementationGuideGlobalType = create_fhir_type( "ImplementationGuideGlobalType", "fhir.resources.R4B.implementationguide.ImplementationGuideGlobal", ) ImplementationGuideManifestType = create_fhir_type( "ImplementationGuideManifestType", "fhir.resources.R4B.implementationguide.ImplementationGuideManifest", ) ImplementationGuideManifestPageType = create_fhir_type( "ImplementationGuideManifestPageType", "fhir.resources.R4B.implementationguide.ImplementationGuideManifestPage", ) ImplementationGuideManifestResourceType = create_fhir_type( "ImplementationGuideManifestResourceType", "fhir.resources.R4B.implementationguide.ImplementationGuideManifestResource", ) IngredientType = create_fhir_type( "IngredientType", "fhir.resources.R4B.ingredient.Ingredient" ) IngredientManufacturerType = create_fhir_type( "IngredientManufacturerType", "fhir.resources.R4B.ingredient.IngredientManufacturer", ) IngredientSubstanceType = create_fhir_type( "IngredientSubstanceType", "fhir.resources.R4B.ingredient.IngredientSubstance" ) IngredientSubstanceStrengthType = create_fhir_type( "IngredientSubstanceStrengthType", "fhir.resources.R4B.ingredient.IngredientSubstanceStrength", ) IngredientSubstanceStrengthReferenceStrengthType = create_fhir_type( "IngredientSubstanceStrengthReferenceStrengthType", "fhir.resources.R4B.ingredient.IngredientSubstanceStrengthReferenceStrength", ) InsurancePlanType = create_fhir_type( "InsurancePlanType", "fhir.resources.R4B.insuranceplan.InsurancePlan" ) InsurancePlanContactType = create_fhir_type( "InsurancePlanContactType", "fhir.resources.R4B.insuranceplan.InsurancePlanContact", ) InsurancePlanCoverageType = create_fhir_type( "InsurancePlanCoverageType", "fhir.resources.R4B.insuranceplan.InsurancePlanCoverage", ) InsurancePlanCoverageBenefitType = create_fhir_type( "InsurancePlanCoverageBenefitType", "fhir.resources.R4B.insuranceplan.InsurancePlanCoverageBenefit", ) InsurancePlanCoverageBenefitLimitType = create_fhir_type( "InsurancePlanCoverageBenefitLimitType", "fhir.resources.R4B.insuranceplan.InsurancePlanCoverageBenefitLimit", ) InsurancePlanPlanType = create_fhir_type( "InsurancePlanPlanType", "fhir.resources.R4B.insuranceplan.InsurancePlanPlan" ) InsurancePlanPlanGeneralCostType = create_fhir_type( "InsurancePlanPlanGeneralCostType", "fhir.resources.R4B.insuranceplan.InsurancePlanPlanGeneralCost", ) InsurancePlanPlanSpecificCostType = create_fhir_type( "InsurancePlanPlanSpecificCostType", "fhir.resources.R4B.insuranceplan.InsurancePlanPlanSpecificCost", ) InsurancePlanPlanSpecificCostBenefitType = create_fhir_type( "InsurancePlanPlanSpecificCostBenefitType", "fhir.resources.R4B.insuranceplan.InsurancePlanPlanSpecificCostBenefit", ) InsurancePlanPlanSpecificCostBenefitCostType = create_fhir_type( "InsurancePlanPlanSpecificCostBenefitCostType", "fhir.resources.R4B.insuranceplan.InsurancePlanPlanSpecificCostBenefitCost", ) InvoiceType = create_fhir_type("InvoiceType", "fhir.resources.R4B.invoice.Invoice") InvoiceLineItemType = create_fhir_type( "InvoiceLineItemType", "fhir.resources.R4B.invoice.InvoiceLineItem" ) InvoiceLineItemPriceComponentType = create_fhir_type( "InvoiceLineItemPriceComponentType", "fhir.resources.R4B.invoice.InvoiceLineItemPriceComponent", ) InvoiceParticipantType = create_fhir_type( "InvoiceParticipantType", "fhir.resources.R4B.invoice.InvoiceParticipant" ) LibraryType = create_fhir_type("LibraryType", "fhir.resources.R4B.library.Library") LinkageType = create_fhir_type("LinkageType", "fhir.resources.R4B.linkage.Linkage") LinkageItemType = create_fhir_type( "LinkageItemType", "fhir.resources.R4B.linkage.LinkageItem" ) ListType = create_fhir_type("ListType", "fhir.resources.R4B.list.List") ListEntryType = create_fhir_type( "ListEntryType", "fhir.resources.R4B.list.ListEntry" ) LocationType = create_fhir_type( "LocationType", "fhir.resources.R4B.location.Location" ) LocationHoursOfOperationType = create_fhir_type( "LocationHoursOfOperationType", "fhir.resources.R4B.location.LocationHoursOfOperation", ) LocationPositionType = create_fhir_type( "LocationPositionType", "fhir.resources.R4B.location.LocationPosition" ) ManufacturedItemDefinitionType = create_fhir_type( "ManufacturedItemDefinitionType", "fhir.resources.R4B.manufactureditemdefinition.ManufacturedItemDefinition", ) ManufacturedItemDefinitionPropertyType = create_fhir_type( "ManufacturedItemDefinitionPropertyType", "fhir.resources.R4B.manufactureditemdefinition.ManufacturedItemDefinitionProperty", ) MarketingStatusType = create_fhir_type( "MarketingStatusType", "fhir.resources.R4B.marketingstatus.MarketingStatus" ) MeasureType = create_fhir_type("MeasureType", "fhir.resources.R4B.measure.Measure") MeasureGroupType = create_fhir_type( "MeasureGroupType", "fhir.resources.R4B.measure.MeasureGroup" ) MeasureGroupPopulationType = create_fhir_type( "MeasureGroupPopulationType", "fhir.resources.R4B.measure.MeasureGroupPopulation", ) MeasureGroupStratifierType = create_fhir_type( "MeasureGroupStratifierType", "fhir.resources.R4B.measure.MeasureGroupStratifier", ) MeasureGroupStratifierComponentType = create_fhir_type( "MeasureGroupStratifierComponentType", "fhir.resources.R4B.measure.MeasureGroupStratifierComponent", ) MeasureReportType = create_fhir_type( "MeasureReportType", "fhir.resources.R4B.measurereport.MeasureReport" ) MeasureReportGroupType = create_fhir_type( "MeasureReportGroupType", "fhir.resources.R4B.measurereport.MeasureReportGroup" ) MeasureReportGroupPopulationType = create_fhir_type( "MeasureReportGroupPopulationType", "fhir.resources.R4B.measurereport.MeasureReportGroupPopulation", ) MeasureReportGroupStratifierType = create_fhir_type( "MeasureReportGroupStratifierType", "fhir.resources.R4B.measurereport.MeasureReportGroupStratifier", ) MeasureReportGroupStratifierStratumType = create_fhir_type( "MeasureReportGroupStratifierStratumType", "fhir.resources.R4B.measurereport.MeasureReportGroupStratifierStratum", ) MeasureReportGroupStratifierStratumComponentType = create_fhir_type( "MeasureReportGroupStratifierStratumComponentType", "fhir.resources.R4B.measurereport.MeasureReportGroupStratifierStratumComponent", ) MeasureReportGroupStratifierStratumPopulationType = create_fhir_type( "MeasureReportGroupStratifierStratumPopulationType", "fhir.resources.R4B.measurereport.MeasureReportGroupStratifierStratumPopulation", ) MeasureSupplementalDataType = create_fhir_type( "MeasureSupplementalDataType", "fhir.resources.R4B.measure.MeasureSupplementalData", ) MediaType = create_fhir_type("MediaType", "fhir.resources.R4B.media.Media") MedicationType = create_fhir_type( "MedicationType", "fhir.resources.R4B.medication.Medication" ) MedicationAdministrationType = create_fhir_type( "MedicationAdministrationType", "fhir.resources.R4B.medicationadministration.MedicationAdministration", ) MedicationAdministrationDosageType = create_fhir_type( "MedicationAdministrationDosageType", "fhir.resources.R4B.medicationadministration.MedicationAdministrationDosage", ) MedicationAdministrationPerformerType = create_fhir_type( "MedicationAdministrationPerformerType", "fhir.resources.R4B.medicationadministration.MedicationAdministrationPerformer", ) MedicationBatchType = create_fhir_type( "MedicationBatchType", "fhir.resources.R4B.medication.MedicationBatch" ) MedicationDispenseType = create_fhir_type( "MedicationDispenseType", "fhir.resources.R4B.medicationdispense.MedicationDispense", ) MedicationDispensePerformerType = create_fhir_type( "MedicationDispensePerformerType", "fhir.resources.R4B.medicationdispense.MedicationDispensePerformer", ) MedicationDispenseSubstitutionType = create_fhir_type( "MedicationDispenseSubstitutionType", "fhir.resources.R4B.medicationdispense.MedicationDispenseSubstitution", ) MedicationIngredientType = create_fhir_type( "MedicationIngredientType", "fhir.resources.R4B.medication.MedicationIngredient" ) MedicationKnowledgeType = create_fhir_type( "MedicationKnowledgeType", "fhir.resources.R4B.medicationknowledge.MedicationKnowledge", ) MedicationKnowledgeAdministrationGuidelinesType = create_fhir_type( "MedicationKnowledgeAdministrationGuidelinesType", "fhir.resources.R4B.medicationknowledge.MedicationKnowledgeAdministrationGuidelines", ) MedicationKnowledgeAdministrationGuidelinesDosageType = create_fhir_type( "MedicationKnowledgeAdministrationGuidelinesDosageType", "fhir.resources.R4B.medicationknowledge.MedicationKnowledgeAdministrationGuidelinesDosage", ) MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsType = create_fhir_type( "MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsType", "fhir.resources.R4B.medicationknowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristics", ) MedicationKnowledgeCostType = create_fhir_type( "MedicationKnowledgeCostType", "fhir.resources.R4B.medicationknowledge.MedicationKnowledgeCost", ) MedicationKnowledgeDrugCharacteristicType = create_fhir_type( "MedicationKnowledgeDrugCharacteristicType", "fhir.resources.R4B.medicationknowledge.MedicationKnowledgeDrugCharacteristic", ) MedicationKnowledgeIngredientType = create_fhir_type( "MedicationKnowledgeIngredientType", "fhir.resources.R4B.medicationknowledge.MedicationKnowledgeIngredient", ) MedicationKnowledgeKineticsType = create_fhir_type( "MedicationKnowledgeKineticsType", "fhir.resources.R4B.medicationknowledge.MedicationKnowledgeKinetics", ) MedicationKnowledgeMedicineClassificationType = create_fhir_type( "MedicationKnowledgeMedicineClassificationType", "fhir.resources.R4B.medicationknowledge.MedicationKnowledgeMedicineClassification", ) MedicationKnowledgeMonitoringProgramType = create_fhir_type( "MedicationKnowledgeMonitoringProgramType", "fhir.resources.R4B.medicationknowledge.MedicationKnowledgeMonitoringProgram", ) MedicationKnowledgeMonographType = create_fhir_type( "MedicationKnowledgeMonographType", "fhir.resources.R4B.medicationknowledge.MedicationKnowledgeMonograph", ) MedicationKnowledgePackagingType = create_fhir_type( "MedicationKnowledgePackagingType", "fhir.resources.R4B.medicationknowledge.MedicationKnowledgePackaging", ) MedicationKnowledgeRegulatoryType = create_fhir_type( "MedicationKnowledgeRegulatoryType", "fhir.resources.R4B.medicationknowledge.MedicationKnowledgeRegulatory", ) MedicationKnowledgeRegulatoryMaxDispenseType = create_fhir_type( "MedicationKnowledgeRegulatoryMaxDispenseType", "fhir.resources.R4B.medicationknowledge.MedicationKnowledgeRegulatoryMaxDispense", ) MedicationKnowledgeRegulatoryScheduleType = create_fhir_type( "MedicationKnowledgeRegulatoryScheduleType", "fhir.resources.R4B.medicationknowledge.MedicationKnowledgeRegulatorySchedule", ) MedicationKnowledgeRegulatorySubstitutionType = create_fhir_type( "MedicationKnowledgeRegulatorySubstitutionType", "fhir.resources.R4B.medicationknowledge.MedicationKnowledgeRegulatorySubstitution", ) MedicationKnowledgeRelatedMedicationKnowledgeType = create_fhir_type( "MedicationKnowledgeRelatedMedicationKnowledgeType", "fhir.resources.R4B.medicationknowledge.MedicationKnowledgeRelatedMedicationKnowledge", ) MedicationRequestType = create_fhir_type( "MedicationRequestType", "fhir.resources.R4B.medicationrequest.MedicationRequest", ) MedicationRequestDispenseRequestType = create_fhir_type( "MedicationRequestDispenseRequestType", "fhir.resources.R4B.medicationrequest.MedicationRequestDispenseRequest", ) MedicationRequestDispenseRequestInitialFillType = create_fhir_type( "MedicationRequestDispenseRequestInitialFillType", "fhir.resources.R4B.medicationrequest.MedicationRequestDispenseRequestInitialFill", ) MedicationRequestSubstitutionType = create_fhir_type( "MedicationRequestSubstitutionType", "fhir.resources.R4B.medicationrequest.MedicationRequestSubstitution", ) MedicationStatementType = create_fhir_type( "MedicationStatementType", "fhir.resources.R4B.medicationstatement.MedicationStatement", ) MedicinalProductDefinitionType = create_fhir_type( "MedicinalProductDefinitionType", "fhir.resources.R4B.medicinalproductdefinition.MedicinalProductDefinition", ) MedicinalProductDefinitionCharacteristicType = create_fhir_type( "MedicinalProductDefinitionCharacteristicType", "fhir.resources.R4B.medicinalproductdefinition.MedicinalProductDefinitionCharacteristic", ) MedicinalProductDefinitionContactType = create_fhir_type( "MedicinalProductDefinitionContactType", "fhir.resources.R4B.medicinalproductdefinition.MedicinalProductDefinitionContact", ) MedicinalProductDefinitionCrossReferenceType = create_fhir_type( "MedicinalProductDefinitionCrossReferenceType", "fhir.resources.R4B.medicinalproductdefinition.MedicinalProductDefinitionCrossReference", ) MedicinalProductDefinitionNameType = create_fhir_type( "MedicinalProductDefinitionNameType", "fhir.resources.R4B.medicinalproductdefinition.MedicinalProductDefinitionName", ) MedicinalProductDefinitionNameCountryLanguageType = create_fhir_type( "MedicinalProductDefinitionNameCountryLanguageType", "fhir.resources.R4B.medicinalproductdefinition.MedicinalProductDefinitionNameCountryLanguage", ) MedicinalProductDefinitionNameNamePartType = create_fhir_type( "MedicinalProductDefinitionNameNamePartType", "fhir.resources.R4B.medicinalproductdefinition.MedicinalProductDefinitionNameNamePart", ) MedicinalProductDefinitionOperationType = create_fhir_type( "MedicinalProductDefinitionOperationType", "fhir.resources.R4B.medicinalproductdefinition.MedicinalProductDefinitionOperation", ) MessageDefinitionType = create_fhir_type( "MessageDefinitionType", "fhir.resources.R4B.messagedefinition.MessageDefinition", ) MessageDefinitionAllowedResponseType = create_fhir_type( "MessageDefinitionAllowedResponseType", "fhir.resources.R4B.messagedefinition.MessageDefinitionAllowedResponse", ) MessageDefinitionFocusType = create_fhir_type( "MessageDefinitionFocusType", "fhir.resources.R4B.messagedefinition.MessageDefinitionFocus", ) MessageHeaderType = create_fhir_type( "MessageHeaderType", "fhir.resources.R4B.messageheader.MessageHeader" ) MessageHeaderDestinationType = create_fhir_type( "MessageHeaderDestinationType", "fhir.resources.R4B.messageheader.MessageHeaderDestination", ) MessageHeaderResponseType = create_fhir_type( "MessageHeaderResponseType", "fhir.resources.R4B.messageheader.MessageHeaderResponse", ) MessageHeaderSourceType = create_fhir_type( "MessageHeaderSourceType", "fhir.resources.R4B.messageheader.MessageHeaderSource", ) MetaType = create_fhir_type("MetaType", "fhir.resources.R4B.meta.Meta") MolecularSequenceType = create_fhir_type( "MolecularSequenceType", "fhir.resources.R4B.molecularsequence.MolecularSequence", ) MolecularSequenceQualityType = create_fhir_type( "MolecularSequenceQualityType", "fhir.resources.R4B.molecularsequence.MolecularSequenceQuality", ) MolecularSequenceQualityRocType = create_fhir_type( "MolecularSequenceQualityRocType", "fhir.resources.R4B.molecularsequence.MolecularSequenceQualityRoc", ) MolecularSequenceReferenceSeqType = create_fhir_type( "MolecularSequenceReferenceSeqType", "fhir.resources.R4B.molecularsequence.MolecularSequenceReferenceSeq", ) MolecularSequenceRepositoryType = create_fhir_type( "MolecularSequenceRepositoryType", "fhir.resources.R4B.molecularsequence.MolecularSequenceRepository", ) MolecularSequenceStructureVariantType = create_fhir_type( "MolecularSequenceStructureVariantType", "fhir.resources.R4B.molecularsequence.MolecularSequenceStructureVariant", ) MolecularSequenceStructureVariantInnerType = create_fhir_type( "MolecularSequenceStructureVariantInnerType", "fhir.resources.R4B.molecularsequence.MolecularSequenceStructureVariantInner", ) MolecularSequenceStructureVariantOuterType = create_fhir_type( "MolecularSequenceStructureVariantOuterType", "fhir.resources.R4B.molecularsequence.MolecularSequenceStructureVariantOuter", ) MolecularSequenceVariantType = create_fhir_type( "MolecularSequenceVariantType", "fhir.resources.R4B.molecularsequence.MolecularSequenceVariant", ) MoneyType = create_fhir_type("MoneyType", "fhir.resources.R4B.money.Money") NamingSystemType = create_fhir_type( "NamingSystemType", "fhir.resources.R4B.namingsystem.NamingSystem" ) NamingSystemUniqueIdType = create_fhir_type( "NamingSystemUniqueIdType", "fhir.resources.R4B.namingsystem.NamingSystemUniqueId", ) NarrativeType = create_fhir_type( "NarrativeType", "fhir.resources.R4B.narrative.Narrative" ) NutritionOrderType = create_fhir_type( "NutritionOrderType", "fhir.resources.R4B.nutritionorder.NutritionOrder" ) NutritionOrderEnteralFormulaType = create_fhir_type( "NutritionOrderEnteralFormulaType", "fhir.resources.R4B.nutritionorder.NutritionOrderEnteralFormula", ) NutritionOrderEnteralFormulaAdministrationType = create_fhir_type( "NutritionOrderEnteralFormulaAdministrationType", "fhir.resources.R4B.nutritionorder.NutritionOrderEnteralFormulaAdministration", ) NutritionOrderOralDietType = create_fhir_type( "NutritionOrderOralDietType", "fhir.resources.R4B.nutritionorder.NutritionOrderOralDiet", ) NutritionOrderOralDietNutrientType = create_fhir_type( "NutritionOrderOralDietNutrientType", "fhir.resources.R4B.nutritionorder.NutritionOrderOralDietNutrient", ) NutritionOrderOralDietTextureType = create_fhir_type( "NutritionOrderOralDietTextureType", "fhir.resources.R4B.nutritionorder.NutritionOrderOralDietTexture", ) NutritionOrderSupplementType = create_fhir_type( "NutritionOrderSupplementType", "fhir.resources.R4B.nutritionorder.NutritionOrderSupplement", ) NutritionProductType = create_fhir_type( "NutritionProductType", "fhir.resources.R4B.nutritionproduct.NutritionProduct" ) NutritionProductIngredientType = create_fhir_type( "NutritionProductIngredientType", "fhir.resources.R4B.nutritionproduct.NutritionProductIngredient", ) NutritionProductInstanceType = create_fhir_type( "NutritionProductInstanceType", "fhir.resources.R4B.nutritionproduct.NutritionProductInstance", ) NutritionProductNutrientType = create_fhir_type( "NutritionProductNutrientType", "fhir.resources.R4B.nutritionproduct.NutritionProductNutrient", ) NutritionProductProductCharacteristicType = create_fhir_type( "NutritionProductProductCharacteristicType", "fhir.resources.R4B.nutritionproduct.NutritionProductProductCharacteristic", ) ObservationType = create_fhir_type( "ObservationType", "fhir.resources.R4B.observation.Observation" ) ObservationComponentType = create_fhir_type( "ObservationComponentType", "fhir.resources.R4B.observation.ObservationComponent", ) ObservationDefinitionType = create_fhir_type( "ObservationDefinitionType", "fhir.resources.R4B.observationdefinition.ObservationDefinition", ) ObservationDefinitionQualifiedIntervalType = create_fhir_type( "ObservationDefinitionQualifiedIntervalType", "fhir.resources.R4B.observationdefinition.ObservationDefinitionQualifiedInterval", ) ObservationDefinitionQuantitativeDetailsType = create_fhir_type( "ObservationDefinitionQuantitativeDetailsType", "fhir.resources.R4B.observationdefinition.ObservationDefinitionQuantitativeDetails", ) ObservationReferenceRangeType = create_fhir_type( "ObservationReferenceRangeType", "fhir.resources.R4B.observation.ObservationReferenceRange", ) OperationDefinitionType = create_fhir_type( "OperationDefinitionType", "fhir.resources.R4B.operationdefinition.OperationDefinition", ) OperationDefinitionOverloadType = create_fhir_type( "OperationDefinitionOverloadType", "fhir.resources.R4B.operationdefinition.OperationDefinitionOverload", ) OperationDefinitionParameterType = create_fhir_type( "OperationDefinitionParameterType", "fhir.resources.R4B.operationdefinition.OperationDefinitionParameter", ) OperationDefinitionParameterBindingType = create_fhir_type( "OperationDefinitionParameterBindingType", "fhir.resources.R4B.operationdefinition.OperationDefinitionParameterBinding", ) OperationDefinitionParameterReferencedFromType = create_fhir_type( "OperationDefinitionParameterReferencedFromType", "fhir.resources.R4B.operationdefinition.OperationDefinitionParameterReferencedFrom", ) OperationOutcomeType = create_fhir_type( "OperationOutcomeType", "fhir.resources.R4B.operationoutcome.OperationOutcome" ) OperationOutcomeIssueType = create_fhir_type( "OperationOutcomeIssueType", "fhir.resources.R4B.operationoutcome.OperationOutcomeIssue", ) OrganizationType = create_fhir_type( "OrganizationType", "fhir.resources.R4B.organization.Organization" ) OrganizationAffiliationType = create_fhir_type( "OrganizationAffiliationType", "fhir.resources.R4B.organizationaffiliation.OrganizationAffiliation", ) OrganizationContactType = create_fhir_type( "OrganizationContactType", "fhir.resources.R4B.organization.OrganizationContact" ) PackagedProductDefinitionType = create_fhir_type( "PackagedProductDefinitionType", "fhir.resources.R4B.packagedproductdefinition.PackagedProductDefinition", ) PackagedProductDefinitionLegalStatusOfSupplyType = create_fhir_type( "PackagedProductDefinitionLegalStatusOfSupplyType", "fhir.resources.R4B.packagedproductdefinition.PackagedProductDefinitionLegalStatusOfSupply", ) PackagedProductDefinitionPackageType = create_fhir_type( "PackagedProductDefinitionPackageType", "fhir.resources.R4B.packagedproductdefinition.PackagedProductDefinitionPackage", ) PackagedProductDefinitionPackageContainedItemType = create_fhir_type( "PackagedProductDefinitionPackageContainedItemType", "fhir.resources.R4B.packagedproductdefinition.PackagedProductDefinitionPackageContainedItem", ) PackagedProductDefinitionPackagePropertyType = create_fhir_type( "PackagedProductDefinitionPackagePropertyType", "fhir.resources.R4B.packagedproductdefinition.PackagedProductDefinitionPackageProperty", ) PackagedProductDefinitionPackageShelfLifeStorageType = create_fhir_type( "PackagedProductDefinitionPackageShelfLifeStorageType", "fhir.resources.R4B.packagedproductdefinition.PackagedProductDefinitionPackageShelfLifeStorage", ) ParameterDefinitionType = create_fhir_type( "ParameterDefinitionType", "fhir.resources.R4B.parameterdefinition.ParameterDefinition", ) ParametersType = create_fhir_type( "ParametersType", "fhir.resources.R4B.parameters.Parameters" ) ParametersParameterType = create_fhir_type( "ParametersParameterType", "fhir.resources.R4B.parameters.ParametersParameter" ) PatientType = create_fhir_type("PatientType", "fhir.resources.R4B.patient.Patient") PatientCommunicationType = create_fhir_type( "PatientCommunicationType", "fhir.resources.R4B.patient.PatientCommunication" ) PatientContactType = create_fhir_type( "PatientContactType", "fhir.resources.R4B.patient.PatientContact" ) PatientLinkType = create_fhir_type( "PatientLinkType", "fhir.resources.R4B.patient.PatientLink" ) PaymentNoticeType = create_fhir_type( "PaymentNoticeType", "fhir.resources.R4B.paymentnotice.PaymentNotice" ) PaymentReconciliationType = create_fhir_type( "PaymentReconciliationType", "fhir.resources.R4B.paymentreconciliation.PaymentReconciliation", ) PaymentReconciliationDetailType = create_fhir_type( "PaymentReconciliationDetailType", "fhir.resources.R4B.paymentreconciliation.PaymentReconciliationDetail", ) PaymentReconciliationProcessNoteType = create_fhir_type( "PaymentReconciliationProcessNoteType", "fhir.resources.R4B.paymentreconciliation.PaymentReconciliationProcessNote", ) PeriodType = create_fhir_type("PeriodType", "fhir.resources.R4B.period.Period") PersonType = create_fhir_type("PersonType", "fhir.resources.R4B.person.Person") PersonLinkType = create_fhir_type( "PersonLinkType", "fhir.resources.R4B.person.PersonLink" ) PlanDefinitionType = create_fhir_type( "PlanDefinitionType", "fhir.resources.R4B.plandefinition.PlanDefinition" ) PlanDefinitionActionType = create_fhir_type( "PlanDefinitionActionType", "fhir.resources.R4B.plandefinition.PlanDefinitionAction", ) PlanDefinitionActionConditionType = create_fhir_type( "PlanDefinitionActionConditionType", "fhir.resources.R4B.plandefinition.PlanDefinitionActionCondition", ) PlanDefinitionActionDynamicValueType = create_fhir_type( "PlanDefinitionActionDynamicValueType", "fhir.resources.R4B.plandefinition.PlanDefinitionActionDynamicValue", ) PlanDefinitionActionParticipantType = create_fhir_type( "PlanDefinitionActionParticipantType", "fhir.resources.R4B.plandefinition.PlanDefinitionActionParticipant", ) PlanDefinitionActionRelatedActionType = create_fhir_type( "PlanDefinitionActionRelatedActionType", "fhir.resources.R4B.plandefinition.PlanDefinitionActionRelatedAction", ) PlanDefinitionGoalType = create_fhir_type( "PlanDefinitionGoalType", "fhir.resources.R4B.plandefinition.PlanDefinitionGoal" ) PlanDefinitionGoalTargetType = create_fhir_type( "PlanDefinitionGoalTargetType", "fhir.resources.R4B.plandefinition.PlanDefinitionGoalTarget", ) PopulationType = create_fhir_type( "PopulationType", "fhir.resources.R4B.population.Population" ) PractitionerType = create_fhir_type( "PractitionerType", "fhir.resources.R4B.practitioner.Practitioner" ) PractitionerQualificationType = create_fhir_type( "PractitionerQualificationType", "fhir.resources.R4B.practitioner.PractitionerQualification", ) PractitionerRoleType = create_fhir_type( "PractitionerRoleType", "fhir.resources.R4B.practitionerrole.PractitionerRole" ) PractitionerRoleAvailableTimeType = create_fhir_type( "PractitionerRoleAvailableTimeType", "fhir.resources.R4B.practitionerrole.PractitionerRoleAvailableTime", ) PractitionerRoleNotAvailableType = create_fhir_type( "PractitionerRoleNotAvailableType", "fhir.resources.R4B.practitionerrole.PractitionerRoleNotAvailable", ) ProcedureType = create_fhir_type( "ProcedureType", "fhir.resources.R4B.procedure.Procedure" ) ProcedureFocalDeviceType = create_fhir_type( "ProcedureFocalDeviceType", "fhir.resources.R4B.procedure.ProcedureFocalDevice" ) ProcedurePerformerType = create_fhir_type( "ProcedurePerformerType", "fhir.resources.R4B.procedure.ProcedurePerformer" ) ProdCharacteristicType = create_fhir_type( "ProdCharacteristicType", "fhir.resources.R4B.prodcharacteristic.ProdCharacteristic", ) ProductShelfLifeType = create_fhir_type( "ProductShelfLifeType", "fhir.resources.R4B.productshelflife.ProductShelfLife" ) ProvenanceType = create_fhir_type( "ProvenanceType", "fhir.resources.R4B.provenance.Provenance" ) ProvenanceAgentType = create_fhir_type( "ProvenanceAgentType", "fhir.resources.R4B.provenance.ProvenanceAgent" ) ProvenanceEntityType = create_fhir_type( "ProvenanceEntityType", "fhir.resources.R4B.provenance.ProvenanceEntity" ) QuantityType = create_fhir_type( "QuantityType", "fhir.resources.R4B.quantity.Quantity" ) QuestionnaireType = create_fhir_type( "QuestionnaireType", "fhir.resources.R4B.questionnaire.Questionnaire" ) QuestionnaireItemType = create_fhir_type( "QuestionnaireItemType", "fhir.resources.R4B.questionnaire.QuestionnaireItem" ) QuestionnaireItemAnswerOptionType = create_fhir_type( "QuestionnaireItemAnswerOptionType", "fhir.resources.R4B.questionnaire.QuestionnaireItemAnswerOption", ) QuestionnaireItemEnableWhenType = create_fhir_type( "QuestionnaireItemEnableWhenType", "fhir.resources.R4B.questionnaire.QuestionnaireItemEnableWhen", ) QuestionnaireItemInitialType = create_fhir_type( "QuestionnaireItemInitialType", "fhir.resources.R4B.questionnaire.QuestionnaireItemInitial", ) QuestionnaireResponseType = create_fhir_type( "QuestionnaireResponseType", "fhir.resources.R4B.questionnaireresponse.QuestionnaireResponse", ) QuestionnaireResponseItemType = create_fhir_type( "QuestionnaireResponseItemType", "fhir.resources.R4B.questionnaireresponse.QuestionnaireResponseItem", ) QuestionnaireResponseItemAnswerType = create_fhir_type( "QuestionnaireResponseItemAnswerType", "fhir.resources.R4B.questionnaireresponse.QuestionnaireResponseItemAnswer", ) RangeType = create_fhir_type("RangeType", "fhir.resources.R4B.range.Range") RatioType = create_fhir_type("RatioType", "fhir.resources.R4B.ratio.Ratio") RatioRangeType = create_fhir_type( "RatioRangeType", "fhir.resources.R4B.ratiorange.RatioRange" ) ReferenceType = create_fhir_type( "ReferenceType", "fhir.resources.R4B.reference.Reference" ) RegulatedAuthorizationType = create_fhir_type( "RegulatedAuthorizationType", "fhir.resources.R4B.regulatedauthorization.RegulatedAuthorization", ) RegulatedAuthorizationCaseType = create_fhir_type( "RegulatedAuthorizationCaseType", "fhir.resources.R4B.regulatedauthorization.RegulatedAuthorizationCase", ) RelatedArtifactType = create_fhir_type( "RelatedArtifactType", "fhir.resources.R4B.relatedartifact.RelatedArtifact" ) RelatedPersonType = create_fhir_type( "RelatedPersonType", "fhir.resources.R4B.relatedperson.RelatedPerson" ) RelatedPersonCommunicationType = create_fhir_type( "RelatedPersonCommunicationType", "fhir.resources.R4B.relatedperson.RelatedPersonCommunication", ) RequestGroupType = create_fhir_type( "RequestGroupType", "fhir.resources.R4B.requestgroup.RequestGroup" ) RequestGroupActionType = create_fhir_type( "RequestGroupActionType", "fhir.resources.R4B.requestgroup.RequestGroupAction" ) RequestGroupActionConditionType = create_fhir_type( "RequestGroupActionConditionType", "fhir.resources.R4B.requestgroup.RequestGroupActionCondition", ) RequestGroupActionRelatedActionType = create_fhir_type( "RequestGroupActionRelatedActionType", "fhir.resources.R4B.requestgroup.RequestGroupActionRelatedAction", ) ResearchDefinitionType = create_fhir_type( "ResearchDefinitionType", "fhir.resources.R4B.researchdefinition.ResearchDefinition", ) ResearchElementDefinitionType = create_fhir_type( "ResearchElementDefinitionType", "fhir.resources.R4B.researchelementdefinition.ResearchElementDefinition", ) ResearchElementDefinitionCharacteristicType = create_fhir_type( "ResearchElementDefinitionCharacteristicType", "fhir.resources.R4B.researchelementdefinition.ResearchElementDefinitionCharacteristic", ) ResearchStudyType = create_fhir_type( "ResearchStudyType", "fhir.resources.R4B.researchstudy.ResearchStudy" ) ResearchStudyArmType = create_fhir_type( "ResearchStudyArmType", "fhir.resources.R4B.researchstudy.ResearchStudyArm" ) ResearchStudyObjectiveType = create_fhir_type( "ResearchStudyObjectiveType", "fhir.resources.R4B.researchstudy.ResearchStudyObjective", ) ResearchSubjectType = create_fhir_type( "ResearchSubjectType", "fhir.resources.R4B.researchsubject.ResearchSubject" ) RiskAssessmentType = create_fhir_type( "RiskAssessmentType", "fhir.resources.R4B.riskassessment.RiskAssessment" ) RiskAssessmentPredictionType = create_fhir_type( "RiskAssessmentPredictionType", "fhir.resources.R4B.riskassessment.RiskAssessmentPrediction", ) SampledDataType = create_fhir_type( "SampledDataType", "fhir.resources.R4B.sampleddata.SampledData" ) ScheduleType = create_fhir_type( "ScheduleType", "fhir.resources.R4B.schedule.Schedule" ) SearchParameterType = create_fhir_type( "SearchParameterType", "fhir.resources.R4B.searchparameter.SearchParameter" ) SearchParameterComponentType = create_fhir_type( "SearchParameterComponentType", "fhir.resources.R4B.searchparameter.SearchParameterComponent", ) ServiceRequestType = create_fhir_type( "ServiceRequestType", "fhir.resources.R4B.servicerequest.ServiceRequest" ) SignatureType = create_fhir_type( "SignatureType", "fhir.resources.R4B.signature.Signature" ) SlotType = create_fhir_type("SlotType", "fhir.resources.R4B.slot.Slot") SpecimenType = create_fhir_type( "SpecimenType", "fhir.resources.R4B.specimen.Specimen" ) SpecimenCollectionType = create_fhir_type( "SpecimenCollectionType", "fhir.resources.R4B.specimen.SpecimenCollection" ) SpecimenContainerType = create_fhir_type( "SpecimenContainerType", "fhir.resources.R4B.specimen.SpecimenContainer" ) SpecimenDefinitionType = create_fhir_type( "SpecimenDefinitionType", "fhir.resources.R4B.specimendefinition.SpecimenDefinition", ) SpecimenDefinitionTypeTestedType = create_fhir_type( "SpecimenDefinitionTypeTestedType", "fhir.resources.R4B.specimendefinition.SpecimenDefinitionTypeTested", ) SpecimenDefinitionTypeTestedContainerType = create_fhir_type( "SpecimenDefinitionTypeTestedContainerType", "fhir.resources.R4B.specimendefinition.SpecimenDefinitionTypeTestedContainer", ) SpecimenDefinitionTypeTestedContainerAdditiveType = create_fhir_type( "SpecimenDefinitionTypeTestedContainerAdditiveType", "fhir.resources.R4B.specimendefinition.SpecimenDefinitionTypeTestedContainerAdditive", ) SpecimenDefinitionTypeTestedHandlingType = create_fhir_type( "SpecimenDefinitionTypeTestedHandlingType", "fhir.resources.R4B.specimendefinition.SpecimenDefinitionTypeTestedHandling", ) SpecimenProcessingType = create_fhir_type( "SpecimenProcessingType", "fhir.resources.R4B.specimen.SpecimenProcessing" ) StructureDefinitionType = create_fhir_type( "StructureDefinitionType", "fhir.resources.R4B.structuredefinition.StructureDefinition", ) StructureDefinitionContextType = create_fhir_type( "StructureDefinitionContextType", "fhir.resources.R4B.structuredefinition.StructureDefinitionContext", ) StructureDefinitionDifferentialType = create_fhir_type( "StructureDefinitionDifferentialType", "fhir.resources.R4B.structuredefinition.StructureDefinitionDifferential", ) StructureDefinitionMappingType = create_fhir_type( "StructureDefinitionMappingType", "fhir.resources.R4B.structuredefinition.StructureDefinitionMapping", ) StructureDefinitionSnapshotType = create_fhir_type( "StructureDefinitionSnapshotType", "fhir.resources.R4B.structuredefinition.StructureDefinitionSnapshot", ) StructureMapType = create_fhir_type( "StructureMapType", "fhir.resources.R4B.structuremap.StructureMap" ) StructureMapGroupType = create_fhir_type( "StructureMapGroupType", "fhir.resources.R4B.structuremap.StructureMapGroup" ) StructureMapGroupInputType = create_fhir_type( "StructureMapGroupInputType", "fhir.resources.R4B.structuremap.StructureMapGroupInput", ) StructureMapGroupRuleType = create_fhir_type( "StructureMapGroupRuleType", "fhir.resources.R4B.structuremap.StructureMapGroupRule", ) StructureMapGroupRuleDependentType = create_fhir_type( "StructureMapGroupRuleDependentType", "fhir.resources.R4B.structuremap.StructureMapGroupRuleDependent", ) StructureMapGroupRuleSourceType = create_fhir_type( "StructureMapGroupRuleSourceType", "fhir.resources.R4B.structuremap.StructureMapGroupRuleSource", ) StructureMapGroupRuleTargetType = create_fhir_type( "StructureMapGroupRuleTargetType", "fhir.resources.R4B.structuremap.StructureMapGroupRuleTarget", ) StructureMapGroupRuleTargetParameterType = create_fhir_type( "StructureMapGroupRuleTargetParameterType", "fhir.resources.R4B.structuremap.StructureMapGroupRuleTargetParameter", ) StructureMapStructureType = create_fhir_type( "StructureMapStructureType", "fhir.resources.R4B.structuremap.StructureMapStructure", ) SubscriptionType = create_fhir_type( "SubscriptionType", "fhir.resources.R4B.subscription.Subscription" ) SubscriptionChannelType = create_fhir_type( "SubscriptionChannelType", "fhir.resources.R4B.subscription.SubscriptionChannel" ) SubscriptionStatusType = create_fhir_type( "SubscriptionStatusType", "fhir.resources.R4B.subscriptionstatus.SubscriptionStatus", ) SubscriptionStatusNotificationEventType = create_fhir_type( "SubscriptionStatusNotificationEventType", "fhir.resources.R4B.subscriptionstatus.SubscriptionStatusNotificationEvent", ) SubscriptionTopicType = create_fhir_type( "SubscriptionTopicType", "fhir.resources.R4B.subscriptiontopic.SubscriptionTopic", ) SubscriptionTopicCanFilterByType = create_fhir_type( "SubscriptionTopicCanFilterByType", "fhir.resources.R4B.subscriptiontopic.SubscriptionTopicCanFilterBy", ) SubscriptionTopicEventTriggerType = create_fhir_type( "SubscriptionTopicEventTriggerType", "fhir.resources.R4B.subscriptiontopic.SubscriptionTopicEventTrigger", ) SubscriptionTopicNotificationShapeType = create_fhir_type( "SubscriptionTopicNotificationShapeType", "fhir.resources.R4B.subscriptiontopic.SubscriptionTopicNotificationShape", ) SubscriptionTopicResourceTriggerType = create_fhir_type( "SubscriptionTopicResourceTriggerType", "fhir.resources.R4B.subscriptiontopic.SubscriptionTopicResourceTrigger", ) SubscriptionTopicResourceTriggerQueryCriteriaType = create_fhir_type( "SubscriptionTopicResourceTriggerQueryCriteriaType", "fhir.resources.R4B.subscriptiontopic.SubscriptionTopicResourceTriggerQueryCriteria", ) SubstanceType = create_fhir_type( "SubstanceType", "fhir.resources.R4B.substance.Substance" ) SubstanceDefinitionType = create_fhir_type( "SubstanceDefinitionType", "fhir.resources.R4B.substancedefinition.SubstanceDefinition", ) SubstanceDefinitionCodeType = create_fhir_type( "SubstanceDefinitionCodeType", "fhir.resources.R4B.substancedefinition.SubstanceDefinitionCode", ) SubstanceDefinitionMoietyType = create_fhir_type( "SubstanceDefinitionMoietyType", "fhir.resources.R4B.substancedefinition.SubstanceDefinitionMoiety", ) SubstanceDefinitionMolecularWeightType = create_fhir_type( "SubstanceDefinitionMolecularWeightType", "fhir.resources.R4B.substancedefinition.SubstanceDefinitionMolecularWeight", ) SubstanceDefinitionNameType = create_fhir_type( "SubstanceDefinitionNameType", "fhir.resources.R4B.substancedefinition.SubstanceDefinitionName", ) SubstanceDefinitionNameOfficialType = create_fhir_type( "SubstanceDefinitionNameOfficialType", "fhir.resources.R4B.substancedefinition.SubstanceDefinitionNameOfficial", ) SubstanceDefinitionPropertyType = create_fhir_type( "SubstanceDefinitionPropertyType", "fhir.resources.R4B.substancedefinition.SubstanceDefinitionProperty", ) SubstanceDefinitionRelationshipType = create_fhir_type( "SubstanceDefinitionRelationshipType", "fhir.resources.R4B.substancedefinition.SubstanceDefinitionRelationship", ) SubstanceDefinitionSourceMaterialType = create_fhir_type( "SubstanceDefinitionSourceMaterialType", "fhir.resources.R4B.substancedefinition.SubstanceDefinitionSourceMaterial", ) SubstanceDefinitionStructureType = create_fhir_type( "SubstanceDefinitionStructureType", "fhir.resources.R4B.substancedefinition.SubstanceDefinitionStructure", ) SubstanceDefinitionStructureRepresentationType = create_fhir_type( "SubstanceDefinitionStructureRepresentationType", "fhir.resources.R4B.substancedefinition.SubstanceDefinitionStructureRepresentation", ) SubstanceIngredientType = create_fhir_type( "SubstanceIngredientType", "fhir.resources.R4B.substance.SubstanceIngredient" ) SubstanceInstanceType = create_fhir_type( "SubstanceInstanceType", "fhir.resources.R4B.substance.SubstanceInstance" ) SupplyDeliveryType = create_fhir_type( "SupplyDeliveryType", "fhir.resources.R4B.supplydelivery.SupplyDelivery" ) SupplyDeliverySuppliedItemType = create_fhir_type( "SupplyDeliverySuppliedItemType", "fhir.resources.R4B.supplydelivery.SupplyDeliverySuppliedItem", ) SupplyRequestType = create_fhir_type( "SupplyRequestType", "fhir.resources.R4B.supplyrequest.SupplyRequest" ) SupplyRequestParameterType = create_fhir_type( "SupplyRequestParameterType", "fhir.resources.R4B.supplyrequest.SupplyRequestParameter", ) TaskType = create_fhir_type("TaskType", "fhir.resources.R4B.task.Task") TaskInputType = create_fhir_type( "TaskInputType", "fhir.resources.R4B.task.TaskInput" ) TaskOutputType = create_fhir_type( "TaskOutputType", "fhir.resources.R4B.task.TaskOutput" ) TaskRestrictionType = create_fhir_type( "TaskRestrictionType", "fhir.resources.R4B.task.TaskRestriction" ) TerminologyCapabilitiesType = create_fhir_type( "TerminologyCapabilitiesType", "fhir.resources.R4B.terminologycapabilities.TerminologyCapabilities", ) TerminologyCapabilitiesClosureType = create_fhir_type( "TerminologyCapabilitiesClosureType", "fhir.resources.R4B.terminologycapabilities.TerminologyCapabilitiesClosure", ) TerminologyCapabilitiesCodeSystemType = create_fhir_type( "TerminologyCapabilitiesCodeSystemType", "fhir.resources.R4B.terminologycapabilities.TerminologyCapabilitiesCodeSystem", ) TerminologyCapabilitiesCodeSystemVersionType = create_fhir_type( "TerminologyCapabilitiesCodeSystemVersionType", "fhir.resources.R4B.terminologycapabilities.TerminologyCapabilitiesCodeSystemVersion", ) TerminologyCapabilitiesCodeSystemVersionFilterType = create_fhir_type( "TerminologyCapabilitiesCodeSystemVersionFilterType", "fhir.resources.R4B.terminologycapabilities.TerminologyCapabilitiesCodeSystemVersionFilter", ) TerminologyCapabilitiesExpansionType = create_fhir_type( "TerminologyCapabilitiesExpansionType", "fhir.resources.R4B.terminologycapabilities.TerminologyCapabilitiesExpansion", ) TerminologyCapabilitiesExpansionParameterType = create_fhir_type( "TerminologyCapabilitiesExpansionParameterType", "fhir.resources.R4B.terminologycapabilities.TerminologyCapabilitiesExpansionParameter", ) TerminologyCapabilitiesImplementationType = create_fhir_type( "TerminologyCapabilitiesImplementationType", "fhir.resources.R4B.terminologycapabilities.TerminologyCapabilitiesImplementation", ) TerminologyCapabilitiesSoftwareType = create_fhir_type( "TerminologyCapabilitiesSoftwareType", "fhir.resources.R4B.terminologycapabilities.TerminologyCapabilitiesSoftware", ) TerminologyCapabilitiesTranslationType = create_fhir_type( "TerminologyCapabilitiesTranslationType", "fhir.resources.R4B.terminologycapabilities.TerminologyCapabilitiesTranslation", ) TerminologyCapabilitiesValidateCodeType = create_fhir_type( "TerminologyCapabilitiesValidateCodeType", "fhir.resources.R4B.terminologycapabilities.TerminologyCapabilitiesValidateCode", ) TestReportType = create_fhir_type( "TestReportType", "fhir.resources.R4B.testreport.TestReport" ) TestReportParticipantType = create_fhir_type( "TestReportParticipantType", "fhir.resources.R4B.testreport.TestReportParticipant", ) TestReportSetupType = create_fhir_type( "TestReportSetupType", "fhir.resources.R4B.testreport.TestReportSetup" ) TestReportSetupActionType = create_fhir_type( "TestReportSetupActionType", "fhir.resources.R4B.testreport.TestReportSetupAction", ) TestReportSetupActionAssertType = create_fhir_type( "TestReportSetupActionAssertType", "fhir.resources.R4B.testreport.TestReportSetupActionAssert", ) TestReportSetupActionOperationType = create_fhir_type( "TestReportSetupActionOperationType", "fhir.resources.R4B.testreport.TestReportSetupActionOperation", ) TestReportTeardownType = create_fhir_type( "TestReportTeardownType", "fhir.resources.R4B.testreport.TestReportTeardown" ) TestReportTeardownActionType = create_fhir_type( "TestReportTeardownActionType", "fhir.resources.R4B.testreport.TestReportTeardownAction", ) TestReportTestType = create_fhir_type( "TestReportTestType", "fhir.resources.R4B.testreport.TestReportTest" ) TestReportTestActionType = create_fhir_type( "TestReportTestActionType", "fhir.resources.R4B.testreport.TestReportTestAction" ) TestScriptType = create_fhir_type( "TestScriptType", "fhir.resources.R4B.testscript.TestScript" ) TestScriptDestinationType = create_fhir_type( "TestScriptDestinationType", "fhir.resources.R4B.testscript.TestScriptDestination", ) TestScriptFixtureType = create_fhir_type( "TestScriptFixtureType", "fhir.resources.R4B.testscript.TestScriptFixture" ) TestScriptMetadataType = create_fhir_type( "TestScriptMetadataType", "fhir.resources.R4B.testscript.TestScriptMetadata" ) TestScriptMetadataCapabilityType = create_fhir_type( "TestScriptMetadataCapabilityType", "fhir.resources.R4B.testscript.TestScriptMetadataCapability", ) TestScriptMetadataLinkType = create_fhir_type( "TestScriptMetadataLinkType", "fhir.resources.R4B.testscript.TestScriptMetadataLink", ) TestScriptOriginType = create_fhir_type( "TestScriptOriginType", "fhir.resources.R4B.testscript.TestScriptOrigin" ) TestScriptSetupType = create_fhir_type( "TestScriptSetupType", "fhir.resources.R4B.testscript.TestScriptSetup" ) TestScriptSetupActionType = create_fhir_type( "TestScriptSetupActionType", "fhir.resources.R4B.testscript.TestScriptSetupAction", ) TestScriptSetupActionAssertType = create_fhir_type( "TestScriptSetupActionAssertType", "fhir.resources.R4B.testscript.TestScriptSetupActionAssert", ) TestScriptSetupActionOperationType = create_fhir_type( "TestScriptSetupActionOperationType", "fhir.resources.R4B.testscript.TestScriptSetupActionOperation", ) TestScriptSetupActionOperationRequestHeaderType = create_fhir_type( "TestScriptSetupActionOperationRequestHeaderType", "fhir.resources.R4B.testscript.TestScriptSetupActionOperationRequestHeader", ) TestScriptTeardownType = create_fhir_type( "TestScriptTeardownType", "fhir.resources.R4B.testscript.TestScriptTeardown" ) TestScriptTeardownActionType = create_fhir_type( "TestScriptTeardownActionType", "fhir.resources.R4B.testscript.TestScriptTeardownAction", ) TestScriptTestType = create_fhir_type( "TestScriptTestType", "fhir.resources.R4B.testscript.TestScriptTest" ) TestScriptTestActionType = create_fhir_type( "TestScriptTestActionType", "fhir.resources.R4B.testscript.TestScriptTestAction" ) TestScriptVariableType = create_fhir_type( "TestScriptVariableType", "fhir.resources.R4B.testscript.TestScriptVariable" ) TimingType = create_fhir_type("TimingType", "fhir.resources.R4B.timing.Timing") TimingRepeatType = create_fhir_type( "TimingRepeatType", "fhir.resources.R4B.timing.TimingRepeat" ) TriggerDefinitionType = create_fhir_type( "TriggerDefinitionType", "fhir.resources.R4B.triggerdefinition.TriggerDefinition", ) UsageContextType = create_fhir_type( "UsageContextType", "fhir.resources.R4B.usagecontext.UsageContext" ) ValueSetType = create_fhir_type( "ValueSetType", "fhir.resources.R4B.valueset.ValueSet" ) ValueSetComposeType = create_fhir_type( "ValueSetComposeType", "fhir.resources.R4B.valueset.ValueSetCompose" ) ValueSetComposeIncludeType = create_fhir_type( "ValueSetComposeIncludeType", "fhir.resources.R4B.valueset.ValueSetComposeInclude", ) ValueSetComposeIncludeConceptType = create_fhir_type( "ValueSetComposeIncludeConceptType", "fhir.resources.R4B.valueset.ValueSetComposeIncludeConcept", ) ValueSetComposeIncludeConceptDesignationType = create_fhir_type( "ValueSetComposeIncludeConceptDesignationType", "fhir.resources.R4B.valueset.ValueSetComposeIncludeConceptDesignation", ) ValueSetComposeIncludeFilterType = create_fhir_type( "ValueSetComposeIncludeFilterType", "fhir.resources.R4B.valueset.ValueSetComposeIncludeFilter", ) ValueSetExpansionType = create_fhir_type( "ValueSetExpansionType", "fhir.resources.R4B.valueset.ValueSetExpansion" ) ValueSetExpansionContainsType = create_fhir_type( "ValueSetExpansionContainsType", "fhir.resources.R4B.valueset.ValueSetExpansionContains", ) ValueSetExpansionParameterType = create_fhir_type( "ValueSetExpansionParameterType", "fhir.resources.R4B.valueset.ValueSetExpansionParameter", ) VerificationResultType = create_fhir_type( "VerificationResultType", "fhir.resources.R4B.verificationresult.VerificationResult", ) VerificationResultAttestationType = create_fhir_type( "VerificationResultAttestationType", "fhir.resources.R4B.verificationresult.VerificationResultAttestation", ) VerificationResultPrimarySourceType = create_fhir_type( "VerificationResultPrimarySourceType", "fhir.resources.R4B.verificationresult.VerificationResultPrimarySource", ) VerificationResultValidatorType = create_fhir_type( "VerificationResultValidatorType", "fhir.resources.R4B.verificationresult.VerificationResultValidator", ) VisionPrescriptionType = create_fhir_type( "VisionPrescriptionType", "fhir.resources.R4B.visionprescription.VisionPrescription", ) VisionPrescriptionLensSpecificationType = create_fhir_type( "VisionPrescriptionLensSpecificationType", "fhir.resources.R4B.visionprescription.VisionPrescriptionLensSpecification", ) VisionPrescriptionLensSpecificationPrismType = create_fhir_type( "VisionPrescriptionLensSpecificationPrismType", "fhir.resources.R4B.visionprescription.VisionPrescriptionLensSpecificationPrism", ) __all__ = [ "BooleanType", "StringType", "Base64BinaryType", "CodeType", "IdType", "IntegerType", "Integer64Type", "DecimalType", "UnsignedIntType", "PositiveIntType", "CanonicalType", "UriType", "OidType", "UuidType", "UrlType", "MarkdownType", "XhtmlType", "DateType", "DateTimeType", "InstantType", "TimeType", "FHIRPrimitiveExtensionType", "AccountType", "AccountCoverageType", "AccountGuarantorType", "ActivityDefinitionType", "ActivityDefinitionDynamicValueType", "ActivityDefinitionParticipantType", "AddressType", "AdministrableProductDefinitionType", "AdministrableProductDefinitionPropertyType", "AdministrableProductDefinitionRouteOfAdministrationType", "AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesType", "AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodType", "AdverseEventType", "AdverseEventSuspectEntityType", "AdverseEventSuspectEntityCausalityType", "AgeType", "AllergyIntoleranceType", "AllergyIntoleranceReactionType", "AnnotationType", "AppointmentType", "AppointmentParticipantType", "AppointmentResponseType", "AttachmentType", "AuditEventType", "AuditEventAgentType", "AuditEventAgentNetworkType", "AuditEventEntityType", "AuditEventEntityDetailType", "AuditEventSourceType", "BackboneElementType", "BasicType", "BinaryType", "BiologicallyDerivedProductType", "BiologicallyDerivedProductCollectionType", "BiologicallyDerivedProductManipulationType", "BiologicallyDerivedProductProcessingType", "BiologicallyDerivedProductStorageType", "BodyStructureType", "BundleType", "BundleEntryType", "BundleEntryRequestType", "BundleEntryResponseType", "BundleEntrySearchType", "BundleLinkType", "CapabilityStatementType", "CapabilityStatementDocumentType", "CapabilityStatementImplementationType", "CapabilityStatementMessagingType", "CapabilityStatementMessagingEndpointType", "CapabilityStatementMessagingSupportedMessageType", "CapabilityStatementRestType", "CapabilityStatementRestInteractionType", "CapabilityStatementRestResourceType", "CapabilityStatementRestResourceInteractionType", "CapabilityStatementRestResourceOperationType", "CapabilityStatementRestResourceSearchParamType", "CapabilityStatementRestSecurityType", "CapabilityStatementSoftwareType", "CarePlanType", "CarePlanActivityType", "CarePlanActivityDetailType", "CareTeamType", "CareTeamParticipantType", "CatalogEntryType", "CatalogEntryRelatedEntryType", "ChargeItemType", "ChargeItemDefinitionType", "ChargeItemDefinitionApplicabilityType", "ChargeItemDefinitionPropertyGroupType", "ChargeItemDefinitionPropertyGroupPriceComponentType", "ChargeItemPerformerType", "CitationType", "CitationCitedArtifactType", "CitationCitedArtifactAbstractType", "CitationCitedArtifactClassificationType", "CitationCitedArtifactClassificationWhoClassifiedType", "CitationCitedArtifactContributorshipType", "CitationCitedArtifactContributorshipEntryType", "CitationCitedArtifactContributorshipEntryAffiliationInfoType", "CitationCitedArtifactContributorshipEntryContributionInstanceType", "CitationCitedArtifactContributorshipSummaryType", "CitationCitedArtifactPartType", "CitationCitedArtifactPublicationFormType", "CitationCitedArtifactPublicationFormPeriodicReleaseType", "CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationType", "CitationCitedArtifactPublicationFormPublishedInType", "CitationCitedArtifactRelatesToType", "CitationCitedArtifactStatusDateType", "CitationCitedArtifactTitleType", "CitationCitedArtifactVersionType", "CitationCitedArtifactWebLocationType", "CitationClassificationType", "CitationRelatesToType", "CitationStatusDateType", "CitationSummaryType", "ClaimType", "ClaimAccidentType", "ClaimCareTeamType", "ClaimDiagnosisType", "ClaimInsuranceType", "ClaimItemType", "ClaimItemDetailType", "ClaimItemDetailSubDetailType", "ClaimPayeeType", "ClaimProcedureType", "ClaimRelatedType", "ClaimResponseType", "ClaimResponseAddItemType", "ClaimResponseAddItemDetailType", "ClaimResponseAddItemDetailSubDetailType", "ClaimResponseErrorType", "ClaimResponseInsuranceType", "ClaimResponseItemType", "ClaimResponseItemAdjudicationType", "ClaimResponseItemDetailType", "ClaimResponseItemDetailSubDetailType", "ClaimResponsePaymentType", "ClaimResponseProcessNoteType", "ClaimResponseTotalType", "ClaimSupportingInfoType", "ClinicalImpressionType", "ClinicalImpressionFindingType", "ClinicalImpressionInvestigationType", "ClinicalUseDefinitionType", "ClinicalUseDefinitionContraindicationType", "ClinicalUseDefinitionContraindicationOtherTherapyType", "ClinicalUseDefinitionIndicationType", "ClinicalUseDefinitionInteractionType", "ClinicalUseDefinitionInteractionInteractantType", "ClinicalUseDefinitionUndesirableEffectType", "ClinicalUseDefinitionWarningType", "CodeSystemType", "CodeSystemConceptType", "CodeSystemConceptDesignationType", "CodeSystemConceptPropertyType", "CodeSystemFilterType", "CodeSystemPropertyType", "CodeableConceptType", "CodeableReferenceType", "CodingType", "CommunicationType", "CommunicationPayloadType", "CommunicationRequestType", "CommunicationRequestPayloadType", "CompartmentDefinitionType", "CompartmentDefinitionResourceType", "CompositionType", "CompositionAttesterType", "CompositionEventType", "CompositionRelatesToType", "CompositionSectionType", "ConceptMapType", "ConceptMapGroupType", "ConceptMapGroupElementType", "ConceptMapGroupElementTargetType", "ConceptMapGroupElementTargetDependsOnType", "ConceptMapGroupUnmappedType", "ConditionType", "ConditionEvidenceType", "ConditionStageType", "ConsentType", "ConsentPolicyType", "ConsentProvisionType", "ConsentProvisionActorType", "ConsentProvisionDataType", "ConsentVerificationType", "ContactDetailType", "ContactPointType", "ContractType", "ContractContentDefinitionType", "ContractFriendlyType", "ContractLegalType", "ContractRuleType", "ContractSignerType", "ContractTermType", "ContractTermActionType", "ContractTermActionSubjectType", "ContractTermAssetType", "ContractTermAssetContextType", "ContractTermAssetValuedItemType", "ContractTermOfferType", "ContractTermOfferAnswerType", "ContractTermOfferPartyType", "ContractTermSecurityLabelType", "ContributorType", "CountType", "CoverageType", "CoverageClassType", "CoverageCostToBeneficiaryType", "CoverageCostToBeneficiaryExceptionType", "CoverageEligibilityRequestType", "CoverageEligibilityRequestInsuranceType", "CoverageEligibilityRequestItemType", "CoverageEligibilityRequestItemDiagnosisType", "CoverageEligibilityRequestSupportingInfoType", "CoverageEligibilityResponseType", "CoverageEligibilityResponseErrorType", "CoverageEligibilityResponseInsuranceType", "CoverageEligibilityResponseInsuranceItemType", "CoverageEligibilityResponseInsuranceItemBenefitType", "DataRequirementType", "DataRequirementCodeFilterType", "DataRequirementDateFilterType", "DataRequirementSortType", "DetectedIssueType", "DetectedIssueEvidenceType", "DetectedIssueMitigationType", "DeviceType", "DeviceDefinitionType", "DeviceDefinitionCapabilityType", "DeviceDefinitionDeviceNameType", "DeviceDefinitionMaterialType", "DeviceDefinitionPropertyType", "DeviceDefinitionSpecializationType", "DeviceDefinitionUdiDeviceIdentifierType", "DeviceDeviceNameType", "DeviceMetricType", "DeviceMetricCalibrationType", "DevicePropertyType", "DeviceRequestType", "DeviceRequestParameterType", "DeviceSpecializationType", "DeviceUdiCarrierType", "DeviceUseStatementType", "DeviceVersionType", "DiagnosticReportType", "DiagnosticReportMediaType", "DistanceType", "DocumentManifestType", "DocumentManifestRelatedType", "DocumentReferenceType", "DocumentReferenceContentType", "DocumentReferenceContextType", "DocumentReferenceRelatesToType", "DomainResourceType", "DosageType", "DosageDoseAndRateType", "DurationType", "ElementType", "ElementDefinitionType", "ElementDefinitionBaseType", "ElementDefinitionBindingType", "ElementDefinitionConstraintType", "ElementDefinitionExampleType", "ElementDefinitionMappingType", "ElementDefinitionSlicingType", "ElementDefinitionSlicingDiscriminatorType", "ElementDefinitionTypeType", "EncounterType", "EncounterClassHistoryType", "EncounterDiagnosisType", "EncounterHospitalizationType", "EncounterLocationType", "EncounterParticipantType", "EncounterStatusHistoryType", "EndpointType", "EnrollmentRequestType", "EnrollmentResponseType", "EpisodeOfCareType", "EpisodeOfCareDiagnosisType", "EpisodeOfCareStatusHistoryType", "EventDefinitionType", "EvidenceType", "EvidenceCertaintyType", "EvidenceReportType", "EvidenceReportRelatesToType", "EvidenceReportSectionType", "EvidenceReportSubjectType", "EvidenceReportSubjectCharacteristicType", "EvidenceStatisticType", "EvidenceStatisticAttributeEstimateType", "EvidenceStatisticModelCharacteristicType", "EvidenceStatisticModelCharacteristicVariableType", "EvidenceStatisticSampleSizeType", "EvidenceVariableType", "EvidenceVariableCategoryType", "EvidenceVariableCharacteristicType", "EvidenceVariableCharacteristicTimeFromStartType", "EvidenceVariableDefinitionType", "ExampleScenarioType", "ExampleScenarioActorType", "ExampleScenarioInstanceType", "ExampleScenarioInstanceContainedInstanceType", "ExampleScenarioInstanceVersionType", "ExampleScenarioProcessType", "ExampleScenarioProcessStepType", "ExampleScenarioProcessStepAlternativeType", "ExampleScenarioProcessStepOperationType", "ExplanationOfBenefitType", "ExplanationOfBenefitAccidentType", "ExplanationOfBenefitAddItemType", "ExplanationOfBenefitAddItemDetailType", "ExplanationOfBenefitAddItemDetailSubDetailType", "ExplanationOfBenefitBenefitBalanceType", "ExplanationOfBenefitBenefitBalanceFinancialType", "ExplanationOfBenefitCareTeamType", "ExplanationOfBenefitDiagnosisType", "ExplanationOfBenefitInsuranceType", "ExplanationOfBenefitItemType", "ExplanationOfBenefitItemAdjudicationType", "ExplanationOfBenefitItemDetailType", "ExplanationOfBenefitItemDetailSubDetailType", "ExplanationOfBenefitPayeeType", "ExplanationOfBenefitPaymentType", "ExplanationOfBenefitProcedureType", "ExplanationOfBenefitProcessNoteType", "ExplanationOfBenefitRelatedType", "ExplanationOfBenefitSupportingInfoType", "ExplanationOfBenefitTotalType", "ExpressionType", "ExtensionType", "FamilyMemberHistoryType", "FamilyMemberHistoryConditionType", "FlagType", "GoalType", "GoalTargetType", "GraphDefinitionType", "GraphDefinitionLinkType", "GraphDefinitionLinkTargetType", "GraphDefinitionLinkTargetCompartmentType", "GroupType", "GroupCharacteristicType", "GroupMemberType", "GuidanceResponseType", "HealthcareServiceType", "HealthcareServiceAvailableTimeType", "HealthcareServiceEligibilityType", "HealthcareServiceNotAvailableType", "HumanNameType", "IdentifierType", "ImagingStudyType", "ImagingStudySeriesType", "ImagingStudySeriesInstanceType", "ImagingStudySeriesPerformerType", "ImmunizationType", "ImmunizationEducationType", "ImmunizationEvaluationType", "ImmunizationPerformerType", "ImmunizationProtocolAppliedType", "ImmunizationReactionType", "ImmunizationRecommendationType", "ImmunizationRecommendationRecommendationType", "ImmunizationRecommendationRecommendationDateCriterionType", "ImplementationGuideType", "ImplementationGuideDefinitionType", "ImplementationGuideDefinitionGroupingType", "ImplementationGuideDefinitionPageType", "ImplementationGuideDefinitionParameterType", "ImplementationGuideDefinitionResourceType", "ImplementationGuideDefinitionTemplateType", "ImplementationGuideDependsOnType", "ImplementationGuideGlobalType", "ImplementationGuideManifestType", "ImplementationGuideManifestPageType", "ImplementationGuideManifestResourceType", "IngredientType", "IngredientManufacturerType", "IngredientSubstanceType", "IngredientSubstanceStrengthType", "IngredientSubstanceStrengthReferenceStrengthType", "InsurancePlanType", "InsurancePlanContactType", "InsurancePlanCoverageType", "InsurancePlanCoverageBenefitType", "InsurancePlanCoverageBenefitLimitType", "InsurancePlanPlanType", "InsurancePlanPlanGeneralCostType", "InsurancePlanPlanSpecificCostType", "InsurancePlanPlanSpecificCostBenefitType", "InsurancePlanPlanSpecificCostBenefitCostType", "InvoiceType", "InvoiceLineItemType", "InvoiceLineItemPriceComponentType", "InvoiceParticipantType", "LibraryType", "LinkageType", "LinkageItemType", "ListType", "ListEntryType", "LocationType", "LocationHoursOfOperationType", "LocationPositionType", "ManufacturedItemDefinitionType", "ManufacturedItemDefinitionPropertyType", "MarketingStatusType", "MeasureType", "MeasureGroupType", "MeasureGroupPopulationType", "MeasureGroupStratifierType", "MeasureGroupStratifierComponentType", "MeasureReportType", "MeasureReportGroupType", "MeasureReportGroupPopulationType", "MeasureReportGroupStratifierType", "MeasureReportGroupStratifierStratumType", "MeasureReportGroupStratifierStratumComponentType", "MeasureReportGroupStratifierStratumPopulationType", "MeasureSupplementalDataType", "MediaType", "MedicationType", "MedicationAdministrationType", "MedicationAdministrationDosageType", "MedicationAdministrationPerformerType", "MedicationBatchType", "MedicationDispenseType", "MedicationDispensePerformerType", "MedicationDispenseSubstitutionType", "MedicationIngredientType", "MedicationKnowledgeType", "MedicationKnowledgeAdministrationGuidelinesType", "MedicationKnowledgeAdministrationGuidelinesDosageType", "MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsType", "MedicationKnowledgeCostType", "MedicationKnowledgeDrugCharacteristicType", "MedicationKnowledgeIngredientType", "MedicationKnowledgeKineticsType", "MedicationKnowledgeMedicineClassificationType", "MedicationKnowledgeMonitoringProgramType", "MedicationKnowledgeMonographType", "MedicationKnowledgePackagingType", "MedicationKnowledgeRegulatoryType", "MedicationKnowledgeRegulatoryMaxDispenseType", "MedicationKnowledgeRegulatoryScheduleType", "MedicationKnowledgeRegulatorySubstitutionType", "MedicationKnowledgeRelatedMedicationKnowledgeType", "MedicationRequestType", "MedicationRequestDispenseRequestType", "MedicationRequestDispenseRequestInitialFillType", "MedicationRequestSubstitutionType", "MedicationStatementType", "MedicinalProductDefinitionType", "MedicinalProductDefinitionCharacteristicType", "MedicinalProductDefinitionContactType", "MedicinalProductDefinitionCrossReferenceType", "MedicinalProductDefinitionNameType", "MedicinalProductDefinitionNameCountryLanguageType", "MedicinalProductDefinitionNameNamePartType", "MedicinalProductDefinitionOperationType", "MessageDefinitionType", "MessageDefinitionAllowedResponseType", "MessageDefinitionFocusType", "MessageHeaderType", "MessageHeaderDestinationType", "MessageHeaderResponseType", "MessageHeaderSourceType", "MetaType", "MolecularSequenceType", "MolecularSequenceQualityType", "MolecularSequenceQualityRocType", "MolecularSequenceReferenceSeqType", "MolecularSequenceRepositoryType", "MolecularSequenceStructureVariantType", "MolecularSequenceStructureVariantInnerType", "MolecularSequenceStructureVariantOuterType", "MolecularSequenceVariantType", "MoneyType", "NamingSystemType", "NamingSystemUniqueIdType", "NarrativeType", "NutritionOrderType", "NutritionOrderEnteralFormulaType", "NutritionOrderEnteralFormulaAdministrationType", "NutritionOrderOralDietType", "NutritionOrderOralDietNutrientType", "NutritionOrderOralDietTextureType", "NutritionOrderSupplementType", "NutritionProductType", "NutritionProductIngredientType", "NutritionProductInstanceType", "NutritionProductNutrientType", "NutritionProductProductCharacteristicType", "ObservationType", "ObservationComponentType", "ObservationDefinitionType", "ObservationDefinitionQualifiedIntervalType", "ObservationDefinitionQuantitativeDetailsType", "ObservationReferenceRangeType", "OperationDefinitionType", "OperationDefinitionOverloadType", "OperationDefinitionParameterType", "OperationDefinitionParameterBindingType", "OperationDefinitionParameterReferencedFromType", "OperationOutcomeType", "OperationOutcomeIssueType", "OrganizationType", "OrganizationAffiliationType", "OrganizationContactType", "PackagedProductDefinitionType", "PackagedProductDefinitionLegalStatusOfSupplyType", "PackagedProductDefinitionPackageType", "PackagedProductDefinitionPackageContainedItemType", "PackagedProductDefinitionPackagePropertyType", "PackagedProductDefinitionPackageShelfLifeStorageType", "ParameterDefinitionType", "ParametersType", "ParametersParameterType", "PatientType", "PatientCommunicationType", "PatientContactType", "PatientLinkType", "PaymentNoticeType", "PaymentReconciliationType", "PaymentReconciliationDetailType", "PaymentReconciliationProcessNoteType", "PeriodType", "PersonType", "PersonLinkType", "PlanDefinitionType", "PlanDefinitionActionType", "PlanDefinitionActionConditionType", "PlanDefinitionActionDynamicValueType", "PlanDefinitionActionParticipantType", "PlanDefinitionActionRelatedActionType", "PlanDefinitionGoalType", "PlanDefinitionGoalTargetType", "PopulationType", "PractitionerType", "PractitionerQualificationType", "PractitionerRoleType", "PractitionerRoleAvailableTimeType", "PractitionerRoleNotAvailableType", "ProcedureType", "ProcedureFocalDeviceType", "ProcedurePerformerType", "ProdCharacteristicType", "ProductShelfLifeType", "ProvenanceType", "ProvenanceAgentType", "ProvenanceEntityType", "QuantityType", "QuestionnaireType", "QuestionnaireItemType", "QuestionnaireItemAnswerOptionType", "QuestionnaireItemEnableWhenType", "QuestionnaireItemInitialType", "QuestionnaireResponseType", "QuestionnaireResponseItemType", "QuestionnaireResponseItemAnswerType", "RangeType", "RatioType", "RatioRangeType", "ReferenceType", "RegulatedAuthorizationType", "RegulatedAuthorizationCaseType", "RelatedArtifactType", "RelatedPersonType", "RelatedPersonCommunicationType", "RequestGroupType", "RequestGroupActionType", "RequestGroupActionConditionType", "RequestGroupActionRelatedActionType", "ResearchDefinitionType", "ResearchElementDefinitionType", "ResearchElementDefinitionCharacteristicType", "ResearchStudyType", "ResearchStudyArmType", "ResearchStudyObjectiveType", "ResearchSubjectType", "ResourceType", "RiskAssessmentType", "RiskAssessmentPredictionType", "SampledDataType", "ScheduleType", "SearchParameterType", "SearchParameterComponentType", "ServiceRequestType", "SignatureType", "SlotType", "SpecimenType", "SpecimenCollectionType", "SpecimenContainerType", "SpecimenDefinitionType", "SpecimenDefinitionTypeTestedType", "SpecimenDefinitionTypeTestedContainerType", "SpecimenDefinitionTypeTestedContainerAdditiveType", "SpecimenDefinitionTypeTestedHandlingType", "SpecimenProcessingType", "StructureDefinitionType", "StructureDefinitionContextType", "StructureDefinitionDifferentialType", "StructureDefinitionMappingType", "StructureDefinitionSnapshotType", "StructureMapType", "StructureMapGroupType", "StructureMapGroupInputType", "StructureMapGroupRuleType", "StructureMapGroupRuleDependentType", "StructureMapGroupRuleSourceType", "StructureMapGroupRuleTargetType", "StructureMapGroupRuleTargetParameterType", "StructureMapStructureType", "SubscriptionType", "SubscriptionChannelType", "SubscriptionStatusType", "SubscriptionStatusNotificationEventType", "SubscriptionTopicType", "SubscriptionTopicCanFilterByType", "SubscriptionTopicEventTriggerType", "SubscriptionTopicNotificationShapeType", "SubscriptionTopicResourceTriggerType", "SubscriptionTopicResourceTriggerQueryCriteriaType", "SubstanceType", "SubstanceDefinitionType", "SubstanceDefinitionCodeType", "SubstanceDefinitionMoietyType", "SubstanceDefinitionMolecularWeightType", "SubstanceDefinitionNameType", "SubstanceDefinitionNameOfficialType", "SubstanceDefinitionPropertyType", "SubstanceDefinitionRelationshipType", "SubstanceDefinitionSourceMaterialType", "SubstanceDefinitionStructureType", "SubstanceDefinitionStructureRepresentationType", "SubstanceIngredientType", "SubstanceInstanceType", "SupplyDeliveryType", "SupplyDeliverySuppliedItemType", "SupplyRequestType", "SupplyRequestParameterType", "TaskType", "TaskInputType", "TaskOutputType", "TaskRestrictionType", "TerminologyCapabilitiesType", "TerminologyCapabilitiesClosureType", "TerminologyCapabilitiesCodeSystemType", "TerminologyCapabilitiesCodeSystemVersionType", "TerminologyCapabilitiesCodeSystemVersionFilterType", "TerminologyCapabilitiesExpansionType", "TerminologyCapabilitiesExpansionParameterType", "TerminologyCapabilitiesImplementationType", "TerminologyCapabilitiesSoftwareType", "TerminologyCapabilitiesTranslationType", "TerminologyCapabilitiesValidateCodeType", "TestReportType", "TestReportParticipantType", "TestReportSetupType", "TestReportSetupActionType", "TestReportSetupActionAssertType", "TestReportSetupActionOperationType", "TestReportTeardownType", "TestReportTeardownActionType", "TestReportTestType", "TestReportTestActionType", "TestScriptType", "TestScriptDestinationType", "TestScriptFixtureType", "TestScriptMetadataType", "TestScriptMetadataCapabilityType", "TestScriptMetadataLinkType", "TestScriptOriginType", "TestScriptSetupType", "TestScriptSetupActionType", "TestScriptSetupActionAssertType", "TestScriptSetupActionOperationType", "TestScriptSetupActionOperationRequestHeaderType", "TestScriptTeardownType", "TestScriptTeardownActionType", "TestScriptTestType", "TestScriptTestActionType", "TestScriptVariableType", "TimingType", "TimingRepeatType", "TriggerDefinitionType", "UsageContextType", "ValueSetType", "ValueSetComposeType", "ValueSetComposeIncludeType", "ValueSetComposeIncludeConceptType", "ValueSetComposeIncludeConceptDesignationType", "ValueSetComposeIncludeFilterType", "ValueSetExpansionType", "ValueSetExpansionContainsType", "ValueSetExpansionParameterType", "VerificationResultType", "VerificationResultAttestationType", "VerificationResultPrimarySourceType", "VerificationResultValidatorType", "VisionPrescriptionType", "VisionPrescriptionLensSpecificationType", "VisionPrescriptionLensSpecificationPrismType", ] ================================================ FILE: fhir/resources/R4B/flag.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Flag Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class Flag(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Key information to flag to healthcare providers. Prospective warnings of potential issues when providing care to the patient. """ __resource_type__ = "Flag" author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="Flag creator", description="The person, organization or device that created the flag.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Organization", "Patient", "Practitioner", "PractitionerRole", ], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Clinical, administrative, etc.", description=( "Allows a flag to be divided into different categories like clinical, " "administrative etc. Intended to be used as a means of filtering which " "flags are displayed to particular user or in a given context." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Coded or textual message to display to user", description=( "The coded value or textual component of the flag to display to the " "user." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Alert relevant during encounter", description="This alert is only relevant during the encounter.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description=( "Business identifiers assigned to this flag by the performer or other " "systems which remain constant as the resource is updated and " "propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period when flag is active", description=( "The period of time from the activation of the flag to inactivation of " "the flag. If the flag is active, the end of the period should be " "unspecified." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | inactive | entered-in-error", description="Supports basic workflow.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "inactive", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who/What is flag about?", description=( "The patient, location, group, organization, or practitioner etc. this " "is about record this flag is associated with." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Location", "Group", "Organization", "Practitioner", "PlanDefinition", "Medication", "Procedure", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Flag`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "category", "code", "subject", "period", "encounter", "author", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Flag`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "category", "code", "subject", "period", "encounter", "author", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/goal.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Goal Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Goal(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Describes the intended objective(s) for a patient, group or organization. Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc. """ __resource_type__ = "Goal" achievementStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="achievementStatus", title=( "in-progress | improving | worsening | no-change | achieved | " "sustaining | not-achieved | no-progress | not-attainable" ), description=( "Describes the progression, or lack thereof, towards the goal against " "the target." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) addresses: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="addresses", title="Issues addressed by this goal", description=( "The identified conditions and other health record elements that are " "intended to be addressed by the goal." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "MedicationStatement", "NutritionOrder", "ServiceRequest", "RiskAssessment", ], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="E.g. Treatment, dietary, behavioral, etc.", description="Indicates a category the goal falls within.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.CodeableConceptType = Field( default=..., alias="description", title="Code or text describing goal", description=( "Human-readable and/or coded description of a specific desired " 'objective of care, such as "control blood pressure" or "negotiate an ' 'obstacle course" or "dance with child at wedding".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) expressedBy: fhirtypes.ReferenceType | None = Field( default=None, alias="expressedBy", title="Who's responsible for creating Goal?", description="Indicates whose goal this is - patient goal, practitioner goal, etc.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", ], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Ids for this goal", description=( "Business identifiers assigned to this goal by the performer or other " "systems which remain constant as the resource is updated and " "propagates from server to server." ), json_schema_extra={ "element_property": True, }, ) lifecycleStatus: fhirtypes.CodeType | None = Field( default=None, alias="lifecycleStatus", title=( "proposed | planned | accepted | active | on-hold | completed | " "cancelled | entered-in-error | rejected" ), description="The state of the goal throughout its lifecycle.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "proposed", "planned", "accepted", "active", "on-hold", "completed", "cancelled", "entered-in-error", "rejected", ], }, ) lifecycleStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lifecycleStatus", title="Extension field for ``lifecycleStatus``.", ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments about the goal", description="Any comments related to the goal.", json_schema_extra={ "element_property": True, }, ) outcomeCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="outcomeCode", title="What result was achieved regarding the goal?", description=( "Identifies the change (or lack of change) at the point when the status" " of the goal is assessed." ), json_schema_extra={ "element_property": True, }, ) outcomeReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="outcomeReference", title="Observation that resulted from goal", description="Details of what's changed (or not changed).", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Observation"], }, ) priority: fhirtypes.CodeableConceptType | None = Field( default=None, alias="priority", title="high-priority | medium-priority | low-priority", description=( "Identifies the mutually agreed level of importance associated with " "reaching/sustaining the goal." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) startCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="startCodeableConcept", title="When goal pursuit begins", description="The date or event after which the goal should begin being pursued.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e start[x] "one_of_many": "start", "one_of_many_required": False, }, ) startDate: fhirtypes.DateType | None = Field( default=None, alias="startDate", title="When goal pursuit begins", description="The date or event after which the goal should begin being pursued.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e start[x] "one_of_many": "start", "one_of_many_required": False, }, ) startDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_startDate", title="Extension field for ``startDate``." ) statusDate: fhirtypes.DateType | None = Field( default=None, alias="statusDate", title="When goal status took effect", description=( "Identifies when the current status. I.e. When initially created, when" " achieved, when cancelled, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_statusDate", title="Extension field for ``statusDate``." ) statusReason: fhirtypes.StringType | None = Field( default=None, alias="statusReason", title="Reason for current status", description="Captures the reason for the current status.", json_schema_extra={ "element_property": True, }, ) statusReason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_statusReason", title="Extension field for ``statusReason``.", ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who this goal is intended for", description=( "Identifies the patient, group or organization for whom the goal is " "being established." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group", "Organization"], }, ) target: typing.List[fhirtypes.GoalTargetType] | None = Field( default=None, alias="target", title="Target outcome for the goal", description="Indicates what should be done by when.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Goal`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "lifecycleStatus", "achievementStatus", "category", "priority", "description", "subject", "startDate", "startCodeableConcept", "target", "statusDate", "statusReason", "expressedBy", "addresses", "note", "outcomeCode", "outcomeReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Goal`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "lifecycleStatus", "achievementStatus", "category", "priority", "description", "subject", "startDate", "startCodeableConcept", "statusDate", "expressedBy", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("lifecycleStatus", "lifecycleStatus__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"start": ["startCodeableConcept", "startDate"]} return one_of_many_fields class GoalTarget(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Target outcome for the goal. Indicates what should be done by when. """ __resource_type__ = "GoalTarget" detailBoolean: bool | None = Field( default=None, alias="detailBoolean", title="The target value to be achieved", description=( "The target value of the focus to be achieved to signify the " "fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low" " or both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any focus value at " "or below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any focus value at or above the" " low value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detailBoolean", title="Extension field for ``detailBoolean``.", ) detailCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="detailCodeableConcept", title="The target value to be achieved", description=( "The target value of the focus to be achieved to signify the " "fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low" " or both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any focus value at " "or below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any focus value at or above the" " low value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailInteger: fhirtypes.IntegerType | None = Field( default=None, alias="detailInteger", title="The target value to be achieved", description=( "The target value of the focus to be achieved to signify the " "fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low" " or both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any focus value at " "or below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any focus value at or above the" " low value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detailInteger", title="Extension field for ``detailInteger``.", ) detailQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="detailQuantity", title="The target value to be achieved", description=( "The target value of the focus to be achieved to signify the " "fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low" " or both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any focus value at " "or below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any focus value at or above the" " low value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailRange: fhirtypes.RangeType | None = Field( default=None, alias="detailRange", title="The target value to be achieved", description=( "The target value of the focus to be achieved to signify the " "fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low" " or both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any focus value at " "or below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any focus value at or above the" " low value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailRatio: fhirtypes.RatioType | None = Field( default=None, alias="detailRatio", title="The target value to be achieved", description=( "The target value of the focus to be achieved to signify the " "fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low" " or both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any focus value at " "or below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any focus value at or above the" " low value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailString: fhirtypes.StringType | None = Field( default=None, alias="detailString", title="The target value to be achieved", description=( "The target value of the focus to be achieved to signify the " "fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low" " or both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any focus value at " "or below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any focus value at or above the" " low value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detailString", title="Extension field for ``detailString``.", ) dueDate: fhirtypes.DateType | None = Field( default=None, alias="dueDate", title="Reach goal on or before", description=( "Indicates either the date or the duration after start by which the " "goal should be met." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e due[x] "one_of_many": "due", "one_of_many_required": False, }, ) dueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dueDate", title="Extension field for ``dueDate``." ) dueDuration: fhirtypes.DurationType | None = Field( default=None, alias="dueDuration", title="Reach goal on or before", description=( "Indicates either the date or the duration after start by which the " "goal should be met." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e due[x] "one_of_many": "due", "one_of_many_required": False, }, ) measure: fhirtypes.CodeableConceptType | None = Field( default=None, alias="measure", title="The parameter whose value is being tracked", description=( "The parameter whose value is being tracked, e.g. body weight, blood " "pressure, or hemoglobin A1c level." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GoalTarget`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "measure", "detailQuantity", "detailRange", "detailCodeableConcept", "detailString", "detailBoolean", "detailInteger", "detailRatio", "dueDate", "dueDuration", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GoalTarget`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "measure", "detailQuantity", "detailRange", "detailCodeableConcept", "detailString", "detailBoolean", "detailInteger", "detailRatio", "dueDate", "dueDuration", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "detail": [ "detailBoolean", "detailCodeableConcept", "detailInteger", "detailQuantity", "detailRange", "detailRatio", "detailString", ], "due": ["dueDate", "dueDuration"], } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/graphdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/GraphDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class GraphDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of a graph of resources. A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set. """ __resource_type__ = "GraphDefinition" contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the graph definition was " "published. The date must change when the business version changes and " "it must change if the status code changes. In addition, it should " "change when the substantive content of the graph definition changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the graph definition", description=( "A free text natural language description of the graph definition from " "a consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this graph definition is authored for" " testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for graph definition (if applicable)", description=( "A legal or geographic region in which the graph definition is intended" " to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) link: typing.List[fhirtypes.GraphDefinitionLinkType] | None = Field( default=None, alias="link", title="Links this graph makes rules about", description=None, json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this graph definition (computer friendly)", description=( "A natural language name identifying the graph definition. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) profile: fhirtypes.CanonicalType | None = Field( default=None, alias="profile", title="Profile on base resource", description="The profile that describes the use of the base resource.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the graph " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this graph definition is defined", description=( "Explanation of why this graph definition is needed and why it has been" " designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) start: fhirtypes.CodeType | None = Field( default=None, alias="start", title="Type of resource at which the graph starts", description="The type of FHIR resource at which instances of this graph start.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_start", title="Extension field for ``start``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this graph definition. Enables tracking the life-cycle " "of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this graph definition, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this graph definition when it" " is referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which at which an authoritative " "instance of this graph definition is (or will be) published. This URL " "can be the target of a canonical reference. It SHALL remain the same " "when the graph definition is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate graph definition instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the graph definition", description=( "The identifier that is used to identify this version of the graph " "definition when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the graph definition " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GraphDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "version", "name", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "start", "profile", "link", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GraphDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "version", "name", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "start", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("name", "name__ext"), ("start", "start__ext"), ("status", "status__ext"), ] return required_fields class GraphDefinitionLink(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Links this graph makes rules about. """ __resource_type__ = "GraphDefinitionLink" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Why this link is specified", description=( "Information about why this link is of interest in this graph " "definition." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) max: fhirtypes.StringType | None = Field( default=None, alias="max", title="Maximum occurrences for this link", description=None, json_schema_extra={ "element_property": True, }, ) max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_max", title="Extension field for ``max``." ) min: fhirtypes.IntegerType | None = Field( default=None, alias="min", title="Minimum occurrences for this link", description=None, json_schema_extra={ "element_property": True, }, ) min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_min", title="Extension field for ``min``." ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="Path in the resource that contains the link", description=( "A FHIR expression that identifies one of FHIR References to other " "resources." ), json_schema_extra={ "element_property": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) sliceName: fhirtypes.StringType | None = Field( default=None, alias="sliceName", title="Which slice (if profiled)", description=None, json_schema_extra={ "element_property": True, }, ) sliceName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sliceName", title="Extension field for ``sliceName``." ) target: typing.List[fhirtypes.GraphDefinitionLinkTargetType] | None = Field( default=None, alias="target", title="Potential target for the link", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GraphDefinitionLink`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "path", "sliceName", "min", "max", "description", "target", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GraphDefinitionLink`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class GraphDefinitionLinkTarget(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Potential target for the link. """ __resource_type__ = "GraphDefinitionLinkTarget" compartment: typing.List[ fhirtypes.GraphDefinitionLinkTargetCompartmentType ] | None = Field( default=None, alias="compartment", title="Compartment Consistency Rules", description=None, json_schema_extra={ "element_property": True, }, ) link: typing.List[fhirtypes.GraphDefinitionLinkType] | None = Field( default=None, alias="link", title="Additional links from target resource", description=None, json_schema_extra={ "element_property": True, }, ) params: fhirtypes.StringType | None = Field( default=None, alias="params", title="Criteria for reverse lookup", description="A set of parameters to look up.", json_schema_extra={ "element_property": True, }, ) params__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_params", title="Extension field for ``params``." ) profile: fhirtypes.CanonicalType | None = Field( default=None, alias="profile", title="Profile for the target resource", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="Type of resource this link refers to", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GraphDefinitionLinkTarget`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "params", "profile", "compartment", "link", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GraphDefinitionLinkTarget`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields class GraphDefinitionLinkTargetCompartment(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Compartment Consistency Rules. """ __resource_type__ = "GraphDefinitionLinkTargetCompartment" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Patient | Encounter | RelatedPerson | Practitioner | Device", description="Identifies the compartment.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "Patient", "Encounter", "RelatedPerson", "Practitioner", "Device", ], }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Documentation for FHIRPath expression", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="Custom rule, as a FHIRPath expression", description=None, json_schema_extra={ "element_property": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) rule: fhirtypes.CodeType | None = Field( default=None, alias="rule", title="identical | matching | different | custom", description="identical | matching | different | no-rule | custom.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["identical", "matching", "different", "custom"], }, ) rule__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rule", title="Extension field for ``rule``." ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="condition | requirement", description=( "Defines how the compartment rule is used - whether it it is used to " "test whether resources are subject to the rule, or whether it is a " "rule that must be followed." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["condition", "requirement"], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GraphDefinitionLinkTargetCompartment`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "use", "code", "rule", "expression", "description", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GraphDefinitionLinkTargetCompartment`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("code", "code__ext"), ("rule", "rule__ext"), ("use", "use__ext"), ] return required_fields ================================================ FILE: fhir/resources/R4B/group.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Group Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Group(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Group of multiple entities. Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively, and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization. """ __resource_type__ = "Group" active: bool | None = Field( default=None, alias="active", title="Whether this group's record is in active use", description=( "Indicates whether the record for the group is available for use or is " "merely being retained for historical purposes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) actual: bool | None = Field( default=None, alias="actual", title="Descriptive or actual", description=( "If true, indicates that the resource refers to a specific group of " "real individuals. If false, the group defines a set of intended " "individuals." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) actual__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_actual", title="Extension field for ``actual``." ) characteristic: typing.List[fhirtypes.GroupCharacteristicType] | None = Field( default=None, alias="characteristic", title="Include / Exclude group members by Trait", description=( "Identifies traits whose presence r absence is shared by members of the" " group." ), json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Kind of Group members", description=( 'Provides a specific type of resource the group includes; e.g. "cow", ' '"syringe", etc.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique id", description="A unique business identifier for this group.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) managingEntity: fhirtypes.ReferenceType | None = Field( default=None, alias="managingEntity", title="Entity that is the custodian of the Group's definition", description=( "Entity responsible for defining and maintaining Group characteristics " "and/or registered members." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Organization", "RelatedPerson", "Practitioner", "PractitionerRole", ], }, ) member: typing.List[fhirtypes.GroupMemberType] | None = Field( default=None, alias="member", title="Who or what is in group", description="Identifies the resource instances that are members of the group.", json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Label for Group", description=( "A label assigned to the group for human identification and " "communication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) quantity: fhirtypes.UnsignedIntType | None = Field( default=None, alias="quantity", title="Number of members", description=( "A count of the number of resource instances that are part of the " "group." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) quantity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_quantity", title="Extension field for ``quantity``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="person | animal | practitioner | device | medication | substance", description=( "Identifies the broad classification of the kind of resources the group" " includes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "person", "animal", "practitioner", "device", "medication", "substance", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Group`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "type", "actual", "code", "name", "quantity", "managingEntity", "characteristic", "member", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Group`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "active", "type", "actual", "code", "name", "quantity", "managingEntity", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("actual", "actual__ext"), ("type", "type__ext")] return required_fields class GroupCharacteristic(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Include / Exclude group members by Trait. Identifies traits whose presence r absence is shared by members of the group. """ __resource_type__ = "GroupCharacteristic" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Kind of characteristic", description="A code that identifies the kind of trait being asserted.", json_schema_extra={ "element_property": True, }, ) exclude: bool | None = Field( default=None, alias="exclude", title="Group includes or excludes", description=( "If true, indicates the characteristic is one that is NOT held by " "members of the group." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) exclude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_exclude", title="Extension field for ``exclude``." ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Period over which characteristic is tested", description=( "The period over which the characteristic is tested; e.g. the patient " "had an operation during the month of June." ), json_schema_extra={ "element_property": True, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value held by characteristic", description=( "The value of the trait that holds (or does not hold - see 'exclude') " "for members of the group." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Value held by characteristic", description=( "The value of the trait that holds (or does not hold - see 'exclude') " "for members of the group." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Value held by characteristic", description=( "The value of the trait that holds (or does not hold - see 'exclude') " "for members of the group." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Value held by characteristic", description=( "The value of the trait that holds (or does not hold - see 'exclude') " "for members of the group." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Value held by characteristic", description=( "The value of the trait that holds (or does not hold - see 'exclude') " "for members of the group." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GroupCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "valueCodeableConcept", "valueBoolean", "valueQuantity", "valueRange", "valueReference", "exclude", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GroupCharacteristic`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("exclude", "exclude__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueCodeableConcept", "valueQuantity", "valueRange", "valueReference", ] } return one_of_many_fields class GroupMember(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who or what is in group. Identifies the resource instances that are members of the group. """ __resource_type__ = "GroupMember" entity: fhirtypes.ReferenceType = Field( default=..., alias="entity", title="Reference to the group member", description=( "A reference to the entity that is a member of the group. Must be " "consistent with Group.type. If the entity is another group, then the " "type must be the same." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "RelatedPerson", "Practitioner", "PractitionerRole", "Device", "Medication", "Substance", "Group", ], }, ) inactive: bool | None = Field( default=None, alias="inactive", title="If member is no longer in group", description=( "A flag to indicate that the member is no longer in the group, but " "previously may have been a member." ), json_schema_extra={ "element_property": True, }, ) inactive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_inactive", title="Extension field for ``inactive``." ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Period member belonged to the group", description="The period that the member was in the group, if known.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GroupMember`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "entity", "period", "inactive"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GroupMember`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/guidanceresponse.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/GuidanceResponse Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class GuidanceResponse(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The formal response to a guidance request. A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken. """ __resource_type__ = "GuidanceResponse" dataRequirement: typing.List[fhirtypes.DataRequirementType] | None = Field( default=None, alias="dataRequirement", title="Additional required data", description=( "If the evaluation could not be completed due to lack of information, " "or additional information would potentially result in a more accurate " "response, this element will a description of the data required in " "order to proceed with the evaluation. A subsequent request to the " "service should include this data." ), json_schema_extra={ "element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter during which the response was returned", description=( "The encounter during which this response was created or to which the " "creation of this record is tightly associated." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) evaluationMessage: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="evaluationMessage", title="Messages resulting from the evaluation of the artifact or artifacts", description=( "Messages resulting from the evaluation of the artifact or artifacts. " "As part of evaluating the request, the engine may produce " "informational or warning messages. These messages will be provided by " "this element." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["OperationOutcome"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description=( "Allows a service to provide unique, business identifiers for the " "response." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) moduleCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="moduleCanonical", title="What guidance was requested", description=( "An identifier, CodeableConcept or canonical reference to the guidance " "that was requested." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e module[x] "one_of_many": "module", "one_of_many_required": True, }, ) moduleCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_moduleCanonical", title="Extension field for ``moduleCanonical``.", ) moduleCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="moduleCodeableConcept", title="What guidance was requested", description=( "An identifier, CodeableConcept or canonical reference to the guidance " "that was requested." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e module[x] "one_of_many": "module", "one_of_many_required": True, }, ) moduleUri: fhirtypes.UriType | None = Field( default=None, alias="moduleUri", title="What guidance was requested", description=( "An identifier, CodeableConcept or canonical reference to the guidance " "that was requested." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e module[x] "one_of_many": "module", "one_of_many_required": True, }, ) moduleUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_moduleUri", title="Extension field for ``moduleUri``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Additional notes about the response", description=( "Provides a mechanism to communicate additional information about the " "response." ), json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When the guidance response was processed", description="Indicates when the guidance response was processed.", json_schema_extra={ "element_property": True, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) outputParameters: fhirtypes.ReferenceType | None = Field( default=None, alias="outputParameters", title="The output parameters of the evaluation, if any", description=( "The output parameters of the evaluation, if any. Many modules will " "result in the return of specific resources such as procedure or " "communication requests that are returned as part of the operation " "result. However, modules may define specific outputs that would be " "returned as the result of the evaluation, and these would be returned " "in this element." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Parameters"], }, ) performer: fhirtypes.ReferenceType | None = Field( default=None, alias="performer", title="Device returning the guidance", description="Provides a reference to the device that performed the guidance.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Why guidance is needed", description=( "Describes the reason for the guidance response in coded or textual " "form." ), json_schema_extra={ "element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Why guidance is needed", description=( "Indicates the reason the request was initiated. This is typically " "provided as a parameter to the evaluation and echoed by the service, " "although for some use cases, such as subscription- or event-based " "scenarios, it may provide an indication of the cause for the response." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "DiagnosticReport", "DocumentReference", ], }, ) requestIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="requestIdentifier", title="The identifier of the request associated with this response, if any", description=( "The identifier of the request associated with this response. If an " "identifier was given as part of the request, it will be reproduced " "here to enable the requester to more easily identify the response in a" " multi-request scenario." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) result: fhirtypes.ReferenceType | None = Field( default=None, alias="result", title="Proposed actions, if any", description="The actions, if any, produced by the evaluation of the artifact.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CarePlan", "RequestGroup"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "success | data-requested | data-required | in-progress | failure | " "entered-in-error" ), description=( "The status of the response. If the evaluation is completed " "successfully, the status will indicate success. However, in order to " "complete the evaluation, the engine may require more information. In " "this case, the status will be data-required, and the response will " "contain a description of the additional required information. If the " "evaluation completed successfully, but the engine determines that a " "potentially more accurate response could be provided if more data was " "available, the status will be data-requested, and the response will " "contain a description of the additional requested information." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "success", "data-requested", "data-required", "in-progress", "failure", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Patient the request was performed for", description="The patient for which the request was processed.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GuidanceResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "requestIdentifier", "identifier", "moduleUri", "moduleCanonical", "moduleCodeableConcept", "status", "subject", "encounter", "occurrenceDateTime", "performer", "reasonCode", "reasonReference", "note", "evaluationMessage", "outputParameters", "result", "dataRequirement", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GuidanceResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "requestIdentifier", "identifier", "moduleUri", "moduleCanonical", "moduleCodeableConcept", "status", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "module": ["moduleCanonical", "moduleCodeableConcept", "moduleUri"] } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/healthcareservice.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/HealthcareService Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class HealthcareService(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The details of a healthcare service available at a location. """ __resource_type__ = "HealthcareService" active: bool | None = Field( default=None, alias="active", title="Whether this HealthcareService record is in active use", description=( "This flag is used to mark the record to not be used. This is not used " "when a center is closed for maintenance, or for holidays, the " "notAvailable period is to be used for this." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) appointmentRequired: bool | None = Field( default=None, alias="appointmentRequired", title="If an appointment is required for access to this service", description=( "Indicates whether or not a prospective consumer will require an " "appointment for a particular service at a site to be provided by the " "Organization. Indicates if an appointment is required for access to " "this service." ), json_schema_extra={ "element_property": True, }, ) appointmentRequired__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_appointmentRequired", title="Extension field for ``appointmentRequired``.", ) availabilityExceptions: fhirtypes.StringType | None = Field( default=None, alias="availabilityExceptions", title="Description of availability exceptions", description=( "A description of site availability exceptions, e.g. public holiday " "availability. Succinctly describing all possible exceptions to normal " "site availability as details in the available Times and not available " "Times." ), json_schema_extra={ "element_property": True, }, ) availabilityExceptions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_availabilityExceptions", title="Extension field for ``availabilityExceptions``.", ) availableTime: typing.List[ fhirtypes.HealthcareServiceAvailableTimeType ] | None = Field( default=None, alias="availableTime", title="Times the Service Site is available", description="A collection of times that the Service Site is available.", json_schema_extra={ "element_property": True, }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Broad category of service being performed or delivered", description="Identifies the broad category of service being performed or delivered.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) characteristic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="characteristic", title="Collection of characteristics (attributes)", description=None, json_schema_extra={ "element_property": True, }, ) comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title=( "Additional description and/or any specific issues not covered " "elsewhere" ), description=( "Any additional description of the service and/or any specific issues " "not covered by the other attributes, which can be displayed as further" " detail under the serviceName." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) communication: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="communication", title="The language that this service is offered in", description=( "Some services are specifically made available in multiple languages, " "this property permits a directory to declare the languages this is " "offered in. Typically this is only provided where a service operates " "in communities with mixed languages used." ), json_schema_extra={ "element_property": True, }, ) coverageArea: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="coverageArea", title="Location(s) service is intended for/available to", description=( "The location(s) that this service is available to (not where the " "service is provided)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) eligibility: typing.List[fhirtypes.HealthcareServiceEligibilityType] | None = Field( default=None, alias="eligibility", title="Specific eligibility requirements required to use the service", description=( "Does this service have specific eligibility requirements that need to " "be met in order to use the service?" ), json_schema_extra={ "element_property": True, }, ) endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title=( "Technical endpoints providing access to electronic services operated " "for the healthcare service" ), description=( "Technical endpoints providing access to services operated for the " "specific healthcare services defined at this resource." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) extraDetails: fhirtypes.MarkdownType | None = Field( default=None, alias="extraDetails", title=( "Extra details about the service that can't be placed in the other " "fields" ), description=None, json_schema_extra={ "element_property": True, }, ) extraDetails__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_extraDetails", title="Extension field for ``extraDetails``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External identifiers for this item", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) location: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="location", title="Location(s) where service may be provided", description="The location(s) where this healthcare service may be provided.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Description of service as presented to a consumer while searching", description=( "Further description of the service as it would be presented to a " "consumer while searching." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) notAvailable: typing.List[ fhirtypes.HealthcareServiceNotAvailableType ] | None = Field( default=None, alias="notAvailable", title="Not available during this time due to provided reason", description=( "The HealthcareService is not available during this period of time due " "to the provided reason." ), json_schema_extra={ "element_property": True, }, ) photo: fhirtypes.AttachmentType | None = Field( default=None, alias="photo", title="Facilitates quick identification of the service", description=( "If there is a photo/symbol associated with this HealthcareService, it " "may be included here to facilitate quick identification of the service" " in a list." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) program: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="program", title="Programs that this service is applicable to", description=None, json_schema_extra={ "element_property": True, }, ) providedBy: fhirtypes.ReferenceType | None = Field( default=None, alias="providedBy", title="Organization that provides this service", description="The organization that provides this healthcare service.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) referralMethod: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="referralMethod", title="Ways that the service accepts referrals", description=( "Ways that the service accepts referrals, if this is not provided then " "it is implied that no referral is required." ), json_schema_extra={ "element_property": True, }, ) serviceProvisionCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="serviceProvisionCode", title="Conditions under which service is available/offered", description=( "The code(s) that detail the conditions under which the healthcare " "service is available/offered." ), json_schema_extra={ "element_property": True, }, ) specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialty", title="Specialties handled by the HealthcareService", description=( "Collection of specialties handled by the service site. This is more of" " a medical term." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="Contacts related to the healthcare service", description="List of contacts related to this specific healthcare service.", json_schema_extra={ "element_property": True, }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Type of service that may be delivered or performed", description="The specific type of service that may be delivered or performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``HealthcareService`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "providedBy", "category", "type", "specialty", "location", "name", "comment", "extraDetails", "photo", "telecom", "coverageArea", "serviceProvisionCode", "eligibility", "program", "characteristic", "communication", "referralMethod", "appointmentRequired", "availableTime", "notAvailable", "availabilityExceptions", "endpoint", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``HealthcareService`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "active", "providedBy", "category", "type", "specialty", "location", "name", "comment", "photo", ] class HealthcareServiceAvailableTime(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Times the Service Site is available. A collection of times that the Service Site is available. """ __resource_type__ = "HealthcareServiceAvailableTime" allDay: bool | None = Field( default=None, alias="allDay", title="Always available? e.g. 24 hour service", description=( "Is this always available? (hence times are irrelevant) e.g. 24 hour " "service." ), json_schema_extra={ "element_property": True, }, ) allDay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allDay", title="Extension field for ``allDay``." ) availableEndTime: fhirtypes.TimeType | None = Field( default=None, alias="availableEndTime", title="Closing time of day (ignored if allDay = true)", description=( "The closing time of day. Note: If the AllDay flag is set, then this " "time is ignored." ), json_schema_extra={ "element_property": True, }, ) availableEndTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_availableEndTime", title="Extension field for ``availableEndTime``.", ) availableStartTime: fhirtypes.TimeType | None = Field( default=None, alias="availableStartTime", title="Opening time of day (ignored if allDay = true)", description=( "The opening time of day. Note: If the AllDay flag is set, then this " "time is ignored." ), json_schema_extra={ "element_property": True, }, ) availableStartTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_availableStartTime", title="Extension field for ``availableStartTime``.", ) daysOfWeek: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="daysOfWeek", title="mon | tue | wed | thu | fri | sat | sun", description=( "Indicates which days of the week are available between the start and " "end Times." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], }, ) daysOfWeek__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_daysOfWeek", title="Extension field for ``daysOfWeek``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``HealthcareServiceAvailableTime`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "daysOfWeek", "allDay", "availableStartTime", "availableEndTime", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``HealthcareServiceAvailableTime`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class HealthcareServiceEligibility(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specific eligibility requirements required to use the service. Does this service have specific eligibility requirements that need to be met in order to use the service? """ __resource_type__ = "HealthcareServiceEligibility" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Coded value for the eligibility", description=None, json_schema_extra={ "element_property": True, }, ) comment: fhirtypes.MarkdownType | None = Field( default=None, alias="comment", title="Describes the eligibility conditions for the service", description=None, json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``HealthcareServiceEligibility`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "comment"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``HealthcareServiceEligibility`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class HealthcareServiceNotAvailable(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Not available during this time due to provided reason. The HealthcareService is not available during this period of time due to the provided reason. """ __resource_type__ = "HealthcareServiceNotAvailable" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Reason presented to the user explaining why time not available", description=( "The reason that can be presented to the user as to why this time is " "not available." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) during: fhirtypes.PeriodType | None = Field( default=None, alias="during", title="Service not available from this date", description=( "Service is not available (seasonally or for a public holiday) from " "this date." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``HealthcareServiceNotAvailable`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "description", "during"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``HealthcareServiceNotAvailable`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("description", "description__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/humanname.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/HumanName Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class HumanName(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Name of a human - parts and usage. A human's name with the ability to identify parts and usage. """ __resource_type__ = "HumanName" family: fhirtypes.StringType | None = Field( default=None, alias="family", title="Family name (often called 'Surname')", description=( "The part of a name that links to the genealogy. In some cultures (e.g." " Eritrea) the family name of a son is the first name of his father." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) family__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_family", title="Extension field for ``family``." ) given: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="given", title="Given names (not always 'first'). Includes middle names", description="Given name.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) given__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_given", title="Extension field for ``given``." ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period when name was/is in use", description=( "Indicates the period of time when this name was valid for the named " "person." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) prefix: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="prefix", title="Parts that come before the name", description=( "Part of the name that is acquired as a title due to academic, legal, " "employment or nobility status, etc. and that appears at the start of " "the name." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) prefix__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_prefix", title="Extension field for ``prefix``." ) suffix: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="suffix", title="Parts that come after the name", description=( "Part of the name that is acquired as a title due to academic, legal, " "employment or nobility status, etc. and that appears at the end of the" " name." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) suffix__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_suffix", title="Extension field for ``suffix``." ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Text representation of the full name", description=( "Specifies the entire name as it should be displayed e.g. on an " "application UI. This may be provided instead of or as well as the " "specific parts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="usual | official | temp | nickname | anonymous | old | maiden", description="Identifies the purpose for this name.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "usual", "official", "temp", "nickname", "anonymous", "old", "maiden", ], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``HumanName`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "use", "text", "family", "given", "prefix", "suffix", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``HumanName`` according to specification, with preserving the original sequence order. """ return ["use", "text", "family", "given", "prefix", "suffix", "period"] ================================================ FILE: fhir/resources/R4B/identifier.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Identifier Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Identifier(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An identifier intended for computation. An identifier - identifies some entity uniquely and unambiguously. Typically this is used for business identifiers. """ __resource_type__ = "Identifier" assigner: fhirtypes.ReferenceType | None = Field( default=None, alias="assigner", title="Organization that issued id (may be just text)", description="Organization that issued/manages the identifier.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period when id is/was valid for use", description="Time period during which identifier is/was valid for use.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) system: fhirtypes.UriType | None = Field( default=None, alias="system", title="The namespace for the identifier value", description=( "Establishes the namespace for the value - that is, a URL that " "describes a set values that are unique." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Description of identifier", description=( "A coded type for the identifier that can be used to determine which " "identifier to use for a specific purpose." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="usual | official | temp | secondary | old (If known)", description="The purpose of this identifier.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["usual", "official", "temp", "secondary", "old"], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The value that is unique", description=( "The portion of the identifier typically relevant to the user and which" " is unique within the context of the system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Identifier`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "use", "type", "system", "value", "period", "assigner", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Identifier`` according to specification, with preserving the original sequence order. """ return ["use", "type", "system", "value", "period", "assigner"] ================================================ FILE: fhir/resources/R4B/imagingstudy.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ImagingStudy Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ImagingStudy(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A set of images produced in single study (one or more series of references images). Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities. """ __resource_type__ = "ImagingStudy" basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Request fulfilled", description=( "A list of the diagnostic requests that resulted in this imaging study " "being performed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CarePlan", "ServiceRequest", "Appointment", "AppointmentResponse", "Task", ], }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Institution-generated description", description=( "The Imaging Manager description of the study. Institution-generated " "description or classification of the Study (component) performed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter with which this imaging study is associated", description=( "The healthcare event (e.g. a patient and healthcare provider " "interaction) during which this ImagingStudy is made." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title="Study access endpoint", description=( "The network service providing access (e.g., query, view, or retrieval)" " for the study. See implementation notes for information about using " "DICOM endpoints. A study-level endpoint applies to each series in the " "study, unless overridden by a series-level endpoint with the same " "Endpoint.connectionType." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifiers for the whole study", description=( "Identifiers for the ImagingStudy such as DICOM Study Instance UID, and" " Accession Number." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) interpreter: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="interpreter", title="Who interpreted images", description="Who read the study and interpreted the images or other content.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where ImagingStudy occurred", description="The principal physical location where the ImagingStudy was performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) modality: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="modality", title="All series modality if actual acquisition modalities", description=( "A list of all the series.modality values that are actual acquisition " "modalities, i.e. those in the DICOM Context Group 29 (value set OID " "1.2.840.10008.6.1.19)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="User-defined comments", description=( "Per the recommended DICOM mapping, this element is derived from the " "Study Description attribute (0008,1030). Observations or findings " "about the imaging study should be recorded in another resource, e.g. " "Observation, and not in this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) numberOfInstances: fhirtypes.UnsignedIntType | None = Field( default=None, alias="numberOfInstances", title="Number of Study Related Instances", description=( "Number of SOP Instances in Study. This value given may be larger than " "the number of instance elements this resource contains due to resource" " availability, security, or other factors. This element should be " "present if any instance elements are present." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) numberOfInstances__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_numberOfInstances", title="Extension field for ``numberOfInstances``.", ) numberOfSeries: fhirtypes.UnsignedIntType | None = Field( default=None, alias="numberOfSeries", title="Number of Study Related Series", description=( "Number of Series in the Study. This value given may be larger than the" " number of series elements this Resource contains due to resource " "availability, security, or other factors. This element should be " "present if any series elements are present." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) numberOfSeries__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_numberOfSeries", title="Extension field for ``numberOfSeries``.", ) procedureCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="procedureCode", title="The performed procedure code", description="The code for the performed procedure type.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) procedureReference: fhirtypes.ReferenceType | None = Field( default=None, alias="procedureReference", title="The performed Procedure reference", description="The procedure which this ImagingStudy was part of.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Procedure"], }, ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Why the study was requested", description=( "Description of clinical condition indicating why the ImagingStudy was " "requested." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Why was study performed", description="Indicates another resource whose existence justifies this Study.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "Media", "DiagnosticReport", "DocumentReference", ], }, ) referrer: fhirtypes.ReferenceType | None = Field( default=None, alias="referrer", title="Referring physician", description="The requesting/referring physician.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) series: typing.List[fhirtypes.ImagingStudySeriesType] | None = Field( default=None, alias="series", title="Each study has one or more series of instances", description="Each study has one or more series of images or other content.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) started: fhirtypes.DateTimeType | None = Field( default=None, alias="started", title="When the study was started", description="Date and time the study started.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) started__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_started", title="Extension field for ``started``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="registered | available | cancelled | entered-in-error | unknown", description="The current state of the ImagingStudy.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "registered", "available", "cancelled", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who or what is the subject of the study", description="The subject, typically a patient, of the imaging study.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Device", "Group"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImagingStudy`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "modality", "subject", "encounter", "started", "basedOn", "referrer", "interpreter", "endpoint", "numberOfSeries", "numberOfInstances", "procedureReference", "procedureCode", "location", "reasonCode", "reasonReference", "note", "description", "series", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImagingStudy`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "modality", "subject", "encounter", "started", "basedOn", "referrer", "interpreter", "endpoint", "numberOfSeries", "numberOfInstances", "procedureReference", "procedureCode", "location", "reasonCode", "reasonReference", "note", "description", "series", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class ImagingStudySeries(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Each study has one or more series of instances. Each study has one or more series of images or other content. """ __resource_type__ = "ImagingStudySeries" bodySite: fhirtypes.CodingType | None = Field( default=None, alias="bodySite", title="Body part examined", description=( "The anatomic structures examined. See DICOM Part 16 Annex L (http://di" "com.nema.org/medical/dicom/current/output/chtml/part16/chapter_L.html)" " for DICOM to SNOMED-CT mappings. The bodySite may indicate the " "laterality of body part imaged; if so, it shall be consistent with any" " content of ImagingStudy.series.laterality." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="A short human readable summary of the series", description="A description of the series.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title="Series access endpoint", description=( "The network service providing access (e.g., query, view, or retrieval)" " for this series. See implementation notes for information about using" " DICOM endpoints. A series-level endpoint, if present, has precedence " "over a study-level endpoint with the same Endpoint.connectionType." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) instance: typing.List[fhirtypes.ImagingStudySeriesInstanceType] | None = Field( default=None, alias="instance", title="A single SOP instance from the series", description=( "A single SOP instance within the series, e.g. an image, or " "presentation state." ), json_schema_extra={ "element_property": True, }, ) laterality: fhirtypes.CodingType | None = Field( default=None, alias="laterality", title="Body part laterality", description=( "The laterality of the (possibly paired) anatomic structures examined. " "E.g., the left knee, both lungs, or unpaired abdomen. If present, " "shall be consistent with any laterality information indicated in " "ImagingStudy.series.bodySite." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) modality: fhirtypes.CodingType = Field( default=..., alias="modality", title="The modality of the instances in the series", description="The modality of this series sequence.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) number: fhirtypes.UnsignedIntType | None = Field( default=None, alias="number", title="Numeric identifier of this series", description="The numeric identifier of this series in the study.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_number", title="Extension field for ``number``." ) numberOfInstances: fhirtypes.UnsignedIntType | None = Field( default=None, alias="numberOfInstances", title="Number of Series Related Instances", description=( "Number of SOP Instances in the Study. The value given may be larger " "than the number of instance elements this resource contains due to " "resource availability, security, or other factors. This element should" " be present if any instance elements are present." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) numberOfInstances__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_numberOfInstances", title="Extension field for ``numberOfInstances``.", ) performer: typing.List[fhirtypes.ImagingStudySeriesPerformerType] | None = Field( default=None, alias="performer", title="Who performed the series", description="Indicates who or what performed the series and how they were involved.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) specimen: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="specimen", title="Specimen imaged", description="The specimen imaged, e.g., for whole slide imaging of a biopsy.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Specimen"], }, ) started: fhirtypes.DateTimeType | None = Field( default=None, alias="started", title="When the series started", description="The date and time the series was started.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) started__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_started", title="Extension field for ``started``." ) uid: fhirtypes.IdType | None = Field( default=None, alias="uid", title="DICOM Series Instance UID for the series", description="The DICOM Series Instance UID for the series.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) uid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uid", title="Extension field for ``uid``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImagingStudySeries`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "uid", "number", "modality", "description", "numberOfInstances", "endpoint", "bodySite", "laterality", "specimen", "started", "performer", "instance", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImagingStudySeries`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "uid", "number", "modality", "description", "numberOfInstances", "endpoint", "bodySite", "laterality", "specimen", "started", "performer", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("uid", "uid__ext")] return required_fields class ImagingStudySeriesInstance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A single SOP instance from the series. A single SOP instance within the series, e.g. an image, or presentation state. """ __resource_type__ = "ImagingStudySeriesInstance" number: fhirtypes.UnsignedIntType | None = Field( default=None, alias="number", title="The number of this instance in the series", description="The number of instance in the series.", json_schema_extra={ "element_property": True, }, ) number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_number", title="Extension field for ``number``." ) sopClass: fhirtypes.CodingType = Field( default=..., alias="sopClass", title="DICOM class type", description="DICOM instance type.", json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Description of instance", description="The description of the instance.", json_schema_extra={ "element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) uid: fhirtypes.IdType | None = Field( default=None, alias="uid", title="DICOM SOP Instance UID", description="The DICOM SOP Instance UID for this image or other DICOM content.", json_schema_extra={ "element_property": True, "element_required": True, }, ) uid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uid", title="Extension field for ``uid``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImagingStudySeriesInstance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "uid", "sopClass", "number", "title", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImagingStudySeriesInstance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("uid", "uid__ext")] return required_fields class ImagingStudySeriesPerformer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who performed the series. Indicates who or what performed the series and how they were involved. """ __resource_type__ = "ImagingStudySeriesPerformer" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Who performed the series", description="Indicates who or what performed the series.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", "Patient", "Device", "RelatedPerson", ], }, ) function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="Type of performance", description="Distinguishes the type of involvement of the performer in the series.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImagingStudySeriesPerformer`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "function", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImagingStudySeriesPerformer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "function", "actor"] ================================================ FILE: fhir/resources/R4B/immunization.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Immunization Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Immunization(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Immunization event information. Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party. """ __resource_type__ = "Immunization" doseQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="doseQuantity", title="Amount of vaccine administered", description="The quantity of vaccine product that was administered.", json_schema_extra={ "element_property": True, }, ) education: typing.List[fhirtypes.ImmunizationEducationType] | None = Field( default=None, alias="education", title="Educational material presented to patient", description=( "Educational material presented to the patient (or guardian) at the " "time of vaccine administration." ), json_schema_extra={ "element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter immunization was part of", description=( "The visit or admission or other contact between patient and health " "care provider the immunization was performed as part of." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) expirationDate: fhirtypes.DateType | None = Field( default=None, alias="expirationDate", title="Vaccine expiration date", description="Date vaccine batch expires.", json_schema_extra={ "element_property": True, }, ) expirationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expirationDate", title="Extension field for ``expirationDate``.", ) fundingSource: fhirtypes.CodeableConceptType | None = Field( default=None, alias="fundingSource", title="Funding source for the vaccine", description=( "Indicates the source of the vaccine actually administered. This may be" " different than the patient eligibility (e.g. the patient may be " "eligible for a publically purchased vaccine but due to inventory " "issues, vaccine purchased with private funds was actually " "administered)." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description="A unique identifier assigned to this immunization record.", json_schema_extra={ "element_property": True, }, ) isSubpotent: bool | None = Field( default=None, alias="isSubpotent", title="Dose potency", description=( "Indication if a dose is considered to be subpotent. By default, a dose" " should be considered to be potent." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) isSubpotent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isSubpotent", title="Extension field for ``isSubpotent``." ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where immunization occurred", description=( "The service delivery location where the vaccine administration " "occurred." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) lotNumber: fhirtypes.StringType | None = Field( default=None, alias="lotNumber", title="Vaccine lot number", description="Lot number of the vaccine product.", json_schema_extra={ "element_property": True, }, ) lotNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lotNumber", title="Extension field for ``lotNumber``." ) manufacturer: fhirtypes.ReferenceType | None = Field( default=None, alias="manufacturer", title="Vaccine manufacturer", description="Name of vaccine manufacturer.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Additional immunization notes", description=( "Extra information about the immunization that is not conveyed by the " "other attributes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="Vaccine administration date", description="Date vaccine administered or was to be administered.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": True, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrenceString: fhirtypes.StringType | None = Field( default=None, alias="occurrenceString", title="Vaccine administration date", description="Date vaccine administered or was to be administered.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": True, }, ) occurrenceString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceString", title="Extension field for ``occurrenceString``.", ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Who was immunized", description="The patient who either received or did not receive the immunization.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) performer: typing.List[fhirtypes.ImmunizationPerformerType] | None = Field( default=None, alias="performer", title="Who performed event", description="Indicates who performed the immunization event.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) primarySource: bool | None = Field( default=None, alias="primarySource", title="Indicates context the data was recorded in", description=( "An indication that the content of the record is based on information " "from the person who administered the vaccine. This reflects the " "context under which the data was originally recorded." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) primarySource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_primarySource", title="Extension field for ``primarySource``.", ) programEligibility: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="programEligibility", title="Patient eligibility for a vaccination program", description="Indicates a patient's eligibility for a funding program.", json_schema_extra={ "element_property": True, }, ) protocolApplied: typing.List[ fhirtypes.ImmunizationProtocolAppliedType ] | None = Field( default=None, alias="protocolApplied", title="Protocol followed by the provider", description=( "The protocol (set of recommendations) being followed by the provider " "who administered the dose." ), json_schema_extra={ "element_property": True, }, ) reaction: typing.List[fhirtypes.ImmunizationReactionType] | None = Field( default=None, alias="reaction", title="Details of a reaction that follows immunization", description=( "Categorical data indicating that an adverse event is associated in " "time to an immunization." ), json_schema_extra={ "element_property": True, }, ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Why immunization occurred", description="Reasons why the vaccine was administered.", json_schema_extra={ "element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Why immunization occurred", description=( "Condition, Observation or DiagnosticReport that supports why the " "immunization was administered." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "Observation", "DiagnosticReport"], }, ) recorded: fhirtypes.DateTimeType | None = Field( default=None, alias="recorded", title="When the immunization was first captured in the subject's record", description=( "The date the occurrence of the immunization was first captured in the " "record - potentially significantly after the occurrence of the event." ), json_schema_extra={ "element_property": True, }, ) recorded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recorded", title="Extension field for ``recorded``." ) reportOrigin: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reportOrigin", title="Indicates the source of a secondarily reported record", description=( "The source of the data when the report of the immunization event is " "not based on information from the person who administered the vaccine." ), json_schema_extra={ "element_property": True, }, ) route: fhirtypes.CodeableConceptType | None = Field( default=None, alias="route", title="How vaccine entered body", description="The path by which the vaccine product is taken into the body.", json_schema_extra={ "element_property": True, }, ) site: fhirtypes.CodeableConceptType | None = Field( default=None, alias="site", title="Body site vaccine was administered", description="Body site where vaccine was administered.", json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="completed | entered-in-error | not-done", description="Indicates the current status of the immunization event.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["completed", "entered-in-error", "not-done"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="statusReason", title="Reason not done", description="Indicates the reason the immunization event was not performed.", json_schema_extra={ "element_property": True, }, ) subpotentReason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="subpotentReason", title="Reason for being subpotent", description="Reason why a dose is considered to be subpotent.", json_schema_extra={ "element_property": True, }, ) vaccineCode: fhirtypes.CodeableConceptType = Field( default=..., alias="vaccineCode", title="Vaccine product administered", description="Vaccine that was administered or was to be administered.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Immunization`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "statusReason", "vaccineCode", "patient", "encounter", "occurrenceDateTime", "occurrenceString", "recorded", "primarySource", "reportOrigin", "location", "manufacturer", "lotNumber", "expirationDate", "site", "route", "doseQuantity", "performer", "note", "reasonCode", "reasonReference", "isSubpotent", "subpotentReason", "education", "programEligibility", "fundingSource", "reaction", "protocolApplied", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Immunization`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "status", "vaccineCode", "patient", "occurrenceDateTime", "occurrenceString", "primarySource", "performer", "note", "isSubpotent", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"occurrence": ["occurrenceDateTime", "occurrenceString"]} return one_of_many_fields class ImmunizationEducation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Educational material presented to patient. Educational material presented to the patient (or guardian) at the time of vaccine administration. """ __resource_type__ = "ImmunizationEducation" documentType: fhirtypes.StringType | None = Field( default=None, alias="documentType", title="Educational material document identifier", description="Identifier of the material presented to the patient.", json_schema_extra={ "element_property": True, }, ) documentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentType", title="Extension field for ``documentType``.", ) presentationDate: fhirtypes.DateTimeType | None = Field( default=None, alias="presentationDate", title="Educational material presentation date", description="Date the educational material was given to the patient.", json_schema_extra={ "element_property": True, }, ) presentationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_presentationDate", title="Extension field for ``presentationDate``.", ) publicationDate: fhirtypes.DateTimeType | None = Field( default=None, alias="publicationDate", title="Educational material publication date", description="Date the educational material was published.", json_schema_extra={ "element_property": True, }, ) publicationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publicationDate", title="Extension field for ``publicationDate``.", ) reference: fhirtypes.UriType | None = Field( default=None, alias="reference", title="Educational material reference pointer", description=( "Reference pointer to the educational material given to the patient if " "the information was on line." ), json_schema_extra={ "element_property": True, }, ) reference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reference", title="Extension field for ``reference``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImmunizationEducation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "documentType", "reference", "publicationDate", "presentationDate", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImmunizationEducation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ImmunizationPerformer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who performed event. Indicates who performed the immunization event. """ __resource_type__ = "ImmunizationPerformer" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Individual or organization who was performing", description="The practitioner or organization who performed the action.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="What type of performance was done", description=( "Describes the type of performance (e.g. ordering provider, " "administering provider, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImmunizationPerformer`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "function", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImmunizationPerformer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "function", "actor"] class ImmunizationProtocolApplied(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Protocol followed by the provider. The protocol (set of recommendations) being followed by the provider who administered the dose. """ __resource_type__ = "ImmunizationProtocolApplied" authority: fhirtypes.ReferenceType | None = Field( default=None, alias="authority", title="Who is responsible for publishing the recommendations", description=( "Indicates the authority who published the protocol (e.g. ACIP) that is" " being followed." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) doseNumberPositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="doseNumberPositiveInt", title="Dose number within series", description="Nominal position in a series.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e doseNumber[x] "one_of_many": "doseNumber", "one_of_many_required": True, }, ) doseNumberPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doseNumberPositiveInt", title="Extension field for ``doseNumberPositiveInt``.", ) doseNumberString: fhirtypes.StringType | None = Field( default=None, alias="doseNumberString", title="Dose number within series", description="Nominal position in a series.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e doseNumber[x] "one_of_many": "doseNumber", "one_of_many_required": True, }, ) doseNumberString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doseNumberString", title="Extension field for ``doseNumberString``.", ) series: fhirtypes.StringType | None = Field( default=None, alias="series", title="Name of vaccine series", description=( "One possible path to achieve presumed immunity against a disease - " "within the context of an authority." ), json_schema_extra={ "element_property": True, }, ) series__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_series", title="Extension field for ``series``." ) seriesDosesPositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="seriesDosesPositiveInt", title="Recommended number of doses for immunity", description="The recommended number of doses to achieve immunity.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e seriesDoses[x] "one_of_many": "seriesDoses", "one_of_many_required": False, }, ) seriesDosesPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_seriesDosesPositiveInt", title="Extension field for ``seriesDosesPositiveInt``.", ) seriesDosesString: fhirtypes.StringType | None = Field( default=None, alias="seriesDosesString", title="Recommended number of doses for immunity", description="The recommended number of doses to achieve immunity.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e seriesDoses[x] "one_of_many": "seriesDoses", "one_of_many_required": False, }, ) seriesDosesString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_seriesDosesString", title="Extension field for ``seriesDosesString``.", ) targetDisease: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="targetDisease", title="Vaccine preventatable disease being targetted", description=( "The vaccine preventable disease the dose is being administered " "against." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImmunizationProtocolApplied`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "series", "authority", "targetDisease", "doseNumberPositiveInt", "doseNumberString", "seriesDosesPositiveInt", "seriesDosesString", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImmunizationProtocolApplied`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "doseNumber": ["doseNumberPositiveInt", "doseNumberString"], "seriesDoses": ["seriesDosesPositiveInt", "seriesDosesString"], } return one_of_many_fields class ImmunizationReaction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details of a reaction that follows immunization. Categorical data indicating that an adverse event is associated in time to an immunization. """ __resource_type__ = "ImmunizationReaction" date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When reaction started", description="Date of reaction to the immunization.", json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) detail: fhirtypes.ReferenceType | None = Field( default=None, alias="detail", title="Additional information on reaction", description="Details of the reaction.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Observation"], }, ) reported: bool | None = Field( default=None, alias="reported", title="Indicates self-reported reaction", description="Self-reported indicator.", json_schema_extra={ "element_property": True, }, ) reported__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reported", title="Extension field for ``reported``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImmunizationReaction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "date", "detail", "reported"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImmunizationReaction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/immunizationevaluation.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ImmunizationEvaluation Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class ImmunizationEvaluation(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Immunization evaluation information. Describes a comparison of an immunization event against published recommendations to determine if the administration is "valid" in relation to those recommendations. """ __resource_type__ = "ImmunizationEvaluation" authority: fhirtypes.ReferenceType | None = Field( default=None, alias="authority", title="Who is responsible for publishing the recommendations", description="Indicates the authority who published the protocol (e.g. ACIP).", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date evaluation was performed", description=( "The date the evaluation of the vaccine administration event was " "performed." ), json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Evaluation notes", description="Additional information about the evaluation.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) doseNumberPositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="doseNumberPositiveInt", title="Dose number within series", description="Nominal position in a series.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e doseNumber[x] "one_of_many": "doseNumber", "one_of_many_required": False, }, ) doseNumberPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doseNumberPositiveInt", title="Extension field for ``doseNumberPositiveInt``.", ) doseNumberString: fhirtypes.StringType | None = Field( default=None, alias="doseNumberString", title="Dose number within series", description="Nominal position in a series.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e doseNumber[x] "one_of_many": "doseNumber", "one_of_many_required": False, }, ) doseNumberString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doseNumberString", title="Extension field for ``doseNumberString``.", ) doseStatus: fhirtypes.CodeableConceptType = Field( default=..., alias="doseStatus", title="Status of the dose relative to published recommendations", description=( "Indicates if the dose is valid or not valid with respect to the " "published recommendations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) doseStatusReason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="doseStatusReason", title="Reason for the dose status", description=( "Provides an explanation as to why the vaccine administration event is " "valid or not relative to the published recommendations." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description="A unique identifier assigned to this immunization evaluation record.", json_schema_extra={ "element_property": True, }, ) immunizationEvent: fhirtypes.ReferenceType = Field( default=..., alias="immunizationEvent", title="Immunization being evaluated", description="The vaccine administration event being evaluated.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Immunization"], }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Who this evaluation is for", description="The individual for whom the evaluation is being done.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) series: fhirtypes.StringType | None = Field( default=None, alias="series", title="Name of vaccine series", description=( "One possible path to achieve presumed immunity against a disease - " "within the context of an authority." ), json_schema_extra={ "element_property": True, }, ) series__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_series", title="Extension field for ``series``." ) seriesDosesPositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="seriesDosesPositiveInt", title="Recommended number of doses for immunity", description="The recommended number of doses to achieve immunity.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e seriesDoses[x] "one_of_many": "seriesDoses", "one_of_many_required": False, }, ) seriesDosesPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_seriesDosesPositiveInt", title="Extension field for ``seriesDosesPositiveInt``.", ) seriesDosesString: fhirtypes.StringType | None = Field( default=None, alias="seriesDosesString", title="Recommended number of doses for immunity", description="The recommended number of doses to achieve immunity.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e seriesDoses[x] "one_of_many": "seriesDoses", "one_of_many_required": False, }, ) seriesDosesString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_seriesDosesString", title="Extension field for ``seriesDosesString``.", ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="completed | entered-in-error", description=( "Indicates the current status of the evaluation of the vaccination " "administration event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["completed", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) targetDisease: fhirtypes.CodeableConceptType = Field( default=..., alias="targetDisease", title="Evaluation target disease", description="The vaccine preventable disease the dose is being evaluated against.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImmunizationEvaluation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "patient", "date", "authority", "targetDisease", "immunizationEvent", "doseStatus", "doseStatusReason", "description", "series", "doseNumberPositiveInt", "doseNumberString", "seriesDosesPositiveInt", "seriesDosesString", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImmunizationEvaluation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "status", "patient", "targetDisease", "immunizationEvent", "doseStatus", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "doseNumber": ["doseNumberPositiveInt", "doseNumberString"], "seriesDoses": ["seriesDosesPositiveInt", "seriesDosesString"], } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/immunizationrecommendation.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ImmunizationRecommendation(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Guidance or advice relating to an immunization. A patient's point-in-time set of recommendations (i.e. forecasting) according to a published schedule with optional supporting justification. """ __resource_type__ = "ImmunizationRecommendation" authority: fhirtypes.ReferenceType | None = Field( default=None, alias="authority", title="Who is responsible for protocol", description="Indicates the authority who published the protocol (e.g. ACIP).", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date recommendation(s) created", description="The date the immunization recommendation(s) were created.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description="A unique identifier assigned to this particular recommendation record.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Who this profile is for", description="The patient the recommendation(s) are for.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) recommendation: typing.List[ fhirtypes.ImmunizationRecommendationRecommendationType ] = Field( default=..., alias="recommendation", title="Vaccine administration recommendations", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImmunizationRecommendation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "patient", "date", "authority", "recommendation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImmunizationRecommendation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "patient", "date", "recommendation", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("date", "date__ext")] return required_fields class ImmunizationRecommendationRecommendation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Vaccine administration recommendations. """ __resource_type__ = "ImmunizationRecommendationRecommendation" contraindicatedVaccineCode: typing.List[ fhirtypes.CodeableConceptType ] | None = Field( default=None, alias="contraindicatedVaccineCode", title="Vaccine which is contraindicated to fulfill the recommendation", description="Vaccine(s) which should not be used to fulfill the recommendation.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dateCriterion: typing.List[ fhirtypes.ImmunizationRecommendationRecommendationDateCriterionType ] | None = Field( default=None, alias="dateCriterion", title="Dates governing proposed immunization", description=( "Vaccine date recommendations. For example, earliest date to " "administer, latest date to administer, etc." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Protocol details", description=( "Contains the description about the protocol under which the vaccine " "was administered." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) doseNumberPositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="doseNumberPositiveInt", title="Recommended dose number within series", description=( "Nominal position of the recommended dose in a series (e.g. dose 2 is " "the next recommended dose)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e doseNumber[x] "one_of_many": "doseNumber", "one_of_many_required": False, }, ) doseNumberPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doseNumberPositiveInt", title="Extension field for ``doseNumberPositiveInt``.", ) doseNumberString: fhirtypes.StringType | None = Field( default=None, alias="doseNumberString", title="Recommended dose number within series", description=( "Nominal position of the recommended dose in a series (e.g. dose 2 is " "the next recommended dose)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e doseNumber[x] "one_of_many": "doseNumber", "one_of_many_required": False, }, ) doseNumberString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doseNumberString", title="Extension field for ``doseNumberString``.", ) forecastReason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="forecastReason", title="Vaccine administration status reason", description="The reason for the assigned forecast status.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) forecastStatus: fhirtypes.CodeableConceptType = Field( default=..., alias="forecastStatus", title="Vaccine recommendation status", description=( "Indicates the patient status with respect to the path to immunity for " "the target disease." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) series: fhirtypes.StringType | None = Field( default=None, alias="series", title="Name of vaccination series", description=( "One possible path to achieve presumed immunity against a disease - " "within the context of an authority." ), json_schema_extra={ "element_property": True, }, ) series__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_series", title="Extension field for ``series``." ) seriesDosesPositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="seriesDosesPositiveInt", title="Recommended number of doses for immunity", description="The recommended number of doses to achieve immunity.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e seriesDoses[x] "one_of_many": "seriesDoses", "one_of_many_required": False, }, ) seriesDosesPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_seriesDosesPositiveInt", title="Extension field for ``seriesDosesPositiveInt``.", ) seriesDosesString: fhirtypes.StringType | None = Field( default=None, alias="seriesDosesString", title="Recommended number of doses for immunity", description="The recommended number of doses to achieve immunity.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e seriesDoses[x] "one_of_many": "seriesDoses", "one_of_many_required": False, }, ) seriesDosesString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_seriesDosesString", title="Extension field for ``seriesDosesString``.", ) supportingImmunization: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingImmunization", title="Past immunizations supporting recommendation", description=( "Immunization event history and/or evaluation that supports the status " "and recommendation." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Immunization", "ImmunizationEvaluation"], }, ) supportingPatientInformation: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingPatientInformation", title="Patient observations supporting recommendation", description=( "Patient Information that supports the status and recommendation. This" " includes patient observations, adverse reactions and " "allergy/intolerance information." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) targetDisease: fhirtypes.CodeableConceptType | None = Field( default=None, alias="targetDisease", title="Disease to be immunized against", description="The targeted disease for the recommendation.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) vaccineCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="vaccineCode", title="Vaccine or vaccine group recommendation applies to", description="Vaccine(s) or vaccine group that pertain to the recommendation.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImmunizationRecommendationRecommendation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "vaccineCode", "targetDisease", "contraindicatedVaccineCode", "forecastStatus", "forecastReason", "dateCriterion", "description", "series", "doseNumberPositiveInt", "doseNumberString", "seriesDosesPositiveInt", "seriesDosesString", "supportingImmunization", "supportingPatientInformation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImmunizationRecommendationRecommendation`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "vaccineCode", "targetDisease", "contraindicatedVaccineCode", "forecastStatus", "forecastReason", "doseNumberPositiveInt", "doseNumberString", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "doseNumber": ["doseNumberPositiveInt", "doseNumberString"], "seriesDoses": ["seriesDosesPositiveInt", "seriesDosesString"], } return one_of_many_fields class ImmunizationRecommendationRecommendationDateCriterion( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Dates governing proposed immunization. Vaccine date recommendations. For example, earliest date to administer, latest date to administer, etc. """ __resource_type__ = "ImmunizationRecommendationRecommendationDateCriterion" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Type of date", description=( "Date classification of recommendation. For example, earliest date to " "give, latest date to give, etc." ), json_schema_extra={ "element_property": True, }, ) value: fhirtypes.DateTimeType | None = Field( default=None, alias="value", title="Recommended date", description="The date whose meaning is specified by dateCriterion.code.", json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImmunizationRecommendationRecommendationDateCriterion`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImmunizationRecommendationRecommendationDateCriterion`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("value", "value__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/implementationguide.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ImplementationGuide Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ImplementationGuide(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A set of rules about how FHIR is used. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. """ __resource_type__ = "ImplementationGuide" contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the implementation guide and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the implementation guide." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the implementation guide was " "published. The date must change when the business version changes and " "it must change if the status code changes. In addition, it should " "change when the substantive content of the implementation guide " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) definition: fhirtypes.ImplementationGuideDefinitionType | None = Field( default=None, alias="definition", title="Information needed to build the IG", description=( "The information needed by an IG publisher tool to publish the whole " "implementation guide." ), json_schema_extra={ "element_property": True, }, ) dependsOn: typing.List[fhirtypes.ImplementationGuideDependsOnType] | None = Field( default=None, alias="dependsOn", title="Another Implementation guide this depends on", description=( "Another implementation guide that this implementation depends on. " "Typically, an implementation guide uses value sets, profiles " "etc.defined in other implementation guides." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the implementation guide", description=( "A free text natural language description of the implementation guide " "from a consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this implementation guide is authored" " for testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) fhirVersion: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="fhirVersion", title="FHIR Version(s) this Implementation Guide targets", description=( "The version(s) of the FHIR specification that this ImplementationGuide" " targets - e.g. describes how to use. The value of this element is the" " formal version of the specification, without the revision number, " "e.g. [publication].[major].[minor], which is 4.3.0 for this version." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) fhirVersion__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_fhirVersion", title="Extension field for ``fhirVersion``." ) global_fhir: typing.List[fhirtypes.ImplementationGuideGlobalType] | None = Field( default=None, alias="global", title="Profiles that apply globally", description=( "A set of profiles that all resources covered by this implementation " "guide must conform to." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for implementation guide (if applicable)", description=( "A legal or geographic region in which the implementation guide is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) license: fhirtypes.CodeType | None = Field( default=None, alias="license", title="SPDX license code for this IG (or not-open-source)", description=( "The license that applies to this Implementation Guide, using an SPDX " "license code, or 'not-open-source'." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) license__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_license", title="Extension field for ``license``." ) manifest: fhirtypes.ImplementationGuideManifestType | None = Field( default=None, alias="manifest", title="Information about an assembled IG", description=( "Information about an assembled implementation guide, created by the " "publication tooling." ), json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this implementation guide (computer friendly)", description=( "A natural language name identifying the implementation guide. This " "name should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) packageId: fhirtypes.IdType | None = Field( default=None, alias="packageId", title="NPM Package name for IG", description=( "The NPM package name for this Implementation Guide, used in the NPM " "package distribution, which is the primary mechanism by which FHIR " "based tooling manages IG dependencies. This value must be globally " "unique, and should be assigned with care." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) packageId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_packageId", title="Extension field for ``packageId``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the " "implementation guide." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this implementation guide. Enables tracking the life-" "cycle of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this implementation guide (human friendly)", description=( "A short, descriptive, user-friendly title for the implementation " "guide." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this implementation guide, represented as a " "URI (globally unique)" ), description=( "An absolute URI that is used to identify this implementation guide " "when it is referenced in a specification, model, design or an " "instance; also called its canonical identifier. This SHOULD be " "globally unique and SHOULD be a literal address at which at which an " "authoritative instance of this implementation guide is (or will be) " "published. This URL can be the target of a canonical reference. It " "SHALL remain the same when the implementation guide is stored on " "different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate implementation guide instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the implementation guide", description=( "The identifier that is used to identify this version of the " "implementation guide when it is referenced in a specification, model, " "design or instance. This is an arbitrary value managed by the " "implementation guide author and is not expected to be globally unique." " For example, it might be a timestamp (e.g. yyyymmdd) if a managed " "version is not available. There is also no expectation that versions " "can be placed in a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuide`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "copyright", "packageId", "license", "fhirVersion", "dependsOn", "global", "definition", "manifest", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuide`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "packageId", "license", "fhirVersion", "dependsOn", "global", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("fhirVersion", "fhirVersion__ext"), ("name", "name__ext"), ("packageId", "packageId__ext"), ("status", "status__ext"), ("url", "url__ext"), ] return required_fields class ImplementationGuideDefinition(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information needed to build the IG. The information needed by an IG publisher tool to publish the whole implementation guide. """ __resource_type__ = "ImplementationGuideDefinition" grouping: typing.List[ fhirtypes.ImplementationGuideDefinitionGroupingType ] | None = Field( default=None, alias="grouping", title="Grouping used to present related resources in the IG", description=( "A logical group of resources. Logical groups can be used when building" " pages." ), json_schema_extra={ "element_property": True, }, ) page: fhirtypes.ImplementationGuideDefinitionPageType | None = Field( default=None, alias="page", title="Page/Section in the Guide", description=( "A page / section in the implementation guide. The root page is the " "implementation guide home page." ), json_schema_extra={ "element_property": True, }, ) parameter: typing.List[ fhirtypes.ImplementationGuideDefinitionParameterType ] | None = Field( default=None, alias="parameter", title="Defines how IG is built by tools", description=None, json_schema_extra={ "element_property": True, }, ) resource: typing.List[fhirtypes.ImplementationGuideDefinitionResourceType] = Field( default=..., alias="resource", title="Resource in the implementation guide", description=( "A resource that is part of the implementation guide. Conformance " "resources (value set, structure definition, capability statements " "etc.) are obvious candidates for inclusion, but any kind of resource " "can be included as an example resource." ), json_schema_extra={ "element_property": True, }, ) template: typing.List[ fhirtypes.ImplementationGuideDefinitionTemplateType ] | None = Field( default=None, alias="template", title="A template for building resources", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuideDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "grouping", "resource", "page", "parameter", "template", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuideDefinition`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ImplementationGuideDefinitionGrouping(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Grouping used to present related resources in the IG. A logical group of resources. Logical groups can be used when building pages. """ __resource_type__ = "ImplementationGuideDefinitionGrouping" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Human readable text describing the package", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Descriptive name for the package", description=( "The human-readable title to display for the package of resources when " "rendering the implementation guide." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuideDefinitionGrouping`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "description"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuideDefinitionGrouping`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields class ImplementationGuideDefinitionPage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Page/Section in the Guide. A page / section in the implementation guide. The root page is the implementation guide home page. """ __resource_type__ = "ImplementationGuideDefinitionPage" generation: fhirtypes.CodeType | None = Field( default=None, alias="generation", title="html | markdown | xml | generated", description="A code that indicates how the page is generated.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["html", "markdown", "xml", "generated"], }, ) generation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_generation", title="Extension field for ``generation``." ) nameReference: fhirtypes.ReferenceType | None = Field( default=None, alias="nameReference", title="Where to find that page", description="The source address for the page.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e name[x] "one_of_many": "name", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Binary"], }, ) nameUrl: fhirtypes.UrlType | None = Field( default=None, alias="nameUrl", title="Where to find that page", description="The source address for the page.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e name[x] "one_of_many": "name", "one_of_many_required": True, }, ) nameUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_nameUrl", title="Extension field for ``nameUrl``." ) page: typing.List[fhirtypes.ImplementationGuideDefinitionPageType] | None = Field( default=None, alias="page", title="Nested Pages / Sections", description="Nested Pages/Sections under this page.", json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Short title shown for navigational assistance", description=( "A short title used to represent this page in navigational structures " "such as table of contents, bread crumbs, etc." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuideDefinitionPage`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "nameUrl", "nameReference", "title", "generation", "page", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuideDefinitionPage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("generation", "generation__ext"), ("title", "title__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"name": ["nameReference", "nameUrl"]} return one_of_many_fields class ImplementationGuideDefinitionParameter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Defines how IG is built by tools. """ __resource_type__ = "ImplementationGuideDefinitionParameter" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title=( "apply | path-resource | path-pages | path-tx-cache | expansion-" "parameter | rule-broken-links | generate-xml | generate-json | " "generate-turtle | html-template" ), description=None, json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "apply", "path-resource", "path-pages", "path-tx-cache", "expansion-parameter", "rule-broken-links", "generate-xml", "generate-json", "generate-turtle", "html-template", ], }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="Value for named type", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuideDefinitionParameter`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuideDefinitionParameter`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext"), ("value", "value__ext")] return required_fields class ImplementationGuideDefinitionResource(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Resource in the implementation guide. A resource that is part of the implementation guide. Conformance resources (value set, structure definition, capability statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource. """ __resource_type__ = "ImplementationGuideDefinitionResource" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Reason why included in guide", description=( "A description of the reason that a resource has been included in the " "implementation guide." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) exampleBoolean: bool | None = Field( default=None, alias="exampleBoolean", title="Is an example/What is this an example of?", description=( "If true or a reference, indicates the resource is an example instance." " If a reference is present, indicates that the example is an example " "of the specified profile." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e example[x] "one_of_many": "example", "one_of_many_required": False, }, ) exampleBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_exampleBoolean", title="Extension field for ``exampleBoolean``.", ) exampleCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="exampleCanonical", title="Is an example/What is this an example of?", description=( "If true or a reference, indicates the resource is an example instance." " If a reference is present, indicates that the example is an example " "of the specified profile." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e example[x] "one_of_many": "example", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) exampleCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_exampleCanonical", title="Extension field for ``exampleCanonical``.", ) fhirVersion: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="fhirVersion", title="Versions this applies to (if different to IG)", description=( "Indicates the FHIR Version(s) this artifact is intended to apply to. " "If no versions are specified, the resource is assumed to apply to all " "the versions stated in ImplementationGuide.fhirVersion." ), json_schema_extra={ "element_property": True, }, ) fhirVersion__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_fhirVersion", title="Extension field for ``fhirVersion``." ) groupingId: fhirtypes.IdType | None = Field( default=None, alias="groupingId", title="Grouping this is part of", description="Reference to the id of the grouping this resource appears in.", json_schema_extra={ "element_property": True, }, ) groupingId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_groupingId", title="Extension field for ``groupingId``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Human Name for the resource", description=( "A human assigned name for the resource. All resources SHOULD have a " "name, but the name may be extracted from the resource (e.g. " "ValueSet.name)." ), json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) reference: fhirtypes.ReferenceType = Field( default=..., alias="reference", title="Location of the resource", description="Where this resource is found.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuideDefinitionResource`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "reference", "fhirVersion", "name", "description", "exampleBoolean", "exampleCanonical", "groupingId", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuideDefinitionResource`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"example": ["exampleBoolean", "exampleCanonical"]} return one_of_many_fields class ImplementationGuideDefinitionTemplate(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A template for building resources. """ __resource_type__ = "ImplementationGuideDefinitionTemplate" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Type of template specified", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) scope: fhirtypes.StringType | None = Field( default=None, alias="scope", title="The scope in which the template applies", description=None, json_schema_extra={ "element_property": True, }, ) scope__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_scope", title="Extension field for ``scope``." ) source: fhirtypes.StringType | None = Field( default=None, alias="source", title="The source location for the template", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_source", title="Extension field for ``source``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuideDefinitionTemplate`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "source", "scope"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuideDefinitionTemplate`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext"), ("source", "source__ext")] return required_fields class ImplementationGuideDependsOn(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Another Implementation guide this depends on. Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, profiles etc.defined in other implementation guides. """ __resource_type__ = "ImplementationGuideDependsOn" packageId: fhirtypes.IdType | None = Field( default=None, alias="packageId", title="NPM Package name for IG this depends on", description=( "The NPM package name for the Implementation Guide that this IG depends" " on." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) packageId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_packageId", title="Extension field for ``packageId``." ) uri: fhirtypes.CanonicalType | None = Field( default=None, alias="uri", title="Identity of the IG that this depends on", description="A canonical reference to the Implementation guide for the dependency.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ImplementationGuide"], }, ) uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uri", title="Extension field for ``uri``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Version of the IG", description=( "The version of the IG that is depended on, when the correct version is" " required to understand the IG correctly." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuideDependsOn`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "uri", "packageId", "version"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuideDependsOn`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "uri", "packageId", "version"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("uri", "uri__ext")] return required_fields class ImplementationGuideGlobal(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Profiles that apply globally. A set of profiles that all resources covered by this implementation guide must conform to. """ __resource_type__ = "ImplementationGuideGlobal" profile: fhirtypes.CanonicalType | None = Field( default=None, alias="profile", title="Profile that all resources must conform to", description="A reference to the profile that all instances must conform to.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="Type this profile applies to", description="The type of resource that all instances must conform to.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuideGlobal`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "profile"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuideGlobal`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "profile"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("profile", "profile__ext"), ("type", "type__ext")] return required_fields class ImplementationGuideManifest(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about an assembled IG. Information about an assembled implementation guide, created by the publication tooling. """ __resource_type__ = "ImplementationGuideManifest" image: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="image", title="Image within the IG", description="Indicates a relative path to an image that exists within the IG.", json_schema_extra={ "element_property": True, }, ) image__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_image", title="Extension field for ``image``." ) other: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="other", title="Additional linkable file in IG", description=( "Indicates the relative path of an additional non-page, non-image file " "that is part of the IG - e.g. zip, jar and similar files that could be" " the target of a hyperlink in a derived IG." ), json_schema_extra={ "element_property": True, }, ) other__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_other", title="Extension field for ``other``." ) page: typing.List[fhirtypes.ImplementationGuideManifestPageType] | None = Field( default=None, alias="page", title="HTML page within the parent IG", description="Information about a page within the IG.", json_schema_extra={ "element_property": True, }, ) rendering: fhirtypes.UrlType | None = Field( default=None, alias="rendering", title="Location of rendered implementation guide", description=( "A pointer to official web page, PDF or other rendering of the " "implementation guide." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) rendering__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rendering", title="Extension field for ``rendering``." ) resource: typing.List[fhirtypes.ImplementationGuideManifestResourceType] = Field( default=..., alias="resource", title="Resource in the implementation guide", description=( "A resource that is part of the implementation guide. Conformance " "resources (value set, structure definition, capability statements " "etc.) are obvious candidates for inclusion, but any kind of resource " "can be included as an example resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuideManifest`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "rendering", "resource", "page", "image", "other", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuideManifest`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "rendering", "resource"] class ImplementationGuideManifestPage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. HTML page within the parent IG. Information about a page within the IG. """ __resource_type__ = "ImplementationGuideManifestPage" anchor: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="anchor", title="Anchor available on the page", description="The name of an anchor available on the page.", json_schema_extra={ "element_property": True, }, ) anchor__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_anchor", title="Extension field for ``anchor``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="HTML page name", description="Relative path to the page.", json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Title of the page, for references", description="Label for the page intended for human display.", json_schema_extra={ "element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuideManifestPage`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "title", "anchor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuideManifestPage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields class ImplementationGuideManifestResource(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Resource in the implementation guide. A resource that is part of the implementation guide. Conformance resources (value set, structure definition, capability statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource. """ __resource_type__ = "ImplementationGuideManifestResource" exampleBoolean: bool | None = Field( default=None, alias="exampleBoolean", title="Is an example/What is this an example of?", description=( "If true or a reference, indicates the resource is an example instance." " If a reference is present, indicates that the example is an example " "of the specified profile." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e example[x] "one_of_many": "example", "one_of_many_required": False, }, ) exampleBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_exampleBoolean", title="Extension field for ``exampleBoolean``.", ) exampleCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="exampleCanonical", title="Is an example/What is this an example of?", description=( "If true or a reference, indicates the resource is an example instance." " If a reference is present, indicates that the example is an example " "of the specified profile." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e example[x] "one_of_many": "example", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) exampleCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_exampleCanonical", title="Extension field for ``exampleCanonical``.", ) reference: fhirtypes.ReferenceType = Field( default=..., alias="reference", title="Location of the resource", description="Where this resource is found.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) relativePath: fhirtypes.UrlType | None = Field( default=None, alias="relativePath", title="Relative path for page in IG", description="The relative path for primary page for this resource within the IG.", json_schema_extra={ "element_property": True, }, ) relativePath__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_relativePath", title="Extension field for ``relativePath``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuideManifestResource`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "reference", "exampleBoolean", "exampleCanonical", "relativePath", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuideManifestResource`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "reference"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"example": ["exampleBoolean", "exampleCanonical"]} return one_of_many_fields ================================================ FILE: fhir/resources/R4B/ingredient.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Ingredient Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Ingredient(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An ingredient of a manufactured item or pharmaceutical product. """ __resource_type__ = "Ingredient" allergenicIndicator: bool | None = Field( default=None, alias="allergenicIndicator", title="If the ingredient is a known or suspected allergen", description=( "If the ingredient is a known or suspected allergen. Note that this is " "a property of the substance, so if a reference to a " "SubstanceDefinition is used to decribe that (rather than just a code)," " the allergen information should go there, not here." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) allergenicIndicator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allergenicIndicator", title="Extension field for ``allergenicIndicator``.", ) for_fhir: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="for", title="The product which this ingredient is a constituent part of", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "MedicinalProductDefinition", "AdministrableProductDefinition", "ManufacturedItemDefinition", ], }, ) function: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="function", title=( "Precise action within the drug product, e.g. antioxidant, alkalizing " "agent" ), description=( "A classification of the ingredient identifying its precise purpose(s) " "in the drug product. This extends the Ingredient.role to add more " "detail. Example: antioxidant, alkalizing agent." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="An identifier or code by which the ingredient can be referenced", description=( "The identifier(s) of this Ingredient that are assigned by business " "processes and/or used to refer to it when a direct URL reference to " "the resource itself is not appropriate." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) manufacturer: typing.List[fhirtypes.IngredientManufacturerType] | None = Field( default=None, alias="manufacturer", title="An organization that manufactures this ingredient", description=( "The organization(s) that manufacture this ingredient. Can be used to " "indicate: 1) Organizations we are aware of that manufacture " "this ingredient 2) Specific Manufacturer(s) currently being " "used 3) Set of organisations allowed to manufacture this " "ingredient for this product Users must be clear on the " "application of context relevant to their use case." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) role: fhirtypes.CodeableConceptType = Field( default=..., alias="role", title="Purpose of the ingredient within the product, e.g. active, inactive", description=( "A classification of the ingredient identifying its purpose within the " "product, e.g. active, inactive." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this ingredient. Enables tracking the life-cycle of the " "content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) substance: fhirtypes.IngredientSubstanceType = Field( default=..., alias="substance", title="The substance that comprises this ingredient", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Ingredient`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "for", "role", "function", "allergenicIndicator", "manufacturer", "substance", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Ingredient`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "for", "role", "function", "allergenicIndicator", "manufacturer", "substance", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class IngredientManufacturer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An organization that manufactures this ingredient. The organization(s) that manufacture this ingredient. Can be used to indicate: 1) Organizations we are aware of that manufacture this ingredient 2) Specific Manufacturer(s) currently being used 3) Set of organisations allowed to manufacture this ingredient for this product Users must be clear on the application of context relevant to their use case. """ __resource_type__ = "IngredientManufacturer" manufacturer: fhirtypes.ReferenceType = Field( default=..., alias="manufacturer", title="An organization that manufactures this ingredient", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) role: fhirtypes.CodeType | None = Field( default=None, alias="role", title="allowed | possible | actual", description=( "The way in which this manufacturer is associated with the ingredient. " "For example whether it is a possible one (others allowed), or an " "exclusive authorized one for this ingredient. Note that this is not " "the manufacturing process role." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["allowed", "possible", "actual"], }, ) role__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_role", title="Extension field for ``role``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``IngredientManufacturer`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "role", "manufacturer"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``IngredientManufacturer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "role", "manufacturer"] class IngredientSubstance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The substance that comprises this ingredient. """ __resource_type__ = "IngredientSubstance" code: fhirtypes.CodeableReferenceType = Field( default=..., alias="code", title="A code or full resource that represents the ingredient substance", description="A code or full resource that represents the ingredient's substance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SubstanceDefinition"], }, ) strength: typing.List[fhirtypes.IngredientSubstanceStrengthType] | None = Field( default=None, alias="strength", title=( "The quantity of substance, per presentation, or per volume or mass, " "and type of quantity" ), description=( "The quantity of substance in the unit of presentation, or in the " "volume (or mass) of the single pharmaceutical product or manufactured " "item. The allowed repetitions do not represent different strengths, " "but are different representations - mathematically equivalent - of a " "single strength." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``IngredientSubstance`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "strength"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``IngredientSubstance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "strength"] class IngredientSubstanceStrength(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The quantity of substance, per presentation, or per volume or mass, and type of quantity. The quantity of substance in the unit of presentation, or in the volume (or mass) of the single pharmaceutical product or manufactured item. The allowed repetitions do not represent different strengths, but are different representations - mathematically equivalent - of a single strength. """ __resource_type__ = "IngredientSubstanceStrength" concentrationRatio: fhirtypes.RatioType | None = Field( default=None, alias="concentrationRatio", title="The strength per unitary volume (or mass)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e concentration[x] "one_of_many": "concentration", "one_of_many_required": False, }, ) concentrationRatioRange: fhirtypes.RatioRangeType | None = Field( default=None, alias="concentrationRatioRange", title="The strength per unitary volume (or mass)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e concentration[x] "one_of_many": "concentration", "one_of_many_required": False, }, ) country: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="country", title="Where the strength range applies", description="The country or countries for which the strength range applies.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) measurementPoint: fhirtypes.StringType | None = Field( default=None, alias="measurementPoint", title="When strength is measured at a particular point or distance", description=( "For when strength is measured at a particular point or distance. There" " are products where strength is measured at a particular point. For " "example, the strength of the ingredient in some inhalers is measured " "at a particular position relative to the point of aerosolization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) measurementPoint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_measurementPoint", title="Extension field for ``measurementPoint``.", ) presentationRatio: fhirtypes.RatioType | None = Field( default=None, alias="presentationRatio", title="The quantity of substance in the unit of presentation", description=( "The quantity of substance in the unit of presentation, or in the " "volume (or mass) of the single pharmaceutical product or manufactured " "item. Unit of presentation refers to the quantity that the item occurs" " in e.g. a strength per tablet size, perhaps 'per 20mg' (the size of " "the tablet). It is not generally normalized as a unitary unit, which " "would be 'per mg')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e presentation[x] "one_of_many": "presentation", "one_of_many_required": False, }, ) presentationRatioRange: fhirtypes.RatioRangeType | None = Field( default=None, alias="presentationRatioRange", title="The quantity of substance in the unit of presentation", description=( "The quantity of substance in the unit of presentation, or in the " "volume (or mass) of the single pharmaceutical product or manufactured " "item. Unit of presentation refers to the quantity that the item occurs" " in e.g. a strength per tablet size, perhaps 'per 20mg' (the size of " "the tablet). It is not generally normalized as a unitary unit, which " "would be 'per mg')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e presentation[x] "one_of_many": "presentation", "one_of_many_required": False, }, ) referenceStrength: typing.List[ fhirtypes.IngredientSubstanceStrengthReferenceStrengthType ] | None = Field( default=None, alias="referenceStrength", title="Strength expressed in terms of a reference substance", description=( "Strength expressed in terms of a reference substance. For when the " "ingredient strength is additionally expressed as equivalent to the " "strength of some other closely related substance (e.g. salt vs. base)." " Reference strength represents the strength (quantitative composition)" " of the active moiety of the active substance. There are situations " "when the active substance and active moiety are different, therefore " "both a strength and a reference strength are needed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) textConcentration: fhirtypes.StringType | None = Field( default=None, alias="textConcentration", title=( "Text of either the whole concentration strength or a part of it (rest " "being in Strength.concentration as a ratio)" ), description=( "A textual represention of either the whole of the concentration " "strength or a part of it - with the rest being in " "Strength.concentration as a ratio." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) textConcentration__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_textConcentration", title="Extension field for ``textConcentration``.", ) textPresentation: fhirtypes.StringType | None = Field( default=None, alias="textPresentation", title=( "Text of either the whole presentation strength or a part of it (rest " "being in Strength.presentation as a ratio)" ), description=( "A textual represention of either the whole of the presentation " "strength or a part of it - with the rest being in " "Strength.presentation as a ratio." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) textPresentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_textPresentation", title="Extension field for ``textPresentation``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``IngredientSubstanceStrength`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "presentationRatio", "presentationRatioRange", "textPresentation", "concentrationRatio", "concentrationRatioRange", "textConcentration", "measurementPoint", "country", "referenceStrength", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``IngredientSubstanceStrength`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "presentationRatio", "presentationRatioRange", "textPresentation", "concentrationRatio", "concentrationRatioRange", "textConcentration", "measurementPoint", "country", "referenceStrength", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "concentration": ["concentrationRatio", "concentrationRatioRange"], "presentation": ["presentationRatio", "presentationRatioRange"], } return one_of_many_fields class IngredientSubstanceStrengthReferenceStrength(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Strength expressed in terms of a reference substance. Strength expressed in terms of a reference substance. For when the ingredient strength is additionally expressed as equivalent to the strength of some other closely related substance (e.g. salt vs. base). Reference strength represents the strength (quantitative composition) of the active moiety of the active substance. There are situations when the active substance and active moiety are different, therefore both a strength and a reference strength are needed. """ __resource_type__ = "IngredientSubstanceStrengthReferenceStrength" country: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="country", title="Where the strength range applies", description="The country or countries for which the strength range applies.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) measurementPoint: fhirtypes.StringType | None = Field( default=None, alias="measurementPoint", title="When strength is measured at a particular point or distance", description="For when strength is measured at a particular point or distance.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) measurementPoint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_measurementPoint", title="Extension field for ``measurementPoint``.", ) strengthRatio: fhirtypes.RatioType | None = Field( default=None, alias="strengthRatio", title="Strength expressed in terms of a reference substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e strength[x] "one_of_many": "strength", "one_of_many_required": True, }, ) strengthRatioRange: fhirtypes.RatioRangeType | None = Field( default=None, alias="strengthRatioRange", title="Strength expressed in terms of a reference substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e strength[x] "one_of_many": "strength", "one_of_many_required": True, }, ) substance: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="substance", title="Relevant reference substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SubstanceDefinition"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``IngredientSubstanceStrengthReferenceStrength`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "substance", "strengthRatio", "strengthRatioRange", "measurementPoint", "country", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``IngredientSubstanceStrengthReferenceStrength`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "substance", "strengthRatio", "strengthRatioRange", "measurementPoint", "country", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"strength": ["strengthRatio", "strengthRatioRange"]} return one_of_many_fields ================================================ FILE: fhir/resources/R4B/insuranceplan.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/InsurancePlan Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class InsurancePlan(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details of a Health Insurance product/plan provided by an organization. """ __resource_type__ = "InsurancePlan" administeredBy: fhirtypes.ReferenceType | None = Field( default=None, alias="administeredBy", title="Product administrator", description=( "An organization which administer other services such as underwriting, " "customer service and/or claims processing on behalf of the health " "insurance product owner." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) alias: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="alias", title="Alternate names", description=( "A list of alternate names that the product is known as, or was known " "as in the past." ), json_schema_extra={ "element_property": True, }, ) alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_alias", title="Extension field for ``alias``." ) contact: typing.List[fhirtypes.InsurancePlanContactType] | None = Field( default=None, alias="contact", title="Contact for the product", description="The contact for the health insurance product for a certain purpose.", json_schema_extra={ "element_property": True, }, ) coverage: typing.List[fhirtypes.InsurancePlanCoverageType] | None = Field( default=None, alias="coverage", title="Coverage details", description="Details about the coverage offered by the insurance product.", json_schema_extra={ "element_property": True, }, ) coverageArea: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="coverageArea", title="Where product applies", description=( "The geographic region in which a health insurance product's benefits " "apply." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title="Technical endpoint", description=( "The technical endpoints providing access to services operated for the " "health insurance product." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for Product", description=( "Business identifiers assigned to this health insurance product which " "remain constant as the resource is updated and propagates from server " "to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Official name", description=( "Official name of the health insurance product as designated by the " "owner." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) network: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="network", title="What networks are Included", description="Reference to the network included in the health insurance product.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) ownedBy: fhirtypes.ReferenceType | None = Field( default=None, alias="ownedBy", title="Plan issuer", description=( "The entity that is providing the health insurance product and " "underwriting the risk. This is typically an insurance carriers, other" " third-party payers, or health plan sponsors comonly referred to as " "'payers'." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="When the product is available", description="The period of time that the health insurance product is available.", json_schema_extra={ "element_property": True, }, ) plan: typing.List[fhirtypes.InsurancePlanPlanType] | None = Field( default=None, alias="plan", title="Plan details", description="Details about an insurance plan.", json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description="The current state of the health insurance product.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Kind of product", description="The kind of health insurance product.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InsurancePlan`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "type", "name", "alias", "period", "ownedBy", "administeredBy", "coverageArea", "contact", "endpoint", "network", "coverage", "plan", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InsurancePlan`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "type", "name", "ownedBy", "administeredBy", "coverageArea", ] class InsurancePlanContact(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contact for the product. The contact for the health insurance product for a certain purpose. """ __resource_type__ = "InsurancePlanContact" address: fhirtypes.AddressType | None = Field( default=None, alias="address", title="Visiting or postal addresses for the contact", description=None, json_schema_extra={ "element_property": True, }, ) name: fhirtypes.HumanNameType | None = Field( default=None, alias="name", title="A name associated with the contact", description=None, json_schema_extra={ "element_property": True, }, ) purpose: fhirtypes.CodeableConceptType | None = Field( default=None, alias="purpose", title="The type of contact", description="Indicates a purpose for which the contact can be reached.", json_schema_extra={ "element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="Contact details (telephone, email, etc.) for a contact", description=( "A contact detail (e.g. a telephone number or an email address) by " "which the party may be contacted." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InsurancePlanContact`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "purpose", "name", "telecom", "address", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InsurancePlanContact`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class InsurancePlanCoverage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Coverage details. Details about the coverage offered by the insurance product. """ __resource_type__ = "InsurancePlanCoverage" benefit: typing.List[fhirtypes.InsurancePlanCoverageBenefitType] = Field( default=..., alias="benefit", title="List of benefits", description="Specific benefits under this type of coverage.", json_schema_extra={ "element_property": True, }, ) network: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="network", title="What networks provide coverage", description="Reference to the network that providing the type of coverage.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Type of coverage", description=( "Type of coverage (Medical; Dental; Mental Health; Substance Abuse; " "Vision; Drug; Short Term; Long Term Care; Hospice; Home Health)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InsurancePlanCoverage`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "network", "benefit"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InsurancePlanCoverage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class InsurancePlanCoverageBenefit(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. List of benefits. Specific benefits under this type of coverage. """ __resource_type__ = "InsurancePlanCoverageBenefit" limit: typing.List[fhirtypes.InsurancePlanCoverageBenefitLimitType] | None = Field( default=None, alias="limit", title="Benefit limits", description="The specific limits on the benefit.", json_schema_extra={ "element_property": True, }, ) requirement: fhirtypes.StringType | None = Field( default=None, alias="requirement", title="Referral requirements", description="The referral requirements to have access/coverage for this benefit.", json_schema_extra={ "element_property": True, }, ) requirement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requirement", title="Extension field for ``requirement``." ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Type of benefit", description=( "Type of benefit (primary care; speciality care; inpatient; " "outpatient)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InsurancePlanCoverageBenefit`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "requirement", "limit"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InsurancePlanCoverageBenefit`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class InsurancePlanCoverageBenefitLimit(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Benefit limits. The specific limits on the benefit. """ __resource_type__ = "InsurancePlanCoverageBenefitLimit" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Benefit limit details", description="The specific limit on the benefit.", json_schema_extra={ "element_property": True, }, ) value: fhirtypes.QuantityType | None = Field( default=None, alias="value", title="Maximum value allowed", description=( "The maximum amount of a service item a plan will pay for a covered " "benefit. For examples. wellness visits, or eyeglasses." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InsurancePlanCoverageBenefitLimit`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "value", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InsurancePlanCoverageBenefitLimit`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class InsurancePlanPlan(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Plan details. Details about an insurance plan. """ __resource_type__ = "InsurancePlanPlan" coverageArea: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="coverageArea", title="Where product applies", description=( "The geographic region in which a health insurance plan's benefits " "apply." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) generalCost: typing.List[fhirtypes.InsurancePlanPlanGeneralCostType] | None = Field( default=None, alias="generalCost", title="Overall costs", description="Overall costs associated with the plan.", json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for Product", description=( "Business identifiers assigned to this health insurance plan which " "remain constant as the resource is updated and propagates from server " "to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) network: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="network", title="What networks provide coverage", description="Reference to the network that providing the type of coverage.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) specificCost: typing.List[ fhirtypes.InsurancePlanPlanSpecificCostType ] | None = Field( default=None, alias="specificCost", title="Specific costs", description="Costs associated with the coverage provided by the product.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Type of plan", description='Type of plan. For example, "Platinum" or "High Deductable".', json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InsurancePlanPlan`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "type", "coverageArea", "network", "generalCost", "specificCost", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InsurancePlanPlan`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "identifier", "coverageArea"] class InsurancePlanPlanGeneralCost(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Overall costs. Overall costs associated with the plan. """ __resource_type__ = "InsurancePlanPlanGeneralCost" comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Additional cost information", description=( "Additional information about the general costs associated with this " "plan." ), json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) cost: fhirtypes.MoneyType | None = Field( default=None, alias="cost", title="Cost value", description="Value of the cost.", json_schema_extra={ "element_property": True, }, ) groupSize: fhirtypes.PositiveIntType | None = Field( default=None, alias="groupSize", title="Number of enrollees", description="Number of participants enrolled in the plan.", json_schema_extra={ "element_property": True, }, ) groupSize__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_groupSize", title="Extension field for ``groupSize``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Type of cost", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InsurancePlanPlanGeneralCost`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "groupSize", "cost", "comment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InsurancePlanPlanGeneralCost`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class InsurancePlanPlanSpecificCost(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specific costs. Costs associated with the coverage provided by the product. """ __resource_type__ = "InsurancePlanPlanSpecificCost" benefit: typing.List[ fhirtypes.InsurancePlanPlanSpecificCostBenefitType ] | None = Field( default=None, alias="benefit", title="Benefits list", description="List of the specific benefits under this category of benefit.", json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType = Field( default=..., alias="category", title="General category of benefit", description=( "General category of benefit (Medical; Dental; Vision; Drug; Mental " "Health; Substance Abuse; Hospice, Home Health)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InsurancePlanPlanSpecificCost`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "category", "benefit"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InsurancePlanPlanSpecificCost`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class InsurancePlanPlanSpecificCostBenefit(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Benefits list. List of the specific benefits under this category of benefit. """ __resource_type__ = "InsurancePlanPlanSpecificCostBenefit" cost: typing.List[ fhirtypes.InsurancePlanPlanSpecificCostBenefitCostType ] | None = Field( default=None, alias="cost", title="List of the costs", description="List of the costs associated with a specific benefit.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Type of specific benefit", description=( "Type of specific benefit (preventative; primary care office visit; " "speciality office visit; hospitalization; emergency room; urgent " "care)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InsurancePlanPlanSpecificCostBenefit`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "cost"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InsurancePlanPlanSpecificCostBenefit`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class InsurancePlanPlanSpecificCostBenefitCost(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. List of the costs. List of the costs associated with a specific benefit. """ __resource_type__ = "InsurancePlanPlanSpecificCostBenefitCost" applicability: fhirtypes.CodeableConceptType | None = Field( default=None, alias="applicability", title="in-network | out-of-network | other", description=( "Whether the cost applies to in-network or out-of-network providers " "(in-network; out-of-network; other)." ), json_schema_extra={ "element_property": True, }, ) qualifiers: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="qualifiers", title="Additional information about the cost", description=( "Additional information about the cost, such as information about " "funding sources (e.g. HSA, HRA, FSA, RRA)." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Type of cost", description=( "Type of cost (copay; individual cap; family cap; coinsurance; " "deductible)." ), json_schema_extra={ "element_property": True, }, ) value: fhirtypes.QuantityType | None = Field( default=None, alias="value", title="The actual cost value", description=( "The actual cost value. (some of the costs may be represented as " "percentages rather than currency, e.g. 10% coinsurance)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InsurancePlanPlanSpecificCostBenefitCost`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "applicability", "qualifiers", "value", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InsurancePlanPlanSpecificCostBenefitCost`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/invoice.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Invoice Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Invoice(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Invoice containing ChargeItems from an Account. Invoice containing collected ChargeItems from an Account with calculated individual and total price for Billing purpose. """ __resource_type__ = "Invoice" account: fhirtypes.ReferenceType | None = Field( default=None, alias="account", title="Account that is being balanced", description="Account which is supposed to be balanced with this Invoice.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Account"], }, ) cancelledReason: fhirtypes.StringType | None = Field( default=None, alias="cancelledReason", title="Reason for cancellation of this Invoice", description=( "In case of Invoice cancellation a reason must be given (entered in " "error, superseded by corrected invoice etc.)." ), json_schema_extra={ "element_property": True, }, ) cancelledReason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_cancelledReason", title="Extension field for ``cancelledReason``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Invoice date / posting date", description="Date/time(s) of when this Invoice was posted.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for item", description=( "Identifier of this Invoice, often used for reference in correspondence" " about this invoice or for tracking of payments." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issuer: fhirtypes.ReferenceType | None = Field( default=None, alias="issuer", title="Issuing Organization of Invoice", description="The organizationissuing the Invoice.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) lineItem: typing.List[fhirtypes.InvoiceLineItemType] | None = Field( default=None, alias="lineItem", title="Line items of this Invoice", description=( "Each line item represents one charge for goods and services rendered. " "Details such as date, code and amount are found in the referenced " "ChargeItem resource." ), json_schema_extra={ "element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the invoice", description=( "Comments made about the invoice by the issuer, subject, or other " "participants." ), json_schema_extra={ "element_property": True, }, ) participant: typing.List[fhirtypes.InvoiceParticipantType] | None = Field( default=None, alias="participant", title="Participant in creation of this Invoice", description=( "Indicates who or what performed or participated in the charged " "service." ), json_schema_extra={ "element_property": True, }, ) paymentTerms: fhirtypes.MarkdownType | None = Field( default=None, alias="paymentTerms", title="Payment details", description=( "Payment details such as banking details, period of payment, " "deductibles, methods of payment." ), json_schema_extra={ "element_property": True, }, ) paymentTerms__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_paymentTerms", title="Extension field for ``paymentTerms``.", ) recipient: fhirtypes.ReferenceType | None = Field( default=None, alias="recipient", title="Recipient of this invoice", description=( "The individual or Organization responsible for balancing of this " "invoice." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization", "Patient", "RelatedPerson"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | issued | balanced | cancelled | entered-in-error", description="The current state of the Invoice.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "draft", "issued", "balanced", "cancelled", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Recipient(s) of goods and services", description=( "The individual or set of individuals receiving the goods and services " "billed in this invoice." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) totalGross: fhirtypes.MoneyType | None = Field( default=None, alias="totalGross", title="Gross total of this Invoice", description="Invoice total, tax included.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) totalNet: fhirtypes.MoneyType | None = Field( default=None, alias="totalNet", title="Net total of this Invoice", description="Invoice total , taxes excluded.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) totalPriceComponent: typing.List[ fhirtypes.InvoiceLineItemPriceComponentType ] | None = Field( default=None, alias="totalPriceComponent", title="Components of Invoice total", description=( "The total amount for the Invoice may be calculated as the sum of the " "line items with surcharges/deductions that apply in certain " "conditions. The priceComponent element can be used to offer " "transparency to the recipient of the Invoice of how the total price " "was calculated." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Type of Invoice", description=( "Type of Invoice depending on domain, realm an usage (e.g. " "internal/external, dental, preliminary)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Invoice`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "cancelledReason", "type", "subject", "recipient", "date", "participant", "issuer", "account", "lineItem", "totalPriceComponent", "totalNet", "totalGross", "paymentTerms", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Invoice`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "type", "subject", "recipient", "date", "totalNet", "totalGross", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class InvoiceLineItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Line items of this Invoice. Each line item represents one charge for goods and services rendered. Details such as date, code and amount are found in the referenced ChargeItem resource. """ __resource_type__ = "InvoiceLineItem" chargeItemCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="chargeItemCodeableConcept", title=( "Reference to ChargeItem containing details of this line item or an " "inline billing code" ), description=( "The ChargeItem contains information such as the billing code, date, " "amount etc. If no further details are required for the lineItem, " "inline billing codes can be added using the CodeableConcept data type " "instead of the Reference." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e chargeItem[x] "one_of_many": "chargeItem", "one_of_many_required": True, }, ) chargeItemReference: fhirtypes.ReferenceType | None = Field( default=None, alias="chargeItemReference", title=( "Reference to ChargeItem containing details of this line item or an " "inline billing code" ), description=( "The ChargeItem contains information such as the billing code, date, " "amount etc. If no further details are required for the lineItem, " "inline billing codes can be added using the CodeableConcept data type " "instead of the Reference." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e chargeItem[x] "one_of_many": "chargeItem", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ChargeItem"], }, ) priceComponent: typing.List[ fhirtypes.InvoiceLineItemPriceComponentType ] | None = Field( default=None, alias="priceComponent", title="Components of total line item price", description=( "The price for a ChargeItem may be calculated as a base price with " "surcharges/deductions that apply in certain conditions. A " "ChargeItemDefinition resource that defines the prices, factors and " "conditions that apply to a billing code is currently under " "development. The priceComponent element can be used to offer " "transparency to the recipient of the Invoice as to how the prices have" " been calculated." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Sequence number of line item", description="Sequence in which the items appear on the invoice.", json_schema_extra={ "element_property": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InvoiceLineItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "chargeItemReference", "chargeItemCodeableConcept", "priceComponent", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InvoiceLineItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "chargeItem": ["chargeItemCodeableConcept", "chargeItemReference"] } return one_of_many_fields class InvoiceLineItemPriceComponent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Components of total line item price. The price for a ChargeItem may be calculated as a base price with surcharges/deductions that apply in certain conditions. A ChargeItemDefinition resource that defines the prices, factors and conditions that apply to a billing code is currently under development. The priceComponent element can be used to offer transparency to the recipient of the Invoice as to how the prices have been calculated. """ __resource_type__ = "InvoiceLineItemPriceComponent" amount: fhirtypes.MoneyType | None = Field( default=None, alias="amount", title="Monetary amount associated with this component", description="The amount calculated for this component.", json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Code identifying the specific component", description=( "A code that identifies the component. Codes may be used to " "differentiate between kinds of taxes, surcharges, discounts etc." ), json_schema_extra={ "element_property": True, }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Factor used for calculating this component", description=( "The factor that has been applied on the base price for calculating " "this component." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="base | surcharge | deduction | discount | tax | informational", description="This code identifies the type of the component.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "base", "surcharge", "deduction", "discount", "tax", "informational", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InvoiceLineItemPriceComponent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "code", "factor", "amount", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InvoiceLineItemPriceComponent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields class InvoiceParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Participant in creation of this Invoice. Indicates who or what performed or participated in the charged service. """ __resource_type__ = "InvoiceParticipant" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Individual who was involved", description=( "The device, practitioner, etc. who performed or participated in the " "service." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Organization", "Patient", "PractitionerRole", "Device", "RelatedPerson", ], }, ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="Type of involvement in creation of this Invoice", description=( "Describes the type of involvement (e.g. transcriptionist, creator " "etc.). If the invoice has been created automatically, the Participant " "may be a billing engine or another kind of device." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InvoiceParticipant`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "role", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InvoiceParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/library.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Library Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class Library(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Represents a library of quality improvement components. The Library resource is a general-purpose container for knowledge asset definitions. It can be used to describe and expose existing knowledge assets such as logic libraries and information model descriptions, as well as to describe a collection of knowledge assets. """ __resource_type__ = "Library" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the library was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the content", description=( "An individiual or organization primarily involved in the creation and " "maintenance of the content." ), json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) content: typing.List[fhirtypes.AttachmentType] | None = Field( default=None, alias="content", title="Contents of the library, either embedded or referenced", description=( "The content of the library as an Attachment. The content may be a " "reference to a url, or may be directly embedded as a base-64 string. " "Either way, the contentType of the attachment determines how to " "interpret the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the library and/or its contents. " "Copyright statements are generally legal restrictions on the use and " "publishing of the library." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) dataRequirement: typing.List[fhirtypes.DataRequirementType] | None = Field( default=None, alias="dataRequirement", title="What data is referenced by this library", description=( "Describes a set of data that must be provided in order to be able to " "successfully perform the computations defined by the library." ), json_schema_extra={ "element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the library was published. The " "date must change when the business version changes and it must change " "if the status code changes. In addition, it should change when the " "substantive content of the library changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the library", description=( "A free text natural language description of the library from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the content", description=( "An individual or organization primarily responsible for internal " "coherence of the content." ), json_schema_extra={ "element_property": True, }, ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the library is expected to be used", description=( "The period during which the library content was or is planned to be in" " active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the content", description=( "An individual or organization responsible for officially endorsing the" " content for use in some setting." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this library is authored for testing " "purposes (or education/evaluation/marketing) and is not intended to be" " used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the library", description=( "A formal identifier that is used to identify this library when it is " "represented in other formats, or referenced in a specification, model," " design or an instance. e.g. CMS or NQF identifiers for a measure " "artifact. Note that at least one identifier is required for non-" "experimental active artifacts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for library (if applicable)", description=( "A legal or geographic region in which the library is intended to be " "used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the library was last reviewed", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this library (computer friendly)", description=( "A natural language name identifying the library. This name should be " "usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) parameter: typing.List[fhirtypes.ParameterDefinitionType] | None = Field( default=None, alias="parameter", title="Parameters defined by the library", description="The parameter element defines parameters used by the library.", json_schema_extra={ "element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description="The name of the organization or individual that published the library.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this library is defined", description=( "Explanation of why this library is needed and why it has been designed" " as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Additional documentation, citations, etc.", description=( "Related artifacts such as additional documentation, justification, or " "bibliographic references." ), json_schema_extra={ "element_property": True, }, ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the content", description=( "An individual or organization primarily responsible for review of some" " aspect of the content." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this library. Enables tracking the life-cycle of the " "content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subjectCodeableConcept", title="Type of individual the library content is focused on", description=( "A code or group definition that describes the intended subject of the " "contents of the library." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, }, ) subjectReference: fhirtypes.ReferenceType | None = Field( default=None, alias="subjectReference", title="Type of individual the library content is focused on", description=( "A code or group definition that describes the intended subject of the " "contents of the library." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) subtitle: fhirtypes.StringType | None = Field( default=None, alias="subtitle", title="Subordinate title of the library", description=( "An explanatory or alternate title for the library giving additional " "information about its content." ), json_schema_extra={ "element_property": True, }, ) subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subtitle", title="Extension field for ``subtitle``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this library (human friendly)", description="A short, descriptive, user-friendly title for the library.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) topic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="topic", title="E.g. Education, Treatment, Assessment, etc.", description=( "Descriptive topics related to the content of the library. Topics " "provide a high-level categorization of the library that can be useful " "for filtering and searching." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title=( "logic-library | model-definition | asset-collection | module-" "definition" ), description=( "Identifies the type of library such as a Logic Library, Model " "Definition, Asset Collection, or Module Definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this library, represented as a URI (globally " "unique)" ), description=( "An absolute URI that is used to identify this library when it is " "referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which at which an authoritative " "instance of this library is (or will be) published. This URL can be " "the target of a canonical reference. It SHALL remain the same when the" " library is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) usage: fhirtypes.StringType | None = Field( default=None, alias="usage", title="Describes the clinical usage of the library", description=( "A detailed description of how the library is used from a clinical " "perspective." ), json_schema_extra={ "element_property": True, }, ) usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usage", title="Extension field for ``usage``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate library instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the library", description=( "The identifier that is used to identify this version of the library " "when it is referenced in a specification, model, design or instance. " "This is an arbitrary value managed by the library author and is not " "expected to be globally unique. For example, it might be a timestamp " "(e.g. yyyymmdd) if a managed version is not available. There is also " "no expectation that versions can be placed in a lexicographical " "sequence. To provide a version consistent with the Decision Support " "Service specification, use the format Major.Minor.Revision (e.g. " "1.0.0). For more information on versioning knowledge assets, refer to " "the Decision Support Service specification. Note that a version is " "required for non-experimental active artifacts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Library`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "subtitle", "status", "experimental", "type", "subjectCodeableConcept", "subjectReference", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "usage", "copyright", "approvalDate", "lastReviewDate", "effectivePeriod", "topic", "author", "editor", "reviewer", "endorser", "relatedArtifact", "parameter", "dataRequirement", "content", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Library`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "type", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "effectivePeriod", "content", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"subject": ["subjectCodeableConcept", "subjectReference"]} return one_of_many_fields ================================================ FILE: fhir/resources/R4B/linkage.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Linkage Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Linkage(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Links records for 'same' item. Identifies two or more records (resource instances) that refer to the same real-world "occurrence". """ __resource_type__ = "Linkage" active: bool | None = Field( default=None, alias="active", title="Whether this linkage assertion is active or not", description=( "Indicates whether the asserted set of linkages are considered to be " '"in effect".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="Who is responsible for linkages", description=( "Identifies the user or organization responsible for asserting the " "linkages as well as the user or organization who establishes the " "context in which the nature of each linkage is evaluated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) item: typing.List[fhirtypes.LinkageItemType] = Field( default=..., alias="item", title="Item to be linked", description=( "Identifies which record considered as the reference to the same real-" "world occurrence as well as how the items should be evaluated within " "the collection of linked items." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Linkage`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "active", "author", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Linkage`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "active", "author", "item"] class LinkageItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Item to be linked. Identifies which record considered as the reference to the same real-world occurrence as well as how the items should be evaluated within the collection of linked items. """ __resource_type__ = "LinkageItem" resource: fhirtypes.ReferenceType = Field( default=..., alias="resource", title="Resource being linked", description="The resource instance being linked as part of the group.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="source | alternate | historical", description=( 'Distinguishes which item is "source of truth" (if any) and which items' " are no longer considered to be current representations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["source", "alternate", "historical"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``LinkageItem`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "resource"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``LinkageItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "resource"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/list.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/List Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class List(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A list is a curated collection of resources. """ __resource_type__ = "List" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="What the purpose of this list is", description="This code defines the purpose of the list - why it was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When the list was prepared", description="The date that the list was prepared.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) emptyReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="emptyReason", title="Why list is empty", description="If the list is empty, why the list is empty.", json_schema_extra={ "element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Context in which list created", description="The encounter that is the context in which this list was created.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) entry: typing.List[fhirtypes.ListEntryType] | None = Field( default=None, alias="entry", title="Entries in the list", description="Entries in this list.", json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description=( "Identifier for the List assigned for business purposes outside the " "context of FHIR." ), json_schema_extra={ "element_property": True, }, ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="working | snapshot | changes", description=( "How this list was prepared - whether it is a working list that is " "suitable for being maintained on an ongoing basis, or if it represents" " a snapshot of a list of items from another source, or whether it is a" " prepared list where items may be marked as added, modified or " "deleted." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["working", "snapshot", "changes"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments about the list", description="Comments that apply to the overall list.", json_schema_extra={ "element_property": True, }, ) orderedBy: fhirtypes.CodeableConceptType | None = Field( default=None, alias="orderedBy", title="What order the list has", description="What order applies to the items in the list.", json_schema_extra={ "element_property": True, }, ) source: fhirtypes.ReferenceType | None = Field( default=None, alias="source", title="Who and/or what defined the list contents (aka Author)", description=( "The entity responsible for deciding what the contents of the list " "were. Where the list was created by a human, this is the same as the " "author of the list." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Patient", "Device", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="current | retired | entered-in-error", description="Indicates the current state of this list.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["current", "retired", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="If all resources have the same subject", description=( "The common subject (or patient) of the resources that are in the list " "if there is one." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group", "Device", "Location"], }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Descriptive name for the list", description="A label for the list assigned by the author.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``List`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "mode", "title", "code", "subject", "encounter", "date", "source", "orderedBy", "note", "entry", "emptyReason", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``List`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "status", "mode", "title", "code", "subject", "date", "source", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("mode", "mode__ext"), ("status", "status__ext")] return required_fields class ListEntry(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Entries in the list. Entries in this list. """ __resource_type__ = "ListEntry" date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When item added to list", description="When this item was added to the list.", json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) deleted: bool | None = Field( default=None, alias="deleted", title="If this item is actually marked as deleted", description="True if this item is marked as deleted in the list.", json_schema_extra={ "element_property": True, }, ) deleted__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deleted", title="Extension field for ``deleted``." ) flag: fhirtypes.CodeableConceptType | None = Field( default=None, alias="flag", title="Status/Workflow information about this item", description=( "The flag allows the system constructing the list to indicate the role " "and significance of the item in the list." ), json_schema_extra={ "element_property": True, }, ) item: fhirtypes.ReferenceType = Field( default=..., alias="item", title="Actual entry", description="A reference to the actual resource from which data was derived.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ListEntry`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "flag", "deleted", "date", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ListEntry`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/location.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Location Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Location(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details and position information for a physical place. Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained, or accommodated. """ __resource_type__ = "Location" address: fhirtypes.AddressType | None = Field( default=None, alias="address", title="Physical location", description=None, json_schema_extra={ "element_property": True, }, ) alias: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="alias", title=( "A list of alternate names that the location is known as, or was known " "as, in the past" ), description=None, json_schema_extra={ "element_property": True, }, ) alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_alias", title="Extension field for ``alias``." ) availabilityExceptions: fhirtypes.StringType | None = Field( default=None, alias="availabilityExceptions", title="Description of availability exceptions", description=( "A description of when the locations opening ours are different to " "normal, e.g. public holiday availability. Succinctly describing all " "possible exceptions to normal site availability as detailed in the " "opening hours Times." ), json_schema_extra={ "element_property": True, }, ) availabilityExceptions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_availabilityExceptions", title="Extension field for ``availabilityExceptions``.", ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title=( "Additional details about the location that could be displayed as " "further information to identify the location beyond its name" ), description=( "Description of the Location, which helps in finding or referencing the" " place." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title=( "Technical endpoints providing access to services operated for the " "location" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) hoursOfOperation: typing.List[ fhirtypes.LocationHoursOfOperationType ] | None = Field( default=None, alias="hoursOfOperation", title="What days/times during a week is this location usually open", description=None, json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique code or number identifying the location to its users", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) managingOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="managingOrganization", title="Organization responsible for provisioning and upkeep", description=( "The organization responsible for the provisioning and upkeep of the " "location." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="instance | kind", description=( "Indicates whether a resource instance represents a specific location " "or a class of locations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["instance", "kind"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name of the location as used by humans", description="Name of the location as used by humans. Does not need to be unique.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) operationalStatus: fhirtypes.CodingType | None = Field( default=None, alias="operationalStatus", title="The operational status of the location (typically only for a bed/room)", description=( "The operational status covers operation values most relevant to beds " "(but can also apply to rooms/units/chairs/etc. such as an isolation " "unit/dialysis chair). This typically covers concepts such as " "contamination, housekeeping, and other activities like maintenance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) partOf: fhirtypes.ReferenceType | None = Field( default=None, alias="partOf", title="Another Location this one is physically a part of", description="Another Location of which this Location is physically a part of.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) physicalType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="physicalType", title="Physical form of the location", description="Physical form of the location, e.g. building, room, vehicle, road.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) position: fhirtypes.LocationPositionType | None = Field( default=None, alias="position", title="The absolute geographic location", description=( "The absolute geographic location of the Location, expressed using the " "WGS84 datum (This is the same co-ordinate system used in KML)." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | suspended | inactive", description=( "The status property covers the general availability of the resource, " "not the current value which may be covered by the operationStatus, or " "by a schedule/slots if they are configured for the location." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "suspended", "inactive"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="Contact details of the location", description=( "The contact details of communication devices available at the " "location. This can include phone numbers, fax numbers, mobile numbers," " email addresses and web sites." ), json_schema_extra={ "element_property": True, }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Type of function performed", description="Indicates the type of function performed at the location.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Location`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "operationalStatus", "name", "alias", "description", "mode", "type", "telecom", "address", "physicalType", "position", "managingOrganization", "partOf", "hoursOfOperation", "availabilityExceptions", "endpoint", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Location`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "operationalStatus", "name", "description", "mode", "type", "physicalType", "managingOrganization", ] class LocationHoursOfOperation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What days/times during a week is this location usually open. """ __resource_type__ = "LocationHoursOfOperation" allDay: bool | None = Field( default=None, alias="allDay", title="The Location is open all day", description=None, json_schema_extra={ "element_property": True, }, ) allDay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allDay", title="Extension field for ``allDay``." ) closingTime: fhirtypes.TimeType | None = Field( default=None, alias="closingTime", title="Time that the Location closes", description=None, json_schema_extra={ "element_property": True, }, ) closingTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_closingTime", title="Extension field for ``closingTime``." ) daysOfWeek: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="daysOfWeek", title="mon | tue | wed | thu | fri | sat | sun", description=( "Indicates which days of the week are available between the start and " "end Times." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], }, ) daysOfWeek__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_daysOfWeek", title="Extension field for ``daysOfWeek``." ) openingTime: fhirtypes.TimeType | None = Field( default=None, alias="openingTime", title="Time that the Location opens", description=None, json_schema_extra={ "element_property": True, }, ) openingTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_openingTime", title="Extension field for ``openingTime``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``LocationHoursOfOperation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "daysOfWeek", "allDay", "openingTime", "closingTime", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``LocationHoursOfOperation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class LocationPosition(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The absolute geographic location. The absolute geographic location of the Location, expressed using the WGS84 datum (This is the same co-ordinate system used in KML). """ __resource_type__ = "LocationPosition" altitude: fhirtypes.DecimalType | None = Field( default=None, alias="altitude", title="Altitude with WGS84 datum", description=( "Altitude. The value domain and the interpretation are the same as for " "the text of the altitude element in KML (see notes below)." ), json_schema_extra={ "element_property": True, }, ) altitude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_altitude", title="Extension field for ``altitude``." ) latitude: fhirtypes.DecimalType | None = Field( default=None, alias="latitude", title="Latitude with WGS84 datum", description=( "Latitude. The value domain and the interpretation are the same as for " "the text of the latitude element in KML (see notes below)." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) latitude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_latitude", title="Extension field for ``latitude``." ) longitude: fhirtypes.DecimalType | None = Field( default=None, alias="longitude", title="Longitude with WGS84 datum", description=( "Longitude. The value domain and the interpretation are the same as for" " the text of the longitude element in KML (see notes below)." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) longitude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_longitude", title="Extension field for ``longitude``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``LocationPosition`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "longitude", "latitude", "altitude", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``LocationPosition`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("latitude", "latitude__ext"), ("longitude", "longitude__ext"), ] return required_fields ================================================ FILE: fhir/resources/R4B/manufactureditemdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ManufacturedItemDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ManufacturedItemDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The definition and characteristics of a medicinal manufactured item, such as a tablet or capsule, as contained in a packaged medicinal product. """ __resource_type__ = "ManufacturedItemDefinition" identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique identifier", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ingredient: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="ingredient", title=( "The ingredients of this manufactured item. Only needed if these are " "not specified by incoming references from the Ingredient resource" ), description=( "The ingredients of this manufactured item. This is only needed if the " "ingredients are not specified by incoming references from the " "Ingredient resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) manufacturedDoseForm: fhirtypes.CodeableConceptType = Field( default=..., alias="manufacturedDoseForm", title="Dose form as manufactured (before any necessary transformation)", description=( "Dose form as manufactured and before any transformation into the " "pharmaceutical product." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) manufacturer: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="manufacturer", title=( "Manufacturer of the item (Note that this should be named " '"manufacturer" but it currently causes technical issues)' ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) property: typing.List[ fhirtypes.ManufacturedItemDefinitionPropertyType ] | None = Field( default=None, alias="property", title="General characteristics of this item", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this item. Enables tracking the life-cycle of the " "content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) unitOfPresentation: fhirtypes.CodeableConceptType | None = Field( default=None, alias="unitOfPresentation", title="The \u201creal world\u201d units in which the quantity of the item is described", description=( "The \u201creal world\u201d units in which the quantity of the manufactured item " "is described." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ManufacturedItemDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "manufacturedDoseForm", "unitOfPresentation", "manufacturer", "ingredient", "property", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ManufacturedItemDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "manufacturedDoseForm", "unitOfPresentation", "manufacturer", "ingredient", "property", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class ManufacturedItemDefinitionProperty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. General characteristics of this item. """ __resource_type__ = "ManufacturedItemDefinitionProperty" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="A code expressing the type of characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ManufacturedItemDefinitionProperty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueCodeableConcept", "valueQuantity", "valueDate", "valueBoolean", "valueAttachment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ManufacturedItemDefinitionProperty`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "valueCodeableConcept", "valueQuantity", "valueDate", "valueBoolean", "valueAttachment", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueBoolean", "valueCodeableConcept", "valueDate", "valueQuantity", ] } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/marketingstatus.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MarketingStatus Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, fhirtypes class MarketingStatus(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The marketing status describes the date when a medicinal product is actually put on the market or the date as of which it is no longer available. """ __resource_type__ = "MarketingStatus" country: fhirtypes.CodeableConceptType | None = Field( default=None, alias="country", title=( "The country in which the marketing authorisation has been granted " "shall be specified It should be specified using the ISO 3166 \u2011 1 " "alpha-2 code elements" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dateRange: fhirtypes.PeriodType | None = Field( default=None, alias="dateRange", title=( "The date when the Medicinal Product is placed on the market by the " "Marketing Authorisation Holder (or where applicable, the " "manufacturer/distributor) in a country and/or jurisdiction shall be " "provided A complete date consisting of day, month and year shall be " "specified using the ISO 8601 date format NOTE \u201cPlaced on the market\u201d " "refers to the release of the Medicinal Product into the distribution " "chain" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: fhirtypes.CodeableConceptType | None = Field( default=None, alias="jurisdiction", title=( "Where a Medicines Regulatory Agency has granted a marketing " "authorisation for which specific provisions within a jurisdiction " "apply, the jurisdiction can be specified using an appropriate " "controlled terminology The controlled term and the controlled term " "identifier shall be specified" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) restoreDate: fhirtypes.DateTimeType | None = Field( default=None, alias="restoreDate", title=( "The date when the Medicinal Product is placed on the market by the " "Marketing Authorisation Holder (or where applicable, the " "manufacturer/distributor) in a country and/or jurisdiction shall be " "provided A complete date consisting of day, month and year shall be " "specified using the ISO 8601 date format NOTE \u201cPlaced on the market\u201d " "refers to the release of the Medicinal Product into the distribution " "chain" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) restoreDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_restoreDate", title="Extension field for ``restoreDate``." ) status: fhirtypes.CodeableConceptType = Field( default=..., alias="status", title=( "This attribute provides information on the status of the marketing of " "the medicinal product See ISO/TS 20443 for more information and " "examples" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MarketingStatus`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "country", "jurisdiction", "status", "dateRange", "restoreDate", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MarketingStatus`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "country", "jurisdiction", "status", "dateRange", "restoreDate", ] ================================================ FILE: fhir/resources/R4B/measure.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Measure Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Measure(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A quality measure definition. The Measure resource provides the definition of a quality measure. """ __resource_type__ = "Measure" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the measure was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the content", description=( "An individiual or organization primarily involved in the creation and " "maintenance of the content." ), json_schema_extra={ "element_property": True, }, ) clinicalRecommendationStatement: fhirtypes.MarkdownType | None = Field( default=None, alias="clinicalRecommendationStatement", title="Summary of clinical guidelines", description=( "Provides a summary of relevant clinical guidelines or other clinical " "recommendations supporting the measure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) clinicalRecommendationStatement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_clinicalRecommendationStatement", title="Extension field for ``clinicalRecommendationStatement``.", ) compositeScoring: fhirtypes.CodeableConceptType | None = Field( default=None, alias="compositeScoring", title="opportunity | all-or-nothing | linear | weighted", description=( "If this is a composite measure, the scoring method used to combine the" " component measures to determine the composite score." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the measure and/or its contents. " "Copyright statements are generally legal restrictions on the use and " "publishing of the measure." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the measure was published. The " "date must change when the business version changes and it must change " "if the status code changes. In addition, it should change when the " "substantive content of the measure changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) definition: typing.List[fhirtypes.MarkdownType | None] | None = Field( default=None, alias="definition", title="Defined terms used in the measure documentation", description="Provides a description of an individual term used within the measure.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) definition__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the measure", description=( "A free text natural language description of the measure from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) disclaimer: fhirtypes.MarkdownType | None = Field( default=None, alias="disclaimer", title="Disclaimer for use of the measure or its referenced content", description=( "Notices and disclaimers regarding the use of the measure or related to" " intellectual property (such as code systems) referenced by the " "measure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) disclaimer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_disclaimer", title="Extension field for ``disclaimer``." ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the content", description=( "An individual or organization primarily responsible for internal " "coherence of the content." ), json_schema_extra={ "element_property": True, }, ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the measure is expected to be used", description=( "The period during which the measure content was or is planned to be in" " active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the content", description=( "An individual or organization responsible for officially endorsing the" " content for use in some setting." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this measure is authored for testing " "purposes (or education/evaluation/marketing) and is not intended to be" " used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) group: typing.List[fhirtypes.MeasureGroupType] | None = Field( default=None, alias="group", title="Population criteria group", description="A group of population criteria for the measure.", json_schema_extra={ "element_property": True, }, ) guidance: fhirtypes.MarkdownType | None = Field( default=None, alias="guidance", title="Additional guidance for implementers", description=( "Additional guidance for the measure including how it can be used in a " "clinical context, and the intent of the measure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) guidance__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_guidance", title="Extension field for ``guidance``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the measure", description=( "A formal identifier that is used to identify this measure when it is " "represented in other formats, or referenced in a specification, model," " design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) improvementNotation: fhirtypes.CodeableConceptType | None = Field( default=None, alias="improvementNotation", title="increase | decrease", description=( "Information on whether an increase or decrease in score is the " "preferred result (e.g., a higher score indicates better quality OR a " "lower score indicates better quality OR quality is within a range)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for measure (if applicable)", description=( "A legal or geographic region in which the measure is intended to be " "used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the measure was last reviewed", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) library: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="library", title="Logic used by the measure", description=( "A reference to a Library resource containing the formal logic used by " "the measure." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Library"], }, ) library__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_library", title="Extension field for ``library``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this measure (computer friendly)", description=( "A natural language name identifying the measure. This name should be " "usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description="The name of the organization or individual that published the measure.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this measure is defined", description=( "Explanation of why this measure is needed and why it has been designed" " as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) rateAggregation: fhirtypes.StringType | None = Field( default=None, alias="rateAggregation", title="How is rate aggregation performed for this measure", description=( "Describes how to combine the information calculated, based on logic in" " each of several populations, into one summarized result." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) rateAggregation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rateAggregation", title="Extension field for ``rateAggregation``.", ) rationale: fhirtypes.MarkdownType | None = Field( default=None, alias="rationale", title="Detailed description of why the measure exists", description=( "Provides a succinct statement of the need for the measure. Usually " "includes statements pertaining to importance criterion: impact, gap in" " care, and evidence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) rationale__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rationale", title="Extension field for ``rationale``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Additional documentation, citations, etc.", description=( "Related artifacts such as additional documentation, justification, or " "bibliographic references." ), json_schema_extra={ "element_property": True, }, ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the content", description=( "An individual or organization primarily responsible for review of some" " aspect of the content." ), json_schema_extra={ "element_property": True, }, ) riskAdjustment: fhirtypes.StringType | None = Field( default=None, alias="riskAdjustment", title="How risk adjustment is applied for this measure", description=( "A description of the risk adjustment factors that may impact the " "resulting score for the measure and how they may be accounted for when" " computing and reporting measure results." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) riskAdjustment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_riskAdjustment", title="Extension field for ``riskAdjustment``.", ) scoring: fhirtypes.CodeableConceptType | None = Field( default=None, alias="scoring", title="proportion | ratio | continuous-variable | cohort", description=( "Indicates how the calculation is performed for the measure, including " "proportion, ratio, continuous-variable, and cohort. The value set is " "extensible, allowing additional measure scoring types to be " "represented." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this measure. Enables tracking the life-cycle of the " "content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subjectCodeableConcept", title=( "E.g. Patient, Practitioner, RelatedPerson, Organization, Location, " "Device" ), description=( "The intended subjects for the measure. If this element is not " "provided, a Patient subject is assumed, but the subject of the measure" " can be anything." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, }, ) subjectReference: fhirtypes.ReferenceType | None = Field( default=None, alias="subjectReference", title=( "E.g. Patient, Practitioner, RelatedPerson, Organization, Location, " "Device" ), description=( "The intended subjects for the measure. If this element is not " "provided, a Patient subject is assumed, but the subject of the measure" " can be anything." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) subtitle: fhirtypes.StringType | None = Field( default=None, alias="subtitle", title="Subordinate title of the measure", description=( "An explanatory or alternate title for the measure giving additional " "information about its content." ), json_schema_extra={ "element_property": True, }, ) subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subtitle", title="Extension field for ``subtitle``." ) supplementalData: typing.List[fhirtypes.MeasureSupplementalDataType] | None = Field( default=None, alias="supplementalData", title="What other data should be reported with the measure", description=( "The supplemental data criteria for the measure report, specified as " "either the name of a valid CQL expression within a referenced library," " or a valid FHIR Resource Path." ), json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this measure (human friendly)", description="A short, descriptive, user-friendly title for the measure.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) topic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="topic", title=( "The category of the measure, such as Education, Treatment, Assessment," " etc." ), description=( "Descriptive topics related to the content of the measure. Topics " "provide a high-level categorization grouping types of measures that " "can be useful for filtering and searching." ), json_schema_extra={ "element_property": True, }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="process | outcome | structure | patient-reported-outcome | composite", description=( "Indicates whether the measure is used to examine a process, an outcome" " over time, a patient-reported outcome, or a structure measure such as" " utilization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this measure, represented as a URI (globally " "unique)" ), description=( "An absolute URI that is used to identify this measure when it is " "referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which at which an authoritative " "instance of this measure is (or will be) published. This URL can be " "the target of a canonical reference. It SHALL remain the same when the" " measure is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) usage: fhirtypes.StringType | None = Field( default=None, alias="usage", title="Describes the clinical usage of the measure", description=( "A detailed description, from a clinical perspective, of how the " "measure is used." ), json_schema_extra={ "element_property": True, }, ) usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usage", title="Extension field for ``usage``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate measure instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the measure", description=( "The identifier that is used to identify this version of the measure " "when it is referenced in a specification, model, design or instance. " "This is an arbitrary value managed by the measure author and is not " "expected to be globally unique. For example, it might be a timestamp " "(e.g. yyyymmdd) if a managed version is not available. There is also " "no expectation that versions can be placed in a lexicographical " "sequence. To provide a version consistent with the Decision Support " "Service specification, use the format Major.Minor.Revision (e.g. " "1.0.0). For more information on versioning knowledge assets, refer to " "the Decision Support Service specification. Note that a version is " "required for non-experimental active artifacts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Measure`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "subtitle", "status", "experimental", "subjectCodeableConcept", "subjectReference", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "usage", "copyright", "approvalDate", "lastReviewDate", "effectivePeriod", "topic", "author", "editor", "reviewer", "endorser", "relatedArtifact", "library", "disclaimer", "scoring", "compositeScoring", "type", "riskAdjustment", "rateAggregation", "rationale", "clinicalRecommendationStatement", "improvementNotation", "definition", "guidance", "group", "supplementalData", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Measure`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "effectivePeriod", "disclaimer", "scoring", "compositeScoring", "type", "riskAdjustment", "rateAggregation", "rationale", "clinicalRecommendationStatement", "improvementNotation", "definition", "guidance", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"subject": ["subjectCodeableConcept", "subjectReference"]} return one_of_many_fields class MeasureGroup(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Population criteria group. A group of population criteria for the measure. """ __resource_type__ = "MeasureGroup" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Meaning of the group", description=( "Indicates a meaning for the group. This can be as simple as a unique " "identifier, or it can establish meaning in a broader context by " "drawing from a terminology, allowing groups to be correlated across " "measures." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Summary description", description="The human readable description of this population group.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) population: typing.List[fhirtypes.MeasureGroupPopulationType] | None = Field( default=None, alias="population", title="Population criteria", description="A population criteria for the measure.", json_schema_extra={ "element_property": True, }, ) stratifier: typing.List[fhirtypes.MeasureGroupStratifierType] | None = Field( default=None, alias="stratifier", title="Stratifier criteria for the measure", description=( "The stratifier criteria for the measure report, specified as either " "the name of a valid CQL expression defined within a referenced library" " or a valid FHIR Resource Path." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureGroup`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "description", "population", "stratifier", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureGroup`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MeasureGroupPopulation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Population criteria. A population criteria for the measure. """ __resource_type__ = "MeasureGroupPopulation" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title=( "initial-population | numerator | numerator-exclusion | denominator | " "denominator-exclusion | denominator-exception | measure-population | " "measure-population-exclusion | measure-observation" ), description="The type of population criteria.", json_schema_extra={ "element_property": True, }, ) criteria: fhirtypes.ExpressionType = Field( default=..., alias="criteria", title="The criteria that defines this population", description=( "An expression that specifies the criteria for the population, " "typically the name of an expression in a library." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="The human readable description of this population criteria", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureGroupPopulation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "description", "criteria", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureGroupPopulation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MeasureGroupStratifier(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Stratifier criteria for the measure. The stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a referenced library or a valid FHIR Resource Path. """ __resource_type__ = "MeasureGroupStratifier" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Meaning of the stratifier", description=( "Indicates a meaning for the stratifier. This can be as simple as a " "unique identifier, or it can establish meaning in a broader context by" " drawing from a terminology, allowing stratifiers to be correlated " "across measures." ), json_schema_extra={ "element_property": True, }, ) component: typing.List[ fhirtypes.MeasureGroupStratifierComponentType ] | None = Field( default=None, alias="component", title="Stratifier criteria component for the measure", description=( "A component of the stratifier criteria for the measure report, " "specified as either the name of a valid CQL expression defined within " "a referenced library or a valid FHIR Resource Path." ), json_schema_extra={ "element_property": True, }, ) criteria: fhirtypes.ExpressionType | None = Field( default=None, alias="criteria", title="How the measure should be stratified", description=( "An expression that specifies the criteria for the stratifier. This is " "typically the name of an expression defined within a referenced " "library, but it may also be a path to a stratifier element." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="The human readable description of this stratifier", description="The human readable description of this stratifier criteria.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureGroupStratifier`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "description", "criteria", "component", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureGroupStratifier`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MeasureGroupStratifierComponent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Stratifier criteria component for the measure. A component of the stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a referenced library or a valid FHIR Resource Path. """ __resource_type__ = "MeasureGroupStratifierComponent" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Meaning of the stratifier component", description=( "Indicates a meaning for the stratifier component. This can be as " "simple as a unique identifier, or it can establish meaning in a " "broader context by drawing from a terminology, allowing stratifiers to" " be correlated across measures." ), json_schema_extra={ "element_property": True, }, ) criteria: fhirtypes.ExpressionType = Field( default=..., alias="criteria", title="Component of how the measure should be stratified", description=( "An expression that specifies the criteria for this component of the " "stratifier. This is typically the name of an expression defined within" " a referenced library, but it may also be a path to a stratifier " "element." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="The human readable description of this stratifier component", description="The human readable description of this stratifier criteria component.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureGroupStratifierComponent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "description", "criteria", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureGroupStratifierComponent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MeasureSupplementalData(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What other data should be reported with the measure. The supplemental data criteria for the measure report, specified as either the name of a valid CQL expression within a referenced library, or a valid FHIR Resource Path. """ __resource_type__ = "MeasureSupplementalData" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Meaning of the supplemental data", description=( "Indicates a meaning for the supplemental data. This can be as simple " "as a unique identifier, or it can establish meaning in a broader " "context by drawing from a terminology, allowing supplemental data to " "be correlated across measures." ), json_schema_extra={ "element_property": True, }, ) criteria: fhirtypes.ExpressionType = Field( default=..., alias="criteria", title="Expression describing additional data to be reported", description=( "The criteria for the supplemental data. This is typically the name of " "a valid expression defined within a referenced library, but it may " "also be a path to a specific data element. The criteria defines the " "data to be returned for this element." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="The human readable description of this supplemental data", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) usage: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="usage", title="supplemental-data | risk-adjustment-factor", description=( "An indicator of the intended usage for the supplemental data element. " "Supplemental data indicates the data is additional information " "requested to augment the measure information. Risk adjustment factor " "indicates the data is additional information used to calculate risk " "adjustment factors when applying a risk model to the measure " "calculation." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureSupplementalData`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "usage", "description", "criteria", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureSupplementalData`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/measurereport.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MeasureReport Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MeasureReport(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Results of a measure evaluation. The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation. """ __resource_type__ = "MeasureReport" date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When the report was generated", description="The date this measure report was generated.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) evaluatedResource: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="evaluatedResource", title="What data was used to calculate the measure score", description=( "A reference to a Bundle containing the Resources that were used in the" " calculation of this measure." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) group: typing.List[fhirtypes.MeasureReportGroupType] | None = Field( default=None, alias="group", title="Measure results for each group", description=( "The results of the calculation, one for each population group in the " "measure." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the MeasureReport", description=( "A formal identifier that is used to identify this MeasureReport when " "it is represented in other formats or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) improvementNotation: fhirtypes.CodeableConceptType | None = Field( default=None, alias="improvementNotation", title="increase | decrease", description=( "Whether improvement in the measure is noted by an increase or decrease" " in the measure score." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) measure: fhirtypes.CanonicalType | None = Field( default=None, alias="measure", title="What measure was calculated", description="A reference to the Measure that was calculated to produce this report.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Measure"], }, ) measure__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_measure", title="Extension field for ``measure``." ) period: fhirtypes.PeriodType = Field( default=..., alias="period", title="What period the report covers", description="The reporting period for which the report was calculated.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reporter: fhirtypes.ReferenceType | None = Field( default=None, alias="reporter", title="Who is reporting the data", description="The individual, location, or organization that is reporting the data.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Location", "Organization", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="complete | pending | error", description=( "The MeasureReport status. No data will be available until the " "MeasureReport status is complete." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["complete", "pending", "error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="What individual(s) the report is for", description=( "Optional subject identifying the individual or individuals the report " "is for." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "Location", "Device", "RelatedPerson", "Group", ], }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="individual | subject-list | summary | data-collection", description=( "The type of measure report. This may be an individual report, which " "provides the score for the measure for an individual member of the " "population; a subject-listing, which returns the list of members that " "meet the various criteria in the measure; a summary report, which " "returns a population count for each of the criteria in the measure; or" " a data-collection, which enables the MeasureReport to be used to " "exchange the data-of-interest for a quality measure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["individual", "subject-list", "summary", "data-collection"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureReport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "type", "measure", "subject", "date", "reporter", "period", "improvementNotation", "group", "evaluatedResource", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureReport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "type", "measure", "subject", "date", "reporter", "period", "improvementNotation", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("measure", "measure__ext"), ("status", "status__ext"), ("type", "type__ext"), ] return required_fields class MeasureReportGroup(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Measure results for each group. The results of the calculation, one for each population group in the measure. """ __resource_type__ = "MeasureReportGroup" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Meaning of the group", description=( "The meaning of the population group as defined in the measure " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) measureScore: fhirtypes.QuantityType | None = Field( default=None, alias="measureScore", title="What score this group achieved", description=( "The measure score for this population group, calculated as appropriate" " for the measure type and scoring method, and based on the contents of" " the populations defined in the group." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) population: typing.List[fhirtypes.MeasureReportGroupPopulationType] | None = Field( default=None, alias="population", title="The populations in the group", description=( "The populations that make up the population group, one for each type " "of population appropriate for the measure." ), json_schema_extra={ "element_property": True, }, ) stratifier: typing.List[fhirtypes.MeasureReportGroupStratifierType] | None = Field( default=None, alias="stratifier", title="Stratification results", description=( "When a measure includes multiple stratifiers, there will be a " "stratifier group for each stratifier defined by the measure." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureReportGroup`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "population", "measureScore", "stratifier", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureReportGroup`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "measureScore"] class MeasureReportGroupPopulation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The populations in the group. The populations that make up the population group, one for each type of population appropriate for the measure. """ __resource_type__ = "MeasureReportGroupPopulation" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title=( "initial-population | numerator | numerator-exclusion | denominator | " "denominator-exclusion | denominator-exception | measure-population | " "measure-population-exclusion | measure-observation" ), description="The type of the population.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) count: fhirtypes.IntegerType | None = Field( default=None, alias="count", title="Size of the population", description="The number of members of the population.", json_schema_extra={ "element_property": True, }, ) count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_count", title="Extension field for ``count``." ) subjectResults: fhirtypes.ReferenceType | None = Field( default=None, alias="subjectResults", title="For subject-list reports, the subject results in this population", description=( "This element refers to a List of subject level MeasureReport " "resources, one for each subject in this population." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["List"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureReportGroupPopulation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "count", "subjectResults", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureReportGroupPopulation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code"] class MeasureReportGroupStratifier(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Stratification results. When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure. """ __resource_type__ = "MeasureReportGroupStratifier" code: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="code", title="What stratifier of the group", description="The meaning of this stratifier, as defined in the measure definition.", json_schema_extra={ "element_property": True, }, ) stratum: typing.List[ fhirtypes.MeasureReportGroupStratifierStratumType ] | None = Field( default=None, alias="stratum", title=( "Stratum results, one for each unique value, or set of values, in the " "stratifier, or stratifier components" ), description=( "This element contains the results for a single stratum within the " "stratifier. For example, when stratifying on administrative gender, " "there will be four strata, one for each possible gender value." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureReportGroupStratifier`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "stratum"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureReportGroupStratifier`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MeasureReportGroupStratifierStratum(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Stratum results, one for each unique value, or set of values, in the stratifier, or stratifier components. This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value. """ __resource_type__ = "MeasureReportGroupStratifierStratum" component: typing.List[ fhirtypes.MeasureReportGroupStratifierStratumComponentType ] | None = Field( default=None, alias="component", title="Stratifier component values", description="A stratifier component value.", json_schema_extra={ "element_property": True, }, ) measureScore: fhirtypes.QuantityType | None = Field( default=None, alias="measureScore", title="What score this stratum achieved", description=( "The measure score for this stratum, calculated as appropriate for the " "measure type and scoring method, and based on only the members of this" " stratum." ), json_schema_extra={ "element_property": True, }, ) population: typing.List[ fhirtypes.MeasureReportGroupStratifierStratumPopulationType ] | None = Field( default=None, alias="population", title="Population results in this stratum", description=( "The populations that make up the stratum, one for each type of " "population appropriate to the measure." ), json_schema_extra={ "element_property": True, }, ) value: fhirtypes.CodeableConceptType | None = Field( default=None, alias="value", title="The stratum value, e.g. male", description=( "The value for this stratum, expressed as a CodeableConcept. When " "defining stratifiers on complex values, the value must be rendered " "such that the value for each stratum within the stratifier is unique." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureReportGroupStratifierStratum`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "value", "component", "population", "measureScore", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureReportGroupStratifierStratum`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MeasureReportGroupStratifierStratumComponent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Stratifier component values. A stratifier component value. """ __resource_type__ = "MeasureReportGroupStratifierStratumComponent" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="What stratifier component of the group", description="The code for the stratum component value.", json_schema_extra={ "element_property": True, }, ) value: fhirtypes.CodeableConceptType = Field( default=..., alias="value", title="The stratum component value, e.g. male", description="The stratum component value.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureReportGroupStratifierStratumComponent`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureReportGroupStratifierStratumComponent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MeasureReportGroupStratifierStratumPopulation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Population results in this stratum. The populations that make up the stratum, one for each type of population appropriate to the measure. """ __resource_type__ = "MeasureReportGroupStratifierStratumPopulation" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title=( "initial-population | numerator | numerator-exclusion | denominator | " "denominator-exclusion | denominator-exception | measure-population | " "measure-population-exclusion | measure-observation" ), description="The type of the population.", json_schema_extra={ "element_property": True, }, ) count: fhirtypes.IntegerType | None = Field( default=None, alias="count", title="Size of the population", description="The number of members of the population in this stratum.", json_schema_extra={ "element_property": True, }, ) count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_count", title="Extension field for ``count``." ) subjectResults: fhirtypes.ReferenceType | None = Field( default=None, alias="subjectResults", title="For subject-list reports, the subject results in this population", description=( "This element refers to a List of subject level MeasureReport " "resources, one for each subject in this population in this stratum." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["List"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureReportGroupStratifierStratumPopulation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "count", "subjectResults", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureReportGroupStratifierStratumPopulation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/media.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Media Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class Media(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference. """ __resource_type__ = "Media" basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Procedure that caused this media to be created", description=( "A procedure that is fulfilled in whole or in part by the creation of " "this media." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ServiceRequest", "CarePlan"], }, ) bodySite: fhirtypes.CodeableConceptType | None = Field( default=None, alias="bodySite", title="Observed body part", description=( "Indicates the site on the subject's body where the observation was " "made (i.e. the target site)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) content: fhirtypes.AttachmentType = Field( default=..., alias="content", title="Actual Media - reference or data", description=( "The actual content of the media - inline or by direct reference to the" " media source file." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) createdDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="createdDateTime", title="When Media was collected", description="The date and time(s) at which the media was collected.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e created[x] "one_of_many": "created", "one_of_many_required": False, }, ) createdDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_createdDateTime", title="Extension field for ``createdDateTime``.", ) createdPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="createdPeriod", title="When Media was collected", description="The date and time(s) at which the media was collected.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e created[x] "one_of_many": "created", "one_of_many_required": False, }, ) device: fhirtypes.ReferenceType | None = Field( default=None, alias="device", title="Observing Device", description="The device used to collect the media.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device", "DeviceMetric", "Device"], }, ) deviceName: fhirtypes.StringType | None = Field( default=None, alias="deviceName", title="Name of the device/manufacturer", description=( "The name of the device / manufacturer of the device that was used to " "make the recording." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) deviceName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deviceName", title="Extension field for ``deviceName``." ) duration: fhirtypes.DecimalType | None = Field( default=None, alias="duration", title="Length in seconds (audio / video)", description="The duration of the recording in seconds - for audio and video.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) duration__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_duration", title="Extension field for ``duration``." ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter associated with media", description="The encounter that establishes the context for this media.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) frames: fhirtypes.PositiveIntType | None = Field( default=None, alias="frames", title="Number of frames if > 1 (photo)", description=( "The number of frames in a photo. This is used with a multi-page fax, " "or an imaging acquisition context that takes multiple slices in a " "single image, or an animated gif. If there is more than one frame, " "this SHALL have a value in order to alert interface software that a " "multi-frame capable rendering widget is required." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) frames__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_frames", title="Extension field for ``frames``." ) height: fhirtypes.PositiveIntType | None = Field( default=None, alias="height", title="Height of the image in pixels (photo/video)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) height__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_height", title="Extension field for ``height``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifier(s) for the image", description=( "Identifiers associated with the image - these may include identifiers " "for the image itself, identifiers for the context of its collection " "(e.g. series ids) and context ids such as accession numbers or other " "workflow identifiers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued: fhirtypes.InstantType | None = Field( default=None, alias="issued", title="Date/Time this version was made available", description=( "The date and time this version of the media was made available to " "providers, typically after having been reviewed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issued", title="Extension field for ``issued``." ) modality: fhirtypes.CodeableConceptType | None = Field( default=None, alias="modality", title="The type of acquisition equipment/process", description=( "Details of the type of the media - usually, how it was acquired (what " "type of device). If images sourced from a DICOM system, are wrapped in" " a Media resource, then this is the modality." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the media", description=( "Comments made about the media by the performer, subject or other " "participants." ), json_schema_extra={ "element_property": True, }, ) operator: fhirtypes.ReferenceType | None = Field( default=None, alias="operator", title="The person who generated the image", description="The person who administered the collection of the image.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", "Patient", "Device", "RelatedPerson", ], }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced event", description="A larger event of which this particular event is a component or step.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Why was event performed?", description="Describes why the event occurred in coded or textual form.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "preparation | in-progress | not-done | on-hold | stopped | completed |" " entered-in-error | unknown" ), description="The current state of the {{title}}.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "preparation", "in-progress", "not-done", "on-hold", "stopped", "completed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Who/What this Media is a record of", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "Group", "Device", "Specimen", "Location", ], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Classification of media as image, video, or audio", description=( "A code that classifies whether the media is an image, video or audio " "recording or some other media category." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) view: fhirtypes.CodeableConceptType | None = Field( default=None, alias="view", title="Imaging view, e.g. Lateral or Antero-posterior", description="The name of the imaging view e.g. Lateral or Antero-posterior (AP).", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) width: fhirtypes.PositiveIntType | None = Field( default=None, alias="width", title="Width of the image in pixels (photo/video)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) width__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_width", title="Extension field for ``width``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Media`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "partOf", "status", "type", "modality", "view", "subject", "encounter", "createdDateTime", "createdPeriod", "issued", "operator", "reasonCode", "bodySite", "deviceName", "device", "height", "width", "frames", "duration", "content", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Media`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "basedOn", "partOf", "status", "type", "modality", "view", "subject", "encounter", "createdDateTime", "createdPeriod", "issued", "operator", "reasonCode", "bodySite", "deviceName", "device", "height", "width", "frames", "duration", "content", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"created": ["createdDateTime", "createdPeriod"]} return one_of_many_fields ================================================ FILE: fhir/resources/R4B/medication.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Medication Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Medication(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of a Medication. This resource is primarily used for the identification and definition of a medication for the purposes of prescribing, dispensing, and administering a medication as well as for making statements about medication use. """ __resource_type__ = "Medication" amount: fhirtypes.RatioType | None = Field( default=None, alias="amount", title="Amount of drug in package", description=( "Specific amount of the drug in the packaged product. For example, " "when specifying a product that has the same strength (For example, " "Insulin glargine 100 unit per mL solution for injection), this " "attribute provides additional clarification of the package amount (For" " example, 3 mL, 10mL, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) batch: fhirtypes.MedicationBatchType | None = Field( default=None, alias="batch", title="Details about packaged medications", description="Information that only applies to packages (not products).", json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Codes that identify this medication", description=( "A code (or set of codes) that specify this medication, or a textual " "description if no code is available. Usage note: This could be a " "standard medication code such as a code from RxNorm, SNOMED CT, IDMP " "etc. It could also be a national or local formulary code, optionally " "with translations to other code systems." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) form: fhirtypes.CodeableConceptType | None = Field( default=None, alias="form", title="powder | tablets | capsule +", description="Describes the form of the item. Powder; tablets; capsule.", json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier for this medication", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ingredient: typing.List[fhirtypes.MedicationIngredientType] | None = Field( default=None, alias="ingredient", title="Active or inactive ingredient", description="Identifies a particular constituent of interest in the product.", json_schema_extra={ "element_property": True, }, ) manufacturer: fhirtypes.ReferenceType | None = Field( default=None, alias="manufacturer", title="Manufacturer of the item", description=( "Describes the details of the manufacturer of the medication product. " "This is not intended to represent the distributor of a medication " "product." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | inactive | entered-in-error", description="A code to indicate if the medication is in active use.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "inactive", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Medication`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "code", "status", "manufacturer", "form", "amount", "ingredient", "batch", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Medication`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "code", "status", "manufacturer", "amount", ] class MedicationBatch(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details about packaged medications. Information that only applies to packages (not products). """ __resource_type__ = "MedicationBatch" expirationDate: fhirtypes.DateTimeType | None = Field( default=None, alias="expirationDate", title="When batch will expire", description="When this specific batch of product will expire.", json_schema_extra={ "element_property": True, }, ) expirationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expirationDate", title="Extension field for ``expirationDate``.", ) lotNumber: fhirtypes.StringType | None = Field( default=None, alias="lotNumber", title="Identifier assigned to batch", description="The assigned lot number of a batch of the specified product.", json_schema_extra={ "element_property": True, }, ) lotNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lotNumber", title="Extension field for ``lotNumber``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationBatch`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "lotNumber", "expirationDate"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationBatch`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationIngredient(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Active or inactive ingredient. Identifies a particular constituent of interest in the product. """ __resource_type__ = "MedicationIngredient" isActive: bool | None = Field( default=None, alias="isActive", title="Active ingredient indicator", description=( "Indication of whether this ingredient affects the therapeutic action " "of the drug." ), json_schema_extra={ "element_property": True, }, ) isActive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isActive", title="Extension field for ``isActive``." ) itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="itemCodeableConcept", title="The actual ingredient or content", description=( "The actual ingredient - either a substance (simple ingredient) or " "another medication of a medication." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": True, }, ) itemReference: fhirtypes.ReferenceType | None = Field( default=None, alias="itemReference", title="The actual ingredient or content", description=( "The actual ingredient - either a substance (simple ingredient) or " "another medication of a medication." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Substance", "Medication"], }, ) strength: fhirtypes.RatioType | None = Field( default=None, alias="strength", title="Quantity of ingredient present", description=( "Specifies how many (or how much) of the items there are in this " "Medication. For example, 250 mg per tablet. This is expressed as a " "ratio where the numerator is 250mg and the denominator is 1 tablet." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationIngredient`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "itemCodeableConcept", "itemReference", "isActive", "strength", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationIngredient`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"item": ["itemCodeableConcept", "itemReference"]} return one_of_many_fields ================================================ FILE: fhir/resources/R4B/medicationadministration.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MedicationAdministration Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MedicationAdministration(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Administration of medication to a patient. Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner. """ __resource_type__ = "MedicationAdministration" category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Type of medication usage", description=( "Indicates where the medication is expected to be consumed or " "administered." ), json_schema_extra={ "element_property": True, }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Encounter or Episode of Care administered as part of", description=( "The visit, admission, or other contact between patient and health care" " provider during which the medication administration was performed." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) device: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="device", title="Device used to administer", description=( "The device used in administering the medication to the patient. For " "example, a particular infusion pump." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) dosage: fhirtypes.MedicationAdministrationDosageType | None = Field( default=None, alias="dosage", title="Details of how medication was taken", description=( "Describes the medication dosage information details e.g. dose, rate, " "site, route, etc." ), json_schema_extra={ "element_property": True, }, ) effectiveDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="effectiveDateTime", title="Start and end time of administration", description=( "A specific date/time or interval of time during which the " "administration took place (or did not take place, when the 'notGiven' " "attribute is true). For many administrations, such as swallowing a " "tablet the use of dateTime is more appropriate." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": True, }, ) effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_effectiveDateTime", title="Extension field for ``effectiveDateTime``.", ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="Start and end time of administration", description=( "A specific date/time or interval of time during which the " "administration took place (or did not take place, when the 'notGiven' " "attribute is true). For many administrations, such as swallowing a " "tablet the use of dateTime is more appropriate." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": True, }, ) eventHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="eventHistory", title="A list of events of interest in the lifecycle", description=( "A summary of the events of interest that have occurred, such as when " "the administration was verified." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Provenance"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External identifier", description=( "Identifiers associated with this Medication Administration that are " "defined by business processes and/or used to refer to it when a direct" " URL reference to the resource itself is not appropriate. They are " "business identifiers assigned to this resource by the performer or " "other systems and remain constant as the resource is updated and " "propagates from server to server." ), json_schema_extra={ "element_property": True, }, ) instantiates: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="instantiates", title="Instantiates protocol or definition", description=( "A protocol, guideline, orderset, or other definition that was adhered " "to in whole or in part by this event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiates__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiates", title="Extension field for ``instantiates``.", ) medicationCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="medicationCodeableConcept", title="What was administered", description=( "Identifies the medication that was administered. This is either a link" " to a resource representing the details of the medication or a simple " "attribute carrying a code that identifies the medication from a known " "list of medications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e medication[x] "one_of_many": "medication", "one_of_many_required": True, }, ) medicationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="medicationReference", title="What was administered", description=( "Identifies the medication that was administered. This is either a link" " to a resource representing the details of the medication or a simple " "attribute carrying a code that identifies the medication from a known " "list of medications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e medication[x] "one_of_many": "medication", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Information about the administration", description=( "Extra information about the medication administration that is not " "conveyed by the other attributes." ), json_schema_extra={ "element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced event", description="A larger event of which this particular event is a component or step.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicationAdministration", "Procedure"], }, ) performer: typing.List[ fhirtypes.MedicationAdministrationPerformerType ] | None = Field( default=None, alias="performer", title="Who performed the medication administration and what they did", description=( "Indicates who or what performed the medication administration and how " "they were involved." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Reason administration performed", description="A code indicating why the medication was given.", json_schema_extra={ "element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title=( "Condition or observation that supports why the medication was " "administered" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "Observation", "DiagnosticReport"], }, ) request: fhirtypes.ReferenceType | None = Field( default=None, alias="request", title="Request administration performed against", description=( "The original request, instruction or authority to perform the " "administration." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicationRequest"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "in-progress | not-done | on-hold | completed | entered-in-error | " "stopped | unknown" ), description=( "Will generally be set to show that the administration has been " "completed. For some long running administrations such as infusions, " "it is possible for an administration to be started but not completed " "or it may be paused while some other process is under way." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "in-progress", "not-done", "on-hold", "completed", "entered-in-error", "stopped", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusReason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="statusReason", title="Reason administration not performed", description="A code indicating why the administration was not performed.", json_schema_extra={ "element_property": True, }, ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who received medication", description="The person or animal or group receiving the medication.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInformation", title="Additional information to support administration", description=( "Additional information (for example, patient height and weight) that " "supports the administration of the medication." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationAdministration`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "instantiates", "partOf", "status", "statusReason", "category", "medicationCodeableConcept", "medicationReference", "subject", "context", "supportingInformation", "effectiveDateTime", "effectivePeriod", "performer", "reasonCode", "reasonReference", "request", "device", "note", "dosage", "eventHistory", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationAdministration`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "instantiates", "partOf", "status", "medicationCodeableConcept", "medicationReference", "subject", "effectiveDateTime", "effectivePeriod", "performer", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "effective": ["effectiveDateTime", "effectivePeriod"], "medication": ["medicationCodeableConcept", "medicationReference"], } return one_of_many_fields class MedicationAdministrationDosage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details of how medication was taken. Describes the medication dosage information details e.g. dose, rate, site, route, etc. """ __resource_type__ = "MedicationAdministrationDosage" dose: fhirtypes.QuantityType | None = Field( default=None, alias="dose", title="Amount of medication per dose", description=( "The amount of the medication given at one administration event. Use " "this value when the administration is essentially an instantaneous " "event such as a swallowing a tablet or giving an injection." ), json_schema_extra={ "element_property": True, }, ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="How drug was administered", description=( "A coded value indicating the method by which the medication is " "intended to be or was introduced into or on the body. This attribute " "will most often NOT be populated. It is most commonly used for " "injections. For example, Slow Push, Deep IV." ), json_schema_extra={ "element_property": True, }, ) rateQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="rateQuantity", title="Dose quantity per unit of time", description=( "Identifies the speed with which the medication was or will be " "introduced into the patient. Typically, the rate for an infusion e.g." " 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per " "unit of time, e.g. 500 ml per 2 hours. Other examples: 200 mcg/min " "or 200 mcg/1 minute; 1 liter/8 hours." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e rate[x] "one_of_many": "rate", "one_of_many_required": False, }, ) rateRatio: fhirtypes.RatioType | None = Field( default=None, alias="rateRatio", title="Dose quantity per unit of time", description=( "Identifies the speed with which the medication was or will be " "introduced into the patient. Typically, the rate for an infusion e.g." " 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per " "unit of time, e.g. 500 ml per 2 hours. Other examples: 200 mcg/min " "or 200 mcg/1 minute; 1 liter/8 hours." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e rate[x] "one_of_many": "rate", "one_of_many_required": False, }, ) route: fhirtypes.CodeableConceptType | None = Field( default=None, alias="route", title="Path of substance into body", description=( "A code specifying the route or physiological path of administration of" " a therapeutic agent into or onto the patient. For example, topical, " "intravenous, etc." ), json_schema_extra={ "element_property": True, }, ) site: fhirtypes.CodeableConceptType | None = Field( default=None, alias="site", title="Body site administered to", description=( "A coded specification of the anatomic site where the medication first " 'entered the body. For example, "left arm".' ), json_schema_extra={ "element_property": True, }, ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Free text dosage instructions e.g. SIG", description=( "Free text dosage can be used for cases where the dosage administered " "is too complex to code. When coded dosage is present, the free text " "dosage may still be present for display to humans. The dosage " "instructions should reflect the dosage of the medication that was " "administered." ), json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationAdministrationDosage`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "text", "site", "route", "method", "dose", "rateRatio", "rateQuantity", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationAdministrationDosage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"rate": ["rateQuantity", "rateRatio"]} return one_of_many_fields class MedicationAdministrationPerformer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who performed the medication administration and what they did. Indicates who or what performed the medication administration and how they were involved. """ __resource_type__ = "MedicationAdministrationPerformer" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Who performed the medication administration", description="Indicates who or what performed the medication administration.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Patient", "RelatedPerson", "Device", ], }, ) function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="Type of performance", description=( "Distinguishes the type of involvement of the performer in the " "medication administration." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationAdministrationPerformer`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "function", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationAdministrationPerformer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "actor"] ================================================ FILE: fhir/resources/R4B/medicationdispense.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MedicationDispense Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MedicationDispense(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Dispensing a medication to a named patient. Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order. """ __resource_type__ = "MedicationDispense" authorizingPrescription: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="authorizingPrescription", title="Medication order that authorizes the dispense", description="Indicates the medication order that is being dispensed against.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicationRequest"], }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Type of medication dispense", description=( "Indicates the type of medication dispense (for example, where the " "medication is expected to be consumed or administered (i.e. inpatient " "or outpatient))." ), json_schema_extra={ "element_property": True, }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Encounter / Episode associated with event", description=( "The encounter or episode of care that establishes the context for this" " event." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) daysSupply: fhirtypes.QuantityType | None = Field( default=None, alias="daysSupply", title="Amount of medication expressed as a timing amount", description="The amount of medication expressed as a timing amount.", json_schema_extra={ "element_property": True, }, ) destination: fhirtypes.ReferenceType | None = Field( default=None, alias="destination", title="Where the medication was sent", description=( "Identification of the facility/location where the medication was " "shipped to, as part of the dispense event." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) detectedIssue: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="detectedIssue", title="Clinical issue with action", description=( "Indicates an actual or potential clinical issue with or between one or" " more active or proposed clinical actions for a patient; e.g. drug-" "drug interaction, duplicate therapy, dosage alert etc." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DetectedIssue"], }, ) dosageInstruction: typing.List[fhirtypes.DosageType] | None = Field( default=None, alias="dosageInstruction", title=( "How the medication is to be used by the patient or administered by the" " caregiver" ), description="Indicates how the medication is to be used by the patient.", json_schema_extra={ "element_property": True, }, ) eventHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="eventHistory", title="A list of relevant lifecycle events", description=( "A summary of the events of interest that have occurred, such as when " "the dispense was verified." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Provenance"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External identifier", description=( "Identifiers associated with this Medication Dispense that are defined " "by business processes and/or used to refer to it when a direct URL " "reference to the resource itself is not appropriate. They are business" " identifiers assigned to this resource by the performer or other " "systems and remain constant as the resource is updated and propagates " "from server to server." ), json_schema_extra={ "element_property": True, }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where the dispense occurred", description="The principal physical location where the dispense was performed.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) medicationCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="medicationCodeableConcept", title="What medication was supplied", description=( "Identifies the medication being administered. This is either a link to" " a resource representing the details of the medication or a simple " "attribute carrying a code that identifies the medication from a known " "list of medications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e medication[x] "one_of_many": "medication", "one_of_many_required": True, }, ) medicationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="medicationReference", title="What medication was supplied", description=( "Identifies the medication being administered. This is either a link to" " a resource representing the details of the medication or a simple " "attribute carrying a code that identifies the medication from a known " "list of medications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e medication[x] "one_of_many": "medication", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Information about the dispense", description=( "Extra information about the dispense that could not be conveyed in the" " other attributes." ), json_schema_extra={ "element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Event that dispense is part of", description="The procedure that trigger the dispense.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Procedure"], }, ) performer: typing.List[fhirtypes.MedicationDispensePerformerType] | None = Field( default=None, alias="performer", title="Who performed event", description="Indicates who or what performed the event.", json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Amount dispensed", description=( "The amount of medication that has been dispensed. Includes unit of " "measure." ), json_schema_extra={ "element_property": True, }, ) receiver: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="receiver", title="Who collected the medication", description=( "Identifies the person who picked up the medication. This will usually" " be a patient or their caregiver, but some cases exist where it can be" " a healthcare professional." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Practitioner"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "preparation | in-progress | cancelled | on-hold | completed | entered-" "in-error | stopped | declined | unknown" ), description="A code specifying the state of the set of dispense events.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "preparation", "in-progress", "cancelled", "on-hold", "completed", "entered-in-error", "stopped", "declined", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusReasonCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="statusReasonCodeableConcept", title="Why a dispense was not performed", description="Indicates the reason why a dispense was not performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e statusReason[x] "one_of_many": "statusReason", "one_of_many_required": False, }, ) statusReasonReference: fhirtypes.ReferenceType | None = Field( default=None, alias="statusReasonReference", title="Why a dispense was not performed", description="Indicates the reason why a dispense was not performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e statusReason[x] "one_of_many": "statusReason", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DetectedIssue"], }, ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Who the dispense is for", description=( "A link to a resource representing the person or the group to whom the " "medication will be given." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) substitution: fhirtypes.MedicationDispenseSubstitutionType | None = Field( default=None, alias="substitution", title="Whether a substitution was performed on the dispense", description=( "Indicates whether or not substitution was made as part of the " "dispense. In some cases, substitution will be expected but does not " "happen, in other cases substitution is not expected but does happen. " "This block explains what substitution did or did not happen and why. " "If nothing is specified, substitution was not done." ), json_schema_extra={ "element_property": True, }, ) supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInformation", title="Information that supports the dispensing of the medication", description="Additional information that supports the medication being dispensed.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Trial fill, partial fill, emergency fill, etc.", description=( "Indicates the type of dispensing event that is performed. For example," " Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, " "Samples, etc." ), json_schema_extra={ "element_property": True, }, ) whenHandedOver: fhirtypes.DateTimeType | None = Field( default=None, alias="whenHandedOver", title="When product was given out", description=( "The time the dispensed product was provided to the patient or their " "representative." ), json_schema_extra={ "element_property": True, }, ) whenHandedOver__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_whenHandedOver", title="Extension field for ``whenHandedOver``.", ) whenPrepared: fhirtypes.DateTimeType | None = Field( default=None, alias="whenPrepared", title="When product was packaged and reviewed", description="The time when the dispensed product was packaged and reviewed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) whenPrepared__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_whenPrepared", title="Extension field for ``whenPrepared``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationDispense`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "partOf", "status", "statusReasonCodeableConcept", "statusReasonReference", "category", "medicationCodeableConcept", "medicationReference", "subject", "context", "supportingInformation", "performer", "location", "authorizingPrescription", "type", "quantity", "daysSupply", "whenPrepared", "whenHandedOver", "destination", "receiver", "note", "dosageInstruction", "substitution", "detectedIssue", "eventHistory", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationDispense`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "status", "medicationCodeableConcept", "medicationReference", "subject", "whenPrepared", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "medication": ["medicationCodeableConcept", "medicationReference"], "statusReason": ["statusReasonCodeableConcept", "statusReasonReference"], } return one_of_many_fields class MedicationDispensePerformer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who performed event. Indicates who or what performed the event. """ __resource_type__ = "MedicationDispensePerformer" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Individual who was performing", description=( "The device, practitioner, etc. who performed the action. It should be" " assumed that the actor is the dispenser of the medication." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Patient", "Device", "RelatedPerson", ], }, ) function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="Who performed the dispense and what they did", description=( "Distinguishes the type of performer in the dispense. For example, " "date enterer, packager, final checker." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationDispensePerformer`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "function", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationDispensePerformer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationDispenseSubstitution(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Whether a substitution was performed on the dispense. Indicates whether or not substitution was made as part of the dispense. In some cases, substitution will be expected but does not happen, in other cases substitution is not expected but does happen. This block explains what substitution did or did not happen and why. If nothing is specified, substitution was not done. """ __resource_type__ = "MedicationDispenseSubstitution" reason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reason", title="Why was substitution made", description=( "Indicates the reason for the substitution (or lack of substitution) " "from what was prescribed." ), json_schema_extra={ "element_property": True, }, ) responsibleParty: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="responsibleParty", title="Who is responsible for the substitution", description=( "The person or organization that has primary responsibility for the " "substitution." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title=( "Code signifying whether a different drug was dispensed from what was " "prescribed" ), description=( "A code signifying whether a different drug was dispensed from what was" " prescribed." ), json_schema_extra={ "element_property": True, }, ) wasSubstituted: bool | None = Field( default=None, alias="wasSubstituted", title="Whether a substitution was or was not performed on the dispense", description=( "True if the dispenser dispensed a different drug or product from what " "was prescribed." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) wasSubstituted__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_wasSubstituted", title="Extension field for ``wasSubstituted``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationDispenseSubstitution`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "wasSubstituted", "type", "reason", "responsibleParty", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationDispenseSubstitution`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("wasSubstituted", "wasSubstituted__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/medicationknowledge.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MedicationKnowledge Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MedicationKnowledge(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of Medication Knowledge. Information about a medication that is used to support knowledge. """ __resource_type__ = "MedicationKnowledge" administrationGuidelines: typing.List[ fhirtypes.MedicationKnowledgeAdministrationGuidelinesType ] | None = Field( default=None, alias="administrationGuidelines", title="Guidelines for administration of the medication", description="Guidelines for the administration of the medication.", json_schema_extra={ "element_property": True, }, ) amount: fhirtypes.QuantityType | None = Field( default=None, alias="amount", title="Amount of drug in package", description=( "Specific amount of the drug in the packaged product. For example, " "when specifying a product that has the same strength (For example, " "Insulin glargine 100 unit per mL solution for injection), this " "attribute provides additional clarification of the package amount (For" " example, 3 mL, 10mL, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) associatedMedication: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="associatedMedication", title="A medication resource that is associated with this medication", description=( "Associated or related medications. For example, if the medication is " "a branded product (e.g. Crestor), this is the Therapeutic Moeity (e.g." " Rosuvastatin) or if this is a generic medication (e.g. Rosuvastatin)," " this would link to a branded product (e.g. Crestor)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication"], }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Code that identifies this medication", description=( "A code that specifies this medication, or a textual description if no " "code is available. Usage note: This could be a standard medication " "code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be" " a national or local formulary code, optionally with translations to " "other code systems." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contraindication: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="contraindication", title="Potential clinical issue with or between medication(s)", description=( "Potential clinical issue with or between medication(s) (for example, " "drug-drug interaction, drug-disease contraindication, drug-allergy " "interaction, etc.)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DetectedIssue"], }, ) cost: typing.List[fhirtypes.MedicationKnowledgeCostType] | None = Field( default=None, alias="cost", title="The pricing of the medication", description="The price of the medication.", json_schema_extra={ "element_property": True, }, ) doseForm: fhirtypes.CodeableConceptType | None = Field( default=None, alias="doseForm", title="powder | tablets | capsule +", description="Describes the form of the item. Powder; tablets; capsule.", json_schema_extra={ "element_property": True, }, ) drugCharacteristic: typing.List[ fhirtypes.MedicationKnowledgeDrugCharacteristicType ] | None = Field( default=None, alias="drugCharacteristic", title="Specifies descriptive properties of the medicine", description=( "Specifies descriptive properties of the medicine, such as color, " "shape, imprints, etc." ), json_schema_extra={ "element_property": True, }, ) ingredient: typing.List[fhirtypes.MedicationKnowledgeIngredientType] | None = Field( default=None, alias="ingredient", title="Active or inactive ingredient", description="Identifies a particular constituent of interest in the product.", json_schema_extra={ "element_property": True, }, ) intendedRoute: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="intendedRoute", title="The intended or approved route of administration", description=None, json_schema_extra={ "element_property": True, }, ) kinetics: typing.List[fhirtypes.MedicationKnowledgeKineticsType] | None = Field( default=None, alias="kinetics", title=( "The time course of drug absorption, distribution, metabolism and " "excretion of a medication from the body" ), description=None, json_schema_extra={ "element_property": True, }, ) manufacturer: fhirtypes.ReferenceType | None = Field( default=None, alias="manufacturer", title="Manufacturer of the item", description=( "Describes the details of the manufacturer of the medication product. " "This is not intended to represent the distributor of a medication " "product." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) medicineClassification: typing.List[ fhirtypes.MedicationKnowledgeMedicineClassificationType ] | None = Field( default=None, alias="medicineClassification", title=( "Categorization of the medication within a formulary or classification " "system" ), description=None, json_schema_extra={ "element_property": True, }, ) monitoringProgram: typing.List[ fhirtypes.MedicationKnowledgeMonitoringProgramType ] | None = Field( default=None, alias="monitoringProgram", title="Program under which a medication is reviewed", description="The program under which the medication is reviewed.", json_schema_extra={ "element_property": True, }, ) monograph: typing.List[fhirtypes.MedicationKnowledgeMonographType] | None = Field( default=None, alias="monograph", title="Associated documentation about the medication", description=None, json_schema_extra={ "element_property": True, }, ) packaging: fhirtypes.MedicationKnowledgePackagingType | None = Field( default=None, alias="packaging", title="Details about packaged medications", description="Information that only applies to packages (not products).", json_schema_extra={ "element_property": True, }, ) preparationInstruction: fhirtypes.MarkdownType | None = Field( default=None, alias="preparationInstruction", title="The instructions for preparing the medication", description=None, json_schema_extra={ "element_property": True, }, ) preparationInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preparationInstruction", title="Extension field for ``preparationInstruction``.", ) productType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="productType", title="Category of the medication or product", description=( "Category of the medication or product (e.g. branded product, " "therapeutic moeity, generic product, innovator product, etc.)." ), json_schema_extra={ "element_property": True, }, ) regulatory: typing.List[fhirtypes.MedicationKnowledgeRegulatoryType] | None = Field( default=None, alias="regulatory", title="Regulatory information about a medication", description=None, json_schema_extra={ "element_property": True, }, ) relatedMedicationKnowledge: typing.List[ fhirtypes.MedicationKnowledgeRelatedMedicationKnowledgeType ] | None = Field( default=None, alias="relatedMedicationKnowledge", title="Associated or related medication information", description="Associated or related knowledge about a medication.", json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | inactive | entered-in-error", description=( "A code to indicate if the medication is in active use. The status " "refers to the validity about the information of the medication and not" " to its medicinal properties." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "inactive", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) synonym: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="synonym", title="Additional names for a medication", description=( "Additional names for a medication, for example, the name(s) given to a" " medication in different countries. For example, acetaminophen and " "paracetamol or salbutamol and albuterol." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) synonym__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_synonym", title="Extension field for ``synonym``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledge`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "code", "status", "manufacturer", "doseForm", "amount", "synonym", "relatedMedicationKnowledge", "associatedMedication", "productType", "monograph", "ingredient", "preparationInstruction", "intendedRoute", "cost", "monitoringProgram", "administrationGuidelines", "medicineClassification", "packaging", "drugCharacteristic", "contraindication", "regulatory", "kinetics", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledge`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "code", "status", "manufacturer", "amount", "synonym", ] class MedicationKnowledgeAdministrationGuidelines(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Guidelines for administration of the medication. Guidelines for the administration of the medication. """ __resource_type__ = "MedicationKnowledgeAdministrationGuidelines" dosage: typing.List[ fhirtypes.MedicationKnowledgeAdministrationGuidelinesDosageType ] | None = Field( default=None, alias="dosage", title="Dosage for the medication for the specific guidelines", description=None, json_schema_extra={ "element_property": True, }, ) indicationCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="indicationCodeableConcept", title=( "Indication for use that apply to the specific administration " "guidelines" ), description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e indication[x] "one_of_many": "indication", "one_of_many_required": False, }, ) indicationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="indicationReference", title=( "Indication for use that apply to the specific administration " "guidelines" ), description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e indication[x] "one_of_many": "indication", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) patientCharacteristics: typing.List[ fhirtypes.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsType ] | None = Field( default=None, alias="patientCharacteristics", title=( "Characteristics of the patient that are relevant to the administration" " guidelines" ), description=( "Characteristics of the patient that are relevant to the administration" " guidelines (for example, height, weight, gender, etc.)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeAdministrationGuidelines`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "dosage", "indicationCodeableConcept", "indicationReference", "patientCharacteristics", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeAdministrationGuidelines`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "indication": ["indicationCodeableConcept", "indicationReference"] } return one_of_many_fields class MedicationKnowledgeAdministrationGuidelinesDosage( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Dosage for the medication for the specific guidelines. """ __resource_type__ = "MedicationKnowledgeAdministrationGuidelinesDosage" dosage: typing.List[fhirtypes.DosageType] = Field( default=..., alias="dosage", title="Dosage for the medication for the specific guidelines", description=None, json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Type of dosage", description=( "The type of dosage (for example, prophylaxis, maintenance, " "therapeutic, etc.)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeAdministrationGuidelinesDosage`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "dosage"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeAdministrationGuidelinesDosage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationKnowledgeAdministrationGuidelinesPatientCharacteristics( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Characteristics of the patient that are relevant to the administration guidelines. Characteristics of the patient that are relevant to the administration guidelines (for example, height, weight, gender, etc.). """ __resource_type__ = ( "MedicationKnowledgeAdministrationGuidelinesPatientCharacteristics" ) characteristicCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="characteristicCodeableConcept", title=( "Specific characteristic that is relevant to the administration " "guideline" ), description=( "Specific characteristic that is relevant to the administration " "guideline (e.g. height, weight, gender)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e characteristic[x] "one_of_many": "characteristic", "one_of_many_required": True, }, ) characteristicQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="characteristicQuantity", title=( "Specific characteristic that is relevant to the administration " "guideline" ), description=( "Specific characteristic that is relevant to the administration " "guideline (e.g. height, weight, gender)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e characteristic[x] "one_of_many": "characteristic", "one_of_many_required": True, }, ) value: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="value", title="The specific characteristic", description="The specific characteristic (e.g. height, weight, gender, etc.).", json_schema_extra={ "element_property": True, }, ) value__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeAdministrationGuidelinesPatientCharacteristics`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "characteristicCodeableConcept", "characteristicQuantity", "value", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeAdministrationGuidelinesPatientCharacteristics`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "characteristic": [ "characteristicCodeableConcept", "characteristicQuantity", ] } return one_of_many_fields class MedicationKnowledgeCost(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The pricing of the medication. The price of the medication. """ __resource_type__ = "MedicationKnowledgeCost" cost: fhirtypes.MoneyType = Field( default=..., alias="cost", title="The price of the medication", description=None, json_schema_extra={ "element_property": True, }, ) source: fhirtypes.StringType | None = Field( default=None, alias="source", title="The source or owner for the price information", description="The source or owner that assigns the price to the medication.", json_schema_extra={ "element_property": True, }, ) source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_source", title="Extension field for ``source``." ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="The category of the cost information", description=( "The category of the cost information. For example, manufacturers' " "cost, patient cost, claim reimbursement cost, actual acquisition cost." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeCost`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "source", "cost"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeCost`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationKnowledgeDrugCharacteristic(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specifies descriptive properties of the medicine. Specifies descriptive properties of the medicine, such as color, shape, imprints, etc. """ __resource_type__ = "MedicationKnowledgeDrugCharacteristic" type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Code specifying the type of characteristic of medication", description=( "A code specifying which characteristic of the medicine is being " "described (for example, colour, shape, imprint)." ), json_schema_extra={ "element_property": True, }, ) valueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="valueBase64Binary", title="Description of the characteristic", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBase64Binary", title="Extension field for ``valueBase64Binary``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Description of the characteristic", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Description of the characteristic", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Description of the characteristic", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeDrugCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueCodeableConcept", "valueString", "valueQuantity", "valueBase64Binary", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeDrugCharacteristic`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBase64Binary", "valueCodeableConcept", "valueQuantity", "valueString", ] } return one_of_many_fields class MedicationKnowledgeIngredient(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Active or inactive ingredient. Identifies a particular constituent of interest in the product. """ __resource_type__ = "MedicationKnowledgeIngredient" isActive: bool | None = Field( default=None, alias="isActive", title="Active ingredient indicator", description=( "Indication of whether this ingredient affects the therapeutic action " "of the drug." ), json_schema_extra={ "element_property": True, }, ) isActive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isActive", title="Extension field for ``isActive``." ) itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="itemCodeableConcept", title="Medication(s) or substance(s) contained in the medication", description=( "The actual ingredient - either a substance (simple ingredient) or " "another medication." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": True, }, ) itemReference: fhirtypes.ReferenceType | None = Field( default=None, alias="itemReference", title="Medication(s) or substance(s) contained in the medication", description=( "The actual ingredient - either a substance (simple ingredient) or " "another medication." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Substance"], }, ) strength: fhirtypes.RatioType | None = Field( default=None, alias="strength", title="Quantity of ingredient present", description=( "Specifies how many (or how much) of the items there are in this " "Medication. For example, 250 mg per tablet. This is expressed as a " "ratio where the numerator is 250mg and the denominator is 1 tablet." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeIngredient`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "itemCodeableConcept", "itemReference", "isActive", "strength", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeIngredient`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"item": ["itemCodeableConcept", "itemReference"]} return one_of_many_fields class MedicationKnowledgeKinetics(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The time course of drug absorption, distribution, metabolism and excretion of a medication from the body. """ __resource_type__ = "MedicationKnowledgeKinetics" areaUnderCurve: typing.List[fhirtypes.QuantityType] | None = Field( default=None, alias="areaUnderCurve", title="The drug concentration measured at certain discrete points in time", description=None, json_schema_extra={ "element_property": True, }, ) halfLifePeriod: fhirtypes.DurationType | None = Field( default=None, alias="halfLifePeriod", title="Time required for concentration in the body to decrease by half", description=( "The time required for any specified property (e.g., the concentration " "of a substance in the body) to decrease by half." ), json_schema_extra={ "element_property": True, }, ) lethalDose50: typing.List[fhirtypes.QuantityType] | None = Field( default=None, alias="lethalDose50", title="The median lethal dose of a drug", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeKinetics`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "areaUnderCurve", "lethalDose50", "halfLifePeriod", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeKinetics`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationKnowledgeMedicineClassification(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Categorization of the medication within a formulary or classification system. """ __resource_type__ = "MedicationKnowledgeMedicineClassification" classification: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="classification", title="Specific category assigned to the medication", description=( "Specific category assigned to the medication (e.g. anti-infective, " "anti-hypertensive, antibiotic, etc.)." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title=( "The type of category for the medication (for example, therapeutic " "classification, therapeutic sub-classification)" ), description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeMedicineClassification`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "classification"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeMedicineClassification`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationKnowledgeMonitoringProgram(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Program under which a medication is reviewed. The program under which the medication is reviewed. """ __resource_type__ = "MedicationKnowledgeMonitoringProgram" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name of the reviewing program", description=None, json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Type of program under which the medication is monitored", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeMonitoringProgram`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "name"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeMonitoringProgram`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationKnowledgeMonograph(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Associated documentation about the medication. """ __resource_type__ = "MedicationKnowledgeMonograph" source: fhirtypes.ReferenceType | None = Field( default=None, alias="source", title="Associated documentation about the medication", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference", "Media"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The category of medication document", description=( "The category of documentation about the medication. (e.g. professional" " monograph, patient education monograph)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeMonograph`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "source"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeMonograph`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationKnowledgePackaging(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details about packaged medications. Information that only applies to packages (not products). """ __resource_type__ = "MedicationKnowledgePackaging" quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="The number of product units the package would contain if fully loaded", description=None, json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title=( "A code that defines the specific type of packaging that the medication" " can be found in" ), description=( "A code that defines the specific type of packaging that the medication" " can be found in (e.g. blister sleeve, tube, bottle)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgePackaging`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "quantity"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgePackaging`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationKnowledgeRegulatory(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Regulatory information about a medication. """ __resource_type__ = "MedicationKnowledgeRegulatory" maxDispense: fhirtypes.MedicationKnowledgeRegulatoryMaxDispenseType | None = Field( default=None, alias="maxDispense", title=( "The maximum number of units of the medication that can be dispensed in" " a period" ), description=None, json_schema_extra={ "element_property": True, }, ) regulatoryAuthority: fhirtypes.ReferenceType = Field( default=..., alias="regulatoryAuthority", title="Specifies the authority of the regulation", description="The authority that is specifying the regulations.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) schedule: typing.List[ fhirtypes.MedicationKnowledgeRegulatoryScheduleType ] | None = Field( default=None, alias="schedule", title="Specifies the schedule of a medication in jurisdiction", description=None, json_schema_extra={ "element_property": True, }, ) substitution: typing.List[ fhirtypes.MedicationKnowledgeRegulatorySubstitutionType ] | None = Field( default=None, alias="substitution", title=( "Specifies if changes are allowed when dispensing a medication from a " "regulatory perspective" ), description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeRegulatory`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "regulatoryAuthority", "substitution", "schedule", "maxDispense", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeRegulatory`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationKnowledgeRegulatoryMaxDispense(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The maximum number of units of the medication that can be dispensed in a period. """ __resource_type__ = "MedicationKnowledgeRegulatoryMaxDispense" period: fhirtypes.DurationType | None = Field( default=None, alias="period", title="The period that applies to the maximum number of units", description=None, json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType = Field( default=..., alias="quantity", title="The maximum number of units of the medication that can be dispensed", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeRegulatoryMaxDispense`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "quantity", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeRegulatoryMaxDispense`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationKnowledgeRegulatorySchedule(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specifies the schedule of a medication in jurisdiction. """ __resource_type__ = "MedicationKnowledgeRegulatorySchedule" schedule: fhirtypes.CodeableConceptType = Field( default=..., alias="schedule", title="Specifies the specific drug schedule", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeRegulatorySchedule`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "schedule"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeRegulatorySchedule`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationKnowledgeRegulatorySubstitution(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specifies if changes are allowed when dispensing a medication from a regulatory perspective. """ __resource_type__ = "MedicationKnowledgeRegulatorySubstitution" allowed: bool | None = Field( default=None, alias="allowed", title=( "Specifies if regulation allows for changes in the medication when " "dispensing" ), description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) allowed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allowed", title="Extension field for ``allowed``." ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Specifies the type of substitution allowed", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeRegulatorySubstitution`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "allowed"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeRegulatorySubstitution`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("allowed", "allowed__ext")] return required_fields class MedicationKnowledgeRelatedMedicationKnowledge(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Associated or related medication information. Associated or related knowledge about a medication. """ __resource_type__ = "MedicationKnowledgeRelatedMedicationKnowledge" reference: typing.List[fhirtypes.ReferenceType] = Field( default=..., alias="reference", title="Associated documentation about the associated medication knowledge", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicationKnowledge"], }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Category of medicationKnowledge", description="The category of the associated medication knowledge reference.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeRelatedMedicationKnowledge`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "reference"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeRelatedMedicationKnowledge`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/medicationrequest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MedicationRequest Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MedicationRequest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Ordering of medication for patient or group. An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationRequest" rather than "MedicationPrescription" or "MedicationOrder" to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns. """ __resource_type__ = "MedicationRequest" authoredOn: fhirtypes.DateTimeType | None = Field( default=None, alias="authoredOn", title="When request was initially authored", description=( "The date (and perhaps time) when the prescription was initially " "written or authored on." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoredOn", title="Extension field for ``authoredOn``." ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="What request fulfills", description=( "A plan or request that is fulfilled in whole or in part by this " "medication request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CarePlan", "MedicationRequest", "ServiceRequest", "ImmunizationRecommendation", ], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Type of medication usage", description=( "Indicates the type of medication request (for example, where the " "medication is expected to be consumed or administered (i.e. inpatient " "or outpatient))." ), json_schema_extra={ "element_property": True, }, ) courseOfTherapyType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="courseOfTherapyType", title="Overall pattern of medication administration", description=( "The description of the overall patte3rn of the administration of the " "medication to the patient." ), json_schema_extra={ "element_property": True, }, ) detectedIssue: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="detectedIssue", title="Clinical Issue with action", description=( "Indicates an actual or potential clinical issue with or between one or" " more active or proposed clinical actions for a patient; e.g. Drug-" "drug interaction, duplicate therapy, dosage alert etc." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DetectedIssue"], }, ) dispenseRequest: fhirtypes.MedicationRequestDispenseRequestType | None = Field( default=None, alias="dispenseRequest", title="Medication supply authorization", description=( "Indicates the specific details for the dispense or medication supply " "part of a medication request (also known as a Medication Prescription " "or Medication Order). Note that this information is not always sent " "with the order. There may be in some settings (e.g. hospitals) " "institutional or system support for completing the dispense details in" " the pharmacy department." ), json_schema_extra={ "element_property": True, }, ) doNotPerform: bool | None = Field( default=None, alias="doNotPerform", title="True if request is prohibiting action", description=( "If true indicates that the provider is asking for the medication " "request not to occur." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doNotPerform", title="Extension field for ``doNotPerform``.", ) dosageInstruction: typing.List[fhirtypes.DosageType] | None = Field( default=None, alias="dosageInstruction", title="How the medication should be taken", description="Indicates how the medication is to be used by the patient.", json_schema_extra={ "element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter created as part of encounter/admission/stay", description=( "The Encounter during which this [x] was created or to which the " "creation of this record is tightly associated." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) eventHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="eventHistory", title="A list of events of interest in the lifecycle", description=( "Links to Provenance records for past versions of this resource or " "fulfilling request or event resources that identify key state " "transitions or updates that are likely to be relevant to a user " "looking at the current version of the resource." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Provenance"], }, ) groupIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="groupIdentifier", title="Composite request this is part of", description=( "A shared identifier common to all requests that were authorized more " "or less simultaneously by a single author, representing the identifier" " of the requisition or prescription." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External ids for this request", description=( "Identifiers associated with this medication request that are defined " "by business processes and/or used to refer to it when a direct URL " "reference to the resource itself is not appropriate. They are business" " identifiers assigned to this resource by the performer or other " "systems and remain constant as the resource is updated and propagates " "from server to server." ), json_schema_extra={ "element_property": True, }, ) instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="instantiatesCanonical", title="Instantiates FHIR protocol or definition", description=( "The URL pointing to a protocol, guideline, orderset, or other " "definition that is adhered to in whole or in part by this " "MedicationRequest." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesCanonical__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="instantiatesUri", title="Instantiates external protocol or definition", description=( "The URL pointing to an externally maintained protocol, guideline, " "orderset or other definition that is adhered to in whole or in part by" " this MedicationRequest." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) insurance: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="insurance", title="Associated insurance coverage", description=( "Insurance plans, coverage extensions, pre-authorizations and/or pre-" "determinations that may be required for delivering the requested " "service." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage", "ClaimResponse"], }, ) intent: fhirtypes.CodeType | None = Field( default=None, alias="intent", title=( "proposal | plan | order | original-order | reflex-order | filler-order" " | instance-order | option" ), description="Whether the request is a proposal, plan, or an original order.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "proposal", "plan", "order", "original-order", "reflex-order", "filler-order", "instance-order", "option", ], }, ) intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intent", title="Extension field for ``intent``." ) medicationCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="medicationCodeableConcept", title="Medication to be taken", description=( "Identifies the medication being requested. This is a link to a " "resource that represents the medication which may be the details of " "the medication or simply an attribute carrying a code that identifies " "the medication from a known list of medications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e medication[x] "one_of_many": "medication", "one_of_many_required": True, }, ) medicationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="medicationReference", title="Medication to be taken", description=( "Identifies the medication being requested. This is a link to a " "resource that represents the medication which may be the details of " "the medication or simply an attribute carrying a code that identifies " "the medication from a known list of medications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e medication[x] "one_of_many": "medication", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Information about the prescription", description=( "Extra information about the prescription that could not be conveyed by" " the other attributes." ), json_schema_extra={ "element_property": True, }, ) performer: fhirtypes.ReferenceType | None = Field( default=None, alias="performer", title="Intended performer of administration", description=( "The specified desired performer of the medication treatment (e.g. the " "performer of the medication administration)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Patient", "Device", "RelatedPerson", "CareTeam", ], }, ) performerType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="performerType", title="Desired kind of performer of the medication administration", description=( "Indicates the type of performer of the administration of the " "medication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) priorPrescription: fhirtypes.ReferenceType | None = Field( default=None, alias="priorPrescription", title="An order/prescription that is being replaced", description=( "A link to a resource representing an earlier order related order or " "prescription." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicationRequest"], }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Indicates how quickly the Medication Request should be addressed with " "respect to other requests." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Reason or indication for ordering or not ordering the medication", description=( "The reason or the indication for ordering or not ordering the " "medication." ), json_schema_extra={ "element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title=( "Condition or observation that supports why the prescription is being " "written" ), description="Condition or observation that supports why the medication was ordered.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "Observation"], }, ) recorder: fhirtypes.ReferenceType | None = Field( default=None, alias="recorder", title="Person who entered the request", description=( "The person who entered the order on behalf of another individual for " "example in the case of a verbal or a telephone order." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) reportedBoolean: bool | None = Field( default=None, alias="reportedBoolean", title="Reported rather than primary record", description=( "Indicates if this record was captured as a secondary 'reported' record" " rather than as an original primary source-of-truth record. It may " "also indicate the source of the report." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e reported[x] "one_of_many": "reported", "one_of_many_required": False, }, ) reportedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reportedBoolean", title="Extension field for ``reportedBoolean``.", ) reportedReference: fhirtypes.ReferenceType | None = Field( default=None, alias="reportedReference", title="Reported rather than primary record", description=( "Indicates if this record was captured as a secondary 'reported' record" " rather than as an original primary source-of-truth record. It may " "also indicate the source of the report." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e reported[x] "one_of_many": "reported", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Organization", ], }, ) requester: fhirtypes.ReferenceType | None = Field( default=None, alias="requester", title="Who/What requested the Request", description=( "The individual, organization, or device that initiated the request and" " has responsibility for its activation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Patient", "RelatedPerson", "Device", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "active | on-hold | cancelled | completed | entered-in-error | stopped " "| draft | unknown" ), description=( "A code specifying the current state of the order. Generally, this " "will be active or completed state." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "active", "on-hold", "cancelled", "completed", "entered-in-error", "stopped", "draft", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="statusReason", title="Reason for current status", description="Captures the reason for the current state of the MedicationRequest.", json_schema_extra={ "element_property": True, }, ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who or group medication request is for", description=( "A link to a resource representing the person or set of individuals to " "whom the medication will be given." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) substitution: fhirtypes.MedicationRequestSubstitutionType | None = Field( default=None, alias="substitution", title="Any restrictions on medication substitution", description=( "Indicates whether or not substitution can or should be part of the " "dispense. In some cases, substitution must happen, in other cases " "substitution must not happen. This block explains the prescriber's " "intent. If nothing is specified substitution may be done." ), json_schema_extra={ "element_property": True, }, ) supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInformation", title="Information to support ordering of the medication", description=( "Include additional information (for example, patient height and " "weight) that supports the ordering of the medication." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "statusReason", "intent", "category", "priority", "doNotPerform", "reportedBoolean", "reportedReference", "medicationCodeableConcept", "medicationReference", "subject", "encounter", "supportingInformation", "authoredOn", "requester", "performer", "performerType", "recorder", "reasonCode", "reasonReference", "instantiatesCanonical", "instantiatesUri", "basedOn", "groupIdentifier", "courseOfTherapyType", "insurance", "note", "dosageInstruction", "dispenseRequest", "substitution", "priorPrescription", "detectedIssue", "eventHistory", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "status", "intent", "priority", "doNotPerform", "reportedBoolean", "reportedReference", "medicationCodeableConcept", "medicationReference", "subject", "authoredOn", "requester", "performerType", "instantiatesCanonical", "instantiatesUri", "basedOn", "groupIdentifier", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("intent", "intent__ext"), ("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "medication": ["medicationCodeableConcept", "medicationReference"], "reported": ["reportedBoolean", "reportedReference"], } return one_of_many_fields class MedicationRequestDispenseRequest(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Medication supply authorization. Indicates the specific details for the dispense or medication supply part of a medication request (also known as a Medication Prescription or Medication Order). Note that this information is not always sent with the order. There may be in some settings (e.g. hospitals) institutional or system support for completing the dispense details in the pharmacy department. """ __resource_type__ = "MedicationRequestDispenseRequest" dispenseInterval: fhirtypes.DurationType | None = Field( default=None, alias="dispenseInterval", title="Minimum period of time between dispenses", description=( "The minimum period of time that must occur between dispenses of the " "medication." ), json_schema_extra={ "element_property": True, }, ) expectedSupplyDuration: fhirtypes.DurationType | None = Field( default=None, alias="expectedSupplyDuration", title="Number of days supply per dispense", description=( "Identifies the period time over which the supplied product is expected" " to be used, or the length of time the dispense is expected to last." ), json_schema_extra={ "element_property": True, }, ) initialFill: fhirtypes.MedicationRequestDispenseRequestInitialFillType | None = ( Field( default=None, alias="initialFill", title="First fill details", description=( "Indicates the quantity or duration for the first dispense of the " "medication." ), json_schema_extra={ "element_property": True, }, ) ) numberOfRepeatsAllowed: fhirtypes.UnsignedIntType | None = Field( default=None, alias="numberOfRepeatsAllowed", title="Number of refills authorized", description=( "An integer indicating the number of times, in addition to the original" " dispense, (aka refills or repeats) that the patient can receive the " "prescribed medication. Usage Notes: This integer does not include the " "original order dispense. This means that if an order indicates " 'dispense 30 tablets plus "3 repeats", then the order can be dispensed ' "a total of 4 times and the patient can receive a total of 120 tablets." " A prescriber may explicitly say that zero refills are permitted " "after the initial dispense." ), json_schema_extra={ "element_property": True, }, ) numberOfRepeatsAllowed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_numberOfRepeatsAllowed", title="Extension field for ``numberOfRepeatsAllowed``.", ) performer: fhirtypes.ReferenceType | None = Field( default=None, alias="performer", title="Intended dispenser", description=( "Indicates the intended dispensing Organization specified by the " "prescriber." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Amount of medication to supply per dispense", description="The amount that is to be dispensed for one fill.", json_schema_extra={ "element_property": True, }, ) validityPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="validityPeriod", title="Time period supply is authorized for", description=( "This indicates the validity period of a prescription (stale dating the" " Prescription)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationRequestDispenseRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "initialFill", "dispenseInterval", "validityPeriod", "numberOfRepeatsAllowed", "quantity", "expectedSupplyDuration", "performer", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationRequestDispenseRequest`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationRequestDispenseRequestInitialFill(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. First fill details. Indicates the quantity or duration for the first dispense of the medication. """ __resource_type__ = "MedicationRequestDispenseRequestInitialFill" duration: fhirtypes.DurationType | None = Field( default=None, alias="duration", title="First fill duration", description="The length of time that the first dispense is expected to last.", json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="First fill quantity", description="The amount or quantity to provide as part of the first dispense.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationRequestDispenseRequestInitialFill`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "quantity", "duration"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationRequestDispenseRequestInitialFill`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationRequestSubstitution(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Any restrictions on medication substitution. Indicates whether or not substitution can or should be part of the dispense. In some cases, substitution must happen, in other cases substitution must not happen. This block explains the prescriber's intent. If nothing is specified substitution may be done. """ __resource_type__ = "MedicationRequestSubstitution" allowedBoolean: bool | None = Field( default=None, alias="allowedBoolean", title="Whether substitution is allowed or not", description=( "True if the prescriber allows a different drug to be dispensed from " "what was prescribed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e allowed[x] "one_of_many": "allowed", "one_of_many_required": True, }, ) allowedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allowedBoolean", title="Extension field for ``allowedBoolean``.", ) allowedCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="allowedCodeableConcept", title="Whether substitution is allowed or not", description=( "True if the prescriber allows a different drug to be dispensed from " "what was prescribed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e allowed[x] "one_of_many": "allowed", "one_of_many_required": True, }, ) reason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reason", title="Why should (not) substitution be made", description=( "Indicates the reason for the substitution, or why substitution must or" " must not be performed." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationRequestSubstitution`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "allowedBoolean", "allowedCodeableConcept", "reason", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationRequestSubstitution`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"allowed": ["allowedBoolean", "allowedCodeableConcept"]} return one_of_many_fields ================================================ FILE: fhir/resources/R4B/medicationstatement.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MedicationStatement Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class MedicationStatement(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Record of medication being taken by a patient. A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from sources such as the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains. The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information. """ __resource_type__ = "MedicationStatement" basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Fulfils plan, proposal or order", description=( "A plan, proposal or order that is fulfilled in whole or in part by " "this event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicationRequest", "CarePlan", "ServiceRequest"], }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Type of medication usage", description=( "Indicates where the medication is expected to be consumed or " "administered." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Encounter / Episode associated with MedicationStatement", description=( "The encounter or episode of care that establishes the context for this" " MedicationStatement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) dateAsserted: fhirtypes.DateTimeType | None = Field( default=None, alias="dateAsserted", title="When the statement was asserted?", description=( "The date when the medication statement was asserted by the information" " source." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dateAsserted__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dateAsserted", title="Extension field for ``dateAsserted``.", ) derivedFrom: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="derivedFrom", title="Additional supporting information", description=( "Allows linking the MedicationStatement to the underlying " "MedicationRequest, or to other information that supports or is used to" " derive the MedicationStatement." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) dosage: typing.List[fhirtypes.DosageType] | None = Field( default=None, alias="dosage", title="Details of how medication is/was taken or should be taken", description="Indicates how the medication is/was or should be taken by the patient.", json_schema_extra={ "element_property": True, }, ) effectiveDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="effectiveDateTime", title="The date/time or interval when the medication is/was/will be taken", description=( "The interval of time during which it is being asserted that the " "patient is/was/will be taking the medication (or was not taking, when " "the MedicationStatement.taken element is No)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_effectiveDateTime", title="Extension field for ``effectiveDateTime``.", ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="The date/time or interval when the medication is/was/will be taken", description=( "The interval of time during which it is being asserted that the " "patient is/was/will be taking the medication (or was not taking, when " "the MedicationStatement.taken element is No)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External identifier", description=( "Identifiers associated with this Medication Statement that are defined" " by business processes and/or used to refer to it when a direct URL " "reference to the resource itself is not appropriate. They are business" " identifiers assigned to this resource by the performer or other " "systems and remain constant as the resource is updated and propagates " "from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) informationSource: fhirtypes.ReferenceType | None = Field( default=None, alias="informationSource", title=( "Person or organization that provided the information about the taking " "of this medication" ), description=( "The person or organization that provided the information about the " "taking of this medication. Note: Use derivedFrom when a " "MedicationStatement is derived from other resources, e.g. Claim or " "MedicationRequest." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Organization", ], }, ) medicationCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="medicationCodeableConcept", title="What medication was taken", description=( "Identifies the medication being administered. This is either a link to" " a resource representing the details of the medication or a simple " "attribute carrying a code that identifies the medication from a known " "list of medications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e medication[x] "one_of_many": "medication", "one_of_many_required": True, }, ) medicationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="medicationReference", title="What medication was taken", description=( "Identifies the medication being administered. This is either a link to" " a resource representing the details of the medication or a simple " "attribute carrying a code that identifies the medication from a known " "list of medications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e medication[x] "one_of_many": "medication", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Further information about the statement", description=( "Provides extra information about the medication statement that is not " "conveyed by the other attributes." ), json_schema_extra={ "element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced event", description="A larger event of which this particular event is a component or step.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "MedicationAdministration", "MedicationDispense", "MedicationStatement", "Procedure", "Observation", ], }, ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Reason for why the medication is being/was taken", description="A reason for why the medication is being/was taken.", json_schema_extra={ "element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title=( "Condition or observation that supports why the medication is being/was" " taken" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "Observation", "DiagnosticReport"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "active | completed | entered-in-error | intended | stopped | on-hold |" " unknown | not-taken" ), description=( "A code representing the patient or other source's judgment about the " "state of the medication used that this statement is about. Generally," " this will be active or completed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "active", "completed", "entered-in-error", "intended", "stopped", "on-hold", "unknown", "not-taken", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusReason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="statusReason", title="Reason for current status", description="Captures the reason for the current state of the MedicationStatement.", json_schema_extra={ "element_property": True, }, ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who is/was taking the medication", description="The person, animal or group who is/was taking the medication.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationStatement`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "partOf", "status", "statusReason", "category", "medicationCodeableConcept", "medicationReference", "subject", "context", "effectiveDateTime", "effectivePeriod", "dateAsserted", "informationSource", "derivedFrom", "reasonCode", "reasonReference", "note", "dosage", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationStatement`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "basedOn", "partOf", "status", "category", "medicationCodeableConcept", "medicationReference", "subject", "context", "effectiveDateTime", "effectivePeriod", "dateAsserted", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "effective": ["effectiveDateTime", "effectivePeriod"], "medication": ["medicationCodeableConcept", "medicationReference"], } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/medicinalproductdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MedicinalProductDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MedicinalProductDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Detailed definition of a medicinal product. A medicinal product, being a substance or combination of substances that is intended to treat, prevent or diagnose a disease, or to restore, correct or modify physiological functions by exerting a pharmacological, immunological or metabolic action. This resource is intended to define and detail such products and their properties, for uses other than direct patient care (e.g. regulatory use, or drug catalogs). """ __resource_type__ = "MedicinalProductDefinition" additionalMonitoringIndicator: fhirtypes.CodeableConceptType | None = Field( default=None, alias="additionalMonitoringIndicator", title=( "Whether the Medicinal Product is subject to additional monitoring for " "regulatory reasons" ), description=( "Whether the Medicinal Product is subject to additional monitoring for " "regulatory reasons, such as heightened reporting requirements." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) attachedDocument: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="attachedDocument", title="Additional documentation about the medicinal product", description=( "Additional information or supporting documentation about the medicinal" " product." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) characteristic: typing.List[ fhirtypes.MedicinalProductDefinitionCharacteristicType ] | None = Field( default=None, alias="characteristic", title='Key product features such as "sugar free", "modified release"', description=( 'Allows the key product features to be recorded, such as "sugar free", ' '"modified release", "parallel import".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) classification: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="classification", title="Allows the product to be classified by various systems", description=( "Allows the product to be classified by various systems, commonly WHO " "ATC." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) clinicalTrial: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="clinicalTrial", title="Clinical trials or studies that this product is involved in", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ResearchStudy"], }, ) code: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="code", title="A code that this product is known by, within some formal terminology", description=( "A code that this product is known by, usually within some formal " "terminology, perhaps assigned by a third party (i.e. not the " "manufacturer or regulator). Products (types of medications) tend to be" " known by identifiers during development and within regulatory " "process. However when they are prescribed they tend to be identified " "by codes. The same product may be have multiple codes, applied to it " "by multiple organizations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) combinedPharmaceuticalDoseForm: fhirtypes.CodeableConceptType | None = Field( default=None, alias="combinedPharmaceuticalDoseForm", title=( "The dose form for a single part product, or combined form of a " "multiple part product" ), description=( "The dose form for a single part product, or combined form of a " "multiple part product. This is one concept that describes all the " "components. It does not represent the form with components physically " "mixed, if that might be necessary, for which see " "(AdministrableProductDefinition.administrableDoseForm)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[ fhirtypes.MedicinalProductDefinitionContactType ] | None = Field( default=None, alias="contact", title="A product specific contact, person (in a role), or an organization", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) crossReference: typing.List[ fhirtypes.MedicinalProductDefinitionCrossReferenceType ] | None = Field( default=None, alias="crossReference", title=( "Reference to another product, e.g. for linking authorised to " "investigational product" ), description=( "Reference to another product, e.g. for linking authorised to " "investigational product, or a virtual product." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="General description of this product", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) domain: fhirtypes.CodeableConceptType | None = Field( default=None, alias="domain", title="If this medicine applies to human or veterinary uses", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier for this product. Could be an MPID", description=( "Business identifier for this product. Could be an MPID. When in " "development or being regulated, products are typically referenced by " "official identifiers, assigned by a manufacturer or regulator, and " "unique to a product (which, when compared to a product instance being " "prescribed, is actually a product type). See also " "MedicinalProductDefinition.code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) impurity: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="impurity", title=( "Any component of the drug product which is not the chemical entity " "defined as the drug substance, or an excipient in the drug product" ), description=( "Any component of the drug product which is not the chemical entity " "defined as the drug substance, or an excipient in the drug product. " "This includes process-related impurities and contaminants, product-" "related impurities including degradation products." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SubstanceDefinition"], }, ) indication: fhirtypes.MarkdownType | None = Field( default=None, alias="indication", title=( "Description of indication(s) for this product, used when structured " "indications are not required" ), description=( "Description of indication(s) for this product, used when structured " "indications are not required. In cases where structured indications " "are required, they are captured using the ClinicalUseDefinition " "resource. An indication is a medical situation for which using the " "product is appropriate." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) indication__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_indication", title="Extension field for ``indication``." ) ingredient: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="ingredient", title=( "The ingredients of this medicinal product - when not detailed in other" " resources" ), description=( "The ingredients of this medicinal product - when not detailed in other" " resources. This is only needed if the ingredients are not specified " "by incoming references from the Ingredient resource, or indirectly via" " incoming AdministrableProductDefinition, PackagedProductDefinition or" " ManufacturedItemDefinition references. In cases where those levels of" " detail are not used, the ingredients may be specified directly here " "as codes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) legalStatusOfSupply: fhirtypes.CodeableConceptType | None = Field( default=None, alias="legalStatusOfSupply", title=( "The legal status of supply of the medicinal product as classified by " "the regulator" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) marketingStatus: typing.List[fhirtypes.MarketingStatusType] | None = Field( default=None, alias="marketingStatus", title=( "Marketing status of the medicinal product, in contrast to marketing " "authorization" ), description=( "Marketing status of the medicinal product, in contrast to marketing " "authorization. This refers to the product being actually 'on the " "market' as opposed to being allowed to be on the market (which is an " "authorization)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) masterFile: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="masterFile", title=( "A master file for the medicinal product (e.g. Pharmacovigilance System" " Master File)" ), description=( "A master file for the medicinal product (e.g. Pharmacovigilance System" " Master File). Drug master files (DMFs) are documents submitted to " "regulatory agencies to provide confidential detailed information about" " facilities, processes or articles used in the manufacturing, " "processing, packaging and storing of drug products." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) name: typing.List[fhirtypes.MedicinalProductDefinitionNameType] = Field( default=..., alias="name", title="The product's name, including full name and possibly coded parts", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) operation: typing.List[ fhirtypes.MedicinalProductDefinitionOperationType ] | None = Field( default=None, alias="operation", title="A manufacturing or administrative process for the medicinal product", description=( "A manufacturing or administrative process or step associated with (or " "performed on) the medicinal product." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) packagedMedicinalProduct: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="packagedMedicinalProduct", title="Package type for the product", description=( "Package type for the product. See also the PackagedProductDefinition " "resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) pediatricUseIndicator: fhirtypes.CodeableConceptType | None = Field( default=None, alias="pediatricUseIndicator", title="If authorised for use in children", description="If authorised for use in children, or infants, neonates etc.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) route: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="route", title=( "The path by which the product is taken into or makes contact with the " "body" ), description=( "The path by which the product is taken into or makes contact with the " "body. In some regions this is referred to as the licenced or approved " "route. See also AdministrableProductDefinition resource. " "MedicinalProductDefinition.route is the same concept as " "AdministrableProductDefinition.routeOfAdministration.code, and they " "cannot be used together." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) specialMeasures: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialMeasures", title=( "Whether the Medicinal Product is subject to special measures for " "regulatory reasons" ), description=( "Whether the Medicinal Product is subject to special measures for " "regulatory reasons, such as a requirement to conduct post-" "authorisation studies." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeableConceptType | None = Field( default=None, alias="status", title="The status within the lifecycle of this product record", description=( "The status within the lifecycle of this product record. A high-level " "status, this is not intended to duplicate details carried elsewhere " "such as legal status, or authorization status." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) statusDate: fhirtypes.DateTimeType | None = Field( default=None, alias="statusDate", title="The date at which the given status became applicable", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_statusDate", title="Extension field for ``statusDate``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Regulatory type, e.g. Investigational or Authorized", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="A business identifier relating to a specific version of the product", description=( "A business identifier relating to a specific version of the product, " "this is commonly used to support revisions to an existing product." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicinalProductDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "type", "domain", "version", "status", "statusDate", "description", "combinedPharmaceuticalDoseForm", "route", "indication", "legalStatusOfSupply", "additionalMonitoringIndicator", "specialMeasures", "pediatricUseIndicator", "classification", "marketingStatus", "packagedMedicinalProduct", "ingredient", "impurity", "attachedDocument", "masterFile", "contact", "clinicalTrial", "code", "name", "crossReference", "operation", "characteristic", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "type", "domain", "version", "status", "statusDate", "description", "combinedPharmaceuticalDoseForm", "route", "indication", "legalStatusOfSupply", "additionalMonitoringIndicator", "specialMeasures", "pediatricUseIndicator", "classification", "marketingStatus", "packagedMedicinalProduct", "ingredient", "impurity", "attachedDocument", "masterFile", "contact", "clinicalTrial", "code", "name", "crossReference", "operation", "characteristic", ] class MedicinalProductDefinitionCharacteristic(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Key product features such as "sugar free", "modified release". Allows the key product features to be recorded, such as "sugar free", "modified release", "parallel import". """ __resource_type__ = "MedicinalProductDefinitionCharacteristic" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="A code expressing the type of characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicinalProductDefinitionCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueCodeableConcept", "valueQuantity", "valueDate", "valueBoolean", "valueAttachment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "valueCodeableConcept", "valueQuantity", "valueDate", "valueBoolean", "valueAttachment", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueBoolean", "valueCodeableConcept", "valueDate", "valueQuantity", ] } return one_of_many_fields class MedicinalProductDefinitionContact(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A product specific contact, person (in a role), or an organization. """ __resource_type__ = "MedicinalProductDefinitionContact" contact: fhirtypes.ReferenceType = Field( default=..., alias="contact", title="A product specific contact, person (in a role), or an organization", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization", "PractitionerRole"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title=( "Allows the contact to be classified, for example QPPV, " "Pharmacovigilance Enquiry Information" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicinalProductDefinitionContact`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "contact"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionContact`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "contact"] class MedicinalProductDefinitionCrossReference(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Reference to another product, e.g. for linking authorised to investigational product. Reference to another product, e.g. for linking authorised to investigational product, or a virtual product. """ __resource_type__ = "MedicinalProductDefinitionCrossReference" product: fhirtypes.CodeableReferenceType = Field( default=..., alias="product", title=( "Reference to another product, e.g. for linking authorised to " "investigational product" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicinalProductDefinition"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title=( "The type of relationship, for instance branded to generic or virtual " "to actual product" ), description=( "The type of relationship, for instance branded to generic, virtual to " "actual product, product to development product (investigational), " "parallel import version." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicinalProductDefinitionCrossReference`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "product", "type"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionCrossReference`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "product", "type"] class MedicinalProductDefinitionName(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The product's name, including full name and possibly coded parts. """ __resource_type__ = "MedicinalProductDefinitionName" countryLanguage: typing.List[ fhirtypes.MedicinalProductDefinitionNameCountryLanguageType ] | None = Field( default=None, alias="countryLanguage", title="Country and jurisdiction where the name applies", description=( "Country and jurisdiction where the name applies, and associated " "language." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) namePart: typing.List[ fhirtypes.MedicinalProductDefinitionNameNamePartType ] | None = Field( default=None, alias="namePart", title="Coding words or phrases of the name", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) productName: fhirtypes.StringType | None = Field( default=None, alias="productName", title="The full product name", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) productName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_productName", title="Extension field for ``productName``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Type of product name, such as rINN, BAN, Proprietary, Non-Proprietary", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicinalProductDefinitionName`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "productName", "type", "namePart", "countryLanguage", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionName`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "productName", "type", "namePart", "countryLanguage", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("productName", "productName__ext")] return required_fields class MedicinalProductDefinitionNameCountryLanguage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Country and jurisdiction where the name applies. Country and jurisdiction where the name applies, and associated language. """ __resource_type__ = "MedicinalProductDefinitionNameCountryLanguage" country: fhirtypes.CodeableConceptType = Field( default=..., alias="country", title="Country code for where this name applies", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: fhirtypes.CodeableConceptType | None = Field( default=None, alias="jurisdiction", title="Jurisdiction code for where this name applies", description=( "Jurisdiction code for where this name applies. A jurisdiction may be a" " sub- or supra-national entity (e.g. a state or a geographic region)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) language: fhirtypes.CodeableConceptType = Field( default=..., alias="language", title="Language code for this name", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicinalProductDefinitionNameCountryLanguage`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "country", "jurisdiction", "language", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionNameCountryLanguage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "country", "jurisdiction", "language"] class MedicinalProductDefinitionNameNamePart(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Coding words or phrases of the name. """ __resource_type__ = "MedicinalProductDefinitionNameNamePart" part: fhirtypes.StringType | None = Field( default=None, alias="part", title="A fragment of a product name", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) part__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_part", title="Extension field for ``part``." ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Identifying type for this part of the name (e.g. strength part)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicinalProductDefinitionNameNamePart`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "part", "type"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionNameNamePart`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "part", "type"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("part", "part__ext")] return required_fields class MedicinalProductDefinitionOperation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A manufacturing or administrative process for the medicinal product. A manufacturing or administrative process or step associated with (or performed on) the medicinal product. """ __resource_type__ = "MedicinalProductDefinitionOperation" confidentialityIndicator: fhirtypes.CodeableConceptType | None = Field( default=None, alias="confidentialityIndicator", title=( "Specifies whether this process is considered proprietary or " "confidential" ), description=( "Specifies whether this particular business or manufacturing process is" " considered proprietary or confidential." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) effectiveDate: fhirtypes.PeriodType | None = Field( default=None, alias="effectiveDate", title="Date range of applicability", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) organization: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="organization", title=( "The organization responsible for the particular process, e.g. the " "manufacturer or importer" ), description=( "The organization or establishment responsible for (or associated with)" " the particular process or step, examples include the manufacturer, " "importer, agent." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) type: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="type", title=( "The type of manufacturing operation e.g. manufacturing itself, re-" "packaging" ), description=( "The type of manufacturing operation e.g. manufacturing itself, re-" "packaging. For the authorization of this, a RegulatedAuthorization " "would point to the same plan or activity referenced here." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ActivityDefinition", "PlanDefinition"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicinalProductDefinitionOperation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "effectiveDate", "organization", "confidentialityIndicator", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionOperation`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "effectiveDate", "organization", "confidentialityIndicator", ] ================================================ FILE: fhir/resources/R4B/messagedefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MessageDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MessageDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A resource that defines a type of message that can be exchanged between systems. Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted. """ __resource_type__ = "MessageDefinition" allowedResponse: typing.List[ fhirtypes.MessageDefinitionAllowedResponseType ] | None = Field( default=None, alias="allowedResponse", title="Responses to this message", description=( "Indicates what types of messages may be sent as an application-level " "response to this message." ), json_schema_extra={ "element_property": True, }, ) base: fhirtypes.CanonicalType | None = Field( default=None, alias="base", title="Definition this one is based on", description=( "The MessageDefinition that is the basis for the contents of this " "resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MessageDefinition"], }, ) base__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_base", title="Extension field for ``base``." ) category: fhirtypes.CodeType | None = Field( default=None, alias="category", title="consequence | currency | notification", description="The impact of the content of the message.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["consequence", "currency", "notification"], }, ) category__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_category", title="Extension field for ``category``." ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the message definition and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the message definition." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the message definition was " "published. The date must change when the business version changes and " "it must change if the status code changes. In addition, it should " "change when the substantive content of the message definition changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the message definition", description=( "A free text natural language description of the message definition " "from a consumer's perspective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) eventCoding: fhirtypes.CodingType | None = Field( default=None, alias="eventCoding", title="Event code or link to the EventDefinition", description="Event code or link to the EventDefinition.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e event[x] "one_of_many": "event", "one_of_many_required": True, }, ) eventUri: fhirtypes.UriType | None = Field( default=None, alias="eventUri", title="Event code or link to the EventDefinition", description="Event code or link to the EventDefinition.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e event[x] "one_of_many": "event", "one_of_many_required": True, }, ) eventUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_eventUri", title="Extension field for ``eventUri``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this message definition is authored " "for testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) focus: typing.List[fhirtypes.MessageDefinitionFocusType] | None = Field( default=None, alias="focus", title="Resource(s) that are the subject of the event", description=( "Identifies the resource (or resources) that are being addressed by the" " event. For example, the Encounter for an admit message or two " "Account records for a merge." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) graph: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="graph", title="Canonical reference to a GraphDefinition", description=( "Canonical reference to a GraphDefinition. If a URL is provided, it is " "the canonical reference to a [GraphDefinition](graphdefinition.html) " "that it controls what resources are to be added to the bundle when " "building the document. The GraphDefinition can also specify profiles " "that apply to the various resources." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["GraphDefinition"], }, ) graph__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_graph", title="Extension field for ``graph``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Primary key for the message definition on a given server", description=( "A formal identifier that is used to identify this message definition " "when it is represented in other formats, or referenced in a " "specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for message definition (if applicable)", description=( "A legal or geographic region in which the message definition is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this message definition (computer friendly)", description=( "A natural language name identifying the message definition. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) parent: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="parent", title="Protocol/workflow this is part of", description=( "Identifies a protocol or workflow that this MessageDefinition " "represents a step in." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ActivityDefinition", "PlanDefinition"], }, ) parent__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_parent", title="Extension field for ``parent``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the message " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this message definition is defined", description=( "Explanation of why this message definition is needed and why it has " "been designed as it has." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) replaces: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="replaces", title="Takes the place of", description="A MessageDefinition that is superseded by this definition.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MessageDefinition"], }, ) replaces__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_replaces", title="Extension field for ``replaces``." ) responseRequired: fhirtypes.CodeType | None = Field( default=None, alias="responseRequired", title="always | on-error | never | on-success", description=( "Declare at a message definition level whether a response is required " "or only upon error or success, or never." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["always", "on-error", "never", "on-success"], }, ) responseRequired__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_responseRequired", title="Extension field for ``responseRequired``.", ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this message definition. Enables tracking the life-cycle" " of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this message definition (human friendly)", description="A short, descriptive, user-friendly title for the message definition.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Business Identifier for a given MessageDefinition", description=( "The business identifier that is used to reference the " "MessageDefinition and *is* expected to be consistent from server to " "server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate message definition instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the message definition", description=( "The identifier that is used to identify this version of the message " "definition when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the message definition" " author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MessageDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "replaces", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "base", "parent", "eventCoding", "eventUri", "category", "focus", "responseRequired", "allowedResponse", "graph", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MessageDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "replaces", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "base", "parent", "eventCoding", "eventUri", "category", "focus", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("date", "date__ext"), ("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"event": ["eventCoding", "eventUri"]} return one_of_many_fields class MessageDefinitionAllowedResponse(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Responses to this message. Indicates what types of messages may be sent as an application-level response to this message. """ __resource_type__ = "MessageDefinitionAllowedResponse" message: fhirtypes.CanonicalType | None = Field( default=None, alias="message", title="Reference to allowed message definition response", description=( "A reference to the message definition that must be adhered to by this " "supported response." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MessageDefinition"], }, ) message__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_message", title="Extension field for ``message``." ) situation: fhirtypes.MarkdownType | None = Field( default=None, alias="situation", title="When should this response be used", description=( "Provides a description of the circumstances in which this response " "should be used (as opposed to one of the alternative responses)." ), json_schema_extra={ "element_property": True, }, ) situation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_situation", title="Extension field for ``situation``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MessageDefinitionAllowedResponse`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "message", "situation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MessageDefinitionAllowedResponse`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("message", "message__ext")] return required_fields class MessageDefinitionFocus(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Resource(s) that are the subject of the event. Identifies the resource (or resources) that are being addressed by the event. For example, the Encounter for an admit message or two Account records for a merge. """ __resource_type__ = "MessageDefinitionFocus" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Type of resource", description="The kind of resource that must be the focus for this message.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) max: fhirtypes.StringType | None = Field( default=None, alias="max", title="Maximum number of focuses of this type", description=( "Identifies the maximum number of resources of this type that must be " "pointed to by a message in order for it to be valid against this " "MessageDefinition." ), json_schema_extra={ "element_property": True, }, ) max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_max", title="Extension field for ``max``." ) min: fhirtypes.UnsignedIntType | None = Field( default=None, alias="min", title="Minimum number of focuses of this type", description=( "Identifies the minimum number of resources of this type that must be " "pointed to by a message in order for it to be valid against this " "MessageDefinition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_min", title="Extension field for ``min``." ) profile: fhirtypes.CanonicalType | None = Field( default=None, alias="profile", title="Profile that must be adhered to by focus", description=( "A profile that reflects constraints for the focal resource (and " "potentially for related resources)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MessageDefinitionFocus`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "profile", "min", "max"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MessageDefinitionFocus`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "min"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext"), ("min", "min__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/messageheader.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MessageHeader Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MessageHeader(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A resource that describes a message that is exchanged between systems. The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. """ __resource_type__ = "MessageHeader" author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="The source of the decision", description=( "The logical author of the message - the person or device that decided " "the described event should happen. When there is more than one " "candidate, pick the most proximal to the MessageHeader. Can provide " "other authors in extensions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) definition: fhirtypes.CanonicalType | None = Field( default=None, alias="definition", title="Link to the definition for this message", description="Permanent link to the MessageDefinition for this message.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MessageDefinition"], }, ) definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) destination: typing.List[fhirtypes.MessageHeaderDestinationType] | None = Field( default=None, alias="destination", title="Message destination application(s)", description="The destination application which the message is intended for.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) enterer: fhirtypes.ReferenceType | None = Field( default=None, alias="enterer", title="The source of the data entry", description=( "The person or device that performed the data entry leading to this " "message. When there is more than one candidate, pick the most proximal" " to the message. Can provide other enterers in extensions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) eventCoding: fhirtypes.CodingType | None = Field( default=None, alias="eventCoding", title="Code for the event this message represents or link to event definition", description=( "Code that identifies the event this message represents and connects it" " with its definition. Events defined as part of the FHIR specification" ' have the system value "http://terminology.hl7.org/CodeSystem/message-' 'events". Alternatively uri to the EventDefinition.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e event[x] "one_of_many": "event", "one_of_many_required": True, }, ) eventUri: fhirtypes.UriType | None = Field( default=None, alias="eventUri", title="Code for the event this message represents or link to event definition", description=( "Code that identifies the event this message represents and connects it" " with its definition. Events defined as part of the FHIR specification" ' have the system value "http://terminology.hl7.org/CodeSystem/message-' 'events". Alternatively uri to the EventDefinition.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e event[x] "one_of_many": "event", "one_of_many_required": True, }, ) eventUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_eventUri", title="Extension field for ``eventUri``." ) focus: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="focus", title="The actual content of the message", description=( "The actual data of the message - a reference to the root/focus class " "of the event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) reason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reason", title="Cause of event", description=( "Coded indication of the cause for the event - indicates a reason for " "the occurrence of the event that is a focus of this message." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) response: fhirtypes.MessageHeaderResponseType | None = Field( default=None, alias="response", title="If this is a reply to prior message", description=( "Information about the message that this message is a response to. " "Only present if this message is a response." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) responsible: fhirtypes.ReferenceType | None = Field( default=None, alias="responsible", title="Final responsibility for event", description=( "The person or organization that accepts overall responsibility for the" " contents of the message. The implication is that the message event " "happened under the policies of the responsible party." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) sender: fhirtypes.ReferenceType | None = Field( default=None, alias="sender", title="Real world sender of the message", description=( "Identifies the sending system to allow the use of a trust " "relationship." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) source: fhirtypes.MessageHeaderSourceType = Field( default=..., alias="source", title="Message source application", description="The source application from which this message originated.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MessageHeader`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "eventCoding", "eventUri", "destination", "sender", "enterer", "author", "source", "responsible", "reason", "response", "focus", "definition", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MessageHeader`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "eventCoding", "eventUri", "destination", "sender", "enterer", "author", "source", "responsible", "reason", "response", "focus", "definition", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"event": ["eventCoding", "eventUri"]} return one_of_many_fields class MessageHeaderDestination(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Message destination application(s). The destination application which the message is intended for. """ __resource_type__ = "MessageHeaderDestination" endpoint: fhirtypes.UrlType | None = Field( default=None, alias="endpoint", title="Actual destination address or id", description="Indicates where the message should be routed to.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) endpoint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_endpoint", title="Extension field for ``endpoint``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name of system", description="Human-readable name for the target system.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) receiver: fhirtypes.ReferenceType | None = Field( default=None, alias="receiver", title='Intended "real-world" recipient for the data', description=( "Allows data conveyed by a message to be addressed to a particular " "person or department when routing to a specific application isn't " "sufficient." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) target: fhirtypes.ReferenceType | None = Field( default=None, alias="target", title="Particular delivery destination within the destination", description=( "Identifies the target end system in situations where the initial " "message transmission is to an intermediary system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MessageHeaderDestination`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "target", "endpoint", "receiver", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MessageHeaderDestination`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "name", "target", "endpoint", "receiver"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("endpoint", "endpoint__ext")] return required_fields class MessageHeaderResponse(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. If this is a reply to prior message. Information about the message that this message is a response to. Only present if this message is a response. """ __resource_type__ = "MessageHeaderResponse" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="ok | transient-error | fatal-error", description=( "Code that identifies the type of response to the message - whether it " "was successful or not, and whether it should be resent or not." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["ok", "transient-error", "fatal-error"], }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) details: fhirtypes.ReferenceType | None = Field( default=None, alias="details", title="Specific list of hints/warnings/errors", description="Full details of any issues found in the message.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["OperationOutcome"], }, ) identifier: fhirtypes.IdType | None = Field( default=None, alias="identifier", title="Id of original message", description=( "The MessageHeader.id of the message to which this message is a " "response." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) identifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_identifier", title="Extension field for ``identifier``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MessageHeaderResponse`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "identifier", "code", "details"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MessageHeaderResponse`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "identifier", "code", "details"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext"), ("identifier", "identifier__ext")] return required_fields class MessageHeaderSource(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Message source application. The source application from which this message originated. """ __resource_type__ = "MessageHeaderSource" contact: fhirtypes.ContactPointType | None = Field( default=None, alias="contact", title="Human contact for problems", description=( "An e-mail, phone, website or other contact point to use to resolve " "issues with message communications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endpoint: fhirtypes.UrlType | None = Field( default=None, alias="endpoint", title="Actual message source address or id", description="Identifies the routing target to send acknowledgements to.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) endpoint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_endpoint", title="Extension field for ``endpoint``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name of system", description="Human-readable name for the source system.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) software: fhirtypes.StringType | None = Field( default=None, alias="software", title="Name of software running the system", description="May include configuration or other information useful in debugging.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) software__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_software", title="Extension field for ``software``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Version of software running", description=( "Can convey versions of multiple systems in situations where a message " "passes through multiple hands." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MessageHeaderSource`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "software", "version", "contact", "endpoint", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MessageHeaderSource`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "name", "software", "version", "contact", "endpoint", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("endpoint", "endpoint__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/meta.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Meta Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Meta(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Metadata about a resource. The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource. """ __resource_type__ = "Meta" lastUpdated: fhirtypes.InstantType | None = Field( default=None, alias="lastUpdated", title="When the resource version last changed", description="When the resource last changed - e.g. when the version changed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastUpdated__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastUpdated", title="Extension field for ``lastUpdated``." ) profile: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="profile", title="Profiles this resource claims to conform to", description=( "A list of profiles (references to " "[StructureDefinition](structuredefinition.html#) resources) that this " "resource claims to conform to. The URL is a reference to " "[StructureDefinition.url](structuredefinition-" "definitions.html#StructureDefinition.url)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) profile__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) security: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="security", title="Security Labels applied to this resource", description=( "Security labels applied to this resource. These tags connect specific " "resources to the overall security policy and infrastructure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) source: fhirtypes.UriType | None = Field( default=None, alias="source", title="Identifies where the resource comes from", description=( "A uri that identifies the source system of the resource. This provides" " a minimal amount of [Provenance](provenance.html#) information that " "can be used to track or differentiate the source of information in the" " resource. The source may identify another FHIR server, document, " "message, database, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_source", title="Extension field for ``source``." ) tag: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="tag", title="Tags applied to this resource", description=( "Tags applied to this resource. Tags are intended to be used to " "identify and relate resources to process and workflow, and " "applications are not required to consider the tags when interpreting " "the meaning of a resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) versionId: fhirtypes.IdType | None = Field( default=None, alias="versionId", title="Version specific identifier", description=( "The version specific identifier, as it appears in the version portion " "of the URL. This value changes when the resource is created, updated, " "or deleted." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) versionId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionId", title="Extension field for ``versionId``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Meta`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "versionId", "lastUpdated", "source", "profile", "security", "tag", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Meta`` according to specification, with preserving the original sequence order. """ return ["versionId", "lastUpdated", "source", "profile", "security", "tag"] ================================================ FILE: fhir/resources/R4B/molecularsequence.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MolecularSequence Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MolecularSequence(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about a biological sequence. Raw data describing a biological sequence. """ __resource_type__ = "MolecularSequence" coordinateSystem: fhirtypes.IntegerType | None = Field( default=None, alias="coordinateSystem", title=( "Base number of coordinate system (0 for 0-based numbering or " "coordinates, inclusive start, exclusive end, 1 for 1-based numbering, " "inclusive start, inclusive end)" ), description=( "Whether the sequence is numbered starting at 0 (0-based numbering or " "coordinates, inclusive start, exclusive end) or starting at 1 (1-based" " numbering, inclusive start and inclusive end)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) coordinateSystem__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_coordinateSystem", title="Extension field for ``coordinateSystem``.", ) device: fhirtypes.ReferenceType | None = Field( default=None, alias="device", title="The method for sequencing", description="The method for sequencing, for example, chip information.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique ID for this particular sequence. This is a FHIR-defined id", description=( "A unique identifier for this particular sequence instance. This is a " "FHIR-defined id." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) observedSeq: fhirtypes.StringType | None = Field( default=None, alias="observedSeq", title="Sequence that was observed", description=( "Sequence that was observed. It is the result marked by referenceSeq " "along with variant records on referenceSeq. This shall start from " "referenceSeq.windowStart and end by referenceSeq.windowEnd." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) observedSeq__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_observedSeq", title="Extension field for ``observedSeq``." ) patient: fhirtypes.ReferenceType | None = Field( default=None, alias="patient", title="Who and/or what this is about", description="The patient whose sequencing results are described by this resource.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) performer: fhirtypes.ReferenceType | None = Field( default=None, alias="performer", title="Who should be responsible for test result", description="The organization or lab that should be responsible for this result.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) pointer: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="pointer", title="Pointer to next atomic sequence", description="Pointer to next atomic sequence which at most contains one variant.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MolecularSequence"], }, ) quality: typing.List[fhirtypes.MolecularSequenceQualityType] | None = Field( default=None, alias="quality", title="An set of value as quality of sequence", description=( "An experimental feature attribute that defines the quality of the " "feature in a quantitative way, such as a phred quality score ([SO:0001" "686](http://www.sequenceontology.org/browser/current_svn/term/SO:00016" "86))." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="The number of copies of the sequence of interest. (RNASeq)", description="The number of copies of the sequence of interest. (RNASeq).", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) readCoverage: fhirtypes.IntegerType | None = Field( default=None, alias="readCoverage", title=( "Average number of reads representing a given nucleotide in the " "reconstructed sequence" ), description=( "Coverage (read depth or depth) is the average number of reads " "representing a given nucleotide in the reconstructed sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) readCoverage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_readCoverage", title="Extension field for ``readCoverage``.", ) referenceSeq: fhirtypes.MolecularSequenceReferenceSeqType | None = Field( default=None, alias="referenceSeq", title="A sequence used as reference", description=( "A sequence that is used as a reference to describe variants that are " "present in a sequence analyzed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) repository: typing.List[fhirtypes.MolecularSequenceRepositoryType] | None = Field( default=None, alias="repository", title=( "External repository which contains detailed report related with " "observedSeq in this resource" ), description=( "Configurations of the external repository. The repository shall store " "target's observedSeq or records related with target's observedSeq." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) specimen: fhirtypes.ReferenceType | None = Field( default=None, alias="specimen", title="Specimen used for sequencing", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Specimen"], }, ) structureVariant: typing.List[ fhirtypes.MolecularSequenceStructureVariantType ] | None = Field( default=None, alias="structureVariant", title="Structural variant", description="Information about chromosome structure variation.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="aa | dna | rna", description="Amino Acid Sequence/ DNA Sequence / RNA Sequence.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["aa", "dna", "rna"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) variant: typing.List[fhirtypes.MolecularSequenceVariantType] | None = Field( default=None, alias="variant", title="Variant in sequence", description=( "The definition of variant here originates from Sequence ontology ([var" "iant_of](http://www.sequenceontology.org/browser/current_svn/term/vari" "ant_of)). This element can represent amino acid or nucleic sequence " "change(including insertion,deletion,SNP,etc.) It can represent some " "complex mutation or segment variation with the assist of CIGAR string." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MolecularSequence`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "type", "coordinateSystem", "patient", "specimen", "device", "performer", "quantity", "referenceSeq", "variant", "observedSeq", "quality", "readCoverage", "repository", "pointer", "structureVariant", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MolecularSequence`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "type", "coordinateSystem", "patient", "specimen", "device", "performer", "quantity", "referenceSeq", "variant", "observedSeq", "quality", "readCoverage", "repository", "pointer", "structureVariant", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("coordinateSystem", "coordinateSystem__ext")] return required_fields class MolecularSequenceQuality(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An set of value as quality of sequence. An experimental feature attribute that defines the quality of the feature in a quantitative way, such as a phred quality score ([SO:0001686](http://w ww.sequenceontology.org/browser/current_svn/term/SO:0001686)). """ __resource_type__ = "MolecularSequenceQuality" end: fhirtypes.IntegerType | None = Field( default=None, alias="end", title="End position of the sequence", description=( "End position of the sequence. If the coordinate system is 0-based then" " end is exclusive and does not include the last position. If the " "coordinate system is 1-base, then end is inclusive and includes the " "last position." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_end", title="Extension field for ``end``." ) fScore: fhirtypes.DecimalType | None = Field( default=None, alias="fScore", title="F-score", description=( "Harmonic mean of Recall and Precision, computed as: 2 * precision * " "recall / (precision + recall)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) fScore__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fScore", title="Extension field for ``fScore``." ) gtFP: fhirtypes.DecimalType | None = Field( default=None, alias="gtFP", title=( "False positives where the non-REF alleles in the Truth and Query Call " "Sets match" ), description=( "The number of false positives where the non-REF alleles in the Truth " "and Query Call Sets match (i.e. cases where the truth is 1/1 and the " "query is 0/1 or similar)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) gtFP__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_gtFP", title="Extension field for ``gtFP``." ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="Method to get quality", description="Which method is used to get sequence quality.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) precision: fhirtypes.DecimalType | None = Field( default=None, alias="precision", title="Precision of comparison", description="QUERY.TP / (QUERY.TP + QUERY.FP).", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) precision__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_precision", title="Extension field for ``precision``." ) queryFP: fhirtypes.DecimalType | None = Field( default=None, alias="queryFP", title="False positives", description=( "False positives, i.e. the number of sites in the Query Call Set for " "which there is no path through the Truth Call Set that is consistent " "with this site. Sites with correct variant but incorrect genotype are " "counted here." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) queryFP__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_queryFP", title="Extension field for ``queryFP``." ) queryTP: fhirtypes.DecimalType | None = Field( default=None, alias="queryTP", title="True positives from the perspective of the query data", description=( "True positives, from the perspective of the query data, i.e. the " "number of sites in the Query Call Set for which there are paths " "through the Truth Call Set that are consistent with all of the alleles" " at this site, and for which there is an accurate genotype call for " "the event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) queryTP__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_queryTP", title="Extension field for ``queryTP``." ) recall: fhirtypes.DecimalType | None = Field( default=None, alias="recall", title="Recall of comparison", description="TRUTH.TP / (TRUTH.TP + TRUTH.FN).", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) recall__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recall", title="Extension field for ``recall``." ) roc: fhirtypes.MolecularSequenceQualityRocType | None = Field( default=None, alias="roc", title="Receiver Operator Characteristic (ROC) Curve", description=( "Receiver Operator Characteristic (ROC) Curve to give " "sensitivity/specificity tradeoff." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) score: fhirtypes.QuantityType | None = Field( default=None, alias="score", title="Quality score for the comparison", description=( "The score of an experimentally derived feature such as a p-value ([SO:" "0001685](http://www.sequenceontology.org/browser/current_svn/term/SO:0" "001685))." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) standardSequence: fhirtypes.CodeableConceptType | None = Field( default=None, alias="standardSequence", title="Standard sequence for comparison", description="Gold standard sequence used for comparing against.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) start: fhirtypes.IntegerType | None = Field( default=None, alias="start", title="Start position of the sequence", description=( "Start position of the sequence. If the coordinate system is either " "0-based or 1-based, then start position is inclusive." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_start", title="Extension field for ``start``." ) truthFN: fhirtypes.DecimalType | None = Field( default=None, alias="truthFN", title="False negatives", description=( "False negatives, i.e. the number of sites in the Truth Call Set for " "which there is no path through the Query Call Set that is consistent " "with all of the alleles at this site, or sites for which there is an " "inaccurate genotype call for the event. Sites with correct variant but" " incorrect genotype are counted here." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) truthFN__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_truthFN", title="Extension field for ``truthFN``." ) truthTP: fhirtypes.DecimalType | None = Field( default=None, alias="truthTP", title="True positives from the perspective of the truth data", description=( "True positives, from the perspective of the truth data, i.e. the " "number of sites in the Truth Call Set for which there are paths " "through the Query Call Set that are consistent with all of the alleles" " at this site, and for which there is an accurate genotype call for " "the event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) truthTP__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_truthTP", title="Extension field for ``truthTP``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="indel | snp | unknown", description="INDEL / SNP / Undefined variant.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["indel", "snp", "unknown"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MolecularSequenceQuality`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "standardSequence", "start", "end", "score", "method", "truthTP", "queryTP", "truthFN", "queryFP", "gtFP", "precision", "recall", "fScore", "roc", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MolecularSequenceQuality`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "standardSequence", "start", "end", "score", "method", "truthTP", "queryTP", "truthFN", "queryFP", "gtFP", "precision", "recall", "fScore", "roc", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields class MolecularSequenceQualityRoc(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Receiver Operator Characteristic (ROC) Curve. Receiver Operator Characteristic (ROC) Curve to give sensitivity/specificity tradeoff. """ __resource_type__ = "MolecularSequenceQualityRoc" fMeasure: typing.List[fhirtypes.DecimalType | None] | None = Field( default=None, alias="fMeasure", title="FScore of the GQ score", description=( 'Calculated fScore if the GQ score threshold was set to "score" field ' "value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) fMeasure__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_fMeasure", title="Extension field for ``fMeasure``." ) numFN: typing.List[fhirtypes.IntegerType | None] | None = Field( default=None, alias="numFN", title="Roc score false negative numbers", description=( "The number of false negatives if the GQ score threshold was set to " '"score" field value.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) numFN__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_numFN", title="Extension field for ``numFN``." ) numFP: typing.List[fhirtypes.IntegerType | None] | None = Field( default=None, alias="numFP", title="Roc score false positive numbers", description=( "The number of false positives if the GQ score threshold was set to " '"score" field value.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) numFP__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_numFP", title="Extension field for ``numFP``." ) numTP: typing.List[fhirtypes.IntegerType | None] | None = Field( default=None, alias="numTP", title="Roc score true positive numbers", description=( "The number of true positives if the GQ score threshold was set to " '"score" field value.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) numTP__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_numTP", title="Extension field for ``numTP``." ) precision: typing.List[fhirtypes.DecimalType | None] | None = Field( default=None, alias="precision", title="Precision of the GQ score", description=( 'Calculated precision if the GQ score threshold was set to "score" ' "field value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) precision__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_precision", title="Extension field for ``precision``." ) score: typing.List[fhirtypes.IntegerType | None] | None = Field( default=None, alias="score", title="Genotype quality score", description=( "Invidual data point representing the GQ (genotype quality) score " "threshold." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) score__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_score", title="Extension field for ``score``." ) sensitivity: typing.List[fhirtypes.DecimalType | None] | None = Field( default=None, alias="sensitivity", title="Sensitivity of the GQ score", description=( 'Calculated sensitivity if the GQ score threshold was set to "score" ' "field value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sensitivity__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_sensitivity", title="Extension field for ``sensitivity``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MolecularSequenceQualityRoc`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "score", "numTP", "numFP", "numFN", "precision", "sensitivity", "fMeasure", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MolecularSequenceQualityRoc`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "score", "numTP", "numFP", "numFN", "precision", "sensitivity", "fMeasure", ] class MolecularSequenceReferenceSeq(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A sequence used as reference. A sequence that is used as a reference to describe variants that are present in a sequence analyzed. """ __resource_type__ = "MolecularSequenceReferenceSeq" chromosome: fhirtypes.CodeableConceptType | None = Field( default=None, alias="chromosome", title="Chromosome containing genetic finding", description=( "Structural unit composed of a nucleic acid molecule which controls its" " own replication through the interaction of specific proteins at one " "or more origins of replication ([SO:0000340](http://www.sequenceontolo" "gy.org/browser/current_svn/term/SO:0000340))." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) genomeBuild: fhirtypes.StringType | None = Field( default=None, alias="genomeBuild", title=( "The Genome Build used for reference, following GRCh build versions " "e.g. 'GRCh 37'" ), description=( "The Genome Build used for reference, following GRCh build versions " "e.g. 'GRCh 37'. Version number must be included if a versioned " "release of a primary build was used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) genomeBuild__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_genomeBuild", title="Extension field for ``genomeBuild``." ) orientation: fhirtypes.CodeType | None = Field( default=None, alias="orientation", title="sense | antisense", description=( "A relative reference to a DNA strand based on gene orientation. The " 'strand that contains the open reading frame of the gene is the "sense"' ' strand, and the opposite complementary strand is the "antisense" ' "strand." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["sense", "antisense"], }, ) orientation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_orientation", title="Extension field for ``orientation``." ) referenceSeqId: fhirtypes.CodeableConceptType | None = Field( default=None, alias="referenceSeqId", title="Reference identifier", description=( "Reference identifier of reference sequence submitted to NCBI. It must " "match the type in the MolecularSequence.type field. For example, the " "prefix, \u201cNG_\u201d identifies reference sequence for genes, \u201cNM_\u201d for " "messenger RNA transcripts, and \u201cNP_\u201d for amino acid sequences." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) referenceSeqPointer: fhirtypes.ReferenceType | None = Field( default=None, alias="referenceSeqPointer", title="A pointer to another MolecularSequence entity as reference sequence", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MolecularSequence"], }, ) referenceSeqString: fhirtypes.StringType | None = Field( default=None, alias="referenceSeqString", title="A string to represent reference sequence", description='A string like "ACGT".', json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) referenceSeqString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_referenceSeqString", title="Extension field for ``referenceSeqString``.", ) strand: fhirtypes.CodeType | None = Field( default=None, alias="strand", title="watson | crick", description=( "An absolute reference to a strand. The Watson strand is the strand " "whose 5'-end is on the short arm of the chromosome, and the Crick " "strand as the one whose 5'-end is on the long arm." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["watson", "crick"], }, ) strand__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_strand", title="Extension field for ``strand``." ) windowEnd: fhirtypes.IntegerType | None = Field( default=None, alias="windowEnd", title="End position of the window on the reference sequence", description=( "End position of the window on the reference sequence. If the " "coordinate system is 0-based then end is exclusive and does not " "include the last position. If the coordinate system is 1-base, then " "end is inclusive and includes the last position." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) windowEnd__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_windowEnd", title="Extension field for ``windowEnd``." ) windowStart: fhirtypes.IntegerType | None = Field( default=None, alias="windowStart", title="Start position of the window on the reference sequence", description=( "Start position of the window on the reference sequence. If the " "coordinate system is either 0-based or 1-based, then start position is" " inclusive." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) windowStart__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_windowStart", title="Extension field for ``windowStart``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MolecularSequenceReferenceSeq`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "chromosome", "genomeBuild", "orientation", "referenceSeqId", "referenceSeqPointer", "referenceSeqString", "strand", "windowStart", "windowEnd", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MolecularSequenceReferenceSeq`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "chromosome", "genomeBuild", "orientation", "referenceSeqId", "referenceSeqPointer", "referenceSeqString", "strand", "windowStart", "windowEnd", ] class MolecularSequenceRepository(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. External repository which contains detailed report related with observedSeq in this resource. Configurations of the external repository. The repository shall store target's observedSeq or records related with target's observedSeq. """ __resource_type__ = "MolecularSequenceRepository" datasetId: fhirtypes.StringType | None = Field( default=None, alias="datasetId", title="Id of the dataset that used to call for dataset in repository", description=( "Id of the variant in this external repository. The server will " "understand how to use this id to call for more info about datasets in " "external repository." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) datasetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_datasetId", title="Extension field for ``datasetId``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Repository's name", description=( "URI of an external repository which contains further details about the" " genetics data." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) readsetId: fhirtypes.StringType | None = Field( default=None, alias="readsetId", title="Id of the read", description="Id of the read in this external repository.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) readsetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_readsetId", title="Extension field for ``readsetId``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="directlink | openapi | login | oauth | other", description=( "Click and see / RESTful API / Need login to see / RESTful API with " "authentication / Other ways to see resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["directlink", "openapi", "login", "oauth", "other"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="URI of the repository", description=( "URI of an external repository which contains further details about the" " genetics data." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) variantsetId: fhirtypes.StringType | None = Field( default=None, alias="variantsetId", title="Id of the variantset that used to call for variantset in repository", description=( "Id of the variantset in this external repository. The server will " "understand how to use this id to call for more info about variantsets " "in external repository." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) variantsetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_variantsetId", title="Extension field for ``variantsetId``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MolecularSequenceRepository`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "url", "name", "datasetId", "variantsetId", "readsetId", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MolecularSequenceRepository`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "url", "name", "datasetId", "variantsetId", "readsetId", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields class MolecularSequenceStructureVariant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Structural variant. Information about chromosome structure variation. """ __resource_type__ = "MolecularSequenceStructureVariant" exact: bool | None = Field( default=None, alias="exact", title="Does the structural variant have base pair resolution breakpoints?", description=( "Used to indicate if the outer and inner start-end values have the same" " meaning." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) exact__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_exact", title="Extension field for ``exact``." ) inner: fhirtypes.MolecularSequenceStructureVariantInnerType | None = Field( default=None, alias="inner", title="Structural variant inner", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) length: fhirtypes.IntegerType | None = Field( default=None, alias="length", title="Structural variant length", description="Length of the variant chromosome.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) length__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_length", title="Extension field for ``length``." ) outer: fhirtypes.MolecularSequenceStructureVariantOuterType | None = Field( default=None, alias="outer", title="Structural variant outer", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) variantType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="variantType", title="Structural variant change type", description="Information about chromosome structure variation DNA change type.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MolecularSequenceStructureVariant`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "variantType", "exact", "length", "outer", "inner", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MolecularSequenceStructureVariant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "variantType", "exact", "length", "outer", "inner"] class MolecularSequenceStructureVariantInner(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Structural variant inner. """ __resource_type__ = "MolecularSequenceStructureVariantInner" end: fhirtypes.IntegerType | None = Field( default=None, alias="end", title="Structural variant inner end", description=( "Structural variant inner end. If the coordinate system is 0-based then" " end is exclusive and does not include the last position. If the " "coordinate system is 1-base, then end is inclusive and includes the " "last position." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_end", title="Extension field for ``end``." ) start: fhirtypes.IntegerType | None = Field( default=None, alias="start", title="Structural variant inner start", description=( "Structural variant inner start. If the coordinate system is either " "0-based or 1-based, then start position is inclusive." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_start", title="Extension field for ``start``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MolecularSequenceStructureVariantInner`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "start", "end"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MolecularSequenceStructureVariantInner`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "start", "end"] class MolecularSequenceStructureVariantOuter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Structural variant outer. """ __resource_type__ = "MolecularSequenceStructureVariantOuter" end: fhirtypes.IntegerType | None = Field( default=None, alias="end", title="Structural variant outer end", description=( "Structural variant outer end. If the coordinate system is 0-based then" " end is exclusive and does not include the last position. If the " "coordinate system is 1-base, then end is inclusive and includes the " "last position." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_end", title="Extension field for ``end``." ) start: fhirtypes.IntegerType | None = Field( default=None, alias="start", title="Structural variant outer start", description=( "Structural variant outer start. If the coordinate system is either " "0-based or 1-based, then start position is inclusive." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_start", title="Extension field for ``start``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MolecularSequenceStructureVariantOuter`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "start", "end"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MolecularSequenceStructureVariantOuter`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "start", "end"] class MolecularSequenceVariant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Variant in sequence. The definition of variant here originates from Sequence ontology ([variant_ of](http://www.sequenceontology.org/browser/current_svn/term/variant_of)). This element can represent amino acid or nucleic sequence change(including insertion,deletion,SNP,etc.) It can represent some complex mutation or segment variation with the assist of CIGAR string. """ __resource_type__ = "MolecularSequenceVariant" cigar: fhirtypes.StringType | None = Field( default=None, alias="cigar", title="Extended CIGAR string for aligning the sequence with reference bases", description=( "Extended CIGAR string for aligning the sequence with reference bases. " "See detailed documentation [here](http://support.illumina.com/help/Seq" "uencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/" "CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) cigar__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_cigar", title="Extension field for ``cigar``." ) end: fhirtypes.IntegerType | None = Field( default=None, alias="end", title="End position of the variant on the reference sequence", description=( "End position of the variant on the reference sequence. If the " "coordinate system is 0-based then end is exclusive and does not " "include the last position. If the coordinate system is 1-base, then " "end is inclusive and includes the last position." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_end", title="Extension field for ``end``." ) observedAllele: fhirtypes.StringType | None = Field( default=None, alias="observedAllele", title="Allele that was observed", description=( "An allele is one of a set of coexisting sequence variants of a gene ([" "SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/S" "O:0001023)). Nucleotide(s)/amino acids from start position of " "sequence to stop position of sequence on the positive (+) strand of " "the observed sequence. When the sequence type is DNA, it should be " "the sequence on the positive (+) strand. This will lay in the range " "between variant.start and variant.end." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) observedAllele__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_observedAllele", title="Extension field for ``observedAllele``.", ) referenceAllele: fhirtypes.StringType | None = Field( default=None, alias="referenceAllele", title="Allele in the reference sequence", description=( "An allele is one of a set of coexisting sequence variants of a gene ([" "SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/S" "O:0001023)). Nucleotide(s)/amino acids from start position of sequence" " to stop position of sequence on the positive (+) strand of the " "reference sequence. When the sequence type is DNA, it should be the " "sequence on the positive (+) strand. This will lay in the range " "between variant.start and variant.end." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) referenceAllele__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_referenceAllele", title="Extension field for ``referenceAllele``.", ) start: fhirtypes.IntegerType | None = Field( default=None, alias="start", title="Start position of the variant on the reference sequence", description=( "Start position of the variant on the reference sequence. If the " "coordinate system is either 0-based or 1-based, then start position is" " inclusive." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_start", title="Extension field for ``start``." ) variantPointer: fhirtypes.ReferenceType | None = Field( default=None, alias="variantPointer", title="Pointer to observed variant information", description="A pointer to an Observation containing variant information.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Observation"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MolecularSequenceVariant`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "start", "end", "observedAllele", "referenceAllele", "cigar", "variantPointer", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MolecularSequenceVariant`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "start", "end", "observedAllele", "referenceAllele", "cigar", "variantPointer", ] ================================================ FILE: fhir/resources/R4B/money.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Money Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Money(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An amount of economic utility in some recognized currency. """ __resource_type__ = "Money" currency: fhirtypes.CodeType | None = Field( default=None, alias="currency", title="ISO 4217 Currency Code", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) currency__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_currency", title="Extension field for ``currency``." ) value: fhirtypes.DecimalType | None = Field( default=None, alias="value", title="Numerical value (with implicit precision)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Money`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "value", "currency"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Money`` according to specification, with preserving the original sequence order. """ return ["value", "currency"] ================================================ FILE: fhir/resources/R4B/namingsystem.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/NamingSystem Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class NamingSystem(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. System of unique identification. A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. """ __resource_type__ = "NamingSystem" contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the naming system was published. " "The date must change when the business version changes and it must " "change if the status code changes. In addition, it should change when " "the substantive content of the naming system changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the naming system", description=( "A free text natural language description of the naming system from a " "consumer's perspective. Details about what the namespace identifies " "including scope, granularity, version labeling, etc." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for naming system (if applicable)", description=( "A legal or geographic region in which the naming system is intended to" " be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title="codesystem | identifier | root", description=( "Indicates the purpose for the naming system - what kinds of things " "does it make unique?" ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["codesystem", "identifier", "root"], }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this naming system (computer friendly)", description=( "A natural language name identifying the naming system. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the naming " "system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) responsible: fhirtypes.StringType | None = Field( default=None, alias="responsible", title="Who maintains system namespace?", description=( "The name of the organization that is responsible for issuing " "identifiers or codes for this namespace and ensuring their non-" "collision." ), json_schema_extra={ "element_property": True, }, ) responsible__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_responsible", title="Extension field for ``responsible``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this naming system. Enables tracking the life-cycle of " "the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="e.g. driver, provider, patient, bank etc.", description=( "Categorizes a naming system for easier search by grouping related " "naming systems." ), json_schema_extra={ "element_property": True, }, ) uniqueId: typing.List[fhirtypes.NamingSystemUniqueIdType] = Field( default=..., alias="uniqueId", title="Unique identifiers used for system", description=( "Indicates how the system may be identified when referenced in " "electronic exchange." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) usage: fhirtypes.StringType | None = Field( default=None, alias="usage", title="How/where is it used", description=( "Provides guidance on the use of the namespace, including the handling " "of formatting characters, use of upper vs. lower case, etc." ), json_schema_extra={ "element_property": True, }, ) usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usage", title="Extension field for ``usage``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate naming system instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NamingSystem`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "name", "status", "kind", "date", "publisher", "contact", "responsible", "type", "description", "useContext", "jurisdiction", "usage", "uniqueId", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NamingSystem`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "name", "status", "kind", "date", "publisher", "contact", "useContext", "jurisdiction", "uniqueId", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("date", "date__ext"), ("kind", "kind__ext"), ("name", "name__ext"), ("status", "status__ext"), ] return required_fields class NamingSystemUniqueId(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Unique identifiers used for system. Indicates how the system may be identified when referenced in electronic exchange. """ __resource_type__ = "NamingSystemUniqueId" comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Notes about identifier usage", description="Notes about the past or intended usage of this identifier.", json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="When is identifier valid?", description=( "Identifies the period of time over which this identifier is considered" " appropriate to refer to the naming system. Outside of this window, " "the identifier might be non-deterministic." ), json_schema_extra={ "element_property": True, }, ) preferred: bool | None = Field( default=None, alias="preferred", title="Is this the id that should be used for this type", description=( 'Indicates whether this identifier is the "preferred" identifier of ' "this type." ), json_schema_extra={ "element_property": True, }, ) preferred__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preferred", title="Extension field for ``preferred``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="oid | uuid | uri | other", description=( "Identifies the unique identifier scheme used for this particular " "identifier." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["oid", "uuid", "uri", "other"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The unique identifier", description=( "The string that should be sent over the wire to identify the code " "system or identifier system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NamingSystemUniqueId`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "value", "preferred", "comment", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NamingSystemUniqueId`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "value"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext"), ("value", "value__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/narrative.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Narrative Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Narrative(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Human-readable summary of the resource (essential clinical and business information). A human-readable summary of the resource conveying the essential clinical and business information for the resource. """ __resource_type__ = "Narrative" div: fhirtypes.XhtmlType | None = Field( default=None, alias="div", title="Limited xhtml content", description="The actual narrative content, a stripped down version of XHTML.", json_schema_extra={ "element_property": True, "element_required": True, }, ) div__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_div", title="Extension field for ``div``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="generated | extensions | additional | empty", description=( "The status of the narrative - whether it's entirely generated (from " "just the defined data or the extensions too), or whether a human " "authored it and it may contain additional data." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["generated", "extensions", "additional", "empty"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Narrative`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "status", "div"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Narrative`` according to specification, with preserving the original sequence order. """ return [] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("div", "div__ext"), ("status", "status__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/nutritionorder.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/NutritionOrder Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class NutritionOrder(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Diet, formula or nutritional supplement request. A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. """ __resource_type__ = "NutritionOrder" allergyIntolerance: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="allergyIntolerance", title=( "List of the patient's food and nutrition-related allergies and " "intolerances" ), description=( "A link to a record of allergies or intolerances which should be " "included in the nutrition order." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["AllergyIntolerance"], }, ) dateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="dateTime", title="Date and time the nutrition order was requested", description="The date and time that this nutrition order was requested.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) dateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dateTime", title="Extension field for ``dateTime``." ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="The encounter associated with this nutrition order", description=( "An encounter that provides additional information about the healthcare" " context in which this request is made." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) enteralFormula: fhirtypes.NutritionOrderEnteralFormulaType | None = Field( default=None, alias="enteralFormula", title="Enteral formula components", description=( "Feeding provided through the gastrointestinal tract via a tube, " "catheter, or stoma that delivers nutrition distal to the oral cavity." ), json_schema_extra={ "element_property": True, }, ) excludeFoodModifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="excludeFoodModifier", title=( "Order-specific modifier about the type of food that should not be " "given" ), description=( "This modifier is used to convey Order-specific modifier about the type" " of oral food or oral fluids that should not be given. These can be " "derived from patient allergies, intolerances, or preferences such as " "No Red Meat, No Soy or No Wheat or Gluten-Free. While it should not " "be necessary to repeat allergy or intolerance information captured in " "the referenced AllergyIntolerance resource in the excludeFoodModifier," " this element may be used to convey additional specificity related to " "foods that should be eliminated from the patient\u2019s diet for any " "reason. This modifier applies to the entire nutrition order inclusive" " of the oral diet, nutritional supplements and enteral formula " "feedings." ), json_schema_extra={ "element_property": True, }, ) foodPreferenceModifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="foodPreferenceModifier", title="Order-specific modifier about the type of food that should be given", description=( "This modifier is used to convey order-specific modifiers about the " "type of food that should be given. These can be derived from patient " "allergies, intolerances, or preferences such as Halal, Vegan or " "Kosher. This modifier applies to the entire nutrition order inclusive " "of the oral diet, nutritional supplements and enteral formula " "feedings." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifiers assigned to this order", description=( "Identifiers assigned to this order by the order sender or by the order" " receiver." ), json_schema_extra={ "element_property": True, }, ) instantiates: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="instantiates", title="Instantiates protocol or definition", description=( "The URL pointing to a protocol, guideline, orderset or other " "definition that is adhered to in whole or in part by this " "NutritionOrder." ), json_schema_extra={ "element_property": True, }, ) instantiates__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiates", title="Extension field for ``instantiates``.", ) instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="instantiatesCanonical", title="Instantiates FHIR protocol or definition", description=( "The URL pointing to a FHIR-defined protocol, guideline, orderset or " "other definition that is adhered to in whole or in part by this " "NutritionOrder." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ActivityDefinition", "PlanDefinition"], }, ) instantiatesCanonical__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="instantiatesUri", title="Instantiates external protocol or definition", description=( "The URL pointing to an externally maintained protocol, guideline, " "orderset or other definition that is adhered to in whole or in part by" " this NutritionOrder." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) intent: fhirtypes.CodeType | None = Field( default=None, alias="intent", title=( "proposal | plan | directive | order | original-order | reflex-order | " "filler-order | instance-order | option" ), description=( "Indicates the level of authority/intentionality associated with the " "NutrionOrder and where the request fits into the workflow chain." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "proposal", "plan", "directive", "order", "original-order", "reflex-order", "filler-order", "instance-order", "option", ], }, ) intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intent", title="Extension field for ``intent``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments", description=( "Comments made about the {{title}} by the requester, performer, subject" " or other participants." ), json_schema_extra={ "element_property": True, }, ) oralDiet: fhirtypes.NutritionOrderOralDietType | None = Field( default=None, alias="oralDiet", title="Oral diet components", description="Diet given orally in contrast to enteral (tube) feeding.", json_schema_extra={ "element_property": True, }, ) orderer: fhirtypes.ReferenceType | None = Field( default=None, alias="orderer", title="Who ordered the diet, formula or nutritional supplement", description=( "The practitioner that holds legal responsibility for ordering the " "diet, nutritional supplement, or formula feedings." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="The person who requires the diet, formula or nutritional supplement", description=( "The person (patient) who needs the nutrition order for an oral diet, " "nutritional supplement and/or enteral or formula feeding." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "draft | active | on-hold | revoked | completed | entered-in-error | " "unknown" ), description="The workflow status of the nutrition order/request.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "draft", "active", "on-hold", "revoked", "completed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) supplement: typing.List[fhirtypes.NutritionOrderSupplementType] | None = Field( default=None, alias="supplement", title="Supplement components", description=( "Oral nutritional products given in order to add further nutritional " "value to the patient's diet." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrder`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "instantiates", "status", "intent", "patient", "encounter", "dateTime", "orderer", "allergyIntolerance", "foodPreferenceModifier", "excludeFoodModifier", "oralDiet", "supplement", "enteralFormula", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrder`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "instantiatesCanonical", "instantiatesUri", "status", "intent", "patient", "dateTime", "orderer", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("dateTime", "dateTime__ext"), ("intent", "intent__ext"), ("status", "status__ext"), ] return required_fields class NutritionOrderEnteralFormula(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Enteral formula components. Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity. """ __resource_type__ = "NutritionOrderEnteralFormula" additiveProductName: fhirtypes.StringType | None = Field( default=None, alias="additiveProductName", title="Product or brand name of the modular additive", description=( "The product or brand name of the type of modular component to be added" " to the formula." ), json_schema_extra={ "element_property": True, }, ) additiveProductName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_additiveProductName", title="Extension field for ``additiveProductName``.", ) additiveType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="additiveType", title="Type of modular component to add to the feeding", description=( "Indicates the type of modular component such as protein, carbohydrate," " fat or fiber to be provided in addition to or mixed with the base " "formula." ), json_schema_extra={ "element_property": True, }, ) administration: typing.List[ fhirtypes.NutritionOrderEnteralFormulaAdministrationType ] | None = Field( default=None, alias="administration", title="Formula feeding instruction as structured data", description=( "Formula administration instructions as structured data. This " "repeating structure allows for changing the administration rate or " "volume over time for both bolus and continuous feeding. An example of" " this would be an instruction to increase the rate of continuous " "feeding every 2 hours." ), json_schema_extra={ "element_property": True, }, ) administrationInstruction: fhirtypes.StringType | None = Field( default=None, alias="administrationInstruction", title="Formula feeding instructions expressed as text", description=( "Free text formula administration, feeding instructions or additional " "instructions or information." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) administrationInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_administrationInstruction", title="Extension field for ``administrationInstruction``.", ) baseFormulaProductName: fhirtypes.StringType | None = Field( default=None, alias="baseFormulaProductName", title="Product or brand name of the enteral or infant formula", description=( "The product or brand name of the enteral or infant formula product " 'such as "ACME Adult Standard Formula".' ), json_schema_extra={ "element_property": True, }, ) baseFormulaProductName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_baseFormulaProductName", title="Extension field for ``baseFormulaProductName``.", ) baseFormulaType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="baseFormulaType", title="Type of enteral or infant formula", description=( "The type of enteral or infant formula such as an adult standard " "formula with fiber or a soy-based infant formula." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) caloricDensity: fhirtypes.QuantityType | None = Field( default=None, alias="caloricDensity", title="Amount of energy per specified volume that is required", description=( "The amount of energy (calories) that the formula should provide per " "specified volume, typically per mL or fluid oz. For example, an " "infant may require a formula that provides 24 calories per fluid ounce" " or an adult may require an enteral formula that provides 1.5 " "calorie/mL." ), json_schema_extra={ "element_property": True, }, ) maxVolumeToDeliver: fhirtypes.QuantityType | None = Field( default=None, alias="maxVolumeToDeliver", title="Upper limit on formula volume per unit of time", description=( "The maximum total quantity of formula that may be administered to a " "subject over the period of time, e.g. 1440 mL over 24 hours." ), json_schema_extra={ "element_property": True, }, ) routeofAdministration: fhirtypes.CodeableConceptType | None = Field( default=None, alias="routeofAdministration", title="How the formula should enter the patient's gastrointestinal tract", description=( "The route or physiological path of administration into the patient's " "gastrointestinal tract for purposes of providing the formula feeding," " e.g. nasogastric tube." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrderEnteralFormula`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "baseFormulaType", "baseFormulaProductName", "additiveType", "additiveProductName", "caloricDensity", "routeofAdministration", "administration", "maxVolumeToDeliver", "administrationInstruction", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrderEnteralFormula`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "baseFormulaType", "administrationInstruction"] class NutritionOrderEnteralFormulaAdministration(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Formula feeding instruction as structured data. Formula administration instructions as structured data. This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding. An example of this would be an instruction to increase the rate of continuous feeding every 2 hours. """ __resource_type__ = "NutritionOrderEnteralFormulaAdministration" quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="The volume of formula to provide", description=( "The volume of formula to provide to the patient per the specified " "administration schedule." ), json_schema_extra={ "element_property": True, }, ) rateQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="rateQuantity", title="Speed with which the formula is provided per period of time", description=( "The rate of administration of formula via a feeding pump, e.g. 60 mL " "per hour, according to the specified schedule." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e rate[x] "one_of_many": "rate", "one_of_many_required": False, }, ) rateRatio: fhirtypes.RatioType | None = Field( default=None, alias="rateRatio", title="Speed with which the formula is provided per period of time", description=( "The rate of administration of formula via a feeding pump, e.g. 60 mL " "per hour, according to the specified schedule." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e rate[x] "one_of_many": "rate", "one_of_many_required": False, }, ) schedule: fhirtypes.TimingType | None = Field( default=None, alias="schedule", title="Scheduled frequency of enteral feeding", description=( "The time period and frequency at which the enteral formula should be " "delivered to the patient." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrderEnteralFormulaAdministration`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "schedule", "quantity", "rateQuantity", "rateRatio", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrderEnteralFormulaAdministration`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"rate": ["rateQuantity", "rateRatio"]} return one_of_many_fields class NutritionOrderOralDiet(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Oral diet components. Diet given orally in contrast to enteral (tube) feeding. """ __resource_type__ = "NutritionOrderOralDiet" fluidConsistencyType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="fluidConsistencyType", title="The required consistency of fluids and liquids provided to the patient", description=( "The required consistency (e.g. honey-thick, nectar-thick, thin, " "thickened.) of liquids or fluids served to the patient." ), json_schema_extra={ "element_property": True, }, ) instruction: fhirtypes.StringType | None = Field( default=None, alias="instruction", title="Instructions or additional information about the oral diet", description=( "Free text or additional instructions or information pertaining to the " "oral diet." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instruction", title="Extension field for ``instruction``." ) nutrient: typing.List[fhirtypes.NutritionOrderOralDietNutrientType] | None = Field( default=None, alias="nutrient", title="Required nutrient modifications", description=( "Class that defines the quantity and type of nutrient modifications " "(for example carbohydrate, fiber or sodium) required for the oral " "diet." ), json_schema_extra={ "element_property": True, }, ) schedule: typing.List[fhirtypes.TimingType] | None = Field( default=None, alias="schedule", title="Scheduled frequency of diet", description=( "The time period and frequency at which the diet should be given. The " "diet should be given for the combination of all schedules if more than" " one schedule is present." ), json_schema_extra={ "element_property": True, }, ) texture: typing.List[fhirtypes.NutritionOrderOralDietTextureType] | None = Field( default=None, alias="texture", title="Required texture modifications", description=( "Class that describes any texture modifications required for the " "patient to safely consume various types of solid foods." ), json_schema_extra={ "element_property": True, }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title=( "Type of oral diet or diet restrictions that describe what can be " "consumed orally" ), description=( "The kind of diet or dietary restriction such as fiber restricted diet " "or diabetic diet." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrderOralDiet`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "schedule", "nutrient", "texture", "fluidConsistencyType", "instruction", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrderOralDiet`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "instruction"] class NutritionOrderOralDietNutrient(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Required nutrient modifications. Class that defines the quantity and type of nutrient modifications (for example carbohydrate, fiber or sodium) required for the oral diet. """ __resource_type__ = "NutritionOrderOralDietNutrient" amount: fhirtypes.QuantityType | None = Field( default=None, alias="amount", title="Quantity of the specified nutrient", description="The quantity of the specified nutrient to include in diet.", json_schema_extra={ "element_property": True, }, ) modifier: fhirtypes.CodeableConceptType | None = Field( default=None, alias="modifier", title="Type of nutrient that is being modified", description="The nutrient that is being modified such as carbohydrate or sodium.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrderOralDietNutrient`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "modifier", "amount"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrderOralDietNutrient`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class NutritionOrderOralDietTexture(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Required texture modifications. Class that describes any texture modifications required for the patient to safely consume various types of solid foods. """ __resource_type__ = "NutritionOrderOralDietTexture" foodType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="foodType", title=( "Concepts that are used to identify an entity that is ingested for " "nutritional purposes" ), description=( "The food type(s) (e.g. meats, all foods) that the texture " "modification applies to. This could be all foods types." ), json_schema_extra={ "element_property": True, }, ) modifier: fhirtypes.CodeableConceptType | None = Field( default=None, alias="modifier", title="Code to indicate how to alter the texture of the foods, e.g. pureed", description=( "Any texture modifications (for solid foods) that should be made, e.g. " "easy to chew, chopped, ground, and pureed." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrderOralDietTexture`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "modifier", "foodType"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrderOralDietTexture`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class NutritionOrderSupplement(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Supplement components. Oral nutritional products given in order to add further nutritional value to the patient's diet. """ __resource_type__ = "NutritionOrderSupplement" instruction: fhirtypes.StringType | None = Field( default=None, alias="instruction", title="Instructions or additional information about the oral supplement", description=( "Free text or additional instructions or information pertaining to the " "oral supplement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instruction", title="Extension field for ``instruction``." ) productName: fhirtypes.StringType | None = Field( default=None, alias="productName", title="Product or brand name of the nutritional supplement", description=( 'The product or brand name of the nutritional supplement such as "Acme ' 'Protein Shake".' ), json_schema_extra={ "element_property": True, }, ) productName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_productName", title="Extension field for ``productName``." ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Amount of the nutritional supplement", description="The amount of the nutritional supplement to be given.", json_schema_extra={ "element_property": True, }, ) schedule: typing.List[fhirtypes.TimingType] | None = Field( default=None, alias="schedule", title="Scheduled frequency of supplement", description=( "The time period and frequency at which the supplement(s) should be " "given. The supplement should be given for the combination of all " "schedules if more than one schedule is present." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Type of supplement product requested", description=( "The kind of nutritional supplement product required such as a high " "protein or pediatric clear liquid supplement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrderSupplement`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "productName", "schedule", "quantity", "instruction", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrderSupplement`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "instruction"] ================================================ FILE: fhir/resources/R4B/nutritionproduct.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/NutritionProduct Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class NutritionProduct(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A product used for nutritional purposes. A food or fluid product that is consumed by patients. """ __resource_type__ = "NutritionProduct" category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title=( "A category or class of the nutrition product (halal, kosher, gluten " "free, vegan, etc)" ), description=( "Nutrition products can have different classifications - according to " "its nutritional properties, preparation methods, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="A code designating a specific type of nutritional product", description=( "The code assigned to the product, for example a manufacturer number or" " other terminology." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ingredient: typing.List[fhirtypes.NutritionProductIngredientType] | None = Field( default=None, alias="ingredient", title="Ingredients contained in this product", description=None, json_schema_extra={ "element_property": True, }, ) instance: fhirtypes.NutritionProductInstanceType | None = Field( default=None, alias="instance", title=( "One or several physical instances or occurrences of the nutrition " "product" ), description=( "Conveys instance-level information about this product item. One or " "several physical, countable instances or occurrences of the product." ), json_schema_extra={ "element_property": True, }, ) knownAllergen: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="knownAllergen", title="Known or suspected allergens that are a part of this product", description=( "Allergens that are known or suspected to be a part of this nutrition " "product." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Substance"], }, ) manufacturer: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="manufacturer", title="Manufacturer, representative or officially responsible for the product", description=( "The organisation (manufacturer, representative or legal authorisation " "holder) that is responsible for the device." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the product", description=None, json_schema_extra={ "element_property": True, }, ) nutrient: typing.List[fhirtypes.NutritionProductNutrientType] | None = Field( default=None, alias="nutrient", title="The product's nutritional information expressed by the nutrients", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) productCharacteristic: typing.List[ fhirtypes.NutritionProductProductCharacteristicType ] | None = Field( default=None, alias="productCharacteristic", title="Specifies descriptive properties of the nutrition product", description=None, json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | inactive | entered-in-error", description="The current state of the product.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "inactive", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionProduct`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "status", "category", "code", "manufacturer", "nutrient", "ingredient", "knownAllergen", "productCharacteristic", "instance", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionProduct`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "status", "category", "code", "manufacturer", "nutrient", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class NutritionProductIngredient(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Ingredients contained in this product. """ __resource_type__ = "NutritionProductIngredient" amount: typing.List[fhirtypes.RatioType] | None = Field( default=None, alias="amount", title="The amount of ingredient that is in the product", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) item: fhirtypes.CodeableReferenceType = Field( default=..., alias="item", title="The ingredient contained in the product", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["NutritionProduct"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionProductIngredient`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "item", "amount"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionProductIngredient`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "item", "amount"] class NutritionProductInstance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. One or several physical instances or occurrences of the nutrition product. Conveys instance-level information about this product item. One or several physical, countable instances or occurrences of the product. """ __resource_type__ = "NutritionProductInstance" expiry: fhirtypes.DateTimeType | None = Field( default=None, alias="expiry", title="The expiry date or date and time for the product", description=( "The time after which the product is no longer expected to be in proper" " condition, or its use is not advised or not allowed." ), json_schema_extra={ "element_property": True, }, ) expiry__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expiry", title="Extension field for ``expiry``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="The identifier for the physical instance, typically a serial number", description=None, json_schema_extra={ "element_property": True, }, ) lotNumber: fhirtypes.StringType | None = Field( default=None, alias="lotNumber", title="The identification of the batch or lot of the product", description=None, json_schema_extra={ "element_property": True, }, ) lotNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lotNumber", title="Extension field for ``lotNumber``." ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="The amount of items or instances", description=( "The amount of items or instances that the resource considers, for " "instance when referring to 2 identical units together." ), json_schema_extra={ "element_property": True, }, ) useBy: fhirtypes.DateTimeType | None = Field( default=None, alias="useBy", title=( "The date until which the product is expected to be good for " "consumption" ), description=( "The time after which the product is no longer expected to be in proper" " condition, or its use is not advised or not allowed." ), json_schema_extra={ "element_property": True, }, ) useBy__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_useBy", title="Extension field for ``useBy``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionProductInstance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "quantity", "identifier", "lotNumber", "expiry", "useBy", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionProductInstance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class NutritionProductNutrient(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The product's nutritional information expressed by the nutrients. """ __resource_type__ = "NutritionProductNutrient" amount: typing.List[fhirtypes.RatioType] | None = Field( default=None, alias="amount", title=( "The amount of nutrient expressed in one or more units: X per pack / " "per serving / per dose" ), description=None, json_schema_extra={ "element_property": True, }, ) item: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="item", title="The (relevant) nutrients in the product", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Substance"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionProductNutrient`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "item", "amount"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionProductNutrient`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class NutritionProductProductCharacteristic(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specifies descriptive properties of the nutrition product. """ __resource_type__ = "NutritionProductProductCharacteristic" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Code specifying the type of characteristic", description=( "A code specifying which characteristic of the product is being " "described (for example, colour, shape)." ), json_schema_extra={ "element_property": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="The value of the characteristic", description="The actual characteristic value corresponding to the type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="valueBase64Binary", title="The value of the characteristic", description="The actual characteristic value corresponding to the type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBase64Binary", title="Extension field for ``valueBase64Binary``.", ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="The value of the characteristic", description="The actual characteristic value corresponding to the type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="The value of the characteristic", description="The actual characteristic value corresponding to the type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="The value of the characteristic", description="The actual characteristic value corresponding to the type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="The value of the characteristic", description="The actual characteristic value corresponding to the type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionProductProductCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueCodeableConcept", "valueString", "valueQuantity", "valueBase64Binary", "valueAttachment", "valueBoolean", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionProductProductCharacteristic`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueBase64Binary", "valueBoolean", "valueCodeableConcept", "valueQuantity", "valueString", ] } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/observation.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Observation Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Observation(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Measurements and simple assertions. Measurements and simple assertions made about a patient, device or other subject. """ __resource_type__ = "Observation" basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Fulfills plan, proposal or order", description=( "A plan, proposal or order that is fulfilled in whole or in part by " "this event. For example, a MedicationRequest may require a patient to" " have laboratory test performed before it is dispensed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CarePlan", "DeviceRequest", "ImmunizationRecommendation", "MedicationRequest", "NutritionOrder", "ServiceRequest", ], }, ) bodySite: fhirtypes.CodeableConceptType | None = Field( default=None, alias="bodySite", title="Observed body part", description=( "Indicates the site on the subject's body where the observation was " "made (i.e. the target site)." ), json_schema_extra={ "element_property": True, }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Classification of type of observation", description="A code that classifies the general type of observation being made.", json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Type of observation (code / type)", description=( "Describes what was observed. Sometimes this is called the observation " '"name".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) component: typing.List[fhirtypes.ObservationComponentType] | None = Field( default=None, alias="component", title="Component results", description=( "Some observations have multiple component observations. These " "component observations are expressed as separate code value pairs that" " share the same attributes. Examples include systolic and diastolic " "component observations for blood pressure measurement and multiple " "component observations for genetics observations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dataAbsentReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="dataAbsentReason", title="Why the result is missing", description=( "Provides a reason why the expected value in the element " "Observation.value[x] is missing." ), json_schema_extra={ "element_property": True, }, ) derivedFrom: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="derivedFrom", title="Related measurements the observation is made from", description=( "The target resource that represents a measurement from which this " "observation value is derived. For example, a calculated anion gap or a" " fetal measurement based on an ultrasound image." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "DocumentReference", "ImagingStudy", "Media", "QuestionnaireResponse", "Observation", "MolecularSequence", ], }, ) device: fhirtypes.ReferenceType | None = Field( default=None, alias="device", title="(Measurement) Device", description="The device used to generate the observation data.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device", "DeviceMetric"], }, ) effectiveDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="effectiveDateTime", title="Clinically relevant time/time-period for observation", description=( "The time or time-period the observed value is asserted as being true. " "For biological subjects - e.g. human patients - this is usually called" ' the "physiologically relevant time". This is usually either the time ' "of the procedure or of specimen collection, but very often the source " "of the date/time is not known, only the date/time itself." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_effectiveDateTime", title="Extension field for ``effectiveDateTime``.", ) effectiveInstant: fhirtypes.InstantType | None = Field( default=None, alias="effectiveInstant", title="Clinically relevant time/time-period for observation", description=( "The time or time-period the observed value is asserted as being true. " "For biological subjects - e.g. human patients - this is usually called" ' the "physiologically relevant time". This is usually either the time ' "of the procedure or of specimen collection, but very often the source " "of the date/time is not known, only the date/time itself." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) effectiveInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_effectiveInstant", title="Extension field for ``effectiveInstant``.", ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="Clinically relevant time/time-period for observation", description=( "The time or time-period the observed value is asserted as being true. " "For biological subjects - e.g. human patients - this is usually called" ' the "physiologically relevant time". This is usually either the time ' "of the procedure or of specimen collection, but very often the source " "of the date/time is not known, only the date/time itself." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) effectiveTiming: fhirtypes.TimingType | None = Field( default=None, alias="effectiveTiming", title="Clinically relevant time/time-period for observation", description=( "The time or time-period the observed value is asserted as being true. " "For biological subjects - e.g. human patients - this is usually called" ' the "physiologically relevant time". This is usually either the time ' "of the procedure or of specimen collection, but very often the source " "of the date/time is not known, only the date/time itself." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Healthcare event during which this observation is made", description=( "The healthcare event (e.g. a patient and healthcare provider " "interaction) during which this observation is made." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) focus: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="focus", title=( "What the observation is about, when it is not about the subject of " "record" ), description=( "The actual focus of an observation when it is not the patient of " "record representing something or someone associated with the patient " "such as a spouse, parent, fetus, or donor. For example, fetus " "observations in a mother's record. The focus of an observation could " "also be an existing condition, an intervention, the subject's diet, " "another observation of the subject, or a body structure such as tumor" " or implanted device. An example use case would be using the " "Observation resource to capture whether the mother is trained to " "change her child's tracheostomy tube. In this example, the child is " "the patient of record and the mother is the focus." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) hasMember: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="hasMember", title="Related resource that belongs to the Observation group", description=( "This observation is a group observation (e.g. a battery, a panel of " "tests, a set of vital sign measurements) that includes the target as a" " member of the group." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Observation", "QuestionnaireResponse", "MolecularSequence", ], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for observation", description="A unique identifier assigned to this observation.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) interpretation: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="interpretation", title="High, low, normal, etc.", description=( "A categorical assessment of an observation value. For example, high, " "low, normal." ), json_schema_extra={ "element_property": True, }, ) issued: fhirtypes.InstantType | None = Field( default=None, alias="issued", title="Date/Time this version was made available", description=( "The date and time this version of the observation was made available " "to providers, typically after the results have been reviewed and " "verified." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issued", title="Extension field for ``issued``." ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="How it was done", description="Indicates the mechanism used to perform the observation.", json_schema_extra={ "element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments about the observation", description="Comments about the observation or the results.", json_schema_extra={ "element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced event", description=( "A larger event of which this particular Observation is a component or " "step. For example, an observation as part of a procedure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "MedicationAdministration", "MedicationDispense", "MedicationStatement", "Procedure", "Immunization", "ImagingStudy", ], }, ) performer: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="performer", title="Who is responsible for the observation", description='Who was responsible for asserting the observed value as "true".', json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", "Patient", "RelatedPerson", ], }, ) referenceRange: typing.List[fhirtypes.ObservationReferenceRangeType] | None = Field( default=None, alias="referenceRange", title="Provides guide for interpretation", description=( "Guidance on how to interpret the value by comparison to a normal or " "recommended range. Multiple reference ranges are interpreted as an " '"OR". In other words, to represent two distinct target populations, ' "two `referenceRange` elements would be used." ), json_schema_extra={ "element_property": True, }, ) specimen: fhirtypes.ReferenceType | None = Field( default=None, alias="specimen", title="Specimen used for this observation", description="The specimen that was used when this observation was made.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Specimen"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="registered | preliminary | final | amended +", description="The status of the result value.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["registered", "preliminary", "final", "amended", "+"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Who and/or what the observation is about", description=( "The patient, or group of patients, location, or device this " "observation is about and into whose record the observation is placed. " "If the actual focus of the observation is different from the subject " "(or a sample of, part, or region of the subject), the `focus` element " "or the `code` itself specifies the actual focus of the observation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Group", "Device", "Location", "Organization", "Procedure", "Practitioner", "Medication", "Substance", ], }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="valueSampledData", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Observation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "partOf", "status", "category", "code", "subject", "focus", "encounter", "effectiveDateTime", "effectivePeriod", "effectiveTiming", "effectiveInstant", "issued", "performer", "valueQuantity", "valueCodeableConcept", "valueString", "valueBoolean", "valueInteger", "valueRange", "valueRatio", "valueSampledData", "valueTime", "valueDateTime", "valuePeriod", "dataAbsentReason", "interpretation", "note", "bodySite", "method", "specimen", "device", "referenceRange", "hasMember", "derivedFrom", "component", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Observation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "basedOn", "partOf", "status", "code", "subject", "focus", "encounter", "effectiveDateTime", "effectivePeriod", "effectiveTiming", "effectiveInstant", "issued", "performer", "valueQuantity", "valueCodeableConcept", "valueString", "valueBoolean", "valueInteger", "valueRange", "valueRatio", "valueSampledData", "valueTime", "valueDateTime", "valuePeriod", "hasMember", "derivedFrom", "component", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "effective": [ "effectiveDateTime", "effectiveInstant", "effectivePeriod", "effectiveTiming", ], "value": [ "valueBoolean", "valueCodeableConcept", "valueDateTime", "valueInteger", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueSampledData", "valueString", "valueTime", ], } return one_of_many_fields class ObservationComponent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Component results. Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same attributes. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations. """ __resource_type__ = "ObservationComponent" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Type of component observation (code / type)", description=( "Describes what was observed. Sometimes this is called the observation " '"code".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dataAbsentReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="dataAbsentReason", title="Why the component result is missing", description=( "Provides a reason why the expected value in the element " "Observation.component.value[x] is missing." ), json_schema_extra={ "element_property": True, }, ) interpretation: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="interpretation", title="High, low, normal, etc.", description=( "A categorical assessment of an observation value. For example, high, " "low, normal." ), json_schema_extra={ "element_property": True, }, ) referenceRange: typing.List[fhirtypes.ObservationReferenceRangeType] | None = Field( default=None, alias="referenceRange", title="Provides guide for interpretation of component result", description=( "Guidance on how to interpret the value by comparison to a normal or " "recommended range." ), json_schema_extra={ "element_property": True, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="valueSampledData", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ObservationComponent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "valueQuantity", "valueCodeableConcept", "valueString", "valueBoolean", "valueInteger", "valueRange", "valueRatio", "valueSampledData", "valueTime", "valueDateTime", "valuePeriod", "dataAbsentReason", "interpretation", "referenceRange", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ObservationComponent`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "code", "valueQuantity", "valueCodeableConcept", "valueString", "valueBoolean", "valueInteger", "valueRange", "valueRatio", "valueSampledData", "valueTime", "valueDateTime", "valuePeriod", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueCodeableConcept", "valueDateTime", "valueInteger", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueSampledData", "valueString", "valueTime", ] } return one_of_many_fields class ObservationReferenceRange(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Provides guide for interpretation. Guidance on how to interpret the value by comparison to a normal or recommended range. Multiple reference ranges are interpreted as an "OR". In other words, to represent two distinct target populations, two `referenceRange` elements would be used. """ __resource_type__ = "ObservationReferenceRange" age: fhirtypes.RangeType | None = Field( default=None, alias="age", title="Applicable age range, if relevant", description=( "The age at which this reference range is applicable. This is a " "neonatal age (e.g. number of weeks at term) if the meaning says so." ), json_schema_extra={ "element_property": True, }, ) appliesTo: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="appliesTo", title="Reference range population", description=( "Codes to indicate the target population this reference range applies " "to. For example, a reference range may be based on the normal " "population or a particular sex or race. Multiple `appliesTo` are " 'interpreted as an "AND" of the target populations. For example, to ' "represent a target population of African American females, both a code" " of female and a code for African American would be used." ), json_schema_extra={ "element_property": True, }, ) high: fhirtypes.QuantityType | None = Field( default=None, alias="high", title="High Range, if relevant", description=( "The value of the high bound of the reference range. The high bound of" " the reference range endpoint is inclusive of the value (e.g. " "reference range is >=5 - <=9). If the high bound is omitted, it is " "assumed to be meaningless (e.g. reference range is >= 2.3)." ), json_schema_extra={ "element_property": True, }, ) low: fhirtypes.QuantityType | None = Field( default=None, alias="low", title="Low Range, if relevant", description=( "The value of the low bound of the reference range. The low bound of " "the reference range endpoint is inclusive of the value (e.g. " "reference range is >=5 - <=9). If the low bound is omitted, it is " "assumed to be meaningless (e.g. reference range is <=2.3)." ), json_schema_extra={ "element_property": True, }, ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Text based reference range in an observation", description=( "Text based reference range in an observation which may be used when a " "quantitative range is not appropriate for an observation. An example " 'would be a reference value of "Negative" or a list or table of ' '"normals".' ), json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Reference range qualifier", description=( "Codes to indicate the what part of the targeted reference population " "it applies to. For example, the normal or therapeutic range." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ObservationReferenceRange`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "low", "high", "type", "appliesTo", "age", "text", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ObservationReferenceRange`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/observationdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ObservationDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ObservationDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of an observation. Set of definitional characteristics for a kind of observation or measurement produced or consumed by an orderable health care service. """ __resource_type__ = "ObservationDefinition" abnormalCodedValueSet: fhirtypes.ReferenceType | None = Field( default=None, alias="abnormalCodedValueSet", title=( "Value set of abnormal coded values for the observations conforming to " "this ObservationDefinition" ), description=( "The set of abnormal coded results for the observation conforming to " "this ObservationDefinition." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Category of observation", description="A code that classifies the general type of observation.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Type of observation (code / type)", description=( "Describes what will be observed. Sometimes this is called the " 'observation "name".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) criticalCodedValueSet: fhirtypes.ReferenceType | None = Field( default=None, alias="criticalCodedValueSet", title=( "Value set of critical coded values for the observations conforming to " "this ObservationDefinition" ), description=( "The set of critical coded results for the observation conforming to " "this ObservationDefinition." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier for this ObservationDefinition instance", description="A unique identifier assigned to this ObservationDefinition artifact.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="Method used to produce the observation", description="The method or technique used to perform the observation.", json_schema_extra={ "element_property": True, }, ) multipleResultsAllowed: bool | None = Field( default=None, alias="multipleResultsAllowed", title="Multiple results allowed", description=( "Multiple results allowed for observations conforming to this " "ObservationDefinition." ), json_schema_extra={ "element_property": True, }, ) multipleResultsAllowed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_multipleResultsAllowed", title="Extension field for ``multipleResultsAllowed``.", ) normalCodedValueSet: fhirtypes.ReferenceType | None = Field( default=None, alias="normalCodedValueSet", title=( "Value set of normal coded values for the observations conforming to " "this ObservationDefinition" ), description=( "The set of normal coded results for the observations conforming to " "this ObservationDefinition." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) permittedDataType: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="permittedDataType", title=( "Quantity | CodeableConcept | string | boolean | integer | Range | " "Ratio | SampledData | time | dateTime | Period" ), description=( "The data types allowed for the value element of the instance " "observations conforming to this ObservationDefinition." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "Quantity", "CodeableConcept", "string", "boolean", "integer", "Range", "Ratio", "SampledData", "time", "dateTime", "Period", ], }, ) permittedDataType__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_permittedDataType", title="Extension field for ``permittedDataType``.", ) preferredReportName: fhirtypes.StringType | None = Field( default=None, alias="preferredReportName", title="Preferred report name", description=( "The preferred name to be used when reporting the results of " "observations conforming to this ObservationDefinition." ), json_schema_extra={ "element_property": True, }, ) preferredReportName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preferredReportName", title="Extension field for ``preferredReportName``.", ) qualifiedInterval: typing.List[ fhirtypes.ObservationDefinitionQualifiedIntervalType ] | None = Field( default=None, alias="qualifiedInterval", title="Qualified range for continuous and ordinal observation results", description=( "Multiple ranges of results qualified by different contexts for " "ordinal or continuous observations conforming to this " "ObservationDefinition." ), json_schema_extra={ "element_property": True, }, ) quantitativeDetails: fhirtypes.ObservationDefinitionQuantitativeDetailsType | None = Field( default=None, alias="quantitativeDetails", title="Characteristics of quantitative results", description="Characteristics for quantitative results of this observation.", json_schema_extra={ "element_property": True, }, ) validCodedValueSet: fhirtypes.ReferenceType | None = Field( default=None, alias="validCodedValueSet", title=( "Value set of valid coded values for the observations conforming to " "this ObservationDefinition" ), description=( "The set of valid coded results for the observations conforming to " "this ObservationDefinition." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ObservationDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "category", "code", "identifier", "permittedDataType", "multipleResultsAllowed", "method", "preferredReportName", "quantitativeDetails", "qualifiedInterval", "validCodedValueSet", "normalCodedValueSet", "abnormalCodedValueSet", "criticalCodedValueSet", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ObservationDefinition`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "category", "code", "identifier"] class ObservationDefinitionQualifiedInterval(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Qualified range for continuous and ordinal observation results. Multiple ranges of results qualified by different contexts for ordinal or continuous observations conforming to this ObservationDefinition. """ __resource_type__ = "ObservationDefinitionQualifiedInterval" age: fhirtypes.RangeType | None = Field( default=None, alias="age", title="Applicable age range, if relevant", description=( "The age at which this reference range is applicable. This is a " "neonatal age (e.g. number of weeks at term) if the meaning says so." ), json_schema_extra={ "element_property": True, }, ) appliesTo: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="appliesTo", title="Targetted population of the range", description=( "Codes to indicate the target population this reference range applies " "to." ), json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeType | None = Field( default=None, alias="category", title="reference | critical | absolute", description=( "The category of interval of values for continuous or ordinal " "observations conforming to this ObservationDefinition." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["reference", "critical", "absolute"], }, ) category__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_category", title="Extension field for ``category``." ) condition: fhirtypes.StringType | None = Field( default=None, alias="condition", title="Condition associated with the reference range", description="Text based condition for which the reference range is valid.", json_schema_extra={ "element_property": True, }, ) condition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_condition", title="Extension field for ``condition``." ) context: fhirtypes.CodeableConceptType | None = Field( default=None, alias="context", title="Range context qualifier", description=( "Codes to indicate the health context the range applies to. For " "example, the normal or therapeutic range." ), json_schema_extra={ "element_property": True, }, ) gender: fhirtypes.CodeType | None = Field( default=None, alias="gender", title="male | female | other | unknown", description="Sex of the population the range applies to.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["male", "female", "other", "unknown"], }, ) gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_gender", title="Extension field for ``gender``." ) gestationalAge: fhirtypes.RangeType | None = Field( default=None, alias="gestationalAge", title="Applicable gestational age range, if relevant", description=( "The gestational age to which this reference range is applicable, in " "the context of pregnancy." ), json_schema_extra={ "element_property": True, }, ) range: fhirtypes.RangeType | None = Field( default=None, alias="range", title="The interval itself, for continuous or ordinal observations", description=( "The low and high values determining the interval. There may be only " "one of the two." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ObservationDefinitionQualifiedInterval`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "category", "range", "context", "appliesTo", "gender", "age", "gestationalAge", "condition", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ObservationDefinitionQualifiedInterval`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ObservationDefinitionQuantitativeDetails(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Characteristics of quantitative results. Characteristics for quantitative results of this observation. """ __resource_type__ = "ObservationDefinitionQuantitativeDetails" conversionFactor: fhirtypes.DecimalType | None = Field( default=None, alias="conversionFactor", title="SI to Customary unit conversion factor", description=( "Factor for converting value expressed with SI unit to value expressed " "with customary unit." ), json_schema_extra={ "element_property": True, }, ) conversionFactor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_conversionFactor", title="Extension field for ``conversionFactor``.", ) customaryUnit: fhirtypes.CodeableConceptType | None = Field( default=None, alias="customaryUnit", title="Customary unit for quantitative results", description=( "Customary unit used to report quantitative results of observations " "conforming to this ObservationDefinition." ), json_schema_extra={ "element_property": True, }, ) decimalPrecision: fhirtypes.IntegerType | None = Field( default=None, alias="decimalPrecision", title="Decimal precision of observation quantitative results", description=( "Number of digits after decimal separator when the results of such " "observations are of type Quantity." ), json_schema_extra={ "element_property": True, }, ) decimalPrecision__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_decimalPrecision", title="Extension field for ``decimalPrecision``.", ) unit: fhirtypes.CodeableConceptType | None = Field( default=None, alias="unit", title="SI unit for quantitative results", description=( "SI unit used to report quantitative results of observations conforming" " to this ObservationDefinition." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ObservationDefinitionQuantitativeDetails`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "customaryUnit", "unit", "conversionFactor", "decimalPrecision", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ObservationDefinitionQuantitativeDetails`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/operationdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/OperationDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class OperationDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of an operation or a named query. A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). """ __resource_type__ = "OperationDefinition" affectsState: bool | None = Field( default=None, alias="affectsState", title="Whether content is changed by the operation", description=( "Whether the operation affects state. Side effects such as producing " "audit trail entries do not count as 'affecting state'." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) affectsState__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_affectsState", title="Extension field for ``affectsState``.", ) base: fhirtypes.CanonicalType | None = Field( default=None, alias="base", title="Marks this as a profile of the base", description=( "Indicates that this operation definition is a constraining profile on " "the base." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["OperationDefinition"], }, ) base__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_base", title="Extension field for ``base``." ) code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Name used to invoke the operation", description="The name used to invoke the operation.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) comment: fhirtypes.MarkdownType | None = Field( default=None, alias="comment", title="Additional information about use", description="Additional information about how to use this operation or named query.", json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the operation definition was " "published. The date must change when the business version changes and " "it must change if the status code changes. In addition, it should " "change when the substantive content of the operation definition " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the operation definition", description=( "A free text natural language description of the operation definition " "from a consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this operation definition is authored" " for testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) inputProfile: fhirtypes.CanonicalType | None = Field( default=None, alias="inputProfile", title="Validation information for in parameters", description=( "Additional validation information for the in parameters - a single " "profile that covers all the parameters. The profile is a constraint on" " the parameters resource as a whole." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) inputProfile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_inputProfile", title="Extension field for ``inputProfile``.", ) instance: bool | None = Field( default=None, alias="instance", title="Invoke on an instance?", description=( "Indicates whether this operation can be invoked on a particular " "instance of one of the given types." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) instance__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instance", title="Extension field for ``instance``." ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for operation definition (if applicable)", description=( "A legal or geographic region in which the operation definition is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title="operation | query", description="Whether this is an operation or a named query.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["operation", "query"], }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this operation definition (computer friendly)", description=( "A natural language name identifying the operation definition. This " "name should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) outputProfile: fhirtypes.CanonicalType | None = Field( default=None, alias="outputProfile", title="Validation information for out parameters", description=( "Additional validation information for the out parameters - a single " "profile that covers all the parameters. The profile is a constraint on" " the parameters resource." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) outputProfile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_outputProfile", title="Extension field for ``outputProfile``.", ) overload: typing.List[fhirtypes.OperationDefinitionOverloadType] | None = Field( default=None, alias="overload", title="Define overloaded variants for when generating code", description=( "Defines an appropriate combination of parameters to use when invoking " "this operation, to help code generators when generating overloaded " "parameter sets for this operation." ), json_schema_extra={ "element_property": True, }, ) parameter: typing.List[fhirtypes.OperationDefinitionParameterType] | None = Field( default=None, alias="parameter", title="Parameters for the operation/query", description="The parameters for the operation/query.", json_schema_extra={ "element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the " "operation definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this operation definition is defined", description=( "Explanation of why this operation definition is needed and why it has " "been designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) resource: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="resource", title="Types this operation applies to", description="The types on which this operation can be executed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) resource__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_resource", title="Extension field for ``resource``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this operation definition. Enables tracking the life-" "cycle of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) system: bool | None = Field( default=None, alias="system", title="Invoke at the system level?", description=( "Indicates whether this operation or named query can be invoked at the " "system level (e.g. without needing to choose a resource type for the " "context)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this operation definition (human friendly)", description=( "A short, descriptive, user-friendly title for the operation " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) type: bool | None = Field( default=None, alias="type", title="Invoke at the type level?", description=( "Indicates whether this operation or named query can be invoked at the " "resource type level for any given resource type level (e.g. without " "needing to choose a specific resource id for the context)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this operation definition, represented as a " "URI (globally unique)" ), description=( "An absolute URI that is used to identify this operation definition " "when it is referenced in a specification, model, design or an " "instance; also called its canonical identifier. This SHOULD be " "globally unique and SHOULD be a literal address at which at which an " "authoritative instance of this operation definition is (or will be) " "published. This URL can be the target of a canonical reference. It " "SHALL remain the same when the operation definition is stored on " "different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate operation definition instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the operation definition", description=( "The identifier that is used to identify this version of the operation " "definition when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the operation " "definition author and is not expected to be globally unique. For " "example, it might be a timestamp (e.g. yyyymmdd) if a managed version " "is not available. There is also no expectation that versions can be " "placed in a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OperationDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "version", "name", "title", "status", "kind", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "affectsState", "code", "comment", "base", "resource", "system", "type", "instance", "inputProfile", "outputProfile", "parameter", "overload", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OperationDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "version", "name", "title", "status", "kind", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "affectsState", "code", "base", "resource", "system", "type", "instance", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("code", "code__ext"), ("instance", "instance__ext"), ("kind", "kind__ext"), ("name", "name__ext"), ("status", "status__ext"), ("system", "system__ext"), ("type", "type__ext"), ] return required_fields class OperationDefinitionOverload(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Define overloaded variants for when generating code. Defines an appropriate combination of parameters to use when invoking this operation, to help code generators when generating overloaded parameter sets for this operation. """ __resource_type__ = "OperationDefinitionOverload" comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Comments to go on overload", description=None, json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) parameterName: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="parameterName", title="Name of parameter to include in overload", description=None, json_schema_extra={ "element_property": True, }, ) parameterName__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_parameterName", title="Extension field for ``parameterName``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OperationDefinitionOverload`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "parameterName", "comment"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OperationDefinitionOverload`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class OperationDefinitionParameter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Parameters for the operation/query. The parameters for the operation/query. """ __resource_type__ = "OperationDefinitionParameter" binding: fhirtypes.OperationDefinitionParameterBindingType | None = Field( default=None, alias="binding", title="ValueSet details if this is coded", description=( "Binds to a value set if this parameter is coded (code, Coding, " "CodeableConcept)." ), json_schema_extra={ "element_property": True, }, ) documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Description of meaning/use", description="Describes the meaning or use of this parameter.", json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) max: fhirtypes.StringType | None = Field( default=None, alias="max", title="Maximum Cardinality (a number or *)", description=( "The maximum number of times this element is permitted to appear in the" " request or response." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_max", title="Extension field for ``max``." ) min: fhirtypes.IntegerType | None = Field( default=None, alias="min", title="Minimum Cardinality", description=( "The minimum number of times this parameter SHALL appear in the request" " or response." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_min", title="Extension field for ``min``." ) name: fhirtypes.CodeType | None = Field( default=None, alias="name", title="Name in Parameters.parameter.name or in URL", description="The name of used to identify the parameter.", json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) part: typing.List[fhirtypes.OperationDefinitionParameterType] | None = Field( default=None, alias="part", title="Parts of a nested Parameter", description="The parts of a nested Parameter.", json_schema_extra={ "element_property": True, }, ) referencedFrom: typing.List[ fhirtypes.OperationDefinitionParameterReferencedFromType ] | None = Field( default=None, alias="referencedFrom", title="References to this parameter", description=( "Identifies other resource parameters within the operation invocation " "that are expected to resolve to this resource." ), json_schema_extra={ "element_property": True, }, ) searchType: fhirtypes.CodeType | None = Field( default=None, alias="searchType", title=( "number | date | string | token | reference | composite | quantity | " "uri | special" ), description=( "How the parameter is understood as a search parameter. This is only " "used if the parameter type is 'string'." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "number", "date", "string", "token", "reference", "composite", "quantity", "uri", "special", ], }, ) searchType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_searchType", title="Extension field for ``searchType``." ) targetProfile: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="targetProfile", title="If type is Reference | canonical, allowed targets", description=( 'Used when the type is "Reference" or "canonical", and identifies a ' "profile structure or implementation Guide that applies to the target " "of the reference this parameter refers to. If any profiles are " "specified, then the content must conform to at least one of them. The " "URL can be a local reference - to a contained StructureDefinition, or " "a reference to another StructureDefinition or Implementation Guide by " "a canonical URL. When an implementation guide is specified, the target" " resource SHALL conform to at least one profile defined in the " "implementation guide." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) targetProfile__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_targetProfile", title="Extension field for ``targetProfile``.", ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="What type this parameter has", description="The type for this parameter.", json_schema_extra={ "element_property": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="in | out", description="Whether this is an input or an output parameter.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["in", "out"], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OperationDefinitionParameter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "use", "min", "max", "documentation", "type", "targetProfile", "searchType", "binding", "referencedFrom", "part", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OperationDefinitionParameter`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("max", "max__ext"), ("min", "min__ext"), ("name", "name__ext"), ("use", "use__ext"), ] return required_fields class OperationDefinitionParameterBinding(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. ValueSet details if this is coded. Binds to a value set if this parameter is coded (code, Coding, CodeableConcept). """ __resource_type__ = "OperationDefinitionParameterBinding" strength: fhirtypes.CodeType | None = Field( default=None, alias="strength", title="required | extensible | preferred | example", description=( "Indicates the degree of conformance expectations associated with this " "binding - that is, the degree to which the provided value set must be " "adhered to in the instances." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["required", "extensible", "preferred", "example"], }, ) strength__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_strength", title="Extension field for ``strength``." ) valueSet: fhirtypes.CanonicalType | None = Field( default=None, alias="valueSet", title="Source of value set", description=( "Points to the value set or external definition (e.g. implicit value " "set) that identifies the set of codes to be used." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueSet", title="Extension field for ``valueSet``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OperationDefinitionParameterBinding`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "strength", "valueSet"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OperationDefinitionParameterBinding`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("strength", "strength__ext"), ("valueSet", "valueSet__ext")] return required_fields class OperationDefinitionParameterReferencedFrom(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. References to this parameter. Identifies other resource parameters within the operation invocation that are expected to resolve to this resource. """ __resource_type__ = "OperationDefinitionParameterReferencedFrom" source: fhirtypes.StringType | None = Field( default=None, alias="source", title="Referencing parameter", description=( "The name of the parameter or dot-separated path of parameter names " "pointing to the resource parameter that is expected to contain a " "reference to this resource." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_source", title="Extension field for ``source``." ) sourceId: fhirtypes.StringType | None = Field( default=None, alias="sourceId", title="Element id of reference", description=( "The id of the element in the referencing resource that is expected to " "resolve to this resource." ), json_schema_extra={ "element_property": True, }, ) sourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceId", title="Extension field for ``sourceId``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OperationDefinitionParameterReferencedFrom`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "source", "sourceId"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OperationDefinitionParameterReferencedFrom`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("source", "source__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/operationoutcome.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/OperationOutcome Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class OperationOutcome(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about the success/failure of an action. A collection of error, warning, or information messages that result from a system action. """ __resource_type__ = "OperationOutcome" issue: typing.List[fhirtypes.OperationOutcomeIssueType] = Field( default=..., alias="issue", title="A single issue associated with the action", description=( "An error, warning, or information message that results from a system " "action." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OperationOutcome`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "issue", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OperationOutcome`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "issue"] class OperationOutcomeIssue(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A single issue associated with the action. An error, warning, or information message that results from a system action. """ __resource_type__ = "OperationOutcomeIssue" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Error or warning code", description=( "Describes the type of the issue. The system that creates an " "OperationOutcome SHALL choose the most applicable code from the " "IssueType value set, and may additional provide its own code for the " "error in the details element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) details: fhirtypes.CodeableConceptType | None = Field( default=None, alias="details", title="Additional details about the error", description=( "Additional details about the error. This may be a text description of " "the error or a system code that identifies the error." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) diagnostics: fhirtypes.StringType | None = Field( default=None, alias="diagnostics", title="Additional diagnostic information about the issue", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) diagnostics__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_diagnostics", title="Extension field for ``diagnostics``." ) expression: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="expression", title="FHIRPath of element(s) related to issue", description=( "A [simple subset of FHIRPath](fhirpath.html#simple) limited to element" " names, repetition indicators and the default child accessor that " "identifies one of the elements in the resource that caused this issue " "to be raised." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) expression__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) location: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="location", title="Deprecated: Path of element(s) related to issue", description=( "This element is deprecated because it is XML specific. It is replaced " "by issue.expression, which is format independent, and simpler to " "parse. For resource issues, this will be a simple XPath limited to " "element names, repetition indicators and the default child accessor " "that identifies one of the elements in the resource that caused this " 'issue to be raised. For HTTP errors, will be "http." + the parameter ' "name." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) location__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_location", title="Extension field for ``location``." ) severity: fhirtypes.CodeType | None = Field( default=None, alias="severity", title="fatal | error | warning | information", description=( "Indicates whether the issue indicates a variation from successful " "processing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["fatal", "error", "warning", "information"], }, ) severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_severity", title="Extension field for ``severity``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OperationOutcomeIssue`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "severity", "code", "details", "diagnostics", "location", "expression", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OperationOutcomeIssue`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "severity", "code", "details", "diagnostics", "location", "expression", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext"), ("severity", "severity__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/organization.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Organization Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Organization(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A grouping of people or organizations with a common purpose. A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, payer/insurer, etc. """ __resource_type__ = "Organization" active: bool | None = Field( default=None, alias="active", title="Whether the organization's record is still in active use", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) address: typing.List[fhirtypes.AddressType] | None = Field( default=None, alias="address", title="An address for the organization", description=None, json_schema_extra={ "element_property": True, }, ) alias: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="alias", title=( "A list of alternate names that the organization is known as, or was " "known as in the past" ), description=None, json_schema_extra={ "element_property": True, }, ) alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_alias", title="Extension field for ``alias``." ) contact: typing.List[fhirtypes.OrganizationContactType] | None = Field( default=None, alias="contact", title="Contact for the organization for a certain purpose", description=None, json_schema_extra={ "element_property": True, }, ) endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title=( "Technical endpoints providing access to services operated for the " "organization" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifies this organization across multiple systems", description=( "Identifier for the organization that is used to identify the " "organization across multiple disparate systems." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name used for the organization", description="A name associated with the organization.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) partOf: fhirtypes.ReferenceType | None = Field( default=None, alias="partOf", title="The organization of which this organization forms a part", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="A contact detail for the organization", description=None, json_schema_extra={ "element_property": True, }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Kind of organization", description="The kind(s) of organization that this is.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Organization`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "type", "name", "alias", "telecom", "address", "partOf", "contact", "endpoint", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Organization`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "active", "type", "name", "partOf", ] class OrganizationContact(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contact for the organization for a certain purpose. """ __resource_type__ = "OrganizationContact" address: fhirtypes.AddressType | None = Field( default=None, alias="address", title="Visiting or postal addresses for the contact", description=None, json_schema_extra={ "element_property": True, }, ) name: fhirtypes.HumanNameType | None = Field( default=None, alias="name", title="A name associated with the contact", description=None, json_schema_extra={ "element_property": True, }, ) purpose: fhirtypes.CodeableConceptType | None = Field( default=None, alias="purpose", title="The type of contact", description="Indicates a purpose for which the contact can be reached.", json_schema_extra={ "element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="Contact details (telephone, email, etc.) for a contact", description=( "A contact detail (e.g. a telephone number or an email address) by " "which the party may be contacted." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OrganizationContact`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "purpose", "name", "telecom", "address", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OrganizationContact`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/organizationaffiliation.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/OrganizationAffiliation Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class OrganizationAffiliation(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Defines an affiliation/assotiation/relationship between 2 distinct oganizations, that is not a part-of relationship/sub-division relationship. """ __resource_type__ = "OrganizationAffiliation" active: bool | None = Field( default=None, alias="active", title="Whether this organization affiliation record is in active use", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) code: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="code", title="Definition of the role the participatingOrganization plays", description=( "Definition of the role the participatingOrganization plays in the " "association." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title=( "Technical endpoints providing access to services operated for this " "role" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) healthcareService: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="healthcareService", title="Healthcare services provided through the role", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["HealthcareService"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifiers that are specific to this role", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) location: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="location", title="The location(s) at which the role occurs", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) network: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="network", title=( "Health insurance provider network in which the " "participatingOrganization provides the role's services (if defined) at" " the indicated locations (if defined)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) organization: fhirtypes.ReferenceType | None = Field( default=None, alias="organization", title="Organization where the role is available", description=( "Organization where the role is available (primary organization/has " "members)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) participatingOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="participatingOrganization", title=( "Organization that provides/performs the role (e.g. providing services " "or is a member of)" ), description=( "The Participating Organization provides/performs the role(s) defined " "by the code to the Primary Organization (e.g. providing services or is" " a member of)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title=( "The period during which the participatingOrganization is affiliated " "with the primary organization" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialty", title=( "Specific specialty of the participatingOrganization in the context of " "the role" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title=( "Contact details at the participatingOrganization relevant to this " "Affiliation" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OrganizationAffiliation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "period", "organization", "participatingOrganization", "network", "code", "specialty", "location", "healthcareService", "telecom", "endpoint", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OrganizationAffiliation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "active", "period", "organization", "participatingOrganization", "network", "code", "specialty", "location", "telecom", ] ================================================ FILE: fhir/resources/R4B/packagedproductdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/PackagedProductDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class PackagedProductDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A medically related item or items, in a container or package. """ __resource_type__ = "PackagedProductDefinition" characteristic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="characteristic", title=( 'Allows the key features to be recorded, such as "hospital pack", ' '"nurse prescribable"' ), description=( 'Allows the key features to be recorded, such as "hospital pack", ' '"nurse prescribable", "calendar pack".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) containedItemQuantity: typing.List[fhirtypes.QuantityType] | None = Field( default=None, alias="containedItemQuantity", title=( "A total of the complete count of contained items of a particular " "type/form, independent of sub-packaging or organization. This can be " "considered as the pack size" ), description=( "A total of the complete count of contained items of a particular " "type/form, independent of sub-packaging or organization. This can be " "considered as the pack size. This attribute differs from " "containedItem.amount in that it can give a single aggregated count of " "all tablet types in a pack, even when these are different manufactured" " items. For example a pill pack of 21 tablets plus 7 sugar tablets, " "can be denoted here as '28 tablets'. This attribute is repeatable so " "that the different item types in one pack type can be counted (e.g. a " "count of vials and count of syringes). Each repeat must have different" " units, so that it is clear what the different sets of counted items " "are, and it is not intended to allow different counts of similar items" " (e.g. not '2 tubes and 3 tubes'). Repeats are not to be used to " "represent different pack sizes (e.g. 20 pack vs. 50 pack) - which " "would be different instances of this resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copackagedIndicator: bool | None = Field( default=None, alias="copackagedIndicator", title=( "If the drug product is supplied with another item such as a diluent or" " adjuvant" ), description=( "States whether a drug product is supplied with another item such as a " "diluent or adjuvant." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copackagedIndicator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copackagedIndicator", title="Extension field for ``copackagedIndicator``.", ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title=( "Textual description. Note that this is not the name of the package or " "product" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="A unique identifier for this package as whole", description=( "A unique identifier for this package as whole. Unique instance " "identifiers assigned to a package by manufacturers, regulators, drug " "catalogue custodians or other organizations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) legalStatusOfSupply: typing.List[ fhirtypes.PackagedProductDefinitionLegalStatusOfSupplyType ] | None = Field( default=None, alias="legalStatusOfSupply", title=( "The legal status of supply of the packaged item as classified by the " "regulator" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) manufacturer: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="manufacturer", title=( "Manufacturer of this package type (multiple means these are all " "possible manufacturers)" ), description=( "Manufacturer of this package type. When there are multiple it means " "these are all possible manufacturers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) marketingStatus: typing.List[fhirtypes.MarketingStatusType] | None = Field( default=None, alias="marketingStatus", title=( "Allows specifying that an item is on the market for sale, or that it " "is not available, and the dates and locations associated" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title=( "A name for this package. Typically as listed in a drug formulary, " "catalogue, inventory etc" ), description=( "A name for this package. Typically what it would be listed as in a " "drug formulary or catalogue, inventory etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) package: fhirtypes.PackagedProductDefinitionPackageType | None = Field( default=None, alias="package", title=( "A packaging item, as a container for medically related items, possibly" " with other packaging items within, or a packaging component, such as " "bottle cap" ), description=( "A packaging item, as a container for medically related items, possibly" " with other packaging items within, or a packaging component, such as " "bottle cap (which is not a device or a medication manufactured item)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) packageFor: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="packageFor", title="The product that this is a pack for", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicinalProductDefinition"], }, ) status: fhirtypes.CodeableConceptType | None = Field( default=None, alias="status", title=( "The status within the lifecycle of this item. High level - not " "intended to duplicate details elsewhere e.g. legal status, or " "authorization/marketing status" ), description=( "The status within the lifecycle of this item. A high level status, " "this is not intended to duplicate details carried elsewhere such as " "legal status, or authorization or marketing status." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) statusDate: fhirtypes.DateTimeType | None = Field( default=None, alias="statusDate", title="The date at which the given status became applicable", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_statusDate", title="Extension field for ``statusDate``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title=( "A high level category e.g. medicinal product, raw material, shipping " "container etc" ), description=( "A high level category e.g. medicinal product, raw material, " "shipping/transport container, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PackagedProductDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "name", "type", "packageFor", "status", "statusDate", "containedItemQuantity", "description", "legalStatusOfSupply", "marketingStatus", "characteristic", "copackagedIndicator", "manufacturer", "package", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PackagedProductDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "name", "type", "packageFor", "status", "statusDate", "containedItemQuantity", "description", "legalStatusOfSupply", "marketingStatus", "characteristic", "copackagedIndicator", "manufacturer", "package", ] class PackagedProductDefinitionLegalStatusOfSupply(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The legal status of supply of the packaged item as classified by the regulator. """ __resource_type__ = "PackagedProductDefinitionLegalStatusOfSupply" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title=( "The actual status of supply. In what situation this package type may " "be supplied for use" ), description=( "The actual status of supply. Conveys in what situation this package " "type may be supplied for use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: fhirtypes.CodeableConceptType | None = Field( default=None, alias="jurisdiction", title="The place where the legal status of supply applies", description=( "The place where the legal status of supply applies. When not " "specified, this indicates it is unknown in this context." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PackagedProductDefinitionLegalStatusOfSupply`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "jurisdiction"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PackagedProductDefinitionLegalStatusOfSupply`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "jurisdiction"] class PackagedProductDefinitionPackage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A packaging item, as a container for medically related items, possibly with other packaging items within, or a packaging component, such as bottle cap. A packaging item, as a container for medically related items, possibly with other packaging items within, or a packaging component, such as bottle cap (which is not a device or a medication manufactured item). """ __resource_type__ = "PackagedProductDefinitionPackage" alternateMaterial: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="alternateMaterial", title=( "A possible alternate material for this part of the packaging, that is " "allowed to be used instead of the usual material" ), description=( "A possible alternate material for this part of the packaging, that is " "allowed to be used instead of the usual material (e.g. different types" " of plastic for a blister sleeve)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) containedItem: typing.List[ fhirtypes.PackagedProductDefinitionPackageContainedItemType ] | None = Field( default=None, alias="containedItem", title="The item(s) within the packaging", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title=( "An identifier that is specific to this particular part of the " "packaging. Including possibly a Data Carrier Identifier" ), description=( "An identifier that is specific to this particular part of the " "packaging. Including possibly Data Carrier Identifier (a GS1 barcode)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) manufacturer: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="manufacturer", title=( "Manufacturer of this package Item (multiple means these are all " "possible manufacturers)" ), description=( "Manufacturer of this package Item. When there are multiple it means " "these are all possible manufacturers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) material: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="material", title="Material type of the package item", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) package: typing.List[fhirtypes.PackagedProductDefinitionPackageType] | None = Field( default=None, alias="package", title=( "Allows containers (and parts of containers) within containers, still a" " single packaged product" ), description=( "Allows containers (and parts of containers) parwithin containers, " "still a single packaged product. See also PackagedProductDefinition.p" "ackage.containedItem.item(PackagedProductDefinition)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) property: typing.List[ fhirtypes.PackagedProductDefinitionPackagePropertyType ] | None = Field( default=None, alias="property", title="General characteristics of this item", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) quantity: fhirtypes.IntegerType | None = Field( default=None, alias="quantity", title=( "The quantity of this level of packaging in the package that contains " "it (with the outermost level being 1)" ), description=( "The quantity of this level of packaging in the package that contains " "it. If specified, the outermost level is always 1." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) quantity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_quantity", title="Extension field for ``quantity``." ) shelfLifeStorage: typing.List[ fhirtypes.PackagedProductDefinitionPackageShelfLifeStorageType ] | None = Field( default=None, alias="shelfLifeStorage", title="Shelf Life and storage information", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The physical type of the container of the items", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PackagedProductDefinitionPackage`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "type", "quantity", "material", "alternateMaterial", "shelfLifeStorage", "manufacturer", "property", "containedItem", "package", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PackagedProductDefinitionPackage`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "identifier", "type", "quantity", "material", "alternateMaterial", "shelfLifeStorage", "manufacturer", "property", "containedItem", "package", ] class PackagedProductDefinitionPackageContainedItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The item(s) within the packaging. """ __resource_type__ = "PackagedProductDefinitionPackageContainedItem" amount: fhirtypes.QuantityType | None = Field( default=None, alias="amount", title="The number of this type of item within this packaging", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) item: fhirtypes.CodeableReferenceType = Field( default=..., alias="item", title=( "The actual item(s) of medication, as manufactured, or a device, or " "other medically related item (food, biologicals, raw materials, " "medical fluids, gases etc.), as contained in the package" ), description=( "The actual item(s) of medication, as manufactured, or a device " "(typically, but not necessarily, a co-packaged one), or other " "medically related item (such as food, biologicals, raw materials, " "medical fluids, gases etc.), as contained in the package. This also " "allows another whole packaged product to be included, which is solely " "for the case where a package of other entire packages is wanted - such" " as a wholesale or distribution pack (for layers within one package, " "use PackagedProductDefinition.package.package)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "ManufacturedItemDefinition", "DeviceDefinition", "PackagedProductDefinition", "BiologicallyDerivedProduct", "NutritionProduct", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PackagedProductDefinitionPackageContainedItem`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "item", "amount"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PackagedProductDefinitionPackageContainedItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "item", "amount"] class PackagedProductDefinitionPackageProperty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. General characteristics of this item. """ __resource_type__ = "PackagedProductDefinitionPackageProperty" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="A code expressing the type of characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PackagedProductDefinitionPackageProperty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueCodeableConcept", "valueQuantity", "valueDate", "valueBoolean", "valueAttachment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PackagedProductDefinitionPackageProperty`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "valueCodeableConcept", "valueQuantity", "valueDate", "valueBoolean", "valueAttachment", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueBoolean", "valueCodeableConcept", "valueDate", "valueQuantity", ] } return one_of_many_fields class PackagedProductDefinitionPackageShelfLifeStorage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Shelf Life and storage information. """ __resource_type__ = "PackagedProductDefinitionPackageShelfLifeStorage" periodDuration: fhirtypes.DurationType | None = Field( default=None, alias="periodDuration", title=( "The shelf life time period can be specified using a numerical value " "for the period of time and its unit of time measurement The unit of " "measurement shall be specified in accordance with ISO 11240 and the " "resulting terminology The symbol and the symbol identifier shall be " "used" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e period[x] "one_of_many": "period", "one_of_many_required": False, }, ) periodString: fhirtypes.StringType | None = Field( default=None, alias="periodString", title=( "The shelf life time period can be specified using a numerical value " "for the period of time and its unit of time measurement The unit of " "measurement shall be specified in accordance with ISO 11240 and the " "resulting terminology The symbol and the symbol identifier shall be " "used" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e period[x] "one_of_many": "period", "one_of_many_required": False, }, ) periodString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_periodString", title="Extension field for ``periodString``.", ) specialPrecautionsForStorage: typing.List[ fhirtypes.CodeableConceptType ] | None = Field( default=None, alias="specialPrecautionsForStorage", title=( "Special precautions for storage, if any, can be specified using an " "appropriate controlled vocabulary. The controlled term and the " "controlled term identifier shall be specified" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title=( "This describes the shelf life, taking into account various scenarios " "such as shelf life of the packaged Medicinal Product itself, shelf " "life after transformation where necessary and shelf life after the " "first opening of a bottle, etc. The shelf life type shall be specified" " using an appropriate controlled vocabulary The controlled term and " "the controlled term identifier shall be specified" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PackagedProductDefinitionPackageShelfLifeStorage`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "periodDuration", "periodString", "specialPrecautionsForStorage", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PackagedProductDefinitionPackageShelfLifeStorage`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "periodDuration", "periodString", "specialPrecautionsForStorage", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"period": ["periodDuration", "periodString"]} return one_of_many_fields ================================================ FILE: fhir/resources/R4B/parameterdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ParameterDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class ParameterDefinition(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of a parameter to a module. The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse. """ __resource_type__ = "ParameterDefinition" documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="A brief description of the parameter", description=( "A brief discussion of what the parameter is for and how it is used by " "the module." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) max: fhirtypes.StringType | None = Field( default=None, alias="max", title="Maximum cardinality (a number of *)", description=( "The maximum number of times this element is permitted to appear in the" " request or response." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_max", title="Extension field for ``max``." ) min: fhirtypes.IntegerType | None = Field( default=None, alias="min", title="Minimum cardinality", description=( "The minimum number of times this parameter SHALL appear in the request" " or response." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_min", title="Extension field for ``min``." ) name: fhirtypes.CodeType | None = Field( default=None, alias="name", title="Name used to access the parameter value", description=( "The name of the parameter used to allow access to the value of the " "parameter in evaluation contexts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) profile: fhirtypes.CanonicalType | None = Field( default=None, alias="profile", title="What profile the value is expected to be", description=( "If specified, this indicates a profile that the input data must " "conform to, or that the output data will conform to." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="What type of value", description="The type of the parameter.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="in | out", description="Whether the parameter is input or output for the module.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["in", "out"], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ParameterDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "name", "use", "min", "max", "documentation", "type", "profile", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ParameterDefinition`` according to specification, with preserving the original sequence order. """ return ["name", "use", "min", "max", "documentation", "type", "profile"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext"), ("use", "use__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/parameters.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Parameters Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, fhirtypes, resource class Parameters(resource.Resource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Operation Request or Response. This resource is a non-persisted resource used to pass information into and back from an [operation](operations.html). It has no other use, and there is no RESTful endpoint associated with it. """ __resource_type__ = "Parameters" parameter: typing.List[fhirtypes.ParametersParameterType] | None = Field( default=None, alias="parameter", title="Operation Parameter", description="A parameter passed to or received from the operation.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Parameters`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "language", "parameter"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Parameters`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "parameter"] class ParametersParameter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Operation Parameter. A parameter passed to or received from the operation. """ __resource_type__ = "ParametersParameter" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name from the definition", description="The name of the parameter (reference to the operation definition).", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) part: typing.List[fhirtypes.ParametersParameterType] | None = Field( default=None, alias="part", title="Named part of a multi-part parameter", description="A named part of a multi-part parameter.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) resource: fhirtypes.ResourceType | None = Field( default=None, alias="resource", title="If parameter is a whole resource", description="If the parameter is a whole resource.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueAddress: fhirtypes.AddressType | None = Field( default=None, alias="valueAddress", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueAge: fhirtypes.AgeType | None = Field( default=None, alias="valueAge", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="valueAnnotation", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="valueBase64Binary", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBase64Binary", title="Extension field for ``valueBase64Binary``.", ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="valueCanonical", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCanonical", title="Extension field for ``valueCanonical``.", ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueContactDetail: fhirtypes.ContactDetailType | None = Field( default=None, alias="valueContactDetail", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="valueContactPoint", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueContributor: fhirtypes.ContributorType | None = Field( default=None, alias="valueContributor", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCount: fhirtypes.CountType | None = Field( default=None, alias="valueCount", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDataRequirement: fhirtypes.DataRequirementType | None = Field( default=None, alias="valueDataRequirement", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueDistance: fhirtypes.DistanceType | None = Field( default=None, alias="valueDistance", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDosage: fhirtypes.DosageType | None = Field( default=None, alias="valueDosage", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDuration: fhirtypes.DurationType | None = Field( default=None, alias="valueDuration", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueExpression: fhirtypes.ExpressionType | None = Field( default=None, alias="valueExpression", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="valueHumanName", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueId: fhirtypes.IdType | None = Field( default=None, alias="valueId", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueId", title="Extension field for ``valueId``." ) valueIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="valueIdentifier", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInstant: fhirtypes.InstantType | None = Field( default=None, alias="valueInstant", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInstant", title="Extension field for ``valueInstant``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="valueMarkdown", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueMarkdown", title="Extension field for ``valueMarkdown``.", ) valueMeta: fhirtypes.MetaType | None = Field( default=None, alias="valueMeta", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueMoney: fhirtypes.MoneyType | None = Field( default=None, alias="valueMoney", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueOid: fhirtypes.OidType | None = Field( default=None, alias="valueOid", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueOid", title="Extension field for ``valueOid``." ) valueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field( default=None, alias="valueParameterDefinition", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="valuePositiveInt", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valuePositiveInt", title="Extension field for ``valuePositiveInt``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field( default=None, alias="valueRelatedArtifact", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="valueSampledData", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueSignature: fhirtypes.SignatureType | None = Field( default=None, alias="valueSignature", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) valueTiming: fhirtypes.TimingType | None = Field( default=None, alias="valueTiming", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field( default=None, alias="valueTriggerDefinition", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="valueUnsignedInt", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUnsignedInt", title="Extension field for ``valueUnsignedInt``.", ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) valueUrl: fhirtypes.UrlType | None = Field( default=None, alias="valueUrl", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUrl", title="Extension field for ``valueUrl``." ) valueUsageContext: fhirtypes.UsageContextType | None = Field( default=None, alias="valueUsageContext", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUuid: fhirtypes.UuidType | None = Field( default=None, alias="valueUuid", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUuid", title="Extension field for ``valueUuid``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ParametersParameter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInstant", "valueInteger", "valueMarkdown", "valueOid", "valuePositiveInt", "valueString", "valueTime", "valueUnsignedInt", "valueUri", "valueUrl", "valueUuid", "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueCodeableConcept", "valueCoding", "valueContactPoint", "valueCount", "valueDistance", "valueDuration", "valueHumanName", "valueIdentifier", "valueMoney", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueReference", "valueSampledData", "valueSignature", "valueTiming", "valueContactDetail", "valueContributor", "valueDataRequirement", "valueExpression", "valueParameterDefinition", "valueRelatedArtifact", "valueTriggerDefinition", "valueUsageContext", "valueDosage", "valueMeta", "resource", "part", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ParametersParameter`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "name", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInstant", "valueInteger", "valueMarkdown", "valueOid", "valuePositiveInt", "valueString", "valueTime", "valueUnsignedInt", "valueUri", "valueUrl", "valueUuid", "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueCodeableConcept", "valueCoding", "valueContactPoint", "valueCount", "valueDistance", "valueDuration", "valueHumanName", "valueIdentifier", "valueMoney", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueReference", "valueSampledData", "valueSignature", "valueTiming", "valueContactDetail", "valueContributor", "valueDataRequirement", "valueExpression", "valueParameterDefinition", "valueRelatedArtifact", "valueTriggerDefinition", "valueUsageContext", "valueDosage", "valueMeta", "resource", "part", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueCodeableConcept", "valueCoding", "valueContactDetail", "valueContactPoint", "valueContributor", "valueCount", "valueDataRequirement", "valueDate", "valueDateTime", "valueDecimal", "valueDistance", "valueDosage", "valueDuration", "valueExpression", "valueHumanName", "valueId", "valueIdentifier", "valueInstant", "valueInteger", "valueMarkdown", "valueMeta", "valueMoney", "valueOid", "valueParameterDefinition", "valuePeriod", "valuePositiveInt", "valueQuantity", "valueRange", "valueRatio", "valueReference", "valueRelatedArtifact", "valueSampledData", "valueSignature", "valueString", "valueTime", "valueTiming", "valueTriggerDefinition", "valueUnsignedInt", "valueUri", "valueUrl", "valueUsageContext", "valueUuid", ] } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/patient.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Patient Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Patient(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about an individual or animal receiving health care services. Demographics and other administrative information about an individual or animal receiving care or other health-related services. """ __resource_type__ = "Patient" active: bool | None = Field( default=None, alias="active", title="Whether this patient's record is in active use", description=( "Whether this patient record is in active use. Many systems use this " "property to mark as non-current patients, such as those that have not " "been seen for a period of time based on an organization's business " "rules. It is often used to filter patient lists to exclude inactive " "patients Deceased patients may also be marked as inactive for the " "same reasons, but may be active for some time after death." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) address: typing.List[fhirtypes.AddressType] | None = Field( default=None, alias="address", title="An address for the individual", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) birthDate: fhirtypes.DateType | None = Field( default=None, alias="birthDate", title="The date of birth for the individual", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) birthDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_birthDate", title="Extension field for ``birthDate``." ) communication: typing.List[fhirtypes.PatientCommunicationType] | None = Field( default=None, alias="communication", title=( "A language which may be used to communicate with the patient about his" " or her health" ), description=None, json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.PatientContactType] | None = Field( default=None, alias="contact", title="A contact party (e.g. guardian, partner, friend) for the patient", description=None, json_schema_extra={ "element_property": True, }, ) deceasedBoolean: bool | None = Field( default=None, alias="deceasedBoolean", title="Indicates if the individual is deceased or not", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deceasedBoolean", title="Extension field for ``deceasedBoolean``.", ) deceasedDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="deceasedDateTime", title="Indicates if the individual is deceased or not", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deceasedDateTime", title="Extension field for ``deceasedDateTime``.", ) gender: fhirtypes.CodeType | None = Field( default=None, alias="gender", title="male | female | other | unknown", description=( "Administrative Gender - the gender that the patient is considered to " "have for administration and record keeping purposes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["male", "female", "other", "unknown"], }, ) gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_gender", title="Extension field for ``gender``." ) generalPractitioner: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="generalPractitioner", title="Patient's nominated primary care provider", description="Patient's nominated care provider.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Organization", "Practitioner", "PractitionerRole", ], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="An identifier for this patient", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) link: typing.List[fhirtypes.PatientLinkType] | None = Field( default=None, alias="link", title="Link to another patient resource that concerns the same actual person", description=( "Link to another patient resource that concerns the same actual " "patient." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) managingOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="managingOrganization", title="Organization that is the custodian of the patient record", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) maritalStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="maritalStatus", title="Marital (civil) status of a patient", description="This field contains a patient's most recent marital (civil) status.", json_schema_extra={ "element_property": True, }, ) multipleBirthBoolean: bool | None = Field( default=None, alias="multipleBirthBoolean", title="Whether patient is part of a multiple birth", description=( "Indicates whether the patient is part of a multiple (boolean) or " "indicates the actual birth order (integer)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e multipleBirth[x] "one_of_many": "multipleBirth", "one_of_many_required": False, }, ) multipleBirthBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_multipleBirthBoolean", title="Extension field for ``multipleBirthBoolean``.", ) multipleBirthInteger: fhirtypes.IntegerType | None = Field( default=None, alias="multipleBirthInteger", title="Whether patient is part of a multiple birth", description=( "Indicates whether the patient is part of a multiple (boolean) or " "indicates the actual birth order (integer)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e multipleBirth[x] "one_of_many": "multipleBirth", "one_of_many_required": False, }, ) multipleBirthInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_multipleBirthInteger", title="Extension field for ``multipleBirthInteger``.", ) name: typing.List[fhirtypes.HumanNameType] | None = Field( default=None, alias="name", title="A name associated with the patient", description="A name associated with the individual.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) photo: typing.List[fhirtypes.AttachmentType] | None = Field( default=None, alias="photo", title="Image of the patient", description=None, json_schema_extra={ "element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="A contact detail for the individual", description=( "A contact detail (e.g. a telephone number or an email address) by " "which the individual may be contacted." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Patient`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "name", "telecom", "gender", "birthDate", "deceasedBoolean", "deceasedDateTime", "address", "maritalStatus", "multipleBirthBoolean", "multipleBirthInteger", "photo", "contact", "communication", "generalPractitioner", "managingOrganization", "link", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Patient`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "active", "name", "telecom", "gender", "birthDate", "deceasedBoolean", "deceasedDateTime", "address", "managingOrganization", "link", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "deceased": ["deceasedBoolean", "deceasedDateTime"], "multipleBirth": ["multipleBirthBoolean", "multipleBirthInteger"], } return one_of_many_fields class PatientCommunication(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A language which may be used to communicate with the patient about his or her health. """ __resource_type__ = "PatientCommunication" language: fhirtypes.CodeableConceptType = Field( default=..., alias="language", title=( "The language which can be used to communicate with the patient about " "his or her health" ), description=( "The ISO-639-1 alpha 2 code in lower case for the language, optionally " "followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in" ' upper case; e.g. "en" for English, or "en-US" for American English ' 'versus "en-EN" for England English.' ), json_schema_extra={ "element_property": True, }, ) preferred: bool | None = Field( default=None, alias="preferred", title="Language preference indicator", description=( "Indicates whether or not the patient prefers this language (over other" " languages he masters up a certain level)." ), json_schema_extra={ "element_property": True, }, ) preferred__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preferred", title="Extension field for ``preferred``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PatientCommunication`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "language", "preferred"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PatientCommunication`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class PatientContact(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A contact party (e.g. guardian, partner, friend) for the patient. """ __resource_type__ = "PatientContact" address: fhirtypes.AddressType | None = Field( default=None, alias="address", title="Address for the contact person", description=None, json_schema_extra={ "element_property": True, }, ) gender: fhirtypes.CodeType | None = Field( default=None, alias="gender", title="male | female | other | unknown", description=( "Administrative Gender - the gender that the contact person is " "considered to have for administration and record keeping purposes." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["male", "female", "other", "unknown"], }, ) gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_gender", title="Extension field for ``gender``." ) name: fhirtypes.HumanNameType | None = Field( default=None, alias="name", title="A name associated with the contact person", description=None, json_schema_extra={ "element_property": True, }, ) organization: fhirtypes.ReferenceType | None = Field( default=None, alias="organization", title="Organization that is associated with the contact", description=( "Organization on behalf of which the contact is acting or for which the" " contact is working." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title=( "The period during which this contact person or organization is valid " "to be contacted relating to this patient" ), description=None, json_schema_extra={ "element_property": True, }, ) relationship: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="relationship", title="The kind of relationship", description=( "The nature of the relationship between the patient and the contact " "person." ), json_schema_extra={ "element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="A contact detail for the person", description=( "A contact detail for the person, e.g. a telephone number or an email " "address." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PatientContact`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "relationship", "name", "telecom", "address", "gender", "organization", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PatientContact`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class PatientLink(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Link to another patient resource that concerns the same actual person. Link to another patient resource that concerns the same actual patient. """ __resource_type__ = "PatientLink" other: fhirtypes.ReferenceType = Field( default=..., alias="other", title="The other patient or related person resource that the link refers to", description="The other patient resource that the link refers to.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "RelatedPerson"], }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="replaced-by | replaces | refer | seealso", description=( "The type of link between this patient resource and another patient " "resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["replaced-by", "replaces", "refer", "seealso"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PatientLink`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "other", "type"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PatientLink`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "other", "type"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/paymentnotice.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/PaymentNotice Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class PaymentNotice(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. PaymentNotice request. This resource provides the status of the payment for goods and services rendered, and the request and response resource references. """ __resource_type__ = "PaymentNotice" amount: fhirtypes.MoneyType = Field( default=..., alias="amount", title="Monetary amount of the payment", description="The amount sent to the payee.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Creation date", description="The date when this resource was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for the payment noctice", description="A unique identifier assigned to this payment notice.", json_schema_extra={ "element_property": True, }, ) payee: fhirtypes.ReferenceType | None = Field( default=None, alias="payee", title="Party being paid", description=( "The party who will receive or has received payment that is the subject" " of this notification." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) payment: fhirtypes.ReferenceType = Field( default=..., alias="payment", title="Payment reference", description="A reference to the payment which is the subject of this notice.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["PaymentReconciliation"], }, ) paymentDate: fhirtypes.DateType | None = Field( default=None, alias="paymentDate", title="Payment or clearing date", description="The date when the above payment action occurred.", json_schema_extra={ "element_property": True, }, ) paymentDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_paymentDate", title="Extension field for ``paymentDate``." ) paymentStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="paymentStatus", title="Issued or cleared Status of the payment", description="A code indicating whether payment has been sent or cleared.", json_schema_extra={ "element_property": True, }, ) provider: fhirtypes.ReferenceType | None = Field( default=None, alias="provider", title="Responsible practitioner", description=( "The practitioner who is responsible for the services rendered to the " "patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) recipient: fhirtypes.ReferenceType = Field( default=..., alias="recipient", title="Party being notified", description="The party who is notified of the payment status.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) request: fhirtypes.ReferenceType | None = Field( default=None, alias="request", title="Request reference", description="Reference of resource for which payment is being made.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) response: fhirtypes.ReferenceType | None = Field( default=None, alias="response", title="Response reference", description="Reference of response to resource for which payment is being made.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PaymentNotice`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "request", "response", "created", "provider", "payment", "paymentDate", "payee", "recipient", "amount", "paymentStatus", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PaymentNotice`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "status", "created", "payment", "recipient", "amount", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("created", "created__ext"), ("status", "status__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/paymentreconciliation.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/PaymentReconciliation Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class PaymentReconciliation(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. PaymentReconciliation resource. This resource provides the details including amount of a payment and allocates the payment items being paid. """ __resource_type__ = "PaymentReconciliation" created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Creation date", description="The date when the resource was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) detail: typing.List[fhirtypes.PaymentReconciliationDetailType] | None = Field( default=None, alias="detail", title="Settlement particulars", description=( "Distribution of the payment amount for a previously acknowledged " "payable." ), json_schema_extra={ "element_property": True, }, ) disposition: fhirtypes.StringType | None = Field( default=None, alias="disposition", title="Disposition message", description=( "A human readable description of the status of the request for the " "reconciliation." ), json_schema_extra={ "element_property": True, }, ) disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_disposition", title="Extension field for ``disposition``." ) formCode: fhirtypes.CodeableConceptType | None = Field( default=None, alias="formCode", title="Printed form identifier", description="A code for the form to be used for printing the content.", json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for a payment reconciliation", description="A unique identifier assigned to this payment reconciliation.", json_schema_extra={ "element_property": True, }, ) outcome: fhirtypes.CodeType | None = Field( default=None, alias="outcome", title="queued | complete | error | partial", description="The outcome of a request for a reconciliation.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["queued", "complete", "error", "partial"], }, ) outcome__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_outcome", title="Extension field for ``outcome``." ) paymentAmount: fhirtypes.MoneyType = Field( default=..., alias="paymentAmount", title="Total amount of Payment", description="Total payment amount as indicated on the financial instrument.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) paymentDate: fhirtypes.DateType | None = Field( default=None, alias="paymentDate", title="When payment issued", description="The date of payment as indicated on the financial instrument.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) paymentDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_paymentDate", title="Extension field for ``paymentDate``." ) paymentIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="paymentIdentifier", title="Business identifier for the payment", description="Issuer's unique identifier for the payment instrument.", json_schema_extra={ "element_property": True, }, ) paymentIssuer: fhirtypes.ReferenceType | None = Field( default=None, alias="paymentIssuer", title="Party generating payment", description="The party who generated the payment.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Period covered", description=( "The period of time for which payments have been gathered into this " "bulk payment for settlement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) processNote: typing.List[ fhirtypes.PaymentReconciliationProcessNoteType ] | None = Field( default=None, alias="processNote", title="Note concerning processing", description=( "A note that describes or explains the processing in a human readable " "form." ), json_schema_extra={ "element_property": True, }, ) request: fhirtypes.ReferenceType | None = Field( default=None, alias="request", title="Reference to requesting resource", description="Original request resource reference.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Task"], }, ) requestor: fhirtypes.ReferenceType | None = Field( default=None, alias="requestor", title="Responsible practitioner", description=( "The practitioner who is responsible for the services rendered to the " "patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PaymentReconciliation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "period", "created", "paymentIssuer", "request", "requestor", "outcome", "disposition", "paymentDate", "paymentAmount", "paymentIdentifier", "detail", "formCode", "processNote", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PaymentReconciliation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "status", "period", "created", "paymentIssuer", "paymentDate", "paymentAmount", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("created", "created__ext"), ("paymentDate", "paymentDate__ext"), ("status", "status__ext"), ] return required_fields class PaymentReconciliationDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Settlement particulars. Distribution of the payment amount for a previously acknowledged payable. """ __resource_type__ = "PaymentReconciliationDetail" amount: fhirtypes.MoneyType | None = Field( default=None, alias="amount", title="Amount allocated to this payable", description="The monetary amount allocated from the total payment to the payable.", json_schema_extra={ "element_property": True, }, ) date: fhirtypes.DateType | None = Field( default=None, alias="date", title="Date of commitment to pay", description="The date from the response resource containing a commitment to pay.", json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Business identifier of the payment detail", description=( "Unique identifier for the current payment item for the referenced " "payable." ), json_schema_extra={ "element_property": True, }, ) payee: fhirtypes.ReferenceType | None = Field( default=None, alias="payee", title="Recipient of the payment", description="The party which is receiving the payment.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) predecessor: fhirtypes.IdentifierType | None = Field( default=None, alias="predecessor", title="Business identifier of the prior payment detail", description=( "Unique identifier for the prior payment item for the referenced " "payable." ), json_schema_extra={ "element_property": True, }, ) request: fhirtypes.ReferenceType | None = Field( default=None, alias="request", title="Request giving rise to the payment", description=( "A resource, such as a Claim, the evaluation of which could lead to " "payment." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) response: fhirtypes.ReferenceType | None = Field( default=None, alias="response", title="Response committing to a payment", description=( "A resource, such as a ClaimResponse, which contains a commitment to " "payment." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) responsible: fhirtypes.ReferenceType | None = Field( default=None, alias="responsible", title="Contact for the response", description=( "A reference to the individual who is responsible for inquiries " "regarding the response and its payment." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["PractitionerRole"], }, ) submitter: fhirtypes.ReferenceType | None = Field( default=None, alias="submitter", title="Submitter of the request", description="The party which submitted the claim or financial transaction.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Category of payment", description="Code to indicate the nature of the payment.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PaymentReconciliationDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "predecessor", "type", "request", "submitter", "response", "date", "responsible", "payee", "amount", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PaymentReconciliationDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class PaymentReconciliationProcessNote(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Note concerning processing. A note that describes or explains the processing in a human readable form. """ __resource_type__ = "PaymentReconciliationProcessNote" text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Note explanatory text", description="The explanation or description associated with the processing.", json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="display | print | printoper", description="The business purpose of the note text.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["display", "print", "printoper"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PaymentReconciliationProcessNote`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "text"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PaymentReconciliationProcessNote`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/period.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Period Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Period(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Time range defined by start and end date/time. A time period defined by a start and end date and optionally time. """ __resource_type__ = "Period" end: fhirtypes.DateTimeType | None = Field( default=None, alias="end", title="End time with inclusive boundary, if not ongoing", description=( "The end of the period. If the end of the period is missing, it means " "no end was known or planned at the time the instance was created. The " "start may be in the past, and the end date in the future, which means " "that period is expected/planned to end at that time." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_end", title="Extension field for ``end``." ) start: fhirtypes.DateTimeType | None = Field( default=None, alias="start", title="Starting time with inclusive boundary", description="The start of the period. The boundary is inclusive.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_start", title="Extension field for ``start``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Period`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "start", "end"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Period`` according to specification, with preserving the original sequence order. """ return ["start", "end"] ================================================ FILE: fhir/resources/R4B/person.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Person Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Person(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A generic person record. Demographics and administrative information about a person independent of a specific health-related context. """ __resource_type__ = "Person" active: bool | None = Field( default=None, alias="active", title="This person's record is in active use", description="Whether this person's record is in active use.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) address: typing.List[fhirtypes.AddressType] | None = Field( default=None, alias="address", title="One or more addresses for the person", description=None, json_schema_extra={ "element_property": True, }, ) birthDate: fhirtypes.DateType | None = Field( default=None, alias="birthDate", title="The date on which the person was born", description="The birth date for the person.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) birthDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_birthDate", title="Extension field for ``birthDate``." ) gender: fhirtypes.CodeType | None = Field( default=None, alias="gender", title="male | female | other | unknown", description="Administrative Gender.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["male", "female", "other", "unknown"], }, ) gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_gender", title="Extension field for ``gender``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="A human identifier for this person", description="Identifier for a person within a particular scope.", json_schema_extra={ "element_property": True, }, ) link: typing.List[fhirtypes.PersonLinkType] | None = Field( default=None, alias="link", title="Link to a resource that concerns the same actual person", description=None, json_schema_extra={ "element_property": True, }, ) managingOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="managingOrganization", title="The organization that is the custodian of the person record", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) name: typing.List[fhirtypes.HumanNameType] | None = Field( default=None, alias="name", title="A name associated with the person", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) photo: fhirtypes.AttachmentType | None = Field( default=None, alias="photo", title="Image of the person", description=( "An image that can be displayed as a thumbnail of the person to enhance" " the identification of the individual." ), json_schema_extra={ "element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="A contact detail for the person", description=( "A contact detail for the person, e.g. a telephone number or an email " "address." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Person`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "name", "telecom", "gender", "birthDate", "address", "photo", "managingOrganization", "active", "link", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Person`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "name", "telecom", "gender", "birthDate", "managingOrganization", "active", ] class PersonLink(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Link to a resource that concerns the same actual person. """ __resource_type__ = "PersonLink" assurance: fhirtypes.CodeType | None = Field( default=None, alias="assurance", title="level1 | level2 | level3 | level4", description=( "Level of assurance that this link is associated with the target " "resource." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["level1", "level2", "level3", "level4"], }, ) assurance__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_assurance", title="Extension field for ``assurance``." ) target: fhirtypes.ReferenceType = Field( default=..., alias="target", title="The resource to which this actual person is associated", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "RelatedPerson", "Person", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PersonLink`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "target", "assurance"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PersonLink`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/plandefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/PlanDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class PlanDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The definition of a plan for a series of actions, independent of any specific patient or context. This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical and non- clinical artifacts such as clinical decision support rules, order sets, protocols, and drug quality specifications. """ __resource_type__ = "PlanDefinition" action: typing.List[fhirtypes.PlanDefinitionActionType] | None = Field( default=None, alias="action", title="Action defined by the plan", description=( "An action or group of actions to be taken as part of the plan. For " "example, in clinical care, an action would be to prescribe a " "particular indicated medication, or perform a particular test as " "appropriate. In pharmaceutical quality, an action would be the test " "that needs to be performed on a drug product as defined in the quality" " specification." ), json_schema_extra={ "element_property": True, }, ) approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the plan definition was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the content", description=( "An individiual or organization primarily involved in the creation and " "maintenance of the content." ), json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the plan definition and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the plan definition." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the plan definition was " "published. The date must change when the business version changes and " "it must change if the status code changes. In addition, it should " "change when the substantive content of the plan definition changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the plan definition", description=( "A free text natural language description of the plan definition from a" " consumer's perspective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the content", description=( "An individual or organization primarily responsible for internal " "coherence of the content." ), json_schema_extra={ "element_property": True, }, ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the plan definition is expected to be used", description=( "The period during which the plan definition content was or is planned " "to be in active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the content", description=( "An individual or organization responsible for officially endorsing the" " content for use in some setting." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this plan definition is authored for " "testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) goal: typing.List[fhirtypes.PlanDefinitionGoalType] | None = Field( default=None, alias="goal", title="What the plan is trying to accomplish", description=( "A goal describes an expected outcome that activities within the plan " "are intended to achieve. For example, weight loss, restoring an " "activity of daily living, obtaining herd immunity via immunization, " "meeting a process improvement objective, meeting the acceptance " "criteria for a test as specified by a quality specification, etc." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the plan definition", description=( "A formal identifier that is used to identify this plan definition when" " it is represented in other formats, or referenced in a specification," " model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for plan definition (if applicable)", description=( "A legal or geographic region in which the plan definition is intended " "to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the plan definition was last reviewed", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) library: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="library", title="Logic used by the plan definition", description=( "A reference to a Library resource containing any formal logic used by " "the plan definition." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Library"], }, ) library__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_library", title="Extension field for ``library``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this plan definition (computer friendly)", description=( "A natural language name identifying the plan definition. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the plan " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this plan definition is defined", description=( "Explanation of why this plan definition is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Additional documentation, citations", description=( "Related artifacts such as additional documentation, justification, or " "bibliographic references." ), json_schema_extra={ "element_property": True, }, ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the content", description=( "An individual or organization primarily responsible for review of some" " aspect of the content." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this plan definition. Enables tracking the life-cycle of" " the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subjectCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="subjectCanonical", title="Type of individual the plan definition is focused on", description=( "A code, group definition, or canonical reference that describes or " "identifies the intended subject of the plan definition. Canonical " "references are allowed to support the definition of protocols for drug" " and substance quality specifications, and is allowed to reference a " "MedicinalProductDefinition, SubstanceDefinition, " "AdministrableProductDefinition, ManufacturedItemDefinition, or " "PackagedProductDefinition resource." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "MedicinalProductDefinition", "SubstanceDefinition", "AdministrableProductDefinition", "ManufacturedItemDefinition", "PackagedProductDefinition", ], }, ) subjectCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subjectCanonical", title="Extension field for ``subjectCanonical``.", ) subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subjectCodeableConcept", title="Type of individual the plan definition is focused on", description=( "A code, group definition, or canonical reference that describes or " "identifies the intended subject of the plan definition. Canonical " "references are allowed to support the definition of protocols for drug" " and substance quality specifications, and is allowed to reference a " "MedicinalProductDefinition, SubstanceDefinition, " "AdministrableProductDefinition, ManufacturedItemDefinition, or " "PackagedProductDefinition resource." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, }, ) subjectReference: fhirtypes.ReferenceType | None = Field( default=None, alias="subjectReference", title="Type of individual the plan definition is focused on", description=( "A code, group definition, or canonical reference that describes or " "identifies the intended subject of the plan definition. Canonical " "references are allowed to support the definition of protocols for drug" " and substance quality specifications, and is allowed to reference a " "MedicinalProductDefinition, SubstanceDefinition, " "AdministrableProductDefinition, ManufacturedItemDefinition, or " "PackagedProductDefinition resource." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) subtitle: fhirtypes.StringType | None = Field( default=None, alias="subtitle", title="Subordinate title of the plan definition", description=( "An explanatory or alternate title for the plan definition giving " "additional information about its content." ), json_schema_extra={ "element_property": True, }, ) subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subtitle", title="Extension field for ``subtitle``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this plan definition (human friendly)", description="A short, descriptive, user-friendly title for the plan definition.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) topic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="topic", title="E.g. Education, Treatment, Assessment", description=( "Descriptive topics related to the content of the plan definition. " "Topics provide a high-level categorization of the definition that can " "be useful for filtering and searching." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="order-set | clinical-protocol | eca-rule | workflow-definition", description=( "A high-level category for the plan definition that distinguishes the " "kinds of systems that would be interested in the plan definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this plan definition, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this plan definition when it " "is referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which at which an authoritative " "instance of this plan definition is (or will be) published. This URL " "can be the target of a canonical reference. It SHALL remain the same " "when the plan definition is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) usage: fhirtypes.StringType | None = Field( default=None, alias="usage", title="Describes the clinical usage of the plan", description=( "A detailed description of how the plan definition is used from a " "clinical perspective." ), json_schema_extra={ "element_property": True, }, ) usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usage", title="Extension field for ``usage``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate plan definition instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the plan definition", description=( "The identifier that is used to identify this version of the plan " "definition when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the plan definition " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence. To provide a version consistent with the " "Decision Support Service specification, use the format " "Major.Minor.Revision (e.g. 1.0.0). For more information on versioning " "knowledge assets, refer to the Decision Support Service specification." " Note that a version is required for non-experimental active " "artifacts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "subtitle", "type", "status", "experimental", "subjectCodeableConcept", "subjectReference", "subjectCanonical", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "usage", "copyright", "approvalDate", "lastReviewDate", "effectivePeriod", "topic", "author", "editor", "reviewer", "endorser", "relatedArtifact", "library", "goal", "action", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "type", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "effectivePeriod", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "subject": [ "subjectCanonical", "subjectCodeableConcept", "subjectReference", ] } return one_of_many_fields class PlanDefinitionAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Action defined by the plan. An action or group of actions to be taken as part of the plan. For example, in clinical care, an action would be to prescribe a particular indicated medication, or perform a particular test as appropriate. In pharmaceutical quality, an action would be the test that needs to be performed on a drug product as defined in the quality specification. """ __resource_type__ = "PlanDefinitionAction" action: typing.List[fhirtypes.PlanDefinitionActionType] | None = Field( default=None, alias="action", title="A sub-action", description=( "Sub actions that are contained within the action. The behavior of this" " action determines the functionality of the sub-actions. For example, " "a selection behavior of at-most-one indicates that of the sub-actions," " at most one may be chosen as part of realizing the action definition." ), json_schema_extra={ "element_property": True, }, ) cardinalityBehavior: fhirtypes.CodeType | None = Field( default=None, alias="cardinalityBehavior", title="single | multiple", description="Defines whether the action can be selected multiple times.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["single", "multiple"], }, ) cardinalityBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_cardinalityBehavior", title="Extension field for ``cardinalityBehavior``.", ) code: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="code", title="Code representing the meaning of the action or sub-actions", description=( "A code that provides a meaning, grouping, or classification for the " "action or action group. For example, a section may have a LOINC code " "for the section of a documentation template. In pharmaceutical " "quality, an action (Test) such as pH could be classified as a physical" " property." ), json_schema_extra={ "element_property": True, }, ) condition: typing.List[fhirtypes.PlanDefinitionActionConditionType] | None = Field( default=None, alias="condition", title="Whether or not the action is applicable", description=( "An expression that describes applicability criteria or start/stop " "conditions for the action." ), json_schema_extra={ "element_property": True, }, ) definitionCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="definitionCanonical", title="Description of the activity to be performed", description=( "A reference to an ActivityDefinition that describes the action to be " "taken in detail, or a PlanDefinition that describes a series of " "actions to be taken." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e definition[x] "one_of_many": "definition", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "ActivityDefinition", "PlanDefinition", "Questionnaire", ], }, ) definitionCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definitionCanonical", title="Extension field for ``definitionCanonical``.", ) definitionUri: fhirtypes.UriType | None = Field( default=None, alias="definitionUri", title="Description of the activity to be performed", description=( "A reference to an ActivityDefinition that describes the action to be " "taken in detail, or a PlanDefinition that describes a series of " "actions to be taken." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e definition[x] "one_of_many": "definition", "one_of_many_required": False, }, ) definitionUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definitionUri", title="Extension field for ``definitionUri``.", ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Brief description of the action", description=( "A brief description of the action used to provide a summary to display" " to the user." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) documentation: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="documentation", title="Supporting documentation for the intended performer of the action", description=( "Didactic or other informational resources associated with the action " "that can be provided to the CDS recipient. Information resources can " "include inline text commentary and links to web resources." ), json_schema_extra={ "element_property": True, }, ) dynamicValue: typing.List[ fhirtypes.PlanDefinitionActionDynamicValueType ] | None = Field( default=None, alias="dynamicValue", title="Dynamic aspects of the definition", description=( "Customizations that should be applied to the statically defined " "resource. For example, if the dosage of a medication must be computed " "based on the patient's weight, a customization would be used to " "specify an expression that calculated the weight, and the path on the " "resource that would contain the result." ), json_schema_extra={ "element_property": True, }, ) goalId: typing.List[fhirtypes.IdType | None] | None = Field( default=None, alias="goalId", title="What goals this action supports", description=( "Identifies goals that this action supports. The reference must be to a" " goal element defined within this plan definition. In pharmaceutical " "quality, a goal represents acceptance criteria (Goal) for a given " "action (Test), so the goalId would be the unique id of a defined goal " "element establishing the acceptance criteria for the action." ), json_schema_extra={ "element_property": True, }, ) goalId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_goalId", title="Extension field for ``goalId``." ) groupingBehavior: fhirtypes.CodeType | None = Field( default=None, alias="groupingBehavior", title="visual-group | logical-group | sentence-group", description="Defines the grouping behavior for the action and its children.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["visual-group", "logical-group", "sentence-group"], }, ) groupingBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_groupingBehavior", title="Extension field for ``groupingBehavior``.", ) input: typing.List[fhirtypes.DataRequirementType] | None = Field( default=None, alias="input", title="Input data requirements", description="Defines input data requirements for the action.", json_schema_extra={ "element_property": True, }, ) output: typing.List[fhirtypes.DataRequirementType] | None = Field( default=None, alias="output", title="Output data definition", description="Defines the outputs of the action, if any.", json_schema_extra={ "element_property": True, }, ) participant: typing.List[ fhirtypes.PlanDefinitionActionParticipantType ] | None = Field( default=None, alias="participant", title="Who should participate in the action", description="Indicates who should participate in performing the action described.", json_schema_extra={ "element_property": True, }, ) precheckBehavior: fhirtypes.CodeType | None = Field( default=None, alias="precheckBehavior", title="yes | no", description="Defines whether the action should usually be preselected.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["yes", "no"], }, ) precheckBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_precheckBehavior", title="Extension field for ``precheckBehavior``.", ) prefix: fhirtypes.StringType | None = Field( default=None, alias="prefix", title="User-visible prefix for the action (e.g. 1. or A.)", description="A user-visible prefix for the action.", json_schema_extra={ "element_property": True, }, ) prefix__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_prefix", title="Extension field for ``prefix``." ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Indicates how quickly the action should be addressed with respect to " "other actions." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) reason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reason", title="Why the action should be performed", description="A description of why this action is necessary or appropriate.", json_schema_extra={ "element_property": True, }, ) relatedAction: typing.List[ fhirtypes.PlanDefinitionActionRelatedActionType ] | None = Field( default=None, alias="relatedAction", title="Relationship to another action", description=( 'A relationship to another action such as "before" or "30-60 minutes ' 'after start of".' ), json_schema_extra={ "element_property": True, }, ) requiredBehavior: fhirtypes.CodeType | None = Field( default=None, alias="requiredBehavior", title="must | could | must-unless-documented", description="Defines the required behavior for the action.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["must", "could", "must-unless-documented"], }, ) requiredBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requiredBehavior", title="Extension field for ``requiredBehavior``.", ) selectionBehavior: fhirtypes.CodeType | None = Field( default=None, alias="selectionBehavior", title="any | all | all-or-none | exactly-one | at-most-one | one-or-more", description="Defines the selection behavior for the action and its children.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "any", "all", "all-or-none", "exactly-one", "at-most-one", "one-or-more", ], }, ) selectionBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_selectionBehavior", title="Extension field for ``selectionBehavior``.", ) subjectCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="subjectCanonical", title="Type of individual the action is focused on", description=( "A code, group definition, or canonical reference that describes the " "intended subject of the action and its children, if any. Canonical " "references are allowed to support the definition of protocols for drug" " and substance quality specifications, and is allowed to reference a " "MedicinalProductDefinition, SubstanceDefinition, " "AdministrableProductDefinition, ManufacturedItemDefinition, or " "PackagedProductDefinition resource." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, }, ) subjectCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subjectCanonical", title="Extension field for ``subjectCanonical``.", ) subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subjectCodeableConcept", title="Type of individual the action is focused on", description=( "A code, group definition, or canonical reference that describes the " "intended subject of the action and its children, if any. Canonical " "references are allowed to support the definition of protocols for drug" " and substance quality specifications, and is allowed to reference a " "MedicinalProductDefinition, SubstanceDefinition, " "AdministrableProductDefinition, ManufacturedItemDefinition, or " "PackagedProductDefinition resource." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, }, ) subjectReference: fhirtypes.ReferenceType | None = Field( default=None, alias="subjectReference", title="Type of individual the action is focused on", description=( "A code, group definition, or canonical reference that describes the " "intended subject of the action and its children, if any. Canonical " "references are allowed to support the definition of protocols for drug" " and substance quality specifications, and is allowed to reference a " "MedicinalProductDefinition, SubstanceDefinition, " "AdministrableProductDefinition, ManufacturedItemDefinition, or " "PackagedProductDefinition resource." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) textEquivalent: fhirtypes.StringType | None = Field( default=None, alias="textEquivalent", title=( "Static text equivalent of the action, used if the dynamic aspects " "cannot be interpreted by the receiving system" ), description=( "A text equivalent of the action to be performed. This provides a " "human-interpretable description of the action when the definition is " "consumed by a system that might not be capable of interpreting it " "dynamically." ), json_schema_extra={ "element_property": True, }, ) textEquivalent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_textEquivalent", title="Extension field for ``textEquivalent``.", ) timingAge: fhirtypes.AgeType | None = Field( default=None, alias="timingAge", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="timingDateTime", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timingDateTime", title="Extension field for ``timingDateTime``.", ) timingDuration: fhirtypes.DurationType | None = Field( default=None, alias="timingDuration", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="timingPeriod", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingRange: fhirtypes.RangeType | None = Field( default=None, alias="timingRange", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingTiming: fhirtypes.TimingType | None = Field( default=None, alias="timingTiming", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="User-visible title", description=( "The textual description of the action displayed to a user. For " "example, when the action is a test to be performed, the title would be" " the title of the test such as Assay by HPLC." ), json_schema_extra={ "element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) transform: fhirtypes.CanonicalType | None = Field( default=None, alias="transform", title="Transform to apply the template", description=( "A reference to a StructureMap resource that defines a transform that " "can be executed to produce the intent resource using the " "ActivityDefinition instance as the input." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureMap"], }, ) transform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_transform", title="Extension field for ``transform``." ) trigger: typing.List[fhirtypes.TriggerDefinitionType] | None = Field( default=None, alias="trigger", title="When the action should be triggered", description="A description of when the action should be triggered.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="create | update | remove | fire-event", description="The type of action to perform (create, update, remove).", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionAction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "prefix", "title", "description", "textEquivalent", "priority", "code", "reason", "documentation", "goalId", "subjectCodeableConcept", "subjectReference", "subjectCanonical", "trigger", "condition", "input", "output", "relatedAction", "timingDateTime", "timingAge", "timingPeriod", "timingDuration", "timingRange", "timingTiming", "participant", "type", "groupingBehavior", "selectionBehavior", "requiredBehavior", "precheckBehavior", "cardinalityBehavior", "definitionCanonical", "definitionUri", "transform", "dynamicValue", "action", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "definition": ["definitionCanonical", "definitionUri"], "subject": [ "subjectCanonical", "subjectCodeableConcept", "subjectReference", ], "timing": [ "timingAge", "timingDateTime", "timingDuration", "timingPeriod", "timingRange", "timingTiming", ], } return one_of_many_fields class PlanDefinitionActionCondition(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Whether or not the action is applicable. An expression that describes applicability criteria or start/stop conditions for the action. """ __resource_type__ = "PlanDefinitionActionCondition" expression: fhirtypes.ExpressionType | None = Field( default=None, alias="expression", title="Boolean-valued expression", description=( "An expression that returns true or false, indicating whether the " "condition is satisfied." ), json_schema_extra={ "element_property": True, }, ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title="applicability | start | stop", description="The kind of condition.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["applicability", "start", "stop"], }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionActionCondition`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "kind", "expression"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionCondition`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("kind", "kind__ext")] return required_fields class PlanDefinitionActionDynamicValue(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Dynamic aspects of the definition. Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result. """ __resource_type__ = "PlanDefinitionActionDynamicValue" expression: fhirtypes.ExpressionType | None = Field( default=None, alias="expression", title="An expression that provides the dynamic value for the customization", description="An expression specifying the value of the customized element.", json_schema_extra={ "element_property": True, }, ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="The path to the element to be set dynamically", description=( "The path to the element to be customized. This is the path on the " "resource that will hold the result of the calculation defined by the " "expression. The specified path SHALL be a FHIRPath resolveable on the " "specified target type of the ActivityDefinition, and SHALL consist " "only of identifiers, constant indexers, and a restricted subset of " "functions. The path is allowed to contain qualifiers (.) to traverse " "sub-elements, as well as indexers ([x]) to traverse multiple-" "cardinality sub-elements (see the [Simple FHIRPath " "Profile](fhirpath.html#simple) for full details)." ), json_schema_extra={ "element_property": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionActionDynamicValue`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "path", "expression"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionDynamicValue`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class PlanDefinitionActionParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who should participate in the action. Indicates who should participate in performing the action described. """ __resource_type__ = "PlanDefinitionActionParticipant" role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="E.g. Nurse, Surgeon, Parent", description=( "The role the participant should play in performing the described " "action." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="patient | practitioner | related-person | device", description="The type of participant in the action.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["patient", "practitioner", "related-person", "device"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionActionParticipant`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "role"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields class PlanDefinitionActionRelatedAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Relationship to another action. A relationship to another action such as "before" or "30-60 minutes after start of". """ __resource_type__ = "PlanDefinitionActionRelatedAction" actionId: fhirtypes.IdType | None = Field( default=None, alias="actionId", title="What action is this related to", description="The element id of the related action.", json_schema_extra={ "element_property": True, "element_required": True, }, ) actionId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_actionId", title="Extension field for ``actionId``." ) offsetDuration: fhirtypes.DurationType | None = Field( default=None, alias="offsetDuration", title="Time offset for the relationship", description=( "A duration or range of durations to apply to the relationship. For " "example, 30-60 minutes before." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e offset[x] "one_of_many": "offset", "one_of_many_required": False, }, ) offsetRange: fhirtypes.RangeType | None = Field( default=None, alias="offsetRange", title="Time offset for the relationship", description=( "A duration or range of durations to apply to the relationship. For " "example, 30-60 minutes before." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e offset[x] "one_of_many": "offset", "one_of_many_required": False, }, ) relationship: fhirtypes.CodeType | None = Field( default=None, alias="relationship", title=( "before-start | before | before-end | concurrent-with-start | " "concurrent | concurrent-with-end | after-start | after | after-end" ), description="The relationship of this action to the related action.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "before-start", "before", "before-end", "concurrent-with-start", "concurrent", "concurrent-with-end", "after-start", "after", "after-end", ], }, ) relationship__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_relationship", title="Extension field for ``relationship``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionActionRelatedAction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "actionId", "relationship", "offsetDuration", "offsetRange", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionRelatedAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("actionId", "actionId__ext"), ("relationship", "relationship__ext"), ] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"offset": ["offsetDuration", "offsetRange"]} return one_of_many_fields class PlanDefinitionGoal(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What the plan is trying to accomplish. A goal describes an expected outcome that activities within the plan are intended to achieve. For example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, meeting the acceptance criteria for a test as specified by a quality specification, etc. """ __resource_type__ = "PlanDefinitionGoal" addresses: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="addresses", title="What does the goal address", description=( "Identifies problems, conditions, issues, or concerns the goal is " "intended to address." ), json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="E.g. Treatment, dietary, behavioral", description="Indicates a category the goal falls within.", json_schema_extra={ "element_property": True, }, ) description: fhirtypes.CodeableConceptType = Field( default=..., alias="description", title="Code or text describing the goal", description=( "Human-readable and/or coded description of a specific desired " 'objective of care, such as "control blood pressure" or "negotiate an ' 'obstacle course" or "dance with child at wedding".' ), json_schema_extra={ "element_property": True, }, ) documentation: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="documentation", title="Supporting documentation for the goal", description=( "Didactic or other informational resources associated with the goal " "that provide further supporting information about the goal. " "Information resources can include inline text commentary and links to " "web resources." ), json_schema_extra={ "element_property": True, }, ) priority: fhirtypes.CodeableConceptType | None = Field( default=None, alias="priority", title="high-priority | medium-priority | low-priority", description=( "Identifies the expected level of importance associated with " "reaching/sustaining the defined goal." ), json_schema_extra={ "element_property": True, }, ) start: fhirtypes.CodeableConceptType | None = Field( default=None, alias="start", title="When goal pursuit begins", description="The event after which the goal should begin being pursued.", json_schema_extra={ "element_property": True, }, ) target: typing.List[fhirtypes.PlanDefinitionGoalTargetType] | None = Field( default=None, alias="target", title="Target outcome for the goal", description="Indicates what should be done and within what timeframe.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionGoal`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "category", "description", "priority", "start", "addresses", "documentation", "target", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionGoal`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class PlanDefinitionGoalTarget(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Target outcome for the goal. Indicates what should be done and within what timeframe. """ __resource_type__ = "PlanDefinitionGoalTarget" detailCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="detailCodeableConcept", title="The target value to be achieved", description=( "The target value of the measure to be achieved to signify fulfillment " "of the goal, e.g. 150 pounds or 7.0%, or in the case of pharmaceutical" " quality - NMT 0.6%, Clear solution, etc. Either the high or low or " "both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any value at or " "below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any value at or above the low " "value." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="detailQuantity", title="The target value to be achieved", description=( "The target value of the measure to be achieved to signify fulfillment " "of the goal, e.g. 150 pounds or 7.0%, or in the case of pharmaceutical" " quality - NMT 0.6%, Clear solution, etc. Either the high or low or " "both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any value at or " "below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any value at or above the low " "value." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailRange: fhirtypes.RangeType | None = Field( default=None, alias="detailRange", title="The target value to be achieved", description=( "The target value of the measure to be achieved to signify fulfillment " "of the goal, e.g. 150 pounds or 7.0%, or in the case of pharmaceutical" " quality - NMT 0.6%, Clear solution, etc. Either the high or low or " "both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any value at or " "below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any value at or above the low " "value." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) due: fhirtypes.DurationType | None = Field( default=None, alias="due", title="Reach goal within", description=( "Indicates the timeframe after the start of the goal in which the goal " "should be met." ), json_schema_extra={ "element_property": True, }, ) measure: fhirtypes.CodeableConceptType | None = Field( default=None, alias="measure", title="The parameter whose value is to be tracked", description=( "The parameter whose value is to be tracked, e.g. body weight, blood " "pressure, or hemoglobin A1c level." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionGoalTarget`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "measure", "detailQuantity", "detailRange", "detailCodeableConcept", "due", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionGoalTarget`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "detail": ["detailCodeableConcept", "detailQuantity", "detailRange"] } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/population.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Population Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, fhirtypes class Population(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A definition of a set of people that apply to some clinically related context, for example people contraindicated for a certain medication. A populatioof people with some set of grouping criteria. """ __resource_type__ = "Population" ageCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="ageCodeableConcept", title="The age of the specific population", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e age[x] "one_of_many": "age", "one_of_many_required": False, }, ) ageRange: fhirtypes.RangeType | None = Field( default=None, alias="ageRange", title="The age of the specific population", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e age[x] "one_of_many": "age", "one_of_many_required": False, }, ) gender: fhirtypes.CodeableConceptType | None = Field( default=None, alias="gender", title="The gender of the specific population", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) physiologicalCondition: fhirtypes.CodeableConceptType | None = Field( default=None, alias="physiologicalCondition", title=( "The existing physiological conditions of the specific population to " "which this applies" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) race: fhirtypes.CodeableConceptType | None = Field( default=None, alias="race", title="Race of the specific population", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Population`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "ageRange", "ageCodeableConcept", "gender", "race", "physiologicalCondition", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Population`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "ageRange", "ageCodeableConcept", "gender", "race", "physiologicalCondition", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"age": ["ageCodeableConcept", "ageRange"]} return one_of_many_fields ================================================ FILE: fhir/resources/R4B/practitioner.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Practitioner Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Practitioner(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A person with a formal responsibility in the provisioning of healthcare or related services. A person who is directly or indirectly involved in the provisioning of healthcare. """ __resource_type__ = "Practitioner" active: bool | None = Field( default=None, alias="active", title="Whether this practitioner's record is in active use", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) address: typing.List[fhirtypes.AddressType] | None = Field( default=None, alias="address", title=( "Address(es) of the practitioner that are not role specific (typically " "home address)" ), description=( "Address(es) of the practitioner that are not role specific (typically " "home address). Work addresses are not typically entered in this " "property as they are usually role dependent." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) birthDate: fhirtypes.DateType | None = Field( default=None, alias="birthDate", title="The date on which the practitioner was born", description="The date of birth for the practitioner.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) birthDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_birthDate", title="Extension field for ``birthDate``." ) communication: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="communication", title="A language the practitioner can use in patient communication", description=None, json_schema_extra={ "element_property": True, }, ) gender: fhirtypes.CodeType | None = Field( default=None, alias="gender", title="male | female | other | unknown", description=( "Administrative Gender - the gender that the person is considered to " "have for administration and record keeping purposes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["male", "female", "other", "unknown"], }, ) gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_gender", title="Extension field for ``gender``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="An identifier for the person as this agent", description="An identifier that applies to this person in this role.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: typing.List[fhirtypes.HumanNameType] | None = Field( default=None, alias="name", title="The name(s) associated with the practitioner", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) photo: typing.List[fhirtypes.AttachmentType] | None = Field( default=None, alias="photo", title="Image of the person", description=None, json_schema_extra={ "element_property": True, }, ) qualification: typing.List[fhirtypes.PractitionerQualificationType] | None = Field( default=None, alias="qualification", title=( "Certification, licenses, or training pertaining to the provision of " "care" ), description=( "The official certifications, training, and licenses that authorize or " "otherwise pertain to the provision of care by the practitioner. For " "example, a medical license issued by a medical board authorizing the " "practitioner to practice medicine within a certian locality." ), json_schema_extra={ "element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="A contact detail for the practitioner (that apply to all roles)", description=( "A contact detail for the practitioner, e.g. a telephone number or an " "email address." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Practitioner`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "name", "telecom", "address", "gender", "birthDate", "photo", "qualification", "communication", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Practitioner`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "active", "name", "telecom", "address", "gender", "birthDate", ] class PractitionerQualification(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Certification, licenses, or training pertaining to the provision of care. The official certifications, training, and licenses that authorize or otherwise pertain to the provision of care by the practitioner. For example, a medical license issued by a medical board authorizing the practitioner to practice medicine within a certian locality. """ __resource_type__ = "PractitionerQualification" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Coded representation of the qualification", description=None, json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="An identifier for this qualification for the practitioner", description=( "An identifier that applies to this person's qualification in this " "role." ), json_schema_extra={ "element_property": True, }, ) issuer: fhirtypes.ReferenceType | None = Field( default=None, alias="issuer", title="Organization that regulates and issues the qualification", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Period during which the qualification is valid", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PractitionerQualification`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "code", "period", "issuer", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PractitionerQualification`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/practitionerrole.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/PractitionerRole Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class PractitionerRole(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Roles/organizations the practitioner is associated with. A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time. """ __resource_type__ = "PractitionerRole" active: bool | None = Field( default=None, alias="active", title="Whether this practitioner role record is in active use", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) availabilityExceptions: fhirtypes.StringType | None = Field( default=None, alias="availabilityExceptions", title="Description of availability exceptions", description=( "A description of site availability exceptions, e.g. public holiday " "availability. Succinctly describing all possible exceptions to normal " "site availability as details in the available Times and not available " "Times." ), json_schema_extra={ "element_property": True, }, ) availabilityExceptions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_availabilityExceptions", title="Extension field for ``availabilityExceptions``.", ) availableTime: typing.List[ fhirtypes.PractitionerRoleAvailableTimeType ] | None = Field( default=None, alias="availableTime", title="Times the Service Site is available", description=( "A collection of times the practitioner is available or performing this" " role at the location and/or healthcareservice." ), json_schema_extra={ "element_property": True, }, ) code: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="code", title="Roles which this practitioner may perform", description=( "Roles which this practitioner is authorized to perform for the " "organization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title=( "Technical endpoints providing access to services operated for the " "practitioner with this role" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) healthcareService: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="healthcareService", title=( "The list of healthcare services that this worker provides for this " "role's Organization/Location(s)" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["HealthcareService"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifiers that are specific to a role/location", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) location: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="location", title="The location(s) at which this practitioner provides care", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) notAvailable: typing.List[ fhirtypes.PractitionerRoleNotAvailableType ] | None = Field( default=None, alias="notAvailable", title="Not available during this time due to provided reason", description=( "The practitioner is not available or performing this role during this " "period of time due to the provided reason." ), json_schema_extra={ "element_property": True, }, ) organization: fhirtypes.ReferenceType | None = Field( default=None, alias="organization", title="Organization where the roles are available", description="The organization where the Practitioner performs the roles associated.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title=( "The period during which the practitioner is authorized to perform in " "these role(s)" ), description=( "The period during which the person is authorized to act as a " "practitioner in these role(s) for the organization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) practitioner: fhirtypes.ReferenceType | None = Field( default=None, alias="practitioner", title=( "Practitioner that is able to provide the defined services for the " "organization" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialty", title="Specific specialty of the practitioner", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="Contact details that are specific to the role/location/service", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PractitionerRole`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "period", "practitioner", "organization", "code", "specialty", "location", "healthcareService", "telecom", "availableTime", "notAvailable", "availabilityExceptions", "endpoint", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PractitionerRole`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "active", "period", "practitioner", "organization", "code", "specialty", "location", "telecom", ] class PractitionerRoleAvailableTime(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Times the Service Site is available. A collection of times the practitioner is available or performing this role at the location and/or healthcareservice. """ __resource_type__ = "PractitionerRoleAvailableTime" allDay: bool | None = Field( default=None, alias="allDay", title="Always available? e.g. 24 hour service", description=( "Is this always available? (hence times are irrelevant) e.g. 24 hour " "service." ), json_schema_extra={ "element_property": True, }, ) allDay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allDay", title="Extension field for ``allDay``." ) availableEndTime: fhirtypes.TimeType | None = Field( default=None, alias="availableEndTime", title="Closing time of day (ignored if allDay = true)", description=( "The closing time of day. Note: If the AllDay flag is set, then this " "time is ignored." ), json_schema_extra={ "element_property": True, }, ) availableEndTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_availableEndTime", title="Extension field for ``availableEndTime``.", ) availableStartTime: fhirtypes.TimeType | None = Field( default=None, alias="availableStartTime", title="Opening time of day (ignored if allDay = true)", description=( "The opening time of day. Note: If the AllDay flag is set, then this " "time is ignored." ), json_schema_extra={ "element_property": True, }, ) availableStartTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_availableStartTime", title="Extension field for ``availableStartTime``.", ) daysOfWeek: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="daysOfWeek", title="mon | tue | wed | thu | fri | sat | sun", description=( "Indicates which days of the week are available between the start and " "end Times." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], }, ) daysOfWeek__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_daysOfWeek", title="Extension field for ``daysOfWeek``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PractitionerRoleAvailableTime`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "daysOfWeek", "allDay", "availableStartTime", "availableEndTime", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PractitionerRoleAvailableTime`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class PractitionerRoleNotAvailable(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Not available during this time due to provided reason. The practitioner is not available or performing this role during this period of time due to the provided reason. """ __resource_type__ = "PractitionerRoleNotAvailable" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Reason presented to the user explaining why time not available", description=( "The reason that can be presented to the user as to why this time is " "not available." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) during: fhirtypes.PeriodType | None = Field( default=None, alias="during", title="Service not available from this date", description=( "Service is not available (seasonally or for a public holiday) from " "this date." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PractitionerRoleNotAvailable`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "description", "during"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PractitionerRoleNotAvailable`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("description", "description__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/procedure.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Procedure Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Procedure(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An action that is being or was performed on a patient. An action that is or was performed on or for a patient. This can be a physical intervention like an operation, or less invasive like long term services, counseling, or hypnotherapy. """ __resource_type__ = "Procedure" asserter: fhirtypes.ReferenceType | None = Field( default=None, alias="asserter", title="Person who asserts this procedure", description="Individual who is making the procedure statement.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "RelatedPerson", "Practitioner", "PractitionerRole", ], }, ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="A request for this procedure", description=( "A reference to a resource that contains details of the request for " "this procedure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CarePlan", "ServiceRequest"], }, ) bodySite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="bodySite", title="Target body sites", description=( "Detailed and structured anatomical location information. Multiple " "locations are allowed - e.g. multiple punch biopsies of a lesion." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Classification of the procedure", description=( "A code that classifies the procedure for searching, sorting and " 'display purposes (e.g. "Surgical Procedure").' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Identification of the procedure", description=( "The specific procedure that is performed. Use text if the exact nature" ' of the procedure cannot be coded (e.g. "Laparoscopic Appendectomy").' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) complication: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="complication", title="Complication following the procedure", description=( "Any complications that occurred during the procedure, or in the " "immediate post-performance period. These are generally tracked " "separately from the notes, which will typically describe the procedure" " itself rather than any 'post procedure' issues." ), json_schema_extra={ "element_property": True, }, ) complicationDetail: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="complicationDetail", title="A condition that is a result of the procedure", description=( "Any complications that occurred during the procedure, or in the " "immediate post-performance period." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter created as part of", description=( "The Encounter during which this Procedure was created or performed or " "to which the creation of this record is tightly associated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) focalDevice: typing.List[fhirtypes.ProcedureFocalDeviceType] | None = Field( default=None, alias="focalDevice", title="Manipulated, implanted, or removed device", description=( "A device that is implanted, removed or otherwise manipulated " "(calibration, battery replacement, fitting a prosthesis, attaching a " "wound-vac, etc.) as a focal portion of the Procedure." ), json_schema_extra={ "element_property": True, }, ) followUp: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="followUp", title="Instructions for follow up", description=( "If the procedure required specific follow up - e.g. removal of " "sutures. The follow up may be represented as a simple note or could " "potentially be more complex, in which case the CarePlan resource can " "be used." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Identifiers for this procedure", description=( "Business identifiers assigned to this procedure by the performer or " "other systems which remain constant as the resource is updated and is " "propagated from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="instantiatesCanonical", title="Instantiates FHIR protocol or definition", description=( "The URL pointing to a FHIR-defined protocol, guideline, order set or " "other definition that is adhered to in whole or in part by this " "Procedure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "PlanDefinition", "ActivityDefinition", "Measure", "OperationDefinition", "Questionnaire", ], }, ) instantiatesCanonical__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="instantiatesUri", title="Instantiates external protocol or definition", description=( "The URL pointing to an externally maintained protocol, guideline, " "order set or other definition that is adhered to in whole or in part " "by this Procedure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where the procedure happened", description=( "The location where the procedure actually happened. E.g. a newborn at" " home, a tracheostomy at a restaurant." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Additional information about the procedure", description="Any other notes and comments about the procedure.", json_schema_extra={ "element_property": True, }, ) outcome: fhirtypes.CodeableConceptType | None = Field( default=None, alias="outcome", title="The result of procedure", description=( "The outcome of the procedure - did it resolve the reasons for the " "procedure being performed?" ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced event", description=( "A larger event of which this particular procedure is a component or " "step." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Procedure", "Observation", "MedicationAdministration", ], }, ) performedAge: fhirtypes.AgeType | None = Field( default=None, alias="performedAge", title="When the procedure was performed", description=( "Estimated or actual date, date-time, period, or age when the procedure" " was performed. Allows a period to support complex procedures that " "span more than one date, and also allows for the length of the " "procedure to be captured." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e performed[x] "one_of_many": "performed", "one_of_many_required": False, }, ) performedDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="performedDateTime", title="When the procedure was performed", description=( "Estimated or actual date, date-time, period, or age when the procedure" " was performed. Allows a period to support complex procedures that " "span more than one date, and also allows for the length of the " "procedure to be captured." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e performed[x] "one_of_many": "performed", "one_of_many_required": False, }, ) performedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_performedDateTime", title="Extension field for ``performedDateTime``.", ) performedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="performedPeriod", title="When the procedure was performed", description=( "Estimated or actual date, date-time, period, or age when the procedure" " was performed. Allows a period to support complex procedures that " "span more than one date, and also allows for the length of the " "procedure to be captured." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e performed[x] "one_of_many": "performed", "one_of_many_required": False, }, ) performedRange: fhirtypes.RangeType | None = Field( default=None, alias="performedRange", title="When the procedure was performed", description=( "Estimated or actual date, date-time, period, or age when the procedure" " was performed. Allows a period to support complex procedures that " "span more than one date, and also allows for the length of the " "procedure to be captured." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e performed[x] "one_of_many": "performed", "one_of_many_required": False, }, ) performedString: fhirtypes.StringType | None = Field( default=None, alias="performedString", title="When the procedure was performed", description=( "Estimated or actual date, date-time, period, or age when the procedure" " was performed. Allows a period to support complex procedures that " "span more than one date, and also allows for the length of the " "procedure to be captured." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e performed[x] "one_of_many": "performed", "one_of_many_required": False, }, ) performedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_performedString", title="Extension field for ``performedString``.", ) performer: typing.List[fhirtypes.ProcedurePerformerType] | None = Field( default=None, alias="performer", title="The people who performed the procedure", description='Limited to "real" people rather than equipment.', json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Coded reason procedure performed", description=( "The coded reason why the procedure was performed. This may be a coded " "entity of some type, or may simply be present as text." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="The justification that the procedure was performed", description="The justification of why the procedure was performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "Procedure", "DiagnosticReport", "DocumentReference", ], }, ) recorder: fhirtypes.ReferenceType | None = Field( default=None, alias="recorder", title="Who recorded the procedure", description=( "Individual who recorded the record and takes responsibility for its " "content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "RelatedPerson", "Practitioner", "PractitionerRole", ], }, ) report: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="report", title="Any report resulting from the procedure", description=( "This could be a histology result, pathology report, surgical report, " "etc." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "DiagnosticReport", "DocumentReference", "Composition", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "preparation | in-progress | not-done | on-hold | stopped | completed |" " entered-in-error | unknown" ), description=( "A code specifying the state of the procedure. Generally, this will be " "the in-progress or completed state." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "preparation", "in-progress", "not-done", "on-hold", "stopped", "completed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="statusReason", title="Reason for current status", description="Captures the reason for the current state of the procedure.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who the procedure was performed on", description="The person, animal or group on which the procedure was performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) usedCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="usedCode", title="Coded items used during the procedure", description="Identifies coded items that were used as part of the procedure.", json_schema_extra={ "element_property": True, }, ) usedReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="usedReference", title="Items used during procedure", description=( "Identifies medications, devices and any other substance used as part " "of the procedure." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device", "Medication", "Substance"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Procedure`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "partOf", "status", "statusReason", "category", "code", "subject", "encounter", "performedDateTime", "performedPeriod", "performedString", "performedAge", "performedRange", "recorder", "asserter", "performer", "location", "reasonCode", "reasonReference", "bodySite", "outcome", "report", "complication", "complicationDetail", "followUp", "note", "focalDevice", "usedReference", "usedCode", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Procedure`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "partOf", "status", "statusReason", "category", "code", "subject", "encounter", "performedDateTime", "performedPeriod", "performedString", "performedAge", "performedRange", "recorder", "asserter", "performer", "location", "reasonCode", "reasonReference", "bodySite", "outcome", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "performed": [ "performedAge", "performedDateTime", "performedPeriod", "performedRange", "performedString", ] } return one_of_many_fields class ProcedureFocalDevice(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Manipulated, implanted, or removed device. A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure. """ __resource_type__ = "ProcedureFocalDevice" action: fhirtypes.CodeableConceptType | None = Field( default=None, alias="action", title="Kind of change to device", description="The kind of change that happened to the device during the procedure.", json_schema_extra={ "element_property": True, }, ) manipulated: fhirtypes.ReferenceType = Field( default=..., alias="manipulated", title="Device that was changed", description="The device that was manipulated (changed) during the procedure.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ProcedureFocalDevice`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "action", "manipulated"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ProcedureFocalDevice`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ProcedurePerformer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The people who performed the procedure. Limited to "real" people rather than equipment. """ __resource_type__ = "ProcedurePerformer" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="The reference to the practitioner", description="The practitioner who was involved in the procedure.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Patient", "RelatedPerson", "Device", ], }, ) function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="Type of performance", description=( "Distinguishes the type of involvement of the performer in the " "procedure. For example, surgeon, anaesthetist, endoscopist." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) onBehalfOf: fhirtypes.ReferenceType | None = Field( default=None, alias="onBehalfOf", title="Organization the device or practitioner was acting for", description="The organization the device or practitioner was acting on behalf of.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ProcedurePerformer`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "function", "actor", "onBehalfOf", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ProcedurePerformer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "function", "actor"] ================================================ FILE: fhir/resources/R4B/prodcharacteristic.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ProdCharacteristic Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, fhirtypes class ProdCharacteristic(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The marketing status describes the date when a medicinal product is actually put on the market or the date as of which it is no longer available. """ __resource_type__ = "ProdCharacteristic" color: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="color", title=( "Where applicable, the color can be specified An appropriate controlled" " vocabulary shall be used The term and the term identifier shall be " "used" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) color__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_color", title="Extension field for ``color``." ) depth: fhirtypes.QuantityType | None = Field( default=None, alias="depth", title=( "Where applicable, the depth can be specified using a numerical value " "and its unit of measurement The unit of measurement shall be specified" " in accordance with ISO 11240 and the resulting terminology The symbol" " and the symbol identifier shall be used" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) externalDiameter: fhirtypes.QuantityType | None = Field( default=None, alias="externalDiameter", title=( "Where applicable, the external diameter can be specified using a " "numerical value and its unit of measurement The unit of measurement " "shall be specified in accordance with ISO 11240 and the resulting " "terminology The symbol and the symbol identifier shall be used" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) height: fhirtypes.QuantityType | None = Field( default=None, alias="height", title=( "Where applicable, the height can be specified using a numerical value " "and its unit of measurement The unit of measurement shall be specified" " in accordance with ISO 11240 and the resulting terminology The symbol" " and the symbol identifier shall be used" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) image: typing.List[fhirtypes.AttachmentType] | None = Field( default=None, alias="image", title=( "Where applicable, the image can be provided The format of the image " "attachment shall be specified by regional implementations" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) imprint: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="imprint", title="Where applicable, the imprint can be specified as text", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) imprint__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_imprint", title="Extension field for ``imprint``." ) nominalVolume: fhirtypes.QuantityType | None = Field( default=None, alias="nominalVolume", title=( "Where applicable, the nominal volume can be specified using a " "numerical value and its unit of measurement The unit of measurement " "shall be specified in accordance with ISO 11240 and the resulting " "terminology The symbol and the symbol identifier shall be used" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) scoring: fhirtypes.CodeableConceptType | None = Field( default=None, alias="scoring", title=( "Where applicable, the scoring can be specified An appropriate " "controlled vocabulary shall be used The term and the term identifier " "shall be used" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) shape: fhirtypes.StringType | None = Field( default=None, alias="shape", title=( "Where applicable, the shape can be specified An appropriate controlled" " vocabulary shall be used The term and the term identifier shall be " "used" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) shape__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_shape", title="Extension field for ``shape``." ) weight: fhirtypes.QuantityType | None = Field( default=None, alias="weight", title=( "Where applicable, the weight can be specified using a numerical value " "and its unit of measurement The unit of measurement shall be specified" " in accordance with ISO 11240 and the resulting terminology The symbol" " and the symbol identifier shall be used" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) width: fhirtypes.QuantityType | None = Field( default=None, alias="width", title=( "Where applicable, the width can be specified using a numerical value " "and its unit of measurement The unit of measurement shall be specified" " in accordance with ISO 11240 and the resulting terminology The symbol" " and the symbol identifier shall be used" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ProdCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "height", "width", "depth", "weight", "nominalVolume", "externalDiameter", "shape", "color", "imprint", "image", "scoring", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ProdCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "height", "width", "depth", "weight", "nominalVolume", "externalDiameter", "shape", "color", "imprint", "image", "scoring", ] ================================================ FILE: fhir/resources/R4B/productshelflife.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ProductShelfLife Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, fhirtypes class ProductShelfLife(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The shelf-life and storage information for a medicinal product item or container can be described using this class. """ __resource_type__ = "ProductShelfLife" identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Unique identifier for the packaged Medicinal Product", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) period: fhirtypes.QuantityType = Field( default=..., alias="period", title=( "The shelf life time period can be specified using a numerical value " "for the period of time and its unit of time measurement The unit of " "measurement shall be specified in accordance with ISO 11240 and the " "resulting terminology The symbol and the symbol identifier shall be " "used" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) specialPrecautionsForStorage: typing.List[ fhirtypes.CodeableConceptType ] | None = Field( default=None, alias="specialPrecautionsForStorage", title=( "Special precautions for storage, if any, can be specified using an " "appropriate controlled vocabulary The controlled term and the " "controlled term identifier shall be specified" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title=( "This describes the shelf life, taking into account various scenarios " "such as shelf life of the packaged Medicinal Product itself, shelf " "life after transformation where necessary and shelf life after the " "first opening of a bottle, etc. The shelf life type shall be specified" " using an appropriate controlled vocabulary The controlled term and " "the controlled term identifier shall be specified" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ProductShelfLife`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "type", "period", "specialPrecautionsForStorage", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ProductShelfLife`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "identifier", "type", "period", "specialPrecautionsForStorage", ] ================================================ FILE: fhir/resources/R4B/provenance.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Provenance Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Provenance(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who, What, When for a set of resources. Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies. """ __resource_type__ = "Provenance" activity: fhirtypes.CodeableConceptType | None = Field( default=None, alias="activity", title="Activity that occurred", description=( "An activity is something that occurs over a period of time and acts " "upon or with entities; it may include consuming, processing, " "transforming, modifying, relocating, using, or generating entities." ), json_schema_extra={ "element_property": True, }, ) agent: typing.List[fhirtypes.ProvenanceAgentType] = Field( default=..., alias="agent", title="Actor involved", description=( "An actor taking a role in an activity for which it can be assigned " "some degree of responsibility for the activity taking place." ), json_schema_extra={ "element_property": True, }, ) entity: typing.List[fhirtypes.ProvenanceEntityType] | None = Field( default=None, alias="entity", title="An entity used in this activity", description=None, json_schema_extra={ "element_property": True, }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where the activity occurred, if relevant", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) occurredDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurredDateTime", title="When the activity occurred", description="The period during which the activity occurred.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e occurred[x] "one_of_many": "occurred", "one_of_many_required": False, }, ) occurredDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurredDateTime", title="Extension field for ``occurredDateTime``.", ) occurredPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurredPeriod", title="When the activity occurred", description="The period during which the activity occurred.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e occurred[x] "one_of_many": "occurred", "one_of_many_required": False, }, ) policy: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="policy", title="Policy or plan the activity was defined by", description=( "Policy or plan the activity was defined by. Typically, a single " "activity may have multiple applicable policy documents, such as " "patient consent, guarantor funding, etc." ), json_schema_extra={ "element_property": True, }, ) policy__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_policy", title="Extension field for ``policy``." ) reason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reason", title="Reason the activity is occurring", description="The reason that the activity was taking place.", json_schema_extra={ "element_property": True, }, ) recorded: fhirtypes.InstantType | None = Field( default=None, alias="recorded", title="When the activity was recorded / updated", description="The instant of time at which the activity was recorded.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) recorded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recorded", title="Extension field for ``recorded``." ) signature: typing.List[fhirtypes.SignatureType] | None = Field( default=None, alias="signature", title="Signature on target", description=( "A digital signature on the target Reference(s). The signer should " "match a Provenance.agent. The purpose of the signature is indicated." ), json_schema_extra={ "element_property": True, }, ) target: typing.List[fhirtypes.ReferenceType] = Field( default=..., alias="target", title="Target Reference(s) (usually version specific)", description=( "The Reference(s) that were generated or updated by the activity " "described in this resource. A provenance can point to more than one " "target if multiple resources were created/updated by the same " "activity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Provenance`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "target", "occurredPeriod", "occurredDateTime", "recorded", "policy", "location", "reason", "activity", "agent", "entity", "signature", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Provenance`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "target", "recorded"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("recorded", "recorded__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"occurred": ["occurredDateTime", "occurredPeriod"]} return one_of_many_fields class ProvenanceAgent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Actor involved. An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place. """ __resource_type__ = "ProvenanceAgent" onBehalfOf: fhirtypes.ReferenceType | None = Field( default=None, alias="onBehalfOf", title="Who the agent is representing", description="The individual, device, or organization for whom the change was made.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "RelatedPerson", "Patient", "Device", "Organization", ], }, ) role: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="role", title="What the agents role was", description=( "The function of the agent with respect to the activity. The security " "role enabling the agent with respect to the activity." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="How the agent participated", description="The participation the agent had with respect to the activity.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) who: fhirtypes.ReferenceType = Field( default=..., alias="who", title="Who participated", description="The individual, device or organization that participated in the event.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "RelatedPerson", "Patient", "Device", "Organization", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ProvenanceAgent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "role", "who", "onBehalfOf", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ProvenanceAgent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "who"] class ProvenanceEntity(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An entity used in this activity. """ __resource_type__ = "ProvenanceEntity" agent: typing.List[fhirtypes.ProvenanceAgentType] | None = Field( default=None, alias="agent", title="Entity is attributed to this agent", description=( "The entity is attributed to an agent to express the agent's " "responsibility for that entity, possibly along with other agents. This" " description can be understood as shorthand for saying that the agent " "was responsible for the activity which generated the entity." ), json_schema_extra={ "element_property": True, }, ) role: fhirtypes.CodeType | None = Field( default=None, alias="role", title="derivation | revision | quotation | source | removal", description="How the entity was used during the activity.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["derivation", "revision", "quotation", "source", "removal"], }, ) role__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_role", title="Extension field for ``role``." ) what: fhirtypes.ReferenceType = Field( default=..., alias="what", title="Identity of entity", description=( "Identity of the Entity used. May be a logical or physical uri and " "maybe absolute or relative." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ProvenanceEntity`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "role", "what", "agent"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ProvenanceEntity`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "role", "what"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("role", "role__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/quantity.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SimpleQuantity Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Quantity(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A measured or measurable amount. A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. """ __resource_type__ = "Quantity" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Coded form of the unit", description=( "A computer processable form of the unit in some unit representation " "system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) comparator: fhirtypes.CodeType | None = Field( default=None, alias="comparator", title="< | <= | >= | > - how to understand the value", description=( "How the value should be understood and represented - whether the " "actual value is greater or less than the stated value due to " 'measurement issues; e.g. if the comparator is "<" , then the real ' "value is < stated value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comparator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comparator", title="Extension field for ``comparator``." ) system: fhirtypes.UriType | None = Field( default=None, alias="system", title="System that defines coded unit form", description=( "The identification of the system that provides the coded form of the " "unit." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) unit: fhirtypes.StringType | None = Field( default=None, alias="unit", title="Unit representation", description="A human-readable form of the unit.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) unit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_unit", title="Extension field for ``unit``." ) value: fhirtypes.DecimalType | None = Field( default=None, alias="value", title="Numerical value (with implicit precision)", description=( "The value of the measured amount. The value includes an implicit " "precision in the presentation of the value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Quantity`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "value", "comparator", "unit", "system", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Quantity`` according to specification, with preserving the original sequence order. """ return ["value", "comparator", "unit", "system", "code"] ================================================ FILE: fhir/resources/R4B/questionnaire.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Questionnaire Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Questionnaire(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A structured set of questions. A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection. """ __resource_type__ = "Questionnaire" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the questionnaire was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) code: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="code", title="Concept that represents the overall questionnaire", description=( "An identifier for this question or group of questions in a particular " "terminology such as LOINC." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the questionnaire and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the questionnaire." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the questionnaire was published. " "The date must change when the business version changes and it must " "change if the status code changes. In addition, it should change when " "the substantive content of the questionnaire changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) derivedFrom: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="derivedFrom", title="Instantiates protocol or definition", description="The URL of a Questionnaire that this Questionnaire is based on.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Questionnaire"], }, ) derivedFrom__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_derivedFrom", title="Extension field for ``derivedFrom``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the questionnaire", description=( "A free text natural language description of the questionnaire from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the questionnaire is expected to be used", description=( "The period during which the questionnaire content was or is planned to" " be in active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this questionnaire is authored for " "testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the questionnaire", description=( "A formal identifier that is used to identify this questionnaire when " "it is represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) item: typing.List[fhirtypes.QuestionnaireItemType] | None = Field( default=None, alias="item", title="Questions and sections within the Questionnaire", description=( "A particular question, question grouping or display text that is part " "of the questionnaire." ), json_schema_extra={ "element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for questionnaire (if applicable)", description=( "A legal or geographic region in which the questionnaire is intended to" " be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the questionnaire was last reviewed", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this questionnaire (computer friendly)", description=( "A natural language name identifying the questionnaire. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the " "questionnaire." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this questionnaire is defined", description=( "Explanation of why this questionnaire is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this questionnaire. Enables tracking the life-cycle of " "the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subjectType: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="subjectType", title="Resource that can be subject of QuestionnaireResponse", description=( "The types of subjects that can be the subject of responses created for" " the questionnaire." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subjectType__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_subjectType", title="Extension field for ``subjectType``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this questionnaire (human friendly)", description="A short, descriptive, user-friendly title for the questionnaire.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this questionnaire, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this questionnaire when it is" " referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which at which an authoritative " "instance of this questionnaire is (or will be) published. This URL can" " be the target of a canonical reference. It SHALL remain the same when" " the questionnaire is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate questionnaire instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the questionnaire", description=( "The identifier that is used to identify this version of the " "questionnaire when it is referenced in a specification, model, design " "or instance. This is an arbitrary value managed by the questionnaire " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Questionnaire`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "derivedFrom", "status", "experimental", "subjectType", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "approvalDate", "lastReviewDate", "effectivePeriod", "code", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Questionnaire`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "subjectType", "date", "publisher", "contact", "useContext", "jurisdiction", "effectivePeriod", "code", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class QuestionnaireItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Questions and sections within the Questionnaire. A particular question, question grouping or display text that is part of the questionnaire. """ __resource_type__ = "QuestionnaireItem" answerOption: typing.List[ fhirtypes.QuestionnaireItemAnswerOptionType ] | None = Field( default=None, alias="answerOption", title="Permitted answer", description='One of the permitted answers for a "choice" or "open-choice" question.', json_schema_extra={ "element_property": True, }, ) answerValueSet: fhirtypes.CanonicalType | None = Field( default=None, alias="answerValueSet", title="Valueset containing permitted answers", description=( "A reference to a value set containing a list of codes representing " 'permitted answers for a "choice" or "open-choice" question.' ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) answerValueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerValueSet", title="Extension field for ``answerValueSet``.", ) code: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="code", title="Corresponding concept for this item in a terminology", description=( "A terminology code that corresponds to this group or question (e.g. a " "code from LOINC, which defines many questions and answers)." ), json_schema_extra={ "element_property": True, }, ) definition: fhirtypes.UriType | None = Field( default=None, alias="definition", title="ElementDefinition - details for the item", description=( "This element is a URI that refers to an " "[ElementDefinition](elementdefinition.html) that provides information " "about this item, including information that might otherwise be " "included in the instance of the Questionnaire resource. A detailed " "description of the construction of the URI is shown in Comments, " "below. If this element is present then the following element values " "MAY be derived from the Element Definition if the corresponding " "elements of this Questionnaire resource instance have no value: * " "code (ElementDefinition.code) * type (ElementDefinition.type) * " "required (ElementDefinition.min) * repeats (ElementDefinition.max) *" " maxLength (ElementDefinition.maxLength) * answerValueSet " "(ElementDefinition.binding) * options (ElementDefinition.binding)." ), json_schema_extra={ "element_property": True, }, ) definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) enableBehavior: fhirtypes.CodeType | None = Field( default=None, alias="enableBehavior", title="all | any", description=( "Controls how multiple enableWhen values are interpreted - whether all" " or any must be true." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["all", "any"], }, ) enableBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_enableBehavior", title="Extension field for ``enableBehavior``.", ) enableWhen: typing.List[fhirtypes.QuestionnaireItemEnableWhenType] | None = Field( default=None, alias="enableWhen", title="Only allow data when", description=( "A constraint indicating that this item should only be enabled " "(displayed/allow answers to be captured) when the specified condition " "is true." ), json_schema_extra={ "element_property": True, }, ) initial: typing.List[fhirtypes.QuestionnaireItemInitialType] | None = Field( default=None, alias="initial", title="Initial value(s) when item is first rendered", description=( "One or more values that should be pre-populated in the answer when " "initially rendering the questionnaire for user input." ), json_schema_extra={ "element_property": True, }, ) item: typing.List[fhirtypes.QuestionnaireItemType] | None = Field( default=None, alias="item", title="Nested questionnaire items", description=( "Text, questions and other groups to be nested beneath a question or " "group." ), json_schema_extra={ "element_property": True, }, ) linkId: fhirtypes.StringType | None = Field( default=None, alias="linkId", title="Unique id for item in questionnaire", description=( "An identifier that is unique within the Questionnaire allowing linkage" " to the equivalent item in a QuestionnaireResponse resource." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) maxLength: fhirtypes.IntegerType | None = Field( default=None, alias="maxLength", title="No more than this many characters", description=( "The maximum number of characters that are permitted in the answer to " 'be considered a "valid" QuestionnaireResponse.' ), json_schema_extra={ "element_property": True, }, ) maxLength__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxLength", title="Extension field for ``maxLength``." ) prefix: fhirtypes.StringType | None = Field( default=None, alias="prefix", title='E.g. "1(a)", "2.5.3"', description=( "A short label for a particular group, question or set of display text " "within the questionnaire used for reference by the individual " "completing the questionnaire." ), json_schema_extra={ "element_property": True, }, ) prefix__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_prefix", title="Extension field for ``prefix``." ) readOnly: bool | None = Field( default=None, alias="readOnly", title="Don't allow human editing", description=( "An indication, when true, that the value cannot be changed by a human " "respondent to the Questionnaire." ), json_schema_extra={ "element_property": True, }, ) readOnly__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_readOnly", title="Extension field for ``readOnly``." ) repeats: bool | None = Field( default=None, alias="repeats", title="Whether the item may repeat", description=( "An indication, if true, that the item may occur multiple times in the " "response, collecting multiple answers for questions or multiple sets " "of answers for groups." ), json_schema_extra={ "element_property": True, }, ) repeats__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_repeats", title="Extension field for ``repeats``." ) required: bool | None = Field( default=None, alias="required", title="Whether the item must be included in data results", description=( 'An indication, if true, that the item must be present in a "completed"' " QuestionnaireResponse. If false, the item may be skipped when " "answering the questionnaire." ), json_schema_extra={ "element_property": True, }, ) required__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_required", title="Extension field for ``required``." ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Primary text for the item", description=( "The name of a section, the text of a question or text content for a " "display item." ), json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="group | display | boolean | decimal | integer | date | dateTime +", description=( "The type of questionnaire item this is - whether text for display, a " "grouping of other items or a particular type of data to be captured " "(string, integer, coded choice, etc.)." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "group", "display", "boolean", "decimal", "integer", "date", "dateTime", "+", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``QuestionnaireItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "linkId", "definition", "code", "prefix", "text", "type", "enableWhen", "enableBehavior", "required", "repeats", "readOnly", "maxLength", "answerValueSet", "answerOption", "initial", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``QuestionnaireItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("linkId", "linkId__ext"), ("type", "type__ext")] return required_fields class QuestionnaireItemAnswerOption(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Permitted answer. One of the permitted answers for a "choice" or "open-choice" question. """ __resource_type__ = "QuestionnaireItemAnswerOption" initialSelected: bool | None = Field( default=None, alias="initialSelected", title="Whether option is selected by default", description=( "Indicates whether the answer value is selected when the list of " "possible answers is initially shown." ), json_schema_extra={ "element_property": True, }, ) initialSelected__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_initialSelected", title="Extension field for ``initialSelected``.", ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Answer value", description="A potential answer that's allowed as the answer to this question.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="Answer value", description="A potential answer that's allowed as the answer to this question.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Answer value", description="A potential answer that's allowed as the answer to this question.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Answer value", description="A potential answer that's allowed as the answer to this question.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Answer value", description="A potential answer that's allowed as the answer to this question.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Answer value", description="A potential answer that's allowed as the answer to this question.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``QuestionnaireItemAnswerOption`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "valueInteger", "valueDate", "valueTime", "valueString", "valueCoding", "valueReference", "initialSelected", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``QuestionnaireItemAnswerOption`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueCoding", "valueDate", "valueInteger", "valueReference", "valueString", "valueTime", ] } return one_of_many_fields class QuestionnaireItemEnableWhen(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Only allow data when. A constraint indicating that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true. """ __resource_type__ = "QuestionnaireItemEnableWhen" answerBoolean: bool | None = Field( default=None, alias="answerBoolean", title="Value for question comparison based on operator", description=( "A value that the referenced question is tested using the specified " "operator in order for the item to be enabled." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": True, }, ) answerBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerBoolean", title="Extension field for ``answerBoolean``.", ) answerCoding: fhirtypes.CodingType | None = Field( default=None, alias="answerCoding", title="Value for question comparison based on operator", description=( "A value that the referenced question is tested using the specified " "operator in order for the item to be enabled." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": True, }, ) answerDate: fhirtypes.DateType | None = Field( default=None, alias="answerDate", title="Value for question comparison based on operator", description=( "A value that the referenced question is tested using the specified " "operator in order for the item to be enabled." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": True, }, ) answerDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerDate", title="Extension field for ``answerDate``." ) answerDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="answerDateTime", title="Value for question comparison based on operator", description=( "A value that the referenced question is tested using the specified " "operator in order for the item to be enabled." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": True, }, ) answerDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerDateTime", title="Extension field for ``answerDateTime``.", ) answerDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="answerDecimal", title="Value for question comparison based on operator", description=( "A value that the referenced question is tested using the specified " "operator in order for the item to be enabled." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": True, }, ) answerDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerDecimal", title="Extension field for ``answerDecimal``.", ) answerInteger: fhirtypes.IntegerType | None = Field( default=None, alias="answerInteger", title="Value for question comparison based on operator", description=( "A value that the referenced question is tested using the specified " "operator in order for the item to be enabled." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": True, }, ) answerInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerInteger", title="Extension field for ``answerInteger``.", ) answerQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="answerQuantity", title="Value for question comparison based on operator", description=( "A value that the referenced question is tested using the specified " "operator in order for the item to be enabled." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": True, }, ) answerReference: fhirtypes.ReferenceType | None = Field( default=None, alias="answerReference", title="Value for question comparison based on operator", description=( "A value that the referenced question is tested using the specified " "operator in order for the item to be enabled." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) answerString: fhirtypes.StringType | None = Field( default=None, alias="answerString", title="Value for question comparison based on operator", description=( "A value that the referenced question is tested using the specified " "operator in order for the item to be enabled." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": True, }, ) answerString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerString", title="Extension field for ``answerString``.", ) answerTime: fhirtypes.TimeType | None = Field( default=None, alias="answerTime", title="Value for question comparison based on operator", description=( "A value that the referenced question is tested using the specified " "operator in order for the item to be enabled." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": True, }, ) answerTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerTime", title="Extension field for ``answerTime``." ) operator: fhirtypes.CodeType | None = Field( default=None, alias="operator", title="exists | = | != | > | < | >= | <=", description="Specifies the criteria by which the question is enabled.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "exists", "=", "!=", "\u003e", "\u003c", "\u003e=", "\u003c=", ], }, ) operator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_operator", title="Extension field for ``operator``." ) question: fhirtypes.StringType | None = Field( default=None, alias="question", title="Question that determines whether item is enabled", description=( "The linkId for the question whose answer (or lack of answer) governs " "whether this item is enabled." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) question__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_question", title="Extension field for ``question``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``QuestionnaireItemEnableWhen`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "question", "operator", "answerBoolean", "answerDecimal", "answerInteger", "answerDate", "answerDateTime", "answerTime", "answerString", "answerCoding", "answerQuantity", "answerReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``QuestionnaireItemEnableWhen`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("operator", "operator__ext"), ("question", "question__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "answer": [ "answerBoolean", "answerCoding", "answerDate", "answerDateTime", "answerDecimal", "answerInteger", "answerQuantity", "answerReference", "answerString", "answerTime", ] } return one_of_many_fields class QuestionnaireItemInitial(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Initial value(s) when item is first rendered. One or more values that should be pre-populated in the answer when initially rendering the questionnaire for user input. """ __resource_type__ = "QuestionnaireItemInitial" valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Actual value for initializing the question", description="The actual value to for an initial answer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Actual value for initializing the question", description="The actual value to for an initial answer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Actual value for initializing the question", description="The actual value to for an initial answer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="Actual value for initializing the question", description="The actual value to for an initial answer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Actual value for initializing the question", description="The actual value to for an initial answer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Actual value for initializing the question", description="The actual value to for an initial answer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Actual value for initializing the question", description="The actual value to for an initial answer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Actual value for initializing the question", description="The actual value to for an initial answer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Actual value for initializing the question", description="The actual value to for an initial answer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Actual value for initializing the question", description="The actual value to for an initial answer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Actual value for initializing the question", description="The actual value to for an initial answer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="Actual value for initializing the question", description="The actual value to for an initial answer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``QuestionnaireItemInitial`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "valueBoolean", "valueDecimal", "valueInteger", "valueDate", "valueDateTime", "valueTime", "valueString", "valueUri", "valueAttachment", "valueCoding", "valueQuantity", "valueReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``QuestionnaireItemInitial`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueBoolean", "valueCoding", "valueDate", "valueDateTime", "valueDecimal", "valueInteger", "valueQuantity", "valueReference", "valueString", "valueTime", "valueUri", ] } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/questionnaireresponse.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class QuestionnaireResponse(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A structured set of questions and their answers. A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to. """ __resource_type__ = "QuestionnaireResponse" author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="Person who received and recorded the answers", description=( "Person who received the answers to the questions in the " "QuestionnaireResponse and recorded them in the system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Practitioner", "PractitionerRole", "Patient", "RelatedPerson", "Organization", ], }, ) authored: fhirtypes.DateTimeType | None = Field( default=None, alias="authored", title="Date the answers were gathered", description="The date and/or time that this set of answers were last changed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authored__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authored", title="Extension field for ``authored``." ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Request fulfilled by this QuestionnaireResponse", description=( "The order, proposal or plan that is fulfilled in whole or in part by " "this QuestionnaireResponse. For example, a ServiceRequest seeking an " "intake assessment or a decision support recommendation to assess for " "post-partum depression." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CarePlan", "ServiceRequest"], }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter created as part of", description=( "The Encounter during which this questionnaire response was created or " "to which the creation of this record is tightly associated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Unique id for this set of answers", description=( "A business identifier assigned to a particular completed (or partially" " completed) questionnaire." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) item: typing.List[fhirtypes.QuestionnaireResponseItemType] | None = Field( default=None, alias="item", title="Groups and questions", description=( "A group or question item from the original questionnaire for which " "answers are provided." ), json_schema_extra={ "element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of this action", description=( "A procedure or observation that this questionnaire was performed as " "part of the execution of. For example, the surgery a checklist was " "executed as part of." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Observation", "Procedure"], }, ) questionnaire: fhirtypes.CanonicalType | None = Field( default=None, alias="questionnaire", title="Form being answered", description=( "The Questionnaire that defines and organizes the questions for which " "answers are being provided." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Questionnaire"], }, ) questionnaire__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_questionnaire", title="Extension field for ``questionnaire``.", ) source: fhirtypes.ReferenceType | None = Field( default=None, alias="source", title="The person who answered the questions", description="The person who answered the questions about the subject.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="in-progress | completed | amended | entered-in-error | stopped", description=( "The position of the questionnaire response within its overall " "lifecycle." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "in-progress", "completed", "amended", "entered-in-error", "stopped", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="The subject of the questions", description=( "The subject of the questionnaire response. This could be a patient, " "organization, practitioner, device, etc. This is who/what the answers" " apply to, but is not necessarily the source of information." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``QuestionnaireResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "partOf", "questionnaire", "status", "subject", "encounter", "authored", "author", "source", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``QuestionnaireResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "basedOn", "partOf", "questionnaire", "status", "subject", "encounter", "authored", "author", "source", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class QuestionnaireResponseItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Groups and questions. A group or question item from the original questionnaire for which answers are provided. """ __resource_type__ = "QuestionnaireResponseItem" answer: typing.List[fhirtypes.QuestionnaireResponseItemAnswerType] | None = Field( default=None, alias="answer", title="The response(s) to the question", description="The respondent's answer(s) to the question.", json_schema_extra={ "element_property": True, }, ) definition: fhirtypes.UriType | None = Field( default=None, alias="definition", title="ElementDefinition - details for the item", description=( "A reference to an [ElementDefinition](elementdefinition.html) that " "provides the details for the item." ), json_schema_extra={ "element_property": True, }, ) definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) item: typing.List[fhirtypes.QuestionnaireResponseItemType] | None = Field( default=None, alias="item", title="Nested questionnaire response items", description="Questions or sub-groups nested beneath a question or group.", json_schema_extra={ "element_property": True, }, ) linkId: fhirtypes.StringType | None = Field( default=None, alias="linkId", title="Pointer to specific item from Questionnaire", description=( "The item from the Questionnaire that corresponds to this item in the " "QuestionnaireResponse resource." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Name for group or question text", description=( "Text that is displayed above the contents of the group or as the text " "of the question being answered." ), json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``QuestionnaireResponseItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "linkId", "definition", "text", "answer", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``QuestionnaireResponseItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("linkId", "linkId__ext")] return required_fields class QuestionnaireResponseItemAnswer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The response(s) to the question. The respondent's answer(s) to the question. """ __resource_type__ = "QuestionnaireResponseItemAnswer" item: typing.List[fhirtypes.QuestionnaireResponseItemType] | None = Field( default=None, alias="item", title="Nested groups and questions", description="Nested groups and/or questions found within this particular answer.", json_schema_extra={ "element_property": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``QuestionnaireResponseItemAnswer`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "valueBoolean", "valueDecimal", "valueInteger", "valueDate", "valueDateTime", "valueTime", "valueString", "valueUri", "valueAttachment", "valueCoding", "valueQuantity", "valueReference", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``QuestionnaireResponseItemAnswer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueBoolean", "valueCoding", "valueDate", "valueDateTime", "valueDecimal", "valueInteger", "valueQuantity", "valueReference", "valueString", "valueTime", "valueUri", ] } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/range.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Range Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Range(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Set of values bounded by low and high. A set of ordered Quantities defined by a low and high limit. """ __resource_type__ = "Range" high: fhirtypes.QuantityType | None = Field( default=None, alias="high", title="High limit", description="The high limit. The boundary is inclusive.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) low: fhirtypes.QuantityType | None = Field( default=None, alias="low", title="Low limit", description="The low limit. The boundary is inclusive.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Range`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "low", "high"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Range`` according to specification, with preserving the original sequence order. """ return ["low", "high"] ================================================ FILE: fhir/resources/R4B/ratio.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Ratio Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Ratio(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A ratio of two Quantity values - a numerator and a denominator. A relationship of two Quantity values - expressed as a numerator and a denominator. """ __resource_type__ = "Ratio" denominator: fhirtypes.QuantityType | None = Field( default=None, alias="denominator", title="Denominator value", description="The value of the denominator.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) numerator: fhirtypes.QuantityType | None = Field( default=None, alias="numerator", title="Numerator value", description="The value of the numerator.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Ratio`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "numerator", "denominator"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Ratio`` according to specification, with preserving the original sequence order. """ return ["numerator", "denominator"] ================================================ FILE: fhir/resources/R4B/ratiorange.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/RatioRange Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class RatioRange(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Range of ratio values. A range of ratios expressed as a low and high numerator and a denominator. """ __resource_type__ = "RatioRange" denominator: fhirtypes.QuantityType | None = Field( default=None, alias="denominator", title="Denominator value", description="The value of the denominator.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) highNumerator: fhirtypes.QuantityType | None = Field( default=None, alias="highNumerator", title="High Numerator limit", description="The value of the high limit numerator.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lowNumerator: fhirtypes.QuantityType | None = Field( default=None, alias="lowNumerator", title="Low Numerator limit", description="The value of the low limit numerator.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RatioRange`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "lowNumerator", "highNumerator", "denominator"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RatioRange`` according to specification, with preserving the original sequence order. """ return ["lowNumerator", "highNumerator", "denominator"] ================================================ FILE: fhir/resources/R4B/reference.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Reference Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Reference(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A reference from one resource to another. """ __resource_type__ = "Reference" display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Text alternative for the resource", description=( "Plain text narrative that identifies the resource in addition to the " "resource reference." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Logical reference, when literal reference is not known", description=( "An identifier for the target resource. This is used when there is no " "way to reference the other resource directly, either because the " "entity it represents is not available through a FHIR server, or " "because there is no way for the author of the resource to convert a " "known identifier to an actual location. There is no requirement that a" " Reference.identifier point to something that is actually exposed as a" " FHIR instance, but it SHALL point to a business concept that would be" " expected to be exposed as a FHIR instance, and that instance would " "need to be of a FHIR resource type allowed by the reference." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reference: fhirtypes.StringType | None = Field( default=None, alias="reference", title="Literal reference, Relative, internal or absolute URL", description=( "A reference to a location at which the other resource is found. The " "reference may be a relative reference, in which case it is relative to" " the service base URL, or an absolute URL that resolves to the " "location where the resource is found. The reference may be version " "specific or not. If the reference is not to a FHIR RESTful server, " "then it should be assumed to be version specific. Internal fragment " "references (start with '#') refer to contained resources." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reference", title="Extension field for ``reference``." ) type: fhirtypes.UriType | None = Field( default=None, alias="type", title='Type the reference refers to (e.g. "Patient")', description=( "The expected type of the target of the reference. If both " "Reference.type and Reference.reference are populated and " "Reference.reference is a FHIR URL, both SHALL be consistent. The type" " is the Canonical URL of Resource Definition that is the type this " "reference refers to. References are URLs that are relative to " 'http://hl7.org/fhir/StructureDefinition/ e.g. "Patient" is a reference' " to http://hl7.org/fhir/StructureDefinition/Patient. Absolute URLs are" " only allowed for logical models (and can only be used in references " "in logical models, not resources)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Reference`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "reference", "type", "identifier", "display"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Reference`` according to specification, with preserving the original sequence order. """ return ["reference", "type", "identifier", "display"] ================================================ FILE: fhir/resources/R4B/regulatedauthorization.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/RegulatedAuthorization Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class RegulatedAuthorization(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Regulatory approval, clearance or licencing related to a regulated product, treatment, facility or activity e.g. Market Authorization for a Medicinal Product. Regulatory approval, clearance or licencing related to a regulated product, treatment, facility or activity that is cited in a guidance, regulation, rule or legislative act. An example is Market Authorization relating to a Medicinal Product. """ __resource_type__ = "RegulatedAuthorization" basis: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="basis", title=( "The legal/regulatory framework or reasons under which this " "authorization is granted" ), description=( "The legal or regulatory framework against which this authorization is " "granted, or other reasons for it." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) case: fhirtypes.RegulatedAuthorizationCaseType | None = Field( default=None, alias="case", title=( "The case or regulatory procedure for granting or amending a regulated " "authorization. Note: This area is subject to ongoing review and the " "workgroup is seeking implementer feedback on its use (see link at " "bottom of page)" ), description=( "The case or regulatory procedure for granting or amending a regulated " "authorization. An authorization is granted in response to " "submissions/applications by those seeking authorization. A case is the" " administrative process that deals with the application(s) that relate" " to this and assesses them. Note: This area is subject to ongoing " "review and the workgroup is seeking implementer feedback on its use " "(see link at bottom of page)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="General textual supporting information", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) holder: fhirtypes.ReferenceType | None = Field( default=None, alias="holder", title=( "The organization that has been granted this authorization, by the " "regulator" ), description=( "The organization that has been granted this authorization, by some " "authoritative body (the 'regulator')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title=( "Business identifier for the authorization, typically assigned by the " "authorizing body" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) indication: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="indication", title="Condition for which the use of the regulated product applies", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ClinicalUseDefinition"], }, ) intendedUse: fhirtypes.CodeableConceptType | None = Field( default=None, alias="intendedUse", title="The intended use of the product, e.g. prevention, treatment", description=( "The intended use of the product, e.g. prevention, treatment, " "diagnosis." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) region: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="region", title="The territory in which the authorization has been granted", description=( "The territory (e.g., country, jurisdiction etc.) in which the " "authorization has been granted." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) regulator: fhirtypes.ReferenceType | None = Field( default=None, alias="regulator", title=( "The regulatory authority or authorizing body granting the " "authorization" ), description=( "The regulatory authority or authorizing body granting the " "authorization. For example, European Medicines Agency (EMA), Food and " "Drug Administration (FDA), Health Canada (HC), etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) status: fhirtypes.CodeableConceptType | None = Field( default=None, alias="status", title=( "The status that is authorised e.g. approved. Intermediate states can " "be tracked with cases and applications" ), description=( "The status that is authorised e.g. approved. Intermediate states and " "actions can be tracked with cases and applications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) statusDate: fhirtypes.DateTimeType | None = Field( default=None, alias="statusDate", title="The date at which the current status was assigned", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_statusDate", title="Extension field for ``statusDate``." ) subject: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="subject", title=( "The product type, treatment, facility or activity that is being " "authorized" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "MedicinalProductDefinition", "BiologicallyDerivedProduct", "NutritionProduct", "PackagedProductDefinition", "SubstanceDefinition", "DeviceDefinition", "ResearchStudy", "ActivityDefinition", "PlanDefinition", "ObservationDefinition", "Practitioner", "Organization", "Location", ], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title=( "Overall type of this authorization, for example drug marketing " "approval, orphan drug designation" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) validityPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="validityPeriod", title=( "The time period in which the regulatory approval etc. is in effect, " "e.g. a Marketing Authorization includes the date of authorization " "and/or expiration date" ), description=( "The time period in which the regulatory approval, clearance or " "licencing is in effect. As an example, a Marketing Authorization " "includes the date of authorization and/or an expiration date." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RegulatedAuthorization`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "subject", "type", "description", "region", "status", "statusDate", "validityPeriod", "indication", "intendedUse", "basis", "holder", "regulator", "case", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RegulatedAuthorization`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "subject", "type", "description", "region", "status", "statusDate", "validityPeriod", "indication", "intendedUse", "basis", "holder", "regulator", "case", ] class RegulatedAuthorizationCase(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The case or regulatory procedure for granting or amending a regulated authorization. Note: This area is subject to ongoing review and the workgroup is seeking implementer feedback on its use (see link at bottom of page). The case or regulatory procedure for granting or amending a regulated authorization. An authorization is granted in response to submissions/applications by those seeking authorization. A case is the administrative process that deals with the application(s) that relate to this and assesses them. Note: This area is subject to ongoing review and the workgroup is seeking implementer feedback on its use (see link at bottom of page). """ __resource_type__ = "RegulatedAuthorizationCase" application: typing.List[fhirtypes.RegulatedAuthorizationCaseType] | None = Field( default=None, alias="application", title=( "Applications submitted to obtain a regulated authorization. Steps " "within the longer running case or procedure" ), description=( "A regulatory submission from an organization to a regulator, as part " "of an assessing case. Multiple applications may occur over time, with " "more or different information to support or modify the submission or " "the authorization. The applications can be considered as steps within " "the longer running case or procedure for this authorization process." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dateDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="dateDateTime", title="Relevant date for this case", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e date[x] "one_of_many": "date", "one_of_many_required": False, }, ) dateDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dateDateTime", title="Extension field for ``dateDateTime``.", ) datePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="datePeriod", title="Relevant date for this case", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e date[x] "one_of_many": "date", "one_of_many_required": False, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Identifier by which this case can be referenced", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeableConceptType | None = Field( default=None, alias="status", title="The status associated with the case", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The defining type of case", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RegulatedAuthorizationCase`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "type", "status", "datePeriod", "dateDateTime", "application", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RegulatedAuthorizationCase`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "identifier", "type", "status", "datePeriod", "dateDateTime", "application", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"date": ["dateDateTime", "datePeriod"]} return one_of_many_fields ================================================ FILE: fhir/resources/R4B/relatedartifact.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/RelatedArtifact Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class RelatedArtifact(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Related artifacts for a knowledge resource. Related artifacts such as additional documentation, justification, or bibliographic references. """ __resource_type__ = "RelatedArtifact" citation: fhirtypes.MarkdownType | None = Field( default=None, alias="citation", title="Bibliographic citation for the artifact", description=( "A bibliographic citation for the related artifact. This text SHOULD be" " formatted according to an accepted citation format." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) citation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_citation", title="Extension field for ``citation``." ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Brief description of the related artifact", description=( "A brief description of the document or knowledge resource being " "referenced, suitable for display to a consumer." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) document: fhirtypes.AttachmentType | None = Field( default=None, alias="document", title="What document is being referenced", description=( "The document being referenced, represented as an attachment. This is " "exclusive with the resource element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) label: fhirtypes.StringType | None = Field( default=None, alias="label", title="Short label", description=( "A short label that can be used to reference the citation from " "elsewhere in the containing artifact, such as a footnote index." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_label", title="Extension field for ``label``." ) resource: fhirtypes.CanonicalType | None = Field( default=None, alias="resource", title="What resource is being referenced", description=( "The related resource, such as a library, value set, profile, or other " "knowledge resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resource", title="Extension field for ``resource``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "documentation | justification | citation | predecessor | successor | " "derived-from | depends-on | composed-of" ), description="The type of relationship to the related artifact.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "documentation", "justification", "citation", "predecessor", "successor", "derived-from", "depends-on", "composed-of", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) url: fhirtypes.UrlType | None = Field( default=None, alias="url", title="Where the artifact can be accessed", description=( "A url for the artifact that can be followed to access the actual " "content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RelatedArtifact`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "type", "label", "display", "citation", "url", "document", "resource", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RelatedArtifact`` according to specification, with preserving the original sequence order. """ return ["type", "label", "display", "citation", "url", "document", "resource"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/relatedperson.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/RelatedPerson Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class RelatedPerson(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A person that is related to a patient, but who is not a direct target of care. Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process. """ __resource_type__ = "RelatedPerson" active: bool | None = Field( default=None, alias="active", title="Whether this related person's record is in active use", description="Whether this related person record is in active use.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) address: typing.List[fhirtypes.AddressType] | None = Field( default=None, alias="address", title="Address where the related person can be contacted or visited", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) birthDate: fhirtypes.DateType | None = Field( default=None, alias="birthDate", title="The date on which the related person was born", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) birthDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_birthDate", title="Extension field for ``birthDate``." ) communication: typing.List[fhirtypes.RelatedPersonCommunicationType] | None = Field( default=None, alias="communication", title=( "A language which may be used to communicate with about the patient's " "health" ), description=None, json_schema_extra={ "element_property": True, }, ) gender: fhirtypes.CodeType | None = Field( default=None, alias="gender", title="male | female | other | unknown", description=( "Administrative Gender - the gender that the person is considered to " "have for administration and record keeping purposes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["male", "female", "other", "unknown"], }, ) gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_gender", title="Extension field for ``gender``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="A human identifier for this person", description="Identifier for a person within a particular scope.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: typing.List[fhirtypes.HumanNameType] | None = Field( default=None, alias="name", title="A name associated with the person", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="The patient this person is related to", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Period of time that this relationship is considered valid", description=( "The period of time during which this relationship is or was active. If" " there are no dates defined, then the interval is unknown." ), json_schema_extra={ "element_property": True, }, ) photo: typing.List[fhirtypes.AttachmentType] | None = Field( default=None, alias="photo", title="Image of the person", description=None, json_schema_extra={ "element_property": True, }, ) relationship: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="relationship", title="The nature of the relationship", description=( "The nature of the relationship between a patient and the related " "person." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="A contact detail for the person", description=( "A contact detail for the person, e.g. a telephone number or an email " "address." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RelatedPerson`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "patient", "relationship", "name", "telecom", "gender", "birthDate", "address", "photo", "period", "communication", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RelatedPerson`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "active", "patient", "relationship", "name", "telecom", "gender", "birthDate", "address", ] class RelatedPersonCommunication(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A language which may be used to communicate with about the patient's health. """ __resource_type__ = "RelatedPersonCommunication" language: fhirtypes.CodeableConceptType = Field( default=..., alias="language", title=( "The language which can be used to communicate with the patient about " "his or her health" ), description=( "The ISO-639-1 alpha 2 code in lower case for the language, optionally " "followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in" ' upper case; e.g. "en" for English, or "en-US" for American English ' 'versus "en-EN" for England English.' ), json_schema_extra={ "element_property": True, }, ) preferred: bool | None = Field( default=None, alias="preferred", title="Language preference indicator", description=( "Indicates whether or not the patient prefers this language (over other" " languages he masters up a certain level)." ), json_schema_extra={ "element_property": True, }, ) preferred__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preferred", title="Extension field for ``preferred``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RelatedPersonCommunication`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "language", "preferred"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RelatedPersonCommunication`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/requestgroup.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/RequestGroup Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class RequestGroup(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A group of related requests. A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one". """ __resource_type__ = "RequestGroup" action: typing.List[fhirtypes.RequestGroupActionType] | None = Field( default=None, alias="action", title="Proposed actions, if any", description="The actions, if any, produced by the evaluation of the artifact.", json_schema_extra={ "element_property": True, }, ) author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="Device or practitioner that authored the request group", description="Provides a reference to the author of the request group.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device", "Practitioner", "PractitionerRole"], }, ) authoredOn: fhirtypes.DateTimeType | None = Field( default=None, alias="authoredOn", title="When the request group was authored", description="Indicates when the request group was created.", json_schema_extra={ "element_property": True, }, ) authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoredOn", title="Extension field for ``authoredOn``." ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Fulfills plan, proposal, or order", description=( "A plan, proposal or order that is fulfilled in whole or in part by " "this request." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="What's being requested/ordered", description="A code that identifies what the overall request group is.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Created as part of", description="Describes the context of the request group, if any.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) groupIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="groupIdentifier", title="Composite request this is part of", description=( "A shared identifier common to all requests that were authorized more " "or less simultaneously by a single author, representing the identifier" " of the requisition, prescription or similar form." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description=( "Allows a service to provide a unique, business identifier for the " "request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="instantiatesCanonical", title="Instantiates FHIR protocol or definition", description=( "A canonical URL referencing a FHIR-defined protocol, guideline, " "orderset or other definition that is adhered to in whole or in part by" " this request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesCanonical__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="instantiatesUri", title="Instantiates external protocol or definition", description=( "A URL referencing an externally defined protocol, guideline, orderset " "or other definition that is adhered to in whole or in part by this " "request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) intent: fhirtypes.CodeType | None = Field( default=None, alias="intent", title=( "proposal | plan | directive | order | original-order | reflex-order | " "filler-order | instance-order | option" ), description=( "Indicates the level of authority/intentionality associated with the " "request and where the request fits into the workflow chain." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "proposal", "plan", "directive", "order", "original-order", "reflex-order", "filler-order", "instance-order", "option", ], }, ) intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intent", title="Extension field for ``intent``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Additional notes about the response", description=( "Provides a mechanism to communicate additional information about the " "response." ), json_schema_extra={ "element_property": True, }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Indicates how quickly the request should be addressed with respect to " "other requests." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Why the request group is needed", description="Describes the reason for the request group in coded or textual form.", json_schema_extra={ "element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Why the request group is needed", description=( "Indicates another resource whose existence justifies this request " "group." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "DiagnosticReport", "DocumentReference", ], }, ) replaces: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="replaces", title="Request(s) replaced by this request", description=( "Completed or terminated request(s) whose function is taken by this new" " request." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "draft | active | on-hold | revoked | completed | entered-in-error | " "unknown" ), description=( "The current state of the request. For request groups, the status " "reflects the status of all the requests in the group." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "draft", "active", "on-hold", "revoked", "completed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Who the request group is about", description="The subject for which the request group was created.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RequestGroup`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "replaces", "groupIdentifier", "status", "intent", "priority", "code", "subject", "encounter", "authoredOn", "author", "reasonCode", "reasonReference", "note", "action", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RequestGroup`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "instantiatesCanonical", "instantiatesUri", "groupIdentifier", "status", "intent", "priority", "code", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("intent", "intent__ext"), ("status", "status__ext")] return required_fields class RequestGroupAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Proposed actions, if any. The actions, if any, produced by the evaluation of the artifact. """ __resource_type__ = "RequestGroupAction" action: typing.List[fhirtypes.RequestGroupActionType] | None = Field( default=None, alias="action", title="Sub action", description="Sub actions.", json_schema_extra={ "element_property": True, }, ) cardinalityBehavior: fhirtypes.CodeType | None = Field( default=None, alias="cardinalityBehavior", title="single | multiple", description="Defines whether the action can be selected multiple times.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["single", "multiple"], }, ) cardinalityBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_cardinalityBehavior", title="Extension field for ``cardinalityBehavior``.", ) code: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="code", title="Code representing the meaning of the action or sub-actions", description=( "A code that provides meaning for the action or action group. For " "example, a section may have a LOINC code for a section of a " "documentation template." ), json_schema_extra={ "element_property": True, }, ) condition: typing.List[fhirtypes.RequestGroupActionConditionType] | None = Field( default=None, alias="condition", title="Whether or not the action is applicable", description=( "An expression that describes applicability criteria, or start/stop " "conditions for the action." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Short description of the action", description=( "A short description of the action used to provide a summary to display" " to the user." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) documentation: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="documentation", title="Supporting documentation for the intended performer of the action", description=( "Didactic or other informational resources associated with the action " "that can be provided to the CDS recipient. Information resources can " "include inline text commentary and links to web resources." ), json_schema_extra={ "element_property": True, }, ) groupingBehavior: fhirtypes.CodeType | None = Field( default=None, alias="groupingBehavior", title="visual-group | logical-group | sentence-group", description="Defines the grouping behavior for the action and its children.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["visual-group", "logical-group", "sentence-group"], }, ) groupingBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_groupingBehavior", title="Extension field for ``groupingBehavior``.", ) participant: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="participant", title="Who should perform the action", description="The participant that should perform or be responsible for this action.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Device", ], }, ) precheckBehavior: fhirtypes.CodeType | None = Field( default=None, alias="precheckBehavior", title="yes | no", description="Defines whether the action should usually be preselected.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["yes", "no"], }, ) precheckBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_precheckBehavior", title="Extension field for ``precheckBehavior``.", ) prefix: fhirtypes.StringType | None = Field( default=None, alias="prefix", title="User-visible prefix for the action (e.g. 1. or A.)", description="A user-visible prefix for the action.", json_schema_extra={ "element_property": True, }, ) prefix__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_prefix", title="Extension field for ``prefix``." ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Indicates how quickly the action should be addressed with respect to " "other actions." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) relatedAction: typing.List[ fhirtypes.RequestGroupActionRelatedActionType ] | None = Field( default=None, alias="relatedAction", title="Relationship to another action", description=( 'A relationship to another action such as "before" or "30-60 minutes ' 'after start of".' ), json_schema_extra={ "element_property": True, }, ) requiredBehavior: fhirtypes.CodeType | None = Field( default=None, alias="requiredBehavior", title="must | could | must-unless-documented", description="Defines expectations around whether an action is required.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["must", "could", "must-unless-documented"], }, ) requiredBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requiredBehavior", title="Extension field for ``requiredBehavior``.", ) resource: fhirtypes.ReferenceType | None = Field( default=None, alias="resource", title="The target of the action", description=( "The resource that is the target of the action (e.g. " "CommunicationRequest)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) selectionBehavior: fhirtypes.CodeType | None = Field( default=None, alias="selectionBehavior", title="any | all | all-or-none | exactly-one | at-most-one | one-or-more", description="Defines the selection behavior for the action and its children.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "any", "all", "all-or-none", "exactly-one", "at-most-one", "one-or-more", ], }, ) selectionBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_selectionBehavior", title="Extension field for ``selectionBehavior``.", ) textEquivalent: fhirtypes.StringType | None = Field( default=None, alias="textEquivalent", title=( "Static text equivalent of the action, used if the dynamic aspects " "cannot be interpreted by the receiving system" ), description=( "A text equivalent of the action to be performed. This provides a " "human-interpretable description of the action when the definition is " "consumed by a system that might not be capable of interpreting it " "dynamically." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) textEquivalent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_textEquivalent", title="Extension field for ``textEquivalent``.", ) timingAge: fhirtypes.AgeType | None = Field( default=None, alias="timingAge", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="timingDateTime", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timingDateTime", title="Extension field for ``timingDateTime``.", ) timingDuration: fhirtypes.DurationType | None = Field( default=None, alias="timingDuration", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="timingPeriod", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingRange: fhirtypes.RangeType | None = Field( default=None, alias="timingRange", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingTiming: fhirtypes.TimingType | None = Field( default=None, alias="timingTiming", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="User-visible title", description="The title of the action displayed to a user.", json_schema_extra={ "element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="create | update | remove | fire-event", description="The type of action to perform (create, update, remove).", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RequestGroupAction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "prefix", "title", "description", "textEquivalent", "priority", "code", "documentation", "condition", "relatedAction", "timingDateTime", "timingAge", "timingPeriod", "timingDuration", "timingRange", "timingTiming", "participant", "type", "groupingBehavior", "selectionBehavior", "requiredBehavior", "precheckBehavior", "cardinalityBehavior", "resource", "action", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RequestGroupAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "description", "textEquivalent"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "timing": [ "timingAge", "timingDateTime", "timingDuration", "timingPeriod", "timingRange", "timingTiming", ] } return one_of_many_fields class RequestGroupActionCondition(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Whether or not the action is applicable. An expression that describes applicability criteria, or start/stop conditions for the action. """ __resource_type__ = "RequestGroupActionCondition" expression: fhirtypes.ExpressionType | None = Field( default=None, alias="expression", title="Boolean-valued expression", description=( "An expression that returns true or false, indicating whether or not " "the condition is satisfied." ), json_schema_extra={ "element_property": True, }, ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title="applicability | start | stop", description="The kind of condition.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["applicability", "start", "stop"], }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RequestGroupActionCondition`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "kind", "expression"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RequestGroupActionCondition`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("kind", "kind__ext")] return required_fields class RequestGroupActionRelatedAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Relationship to another action. A relationship to another action such as "before" or "30-60 minutes after start of". """ __resource_type__ = "RequestGroupActionRelatedAction" actionId: fhirtypes.IdType | None = Field( default=None, alias="actionId", title="What action this is related to", description="The element id of the action this is related to.", json_schema_extra={ "element_property": True, "element_required": True, }, ) actionId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_actionId", title="Extension field for ``actionId``." ) offsetDuration: fhirtypes.DurationType | None = Field( default=None, alias="offsetDuration", title="Time offset for the relationship", description=( "A duration or range of durations to apply to the relationship. For " "example, 30-60 minutes before." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e offset[x] "one_of_many": "offset", "one_of_many_required": False, }, ) offsetRange: fhirtypes.RangeType | None = Field( default=None, alias="offsetRange", title="Time offset for the relationship", description=( "A duration or range of durations to apply to the relationship. For " "example, 30-60 minutes before." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e offset[x] "one_of_many": "offset", "one_of_many_required": False, }, ) relationship: fhirtypes.CodeType | None = Field( default=None, alias="relationship", title=( "before-start | before | before-end | concurrent-with-start | " "concurrent | concurrent-with-end | after-start | after | after-end" ), description="The relationship of this action to the related action.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "before-start", "before", "before-end", "concurrent-with-start", "concurrent", "concurrent-with-end", "after-start", "after", "after-end", ], }, ) relationship__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_relationship", title="Extension field for ``relationship``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RequestGroupActionRelatedAction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "actionId", "relationship", "offsetDuration", "offsetRange", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RequestGroupActionRelatedAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("actionId", "actionId__ext"), ("relationship", "relationship__ext"), ] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"offset": ["offsetDuration", "offsetRange"]} return one_of_many_fields ================================================ FILE: fhir/resources/R4B/researchdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ResearchDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class ResearchDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A research context or question. The ResearchDefinition resource describes the conditional state (population and any exposures being compared within the population) and outcome (if specified) that the knowledge (evidence, assertion, recommendation) is about. """ __resource_type__ = "ResearchDefinition" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the research definition was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the content", description=( "An individiual or organization primarily involved in the creation and " "maintenance of the content." ), json_schema_extra={ "element_property": True, }, ) comment: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="comment", title="Used for footnotes or explanatory notes", description=( "A human-readable string to clarify or explain concepts about the " "resource." ), json_schema_extra={ "element_property": True, }, ) comment__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the research definition and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the research definition." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the research definition was " "published. The date must change when the business version changes and " "it must change if the status code changes. In addition, it should " "change when the substantive content of the research definition " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the research definition", description=( "A free text natural language description of the research definition " "from a consumer's perspective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the content", description=( "An individual or organization primarily responsible for internal " "coherence of the content." ), json_schema_extra={ "element_property": True, }, ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the research definition is expected to be used", description=( "The period during which the research definition content was or is " "planned to be in active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the content", description=( "An individual or organization responsible for officially endorsing the" " content for use in some setting." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this research definition is authored " "for testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) exposure: fhirtypes.ReferenceType | None = Field( default=None, alias="exposure", title="What exposure?", description=( "A reference to a ResearchElementDefinition resource that defines the " "exposure for the research." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ResearchElementDefinition"], }, ) exposureAlternative: fhirtypes.ReferenceType | None = Field( default=None, alias="exposureAlternative", title="What alternative exposure state?", description=( "A reference to a ResearchElementDefinition resource that defines the " "exposureAlternative for the research." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ResearchElementDefinition"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the research definition", description=( "A formal identifier that is used to identify this research definition " "when it is represented in other formats, or referenced in a " "specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for research definition (if applicable)", description=( "A legal or geographic region in which the research definition is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the research definition was last reviewed", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) library: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="library", title="Logic used by the ResearchDefinition", description=( "A reference to a Library resource containing the formal logic used by " "the ResearchDefinition." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Library"], }, ) library__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_library", title="Extension field for ``library``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this research definition (computer friendly)", description=( "A natural language name identifying the research definition. This name" " should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) outcome: fhirtypes.ReferenceType | None = Field( default=None, alias="outcome", title="What outcome?", description=( "A reference to a ResearchElementDefinition resomece that defines the " "outcome for the research." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ResearchElementDefinition"], }, ) population: fhirtypes.ReferenceType = Field( default=..., alias="population", title="What population?", description=( "A reference to a ResearchElementDefinition resource that defines the " "population for the research." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ResearchElementDefinition"], }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the research" " definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this research definition is defined", description=( "Explanation of why this research definition is needed and why it has " "been designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Additional documentation, citations, etc.", description=( "Related artifacts such as additional documentation, justification, or " "bibliographic references." ), json_schema_extra={ "element_property": True, }, ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the content", description=( "An individual or organization primarily responsible for review of some" " aspect of the content." ), json_schema_extra={ "element_property": True, }, ) shortTitle: fhirtypes.StringType | None = Field( default=None, alias="shortTitle", title="Title for use in informal contexts", description=( "The short title provides an alternate title for use in informal " "descriptive contexts where the full, formal title is not necessary." ), json_schema_extra={ "element_property": True, }, ) shortTitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_shortTitle", title="Extension field for ``shortTitle``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this research definition. Enables tracking the life-" "cycle of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subjectCodeableConcept", title=( "E.g. Patient, Practitioner, RelatedPerson, Organization, Location, " "Device" ), description=( "The intended subjects for the ResearchDefinition. If this element is " "not provided, a Patient subject is assumed, but the subject of the " "ResearchDefinition can be anything." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, }, ) subjectReference: fhirtypes.ReferenceType | None = Field( default=None, alias="subjectReference", title=( "E.g. Patient, Practitioner, RelatedPerson, Organization, Location, " "Device" ), description=( "The intended subjects for the ResearchDefinition. If this element is " "not provided, a Patient subject is assumed, but the subject of the " "ResearchDefinition can be anything." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) subtitle: fhirtypes.StringType | None = Field( default=None, alias="subtitle", title="Subordinate title of the ResearchDefinition", description=( "An explanatory or alternate title for the ResearchDefinition giving " "additional information about its content." ), json_schema_extra={ "element_property": True, }, ) subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subtitle", title="Extension field for ``subtitle``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this research definition (human friendly)", description="A short, descriptive, user-friendly title for the research definition.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) topic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="topic", title=( "The category of the ResearchDefinition, such as Education, Treatment, " "Assessment, etc." ), description=( "Descriptive topics related to the content of the ResearchDefinition. " "Topics provide a high-level categorization grouping types of " "ResearchDefinitions that can be useful for filtering and searching." ), json_schema_extra={ "element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this research definition, represented as a " "URI (globally unique)" ), description=( "An absolute URI that is used to identify this research definition when" " it is referenced in a specification, model, design or an instance; " "also called its canonical identifier. This SHOULD be globally unique " "and SHOULD be a literal address at which at which an authoritative " "instance of this research definition is (or will be) published. This " "URL can be the target of a canonical reference. It SHALL remain the " "same when the research definition is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) usage: fhirtypes.StringType | None = Field( default=None, alias="usage", title="Describes the clinical usage of the ResearchDefinition", description=( "A detailed description, from a clinical perspective, of how the " "ResearchDefinition is used." ), json_schema_extra={ "element_property": True, }, ) usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usage", title="Extension field for ``usage``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate research definition instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the research definition", description=( "The identifier that is used to identify this version of the research " "definition when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the research " "definition author and is not expected to be globally unique. For " "example, it might be a timestamp (e.g. yyyymmdd) if a managed version " "is not available. There is also no expectation that versions can be " "placed in a lexicographical sequence. To provide a version consistent " "with the Decision Support Service specification, use the format " "Major.Minor.Revision (e.g. 1.0.0). For more information on versioning " "knowledge assets, refer to the Decision Support Service specification." " Note that a version is required for non-experimental active " "artifacts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ResearchDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "shortTitle", "subtitle", "status", "experimental", "subjectCodeableConcept", "subjectReference", "date", "publisher", "contact", "description", "comment", "useContext", "jurisdiction", "purpose", "usage", "copyright", "approvalDate", "lastReviewDate", "effectivePeriod", "topic", "author", "editor", "reviewer", "endorser", "relatedArtifact", "library", "population", "exposure", "exposureAlternative", "outcome", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ResearchDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "effectivePeriod", "population", "exposure", "exposureAlternative", "outcome", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"subject": ["subjectCodeableConcept", "subjectReference"]} return one_of_many_fields ================================================ FILE: fhir/resources/R4B/researchelementdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ResearchElementDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ResearchElementDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A population, intervention, or exposure definition. The ResearchElementDefinition resource describes a "PICO" element that knowledge (evidence, assertion, recommendation) is about. """ __resource_type__ = "ResearchElementDefinition" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the research element definition was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the content", description=( "An individiual or organization primarily involved in the creation and " "maintenance of the content." ), json_schema_extra={ "element_property": True, }, ) characteristic: typing.List[ fhirtypes.ResearchElementDefinitionCharacteristicType ] = Field( default=..., alias="characteristic", title="What defines the members of the research element", description=( "A characteristic that defines the members of the research element. " 'Multiple characteristics are applied with "and" semantics.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comment: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="comment", title="Used for footnotes or explanatory notes", description=( "A human-readable string to clarify or explain concepts about the " "resource." ), json_schema_extra={ "element_property": True, }, ) comment__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the research element definition " "and/or its contents. Copyright statements are generally legal " "restrictions on the use and publishing of the research element " "definition." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the research element definition " "was published. The date must change when the business version changes " "and it must change if the status code changes. In addition, it should " "change when the substantive content of the research element definition" " changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the research element definition", description=( "A free text natural language description of the research element " "definition from a consumer's perspective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the content", description=( "An individual or organization primarily responsible for internal " "coherence of the content." ), json_schema_extra={ "element_property": True, }, ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the research element definition is expected to be used", description=( "The period during which the research element definition content was or" " is planned to be in active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the content", description=( "An individual or organization responsible for officially endorsing the" " content for use in some setting." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this research element definition is " "authored for testing purposes (or education/evaluation/marketing) and " "is not intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the research element definition", description=( "A formal identifier that is used to identify this research element " "definition when it is represented in other formats, or referenced in a" " specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for research element definition (if applicable)", description=( "A legal or geographic region in which the research element definition " "is intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the research element definition was last reviewed", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) library: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="library", title="Logic used by the ResearchElementDefinition", description=( "A reference to a Library resource containing the formal logic used by " "the ResearchElementDefinition." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Library"], }, ) library__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_library", title="Extension field for ``library``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this research element definition (computer friendly)", description=( "A natural language name identifying the research element definition. " "This name should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the research" " element definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this research element definition is defined", description=( "Explanation of why this research element definition is needed and why " "it has been designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Additional documentation, citations, etc.", description=( "Related artifacts such as additional documentation, justification, or " "bibliographic references." ), json_schema_extra={ "element_property": True, }, ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the content", description=( "An individual or organization primarily responsible for review of some" " aspect of the content." ), json_schema_extra={ "element_property": True, }, ) shortTitle: fhirtypes.StringType | None = Field( default=None, alias="shortTitle", title="Title for use in informal contexts", description=( "The short title provides an alternate title for use in informal " "descriptive contexts where the full, formal title is not necessary." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) shortTitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_shortTitle", title="Extension field for ``shortTitle``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this research element definition. Enables tracking the " "life-cycle of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subjectCodeableConcept", title=( "E.g. Patient, Practitioner, RelatedPerson, Organization, Location, " "Device" ), description=( "The intended subjects for the ResearchElementDefinition. If this " "element is not provided, a Patient subject is assumed, but the subject" " of the ResearchElementDefinition can be anything." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, }, ) subjectReference: fhirtypes.ReferenceType | None = Field( default=None, alias="subjectReference", title=( "E.g. Patient, Practitioner, RelatedPerson, Organization, Location, " "Device" ), description=( "The intended subjects for the ResearchElementDefinition. If this " "element is not provided, a Patient subject is assumed, but the subject" " of the ResearchElementDefinition can be anything." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) subtitle: fhirtypes.StringType | None = Field( default=None, alias="subtitle", title="Subordinate title of the ResearchElementDefinition", description=( "An explanatory or alternate title for the ResearchElementDefinition " "giving additional information about its content." ), json_schema_extra={ "element_property": True, }, ) subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subtitle", title="Extension field for ``subtitle``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this research element definition (human friendly)", description=( "A short, descriptive, user-friendly title for the research element " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) topic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="topic", title=( "The category of the ResearchElementDefinition, such as Education, " "Treatment, Assessment, etc." ), description=( "Descriptive topics related to the content of the " "ResearchElementDefinition. Topics provide a high-level categorization " "grouping types of ResearchElementDefinitions that can be useful for " "filtering and searching." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="population | exposure | outcome", description=( "The type of research element, a population, an exposure, or an " "outcome." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["population", "exposure", "outcome"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this research element definition, represented" " as a URI (globally unique)" ), description=( "An absolute URI that is used to identify this research element " "definition when it is referenced in a specification, model, design or " "an instance; also called its canonical identifier. This SHOULD be " "globally unique and SHOULD be a literal address at which at which an " "authoritative instance of this research element definition is (or will" " be) published. This URL can be the target of a canonical reference. " "It SHALL remain the same when the research element definition is " "stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) usage: fhirtypes.StringType | None = Field( default=None, alias="usage", title="Describes the clinical usage of the ResearchElementDefinition", description=( "A detailed description, from a clinical perspective, of how the " "ResearchElementDefinition is used." ), json_schema_extra={ "element_property": True, }, ) usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usage", title="Extension field for ``usage``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate research element definition " "instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) variableType: fhirtypes.CodeType | None = Field( default=None, alias="variableType", title="dichotomous | continuous | descriptive", description=( "The type of the outcome (e.g. Dichotomous, Continuous, or " "Descriptive)." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["dichotomous", "continuous", "descriptive"], }, ) variableType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_variableType", title="Extension field for ``variableType``.", ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the research element definition", description=( "The identifier that is used to identify this version of the research " "element definition when it is referenced in a specification, model, " "design or instance. This is an arbitrary value managed by the research" " element definition author and is not expected to be globally unique. " "For example, it might be a timestamp (e.g. yyyymmdd) if a managed " "version is not available. There is also no expectation that versions " "can be placed in a lexicographical sequence. To provide a version " "consistent with the Decision Support Service specification, use the " "format Major.Minor.Revision (e.g. 1.0.0). For more information on " "versioning knowledge assets, refer to the Decision Support Service " "specification. Note that a version is required for non-experimental " "active artifacts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ResearchElementDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "shortTitle", "subtitle", "status", "experimental", "subjectCodeableConcept", "subjectReference", "date", "publisher", "contact", "description", "comment", "useContext", "jurisdiction", "purpose", "usage", "copyright", "approvalDate", "lastReviewDate", "effectivePeriod", "topic", "author", "editor", "reviewer", "endorser", "relatedArtifact", "library", "type", "variableType", "characteristic", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ResearchElementDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "shortTitle", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "effectivePeriod", "type", "characteristic", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext"), ("type", "type__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"subject": ["subjectCodeableConcept", "subjectReference"]} return one_of_many_fields class ResearchElementDefinitionCharacteristic(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What defines the members of the research element. A characteristic that defines the members of the research element. Multiple characteristics are applied with "and" semantics. """ __resource_type__ = "ResearchElementDefinitionCharacteristic" definitionCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="definitionCanonical", title="What code or expression defines members?", description=( "Define members of the research element using Codes (such as condition," " medication, or observation), Expressions ( using an expression " "language such as FHIRPath or CQL) or DataRequirements (such as " "Diabetes diagnosis onset in the last year)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e definition[x] "one_of_many": "definition", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) definitionCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definitionCanonical", title="Extension field for ``definitionCanonical``.", ) definitionCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="definitionCodeableConcept", title="What code or expression defines members?", description=( "Define members of the research element using Codes (such as condition," " medication, or observation), Expressions ( using an expression " "language such as FHIRPath or CQL) or DataRequirements (such as " "Diabetes diagnosis onset in the last year)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e definition[x] "one_of_many": "definition", "one_of_many_required": True, }, ) definitionDataRequirement: fhirtypes.DataRequirementType | None = Field( default=None, alias="definitionDataRequirement", title="What code or expression defines members?", description=( "Define members of the research element using Codes (such as condition," " medication, or observation), Expressions ( using an expression " "language such as FHIRPath or CQL) or DataRequirements (such as " "Diabetes diagnosis onset in the last year)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e definition[x] "one_of_many": "definition", "one_of_many_required": True, }, ) definitionExpression: fhirtypes.ExpressionType | None = Field( default=None, alias="definitionExpression", title="What code or expression defines members?", description=( "Define members of the research element using Codes (such as condition," " medication, or observation), Expressions ( using an expression " "language such as FHIRPath or CQL) or DataRequirements (such as " "Diabetes diagnosis onset in the last year)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e definition[x] "one_of_many": "definition", "one_of_many_required": True, }, ) exclude: bool | None = Field( default=None, alias="exclude", title="Whether the characteristic includes or excludes members", description=( "When true, members with this characteristic are excluded from the " "element." ), json_schema_extra={ "element_property": True, }, ) exclude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_exclude", title="Extension field for ``exclude``." ) participantEffectiveDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="participantEffectiveDateTime", title="What time period do participants cover", description="Indicates what effective period the study covers.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e participantEffective[x] "one_of_many": "participantEffective", "one_of_many_required": False, }, ) participantEffectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = ( Field( default=None, alias="_participantEffectiveDateTime", title="Extension field for ``participantEffectiveDateTime``.", ) ) participantEffectiveDescription: fhirtypes.StringType | None = Field( default=None, alias="participantEffectiveDescription", title="What time period do participants cover", description="A narrative description of the time period the study covers.", json_schema_extra={ "element_property": True, }, ) participantEffectiveDescription__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_participantEffectiveDescription", title="Extension field for ``participantEffectiveDescription``.", ) participantEffectiveDuration: fhirtypes.DurationType | None = Field( default=None, alias="participantEffectiveDuration", title="What time period do participants cover", description="Indicates what effective period the study covers.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e participantEffective[x] "one_of_many": "participantEffective", "one_of_many_required": False, }, ) participantEffectiveGroupMeasure: fhirtypes.CodeType | None = Field( default=None, alias="participantEffectiveGroupMeasure", title=( "mean | median | mean-of-mean | mean-of-median | median-of-mean | " "median-of-median" ), description=( "Indicates how elements are aggregated within the study effective " "period." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "mean", "median", "mean-of-mean", "mean-of-median", "median-of-mean", "median-of-median", ], }, ) participantEffectiveGroupMeasure__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_participantEffectiveGroupMeasure", title="Extension field for ``participantEffectiveGroupMeasure``.", ) participantEffectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="participantEffectivePeriod", title="What time period do participants cover", description="Indicates what effective period the study covers.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e participantEffective[x] "one_of_many": "participantEffective", "one_of_many_required": False, }, ) participantEffectiveTimeFromStart: fhirtypes.DurationType | None = Field( default=None, alias="participantEffectiveTimeFromStart", title="Observation time from study start", description="Indicates duration from the participant's study entry.", json_schema_extra={ "element_property": True, }, ) participantEffectiveTiming: fhirtypes.TimingType | None = Field( default=None, alias="participantEffectiveTiming", title="What time period do participants cover", description="Indicates what effective period the study covers.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e participantEffective[x] "one_of_many": "participantEffective", "one_of_many_required": False, }, ) studyEffectiveDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="studyEffectiveDateTime", title="What time period does the study cover", description="Indicates what effective period the study covers.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e studyEffective[x] "one_of_many": "studyEffective", "one_of_many_required": False, }, ) studyEffectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_studyEffectiveDateTime", title="Extension field for ``studyEffectiveDateTime``.", ) studyEffectiveDescription: fhirtypes.StringType | None = Field( default=None, alias="studyEffectiveDescription", title="What time period does the study cover", description="A narrative description of the time period the study covers.", json_schema_extra={ "element_property": True, }, ) studyEffectiveDescription__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_studyEffectiveDescription", title="Extension field for ``studyEffectiveDescription``.", ) studyEffectiveDuration: fhirtypes.DurationType | None = Field( default=None, alias="studyEffectiveDuration", title="What time period does the study cover", description="Indicates what effective period the study covers.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e studyEffective[x] "one_of_many": "studyEffective", "one_of_many_required": False, }, ) studyEffectiveGroupMeasure: fhirtypes.CodeType | None = Field( default=None, alias="studyEffectiveGroupMeasure", title=( "mean | median | mean-of-mean | mean-of-median | median-of-mean | " "median-of-median" ), description=( "Indicates how elements are aggregated within the study effective " "period." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "mean", "median", "mean-of-mean", "mean-of-median", "median-of-mean", "median-of-median", ], }, ) studyEffectiveGroupMeasure__ext: fhirtypes.FHIRPrimitiveExtensionType | None = ( Field( default=None, alias="_studyEffectiveGroupMeasure", title="Extension field for ``studyEffectiveGroupMeasure``.", ) ) studyEffectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="studyEffectivePeriod", title="What time period does the study cover", description="Indicates what effective period the study covers.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e studyEffective[x] "one_of_many": "studyEffective", "one_of_many_required": False, }, ) studyEffectiveTimeFromStart: fhirtypes.DurationType | None = Field( default=None, alias="studyEffectiveTimeFromStart", title="Observation time from study start", description="Indicates duration from the study initiation.", json_schema_extra={ "element_property": True, }, ) studyEffectiveTiming: fhirtypes.TimingType | None = Field( default=None, alias="studyEffectiveTiming", title="What time period does the study cover", description="Indicates what effective period the study covers.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e studyEffective[x] "one_of_many": "studyEffective", "one_of_many_required": False, }, ) unitOfMeasure: fhirtypes.CodeableConceptType | None = Field( default=None, alias="unitOfMeasure", title="What unit is the outcome described in?", description="Specifies the UCUM unit for the outcome.", json_schema_extra={ "element_property": True, }, ) usageContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="usageContext", title="What code/value pairs define members?", description=( "Use UsageContext to define the members of the population, such as Age " "Ranges, Genders, Settings." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ResearchElementDefinitionCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "definitionCodeableConcept", "definitionCanonical", "definitionExpression", "definitionDataRequirement", "usageContext", "exclude", "unitOfMeasure", "studyEffectiveDescription", "studyEffectiveDateTime", "studyEffectivePeriod", "studyEffectiveDuration", "studyEffectiveTiming", "studyEffectiveTimeFromStart", "studyEffectiveGroupMeasure", "participantEffectiveDescription", "participantEffectiveDateTime", "participantEffectivePeriod", "participantEffectiveDuration", "participantEffectiveTiming", "participantEffectiveTimeFromStart", "participantEffectiveGroupMeasure", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ResearchElementDefinitionCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "definitionCodeableConcept", "definitionCanonical", "definitionExpression", "definitionDataRequirement", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "definition": [ "definitionCanonical", "definitionCodeableConcept", "definitionDataRequirement", "definitionExpression", ], "participantEffective": [ "participantEffectiveDateTime", "participantEffectiveDuration", "participantEffectivePeriod", "participantEffectiveTiming", ], "studyEffective": [ "studyEffectiveDateTime", "studyEffectiveDuration", "studyEffectivePeriod", "studyEffectiveTiming", ], } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/researchstudy.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ResearchStudy Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ResearchStudy(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Investigation to increase healthcare-related patient-independent knowledge. A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. A ResearchStudy involves the gathering of information about human or animal subjects. """ __resource_type__ = "ResearchStudy" arm: typing.List[fhirtypes.ResearchStudyArmType] | None = Field( default=None, alias="arm", title="Defined path through the study for a subject", description=( "Describes an expected sequence of events for one of the participants " "of a study. E.g. Exposure to drug A, wash-out, exposure to drug B, " "wash-out, follow-up." ), json_schema_extra={ "element_property": True, }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Classifications for the study", description=( "Codes categorizing the type of study such as investigational vs. " "observational, type of blinding, type of randomization, safety vs. " "efficacy, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) condition: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="condition", title="Condition being studied", description=( "The condition that is the focus of the study. For example, In a study" " to examine risk factors for Lupus, might have as an inclusion " 'criterion "healthy volunteer", but the target condition code would be ' "a Lupus SNOMED code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the study", description=( "Contact details to assist a user in learning more about or engaging " "with the study." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="What this is study doing", description="A full description of how the study is being conducted.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) enrollment: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="enrollment", title="Inclusion & exclusion criteria", description=( "Reference to a Group that defines the criteria for and quantity of " 'subjects participating in the study. E.g. " 200 female Europeans ' 'between the ages of 20 and 45 with early onset diabetes".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) focus: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="focus", title="Drugs, devices, etc. under study", description=( "The medication(s), food(s), therapy(ies), device(s) or other concerns " "or interventions that the study is seeking to gain more information " "about." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for study", description=( "Identifiers assigned to this research study by the sponsor or other " "systems." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) keyword: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="keyword", title="Used to search for the study", description="Key terms to aid in searching for or filtering the study.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) location: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="location", title="Geographic region(s) for study", description=( "Indicates a country, state or other region where the study is taking " "place." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the study", description=( "Comments made about the study by the performer, subject or other " "participants." ), json_schema_extra={ "element_property": True, }, ) objective: typing.List[fhirtypes.ResearchStudyObjectiveType] | None = Field( default=None, alias="objective", title="A goal for the study", description=( "A goal that the study is aiming to achieve in terms of a scientific " "question to be answered by the analysis of data collected during the " "study." ), json_schema_extra={ "element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of larger study", description=( "A larger research study of which this particular study is a component " "or step." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ResearchStudy"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="When the study began and ended", description=( "Identifies the start date and the expected (or actual, depending on " "status) end date for the study." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) phase: fhirtypes.CodeableConceptType | None = Field( default=None, alias="phase", title=( "n-a | early-phase-1 | phase-1 | phase-1-phase-2 | phase-2 | " "phase-2-phase-3 | phase-3 | phase-4" ), description=( "The stage in the progression of a therapy from initial experimental " "use in humans in clinical trials to post-market evaluation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) primaryPurposeType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="primaryPurposeType", title=( "treatment | prevention | diagnostic | supportive-care | screening | " "health-services-research | basic-science | device-feasibility" ), description=( "The type of study based upon the intent of the study's activities. A " "classification of the intent of the study." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) principalInvestigator: fhirtypes.ReferenceType | None = Field( default=None, alias="principalInvestigator", title="Researcher who oversees multiple aspects of the study", description=( "A researcher in a study who oversees multiple aspects of the study, " "such as concept development, protocol writing, protocol submission for" " IRB approval, participant recruitment, informed consent, data " "collection, analysis, interpretation and presentation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) protocol: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="protocol", title="Steps followed in executing study", description=( "The set of steps expected to be performed as part of the execution of " "the study." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["PlanDefinition"], }, ) reasonStopped: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reasonStopped", title=( "accrual-goal-met | closed-due-to-toxicity | closed-due-to-lack-of-" "study-progress | temporarily-closed-per-study-design" ), description=( "A description and/or code explaining the premature termination of the " "study." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="References and dependencies", description="Citations, references and other related documents.", json_schema_extra={ "element_property": True, }, ) site: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="site", title="Facility where study activities are conducted", description="A facility in which study activities are conducted.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) sponsor: fhirtypes.ReferenceType | None = Field( default=None, alias="sponsor", title="Organization that initiates and is legally responsible for the study", description=( "An organization that initiates the investigation and is legally " "responsible for the study." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "active | administratively-completed | approved | closed-to-accrual | " "closed-to-accrual-and-intervention | completed | disapproved | in-" "review | temporarily-closed-to-accrual | temporarily-closed-to-" "accrual-and-intervention | withdrawn" ), description="The current state of the study.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "active", "administratively-completed", "approved", "closed-to-accrual", "closed-to-accrual-and-intervention", "completed", "disapproved", "in-review", "temporarily-closed-to-accrual", "temporarily-closed-to-accrual-and-intervention", "withdrawn", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this study", description="A short, descriptive user-friendly label for the study.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ResearchStudy`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "title", "protocol", "partOf", "status", "primaryPurposeType", "phase", "category", "focus", "condition", "contact", "relatedArtifact", "keyword", "location", "description", "enrollment", "period", "sponsor", "principalInvestigator", "site", "reasonStopped", "note", "arm", "objective", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ResearchStudy`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "title", "protocol", "partOf", "status", "primaryPurposeType", "phase", "category", "focus", "condition", "contact", "keyword", "location", "enrollment", "period", "sponsor", "principalInvestigator", "site", "reasonStopped", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class ResearchStudyArm(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Defined path through the study for a subject. Describes an expected sequence of events for one of the participants of a study. E.g. Exposure to drug A, wash-out, exposure to drug B, wash-out, follow-up. """ __resource_type__ = "ResearchStudyArm" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Short explanation of study path", description=( "A succinct description of the path through the study that would be " "followed by a subject adhering to this arm." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Label for study arm", description="Unique, human-readable label for this arm of the study.", json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Categorization of study arm", description=( "Categorization of study arm, e.g. experimental, active comparator, " "placebo comparater." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ResearchStudyArm`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "type", "description"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ResearchStudyArm`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields class ResearchStudyObjective(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A goal for the study. A goal that the study is aiming to achieve in terms of a scientific question to be answered by the analysis of data collected during the study. """ __resource_type__ = "ResearchStudyObjective" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Label for the objective", description="Unique, human-readable label for this objective of the study.", json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="primary | secondary | exploratory", description="The kind of study objective.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ResearchStudyObjective`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "type"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ResearchStudyObjective`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/researchsubject.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ResearchSubject Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class ResearchSubject(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Physical entity which is the primary unit of interest in the study. A physical entity which is the primary unit of operational and/or administrative interest in a study. """ __resource_type__ = "ResearchSubject" actualArm: fhirtypes.StringType | None = Field( default=None, alias="actualArm", title="What path was followed", description=( "The name of the arm in the study the subject actually followed as part" " of this study." ), json_schema_extra={ "element_property": True, }, ) actualArm__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_actualArm", title="Extension field for ``actualArm``." ) assignedArm: fhirtypes.StringType | None = Field( default=None, alias="assignedArm", title="What path should be followed", description=( "The name of the arm in the study the subject is expected to follow as " "part of this study." ), json_schema_extra={ "element_property": True, }, ) assignedArm__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_assignedArm", title="Extension field for ``assignedArm``." ) consent: fhirtypes.ReferenceType | None = Field( default=None, alias="consent", title="Agreement to participate in study", description=( "A record of the patient's informed agreement to participate in the " "study." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Consent"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for research subject in a study", description="Identifiers assigned to this research subject for a study.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) individual: fhirtypes.ReferenceType = Field( default=..., alias="individual", title="Who is part of study", description="The record of the person or animal who is involved in the study.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Start and end of participation", description=( "The dates the subject began and ended their participation in the " "study." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "candidate | eligible | follow-up | ineligible | not-registered | off-" "study | on-study | on-study-intervention | on-study-observation | " "pending-on-study | potential-candidate | screening | withdrawn" ), description="The current state of the subject.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "candidate", "eligible", "follow-up", "ineligible", "not-registered", "off-study", "on-study", "on-study-intervention", "on-study-observation", "pending-on-study", "potential-candidate", "screening", "withdrawn", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) study: fhirtypes.ReferenceType = Field( default=..., alias="study", title="Study subject is part of", description="Reference to the study the subject is participating in.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ResearchStudy"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ResearchSubject`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "period", "study", "individual", "assignedArm", "actualArm", "consent", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ResearchSubject`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "period", "study", "individual", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/resource.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Resource Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import fhirresourcemodel, fhirtypes class Resource(fhirresourcemodel.FHIRResourceModel): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Base Resource. This is the base resource type for everything. """ __resource_type__ = "Resource" id: fhirtypes.IdType | None = Field( default=None, alias="id", title="Logical id of this artifact", description=( "The logical id of the resource, as used in the URL for the resource. " "Once assigned, this value never changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) implicitRules: fhirtypes.UriType | None = Field( default=None, alias="implicitRules", title="A set of rules under which this content was created", description=( "A reference to a set of rules that were followed when the resource was" " constructed, and which must be understood when processing the " "content. Often, this is a reference to an implementation guide that " "defines the special rules along with other profiles etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) implicitRules__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_implicitRules", title="Extension field for ``implicitRules``.", ) language: fhirtypes.CodeType | None = Field( default=None, alias="language", title="Language of the resource content", description="The base language in which the resource is written.", json_schema_extra={ "element_property": True, }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) meta: fhirtypes.MetaType | None = Field( default=None, alias="meta", title="Metadata about the resource", description=( "The metadata about the resource. This is content that is maintained by" " the infrastructure. Changes to the content might not always be " "associated with version changes to the resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Resource`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "language"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Resource`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules"] ================================================ FILE: fhir/resources/R4B/riskassessment.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/RiskAssessment Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class RiskAssessment(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Potential outcomes for a subject with likelihood. An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. """ __resource_type__ = "RiskAssessment" basedOn: fhirtypes.ReferenceType | None = Field( default=None, alias="basedOn", title="Request fulfilled by this assessment", description="A reference to the request that is fulfilled by this risk assessment.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) basis: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basis", title="Information used in assessment", description=( "Indicates the source data considered as part of the assessment (for " "example, FamilyHistory, Observations, Procedures, Conditions, etc.)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Type of assessment", description="The type of the risk assessment performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) condition: fhirtypes.ReferenceType | None = Field( default=None, alias="condition", title="Condition assessed", description=( "For assessments or prognosis specific to a particular condition, " "indicates the condition being assessed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Where was assessment performed?", description="The encounter where the assessment was performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique identifier for the assessment", description="Business identifier assigned to the risk assessment.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="Evaluation mechanism", description="The algorithm, process or mechanism used to evaluate the risk.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) mitigation: fhirtypes.StringType | None = Field( default=None, alias="mitigation", title="How to reduce risk", description=( "A description of the steps that might be taken to reduce the " "identified risk(s)." ), json_schema_extra={ "element_property": True, }, ) mitigation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mitigation", title="Extension field for ``mitigation``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments on the risk assessment", description="Additional comments about the risk assessment.", json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When was assessment made?", description="The date (and possibly time) the risk assessment was performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="When was assessment made?", description="The date (and possibly time) the risk assessment was performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) parent: fhirtypes.ReferenceType | None = Field( default=None, alias="parent", title="Part of this occurrence", description=( "A reference to a resource that this risk assessment is part of, such " "as a Procedure." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) performer: fhirtypes.ReferenceType | None = Field( default=None, alias="performer", title="Who did assessment?", description="The provider or software application that performed the assessment.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole", "Device"], }, ) prediction: typing.List[fhirtypes.RiskAssessmentPredictionType] | None = Field( default=None, alias="prediction", title="Outcome predicted", description="Describes the expected outcome for the subject.", json_schema_extra={ "element_property": True, }, ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Why the assessment was necessary?", description="The reason the risk assessment was performed.", json_schema_extra={ "element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Why the assessment was necessary?", description="Resources supporting the reason the risk assessment was performed.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "DiagnosticReport", "DocumentReference", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="registered | preliminary | final | amended +", description=( "The status of the RiskAssessment, using the same statuses as an " "Observation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["registered", "preliminary", "final", "amended", "+"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who/what does assessment apply to?", description="The patient or group the risk assessment applies to.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RiskAssessment`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "parent", "status", "method", "code", "subject", "encounter", "occurrenceDateTime", "occurrencePeriod", "condition", "performer", "reasonCode", "reasonReference", "basis", "prediction", "mitigation", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RiskAssessment`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "method", "code", "subject", "encounter", "occurrenceDateTime", "occurrencePeriod", "condition", "performer", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"occurrence": ["occurrenceDateTime", "occurrencePeriod"]} return one_of_many_fields class RiskAssessmentPrediction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Outcome predicted. Describes the expected outcome for the subject. """ __resource_type__ = "RiskAssessmentPrediction" outcome: fhirtypes.CodeableConceptType | None = Field( default=None, alias="outcome", title="Possible outcome for the subject", description=( "One of the potential outcomes for the patient (e.g. remission, death," " a particular condition)." ), json_schema_extra={ "element_property": True, }, ) probabilityDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="probabilityDecimal", title="Likelihood of specified outcome", description="Indicates how likely the outcome is (in the specified timeframe).", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e probability[x] "one_of_many": "probability", "one_of_many_required": False, }, ) probabilityDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_probabilityDecimal", title="Extension field for ``probabilityDecimal``.", ) probabilityRange: fhirtypes.RangeType | None = Field( default=None, alias="probabilityRange", title="Likelihood of specified outcome", description="Indicates how likely the outcome is (in the specified timeframe).", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e probability[x] "one_of_many": "probability", "one_of_many_required": False, }, ) qualitativeRisk: fhirtypes.CodeableConceptType | None = Field( default=None, alias="qualitativeRisk", title="Likelihood of specified outcome as a qualitative value", description=( "Indicates how likely the outcome is (in the specified timeframe), " "expressed as a qualitative value (e.g. low, medium, or high)." ), json_schema_extra={ "element_property": True, }, ) rationale: fhirtypes.StringType | None = Field( default=None, alias="rationale", title="Explanation of prediction", description="Additional information explaining the basis for the prediction.", json_schema_extra={ "element_property": True, }, ) rationale__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rationale", title="Extension field for ``rationale``." ) relativeRisk: fhirtypes.DecimalType | None = Field( default=None, alias="relativeRisk", title="Relative likelihood", description=( "Indicates the risk for this particular subject (with their specific " "characteristics) divided by the risk of the population in general. " "(Numbers greater than 1 = higher risk than the population, numbers " "less than 1 = lower risk.)." ), json_schema_extra={ "element_property": True, }, ) relativeRisk__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_relativeRisk", title="Extension field for ``relativeRisk``.", ) whenPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="whenPeriod", title="Timeframe or age range", description=( "Indicates the period of time or age range of the subject to which the " "specified probability applies." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e when[x] "one_of_many": "when", "one_of_many_required": False, }, ) whenRange: fhirtypes.RangeType | None = Field( default=None, alias="whenRange", title="Timeframe or age range", description=( "Indicates the period of time or age range of the subject to which the " "specified probability applies." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e when[x] "one_of_many": "when", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RiskAssessmentPrediction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "outcome", "probabilityDecimal", "probabilityRange", "qualitativeRisk", "relativeRisk", "whenPeriod", "whenRange", "rationale", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RiskAssessmentPrediction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "probability": ["probabilityDecimal", "probabilityRange"], "when": ["whenPeriod", "whenRange"], } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/sampleddata.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SampledData Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class SampledData(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A series of measurements taken by a device. A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data. """ __resource_type__ = "SampledData" data: fhirtypes.StringType | None = Field( default=None, alias="data", title='Decimal values with spaces, or "E" | "U" | "L"', description=( "A series of data points which are decimal values separated by a single" ' space (character u20). The special values "E" (error), "L" (below ' 'detection limit) and "U" (above detection limit) can also be used in ' "place of a decimal value." ), json_schema_extra={ "element_property": True, }, ) data__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_data", title="Extension field for ``data``." ) dimensions: fhirtypes.PositiveIntType | None = Field( default=None, alias="dimensions", title="Number of sample points at each time point", description=( "The number of sample points at each time point. If this value is " "greater than one, then the dimensions will be interlaced - all the " "sample points for a point in time will be recorded at once." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) dimensions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dimensions", title="Extension field for ``dimensions``." ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Multiply data by this before adding to origin", description=( "A correction factor that is applied to the sampled data points before " "they are added to the origin." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) lowerLimit: fhirtypes.DecimalType | None = Field( default=None, alias="lowerLimit", title="Lower limit of detection", description=( "The lower limit of detection of the measured points. This is needed if" ' any of the data points have the value "L" (lower than detection ' "limit)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lowerLimit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lowerLimit", title="Extension field for ``lowerLimit``." ) origin: fhirtypes.QuantityType = Field( default=..., alias="origin", title="Zero value and units", description=( "The base quantity that a measured value of zero represents. In " "addition, this provides the units of the entire measurement series." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) period: fhirtypes.DecimalType | None = Field( default=None, alias="period", title="Number of milliseconds between samples", description="The length of time between sampling times, measured in milliseconds.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) period__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_period", title="Extension field for ``period``." ) upperLimit: fhirtypes.DecimalType | None = Field( default=None, alias="upperLimit", title="Upper limit of detection", description=( "The upper limit of detection of the measured points. This is needed if" ' any of the data points have the value "U" (higher than detection ' "limit)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) upperLimit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_upperLimit", title="Extension field for ``upperLimit``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SampledData`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "origin", "period", "factor", "lowerLimit", "upperLimit", "dimensions", "data", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SampledData`` according to specification, with preserving the original sequence order. """ return ["origin", "period", "factor", "lowerLimit", "upperLimit", "dimensions"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("dimensions", "dimensions__ext"), ("period", "period__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/schedule.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Schedule Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class Schedule(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A container for slots of time that may be available for booking appointments. """ __resource_type__ = "Schedule" active: bool | None = Field( default=None, alias="active", title="Whether this schedule is in active use", description=( "Whether this schedule record is in active use or should not be used " "(such as was entered in error)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) actor: typing.List[fhirtypes.ReferenceType] = Field( default=..., alias="actor", title="Resource(s) that availability information is being provided for", description=( "Slots that reference this schedule resource provide the availability " "details to these referenced resource(s)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Device", "HealthcareService", "Location", ], }, ) comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Comments on availability", description=( "Comments on the availability to describe any extended information. " "Such as custom constraints on the slots that may be associated." ), json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Ids for this item", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) planningHorizon: fhirtypes.PeriodType | None = Field( default=None, alias="planningHorizon", title="Period of time covered by schedule", description=( "The period of time that the slots that reference this Schedule " "resource cover (even if none exist). These cover the amount of time " "that an organization's planning horizon; the interval for which they " "are currently accepting appointments. This does not define a " '"template" for planning outside these dates.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) serviceCategory: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="serviceCategory", title="High-level category", description=( "A broad categorization of the service that is to be performed during " "this appointment." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) serviceType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="serviceType", title="Specific service", description="The specific service that is to be performed during this appointment.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialty", title="Type of specialty needed", description=( "The specialty of a practitioner that would be required to perform the " "service requested in this appointment." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Schedule`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "serviceCategory", "serviceType", "specialty", "actor", "planningHorizon", "comment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Schedule`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "active", "serviceCategory", "serviceType", "specialty", "actor", "planningHorizon", ] ================================================ FILE: fhir/resources/R4B/searchparameter.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SearchParameter Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class SearchParameter(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Search parameter for a resource. A search parameter that defines a named search item that can be used to search/filter on a resource. """ __resource_type__ = "SearchParameter" base: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="base", title="The resource type(s) this search parameter applies to", description=( "The base resource type(s) that this search parameter can be used " "against." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) base__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_base", title="Extension field for ``base``." ) chain: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="chain", title="Chained names supported", description=( "Contains the names of any search parameters which may be chained to " "the containing search parameter. Chained parameters may be added to " "search parameters of type reference and specify that resources will " "only be returned if they contain a reference to a resource which " "matches the chained parameter value. Values for this field should be " "drawn from SearchParameter.code for a parameter on the target resource" " type." ), json_schema_extra={ "element_property": True, }, ) chain__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_chain", title="Extension field for ``chain``." ) code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Code used in URL", description=( "The code used in the URL or the parameter name in a parameters " "resource for this search parameter." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) comparator: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="comparator", title="eq | ne | gt | lt | ge | le | sa | eb | ap", description="Comparators supported for the search parameter.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["eq", "ne", "gt", "lt", "ge", "le", "sa", "eb", "ap"], }, ) comparator__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_comparator", title="Extension field for ``comparator``." ) component: typing.List[fhirtypes.SearchParameterComponentType] | None = Field( default=None, alias="component", title="For Composite resources to define the parts", description="Used to define the parts of a composite search parameter.", json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the search parameter was " "published. The date must change when the business version changes and " "it must change if the status code changes. In addition, it should " "change when the substantive content of the search parameter changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) derivedFrom: fhirtypes.CanonicalType | None = Field( default=None, alias="derivedFrom", title="Original definition for the search parameter", description=( "Where this search parameter is originally defined. If a derivedFrom is" " provided, then the details in the search parameter must be consistent" " with the definition from which it is defined. i.e. the parameter " "should have the same meaning, and (usually) the functionality should " "be a proper subset of the underlying search parameter." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SearchParameter"], }, ) derivedFrom__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_derivedFrom", title="Extension field for ``derivedFrom``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the search parameter", description="And how it used.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this search parameter is authored for" " testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="FHIRPath expression that extracts the values", description=( "A FHIRPath expression that returns a set of elements for the search " "parameter." ), json_schema_extra={ "element_property": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for search parameter (if applicable)", description=( "A legal or geographic region in which the search parameter is intended" " to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) modifier: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="modifier", title=( "missing | exact | contains | not | text | in | not-in | below | above " "| type | identifier | ofType" ), description="A modifier supported for the search parameter.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "missing", "exact", "contains", "not", "text", "in", "not-in", "below", "above", "type", "identifier", "ofType", ], }, ) modifier__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_modifier", title="Extension field for ``modifier``." ) multipleAnd: bool | None = Field( default=None, alias="multipleAnd", title="Allow multiple parameters (and)", description=( "Whether multiple parameters are allowed - e.g. more than one parameter" " with the same name. The search matches if all the parameters match." ), json_schema_extra={ "element_property": True, }, ) multipleAnd__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_multipleAnd", title="Extension field for ``multipleAnd``." ) multipleOr: bool | None = Field( default=None, alias="multipleOr", title="Allow multiple values per parameter (or)", description=( "Whether multiple values are allowed for each time the parameter " "exists. Values are separated by commas, and the parameter matches if " "any of the values match." ), json_schema_extra={ "element_property": True, }, ) multipleOr__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_multipleOr", title="Extension field for ``multipleOr``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this search parameter (computer friendly)", description=( "A natural language name identifying the search parameter. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the search " "parameter." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this search parameter is defined", description=( "Explanation of why this search parameter is needed and why it has been" " designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this search parameter. Enables tracking the life-cycle " "of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) target: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="target", title="Types of resource (if a resource reference)", description="Types of resource (if a resource is referenced).", json_schema_extra={ "element_property": True, }, ) target__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_target", title="Extension field for ``target``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "number | date | string | token | reference | composite | quantity | " "uri | special" ), description=( "The type of value that a search parameter may contain, and how the " "content is interpreted." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "number", "date", "string", "token", "reference", "composite", "quantity", "uri", "special", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this search parameter, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this search parameter when it" " is referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which at which an authoritative " "instance of this search parameter is (or will be) published. This URL " "can be the target of a canonical reference. It SHALL remain the same " "when the search parameter is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate search parameter instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the search parameter", description=( "The identifier that is used to identify this version of the search " "parameter when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the search parameter " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) xpath: fhirtypes.StringType | None = Field( default=None, alias="xpath", title="XPath that extracts the values", description=( "An XPath expression that returns a set of elements for the search " "parameter." ), json_schema_extra={ "element_property": True, }, ) xpath__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_xpath", title="Extension field for ``xpath``." ) xpathUsage: fhirtypes.CodeType | None = Field( default=None, alias="xpathUsage", title="normal | phonetic | nearby | distance | other", description=( "How the search parameter relates to the set of elements returned by " "evaluating the xpath query." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["normal", "phonetic", "nearby", "distance", "other"], }, ) xpathUsage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_xpathUsage", title="Extension field for ``xpathUsage``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SearchParameter`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "version", "name", "derivedFrom", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "code", "base", "type", "expression", "xpath", "xpathUsage", "target", "multipleOr", "multipleAnd", "comparator", "modifier", "chain", "component", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SearchParameter`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "version", "name", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "code", "base", "type", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("base", "base__ext"), ("code", "code__ext"), ("description", "description__ext"), ("name", "name__ext"), ("status", "status__ext"), ("type", "type__ext"), ("url", "url__ext"), ] return required_fields class SearchParameterComponent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. For Composite resources to define the parts. Used to define the parts of a composite search parameter. """ __resource_type__ = "SearchParameterComponent" definition: fhirtypes.CanonicalType | None = Field( default=None, alias="definition", title="Defines how the part works", description="The definition of the search parameter that describes this part.", json_schema_extra={ "element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SearchParameter"], }, ) definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="Subexpression relative to main expression", description=( "A sub-expression that defines how to extract values for this component" " from the output of the main SearchParameter.expression." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SearchParameterComponent`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "definition", "expression"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SearchParameterComponent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("definition", "definition__ext"), ("expression", "expression__ext"), ] return required_fields ================================================ FILE: fhir/resources/R4B/servicerequest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ServiceRequest Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class ServiceRequest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A request for a service to be performed. A record of a request for service such as diagnostic investigations, treatments, or operations to be performed. """ __resource_type__ = "ServiceRequest" asNeededBoolean: bool | None = Field( default=None, alias="asNeededBoolean", title="Preconditions for service", description=( "If a CodeableConcept is present, it indicates the pre-condition for " 'performing the service. For example "pain", "on flare-up", etc.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e asNeeded[x] "one_of_many": "asNeeded", "one_of_many_required": False, }, ) asNeededBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_asNeededBoolean", title="Extension field for ``asNeededBoolean``.", ) asNeededCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="asNeededCodeableConcept", title="Preconditions for service", description=( "If a CodeableConcept is present, it indicates the pre-condition for " 'performing the service. For example "pain", "on flare-up", etc.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e asNeeded[x] "one_of_many": "asNeeded", "one_of_many_required": False, }, ) authoredOn: fhirtypes.DateTimeType | None = Field( default=None, alias="authoredOn", title="Date request signed", description="When the request transitioned to being actionable.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoredOn", title="Extension field for ``authoredOn``." ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="What request fulfills", description="Plan/proposal/order fulfilled by this request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CarePlan", "ServiceRequest", "MedicationRequest"], }, ) bodySite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="bodySite", title="Location on Body", description=( "Anatomic location where the procedure should be performed. This is the" " target site." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Classification of service", description=( "A code that classifies the service for searching, sorting and display " 'purposes (e.g. "Surgical Procedure").' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="What is being requested/ordered", description=( "A code that identifies a particular service (i.e., procedure, " "diagnostic investigation, or panel of investigations) that have been " "requested." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) doNotPerform: bool | None = Field( default=None, alias="doNotPerform", title="True if service/procedure should not be performed", description=( "Set this to true if the record is saying that the service/procedure " "should NOT be performed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doNotPerform", title="Extension field for ``doNotPerform``.", ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter in which the request was created", description=( "An encounter that provides additional information about the healthcare" " context in which this request is made." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifiers assigned to this order", description=( "Identifiers assigned to this order instance by the orderer and/or the " "receiver and/or order fulfiller." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="instantiatesCanonical", title="Instantiates FHIR protocol or definition", description=( "The URL pointing to a FHIR-defined protocol, guideline, orderset or " "other definition that is adhered to in whole or in part by this " "ServiceRequest." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ActivityDefinition", "PlanDefinition"], }, ) instantiatesCanonical__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="instantiatesUri", title="Instantiates external protocol or definition", description=( "The URL pointing to an externally maintained protocol, guideline, " "orderset or other definition that is adhered to in whole or in part by" " this ServiceRequest." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) insurance: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="insurance", title="Associated insurance coverage", description=( "Insurance plans, coverage extensions, pre-authorizations and/or pre-" "determinations that may be needed for delivering the requested " "service." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage", "ClaimResponse"], }, ) intent: fhirtypes.CodeType | None = Field( default=None, alias="intent", title=( "proposal | plan | directive | order | original-order | reflex-order | " "filler-order | instance-order | option" ), description=( "Whether the request is a proposal, plan, an original order or a reflex" " order." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "proposal", "plan", "directive", "order", "original-order", "reflex-order", "filler-order", "instance-order", "option", ], }, ) intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intent", title="Extension field for ``intent``." ) locationCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="locationCode", title="Requested location", description=( "The preferred location(s) where the procedure should actually happen " "in coded or free text form. E.g. at home or nursing day care center." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) locationReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="locationReference", title="Requested location", description=( "A reference to the the preferred location(s) where the procedure " "should actually happen. E.g. at home or nursing day care center." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments", description=( "Any other notes and comments made about the service request. For " "example, internal billing notes." ), json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When service should occur", description="The date/time at which the requested service should occur.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="When service should occur", description="The date/time at which the requested service should occur.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceTiming: fhirtypes.TimingType | None = Field( default=None, alias="occurrenceTiming", title="When service should occur", description="The date/time at which the requested service should occur.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) orderDetail: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="orderDetail", title="Additional order information", description=( "Additional details and instructions about the how the services are to " "be delivered. For example, and order for a urinary catheter may have" " an order detail for an external or indwelling catheter, or an order " "for a bandage may require additional instructions specifying how the " "bandage should be applied." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patientInstruction: fhirtypes.StringType | None = Field( default=None, alias="patientInstruction", title="Patient or consumer-oriented instructions", description="Instructions in terms that are understood by the patient or consumer.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patientInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patientInstruction", title="Extension field for ``patientInstruction``.", ) performer: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="performer", title="Requested performer", description=( "The desired performer for doing the requested service. For example, " "the surgeon, dermatopathologist, endoscopist, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", "HealthcareService", "Patient", "Device", "RelatedPerson", ], }, ) performerType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="performerType", title="Performer role", description="Desired type of performer for doing the requested service.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Indicates how quickly the ServiceRequest should be addressed with " "respect to other requests." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) quantityQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantityQuantity", title="Service amount", description=( "An amount of service being requested which can be a quantity ( for " "example $1,500 home modification), a ratio ( for example, 20 half day " "visits per month), or a range (2.0 to 1.8 Gy per fraction)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e quantity[x] "one_of_many": "quantity", "one_of_many_required": False, }, ) quantityRange: fhirtypes.RangeType | None = Field( default=None, alias="quantityRange", title="Service amount", description=( "An amount of service being requested which can be a quantity ( for " "example $1,500 home modification), a ratio ( for example, 20 half day " "visits per month), or a range (2.0 to 1.8 Gy per fraction)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e quantity[x] "one_of_many": "quantity", "one_of_many_required": False, }, ) quantityRatio: fhirtypes.RatioType | None = Field( default=None, alias="quantityRatio", title="Service amount", description=( "An amount of service being requested which can be a quantity ( for " "example $1,500 home modification), a ratio ( for example, 20 half day " "visits per month), or a range (2.0 to 1.8 Gy per fraction)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e quantity[x] "one_of_many": "quantity", "one_of_many_required": False, }, ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Explanation/Justification for procedure or service", description=( "An explanation or justification for why this service is being " "requested in coded or textual form. This is often for billing " "purposes. May relate to the resources referred to in " "`supportingInfo`." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Explanation/Justification for service or service", description=( "Indicates another resource that provides a justification for why this " "service is being requested. May relate to the resources referred to " "in `supportingInfo`." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "DiagnosticReport", "DocumentReference", ], }, ) relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="relevantHistory", title="Request provenance", description="Key events in the history of the request.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Provenance"], }, ) replaces: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="replaces", title="What request replaces", description=( "The request takes the place of the referenced completed or terminated " "request(s)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ServiceRequest"], }, ) requester: fhirtypes.ReferenceType | None = Field( default=None, alias="requester", title="Who/what is requesting service", description=( "The individual who initiated the request and has responsibility for " "its activation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Patient", "RelatedPerson", "Device", ], }, ) requisition: fhirtypes.IdentifierType | None = Field( default=None, alias="requisition", title="Composite Request ID", description=( "A shared identifier common to all service requests that were " "authorized more or less simultaneously by a single author, " "representing the composite or group identifier." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) specimen: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="specimen", title="Procedure Samples", description="One or more specimens that the laboratory procedure will use.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Specimen"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "draft | active | on-hold | revoked | completed | entered-in-error | " "unknown" ), description="The status of the order.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "draft", "active", "on-hold", "revoked", "completed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Individual or Entity the service is ordered for", description=( "On whom or what the service is to be performed. This is usually a " "human patient, but can also be requested on animals, groups of humans " "or animals, devices such as dialysis machines, or even locations " "(typically for environmental scans)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group", "Location", "Device"], }, ) supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInfo", title="Additional clinical information", description=( "Additional clinical information about the patient or specimen that may" " influence the services or their interpretations. This information" " includes diagnosis, clinical findings and other observations. In " 'laboratory ordering these are typically referred to as "ask at order ' 'entry questions (AOEs)". This includes observations explicitly ' "requested by the producer (filler) to provide context or supporting " "information needed to complete the order. For example, reporting the " "amount of inspired oxygen for blood gas measurements." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ServiceRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "replaces", "requisition", "status", "intent", "category", "priority", "doNotPerform", "code", "orderDetail", "quantityQuantity", "quantityRatio", "quantityRange", "subject", "encounter", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "asNeededBoolean", "asNeededCodeableConcept", "authoredOn", "requester", "performerType", "performer", "locationCode", "locationReference", "reasonCode", "reasonReference", "insurance", "supportingInfo", "specimen", "bodySite", "note", "patientInstruction", "relevantHistory", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ServiceRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "replaces", "requisition", "status", "intent", "category", "priority", "doNotPerform", "code", "orderDetail", "quantityQuantity", "quantityRatio", "quantityRange", "subject", "encounter", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "asNeededBoolean", "asNeededCodeableConcept", "authoredOn", "requester", "performerType", "performer", "locationCode", "locationReference", "reasonCode", "reasonReference", "specimen", "bodySite", "patientInstruction", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("intent", "intent__ext"), ("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "asNeeded": ["asNeededBoolean", "asNeededCodeableConcept"], "occurrence": [ "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", ], "quantity": ["quantityQuantity", "quantityRange", "quantityRatio"], } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/signature.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Signature Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Signature(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A Signature - XML DigSig, JWS, Graphical image of signature, etc.. A signature along with supporting context. The signature may be a digital signature that is cryptographic in nature, or some other signature acceptable to the domain. This other signature may be as simple as a graphical image representing a hand-written signature, or a signature ceremony Different signature approaches have different utilities. """ __resource_type__ = "Signature" data: fhirtypes.Base64BinaryType | None = Field( default=None, alias="data", title="The actual signature content (XML DigSig. JWS, picture, etc.)", description=( "The base64 encoding of the Signature content. When signature is not " "recorded electronically this element would be empty." ), json_schema_extra={ "element_property": True, }, ) data__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_data", title="Extension field for ``data``." ) onBehalfOf: fhirtypes.ReferenceType | None = Field( default=None, alias="onBehalfOf", title="The party represented", description=( "A reference to an application-usable description of the identity that " "is represented by the signature." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "RelatedPerson", "Patient", "Device", "Organization", ], }, ) sigFormat: fhirtypes.CodeType | None = Field( default=None, alias="sigFormat", title="The technical format of the signature", description=( "A mime type that indicates the technical format of the signature. " "Important mime types are application/signature+xml for X ML DigSig, " "application/jose for JWS, and image/* for a graphical image of a " "signature, etc." ), json_schema_extra={ "element_property": True, }, ) sigFormat__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sigFormat", title="Extension field for ``sigFormat``." ) targetFormat: fhirtypes.CodeType | None = Field( default=None, alias="targetFormat", title="The technical format of the signed resources", description=( "A mime type that indicates the technical format of the target " "resources signed by the signature." ), json_schema_extra={ "element_property": True, }, ) targetFormat__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_targetFormat", title="Extension field for ``targetFormat``.", ) type: typing.List[fhirtypes.CodingType] = Field( default=..., alias="type", title="Indication of the reason the entity signed the object(s)", description=( "An indication of the reason that the entity signed this document. This" " may be explicitly included as part of the signature information and " "can be used when determining accountability for various actions " "concerning the document." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) when: fhirtypes.InstantType | None = Field( default=None, alias="when", title="When the signature was created", description="When the digital signature was signed.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) when__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_when", title="Extension field for ``when``." ) who: fhirtypes.ReferenceType = Field( default=..., alias="who", title="Who signed", description=( "A reference to an application-usable description of the identity that " "signed (e.g. the signature used their private key)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "RelatedPerson", "Patient", "Device", "Organization", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Signature`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "type", "when", "who", "onBehalfOf", "targetFormat", "sigFormat", "data", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Signature`` according to specification, with preserving the original sequence order. """ return ["type", "when", "who", "onBehalfOf"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("when", "when__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/slot.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Slot Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class Slot(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A slot of time on a schedule that may be available for booking appointments. """ __resource_type__ = "Slot" appointmentType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="appointmentType", title=( "The style of appointment or patient that may be booked in the slot " "(not service type)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title=( "Comments on the slot to describe any extended information. Such as " "custom constraints on the slot" ), description=None, json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) end: fhirtypes.InstantType | None = Field( default=None, alias="end", title="Date/Time that the slot is to conclude", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_end", title="Extension field for ``end``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Ids for this item", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) overbooked: bool | None = Field( default=None, alias="overbooked", title=( "This slot has already been overbooked, appointments are unlikely to be" " accepted for this time" ), description=None, json_schema_extra={ "element_property": True, }, ) overbooked__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_overbooked", title="Extension field for ``overbooked``." ) schedule: fhirtypes.ReferenceType = Field( default=..., alias="schedule", title=( "The schedule resource that this slot defines an interval of status " "information" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Schedule"], }, ) serviceCategory: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="serviceCategory", title=( "A broad categorization of the service that is to be performed during " "this appointment" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) serviceType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="serviceType", title=( "The type of appointments that can be booked into this slot (ideally " "this would be an identifiable service - which is at a location, rather" " than the location itself). If provided then this overrides the value " "provided on the availability resource" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialty", title=( "The specialty of a practitioner that would be required to perform the " "service requested in this appointment" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) start: fhirtypes.InstantType | None = Field( default=None, alias="start", title="Date/Time that the slot is to begin", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_start", title="Extension field for ``start``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="busy | free | busy-unavailable | busy-tentative | entered-in-error", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "busy", "free", "busy-unavailable", "busy-tentative", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Slot`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "serviceCategory", "serviceType", "specialty", "appointmentType", "schedule", "status", "start", "end", "overbooked", "comment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Slot`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "serviceCategory", "serviceType", "specialty", "appointmentType", "schedule", "status", "start", "end", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("end", "end__ext"), ("start", "start__ext"), ("status", "status__ext"), ] return required_fields ================================================ FILE: fhir/resources/R4B/specimen.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Specimen Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Specimen(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Sample for analysis. A sample to be used for analysis. """ __resource_type__ = "Specimen" accessionIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="accessionIdentifier", title="Identifier assigned by the lab", description=( "The identifier assigned by the lab when accessioning specimen(s). This" " is not necessarily the same as the specimen identifier, depending on " "local lab procedures." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) collection: fhirtypes.SpecimenCollectionType | None = Field( default=None, alias="collection", title="Collection details", description="Details concerning the specimen collection.", json_schema_extra={ "element_property": True, }, ) condition: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="condition", title="State of the specimen", description="A mode or state of being that describes the nature of the specimen.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) container: typing.List[fhirtypes.SpecimenContainerType] | None = Field( default=None, alias="container", title="Direct container of specimen (tube/slide, etc.)", description=( "The container holding the specimen. The recursive nature of " "containers; i.e. blood in tube in tray in rack is not addressed here." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Identifier", description="Id for specimen.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments", description=( "To communicate any details or issues about the specimen or during the " "specimen collection. (for example: broken vial, sent with patient, " "frozen)." ), json_schema_extra={ "element_property": True, }, ) parent: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="parent", title="Specimen from which this specimen originated", description=( "Reference to the parent (source) specimen which is used when the " "specimen was either derived from or a component of another specimen." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Specimen"], }, ) processing: typing.List[fhirtypes.SpecimenProcessingType] | None = Field( default=None, alias="processing", title="Processing and processing step details", description="Details concerning processing and processing steps for the specimen.", json_schema_extra={ "element_property": True, }, ) receivedTime: fhirtypes.DateTimeType | None = Field( default=None, alias="receivedTime", title="The time when specimen was received for processing", description="Time when specimen was received for processing or testing.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) receivedTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_receivedTime", title="Extension field for ``receivedTime``.", ) request: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="request", title="Why the specimen was collected", description=( "Details concerning a service request that required a specimen to be " "collected." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ServiceRequest"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="available | unavailable | unsatisfactory | entered-in-error", description="The availability of the specimen.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "available", "unavailable", "unsatisfactory", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title=( "Where the specimen came from. This may be from patient(s), from a " "location (e.g., the source of an environmental sample), or a sampling " "of a substance or a device" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Group", "Device", "Substance", "Location", ], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Kind of material that forms the specimen", description="The kind of material that forms the specimen.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Specimen`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "accessionIdentifier", "status", "type", "subject", "receivedTime", "parent", "request", "collection", "processing", "container", "condition", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Specimen`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "accessionIdentifier", "status", "type", "subject", "receivedTime", "condition", ] class SpecimenCollection(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Collection details. Details concerning the specimen collection. """ __resource_type__ = "SpecimenCollection" bodySite: fhirtypes.CodeableConceptType | None = Field( default=None, alias="bodySite", title="Anatomical collection site", description=( "Anatomical location from which the specimen was collected (if subject " "is a patient). This is the target site. This element is not used for " "environmental specimens." ), json_schema_extra={ "element_property": True, }, ) collectedDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="collectedDateTime", title="Collection time", description=( "Time when specimen was collected from subject - the physiologically " "relevant time." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e collected[x] "one_of_many": "collected", "one_of_many_required": False, }, ) collectedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_collectedDateTime", title="Extension field for ``collectedDateTime``.", ) collectedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="collectedPeriod", title="Collection time", description=( "Time when specimen was collected from subject - the physiologically " "relevant time." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e collected[x] "one_of_many": "collected", "one_of_many_required": False, }, ) collector: fhirtypes.ReferenceType | None = Field( default=None, alias="collector", title="Who collected the specimen", description="Person who collected the specimen.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) duration: fhirtypes.DurationType | None = Field( default=None, alias="duration", title="How long it took to collect specimen", description="The span of time over which the collection of a specimen occurred.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) fastingStatusCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="fastingStatusCodeableConcept", title="Whether or how long patient abstained from food and/or drink", description=( "Abstinence or reduction from some or all food, drink, or both, for a " "period of time prior to sample collection." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fastingStatus[x] "one_of_many": "fastingStatus", "one_of_many_required": False, }, ) fastingStatusDuration: fhirtypes.DurationType | None = Field( default=None, alias="fastingStatusDuration", title="Whether or how long patient abstained from food and/or drink", description=( "Abstinence or reduction from some or all food, drink, or both, for a " "period of time prior to sample collection." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fastingStatus[x] "one_of_many": "fastingStatus", "one_of_many_required": False, }, ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="Technique used to perform collection", description=( "A coded value specifying the technique that is used to perform the " "procedure." ), json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="The quantity of specimen collected", description=( "The quantity of specimen collected; for instance the volume of a blood" " sample, or the physical measurement of an anatomic pathology sample." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SpecimenCollection`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "collector", "collectedDateTime", "collectedPeriod", "duration", "quantity", "method", "bodySite", "fastingStatusCodeableConcept", "fastingStatusDuration", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SpecimenCollection`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "collector", "collectedDateTime", "collectedPeriod", "duration", "fastingStatusCodeableConcept", "fastingStatusDuration", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "collected": ["collectedDateTime", "collectedPeriod"], "fastingStatus": ["fastingStatusCodeableConcept", "fastingStatusDuration"], } return one_of_many_fields class SpecimenContainer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Direct container of specimen (tube/slide, etc.). The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here. """ __resource_type__ = "SpecimenContainer" additiveCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="additiveCodeableConcept", title="Additive associated with container", description=( "Introduced substance to preserve, maintain or enhance the specimen. " "Examples: Formalin, Citrate, EDTA." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e additive[x] "one_of_many": "additive", "one_of_many_required": False, }, ) additiveReference: fhirtypes.ReferenceType | None = Field( default=None, alias="additiveReference", title="Additive associated with container", description=( "Introduced substance to preserve, maintain or enhance the specimen. " "Examples: Formalin, Citrate, EDTA." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e additive[x] "one_of_many": "additive", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Substance"], }, ) capacity: fhirtypes.QuantityType | None = Field( default=None, alias="capacity", title="Container volume or size", description="The capacity (volume or other measure) the container may contain.", json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Textual description of the container", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Id for the container", description=( "Id for container. There may be multiple; a manufacturer's bar code, " "lab assigned identifier, etc. The container ID may differ from the " "specimen id in some circumstances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) specimenQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="specimenQuantity", title="Quantity of specimen within container", description=( "The quantity of specimen in the container; may be volume, dimensions, " "or other appropriate measurements, depending on the specimen type." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Kind of container directly associated with specimen", description=( "The type of container associated with the specimen (e.g. slide, " "aliquot, etc.)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SpecimenContainer`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "description", "type", "capacity", "specimenQuantity", "additiveCodeableConcept", "additiveReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SpecimenContainer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "identifier"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "additive": ["additiveCodeableConcept", "additiveReference"] } return one_of_many_fields class SpecimenProcessing(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Processing and processing step details. Details concerning processing and processing steps for the specimen. """ __resource_type__ = "SpecimenProcessing" additive: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="additive", title="Material used in the processing step", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Substance"], }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Textual description of procedure", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) procedure: fhirtypes.CodeableConceptType | None = Field( default=None, alias="procedure", title="Indicates the treatment step applied to the specimen", description="A coded value specifying the procedure used to process the specimen.", json_schema_extra={ "element_property": True, }, ) timeDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="timeDateTime", title="Date and time of specimen processing", description=( "A record of the time or period when the specimen processing occurred." " For example the time of sample fixation or the period of time the " "sample was in formalin." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e time[x] "one_of_many": "time", "one_of_many_required": False, }, ) timeDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timeDateTime", title="Extension field for ``timeDateTime``.", ) timePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="timePeriod", title="Date and time of specimen processing", description=( "A record of the time or period when the specimen processing occurred." " For example the time of sample fixation or the period of time the " "sample was in formalin." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e time[x] "one_of_many": "time", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SpecimenProcessing`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "procedure", "additive", "timeDateTime", "timePeriod", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SpecimenProcessing`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"time": ["timeDateTime", "timePeriod"]} return one_of_many_fields ================================================ FILE: fhir/resources/R4B/specimendefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SpecimenDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class SpecimenDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Kind of specimen. A kind of specimen with associated set of requirements. """ __resource_type__ = "SpecimenDefinition" collection: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="collection", title="Specimen collection procedure", description="The action to be performed for collecting the specimen.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Business identifier of a kind of specimen", description="A business identifier associated with the kind of specimen.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patientPreparation: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="patientPreparation", title="Patient preparation for collection", description="Preparation of the patient for specimen collection.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) timeAspect: fhirtypes.StringType | None = Field( default=None, alias="timeAspect", title="Time aspect for collection", description="Time aspect of specimen collection (duration or offset).", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) timeAspect__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timeAspect", title="Extension field for ``timeAspect``." ) typeCollected: fhirtypes.CodeableConceptType | None = Field( default=None, alias="typeCollected", title="Kind of material to collect", description="The kind of material to be collected.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) typeTested: typing.List[fhirtypes.SpecimenDefinitionTypeTestedType] | None = Field( default=None, alias="typeTested", title="Specimen in container intended for testing by lab", description=( "Specimen conditioned in a container as expected by the testing " "laboratory." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SpecimenDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "typeCollected", "patientPreparation", "timeAspect", "collection", "typeTested", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SpecimenDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "typeCollected", "patientPreparation", "timeAspect", "collection", ] class SpecimenDefinitionTypeTested(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specimen in container intended for testing by lab. Specimen conditioned in a container as expected by the testing laboratory. """ __resource_type__ = "SpecimenDefinitionTypeTested" container: fhirtypes.SpecimenDefinitionTypeTestedContainerType | None = Field( default=None, alias="container", title="The specimen's container", description=None, json_schema_extra={ "element_property": True, }, ) handling: typing.List[ fhirtypes.SpecimenDefinitionTypeTestedHandlingType ] | None = Field( default=None, alias="handling", title="Specimen handling before testing", description=( "Set of instructions for preservation/transport of the specimen at a " "defined temperature interval, prior the testing process." ), json_schema_extra={ "element_property": True, }, ) isDerived: bool | None = Field( default=None, alias="isDerived", title="Primary or secondary specimen", description="Primary of secondary specimen.", json_schema_extra={ "element_property": True, }, ) isDerived__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isDerived", title="Extension field for ``isDerived``." ) preference: fhirtypes.CodeType | None = Field( default=None, alias="preference", title="preferred | alternate", description="The preference for this type of conditioned specimen.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["preferred", "alternate"], }, ) preference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preference", title="Extension field for ``preference``." ) rejectionCriterion: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="rejectionCriterion", title="Rejection criterion", description=( "Criterion for rejection of the specimen in its container by the " "laboratory." ), json_schema_extra={ "element_property": True, }, ) requirement: fhirtypes.StringType | None = Field( default=None, alias="requirement", title="Specimen requirements", description=( "Requirements for delivery and special handling of this kind of " "conditioned specimen." ), json_schema_extra={ "element_property": True, }, ) requirement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requirement", title="Extension field for ``requirement``." ) retentionTime: fhirtypes.DurationType | None = Field( default=None, alias="retentionTime", title="Specimen retention time", description=( "The usual time that a specimen of this kind is retained after the " "ordered tests are completed, for the purpose of additional testing." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Type of intended specimen", description="The kind of specimen conditioned for testing expected by lab.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SpecimenDefinitionTypeTested`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "isDerived", "type", "preference", "container", "requirement", "retentionTime", "rejectionCriterion", "handling", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SpecimenDefinitionTypeTested`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("preference", "preference__ext")] return required_fields class SpecimenDefinitionTypeTestedContainer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The specimen's container. """ __resource_type__ = "SpecimenDefinitionTypeTestedContainer" additive: typing.List[ fhirtypes.SpecimenDefinitionTypeTestedContainerAdditiveType ] | None = Field( default=None, alias="additive", title="Additive associated with container", description=( "Substance introduced in the kind of container to preserve, maintain or" " enhance the specimen. Examples: Formalin, Citrate, EDTA." ), json_schema_extra={ "element_property": True, }, ) cap: fhirtypes.CodeableConceptType | None = Field( default=None, alias="cap", title="Color of container cap", description=None, json_schema_extra={ "element_property": True, }, ) capacity: fhirtypes.QuantityType | None = Field( default=None, alias="capacity", title="Container capacity", description="The capacity (volume or other measure) of this kind of container.", json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Container description", description="The textual description of the kind of container.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) material: fhirtypes.CodeableConceptType | None = Field( default=None, alias="material", title="Container material", description="The type of material of the container.", json_schema_extra={ "element_property": True, }, ) minimumVolumeQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="minimumVolumeQuantity", title="Minimum volume", description="The minimum volume to be conditioned in the container.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e minimumVolume[x] "one_of_many": "minimumVolume", "one_of_many_required": False, }, ) minimumVolumeString: fhirtypes.StringType | None = Field( default=None, alias="minimumVolumeString", title="Minimum volume", description="The minimum volume to be conditioned in the container.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e minimumVolume[x] "one_of_many": "minimumVolume", "one_of_many_required": False, }, ) minimumVolumeString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minimumVolumeString", title="Extension field for ``minimumVolumeString``.", ) preparation: fhirtypes.StringType | None = Field( default=None, alias="preparation", title="Specimen container preparation", description=( "Special processing that should be applied to the container for this " "kind of specimen." ), json_schema_extra={ "element_property": True, }, ) preparation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preparation", title="Extension field for ``preparation``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Kind of container associated with the kind of specimen", description="The type of container used to contain this kind of specimen.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SpecimenDefinitionTypeTestedContainer`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "material", "type", "cap", "description", "capacity", "minimumVolumeQuantity", "minimumVolumeString", "additive", "preparation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SpecimenDefinitionTypeTestedContainer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "minimumVolume": ["minimumVolumeQuantity", "minimumVolumeString"] } return one_of_many_fields class SpecimenDefinitionTypeTestedContainerAdditive(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additive associated with container. Substance introduced in the kind of container to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA. """ __resource_type__ = "SpecimenDefinitionTypeTestedContainerAdditive" additiveCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="additiveCodeableConcept", title="Additive associated with container", description=( "Substance introduced in the kind of container to preserve, maintain or" " enhance the specimen. Examples: Formalin, Citrate, EDTA." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e additive[x] "one_of_many": "additive", "one_of_many_required": True, }, ) additiveReference: fhirtypes.ReferenceType | None = Field( default=None, alias="additiveReference", title="Additive associated with container", description=( "Substance introduced in the kind of container to preserve, maintain or" " enhance the specimen. Examples: Formalin, Citrate, EDTA." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e additive[x] "one_of_many": "additive", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Substance"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SpecimenDefinitionTypeTestedContainerAdditive`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "additiveCodeableConcept", "additiveReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SpecimenDefinitionTypeTestedContainerAdditive`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "additive": ["additiveCodeableConcept", "additiveReference"] } return one_of_many_fields class SpecimenDefinitionTypeTestedHandling(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specimen handling before testing. Set of instructions for preservation/transport of the specimen at a defined temperature interval, prior the testing process. """ __resource_type__ = "SpecimenDefinitionTypeTestedHandling" instruction: fhirtypes.StringType | None = Field( default=None, alias="instruction", title="Preservation instruction", description=( "Additional textual instructions for the preservation or transport of " "the specimen. For instance, 'Protect from light exposure'." ), json_schema_extra={ "element_property": True, }, ) instruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instruction", title="Extension field for ``instruction``." ) maxDuration: fhirtypes.DurationType | None = Field( default=None, alias="maxDuration", title="Maximum preservation time", description=( "The maximum time interval of preservation of the specimen with these " "conditions." ), json_schema_extra={ "element_property": True, }, ) temperatureQualifier: fhirtypes.CodeableConceptType | None = Field( default=None, alias="temperatureQualifier", title="Temperature qualifier", description=( "It qualifies the interval of temperature, which characterizes an " "occurrence of handling. Conditions that are not related to temperature" " may be handled in the instruction element." ), json_schema_extra={ "element_property": True, }, ) temperatureRange: fhirtypes.RangeType | None = Field( default=None, alias="temperatureRange", title="Temperature range", description="The temperature interval for this set of handling instructions.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SpecimenDefinitionTypeTestedHandling`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "temperatureQualifier", "temperatureRange", "maxDuration", "instruction", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SpecimenDefinitionTypeTestedHandling`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/structuredefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/StructureDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class StructureDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Structural Definition. A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types. """ __resource_type__ = "StructureDefinition" abstract: bool | None = Field( default=None, alias="abstract", title="Whether the structure is abstract", description=( "Whether structure this definition describes is abstract or not - that" " is, whether the structure is not intended to be instantiated. For " "Resources and Data types, abstract types will never be exchanged " "between systems." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) abstract__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_abstract", title="Extension field for ``abstract``." ) baseDefinition: fhirtypes.CanonicalType | None = Field( default=None, alias="baseDefinition", title="Definition that this type is constrained/specialized from", description=( "An absolute URI that is the base structure from which this type is " "derived, either by specialization or constraint." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) baseDefinition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_baseDefinition", title="Extension field for ``baseDefinition``.", ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) context: typing.List[fhirtypes.StructureDefinitionContextType] | None = Field( default=None, alias="context", title="If an extension, where it can be used in instances", description=( "Identifies the types of resource or data type elements to which the " "extension can be applied." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contextInvariant: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="contextInvariant", title="FHIRPath invariants - when the extension can be used", description=( "A set of rules as FHIRPath Invariants about when the extension can be " "used (e.g. co-occurrence variants for the extension). All the rules " "must be true." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contextInvariant__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_contextInvariant", title="Extension field for ``contextInvariant``.", ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the structure definition and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the structure definition." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the structure definition was " "published. The date must change when the business version changes and " "it must change if the status code changes. In addition, it should " "change when the substantive content of the structure definition " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) derivation: fhirtypes.CodeType | None = Field( default=None, alias="derivation", title="specialization | constraint - How relates to base definition", description="How the type relates to the baseDefinition.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["specialization", "constraint"], }, ) derivation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_derivation", title="Extension field for ``derivation``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the structure definition", description=( "A free text natural language description of the structure definition " "from a consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) differential: fhirtypes.StructureDefinitionDifferentialType | None = Field( default=None, alias="differential", title="Differential view of the structure", description=( "A differential view is expressed relative to the base " "StructureDefinition - a statement of differences that it applies." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this structure definition is authored" " for testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) fhirVersion: fhirtypes.CodeType | None = Field( default=None, alias="fhirVersion", title="FHIR Version this StructureDefinition targets", description=( "The version of the FHIR specification on which this " "StructureDefinition is based - this is the formal version of the " "specification, without the revision number, e.g. " "[publication].[major].[minor], which is 4.3.0 for this version." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) fhirVersion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fhirVersion", title="Extension field for ``fhirVersion``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the structure definition", description=( "A formal identifier that is used to identify this structure definition" " when it is represented in other formats, or referenced in a " "specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for structure definition (if applicable)", description=( "A legal or geographic region in which the structure definition is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) keyword: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="keyword", title="Assist with indexing and finding", description=( "A set of key words or terms from external terminologies that may be " "used to assist with indexing and searching of templates nby describing" " the use of this structure definition, or the content it describes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title="primitive-type | complex-type | resource | logical", description="Defines the kind of structure that this definition is describing.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["primitive-type", "complex-type", "resource", "logical"], }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) mapping: typing.List[fhirtypes.StructureDefinitionMappingType] | None = Field( default=None, alias="mapping", title="External specification that the content is mapped to", description="An external specification that the content is mapped to.", json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this structure definition (computer friendly)", description=( "A natural language name identifying the structure definition. This " "name should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the " "structure definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this structure definition is defined", description=( "Explanation of why this structure definition is needed and why it has " "been designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) snapshot: fhirtypes.StructureDefinitionSnapshotType | None = Field( default=None, alias="snapshot", title="Snapshot view of the structure", description=( "A snapshot view is expressed in a standalone form that can be used and" " interpreted without considering the base StructureDefinition." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this structure definition. Enables tracking the life-" "cycle of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this structure definition (human friendly)", description=( "A short, descriptive, user-friendly title for the structure " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) type: fhirtypes.UriType | None = Field( default=None, alias="type", title="Type defined or constrained by this structure", description=( "The type this structure describes. If the derivation kind is " "'specialization' then this is the master definition for a type, and " "there is always one of these (a data type, an extension, a resource, " "including abstract ones). Otherwise the structure definition is a " "constraint on the stated type (and in this case, the type cannot be an" " abstract type). References are URLs that are relative to " 'http://hl7.org/fhir/StructureDefinition e.g. "string" is a reference ' "to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are " "only allowed in logical models." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this structure definition, represented as a " "URI (globally unique)" ), description=( "An absolute URI that is used to identify this structure definition " "when it is referenced in a specification, model, design or an " "instance; also called its canonical identifier. This SHOULD be " "globally unique and SHOULD be a literal address at which at which an " "authoritative instance of this structure definition is (or will be) " "published. This URL can be the target of a canonical reference. It " "SHALL remain the same when the structure definition is stored on " "different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate structure definition instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the structure definition", description=( "The identifier that is used to identify this version of the structure " "definition when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the structure " "definition author and is not expected to be globally unique. For " "example, it might be a timestamp (e.g. yyyymmdd) if a managed version " "is not available. There is also no expectation that versions can be " "placed in a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "keyword", "fhirVersion", "mapping", "kind", "abstract", "context", "contextInvariant", "type", "baseDefinition", "derivation", "snapshot", "differential", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "keyword", "fhirVersion", "kind", "abstract", "context", "contextInvariant", "type", "baseDefinition", "derivation", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("abstract", "abstract__ext"), ("kind", "kind__ext"), ("name", "name__ext"), ("status", "status__ext"), ("type", "type__ext"), ("url", "url__ext"), ] return required_fields class StructureDefinitionContext(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. If an extension, where it can be used in instances. Identifies the types of resource or data type elements to which the extension can be applied. """ __resource_type__ = "StructureDefinitionContext" expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="Where the extension can be used in instances", description=( "An expression that defines where an extension can be used in " "resources." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="fhirpath | element | extension", description=( "Defines how to interpret the expression that defines what the context " "of the extension is." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["fhirpath", "element", "extension"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureDefinitionContext`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "expression"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureDefinitionContext`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "expression"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("expression", "expression__ext"), ("type", "type__ext")] return required_fields class StructureDefinitionDifferential(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Differential view of the structure. A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies. """ __resource_type__ = "StructureDefinitionDifferential" element: typing.List[fhirtypes.ElementDefinitionType] = Field( default=..., alias="element", title="Definition of elements in the resource (if no StructureDefinition)", description="Captures constraints on each element within the resource.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureDefinitionDifferential`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "element"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureDefinitionDifferential`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class StructureDefinitionMapping(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. External specification that the content is mapped to. An external specification that the content is mapped to. """ __resource_type__ = "StructureDefinitionMapping" comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Versions, Issues, Scope limitations etc.", description=( "Comments about this mapping, including version notes, issues, scope " "limitations, and other important notes for usage." ), json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) identity: fhirtypes.IdType | None = Field( default=None, alias="identity", title="Internal id when this mapping is used", description=( "An Internal id that is used to identify this mapping set when specific" " mappings are made." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) identity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_identity", title="Extension field for ``identity``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Names what this mapping refers to", description="A name for the specification that is being mapped to.", json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) uri: fhirtypes.UriType | None = Field( default=None, alias="uri", title="Identifies what this mapping refers to", description=( "An absolute URI that identifies the specification that this mapping is" " expressed to." ), json_schema_extra={ "element_property": True, }, ) uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uri", title="Extension field for ``uri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureDefinitionMapping`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identity", "uri", "name", "comment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureDefinitionMapping`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("identity", "identity__ext")] return required_fields class StructureDefinitionSnapshot(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Snapshot view of the structure. A snapshot view is expressed in a standalone form that can be used and interpreted without considering the base StructureDefinition. """ __resource_type__ = "StructureDefinitionSnapshot" element: typing.List[fhirtypes.ElementDefinitionType] = Field( default=..., alias="element", title="Definition of elements in the resource (if no StructureDefinition)", description="Captures constraints on each element within the resource.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureDefinitionSnapshot`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "element"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureDefinitionSnapshot`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/structuremap.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/StructureMap Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class StructureMap(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A Map of relationships between 2 structures that can be used to transform data. """ __resource_type__ = "StructureMap" contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the structure map and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the structure map." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the structure map was published. " "The date must change when the business version changes and it must " "change if the status code changes. In addition, it should change when " "the substantive content of the structure map changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the structure map", description=( "A free text natural language description of the structure map from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this structure map is authored for " "testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) group: typing.List[fhirtypes.StructureMapGroupType] = Field( default=..., alias="group", title="Named sections for reader convenience", description=( "Organizes the mapping into manageable chunks for human review/ease of " "maintenance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the structure map", description=( "A formal identifier that is used to identify this structure map when " "it is represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) import_fhir: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="import", title="Other maps used by this map (canonical URLs)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureMap"], }, ) import__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_import", title="Extension field for ``import_fhir``." ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for structure map (if applicable)", description=( "A legal or geographic region in which the structure map is intended to" " be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this structure map (computer friendly)", description=( "A natural language name identifying the structure map. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the " "structure map." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this structure map is defined", description=( "Explanation of why this structure map is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this structure map. Enables tracking the life-cycle of " "the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) structure: typing.List[fhirtypes.StructureMapStructureType] | None = Field( default=None, alias="structure", title="Structure Definition used by this map", description=( "A structure definition used by this map. The structure definition may " "describe instances that are converted, or the instances that are " "produced." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this structure map (human friendly)", description="A short, descriptive, user-friendly title for the structure map.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this structure map, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this structure map when it is" " referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which at which an authoritative " "instance of this structure map is (or will be) published. This URL can" " be the target of a canonical reference. It SHALL remain the same when" " the structure map is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate structure map instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the structure map", description=( "The identifier that is used to identify this version of the structure " "map when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the structure map " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMap`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "structure", "import", "group", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMap`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "structure", "import", "group", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("name", "name__ext"), ("status", "status__ext"), ("url", "url__ext"), ] return required_fields class StructureMapGroup(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Named sections for reader convenience. Organizes the mapping into manageable chunks for human review/ease of maintenance. """ __resource_type__ = "StructureMapGroup" documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Additional description/explanation for group", description=( "Additional supporting documentation that explains the purpose of the " "group and the types of mappings within it." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) extends: fhirtypes.IdType | None = Field( default=None, alias="extends", title="Another group that this group adds rules to", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) extends__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_extends", title="Extension field for ``extends``." ) input: typing.List[fhirtypes.StructureMapGroupInputType] = Field( default=..., alias="input", title="Named instance provided when invoking the map", description=( "A name assigned to an instance of data. The instance must be provided " "when the mapping is invoked." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.IdType | None = Field( default=None, alias="name", title="Human-readable label", description="A unique name for the group for the convenience of human readers.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) rule: typing.List[fhirtypes.StructureMapGroupRuleType] = Field( default=..., alias="rule", title="Transform Rule from source to target", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) typeMode: fhirtypes.CodeType | None = Field( default=None, alias="typeMode", title="none | types | type-and-types", description=( "If this is the default rule set to apply for the source type or this " "combination of types." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["none", "types", "type-and-types"], }, ) typeMode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_typeMode", title="Extension field for ``typeMode``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapGroup`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "extends", "typeMode", "documentation", "input", "rule", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapGroup`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "name", "extends", "typeMode", "documentation", "input", "rule", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext"), ("typeMode", "typeMode__ext")] return required_fields class StructureMapGroupInput(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Named instance provided when invoking the map. A name assigned to an instance of data. The instance must be provided when the mapping is invoked. """ __resource_type__ = "StructureMapGroupInput" documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Documentation for this instance of data", description=None, json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="source | target", description="Mode for this instance of data.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["source", "target"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) name: fhirtypes.IdType | None = Field( default=None, alias="name", title="Name for this instance of data", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) type: fhirtypes.StringType | None = Field( default=None, alias="type", title="Type for this instance of data", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapGroupInput`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "type", "mode", "documentation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapGroupInput`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "name", "type", "mode"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("mode", "mode__ext"), ("name", "name__ext")] return required_fields class StructureMapGroupRule(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Transform Rule from source to target. """ __resource_type__ = "StructureMapGroupRule" dependent: typing.List[fhirtypes.StructureMapGroupRuleDependentType] | None = Field( default=None, alias="dependent", title="Which other rules to apply in the context of this rule", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Documentation for this instance of data", description=None, json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) name: fhirtypes.IdType | None = Field( default=None, alias="name", title="Name of the rule for internal references", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) rule: typing.List[fhirtypes.StructureMapGroupRuleType] | None = Field( default=None, alias="rule", title="Rules contained in this rule", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) source: typing.List[fhirtypes.StructureMapGroupRuleSourceType] = Field( default=..., alias="source", title="Source inputs to the mapping", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) target: typing.List[fhirtypes.StructureMapGroupRuleTargetType] | None = Field( default=None, alias="target", title="Content to create because of this mapping rule", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapGroupRule`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "source", "target", "rule", "dependent", "documentation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapGroupRule`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "name", "source", "target", "rule", "dependent"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields class StructureMapGroupRuleDependent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Which other rules to apply in the context of this rule. """ __resource_type__ = "StructureMapGroupRuleDependent" name: fhirtypes.IdType | None = Field( default=None, alias="name", title="Name of a rule or group to apply", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) variable: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="variable", title="Variable to pass to the rule or group", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) variable__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_variable", title="Extension field for ``variable``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapGroupRuleDependent`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "variable"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapGroupRuleDependent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "name", "variable"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext"), ("variable", "variable__ext")] return required_fields class StructureMapGroupRuleSource(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Source inputs to the mapping. """ __resource_type__ = "StructureMapGroupRuleSource" check: fhirtypes.StringType | None = Field( default=None, alias="check", title=( "FHIRPath expression - must be true or the mapping engine throws an " "error instead of completing" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) check__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_check", title="Extension field for ``check``." ) condition: fhirtypes.StringType | None = Field( default=None, alias="condition", title="FHIRPath expression - must be true or the rule does not apply", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) condition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_condition", title="Extension field for ``condition``." ) context: fhirtypes.IdType | None = Field( default=None, alias="context", title="Type or variable this rule applies to", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) context__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_context", title="Extension field for ``context``." ) defaultValueAddress: fhirtypes.AddressType | None = Field( default=None, alias="defaultValueAddress", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueAge: fhirtypes.AgeType | None = Field( default=None, alias="defaultValueAge", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="defaultValueAnnotation", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="defaultValueAttachment", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="defaultValueBase64Binary", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueBase64Binary", title="Extension field for ``defaultValueBase64Binary``.", ) defaultValueBoolean: bool | None = Field( default=None, alias="defaultValueBoolean", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueBoolean", title="Extension field for ``defaultValueBoolean``.", ) defaultValueCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="defaultValueCanonical", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueCanonical", title="Extension field for ``defaultValueCanonical``.", ) defaultValueCode: fhirtypes.CodeType | None = Field( default=None, alias="defaultValueCode", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueCode", title="Extension field for ``defaultValueCode``.", ) defaultValueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="defaultValueCodeableConcept", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueCoding: fhirtypes.CodingType | None = Field( default=None, alias="defaultValueCoding", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueContactDetail: fhirtypes.ContactDetailType | None = Field( default=None, alias="defaultValueContactDetail", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="defaultValueContactPoint", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueContributor: fhirtypes.ContributorType | None = Field( default=None, alias="defaultValueContributor", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueCount: fhirtypes.CountType | None = Field( default=None, alias="defaultValueCount", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDataRequirement: fhirtypes.DataRequirementType | None = Field( default=None, alias="defaultValueDataRequirement", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDate: fhirtypes.DateType | None = Field( default=None, alias="defaultValueDate", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueDate", title="Extension field for ``defaultValueDate``.", ) defaultValueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="defaultValueDateTime", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueDateTime", title="Extension field for ``defaultValueDateTime``.", ) defaultValueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="defaultValueDecimal", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueDecimal", title="Extension field for ``defaultValueDecimal``.", ) defaultValueDistance: fhirtypes.DistanceType | None = Field( default=None, alias="defaultValueDistance", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDosage: fhirtypes.DosageType | None = Field( default=None, alias="defaultValueDosage", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDuration: fhirtypes.DurationType | None = Field( default=None, alias="defaultValueDuration", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueExpression: fhirtypes.ExpressionType | None = Field( default=None, alias="defaultValueExpression", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="defaultValueHumanName", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueId: fhirtypes.IdType | None = Field( default=None, alias="defaultValueId", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueId", title="Extension field for ``defaultValueId``.", ) defaultValueIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="defaultValueIdentifier", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueInstant: fhirtypes.InstantType | None = Field( default=None, alias="defaultValueInstant", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueInstant", title="Extension field for ``defaultValueInstant``.", ) defaultValueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="defaultValueInteger", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueInteger", title="Extension field for ``defaultValueInteger``.", ) defaultValueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="defaultValueMarkdown", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueMarkdown", title="Extension field for ``defaultValueMarkdown``.", ) defaultValueMeta: fhirtypes.MetaType | None = Field( default=None, alias="defaultValueMeta", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueMoney: fhirtypes.MoneyType | None = Field( default=None, alias="defaultValueMoney", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueOid: fhirtypes.OidType | None = Field( default=None, alias="defaultValueOid", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueOid", title="Extension field for ``defaultValueOid``.", ) defaultValueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field( default=None, alias="defaultValueParameterDefinition", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="defaultValuePeriod", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="defaultValuePositiveInt", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValuePositiveInt", title="Extension field for ``defaultValuePositiveInt``.", ) defaultValueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="defaultValueQuantity", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueRange: fhirtypes.RangeType | None = Field( default=None, alias="defaultValueRange", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueRatio: fhirtypes.RatioType | None = Field( default=None, alias="defaultValueRatio", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="defaultValueReference", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field( default=None, alias="defaultValueRelatedArtifact", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="defaultValueSampledData", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueSignature: fhirtypes.SignatureType | None = Field( default=None, alias="defaultValueSignature", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueString: fhirtypes.StringType | None = Field( default=None, alias="defaultValueString", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueString", title="Extension field for ``defaultValueString``.", ) defaultValueTime: fhirtypes.TimeType | None = Field( default=None, alias="defaultValueTime", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueTime", title="Extension field for ``defaultValueTime``.", ) defaultValueTiming: fhirtypes.TimingType | None = Field( default=None, alias="defaultValueTiming", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field( default=None, alias="defaultValueTriggerDefinition", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="defaultValueUnsignedInt", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueUnsignedInt", title="Extension field for ``defaultValueUnsignedInt``.", ) defaultValueUri: fhirtypes.UriType | None = Field( default=None, alias="defaultValueUri", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueUri", title="Extension field for ``defaultValueUri``.", ) defaultValueUrl: fhirtypes.UrlType | None = Field( default=None, alias="defaultValueUrl", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueUrl", title="Extension field for ``defaultValueUrl``.", ) defaultValueUsageContext: fhirtypes.UsageContextType | None = Field( default=None, alias="defaultValueUsageContext", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueUuid: fhirtypes.UuidType | None = Field( default=None, alias="defaultValueUuid", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueUuid", title="Extension field for ``defaultValueUuid``.", ) element: fhirtypes.StringType | None = Field( default=None, alias="element", title="Optional field for this source", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) element__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_element", title="Extension field for ``element``." ) listMode: fhirtypes.CodeType | None = Field( default=None, alias="listMode", title="first | not_first | last | not_last | only_one", description="How to handle the list mode for this element.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["first", "not_first", "last", "not_last", "only_one"], }, ) listMode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_listMode", title="Extension field for ``listMode``." ) logMessage: fhirtypes.StringType | None = Field( default=None, alias="logMessage", title="Message to put in log if source exists (FHIRPath)", description=( "A FHIRPath expression which specifies a message to put in the " "transform log when content matching the source rule is found." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) logMessage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_logMessage", title="Extension field for ``logMessage``." ) max: fhirtypes.StringType | None = Field( default=None, alias="max", title="Specified maximum cardinality (number or *)", description=( 'Specified maximum cardinality for the element - a number or a "*". ' "This is optional; if present, it acts an implicit check on the input " "content (* just serves as documentation; it's the default value)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_max", title="Extension field for ``max``." ) min: fhirtypes.IntegerType | None = Field( default=None, alias="min", title="Specified minimum cardinality", description=( "Specified minimum cardinality for the element. This is optional; if " "present, it acts an implicit check on the input content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_min", title="Extension field for ``min``." ) type: fhirtypes.StringType | None = Field( default=None, alias="type", title="Rule only applies if source has this type", description=( "Specified type for the element. This works as a condition on the " "mapping - use for polymorphic elements." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) variable: fhirtypes.IdType | None = Field( default=None, alias="variable", title="Named context for field, if a field is specified", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) variable__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_variable", title="Extension field for ``variable``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapGroupRuleSource`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "context", "min", "max", "type", "defaultValueBase64Binary", "defaultValueBoolean", "defaultValueCanonical", "defaultValueCode", "defaultValueDate", "defaultValueDateTime", "defaultValueDecimal", "defaultValueId", "defaultValueInstant", "defaultValueInteger", "defaultValueMarkdown", "defaultValueOid", "defaultValuePositiveInt", "defaultValueString", "defaultValueTime", "defaultValueUnsignedInt", "defaultValueUri", "defaultValueUrl", "defaultValueUuid", "defaultValueAddress", "defaultValueAge", "defaultValueAnnotation", "defaultValueAttachment", "defaultValueCodeableConcept", "defaultValueCoding", "defaultValueContactPoint", "defaultValueCount", "defaultValueDistance", "defaultValueDuration", "defaultValueHumanName", "defaultValueIdentifier", "defaultValueMoney", "defaultValuePeriod", "defaultValueQuantity", "defaultValueRange", "defaultValueRatio", "defaultValueReference", "defaultValueSampledData", "defaultValueSignature", "defaultValueTiming", "defaultValueContactDetail", "defaultValueContributor", "defaultValueDataRequirement", "defaultValueExpression", "defaultValueParameterDefinition", "defaultValueRelatedArtifact", "defaultValueTriggerDefinition", "defaultValueUsageContext", "defaultValueDosage", "defaultValueMeta", "element", "listMode", "variable", "condition", "check", "logMessage", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapGroupRuleSource`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "context", "min", "max", "type", "defaultValueBase64Binary", "defaultValueBoolean", "defaultValueCanonical", "defaultValueCode", "defaultValueDate", "defaultValueDateTime", "defaultValueDecimal", "defaultValueId", "defaultValueInstant", "defaultValueInteger", "defaultValueMarkdown", "defaultValueOid", "defaultValuePositiveInt", "defaultValueString", "defaultValueTime", "defaultValueUnsignedInt", "defaultValueUri", "defaultValueUrl", "defaultValueUuid", "defaultValueAddress", "defaultValueAge", "defaultValueAnnotation", "defaultValueAttachment", "defaultValueCodeableConcept", "defaultValueCoding", "defaultValueContactPoint", "defaultValueCount", "defaultValueDistance", "defaultValueDuration", "defaultValueHumanName", "defaultValueIdentifier", "defaultValueMoney", "defaultValuePeriod", "defaultValueQuantity", "defaultValueRange", "defaultValueRatio", "defaultValueReference", "defaultValueSampledData", "defaultValueSignature", "defaultValueTiming", "defaultValueContactDetail", "defaultValueContributor", "defaultValueDataRequirement", "defaultValueExpression", "defaultValueParameterDefinition", "defaultValueRelatedArtifact", "defaultValueTriggerDefinition", "defaultValueUsageContext", "defaultValueDosage", "defaultValueMeta", "element", "listMode", "variable", "condition", "check", "logMessage", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("context", "context__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "defaultValue": [ "defaultValueAddress", "defaultValueAge", "defaultValueAnnotation", "defaultValueAttachment", "defaultValueBase64Binary", "defaultValueBoolean", "defaultValueCanonical", "defaultValueCode", "defaultValueCodeableConcept", "defaultValueCoding", "defaultValueContactDetail", "defaultValueContactPoint", "defaultValueContributor", "defaultValueCount", "defaultValueDataRequirement", "defaultValueDate", "defaultValueDateTime", "defaultValueDecimal", "defaultValueDistance", "defaultValueDosage", "defaultValueDuration", "defaultValueExpression", "defaultValueHumanName", "defaultValueId", "defaultValueIdentifier", "defaultValueInstant", "defaultValueInteger", "defaultValueMarkdown", "defaultValueMeta", "defaultValueMoney", "defaultValueOid", "defaultValueParameterDefinition", "defaultValuePeriod", "defaultValuePositiveInt", "defaultValueQuantity", "defaultValueRange", "defaultValueRatio", "defaultValueReference", "defaultValueRelatedArtifact", "defaultValueSampledData", "defaultValueSignature", "defaultValueString", "defaultValueTime", "defaultValueTiming", "defaultValueTriggerDefinition", "defaultValueUnsignedInt", "defaultValueUri", "defaultValueUrl", "defaultValueUsageContext", "defaultValueUuid", ] } return one_of_many_fields class StructureMapGroupRuleTarget(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Content to create because of this mapping rule. """ __resource_type__ = "StructureMapGroupRuleTarget" context: fhirtypes.IdType | None = Field( default=None, alias="context", title="Type or variable this rule applies to", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) context__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_context", title="Extension field for ``context``." ) contextType: fhirtypes.CodeType | None = Field( default=None, alias="contextType", title="type | variable", description="How to interpret the context.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["type", "variable"], }, ) contextType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contextType", title="Extension field for ``contextType``." ) element: fhirtypes.StringType | None = Field( default=None, alias="element", title="Field to create in the context", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) element__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_element", title="Extension field for ``element``." ) listMode: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="listMode", title="first | share | last | collate", description="If field is a list, how to manage the list.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["first", "share", "last", "collate"], }, ) listMode__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_listMode", title="Extension field for ``listMode``." ) listRuleId: fhirtypes.IdType | None = Field( default=None, alias="listRuleId", title="Internal rule reference for shared list items", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) listRuleId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_listRuleId", title="Extension field for ``listRuleId``." ) parameter: typing.List[ fhirtypes.StructureMapGroupRuleTargetParameterType ] | None = Field( default=None, alias="parameter", title="Parameters to the transform", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) transform: fhirtypes.CodeType | None = Field( default=None, alias="transform", title="create | copy +", description="How the data is copied / created.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["create", "copy", "+"], }, ) transform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_transform", title="Extension field for ``transform``." ) variable: fhirtypes.IdType | None = Field( default=None, alias="variable", title="Named context for field, if desired, and a field is specified", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) variable__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_variable", title="Extension field for ``variable``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapGroupRuleTarget`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "context", "contextType", "element", "variable", "listMode", "listRuleId", "transform", "parameter", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapGroupRuleTarget`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "context", "contextType", "element", "variable", "listMode", "listRuleId", "transform", "parameter", ] class StructureMapGroupRuleTargetParameter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Parameters to the transform. """ __resource_type__ = "StructureMapGroupRuleTargetParameter" valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Parameter value - variable or literal", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Parameter value - variable or literal", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueId: fhirtypes.IdType | None = Field( default=None, alias="valueId", title="Parameter value - variable or literal", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueId", title="Extension field for ``valueId``." ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Parameter value - variable or literal", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Parameter value - variable or literal", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapGroupRuleTargetParameter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "valueId", "valueString", "valueBoolean", "valueInteger", "valueDecimal", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapGroupRuleTargetParameter`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "valueId", "valueString", "valueBoolean", "valueInteger", "valueDecimal", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueDecimal", "valueId", "valueInteger", "valueString", ] } return one_of_many_fields class StructureMapStructure(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Structure Definition used by this map. A structure definition used by this map. The structure definition may describe instances that are converted, or the instances that are produced. """ __resource_type__ = "StructureMapStructure" alias: fhirtypes.StringType | None = Field( default=None, alias="alias", title="Name for type in this map", description="The name used for this type in the map.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) alias__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_alias", title="Extension field for ``alias``." ) documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Documentation on use of structure", description="Documentation that describes how the structure is used in the mapping.", json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="source | queried | target | produced", description="How the referenced structure is used in this mapping.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["source", "queried", "target", "produced"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) url: fhirtypes.CanonicalType | None = Field( default=None, alias="url", title="Canonical reference to structure definition", description="The canonical reference to the structure.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapStructure`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "url", "mode", "alias", "documentation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapStructure`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "url", "mode", "alias"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("mode", "mode__ext"), ("url", "url__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/subscription.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Subscription Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Subscription(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Server push subscription criteria. The subscription resource is used to define a push-based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system can take an appropriate action. """ __resource_type__ = "Subscription" channel: fhirtypes.SubscriptionChannelType = Field( default=..., alias="channel", title="The channel on which to report matches to the criteria", description=( "Details where to send notifications when resources are received that " "meet the criteria." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="contact", title="Contact details for source (e.g. troubleshooting)", description=( "Contact details for a human to contact about the subscription. The " "primary use of this for system administrator troubleshooting." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) criteria: fhirtypes.StringType | None = Field( default=None, alias="criteria", title="Rule for server push", description=( "The rules that the server should use to determine when to generate " "notifications for this subscription." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) criteria__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_criteria", title="Extension field for ``criteria``." ) end: fhirtypes.InstantType | None = Field( default=None, alias="end", title="When to automatically delete the subscription", description="The time for the server to turn the subscription off.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_end", title="Extension field for ``end``." ) error: fhirtypes.StringType | None = Field( default=None, alias="error", title="Latest error note", description=( "A record of the last error that occurred when the server processed a " "notification." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) error__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_error", title="Extension field for ``error``." ) reason: fhirtypes.StringType | None = Field( default=None, alias="reason", title="Description of why this subscription was created", description="A description of why this subscription is defined.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) reason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reason", title="Extension field for ``reason``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="requested | active | error | off", description=( "The status of the subscription, which marks the server state for " "managing the subscription." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["requested", "active", "error", "off"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Subscription`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "status", "contact", "end", "reason", "criteria", "error", "channel", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Subscription`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "status", "contact", "end", "reason", "criteria", "error", "channel", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("criteria", "criteria__ext"), ("reason", "reason__ext"), ("status", "status__ext"), ] return required_fields class SubscriptionChannel(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The channel on which to report matches to the criteria. Details where to send notifications when resources are received that meet the criteria. """ __resource_type__ = "SubscriptionChannel" endpoint: fhirtypes.UrlType | None = Field( default=None, alias="endpoint", title="Where the channel points to", description="The url that describes the actual end-point to send messages to.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endpoint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_endpoint", title="Extension field for ``endpoint``." ) header: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="header", title="Usage depends on the channel type", description="Additional headers / information to send as part of the notification.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) header__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_header", title="Extension field for ``header``." ) payload: fhirtypes.CodeType | None = Field( default=None, alias="payload", title="MIME type to send, or omit for no payload", description=( "The mime type to send the payload in - either application/fhir+xml, or" " application/fhir+json. If the payload is not present, then there is " "no payload in the notification, just a notification. The mime type " '"text/plain" may also be used for Email and SMS subscriptions.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) payload__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_payload", title="Extension field for ``payload``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="rest-hook | websocket | email | sms | message", description="The type of channel to send notifications on.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["rest-hook", "websocket", "email", "sms", "message"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubscriptionChannel`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "endpoint", "payload", "header", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubscriptionChannel`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "endpoint", "payload", "header"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/subscriptionstatus.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SubscriptionStatus Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class SubscriptionStatus(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Status information about a Subscription provided during event notification. The SubscriptionStatus resource describes the state of a Subscription during notifications. """ __resource_type__ = "SubscriptionStatus" error: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="error", title="List of errors on the subscription", description=( "A record of errors that occurred when the server processed a " "notification." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) eventsSinceSubscriptionStart: fhirtypes.StringType | None = Field( default=None, alias="eventsSinceSubscriptionStart", title="Events since the Subscription was created", description=( "The total number of actual events which have been generated since the " "Subscription was created (inclusive of this notification) - regardless" " of how many have been successfully communicated. This number is NOT " "incremented for handshake and heartbeat notifications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) eventsSinceSubscriptionStart__ext: fhirtypes.FHIRPrimitiveExtensionType | None = ( Field( default=None, alias="_eventsSinceSubscriptionStart", title="Extension field for ``eventsSinceSubscriptionStart``.", ) ) notificationEvent: typing.List[ fhirtypes.SubscriptionStatusNotificationEventType ] | None = Field( default=None, alias="notificationEvent", title="Detailed information about any events relevant to this notification", description=( "Detailed information about events relevant to this subscription " "notification." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="requested | active | error | off | entered-in-error", description=( "The status of the subscription, which marks the server state for " "managing the subscription." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["requested", "active", "error", "off", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subscription: fhirtypes.ReferenceType = Field( default=..., alias="subscription", title="Reference to the Subscription responsible for this notification", description="The reference to the Subscription which generated this notification.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Subscription"], }, ) topic: fhirtypes.CanonicalType | None = Field( default=None, alias="topic", title="Reference to the SubscriptionTopic this notification relates to", description=( "The reference to the SubscriptionTopic for the Subscription which " "generated this notification." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SubscriptionTopic"], }, ) topic__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_topic", title="Extension field for ``topic``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "handshake | heartbeat | event-notification | query-status | query-" "event" ), description="The type of event being conveyed with this notificaiton.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "handshake", "heartbeat", "event-notification", "query-status", "query-event", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubscriptionStatus`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "status", "type", "eventsSinceSubscriptionStart", "notificationEvent", "subscription", "topic", "error", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubscriptionStatus`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "status", "type", "eventsSinceSubscriptionStart", "subscription", "topic", "error", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields class SubscriptionStatusNotificationEvent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Detailed information about any events relevant to this notification. Detailed information about events relevant to this subscription notification. """ __resource_type__ = "SubscriptionStatusNotificationEvent" additionalContext: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="additionalContext", title="Additional context for this event", description=( "Additional context information for this event. Generally, this will " "contain references to additional resources included with the event " "(e.g., the Patient relevant to an Encounter), however it MAY refer to " "non-FHIR objects." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) eventNumber: fhirtypes.StringType | None = Field( default=None, alias="eventNumber", title="Event number", description=( "The sequential number of this event in this subscription context. Note" " that this value is a 64-bit integer value, encoded as a string." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) eventNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_eventNumber", title="Extension field for ``eventNumber``." ) focus: fhirtypes.ReferenceType | None = Field( default=None, alias="focus", title="The focus of this event", description=( "The focus of this event. While this will usually be a reference to the" " focus resource of the event, it MAY contain a reference to a non-FHIR" " object." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) timestamp: fhirtypes.InstantType | None = Field( default=None, alias="timestamp", title="The instant this event occurred", description="The actual time this event occured on the server.", json_schema_extra={ "element_property": True, }, ) timestamp__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timestamp", title="Extension field for ``timestamp``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubscriptionStatusNotificationEvent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "eventNumber", "timestamp", "focus", "additionalContext", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubscriptionStatusNotificationEvent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("eventNumber", "eventNumber__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/subscriptiontopic.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SubscriptionTopic Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class SubscriptionTopic(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The definition of a specific topic for triggering events within the Subscriptions framework. Describes a stream of resource state changes or events and annotated with labels useful to filter projections from this topic. """ __resource_type__ = "SubscriptionTopic" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When SubscriptionTopic is/was approved by publisher", description=( "The date on which the asset content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) canFilterBy: typing.List[fhirtypes.SubscriptionTopicCanFilterByType] | None = Field( default=None, alias="canFilterBy", title=( "Properties by which a Subscription can filter notifications from the " "SubscriptionTopic" ), description=( "List of properties by which Subscriptions on the SubscriptionTopic can" " be filtered. May be defined Search Parameters (e.g., " "Encounter.patient) or parameters defined within this SubscriptionTopic" " context (e.g., hub.event)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the SubscriptionTopic and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the SubscriptionTopic." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date status first applied", description=( "For draft definitions, indicates the date of initial creation. For " "active definitions, represents the date of activation. For withdrawn " "definitions, indicates the date of withdrawal." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) derivedFrom: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="derivedFrom", title="Based on FHIR protocol or definition", description=( "The canonical URL pointing to another FHIR-defined SubscriptionTopic " "that is adhered to in whole or in part by this SubscriptionTopic." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SubscriptionTopic"], }, ) derivedFrom__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_derivedFrom", title="Extension field for ``derivedFrom``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the SubscriptionTopic", description=( "A free text natural language description of the Topic from the " "consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="The effective date range for the SubscriptionTopic", description=( "The period during which the SubscriptionTopic content was or is " "planned to be effective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) eventTrigger: typing.List[ fhirtypes.SubscriptionTopicEventTriggerType ] | None = Field( default=None, alias="eventTrigger", title="Event definitions the SubscriptionTopic", description="Event definition which can be used to trigger the SubscriptionTopic.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="If for testing purposes, not real usage", description=( "A flag to indicate that this TopSubscriptionTopicic is authored for " "testing purposes (or education/evaluation/marketing), and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for this subscription topic", description=( "Business identifiers assigned to this subscription topic by the " "performer and/or other systems. These identifiers remain constant as " "the resource is updated and propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction of the SubscriptionTopic (if applicable)", description="A jurisdiction in which the Topic is intended to be used.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="Date the Subscription Topic was last reviewed by the publisher", description=( "The date on which the asset content was last reviewed. Review happens " "periodically after that, but doesn't change the original approval " "date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) notificationShape: typing.List[ fhirtypes.SubscriptionTopicNotificationShapeType ] | None = Field( default=None, alias="notificationShape", title=( "Properties for describing the shape of notifications generated by this" " topic" ), description=( "List of properties to describe the shape (e.g., resources) included in" " notifications from this Subscription Topic." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title=( "The name of the individual or organization that published the " "SubscriptionTopic" ), description=( 'Helps establish the "authority/credibility" of the SubscriptionTopic.' " May also allow for contact." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this SubscriptionTopic is defined", description=( "Explains why this Topic is needed and why it has been designed as it " "has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) resourceTrigger: typing.List[ fhirtypes.SubscriptionTopicResourceTriggerType ] | None = Field( default=None, alias="resourceTrigger", title="Definition of a resource-based trigger for the subscription topic", description=( "A definition of a resource-based event that triggers a notification " "based on the SubscriptionTopic. The criteria may be just a human " "readable description and/or a full FHIR search string or FHIRPath " "expression. Multiple triggers are considered OR joined (e.g., a " "resource update matching ANY of the definitions will trigger a " "notification)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description="The current state of the SubscriptionTopic.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this subscription topic (Human friendly)", description=( "A short, descriptive, user-friendly title for the SubscriptionTopic, " 'for example, "admission".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this subscription topic definition, " "represented as a URI (globally unique)" ), description=( "An absolute URI that is used to identify this subscription topic when " "it is referenced in a specification, model, design or an instance; " "also called its canonical identifier. This SHOULD be globally unique " "and SHOULD be a literal address at which at which an authoritative " "instance of this subscription topic is (or will be) published. This " "URL can be the target of a canonical reference. It SHALL remain the " "same when the subscription topic is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Content intends to support these contexts", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching of code system definitions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the subscription topic", description=( "The identifier that is used to identify this version of the " "subscription topic when it is referenced in a specification, model, " "design or instance. This is an arbitrary value managed by the Topic " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions are orderable." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubscriptionTopic`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "title", "derivedFrom", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "approvalDate", "lastReviewDate", "effectivePeriod", "resourceTrigger", "eventTrigger", "canFilterBy", "notificationShape", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubscriptionTopic`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "title", "derivedFrom", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "effectivePeriod", "resourceTrigger", "eventTrigger", "canFilterBy", "notificationShape", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext"), ("url", "url__ext")] return required_fields class SubscriptionTopicCanFilterBy(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Properties by which a Subscription can filter notifications from the SubscriptionTopic. List of properties by which Subscriptions on the SubscriptionTopic can be filtered. May be defined Search Parameters (e.g., Encounter.patient) or parameters defined within this SubscriptionTopic context (e.g., hub.event). """ __resource_type__ = "SubscriptionTopicCanFilterBy" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Description of this filter parameter", description="Description of how this filtering parameter is intended to be used.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) filterDefinition: fhirtypes.UriType | None = Field( default=None, alias="filterDefinition", title="Canonical URL for a filterParameter definition", description=( "Either the canonical URL to a search parameter (like " '"http://hl7.org/fhir/SearchParameter/encounter-patient") or the ' "officially-defined URI for a shared filter concept (like " '"http://example.org/concepts/shared-common-event").' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) filterDefinition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_filterDefinition", title="Extension field for ``filterDefinition``.", ) filterParameter: fhirtypes.StringType | None = Field( default=None, alias="filterParameter", title=( "Human-readable and computation-friendly name for a filter parameter " "usable by subscriptions on this topic, via " "Subscription.filterBy.filterParameter" ), description=( "Either the canonical URL to a search parameter (like " '"http://hl7.org/fhir/SearchParameter/encounter-patient") or topic-' 'defined parameter (like "hub.event") which is a label for the filter.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) filterParameter__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_filterParameter", title="Extension field for ``filterParameter``.", ) modifier: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="modifier", title=( "= | eq | ne | gt | lt | ge | le | sa | eb | ap | above | below | in | " "not-in | of-type" ), description=( "Allowable operators to apply when determining matches (Search " "Modifiers). If the filterParameter is a SearchParameter, this list of" " modifiers SHALL be a strict subset of the modifiers defined on that " "SearchParameter." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "=", "eq", "ne", "gt", "lt", "ge", "le", "sa", "eb", "ap", "above", "below", "in", "not-in", "of-type", ], }, ) modifier__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_modifier", title="Extension field for ``modifier``." ) resource: fhirtypes.UriType | None = Field( default=None, alias="resource", title="URL of the triggering Resource that this filter applies to", description=( "URL of the Resource that is the type used in this filter. This is the " '"focus" of the topic (or one of them if there are more than one). It ' "will be the same, a generality, or a specificity of " "SubscriptionTopic.resourceTrigger.resource or " "SubscriptionTopic.eventTrigger.resource when they are present." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resource", title="Extension field for ``resource``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubscriptionTopicCanFilterBy`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "resource", "filterParameter", "filterDefinition", "modifier", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubscriptionTopicCanFilterBy`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "description", "resource", "filterParameter", "filterDefinition", "modifier", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("filterParameter", "filterParameter__ext")] return required_fields class SubscriptionTopicEventTrigger(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Event definitions the SubscriptionTopic. Event definition which can be used to trigger the SubscriptionTopic. """ __resource_type__ = "SubscriptionTopicEventTrigger" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Text representation of the event trigger", description=( "The human readable description of an event to trigger a notification " 'for the SubscriptionTopic - for example, "Patient Admission, as ' 'defined in HL7v2 via message ADT^A01". Multiple values are considered ' "OR joined (e.g., matching any single event listed)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) event: fhirtypes.CodeableConceptType = Field( default=..., alias="event", title="Event which can trigger a notification from the SubscriptionTopic", description=( "A well-defined event which can be used to trigger notifications from " "the SubscriptionTopic." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) resource: fhirtypes.UriType | None = Field( default=None, alias="resource", title=( "Data Type or Resource (reference to definition) for this trigger " "definition" ), description=( "URL of the Resource that is the focus type used in this event trigger." " Relative URLs are relative to the StructureDefinition root of the " "implemented FHIR version (e.g., " 'http://hl7.org/fhir/StructureDefinition). For example, "Patient" maps ' "to http://hl7.org/fhir/StructureDefinition/Patient. For more " 'information, see ElementDefinition.type.code.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resource", title="Extension field for ``resource``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubscriptionTopicEventTrigger`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "event", "resource", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubscriptionTopicEventTrigger`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "description", "event", "resource"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("resource", "resource__ext")] return required_fields class SubscriptionTopicNotificationShape(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Properties for describing the shape of notifications generated by this topic. List of properties to describe the shape (e.g., resources) included in notifications from this Subscription Topic. """ __resource_type__ = "SubscriptionTopicNotificationShape" include: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="include", title="Include directives, rooted in the resource for this shape", description=( "Search-style _include directives, rooted in the resource for this " "shape. Servers SHOULD include resources listed here, if they exist and" " the user is authorized to receive them. Clients SHOULD be prepared " "to receive these additional resources, but SHALL function properly " "without them." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) include__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_include", title="Extension field for ``include``." ) resource: fhirtypes.UriType | None = Field( default=None, alias="resource", title=( "URL of the Resource that is the focus (main) resource in a " "notification shape" ), description=( "URL of the Resource that is the type used in this shape. This is the " '"focus" of the topic (or one of them if there are more than one) and ' "the root resource for this shape definition. It will be the same, a " "generality, or a specificity of " "SubscriptionTopic.resourceTrigger.resource or " "SubscriptionTopic.eventTrigger.resource when they are present." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resource", title="Extension field for ``resource``." ) revInclude: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="revInclude", title="Reverse include directives, rooted in the resource for this shape", description=( "Search-style _revinclude directives, rooted in the resource for this " "shape. Servers SHOULD include resources listed here, if they exist and" " the user is authorized to receive them. Clients SHOULD be prepared " "to receive these additional resources, but SHALL function properly " "without them." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) revInclude__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_revInclude", title="Extension field for ``revInclude``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubscriptionTopicNotificationShape`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "resource", "include", "revInclude", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubscriptionTopicNotificationShape`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "resource", "include", "revInclude"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("resource", "resource__ext")] return required_fields class SubscriptionTopicResourceTrigger(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of a resource-based trigger for the subscription topic. A definition of a resource-based event that triggers a notification based on the SubscriptionTopic. The criteria may be just a human readable description and/or a full FHIR search string or FHIRPath expression. Multiple triggers are considered OR joined (e.g., a resource update matching ANY of the definitions will trigger a notification). """ __resource_type__ = "SubscriptionTopicResourceTrigger" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Text representation of the resource trigger", description=( "The human readable description of this resource trigger for the " "SubscriptionTopic - for example, \"An Encounter enters the 'in-" "progress' state\"." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) fhirPathCriteria: fhirtypes.StringType | None = Field( default=None, alias="fhirPathCriteria", title="FHIRPath based trigger rule", description=( "The FHIRPath based rules that the server should use to determine when " "to trigger a notification for this topic." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) fhirPathCriteria__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fhirPathCriteria", title="Extension field for ``fhirPathCriteria``.", ) queryCriteria: fhirtypes.SubscriptionTopicResourceTriggerQueryCriteriaType | None = Field( default=None, alias="queryCriteria", title="Query based trigger rule", description=( "The FHIR query based rules that the server should use to determine " "when to trigger a notification for this subscription topic." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) resource: fhirtypes.UriType | None = Field( default=None, alias="resource", title=( "Data Type or Resource (reference to definition) for this trigger " "definition" ), description=( "URL of the Resource that is the type used in this resource trigger. " "Relative URLs are relative to the StructureDefinition root of the " "implemented FHIR version (e.g., " 'http://hl7.org/fhir/StructureDefinition). For example, "Patient" maps ' "to http://hl7.org/fhir/StructureDefinition/Patient. For more " 'information, see ElementDefinition.type.code.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resource", title="Extension field for ``resource``." ) supportedInteraction: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="supportedInteraction", title="create | update | delete", description=( "The FHIR RESTful interaction which can be used to trigger a " "notification for the SubscriptionTopic. Multiple values are considered" " OR joined (e.g., CREATE or UPDATE)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["create", "update", "delete"], }, ) supportedInteraction__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_supportedInteraction", title="Extension field for ``supportedInteraction``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubscriptionTopicResourceTrigger`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "resource", "supportedInteraction", "queryCriteria", "fhirPathCriteria", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubscriptionTopicResourceTrigger`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "description", "resource", "supportedInteraction", "queryCriteria", "fhirPathCriteria", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("resource", "resource__ext")] return required_fields class SubscriptionTopicResourceTriggerQueryCriteria(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Query based trigger rule. The FHIR query based rules that the server should use to determine when to trigger a notification for this subscription topic. """ __resource_type__ = "SubscriptionTopicResourceTriggerQueryCriteria" current: fhirtypes.StringType | None = Field( default=None, alias="current", title="Rule applied to current resource state", description=( "The FHIR query based rules are applied to the current resource state " "(e.g., state after an update)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) current__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_current", title="Extension field for ``current``." ) previous: fhirtypes.StringType | None = Field( default=None, alias="previous", title="Rule applied to previous resource state", description=( "The FHIR query based rules are applied to the previous resource state " "(e.g., state before an update)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) previous__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_previous", title="Extension field for ``previous``." ) requireBoth: bool | None = Field( default=None, alias="requireBoth", title="Both must be true flag", description=( "If set to true, both current and previous criteria must evaluate true " "to trigger a notification for this topic. Otherwise a notification " "for this topic will be triggered if either one evaluates to true." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) requireBoth__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requireBoth", title="Extension field for ``requireBoth``." ) resultForCreate: fhirtypes.CodeType | None = Field( default=None, alias="resultForCreate", title="test-passes | test-fails", description=( 'For "create" interactions, should the "previous" criteria count as an ' "automatic pass or an automatic fail." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["test-passes", "test-fails"], }, ) resultForCreate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resultForCreate", title="Extension field for ``resultForCreate``.", ) resultForDelete: fhirtypes.CodeType | None = Field( default=None, alias="resultForDelete", title="test-passes | test-fails", description=( 'For "delete" interactions, should the "current" criteria count as an ' "automatic pass or an automatic fail." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["test-passes", "test-fails"], }, ) resultForDelete__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resultForDelete", title="Extension field for ``resultForDelete``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubscriptionTopicResourceTriggerQueryCriteria`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "previous", "resultForCreate", "current", "resultForDelete", "requireBoth", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubscriptionTopicResourceTriggerQueryCriteria`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "previous", "resultForCreate", "current", "resultForDelete", "requireBoth", ] ================================================ FILE: fhir/resources/R4B/substance.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Substance Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Substance(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A homogeneous material with a definite composition. """ __resource_type__ = "Substance" category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="What class/type of substance this is", description=( "A code that classifies the general type of substance. This is used " "for searching, sorting and display purposes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="What substance this is", description="A code (or set of codes) that identify this substance.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Textual description of the substance, comments", description=( "A description of the substance - its appearance, handling " "requirements, and other usage notes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique identifier", description="Unique identifier for the substance.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ingredient: typing.List[fhirtypes.SubstanceIngredientType] | None = Field( default=None, alias="ingredient", title="Composition information about the substance", description="A substance can be composed of other substances.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instance: typing.List[fhirtypes.SubstanceInstanceType] | None = Field( default=None, alias="instance", title="If this describes a specific package/container of the substance", description=( "Substance may be used to describe a kind of substance, or a specific " "package/container of the substance: an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | inactive | entered-in-error", description="A code to indicate if the substance is actively used.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "inactive", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Substance`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "category", "code", "description", "instance", "ingredient", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Substance`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "category", "code", "description", "instance", "ingredient", ] class SubstanceIngredient(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Composition information about the substance. A substance can be composed of other substances. """ __resource_type__ = "SubstanceIngredient" quantity: fhirtypes.RatioType | None = Field( default=None, alias="quantity", title="Optional amount (concentration)", description="The amount of the ingredient in the substance - a concentration ratio.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) substanceCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="substanceCodeableConcept", title="A component of the substance", description="Another substance that is a component of this substance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e substance[x] "one_of_many": "substance", "one_of_many_required": True, }, ) substanceReference: fhirtypes.ReferenceType | None = Field( default=None, alias="substanceReference", title="A component of the substance", description="Another substance that is a component of this substance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e substance[x] "one_of_many": "substance", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Substance"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceIngredient`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "quantity", "substanceCodeableConcept", "substanceReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceIngredient`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "quantity", "substanceCodeableConcept", "substanceReference", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "substance": ["substanceCodeableConcept", "substanceReference"] } return one_of_many_fields class SubstanceInstance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. If this describes a specific package/container of the substance. Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance. """ __resource_type__ = "SubstanceInstance" expiry: fhirtypes.DateTimeType | None = Field( default=None, alias="expiry", title="When no longer valid to use", description=( "When the substance is no longer valid to use. For some substances, a " "single arbitrary date is used for expiry." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) expiry__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expiry", title="Extension field for ``expiry``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Identifier of the package/container", description=( "Identifier associated with the package/container (usually a label " "affixed directly)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Amount of substance in the package", description="The amount of the substance.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceInstance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "expiry", "quantity", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceInstance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "identifier", "expiry", "quantity"] ================================================ FILE: fhir/resources/R4B/substancedefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SubstanceDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class SubstanceDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The detailed description of a substance, typically at a level beyond what is used for prescribing. """ __resource_type__ = "SubstanceDefinition" classification: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="classification", title=( "A categorization, high level e.g. polymer or nucleic acid, or food, " "chemical, biological, or lower e.g. polymer linear or branch chain, or" " type of impurity" ), description=( "A high level categorization, e.g. polymer or nucleic acid, or food, " "chemical, biological, or a lower level such as the general types of " "polymer (linear or branch chain) or type of impurity (process related " "or contaminant)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: typing.List[fhirtypes.SubstanceDefinitionCodeType] | None = Field( default=None, alias="code", title="Codes associated with the substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Textual description of the substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) domain: fhirtypes.CodeableConceptType | None = Field( default=None, alias="domain", title="If the substance applies to human or veterinary use", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) grade: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="grade", title=( "The quality standard, established benchmark, to which substance " "complies (e.g. USP/NF, BP)" ), description=( "The quality standard, established benchmark, to which substance " "complies (e.g. USP/NF, Ph. Eur, JP, BP, Company Standard)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifier by which this substance is known", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) informationSource: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="informationSource", title="Supporting literature", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Citation"], }, ) manufacturer: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="manufacturer", title="The entity that creates, makes, produces or fabricates the substance", description=( "The entity that creates, makes, produces or fabricates the substance. " "This is a set of potential manufacturers but is not necessarily " "comprehensive." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) moiety: typing.List[fhirtypes.SubstanceDefinitionMoietyType] | None = Field( default=None, alias="moiety", title="Moiety, for structural modifications", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) molecularWeight: typing.List[ fhirtypes.SubstanceDefinitionMolecularWeightType ] | None = Field( default=None, alias="molecularWeight", title="The molecular weight or weight range", description=( "The molecular weight or weight range (for proteins, polymers or " "nucleic acids)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: typing.List[fhirtypes.SubstanceDefinitionNameType] | None = Field( default=None, alias="name", title="Names applicable to this substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Textual comment about the substance's catalogue or registry record", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) property: typing.List[fhirtypes.SubstanceDefinitionPropertyType] | None = Field( default=None, alias="property", title="General specifications for this substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) relationship: typing.List[ fhirtypes.SubstanceDefinitionRelationshipType ] | None = Field( default=None, alias="relationship", title="A link between this substance and another", description=( "A link between this substance and another, with details of the " "relationship." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sourceMaterial: fhirtypes.SubstanceDefinitionSourceMaterialType | None = Field( default=None, alias="sourceMaterial", title="Material or taxonomic/anatomical source", description="Material or taxonomic/anatomical source for the substance.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeableConceptType | None = Field( default=None, alias="status", title="Status of substance within the catalogue e.g. active, retired", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) structure: fhirtypes.SubstanceDefinitionStructureType | None = Field( default=None, alias="structure", title="Structural information", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) supplier: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supplier", title=( "An entity that is the source for the substance. It may be different " "from the manufacturer" ), description=( "An entity that is the source for the substance. It may be different " "from the manufacturer. Supplier is synonymous to a distributor." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="A business level version identifier of the substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "version", "status", "classification", "domain", "grade", "description", "informationSource", "note", "manufacturer", "supplier", "moiety", "property", "molecularWeight", "structure", "code", "name", "relationship", "sourceMaterial", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "version", "status", "classification", "domain", "grade", "description", "informationSource", "note", "manufacturer", "supplier", "moiety", "property", "molecularWeight", "structure", "code", "name", "relationship", "sourceMaterial", ] class SubstanceDefinitionCode(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Codes associated with the substance. """ __resource_type__ = "SubstanceDefinitionCode" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="The specific code", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Any comment can be provided in this field", description="Any comment can be provided in this field, if necessary.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) source: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="source", title="Supporting literature", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) status: fhirtypes.CodeableConceptType | None = Field( default=None, alias="status", title="Status of the code assignment, for example 'provisional', 'approved'", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) statusDate: fhirtypes.DateTimeType | None = Field( default=None, alias="statusDate", title="The date at which the code status was changed", description=( "The date at which the code status was changed as part of the " "terminology maintenance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_statusDate", title="Extension field for ``statusDate``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceDefinitionCode`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "status", "statusDate", "note", "source", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionCode`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "status", "statusDate", "note", "source"] class SubstanceDefinitionMoiety(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Moiety, for structural modifications. """ __resource_type__ = "SubstanceDefinitionMoiety" amountQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="amountQuantity", title="Quantitative value for this moiety", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e amount[x] "one_of_many": "amount", "one_of_many_required": False, }, ) amountString: fhirtypes.StringType | None = Field( default=None, alias="amountString", title="Quantitative value for this moiety", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e amount[x] "one_of_many": "amount", "one_of_many_required": False, }, ) amountString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_amountString", title="Extension field for ``amountString``.", ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Identifier by which this moiety substance is known", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) measurementType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="measurementType", title="The measurement type of the quantitative value", description=( "The measurement type of the quantitative value. In capturing the " "actual relative amounts of substances or molecular fragments it may be" " necessary to indicate whether the amount refers to, for example, a " "mole ratio or weight ratio." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) molecularFormula: fhirtypes.StringType | None = Field( default=None, alias="molecularFormula", title="Molecular formula for this moiety (e.g. with the Hill system)", description=( "Molecular formula for this moiety of this substance, typically using " "the Hill system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) molecularFormula__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_molecularFormula", title="Extension field for ``molecularFormula``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Textual name for this moiety substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) opticalActivity: fhirtypes.CodeableConceptType | None = Field( default=None, alias="opticalActivity", title="Optical activity type", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="Role that the moiety is playing", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) stereochemistry: fhirtypes.CodeableConceptType | None = Field( default=None, alias="stereochemistry", title="Stereochemistry type", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceDefinitionMoiety`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "role", "identifier", "name", "stereochemistry", "opticalActivity", "molecularFormula", "amountQuantity", "amountString", "measurementType", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionMoiety`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "role", "identifier", "name", "stereochemistry", "opticalActivity", "molecularFormula", "amountQuantity", "amountString", "measurementType", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"amount": ["amountQuantity", "amountString"]} return one_of_many_fields class SubstanceDefinitionMolecularWeight(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The molecular weight or weight range. The molecular weight or weight range (for proteins, polymers or nucleic acids). """ __resource_type__ = "SubstanceDefinitionMolecularWeight" amount: fhirtypes.QuantityType = Field( default=..., alias="amount", title="Used to capture quantitative values for a variety of elements", description=( "Used to capture quantitative values for a variety of elements. If only" " limits are given, the arithmetic mean would be the average. If only a" " single definite value for a given element is given, it would be " "captured in this field." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="The method by which the weight was determined", description="The method by which the molecular weight was determined.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Type of molecular weight e.g. exact, average, weight average", description=( "Type of molecular weight such as exact, average (also known as. number" " average), weight average." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceDefinitionMolecularWeight`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "method", "type", "amount"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionMolecularWeight`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "method", "type", "amount"] class SubstanceDefinitionName(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Names applicable to this substance. """ __resource_type__ = "SubstanceDefinitionName" domain: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="domain", title=( "The use context of this name e.g. as an active ingredient or as a food" " colour additive" ), description=( "The use context of this name for example if there is a different name " "a drug active ingredient as opposed to a food colour additive." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="The jurisdiction where this name applies", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) language: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="language", title="Human language that the name is written in", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="The actual name", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) official: typing.List[fhirtypes.SubstanceDefinitionNameOfficialType] | None = Field( default=None, alias="official", title="Details of the official nature of this name", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) preferred: bool | None = Field( default=None, alias="preferred", title="If this is the preferred name for this substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) preferred__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preferred", title="Extension field for ``preferred``." ) source: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="source", title="Supporting literature", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) status: fhirtypes.CodeableConceptType | None = Field( default=None, alias="status", title="The status of the name e.g. 'current', 'proposed'", description="The status of the name, for example 'current', 'proposed'.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) synonym: typing.List[fhirtypes.SubstanceDefinitionNameType] | None = Field( default=None, alias="synonym", title=( "A synonym of this particular name, by which the substance is also " "known" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) translation: typing.List[fhirtypes.SubstanceDefinitionNameType] | None = Field( default=None, alias="translation", title="A translation for this name into another human language", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Name type e.g. 'systematic', 'scientific, 'brand'", description="Name type, for example 'systematic', 'scientific, 'brand'.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceDefinitionName`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "type", "status", "preferred", "language", "domain", "jurisdiction", "synonym", "translation", "official", "source", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionName`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "name", "type", "status", "preferred", "language", "domain", "jurisdiction", "synonym", "translation", "official", "source", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields class SubstanceDefinitionNameOfficial(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details of the official nature of this name. """ __resource_type__ = "SubstanceDefinitionNameOfficial" authority: fhirtypes.CodeableConceptType | None = Field( default=None, alias="authority", title="Which authority uses this official name", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date of official name change", description="Date of the official name change.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) status: fhirtypes.CodeableConceptType | None = Field( default=None, alias="status", title="The status of the official name, for example 'draft', 'active'", description=( "The status of the official name, for example 'draft', 'active', " "'retired'." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceDefinitionNameOfficial`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "authority", "status", "date"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionNameOfficial`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "authority", "status", "date"] class SubstanceDefinitionProperty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. General specifications for this substance. """ __resource_type__ = "SubstanceDefinitionProperty" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="A code expressing the type of property", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="A value for the property", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="A value for the property", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="A value for the property", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="A value for the property", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="A value for the property", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceDefinitionProperty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueCodeableConcept", "valueQuantity", "valueDate", "valueBoolean", "valueAttachment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionProperty`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "valueCodeableConcept", "valueQuantity", "valueDate", "valueBoolean", "valueAttachment", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueBoolean", "valueCodeableConcept", "valueDate", "valueQuantity", ] } return one_of_many_fields class SubstanceDefinitionRelationship(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A link between this substance and another. A link between this substance and another, with details of the relationship. """ __resource_type__ = "SubstanceDefinitionRelationship" amountQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="amountQuantity", title=( "A numeric factor for the relationship, e.g. that a substance salt has " "some percentage of active substance in relation to some other" ), description=( "A numeric factor for the relationship, for instance to express that " "the salt of a substance has some percentage of the active substance in" " relation to some other." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e amount[x] "one_of_many": "amount", "one_of_many_required": False, }, ) amountRatio: fhirtypes.RatioType | None = Field( default=None, alias="amountRatio", title=( "A numeric factor for the relationship, e.g. that a substance salt has " "some percentage of active substance in relation to some other" ), description=( "A numeric factor for the relationship, for instance to express that " "the salt of a substance has some percentage of the active substance in" " relation to some other." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e amount[x] "one_of_many": "amount", "one_of_many_required": False, }, ) amountString: fhirtypes.StringType | None = Field( default=None, alias="amountString", title=( "A numeric factor for the relationship, e.g. that a substance salt has " "some percentage of active substance in relation to some other" ), description=( "A numeric factor for the relationship, for instance to express that " "the salt of a substance has some percentage of the active substance in" " relation to some other." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e amount[x] "one_of_many": "amount", "one_of_many_required": False, }, ) amountString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_amountString", title="Extension field for ``amountString``.", ) comparator: fhirtypes.CodeableConceptType | None = Field( default=None, alias="comparator", title=( 'An operator for the amount, for example "average", "approximately", ' '"less than"' ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) isDefining: bool | None = Field( default=None, alias="isDefining", title=( "For example where an enzyme strongly bonds with a particular " "substance, this is a defining relationship for that enzyme, out of " "several possible relationships" ), description=( "For example where an enzyme strongly bonds with a particular " "substance, this is a defining relationship for that enzyme, out of " "several possible substance relationships." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) isDefining__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isDefining", title="Extension field for ``isDefining``." ) ratioHighLimitAmount: fhirtypes.RatioType | None = Field( default=None, alias="ratioHighLimitAmount", title="For use when the numeric has an uncertain range", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) source: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="source", title="Supporting literature", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) substanceDefinitionCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="substanceDefinitionCodeableConcept", title=( "A pointer to another substance, as a resource or a representational " "code" ), description=( "A pointer to another substance, as a resource or just a " "representational code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e substanceDefinition[x] "one_of_many": "substanceDefinition", "one_of_many_required": False, }, ) substanceDefinitionReference: fhirtypes.ReferenceType | None = Field( default=None, alias="substanceDefinitionReference", title=( "A pointer to another substance, as a resource or a representational " "code" ), description=( "A pointer to another substance, as a resource or just a " "representational code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e substanceDefinition[x] "one_of_many": "substanceDefinition", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SubstanceDefinition"], }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title='For example "salt to parent", "active moiety"', description=( 'For example "salt to parent", "active moiety", "starting material", ' '"polymorph", "impurity of".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceDefinitionRelationship`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "substanceDefinitionReference", "substanceDefinitionCodeableConcept", "type", "isDefining", "amountQuantity", "amountRatio", "amountString", "ratioHighLimitAmount", "comparator", "source", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionRelationship`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "substanceDefinitionReference", "substanceDefinitionCodeableConcept", "type", "isDefining", "amountQuantity", "amountRatio", "amountString", "ratioHighLimitAmount", "comparator", "source", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "amount": ["amountQuantity", "amountRatio", "amountString"], "substanceDefinition": [ "substanceDefinitionCodeableConcept", "substanceDefinitionReference", ], } return one_of_many_fields class SubstanceDefinitionSourceMaterial(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Material or taxonomic/anatomical source. Material or taxonomic/anatomical source for the substance. """ __resource_type__ = "SubstanceDefinitionSourceMaterial" countryOfOrigin: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="countryOfOrigin", title="The country or countries where the material is harvested", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) genus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="genus", title=( "The genus of an organism e.g. the Latin epithet of the plant/animal " "scientific name" ), description=( "The genus of an organism, typically referring to the Latin epithet of " "the genus element of the plant/animal scientific name." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) part: fhirtypes.CodeableConceptType | None = Field( default=None, alias="part", title="An anatomical origin of the source material within an organism", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) species: fhirtypes.CodeableConceptType | None = Field( default=None, alias="species", title=( "The species of an organism e.g. the Latin epithet of the species of " "the plant/animal" ), description=( "The species of an organism, typically referring to the Latin epithet " "of the species of the plant/animal." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title=( "Classification of the origin of the raw material. e.g. cat hair is an " "Animal source type" ), description=( "A classification that provides the origin of the raw material. " "Example: cat hair would be an Animal source type." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceDefinitionSourceMaterial`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "genus", "species", "part", "countryOfOrigin", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionSourceMaterial`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "genus", "species", "part", "countryOfOrigin", ] class SubstanceDefinitionStructure(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Structural information. """ __resource_type__ = "SubstanceDefinitionStructure" molecularFormula: fhirtypes.StringType | None = Field( default=None, alias="molecularFormula", title="Molecular formula (e.g. using the Hill system)", description="Molecular formula of this substance, typically using the Hill system.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) molecularFormula__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_molecularFormula", title="Extension field for ``molecularFormula``.", ) molecularFormulaByMoiety: fhirtypes.StringType | None = Field( default=None, alias="molecularFormulaByMoiety", title="Specified per moiety according to the Hill system", description=( "Specified per moiety according to the Hill system, i.e. first C, then " "H, then alphabetical, each moiety separated by a dot." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) molecularFormulaByMoiety__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_molecularFormulaByMoiety", title="Extension field for ``molecularFormulaByMoiety``.", ) molecularWeight: fhirtypes.SubstanceDefinitionMolecularWeightType | None = Field( default=None, alias="molecularWeight", title="The molecular weight or weight range", description=( "The molecular weight or weight range (for proteins, polymers or " "nucleic acids)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) opticalActivity: fhirtypes.CodeableConceptType | None = Field( default=None, alias="opticalActivity", title="Optical activity type", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) representation: typing.List[ fhirtypes.SubstanceDefinitionStructureRepresentationType ] | None = Field( default=None, alias="representation", title="A depiction of the structure or characterization of the substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sourceDocument: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="sourceDocument", title="Source of information for the structure", description="The source of information about the structure.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) stereochemistry: fhirtypes.CodeableConceptType | None = Field( default=None, alias="stereochemistry", title="Stereochemistry type", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) technique: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="technique", title="The method used to find the structure e.g. X-ray, NMR", description=( "The method used to elucidate the structure or characterization of the " "drug substance. Examples: X-ray, HPLC, NMR, Peptide mapping, Ligand " "binding assay." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceDefinitionStructure`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "stereochemistry", "opticalActivity", "molecularFormula", "molecularFormulaByMoiety", "molecularWeight", "technique", "sourceDocument", "representation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionStructure`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "stereochemistry", "opticalActivity", "molecularFormula", "molecularFormulaByMoiety", "molecularWeight", "technique", "sourceDocument", "representation", ] class SubstanceDefinitionStructureRepresentation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A depiction of the structure or characterization of the substance. """ __resource_type__ = "SubstanceDefinitionStructureRepresentation" document: fhirtypes.ReferenceType | None = Field( default=None, alias="document", title=( "An attachment with the structural representation e.g. a structure " "graphic or AnIML file" ), description=( "An attached file with the structural representation or " "characterization e.g. a molecular structure graphic of the substance, " "a JCAMP or AnIML file." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) format: fhirtypes.CodeableConceptType | None = Field( default=None, alias="format", title=( "The format of the representation e.g. InChI, SMILES, MOLFILE (note: " "not the physical file format)" ), description=( "The format of the representation e.g. InChI, SMILES, MOLFILE, CDX, " "SDF, PDB, mmCIF. The logical content type rather than the physical " "file format of a document." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) representation: fhirtypes.StringType | None = Field( default=None, alias="representation", title=( "The structural representation or characterization as a text string in " "a standard format" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) representation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_representation", title="Extension field for ``representation``.", ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The kind of structural representation (e.g. full, partial)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceDefinitionStructureRepresentation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "representation", "format", "document", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionStructureRepresentation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "representation", "format", "document"] ================================================ FILE: fhir/resources/R4B/supplydelivery.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SupplyDelivery Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class SupplyDelivery(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Delivery of bulk Supplies. Record of delivery of what is supplied. """ __resource_type__ = "SupplyDelivery" basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Fulfills plan, proposal or order", description=( "A plan, proposal or order that is fulfilled in whole or in part by " "this event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SupplyRequest"], }, ) destination: fhirtypes.ReferenceType | None = Field( default=None, alias="destination", title="Where the Supply was sent", description=( "Identification of the facility/location where the Supply was shipped " "to, as part of the dispense event." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External identifier", description=( "Identifier for the supply delivery event that is used to identify it " "across multiple disparate systems." ), json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When event occurred", description="The date or time(s) the activity occurred.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="When event occurred", description="The date or time(s) the activity occurred.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceTiming: fhirtypes.TimingType | None = Field( default=None, alias="occurrenceTiming", title="When event occurred", description="The date or time(s) the activity occurred.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced event", description="A larger event of which this particular event is a component or step.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SupplyDelivery", "Contract"], }, ) patient: fhirtypes.ReferenceType | None = Field( default=None, alias="patient", title="Patient for whom the item is supplied", description=( "A link to a resource representing the person whom the delivered item " "is for." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) receiver: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="receiver", title="Who collected the Supply", description="Identifies the person who picked up the Supply.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="in-progress | completed | abandoned | entered-in-error", description="A code specifying the state of the dispense event.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "in-progress", "completed", "abandoned", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) suppliedItem: fhirtypes.SupplyDeliverySuppliedItemType | None = Field( default=None, alias="suppliedItem", title="The item that is delivered or supplied", description="The item that is being delivered or has been supplied.", json_schema_extra={ "element_property": True, }, ) supplier: fhirtypes.ReferenceType | None = Field( default=None, alias="supplier", title="Dispenser", description=( "The individual responsible for dispensing the medication, supplier or " "device." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Category of dispense event", description=( "Indicates the type of dispensing event that is performed. Examples " "include: Trial Fill, Completion of Trial, Partial Fill, Emergency " "Fill, Samples, etc." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SupplyDelivery`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "partOf", "status", "patient", "type", "suppliedItem", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "supplier", "destination", "receiver", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SupplyDelivery`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "basedOn", "partOf", "status", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "occurrence": ["occurrenceDateTime", "occurrencePeriod", "occurrenceTiming"] } return one_of_many_fields class SupplyDeliverySuppliedItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The item that is delivered or supplied. The item that is being delivered or has been supplied. """ __resource_type__ = "SupplyDeliverySuppliedItem" itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="itemCodeableConcept", title="Medication, Substance, or Device supplied", description=( "Identifies the medication, substance or device being dispensed. This " "is either a link to a resource representing the details of the item or" " a code that identifies the item from a known list." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": False, }, ) itemReference: fhirtypes.ReferenceType | None = Field( default=None, alias="itemReference", title="Medication, Substance, or Device supplied", description=( "Identifies the medication, substance or device being dispensed. This " "is either a link to a resource representing the details of the item or" " a code that identifies the item from a known list." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication", "Substance", "Device"], }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Amount dispensed", description=( "The amount of supply that has been dispensed. Includes unit of " "measure." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SupplyDeliverySuppliedItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "quantity", "itemCodeableConcept", "itemReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SupplyDeliverySuppliedItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"item": ["itemCodeableConcept", "itemReference"]} return one_of_many_fields ================================================ FILE: fhir/resources/R4B/supplyrequest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SupplyRequest Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class SupplyRequest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Request for a medication, substance or device. A record of a request for a medication, substance or device used in the healthcare setting. """ __resource_type__ = "SupplyRequest" authoredOn: fhirtypes.DateTimeType | None = Field( default=None, alias="authoredOn", title="When the request was made", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoredOn", title="Extension field for ``authoredOn``." ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="The kind of supply (central, non-stock, etc.)", description=( "Category of supply, e.g. central, non-stock, etc. This is used to " "support work flows associated with the supply process." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) deliverFrom: fhirtypes.ReferenceType | None = Field( default=None, alias="deliverFrom", title="The origin of the supply", description="Where the supply is expected to come from.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization", "Location"], }, ) deliverTo: fhirtypes.ReferenceType | None = Field( default=None, alias="deliverTo", title="The destination of the supply", description="Where the supply is destined to go.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization", "Location", "Patient"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for SupplyRequest", description=( "Business identifiers assigned to this SupplyRequest by the author " "and/or other systems. These identifiers remain constant as the " "resource is updated and propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="itemCodeableConcept", title="Medication, Substance, or Device requested to be supplied", description=( "The item that is requested to be supplied. This is either a link to a " "resource representing the details of the item or a code that " "identifies the item from a known list." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": True, }, ) itemReference: fhirtypes.ReferenceType | None = Field( default=None, alias="itemReference", title="Medication, Substance, or Device requested to be supplied", description=( "The item that is requested to be supplied. This is either a link to a " "resource representing the details of the item or a code that " "identifies the item from a known list." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication", "Substance", "Device"], }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When the request should be fulfilled", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="When the request should be fulfilled", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceTiming: fhirtypes.TimingType | None = Field( default=None, alias="occurrenceTiming", title="When the request should be fulfilled", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) parameter: typing.List[fhirtypes.SupplyRequestParameterType] | None = Field( default=None, alias="parameter", title="Ordered item details", description=( "Specific parameters for the ordered item. For example, the size of " "the indicated item." ), json_schema_extra={ "element_property": True, }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Indicates how quickly this SupplyRequest should be addressed with " "respect to other requests." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) quantity: fhirtypes.QuantityType = Field( default=..., alias="quantity", title="The requested amount of the item indicated", description="The amount that is being ordered of the indicated item.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="The reason why the supply item was requested", description=None, json_schema_extra={ "element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="The reason why the supply item was requested", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "DiagnosticReport", "DocumentReference", ], }, ) requester: fhirtypes.ReferenceType | None = Field( default=None, alias="requester", title="Individual making the request", description="The device, practitioner, etc. who initiated the request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Patient", "RelatedPerson", "Device", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | suspended +", description="Status of the supply request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "suspended", "+"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) supplier: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supplier", title="Who is intended to fulfill the request", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization", "HealthcareService"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SupplyRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "category", "priority", "itemCodeableConcept", "itemReference", "quantity", "parameter", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "authoredOn", "requester", "supplier", "reasonCode", "reasonReference", "deliverFrom", "deliverTo", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SupplyRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "category", "priority", "itemCodeableConcept", "itemReference", "quantity", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "authoredOn", "requester", "supplier", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "item": ["itemCodeableConcept", "itemReference"], "occurrence": [ "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", ], } return one_of_many_fields class SupplyRequestParameter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Ordered item details. Specific parameters for the ordered item. For example, the size of the indicated item. """ __resource_type__ = "SupplyRequestParameter" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Item detail", description="A code or string that identifies the device detail being asserted.", json_schema_extra={ "element_property": True, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value of detail", description="The value of the device detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Value of detail", description="The value of the device detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Value of detail", description="The value of the device detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Value of detail", description="The value of the device detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SupplyRequestParameter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "valueCodeableConcept", "valueQuantity", "valueRange", "valueBoolean", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SupplyRequestParameter`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueCodeableConcept", "valueQuantity", "valueRange", ] } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/task.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Task Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Task(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A task to be performed. """ __resource_type__ = "Task" authoredOn: fhirtypes.DateTimeType | None = Field( default=None, alias="authoredOn", title="Task Creation Date", description="The date and time this task was created.", json_schema_extra={ "element_property": True, }, ) authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoredOn", title="Extension field for ``authoredOn``." ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Request fulfilled by this task", description=( "BasedOn refers to a higher-level authorization that triggered the " 'creation of the task. It references a "request" resource such as a ' "ServiceRequest, MedicationRequest, ServiceRequest, CarePlan, etc. " 'which is distinct from the "request" resource the task is seeking to ' "fulfill. This latter resource is referenced by FocusOn. For example," " based on a ServiceRequest (= BasedOn), a task is created to fulfill a" " procedureRequest ( = FocusOn ) to collect a specimen from a patient." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) businessStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="businessStatus", title='E.g. "Specimen collected", "IV prepped"', description="Contains business-specific nuances of the business state.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Task Type", description="A name or code (or both) briefly describing what the task involves.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Human-readable explanation of task", description="A free-text description of what is to be performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Healthcare event during which this task originated", description=( "The healthcare event (e.g. a patient and healthcare provider " "interaction) during which this task was created." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) executionPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="executionPeriod", title="Start and end time of execution", description=( "Identifies the time action was first taken against the task (start) " "and/or the time final action was taken against the task prior to " "marking it as completed (end)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) focus: fhirtypes.ReferenceType | None = Field( default=None, alias="focus", title="What task is acting on", description=( "The request being actioned or the resource being manipulated by this " "task." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) for_fhir: fhirtypes.ReferenceType | None = Field( default=None, alias="for", title="Beneficiary of the Task", description=( "The entity who benefits from the performance of the service specified " "in the task (e.g., the patient)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) groupIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="groupIdentifier", title="Requisition or grouper id", description=( "An identifier that links together multiple tasks and other requests " "that were created in the same context." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Task Instance Identifier", description="The business identifier for this task.", json_schema_extra={ "element_property": True, }, ) input: typing.List[fhirtypes.TaskInputType] | None = Field( default=None, alias="input", title="Information used to perform task", description=( "Additional information that may be needed in the execution of the " "task." ), json_schema_extra={ "element_property": True, }, ) instantiatesCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="instantiatesCanonical", title="Formal definition of task", description=( "The URL pointing to a *FHIR*-defined protocol, guideline, orderset or " "other definition that is adhered to in whole or in part by this Task." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ActivityDefinition"], }, ) instantiatesCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesUri: fhirtypes.UriType | None = Field( default=None, alias="instantiatesUri", title="Formal definition of task", description=( "The URL pointing to an *externally* maintained protocol, guideline, " "orderset or other definition that is adhered to in whole or in part by" " this Task." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) insurance: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="insurance", title="Associated insurance coverage", description=( "Insurance plans, coverage extensions, pre-authorizations and/or pre-" "determinations that may be relevant to the Task." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage", "ClaimResponse"], }, ) intent: fhirtypes.CodeType | None = Field( default=None, alias="intent", title=( "unknown | proposal | plan | order | original-order | reflex-order | " "filler-order | instance-order | option" ), description=( 'Indicates the "level" of actionability associated with the Task, i.e. ' "i+R[9]Cs this a proposed task, a planned task, an actionable task, " "etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "unknown", "proposal", "plan", "order", "original-order", "reflex-order", "filler-order", "instance-order", "option", ], }, ) intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intent", title="Extension field for ``intent``." ) lastModified: fhirtypes.DateTimeType | None = Field( default=None, alias="lastModified", title="Task Last Modified Date", description="The date and time of last modification to this task.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastModified__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastModified", title="Extension field for ``lastModified``.", ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where task occurs", description="Principal physical location where the this task is performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the task", description="Free-text information captured about the task as it progresses.", json_schema_extra={ "element_property": True, }, ) output: typing.List[fhirtypes.TaskOutputType] | None = Field( default=None, alias="output", title="Information produced as part of task", description="Outputs produced by the Task.", json_schema_extra={ "element_property": True, }, ) owner: fhirtypes.ReferenceType | None = Field( default=None, alias="owner", title="Responsible individual", description=( "Individual organization or Device currently responsible for task " "execution." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", "HealthcareService", "Patient", "Device", "RelatedPerson", ], }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Composite task", description="Task that this particular task is part of.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Task"], }, ) performerType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="performerType", title="Requested performer", description="The kind of participant that should perform the task.", json_schema_extra={ "element_property": True, }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Indicates how quickly the Task should be addressed with respect to " "other requests." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) reasonCode: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reasonCode", title="Why task is needed", description="A description or code indicating why this task needs to be performed.", json_schema_extra={ "element_property": True, }, ) reasonReference: fhirtypes.ReferenceType | None = Field( default=None, alias="reasonReference", title="Why task is needed", description="A resource reference indicating why this task needs to be performed.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="relevantHistory", title="Key events in history of the Task", description=( "Links to Provenance records for past versions of this Task that " "identify key state transitions or updates that are likely to be " "relevant to a user looking at the current version of the task." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Provenance"], }, ) requester: fhirtypes.ReferenceType | None = Field( default=None, alias="requester", title="Who is asking for task to be done", description="The creator of the task.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", ], }, ) restriction: fhirtypes.TaskRestrictionType | None = Field( default=None, alias="restriction", title="Constraints on fulfillment tasks", description=( "If the Task.focus is a request resource and the task is seeking " "fulfillment (i.e. is asking for the request to be actioned), this " "element identifies any limitations on what parts of the referenced " "request should be actioned." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | requested | received | accepted | +", description="The current status of the task.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "requested", "received", "accepted", "+"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="statusReason", title="Reason for current status", description="An explanation as to why this task is held, failed, was refused, etc.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Task`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "groupIdentifier", "partOf", "status", "statusReason", "businessStatus", "intent", "priority", "code", "description", "focus", "for", "encounter", "executionPeriod", "authoredOn", "lastModified", "requester", "performerType", "owner", "location", "reasonCode", "reasonReference", "insurance", "note", "relevantHistory", "restriction", "input", "output", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Task`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "instantiatesCanonical", "instantiatesUri", "basedOn", "groupIdentifier", "partOf", "status", "statusReason", "businessStatus", "intent", "code", "description", "focus", "for", "encounter", "executionPeriod", "lastModified", "requester", "owner", "location", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("intent", "intent__ext"), ("status", "status__ext")] return required_fields class TaskInput(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information used to perform task. Additional information that may be needed in the execution of the task. """ __resource_type__ = "TaskInput" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Label for the input", description=( "A code or description indicating how the input is intended to be used " "as part of the task execution." ), json_schema_extra={ "element_property": True, }, ) valueAddress: fhirtypes.AddressType | None = Field( default=None, alias="valueAddress", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAge: fhirtypes.AgeType | None = Field( default=None, alias="valueAge", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="valueAnnotation", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="valueBase64Binary", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBase64Binary", title="Extension field for ``valueBase64Binary``.", ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="valueCanonical", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCanonical", title="Extension field for ``valueCanonical``.", ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueContactDetail: fhirtypes.ContactDetailType | None = Field( default=None, alias="valueContactDetail", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="valueContactPoint", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueContributor: fhirtypes.ContributorType | None = Field( default=None, alias="valueContributor", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCount: fhirtypes.CountType | None = Field( default=None, alias="valueCount", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDataRequirement: fhirtypes.DataRequirementType | None = Field( default=None, alias="valueDataRequirement", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueDistance: fhirtypes.DistanceType | None = Field( default=None, alias="valueDistance", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDosage: fhirtypes.DosageType | None = Field( default=None, alias="valueDosage", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDuration: fhirtypes.DurationType | None = Field( default=None, alias="valueDuration", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueExpression: fhirtypes.ExpressionType | None = Field( default=None, alias="valueExpression", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="valueHumanName", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId: fhirtypes.IdType | None = Field( default=None, alias="valueId", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueId", title="Extension field for ``valueId``." ) valueIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="valueIdentifier", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInstant: fhirtypes.InstantType | None = Field( default=None, alias="valueInstant", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInstant", title="Extension field for ``valueInstant``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="valueMarkdown", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueMarkdown", title="Extension field for ``valueMarkdown``.", ) valueMeta: fhirtypes.MetaType | None = Field( default=None, alias="valueMeta", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueMoney: fhirtypes.MoneyType | None = Field( default=None, alias="valueMoney", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueOid: fhirtypes.OidType | None = Field( default=None, alias="valueOid", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueOid", title="Extension field for ``valueOid``." ) valueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field( default=None, alias="valueParameterDefinition", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="valuePositiveInt", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valuePositiveInt", title="Extension field for ``valuePositiveInt``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field( default=None, alias="valueRelatedArtifact", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="valueSampledData", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueSignature: fhirtypes.SignatureType | None = Field( default=None, alias="valueSignature", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) valueTiming: fhirtypes.TimingType | None = Field( default=None, alias="valueTiming", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field( default=None, alias="valueTriggerDefinition", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="valueUnsignedInt", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUnsignedInt", title="Extension field for ``valueUnsignedInt``.", ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) valueUrl: fhirtypes.UrlType | None = Field( default=None, alias="valueUrl", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUrl", title="Extension field for ``valueUrl``." ) valueUsageContext: fhirtypes.UsageContextType | None = Field( default=None, alias="valueUsageContext", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUuid: fhirtypes.UuidType | None = Field( default=None, alias="valueUuid", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUuid", title="Extension field for ``valueUuid``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TaskInput`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInstant", "valueInteger", "valueMarkdown", "valueOid", "valuePositiveInt", "valueString", "valueTime", "valueUnsignedInt", "valueUri", "valueUrl", "valueUuid", "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueCodeableConcept", "valueCoding", "valueContactPoint", "valueCount", "valueDistance", "valueDuration", "valueHumanName", "valueIdentifier", "valueMoney", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueReference", "valueSampledData", "valueSignature", "valueTiming", "valueContactDetail", "valueContributor", "valueDataRequirement", "valueExpression", "valueParameterDefinition", "valueRelatedArtifact", "valueTriggerDefinition", "valueUsageContext", "valueDosage", "valueMeta", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TaskInput`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueCodeableConcept", "valueCoding", "valueContactDetail", "valueContactPoint", "valueContributor", "valueCount", "valueDataRequirement", "valueDate", "valueDateTime", "valueDecimal", "valueDistance", "valueDosage", "valueDuration", "valueExpression", "valueHumanName", "valueId", "valueIdentifier", "valueInstant", "valueInteger", "valueMarkdown", "valueMeta", "valueMoney", "valueOid", "valueParameterDefinition", "valuePeriod", "valuePositiveInt", "valueQuantity", "valueRange", "valueRatio", "valueReference", "valueRelatedArtifact", "valueSampledData", "valueSignature", "valueString", "valueTime", "valueTiming", "valueTriggerDefinition", "valueUnsignedInt", "valueUri", "valueUrl", "valueUsageContext", "valueUuid", ] } return one_of_many_fields class TaskOutput(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information produced as part of task. Outputs produced by the Task. """ __resource_type__ = "TaskOutput" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Label for output", description="The name of the Output parameter.", json_schema_extra={ "element_property": True, }, ) valueAddress: fhirtypes.AddressType | None = Field( default=None, alias="valueAddress", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAge: fhirtypes.AgeType | None = Field( default=None, alias="valueAge", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="valueAnnotation", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="valueBase64Binary", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBase64Binary", title="Extension field for ``valueBase64Binary``.", ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="valueCanonical", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCanonical", title="Extension field for ``valueCanonical``.", ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueContactDetail: fhirtypes.ContactDetailType | None = Field( default=None, alias="valueContactDetail", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="valueContactPoint", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueContributor: fhirtypes.ContributorType | None = Field( default=None, alias="valueContributor", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCount: fhirtypes.CountType | None = Field( default=None, alias="valueCount", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDataRequirement: fhirtypes.DataRequirementType | None = Field( default=None, alias="valueDataRequirement", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueDistance: fhirtypes.DistanceType | None = Field( default=None, alias="valueDistance", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDosage: fhirtypes.DosageType | None = Field( default=None, alias="valueDosage", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDuration: fhirtypes.DurationType | None = Field( default=None, alias="valueDuration", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueExpression: fhirtypes.ExpressionType | None = Field( default=None, alias="valueExpression", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="valueHumanName", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId: fhirtypes.IdType | None = Field( default=None, alias="valueId", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueId", title="Extension field for ``valueId``." ) valueIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="valueIdentifier", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInstant: fhirtypes.InstantType | None = Field( default=None, alias="valueInstant", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInstant", title="Extension field for ``valueInstant``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="valueMarkdown", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueMarkdown", title="Extension field for ``valueMarkdown``.", ) valueMeta: fhirtypes.MetaType | None = Field( default=None, alias="valueMeta", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueMoney: fhirtypes.MoneyType | None = Field( default=None, alias="valueMoney", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueOid: fhirtypes.OidType | None = Field( default=None, alias="valueOid", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueOid", title="Extension field for ``valueOid``." ) valueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field( default=None, alias="valueParameterDefinition", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="valuePositiveInt", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valuePositiveInt", title="Extension field for ``valuePositiveInt``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field( default=None, alias="valueRelatedArtifact", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="valueSampledData", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueSignature: fhirtypes.SignatureType | None = Field( default=None, alias="valueSignature", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) valueTiming: fhirtypes.TimingType | None = Field( default=None, alias="valueTiming", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field( default=None, alias="valueTriggerDefinition", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="valueUnsignedInt", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUnsignedInt", title="Extension field for ``valueUnsignedInt``.", ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) valueUrl: fhirtypes.UrlType | None = Field( default=None, alias="valueUrl", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUrl", title="Extension field for ``valueUrl``." ) valueUsageContext: fhirtypes.UsageContextType | None = Field( default=None, alias="valueUsageContext", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUuid: fhirtypes.UuidType | None = Field( default=None, alias="valueUuid", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUuid", title="Extension field for ``valueUuid``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TaskOutput`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInstant", "valueInteger", "valueMarkdown", "valueOid", "valuePositiveInt", "valueString", "valueTime", "valueUnsignedInt", "valueUri", "valueUrl", "valueUuid", "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueCodeableConcept", "valueCoding", "valueContactPoint", "valueCount", "valueDistance", "valueDuration", "valueHumanName", "valueIdentifier", "valueMoney", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueReference", "valueSampledData", "valueSignature", "valueTiming", "valueContactDetail", "valueContributor", "valueDataRequirement", "valueExpression", "valueParameterDefinition", "valueRelatedArtifact", "valueTriggerDefinition", "valueUsageContext", "valueDosage", "valueMeta", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TaskOutput`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueCodeableConcept", "valueCoding", "valueContactDetail", "valueContactPoint", "valueContributor", "valueCount", "valueDataRequirement", "valueDate", "valueDateTime", "valueDecimal", "valueDistance", "valueDosage", "valueDuration", "valueExpression", "valueHumanName", "valueId", "valueIdentifier", "valueInstant", "valueInteger", "valueMarkdown", "valueMeta", "valueMoney", "valueOid", "valueParameterDefinition", "valuePeriod", "valuePositiveInt", "valueQuantity", "valueRange", "valueRatio", "valueReference", "valueRelatedArtifact", "valueSampledData", "valueSignature", "valueString", "valueTime", "valueTiming", "valueTriggerDefinition", "valueUnsignedInt", "valueUri", "valueUrl", "valueUsageContext", "valueUuid", ] } return one_of_many_fields class TaskRestriction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Constraints on fulfillment tasks. If the Task.focus is a request resource and the task is seeking fulfillment (i.e. is asking for the request to be actioned), this element identifies any limitations on what parts of the referenced request should be actioned. """ __resource_type__ = "TaskRestriction" period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="When fulfillment sought", description="Over what time-period is fulfillment sought.", json_schema_extra={ "element_property": True, }, ) recipient: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="recipient", title="For whom is fulfillment sought?", description=( "For requests that are targeted to more than on potential " "recipient/target, for whom is fulfillment sought?" ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Group", "Organization", ], }, ) repetitions: fhirtypes.PositiveIntType | None = Field( default=None, alias="repetitions", title="How many times to repeat", description="Indicates the number of times the requested action should occur.", json_schema_extra={ "element_property": True, }, ) repetitions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_repetitions", title="Extension field for ``repetitions``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TaskRestriction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "repetitions", "period", "recipient", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TaskRestriction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/terminologycapabilities.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/TerminologyCapabilities Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class TerminologyCapabilities(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A statement of system capabilities. A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. """ __resource_type__ = "TerminologyCapabilities" closure: fhirtypes.TerminologyCapabilitiesClosureType | None = Field( default=None, alias="closure", title=( "Information about the [ConceptMap/$closure](conceptmap-operation-" "closure.html) operation" ), description="Whether the $closure operation is supported.", json_schema_extra={ "element_property": True, }, ) codeSearch: fhirtypes.CodeType | None = Field( default=None, alias="codeSearch", title="explicit | all", description=( "The degree to which the server supports the code search parameter on " "ValueSet, if it is supported." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["explicit", "all"], }, ) codeSearch__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_codeSearch", title="Extension field for ``codeSearch``." ) codeSystem: typing.List[ fhirtypes.TerminologyCapabilitiesCodeSystemType ] | None = Field( default=None, alias="codeSystem", title="A code system supported by the server", description=( "Identifies a code system that is supported by the server. If there is " "a no code system URL, then this declares the general assumptions a " "client can make about support for any CodeSystem resource." ), json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the terminology capabilities and/or " "its contents. Copyright statements are generally legal restrictions on" " the use and publishing of the terminology capabilities." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the terminology capabilities was " "published. The date must change when the business version changes and " "it must change if the status code changes. In addition, it should " "change when the substantive content of the terminology capabilities " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the terminology capabilities", description=( "A free text natural language description of the terminology " "capabilities from a consumer's perspective. Typically, this is used " "when the capability statement describes a desired rather than an " "actual solution, for example as a formal expression of requirements as" " part of an RFP." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) expansion: fhirtypes.TerminologyCapabilitiesExpansionType | None = Field( default=None, alias="expansion", title=( "Information about the [ValueSet/$expand](valueset-operation-" "expand.html) operation" ), description=None, json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this terminology capabilities is " "authored for testing purposes (or education/evaluation/marketing) and " "is not intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) implementation: fhirtypes.TerminologyCapabilitiesImplementationType | None = Field( default=None, alias="implementation", title="If this describes a specific instance", description=( "Identifies a specific implementation instance that is described by the" " terminology capability statement - i.e. a particular installation, " "rather than the capabilities of a software program." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for terminology capabilities (if applicable)", description=( "A legal or geographic region in which the terminology capabilities is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title="instance | capability | requirements", description=( "The way that this statement is intended to be used, to describe an " "actual running instance of software, a particular product (kind, not " "instance of software) or a class of implementation (e.g. a desired " "purchase)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["instance", "capability", "requirements"], }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) lockedDate: bool | None = Field( default=None, alias="lockedDate", title="Whether lockedDate is supported", description="Whether the server supports lockedDate.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lockedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lockedDate", title="Extension field for ``lockedDate``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this terminology capabilities (computer friendly)", description=( "A natural language name identifying the terminology capabilities. This" " name should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the " "terminology capabilities." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this terminology capabilities is defined", description=( "Explanation of why this terminology capabilities is needed and why it " "has been designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) software: fhirtypes.TerminologyCapabilitiesSoftwareType | None = Field( default=None, alias="software", title="Software that is covered by this terminology capability statement", description=( "Software that is covered by this terminology capability statement. It" " is used when the statement describes the capabilities of a particular" " software version, independent of an installation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this terminology capabilities. Enables tracking the " "life-cycle of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this terminology capabilities (human friendly)", description=( "A short, descriptive, user-friendly title for the terminology " "capabilities." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) translation: fhirtypes.TerminologyCapabilitiesTranslationType | None = Field( default=None, alias="translation", title=( "Information about the [ConceptMap/$translate](conceptmap-operation-" "translate.html) operation" ), description=None, json_schema_extra={ "element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this terminology capabilities, represented as" " a URI (globally unique)" ), description=( "An absolute URI that is used to identify this terminology capabilities" " when it is referenced in a specification, model, design or an " "instance; also called its canonical identifier. This SHOULD be " "globally unique and SHOULD be a literal address at which at which an " "authoritative instance of this terminology capabilities is (or will " "be) published. This URL can be the target of a canonical reference. It" " SHALL remain the same when the terminology capabilities is stored on " "different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate terminology capabilities " "instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) validateCode: fhirtypes.TerminologyCapabilitiesValidateCodeType | None = Field( default=None, alias="validateCode", title=( "Information about the [ValueSet/$validate-code](valueset-operation-" "validate-code.html) operation" ), description=None, json_schema_extra={ "element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the terminology capabilities", description=( "The identifier that is used to identify this version of the " "terminology capabilities when it is referenced in a specification, " "model, design or instance. This is an arbitrary value managed by the " "terminology capabilities author and is not expected to be globally " "unique. For example, it might be a timestamp (e.g. yyyymmdd) if a " "managed version is not available. There is also no expectation that " "versions can be placed in a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TerminologyCapabilities`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "kind", "software", "implementation", "lockedDate", "codeSystem", "expansion", "codeSearch", "validateCode", "translation", "closure", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TerminologyCapabilities`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "copyright", "kind", "software", "implementation", "lockedDate", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("date", "date__ext"), ("kind", "kind__ext"), ("status", "status__ext"), ] return required_fields class TerminologyCapabilitiesClosure(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about the [ConceptMap/$closure](conceptmap-operation- closure.html) operation. Whether the $closure operation is supported. """ __resource_type__ = "TerminologyCapabilitiesClosure" translation: bool | None = Field( default=None, alias="translation", title="If cross-system closure is supported", description=None, json_schema_extra={ "element_property": True, }, ) translation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_translation", title="Extension field for ``translation``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TerminologyCapabilitiesClosure`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "translation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesClosure`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TerminologyCapabilitiesCodeSystem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A code system supported by the server. Identifies a code system that is supported by the server. If there is a no code system URL, then this declares the general assumptions a client can make about support for any CodeSystem resource. """ __resource_type__ = "TerminologyCapabilitiesCodeSystem" subsumption: bool | None = Field( default=None, alias="subsumption", title="Whether subsumption is supported", description="True if subsumption is supported for this version of the code system.", json_schema_extra={ "element_property": True, }, ) subsumption__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subsumption", title="Extension field for ``subsumption``." ) uri: fhirtypes.CanonicalType | None = Field( default=None, alias="uri", title="URI for the Code System", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CodeSystem"], }, ) uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uri", title="Extension field for ``uri``." ) version: typing.List[ fhirtypes.TerminologyCapabilitiesCodeSystemVersionType ] | None = Field( default=None, alias="version", title="Version of Code System supported", description=( "For the code system, a list of versions that are supported by the " "server." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TerminologyCapabilitiesCodeSystem`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "uri", "version", "subsumption"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesCodeSystem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TerminologyCapabilitiesCodeSystemVersion(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Version of Code System supported. For the code system, a list of versions that are supported by the server. """ __resource_type__ = "TerminologyCapabilitiesCodeSystemVersion" code: fhirtypes.StringType | None = Field( default=None, alias="code", title="Version identifier for this version", description=( "For version-less code systems, there should be a single version with " "no identifier." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) compositional: bool | None = Field( default=None, alias="compositional", title="If compositional grammar is supported", description="If the compositional grammar defined by the code system is supported.", json_schema_extra={ "element_property": True, }, ) compositional__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_compositional", title="Extension field for ``compositional``.", ) filter: typing.List[ fhirtypes.TerminologyCapabilitiesCodeSystemVersionFilterType ] | None = Field( default=None, alias="filter", title="Filter Properties supported", description=None, json_schema_extra={ "element_property": True, }, ) isDefault: bool | None = Field( default=None, alias="isDefault", title="If this is the default version for this code system", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) isDefault__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isDefault", title="Extension field for ``isDefault``." ) language: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="language", title="Language Displays supported", description=None, json_schema_extra={ "element_property": True, }, ) language__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) property: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="property", title="Properties supported for $lookup", description=None, json_schema_extra={ "element_property": True, }, ) property__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_property", title="Extension field for ``property``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TerminologyCapabilitiesCodeSystemVersion`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "isDefault", "compositional", "language", "filter", "property", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesCodeSystemVersion`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "isDefault"] class TerminologyCapabilitiesCodeSystemVersionFilter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Filter Properties supported. """ __resource_type__ = "TerminologyCapabilitiesCodeSystemVersionFilter" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Code of the property supported", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) op: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="op", title="Operations supported for the property", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) op__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_op", title="Extension field for ``op``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TerminologyCapabilitiesCodeSystemVersionFilter`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "op"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesCodeSystemVersionFilter`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext"), ("op", "op__ext")] return required_fields class TerminologyCapabilitiesExpansion(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about the [ValueSet/$expand](valueset-operation-expand.html) operation. """ __resource_type__ = "TerminologyCapabilitiesExpansion" hierarchical: bool | None = Field( default=None, alias="hierarchical", title="Whether the server can return nested value sets", description=None, json_schema_extra={ "element_property": True, }, ) hierarchical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_hierarchical", title="Extension field for ``hierarchical``.", ) incomplete: bool | None = Field( default=None, alias="incomplete", title="Allow request for incomplete expansions?", description="Allow request for incomplete expansions?", json_schema_extra={ "element_property": True, }, ) incomplete__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_incomplete", title="Extension field for ``incomplete``." ) paging: bool | None = Field( default=None, alias="paging", title="Whether the server supports paging on expansion", description=None, json_schema_extra={ "element_property": True, }, ) paging__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_paging", title="Extension field for ``paging``." ) parameter: typing.List[ fhirtypes.TerminologyCapabilitiesExpansionParameterType ] | None = Field( default=None, alias="parameter", title="Supported expansion parameter", description=None, json_schema_extra={ "element_property": True, }, ) textFilter: fhirtypes.MarkdownType | None = Field( default=None, alias="textFilter", title="Documentation about text searching works", description=None, json_schema_extra={ "element_property": True, }, ) textFilter__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_textFilter", title="Extension field for ``textFilter``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TerminologyCapabilitiesExpansion`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "hierarchical", "paging", "incomplete", "parameter", "textFilter", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesExpansion`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TerminologyCapabilitiesExpansionParameter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Supported expansion parameter. """ __resource_type__ = "TerminologyCapabilitiesExpansionParameter" documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Description of support for parameter", description=None, json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) name: fhirtypes.CodeType | None = Field( default=None, alias="name", title="Expansion Parameter name", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TerminologyCapabilitiesExpansionParameter`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "documentation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesExpansionParameter`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields class TerminologyCapabilitiesImplementation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. If this describes a specific instance. Identifies a specific implementation instance that is described by the terminology capability statement - i.e. a particular installation, rather than the capabilities of a software program. """ __resource_type__ = "TerminologyCapabilitiesImplementation" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Describes this specific instance", description=( "Information about the specific installation that this terminology " "capability statement relates to." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) url: fhirtypes.UrlType | None = Field( default=None, alias="url", title="Base URL for the implementation", description="An absolute base URL for the implementation.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TerminologyCapabilitiesImplementation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "description", "url"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesImplementation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "description", "url"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("description", "description__ext")] return required_fields class TerminologyCapabilitiesSoftware(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Software that is covered by this terminology capability statement. Software that is covered by this terminology capability statement. It is used when the statement describes the capabilities of a particular software version, independent of an installation. """ __resource_type__ = "TerminologyCapabilitiesSoftware" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="A name the software is known by", description="Name the software is known by.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Version covered by this statement", description="The version identifier for the software covered by this statement.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TerminologyCapabilitiesSoftware`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "version"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesSoftware`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "name", "version"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields class TerminologyCapabilitiesTranslation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about the [ConceptMap/$translate](conceptmap-operation- translate.html) operation. """ __resource_type__ = "TerminologyCapabilitiesTranslation" needsMap: bool | None = Field( default=None, alias="needsMap", title="Whether the client must identify the map", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) needsMap__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_needsMap", title="Extension field for ``needsMap``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TerminologyCapabilitiesTranslation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "needsMap"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesTranslation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("needsMap", "needsMap__ext")] return required_fields class TerminologyCapabilitiesValidateCode(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about the [ValueSet/$validate-code](valueset-operation- validate-code.html) operation. """ __resource_type__ = "TerminologyCapabilitiesValidateCode" translations: bool | None = Field( default=None, alias="translations", title="Whether translations are validated", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) translations__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_translations", title="Extension field for ``translations``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TerminologyCapabilitiesValidateCode`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "translations"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesValidateCode`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("translations", "translations__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/testreport.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/TestReport Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class TestReport(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Describes the results of a TestScript execution. A summary of information based on the results of executing a TestScript. """ __resource_type__ = "TestReport" identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="External identifier", description=( "Identifier for the TestScript assigned for external purposes outside " "the context of FHIR." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued: fhirtypes.DateTimeType | None = Field( default=None, alias="issued", title="When the TestScript was executed and this TestReport was generated", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issued", title="Extension field for ``issued``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Informal name of the executed TestScript", description="A free text natural language name identifying the executed TestScript.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) participant: typing.List[fhirtypes.TestReportParticipantType] | None = Field( default=None, alias="participant", title=( "A participant in the test execution, either the execution engine, a " "client, or a server" ), description=None, json_schema_extra={ "element_property": True, }, ) result: fhirtypes.CodeType | None = Field( default=None, alias="result", title="pass | fail | pending", description="The overall result from the execution of the TestScript.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["pass", "fail", "pending"], }, ) result__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_result", title="Extension field for ``result``." ) score: fhirtypes.DecimalType | None = Field( default=None, alias="score", title=( "The final score (percentage of tests passed) resulting from the " "execution of the TestScript" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) score__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_score", title="Extension field for ``score``." ) setup: fhirtypes.TestReportSetupType | None = Field( default=None, alias="setup", title=( "The results of the series of required setup operations before the " "tests were executed" ), description=None, json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="completed | in-progress | waiting | stopped | entered-in-error", description="The current state of this test report.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "completed", "in-progress", "waiting", "stopped", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) teardown: fhirtypes.TestReportTeardownType | None = Field( default=None, alias="teardown", title="The results of running the series of required clean up steps", description=( "The results of the series of operations required to clean up after all" " the tests were executed (successfully or otherwise)." ), json_schema_extra={ "element_property": True, }, ) test: typing.List[fhirtypes.TestReportTestType] | None = Field( default=None, alias="test", title="A test executed from the test script", description=None, json_schema_extra={ "element_property": True, }, ) testScript: fhirtypes.ReferenceType = Field( default=..., alias="testScript", title=( "Reference to the version-specific TestScript that was executed to " "produce this TestReport" ), description=( "Ideally this is an absolute URL that is used to identify the version-" "specific TestScript that was executed, matching the `TestScript.url`." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["TestScript"], }, ) tester: fhirtypes.StringType | None = Field( default=None, alias="tester", title="Name of the tester producing this report (Organization or individual)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) tester__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_tester", title="Extension field for ``tester``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "name", "status", "testScript", "result", "score", "tester", "issued", "participant", "setup", "test", "teardown", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "name", "status", "testScript", "result", "score", "tester", "issued", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("result", "result__ext"), ("status", "status__ext")] return required_fields class TestReportParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A participant in the test execution, either the execution engine, a client, or a server. """ __resource_type__ = "TestReportParticipant" display: fhirtypes.StringType | None = Field( default=None, alias="display", title="The display name of the participant", description=None, json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="test-engine | client | server", description="The type of participant.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["test-engine", "client", "server"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) uri: fhirtypes.UriType | None = Field( default=None, alias="uri", title="The uri of the participant. An absolute URL is preferred", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uri", title="Extension field for ``uri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportParticipant`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "uri", "display"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext"), ("uri", "uri__ext")] return required_fields class TestReportSetup(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The results of the series of required setup operations before the tests were executed. """ __resource_type__ = "TestReportSetup" action: typing.List[fhirtypes.TestReportSetupActionType] = Field( default=..., alias="action", title="A setup operation or assert that was executed", description="Action would contain either an operation or an assertion.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportSetup`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "action"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportSetup`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestReportSetupAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A setup operation or assert that was executed. Action would contain either an operation or an assertion. """ __resource_type__ = "TestReportSetupAction" assert_fhir: fhirtypes.TestReportSetupActionAssertType | None = Field( default=None, alias="assert", title="The assertion to perform", description="The results of the assertion performed on the previous operations.", json_schema_extra={ "element_property": True, }, ) operation: fhirtypes.TestReportSetupActionOperationType | None = Field( default=None, alias="operation", title="The operation to perform", description="The operation performed.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportSetupAction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "operation", "assert"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportSetupAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestReportSetupActionAssert(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The assertion to perform. The results of the assertion performed on the previous operations. """ __resource_type__ = "TestReportSetupActionAssert" detail: fhirtypes.StringType | None = Field( default=None, alias="detail", title="A link to further details on the result", description=None, json_schema_extra={ "element_property": True, }, ) detail__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detail", title="Extension field for ``detail``." ) message: fhirtypes.MarkdownType | None = Field( default=None, alias="message", title="A message associated with the result", description="An explanatory message associated with the result.", json_schema_extra={ "element_property": True, }, ) message__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_message", title="Extension field for ``message``." ) result: fhirtypes.CodeType | None = Field( default=None, alias="result", title="pass | skip | fail | warning | error", description="The result of this assertion.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["pass", "skip", "fail", "warning", "error"], }, ) result__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_result", title="Extension field for ``result``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportSetupActionAssert`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "result", "message", "detail"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportSetupActionAssert`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("result", "result__ext")] return required_fields class TestReportSetupActionOperation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The operation to perform. The operation performed. """ __resource_type__ = "TestReportSetupActionOperation" detail: fhirtypes.UriType | None = Field( default=None, alias="detail", title="A link to further details on the result", description=None, json_schema_extra={ "element_property": True, }, ) detail__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detail", title="Extension field for ``detail``." ) message: fhirtypes.MarkdownType | None = Field( default=None, alias="message", title="A message associated with the result", description="An explanatory message associated with the result.", json_schema_extra={ "element_property": True, }, ) message__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_message", title="Extension field for ``message``." ) result: fhirtypes.CodeType | None = Field( default=None, alias="result", title="pass | skip | fail | warning | error", description="The result of this operation.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["pass", "skip", "fail", "warning", "error"], }, ) result__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_result", title="Extension field for ``result``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportSetupActionOperation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "result", "message", "detail"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportSetupActionOperation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("result", "result__ext")] return required_fields class TestReportTeardown(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The results of running the series of required clean up steps. The results of the series of operations required to clean up after all the tests were executed (successfully or otherwise). """ __resource_type__ = "TestReportTeardown" action: typing.List[fhirtypes.TestReportTeardownActionType] = Field( default=..., alias="action", title="One or more teardown operations performed", description="The teardown action will only contain an operation.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportTeardown`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "action"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportTeardown`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestReportTeardownAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. One or more teardown operations performed. The teardown action will only contain an operation. """ __resource_type__ = "TestReportTeardownAction" operation: fhirtypes.TestReportSetupActionOperationType = Field( default=..., alias="operation", title="The teardown operation performed", description="An operation would involve a REST request to a server.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportTeardownAction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "operation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportTeardownAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestReportTest(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A test executed from the test script. """ __resource_type__ = "TestReportTest" action: typing.List[fhirtypes.TestReportTestActionType] = Field( default=..., alias="action", title="A test operation or assert that was performed", description="Action would contain either an operation or an assertion.", json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Tracking/reporting short description of the test", description=( "A short description of the test used by test engines for tracking and " "reporting purposes." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Tracking/logging name of this test", description=( "The name of this test used for tracking/logging purposes by test " "engines." ), json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportTest`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "description", "action"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportTest`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestReportTestAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A test operation or assert that was performed. Action would contain either an operation or an assertion. """ __resource_type__ = "TestReportTestAction" assert_fhir: fhirtypes.TestReportSetupActionAssertType | None = Field( default=None, alias="assert", title="The assertion performed", description="The results of the assertion performed on the previous operations.", json_schema_extra={ "element_property": True, }, ) operation: fhirtypes.TestReportSetupActionOperationType | None = Field( default=None, alias="operation", title="The operation performed", description="An operation would involve a REST request to a server.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportTestAction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "operation", "assert"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportTestAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/tests/__init__.py ================================================ __author__ = "Md Nazrul Islam" __email__ = "email2nazrul@gmail.com" __fhir_version__ = "4.3.0" ================================================ FILE: fhir/resources/R4B/tests/conftest.py ================================================ import hashlib import io import os import pathlib import shutil import sys import tempfile import zipfile from os.path import dirname import pytest from fhir_core.types import ( Base64BinaryType, DateTimeType, DateType, InstantType, TimeType, UriType, UrlType, ) from pydantic import BaseModel, Field from tests import patch_r4b_test patch_r4b_test.apply() EXAMPLE_RESOURCES_URL = ( "https://github.com/nazrulworld/hl7-archives/raw/" "0.4.0/FHIR/R4B/" "4.3.0-examples-json.zip" ) ROOT_PATH = dirname(dirname(dirname(dirname(dirname(os.path.abspath(__file__)))))) CACHE_PATH = os.path.join(ROOT_PATH, ".cache", "R4B") def download_and_store(url, path): """ """ import requests try: sys.stdout.write("Attempting to download from {0}\n".format(url)) ret = requests.get(url) except requests.HTTPError as exc: # pragma: no cover raise LookupError("Failed to download. Full error: {0!s}".format(exc)) else: if not ret.ok: # pragma: no cover raise Exception("Failed to download {0}".format(url)) with io.open(path, "wb") as handle: for chunk in ret.iter_content(): handle.write(chunk) sys.stdout.write( "Download has been completed, now saved to {0}\n".format(path) ) def expand(self, local): # pragma: no cover """Expand the ZIP file at the given path to the cache directory.""" path = os.path.join(self.cache, local) assert os.path.exists(path) import zipfile # import here as we can bypass its use with a manual unzip with zipfile.ZipFile(path) as z: z.extractall(self.cache) @pytest.fixture(scope="session") def base_settings(): if not os.path.exists(CACHE_PATH): # pragma: no cover os.makedirs(CACHE_PATH) settings = {} example_data_file_uri = EXAMPLE_RESOURCES_URL example_data_file_id = hashlib.md5(example_data_file_uri.encode()).hexdigest() example_data_file_location = os.path.join( CACHE_PATH, (example_data_file_id + ".zip") ) if not os.path.exists(example_data_file_location): download_and_store(example_data_file_uri, example_data_file_location) temp_data_dir = tempfile.mkdtemp() # extract all files from archive and put into temp dir with zipfile.ZipFile(example_data_file_location) as z: z.extractall(temp_data_dir) zip_dir_name = pathlib.Path(EXAMPLE_RESOURCES_URL).name[:-4] if "FHIR_UNITTEST_DATADIR" not in os.environ: os.environ.setdefault( "FHIR_UNITTEST_DATADIR", os.path.join(temp_data_dir, zip_dir_name) ) settings["unittest_data_dir"] = pathlib.Path(os.environ["FHIR_UNITTEST_DATADIR"]) yield settings os.environ.pop("FHIR_UNITTEST_DATADIR") shutil.rmtree(temp_data_dir) class ExternalValidatorModel(BaseModel): """This model is used to validate datetime objects against in the tests""" valueDate: DateType = Field(None, title="Date") valueTime: TimeType = Field(None, title="Time") valueDateTime: DateTimeType = Field(None, title="DateTime") valueInstant: InstantType = Field(None, title="Instant") valueUri: UriType = Field(None, title="Uri") valueUrl: UrlType = Field(None, title="Url") valueBase64Binary: Base64BinaryType = Field(None, title="Base64Binary") ================================================ FILE: fhir/resources/R4B/tests/test_account.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Account Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import account from .conftest import ExternalValidatorModel # noqa: F401 def impl_account_1(inst): assert inst.coverage[0].coverage.reference == "Coverage/7546D" assert inst.coverage[0].priority == 1 assert inst.description == "Hospital charges" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:0.1.2.3.4.5.6.7"} ).valueUri ) assert inst.identifier[0].value == "654321" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "HACC Funded Billing for Peter James Chalmers" assert inst.owner.reference == "Organization/hl7" assert ( inst.servicePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-06-30"} ).valueDateTime ) assert ( inst.servicePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-01"} ).valueDateTime ) assert inst.status == "active" assert inst.subject[0].display == "Peter James Chalmers" assert inst.subject[0].reference == "Patient/example" assert inst.text.div == ( '
HACC Funded ' "Billing for Peter James Chalmers
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "PBILLACCT" assert inst.type.coding[0].display == "patient billing account" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.type.text == "patient" def test_account_1(base_settings): """No. 1 tests collection for Account. Test File: account-example.json """ filename = base_settings["unittest_data_dir"] / "account-example.json" inst = account.Account.model_validate_json(filename.read_bytes()) assert "Account" == inst.get_resource_type() impl_account_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Account" == data["resourceType"] inst2 = account.Account(**data) impl_account_1(inst2) def impl_account_2(inst): assert inst.coverage[0].coverage.reference == "Coverage/9876B1" assert inst.coverage[0].priority == 1 assert inst.coverage[1].coverage.reference == "Coverage/7546D" assert inst.coverage[1].priority == 2 assert inst.description == "Hospital charges" assert inst.guarantor[0].onHold is False assert inst.guarantor[0].party.display == "Bénédicte du Marché" assert inst.guarantor[0].party.reference == "RelatedPerson/benedicte" assert ( inst.guarantor[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-01"} ).valueDateTime ) assert inst.id == "ewg" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:0.1.2.3.4.5.6.7"} ).valueUri ) assert inst.identifier[0].value == "654321" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Inpatient: Peter James Chalmers" assert inst.owner.display == "Burgers University Medical Center" assert inst.owner.reference == "Organization/f001" assert ( inst.servicePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-06-30"} ).valueDateTime ) assert ( inst.servicePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-01"} ).valueDateTime ) assert inst.status == "active" assert inst.subject[0].display == "Peter James Chalmers" assert inst.subject[0].reference == "Patient/example" assert inst.text.div == ( '
Inpatient ' "Admission for Peter James Chalmers Account
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "PBILLACCT" assert inst.type.coding[0].display == "patient billing account" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.type.text == "patient" def test_account_2(base_settings): """No. 2 tests collection for Account. Test File: account-example-with-guarantor.json """ filename = ( base_settings["unittest_data_dir"] / "account-example-with-guarantor.json" ) inst = account.Account.model_validate_json(filename.read_bytes()) assert "Account" == inst.get_resource_type() impl_account_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Account" == data["resourceType"] inst2 = account.Account(**data) impl_account_2(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_activitydefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ActivityDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import activitydefinition from .conftest import ExternalValidatorModel # noqa: F401 def impl_activitydefinition_1(inst): assert inst.code.coding[0].code == "zika-virus-exposure-assessment" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/questionnaires"} ).valueUri ) assert inst.description == "Administer Zika Virus Exposure Assessment" assert inst.experimental is True assert inst.id == "administer-zika-virus-exposure-assessment" assert inst.kind == "ServiceRequest" assert inst.library[0] == ( "http://example.org/fhir/Library/zika-virus-intervention-" "logic" ) assert inst.participant[0].type == "practitioner" assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "https://www.cdc.gov/zika/hc-providers/pregnant-woman.html"} ).valueUrl ) assert inst.relatedArtifact[0].type == "derived-from" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( {"valueUrl": "https://www.cdc.gov/zika/hc-providers/pregnant-woman.html"} ).valueUrl ) assert inst.relatedArtifact[1].resource == ( "http://hl7.org/fhir/Questionnaire/zika-virus-exposure-" "assessment" ) assert inst.relatedArtifact[1].type == "depends-on" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/ActivityDefinition/administer-zika-virus-exposure-assessment" } ).valueUri ) assert inst.useContext[0].code.code == "age" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueRange.low.unit == "a" assert float(inst.useContext[0].valueRange.low.value) == float(12) def test_activitydefinition_1(base_settings): """No. 1 tests collection for ActivityDefinition. Test File: activitydefinition-administer-zika-virus-exposure-assessment.json """ filename = ( base_settings["unittest_data_dir"] / "activitydefinition-administer-zika-virus-exposure-assessment.json" ) inst = activitydefinition.ActivityDefinition.model_validate_json( filename.read_bytes() ) assert "ActivityDefinition" == inst.get_resource_type() impl_activitydefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ActivityDefinition" == data["resourceType"] inst2 = activitydefinition.ActivityDefinition(**data) impl_activitydefinition_1(inst2) def impl_activitydefinition_2(inst): assert inst.code.text == "Provide Mosquito Prevention Advice" assert inst.description == "Provide mosquito prevention advice" assert inst.experimental is True assert inst.id == "provide-mosquito-prevention-advice" assert inst.kind == "CommunicationRequest" assert inst.library[0] == ( "http://example.org/fhir/Library/zika-virus-intervention-" "logic" ) assert inst.participant[0].type == "practitioner" assert ( inst.relatedArtifact[0].display == "Advice for patients about how to avoid Mosquito bites." ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://www.cdc.gov/zika/prevention/index.html"} ).valueUrl ) assert inst.relatedArtifact[0].type == "documentation" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( {"valueUrl": "http://www.cdc.gov/zika/prevention/index.html"} ).valueUrl ) assert inst.relatedArtifact[1].display == ( "Advice for patients about which mosquito repellents are " "effective and safe to use in pregnancy. [DEET, IF3535 and " "Picardin are safe during]" ) assert ( inst.relatedArtifact[1].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://www.epa.gov/insect-repellents/find-insect-repellent-right-you" } ).valueUrl ) assert inst.relatedArtifact[1].type == "documentation" assert ( inst.relatedArtifact[1].url == ExternalValidatorModel.model_validate( { "valueUrl": "https://www.epa.gov/insect-repellents/find-insect-repellent-right-you" } ).valueUrl ) assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/ActivityDefinition/provide-mosquito-prevention-advice" } ).valueUri ) def test_activitydefinition_2(base_settings): """No. 2 tests collection for ActivityDefinition. Test File: activitydefinition-provide-mosquito-prevention-advice.json """ filename = ( base_settings["unittest_data_dir"] / "activitydefinition-provide-mosquito-prevention-advice.json" ) inst = activitydefinition.ActivityDefinition.model_validate_json( filename.read_bytes() ) assert "ActivityDefinition" == inst.get_resource_type() impl_activitydefinition_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ActivityDefinition" == data["resourceType"] inst2 = activitydefinition.ActivityDefinition(**data) impl_activitydefinition_2(inst2) def impl_activitydefinition_3(inst): assert ( inst.approvalDate == ExternalValidatorModel.model_validate({"valueDate": "2016-03-12"}).valueDate ) assert inst.author[0].name == "Motive Medical Intelligence" assert inst.author[0].telecom[0].system == "phone" assert inst.author[0].telecom[0].use == "work" assert inst.author[0].telecom[0].value == "415-362-4007" assert inst.author[0].telecom[1].system == "email" assert inst.author[0].telecom[1].use == "work" assert inst.author[0].telecom[1].value == "info@motivemi.com" assert inst.code.coding[0].code == "306206005" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Referral to service (procedure)" assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "415-362-4007" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].use == "work" assert inst.contact[0].telecom[1].value == "info@motivemi.com" assert inst.copyright == ( "© Copyright 2016 Motive Medical Intelligence. All rights " "reserved." ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-03T14:06:00Z"} ).valueDateTime ) assert inst.description == ( "refer to primary care mental-health integrated care program " "for evaluation and treatment of mental health conditions now" ) assert ( inst.effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-12-31"} ).valueDateTime ) assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-01"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "referralPrimaryCareMentalHealth-initial" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://motivemi.com/artifacts"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "referralPrimaryCareMentalHealth" assert inst.jurisdiction[0].coding[0].code == "US" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.kind == "ServiceRequest" assert ( inst.lastReviewDate == ExternalValidatorModel.model_validate({"valueDate": "2016-08-15"}).valueDate ) assert inst.name == "ReferralPrimaryCareMentalHealth" assert inst.participant[0].type == "practitioner" assert inst.publisher == "Motive Medical Intelligence" assert inst.relatedArtifact[0].display == ( "Practice Guideline for the Treatment of Patients with Major " "Depressive Disorder" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf" } ).valueUrl ) assert inst.relatedArtifact[0].type == "citation" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( { "valueUrl": "http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf" } ).valueUrl ) assert inst.relatedArtifact[1].resource == ( "http://example.org/fhir/ActivityDefinition/referralPrimaryCa" "reMentalHealth" ) assert inst.relatedArtifact[1].type == "successor" assert inst.status == "retired" assert inst.text.status == "generated" assert inst.title == "Referral to Primary Care Mental Health" assert inst.topic[0].text == "Mental Health Referral" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://motivemi.com/artifacts/ActivityDefinition/referralPrimaryCareMentalHealth" } ).valueUri ) assert inst.useContext[0].code.code == "age" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "D000328" assert inst.useContext[0].valueCodeableConcept.coding[0].display == "Adult" assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://meshb.nlm.nih.gov"} ).valueUri ) assert inst.useContext[1].code.code == "focus" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueCodeableConcept.coding[0].code == "87512008" assert ( inst.useContext[1].valueCodeableConcept.coding[0].display == "Mild major depression" ) assert ( inst.useContext[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[2].code.code == "focus" assert ( inst.useContext[2].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[2].valueCodeableConcept.coding[0].code == "40379007" assert ( inst.useContext[2].valueCodeableConcept.coding[0].display == "Major depression, recurrent, mild" ) assert ( inst.useContext[2].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[3].code.code == "focus" assert ( inst.useContext[3].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[3].valueCodeableConcept.coding[0].code == "225444004" assert ( inst.useContext[3].valueCodeableConcept.coding[0].display == "At risk for suicide (finding)" ) assert ( inst.useContext[3].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[4].code.code == "focus" assert ( inst.useContext[4].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[4].valueCodeableConcept.coding[0].code == "306206005" assert ( inst.useContext[4].valueCodeableConcept.coding[0].display == "Referral to service (procedure)" ) assert ( inst.useContext[4].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[5].code.code == "user" assert ( inst.useContext[5].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[5].valueCodeableConcept.coding[0].code == "309343006" assert inst.useContext[5].valueCodeableConcept.coding[0].display == "Physician" assert ( inst.useContext[5].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[6].code.code == "venue" assert ( inst.useContext[6].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[6].valueCodeableConcept.coding[0].code == "440655000" assert ( inst.useContext[6].valueCodeableConcept.coding[0].display == "Outpatient environment" ) assert ( inst.useContext[6].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version == "1.0.0" def test_activitydefinition_3(base_settings): """No. 3 tests collection for ActivityDefinition. Test File: activitydefinition-predecessor-example.json """ filename = ( base_settings["unittest_data_dir"] / "activitydefinition-predecessor-example.json" ) inst = activitydefinition.ActivityDefinition.model_validate_json( filename.read_bytes() ) assert "ActivityDefinition" == inst.get_resource_type() impl_activitydefinition_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ActivityDefinition" == data["resourceType"] inst2 = activitydefinition.ActivityDefinition(**data) impl_activitydefinition_3(inst2) def impl_activitydefinition_4(inst): assert inst.code.text == "Serum Zika and Dengue Virus IgM" assert inst.description == "Order Serum Zika and Dengue Virus IgM" assert inst.experimental is True assert inst.id == "serum-zika-dengue-virus-igm" assert inst.kind == "ServiceRequest" assert inst.library[0] == ( "http://example.org/fhir/Library/zika-virus-intervention-" "logic" ) assert inst.participant[0].type == "practitioner" assert inst.relatedArtifact[0].display == ( "Explanation of diagnostic tests for Zika virus and which to " "use based on the patient’s clinical and exposure history." ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://www.cdc.gov/zika/hc-providers/diagnostic.html"} ).valueUrl ) assert inst.relatedArtifact[0].type == "documentation" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( {"valueUrl": "http://www.cdc.gov/zika/hc-providers/diagnostic.html"} ).valueUrl ) assert inst.relatedArtifact[1].resource == ( "http://example.org/fhir/ActivityDefinition/serum-dengue-" "virus-igm" ) assert inst.relatedArtifact[1].type == "derived-from" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/ActivityDefinition/serum-zika-dengue-virus-igm" } ).valueUri ) def test_activitydefinition_4(base_settings): """No. 4 tests collection for ActivityDefinition. Test File: activitydefinition-order-serum-zika-dengue-virus-igm.json """ filename = ( base_settings["unittest_data_dir"] / "activitydefinition-order-serum-zika-dengue-virus-igm.json" ) inst = activitydefinition.ActivityDefinition.model_validate_json( filename.read_bytes() ) assert "ActivityDefinition" == inst.get_resource_type() impl_activitydefinition_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ActivityDefinition" == data["resourceType"] inst2 = activitydefinition.ActivityDefinition(**data) impl_activitydefinition_4(inst2) def impl_activitydefinition_5(inst): assert ( inst.approvalDate == ExternalValidatorModel.model_validate({"valueDate": "2016-03-12"}).valueDate ) assert inst.author[0].name == "Motive Medical Intelligence" assert inst.author[0].telecom[0].system == "phone" assert inst.author[0].telecom[0].use == "work" assert inst.author[0].telecom[0].value == "415-362-4007" assert inst.author[0].telecom[1].system == "email" assert inst.author[0].telecom[1].use == "work" assert inst.author[0].telecom[1].value == "info@motivemi.com" assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "415-362-4007" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].use == "work" assert inst.contact[0].telecom[1].value == "info@motivemi.com" assert inst.contained[0].id == "citalopramMedication" assert inst.contained[1].id == "citalopramSubstance" assert inst.copyright == ( "© Copyright 2016 Motive Medical Intelligence. All rights " "reserved." ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-15"} ).valueDateTime ) assert inst.description == ( "Citalopram 20 mg tablet 1 tablet oral 1 time daily now (30 " "table; 3 refills" ) assert inst.dosage[0].doseAndRate[0].doseQuantity.unit == "{tbl}" assert float(inst.dosage[0].doseAndRate[0].doseQuantity.value) == float(1) assert inst.dosage[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosage[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosage[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosage[0].route.coding[0].code == "26643006" assert inst.dosage[0].route.coding[0].display == "Oral route (qualifier value)" assert inst.dosage[0].route.text == "Oral route (qualifier value)" assert inst.dosage[0].text == "1 tablet oral 1 time daily" assert inst.dosage[0].timing.repeat.frequency == 1 assert float(inst.dosage[0].timing.repeat.period) == float(1) assert inst.dosage[0].timing.repeat.periodUnit == "d" assert ( inst.dynamicValue[0].expression.description == "dispenseRequest.numberOfRepeatsAllowed is three (3)" ) assert inst.dynamicValue[0].expression.expression == "3" assert inst.dynamicValue[0].expression.language == "text/cql" assert inst.dynamicValue[0].path == "dispenseRequest.numberOfRepeatsAllowed" assert ( inst.dynamicValue[1].expression.description == "dispenseRequest.quantity is thirty (30) tablets" ) assert inst.dynamicValue[1].expression.expression == "30 '{tbl}'" assert inst.dynamicValue[1].expression.language == "text/cql" assert inst.dynamicValue[1].path == "dispenseRequest.quantity" assert ( inst.effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-12-31"} ).valueDateTime ) assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-01"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "citalopramPrescription" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://motivemi.com"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "citalopramPrescription" assert inst.jurisdiction[0].coding[0].code == "US" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.kind == "MedicationRequest" assert ( inst.lastReviewDate == ExternalValidatorModel.model_validate({"valueDate": "2016-08-15"}).valueDate ) assert inst.name == "CitalopramPrescription" assert inst.productReference.reference == "#citalopramMedication" assert inst.publisher == "Motive Medical Intelligence" assert inst.purpose == ( "Defines a guideline supported prescription for the treatment" " of depressive disorders" ) assert inst.relatedArtifact[0].display == ( "Practice Guideline for the Treatment of Patients with Major " "Depressive Disorder" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf" } ).valueUrl ) assert inst.relatedArtifact[0].type == "citation" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( { "valueUrl": "http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf" } ).valueUrl ) assert inst.relatedArtifact[1].resource == "#citalopramMedication" assert inst.relatedArtifact[1].type == "composed-of" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Citalopram Prescription" assert inst.topic[0].text == "Mental Health Treatment" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://motivemi.com/artifacts/ActivityDefinition/citalopramPrescription" } ).valueUri ) assert inst.usage == ( "This activity definition is used as part of various suicide " "risk order sets" ) assert inst.useContext[0].code.code == "age" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "D000328" assert inst.useContext[0].valueCodeableConcept.coding[0].display == "Adult" assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://meshb.nlm.nih.gov"} ).valueUri ) assert inst.useContext[1].code.code == "focus" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueCodeableConcept.coding[0].code == "87512008" assert ( inst.useContext[1].valueCodeableConcept.coding[0].display == "Mild major depression" ) assert ( inst.useContext[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[2].code.code == "focus" assert ( inst.useContext[2].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[2].valueCodeableConcept.coding[0].code == "40379007" assert ( inst.useContext[2].valueCodeableConcept.coding[0].display == "Major depression, recurrent, mild" ) assert ( inst.useContext[2].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[3].code.code == "focus" assert ( inst.useContext[3].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[3].valueCodeableConcept.coding[0].code == "225444004" assert ( inst.useContext[3].valueCodeableConcept.coding[0].display == "At risk for suicide (finding)" ) assert ( inst.useContext[3].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[4].code.code == "focus" assert ( inst.useContext[4].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[4].valueCodeableConcept.coding[0].code == "306206005" assert ( inst.useContext[4].valueCodeableConcept.coding[0].display == "Referral to service (procedure)" ) assert ( inst.useContext[4].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[5].code.code == "user" assert ( inst.useContext[5].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[5].valueCodeableConcept.coding[0].code == "309343006" assert inst.useContext[5].valueCodeableConcept.coding[0].display == "Physician" assert ( inst.useContext[5].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[6].code.code == "venue" assert ( inst.useContext[6].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[6].valueCodeableConcept.coding[0].code == "440655000" assert ( inst.useContext[6].valueCodeableConcept.coding[0].display == "Outpatient environment" ) assert ( inst.useContext[6].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version == "1.0.0" def test_activitydefinition_5(base_settings): """No. 5 tests collection for ActivityDefinition. Test File: activitydefinition-medicationorder-example.json """ filename = ( base_settings["unittest_data_dir"] / "activitydefinition-medicationorder-example.json" ) inst = activitydefinition.ActivityDefinition.model_validate_json( filename.read_bytes() ) assert "ActivityDefinition" == inst.get_resource_type() impl_activitydefinition_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ActivityDefinition" == data["resourceType"] inst2 = activitydefinition.ActivityDefinition(**data) impl_activitydefinition_5(inst2) def impl_activitydefinition_6(inst): assert inst.code.coding[0].code == "1155608" assert inst.code.coding[0].display == "alteplase injectable product" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.dosage[0].doseAndRate[0].doseQuantity.code == "mg/kg" assert ( inst.dosage[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.dosage[0].doseAndRate[0].doseQuantity.value) == float(0.9) assert inst.dosage[0].doseAndRate[0].type.coding[0].code == "calculated" assert inst.dosage[0].doseAndRate[0].type.coding[0].display == "Calculated" assert ( inst.dosage[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosage[0].maxDosePerAdministration.code == "mg" assert ( inst.dosage[0].maxDosePerAdministration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.dosage[0].maxDosePerAdministration.value) == float(90) assert inst.dosage[0].route.coding[0].code == "47625008" assert inst.dosage[0].route.coding[0].display == "Intravenous use" assert ( inst.dosage[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage[0].sequence == 1 assert inst.dosage[0].text == "give 10% of dose over 1 minute" assert inst.dosage[1].doseAndRate[0].doseQuantity.code == "mg/kg" assert ( inst.dosage[1].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.dosage[1].doseAndRate[0].doseQuantity.value) == float(0.9) assert inst.dosage[1].doseAndRate[0].type.coding[0].code == "calculated" assert inst.dosage[1].doseAndRate[0].type.coding[0].display == "Calculated" assert ( inst.dosage[1].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosage[1].maxDosePerAdministration.code == "mg" assert ( inst.dosage[1].maxDosePerAdministration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.dosage[1].maxDosePerAdministration.value) == float(90) assert inst.dosage[1].route.coding[0].code == "47625008" assert inst.dosage[1].route.coding[0].display == "Intravenous use" assert ( inst.dosage[1].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage[1].sequence == 2 assert inst.dosage[1].text == "give remaining 90% of dose over 1 hour" assert inst.experimental is True assert inst.id == "example-alteplase-dosing" assert inst.intent == "order" assert inst.kind == "MedicationRequest" assert inst.name == "Alteplase Dosing for Stroke" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/fhir/ActivityDefinition/example-alteplase-dosing" } ).valueUri ) def test_activitydefinition_6(base_settings): """No. 6 tests collection for ActivityDefinition. Test File: activitydefinition-example-alteplase-dosing.json """ filename = ( base_settings["unittest_data_dir"] / "activitydefinition-example-alteplase-dosing.json" ) inst = activitydefinition.ActivityDefinition.model_validate_json( filename.read_bytes() ) assert "ActivityDefinition" == inst.get_resource_type() impl_activitydefinition_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ActivityDefinition" == data["resourceType"] inst2 = activitydefinition.ActivityDefinition(**data) impl_activitydefinition_6(inst2) def impl_activitydefinition_7(inst): assert ( inst.approvalDate == ExternalValidatorModel.model_validate({"valueDate": "2017-03-01"}).valueDate ) assert inst.author[0].name == "Motive Medical Intelligence" assert inst.author[0].telecom[0].system == "phone" assert inst.author[0].telecom[0].use == "work" assert inst.author[0].telecom[0].value == "415-362-4007" assert inst.author[0].telecom[1].system == "email" assert inst.author[0].telecom[1].use == "work" assert inst.author[0].telecom[1].value == "info@motivemi.com" assert inst.code.coding[0].code == "306206005" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Referral to service (procedure)" assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "415-362-4007" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].use == "work" assert inst.contact[0].telecom[1].value == "info@motivemi.com" assert inst.copyright == ( "© Copyright 2016 Motive Medical Intelligence. All rights " "reserved." ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-03T14:06:00Z"} ).valueDateTime ) assert inst.description == ( "refer to primary care mental-health integrated care program " "for evaluation and treatment of mental health conditions now" ) assert ( inst.effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-12-31"} ).valueDateTime ) assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-01"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "referralPrimaryCareMentalHealth" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://motivemi.com/artifacts"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "referralPrimaryCareMentalHealth" assert inst.jurisdiction[0].coding[0].code == "US" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.kind == "ServiceRequest" assert ( inst.lastReviewDate == ExternalValidatorModel.model_validate({"valueDate": "2017-03-01"}).valueDate ) assert inst.name == "ReferralPrimaryCareMentalHealth" assert inst.participant[0].type == "practitioner" assert inst.publisher == "Motive Medical Intelligence" assert inst.relatedArtifact[0].display == ( "Practice Guideline for the Treatment of Patients with Major " "Depressive Disorder" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf" } ).valueUrl ) assert inst.relatedArtifact[0].type == "citation" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( { "valueUrl": "http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf" } ).valueUrl ) assert inst.relatedArtifact[1].resource == ( "http://example.org/fhir/ActivityDefinition/referralPrimaryCa" "reMentalHealth-initial" ) assert inst.relatedArtifact[1].type == "predecessor" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Referral to Primary Care Mental Health" assert inst.topic[0].text == "Mental Health Referral" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://motivemi.com/artifacts/ActivityDefinition/referralPrimaryCareMentalHealth" } ).valueUri ) assert inst.useContext[0].code.code == "age" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "D000328" assert inst.useContext[0].valueCodeableConcept.coding[0].display == "Adult" assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://meshb.nlm.nih.gov"} ).valueUri ) assert inst.useContext[1].code.code == "focus" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueCodeableConcept.coding[0].code == "87512008" assert ( inst.useContext[1].valueCodeableConcept.coding[0].display == "Mild major depression" ) assert ( inst.useContext[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[2].code.code == "focus" assert ( inst.useContext[2].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[2].valueCodeableConcept.coding[0].code == "40379007" assert ( inst.useContext[2].valueCodeableConcept.coding[0].display == "Major depression, recurrent, mild" ) assert ( inst.useContext[2].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[3].code.code == "focus" assert ( inst.useContext[3].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[3].valueCodeableConcept.coding[0].code == "225444004" assert ( inst.useContext[3].valueCodeableConcept.coding[0].display == "At risk for suicide (finding)" ) assert ( inst.useContext[3].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[4].code.code == "focus" assert ( inst.useContext[4].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[4].valueCodeableConcept.coding[0].code == "306206005" assert ( inst.useContext[4].valueCodeableConcept.coding[0].display == "Referral to service (procedure)" ) assert ( inst.useContext[4].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[5].code.code == "user" assert ( inst.useContext[5].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[5].valueCodeableConcept.coding[0].code == "309343006" assert inst.useContext[5].valueCodeableConcept.coding[0].display == "Physician" assert ( inst.useContext[5].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[6].code.code == "venue" assert ( inst.useContext[6].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[6].valueCodeableConcept.coding[0].code == "440655000" assert ( inst.useContext[6].valueCodeableConcept.coding[0].display == "Outpatient environment" ) assert ( inst.useContext[6].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version == "1.1.0" def test_activitydefinition_7(base_settings): """No. 7 tests collection for ActivityDefinition. Test File: activitydefinition-example.json """ filename = base_settings["unittest_data_dir"] / "activitydefinition-example.json" inst = activitydefinition.ActivityDefinition.model_validate_json( filename.read_bytes() ) assert "ActivityDefinition" == inst.get_resource_type() impl_activitydefinition_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ActivityDefinition" == data["resourceType"] inst2 = activitydefinition.ActivityDefinition(**data) impl_activitydefinition_7(inst2) def impl_activitydefinition_8(inst): assert inst.code.text == "Serum Dengue Virus IgM" assert inst.description == "Order Serum Dengue Virus IgM" assert inst.experimental is True assert inst.id == "serum-dengue-virus-igm" assert inst.kind == "ServiceRequest" assert inst.participant[0].type == "practitioner" assert inst.relatedArtifact[0].display == ( "Explanation of diagnostic tests for Dengue virus and which " "to use based on the patient’s clinical and exposure history." ) assert inst.relatedArtifact[0].type == "documentation" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/ActivityDefinition/serum-dengue-virus-igm"} ).valueUri ) def test_activitydefinition_8(base_settings): """No. 8 tests collection for ActivityDefinition. Test File: activitydefinition-order-serum-dengue-virus-igm.json """ filename = ( base_settings["unittest_data_dir"] / "activitydefinition-order-serum-dengue-virus-igm.json" ) inst = activitydefinition.ActivityDefinition.model_validate_json( filename.read_bytes() ) assert "ActivityDefinition" == inst.get_resource_type() impl_activitydefinition_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ActivityDefinition" == data["resourceType"] inst2 = activitydefinition.ActivityDefinition(**data) impl_activitydefinition_8(inst2) def impl_activitydefinition_9(inst): assert inst.bodySite[0].coding[0].code == "17401000" assert inst.bodySite[0].coding[0].display == "Heart valve structure" assert ( inst.bodySite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.coding[0].code == "34068001" assert inst.code.coding[0].display == "Heart valve replacement" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.description == "Heart valve replacement" assert inst.experimental is True assert inst.id == "heart-valve-replacement" assert inst.kind == "ServiceRequest" assert inst.location.reference == "Location/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].role.coding[0].code == "207RI0011X" assert inst.participant[0].role.coding[0].display == "Interventional Cardiology" assert ( inst.participant[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://nucc.org/provider-taxonomy"} ).valueUri ) assert inst.participant[0].role.text == "Interventional Cardiology" assert inst.participant[0].type == "practitioner" assert ( inst.purpose == "Describes the proposal to perform a Heart Valve replacement." ) assert inst.status == "draft" assert inst.text.status == "generated" assert inst.topic[0].coding[0].code == "34068001" assert inst.topic[0].coding[0].display == "Heart valve replacement" assert ( inst.topic[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[0].code.code == "age" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "D000328" assert inst.useContext[0].valueCodeableConcept.coding[0].display == "Adult" assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://meshb.nlm.nih.gov"} ).valueUri ) assert inst.useContext[1].code.code == "user" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueCodeableConcept.coding[0].code == "309343006" assert inst.useContext[1].valueCodeableConcept.coding[0].display == "Physician" assert ( inst.useContext[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_activitydefinition_9(base_settings): """No. 9 tests collection for ActivityDefinition. Test File: activitydefinition-servicerequest-example.json """ filename = ( base_settings["unittest_data_dir"] / "activitydefinition-servicerequest-example.json" ) inst = activitydefinition.ActivityDefinition.model_validate_json( filename.read_bytes() ) assert "ActivityDefinition" == inst.get_resource_type() impl_activitydefinition_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ActivityDefinition" == data["resourceType"] inst2 = activitydefinition.ActivityDefinition(**data) impl_activitydefinition_9(inst2) def impl_activitydefinition_10(inst): assert inst.code.coding[0].code == "BlueTubes" assert inst.code.coding[0].display == "Blood collect tubes blue cap" assert inst.description == "10 Blood collect tubes blue cap" assert inst.experimental is True assert inst.id == "blood-tubes-supply" assert inst.kind == "SupplyRequest" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.purpose == ( "Describes a request for 10 Blood collection tubes with blue " "caps." ) assert float(inst.quantity.value) == float(10) assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.transform == "http://example.org/fhir/StructureMap/supplyrequest-transform" ) def test_activitydefinition_10(base_settings): """No. 10 tests collection for ActivityDefinition. Test File: activitydefinition-supplyrequest-example.json """ filename = ( base_settings["unittest_data_dir"] / "activitydefinition-supplyrequest-example.json" ) inst = activitydefinition.ActivityDefinition.model_validate_json( filename.read_bytes() ) assert "ActivityDefinition" == inst.get_resource_type() impl_activitydefinition_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ActivityDefinition" == data["resourceType"] inst2 = activitydefinition.ActivityDefinition(**data) impl_activitydefinition_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_administrableproductdefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/AdministrableProductDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import administrableproductdefinition from .conftest import ExternalValidatorModel # noqa: F401 def impl_administrableproductdefinition_1(inst): assert inst.administrableDoseForm.coding[0].code == "Film-coatedtablet" assert ( inst.administrableDoseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/administrabledoseform"} ).valueUri ) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/phpididentifiersets"} ).valueUri ) assert inst.identifier[0].value == "{PhPID}" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.routeOfAdministration[0].code.coding[0].code == "OralUse" assert ( inst.routeOfAdministration[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/routeofadministration"} ).valueUri ) assert inst.status == "active" assert inst.text.status == "generated" assert inst.unitOfPresentation.coding[0].code == "Tablet" assert ( inst.unitOfPresentation.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/unitofpresentation"} ).valueUri ) def test_administrableproductdefinition_1(base_settings): """No. 1 tests collection for AdministrableProductDefinition. Test File: administrableproductdefinition-example.json """ filename = ( base_settings["unittest_data_dir"] / "administrableproductdefinition-example.json" ) inst = administrableproductdefinition.AdministrableProductDefinition.model_validate_json( filename.read_bytes() ) assert "AdministrableProductDefinition" == inst.get_resource_type() impl_administrableproductdefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AdministrableProductDefinition" == data["resourceType"] inst2 = administrableproductdefinition.AdministrableProductDefinition(**data) impl_administrableproductdefinition_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_adverseevent.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/AdverseEvent Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import adverseevent from .conftest import ExternalValidatorModel # noqa: F401 def impl_adverseevent_1(inst): assert inst.actuality == "actual" assert inst.category[0].coding[0].code == "product-use-error" assert inst.category[0].coding[0].display == "Product Use Error" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/adverse-event-category"} ).valueUri ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-29T12:34:56+00:00"} ).valueDateTime ) assert inst.event.coding[0].code == "304386008" assert inst.event.coding[0].display == "O/E - itchy rash" assert ( inst.event.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.event.text == "This was a mild rash on the left forearm" assert inst.id == "example" assert ( inst.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/ids/patients/risks"} ).valueUri ) assert inst.identifier.value == "49476534" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.recorder.reference == "Practitioner/example" assert inst.seriousness.coding[0].code == "Non-serious" assert inst.seriousness.coding[0].display == "Non-serious" assert ( inst.seriousness.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/adverse-event-seriousness" } ).valueUri ) assert inst.severity.coding[0].code == "mild" assert inst.severity.coding[0].display == "Mild" assert ( inst.severity.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/adverse-event-severity"} ).valueUri ) assert inst.subject.reference == "Patient/example" assert inst.suspectEntity[0].instance.reference == "Medication/example" assert inst.text.status == "generated" def test_adverseevent_1(base_settings): """No. 1 tests collection for AdverseEvent. Test File: adverseevent-example.json """ filename = base_settings["unittest_data_dir"] / "adverseevent-example.json" inst = adverseevent.AdverseEvent.model_validate_json(filename.read_bytes()) assert "AdverseEvent" == inst.get_resource_type() impl_adverseevent_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AdverseEvent" == data["resourceType"] inst2 = adverseevent.AdverseEvent(**data) impl_adverseevent_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_allergyintolerance.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/AllergyIntolerance Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import allergyintolerance from .conftest import ExternalValidatorModel # noqa: F401 def impl_allergyintolerance_1(inst): assert inst.clinicalStatus.coding[0].code == "active" assert inst.clinicalStatus.coding[0].display == "Active" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical" } ).valueUri ) assert inst.code.coding[0].code == "716184000" assert inst.code.coding[0].display == "No Known Latex Allergy (situation)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "No Known Latex Allergy" assert inst.id == "nkla" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-06T15:37:31-06:00"} ).valueDateTime ) assert inst.recorder.reference == "Practitioner/example" assert inst.text.status == "generated" assert inst.verificationStatus.coding[0].code == "confirmed" assert inst.verificationStatus.coding[0].display == "Confirmed" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification" } ).valueUri ) def test_allergyintolerance_1(base_settings): """No. 1 tests collection for AllergyIntolerance. Test File: allergyintolerance-nkla.json """ filename = base_settings["unittest_data_dir"] / "allergyintolerance-nkla.json" inst = allergyintolerance.AllergyIntolerance.model_validate_json( filename.read_bytes() ) assert "AllergyIntolerance" == inst.get_resource_type() impl_allergyintolerance_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AllergyIntolerance" == data["resourceType"] inst2 = allergyintolerance.AllergyIntolerance(**data) impl_allergyintolerance_1(inst2) def impl_allergyintolerance_2(inst): assert inst.asserter.reference == "Patient/example" assert inst.category[0] == "food" assert inst.clinicalStatus.coding[0].code == "active" assert inst.clinicalStatus.coding[0].display == "Active" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical" } ).valueUri ) assert inst.code.coding[0].code == "227493005" assert inst.code.coding[0].display == "Cashew nuts" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.criticality == "high" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/ids/patients/risks"} ).valueUri ) assert inst.identifier[0].value == "49476534" assert ( inst.lastOccurrence == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-06"} ).valueDateTime ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == ( "The criticality is high becasue of the observed anaphylactic" " reaction when challenged with cashew extract." ) assert ( inst.onsetDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2004"} ).valueDateTime ) assert inst.patient.reference == "Patient/example" assert inst.reaction[0].description == ( "Challenge Protocol. Severe reaction to subcutaneous cashew " "extract. Epinephrine administered" ) assert inst.reaction[0].exposureRoute.coding[0].code == "34206005" assert inst.reaction[0].exposureRoute.coding[0].display == "Subcutaneous route" assert ( inst.reaction[0].exposureRoute.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.reaction[0].manifestation[0].coding[0].code == "39579001" assert ( inst.reaction[0].manifestation[0].coding[0].display == "Anaphylactic reaction" ) assert ( inst.reaction[0].manifestation[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.reaction[0].onset == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-06-12"} ).valueDateTime ) assert inst.reaction[0].severity == "severe" assert inst.reaction[0].substance.coding[0].code == "1160593" assert ( inst.reaction[0].substance.coding[0].display == "cashew nut allergenic extract Injectable Product" ) assert ( inst.reaction[0].substance.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.reaction[1].manifestation[0].coding[0].code == "64305001" assert inst.reaction[1].manifestation[0].coding[0].display == "Urticaria" assert ( inst.reaction[1].manifestation[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.reaction[1].note[0].text == ( "The patient reports that the onset of urticaria was within " "15 minutes of eating cashews." ) assert ( inst.reaction[1].onset == ExternalValidatorModel.model_validate( {"valueDateTime": "2004"} ).valueDateTime ) assert inst.reaction[1].severity == "moderate" assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-10-09T14:58:00+11:00"} ).valueDateTime ) assert inst.recorder.reference == "Practitioner/example" assert inst.text.status == "generated" assert inst.type == "allergy" assert inst.verificationStatus.coding[0].code == "confirmed" assert inst.verificationStatus.coding[0].display == "Confirmed" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification" } ).valueUri ) def test_allergyintolerance_2(base_settings): """No. 2 tests collection for AllergyIntolerance. Test File: allergyintolerance-example.json """ filename = base_settings["unittest_data_dir"] / "allergyintolerance-example.json" inst = allergyintolerance.AllergyIntolerance.model_validate_json( filename.read_bytes() ) assert "AllergyIntolerance" == inst.get_resource_type() impl_allergyintolerance_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AllergyIntolerance" == data["resourceType"] inst2 = allergyintolerance.AllergyIntolerance(**data) impl_allergyintolerance_2(inst2) def impl_allergyintolerance_3(inst): assert inst.clinicalStatus.coding[0].code == "active" assert inst.clinicalStatus.coding[0].display == "Active" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical" } ).valueUri ) assert inst.code.coding[0].code == "716186003" assert inst.code.coding[0].display == "No Known Allergy (situation)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "NKA" assert inst.id == "nka" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/mom" assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-06T15:37:31-06:00"} ).valueDateTime ) assert inst.recorder.reference == "Practitioner/example" assert inst.text.status == "generated" assert inst.verificationStatus.coding[0].code == "confirmed" assert inst.verificationStatus.coding[0].display == "Confirmed" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification" } ).valueUri ) def test_allergyintolerance_3(base_settings): """No. 3 tests collection for AllergyIntolerance. Test File: allergyintolerance-nka.json """ filename = base_settings["unittest_data_dir"] / "allergyintolerance-nka.json" inst = allergyintolerance.AllergyIntolerance.model_validate_json( filename.read_bytes() ) assert "AllergyIntolerance" == inst.get_resource_type() impl_allergyintolerance_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AllergyIntolerance" == data["resourceType"] inst2 = allergyintolerance.AllergyIntolerance(**data) impl_allergyintolerance_3(inst2) def impl_allergyintolerance_4(inst): assert inst.category[0] == "medication" assert inst.clinicalStatus.coding[0].code == "active" assert inst.clinicalStatus.coding[0].display == "Active" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical" } ).valueUri ) assert inst.code.coding[0].code == "7980" assert inst.code.coding[0].display == "Penicillin G" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.criticality == "high" assert inst.id == "medication" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert inst.reaction[0].manifestation[0].coding[0].code == "247472004" assert inst.reaction[0].manifestation[0].coding[0].display == "Hives" assert ( inst.reaction[0].manifestation[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2010-03-01"} ).valueDateTime ) assert inst.recorder.reference == "Practitioner/13" assert inst.text.status == "generated" assert inst.verificationStatus.coding[0].code == "unconfirmed" assert inst.verificationStatus.coding[0].display == "Unconfirmed" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification" } ).valueUri ) def test_allergyintolerance_4(base_settings): """No. 4 tests collection for AllergyIntolerance. Test File: allergyintolerance-medication.json """ filename = base_settings["unittest_data_dir"] / "allergyintolerance-medication.json" inst = allergyintolerance.AllergyIntolerance.model_validate_json( filename.read_bytes() ) assert "AllergyIntolerance" == inst.get_resource_type() impl_allergyintolerance_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AllergyIntolerance" == data["resourceType"] inst2 = allergyintolerance.AllergyIntolerance(**data) impl_allergyintolerance_4(inst2) def impl_allergyintolerance_5(inst): assert inst.category[0] == "food" assert inst.clinicalStatus.coding[0].code == "active" assert inst.clinicalStatus.coding[0].display == "Active" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical" } ).valueUri ) assert inst.code.coding[0].code == "227037002" assert inst.code.coding[0].display == "Fish - dietary (substance)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Allergic to fresh fish. Tolerates canned fish" assert inst.id == "fishallergy" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/ids/patients/risks"} ).valueUri ) assert inst.identifier[0].value == "49476535" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-06T15:37:31-06:00"} ).valueDateTime ) assert inst.recorder.reference == "Practitioner/example" assert inst.text.status == "additional" assert inst.verificationStatus.coding[0].code == "confirmed" assert inst.verificationStatus.coding[0].display == "Confirmed" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification" } ).valueUri ) def test_allergyintolerance_5(base_settings): """No. 5 tests collection for AllergyIntolerance. Test File: allergyintolerance-fishallergy.json """ filename = ( base_settings["unittest_data_dir"] / "allergyintolerance-fishallergy.json" ) inst = allergyintolerance.AllergyIntolerance.model_validate_json( filename.read_bytes() ) assert "AllergyIntolerance" == inst.get_resource_type() impl_allergyintolerance_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AllergyIntolerance" == data["resourceType"] inst2 = allergyintolerance.AllergyIntolerance(**data) impl_allergyintolerance_5(inst2) def impl_allergyintolerance_6(inst): assert inst.clinicalStatus.coding[0].code == "active" assert inst.clinicalStatus.coding[0].display == "Active" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical" } ).valueUri ) assert inst.code.coding[0].code == "409137002" assert inst.code.coding[0].display == "No Known Drug Allergy (situation)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "NKDA" assert inst.id == "nkda" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/mom" assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-06T15:37:31-06:00"} ).valueDateTime ) assert inst.recorder.reference == "Practitioner/example" assert inst.text.status == "generated" assert inst.verificationStatus.coding[0].code == "confirmed" assert inst.verificationStatus.coding[0].display == "Confirmed" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification" } ).valueUri ) def test_allergyintolerance_6(base_settings): """No. 6 tests collection for AllergyIntolerance. Test File: allergyintolerance-nkda.json """ filename = base_settings["unittest_data_dir"] / "allergyintolerance-nkda.json" inst = allergyintolerance.AllergyIntolerance.model_validate_json( filename.read_bytes() ) assert "AllergyIntolerance" == inst.get_resource_type() impl_allergyintolerance_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AllergyIntolerance" == data["resourceType"] inst2 = allergyintolerance.AllergyIntolerance(**data) impl_allergyintolerance_6(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_appointment.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Appointment Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import appointment from .conftest import ExternalValidatorModel # noqa: F401 def impl_appointment_1(inst): assert inst.appointmentType.coding[0].code == "FOLLOWUP" assert ( inst.appointmentType.coding[0].display == "A follow up visit from a previous appointment" ) assert ( inst.appointmentType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0276"} ).valueUri ) assert inst.basedOn[0].reference == "ServiceRequest/myringotomy" assert inst.comment == ( "Further expand on the results of the MRI and determine the " "next actions that may be appropriate." ) assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-10-10"} ).valueDateTime ) assert inst.description == "Discussion on the results of your recent MRI" assert ( inst.end == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-10T11:00:00Z"} ).valueInstant ) assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].actor.display == "Peter James Chalmers" assert inst.participant[0].actor.reference == "Patient/example" assert inst.participant[0].required == "required" assert inst.participant[0].status == "accepted" assert inst.participant[1].actor.display == "Dr Adam Careful" assert inst.participant[1].actor.reference == "Practitioner/example" assert inst.participant[1].required == "required" assert inst.participant[1].status == "accepted" assert inst.participant[1].type[0].coding[0].code == "ATND" assert ( inst.participant[1].type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.participant[2].actor.display == "South Wing, second floor" assert inst.participant[2].actor.reference == "Location/1" assert inst.participant[2].required == "required" assert inst.participant[2].status == "accepted" assert inst.priority == 5 assert inst.reasonReference[0].display == "Severe burn of left ear" assert inst.reasonReference[0].reference == "Condition/example" assert inst.serviceCategory[0].coding[0].code == "gp" assert inst.serviceCategory[0].coding[0].display == "General Practice" assert ( inst.serviceCategory[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/service-category"} ).valueUri ) assert inst.serviceType[0].coding[0].code == "52" assert inst.serviceType[0].coding[0].display == "General Discussion" assert inst.specialty[0].coding[0].code == "394814009" assert inst.specialty[0].coding[0].display == "General practice" assert ( inst.specialty[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.start == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-10T09:00:00Z"} ).valueInstant ) assert inst.status == "booked" assert inst.text.div == ( '
Brian MRI ' "results discussion
" ) assert inst.text.status == "generated" def test_appointment_1(base_settings): """No. 1 tests collection for Appointment. Test File: appointment-example.json """ filename = base_settings["unittest_data_dir"] / "appointment-example.json" inst = appointment.Appointment.model_validate_json(filename.read_bytes()) assert "Appointment" == inst.get_resource_type() impl_appointment_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Appointment" == data["resourceType"] inst2 = appointment.Appointment(**data) impl_appointment_1(inst2) def impl_appointment_2(inst): assert inst.appointmentType.coding[0].code == "WALKIN" assert ( inst.appointmentType.coding[0].display == "A previously unscheduled walk-in visit" ) assert ( inst.appointmentType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0276"} ).valueUri ) assert inst.comment == ( "Further expand on the results of the MRI and determine the " "next actions that may be appropriate." ) assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-12-02"} ).valueDateTime ) assert inst.description == "Discussion on the results of your recent MRI" assert inst.id == "examplereq" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/sampleappointment-identifier"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.minutesDuration == 15 assert inst.participant[0].actor.display == "Peter James Chalmers" assert inst.participant[0].actor.reference == "Patient/example" assert inst.participant[0].required == "required" assert inst.participant[0].status == "needs-action" assert inst.participant[1].required == "required" assert inst.participant[1].status == "needs-action" assert inst.participant[1].type[0].coding[0].code == "ATND" assert ( inst.participant[1].type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.participant[2].actor.display == "South Wing, second floor" assert inst.participant[2].actor.reference == "Location/1" assert inst.participant[2].required == "required" assert inst.participant[2].status == "accepted" assert inst.priority == 5 assert inst.reasonCode[0].coding[0].code == "413095006" assert ( inst.reasonCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.reasonCode[0].text == "Clinical Review" assert ( inst.requestedPeriod[0].end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-06-09"} ).valueDateTime ) assert ( inst.requestedPeriod[0].start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-06-02"} ).valueDateTime ) assert inst.serviceCategory[0].coding[0].code == "gp" assert inst.serviceCategory[0].coding[0].display == "General Practice" assert ( inst.serviceCategory[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/service-category"} ).valueUri ) assert inst.slot[0].reference == "Slot/example" assert inst.specialty[0].coding[0].code == "394814009" assert inst.specialty[0].coding[0].display == "General practice" assert ( inst.specialty[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.status == "proposed" assert inst.text.div == ( '
Brian MRI ' "results discussion
" ) assert inst.text.status == "generated" def test_appointment_2(base_settings): """No. 2 tests collection for Appointment. Test File: appointment-example-request.json """ filename = base_settings["unittest_data_dir"] / "appointment-example-request.json" inst = appointment.Appointment.model_validate_json(filename.read_bytes()) assert "Appointment" == inst.get_resource_type() impl_appointment_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Appointment" == data["resourceType"] inst2 = appointment.Appointment(**data) impl_appointment_2(inst2) def impl_appointment_3(inst): assert inst.appointmentType.coding[0].code == "WALKIN" assert ( inst.appointmentType.coding[0].display == "A previously unscheduled walk-in visit" ) assert ( inst.appointmentType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0276"} ).valueUri ) assert inst.comment == ( "Clarify the results of the MRI to ensure context of test was" " correct" ) assert inst.description == "Discussion about Peter Chalmers MRI results" assert ( inst.end == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-09T11:00:00Z"} ).valueInstant ) assert inst.id == "2docs" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].actor.display == "Peter James Chalmers" assert inst.participant[0].actor.reference == "Patient/example" assert inst.participant[0].required == "information-only" assert inst.participant[0].status == "accepted" assert inst.participant[1].actor.display == "Dr Adam Careful" assert inst.participant[1].actor.reference == "Practitioner/example" assert inst.participant[1].required == "required" assert inst.participant[1].status == "accepted" assert inst.participant[2].actor.display == "Luigi Maas" assert inst.participant[2].actor.reference == "Practitioner/f202" assert inst.participant[2].required == "required" assert inst.participant[2].status == "accepted" assert inst.participant[3].actor.display == "Phone Call" assert inst.participant[3].required == "information-only" assert inst.participant[3].status == "accepted" assert inst.priority == 5 assert inst.serviceCategory[0].coding[0].code == "gp" assert inst.serviceCategory[0].coding[0].display == "General Practice" assert ( inst.serviceCategory[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/service-category"} ).valueUri ) assert inst.serviceType[0].coding[0].code == "52" assert inst.serviceType[0].coding[0].display == "General Discussion" assert inst.specialty[0].coding[0].code == "394814009" assert inst.specialty[0].coding[0].display == "General practice" assert ( inst.specialty[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.start == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-09T09:00:00Z"} ).valueInstant ) assert inst.status == "booked" assert inst.supportingInformation[0].reference == "DiagnosticReport/ultrasound" assert inst.text.div == ( '
Brian MRI ' "results discussion
" ) assert inst.text.status == "generated" def test_appointment_3(base_settings): """No. 3 tests collection for Appointment. Test File: appointment-example2doctors.json """ filename = base_settings["unittest_data_dir"] / "appointment-example2doctors.json" inst = appointment.Appointment.model_validate_json(filename.read_bytes()) assert "Appointment" == inst.get_resource_type() impl_appointment_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Appointment" == data["resourceType"] inst2 = appointment.Appointment(**data) impl_appointment_3(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_appointmentresponse.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/AppointmentResponse Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import appointmentresponse from .conftest import ExternalValidatorModel # noqa: F401 def impl_appointmentresponse_1(inst): assert inst.actor.display == "Dr Adam Careful" assert inst.actor.reference == "Practitioner/example" assert inst.appointment.display == "Brian MRI results discussion" assert inst.appointment.reference == "Appointment/examplereq" assert inst.comment == "can't we try for this time, can't do mornings" assert ( inst.end == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-25T13:30:00Z"} ).valueInstant ) assert inst.id == "exampleresp" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/sampleappointmentresponse-identifier"} ).valueUri ) assert inst.identifier[0].value == "response123" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participantStatus == "tentative" assert inst.participantType[0].coding[0].code == "ATND" assert ( inst.participantType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert ( inst.start == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-25T13:15:00Z"} ).valueInstant ) assert inst.text.div == ( '
Accept Brian MRI' " results discussion
" ) assert inst.text.status == "generated" def test_appointmentresponse_1(base_settings): """No. 1 tests collection for AppointmentResponse. Test File: appointmentresponse-example-req.json """ filename = ( base_settings["unittest_data_dir"] / "appointmentresponse-example-req.json" ) inst = appointmentresponse.AppointmentResponse.model_validate_json( filename.read_bytes() ) assert "AppointmentResponse" == inst.get_resource_type() impl_appointmentresponse_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AppointmentResponse" == data["resourceType"] inst2 = appointmentresponse.AppointmentResponse(**data) impl_appointmentresponse_1(inst2) def impl_appointmentresponse_2(inst): assert inst.actor.display == "Peter James Chalmers" assert inst.actor.reference == "Patient/example" assert inst.appointment.display == "Brian MRI results discussion" assert inst.appointment.reference == "Appointment/example" assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participantStatus == "accepted" assert inst.text.div == ( '
Accept Brian MRI' " results discussion
" ) assert inst.text.status == "generated" def test_appointmentresponse_2(base_settings): """No. 2 tests collection for AppointmentResponse. Test File: appointmentresponse-example.json """ filename = base_settings["unittest_data_dir"] / "appointmentresponse-example.json" inst = appointmentresponse.AppointmentResponse.model_validate_json( filename.read_bytes() ) assert "AppointmentResponse" == inst.get_resource_type() impl_appointmentresponse_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AppointmentResponse" == data["resourceType"] inst2 = appointmentresponse.AppointmentResponse(**data) impl_appointmentresponse_2(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_auditevent.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/AuditEvent Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import auditevent from .conftest import ExternalValidatorModel # noqa: F401 def impl_auditevent_1(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 == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/extra-security-role-type" } ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert ( inst.agent[1].who.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.4.2"} ).valueUri ) assert inst.agent[1].who.identifier.value == "2.16.840.1.113883.4.2" assert ( inst.entity[0].query == ExternalValidatorModel.model_validate( { "valueBase64Binary": ( "aHR0cDovL2ZoaXItZGV2LmhlYWx0aGludGVyc2VjdGlvbnMuY29tLmF1L29w" "ZW4vRW5jb3VudGVyP3BhcnRpY2lwYW50PTEz" ) } ).valueBase64Binary ) assert inst.entity[0].role.code == "24" assert inst.entity[0].role.display == "Query" assert ( inst.entity[0].role.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/object-role"} ).valueUri ) assert inst.entity[0].type.code == "2" assert inst.entity[0].type.display == "System Object" assert ( inst.entity[0].type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-entity-type"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "0" assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2015-08-22T23:42:24Z"} ).valueInstant ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/security-source-type"} ).valueUri ) assert inst.subtype[0].code == "search" assert inst.subtype[0].display == "search" assert ( inst.subtype[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert inst.text.status == "generated" assert inst.type.code == "rest" assert inst.type.display == "Restful Operation" assert ( inst.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-event-type"} ).valueUri ) def test_auditevent_1(base_settings): """No. 1 tests collection for AuditEvent. Test File: audit-event-example-search.json """ filename = base_settings["unittest_data_dir"] / "audit-event-example-search.json" inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes()) assert "AuditEvent" == inst.get_resource_type() impl_auditevent_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AuditEvent" == data["resourceType"] inst2 = auditevent.AuditEvent(**data) impl_auditevent_1(inst2) def impl_auditevent_2(inst): assert inst.action == "E" assert inst.agent[0].altId == "601847123" assert inst.agent[0].name == "Grahame Grieve" assert inst.agent[0].network.address == "127.0.0.1" assert inst.agent[0].network.type == "2" 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 == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/extra-security-role-type" } ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert ( inst.agent[1].who.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.4.2"} ).valueUri ) assert inst.agent[1].who.identifier.value == "2.16.840.1.113883.4.2" assert inst.id == "example-logout" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "0" assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2013-06-20T23:46:41Z"} ).valueInstant ) assert ( inst.source.observer.identifier.value == "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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/security-source-type"} ).valueUri ) assert inst.subtype[0].code == "110123" assert inst.subtype[0].display == "Logout" assert ( inst.subtype[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.text.status == "generated" assert inst.type.code == "110114" assert inst.type.display == "User Authentication" assert ( inst.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) def test_auditevent_2(base_settings): """No. 2 tests collection for AuditEvent. Test File: audit-event-example-logout.json """ filename = base_settings["unittest_data_dir"] / "audit-event-example-logout.json" inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes()) assert "AuditEvent" == inst.get_resource_type() impl_auditevent_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AuditEvent" == data["resourceType"] inst2 = auditevent.AuditEvent(**data) impl_auditevent_2(inst2) def impl_auditevent_3(inst): assert inst.action == "R" 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 == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/extra-security-role-type" } ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert ( inst.agent[1].who.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.4.2"} ).valueUri ) assert inst.agent[1].who.identifier.value == "2.16.840.1.113883.4.2" assert inst.entity[0].lifecycle.code == "6" assert inst.entity[0].lifecycle.display == "Access / Use" assert ( inst.entity[0].lifecycle.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dicom-audit-lifecycle"} ).valueUri ) assert inst.entity[0].type.code == "2" assert inst.entity[0].type.display == "System Object" assert ( inst.entity[0].type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-entity-type"} ).valueUri ) assert inst.entity[0].what.reference == "Patient/example/_history/1" assert inst.id == "example-rest" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "0" assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2013-06-20T23:42:24Z"} ).valueInstant ) assert ( inst.source.observer.identifier.value == "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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/security-source-type"} ).valueUri ) assert inst.subtype[0].code == "vread" assert inst.subtype[0].display == "vread" assert ( inst.subtype[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert inst.text.status == "generated" assert inst.type.code == "rest" assert inst.type.display == "Restful Operation" assert ( inst.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-event-type"} ).valueUri ) def test_auditevent_3(base_settings): """No. 3 tests collection for AuditEvent. Test File: audit-event-example-vread.json """ filename = base_settings["unittest_data_dir"] / "audit-event-example-vread.json" inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes()) assert "AuditEvent" == inst.get_resource_type() impl_auditevent_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AuditEvent" == data["resourceType"] inst2 = auditevent.AuditEvent(**data) impl_auditevent_3(inst2) def impl_auditevent_4(inst): assert inst.action == "R" 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.agent[0].who.display == "ExportToMedia.app" 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 == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/extra-security-role-type" } ).valueUri ) assert inst.agent[1].who.identifier.value == "95" assert inst.agent[2].media.code == "110033" assert inst.agent[2].media.display == "DVD" assert ( inst.agent[2].media.system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.agent[2].name == "Media title: Hello World" assert inst.agent[2].requestor is False assert inst.agent[2].type.coding[0].code == "110154" assert inst.agent[2].type.coding[0].display == "Destination Media" assert ( inst.agent[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.entity[0].role.code == "1" assert inst.entity[0].role.display == "Patient" assert ( inst.entity[0].role.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/object-role"} ).valueUri ) assert inst.entity[0].type.code == "1" assert inst.entity[0].type.display == "Person" assert ( inst.entity[0].type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-entity-type"} ).valueUri ) assert ( inst.entity[0].what.identifier.value == "e3cdfc81a0d24bd^^^&2.16.840.1.113883.4.2&ISO" ) assert inst.entity[1].role.code == "20" assert inst.entity[1].role.display == "Job" assert ( inst.entity[1].role.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/object-role"} ).valueUri ) assert inst.entity[1].type.code == "2" assert inst.entity[1].type.display == "System Object" assert ( inst.entity[1].type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-entity-type"} ).valueUri ) assert inst.entity[1].what.identifier.type.coding[0].code == "IHE XDS Metadata" assert ( inst.entity[1].what.identifier.type.coding[0].display == "submission set classificationNode" ) assert ( inst.entity[1].what.identifier.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:uuid:a54d6aa5-d40d-43f9-88c5-b4633d873bdd"} ).valueUri ) assert ( inst.entity[1].what.identifier.value == "e3cdfc81a0d24bd^^^&2.16.840.1.113883.4.2&ISO" ) assert inst.entity[2].type.code == "2" assert inst.entity[2].type.display == "System Object" assert ( inst.entity[2].type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-entity-type"} ).valueUri ) assert inst.entity[2].what.reference == "DocumentManifest/example" assert inst.id == "example-media" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "0" assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2015-08-27T23:42:24Z"} ).valueInstant ) assert inst.source.observer.display == "hl7connect.healthintersections.com.au" assert inst.subtype[0].code == "ITI-32" assert inst.subtype[0].display == "Distribute Document Set on Media" assert ( inst.subtype[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.3.6.1.4.1.19376.1.2"} ).valueUri ) assert inst.text.status == "generated" assert inst.type.code == "110106" assert inst.type.display == "Export" assert ( inst.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) def test_auditevent_4(base_settings): """No. 4 tests collection for AuditEvent. Test File: audit-event-example-media.json """ filename = base_settings["unittest_data_dir"] / "audit-event-example-media.json" inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes()) assert "AuditEvent" == inst.get_resource_type() impl_auditevent_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AuditEvent" == data["resourceType"] inst2 = auditevent.AuditEvent(**data) impl_auditevent_4(inst2) 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].network.address == "127.0.0.1" assert inst.agent[0].network.type == "2" 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 == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/extra-security-role-type" } ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert ( inst.agent[1].who.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.4.2"} ).valueUri ) assert inst.agent[1].who.identifier.value == "2.16.840.1.113883.4.2" assert inst.id == "example-login" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "0" assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2013-06-20T23:41:23Z"} ).valueInstant ) assert ( inst.source.observer.identifier.value == "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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/security-source-type"} ).valueUri ) assert inst.subtype[0].code == "110122" assert inst.subtype[0].display == "Login" assert ( inst.subtype[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.text.status == "generated" assert inst.type.code == "110114" assert inst.type.display == "User Authentication" assert ( inst.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) def test_auditevent_5(base_settings): """No. 5 tests collection for AuditEvent. Test File: audit-event-example-login.json """ filename = base_settings["unittest_data_dir"] / "audit-event-example-login.json" inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes()) assert "AuditEvent" == inst.get_resource_type() impl_auditevent_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AuditEvent" == data["resourceType"] inst2 = auditevent.AuditEvent(**data) impl_auditevent_5(inst2) 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].type.coding[0].code == "110153" assert inst.agent[0].type.coding[0].display == "Source Role ID" assert ( inst.agent[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert ( inst.agent[0].who.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.4.2"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/extra-security-role-type" } ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/object-role"} ).valueUri ) assert inst.entity[0].type.code == "1" assert inst.entity[0].type.display == "Person" assert ( inst.entity[0].type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-entity-type"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueBase64Binary": "MS4yLjg0MC4xMTQzNTAuMS4xMy4wLjEuNy4xLjE="} ).valueBase64Binary ) assert inst.entity[1].role.code == "24" assert inst.entity[1].role.display == "Query" assert ( inst.entity[1].role.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/object-role"} ).valueUri ) assert inst.entity[1].type.code == "2" assert inst.entity[1].type.display == "System Object" assert ( inst.entity[1].type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-entity-type"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "0" assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2015-08-26T23:42:24Z"} ).valueInstant ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.3.6.1.4.1.19376.1.2"} ).valueUri ) assert inst.text.status == "generated" assert inst.type.code == "110112" assert inst.type.display == "Query" assert ( inst.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) def test_auditevent_6(base_settings): """No. 6 tests collection for AuditEvent. Test File: audit-event-example-pixQuery.json """ filename = base_settings["unittest_data_dir"] / "audit-event-example-pixQuery.json" inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes()) assert "AuditEvent" == inst.get_resource_type() impl_auditevent_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AuditEvent" == data["resourceType"] inst2 = auditevent.AuditEvent(**data) impl_auditevent_6(inst2) def impl_auditevent_7(inst): assert inst.action == "E" assert inst.agent[0].network.address == "127.0.0.1" assert inst.agent[0].network.type == "2" assert inst.agent[0].requestor is False assert inst.agent[0].role[0].text == "Service User (Logon)" 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 == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/extra-security-role-type" } ).valueUri ) assert inst.agent[0].who.identifier.value == "Grahame" 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert ( inst.agent[1].who.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.4.2"} ).valueUri ) assert inst.agent[1].who.identifier.value == "2.16.840.1.113883.4.2" assert inst.entity[0].lifecycle.code == "6" assert inst.entity[0].lifecycle.display == "Access / Use" assert ( inst.entity[0].lifecycle.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dicom-audit-lifecycle"} ).valueUri ) assert inst.entity[0].name == "Grahame's Laptop" assert inst.entity[0].role.code == "4" assert inst.entity[0].role.display == "Domain Resource" assert ( inst.entity[0].role.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/object-role"} ).valueUri ) assert inst.entity[0].type.code == "4" assert inst.entity[0].type.display == "Other" assert ( inst.entity[0].type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-entity-type"} ).valueUri ) assert inst.entity[0].what.identifier.type.coding[0].code == "SNO" assert ( inst.entity[0].what.identifier.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.entity[0].what.identifier.type.text == "Dell Serial Number" assert inst.entity[0].what.identifier.value == "ABCDEF" assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "0" assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2012-10-25T22:04:27+11:00"} ).valueInstant ) assert inst.source.observer.display == "Grahame's Laptop" assert inst.source.site == "Development" assert inst.source.type[0].code == "110122" assert inst.source.type[0].display == "Login" assert ( inst.source.type[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.subtype[0].code == "110120" assert inst.subtype[0].display == "Application Start" assert ( inst.subtype[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.text.div == ( '
Application ' "Start for under service login "Grahame" (id: " "Grahame's Test HL7Connect)
" ) assert inst.text.status == "generated" assert inst.type.code == "110100" assert inst.type.display == "Application Activity" assert ( inst.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) def test_auditevent_7(base_settings): """No. 7 tests collection for AuditEvent. Test File: auditevent-example.json """ filename = base_settings["unittest_data_dir"] / "auditevent-example.json" inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes()) assert "AuditEvent" == inst.get_resource_type() impl_auditevent_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AuditEvent" == data["resourceType"] inst2 = auditevent.AuditEvent(**data) impl_auditevent_7(inst2) def impl_auditevent_8(inst): assert inst.action == "R" assert inst.agent[0].altId == "notMe" assert inst.agent[0].location.reference == "Location/1" assert inst.agent[0].name == "That guy everyone wishes would be caught" assert inst.agent[0].network.address == "custodian.net" assert inst.agent[0].network.type == "1" assert ( inst.agent[0].policy[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://consent.com/yes"} ).valueUri ) assert inst.agent[0].requestor is True 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.agent[0].who.identifier.value == "SomeIdiot@nowhere" assert inst.agent[1].network.address == "marketing.land" assert inst.agent[1].network.type == "1" assert inst.agent[1].purposeOfUse[0].coding[0].code == "HMARKT" assert inst.agent[1].purposeOfUse[0].coding[0].display == "healthcare marketing" assert ( inst.agent[1].purposeOfUse[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.agent[1].requestor is False assert inst.agent[1].type.coding[0].code == "110152" assert inst.agent[1].type.coding[0].display == "Destination Role ID" assert ( inst.agent[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.agent[1].who.display == "Where" assert inst.agent[1].who.reference == "Practitioner/example" assert inst.entity[0].role.code == "1" assert inst.entity[0].role.display == "Patient" assert ( inst.entity[0].role.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/object-role"} ).valueUri ) assert inst.entity[0].type.code == "1" assert inst.entity[0].type.display == "Person" assert ( inst.entity[0].type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-entity-type"} ).valueUri ) assert inst.entity[0].what.reference == "Patient/example" assert inst.entity[1].description == "data about Everthing important" assert inst.entity[1].lifecycle.code == "11" assert inst.entity[1].lifecycle.display == "Disclosure" assert ( inst.entity[1].lifecycle.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dicom-audit-lifecycle"} ).valueUri ) assert inst.entity[1].name == "Namne of What" assert inst.entity[1].role.code == "4" assert inst.entity[1].role.display == "Domain Resource" assert ( inst.entity[1].role.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/object-role"} ).valueUri ) assert inst.entity[1].securityLabel[0].code == "V" assert inst.entity[1].securityLabel[0].display == "very restricted" assert ( inst.entity[1].securityLabel[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-Confidentiality"} ).valueUri ) assert inst.entity[1].securityLabel[1].code == "STD" assert ( inst.entity[1].securityLabel[1].display == "sexually transmitted disease information sensitivity" ) assert ( inst.entity[1].securityLabel[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.entity[1].securityLabel[2].code == "DELAU" assert inst.entity[1].securityLabel[2].display == "delete after use" assert ( inst.entity[1].securityLabel[2].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.entity[1].type.code == "2" assert inst.entity[1].type.display == "System Object" assert ( inst.entity[1].type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-entity-type"} ).valueUri ) assert inst.entity[1].what.identifier.value == "What.id" assert inst.entity[1].what.reference == "Patient/example/_history/1" assert inst.id == "example-disclosure" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "0" assert inst.outcomeDesc == "Successful Disclosure" assert inst.purposeOfEvent[0].coding[0].code == "HMARKT" assert inst.purposeOfEvent[0].coding[0].display == "healthcare marketing" assert ( inst.purposeOfEvent[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2013-09-22T00:08:00Z"} ).valueInstant ) assert ( inst.source.observer.display == "Watchers Accounting of Disclosures Application" ) assert inst.source.site == "Watcher" assert inst.source.type[0].code == "4" assert inst.source.type[0].display == "Application Server" assert ( inst.source.type[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/security-source-type"} ).valueUri ) assert inst.subtype[0].code == "Disclosure" assert inst.subtype[0].display == "HIPAA disclosure" assert inst.text.div == ( '
Disclosure by ' "some idiot, for marketing reasons, to places unknown, of a " "Poor Sap, data about Everthing important.
" ) assert inst.text.status == "generated" assert inst.type.code == "110106" assert inst.type.display == "Export" assert ( inst.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) def test_auditevent_8(base_settings): """No. 8 tests collection for AuditEvent. Test File: auditevent-example-disclosure.json """ filename = base_settings["unittest_data_dir"] / "auditevent-example-disclosure.json" inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes()) assert "AuditEvent" == inst.get_resource_type() impl_auditevent_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AuditEvent" == data["resourceType"] inst2 = auditevent.AuditEvent(**data) impl_auditevent_8(inst2) def impl_auditevent_9(inst): assert inst.action == "C" 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 == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/extra-security-role-type" } ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert ( inst.agent[1].who.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.4.2"} ).valueUri ) assert inst.agent[1].who.identifier.value == "2.16.840.1.113883.4.2" assert inst.contained[0].id == "o1" assert inst.entity[0].detail[0].type == "requested transaction" assert inst.entity[0].detail[0].valueString == "http POST ....." assert inst.entity[0].type.code == "2" assert inst.entity[0].type.display == "System Object" assert ( inst.entity[0].type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-entity-type"} ).valueUri ) assert inst.entity[1].description == "transaction failed" assert inst.entity[1].type.code == "OperationOutcome" assert inst.entity[1].type.display == "OperationOutcome" assert ( inst.entity[1].type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/resource-types"} ).valueUri ) assert inst.entity[1].what.reference == "#o1" assert inst.id == "example-error" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "8" assert inst.outcomeDesc == ( "Invalid request to create an Operation resource on the " "Patient endpoint." ) assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2017-09-07T23:42:24Z"} ).valueInstant ) assert ( inst.source.observer.identifier.value == "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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/security-source-type"} ).valueUri ) assert inst.subtype[0].code == "create" assert inst.subtype[0].display == "create" assert ( inst.subtype[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert inst.text.status == "generated" assert inst.type.code == "rest" assert inst.type.display == "Restful Operation" assert ( inst.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-event-type"} ).valueUri ) def test_auditevent_9(base_settings): """No. 9 tests collection for AuditEvent. Test File: auditevent-example-error.json """ filename = base_settings["unittest_data_dir"] / "auditevent-example-error.json" inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes()) assert "AuditEvent" == inst.get_resource_type() impl_auditevent_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AuditEvent" == data["resourceType"] inst2 = auditevent.AuditEvent(**data) impl_auditevent_9(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_basic.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Basic Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import basic from .conftest import ExternalValidatorModel # noqa: F401 def impl_basic_1(inst): assert inst.code.coding[0].code == "UMLCLASSMODEL" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/do-not-use/fhir-codes#resourceTypes"} ).valueUri ) assert ( inst.extension[0].extension[0].url == ExternalValidatorModel.model_validate({"valueUri": "name"}).valueUri ) assert inst.extension[0].extension[0].valueString == "Class1" assert ( inst.extension[0].extension[1].extension[0].url == ExternalValidatorModel.model_validate({"valueUri": "name"}).valueUri ) assert inst.extension[0].extension[1].extension[0].valueString == "attribute1" assert ( inst.extension[0].extension[1].extension[1].url == ExternalValidatorModel.model_validate({"valueUri": "minOccurs"}).valueUri ) assert inst.extension[0].extension[1].extension[1].valueInteger == 1 assert ( inst.extension[0].extension[1].extension[2].url == ExternalValidatorModel.model_validate({"valueUri": "maxOccurs"}).valueUri ) assert inst.extension[0].extension[1].extension[2].valueCode == "*" assert ( inst.extension[0].extension[1].url == ExternalValidatorModel.model_validate({"valueUri": "attribute"}).valueUri ) assert ( inst.extension[0].extension[2].extension[0].url == ExternalValidatorModel.model_validate({"valueUri": "name"}).valueUri ) assert inst.extension[0].extension[2].extension[0].valueString == "attribute2" assert ( inst.extension[0].extension[2].extension[1].url == ExternalValidatorModel.model_validate({"valueUri": "minOccurs"}).valueUri ) assert inst.extension[0].extension[2].extension[1].valueInteger == 0 assert ( inst.extension[0].extension[2].extension[2].url == ExternalValidatorModel.model_validate({"valueUri": "maxOccurs"}).valueUri ) assert inst.extension[0].extension[2].extension[2].valueInteger == 1 assert ( inst.extension[0].extension[2].url == ExternalValidatorModel.model_validate({"valueUri": "attribute"}).valueUri ) assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/do-not-use/fhir-extensions/UMLclass"} ).valueUri ) assert inst.id == "classModel" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_basic_1(base_settings): """No. 1 tests collection for Basic. Test File: basic-example2.json """ filename = base_settings["unittest_data_dir"] / "basic-example2.json" inst = basic.Basic.model_validate_json(filename.read_bytes()) assert "Basic" == inst.get_resource_type() impl_basic_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Basic" == data["resourceType"] inst2 = basic.Basic(**data) impl_basic_1(inst2) def impl_basic_2(inst): assert inst.code.text == "Example Narrative Tester" assert inst.id == "basic-example-narrative" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "additional" def test_basic_2(base_settings): """No. 2 tests collection for Basic. Test File: basic-example-narrative.json """ filename = base_settings["unittest_data_dir"] / "basic-example-narrative.json" inst = basic.Basic.model_validate_json(filename.read_bytes()) assert "Basic" == inst.get_resource_type() impl_basic_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Basic" == data["resourceType"] inst2 = basic.Basic(**data) impl_basic_2(inst2) def impl_basic_3(inst): assert inst.author.reference == "Practitioner/example" assert inst.code.coding[0].code == "referral" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/basic-resource-type"} ).valueUri ) assert ( inst.created == ExternalValidatorModel.model_validate({"valueDate": "2013-05-14"}).valueDate ) assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/do-not-use/fhir-extensions/referral#requestingPractitioner" } ).valueUri ) assert inst.extension[0].valueReference.display == "Dokter Bronsig" assert inst.extension[0].valueReference.reference == "Practitioner/f201" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/do-not-use/fhir-extensions/referral#notes"} ).valueUri ) assert inst.extension[1].valueString == ( "The patient had fever peaks over the last couple of days. He" " is worried about these peaks." ) assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/do-not-use/fhir-extensions/referral#fulfillingEncounter" } ).valueUri ) assert inst.extension[2].valueReference.reference == "Encounter/f201" assert inst.id == "referral" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealth.org/basic/identifiers"} ).valueUri ) assert inst.identifier[0].value == "19283746" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.modifierExtension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/do-not-use/fhir-extensions/referral#referredForService" } ).valueUri ) assert inst.modifierExtension[0].valueCodeableConcept.coding[0].code == "11429006" assert ( inst.modifierExtension[0].valueCodeableConcept.coding[0].display == "Consultation" ) assert ( inst.modifierExtension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.modifierExtension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/do-not-use/fhir-extensions/referral#targetDate" } ).valueUri ) assert ( inst.modifierExtension[1].valuePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-04-15"} ).valueDateTime ) assert ( inst.modifierExtension[1].valuePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-04-01"} ).valueDateTime ) assert ( inst.modifierExtension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/do-not-use/fhir-extensions/referral#status" } ).valueUri ) assert inst.modifierExtension[2].valueCode == "complete" assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" def test_basic_3(base_settings): """No. 3 tests collection for Basic. Test File: basic-example.json """ filename = base_settings["unittest_data_dir"] / "basic-example.json" inst = basic.Basic.model_validate_json(filename.read_bytes()) assert "Basic" == inst.get_resource_type() impl_basic_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Basic" == data["resourceType"] inst2 = basic.Basic(**data) impl_basic_3(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_binary.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Binary Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import binary from .conftest import ExternalValidatorModel # noqa: F401 def impl_binary_1(inst): assert inst.contentType == "application/pdf" assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.securityContext.reference == "DocumentReference/example" def test_binary_1(base_settings): """No. 1 tests collection for Binary. Test File: binary-example.json """ filename = base_settings["unittest_data_dir"] / "binary-example.json" inst = binary.Binary.model_validate_json(filename.read_bytes()) assert "Binary" == inst.get_resource_type() impl_binary_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Binary" == data["resourceType"] inst2 = binary.Binary(**data) impl_binary_1(inst2) def impl_binary_2(inst): assert inst.contentType == "image/jpeg" assert inst.id == "f006" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) def test_binary_2(base_settings): """No. 2 tests collection for Binary. Test File: binary-f006.json """ filename = base_settings["unittest_data_dir"] / "binary-f006.json" inst = binary.Binary.model_validate_json(filename.read_bytes()) assert "Binary" == inst.get_resource_type() impl_binary_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Binary" == data["resourceType"] inst2 = binary.Binary(**data) impl_binary_2(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_biologicallyderivedproduct.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/BiologicallyDerivedProduct Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import biologicallyderivedproduct from .conftest import ExternalValidatorModel # noqa: F401 def impl_biologicallyderivedproduct_1(inst): assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" def test_biologicallyderivedproduct_1(base_settings): """No. 1 tests collection for BiologicallyDerivedProduct. Test File: biologicallyderivedproduct-example.json """ filename = ( base_settings["unittest_data_dir"] / "biologicallyderivedproduct-example.json" ) inst = biologicallyderivedproduct.BiologicallyDerivedProduct.model_validate_json( filename.read_bytes() ) assert "BiologicallyDerivedProduct" == inst.get_resource_type() impl_biologicallyderivedproduct_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "BiologicallyDerivedProduct" == data["resourceType"] inst2 = biologicallyderivedproduct.BiologicallyDerivedProduct(**data) impl_biologicallyderivedproduct_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_bodystructure.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/BodyStructure Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import bodystructure from .conftest import ExternalValidatorModel # noqa: F401 def impl_bodystructure_1(inst): assert inst.description == "EDD 1/1/2017 confirmation by LMP" assert inst.id == "fetus" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealth.org/bodystructure/identifiers"} ).valueUri ) assert inst.identifier[0].value == "12345" assert inst.location.coding[0].code == "83418008" assert inst.location.coding[0].display == "Entire fetus (body structure)" assert ( inst.location.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.location.text == "Fetus" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert inst.text.status == "generated" def test_bodystructure_1(base_settings): """No. 1 tests collection for BodyStructure. Test File: bodystructure-example-fetus.json """ filename = base_settings["unittest_data_dir"] / "bodystructure-example-fetus.json" inst = bodystructure.BodyStructure.model_validate_json(filename.read_bytes()) assert "BodyStructure" == inst.get_resource_type() impl_bodystructure_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "BodyStructure" == data["resourceType"] inst2 = bodystructure.BodyStructure(**data) impl_bodystructure_1(inst2) def impl_bodystructure_2(inst): assert inst.description == "7 cm maximum diameter" assert inst.id == "tumor" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealth.org/bodystructure/identifiers"} ).valueUri ) assert inst.identifier[0].value == "12345" assert inst.image[0].contentType == "application/dicom" assert ( inst.image[0].url == ExternalValidatorModel.model_validate( { "valueUrl": "http://imaging.acme.com/wado/server?requestType=WADO&wado_details" } ).valueUrl ) assert inst.location.coding[0].code == "78961009" assert inst.location.coding[0].display == "Splenic structure (body structure)" assert ( inst.location.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.location.text == "Spleen" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.morphology.coding[0].code == "4147007" assert inst.morphology.coding[0].display == "Mass (morphologic abnormality)" assert ( inst.morphology.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.morphology.text == "Splenic mass" assert inst.patient.reference == "Patient/example" assert inst.text.status == "generated" def test_bodystructure_2(base_settings): """No. 2 tests collection for BodyStructure. Test File: bodystructure-example-tumor.json """ filename = base_settings["unittest_data_dir"] / "bodystructure-example-tumor.json" inst = bodystructure.BodyStructure.model_validate_json(filename.read_bytes()) assert "BodyStructure" == inst.get_resource_type() impl_bodystructure_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "BodyStructure" == data["resourceType"] inst2 = bodystructure.BodyStructure(**data) impl_bodystructure_2(inst2) def impl_bodystructure_3(inst): assert inst.active is False assert inst.description == "inner surface (volar) of the left forearm" assert inst.id == "skin-patch" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealth.org/bodystructure/identifiers"} ).valueUri ) assert inst.identifier[0].value == "12345" assert inst.location.coding[0].code == "14975008" assert inst.location.coding[0].display == "Forearm" assert ( inst.location.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.location.text == "Forearm" assert inst.locationQualifier[0].coding[0].code == "419161000" assert inst.locationQualifier[0].coding[0].display == "Unilateral left" assert ( inst.locationQualifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.locationQualifier[0].text == "Left" assert inst.locationQualifier[1].coding[0].code == "263929005" assert inst.locationQualifier[1].coding[0].display == "Volar" assert ( inst.locationQualifier[1].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.locationQualifier[1].text == "Volar" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.morphology.text == "Skin patch" assert inst.patient.reference == "Patient/example" assert inst.text.status == "generated" def test_bodystructure_3(base_settings): """No. 3 tests collection for BodyStructure. Test File: bodystructure-example-skin-patch.json """ filename = ( base_settings["unittest_data_dir"] / "bodystructure-example-skin-patch.json" ) inst = bodystructure.BodyStructure.model_validate_json(filename.read_bytes()) assert "BodyStructure" == inst.get_resource_type() impl_bodystructure_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "BodyStructure" == data["resourceType"] inst2 = bodystructure.BodyStructure(**data) impl_bodystructure_3(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_bundle.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Bundle Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import bundle from .conftest import ExternalValidatorModel # noqa: F401 def impl_bundle_1(inst): assert ( inst.entry[0].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "urn:uuid:d195d9b8-6f78-4d71-9d22-3c1a923bfea5"} ).valueUri ) assert inst.entry[0].request.method == "GET" assert ( inst.entry[0].request.url == ExternalValidatorModel.model_validate( {"valueUri": "Subscription/123/$status"} ).valueUri ) assert inst.entry[0].resource.id == "d195d9b8-6f78-4d71-9d22-3c1a923bfea5" assert inst.entry[0].response.status == "200" assert ( inst.entry[1].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "https://example.org/FHIR/R4/Encounter/2"} ).valueUri ) assert inst.entry[1].request.method == "PUT" assert ( inst.entry[1].request.url == ExternalValidatorModel.model_validate({"valueUri": "Encounter/2"}).valueUri ) assert inst.entry[1].resource.id == "2" assert ( inst.entry[1].resource.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2019-08-07T10:49:22Z"} ).valueInstant ) assert inst.entry[1].resource.meta.versionId == "1" assert inst.entry[1].response.status == "201" assert inst.id == "00b99077-2bda-436e-98cc-a4f65d6c2fe0" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.timestamp == ExternalValidatorModel.model_validate( {"valueInstant": "2020-04-17T10:24:13.1882432-05:00"} ).valueInstant ) assert inst.type == "history" def test_bundle_1(base_settings): """No. 1 tests collection for Bundle. Test File: notification-full-resource.json """ filename = base_settings["unittest_data_dir"] / "notification-full-resource.json" inst = bundle.Bundle.model_validate_json(filename.read_bytes()) assert "Bundle" == inst.get_resource_type() impl_bundle_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Bundle" == data["resourceType"] inst2 = bundle.Bundle(**data) impl_bundle_1(inst2) def impl_bundle_2(inst): assert ( inst.entry[0].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "urn:uuid:2866af9c-137d-4458-a8a9-eeeec0ce5583"} ).valueUri ) assert inst.entry[0].resource.id == "warning" assert inst.entry[0].search.mode == "outcome" assert inst.id == "bundle-search-warning" assert inst.link[0].relation == "self" assert ( inst.link[0].url == ExternalValidatorModel.model_validate( { "valueUri": "https://example.org/fhir/Observation?patient.identifier=http://example.com/fhir/identifier/mrn|123456" } ).valueUri ) assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2017-03-14T08:23:30+11:00"} ).valueInstant ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.total == 0 assert inst.type == "searchset" def test_bundle_2(base_settings): """No. 2 tests collection for Bundle. Test File: bundle-search-warning.json """ filename = base_settings["unittest_data_dir"] / "bundle-search-warning.json" inst = bundle.Bundle.model_validate_json(filename.read_bytes()) assert "Bundle" == inst.get_resource_type() impl_bundle_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Bundle" == data["resourceType"] inst2 = bundle.Bundle(**data) impl_bundle_2(inst2) def impl_bundle_3(inst): assert ( inst.entry[0].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "urn:uuid:dd431176-7bcf-455e-8a0c-50cb15d6263f"} ).valueUri ) assert inst.entry[0].request.method == "GET" assert ( inst.entry[0].request.url == ExternalValidatorModel.model_validate( {"valueUri": "Subscription/123/$events"} ).valueUri ) assert inst.entry[0].resource.id == "dd431176-7bcf-455e-8a0c-50cb15d6263f" assert inst.entry[0].response.status == "200" assert ( inst.entry[1].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/FHIR/R4B/Encounter/1"} ).valueUri ) assert inst.entry[1].request.method == "PUT" assert ( inst.entry[1].request.url == ExternalValidatorModel.model_validate({"valueUri": "Encounter/1"}).valueUri ) assert inst.entry[1].response.status == "201" assert ( inst.entry[2].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/FHIR/R4B/Encounter/2"} ).valueUri ) assert inst.entry[2].request.method == "PUT" assert ( inst.entry[2].request.url == ExternalValidatorModel.model_validate({"valueUri": "Encounter/2"}).valueUri ) assert inst.entry[2].response.status == "201" assert inst.id == "155141d4-7601-46f7-a82b-b8443bcf9883" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.timestamp == ExternalValidatorModel.model_validate( {"valueInstant": "2020-04-17T10:24:13.1882432-05:00"} ).valueInstant ) assert inst.type == "history" def test_bundle_3(base_settings): """No. 3 tests collection for Bundle. Test File: notification-id-only-query.json """ filename = base_settings["unittest_data_dir"] / "notification-id-only-query.json" inst = bundle.Bundle.model_validate_json(filename.read_bytes()) assert "Bundle" == inst.get_resource_type() impl_bundle_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Bundle" == data["resourceType"] inst2 = bundle.Bundle(**data) impl_bundle_3(inst2) def impl_bundle_4(inst): assert ( inst.entry[0].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "https://example.com/base/DiagnosticReport/f202"} ).valueUri ) assert inst.entry[0].resource.id == "f202" assert ( inst.entry[1].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "https://example.com/base/ServiceRequest/req"} ).valueUri ) assert inst.entry[1].resource.id == "req" assert inst.id == "f202" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.type == "collection" def test_bundle_4(base_settings): """No. 4 tests collection for Bundle. Test File: diagnosticreport-example-f202-bloodculture.json """ filename = ( base_settings["unittest_data_dir"] / "diagnosticreport-example-f202-bloodculture.json" ) inst = bundle.Bundle.model_validate_json(filename.read_bytes()) assert "Bundle" == inst.get_resource_type() impl_bundle_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Bundle" == data["resourceType"] inst2 = bundle.Bundle(**data) impl_bundle_4(inst2) def impl_bundle_5(inst): assert ( inst.entry[0].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "urn:uuid:a5b053d4-2603-446f-ae86-f5853ac09334"} ).valueUri ) assert inst.entry[0].request.method == "GET" assert ( inst.entry[0].request.url == ExternalValidatorModel.model_validate( {"valueUri": "Subscription/123/$status"} ).valueUri ) assert inst.entry[0].resource.id == "a5b053d4-2603-446f-ae86-f5853ac09334" assert inst.entry[0].response.status == "200" assert inst.id == "3d20ea4b-90dc-4d0d-b15a-c7a893389401" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.timestamp == ExternalValidatorModel.model_validate( {"valueInstant": "2020-04-17T10:24:13.1882432-05:00"} ).valueInstant ) assert inst.type == "history" def test_bundle_5(base_settings): """No. 5 tests collection for Bundle. Test File: notification-heartbeat.json """ filename = base_settings["unittest_data_dir"] / "notification-heartbeat.json" inst = bundle.Bundle.model_validate_json(filename.read_bytes()) assert "Bundle" == inst.get_resource_type() impl_bundle_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Bundle" == data["resourceType"] inst2 = bundle.Bundle(**data) impl_bundle_5(inst2) def impl_bundle_6(inst): assert ( inst.entry[0].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "urn:uuid:d9d296d8-5afd-42e1-a0ce-3344e0e003ed"} ).valueUri ) assert inst.entry[0].resource.id == "caf609cf-c3a7-4be3-a3aa-356b9bb69d4f" assert ( inst.entry[1].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "urn:uuid:03f9aa7d-b395-47b9-84e0-053678b6e4e3"} ).valueUri ) assert inst.entry[1].resource.id == "03f9aa7d-b395-47b9-84e0-053678b6e4e3" assert ( inst.entry[2].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/ehr/fhir/Patient/pat1"} ).valueUri ) assert inst.entry[2].resource.id == "pat1" assert ( inst.entry[3].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/ehr/fhir/Patient/pat12"} ).valueUri ) assert inst.entry[3].resource.id == "pat2" assert inst.id == "3a0707d3-549e-4467-b8b8-5a2ab3800efe" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.timestamp == ExternalValidatorModel.model_validate( {"valueInstant": "2015-07-14T11:15:33+10:00"} ).valueInstant ) assert inst.type == "message" def test_bundle_6(base_settings): """No. 6 tests collection for Bundle. Test File: message-response-link.json """ filename = base_settings["unittest_data_dir"] / "message-response-link.json" inst = bundle.Bundle.model_validate_json(filename.read_bytes()) assert "Bundle" == inst.get_resource_type() impl_bundle_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Bundle" == data["resourceType"] inst2 = bundle.Bundle(**data) impl_bundle_6(inst2) def impl_bundle_7(inst): assert ( inst.entry[0].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "urn:uuid:3fdc72f4-a11d-4a9d-9260-a9f745779e1d"} ).valueUri ) assert inst.entry[0].request.method == "POST" assert ( inst.entry[0].request.url == ExternalValidatorModel.model_validate( {"valueUri": "DocumentReference"} ).valueUri ) assert ( inst.entry[0].resource.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2013-07-01T13:11:33Z"} ).valueInstant ) assert ( inst.entry[1].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://localhost:9556/svc/fhir/Patient/a2"} ).valueUri ) assert ( inst.entry[1].request.ifNoneExist == "Patient?identifier=http://acme.org/xds/patients!89765a87b" ) assert inst.entry[1].request.method == "POST" assert ( inst.entry[1].request.url == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.entry[1].resource.id == "a2" assert ( inst.entry[1].resource.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2013-07-01T13:11:33Z"} ).valueInstant ) assert ( inst.entry[2].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://localhost:9556/svc/fhir/Practitioner/a3"} ).valueUri ) assert inst.entry[2].request.method == "POST" assert ( inst.entry[2].request.url == ExternalValidatorModel.model_validate({"valueUri": "Practitioner"}).valueUri ) assert inst.entry[2].resource.id == "a3" assert ( inst.entry[2].resource.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2013-07-01T13:11:33Z"} ).valueInstant ) assert ( inst.entry[3].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://localhost:9556/svc/fhir/Practitioner/a4"} ).valueUri ) assert inst.entry[3].request.method == "POST" assert ( inst.entry[3].request.url == ExternalValidatorModel.model_validate({"valueUri": "Practitioner"}).valueUri ) assert inst.entry[3].resource.id == "a4" assert ( inst.entry[3].resource.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2013-07-01T13:11:33Z"} ).valueInstant ) assert ( inst.entry[4].fullUrl == ExternalValidatorModel.model_validate( { "valueUri": "http://localhost:9556/svc/fhir/Binary/1e404af3-077f-4bee-b7a6-a9be97e1ce32" } ).valueUri ) assert inst.entry[4].request.method == "POST" assert ( inst.entry[4].request.url == ExternalValidatorModel.model_validate({"valueUri": "Binary"}).valueUri ) assert inst.entry[4].resource.id == "1e404af3-077f-4bee-b7a6-a9be97e1ce32" assert ( inst.entry[4].resource.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2013-07-01T13:11:33Z"} ).valueInstant ) assert inst.id == "xds" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2013-07-01T13:11:33Z"} ).valueInstant ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.type == "transaction" def test_bundle_7(base_settings): """No. 7 tests collection for Bundle. Test File: xds-example.json """ filename = base_settings["unittest_data_dir"] / "xds-example.json" inst = bundle.Bundle.model_validate_json(filename.read_bytes()) assert "Bundle" == inst.get_resource_type() impl_bundle_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Bundle" == data["resourceType"] inst2 = bundle.Bundle(**data) impl_bundle_7(inst2) def impl_bundle_8(inst): assert ( inst.entry[0].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/DomainResource-text"} ).valueUri ) assert inst.entry[0].resource.id == "DomainResource-text" assert ( inst.entry[1].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-content"} ).valueUri ) assert inst.entry[1].resource.id == "Resource-content" assert ( inst.entry[2].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-filter"} ).valueUri ) assert inst.entry[2].resource.id == "Resource-filter" assert ( inst.entry[3].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-has"} ).valueUri ) assert inst.entry[3].resource.id == "Resource-has" assert ( inst.entry[4].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-id"} ).valueUri ) assert inst.entry[4].resource.id == "Resource-id" assert ( inst.entry[5].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-lastUpdated"} ).valueUri ) assert inst.entry[5].resource.id == "Resource-lastUpdated" assert ( inst.entry[6].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-list"} ).valueUri ) assert inst.entry[6].resource.id == "Resource-list" assert ( inst.entry[7].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-profile"} ).valueUri ) assert inst.entry[7].resource.id == "Resource-profile" assert ( inst.entry[8].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-query"} ).valueUri ) assert inst.entry[8].resource.id == "Resource-query" assert ( inst.entry[9].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-security"} ).valueUri ) assert inst.entry[9].resource.id == "Resource-security" assert inst.id == "searchParams" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2022-05-28T12:47:40.239+10:00"} ).valueInstant ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.type == "collection" def test_bundle_8(base_settings): """No. 8 tests collection for Bundle. Test File: search-parameters.json """ filename = base_settings["unittest_data_dir"] / "search-parameters.json" inst = bundle.Bundle.model_validate_json(filename.read_bytes()) assert "Bundle" == inst.get_resource_type() impl_bundle_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Bundle" == data["resourceType"] inst2 = bundle.Bundle(**data) impl_bundle_8(inst2) def impl_bundle_9(inst): assert ( inst.entry[0].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "urn:uuid:267b18ce-3d37-4581-9baa-6fada338038b"} ).valueUri ) assert inst.entry[0].resource.id == "267b18ce-3d37-4581-9baa-6fada338038b" assert ( inst.entry[1].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/ehr/fhir/Patient/pat1"} ).valueUri ) assert inst.entry[1].resource.id == "pat1" assert ( inst.entry[2].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/ehr/fhir/Patient/pat12"} ).valueUri ) assert inst.entry[2].resource.id == "pat2" assert inst.id == "10bb101f-a121-4264-a920-67be9cb82c74" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.timestamp == ExternalValidatorModel.model_validate( {"valueInstant": "2015-07-14T11:15:33+10:00"} ).valueInstant ) assert inst.type == "message" def test_bundle_9(base_settings): """No. 9 tests collection for Bundle. Test File: message-request-link.json """ filename = base_settings["unittest_data_dir"] / "message-request-link.json" inst = bundle.Bundle.model_validate_json(filename.read_bytes()) assert "Bundle" == inst.get_resource_type() impl_bundle_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Bundle" == data["resourceType"] inst2 = bundle.Bundle(**data) impl_bundle_9(inst2) def impl_bundle_10(inst): assert ( inst.entry[0].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/tx-sct"} ).valueUri ) assert inst.entry[0].resource.id == "tx-sct" assert ( inst.entry[1].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/tx-rxnorm"} ).valueUri ) assert inst.entry[1].resource.id == "tx-rxnorm" assert ( inst.entry[2].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/tx-loinc"} ).valueUri ) assert inst.entry[2].resource.id == "tx-loinc" assert ( inst.entry[3].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/tx-ucum"} ).valueUri ) assert inst.entry[3].resource.id == "tx-ucum" assert ( inst.entry[4].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/tx-nci"} ).valueUri ) assert inst.entry[4].resource.id == "tx-nci" assert ( inst.entry[5].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/tx-cpt"} ).valueUri ) assert inst.entry[5].resource.id == "tx-cpt" assert ( inst.entry[6].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/tx-ndf-rt"} ).valueUri ) assert inst.entry[6].resource.id == "tx-ndf-rt" assert ( inst.entry[7].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/tx-unii"} ).valueUri ) assert inst.entry[7].resource.id == "tx-unii" assert ( inst.entry[8].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/tx-ndc"} ).valueUri ) assert inst.entry[8].resource.id == "tx-ndc" assert ( inst.entry[9].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/tx-cvx"} ).valueUri ) assert inst.entry[9].resource.id == "tx-cvx" assert inst.id == "terminologies" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.type == "collection" def test_bundle_10(base_settings): """No. 10 tests collection for Bundle. Test File: namingsystem-terminologies.json """ filename = base_settings["unittest_data_dir"] / "namingsystem-terminologies.json" inst = bundle.Bundle.model_validate_json(filename.read_bytes()) assert "Bundle" == inst.get_resource_type() impl_bundle_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Bundle" == data["resourceType"] inst2 = bundle.Bundle(**data) impl_bundle_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_capabilitystatement.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/CapabilityStatement Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import capabilitystatement from .conftest import ExternalValidatorModel # noqa: F401 def impl_capabilitystatement_1(inst): assert inst.contact[0].name == "System Administrator" assert inst.contact[0].telecom[0].system == "email" assert inst.contact[0].telecom[0].value == "wile@acme.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-01-04"} ).valueDateTime ) assert inst.description == ( "Sample capability statement showing new MessageDefinition " "structure" ) assert inst.experimental is True assert inst.fhirVersion == "4.3.0" assert inst.format[0] == "xml" assert inst.format[1] == "json" assert inst.id == "messagedefinition" assert inst.implementation.description == "Acme Message endpoint" assert ( inst.implementation.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://acem.com/fhir/message-drop"} ).valueUrl ) assert inst.kind == "instance" assert ( inst.messaging[0].documentation == "ADT A08 equivalent for external system notifications" ) assert ( inst.messaging[0].endpoint[0].address == ExternalValidatorModel.model_validate( {"valueUrl": "mllp:10.1.1.10:9234"} ).valueUrl ) assert inst.messaging[0].endpoint[0].protocol.code == "mllp" assert ( inst.messaging[0].endpoint[0].protocol.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/message-transport"} ).valueUri ) assert inst.messaging[0].reliableCache == 30 assert ( inst.messaging[0].supportedMessage[0].definition == "http://hl7.org/fhir/MessageDefinition/example" ) assert inst.messaging[0].supportedMessage[0].mode == "receiver" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.publisher == "ACME Corporation" assert inst.software.name == "EHR" assert inst.status == "draft" def test_capabilitystatement_1(base_settings): """No. 1 tests collection for CapabilityStatement. Test File: capabilitystatement-messagedefinition.json """ filename = ( base_settings["unittest_data_dir"] / "capabilitystatement-messagedefinition.json" ) inst = capabilitystatement.CapabilityStatement.model_validate_json( filename.read_bytes() ) assert "CapabilityStatement" == inst.get_resource_type() impl_capabilitystatement_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CapabilityStatement" == data["resourceType"] inst2 = capabilitystatement.CapabilityStatement(**data) impl_capabilitystatement_1(inst2) def impl_capabilitystatement_2(inst): assert inst.contact[0].name == "System Administrator" assert inst.contact[0].telecom[0].system == "email" assert inst.contact[0].telecom[0].value == "wile@acme.org" assert inst.copyright == "Copyright © Acme Healthcare and GoodCorp EHR Systems" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-01-04"} ).valueDateTime ) assert inst.description == ( "This is the FHIR capability statement for the main EHR at " "ACME for the private interface - it does not describe the " "public interface" ) assert ( inst.document[0].documentation == "Basic rules for all documents in the EHR system" ) assert inst.document[0].mode == "consumer" assert inst.document[0].profile == ( "http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-" "838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796" ) assert inst.experimental is True assert inst.fhirVersion == "4.3.0" assert inst.format[0] == "xml" assert inst.format[1] == "json" assert inst.id == "example" assert inst.implementation.description == "main EHR at ACME" assert ( inst.implementation.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://10.2.3.4/fhir"} ).valueUrl ) assert inst.implementationGuide[0] == "http://hl7.org/fhir/us/lab" assert inst.instantiates[0] == "http://ihe.org/fhir/CapabilityStatement/pixm-client" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America (the)" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.kind == "instance" assert ( inst.messaging[0].documentation == "ADT A08 equivalent for external system notifications" ) assert ( inst.messaging[0].endpoint[0].address == ExternalValidatorModel.model_validate( {"valueUrl": "mllp:10.1.1.10:9234"} ).valueUrl ) assert inst.messaging[0].endpoint[0].protocol.code == "mllp" assert ( inst.messaging[0].endpoint[0].protocol.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/message-transport"} ).valueUri ) assert inst.messaging[0].reliableCache == 30 assert ( inst.messaging[0].supportedMessage[0].definition == "http://hl7.org/fhir/MessageDefinition/example" ) assert inst.messaging[0].supportedMessage[0].mode == "receiver" assert inst.name == "ACME-EHR" assert inst.patchFormat[0] == "application/xml-patch+xml" assert inst.patchFormat[1] == "application/json-patch+json" assert inst.publisher == "ACME Corporation" assert inst.purpose == ( "Main EHR capability statement, published for contracting and" " operational support" ) assert ( inst.rest[0].compartment[0] == "http://hl7.org/fhir/CompartmentDefinition/patient" ) assert inst.rest[0].documentation == "Main FHIR endpoint for acem health" assert inst.rest[0].interaction[0].code == "transaction" assert inst.rest[0].interaction[1].code == "history-system" assert inst.rest[0].mode == "server" assert inst.rest[0].resource[0].conditionalCreate is True assert inst.rest[0].resource[0].conditionalDelete == "not-supported" assert inst.rest[0].resource[0].conditionalRead == "full-support" assert inst.rest[0].resource[0].conditionalUpdate is False assert ( inst.rest[0].resource[0].documentation == "This server does not let the clients create identities." ) assert inst.rest[0].resource[0].interaction[0].code == "read" assert inst.rest[0].resource[0].interaction[1].code == "vread" assert ( inst.rest[0].resource[0].interaction[1].documentation == "Only supported for patient records since 12-Dec 2012" ) assert inst.rest[0].resource[0].interaction[2].code == "update" assert inst.rest[0].resource[0].interaction[3].code == "history-instance" assert inst.rest[0].resource[0].interaction[4].code == "create" assert inst.rest[0].resource[0].interaction[5].code == "history-type" assert inst.rest[0].resource[0].profile == ( "http://registry.fhir.org/r4/StructureDefinition/7896271d-" "57f6-4231-89dc-dcc91eab2416" ) assert inst.rest[0].resource[0].readHistory is True assert inst.rest[0].resource[0].searchInclude[0] == "Organization" assert ( inst.rest[0].resource[0].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/Patient-identifier" ) assert ( inst.rest[0].resource[0].searchParam[0].documentation == "Only supports search by institution MRN" ) assert inst.rest[0].resource[0].searchParam[0].name == "identifier" assert inst.rest[0].resource[0].searchParam[0].type == "token" assert inst.rest[0].resource[0].searchParam[1].definition == ( "http://hl7.org/fhir/SearchParameter/Patient-general-" "practitioner" ) assert inst.rest[0].resource[0].searchParam[1].name == "general-practitioner" assert inst.rest[0].resource[0].searchParam[1].type == "reference" assert inst.rest[0].resource[0].searchRevInclude[0] == "Person" assert inst.rest[0].resource[0].supportedProfile[0] == ( "http://registry.fhir.org/r4/StructureDefinition/00ab9e7a-" "06c7-4f77-9234-4154ca1e3347" ) assert inst.rest[0].resource[0].type == "Patient" assert inst.rest[0].resource[0].updateCreate is False assert inst.rest[0].resource[0].versioning == "versioned-update" assert inst.rest[0].security.cors is True assert inst.rest[0].security.description == "See Smart on FHIR documentation" assert inst.rest[0].security.service[0].coding[0].code == "SMART-on-FHIR" assert ( inst.rest[0].security.service[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/restful-security-service" } ).valueUri ) assert inst.software.name == "EHR" assert ( inst.software.releaseDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-01-04"} ).valueDateTime ) assert inst.software.version == "0.00.020.2134" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "ACME EHR capability statement" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "urn:uuid:68d043b5-9ecf-4559-a57a-396e0d452311"} ).valueUri ) assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "positive" assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variant-state"} ).valueUri ) assert inst.version == "20130510" def test_capabilitystatement_2(base_settings): """No. 2 tests collection for CapabilityStatement. Test File: capabilitystatement-example.json """ filename = base_settings["unittest_data_dir"] / "capabilitystatement-example.json" inst = capabilitystatement.CapabilityStatement.model_validate_json( filename.read_bytes() ) assert "CapabilityStatement" == inst.get_resource_type() impl_capabilitystatement_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CapabilityStatement" == data["resourceType"] inst2 = capabilitystatement.CapabilityStatement(**data) impl_capabilitystatement_2(inst2) def impl_capabilitystatement_3(inst): assert inst.contact[0].name == "FHIR Project" assert inst.contact[0].telecom[0].system == "other" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-09-16"} ).valueDateTime ) assert inst.description == ( "Basic conformance statement for a Measure Processor Service." " A server can support more functionality than defined " "here, but this is the minimum amount" ) assert inst.experimental is True assert inst.fhirVersion == "4.3.0" assert inst.format[0] == "json" assert inst.format[1] == "xml" assert inst.id == "measure-processor" assert inst.kind == "capability" assert inst.name == "Measure Processor Service Conformance Statement" assert inst.publisher == "HL7, Inc" assert inst.rest[0].documentation == "RESTful Measure Processor Service" assert inst.rest[0].mode == "server" assert inst.rest[0].operation[0].definition == ( "http://hl7.org/fhir/OperationDefinition/Measure-evaluate-" "measure" ) assert inst.rest[0].operation[0].name == "evaluate-measure" assert inst.rest[0].operation[1].definition == ( "http://hl7.org/fhir/OperationDefinition/Measure-data-" "requirements" ) assert inst.rest[0].operation[1].name == "data-requirements" assert inst.rest[0].resource[0].interaction[0].code == "read" assert inst.rest[0].resource[0].interaction[0].documentation == ( "Read allows clients to get the logical definitions of the " "measures" ) assert inst.rest[0].resource[0].interaction[1].code == "search-type" assert inst.rest[0].resource[0].interaction[1].documentation == ( "Search allows clients to filter measures based on a provided" " search parameter" ) assert ( inst.rest[0].resource[0].profile == "http://hl7.org/fhir/StructureDefinition/Measure" ) assert ( inst.rest[0].resource[0].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/Measure-identifier" ) assert inst.rest[0].resource[0].searchParam[0].name == "identifier" assert inst.rest[0].resource[0].searchParam[0].type == "token" assert ( inst.rest[0].resource[0].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/Measure-status" ) assert inst.rest[0].resource[0].searchParam[1].name == "status" assert inst.rest[0].resource[0].searchParam[1].type == "token" assert ( inst.rest[0].resource[0].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/Measure-version" ) assert inst.rest[0].resource[0].searchParam[2].name == "version" assert inst.rest[0].resource[0].searchParam[2].type == "token" assert inst.rest[0].resource[0].type == "Measure" assert inst.rest[0].security.cors is True assert inst.rest[0].security.service[0].coding[0].code == "Certificates" assert ( inst.rest[0].security.service[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/restful-security-service" } ).valueUri ) assert inst.software.name == "ACME Measure Processor Service" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/measure-processor"} ).valueUri ) def test_capabilitystatement_3(base_settings): """No. 3 tests collection for CapabilityStatement. Test File: capabilitystatement-measure-processor.json """ filename = ( base_settings["unittest_data_dir"] / "capabilitystatement-measure-processor.json" ) inst = capabilitystatement.CapabilityStatement.model_validate_json( filename.read_bytes() ) assert "CapabilityStatement" == inst.get_resource_type() impl_capabilitystatement_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CapabilityStatement" == data["resourceType"] inst2 = capabilitystatement.CapabilityStatement(**data) impl_capabilitystatement_3(inst2) def impl_capabilitystatement_4(inst): assert inst.contact[0].name == "FHIR Project" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-07-05"} ).valueDateTime ) assert inst.description == ( "Basic capability statement for a Terminology Server. A " "server can support more fucntionality than defined here, but" " this is the minimum amount" ) assert inst.experimental is True assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-supported-system" } ).valueUri ) assert ( inst.extension[0].valueUri == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.fhirVersion == "4.3.0" assert inst.format[0] == "json" assert inst.format[1] == "xml" assert inst.id == "terminology-server" assert inst.kind == "capability" assert inst.name == "Terminology Service Capability Statement" assert inst.publisher == "HL7, Inc" assert inst.rest[0].documentation == "RESTful Terminology Server" assert inst.rest[0].mode == "server" assert ( inst.rest[0].operation[0].definition == "http://hl7.org/fhir/OperationDefinition/ValueSet-expand" ) assert ( inst.rest[0].operation[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation" } ).valueUri ) assert inst.rest[0].operation[0].extension[0].valueCode == "SHALL" assert inst.rest[0].operation[0].name == "expand" assert ( inst.rest[0].operation[1].definition == "http://hl7.org/fhir/OperationDefinition/CodeSystem-lookup" ) assert ( inst.rest[0].operation[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation" } ).valueUri ) assert inst.rest[0].operation[1].extension[0].valueCode == "SHALL" assert inst.rest[0].operation[1].name == "lookup" assert inst.rest[0].operation[2].definition == ( "http://hl7.org/fhir/OperationDefinition/ValueSet-validate-" "code" ) assert ( inst.rest[0].operation[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation" } ).valueUri ) assert inst.rest[0].operation[2].extension[0].valueCode == "SHALL" assert inst.rest[0].operation[2].name == "validate-code" assert ( inst.rest[0].operation[3].definition == "http://hl7.org/fhir/OperationDefinition/ConceptMap-translate" ) assert ( inst.rest[0].operation[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation" } ).valueUri ) assert inst.rest[0].operation[3].extension[0].valueCode == "SHALL" assert inst.rest[0].operation[3].name == "translate" assert ( inst.rest[0].operation[4].definition == "http://hl7.org/fhir/OperationDefinition/ConceptMap-closure" ) assert ( inst.rest[0].operation[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation" } ).valueUri ) assert inst.rest[0].operation[4].extension[0].valueCode == "SHOULD" assert inst.rest[0].operation[4].name == "closure" assert inst.rest[0].resource[0].interaction[0].code == "read" assert inst.rest[0].resource[0].interaction[0].documentation == ( "Read allows clients to get the logical definitions of the " "value sets" ) assert ( inst.rest[0].resource[0].interaction[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation" } ).valueUri ) assert inst.rest[0].resource[0].interaction[0].extension[0].valueCode == "SHALL" assert inst.rest[0].resource[0].interaction[1].code == "search-type" assert ( inst.rest[0].resource[0].interaction[1].documentation == "Search allows clients to find value sets on the server" ) assert ( inst.rest[0].resource[0].interaction[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation" } ).valueUri ) assert inst.rest[0].resource[0].interaction[1].extension[0].valueCode == "SHALL" assert ( inst.rest[0].resource[0].profile == "http://hl7.org/fhir/StructureDefinition/ValueSet" ) assert ( inst.rest[0].resource[0].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/ValueSet-date" ) assert inst.rest[0].resource[0].searchParam[0].name == "date" assert inst.rest[0].resource[0].searchParam[0].type == "date" assert ( inst.rest[0].resource[0].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/ValueSet-name" ) assert inst.rest[0].resource[0].searchParam[1].name == "name" assert inst.rest[0].resource[0].searchParam[1].type == "string" assert ( inst.rest[0].resource[0].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/ValueSet-reference" ) assert inst.rest[0].resource[0].searchParam[2].name == "reference" assert inst.rest[0].resource[0].searchParam[2].type == "uri" assert ( inst.rest[0].resource[0].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/ValueSet-status" ) assert inst.rest[0].resource[0].searchParam[3].name == "status" assert inst.rest[0].resource[0].searchParam[3].type == "token" assert ( inst.rest[0].resource[0].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/ValueSet-url" ) assert inst.rest[0].resource[0].searchParam[4].name == "url" assert inst.rest[0].resource[0].searchParam[4].type == "uri" assert ( inst.rest[0].resource[0].searchParam[5].definition == "http://hl7.org/fhir/SearchParameter/ValueSet-version" ) assert inst.rest[0].resource[0].searchParam[5].name == "version" assert inst.rest[0].resource[0].searchParam[5].type == "token" assert inst.rest[0].resource[0].type == "ValueSet" assert inst.rest[0].resource[1].interaction[0].code == "read" assert inst.rest[0].resource[1].interaction[0].documentation == ( "Read allows clients to get the logical definitions of the " "concept maps" ) assert ( inst.rest[0].resource[1].interaction[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation" } ).valueUri ) assert inst.rest[0].resource[1].interaction[0].extension[0].valueCode == "SHALL" assert inst.rest[0].resource[1].interaction[1].code == "search-type" assert ( inst.rest[0].resource[1].interaction[1].documentation == "Search allows clients to find concept maps on the server" ) assert ( inst.rest[0].resource[1].interaction[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation" } ).valueUri ) assert inst.rest[0].resource[1].interaction[1].extension[0].valueCode == "SHALL" assert ( inst.rest[0].resource[1].profile == "http://hl7.org/fhir/StructureDefinition/ConceptMap" ) assert ( inst.rest[0].resource[1].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/ConceptMap-date" ) assert inst.rest[0].resource[1].searchParam[0].name == "date" assert inst.rest[0].resource[1].searchParam[0].type == "date" assert ( inst.rest[0].resource[1].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/ConceptMap-name" ) assert inst.rest[0].resource[1].searchParam[1].name == "name" assert inst.rest[0].resource[1].searchParam[1].type == "string" assert ( inst.rest[0].resource[1].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/ConceptMap-status" ) assert inst.rest[0].resource[1].searchParam[2].name == "status" assert inst.rest[0].resource[1].searchParam[2].type == "token" assert ( inst.rest[0].resource[1].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/ConceptMap-source" ) assert inst.rest[0].resource[1].searchParam[3].name == "source" assert inst.rest[0].resource[1].searchParam[3].type == "reference" assert ( inst.rest[0].resource[1].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/ConceptMap-target" ) assert inst.rest[0].resource[1].searchParam[4].name == "target" assert inst.rest[0].resource[1].searchParam[4].type == "reference" assert ( inst.rest[0].resource[1].searchParam[5].definition == "http://hl7.org/fhir/SearchParameter/ConceptMap-url" ) assert inst.rest[0].resource[1].searchParam[5].name == "url" assert inst.rest[0].resource[1].searchParam[5].type == "uri" assert ( inst.rest[0].resource[1].searchParam[6].definition == "http://hl7.org/fhir/SearchParameter/ConceptMap-version" ) assert inst.rest[0].resource[1].searchParam[6].name == "version" assert inst.rest[0].resource[1].searchParam[6].type == "token" assert inst.rest[0].resource[1].type == "ConceptMap" assert inst.rest[0].security.cors is True assert inst.rest[0].security.service[0].coding[0].code == "Certificates" assert ( inst.rest[0].security.service[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/restful-security-service" } ).valueUri ) assert inst.software.name == "ACME Terminology Server" assert inst.status == "draft" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/terminology-server"} ).valueUri ) def test_capabilitystatement_4(base_settings): """No. 4 tests collection for CapabilityStatement. Test File: capabilitystatement-terminology-server.json """ filename = ( base_settings["unittest_data_dir"] / "capabilitystatement-terminology-server.json" ) inst = capabilitystatement.CapabilityStatement.model_validate_json( filename.read_bytes() ) assert "CapabilityStatement" == inst.get_resource_type() impl_capabilitystatement_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CapabilityStatement" == data["resourceType"] inst2 = capabilitystatement.CapabilityStatement(**data) impl_capabilitystatement_4(inst2) def impl_capabilitystatement_5(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.experimental is True assert inst.fhirVersion == "4.3.0" assert inst.format[0] == "xml" assert inst.format[1] == "json" assert inst.id == "base2" assert inst.kind == "capability" assert inst.name == "Base FHIR Capability Statement (Empty)" assert inst.publisher == "FHIR Project Team" assert inst.rest[0].documentation == "An empty Capability Statement" assert inst.rest[0].mode == "server" assert inst.rest[0].security.cors is True assert inst.rest[0].security.description == ( "This is the Capability Statement to declare that the server " "supports SMART-on-FHIR. See the SMART-on-FHIR docs for the " "extension that would go with such a server" ) assert inst.rest[0].security.service[0].coding[0].code == "SMART-on-FHIR" assert inst.rest[0].security.service[0].coding[0].display == "SMART-on-FHIR" assert ( inst.rest[0].security.service[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/restful-security-service" } ).valueUri ) assert inst.rest[0].security.service[0].text == "See http://docs.smarthealthit.org/" assert inst.software.name == "Insert your software name here..." assert inst.status == "draft" assert inst.text.status == "extensions" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CapabilityStatement/base2"} ).valueUri ) assert inst.version == "4.3.0" def test_capabilitystatement_5(base_settings): """No. 5 tests collection for CapabilityStatement. Test File: capabilitystatement-base2.json """ filename = base_settings["unittest_data_dir"] / "capabilitystatement-base2.json" inst = capabilitystatement.CapabilityStatement.model_validate_json( filename.read_bytes() ) assert "CapabilityStatement" == inst.get_resource_type() impl_capabilitystatement_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CapabilityStatement" == data["resourceType"] inst2 = capabilitystatement.CapabilityStatement(**data) impl_capabilitystatement_5(inst2) def impl_capabilitystatement_6(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-06-18"} ).valueDateTime ) assert inst.description == ( "Prototype Capability Statement for September 2013 " "Connectathon" ) assert inst.experimental is True assert inst.fhirVersion == "4.3.0" assert inst.format[0] == "json" assert inst.format[1] == "xml" assert inst.id == "phr" assert inst.kind == "capability" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "PHR Template" assert inst.publisher == "FHIR Project" assert inst.rest[0].documentation == ( "Protoype server Capability Statement for September 2013 " "Connectathon" ) assert inst.rest[0].mode == "server" assert inst.rest[0].resource[0].interaction[0].code == "read" assert inst.rest[0].resource[0].interaction[1].code == "search-type" assert inst.rest[0].resource[0].interaction[1].documentation == ( "When a client searches patients with no search criteria, " "they get a list of all patients they have access too. " "Servers may elect to offer additional search parameters, but" " this is not required" ) assert inst.rest[0].resource[0].type == "Patient" assert inst.rest[0].resource[1].interaction[0].code == "read" assert inst.rest[0].resource[1].interaction[1].code == "search-type" assert inst.rest[0].resource[1].searchParam[0].documentation == ( "_id parameter always supported. For the connectathon, " "servers may elect which search parameters are supported" ) assert inst.rest[0].resource[1].searchParam[0].name == "_id" assert inst.rest[0].resource[1].searchParam[0].type == "token" assert inst.rest[0].resource[1].type == "DocumentReference" assert inst.rest[0].resource[2].interaction[0].code == "read" assert inst.rest[0].resource[2].interaction[1].code == "search-type" assert ( inst.rest[0].resource[2].searchParam[0].documentation == "Standard _id parameter" ) assert inst.rest[0].resource[2].searchParam[0].name == "_id" assert inst.rest[0].resource[2].searchParam[0].type == "token" assert inst.rest[0].resource[2].type == "Condition" assert inst.rest[0].resource[3].interaction[0].code == "read" assert inst.rest[0].resource[3].interaction[1].code == "search-type" assert ( inst.rest[0].resource[3].searchParam[0].documentation == "Standard _id parameter" ) assert inst.rest[0].resource[3].searchParam[0].name == "_id" assert inst.rest[0].resource[3].searchParam[0].type == "token" assert ( inst.rest[0].resource[3].searchParam[1].documentation == "which diagnostic discipline/department created the report" ) assert inst.rest[0].resource[3].searchParam[1].name == "service" assert inst.rest[0].resource[3].searchParam[1].type == "token" assert inst.rest[0].resource[3].type == "DiagnosticReport" assert inst.rest[0].security.service[0].text == "OAuth" assert inst.software.name == "ACME PHR Server" assert inst.status == "draft" assert inst.text.status == "generated" def test_capabilitystatement_6(base_settings): """No. 6 tests collection for CapabilityStatement. Test File: capabilitystatement-phr-example.json """ filename = ( base_settings["unittest_data_dir"] / "capabilitystatement-phr-example.json" ) inst = capabilitystatement.CapabilityStatement.model_validate_json( filename.read_bytes() ) assert "CapabilityStatement" == inst.get_resource_type() impl_capabilitystatement_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CapabilityStatement" == data["resourceType"] inst2 = capabilitystatement.CapabilityStatement(**data) impl_capabilitystatement_6(inst2) def impl_capabilitystatement_7(inst): assert inst.contact[0].name == "FHIR Project" assert inst.contact[0].telecom[0].system == "other" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-25"} ).valueDateTime ) assert inst.description == ( "Basic conformance statement for a Knowledge Repository " "Service. A server can support more functionality than " "defined here, but this is the minimum amount" ) assert inst.experimental is True assert inst.fhirVersion == "4.3.0" assert inst.format[0] == "json" assert inst.format[1] == "xml" assert inst.id == "knowledge-repository" assert inst.kind == "capability" assert inst.name == "Knowledge Repository Service Conformance Statement" assert inst.publisher == "HL7, Inc" assert inst.rest[0].documentation == "RESTful Knowledge Repository Service" assert inst.rest[0].mode == "server" assert inst.rest[0].operation[0].definition == ( "http://hl7.org/fhir/OperationDefinition/Library-data-" "requirements" ) assert inst.rest[0].operation[0].name == "data-requirements" assert inst.rest[0].resource[0].interaction[0].code == "read" assert inst.rest[0].resource[0].interaction[0].documentation == ( "Read allows clients to get the logical definitions of the " "libraries" ) assert inst.rest[0].resource[0].interaction[1].code == "search-type" assert inst.rest[0].resource[0].interaction[1].documentation == ( "Search allows clients to filter libraries based on a " "provided search parameter" ) assert ( inst.rest[0].resource[0].profile == "http://hl7.org/fhir/StructureDefinition/Library" ) assert ( inst.rest[0].resource[0].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/Library-description" ) assert inst.rest[0].resource[0].searchParam[0].name == "description" assert inst.rest[0].resource[0].searchParam[0].type == "string" assert ( inst.rest[0].resource[0].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/Library-identifier" ) assert inst.rest[0].resource[0].searchParam[1].name == "identifier" assert inst.rest[0].resource[0].searchParam[1].type == "token" assert ( inst.rest[0].resource[0].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/Library-status" ) assert inst.rest[0].resource[0].searchParam[2].name == "status" assert inst.rest[0].resource[0].searchParam[2].type == "token" assert ( inst.rest[0].resource[0].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/Library-title" ) assert inst.rest[0].resource[0].searchParam[3].name == "title" assert inst.rest[0].resource[0].searchParam[3].type == "string" assert ( inst.rest[0].resource[0].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/Library-topic" ) assert inst.rest[0].resource[0].searchParam[4].name == "topic" assert inst.rest[0].resource[0].searchParam[4].type == "token" assert ( inst.rest[0].resource[0].searchParam[5].definition == "http://hl7.org/fhir/SearchParameter/Library-version" ) assert inst.rest[0].resource[0].searchParam[5].name == "version" assert inst.rest[0].resource[0].searchParam[5].type == "token" assert ( inst.rest[0].resource[0].searchParam[6].definition == "http://hl7.org/fhir/SearchParameter/Library-composed-of" ) assert inst.rest[0].resource[0].searchParam[6].name == "composed-of" assert inst.rest[0].resource[0].searchParam[6].type == "reference" assert ( inst.rest[0].resource[0].searchParam[7].definition == "http://hl7.org/fhir/SearchParameter/Library-depends-on" ) assert inst.rest[0].resource[0].searchParam[7].name == "depends-on" assert inst.rest[0].resource[0].searchParam[7].type == "reference" assert ( inst.rest[0].resource[0].searchParam[8].definition == "http://hl7.org/fhir/SearchParameter/Library-derived-from" ) assert inst.rest[0].resource[0].searchParam[8].name == "derived-from" assert inst.rest[0].resource[0].searchParam[8].type == "reference" assert ( inst.rest[0].resource[0].searchParam[9].definition == "http://hl7.org/fhir/SearchParameter/Library-predecessor" ) assert inst.rest[0].resource[0].searchParam[9].name == "predecessor" assert inst.rest[0].resource[0].searchParam[9].type == "reference" assert inst.rest[0].resource[0].type == "Library" assert inst.rest[0].resource[1].interaction[0].code == "read" assert inst.rest[0].resource[1].interaction[0].documentation == ( "Read allows clients to get the logical definitions of the " "plan definitions" ) assert inst.rest[0].resource[1].interaction[1].code == "search-type" assert inst.rest[0].resource[1].interaction[1].documentation == ( "Search allows clients to filter plan definitions based on a " "provided search parameter" ) assert ( inst.rest[0].resource[1].profile == "http://hl7.org/fhir/StructureDefinition/PlanDefinition" ) assert inst.rest[0].resource[1].searchParam[0].definition == ( "http://hl7.org/fhir/SearchParameter/PlanDefinition-" "description" ) assert inst.rest[0].resource[1].searchParam[0].name == "description" assert inst.rest[0].resource[1].searchParam[0].type == "string" assert inst.rest[0].resource[1].searchParam[1].definition == ( "http://hl7.org/fhir/SearchParameter/PlanDefinition-" "identifier" ) assert inst.rest[0].resource[1].searchParam[1].name == "identifier" assert inst.rest[0].resource[1].searchParam[1].type == "token" assert ( inst.rest[0].resource[1].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/PlanDefinition-status" ) assert inst.rest[0].resource[1].searchParam[2].name == "status" assert inst.rest[0].resource[1].searchParam[2].type == "token" assert ( inst.rest[0].resource[1].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/PlanDefinition-title" ) assert inst.rest[0].resource[1].searchParam[3].name == "title" assert inst.rest[0].resource[1].searchParam[3].type == "string" assert ( inst.rest[0].resource[1].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/PlanDefinition-topic" ) assert inst.rest[0].resource[1].searchParam[4].name == "topic" assert inst.rest[0].resource[1].searchParam[4].type == "token" assert ( inst.rest[0].resource[1].searchParam[5].definition == "http://hl7.org/fhir/SearchParameter/PlanDefinition-version" ) assert inst.rest[0].resource[1].searchParam[5].name == "version" assert inst.rest[0].resource[1].searchParam[5].type == "token" assert inst.rest[0].resource[1].searchParam[6].definition == ( "http://hl7.org/fhir/SearchParameter/PlanDefinition-composed-" "of" ) assert inst.rest[0].resource[1].searchParam[6].name == "composed-of" assert inst.rest[0].resource[1].searchParam[6].type == "reference" assert inst.rest[0].resource[1].searchParam[7].definition == ( "http://hl7.org/fhir/SearchParameter/PlanDefinition-depends-" "on" ) assert inst.rest[0].resource[1].searchParam[7].name == "depends-on" assert inst.rest[0].resource[1].searchParam[7].type == "reference" assert inst.rest[0].resource[1].searchParam[8].definition == ( "http://hl7.org/fhir/SearchParameter/PlanDefinition-derived-" "from" ) assert inst.rest[0].resource[1].searchParam[8].name == "derived-from" assert inst.rest[0].resource[1].searchParam[8].type == "reference" assert inst.rest[0].resource[1].searchParam[9].definition == ( "http://hl7.org/fhir/SearchParameter/PlanDefinition-" "predecessor" ) assert inst.rest[0].resource[1].searchParam[9].name == "predecessor" assert inst.rest[0].resource[1].searchParam[9].type == "reference" assert inst.rest[0].resource[1].type == "PlanDefinition" assert inst.rest[0].resource[2].interaction[0].code == "read" assert inst.rest[0].resource[2].interaction[0].documentation == ( "Read allows clients to get the logical definitions of the " "activity definitions" ) assert inst.rest[0].resource[2].interaction[1].code == "search-type" assert inst.rest[0].resource[2].interaction[1].documentation == ( "Search allows clients to filter activity definitions based " "on a provided search parameter" ) assert ( inst.rest[0].resource[2].profile == "http://hl7.org/fhir/StructureDefinition/ActivityDefinition" ) assert inst.rest[0].resource[2].searchParam[0].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "description" ) assert inst.rest[0].resource[2].searchParam[0].name == "description" assert inst.rest[0].resource[2].searchParam[0].type == "string" assert inst.rest[0].resource[2].searchParam[1].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "identifier" ) assert inst.rest[0].resource[2].searchParam[1].name == "identifier" assert inst.rest[0].resource[2].searchParam[1].type == "token" assert inst.rest[0].resource[2].searchParam[2].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "status" ) assert inst.rest[0].resource[2].searchParam[2].name == "status" assert inst.rest[0].resource[2].searchParam[2].type == "token" assert ( inst.rest[0].resource[2].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/ActivityDefinition-title" ) assert inst.rest[0].resource[2].searchParam[3].name == "title" assert inst.rest[0].resource[2].searchParam[3].type == "string" assert ( inst.rest[0].resource[2].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/ActivityDefinition-topic" ) assert inst.rest[0].resource[2].searchParam[4].name == "topic" assert inst.rest[0].resource[2].searchParam[4].type == "token" assert inst.rest[0].resource[2].searchParam[5].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "version" ) assert inst.rest[0].resource[2].searchParam[5].name == "version" assert inst.rest[0].resource[2].searchParam[5].type == "token" assert inst.rest[0].resource[2].searchParam[6].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "composed-of" ) assert inst.rest[0].resource[2].searchParam[6].name == "composed-of" assert inst.rest[0].resource[2].searchParam[6].type == "reference" assert inst.rest[0].resource[2].searchParam[7].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "depends-on" ) assert inst.rest[0].resource[2].searchParam[7].name == "depends-on" assert inst.rest[0].resource[2].searchParam[7].type == "reference" assert inst.rest[0].resource[2].searchParam[8].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "derived-from" ) assert inst.rest[0].resource[2].searchParam[8].name == "derived-from" assert inst.rest[0].resource[2].searchParam[8].type == "reference" assert inst.rest[0].resource[2].searchParam[9].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "predecessor" ) assert inst.rest[0].resource[2].searchParam[9].name == "predecessor" assert inst.rest[0].resource[2].searchParam[9].type == "reference" assert inst.rest[0].resource[2].type == "ActivityDefinition" assert inst.rest[0].resource[3].interaction[0].code == "read" assert inst.rest[0].resource[3].interaction[0].documentation == ( "Read allows clients to get the logical definitions of the " "measures" ) assert inst.rest[0].resource[3].interaction[1].code == "search-type" assert inst.rest[0].resource[3].interaction[1].documentation == ( "Search allows clients to filter measures based on a provided" " search parameter" ) assert ( inst.rest[0].resource[3].profile == "http://hl7.org/fhir/StructureDefinition/Measure" ) assert ( inst.rest[0].resource[3].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/Measure-description" ) assert inst.rest[0].resource[3].searchParam[0].name == "description" assert inst.rest[0].resource[3].searchParam[0].type == "string" assert ( inst.rest[0].resource[3].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/Measure-identifier" ) assert inst.rest[0].resource[3].searchParam[1].name == "identifier" assert inst.rest[0].resource[3].searchParam[1].type == "token" assert ( inst.rest[0].resource[3].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/Measure-status" ) assert inst.rest[0].resource[3].searchParam[2].name == "status" assert inst.rest[0].resource[3].searchParam[2].type == "token" assert ( inst.rest[0].resource[3].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/Measure-title" ) assert inst.rest[0].resource[3].searchParam[3].name == "title" assert inst.rest[0].resource[3].searchParam[3].type == "string" assert ( inst.rest[0].resource[3].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/Measure-topic" ) assert inst.rest[0].resource[3].searchParam[4].name == "topic" assert inst.rest[0].resource[3].searchParam[4].type == "token" assert ( inst.rest[0].resource[3].searchParam[5].definition == "http://hl7.org/fhir/SearchParameter/Measure-version" ) assert inst.rest[0].resource[3].searchParam[5].name == "version" assert inst.rest[0].resource[3].searchParam[5].type == "token" assert ( inst.rest[0].resource[3].searchParam[6].definition == "http://hl7.org/fhir/SearchParameter/Measure-composed-of" ) assert inst.rest[0].resource[3].searchParam[6].name == "composed-of" assert inst.rest[0].resource[3].searchParam[6].type == "reference" assert ( inst.rest[0].resource[3].searchParam[7].definition == "http://hl7.org/fhir/SearchParameter/Measure-depends-on" ) assert inst.rest[0].resource[3].searchParam[7].name == "depends-on" assert inst.rest[0].resource[3].searchParam[7].type == "reference" assert ( inst.rest[0].resource[3].searchParam[8].definition == "http://hl7.org/fhir/SearchParameter/Measure-derived-from" ) assert inst.rest[0].resource[3].searchParam[8].name == "derived-from" assert inst.rest[0].resource[3].searchParam[8].type == "reference" assert ( inst.rest[0].resource[3].searchParam[9].definition == "http://hl7.org/fhir/SearchParameter/Measure-predecessor" ) assert inst.rest[0].resource[3].searchParam[9].name == "predecessor" assert inst.rest[0].resource[3].searchParam[9].type == "reference" assert inst.rest[0].resource[3].type == "Measure" assert inst.rest[0].resource[4].interaction[0].code == "read" assert inst.rest[0].resource[4].interaction[0].documentation == ( "Read allows clients to get the logical definitions of the " "measures" ) assert inst.rest[0].resource[4].interaction[1].code == "search-type" assert inst.rest[0].resource[4].interaction[1].documentation == ( "Search allows clients to filter measures based on a provided" " search parameter" ) assert ( inst.rest[0].resource[4].profile == "http://hl7.org/fhir/StructureDefinition/Questionnaire" ) assert ( inst.rest[0].resource[4].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/Questionnaire-code" ) assert inst.rest[0].resource[4].searchParam[0].name == "code" assert inst.rest[0].resource[4].searchParam[0].type == "token" assert ( inst.rest[0].resource[4].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/Questionnaire-context" ) assert inst.rest[0].resource[4].searchParam[1].name == "context" assert inst.rest[0].resource[4].searchParam[1].type == "token" assert ( inst.rest[0].resource[4].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/Questionnaire-date" ) assert inst.rest[0].resource[4].searchParam[2].name == "date" assert inst.rest[0].resource[4].searchParam[2].type == "date" assert ( inst.rest[0].resource[4].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/Questionnaire-identifier" ) assert inst.rest[0].resource[4].searchParam[3].name == "identifier" assert inst.rest[0].resource[4].searchParam[3].type == "token" assert ( inst.rest[0].resource[4].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/Questionnaire-publisher" ) assert inst.rest[0].resource[4].searchParam[4].name == "publisher" assert inst.rest[0].resource[4].searchParam[4].type == "string" assert ( inst.rest[0].resource[4].searchParam[5].definition == "http://hl7.org/fhir/SearchParameter/Questionnaire-status" ) assert inst.rest[0].resource[4].searchParam[5].name == "status" assert inst.rest[0].resource[4].searchParam[5].type == "token" assert ( inst.rest[0].resource[4].searchParam[6].definition == "http://hl7.org/fhir/SearchParameter/Questionnaire-title" ) assert inst.rest[0].resource[4].searchParam[6].name == "title" assert inst.rest[0].resource[4].searchParam[6].type == "string" assert ( inst.rest[0].resource[4].searchParam[7].definition == "http://hl7.org/fhir/SearchParameter/Questionnaire-version" ) assert inst.rest[0].resource[4].searchParam[7].name == "version" assert inst.rest[0].resource[4].searchParam[7].type == "token" assert inst.rest[0].resource[4].type == "Questionnaire" assert inst.rest[0].security.cors is True assert inst.rest[0].security.service[0].coding[0].code == "Certificates" assert ( inst.rest[0].security.service[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/restful-security-service" } ).valueUri ) assert inst.software.name == "ACME Knowledge Repository Service" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/knowledge-repository"} ).valueUri ) def test_capabilitystatement_7(base_settings): """No. 7 tests collection for CapabilityStatement. Test File: capabilitystatement-knowledge-repository.json """ filename = ( base_settings["unittest_data_dir"] / "capabilitystatement-knowledge-repository.json" ) inst = capabilitystatement.CapabilityStatement.model_validate_json( filename.read_bytes() ) assert "CapabilityStatement" == inst.get_resource_type() impl_capabilitystatement_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CapabilityStatement" == data["resourceType"] inst2 = capabilitystatement.CapabilityStatement(**data) impl_capabilitystatement_7(inst2) def impl_capabilitystatement_8(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.experimental is True assert inst.fhirVersion == "4.3.0" assert inst.format[0] == "xml" assert inst.format[1] == "json" assert inst.id == "base" assert inst.kind == "capability" assert inst.name == "Base FHIR Capability Statement (Full)" assert inst.publisher == "FHIR Project Team" assert inst.rest[0].documentation == "All the functionality defined in FHIR" assert inst.rest[0].interaction[0].code == "transaction" assert inst.rest[0].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].interaction[1].code == "batch" assert inst.rest[0].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].interaction[2].code == "history-system" assert inst.rest[0].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].interaction[3].code == "search-system" assert inst.rest[0].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].mode == "server" assert ( inst.rest[0].operation[0].definition == "http://hl7.org/fhir/OperationDefinition/resource-validate" ) assert inst.rest[0].operation[0].name == "validate" assert ( inst.rest[0].operation[1].definition == "http://hl7.org/fhir/OperationDefinition/resource-meta" ) assert inst.rest[0].operation[1].name == "meta" assert ( inst.rest[0].operation[2].definition == "http://hl7.org/fhir/OperationDefinition/resource-meta-add" ) assert inst.rest[0].operation[2].name == "meta-add" assert ( inst.rest[0].operation[3].definition == "http://hl7.org/fhir/OperationDefinition/resource-meta-delete" ) assert inst.rest[0].operation[3].name == "meta-delete" assert ( inst.rest[0].operation[4].definition == "http://hl7.org/fhir/OperationDefinition/resource-convert" ) assert inst.rest[0].operation[4].name == "convert" assert ( inst.rest[0].operation[5].definition == "http://hl7.org/fhir/OperationDefinition/resource-graphql" ) assert inst.rest[0].operation[5].name == "graphql" assert ( inst.rest[0].operation[6].definition == "http://hl7.org/fhir/OperationDefinition/resource-graph" ) assert inst.rest[0].operation[6].name == "graph" assert inst.rest[0].operation[7].definition == ( "http://hl7.org/fhir/OperationDefinition/activitydefinition-" "apply" ) assert inst.rest[0].operation[7].name == "apply" assert inst.rest[0].operation[8].definition == ( "http://hl7.org/fhir/OperationDefinition/activitydefinition-" "data-requirements" ) assert inst.rest[0].operation[8].name == "data-requirements" assert inst.rest[0].operation[9].definition == ( "http://hl7.org/fhir/OperationDefinition/capabilitystatement-" "subset" ) assert inst.rest[0].operation[9].name == "subset" assert inst.rest[0].resource[0].conditionalCreate is True assert inst.rest[0].resource[0].conditionalDelete == "multiple" assert inst.rest[0].resource[0].conditionalUpdate is True assert inst.rest[0].resource[0].interaction[0].code == "read" assert inst.rest[0].resource[0].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[0].interaction[1].code == "vread" assert inst.rest[0].resource[0].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[0].interaction[2].code == "update" assert inst.rest[0].resource[0].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[0].interaction[3].code == "delete" assert inst.rest[0].resource[0].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[0].interaction[4].code == "history-instance" assert inst.rest[0].resource[0].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[0].interaction[5].code == "history-type" assert inst.rest[0].resource[0].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[0].interaction[6].code == "create" assert inst.rest[0].resource[0].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[0].interaction[7].code == "search-type" assert inst.rest[0].resource[0].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[0].profile == "http://hl7.org/fhir/StructureDefinition/Account" ) assert inst.rest[0].resource[0].referencePolicy[0] == "literal" assert inst.rest[0].resource[0].referencePolicy[1] == "logical" assert inst.rest[0].resource[0].searchInclude[0] == "Account.owner" assert inst.rest[0].resource[0].searchInclude[1] == "Account.patient" assert inst.rest[0].resource[0].searchInclude[2] == "Account.subject" assert ( inst.rest[0].resource[0].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/Account-owner" ) assert ( inst.rest[0].resource[0].searchParam[0].documentation == "Entity managing the Account" ) assert inst.rest[0].resource[0].searchParam[0].name == "owner" assert inst.rest[0].resource[0].searchParam[0].type == "reference" assert ( inst.rest[0].resource[0].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/Account-identifier" ) assert inst.rest[0].resource[0].searchParam[1].documentation == "Account number" assert inst.rest[0].resource[0].searchParam[1].name == "identifier" assert inst.rest[0].resource[0].searchParam[1].type == "token" assert ( inst.rest[0].resource[0].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/Account-period" ) assert inst.rest[0].resource[0].searchParam[2].documentation == "Transaction window" assert inst.rest[0].resource[0].searchParam[2].name == "period" assert inst.rest[0].resource[0].searchParam[2].type == "date" assert ( inst.rest[0].resource[0].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/Account-patient" ) assert ( inst.rest[0].resource[0].searchParam[3].documentation == "The entity that caused the expenses" ) assert inst.rest[0].resource[0].searchParam[3].name == "patient" assert inst.rest[0].resource[0].searchParam[3].type == "reference" assert ( inst.rest[0].resource[0].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/Account-subject" ) assert ( inst.rest[0].resource[0].searchParam[4].documentation == "The entity that caused the expenses" ) assert inst.rest[0].resource[0].searchParam[4].name == "subject" assert inst.rest[0].resource[0].searchParam[4].type == "reference" assert ( inst.rest[0].resource[0].searchParam[5].definition == "http://hl7.org/fhir/SearchParameter/Account-name" ) assert ( inst.rest[0].resource[0].searchParam[5].documentation == "Human-readable label" ) assert inst.rest[0].resource[0].searchParam[5].name == "name" assert inst.rest[0].resource[0].searchParam[5].type == "string" assert ( inst.rest[0].resource[0].searchParam[6].definition == "http://hl7.org/fhir/SearchParameter/Account-type" ) assert ( inst.rest[0].resource[0].searchParam[6].documentation == "E.g. patient, expense, depreciation" ) assert inst.rest[0].resource[0].searchParam[6].name == "type" assert inst.rest[0].resource[0].searchParam[6].type == "token" assert ( inst.rest[0].resource[0].searchParam[7].definition == "http://hl7.org/fhir/SearchParameter/Account-status" ) assert ( inst.rest[0].resource[0].searchParam[7].documentation == "active | inactive | entered-in-error | on-hold | unknown" ) assert inst.rest[0].resource[0].searchParam[7].name == "status" assert inst.rest[0].resource[0].searchParam[7].type == "token" assert inst.rest[0].resource[0].searchRevInclude[0] == "ChargeItem.account" assert inst.rest[0].resource[0].searchRevInclude[1] == "Encounter.account" assert inst.rest[0].resource[0].searchRevInclude[2] == "Invoice.account" assert inst.rest[0].resource[0].type == "Account" assert inst.rest[0].resource[1].conditionalCreate is True assert inst.rest[0].resource[1].conditionalDelete == "multiple" assert inst.rest[0].resource[1].conditionalUpdate is True assert inst.rest[0].resource[1].interaction[0].code == "read" assert inst.rest[0].resource[1].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[1].interaction[1].code == "vread" assert inst.rest[0].resource[1].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[1].interaction[2].code == "update" assert inst.rest[0].resource[1].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[1].interaction[3].code == "delete" assert inst.rest[0].resource[1].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[1].interaction[4].code == "history-instance" assert inst.rest[0].resource[1].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[1].interaction[5].code == "history-type" assert inst.rest[0].resource[1].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[1].interaction[6].code == "create" assert inst.rest[0].resource[1].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[1].interaction[7].code == "search-type" assert inst.rest[0].resource[1].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[1].profile == "http://hl7.org/fhir/StructureDefinition/ActivityDefinition" ) assert inst.rest[0].resource[1].referencePolicy[0] == "literal" assert inst.rest[0].resource[1].referencePolicy[1] == "logical" assert inst.rest[0].resource[1].searchInclude[0] == "ActivityDefinition.successor" assert ( inst.rest[0].resource[1].searchInclude[1] == "ActivityDefinition.derived-from" ) assert inst.rest[0].resource[1].searchInclude[2] == "ActivityDefinition.predecessor" assert inst.rest[0].resource[1].searchInclude[3] == "ActivityDefinition.composed-of" assert inst.rest[0].resource[1].searchInclude[4] == "ActivityDefinition.depends-on" assert ( inst.rest[0].resource[1].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/ActivityDefinition-date" ) assert ( inst.rest[0].resource[1].searchParam[0].documentation == "The activity definition publication date" ) assert inst.rest[0].resource[1].searchParam[0].name == "date" assert inst.rest[0].resource[1].searchParam[0].type == "date" assert inst.rest[0].resource[1].searchParam[1].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "identifier" ) assert ( inst.rest[0].resource[1].searchParam[1].documentation == "External identifier for the activity definition" ) assert inst.rest[0].resource[1].searchParam[1].name == "identifier" assert inst.rest[0].resource[1].searchParam[1].type == "token" assert inst.rest[0].resource[1].searchParam[2].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "successor" ) assert ( inst.rest[0].resource[1].searchParam[2].documentation == "What resource is being referenced" ) assert inst.rest[0].resource[1].searchParam[2].name == "successor" assert inst.rest[0].resource[1].searchParam[2].type == "reference" assert inst.rest[0].resource[1].searchParam[3].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "context-type-value" ) assert inst.rest[0].resource[1].searchParam[3].documentation == ( "A use context type and value assigned to the activity " "definition" ) assert inst.rest[0].resource[1].searchParam[3].name == "context-type-value" assert inst.rest[0].resource[1].searchParam[3].type == "composite" assert inst.rest[0].resource[1].searchParam[4].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "jurisdiction" ) assert ( inst.rest[0].resource[1].searchParam[4].documentation == "Intended jurisdiction for the activity definition" ) assert inst.rest[0].resource[1].searchParam[4].name == "jurisdiction" assert inst.rest[0].resource[1].searchParam[4].type == "token" assert inst.rest[0].resource[1].searchParam[5].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "derived-from" ) assert ( inst.rest[0].resource[1].searchParam[5].documentation == "What resource is being referenced" ) assert inst.rest[0].resource[1].searchParam[5].name == "derived-from" assert inst.rest[0].resource[1].searchParam[5].type == "reference" assert inst.rest[0].resource[1].searchParam[6].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "description" ) assert ( inst.rest[0].resource[1].searchParam[6].documentation == "The description of the activity definition" ) assert inst.rest[0].resource[1].searchParam[6].name == "description" assert inst.rest[0].resource[1].searchParam[6].type == "string" assert inst.rest[0].resource[1].searchParam[7].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "context-type" ) assert ( inst.rest[0].resource[1].searchParam[7].documentation == "A type of use context assigned to the activity definition" ) assert inst.rest[0].resource[1].searchParam[7].name == "context-type" assert inst.rest[0].resource[1].searchParam[7].type == "token" assert inst.rest[0].resource[1].searchParam[8].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "predecessor" ) assert ( inst.rest[0].resource[1].searchParam[8].documentation == "What resource is being referenced" ) assert inst.rest[0].resource[1].searchParam[8].name == "predecessor" assert inst.rest[0].resource[1].searchParam[8].type == "reference" assert inst.rest[0].resource[1].searchParam[9].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "composed-of" ) assert ( inst.rest[0].resource[1].searchParam[9].documentation == "What resource is being referenced" ) assert inst.rest[0].resource[1].searchParam[9].name == "composed-of" assert inst.rest[0].resource[1].searchParam[9].type == "reference" assert ( inst.rest[0].resource[1].searchRevInclude[0] == "CarePlan.instantiates-canonical" ) assert ( inst.rest[0].resource[1].searchRevInclude[1] == "ClinicalUseDefinition.product" ) assert ( inst.rest[0].resource[1].searchRevInclude[2] == "ClinicalUseDefinition.subject" ) assert ( inst.rest[0].resource[1].searchRevInclude[3] == "Communication.instantiates-canonical" ) assert ( inst.rest[0].resource[1].searchRevInclude[4] == "DeviceRequest.instantiates-canonical" ) assert ( inst.rest[0].resource[1].searchRevInclude[5] == "FamilyMemberHistory.instantiates-canonical" ) assert inst.rest[0].resource[1].searchRevInclude[6] == "MessageDefinition.parent" assert ( inst.rest[0].resource[1].searchRevInclude[7] == "NutritionOrder.instantiates-canonical" ) assert inst.rest[0].resource[1].searchRevInclude[8] == "PlanDefinition.definition" assert ( inst.rest[0].resource[1].searchRevInclude[9] == "Procedure.instantiates-canonical" ) assert inst.rest[0].resource[1].type == "ActivityDefinition" assert inst.rest[0].resource[2].conditionalCreate is True assert inst.rest[0].resource[2].conditionalDelete == "multiple" assert inst.rest[0].resource[2].conditionalUpdate is True assert inst.rest[0].resource[2].interaction[0].code == "read" assert inst.rest[0].resource[2].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[2].interaction[1].code == "vread" assert inst.rest[0].resource[2].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[2].interaction[2].code == "update" assert inst.rest[0].resource[2].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[2].interaction[3].code == "delete" assert inst.rest[0].resource[2].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[2].interaction[4].code == "history-instance" assert inst.rest[0].resource[2].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[2].interaction[5].code == "history-type" assert inst.rest[0].resource[2].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[2].interaction[6].code == "create" assert inst.rest[0].resource[2].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[2].interaction[7].code == "search-type" assert inst.rest[0].resource[2].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[2].profile == ( "http://hl7.org/fhir/StructureDefinition/AdministrableProduct" "Definition" ) assert inst.rest[0].resource[2].referencePolicy[0] == "literal" assert inst.rest[0].resource[2].referencePolicy[1] == "logical" assert ( inst.rest[0].resource[2].searchInclude[0] == "AdministrableProductDefinition.manufactured-item" ) assert ( inst.rest[0].resource[2].searchInclude[1] == "AdministrableProductDefinition.device" ) assert ( inst.rest[0].resource[2].searchInclude[2] == "AdministrableProductDefinition.form-of" ) assert inst.rest[0].resource[2].searchParam[0].definition == ( "http://hl7.org/fhir/SearchParameter/AdministrableProductDefi" "nition-identifier" ) assert ( inst.rest[0].resource[2].searchParam[0].documentation == "An identifier for the administrable product" ) assert inst.rest[0].resource[2].searchParam[0].name == "identifier" assert inst.rest[0].resource[2].searchParam[0].type == "token" assert inst.rest[0].resource[2].searchParam[1].definition == ( "http://hl7.org/fhir/SearchParameter/AdministrableProductDefi" "nition-manufactured-item" ) assert inst.rest[0].resource[2].searchParam[1].name == "manufactured-item" assert inst.rest[0].resource[2].searchParam[1].type == "reference" assert inst.rest[0].resource[2].searchParam[2].definition == ( "http://hl7.org/fhir/SearchParameter/AdministrableProductDefi" "nition-ingredient" ) assert ( inst.rest[0].resource[2].searchParam[2].documentation == "The ingredients of this administrable medicinal product" ) assert inst.rest[0].resource[2].searchParam[2].name == "ingredient" assert inst.rest[0].resource[2].searchParam[2].type == "token" assert inst.rest[0].resource[2].searchParam[3].definition == ( "http://hl7.org/fhir/SearchParameter/AdministrableProductDefi" "nition-route" ) assert ( inst.rest[0].resource[2].searchParam[3].documentation == "Coded expression for the route" ) assert inst.rest[0].resource[2].searchParam[3].name == "route" assert inst.rest[0].resource[2].searchParam[3].type == "token" assert inst.rest[0].resource[2].searchParam[4].definition == ( "http://hl7.org/fhir/SearchParameter/AdministrableProductDefi" "nition-dose-form" ) assert inst.rest[0].resource[2].searchParam[4].documentation == ( "The administrable dose form, i.e. the dose form of the final" " product after necessary reconstitution or processing" ) assert inst.rest[0].resource[2].searchParam[4].name == "dose-form" assert inst.rest[0].resource[2].searchParam[4].type == "token" assert inst.rest[0].resource[2].searchParam[5].definition == ( "http://hl7.org/fhir/SearchParameter/AdministrableProductDefi" "nition-device" ) assert inst.rest[0].resource[2].searchParam[5].documentation == ( "A device that is integral to the medicinal product, in " 'effect being considered as an "ingredient" of the ' "medicinal product. This is not intended for devices that are" " just co-packaged" ) assert inst.rest[0].resource[2].searchParam[5].name == "device" assert inst.rest[0].resource[2].searchParam[5].type == "reference" assert inst.rest[0].resource[2].searchParam[6].definition == ( "http://hl7.org/fhir/SearchParameter/AdministrableProductDefi" "nition-form-of" ) assert inst.rest[0].resource[2].searchParam[6].documentation == ( "The medicinal product that this is an administrable form of." " This is not a reference to the item(s) that make up this " "administrable form - it is the whole product" ) assert inst.rest[0].resource[2].searchParam[6].name == "form-of" assert inst.rest[0].resource[2].searchParam[6].type == "reference" assert inst.rest[0].resource[2].searchParam[7].definition == ( "http://hl7.org/fhir/SearchParameter/AdministrableProductDefi" "nition-target-species" ) assert ( inst.rest[0].resource[2].searchParam[7].documentation == "Coded expression for the species" ) assert inst.rest[0].resource[2].searchParam[7].name == "target-species" assert inst.rest[0].resource[2].searchParam[7].type == "token" assert inst.rest[0].resource[2].searchRevInclude[0] == "Ingredient.for" assert inst.rest[0].resource[2].type == "AdministrableProductDefinition" assert inst.rest[0].resource[3].conditionalCreate is True assert inst.rest[0].resource[3].conditionalDelete == "multiple" assert inst.rest[0].resource[3].conditionalUpdate is True assert inst.rest[0].resource[3].interaction[0].code == "read" assert inst.rest[0].resource[3].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[3].interaction[1].code == "vread" assert inst.rest[0].resource[3].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[3].interaction[2].code == "update" assert inst.rest[0].resource[3].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[3].interaction[3].code == "delete" assert inst.rest[0].resource[3].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[3].interaction[4].code == "history-instance" assert inst.rest[0].resource[3].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[3].interaction[5].code == "history-type" assert inst.rest[0].resource[3].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[3].interaction[6].code == "create" assert inst.rest[0].resource[3].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[3].interaction[7].code == "search-type" assert inst.rest[0].resource[3].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[3].profile == "http://hl7.org/fhir/StructureDefinition/AdverseEvent" ) assert inst.rest[0].resource[3].referencePolicy[0] == "literal" assert inst.rest[0].resource[3].referencePolicy[1] == "logical" assert inst.rest[0].resource[3].searchInclude[0] == "AdverseEvent.recorder" assert inst.rest[0].resource[3].searchInclude[1] == "AdverseEvent.study" assert inst.rest[0].resource[3].searchInclude[2] == "AdverseEvent.subject" assert ( inst.rest[0].resource[3].searchInclude[3] == "AdverseEvent.resultingcondition" ) assert inst.rest[0].resource[3].searchInclude[4] == "AdverseEvent.substance" assert inst.rest[0].resource[3].searchInclude[5] == "AdverseEvent.location" assert ( inst.rest[0].resource[3].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/AdverseEvent-date" ) assert ( inst.rest[0].resource[3].searchParam[0].documentation == "When the event occurred" ) assert inst.rest[0].resource[3].searchParam[0].name == "date" assert inst.rest[0].resource[3].searchParam[0].type == "date" assert ( inst.rest[0].resource[3].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/AdverseEvent-severity" ) assert ( inst.rest[0].resource[3].searchParam[1].documentation == "mild | moderate | severe" ) assert inst.rest[0].resource[3].searchParam[1].name == "severity" assert inst.rest[0].resource[3].searchParam[1].type == "token" assert ( inst.rest[0].resource[3].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/AdverseEvent-recorder" ) assert ( inst.rest[0].resource[3].searchParam[2].documentation == "Who recorded the adverse event" ) assert inst.rest[0].resource[3].searchParam[2].name == "recorder" assert inst.rest[0].resource[3].searchParam[2].type == "reference" assert ( inst.rest[0].resource[3].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/AdverseEvent-study" ) assert inst.rest[0].resource[3].searchParam[3].documentation == "AdverseEvent.study" assert inst.rest[0].resource[3].searchParam[3].name == "study" assert inst.rest[0].resource[3].searchParam[3].type == "reference" assert ( inst.rest[0].resource[3].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/AdverseEvent-actuality" ) assert inst.rest[0].resource[3].searchParam[4].documentation == "actual | potential" assert inst.rest[0].resource[3].searchParam[4].name == "actuality" assert inst.rest[0].resource[3].searchParam[4].type == "token" assert ( inst.rest[0].resource[3].searchParam[5].definition == "http://hl7.org/fhir/SearchParameter/AdverseEvent-seriousness" ) assert ( inst.rest[0].resource[3].searchParam[5].documentation == "Seriousness of the event" ) assert inst.rest[0].resource[3].searchParam[5].name == "seriousness" assert inst.rest[0].resource[3].searchParam[5].type == "token" assert ( inst.rest[0].resource[3].searchParam[6].definition == "http://hl7.org/fhir/SearchParameter/AdverseEvent-subject" ) assert ( inst.rest[0].resource[3].searchParam[6].documentation == "Subject impacted by event" ) assert inst.rest[0].resource[3].searchParam[6].name == "subject" assert inst.rest[0].resource[3].searchParam[6].type == "reference" assert inst.rest[0].resource[3].searchParam[7].definition == ( "http://hl7.org/fhir/SearchParameter/AdverseEvent-" "resultingcondition" ) assert ( inst.rest[0].resource[3].searchParam[7].documentation == "Effect on the subject due to this event" ) assert inst.rest[0].resource[3].searchParam[7].name == "resultingcondition" assert inst.rest[0].resource[3].searchParam[7].type == "reference" assert ( inst.rest[0].resource[3].searchParam[8].definition == "http://hl7.org/fhir/SearchParameter/AdverseEvent-substance" ) assert ( inst.rest[0].resource[3].searchParam[8].documentation == "Refers to the specific entity that caused the adverse event" ) assert inst.rest[0].resource[3].searchParam[8].name == "substance" assert inst.rest[0].resource[3].searchParam[8].type == "reference" assert ( inst.rest[0].resource[3].searchParam[9].definition == "http://hl7.org/fhir/SearchParameter/AdverseEvent-location" ) assert ( inst.rest[0].resource[3].searchParam[9].documentation == "Location where adverse event occurred" ) assert inst.rest[0].resource[3].searchParam[9].name == "location" assert inst.rest[0].resource[3].searchParam[9].type == "reference" assert inst.rest[0].resource[3].type == "AdverseEvent" assert inst.rest[0].resource[4].conditionalCreate is True assert inst.rest[0].resource[4].conditionalDelete == "multiple" assert inst.rest[0].resource[4].conditionalUpdate is True assert inst.rest[0].resource[4].interaction[0].code == "read" assert inst.rest[0].resource[4].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[4].interaction[1].code == "vread" assert inst.rest[0].resource[4].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[4].interaction[2].code == "update" assert inst.rest[0].resource[4].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[4].interaction[3].code == "delete" assert inst.rest[0].resource[4].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[4].interaction[4].code == "history-instance" assert inst.rest[0].resource[4].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[4].interaction[5].code == "history-type" assert inst.rest[0].resource[4].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[4].interaction[6].code == "create" assert inst.rest[0].resource[4].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[4].interaction[7].code == "search-type" assert inst.rest[0].resource[4].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[4].profile == "http://hl7.org/fhir/StructureDefinition/AllergyIntolerance" ) assert inst.rest[0].resource[4].referencePolicy[0] == "literal" assert inst.rest[0].resource[4].referencePolicy[1] == "logical" assert inst.rest[0].resource[4].searchInclude[0] == "AllergyIntolerance.recorder" assert inst.rest[0].resource[4].searchInclude[1] == "AllergyIntolerance.asserter" assert inst.rest[0].resource[4].searchInclude[2] == "AllergyIntolerance.patient" assert ( inst.rest[0].resource[4].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/clinical-date" ) assert ( inst.rest[0].resource[4].searchParam[0].documentation == "Date first version of the resource instance was recorded" ) assert inst.rest[0].resource[4].searchParam[0].name == "date" assert inst.rest[0].resource[4].searchParam[0].type == "date" assert inst.rest[0].resource[4].searchParam[1].definition == ( "http://hl7.org/fhir/SearchParameter/AllergyIntolerance-" "severity" ) assert ( inst.rest[0].resource[4].searchParam[1].documentation == "mild | moderate | severe (of event as a whole)" ) assert inst.rest[0].resource[4].searchParam[1].name == "severity" assert inst.rest[0].resource[4].searchParam[1].type == "token" assert ( inst.rest[0].resource[4].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/clinical-identifier" ) assert ( inst.rest[0].resource[4].searchParam[2].documentation == "External ids for this item" ) assert inst.rest[0].resource[4].searchParam[2].name == "identifier" assert inst.rest[0].resource[4].searchParam[2].type == "token" assert inst.rest[0].resource[4].searchParam[3].definition == ( "http://hl7.org/fhir/SearchParameter/AllergyIntolerance-" "manifestation" ) assert ( inst.rest[0].resource[4].searchParam[3].documentation == "Clinical symptoms/signs associated with the Event" ) assert inst.rest[0].resource[4].searchParam[3].name == "manifestation" assert inst.rest[0].resource[4].searchParam[3].type == "token" assert inst.rest[0].resource[4].searchParam[4].definition == ( "http://hl7.org/fhir/SearchParameter/AllergyIntolerance-" "recorder" ) assert ( inst.rest[0].resource[4].searchParam[4].documentation == "Who recorded the sensitivity" ) assert inst.rest[0].resource[4].searchParam[4].name == "recorder" assert inst.rest[0].resource[4].searchParam[4].type == "reference" assert ( inst.rest[0].resource[4].searchParam[5].definition == "http://hl7.org/fhir/SearchParameter/clinical-code" ) assert ( inst.rest[0].resource[4].searchParam[5].documentation == "Code that identifies the allergy or intolerance" ) assert inst.rest[0].resource[4].searchParam[5].name == "code" assert inst.rest[0].resource[4].searchParam[5].type == "token" assert inst.rest[0].resource[4].searchParam[6].definition == ( "http://hl7.org/fhir/SearchParameter/AllergyIntolerance-" "verification-status" ) assert ( inst.rest[0].resource[4].searchParam[6].documentation == "unconfirmed | confirmed | refuted | entered-in-error" ) assert inst.rest[0].resource[4].searchParam[6].name == "verification-status" assert inst.rest[0].resource[4].searchParam[6].type == "token" assert inst.rest[0].resource[4].searchParam[7].definition == ( "http://hl7.org/fhir/SearchParameter/AllergyIntolerance-" "criticality" ) assert ( inst.rest[0].resource[4].searchParam[7].documentation == "low | high | unable-to-assess" ) assert inst.rest[0].resource[4].searchParam[7].name == "criticality" assert inst.rest[0].resource[4].searchParam[7].type == "token" assert inst.rest[0].resource[4].searchParam[8].definition == ( "http://hl7.org/fhir/SearchParameter/AllergyIntolerance-" "clinical-status" ) assert ( inst.rest[0].resource[4].searchParam[8].documentation == "active | inactive | resolved" ) assert inst.rest[0].resource[4].searchParam[8].name == "clinical-status" assert inst.rest[0].resource[4].searchParam[8].type == "token" assert ( inst.rest[0].resource[4].searchParam[9].definition == "http://hl7.org/fhir/SearchParameter/AllergyIntolerance-onset" ) assert ( inst.rest[0].resource[4].searchParam[9].documentation == "Date(/time) when manifestations showed" ) assert inst.rest[0].resource[4].searchParam[9].name == "onset" assert inst.rest[0].resource[4].searchParam[9].type == "date" assert inst.rest[0].resource[4].searchRevInclude[0] == "ClinicalImpression.problem" assert inst.rest[0].resource[4].type == "AllergyIntolerance" assert inst.rest[0].resource[5].conditionalCreate is True assert inst.rest[0].resource[5].conditionalDelete == "multiple" assert inst.rest[0].resource[5].conditionalUpdate is True assert inst.rest[0].resource[5].interaction[0].code == "read" assert inst.rest[0].resource[5].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[5].interaction[1].code == "vread" assert inst.rest[0].resource[5].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[5].interaction[2].code == "update" assert inst.rest[0].resource[5].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[5].interaction[3].code == "delete" assert inst.rest[0].resource[5].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[5].interaction[4].code == "history-instance" assert inst.rest[0].resource[5].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[5].interaction[5].code == "history-type" assert inst.rest[0].resource[5].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[5].interaction[6].code == "create" assert inst.rest[0].resource[5].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[5].interaction[7].code == "search-type" assert inst.rest[0].resource[5].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[5].profile == "http://hl7.org/fhir/StructureDefinition/Appointment" ) assert inst.rest[0].resource[5].referencePolicy[0] == "literal" assert inst.rest[0].resource[5].referencePolicy[1] == "logical" assert inst.rest[0].resource[5].searchInclude[0] == "Appointment.practitioner" assert inst.rest[0].resource[5].searchInclude[1] == "Appointment.slot" assert inst.rest[0].resource[5].searchInclude[2] == "Appointment.actor" assert inst.rest[0].resource[5].searchInclude[3] == "Appointment.based-on" assert inst.rest[0].resource[5].searchInclude[4] == "Appointment.patient" assert inst.rest[0].resource[5].searchInclude[5] == "Appointment.reason-reference" assert inst.rest[0].resource[5].searchInclude[6] == "Appointment.supporting-info" assert inst.rest[0].resource[5].searchInclude[7] == "Appointment.location" assert ( inst.rest[0].resource[5].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/Appointment-date" ) assert ( inst.rest[0].resource[5].searchParam[0].documentation == "Appointment date/time." ) assert inst.rest[0].resource[5].searchParam[0].name == "date" assert inst.rest[0].resource[5].searchParam[0].type == "date" assert ( inst.rest[0].resource[5].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/Appointment-identifier" ) assert ( inst.rest[0].resource[5].searchParam[1].documentation == "An Identifier of the Appointment" ) assert inst.rest[0].resource[5].searchParam[1].name == "identifier" assert inst.rest[0].resource[5].searchParam[1].type == "token" assert ( inst.rest[0].resource[5].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/Appointment-specialty" ) assert inst.rest[0].resource[5].searchParam[2].documentation == ( "The specialty of a practitioner that would be required to " "perform the service requested in this appointment" ) assert inst.rest[0].resource[5].searchParam[2].name == "specialty" assert inst.rest[0].resource[5].searchParam[2].type == "token" assert inst.rest[0].resource[5].searchParam[3].definition == ( "http://hl7.org/fhir/SearchParameter/Appointment-service-" "category" ) assert inst.rest[0].resource[5].searchParam[3].documentation == ( "A broad categorization of the service that is to be " "performed during this appointment" ) assert inst.rest[0].resource[5].searchParam[3].name == "service-category" assert inst.rest[0].resource[5].searchParam[3].type == "token" assert ( inst.rest[0].resource[5].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/Appointment-practitioner" ) assert inst.rest[0].resource[5].searchParam[4].documentation == ( "One of the individuals of the appointment is this " "practitioner" ) assert inst.rest[0].resource[5].searchParam[4].name == "practitioner" assert inst.rest[0].resource[5].searchParam[4].type == "reference" assert inst.rest[0].resource[5].searchParam[5].definition == ( "http://hl7.org/fhir/SearchParameter/Appointment-appointment-" "type" ) assert inst.rest[0].resource[5].searchParam[5].documentation == ( "The style of appointment or patient that has been booked in " "the slot (not service type)" ) assert inst.rest[0].resource[5].searchParam[5].name == "appointment-type" assert inst.rest[0].resource[5].searchParam[5].type == "token" assert ( inst.rest[0].resource[5].searchParam[6].definition == "http://hl7.org/fhir/SearchParameter/Appointment-part-status" ) assert inst.rest[0].resource[5].searchParam[6].documentation == ( "The Participation status of the subject, or other " "participant on the appointment. Can be used to locate " "participants that have not responded to meeting requests." ) assert inst.rest[0].resource[5].searchParam[6].name == "part-status" assert inst.rest[0].resource[5].searchParam[6].type == "token" assert ( inst.rest[0].resource[5].searchParam[7].definition == "http://hl7.org/fhir/SearchParameter/Appointment-service-type" ) assert inst.rest[0].resource[5].searchParam[7].documentation == ( "The specific service that is to be performed during this " "appointment" ) assert inst.rest[0].resource[5].searchParam[7].name == "service-type" assert inst.rest[0].resource[5].searchParam[7].type == "token" assert ( inst.rest[0].resource[5].searchParam[8].definition == "http://hl7.org/fhir/SearchParameter/Appointment-slot" ) assert ( inst.rest[0].resource[5].searchParam[8].documentation == "The slots that this appointment is filling" ) assert inst.rest[0].resource[5].searchParam[8].name == "slot" assert inst.rest[0].resource[5].searchParam[8].type == "reference" assert ( inst.rest[0].resource[5].searchParam[9].definition == "http://hl7.org/fhir/SearchParameter/Appointment-reason-code" ) assert ( inst.rest[0].resource[5].searchParam[9].documentation == "Coded reason this appointment is scheduled" ) assert inst.rest[0].resource[5].searchParam[9].name == "reason-code" assert inst.rest[0].resource[5].searchParam[9].type == "token" assert ( inst.rest[0].resource[5].searchRevInclude[0] == "AppointmentResponse.appointment" ) assert inst.rest[0].resource[5].searchRevInclude[1] == "CarePlan.activity-reference" assert inst.rest[0].resource[5].searchRevInclude[2] == "Encounter.appointment" assert inst.rest[0].resource[5].searchRevInclude[3] == "ImagingStudy.basedon" assert inst.rest[0].resource[5].type == "Appointment" assert inst.rest[0].resource[6].conditionalCreate is True assert inst.rest[0].resource[6].conditionalDelete == "multiple" assert inst.rest[0].resource[6].conditionalUpdate is True assert inst.rest[0].resource[6].interaction[0].code == "read" assert inst.rest[0].resource[6].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[6].interaction[1].code == "vread" assert inst.rest[0].resource[6].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[6].interaction[2].code == "update" assert inst.rest[0].resource[6].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[6].interaction[3].code == "delete" assert inst.rest[0].resource[6].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[6].interaction[4].code == "history-instance" assert inst.rest[0].resource[6].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[6].interaction[5].code == "history-type" assert inst.rest[0].resource[6].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[6].interaction[6].code == "create" assert inst.rest[0].resource[6].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[6].interaction[7].code == "search-type" assert inst.rest[0].resource[6].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[6].profile == "http://hl7.org/fhir/StructureDefinition/AppointmentResponse" ) assert inst.rest[0].resource[6].referencePolicy[0] == "literal" assert inst.rest[0].resource[6].referencePolicy[1] == "logical" assert inst.rest[0].resource[6].searchInclude[0] == "AppointmentResponse.actor" assert ( inst.rest[0].resource[6].searchInclude[1] == "AppointmentResponse.practitioner" ) assert inst.rest[0].resource[6].searchInclude[2] == "AppointmentResponse.patient" assert ( inst.rest[0].resource[6].searchInclude[3] == "AppointmentResponse.appointment" ) assert inst.rest[0].resource[6].searchInclude[4] == "AppointmentResponse.location" assert inst.rest[0].resource[6].searchParam[0].definition == ( "http://hl7.org/fhir/SearchParameter/AppointmentResponse-" "actor" ) assert inst.rest[0].resource[6].searchParam[0].documentation == ( "The Person, Location/HealthcareService or Device that this " "appointment response replies for" ) assert inst.rest[0].resource[6].searchParam[0].name == "actor" assert inst.rest[0].resource[6].searchParam[0].type == "reference" assert inst.rest[0].resource[6].searchParam[1].definition == ( "http://hl7.org/fhir/SearchParameter/AppointmentResponse-" "identifier" ) assert ( inst.rest[0].resource[6].searchParam[1].documentation == "An Identifier in this appointment response" ) assert inst.rest[0].resource[6].searchParam[1].name == "identifier" assert inst.rest[0].resource[6].searchParam[1].type == "token" assert inst.rest[0].resource[6].searchParam[2].definition == ( "http://hl7.org/fhir/SearchParameter/AppointmentResponse-" "practitioner" ) assert ( inst.rest[0].resource[6].searchParam[2].documentation == "This Response is for this Practitioner" ) assert inst.rest[0].resource[6].searchParam[2].name == "practitioner" assert inst.rest[0].resource[6].searchParam[2].type == "reference" assert inst.rest[0].resource[6].searchParam[3].definition == ( "http://hl7.org/fhir/SearchParameter/AppointmentResponse-" "part-status" ) assert ( inst.rest[0].resource[6].searchParam[3].documentation == "The participants acceptance status for this appointment" ) assert inst.rest[0].resource[6].searchParam[3].name == "part-status" assert inst.rest[0].resource[6].searchParam[3].type == "token" assert inst.rest[0].resource[6].searchParam[4].definition == ( "http://hl7.org/fhir/SearchParameter/AppointmentResponse-" "patient" ) assert ( inst.rest[0].resource[6].searchParam[4].documentation == "This Response is for this Patient" ) assert inst.rest[0].resource[6].searchParam[4].name == "patient" assert inst.rest[0].resource[6].searchParam[4].type == "reference" assert inst.rest[0].resource[6].searchParam[5].definition == ( "http://hl7.org/fhir/SearchParameter/AppointmentResponse-" "appointment" ) assert ( inst.rest[0].resource[6].searchParam[5].documentation == "The appointment that the response is attached to" ) assert inst.rest[0].resource[6].searchParam[5].name == "appointment" assert inst.rest[0].resource[6].searchParam[5].type == "reference" assert inst.rest[0].resource[6].searchParam[6].definition == ( "http://hl7.org/fhir/SearchParameter/AppointmentResponse-" "location" ) assert ( inst.rest[0].resource[6].searchParam[6].documentation == "This Response is for this Location" ) assert inst.rest[0].resource[6].searchParam[6].name == "location" assert inst.rest[0].resource[6].searchParam[6].type == "reference" assert inst.rest[0].resource[6].searchRevInclude[0] == "ImagingStudy.basedon" assert inst.rest[0].resource[6].type == "AppointmentResponse" assert inst.rest[0].resource[7].conditionalCreate is True assert inst.rest[0].resource[7].conditionalDelete == "multiple" assert inst.rest[0].resource[7].conditionalUpdate is True assert inst.rest[0].resource[7].interaction[0].code == "read" assert inst.rest[0].resource[7].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[7].interaction[1].code == "vread" assert inst.rest[0].resource[7].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[7].interaction[2].code == "update" assert inst.rest[0].resource[7].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[7].interaction[3].code == "delete" assert inst.rest[0].resource[7].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[7].interaction[4].code == "history-instance" assert inst.rest[0].resource[7].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[7].interaction[5].code == "history-type" assert inst.rest[0].resource[7].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[7].interaction[6].code == "create" assert inst.rest[0].resource[7].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[7].interaction[7].code == "search-type" assert inst.rest[0].resource[7].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[7].profile == "http://hl7.org/fhir/StructureDefinition/AuditEvent" ) assert inst.rest[0].resource[7].referencePolicy[0] == "literal" assert inst.rest[0].resource[7].referencePolicy[1] == "logical" assert inst.rest[0].resource[7].searchInclude[0] == "AuditEvent.agent" assert inst.rest[0].resource[7].searchInclude[1] == "AuditEvent.source" assert inst.rest[0].resource[7].searchInclude[2] == "AuditEvent.patient" assert inst.rest[0].resource[7].searchInclude[3] == "AuditEvent.entity" assert ( inst.rest[0].resource[7].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/AuditEvent-date" ) assert ( inst.rest[0].resource[7].searchParam[0].documentation == "Time when the event was recorded" ) assert inst.rest[0].resource[7].searchParam[0].name == "date" assert inst.rest[0].resource[7].searchParam[0].type == "date" assert ( inst.rest[0].resource[7].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/AuditEvent-entity-type" ) assert ( inst.rest[0].resource[7].searchParam[1].documentation == "Type of entity involved" ) assert inst.rest[0].resource[7].searchParam[1].name == "entity-type" assert inst.rest[0].resource[7].searchParam[1].type == "token" assert ( inst.rest[0].resource[7].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/AuditEvent-agent" ) assert inst.rest[0].resource[7].searchParam[2].documentation == "Identifier of who" assert inst.rest[0].resource[7].searchParam[2].name == "agent" assert inst.rest[0].resource[7].searchParam[2].type == "reference" assert ( inst.rest[0].resource[7].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/AuditEvent-address" ) assert ( inst.rest[0].resource[7].searchParam[3].documentation == "Identifier for the network access point of the user device" ) assert inst.rest[0].resource[7].searchParam[3].name == "address" assert inst.rest[0].resource[7].searchParam[3].type == "string" assert ( inst.rest[0].resource[7].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/AuditEvent-entity-role" ) assert ( inst.rest[0].resource[7].searchParam[4].documentation == "What role the entity played" ) assert inst.rest[0].resource[7].searchParam[4].name == "entity-role" assert inst.rest[0].resource[7].searchParam[4].type == "token" assert ( inst.rest[0].resource[7].searchParam[5].definition == "http://hl7.org/fhir/SearchParameter/AuditEvent-source" ) assert ( inst.rest[0].resource[7].searchParam[5].documentation == "The identity of source detecting the event" ) assert inst.rest[0].resource[7].searchParam[5].name == "source" assert inst.rest[0].resource[7].searchParam[5].type == "reference" assert ( inst.rest[0].resource[7].searchParam[6].definition == "http://hl7.org/fhir/SearchParameter/AuditEvent-type" ) assert ( inst.rest[0].resource[7].searchParam[6].documentation == "Type/identifier of event" ) assert inst.rest[0].resource[7].searchParam[6].name == "type" assert inst.rest[0].resource[7].searchParam[6].type == "token" assert ( inst.rest[0].resource[7].searchParam[7].definition == "http://hl7.org/fhir/SearchParameter/AuditEvent-altid" ) assert ( inst.rest[0].resource[7].searchParam[7].documentation == "Alternative User identity" ) assert inst.rest[0].resource[7].searchParam[7].name == "altid" assert inst.rest[0].resource[7].searchParam[7].type == "token" assert ( inst.rest[0].resource[7].searchParam[8].definition == "http://hl7.org/fhir/SearchParameter/AuditEvent-site" ) assert ( inst.rest[0].resource[7].searchParam[8].documentation == "Logical source location within the enterprise" ) assert inst.rest[0].resource[7].searchParam[8].name == "site" assert inst.rest[0].resource[7].searchParam[8].type == "token" assert ( inst.rest[0].resource[7].searchParam[9].definition == "http://hl7.org/fhir/SearchParameter/AuditEvent-agent-name" ) assert ( inst.rest[0].resource[7].searchParam[9].documentation == "Human friendly name for the agent" ) assert inst.rest[0].resource[7].searchParam[9].name == "agent-name" assert inst.rest[0].resource[7].searchParam[9].type == "string" assert inst.rest[0].resource[7].type == "AuditEvent" assert inst.rest[0].resource[8].conditionalCreate is True assert inst.rest[0].resource[8].conditionalDelete == "multiple" assert inst.rest[0].resource[8].conditionalUpdate is True assert inst.rest[0].resource[8].interaction[0].code == "read" assert inst.rest[0].resource[8].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[8].interaction[1].code == "vread" assert inst.rest[0].resource[8].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[8].interaction[2].code == "update" assert inst.rest[0].resource[8].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[8].interaction[3].code == "delete" assert inst.rest[0].resource[8].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[8].interaction[4].code == "history-instance" assert inst.rest[0].resource[8].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[8].interaction[5].code == "history-type" assert inst.rest[0].resource[8].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[8].interaction[6].code == "create" assert inst.rest[0].resource[8].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[8].interaction[7].code == "search-type" assert inst.rest[0].resource[8].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[8].profile == "http://hl7.org/fhir/StructureDefinition/Basic" ) assert inst.rest[0].resource[8].referencePolicy[0] == "literal" assert inst.rest[0].resource[8].referencePolicy[1] == "logical" assert inst.rest[0].resource[8].searchInclude[0] == "Basic.author" assert inst.rest[0].resource[8].searchInclude[1] == "Basic.patient" assert inst.rest[0].resource[8].searchInclude[2] == "Basic.subject" assert ( inst.rest[0].resource[8].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/Basic-identifier" ) assert ( inst.rest[0].resource[8].searchParam[0].documentation == "Business identifier" ) assert inst.rest[0].resource[8].searchParam[0].name == "identifier" assert inst.rest[0].resource[8].searchParam[0].type == "token" assert ( inst.rest[0].resource[8].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/Basic-code" ) assert inst.rest[0].resource[8].searchParam[1].documentation == "Kind of Resource" assert inst.rest[0].resource[8].searchParam[1].name == "code" assert inst.rest[0].resource[8].searchParam[1].type == "token" assert ( inst.rest[0].resource[8].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/Basic-author" ) assert inst.rest[0].resource[8].searchParam[2].documentation == "Who created" assert inst.rest[0].resource[8].searchParam[2].name == "author" assert inst.rest[0].resource[8].searchParam[2].type == "reference" assert ( inst.rest[0].resource[8].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/Basic-created" ) assert inst.rest[0].resource[8].searchParam[3].documentation == "When created" assert inst.rest[0].resource[8].searchParam[3].name == "created" assert inst.rest[0].resource[8].searchParam[3].type == "date" assert ( inst.rest[0].resource[8].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/Basic-patient" ) assert ( inst.rest[0].resource[8].searchParam[4].documentation == "Identifies the focus of this resource" ) assert inst.rest[0].resource[8].searchParam[4].name == "patient" assert inst.rest[0].resource[8].searchParam[4].type == "reference" assert ( inst.rest[0].resource[8].searchParam[5].definition == "http://hl7.org/fhir/SearchParameter/Basic-subject" ) assert ( inst.rest[0].resource[8].searchParam[5].documentation == "Identifies the focus of this resource" ) assert inst.rest[0].resource[8].searchParam[5].name == "subject" assert inst.rest[0].resource[8].searchParam[5].type == "reference" assert inst.rest[0].resource[8].type == "Basic" assert inst.rest[0].resource[9].conditionalCreate is True assert inst.rest[0].resource[9].conditionalDelete == "multiple" assert inst.rest[0].resource[9].conditionalUpdate is True assert inst.rest[0].resource[9].interaction[0].code == "read" assert inst.rest[0].resource[9].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[9].interaction[1].code == "vread" assert inst.rest[0].resource[9].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[9].interaction[2].code == "update" assert inst.rest[0].resource[9].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[9].interaction[3].code == "delete" assert inst.rest[0].resource[9].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[9].interaction[4].code == "history-instance" assert inst.rest[0].resource[9].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[9].interaction[5].code == "history-type" assert inst.rest[0].resource[9].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[9].interaction[6].code == "create" assert inst.rest[0].resource[9].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[9].interaction[7].code == "search-type" assert inst.rest[0].resource[9].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[9].profile == "http://hl7.org/fhir/StructureDefinition/Binary" ) assert inst.rest[0].resource[9].referencePolicy[0] == "literal" assert inst.rest[0].resource[9].referencePolicy[1] == "logical" assert inst.rest[0].resource[9].type == "Binary" assert ( inst.rest[0].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/DomainResource-text" ) assert ( inst.rest[0].searchParam[0].documentation == "Search on the narrative of the resource" ) assert inst.rest[0].searchParam[0].name == "_text" assert inst.rest[0].searchParam[0].type == "string" assert ( inst.rest[0].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/id" ) assert inst.rest[0].searchParam[1].documentation == "some doco" assert inst.rest[0].searchParam[1].name == "something" assert inst.rest[0].searchParam[1].type == "string" assert ( inst.rest[0].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/Resource-list" ) assert inst.rest[0].searchParam[2].documentation == ( "Retrieval of resources that are referenced by a List " "resource" ) assert inst.rest[0].searchParam[2].name == "_list" assert inst.rest[0].searchParam[2].type == "token" assert ( inst.rest[0].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/Resource-has" ) assert ( inst.rest[0].searchParam[3].documentation == "Provides support for reverse chaining" ) assert inst.rest[0].searchParam[3].name == "_has" assert inst.rest[0].searchParam[3].type == "composite" assert ( inst.rest[0].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/Resource-type" ) assert ( inst.rest[0].searchParam[4].documentation == "Type of resource (when doing cross-resource search" ) assert inst.rest[0].searchParam[4].name == "_type" assert inst.rest[0].searchParam[4].type == "token" assert ( inst.rest[0].searchParam[5].definition == "http://hl7.org/fhir/SearchParameter/Resource-source" ) assert ( inst.rest[0].searchParam[5].documentation == "How to sort the resources when returning" ) assert inst.rest[0].searchParam[5].name == "_sort" assert inst.rest[0].searchParam[5].type == "token" assert ( inst.rest[0].searchParam[6].definition == "http://hl7.org/fhir/SearchParameter/Resource-count" ) assert inst.rest[0].searchParam[6].documentation == "How many resources to return" assert inst.rest[0].searchParam[6].name == "_count" assert inst.rest[0].searchParam[6].type == "number" assert ( inst.rest[0].searchParam[7].definition == "http://hl7.org/fhir/SearchParameter/Resource-include" ) assert ( inst.rest[0].searchParam[7].documentation == "Control over returning additional resources (see spec)" ) assert inst.rest[0].searchParam[7].name == "_include" assert inst.rest[0].searchParam[7].type == "token" assert ( inst.rest[0].searchParam[8].definition == "http://hl7.org/fhir/SearchParameter/Resource-revinclude" ) assert ( inst.rest[0].searchParam[8].documentation == "Control over returning additional resources (see spec)" ) assert inst.rest[0].searchParam[8].name == "_revinclude" assert inst.rest[0].searchParam[8].type == "token" assert ( inst.rest[0].searchParam[9].definition == "http://hl7.org/fhir/SearchParameter/Resource-summary" ) assert ( inst.rest[0].searchParam[9].documentation == "What kind of information to return" ) assert inst.rest[0].searchParam[9].name == "_summary" assert inst.rest[0].searchParam[9].type == "token" assert inst.rest[0].security.cors is True assert inst.rest[0].security.description == ( "This is the Capability Statement to declare that the server " "supports SMART-on-FHIR. See the SMART-on-FHIR docs for the " "extension that would go with such a server" ) assert inst.rest[0].security.service[0].coding[0].code == "SMART-on-FHIR" assert inst.rest[0].security.service[0].coding[0].display == "SMART-on-FHIR" assert ( inst.rest[0].security.service[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/restful-security-service" } ).valueUri ) assert inst.rest[0].security.service[0].text == "See http://docs.smarthealthit.org/" assert inst.software.name == "Insert your software name here..." assert inst.status == "draft" assert inst.text.status == "extensions" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CapabilityStatement/base"} ).valueUri ) assert inst.version == "4.3.0" def test_capabilitystatement_8(base_settings): """No. 8 tests collection for CapabilityStatement. Test File: capabilitystatement-base.json """ filename = base_settings["unittest_data_dir"] / "capabilitystatement-base.json" inst = capabilitystatement.CapabilityStatement.model_validate_json( filename.read_bytes() ) assert "CapabilityStatement" == inst.get_resource_type() impl_capabilitystatement_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CapabilityStatement" == data["resourceType"] inst2 = capabilitystatement.CapabilityStatement(**data) impl_capabilitystatement_8(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_careplan.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/CarePlan Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import careplan from .conftest import ExternalValidatorModel # noqa: F401 def impl_careplan_1(inst): assert inst.activity[0].detail.code.coding[0].code == "359615001" assert inst.activity[0].detail.code.coding[0].display == "Partial lobectomy of lung" assert ( inst.activity[0].detail.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.activity[0].detail.doNotPerform is True assert inst.activity[0].detail.kind == "ServiceRequest" assert inst.activity[0].detail.performer[0].display == "M.I.M. Versteegh" assert inst.activity[0].detail.performer[0].reference == "Practitioner/f003" assert inst.activity[0].detail.scheduledString == "2011-07-07T09:30:10+01:00" assert inst.activity[0].detail.status == "completed" assert inst.addresses[0].display == "?????" assert inst.addresses[0].reference == "Condition/f201" assert inst.careTeam[0].reference == "#careteam" assert inst.contained[0].id == "careteam" assert inst.contained[1].id == "goal" assert inst.goal[0].reference == "#goal" assert inst.id == "f002" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/zorgportal/identifiers/careplans"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "CP2934" assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-07-07"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2011-07-06"} ).valueDateTime ) assert inst.status == "completed" assert inst.subject.display == "P. van de Heuvel" assert inst.subject.reference == "Patient/f001" assert inst.text.status == "generated" def test_careplan_1(base_settings): """No. 1 tests collection for CarePlan. Test File: careplan-example-f002-lung.json """ filename = base_settings["unittest_data_dir"] / "careplan-example-f002-lung.json" inst = careplan.CarePlan.model_validate_json(filename.read_bytes()) assert "CarePlan" == inst.get_resource_type() impl_careplan_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CarePlan" == data["resourceType"] inst2 = careplan.CarePlan(**data) impl_careplan_1(inst2) def impl_careplan_2(inst): assert inst.activity[0].detail.code.coding[0].code == "367336001" assert inst.activity[0].detail.code.coding[0].display == "Chemotherapy" assert ( inst.activity[0].detail.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.activity[0].detail.doNotPerform is False assert inst.activity[0].detail.kind == "ServiceRequest" assert inst.activity[0].detail.productReference.reference == "#tpf" assert inst.activity[0].detail.status == "in-progress" assert inst.activity[0].outcomeReference[0].display == "Roel's Chemotherapy" assert inst.activity[0].outcomeReference[0].reference == "Procedure/f201" assert inst.addresses[0].display == "Roel's head-neck tumor" assert inst.addresses[0].reference == "Condition/f202" assert inst.careTeam[0].reference == "#careteam" assert inst.contained[0].id == "doce" assert inst.contained[1].id == "cisp" assert inst.contained[2].id == "fluo" assert inst.contained[3].id == "tpf" assert inst.contained[4].id == "careteam" assert inst.contained[5].id == "goal" assert inst.goal[0].reference == "#goal" assert inst.id == "f202" assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "active" assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" def test_careplan_2(base_settings): """No. 2 tests collection for CarePlan. Test File: careplan-example-f202-malignancy.json """ filename = ( base_settings["unittest_data_dir"] / "careplan-example-f202-malignancy.json" ) inst = careplan.CarePlan.model_validate_json(filename.read_bytes()) assert "CarePlan" == inst.get_resource_type() impl_careplan_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CarePlan" == data["resourceType"] inst2 = careplan.CarePlan(**data) impl_careplan_2(inst2) def impl_careplan_3(inst): assert inst.id == "obesity-narrative" assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "active" assert inst.subject.display == "Peter James Chalmers" assert inst.subject.reference == "Patient/example" assert inst.text.status == "additional" def test_careplan_3(base_settings): """No. 3 tests collection for CarePlan. Test File: careplan-example-obesity-narrative.json """ filename = ( base_settings["unittest_data_dir"] / "careplan-example-obesity-narrative.json" ) inst = careplan.CarePlan.model_validate_json(filename.read_bytes()) assert "CarePlan" == inst.get_resource_type() impl_careplan_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CarePlan" == data["resourceType"] inst2 = careplan.CarePlan(**data) impl_careplan_3(inst2) def impl_careplan_4(inst): assert inst.activity[0].detail.code.coding[0].code == "3141-9" assert inst.activity[0].detail.code.coding[0].display == "Weight Measured" assert ( inst.activity[0].detail.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.activity[0].detail.code.coding[1].code == "27113001" assert inst.activity[0].detail.code.coding[1].display == "Body weight" assert ( inst.activity[0].detail.code.coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.activity[0].detail.doNotPerform is False assert inst.activity[0].detail.location.display == "Patient's home" assert inst.activity[0].detail.performer[0].display == "Peter James Chalmers" assert inst.activity[0].detail.performer[0].reference == "Patient/example" assert inst.activity[0].detail.scheduledTiming.repeat.frequency == 1 assert float(inst.activity[0].detail.scheduledTiming.repeat.period) == float(1) assert inst.activity[0].detail.scheduledTiming.repeat.periodUnit == "d" assert inst.activity[0].detail.status == "completed" assert ( inst.activity[0].detail.statusReason.text == "Achieved weight loss to mitigate diabetes risk." ) assert inst.activity[0].outcomeCodeableConcept[0].coding[0].code == "161832001" assert ( inst.activity[0].outcomeCodeableConcept[0].coding[0].display == "Progressive weight loss" ) assert ( inst.activity[0].outcomeCodeableConcept[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.activity[0].outcomeReference[0].display == "Weight Measured" assert inst.activity[0].outcomeReference[0].reference == "Observation/example" assert inst.addresses[0].display == "obesity" assert inst.addresses[0].reference == "#p1" assert inst.author.display == "Dr Adam Careful" assert inst.author.reference == "Practitioner/example" assert inst.basedOn[0].display == "Management of Type 2 Diabetes" assert inst.careTeam[0].reference == "CareTeam/example" assert inst.category[0].text == "Weight management plan" assert inst.contained[0].id == "p1" assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-01"} ).valueDateTime ) assert inst.description == "Manage obesity and weight loss" assert inst.encounter.reference == "Encounter/home" assert inst.goal[0].reference == "Goal/example" assert inst.id == "example" assert inst.identifier[0].value == "12345" assert ( inst.instantiatesUri[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/protocol-for-obesity"} ).valueUri ) assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.partOf[0].display == "Overall wellness plan" assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-06-01"} ).valueDateTime ) assert inst.replaces[0].display == "Plan from urgent care clinic" assert inst.status == "active" assert inst.subject.display == "Peter James Chalmers" assert inst.subject.reference == "Patient/example" assert inst.text.status == "additional" def test_careplan_4(base_settings): """No. 4 tests collection for CarePlan. Test File: careplan-example.json """ filename = base_settings["unittest_data_dir"] / "careplan-example.json" inst = careplan.CarePlan.model_validate_json(filename.read_bytes()) assert "CarePlan" == inst.get_resource_type() impl_careplan_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CarePlan" == data["resourceType"] inst2 = careplan.CarePlan(**data) impl_careplan_4(inst2) def impl_careplan_5(inst): assert inst.activity[0].detail.code.coding[0].code == "284093001" assert inst.activity[0].detail.code.coding[0].display == "Potassium supplementation" assert ( inst.activity[0].detail.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.activity[0].detail.dailyAmount.code == "258718000" assert ( inst.activity[0].detail.dailyAmount.system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.activity[0].detail.dailyAmount.unit == "mmol" assert float(inst.activity[0].detail.dailyAmount.value) == float(80) assert inst.activity[0].detail.doNotPerform is False assert inst.activity[0].detail.kind == "NutritionOrder" assert inst.activity[0].detail.productReference.display == "Potassium" assert inst.activity[0].detail.productReference.reference == "Substance/f203" assert inst.activity[0].detail.scheduledString == "daily" assert inst.activity[0].detail.status == "completed" assert inst.activity[1].detail.code.coding[0].code == "306005" assert inst.activity[1].detail.code.coding[0].display == "Echography of kidney" assert ( inst.activity[1].detail.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.activity[1].detail.doNotPerform is False assert inst.activity[1].detail.kind == "ServiceRequest" assert inst.activity[1].detail.status == "completed" assert inst.addresses[0].display == "Roel's renal insufficiency" assert inst.addresses[0].reference == "Condition/f204" assert inst.careTeam[0].reference == "#careteam" assert inst.contained[0].id == "careteam" assert inst.contained[1].id == "goal" assert inst.goal[0].reference == "#goal" assert inst.id == "f201" assert inst.intent == "proposal" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-13"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-11"} ).valueDateTime ) assert inst.status == "draft" assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" def test_careplan_5(base_settings): """No. 5 tests collection for CarePlan. Test File: careplan-example-f201-renal.json """ filename = base_settings["unittest_data_dir"] / "careplan-example-f201-renal.json" inst = careplan.CarePlan.model_validate_json(filename.read_bytes()) assert "CarePlan" == inst.get_resource_type() impl_careplan_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CarePlan" == data["resourceType"] inst2 = careplan.CarePlan(**data) impl_careplan_5(inst2) def impl_careplan_6(inst): assert inst.activity[0].detail.code.coding[0].code == "nursecon" assert ( inst.activity[0].detail.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/local"} ).valueUri ) assert inst.activity[0].detail.code.text == "Nurse Consultation" assert inst.activity[0].detail.doNotPerform is False assert inst.activity[0].detail.kind == "Appointment" assert inst.activity[0].detail.performer[0].display == "Nurse Nancy" assert inst.activity[0].detail.performer[0].reference == "Practitioner/13" assert ( inst.activity[0].detail.scheduledPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-01T10:50:00+00:00"} ).valueDateTime ) assert ( inst.activity[0].detail.scheduledPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-01T10:38:00+00:00"} ).valueDateTime ) assert inst.activity[0].detail.status == "completed" assert inst.activity[0].outcomeReference[0].reference == "Encounter/example" assert inst.activity[1].detail.code.coding[0].code == "doccon" assert ( inst.activity[1].detail.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/local"} ).valueUri ) assert inst.activity[1].detail.code.text == "Doctor Consultation" assert inst.activity[1].detail.doNotPerform is False assert inst.activity[1].detail.kind == "Appointment" assert inst.activity[1].detail.performer[0].display == "Doctor Dave" assert inst.activity[1].detail.performer[0].reference == "Practitioner/14" assert inst.activity[1].detail.status == "scheduled" assert inst.addresses[0].display == "obesity" assert inst.addresses[0].reference == "#p1" assert inst.careTeam[0].reference == "#careteam" assert inst.contained[0].id == "p1" assert inst.contained[1].id == "careteam" assert inst.contained[2].id == "goal" assert inst.goal[0].reference == "#goal" assert inst.id == "gpvisit" assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-01T10:30:00+00:00"} ).valueDateTime ) assert inst.status == "active" assert inst.subject.display == "Peter James Chalmers" assert inst.subject.reference == "Patient/100" assert inst.text.status == "additional" def test_careplan_6(base_settings): """No. 6 tests collection for CarePlan. Test File: careplan-example-GPVisit.json """ filename = base_settings["unittest_data_dir"] / "careplan-example-GPVisit.json" inst = careplan.CarePlan.model_validate_json(filename.read_bytes()) assert "CarePlan" == inst.get_resource_type() impl_careplan_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CarePlan" == data["resourceType"] inst2 = careplan.CarePlan(**data) impl_careplan_6(inst2) def impl_careplan_7(inst): assert inst.activity[0].detail.description == ( "Eve will review photos of high and low density foods and " "share with her parents" ) assert inst.activity[0].detail.doNotPerform is False assert ( inst.activity[0].detail.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/StructureDefinition/RevisionDate"} ).valueUri ) assert ( inst.activity[0].detail.extension[0].valueDate == ExternalValidatorModel.model_validate({"valueDate": "2012-09-10"}).valueDate ) assert inst.activity[0].detail.goal[0].reference == "#g1" assert ( inst.activity[0].detail.scheduledPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-09-10"} ).valueDateTime ) assert inst.activity[0].detail.status == "not-started" assert ( inst.activity[0].progress[0].text == "Eve eats one meal a day with her parents" ) assert ( inst.activity[0].progress[0].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-09-10"} ).valueDateTime ) assert inst.activity[1].detail.description == ( "Eve will ask her dad to asist her to put the head of her bed" " on blocks" ) assert inst.activity[1].detail.doNotPerform is False assert ( inst.activity[1].detail.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/StructureDefinition/RevisionDate"} ).valueUri ) assert ( inst.activity[1].detail.extension[0].valueDate == ExternalValidatorModel.model_validate({"valueDate": "2012-09-10"}).valueDate ) assert inst.activity[1].detail.goal[0].reference == "#g1" assert inst.activity[1].detail.kind == "CommunicationRequest" assert ( inst.activity[1].detail.scheduledPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-09-10"} ).valueDateTime ) assert inst.activity[1].detail.status == "not-started" assert ( inst.activity[1].progress[0].text == "Eve will sleep in her bed more often than the couch" ) assert ( inst.activity[1].progress[0].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-09-10"} ).valueDateTime ) assert ( inst.activity[2].detail.description == "Eve will reduce her intake of coffee and chocolate" ) assert inst.activity[2].detail.doNotPerform is False assert ( inst.activity[2].detail.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/StructureDefinition/RevisionDate"} ).valueUri ) assert ( inst.activity[2].detail.extension[0].valueDate == ExternalValidatorModel.model_validate({"valueDate": "2012-09-10"}).valueDate ) assert inst.activity[2].detail.goal[0].reference == "#g2" assert ( inst.activity[2].detail.scheduledPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-09-10"} ).valueDateTime ) assert inst.activity[2].detail.status == "in-progress" assert inst.activity[3].detail.description == ( "Eve will walk her friend's dog up and down a big hill 15-30 " "minutes 3 days a week" ) assert inst.activity[3].detail.doNotPerform is False assert ( inst.activity[3].detail.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/StructureDefinition/RevisionDate"} ).valueUri ) assert ( inst.activity[3].detail.extension[0].valueDate == ExternalValidatorModel.model_validate({"valueDate": "2012-09-10"}).valueDate ) assert inst.activity[3].detail.goal[0].reference == "#g3" assert ( inst.activity[3].detail.scheduledPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-08-27"} ).valueDateTime ) assert inst.activity[3].detail.status == "in-progress" assert ( inst.activity[3].progress[0].text == "Eve would like to try for 5 days a week." ) assert ( inst.activity[3].progress[0].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-08-27"} ).valueDateTime ) assert inst.activity[3].progress[1].text == "Eve is still walking the dogs." assert ( inst.activity[3].progress[1].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-09-10"} ).valueDateTime ) assert ( inst.activity[4].detail.description == "Eve will walk 3 blocks to her parents house twice a week" ) assert inst.activity[4].detail.doNotPerform is False assert ( inst.activity[4].detail.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/StructureDefinition/RevisionDate"} ).valueUri ) assert ( inst.activity[4].detail.extension[0].valueDate == ExternalValidatorModel.model_validate({"valueDate": "2012-09-10"}).valueDate ) assert inst.activity[4].detail.goal[0].reference == "#g3" assert ( inst.activity[4].detail.scheduledPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-07-23"} ).valueDateTime ) assert inst.activity[4].detail.status == "in-progress" assert inst.activity[4].progress[0].text == "Eve walked 4 times the last week." assert ( inst.activity[4].progress[0].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-08-13"} ).valueDateTime ) assert inst.activity[4].progress[1].text == ( "Eve did not walk to her parents the last week, but has plans" " to start again" ) assert ( inst.activity[4].progress[1].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-09-10"} ).valueDateTime ) assert inst.activity[5].detail.description == ( "Eve will use a calendar to check off after medications are " "taken" ) assert inst.activity[5].detail.doNotPerform is False assert ( inst.activity[5].detail.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/StructureDefinition/RevisionDate"} ).valueUri ) assert ( inst.activity[5].detail.extension[0].valueDate == ExternalValidatorModel.model_validate({"valueDate": "2012-08-13"}).valueDate ) assert inst.activity[5].detail.goal[0].reference == "#g4" assert ( inst.activity[5].detail.scheduledPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-07-23"} ).valueDateTime ) assert inst.activity[5].detail.status == "in-progress" assert ( inst.activity[6].detail.description == "Eve will use her lights MWF after her shower for 3 minutes" ) assert inst.activity[6].detail.doNotPerform is False assert ( inst.activity[6].detail.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/StructureDefinition/RevisionDate"} ).valueUri ) assert ( inst.activity[6].detail.extension[0].valueDate == ExternalValidatorModel.model_validate({"valueDate": "2012-08-27"}).valueDate ) assert inst.activity[6].detail.goal[0].reference == "#g5" assert ( inst.activity[6].detail.scheduledPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-07-23"} ).valueDateTime ) assert inst.activity[6].detail.status == "in-progress" assert inst.activity[6].progress[0].text == ( "After restarting the vinegar soaks the psoriasis is improved" " and Eve plans to treat the remainder with light treatments." " She plans to start this week." ) assert ( inst.activity[6].progress[0].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-08-13"} ).valueDateTime ) assert inst.activity[6].progress[1].text == ( "Since her skin is improved Eve has not been using the light " "treatment as often, maybe once a week. She would like to " "increase to 3 times a week again" ) assert ( inst.activity[6].progress[1].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-08-27"} ).valueDateTime ) assert inst.activity[7].detail.description == ( "Eve will use a calendar of a chart to help her remember when" " to take her medications" ) assert inst.activity[7].detail.doNotPerform is False assert ( inst.activity[7].detail.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/StructureDefinition/RevisionDate"} ).valueUri ) assert ( inst.activity[7].detail.extension[0].valueDate == ExternalValidatorModel.model_validate({"valueDate": "2012-09-10"}).valueDate ) assert inst.activity[7].detail.goal[0].reference == "#g4" assert ( inst.activity[7].detail.scheduledPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-07-10"} ).valueDateTime ) assert inst.activity[7].detail.status == "in-progress" assert inst.activity[7].progress[0].text == ( "Eve created a chart as a reminer to take the medications " "that do not fit in her pill box" ) assert ( inst.activity[7].progress[0].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-07-23"} ).valueDateTime ) assert inst.activity[8].detail.description == ( "Eve will start using stretch bands and one step 2 days a " "week Mon/Wed 6-7am and maybe Friday afternoon" ) assert inst.activity[8].detail.doNotPerform is False assert ( inst.activity[8].detail.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/StructureDefinition/RevisionDate"} ).valueUri ) assert ( inst.activity[8].detail.extension[0].valueDate == ExternalValidatorModel.model_validate({"valueDate": "2012-08-23"}).valueDate ) assert inst.activity[8].detail.goal[0].reference == "#g3" assert ( inst.activity[8].detail.scheduledPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-07-23"} ).valueDateTime ) assert inst.activity[8].detail.status == "on-hold" assert inst.activity[8].progress[0].text == "Will be able to esume exercise." assert ( inst.activity[8].progress[0].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-07-30"} ).valueDateTime ) assert ( inst.activity[8].progress[1].text == "Eve prefers to focus on walking at this time" ) assert ( inst.activity[8].progress[1].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-08-13"} ).valueDateTime ) assert inst.activity[9].detail.description == ( "Eve will match a printed medication worksheet with the " "medication bottles at home" ) assert inst.activity[9].detail.doNotPerform is False assert ( inst.activity[9].detail.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/StructureDefinition/RevisionDate"} ).valueUri ) assert ( inst.activity[9].detail.extension[0].valueDate == ExternalValidatorModel.model_validate({"valueDate": "2012-07-23"}).valueDate ) assert inst.activity[9].detail.goal[0].reference == "#g4" assert ( inst.activity[9].detail.scheduledPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-07-10"} ).valueDateTime ) assert inst.activity[9].detail.status == "completed" assert inst.addresses[0].display == "GERDS" assert inst.addresses[0].reference == "#p1" assert inst.addresses[1].display == "Obesity" assert inst.addresses[1].reference == "#p2" assert inst.addresses[2].display == "Psoriasis" assert inst.addresses[2].reference == "#p3" assert inst.contained[0].id == "p1" assert inst.contained[1].id == "p2" assert inst.contained[2].id == "p3" assert inst.contained[3].id == "g1" assert inst.contained[4].id == "g2" assert inst.contained[5].id == "g3" assert inst.contained[6].id == "g4" assert inst.contained[7].id == "g5" assert inst.goal[0].reference == "#g1" assert inst.goal[1].reference == "#g2" assert inst.goal[2].reference == "#g3" assert inst.goal[3].reference == "#g4" assert inst.goal[4].reference == "#g5" assert inst.id == "integrate" assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == ( "Patient family is not ready to commit to goal setting at " "this time. Goal setting will be addressed in the future" ) assert inst.status == "active" assert inst.subject.display == "Eve Everywoman" assert inst.subject.reference == "Patient/1" assert inst.text.status == "generated" def test_careplan_7(base_settings): """No. 7 tests collection for CarePlan. Test File: careplan-example-integrated.json """ filename = base_settings["unittest_data_dir"] / "careplan-example-integrated.json" inst = careplan.CarePlan.model_validate_json(filename.read_bytes()) assert "CarePlan" == inst.get_resource_type() impl_careplan_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CarePlan" == data["resourceType"] inst2 = careplan.CarePlan(**data) impl_careplan_7(inst2) def impl_careplan_8(inst): assert inst.activity[0].detail.code.coding[0].code == "172960003" assert ( inst.activity[0].detail.code.coding[0].display == "Incision of retropharyngeal abscess" ) assert ( inst.activity[0].detail.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.activity[0].detail.doNotPerform is True assert inst.activity[0].detail.kind == "ServiceRequest" assert inst.activity[0].detail.performer[0].display == "E.M. van den broek" assert inst.activity[0].detail.performer[0].reference == "Practitioner/f001" assert inst.activity[0].detail.scheduledString == "2011-06-27T09:30:10+01:00" assert inst.activity[0].detail.status == "completed" assert inst.addresses[0].display == "?????" assert inst.addresses[0].reference == "Condition/f201" assert inst.careTeam[0].reference == "#careteam" assert inst.contained[0].id == "careteam" assert inst.contained[1].id == "goal" assert inst.goal[0].reference == "#goal" assert inst.id == "f003" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/zorgportal/identifiers/careplans"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "CP3953" assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-08T09:30:10+01:00"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-08T09:00:10+01:00"} ).valueDateTime ) assert inst.status == "completed" assert inst.subject.display == "P. van de Heuvel" assert inst.subject.reference == "Patient/f001" assert inst.text.status == "generated" def test_careplan_8(base_settings): """No. 8 tests collection for CarePlan. Test File: careplan-example-f003-pharynx.json """ filename = base_settings["unittest_data_dir"] / "careplan-example-f003-pharynx.json" inst = careplan.CarePlan.model_validate_json(filename.read_bytes()) assert "CarePlan" == inst.get_resource_type() impl_careplan_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CarePlan" == data["resourceType"] inst2 = careplan.CarePlan(**data) impl_careplan_8(inst2) def impl_careplan_9(inst): assert inst.activity[0].detail.code.coding[0].code == "64915003" assert inst.activity[0].detail.code.coding[0].display == "Operation on heart" assert ( inst.activity[0].detail.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.activity[0].detail.doNotPerform is True assert inst.activity[0].detail.kind == "ServiceRequest" assert inst.activity[0].detail.performer[0].display == "P. Voigt" assert inst.activity[0].detail.performer[0].reference == "Practitioner/f002" assert inst.activity[0].detail.scheduledString == "2011-06-27T09:30:10+01:00" assert inst.activity[0].detail.status == "completed" assert inst.addresses[0].display == "?????" assert inst.addresses[0].reference == "Condition/f201" assert inst.careTeam[0].reference == "#careteam" assert inst.contained[0].id == "careteam" assert inst.contained[1].id == "goal" assert inst.goal[0].reference == "#goal" assert inst.id == "f001" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/zorgportal/identifiers/careplans"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "CP2903" assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2011-06-27"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2011-06-26"} ).valueDateTime ) assert inst.status == "completed" assert inst.subject.display == "P. van de Heuvel" assert inst.subject.reference == "Patient/f001" assert inst.text.status == "generated" def test_careplan_9(base_settings): """No. 9 tests collection for CarePlan. Test File: careplan-example-f001-heart.json """ filename = base_settings["unittest_data_dir"] / "careplan-example-f001-heart.json" inst = careplan.CarePlan.model_validate_json(filename.read_bytes()) assert "CarePlan" == inst.get_resource_type() impl_careplan_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CarePlan" == data["resourceType"] inst2 = careplan.CarePlan(**data) impl_careplan_9(inst2) def impl_careplan_10(inst): assert inst.activity[0].reference.display == "Prenatal vitamin MedicationRequest" assert inst.activity[1].detail.code.coding[0].code == "1an" assert ( inst.activity[1].detail.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/mySystem"} ).valueUri ) assert inst.activity[1].detail.code.text == "First Antenatal encounter" assert inst.activity[1].detail.description == ( "The first antenatal encounter. This is where a detailed " "physical examination is performed. and the " "pregnanacy discussed with the mother-to-be." ) assert inst.activity[1].detail.doNotPerform is False assert inst.activity[1].detail.kind == "Appointment" assert inst.activity[1].detail.performer[0].display == "Mavis Midwife" assert inst.activity[1].detail.performer[0].reference == "#pr1" assert ( inst.activity[1].detail.scheduledTiming.repeat.boundsPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-02-28"} ).valueDateTime ) assert ( inst.activity[1].detail.scheduledTiming.repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-02-14"} ).valueDateTime ) assert inst.activity[1].detail.status == "scheduled" assert ( inst.activity[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/fhir/StructureDefinition/careplan#andetails" } ).valueUri ) assert ( inst.activity[1].extension[0].valueUri == ExternalValidatorModel.model_validate( {"valueUri": "http://orionhealth.com/fhir/careplan/1andetails"} ).valueUri ) assert inst.activity[2].detail.code.coding[0].code == "an" assert ( inst.activity[2].detail.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/mySystem"} ).valueUri ) assert inst.activity[2].detail.code.text == "Follow-up Antenatal encounter" assert inst.activity[2].detail.description == ( "The second antenatal encounter. Discuss any issues that " "arose from the first antenatal encounter" ) assert inst.activity[2].detail.doNotPerform is False assert inst.activity[2].detail.kind == "Appointment" assert inst.activity[2].detail.performer[0].display == "Mavis Midwife" assert inst.activity[2].detail.performer[0].reference == "#pr1" assert ( inst.activity[2].detail.scheduledTiming.repeat.boundsPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-14"} ).valueDateTime ) assert ( inst.activity[2].detail.scheduledTiming.repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-01"} ).valueDateTime ) assert inst.activity[2].detail.status == "not-started" assert inst.activity[3].detail.code.coding[0].code == "del" assert ( inst.activity[3].detail.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/mySystem"} ).valueUri ) assert inst.activity[3].detail.code.text == "Delivery" assert inst.activity[3].detail.description == "The delivery." assert inst.activity[3].detail.doNotPerform is False assert inst.activity[3].detail.kind == "Appointment" assert inst.activity[3].detail.performer[0].display == "Mavis Midwife" assert inst.activity[3].detail.performer[0].reference == "#pr1" assert ( inst.activity[3].detail.scheduledTiming.repeat.boundsPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-09-14"} ).valueDateTime ) assert ( inst.activity[3].detail.scheduledTiming.repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-09-01"} ).valueDateTime ) assert inst.activity[3].detail.status == "not-started" assert inst.addresses[0].display == "pregnancy" assert inst.addresses[0].reference == "#p1" assert inst.careTeam[0].reference == "#careteam" assert inst.contained[0].id == "p1" assert inst.contained[1].id == "pr1" assert inst.contained[2].id == "pr2" assert inst.contained[3].id == "careteam" assert inst.contained[4].id == "goal" assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/StructureDefinition/careplan#lmp"} ).valueUri ) assert ( inst.extension[0].valueDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-01"} ).valueDateTime ) assert inst.goal[0].reference == "#goal" assert inst.id == "preg" assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-10-01"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-01"} ).valueDateTime ) assert inst.status == "active" assert inst.subject.display == "Eve Everywoman" assert inst.subject.reference == "Patient/1" assert inst.text.status == "additional" def test_careplan_10(base_settings): """No. 10 tests collection for CarePlan. Test File: careplan-example-pregnancy.json """ filename = base_settings["unittest_data_dir"] / "careplan-example-pregnancy.json" inst = careplan.CarePlan.model_validate_json(filename.read_bytes()) assert "CarePlan" == inst.get_resource_type() impl_careplan_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CarePlan" == data["resourceType"] inst2 = careplan.CarePlan(**data) impl_careplan_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_careteam.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/CareTeam Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import careteam from .conftest import ExternalValidatorModel # noqa: F401 def impl_careteam_1(inst): assert inst.category[0].coding[0].code == "LA27976-2" assert inst.category[0].coding[0].display == "Encounter-focused care team" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.contained[0].id == "pr1" assert inst.encounter.reference == "Encounter/example" assert inst.id == "example" assert inst.identifier[0].value == "12345" assert inst.managingOrganization[0].reference == "Organization/f001" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Peter James Charlmers Care Plan for Inpatient Encounter" assert inst.participant[0].member.display == "Peter James Chalmers" assert inst.participant[0].member.reference == "Patient/example" assert inst.participant[0].role[0].text == "responsiblePerson" assert inst.participant[1].member.display == "Dorothy Dietition" assert inst.participant[1].member.reference == "#pr1" assert inst.participant[1].onBehalfOf.reference == "Organization/f001" assert ( inst.participant[1].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-01"} ).valueDateTime ) assert inst.participant[1].role[0].text == "adviser" assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-01"} ).valueDateTime ) assert inst.status == "active" assert inst.subject.display == "Peter James Chalmers" assert inst.subject.reference == "Patient/example" assert inst.text.div == '
Care Team
' assert inst.text.status == "generated" def test_careteam_1(base_settings): """No. 1 tests collection for CareTeam. Test File: careteam-example.json """ filename = base_settings["unittest_data_dir"] / "careteam-example.json" inst = careteam.CareTeam.model_validate_json(filename.read_bytes()) assert "CareTeam" == inst.get_resource_type() impl_careteam_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CareTeam" == data["resourceType"] inst2 = careteam.CareTeam(**data) impl_careteam_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_catalogentry.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/CatalogEntry Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import catalogentry from .conftest import ExternalValidatorModel # noqa: F401 def impl_catalogentry_1(inst): assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.com/identifier"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.orderable is True assert inst.referencedItem.reference == "Medication/123" assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" assert inst.type.text == "Medication" def test_catalogentry_1(base_settings): """No. 1 tests collection for CatalogEntry. Test File: catalogentry-example.json """ filename = base_settings["unittest_data_dir"] / "catalogentry-example.json" inst = catalogentry.CatalogEntry.model_validate_json(filename.read_bytes()) assert "CatalogEntry" == inst.get_resource_type() impl_catalogentry_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CatalogEntry" == data["resourceType"] inst2 = catalogentry.CatalogEntry(**data) impl_catalogentry_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_chargeitem.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ChargeItem Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import chargeitem from .conftest import ExternalValidatorModel # noqa: F401 def impl_chargeitem_1(inst): assert inst.account[0].reference == "Account/example" assert inst.code.coding[0].code == "01510" assert inst.code.coding[0].display == ( "Zusatzpauschale für Beobachtung nach diagnostischer " "Koronarangiografie" ) assert inst.context.reference == "Encounter/example" assert ( inst.definitionUri[0] == ExternalValidatorModel.model_validate( { "valueUri": "http://www.kbv.de/tools/ebm/html/01520_2904360860826220813632.html" } ).valueUri ) assert ( inst.enteredDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-25T23:55:04+01:00"} ).valueDateTime ) assert inst.enterer.reference == "Practitioner/example" assert float(inst.factorOverride) == float(0.8) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://myHospital.org/ChargeItems"} ).valueUri ) assert inst.identifier[0].value == "654321" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].authorReference.reference == "Practitioner/example" assert inst.note[0].text == "The code is only applicable for periods longer than 4h" assert ( inst.note[0].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-25T23:55:04+01:00"} ).valueDateTime ) assert ( inst.occurrencePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-25T12:35:00+01:00"} ).valueDateTime ) assert ( inst.occurrencePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-25T08:00:00+01:00"} ).valueDateTime ) assert inst.overrideReason == ( "Patient is Cardiologist's golf buddy, so he gets a 20% " "discount!" ) assert inst.performer[0].actor.reference == "Practitioner/example" assert inst.performer[0].function.coding[0].code == "17561000" assert inst.performer[0].function.coding[0].display == "Cardiologist" assert ( inst.performer[0].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.performer[1].actor.reference == "Practitioner/example" assert inst.performer[1].function.coding[0].code == "224542009" assert inst.performer[1].function.coding[0].display == "Coronary Care Nurse" assert ( inst.performer[1].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.performingOrganization.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://myhospital/NamingSystem/departments"} ).valueUri ) assert inst.performingOrganization.identifier.value == "CARD_INTERMEDIATE_CARE" assert inst.priceOverride.currency == "EUR" assert float(inst.priceOverride.value) == float(40) assert float(inst.quantity.value) == float(1) assert inst.reason[0].coding[0].code == "I51.6" assert inst.reason[0].coding[0].display == "Cardiovascular disease, unspecified" assert ( inst.reason[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/icd-10"} ).valueUri ) assert ( inst.requestingOrganization.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://myhospital/NamingSystem/departments"} ).valueUri ) assert inst.requestingOrganization.identifier.value == "CARD_U1" assert inst.service[0].reference == "Procedure/example" assert inst.status == "billable" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Example of ' "ChargeItem Usage in Context of the German EBM Billing code " "system
" ) assert inst.text.status == "generated" def test_chargeitem_1(base_settings): """No. 1 tests collection for ChargeItem. Test File: chargeitem-example.json """ filename = base_settings["unittest_data_dir"] / "chargeitem-example.json" inst = chargeitem.ChargeItem.model_validate_json(filename.read_bytes()) assert "ChargeItem" == inst.get_resource_type() impl_chargeitem_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ChargeItem" == data["resourceType"] inst2 = chargeitem.ChargeItem(**data) impl_chargeitem_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_chargeitemdefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ChargeItemDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import chargeitemdefinition from .conftest import ExternalValidatorModel # noqa: F401 def impl_chargeitemdefinition_1(inst): assert ( inst.applicability[0].description == "Verify ChargeItem pertains to Device 12345" ) assert ( inst.applicability[0].expression == "%context.service.suppliedItem='Device/12345'" ) assert inst.applicability[0].language == "text/fhirpath" assert inst.description == "Financial details for custom made device" assert inst.experimental is True assert inst.id == "device" assert inst.instance[0].reference == "Device/12345" assert inst.propertyGroup[0].priceComponent[0].amount.currency == "EUR" assert float(inst.propertyGroup[0].priceComponent[0].amount.value) == float(67.44) assert inst.propertyGroup[0].priceComponent[0].code.coding[0].code == "VK" assert ( inst.propertyGroup[0].priceComponent[0].code.coding[0].display == "Verkaufspreis (netto)" ) assert ( inst.propertyGroup[0].priceComponent[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://fhir.de/CodeSystem/billing-attributes"} ).valueUri ) assert inst.propertyGroup[0].priceComponent[0].type == "base" assert inst.propertyGroup[1].applicability[0].description == "Gültigkeit Steuersatz" assert ( inst.propertyGroup[1].applicability[0].expression == "%context.occurenceDateTime > '2018-04-01'" ) assert inst.propertyGroup[1].applicability[0].language == "text/fhirpath" assert inst.propertyGroup[1].priceComponent[0].code.coding[0].code == "MWST" assert ( inst.propertyGroup[1].priceComponent[0].code.coding[0].display == "Mehrwersteuersatz" ) assert ( inst.propertyGroup[1].priceComponent[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://fhir.de/CodeSystem/billing-attributes"} ).valueUri ) assert float(inst.propertyGroup[1].priceComponent[0].factor) == float(1.19) assert inst.propertyGroup[1].priceComponent[0].type == "tax" assert inst.propertyGroup[2].applicability[0].description == "Gültigkeit Steuersatz" assert ( inst.propertyGroup[2].applicability[0].expression == "%context.occurenceDateTime <= '2018-04-01'" ) assert inst.propertyGroup[2].applicability[0].language == "text/fhirpath" assert inst.propertyGroup[2].priceComponent[0].code.coding[0].code == "MWST" assert ( inst.propertyGroup[2].priceComponent[0].code.coding[0].display == "Mehrwersteuersatz" ) assert ( inst.propertyGroup[2].priceComponent[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://fhir.de/CodeSystem/billing-attributes"} ).valueUri ) assert float(inst.propertyGroup[2].priceComponent[0].factor) == float(1.07) assert inst.propertyGroup[2].priceComponent[0].type == "tax" assert inst.status == "active" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://sap.org/ChargeItemDefinition/device-123"} ).valueUri ) def test_chargeitemdefinition_1(base_settings): """No. 1 tests collection for ChargeItemDefinition. Test File: chargeitemdefinition-device-example.json """ filename = ( base_settings["unittest_data_dir"] / "chargeitemdefinition-device-example.json" ) inst = chargeitemdefinition.ChargeItemDefinition.model_validate_json( filename.read_bytes() ) assert "ChargeItemDefinition" == inst.get_resource_type() impl_chargeitemdefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ChargeItemDefinition" == data["resourceType"] inst2 = chargeitemdefinition.ChargeItemDefinition(**data) impl_chargeitemdefinition_1(inst2) def impl_chargeitemdefinition_2(inst): assert ( inst.applicability[0].description == "Excludes billing code 13250 for same Encounter" ) assert inst.applicability[0].expression == "[some CQL expression]" assert inst.applicability[0].language == "text/cql" assert inst.applicability[1].description == "Applies only once per Encounter" assert inst.applicability[1].expression == "[some CQL expression]" assert inst.applicability[1].language == "text/CQL" assert inst.code.coding[0].code == "30110" assert inst.code.coding[0].display == "Allergologiediagnostik I" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://fhir.de/CodingSystem/kbv/ebm"} ).valueUri ) assert inst.description == ( "Allergologisch-diagnostischer Komplex zur Diagnostik " "und/oder zum Ausschluss einer (Kontakt-)Allergie vom Spättyp" " (Typ IV), einschl. Kosten" ) assert ( inst.effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-06-30"} ).valueDateTime ) assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-04-01"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "ebm" assert inst.propertyGroup[0].priceComponent[0].amount.currency == "EUR" assert float(inst.propertyGroup[0].priceComponent[0].amount.value) == float(67.44) assert inst.propertyGroup[0].priceComponent[0].code.coding[0].code == "gesamt-euro" assert ( inst.propertyGroup[0].priceComponent[0].code.coding[0].display == "Gesamt (Euro)" ) assert ( inst.propertyGroup[0].priceComponent[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://fhir.de/CodeSystem/kbv/ebm-attribute"} ).valueUri ) assert inst.propertyGroup[0].priceComponent[0].type == "base" assert ( inst.propertyGroup[0].priceComponent[1].code.coding[0].code == "gesamt-punkte" ) assert ( inst.propertyGroup[0].priceComponent[1].code.coding[0].display == "Gesamt (Punkte)" ) assert ( inst.propertyGroup[0].priceComponent[1].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://fhir.de/CodeSystem/kbv/ebm-attribute"} ).valueUri ) assert float(inst.propertyGroup[0].priceComponent[1].factor) == float(633) assert inst.propertyGroup[0].priceComponent[1].type == "informational" assert inst.status == "active" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://fhir.de/ChargeItemDefinition/kbv/ebm-30110"} ).valueUri ) assert inst.version == "2-2018" def test_chargeitemdefinition_2(base_settings): """No. 2 tests collection for ChargeItemDefinition. Test File: chargeitemdefinition-ebm-example.json """ filename = ( base_settings["unittest_data_dir"] / "chargeitemdefinition-ebm-example.json" ) inst = chargeitemdefinition.ChargeItemDefinition.model_validate_json( filename.read_bytes() ) assert "ChargeItemDefinition" == inst.get_resource_type() impl_chargeitemdefinition_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ChargeItemDefinition" == data["resourceType"] inst2 = chargeitemdefinition.ChargeItemDefinition(**data) impl_chargeitemdefinition_2(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_citation.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Citation Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import citation from .conftest import ExternalValidatorModel # noqa: F401 def impl_citation_1(inst): assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "draft" assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" def test_citation_1(base_settings): """No. 1 tests collection for Citation. Test File: citation-example.json """ filename = base_settings["unittest_data_dir"] / "citation-example.json" inst = citation.Citation.model_validate_json(filename.read_bytes()) assert "Citation" == inst.get_resource_type() impl_citation_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Citation" == data["resourceType"] inst2 = citation.Citation(**data) impl_citation_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_claim.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Claim Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import claim from .conftest import ExternalValidatorModel # noqa: F401 def impl_claim_1(inst): assert ( inst.accident.date == ExternalValidatorModel.model_validate({"valueDate": "2014-07-09"}).valueDate ) assert inst.accident.locationAddress.text == "Grouse Mountain Ski Hill" assert inst.accident.type.coding[0].code == "SPT" assert inst.accident.type.coding[0].display == "Sporting Accident" assert ( inst.accident.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActIncidentCode"} ).valueUri ) assert ( inst.billablePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert ( inst.billablePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-15"} ).valueDateTime ) assert inst.careTeam[0].provider.reference == "Practitioner/example" assert inst.careTeam[0].qualification.coding[0].code == "physician" assert ( inst.careTeam[0].qualification.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/provider-qualification"} ).valueUri ) assert inst.careTeam[0].responsible is True assert inst.careTeam[0].role.coding[0].code == "primary" assert ( inst.careTeam[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/claim-careteamrole"} ).valueUri ) assert inst.careTeam[0].sequence == 1 assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == "654456" assert inst.diagnosis[0].packageCode.coding[0].code == "400" assert inst.diagnosis[0].packageCode.coding[0].display == "Head trauma - concussion" assert ( inst.diagnosis[0].packageCode.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/ex-diagnosisrelatedgroup" } ).valueUri ) assert inst.diagnosis[0].sequence == 1 assert inst.diagnosis[0].type[0].coding[0].code == "admitting" assert ( inst.diagnosis[0].type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype"} ).valueUri ) assert ( inst.enterer.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://jurisdiction.org/facilities/HOSP1234/users"} ).valueUri ) assert inst.enterer.identifier.value == "UC1234" assert ( inst.facility.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://jurisdiction.org/facilities"} ).valueUri ) assert inst.facility.identifier.value == "HOSP1234" assert inst.id == "960151" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyhospital.com/claim"} ).valueUri ) assert inst.identifier[0].value == "96123451" assert inst.insurance[0].businessArrangement == "BA987123" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].focal is True assert inst.insurance[0].preAuthRef[0] == "PA2014G56473" assert inst.insurance[0].sequence == 1 assert inst.insurer.reference == "Organization/2" assert inst.item[0].careTeamSequence[0] == 1 assert inst.item[0].net.currency == "USD" assert float(inst.item[0].net.value) == float(125.0) assert inst.item[0].productOrService.coding[0].code == "exam" assert ( inst.item[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ex-serviceproduct"} ).valueUri ) assert inst.item[0].sequence == 1 assert ( inst.item[0].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert inst.item[0].unitPrice.currency == "USD" assert float(inst.item[0].unitPrice.value) == float(125.0) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/1" assert inst.payee.type.coding[0].code == "provider" assert inst.priority.coding[0].code == "normal" assert ( inst.provider.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://npid.org/providerid"} ).valueUri ) assert inst.provider.identifier.value == "NJ12345" assert inst.status == "active" assert inst.supportingInfo[0].category.coding[0].code == "employmentimpacted" assert ( inst.supportingInfo[0].category.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/claiminformationcategory" } ).valueUri ) assert inst.supportingInfo[0].sequence == 1 assert ( inst.supportingInfo[0].timingPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert ( inst.supportingInfo[0].timingPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.supportingInfo[1].category.coding[0].code == "hospitalized" assert ( inst.supportingInfo[1].category.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/claiminformationcategory" } ).valueUri ) assert inst.supportingInfo[1].sequence == 2 assert ( inst.supportingInfo[1].timingPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert ( inst.supportingInfo[1].timingPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-15"} ).valueDateTime ) assert inst.text.div == ( '
A human-readable' " rendering of the Claim
" ) assert inst.text.status == "generated" assert inst.total.currency == "USD" assert float(inst.total.value) == float(125.0) assert inst.type.coding[0].code == "institutional" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claim_1(base_settings): """No. 1 tests collection for Claim. Test File: claim-example-institutional-rich.json """ filename = ( base_settings["unittest_data_dir"] / "claim-example-institutional-rich.json" ) inst = claim.Claim.model_validate_json(filename.read_bytes()) assert "Claim" == inst.get_resource_type() impl_claim_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Claim" == data["resourceType"] inst2 = claim.Claim(**data) impl_claim_1(inst2) def impl_claim_2(inst): assert inst.careTeam[0].provider.reference == "Practitioner/example" assert inst.careTeam[0].sequence == 1 assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == "654456" assert inst.diagnosis[0].sequence == 1 assert inst.id == "860150" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happypdocs.com/claim"} ).valueUri ) assert inst.identifier[0].value == "8612345" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].focal is True assert inst.insurance[0].sequence == 1 assert inst.insurer.reference == "Organization/2" assert inst.item[0].careTeamSequence[0] == 1 assert inst.item[0].net.currency == "USD" assert float(inst.item[0].net.value) == float(75.0) assert inst.item[0].productOrService.coding[0].code == "exam" assert ( inst.item[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ex-serviceproduct"} ).valueUri ) assert inst.item[0].sequence == 1 assert ( inst.item[0].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert inst.item[0].unitPrice.currency == "USD" assert float(inst.item[0].unitPrice.value) == float(75.0) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/1" assert inst.payee.type.coding[0].code == "provider" assert inst.priority.coding[0].code == "normal" assert inst.provider.reference == "Organization/1" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the Claim
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "professional" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claim_2(base_settings): """No. 2 tests collection for Claim. Test File: claim-example-professional.json """ filename = base_settings["unittest_data_dir"] / "claim-example-professional.json" inst = claim.Claim.model_validate_json(filename.read_bytes()) assert "Claim" == inst.get_resource_type() impl_claim_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Claim" == data["resourceType"] inst2 = claim.Claim(**data) impl_claim_2(inst2) def impl_claim_3(inst): assert inst.careTeam[0].provider.reference == "Practitioner/example" assert inst.careTeam[0].sequence == 1 assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == "123456" assert inst.diagnosis[0].sequence == 1 assert inst.id == "100150" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/claim"} ).valueUri ) assert inst.identifier[0].value == "12345" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].focal is True assert ( inst.insurance[0].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/claim"} ).valueUri ) assert inst.insurance[0].identifier.value == "12345" assert inst.insurance[0].sequence == 1 assert inst.insurer.reference == "Organization/2" assert inst.item[0].careTeamSequence[0] == 1 assert inst.item[0].net.currency == "USD" assert float(inst.item[0].net.value) == float(135.57) assert inst.item[0].productOrService.coding[0].code == "1200" assert inst.item[0].sequence == 1 assert ( inst.item[0].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert inst.item[0].unitPrice.currency == "USD" assert float(inst.item[0].unitPrice.value) == float(135.57) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/1" assert inst.payee.type.coding[0].code == "provider" assert inst.priority.coding[0].code == "normal" assert inst.provider.reference == "Organization/1" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the Oral Health Claim
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "oral" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claim_3(base_settings): """No. 3 tests collection for Claim. Test File: claim-example.json """ filename = base_settings["unittest_data_dir"] / "claim-example.json" inst = claim.Claim.model_validate_json(filename.read_bytes()) assert "Claim" == inst.get_resource_type() impl_claim_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Claim" == data["resourceType"] inst2 = claim.Claim(**data) impl_claim_3(inst2) def impl_claim_4(inst): assert inst.careTeam[0].provider.reference == "Practitioner/example" assert inst.careTeam[0].sequence == 1 assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == "654321" assert inst.diagnosis[0].sequence == 1 assert inst.id == "660150" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happysight.com/claim"} ).valueUri ) assert inst.identifier[0].value == "6612345" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].focal is True assert inst.insurance[0].sequence == 1 assert inst.insurer.reference == "Organization/2" assert inst.item[0].careTeamSequence[0] == 1 assert inst.item[0].net.currency == "USD" assert float(inst.item[0].net.value) == float(80.0) assert inst.item[0].productOrService.coding[0].code == "exam" assert ( inst.item[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/ex-visionservice"} ).valueUri ) assert inst.item[0].sequence == 1 assert ( inst.item[0].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert inst.item[0].unitPrice.currency == "USD" assert float(inst.item[0].unitPrice.value) == float(80.0) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/1" assert inst.payee.type.coding[0].code == "provider" assert inst.priority.coding[0].code == "normal" assert inst.provider.reference == "Organization/1" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the Vision Claim
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "vision" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claim_4(base_settings): """No. 4 tests collection for Claim. Test File: claim-example-vision.json """ filename = base_settings["unittest_data_dir"] / "claim-example-vision.json" inst = claim.Claim.model_validate_json(filename.read_bytes()) assert "Claim" == inst.get_resource_type() impl_claim_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Claim" == data["resourceType"] inst2 = claim.Claim(**data) impl_claim_4(inst2) def impl_claim_5(inst): assert inst.careTeam[0].provider.reference == "Practitioner/example" assert inst.careTeam[0].sequence == 1 assert inst.contained[0].id == "device-frame" assert inst.contained[1].id == "device-lens" assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == "654321" assert inst.diagnosis[0].sequence == 1 assert inst.id == "660152" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happysight.com/claim"} ).valueUri ) assert inst.identifier[0].value == "6612347" assert inst.insurance[0].claimResponse.reference == "ClaimResponse/R3500" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].focal is False assert inst.insurance[0].preAuthRef[0] == "PR7652387237" assert inst.insurance[0].sequence == 1 assert inst.insurance[1].coverage.reference == "Coverage/9876B1" assert inst.insurance[1].focal is True assert inst.insurance[1].preAuthRef[0] == "AB543GTD7567" assert inst.insurance[1].sequence == 2 assert inst.insurer.reference == "Organization/2" assert inst.item[0].careTeamSequence[0] == 1 assert inst.item[0].category.coding[0].code == "F6" assert inst.item[0].category.coding[0].display == "Vision Coverage" assert ( inst.item[0].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/benefit-subcategory"} ).valueUri ) assert inst.item[0].detail[0].category.coding[0].code == "F6" assert inst.item[0].detail[0].category.coding[0].display == "Vision Coverage" assert ( inst.item[0].detail[0].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/benefit-subcategory"} ).valueUri ) assert float(inst.item[0].detail[0].factor) == float(1.1) assert inst.item[0].detail[0].modifier[0].coding[0].code == "rooh" assert ( inst.item[0].detail[0].modifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/modifiers"} ).valueUri ) assert inst.item[0].detail[0].net.currency == "USD" assert float(inst.item[0].detail[0].net.value) == float(110.0) assert inst.item[0].detail[0].productOrService.coding[0].code == "frame" assert ( inst.item[0].detail[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/ex-visionservice"} ).valueUri ) assert inst.item[0].detail[0].revenue.coding[0].code == "0010" assert inst.item[0].detail[0].revenue.coding[0].display == "Vision Clinic" assert ( inst.item[0].detail[0].revenue.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-revenue-center"} ).valueUri ) assert inst.item[0].detail[0].sequence == 1 assert inst.item[0].detail[0].udi[0].reference == "#device-frame" assert inst.item[0].detail[0].unitPrice.currency == "USD" assert float(inst.item[0].detail[0].unitPrice.value) == float(100.0) assert inst.item[0].detail[1].category.coding[0].code == "F6" assert inst.item[0].detail[1].category.coding[0].display == "Vision Coverage" assert ( inst.item[0].detail[1].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/benefit-subcategory"} ).valueUri ) assert inst.item[0].detail[1].net.currency == "USD" assert float(inst.item[0].detail[1].net.value) == float(110.0) assert inst.item[0].detail[1].productOrService.coding[0].code == "lens" assert ( inst.item[0].detail[1].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/ex-visionservice"} ).valueUri ) assert inst.item[0].detail[1].programCode[0].coding[0].code == "none" assert ( inst.item[0].detail[1].programCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-programcode"} ).valueUri ) assert float(inst.item[0].detail[1].quantity.value) == float(2) assert inst.item[0].detail[1].revenue.coding[0].code == "0010" assert inst.item[0].detail[1].revenue.coding[0].display == "Vision Clinic" assert ( inst.item[0].detail[1].revenue.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-revenue-center"} ).valueUri ) assert inst.item[0].detail[1].sequence == 2 assert inst.item[0].detail[1].subDetail[0].category.coding[0].code == "F6" assert ( inst.item[0].detail[1].subDetail[0].category.coding[0].display == "Vision Coverage" ) assert ( inst.item[0].detail[1].subDetail[0].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/benefit-subcategory"} ).valueUri ) assert float(inst.item[0].detail[1].subDetail[0].factor) == float(1.1) assert inst.item[0].detail[1].subDetail[0].modifier[0].coding[0].code == "rooh" assert ( inst.item[0].detail[1].subDetail[0].modifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/modifiers"} ).valueUri ) assert inst.item[0].detail[1].subDetail[0].net.currency == "USD" assert float(inst.item[0].detail[1].subDetail[0].net.value) == float(66.0) assert inst.item[0].detail[1].subDetail[0].productOrService.coding[0].code == "lens" assert ( inst.item[0].detail[1].subDetail[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/ex-visionservice"} ).valueUri ) assert inst.item[0].detail[1].subDetail[0].programCode[0].coding[0].code == "none" assert ( inst.item[0].detail[1].subDetail[0].programCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-programcode"} ).valueUri ) assert float(inst.item[0].detail[1].subDetail[0].quantity.value) == float(2) assert inst.item[0].detail[1].subDetail[0].revenue.coding[0].code == "0010" assert ( inst.item[0].detail[1].subDetail[0].revenue.coding[0].display == "Vision Clinic" ) assert ( inst.item[0].detail[1].subDetail[0].revenue.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-revenue-center"} ).valueUri ) assert inst.item[0].detail[1].subDetail[0].sequence == 1 assert inst.item[0].detail[1].subDetail[0].udi[0].reference == "#device-lens" assert inst.item[0].detail[1].subDetail[0].unitPrice.currency == "USD" assert float(inst.item[0].detail[1].subDetail[0].unitPrice.value) == float(30.0) assert inst.item[0].detail[1].subDetail[1].category.coding[0].code == "F6" assert ( inst.item[0].detail[1].subDetail[1].category.coding[0].display == "Vision Coverage" ) assert ( inst.item[0].detail[1].subDetail[1].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/benefit-subcategory"} ).valueUri ) assert float(inst.item[0].detail[1].subDetail[1].factor) == float(1.1) assert inst.item[0].detail[1].subDetail[1].modifier[0].coding[0].code == "rooh" assert ( inst.item[0].detail[1].subDetail[1].modifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/modifiers"} ).valueUri ) assert inst.item[0].detail[1].subDetail[1].net.currency == "USD" assert float(inst.item[0].detail[1].subDetail[1].net.value) == float(33.0) assert ( inst.item[0].detail[1].subDetail[1].productOrService.coding[0].code == "hardening" ) assert ( inst.item[0].detail[1].subDetail[1].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/ex-visionservice"} ).valueUri ) assert float(inst.item[0].detail[1].subDetail[1].quantity.value) == float(2) assert inst.item[0].detail[1].subDetail[1].revenue.coding[0].code == "0010" assert ( inst.item[0].detail[1].subDetail[1].revenue.coding[0].display == "Vision Clinic" ) assert ( inst.item[0].detail[1].subDetail[1].revenue.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-revenue-center"} ).valueUri ) assert inst.item[0].detail[1].subDetail[1].sequence == 2 assert inst.item[0].detail[1].subDetail[1].unitPrice.currency == "USD" assert float(inst.item[0].detail[1].subDetail[1].unitPrice.value) == float(15.0) assert inst.item[0].detail[1].subDetail[2].category.coding[0].code == "F6" assert ( inst.item[0].detail[1].subDetail[2].category.coding[0].display == "Vision Coverage" ) assert ( inst.item[0].detail[1].subDetail[2].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/benefit-subcategory"} ).valueUri ) assert float(inst.item[0].detail[1].subDetail[2].factor) == float(1.1) assert inst.item[0].detail[1].subDetail[2].modifier[0].coding[0].code == "rooh" assert ( inst.item[0].detail[1].subDetail[2].modifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/modifiers"} ).valueUri ) assert inst.item[0].detail[1].subDetail[2].net.currency == "USD" assert float(inst.item[0].detail[1].subDetail[2].net.value) == float(11.0) assert ( inst.item[0].detail[1].subDetail[2].productOrService.coding[0].code == "UV coating" ) assert ( inst.item[0].detail[1].subDetail[2].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/ex-visionservice"} ).valueUri ) assert float(inst.item[0].detail[1].subDetail[2].quantity.value) == float(2) assert inst.item[0].detail[1].subDetail[2].revenue.coding[0].code == "0010" assert ( inst.item[0].detail[1].subDetail[2].revenue.coding[0].display == "Vision Clinic" ) assert ( inst.item[0].detail[1].subDetail[2].revenue.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-revenue-center"} ).valueUri ) assert inst.item[0].detail[1].subDetail[2].sequence == 3 assert inst.item[0].detail[1].subDetail[2].unitPrice.currency == "USD" assert float(inst.item[0].detail[1].subDetail[2].unitPrice.value) == float(5.0) assert inst.item[0].detail[1].unitPrice.currency == "USD" assert float(inst.item[0].detail[1].unitPrice.value) == float(55.0) assert inst.item[0].detail[2].category.coding[0].code == "F6" assert inst.item[0].detail[2].category.coding[0].display == "Vision Coverage" assert ( inst.item[0].detail[2].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/benefit-subcategory"} ).valueUri ) assert float(inst.item[0].detail[2].factor) == float(0.07) assert inst.item[0].detail[2].net.currency == "USD" assert float(inst.item[0].detail[2].net.value) == float(15.4) assert inst.item[0].detail[2].productOrService.coding[0].code == "fst" assert ( inst.item[0].detail[2].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/ex-visionservice"} ).valueUri ) assert inst.item[0].detail[2].revenue.coding[0].code == "0010" assert inst.item[0].detail[2].revenue.coding[0].display == "Vision Clinic" assert ( inst.item[0].detail[2].revenue.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-revenue-center"} ).valueUri ) assert inst.item[0].detail[2].sequence == 3 assert inst.item[0].detail[2].unitPrice.currency == "USD" assert float(inst.item[0].detail[2].unitPrice.value) == float(220.0) assert inst.item[0].modifier[0].coding[0].code == "rooh" assert ( inst.item[0].modifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/modifiers"} ).valueUri ) assert inst.item[0].net.currency == "USD" assert float(inst.item[0].net.value) == float(235.4) assert inst.item[0].productOrService.coding[0].code == "glasses" assert ( inst.item[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/ex-visionservice"} ).valueUri ) assert inst.item[0].programCode[0].coding[0].code == "none" assert ( inst.item[0].programCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-programcode"} ).valueUri ) assert inst.item[0].revenue.coding[0].code == "0010" assert inst.item[0].revenue.coding[0].display == "Vision Clinic" assert ( inst.item[0].revenue.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-revenue-center"} ).valueUri ) assert inst.item[0].sequence == 1 assert ( inst.item[0].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert inst.item[0].unitPrice.currency == "USD" assert float(inst.item[0].unitPrice.value) == float(235.4) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/1" assert inst.payee.type.coding[0].code == "provider" assert inst.prescription.reference == "http://www.optdocs.com/prescription/12345" assert inst.priority.coding[0].code == "normal" assert inst.provider.reference == "Organization/1" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the Vision Claim for Glasses
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "vision" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claim_5(base_settings): """No. 5 tests collection for Claim. Test File: claim-example-vision-glasses-3tier.json """ filename = ( base_settings["unittest_data_dir"] / "claim-example-vision-glasses-3tier.json" ) inst = claim.Claim.model_validate_json(filename.read_bytes()) assert "Claim" == inst.get_resource_type() impl_claim_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Claim" == data["resourceType"] inst2 = claim.Claim(**data) impl_claim_5(inst2) def impl_claim_6(inst): assert inst.careTeam[0].provider.reference == "Practitioner/example" assert inst.careTeam[0].sequence == 1 assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == "654456" assert inst.diagnosis[0].sequence == 1 assert ( inst.enterer.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://jurisdiction.org/facilities/HOSP1234/users"} ).valueUri ) assert inst.enterer.identifier.value == "UC1234" assert ( inst.facility.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://jurisdiction.org/facilities"} ).valueUri ) assert inst.facility.identifier.value == "HOSP1234" assert inst.id == "960150" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyhospital.com/claim"} ).valueUri ) assert inst.identifier[0].value == "9612345" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].focal is True assert inst.insurance[0].sequence == 1 assert inst.insurer.reference == "Organization/2" assert inst.item[0].careTeamSequence[0] == 1 assert inst.item[0].encounter[0].reference == "Encounter/example" assert inst.item[0].net.currency == "USD" assert float(inst.item[0].net.value) == float(125.0) assert inst.item[0].productOrService.coding[0].code == "exam" assert ( inst.item[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ex-serviceproduct"} ).valueUri ) assert inst.item[0].sequence == 1 assert ( inst.item[0].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert inst.item[0].unitPrice.currency == "USD" assert float(inst.item[0].unitPrice.value) == float(125.0) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/1" assert inst.payee.type.coding[0].code == "provider" assert inst.priority.coding[0].code == "normal" assert ( inst.procedure[0].date == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.procedure[0].procedureCodeableConcept.coding[0].code == "SDI9901" assert ( inst.procedure[0].procedureCodeableConcept.text == "Subcutaneous diagnostic implant" ) assert inst.procedure[0].sequence == 1 assert inst.procedure[0].type[0].coding[0].code == "primary" assert inst.procedure[0].udi[0].reference == "Device/example" assert inst.provider.reference == "Organization/1" assert inst.status == "active" assert inst.subType.coding[0].code == "emergency" assert ( inst.subType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-claimsubtype"} ).valueUri ) assert inst.text.div == ( '
A human-readable' " rendering of the Claim
" ) assert inst.text.status == "generated" assert inst.total.currency == "USD" assert float(inst.total.value) == float(125.0) assert inst.type.coding[0].code == "institutional" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claim_6(base_settings): """No. 6 tests collection for Claim. Test File: claim-example-institutional.json """ filename = base_settings["unittest_data_dir"] / "claim-example-institutional.json" inst = claim.Claim.model_validate_json(filename.read_bytes()) assert "Claim" == inst.get_resource_type() impl_claim_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Claim" == data["resourceType"] inst2 = claim.Claim(**data) impl_claim_6(inst2) def impl_claim_7(inst): assert inst.careTeam[0].provider.reference == "#provider-1" assert inst.careTeam[0].sequence == 1 assert inst.contained[0].id == "org-insurer" assert inst.contained[1].id == "org-org" assert inst.contained[2].id == "provider-1" assert inst.contained[3].id == "patient-1" assert inst.contained[4].id == "coverage-1" assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == "123456" assert inst.diagnosis[0].sequence == 1 assert inst.id == "100152" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/claim"} ).valueUri ) assert inst.identifier[0].value == "12347" assert inst.insurance[0].coverage.reference == "#coverage-1" assert inst.insurance[0].focal is True assert inst.insurance[0].sequence == 1 assert inst.insurer.reference == "#org-insurer" assert inst.item[0].careTeamSequence[0] == 1 assert inst.item[0].net.currency == "USD" assert float(inst.item[0].net.value) == float(135.57) assert inst.item[0].productOrService.coding[0].code == "1200" assert inst.item[0].sequence == 1 assert ( inst.item[0].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert inst.item[0].unitPrice.currency == "USD" assert float(inst.item[0].unitPrice.value) == float(135.57) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "#patient-1" assert inst.payee.type.coding[0].code == "provider" assert inst.priority.coding[0].code == "normal" assert inst.provider.reference == "#org-org" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the Oral Health Claim
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "oral" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claim_7(base_settings): """No. 7 tests collection for Claim. Test File: claim-example-oral-contained.json """ filename = base_settings["unittest_data_dir"] / "claim-example-oral-contained.json" inst = claim.Claim.model_validate_json(filename.read_bytes()) assert "Claim" == inst.get_resource_type() impl_claim_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Claim" == data["resourceType"] inst2 = claim.Claim(**data) impl_claim_7(inst2) def impl_claim_8(inst): assert inst.careTeam[0].provider.reference == "Practitioner/example" assert inst.careTeam[0].sequence == 1 assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == "654456" assert inst.diagnosis[0].sequence == 1 assert inst.id == "760151" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happypharma.com/claim"} ).valueUri ) assert inst.identifier[0].value == "7612345" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].focal is True assert inst.insurance[0].sequence == 1 assert inst.insurer.reference == "Organization/2" assert inst.item[0].careTeamSequence[0] == 1 assert inst.item[0].detail[0].net.currency == "USD" assert float(inst.item[0].detail[0].net.value) == float(45.0) assert inst.item[0].detail[0].productOrService.coding[0].code == "drugcost" assert ( inst.item[0].detail[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ex-pharmaservice"} ).valueUri ) assert inst.item[0].detail[0].sequence == 1 assert inst.item[0].detail[1].net.currency == "USD" assert float(inst.item[0].detail[1].net.value) == float(9.0) assert inst.item[0].detail[1].productOrService.coding[0].code == "markup" assert ( inst.item[0].detail[1].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ex-pharmaservice"} ).valueUri ) assert inst.item[0].detail[1].sequence == 2 assert inst.item[0].detail[2].net.currency == "USD" assert float(inst.item[0].detail[2].net.value) == float(36.0) assert inst.item[0].detail[2].productOrService.coding[0].code == "dispensefee" assert ( inst.item[0].detail[2].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ex-pharmaservice"} ).valueUri ) assert inst.item[0].detail[2].sequence == 3 assert inst.item[0].informationSequence[0] == 1 assert inst.item[0].informationSequence[1] == 2 assert inst.item[0].informationSequence[2] == 3 assert inst.item[0].net.currency == "USD" assert float(inst.item[0].net.value) == float(90.0) assert inst.item[0].productOrService.coding[0].code == "562721" assert ( inst.item[0].productOrService.coding[0].display == "Alprazolam 0.25mg (Xanax)" ) assert ( inst.item[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.item[0].quantity.code == "TAB" assert ( inst.item[0].quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.item[0].quantity.unit == "TAB" assert float(inst.item[0].quantity.value) == float(90) assert inst.item[0].sequence == 1 assert ( inst.item[0].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.originalPrescription.reference == "http://pharmacy.org/MedicationRequest/AB1202B" ) assert inst.patient.reference == "Patient/1" assert inst.payee.type.coding[0].code == "provider" assert ( inst.prescription.reference == "http://pharmacy.org/MedicationRequest/AB1234G" ) assert inst.priority.coding[0].code == "stat" assert inst.provider.reference == "Organization/1" assert inst.status == "active" assert inst.supportingInfo[0].category.coding[0].code == "pharmacyrefill" assert inst.supportingInfo[0].code.coding[0].code == "new" assert ( inst.supportingInfo[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/pharmacy-refill"} ).valueUri ) assert inst.supportingInfo[0].sequence == 1 assert inst.supportingInfo[1].category.coding[0].code == "pharmacyinformation" assert inst.supportingInfo[1].code.coding[0].code == "refillsremaining" assert ( inst.supportingInfo[1].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/pharmacy-information"} ).valueUri ) assert inst.supportingInfo[1].sequence == 2 assert float(inst.supportingInfo[1].valueQuantity.value) == float(2) assert inst.supportingInfo[2].category.coding[0].code == "pharmacyinformation" assert inst.supportingInfo[2].code.coding[0].code == "dayssupply" assert ( inst.supportingInfo[2].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/pharmacy-information"} ).valueUri ) assert inst.supportingInfo[2].sequence == 3 assert float(inst.supportingInfo[2].valueQuantity.value) == float(90) assert inst.text.div == ( '
A human-readable' " rendering of the Pharmacy Claim
" ) assert inst.text.status == "generated" assert inst.total.currency == "USD" assert float(inst.total.value) == float(90.0) assert inst.type.coding[0].code == "pharmacy" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claim_8(base_settings): """No. 8 tests collection for Claim. Test File: claim-example-pharmacy-medication.json """ filename = ( base_settings["unittest_data_dir"] / "claim-example-pharmacy-medication.json" ) inst = claim.Claim.model_validate_json(filename.read_bytes()) assert "Claim" == inst.get_resource_type() impl_claim_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Claim" == data["resourceType"] inst2 = claim.Claim(**data) impl_claim_8(inst2) def impl_claim_9(inst): assert inst.careTeam[0].provider.reference == "Practitioner/example" assert inst.careTeam[0].sequence == 1 assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-03-16"} ).valueDateTime ) assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == "K07.3" assert ( inst.diagnosis[0].diagnosisCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/icd-10"} ).valueUri ) assert inst.diagnosis[0].sequence == 1 assert inst.fundsReserve.coding[0].code == "provider" assert inst.id == "100153" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/claim"} ).valueUri ) assert inst.identifier[0].value == "12355" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].focal is True assert inst.insurance[0].sequence == 1 assert inst.insurer.reference == "Organization/2" assert inst.item[0].careTeamSequence[0] == 1 assert inst.item[0].detail[0].net.currency == "USD" assert float(inst.item[0].detail[0].net.value) == float(1000.0) assert inst.item[0].detail[0].productOrService.coding[0].code == "ORTHOEXAM" assert ( inst.item[0].detail[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert inst.item[0].detail[0].sequence == 1 assert inst.item[0].detail[0].unitPrice.currency == "USD" assert float(inst.item[0].detail[0].unitPrice.value) == float(1000.0) assert inst.item[0].detail[1].net.currency == "USD" assert float(inst.item[0].detail[1].net.value) == float(1500.0) assert inst.item[0].detail[1].productOrService.coding[0].code == "ORTHODIAG" assert ( inst.item[0].detail[1].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert inst.item[0].detail[1].sequence == 2 assert inst.item[0].detail[1].unitPrice.currency == "USD" assert float(inst.item[0].detail[1].unitPrice.value) == float(1500.0) assert inst.item[0].detail[2].net.currency == "USD" assert float(inst.item[0].detail[2].net.value) == float(500.0) assert inst.item[0].detail[2].productOrService.coding[0].code == "ORTHOINITIAL" assert ( inst.item[0].detail[2].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert inst.item[0].detail[2].sequence == 3 assert inst.item[0].detail[2].unitPrice.currency == "USD" assert float(inst.item[0].detail[2].unitPrice.value) == float(500.0) assert inst.item[0].detail[3].productOrService.coding[0].code == "ORTHOMONTHS" assert ( inst.item[0].detail[3].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert float(inst.item[0].detail[3].quantity.value) == float(24) assert inst.item[0].detail[3].sequence == 4 assert inst.item[0].detail[4].net.currency == "USD" assert float(inst.item[0].detail[4].net.value) == float(250.0) assert inst.item[0].detail[4].productOrService.coding[0].code == "ORTHOPERIODIC" assert ( inst.item[0].detail[4].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert float(inst.item[0].detail[4].quantity.value) == float(24) assert inst.item[0].detail[4].sequence == 5 assert inst.item[0].detail[4].unitPrice.currency == "USD" assert float(inst.item[0].detail[4].unitPrice.value) == float(250.0) assert inst.item[0].diagnosisSequence[0] == 1 assert inst.item[0].net.currency == "USD" assert float(inst.item[0].net.value) == float(9000.0) assert inst.item[0].productOrService.coding[0].code == "ORTHPLAN" assert ( inst.item[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert inst.item[0].sequence == 1 assert ( inst.item[0].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2015-05-16"}).valueDate ) assert inst.item[0].unitPrice.currency == "USD" assert float(inst.item[0].unitPrice.value) == float(9000.0) assert inst.item[1].bodySite.coding[0].code == "21" assert ( inst.item[1].bodySite.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://fdi.org/fhir/oraltoothcodes"} ).valueUri ) assert inst.item[1].careTeamSequence[0] == 1 assert inst.item[1].net.currency == "USD" assert float(inst.item[1].net.value) == float(105.0) assert inst.item[1].productOrService.coding[0].code == "21211" assert ( inst.item[1].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert inst.item[1].sequence == 2 assert ( inst.item[1].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert inst.item[1].subSite[0].coding[0].code == "L" assert ( inst.item[1].subSite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://fdi.org/fhir/oralsurfacecodes"} ).valueUri ) assert inst.item[1].unitPrice.currency == "USD" assert float(inst.item[1].unitPrice.value) == float(105.0) assert inst.item[2].bodySite.coding[0].code == "36" assert ( inst.item[2].bodySite.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://fdi.org/fhir/oraltoothcodes"} ).valueUri ) assert inst.item[2].careTeamSequence[0] == 1 assert inst.item[2].detail[0].net.currency == "USD" assert float(inst.item[2].detail[0].net.value) == float(750.0) assert inst.item[2].detail[0].productOrService.coding[0].code == "27211" assert ( inst.item[2].detail[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert inst.item[2].detail[0].sequence == 1 assert inst.item[2].detail[0].unitPrice.currency == "USD" assert float(inst.item[2].detail[0].unitPrice.value) == float(750.0) assert inst.item[2].detail[1].net.currency == "USD" assert float(inst.item[2].detail[1].net.value) == float(350.0) assert inst.item[2].detail[1].productOrService.coding[0].code == "lab" assert ( inst.item[2].detail[1].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert inst.item[2].detail[1].sequence == 2 assert inst.item[2].detail[1].unitPrice.currency == "USD" assert float(inst.item[2].detail[1].unitPrice.value) == float(350.0) assert inst.item[2].net.currency == "USD" assert float(inst.item[2].net.value) == float(1100.0) assert inst.item[2].productOrService.coding[0].code == "27211" assert ( inst.item[2].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert inst.item[2].sequence == 3 assert ( inst.item[2].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert inst.item[2].unitPrice.currency == "USD" assert float(inst.item[2].unitPrice.value) == float(1100.0) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/1" assert inst.payee.type.coding[0].code == "provider" assert inst.priority.coding[0].code == "normal" assert inst.provider.reference == "Organization/1" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the Oral Health Claim
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "oral" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "preauthorization" def test_claim_9(base_settings): """No. 9 tests collection for Claim. Test File: claim-example-oral-orthoplan.json """ filename = base_settings["unittest_data_dir"] / "claim-example-oral-orthoplan.json" inst = claim.Claim.model_validate_json(filename.read_bytes()) assert "Claim" == inst.get_resource_type() impl_claim_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Claim" == data["resourceType"] inst2 = claim.Claim(**data) impl_claim_9(inst2) def impl_claim_10(inst): assert inst.careTeam[0].provider.reference == "Practitioner/example" assert inst.careTeam[0].sequence == 1 assert inst.contained[0].id == "patient-1" assert inst.contained[1].id == "coverage-1" assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-10-16T00:00:00-07:00"} ).valueDateTime ) assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == "M96.1" assert ( inst.diagnosis[0].diagnosisCodeableConcept.coding[0].display == "Postlaminectomy syndrome, not elsewhere classified" ) assert ( inst.diagnosis[0].diagnosisCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/icd-10-cm"} ).valueUri ) assert inst.diagnosis[0].sequence == 1 assert inst.diagnosis[1].diagnosisCodeableConcept.coding[0].code == "G89.4" assert ( inst.diagnosis[1].diagnosisCodeableConcept.coding[0].display == "Chronic pain syndrome" ) assert ( inst.diagnosis[1].diagnosisCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/icd-10-cm"} ).valueUri ) assert inst.diagnosis[1].sequence == 2 assert inst.diagnosis[2].diagnosisCodeableConcept.coding[0].code == "M53.88" assert inst.diagnosis[2].diagnosisCodeableConcept.coding[0].display == ( "Other specified dorsopathies, sacral and sacrococcygeal " "region" ) assert ( inst.diagnosis[2].diagnosisCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/icd-10-cm"} ).valueUri ) assert inst.diagnosis[2].sequence == 3 assert inst.diagnosis[3].diagnosisCodeableConcept.coding[0].code == "M47.816" assert inst.diagnosis[3].diagnosisCodeableConcept.coding[0].display == ( "Spondylosis without myelopathy or radiculopathy, lumbar " "region" ) assert ( inst.diagnosis[3].diagnosisCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/icd-10-cm"} ).valueUri ) assert inst.diagnosis[3].sequence == 4 assert inst.id == "MED-00050" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://CedarArmsMedicalCenter.com/claim"} ).valueUri ) assert inst.identifier[0].value == "MED-00050" assert inst.insurance[0].coverage.reference == "#coverage-1" assert inst.insurance[0].focal is True assert ( inst.insurance[0].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://CedarArmsMedicalCenter.com/claim"} ).valueUri ) assert inst.insurance[0].identifier.value == "MED-00050" assert inst.insurance[0].sequence == 1 assert inst.insurer.display == "Humana Inc." assert ( inst.insurer.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bindb.com/bin"} ).valueUri ) assert inst.insurer.identifier.value == "123456" assert inst.item[0].careTeamSequence[0] == 1 assert inst.item[0].diagnosisSequence[0] == 2 assert inst.item[0].diagnosisSequence[1] == 4 assert inst.item[0].informationSequence[0] == 1 assert inst.item[0].locationCodeableConcept.coding[0].code == "24" assert ( inst.item[0].locationCodeableConcept.coding[0].display == "Ambulatory Surgical Center" ) assert ( inst.item[0].locationCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "https://www.cms.gov/medicare/coding/place-of-service-codes/place_of_service_code_set.html" } ).valueUri ) assert inst.item[0].net.currency == "USD" assert float(inst.item[0].net.value) == float(12500.0) assert inst.item[0].productOrService.coding[0].code == "62264" assert ( inst.item[0].productOrService.coding[0].display == "Surgical Procedures on the Spine and Spinal Cord" ) assert ( inst.item[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.ama-assn.org/go/cpt"} ).valueUri ) assert inst.item[0].sequence == 1 assert ( inst.item[0].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2015-10-13"}).valueDate ) assert inst.item[0].unitPrice.currency == "USD" assert float(inst.item[0].unitPrice.value) == float(12500.0) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "#patient-1" assert inst.payee.party.reference == "Organization/1" assert inst.payee.type.coding[0].code == "provider" assert ( inst.payee.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/payeetype"} ).valueUri ) assert inst.priority.coding[0].code == "normal" assert inst.provider.reference == "Organization/1" assert inst.status == "active" assert inst.subType.coding[0].code == "831" assert ( inst.subType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.cms.gov/codes/billtype"} ).valueUri ) assert inst.supportingInfo[0].category.coding[0].code == "hospitalized" assert ( inst.supportingInfo[0].category.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/claiminformationcategory" } ).valueUri ) assert inst.supportingInfo[0].sequence == 1 assert ( inst.supportingInfo[0].timingPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-10-05T00:00:00-07:00"} ).valueDateTime ) assert ( inst.supportingInfo[0].timingPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-10-01T00:00:00-07:00"} ).valueDateTime ) assert inst.supportingInfo[1].category.coding[0].code == "discharge" assert ( inst.supportingInfo[1].category.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/claiminformationcategory" } ).valueUri ) assert inst.supportingInfo[1].code.coding[0].code == "01" assert ( inst.supportingInfo[1].code.coding[0].display == "Discharge to Home or Self Care" ) assert ( inst.supportingInfo[1].code.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "https://www.cms.gov/Outreach-and-Education/Medicare-Learning-Network-MLN/MLNMattersArticles/downloads/SE0801.pdf" } ).valueUri ) assert inst.supportingInfo[1].sequence == 2 assert inst.text.div == ( '
A human-readable' " rendering of a CMS 1500 Claim
" ) assert inst.text.status == "generated" assert inst.total.currency == "USD" assert float(inst.total.value) == float(12500.0) assert inst.type.coding[0].code == "institutional" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claim_10(base_settings): """No. 10 tests collection for Claim. Test File: claim-example-cms1500-medical.json """ filename = base_settings["unittest_data_dir"] / "claim-example-cms1500-medical.json" inst = claim.Claim.model_validate_json(filename.read_bytes()) assert "Claim" == inst.get_resource_type() impl_claim_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Claim" == data["resourceType"] inst2 = claim.Claim(**data) impl_claim_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_claimresponse.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ClaimResponse Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import claimresponse from .conftest import ExternalValidatorModel # noqa: F401 def impl_claimresponse_1(inst): assert inst.addItem[0].adjudication[0].amount.currency == "USD" assert float(inst.addItem[0].adjudication[0].amount.value) == float(250.0) assert inst.addItem[0].adjudication[0].category.coding[0].code == "eligible" assert inst.addItem[0].adjudication[1].amount.currency == "USD" assert float(inst.addItem[0].adjudication[1].amount.value) == float(10.0) assert inst.addItem[0].adjudication[1].category.coding[0].code == "copay" assert inst.addItem[0].adjudication[2].category.coding[0].code == "eligpercent" assert float(inst.addItem[0].adjudication[2].value) == float(100.0) assert inst.addItem[0].adjudication[3].amount.currency == "USD" assert float(inst.addItem[0].adjudication[3].amount.value) == float(240.0) assert inst.addItem[0].adjudication[3].category.coding[0].code == "benefit" assert inst.addItem[0].itemSequence[0] == 1 assert inst.addItem[0].modifier[0].coding[0].code == "x" assert inst.addItem[0].modifier[0].coding[0].display == "None" assert ( inst.addItem[0].modifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/modifiers"} ).valueUri ) assert inst.addItem[0].net.currency == "USD" assert float(inst.addItem[0].net.value) == float(250.0) assert inst.addItem[0].noteNumber[0] == 101 assert inst.addItem[0].productOrService.coding[0].code == "1101" assert ( inst.addItem[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert inst.addItem[1].adjudication[0].amount.currency == "USD" assert float(inst.addItem[1].adjudication[0].amount.value) == float(800.0) assert inst.addItem[1].adjudication[0].category.coding[0].code == "eligible" assert inst.addItem[1].adjudication[1].category.coding[0].code == "eligpercent" assert float(inst.addItem[1].adjudication[1].value) == float(100.0) assert inst.addItem[1].adjudication[2].amount.currency == "USD" assert float(inst.addItem[1].adjudication[2].amount.value) == float(800.0) assert inst.addItem[1].adjudication[2].category.coding[0].code == "benefit" assert inst.addItem[1].itemSequence[0] == 1 assert inst.addItem[1].net.currency == "USD" assert float(inst.addItem[1].net.value) == float(800.0) assert inst.addItem[1].productOrService.coding[0].code == "2101" assert ( inst.addItem[1].productOrService.coding[0].display == "Radiograph, series (12)" ) assert ( inst.addItem[1].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.disposition == ( "The enclosed services are authorized for your provision " "within 30 days of this notice." ) assert inst.id == "UR3503" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.SocialBenefitsInc.com/fhir/ClaimResponse"} ).valueUri ) assert inst.identifier[0].value == "UR3503" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].focal is True assert inst.insurance[0].sequence == 1 assert ( inst.insurer.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.jurisdiction.org/insurers"} ).valueUri ) assert inst.insurer.identifier.value == "444123" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "complete" assert inst.patient.reference == "Patient/1" assert inst.payeeType.coding[0].code == "provider" assert ( inst.payeeType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/payeetype"} ).valueUri ) assert inst.preAuthRef == "18SS12345" assert inst.processNote[0].language.coding[0].code == "en-CA" assert ( inst.processNote[0].language.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:47"} ).valueUri ) assert inst.processNote[0].number == 101 assert inst.processNote[0].text == ( "Please submit a Pre-Authorization request if a more " "extensive examination or urgent services are required." ) assert inst.processNote[0].type == "print" assert inst.requestor.reference == "Organization/1" assert inst.status == "active" assert inst.text.div == ( '
A sample ' "unsolicited pre-authorization response which authorizes " "basic dental services to be performed for a patient.
" ) assert inst.text.status == "generated" assert inst.total[0].amount.currency == "USD" assert float(inst.total[0].amount.value) == float(1050.0) assert inst.total[0].category.coding[0].code == "submitted" assert inst.total[1].amount.currency == "USD" assert float(inst.total[1].amount.value) == float(1040.0) assert inst.total[1].category.coding[0].code == "benefit" assert inst.type.coding[0].code == "oral" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "preauthorization" def test_claimresponse_1(base_settings): """No. 1 tests collection for ClaimResponse. Test File: claimresponse-example-unsolicited-preauth.json """ filename = ( base_settings["unittest_data_dir"] / "claimresponse-example-unsolicited-preauth.json" ) inst = claimresponse.ClaimResponse.model_validate_json(filename.read_bytes()) assert "ClaimResponse" == inst.get_resource_type() impl_claimresponse_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ClaimResponse" == data["resourceType"] inst2 = claimresponse.ClaimResponse(**data) impl_claimresponse_1(inst2) def impl_claimresponse_2(inst): assert inst.addItem[0].adjudication[0].amount.currency == "USD" assert float(inst.addItem[0].adjudication[0].amount.value) == float(100.0) assert inst.addItem[0].adjudication[0].category.coding[0].code == "eligible" assert inst.addItem[0].adjudication[1].amount.currency == "USD" assert float(inst.addItem[0].adjudication[1].amount.value) == float(10.0) assert inst.addItem[0].adjudication[1].category.coding[0].code == "copay" assert inst.addItem[0].adjudication[2].category.coding[0].code == "eligpercent" assert float(inst.addItem[0].adjudication[2].value) == float(80.0) assert inst.addItem[0].adjudication[3].amount.currency == "USD" assert float(inst.addItem[0].adjudication[3].amount.value) == float(72.0) assert inst.addItem[0].adjudication[3].category.coding[0].code == "benefit" assert inst.addItem[0].adjudication[3].reason.coding[0].code == "ar002" assert ( inst.addItem[0].adjudication[3].reason.coding[0].display == "Plan Limit Reached" ) assert ( inst.addItem[0].adjudication[3].reason.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/adjudication-reason"} ).valueUri ) assert inst.addItem[0].itemSequence[0] == 1 assert inst.addItem[0].modifier[0].coding[0].code == "x" assert inst.addItem[0].modifier[0].coding[0].display == "None" assert ( inst.addItem[0].modifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/modifiers"} ).valueUri ) assert inst.addItem[0].net.currency == "USD" assert float(inst.addItem[0].net.value) == float(135.57) assert inst.addItem[0].noteNumber[0] == 101 assert inst.addItem[0].productOrService.coding[0].code == "1101" assert ( inst.addItem[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert inst.addItem[1].adjudication[0].amount.currency == "USD" assert float(inst.addItem[1].adjudication[0].amount.value) == float(35.57) assert inst.addItem[1].adjudication[0].category.coding[0].code == "eligible" assert inst.addItem[1].adjudication[1].category.coding[0].code == "eligpercent" assert float(inst.addItem[1].adjudication[1].value) == float(80.0) assert inst.addItem[1].adjudication[2].amount.currency == "USD" assert float(inst.addItem[1].adjudication[2].amount.value) == float(28.47) assert inst.addItem[1].adjudication[2].category.coding[0].code == "benefit" assert inst.addItem[1].itemSequence[0] == 1 assert inst.addItem[1].net.currency == "USD" assert float(inst.addItem[1].net.value) == float(35.57) assert inst.addItem[1].productOrService.coding[0].code == "2141" assert inst.addItem[1].productOrService.coding[0].display == "Radiograph, bytewing" assert ( inst.addItem[1].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert inst.addItem[2].adjudication[0].amount.currency == "USD" assert float(inst.addItem[2].adjudication[0].amount.value) == float(350.0) assert inst.addItem[2].adjudication[0].category.coding[0].code == "eligible" assert inst.addItem[2].adjudication[1].category.coding[0].code == "eligpercent" assert float(inst.addItem[2].adjudication[1].value) == float(80.0) assert inst.addItem[2].adjudication[2].amount.currency == "USD" assert float(inst.addItem[2].adjudication[2].amount.value) == float(270.0) assert inst.addItem[2].adjudication[2].category.coding[0].code == "benefit" assert inst.addItem[2].detailSequence[0] == 2 assert inst.addItem[2].itemSequence[0] == 3 assert inst.addItem[2].modifier[0].coding[0].code == "x" assert inst.addItem[2].modifier[0].coding[0].display == "None" assert ( inst.addItem[2].modifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/modifiers"} ).valueUri ) assert inst.addItem[2].net.currency == "USD" assert float(inst.addItem[2].net.value) == float(350.0) assert inst.addItem[2].noteNumber[0] == 101 assert inst.addItem[2].productOrService.coding[0].code == "expense" assert ( inst.addItem[2].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.disposition == "Claim settled as per contract." assert inst.id == "R3503" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/remittance"} ).valueUri ) assert inst.identifier[0].value == "R3503" assert ( inst.insurer.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.jurisdiction.org/insurers"} ).valueUri ) assert inst.insurer.identifier.value == "555123" assert inst.item[0].adjudication[0].amount.currency == "USD" assert float(inst.item[0].adjudication[0].amount.value) == float(0.0) assert inst.item[0].adjudication[0].category.coding[0].code == "eligible" assert inst.item[0].adjudication[1].amount.currency == "USD" assert float(inst.item[0].adjudication[1].amount.value) == float(0.0) assert inst.item[0].adjudication[1].category.coding[0].code == "benefit" assert inst.item[0].itemSequence == 1 assert inst.item[1].adjudication[0].amount.currency == "USD" assert float(inst.item[1].adjudication[0].amount.value) == float(105.0) assert inst.item[1].adjudication[0].category.coding[0].code == "eligible" assert inst.item[1].adjudication[1].category.coding[0].code == "eligpercent" assert float(inst.item[1].adjudication[1].value) == float(80.0) assert inst.item[1].adjudication[2].amount.currency == "USD" assert float(inst.item[1].adjudication[2].amount.value) == float(84.0) assert inst.item[1].adjudication[2].category.coding[0].code == "benefit" assert inst.item[1].itemSequence == 2 assert inst.item[2].adjudication[0].amount.currency == "USD" assert float(inst.item[2].adjudication[0].amount.value) == float(750.0) assert inst.item[2].adjudication[0].category.coding[0].code == "eligible" assert inst.item[2].adjudication[1].category.coding[0].code == "eligpercent" assert float(inst.item[2].adjudication[1].value) == float(80.0) assert inst.item[2].adjudication[2].amount.currency == "USD" assert float(inst.item[2].adjudication[2].amount.value) == float(600.0) assert inst.item[2].adjudication[2].category.coding[0].code == "benefit" assert inst.item[2].detail[0].adjudication[0].amount.currency == "USD" assert float(inst.item[2].detail[0].adjudication[0].amount.value) == float(750.0) assert inst.item[2].detail[0].adjudication[0].category.coding[0].code == "eligible" assert ( inst.item[2].detail[0].adjudication[1].category.coding[0].code == "eligpercent" ) assert float(inst.item[2].detail[0].adjudication[1].value) == float(80.0) assert inst.item[2].detail[0].adjudication[2].amount.currency == "USD" assert float(inst.item[2].detail[0].adjudication[2].amount.value) == float(600.0) assert inst.item[2].detail[0].adjudication[2].category.coding[0].code == "benefit" assert inst.item[2].detail[0].detailSequence == 1 assert inst.item[2].detail[1].adjudication[0].amount.currency == "USD" assert float(inst.item[2].detail[1].adjudication[0].amount.value) == float(0.0) assert inst.item[2].detail[1].adjudication[0].category.coding[0].code == "eligible" assert inst.item[2].detail[1].adjudication[1].amount.currency == "USD" assert float(inst.item[2].detail[1].adjudication[1].amount.value) == float(0.0) assert inst.item[2].detail[1].adjudication[1].category.coding[0].code == "benefit" assert inst.item[2].detail[1].detailSequence == 2 assert inst.item[2].itemSequence == 3 assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "complete" assert inst.patient.reference == "Patient/1" assert inst.payeeType.coding[0].code == "provider" assert ( inst.payeeType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/payeetype"} ).valueUri ) assert inst.payment.amount.currency == "USD" assert float(inst.payment.amount.value) == float(100.47) assert ( inst.payment.date == ExternalValidatorModel.model_validate({"valueDate": "2014-08-31"}).valueDate ) assert ( inst.payment.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/paymentidentifier"} ).valueUri ) assert inst.payment.identifier.value == "201408-2-15507" assert inst.payment.type.coding[0].code == "complete" assert ( inst.payment.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-paymenttype"} ).valueUri ) assert inst.processNote[0].language.coding[0].code == "en-CA" assert ( inst.processNote[0].language.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:47"} ).valueUri ) assert inst.processNote[0].number == 101 assert ( inst.processNote[0].text == "Package codes are not permitted. Codes replaced by Insurer." ) assert inst.processNote[0].type == "print" assert ( inst.request.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/claim"} ).valueUri ) assert inst.request.identifier.value == "12346" assert inst.requestor.reference == "Organization/1" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the ClaimResponse to Claim Oral Average with " "additional items
" ) assert inst.text.status == "generated" assert inst.total[0].amount.currency == "USD" assert float(inst.total[0].amount.value) == float(1340.57) assert inst.total[0].category.coding[0].code == "submitted" assert inst.total[1].amount.currency == "USD" assert float(inst.total[1].amount.value) == float(1054.47) assert inst.total[1].category.coding[0].code == "benefit" assert inst.type.coding[0].code == "oral" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claimresponse_2(base_settings): """No. 2 tests collection for ClaimResponse. Test File: claimresponse-example-additem.json """ filename = base_settings["unittest_data_dir"] / "claimresponse-example-additem.json" inst = claimresponse.ClaimResponse.model_validate_json(filename.read_bytes()) assert "ClaimResponse" == inst.get_resource_type() impl_claimresponse_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ClaimResponse" == data["resourceType"] inst2 = claimresponse.ClaimResponse(**data) impl_claimresponse_2(inst2) def impl_claimresponse_3(inst): assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.disposition == "Claim settled as per contract." assert inst.id == "R3500" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/remittance"} ).valueUri ) assert inst.identifier[0].value == "R3500" assert ( inst.insurer.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.jurisdiction.org/insurers"} ).valueUri ) assert inst.insurer.identifier.value == "555123" assert inst.item[0].adjudication[0].amount.currency == "USD" assert float(inst.item[0].adjudication[0].amount.value) == float(135.57) assert inst.item[0].adjudication[0].category.coding[0].code == "eligible" assert inst.item[0].adjudication[1].amount.currency == "USD" assert float(inst.item[0].adjudication[1].amount.value) == float(10.0) assert inst.item[0].adjudication[1].category.coding[0].code == "copay" assert inst.item[0].adjudication[2].category.coding[0].code == "eligpercent" assert float(inst.item[0].adjudication[2].value) == float(80.0) assert inst.item[0].adjudication[3].amount.currency == "USD" assert float(inst.item[0].adjudication[3].amount.value) == float(90.47) assert inst.item[0].adjudication[3].category.coding[0].code == "benefit" assert inst.item[0].adjudication[3].reason.coding[0].code == "ar002" assert inst.item[0].adjudication[3].reason.coding[0].display == "Plan Limit Reached" assert ( inst.item[0].adjudication[3].reason.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/adjudication-reason"} ).valueUri ) assert inst.item[0].itemSequence == 1 assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "complete" assert inst.patient.reference == "Patient/1" assert inst.payeeType.coding[0].code == "provider" assert ( inst.payeeType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/payeetype"} ).valueUri ) assert inst.payment.amount.currency == "USD" assert float(inst.payment.amount.value) == float(100.47) assert ( inst.payment.date == ExternalValidatorModel.model_validate({"valueDate": "2014-08-31"}).valueDate ) assert ( inst.payment.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/paymentidentifier"} ).valueUri ) assert inst.payment.identifier.value == "201408-2-1569478" assert inst.payment.type.coding[0].code == "complete" assert ( inst.payment.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-paymenttype"} ).valueUri ) assert ( inst.request.reference == "http://www.BenefitsInc.com/fhir/oralhealthclaim/15476332402" ) assert inst.requestor.reference == "Organization/1" assert inst.status == "active" assert inst.subType.coding[0].code == "emergency" assert ( inst.subType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-claimsubtype"} ).valueUri ) assert inst.text.div == ( '
A human-readable' " rendering of the ClaimResponse
" ) assert inst.text.status == "generated" assert inst.total[0].amount.currency == "USD" assert float(inst.total[0].amount.value) == float(135.57) assert inst.total[0].category.coding[0].code == "submitted" assert inst.total[1].amount.currency == "USD" assert float(inst.total[1].amount.value) == float(90.47) assert inst.total[1].category.coding[0].code == "benefit" assert inst.type.coding[0].code == "oral" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claimresponse_3(base_settings): """No. 3 tests collection for ClaimResponse. Test File: claimresponse-example.json """ filename = base_settings["unittest_data_dir"] / "claimresponse-example.json" inst = claimresponse.ClaimResponse.model_validate_json(filename.read_bytes()) assert "ClaimResponse" == inst.get_resource_type() impl_claimresponse_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ClaimResponse" == data["resourceType"] inst2 = claimresponse.ClaimResponse(**data) impl_claimresponse_3(inst2) def impl_claimresponse_4(inst): assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.disposition == "Claim settled as per contract." assert inst.id == "R3502" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://thebenefitcompany.com/claimresponse"} ).valueUri ) assert inst.identifier[0].value == "CR6532875367" assert inst.insurer.reference == "Organization/2" assert inst.item[0].adjudication[0].amount.currency == "USD" assert float(inst.item[0].adjudication[0].amount.value) == float(235.4) assert inst.item[0].adjudication[0].category.coding[0].code == "eligible" assert inst.item[0].adjudication[1].amount.currency == "USD" assert float(inst.item[0].adjudication[1].amount.value) == float(20.0) assert inst.item[0].adjudication[1].category.coding[0].code == "copay" assert inst.item[0].adjudication[2].category.coding[0].code == "eligpercent" assert float(inst.item[0].adjudication[2].value) == float(80.0) assert inst.item[0].adjudication[3].amount.currency == "USD" assert float(inst.item[0].adjudication[3].amount.value) == float(172.32) assert inst.item[0].adjudication[3].category.coding[0].code == "benefit" assert inst.item[0].detail[0].adjudication[0].amount.currency == "USD" assert float(inst.item[0].detail[0].adjudication[0].amount.value) == float(100.0) assert inst.item[0].detail[0].adjudication[0].category.coding[0].code == "eligible" assert inst.item[0].detail[0].adjudication[1].amount.currency == "USD" assert float(inst.item[0].detail[0].adjudication[1].amount.value) == float(20.0) assert inst.item[0].detail[0].adjudication[1].category.coding[0].code == "copay" assert ( inst.item[0].detail[0].adjudication[2].category.coding[0].code == "eligpercent" ) assert float(inst.item[0].detail[0].adjudication[2].value) == float(80.0) assert inst.item[0].detail[0].adjudication[3].amount.currency == "USD" assert float(inst.item[0].detail[0].adjudication[3].amount.value) == float(80.0) assert inst.item[0].detail[0].adjudication[3].category.coding[0].code == "benefit" assert inst.item[0].detail[0].detailSequence == 1 assert inst.item[0].detail[0].noteNumber[0] == 1 assert inst.item[0].detail[1].adjudication[0].amount.currency == "USD" assert float(inst.item[0].detail[1].adjudication[0].amount.value) == float(110.0) assert inst.item[0].detail[1].adjudication[0].category.coding[0].code == "eligible" assert ( inst.item[0].detail[1].adjudication[1].category.coding[0].code == "eligpercent" ) assert float(inst.item[0].detail[1].adjudication[1].value) == float(80.0) assert inst.item[0].detail[1].adjudication[2].amount.currency == "USD" assert float(inst.item[0].detail[1].adjudication[2].amount.value) == float(88.0) assert inst.item[0].detail[1].adjudication[2].category.coding[0].code == "benefit" assert inst.item[0].detail[1].detailSequence == 2 assert inst.item[0].detail[1].noteNumber[0] == 1 assert inst.item[0].detail[1].subDetail[0].adjudication[0].amount.currency == "USD" assert float( inst.item[0].detail[1].subDetail[0].adjudication[0].amount.value ) == float(60.0) assert ( inst.item[0].detail[1].subDetail[0].adjudication[0].category.coding[0].code == "eligible" ) assert ( inst.item[0].detail[1].subDetail[0].adjudication[1].category.coding[0].code == "eligpercent" ) assert float(inst.item[0].detail[1].subDetail[0].adjudication[1].value) == float( 80.0 ) assert inst.item[0].detail[1].subDetail[0].adjudication[2].amount.currency == "USD" assert float( inst.item[0].detail[1].subDetail[0].adjudication[2].amount.value ) == float(48.0) assert ( inst.item[0].detail[1].subDetail[0].adjudication[2].category.coding[0].code == "benefit" ) assert inst.item[0].detail[1].subDetail[0].noteNumber[0] == 1 assert inst.item[0].detail[1].subDetail[0].subDetailSequence == 1 assert inst.item[0].detail[1].subDetail[1].adjudication[0].amount.currency == "USD" assert float( inst.item[0].detail[1].subDetail[1].adjudication[0].amount.value ) == float(30.0) assert ( inst.item[0].detail[1].subDetail[1].adjudication[0].category.coding[0].code == "eligible" ) assert ( inst.item[0].detail[1].subDetail[1].adjudication[1].category.coding[0].code == "eligpercent" ) assert float(inst.item[0].detail[1].subDetail[1].adjudication[1].value) == float( 80.0 ) assert inst.item[0].detail[1].subDetail[1].adjudication[2].amount.currency == "USD" assert float( inst.item[0].detail[1].subDetail[1].adjudication[2].amount.value ) == float(24.0) assert ( inst.item[0].detail[1].subDetail[1].adjudication[2].category.coding[0].code == "benefit" ) assert inst.item[0].detail[1].subDetail[1].subDetailSequence == 2 assert inst.item[0].detail[1].subDetail[2].adjudication[0].amount.currency == "USD" assert float( inst.item[0].detail[1].subDetail[2].adjudication[0].amount.value ) == float(10.0) assert ( inst.item[0].detail[1].subDetail[2].adjudication[0].category.coding[0].code == "eligible" ) assert ( inst.item[0].detail[1].subDetail[2].adjudication[1].category.coding[0].code == "eligpercent" ) assert float(inst.item[0].detail[1].subDetail[2].adjudication[1].value) == float( 80.0 ) assert inst.item[0].detail[1].subDetail[2].adjudication[2].amount.currency == "USD" assert float( inst.item[0].detail[1].subDetail[2].adjudication[2].amount.value ) == float(8.0) assert ( inst.item[0].detail[1].subDetail[2].adjudication[2].category.coding[0].code == "benefit" ) assert inst.item[0].detail[1].subDetail[2].noteNumber[0] == 1 assert inst.item[0].detail[1].subDetail[2].subDetailSequence == 3 assert inst.item[0].detail[2].adjudication[0].amount.currency == "USD" assert float(inst.item[0].detail[2].adjudication[0].amount.value) == float(200.0) assert inst.item[0].detail[2].adjudication[0].category.coding[0].code == "eligible" assert ( inst.item[0].detail[2].adjudication[1].category.coding[0].code == "eligpercent" ) assert float(inst.item[0].detail[2].adjudication[1].value) == float(80.0) assert inst.item[0].detail[2].adjudication[2].amount.currency == "USD" assert float(inst.item[0].detail[2].adjudication[2].amount.value) == float(14.0) assert inst.item[0].detail[2].adjudication[2].category.coding[0].code == "benefit" assert inst.item[0].detail[2].detailSequence == 3 assert inst.item[0].detail[2].noteNumber[0] == 1 assert inst.item[0].itemSequence == 1 assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "complete" assert inst.patient.reference == "Patient/1" assert inst.payeeType.coding[0].code == "provider" assert ( inst.payeeType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/payeetype"} ).valueUri ) assert inst.payment.adjustment.currency == "USD" assert float(inst.payment.adjustment.value) == float(75.0) assert inst.payment.adjustmentReason.coding[0].code == "a002" assert inst.payment.adjustmentReason.coding[0].display == "Prior Overpayment" assert ( inst.payment.adjustmentReason.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/payment-adjustment-reason" } ).valueUri ) assert inst.payment.amount.currency == "USD" assert float(inst.payment.amount.value) == float(107.0) assert ( inst.payment.date == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert ( inst.payment.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://thebenefitcompany.com/paymentidentifier"} ).valueUri ) assert inst.payment.identifier.value == "201416-123456" assert inst.payment.type.coding[0].code == "complete" assert ( inst.payment.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-paymenttype"} ).valueUri ) assert inst.processNote[0].language.coding[0].code == "en-CA" assert ( inst.processNote[0].language.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:47"} ).valueUri ) assert inst.processNote[0].number == 1 assert inst.processNote[0].text == "After hours surcharge declined" assert inst.processNote[0].type == "display" assert ( inst.request.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://happysight.com/claim"} ).valueUri ) assert inst.request.identifier.value == "6612346" assert inst.requestor.reference == "Organization/1" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the ClaimResponse
" ) assert inst.text.status == "generated" assert inst.total[0].amount.currency == "USD" assert float(inst.total[0].amount.value) == float(235.4) assert inst.total[0].category.coding[0].code == "submitted" assert inst.total[1].amount.currency == "USD" assert float(inst.total[1].amount.value) == float(182.0) assert inst.total[1].category.coding[0].code == "benefit" assert inst.type.coding[0].code == "vision" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claimresponse_4(base_settings): """No. 4 tests collection for ClaimResponse. Test File: claimresponse-example-vision-3tier.json """ filename = ( base_settings["unittest_data_dir"] / "claimresponse-example-vision-3tier.json" ) inst = claimresponse.ClaimResponse.model_validate_json(filename.read_bytes()) assert "ClaimResponse" == inst.get_resource_type() impl_claimresponse_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ClaimResponse" == data["resourceType"] inst2 = claimresponse.ClaimResponse(**data) impl_claimresponse_4(inst2) def impl_claimresponse_5(inst): assert inst.communicationRequest[0].reference == "CommunicationRequest/fm-solicit" assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.disposition == "Claim could not be processed" assert inst.error[0].code.coding[0].code == "a002" assert ( inst.error[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/adjudication-error"} ).valueUri ) assert inst.error[0].detailSequence == 2 assert inst.error[0].itemSequence == 3 assert inst.formCode.coding[0].code == "2" assert ( inst.formCode.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/forms-codes"} ).valueUri ) assert inst.id == "R3501" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/remittance"} ).valueUri ) assert inst.identifier[0].value == "R3501" assert ( inst.insurer.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.jurisdiction.org/insurers"} ).valueUri ) assert inst.insurer.identifier.value == "555123" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "error" assert inst.patient.reference == "Patient/1" assert inst.processNote[0].language.coding[0].code == "en-CA" assert ( inst.processNote[0].language.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:47"} ).valueUri ) assert inst.processNote[0].number == 1 assert inst.processNote[0].text == "Invalid claim" assert inst.processNote[0].type == "display" assert inst.request.reference == "Claim/100156" assert inst.requestor.reference == "Practitioner/1" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the ClaimResponse that demonstrates returning " "errors
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "oral" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claimresponse_5(base_settings): """No. 5 tests collection for ClaimResponse. Test File: claimresponse-example-2.json """ filename = base_settings["unittest_data_dir"] / "claimresponse-example-2.json" inst = claimresponse.ClaimResponse.model_validate_json(filename.read_bytes()) assert "ClaimResponse" == inst.get_resource_type() impl_claimresponse_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ClaimResponse" == data["resourceType"] inst2 = claimresponse.ClaimResponse(**data) impl_claimresponse_5(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_clinicalimpression.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ClinicalImpression Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import clinicalimpression from .conftest import ExternalValidatorModel # noqa: F401 def impl_clinicalimpression_1(inst): assert inst.assessor.reference == "Practitioner/example" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-12-06T22:33:00+11:00"} ).valueDateTime ) assert inst.description == ( "This 26 yo male patient is brought into ER by ambulance " "after being involved in a motor vehicle accident" ) assert ( inst.effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-12-06T22:33:00+11:00"} ).valueDateTime ) assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-12-06T20:00:00+11:00"} ).valueDateTime ) assert inst.encounter.reference == "Encounter/example" assert inst.finding[0].itemCodeableConcept.coding[0].code == "850.0" assert ( inst.finding[0].itemCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/icd-9"} ).valueUri ) assert inst.id == "example" assert inst.identifier[0].value == "12345" assert inst.investigation[0].code.text == "Initial Examination" assert ( inst.investigation[0].item[0].display == "deep laceration of the scalp (left temporo-occipital)" ) assert inst.investigation[0].item[1].display == "decreased level of consciousness" assert inst.investigation[0].item[2].display == "disoriented to time and place" assert inst.investigation[0].item[3].display == "restless" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.problem[0].display == "MVA" assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.summary == ( "provisional diagnoses of laceration of head and traumatic " "brain injury (TBI)" ) assert inst.text.status == "generated" def test_clinicalimpression_1(base_settings): """No. 1 tests collection for ClinicalImpression. Test File: clinicalimpression-example.json """ filename = base_settings["unittest_data_dir"] / "clinicalimpression-example.json" inst = clinicalimpression.ClinicalImpression.model_validate_json( filename.read_bytes() ) assert "ClinicalImpression" == inst.get_resource_type() impl_clinicalimpression_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ClinicalImpression" == data["resourceType"] inst2 = clinicalimpression.ClinicalImpression(**data) impl_clinicalimpression_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_clinicalusedefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ClinicalUseDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import clinicalusedefinition from .conftest import ExternalValidatorModel # noqa: F401 def impl_clinicalusedefinition_1(inst): assert ( inst.contraindication.comorbidity[0].concept.coding[0].code == "Hepaticdisease" ) assert ( inst.contraindication.comorbidity[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/comorbidity"} ).valueUri ) assert ( inst.contraindication.diseaseSymptomProcedure.concept.coding[0].code == "Coagulopathiesandbleedingdiatheses(exclthrombocytopenic)" ) assert ( inst.contraindication.diseaseSymptomProcedure.concept.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://ema.europa.eu/example/contraindicationsasdisease-symptom-procedure" } ).valueUri ) assert inst.contraindication.diseaseSymptomProcedure.concept.text == ( "Hepatic disease associated with coagulopathy and clinically " "relevant bleeding risk" ) assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" assert inst.type == "contraindication" def test_clinicalusedefinition_1(base_settings): """No. 1 tests collection for ClinicalUseDefinition. Test File: clinicalusedefinition-example.json """ filename = base_settings["unittest_data_dir"] / "clinicalusedefinition-example.json" inst = clinicalusedefinition.ClinicalUseDefinition.model_validate_json( filename.read_bytes() ) assert "ClinicalUseDefinition" == inst.get_resource_type() impl_clinicalusedefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ClinicalUseDefinition" == data["resourceType"] inst2 = clinicalusedefinition.ClinicalUseDefinition(**data) impl_clinicalusedefinition_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_codesystem.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/CodeSystem Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import codesystem from .conftest import ExternalValidatorModel # noqa: F401 def impl_codesystem_1(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "source" assert inst.concept[0].definition == ( "This structure describes an instance passed to the mapping " "engine that is used a source of data." ) assert inst.concept[0].display == "Source Structure Definition" assert inst.concept[1].code == "queried" assert inst.concept[1].definition == ( "This structure describes an instance that the mapping engine" " may ask for that is used a source of data." ) assert inst.concept[1].display == "Queried Structure Definition" assert inst.concept[2].code == "target" assert inst.concept[2].definition == ( "This structure describes an instance passed to the mapping " "engine that is used a target of data." ) assert inst.concept[2].display == "Target Structure Definition" assert inst.concept[3].code == "produced" assert inst.concept[3].definition == ( "This structure describes an instance that the mapping engine" " may ask to create that is used a target of data." ) assert inst.concept[3].display == "Produced Structure Definition" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert inst.content == "complete" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-17T07:06:13+11:00"} ).valueDateTime ) assert inst.description == "How the referenced structure is used in this mapping." assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "fhir" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 2 assert inst.id == "map-model-mode" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.4.676" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2022-05-28T13:47:40.239+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablecodesystem" ) assert inst.name == "StructureMapModelMode" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "StructureMapModelMode" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/map-model-mode"} ).valueUri ) assert inst.valueSet == "http://hl7.org/fhir/ValueSet/map-model-mode" assert inst.version == "4.3.0" def test_codesystem_1(base_settings): """No. 1 tests collection for CodeSystem. Test File: codesystem-map-model-mode.json """ filename = base_settings["unittest_data_dir"] / "codesystem-map-model-mode.json" inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_1(inst2) def impl_codesystem_2(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "true" assert inst.concept[0].definition == "Boolean true." assert inst.concept[0].display == "true" assert inst.concept[1].code == "false" assert inst.concept[1].definition == "Boolean false." assert inst.concept[1].display == "false" assert inst.concept[2].code == "trace" assert inst.concept[2].definition == ( "The content is greater than zero, but too small to be " "quantified." ) assert inst.concept[2].display == "Trace Amount Detected" assert inst.concept[3].code == "sufficient" assert inst.concept[3].definition == ( "The specific quantity is not known, but is known to be non-" "zero and is not specified because it makes up the bulk of " "the material." ) assert inst.concept[3].display == "Sufficient Quantity" assert ( inst.concept[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/codesystem-concept-comments" } ).valueUri ) assert inst.concept[3].extension[0].valueString == ( "used in formulations (e.g. 'Add 10mg of ingredient X, 50mg " "of ingredient Y, and sufficient quantity of water to 100mL.'" " This code would be used to express the quantity of water. )" ) assert inst.concept[4].code == "withdrawn" assert inst.concept[4].definition == "The value is no longer available." assert inst.concept[4].display == "Value Withdrawn" assert inst.concept[5].code == "nil-known" assert ( inst.concept[5].definition == "The are no known applicable values in this context." ) assert inst.concept[5].display == "Nil Known" assert ( inst.concept[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/codesystem-concept-comments" } ).valueUri ) assert ( inst.concept[5].extension[0].valueString == "The existence of this subject to review" ) assert inst.content == "complete" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.description == ( "A set of generally useful codes defined so they can be " "included in value sets." ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "fhir" assert inst.id == "special-values" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.1.1049" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2022-05-28T12:47:40.239+10:00"} ).valueInstant ) assert inst.name == "SpecialValues" assert inst.status == "draft" assert inst.text.status == "extensions" assert inst.title == "SpecialValues" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/special-values"} ).valueUri ) assert inst.valueSet == "http://hl7.org/fhir/ValueSet/special-values" assert inst.version == "4.3.0" def test_codesystem_2(base_settings): """No. 2 tests collection for CodeSystem. Test File: codesystem-special-values.json """ filename = base_settings["unittest_data_dir"] / "codesystem-special-values.json" inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_2(inst2) def impl_codesystem_3(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "unknown" assert ( inst.concept[0].definition == "The communication was not done due to an unknown reason." ) assert inst.concept[0].display == "Unknown" assert inst.concept[1].code == "system-error" assert ( inst.concept[1].definition == "The communication was not done due to a system error." ) assert inst.concept[1].display == "System Error" assert inst.concept[2].code == "invalid-phone-number" assert inst.concept[2].definition == ( "The communication was not done due to an invalid phone " "number." ) assert inst.concept[2].display == "Invalid Phone Number" assert inst.concept[3].code == "recipient-unavailable" assert inst.concept[3].definition == ( "The communication was not done due to the recipient being " "unavailable." ) assert inst.concept[3].display == "Recipient Unavailable" assert inst.concept[4].code == "family-objection" assert ( inst.concept[4].definition == "The communication was not done due to a family objection." ) assert inst.concept[4].display == "Family Objection" assert inst.concept[5].code == "patient-objection" assert ( inst.concept[5].definition == "The communication was not done due to a patient objection." ) assert inst.concept[5].display == "Patient Objection" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert inst.content == "complete" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-17T07:06:13+11:00"} ).valueDateTime ) assert ( inst.description == "Codes for the reason why a communication did not happen." ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "pc" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "draft" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 1 assert inst.id == "communication-not-done-reason" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.4.1077" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2022-05-28T13:47:40.239+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablecodesystem" ) assert inst.name == "CommunicationNotDoneReason" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "CommunicationNotDoneReason" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/communication-not-done-reason" } ).valueUri ) assert inst.valueSet == "http://hl7.org/fhir/ValueSet/communication-not-done-reason" assert inst.version == "4.3.0" def test_codesystem_3(base_settings): """No. 3 tests collection for CodeSystem. Test File: codesystem-communication-not-done-reason.json """ filename = ( base_settings["unittest_data_dir"] / "codesystem-communication-not-done-reason.json" ) inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_3(inst2) def impl_codesystem_4(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "grouped-by" assert inst.concept[0].display == "Grouped By" assert inst.concept[1].code == "is-a" assert inst.concept[1].display == "Is-A" assert inst.concept[2].code == "part-of" assert inst.concept[2].definition == ( "Child elements list the individual parts of a composite " "whole (e.g. body site)." ) assert inst.concept[2].display == "Part Of" assert inst.concept[3].code == "classified-with" assert inst.concept[3].display == "Classified With" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert inst.content == "complete" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-17T07:06:13+11:00"} ).valueDateTime ) assert ( inst.description == "The meaning of the hierarchy of concepts in a code system." ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "vocab" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "normative" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version" } ).valueUri ) assert inst.extension[2].valueCode == "4.0.0" assert ( inst.extension[3].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[3].valueInteger == 5 assert inst.id == "codesystem-hierarchy-meaning" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.4.785" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2022-05-28T13:47:40.239+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablecodesystem" ) assert inst.name == "CodeSystemHierarchyMeaning" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "CodeSystemHierarchyMeaning" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/codesystem-hierarchy-meaning"} ).valueUri ) assert inst.valueSet == "http://hl7.org/fhir/ValueSet/codesystem-hierarchy-meaning" assert inst.version == "4.3.0" def test_codesystem_4(base_settings): """No. 4 tests collection for CodeSystem. Test File: codesystem-codesystem-hierarchy-meaning.json """ filename = ( base_settings["unittest_data_dir"] / "codesystem-codesystem-hierarchy-meaning.json" ) inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_4(inst2) def impl_codesystem_5(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "continuous" assert inst.concept[0].definition == ( "A medication which is expected to be continued beyond the " "present order and which the patient should be assumed to be " "taking unless explicitly stopped." ) assert inst.concept[0].display == "Continuous long term therapy" assert inst.concept[1].code == "acute" assert inst.concept[1].definition == ( "A medication which the patient is only expected to consume " "for the duration of the current order and which is not " "expected to be renewed." ) assert inst.concept[1].display == "Short course (acute) therapy" assert inst.concept[2].code == "seasonal" assert inst.concept[2].definition == ( "A medication which is expected to be used on a part time " "basis at certain times of the year" ) assert inst.concept[2].display == "Seasonal" assert inst.content == "complete" assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "phx" assert inst.id == "medicationrequest-course-of-therapy" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.1.1327" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2022-05-28T12:47:40.239+10:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablecodesystem" ) assert inst.name == "MedicationRequest Course of Therapy Codes" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy" } ).valueUri ) assert inst.valueSet == ( "http://hl7.org/fhir/ValueSet/medicationrequest-course-of-" "therapy" ) assert inst.version == "4.3.0" def test_codesystem_5(base_settings): """No. 5 tests collection for CodeSystem. Test File: codesystem-medicationrequest-course-of-therapy.json """ filename = ( base_settings["unittest_data_dir"] / "codesystem-medicationrequest-course-of-therapy.json" ) inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_5(inst2) def impl_codesystem_6(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "0" assert inst.concept[0].definition == ( "The operation completed successfully (whether with warnings " "or not)." ) assert inst.concept[0].display == "Success" assert inst.concept[1].code == "4" assert inst.concept[1].definition == ( "The action was not successful due to some kind of minor " "failure (often equivalent to an HTTP 400 response)." ) assert inst.concept[1].display == "Minor failure" assert inst.concept[2].code == "8" assert inst.concept[2].definition == ( "The action was not successful due to some kind of unexpected" " error (often equivalent to an HTTP 500 response)." ) assert inst.concept[2].display == "Serious failure" assert inst.concept[3].code == "12" assert inst.concept[3].definition == ( "An error of such magnitude occurred that the system is no " "longer available for use (i.e. the system died)." ) assert inst.concept[3].display == "Major failure" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert inst.content == "complete" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-17T07:06:13+11:00"} ).valueDateTime ) assert inst.description == "Indicates whether the event succeeded or failed." assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "sec" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 3 assert inst.id == "audit-event-outcome" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.4.455" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2022-05-28T13:47:40.239+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablecodesystem" ) assert inst.name == "AuditEventOutcome" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "AuditEventOutcome" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/audit-event-outcome"} ).valueUri ) assert inst.valueSet == "http://hl7.org/fhir/ValueSet/audit-event-outcome" assert inst.version == "4.3.0" def test_codesystem_6(base_settings): """No. 6 tests collection for CodeSystem. Test File: codesystem-audit-event-outcome.json """ filename = ( base_settings["unittest_data_dir"] / "codesystem-audit-event-outcome.json" ) inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_6(inst2) def impl_codesystem_7(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "disclosure-ca" assert ( inst.concept[0].definition == "Canadian health information disclosure policy." ) assert inst.concept[0].display == "Disclosure-CA" assert inst.concept[1].code == "disclosure-us" assert ( inst.concept[1].definition == "United States health information disclosure policy." ) assert inst.concept[1].display == "Disclosure-US" assert inst.content == "complete" assert inst.copyright == "This is an example set." assert inst.description == "This value set includes sample Contract Subtype codes." assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "fm" assert inst.id == "contract-subtype" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.1.0" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2022-05-28T12:47:40.239+10:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablecodesystem" ) assert inst.name == "ContractSubtypeCodes" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Contract Subtype Codes" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/contract-subtype"} ).valueUri ) assert inst.version == "4.3.0" def test_codesystem_7(base_settings): """No. 7 tests collection for CodeSystem. Test File: codesystem-contract-subtype.json """ filename = base_settings["unittest_data_dir"] / "codesystem-contract-subtype.json" inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_7(inst2) def impl_codesystem_8(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "create" assert inst.concept[0].definition == ( "create(type : string) - type is passed through to the " "application on the standard API, and must be known by it." ) assert inst.concept[0].display == "create" assert inst.concept[1].code == "copy" assert inst.concept[1].definition == "copy(source)." assert inst.concept[1].display == "copy" assert inst.concept[2].code == "truncate" assert ( inst.concept[2].definition == "truncate(source, length) - source must be stringy type." ) assert inst.concept[2].display == "truncate" assert inst.concept[3].code == "escape" assert inst.concept[3].definition == ( "escape(source, fmt1, fmt2) - change source from one kind of " "escaping to another (plain, java, xml, json). note that this" " is for when the string itself is escaped." ) assert inst.concept[3].display == "escape" assert inst.concept[4].code == "cast" assert inst.concept[4].definition == ( "cast(source, type?) - case source from one type to another. " "target type can be left as implicit if there is one and only" " one target type known." ) assert inst.concept[4].display == "cast" assert inst.concept[5].code == "append" assert ( inst.concept[5].definition == "append(source...) - source is element or string." ) assert inst.concept[5].display == "append" assert inst.concept[6].code == "translate" assert ( inst.concept[6].definition == "translate(source, uri_of_map) - use the translate operation." ) assert inst.concept[6].display == "translate" assert inst.concept[7].code == "reference" assert inst.concept[7].definition == ( "reference(source : object) - return a string that references" " the provided tree properly." ) assert inst.concept[7].display == "reference" assert inst.concept[8].code == "dateOp" assert ( inst.concept[8].definition == "Perform a date operation. *Parameters to be documented*." ) assert inst.concept[8].display == "dateOp" assert inst.concept[9].code == "uuid" assert ( inst.concept[9].definition == "Generate a random UUID (in lowercase). No Parameters." ) assert inst.concept[9].display == "uuid" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert inst.content == "complete" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-17T07:06:13+11:00"} ).valueDateTime ) assert inst.description == "How data is copied/created." assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "fhir" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 2 assert inst.id == "map-transform" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.4.682" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2022-05-28T13:47:40.239+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablecodesystem" ) assert inst.name == "StructureMapTransform" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "StructureMapTransform" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/map-transform"} ).valueUri ) assert inst.valueSet == "http://hl7.org/fhir/ValueSet/map-transform" assert inst.version == "4.3.0" def test_codesystem_8(base_settings): """No. 8 tests collection for CodeSystem. Test File: codesystem-map-transform.json """ filename = base_settings["unittest_data_dir"] / "codesystem-map-transform.json" inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_8(inst2) def impl_codesystem_9(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "contraindicated-only-with" assert ( inst.concept[0].definition == "Only contraindicated if the other therapy is given" ) assert ( inst.concept[0].display == "Only contraindicated if the other therapy is given" ) assert inst.concept[1].code == "contraindicated-except-with" assert ( inst.concept[1].definition == "Contraindicated unless the other therapy is given" ) assert ( inst.concept[1].display == "Contraindicated unless the other therapy is given" ) assert inst.concept[2].code == "indicated-only-with" assert inst.concept[2].definition == ( "Indicated only when the other therapy is given (co-" "occurrent)" ) assert inst.concept[2].display == ( "Indicated only when the other therapy is given (co-" "occurrent)" ) assert inst.concept[3].code == "indicated-except-with" assert ( inst.concept[3].definition == "Indicated except when the other therapy is given" ) assert inst.concept[3].display == "Indicated except when the other therapy is given" assert inst.concept[4].code == "indicated-only-before" assert inst.concept[4].definition == ( "Indicated only if the other therapy is planned to be given " "afterwards (prep)" ) assert inst.concept[4].display == ( "Indicated only if the other therapy is planned to be given " "afterwards (prep)" ) assert inst.concept[5].code == "indicated-only-before" assert inst.concept[5].definition == ( "Indicated only if the other therapy was given before " "(follow-up)" ) assert inst.concept[5].display == ( "Indicated only if the other therapy was given before " "(follow-up)" ) assert inst.concept[6].code == "replace-other-therapy" assert inst.concept[6].definition == "Indicated to replace the other therapy" assert inst.concept[6].display == "Indicated to replace the other therapy" assert inst.concept[7].code == "replace-other-therapy-contraindicated" assert ( inst.concept[7].definition == "Indicated to replace the other contraindicated therapy." ) assert ( inst.concept[7].display == "Indicated to replace the other contraindicated therapy" ) assert inst.concept[8].code == "replace-other-therapy-not-tolerated" assert inst.concept[8].definition == ( "Indicated to replace the other therapy not well tolerated by" " patient" ) assert inst.concept[8].display == ( "Indicated to replace the other therapy not well tolerated by" " patient" ) assert inst.concept[9].code == "replace-other-therapy-not-effective" assert inst.concept[9].definition == ( "Indicated to replace the other therapy not effective on " "patient" ) assert inst.concept[9].display == ( "Indicated to replace the other therapy not effective on " "patient" ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert inst.content == "complete" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-08-15T16:55:11+11:00"} ).valueDateTime ) assert inst.description == ( "Classification of relationship between a therapy and a " "contraindication or an indication." ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "brr" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 1 assert inst.id == "therapy-relationship-type" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.1.1560" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2022-05-28T13:47:40.239+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablecodesystem" ) assert inst.name == "TherapyRelationshipType" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "TherapyRelationshipType" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/therapy-relationship-type"} ).valueUri ) assert inst.valueSet == "http://hl7.org/fhir/ValueSet/therapy-relationship-type" assert inst.version == "4.3.0" def test_codesystem_9(base_settings): """No. 9 tests collection for CodeSystem. Test File: codesystem-therapy-relationship-type.json """ filename = ( base_settings["unittest_data_dir"] / "codesystem-therapy-relationship-type.json" ) inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_9(inst2) def impl_codesystem_10(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "registered" assert inst.concept[0].definition == ( "The existence of the imaging study is registered, but there " "is nothing yet available." ) assert inst.concept[0].display == "Registered" assert inst.concept[1].code == "available" assert inst.concept[1].definition == ( "At least one instance has been associated with this imaging " "study." ) assert inst.concept[1].display == "Available" assert inst.concept[2].code == "cancelled" assert inst.concept[2].definition == ( "The imaging study is unavailable because the imaging study " "was not started or not completed (also sometimes called " '"aborted").' ) assert inst.concept[2].display == "Cancelled" assert inst.concept[3].code == "entered-in-error" assert inst.concept[3].display == "Entered in Error" assert inst.concept[4].code == "unknown" assert inst.concept[4].display == "Unknown" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert inst.content == "complete" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-17T07:06:13+11:00"} ).valueDateTime ) assert inst.description == "The status of the ImagingStudy." assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "ii" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 3 assert inst.id == "imagingstudy-status" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.4.991" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2022-05-28T13:47:40.239+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablecodesystem" ) assert inst.name == "ImagingStudyStatus" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "ImagingStudyStatus" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/imagingstudy-status"} ).valueUri ) assert inst.valueSet == "http://hl7.org/fhir/ValueSet/imagingstudy-status" assert inst.version == "4.3.0" def test_codesystem_10(base_settings): """No. 10 tests collection for CodeSystem. Test File: codesystem-imagingstudy-status.json """ filename = ( base_settings["unittest_data_dir"] / "codesystem-imagingstudy-status.json" ) inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_communication.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Communication Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import communication from .conftest import ExternalValidatorModel # noqa: F401 def impl_communication_1(inst): assert ( inst.about[0].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/claim"} ).valueUri ) assert inst.about[0].identifier.value == "12345" assert ( inst.about[1].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/claimresponse"} ).valueUri ) assert inst.about[1].identifier.value == "R3500" assert inst.category[0].coding[0].code == "SolicitedAttachment" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org/messagetypes"} ).valueUri ) assert inst.id == "fm-attachment" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.providerco.com/communication"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.payload[0].contentAttachment.contentType == "application/pdf" assert ( inst.payload[0].contentAttachment.creation == ExternalValidatorModel.model_validate( {"valueDateTime": "2010-02-01T11:50:23-05:00"} ).valueDateTime ) assert ( inst.payload[0].contentAttachment.data == ExternalValidatorModel.model_validate( {"valueBase64Binary": "SGVsbG8="} ).valueBase64Binary ) assert inst.payload[0].contentAttachment.title == "accident notes 20100201.pdf" assert inst.payload[1].contentAttachment.contentType == "application/pdf" assert ( inst.payload[1].contentAttachment.creation == ExternalValidatorModel.model_validate( {"valueDateTime": "2010-02-01T10:57:34+01:00"} ).valueDateTime ) assert ( inst.payload[1].contentAttachment.hash == ExternalValidatorModel.model_validate( {"valueBase64Binary": "SGVsbG8gdGhlcmU="} ).valueBase64Binary ) assert inst.payload[1].contentAttachment.size == 104274 assert ( inst.payload[1].contentAttachment.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://example.org/docs/AB12345"} ).valueUrl ) assert ( inst.recipient[0].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.jurisdiction.com/insurer"} ).valueUri ) assert inst.recipient[0].identifier.value == "123456" assert ( inst.sender.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.jurisdiction.com/provideroffices"} ).valueUri ) assert inst.sender.identifier.value == "3456" assert ( inst.sent == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-06-12T18:01:10-08:00"} ).valueDateTime ) assert inst.status == "completed" assert inst.subject.reference == "Patient/1" assert inst.text.div == ( '
Attachment which' " is unsolicited
" ) assert inst.text.status == "generated" def test_communication_1(base_settings): """No. 1 tests collection for Communication. Test File: communication-example-fm-attachment.json """ filename = ( base_settings["unittest_data_dir"] / "communication-example-fm-attachment.json" ) inst = communication.Communication.model_validate_json(filename.read_bytes()) assert "Communication" == inst.get_resource_type() impl_communication_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Communication" == data["resourceType"] inst2 = communication.Communication(**data) impl_communication_1(inst2) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org/messagetypes"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://www.providerco.com/communication"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.payload[0].contentAttachment.contentType == "application/pdf" assert ( inst.payload[0].contentAttachment.creation == ExternalValidatorModel.model_validate( {"valueDateTime": "2010-02-01T11:50:23-05:00"} ).valueDateTime ) assert ( inst.payload[0].contentAttachment.data == ExternalValidatorModel.model_validate( {"valueBase64Binary": "SGVsbG8="} ).valueBase64Binary ) assert inst.payload[0].contentAttachment.title == "accident notes 20100201.pdf" assert inst.payload[1].contentAttachment.contentType == "application/pdf" assert ( inst.payload[1].contentAttachment.creation == ExternalValidatorModel.model_validate( {"valueDateTime": "2010-02-01T10:57:34+01:00"} ).valueDateTime ) assert ( inst.payload[1].contentAttachment.hash == ExternalValidatorModel.model_validate( {"valueBase64Binary": "SGVsbG8gdGhlcmU="} ).valueBase64Binary ) assert inst.payload[1].contentAttachment.size == 104274 assert ( inst.payload[1].contentAttachment.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://happyvalley.com/docs/AB12345"} ).valueUrl ) assert inst.recipient[0].reference == "#payor" assert inst.sender.reference == "#provider" assert ( inst.sent == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-06-12T18:01:10-08:00"} ).valueDateTime ) assert inst.status == "completed" assert inst.subject.reference == "Patient/1" assert inst.text.div == ( '
Attachment in ' "response to a Request
" ) assert inst.text.status == "generated" def test_communication_2(base_settings): """No. 2 tests collection for Communication. Test File: communication-example-fm-solicited-attachment.json """ filename = ( base_settings["unittest_data_dir"] / "communication-example-fm-solicited-attachment.json" ) inst = communication.Communication.model_validate_json(filename.read_bytes()) assert "Communication" == inst.get_resource_type() impl_communication_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Communication" == data["resourceType"] inst2 = communication.Communication(**data) impl_communication_2(inst2) def impl_communication_3(inst): assert inst.category[0].coding[0].code == "Alert" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org/messagetypes"} ).valueUri ) assert inst.category[0].text == "Alert" assert inst.encounter.reference == "Encounter/example" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.3.4.5.6.7"} ).valueUri ) assert inst.identifier[0].type.text == "Paging System" assert inst.identifier[0].value == "2345678901" assert ( inst.instantiatesUri[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/hyperkalemia"} ).valueUri ) assert inst.medium[0].coding[0].code == "WRITTEN" assert inst.medium[0].coding[0].display == "written" assert ( inst.medium[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationMode"} ).valueUri ) assert inst.medium[0].text == "written" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.partOf[0].display == "Serum Potassium Observation" assert inst.payload[0].contentString == ( "Patient 1 has a very high serum potassium value (7.2 mmol/L " "on 2014-Dec-12 at 5:55 pm)" ) assert inst.payload[1].contentReference.display == "Serum Potassium Observation" assert ( inst.received == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-12-12T18:01:11-08:00"} ).valueDateTime ) assert inst.recipient[0].reference == "Practitioner/example" assert inst.sender.reference == "Device/f001" assert ( inst.sent == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-12-12T18:01:10-08:00"} ).valueDateTime ) assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Patient has very' " high serum potassium
" ) assert inst.text.status == "generated" def test_communication_3(base_settings): """No. 3 tests collection for Communication. Test File: communication-example.json """ filename = base_settings["unittest_data_dir"] / "communication-example.json" inst = communication.Communication.model_validate_json(filename.read_bytes()) assert "Communication" == inst.get_resource_type() impl_communication_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Communication" == data["resourceType"] inst2 = communication.Communication(**data) impl_communication_3(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_communicationrequest.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/CommunicationRequest Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import communicationrequest from .conftest import ExternalValidatorModel # noqa: F401 def impl_communicationrequest_1(inst): assert inst.encounter.reference == "Encounter/example" assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "active" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
To be filled out' " at a later time
" ) assert inst.text.status == "generated" def test_communicationrequest_1(base_settings): """No. 1 tests collection for CommunicationRequest. Test File: communicationrequest-example.json """ filename = base_settings["unittest_data_dir"] / "communicationrequest-example.json" inst = communicationrequest.CommunicationRequest.model_validate_json( filename.read_bytes() ) assert "CommunicationRequest" == inst.get_resource_type() impl_communicationrequest_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CommunicationRequest" == data["resourceType"] inst2 = communicationrequest.CommunicationRequest(**data) impl_communicationrequest_1(inst2) def impl_communicationrequest_2(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-06-10T11:01:10-08:00"} ).valueDateTime ) assert inst.basedOn[0].display == "EligibilityRequest" assert inst.category[0].coding[0].code == "SolicitedAttachmentRequest" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org/messagetypes"} ).valueUri ) assert inst.contained[0].id == "provider" assert inst.contained[1].id == "payor" assert inst.contained[2].id == "requester" assert inst.encounter.reference == "Encounter/example" assert inst.groupIdentifier.value == "12345" assert inst.id == "fm-solicit" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.jurisdiction.com/insurer/123456"} ).valueUri ) assert inst.identifier[0].value == "ABC123" assert inst.medium[0].coding[0].code == "WRITTEN" assert inst.medium[0].coding[0].display == "written" assert ( inst.medium[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationMode"} ).valueUri ) assert inst.medium[0].text == "written" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-06-10T11:01:10-08:00"} ).valueDateTime ) assert inst.payload[0].contentString == ( "Please provide the accident report and any associated " "pictures to support your Claim# DEF5647." ) assert inst.priority == "routine" assert inst.recipient[0].reference == "#provider" assert inst.replaces[0].display == "prior CommunicationRequest" assert inst.requester.reference == "#requester" assert inst.sender.reference == "#payor" assert inst.status == "active" assert inst.text.div == ( '
Request for ' "Accident Report
" ) assert inst.text.status == "generated" def test_communicationrequest_2(base_settings): """No. 2 tests collection for CommunicationRequest. Test File: communicationrequest-example-fm-solicit-attachment.json """ filename = ( base_settings["unittest_data_dir"] / "communicationrequest-example-fm-solicit-attachment.json" ) inst = communicationrequest.CommunicationRequest.model_validate_json( filename.read_bytes() ) assert "CommunicationRequest" == inst.get_resource_type() impl_communicationrequest_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CommunicationRequest" == data["resourceType"] inst2 = communicationrequest.CommunicationRequest(**data) impl_communicationrequest_2(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_compartmentdefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/CompartmentDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import compartmentdefinition from .conftest import ExternalValidatorModel # noqa: F401 def impl_compartmentdefinition_1(inst): assert inst.code == "Device" assert inst.contact[0].name == "[string]" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-24"} ).valueDateTime ) assert inst.description == ( "The set of resources associated with a particular Device " "(example with Communication and CommunicationRequest " "resourses only)." ) assert inst.experimental is True assert inst.id == "example" assert inst.name == "EXAMPLE" assert inst.publisher == "Health Level Seven International (FHIR Infrastructure)" assert inst.purpose == ( "Provides an example of a FHIR compartment definition based " "on the Device resource type." ) assert inst.resource[0].code == "Communication" assert ( inst.resource[0].documentation == "The device used as the message sender and recipient" ) assert inst.resource[0].param[0] == "sender" assert inst.resource[0].param[1] == "recipient" assert inst.resource[1].code == "CommunicationRequest" assert ( inst.resource[1].documentation == "The device used as the message sender and recipient" ) assert inst.resource[1].param[0] == "sender" assert inst.resource[1].param[1] == "recipient" assert inst.search is True assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CompartmentDefinition/example"} ).valueUri ) assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "Device" assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/resource-types"} ).valueUri ) def test_compartmentdefinition_1(base_settings): """No. 1 tests collection for CompartmentDefinition. Test File: compartmentdefinition-example.json """ filename = base_settings["unittest_data_dir"] / "compartmentdefinition-example.json" inst = compartmentdefinition.CompartmentDefinition.model_validate_json( filename.read_bytes() ) assert "CompartmentDefinition" == inst.get_resource_type() impl_compartmentdefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CompartmentDefinition" == data["resourceType"] inst2 = compartmentdefinition.CompartmentDefinition(**data) impl_compartmentdefinition_1(inst2) def impl_compartmentdefinition_2(inst): assert inst.code == "RelatedPerson" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "relatedPerson" assert inst.name == "Base FHIR compartment definition for RelatedPerson" assert inst.publisher == "FHIR Project Team" assert inst.resource[0].code == "Account" assert inst.resource[1].code == "ActivityDefinition" assert inst.resource[2].code == "AdministrableProductDefinition" assert inst.resource[3].code == "AdverseEvent" assert inst.resource[3].param[0] == "recorder" assert inst.resource[4].code == "AllergyIntolerance" assert inst.resource[4].param[0] == "asserter" assert inst.resource[5].code == "Appointment" assert inst.resource[5].param[0] == "actor" assert inst.resource[6].code == "AppointmentResponse" assert inst.resource[6].param[0] == "actor" assert inst.resource[7].code == "AuditEvent" assert inst.resource[8].code == "Basic" assert inst.resource[8].param[0] == "author" assert inst.resource[9].code == "Binary" assert inst.search is True assert inst.status == "draft" assert inst.text.status == "extensions" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CompartmentDefinition/relatedPerson"} ).valueUri ) assert inst.version == "4.3.0" def test_compartmentdefinition_2(base_settings): """No. 2 tests collection for CompartmentDefinition. Test File: compartmentdefinition-relatedperson.json """ filename = ( base_settings["unittest_data_dir"] / "compartmentdefinition-relatedperson.json" ) inst = compartmentdefinition.CompartmentDefinition.model_validate_json( filename.read_bytes() ) assert "CompartmentDefinition" == inst.get_resource_type() impl_compartmentdefinition_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CompartmentDefinition" == data["resourceType"] inst2 = compartmentdefinition.CompartmentDefinition(**data) impl_compartmentdefinition_2(inst2) def impl_compartmentdefinition_3(inst): assert inst.code == "Patient" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "patient" assert inst.name == "Base FHIR compartment definition for Patient" assert inst.publisher == "FHIR Project Team" assert inst.resource[0].code == "Account" assert inst.resource[0].param[0] == "subject" assert inst.resource[1].code == "ActivityDefinition" assert inst.resource[2].code == "AdministrableProductDefinition" assert inst.resource[3].code == "AdverseEvent" assert inst.resource[3].param[0] == "subject" assert inst.resource[4].code == "AllergyIntolerance" assert inst.resource[4].param[0] == "patient" assert inst.resource[4].param[1] == "recorder" assert inst.resource[4].param[2] == "asserter" assert inst.resource[5].code == "Appointment" assert inst.resource[5].param[0] == "actor" assert inst.resource[6].code == "AppointmentResponse" assert inst.resource[6].param[0] == "actor" assert inst.resource[7].code == "AuditEvent" assert inst.resource[7].param[0] == "patient" assert inst.resource[8].code == "Basic" assert inst.resource[8].param[0] == "patient" assert inst.resource[8].param[1] == "author" assert inst.resource[9].code == "Binary" assert inst.search is True assert inst.status == "draft" assert inst.text.status == "extensions" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CompartmentDefinition/patient"} ).valueUri ) assert inst.version == "4.3.0" def test_compartmentdefinition_3(base_settings): """No. 3 tests collection for CompartmentDefinition. Test File: compartmentdefinition-patient.json """ filename = base_settings["unittest_data_dir"] / "compartmentdefinition-patient.json" inst = compartmentdefinition.CompartmentDefinition.model_validate_json( filename.read_bytes() ) assert "CompartmentDefinition" == inst.get_resource_type() impl_compartmentdefinition_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CompartmentDefinition" == data["resourceType"] inst2 = compartmentdefinition.CompartmentDefinition(**data) impl_compartmentdefinition_3(inst2) def impl_compartmentdefinition_4(inst): assert inst.code == "Practitioner" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "practitioner" assert inst.name == "Base FHIR compartment definition for Practitioner" assert inst.publisher == "FHIR Project Team" assert inst.resource[0].code == "Account" assert inst.resource[0].param[0] == "subject" assert inst.resource[1].code == "ActivityDefinition" assert inst.resource[2].code == "AdministrableProductDefinition" assert inst.resource[3].code == "AdverseEvent" assert inst.resource[3].param[0] == "recorder" assert inst.resource[4].code == "AllergyIntolerance" assert inst.resource[4].param[0] == "recorder" assert inst.resource[4].param[1] == "asserter" assert inst.resource[5].code == "Appointment" assert inst.resource[5].param[0] == "actor" assert inst.resource[6].code == "AppointmentResponse" assert inst.resource[6].param[0] == "actor" assert inst.resource[7].code == "AuditEvent" assert inst.resource[7].param[0] == "agent" assert inst.resource[8].code == "Basic" assert inst.resource[8].param[0] == "author" assert inst.resource[9].code == "Binary" assert inst.search is True assert inst.status == "draft" assert inst.text.status == "extensions" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CompartmentDefinition/practitioner"} ).valueUri ) assert inst.version == "4.3.0" def test_compartmentdefinition_4(base_settings): """No. 4 tests collection for CompartmentDefinition. Test File: compartmentdefinition-practitioner.json """ filename = ( base_settings["unittest_data_dir"] / "compartmentdefinition-practitioner.json" ) inst = compartmentdefinition.CompartmentDefinition.model_validate_json( filename.read_bytes() ) assert "CompartmentDefinition" == inst.get_resource_type() impl_compartmentdefinition_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CompartmentDefinition" == data["resourceType"] inst2 = compartmentdefinition.CompartmentDefinition(**data) impl_compartmentdefinition_4(inst2) def impl_compartmentdefinition_5(inst): assert inst.code == "Encounter" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "encounter" assert inst.name == "Base FHIR compartment definition for Encounter" assert inst.publisher == "FHIR Project Team" assert inst.resource[0].code == "Account" assert inst.resource[1].code == "ActivityDefinition" assert inst.resource[2].code == "AdministrableProductDefinition" assert inst.resource[3].code == "AdverseEvent" assert inst.resource[4].code == "AllergyIntolerance" assert inst.resource[5].code == "Appointment" assert inst.resource[6].code == "AppointmentResponse" assert inst.resource[7].code == "AuditEvent" assert inst.resource[8].code == "Basic" assert inst.resource[9].code == "Binary" assert inst.search is True assert inst.status == "draft" assert inst.text.status == "extensions" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CompartmentDefinition/encounter"} ).valueUri ) assert inst.version == "4.3.0" def test_compartmentdefinition_5(base_settings): """No. 5 tests collection for CompartmentDefinition. Test File: compartmentdefinition-encounter.json """ filename = ( base_settings["unittest_data_dir"] / "compartmentdefinition-encounter.json" ) inst = compartmentdefinition.CompartmentDefinition.model_validate_json( filename.read_bytes() ) assert "CompartmentDefinition" == inst.get_resource_type() impl_compartmentdefinition_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CompartmentDefinition" == data["resourceType"] inst2 = compartmentdefinition.CompartmentDefinition(**data) impl_compartmentdefinition_5(inst2) def impl_compartmentdefinition_6(inst): assert inst.code == "Device" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.description == ( "There is an instance of the device compartment for each " "Device resource, and the identity of the compartment is the " "same as the Device. The set of resources associated with a " "particular device" ) assert inst.experimental is True assert inst.id == "device" assert inst.name == "Base FHIR compartment definition for Device" assert inst.publisher == "FHIR Project Team" assert inst.resource[0].code == "Account" assert inst.resource[0].param[0] == "subject" assert inst.resource[1].code == "ActivityDefinition" assert inst.resource[2].code == "AdministrableProductDefinition" assert inst.resource[3].code == "AdverseEvent" assert inst.resource[4].code == "AllergyIntolerance" assert inst.resource[5].code == "Appointment" assert inst.resource[5].param[0] == "actor" assert inst.resource[6].code == "AppointmentResponse" assert inst.resource[6].param[0] == "actor" assert inst.resource[7].code == "AuditEvent" assert inst.resource[7].param[0] == "agent" assert inst.resource[8].code == "Basic" assert inst.resource[9].code == "Binary" assert inst.search is True assert inst.status == "draft" assert inst.text.status == "extensions" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CompartmentDefinition/device"} ).valueUri ) assert inst.version == "4.3.0" def test_compartmentdefinition_6(base_settings): """No. 6 tests collection for CompartmentDefinition. Test File: compartmentdefinition-device.json """ filename = base_settings["unittest_data_dir"] / "compartmentdefinition-device.json" inst = compartmentdefinition.CompartmentDefinition.model_validate_json( filename.read_bytes() ) assert "CompartmentDefinition" == inst.get_resource_type() impl_compartmentdefinition_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CompartmentDefinition" == data["resourceType"] inst2 = compartmentdefinition.CompartmentDefinition(**data) impl_compartmentdefinition_6(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_composition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Composition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import composition from .conftest import ExternalValidatorModel # noqa: F401 def impl_composition_1(inst): assert inst.attester[0].mode == "legal" assert inst.attester[0].party.display == "Harold Hippocrates, MD" assert inst.attester[0].party.reference == "Practitioner/xcda-author" assert ( inst.attester[0].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-01-04T09:10:14Z"} ).valueDateTime ) assert inst.author[0].display == "Harold Hippocrates, MD" assert inst.author[0].reference == "Practitioner/xcda-author" assert inst.category[0].coding[0].code == "LP173421-1" assert inst.category[0].coding[0].display == "Report" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.confidentiality == "N" assert inst.custodian.display == "Good Health Clinic" assert inst.custodian.reference == "Organization/2.16.840.1.113883.19.5" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-30T16:56:04+11:00"} ).valueDateTime ) assert inst.id == "example-mixed" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.section[0].code.coding[0].code == "newborn" assert inst.section[0].code.coding[0].display == "New Born Details" assert ( inst.section[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org/codes/SectionType"} ).valueUri ) assert inst.section[0].text.status == "generated" assert inst.section[0].title == "Child's Details" assert inst.section[1].code.coding[0].code == "mother" assert inst.section[1].code.coding[0].display == "Mother's Details" assert ( inst.section[1].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org/codes/SectionType"} ).valueUri ) assert inst.section[1].text.status == "generated" assert inst.section[1].title == "Mpther's Details" assert inst.status == "final" assert inst.subject.display == "Tahlia Smith" assert inst.subject.reference == "Patient/newborn" assert inst.text.status == "generated" assert inst.title == "Discharge Summary (Neonatal Service)" assert inst.type.coding[0].code == "78418-1" assert ( inst.type.coding[0].display == "Neonatal perinatal medicine Discharge summary" ) assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) def test_composition_1(base_settings): """No. 1 tests collection for Composition. Test File: composition-example-mixed.json """ filename = base_settings["unittest_data_dir"] / "composition-example-mixed.json" inst = composition.Composition.model_validate_json(filename.read_bytes()) assert "Composition" == inst.get_resource_type() impl_composition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Composition" == data["resourceType"] inst2 = composition.Composition(**data) impl_composition_1(inst2) def impl_composition_2(inst): assert inst.attester[0].mode == "legal" assert inst.attester[0].party.display == "Harold Hippocrates, MD" assert inst.attester[0].party.reference == "Practitioner/xcda-author" assert ( inst.attester[0].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-01-04T09:10:14Z"} ).valueDateTime ) assert inst.author[0].display == "Harold Hippocrates, MD" assert inst.author[0].reference == "Practitioner/xcda-author" assert inst.category[0].coding[0].code == "LP173421-1" assert inst.category[0].coding[0].display == "Report" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.confidentiality == "N" assert inst.custodian.display == "Good Health Clinic" assert inst.custodian.reference == "Organization/2.16.840.1.113883.19.5" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-01-04T09:10:14Z"} ).valueDateTime ) assert inst.encounter.reference == "Encounter/xcda" assert inst.event[0].code[0].coding[0].code == "HEALTHREC" assert inst.event[0].code[0].coding[0].display == "health record" assert ( inst.event[0].code[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.event[0].detail[0].reference == "Observation/example" assert ( inst.event[0].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-11-12"} ).valueDateTime ) assert ( inst.event[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2010-07-18"} ).valueDateTime ) assert inst.id == "example" assert ( inst.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://healthintersections.com.au/test"} ).valueUri ) assert inst.identifier.value == "1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.relatesTo[0].code == "replaces" assert inst.relatesTo[0].targetReference.reference == "Composition/old-example" assert inst.relatesTo[1].code == "appends" assert ( inst.relatesTo[1].targetIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/NamingSystem/document-ids"} ).valueUri ) assert inst.relatesTo[1].targetIdentifier.value == "ABC123" assert inst.section[0].code.coding[0].code == "11348-0" assert inst.section[0].code.coding[0].display == "History of past illness Narrative" assert ( inst.section[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.section[0].entry[0].reference == "Condition/stroke" assert inst.section[0].entry[1].reference == "Condition/example" assert inst.section[0].entry[2].reference == "Condition/example2" assert inst.section[0].mode == "snapshot" assert inst.section[0].orderedBy.coding[0].code == "event-date" assert inst.section[0].orderedBy.coding[0].display == "Sorted by Event Date" assert ( inst.section[0].orderedBy.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/list-order"} ).valueUri ) assert inst.section[0].text.status == "generated" assert inst.section[0].title == "History of present illness" assert inst.section[1].code.coding[0].code == "10157-6" assert ( inst.section[1].code.coding[0].display == "History of family member diseases Narrative" ) assert ( inst.section[1].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.section[1].emptyReason.coding[0].code == "withheld" assert inst.section[1].emptyReason.coding[0].display == "Information Withheld" assert ( inst.section[1].emptyReason.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/list-empty-reason"} ).valueUri ) assert inst.section[1].mode == "snapshot" assert inst.section[1].text.status == "generated" assert inst.section[1].title == "History of family member diseases" assert inst.status == "final" assert inst.subject.display == "Henry Levin the 7th" assert inst.subject.reference == "Patient/xcda" assert inst.text.status == "generated" assert inst.title == "Consultation Note" assert inst.type.coding[0].code == "11488-4" assert inst.type.coding[0].display == "Consult note" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) def test_composition_2(base_settings): """No. 2 tests collection for Composition. Test File: composition-example.json """ filename = base_settings["unittest_data_dir"] / "composition-example.json" inst = composition.Composition.model_validate_json(filename.read_bytes()) assert "Composition" == inst.get_resource_type() impl_composition_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Composition" == data["resourceType"] inst2 = composition.Composition(**data) impl_composition_2(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_conceptmap.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ConceptMap Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import conceptmap from .conftest import ExternalValidatorModel # noqa: F401 def impl_conceptmap_1(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.description == ( 'Canonical Mapping for "The lifecycle status of an ' 'artifact."' ) assert inst.experimental is False assert inst.group[0].element[0].code == "draft" assert inst.group[0].element[0].target[0].code == "draft" assert inst.group[0].element[0].target[0].equivalence == "equivalent" assert inst.group[0].element[1].code == "active" assert inst.group[0].element[1].target[0].code == "active" assert inst.group[0].element[1].target[0].equivalence == "equivalent" assert inst.group[0].element[2].code == "retired" assert inst.group[0].element[2].target[0].code == "inactive" assert inst.group[0].element[2].target[0].equivalence == "equivalent" assert inst.group[0].element[3].code == "unknown" assert inst.group[0].element[3].target[0].code == "unknown" assert inst.group[0].element[3].target[0].equivalence == "equivalent" assert ( inst.group[0].source == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/publication-status"} ).valueUri ) assert ( inst.group[0].target == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/resource-status"} ).valueUri ) assert inst.id == "sc-publication-status" assert inst.name == "PublicationStatusCanonicalMap" assert inst.publisher == "HL7 (FHIR Project)" assert inst.sourceCanonical == "http://hl7.org/fhir/ValueSet/publication-status" assert inst.status == "draft" assert inst.targetCanonical == "http://hl7.org/fhir/ValueSet/resource-status" assert inst.text.status == "extensions" assert inst.title == 'Canonical Mapping for "PublicationStatus"' assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/sc-publication-status"} ).valueUri ) assert inst.version == "4.3.0" def test_conceptmap_1(base_settings): """No. 1 tests collection for ConceptMap. Test File: sc-valueset-publication-status.json """ filename = ( base_settings["unittest_data_dir"] / "sc-valueset-publication-status.json" ) inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_1(inst2) def impl_conceptmap_2(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.experimental is False assert inst.group[0].element[0].code == "home" assert inst.group[0].element[0].target[0].code == "H" assert inst.group[0].element[0].target[0].equivalence == "equivalent" assert inst.group[0].element[1].code == "work" assert inst.group[0].element[1].target[0].code == "WP" assert inst.group[0].element[1].target[0].equivalence == "equivalent" assert inst.group[0].element[2].code == "temp" assert inst.group[0].element[2].target[0].code == "TMP" assert inst.group[0].element[2].target[0].equivalence == "equivalent" assert inst.group[0].element[3].code == "old" assert inst.group[0].element[3].target[0].code == "OLD" assert inst.group[0].element[3].target[0].comment == "Bad or Old" assert inst.group[0].element[3].target[0].equivalence == "narrower" assert inst.group[0].element[3].target[1].code == "BAD" assert inst.group[0].element[3].target[1].comment == "Bad or Old" assert inst.group[0].element[3].target[1].equivalence == "narrower" assert ( inst.group[0].source == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/address-use"} ).valueUri ) assert ( inst.group[0].target == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-AddressUse"} ).valueUri ) assert inst.id == "cm-address-use-v3" assert inst.name == "v3.AddressUse" assert inst.publisher == "HL7 (FHIR Project)" assert inst.sourceCanonical == "http://hl7.org/fhir/ValueSet/address-use" assert inst.status == "draft" assert inst.targetCanonical == "http://terminology.hl7.org/ValueSet/v3-AddressUse" assert inst.text.status == "extensions" assert inst.title == "v3 map for AddressUse" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/cm-address-use-v3"} ).valueUri ) assert inst.version == "4.3.0" def test_conceptmap_2(base_settings): """No. 2 tests collection for ConceptMap. Test File: cm-address-use-v3.json """ filename = base_settings["unittest_data_dir"] / "cm-address-use-v3.json" inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_2(inst2) def impl_conceptmap_3(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.description == ( 'Canonical Mapping for "This value set includes Status ' 'codes."' ) assert inst.experimental is False assert inst.group[0].element[0].code == "entered-in-error" assert inst.group[0].element[0].target[0].code == "error" assert inst.group[0].element[0].target[0].equivalence == "equivalent" assert inst.group[0].element[1].code == "draft" assert inst.group[0].element[1].target[0].code == "draft" assert inst.group[0].element[1].target[0].equivalence == "equivalent" assert inst.group[0].element[2].code == "active" assert inst.group[0].element[2].target[0].code == "active" assert inst.group[0].element[2].target[0].equivalence == "equivalent" assert inst.group[0].element[3].code == "cancelled" assert inst.group[0].element[3].target[0].code == "abandoned" assert inst.group[0].element[3].target[0].equivalence == "equivalent" assert ( inst.group[0].source == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/fm-status"} ).valueUri ) assert ( inst.group[0].target == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/resource-status"} ).valueUri ) assert inst.id == "sc-fm-status" assert inst.name == "FinancialResourceStatusCodesCanonicalMap" assert inst.publisher == "Financial Management" assert inst.sourceCanonical == "http://hl7.org/fhir/ValueSet/fm-status" assert inst.status == "draft" assert inst.targetCanonical == "http://hl7.org/fhir/ValueSet/resource-status" assert inst.text.status == "extensions" assert inst.title == 'Canonical Mapping for "Financial Resource Status Codes"' assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/sc-fm-status"} ).valueUri ) assert inst.version == "4.3.0" def test_conceptmap_3(base_settings): """No. 3 tests collection for ConceptMap. Test File: sc-valueset-fm-status.json """ filename = base_settings["unittest_data_dir"] / "sc-valueset-fm-status.json" inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_3(inst2) def impl_conceptmap_4(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-17T07:06:13+11:00"} ).valueDateTime ) assert inst.description == ( 'Canonical Mapping for "Indicates whether this flag is ' "active and needs to be displayed to a user, or whether it is" ' no longer needed or was entered in error."' ) assert inst.experimental is False assert inst.group[0].element[0].code == "entered-in-error" assert inst.group[0].element[0].target[0].code == "error" assert inst.group[0].element[0].target[0].equivalence == "equivalent" assert inst.group[0].element[1].code == "active" assert inst.group[0].element[1].target[0].code == "active" assert inst.group[0].element[1].target[0].equivalence == "equivalent" assert inst.group[0].element[2].code == "inactive" assert inst.group[0].element[2].target[0].code == "inactive" assert inst.group[0].element[2].target[0].equivalence == "equivalent" assert ( inst.group[0].source == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/flag-status"} ).valueUri ) assert ( inst.group[0].target == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/resource-status"} ).valueUri ) assert inst.id == "sc-flag-status" assert inst.name == "FlagStatusCanonicalMap" assert inst.publisher == "HL7 (FHIR Project)" assert inst.sourceCanonical == "http://hl7.org/fhir/ValueSet/flag-status" assert inst.status == "draft" assert inst.targetCanonical == "http://hl7.org/fhir/ValueSet/resource-status" assert inst.text.status == "extensions" assert inst.title == 'Canonical Mapping for "FlagStatus"' assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/sc-flag-status"} ).valueUri ) assert inst.version == "4.3.0" def test_conceptmap_4(base_settings): """No. 4 tests collection for ConceptMap. Test File: sc-valueset-flag-status.json """ filename = base_settings["unittest_data_dir"] / "sc-valueset-flag-status.json" inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_4(inst2) def impl_conceptmap_5(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-17T07:06:13+11:00"} ).valueDateTime ) assert inst.description == ( 'Canonical Mapping for "The availability status of the ' 'device."' ) assert inst.experimental is False assert inst.group[0].element[0].code == "entered-in-error" assert inst.group[0].element[0].target[0].code == "error" assert inst.group[0].element[0].target[0].equivalence == "equivalent" assert inst.group[0].element[1].code == "active" assert inst.group[0].element[1].target[0].code == "active" assert inst.group[0].element[1].target[0].equivalence == "equivalent" assert inst.group[0].element[2].code == "inactive" assert inst.group[0].element[2].target[0].code == "inactive" assert inst.group[0].element[2].target[0].equivalence == "equivalent" assert inst.group[0].element[3].code == "unknown" assert inst.group[0].element[3].target[0].code == "unknown" assert inst.group[0].element[3].target[0].equivalence == "equivalent" assert ( inst.group[0].source == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/device-status"} ).valueUri ) assert ( inst.group[0].target == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/resource-status"} ).valueUri ) assert inst.id == "sc-device-status" assert inst.name == "FHIRDeviceStatusCanonicalMap" assert inst.publisher == "HL7 (FHIR Project)" assert inst.sourceCanonical == "http://hl7.org/fhir/ValueSet/device-status" assert inst.status == "draft" assert inst.targetCanonical == "http://hl7.org/fhir/ValueSet/resource-status" assert inst.text.status == "extensions" assert inst.title == 'Canonical Mapping for "FHIRDeviceStatus"' assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/sc-device-status"} ).valueUri ) assert inst.version == "4.3.0" def test_conceptmap_5(base_settings): """No. 5 tests collection for ConceptMap. Test File: sc-valueset-device-status.json """ filename = base_settings["unittest_data_dir"] / "sc-valueset-device-status.json" inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_5(inst2) def impl_conceptmap_6(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.experimental is False assert inst.group[0].element[0].code == "home" assert inst.group[0].element[0].target[0].code == "PRN" assert inst.group[0].element[0].target[0].equivalence == "narrower" assert inst.group[0].element[0].target[1].code == "ORN" assert inst.group[0].element[0].target[1].equivalence == "narrower" assert inst.group[0].element[0].target[2].code == "VHN" assert inst.group[0].element[0].target[2].equivalence == "narrower" assert inst.group[0].element[1].code == "work" assert inst.group[0].element[1].target[0].code == "WPN" assert inst.group[0].element[1].target[0].equivalence == "equivalent" assert inst.group[0].element[2].code == "mobile" assert inst.group[0].element[2].target[0].code == "PRS" assert inst.group[0].element[2].target[0].equivalence == "equivalent" assert ( inst.group[0].source == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/contact-point-use"} ).valueUri ) assert ( inst.group[0].target == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0201"} ).valueUri ) assert inst.id == "cm-contact-point-use-v2" assert inst.name == "v2.ContactPointUse" assert inst.publisher == "HL7 (FHIR Project)" assert inst.sourceCanonical == "http://hl7.org/fhir/ValueSet/contact-point-use" assert inst.status == "draft" assert inst.targetCanonical == "http://terminology.hl7.org/ValueSet/v2-0201" assert inst.text.status == "extensions" assert inst.title == "v2 map for ContactPointUse" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/cm-contact-point-use-v2"} ).valueUri ) assert inst.version == "4.3.0" def test_conceptmap_6(base_settings): """No. 6 tests collection for ConceptMap. Test File: cm-contact-point-use-v2.json """ filename = base_settings["unittest_data_dir"] / "cm-contact-point-use-v2.json" inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_6(inst2) def impl_conceptmap_7(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.description == ( 'Canonical Mapping for "Preferred value set for ' 'AllergyIntolerance Clinical Status."' ) assert inst.experimental is False assert inst.group[0].element[0].code == "active" assert inst.group[0].element[0].target[0].code == "active" assert inst.group[0].element[0].target[0].equivalence == "equivalent" assert inst.group[0].element[1].code == "inactive" assert inst.group[0].element[1].target[0].code == "inactive" assert inst.group[0].element[1].target[0].equivalence == "equivalent" assert inst.group[0].element[2].code == "resolved" assert inst.group[0].element[2].target[0].code == "resolved" assert inst.group[0].element[2].target[0].equivalence == "equivalent" assert ( inst.group[0].source == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical" } ).valueUri ) assert ( inst.group[0].target == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/resource-status"} ).valueUri ) assert inst.id == "sc-allergyintolerance-clinical" assert inst.name == "AllergyIntoleranceClinicalStatusCodesCanonicalMap" assert inst.publisher == "FHIR Project team" assert ( inst.sourceCanonical == "http://hl7.org/fhir/ValueSet/allergyintolerance-clinical" ) assert inst.status == "draft" assert inst.targetCanonical == "http://hl7.org/fhir/ValueSet/resource-status" assert inst.text.status == "extensions" assert inst.title == ( 'Canonical Mapping for "AllergyIntolerance Clinical Status ' 'Codes"' ) assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/ConceptMap/sc-allergyintolerance-clinical" } ).valueUri ) assert inst.version == "4.3.0" def test_conceptmap_7(base_settings): """No. 7 tests collection for ConceptMap. Test File: sc-valueset-allergyintolerance-clinical.json """ filename = ( base_settings["unittest_data_dir"] / "sc-valueset-allergyintolerance-clinical.json" ) inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_7(inst2) def impl_conceptmap_8(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.description == 'Canonical Mapping for "Medication Status Codes"' assert inst.experimental is False assert inst.group[0].element[0].code == "entered-in-error" assert inst.group[0].element[0].target[0].code == "error" assert inst.group[0].element[0].target[0].equivalence == "equivalent" assert inst.group[0].element[1].code == "active" assert inst.group[0].element[1].target[0].code == "active" assert inst.group[0].element[1].target[0].equivalence == "equivalent" assert inst.group[0].element[2].code == "inactive" assert inst.group[0].element[2].target[0].code == "inactive" assert inst.group[0].element[2].target[0].equivalence == "equivalent" assert ( inst.group[0].source == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CodeSystem/medication-status"} ).valueUri ) assert ( inst.group[0].target == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/resource-status"} ).valueUri ) assert inst.id == "sc-medication-status" assert inst.name == "Medication Status CodesCanonicalMap" assert inst.publisher == "FHIR Project team" assert inst.sourceCanonical == "http://hl7.org/fhir/ValueSet/medication-status" assert inst.status == "draft" assert inst.targetCanonical == "http://hl7.org/fhir/ValueSet/resource-status" assert inst.text.status == "extensions" assert inst.title == 'Canonical Mapping for "Medication Status Codes"' assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/sc-medication-status"} ).valueUri ) assert inst.version == "4.3.0" def test_conceptmap_8(base_settings): """No. 8 tests collection for ConceptMap. Test File: sc-valueset-medication-status.json """ filename = base_settings["unittest_data_dir"] / "sc-valueset-medication-status.json" inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_8(inst2) def impl_conceptmap_9(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-17T07:06:13+11:00"} ).valueDateTime ) assert inst.description == ( 'Canonical Mapping for "Indicates whether the location is ' 'still in use."' ) assert inst.experimental is False assert inst.group[0].element[0].code == "active" assert inst.group[0].element[0].target[0].code == "active" assert inst.group[0].element[0].target[0].equivalence == "equivalent" assert inst.group[0].element[1].code == "suspended" assert inst.group[0].element[1].target[0].code == "suspended" assert inst.group[0].element[1].target[0].equivalence == "equivalent" assert inst.group[0].element[2].code == "inactive" assert inst.group[0].element[2].target[0].code == "inactive" assert inst.group[0].element[2].target[0].equivalence == "equivalent" assert ( inst.group[0].source == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/location-status"} ).valueUri ) assert ( inst.group[0].target == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/resource-status"} ).valueUri ) assert inst.id == "sc-location-status" assert inst.name == "LocationStatusCanonicalMap" assert inst.publisher == "HL7 (FHIR Project)" assert inst.sourceCanonical == "http://hl7.org/fhir/ValueSet/location-status" assert inst.status == "draft" assert inst.targetCanonical == "http://hl7.org/fhir/ValueSet/resource-status" assert inst.text.status == "extensions" assert inst.title == 'Canonical Mapping for "LocationStatus"' assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/sc-location-status"} ).valueUri ) assert inst.version == "4.3.0" def test_conceptmap_9(base_settings): """No. 9 tests collection for ConceptMap. Test File: sc-valueset-location-status.json """ filename = base_settings["unittest_data_dir"] / "sc-valueset-location-status.json" inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_9(inst2) def impl_conceptmap_10(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-17T07:06:13+11:00"} ).valueDateTime ) assert inst.description == ( 'Canonical Mapping for "The verification status to support ' "or decline the clinical status of the condition or " 'diagnosis."' ) assert inst.experimental is False assert inst.group[0].element[0].code == "entered-in-error" assert inst.group[0].element[0].target[0].code == "error" assert inst.group[0].element[0].target[0].equivalence == "equivalent" assert inst.group[0].element[1].code == "unknown" assert inst.group[0].element[1].target[0].code == "unknown" assert inst.group[0].element[1].target[0].equivalence == "equivalent" assert inst.group[0].element[2].code == "unconfirmed, provisional" assert inst.group[0].element[2].target[0].code == "unconfirmed" assert inst.group[0].element[2].target[0].equivalence == "equivalent" assert inst.group[0].element[3].code == "confirmed" assert inst.group[0].element[3].target[0].code == "confirmed" assert inst.group[0].element[3].target[0].equivalence == "equivalent" assert inst.group[0].element[4].code == "refuted" assert inst.group[0].element[4].target[0].code == "refuted" assert inst.group[0].element[4].target[0].equivalence == "equivalent" assert inst.group[0].element[5].code == "differential" assert inst.group[0].element[5].target[0].code == "differential" assert inst.group[0].element[5].target[0].equivalence == "equivalent" assert ( inst.group[0].source == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-ver-status"} ).valueUri ) assert ( inst.group[0].target == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/resource-status"} ).valueUri ) assert inst.id == "sc-condition-ver-status" assert inst.name == "ConditionVerificationStatusCanonicalMap" assert inst.publisher == "HL7 (FHIR Project)" assert inst.sourceCanonical == "http://hl7.org/fhir/ValueSet/condition-ver-status" assert inst.status == "draft" assert inst.targetCanonical == "http://hl7.org/fhir/ValueSet/resource-status" assert inst.text.status == "extensions" assert inst.title == 'Canonical Mapping for "ConditionVerificationStatus"' assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/sc-condition-ver-status"} ).valueUri ) assert inst.version == "4.3.0" def test_conceptmap_10(base_settings): """No. 10 tests collection for ConceptMap. Test File: sc-valueset-condition-ver-status.json """ filename = ( base_settings["unittest_data_dir"] / "sc-valueset-condition-ver-status.json" ) inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_condition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Condition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import condition from .conftest import ExternalValidatorModel # noqa: F401 def impl_condition_1(inst): assert inst.asserter.display == "P. van de Heuvel" assert inst.asserter.reference == "Patient/f001" assert inst.bodySite[0].coding[0].code == "280193007" assert inst.bodySite[0].coding[0].display == "Entire retropharyngeal area" assert ( inst.bodySite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].coding[0].code == "439401001" assert inst.category[0].coding[0].display == "diagnosis" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.clinicalStatus.coding[0].code == "active" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-clinical"} ).valueUri ) assert inst.code.coding[0].code == "18099001" assert inst.code.coding[0].display == "Retropharyngeal abscess" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.encounter.reference == "Encounter/f003" assert inst.evidence[0].code[0].coding[0].code == "169068008" assert inst.evidence[0].code[0].coding[0].display == "CT of neck" assert ( inst.evidence[0].code[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "f003" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.onsetDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-02-27"} ).valueDateTime ) assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-02-20"} ).valueDateTime ) assert inst.severity.coding[0].code == "371923003" assert inst.severity.coding[0].display == "Mild to moderate" assert ( inst.severity.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.subject.display == "P. van de Heuvel" assert inst.subject.reference == "Patient/f001" assert inst.text.status == "generated" assert inst.verificationStatus.coding[0].code == "confirmed" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-ver-status"} ).valueUri ) def test_condition_1(base_settings): """No. 1 tests collection for Condition. Test File: condition-example-f003-abscess.json """ filename = ( base_settings["unittest_data_dir"] / "condition-example-f003-abscess.json" ) inst = condition.Condition.model_validate_json(filename.read_bytes()) assert "Condition" == inst.get_resource_type() impl_condition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Condition" == data["resourceType"] inst2 = condition.Condition(**data) impl_condition_1(inst2) def impl_condition_2(inst): assert inst.asserter.reference == "Practitioner/f201" assert inst.bodySite[0].coding[0].code == "281158006" assert inst.bodySite[0].coding[0].display == "Pulmonary vascular structure" assert ( inst.bodySite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].coding[0].code == "55607006" assert inst.category[0].coding[0].display == "Problem" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].coding[1].code == "problem-list-item" assert ( inst.category[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-category"} ).valueUri ) assert inst.clinicalStatus.coding[0].code == "active" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-clinical"} ).valueUri ) assert inst.code.coding[0].code == "10001005" assert inst.code.coding[0].display == "Bacterial sepsis" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.encounter.display == "Roel's encounter on March elevanth" assert inst.encounter.reference == "Encounter/f203" assert inst.evidence[0].detail[0].display == "Diagnostic report for Roel's sepsis" assert inst.evidence[0].detail[0].reference == "DiagnosticReport/f202" assert inst.id == "f203" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.onsetDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-08"} ).valueDateTime ) assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-11"} ).valueDateTime ) assert inst.severity.coding[0].code == "371924009" assert inst.severity.coding[0].display == "Moderate to severe" assert ( inst.severity.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" assert inst.verificationStatus.coding[0].code == "confirmed" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-ver-status"} ).valueUri ) def test_condition_2(base_settings): """No. 2 tests collection for Condition. Test File: condition-example-f203-sepsis.json """ filename = base_settings["unittest_data_dir"] / "condition-example-f203-sepsis.json" inst = condition.Condition.model_validate_json(filename.read_bytes()) assert "Condition" == inst.get_resource_type() impl_condition_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Condition" == data["resourceType"] inst2 = condition.Condition(**data) impl_condition_2(inst2) def impl_condition_3(inst): assert inst.category[0].coding[0].code == "encounter-diagnosis" assert inst.category[0].coding[0].display == "Encounter Diagnosis" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-category"} ).valueUri ) assert inst.clinicalStatus.coding[0].code == "active" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-clinical"} ).valueUri ) assert inst.code.coding[0].code == "422504002" assert inst.code.coding[0].display == "Ischemic stroke (disorder)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Stroke" assert inst.id == "stroke" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.onsetDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2010-07-18"} ).valueDateTime ) assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Ischemic stroke,' " July 18, 2010
" ) assert inst.text.status == "generated" assert inst.verificationStatus.coding[0].code == "confirmed" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-ver-status"} ).valueUri ) def test_condition_3(base_settings): """No. 3 tests collection for Condition. Test File: condition-example-stroke.json """ filename = base_settings["unittest_data_dir"] / "condition-example-stroke.json" inst = condition.Condition.model_validate_json(filename.read_bytes()) assert "Condition" == inst.get_resource_type() impl_condition_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Condition" == data["resourceType"] inst2 = condition.Condition(**data) impl_condition_3(inst2) def impl_condition_4(inst): assert inst.category[0].coding[0].code == "problem-list-item" assert inst.category[0].coding[0].display == "Problem List Item" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-category"} ).valueUri ) assert inst.clinicalStatus.coding[0].code == "active" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-clinical"} ).valueUri ) assert inst.code.coding[0].code == "312824007" assert inst.code.coding[0].display == "Family history of cancer of colon" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "family-history" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Family history ' "of cancer of colon
" ) assert inst.text.status == "generated" def test_condition_4(base_settings): """No. 4 tests collection for Condition. Test File: condition-example-family-history.json """ filename = ( base_settings["unittest_data_dir"] / "condition-example-family-history.json" ) inst = condition.Condition.model_validate_json(filename.read_bytes()) assert "Condition" == inst.get_resource_type() impl_condition_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Condition" == data["resourceType"] inst2 = condition.Condition(**data) impl_condition_4(inst2) def impl_condition_5(inst): assert inst.asserter.display == "P. van de Heuvel" assert inst.asserter.reference == "Patient/f001" assert inst.bodySite[0].coding[0].code == "51185008" assert inst.bodySite[0].coding[0].display == "Thorax" assert ( inst.bodySite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].coding[0].code == "439401001" assert inst.category[0].coding[0].display == "diagnosis" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.clinicalStatus.coding[0].code == "active" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-clinical"} ).valueUri ) assert inst.code.coding[0].code == "254637007" assert inst.code.coding[0].display == "NSCLC - Non-small cell lung cancer" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.encounter.reference == "Encounter/f002" assert inst.evidence[0].code[0].coding[0].code == "169069000" assert inst.evidence[0].code[0].coding[0].display == "CT of thorax" assert ( inst.evidence[0].code[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "f002" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.onsetDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2011-05-05"} ).valueDateTime ) assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-06-03"} ).valueDateTime ) assert inst.severity.coding[0].code == "24484000" assert inst.severity.coding[0].display == "Severe" assert ( inst.severity.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.stage[0].summary.coding[0].code == "258219007" assert inst.stage[0].summary.coding[0].display == "stage II" assert ( inst.stage[0].summary.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.stage[0].type.coding[0].code == "260998006" assert inst.stage[0].type.coding[0].display == "Clinical staging (qualifier value)" assert ( inst.stage[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.subject.display == "P. van de Heuvel" assert inst.subject.reference == "Patient/f001" assert inst.text.status == "generated" assert inst.verificationStatus.coding[0].code == "confirmed" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-ver-status"} ).valueUri ) def test_condition_5(base_settings): """No. 5 tests collection for Condition. Test File: condition-example-f002-lung.json """ filename = base_settings["unittest_data_dir"] / "condition-example-f002-lung.json" inst = condition.Condition.model_validate_json(filename.read_bytes()) assert "Condition" == inst.get_resource_type() impl_condition_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Condition" == data["resourceType"] inst2 = condition.Condition(**data) impl_condition_5(inst2) def impl_condition_6(inst): assert inst.asserter.reference == "Practitioner/f201" assert inst.clinicalStatus.coding[0].code == "active" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-clinical"} ).valueUri ) assert inst.code.coding[0].code == "87628006" assert inst.code.coding[0].display == "Bacterial infectious disease" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "f205" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-04-04"} ).valueDateTime ) assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" assert inst.verificationStatus.coding[0].code == "differential" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-ver-status"} ).valueUri ) def test_condition_6(base_settings): """No. 6 tests collection for Condition. Test File: condition-example-f205-infection.json """ filename = ( base_settings["unittest_data_dir"] / "condition-example-f205-infection.json" ) inst = condition.Condition.model_validate_json(filename.read_bytes()) assert "Condition" == inst.get_resource_type() impl_condition_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Condition" == data["resourceType"] inst2 = condition.Condition(**data) impl_condition_6(inst2) def impl_condition_7(inst): assert ( inst.abatementDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-20"} ).valueDateTime ) assert inst.asserter.reference == "Practitioner/f201" assert inst.bodySite[0].coding[0].code == "181414000" assert inst.bodySite[0].coding[0].display == "Kidney" assert ( inst.bodySite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].coding[0].code == "55607006" assert inst.category[0].coding[0].display == "Problem" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].coding[1].code == "problem-list-item" assert ( inst.category[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-category"} ).valueUri ) assert inst.clinicalStatus.coding[0].code == "inactive" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-clinical"} ).valueUri ) assert inst.code.coding[0].code == "36225005" assert ( inst.code.coding[0].display == "Acute renal insufficiency specified as due to procedure" ) assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.encounter.display == "Roel's encounter on March elevanth" assert inst.encounter.reference == "Encounter/f203" assert inst.id == "f204" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "The patient is anuric." assert ( inst.onsetDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-11"} ).valueDateTime ) assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-11"} ).valueDateTime ) assert inst.severity.coding[0].code == "24484000" assert inst.severity.coding[0].display == "Severe" assert ( inst.severity.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.stage[0].assessment[0].display == "Genetic analysis master panel" assert inst.stage[0].summary.coding[0].code == "14803004" assert inst.stage[0].summary.coding[0].display == "Temporary" assert ( inst.stage[0].summary.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" assert inst.verificationStatus.coding[0].code == "differential" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-ver-status"} ).valueUri ) def test_condition_7(base_settings): """No. 7 tests collection for Condition. Test File: condition-example-f204-renal.json """ filename = base_settings["unittest_data_dir"] / "condition-example-f204-renal.json" inst = condition.Condition.model_validate_json(filename.read_bytes()) assert "Condition" == inst.get_resource_type() impl_condition_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Condition" == data["resourceType"] inst2 = condition.Condition(**data) impl_condition_7(inst2) def impl_condition_8(inst): assert inst.category[0].coding[0].code == "problem-list-item" assert inst.category[0].coding[0].display == "Problem List Item" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-category"} ).valueUri ) assert inst.clinicalStatus.coding[0].code == "active" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-clinical"} ).valueUri ) assert inst.code.text == "Asthma" assert inst.id == "example2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.onsetString == "approximately November 2012" assert inst.severity.coding[0].code == "255604002" assert inst.severity.coding[0].display == "Mild" assert ( inst.severity.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Mild Asthma ' "(Date: 12-Nov 2012)
" ) assert inst.text.status == "generated" assert inst.verificationStatus.coding[0].code == "confirmed" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-ver-status"} ).valueUri ) def test_condition_8(base_settings): """No. 8 tests collection for Condition. Test File: condition-example2.json """ filename = base_settings["unittest_data_dir"] / "condition-example2.json" inst = condition.Condition.model_validate_json(filename.read_bytes()) assert "Condition" == inst.get_resource_type() impl_condition_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Condition" == data["resourceType"] inst2 = condition.Condition(**data) impl_condition_8(inst2) def impl_condition_9(inst): assert inst.abatementAge.code == "a" assert ( inst.abatementAge.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.abatementAge.unit == "years" assert float(inst.abatementAge.value) == float(54) assert inst.bodySite[0].coding[0].code == "361355005" assert inst.bodySite[0].coding[0].display == "Entire head and neck" assert ( inst.bodySite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].coding[0].code == "encounter-diagnosis" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-category"} ).valueUri ) assert inst.clinicalStatus.coding[0].code == "resolved" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-clinical"} ).valueUri ) assert inst.code.coding[0].code == "363346000" assert inst.code.coding[0].display == "Malignant neoplastic disease" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.evidence[0].detail[0].display == "Erasmus' diagnostic report of Roel's tumor" ) assert inst.evidence[0].detail[0].reference == "DiagnosticReport/f201" assert inst.id == "f202" assert inst.meta.security[0].code == "TBOO" assert inst.meta.security[0].display == "taboo" assert ( inst.meta.security[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.onsetAge.code == "a" assert ( inst.onsetAge.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.onsetAge.unit == "years" assert float(inst.onsetAge.value) == float(52) assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-12-01"} ).valueDateTime ) assert inst.severity.coding[0].code == "24484000" assert inst.severity.coding[0].display == "Severe" assert ( inst.severity.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" assert inst.verificationStatus.coding[0].code == "confirmed" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-ver-status"} ).valueUri ) def test_condition_9(base_settings): """No. 9 tests collection for Condition. Test File: condition-example-f202-malignancy.json """ filename = ( base_settings["unittest_data_dir"] / "condition-example-f202-malignancy.json" ) inst = condition.Condition.model_validate_json(filename.read_bytes()) assert "Condition" == inst.get_resource_type() impl_condition_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Condition" == data["resourceType"] inst2 = condition.Condition(**data) impl_condition_9(inst2) def impl_condition_10(inst): assert inst.abatementString == "around April 9, 2013" assert inst.asserter.reference == "Practitioner/f201" assert inst.bodySite[0].coding[0].code == "38266002" assert inst.bodySite[0].coding[0].display == "Entire body as a whole" assert ( inst.bodySite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].coding[0].code == "55607006" assert inst.category[0].coding[0].display == "Problem" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].coding[1].code == "problem-list-item" assert ( inst.category[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-category"} ).valueUri ) assert inst.clinicalStatus.coding[0].code == "resolved" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-clinical"} ).valueUri ) assert inst.code.coding[0].code == "386661006" assert inst.code.coding[0].display == "Fever" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.encounter.reference == "Encounter/f201" assert inst.evidence[0].code[0].coding[0].code == "258710007" assert inst.evidence[0].code[0].coding[0].display == "degrees C" assert ( inst.evidence[0].code[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.evidence[0].detail[0].display == "Temperature" assert inst.evidence[0].detail[0].reference == "Observation/f202" assert inst.id == "f201" 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.onsetDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-04-02"} ).valueDateTime ) assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-04-04"} ).valueDateTime ) assert inst.recorder.reference == "Practitioner/f201" assert inst.severity.coding[0].code == "255604002" assert inst.severity.coding[0].display == "Mild" assert ( inst.severity.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" assert inst.verificationStatus.coding[0].code == "confirmed" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-ver-status"} ).valueUri ) def test_condition_10(base_settings): """No. 10 tests collection for Condition. Test File: condition-example-f201-fever.json """ filename = base_settings["unittest_data_dir"] / "condition-example-f201-fever.json" inst = condition.Condition.model_validate_json(filename.read_bytes()) assert "Condition" == inst.get_resource_type() impl_condition_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Condition" == data["resourceType"] inst2 = condition.Condition(**data) impl_condition_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_consent.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Consent Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import consent from .conftest import ExternalValidatorModel # noqa: F401 def impl_consent_1(inst): assert inst.category[0].coding[0].code == "59284-0" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-11-18"} ).valueDateTime ) assert inst.id == "consent-example-notThis" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.organization[0].reference == "Organization/f001" assert inst.patient.display == "P. van de Heuvel" assert inst.patient.reference == "Patient/f001" assert inst.policyRule.coding[0].code == "OPTIN" assert ( inst.policyRule.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.provision.data[0].meaning == "related" assert inst.provision.data[0].reference.reference == "Task/example3" assert inst.scope.coding[0].code == "patient-privacy" assert ( inst.scope.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentscope"} ).valueUri ) assert inst.sourceAttachment.title == "The terms of the consent in lawyer speak." assert inst.status == "active" assert inst.text.status == "generated" def test_consent_1(base_settings): """No. 1 tests collection for Consent. Test File: consent-example-notThis.json """ filename = base_settings["unittest_data_dir"] / "consent-example-notThis.json" inst = consent.Consent.model_validate_json(filename.read_bytes()) assert "Consent" == inst.get_resource_type() impl_consent_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Consent" == data["resourceType"] inst2 = consent.Consent(**data) impl_consent_1(inst2) def impl_consent_2(inst): assert inst.category[0].coding[0].code == "59284-0" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-06-23T17:02:33+10:00"} ).valueDateTime ) assert inst.id == "consent-example-smartonfhir" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.organization[0].reference == "Organization/f001" assert inst.patient.reference == "Patient/xcda" assert inst.performer[0].reference == "RelatedPerson/peter" assert inst.policyRule.coding[0].code == "OPTIN" assert ( inst.policyRule.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.provision.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-06-23T17:32:33+10:00"} ).valueDateTime ) assert ( inst.provision.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-06-23T17:02:33+10:00"} ).valueDateTime ) assert inst.provision.provision[0].action[0].coding[0].code == "access" assert ( inst.provision.provision[0].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert inst.provision.provision[0].class_fhir[0].code == "MedicationRequest" assert ( inst.provision.provision[0].class_fhir[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/resource-types"} ).valueUri ) assert inst.provision.provision[0].type == "permit" assert inst.scope.coding[0].code == "patient-privacy" assert ( inst.scope.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentscope"} ).valueUri ) assert inst.status == "active" assert inst.text.status == "generated" def test_consent_2(base_settings): """No. 2 tests collection for Consent. Test File: consent-example-smartonfhir.json """ filename = base_settings["unittest_data_dir"] / "consent-example-smartonfhir.json" inst = consent.Consent.model_validate_json(filename.read_bytes()) assert "Consent" == inst.get_resource_type() impl_consent_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Consent" == data["resourceType"] inst2 = consent.Consent(**data) impl_consent_2(inst2) def impl_consent_3(inst): assert inst.category[0].coding[0].code == "59284-0" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-11-18"} ).valueDateTime ) assert inst.id == "consent-example-notAuthor" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.organization[0].reference == "Organization/f001" assert inst.patient.display == "P. van de Heuvel" assert inst.patient.reference == "Patient/f001" assert inst.policyRule.coding[0].code == "OPTIN" assert ( inst.policyRule.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.provision.actor[0].reference.reference == "Organization/f001" assert inst.provision.actor[0].role.coding[0].code == "CST" assert ( inst.provision.actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.scope.coding[0].code == "patient-privacy" assert ( inst.scope.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentscope"} ).valueUri ) assert inst.sourceAttachment.title == "The terms of the consent in lawyer speak." assert inst.status == "active" assert inst.text.status == "generated" def test_consent_3(base_settings): """No. 3 tests collection for Consent. Test File: consent-example-notAuthor.json """ filename = base_settings["unittest_data_dir"] / "consent-example-notAuthor.json" inst = consent.Consent.model_validate_json(filename.read_bytes()) assert "Consent" == inst.get_resource_type() impl_consent_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Consent" == data["resourceType"] inst2 = consent.Consent(**data) impl_consent_3(inst2) def impl_consent_4(inst): assert inst.category[0].coding[0].code == "59284-0" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-11-18"} ).valueDateTime ) assert inst.id == "consent-example-notTime" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.organization[0].reference == "Organization/f001" assert inst.patient.display == "P. van de Heuvel" assert inst.patient.reference == "Patient/f001" assert inst.policyRule.coding[0].code == "OPTIN" assert ( inst.policyRule.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.provision.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-01"} ).valueDateTime ) assert ( inst.provision.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-01"} ).valueDateTime ) assert inst.scope.coding[0].code == "patient-privacy" assert ( inst.scope.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentscope"} ).valueUri ) assert inst.sourceAttachment.title == "The terms of the consent in lawyer speak." assert inst.status == "active" assert inst.text.status == "generated" def test_consent_4(base_settings): """No. 4 tests collection for Consent. Test File: consent-example-notTime.json """ filename = base_settings["unittest_data_dir"] / "consent-example-notTime.json" inst = consent.Consent.model_validate_json(filename.read_bytes()) assert "Consent" == inst.get_resource_type() impl_consent_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Consent" == data["resourceType"] inst2 = consent.Consent(**data) impl_consent_4(inst2) def impl_consent_5(inst): assert inst.category[0].coding[0].code == "npp" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentcategorycodes"} ).valueUri ) assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-05-26T00:41:10-04:00"} ).valueDateTime ) assert inst.id == "consent-example-signature" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.3.72.5.9.1"} ).valueUri ) assert inst.identifier[0].value == "494e0c7a-a69e-4fb4-9d02-6aae747790d7" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.organization[0].reference == "Organization/f001" assert inst.patient.reference == "Patient/72" assert inst.performer[0].reference == "Patient/72" assert inst.policyRule.coding[0].code == "OPTIN" assert ( inst.policyRule.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.provision.actor[0].reference.reference == "Practitioner/13" assert inst.provision.actor[0].role.coding[0].code == "PRCP" assert ( inst.provision.actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert ( inst.provision.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-10"} ).valueDateTime ) assert ( inst.provision.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-10-10"} ).valueDateTime ) assert ( inst.provision.provision[0].actor[0].reference.reference == "Practitioner/xcda-author" ) assert inst.provision.provision[0].actor[0].role.coding[0].code == "AUT" assert ( inst.provision.provision[0].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision.provision[0].class_fhir[0].code == "application/hl7-cda+xml" assert ( inst.provision.provision[0].class_fhir[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:13"} ).valueUri ) assert inst.provision.provision[0].code[0].coding[0].code == "34133-9" assert ( inst.provision.provision[0].code[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.provision.provision[0].code[1].coding[0].code == "18842-5" assert ( inst.provision.provision[0].code[1].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.provision.provision[0].type == "permit" assert inst.scope.coding[0].code == "patient-privacy" assert ( inst.scope.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentscope"} ).valueUri ) assert inst.status == "active" assert inst.text.status == "generated" def test_consent_5(base_settings): """No. 5 tests collection for Consent. Test File: consent-example-signature.json """ filename = base_settings["unittest_data_dir"] / "consent-example-signature.json" inst = consent.Consent.model_validate_json(filename.read_bytes()) assert "Consent" == inst.get_resource_type() impl_consent_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Consent" == data["resourceType"] inst2 = consent.Consent(**data) impl_consent_5(inst2) def impl_consent_6(inst): assert inst.category[0].coding[0].code == "59284-0" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-11-18"} ).valueDateTime ) assert inst.id == "consent-example-notThem" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.organization[0].reference == "Organization/f001" assert inst.patient.display == "P. van de Heuvel" assert inst.patient.reference == "Patient/f001" assert inst.policyRule.coding[0].code == "OPTIN" assert ( inst.policyRule.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.provision.action[0].coding[0].code == "access" assert ( inst.provision.action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert inst.provision.action[1].coding[0].code == "correct" assert ( inst.provision.action[1].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert inst.provision.actor[0].reference.display == "Fictive Nurse" assert inst.provision.actor[0].reference.reference == "Practitioner/f204" assert inst.provision.actor[0].role.coding[0].code == "PRCP" assert ( inst.provision.actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.scope.coding[0].code == "patient-privacy" assert ( inst.scope.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentscope"} ).valueUri ) assert inst.sourceAttachment.title == "The terms of the consent in lawyer speak." assert inst.status == "active" assert inst.text.status == "generated" def test_consent_6(base_settings): """No. 6 tests collection for Consent. Test File: consent-example-notThem.json """ filename = base_settings["unittest_data_dir"] / "consent-example-notThem.json" inst = consent.Consent.model_validate_json(filename.read_bytes()) assert "Consent" == inst.get_resource_type() impl_consent_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Consent" == data["resourceType"] inst2 = consent.Consent(**data) impl_consent_6(inst2) def impl_consent_7(inst): assert inst.category[0].coding[0].code == "INFAO" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-11-18"} ).valueDateTime ) assert inst.id == "consent-example-grantor" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.organization[0].reference == "Organization/f001" assert inst.patient.display == "P. van de Heuvel" assert inst.patient.reference == "Patient/f001" assert inst.policyRule.coding[0].code == "OPTOUT" assert ( inst.policyRule.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.provision.action[0].coding[0].code == "access" assert ( inst.provision.action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert inst.provision.actor[0].reference.reference == "Organization/f001" assert inst.provision.actor[0].role.coding[0].code == "CST" assert ( inst.provision.actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision.actor[1].reference.display == "Good Health Clinic" assert inst.provision.actor[1].reference.reference == "Patient/example" assert inst.provision.actor[1].role.coding[0].code == "PRCP" assert ( inst.provision.actor[1].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.scope.coding[0].code == "patient-privacy" assert ( inst.scope.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentscope"} ).valueUri ) assert inst.sourceAttachment.title == "The terms of the consent in lawyer speak." assert inst.status == "active" assert inst.text.status == "generated" def test_consent_7(base_settings): """No. 7 tests collection for Consent. Test File: consent-example-grantor.json """ filename = base_settings["unittest_data_dir"] / "consent-example-grantor.json" inst = consent.Consent.model_validate_json(filename.read_bytes()) assert "Consent" == inst.get_resource_type() impl_consent_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Consent" == data["resourceType"] inst2 = consent.Consent(**data) impl_consent_7(inst2) def impl_consent_8(inst): assert inst.category[0].coding[0].code == "59284-0" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-11-18"} ).valueDateTime ) assert inst.id == "consent-example-notOrg" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.organization[0].reference == "Organization/f001" assert inst.patient.display == "P. van de Heuvel" assert inst.patient.reference == "Patient/f001" assert inst.policyRule.coding[0].code == "OPTIN" assert ( inst.policyRule.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.provision.action[0].coding[0].code == "access" assert ( inst.provision.action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert inst.provision.action[1].coding[0].code == "correct" assert ( inst.provision.action[1].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert inst.provision.actor[0].reference.reference == "Organization/f001" assert inst.provision.actor[0].role.coding[0].code == "PRCP" assert ( inst.provision.actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision.type == "deny" assert inst.scope.coding[0].code == "patient-privacy" assert ( inst.scope.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentscope"} ).valueUri ) assert inst.sourceAttachment.title == "The terms of the consent in lawyer speak." assert inst.status == "active" assert inst.text.status == "generated" def test_consent_8(base_settings): """No. 8 tests collection for Consent. Test File: consent-example-notOrg.json """ filename = base_settings["unittest_data_dir"] / "consent-example-notOrg.json" inst = consent.Consent.model_validate_json(filename.read_bytes()) assert "Consent" == inst.get_resource_type() impl_consent_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Consent" == data["resourceType"] inst2 = consent.Consent(**data) impl_consent_8(inst2) def impl_consent_9(inst): assert inst.category[0].coding[0].code == "59284-0" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-06-16"} ).valueDateTime ) assert inst.id == "consent-example-pkb" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.organization[0].reference == "Organization/f001" assert inst.patient.display == "...example patient..." assert inst.patient.reference == "Patient/example" assert inst.policyRule.coding[0].code == "OPTOUT" assert ( inst.policyRule.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.provision.action[0].coding[0].code == "access" assert ( inst.provision.action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert inst.provision.actor[0].reference.reference == "Organization/f001" assert inst.provision.actor[0].role.coding[0].code == "PRCP" assert ( inst.provision.actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision.provision[0].action[0].coding[0].code == "access" assert ( inst.provision.provision[0].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert ( inst.provision.provision[0].actor[0].reference.reference == "Organization/f001" ) assert inst.provision.provision[0].actor[0].role.coding[0].code == "PRCP" assert ( inst.provision.provision[0].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision.provision[0].securityLabel[0].code == "PSY" assert ( inst.provision.provision[0].securityLabel[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.provision.provision[1].action[0].coding[0].code == "access" assert ( inst.provision.provision[1].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert ( inst.provision.provision[1].actor[0].reference.reference == "Organization/f001" ) assert inst.provision.provision[1].actor[0].role.coding[0].code == "PRCP" assert ( inst.provision.provision[1].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision.provision[1].securityLabel[0].code == "SPI" assert ( inst.provision.provision[1].securityLabel[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.provision.provision[2].action[0].coding[0].code == "access" assert ( inst.provision.provision[2].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert ( inst.provision.provision[2].actor[0].reference.reference == "Organization/f001" ) assert inst.provision.provision[2].actor[0].role.coding[0].code == "PRCP" assert ( inst.provision.provision[2].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision.provision[2].securityLabel[0].code == "N" assert ( inst.provision.provision[2].securityLabel[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-Confidentiality"} ).valueUri ) assert inst.provision.provision[3].action[0].coding[0].code == "access" assert ( inst.provision.provision[3].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert ( inst.provision.provision[3].actor[0].reference.reference == "Organization/f001" ) assert inst.provision.provision[3].actor[0].role.coding[0].code == "PRCP" assert ( inst.provision.provision[3].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision.provision[3].securityLabel[0].code == "PSY" assert ( inst.provision.provision[3].securityLabel[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.provision.provision[4].action[0].coding[0].code == "access" assert ( inst.provision.provision[4].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert ( inst.provision.provision[4].actor[0].reference.reference == "Organization/f001" ) assert inst.provision.provision[4].actor[0].role.coding[0].code == "PRCP" assert ( inst.provision.provision[4].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision.provision[4].securityLabel[0].code == "SPI" assert ( inst.provision.provision[4].securityLabel[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.provision.provision[5].action[0].coding[0].code == "access" assert ( inst.provision.provision[5].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert ( inst.provision.provision[5].actor[0].reference.reference == "Organization/f001" ) assert inst.provision.provision[5].actor[0].role.coding[0].code == "PRCP" assert ( inst.provision.provision[5].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision.provision[5].securityLabel[0].code == "SEX" assert ( inst.provision.provision[5].securityLabel[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.provision.provision[6].action[0].coding[0].code == "access" assert ( inst.provision.provision[6].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert ( inst.provision.provision[6].actor[0].reference.reference == "Organization/f001" ) assert inst.provision.provision[6].actor[0].role.coding[0].code == "PRCP" assert ( inst.provision.provision[6].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision.provision[6].securityLabel[0].code == "N" assert ( inst.provision.provision[6].securityLabel[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-Confidentiality"} ).valueUri ) assert inst.provision.provision[7].action[0].coding[0].code == "access" assert ( inst.provision.provision[7].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert ( inst.provision.provision[7].actor[0].reference.reference == "Organization/f001" ) assert inst.provision.provision[7].actor[0].role.coding[0].code == "PRCP" assert ( inst.provision.provision[7].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision.provision[7].securityLabel[0].code == "PSY" assert ( inst.provision.provision[7].securityLabel[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.provision.provision[8].action[0].coding[0].code == "access" assert ( inst.provision.provision[8].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert ( inst.provision.provision[8].actor[0].reference.reference == "Organization/f001" ) assert inst.provision.provision[8].actor[0].role.coding[0].code == "PRCP" assert ( inst.provision.provision[8].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision.provision[8].securityLabel[0].code == "SPI" assert ( inst.provision.provision[8].securityLabel[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.provision.provision[9].action[0].coding[0].code == "access" assert ( inst.provision.provision[9].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert ( inst.provision.provision[9].actor[0].reference.reference == "Organization/f001" ) assert inst.provision.provision[9].actor[0].role.coding[0].code == "PRCP" assert ( inst.provision.provision[9].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision.provision[9].securityLabel[0].code == "SEX" assert ( inst.provision.provision[9].securityLabel[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.provision.securityLabel[0].code == "N" assert ( inst.provision.securityLabel[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-Confidentiality"} ).valueUri ) assert inst.scope.coding[0].code == "patient-privacy" assert ( inst.scope.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentscope"} ).valueUri ) assert inst.status == "active" assert inst.text.status == "generated" def test_consent_9(base_settings): """No. 9 tests collection for Consent. Test File: consent-example-pkb.json """ filename = base_settings["unittest_data_dir"] / "consent-example-pkb.json" inst = consent.Consent.model_validate_json(filename.read_bytes()) assert "Consent" == inst.get_resource_type() impl_consent_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Consent" == data["resourceType"] inst2 = consent.Consent(**data) impl_consent_9(inst2) def impl_consent_10(inst): assert inst.category[0].coding[0].code == "59284-0" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-05-11"} ).valueDateTime ) assert inst.id == "consent-example-basic" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.organization[0].reference == "Organization/f001" assert inst.patient.display == "P. van de Heuvel" assert inst.patient.reference == "Patient/f001" assert inst.policyRule.coding[0].code == "OPTIN" assert ( inst.policyRule.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.provision.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-01"} ).valueDateTime ) assert ( inst.provision.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "1964-01-01"} ).valueDateTime ) assert inst.scope.coding[0].code == "patient-privacy" assert ( inst.scope.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentscope"} ).valueUri ) assert inst.sourceAttachment.title == "The terms of the consent in lawyer speak." assert inst.status == "active" assert inst.text.status == "generated" def test_consent_10(base_settings): """No. 10 tests collection for Consent. Test File: consent-example.json """ filename = base_settings["unittest_data_dir"] / "consent-example.json" inst = consent.Consent.model_validate_json(filename.read_bytes()) assert "Consent" == inst.get_resource_type() impl_consent_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Consent" == data["resourceType"] inst2 = consent.Consent(**data) impl_consent_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_contract.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Contract Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import contract from .conftest import ExternalValidatorModel # noqa: F401 def impl_contract_1(inst): assert inst.authority[0].display == "Michigan Health" assert inst.authority[0].reference == "Organization/3" assert inst.domain[0].display == "UK Pharmacies" assert inst.domain[0].reference == "Location/ukp" assert ( inst.friendly[0].contentAttachment.title == "The terms of the consent in friendly consumer speak." ) assert inst.id == "pcd-example-notOrg" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-11-18"} ).valueDateTime ) assert ( inst.legal[0].contentAttachment.title == "The terms of the consent in lawyer speak." ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.subType[0].coding[0].code == "Opt-In" assert inst.subType[0].coding[0].display == "Default Authorization with exceptions." assert ( inst.subType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.infoway-inforoute.ca.org/Consent-subtype-codes"} ).valueUri ) assert inst.subject[0].display == "P. van de Heuvel" assert inst.subject[0].reference == "Patient/f001" assert inst.term[0].offer.text == ( "Withhold this order and any results or related objects from " "any provider." ) assert inst.term[0].offer.topic.display == "Good Health Clinic" assert inst.term[0].offer.topic.reference == "Organization/2.16.840.1.113883.19.5" assert inst.term[0].type.coding[0].code == "withhold-from" assert ( inst.term[0].type.coding[0].display == "Withhold all data from specified actor entity." ) assert ( inst.term[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/consent-term-type-codes"} ).valueUri ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "57016-8" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) def test_contract_1(base_settings): """No. 1 tests collection for Contract. Test File: pcd-example-notOrg.json """ filename = base_settings["unittest_data_dir"] / "pcd-example-notOrg.json" inst = contract.Contract.model_validate_json(filename.read_bytes()) assert "Contract" == inst.get_resource_type() impl_contract_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Contract" == data["resourceType"] inst2 = contract.Contract(**data) impl_contract_1(inst2) def impl_contract_2(inst): assert ( inst.applies.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-01"} ).valueDateTime ) assert inst.id == "INS-101" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://xyz-insurance.com/forms"} ).valueUri ) assert inst.identifier[0].value == "YCSCWLN(01-2017)" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.subject[0].reference == "Patient/1" assert ( inst.term[0].asset[0].period[0].start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-06-01"} ).valueDateTime ) assert inst.term[0].asset[0].subtype[0].text == "sample" assert inst.term[0].asset[0].type[0].coding[0].code == "RicardianContract" assert ( inst.term[0].asset[0].type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://something/something"} ).valueUri ) assert ( inst.term[0].asset[0].valuedItem[0].effectiveTime == ExternalValidatorModel.model_validate( {"valueDateTime": "1995"} ).valueDateTime ) assert ( inst.term[0].asset[0].valuedItem[0].entityCodeableConcept.text == "Ford Bobcat" ) assert float(inst.term[0].asset[0].valuedItem[0].factor) == float(1.0) assert ( inst.term[0].asset[0].valuedItem[0].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://somewhere.motor-vehicle.com/vin"} ).valueUri ) assert inst.term[0].asset[0].valuedItem[0].identifier.value == "XXSVT34-7665t952236" assert inst.term[0].asset[0].valuedItem[0].net.currency == "CAD" assert float(inst.term[0].asset[0].valuedItem[0].net.value) == float(200.0) assert float(inst.term[0].asset[0].valuedItem[0].points) == float(1.0) assert float(inst.term[0].asset[0].valuedItem[0].quantity.value) == float(1) assert inst.term[0].asset[0].valuedItem[0].unitPrice.currency == "CAD" assert float(inst.term[0].asset[0].valuedItem[0].unitPrice.value) == float(200.0) assert inst.term[0].group[0].offer.text == "Eligible Providers" assert inst.term[0].group[1].offer.text == "Responsibility for Payment" assert inst.term[0].group[2].group[0].group[0].offer.text == "Emergency Room Copay" assert ( inst.term[0].group[2].group[0].group[1].offer.text == "Professional Visit Copay" ) assert inst.term[0].group[2].group[0].offer.text == "Copays" assert inst.term[0].group[2].group[1].offer.text == "Calendar Year Deductible" assert inst.term[0].group[2].group[2].offer.text == "Out-Of-Pocket Maximum" assert inst.term[0].group[2].group[3].group[0].offer.text == "Ambulance Services" assert inst.term[0].group[2].group[3].group[1].offer.text == "Dental Services" assert inst.term[0].group[2].group[3].group[2].offer.text == "Diagnostic Services" assert ( inst.term[0].group[2].group[3].group[3].offer.text == "Emergency Room Services" ) assert ( inst.term[0].group[2].group[3].group[4].offer.text == "Hospital Inpatient Care" ) assert inst.term[0].group[2].group[3].offer.text == "Medical Services" assert inst.term[0].group[2].offer.text == "List of Benefits" assert inst.text.status == "generated" assert inst.type.coding[0].code == "healthinsurance" assert inst.type.coding[0].display == "Health Insurance" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/contract-type"} ).valueUri ) def test_contract_2(base_settings): """No. 2 tests collection for Contract. Test File: contract-example-ins-policy.json """ filename = base_settings["unittest_data_dir"] / "contract-example-ins-policy.json" inst = contract.Contract.model_validate_json(filename.read_bytes()) assert "Contract" == inst.get_resource_type() impl_contract_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Contract" == data["resourceType"] inst2 = contract.Contract(**data) impl_contract_2(inst2) def impl_contract_3(inst): assert ( inst.applies.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-11-01T21:18:27-04:00"} ).valueDateTime ) assert inst.contentDerivative.coding[0].code == "registration" assert ( inst.contentDerivative.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/contract-content-derivative" } ).valueUri ) assert inst.id == "C-2121" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-11-01T21:18:27-04:00"} ).valueDateTime ) assert inst.legal[0].contentAttachment.contentType == "application/pdf" assert inst.legal[0].contentAttachment.language == "en-US" assert ( inst.legal[0].contentAttachment.title == "MDHHS-5515 Consent To Share Your Health Information" ) assert ( inst.legal[0].contentAttachment.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://org.mihin.ecms/ConsentDirective-2121"} ).valueUrl ) assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2016-07-19T18:18:42.108-04:00"} ).valueInstant ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.meta.versionId == "1" assert inst.signer[0].party.display == "Alice Recruit" assert inst.signer[0].party.reference == "Patient/f201" assert inst.signer[0].signature[0].type[0].code == "1.2.840.10065.1.12.1.1" assert ( inst.signer[0].signature[0].type[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso-astm:E1762-95:2013"} ).valueUri ) assert ( inst.signer[0].signature[0].when == ExternalValidatorModel.model_validate( {"valueInstant": "2017-02-08T10:57:34+01:00"} ).valueInstant ) assert inst.signer[0].signature[0].who.reference == "Patient/f201" assert inst.signer[0].type.code == "SELF" assert ( inst.signer[0].type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://mdhhs.org/fhir/consent-signer-type"} ).valueUri ) assert inst.status == "executed" assert inst.subType[0].coding[0].code == "hcd" assert ( inst.subType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentcategorycodes"} ).valueUri ) assert inst.subject[0].reference == "Patient/f201" assert inst.term[0].action[0].intent.coding[0].code == "HPRGRP" assert ( inst.term[0].action[0].intent.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.term[0].action[0].status.text == "Sample" assert ( inst.term[0].action[0].subject[0].reference[0].display == "VA Ann Arbor Healthcare System" ) assert ( inst.term[0].action[0].subject[0].reference[0].reference == "Organization/f001" ) assert inst.term[0].action[0].subject[0].role.coding[0].code == "IR" assert inst.term[0].action[0].subject[0].role.coding[0].display == "Recipient" assert ( inst.term[0].action[0].subject[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://mdhhs.org/fhir/consent-actor-type"} ).valueUri ) assert ( inst.term[0].action[0].subject[0].role.text == "Recipient of restricted health information" ) assert ( inst.term[0].action[0].subject[1].reference[0].display == "Community Mental Health Clinic" ) assert inst.term[0].action[0].subject[1].reference[0].reference == "Organization/2" assert inst.term[0].action[0].subject[1].role.coding[0].code == "IS" assert inst.term[0].action[0].subject[1].role.coding[0].display == "Sender" assert ( inst.term[0].action[0].subject[1].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://mdhhs.org/fhir/consent-actor-type"} ).valueUri ) assert ( inst.term[0].action[0].subject[1].role.text == "Sender of restricted health information" ) assert inst.term[0].action[0].type.coding[0].code == "action-a" assert ( inst.term[0].action[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/contractaction"} ).valueUri ) assert ( inst.term[0].asset[0].period[0].end == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-11-01T21:18:27-04:00"} ).valueDateTime ) assert ( inst.term[0].asset[0].period[0].start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-11-01T21:18:27-04:00"} ).valueDateTime ) assert inst.term[0].offer.decision.coding[0].code == "OPTIN" assert ( inst.term[0].offer.decision.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.term[0].offer.text == "Can't refuse" assert inst.term[0].offer.type.coding[0].code == "statutory" assert ( inst.term[0].offer.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/contracttermtypecodes"} ).valueUri ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "OPTIN" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://mdhhs.org/fhir/consentdirective-type"} ).valueUri ) assert inst.type.text == "Opt-in consent directive" def test_contract_3(base_settings): """No. 3 tests collection for Contract. Test File: contract-example-42cfr-part2.json """ filename = base_settings["unittest_data_dir"] / "contract-example-42cfr-part2.json" inst = contract.Contract.model_validate_json(filename.read_bytes()) assert "Contract" == inst.get_resource_type() impl_contract_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Contract" == data["resourceType"] inst2 = contract.Contract(**data) impl_contract_3(inst2) def impl_contract_4(inst): assert inst.authority[0].display == "Michigan Health" assert inst.authority[0].reference == "Organization/3" assert inst.domain[0].display == "UK Pharmacies" assert inst.domain[0].reference == "Location/ukp" assert ( inst.friendly[0].contentAttachment.title == "The terms of the consent in friendly consumer speak." ) assert inst.id == "pcd-example-notLabs" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-17"} ).valueDateTime ) assert ( inst.legal[0].contentAttachment.title == "The terms of the consent in lawyer speak." ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.subType[0].coding[0].code == "Opt-In" assert inst.subType[0].coding[0].display == "Default Authorization with exceptions." assert ( inst.subType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.infoway-inforoute.ca.org/Consent-subtype-codes"} ).valueUri ) assert inst.subject[0].display == "P. van de Heuvel" assert inst.subject[0].reference == "Patient/f001" assert inst.term[0].group[0].offer.text == "Withhold orders from any provider." assert inst.term[0].group[0].subType.coding[0].code == "ServiceRequest" assert ( inst.term[0].group[0].subType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/resource-types"} ).valueUri ) assert inst.term[0].group[0].type.coding[0].code == "withhold-object-type" assert ( inst.term[0].group[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/consent-term-type-codes"} ).valueUri ) assert ( inst.term[0].group[1].offer.text == "Withhold order results from any provider." ) assert inst.term[0].group[1].subType.coding[0].code == "DiagnosticReport" assert ( inst.term[0].group[1].subType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/resource-types"} ).valueUri ) assert inst.term[0].group[1].type.coding[0].code == "withhold-object-type" assert ( inst.term[0].group[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/consent-term-type-codes"} ).valueUri ) assert inst.term[0].offer.text == "sample" assert inst.text.status == "generated" assert inst.type.coding[0].code == "57016-8" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) def test_contract_4(base_settings): """No. 4 tests collection for Contract. Test File: pcd-example-notLabs.json """ filename = base_settings["unittest_data_dir"] / "pcd-example-notLabs.json" inst = contract.Contract.model_validate_json(filename.read_bytes()) assert "Contract" == inst.get_resource_type() impl_contract_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Contract" == data["resourceType"] inst2 = contract.Contract(**data) impl_contract_4(inst2) def impl_contract_5(inst): assert inst.authority[0].display == "Michigan Health" assert inst.authority[0].reference == "Organization/3" assert inst.domain[0].display == "UK Pharmacies" assert inst.domain[0].reference == "Location/ukp" assert ( inst.friendly[0].contentAttachment.title == "The terms of the consent in friendly consumer speak." ) assert inst.id == "pcd-example-notThem" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-11-18"} ).valueDateTime ) assert ( inst.legal[0].contentAttachment.title == "The terms of the consent in lawyer speak." ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.signer[0].party.reference == "Patient/f001" assert inst.signer[0].signature[0].type[0].code == "1.2.840.10065.1.12.1.1" assert ( inst.signer[0].signature[0].type[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso-astm:E1762-95:2013"} ).valueUri ) assert ( inst.signer[0].signature[0].when == ExternalValidatorModel.model_validate( {"valueInstant": "2013-06-08T10:57:34-07:00"} ).valueInstant ) assert inst.signer[0].signature[0].who.reference == "Patient/f001" assert inst.signer[0].type.code == "COVPTY" assert ( inst.signer[0].type.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/contractsignertypecodes" } ).valueUri ) assert inst.subType[0].coding[0].code == "Opt-In" assert inst.subType[0].coding[0].display == "Default Authorization with exceptions." assert ( inst.subType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.infoway-inforoute.ca.org/Consent-subtype-codes"} ).valueUri ) assert inst.subject[0].display == "P. van de Heuvel" assert inst.subject[0].reference == "Patient/f001" assert inst.term[0].offer.text == ( "Withhold this order and any results or related objects from " "specified nurse provider." ) assert inst.term[0].offer.topic.display == "Fictive Nurse" assert inst.term[0].offer.topic.reference == "Practitioner/f204" assert inst.term[0].type.coding[0].code == "withhold-from" assert ( inst.term[0].type.coding[0].display == "Withhold all data from specified actor entity." ) assert ( inst.term[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/consent-term-type-codes"} ).valueUri ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "57016-8" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) def test_contract_5(base_settings): """No. 5 tests collection for Contract. Test File: pcd-example-notThem.json """ filename = base_settings["unittest_data_dir"] / "pcd-example-notThem.json" inst = contract.Contract.model_validate_json(filename.read_bytes()) assert "Contract" == inst.get_resource_type() impl_contract_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Contract" == data["resourceType"] inst2 = contract.Contract(**data) impl_contract_5(inst2) def impl_contract_6(inst): assert inst.authority[0].display == "Michigan Health" assert inst.authority[0].reference == "Organization/3" assert inst.domain[0].display == "UK Pharmacies" assert inst.domain[0].reference == "Location/ukp" assert ( inst.friendly[0].contentAttachment.title == "The terms of the consent in friendly consumer speak." ) assert inst.id == "pcd-example-notAuthor" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-11-18"} ).valueDateTime ) assert ( inst.legal[0].contentAttachment.title == "The terms of the consent in lawyer speak." ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.subType[0].coding[0].code == "Opt-In" assert inst.subType[0].coding[0].display == "Default Authorization with exceptions." assert ( inst.subType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.infoway-inforoute.ca.org/Consent-subtype-codes"} ).valueUri ) assert inst.subject[0].display == "P. van de Heuvel" assert inst.subject[0].reference == "Patient/f001" assert ( inst.term[0].offer.text == "Withhold all data authored by Good Health provider." ) assert inst.term[0].offer.topic.display == "Good Health Clinic" assert inst.term[0].offer.topic.reference == "Organization/2.16.840.1.113883.19.5" assert inst.term[0].type.coding[0].code == "withhold-authored-by" assert ( inst.term[0].type.coding[0].display == "Withhold all data authored by specified actor entity." ) assert ( inst.term[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/consent-term-type-codes"} ).valueUri ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "57016-8" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) def test_contract_6(base_settings): """No. 6 tests collection for Contract. Test File: pcd-example-notAuthor.json """ filename = base_settings["unittest_data_dir"] / "pcd-example-notAuthor.json" inst = contract.Contract.model_validate_json(filename.read_bytes()) assert "Contract" == inst.get_resource_type() impl_contract_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Contract" == data["resourceType"] inst2 = contract.Contract(**data) impl_contract_6(inst2) def impl_contract_7(inst): assert inst.id == "C-123" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/contract"} ).valueUri ) assert inst.identifier[0].value == "12347" assert inst.legallyBindingAttachment.contentType == "application/pdf" assert ( inst.legallyBindingAttachment.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://www.aws3.com/storage/doc.pdf"} ).valueUrl ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.rule[0].contentAttachment.contentType == "application/txt" assert ( inst.rule[0].contentAttachment.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://www.rfc-editor.org/bcp/bcp13.txt"} ).valueUrl ) assert ( inst.term[0].asset[0].period[0].start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-06-01"} ).valueDateTime ) assert inst.term[0].asset[0].subtype[0].text == "sample" assert inst.term[0].asset[0].type[0].coding[0].code == "RicardianContract" assert ( inst.term[0].asset[0].type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://something/something"} ).valueUri ) assert ( inst.term[0].asset[0].valuedItem[0].effectiveTime == ExternalValidatorModel.model_validate( {"valueDateTime": "1995"} ).valueDateTime ) assert ( inst.term[0].asset[0].valuedItem[0].entityCodeableConcept.text == "Ford Bobcat" ) assert float(inst.term[0].asset[0].valuedItem[0].factor) == float(1.0) assert ( inst.term[0].asset[0].valuedItem[0].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://somewhere.motor-vehicle.com/vin"} ).valueUri ) assert inst.term[0].asset[0].valuedItem[0].identifier.value == "XXSVT34-7665t952236" assert inst.term[0].asset[0].valuedItem[0].net.currency == "CAD" assert float(inst.term[0].asset[0].valuedItem[0].net.value) == float(200.0) assert float(inst.term[0].asset[0].valuedItem[0].points) == float(1.0) assert float(inst.term[0].asset[0].valuedItem[0].quantity.value) == float(1) assert inst.term[0].asset[0].valuedItem[0].unitPrice.currency == "CAD" assert float(inst.term[0].asset[0].valuedItem[0].unitPrice.value) == float(200.0) assert inst.term[0].offer.text == "Can't refuse" assert inst.text.div == ( '
A human-readable' " rendering of the contract
" ) assert inst.text.status == "generated" def test_contract_7(base_settings): """No. 7 tests collection for Contract. Test File: contract-example.json """ filename = base_settings["unittest_data_dir"] / "contract-example.json" inst = contract.Contract.model_validate_json(filename.read_bytes()) assert "Contract" == inst.get_resource_type() impl_contract_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Contract" == data["resourceType"] inst2 = contract.Contract(**data) impl_contract_7(inst2) def impl_contract_8(inst): assert inst.authority[0].display == "Michigan Health" assert inst.authority[0].reference == "Organization/3" assert inst.domain[0].display == "UK Pharmacies" assert inst.domain[0].reference == "Location/ukp" assert ( inst.friendly[0].contentAttachment.title == "The terms of the consent in friendly consumer speak." ) assert inst.id == "pcd-example-notThis" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-11-18"} ).valueDateTime ) assert ( inst.legal[0].contentAttachment.title == "The terms of the consent in lawyer speak." ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.subType[0].coding[0].code == "Opt-In" assert inst.subType[0].coding[0].display == "Default Authorization with exceptions." assert ( inst.subType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.infoway-inforoute.ca.org/Consent-subtype-codes"} ).valueUri ) assert inst.subject[0].display == "P. van de Heuvel" assert inst.subject[0].reference == "Patient/f001" assert ( inst.term[0].applies.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-11-18"} ).valueDateTime ) assert ( inst.term[0].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/term-items"} ).valueUri ) assert inst.term[0].identifier.value == "3347689" assert ( inst.term[0].issued == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-11-01"} ).valueDateTime ) assert inst.term[0].offer.text == ( "Withhold this order and any results or related objects from " "any provider." ) assert inst.term[0].offer.topic.reference == "ServiceRequest/lipid" assert inst.term[0].type.coding[0].code == "withhold-identified-object-and-related" assert inst.term[0].type.coding[0].display == ( "Withhold the identified object and any other resources that " "are related to this object." ) assert ( inst.term[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/consent-term-type-codes"} ).valueUri ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "57016-8" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) def test_contract_8(base_settings): """No. 8 tests collection for Contract. Test File: pcd-example-notThis.json """ filename = base_settings["unittest_data_dir"] / "pcd-example-notThis.json" inst = contract.Contract.model_validate_json(filename.read_bytes()) assert "Contract" == inst.get_resource_type() impl_contract_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Contract" == data["resourceType"] inst2 = contract.Contract(**data) impl_contract_8(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_coverage.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Coverage Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import coverage from .conftest import ExternalValidatorModel # noqa: F401 def impl_coverage_1(inst): assert inst.beneficiary.reference == "Patient/5" assert inst.class_fhir[0].name == "Western Airlines" assert inst.class_fhir[0].type.coding[0].code == "group" assert ( inst.class_fhir[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[0].value == "WESTAIR" assert ( inst.class_fhir[1].name == "Full Coverage: Medical, Dental, Pharmacy, Vision, EHC" ) assert inst.class_fhir[1].type.coding[0].code == "plan" assert ( inst.class_fhir[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[1].value == "BG4352" assert inst.class_fhir[2].name == "Platinum" assert inst.class_fhir[2].type.coding[0].code == "subplan" assert ( inst.class_fhir[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[2].value == "D15C9" assert inst.contract[0].reference == "Contract/INS-101" assert ( inst.costToBeneficiary[0].exception[0].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-12-31"} ).valueDateTime ) assert ( inst.costToBeneficiary[0].exception[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-01-01"} ).valueDateTime ) assert inst.costToBeneficiary[0].exception[0].type.coding[0].code == "retired" assert ( inst.costToBeneficiary[0].exception[0].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/ex-coverage-financial-exception" } ).valueUri ) assert inst.costToBeneficiary[0].type.coding[0].code == "gpvisit" assert ( inst.costToBeneficiary[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-copay-type"} ).valueUri ) assert inst.costToBeneficiary[0].valueMoney.currency == "USD" assert float(inst.costToBeneficiary[0].valueMoney.value) == float(20.0) assert inst.dependent == "1" assert inst.id == "7546D" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://xyz.com/codes/identifier"} ).valueUri ) assert inst.identifier[0].value == "AB98761" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.network == "5" assert inst.order == 2 assert inst.payor[0].reference == "Organization/2" assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-03-17"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2011-03-17"} ).valueDateTime ) assert inst.relationship.coding[0].code == "self" assert inst.status == "active" assert inst.subscriber.reference == "Patient/5" assert inst.subscriberId == "AB9876" assert inst.text.div == ( '
A human-readable' " rendering of the coverage
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "EHCPOL" assert inst.type.coding[0].display == "extended healthcare" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) def test_coverage_1(base_settings): """No. 1 tests collection for Coverage. Test File: coverage-example-2.json """ filename = base_settings["unittest_data_dir"] / "coverage-example-2.json" inst = coverage.Coverage.model_validate_json(filename.read_bytes()) assert "Coverage" == inst.get_resource_type() impl_coverage_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Coverage" == data["resourceType"] inst2 = coverage.Coverage(**data) impl_coverage_1(inst2) def impl_coverage_2(inst): assert inst.beneficiary.reference == "Patient/5" assert inst.id == "SP1234" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hospitalx.com/selfpayagreement"} ).valueUri ) assert inst.identifier[0].value == "SP12345678" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.payor[0].reference == "Patient/5" assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-03-17"} ).valueDateTime ) assert inst.relationship.coding[0].code == "self" assert inst.status == "active" assert inst.subscriber.reference == "Patient/5" assert inst.text.div == ( '
A human-readable' " rendering of a Self Pay Agreement.
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "pay" assert inst.type.coding[0].display == "PAY" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-selfpay"} ).valueUri ) def test_coverage_2(base_settings): """No. 2 tests collection for Coverage. Test File: coverage-example-selfpay.json """ filename = base_settings["unittest_data_dir"] / "coverage-example-selfpay.json" inst = coverage.Coverage.model_validate_json(filename.read_bytes()) assert "Coverage" == inst.get_resource_type() impl_coverage_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Coverage" == data["resourceType"] inst2 = coverage.Coverage(**data) impl_coverage_2(inst2) def impl_coverage_3(inst): assert inst.beneficiary.reference == "Patient/5" assert inst.id == "7547E" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ehic.com/insurer/123456789/member"} ).valueUri ) assert inst.identifier[0].value == "A123456780" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.payor[0].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://ehic.com/insurer"} ).valueUri ) assert inst.payor[0].identifier.value == "123456789" assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-03-17"} ).valueDateTime ) assert inst.relationship.coding[0].code == "self" assert inst.status == "active" assert inst.subscriber.reference == "Patient/5" assert inst.text.div == ( '
A human-readable' " rendering of the European Health Insurance Card
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "EHCPOL" assert inst.type.coding[0].display == "extended healthcare" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) def test_coverage_3(base_settings): """No. 3 tests collection for Coverage. Test File: coverage-example-ehic.json """ filename = base_settings["unittest_data_dir"] / "coverage-example-ehic.json" inst = coverage.Coverage.model_validate_json(filename.read_bytes()) assert "Coverage" == inst.get_resource_type() impl_coverage_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Coverage" == data["resourceType"] inst2 = coverage.Coverage(**data) impl_coverage_3(inst2) def impl_coverage_4(inst): assert inst.beneficiary.reference == "Patient/4" assert inst.class_fhir[0].name == "Corporate Baker's Inc. Local #35" assert inst.class_fhir[0].type.coding[0].code == "group" assert ( inst.class_fhir[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[0].value == "CB135" assert inst.class_fhir[1].name == "Trainee Part-time Benefits" assert inst.class_fhir[1].type.coding[0].code == "subgroup" assert ( inst.class_fhir[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[1].value == "123" assert ( inst.class_fhir[2].name == "Full Coverage: Medical, Dental, Pharmacy, Vision, EHC" ) assert inst.class_fhir[2].type.coding[0].code == "plan" assert ( inst.class_fhir[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[2].value == "B37FC" assert inst.class_fhir[3].name == "Includes afterlife benefits" assert inst.class_fhir[3].type.coding[0].code == "subplan" assert ( inst.class_fhir[3].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[3].value == "P7" assert inst.class_fhir[4].name == "Silver: Family Plan spouse only" assert inst.class_fhir[4].type.coding[0].code == "class" assert ( inst.class_fhir[4].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[4].value == "SILVER" assert inst.class_fhir[5].name == "Low deductable, max $20 copay" assert inst.class_fhir[5].type.coding[0].code == "subclass" assert ( inst.class_fhir[5].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[5].value == "Tier2" assert inst.class_fhir[6].type.coding[0].code == "sequence" assert ( inst.class_fhir[6].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[6].value == "9" assert inst.class_fhir[7].type.coding[0].code == "rxid" assert ( inst.class_fhir[7].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[7].value == "MDF12345" assert inst.class_fhir[8].type.coding[0].code == "rxbin" assert ( inst.class_fhir[8].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[8].value == "987654" assert inst.class_fhir[9].type.coding[0].code == "rxgroup" assert ( inst.class_fhir[9].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[9].value == "M35PT" assert inst.dependent == "0" assert inst.id == "9876B1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://benefitsinc.com/certificate"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.payor[0].reference == "Organization/2" assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-05-23"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2011-05-23"} ).valueDateTime ) assert ( inst.policyHolder.reference == "http://benefitsinc.com/FHIR/Organization/CBI35" ) assert inst.relationship.coding[0].code == "self" assert inst.status == "active" assert inst.subscriber.reference == "Patient/4" assert inst.text.div == ( '
A human-readable' " rendering of the coverage
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "EHCPOL" assert inst.type.coding[0].display == "extended healthcare" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) def test_coverage_4(base_settings): """No. 4 tests collection for Coverage. Test File: coverage-example.json """ filename = base_settings["unittest_data_dir"] / "coverage-example.json" inst = coverage.Coverage.model_validate_json(filename.read_bytes()) assert "Coverage" == inst.get_resource_type() impl_coverage_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Coverage" == data["resourceType"] inst2 = coverage.Coverage(**data) impl_coverage_4(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_coverageeligibilityrequest.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/CoverageEligibilityRequest Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import coverageeligibilityrequest from .conftest import ExternalValidatorModel # noqa: F401 def impl_coverageeligibilityrequest_1(inst): assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.id == "52345" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/coverageelegibilityrequest"} ).valueUri ) assert inst.identifier[0].value == "52345" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].focal is True assert inst.insurer.reference == "Organization/2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/pat1" assert inst.priority.coding[0].code == "normal" assert inst.provider.reference == "Organization/1" assert inst.purpose[0] == "validation" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the CoverageEligibilityRequest
" ) assert inst.text.status == "generated" def test_coverageeligibilityrequest_1(base_settings): """No. 1 tests collection for CoverageEligibilityRequest. Test File: coverageeligibilityrequest-example.json """ filename = ( base_settings["unittest_data_dir"] / "coverageeligibilityrequest-example.json" ) inst = coverageeligibilityrequest.CoverageEligibilityRequest.model_validate_json( filename.read_bytes() ) assert "CoverageEligibilityRequest" == inst.get_resource_type() impl_coverageeligibilityrequest_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CoverageEligibilityRequest" == data["resourceType"] inst2 = coverageeligibilityrequest.CoverageEligibilityRequest(**data) impl_coverageeligibilityrequest_1(inst2) def impl_coverageeligibilityrequest_2(inst): assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert ( inst.enterer.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalleyclinic.com/staff"} ).valueUri ) assert inst.enterer.identifier.value == "14" assert ( inst.facility.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://statecliniclicensor.com/clinicid"} ).valueUri ) assert inst.facility.identifier.value == "G35B9" assert inst.id == "52346" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/coverageelegibilityrequest"} ).valueUri ) assert inst.identifier[0].value == "52346" assert inst.insurance[0].businessArrangement == "NB8742" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurer.reference == "Organization/2" assert inst.item[0].category.coding[0].code == "69" assert inst.item[0].category.coding[0].display == "Maternity" assert ( inst.item[0].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-benefitcategory"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/pat1" assert inst.priority.coding[0].code == "normal" assert inst.provider.reference == "Organization/1" assert inst.purpose[0] == "validation" assert inst.purpose[1] == "benefits" assert ( inst.servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-09-17"}).valueDate ) assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the CoverageEligibilityRequest
" ) assert inst.text.status == "generated" def test_coverageeligibilityrequest_2(base_settings): """No. 2 tests collection for CoverageEligibilityRequest. Test File: coverageeligibilityrequest-example-2.json """ filename = ( base_settings["unittest_data_dir"] / "coverageeligibilityrequest-example-2.json" ) inst = coverageeligibilityrequest.CoverageEligibilityRequest.model_validate_json( filename.read_bytes() ) assert "CoverageEligibilityRequest" == inst.get_resource_type() impl_coverageeligibilityrequest_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CoverageEligibilityRequest" == data["resourceType"] inst2 = coverageeligibilityrequest.CoverageEligibilityRequest(**data) impl_coverageeligibilityrequest_2(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_coverageeligibilityresponse.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/CoverageEligibilityResponse Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import coverageeligibilityresponse from .conftest import ExternalValidatorModel # noqa: F401 def impl_coverageeligibilityresponse_1(inst): assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.disposition == "Policy is currently in-force." assert inst.id == "E2500" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/coverageeligibilityresponse"} ).valueUri ) assert inst.identifier[0].value == "881234" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].inforce is True assert inst.insurer.reference == "Organization/2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "complete" assert inst.patient.reference == "Patient/pat1" assert inst.purpose[0] == "validation" assert inst.request.reference == ( "http://www.BenefitsInc.com/fhir/coverageeligibilityrequest/2" "25476332402" ) assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the CoverageEligibilityResponse.
" ) assert inst.text.status == "generated" def test_coverageeligibilityresponse_1(base_settings): """No. 1 tests collection for CoverageEligibilityResponse. Test File: coverageeligibilityresponse-example.json """ filename = ( base_settings["unittest_data_dir"] / "coverageeligibilityresponse-example.json" ) inst = coverageeligibilityresponse.CoverageEligibilityResponse.model_validate_json( filename.read_bytes() ) assert "CoverageEligibilityResponse" == inst.get_resource_type() impl_coverageeligibilityresponse_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CoverageEligibilityResponse" == data["resourceType"] inst2 = coverageeligibilityresponse.CoverageEligibilityResponse(**data) impl_coverageeligibilityresponse_1(inst2) def impl_coverageeligibilityresponse_2(inst): assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-16"} ).valueDateTime ) assert inst.disposition == ( "Eligibiliy request could not be processed, please address " "errors before submitting." ) assert inst.error[0].code.coding[0].code == "a001" assert ( inst.error[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/adjudication-error"} ).valueUri ) assert inst.form.coding[0].code == "ELRSP/2017/01" assert ( inst.form.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://national.org/form"} ).valueUri ) assert inst.id == "E2503" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/coverageeligibilityresponse"} ).valueUri ) assert inst.identifier[0].value == "8812343" assert inst.insurer.reference == "Organization/2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "error" assert inst.patient.reference == "Patient/f201" assert inst.purpose[0] == "validation" assert inst.request.reference == ( "http://www.BenefitsInc.com/fhir/coverageeligibilityresponse/" "225476332406" ) assert ( inst.requestor.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://national.org/clinic"} ).valueUri ) assert inst.requestor.identifier.value == "OR1234" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the CoverageEligibilityResponse.
" ) assert inst.text.status == "generated" def test_coverageeligibilityresponse_2(base_settings): """No. 2 tests collection for CoverageEligibilityResponse. Test File: coverageeligibilityresponse-example-error.json """ filename = ( base_settings["unittest_data_dir"] / "coverageeligibilityresponse-example-error.json" ) inst = coverageeligibilityresponse.CoverageEligibilityResponse.model_validate_json( filename.read_bytes() ) assert "CoverageEligibilityResponse" == inst.get_resource_type() impl_coverageeligibilityresponse_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CoverageEligibilityResponse" == data["resourceType"] inst2 = coverageeligibilityresponse.CoverageEligibilityResponse(**data) impl_coverageeligibilityresponse_2(inst2) def impl_coverageeligibilityresponse_3(inst): assert inst.contained[0].id == "coverage-1" assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-16"} ).valueDateTime ) assert inst.disposition == "Policy is currently in-force." assert inst.form.coding[0].code == "ELRSP/2017/01" assert ( inst.form.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://national.org/form"} ).valueUri ) assert inst.id == "E2502" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/coverageeligibilityresponse"} ).valueUri ) assert inst.identifier[0].value == "8812342" assert inst.insurance[0].coverage.reference == "#coverage-1" assert inst.insurance[0].inforce is True assert inst.insurance[0].item[0].benefit[0].allowedMoney.currency == "USD" assert float(inst.insurance[0].item[0].benefit[0].allowedMoney.value) == float( 500000 ) assert inst.insurance[0].item[0].benefit[0].type.coding[0].code == "benefit" assert inst.insurance[0].item[0].benefit[0].usedMoney.currency == "USD" assert float(inst.insurance[0].item[0].benefit[0].usedMoney.value) == float(3748.0) assert inst.insurance[0].item[0].benefit[1].allowedMoney.currency == "USD" assert float(inst.insurance[0].item[0].benefit[1].allowedMoney.value) == float(100) assert inst.insurance[0].item[0].benefit[1].type.coding[0].code == "copay-maximum" assert inst.insurance[0].item[0].benefit[2].allowedUnsignedInt == 20 assert inst.insurance[0].item[0].benefit[2].type.coding[0].code == "copay-percent" assert inst.insurance[0].item[0].category.coding[0].code == "30" assert ( inst.insurance[0].item[0].category.coding[0].display == "Health Benefit Plan Coverage" ) assert ( inst.insurance[0].item[0].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-benefitcategory"} ).valueUri ) assert inst.insurance[0].item[0].network.coding[0].code == "in" assert ( inst.insurance[0].item[0].network.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-network"} ).valueUri ) assert inst.insurance[0].item[0].term.coding[0].code == "annual" assert ( inst.insurance[0].item[0].term.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-term"} ).valueUri ) assert inst.insurance[0].item[0].unit.coding[0].code == "individual" assert ( inst.insurance[0].item[0].unit.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-unit"} ).valueUri ) assert inst.insurance[0].item[1].benefit[0].allowedMoney.currency == "USD" assert float(inst.insurance[0].item[1].benefit[0].allowedMoney.value) == float( 15000 ) assert inst.insurance[0].item[1].benefit[0].type.coding[0].code == "benefit" assert inst.insurance[0].item[1].category.coding[0].code == "69" assert inst.insurance[0].item[1].category.coding[0].display == "Maternity" assert ( inst.insurance[0].item[1].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-benefitcategory"} ).valueUri ) assert inst.insurance[0].item[1].network.coding[0].code == "in" assert ( inst.insurance[0].item[1].network.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-network"} ).valueUri ) assert inst.insurance[0].item[1].term.coding[0].code == "annual" assert ( inst.insurance[0].item[1].term.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-term"} ).valueUri ) assert inst.insurance[0].item[1].unit.coding[0].code == "individual" assert ( inst.insurance[0].item[1].unit.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-unit"} ).valueUri ) assert inst.insurance[0].item[2].benefit[0].allowedMoney.currency == "USD" assert float(inst.insurance[0].item[2].benefit[0].allowedMoney.value) == float(2000) assert inst.insurance[0].item[2].benefit[0].type.coding[0].code == "benefit" assert inst.insurance[0].item[2].category.coding[0].code == "F3" assert inst.insurance[0].item[2].category.coding[0].display == "Dental Coverage" assert ( inst.insurance[0].item[2].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-benefitcategory"} ).valueUri ) assert inst.insurance[0].item[2].network.coding[0].code == "in" assert ( inst.insurance[0].item[2].network.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-network"} ).valueUri ) assert inst.insurance[0].item[2].term.coding[0].code == "annual" assert ( inst.insurance[0].item[2].term.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-term"} ).valueUri ) assert inst.insurance[0].item[2].unit.coding[0].code == "individual" assert ( inst.insurance[0].item[2].unit.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-unit"} ).valueUri ) assert inst.insurance[0].item[3].category.coding[0].code == "F6" assert inst.insurance[0].item[3].category.coding[0].display == "Vision Coverage" assert ( inst.insurance[0].item[3].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-benefitcategory"} ).valueUri ) assert inst.insurance[0].item[3].description == ( "Vision products and services such as exams, glasses and " "contact lenses." ) assert inst.insurance[0].item[3].excluded is True assert inst.insurance[0].item[3].name == "Vision" assert inst.insurer.reference == "Organization/2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "complete" assert inst.patient.reference == "Patient/f201" assert inst.purpose[0] == "validation" assert inst.purpose[1] == "benefits" assert inst.request.reference == ( "http://www.BenefitsInc.com/fhir/coverageeligibilityrequest/2" "25476332405" ) assert ( inst.requestor.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://national.org/clinic"} ).valueUri ) assert inst.requestor.identifier.value == "OR1234" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the CoverageEligibilityResponse.
" ) assert inst.text.status == "generated" def test_coverageeligibilityresponse_3(base_settings): """No. 3 tests collection for CoverageEligibilityResponse. Test File: coverageeligibilityresponse-example-benefits-2.json """ filename = ( base_settings["unittest_data_dir"] / "coverageeligibilityresponse-example-benefits-2.json" ) inst = coverageeligibilityresponse.CoverageEligibilityResponse.model_validate_json( filename.read_bytes() ) assert "CoverageEligibilityResponse" == inst.get_resource_type() impl_coverageeligibilityresponse_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CoverageEligibilityResponse" == data["resourceType"] inst2 = coverageeligibilityresponse.CoverageEligibilityResponse(**data) impl_coverageeligibilityresponse_3(inst2) def impl_coverageeligibilityresponse_4(inst): assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.disposition == "Policy is currently in-force." assert inst.id == "E2501" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/coverageeligibilityresponse"} ).valueUri ) assert inst.identifier[0].value == "881234" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].inforce is True assert inst.insurance[0].item[0].benefit[0].allowedMoney.currency == "SAR" assert float(inst.insurance[0].item[0].benefit[0].allowedMoney.value) == float( 500000 ) assert inst.insurance[0].item[0].benefit[0].type.coding[0].code == "benefit" assert inst.insurance[0].item[0].benefit[1].allowedMoney.currency == "SAR" assert float(inst.insurance[0].item[0].benefit[1].allowedMoney.value) == float(100) assert inst.insurance[0].item[0].benefit[1].type.coding[0].code == "copay-maximum" assert inst.insurance[0].item[0].benefit[2].allowedUnsignedInt == 20 assert inst.insurance[0].item[0].benefit[2].type.coding[0].code == "copay-percent" assert inst.insurance[0].item[0].category.coding[0].code == "30" assert ( inst.insurance[0].item[0].category.coding[0].display == "Health Benefit Plan Coverage" ) assert ( inst.insurance[0].item[0].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-benefitcategory"} ).valueUri ) assert inst.insurance[0].item[0].network.coding[0].code == "in" assert ( inst.insurance[0].item[0].network.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-network"} ).valueUri ) assert inst.insurance[0].item[0].term.coding[0].code == "annual" assert ( inst.insurance[0].item[0].term.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-term"} ).valueUri ) assert inst.insurance[0].item[0].unit.coding[0].code == "individual" assert ( inst.insurance[0].item[0].unit.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-unit"} ).valueUri ) assert inst.insurance[0].item[1].benefit[0].allowedMoney.currency == "SAR" assert float(inst.insurance[0].item[1].benefit[0].allowedMoney.value) == float( 15000 ) assert inst.insurance[0].item[1].benefit[0].type.coding[0].code == "benefit" assert inst.insurance[0].item[1].category.coding[0].code == "69" assert inst.insurance[0].item[1].category.coding[0].display == "Maternity" assert ( inst.insurance[0].item[1].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-benefitcategory"} ).valueUri ) assert inst.insurance[0].item[1].network.coding[0].code == "in" assert ( inst.insurance[0].item[1].network.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-network"} ).valueUri ) assert inst.insurance[0].item[1].term.coding[0].code == "annual" assert ( inst.insurance[0].item[1].term.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-term"} ).valueUri ) assert inst.insurance[0].item[1].unit.coding[0].code == "individual" assert ( inst.insurance[0].item[1].unit.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-unit"} ).valueUri ) assert inst.insurance[0].item[2].benefit[0].allowedMoney.currency == "SAR" assert float(inst.insurance[0].item[2].benefit[0].allowedMoney.value) == float(2000) assert inst.insurance[0].item[2].benefit[0].type.coding[0].code == "benefit" assert inst.insurance[0].item[2].category.coding[0].code == "F3" assert inst.insurance[0].item[2].category.coding[0].display == "Dental Coverage" assert ( inst.insurance[0].item[2].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-benefitcategory"} ).valueUri ) assert inst.insurance[0].item[2].network.coding[0].code == "in" assert ( inst.insurance[0].item[2].network.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-network"} ).valueUri ) assert inst.insurance[0].item[2].term.coding[0].code == "annual" assert ( inst.insurance[0].item[2].term.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-term"} ).valueUri ) assert inst.insurance[0].item[2].unit.coding[0].code == "individual" assert ( inst.insurance[0].item[2].unit.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-unit"} ).valueUri ) assert inst.insurance[0].item[3].benefit[0].allowedMoney.currency == "SAR" assert float(inst.insurance[0].item[3].benefit[0].allowedMoney.value) == float(400) assert inst.insurance[0].item[3].benefit[0].type.coding[0].code == "benefit" assert inst.insurance[0].item[3].category.coding[0].code == "F6" assert inst.insurance[0].item[3].category.coding[0].display == "Vision Coverage" assert ( inst.insurance[0].item[3].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-benefitcategory"} ).valueUri ) assert inst.insurance[0].item[3].network.coding[0].code == "in" assert ( inst.insurance[0].item[3].network.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-network"} ).valueUri ) assert inst.insurance[0].item[3].term.coding[0].code == "annual" assert ( inst.insurance[0].item[3].term.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-term"} ).valueUri ) assert inst.insurance[0].item[3].unit.coding[0].code == "individual" assert ( inst.insurance[0].item[3].unit.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-unit"} ).valueUri ) assert inst.insurance[0].item[4].benefit[0].allowedString == "shared" assert inst.insurance[0].item[4].benefit[0].type.coding[0].code == "room" assert inst.insurance[0].item[4].benefit[1].allowedMoney.currency == "SAR" assert float(inst.insurance[0].item[4].benefit[1].allowedMoney.value) == float(600) assert inst.insurance[0].item[4].benefit[1].type.coding[0].code == "benefit" assert inst.insurance[0].item[4].category.coding[0].code == "49" assert ( inst.insurance[0].item[4].category.coding[0].display == "Hospital Room and Board" ) assert ( inst.insurance[0].item[4].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-benefitcategory"} ).valueUri ) assert inst.insurance[0].item[4].network.coding[0].code == "in" assert ( inst.insurance[0].item[4].network.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-network"} ).valueUri ) assert inst.insurance[0].item[4].term.coding[0].code == "day" assert ( inst.insurance[0].item[4].term.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-term"} ).valueUri ) assert inst.insurance[0].item[4].unit.coding[0].code == "individual" assert ( inst.insurance[0].item[4].unit.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-unit"} ).valueUri ) assert inst.insurer.reference == "Organization/2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "complete" assert inst.patient.reference == "Patient/pat1" assert inst.purpose[0] == "validation" assert inst.purpose[1] == "benefits" assert inst.request.reference == ( "http://www.BenefitsInc.com/fhir/coverageeligibilityresponse/" "225476332402" ) assert ( inst.servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-09-17"}).valueDate ) assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the CoverageEligibilityResponse.
" ) assert inst.text.status == "generated" def test_coverageeligibilityresponse_4(base_settings): """No. 4 tests collection for CoverageEligibilityResponse. Test File: coverageeligibilityresponse-example-benefits.json """ filename = ( base_settings["unittest_data_dir"] / "coverageeligibilityresponse-example-benefits.json" ) inst = coverageeligibilityresponse.CoverageEligibilityResponse.model_validate_json( filename.read_bytes() ) assert "CoverageEligibilityResponse" == inst.get_resource_type() impl_coverageeligibilityresponse_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CoverageEligibilityResponse" == data["resourceType"] inst2 = coverageeligibilityresponse.CoverageEligibilityResponse(**data) impl_coverageeligibilityresponse_4(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_detectedissue.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/DetectedIssue Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import detectedissue from .conftest import ExternalValidatorModel # noqa: F401 def impl_detectedissue_1(inst): assert inst.id == "allergy" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "final" assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" def test_detectedissue_1(base_settings): """No. 1 tests collection for DetectedIssue. Test File: detectedissue-example-allergy.json """ filename = base_settings["unittest_data_dir"] / "detectedissue-example-allergy.json" inst = detectedissue.DetectedIssue.model_validate_json(filename.read_bytes()) assert "DetectedIssue" == inst.get_resource_type() impl_detectedissue_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DetectedIssue" == data["resourceType"] inst2 = detectedissue.DetectedIssue(**data) impl_detectedissue_1(inst2) def impl_detectedissue_2(inst): assert inst.author.reference == "Device/software" assert inst.code.coding[0].code == "DUPTHPY" assert inst.code.coding[0].display == "Duplicate Therapy Alert" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.detail == "Similar test was performed within the past 14 days" assert inst.id == "duplicate" assert ( inst.identifiedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-05-08"} ).valueDateTime ) assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345" assert ( inst.implicated[0].display == "Chest CT - ordered May 8, 2013 by Dr. Adam Careful" ) assert inst.implicated[0].reference == "ServiceRequest/di" assert inst.implicated[1].display == ( "Image 1 from Series 3: CT Images on Patient MINT (MINT1234) " "taken at 1-Jan 2011 01:20 AM" ) assert inst.implicated[1].reference == "ImagingStudy/example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/dicom" assert ( inst.reference == ExternalValidatorModel.model_validate( { "valueUri": "http://www.tmhp.com/RadiologyClinicalDecisionSupport/2011/CHEST%20IMAGING%20GUIDELINES%202011.pdf" } ).valueUri ) assert inst.status == "final" assert inst.text.status == "generated" def test_detectedissue_2(base_settings): """No. 2 tests collection for DetectedIssue. Test File: detectedissue-example-dup.json """ filename = base_settings["unittest_data_dir"] / "detectedissue-example-dup.json" inst = detectedissue.DetectedIssue.model_validate_json(filename.read_bytes()) assert "DetectedIssue" == inst.get_resource_type() impl_detectedissue_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DetectedIssue" == data["resourceType"] inst2 = detectedissue.DetectedIssue(**data) impl_detectedissue_2(inst2) def impl_detectedissue_3(inst): assert inst.author.reference == "Device/software" assert inst.code.coding[0].code == "DRG" assert inst.code.coding[0].display == "Drug Interaction Alert" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.id == "ddi" assert ( inst.identifiedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-01-05"} ).valueDateTime ) assert ( inst.implicated[0].display == "500 mg Acetaminophen tablet 1/day, PRN since 2010" ) assert inst.implicated[0].reference == "MedicationStatement/example001" assert inst.implicated[1].display == "Warfarin 1 MG TAB prescribed Jan. 15, 2015" assert inst.implicated[1].reference == "MedicationRequest/medrx0331" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mitigation[0].action.coding[0].code == "13" assert inst.mitigation[0].action.coding[0].display == "Stopped Concurrent Therapy" assert ( inst.mitigation[0].action.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.mitigation[0].action.text == ( "Asked patient to discontinue regular use of Tylenol and to " "consult with clinician if they need to resume to allow " "appropriate INR monitoring" ) assert inst.mitigation[0].author.display == "Dr. Adam Careful" assert inst.mitigation[0].author.reference == "Practitioner/example" assert ( inst.mitigation[0].date == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-01-05"} ).valueDateTime ) assert inst.severity == "high" assert inst.status == "final" assert inst.text.status == "generated" def test_detectedissue_3(base_settings): """No. 3 tests collection for DetectedIssue. Test File: detectedissue-example.json """ filename = base_settings["unittest_data_dir"] / "detectedissue-example.json" inst = detectedissue.DetectedIssue.model_validate_json(filename.read_bytes()) assert "DetectedIssue" == inst.get_resource_type() impl_detectedissue_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DetectedIssue" == data["resourceType"] inst2 = detectedissue.DetectedIssue(**data) impl_detectedissue_3(inst2) def impl_detectedissue_4(inst): assert inst.id == "lab" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "final" assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" def test_detectedissue_4(base_settings): """No. 4 tests collection for DetectedIssue. Test File: detectedissue-example-lab.json """ filename = base_settings["unittest_data_dir"] / "detectedissue-example-lab.json" inst = detectedissue.DetectedIssue.model_validate_json(filename.read_bytes()) assert "DetectedIssue" == inst.get_resource_type() impl_detectedissue_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DetectedIssue" == data["resourceType"] inst2 = detectedissue.DetectedIssue(**data) impl_detectedissue_4(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_device.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Device Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import device from .conftest import ExternalValidatorModel # noqa: F401 def impl_device_1(inst): assert inst.id == "f001" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http:/goodhealthhospital/identifier/devices"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "active" assert inst.text.status == "generated" def test_device_1(base_settings): """No. 1 tests collection for Device. Test File: device-example-f001-feedingtube.json """ filename = ( base_settings["unittest_data_dir"] / "device-example-f001-feedingtube.json" ) inst = device.Device.model_validate_json(filename.read_bytes()) assert "Device" == inst.get_resource_type() impl_device_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Device" == data["resourceType"] inst2 = device.Device(**data) impl_device_1(inst2) def impl_device_2(inst): assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodcare.org/devices/id"} ).valueUri ) assert inst.identifier[0].value == "345675" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_device_2(base_settings): """No. 2 tests collection for Device. Test File: device-example.json """ filename = base_settings["unittest_data_dir"] / "device-example.json" inst = device.Device.model_validate_json(filename.read_bytes()) assert "Device" == inst.get_resource_type() impl_device_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Device" == data["resourceType"] inst2 = device.Device(**data) impl_device_2(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_devicedefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/DeviceDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import devicedefinition from .conftest import ExternalValidatorModel # noqa: F401 def impl_devicedefinition_1(inst): assert inst.id == "example" assert inst.identifier[0].value == "0" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_devicedefinition_1(base_settings): """No. 1 tests collection for DeviceDefinition. Test File: devicedefinition-example.json """ filename = base_settings["unittest_data_dir"] / "devicedefinition-example.json" inst = devicedefinition.DeviceDefinition.model_validate_json(filename.read_bytes()) assert "DeviceDefinition" == inst.get_resource_type() impl_devicedefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DeviceDefinition" == data["resourceType"] inst2 = devicedefinition.DeviceDefinition(**data) impl_devicedefinition_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_devicemetric.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/DeviceMetric Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import devicemetric from .conftest import ExternalValidatorModel # noqa: F401 def impl_devicemetric_1(inst): assert inst.calibration[0].state == "calibrated" assert ( inst.calibration[0].time == ExternalValidatorModel.model_validate( {"valueInstant": "2016-12-28T09:03:04-05:00"} ).valueInstant ) assert inst.calibration[0].type == "two-point" assert inst.category == "measurement" assert inst.color == "blue" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodcare.org/devicemetric/id"} ).valueUri ) assert inst.identifier[0].value == "345675" assert inst.measurementPeriod.repeat.frequency == 1 assert float(inst.measurementPeriod.repeat.period) == float(1) assert inst.measurementPeriod.repeat.periodUnit == "s" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.operationalStatus == "on" assert inst.parent.reference == "DeviceDefinition/dc102" assert inst.source.reference == "Device/dev1" assert inst.text.status == "generated" assert inst.type.coding[0].code == "150456" assert inst.type.coding[0].display == "MDC_PULS_OXIM_SAT_O2" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert inst.unit.coding[0].code == "262688" assert inst.unit.coding[0].display == "MDC_DIM_PERCENT" assert ( inst.unit.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) def test_devicemetric_1(base_settings): """No. 1 tests collection for DeviceMetric. Test File: devicemetric-example.json """ filename = base_settings["unittest_data_dir"] / "devicemetric-example.json" inst = devicemetric.DeviceMetric.model_validate_json(filename.read_bytes()) assert "DeviceMetric" == inst.get_resource_type() impl_devicemetric_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DeviceMetric" == data["resourceType"] inst2 = devicemetric.DeviceMetric(**data) impl_devicemetric_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_devicerequest.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/DeviceRequest Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import devicerequest from .conftest import ExternalValidatorModel # noqa: F401 def impl_devicerequest_1(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-05-08T09:33:27+07:00"} ).valueDateTime ) assert inst.basedOn[0].display == "Homecare - DM follow-up" assert inst.codeCodeableConcept.coding[0].code == "43148-6" assert ( inst.codeCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.codeCodeableConcept.text == "Insulin delivery device panel" assert inst.encounter.display == "Encounter 1" assert inst.groupIdentifier.value == "ip_request1" assert inst.id == "insulinpump" assert inst.identifier[0].value == "ip_request1.1" assert inst.instantiatesCanonical[0] == ( "http://motivemi.com/artifacts/PlanDefinition/low-suicide-" "risk-order-set" ) assert inst.intent == "instance-order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "this is the right device brand and model" assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-05-08T09:33:27+07:00"} ).valueDateTime ) assert inst.performer.display == "Nurse Rossignol" assert inst.performerType.coding[0].display == "Qualified nurse" assert inst.performerType.text == "Nurse" assert inst.priorRequest[0].display == "CGM ambulatory" assert inst.priority == "routine" assert inst.reasonCode[0].text == "gastroparesis" assert inst.reasonReference[0].display == "Gastroparesis" assert inst.relevantHistory[0].display == "Request for unspecified device" assert inst.requester.display == "Dr. Adam Careful" assert inst.requester.reference == "Practitioner/example" assert inst.status == "active" assert inst.subject.reference == "Patient/dicom" assert inst.supportingInfo[0].display == "Previous results" assert inst.text.status == "generated" def test_devicerequest_1(base_settings): """No. 1 tests collection for DeviceRequest. Test File: devicerequest-example-insulinpump.json """ filename = ( base_settings["unittest_data_dir"] / "devicerequest-example-insulinpump.json" ) inst = devicerequest.DeviceRequest.model_validate_json(filename.read_bytes()) assert "DeviceRequest" == inst.get_resource_type() impl_devicerequest_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DeviceRequest" == data["resourceType"] inst2 = devicerequest.DeviceRequest(**data) impl_devicerequest_1(inst2) def impl_devicerequest_2(inst): assert inst.codeCodeableConcept.coding[0].code == "lens" assert ( inst.codeCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct" } ).valueUri ) assert ( inst.groupIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org"} ).valueUri ) assert inst.groupIdentifier.value == "15013" assert inst.id == "left-lens" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.happysight.com/prescription"} ).valueUri ) assert inst.identifier[0].value == "15013L" assert inst.intent == "original-order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-06-15"} ).valueDateTime ) assert inst.parameter[0].code.coding[0].code == "28842-3" assert ( inst.parameter[0].code.coding[0].display == "Sphere distance Glasses prescription.lens - left" ) assert ( inst.parameter[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.parameter[0].code.text == "sphere, left lens" assert inst.parameter[0].valueQuantity.code == "[diop]" assert ( inst.parameter[0].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.parameter[0].valueQuantity.unit == "Diopter" assert float(inst.parameter[0].valueQuantity.value) == float(-1.0) assert inst.parameter[1].code.coding[0].code == "28843-1" assert ( inst.parameter[1].code.coding[0].display == "Cylinder base distance Glasses prescription.lens - left" ) assert ( inst.parameter[1].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.parameter[1].code.text == "cylinder, left lens" assert inst.parameter[1].valueQuantity.code == "[diop]" assert ( inst.parameter[1].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.parameter[1].valueQuantity.unit == "Diopter" assert float(inst.parameter[1].valueQuantity.value) == float(-0.5) assert inst.parameter[2].code.coding[0].code == "28844-9" assert ( inst.parameter[2].code.coding[0].display == " Axis distance Glasses prescription.lens - left" ) assert ( inst.parameter[2].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.parameter[2].code.text == "axis, left lens" assert inst.parameter[2].valueQuantity.code == "deg" assert ( inst.parameter[2].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.parameter[2].valueQuantity.unit == "Degrees" assert float(inst.parameter[2].valueQuantity.value) == float(180) assert inst.requester.reference == "Practitioner/example" assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_devicerequest_2(base_settings): """No. 2 tests collection for DeviceRequest. Test File: devicerequest-left-lens.json """ filename = base_settings["unittest_data_dir"] / "devicerequest-left-lens.json" inst = devicerequest.DeviceRequest.model_validate_json(filename.read_bytes()) assert "DeviceRequest" == inst.get_resource_type() impl_devicerequest_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DeviceRequest" == data["resourceType"] inst2 = devicerequest.DeviceRequest(**data) impl_devicerequest_2(inst2) def impl_devicerequest_3(inst): assert inst.codeCodeableConcept.coding[0].code == "lens" assert ( inst.codeCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct" } ).valueUri ) assert ( inst.groupIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org"} ).valueUri ) assert inst.groupIdentifier.value == "15013" assert inst.id == "right-lens" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.happysight.com/prescription"} ).valueUri ) assert inst.identifier[0].value == "15013R" assert inst.intent == "original-order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-06-15"} ).valueDateTime ) assert inst.parameter[0].code.coding[0].code == "28826-6" assert ( inst.parameter[0].code.coding[0].display == "Sphere distance Glasses prescription.lens - right" ) assert ( inst.parameter[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.parameter[0].code.text == "sphere, right lens" assert inst.parameter[0].valueQuantity.code == "[diop]" assert ( inst.parameter[0].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.parameter[0].valueQuantity.unit == "Diopter" assert float(inst.parameter[0].valueQuantity.value) == float(-2.0) assert inst.parameter[1].code.coding[0].code == "28829-0" assert ( inst.parameter[1].code.coding[0].display == "Prism base distance Glasses prescription.lens - right" ) assert ( inst.parameter[1].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.parameter[1].code.text == "prisms, right lens" assert inst.parameter[1].valueQuantity.code == "[diop]" assert ( inst.parameter[1].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.parameter[1].valueQuantity.unit == "Diopter" assert float(inst.parameter[1].valueQuantity.value) == float(-2.0) assert inst.parameter[2].code.coding[0].code == "28810-0" assert inst.parameter[2].code.coding[0].display == "Add 1 LM glasses lens - right" assert ( inst.parameter[2].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.parameter[2].code.text == "add, right lens" assert inst.parameter[2].valueQuantity.code == "[diop]" assert ( inst.parameter[2].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.parameter[2].valueQuantity.unit == "Diopter" assert float(inst.parameter[2].valueQuantity.value) == float(2.0) assert inst.requester.reference == "Practitioner/example" assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_devicerequest_3(base_settings): """No. 3 tests collection for DeviceRequest. Test File: devicerequest-right-lens.json """ filename = base_settings["unittest_data_dir"] / "devicerequest-right-lens.json" inst = devicerequest.DeviceRequest.model_validate_json(filename.read_bytes()) assert "DeviceRequest" == inst.get_resource_type() impl_devicerequest_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DeviceRequest" == data["resourceType"] inst2 = devicerequest.DeviceRequest(**data) impl_devicerequest_3(inst2) def impl_devicerequest_4(inst): assert inst.codeReference.reference == "Device/example" assert inst.id == "example" assert inst.intent == "original-order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_devicerequest_4(base_settings): """No. 4 tests collection for DeviceRequest. Test File: devicerequest-example.json """ filename = base_settings["unittest_data_dir"] / "devicerequest-example.json" inst = devicerequest.DeviceRequest.model_validate_json(filename.read_bytes()) assert "DeviceRequest" == inst.get_resource_type() impl_devicerequest_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DeviceRequest" == data["resourceType"] inst2 = devicerequest.DeviceRequest(**data) impl_devicerequest_4(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_deviceusestatement.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/DeviceUseStatement Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import deviceusestatement from .conftest import ExternalValidatorModel # noqa: F401 def impl_deviceusestatement_1(inst): assert inst.device.reference == "Device/example" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http:goodhealth.org/identifiers"} ).valueUri ) assert inst.identifier[0].value == "51ebb7a9-4e3a-4360-9a05-0cc2d869086f" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.reasonReference[0].display == "PHx of Appendectomy (surgery)" assert inst.reasonReference[0].reference == "Condition/example" assert inst.status == "active" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_deviceusestatement_1(base_settings): """No. 1 tests collection for DeviceUseStatement. Test File: deviceusestatement-example.json """ filename = base_settings["unittest_data_dir"] / "deviceusestatement-example.json" inst = deviceusestatement.DeviceUseStatement.model_validate_json( filename.read_bytes() ) assert "DeviceUseStatement" == inst.get_resource_type() impl_deviceusestatement_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DeviceUseStatement" == data["resourceType"] inst2 = deviceusestatement.DeviceUseStatement(**data) impl_deviceusestatement_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_diagnosticreport.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/DiagnosticReport Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import diagnosticreport from .conftest import ExternalValidatorModel # noqa: F401 def impl_diagnosticreport_1(inst): assert inst.category[0].coding[0].code == "394914008" assert inst.category[0].coding[0].display == "Radiology" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].coding[1].code == "RAD" assert ( inst.category[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0074"} ).valueUri ) assert inst.code.coding[0].code == "45036003" assert inst.code.coding[0].display == "Ultrasonography of abdomen" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Abdominal Ultrasound" assert inst.conclusion == "Unremarkable study" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-12-01T12:00:00+01:00"} ).valueDateTime ) assert inst.id == "ultrasound" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueInstant": "2012-12-01T12:00:00+01:00"} ).valueInstant ) assert inst.media[0].comment == "A comment about the image" assert inst.media[0].link.display == "WADO example image" assert ( inst.media[0].link.reference == "Media/1.2.840.11361907579238403408700.3.1.04.19970327150033" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].reference == "Practitioner/example" assert inst.status == "final" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_diagnosticreport_1(base_settings): """No. 1 tests collection for DiagnosticReport. Test File: diagnosticreport-example-ultrasound.json """ filename = ( base_settings["unittest_data_dir"] / "diagnosticreport-example-ultrasound.json" ) inst = diagnosticreport.DiagnosticReport.model_validate_json(filename.read_bytes()) assert "DiagnosticReport" == inst.get_resource_type() impl_diagnosticreport_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DiagnosticReport" == data["resourceType"] inst2 = diagnosticreport.DiagnosticReport(**data) impl_diagnosticreport_1(inst2) def impl_diagnosticreport_2(inst): assert inst.category[0].coding[0].code == "394914008" assert inst.category[0].coding[0].display == "Radiology" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].coding[1].code == "RAD" assert ( inst.category[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0074"} ).valueUri ) assert inst.code.coding[0].code == "429858000" assert inst.code.coding[0].display == "Computed tomography (CT) of head and neck" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "CT of head-neck" assert inst.conclusion == "CT brains: large tumor sphenoid/clivus." assert inst.conclusionCode[0].coding[0].code == "188340000" assert ( inst.conclusionCode[0].coding[0].display == "Malignant tumor of craniopharyngeal duct" ) assert ( inst.conclusionCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-12-01T12:00:00+01:00"} ).valueDateTime ) assert inst.id == "f201" assert inst.imagingStudy[0].display == "HEAD and NECK CT DICOM imaging study" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueInstant": "2012-12-01T12:00:00+01:00"} ).valueInstant ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].display == "Blijdorp MC" assert inst.performer[0].reference == "Organization/f203" assert inst.status == "final" assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" def test_diagnosticreport_2(base_settings): """No. 2 tests collection for DiagnosticReport. Test File: diagnosticreport-example-f201-brainct.json """ filename = ( base_settings["unittest_data_dir"] / "diagnosticreport-example-f201-brainct.json" ) inst = diagnosticreport.DiagnosticReport.model_validate_json(filename.read_bytes()) assert "DiagnosticReport" == inst.get_resource_type() impl_diagnosticreport_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DiagnosticReport" == data["resourceType"] inst2 = diagnosticreport.DiagnosticReport(**data) impl_diagnosticreport_2(inst2) def impl_diagnosticreport_3(inst): assert inst.code.coding[0].code == "47527-7" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-02-11T10:33:33+11:00"} ).valueDateTime ) assert inst.id == "pap" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueInstant": "2013-02-13T11:45:33+11:00"} ).valueInstant ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].reference == "Practitioner/example" assert inst.status == "final" assert inst.subject.reference == "Patient/b248b1b2-1686-4b94-9936-37d7a5f94b51" assert inst.text.status == "additional" def test_diagnosticreport_3(base_settings): """No. 3 tests collection for DiagnosticReport. Test File: diagnosticreport-example-papsmear.json """ filename = ( base_settings["unittest_data_dir"] / "diagnosticreport-example-papsmear.json" ) inst = diagnosticreport.DiagnosticReport.model_validate_json(filename.read_bytes()) assert "DiagnosticReport" == inst.get_resource_type() impl_diagnosticreport_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DiagnosticReport" == data["resourceType"] inst2 = diagnosticreport.DiagnosticReport(**data) impl_diagnosticreport_3(inst2) def impl_diagnosticreport_4(inst): assert inst.category[0].coding[0].code == "PAT" assert ( inst.category[0].coding[0].display == "Pathology (gross & histopath, not surgical)" ) assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0074"} ).valueUri ) assert inst.category[0].text == "Pathology" assert inst.code.coding[0].code == "4503" assert inst.code.coding[0].display == ( "Biopsy without Microscopic Description (1 " "Site/Lesion)-Standard" ) assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.acmeonline.com"} ).valueUri ) assert inst.code.text == ( "Biopsy without Microscopic Description (1 " "Site/Lesion)-Standard" ) assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-02"} ).valueDateTime ) assert inst.id == "gingival-mass" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.acmeonline.com"} ).valueUri ) assert inst.identifier[0].value == "P73456090" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueInstant": "2017-03-15T08:13:08Z"} ).valueInstant ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].display == "Acme Animal Labs" assert inst.presentedForm[0].contentType == "application/pdf" assert inst.presentedForm[0].language == "en" assert inst.presentedForm[0].title == ( "LAB ID: P73456090 MAX JONES Biopsy without Microscopic " "Description (1 Site/Lesion)-Standard" ) assert inst.status == "final" assert inst.subject.display == "Max Jones" assert inst.text.status == "generated" def test_diagnosticreport_4(base_settings): """No. 4 tests collection for DiagnosticReport. Test File: diagnosticreport-example-gingival-mass.json """ filename = ( base_settings["unittest_data_dir"] / "diagnosticreport-example-gingival-mass.json" ) inst = diagnosticreport.DiagnosticReport.model_validate_json(filename.read_bytes()) assert "DiagnosticReport" == inst.get_resource_type() impl_diagnosticreport_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DiagnosticReport" == data["resourceType"] inst2 = diagnosticreport.DiagnosticReport(**data) impl_diagnosticreport_4(inst2) 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 == ExternalValidatorModel.model_validate( {"valueUri": "https://system/PGxReport"} ).valueUri ) assert inst.code.text == "Pharmacogenetics Report" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-15T12:34:56+11:00"} ).valueDateTime ) assert inst.id == "example-pgx" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueInstant": "2016-10-20T14:00:05+11:00"} ).valueInstant ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].reference == "Organization/4829" assert inst.presentedForm[0].contentType == "application/pdf" assert ( inst.presentedForm[0].creation == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-20T20:00:00+11:00"} ).valueDateTime ) assert ( inst.presentedForm[0].data == ExternalValidatorModel.model_validate( {"valueBase64Binary": "cGRmSW5CYXNlNjRCaW5hcnk="} ).valueBase64Binary ) assert ( inst.presentedForm[0].hash == ExternalValidatorModel.model_validate( {"valueBase64Binary": "571ef9c5655840f324e679072ed62b1b95eef8a0"} ).valueBase64Binary ) 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" def test_diagnosticreport_5(base_settings): """No. 5 tests collection for DiagnosticReport. Test File: diagnosticreport-example-pgx.json """ filename = base_settings["unittest_data_dir"] / "diagnosticreport-example-pgx.json" inst = diagnosticreport.DiagnosticReport.model_validate_json(filename.read_bytes()) assert "DiagnosticReport" == inst.get_resource_type() impl_diagnosticreport_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DiagnosticReport" == data["resourceType"] inst2 = diagnosticreport.DiagnosticReport(**data) impl_diagnosticreport_5(inst2) def impl_diagnosticreport_6(inst): assert inst.code.coding[0].code == "38269-7" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.code.text == "DXA BONE DENSITOMETRY" assert inst.conclusionCode[0].coding[0].code == "391040000" assert ( inst.conclusionCode[0].coding[0].display == "At risk of osteoporotic fracture" ) assert ( inst.conclusionCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2008-06-17"} ).valueDateTime ) assert inst.id == "102" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueInstant": "2008-06-18T09:23:00+10:00"} ).valueInstant ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].display == "Dr Henry Seven" assert ( inst.performer[0].reference == "Practitioner/3ad0687e-f477-468c-afd5-fcc2bf897809" ) assert inst.result[0].reference == "Observation/bmd" assert inst.status == "final" assert inst.subject.reference == "Patient/pat2" assert inst.text.status == "generated" def test_diagnosticreport_6(base_settings): """No. 6 tests collection for DiagnosticReport. Test File: diagnosticreport-example-dxa.json """ filename = base_settings["unittest_data_dir"] / "diagnosticreport-example-dxa.json" inst = diagnosticreport.DiagnosticReport.model_validate_json(filename.read_bytes()) assert "DiagnosticReport" == inst.get_resource_type() impl_diagnosticreport_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DiagnosticReport" == data["resourceType"] inst2 = diagnosticreport.DiagnosticReport(**data) impl_diagnosticreport_6(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_documentmanifest.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/DocumentManifest Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import documentmanifest from .conftest import ExternalValidatorModel # noqa: F401 def impl_documentmanifest_1(inst): assert inst.author[0].reference == "#a1" assert inst.contained[0].id == "a1" assert inst.content[0].reference == "DocumentReference/example" assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2004-12-25T23:50:50-05:00"} ).valueDateTime ) assert inst.description == "Physical" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/documents"} ).valueUri ) assert inst.identifier[0].value == "23425234234-2347" assert ( inst.masterIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/documents"} ).valueUri ) assert inst.masterIdentifier.value == "23425234234-2346" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.recipient[0].reference == "Practitioner/xcda1" assert ( inst.related[0].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/documents"} ).valueUri ) assert inst.related[0].identifier.value == "23425234234-9999" assert inst.related[0].ref.reference == "DocumentReference/example" assert ( inst.source == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.3.6.1.4.1.21367.2009.1.2.1"} ).valueUri ) assert inst.status == "current" assert inst.subject.reference == "Patient/xcda" assert inst.text.div == '
Text
' assert inst.text.status == "generated" assert inst.type.text == "History and Physical" def test_documentmanifest_1(base_settings): """No. 1 tests collection for DocumentManifest. Test File: documentmanifest-example.json """ filename = base_settings["unittest_data_dir"] / "documentmanifest-example.json" inst = documentmanifest.DocumentManifest.model_validate_json(filename.read_bytes()) assert "DocumentManifest" == inst.get_resource_type() impl_documentmanifest_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DocumentManifest" == data["resourceType"] inst2 = documentmanifest.DocumentManifest(**data) impl_documentmanifest_1(inst2) def impl_documentmanifest_2(inst): assert inst.contained[0].id == "org-1" assert inst.contained[1].id == "a1" assert inst.contained[2].id == "a2" assert inst.content[0].reference == "#a1" assert inst.content[1].reference == "#a2" assert inst.content[2].reference == "DocumentReference/example" assert inst.content[3].reference == "DiagnosticReport/f001" assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-21T11:50:23-05:00"} ).valueDateTime ) assert inst.id == "654789" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/supportingdocumentation"} ).valueUri ) assert inst.identifier[0].value == "52345" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.recipient[0].reference == "#org-1" assert ( inst.related[0].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/claim"} ).valueUri ) assert inst.related[0].identifier.value == "12345" assert ( inst.related[1].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/remittance"} ).valueUri ) assert inst.related[1].identifier.value == "R3500" assert inst.status == "current" assert inst.text.div == ( '
A Financial ' "Management Attachment example
" ) assert inst.text.status == "generated" def test_documentmanifest_2(base_settings): """No. 2 tests collection for DocumentManifest. Test File: documentmanifest-fm-attachment.json """ filename = ( base_settings["unittest_data_dir"] / "documentmanifest-fm-attachment.json" ) inst = documentmanifest.DocumentManifest.model_validate_json(filename.read_bytes()) assert "DocumentManifest" == inst.get_resource_type() impl_documentmanifest_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DocumentManifest" == data["resourceType"] inst2 = documentmanifest.DocumentManifest(**data) impl_documentmanifest_2(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_documentreference.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/DocumentReference Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import documentreference from .conftest import ExternalValidatorModel # noqa: F401 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.category[0].coding[0].code == "History and Physical" assert inst.category[0].coding[0].display == "History and Physical" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/xds/connectathon/classCodes"} ).valueUri ) assert inst.contained[0].id == "a2" assert inst.content[0].attachment.contentType == "application/hl7-v3+xml" assert ( inst.content[0].attachment.creation == ExternalValidatorModel.model_validate( {"valueDateTime": "2005-12-24T09:35:00+11:00"} ).valueDateTime ) assert ( inst.content[0].attachment.hash == ExternalValidatorModel.model_validate( {"valueBase64Binary": "2jmj7l5rSw0yVb/vlWAYkK/YBwk="} ).valueBase64Binary ) assert inst.content[0].attachment.language == "en-US" assert inst.content[0].attachment.size == 3654 assert inst.content[0].attachment.title == "Physical" assert ( inst.content[0].attachment.url == ExternalValidatorModel.model_validate( { "valueUrl": "http://example.org/xds/mhd/Binary/07a6483f-732b-461e-86b6-edb665c45510" } ).valueUrl ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.3.6.1.4.1.19376.1.2.3"} ).valueUri ) assert inst.context.encounter[0].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 == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/xds/connectathon/eventCodes"} ).valueUri ) assert inst.context.facilityType.coding[0].code == "Outpatient" assert inst.context.facilityType.coding[0].display == "Outpatient" assert ( inst.context.facilityType.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://www.ihe.net/xds/connectathon/healthcareFacilityTypeCodes" } ).valueUri ) assert ( inst.context.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2004-12-23T08:01:00+11:00"} ).valueDateTime ) assert ( inst.context.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2004-12-23T08:00:00+11:00"} ).valueDateTime ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://www.ihe.net/xds/connectathon/practiceSettingCodes"} ).valueUri ) assert ( inst.context.related[0].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) 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].reference == "Patient/xcda" assert inst.context.sourcePatientInfo.reference == "Patient/xcda" assert inst.custodian.reference == "Organization/f001" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueInstant": "2005-12-24T09:43:41+11:00"} ).valueInstant ) assert inst.description == "Physical" assert inst.docStatus == "preliminary" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234" assert ( inst.masterIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.masterIdentifier.value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-Confidentiality"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) def test_documentreference_1(base_settings): """No. 1 tests collection for DocumentReference. Test File: documentreference-example.json """ filename = base_settings["unittest_data_dir"] / "documentreference-example.json" inst = documentreference.DocumentReference.model_validate_json( filename.read_bytes() ) assert "DocumentReference" == inst.get_resource_type() impl_documentreference_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DocumentReference" == data["resourceType"] inst2 = documentreference.DocumentReference(**data) impl_documentreference_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_encounter.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Encounter Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import encounter from .conftest import ExternalValidatorModel # noqa: F401 def impl_encounter_1(inst): assert inst.class_fhir.code == "HH" assert inst.class_fhir.display == "home health" assert ( inst.class_fhir.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.contained[0].id == "home" assert inst.id == "home" assert inst.location[0].location.display == "Client's home" assert inst.location[0].location.reference == "#home" assert ( inst.location[0].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-17T16:30:00+10:00"} ).valueDateTime ) assert ( inst.location[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-17T16:00:00+10:00"} ).valueDateTime ) assert inst.location[0].status == "completed" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].individual.display == "Dr Adam Careful" assert inst.participant[0].individual.reference == "Practitioner/example" assert ( inst.participant[0].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-17T16:30:00+10:00"} ).valueDateTime ) assert ( inst.participant[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-17T16:00:00+10:00"} ).valueDateTime ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-17T16:30:00+10:00"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-17T16:00:00+10:00"} ).valueDateTime ) assert inst.status == "finished" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Encounter with ' "patient @example who is at home
" ) assert inst.text.status == "generated" def test_encounter_1(base_settings): """No. 1 tests collection for Encounter. Test File: encounter-example-home.json """ filename = base_settings["unittest_data_dir"] / "encounter-example-home.json" inst = encounter.Encounter.model_validate_json(filename.read_bytes()) assert "Encounter" == inst.get_resource_type() impl_encounter_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Encounter" == data["resourceType"] inst2 = encounter.Encounter(**data) impl_encounter_1(inst2) def impl_encounter_2(inst): assert inst.class_fhir.code == "AMB" assert inst.class_fhir.display == "ambulatory" assert ( inst.class_fhir.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.id == "f201" assert inst.identifier[0].use == "temp" assert inst.identifier[0].value == "Encounter_Roel_20130404" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].individual.reference == "Practitioner/f201" assert inst.priority.coding[0].code == "17621005" assert inst.priority.coding[0].display == "Normal" assert ( inst.priority.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.reasonCode[0].text == ( "The patient had fever peaks over the last couple of days. He" " is worried about these peaks." ) assert inst.serviceProvider.reference == "Organization/f201" assert inst.status == "finished" assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "11429006" assert inst.type[0].coding[0].display == "Consultation" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_encounter_2(base_settings): """No. 2 tests collection for Encounter. Test File: encounter-example-f201-20130404.json """ filename = ( base_settings["unittest_data_dir"] / "encounter-example-f201-20130404.json" ) inst = encounter.Encounter.model_validate_json(filename.read_bytes()) assert "Encounter" == inst.get_resource_type() impl_encounter_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Encounter" == data["resourceType"] inst2 = encounter.Encounter(**data) impl_encounter_2(inst2) def impl_encounter_3(inst): assert inst.class_fhir.code == "AMB" assert inst.class_fhir.display == "ambulatory" assert ( inst.class_fhir.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.hospitalization.admitSource.coding[0].code == "305956004" assert inst.hospitalization.admitSource.coding[0].display == "Referral by physician" assert ( inst.hospitalization.admitSource.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.hospitalization.dischargeDisposition.coding[0].code == "306689006" assert ( inst.hospitalization.dischargeDisposition.coding[0].display == "Discharge to home" ) assert ( inst.hospitalization.dischargeDisposition.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.hospitalization.preAdmissionIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/zorgportal/identifiers/pre-admissions"} ).valueUri ) assert inst.hospitalization.preAdmissionIdentifier.use == "official" assert inst.hospitalization.preAdmissionIdentifier.value == "93042" assert inst.id == "f003" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/zorgportal/identifiers/encounters"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "v6751" assert inst.length.code == "min" assert ( inst.length.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.length.unit == "min" assert float(inst.length.value) == float(90) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].individual.display == "E.M. van den Broek" assert inst.participant[0].individual.reference == "Practitioner/f001" assert inst.priority.coding[0].code == "103391001" assert ( inst.priority.coding[0].display == "Non-urgent ear, nose and throat admission" ) assert ( inst.priority.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.reasonCode[0].coding[0].code == "18099001" assert inst.reasonCode[0].coding[0].display == "Retropharyngeal abscess" assert ( inst.reasonCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.serviceProvider.reference == "Organization/f001" assert inst.status == "finished" assert inst.subject.display == "P. van de Heuvel" assert inst.subject.reference == "Patient/f001" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "270427003" assert inst.type[0].coding[0].display == "Patient-initiated encounter" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_encounter_3(base_settings): """No. 3 tests collection for Encounter. Test File: encounter-example-f003-abscess.json """ filename = ( base_settings["unittest_data_dir"] / "encounter-example-f003-abscess.json" ) inst = encounter.Encounter.model_validate_json(filename.read_bytes()) assert "Encounter" == inst.get_resource_type() impl_encounter_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Encounter" == data["resourceType"] inst2 = encounter.Encounter(**data) impl_encounter_3(inst2) def impl_encounter_4(inst): assert inst.class_fhir.code == "IMP" assert inst.class_fhir.display == "inpatient encounter" assert ( inst.class_fhir.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "in-progress" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Encounter with ' "patient @example
" ) assert inst.text.status == "generated" def test_encounter_4(base_settings): """No. 4 tests collection for Encounter. Test File: encounter-example.json """ filename = base_settings["unittest_data_dir"] / "encounter-example.json" inst = encounter.Encounter.model_validate_json(filename.read_bytes()) assert "Encounter" == inst.get_resource_type() impl_encounter_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Encounter" == data["resourceType"] inst2 = encounter.Encounter(**data) impl_encounter_4(inst2) def impl_encounter_5(inst): assert inst.class_fhir.code == "AMB" assert inst.class_fhir.display == "ambulatory" assert ( inst.class_fhir.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.hospitalization.admitSource.coding[0].code == "305997006" assert ( inst.hospitalization.admitSource.coding[0].display == "Referral by radiologist" ) assert ( inst.hospitalization.admitSource.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.hospitalization.dischargeDisposition.coding[0].code == "306689006" assert ( inst.hospitalization.dischargeDisposition.coding[0].display == "Discharge to home" ) assert ( inst.hospitalization.dischargeDisposition.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.hospitalization.preAdmissionIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/zorgportal/identifiers/pre-admissions"} ).valueUri ) assert inst.hospitalization.preAdmissionIdentifier.use == "official" assert inst.hospitalization.preAdmissionIdentifier.value == "98682" assert inst.id == "f002" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/zorgportal/identifiers/encounters"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "v3251" assert inst.length.code == "min" assert ( inst.length.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.length.unit == "min" assert float(inst.length.value) == float(140) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].individual.display == "M.I.M Versteegh" assert inst.participant[0].individual.reference == "Practitioner/f003" assert inst.priority.coding[0].code == "103391001" assert inst.priority.coding[0].display == "Urgent" assert ( inst.priority.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.reasonCode[0].coding[0].code == "34068001" assert inst.reasonCode[0].coding[0].display == "Partial lobectomy of lung" assert ( inst.reasonCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.serviceProvider.display == "BMC" assert inst.serviceProvider.reference == "Organization/f001" assert inst.status == "finished" assert inst.subject.display == "P. van de Heuvel" assert inst.subject.reference == "Patient/f001" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "270427003" assert inst.type[0].coding[0].display == "Patient-initiated encounter" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_encounter_5(base_settings): """No. 5 tests collection for Encounter. Test File: encounter-example-f002-lung.json """ filename = base_settings["unittest_data_dir"] / "encounter-example-f002-lung.json" inst = encounter.Encounter.model_validate_json(filename.read_bytes()) assert "Encounter" == inst.get_resource_type() impl_encounter_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Encounter" == data["resourceType"] inst2 = encounter.Encounter(**data) impl_encounter_5(inst2) def impl_encounter_6(inst): assert inst.account[0].reference == "Account/example" assert inst.appointment[0].reference == "Appointment/example" assert inst.basedOn[0].reference == "ServiceRequest/myringotomy" assert inst.class_fhir.code == "IMP" assert inst.class_fhir.display == "inpatient encounter" assert ( inst.class_fhir.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.diagnosis[0].condition.reference == "Condition/stroke" assert inst.diagnosis[0].rank == 1 assert inst.diagnosis[0].use.coding[0].code == "AD" assert inst.diagnosis[0].use.coding[0].display == "Admission diagnosis" assert ( inst.diagnosis[0].use.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/diagnosis-role"} ).valueUri ) assert inst.diagnosis[1].condition.reference == "Condition/f201" assert inst.diagnosis[1].use.coding[0].code == "DD" assert inst.diagnosis[1].use.coding[0].display == "Discharge diagnosis" assert ( inst.diagnosis[1].use.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/diagnosis-role"} ).valueUri ) assert inst.episodeOfCare[0].reference == "EpisodeOfCare/example" assert inst.hospitalization.admitSource.coding[0].code == "309902002" assert ( inst.hospitalization.admitSource.coding[0].display == "Clinical Oncology Department" ) assert ( inst.hospitalization.admitSource.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.hospitalization.destination.reference == "Location/2" assert inst.hospitalization.dietPreference[0].coding[0].code == "276026009" assert ( inst.hospitalization.dietPreference[0].coding[0].display == "Fluid balance regulation" ) assert ( inst.hospitalization.dietPreference[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.hospitalization.origin.reference == "Location/2" assert inst.hospitalization.reAdmission.coding[0].display == "readmitted" assert inst.hospitalization.specialArrangement[0].coding[0].code == "wheel" assert inst.hospitalization.specialArrangement[0].coding[0].display == "Wheelchair" assert ( inst.hospitalization.specialArrangement[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/encounter-special-arrangements" } ).valueUri ) assert inst.hospitalization.specialCourtesy[0].coding[0].code == "NRM" assert ( inst.hospitalization.specialCourtesy[0].coding[0].display == "normal courtesy" ) assert ( inst.hospitalization.specialCourtesy[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/v3-EncounterSpecialCourtesy" } ).valueUri ) assert inst.id == "f203" assert inst.identifier[0].use == "temp" assert inst.identifier[0].value == "Encounter_Roel_20130311" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.partOf.reference == "Encounter/f203" assert inst.participant[0].individual.reference == "Practitioner/f201" assert inst.participant[0].type[0].coding[0].code == "PART" assert ( inst.participant[0].type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-20"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-11"} ).valueDateTime ) assert inst.priority.coding[0].code == "394849002" assert inst.priority.coding[0].display == "High priority" assert ( inst.priority.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.reasonCode[0].text == ( "The patient seems to suffer from bilateral pneumonia and " "renal insufficiency, most likely due to chemotherapy." ) assert inst.serviceProvider.reference == "Organization/2" assert inst.status == "finished" assert ( inst.statusHistory[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-08"} ).valueDateTime ) assert inst.statusHistory[0].status == "arrived" assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "183807002" assert inst.type[0].coding[0].display == "Inpatient stay for nine days" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_encounter_6(base_settings): """No. 6 tests collection for Encounter. Test File: encounter-example-f203-20130311.json """ filename = ( base_settings["unittest_data_dir"] / "encounter-example-f203-20130311.json" ) inst = encounter.Encounter.model_validate_json(filename.read_bytes()) assert "Encounter" == inst.get_resource_type() impl_encounter_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Encounter" == data["resourceType"] inst2 = encounter.Encounter(**data) impl_encounter_6(inst2) def impl_encounter_7(inst): assert inst.class_fhir.code == "AMB" assert inst.class_fhir.display == "ambulatory" assert ( inst.class_fhir.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.id == "xcda" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://healthcare.example.org/identifiers/enocunter"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "1234213.52345873" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].individual.reference == "Practitioner/xcda1" assert inst.reasonCode[0].coding[0].code == "T-D8200" assert inst.reasonCode[0].coding[0].display == "Arm" assert ( inst.reasonCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/xds/connectathon/eventCodes"} ).valueUri ) assert inst.status == "finished" assert inst.subject.reference == "Patient/xcda" assert inst.text.status == "generated" def test_encounter_7(base_settings): """No. 7 tests collection for Encounter. Test File: encounter-example-xcda.json """ filename = base_settings["unittest_data_dir"] / "encounter-example-xcda.json" inst = encounter.Encounter.model_validate_json(filename.read_bytes()) assert "Encounter" == inst.get_resource_type() impl_encounter_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Encounter" == data["resourceType"] inst2 = encounter.Encounter(**data) impl_encounter_7(inst2) def impl_encounter_8(inst): assert inst.class_fhir.code == "AMB" assert inst.class_fhir.display == "ambulatory" assert ( inst.class_fhir.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.diagnosis[0].condition.display == ( "Complications from Roel's TPF chemotherapy on January 28th, " "2013" ) assert inst.diagnosis[0].rank == 2 assert inst.diagnosis[0].use.coding[0].code == "AD" assert inst.diagnosis[0].use.coding[0].display == "Admission diagnosis" assert ( inst.diagnosis[0].use.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/diagnosis-role"} ).valueUri ) assert inst.diagnosis[1].condition.display == "The patient is treated for a tumor" assert inst.diagnosis[1].rank == 1 assert inst.diagnosis[1].use.coding[0].code == "CC" assert inst.diagnosis[1].use.coding[0].display == "Chief complaint" assert ( inst.diagnosis[1].use.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/diagnosis-role"} ).valueUri ) assert inst.id == "f202" assert inst.identifier[0].use == "temp" assert inst.identifier[0].value == "Encounter_Roel_20130128" assert inst.length.code == "min" assert ( inst.length.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.length.unit == "minutes" assert float(inst.length.value) == float(56) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].individual.reference == "Practitioner/f201" assert inst.priority.coding[0].code == "103391001" assert inst.priority.coding[0].display == "Urgent" assert ( inst.priority.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.reasonCode[0].text == "The patient is treated for a tumor." assert inst.serviceProvider.reference == "Organization/f201" assert inst.status == "finished" assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "367336001" assert inst.type[0].coding[0].display == "Chemotherapy" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_encounter_8(base_settings): """No. 8 tests collection for Encounter. Test File: encounter-example-f202-20130128.json """ filename = ( base_settings["unittest_data_dir"] / "encounter-example-f202-20130128.json" ) inst = encounter.Encounter.model_validate_json(filename.read_bytes()) assert "Encounter" == inst.get_resource_type() impl_encounter_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Encounter" == data["resourceType"] inst2 = encounter.Encounter(**data) impl_encounter_8(inst2) def impl_encounter_9(inst): assert inst.classHistory[0].class_fhir.code == "EMER" assert inst.classHistory[0].class_fhir.display == "emergency" assert ( inst.classHistory[0].class_fhir.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.classHistory[0].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T09:27:00+10:00"} ).valueDateTime ) assert ( inst.classHistory[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T07:15:00+10:00"} ).valueDateTime ) assert inst.classHistory[1].class_fhir.code == "IMP" assert inst.classHistory[1].class_fhir.display == "inpatient encounter" assert ( inst.classHistory[1].class_fhir.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.classHistory[1].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T09:27:00+10:00"} ).valueDateTime ) assert inst.class_fhir.code == "IMP" assert inst.class_fhir.display == "inpatient encounter" assert ( inst.class_fhir.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.hospitalization.admitSource.coding[0].code == "emd" assert ( inst.hospitalization.admitSource.coding[0].display == "From accident/emergency department" ) assert ( inst.hospitalization.admitSource.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/admit-source"} ).valueUri ) assert inst.id == "emerg" assert inst.location[0].location.display == "Emergency Waiting Room" assert ( inst.location[0].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T08:45:00+10:00"} ).valueDateTime ) assert ( inst.location[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T07:15:00+10:00"} ).valueDateTime ) assert inst.location[0].status == "active" assert inst.location[1].location.display == "Emergency" assert ( inst.location[1].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T09:27:00+10:00"} ).valueDateTime ) assert ( inst.location[1].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T08:45:00+10:00"} ).valueDateTime ) assert inst.location[1].status == "active" assert inst.location[2].location.display == "Ward 1, Room 42, Bed 1" assert ( inst.location[2].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T12:15:00+10:00"} ).valueDateTime ) assert ( inst.location[2].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T09:27:00+10:00"} ).valueDateTime ) assert inst.location[2].status == "active" assert inst.location[3].location.display == "Ward 1, Room 42, Bed 1" assert ( inst.location[3].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T12:45:00+10:00"} ).valueDateTime ) assert ( inst.location[3].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T12:15:00+10:00"} ).valueDateTime ) assert inst.location[3].status == "reserved" assert inst.location[4].location.display == "Ward 1, Room 42, Bed 1" assert ( inst.location[4].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T12:45:00+10:00"} ).valueDateTime ) assert inst.location[4].status == "active" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T07:15:00+10:00"} ).valueDateTime ) assert inst.status == "in-progress" assert ( inst.statusHistory[0].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T07:35:00+10:00"} ).valueDateTime ) assert ( inst.statusHistory[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T07:15:00+10:00"} ).valueDateTime ) assert inst.statusHistory[0].status == "arrived" assert ( inst.statusHistory[1].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T08:45:00+10:00"} ).valueDateTime ) assert ( inst.statusHistory[1].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T07:35:00+10:00"} ).valueDateTime ) assert inst.statusHistory[1].status == "triaged" assert ( inst.statusHistory[2].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T12:15:00+10:00"} ).valueDateTime ) assert ( inst.statusHistory[2].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T08:45:00+10:00"} ).valueDateTime ) assert inst.statusHistory[2].status == "in-progress" assert ( inst.statusHistory[3].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T12:45:00+10:00"} ).valueDateTime ) assert ( inst.statusHistory[3].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T12:15:00+10:00"} ).valueDateTime ) assert inst.statusHistory[3].status == "onleave" assert ( inst.statusHistory[4].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T12:45:00+10:00"} ).valueDateTime ) assert inst.statusHistory[4].status == "in-progress" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Emergency visit ' "that escalated into inpatient patient @example
" ) assert inst.text.status == "generated" def test_encounter_9(base_settings): """No. 9 tests collection for Encounter. Test File: encounter-example-emerg.json """ filename = base_settings["unittest_data_dir"] / "encounter-example-emerg.json" inst = encounter.Encounter.model_validate_json(filename.read_bytes()) assert "Encounter" == inst.get_resource_type() impl_encounter_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Encounter" == data["resourceType"] inst2 = encounter.Encounter(**data) impl_encounter_9(inst2) def impl_encounter_10(inst): assert inst.class_fhir.code == "AMB" assert inst.class_fhir.display == "ambulatory" assert ( inst.class_fhir.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.hospitalization.admitSource.coding[0].code == "305956004" assert inst.hospitalization.admitSource.coding[0].display == "Referral by physician" assert ( inst.hospitalization.admitSource.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.hospitalization.dischargeDisposition.coding[0].code == "306689006" assert ( inst.hospitalization.dischargeDisposition.coding[0].display == "Discharge to home" ) assert ( inst.hospitalization.dischargeDisposition.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.hospitalization.preAdmissionIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.amc.nl/zorgportal/identifiers/pre-admissions"} ).valueUri ) assert inst.hospitalization.preAdmissionIdentifier.use == "official" assert inst.hospitalization.preAdmissionIdentifier.value == "93042" assert inst.id == "f001" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.amc.nl/zorgportal/identifiers/visits"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "v1451" assert inst.length.code == "min" assert ( inst.length.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.length.unit == "min" assert float(inst.length.value) == float(140) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].individual.display == "P. Voigt" assert inst.participant[0].individual.reference == "Practitioner/f002" assert inst.priority.coding[0].code == "310361003" assert inst.priority.coding[0].display == "Non-urgent cardiological admission" assert ( inst.priority.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.reasonCode[0].coding[0].code == "34068001" assert inst.reasonCode[0].coding[0].display == "Heart valve replacement" assert ( inst.reasonCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.serviceProvider.display == "Burgers University Medical Center" assert inst.serviceProvider.reference == "Organization/f001" assert inst.status == "finished" assert inst.subject.display == "P. van de Heuvel" assert inst.subject.reference == "Patient/f001" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "270427003" assert inst.type[0].coding[0].display == "Patient-initiated encounter" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_encounter_10(base_settings): """No. 10 tests collection for Encounter. Test File: encounter-example-f001-heart.json """ filename = base_settings["unittest_data_dir"] / "encounter-example-f001-heart.json" inst = encounter.Encounter.model_validate_json(filename.read_bytes()) assert "Encounter" == inst.get_resource_type() impl_encounter_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Encounter" == data["resourceType"] inst2 = encounter.Encounter(**data) impl_encounter_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_endpoint.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Endpoint Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import endpoint from .conftest import ExternalValidatorModel # noqa: F401 def impl_endpoint_1(inst): assert ( inst.address == ExternalValidatorModel.model_validate( {"valueUrl": "https://pacs.hospital.org/IHEInvokeImageDisplay"} ).valueUrl ) assert inst.connectionType.code == "ihe-iid" assert ( inst.connectionType.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/endpoint-connection-type" } ).valueUri ) assert inst.id == "example-iid" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "PACS Hospital Invoke Image Display endpoint" assert inst.payloadType[0].text == "DICOM IID" assert inst.status == "active" assert inst.text.status == "generated" def test_endpoint_1(base_settings): """No. 1 tests collection for Endpoint. Test File: endpoint-example-iid.json """ filename = base_settings["unittest_data_dir"] / "endpoint-example-iid.json" inst = endpoint.Endpoint.model_validate_json(filename.read_bytes()) assert "Endpoint" == inst.get_resource_type() impl_endpoint_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Endpoint" == data["resourceType"] inst2 = endpoint.Endpoint(**data) impl_endpoint_1(inst2) def impl_endpoint_2(inst): assert ( inst.address == ExternalValidatorModel.model_validate( {"valueUrl": "mailto:MARTIN.SMIETANKA@directnppes.com"} ).valueUrl ) assert inst.connectionType.code == "direct-project" assert inst.id == "direct-endpoint" assert inst.managingOrganization.reference == "Organization/299" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "MARTIN SMIETANKA" assert ( inst.payloadType[0].coding[0].code == "urn:hl7-org:sdwg:ccda-structuredBody:1.1" ) assert ( inst.payloadType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.3.6.1.4.1.19376.1.2.3"} ).valueUri ) assert inst.status == "active" assert inst.text.status == "generated" def test_endpoint_2(base_settings): """No. 2 tests collection for Endpoint. Test File: endpoint-example-direct.json """ filename = base_settings["unittest_data_dir"] / "endpoint-example-direct.json" inst = endpoint.Endpoint.model_validate_json(filename.read_bytes()) assert "Endpoint" == inst.get_resource_type() impl_endpoint_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Endpoint" == data["resourceType"] inst2 = endpoint.Endpoint(**data) impl_endpoint_2(inst2) def impl_endpoint_3(inst): assert ( inst.address == ExternalValidatorModel.model_validate( {"valueUrl": "https://pacs.hospital.org/wado-rs"} ).valueUrl ) assert inst.connectionType.code == "dicom-wado-rs" assert ( inst.connectionType.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/endpoint-connection-type" } ).valueUri ) assert inst.id == "example-wadors" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "PACS Hospital DICOM WADO-RS endpoint" assert inst.payloadMimeType[0] == "application/dicom" assert inst.payloadType[0].text == "DICOM WADO-RS" assert inst.status == "active" assert inst.text.status == "generated" def test_endpoint_3(base_settings): """No. 3 tests collection for Endpoint. Test File: endpoint-example-wadors.json """ filename = base_settings["unittest_data_dir"] / "endpoint-example-wadors.json" inst = endpoint.Endpoint.model_validate_json(filename.read_bytes()) assert "Endpoint" == inst.get_resource_type() impl_endpoint_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Endpoint" == data["resourceType"] inst2 = endpoint.Endpoint(**data) impl_endpoint_3(inst2) def impl_endpoint_4(inst): assert ( inst.address == ExternalValidatorModel.model_validate( {"valueUrl": "http://fhir3.healthintersections.com.au/open/CarePlan"} ).valueUrl ) assert inst.connectionType.code == "hl7-fhir-rest" assert ( inst.connectionType.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/endpoint-connection-type" } ).valueUri ) assert inst.contact[0].system == "email" assert inst.contact[0].use == "work" assert inst.contact[0].value == "endpointmanager@example.org" assert inst.header[0] == "bearer-code BASGS534s4" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/enpoint-identifier"} ).valueUri ) assert inst.identifier[0].value == "epcp12" assert inst.managingOrganization.reference == "Organization/hl7" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Health Intersections CarePlan Hub" assert inst.payloadMimeType[0] == "application/fhir+xml" assert inst.payloadType[0].coding[0].code == "CarePlan" assert ( inst.payloadType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/resource-types"} ).valueUri ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-01"} ).valueDateTime ) assert inst.status == "active" assert inst.text.status == "generated" def test_endpoint_4(base_settings): """No. 4 tests collection for Endpoint. Test File: endpoint-example.json """ filename = base_settings["unittest_data_dir"] / "endpoint-example.json" inst = endpoint.Endpoint.model_validate_json(filename.read_bytes()) assert "Endpoint" == inst.get_resource_type() impl_endpoint_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Endpoint" == data["resourceType"] inst2 = endpoint.Endpoint(**data) impl_endpoint_4(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_enrollmentrequest.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/EnrollmentRequest Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import enrollmentrequest from .conftest import ExternalValidatorModel # noqa: F401 def impl_enrollmentrequest_1(inst): assert inst.candidate.reference == "Patient/1" assert inst.coverage.reference == "Coverage/9876B1" assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.id == "22345" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/enrollmentrequest"} ).valueUri ) assert inst.identifier[0].value == "EN22345" assert inst.insurer.reference == "Organization/2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.provider.reference == "Organization/1" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the EnrollmentRequest.
" ) assert inst.text.status == "generated" def test_enrollmentrequest_1(base_settings): """No. 1 tests collection for EnrollmentRequest. Test File: enrollmentrequest-example.json """ filename = base_settings["unittest_data_dir"] / "enrollmentrequest-example.json" inst = enrollmentrequest.EnrollmentRequest.model_validate_json( filename.read_bytes() ) assert "EnrollmentRequest" == inst.get_resource_type() impl_enrollmentrequest_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EnrollmentRequest" == data["resourceType"] inst2 = enrollmentrequest.EnrollmentRequest(**data) impl_enrollmentrequest_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_enrollmentresponse.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/EnrollmentResponse Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import enrollmentresponse from .conftest import ExternalValidatorModel # noqa: F401 def impl_enrollmentresponse_1(inst): assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.disposition == "Dependant added to policy." assert inst.id == "ER2500" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/enrollmentresponse"} ).valueUri ) assert inst.identifier[0].value == "781234" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.organization.reference == "Organization/2" assert inst.outcome == "complete" assert ( inst.request.reference == "http://www.BenefitsInc.com/fhir/eligibility/225476332402" ) assert inst.requestProvider.reference == "Organization/1" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the EnrollmentResponse
" ) assert inst.text.status == "generated" def test_enrollmentresponse_1(base_settings): """No. 1 tests collection for EnrollmentResponse. Test File: enrollmentresponse-example.json """ filename = base_settings["unittest_data_dir"] / "enrollmentresponse-example.json" inst = enrollmentresponse.EnrollmentResponse.model_validate_json( filename.read_bytes() ) assert "EnrollmentResponse" == inst.get_resource_type() impl_enrollmentresponse_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EnrollmentResponse" == data["resourceType"] inst2 = enrollmentresponse.EnrollmentResponse(**data) impl_enrollmentresponse_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_episodeofcare.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/EpisodeOfCare Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import episodeofcare from .conftest import ExternalValidatorModel # noqa: F401 def impl_episodeofcare_1(inst): assert inst.account[0].display == "example account" assert inst.account[0].reference == "Account/example" assert inst.careManager.display == "Amanda Assigned" assert inst.careManager.reference == "Practitioner/14" assert inst.diagnosis[0].condition.reference == "Condition/stroke" assert inst.diagnosis[0].rank == 1 assert inst.diagnosis[0].role.coding[0].code == "CC" assert inst.diagnosis[0].role.coding[0].display == "Chief complaint" assert ( inst.diagnosis[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/diagnosis-role"} ).valueUri ) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/sampleepisodeofcare-identifier"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.managingOrganization.reference == "Organization/hl7" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-01"} ).valueDateTime ) assert inst.referralRequest[0].display == "Referral from Example Aged Care Services" assert inst.status == "active" assert ( inst.statusHistory[0].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-14"} ).valueDateTime ) assert ( inst.statusHistory[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-01"} ).valueDateTime ) assert inst.statusHistory[0].status == "planned" assert ( inst.statusHistory[1].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-21"} ).valueDateTime ) assert ( inst.statusHistory[1].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-15"} ).valueDateTime ) assert inst.statusHistory[1].status == "active" assert ( inst.statusHistory[2].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-24"} ).valueDateTime ) assert ( inst.statusHistory[2].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-22"} ).valueDateTime ) assert inst.statusHistory[2].status == "onhold" assert ( inst.statusHistory[3].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-25"} ).valueDateTime ) assert inst.statusHistory[3].status == "active" assert inst.team[0].display == "example care team" assert inst.team[0].reference == "CareTeam/example" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "hacc" assert inst.type[0].coding[0].display == "Home and Community Care" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/episodeofcare-type"} ).valueUri ) def test_episodeofcare_1(base_settings): """No. 1 tests collection for EpisodeOfCare. Test File: episodeofcare-example.json """ filename = base_settings["unittest_data_dir"] / "episodeofcare-example.json" inst = episodeofcare.EpisodeOfCare.model_validate_json(filename.read_bytes()) assert "EpisodeOfCare" == inst.get_resource_type() impl_episodeofcare_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EpisodeOfCare" == data["resourceType"] inst2 = episodeofcare.EpisodeOfCare(**data) impl_episodeofcare_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_eventdefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/EventDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import eventdefinition from .conftest import ExternalValidatorModel # noqa: F401 def impl_eventdefinition_1(inst): assert inst.experimental is True assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.purpose == "Monitor all admissions to Emergency" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.trigger[0].condition.description == ( "Encounter Location = emergency (active/completed encounters," " current or previous)" ) assert inst.trigger[0].condition.expression == ( "(this | %previous).location.where(location = " "'Location/emergency' and status in {'active', " "'completed'}).exists()" ) assert inst.trigger[0].condition.language == "text/fhirpath" assert inst.trigger[0].data[0].type == "Encounter" assert inst.trigger[0].name == "monitor-emergency-admissions" assert inst.trigger[0].type == "named-event" def test_eventdefinition_1(base_settings): """No. 1 tests collection for EventDefinition. Test File: eventdefinition-example.json """ filename = base_settings["unittest_data_dir"] / "eventdefinition-example.json" inst = eventdefinition.EventDefinition.model_validate_json(filename.read_bytes()) assert "EventDefinition" == inst.get_resource_type() impl_eventdefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EventDefinition" == data["resourceType"] inst2 = eventdefinition.EventDefinition(**data) impl_eventdefinition_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_evidence.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Evidence Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import evidence from .conftest import ExternalValidatorModel # noqa: F401 def impl_evidence_1(inst): assert inst.description == ( "0.4% incidence of fatal intracranial hemorrhage within 7 " "days without alteplase in patients with acute ischemic " "stroke" ) assert inst.id == "example-stroke-no-alteplase-fatalICH" assert inst.relatedArtifact[0].label == "Emberson 2014" assert inst.relatedArtifact[0].type == "citation" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( {"valueUrl": "https://doi.org/10.1016/S0140-6736(14)60584-5"} ).valueUrl ) assert inst.statistic[0].numberOfEvents == 13 assert float(inst.statistic[0].quantity.value) == float(0.00386298627) assert inst.statistic[0].sampleSize.numberOfParticipants == 3365 assert inst.statistic[0].sampleSize.numberOfStudies == 9 assert inst.statistic[0].statisticType.coding[0].code == "C44256" assert inst.statistic[0].statisticType.coding[0].display == "Proportion" assert ( inst.statistic[0].statisticType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/statistic-type"} ).valueUri ) assert inst.status == "draft" assert inst.studyType.coding[0].code == "RCT" assert inst.studyType.coding[0].display == "randomized trial" assert ( inst.studyType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/study-type"} ).valueUri ) assert inst.synthesisType.coding[0].code == "IPD-MA" assert ( inst.synthesisType.coding[0].display == "individual patient data meta-analysis" ) assert ( inst.synthesisType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/synthesis-type"} ).valueUri ) assert inst.text.status == "generated" assert inst.title == "Risk of fatal ICH without alteplase for stroke" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/Evidence/example-stroke-no-alteplase-fatalICH" } ).valueUri ) assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.text == "Stroke" assert inst.useContext[1].code.code == "1386000" assert inst.useContext[1].code.display == "Intracranial hemorrhage" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[1].valueRange.high.unit == "d" assert float(inst.useContext[1].valueRange.high.value) == float(7) assert inst.useContext[1].valueRange.low.unit == "d" assert float(inst.useContext[1].valueRange.low.value) == float(0) assert ( inst.variableDefinition[0].intended.display == "adults with acute ischemic stroke" ) assert inst.variableDefinition[0].intended.reference == "Group/AcuteIschemicStroke" assert ( inst.variableDefinition[0].intended.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert ( inst.variableDefinition[0].observed.display == "adults with acute ischemic stroke" ) assert inst.variableDefinition[0].observed.reference == "Group/AcuteIschemicStroke" assert ( inst.variableDefinition[0].observed.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert inst.variableDefinition[0].variableRole.coding[0].code == "population" assert inst.variableDefinition[0].variableRole.coding[0].display == "population" assert ( inst.variableDefinition[0].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) assert ( inst.variableDefinition[1].intended.display == "adults with acute ischemic stroke treated without alteplase" ) assert ( inst.variableDefinition[1].intended.reference == "Group/AcuteIschemicStrokeTreatedWithoutAlteplase" ) assert ( inst.variableDefinition[1].intended.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert ( inst.variableDefinition[1].observed.display == "Emberson 2014 IPD-MA No Alteplase Cohort" ) assert ( inst.variableDefinition[1].observed.reference == "Group/Emberson-2014-IPD-MA-No-Alteplase-Cohort" ) assert ( inst.variableDefinition[1].observed.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert inst.variableDefinition[1].variableRole.coding[0].code == "population" assert inst.variableDefinition[1].variableRole.coding[0].display == "population" assert ( inst.variableDefinition[1].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) assert inst.variableDefinition[2].intended.display == "fatal ICH" assert ( inst.variableDefinition[2].intended.reference == "EvidenceVariable/example-fatal-ICH-in-7-days" ) assert ( inst.variableDefinition[2].intended.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[2].observed.display == "fatal ICH" assert ( inst.variableDefinition[2].observed.reference == "EvidenceVariable/example-fatal-ICH-in-7-days" ) assert ( inst.variableDefinition[2].observed.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[2].variableRole.coding[0].code == "measuredVariable" assert ( inst.variableDefinition[2].variableRole.coding[0].display == "measured variable" ) assert ( inst.variableDefinition[2].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) def test_evidence_1(base_settings): """No. 1 tests collection for Evidence. Test File: evidence-example-stroke-no-alteplase-fatalICH.json """ filename = ( base_settings["unittest_data_dir"] / "evidence-example-stroke-no-alteplase-fatalICH.json" ) inst = evidence.Evidence.model_validate_json(filename.read_bytes()) assert "Evidence" == inst.get_resource_type() impl_evidence_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Evidence" == data["resourceType"] inst2 = evidence.Evidence(**data) impl_evidence_1(inst2) def impl_evidence_2(inst): assert inst.certainty[0].description == ( "Very low certainty due to risk of bias, inconsistency, " "imprecision, and indirectness" ) assert inst.certainty[0].rating.coding[0].code == "very-low" assert inst.certainty[0].rating.coding[0].display == "Very low quality" assert ( inst.certainty[0].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[0].rating.coding[0].code == "no-concern" assert ( inst.certainty[0].subcomponent[0].rating.coding[0].display == "no serious concern" ) assert ( inst.certainty[0].subcomponent[0].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[0].type.coding[0].code == "PublicationBias" assert ( inst.certainty[0].subcomponent[0].type.coding[0].display == "Publication bias" ) assert ( inst.certainty[0].subcomponent[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-type"} ).valueUri ) assert inst.certainty[0].subcomponent[1].note[0].text == ( "IST-3 had inconsistent results and contributed large " "proportion of data" ) assert inst.certainty[0].subcomponent[1].rating.coding[0].code == "serious-concern" assert ( inst.certainty[0].subcomponent[1].rating.coding[0].display == "serious concern" ) assert ( inst.certainty[0].subcomponent[1].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[1].type.coding[0].code == "Inconsistency" assert inst.certainty[0].subcomponent[1].type.coding[0].display == "Inconsistency" assert ( inst.certainty[0].subcomponent[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-type"} ).valueUri ) assert inst.certainty[0].subcomponent[2].rating.coding[0].code == "serious-concern" assert ( inst.certainty[0].subcomponent[2].rating.coding[0].display == "serious concern" ) assert ( inst.certainty[0].subcomponent[2].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[2].type.coding[0].code == "Imprecision" assert inst.certainty[0].subcomponent[2].type.coding[0].display == "Imprecision" assert ( inst.certainty[0].subcomponent[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-type"} ).valueUri ) assert inst.certainty[0].subcomponent[3].note[0].text == ( "resuts derived for 3 - 4.5 hours assume data from 0 - 6 " "hours is informative" ) assert inst.certainty[0].subcomponent[3].rating.coding[0].code == "serious-concern" assert ( inst.certainty[0].subcomponent[3].rating.coding[0].display == "serious concern" ) assert ( inst.certainty[0].subcomponent[3].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[3].type.coding[0].code == "Indirectness" assert inst.certainty[0].subcomponent[3].type.coding[0].display == "Indirectness" assert ( inst.certainty[0].subcomponent[3].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-type"} ).valueUri ) assert inst.certainty[0].subcomponent[4].note[0].text == ( "results largely influenced by IST-3 trial which was " "unblinded and ECASS III which had baseline imbalances" ) assert inst.certainty[0].subcomponent[4].rating.coding[0].code == "serious-concern" assert ( inst.certainty[0].subcomponent[4].rating.coding[0].display == "serious concern" ) assert ( inst.certainty[0].subcomponent[4].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[4].type.coding[0].code == "RiskOfBias" assert inst.certainty[0].subcomponent[4].type.coding[0].display == "Risk of bias" assert ( inst.certainty[0].subcomponent[4].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-type"} ).valueUri ) assert inst.certainty[0].type.coding[0].code == "Overall" assert inst.certainty[0].type.coding[0].display == "Overall quality" assert ( inst.certainty[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-type"} ).valueUri ) assert inst.description == ( "mRS 0-2 at 90 days Odds Ratio 1.2 for Alteplase vs. No " "Alteplase in patients with acute ischemic stroke 3-4.5 hours" " prior" ) assert inst.id == "example-stroke-3-4half-alteplase-vs-no-alteplase-mRS0-2" assert inst.relatedArtifact[0].display == "Figure 2 Lees 2016" assert inst.relatedArtifact[0].label == "Lees 2016" assert inst.relatedArtifact[0].type == "citation" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( {"valueUrl": "https://doi.org/10.1161/STROKEAHA.116.013644"} ).valueUrl ) assert inst.statistic[0].attributeEstimate[0].description == "95% CI 1.06 to 1.3" assert float(inst.statistic[0].attributeEstimate[0].level) == float(0.95) assert float(inst.statistic[0].attributeEstimate[0].range.high.value) == float(1.3) assert float(inst.statistic[0].attributeEstimate[0].range.low.value) == float(1.06) assert inst.statistic[0].attributeEstimate[0].type.coding[0].code == "C53324" assert ( inst.statistic[0].attributeEstimate[0].type.coding[0].display == "Confidence interval" ) assert ( inst.statistic[0].attributeEstimate[0].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/attribute-estimate-type" } ).valueUri ) assert float(inst.statistic[0].quantity.value) == float(1.2) assert inst.statistic[0].sampleSize.numberOfStudies == 9 assert inst.statistic[0].statisticType.coding[0].code == "C16932" assert inst.statistic[0].statisticType.coding[0].display == "Odds Ratio" assert ( inst.statistic[0].statisticType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/statistic-type"} ).valueUri ) assert inst.status == "draft" assert inst.studyType.coding[0].code == "RCT" assert inst.studyType.coding[0].display == "randomized trial" assert ( inst.studyType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/study-type"} ).valueUri ) assert inst.synthesisType.coding[0].code == "IPD-MA" assert ( inst.synthesisType.coding[0].display == "individual patient data meta-analysis" ) assert ( inst.synthesisType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/synthesis-type"} ).valueUri ) assert inst.text.status == "generated" assert inst.title == ( "Effect of Alteplase vs No alteplase on mRS 0-2 at 90 days in" " Stroke 3-4.5 hours prior" ) assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/Evidence/example-stroke-3-4half-alteplase-vs-no-alteplase-mRS0-2" } ).valueUri ) assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.text == "Stroke" assert inst.variableDefinition[0].directnessMatch.coding[0].code == "moderate" assert ( inst.variableDefinition[0].directnessMatch.coding[0].display == "Moderate quality match" ) assert ( inst.variableDefinition[0].directnessMatch.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/directness"} ).valueUri ) assert inst.variableDefinition[0].intended.display == "stroke at 3-4.5 hours" assert ( inst.variableDefinition[0].intended.reference == "Group/AcuteIschemicStroke3-4halfHours" ) assert ( inst.variableDefinition[0].intended.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert ( inst.variableDefinition[0].observed.display == "Stroke Thrombolysis Trialists’ 2014-2016 IPD-MA Cohort" ) assert inst.variableDefinition[0].observed.reference == ( "EvidenceVariable/Stroke-Thrombolysis-" "Trialists-2014-2016-IPD-MA-Cohort" ) assert ( inst.variableDefinition[0].observed.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[0].variableRole.coding[0].code == "population" assert inst.variableDefinition[0].variableRole.coding[0].display == "population" assert ( inst.variableDefinition[0].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) assert ( inst.variableDefinition[1].intended.display == "Alive and not functionally dependent at 90 days" ) assert ( inst.variableDefinition[1].intended.reference == "EvidenceVariable/example-alive-independent-90day" ) assert ( inst.variableDefinition[1].intended.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[1].observed.display == "mRS 0-2 at 90 days" assert ( inst.variableDefinition[1].observed.reference == "EvidenceVariable/example-mRS0-2-at-90days" ) assert ( inst.variableDefinition[1].observed.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[1].variableRole.coding[0].code == "measuredVariable" assert ( inst.variableDefinition[1].variableRole.coding[0].display == "measured variable" ) assert ( inst.variableDefinition[1].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) assert inst.variableDefinition[2].intended.display == "Alteplase for Stroke" assert ( inst.variableDefinition[2].intended.reference == "EvidenceVariable/example-alteplase-for-stroke" ) assert ( inst.variableDefinition[2].intended.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[2].observed.display == "Alteplase for Stroke" assert ( inst.variableDefinition[2].observed.reference == "EvidenceVariable/example-alteplase-for-stroke" ) assert ( inst.variableDefinition[2].observed.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[2].variableRole.coding[0].code == "exposure" assert inst.variableDefinition[2].variableRole.coding[0].display == "exposure" assert ( inst.variableDefinition[2].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) assert inst.variableDefinition[3].intended.display == "no alteplase" assert ( inst.variableDefinition[3].intended.reference == "EvidenceVariable/example-no-alteplase" ) assert ( inst.variableDefinition[3].intended.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[3].observed.display == "no alteplase" assert ( inst.variableDefinition[3].observed.reference == "EvidenceVariable/example-no-alteplase" ) assert ( inst.variableDefinition[3].observed.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[3].variableRole.coding[0].code == "referenceExposure" assert ( inst.variableDefinition[3].variableRole.coding[0].display == "reference exposure" ) assert ( inst.variableDefinition[3].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) def test_evidence_2(base_settings): """No. 2 tests collection for Evidence. Test File: evidence-example-stroke-3-4half-alteplase-vs-no-alteplase-mRS0-2.json """ filename = ( base_settings["unittest_data_dir"] / "evidence-example-stroke-3-4half-alteplase-vs-no-alteplase-mRS0-2.json" ) inst = evidence.Evidence.model_validate_json(filename.read_bytes()) assert "Evidence" == inst.get_resource_type() impl_evidence_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Evidence" == data["resourceType"] inst2 = evidence.Evidence(**data) impl_evidence_2(inst2) def impl_evidence_3(inst): assert inst.certainty[0].description == "Moderate certainty due to risk of bias" assert inst.certainty[0].rating.coding[0].code == "moderate" assert inst.certainty[0].rating.coding[0].display == "Moderate" assert ( inst.certainty[0].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[0].rating.coding[0].code == "no-concern" assert ( inst.certainty[0].subcomponent[0].rating.coding[0].display == "no serious concern" ) assert ( inst.certainty[0].subcomponent[0].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[0].type.coding[0].code == "PublicationBias" assert ( inst.certainty[0].subcomponent[0].type.coding[0].display == "Publication bias" ) assert ( inst.certainty[0].subcomponent[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-type"} ).valueUri ) assert inst.certainty[0].subcomponent[1].rating.coding[0].code == "no-concern" assert ( inst.certainty[0].subcomponent[1].rating.coding[0].display == "no serious concern" ) assert ( inst.certainty[0].subcomponent[1].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[1].type.coding[0].code == "Inconsistency" assert inst.certainty[0].subcomponent[1].type.coding[0].display == "Inconsistency" assert ( inst.certainty[0].subcomponent[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-type"} ).valueUri ) assert inst.certainty[0].subcomponent[2].rating.coding[0].code == "no-concern" assert ( inst.certainty[0].subcomponent[2].rating.coding[0].display == "no serious concern" ) assert ( inst.certainty[0].subcomponent[2].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[2].type.coding[0].code == "Imprecision" assert inst.certainty[0].subcomponent[2].type.coding[0].display == "Imprecision" assert ( inst.certainty[0].subcomponent[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-type"} ).valueUri ) assert inst.certainty[0].subcomponent[3].rating.coding[0].code == "no-concern" assert ( inst.certainty[0].subcomponent[3].rating.coding[0].display == "no serious concern" ) assert ( inst.certainty[0].subcomponent[3].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[3].type.coding[0].code == "Indirectness" assert inst.certainty[0].subcomponent[3].type.coding[0].display == "Indirectness" assert ( inst.certainty[0].subcomponent[3].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-type"} ).valueUri ) assert inst.certainty[0].subcomponent[4].note[0].text == ( "results largely influenced by IST-3 trial which was " "unblinded and NINDS trial which had allocation concealment " "not stated and baseline imbalances" ) assert inst.certainty[0].subcomponent[4].rating.coding[0].code == "serious-concern" assert ( inst.certainty[0].subcomponent[4].rating.coding[0].display == "serious concern" ) assert ( inst.certainty[0].subcomponent[4].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[4].type.coding[0].code == "RiskOfBias" assert inst.certainty[0].subcomponent[4].type.coding[0].display == "Risk of bias" assert ( inst.certainty[0].subcomponent[4].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-type"} ).valueUri ) assert inst.certainty[0].type.coding[0].code == "Overall" assert inst.certainty[0].type.coding[0].display == "Overall quality" assert ( inst.certainty[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-type"} ).valueUri ) assert inst.description == ( "mRS 3-6 at 90 days Odds Ratio 0.65 for Alteplase vs. No " "Alteplase in patients with acute ischemic stroke 0-3 hours " "prior" ) assert inst.id == "example-stroke-0-3-alteplase-vs-no-alteplase-mRS3-6" assert inst.relatedArtifact[0].citation == ( "Wardlaw JM, Murray V, Berge E, del Zoppo GJ. Thrombolysis " "for acute ischaemic stroke. Cochrane Database Syst Rev. 2014" " Jul 29(7):CD000213. PMID 25072528" ) assert inst.relatedArtifact[0].display == "Analysis 1.16 from Wardlaw 2014" assert inst.relatedArtifact[0].label == "Wardlaw 2014" assert inst.relatedArtifact[0].type == "citation" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( {"valueUrl": "https://doi.org/10.1002/14651858.CD000213.pub3"} ).valueUrl ) assert inst.statistic[0].attributeEstimate[0].description == "95% CI 0.54 to 0.80" assert float(inst.statistic[0].attributeEstimate[0].level) == float(0.95) assert float(inst.statistic[0].attributeEstimate[0].range.high.value) == float(0.8) assert float(inst.statistic[0].attributeEstimate[0].range.low.value) == float(0.54) assert inst.statistic[0].attributeEstimate[0].type.coding[0].code == "C53324" assert ( inst.statistic[0].attributeEstimate[0].type.coding[0].display == "Confidence interval" ) assert ( inst.statistic[0].attributeEstimate[0].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/attribute-estimate-type" } ).valueUri ) assert inst.statistic[0].attributeEstimate[1].description == "P-value = 0.000023" assert float(inst.statistic[0].attributeEstimate[1].quantity.value) == float( 2.3e-05 ) assert inst.statistic[0].attributeEstimate[1].type.coding[0].code == "C44185" assert inst.statistic[0].attributeEstimate[1].type.coding[0].display == "P-value" assert ( inst.statistic[0].attributeEstimate[1].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/attribute-estimate-type" } ).valueUri ) assert ( inst.statistic[0].attributeEstimate[2].description == "Heterogeneity I-sq = 0.0%" ) assert inst.statistic[0].attributeEstimate[2].quantity.code == "%" assert ( inst.statistic[0].attributeEstimate[2].quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.statistic[0].attributeEstimate[2].quantity.unit == "%" assert float(inst.statistic[0].attributeEstimate[2].quantity.value) == float(0) assert inst.statistic[0].attributeEstimate[2].type.coding[0].code == "0000420" assert inst.statistic[0].attributeEstimate[2].type.coding[0].display == "I-squared" assert ( inst.statistic[0].attributeEstimate[2].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/attribute-estimate-type" } ).valueUri ) assert inst.statistic[0].numberOfEvents == 1137 assert float(inst.statistic[0].quantity.value) == float(0.65) assert inst.statistic[0].sampleSize.numberOfParticipants == 1779 assert inst.statistic[0].sampleSize.numberOfStudies == 6 assert inst.statistic[0].statisticType.coding[0].code == "C16932" assert inst.statistic[0].statisticType.coding[0].display == "Odds Ratio" assert ( inst.statistic[0].statisticType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/statistic-type"} ).valueUri ) assert inst.status == "draft" assert inst.studyType.coding[0].code == "RCT" assert inst.studyType.coding[0].display == "randomized trial" assert ( inst.studyType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/study-type"} ).valueUri ) assert inst.synthesisType.coding[0].code == "std-MA" assert inst.synthesisType.coding[0].display == "summary data meta-analysis" assert ( inst.synthesisType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/synthesis-type"} ).valueUri ) assert inst.text.status == "generated" assert inst.title == ( "Effect of Alteplase vs No alteplase on mRS 3-6 at 90 days in" " Stroke 0-3 hours prior" ) assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/Evidence/example-stroke-0-3-alteplase-vs-no-alteplase-mRS3-6" } ).valueUri ) assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.text == "Stroke" assert inst.variableDefinition[0].intended.display == "stroke at 0-3 hours" assert ( inst.variableDefinition[0].intended.reference == "Group/AcuteIschemicStroke0-3Hours" ) assert ( inst.variableDefinition[0].intended.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert ( inst.variableDefinition[0].observed.display == "Wardlaw 2014 Analysis 1.16.3 Evidence set" ) assert ( inst.variableDefinition[0].observed.reference == "EvidenceVariable/Wardlaw2014Analysis1.16.3EvidenceSet" ) assert ( inst.variableDefinition[0].observed.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[0].variableRole.coding[0].code == "population" assert inst.variableDefinition[0].variableRole.coding[0].display == "population" assert ( inst.variableDefinition[0].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) assert ( inst.variableDefinition[1].intended.display == "Dead or functionally dependent at 90 days" ) assert ( inst.variableDefinition[1].intended.reference == "EvidenceVariable/example-dead-or-dependent-90day" ) assert ( inst.variableDefinition[1].intended.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[1].observed.display == "mRS 3-6 at 90 days" assert ( inst.variableDefinition[1].observed.reference == "EvidenceVariable/example-mRS3-6-at-90days" ) assert ( inst.variableDefinition[1].observed.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[1].variableRole.coding[0].code == "measuredVariable" assert ( inst.variableDefinition[1].variableRole.coding[0].display == "measured variable" ) assert ( inst.variableDefinition[1].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) assert inst.variableDefinition[2].intended.display == "Alteplase for Stroke" assert ( inst.variableDefinition[2].intended.reference == "EvidenceVariable/example-alteplase-for-stroke" ) assert ( inst.variableDefinition[2].intended.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[2].observed.display == "Alteplase for Stroke" assert ( inst.variableDefinition[2].observed.reference == "EvidenceVariable/example-alteplase-for-stroke" ) assert ( inst.variableDefinition[2].observed.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[2].variableRole.coding[0].code == "exposure" assert inst.variableDefinition[2].variableRole.coding[0].display == "exposure" assert ( inst.variableDefinition[2].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) assert inst.variableDefinition[3].intended.display == "no alteplase" assert ( inst.variableDefinition[3].intended.reference == "EvidenceVariable/example-no-alteplase" ) assert ( inst.variableDefinition[3].intended.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[3].observed.display == "no alteplase" assert ( inst.variableDefinition[3].observed.reference == "EvidenceVariable/example-no-alteplase" ) assert ( inst.variableDefinition[3].observed.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[3].variableRole.coding[0].code == "referenceExposure" assert ( inst.variableDefinition[3].variableRole.coding[0].display == "reference exposure" ) assert ( inst.variableDefinition[3].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) def test_evidence_3(base_settings): """No. 3 tests collection for Evidence. Test File: evidence-example-stroke-0-3-alteplase-vs-no-alteplase-mRS3-6.json """ filename = ( base_settings["unittest_data_dir"] / "evidence-example-stroke-0-3-alteplase-vs-no-alteplase-mRS3-6.json" ) inst = evidence.Evidence.model_validate_json(filename.read_bytes()) assert "Evidence" == inst.get_resource_type() impl_evidence_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Evidence" == data["resourceType"] inst2 = evidence.Evidence(**data) impl_evidence_3(inst2) def impl_evidence_4(inst): assert inst.description == ( "2.7% incidence of fatal intracranial hemorrhage within 7 " "days with alteplase in patients with acute ischemic stroke" ) assert inst.id == "example-stroke-alteplase-fatalICH" assert inst.relatedArtifact[0].label == "Emberson 2014" assert inst.relatedArtifact[0].type == "citation" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( {"valueUrl": "https://doi.org/10.1016/S0140-6736(14)60584-5"} ).valueUrl ) assert inst.statistic[0].numberOfEvents == 91 assert float(inst.statistic[0].quantity.value) == float(0.026835741669) assert inst.statistic[0].sampleSize.numberOfParticipants == 3391 assert inst.statistic[0].sampleSize.numberOfStudies == 9 assert inst.statistic[0].statisticType.coding[0].code == "C44256" assert inst.statistic[0].statisticType.coding[0].display == "Proportion" assert ( inst.statistic[0].statisticType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/statistic-type"} ).valueUri ) assert inst.status == "draft" assert inst.studyType.coding[0].code == "RCT" assert inst.studyType.coding[0].display == "randomized trial" assert ( inst.studyType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/study-type"} ).valueUri ) assert inst.synthesisType.coding[0].code == "IPD-MA" assert ( inst.synthesisType.coding[0].display == "individual patient data meta-analysis" ) assert ( inst.synthesisType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/synthesis-type"} ).valueUri ) assert inst.text.status == "generated" assert inst.title == "Risk of fatal ICH with alteplase for stroke" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/Evidence/example-stroke-alteplase-fatalICH" } ).valueUri ) assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.text == "Stroke" assert inst.useContext[1].code.code == "1386000" assert inst.useContext[1].code.display == "Intracranial hemorrhage" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[1].valueRange.high.unit == "d" assert float(inst.useContext[1].valueRange.high.value) == float(7) assert inst.useContext[1].valueRange.low.unit == "d" assert float(inst.useContext[1].valueRange.low.value) == float(0) assert ( inst.variableDefinition[0].intended.display == "adults with acute ischemic stroke" ) assert inst.variableDefinition[0].intended.reference == "Group/AcuteIschemicStroke" assert ( inst.variableDefinition[0].intended.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert ( inst.variableDefinition[0].observed.display == "adults with acute ischemic stroke" ) assert inst.variableDefinition[0].observed.reference == "Group/AcuteIschemicStroke" assert ( inst.variableDefinition[0].observed.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert inst.variableDefinition[0].variableRole.coding[0].code == "population" assert inst.variableDefinition[0].variableRole.coding[0].display == "population" assert ( inst.variableDefinition[0].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) assert ( inst.variableDefinition[1].intended.display == "adults with acute ischemic stroke treated with alteplase" ) assert ( inst.variableDefinition[1].intended.reference == "Group/AcuteIschemicStrokeTreatedWithAlteplase" ) assert ( inst.variableDefinition[1].intended.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert ( inst.variableDefinition[1].observed.display == "Emberson 2014 IPD-MA Alteplase Cohort" ) assert ( inst.variableDefinition[1].observed.reference == "Group/Emberson-2014-IPD-MA-Alteplase-Cohort" ) assert ( inst.variableDefinition[1].observed.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert inst.variableDefinition[1].variableRole.coding[0].code == "population" assert inst.variableDefinition[1].variableRole.coding[0].display == "population" assert ( inst.variableDefinition[1].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) assert inst.variableDefinition[2].intended.display == "fatal ICH" assert ( inst.variableDefinition[2].intended.reference == "EvidenceVariable/example-fatal-ICH-in-7-days" ) assert ( inst.variableDefinition[2].intended.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[2].observed.display == "fatal ICH" assert ( inst.variableDefinition[2].observed.reference == "EvidenceVariable/example-fatal-ICH-in-7-days" ) assert ( inst.variableDefinition[2].observed.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[2].variableRole.coding[0].code == "measuredVariable" assert ( inst.variableDefinition[2].variableRole.coding[0].display == "measured variable" ) assert ( inst.variableDefinition[2].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) def test_evidence_4(base_settings): """No. 4 tests collection for Evidence. Test File: evidence-example-stroke-alteplase-fatalICH.json """ filename = ( base_settings["unittest_data_dir"] / "evidence-example-stroke-alteplase-fatalICH.json" ) inst = evidence.Evidence.model_validate_json(filename.read_bytes()) assert "Evidence" == inst.get_resource_type() impl_evidence_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Evidence" == data["resourceType"] inst2 = evidence.Evidence(**data) impl_evidence_4(inst2) def impl_evidence_5(inst): assert inst.certainty[0].rating.coding[0].code == "high" assert inst.certainty[0].rating.coding[0].display == "High quality" assert ( inst.certainty[0].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[0].rating.coding[0].code == "no-concern" assert ( inst.certainty[0].subcomponent[0].rating.coding[0].display == "no serious concern" ) assert ( inst.certainty[0].subcomponent[0].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[0].type.coding[0].code == "RiskOfBias" assert inst.certainty[0].subcomponent[0].type.coding[0].display == "Risk of bias" assert ( inst.certainty[0].subcomponent[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-type"} ).valueUri ) assert inst.certainty[0].subcomponent[1].description == ( "Estimated risk from validation calibration plot consistent " "with predicted risk; observed risk in subgroup with ASTRAL " "score = 12 consistent with validation calibration plot" ) assert inst.certainty[0].subcomponent[1].rating.coding[0].code == "no-concern" assert ( inst.certainty[0].subcomponent[1].rating.coding[0].display == "no serious concern" ) assert ( inst.certainty[0].subcomponent[1].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[1].type.coding[0].code == "Inconsistency" assert inst.certainty[0].subcomponent[1].type.coding[0].display == "Inconsistency" assert ( inst.certainty[0].subcomponent[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-type"} ).valueUri ) assert inst.certainty[0].subcomponent[2].rating.coding[0].code == "no-concern" assert ( inst.certainty[0].subcomponent[2].rating.coding[0].display == "no serious concern" ) assert ( inst.certainty[0].subcomponent[2].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[2].type.coding[0].code == "Indirectness" assert inst.certainty[0].subcomponent[2].type.coding[0].display == "Indirectness" assert ( inst.certainty[0].subcomponent[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-type"} ).valueUri ) assert inst.certainty[0].subcomponent[3].description == "Narrow confidence interval" assert inst.certainty[0].subcomponent[3].rating.coding[0].code == "no-concern" assert ( inst.certainty[0].subcomponent[3].rating.coding[0].display == "no serious concern" ) assert ( inst.certainty[0].subcomponent[3].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[3].type.coding[0].code == "Imprecision" assert inst.certainty[0].subcomponent[3].type.coding[0].display == "Imprecision" assert ( inst.certainty[0].subcomponent[3].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-type"} ).valueUri ) assert inst.certainty[0].subcomponent[4].rating.coding[0].code == "no-concern" assert ( inst.certainty[0].subcomponent[4].rating.coding[0].display == "no serious concern" ) assert ( inst.certainty[0].subcomponent[4].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[4].type.coding[0].code == "PublicationBias" assert ( inst.certainty[0].subcomponent[4].type.coding[0].display == "Publication bias" ) assert ( inst.certainty[0].subcomponent[4].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-type"} ).valueUri ) assert inst.certainty[0].type.coding[0].code == "Overall" assert inst.certainty[0].type.coding[0].display == "Overall quality" assert ( inst.certainty[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/certainty-type"} ).valueUri ) assert inst.description == "5.3% risk of mRS 3-6 at 90 days" assert inst.id == "example-ASTRAL-12-alteplase-mRS3-6" assert inst.relatedArtifact[0].display == ( "External Validation of the ASTRAL and DRAGON Scores for " "Prediction of Functional Outcome in Stroke." ) assert inst.relatedArtifact[0].label == "Cooray 2016 Validation Study" assert inst.relatedArtifact[0].type == "citation" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( {"valueUrl": "https://doi.org/10.1161/STROKEAHA.116.012802"} ).valueUrl ) assert inst.statistic[0].description == "5.3% risk" assert float(inst.statistic[0].quantity.value) == float(0.0525) assert inst.statistic[0].sampleSize.numberOfParticipants == 36131 assert inst.statistic[0].statisticType.coding[0].code == "C44256" assert inst.statistic[0].statisticType.coding[0].display == "Proportion" assert ( inst.statistic[0].statisticType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/statistic-type"} ).valueUri ) assert inst.statistic[0].statisticType.text == "derived proportion" assert inst.status == "draft" assert inst.studyType.coding[0].code == "series" assert inst.studyType.coding[0].display == "uncontrolled cohort or case series" assert ( inst.studyType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/study-type"} ).valueUri ) assert inst.text.status == "generated" assert inst.title == ( "Risk of mRS3-6 at 90 days after Alteplase for Stroke if " "ASTRAL score 12" ) assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/Evidence/example-ASTRAL-12-alteplase-mRS3-6" } ).valueUri ) assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.text == "Stroke" assert inst.variableDefinition[0].intended.display == ( "patients 0-4.5 hours after acute ischemic stroke onset with " "ASTRAL score = 12" ) assert inst.variableDefinition[0].intended.reference == "Group/ASTRAL-12" assert ( inst.variableDefinition[0].intended.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert inst.variableDefinition[0].observed.display == "ASTRAL validation cohort" assert ( inst.variableDefinition[0].observed.reference == "Group/ASTRAL-Cooray-validation-cohort" ) assert ( inst.variableDefinition[0].observed.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert inst.variableDefinition[0].variableRole.coding[0].code == "population" assert inst.variableDefinition[0].variableRole.coding[0].display == "population" assert ( inst.variableDefinition[0].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) assert ( inst.variableDefinition[1].description == "functionally dependent or dead at 3 months" ) assert inst.variableDefinition[1].directnessMatch.coding[0].code == "high" assert ( inst.variableDefinition[1].directnessMatch.coding[0].display == "High quality match" ) assert ( inst.variableDefinition[1].directnessMatch.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/directness"} ).valueUri ) assert ( inst.variableDefinition[1].intended.display == "Dead or functionally dependent at 90 days" ) assert ( inst.variableDefinition[1].intended.reference == "EvidenceVariable/example-dead-or-dependent-90day" ) assert ( inst.variableDefinition[1].intended.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[1].observed.display == "mRS 3-6 at 90 days" assert ( inst.variableDefinition[1].observed.reference == "EvidenceVariable/example-mRS3-6-at-90days" ) assert ( inst.variableDefinition[1].observed.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[1].variableRole.coding[0].code == "measuredVariable" assert ( inst.variableDefinition[1].variableRole.coding[0].display == "measured variable" ) assert ( inst.variableDefinition[1].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) assert inst.variableDefinition[2].directnessMatch.coding[0].code == "exact" assert inst.variableDefinition[2].directnessMatch.coding[0].display == "Exact match" assert ( inst.variableDefinition[2].directnessMatch.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/directness"} ).valueUri ) assert inst.variableDefinition[2].intended.display == "Alteplase for Stroke" assert ( inst.variableDefinition[2].intended.reference == "EvidenceVariable/example-alteplase-for-stroke" ) assert ( inst.variableDefinition[2].intended.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[2].observed.display == "Alteplase for Stroke" assert ( inst.variableDefinition[2].observed.reference == "EvidenceVariable/example-alteplase-for-stroke" ) assert ( inst.variableDefinition[2].observed.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[2].variableRole.coding[0].code == "exposure" assert inst.variableDefinition[2].variableRole.coding[0].display == "exposure" assert ( inst.variableDefinition[2].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) def test_evidence_5(base_settings): """No. 5 tests collection for Evidence. Test File: evidence-example-ASTRAL-12-alteplase-mRS3-6.json """ filename = ( base_settings["unittest_data_dir"] / "evidence-example-ASTRAL-12-alteplase-mRS3-6.json" ) inst = evidence.Evidence.model_validate_json(filename.read_bytes()) assert "Evidence" == inst.get_resource_type() impl_evidence_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Evidence" == data["resourceType"] inst2 = evidence.Evidence(**data) impl_evidence_5(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_evidencereport.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/EvidenceReport Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import evidencereport from .conftest import ExternalValidatorModel # noqa: F401 def impl_evidencereport_1(inst): assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "draft" assert inst.subject.note[0].text == "This is just an example." assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" def test_evidencereport_1(base_settings): """No. 1 tests collection for EvidenceReport. Test File: evidencereport-example.json """ filename = base_settings["unittest_data_dir"] / "evidencereport-example.json" inst = evidencereport.EvidenceReport.model_validate_json(filename.read_bytes()) assert "EvidenceReport" == inst.get_resource_type() impl_evidencereport_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EvidenceReport" == data["resourceType"] inst2 = evidencereport.EvidenceReport(**data) impl_evidencereport_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_evidencevariable.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/EvidenceVariable Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import evidencevariable from .conftest import ExternalValidatorModel # noqa: F401 def impl_evidencevariable_1(inst): assert inst.actual is True assert ( inst.characteristic[0].definitionCodeableConcept.coding[0].code == "182886004" ) assert ( inst.characteristic[0].definitionCodeableConcept.coding[0].display == "Placebo given (situation)" ) assert ( inst.characteristic[0].definitionCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.characteristic[0].description == "placebo" assert inst.id == "example-placebo" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "placebo" assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.text == "Stroke" def test_evidencevariable_1(base_settings): """No. 1 tests collection for EvidenceVariable. Test File: evidencevariable-example-placebo.json """ filename = ( base_settings["unittest_data_dir"] / "evidencevariable-example-placebo.json" ) inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes()) assert "EvidenceVariable" == inst.get_resource_type() impl_evidencevariable_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EvidenceVariable" == data["resourceType"] inst2 = evidencevariable.EvidenceVariable(**data) impl_evidencevariable_1(inst2) def impl_evidencevariable_2(inst): assert inst.actual is True assert inst.characteristic[0].definitionExpression.description == "mRS 0-2" assert inst.characteristic[0].definitionExpression.expression == ( '["Observation": code in "75859-9|LOINC"] mRS where ' "mRS.value between 0 and 2" ) assert inst.characteristic[0].definitionExpression.language == "text/cql" assert inst.characteristic[0].description == "mRS 0-2 at 90 days" assert inst.characteristic[0].timeFromStart.quantity.code == "d" assert ( inst.characteristic[0].timeFromStart.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[0].timeFromStart.quantity.unit == "day" assert float(inst.characteristic[0].timeFromStart.quantity.value) == float(90) assert inst.handling == "dichotomous" assert inst.id == "example-mRS0-2-at-90days" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Modified Rankin Scale score 0-2 at 90 days after treatment" assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.text == "Stroke" def test_evidencevariable_2(base_settings): """No. 2 tests collection for EvidenceVariable. Test File: evidencevariable-example-mRS0-2-at-90days.json """ filename = ( base_settings["unittest_data_dir"] / "evidencevariable-example-mRS0-2-at-90days.json" ) inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes()) assert "EvidenceVariable" == inst.get_resource_type() impl_evidencevariable_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EvidenceVariable" == data["resourceType"] inst2 = evidencevariable.EvidenceVariable(**data) impl_evidencevariable_2(inst2) def impl_evidencevariable_3(inst): assert inst.actual is True assert inst.characteristic[0].definitionCanonical == ( "http://example.org/fhir/ActivityDefinition/example-" "alteplase-dosing" ) assert inst.characteristic[0].description == ( "IV alteplase 0.9 mg/kg (maximum 90 mg) as 10% of dose over 1" " minute and 90% over 1 hour" ) assert inst.id == "example-alteplase-for-stroke" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Alteplase for Stroke" assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.text == "Stroke" def test_evidencevariable_3(base_settings): """No. 3 tests collection for EvidenceVariable. Test File: evidencevariable-example-alteplase-for-stroke.json """ filename = ( base_settings["unittest_data_dir"] / "evidencevariable-example-alteplase-for-stroke.json" ) inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes()) assert "EvidenceVariable" == inst.get_resource_type() impl_evidencevariable_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EvidenceVariable" == data["resourceType"] inst2 = evidencevariable.EvidenceVariable(**data) impl_evidencevariable_3(inst2) def impl_evidencevariable_4(inst): assert inst.actual is False assert inst.characteristic[0].definitionCodeableConcept.coding[0].code == "8410" assert ( inst.characteristic[0].definitionCodeableConcept.coding[0].display == "alteplase" ) assert ( inst.characteristic[0].definitionCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.characteristic[0].description == "no alteplase" assert inst.characteristic[0].exclude is True assert inst.id == "example-no-alteplase" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "no alteplase" assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.text == "Stroke" def test_evidencevariable_4(base_settings): """No. 4 tests collection for EvidenceVariable. Test File: evidencevariable-example-no-alteplase.json """ filename = ( base_settings["unittest_data_dir"] / "evidencevariable-example-no-alteplase.json" ) inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes()) assert "EvidenceVariable" == inst.get_resource_type() impl_evidencevariable_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EvidenceVariable" == data["resourceType"] inst2 = evidencevariable.EvidenceVariable(**data) impl_evidencevariable_4(inst2) def impl_evidencevariable_5(inst): assert inst.actual is False assert inst.characteristicCombination == "union" assert ( inst.characteristic[0].definitionCodeableConcept.coding[0].code == "718705001" ) assert ( inst.characteristic[0].definitionCodeableConcept.coding[0].display == "Functionally dependent (finding)" ) assert ( inst.characteristic[0].definitionCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.characteristic[0].description == "functionally dependent at 90 days" assert inst.characteristic[0].timeFromStart.quantity.code == "d" assert ( inst.characteristic[0].timeFromStart.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[0].timeFromStart.quantity.unit == "day" assert float(inst.characteristic[0].timeFromStart.quantity.value) == float(90) assert ( inst.characteristic[1].definitionCodeableConcept.coding[0].code == "419099009" ) assert ( inst.characteristic[1].definitionCodeableConcept.coding[0].display == "Dead (finding)" ) assert ( inst.characteristic[1].definitionCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.characteristic[1].description == "dead at 90 days" assert inst.characteristic[1].timeFromStart.quantity.code == "d" assert ( inst.characteristic[1].timeFromStart.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[1].timeFromStart.quantity.unit == "day" assert float(inst.characteristic[1].timeFromStart.quantity.value) == float(90) assert inst.handling == "dichotomous" assert inst.id == "example-dead-or-dependent-90day" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Dead or functionally dependent at 90 days" assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.text == "Stroke" def test_evidencevariable_5(base_settings): """No. 5 tests collection for EvidenceVariable. Test File: evidencevariable-example-dead-or-dependent-90day.json """ filename = ( base_settings["unittest_data_dir"] / "evidencevariable-example-dead-or-dependent-90day.json" ) inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes()) assert "EvidenceVariable" == inst.get_resource_type() impl_evidencevariable_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EvidenceVariable" == data["resourceType"] inst2 = evidencevariable.EvidenceVariable(**data) impl_evidencevariable_5(inst2) def impl_evidencevariable_6(inst): assert inst.actual is True assert inst.characteristicCombination == "union" assert ( inst.characteristic[0].definitionReference.display == "ECASS III Trial Cohort" ) assert ( inst.characteristic[0].definitionReference.reference == "Group/ECASSIII-Trial-Cohort" ) assert ( inst.characteristic[0].definitionReference.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert inst.characteristic[1].definitionReference.display == "IST3 Trial Cohort" assert ( inst.characteristic[1].definitionReference.reference == "Group/IST3-Trial-Cohort" ) assert ( inst.characteristic[1].definitionReference.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert inst.characteristic[2].definitionReference.display == "ECASS Trial Cohort" assert ( inst.characteristic[2].definitionReference.reference == "Group/ECASS-Trial-Cohort" ) assert ( inst.characteristic[2].definitionReference.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert inst.characteristic[3].definitionReference.display == "ECASSII Trial Cohort" assert ( inst.characteristic[3].definitionReference.reference == "Group/ECASSII-Trial-Cohort" ) assert ( inst.characteristic[3].definitionReference.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert inst.characteristic[4].definitionReference.display == "EPITHET Trial Cohort" assert ( inst.characteristic[4].definitionReference.reference == "Group/EPITHET-Trial-Cohort" ) assert ( inst.characteristic[4].definitionReference.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert inst.characteristic[5].definitionReference.display == "ATLANTIS Trial Cohort" assert ( inst.characteristic[5].definitionReference.reference == "Group/ATLANTIS-Trial-Cohort" ) assert ( inst.characteristic[5].definitionReference.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert inst.characteristic[6].definitionReference.display == "NINDS Trial Cohort" assert ( inst.characteristic[6].definitionReference.reference == "Group/NINDS-Trial-Cohort" ) assert ( inst.characteristic[6].definitionReference.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert inst.id == ( "example-Stroke-Thrombolysis-Trialists-2014-2016-IPD-MA-" "Cohort" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Stroke Thrombolysis Trialists’ 2014-2016 IPD-MA Cohort" assert inst.relatedArtifact[0].label == "Emberson 2014" assert inst.relatedArtifact[0].type == "citation" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( {"valueUrl": "https://doi.org/10.1016/S0140-6736(14)60584-5"} ).valueUrl ) assert inst.relatedArtifact[1].display == "Figure 2 Lees 2016" assert inst.relatedArtifact[1].label == "Lees 2016" assert inst.relatedArtifact[1].type == "citation" assert ( inst.relatedArtifact[1].url == ExternalValidatorModel.model_validate( {"valueUrl": "https://doi.org/10.1161/STROKEAHA.116.013644"} ).valueUrl ) assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == ( "Stroke Thrombolysis Trialists’ Collaborators Group " "collection used for individual patient data meta-analysis" ) assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.text == "Stroke" def test_evidencevariable_6(base_settings): """No. 6 tests collection for EvidenceVariable. Test File: evidencevariable-example-Stroke-Thrombolysis-Trialists-2014-2016-IPD-MA-Cohort.json """ filename = ( base_settings["unittest_data_dir"] / "evidencevariable-example-Stroke-Thrombolysis-Trialists-2014-2016-IPD-MA-Cohort.json" ) inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes()) assert "EvidenceVariable" == inst.get_resource_type() impl_evidencevariable_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EvidenceVariable" == data["resourceType"] inst2 = evidencevariable.EvidenceVariable(**data) impl_evidencevariable_6(inst2) def impl_evidencevariable_7(inst): assert inst.actual is True assert inst.characteristicCombination == "intersection" assert inst.characteristic[0].definitionCodeableConcept.coding[0].code == "1386000" assert ( inst.characteristic[0].definitionCodeableConcept.coding[0].display == "Intracranial hemorrhage (disorder)" ) assert ( inst.characteristic[0].definitionCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.characteristic[0].description == "intracranial hemorrhage within 7 days" assert inst.characteristic[0].timeFromStart.description == "within 7 days" assert inst.characteristic[0].timeFromStart.range.high.code == "d" assert ( inst.characteristic[0].timeFromStart.range.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[0].timeFromStart.range.high.unit == "day" assert float(inst.characteristic[0].timeFromStart.range.high.value) == float(7) assert inst.characteristic[0].timeFromStart.range.low.code == "d" assert ( inst.characteristic[0].timeFromStart.range.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[0].timeFromStart.range.low.unit == "day" assert float(inst.characteristic[0].timeFromStart.range.low.value) == float(0) assert ( inst.characteristic[1].definitionCodeableConcept.coding[0].code == "419620001" ) assert ( inst.characteristic[1].definitionCodeableConcept.coding[0].display == "Death (event)" ) assert ( inst.characteristic[1].definitionCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.characteristic[1].description == "death within 7 days" assert inst.characteristic[1].timeFromStart.description == "within 7 days" assert inst.characteristic[1].timeFromStart.range.high.code == "d" assert ( inst.characteristic[1].timeFromStart.range.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[1].timeFromStart.range.high.unit == "day" assert float(inst.characteristic[1].timeFromStart.range.high.value) == float(7) assert inst.characteristic[1].timeFromStart.range.low.code == "d" assert ( inst.characteristic[1].timeFromStart.range.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[1].timeFromStart.range.low.unit == "day" assert float(inst.characteristic[1].timeFromStart.range.low.value) == float(0) assert inst.handling == "dichotomous" assert inst.id == "example-fatal-ICH-in-7-days" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "Death must be due to intracranial hemorrhage" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Fatal Intracranial Hemorrhage Within Seven Days" assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.text == "Stroke" assert inst.useContext[1].code.code == "1386000" assert inst.useContext[1].code.display == "Intracranial hemorrhage" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[1].valueRange.high.unit == "d" assert float(inst.useContext[1].valueRange.high.value) == float(7) assert inst.useContext[1].valueRange.low.unit == "d" assert float(inst.useContext[1].valueRange.low.value) == float(0) def test_evidencevariable_7(base_settings): """No. 7 tests collection for EvidenceVariable. Test File: evidencevariable-example-fatal-ICH-in-7-days.json """ filename = ( base_settings["unittest_data_dir"] / "evidencevariable-example-fatal-ICH-in-7-days.json" ) inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes()) assert "EvidenceVariable" == inst.get_resource_type() impl_evidencevariable_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EvidenceVariable" == data["resourceType"] inst2 = evidencevariable.EvidenceVariable(**data) impl_evidencevariable_7(inst2) def impl_evidencevariable_8(inst): assert inst.actual is False assert inst.characteristicCombination == "intersection" assert ( inst.characteristic[0].definitionCodeableConcept.coding[0].code == "718705001" ) assert ( inst.characteristic[0].definitionCodeableConcept.coding[0].display == "Functionally dependent (finding)" ) assert ( inst.characteristic[0].definitionCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.characteristic[0].description == "not functionally dependent at 90 days" assert inst.characteristic[0].exclude is True assert inst.characteristic[0].timeFromStart.quantity.code == "d" assert ( inst.characteristic[0].timeFromStart.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[0].timeFromStart.quantity.unit == "day" assert float(inst.characteristic[0].timeFromStart.quantity.value) == float(90) assert ( inst.characteristic[1].definitionCodeableConcept.coding[0].code == "419099009" ) assert ( inst.characteristic[1].definitionCodeableConcept.coding[0].display == "Dead (finding)" ) assert ( inst.characteristic[1].definitionCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.characteristic[1].description == "alive at 90 days" assert inst.characteristic[1].exclude is True assert inst.characteristic[1].timeFromStart.quantity.code == "d" assert ( inst.characteristic[1].timeFromStart.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[1].timeFromStart.quantity.unit == "day" assert float(inst.characteristic[1].timeFromStart.quantity.value) == float(90) assert inst.handling == "dichotomous" assert inst.id == "example-alive-independent-90day" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Alive and not functionally dependent at 90 days" assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.text == "Stroke" def test_evidencevariable_8(base_settings): """No. 8 tests collection for EvidenceVariable. Test File: evidencevariable-example-alive-independent-90day.json """ filename = ( base_settings["unittest_data_dir"] / "evidencevariable-example-alive-independent-90day.json" ) inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes()) assert "EvidenceVariable" == inst.get_resource_type() impl_evidencevariable_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EvidenceVariable" == data["resourceType"] inst2 = evidencevariable.EvidenceVariable(**data) impl_evidencevariable_8(inst2) def impl_evidencevariable_9(inst): assert inst.actual is True assert inst.characteristic[0].definitionExpression.description == "mRS 3-6" assert inst.characteristic[0].definitionExpression.expression == ( '["Observation": code in "75859-9|LOINC"] mRS where ' "mRS.value between 3 and 6" ) assert inst.characteristic[0].definitionExpression.language == "text/cql" assert inst.characteristic[0].description == "mRS 3-6 at 90 days" assert inst.characteristic[0].timeFromStart.quantity.code == "d" assert ( inst.characteristic[0].timeFromStart.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[0].timeFromStart.quantity.unit == "day" assert float(inst.characteristic[0].timeFromStart.quantity.value) == float(90) assert inst.handling == "dichotomous" assert inst.id == "example-mRS3-6-at-90days" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Modified Rankin Scale score 3-6 at 90 days after treatment" assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.text == "Stroke" def test_evidencevariable_9(base_settings): """No. 9 tests collection for EvidenceVariable. Test File: evidencevariable-example-mRS3-6-at-90days.json """ filename = ( base_settings["unittest_data_dir"] / "evidencevariable-example-mRS3-6-at-90days.json" ) inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes()) assert "EvidenceVariable" == inst.get_resource_type() impl_evidencevariable_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EvidenceVariable" == data["resourceType"] inst2 = evidencevariable.EvidenceVariable(**data) impl_evidencevariable_9(inst2) def impl_evidencevariable_10(inst): assert inst.actual is True assert inst.characteristicCombination == "union" assert inst.characteristic[0].definitionReference.display == "NINDS 1995" assert ( inst.characteristic[0].definitionReference.type == ExternalValidatorModel.model_validate({"valueUri": "Evidence"}).valueUri ) assert inst.characteristic[1].definitionReference.display == "ECASS 1995" assert ( inst.characteristic[1].definitionReference.type == ExternalValidatorModel.model_validate({"valueUri": "Evidence"}).valueUri ) assert inst.characteristic[2].definitionReference.display == "ECASS II 1998" assert ( inst.characteristic[2].definitionReference.type == ExternalValidatorModel.model_validate({"valueUri": "Evidence"}).valueUri ) assert inst.characteristic[3].definitionReference.display == "ATLANTIS B 1999" assert ( inst.characteristic[3].definitionReference.type == ExternalValidatorModel.model_validate({"valueUri": "Evidence"}).valueUri ) assert inst.characteristic[4].definitionReference.display == "ATLANTIS A 2000" assert ( inst.characteristic[4].definitionReference.type == ExternalValidatorModel.model_validate({"valueUri": "Evidence"}).valueUri ) assert inst.characteristic[5].definitionReference.display == "IST3 2012" assert ( inst.characteristic[5].definitionReference.type == ExternalValidatorModel.model_validate({"valueUri": "Evidence"}).valueUri ) assert inst.handling == "dichotomous" assert inst.id == "example-Wardlaw2014Analysis1.16.3EvidenceSet" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Wardlaw 2014 Analysis 1.16.3 Evidence set" assert inst.note[0].text == ( "Short names for Evidence sources are detailed in " '"References to studies included in this review"' ) assert inst.relatedArtifact[0].citation == ( "Wardlaw JM, Murray V, Berge E, del Zoppo GJ. Thrombolysis " "for acute ischaemic stroke. Cochrane Database Syst Rev. 2014" " Jul 29(7):CD000213. PMID 25072528" ) assert inst.relatedArtifact[0].display == "Analysis 1.16.3 from Wardlaw 2014" assert inst.relatedArtifact[0].label == "Wardlaw 2014" assert inst.relatedArtifact[0].type == "citation" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( {"valueUrl": "https://doi.org/10.1002/14651858.CD000213.pub3"} ).valueUrl ) assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Wardlaw 2014 Analysis 1.16.3 Evidence set" assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.text == "Stroke" def test_evidencevariable_10(base_settings): """No. 10 tests collection for EvidenceVariable. Test File: evidencevariable-example-Wardlaw2014Analysis1.16.3EvidenceSet.json """ filename = ( base_settings["unittest_data_dir"] / "evidencevariable-example-Wardlaw2014Analysis1.16.3EvidenceSet.json" ) inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes()) assert "EvidenceVariable" == inst.get_resource_type() impl_evidencevariable_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EvidenceVariable" == data["resourceType"] inst2 = evidencevariable.EvidenceVariable(**data) impl_evidencevariable_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_examplescenario.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ExampleScenario Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import examplescenario from .conftest import ExternalValidatorModel # noqa: F401 def impl_examplescenario_1(inst): assert inst.actor[0].actorId == "Nurse" assert inst.actor[0].description == "The Nurse" assert inst.actor[0].name == "Nurse" assert inst.actor[0].type == "person" assert inst.actor[1].actorId == "MAP" assert inst.actor[1].description == ( "The entity that receives the Administration Requests to show" " the nurse to perform them" ) assert inst.actor[1].name == "Nurse's Tablet" assert inst.actor[1].type == "entity" assert inst.actor[2].actorId == "OP" assert inst.actor[2].description == "The Medication Administration Order Placer" assert inst.actor[2].name == "MAR / Scheduler" assert inst.actor[2].type == "entity" assert inst.actor[3].actorId == "MAC" assert inst.actor[3].description == ( "The entity that receives the Medication Administration " "reports" ) assert inst.actor[3].name == "MAR / EHR" assert inst.actor[3].type == "entity" assert inst.experimental is True assert inst.id == "example" assert inst.instance[0].description == ( 'The initial prescription which describes "medication X, 3 ' 'times per day" - the exact scheduling is not in the ' "initial prescription (it is left for the care teams to " "decide on the schedule)." ) assert inst.instance[0].name == "Initial Prescription" assert inst.instance[0].resourceId == "iherx001" assert ( inst.instance[1].description == "The administration request for day 1, morning" ) assert inst.instance[1].name == "Request for day 1, morning" assert inst.instance[1].resourceId == "iherx001.001" assert inst.instance[2].description == "The administration request for day 1, lunch" assert inst.instance[2].name == "Request for day 1, lunch" assert inst.instance[2].resourceId == "iherx001.002" assert ( inst.instance[3].description == "The administration request for day 1, evening" ) assert inst.instance[3].name == "Request for day 1, evening" assert inst.instance[3].resourceId == "iherx001.003" assert ( inst.instance[4].description == "The administration request for day 2, morning" ) assert inst.instance[4].name == "Request for day 2, morning" assert inst.instance[4].resourceId == "iherx001.004" assert inst.instance[5].description == "The administration request for day 2, lunch" assert inst.instance[5].name == "Request for day 2, lunch" assert inst.instance[5].resourceId == "iherx001.005" assert ( inst.instance[6].description == "The administration request for day 2, evening" ) assert inst.instance[6].name == "Request for day 2, evening" assert inst.instance[6].resourceId == "iherx001.006" assert ( inst.instance[7].description == "Administration report for day 1, morning: Taken" ) assert inst.instance[7].name == "Morning meds - taken" assert inst.instance[7].resourceId == "iheadm001a" assert ( inst.instance[8].description == "Administration report for day 1, morning: NOT Taken" ) assert inst.instance[8].name == "Morning meds - not taken" assert inst.instance[8].resourceId == "iheadm001b" assert inst.instance[9].containedInstance[0].resourceId == "iherx001.001" assert inst.instance[9].containedInstance[1].resourceId == "iherx001.002" assert inst.instance[9].containedInstance[2].resourceId == "iherx001.003" assert inst.instance[9].containedInstance[3].resourceId == "iherx001.004" assert inst.instance[9].containedInstance[4].resourceId == "iherx001.005" assert inst.instance[9].containedInstance[5].resourceId == "iherx001.006" assert inst.instance[9].description == "All the medication Requests for Day 1" assert inst.instance[9].name == "Bundle of Medication Requests" assert inst.instance[9].resourceId == "iherx001bundle" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.process[0].postConditions == ( "Medication administration Reports are submitted, EHR is " "updated." ) assert inst.process[0].preConditions == ( "Medication administration requests are in the EHR / MAR, " "scheduled for each individual intake." ) assert inst.process[0].step[0].operation.initiator == "Nurse" assert inst.process[0].step[0].operation.name == "1. Get today's schedule" assert inst.process[0].step[0].operation.number == "1" assert inst.process[0].step[0].operation.receiver == "MAP" assert inst.process[0].step[1].process[0].description == ( "Query for medication administration orders,\\n- For today's " "shifts\\n- For today's patients" ) assert inst.process[0].step[1].process[0].step[0].operation.initiator == "MAP" assert inst.process[0].step[1].process[0].step[0].operation.name == ( "2.Query for medication administration orders,\\n- For " "today's shifts\\n- For today's patients" ) assert inst.process[0].step[1].process[0].step[0].operation.number == "2" assert inst.process[0].step[1].process[0].step[0].operation.receiver == "OP" assert ( inst.process[0].step[1].process[0].step[0].operation.request.resourceId == "iherxqry" ) assert ( inst.process[0].step[1].process[0].step[0].operation.response.resourceId == "iherx001bundle" ) assert ( inst.process[0].step[1].process[0].title == "P1. Query Administration Requests" ) assert inst.process[0].step[2].pause is True assert inst.process[0].step[3].operation.initiator == "MAP" assert inst.process[0].step[3].operation.name == "Notify (alert)" assert inst.process[0].step[3].operation.number == "4" assert inst.process[0].step[3].operation.receiver == "Nurse" assert inst.process[0].step[4].operation.initiator == "Nurse" assert inst.process[0].step[4].operation.name == "Read orders" assert inst.process[0].step[4].operation.number == "5" assert inst.process[0].step[4].operation.receiver == "MAP" assert inst.process[0].step[5].pause is True assert inst.process[0].step[6].operation.initiator == "Nurse" assert inst.process[0].step[6].operation.name == "Ask if patient took meds" assert inst.process[0].step[6].operation.number == "5" assert inst.process[0].step[6].operation.receiver == "Nurse" assert ( inst.process[0].step[7].alternative[0].description == "Invoke if patient took medications" ) assert ( inst.process[0] .step[7] .alternative[0] .step[0] .process[0] .step[0] .operation.initiator == "Nurse" ) assert ( inst.process[0] .step[7] .alternative[0] .step[0] .process[0] .step[0] .operation.initiatorActive is True ) assert ( inst.process[0].step[7].alternative[0].step[0].process[0].step[0].operation.name == "Register Meds taken" ) assert ( inst.process[0] .step[7] .alternative[0] .step[0] .process[0] .step[0] .operation.number == "1a" ) assert ( inst.process[0] .step[7] .alternative[0] .step[0] .process[0] .step[0] .operation.receiver == "MAP" ) assert ( inst.process[0].step[7].alternative[0].step[0].process[0].title == "Register Meds taken" ) assert inst.process[0].step[7].alternative[0].title == "Patient took drugs" assert ( inst.process[0].step[7].alternative[1].description == "No, patient did not take drugs" ) assert ( inst.process[0] .step[7] .alternative[1] .step[0] .process[0] .step[0] .operation.initiator == "Nurse" ) assert ( inst.process[0] .step[7] .alternative[1] .step[0] .process[0] .step[0] .operation.initiatorActive is True ) assert ( inst.process[0].step[7].alternative[1].step[0].process[0].step[0].operation.name == "Register Meds NOT taken" ) assert ( inst.process[0] .step[7] .alternative[1] .step[0] .process[0] .step[0] .operation.number == "1b" ) assert ( inst.process[0] .step[7] .alternative[1] .step[0] .process[0] .step[0] .operation.receiver == "MAP" ) assert ( inst.process[0].step[7].alternative[1].step[0].process[0].title == "Register Meds NOT taken" ) assert inst.process[0].step[7].alternative[1].title == "No drugs" assert ( inst.process[0].step[7].alternative[2].description == "Unknown whether patient took medications or not" ) assert inst.process[0].step[7].alternative[2].step[0].pause is True assert inst.process[0].step[7].alternative[2].title == "Not clear" assert inst.process[0].step[8].pause is True assert inst.process[0].step[9].operation.initiator == "Nurse" assert inst.process[0].step[9].operation.name == "Administer drug" assert inst.process[0].step[9].operation.number == "6" assert inst.process[0].step[9].operation.receiver == "Nurse" assert inst.process[0].title == "Mobile Medication Administration" assert inst.status == "draft" assert inst.text.status == "generated" def test_examplescenario_1(base_settings): """No. 1 tests collection for ExampleScenario. Test File: examplescenario-example.json """ filename = base_settings["unittest_data_dir"] / "examplescenario-example.json" inst = examplescenario.ExampleScenario.model_validate_json(filename.read_bytes()) assert "ExampleScenario" == inst.get_resource_type() impl_examplescenario_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ExampleScenario" == data["resourceType"] inst2 = examplescenario.ExampleScenario(**data) impl_examplescenario_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_explanationofbenefit.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ExplanationOfBenefit Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import explanationofbenefit from .conftest import ExternalValidatorModel # noqa: F401 def impl_explanationofbenefit_1(inst): assert inst.careTeam[0].provider.reference == "Practitioner/example" assert inst.careTeam[0].sequence == 1 assert inst.claim.reference == "Claim/100150" assert inst.claimResponse.reference == "ClaimResponse/R3500" assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.disposition == "Claim settled as per contract." assert inst.enterer.reference == "Practitioner/1" assert inst.facility.reference == "Location/1" assert inst.id == "EB3500" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/explanationofbenefit"} ).valueUri ) assert inst.identifier[0].value == "987654321" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].focal is True assert inst.insurer.reference == "Organization/3" assert inst.item[0].adjudication[0].amount.currency == "USD" assert float(inst.item[0].adjudication[0].amount.value) == float(120.0) assert inst.item[0].adjudication[0].category.coding[0].code == "eligible" assert inst.item[0].adjudication[1].category.coding[0].code == "eligpercent" assert float(inst.item[0].adjudication[1].value) == float(0.8) assert inst.item[0].adjudication[2].amount.currency == "USD" assert float(inst.item[0].adjudication[2].amount.value) == float(96.0) assert inst.item[0].adjudication[2].category.coding[0].code == "benefit" assert inst.item[0].careTeamSequence[0] == 1 assert inst.item[0].encounter[0].reference == "Encounter/example" assert inst.item[0].net.currency == "USD" assert float(inst.item[0].net.value) == float(135.57) assert inst.item[0].productOrService.coding[0].code == "1205" assert ( inst.item[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-USCLS"} ).valueUri ) assert inst.item[0].sequence == 1 assert ( inst.item[0].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert inst.item[0].udi[0].reference == "Device/example" assert inst.item[0].unitPrice.currency == "USD" assert float(inst.item[0].unitPrice.value) == float(135.57) assert inst.item[1].adjudication[0].amount.currency == "USD" assert float(inst.item[1].adjudication[0].amount.value) == float(180.0) assert inst.item[1].adjudication[0].category.coding[0].code == "benefit" assert inst.item[1].careTeamSequence[0] == 1 assert inst.item[1].detail[0].adjudication[0].amount.currency == "USD" assert float(inst.item[1].detail[0].adjudication[0].amount.value) == float(180.0) assert inst.item[1].detail[0].adjudication[0].category.coding[0].code == "benefit" assert inst.item[1].detail[0].net.currency == "USD" assert float(inst.item[1].detail[0].net.value) == float(200.0) assert inst.item[1].detail[0].productOrService.coding[0].code == "group" assert inst.item[1].detail[0].sequence == 1 assert inst.item[1].detail[0].subDetail[0].adjudication[0].amount.currency == "USD" assert float( inst.item[1].detail[0].subDetail[0].adjudication[0].amount.value ) == float(200.0) assert ( inst.item[1].detail[0].subDetail[0].adjudication[0].category.coding[0].code == "eligible" ) assert ( inst.item[1].detail[0].subDetail[0].adjudication[1].category.coding[0].code == "eligpercent" ) assert float(inst.item[1].detail[0].subDetail[0].adjudication[1].value) == float( 0.9 ) assert inst.item[1].detail[0].subDetail[0].adjudication[2].amount.currency == "USD" assert float( inst.item[1].detail[0].subDetail[0].adjudication[2].amount.value ) == float(180.0) assert ( inst.item[1].detail[0].subDetail[0].adjudication[2].category.coding[0].code == "benefit" ) assert inst.item[1].detail[0].subDetail[0].net.currency == "USD" assert float(inst.item[1].detail[0].subDetail[0].net.value) == float(200.0) assert inst.item[1].detail[0].subDetail[0].productOrService.coding[0].code == "1205" assert ( inst.item[1].detail[0].subDetail[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-USCLS"} ).valueUri ) assert inst.item[1].detail[0].subDetail[0].sequence == 1 assert inst.item[1].detail[0].subDetail[0].udi[0].reference == "Device/example" assert inst.item[1].detail[0].subDetail[0].unitPrice.currency == "USD" assert float(inst.item[1].detail[0].subDetail[0].unitPrice.value) == float(200.0) assert inst.item[1].detail[0].udi[0].reference == "Device/example" assert inst.item[1].net.currency == "USD" assert float(inst.item[1].net.value) == float(200.0) assert inst.item[1].productOrService.coding[0].code == "group" assert inst.item[1].sequence == 2 assert ( inst.item[1].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "complete" assert inst.patient.reference == "Patient/pat1" assert inst.payee.party.reference == "Organization/2" assert inst.payee.type.coding[0].code == "provider" assert ( inst.payee.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/payeetype"} ).valueUri ) assert inst.provider.reference == "Practitioner/1" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the ExplanationOfBenefit
" ) assert inst.text.status == "generated" assert inst.total[0].amount.currency == "USD" assert float(inst.total[0].amount.value) == float(135.57) assert inst.total[0].category.coding[0].code == "submitted" assert inst.total[1].amount.currency == "USD" assert float(inst.total[1].amount.value) == float(96.0) assert inst.total[1].category.coding[0].code == "benefit" assert inst.type.coding[0].code == "oral" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_explanationofbenefit_1(base_settings): """No. 1 tests collection for ExplanationOfBenefit. Test File: explanationofbenefit-example.json """ filename = base_settings["unittest_data_dir"] / "explanationofbenefit-example.json" inst = explanationofbenefit.ExplanationOfBenefit.model_validate_json( filename.read_bytes() ) assert "ExplanationOfBenefit" == inst.get_resource_type() impl_explanationofbenefit_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ExplanationOfBenefit" == data["resourceType"] inst2 = explanationofbenefit.ExplanationOfBenefit(**data) impl_explanationofbenefit_1(inst2) def impl_explanationofbenefit_2(inst): assert ( inst.accident.date == ExternalValidatorModel.model_validate({"valueDate": "2014-02-14"}).valueDate ) assert inst.accident.locationReference.reference == "Location/ph" assert inst.accident.type.coding[0].code == "SPT" assert ( inst.accident.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.billablePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-03-01"} ).valueDateTime ) assert ( inst.billablePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-02-01"} ).valueDateTime ) assert inst.claim.reference == "Claim/100150" assert inst.claimResponse.reference == "ClaimResponse/R3500" assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.disposition == "Could not process." assert inst.enterer.reference == "Practitioner/1" assert inst.facility.reference == "Location/1" assert inst.formCode.coding[0].code == "2" assert ( inst.formCode.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/forms-codes"} ).valueUri ) assert inst.id == "EB3501" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/explanationofbenefit"} ).valueUri ) assert inst.identifier[0].value == "error-1" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].focal is True assert inst.insurer.reference == "Organization/2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.originalPrescription.reference == "MedicationRequest/medrx0301" assert inst.outcome == "error" assert inst.patient.reference == "Patient/pat1" assert inst.precedence == 2 assert inst.prescription.reference == "MedicationRequest/medrx002" assert ( inst.procedure[0].date == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-02-14"} ).valueDateTime ) assert inst.procedure[0].procedureCodeableConcept.coding[0].code == "123001" assert ( inst.procedure[0].procedureCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/ex-icd-10-procedures"} ).valueUri ) assert inst.procedure[0].sequence == 1 assert inst.procedure[0].udi[0].reference == "Device/example" assert inst.processNote[0].language.coding[0].code == "en-CA" assert ( inst.processNote[0].language.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:47"} ).valueUri ) assert inst.processNote[0].number == 1 assert inst.processNote[0].text == "Invalid claim" assert inst.processNote[0].type == "display" assert inst.provider.reference == "Organization/2" assert ( inst.related[0].reference.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/case-number"} ).valueUri ) assert inst.related[0].reference.value == "23-56Tu-XX-47-20150M14" assert inst.status == "active" assert inst.subType.coding[0].code == "emergency" assert ( inst.subType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-claimsubtype"} ).valueUri ) assert inst.supportingInfo[0].category.coding[0].code == "employmentimpacted" assert ( inst.supportingInfo[0].category.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/claiminformationcategory" } ).valueUri ) assert inst.supportingInfo[0].sequence == 1 assert ( inst.supportingInfo[0].timingPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-02-28"} ).valueDateTime ) assert ( inst.supportingInfo[0].timingPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-02-14"} ).valueDateTime ) assert inst.supportingInfo[1].category.coding[0].code == "hospitalized" assert ( inst.supportingInfo[1].category.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/claiminformationcategory" } ).valueUri ) assert inst.supportingInfo[1].sequence == 2 assert ( inst.supportingInfo[1].timingPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-02-16"} ).valueDateTime ) assert ( inst.supportingInfo[1].timingPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-02-14"} ).valueDateTime ) assert inst.text.status == "generated" assert inst.total[0].amount.currency == "USD" assert float(inst.total[0].amount.value) == float(2478.57) assert inst.total[0].category.coding[0].code == "submitted" assert inst.total[1].amount.currency == "USD" assert float(inst.total[1].amount.value) == float(0.0) assert inst.total[1].category.coding[0].code == "benefit" assert inst.type.coding[0].code == "oral" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_explanationofbenefit_2(base_settings): """No. 2 tests collection for ExplanationOfBenefit. Test File: explanationofbenefit-example-2.json """ filename = ( base_settings["unittest_data_dir"] / "explanationofbenefit-example-2.json" ) inst = explanationofbenefit.ExplanationOfBenefit.model_validate_json( filename.read_bytes() ) assert "ExplanationOfBenefit" == inst.get_resource_type() impl_explanationofbenefit_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ExplanationOfBenefit" == data["resourceType"] inst2 = explanationofbenefit.ExplanationOfBenefit(**data) impl_explanationofbenefit_2(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_familymemberhistory.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/FamilyMemberHistory Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import familymemberhistory from .conftest import ExternalValidatorModel # noqa: F401 def impl_familymemberhistory_1(inst): assert inst.condition[0].code.coding[0].code == "315619001" assert inst.condition[0].code.coding[0].display == "Myocardial Infarction" assert ( inst.condition[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.condition[0].code.text == "Heart Attack" assert inst.condition[0].contributedToDeath is True assert inst.condition[0].note[0].text == ( "Was fishing at the time. At least he went doing someting he " "loved." ) assert inst.condition[0].onsetAge.code == "a" assert ( inst.condition[0].onsetAge.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.condition[0].onsetAge.unit == "yr" assert float(inst.condition[0].onsetAge.value) == float(74) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2011-03-18"} ).valueDateTime ) assert inst.id == "father" assert inst.identifier[0].value == "12345" assert ( inst.instantiatesUri[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/family-member-history-questionnaire"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.display == "Peter Patient" assert inst.patient.reference == "Patient/example" assert inst.relationship.coding[0].code == "FTH" assert inst.relationship.coding[0].display == "father" assert ( inst.relationship.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) assert inst.sex.coding[0].code == "male" assert inst.sex.coding[0].display == "Male" assert ( inst.sex.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/administrative-gender"} ).valueUri ) assert inst.status == "completed" assert inst.text.div == ( '
Father died of a' " heart attack aged 74
" ) assert inst.text.status == "generated" def test_familymemberhistory_1(base_settings): """No. 1 tests collection for FamilyMemberHistory. Test File: familymemberhistory-example.json """ filename = base_settings["unittest_data_dir"] / "familymemberhistory-example.json" inst = familymemberhistory.FamilyMemberHistory.model_validate_json( filename.read_bytes() ) assert "FamilyMemberHistory" == inst.get_resource_type() impl_familymemberhistory_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "FamilyMemberHistory" == data["resourceType"] inst2 = familymemberhistory.FamilyMemberHistory(**data) impl_familymemberhistory_1(inst2) def impl_familymemberhistory_2(inst): assert inst.condition[0].code.coding[0].code == "371041009" assert inst.condition[0].code.coding[0].display == "Embolic Stroke" assert ( inst.condition[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.condition[0].code.text == "Stroke" assert inst.condition[0].onsetAge.code == "a" assert ( inst.condition[0].onsetAge.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.condition[0].onsetAge.unit == "yr" assert float(inst.condition[0].onsetAge.value) == float(56) assert inst.id == "mother" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.display == "Peter Patient" assert inst.patient.reference == "Patient/100" assert inst.relationship.coding[0].code == "MTH" assert inst.relationship.coding[0].display == "mother" assert ( inst.relationship.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) assert inst.status == "completed" assert inst.text.div == ( '
Mother died of a' " stroke aged 56
" ) assert inst.text.status == "generated" def test_familymemberhistory_2(base_settings): """No. 2 tests collection for FamilyMemberHistory. Test File: familymemberhistory-example-mother.json """ filename = ( base_settings["unittest_data_dir"] / "familymemberhistory-example-mother.json" ) inst = familymemberhistory.FamilyMemberHistory.model_validate_json( filename.read_bytes() ) assert "FamilyMemberHistory" == inst.get_resource_type() impl_familymemberhistory_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "FamilyMemberHistory" == data["resourceType"] inst2 = familymemberhistory.FamilyMemberHistory(**data) impl_familymemberhistory_2(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_flag.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Flag Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import flag from .conftest import ExternalValidatorModel # noqa: F401 def impl_flag_1(inst): assert inst.author.display == "Nancy Nurse" assert inst.author.reference == "Practitioner/example" assert inst.category[0].coding[0].code == "safety" assert inst.category[0].coding[0].display == "Safety" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/flag-category"} ).valueUri ) assert inst.category[0].text == "Safety" assert inst.code.coding[0].code == "bigdog" assert inst.code.coding[0].display == "Big dog" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/local"} ).valueUri ) assert inst.code.text == ( "Patient has a big dog at his home. Always always wear a suit" " of armor or take other active counter-measures" ) assert inst.id == "example" 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-12-01"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-17"} ).valueDateTime ) assert inst.status == "inactive" assert inst.subject.display == "Peter Patient" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Large Dog ' "warning for Peter Patient
" ) assert inst.text.status == "generated" def test_flag_1(base_settings): """No. 1 tests collection for Flag. Test File: flag-example.json """ filename = base_settings["unittest_data_dir"] / "flag-example.json" inst = flag.Flag.model_validate_json(filename.read_bytes()) assert "Flag" == inst.get_resource_type() impl_flag_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Flag" == data["resourceType"] inst2 = flag.Flag(**data) impl_flag_1(inst2) def impl_flag_2(inst): assert inst.category[0].coding[0].code == "infection" assert inst.category[0].coding[0].display == "Infection Control Level" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/local"} ).valueUri ) assert inst.code.coding[0].code == "l3" assert inst.code.coding[0].display == "Follow Level 3 Protocol" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/local/if1"} ).valueUri ) assert inst.encounter.reference == "Encounter/example" assert inst.id == "example-encounter" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "active" assert inst.subject.display == "Peter Patient" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Follow Infection' " Control Level 3 Protocol
" ) assert inst.text.status == "generated" def test_flag_2(base_settings): """No. 2 tests collection for Flag. Test File: flag-example-encounter.json """ filename = base_settings["unittest_data_dir"] / "flag-example-encounter.json" inst = flag.Flag.model_validate_json(filename.read_bytes()) assert "Flag" == inst.get_resource_type() impl_flag_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Flag" == data["resourceType"] inst2 = flag.Flag(**data) impl_flag_2(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_goal.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Goal Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import goal from .conftest import ExternalValidatorModel # noqa: F401 def impl_goal_1(inst): assert inst.addresses[0].display == "obesity condition" assert inst.category[0].coding[0].code == "dietary" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/goal-category"} ).valueUri ) assert inst.description.text == "Target weight is 160 to 180 lbs." assert inst.expressedBy.display == "Peter James Chalmers" assert inst.expressedBy.reference == "Patient/example" assert inst.id == "example" assert inst.identifier[0].value == "123" assert inst.lifecycleStatus == "on-hold" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcomeReference[0].display == "Body Weight Measured" assert inst.outcomeReference[0].reference == "Observation/example" assert inst.priority.coding[0].code == "high-priority" assert inst.priority.coding[0].display == "High Priority" assert ( inst.priority.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/goal-priority"} ).valueUri ) assert inst.priority.text == "high" assert ( inst.startDate == ExternalValidatorModel.model_validate({"valueDate": "2015-04-05"}).valueDate ) assert ( inst.statusDate == ExternalValidatorModel.model_validate({"valueDate": "2016-02-14"}).valueDate ) assert ( inst.statusReason == "Patient wants to defer weight loss until after honeymoon." ) assert inst.subject.display == "Peter James Chalmers" assert inst.subject.reference == "Patient/example" assert inst.target[0].detailRange.high.code == "[lb_av]" assert ( inst.target[0].detailRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.target[0].detailRange.high.unit == "lbs" assert float(inst.target[0].detailRange.high.value) == float(180) assert inst.target[0].detailRange.low.code == "[lb_av]" assert ( inst.target[0].detailRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.target[0].detailRange.low.unit == "lbs" assert float(inst.target[0].detailRange.low.value) == float(160) assert ( inst.target[0].dueDate == ExternalValidatorModel.model_validate({"valueDate": "2016-04-05"}).valueDate ) assert inst.target[0].measure.coding[0].code == "3141-9" assert inst.target[0].measure.coding[0].display == "Weight Measured" assert ( inst.target[0].measure.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.text.status == "additional" def test_goal_1(base_settings): """No. 1 tests collection for Goal. Test File: goal-example.json """ filename = base_settings["unittest_data_dir"] / "goal-example.json" inst = goal.Goal.model_validate_json(filename.read_bytes()) assert "Goal" == inst.get_resource_type() impl_goal_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Goal" == data["resourceType"] inst2 = goal.Goal(**data) impl_goal_1(inst2) def impl_goal_2(inst): assert inst.achievementStatus.coding[0].code == "achieved" assert inst.achievementStatus.coding[0].display == "Achieved" assert ( inst.achievementStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/goal-achievement"} ).valueUri ) assert inst.achievementStatus.text == "Achieved" assert inst.description.text == "Stop smoking" assert inst.id == "stop-smoking" assert inst.identifier[0].value == "123" assert inst.lifecycleStatus == "completed" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcomeCode[0].coding[0].code == "8517006" assert inst.outcomeCode[0].coding[0].display == "Ex-smoker (finding)" assert ( inst.outcomeCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.outcomeCode[0].text == "Former smoker" assert ( inst.startDate == ExternalValidatorModel.model_validate({"valueDate": "2015-04-05"}).valueDate ) assert inst.subject.display == "Peter James Chalmers" assert inst.subject.reference == "Patient/example" assert inst.text.status == "additional" def test_goal_2(base_settings): """No. 2 tests collection for Goal. Test File: goal-example-stop-smoking.json """ filename = base_settings["unittest_data_dir"] / "goal-example-stop-smoking.json" inst = goal.Goal.model_validate_json(filename.read_bytes()) assert "Goal" == inst.get_resource_type() impl_goal_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Goal" == data["resourceType"] inst2 = goal.Goal(**data) impl_goal_2(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_graphdefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/GraphDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import graphdefinition from .conftest import ExternalValidatorModel # noqa: F401 def impl_graphdefinition_1(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-04"} ).valueDateTime ) assert inst.description == ( "Specify to include list references when generating a " "document using the $document operation" ) assert inst.experimental is True assert inst.id == "example" assert inst.link[0].description == "Link to List" assert inst.link[0].path == "Composition.section.entry" assert inst.link[0].target[0].compartment[0].code == "Patient" assert inst.link[0].target[0].compartment[0].rule == "identical" assert inst.link[0].target[0].compartment[0].use == "requirement" assert inst.link[0].target[0].link[0].description == "Include any list entries" assert inst.link[0].target[0].link[0].path == "List.entry.item" assert inst.link[0].target[0].link[0].target[0].compartment[0].code == "Patient" assert inst.link[0].target[0].link[0].target[0].compartment[0].rule == "identical" assert inst.link[0].target[0].link[0].target[0].compartment[0].use == "requirement" assert inst.link[0].target[0].link[0].target[0].type == "Resource" assert inst.link[0].target[0].type == "List" assert inst.name == "Document Generation Template" assert inst.publisher == "FHIR Project" assert inst.start == "Composition" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://h7.org/fhir/GraphDefinition/example"} ).valueUri ) def test_graphdefinition_1(base_settings): """No. 1 tests collection for GraphDefinition. Test File: graphdefinition-example.json """ filename = base_settings["unittest_data_dir"] / "graphdefinition-example.json" inst = graphdefinition.GraphDefinition.model_validate_json(filename.read_bytes()) assert "GraphDefinition" == inst.get_resource_type() impl_graphdefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "GraphDefinition" == data["resourceType"] inst2 = graphdefinition.GraphDefinition(**data) impl_graphdefinition_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_group.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Group Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import group from .conftest import ExternalValidatorModel # noqa: F401 def impl_group_1(inst): assert inst.actual is True assert inst.characteristic[0].code.text == "gender" assert inst.characteristic[0].exclude is False assert inst.characteristic[0].valueCodeableConcept.text == "mixed" assert inst.characteristic[1].code.text == "owner" assert inst.characteristic[1].exclude is False assert inst.characteristic[1].valueCodeableConcept.text == "John Smith" assert inst.code.text == "Horse" assert inst.id == "101" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://someveterinarianclinic.org/fhir/NamingSystem/herds"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "John's herd" assert inst.quantity == 25 assert inst.text.status == "additional" assert inst.type == "animal" def test_group_1(base_settings): """No. 1 tests collection for Group. Test File: group-example.json """ filename = base_settings["unittest_data_dir"] / "group-example.json" inst = group.Group.model_validate_json(filename.read_bytes()) assert "Group" == inst.get_resource_type() impl_group_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Group" == data["resourceType"] inst2 = group.Group(**data) impl_group_1(inst2) def impl_group_2(inst): assert inst.actual is True assert inst.id == "102" assert inst.member[0].entity.reference == "Patient/pat1" assert ( inst.member[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-10-08"} ).valueDateTime ) assert inst.member[1].entity.reference == "Patient/pat2" assert inst.member[1].inactive is True assert ( inst.member[1].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-04-02"} ).valueDateTime ) assert inst.member[2].entity.reference == "Patient/pat3" assert ( inst.member[2].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-06"} ).valueDateTime ) assert inst.member[3].entity.reference == "Patient/pat4" assert ( inst.member[3].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-06"} ).valueDateTime ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "additional" assert inst.type == "person" def test_group_2(base_settings): """No. 2 tests collection for Group. Test File: group-example-member.json """ filename = base_settings["unittest_data_dir"] / "group-example-member.json" inst = group.Group.model_validate_json(filename.read_bytes()) assert "Group" == inst.get_resource_type() impl_group_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Group" == data["resourceType"] inst2 = group.Group(**data) impl_group_2(inst2) def impl_group_3(inst): assert inst.actual is True assert inst.characteristic[0].code.coding[0].code == "attributed-to" assert ( inst.characteristic[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org"} ).valueUri ) assert inst.characteristic[0].code.text == "Patients primarily attributed to" assert inst.characteristic[0].exclude is False assert inst.characteristic[0].valueReference.reference == "Practitioner/123" assert inst.id == "example-patientlist" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "additional" assert inst.type == "person" def test_group_3(base_settings): """No. 3 tests collection for Group. Test File: group-example-patientlist.json """ filename = base_settings["unittest_data_dir"] / "group-example-patientlist.json" inst = group.Group.model_validate_json(filename.read_bytes()) assert "Group" == inst.get_resource_type() impl_group_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Group" == data["resourceType"] inst2 = group.Group(**data) impl_group_3(inst2) def impl_group_4(inst): assert inst.active is True assert inst.actual is True assert inst.characteristic[0].code.text == "gender" assert inst.characteristic[0].exclude is False assert inst.characteristic[0].valueCodeableConcept.text == "female" assert inst.code.coding[0].code == "388393002" assert inst.code.coding[0].display == "Genus Sus (organism)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.coding[1].code == "POR" assert inst.code.coding[1].display == "porcine" assert ( inst.code.coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.aphis.usda.gov"} ).valueUri ) assert inst.code.text == "Porcine" assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/StructureDefinition/owner"} ).valueUri ) assert inst.extension[0].valueReference.display == "Peter Chalmers" assert inst.extension[0].valueReference.reference == "RelatedPerson/peter" assert inst.id == "herd1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://vetmed.iastate.edu/vdl"} ).valueUri ) assert inst.identifier[0].value == "20171120-1234" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Breeding herd" assert inst.quantity == 2500 assert inst.text.status == "generated" assert inst.type == "animal" def test_group_4(base_settings): """No. 4 tests collection for Group. Test File: group-example-herd1.json """ filename = base_settings["unittest_data_dir"] / "group-example-herd1.json" inst = group.Group.model_validate_json(filename.read_bytes()) assert "Group" == inst.get_resource_type() impl_group_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Group" == data["resourceType"] inst2 = group.Group(**data) impl_group_4(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_guidanceresponse.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/GuidanceResponse Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import guidanceresponse from .conftest import ExternalValidatorModel # noqa: F401 def impl_guidanceresponse_1(inst): assert inst.contained[0].id == "outputParameters1" assert inst.encounter.reference == "Encounter/example" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org"} ).valueUri ) assert inst.identifier[0].value == "guidanceResponse1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.moduleUri == ExternalValidatorModel.model_validate( { "valueUri": "http://someguidelineprovider.org/radiology-appropriateness-guidelines.html" } ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-10T16:02:00Z"} ).valueDateTime ) assert inst.outputParameters.reference == "#outputParameters1" assert inst.performer.reference == "Device/software" assert inst.reasonCode[0].text == "Guideline Appropriate Ordering Assessment" assert ( inst.requestIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org"} ).valueUri ) assert inst.requestIdentifier.value == "guidanceRequest1" assert inst.status == "success" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_guidanceresponse_1(base_settings): """No. 1 tests collection for GuidanceResponse. Test File: guidanceresponse-example.json """ filename = base_settings["unittest_data_dir"] / "guidanceresponse-example.json" inst = guidanceresponse.GuidanceResponse.model_validate_json(filename.read_bytes()) assert "GuidanceResponse" == inst.get_resource_type() impl_guidanceresponse_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "GuidanceResponse" == data["resourceType"] inst2 = guidanceresponse.GuidanceResponse(**data) impl_guidanceresponse_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_healthcareservice.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/HealthcareService Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import healthcareservice from .conftest import ExternalValidatorModel # noqa: F401 def impl_healthcareservice_1(inst): assert inst.active is True assert inst.appointmentRequired is False assert ( inst.availabilityExceptions == "Reduced capacity is available during the Christmas period" ) assert inst.availableTime[0].allDay is True assert inst.availableTime[0].daysOfWeek[0] == "wed" assert ( inst.availableTime[1].availableEndTime == ExternalValidatorModel.model_validate({"valueTime": "05:30:00"}).valueTime ) assert ( inst.availableTime[1].availableStartTime == ExternalValidatorModel.model_validate({"valueTime": "08:30:00"}).valueTime ) assert inst.availableTime[1].daysOfWeek[0] == "mon" assert inst.availableTime[1].daysOfWeek[1] == "tue" assert inst.availableTime[1].daysOfWeek[2] == "thu" assert inst.availableTime[1].daysOfWeek[3] == "fri" assert ( inst.availableTime[2].availableEndTime == ExternalValidatorModel.model_validate({"valueTime": "04:30:00"}).valueTime ) assert ( inst.availableTime[2].availableStartTime == ExternalValidatorModel.model_validate({"valueTime": "09:30:00"}).valueTime ) assert inst.availableTime[2].daysOfWeek[0] == "sat" assert inst.availableTime[2].daysOfWeek[1] == "fri" assert inst.category[0].coding[0].code == "8" assert inst.category[0].coding[0].display == "Counselling" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/service-category"} ).valueUri ) assert inst.category[0].text == "Counselling" assert inst.characteristic[0].coding[0].display == "Wheelchair access" assert inst.comment == ( "Providing Specialist psychology services to the greater Den " "Burg area, many years of experience dealing with PTSD issues" ) assert inst.contained[0].id == "DenBurg" assert inst.coverageArea[0].display == "Greater Denburg area" assert inst.coverageArea[0].reference == "#DenBurg" assert inst.eligibility[0].code.coding[0].display == "DVA Required" assert inst.eligibility[0].comment == ( "Evidence of application for DVA status may be sufficient for" " commencing assessment" ) assert inst.endpoint[0].reference == "Endpoint/example" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/shared-ids"} ).valueUri ) assert inst.identifier[0].value == "HS-12" assert inst.location[0].reference == "Location/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Consulting psychologists and/or psychology services" assert inst.notAvailable[0].description == "Christmas/Boxing Day" assert ( inst.notAvailable[0].during.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-12-26"} ).valueDateTime ) assert ( inst.notAvailable[0].during.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-12-25"} ).valueDateTime ) assert inst.notAvailable[1].description == "New Years Day" assert ( inst.notAvailable[1].during.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-01"} ).valueDateTime ) assert ( inst.notAvailable[1].during.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-01"} ).valueDateTime ) assert inst.program[0].text == "PTSD outreach" assert inst.providedBy.display == "Burgers University Medical Center" assert inst.providedBy.reference == "Organization/f001" assert inst.referralMethod[0].coding[0].code == "phone" assert inst.referralMethod[0].coding[0].display == "Phone" assert inst.referralMethod[1].coding[0].code == "fax" assert inst.referralMethod[1].coding[0].display == "Fax" assert inst.referralMethod[2].coding[0].code == "elec" assert inst.referralMethod[2].coding[0].display == "Secure Messaging" assert inst.referralMethod[3].coding[0].code == "semail" assert inst.referralMethod[3].coding[0].display == "Secure Email" assert inst.serviceProvisionCode[0].coding[0].code == "cost" assert inst.serviceProvisionCode[0].coding[0].display == "Fees apply" assert ( inst.serviceProvisionCode[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/service-provision-conditions" } ).valueUri ) assert inst.specialty[0].coding[0].code == "47505003" assert inst.specialty[0].coding[0].display == "Posttraumatic stress disorder" assert ( inst.specialty[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "(555) silent" assert inst.telecom[1].system == "email" assert inst.telecom[1].use == "work" assert inst.telecom[1].value == "directaddress@example.com" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "394913002" assert inst.type[0].coding[0].display == "Psychotherapy" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.type[1].coding[0].code == "394587001" assert inst.type[1].coding[0].display == "Psychiatry" assert ( inst.type[1].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_healthcareservice_1(base_settings): """No. 1 tests collection for HealthcareService. Test File: healthcareservice-example.json """ filename = base_settings["unittest_data_dir"] / "healthcareservice-example.json" inst = healthcareservice.HealthcareService.model_validate_json( filename.read_bytes() ) assert "HealthcareService" == inst.get_resource_type() impl_healthcareservice_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "HealthcareService" == data["resourceType"] inst2 = healthcareservice.HealthcareService(**data) impl_healthcareservice_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_imagingstudy.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ImagingStudy Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import imagingstudy from .conftest import ExternalValidatorModel # noqa: F401 def impl_imagingstudy_1(inst): assert inst.basedOn[0].reference == "ServiceRequest/example" assert inst.encounter.reference == "Encounter/example" assert inst.endpoint[0].reference == "Endpoint/example-wadors" assert inst.id == "example-xr" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate({"valueUri": "urn:dicom:uid"}).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == ( "urn:oid:2.16.124.113543.6003.1154777499.30246.19789.35034300" "46" ) assert inst.identifier[1].assigner.reference == "Organization/dicom-organization" assert inst.identifier[1].type.coding[0].code == "ACSN" assert ( inst.identifier[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[1].use == "usual" assert inst.identifier[1].value == "W12342398" assert inst.identifier[2].assigner.reference == "Organization/dicom-organization" assert inst.identifier[2].use == "secondary" assert inst.identifier[2].value == "55551234" assert inst.interpreter[0].reference == "Practitioner/example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.modality[0].code == "DX" assert ( inst.modality[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.note[0].text == "XR Wrist 3+ Views" assert inst.numberOfInstances == 2 assert inst.numberOfSeries == 1 assert inst.procedureCode[0].coding[0].code == "RPID2589" assert inst.procedureCode[0].coding[0].display == "XR Wrist 3+ Views" assert ( inst.procedureCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.radlex.org"} ).valueUri ) assert inst.procedureCode[0].text == "XR Wrist 3+ Views" assert inst.procedureReference.reference == "Procedure/example" assert inst.reasonCode[0].coding[0].code == "357009" assert ( inst.reasonCode[0].coding[0].display == "Closed fracture of trapezoidal bone of wrist" ) assert ( inst.reasonCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.referrer.reference == "Practitioner/example" assert inst.series[0].bodySite.code == "T-15460" assert inst.series[0].bodySite.display == "Wrist Joint" assert ( inst.series[0].bodySite.system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.series[0].description == "XR Wrist 3+ Views" assert inst.series[0].endpoint[0].reference == "Endpoint/example-wadors" assert inst.series[0].instance[0].number == 1 assert ( inst.series[0].instance[0].sopClass.code == "urn:oid:1.2.840.10008.5.1.4.1.1.2" ) assert ( inst.series[0].instance[0].sopClass.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.series[0].instance[0].title == "PA VIEW" assert ( inst.series[0].instance[0].uid == "2.16.124.113543.6003.1154777499.30246.19789.3503430045.1.1" ) assert inst.series[0].instance[1].number == 2 assert ( inst.series[0].instance[1].sopClass.code == "urn:oid:1.2.840.10008.5.1.4.1.1.2" ) assert ( inst.series[0].instance[1].sopClass.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.series[0].instance[1].title == "LL VIEW" assert ( inst.series[0].instance[1].uid == "2.16.124.113543.6003.1154777499.30246.19789.3503430045.1.2" ) assert inst.series[0].laterality.code == "419161000" assert inst.series[0].laterality.display == "Unilateral left" assert ( inst.series[0].laterality.system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.series[0].modality.code == "DX" assert ( inst.series[0].modality.system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.series[0].number == 3 assert inst.series[0].numberOfInstances == 2 assert inst.series[0].performer[0].actor.reference == "Practitioner/example" assert inst.series[0].performer[0].function.coding[0].code == "PRF" assert ( inst.series[0].performer[0].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert ( inst.series[0].started == ExternalValidatorModel.model_validate( {"valueDateTime": "2011-01-01T11:01:20+03:00"} ).valueDateTime ) assert ( inst.series[0].uid == "2.16.124.113543.6003.1154777499.30246.19789.3503430045.1" ) assert ( inst.started == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-01T11:01:20+03:00"} ).valueDateTime ) assert inst.status == "available" assert inst.subject.reference == "Patient/dicom" assert inst.text.div == ( '
XR Wrist 3+ ' "Views. John Smith (MRN: 09236). Accession: W12342398. " "Performed: 2017-01-01. 1 series, 2 images.
" ) assert inst.text.status == "generated" def test_imagingstudy_1(base_settings): """No. 1 tests collection for ImagingStudy. Test File: imagingstudy-example-xr.json """ filename = base_settings["unittest_data_dir"] / "imagingstudy-example-xr.json" inst = imagingstudy.ImagingStudy.model_validate_json(filename.read_bytes()) assert "ImagingStudy" == inst.get_resource_type() impl_imagingstudy_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ImagingStudy" == data["resourceType"] inst2 = imagingstudy.ImagingStudy(**data) impl_imagingstudy_1(inst2) def impl_imagingstudy_2(inst): assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate({"valueUri": "urn:dicom:uid"}).valueUri ) assert inst.identifier[0].value == ( "urn:oid:2.16.124.113543.6003.1154777499.30246.19789.35034300" "45" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.numberOfInstances == 1 assert inst.numberOfSeries == 1 assert inst.series[0].bodySite.code == "67734004" assert inst.series[0].bodySite.display == "Upper Trunk Structure" assert ( inst.series[0].bodySite.system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.series[0].description == "CT Surview 180" assert inst.series[0].instance[0].number == 1 assert ( inst.series[0].instance[0].sopClass.code == "urn:oid:1.2.840.10008.5.1.4.1.1.2" ) assert ( inst.series[0].instance[0].sopClass.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.series[0].instance[0].uid == "2.16.124.113543.6003.189642796.63084.16748.2599092903" ) assert inst.series[0].modality.code == "CT" assert ( inst.series[0].modality.system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.series[0].number == 3 assert inst.series[0].numberOfInstances == 1 assert ( inst.series[0].uid == "2.16.124.113543.6003.2588828330.45298.17418.2723805630" ) assert ( inst.started == ExternalValidatorModel.model_validate( {"valueDateTime": "2011-01-01T11:01:20+03:00"} ).valueDateTime ) assert inst.status == "available" assert inst.subject.reference == "Patient/dicom" assert inst.text.div == ( '
CT Chest. John ' "Smith (MRN: 09236). Accession: W12342398. Performed: " "2011-01-01. 3 series, 12 images.
" ) assert inst.text.status == "generated" def test_imagingstudy_2(base_settings): """No. 2 tests collection for ImagingStudy. Test File: imagingstudy-example.json """ filename = base_settings["unittest_data_dir"] / "imagingstudy-example.json" inst = imagingstudy.ImagingStudy.model_validate_json(filename.read_bytes()) assert "ImagingStudy" == inst.get_resource_type() impl_imagingstudy_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ImagingStudy" == data["resourceType"] inst2 = imagingstudy.ImagingStudy(**data) impl_imagingstudy_2(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_immunization.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Immunization Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import immunization from .conftest import ExternalValidatorModel # noqa: F401 def impl_immunization_1(inst): assert inst.doseQuantity.code == "mg" assert ( inst.doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.doseQuantity.value) == float(5) assert inst.education[0].documentType == "253088698300010311120702" assert ( inst.education[0].presentationDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-10"} ).valueDateTime ) assert ( inst.education[0].publicationDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-07-02"} ).valueDateTime ) assert inst.encounter.reference == "Encounter/example" assert ( inst.expirationDate == ExternalValidatorModel.model_validate({"valueDate": "2015-02-15"}).valueDate ) assert inst.fundingSource.coding[0].code == "private" assert ( inst.fundingSource.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/immunization-funding-source" } ).valueUri ) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234" assert inst.isSubpotent is True assert inst.location.reference == "Location/1" assert inst.lotNumber == "AAJN11K" assert inst.manufacturer.reference == "Organization/hl7" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "Notes on adminstration of vaccine" assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-10"} ).valueDateTime ) assert inst.patient.reference == "Patient/example" assert inst.performer[0].actor.reference == "Practitioner/example" assert inst.performer[0].function.coding[0].code == "OP" assert ( inst.performer[0].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0443"} ).valueUri ) assert inst.performer[1].actor.reference == "Practitioner/example" assert inst.performer[1].function.coding[0].code == "AP" assert ( inst.performer[1].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0443"} ).valueUri ) assert inst.primarySource is True assert inst.programEligibility[0].coding[0].code == "ineligible" assert ( inst.programEligibility[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/immunization-program-eligibility" } ).valueUri ) assert inst.reasonCode[0].coding[0].code == "429060002" assert ( inst.reasonCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.route.coding[0].code == "IM" assert inst.route.coding[0].display == "Injection, intramuscular" assert ( inst.route.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration" } ).valueUri ) assert inst.site.coding[0].code == "LA" assert inst.site.coding[0].display == "left arm" assert ( inst.site.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActSite"} ).valueUri ) assert inst.status == "completed" assert inst.text.status == "generated" assert inst.vaccineCode.coding[0].code == "FLUVAX" assert ( inst.vaccineCode.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.2.36.1.2001.1005.17"} ).valueUri ) assert inst.vaccineCode.text == "Fluvax (Influenza)" def test_immunization_1(base_settings): """No. 1 tests collection for Immunization. Test File: immunization-example.json """ filename = base_settings["unittest_data_dir"] / "immunization-example.json" inst = immunization.Immunization.model_validate_json(filename.read_bytes()) assert "Immunization" == inst.get_resource_type() impl_immunization_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Immunization" == data["resourceType"] inst2 = immunization.Immunization(**data) impl_immunization_1(inst2) def impl_immunization_2(inst): assert inst.id == "historical" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234" assert inst.location.reference == "Location/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "Notes on adminstration of a historical vaccine" assert inst.occurrenceString == "January 2012" assert inst.patient.reference == "Patient/example" assert inst.primarySource is False assert inst.reportOrigin.coding[0].code == "record" assert ( inst.reportOrigin.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/immunization-origin"} ).valueUri ) assert inst.reportOrigin.text == "Written Record" assert inst.status == "completed" assert inst.text.status == "generated" assert inst.vaccineCode.coding[0].code == "GNFLU" assert ( inst.vaccineCode.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.2.36.1.2001.1005.17"} ).valueUri ) assert inst.vaccineCode.text == "Influenza" def test_immunization_2(base_settings): """No. 2 tests collection for Immunization. Test File: immunization-example-historical.json """ filename = ( base_settings["unittest_data_dir"] / "immunization-example-historical.json" ) inst = immunization.Immunization.model_validate_json(filename.read_bytes()) assert "Immunization" == inst.get_resource_type() impl_immunization_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Immunization" == data["resourceType"] inst2 = immunization.Immunization(**data) impl_immunization_2(inst2) def impl_immunization_3(inst): assert inst.doseQuantity.code == "mg" assert ( inst.doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.doseQuantity.value) == float(5) assert inst.encounter.reference == "Encounter/example" assert ( inst.expirationDate == ExternalValidatorModel.model_validate({"valueDate": "2018-12-15"}).valueDate ) assert inst.fundingSource.coding[0].code == "private" assert ( inst.fundingSource.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/immunization-funding-source" } ).valueUri ) assert inst.id == "protocol" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234" assert inst.isSubpotent is False assert inst.location.reference == "Location/1" assert inst.lotNumber == "PT123F" assert inst.manufacturer.reference == "Organization/hl7" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-06-18"} ).valueDateTime ) assert inst.patient.reference == "Patient/example" assert inst.performer[0].actor.reference == "Practitioner/example" assert inst.performer[0].function.coding[0].code == "OP" assert ( inst.performer[0].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0443"} ).valueUri ) assert inst.performer[1].actor.reference == "Practitioner/example" assert inst.performer[1].function.coding[0].code == "AP" assert ( inst.performer[1].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0443"} ).valueUri ) assert inst.primarySource is True assert inst.programEligibility[0].coding[0].code == "ineligible" assert ( inst.programEligibility[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/immunization-program-eligibility" } ).valueUri ) assert inst.protocolApplied[0].doseNumberPositiveInt == 1 assert inst.protocolApplied[0].series == "2-dose" assert inst.protocolApplied[0].targetDisease[0].coding[0].code == "40468003" assert ( inst.protocolApplied[0].targetDisease[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.protocolApplied[1].doseNumberPositiveInt == 2 assert inst.protocolApplied[1].series == "3-dose" assert inst.protocolApplied[1].targetDisease[0].coding[0].code == "66071002" assert ( inst.protocolApplied[1].targetDisease[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.route.coding[0].code == "IM" assert inst.route.coding[0].display == "Injection, intramuscular" assert ( inst.route.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration" } ).valueUri ) assert inst.site.coding[0].code == "LA" assert inst.site.coding[0].display == "left arm" assert ( inst.site.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActSite"} ).valueUri ) assert inst.status == "completed" assert inst.text.status == "generated" assert inst.vaccineCode.coding[0].code == "104" assert ( inst.vaccineCode.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/cvx"} ).valueUri ) assert inst.vaccineCode.text == "Twinrix (HepA/HepB)" def test_immunization_3(base_settings): """No. 3 tests collection for Immunization. Test File: immunization-example-protocol.json """ filename = base_settings["unittest_data_dir"] / "immunization-example-protocol.json" inst = immunization.Immunization.model_validate_json(filename.read_bytes()) assert "Immunization" == inst.get_resource_type() impl_immunization_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Immunization" == data["resourceType"] inst2 = immunization.Immunization(**data) impl_immunization_3(inst2) def impl_immunization_4(inst): assert inst.id == "notGiven" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-10"} ).valueDateTime ) assert inst.patient.reference == "Patient/example" assert inst.primarySource is True assert inst.status == "not-done" assert inst.statusReason.coding[0].code == "MEDPREC" assert inst.statusReason.coding[0].display == "medical precaution" assert ( inst.statusReason.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" assert inst.vaccineCode.coding[0].code == "01" assert inst.vaccineCode.coding[0].display == "DTP" assert ( inst.vaccineCode.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/cvx"} ).valueUri ) def test_immunization_4(base_settings): """No. 4 tests collection for Immunization. Test File: immunization-example-refused.json """ filename = base_settings["unittest_data_dir"] / "immunization-example-refused.json" inst = immunization.Immunization.model_validate_json(filename.read_bytes()) assert "Immunization" == inst.get_resource_type() impl_immunization_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Immunization" == data["resourceType"] inst2 = immunization.Immunization(**data) impl_immunization_4(inst2) def impl_immunization_5(inst): assert inst.doseQuantity.code == "ml" assert ( inst.doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.doseQuantity.value) == float(0.5) assert inst.education[0].documentType == "253088698300010311120702" assert ( inst.education[0].presentationDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-10"} ).valueDateTime ) assert ( inst.education[0].publicationDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-07-02"} ).valueDateTime ) assert inst.encounter.reference == "Encounter/example" assert ( inst.expirationDate == ExternalValidatorModel.model_validate({"valueDate": "2015-02-28"}).valueDate ) assert inst.fundingSource.coding[0].code == "private" assert ( inst.fundingSource.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/immunization-funding-source" } ).valueUri ) assert inst.id == "subpotent" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234" assert inst.isSubpotent is False assert inst.location.reference == "Location/1" assert inst.lotNumber == "AAJN11K" assert inst.manufacturer.reference == "Organization/hl7" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "Notes on adminstration of vaccine" assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.patient.reference == "Patient/example" assert inst.performer[0].actor.reference == "Practitioner/example" assert inst.performer[0].function.coding[0].code == "OP" assert ( inst.performer[0].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0443"} ).valueUri ) assert inst.performer[1].actor.reference == "Practitioner/example" assert inst.performer[1].function.coding[0].code == "AP" assert ( inst.performer[1].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0443"} ).valueUri ) assert inst.primarySource is True assert inst.programEligibility[0].coding[0].code == "ineligible" assert ( inst.programEligibility[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/immunization-program-eligibility" } ).valueUri ) assert inst.route.coding[0].code == "IM" assert inst.route.coding[0].display == "Injection, intramuscular" assert ( inst.route.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration" } ).valueUri ) assert inst.site.coding[0].code == "LT" assert inst.site.coding[0].display == "left thigh" assert ( inst.site.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActSite"} ).valueUri ) assert inst.status == "completed" assert inst.subpotentReason[0].coding[0].code == "partial" assert ( inst.subpotentReason[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/immunization-subpotent-reason" } ).valueUri ) assert inst.text.status == "generated" assert inst.vaccineCode.coding[0].code == "GNHEP" assert ( inst.vaccineCode.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.2.36.1.2001.1005.17"} ).valueUri ) assert inst.vaccineCode.text == "Hepatitis B" def test_immunization_5(base_settings): """No. 5 tests collection for Immunization. Test File: immunization-example-subpotent.json """ filename = ( base_settings["unittest_data_dir"] / "immunization-example-subpotent.json" ) inst = immunization.Immunization.model_validate_json(filename.read_bytes()) assert "Immunization" == inst.get_resource_type() impl_immunization_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Immunization" == data["resourceType"] inst2 = immunization.Immunization(**data) impl_immunization_5(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_immunizationevaluation.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ImmunizationEvaluation Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import immunizationevaluation from .conftest import ExternalValidatorModel # noqa: F401 def impl_immunizationevaluation_1(inst): assert inst.authority.reference == "Organization/hl7" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-10"} ).valueDateTime ) assert inst.doseNumberPositiveInt == 1 assert inst.doseStatus.coding[0].code == "valid" assert inst.doseStatus.coding[0].display == "Valid" assert ( inst.doseStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/immunization-evaluation-dose-status" } ).valueUri ) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234" assert inst.immunizationEvent.reference == "Immunization/example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert inst.series == "Vaccination Series 1" assert inst.seriesDosesPositiveInt == 3 assert inst.status == "completed" assert inst.targetDisease.coding[0].code == "1857005" assert ( inst.targetDisease.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.text.status == "generated" def test_immunizationevaluation_1(base_settings): """No. 1 tests collection for ImmunizationEvaluation. Test File: immunizationevaluation-example.json """ filename = ( base_settings["unittest_data_dir"] / "immunizationevaluation-example.json" ) inst = immunizationevaluation.ImmunizationEvaluation.model_validate_json( filename.read_bytes() ) assert "ImmunizationEvaluation" == inst.get_resource_type() impl_immunizationevaluation_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ImmunizationEvaluation" == data["resourceType"] inst2 = immunizationevaluation.ImmunizationEvaluation(**data) impl_immunizationevaluation_1(inst2) def impl_immunizationevaluation_2(inst): assert inst.authority.reference == "Organization/hl7" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-10"} ).valueDateTime ) assert inst.doseNumberPositiveInt == 2 assert inst.doseStatus.coding[0].code == "notvalid" assert inst.doseStatus.coding[0].display == "Not Valid" assert ( inst.doseStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/immunization-evaluation-dose-status" } ).valueUri ) assert inst.doseStatusReason[0].coding[0].code == "outsidesched" assert ( inst.doseStatusReason[0].coding[0].display == "Administered outside recommended schedule" ) assert ( inst.doseStatusReason[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/immunization-evaluation-dose-status-reason" } ).valueUri ) assert inst.id == "notValid" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234" assert inst.immunizationEvent.reference == "Immunization/example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert inst.series == "Vaccination Series 1" assert inst.seriesDosesPositiveInt == 3 assert inst.status == "completed" assert inst.targetDisease.coding[0].code == "1857005" assert ( inst.targetDisease.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.text.status == "generated" def test_immunizationevaluation_2(base_settings): """No. 2 tests collection for ImmunizationEvaluation. Test File: immunizationevaluation-example-notvalid.json """ filename = ( base_settings["unittest_data_dir"] / "immunizationevaluation-example-notvalid.json" ) inst = immunizationevaluation.ImmunizationEvaluation.model_validate_json( filename.read_bytes() ) assert "ImmunizationEvaluation" == inst.get_resource_type() impl_immunizationevaluation_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ImmunizationEvaluation" == data["resourceType"] inst2 = immunizationevaluation.ImmunizationEvaluation(**data) impl_immunizationevaluation_2(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_immunizationrecommendation.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import immunizationrecommendation from .conftest import ExternalValidatorModel # noqa: F401 def impl_immunizationrecommendation_1(inst): assert inst.authority.reference == "Organization/hl7" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-09T11:04:15.817-05:00"} ).valueDateTime ) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1235" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert inst.recommendation[0].dateCriterion[0].code.coding[0].code == "earliest" assert ( inst.recommendation[0].dateCriterion[0].code.coding[0].display == "Earliest Date" ) assert ( inst.recommendation[0].dateCriterion[0].code.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion" } ).valueUri ) assert ( inst.recommendation[0].dateCriterion[0].value == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-12-01T00:00:00-05:00"} ).valueDateTime ) assert inst.recommendation[0].dateCriterion[1].code.coding[0].code == "recommended" assert ( inst.recommendation[0].dateCriterion[1].code.coding[0].display == "Recommended" ) assert ( inst.recommendation[0].dateCriterion[1].code.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion" } ).valueUri ) assert ( inst.recommendation[0].dateCriterion[1].value == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-12-01T00:00:00-05:00"} ).valueDateTime ) assert inst.recommendation[0].dateCriterion[2].code.coding[0].code == "overdue" assert ( inst.recommendation[0].dateCriterion[2].code.coding[0].display == "Past Due Date" ) assert ( inst.recommendation[0].dateCriterion[2].code.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion" } ).valueUri ) assert ( inst.recommendation[0].dateCriterion[2].value == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-12-28T00:00:00-05:00"} ).valueDateTime ) assert inst.recommendation[0].description == "First sequence in protocol" assert inst.recommendation[0].doseNumberPositiveInt == 1 assert inst.recommendation[0].forecastStatus.text == "Not Complete" assert inst.recommendation[0].series == "Vaccination Series 1" assert inst.recommendation[0].seriesDosesPositiveInt == 3 assert ( inst.recommendation[0].supportingImmunization[0].reference == "Immunization/example" ) assert ( inst.recommendation[0].supportingPatientInformation[0].reference == "Observation/example" ) assert inst.recommendation[0].vaccineCode[0].coding[0].code == "14745005" assert ( inst.recommendation[0].vaccineCode[0].coding[0].display == "Hepatitis A vaccine" ) assert ( inst.recommendation[0].vaccineCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.text.div == ( '
Authored by ' "Joginder Madra
" ) assert inst.text.status == "generated" def test_immunizationrecommendation_1(base_settings): """No. 1 tests collection for ImmunizationRecommendation. Test File: immunizationrecommendation-example.json """ filename = ( base_settings["unittest_data_dir"] / "immunizationrecommendation-example.json" ) inst = immunizationrecommendation.ImmunizationRecommendation.model_validate_json( filename.read_bytes() ) assert "ImmunizationRecommendation" == inst.get_resource_type() impl_immunizationrecommendation_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ImmunizationRecommendation" == data["resourceType"] inst2 = immunizationrecommendation.ImmunizationRecommendation(**data) impl_immunizationrecommendation_1(inst2) def impl_immunizationrecommendation_2(inst): assert inst.authority.reference == "Organization/hl7" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-09T11:04:15.817-05:00"} ).valueDateTime ) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1235" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert inst.recommendation[0].dateCriterion[0].code.coding[0].code == "30981-5" assert ( inst.recommendation[0].dateCriterion[0].code.coding[0].display == "Earliest date to give" ) assert ( inst.recommendation[0].dateCriterion[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.recommendation[0].dateCriterion[0].value == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-12-01T00:00:00-05:00"} ).valueDateTime ) assert inst.recommendation[0].dateCriterion[1].code.coding[0].code == "recommended" assert ( inst.recommendation[0].dateCriterion[1].code.coding[0].display == "Recommended" ) assert ( inst.recommendation[0].dateCriterion[1].code.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion" } ).valueUri ) assert ( inst.recommendation[0].dateCriterion[1].value == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-12-01T00:00:00-05:00"} ).valueDateTime ) assert inst.recommendation[0].dateCriterion[2].code.coding[0].code == "overdue" assert ( inst.recommendation[0].dateCriterion[2].code.coding[0].display == "Past Due Date" ) assert ( inst.recommendation[0].dateCriterion[2].code.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion" } ).valueUri ) assert ( inst.recommendation[0].dateCriterion[2].value == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-12-28T00:00:00-05:00"} ).valueDateTime ) assert inst.recommendation[0].description == "First sequence in protocol" assert inst.recommendation[0].doseNumberPositiveInt == 1 assert inst.recommendation[0].forecastStatus.text == "Not Complete" assert inst.recommendation[0].series == "Vaccination Series 1" assert inst.recommendation[0].seriesDosesPositiveInt == 3 assert ( inst.recommendation[0].supportingImmunization[0].reference == "Immunization/example" ) assert ( inst.recommendation[0].supportingPatientInformation[0].reference == "Observation/example" ) assert inst.recommendation[0].targetDisease.coding[0].code == "40468003" assert ( inst.recommendation[0].targetDisease.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.text.div == ( '
Authored by ' "Joginder Madra
" ) assert inst.text.status == "generated" def test_immunizationrecommendation_2(base_settings): """No. 2 tests collection for ImmunizationRecommendation. Test File: immunizationrecommendation-example-target-disease.json """ filename = ( base_settings["unittest_data_dir"] / "immunizationrecommendation-example-target-disease.json" ) inst = immunizationrecommendation.ImmunizationRecommendation.model_validate_json( filename.read_bytes() ) assert "ImmunizationRecommendation" == inst.get_resource_type() impl_immunizationrecommendation_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ImmunizationRecommendation" == data["resourceType"] inst2 = immunizationrecommendation.ImmunizationRecommendation(**data) impl_immunizationrecommendation_2(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_implementationguide.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ImplementationGuide Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import implementationguide from .conftest import ExternalValidatorModel # noqa: F401 def impl_implementationguide_1(inst): assert inst.contact[0].name == "ONC" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://www.healthit.gov" assert inst.contact[1].name == "HL7" assert inst.contact[1].telecom[0].system == "url" assert inst.contact[1].telecom[0].value == "http://hl7.org/fhir" assert inst.copyright == "Published by ONC under the standard FHIR license (CC0)" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-01"} ).valueDateTime ) assert ( inst.definition.grouping[0].description == "Base package (not broken up into multiple packages)" ) assert inst.definition.grouping[0].name == "test" assert inst.definition.page.generation == "html" assert ( inst.definition.page.nameUrl == ExternalValidatorModel.model_validate( {"valueUrl": "patient-example.html"} ).valueUrl ) assert inst.definition.page.page[0].generation == "html" assert ( inst.definition.page.page[0].nameUrl == ExternalValidatorModel.model_validate({"valueUrl": "list.html"}).valueUrl ) assert inst.definition.page.page[0].title == "Value Set Page" assert inst.definition.page.title == "Example Patient Page" assert inst.definition.parameter[0].code == "apply" assert inst.definition.parameter[0].value == "version" assert ( inst.definition.resource[0].description == "A test example to show how an implementation guide works" ) assert ( inst.definition.resource[0].exampleCanonical == "http://hl7.org/fhir/us/core/StructureDefinition/patient" ) assert inst.definition.resource[0].name == "Test Example" assert inst.definition.resource[0].reference.reference == "Patient/test" assert inst.dependsOn[0].uri == "http://hl7.org/fhir/ImplementationGuide/uscore" assert inst.experimental is False assert inst.fhirVersion[0] == "4.3.0" assert ( inst.global_fhir[0].profile == "http://hl7.org/fhir/us/core/StructureDefinition/patient" ) assert inst.global_fhir[0].type == "Patient" assert inst.id == "example" assert inst.jurisdiction[0].coding[0].code == "US" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.license == "CC0-1.0" assert inst.manifest.image[0] == "fhir.png" assert inst.manifest.other[0] == "fhir.css" assert inst.manifest.page[0].anchor[0] == "patient-test" assert inst.manifest.page[0].anchor[1] == "tx" assert inst.manifest.page[0].anchor[2] == "uml" assert inst.manifest.page[0].name == "patient-test.html" assert inst.manifest.page[0].title == "Test Patient Example" assert ( inst.manifest.rendering == ExternalValidatorModel.model_validate( {"valueUrl": "http://hl7.org/fhir/us/daf"} ).valueUrl ) assert ( inst.manifest.resource[0].exampleCanonical == "http://hl7.org/fhir/us/core/StructureDefinition/patient" ) assert inst.manifest.resource[0].reference.reference == "Patient/test" assert ( inst.manifest.resource[0].relativePath == ExternalValidatorModel.model_validate( {"valueUrl": "patient-test.html#patient-test"} ).valueUrl ) assert inst.name == "Data Access Framework (DAF)" assert inst.packageId == "hl7.fhir.us.daf" assert inst.publisher == "ONC / HL7 Joint project" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/us/daf"} ).valueUri ) assert inst.version == "0" def test_implementationguide_1(base_settings): """No. 1 tests collection for ImplementationGuide. Test File: implementationguide-example.json """ filename = base_settings["unittest_data_dir"] / "implementationguide-example.json" inst = implementationguide.ImplementationGuide.model_validate_json( filename.read_bytes() ) assert "ImplementationGuide" == inst.get_resource_type() impl_implementationguide_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ImplementationGuide" == data["resourceType"] inst2 = implementationguide.ImplementationGuide(**data) impl_implementationguide_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_ingredient.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Ingredient Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import ingredient from .conftest import ExternalValidatorModel # noqa: F401 def impl_ingredient_1(inst): assert inst.id == "example" assert inst.manufacturer[0].manufacturer.reference == "Organization/example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.role.coding[0].code == "ActiveBase" assert ( inst.role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/ingredientRole"} ).valueUri ) assert inst.status == "active" assert inst.substance.code.concept.coding[0].code == "EQUIXABAN" assert ( inst.substance.code.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/substance"} ).valueUri ) assert inst.substance.strength[0].presentationRatio.denominator.code == "{tablet}" assert ( inst.substance.strength[0].presentationRatio.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.substance.strength[0].presentationRatio.denominator.unit == "tablet" assert float( inst.substance.strength[0].presentationRatio.denominator.value ) == float(1) assert inst.substance.strength[0].presentationRatio.numerator.code == "mg" assert ( inst.substance.strength[0].presentationRatio.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.substance.strength[0].presentationRatio.numerator.unit == "mg" assert float(inst.substance.strength[0].presentationRatio.numerator.value) == float( 2.5 ) assert inst.text.status == "generated" def test_ingredient_1(base_settings): """No. 1 tests collection for Ingredient. Test File: ingredient-example.json """ filename = base_settings["unittest_data_dir"] / "ingredient-example.json" inst = ingredient.Ingredient.model_validate_json(filename.read_bytes()) assert "Ingredient" == inst.get_resource_type() impl_ingredient_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Ingredient" == data["resourceType"] inst2 = ingredient.Ingredient(**data) impl_ingredient_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_insuranceplan.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/InsurancePlan Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import insuranceplan from .conftest import ExternalValidatorModel # noqa: F401 def impl_insuranceplan_1(inst): assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "foo" assert inst.text.status == "generated" def test_insuranceplan_1(base_settings): """No. 1 tests collection for InsurancePlan. Test File: insuranceplan-example.json """ filename = base_settings["unittest_data_dir"] / "insuranceplan-example.json" inst = insuranceplan.InsurancePlan.model_validate_json(filename.read_bytes()) assert "InsurancePlan" == inst.get_resource_type() impl_insuranceplan_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "InsurancePlan" == data["resourceType"] inst2 = insuranceplan.InsurancePlan(**data) impl_insuranceplan_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_invoice.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Invoice Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import invoice from .conftest import ExternalValidatorModel # noqa: F401 def impl_invoice_1(inst): assert inst.account.reference == "Account/example" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-25T08:00:00+01:00"} ).valueDateTime ) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://myHospital.org/Invoices"} ).valueUri ) assert inst.identifier[0].value == "654321" assert ( inst.issuer.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://myhospital/NamingSystem/departments"} ).valueUri ) assert inst.issuer.identifier.value == "CARD_INTERMEDIATE_CARE" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].actor.reference == "Practitioner/example" assert inst.participant[0].role.coding[0].code == "17561000" assert inst.participant[0].role.coding[0].display == "Cardiologist" assert ( inst.participant[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.status == "issued" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Example of ' "Invoice
" ) assert inst.text.status == "generated" assert inst.totalGross.currency == "EUR" assert float(inst.totalGross.value) == float(48) assert inst.totalNet.currency == "EUR" assert float(inst.totalNet.value) == float(40) def test_invoice_1(base_settings): """No. 1 tests collection for Invoice. Test File: invoice-example.json """ filename = base_settings["unittest_data_dir"] / "invoice-example.json" inst = invoice.Invoice.model_validate_json(filename.read_bytes()) assert "Invoice" == inst.get_resource_type() impl_invoice_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Invoice" == data["resourceType"] inst2 = invoice.Invoice(**data) impl_invoice_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_library.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Library Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import library from .conftest import ExternalValidatorModel # noqa: F401 def impl_library_1(inst): assert inst.author[0].name == "Kensaku Kawamoto, MD, PhD, MHS" assert inst.author[1].name == "Bryn Rhodes" assert inst.author[2].name == "Floyd Eisenberg, MD, MPH" assert inst.author[3].name == "Robert McClure, MD, MPH" assert inst.content[0].contentType == "application/xml" assert ( inst.content[0].url == ExternalValidatorModel.model_validate( {"valueUrl": "elm/OMTK-modelinfo-0.1.0.xml"} ).valueUrl ) assert inst.copyright == "© CDC 2016+." assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-05-05"} ).valueDateTime ) assert inst.description == ( "Opioid Management Terminology Knowledge Base Model " "Definition for use in implementing CDC Opioid Prescribing " "Guidelines." ) assert inst.experimental is True assert inst.id == "omtk-modelinfo" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "OMTKModelInfo" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.publisher == "Centers for Disease Control and Prevention (CDC)" assert inst.purpose == ( "This library defines the Opioid Management Terminology " "Knowledge Base model" ) assert inst.status == "active" assert inst.title == "OMTK Model Info" assert inst.topic[0].text == "Opioid Prescribing" assert inst.type.coding[0].code == "model-definition" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/library-type"} ).valueUri ) assert inst.usage == ( "This library is used to resolve data elements in the Opioid " "Management Terminology Knowledge Base model" ) assert inst.useContext[0].code.code == "focus" assert inst.useContext[0].code.display == "Clinical Focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "182888003" assert ( inst.useContext[0].valueCodeableConcept.coding[0].display == "Medication requested (situation)" ) assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[1].code.code == "focus" assert inst.useContext[1].code.display == "Clinical Focus" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueCodeableConcept.coding[0].code == "82423001" assert ( inst.useContext[1].valueCodeableConcept.coding[0].display == "Chronic pain (finding)" ) assert ( inst.useContext[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version == "0.1.0" def test_library_1(base_settings): """No. 1 tests collection for Library. Test File: library-omtk-modelinfo.json """ filename = base_settings["unittest_data_dir"] / "library-omtk-modelinfo.json" inst = library.Library.model_validate_json(filename.read_bytes()) assert "Library" == inst.get_resource_type() impl_library_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Library" == data["resourceType"] inst2 = library.Library(**data) impl_library_1(inst2) def impl_library_2(inst): assert inst.content[0].contentType == "text/cql" assert ( inst.content[0].url == ExternalValidatorModel.model_validate( {"valueUrl": "library-hiv-indicators-content.cql"} ).valueUrl ) assert inst.content[1].contentType == "application/elm+xml" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-08-03"} ).valueDateTime ) assert inst.description == "HIV Indicators Reporting Example" assert inst.experimental is True assert inst.id == "hiv-indicators" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ohie.org/Library/"} ).valueUri ) assert inst.identifier[0].value == "hiv-indicators" assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://wiki.ihe.net/index.php/Aggregate_Data_Exchange_-_HIV"} ).valueUrl ) assert inst.relatedArtifact[0].type == "derived-from" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( {"valueUrl": "http://wiki.ihe.net/index.php/Aggregate_Data_Exchange_-_HIV"} ).valueUrl ) assert inst.status == "draft" assert inst.title == "HIV Indicators" assert inst.type.coding[0].code == "logic-library" assert inst.type.coding[0].display == "Logic Library" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/library-type"} ).valueUri ) assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://ohie.org/Library/hiv-indicators"} ).valueUri ) assert inst.version == "0.0.0" def test_library_2(base_settings): """No. 2 tests collection for Library. Test File: library-hiv-indicators.json """ filename = base_settings["unittest_data_dir"] / "library-hiv-indicators.json" inst = library.Library.model_validate_json(filename.read_bytes()) assert "Library" == inst.get_resource_type() impl_library_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Library" == data["resourceType"] inst2 = library.Library(**data) impl_library_2(inst2) def impl_library_3(inst): assert inst.content[0].contentType == "application/xml" assert ( inst.content[0].url == ExternalValidatorModel.model_validate( {"valueUrl": "http://cqlrepository.org/quick-modelinfo.xml"} ).valueUrl ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-07-08"} ).valueDateTime ) assert inst.description == "Model definition for the QUICK Logical Model" assert inst.experimental is True assert inst.id == "library-quick-model-definition" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "QUICK" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "QUICK Model Definition" assert inst.topic[0].text == "QUICK" assert inst.type.coding[0].code == "model-definition" assert inst.version == "1.0.0" def test_library_3(base_settings): """No. 3 tests collection for Library. Test File: library-quick-model-definition.json """ filename = ( base_settings["unittest_data_dir"] / "library-quick-model-definition.json" ) inst = library.Library.model_validate_json(filename.read_bytes()) assert "Library" == inst.get_resource_type() impl_library_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Library" == data["resourceType"] inst2 = library.Library(**data) impl_library_3(inst2) def impl_library_4(inst): assert inst.author[0].name == "Kensaku Kawamoto, MD, PhD, MHS" assert inst.author[1].name == "Bryn Rhodes" assert inst.author[2].name == "Floyd Eisenberg, MD, MPH" assert inst.author[3].name == "Robert McClure, MD, MPH" assert inst.content[0].contentType == "application/elm+xml" assert inst.copyright == "© CDC 2016+." assert inst.dataRequirement[0].codeFilter[0].path == "medicationCodeableConcept" assert ( inst.dataRequirement[0].codeFilter[0].valueSet == "http://example.org/fhir/ValueSet/benzodiazepines" ) assert inst.dataRequirement[0].type == "MedicationRequest" assert inst.dataRequirement[1].codeFilter[0].path == "medicationCodeableConcept" assert inst.dataRequirement[1].codeFilter[0].valueSet == ( "http://example.org/fhir/ValueSet/opioids-abused-in-" "ambulatory-care" ) assert inst.dataRequirement[1].type == "MedicationRequest" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-03-25T13:49:09-06:00"} ).valueDateTime ) assert inst.description == ( "Opioid decision support logic to avoid prescribing opioid " "pain medication and benzodiazepines concurrently whenever " "possible." ) assert inst.experimental is False assert inst.id == "opioidcds-recommendation-11" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "OpioidCDS_REC_11" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.publisher == "Centers for Disease Control and Prevention (CDC)" assert inst.purpose == ( "The purpose of this library is to determine whether opioid " "pain medication and benzodiazepines have been prescribed " "concurrently." ) assert ( inst.relatedArtifact[0].display == "CDC guideline for prescribing opioids for chronic pain" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420" } ).valueUrl ) assert inst.relatedArtifact[0].type == "documentation" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( { "valueUrl": "https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420" } ).valueUrl ) assert ( inst.relatedArtifact[1].resource == "http://example.org/fhir/Library/opioidcds-common" ) assert inst.relatedArtifact[1].type == "depends-on" assert inst.status == "active" assert inst.title == "Opioid CDS Logic for recommendation #11" assert inst.topic[0].text == "Opioid Prescribing" assert inst.type.coding[0].code == "logic-library" assert inst.type.coding[0].display == "Logic Library" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/library-type"} ).valueUri ) assert inst.usage == ( "This library is used to notify the prescriber/user to avoid " "prescribing opioid pain medication and benzodiazepines " "concurrently." ) assert inst.useContext[0].code.code == "focus" assert inst.useContext[0].code.display == "Clinical Focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "182888003" assert ( inst.useContext[0].valueCodeableConcept.coding[0].display == "Medication requested (situation)" ) assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[1].code.code == "focus" assert inst.useContext[1].code.display == "Clinical Focus" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueCodeableConcept.coding[0].code == "82423001" assert ( inst.useContext[1].valueCodeableConcept.coding[0].display == "Chronic pain (finding)" ) assert ( inst.useContext[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version == "0.1.0" def test_library_4(base_settings): """No. 4 tests collection for Library. Test File: library-opioidcds-recommendation-11.json """ filename = ( base_settings["unittest_data_dir"] / "library-opioidcds-recommendation-11.json" ) inst = library.Library.model_validate_json(filename.read_bytes()) assert "Library" == inst.get_resource_type() impl_library_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Library" == data["resourceType"] inst2 = library.Library(**data) impl_library_4(inst2) def impl_library_5(inst): assert inst.author[0].name == "Kensaku Kawamoto, MD, PhD, MHS" assert inst.author[1].name == "Bryn Rhodes" assert inst.author[2].name == "Floyd Eisenberg, MD, MPH" assert inst.author[3].name == "Robert McClure, MD, MPH" assert inst.content[0].contentType == "application/elm+xml" assert inst.copyright == "© CDC 2016+." assert inst.dataRequirement[0].codeFilter[0].path == "medicationCodeableConcept" assert inst.dataRequirement[0].codeFilter[0].valueSet == ( "http://example.org/fhir/ValueSet/opioids-indicating-end-of-" "life" ) assert inst.dataRequirement[0].type == "MedicationRequest" assert inst.dataRequirement[1].codeFilter[0].path == "code" assert inst.dataRequirement[1].type == "Procedure" assert inst.dataRequirement[2].codeFilter[0].path == "code" assert inst.dataRequirement[2].type == "Procedure" assert inst.dataRequirement[3].codeFilter[0].path == "medicationCodeableConcept" assert inst.dataRequirement[3].codeFilter[0].valueSet == ( "http://example.org/fhir/ValueSet/opioids-abused-in-" "ambulatory-care" ) assert inst.dataRequirement[3].type == "MedicationRequest" assert inst.dataRequirement[4].type == "Encounter" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-03-25T13:49:09-06:00"} ).valueDateTime ) assert inst.experimental is False assert inst.id == "opioidcds-recommendation-07" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "OpioidCDS_REC_07" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.publisher == "Centers for Disease Control and Prevention (CDC)" assert inst.purpose == ( "The purpose of this library is to determine whether the " "patient has been evaluated for benefits and harms within 1 " "to 4 weeks of starting opioid therapy and every 3 months or " "more subsequently." ) assert ( inst.relatedArtifact[0].display == "CDC guideline for prescribing opioids for chronic pain" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420" } ).valueUrl ) assert inst.relatedArtifact[0].type == "documentation" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( { "valueUrl": "https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420" } ).valueUrl ) assert ( inst.relatedArtifact[1].resource == "http://example.org/fhir/Library/opioidcds-common" ) assert inst.relatedArtifact[1].type == "depends-on" assert inst.status == "active" assert inst.title == "Opioid CDS Logic for recommendation #7" assert inst.topic[0].text == "Opioid Prescribing" assert inst.type.coding[0].code == "logic-library" assert inst.type.coding[0].display == "Logic Library" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/library-type"} ).valueUri ) assert inst.usage == ( "This library is used to notify the prescriber/user whether " "an evaluation for benefits and harms associated with opioid " "therapy is recommended for the patient." ) assert inst.useContext[0].code.code == "focus" assert inst.useContext[0].code.display == "Clinical Focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "182888003" assert ( inst.useContext[0].valueCodeableConcept.coding[0].display == "Medication requested (situation)" ) assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[1].code.code == "focus" assert inst.useContext[1].code.display == "Clinical Focus" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueCodeableConcept.coding[0].code == "82423001" assert ( inst.useContext[1].valueCodeableConcept.coding[0].display == "Chronic pain (finding)" ) assert ( inst.useContext[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version == "0.1.0" def test_library_5(base_settings): """No. 5 tests collection for Library. Test File: library-opioidcds-recommendation-07.json """ filename = ( base_settings["unittest_data_dir"] / "library-opioidcds-recommendation-07.json" ) inst = library.Library.model_validate_json(filename.read_bytes()) assert "Library" == inst.get_resource_type() impl_library_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Library" == data["resourceType"] inst2 = library.Library(**data) impl_library_5(inst2) def impl_library_6(inst): assert ( inst.approvalDate == ExternalValidatorModel.model_validate({"valueDate": "2021-03-02"}).valueDate ) assert inst.content[0].contentType == "application/xml" assert ( inst.content[0].url == ExternalValidatorModel.model_validate( {"valueUrl": "http://cqlrepository.org/fhirmodel-modelinfo.xml"} ).valueUrl ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-07-08"} ).valueDateTime ) assert inst.description == "Model definition for the FHIR Model" assert inst.experimental is False assert inst.id == "FHIR-ModelInfo" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "FHIR" assert ( inst.lastReviewDate == ExternalValidatorModel.model_validate({"valueDate": "2021-03-02"}).valueDate ) assert inst.name == "FHIR" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "FHIR Model Definition" assert inst.topic[0].text == "FHIR" assert inst.type.coding[0].code == "model-definition" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/Library/FHIR-ModelInfo"} ).valueUri ) assert inst.version == "4.3.0" def test_library_6(base_settings): """No. 6 tests collection for Library. Test File: library-fhir-model-definition.json """ filename = base_settings["unittest_data_dir"] / "library-fhir-model-definition.json" inst = library.Library.model_validate_json(filename.read_bytes()) assert "Library" == inst.get_resource_type() impl_library_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Library" == data["resourceType"] inst2 = library.Library(**data) impl_library_6(inst2) def impl_library_7(inst): assert inst.content[0].contentType == "text/cql" assert inst.content[0].title == "FHIR Helpers" assert ( inst.content[0].url == ExternalValidatorModel.model_validate( {"valueUrl": "library-fhir-helpers-content.cql"} ).valueUrl ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-11-14"} ).valueDateTime ) assert inst.description == "FHIR Helpers" assert inst.experimental is True assert inst.id == "library-fhir-helpers-predecessor" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "FHIRHelpers" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.relatedArtifact[0].resource == "http://example.org/fhir/Library/fhir-model-definition" ) assert inst.relatedArtifact[0].type == "depends-on" assert ( inst.relatedArtifact[1].resource == "http://example.org/fhir/Library/library-fhir-helpers" ) assert inst.relatedArtifact[1].type == "successor" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "FHIR Helpers" assert inst.topic[0].text == "FHIR Helpers" assert inst.type.coding[0].code == "logic-library" assert inst.version == "1.6" def test_library_7(base_settings): """No. 7 tests collection for Library. Test File: library-predecessor-example.json """ filename = base_settings["unittest_data_dir"] / "library-predecessor-example.json" inst = library.Library.model_validate_json(filename.read_bytes()) assert "Library" == inst.get_resource_type() impl_library_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Library" == data["resourceType"] inst2 = library.Library(**data) impl_library_7(inst2) def impl_library_8(inst): assert inst.author[0].name == "Kensaku Kawamoto, MD, PhD, MHS" assert inst.author[1].name == "Bryn Rhodes" assert inst.author[2].name == "Floyd Eisenberg, MD, MPH" assert inst.author[3].name == "Robert McClure, MD, MPH" assert inst.content[0].contentType == "application/elm+xml" assert inst.copyright == "© CDC 2016+." assert inst.dataRequirement[0].codeFilter[0].path == "medicationCodeableConcept" assert inst.dataRequirement[0].codeFilter[0].valueSet == ( "http://example.org/fhir/ValueSet/opioids-indicating-end-of-" "life" ) assert inst.dataRequirement[0].type == "MedicationRequest" assert inst.dataRequirement[1].codeFilter[0].path == "medicationCodeableConcept" assert inst.dataRequirement[1].codeFilter[0].valueSet == ( "http://example.org/fhir/ValueSet/opioids-abused-in-" "ambulatory-care" ) assert inst.dataRequirement[1].type == "MedicationRequest" assert inst.dataRequirement[2].codeFilter[0].path == "combo-code" assert inst.dataRequirement[2].codeFilter[0].valueSet == ( "http://example.org/fhir/ValueSet/illicit-drug-urine-" "screening" ) assert inst.dataRequirement[2].type == "Observation" assert inst.dataRequirement[3].codeFilter[0].path == "combo-code" assert ( inst.dataRequirement[3].codeFilter[0].valueSet == "http://example.org/fhir/ValueSet/opioid-urine-screening" ) assert inst.dataRequirement[3].type == "Observation" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-03-25T13:49:09-06:00"} ).valueDateTime ) assert inst.description == ( "Opioid decision support logic to evaluate whether the " "patient has had a urine screening in the past 12 months and " "provide analysis." ) assert inst.experimental is False assert inst.id == "opioidcds-recommendation-10" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "OpioidCDS_REC_10" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.publisher == "Centers for Disease Control and Prevention (CDC)" assert ( inst.relatedArtifact[0].display == "CDC guideline for prescribing opioids for chronic pain" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420" } ).valueUrl ) assert inst.relatedArtifact[0].type == "documentation" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( { "valueUrl": "https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420" } ).valueUrl ) assert ( inst.relatedArtifact[1].resource == "http://example.org/fhir/Library/opioidcds-common" ) assert inst.relatedArtifact[1].type == "depends-on" assert inst.status == "active" assert inst.title == "Opioid CDS Logic for recommendation #10" assert inst.topic[0].text == "Opioid Prescribing" assert inst.type.coding[0].code == "logic-library" assert inst.type.coding[0].display == "Logic Library" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/library-type"} ).valueUri ) assert inst.usage == ( "This library is used to notify the prescriber/user whether " "the patient has had a urine screening in the past 12 months " "and to provide analysis if true." ) assert inst.useContext[0].code.code == "focus" assert inst.useContext[0].code.display == "Clinical Focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "182888003" assert ( inst.useContext[0].valueCodeableConcept.coding[0].display == "Medication requested (situation)" ) assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[1].code.code == "focus" assert inst.useContext[1].code.display == "Clinical Focus" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueCodeableConcept.coding[0].code == "82423001" assert ( inst.useContext[1].valueCodeableConcept.coding[0].display == "Chronic pain (finding)" ) assert ( inst.useContext[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version == "0.1.0" def test_library_8(base_settings): """No. 8 tests collection for Library. Test File: library-opioidcds-recommendation-10.json """ filename = ( base_settings["unittest_data_dir"] / "library-opioidcds-recommendation-10.json" ) inst = library.Library.model_validate_json(filename.read_bytes()) assert "Library" == inst.get_resource_type() impl_library_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Library" == data["resourceType"] inst2 = library.Library(**data) impl_library_8(inst2) def impl_library_9(inst): assert inst.content[0].contentType == "text/cql" assert inst.content[1].contentType == "application/elm+xml" assert inst.dataRequirement[0].type == "Patient" assert inst.dataRequirement[1].codeFilter[0].code[0].code == "diagnosis" assert inst.dataRequirement[1].codeFilter[0].path == "category" assert inst.dataRequirement[1].codeFilter[1].code[0].code == "confirmed" assert inst.dataRequirement[1].codeFilter[1].path == "clinicalStatus" assert inst.dataRequirement[1].codeFilter[2].path == "code" assert ( inst.dataRequirement[1].codeFilter[2].valueSet == "urn:oid:2.16.840.1.113883.3.464.1003.102.12.1011" ) assert inst.dataRequirement[1].type == "Condition" assert inst.dataRequirement[2].codeFilter[0].code[0].code == "diagnosis" assert inst.dataRequirement[2].codeFilter[0].path == "category" assert inst.dataRequirement[2].codeFilter[1].code[0].code == "confirmed" assert inst.dataRequirement[2].codeFilter[1].path == "clinicalStatus" assert inst.dataRequirement[2].codeFilter[2].path == "code" assert ( inst.dataRequirement[2].codeFilter[2].valueSet == "urn:oid:2.16.840.1.113883.3.464.1003.102.12.1012" ) assert inst.dataRequirement[2].type == "Condition" assert inst.dataRequirement[3].codeFilter[0].code[0].code == "finished" assert inst.dataRequirement[3].codeFilter[0].path == "status" assert inst.dataRequirement[3].codeFilter[1].code[0].code == "ambulatory" assert inst.dataRequirement[3].codeFilter[1].path == "class" assert inst.dataRequirement[3].codeFilter[2].path == "type" assert ( inst.dataRequirement[3].codeFilter[2].valueSet == "urn:oid:2.16.840.1.113883.3.464.1003.101.12.1061" ) assert inst.dataRequirement[3].type == "Encounter" assert inst.dataRequirement[4].codeFilter[0].path == "diagnosis" assert ( inst.dataRequirement[4].codeFilter[0].valueSet == "urn:oid:2.16.840.1.113883.3.464.1003.198.12.1012" ) assert inst.dataRequirement[4].type == "DiagnosticReport" assert inst.dataRequirement[5].codeFilter[0].path == "code" assert ( inst.dataRequirement[5].codeFilter[0].valueSet == "urn:oid:2.16.840.1.113883.3.464.1003.196.12.1001" ) assert inst.dataRequirement[5].type == "Medication" assert inst.dataRequirement[6].codeFilter[0].code[0].code == "active" assert inst.dataRequirement[6].codeFilter[0].path == "status" assert inst.dataRequirement[6].codeFilter[1].path == "medication.code" assert ( inst.dataRequirement[6].codeFilter[1].valueSet == "urn:oid:2.16.840.1.113883.3.464.1003.196.12.1001" ) assert inst.dataRequirement[6].type == "MedicationRequest" assert inst.dataRequirement[7].codeFilter[0].code[0].code == "completed" assert inst.dataRequirement[7].codeFilter[0].path == "status" assert inst.dataRequirement[7].codeFilter[1].path == "medication.code" assert ( inst.dataRequirement[7].codeFilter[1].valueSet == "urn:oid:2.16.840.1.113883.3.464.1003.196.12.1001" ) assert inst.dataRequirement[7].type == "MedicationStatement" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-07-22"} ).valueDateTime ) assert inst.description == ( "Logic for CMS 146: Appropriate Testing for Children with " "Pharyngitis" ) assert inst.experimental is True assert inst.id == "library-cms146-example" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "CMS146" assert inst.name == "CMS146" assert ( inst.relatedArtifact[0].resource == "http://hl7.org/fhir/Library/library-quick-model-definition" ) assert inst.relatedArtifact[0].type == "depends-on" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "CMS146: Appropriate Testing for Children with Pharyngitis" assert inst.type.coding[0].code == "logic-library" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/Library/library-cms146-example"} ).valueUri ) assert inst.version == "2.0.0" def test_library_9(base_settings): """No. 9 tests collection for Library. Test File: library-cms146-example.json """ filename = base_settings["unittest_data_dir"] / "library-cms146-example.json" inst = library.Library.model_validate_json(filename.read_bytes()) assert "Library" == inst.get_resource_type() impl_library_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Library" == data["resourceType"] inst2 = library.Library(**data) impl_library_9(inst2) def impl_library_10(inst): assert inst.author[0].name == "Kensaku Kawamoto, MD, PhD, MHS" assert inst.author[1].name == "Bryn Rhodes" assert inst.author[2].name == "Floyd Eisenberg, MD, MPH" assert inst.author[3].name == "Robert McClure, MD, MPH" assert inst.content[0].contentType == "application/elm+xml" assert inst.copyright == "© CDC 2016+." assert inst.dataRequirement[0].codeFilter[0].code[0].code == "active" assert inst.dataRequirement[0].codeFilter[0].path == "status" assert inst.dataRequirement[0].codeFilter[1].code[0].code == "outpatient" assert ( inst.dataRequirement[0].codeFilter[1].code[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/medicationrequest-category" } ).valueUri ) assert inst.dataRequirement[0].codeFilter[1].path == "category" assert inst.dataRequirement[0].id == "medications" assert inst.dataRequirement[0].type == "MedicationRequest" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-03-25T13:49:09-06:00"} ).valueDateTime ) assert inst.description == ( "Opioid Decision Support Logic for use in implementing CDC " "Opioid Prescribing Guidelines." ) assert inst.experimental is False assert inst.id == "opioidcds-recommendation-05" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "OpioidCDS_REC_05" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.publisher == "Centers for Disease Control and Prevention (CDC)" assert inst.purpose == ( "This library works in concert with the OMTK logic library to" " provide decision support for Morphine Milligram Equivalence" " calculations and dynamic value resolution." ) assert ( inst.relatedArtifact[0].display == "CDC guideline for prescribing opioids for chronic pain" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420" } ).valueUrl ) assert inst.relatedArtifact[0].type == "documentation" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( { "valueUrl": "https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420" } ).valueUrl ) assert ( inst.relatedArtifact[1].resource == "http://example.org/fhir/Library/opioidcds-common" ) assert inst.relatedArtifact[1].type == "depends-on" assert inst.relatedArtifact[2].display == "MME Conversion Tables" assert ( inst.relatedArtifact[2].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf" } ).valueUrl ) assert inst.relatedArtifact[2].type == "documentation" assert ( inst.relatedArtifact[2].url == ExternalValidatorModel.model_validate( { "valueUrl": "https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf" } ).valueUrl ) assert inst.status == "active" assert inst.title == "Opioid CDS Logic for recommendation #5" assert inst.topic[0].text == "Opioid Prescribing" assert inst.type.coding[0].code == "logic-library" assert inst.type.coding[0].display == "Logic Library" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/library-type"} ).valueUri ) assert inst.usage == ( "This library is to notify the prescriber/user whether the " "current prescription exceeds the recommended MME." ) assert inst.useContext[0].code.code == "focus" assert inst.useContext[0].code.display == "Clinical Focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "182888003" assert ( inst.useContext[0].valueCodeableConcept.coding[0].display == "Medication requested (situation)" ) assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[1].code.code == "focus" assert inst.useContext[1].code.display == "Clinical Focus" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueCodeableConcept.coding[0].code == "82423001" assert ( inst.useContext[1].valueCodeableConcept.coding[0].display == "Chronic pain (finding)" ) assert ( inst.useContext[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version == "0.1.0" def test_library_10(base_settings): """No. 10 tests collection for Library. Test File: library-opioidcds-recommendation-05.json """ filename = ( base_settings["unittest_data_dir"] / "library-opioidcds-recommendation-05.json" ) inst = library.Library.model_validate_json(filename.read_bytes()) assert "Library" == inst.get_resource_type() impl_library_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Library" == data["resourceType"] inst2 = library.Library(**data) impl_library_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_linkage.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Linkage Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import linkage from .conftest import ExternalValidatorModel # noqa: F401 def impl_linkage_1(inst): assert inst.author.reference == "Practitioner/f201" assert inst.id == "example" assert ( inst.item[0].resource.display == "Severe burn of left ear (Date: 24-May 2012)" ) assert inst.item[0].resource.reference == "Condition/example" assert inst.item[0].type == "source" assert ( inst.item[1].resource.display == "Severe burn of left ear (Date: 24-May 2012)" ) assert inst.item[1].resource.reference == "Condition/condition-example" assert inst.item[1].type == "alternate" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_linkage_1(base_settings): """No. 1 tests collection for Linkage. Test File: linkage-example.json """ filename = base_settings["unittest_data_dir"] / "linkage-example.json" inst = linkage.Linkage.model_validate_json(filename.read_bytes()) assert "Linkage" == inst.get_resource_type() impl_linkage_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Linkage" == data["resourceType"] inst2 = linkage.Linkage(**data) impl_linkage_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_list.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/List Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import list from .conftest import ExternalValidatorModel # noqa: F401 def impl_list_1(inst): assert inst.code.coding[0].code == "182836005" assert inst.code.coding[0].display == "Review of medication" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Medication Review" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-11-20T23:10:23+11:00"} ).valueDateTime ) assert inst.entry[0].flag.coding[0].code == "01" assert inst.entry[0].flag.coding[0].display == "Prescribed" assert ( inst.entry[0].flag.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://nehta.gov.au/codes/medications/changetype"} ).valueUri ) assert inst.entry[0].item.display == "hydroxocobalamin" assert inst.entry[1].deleted is True assert inst.entry[1].flag.coding[0].code == "02" assert inst.entry[1].flag.coding[0].display == "Cancelled" assert ( inst.entry[1].flag.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://nehta.gov.au/codes/medications/changetype"} ).valueUri ) assert inst.entry[1].item.display == "Morphine Sulfate" assert inst.id == "med-list" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "changes" assert inst.source.reference == "Patient/example" assert inst.status == "current" assert inst.text.status == "generated" def test_list_1(base_settings): """No. 1 tests collection for List. Test File: list-example-medlist.json """ filename = base_settings["unittest_data_dir"] / "list-example-medlist.json" inst = list.List.model_validate_json(filename.read_bytes()) assert "List" == inst.get_resource_type() impl_list_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "List" == data["resourceType"] inst2 = list.List(**data) impl_list_1(inst2) def impl_list_2(inst): assert inst.code.coding[0].code == "8670-2" assert inst.code.coding[0].display == "History of family member diseases" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.contained[0].id == "image" assert inst.contained[1].id == "1" assert inst.contained[2].id == "2" assert inst.contained[3].id == "3" assert inst.contained[4].id == "4" assert inst.contained[5].id == "5" assert inst.contained[6].id == "6" assert inst.contained[7].id == "7" assert inst.contained[8].id == "8" assert inst.contained[9].id == "9" assert inst.entry[0].item.reference == "#image" assert inst.entry[1].item.reference == "#2" assert inst.entry[2].item.reference == "#3" assert inst.entry[3].item.reference == "#4" assert inst.entry[4].item.reference == "#5" assert inst.entry[5].item.reference == "#6" assert inst.entry[6].item.reference == "#7" assert inst.entry[7].item.reference == "#8" assert inst.entry[8].item.reference == "#9" assert inst.entry[9].item.reference == "#10" assert inst.id == "prognosis" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "snapshot" assert inst.status == "current" assert inst.subject.display == "Annie Proband, female, born 1966" assert inst.subject.reference == "Patient/proband" assert inst.text.status == "generated" def test_list_2(base_settings): """No. 2 tests collection for List. Test File: list-example-familyhistory-genetics-profile-annie.json """ filename = ( base_settings["unittest_data_dir"] / "list-example-familyhistory-genetics-profile-annie.json" ) inst = list.List.model_validate_json(filename.read_bytes()) assert "List" == inst.get_resource_type() impl_list_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "List" == data["resourceType"] inst2 = list.List(**data) impl_list_2(inst2) def impl_list_3(inst): assert inst.code.coding[0].code == "346638" assert inst.code.coding[0].display == "Patient Admission List" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/list-codes"} ).valueUri ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-07-14T11:54:05+10:00"} ).valueDateTime ) assert inst.id == "example-simple-empty" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "snapshot" assert inst.status == "current" assert inst.text.status == "generated" def test_list_3(base_settings): """No. 3 tests collection for List. Test File: list-example-simple-empty.json """ filename = base_settings["unittest_data_dir"] / "list-example-simple-empty.json" inst = list.List.model_validate_json(filename.read_bytes()) assert "List" == inst.get_resource_type() impl_list_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "List" == data["resourceType"] inst2 = list.List(**data) impl_list_3(inst2) def impl_list_4(inst): assert inst.code.coding[0].code == "182836005" assert inst.code.coding[0].display == "Review of medication" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Medication Review" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-11-26T07:30:23+11:00"} ).valueDateTime ) assert inst.emptyReason.coding[0].code == "nilknown" assert inst.emptyReason.coding[0].display == "Nil Known" assert ( inst.emptyReason.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/list-empty-reason"} ).valueUri ) assert inst.emptyReason.text == "The patient is not on any medications" assert inst.id == "example-empty" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "snapshot" assert inst.source.reference == "Patient/example" assert inst.status == "current" assert inst.text.status == "generated" def test_list_4(base_settings): """No. 4 tests collection for List. Test File: list-example-empty.json """ filename = base_settings["unittest_data_dir"] / "list-example-empty.json" inst = list.List.model_validate_json(filename.read_bytes()) assert "List" == inst.get_resource_type() impl_list_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "List" == data["resourceType"] inst2 = list.List(**data) impl_list_4(inst2) def impl_list_5(inst): assert inst.code.coding[0].code == "8670-2" assert inst.code.coding[0].display == "History of family member diseases" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.contained[0].id == "1" assert inst.contained[1].id == "2" assert inst.contained[2].id == "3" assert inst.contained[3].id == "4" assert inst.contained[4].id == "5" assert inst.contained[5].id == "6" assert inst.contained[6].id == "7" assert inst.contained[7].id == "8" assert inst.entry[0].item.reference == "#1" assert inst.entry[1].item.reference == "#2" assert inst.entry[2].item.reference == "#3" assert inst.entry[3].item.reference == "#4" assert inst.entry[4].item.reference == "#5" assert inst.entry[5].item.reference == "#6" assert inst.entry[6].item.reference == "#7" assert inst.entry[7].item.reference == "#8" assert inst.entry[8].item.display == "Family history of cancer of colon" assert inst.entry[8].item.reference == "Condition/family-history" assert inst.id == "genetic" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "snapshot" assert inst.status == "current" assert inst.subject.display == "Peter Patient" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_list_5(base_settings): """No. 5 tests collection for List. Test File: list-example-familyhistory-genetics-profile.json """ filename = ( base_settings["unittest_data_dir"] / "list-example-familyhistory-genetics-profile.json" ) inst = list.List.model_validate_json(filename.read_bytes()) assert "List" == inst.get_resource_type() impl_list_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "List" == data["resourceType"] inst2 = list.List(**data) impl_list_5(inst2) def impl_list_6(inst): assert inst.code.coding[0].code == "8670-2" assert inst.code.coding[0].display == "History of family member diseases" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.contained[0].id == "fmh-1" assert inst.contained[1].id == "fmh-2" assert inst.entry[0].item.reference == "#fmh-1" assert inst.entry[1].item.reference == "#fmh-2" assert inst.id == "f201" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "snapshot" assert inst.note[0].text == ( "Both parents, both brothers and both children (twin) are " "still alive." ) assert inst.status == "current" assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" def test_list_6(base_settings): """No. 6 tests collection for List. Test File: list-example-familyhistory-f201-roel.json """ filename = ( base_settings["unittest_data_dir"] / "list-example-familyhistory-f201-roel.json" ) inst = list.List.model_validate_json(filename.read_bytes()) assert "List" == inst.get_resource_type() impl_list_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "List" == data["resourceType"] inst2 = list.List(**data) impl_list_6(inst2) def impl_list_7(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-11-25T22:17:00+11:00"} ).valueDateTime ) assert inst.encounter.reference == "Encounter/example" assert inst.entry[0].deleted is True assert inst.entry[0].flag.text == "Deleted due to error" assert inst.entry[0].item.reference == "Condition/example" assert inst.entry[1].flag.text == "Added" assert inst.entry[1].item.reference == "Condition/example2" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:uuid:a9fcea7c-fcdf-4d17-a5e0-f26dda030b59"} ).valueUri ) assert inst.identifier[0].value == "23974652" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "changes" assert inst.source.reference == "Patient/example" assert inst.status == "current" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_list_7(base_settings): """No. 7 tests collection for List. Test File: list-example.json """ filename = base_settings["unittest_data_dir"] / "list-example.json" inst = list.List.model_validate_json(filename.read_bytes()) assert "List" == inst.get_resource_type() impl_list_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "List" == data["resourceType"] inst2 = list.List(**data) impl_list_7(inst2) def impl_list_8(inst): assert inst.code.coding[0].code == "52472-8" assert inst.code.coding[0].display == "Allergies and Adverse Drug Reactions" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.code.text == "Current Allergy List" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-07-14T23:10:23+11:00"} ).valueDateTime ) assert inst.entry[0].item.reference == "AllergyIntolerance/example" assert inst.entry[1].item.reference == "AllergyIntolerance/medication" assert inst.id == "current-allergies" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "working" assert inst.orderedBy.coding[0].code == "entry-date" assert ( inst.orderedBy.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/list-order"} ).valueUri ) assert inst.source.reference == "Patient/example" assert inst.status == "current" assert inst.text.status == "generated" assert inst.title == "Current Allergy List" def test_list_8(base_settings): """No. 8 tests collection for List. Test File: list-example-allergies.json """ filename = base_settings["unittest_data_dir"] / "list-example-allergies.json" inst = list.List.model_validate_json(filename.read_bytes()) assert "List" == inst.get_resource_type() impl_list_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "List" == data["resourceType"] inst2 = list.List(**data) impl_list_8(inst2) def impl_list_9(inst): assert inst.code.coding[0].code == "80738-8" assert inst.code.coding[0].display == ( "TPMT gene mutations found [Identifier] in Blood or Tissue by" " Sequencing Nominal" ) assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.code.text == ( "TPMT gene mutations found [Identifier] in Blood or Tissue by" " Sequencing Nominal" ) assert inst.contained[0].id == "1" assert inst.contained[1].id == "2" assert inst.contained[2].id == "3" assert inst.contained[3].id == "4" assert inst.contained[4].id == "5" assert inst.contained[5].id == "6" assert inst.entry[0].item.reference == "#1" assert inst.entry[1].item.reference == "#2" assert inst.entry[2].item.reference == "#3" assert inst.entry[3].item.reference == "#4" assert inst.entry[4].item.reference == "#5" assert inst.entry[5].item.reference == "#6" assert inst.id == "example-double-cousin-relationship" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "snapshot" assert inst.status == "current" assert inst.subject.display == "Pam Taylor" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_list_9(base_settings): """No. 9 tests collection for List. Test File: list-example-double-cousin-relationship-pedigree.json """ filename = ( base_settings["unittest_data_dir"] / "list-example-double-cousin-relationship-pedigree.json" ) inst = list.List.model_validate_json(filename.read_bytes()) assert "List" == inst.get_resource_type() impl_list_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "List" == data["resourceType"] inst2 = list.List(**data) impl_list_9(inst2) def impl_list_10(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-02-21T12:17:00+11:00"} ).valueDateTime ) assert inst.entry[0].item.reference == "Patient/example" assert inst.entry[1].item.reference == "Patient/pat1" assert inst.entry[2].item.reference == "Patient/pat2" assert inst.entry[3].item.reference == "Patient/pat3" assert inst.entry[4].item.reference == "Patient/pat4" assert inst.entry[5].item.reference == "Patient/1" assert inst.entry[6].item.reference == "Patient/2" assert inst.entry[7].item.reference == "Patient/3" assert inst.entry[8].item.reference == "Patient/4" assert inst.entry[9].item.reference == "Patient/5" assert inst.id == "long" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "changes" assert inst.status == "current" assert inst.text.status == "generated" def test_list_10(base_settings): """No. 10 tests collection for List. Test File: list-example-long.json """ filename = base_settings["unittest_data_dir"] / "list-example-long.json" inst = list.List.model_validate_json(filename.read_bytes()) assert "List" == inst.get_resource_type() impl_list_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "List" == data["resourceType"] inst2 = list.List(**data) impl_list_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_location.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Location Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import location from .conftest import ExternalValidatorModel # noqa: F401 def impl_location_1(inst): assert inst.address.city == "Den Burg" assert inst.address.country == "NLD" assert inst.address.line[0] == "Galapagosweg 91, Building A" assert inst.address.postalCode == "9105 PZ" assert inst.address.use == "work" assert inst.alias[0] == "BU MC, SW, F2" assert ( inst.alias[1] == "Burgers University Medical Center, South Wing, second floor" ) assert inst.description == ( "Second floor of the Old South Wing, formerly in use by " "Psychiatry" ) assert inst.endpoint[0].reference == "Endpoint/example" assert inst.id == "1" assert inst.identifier[0].value == "B1-S.F2" assert inst.managingOrganization.reference == "Organization/f001" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "instance" assert inst.name == "South Wing, second floor" assert inst.physicalType.coding[0].code == "wi" assert inst.physicalType.coding[0].display == "Wing" assert ( inst.physicalType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/location-physical-type"} ).valueUri ) assert float(inst.position.altitude) == float(0) assert float(inst.position.latitude) == float(42.25475478) assert float(inst.position.longitude) == float(-83.6945691) assert inst.status == "active" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "2328" assert inst.telecom[1].system == "fax" assert inst.telecom[1].use == "work" assert inst.telecom[1].value == "2329" assert inst.telecom[2].system == "email" assert inst.telecom[2].value == "second wing admissions" assert inst.telecom[3].system == "url" assert inst.telecom[3].use == "work" assert inst.telecom[3].value == "http://sampleorg.com/southwing" assert inst.text.div == ( '
Burgers UMC, ' "South Wing, second floor
" ) assert inst.text.status == "generated" def test_location_1(base_settings): """No. 1 tests collection for Location. Test File: location-example.json """ filename = base_settings["unittest_data_dir"] / "location-example.json" inst = location.Location.model_validate_json(filename.read_bytes()) assert "Location" == inst.get_resource_type() impl_location_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Location" == data["resourceType"] inst2 = location.Location(**data) impl_location_1(inst2) def impl_location_2(inst): assert inst.alias[0] == "South Wing OR 5" assert inst.alias[1] == "Main Wing OR 2" assert inst.description == ( "Old South Wing, Neuro Radiology Operation Room 1 on second " "floor" ) assert inst.id == "2" assert inst.identifier[0].value == "B1-S.F2.1.00" assert inst.managingOrganization.reference == "Organization/f001" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "instance" assert inst.name == "South Wing Neuro OR 1" assert inst.operationalStatus.code == "H" assert inst.operationalStatus.display == "Housekeeping" assert ( inst.operationalStatus.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0116"} ).valueUri ) assert inst.partOf.reference == "Location/1" assert inst.physicalType.coding[0].code == "ro" assert inst.physicalType.coding[0].display == "Room" assert ( inst.physicalType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/location-physical-type"} ).valueUri ) assert inst.status == "suspended" assert inst.telecom[0].system == "phone" assert inst.telecom[0].value == "2329" assert inst.text.div == ( '
Burgers UMC, ' "South Wing, second floor, Neuro Radiology Operation Room " "1
" ) assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "RNEU" assert inst.type[0].coding[0].display == "Neuroradiology unit" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) def test_location_2(base_settings): """No. 2 tests collection for Location. Test File: location-example-room.json """ filename = base_settings["unittest_data_dir"] / "location-example-room.json" inst = location.Location.model_validate_json(filename.read_bytes()) assert "Location" == inst.get_resource_type() impl_location_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Location" == data["resourceType"] inst2 = location.Location(**data) impl_location_2(inst2) def impl_location_3(inst): assert inst.description == "Ambulance provided by Burgers University Medical Center" assert inst.id == "amb" assert inst.managingOrganization.reference == "Organization/f001" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "kind" assert inst.name == "BUMC Ambulance" assert inst.physicalType.coding[0].code == "ve" assert inst.physicalType.coding[0].display == "Vehicle" assert ( inst.physicalType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/location-physical-type"} ).valueUri ) assert inst.status == "active" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "mobile" assert inst.telecom[0].value == "2329" assert inst.text.div == ( '
Mobile ' "Clinic
" ) assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "AMB" assert inst.type[0].coding[0].display == "Ambulance" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) def test_location_3(base_settings): """No. 3 tests collection for Location. Test File: location-example-ambulance.json """ filename = base_settings["unittest_data_dir"] / "location-example-ambulance.json" inst = location.Location.model_validate_json(filename.read_bytes()) assert "Location" == inst.get_resource_type() impl_location_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Location" == data["resourceType"] inst2 = location.Location(**data) impl_location_3(inst2) def impl_location_4(inst): assert inst.description == ( "All Pharmacies in the United Kingdom covered by the National" " Pharmacy Association" ) assert inst.id == "ukp" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "kind" assert inst.name == "UK Pharmacies" assert inst.physicalType.coding[0].code == "jdn" assert inst.physicalType.coding[0].display == "Jurisdiction" assert ( inst.physicalType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/location-physical-type"} ).valueUri ) assert inst.status == "active" assert inst.text.div == ( '
UK ' "Pharmacies
" ) assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "PHARM" assert inst.type[0].coding[0].display == "Pharmacy" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) def test_location_4(base_settings): """No. 4 tests collection for Location. Test File: location-example-ukpharmacy.json """ filename = base_settings["unittest_data_dir"] / "location-example-ukpharmacy.json" inst = location.Location.model_validate_json(filename.read_bytes()) assert "Location" == inst.get_resource_type() impl_location_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Location" == data["resourceType"] inst2 = location.Location(**data) impl_location_4(inst2) def impl_location_5(inst): assert inst.description == "Patient's Home" assert inst.id == "ph" assert inst.managingOrganization.reference == "Organization/f001" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "kind" assert inst.name == "Patient's Home" assert inst.physicalType.coding[0].code == "ho" assert inst.physicalType.coding[0].display == "House" assert ( inst.physicalType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/location-physical-type"} ).valueUri ) assert inst.status == "active" assert inst.text.div == ( '
Patient\'s ' "Home
" ) assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "PTRES" assert inst.type[0].coding[0].display == "Patient's Residence" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) def test_location_5(base_settings): """No. 5 tests collection for Location. Test File: location-example-patients-home.json """ filename = ( base_settings["unittest_data_dir"] / "location-example-patients-home.json" ) inst = location.Location.model_validate_json(filename.read_bytes()) assert "Location" == inst.get_resource_type() impl_location_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Location" == data["resourceType"] inst2 = location.Location(**data) impl_location_5(inst2) def impl_location_6(inst): assert inst.address.city == "Ann Arbor" assert inst.address.country == "USA" assert inst.address.line[0] == "3300 Washtenaw Avenue, Suite 227" assert inst.address.postalCode == "48104" assert inst.address.state == "MI" assert inst.description == "HL7 Headquarters" assert inst.id == "hl7" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "instance" assert inst.name == "Health Level Seven International" assert inst.physicalType.coding[0].code == "bu" assert inst.physicalType.coding[0].display == "Building" assert ( inst.physicalType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/location-physical-type"} ).valueUri ) assert float(inst.position.latitude) == float(-83.69471) assert float(inst.position.longitude) == float(42.2565) assert inst.status == "active" assert inst.telecom[0].system == "phone" assert inst.telecom[0].value == "(+1) 734-677-7777" assert inst.telecom[1].system == "fax" assert inst.telecom[1].value == "(+1) 734-677-6622" assert inst.telecom[2].system == "email" assert inst.telecom[2].value == "hq@HL7.org" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "SLEEP" assert inst.type[0].coding[0].display == "Sleep disorders unit" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) def test_location_6(base_settings): """No. 6 tests collection for Location. Test File: location-example-hl7hq.json """ filename = base_settings["unittest_data_dir"] / "location-example-hl7hq.json" inst = location.Location.model_validate_json(filename.read_bytes()) assert "Location" == inst.get_resource_type() impl_location_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Location" == data["resourceType"] inst2 = location.Location(**data) impl_location_6(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_manufactureditemdefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ManufacturedItemDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import manufactureditemdefinition from .conftest import ExternalValidatorModel # noqa: F401 def impl_manufactureditemdefinition_1(inst): assert inst.id == "example" assert inst.manufacturedDoseForm.coding[0].code == "Film-coatedtablet" assert ( inst.manufacturedDoseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/manufactureddoseform"} ).valueUri ) assert inst.manufacturer[0].reference == "Organization/example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.property[0].type.coding[0].code == "shape" assert inst.property[0].valueCodeableConcept.text == "Oval" assert inst.property[1].type.coding[0].code == "color" assert inst.property[1].valueCodeableConcept.text == "pink" assert inst.property[2].type.coding[0].code == "imprint" assert inst.property[2].valueCodeableConcept.text == "894" assert inst.status == "active" assert inst.text.status == "generated" assert inst.unitOfPresentation.coding[0].code == "Tablet" assert ( inst.unitOfPresentation.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/unitofpresentation"} ).valueUri ) def test_manufactureditemdefinition_1(base_settings): """No. 1 tests collection for ManufacturedItemDefinition. Test File: manufactureditemdefinition-example.json """ filename = ( base_settings["unittest_data_dir"] / "manufactureditemdefinition-example.json" ) inst = manufactureditemdefinition.ManufacturedItemDefinition.model_validate_json( filename.read_bytes() ) assert "ManufacturedItemDefinition" == inst.get_resource_type() impl_manufactureditemdefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ManufacturedItemDefinition" == data["resourceType"] inst2 = manufactureditemdefinition.ManufacturedItemDefinition(**data) impl_manufactureditemdefinition_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_measure.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Measure Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import measure from .conftest import ExternalValidatorModel # noqa: F401 def impl_measure_1(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-03-08"} ).valueDateTime ) assert inst.description == ( "Exclusive breastfeeding measure of outcomes for exclusive " "breastmilk feeding of newborns." ) assert inst.experimental is True assert inst.group[0].id == "PopulationGroup1" assert inst.group[0].population[0].code.coding[0].code == "initial-population" assert inst.group[0].population[0].criteria.expression == "InitialPopulation1" assert inst.group[0].population[0].criteria.language == "text/cql" assert inst.group[0].population[1].code.coding[0].code == "denominator" assert inst.group[0].population[1].criteria.expression == "Denominator1" assert inst.group[0].population[1].criteria.language == "text/cql" assert inst.group[0].population[2].code.coding[0].code == "denominator-exclusions" assert inst.group[0].population[2].criteria.expression == "DenominatorExclusions1" assert inst.group[0].population[2].criteria.language == "text/cql" assert inst.group[0].population[3].code.coding[0].code == "numerator" assert inst.group[0].population[3].criteria.expression == "Numerator1" assert inst.group[0].population[3].criteria.language == "text/cql" assert inst.group[1].id == "PopulationGroup2" assert inst.group[1].population[0].code.coding[0].code == "initial-population" assert inst.group[1].population[0].criteria.expression == "InitialPopulation2" assert inst.group[1].population[0].criteria.language == "text/cql" assert inst.group[1].population[1].code.coding[0].code == "denominator" assert inst.group[1].population[1].criteria.expression == "Denominator2" assert inst.group[1].population[1].criteria.language == "text/cql" assert inst.group[1].population[2].code.coding[0].code == "denominator-exclusion" assert inst.group[1].population[2].criteria.expression == "DenominatorExclusions2" assert inst.group[1].population[2].criteria.language == "text/cql" assert inst.group[1].population[3].code.coding[0].code == "numerator" assert inst.group[1].population[3].criteria.expression == "Numerator2" assert inst.group[1].population[3].criteria.language == "text/cql" assert inst.id == "measure-exclusive-breastfeeding" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "exclusive-breastfeeding-measure" assert inst.improvementNotation.coding[0].code == "increase" assert ( inst.improvementNotation.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/measure-improvement-notation" } ).valueUri ) assert inst.library[0] == ( "http://example.org/fhir/Library/library-exclusive-" "breastfeeding-cqm-logic" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.purpose == ( "Measure of newborns who were fed breast milk only since " "birth" ) assert inst.relatedArtifact[0].citation == ( "American Academy of Pediatrics. (2005). Section on " "Breastfeeding. Policy Statement:Breastfeeding and the Use of" " Human Milk. Pediatrics.115:496-506." ) assert inst.relatedArtifact[0].type == "documentation" assert inst.relatedArtifact[1].type == "documentation" assert inst.relatedArtifact[2].type == "documentation" assert inst.relatedArtifact[3].type == "documentation" assert inst.relatedArtifact[4].type == "documentation" assert inst.relatedArtifact[5].type == "documentation" assert inst.relatedArtifact[6].citation == ( "Kramer, M.S. & Kakuma, R. (2002).Optimal duration of " "exclusive breastfeeding. [107 refs] Cochrane Database of " "Systematic Reviews. (1):CD003517." ) assert inst.relatedArtifact[6].type == "documentation" assert inst.relatedArtifact[7].citation == ( "Petrova, A., Hegyi, T., & Mehta, R. (2007). Maternal " "race/ethnicity and one-month exclusive breastfeeding in " "association with the in-hospital feeding modality. " "Breastfeeding Medicine. 2(2):92-8." ) assert inst.relatedArtifact[7].type == "documentation" assert inst.relatedArtifact[8].type == "documentation" assert inst.relatedArtifact[9].type == "documentation" assert inst.scoring.coding[0].code == "proportion" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Exclusive Breastfeeding Measure" assert inst.topic[0].text == "Exclusive Breastfeeding" assert inst.type[0].coding[0].code == "process" assert inst.version == "4.3.0" def test_measure_1(base_settings): """No. 1 tests collection for Measure. Test File: measure-exclusive-breastfeeding.json """ filename = ( base_settings["unittest_data_dir"] / "measure-exclusive-breastfeeding.json" ) inst = measure.Measure.model_validate_json(filename.read_bytes()) assert "Measure" == inst.get_resource_type() impl_measure_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Measure" == data["resourceType"] inst2 = measure.Measure(**data) impl_measure_1(inst2) def impl_measure_2(inst): assert inst.experimental is True assert inst.group[0].id == "Main" assert inst.group[0].population[0].code.coding[0].code == "initial-population" assert inst.group[0].population[0].criteria.expression == "Initial Population" assert inst.group[0].population[0].criteria.language == "text/cql" assert inst.group[0].population[1].code.coding[0].code == "denominator" assert inst.group[0].population[1].criteria.expression == "Denominator" assert inst.group[0].population[1].criteria.language == "text/cql" assert inst.group[0].population[2].code.coding[0].code == "numerator" assert inst.group[0].population[2].criteria.expression == "Numerator" assert inst.group[0].population[2].criteria.language == "text/cql" assert inst.id == "component-b-example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.scoring.coding[0].code == "proportion" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Screening for Depression" def test_measure_2(base_settings): """No. 2 tests collection for Measure. Test File: measure-component-b-example.json """ filename = base_settings["unittest_data_dir"] / "measure-component-b-example.json" inst = measure.Measure.model_validate_json(filename.read_bytes()) assert "Measure" == inst.get_resource_type() impl_measure_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Measure" == data["resourceType"] inst2 = measure.Measure(**data) impl_measure_2(inst2) def impl_measure_3(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-03-08"} ).valueDateTime ) assert inst.description == ( "Exclusive breastfeeding measure of outcomes for exclusive " "breastmilk feeding of newborns." ) assert inst.experimental is True assert inst.group[0].id == "PopulationGroup1" assert inst.group[0].population[0].code.coding[0].code == "initial-population" assert inst.group[0].population[0].criteria.expression == "InitialPopulation1" assert inst.group[0].population[0].criteria.language == "text/cql" assert inst.group[0].population[1].code.coding[0].code == "denominator" assert inst.group[0].population[1].criteria.expression == "Denominator1" assert inst.group[0].population[1].criteria.language == "text/cql" assert inst.group[0].population[2].code.coding[0].code == "denominator-exclusions" assert inst.group[0].population[2].criteria.expression == "DenominatorExclusions1" assert inst.group[0].population[2].criteria.language == "text/cql" assert inst.group[0].population[3].code.coding[0].code == "numerator" assert inst.group[0].population[3].criteria.expression == "Numerator1" assert inst.group[0].population[3].criteria.language == "text/cql" assert inst.group[1].id == "PopulationGroup2" assert inst.group[1].population[0].code.coding[0].code == "initial-population" assert inst.group[1].population[0].criteria.expression == "InitialPopulation2" assert inst.group[1].population[0].criteria.language == "text/cql" assert inst.group[1].population[1].code.coding[0].code == "denominator" assert inst.group[1].population[1].criteria.expression == "Denominator2" assert inst.group[1].population[1].criteria.language == "text/cql" assert inst.group[1].population[2].code.coding[0].code == "denominator-exclusion" assert inst.group[1].population[2].criteria.expression == "DenominatorExclusions2" assert inst.group[1].population[2].criteria.language == "text/cql" assert inst.group[1].population[3].code.coding[0].code == "numerator" assert inst.group[1].population[3].criteria.expression == "Numerator2" assert inst.group[1].population[3].criteria.language == "text/cql" assert inst.id == "measure-predecessor-example" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "exclusive-breastfeeding-measure" assert inst.improvementNotation.coding[0].code == "increase" assert ( inst.improvementNotation.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/measure-improvement-notation" } ).valueUri ) assert inst.library[0] == ( "http://example.org/fhir/Library/library-exclusive-" "breastfeeding-cqm-logic" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.purpose == ( "Measure of newborns who were fed breast milk only since " "birth" ) assert inst.relatedArtifact[0].citation == ( "American Academy of Pediatrics. (2005). Section on " "Breastfeeding. Policy Statement:Breastfeeding and the Use of" " Human Milk. Pediatrics.115:496-506." ) assert inst.relatedArtifact[0].type == "documentation" assert inst.relatedArtifact[1].type == "documentation" assert inst.relatedArtifact[2].type == "documentation" assert inst.relatedArtifact[3].type == "documentation" assert inst.relatedArtifact[4].type == "documentation" assert inst.relatedArtifact[5].type == "documentation" assert inst.relatedArtifact[6].citation == ( "Kramer, M.S. & Kakuma, R. (2002).Optimal duration of " "exclusive breastfeeding. [107 refs] Cochrane Database of " "Systematic Reviews. (1):CD003517." ) assert inst.relatedArtifact[6].type == "documentation" assert inst.relatedArtifact[7].citation == ( "Petrova, A., Hegyi, T., & Mehta, R. (2007). Maternal " "race/ethnicity and one-month exclusive breastfeeding in " "association with the in-hospital feeding modality. " "Breastfeeding Medicine. 2(2):92-8." ) assert inst.relatedArtifact[7].type == "documentation" assert inst.relatedArtifact[8].type == "documentation" assert inst.relatedArtifact[9].type == "documentation" assert inst.scoring.coding[0].code == "proportion" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Exclusive Breastfeeding Measure" assert inst.topic[0].text == "Exclusive Breastfeeding" assert inst.type[0].coding[0].code == "process" assert inst.version == "4.3.0" def test_measure_3(base_settings): """No. 3 tests collection for Measure. Test File: measure-predecessor-example.json """ filename = base_settings["unittest_data_dir"] / "measure-predecessor-example.json" inst = measure.Measure.model_validate_json(filename.read_bytes()) assert "Measure" == inst.get_resource_type() impl_measure_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Measure" == data["resourceType"] inst2 = measure.Measure(**data) impl_measure_3(inst2) def impl_measure_4(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-03-08"} ).valueDateTime ) assert inst.experimental is True assert inst.group[0].code.coding[0].code == "QRPH_ADX_ART1_N" assert ( inst.group[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[0].description == ( "Number of adults and children newly enrolled on " "antiretroviral therapy (ART) in the reporting period" ) assert inst.group[0].population[0].code.text == "cohort" assert inst.group[0].population[0].criteria.expression == ( "Newly enrolled on antiretroviral therapy (ART) during " "measurement period" ) assert inst.group[0].population[0].criteria.language == "text/cql" assert inst.group[0].stratifier[0].code.coding[0].code == "AGE_GROUP:SEX" assert ( inst.group[0].stratifier[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[0].stratifier[0].criteria.expression == "Age Group/Sex" assert inst.group[0].stratifier[0].criteria.language == "text/cql" assert inst.group[1].code.coding[0].code == "QRPH_ADX_ART1_N_PREG_BF" assert ( inst.group[1].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[1].description == ( "Number of adults and children newly enrolled on ART in the " "reporting period_pregnant and breastfeeding" ) assert inst.group[1].population[0].code.text == "cohort" assert inst.group[1].population[0].criteria.expression == ( "Newly enrolled on antiretroviral therapy (ART) during " "measurement period (pregnant and breastfeeding)" ) assert inst.group[1].population[0].criteria.language == "text/cql" assert inst.group[1].stratifier[0].code.coding[0].code == "PREG_BF" assert ( inst.group[1].stratifier[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[1].stratifier[0].criteria.expression == "Pregnant/Breastfeeding" assert inst.group[1].stratifier[0].criteria.language == "text/cql" assert inst.group[2].code.coding[0].code == "QRPH_ADX_ART3_N" assert ( inst.group[2].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[2].description == ( "Number of adults and children currently receiving " "antiretroviral therapy (ART)" ) assert inst.group[2].population[0].code.text == "cohort" assert inst.group[2].population[0].criteria.expression == ( "Receiving antiretroviral therapy (ART) during measurement " "period" ) assert inst.group[2].population[0].criteria.language == "text/cql" assert inst.group[3].code.coding[0].code == "QRPH_ADX_ART5_N" assert ( inst.group[3].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[3].description == ( "Number of adults and children who are still on treatment at " "12 months after initiating ART" ) assert inst.group[3].population[0].code.text == "cohort" assert inst.group[3].population[0].criteria.expression == ( "Receiving antiretroviral therapy (ART) at 12 months after " "initiating" ) assert inst.group[3].population[0].criteria.language == "text/cql" assert inst.group[3].stratifier[0].component[0].code.coding[0].code == "AGE_GROUP" assert ( inst.group[3].stratifier[0].component[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[3].stratifier[0].component[0].criteria.expression == "Age Group" assert inst.group[3].stratifier[0].component[0].criteria.language == "text/cql" assert inst.group[3].stratifier[0].component[1].code.coding[0].code == "SEX" assert ( inst.group[3].stratifier[0].component[1].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[3].stratifier[0].component[1].criteria.expression == "Sex" assert inst.group[3].stratifier[0].component[1].criteria.language == "text/cql" assert inst.group[4].code.coding[0].code == "QRPH_ADX_ART5_N_PREG_BF" assert ( inst.group[4].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[4].description == ( "Number of adults and children who are still on treatment at " "12 months after initiating ART-pregnant and breastfeeding" ) assert inst.group[4].population[0].code.text == "cohort" assert inst.group[4].population[0].criteria.expression == ( "Receiving antiretroviral therapy (ART) at 12 months after " "initiating (pregnant and breastfeeding)" ) assert inst.group[4].population[0].criteria.language == "text/cql" assert inst.group[4].stratifier[0].code.coding[0].code == "PREG_BF" assert ( inst.group[4].stratifier[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[4].stratifier[0].criteria.expression == "Pregnant/Breastfeeding" assert inst.group[4].stratifier[0].criteria.language == "text/cql" assert inst.group[5].code.coding[0].code == "QRPH_ADX_ART5_D" assert ( inst.group[5].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[5].description == ( "Number of adults and children who initiated ART in the 12 " "months prior to the beginning of the reporting period" ) assert inst.group[5].population[0].code.text == "cohort" assert inst.group[5].population[0].criteria.expression == ( "Initiated antiretroviral therapy (ART) in the 12 months " "prior to measurement period" ) assert inst.group[5].population[0].criteria.language == "text/cql" assert inst.group[5].stratifier[0].code.coding[0].code == "AGE_GROUP:SEX" assert ( inst.group[5].stratifier[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[5].stratifier[0].criteria.expression == "Age Group/Sex" assert inst.group[5].stratifier[0].criteria.language == "text/cql" assert inst.group[6].code.coding[0].code == "QRPH_ADX_MTCT1_D" assert ( inst.group[6].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[6].description == ( "Number of pregnant women who attended ANC or had a facility-" "based delivery in the reporting period" ) assert inst.group[6].population[0].code.text == "cohort" assert inst.group[6].population[0].criteria.expression == ( "Antenatal Care Visit or Live Birth during the Measurement " "Period" ) assert inst.group[6].population[0].criteria.language == "text/cql" assert inst.group[6].stratifier[0].code.coding[0].code == "PMTCT_HIV_STATUS" assert ( inst.group[6].stratifier[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[6].stratifier[0].criteria.expression == "PMTCT HIV Status" assert inst.group[6].stratifier[0].criteria.language == "text/cql" assert inst.group[7].code.coding[0].code == "QRPH_ADX_MTCT2_D" assert ( inst.group[7].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[7].description == ( "Number of HIV positive pregnant women who attended ANC or " "had a facility-based delivery within the reporting period" ) assert inst.group[7].population[0].code.text == "cohort" assert inst.group[7].population[0].criteria.expression == ( "Antenatal Care Visit or Live Birth during Measurement Period" " (HIV Positive)" ) assert inst.group[7].population[0].criteria.language == "text/cql" assert inst.group[8].code.coding[0].code == "QRPH_ADX_MTCT2_N" assert ( inst.group[8].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[8].description == ( "Number of HIV-positive pregnant women who received ART to " "reduce the risk of mother-to-child-transmission during " "pregnancy" ) assert inst.group[8].population[0].code.text == "cohort" assert inst.group[8].population[0].criteria.expression == ( "HIV-positive, pregnant, and receiving antiretroviral therapy" " (ART) to reduce the risk of mother-to-child-transmission " "during pregnancy" ) assert inst.group[8].population[0].criteria.language == "text/cql" assert inst.group[8].stratifier[0].code.coding[0].code == "PMTCT_ART_STATUS" assert ( inst.group[8].stratifier[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[8].stratifier[0].criteria.expression == "PMTCT ART Status" assert inst.group[8].stratifier[0].criteria.language == "text/cql" assert inst.group[9].code.coding[0].code == "QRPH_ADX_VLS3_N" assert ( inst.group[9].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[9].description == ( "Number of people living with HIV and on ART who have a " "suppressed viral load results (<1000 copies/mL)" ) assert inst.group[9].population[0].code.text == "cohort" assert inst.group[9].population[0].criteria.expression == ( "Living with HIV and on ART with suppressed viral load " "results (<1000 copies/mL)" ) assert inst.group[9].population[0].criteria.language == "text/cql" assert inst.group[9].stratifier[0].code.coding[0].code == "AGE_GROUP:SEX" assert ( inst.group[9].stratifier[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[9].stratifier[0].criteria.expression == "Age Group/Sex" assert inst.group[9].stratifier[0].criteria.language == "text/cql" assert inst.id == "hiv-indicators" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ohie.org/Measure/"} ).valueUri ) assert inst.identifier[0].value == "hiv-indicators" assert inst.library[0] == "http://ohie.org/Library/hiv-indicators" assert inst.name == "HIV" assert inst.publisher == "Open HIE" assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://wiki.ihe.net/index.php/Aggregate_Data_Exchange_-_HIV"} ).valueUrl ) assert inst.relatedArtifact[0].type == "derived-from" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( {"valueUrl": "http://wiki.ihe.net/index.php/Aggregate_Data_Exchange_-_HIV"} ).valueUrl ) assert inst.scoring.coding[0].code == "cohort" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "HIV Indicators" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://ohie.org/Measure/hiv-indicators"} ).valueUri ) assert inst.version == "0.0.0" def test_measure_4(base_settings): """No. 4 tests collection for Measure. Test File: measure-hiv-indicators.json """ filename = base_settings["unittest_data_dir"] / "measure-hiv-indicators.json" inst = measure.Measure.model_validate_json(filename.read_bytes()) assert "Measure" == inst.get_resource_type() impl_measure_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Measure" == data["resourceType"] inst2 = measure.Measure(**data) impl_measure_4(inst2) def impl_measure_5(inst): assert ( inst.approvalDate == ExternalValidatorModel.model_validate({"valueDate": "2016-01-01"}).valueDate ) assert inst.author[0].name == "National Committee for Quality Assurance" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://www.ncqa.org/" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-10"} ).valueDateTime ) assert inst.description == ( "Percentage of children 3-18 years of age who were diagnosed " "with pharyngitis, ordered an antibiotic and received a group" " A streptococcus (strep) test for the episode." ) assert ( inst.effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-12-31"} ).valueDateTime ) assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-01"} ).valueDateTime ) assert inst.experimental is True assert inst.group[0].id == "CMS146-group-1" assert inst.group[0].population[0].code.coding[0].code == "initial-population" assert ( inst.group[0].population[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/measure-population"} ).valueUri ) assert inst.group[0].population[0].criteria.expression == "CMS146.InitialPopulation" assert inst.group[0].population[0].criteria.language == "text/cql" assert inst.group[0].population[1].code.coding[0].code == "numerator" assert ( inst.group[0].population[1].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/measure-population"} ).valueUri ) assert inst.group[0].population[1].criteria.expression == "CMS146.Numerator" assert inst.group[0].population[1].criteria.language == "text/cql" assert inst.group[0].population[2].code.coding[0].code == "denominator" assert ( inst.group[0].population[2].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/measure-population"} ).valueUri ) assert inst.group[0].population[2].criteria.expression == "CMS146.Denominator" assert inst.group[0].population[2].criteria.language == "text/cql" assert inst.group[0].population[3].code.coding[0].code == "denominator-exclusion" assert ( inst.group[0].population[3].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/measure-population"} ).valueUri ) assert ( inst.group[0].population[3].criteria.expression == "CMS146.DenominatorExclusion" ) assert inst.group[0].population[3].criteria.language == "text/cql" assert inst.group[0].stratifier[0].code.text == "stratifier-ages-up-to-9" assert inst.group[0].stratifier[0].criteria.expression == "CMS146.AgesUpToNine" assert inst.group[0].stratifier[0].criteria.language == "text/cql" assert inst.group[0].stratifier[1].code.text == "stratifier-ages-10-plus" assert inst.group[0].stratifier[1].criteria.expression == "CMS146.AgesTenPlus" assert inst.group[0].stratifier[1].criteria.language == "text/cql" assert inst.group[0].stratifier[2].code.text == "stratifier-gender" assert inst.group[0].stratifier[2].criteria.expression == "Patient.gender" assert inst.group[0].stratifier[2].criteria.language == "text/fhirpath" assert inst.guidance == ( "This is an episode of care measure that examines all " "eligible episodes for the patient during the measurement " "period. If the patient has more than one episode, include " "all episodes in the measure" ) assert inst.id == "measure-cms146-example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/cqi/ecqm/Measure/Identifier/cms"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "146" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/cqi/ecqm/Measure/Identifier/nqf"} ).valueUri ) assert inst.identifier[1].use == "official" assert inst.identifier[1].value == "0002" assert inst.improvementNotation.coding[0].code == "increase" assert ( inst.improvementNotation.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/measure-improvement-notation" } ).valueUri ) assert inst.jurisdiction[0].coding[0].code == "US" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert ( inst.lastReviewDate == ExternalValidatorModel.model_validate({"valueDate": "2016-09-01"}).valueDate ) assert inst.library[0] == "http://hl7.org/fhir/Library/library-cms146-example" assert inst.name == "CMS146" assert inst.publisher == "National Committee for Quality Assurance" assert inst.purpose == ( "Measure of children with a group A streptococcus test in the" " 7-day period from 3 days prior through 3 days after the " "diagnosis of pharyngitis" ) assert inst.relatedArtifact[0].citation == ( "Linder, J.A., D.W. Bates, G.M. Lee, J.A. Finkelstein. 2005. " "_Antibiotic treatment of children with sore throat._ JAMA " "294(18):2315-2322." ) assert inst.relatedArtifact[0].type == "documentation" assert inst.relatedArtifact[1].citation == ( "Infectious Diseases Society of America. 2012. _Clinical " "Practice Guideline for the Diagnosis and Management of Group" " A Streptococcal Pharyngitis: 2012 Update._" ) assert inst.relatedArtifact[1].type == "documentation" assert inst.relatedArtifact[2].type == "documentation" assert inst.scoring.coding[0].code == "proportion" assert ( inst.scoring.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/measure-scoring"} ).valueUri ) assert inst.status == "active" assert inst.supplementalData[0].code.text == "supplemental-data-gender" assert inst.supplementalData[0].criteria.expression == "Patient.gender" assert inst.supplementalData[0].criteria.language == "text/fhirpath" assert inst.supplementalData[1].code.text == "supplemental-data-deceased" assert inst.supplementalData[1].criteria.expression == "deceasedBoolean" assert inst.supplementalData[1].criteria.language == "text/fhirpath" assert inst.text.status == "additional" assert inst.title == "Appropriate Testing for Children with Pharyngitis" assert inst.topic[0].coding[0].code == "57024-2" assert ( inst.topic[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.type[0].coding[0].code == "process" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/measure-type"} ).valueUri ) assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/Measure/measure-cms146-example"} ).valueUri ) assert inst.useContext[0].code.code == "program" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.text == "eligibile-provider" assert inst.useContext[1].code.code == "age" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueRange.high.unit == "a" assert float(inst.useContext[1].valueRange.high.value) == float(18) assert inst.useContext[1].valueRange.low.unit == "a" assert float(inst.useContext[1].valueRange.low.value) == float(3) assert inst.version == "1.0.0" def test_measure_5(base_settings): """No. 5 tests collection for Measure. Test File: measure-cms146-example.json """ filename = base_settings["unittest_data_dir"] / "measure-cms146-example.json" inst = measure.Measure.model_validate_json(filename.read_bytes()) assert "Measure" == inst.get_resource_type() impl_measure_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Measure" == data["resourceType"] inst2 = measure.Measure(**data) impl_measure_5(inst2) def impl_measure_6(inst): assert inst.experimental is True assert inst.group[0].id == "Main" assert inst.group[0].population[0].code.coding[0].code == "initial-population" assert inst.group[0].population[0].criteria.expression == "Initial Population" assert inst.group[0].population[0].criteria.language == "text/cql" assert inst.group[0].population[1].code.coding[0].code == "denominator" assert inst.group[0].population[1].criteria.expression == "Denominator" assert inst.group[0].population[1].criteria.language == "text/cql" assert inst.group[0].population[2].code.coding[0].code == "numerator" assert inst.group[0].population[2].criteria.expression == "Numerator" assert inst.group[0].population[2].criteria.language == "text/cql" assert inst.id == "component-a-example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.scoring.coding[0].code == "proportion" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Screening for Alcohol Misuse" def test_measure_6(base_settings): """No. 6 tests collection for Measure. Test File: measure-component-a-example.json """ filename = base_settings["unittest_data_dir"] / "measure-component-a-example.json" inst = measure.Measure.model_validate_json(filename.read_bytes()) assert "Measure" == inst.get_resource_type() impl_measure_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Measure" == data["resourceType"] inst2 = measure.Measure(**data) impl_measure_6(inst2) def impl_measure_7(inst): assert inst.compositeScoring.coding[0].code == "opportunity" assert inst.experimental is True assert inst.id == "composite-example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.relatedArtifact[0].resource == "http://example.org/fhir/Measure/component-a-example" ) assert inst.relatedArtifact[0].type == "composed-of" assert ( inst.relatedArtifact[1].resource == "http://example.org/fhir/Measure/component-b-example" ) assert inst.relatedArtifact[1].type == "composed-of" assert inst.scoring.coding[0].code == "proportion" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Behavioral Assessment Composite Measure" def test_measure_7(base_settings): """No. 7 tests collection for Measure. Test File: measure-composite-example.json """ filename = base_settings["unittest_data_dir"] / "measure-composite-example.json" inst = measure.Measure.model_validate_json(filename.read_bytes()) assert "Measure" == inst.get_resource_type() impl_measure_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Measure" == data["resourceType"] inst2 = measure.Measure(**data) impl_measure_7(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_measurereport.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/MeasureReport Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import measurereport from .conftest import ExternalValidatorModel # noqa: F401 def impl_measurereport_1(inst): assert inst.contained[0].id == "reporter" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-04-01"} ).valueDateTime ) assert inst.evaluatedResource[0].reference == "Condition/example" assert inst.group[0].id == "CMS146-group-1" assert inst.group[0].population[0].code.coding[0].code == "initial-population" assert inst.group[0].population[0].count == 1 assert inst.group[0].population[1].code.coding[0].code == "numerator" assert inst.group[0].population[1].count == 1 assert inst.group[0].population[2].code.coding[0].code == "denominator" assert inst.group[0].population[2].count == 1 assert inst.group[0].population[3].code.coding[0].code == "denominator-exclusion" assert inst.group[0].population[3].count == 0 assert inst.group[0].stratifier[0].code[0].text == "stratifier-ages-up-to-9" assert ( inst.group[0].stratifier[0].stratum[0].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[0].stratum[0].population[0].count == 1 assert ( inst.group[0].stratifier[0].stratum[0].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[0].stratum[0].population[1].count == 1 assert ( inst.group[0].stratifier[0].stratum[0].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[0].stratum[0].population[2].count == 1 assert ( inst.group[0].stratifier[0].stratum[0].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[0].stratum[0].population[3].count == 0 assert inst.group[0].stratifier[0].stratum[0].value.text == "true" assert ( inst.group[0].stratifier[0].stratum[1].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[0].stratum[1].population[0].count == 0 assert ( inst.group[0].stratifier[0].stratum[1].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[0].stratum[1].population[1].count == 0 assert ( inst.group[0].stratifier[0].stratum[1].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[0].stratum[1].population[2].count == 0 assert ( inst.group[0].stratifier[0].stratum[1].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[0].stratum[1].population[3].count == 0 assert inst.group[0].stratifier[0].stratum[1].value.text == "false" assert inst.group[0].stratifier[1].code[0].text == "stratifier-ages-10-plus" assert ( inst.group[0].stratifier[1].stratum[0].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[1].stratum[0].population[0].count == 0 assert ( inst.group[0].stratifier[1].stratum[0].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[1].stratum[0].population[1].count == 0 assert ( inst.group[0].stratifier[1].stratum[0].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[1].stratum[0].population[2].count == 0 assert ( inst.group[0].stratifier[1].stratum[0].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[1].stratum[0].population[3].count == 0 assert inst.group[0].stratifier[1].stratum[0].value.text == "true" assert ( inst.group[0].stratifier[1].stratum[1].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[1].stratum[1].population[0].count == 1 assert ( inst.group[0].stratifier[1].stratum[1].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[1].stratum[1].population[1].count == 1 assert ( inst.group[0].stratifier[1].stratum[1].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[1].stratum[1].population[2].count == 1 assert ( inst.group[0].stratifier[1].stratum[1].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[1].stratum[1].population[3].count == 0 assert inst.group[0].stratifier[1].stratum[1].value.text == "false" assert inst.group[0].stratifier[2].code[0].text == "stratifier-gender" assert ( inst.group[0].stratifier[2].stratum[0].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[2].stratum[0].population[0].count == 1 assert ( inst.group[0].stratifier[2].stratum[0].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[2].stratum[0].population[1].count == 1 assert ( inst.group[0].stratifier[2].stratum[0].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[2].stratum[0].population[2].count == 1 assert ( inst.group[0].stratifier[2].stratum[0].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[2].stratum[0].population[3].count == 0 assert inst.group[0].stratifier[2].stratum[0].value.text == "male" assert ( inst.group[0].stratifier[2].stratum[1].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[2].stratum[1].population[0].count == 0 assert ( inst.group[0].stratifier[2].stratum[1].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[2].stratum[1].population[1].count == 0 assert ( inst.group[0].stratifier[2].stratum[1].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[2].stratum[1].population[2].count == 0 assert ( inst.group[0].stratifier[2].stratum[1].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[2].stratum[1].population[3].count == 0 assert inst.group[0].stratifier[2].stratum[1].value.text == "female" assert ( inst.group[0].stratifier[2].stratum[2].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[2].stratum[2].population[0].count == 0 assert ( inst.group[0].stratifier[2].stratum[2].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[2].stratum[2].population[1].count == 0 assert ( inst.group[0].stratifier[2].stratum[2].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[2].stratum[2].population[2].count == 0 assert ( inst.group[0].stratifier[2].stratum[2].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[2].stratum[2].population[3].count == 0 assert inst.group[0].stratifier[2].stratum[2].value.text == "other" assert ( inst.group[0].stratifier[2].stratum[3].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[2].stratum[3].population[0].count == 0 assert ( inst.group[0].stratifier[2].stratum[3].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[2].stratum[3].population[1].count == 0 assert ( inst.group[0].stratifier[2].stratum[3].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[2].stratum[3].population[2].count == 0 assert ( inst.group[0].stratifier[2].stratum[3].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[2].stratum[3].population[3].count == 0 assert inst.group[0].stratifier[2].stratum[3].value.text == "unknown" assert inst.id == "measurereport-cms146-cat1-example" assert inst.identifier[0].value == "measurereport-cms146-cat1-example-2017-03-13" assert inst.measure == "http://example.org/fhir/Measure/CMS146" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-03-31"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-01-01"} ).valueDateTime ) assert inst.reporter.reference == "#reporter" assert inst.status == "complete" assert inst.subject.reference == "Patient/123" assert inst.text.status == "generated" assert inst.type == "individual" def test_measurereport_1(base_settings): """No. 1 tests collection for MeasureReport. Test File: measurereport-cms146-cat1-example.json """ filename = ( base_settings["unittest_data_dir"] / "measurereport-cms146-cat1-example.json" ) inst = measurereport.MeasureReport.model_validate_json(filename.read_bytes()) assert "MeasureReport" == inst.get_resource_type() impl_measurereport_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MeasureReport" == data["resourceType"] inst2 = measurereport.MeasureReport(**data) impl_measurereport_1(inst2) def impl_measurereport_2(inst): assert inst.contained[0].id == "patient-new" assert inst.group[0].code.coding[0].code == "QRPH_ADX_ART5_N" assert float(inst.group[0].measureScore.value) == float(1) assert inst.group[0].stratifier[0].code[0].coding[0].code == "AGE_GROUP:SEX" assert float(inst.group[0].stratifier[0].stratum[0].measureScore.value) == float(0) assert inst.group[0].stratifier[0].stratum[0].value.coding[0].code == "P0Y--P20Y:F" assert float(inst.group[0].stratifier[0].stratum[1].measureScore.value) == float(0) assert inst.group[0].stratifier[0].stratum[1].value.coding[0].code == "P0Y--P20Y:M" assert float(inst.group[0].stratifier[0].stratum[2].measureScore.value) == float(0) assert inst.group[0].stratifier[0].stratum[2].value.coding[0].code == "P20Y--P40Y:F" assert float(inst.group[0].stratifier[0].stratum[3].measureScore.value) == float(0) assert inst.group[0].stratifier[0].stratum[3].value.coding[0].code == "P20Y--P40Y:M" assert float(inst.group[0].stratifier[0].stratum[4].measureScore.value) == float(0) assert inst.group[0].stratifier[0].stratum[4].value.coding[0].code == "P40Y--P65Y:F" assert float(inst.group[0].stratifier[0].stratum[5].measureScore.value) == float(1) assert inst.group[0].stratifier[0].stratum[5].value.coding[0].code == "P40Y--P65Y:M" assert inst.id == "general-example-of-report" assert inst.measure == "http://ohie.org/Measure/hiv-indicators" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-12-31"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-01-01"} ).valueDateTime ) assert inst.status == "complete" assert inst.subject.reference == "#patient-new" assert inst.text.status == "generated" assert inst.type == "individual" def test_measurereport_2(base_settings): """No. 2 tests collection for MeasureReport. Test File: measurereport-general-example.json """ filename = base_settings["unittest_data_dir"] / "measurereport-general-example.json" inst = measurereport.MeasureReport.model_validate_json(filename.read_bytes()) assert "MeasureReport" == inst.get_resource_type() impl_measurereport_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MeasureReport" == data["resourceType"] inst2 = measurereport.MeasureReport(**data) impl_measurereport_2(inst2) def impl_measurereport_3(inst): assert inst.group[0].code.coding[0].code == "QRPH_ADX_ART1_N" assert float(inst.group[0].measureScore.value) == float(0) assert inst.group[0].stratifier[0].code[0].coding[0].code == "AGE_GROUP:SEX" assert float(inst.group[0].stratifier[0].stratum[0].measureScore.value) == float(0) assert inst.group[0].stratifier[0].stratum[0].value.coding[0].code == "P0Y--P1Y:F" assert float(inst.group[0].stratifier[0].stratum[1].measureScore.value) == float(0) assert inst.group[0].stratifier[0].stratum[1].value.coding[0].code == "P0Y--P1Y:M" assert float(inst.group[0].stratifier[0].stratum[2].measureScore.value) == float(0) assert inst.group[0].stratifier[0].stratum[2].value.coding[0].code == "P1Y--P5Y:F" assert float(inst.group[0].stratifier[0].stratum[3].measureScore.value) == float(0) assert inst.group[0].stratifier[0].stratum[3].value.coding[0].code == "P1Y--P5Y:M" assert float(inst.group[0].stratifier[0].stratum[4].measureScore.value) == float(0) assert inst.group[0].stratifier[0].stratum[4].value.coding[0].code == "P10Y--P15Y:F" assert float(inst.group[0].stratifier[0].stratum[5].measureScore.value) == float(0) assert inst.group[0].stratifier[0].stratum[5].value.coding[0].code == "P10Y--P15Y:M" assert inst.group[1].code.coding[0].code == "QRPH_ADX_ART1_N" assert float(inst.group[1].measureScore.value) == float(0) assert inst.group[1].stratifier[0].code[0].coding[0].code == "AGE_GROUP:SEX" assert float(inst.group[1].stratifier[0].stratum[0].measureScore.value) == float(0) assert inst.group[1].stratifier[0].stratum[0].value.coding[0].code == "P0Y--P1Y:F" assert float(inst.group[1].stratifier[0].stratum[1].measureScore.value) == float(0) assert inst.group[1].stratifier[0].stratum[1].value.coding[0].code == "P0Y--P1Y:M" assert float(inst.group[1].stratifier[0].stratum[2].measureScore.value) == float(0) assert inst.group[1].stratifier[0].stratum[2].value.coding[0].code == "P1Y--P5Y:F" assert float(inst.group[1].stratifier[0].stratum[3].measureScore.value) == float(0) assert inst.group[1].stratifier[0].stratum[3].value.coding[0].code == "P1Y--P5Y:M" assert float(inst.group[1].stratifier[0].stratum[4].measureScore.value) == float(0) assert inst.group[1].stratifier[0].stratum[4].value.coding[0].code == "P10Y--P15Y:F" assert float(inst.group[1].stratifier[0].stratum[5].measureScore.value) == float(0) assert inst.group[1].stratifier[0].stratum[5].value.coding[0].code == "P10Y--P15Y:M" assert inst.group[2].code.coding[0].code == "QRPH_ADX_ART1_N" assert float(inst.group[2].measureScore.value) == float(0) assert inst.group[2].stratifier[0].code[0].coding[0].code == "AGE_GROUP" assert inst.group[2].stratifier[0].code[1].coding[0].code == "SEX" assert ( inst.group[2].stratifier[0].stratum[0].component[0].code.coding[0].code == "AGE_GROUP" ) assert ( inst.group[2].stratifier[0].stratum[0].component[0].value.coding[0].code == "P0Y--P1Y" ) assert ( inst.group[2].stratifier[0].stratum[0].component[1].code.coding[0].code == "SEX" ) assert ( inst.group[2].stratifier[0].stratum[0].component[1].value.coding[0].code == "F" ) assert float(inst.group[2].stratifier[0].stratum[0].measureScore.value) == float(0) assert ( inst.group[2].stratifier[0].stratum[1].component[0].code.coding[0].code == "AGE_GROUP" ) assert ( inst.group[2].stratifier[0].stratum[1].component[0].value.coding[0].code == "P0Y--P1Y" ) assert ( inst.group[2].stratifier[0].stratum[1].component[1].code.coding[0].code == "SEX" ) assert ( inst.group[2].stratifier[0].stratum[1].component[1].value.coding[0].code == "M" ) assert float(inst.group[2].stratifier[0].stratum[1].measureScore.value) == float(0) assert ( inst.group[2].stratifier[0].stratum[2].component[0].code.coding[0].code == "AGE_GROUP" ) assert ( inst.group[2].stratifier[0].stratum[2].component[0].value.coding[0].code == "P1Y--P5Y" ) assert ( inst.group[2].stratifier[0].stratum[2].component[1].code.coding[0].code == "SEX" ) assert ( inst.group[2].stratifier[0].stratum[2].component[1].value.coding[0].code == "F" ) assert float(inst.group[2].stratifier[0].stratum[2].measureScore.value) == float(0) assert ( inst.group[2].stratifier[0].stratum[3].component[0].code.coding[0].code == "AGE_GROUP" ) assert ( inst.group[2].stratifier[0].stratum[3].component[0].value.coding[0].code == "P1Y--P5Y" ) assert ( inst.group[2].stratifier[0].stratum[3].component[1].code.coding[0].code == "SEX" ) assert ( inst.group[2].stratifier[0].stratum[3].component[1].value.coding[0].code == "F" ) assert float(inst.group[2].stratifier[0].stratum[3].measureScore.value) == float(0) assert inst.id == "hiv-indicators" assert inst.measure == "http://ohie.org/Measure/hiv-indicators" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-01-31"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-01-01"} ).valueDateTime ) assert inst.reporter.reference == "Organization/hl7" assert inst.status == "complete" assert inst.text.status == "generated" assert inst.type == "summary" def test_measurereport_3(base_settings): """No. 3 tests collection for MeasureReport. Test File: measurereport-hiv-indicators.json """ filename = base_settings["unittest_data_dir"] / "measurereport-hiv-indicators.json" inst = measurereport.MeasureReport.model_validate_json(filename.read_bytes()) assert "MeasureReport" == inst.get_resource_type() impl_measurereport_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MeasureReport" == data["resourceType"] inst2 = measurereport.MeasureReport(**data) impl_measurereport_3(inst2) def impl_measurereport_4(inst): assert inst.contained[0].id == "reporter" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-04-01"} ).valueDateTime ) assert inst.group[0].id == "CMS146-group-1" assert inst.group[0].population[0].code.coding[0].code == "initial-population" assert inst.group[0].population[0].count == 500 assert inst.group[0].population[1].code.coding[0].code == "numerator" assert inst.group[0].population[1].count == 200 assert inst.group[0].population[2].code.coding[0].code == "denominator" assert inst.group[0].population[2].count == 500 assert inst.group[0].population[3].code.coding[0].code == "denominator-exclusion" assert inst.group[0].population[3].count == 100 assert inst.group[0].stratifier[0].code[0].text == "stratifier-ages-up-to-9" assert ( inst.group[0].stratifier[0].stratum[0].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[0].stratum[0].population[0].count == 250 assert ( inst.group[0].stratifier[0].stratum[0].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[0].stratum[0].population[1].count == 100 assert ( inst.group[0].stratifier[0].stratum[0].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[0].stratum[0].population[2].count == 250 assert ( inst.group[0].stratifier[0].stratum[0].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[0].stratum[0].population[3].count == 50 assert inst.group[0].stratifier[0].stratum[0].value.text == "true" assert ( inst.group[0].stratifier[0].stratum[1].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[0].stratum[1].population[0].count == 250 assert ( inst.group[0].stratifier[0].stratum[1].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[0].stratum[1].population[1].count == 100 assert ( inst.group[0].stratifier[0].stratum[1].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[0].stratum[1].population[2].count == 250 assert ( inst.group[0].stratifier[0].stratum[1].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[0].stratum[1].population[3].count == 50 assert inst.group[0].stratifier[0].stratum[1].value.text == "false" assert inst.group[0].stratifier[1].code[0].text == "stratifier-ages-10-plus" assert ( inst.group[0].stratifier[1].stratum[0].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[1].stratum[0].population[0].count == 250 assert ( inst.group[0].stratifier[1].stratum[0].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[1].stratum[0].population[1].count == 100 assert ( inst.group[0].stratifier[1].stratum[0].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[1].stratum[0].population[2].count == 250 assert ( inst.group[0].stratifier[1].stratum[0].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[1].stratum[0].population[3].count == 50 assert inst.group[0].stratifier[1].stratum[0].value.text == "true" assert ( inst.group[0].stratifier[1].stratum[1].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[1].stratum[1].population[0].count == 250 assert ( inst.group[0].stratifier[1].stratum[1].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[1].stratum[1].population[1].count == 100 assert ( inst.group[0].stratifier[1].stratum[1].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[1].stratum[1].population[2].count == 250 assert ( inst.group[0].stratifier[1].stratum[1].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[1].stratum[1].population[3].count == 50 assert inst.group[0].stratifier[1].stratum[1].value.text == "false" assert inst.group[0].stratifier[2].code[0].text == "stratifier-gender" assert ( inst.group[0].stratifier[2].stratum[0].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[2].stratum[0].population[0].count == 250 assert ( inst.group[0].stratifier[2].stratum[0].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[2].stratum[0].population[1].count == 100 assert ( inst.group[0].stratifier[2].stratum[0].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[2].stratum[0].population[2].count == 250 assert ( inst.group[0].stratifier[2].stratum[0].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[2].stratum[0].population[3].count == 50 assert inst.group[0].stratifier[2].stratum[0].value.text == "male" assert ( inst.group[0].stratifier[2].stratum[1].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[2].stratum[1].population[0].count == 250 assert ( inst.group[0].stratifier[2].stratum[1].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[2].stratum[1].population[1].count == 100 assert ( inst.group[0].stratifier[2].stratum[1].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[2].stratum[1].population[2].count == 250 assert ( inst.group[0].stratifier[2].stratum[1].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[2].stratum[1].population[3].count == 50 assert inst.group[0].stratifier[2].stratum[1].value.text == "female" assert ( inst.group[0].stratifier[2].stratum[2].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[2].stratum[2].population[0].count == 0 assert ( inst.group[0].stratifier[2].stratum[2].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[2].stratum[2].population[1].count == 0 assert ( inst.group[0].stratifier[2].stratum[2].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[2].stratum[2].population[2].count == 0 assert ( inst.group[0].stratifier[2].stratum[2].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[2].stratum[2].population[3].count == 0 assert inst.group[0].stratifier[2].stratum[2].value.text == "other" assert ( inst.group[0].stratifier[2].stratum[3].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[2].stratum[3].population[0].count == 0 assert ( inst.group[0].stratifier[2].stratum[3].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[2].stratum[3].population[1].count == 0 assert ( inst.group[0].stratifier[2].stratum[3].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[2].stratum[3].population[2].count == 0 assert ( inst.group[0].stratifier[2].stratum[3].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[2].stratum[3].population[3].count == 0 assert inst.group[0].stratifier[2].stratum[3].value.text == "unknown" assert inst.id == "measurereport-cms146-cat3-example" assert inst.identifier[0].value == "measurereport-cms146-cat3-example-2017-03-13" assert inst.measure == "http://example.org/fhir/Measure/CMS146" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-03-31"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-01-01"} ).valueDateTime ) assert inst.reporter.reference == "#reporter" assert inst.status == "complete" assert inst.text.status == "generated" assert inst.type == "summary" def test_measurereport_4(base_settings): """No. 4 tests collection for MeasureReport. Test File: measurereport-cms146-cat3-example.json """ filename = ( base_settings["unittest_data_dir"] / "measurereport-cms146-cat3-example.json" ) inst = measurereport.MeasureReport.model_validate_json(filename.read_bytes()) assert "MeasureReport" == inst.get_resource_type() impl_measurereport_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MeasureReport" == data["resourceType"] inst2 = measurereport.MeasureReport(**data) impl_measurereport_4(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_media.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Media Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import media from .conftest import ExternalValidatorModel # noqa: F401 def impl_media_1(inst): assert inst.content.contentType == "image/gif" assert ( inst.content.creation == ExternalValidatorModel.model_validate( {"valueDateTime": "2009-09-03"} ).valueDateTime ) assert inst.content.id == "a1" assert ( inst.createdDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-12-17"} ).valueDateTime ) assert inst.device.display == "Acme Camera" assert inst.frames == 1 assert inst.height == 145 assert inst.id == "example" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueInstant": "2017-12-17T14:56:18Z"} ).valueInstant ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.modality.coding[0].code == "diagram" assert ( inst.modality.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/media-modality"} ).valueUri ) assert inst.operator.reference == "Practitioner/xcda-author" assert inst.status == "completed" assert inst.subject.reference == "Patient/xcda" assert inst.text.status == "generated" assert inst.type.coding[0].code == "image" assert inst.type.coding[0].display == "Image" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/media-type"} ).valueUri ) assert inst.width == 126 def test_media_1(base_settings): """No. 1 tests collection for Media. Test File: media-example.json """ filename = base_settings["unittest_data_dir"] / "media-example.json" inst = media.Media.model_validate_json(filename.read_bytes()) assert "Media" == inst.get_resource_type() impl_media_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Media" == data["resourceType"] inst2 = media.Media(**data) impl_media_1(inst2) def impl_media_2(inst): assert inst.content.contentType == "application/dicom" assert inst.device.display == "G.E. Medical Systems" assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://nema.org/fhir/extensions#0002-0010"} ).valueUri ) assert ( inst.extension[0].valueUri == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.2.840.10008.1.2.1"} ).valueUri ) assert inst.height == 480 assert inst.id == "1.2.840.11361907579238403408700.3.1.04.19970327150033" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate({"valueUri": "urn:dicom:uid"}).valueUri ) assert inst.identifier[0].type.text == "InstanceUID" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == ( "urn:oid:1.2.840.11361907579238403408700.3.1.04.1997032715003" "3" ) assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme-imaging.com/accession/2012"} ).valueUri ) assert inst.identifier[1].type.text == "accessionNo" assert inst.identifier[1].value == "1234567" assert ( inst.identifier[2].system == ExternalValidatorModel.model_validate({"valueUri": "urn:dicom:uid"}).valueUri ) assert inst.identifier[2].type.text == "studyId" assert ( inst.identifier[2].value == "urn:oid:1.2.840.113619.2.21.848.34082.0.538976288.3" ) assert ( inst.identifier[3].system == ExternalValidatorModel.model_validate({"valueUri": "urn:dicom:uid"}).valueUri ) assert inst.identifier[3].type.text == "seriesId" assert ( inst.identifier[3].value == "urn:oid:1.2.840.113619.2.21.3408.700.0.757923840.3.0" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.modality.coding[0].code == "US" assert ( inst.modality.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" assert inst.view.coding[0].code == "399067008" assert inst.view.coding[0].display == "Lateral projection" assert ( inst.view.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.width == 640 def test_media_2(base_settings): """No. 2 tests collection for Media. Test File: media-example-dicom.json """ filename = base_settings["unittest_data_dir"] / "media-example-dicom.json" inst = media.Media.model_validate_json(filename.read_bytes()) assert "Media" == inst.get_resource_type() impl_media_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Media" == data["resourceType"] inst2 = media.Media(**data) impl_media_2(inst2) def impl_media_3(inst): assert inst.basedOn[0].identifier.assigner.display == "XYZ Medical Clinic" assert ( inst.basedOn[0].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://someclinic.org/fhir/NamingSystem/imaging-orders"} ).valueUri ) assert inst.basedOn[0].identifier.value == "111222" assert inst.bodySite.coding[0].code == "85151006" assert inst.bodySite.coding[0].display == "Structure of left hand (body structure)" assert ( inst.bodySite.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.content.contentType == "image/jpeg" assert ( inst.content.creation == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-03-15"} ).valueDateTime ) assert inst.content.id == "a1" assert ( inst.content.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://someimagingcenter.org/fhir/Binary/A12345"} ).valueUrl ) assert ( inst.createdDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-03-15"} ).valueDateTime ) assert inst.encounter.reference == "Encounter/example" assert inst.height == 432 assert inst.id == "xray" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.modality.coding[0].code == "39714003" assert inst.modality.coding[0].display == "Skeletal X-ray of wrist and hand" assert ( inst.modality.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Xray of left ' "hand for Patient Henry Levin (MRN 12345) 2016-03-15
" ) assert inst.text.status == "generated" assert inst.width == 640 def test_media_3(base_settings): """No. 3 tests collection for Media. Test File: media-example-xray.json """ filename = base_settings["unittest_data_dir"] / "media-example-xray.json" inst = media.Media.model_validate_json(filename.read_bytes()) assert "Media" == inst.get_resource_type() impl_media_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Media" == data["resourceType"] inst2 = media.Media(**data) impl_media_3(inst2) def impl_media_4(inst): assert inst.content.contentType == "audio/mpeg" assert ( inst.content.data == ExternalValidatorModel.model_validate( {"valueBase64Binary": "dG9vIGJpZyB0b28gaW5jbHVkZSB0aGUgd2hvbGU="} ).valueBase64Binary ) assert inst.content.id == "a1" assert float(inst.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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.operator.reference == "Practitioner/xcda-author" assert inst.status == "completed" assert inst.subject.reference == "Patient/xcda" assert inst.text.div == ( '
Sound recording ' "of speech example for Patient Henry Levin (MRN " '12345):
diagram
' ) assert inst.text.status == "generated" def test_media_4(base_settings): """No. 4 tests collection for Media. Test File: media-example-sound.json """ filename = base_settings["unittest_data_dir"] / "media-example-sound.json" inst = media.Media.model_validate_json(filename.read_bytes()) assert "Media" == inst.get_resource_type() impl_media_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Media" == data["resourceType"] inst2 = media.Media(**data) impl_media_4(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_medication.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Medication Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import medication from .conftest import ExternalValidatorModel # noqa: F401 def impl_medication_1(inst): assert ( inst.batch.expirationDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-31"} ).valueDateTime ) assert inst.batch.lotNumber == "12345" assert inst.code.coding[0].code == "0169-7501-11" assert inst.code.coding[0].display == "Novolog 100u/ml" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/ndc"} ).valueUri ) assert inst.contained[0].id == "org3" assert inst.form.coding[0].code == "385219001" assert inst.form.coding[0].display == "Injection solution (qualifier value)" assert ( inst.form.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "med0307" assert inst.ingredient[0].itemCodeableConcept.coding[0].code == "325072002" assert ( inst.ingredient[0].itemCodeableConcept.coding[0].display == "Insulin Aspart (substance)" ) assert ( inst.ingredient[0].itemCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.ingredient[0].strength.denominator.code == "mL" assert ( inst.ingredient[0].strength.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[0].strength.denominator.value) == float(1) assert inst.ingredient[0].strength.numerator.code == "U" assert ( inst.ingredient[0].strength.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[0].strength.numerator.value) == float(100) assert inst.manufacturer.reference == "#org3" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_medication_1(base_settings): """No. 1 tests collection for Medication. Test File: medicationexample0307.json """ filename = base_settings["unittest_data_dir"] / "medicationexample0307.json" inst = medication.Medication.model_validate_json(filename.read_bytes()) assert "Medication" == inst.get_resource_type() impl_medication_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Medication" == data["resourceType"] inst2 = medication.Medication(**data) impl_medication_1(inst2) def impl_medication_2(inst): assert inst.code.coding[0].code == "373994007" assert inst.code.coding[0].display == "Prednisone 5mg tablet (Product)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.contained[0].id == "sub03" assert inst.form.coding[0].code == "385055001" assert inst.form.coding[0].display == "Tablet dose form (qualifier value)" assert ( inst.form.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "med0311" assert inst.ingredient[0].itemReference.reference == "#sub03" assert inst.ingredient[0].strength.denominator.code == "TAB" assert ( inst.ingredient[0].strength.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert float(inst.ingredient[0].strength.denominator.value) == float(1) assert inst.ingredient[0].strength.numerator.code == "mg" assert ( inst.ingredient[0].strength.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[0].strength.numerator.value) == float(5) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_medication_2(base_settings): """No. 2 tests collection for Medication. Test File: medicationexample0311.json """ filename = base_settings["unittest_data_dir"] / "medicationexample0311.json" inst = medication.Medication.model_validate_json(filename.read_bytes()) assert "Medication" == inst.get_resource_type() impl_medication_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Medication" == data["resourceType"] inst2 = medication.Medication(**data) impl_medication_2(inst2) def impl_medication_3(inst): assert inst.code.coding[0].code == "430127000" assert inst.code.coding[0].display == "Oral Form Oxycodone (product)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.contained[0].id == "sub03" assert inst.form.coding[0].code == "385055001" assert inst.form.coding[0].display == "Tablet dose form (qualifier value)" assert ( inst.form.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "med0310" assert inst.ingredient[0].itemReference.reference == "#sub03" assert inst.ingredient[0].strength.denominator.code == "TAB" assert ( inst.ingredient[0].strength.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert float(inst.ingredient[0].strength.denominator.value) == float(1) assert inst.ingredient[0].strength.numerator.code == "mg" assert ( inst.ingredient[0].strength.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[0].strength.numerator.value) == float(5) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_medication_3(base_settings): """No. 3 tests collection for Medication. Test File: medicationexample0310.json """ filename = base_settings["unittest_data_dir"] / "medicationexample0310.json" inst = medication.Medication.model_validate_json(filename.read_bytes()) assert "Medication" == inst.get_resource_type() impl_medication_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Medication" == data["resourceType"] inst2 = medication.Medication(**data) impl_medication_3(inst2) def impl_medication_4(inst): assert ( inst.batch.expirationDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-31"} ).valueDateTime ) assert inst.batch.lotNumber == "12345" assert inst.code.coding[0].code == "51144-050-01" assert inst.code.coding[0].display == "Adcetris" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/ndc"} ).valueUri ) assert inst.contained[0].id == "org3" assert inst.form.coding[0].code == "421637006" assert ( inst.form.coding[0].display == "Lyophilized powder for injectable solution (qualifier value)" ) assert ( inst.form.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "med0306" assert inst.manufacturer.reference == "#org3" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_medication_4(base_settings): """No. 4 tests collection for Medication. Test File: medicationexample0306.json """ filename = base_settings["unittest_data_dir"] / "medicationexample0306.json" inst = medication.Medication.model_validate_json(filename.read_bytes()) assert "Medication" == inst.get_resource_type() impl_medication_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Medication" == data["resourceType"] inst2 = medication.Medication(**data) impl_medication_4(inst2) def impl_medication_5(inst): assert ( inst.batch.expirationDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-05-22"} ).valueDateTime ) assert inst.batch.lotNumber == "9494788" assert inst.code.coding[0].code == "0409-6531-02" assert ( inst.code.coding[0].display == "Vancomycin Hydrochloride (VANCOMYCIN HYDROCHLORIDE)" ) assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/ndc"} ).valueUri ) assert inst.contained[0].id == "org4" assert inst.form.coding[0].code == "385219001" assert inst.form.coding[0].display == "Injection Solution (qualifier value)" assert ( inst.form.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "med0301" assert inst.ingredient[0].isActive is True assert inst.ingredient[0].itemCodeableConcept.coding[0].code == "66955" assert ( inst.ingredient[0].itemCodeableConcept.coding[0].display == "Vancomycin Hydrochloride" ) assert ( inst.ingredient[0].itemCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.ingredient[0].strength.denominator.code == "mL" assert ( inst.ingredient[0].strength.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[0].strength.denominator.value) == float(10) assert inst.ingredient[0].strength.numerator.code == "mg" assert ( inst.ingredient[0].strength.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[0].strength.numerator.value) == float(500) assert inst.manufacturer.reference == "#org4" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "active" assert inst.text.status == "generated" def test_medication_5(base_settings): """No. 5 tests collection for Medication. Test File: medicationexample0301.json """ filename = base_settings["unittest_data_dir"] / "medicationexample0301.json" inst = medication.Medication.model_validate_json(filename.read_bytes()) assert "Medication" == inst.get_resource_type() impl_medication_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Medication" == data["resourceType"] inst2 = medication.Medication(**data) impl_medication_5(inst2) def impl_medication_6(inst): assert inst.form.coding[0].code == "385219001" assert inst.form.coding[0].display == "Injection Solution (qualifier value)" assert ( inst.form.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.form.text == "Injection Solution (qualifier value)" assert inst.id == "med0317" assert inst.ingredient[0].itemCodeableConcept.coding[0].code == "204520" assert ( inst.ingredient[0].itemCodeableConcept.coding[0].display == "Potassium Chloride" ) assert ( inst.ingredient[0].itemCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.ingredient[0].strength.denominator.code == "mL" assert ( inst.ingredient[0].strength.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[0].strength.denominator.value) == float(1) assert inst.ingredient[0].strength.numerator.code == "meq" assert ( inst.ingredient[0].strength.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[0].strength.numerator.value) == float(2) assert inst.ingredient[1].itemCodeableConcept.coding[0].code == "313002" assert ( inst.ingredient[1].itemCodeableConcept.coding[0].display == "Sodium Chloride 0.9% injectable solution" ) assert ( inst.ingredient[1].itemCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.ingredient[1].strength.denominator.code == "mL" assert ( inst.ingredient[1].strength.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[1].strength.denominator.value) == float(100) assert inst.ingredient[1].strength.numerator.code == "g" assert ( inst.ingredient[1].strength.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[1].strength.numerator.value) == float(0.9) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_medication_6(base_settings): """No. 6 tests collection for Medication. Test File: medicationexample0317.json """ filename = base_settings["unittest_data_dir"] / "medicationexample0317.json" inst = medication.Medication.model_validate_json(filename.read_bytes()) assert "Medication" == inst.get_resource_type() impl_medication_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Medication" == data["resourceType"] inst2 = medication.Medication(**data) impl_medication_6(inst2) def impl_medication_7(inst): assert inst.code.text == "Amoxicillin 250mg/5ml Suspension" assert inst.id == "medicationexample1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.div == ( '
Amoxicillin ' "250mg/5ml Suspension
" ) assert inst.text.status == "generated" def test_medication_7(base_settings): """No. 7 tests collection for Medication. Test File: medicationexample1.json """ filename = base_settings["unittest_data_dir"] / "medicationexample1.json" inst = medication.Medication.model_validate_json(filename.read_bytes()) assert "Medication" == inst.get_resource_type() impl_medication_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Medication" == data["resourceType"] inst2 = medication.Medication(**data) impl_medication_7(inst2) def impl_medication_8(inst): assert ( inst.batch.expirationDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-05-22"} ).valueDateTime ) assert inst.batch.lotNumber == "9494788" assert inst.code.coding[0].code == "213293" assert inst.code.coding[0].display == "Capecitabine 500mg oral tablet (Xeloda)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.contained[0].id == "org2" assert inst.contained[1].id == "sub04" assert inst.form.coding[0].code == "385055001" assert inst.form.coding[0].display == "Tablet dose form (qualifier value)" assert ( inst.form.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "medexample015" assert inst.ingredient[0].itemReference.reference == "#sub04" assert inst.ingredient[0].strength.denominator.code == "TAB" assert ( inst.ingredient[0].strength.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert float(inst.ingredient[0].strength.denominator.value) == float(1) assert inst.ingredient[0].strength.numerator.code == "mg" assert ( inst.ingredient[0].strength.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[0].strength.numerator.value) == float(500) assert inst.manufacturer.reference == "#org2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_medication_8(base_settings): """No. 8 tests collection for Medication. Test File: medicationexample15.json """ filename = base_settings["unittest_data_dir"] / "medicationexample15.json" inst = medication.Medication.model_validate_json(filename.read_bytes()) assert "Medication" == inst.get_resource_type() impl_medication_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Medication" == data["resourceType"] inst2 = medication.Medication(**data) impl_medication_8(inst2) def impl_medication_9(inst): assert inst.code.coding[0].code == "108761006" assert inst.code.coding[0].display == "Capecitabine (product)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.contained[0].id == "sub03" assert inst.form.coding[0].code == "385055001" assert inst.form.coding[0].display == "Tablet dose form (qualifier value)" assert ( inst.form.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "med0321" assert inst.ingredient[0].itemReference.reference == "#sub03" assert inst.ingredient[0].strength.denominator.code == "385055001" assert ( inst.ingredient[0].strength.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.ingredient[0].strength.denominator.unit == "Tablet" assert float(inst.ingredient[0].strength.denominator.value) == float(1) assert inst.ingredient[0].strength.numerator.code == "mg" assert ( inst.ingredient[0].strength.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[0].strength.numerator.value) == float(500) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_medication_9(base_settings): """No. 9 tests collection for Medication. Test File: medicationexample0321.json """ filename = base_settings["unittest_data_dir"] / "medicationexample0321.json" inst = medication.Medication.model_validate_json(filename.read_bytes()) assert "Medication" == inst.get_resource_type() impl_medication_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Medication" == data["resourceType"] inst2 = medication.Medication(**data) impl_medication_9(inst2) def impl_medication_10(inst): assert inst.code.coding[0].code == "324252006" assert inst.code.coding[0].display == "Azithromycin 250mg capsule (product)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.contained[0].id == "sub03" assert inst.form.coding[0].code == "385055001" assert inst.form.coding[0].display == "Tablet dose form (qualifier value)" assert ( inst.form.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "med0320" assert inst.ingredient[0].itemReference.reference == "#sub03" assert inst.ingredient[0].strength.denominator.code == "TAB" assert ( inst.ingredient[0].strength.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert float(inst.ingredient[0].strength.denominator.value) == float(1) assert inst.ingredient[0].strength.numerator.code == "mg" assert ( inst.ingredient[0].strength.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[0].strength.numerator.value) == float(250) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_medication_10(base_settings): """No. 10 tests collection for Medication. Test File: medicationexample0320.json """ filename = base_settings["unittest_data_dir"] / "medicationexample0320.json" inst = medication.Medication.model_validate_json(filename.read_bytes()) assert "Medication" == inst.get_resource_type() impl_medication_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Medication" == data["resourceType"] inst2 = medication.Medication(**data) impl_medication_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_medicationadministration.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/MedicationAdministration Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import medicationadministration from .conftest import ExternalValidatorModel # noqa: F401 def impl_medicationadministration_1(inst): assert inst.contained[0].id == "med0301" assert inst.contained[1].id == "signature" assert inst.context.display == "encounter who leads to this prescription" assert inst.context.reference == "Encounter/f001" assert inst.dosage.dose.code == "mg" assert ( inst.dosage.dose.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage.dose.unit == "mg" assert float(inst.dosage.dose.value) == float(500) assert inst.dosage.method.text == "IV Push" assert inst.dosage.route.coding[0].code == "47625008" assert inst.dosage.route.coding[0].display == "Intravenous route (qualifier value)" assert ( inst.dosage.route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage.text == "500mg IV q6h x 3 days" assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T14:30:00+01:00"} ).valueDateTime ) assert inst.eventHistory[0].display == "Author's Signature" assert inst.eventHistory[0].reference == "#signature" assert inst.id == "medadmin0301" assert inst.medicationReference.reference == "#med0301" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.display == "Patrick Pump" assert inst.performer[0].actor.reference == "Practitioner/f007" assert inst.reasonCode[0].coding[0].code == "b" assert inst.reasonCode[0].coding[0].display == "Given as Ordered" assert ( inst.reasonCode[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/reason-medication-given" } ).valueUri ) assert inst.request.reference == "MedicationRequest/medrx0318" assert inst.status == "in-progress" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationadministration_1(base_settings): """No. 1 tests collection for MedicationAdministration. Test File: medicationadministration0301.json """ filename = base_settings["unittest_data_dir"] / "medicationadministration0301.json" inst = medicationadministration.MedicationAdministration.model_validate_json( filename.read_bytes() ) assert "MedicationAdministration" == inst.get_resource_type() impl_medicationadministration_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationAdministration" == data["resourceType"] inst2 = medicationadministration.MedicationAdministration(**data) impl_medicationadministration_1(inst2) def impl_medicationadministration_2(inst): assert inst.contained[0].id == "med0303" assert inst.context.reference == "Encounter/f001" assert ( inst.effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T14:30:00+01:00"} ).valueDateTime ) assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T14:30:00+01:00"} ).valueDateTime ) assert inst.id == "medadminexample03" assert inst.medicationReference.reference == "#med0303" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == ( "Patient started Bupropion this morning - will administer in " "a reduced dose tomorrow" ) assert inst.request.reference == "MedicationRequest/medrx0317" assert inst.status == "on-hold" assert inst.statusReason[0].coding[0].code == "373147003" assert inst.statusReason[0].coding[0].display == ( "Administration of medication not done due to a " "contraindication (situation)" ) assert ( inst.statusReason[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.supportingInformation[0].reference == "Condition/f204" assert inst.text.status == "generated" def test_medicationadministration_2(base_settings): """No. 2 tests collection for MedicationAdministration. Test File: medicationadministrationexample3.json """ filename = ( base_settings["unittest_data_dir"] / "medicationadministrationexample3.json" ) inst = medicationadministration.MedicationAdministration.model_validate_json( filename.read_bytes() ) assert "MedicationAdministration" == inst.get_resource_type() impl_medicationadministration_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationAdministration" == data["resourceType"] inst2 = medicationadministration.MedicationAdministration(**data) impl_medicationadministration_2(inst2) def impl_medicationadministration_3(inst): assert inst.contained[0].id == "med0313" assert inst.context.display == "encounter who leads to this prescription" assert inst.context.reference == "Encounter/f001" assert inst.device[0].reference == "Device/f001" assert inst.dosage.dose.code == "mg" assert ( inst.dosage.dose.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage.dose.unit == "mg" assert float(inst.dosage.dose.value) == float(7) assert inst.dosage.method.coding[0].code == "420620005" assert ( inst.dosage.method.coding[0].display == "Push - dosing instruction imperative (qualifier value)" ) assert ( inst.dosage.method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage.rateQuantity.code == "min" assert ( inst.dosage.rateQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage.rateQuantity.unit == "min" assert float(inst.dosage.rateQuantity.value) == float(4) assert inst.dosage.route.coding[0].code == "255560000" assert inst.dosage.route.coding[0].display == "Intravenous" assert ( inst.dosage.route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage.text == ( "0.05 - 0.1mg/kg IV over 2-5 minutes every 15 minutes as " "needed" ) assert ( inst.effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T14:30:00+01:00"} ).valueDateTime ) assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T04:30:00+01:00"} ).valueDateTime ) assert inst.id == "medadmin0307" assert inst.medicationReference.reference == "#med0313" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.display == "Patrick Pump" assert inst.performer[0].actor.reference == "Practitioner/f007" assert inst.performer[0].function.coding[0].code == "performer" assert inst.performer[0].function.coding[0].display == "Performer" assert ( inst.performer[0].function.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/med-admin-perform-function" } ).valueUri ) assert inst.request.reference == "MedicationRequest/medrx0315" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationadministration_3(base_settings): """No. 3 tests collection for MedicationAdministration. Test File: medicationadministration0307.json """ filename = base_settings["unittest_data_dir"] / "medicationadministration0307.json" inst = medicationadministration.MedicationAdministration.model_validate_json( filename.read_bytes() ) assert "MedicationAdministration" == inst.get_resource_type() impl_medicationadministration_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationAdministration" == data["resourceType"] inst2 = medicationadministration.MedicationAdministration(**data) impl_medicationadministration_3(inst2) def impl_medicationadministration_4(inst): assert inst.contained[0].id == "med0304" assert inst.dosage.dose.code == "TAB" assert ( inst.dosage.dose.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosage.dose.unit == "TAB" assert float(inst.dosage.dose.value) == float(1) assert inst.dosage.route.coding[0].code == "26643006" assert inst.dosage.route.coding[0].display == "Oral Route" assert ( inst.dosage.route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage.text == ( "0.25mg PO every 6-12 hours as needed for menses from Jan " "15-20, 2015. Do not exceed more than 4mg per day" ) assert ( inst.effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-16T02:03:00+01:00"} ).valueDateTime ) assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T22:03:00+01:00"} ).valueDateTime ) assert inst.id == "medadmin0311" assert inst.medicationReference.reference == "#med0304" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.display == "Patrick Pump" assert inst.performer[0].actor.reference == "Practitioner/f007" assert inst.reasonCode[0].coding[0].code == "266599000" assert inst.reasonCode[0].coding[0].display == "Dysmenorrhea" assert ( inst.reasonCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.request.reference == "MedicationRequest/medrx0305" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationadministration_4(base_settings): """No. 4 tests collection for MedicationAdministration. Test File: medicationadministration0311.json """ filename = base_settings["unittest_data_dir"] / "medicationadministration0311.json" inst = medicationadministration.MedicationAdministration.model_validate_json( filename.read_bytes() ) assert "MedicationAdministration" == inst.get_resource_type() impl_medicationadministration_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationAdministration" == data["resourceType"] inst2 = medicationadministration.MedicationAdministration(**data) impl_medicationadministration_4(inst2) def impl_medicationadministration_5(inst): assert inst.contained[0].id == "med0304" assert inst.dosage.dose.code == "mg" assert ( inst.dosage.dose.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage.dose.unit == "mg" assert float(inst.dosage.dose.value) == float(6) assert inst.dosage.route.coding[0].code == "26643006" assert inst.dosage.route.coding[0].display == "Oral route (qualifier value)" assert ( inst.dosage.route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage.text == ( "6 mg PO daily for remission induction; adjust dosage to " "white blood cell (WBC) count. With hold treatment if WBC is" " less than 15,000/µL; resume when WBC is greater than " "50,000/µL" ) assert ( inst.effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-16T02:03:00+01:00"} ).valueDateTime ) assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T22:03:00+01:00"} ).valueDateTime ) assert inst.id == "medadmin0310" assert inst.medicationReference.reference == "#med0304" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.display == "Patrick Pump" assert inst.performer[0].actor.reference == "Practitioner/f007" assert inst.request.reference == "MedicationRequest/medrx0306" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationadministration_5(base_settings): """No. 5 tests collection for MedicationAdministration. Test File: medicationadministration0310.json """ filename = base_settings["unittest_data_dir"] / "medicationadministration0310.json" inst = medicationadministration.MedicationAdministration.model_validate_json( filename.read_bytes() ) assert "MedicationAdministration" == inst.get_resource_type() impl_medicationadministration_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationAdministration" == data["resourceType"] inst2 = medicationadministration.MedicationAdministration(**data) impl_medicationadministration_5(inst2) def impl_medicationadministration_6(inst): assert inst.contained[0].id == "med0306" assert inst.context.display == "encounter who leads to this prescription" assert inst.context.reference == "Encounter/f001" assert inst.dosage.dose.code == "TAB" assert ( inst.dosage.dose.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosage.dose.unit == "TAB" assert float(inst.dosage.dose.value) == float(2) assert inst.dosage.method.coding[0].code == "421521009" assert ( inst.dosage.method.coding[0].display == "Swallow - dosing instruction imperative (qualifier value)" ) assert ( inst.dosage.method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage.route.coding[0].code == "26643006" assert inst.dosage.route.coding[0].display == "Oral Route" assert ( inst.dosage.route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage.text == "Two tablets at once" assert ( inst.effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T14:30:00+01:00"} ).valueDateTime ) assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T04:30:00+01:00"} ).valueDateTime ) assert inst.id == "medadmin0306" assert inst.medicationReference.reference == "#med0306" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.display == "Patrick Pump" assert inst.performer[0].actor.reference == "Practitioner/f007" assert inst.performer[0].function.coding[0].code == "performer" assert inst.performer[0].function.coding[0].display == "Performer" assert ( inst.performer[0].function.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/med-admin-perform-function" } ).valueUri ) assert inst.request.reference == "MedicationRequest/medrx0302" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationadministration_6(base_settings): """No. 6 tests collection for MedicationAdministration. Test File: medicationadministration0306.json """ filename = base_settings["unittest_data_dir"] / "medicationadministration0306.json" inst = medicationadministration.MedicationAdministration.model_validate_json( filename.read_bytes() ) assert "MedicationAdministration" == inst.get_resource_type() impl_medicationadministration_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationAdministration" == data["resourceType"] inst2 = medicationadministration.MedicationAdministration(**data) impl_medicationadministration_6(inst2) def impl_medicationadministration_7(inst): assert inst.contained[0].id == "med0318" assert inst.device[0].reference == "Device/f001" assert inst.dosage.dose.code == "mL" assert ( inst.dosage.dose.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage.dose.unit == "mL" assert float(inst.dosage.dose.value) == float(1000) assert inst.dosage.method.text == "PICC line" assert inst.dosage.rateRatio.denominator.code == "h" assert ( inst.dosage.rateRatio.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage.rateRatio.denominator.unit == "h" assert float(inst.dosage.rateRatio.denominator.value) == float(1) assert inst.dosage.rateRatio.numerator.code == "mL" assert ( inst.dosage.rateRatio.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage.rateRatio.numerator.unit == "mL" assert float(inst.dosage.rateRatio.numerator.value) == float(50) assert inst.dosage.route.coding[0].code == "255560000" assert inst.dosage.route.coding[0].display == "Intravenous" assert ( inst.dosage.route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage.site.coding[0].code == "6073002" assert ( inst.dosage.site.coding[0].display == "Structure of ligament of left superior vena cava" ) assert ( inst.dosage.site.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.dosage.text == "1000mL infused at 50ml/hour for 4 hours - hung at 2200 hours" ) assert ( inst.effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-16T02:03:00+01:00"} ).valueDateTime ) assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T22:03:00+01:00"} ).valueDateTime ) assert inst.id == "medadmin0309" assert inst.medicationReference.reference == "#med0318" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.display == "Patrick Pump" assert inst.performer[0].actor.reference == "Practitioner/f007" assert inst.performer[0].function.coding[0].code == "performer" assert inst.performer[0].function.coding[0].display == "Performer" assert ( inst.performer[0].function.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/med-admin-perform-function" } ).valueUri ) assert inst.request.reference == "MedicationRequest/medrx0323" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationadministration_7(base_settings): """No. 7 tests collection for MedicationAdministration. Test File: medicationadministration0309.json """ filename = base_settings["unittest_data_dir"] / "medicationadministration0309.json" inst = medicationadministration.MedicationAdministration.model_validate_json( filename.read_bytes() ) assert "MedicationAdministration" == inst.get_resource_type() impl_medicationadministration_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationAdministration" == data["resourceType"] inst2 = medicationadministration.MedicationAdministration(**data) impl_medicationadministration_7(inst2) def impl_medicationadministration_8(inst): assert inst.dosage.dose.code == "mg" assert ( inst.dosage.dose.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage.dose.unit == "mg" assert float(inst.dosage.dose.value) == float(240) assert inst.dosage.site.coding[0].code == "34402009" assert inst.dosage.site.coding[0].display == "Rectum structure" assert ( inst.dosage.site.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage.text == ( "Insert one suppository rectally twice daily as needed for " "fever to a maximim of 3 per day" ) assert ( inst.effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-16T02:03:00+01:00"} ).valueDateTime ) assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T22:03:00+01:00"} ).valueDateTime ) assert inst.id == "medadmin0313" assert inst.medicationCodeableConcept.coding[0].code == "322254008" assert ( inst.medicationCodeableConcept.coding[0].display == "Paracetamol 240mg suppository (product)" ) assert ( inst.medicationCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.display == "Patrick Pump" assert inst.performer[0].actor.reference == "Practitioner/f007" assert inst.reasonCode[0].coding[0].code == "c" assert inst.reasonCode[0].coding[0].display == "Emergency" assert ( inst.reasonCode[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/reason-medication-given" } ).valueUri ) assert inst.request.reference == "MedicationRequest/medrx0324" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationadministration_8(base_settings): """No. 8 tests collection for MedicationAdministration. Test File: medicationadministration0313.json """ filename = base_settings["unittest_data_dir"] / "medicationadministration0313.json" inst = medicationadministration.MedicationAdministration.model_validate_json( filename.read_bytes() ) assert "MedicationAdministration" == inst.get_resource_type() impl_medicationadministration_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationAdministration" == data["resourceType"] inst2 = medicationadministration.MedicationAdministration(**data) impl_medicationadministration_8(inst2) def impl_medicationadministration_9(inst): assert inst.contained[0].id == "med0306" assert inst.context.display == "encounter who leads to this prescription" assert inst.context.reference == "Encounter/f001" assert inst.dosage.dose.code == "mg/kg" assert ( inst.dosage.dose.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage.dose.unit == "mg/kg" assert float(inst.dosage.dose.value) == float(1.8) assert inst.dosage.rateQuantity.code == "min" assert ( inst.dosage.rateQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage.rateQuantity.unit == "min" assert float(inst.dosage.rateQuantity.value) == float(20) assert inst.dosage.route.coding[0].code == "255560000" assert inst.dosage.route.coding[0].display == "Intravenous" assert ( inst.dosage.route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage.text == "1.8 mg/kg IV infusion over 30 minutes" assert ( inst.effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T14:30:00+01:00"} ).valueDateTime ) assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T04:30:00+01:00"} ).valueDateTime ) assert inst.id == "medadmin0305" assert ( inst.instantiates[0] == ExternalValidatorModel.model_validate( { "valueUri": "http://www.bccancer.bc.ca/chemotherapy-protocols-site/Documents/Lymphoma-Myeloma/ULYBRENTUX%20Protocol_1Jun2017.pdf" } ).valueUri ) assert inst.medicationReference.reference == "#med0306" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.display == "Patrick Pump" assert inst.performer[0].actor.reference == "Practitioner/f007" assert inst.request.reference == "MedicationRequest/medrx0316" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationadministration_9(base_settings): """No. 9 tests collection for MedicationAdministration. Test File: medicationadministration0305.json """ filename = base_settings["unittest_data_dir"] / "medicationadministration0305.json" inst = medicationadministration.MedicationAdministration.model_validate_json( filename.read_bytes() ) assert "MedicationAdministration" == inst.get_resource_type() impl_medicationadministration_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationAdministration" == data["resourceType"] inst2 = medicationadministration.MedicationAdministration(**data) impl_medicationadministration_9(inst2) def impl_medicationadministration_10(inst): assert inst.contained[0].id == "med0303" assert inst.context.display == "encounter who leads to this prescription" assert inst.context.reference == "Encounter/f001" assert inst.dosage.dose.code == "mg" assert ( inst.dosage.dose.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage.dose.unit == "mg" assert float(inst.dosage.dose.value) == float(3) assert inst.dosage.method.coding[0].code == "422145002" assert ( inst.dosage.method.coding[0].display == "Inject - dosing instruction imperative (qualifier value)" ) assert ( inst.dosage.method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage.route.coding[0].code == "47625008" assert inst.dosage.route.coding[0].display == "Intravenous route (qualifier value)" assert ( inst.dosage.route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage.text == ( "Rapid daily-dose escalation, until tolerated, from 3 mg/d, " "and then 10 mg/d, to the recommended maintenance dose of 30 " "mg IV over 120 min, 3 times per wk on alternate days for up " "to 12 wk" ) assert ( inst.effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T14:30:00+01:00"} ).valueDateTime ) assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T04:30:00+01:00"} ).valueDateTime ) assert inst.id == "medadmin0304" assert inst.medicationReference.reference == "#med0303" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.display == "Patrick Pump" assert inst.performer[0].actor.reference == "Practitioner/f007" assert inst.reasonReference[0].reference == "Condition/f202" assert inst.request.reference == "MedicationRequest/medrx0319" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationadministration_10(base_settings): """No. 10 tests collection for MedicationAdministration. Test File: medicationadministration0304.json """ filename = base_settings["unittest_data_dir"] / "medicationadministration0304.json" inst = medicationadministration.MedicationAdministration.model_validate_json( filename.read_bytes() ) assert "MedicationAdministration" == inst.get_resource_type() impl_medicationadministration_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationAdministration" == data["resourceType"] inst2 = medicationadministration.MedicationAdministration(**data) impl_medicationadministration_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_medicationdispense.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/MedicationDispense Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import medicationdispense from .conftest import ExternalValidatorModel # noqa: F401 def impl_medicationdispense_1(inst): assert inst.authorizingPrescription[0].reference == "MedicationRequest/medrx0316" assert inst.contained[0].id == "med0306" assert inst.daysSupply.code == "d" assert ( inst.daysSupply.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.daysSupply.unit == "Day" assert float(inst.daysSupply.value) == float(1) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "mg/kg" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "mg/kg" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 1.8 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].route.coding[0].code == "255560000" assert inst.dosageInstruction[0].route.coding[0].display == "Intravenous" assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == ( "1.8 mg/kg IV infusion over 30 minutes every 3 weeks for 16 " "cycles" ) assert inst.dosageInstruction[0].timing.repeat.count == 16 assert inst.dosageInstruction[0].timing.repeat.frequency == 1 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(3) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "wk" assert inst.id == "meddisp0317" assert inst.medicationReference.display == "Brentixumab Vedotin (Adcetris)" assert inst.medicationReference.reference == "#med0306" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.reference == "Practitioner/f006" assert inst.quantity.code == "415818005" assert ( inst.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert float(inst.quantity.value) == float(3) assert inst.status == "stopped" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" assert inst.type.coding[0].code == "TF" assert inst.type.coding[0].display == "Trial Fill" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.whenHandedOver == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-06-26T07:13:00+05:00"} ).valueDateTime ) assert ( inst.whenPrepared == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-06-25T07:13:00+05:00"} ).valueDateTime ) def test_medicationdispense_1(base_settings): """No. 1 tests collection for MedicationDispense. Test File: medicationdispense0317.json """ filename = base_settings["unittest_data_dir"] / "medicationdispense0317.json" inst = medicationdispense.MedicationDispense.model_validate_json( filename.read_bytes() ) assert "MedicationDispense" == inst.get_resource_type() impl_medicationdispense_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationDispense" == data["resourceType"] inst2 = medicationdispense.MedicationDispense(**data) impl_medicationdispense_1(inst2) def impl_medicationdispense_2(inst): assert inst.authorizingPrescription[0].reference == "MedicationRequest/medrx0318" assert inst.contained[0].id == "med0301" assert inst.daysSupply.code == "d" assert ( inst.daysSupply.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.daysSupply.unit == "Day" assert float(inst.daysSupply.value) == float(3) assert inst.destination.reference == "Location/ph" assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "mg" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "mg" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 500 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].method.coding[0].code == "420620005" assert ( inst.dosageInstruction[0].method.coding[0].display == "Push - dosing instruction imperative (qualifier value)" ) assert ( inst.dosageInstruction[0].method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].route.coding[0].code == "255560000" assert inst.dosageInstruction[0].route.coding[0].display == "Intravenous" assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == "500mg IV q6h x 3 days" assert inst.dosageInstruction[0].timing.repeat.frequency == 1 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(6) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "h" assert inst.id == "meddisp0301" assert inst.location.display == "Pharmacy" assert inst.location.reference == "Location/ukp" assert inst.medicationReference.display == "Vancomycin Hydrochloride" assert inst.medicationReference.reference == "#med0301" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.reference == "Practitioner/f006" assert inst.quantity.code == "733026001" assert ( inst.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info.sct"} ).valueUri ) assert inst.quantity.unit == "Vial" assert float(inst.quantity.value) == float(12) assert inst.receiver[0].display == "Donald Duck" assert inst.receiver[0].reference == "Patient/pat1" assert inst.status == "in-progress" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.supportingInformation[0].reference == "Condition/f203" assert inst.text.status == "generated" assert inst.type.coding[0].code == "EM" assert inst.type.coding[0].display == "Emergency Supply" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.whenPrepared == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T10:20:00Z"} ).valueDateTime ) def test_medicationdispense_2(base_settings): """No. 2 tests collection for MedicationDispense. Test File: medicationdispense0301.json """ filename = base_settings["unittest_data_dir"] / "medicationdispense0301.json" inst = medicationdispense.MedicationDispense.model_validate_json( filename.read_bytes() ) assert "MedicationDispense" == inst.get_resource_type() impl_medicationdispense_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationDispense" == data["resourceType"] inst2 = medicationdispense.MedicationDispense(**data) impl_medicationdispense_2(inst2) def impl_medicationdispense_3(inst): assert inst.authorizingPrescription[0].reference == "MedicationRequest/medrx0321" assert inst.daysSupply.code == "d" assert ( inst.daysSupply.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.daysSupply.unit == "Day" assert float(inst.daysSupply.value) == float(10) assert ( inst.dosageInstruction[0].additionalInstruction[0].coding[0].code == "418914006" ) assert inst.dosageInstruction[0].additionalInstruction[0].coding[0].display == ( "Warning. May cause drowsiness. If affected do not drive or " "operate machinery. Avoid alcoholic drink (qualifier value)" ) assert ( inst.dosageInstruction[0].additionalInstruction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.dosageInstruction[0].asNeededCodeableConcept.coding[0].code == "203082005" ) assert ( inst.dosageInstruction[0].asNeededCodeableConcept.coding[0].display == "Fibromyalgia (disorder)" ) assert ( inst.dosageInstruction[0].asNeededCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "TAB" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "TAB" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 1 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].route.coding[0].code == "26643006" assert inst.dosageInstruction[0].route.coding[0].display == "Oral Route" assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert ( inst.dosageInstruction[0].text == "1 tablet every four hours as needed for pain" ) assert inst.dosageInstruction[0].timing.repeat.frequency == 1 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(4) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "h" assert inst.id == "meddisp0321" assert inst.medicationCodeableConcept.coding[0].code == "0074-3043-13" assert ( inst.medicationCodeableConcept.coding[0].display == "Vicodin 5mg Hydrocodone, 500mg Acetaminophen tablet" ) assert ( inst.medicationCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/ndc"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.reference == "Practitioner/f006" assert inst.quantity.code == "TAB" assert ( inst.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert float(inst.quantity.value) == float(30) assert inst.status == "in-progress" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" assert inst.type.coding[0].code == "RFP" assert inst.type.coding[0].display == "Refill - Part Fill" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.whenPrepared == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T10:20:00Z"} ).valueDateTime ) def test_medicationdispense_3(base_settings): """No. 3 tests collection for MedicationDispense. Test File: medicationdispense0321.json """ filename = base_settings["unittest_data_dir"] / "medicationdispense0321.json" inst = medicationdispense.MedicationDispense.model_validate_json( filename.read_bytes() ) assert "MedicationDispense" == inst.get_resource_type() impl_medicationdispense_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationDispense" == data["resourceType"] inst2 = medicationdispense.MedicationDispense(**data) impl_medicationdispense_3(inst2) def impl_medicationdispense_4(inst): assert inst.authorizingPrescription[0].reference == "MedicationRequest/medrx0323" assert inst.contained[0].id == "med0318" assert inst.daysSupply.code == "d" assert ( inst.daysSupply.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.daysSupply.unit == "Day" assert float(inst.daysSupply.value) == float(1) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "mL" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "mL" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 1000 ) assert inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.code == "h" assert ( inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.unit == "h" assert float( inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.value ) == float(1) assert inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.code == "mL" assert ( inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.unit == "mL" assert float( inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.value ) == float(50) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].route.coding[0].code == "255560000" assert inst.dosageInstruction[0].route.coding[0].display == "Intravenous" assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert ( inst.dosageInstruction[0].text == "1000mL infused at 50ml/hour for 4 hours - hang at 2200 hours" ) assert ( inst.dosageInstruction[0].timing.event[0] == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T22:00:00+11:00"} ).valueDateTime ) assert inst.dosageInstruction[0].timing.repeat.frequency == 1 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(24) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "h" assert inst.id == "meddisp0320" assert inst.medicationReference.display == "TPN Solution" assert inst.medicationReference.reference == "#med0318" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.reference == "Practitioner/f006" assert inst.quantity.code == "ml" assert ( inst.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.quantity.value) == float(1000) assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" assert ( inst.whenHandedOver == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-03-17T17:13:00+05:00"} ).valueDateTime ) assert ( inst.whenPrepared == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-03-16T17:13:00+05:00"} ).valueDateTime ) def test_medicationdispense_4(base_settings): """No. 4 tests collection for MedicationDispense. Test File: medicationdispense0320.json """ filename = base_settings["unittest_data_dir"] / "medicationdispense0320.json" inst = medicationdispense.MedicationDispense.model_validate_json( filename.read_bytes() ) assert "MedicationDispense" == inst.get_resource_type() impl_medicationdispense_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationDispense" == data["resourceType"] inst2 = medicationdispense.MedicationDispense(**data) impl_medicationdispense_4(inst2) def impl_medicationdispense_5(inst): assert inst.authorizingPrescription[0].reference == "MedicationRequest/medrx0320" assert inst.daysSupply.code == "d" assert ( inst.daysSupply.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.daysSupply.unit == "Day" assert float(inst.daysSupply.value) == float(30) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "U" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "U" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 20 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].route.coding[0].code == "263887005" assert ( inst.dosageInstruction[0].route.coding[0].display == "Subcutaneous (qualifier value)" ) assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == "20 Units SC three times daily" assert inst.dosageInstruction[0].timing.repeat.frequency == 3 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert inst.id == "meddisp0316" assert inst.medicationCodeableConcept.coding[0].code == "285018" assert ( inst.medicationCodeableConcept.coding[0].display == "Lantus 100 unit/ml injectable solution" ) assert ( inst.medicationCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.reference == "Practitioner/f006" assert inst.quantity.code == "ml" assert ( inst.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.quantity.value) == float(10) assert inst.status == "in-progress" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" assert inst.type.coding[0].code == "RFP" assert inst.type.coding[0].display == "Refill - Part Fill" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.whenPrepared == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-06-25T07:13:00+05:00"} ).valueDateTime ) def test_medicationdispense_5(base_settings): """No. 5 tests collection for MedicationDispense. Test File: medicationdispense0316.json """ filename = base_settings["unittest_data_dir"] / "medicationdispense0316.json" inst = medicationdispense.MedicationDispense.model_validate_json( filename.read_bytes() ) assert "MedicationDispense" == inst.get_resource_type() impl_medicationdispense_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationDispense" == data["resourceType"] inst2 = medicationdispense.MedicationDispense(**data) impl_medicationdispense_5(inst2) def impl_medicationdispense_6(inst): assert inst.authorizingPrescription[0].reference == "MedicationRequest/medrx0321" assert inst.daysSupply.code == "d" assert ( inst.daysSupply.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.daysSupply.unit == "Day" assert float(inst.daysSupply.value) == float(30) assert inst.dosageInstruction[0].additionalInstruction[0].text == "Shake Well" assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "ORINHL" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "ea" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 1 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == "Use two sprays twice daily" assert inst.dosageInstruction[0].timing.repeat.frequency == 2 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert inst.id == "meddisp0327" assert inst.medicationCodeableConcept.coding[0].code == "746763" assert inst.medicationCodeableConcept.coding[0].display == ( "Proventil 0.09mg/actuat (Albuterol sulfate 0.108mg/actuat " "from mouthpiece)" ) assert ( inst.medicationCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.reference == "Practitioner/f006" assert inst.quantity.code == "ml" assert ( inst.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.quantity.value) == float(30) assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" assert inst.type.coding[0].code == "TF" assert inst.type.coding[0].display == "Trial Fill" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.whenHandedOver == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T16:20:00Z"} ).valueDateTime ) assert ( inst.whenPrepared == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T10:20:00Z"} ).valueDateTime ) def test_medicationdispense_6(base_settings): """No. 6 tests collection for MedicationDispense. Test File: medicationdispense0327.json """ filename = base_settings["unittest_data_dir"] / "medicationdispense0327.json" inst = medicationdispense.MedicationDispense.model_validate_json( filename.read_bytes() ) assert "MedicationDispense" == inst.get_resource_type() impl_medicationdispense_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationDispense" == data["resourceType"] inst2 = medicationdispense.MedicationDispense(**data) impl_medicationdispense_6(inst2) def impl_medicationdispense_7(inst): assert inst.authorizingPrescription[0].reference == "MedicationRequest/medrx0309" assert inst.contained[0].id == "medexample015" assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "mg" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "mg" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 500 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].route.coding[0].code == "394899003" assert ( inst.dosageInstruction[0].route.coding[0].display == "oral administration of treatment" ) assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].timing.repeat.frequency == 2 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(21) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert inst.id == "meddisp008" assert inst.medicationReference.reference == "#medexample015" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.reference == "Practitioner/f006" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationdispense_7(base_settings): """No. 7 tests collection for MedicationDispense. Test File: medicationdispenseexample8.json """ filename = base_settings["unittest_data_dir"] / "medicationdispenseexample8.json" inst = medicationdispense.MedicationDispense.model_validate_json( filename.read_bytes() ) assert "MedicationDispense" == inst.get_resource_type() impl_medicationdispense_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationDispense" == data["resourceType"] inst2 = medicationdispense.MedicationDispense(**data) impl_medicationdispense_7(inst2) def impl_medicationdispense_8(inst): assert inst.authorizingPrescription[0].reference == "MedicationRequest/medrx0331" assert inst.contained[0].id == "med0352" assert inst.daysSupply.code == "d" assert ( inst.daysSupply.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.daysSupply.unit == "Day" assert float(inst.daysSupply.value) == float(1) assert inst.dosageInstruction[0].additionalInstruction[0].text == ( "Take along with one 2mg Coumadin tablet for a total daily " "dose of 7mg as prescribed by physician" ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "mg" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "mg" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 2 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert ( inst.dosageInstruction[0].text == "7mg (=one 5mg tablet PLUS one 2mg tablet) once daily" ) assert inst.dosageInstruction[0].timing.repeat.frequency == 1 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert inst.id == "meddisp0331" assert inst.medicationReference.display == "Coumadin 2mg tablet" assert inst.medicationReference.reference == "#med0352" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.reference == "Practitioner/f006" assert inst.quantity.code == "415818006" assert ( inst.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert float(inst.quantity.value) == float(1) assert inst.status == "in-progress" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" assert inst.type.coding[0].code == "DF" assert inst.type.coding[0].display == "Daily Fill" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.whenPrepared == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T10:20:00Z"} ).valueDateTime ) def test_medicationdispense_8(base_settings): """No. 8 tests collection for MedicationDispense. Test File: medicationdispense0331.json """ filename = base_settings["unittest_data_dir"] / "medicationdispense0331.json" inst = medicationdispense.MedicationDispense.model_validate_json( filename.read_bytes() ) assert "MedicationDispense" == inst.get_resource_type() impl_medicationdispense_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationDispense" == data["resourceType"] inst2 = medicationdispense.MedicationDispense(**data) impl_medicationdispense_8(inst2) def impl_medicationdispense_9(inst): assert inst.authorizingPrescription[0].reference == "MedicationRequest/medrx0324" assert inst.daysSupply.code == "d" assert ( inst.daysSupply.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.daysSupply.unit == "Day" assert float(inst.daysSupply.value) == float(10) assert ( inst.dosageInstruction[0].additionalInstruction[0].coding[0].code == "418637003" ) assert inst.dosageInstruction[0].additionalInstruction[0].coding[0].display == ( "Do not take with any other paracetamol products (qualifier " "value)" ) assert ( inst.dosageInstruction[0].additionalInstruction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.dosageInstruction[0].asNeededCodeableConcept.coding[0].code == "386661006" ) assert ( inst.dosageInstruction[0].asNeededCodeableConcept.coding[0].display == "Fever (finding)" ) assert ( inst.dosageInstruction[0].asNeededCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "mg" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "mg" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 240 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].maxDosePerPeriod.denominator.code == "d" assert ( inst.dosageInstruction[0].maxDosePerPeriod.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.dosageInstruction[0].maxDosePerPeriod.denominator.value) == float( 1 ) assert inst.dosageInstruction[0].maxDosePerPeriod.numerator.code == "mg" assert ( inst.dosageInstruction[0].maxDosePerPeriod.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.dosageInstruction[0].maxDosePerPeriod.numerator.value) == float( 720 ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == ( "Insert two suppositories (240mg) rectally twice daily as " "needed for fever to a maximim of 6 per day" ) assert inst.dosageInstruction[0].timing.repeat.frequency == 2 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert inst.id == "meddisp0311" assert inst.medicationCodeableConcept.coding[0].code == "0713-0118" assert ( inst.medicationCodeableConcept.coding[0].display == "Acetaminophen 120mg Suppository" ) assert ( inst.medicationCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/ndc"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.reference == "Practitioner/f006" assert inst.quantity.code == "RECSUPP" assert ( inst.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert float(inst.quantity.value) == float(60) assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" assert inst.type.coding[0].code == "RFP" assert inst.type.coding[0].display == "Refill - Part Fill" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.whenHandedOver == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T16:20:00Z"} ).valueDateTime ) assert ( inst.whenPrepared == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T10:20:00Z"} ).valueDateTime ) def test_medicationdispense_9(base_settings): """No. 9 tests collection for MedicationDispense. Test File: medicationdispense0311.json """ filename = base_settings["unittest_data_dir"] / "medicationdispense0311.json" inst = medicationdispense.MedicationDispense.model_validate_json( filename.read_bytes() ) assert "MedicationDispense" == inst.get_resource_type() impl_medicationdispense_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationDispense" == data["resourceType"] inst2 = medicationdispense.MedicationDispense(**data) impl_medicationdispense_9(inst2) def impl_medicationdispense_10(inst): assert inst.authorizingPrescription[0].reference == "MedicationRequest/medrx0306" assert inst.daysSupply.code == "d" assert ( inst.daysSupply.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.daysSupply.unit == "Day" assert float(inst.daysSupply.value) == float(30) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "mg" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "mg" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 6 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "calculated" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Calculated" ) assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == "Take 3 tablets (6mg) once daily" assert inst.dosageInstruction[0].timing.repeat.frequency == 1 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert inst.id == "meddisp0307" assert inst.medicationCodeableConcept.coding[0].code == "76388-713-25" assert ( inst.medicationCodeableConcept.coding[0].display == "Myleran 2mg tablet, film coated" ) assert ( inst.medicationCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/ndc"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.reference == "Practitioner/f006" assert inst.quantity.code == "TAB" assert ( inst.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert float(inst.quantity.value) == float(90) assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" assert inst.type.coding[0].code == "RFP" assert inst.type.coding[0].display == "Refill - Part Fill" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.whenHandedOver == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T16:20:00Z"} ).valueDateTime ) assert ( inst.whenPrepared == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T10:20:00Z"} ).valueDateTime ) def test_medicationdispense_10(base_settings): """No. 10 tests collection for MedicationDispense. Test File: medicationdispense0307.json """ filename = base_settings["unittest_data_dir"] / "medicationdispense0307.json" inst = medicationdispense.MedicationDispense.model_validate_json( filename.read_bytes() ) assert "MedicationDispense" == inst.get_resource_type() impl_medicationdispense_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationDispense" == data["resourceType"] inst2 = medicationdispense.MedicationDispense(**data) impl_medicationdispense_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_medicationknowledge.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/MedicationKnowledge Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import medicationknowledge from .conftest import ExternalValidatorModel # noqa: F401 def impl_medicationknowledge_1(inst): assert inst.amount.unit == "mg/ml" assert float(inst.amount.value) == float(50) assert inst.code.coding[0].code == "0409-6531-02" assert ( inst.code.coding[0].display == "Vancomycin Hydrochloride (VANCOMYCIN HYDROCHLORIDE)" ) assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/ndc"} ).valueUri ) assert inst.contained[0].id == "org4" assert inst.doseForm.coding[0].code == "385268001" assert inst.doseForm.coding[0].display == "Oral Dose Form (qualifier value)" assert ( inst.doseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "example" assert inst.manufacturer.reference == "#org4" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "active" assert inst.synonym[0] == "Vancomycin Hydrochloride (VANCOMYCIN HYDROCHLORIDE)" assert inst.text.status == "generated" def test_medicationknowledge_1(base_settings): """No. 1 tests collection for MedicationKnowledge. Test File: medicationknowledge-example.json """ filename = base_settings["unittest_data_dir"] / "medicationknowledge-example.json" inst = medicationknowledge.MedicationKnowledge.model_validate_json( filename.read_bytes() ) assert "MedicationKnowledge" == inst.get_resource_type() impl_medicationknowledge_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationKnowledge" == data["resourceType"] inst2 = medicationknowledge.MedicationKnowledge(**data) impl_medicationknowledge_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_medicationrequest.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/MedicationRequest Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import medicationrequest from .conftest import ExternalValidatorModel # noqa: F401 def impl_medicationrequest_1(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.dispenseRequest.expectedSupplyDuration.code == "d" assert ( inst.dispenseRequest.expectedSupplyDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dispenseRequest.expectedSupplyDuration.unit == "days" assert float(inst.dispenseRequest.expectedSupplyDuration.value) == float(30) assert inst.dispenseRequest.numberOfRepeatsAllowed == 3 assert inst.dispenseRequest.quantity.code == "mL" assert ( inst.dispenseRequest.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dispenseRequest.quantity.unit == "mL" assert float(inst.dispenseRequest.quantity.value) == float(30) assert ( inst.dispenseRequest.validityPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-15"} ).valueDateTime ) assert ( inst.dispenseRequest.validityPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.dosageInstruction[0].additionalInstruction[0].text == "Shake Well" assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "ORINHL" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "ea" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 1 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == "Use two sprays twice daily" assert inst.dosageInstruction[0].timing.repeat.frequency == 2 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert inst.id == "medrx0326" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/portal/prescriptions"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345689" assert inst.intent == "order" assert inst.medicationCodeableConcept.coding[0].code == "746763" assert ( inst.medicationCodeableConcept.coding[0].display == "Proventil HFA 90mcg/actuat metered dose inhaler, 200 actuat" ) assert ( inst.medicationCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.requester.display == "Patrick Pump" assert inst.requester.reference == "Practitioner/f007" assert inst.status == "on-hold" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.substitution.allowedBoolean is True assert inst.substitution.reason.coding[0].code == "FP" assert inst.substitution.reason.coding[0].display == "formulary policy" assert ( inst.substitution.reason.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_medicationrequest_1(base_settings): """No. 1 tests collection for MedicationRequest. Test File: medicationrequest0326.json """ filename = base_settings["unittest_data_dir"] / "medicationrequest0326.json" inst = medicationrequest.MedicationRequest.model_validate_json( filename.read_bytes() ) assert "MedicationRequest" == inst.get_resource_type() impl_medicationrequest_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationRequest" == data["resourceType"] inst2 = medicationrequest.MedicationRequest(**data) impl_medicationrequest_1(inst2) def impl_medicationrequest_2(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.contained[0].id == "med0305" assert inst.dispenseRequest.expectedSupplyDuration.code == "d" assert ( inst.dispenseRequest.expectedSupplyDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dispenseRequest.expectedSupplyDuration.unit == "days" assert float(inst.dispenseRequest.expectedSupplyDuration.value) == float(30) assert inst.dispenseRequest.numberOfRepeatsAllowed == 1 assert inst.dispenseRequest.quantity.code == "mL" assert ( inst.dispenseRequest.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dispenseRequest.quantity.unit == "mL" assert float(inst.dispenseRequest.quantity.value) == float(10) assert ( inst.dispenseRequest.validityPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-15"} ).valueDateTime ) assert ( inst.dispenseRequest.validityPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "OPDROP" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "OPDROP" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 1 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].method.coding[0].code == "421538008" assert ( inst.dosageInstruction[0].method.coding[0].display == "Instill - dosing instruction imperative (qualifier value)" ) assert ( inst.dosageInstruction[0].method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].route.coding[0].code == "54485002" assert ( inst.dosageInstruction[0].route.coding[0].display == "Ophthalmic route (qualifier value)" ) assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == "Instil one drop in each eye twice daily" assert inst.dosageInstruction[0].timing.repeat.frequency == 2 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert inst.encounter.display == "encounter who leads to this prescription" assert inst.encounter.reference == "Encounter/f002" assert inst.id == "medrx0330" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/portal/prescriptions"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345689" assert inst.intent == "order" assert inst.medicationReference.reference == "#med0305" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.requester.display == "Patrick Pump" assert inst.requester.reference == "Practitioner/f007" assert inst.status == "active" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.substitution.allowedBoolean is False assert inst.substitution.reason.coding[0].code == "FP" assert inst.substitution.reason.coding[0].display == "formulary policy" assert ( inst.substitution.reason.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_medicationrequest_2(base_settings): """No. 2 tests collection for MedicationRequest. Test File: medicationrequest0330.json """ filename = base_settings["unittest_data_dir"] / "medicationrequest0330.json" inst = medicationrequest.MedicationRequest.model_validate_json( filename.read_bytes() ) assert "MedicationRequest" == inst.get_resource_type() impl_medicationrequest_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationRequest" == data["resourceType"] inst2 = medicationrequest.MedicationRequest(**data) impl_medicationrequest_2(inst2) def impl_medicationrequest_3(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.contained[0].id == "med0309" assert inst.dosageInstruction[0].additionalInstruction[0].text == "Take at bedtime" assert ( inst.dosageInstruction[0].asNeededCodeableConcept.coding[0].code == "32914008" ) assert ( inst.dosageInstruction[0].asNeededCodeableConcept.coding[0].display == "Restless Legs" ) assert ( inst.dosageInstruction[0].asNeededCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseRange.high.code == "TAB" assert ( inst.dosageInstruction[0].doseAndRate[0].doseRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseRange.high.unit == "TAB" assert float( inst.dosageInstruction[0].doseAndRate[0].doseRange.high.value ) == float(2) assert inst.dosageInstruction[0].doseAndRate[0].doseRange.low.code == "TAB" assert ( inst.dosageInstruction[0].doseAndRate[0].doseRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseRange.low.unit == "TAB" assert float(inst.dosageInstruction[0].doseAndRate[0].doseRange.low.value) == float( 1 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].route.coding[0].code == "26643006" assert inst.dosageInstruction[0].route.coding[0].display == "Oral Route" assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == ( "Take 1-2 tablets once daily at bedtime as needed for " "restless legs" ) assert inst.dosageInstruction[0].timing.repeat.frequency == 1 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert inst.encounter.display == "encounter who leads to this prescription" assert inst.encounter.reference == "Encounter/f001" assert inst.id == "medrx0310" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/portal/prescriptions"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345689" assert inst.intent == "order" assert inst.medicationReference.reference == "#med0309" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.requester.display == "Patrick Pump" assert inst.requester.reference == "Practitioner/f007" assert inst.status == "active" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationrequest_3(base_settings): """No. 3 tests collection for MedicationRequest. Test File: medicationrequest0310.json """ filename = base_settings["unittest_data_dir"] / "medicationrequest0310.json" inst = medicationrequest.MedicationRequest.model_validate_json( filename.read_bytes() ) assert "MedicationRequest" == inst.get_resource_type() impl_medicationrequest_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationRequest" == data["resourceType"] inst2 = medicationrequest.MedicationRequest(**data) impl_medicationrequest_3(inst2) def impl_medicationrequest_4(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.contained[0].id == "med0304" assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "mg" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "mg" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 6 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].route.coding[0].code == "26643006" assert ( inst.dosageInstruction[0].route.coding[0].display == "Oral route (qualifier value)" ) assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == ( "6 mg PO daily for remission induction; adjust dosage to " "white blood cell (WBC) count. With hold treatment if WBC is" " less than 15,000/µL; resume when WBC is greater than " "50,000/µL" ) assert inst.dosageInstruction[0].timing.repeat.frequency == 1 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert inst.id == "medrx0306" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/portal/prescriptions"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345689" assert inst.intent == "order" assert inst.medicationReference.display == "Myleran 2mg tablet" assert inst.medicationReference.reference == "#med0304" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.reasonCode[0].coding[0].code == "92818009" assert inst.reasonCode[0].coding[0].display == "Chronic myeloid Leukemia (disorder)" assert ( inst.reasonCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.requester.display == "Patrick Pump" assert inst.requester.reference == "Practitioner/f007" assert inst.status == "active" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationrequest_4(base_settings): """No. 4 tests collection for MedicationRequest. Test File: medicationrequest0306.json """ filename = base_settings["unittest_data_dir"] / "medicationrequest0306.json" inst = medicationrequest.MedicationRequest.model_validate_json( filename.read_bytes() ) assert "MedicationRequest" == inst.get_resource_type() impl_medicationrequest_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationRequest" == data["resourceType"] inst2 = medicationrequest.MedicationRequest(**data) impl_medicationrequest_4(inst2) def impl_medicationrequest_5(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.contained[0].id == "med0308" assert inst.dispenseRequest.expectedSupplyDuration.code == "d" assert ( inst.dispenseRequest.expectedSupplyDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dispenseRequest.expectedSupplyDuration.unit == "days" assert float(inst.dispenseRequest.expectedSupplyDuration.value) == float(10) assert inst.dispenseRequest.quantity.code == "TAB" assert ( inst.dispenseRequest.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dispenseRequest.quantity.unit == "TAB" assert float(inst.dispenseRequest.quantity.value) == float(30) assert ( inst.dispenseRequest.validityPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-15"} ).valueDateTime ) assert ( inst.dispenseRequest.validityPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert ( inst.dosageInstruction[0].additionalInstruction[0].coding[0].code == "418914006" ) assert inst.dosageInstruction[0].additionalInstruction[0].coding[0].display == ( "Warning. May cause drowsiness. If affected do not drive or " "operate machinery. Avoid alcoholic drink (qualifier value)" ) assert ( inst.dosageInstruction[0].additionalInstruction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.dosageInstruction[0].asNeededCodeableConcept.coding[0].code == "203082005" ) assert ( inst.dosageInstruction[0].asNeededCodeableConcept.coding[0].display == "Fibromyalgia (disorder)" ) assert ( inst.dosageInstruction[0].asNeededCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "TAB" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "TAB" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 1 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].route.coding[0].code == "26643006" assert inst.dosageInstruction[0].route.coding[0].display == "Oral Route" assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert ( inst.dosageInstruction[0].text == "1 tablet every four hours as needed for pain" ) assert inst.dosageInstruction[0].timing.repeat.frequency == 1 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(4) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "h" assert inst.encounter.display == "encounter who leads to this prescription" assert inst.encounter.reference == "Encounter/f001" assert inst.id == "medrx0307" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/portal/prescriptions"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345689" assert inst.intent == "order" assert inst.medicationReference.reference == "#med0308" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.requester.display == "Patrick Pump" assert inst.requester.reference == "Practitioner/f007" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.substitution.allowedBoolean is True assert inst.substitution.reason.coding[0].code == "FP" assert inst.substitution.reason.coding[0].display == "formulary policy" assert ( inst.substitution.reason.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_medicationrequest_5(base_settings): """No. 5 tests collection for MedicationRequest. Test File: medicationrequest0307.json """ filename = base_settings["unittest_data_dir"] / "medicationrequest0307.json" inst = medicationrequest.MedicationRequest.model_validate_json( filename.read_bytes() ) assert "MedicationRequest" == inst.get_resource_type() impl_medicationrequest_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationRequest" == data["resourceType"] inst2 = medicationrequest.MedicationRequest(**data) impl_medicationrequest_5(inst2) def impl_medicationrequest_6(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.contained[0].id == "med0350" assert inst.dispenseRequest.expectedSupplyDuration.code == "d" assert ( inst.dispenseRequest.expectedSupplyDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dispenseRequest.expectedSupplyDuration.unit == "days" assert float(inst.dispenseRequest.expectedSupplyDuration.value) == float(30) assert inst.dispenseRequest.numberOfRepeatsAllowed == 3 assert inst.dispenseRequest.quantity.code == "TAB" assert ( inst.dispenseRequest.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dispenseRequest.quantity.unit == "TAB" assert float(inst.dispenseRequest.quantity.value) == float(30) assert ( inst.dispenseRequest.validityPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-15"} ).valueDateTime ) assert ( inst.dispenseRequest.validityPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "mg" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "mg" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 7 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == "7mg once daily" assert inst.dosageInstruction[0].timing.repeat.frequency == 1 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert inst.id == "medrx0331" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/portal/prescriptions"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345689" assert inst.intent == "order" assert inst.medicationReference.reference == "#med0350" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.requester.display == "Patrick Pump" assert inst.requester.reference == "Practitioner/f007" assert inst.status == "active" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.substitution.allowedBoolean is True assert inst.substitution.reason.coding[0].code == "FP" assert inst.substitution.reason.coding[0].display == "formulary policy" assert ( inst.substitution.reason.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_medicationrequest_6(base_settings): """No. 6 tests collection for MedicationRequest. Test File: medicationrequest0331.json """ filename = base_settings["unittest_data_dir"] / "medicationrequest0331.json" inst = medicationrequest.MedicationRequest.model_validate_json( filename.read_bytes() ) assert "MedicationRequest" == inst.get_resource_type() impl_medicationrequest_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationRequest" == data["resourceType"] inst2 = medicationrequest.MedicationRequest(**data) impl_medicationrequest_6(inst2) def impl_medicationrequest_7(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.dispenseRequest.expectedSupplyDuration.code == "d" assert ( inst.dispenseRequest.expectedSupplyDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dispenseRequest.expectedSupplyDuration.unit == "days" assert float(inst.dispenseRequest.expectedSupplyDuration.value) == float(14) assert inst.dispenseRequest.quantity.code == "PATCH" assert ( inst.dispenseRequest.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dispenseRequest.quantity.unit == "patch" assert float(inst.dispenseRequest.quantity.value) == float(6) assert ( inst.dispenseRequest.validityPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-15"} ).valueDateTime ) assert ( inst.dispenseRequest.validityPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "PATCH" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "patch" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 1 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == "apply one patch three times per week" assert inst.dosageInstruction[0].timing.repeat.frequency == 3 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "wk" assert inst.id == "medrx0327" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/portal/prescriptions"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345689" assert inst.intent == "order" assert inst.medicationCodeableConcept.coding[0].code == "333919005" assert ( inst.medicationCodeableConcept.coding[0].display == "Fentanyl 25micrograms/hour patch (product)" ) assert ( inst.medicationCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.requester.display == "Patrick Pump" assert inst.requester.reference == "Practitioner/f007" assert inst.status == "active" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationrequest_7(base_settings): """No. 7 tests collection for MedicationRequest. Test File: medicationrequest0327.json """ filename = base_settings["unittest_data_dir"] / "medicationrequest0327.json" inst = medicationrequest.MedicationRequest.model_validate_json( filename.read_bytes() ) assert "MedicationRequest" == inst.get_resource_type() impl_medicationrequest_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationRequest" == data["resourceType"] inst2 = medicationrequest.MedicationRequest(**data) impl_medicationrequest_7(inst2) def impl_medicationrequest_8(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.contained[0].id == "med0306" assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "mg/kg" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "mg/kg" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 1.8 ) assert inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.code == "min" assert ( inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float( inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.value ) == float(20) assert inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.code == "mg/kg" assert ( inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float( inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.value ) == float(1.8) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].maxDosePerLifetime.code == "mg" assert ( inst.dosageInstruction[0].maxDosePerLifetime.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].maxDosePerLifetime.unit == "mg" assert float(inst.dosageInstruction[0].maxDosePerLifetime.value) == float(400) assert inst.dosageInstruction[0].route.coding[0].code == "255560000" assert inst.dosageInstruction[0].route.coding[0].display == "Intravenous" assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == ( "1.8 mg/kg IV infusion over 20 minutes every 3 weeks for 16 " "cycles" ) assert inst.dosageInstruction[0].timing.repeat.count == 16 assert inst.dosageInstruction[0].timing.repeat.frequency == 1 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(3) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "wk" assert inst.encounter.display == "encounter who leads to this prescription" assert inst.encounter.reference == "Encounter/f001" assert inst.id == "medrx0316" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/portal/prescriptions"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345689" assert ( inst.instantiatesUri[0] == ExternalValidatorModel.model_validate( { "valueUri": "http://www.bccancer.bc.ca/chemotherapy-protocols-site/Documents/Lymphoma-Myeloma/ULYBRENTUX%20Protocol_1Jun2017.pdf" } ).valueUri ) assert inst.intent == "order" assert inst.medicationReference.reference == "#med0306" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.requester.display == "Patrick Pump" assert inst.requester.reference == "Practitioner/f007" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationrequest_8(base_settings): """No. 8 tests collection for MedicationRequest. Test File: medicationrequest0316.json """ filename = base_settings["unittest_data_dir"] / "medicationrequest0316.json" inst = medicationrequest.MedicationRequest.model_validate_json( filename.read_bytes() ) assert "MedicationRequest" == inst.get_resource_type() impl_medicationrequest_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationRequest" == data["resourceType"] inst2 = medicationrequest.MedicationRequest(**data) impl_medicationrequest_8(inst2) def impl_medicationrequest_9(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.dispenseRequest.expectedSupplyDuration.code == "d" assert ( inst.dispenseRequest.expectedSupplyDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dispenseRequest.expectedSupplyDuration.unit == "days" assert float(inst.dispenseRequest.expectedSupplyDuration.value) == float(30) assert inst.dispenseRequest.numberOfRepeatsAllowed == 6 assert inst.dispenseRequest.quantity.code == "mL" assert ( inst.dispenseRequest.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dispenseRequest.quantity.unit == "mL" assert float(inst.dispenseRequest.quantity.value) == float(10) assert ( inst.dispenseRequest.validityPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-15"} ).valueDateTime ) assert ( inst.dispenseRequest.validityPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "U" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "U" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 20 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].route.coding[0].code == "263887005" assert ( inst.dosageInstruction[0].route.coding[0].display == "Subcutaneous (qualifier value)" ) assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == "20 Units SC three times daily" assert inst.dosageInstruction[0].timing.repeat.frequency == 3 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert inst.id == "medrx0320" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/portal/prescriptions"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345689" assert inst.intent == "order" assert inst.medicationCodeableConcept.coding[0].code == "285018" assert ( inst.medicationCodeableConcept.coding[0].display == "Lantus 100 unit/ml injectable solution" ) assert ( inst.medicationCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.reasonCode[0].coding[0].code == "473189005" assert ( inst.reasonCode[0].coding[0].display == "On subcutaneous insulin for diabetes mellitus (finding)" ) assert ( inst.reasonCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.requester.display == "Patrick Pump" assert inst.requester.reference == "Practitioner/f007" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationrequest_9(base_settings): """No. 9 tests collection for MedicationRequest. Test File: medicationrequest0320.json """ filename = base_settings["unittest_data_dir"] / "medicationrequest0320.json" inst = medicationrequest.MedicationRequest.model_validate_json( filename.read_bytes() ) assert "MedicationRequest" == inst.get_resource_type() impl_medicationrequest_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationRequest" == data["resourceType"] inst2 = medicationrequest.MedicationRequest(**data) impl_medicationrequest_9(inst2) def impl_medicationrequest_10(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.contained[0].id == "med0336" assert ( inst.dosageInstruction[0].doseAndRate[0].rateQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].rateQuantity.unit == "ug/kg/min" assert float(inst.dosageInstruction[0].doseAndRate[0].rateQuantity.value) == float( 4 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].route.coding[0].code == "47625008" assert ( inst.dosageInstruction[0].route.coding[0].display == "Intravenous route (qualifier value)" ) assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == "Dopamine 4mcg/kg/min" assert float(inst.dosageInstruction[0].timing.repeat.duration) == float(33.33) assert inst.dosageInstruction[0].timing.repeat.durationUnit == "h" assert inst.id == "medrx0336" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/portal/prescriptions"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345689" assert inst.intent == "order" assert inst.medicationReference.display == "Dopamine 400mg in 500mL D5W" assert inst.medicationReference.reference == "#med0336" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.requester.display == "Patrick Pump" assert inst.requester.reference == "Practitioner/f007" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.supportingInformation[0].reference == "Observation/example" assert inst.text.status == "generated" def test_medicationrequest_10(base_settings): """No. 10 tests collection for MedicationRequest. Test File: medicationrequest0336.json """ filename = base_settings["unittest_data_dir"] / "medicationrequest0336.json" inst = medicationrequest.MedicationRequest.model_validate_json( filename.read_bytes() ) assert "MedicationRequest" == inst.get_resource_type() impl_medicationrequest_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationRequest" == data["resourceType"] inst2 = medicationrequest.MedicationRequest(**data) impl_medicationrequest_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_medicationstatement.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/MedicationStatement Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import medicationstatement from .conftest import ExternalValidatorModel # noqa: F401 def impl_medicationstatement_1(inst): assert inst.basedOn[0].reference == "CarePlan/gpvisit" assert inst.context.reference == "Encounter/f203" assert ( inst.dateAsserted == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-22"} ).valueDateTime ) assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-01-23"} ).valueDateTime ) assert inst.id == "example005" assert inst.informationSource.display == "Donald Duck" assert inst.informationSource.reference == "Patient/pat1" assert inst.medicationCodeableConcept.coding[0].code == "27658006" assert inst.medicationCodeableConcept.coding[0].display == "Amoxicillin (product)" assert ( inst.medicationCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == ( "Patient indicated that they thought it was Amoxicillin they " "were taking but it was really Erythromycin" ) assert inst.status == "entered-in-error" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationstatement_1(base_settings): """No. 1 tests collection for MedicationStatement. Test File: medicationstatementexample5.json """ filename = base_settings["unittest_data_dir"] / "medicationstatementexample5.json" inst = medicationstatement.MedicationStatement.model_validate_json( filename.read_bytes() ) assert "MedicationStatement" == inst.get_resource_type() impl_medicationstatement_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationStatement" == data["resourceType"] inst2 = medicationstatement.MedicationStatement(**data) impl_medicationstatement_1(inst2) def impl_medicationstatement_2(inst): assert ( inst.dateAsserted == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-22"} ).valueDateTime ) assert inst.dosage[0].asNeededBoolean is False assert inst.dosage[0].maxDosePerPeriod.denominator.code == "d" assert ( inst.dosage[0].maxDosePerPeriod.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.dosage[0].maxDosePerPeriod.denominator.value) == float(1) assert inst.dosage[0].maxDosePerPeriod.numerator.code == "385055001" assert ( inst.dosage[0].maxDosePerPeriod.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage[0].maxDosePerPeriod.numerator.unit == "capsules" assert float(inst.dosage[0].maxDosePerPeriod.numerator.value) == float(3) assert inst.dosage[0].route.coding[0].code == "260548002" assert inst.dosage[0].route.coding[0].display == "Oral" assert ( inst.dosage[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage[0].text == "one capsule three times daily" assert inst.dosage[0].timing.repeat.frequency == 3 assert float(inst.dosage[0].timing.repeat.period) == float(1) assert inst.dosage[0].timing.repeat.periodUnit == "d" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-01-23"} ).valueDateTime ) assert inst.id == "example004" assert inst.informationSource.display == "Donald Duck" assert inst.informationSource.reference == "Patient/pat1" assert inst.medicationCodeableConcept.coding[0].code == "27658006" assert inst.medicationCodeableConcept.coding[0].display == "Amoxicillin (product)" assert ( inst.medicationCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "Patient indicates they miss the occasional dose" assert inst.partOf[0].reference == "Observation/blood-pressure" assert inst.reasonCode[0].coding[0].code == "65363002" assert inst.reasonCode[0].coding[0].display == "Otitis Media" assert ( inst.reasonCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.status == "active" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationstatement_2(base_settings): """No. 2 tests collection for MedicationStatement. Test File: medicationstatementexample4.json """ filename = base_settings["unittest_data_dir"] / "medicationstatementexample4.json" inst = medicationstatement.MedicationStatement.model_validate_json( filename.read_bytes() ) assert "MedicationStatement" == inst.get_resource_type() impl_medicationstatement_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationStatement" == data["resourceType"] inst2 = medicationstatement.MedicationStatement(**data) impl_medicationstatement_2(inst2) def impl_medicationstatement_3(inst): assert ( inst.dateAsserted == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-02-22"} ).valueDateTime ) assert inst.dosage[0].asNeededBoolean is False assert inst.dosage[0].doseAndRate[0].doseQuantity.code == "TAB" assert ( inst.dosage[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosage[0].doseAndRate[0].doseQuantity.unit == "tab" assert float(inst.dosage[0].doseAndRate[0].doseQuantity.value) == float(1) assert inst.dosage[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosage[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosage[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosage[0].maxDosePerPeriod.denominator.code == "d" assert ( inst.dosage[0].maxDosePerPeriod.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.dosage[0].maxDosePerPeriod.denominator.value) == float(1) assert float(inst.dosage[0].maxDosePerPeriod.numerator.value) == float(1) assert inst.dosage[0].route.coding[0].code == "260548002" assert inst.dosage[0].route.coding[0].display == "Oral" assert ( inst.dosage[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage[0].sequence == 1 assert inst.dosage[0].text == "1 tablet per day" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-02-01"} ).valueDateTime ) assert inst.id == "example003" assert inst.informationSource.display == "Donald Duck" assert inst.informationSource.reference == "Patient/pat1" assert inst.medicationCodeableConcept.text == "Little Pink Pill for water retention" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == ( "Patient cannot remember the name of the tablet, but takes it" " every day in the morning for water retention" ) assert inst.reasonReference[0].reference == "Observation/blood-pressure" assert inst.status == "active" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationstatement_3(base_settings): """No. 3 tests collection for MedicationStatement. Test File: medicationstatementexample3.json """ filename = base_settings["unittest_data_dir"] / "medicationstatementexample3.json" inst = medicationstatement.MedicationStatement.model_validate_json( filename.read_bytes() ) assert "MedicationStatement" == inst.get_resource_type() impl_medicationstatement_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationStatement" == data["resourceType"] inst2 = medicationstatement.MedicationStatement(**data) impl_medicationstatement_3(inst2) def impl_medicationstatement_4(inst): assert inst.contained[0].id == "med0309" assert ( inst.dateAsserted == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-22"} ).valueDateTime ) assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-23"} ).valueDateTime ) assert inst.id == "example002" assert inst.informationSource.display == "Donald Duck" assert inst.informationSource.reference == "Patient/pat1" assert inst.medicationReference.reference == "#med0309" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.note[0].text == "Patient cannot take acetaminophen as per Dr instructions" ) assert inst.status == "active" assert inst.statusReason[0].coding[0].code == "166643006" assert inst.statusReason[0].coding[0].display == "Liver enzymes abnormal" assert ( inst.statusReason[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationstatement_4(base_settings): """No. 4 tests collection for MedicationStatement. Test File: medicationstatementexample2.json """ filename = base_settings["unittest_data_dir"] / "medicationstatementexample2.json" inst = medicationstatement.MedicationStatement.model_validate_json( filename.read_bytes() ) assert "MedicationStatement" == inst.get_resource_type() impl_medicationstatement_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationStatement" == data["resourceType"] inst2 = medicationstatement.MedicationStatement(**data) impl_medicationstatement_4(inst2) def impl_medicationstatement_5(inst): assert inst.category.coding[0].code == "inpatient" assert inst.category.coding[0].display == "Inpatient" assert ( inst.category.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/medication-statement-category" } ).valueUri ) assert inst.contained[0].id == "med0309" assert ( inst.dateAsserted == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-22"} ).valueDateTime ) assert inst.derivedFrom[0].reference == "MedicationRequest/medrx002" assert inst.dosage[0].additionalInstruction[0].text == "Taking at bedtime" assert inst.dosage[0].asNeededCodeableConcept.coding[0].code == "32914008" assert inst.dosage[0].asNeededCodeableConcept.coding[0].display == "Restless Legs" assert ( inst.dosage[0].asNeededCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage[0].doseAndRate[0].doseRange.high.code == "TAB" assert ( inst.dosage[0].doseAndRate[0].doseRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosage[0].doseAndRate[0].doseRange.high.unit == "TAB" assert float(inst.dosage[0].doseAndRate[0].doseRange.high.value) == float(2) assert inst.dosage[0].doseAndRate[0].doseRange.low.code == "TAB" assert ( inst.dosage[0].doseAndRate[0].doseRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosage[0].doseAndRate[0].doseRange.low.unit == "TAB" assert float(inst.dosage[0].doseAndRate[0].doseRange.low.value) == float(1) assert inst.dosage[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosage[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosage[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosage[0].route.coding[0].code == "26643006" assert inst.dosage[0].route.coding[0].display == "Oral Route" assert ( inst.dosage[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage[0].sequence == 1 assert inst.dosage[0].text == ( "1-2 tablets once daily at bedtime as needed for restless " "legs" ) assert inst.dosage[0].timing.repeat.frequency == 1 assert float(inst.dosage[0].timing.repeat.period) == float(1) assert inst.dosage[0].timing.repeat.periodUnit == "d" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-23"} ).valueDateTime ) assert inst.id == "example001" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/portal/medstatements"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345689" assert inst.informationSource.display == "Donald Duck" assert inst.informationSource.reference == "Patient/pat1" assert inst.medicationReference.reference == "#med0309" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "Patient indicates they miss the occasional dose" assert inst.reasonCode[0].coding[0].code == "32914008" assert inst.reasonCode[0].coding[0].display == "Restless Legs" assert ( inst.reasonCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.status == "active" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationstatement_5(base_settings): """No. 5 tests collection for MedicationStatement. Test File: medicationstatementexample1.json """ filename = base_settings["unittest_data_dir"] / "medicationstatementexample1.json" inst = medicationstatement.MedicationStatement.model_validate_json( filename.read_bytes() ) assert "MedicationStatement" == inst.get_resource_type() impl_medicationstatement_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationStatement" == data["resourceType"] inst2 = medicationstatement.MedicationStatement(**data) impl_medicationstatement_5(inst2) def impl_medicationstatement_6(inst): assert inst.contained[0].id == "med0315" assert inst.id == "example007" assert inst.informationSource.display == "Donald Duck" assert inst.informationSource.reference == "Patient/pat1" assert inst.medicationReference.reference == "#med0315" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == ( "patient plans to start using for seasonal allergies in the " "Spring when pollen is in the air" ) assert inst.status == "active" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationstatement_6(base_settings): """No. 6 tests collection for MedicationStatement. Test File: medicationstatementexample7.json """ filename = base_settings["unittest_data_dir"] / "medicationstatementexample7.json" inst = medicationstatement.MedicationStatement.model_validate_json( filename.read_bytes() ) assert "MedicationStatement" == inst.get_resource_type() impl_medicationstatement_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationStatement" == data["resourceType"] inst2 = medicationstatement.MedicationStatement(**data) impl_medicationstatement_6(inst2) def impl_medicationstatement_7(inst): assert ( inst.dateAsserted == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-02-22"} ).valueDateTime ) assert inst.dosage[0].asNeededBoolean is False assert inst.dosage[0].doseAndRate[0].doseQuantity.code == "mL" assert ( inst.dosage[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage[0].doseAndRate[0].doseQuantity.unit == "mL" assert float(inst.dosage[0].doseAndRate[0].doseQuantity.value) == float(5) assert inst.dosage[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosage[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosage[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosage[0].maxDosePerPeriod.denominator.code == "d" assert ( inst.dosage[0].maxDosePerPeriod.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.dosage[0].maxDosePerPeriod.denominator.value) == float(1) assert float(inst.dosage[0].maxDosePerPeriod.numerator.value) == float(3) assert inst.dosage[0].route.coding[0].code == "260548002" assert inst.dosage[0].route.coding[0].display == "Oral" assert ( inst.dosage[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage[0].sequence == 1 assert inst.dosage[0].text == "5ml three times daily" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-02-01"} ).valueDateTime ) assert inst.id == "example006" assert inst.informationSource.display == "Peter Chalmers" assert inst.informationSource.reference == "RelatedPerson/peter" assert inst.medicationCodeableConcept.coding[0].code == "27658006" assert inst.medicationCodeableConcept.coding[0].display == "Amoxicillin (product)" assert ( inst.medicationCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "Father indicates they miss the occasional dose" assert inst.status == "active" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationstatement_7(base_settings): """No. 7 tests collection for MedicationStatement. Test File: medicationstatementexample6.json """ filename = base_settings["unittest_data_dir"] / "medicationstatementexample6.json" inst = medicationstatement.MedicationStatement.model_validate_json( filename.read_bytes() ) assert "MedicationStatement" == inst.get_resource_type() impl_medicationstatement_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationStatement" == data["resourceType"] inst2 = medicationstatement.MedicationStatement(**data) impl_medicationstatement_7(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_medicinalproductdefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/MedicinalProductDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import medicinalproductdefinition from .conftest import ExternalValidatorModel # noqa: F401 def impl_medicinalproductdefinition_1(inst): assert inst.contained[0].id == "ppd1" assert inst.contained[1].id == "i1" assert inst.id == "product-with-contained-package-and-ingredient" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].productName == "Exampleocillin" assert inst.text.status == "generated" def test_medicinalproductdefinition_1(base_settings): """No. 1 tests collection for MedicinalProductDefinition. Test File: medicinalproductdefinition-with-contained-package-and-ingredient.json """ filename = ( base_settings["unittest_data_dir"] / "medicinalproductdefinition-with-contained-package-and-ingredient.json" ) inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json( filename.read_bytes() ) assert "MedicinalProductDefinition" == inst.get_resource_type() impl_medicinalproductdefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicinalProductDefinition" == data["resourceType"] inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data) impl_medicinalproductdefinition_1(inst2) def impl_medicinalproductdefinition_2(inst): assert inst.classification[0].coding[0].code == "B01A" assert ( inst.classification[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.whocc.no/atc/example"} ).valueUri ) assert inst.combinedPharmaceuticalDoseForm.coding[0].code == "tablet" assert ( inst.combinedPharmaceuticalDoseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org.uk/fhir/dosefom"} ).valueUri ) assert ( inst.crossReference[0].product.reference.reference == "MedicinalProductDefinition/genericEquilidonium" ) assert inst.id == "equilidem-basics" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org.uk/fhir/product"} ).valueUri ) assert inst.identifier[0].value == "Equilidem25" assert inst.ingredient[0].text == "Equilidonium Phosphate" assert inst.ingredient[1].text == "Calcium Carbonate" assert inst.legalStatusOfSupply.coding[0].code == "POM" assert inst.legalStatusOfSupply.coding[0].display == "Prescription only medicine" assert ( inst.legalStatusOfSupply.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org.uk/fhir/legalstatusofsupply"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].productName == "Equilidem 2.5 mg film-coated tablets" assert inst.operation[0].organization[0].display == "EquiliDrugCo Inc." assert inst.text.status == "generated" def test_medicinalproductdefinition_2(base_settings): """No. 2 tests collection for MedicinalProductDefinition. Test File: medicinalproductdefinition-example-equilidem-basics.json """ filename = ( base_settings["unittest_data_dir"] / "medicinalproductdefinition-example-equilidem-basics.json" ) inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json( filename.read_bytes() ) assert "MedicinalProductDefinition" == inst.get_resource_type() impl_medicinalproductdefinition_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicinalProductDefinition" == data["resourceType"] inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data) impl_medicinalproductdefinition_2(inst2) def impl_medicinalproductdefinition_3(inst): assert inst.classification[0].coding[0].code == "B01A" assert ( inst.classification[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.whocc.no/atc/example"} ).valueUri ) assert inst.combinedPharmaceuticalDoseForm.coding[0].code == "tablet" assert ( inst.combinedPharmaceuticalDoseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org.uk/fhir/dosefom"} ).valueUri ) assert inst.contained[0].id == "EquilidoniumPhosphate" assert inst.contained[1].id == "CalciumCarbonate" assert ( inst.crossReference[0].product.reference.reference == "MedicinalProductDefinition/genericEquilidonium" ) assert inst.id == "equilidem-with-ing-and-auth" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org.uk/fhir/product"} ).valueUri ) assert inst.identifier[0].value == "Equilidem25" assert inst.legalStatusOfSupply.coding[0].code == "POM" assert inst.legalStatusOfSupply.coding[0].display == "Prescription only medicine" assert ( inst.legalStatusOfSupply.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org.uk/fhir/legalstatusofsupply"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].productName == "Equilidem 2.5 mg film-coated tablets" assert inst.operation[0].organization[0].display == "EquiliDrugCo Processing Inc." assert inst.text.status == "generated" def test_medicinalproductdefinition_3(base_settings): """No. 3 tests collection for MedicinalProductDefinition. Test File: medicinalproductdefinition-example-equilidem-using-ingredient-and-auth.json """ filename = ( base_settings["unittest_data_dir"] / "medicinalproductdefinition-example-equilidem-using-ingredient-and-auth.json" ) inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json( filename.read_bytes() ) assert "MedicinalProductDefinition" == inst.get_resource_type() impl_medicinalproductdefinition_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicinalProductDefinition" == data["resourceType"] inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data) impl_medicinalproductdefinition_3(inst2) def impl_medicinalproductdefinition_4(inst): assert ( inst.combinedPharmaceuticalDoseForm.coding[0].code == "solution for injection" ) assert ( inst.combinedPharmaceuticalDoseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org.uk/fhir/doseform"} ).valueUri ) assert inst.contained[0].id == "package" assert inst.contained[1].id == "syringeDevice" assert inst.contained[2].id == "liquidItem" assert inst.id == "drug-and-device" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org.uk/fhir/product"} ).valueUri ) assert inst.identifier[0].value == "Wonderdrug+" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].productName == "Wonderdrug+ liquid 20ml" assert inst.text.status == "generated" def test_medicinalproductdefinition_4(base_settings): """No. 4 tests collection for MedicinalProductDefinition. Test File: medicinalproductdefinition-example-co-packaged-liquid-and-syringe.json """ filename = ( base_settings["unittest_data_dir"] / "medicinalproductdefinition-example-co-packaged-liquid-and-syringe.json" ) inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json( filename.read_bytes() ) assert "MedicinalProductDefinition" == inst.get_resource_type() impl_medicinalproductdefinition_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicinalProductDefinition" == data["resourceType"] inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data) impl_medicinalproductdefinition_4(inst2) def impl_medicinalproductdefinition_5(inst): assert ( inst.combinedPharmaceuticalDoseForm.coding[0].code == "Powder and solution for injection with itegral syringe" ) assert ( inst.combinedPharmaceuticalDoseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org.uk/fhir/doseform"} ).valueUri ) assert inst.contained[0].id == "package" assert inst.contained[1].id == "solventItem" assert inst.contained[2].id == "powderItem" assert inst.contained[3].id == "syringeDevice" assert inst.contained[4].id == "administrable-form" assert inst.id == "drug-and-device-complete" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org.uk/fhir/product"} ).valueUri ) assert inst.identifier[0].value == "Wonderdrug+" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].productName == "Wonderdrug liquid 20ml (integral syringe)" assert inst.text.status == "generated" def test_medicinalproductdefinition_5(base_settings): """No. 5 tests collection for MedicinalProductDefinition. Test File: medicinalproductdefinition-example-co-packaged-liquid-and-syringe-complete.json """ filename = ( base_settings["unittest_data_dir"] / "medicinalproductdefinition-example-co-packaged-liquid-and-syringe-complete.json" ) inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json( filename.read_bytes() ) assert "MedicinalProductDefinition" == inst.get_resource_type() impl_medicinalproductdefinition_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicinalProductDefinition" == data["resourceType"] inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data) impl_medicinalproductdefinition_5(inst2) def impl_medicinalproductdefinition_6(inst): assert ( inst.combinedPharmaceuticalDoseForm.coding[0].code == "Tablet and Cream for topical application" ) assert ( inst.combinedPharmaceuticalDoseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org.uk/fhir/doseform"} ).valueUri ) assert inst.contained[0].id == "packageCombo" assert inst.contained[1].id == "tabletItem" assert inst.contained[2].id == "creamItem" assert inst.id == "drug-combo-product" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org.uk/fhir/product"} ).valueUri ) assert inst.identifier[0].value == "ThrushTreatCombo" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].productName == "ThrushTreat Combo" assert inst.text.status == "generated" def test_medicinalproductdefinition_6(base_settings): """No. 6 tests collection for MedicinalProductDefinition. Test File: medicinalproductdefinition-example-combo-product.json """ filename = ( base_settings["unittest_data_dir"] / "medicinalproductdefinition-example-combo-product.json" ) inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json( filename.read_bytes() ) assert "MedicinalProductDefinition" == inst.get_resource_type() impl_medicinalproductdefinition_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicinalProductDefinition" == data["resourceType"] inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data) impl_medicinalproductdefinition_6(inst2) def impl_medicinalproductdefinition_7(inst): assert inst.contained[0].id == "Acetamin-pack-20" assert inst.contained[1].id == "Acetamin-tab-500" assert inst.id == "Acetamin-500-20-generic" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.nation.org/drugs"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].productName == "Acetaminophen 500 mg tablets [generic]" assert inst.text.status == "generated" def test_medicinalproductdefinition_7(base_settings): """No. 7 tests collection for MedicinalProductDefinition. Test File: medicinalproductdefinition-acetaminophen-500mg-tablets-box-of-20.json """ filename = ( base_settings["unittest_data_dir"] / "medicinalproductdefinition-acetaminophen-500mg-tablets-box-of-20.json" ) inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json( filename.read_bytes() ) assert "MedicinalProductDefinition" == inst.get_resource_type() impl_medicinalproductdefinition_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicinalProductDefinition" == data["resourceType"] inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data) impl_medicinalproductdefinition_7(inst2) def impl_medicinalproductdefinition_8(inst): assert inst.attachedDocument[0].reference == "DocumentReference/example" assert inst.classification[0].coding[0].code == "B01AF02" assert ( inst.classification[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://ema.europa.eu/example/WHOAnatomicalTherapeuticChemicalATCClassificationSystem" } ).valueUri ) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/MPID"} ).valueUri ) assert inst.identifier[0].value == "{mpid}" assert inst.masterFile[0].reference == "DocumentReference/example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].countryLanguage[0].country.coding[0].code == "EU" assert ( inst.name[0].countryLanguage[0].country.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/countryCode"} ).valueUri ) assert inst.name[0].countryLanguage[0].jurisdiction.coding[0].code == "EU" assert ( inst.name[0].countryLanguage[0].jurisdiction.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/jurisdictionCode"} ).valueUri ) assert inst.name[0].countryLanguage[0].language.coding[0].code == "EN" assert ( inst.name[0].countryLanguage[0].language.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/languageCode"} ).valueUri ) assert inst.name[0].namePart[0].part == "Equilidem" assert inst.name[0].namePart[0].type.coding[0].code == "INV" assert inst.name[0].namePart[1].part == "2.5 mg" assert inst.name[0].namePart[1].type.coding[0].code == "STR" assert inst.name[0].namePart[2].part == "film-coated tablets" assert inst.name[0].namePart[2].type.coding[0].code == "FRM" assert inst.name[0].productName == "Equilidem 2.5 mg film-coated tablets" assert ( inst.operation[0].effectiveDate.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-15"} ).valueDateTime ) assert inst.operation[0].type.concept.coding[0].code == "Batchrelease" assert ( inst.operation[0].type.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/manufacturingOperationType"} ).valueUri ) assert inst.text.status == "generated" def test_medicinalproductdefinition_8(base_settings): """No. 8 tests collection for MedicinalProductDefinition. Test File: medicinalproductdefinition-example.json """ filename = ( base_settings["unittest_data_dir"] / "medicinalproductdefinition-example.json" ) inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json( filename.read_bytes() ) assert "MedicinalProductDefinition" == inst.get_resource_type() impl_medicinalproductdefinition_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicinalProductDefinition" == data["resourceType"] inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data) impl_medicinalproductdefinition_8(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_messagedefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/MessageDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import messagedefinition from .conftest import ExternalValidatorModel # noqa: F401 def impl_messagedefinition_1(inst): assert inst.category == "notification" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-11-09"} ).valueDateTime ) assert inst.eventCoding.code == "admin-notify" assert ( inst.eventCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/message-events"} ).valueUri ) assert inst.experimental is True assert inst.id == "example" assert inst.name == "EXAMPLE" assert inst.publisher == "Health Level Seven, Int'l" assert inst.purpose == ( "Defines a base example for other MessageDefinition " "instances." ) assert inst.status == "draft" assert inst.text.div == ( '
Message ' "definition base example
" ) assert inst.text.status == "generated" assert inst.title == "Message definition base example" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/MessageDefinition/example"} ).valueUri ) def test_messagedefinition_1(base_settings): """No. 1 tests collection for MessageDefinition. Test File: messagedefinition-example.json """ filename = base_settings["unittest_data_dir"] / "messagedefinition-example.json" inst = messagedefinition.MessageDefinition.model_validate_json( filename.read_bytes() ) assert "MessageDefinition" == inst.get_resource_type() impl_messagedefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MessageDefinition" == data["resourceType"] inst2 = messagedefinition.MessageDefinition(**data) impl_messagedefinition_1(inst2) def impl_messagedefinition_2(inst): assert ( inst.allowedResponse[0].message == "http://hl7.org/fhir/MessageDefinition/patient-link-response" ) assert inst.allowedResponse[0].situation == ( "Optional response message that may provide additional " "information" ) assert inst.base == "http://hl7.org/fhir/MessageDefinition/example" assert inst.category == "notification" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org" assert inst.copyright == "HL7.org 2011+" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-03"} ).valueDateTime ) assert inst.description == ( "Notification of two patient records that represent the same " "individual that require an established linkage." ) assert inst.eventCoding.code == "admin-notify" assert ( inst.eventCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/message-events"} ).valueUri ) assert inst.experimental is True assert inst.focus[0].code == "Patient" assert inst.focus[0].max == "2" assert inst.focus[0].min == 2 assert inst.focus[0].profile == "http://hl7.org/fhir/StructureDefinition/example" assert inst.id == "patient-link-notification" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9878" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America (the)" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.name == "PATIENT-LINK-NOTIFICATION" assert inst.publisher == "Health Level Seven, Int'l" assert inst.purpose == ( "Notifies recipient systems that two patients have been " "'linked' - meaning they represent the same individual" ) assert inst.status == "draft" assert inst.text.div == ( '
Link Patients ' "Notification
" ) assert inst.text.status == "generated" assert inst.title == "Link Patients Notification" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/MessageDefinition/patient-link-notification" } ).valueUri ) assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "positive" assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variant-state"} ).valueUri ) assert inst.version == "1" def test_messagedefinition_2(base_settings): """No. 2 tests collection for MessageDefinition. Test File: messagedefinition-patient-link-notification.json """ filename = ( base_settings["unittest_data_dir"] / "messagedefinition-patient-link-notification.json" ) inst = messagedefinition.MessageDefinition.model_validate_json( filename.read_bytes() ) assert "MessageDefinition" == inst.get_resource_type() impl_messagedefinition_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MessageDefinition" == data["resourceType"] inst2 = messagedefinition.MessageDefinition(**data) impl_messagedefinition_2(inst2) def impl_messagedefinition_3(inst): assert inst.base == "http://hl7.org/fhir/MessageDefinition/example" assert inst.category == "consequence" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org" assert inst.copyright == "HL7.org 2011+" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-03"} ).valueDateTime ) assert inst.description == "Optional response to a patient link notification." assert inst.eventCoding.code == "admin-notify" assert ( inst.eventCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/message-events"} ).valueUri ) assert inst.experimental is True assert inst.focus[0].code == "Patient" assert inst.focus[0].max == "2" assert inst.focus[0].min == 2 assert inst.focus[0].profile == "http://hl7.org/fhir/StructureDefinition/example" assert inst.id == "patient-link-response" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9879" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America (the)" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.name == "PATIENT-LINK-RESPONSE" assert inst.publisher == "Health Level Seven, Int'l" assert inst.purpose == ( "Optional response message that may provide additional " "information on the outcome of the patient link operation." ) assert inst.status == "draft" assert inst.text.div == ( '
Link Patients ' "Response
" ) assert inst.text.status == "generated" assert inst.title == "Link Patients Response" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/MessageDefinition/patient-link-response"} ).valueUri ) assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "positive" assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variant-state"} ).valueUri ) assert inst.version == "1" def test_messagedefinition_3(base_settings): """No. 3 tests collection for MessageDefinition. Test File: messagedefinition-patient-link-response.json """ filename = ( base_settings["unittest_data_dir"] / "messagedefinition-patient-link-response.json" ) inst = messagedefinition.MessageDefinition.model_validate_json( filename.read_bytes() ) assert "MessageDefinition" == inst.get_resource_type() impl_messagedefinition_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MessageDefinition" == data["resourceType"] inst2 = messagedefinition.MessageDefinition(**data) impl_messagedefinition_3(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_messageheader.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/MessageHeader Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import messageheader from .conftest import ExternalValidatorModel # noqa: F401 def impl_messageheader_1(inst): assert inst.author.reference == "Practitioner/example" assert ( inst.definition == "http:////acme.com/ehr/fhir/messagedefinition/patientrequest" ) assert ( inst.destination[0].endpoint == ExternalValidatorModel.model_validate( {"valueUrl": "llp:10.11.12.14:5432"} ).valueUrl ) assert inst.destination[0].name == "Acme Message Gateway" assert ( inst.destination[0].receiver.reference == "http://acme.com/ehr/fhir/Practitioner/2323-33-4" ) assert inst.destination[0].target.reference == "Device/example" assert inst.enterer.reference == "Practitioner/example" assert inst.eventCoding.code == "admin-notify" assert ( inst.eventCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/message-events"} ).valueUri ) assert inst.focus[0].reference == "Patient/example" assert inst.id == "1cbdfb97-5859-48a4-8301-d54eab818d68" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.reason.coding[0].code == "admit" assert ( inst.reason.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/message-reasons-encounter" } ).valueUri ) assert inst.response.code == "ok" assert inst.response.identifier == "5015fe84-8e76-4526-89d8-44b322e8d4fb" assert inst.sender.reference == "Organization/1" assert inst.source.contact.system == "phone" assert inst.source.contact.value == "+1 (555) 123 4567" assert ( inst.source.endpoint == ExternalValidatorModel.model_validate( {"valueUrl": "llp:10.11.12.13:5432"} ).valueUrl ) assert inst.source.name == "Acme Central Patient Registry" assert inst.source.software == "FooBar Patient Manager" assert inst.source.version == "3.1.45.AABB" assert inst.text.status == "generated" def test_messageheader_1(base_settings): """No. 1 tests collection for MessageHeader. Test File: messageheader-example.json """ filename = base_settings["unittest_data_dir"] / "messageheader-example.json" inst = messageheader.MessageHeader.model_validate_json(filename.read_bytes()) assert "MessageHeader" == inst.get_resource_type() impl_messageheader_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MessageHeader" == data["resourceType"] inst2 = messageheader.MessageHeader(**data) impl_messageheader_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_molecularsequence.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/MolecularSequence Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import molecularsequence from .conftest import ExternalValidatorModel # noqa: F401 def impl_molecularsequence_1(inst): assert inst.coordinateSystem == 0 assert inst.id == "breastcancer" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/brcapat" assert inst.referenceSeq.referenceSeqId.coding[0].code == "NM_000059.3" assert ( inst.referenceSeq.referenceSeqId.coding[0].display == "Homo sapiens BRCA2, DNA repair associated (BRCA2), mRNA" ) assert ( inst.referenceSeq.referenceSeqId.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.ncbi.nlm.nih.gov/nuccore/"} ).valueUri ) assert inst.referenceSeq.windowEnd == 101499444 assert inst.referenceSeq.windowStart == 101488058 assert inst.text.status == "generated" assert inst.type == "rna" assert inst.variant[0].end == 32316187 assert inst.variant[0].observedAllele == "A" assert inst.variant[0].referenceAllele == "C" assert inst.variant[0].start == 32316186 def test_molecularsequence_1(base_settings): """No. 1 tests collection for MolecularSequence. Test File: sequence-genetics-example-breastcancer.json """ filename = ( base_settings["unittest_data_dir"] / "sequence-genetics-example-breastcancer.json" ) inst = molecularsequence.MolecularSequence.model_validate_json( filename.read_bytes() ) assert "MolecularSequence" == inst.get_resource_type() impl_molecularsequence_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MolecularSequence" == data["resourceType"] inst2 = molecularsequence.MolecularSequence(**data) impl_molecularsequence_1(inst2) def impl_molecularsequence_2(inst): assert inst.coordinateSystem == 0 assert inst.id == "graphic-example-1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.pointer[0].reference == "MolecularSequence/graphic-example-2" assert inst.referenceSeq.referenceSeqId.coding[0].code == "NC_000002.12" assert ( inst.referenceSeq.referenceSeqId.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.ncbi.nlm.nih.gov/nuccore"} ).valueUri ) assert inst.referenceSeq.strand == "watson" assert inst.referenceSeq.windowEnd == 128273732 assert inst.referenceSeq.windowStart == 128273724 assert inst.text.status == "generated" assert inst.type == "dna" assert inst.variant[0].cigar == "1M" assert inst.variant[0].end == 128273726 assert inst.variant[0].observedAllele == "G" assert inst.variant[0].referenceAllele == "T" assert inst.variant[0].start == 128273725 def test_molecularsequence_2(base_settings): """No. 2 tests collection for MolecularSequence. Test File: sequence-graphic-example-1.json """ filename = base_settings["unittest_data_dir"] / "sequence-graphic-example-1.json" inst = molecularsequence.MolecularSequence.model_validate_json( filename.read_bytes() ) assert "MolecularSequence" == inst.get_resource_type() impl_molecularsequence_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MolecularSequence" == data["resourceType"] inst2 = molecularsequence.MolecularSequence(**data) impl_molecularsequence_2(inst2) def impl_molecularsequence_3(inst): assert inst.coordinateSystem == 1 assert inst.id == "fda-vcfeval-comparison" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert inst.quality[0].end == 101770080 assert float(inst.quality[0].gtFP) == float(2186) assert inst.quality[0].method.coding[0].code == "app-BxfGF8j02pBZzZxbzZxP725P" assert ( inst.quality[0].method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://precision.fda.gov/apps/"} ).valueUri ) assert inst.quality[0].method.text == "Vcfeval + Hap.py Comparison" assert float(inst.quality[0].precision) == float(0.428005) assert float(inst.quality[0].queryFP) == float(10670) assert float(inst.quality[0].recall) == float(0.752111) assert ( inst.quality[0].standardSequence.coding[0].code == "file-BkZxBZ00bpJVk2q6x43b1YBx" ) assert ( inst.quality[0].standardSequence.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://precision.fda.gov/files/"} ).valueUri ) assert inst.quality[0].start == 10453 assert float(inst.quality[0].truthFN) == float(2554) assert float(inst.quality[0].truthTP) == float(7749) assert inst.quality[0].type == "indel" assert inst.quality[1].end == 101770080 assert float(inst.quality[1].gtFP) == float(493) assert inst.quality[1].method.coding[0].code == "app-BxfGF8j02pBZzZxbzZxP725P" assert ( inst.quality[1].method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://precision.fda.gov/apps/"} ).valueUri ) assert inst.quality[1].method.text == "Vcfeval + Hap.py Comparison" assert float(inst.quality[1].precision) == float(0.808602) assert float(inst.quality[1].queryFP) == float(21744) assert float(inst.quality[1].recall) == float(0.986642) assert ( inst.quality[1].standardSequence.coding[0].code == "file-BkZxBZ00bpJVk2q6x43b1YBx" ) assert ( inst.quality[1].standardSequence.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://precision.fda.gov/files/"} ).valueUri ) assert inst.quality[1].start == 10453 assert float(inst.quality[1].truthFN) == float(1247) assert float(inst.quality[1].truthTP) == float(92106) assert inst.quality[1].type == "snp" assert inst.referenceSeq.referenceSeqId.coding[0].code == "NC_000001.11" assert ( inst.referenceSeq.referenceSeqId.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.ncbi.nlm.nih.gov/nuccore"} ).valueUri ) assert inst.referenceSeq.strand == "watson" assert inst.referenceSeq.windowEnd == 101770080 assert inst.referenceSeq.windowStart == 10453 assert inst.repository[0].name == "FDA" assert inst.repository[0].type == "login" assert ( inst.repository[0].url == ExternalValidatorModel.model_validate( {"valueUri": "https://precision.fda.gov/jobs/job-ByxYPx809jFVy21KJG74Jg3Y"} ).valueUri ) assert inst.text.status == "generated" assert inst.variant[0].end == 13117 assert inst.variant[0].observedAllele == "T" assert inst.variant[0].referenceAllele == "G" assert inst.variant[0].start == 13116 def test_molecularsequence_3(base_settings): """No. 3 tests collection for MolecularSequence. Test File: sequence-example-fda-vcfeval.json """ filename = base_settings["unittest_data_dir"] / "sequence-example-fda-vcfeval.json" inst = molecularsequence.MolecularSequence.model_validate_json( filename.read_bytes() ) assert "MolecularSequence" == inst.get_resource_type() impl_molecularsequence_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MolecularSequence" == data["resourceType"] inst2 = molecularsequence.MolecularSequence(**data) impl_molecularsequence_3(inst2) def impl_molecularsequence_4(inst): assert inst.coordinateSystem == 1 assert inst.device.display == "12 lead EKG Device Metric" assert inst.id == "sequence-complex-variant" assert inst.identifier[0].use == "official" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer.display == "HL7" assert inst.performer.reference == "Organization/hl7" assert float(inst.quantity.value) == float(25) assert inst.readCoverage == 1 assert inst.referenceSeq.referenceSeqId.coding[0].code == "NC_000002.12" assert ( inst.referenceSeq.referenceSeqId.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.ncbi.nlm.nih.gov/nuccore"} ).valueUri ) assert inst.referenceSeq.strand == "watson" assert inst.referenceSeq.windowEnd == 128273754 assert inst.referenceSeq.windowStart == 128273724 assert inst.repository[0].datasetId == "Ensembl" assert inst.repository[0].readsetId == "v1beta2" assert inst.repository[0].type == "other" assert inst.specimen.display == "Molecular Specimen ID: MLD45-Z4-1234" assert inst.specimen.reference == "Specimen/genetics-example1-somatic" assert inst.text.status == "generated" assert inst.type == "dna" assert inst.variant[0].cigar == "3M1D4M6N2M" assert inst.variant[0].end == 128273736 assert inst.variant[0].observedAllele == "CTCATTGT" assert inst.variant[0].referenceAllele == "CTCCATTGCATGCGTT" assert inst.variant[0].start == 128273724 def test_molecularsequence_4(base_settings): """No. 4 tests collection for MolecularSequence. Test File: sequence-complex-variant.json """ filename = base_settings["unittest_data_dir"] / "sequence-complex-variant.json" inst = molecularsequence.MolecularSequence.model_validate_json( filename.read_bytes() ) assert "MolecularSequence" == inst.get_resource_type() impl_molecularsequence_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MolecularSequence" == data["resourceType"] inst2 = molecularsequence.MolecularSequence(**data) impl_molecularsequence_4(inst2) def impl_molecularsequence_5(inst): assert inst.coordinateSystem == 1 assert inst.id == "example-TPMT-one" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.observedSeq == "T-C-C-C-A-C-C-C" assert inst.patient.reference == "Patient/example" assert inst.referenceSeq.referenceSeqId.coding[0].code == "NT_007592.15" assert ( inst.referenceSeq.referenceSeqId.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.ncbi.nlm.nih.gov/nuccore"} ).valueUri ) assert inst.referenceSeq.strand == "watson" assert inst.referenceSeq.windowEnd == 18143955 assert inst.referenceSeq.windowStart == 18130918 assert inst.text.status == "generated" assert inst.type == "dna" assert inst.variant[0].end == 18139214 assert inst.variant[0].observedAllele == "A" assert inst.variant[0].referenceAllele == "G" assert inst.variant[0].start == 18139214 def test_molecularsequence_5(base_settings): """No. 5 tests collection for MolecularSequence. Test File: sequence-example-TPMT-one.json """ filename = base_settings["unittest_data_dir"] / "sequence-example-TPMT-one.json" inst = molecularsequence.MolecularSequence.model_validate_json( filename.read_bytes() ) assert "MolecularSequence" == inst.get_resource_type() impl_molecularsequence_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MolecularSequence" == data["resourceType"] inst2 = molecularsequence.MolecularSequence(**data) impl_molecularsequence_5(inst2) def impl_molecularsequence_6(inst): assert inst.coordinateSystem == 0 assert inst.id == "example-pgx-2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert inst.referenceSeq.orientation == "sense" assert inst.referenceSeq.referenceSeqId.coding[0].code == "NG_007726.3" assert ( inst.referenceSeq.referenceSeqId.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.ncbi.nlm.nih.gov/nuccore"} ).valueUri ) assert inst.referenceSeq.strand == "watson" assert inst.referenceSeq.windowEnd == 55227980 assert inst.referenceSeq.windowStart == 55227970 assert inst.text.status == "generated" assert inst.type == "dna" assert inst.variant[0].end == 55227979 assert inst.variant[0].observedAllele == "G" assert inst.variant[0].referenceAllele == "T" assert inst.variant[0].start == 55227978 assert inst.variant[0].variantPointer.display == "Target Haplotype Observation" assert inst.variant[0].variantPointer.reference == "Observation/example-haplotype2" def test_molecularsequence_6(base_settings): """No. 6 tests collection for MolecularSequence. Test File: sequence-example-pgx-2.json """ filename = base_settings["unittest_data_dir"] / "sequence-example-pgx-2.json" inst = molecularsequence.MolecularSequence.model_validate_json( filename.read_bytes() ) assert "MolecularSequence" == inst.get_resource_type() impl_molecularsequence_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MolecularSequence" == data["resourceType"] inst2 = molecularsequence.MolecularSequence(**data) impl_molecularsequence_6(inst2) def impl_molecularsequence_7(inst): assert inst.coordinateSystem == 0 assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert inst.referenceSeq.referenceSeqId.coding[0].code == "NC_000009.11" assert ( inst.referenceSeq.referenceSeqId.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.ncbi.nlm.nih.gov/nuccore"} ).valueUri ) assert inst.referenceSeq.strand == "watson" assert inst.referenceSeq.windowEnd == 22125510 assert inst.referenceSeq.windowStart == 22125500 assert inst.repository[0].name == "GA4GH API" assert inst.repository[0].type == "openapi" assert ( inst.repository[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://grch37.rest.ensembl.org/ga4gh/variants/3:rs1333049?content-type=application/json" } ).valueUri ) assert inst.repository[0].variantsetId == "3:rs1333049" assert inst.text.status == "generated" assert inst.type == "dna" assert inst.variant[0].end == 22125504 assert inst.variant[0].observedAllele == "C" assert inst.variant[0].referenceAllele == "G" assert inst.variant[0].start == 22125503 def test_molecularsequence_7(base_settings): """No. 7 tests collection for MolecularSequence. Test File: molecularsequence-example.json """ filename = base_settings["unittest_data_dir"] / "molecularsequence-example.json" inst = molecularsequence.MolecularSequence.model_validate_json( filename.read_bytes() ) assert "MolecularSequence" == inst.get_resource_type() impl_molecularsequence_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MolecularSequence" == data["resourceType"] inst2 = molecularsequence.MolecularSequence(**data) impl_molecularsequence_7(inst2) def impl_molecularsequence_8(inst): assert inst.coordinateSystem == 1 assert inst.id == "fda-example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert inst.quality[0].end == 101770080 assert float(inst.quality[0].fScore) == float(0.545551) assert float(inst.quality[0].gtFP) == float(2186) assert inst.quality[0].method.coding[0].code == "job-ByxYPx809jFVy21KJG74Jg3Y" assert ( inst.quality[0].method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://precision.fda.gov/jobs/"} ).valueUri ) assert inst.quality[0].method.text == "Vcfeval + Hap.py Comparison" assert float(inst.quality[0].precision) == float(0.428005) assert float(inst.quality[0].queryFP) == float(10670) assert float(inst.quality[0].queryTP) == float(7984) assert float(inst.quality[0].recall) == float(0.752111) assert ( inst.quality[0].standardSequence.coding[0].code == "file-Bk50V4Q0qVb65P0v2VPbfYPZ" ) assert ( inst.quality[0].standardSequence.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://precision.fda.gov/files/"} ).valueUri ) assert inst.quality[0].start == 10453 assert float(inst.quality[0].truthFN) == float(2554) assert float(inst.quality[0].truthTP) == float(7749) assert inst.quality[0].type == "snp" assert inst.referenceSeq.referenceSeqId.coding[0].code == "NC_000001.11" assert ( inst.referenceSeq.referenceSeqId.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.ncbi.nlm.nih.gov/nuccore"} ).valueUri ) assert inst.referenceSeq.strand == "watson" assert inst.referenceSeq.windowEnd == 101770080 assert inst.referenceSeq.windowStart == 10453 assert inst.repository[0].name == "FDA" assert inst.repository[0].type == "login" assert ( inst.repository[0].url == ExternalValidatorModel.model_validate( { "valueUri": "https://precision.fda.gov/files/file-Bx37ZK009P4bX5g3qjkFZV38" } ).valueUri ) assert inst.repository[0].variantsetId == "file-Bx37ZK009P4bX5g3qjkFZV38" assert inst.text.status == "generated" assert inst.type == "dna" assert inst.variant[0].end == 13117 assert inst.variant[0].observedAllele == "T" assert inst.variant[0].referenceAllele == "G" assert inst.variant[0].start == 13116 def test_molecularsequence_8(base_settings): """No. 8 tests collection for MolecularSequence. Test File: sequence-example-fda.json """ filename = base_settings["unittest_data_dir"] / "sequence-example-fda.json" inst = molecularsequence.MolecularSequence.model_validate_json( filename.read_bytes() ) assert "MolecularSequence" == inst.get_resource_type() impl_molecularsequence_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MolecularSequence" == data["resourceType"] inst2 = molecularsequence.MolecularSequence(**data) impl_molecularsequence_8(inst2) def impl_molecularsequence_9(inst): assert inst.coordinateSystem == 1 assert inst.id == "coord-1-base" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.observedSeq == "ACATGGTAGC" assert inst.referenceSeq.referenceSeqString == "ACGTAGTC" assert inst.referenceSeq.strand == "watson" assert inst.referenceSeq.windowEnd == 8 assert inst.referenceSeq.windowStart == 1 assert inst.text.status == "generated" assert inst.type == "dna" assert inst.variant[0].cigar == "3I" assert inst.variant[0].end == 3 assert inst.variant[0].observedAllele == "ATG" assert inst.variant[0].referenceAllele == "-" assert inst.variant[0].start == 2 assert inst.variant[1].cigar == "3I" assert inst.variant[1].end == 5 assert inst.variant[1].observedAllele == "T" assert inst.variant[1].referenceAllele == "A" assert inst.variant[1].start == 5 assert inst.variant[2].cigar == "1D" assert inst.variant[2].end == 7 assert inst.variant[2].observedAllele == "-" assert inst.variant[2].referenceAllele == "T" assert inst.variant[2].start == 7 def test_molecularsequence_9(base_settings): """No. 9 tests collection for MolecularSequence. Test File: coord-1base-example.json """ filename = base_settings["unittest_data_dir"] / "coord-1base-example.json" inst = molecularsequence.MolecularSequence.model_validate_json( filename.read_bytes() ) assert "MolecularSequence" == inst.get_resource_type() impl_molecularsequence_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MolecularSequence" == data["resourceType"] inst2 = molecularsequence.MolecularSequence(**data) impl_molecularsequence_9(inst2) def impl_molecularsequence_10(inst): assert inst.coordinateSystem == 0 assert inst.id == "graphic-example-4" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.referenceSeq.chromosome.coding[0].code == "2" assert inst.referenceSeq.chromosome.coding[0].display == "chromosome 2" assert ( inst.referenceSeq.chromosome.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/chromosome-human"} ).valueUri ) assert inst.referenceSeq.genomeBuild == "GRCh 38" assert inst.referenceSeq.strand == "watson" assert inst.referenceSeq.windowEnd == 128273740 assert inst.referenceSeq.windowStart == 128273736 assert inst.text.status == "generated" assert inst.type == "dna" def test_molecularsequence_10(base_settings): """No. 10 tests collection for MolecularSequence. Test File: sequence-graphic-example-4.json """ filename = base_settings["unittest_data_dir"] / "sequence-graphic-example-4.json" inst = molecularsequence.MolecularSequence.model_validate_json( filename.read_bytes() ) assert "MolecularSequence" == inst.get_resource_type() impl_molecularsequence_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MolecularSequence" == data["resourceType"] inst2 = molecularsequence.MolecularSequence(**data) impl_molecularsequence_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_namingsystem.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/NamingSystem Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import namingsystem from .conftest import ExternalValidatorModel # noqa: F401 def impl_namingsystem_1(inst): assert inst.contact[0].name == "HL7 Australia FHIR Team" assert inst.contact[0].telecom[0].system == "url" assert ( inst.contact[0].telecom[0].value == "http://hl7-australia.wikispaces.com/FHIR+Australia" ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-31"} ).valueDateTime ) assert inst.description == ( "Australian HI Identifier as established by relevant " "regulations etc." ) assert inst.id == "example-id" assert inst.jurisdiction[0].coding[0].code == "AU" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.kind == "identifier" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Austalian Healthcare Identifier - Individual" assert inst.publisher == "HL7 Australia on behalf of NEHTA" assert inst.responsible == "HI Service Operator / NEHTA" assert inst.status == "active" assert inst.text.status == "generated" assert inst.type.coding[0].code == "NI" assert inst.type.coding[0].display == "National unique individual identifier" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.type.text == "IHI" assert inst.uniqueId[0].comment == "This value is used in Australian CDA documents" assert inst.uniqueId[0].type == "oid" assert inst.uniqueId[0].value == "1.2.36.1.2001.1003.0" assert ( inst.uniqueId[1].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-21"} ).valueDateTime ) assert inst.uniqueId[1].preferred is True assert inst.uniqueId[1].type == "uri" assert inst.uniqueId[1].value == "http://ns.electronichealth.net.au/id/hi/ihi/1.0" assert inst.usage == "Used in Australia for identifying patients" def test_namingsystem_1(base_settings): """No. 1 tests collection for NamingSystem. Test File: namingsystem-example-id.json """ filename = base_settings["unittest_data_dir"] / "namingsystem-example-id.json" inst = namingsystem.NamingSystem.model_validate_json(filename.read_bytes()) assert "NamingSystem" == inst.get_resource_type() impl_namingsystem_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NamingSystem" == data["resourceType"] inst2 = namingsystem.NamingSystem(**data) impl_namingsystem_1(inst2) def impl_namingsystem_2(inst): assert inst.contact[0].name == "FHIR project team" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-12-13"} ).valueDateTime ) assert inst.id == "example" assert inst.kind == "codesystem" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "SNOMED CT" assert inst.publisher == "HL7 International on behalf of IHTSDO" assert inst.responsible == "IHTSDO & affiliates" assert inst.status == "active" assert inst.text.status == "generated" assert inst.uniqueId[0].type == "oid" assert inst.uniqueId[0].value == "2.16.840.1.113883.6.96" assert inst.uniqueId[1].preferred is True assert inst.uniqueId[1].type == "uri" assert inst.uniqueId[1].value == "http://snomed.info/sct" def test_namingsystem_2(base_settings): """No. 2 tests collection for NamingSystem. Test File: namingsystem-example.json """ filename = base_settings["unittest_data_dir"] / "namingsystem-example.json" inst = namingsystem.NamingSystem.model_validate_json(filename.read_bytes()) assert "NamingSystem" == inst.get_resource_type() impl_namingsystem_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NamingSystem" == data["resourceType"] inst2 = namingsystem.NamingSystem(**data) impl_namingsystem_2(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_nutritionorder.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/NutritionOrder Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import nutritionorder from .conftest import ExternalValidatorModel # noqa: F401 def impl_nutritionorder_1(inst): assert inst.allergyIntolerance[0].display == "Cashew Nuts" assert inst.allergyIntolerance[0].reference == "AllergyIntolerance/example" assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17"} ).valueDateTime ) assert inst.encounter.display == "Inpatient" assert inst.encounter.reference == "Encounter/example" assert inst.excludeFoodModifier[0].coding[0].code == "227493005" assert inst.excludeFoodModifier[0].coding[0].display == "Cashew Nut" assert ( inst.excludeFoodModifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.excludeFoodModifier[0].coding[0].version == "20140730" assert inst.foodPreferenceModifier[0].coding[0].code == "kosher" assert ( inst.foodPreferenceModifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/diet"} ).valueUri ) assert inst.id == "diabeticsupplement" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/nutrition-requests"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.orderer.display == "Dr Adam Careful" assert inst.orderer.reference == "Practitioner/example" assert inst.patient.display == "Peter Chalmers" assert inst.patient.reference == "Patient/example" assert inst.status == "active" assert inst.supplement[0].productName == "Glucerna" assert inst.supplement[0].quantity.unit == "8 oz bottle" assert float(inst.supplement[0].quantity.value) == float(1) assert ( inst.supplement[0].schedule[0].repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-10T15:00:00Z"} ).valueDateTime ) assert inst.supplement[0].schedule[0].repeat.frequency == 1 assert float(inst.supplement[0].schedule[0].repeat.period) == float(24) assert inst.supplement[0].schedule[0].repeat.periodUnit == "h" assert float(inst.supplement[0].schedule[1].repeat.duration) == float(1) assert inst.supplement[0].schedule[1].repeat.durationUnit == "h" assert inst.supplement[0].schedule[1].repeat.when[0] == "HS" assert inst.supplement[0].type.coding[0].code == "443051000124104" assert ( inst.supplement[0].type.coding[0].display == "Adult diabetes specialty formula" ) assert ( inst.supplement[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.supplement[0].type.coding[1].code == "1010" assert inst.supplement[0].type.coding[1].display == "Adult diabetic formula" assert ( inst.supplement[0].type.coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/supplement-type-codes"} ).valueUri ) assert inst.supplement[0].type.text == "Adult diabetic formula" assert inst.text.status == "generated" def test_nutritionorder_1(base_settings): """No. 1 tests collection for NutritionOrder. Test File: nutritionorder-example-diabeticsupplement.json """ filename = ( base_settings["unittest_data_dir"] / "nutritionorder-example-diabeticsupplement.json" ) inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes()) assert "NutritionOrder" == inst.get_resource_type() impl_nutritionorder_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NutritionOrder" == data["resourceType"] inst2 = nutritionorder.NutritionOrder(**data) impl_nutritionorder_1(inst2) def impl_nutritionorder_2(inst): assert inst.allergyIntolerance[0].display == "Cashew Nuts" assert inst.allergyIntolerance[0].reference == "AllergyIntolerance/example" assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17"} ).valueDateTime ) assert inst.encounter.display == "Inpatient" assert inst.encounter.reference == "Encounter/example" assert inst.enteralFormula.additiveProductName == "Acme Lipid Additive" assert inst.enteralFormula.additiveType.coding[0].code == "lipid" assert inst.enteralFormula.additiveType.coding[0].display == "Lipid" assert ( inst.enteralFormula.additiveType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/entformula-additive"} ).valueUri ) assert inst.enteralFormula.administrationInstruction == "240 mls every 4hrs" assert inst.enteralFormula.administration[0].quantity.code == "mL" assert ( inst.enteralFormula.administration[0].quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.enteralFormula.administration[0].quantity.unit == "milliliters" assert float(inst.enteralFormula.administration[0].quantity.value) == float(240) assert ( inst.enteralFormula.administration[0].schedule.repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17T16:00:00Z"} ).valueDateTime ) assert inst.enteralFormula.administration[0].schedule.repeat.frequency == 1 assert float(inst.enteralFormula.administration[0].schedule.repeat.period) == float( 4 ) assert inst.enteralFormula.administration[0].schedule.repeat.periodUnit == "h" assert inst.enteralFormula.baseFormulaProductName == "Acme High Protein Formula" assert inst.enteralFormula.baseFormulaType.coding[0].code == "442991000124104" assert ( inst.enteralFormula.baseFormulaType.coding[0].display == "Adult high protein formula" ) assert ( inst.enteralFormula.baseFormulaType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.enteralFormula.caloricDensity.code == "cal/mL" assert ( inst.enteralFormula.caloricDensity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.enteralFormula.caloricDensity.unit == "calories per milliliter" assert float(inst.enteralFormula.caloricDensity.value) == float(1.5) assert inst.enteralFormula.maxVolumeToDeliver.code == "mL/d" assert ( inst.enteralFormula.maxVolumeToDeliver.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.enteralFormula.maxVolumeToDeliver.unit == "milliliter/day" assert float(inst.enteralFormula.maxVolumeToDeliver.value) == float(1440) assert inst.enteralFormula.routeofAdministration.coding[0].code == "GT" assert ( inst.enteralFormula.routeofAdministration.coding[0].display == "Instillation, gastrostomy tube" ) assert ( inst.enteralFormula.routeofAdministration.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration" } ).valueUri ) assert inst.excludeFoodModifier[0].coding[0].code == "227493005" assert inst.excludeFoodModifier[0].coding[0].display == "Cashew Nut" assert ( inst.excludeFoodModifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.excludeFoodModifier[0].coding[0].version == "20140730" assert inst.foodPreferenceModifier[0].coding[0].code == "dairy-free" assert ( inst.foodPreferenceModifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/diet"} ).valueUri ) assert inst.id == "enteralbolus" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.acme.org/nutritionorders"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.orderer.display == "Dr Adam Careful" assert inst.orderer.reference == "Practitioner/example" assert inst.patient.display == "Peter Chalmers" assert inst.patient.reference == "Patient/example" assert inst.status == "active" assert inst.text.status == "generated" def test_nutritionorder_2(base_settings): """No. 2 tests collection for NutritionOrder. Test File: nutritionorder-example-enteralbolus.json """ filename = ( base_settings["unittest_data_dir"] / "nutritionorder-example-enteralbolus.json" ) inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes()) assert "NutritionOrder" == inst.get_resource_type() impl_nutritionorder_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NutritionOrder" == data["resourceType"] inst2 = nutritionorder.NutritionOrder(**data) impl_nutritionorder_2(inst2) def impl_nutritionorder_3(inst): assert inst.allergyIntolerance[0].display == "Cashew Nuts" assert inst.allergyIntolerance[0].reference == "AllergyIntolerance/example" assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17"} ).valueDateTime ) assert inst.encounter.display == "Inpatient" assert inst.encounter.reference == "Encounter/example" assert inst.excludeFoodModifier[0].coding[0].code == "227493005" assert inst.excludeFoodModifier[0].coding[0].display == "Cashew Nut" assert ( inst.excludeFoodModifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.excludeFoodModifier[0].coding[0].version == "20140730" assert inst.foodPreferenceModifier[0].coding[0].code == "dairy-free" assert ( inst.foodPreferenceModifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/diet"} ).valueUri ) assert inst.id == "fiberrestricteddiet" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/nutrition-requests"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.oralDiet.nutrient[0].amount.code == "g" assert ( inst.oralDiet.nutrient[0].amount.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.oralDiet.nutrient[0].amount.unit == "grams" assert float(inst.oralDiet.nutrient[0].amount.value) == float(50) assert inst.oralDiet.nutrient[0].modifier.coding[0].code == "256674009" assert inst.oralDiet.nutrient[0].modifier.coding[0].display == "Fat" assert ( inst.oralDiet.nutrient[0].modifier.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.oralDiet.schedule[0].repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-10"} ).valueDateTime ) assert inst.oralDiet.schedule[0].repeat.frequency == 3 assert float(inst.oralDiet.schedule[0].repeat.period) == float(1) assert inst.oralDiet.schedule[0].repeat.periodUnit == "d" assert inst.oralDiet.type[0].coding[0].code == "15108003" assert inst.oralDiet.type[0].coding[0].display == "Restricted fiber diet" assert ( inst.oralDiet.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.type[0].coding[1].code == "1000" assert inst.oralDiet.type[0].coding[1].display == "Fiber restricted" assert ( inst.oralDiet.type[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/diet-type-codes"} ).valueUri ) assert inst.oralDiet.type[0].text == "Fiber restricted diet" assert inst.oralDiet.type[1].coding[0].code == "16208003" assert inst.oralDiet.type[1].coding[0].display == "Low fat diet" assert ( inst.oralDiet.type[1].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.type[1].coding[1].code == "1100" assert inst.oralDiet.type[1].coding[1].display == "Low Fat" assert ( inst.oralDiet.type[1].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/diet-type-codes"} ).valueUri ) assert inst.oralDiet.type[1].text == "Low fat diet" assert inst.orderer.display == "Dr Adam Careful" assert inst.orderer.reference == "Practitioner/example" assert inst.patient.display == "Peter Chalmers" assert inst.patient.reference == "Patient/example" assert inst.status == "active" assert inst.text.status == "generated" def test_nutritionorder_3(base_settings): """No. 3 tests collection for NutritionOrder. Test File: nutritionorder-example-fiberrestricteddiet.json """ filename = ( base_settings["unittest_data_dir"] / "nutritionorder-example-fiberrestricteddiet.json" ) inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes()) assert "NutritionOrder" == inst.get_resource_type() impl_nutritionorder_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NutritionOrder" == data["resourceType"] inst2 = nutritionorder.NutritionOrder(**data) impl_nutritionorder_3(inst2) def impl_nutritionorder_4(inst): assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17"} ).valueDateTime ) assert inst.id == "texturemodified" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/nutrition-requests"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.oralDiet.schedule[0].repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-10"} ).valueDateTime ) assert inst.oralDiet.schedule[0].repeat.frequency == 3 assert float(inst.oralDiet.schedule[0].repeat.period) == float(1) assert inst.oralDiet.schedule[0].repeat.periodUnit == "d" assert inst.oralDiet.texture[0].foodType.coding[0].code == "28647000" assert inst.oralDiet.texture[0].foodType.coding[0].display == "Meat" assert ( inst.oralDiet.texture[0].foodType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.texture[0].foodType.text == "Regular, Chopped Meat" assert inst.oralDiet.texture[0].modifier.coding[0].code == "228049004" assert inst.oralDiet.texture[0].modifier.coding[0].display == "Chopped food" assert ( inst.oralDiet.texture[0].modifier.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.texture[0].modifier.text == "Regular, Chopped Meat" assert inst.oralDiet.type[0].coding[0].code == "435801000124108" assert inst.oralDiet.type[0].coding[0].display == "Texture modified diet" assert ( inst.oralDiet.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.type[0].coding[1].code == "1010" assert inst.oralDiet.type[0].coding[1].display == "Texture modified diet" assert ( inst.oralDiet.type[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/diet-type-codes"} ).valueUri ) assert inst.oralDiet.type[0].text == "Texture modified diet" assert inst.orderer.display == "Dr Adam Careful" assert inst.orderer.reference == "Practitioner/example" assert inst.patient.display == "Peter Chalmers" assert inst.patient.reference == "Patient/example" assert inst.status == "active" assert inst.text.status == "generated" def test_nutritionorder_4(base_settings): """No. 4 tests collection for NutritionOrder. Test File: nutritionorder-example-texture-modified.json """ filename = ( base_settings["unittest_data_dir"] / "nutritionorder-example-texture-modified.json" ) inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes()) assert "NutritionOrder" == inst.get_resource_type() impl_nutritionorder_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NutritionOrder" == data["resourceType"] inst2 = nutritionorder.NutritionOrder(**data) impl_nutritionorder_4(inst2) def impl_nutritionorder_5(inst): assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17"} ).valueDateTime ) assert inst.id == "pureeddiet-simple" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/nutrition-requests"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.oralDiet.fluidConsistencyType[0].coding[0].code == "439021000124105" assert ( inst.oralDiet.fluidConsistencyType[0].coding[0].display == "Dietary liquid consistency - nectar thick liquid" ) assert ( inst.oralDiet.fluidConsistencyType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.fluidConsistencyType[0].text == "Nectar thick liquids" assert ( inst.oralDiet.schedule[0].repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-10"} ).valueDateTime ) assert inst.oralDiet.schedule[0].repeat.frequency == 3 assert float(inst.oralDiet.schedule[0].repeat.period) == float(1) assert inst.oralDiet.schedule[0].repeat.periodUnit == "d" assert inst.oralDiet.texture[0].modifier.coding[0].code == "228055009" assert inst.oralDiet.texture[0].modifier.coding[0].display == "Liquidized food" assert ( inst.oralDiet.texture[0].modifier.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.texture[0].modifier.text == "Pureed" assert inst.oralDiet.type[0].coding[0].code == "226211001" assert inst.oralDiet.type[0].coding[0].display == "Pureed diet" assert ( inst.oralDiet.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.type[0].coding[1].code == "1010" assert inst.oralDiet.type[0].coding[1].display == "Pureed diet" assert ( inst.oralDiet.type[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/diet-type-codes"} ).valueUri ) assert inst.oralDiet.type[0].text == "Pureed diet" assert inst.orderer.display == "Dr Adam Careful" assert inst.orderer.reference == "Practitioner/example" assert inst.patient.display == "Peter Chalmers" assert inst.patient.reference == "Patient/example" assert inst.status == "active" assert ( inst.supplement[0].instruction == "Ensure Pudding at breakfast, lunch, supper" ) assert inst.supplement[0].productName == "Ensure Pudding 4 oz container" assert inst.supplement[0].type.coding[0].code == "442971000124100" assert inst.supplement[0].type.coding[0].display == "Adult high energy formula" assert ( inst.supplement[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.supplement[0].type.coding[1].code == "1040" assert inst.supplement[0].type.coding[1].display == "Adult high energy pudding" assert ( inst.supplement[0].type.coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/supplement-type-codes"} ).valueUri ) assert inst.supplement[0].type.text == "Adult high energy pudding" assert inst.text.status == "generated" def test_nutritionorder_5(base_settings): """No. 5 tests collection for NutritionOrder. Test File: nutritionorder-example-pureeddiet-simple.json """ filename = ( base_settings["unittest_data_dir"] / "nutritionorder-example-pureeddiet-simple.json" ) inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes()) assert "NutritionOrder" == inst.get_resource_type() impl_nutritionorder_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NutritionOrder" == data["resourceType"] inst2 = nutritionorder.NutritionOrder(**data) impl_nutritionorder_5(inst2) def impl_nutritionorder_6(inst): assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17"} ).valueDateTime ) assert inst.encounter.display == "Inpatient" assert inst.encounter.reference == "Encounter/example" assert inst.enteralFormula.additiveProductName == "Acme High Carbohydrate Additive" assert inst.enteralFormula.additiveType.coding[0].code == "carbohydrate" assert inst.enteralFormula.additiveType.coding[0].display == "Carbohydrate" assert ( inst.enteralFormula.additiveType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/entformula-additive"} ).valueUri ) assert inst.enteralFormula.administrationInstruction == ( "Add high calorie high carbohydrate additive to increase " "cal/oz from 24 cal/oz to 27 cal/oz." ) assert inst.enteralFormula.administration[0].quantity.code == "[foz_us]" assert ( inst.enteralFormula.administration[0].quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.enteralFormula.administration[0].quantity.unit == "ounces" assert float(inst.enteralFormula.administration[0].quantity.value) == float(4) assert ( inst.enteralFormula.administration[0].schedule.repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17"} ).valueDateTime ) assert inst.enteralFormula.administration[0].schedule.repeat.frequency == 1 assert float(inst.enteralFormula.administration[0].schedule.repeat.period) == float( 3 ) assert inst.enteralFormula.administration[0].schedule.repeat.periodUnit == "h" assert inst.enteralFormula.baseFormulaProductName == "Acme Infant Formula + Iron" assert inst.enteralFormula.baseFormulaType.coding[0].code == "412414007" assert ( inst.enteralFormula.baseFormulaType.coding[0].display == "infant formula + iron" ) assert ( inst.enteralFormula.baseFormulaType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.enteralFormula.caloricDensity.code == "cal/[foz_us]" assert ( inst.enteralFormula.caloricDensity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.enteralFormula.caloricDensity.unit == "calories per ounce" assert float(inst.enteralFormula.caloricDensity.value) == float(20) assert inst.enteralFormula.maxVolumeToDeliver.code == "[foz_us]" assert ( inst.enteralFormula.maxVolumeToDeliver.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.enteralFormula.maxVolumeToDeliver.unit == "ounces" assert float(inst.enteralFormula.maxVolumeToDeliver.value) == float(32) assert inst.enteralFormula.routeofAdministration.coding[0].code == "PO" assert ( inst.enteralFormula.routeofAdministration.coding[0].display == "Swallow, oral" ) assert ( inst.enteralFormula.routeofAdministration.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration" } ).valueUri ) assert inst.enteralFormula.routeofAdministration.coding[0].userSelected is True assert inst.id == "infantenteral" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.acme.org/nutritionorders"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.orderer.display == "Dr Adam Careful" assert inst.orderer.reference == "Practitioner/example" assert inst.patient.display == "Peter Chalmers" assert inst.patient.reference == "Patient/example" assert inst.status == "active" assert inst.text.status == "generated" def test_nutritionorder_6(base_settings): """No. 6 tests collection for NutritionOrder. Test File: nutritionorder-example-infantenteral.json """ filename = ( base_settings["unittest_data_dir"] / "nutritionorder-example-infantenteral.json" ) inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes()) assert "NutritionOrder" == inst.get_resource_type() impl_nutritionorder_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NutritionOrder" == data["resourceType"] inst2 = nutritionorder.NutritionOrder(**data) impl_nutritionorder_6(inst2) def impl_nutritionorder_7(inst): assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17"} ).valueDateTime ) assert inst.encounter.display == "Inpatient" assert inst.encounter.reference == "Encounter/example" assert inst.enteralFormula.administrationInstruction == ( "Hold feedings from 7 pm to 7 am. Add MCT oil to increase " "calories from 1.0 cal/mL to 1.5 cal/mL" ) assert inst.enteralFormula.administration[0].rateQuantity.code == "mL/h" assert ( inst.enteralFormula.administration[0].rateQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.enteralFormula.administration[0].rateQuantity.unit == "ml/hr" assert float(inst.enteralFormula.administration[0].rateQuantity.value) == float(60) assert ( inst.enteralFormula.administration[0].schedule.repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17T07:00:00Z"} ).valueDateTime ) assert inst.enteralFormula.administration[1].rateQuantity.code == "mL/h" assert ( inst.enteralFormula.administration[1].rateQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.enteralFormula.administration[1].rateQuantity.unit == "ml/hr" assert float(inst.enteralFormula.administration[1].rateQuantity.value) == float(80) assert ( inst.enteralFormula.administration[1].schedule.repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17T11:00:00Z"} ).valueDateTime ) assert inst.enteralFormula.administration[2].rateQuantity.code == "mL/h" assert ( inst.enteralFormula.administration[2].rateQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.enteralFormula.administration[2].rateQuantity.unit == "ml/hr" assert float(inst.enteralFormula.administration[2].rateQuantity.value) == float(100) assert ( inst.enteralFormula.administration[2].schedule.repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17T15:00:00Z"} ).valueDateTime ) assert inst.enteralFormula.baseFormulaProductName == " Acme Diabetes Formula" assert inst.enteralFormula.baseFormulaType.coding[0].code == "6547210000124112" assert ( inst.enteralFormula.baseFormulaType.coding[0].display == "Diabetic specialty enteral formula" ) assert ( inst.enteralFormula.baseFormulaType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.enteralFormula.caloricDensity.code == "cal/mL" assert ( inst.enteralFormula.caloricDensity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.enteralFormula.caloricDensity.unit == "calories per milliliter" assert float(inst.enteralFormula.caloricDensity.value) == float(1) assert inst.enteralFormula.maxVolumeToDeliver.code == "mL/d" assert ( inst.enteralFormula.maxVolumeToDeliver.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.enteralFormula.maxVolumeToDeliver.unit == "milliliter/day" assert float(inst.enteralFormula.maxVolumeToDeliver.value) == float(880) assert inst.enteralFormula.routeofAdministration.coding[0].code == "NGT" assert ( inst.enteralFormula.routeofAdministration.coding[0].display == "Instillation, nasogastric tube" ) assert ( inst.enteralFormula.routeofAdministration.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration" } ).valueUri ) assert inst.id == "enteralcontinuous" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.acme.org/nutritionorders"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.orderer.display == "Dr Adam Careful" assert inst.orderer.reference == "Practitioner/example" assert inst.patient.display == "Peter Chalmers" assert inst.patient.reference == "Patient/example" assert inst.status == "active" assert inst.text.status == "generated" def test_nutritionorder_7(base_settings): """No. 7 tests collection for NutritionOrder. Test File: nutritionorder-example-enteralcontinuous.json """ filename = ( base_settings["unittest_data_dir"] / "nutritionorder-example-enteralcontinuous.json" ) inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes()) assert "NutritionOrder" == inst.get_resource_type() impl_nutritionorder_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NutritionOrder" == data["resourceType"] inst2 = nutritionorder.NutritionOrder(**data) impl_nutritionorder_7(inst2) def impl_nutritionorder_8(inst): assert inst.allergyIntolerance[0].display == "Cashew Nuts" assert inst.allergyIntolerance[0].reference == "AllergyIntolerance/example" assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17"} ).valueDateTime ) assert inst.encounter.display == "Inpatient" assert inst.encounter.reference == "Encounter/example" assert inst.excludeFoodModifier[0].coding[0].code == "227493005" assert inst.excludeFoodModifier[0].coding[0].display == "Cashew Nut" assert ( inst.excludeFoodModifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.excludeFoodModifier[0].coding[0].version == "20140730" assert inst.foodPreferenceModifier[0].coding[0].code == "dairy-free" assert ( inst.foodPreferenceModifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/diet"} ).valueUri ) assert inst.id == "cardiacdiet" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/nutrition-requests"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.oralDiet.instruction == "Starting on 2/10 breakfast, maximum 400 ml fluids per meal" ) assert inst.oralDiet.nutrient[0].amount.code == "g" assert ( inst.oralDiet.nutrient[0].amount.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.oralDiet.nutrient[0].amount.unit == "grams" assert float(inst.oralDiet.nutrient[0].amount.value) == float(2) assert inst.oralDiet.nutrient[0].modifier.coding[0].code == "39972003" assert inst.oralDiet.nutrient[0].modifier.coding[0].display == "Sodium" assert ( inst.oralDiet.nutrient[0].modifier.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.nutrient[1].amount.code == "mL" assert ( inst.oralDiet.nutrient[1].amount.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.oralDiet.nutrient[1].amount.unit == "milliliter" assert float(inst.oralDiet.nutrient[1].amount.value) == float(1500) assert inst.oralDiet.nutrient[1].modifier.coding[0].code == "33463005" assert inst.oralDiet.nutrient[1].modifier.coding[0].display == "Fluid" assert ( inst.oralDiet.nutrient[1].modifier.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.type[0].coding[0].code == "386619000" assert inst.oralDiet.type[0].coding[0].display == "Low sodium diet" assert ( inst.oralDiet.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.type[0].coding[1].code == "1040" assert inst.oralDiet.type[0].coding[1].display == "Low Sodium Diet" assert ( inst.oralDiet.type[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/diet-type-codes"} ).valueUri ) assert inst.oralDiet.type[0].text == "Low sodium diet" assert inst.oralDiet.type[1].coding[0].code == "226208002" assert inst.oralDiet.type[1].coding[0].display == "Fluid restricted diet" assert ( inst.oralDiet.type[1].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.type[1].coding[1].code == "1040" assert inst.oralDiet.type[1].coding[1].display == "Fluid restricted diet" assert ( inst.oralDiet.type[1].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/diet-type-codes"} ).valueUri ) assert inst.oralDiet.type[1].text == "Fluid restricted diet" assert inst.orderer.display == "Dr Adam Careful" assert inst.orderer.reference == "Practitioner/example" assert inst.patient.display == "Peter Chalmers" assert inst.patient.reference == "Patient/example" assert inst.status == "active" assert inst.text.status == "generated" def test_nutritionorder_8(base_settings): """No. 8 tests collection for NutritionOrder. Test File: nutritionorder-example-cardiacdiet.json """ filename = ( base_settings["unittest_data_dir"] / "nutritionorder-example-cardiacdiet.json" ) inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes()) assert "NutritionOrder" == inst.get_resource_type() impl_nutritionorder_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NutritionOrder" == data["resourceType"] inst2 = nutritionorder.NutritionOrder(**data) impl_nutritionorder_8(inst2) def impl_nutritionorder_9(inst): assert inst.allergyIntolerance[0].display == "Cashew Nuts" assert inst.allergyIntolerance[0].reference == "AllergyIntolerance/example" assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17"} ).valueDateTime ) assert inst.encounter.display == "Inpatient" assert inst.encounter.reference == "Encounter/example" assert inst.excludeFoodModifier[0].coding[0].code == "227493005" assert inst.excludeFoodModifier[0].coding[0].display == "Cashew Nut" assert ( inst.excludeFoodModifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.excludeFoodModifier[0].coding[0].version == "20140730" assert inst.foodPreferenceModifier[0].coding[0].code == "dairy-free" assert ( inst.foodPreferenceModifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/diet"} ).valueUri ) assert inst.id == "pureeddiet" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/nutrition-requests"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.oralDiet.fluidConsistencyType[0].coding[0].code == "439021000124105" assert ( inst.oralDiet.fluidConsistencyType[0].coding[0].display == "Dietary liquid consistency - nectar thick liquid" ) assert ( inst.oralDiet.fluidConsistencyType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.fluidConsistencyType[0].text == "Nectar thick liquids" assert ( inst.oralDiet.schedule[0].repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-10"} ).valueDateTime ) assert inst.oralDiet.schedule[0].repeat.frequency == 3 assert float(inst.oralDiet.schedule[0].repeat.period) == float(1) assert inst.oralDiet.schedule[0].repeat.periodUnit == "d" assert inst.oralDiet.texture[0].modifier.coding[0].code == "228055009" assert inst.oralDiet.texture[0].modifier.coding[0].display == "Liquidized food" assert ( inst.oralDiet.texture[0].modifier.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.texture[0].modifier.text == "Pureed" assert inst.oralDiet.type[0].coding[0].code == "226211001" assert inst.oralDiet.type[0].coding[0].display == "Pureed diet" assert ( inst.oralDiet.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.type[0].coding[1].code == "1010" assert inst.oralDiet.type[0].coding[1].display == "Pureed diet" assert ( inst.oralDiet.type[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/diet-type-codes"} ).valueUri ) assert inst.oralDiet.type[0].text == "Pureed diet" assert inst.orderer.display == "Dr Adam Careful" assert inst.orderer.reference == "Practitioner/example" assert inst.patient.display == "Peter Chalmers" assert inst.patient.reference == "Patient/example" assert inst.status == "active" assert inst.text.status == "generated" def test_nutritionorder_9(base_settings): """No. 9 tests collection for NutritionOrder. Test File: nutritionorder-example-pureeddiet.json """ filename = ( base_settings["unittest_data_dir"] / "nutritionorder-example-pureeddiet.json" ) inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes()) assert "NutritionOrder" == inst.get_resource_type() impl_nutritionorder_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NutritionOrder" == data["resourceType"] inst2 = nutritionorder.NutritionOrder(**data) impl_nutritionorder_9(inst2) def impl_nutritionorder_10(inst): assert inst.allergyIntolerance[0].display == "Cashew Nuts" assert inst.allergyIntolerance[0].reference == "AllergyIntolerance/example" assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17"} ).valueDateTime ) assert inst.encounter.display == "Inpatient" assert inst.encounter.reference == "Encounter/example" assert inst.excludeFoodModifier[0].coding[0].code == "227493005" assert inst.excludeFoodModifier[0].coding[0].display == "Cashew Nut" assert ( inst.excludeFoodModifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.excludeFoodModifier[0].coding[0].version == "20140730" assert inst.foodPreferenceModifier[0].coding[0].code == "dairy-free" assert ( inst.foodPreferenceModifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/diet"} ).valueUri ) assert inst.id == "diabeticdiet" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/nutrition-requests"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.oralDiet.nutrient[0].amount.code == "g" assert ( inst.oralDiet.nutrient[0].amount.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.oralDiet.nutrient[0].amount.unit == "grams" assert float(inst.oralDiet.nutrient[0].amount.value) == float(75) assert inst.oralDiet.nutrient[0].modifier.coding[0].code == "2331003" assert inst.oralDiet.nutrient[0].modifier.coding[0].display == "Carbohydrate" assert ( inst.oralDiet.nutrient[0].modifier.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.oralDiet.schedule[0].repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-10"} ).valueDateTime ) assert inst.oralDiet.schedule[0].repeat.frequency == 3 assert float(inst.oralDiet.schedule[0].repeat.period) == float(1) assert inst.oralDiet.schedule[0].repeat.periodUnit == "d" assert inst.oralDiet.type[0].coding[0].code == "160670007" assert inst.oralDiet.type[0].coding[0].display == "Diabetic diet" assert ( inst.oralDiet.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.type[0].coding[1].code == "1030" assert inst.oralDiet.type[0].coding[1].display == "DD - Diabetic diet" assert ( inst.oralDiet.type[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/diet-type-codes"} ).valueUri ) assert inst.oralDiet.type[0].text == "DD - Diabetic diet" assert inst.orderer.display == "Dr Adam Careful" assert inst.orderer.reference == "Practitioner/example" assert inst.patient.display == "Peter Chalmers" assert inst.patient.reference == "Patient/example" assert inst.status == "active" assert inst.text.status == "generated" def test_nutritionorder_10(base_settings): """No. 10 tests collection for NutritionOrder. Test File: nutritionorder-example-diabeticdiet.json """ filename = ( base_settings["unittest_data_dir"] / "nutritionorder-example-diabeticdiet.json" ) inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes()) assert "NutritionOrder" == inst.get_resource_type() impl_nutritionorder_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NutritionOrder" == data["resourceType"] inst2 = nutritionorder.NutritionOrder(**data) impl_nutritionorder_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_nutritionproduct.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/NutritionProduct Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import nutritionproduct from .conftest import ExternalValidatorModel # noqa: F401 def impl_nutritionproduct_1(inst): assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "active" assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" def test_nutritionproduct_1(base_settings): """No. 1 tests collection for NutritionProduct. Test File: nutritionproduct-example.json """ filename = base_settings["unittest_data_dir"] / "nutritionproduct-example.json" inst = nutritionproduct.NutritionProduct.model_validate_json(filename.read_bytes()) assert "NutritionProduct" == inst.get_resource_type() impl_nutritionproduct_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NutritionProduct" == data["resourceType"] inst2 = nutritionproduct.NutritionProduct(**data) impl_nutritionproduct_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_observation.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Observation Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import observation from .conftest import ExternalValidatorModel # noqa: F401 def impl_observation_1(inst): assert inst.code.coding[0].code == "55233-1" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.device.reference == "Device/example" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-04-03T15:30:10+01:00"} ).valueDateTime ) assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/observation-geneticsGene" } ).valueUri ) assert inst.extension[0].valueCodeableConcept.coding[0].code == "3236" assert inst.extension[0].valueCodeableConcept.coding[0].display == "EGFR" assert ( inst.extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.genenames.org"} ).valueUri ) assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/observation-geneticsDNARegionName" } ).valueUri ) assert inst.extension[1].valueString == "Exon 21" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/observation-geneticsGenomicSourceClass" } ).valueUri ) assert inst.extension[2].valueCodeableConcept.coding[0].code == "LA6684-0" assert inst.extension[2].valueCodeableConcept.coding[0].display == "somatic" assert ( inst.extension[2].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.id == "example-genetics-1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].display == "Molecular Diagnostics Laboratory" assert inst.performer[0].reference == "Practitioner/example" assert inst.status == "final" assert inst.subject.display == "Molecular Lab Patient ID: HOSP-23456" assert inst.subject.reference == "Patient/example" assert inst.text.status == "extensions" assert inst.valueCodeableConcept.coding[0].code == "10828004" assert inst.valueCodeableConcept.coding[0].display == "Positive" assert ( inst.valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_observation_1(base_settings): """No. 1 tests collection for Observation. Test File: observation-example-genetics-1.json """ filename = ( base_settings["unittest_data_dir"] / "observation-example-genetics-1.json" ) inst = observation.Observation.model_validate_json(filename.read_bytes()) assert "Observation" == inst.get_resource_type() impl_observation_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Observation" == data["resourceType"] inst2 = observation.Observation(**data) impl_observation_1(inst2) def impl_observation_2(inst): assert inst.bodySite.coding[0].code == "71341001:272741003=7771000" assert ( inst.bodySite.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.bodySite.text == "Left Femur" assert inst.code.coding[0].code == "24701-5" assert inst.code.coding[0].display == "Femur DXA Bone density" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.code.text == "BMD - Left Femur" assert inst.id == "bmd" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].display == "Acme Imaging Diagnostics" assert ( inst.performer[0].reference == "Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" ) assert inst.status == "final" assert inst.subject.reference == "Patient/pat2" assert inst.text.status == "generated" assert inst.valueQuantity.code == "g/cm-2" assert ( inst.valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.valueQuantity.unit == "g/cm²" assert float(inst.valueQuantity.value) == float(0.887) def test_observation_2(base_settings): """No. 2 tests collection for Observation. Test File: observation-example-bmd.json """ filename = base_settings["unittest_data_dir"] / "observation-example-bmd.json" inst = observation.Observation.model_validate_json(filename.read_bytes()) assert "Observation" == inst.get_resource_type() impl_observation_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Observation" == data["resourceType"] inst2 = observation.Observation(**data) impl_observation_2(inst2) def impl_observation_3(inst): assert inst.category[0].coding[0].code == "vital-signs" assert inst.category[0].coding[0].display == "Vital Signs" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/observation-category"} ).valueUri ) assert inst.category[0].text == "Vital Signs" assert inst.code.coding[0].code == "9279-1" assert inst.code.coding[0].display == "Respiratory rate" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.code.text == "Respiratory rate" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "1999-07-02"} ).valueDateTime ) assert inst.id == "respiratory-rate" assert inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/vitalsigns" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "final" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" assert inst.valueQuantity.code == "/min" assert ( inst.valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.valueQuantity.unit == "breaths/minute" assert float(inst.valueQuantity.value) == float(26) def test_observation_3(base_settings): """No. 3 tests collection for Observation. Test File: observation-example-respiratory-rate.json """ filename = ( base_settings["unittest_data_dir"] / "observation-example-respiratory-rate.json" ) inst = observation.Observation.model_validate_json(filename.read_bytes()) assert "Observation" == inst.get_resource_type() impl_observation_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Observation" == data["resourceType"] inst2 = observation.Observation(**data) impl_observation_3(inst2) def impl_observation_4(inst): assert inst.category[0].coding[0].code == "vital-signs" assert inst.category[0].coding[0].display == "Vital Signs" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/observation-category"} ).valueUri ) assert inst.code.coding[0].code == "29463-7" assert inst.code.coding[0].display == "Body Weight" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.code.coding[1].code == "3141-9" assert inst.code.coding[1].display == "Body weight Measured" assert ( inst.code.coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.code.coding[2].code == "27113001" assert inst.code.coding[2].display == "Body weight" assert ( inst.code.coding[2].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.coding[3].code == "body-weight" assert inst.code.coding[3].display == "Body Weight" assert ( inst.code.coding[3].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org/devices/clinical-codes"} ).valueUri ) assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-03-28"} ).valueDateTime ) assert inst.encounter.reference == "Encounter/example" assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "final" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" assert inst.valueQuantity.code == "[lb_av]" assert ( inst.valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.valueQuantity.unit == "lbs" assert float(inst.valueQuantity.value) == float(185) def test_observation_4(base_settings): """No. 4 tests collection for Observation. Test File: observation-example.json """ filename = base_settings["unittest_data_dir"] / "observation-example.json" inst = observation.Observation.model_validate_json(filename.read_bytes()) assert "Observation" == inst.get_resource_type() impl_observation_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Observation" == data["resourceType"] inst2 = observation.Observation(**data) impl_observation_4(inst2) def impl_observation_5(inst): assert inst.code.coding[0].code == "55233-1" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.derivedFrom[0].reference == "MolecularSequence/example-pgx-1" assert inst.derivedFrom[1].reference == "MolecularSequence/example-pgx-2" assert inst.device.reference == "Device/example" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-04-03T15:30:10+01:00"} ).valueDateTime ) assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/observation-geneticsGene" } ).valueUri ) assert inst.extension[0].valueCodeableConcept.coding[0].code == "2623" assert inst.extension[0].valueCodeableConcept.coding[0].display == "CYP2C9" assert ( inst.extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.genenames.org"} ).valueUri ) assert inst.id == "example-haplotype2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "unknown" assert inst.subject.display == "J*********** C***********" assert inst.subject.reference == "Patient/727127" assert inst.text.status == "extensions" assert inst.valueCodeableConcept.coding[0].code == "PA16581679" assert inst.valueCodeableConcept.coding[0].display == "*4" assert ( inst.valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://pharmakb.org"} ).valueUri ) def test_observation_5(base_settings): """No. 5 tests collection for Observation. Test File: observation-example-haplotype2.json """ filename = ( base_settings["unittest_data_dir"] / "observation-example-haplotype2.json" ) inst = observation.Observation.model_validate_json(filename.read_bytes()) assert "Observation" == inst.get_resource_type() impl_observation_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Observation" == data["resourceType"] inst2 = observation.Observation(**data) impl_observation_5(inst2) def impl_observation_6(inst): assert inst.category[0].coding[0].code == "vital-signs" assert inst.category[0].coding[0].display == "Vital Signs" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/observation-category"} ).valueUri ) assert inst.category[0].text == "Vital Signs" assert inst.code.coding[0].code == "8478-0" assert inst.code.coding[0].display == "Mean blood pressure" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.code.text == "Mean blood pressure" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "1999-07-02"} ).valueDateTime ) assert inst.id == "mbp" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "final" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" assert inst.valueQuantity.code == "mm[Hg]" assert ( inst.valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.valueQuantity.unit == "mm[Hg]" assert float(inst.valueQuantity.value) == float(80) def test_observation_6(base_settings): """No. 6 tests collection for Observation. Test File: observation-example-mbp.json """ filename = base_settings["unittest_data_dir"] / "observation-example-mbp.json" inst = observation.Observation.model_validate_json(filename.read_bytes()) assert "Observation" == inst.get_resource_type() impl_observation_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Observation" == data["resourceType"] inst2 = observation.Observation(**data) impl_observation_6(inst2) def impl_observation_7(inst): assert inst.code.coding[0].code == "59041-4" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.device.reference == "Device/example" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-03-03T14:50:23-05:00"} ).valueDateTime ) assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/observation-geneticsGene" } ).valueUri ) assert inst.extension[0].valueCodeableConcept.coding[0].code == "KX470182.1" assert inst.extension[0].valueCodeableConcept.coding[0].display == "BRCA" assert ( inst.extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.ncbi.nlm.nih.gov/nuccore"} ).valueUri ) assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity" } ).valueUri ) assert inst.extension[1].valueCodeableConcept.coding[0].code == "413581001" assert ( inst.extension[1].valueCodeableConcept.coding[0].display == "Unknown racial group" ) assert ( inst.extension[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://browser.ihtsdotools.org/"} ).valueUri ) assert inst.id == "example-genetics-brcapat" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "final" assert inst.subject.display == "Patient1 with Breast Cancer FamilyHistory" assert inst.subject.reference == "Patient/brcapat" assert inst.text.status == "extensions" def test_observation_7(base_settings): """No. 7 tests collection for Observation. Test File: observation-example-genetics-brcapat.json """ filename = ( base_settings["unittest_data_dir"] / "observation-example-genetics-brcapat.json" ) inst = observation.Observation.model_validate_json(filename.read_bytes()) assert "Observation" == inst.get_resource_type() impl_observation_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Observation" == data["resourceType"] inst2 = observation.Observation(**data) impl_observation_7(inst2) def impl_observation_8(inst): assert inst.category[0].coding[0].code == "vital-signs" assert inst.category[0].coding[0].display == "Vital Signs" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/observation-category"} ).valueUri ) assert inst.category[0].text == "Vital Signs" assert inst.code.coding[0].code == "39156-5" assert inst.code.coding[0].display == "Body mass index (BMI) [Ratio]" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.code.text == "BMI" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "1999-07-02"} ).valueDateTime ) assert inst.id == "bmi" assert inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/vitalsigns" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "final" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" assert inst.valueQuantity.code == "kg/m2" assert ( inst.valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.valueQuantity.unit == "kg/m2" assert float(inst.valueQuantity.value) == float(16.2) def test_observation_8(base_settings): """No. 8 tests collection for Observation. Test File: observation-example-bmi.json """ filename = base_settings["unittest_data_dir"] / "observation-example-bmi.json" inst = observation.Observation.model_validate_json(filename.read_bytes()) assert "Observation" == inst.get_resource_type() impl_observation_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Observation" == data["resourceType"] inst2 = observation.Observation(**data) impl_observation_8(inst2) def impl_observation_9(inst): assert inst.category[0].coding[0].code == "vital-signs" assert inst.category[0].coding[0].display == "Vital Signs" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/observation-category"} ).valueUri ) assert inst.category[0].text == "Vital Signs" assert inst.code.coding[0].code == "8302-2" assert inst.code.coding[0].display == "Body height" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.code.text == "Body height" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "1999-07-02"} ).valueDateTime ) assert inst.id == "body-height" assert inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/vitalsigns" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "final" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" assert inst.valueQuantity.code == "[in_i]" assert ( inst.valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.valueQuantity.unit == "in" assert float(inst.valueQuantity.value) == float(66.89999999999999) def test_observation_9(base_settings): """No. 9 tests collection for Observation. Test File: observation-example-body-height.json """ filename = ( base_settings["unittest_data_dir"] / "observation-example-body-height.json" ) inst = observation.Observation.model_validate_json(filename.read_bytes()) assert "Observation" == inst.get_resource_type() impl_observation_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Observation" == data["resourceType"] inst2 = observation.Observation(**data) impl_observation_9(inst2) def impl_observation_10(inst): assert inst.code.text == "eye color" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-05-18"} ).valueDateTime ) assert inst.id == "eye-color" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "final" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" assert inst.valueString == "blue" def test_observation_10(base_settings): """No. 10 tests collection for Observation. Test File: observation-example-eye-color.json """ filename = base_settings["unittest_data_dir"] / "observation-example-eye-color.json" inst = observation.Observation.model_validate_json(filename.read_bytes()) assert "Observation" == inst.get_resource_type() impl_observation_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Observation" == data["resourceType"] inst2 = observation.Observation(**data) impl_observation_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_observationdefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ObservationDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import observationdefinition from .conftest import ExternalValidatorModel # noqa: F401 def impl_observationdefinition_1(inst): assert inst.code.coding[0].code == "15074-8" assert inst.code.coding[0].display == "Glucose [Moles/volume] in Blood" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_observationdefinition_1(base_settings): """No. 1 tests collection for ObservationDefinition. Test File: observationdefinition-example.json """ filename = base_settings["unittest_data_dir"] / "observationdefinition-example.json" inst = observationdefinition.ObservationDefinition.model_validate_json( filename.read_bytes() ) assert "ObservationDefinition" == inst.get_resource_type() impl_observationdefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ObservationDefinition" == data["resourceType"] inst2 = observationdefinition.ObservationDefinition(**data) impl_observationdefinition_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_operationdefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/OperationDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import operationdefinition from .conftest import ExternalValidatorModel # noqa: F401 def impl_operationdefinition_1(inst): assert inst.affectsState is False assert inst.code == "data-requirements" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.description == ( "The data-requirements operation aggregates and returns the " "parameters and data requirements for the measure and all its" " dependencies as a single module definition" ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[0].valueInteger == 3 assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert inst.id == "Measure-data-requirements" assert inst.instance is True assert inst.kind == "operation" assert inst.name == "DataRequirements" assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 1 assert inst.parameter[0].name == "periodStart" assert inst.parameter[0].type == "date" assert inst.parameter[0].use == "in" assert inst.parameter[1].documentation == ( "The end of the measurement period. The period will end at " "the end of the period implied by the supplied timestamp. " "E.g. a value of 2014 would set the period end to be " "2014-12-31T23:59:59 inclusive" ) assert inst.parameter[1].max == "1" assert inst.parameter[1].min == 1 assert inst.parameter[1].name == "periodEnd" assert inst.parameter[1].type == "date" assert inst.parameter[1].use == "in" assert inst.parameter[2].documentation == ( "The result of the requirements gathering is a module-" "definition Library that describes the aggregate parameters, " "data requirements, and dependencies of the measure" ) assert inst.parameter[2].max == "1" assert inst.parameter[2].min == 1 assert inst.parameter[2].name == "return" assert inst.parameter[2].type == "Library" assert inst.parameter[2].use == "out" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "Measure" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "extensions" assert inst.title == "Data Requirements" assert inst.type is False assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/OperationDefinition/Measure-data-requirements" } ).valueUri ) assert inst.version == "4.3.0" def test_operationdefinition_1(base_settings): """No. 1 tests collection for OperationDefinition. Test File: operation-measure-data-requirements.json """ filename = ( base_settings["unittest_data_dir"] / "operation-measure-data-requirements.json" ) inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_1(inst2) def impl_operationdefinition_2(inst): assert inst.affectsState is False assert inst.code == "translate" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[0].valueInteger == 3 assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert inst.id == "ConceptMap-translate" assert inst.instance is True assert inst.kind == "operation" assert inst.name == "Translate" assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 0 assert inst.parameter[0].name == "url" assert inst.parameter[0].type == "uri" assert inst.parameter[0].use == "in" assert inst.parameter[1].documentation == ( "The concept map is provided directly as part of the request." " Servers may choose not to accept concept maps in this " "fashion." ) assert inst.parameter[1].max == "1" assert inst.parameter[1].min == 0 assert inst.parameter[1].name == "conceptMap" assert inst.parameter[1].type == "ConceptMap" assert inst.parameter[1].use == "in" assert inst.parameter[2].max == "1" assert inst.parameter[2].min == 0 assert inst.parameter[2].name == "conceptMapVersion" assert inst.parameter[2].type == "string" assert inst.parameter[2].use == "in" assert inst.parameter[3].documentation == ( "The code that is to be translated. If a code is provided, a " "system must be provided" ) assert inst.parameter[3].max == "1" assert inst.parameter[3].min == 0 assert inst.parameter[3].name == "code" assert inst.parameter[3].type == "code" assert inst.parameter[3].use == "in" assert ( inst.parameter[4].documentation == "The system for the code that is to be translated" ) assert inst.parameter[4].max == "1" assert inst.parameter[4].min == 0 assert inst.parameter[4].name == "system" assert inst.parameter[4].type == "uri" assert inst.parameter[4].use == "in" assert inst.parameter[5].documentation == ( "The version of the system, if one was provided in the source" " data" ) assert inst.parameter[5].max == "1" assert inst.parameter[5].min == 0 assert inst.parameter[5].name == "version" assert inst.parameter[5].type == "string" assert inst.parameter[5].use == "in" assert inst.parameter[6].max == "1" assert inst.parameter[6].min == 0 assert inst.parameter[6].name == "source" assert inst.parameter[6].type == "uri" assert inst.parameter[6].use == "in" assert inst.parameter[7].documentation == "A coding to translate" assert inst.parameter[7].max == "1" assert inst.parameter[7].min == 0 assert inst.parameter[7].name == "coding" assert inst.parameter[7].type == "Coding" assert inst.parameter[7].use == "in" assert inst.parameter[8].documentation == ( "A full codeableConcept to validate. The server can translate" " any of the coding values (e.g. existing translations) as it" " chooses" ) assert inst.parameter[8].max == "1" assert inst.parameter[8].min == 0 assert inst.parameter[8].name == "codeableConcept" assert inst.parameter[8].type == "CodeableConcept" assert inst.parameter[8].use == "in" assert inst.parameter[9].max == "1" assert inst.parameter[9].min == 0 assert inst.parameter[9].name == "target" assert inst.parameter[9].type == "uri" assert inst.parameter[9].use == "in" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "ConceptMap" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "extensions" assert inst.title == "Concept Translation" assert inst.type is True assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/OperationDefinition/ConceptMap-translate"} ).valueUri ) assert inst.version == "4.3.0" def test_operationdefinition_2(base_settings): """No. 2 tests collection for OperationDefinition. Test File: operation-conceptmap-translate.json """ filename = ( base_settings["unittest_data_dir"] / "operation-conceptmap-translate.json" ) inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_2(inst2) def impl_operationdefinition_3(inst): assert inst.affectsState is False assert inst.code == "expand" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[0].valueInteger == 5 assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "normative" assert inst.id == "ValueSet-expand" assert inst.instance is True assert inst.kind == "operation" assert inst.name == "Expand" assert inst.parameter[0].documentation == ( "A canonical reference to a value set. The server must know " "the value set (e.g. it is defined explicitly in the server's" " value sets, or it is defined implicitly by some code system" " known to the server" ) assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 0 assert inst.parameter[0].name == "url" assert inst.parameter[0].type == "uri" assert inst.parameter[0].use == "in" assert inst.parameter[1].documentation == ( "The value set is provided directly as part of the request. " "Servers may choose not to accept value sets in this fashion" ) assert inst.parameter[1].max == "1" assert inst.parameter[1].min == 0 assert inst.parameter[1].name == "valueSet" assert inst.parameter[1].type == "ValueSet" assert inst.parameter[1].use == "in" assert inst.parameter[2].max == "1" assert inst.parameter[2].min == 0 assert inst.parameter[2].name == "valueSetVersion" assert inst.parameter[2].type == "string" assert inst.parameter[2].use == "in" assert inst.parameter[3].max == "1" assert inst.parameter[3].min == 0 assert inst.parameter[3].name == "context" assert inst.parameter[3].type == "uri" assert inst.parameter[3].use == "in" assert inst.parameter[4].max == "1" assert inst.parameter[4].min == 0 assert inst.parameter[4].name == "contextDirection" assert inst.parameter[4].type == "code" assert inst.parameter[4].use == "in" assert inst.parameter[5].max == "1" assert inst.parameter[5].min == 0 assert inst.parameter[5].name == "filter" assert inst.parameter[5].type == "string" assert inst.parameter[5].use == "in" assert inst.parameter[6].max == "1" assert inst.parameter[6].min == 0 assert inst.parameter[6].name == "date" assert inst.parameter[6].type == "dateTime" assert inst.parameter[6].use == "in" assert inst.parameter[7].documentation == ( "Paging support - where to start if a subset is desired " "(default = 0). Offset is number of records (not number of " "pages)" ) assert inst.parameter[7].max == "1" assert inst.parameter[7].min == 0 assert inst.parameter[7].name == "offset" assert inst.parameter[7].type == "integer" assert inst.parameter[7].use == "in" assert inst.parameter[8].max == "1" assert inst.parameter[8].min == 0 assert inst.parameter[8].name == "count" assert inst.parameter[8].type == "integer" assert inst.parameter[8].use == "in" assert inst.parameter[9].documentation == ( "Controls whether concept designations are to be included or " "excluded in value set expansions" ) assert inst.parameter[9].max == "1" assert inst.parameter[9].min == 0 assert inst.parameter[9].name == "includeDesignations" assert inst.parameter[9].type == "boolean" assert inst.parameter[9].use == "in" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "ValueSet" assert inst.status == "active" assert inst.system is False assert inst.text.status == "extensions" assert inst.title == "Value Set Expansion" assert inst.type is True assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/OperationDefinition/ValueSet-expand"} ).valueUri ) assert inst.version == "4.3.0" def test_operationdefinition_3(base_settings): """No. 3 tests collection for OperationDefinition. Test File: operation-valueset-expand.json """ filename = base_settings["unittest_data_dir"] / "operation-valueset-expand.json" inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_3(inst2) def impl_operationdefinition_4(inst): assert inst.affectsState is True assert inst.code == "meta-add" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.description == ( "This operation takes a meta, and adds the profiles, tags, " "and security labels found in it to the nominated resource" ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[0].valueInteger == 3 assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert inst.id == "Resource-meta-add" assert inst.instance is True assert inst.kind == "operation" assert inst.name == "MetaAdd" assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 1 assert inst.parameter[0].name == "meta" assert inst.parameter[0].type == "Meta" assert inst.parameter[0].use == "in" assert inst.parameter[1].documentation == "Resulting meta for the resource" assert inst.parameter[1].max == "1" assert inst.parameter[1].min == 1 assert inst.parameter[1].name == "return" assert inst.parameter[1].type == "Meta" assert inst.parameter[1].use == "out" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "Resource" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "extensions" assert inst.title == "Add profiles, tags, and security labels to a resource" assert inst.type is False assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/OperationDefinition/Resource-meta-add"} ).valueUri ) assert inst.version == "4.3.0" def test_operationdefinition_4(base_settings): """No. 4 tests collection for OperationDefinition. Test File: operation-resource-meta-add.json """ filename = base_settings["unittest_data_dir"] / "operation-resource-meta-add.json" inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_4(inst2) def impl_operationdefinition_5(inst): assert inst.affectsState is False assert inst.code == "everything" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[0].valueInteger == 2 assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert inst.id == "Encounter-everything" assert inst.instance is True assert inst.kind == "operation" assert inst.name == "Everything" assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 0 assert inst.parameter[0].name == "_since" assert inst.parameter[0].type == "instant" assert inst.parameter[0].use == "in" assert inst.parameter[1].documentation == ( "One or more parameters, each containing one or more comma-" "delimited FHIR resource types to include in the return " "resources. In the absense of any specified types, the server" " returns all resource types" ) assert inst.parameter[1].max == "*" assert inst.parameter[1].min == 0 assert inst.parameter[1].name == "_type" assert inst.parameter[1].type == "code" assert inst.parameter[1].use == "in" assert inst.parameter[2].documentation == ( "See discussion below on the utility of paging through the " "results of the $everything operation" ) assert inst.parameter[2].max == "1" assert inst.parameter[2].min == 0 assert inst.parameter[2].name == "_count" assert inst.parameter[2].type == "integer" assert inst.parameter[2].use == "in" assert inst.parameter[3].documentation == 'The bundle type is "searchset"' assert inst.parameter[3].max == "1" assert inst.parameter[3].min == 1 assert inst.parameter[3].name == "return" assert inst.parameter[3].type == "Bundle" assert inst.parameter[3].use == "out" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "Encounter" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "extensions" assert inst.title == "Fetch Encounter Record" assert inst.type is False assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/OperationDefinition/Encounter-everything"} ).valueUri ) assert inst.version == "4.3.0" def test_operationdefinition_5(base_settings): """No. 5 tests collection for OperationDefinition. Test File: operation-encounter-everything.json """ filename = ( base_settings["unittest_data_dir"] / "operation-encounter-everything.json" ) inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_5(inst2) def impl_operationdefinition_6(inst): assert inst.affectsState is False assert inst.code == "graph" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[0].valueInteger == 1 assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert inst.id == "Resource-graph" assert inst.instance is True assert inst.kind == "operation" assert inst.name == "Graph" assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 1 assert inst.parameter[0].name == "graph" assert inst.parameter[0].type == "uri" assert inst.parameter[0].use == "in" assert inst.parameter[1].documentation == ( "The set of resources that were in the graph based on the " "provided definition" ) assert inst.parameter[1].max == "1" assert inst.parameter[1].min == 1 assert inst.parameter[1].name == "result" assert inst.parameter[1].type == "Bundle" assert inst.parameter[1].use == "out" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "Resource" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "extensions" assert inst.title == "Return a graph of resources" assert inst.type is False assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/OperationDefinition/Resource-graph"} ).valueUri ) assert inst.version == "4.3.0" def test_operationdefinition_6(base_settings): """No. 6 tests collection for OperationDefinition. Test File: operation-resource-graph.json """ filename = base_settings["unittest_data_dir"] / "operation-resource-graph.json" inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_6(inst2) def impl_operationdefinition_7(inst): assert inst.affectsState is False assert inst.code == "meta" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[0].valueInteger == 3 assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert inst.id == "Resource-meta" assert inst.instance is True assert inst.kind == "operation" assert inst.name == "Meta" assert inst.parameter[0].documentation == "The meta returned by the operation" assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 1 assert inst.parameter[0].name == "return" assert inst.parameter[0].type == "Meta" assert inst.parameter[0].use == "out" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "Resource" assert inst.status == "draft" assert inst.system is True assert inst.text.status == "extensions" assert inst.title == "Access a list of profiles, tags, and security labels" assert inst.type is True assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/OperationDefinition/Resource-meta"} ).valueUri ) assert inst.version == "4.3.0" def test_operationdefinition_7(base_settings): """No. 7 tests collection for OperationDefinition. Test File: operation-resource-meta.json """ filename = base_settings["unittest_data_dir"] / "operation-resource-meta.json" inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_7(inst2) def impl_operationdefinition_8(inst): assert inst.affectsState is False assert inst.code == "care-gaps" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.description == ( "The care-gaps operation is used to determine gaps-in-care " "based on the results of quality measures" ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[0].valueInteger == 3 assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert inst.id == "Measure-care-gaps" assert inst.instance is False assert inst.kind == "operation" assert inst.name == "CareGaps" assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 1 assert inst.parameter[0].name == "periodStart" assert inst.parameter[0].type == "date" assert inst.parameter[0].use == "in" assert inst.parameter[1].documentation == ( "The end of the measurement period. The period will end at " "the end of the period implied by the supplied timestamp. " "E.g. a value of 2014 would set the period end to be " "2014-12-31T23:59:59 inclusive" ) assert inst.parameter[1].max == "1" assert inst.parameter[1].min == 1 assert inst.parameter[1].name == "periodEnd" assert inst.parameter[1].type == "date" assert inst.parameter[1].use == "in" assert inst.parameter[2].documentation == ( "The topic to be used to determine which measures are " "considered for the care gaps report. Any measure with the " "given topic will be included in the report" ) assert inst.parameter[2].max == "1" assert inst.parameter[2].min == 1 assert inst.parameter[2].name == "topic" assert inst.parameter[2].type == "string" assert inst.parameter[2].use == "in" assert ( inst.parameter[3].documentation == "Subject for which the care gaps report will be produced" ) assert inst.parameter[3].max == "1" assert inst.parameter[3].min == 1 assert inst.parameter[3].name == "subject" assert inst.parameter[3].searchType == "reference" assert inst.parameter[3].type == "string" assert inst.parameter[3].use == "in" assert inst.parameter[4].documentation == ( "The result of the care gaps report will be returned as a " "document bundle with a MeasureReport entry for each included" " measure" ) assert inst.parameter[4].max == "1" assert inst.parameter[4].min == 1 assert inst.parameter[4].name == "return" assert inst.parameter[4].type == "Bundle" assert inst.parameter[4].use == "out" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "Measure" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "extensions" assert inst.title == "Care Gaps" assert inst.type is True assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/OperationDefinition/Measure-care-gaps"} ).valueUri ) assert inst.version == "4.3.0" def test_operationdefinition_8(base_settings): """No. 8 tests collection for OperationDefinition. Test File: operation-measure-care-gaps.json """ filename = base_settings["unittest_data_dir"] / "operation-measure-care-gaps.json" inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_8(inst2) def impl_operationdefinition_9(inst): assert inst.affectsState is False assert inst.code == "submit-data" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[0].valueInteger == 3 assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert inst.id == "Measure-submit-data" assert inst.instance is True assert inst.kind == "operation" assert inst.name == "SubmitData" assert inst.parameter[0].documentation == "The measure report being submitted" assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 1 assert inst.parameter[0].name == "measureReport" assert inst.parameter[0].type == "MeasureReport" assert inst.parameter[0].use == "in" assert inst.parameter[1].documentation == ( "The individual resources that make up the data-of-interest " "being submitted" ) assert inst.parameter[1].max == "*" assert inst.parameter[1].min == 0 assert inst.parameter[1].name == "resource" assert inst.parameter[1].type == "Resource" assert inst.parameter[1].use == "in" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "Measure" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "extensions" assert inst.title == "Submit Data" assert inst.type is True assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/OperationDefinition/Measure-submit-data"} ).valueUri ) assert inst.version == "4.3.0" def test_operationdefinition_9(base_settings): """No. 9 tests collection for OperationDefinition. Test File: operation-measure-submit-data.json """ filename = base_settings["unittest_data_dir"] / "operation-measure-submit-data.json" inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_9(inst2) def impl_operationdefinition_10(inst): assert inst.affectsState is False assert inst.code == "evaluate-measure" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.description == ( "The evaluate-measure operation is used to calculate an " "eMeasure and obtain the results" ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[0].valueInteger == 3 assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert inst.id == "Measure-evaluate-measure" assert inst.instance is True assert inst.kind == "operation" assert inst.name == "EvaluateMeasure" assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 1 assert inst.parameter[0].name == "periodStart" assert inst.parameter[0].type == "date" assert inst.parameter[0].use == "in" assert inst.parameter[1].documentation == ( "The end of the measurement period. The period will end at " "the end of the period implied by the supplied timestamp. " "E.g. a value of 2014 would set the period end to be " "2014-12-31T23:59:59 inclusive" ) assert inst.parameter[1].max == "1" assert inst.parameter[1].min == 1 assert inst.parameter[1].name == "periodEnd" assert inst.parameter[1].type == "date" assert inst.parameter[1].use == "in" assert inst.parameter[2].documentation == ( "The measure to evaluate. This parameter is only required " "when the operation is invoked on the resource type, it is " "not used when invoking the operation on a Measure instance" ) assert inst.parameter[2].max == "1" assert inst.parameter[2].min == 0 assert inst.parameter[2].name == "measure" assert inst.parameter[2].searchType == "reference" assert inst.parameter[2].type == "string" assert inst.parameter[2].use == "in" assert inst.parameter[3].documentation == ( "The type of measure report: subject, subject-list, or " "population. If not specified, a default value of subject " "will be used if the subject parameter is supplied, " "otherwise, population will be used" ) assert inst.parameter[3].max == "1" assert inst.parameter[3].min == 0 assert inst.parameter[3].name == "reportType" assert inst.parameter[3].type == "code" assert inst.parameter[3].use == "in" assert inst.parameter[4].max == "1" assert inst.parameter[4].min == 0 assert inst.parameter[4].name == "subject" assert inst.parameter[4].searchType == "reference" assert inst.parameter[4].type == "string" assert inst.parameter[4].use == "in" assert inst.parameter[5].documentation == ( "Practitioner for which the measure will be calculated. If " "specified, the measure will be calculated only for subjects " "that have a primary relationship to the identified " "practitioner" ) assert inst.parameter[5].max == "1" assert inst.parameter[5].min == 0 assert inst.parameter[5].name == "practitioner" assert inst.parameter[5].searchType == "reference" assert inst.parameter[5].type == "string" assert inst.parameter[5].use == "in" assert inst.parameter[6].max == "1" assert inst.parameter[6].min == 0 assert inst.parameter[6].name == "lastReceivedOn" assert inst.parameter[6].type == "dateTime" assert inst.parameter[6].use == "in" assert inst.parameter[7].max == "1" assert inst.parameter[7].min == 1 assert inst.parameter[7].name == "return" assert inst.parameter[7].type == "MeasureReport" assert inst.parameter[7].use == "out" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "Measure" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "extensions" assert inst.title == "Evaluate Measure" assert inst.type is True assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/OperationDefinition/Measure-evaluate-measure" } ).valueUri ) assert inst.version == "4.3.0" def test_operationdefinition_10(base_settings): """No. 10 tests collection for OperationDefinition. Test File: operation-measure-evaluate-measure.json """ filename = ( base_settings["unittest_data_dir"] / "operation-measure-evaluate-measure.json" ) inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_operationoutcome.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/OperationOutcome Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import operationoutcome from .conftest import ExternalValidatorModel # noqa: F401 def impl_operationoutcome_1(inst): assert inst.id == "validationfail" assert inst.issue[0].code == "structure" assert ( inst.issue[0].details.text == 'Error parsing resource XML (Unknown Content "label"' ) assert inst.issue[0].expression[0] == "Patient.identifier" assert inst.issue[0].location[0] == "/f:Patient/f:identifier" assert inst.issue[0].severity == "error" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_operationoutcome_1(base_settings): """No. 1 tests collection for OperationOutcome. Test File: operationoutcome-example-validationfail.json """ filename = ( base_settings["unittest_data_dir"] / "operationoutcome-example-validationfail.json" ) inst = operationoutcome.OperationOutcome.model_validate_json(filename.read_bytes()) assert "OperationOutcome" == inst.get_resource_type() impl_operationoutcome_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationOutcome" == data["resourceType"] inst2 = operationoutcome.OperationOutcome(**data) impl_operationoutcome_1(inst2) def impl_operationoutcome_2(inst): assert inst.id == "break-the-glass" assert inst.issue[0].code == "suppressed" assert inst.issue[0].details.coding[0].code == "ETREAT" assert inst.issue[0].details.coding[0].display == "Emergency Treatment" assert ( inst.issue[0].details.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.issue[0].details.text == ( "Additional information may be available using the Break-The-" "Glass Protocol" ) assert inst.issue[0].severity == "information" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_operationoutcome_2(base_settings): """No. 2 tests collection for OperationOutcome. Test File: operationoutcome-example-break-the-glass.json """ filename = ( base_settings["unittest_data_dir"] / "operationoutcome-example-break-the-glass.json" ) inst = operationoutcome.OperationOutcome.model_validate_json(filename.read_bytes()) assert "OperationOutcome" == inst.get_resource_type() impl_operationoutcome_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationOutcome" == data["resourceType"] inst2 = operationoutcome.OperationOutcome(**data) impl_operationoutcome_2(inst2) def impl_operationoutcome_3(inst): assert inst.id == "searchfail" assert inst.issue[0].code == "code-invalid" assert inst.issue[0].details.text == ( 'The "name" parameter has the modifier "exact" which is ' "not supported by this server" ) assert inst.issue[0].location[0] == "http.name:exact" assert inst.issue[0].severity == "fatal" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_operationoutcome_3(base_settings): """No. 3 tests collection for OperationOutcome. Test File: operationoutcome-example-searchfail.json """ filename = ( base_settings["unittest_data_dir"] / "operationoutcome-example-searchfail.json" ) inst = operationoutcome.OperationOutcome.model_validate_json(filename.read_bytes()) assert "OperationOutcome" == inst.get_resource_type() impl_operationoutcome_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationOutcome" == data["resourceType"] inst2 = operationoutcome.OperationOutcome(**data) impl_operationoutcome_3(inst2) def impl_operationoutcome_4(inst): assert inst.id == "exception" assert inst.issue[0].code == "exception" assert inst.issue[0].details.text == "SQL Link Communication Error (dbx = 34234)" assert inst.issue[0].severity == "error" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_operationoutcome_4(base_settings): """No. 4 tests collection for OperationOutcome. Test File: operationoutcome-example-exception.json """ filename = ( base_settings["unittest_data_dir"] / "operationoutcome-example-exception.json" ) inst = operationoutcome.OperationOutcome.model_validate_json(filename.read_bytes()) assert "OperationOutcome" == inst.get_resource_type() impl_operationoutcome_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationOutcome" == data["resourceType"] inst2 = operationoutcome.OperationOutcome(**data) impl_operationoutcome_4(inst2) def impl_operationoutcome_5(inst): assert inst.id == "101" assert inst.issue[0].code == "code-invalid" assert ( inst.issue[0].details.text == 'The code "W" is not known and not legal in this context' ) assert ( inst.issue[0].diagnostics == "Acme.Interop.FHIRProcessors.Patient.processGender line 2453" ) assert inst.issue[0].expression[0] == "Patient.gender" assert inst.issue[0].location[0] == "/f:Patient/f:gender" assert inst.issue[0].severity == "error" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_operationoutcome_5(base_settings): """No. 5 tests collection for OperationOutcome. Test File: operationoutcome-example.json """ filename = base_settings["unittest_data_dir"] / "operationoutcome-example.json" inst = operationoutcome.OperationOutcome.model_validate_json(filename.read_bytes()) assert "OperationOutcome" == inst.get_resource_type() impl_operationoutcome_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationOutcome" == data["resourceType"] inst2 = operationoutcome.OperationOutcome(**data) impl_operationoutcome_5(inst2) def impl_operationoutcome_6(inst): assert inst.id == "allok" assert inst.issue[0].code == "informational" assert inst.issue[0].details.text == "All OK" assert inst.issue[0].severity == "information" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_operationoutcome_6(base_settings): """No. 6 tests collection for OperationOutcome. Test File: operationoutcome-example-allok.json """ filename = ( base_settings["unittest_data_dir"] / "operationoutcome-example-allok.json" ) inst = operationoutcome.OperationOutcome.model_validate_json(filename.read_bytes()) assert "OperationOutcome" == inst.get_resource_type() impl_operationoutcome_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationOutcome" == data["resourceType"] inst2 = operationoutcome.OperationOutcome(**data) impl_operationoutcome_6(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_organization.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Organization Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import organization from .conftest import ExternalValidatorModel # noqa: F401 def impl_organization_1(inst): assert inst.address[0].city == "Ann Arbor" assert inst.address[0].country == "USA" assert inst.address[0].line[0] == "3300 Washtenaw Avenue, Suite 227" assert inst.address[0].postalCode == "48104" assert inst.address[0].state == "MI" assert inst.alias[0] == "HL7 International" assert inst.endpoint[0].reference == "Endpoint/example" assert inst.id == "hl7" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Health Level Seven International" assert inst.telecom[0].system == "phone" assert inst.telecom[0].value == "(+1) 734-677-7777" assert inst.telecom[1].system == "fax" assert inst.telecom[1].value == "(+1) 734-677-6622" assert inst.telecom[2].system == "email" assert inst.telecom[2].value == "hq@HL7.org" assert inst.text.status == "generated" def test_organization_1(base_settings): """No. 1 tests collection for Organization. Test File: organization-example.json """ filename = base_settings["unittest_data_dir"] / "organization-example.json" inst = organization.Organization.model_validate_json(filename.read_bytes()) assert "Organization" == inst.get_resource_type() impl_organization_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Organization" == data["resourceType"] inst2 = organization.Organization(**data) impl_organization_1(inst2) def impl_organization_2(inst): assert inst.active is True assert inst.address[0].country == "Swizterland" assert inst.id == "mmanu" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Acme Corporation" assert inst.text.status == "generated" def test_organization_2(base_settings): """No. 2 tests collection for Organization. Test File: organization-example-mmanu.json """ filename = base_settings["unittest_data_dir"] / "organization-example-mmanu.json" inst = organization.Organization.model_validate_json(filename.read_bytes()) assert "Organization" == inst.get_resource_type() impl_organization_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Organization" == data["resourceType"] inst2 = organization.Organization(**data) impl_organization_2(inst2) def impl_organization_3(inst): assert inst.id == "1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.acme.org.au/units"} ).valueUri ) assert inst.identifier[0].value == "Gastro" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Gastroenterology" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "mobile" assert inst.telecom[0].value == "+1 555 234 3523" assert inst.telecom[1].system == "email" assert inst.telecom[1].use == "work" assert inst.telecom[1].value == "gastro@acme.org" assert inst.text.status == "generated" def test_organization_3(base_settings): """No. 3 tests collection for Organization. Test File: organization-example-gastro.json """ filename = base_settings["unittest_data_dir"] / "organization-example-gastro.json" inst = organization.Organization.model_validate_json(filename.read_bytes()) assert "Organization" == inst.get_resource_type() impl_organization_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Organization" == data["resourceType"] inst2 = organization.Organization(**data) impl_organization_3(inst2) def impl_organization_4(inst): assert inst.alias[0] == "Michigan State Department of Health" assert inst.id == "3" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://michigan.gov/state-dept-ids"} ).valueUri ) assert inst.identifier[0].value == "25" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Michigan Health" assert inst.text.status == "generated" def test_organization_4(base_settings): """No. 4 tests collection for Organization. Test File: organization-example-mihealth.json """ filename = base_settings["unittest_data_dir"] / "organization-example-mihealth.json" inst = organization.Organization.model_validate_json(filename.read_bytes()) assert "Organization" == inst.get_resource_type() impl_organization_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Organization" == data["resourceType"] inst2 = organization.Organization(**data) impl_organization_4(inst2) def impl_organization_5(inst): assert inst.id == "1832473e-2fe0-452d-abe9-3cdb9879522f" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.acme.org.au/units"} ).valueUri ) assert inst.identifier[0].value == "ClinLab" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Clinical Lab" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "+1 555 234 1234" assert inst.telecom[1].system == "email" assert inst.telecom[1].use == "work" assert inst.telecom[1].value == "contact@labs.acme.org" assert inst.text.status == "generated" def test_organization_5(base_settings): """No. 5 tests collection for Organization. Test File: organization-example-lab.json """ filename = base_settings["unittest_data_dir"] / "organization-example-lab.json" inst = organization.Organization.model_validate_json(filename.read_bytes()) assert "Organization" == inst.get_resource_type() impl_organization_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Organization" == data["resourceType"] inst2 = organization.Organization(**data) impl_organization_5(inst2) def impl_organization_6(inst): assert inst.active is True assert inst.address[0].line[0] == "South Wing, floor 2" assert inst.contact[0].address.line[0] == "South Wing, floor 2" assert inst.contact[0].name.text == "mevr. D. de Haan" assert inst.contact[0].purpose.coding[0].code == "ADMIN" assert ( inst.contact[0].purpose.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/contactentity-type"} ).valueUri ) assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].value == "022-655 2321" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "cardio@burgersumc.nl" assert inst.contact[0].telecom[2].system == "fax" assert inst.contact[0].telecom[2].value == "022-655 2322" assert inst.id == "f002" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Burgers UMC Cardiology unit" assert inst.partOf.reference == "Organization/f001" assert inst.telecom[0].system == "phone" assert inst.telecom[0].value == "022-655 2320" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "dept" assert inst.type[0].coding[0].display == "Hospital Department" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/organization-type"} ).valueUri ) def test_organization_6(base_settings): """No. 6 tests collection for Organization. Test File: organization-example-f002-burgers-card.json """ filename = ( base_settings["unittest_data_dir"] / "organization-example-f002-burgers-card.json" ) inst = organization.Organization.model_validate_json(filename.read_bytes()) assert "Organization" == inst.get_resource_type() impl_organization_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Organization" == data["resourceType"] inst2 = organization.Organization(**data) impl_organization_6(inst2) def impl_organization_7(inst): assert inst.active is True assert inst.address[0].city == "Den Helder" assert inst.address[0].country == "NLD" assert inst.address[0].line[0] == "Walvisbaai 3" assert inst.address[0].postalCode == "2333ZA" assert inst.address[0].use == "work" assert inst.contact[0].address.city == "Den helder" assert inst.contact[0].address.country == "NLD" assert inst.contact[0].address.line[0] == "Walvisbaai 3" assert inst.contact[0].address.line[1] == "Gebouw 2" assert inst.contact[0].address.postalCode == "2333ZA" assert inst.contact[0].name.family == "Brand" assert inst.contact[0].name.given[0] == "Ronald" assert inst.contact[0].name.prefix[0] == "Prof.Dr." assert inst.contact[0].name.text == "Professor Brand" assert inst.contact[0].name.use == "official" assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "+31715269702" assert inst.id == "f201" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.zorgkaartnederland.nl/"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "Artis University Medical Center" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Artis University Medical Center (AUMC)" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "+31715269111" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "405608006" assert inst.type[0].coding[0].display == "Academic Medical Center" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.type[0].coding[1].code == "V6" assert inst.type[0].coding[1].display == "University Medical Hospital" assert ( inst.type[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.2.4.15.1060"} ).valueUri ) assert inst.type[0].coding[2].code == "prov" assert inst.type[0].coding[2].display == "Healthcare Provider" assert ( inst.type[0].coding[2].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/organization-type"} ).valueUri ) def test_organization_7(base_settings): """No. 7 tests collection for Organization. Test File: organization-example-f201-aumc.json """ filename = ( base_settings["unittest_data_dir"] / "organization-example-f201-aumc.json" ) inst = organization.Organization.model_validate_json(filename.read_bytes()) assert "Organization" == inst.get_resource_type() impl_organization_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Organization" == data["resourceType"] inst2 = organization.Organization(**data) impl_organization_7(inst2) def impl_organization_8(inst): assert inst.id == "2.16.840.1.113883.19.5" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.19.5" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Good Health Clinic" assert inst.text.status == "generated" def test_organization_8(base_settings): """No. 8 tests collection for Organization. Test File: organization-example-good-health-care.json """ filename = ( base_settings["unittest_data_dir"] / "organization-example-good-health-care.json" ) inst = organization.Organization.model_validate_json(filename.read_bytes()) assert "Organization" == inst.get_resource_type() impl_organization_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Organization" == data["resourceType"] inst2 = organization.Organization(**data) impl_organization_8(inst2) def impl_organization_9(inst): assert inst.address[0].city == "Den Burg" assert inst.address[0].country == "NLD" assert inst.address[0].line[0] == "Galapagosweg 91" assert inst.address[0].postalCode == "9105 PZ" assert inst.address[0].use == "work" assert inst.address[1].city == "Den Burg" assert inst.address[1].country == "NLD" assert inst.address[1].line[0] == "PO Box 2311" assert inst.address[1].postalCode == "9100 AA" assert inst.address[1].use == "work" assert inst.contact[0].purpose.coding[0].code == "PRESS" assert ( inst.contact[0].purpose.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/contactentity-type"} ).valueUri ) assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].value == "022-655 2334" assert inst.contact[1].purpose.coding[0].code == "PATINF" assert ( inst.contact[1].purpose.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/contactentity-type"} ).valueUri ) assert inst.contact[1].telecom[0].system == "phone" assert inst.contact[1].telecom[0].value == "022-655 2335" assert inst.id == "f001" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.528.1"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "91654" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.2.4.6.1"} ).valueUri ) assert inst.identifier[1].use == "usual" assert inst.identifier[1].value == "17-0112278" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Burgers University Medical Center" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "022-655 2300" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "V6" assert inst.type[0].coding[0].display == "University Medical Hospital" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.2.4.15.1060"} ).valueUri ) assert inst.type[0].coding[1].code == "prov" assert inst.type[0].coding[1].display == "Healthcare Provider" assert ( inst.type[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/organization-type"} ).valueUri ) def test_organization_9(base_settings): """No. 9 tests collection for Organization. Test File: organization-example-f001-burgers.json """ filename = ( base_settings["unittest_data_dir"] / "organization-example-f001-burgers.json" ) inst = organization.Organization.model_validate_json(filename.read_bytes()) assert "Organization" == inst.get_resource_type() impl_organization_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Organization" == data["resourceType"] inst2 = organization.Organization(**data) impl_organization_9(inst2) def impl_organization_10(inst): assert inst.alias[0] == "ABC Insurance" assert inst.id == "2" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.3.19.2.3"} ).valueUri ) assert inst.identifier[0].value == "666666" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "XYZ Insurance" assert inst.text.status == "generated" def test_organization_10(base_settings): """No. 10 tests collection for Organization. Test File: organization-example-insurer.json """ filename = base_settings["unittest_data_dir"] / "organization-example-insurer.json" inst = organization.Organization.model_validate_json(filename.read_bytes()) assert "Organization" == inst.get_resource_type() impl_organization_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Organization" == data["resourceType"] inst2 = organization.Organization(**data) impl_organization_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_organizationaffiliation.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/OrganizationAffiliation Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import organizationaffiliation from .conftest import ExternalValidatorModel # noqa: F401 def impl_organizationaffiliation_1(inst): assert inst.active is True assert inst.code[0].coding[0].code == "provider" assert ( inst.code[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/organization-role"} ).valueUri ) assert inst.endpoint[0].reference == "Endpoint/example" assert inst.healthcareService[0].reference == "HealthcareService/example" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.acme.org/practitioners"} ).valueUri ) assert inst.identifier[0].value == "23" assert inst.location[0].display == "South Wing, second floor" assert inst.location[0].reference == "Location/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.network[0].display == "HL7 Payer Network" assert inst.network[0].reference == "Organization/hl7pay" assert inst.organization.reference == "Organization/hl7pay" assert inst.participatingOrganization.reference == "Organization/f001" assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-03-31"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-01-01"} ).valueDateTime ) assert inst.specialty[0].coding[0].code == "408443003" assert inst.specialty[0].coding[0].display == "General medical practice" assert ( inst.specialty[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.telecom[0].system == "email" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "general.practice@example.org" assert inst.text.status == "generated" def test_organizationaffiliation_1(base_settings): """No. 1 tests collection for OrganizationAffiliation. Test File: organizationaffiliation-example.json """ filename = ( base_settings["unittest_data_dir"] / "organizationaffiliation-example.json" ) inst = organizationaffiliation.OrganizationAffiliation.model_validate_json( filename.read_bytes() ) assert "OrganizationAffiliation" == inst.get_resource_type() impl_organizationaffiliation_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OrganizationAffiliation" == data["resourceType"] inst2 = organizationaffiliation.OrganizationAffiliation(**data) impl_organizationaffiliation_1(inst2) def impl_organizationaffiliation_2(inst): assert inst.active is True assert inst.code[0].coding[0].code == "member" assert inst.code[0].coding[0].display == "Member" assert ( inst.code[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/organization-role"} ).valueUri ) assert inst.code[0].text == "Hospital member" assert inst.endpoint[0].display == "Founding Fathers Memorial Hospital HIE endpoint" assert ( inst.endpoint[0].reference == "http://hl7.org/fhir/ig/vhdir/Endpoint/foundingfathersHIE" ) assert inst.id == "orgrole2" assert inst.identifier[0].assigner.display == "Monument Health Information Exchange" assert ( inst.identifier[0].assigner.reference == "http://hl7.org/fhir/ig/vhdir/Organization/monumentHIE" ) assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/www.monumentHIE.com"} ).valueUri ) assert inst.identifier[0].type.text == "member hospital" assert inst.identifier[0].use == "secondary" assert inst.identifier[0].value == "hosp32" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.organization.display == "Monument Health Information Exchange" assert ( inst.organization.reference == "http://hl7.org/fhir/ig/vhdir/Organization/monumentHIE" ) assert ( inst.participatingOrganization.display == "Founding Fathers Memorial Hospital" ) assert ( inst.participatingOrganization.reference == "http://hl7.org/fhir/ig/vhdir/Organization/foundingfathers" ) assert inst.text.status == "generated" def test_organizationaffiliation_2(base_settings): """No. 2 tests collection for OrganizationAffiliation. Test File: orgrole-example-hie.json """ filename = base_settings["unittest_data_dir"] / "orgrole-example-hie.json" inst = organizationaffiliation.OrganizationAffiliation.model_validate_json( filename.read_bytes() ) assert "OrganizationAffiliation" == inst.get_resource_type() impl_organizationaffiliation_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OrganizationAffiliation" == data["resourceType"] inst2 = organizationaffiliation.OrganizationAffiliation(**data) impl_organizationaffiliation_2(inst2) def impl_organizationaffiliation_3(inst): assert inst.active is True assert inst.code[0].coding[0].code == "provider" assert inst.code[0].coding[0].display == "Provider" assert ( inst.code[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/organization-role"} ).valueUri ) assert inst.code[0].coding[0].userSelected is True assert inst.code[0].text == "Provider of rehabilitation services" assert inst.healthcareService[0].display == "Inpatient rehabilitation services" assert inst.healthcareService[0].reference == ( "http://hl7.org/fhir/ig/vhdir/HealthcareService/independencer" "ehab1" ) assert inst.healthcareService[1].display == "Outpatient rehabilitation services" assert inst.healthcareService[1].reference == ( "http://hl7.org/fhir/ig/vhdir/HealthcareService/independencer" "ehab2" ) assert inst.id == "orgrole1" assert inst.identifier[0].assigner.display == "Founding Fathers Memorial Hospital" assert ( inst.identifier[0].assigner.reference == "http://hl7.org/fhir/ig/vhdir/Organization/foundingfathers" ) assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/www.foundingfathersmemorial.com"} ).valueUri ) assert inst.identifier[0].use == "secondary" assert inst.identifier[0].value == "service002" assert inst.location[0].display == "Founding Fathers Memorial Hospital" assert ( inst.location[0].reference == "http://hl7.org/fhir/ig/vhdir/Location/foundingfathers1" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.network[0].display == "Patriot Preferred Provider Network" assert ( inst.network[0].reference == "http://hl7.org/fhir/ig/vhdir/Network/patriotppo" ) assert inst.organization.display == "Founding Fathers Memorial Hospital" assert ( inst.organization.reference == "http://hl7.org/fhir/ig/vhdir/Organization/foundingfathers" ) assert ( inst.participatingOrganization.display == "Independence Rehabilitation Services, Inc." ) assert ( inst.participatingOrganization.reference == "http://hl7.org/fhir/ig/vhdir/Organization/independencerehab" ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-02-01"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-02-09"} ).valueDateTime ) assert inst.specialty[0].coding[0].code == "394602003" assert inst.specialty[0].coding[0].display == "Rehabilitation - specialty" assert ( inst.specialty[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.specialty[0].text == "Rehabilitation" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "202-109-8765" assert inst.text.status == "generated" def test_organizationaffiliation_3(base_settings): """No. 3 tests collection for OrganizationAffiliation. Test File: orgrole-example-services.json """ filename = base_settings["unittest_data_dir"] / "orgrole-example-services.json" inst = organizationaffiliation.OrganizationAffiliation.model_validate_json( filename.read_bytes() ) assert "OrganizationAffiliation" == inst.get_resource_type() impl_organizationaffiliation_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OrganizationAffiliation" == data["resourceType"] inst2 = organizationaffiliation.OrganizationAffiliation(**data) impl_organizationaffiliation_3(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_packagedproductdefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/PackagedProductDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import packagedproductdefinition from .conftest import ExternalValidatorModel # noqa: F401 def impl_packagedproductdefinition_1(inst): assert ( inst.description == "ALU-PVC/PVDC BLISTERS. CARTONS OF 10 FILM-COATED TABLETS." ) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/pcid"} ).valueUri ) assert inst.identifier[0].value == "{PCID}" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.package.manufacturer[0].reference == "Organization/example" assert inst.package.material[0].coding[0].code == "Paperboard" assert ( inst.package.material[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/packageItemContainerMaterial"} ).valueUri ) assert float(inst.package.package[0].containedItem[0].amount.value) == float(10) assert ( inst.package.package[0].containedItem[0].item.reference.reference == "ManufacturedItemDefinition/tablet" ) assert inst.package.package[0].manufacturer[0].reference == "Organization/example" assert inst.package.package[0].material[0].coding[0].code == "PVC" assert ( inst.package.package[0].material[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/packageItemContainerMaterial"} ).valueUri ) assert inst.package.package[0].material[1].coding[0].code == "PVDC" assert ( inst.package.package[0].material[1].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/packageItemContainerMaterial"} ).valueUri ) assert inst.package.package[0].material[2].coding[0].code == "alu" assert ( inst.package.package[0].material[2].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/packageItemContainerMaterial"} ).valueUri ) assert inst.package.package[0].property[0].type.coding[0].code == "height" assert inst.package.package[0].property[0].valueQuantity.code == "mm" assert ( inst.package.package[0].property[0].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.package.package[0].property[0].valueQuantity.unit == "mm" assert float(inst.package.package[0].property[0].valueQuantity.value) == float(45) assert inst.package.package[0].property[1].type.coding[0].code == "width" assert inst.package.package[0].property[1].valueQuantity.code == "mm" assert ( inst.package.package[0].property[1].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.package.package[0].property[1].valueQuantity.unit == "mm" assert float(inst.package.package[0].property[1].valueQuantity.value) == float(35) assert inst.package.package[0].quantity == 1 assert inst.package.package[0].shelfLifeStorage[0].periodDuration.code == "a" assert ( inst.package.package[0].shelfLifeStorage[0].periodDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.package.package[0].shelfLifeStorage[0].periodDuration.unit == "year" assert float( inst.package.package[0].shelfLifeStorage[0].periodDuration.value ) == float(3) assert ( inst.package.package[0] .shelfLifeStorage[0] .specialPrecautionsForStorage[0] .coding[0] .code == "none" ) assert ( inst.package.package[0] .shelfLifeStorage[0] .specialPrecautionsForStorage[0] .coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/specialprecautionsforstorage"} ).valueUri ) assert ( inst.package.package[0].shelfLifeStorage[0].type.coding[0].code == "ShelfLifeofPackagedMedicinalProduct" ) assert ( inst.package.package[0].shelfLifeStorage[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/shelfLifeTypePlaceHolder"} ).valueUri ) assert inst.package.package[0].type.coding[0].code == "Blister" assert ( inst.package.package[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/packageitemcontainertype"} ).valueUri ) assert inst.package.property[0].type.coding[0].code == "height" assert inst.package.property[0].valueQuantity.code == "mm" assert ( inst.package.property[0].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.package.property[0].valueQuantity.unit == "mm" assert float(inst.package.property[0].valueQuantity.value) == float(50) assert inst.package.property[1].type.coding[0].code == "width" assert inst.package.property[1].valueQuantity.code == "mm" assert ( inst.package.property[1].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.package.property[1].valueQuantity.unit == "mm" assert float(inst.package.property[1].valueQuantity.value) == float(45) assert inst.package.property[2].type.coding[0].code == "depth" assert inst.package.property[2].valueQuantity.code == "mm" assert ( inst.package.property[2].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.package.property[2].valueQuantity.unit == "mm" assert float(inst.package.property[2].valueQuantity.value) == float(23.5) assert inst.package.quantity == 1 assert inst.package.type.coding[0].code == "Carton" assert ( inst.package.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/packageitemcontainertype"} ).valueUri ) assert inst.text.status == "generated" def test_packagedproductdefinition_1(base_settings): """No. 1 tests collection for PackagedProductDefinition. Test File: packagedproductdefinition-example.json """ filename = ( base_settings["unittest_data_dir"] / "packagedproductdefinition-example.json" ) inst = packagedproductdefinition.PackagedProductDefinition.model_validate_json( filename.read_bytes() ) assert "PackagedProductDefinition" == inst.get_resource_type() impl_packagedproductdefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PackagedProductDefinition" == data["resourceType"] inst2 = packagedproductdefinition.PackagedProductDefinition(**data) impl_packagedproductdefinition_1(inst2) def impl_packagedproductdefinition_2(inst): assert inst.contained[0].id == "syringeDevice" assert inst.contained[1].id == "liquidItem" assert inst.id == "package-with-liquid-and-syringe" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.package.containedItem[0].amount.code == "mL" assert ( inst.package.containedItem[0].amount.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.package.containedItem[0].amount.unit == "ml" assert float(inst.package.containedItem[0].amount.value) == float(20) assert inst.package.containedItem[0].item.reference.reference == "#liquidItem" assert inst.package.containedItem[1].item.reference.reference == "#syringeDevice" assert ( inst.packageFor[0].reference == "MedicinalProductDefinition/ProductThatHasThisPackType" ) assert inst.text.status == "generated" def test_packagedproductdefinition_2(base_settings): """No. 2 tests collection for PackagedProductDefinition. Test File: packagedproductdefinition-example-co-packaged-liquid-and-syringe.json """ filename = ( base_settings["unittest_data_dir"] / "packagedproductdefinition-example-co-packaged-liquid-and-syringe.json" ) inst = packagedproductdefinition.PackagedProductDefinition.model_validate_json( filename.read_bytes() ) assert "PackagedProductDefinition" == inst.get_resource_type() impl_packagedproductdefinition_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PackagedProductDefinition" == data["resourceType"] inst2 = packagedproductdefinition.PackagedProductDefinition(**data) impl_packagedproductdefinition_2(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_parameters.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Parameters Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import parameters from .conftest import ExternalValidatorModel # noqa: F401 def impl_parameters_1(inst): assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.parameter[0].name == "exact" assert inst.parameter[0].valueBoolean is True assert inst.parameter[1].name == "property" assert inst.parameter[1].part[0].name == "code" assert inst.parameter[1].part[0].valueCode == "focus" assert inst.parameter[1].part[1].name == "value" assert inst.parameter[1].part[1].valueCode == "top" assert inst.parameter[2].name == "patient" assert inst.parameter[2].resource.id == "example" def test_parameters_1(base_settings): """No. 1 tests collection for Parameters. Test File: parameters-example.json """ filename = base_settings["unittest_data_dir"] / "parameters-example.json" inst = parameters.Parameters.model_validate_json(filename.read_bytes()) assert "Parameters" == inst.get_resource_type() impl_parameters_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Parameters" == data["resourceType"] inst2 = parameters.Parameters(**data) impl_parameters_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_patient.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Patient Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import patient from .conftest import ExternalValidatorModel # noqa: F401 def impl_patient_1(inst): assert inst.active is True assert inst.address[0].city == "Metropolis" assert inst.address[0].country == "USA" assert inst.address[0].line[0] == "100 Main St" assert inst.address[0].postalCode == "44130" assert inst.address[0].state == "Il" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1956-05-27"}).valueDate ) assert inst.gender == "male" assert inst.id == "xds" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.2.3.4.5"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "MR" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].use == "usual" assert inst.identifier[0].value == "89765a87b" assert inst.managingOrganization.reference == "Organization/2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Doe" assert inst.name[0].given[0] == "John" assert inst.text.status == "generated" def test_patient_1(base_settings): """No. 1 tests collection for Patient. Test File: patient-example-xds.json """ filename = base_settings["unittest_data_dir"] / "patient-example-xds.json" inst = patient.Patient.model_validate_json(filename.read_bytes()) assert "Patient" == inst.get_resource_type() impl_patient_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Patient" == data["resourceType"] inst2 = patient.Patient(**data) impl_patient_1(inst2) def impl_patient_2(inst): assert inst.active is True assert inst.address[0].city == "Amsterdam" assert inst.address[0].country == "NLD" assert inst.address[0].line[0] == "Van Egmondkade 23" assert inst.address[0].postalCode == "1024 RJ" assert inst.address[0].use == "home" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1944-11-17"}).valueDate ) assert inst.communication[0].language.coding[0].code == "nl" assert inst.communication[0].language.coding[0].display == "Dutch" assert ( inst.communication[0].language.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:47"} ).valueUri ) assert inst.communication[0].language.text == "Nederlands" assert inst.communication[0].preferred is True assert inst.contact[0].name.family == "Abels" assert inst.contact[0].name.given[0] == "Sarah" assert inst.contact[0].name.use == "usual" assert inst.contact[0].relationship[0].coding[0].code == "C" assert ( inst.contact[0].relationship[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0131"} ).valueUri ) assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].use == "mobile" assert inst.contact[0].telecom[0].value == "0690383372" assert inst.deceasedBoolean is False assert inst.gender == "male" assert inst.id == "f001" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.2.4.6.3"} ).valueUri ) assert inst.identifier[0].use == "usual" assert inst.identifier[0].value == "738472983" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.2.4.6.3"} ).valueUri ) assert inst.identifier[1].use == "usual" assert inst.managingOrganization.display == "Burgers University Medical Centre" assert inst.managingOrganization.reference == "Organization/f001" assert inst.maritalStatus.coding[0].code == "M" assert inst.maritalStatus.coding[0].display == "Married" assert ( inst.maritalStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus"} ).valueUri ) assert inst.maritalStatus.text == "Getrouwd" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.multipleBirthBoolean is True assert inst.name[0].family == "van de Heuvel" assert inst.name[0].given[0] == "Pieter" assert inst.name[0].suffix[0] == "MSc" assert inst.name[0].use == "usual" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "mobile" assert inst.telecom[0].value == "0648352638" assert inst.telecom[1].system == "email" assert inst.telecom[1].use == "home" assert inst.telecom[1].value == "p.heuvel@gmail.com" assert inst.text.div == ( '

Pieter van' " de Heuvel male, DoB: 1944-11-17 ( id: 738472983 " "(USUAL))

" ) assert inst.text.status == "generated" def test_patient_2(base_settings): """No. 2 tests collection for Patient. Test File: patient-example-f001-pieter.json """ filename = base_settings["unittest_data_dir"] / "patient-example-f001-pieter.json" inst = patient.Patient.model_validate_json(filename.read_bytes()) assert "Patient" == inst.get_resource_type() impl_patient_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Patient" == data["resourceType"] inst2 = patient.Patient(**data) impl_patient_2(inst2) def impl_patient_3(inst): assert inst.active is True assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1982-08-02"}).valueDate ) assert inst.deceasedBoolean is True assert inst.gender == "female" assert inst.id == "pat4" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:0.1.2.3.4.5.6.7"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "MR" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].use == "usual" assert inst.identifier[0].value == "123458" assert inst.managingOrganization.display == "ACME Healthcare, Inc" assert inst.managingOrganization.reference == "Organization/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Notsowell" assert inst.name[0].given[0] == "Sandy" assert inst.name[0].use == "official" assert inst.text.status == "generated" def test_patient_3(base_settings): """No. 3 tests collection for Patient. Test File: patient-example-d.json """ filename = base_settings["unittest_data_dir"] / "patient-example-d.json" inst = patient.Patient.model_validate_json(filename.read_bytes()) assert "Patient" == inst.get_resource_type() impl_patient_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Patient" == data["resourceType"] inst2 = patient.Patient(**data) impl_patient_3(inst2) def impl_patient_4(inst): assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "2017-05-15"}).valueDate ) assert inst.contact[0].name.family == "Organa" assert inst.contact[0].name.given[0] == "Leia" assert inst.contact[0].name.use == "maiden" assert inst.contact[0].relationship[0].coding[0].code == "72705000" assert inst.contact[0].relationship[0].coding[0].display == "Mother" assert ( inst.contact[0].relationship[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.contact[0].relationship[0].coding[1].code == "N" assert ( inst.contact[0].relationship[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0131"} ).valueUri ) assert inst.contact[0].relationship[0].coding[2].code == "MTH" assert ( inst.contact[0].relationship[0].coding[2].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].use == "mobile" assert inst.contact[0].telecom[0].value == "+31201234567" assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName" } ).valueUri ) assert inst.extension[0].valueString == "Organa" assert inst.gender == "female" assert inst.id == "infant-twin-1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://coruscanthealth.org/main-hospital/patient-identifier"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "MR" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].value == "MRN7465737865" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://new-republic.gov/galactic-citizen-identifier"} ).valueUri ) assert inst.identifier[1].value == "7465737865" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.multipleBirthInteger == 1 assert inst.name[0].family == "Solo" assert inst.name[0].given[0] == "Jaina" assert inst.name[0].use == "official" assert inst.text.div == ( '

Jaina Solo' " (OFFICIAL) female, DoB: 2017-05-15 ( Medical record " "number: MRN7465737865)

" ) assert inst.text.status == "generated" def test_patient_4(base_settings): """No. 4 tests collection for Patient. Test File: patient-example-infant-twin-1.json """ filename = base_settings["unittest_data_dir"] / "patient-example-infant-twin-1.json" inst = patient.Patient.model_validate_json(filename.read_bytes()) assert "Patient" == inst.get_resource_type() impl_patient_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Patient" == data["resourceType"] inst2 = patient.Patient(**data) impl_patient_4(inst2) def impl_patient_5(inst): assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1995-10-12"}).valueDate ) assert inst.gender == "female" assert inst.generalPractitioner[0].display == "Too-Onebee" assert inst.generalPractitioner[0].reference == "Practitioner/21B" assert inst.id == "infant-mom" assert inst.maritalStatus.coding[0].code == "M" assert inst.maritalStatus.coding[0].display == "Married" assert ( inst.maritalStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Solo" assert inst.name[0].given[0] == "Leia" assert inst.name[0].use == "official" assert inst.name[1].family == "Organa" assert inst.name[1].given[0] == "Leia" assert inst.name[1].use == "maiden" assert inst.text.div == ( '

Leia Solo ' "(OFFICIAL) female, DoB: 1995-10-12

" ) assert inst.text.status == "generated" def test_patient_5(base_settings): """No. 5 tests collection for Patient. Test File: patient-example-infant-mom.json """ filename = base_settings["unittest_data_dir"] / "patient-example-infant-mom.json" inst = patient.Patient.model_validate_json(filename.read_bytes()) assert "Patient" == inst.get_resource_type() impl_patient_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Patient" == data["resourceType"] inst2 = patient.Patient(**data) impl_patient_5(inst2) def impl_patient_6(inst): assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "2017-09-05"}).valueDate ) assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName" } ).valueUri ) assert inst.extension[0].valueString == "Everywoman" assert inst.gender == "male" assert inst.id == "newborn" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.multipleBirthInteger == 2 assert inst.text.div == ( '

Anonymous ' "Patient male, DoB: 2017-09-05

" ) assert inst.text.status == "generated" def test_patient_6(base_settings): """No. 6 tests collection for Patient. Test File: patient-example-newborn.json """ filename = base_settings["unittest_data_dir"] / "patient-example-newborn.json" inst = patient.Patient.model_validate_json(filename.read_bytes()) assert "Patient" == inst.get_resource_type() impl_patient_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Patient" == data["resourceType"] inst2 = patient.Patient(**data) impl_patient_6(inst2) def impl_patient_7(inst): assert inst.contact[0].name.family == "Organa" assert inst.contact[0].name.given[0] == "Leia" assert inst.contact[0].name.use == "maiden" assert inst.contact[0].relationship[0].coding[0].code == "72705000" assert inst.contact[0].relationship[0].coding[0].display == "Mother" assert ( inst.contact[0].relationship[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.contact[0].relationship[0].coding[1].code == "N" assert ( inst.contact[0].relationship[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0131"} ).valueUri ) assert inst.contact[0].relationship[0].coding[2].code == "MTH" assert ( inst.contact[0].relationship[0].coding[2].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].use == "mobile" assert inst.contact[0].telecom[0].value == "+31201234567" assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName" } ).valueUri ) assert inst.extension[0].valueString == "Organa" assert inst.gender == "male" assert inst.id == "infant-fetal" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://coruscanthealth.org/main-hospital/patient-identifier"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "MR" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].value == "MRN657865757378" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.div == ( '

Anonymous ' "Patient male, DoB Unknown ( Medical record number: " "MRN657865757378)

" ) assert inst.text.status == "generated" def test_patient_7(base_settings): """No. 7 tests collection for Patient. Test File: patient-example-infant-fetal.json """ filename = base_settings["unittest_data_dir"] / "patient-example-infant-fetal.json" inst = patient.Patient.model_validate_json(filename.read_bytes()) assert "Patient" == inst.get_resource_type() impl_patient_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Patient" == data["resourceType"] inst2 = patient.Patient(**data) impl_patient_7(inst2) def impl_patient_8(inst): assert inst.active is True assert inst.address[0].line[0] == "2222 Home Street" assert inst.address[0].use == "home" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1973-05-31"}).valueDate ) assert inst.gender == "female" assert inst.id == "genetics-example1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/us-ssn"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "SS" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].value == "444222222" assert inst.managingOrganization.reference == "Organization/hl7" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2012-05-29T23:45:32Z"} ).valueInstant ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Everywoman" assert inst.name[0].given[0] == "Eve" assert inst.name[0].use == "official" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "555-555-2003" assert inst.text.status == "generated" def test_patient_8(base_settings): """No. 8 tests collection for Patient. Test File: patient-genetics-example1.json """ filename = base_settings["unittest_data_dir"] / "patient-genetics-example1.json" inst = patient.Patient.model_validate_json(filename.read_bytes()) assert "Patient" == inst.get_resource_type() impl_patient_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Patient" == data["resourceType"] inst2 = patient.Patient(**data) impl_patient_8(inst2) def impl_patient_9(inst): assert inst.active is True assert inst.gender == "other" assert inst.id == "pat2" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:0.1.2.3.4.5.6.7"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "MR" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].use == "usual" assert inst.identifier[0].value == "123456" assert inst.link[0].other.reference == "Patient/pat1" assert inst.link[0].type == "seealso" assert inst.managingOrganization.display == "ACME Healthcare, Inc" assert inst.managingOrganization.reference == "Organization/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Donald" assert inst.name[0].given[0] == "Duck" assert inst.name[0].given[1] == "D" assert inst.name[0].use == "official" assert inst.photo[0].contentType == "image/gif" assert inst.text.status == "generated" def test_patient_9(base_settings): """No. 9 tests collection for Patient. Test File: patient-example-b.json """ filename = base_settings["unittest_data_dir"] / "patient-example-b.json" inst = patient.Patient.model_validate_json(filename.read_bytes()) assert "Patient" == inst.get_resource_type() impl_patient_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Patient" == data["resourceType"] inst2 = patient.Patient(**data) impl_patient_9(inst2) def impl_patient_10(inst): assert inst.active is True assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1982-01-23"}).valueDate ) assert ( inst.deceasedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-14T13:42:00+10:00"} ).valueDateTime ) assert inst.gender == "male" assert inst.id == "pat3" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:0.1.2.3.4.5.6.7"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "MR" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].use == "usual" assert inst.identifier[0].value == "123457" assert inst.managingOrganization.display == "ACME Healthcare, Inc" assert inst.managingOrganization.reference == "Organization/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Notsowell" assert inst.name[0].given[0] == "Simon" assert inst.name[0].use == "official" assert inst.text.status == "generated" def test_patient_10(base_settings): """No. 10 tests collection for Patient. Test File: patient-example-c.json """ filename = base_settings["unittest_data_dir"] / "patient-example-c.json" inst = patient.Patient.model_validate_json(filename.read_bytes()) assert "Patient" == inst.get_resource_type() impl_patient_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Patient" == data["resourceType"] inst2 = patient.Patient(**data) impl_patient_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_paymentnotice.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/PaymentNotice Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import paymentnotice from .conftest import ExternalValidatorModel # noqa: F401 def impl_paymentnotice_1(inst): assert inst.amount.currency == "USD" assert float(inst.amount.value) == float(12500.0) assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.id == "77654" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://benefitsinc.com/paymentnotice"} ).valueUri ) assert inst.identifier[0].value == "776543" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.payee.reference == "Organization/1" assert inst.payment.reference == "PaymentReconciliation/ER2500" assert ( inst.paymentDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-15"}).valueDate ) assert inst.paymentStatus.coding[0].code == "paid" assert ( inst.paymentStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/paymentstatus"} ).valueUri ) assert inst.provider.reference == "Organization/1" assert ( inst.recipient.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://regulators.gov"} ).valueUri ) assert inst.recipient.identifier.value == "AB123" assert inst.request.reference == "http://benefitsinc.com/fhir/claim/12345" assert ( inst.response.reference == "http://benefitsinc.com/fhir/claimresponse/CR12345" ) assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the PaymentNotice
" ) assert inst.text.status == "generated" def test_paymentnotice_1(base_settings): """No. 1 tests collection for PaymentNotice. Test File: paymentnotice-example.json """ filename = base_settings["unittest_data_dir"] / "paymentnotice-example.json" inst = paymentnotice.PaymentNotice.model_validate_json(filename.read_bytes()) assert "PaymentNotice" == inst.get_resource_type() impl_paymentnotice_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PaymentNotice" == data["resourceType"] inst2 = paymentnotice.PaymentNotice(**data) impl_paymentnotice_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_paymentreconciliation.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/PaymentReconciliation Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import paymentreconciliation from .conftest import ExternalValidatorModel # noqa: F401 def impl_paymentreconciliation_1(inst): assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.detail[0].amount.currency == "USD" assert float(inst.detail[0].amount.value) == float(3500.0) assert ( inst.detail[0].date == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert ( inst.detail[0].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/payment/2018/detail"} ).valueUri ) assert inst.detail[0].identifier.value == "10-12345-001" assert inst.detail[0].payee.reference == "Organization/1" assert ( inst.detail[0].request.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalleyclinic.com/claim"} ).valueUri ) assert inst.detail[0].request.identifier.value == "AB12345" assert ( inst.detail[0].response.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/claimresponse"} ).valueUri ) assert inst.detail[0].response.identifier.value == "CR20140815-AB12345" assert inst.detail[0].submitter.reference == "Organization/1" assert inst.detail[0].type.coding[0].code == "payment" assert ( inst.detail[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/payment-type"} ).valueUri ) assert inst.detail[1].amount.currency == "USD" assert float(inst.detail[1].amount.value) == float(4000.0) assert ( inst.detail[1].date == ExternalValidatorModel.model_validate({"valueDate": "2014-08-12"}).valueDate ) assert ( inst.detail[1].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/payment/2018/detail"} ).valueUri ) assert inst.detail[1].identifier.value == "10-12345-002" assert ( inst.detail[1].request.reference == "http://www.BenefitsInc.com/fhir/oralhealthclaim/225476332699" ) assert inst.detail[1].type.coding[0].code == "payment" assert ( inst.detail[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/payment-type"} ).valueUri ) assert inst.detail[2].amount.currency == "USD" assert float(inst.detail[2].amount.value) == float(-1500.0) assert ( inst.detail[2].date == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert ( inst.detail[2].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/payment/2018/detail"} ).valueUri ) assert inst.detail[2].identifier.value == "10-12345-003" assert inst.detail[2].type.coding[0].code == "advance" assert ( inst.detail[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/payment-type"} ).valueUri ) assert inst.disposition == "2014 August mid-month settlement." assert inst.formCode.coding[0].code == "PAYREC/2016/01B" assert ( inst.formCode.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ncforms.org/formid"} ).valueUri ) assert inst.id == "ER2500" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/enrollmentresponse"} ).valueUri ) assert inst.identifier[0].value == "781234" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "complete" assert inst.paymentAmount.currency == "USD" assert float(inst.paymentAmount.value) == float(7000.0) assert ( inst.paymentDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-01"}).valueDate ) assert ( inst.paymentIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/payment/2018"} ).valueUri ) assert inst.paymentIdentifier.value == "10-12345" assert inst.paymentIssuer.reference == "Organization/2" assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-31"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.processNote[0].text == ( "Due to the year end holiday the cutoff for submissions for " "December will be the 28th." ) assert inst.processNote[0].type == "display" assert ( inst.request.reference == "http://www.BenefitsInc.com/fhir/eligibility/225476332402" ) assert inst.requestor.reference == "Organization/1" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the PaymentReconciliation
" ) assert inst.text.status == "generated" def test_paymentreconciliation_1(base_settings): """No. 1 tests collection for PaymentReconciliation. Test File: paymentreconciliation-example.json """ filename = base_settings["unittest_data_dir"] / "paymentreconciliation-example.json" inst = paymentreconciliation.PaymentReconciliation.model_validate_json( filename.read_bytes() ) assert "PaymentReconciliation" == inst.get_resource_type() impl_paymentreconciliation_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PaymentReconciliation" == data["resourceType"] inst2 = paymentreconciliation.PaymentReconciliation(**data) impl_paymentreconciliation_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_person.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Person Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import person from .conftest import ExternalValidatorModel # noqa: F401 def impl_person_1(inst): assert inst.active is True assert inst.address[0].city == "Sandusky" assert inst.address[0].country == "USA" assert inst.address[0].line[0] == "2086 College St" assert inst.address[0].postalCode == "44870" assert inst.address[0].state == "OH" assert inst.address[0].use == "home" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1974-03-07"}).valueDate ) assert inst.gender == "female" assert inst.id == "pp" assert inst.identifier[0].assigner.display == "Ohio Bureau of Motor Vehicles" assert ( inst.identifier[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2041-09-23"} ).valueDateTime ) assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.4.3.39"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "DL" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].type.text == "Ohio driver license" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "TL545786" assert inst.link[0].assurance == "level3" assert inst.link[0].target.display == "Eve Everywoman" assert inst.link[0].target.reference == "http://www.goodhealth.com/Patient/98574" assert inst.link[1].assurance == "level2" assert inst.link[1].target.display == "Eve Marie Everywoman" assert inst.link[1].target.reference == "http://www.acme-medical.com/Patient/ab34d" assert inst.managingOrganization.display == "Goodhealth Patient Portal" assert ( inst.managingOrganization.reference == "http://www.goodhealth.com/Organization/12" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Everywoman" assert inst.name[0].given[0] == "Eve" assert inst.name[0].given[1] == "Marie" assert inst.name[0].use == "official" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "home" assert inst.telecom[0].value == "(621)-479-9743" assert inst.text.status == "generated" def test_person_1(base_settings): """No. 1 tests collection for Person. Test File: person-patient-portal.json """ filename = base_settings["unittest_data_dir"] / "person-patient-portal.json" inst = person.Person.model_validate_json(filename.read_bytes()) assert "Person" == inst.get_resource_type() impl_person_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Person" == data["resourceType"] inst2 = person.Person(**data) impl_person_1(inst2) def impl_person_2(inst): assert inst.active is True assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1963"}).valueDate ) assert inst.gender == "female" assert inst.id == "f002" assert inst.link[0].target.display == "Ariadne Bor-Jansma" assert inst.link[0].target.reference == "RelatedPerson/f002" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].text == "Ariadne Bor-Jansma" assert inst.name[0].use == "usual" assert inst.photo.contentType == "image/jpeg" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "home" assert inst.telecom[0].value == "+31201234567" assert inst.text.status == "generated" def test_person_2(base_settings): """No. 2 tests collection for Person. Test File: person-example-f002-ariadne.json """ filename = base_settings["unittest_data_dir"] / "person-example-f002-ariadne.json" inst = person.Person.model_validate_json(filename.read_bytes()) assert "Person" == inst.get_resource_type() impl_person_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Person" == data["resourceType"] inst2 = person.Person(**data) impl_person_2(inst2) def impl_person_3(inst): assert inst.active is True assert inst.address[0].city == "Northfield" assert inst.address[0].line[0] == "1003 Healthcare Drive" assert inst.address[0].state == "MN" assert inst.address[0].use == "home" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1959-04-22"}).valueDate ) assert inst.gender == "male" assert inst.id == "pd" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/us-ssn"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "SS" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "444444444" assert inst.link[0].assurance == "level2" assert inst.link[0].target.display == "Dr. Harold Hippocrates" assert ( inst.link[0].target.reference == "http://www.goodhealth.com/Practitioner/98574" ) assert inst.link[1].assurance == "level2" assert inst.link[1].target.display == "Harold Hippocrates, MD" assert ( inst.link[1].target.reference == "http://www.acme-medical.com/Practitioner/ab34d" ) assert ( inst.managingOrganization.display == "Northfield Regional Physician Directory" ) assert ( inst.managingOrganization.reference == "http://www.northfield-regional.com/Organization/2" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Hippocrates" assert inst.name[0].given[0] == "Harold" assert inst.name[0].use == "official" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "555-555-1003" assert inst.text.status == "generated" def test_person_3(base_settings): """No. 3 tests collection for Person. Test File: person-provider-directory.json """ filename = base_settings["unittest_data_dir"] / "person-provider-directory.json" inst = person.Person.model_validate_json(filename.read_bytes()) assert "Person" == inst.get_resource_type() impl_person_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Person" == data["resourceType"] inst2 = person.Person(**data) impl_person_3(inst2) def impl_person_4(inst): assert inst.active is True assert inst.address[0].city == "PleasantVille" assert inst.address[0].line[0] == "534 Erewhon St" assert inst.address[0].postalCode == "3999" assert inst.address[0].state == "Vic" assert inst.address[0].use == "home" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1974-12-25"}).valueDate ) assert inst.gender == "male" assert inst.id == "example" assert inst.identifier[0].assigner.display == "Acme Healthcare" assert ( inst.identifier[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2001-05-06"} ).valueDateTime ) assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.2.36.146.595.217.0.1"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "MR" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].use == "usual" assert inst.identifier[0].value == "12345" assert inst.link[0].target.display == "Peter Chalmers" assert inst.link[0].target.reference == "RelatedPerson/peter" assert inst.link[1].target.display == "Peter Chalmers" assert inst.link[1].target.reference == "Patient/example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Chalmers" assert inst.name[0].given[0] == "Peter" assert inst.name[0].given[1] == "James" assert inst.name[0].use == "official" assert inst.name[1].given[0] == "Jim" assert inst.name[1].use == "usual" assert inst.telecom[0].use == "home" assert inst.telecom[1].system == "phone" assert inst.telecom[1].use == "work" assert inst.telecom[1].value == "(03) 5555 6473" assert inst.telecom[2].system == "email" assert inst.telecom[2].use == "home" assert inst.telecom[2].value == "Jim@example.org" assert inst.text.status == "generated" def test_person_4(base_settings): """No. 4 tests collection for Person. Test File: person-example.json """ filename = base_settings["unittest_data_dir"] / "person-example.json" inst = person.Person.model_validate_json(filename.read_bytes()) assert "Person" == inst.get_resource_type() impl_person_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Person" == data["resourceType"] inst2 = person.Person(**data) impl_person_4(inst2) def impl_person_5(inst): assert inst.active is True assert inst.address[0].city == "PleasantVille" assert inst.address[0].line[0] == "534 Erewhon St" assert inst.address[0].postalCode == "3999" assert inst.address[0].state == "Vic" assert inst.address[0].use == "home" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1974-12-25"}).valueDate ) assert inst.gender == "male" assert inst.id == "grahame" assert inst.identifier[0].assigner.display == "Acme Healthcare" assert ( inst.identifier[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2001-05-06"} ).valueDateTime ) assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.2.36.146.595.217.0.1"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "MR" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].use == "usual" assert inst.identifier[0].value == "12345" assert inst.managingOrganization.reference == "Organization/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Chalmers" assert inst.name[0].given[0] == "Peter" assert inst.name[0].given[1] == "James" assert inst.name[0].use == "official" assert inst.name[1].given[0] == "Jim" assert inst.name[1].use == "usual" assert inst.telecom[0].use == "home" assert inst.telecom[1].system == "phone" assert inst.telecom[1].use == "work" assert inst.telecom[1].value == "(03) 5555 6473" assert inst.text.status == "generated" def test_person_5(base_settings): """No. 5 tests collection for Person. Test File: person-grahame.json """ filename = base_settings["unittest_data_dir"] / "person-grahame.json" inst = person.Person.model_validate_json(filename.read_bytes()) assert "Person" == inst.get_resource_type() impl_person_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Person" == data["resourceType"] inst2 = person.Person(**data) impl_person_5(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_plandefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/PlanDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import plandefinition from .conftest import ExternalValidatorModel # noqa: F401 def impl_plandefinition_1(inst): assert ( inst.action[0].action[0].action[0].action[0].action[0].definitionCanonical == "#1111" ) assert ( inst.action[0] .action[0] .action[0] .action[0] .action[0] .extension[0] .extension[0] .url == ExternalValidatorModel.model_validate({"valueUri": "day"}).valueUri ) assert ( inst.action[0] .action[0] .action[0] .action[0] .action[0] .extension[0] .extension[0] .valueInteger == 1 ) assert ( inst.action[0] .action[0] .action[0] .action[0] .action[0] .extension[0] .extension[1] .url == ExternalValidatorModel.model_validate({"valueUri": "day"}).valueUri ) assert ( inst.action[0] .action[0] .action[0] .action[0] .action[0] .extension[0] .extension[1] .valueInteger == 8 ) assert ( inst.action[0].action[0].action[0].action[0].action[0].extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/timing-daysOfCycle"} ).valueUri ) assert inst.action[0].action[0].action[0].action[0].action[0].id == "action-1" assert ( inst.action[0].action[0].action[0].action[0].action[0].textEquivalent == "Gemcitabine 1250 mg/m² IV over 30 minutes on days 1 and 8" ) assert ( inst.action[0].action[0].action[0].action[0].action[1].definitionCanonical == "#2222" ) assert ( inst.action[0] .action[0] .action[0] .action[0] .action[1] .extension[0] .extension[0] .url == ExternalValidatorModel.model_validate({"valueUri": "day"}).valueUri ) assert ( inst.action[0] .action[0] .action[0] .action[0] .action[1] .extension[0] .extension[0] .valueInteger == 1 ) assert ( inst.action[0].action[0].action[0].action[0].action[1].extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/timing-daysOfCycle"} ).valueUri ) assert inst.action[0].action[0].action[0].action[0].action[1].id == "action-2" assert ( inst.action[0].action[0].action[0].action[0].action[1].relatedAction[0].actionId == "action-1" ) assert ( inst.action[0] .action[0] .action[0] .action[0] .action[1] .relatedAction[0] .relationship == "concurrent-with-start" ) assert ( inst.action[0].action[0].action[0].action[0].action[1].textEquivalent == "CARBOplatin AUC 5 IV over 30 minutes on Day 1" ) assert inst.action[0].action[0].action[0].action[0].id == "cycle-definition-1" assert ( inst.action[0].action[0].action[0].action[0].textEquivalent == "21-day cycle for 6 cycles" ) assert inst.action[0].action[0].action[0].action[0].timingTiming.repeat.count == 6 assert float( inst.action[0].action[0].action[0].action[0].timingTiming.repeat.duration ) == float(21) assert ( inst.action[0].action[0].action[0].action[0].timingTiming.repeat.durationUnit == "d" ) assert inst.action[0].action[0].action[0].groupingBehavior == "sentence-group" assert inst.action[0].action[0].action[0].selectionBehavior == "exactly-one" assert inst.action[0].action[0].selectionBehavior == "all" assert inst.action[0].selectionBehavior == "exactly-one" assert ( inst.approvalDate == ExternalValidatorModel.model_validate({"valueDate": "2016-07-27"}).valueDate ) assert inst.author[0].name == "Lee Surprenant" assert inst.contained[0].id == "1111" assert inst.contained[1].id == "2222" assert inst.copyright == "All rights reserved." assert inst.experimental is True assert inst.id == "KDN5" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/ordertemplates"} ).valueUri ) assert inst.identifier[0].value == "KDN5" assert ( inst.lastReviewDate == ExternalValidatorModel.model_validate({"valueDate": "2016-07-27"}).valueDate ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.publisher == "National Comprehensive Cancer Network, Inc." assert ( inst.relatedArtifact[0].display == "NCCN Guidelines for Kidney Cancer. V.2.2016" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "http://www.example.org/professionals/physician_gls/PDF/kidney.pdf" } ).valueUrl ) assert inst.relatedArtifact[0].type == "derived-from" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( { "valueUrl": "http://www.example.org/professionals/physician_gls/PDF/kidney.pdf" } ).valueUrl ) assert ( inst.relatedArtifact[1].citation == "Oudard S, et al. J Urol. 2007;177(5):1698-702" ) assert ( inst.relatedArtifact[1].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://www.ncbi.nlm.nih.gov/pubmed/17437788"} ).valueUrl ) assert inst.relatedArtifact[1].type == "citation" assert ( inst.relatedArtifact[1].url == ExternalValidatorModel.model_validate( {"valueUrl": "http://www.ncbi.nlm.nih.gov/pubmed/17437788"} ).valueUrl ) assert inst.status == "draft" assert inst.text.status == "additional" assert inst.title == "Gemcitabine/CARBOplatin" assert inst.type.text == "Chemotherapy Order Template" assert inst.useContext[0].code.code == "treamentSetting-or-diseaseStatus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/indications"} ).valueUri ) assert ( inst.useContext[0].extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/usagecontext-group"} ).valueUri ) assert inst.useContext[0].extension[0].valueString == "A" assert inst.useContext[0].valueCodeableConcept.text == "Metastatic" assert inst.useContext[1].code.code == "disease-or-histology" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/indications"} ).valueUri ) assert ( inst.useContext[1].extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/usagecontext-group"} ).valueUri ) assert inst.useContext[1].extension[0].valueString == "A" assert ( inst.useContext[1].valueCodeableConcept.text == "Collecting Duct/Medullary Subtypes" ) assert inst.useContext[2].code.code == "focus" assert ( inst.useContext[2].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert ( inst.useContext[2].extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/usagecontext-group"} ).valueUri ) assert inst.useContext[2].extension[0].valueString == "A" assert inst.useContext[2].valueCodeableConcept.text == "Kidney Cancer" assert inst.useContext[3].code.code == "treatmentSetting-or-diseaseStatus" assert ( inst.useContext[3].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/indications"} ).valueUri ) assert ( inst.useContext[3].extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/usagecontext-group"} ).valueUri ) assert inst.useContext[3].extension[0].valueString == "B" assert inst.useContext[3].valueCodeableConcept.text == "Relapsed" assert inst.useContext[4].code.code == "disease-or-histology" assert ( inst.useContext[4].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/indications"} ).valueUri ) assert ( inst.useContext[4].extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/usagecontext-group"} ).valueUri ) assert inst.useContext[4].extension[0].valueString == "B" assert ( inst.useContext[4].valueCodeableConcept.text == "Collecting Duct/Medullary Subtypes" ) assert inst.useContext[5].code.code == "focus" assert ( inst.useContext[5].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert ( inst.useContext[5].extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/usagecontext-group"} ).valueUri ) assert inst.useContext[5].extension[0].valueString == "B" assert inst.useContext[5].valueCodeableConcept.text == ( "Kidney Cancer – Collecting Duct/Medullary Subtypes - " "Metastatic" ) assert inst.version == "1" def test_plandefinition_1(base_settings): """No. 1 tests collection for PlanDefinition. Test File: plandefinition-example-kdn5-simplified.json """ filename = ( base_settings["unittest_data_dir"] / "plandefinition-example-kdn5-simplified.json" ) inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes()) assert "PlanDefinition" == inst.get_resource_type() impl_plandefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PlanDefinition" == data["resourceType"] inst2 = plandefinition.PlanDefinition(**data) impl_plandefinition_1(inst2) def impl_plandefinition_2(inst): assert ( inst.action[0].action[0].definitionCanonical == "#activitydefinition-medicationrequest-1" ) assert inst.action[0].action[0].id == "medication-action-1" assert inst.action[0].action[0].title == "Administer Medication 1" assert ( inst.action[0].action[1].definitionCanonical == "#activitydefinition-medicationrequest-2" ) assert inst.action[0].action[1].id == "medication-action-2" assert inst.action[0].action[1].relatedAction[0].actionId == "medication-action-1" assert inst.action[0].action[1].relatedAction[0].offsetDuration.code == "h" assert ( inst.action[0].action[1].relatedAction[0].offsetDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.action[0].action[1].relatedAction[0].offsetDuration.unit == "h" assert float( inst.action[0].action[1].relatedAction[0].offsetDuration.value ) == float(1) assert inst.action[0].action[1].relatedAction[0].relationship == "after-end" assert inst.action[0].action[1].title == "Administer Medication 2" assert inst.action[0].groupingBehavior == "logical-group" assert inst.action[0].selectionBehavior == "all" assert inst.contained[0].id == "activitydefinition-medicationrequest-1" assert inst.contained[1].id == "activitydefinition-medicationrequest-2" assert inst.experimental is True assert inst.id == "options-example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "draft" assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" assert inst.title == "This example illustrates relationships between actions." def test_plandefinition_2(base_settings): """No. 2 tests collection for PlanDefinition. Test File: plandefinition-options-example.json """ filename = ( base_settings["unittest_data_dir"] / "plandefinition-options-example.json" ) inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes()) assert "PlanDefinition" == inst.get_resource_type() impl_plandefinition_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PlanDefinition" == data["resourceType"] inst2 = plandefinition.PlanDefinition(**data) impl_plandefinition_2(inst2) def impl_plandefinition_3(inst): assert ( inst.action[0].action[0].dynamicValue[0].expression.expression == "Communication Request to Provider" ) assert inst.action[0].action[0].dynamicValue[0].expression.language == "text/cql" assert inst.action[0].action[0].dynamicValue[0].path == "/" assert inst.action[0].action[0].textEquivalent == ( "A Breastfeeding Readiness Assessment is recommended, please " "authorize or reject the order." ) assert inst.action[0].action[0].title == "Notify the provider to sign the order." assert inst.action[0].action[0].type.coding[0].code == "create" assert ( inst.action[0].condition[0].expression.expression == "Should Notify Provider to Sign Assessment Order" ) assert inst.action[0].condition[0].expression.language == "text/cql" assert inst.action[0].condition[0].kind == "applicability" assert inst.action[0].title == ( "Mother should be administered a breastfeeding readiness " "assessment." ) assert inst.action[0].trigger[0].name == "Admission" assert inst.action[0].trigger[0].type == "named-event" assert inst.action[0].trigger[1].name == "Birth" assert inst.action[0].trigger[1].type == "named-event" assert inst.action[0].trigger[2].name == "Infant Transfer to Recovery" assert inst.action[0].trigger[2].type == "named-event" assert inst.action[0].trigger[3].name == "Transfer to Post-Partum" assert inst.action[0].trigger[3].type == "named-event" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-03-08"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "exclusive-breastfeeding-intervention-02" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "exclusive-breastfeeding-intervention-02" assert inst.library[0] == ( "http://example.org/fhir/Library/library-exclusive-" "breastfeeding-cds-logic" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.relatedArtifact[0].resource == ( "http://example.org/fhir/Measure/measure-exclusive-" "breastfeeding" ) assert inst.relatedArtifact[0].type == "derived-from" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Exclusive Breastfeeding Intervention-02" assert inst.topic[0].text == "Exclusive Breastfeeding" assert inst.version == "1.0.0" def test_plandefinition_3(base_settings): """No. 3 tests collection for PlanDefinition. Test File: plandefinition-exclusive-breastfeeding-intervention-02.json """ filename = ( base_settings["unittest_data_dir"] / "plandefinition-exclusive-breastfeeding-intervention-02.json" ) inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes()) assert "PlanDefinition" == inst.get_resource_type() impl_plandefinition_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PlanDefinition" == data["resourceType"] inst2 = plandefinition.PlanDefinition(**data) impl_plandefinition_3(inst2) def impl_plandefinition_4(inst): assert ( inst.action[0].action[0].dynamicValue[0].expression.expression == "Communication Request to Charge Nurse" ) assert inst.action[0].action[0].dynamicValue[0].expression.language == "text/cql" assert inst.action[0].action[0].dynamicValue[0].path == "/" assert inst.action[0].action[0].textEquivalent == ( "A Breastfeeding Readiness Assessment is recommended, please " "administer the assessment." ) assert ( inst.action[0].action[0].title == "Notify the charge nurse to perform the assessment." ) assert inst.action[0].action[0].type.coding[0].code == "create" assert ( inst.action[0].action[1].dynamicValue[0].expression.expression == "Communication Request to Bedside Nurse" ) assert inst.action[0].action[1].dynamicValue[0].expression.language == "text/cql" assert inst.action[0].action[1].dynamicValue[0].path == "/" assert inst.action[0].action[1].textEquivalent == ( "A Breastfeeding Readiness Assessment is recommended, please " "administer the assessment." ) assert ( inst.action[0].action[1].title == "Notify the bedside nurse to perform the assessment." ) assert inst.action[0].action[1].type.coding[0].code == "create" assert ( inst.action[0].condition[0].expression.expression == "Should Notify Nurse to Perform Assessment" ) assert inst.action[0].condition[0].expression.language == "text/cql" assert inst.action[0].condition[0].kind == "applicability" assert inst.action[0].title == ( "Mother should be administered a breastfeeding readiness " "assessment." ) assert inst.action[0].trigger[0].name == "Admission" assert inst.action[0].trigger[0].type == "named-event" assert inst.action[0].trigger[1].name == "Birth" assert inst.action[0].trigger[1].type == "named-event" assert inst.action[0].trigger[2].name == "Infant Transfer to Recovery" assert inst.action[0].trigger[2].type == "named-event" assert inst.action[0].trigger[3].name == "Transfer to Post-Partum" assert inst.action[0].trigger[3].type == "named-event" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-03-08"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "exclusive-breastfeeding-intervention-03" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "exclusive-breastfeeding-intervention-03" assert inst.library[0] == ( "http://example.org/fhir/Library/library-exclusive-" "breastfeeding-cds-logic" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.relatedArtifact[0].resource == ( "http://example.org/fhir/Measure/measure-exclusive-" "breastfeeding" ) assert inst.relatedArtifact[0].type == "derived-from" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Exclusive Breastfeeding Intervention-03" assert inst.topic[0].text == "Exclusive Breastfeeding" assert inst.version == "1.0.0" def test_plandefinition_4(base_settings): """No. 4 tests collection for PlanDefinition. Test File: plandefinition-exclusive-breastfeeding-intervention-03.json """ filename = ( base_settings["unittest_data_dir"] / "plandefinition-exclusive-breastfeeding-intervention-03.json" ) inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes()) assert "PlanDefinition" == inst.get_resource_type() impl_plandefinition_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PlanDefinition" == data["resourceType"] inst2 = plandefinition.PlanDefinition(**data) impl_plandefinition_4(inst2) def impl_plandefinition_5(inst): assert ( inst.action[0].action[0].action[0].definitionCanonical == "#referralToCardiologyConsult" ) assert ( inst.action[0].action[0].action[0].dynamicValue[0].expression.expression == "Now()" ) assert ( inst.action[0].action[0].action[0].dynamicValue[0].expression.language == "text/cql" ) assert inst.action[0].action[0].action[0].dynamicValue[0].path == "timing.event" assert inst.action[0].action[0].action[0].dynamicValue[1].expression.expression == ( "Code '261QM0850X' from CardiologyChestPainLogic.\"NUCC " "Provider Taxonomy\" display 'Adult Mental Health'" ) assert ( inst.action[0].action[0].action[0].dynamicValue[1].expression.language == "text/cql" ) assert inst.action[0].action[0].action[0].dynamicValue[1].path == "specialty" assert ( inst.action[0].action[0].action[0].dynamicValue[2].expression.expression == "CardiologyChestPainLogic.ServiceRequestFulfillmentTime" ) assert ( inst.action[0].action[0].action[0].dynamicValue[2].expression.language == "text/cql" ) assert ( inst.action[0].action[0].action[0].dynamicValue[2].path == "occurrenceDateTime" ) assert ( inst.action[0].action[0].action[0].dynamicValue[3].expression.expression == "CardiologyChestPainLogic.Patient" ) assert ( inst.action[0].action[0].action[0].dynamicValue[3].expression.language == "text/cql" ) assert inst.action[0].action[0].action[0].dynamicValue[3].path == "subject" assert ( inst.action[0].action[0].action[0].dynamicValue[4].expression.expression == "CardiologyChestPainLogic.Practitioner" ) assert ( inst.action[0].action[0].action[0].dynamicValue[4].expression.language == "text/cql" ) assert inst.action[0].action[0].action[0].dynamicValue[4].path == "requester.agent" assert ( inst.action[0].action[0].action[0].dynamicValue[5].expression.expression == "CardiologyChestPainLogic.CardiologyReferralReason" ) assert ( inst.action[0].action[0].action[0].dynamicValue[5].expression.language == "text/cql" ) assert inst.action[0].action[0].action[0].dynamicValue[5].path == "reasonCode" assert ( inst.action[0].action[0].action[0].dynamicValue[6].expression.expression == "CardiologyChestPainLogic.RiskAssessment" ) assert ( inst.action[0].action[0].action[0].dynamicValue[6].expression.language == "text/cql" ) assert inst.action[0].action[0].action[0].dynamicValue[6].path == "reasonReference" assert ( inst.action[0].action[0].action[0].textEquivalent == "Referral to cardiology to evaluate chest pain (routine)" ) assert ( inst.action[0].action[0].action[1].definitionCanonical == "#CollectReferralReason" ) assert ( inst.action[0].action[0].action[1].title == "Reason for cardiology consultation" ) assert ( inst.action[0].action[0].action[2].definitionCanonical == "#CardiologyConsultationGoal" ) assert inst.action[0].action[0].action[2].title == "Goal of cardiology consultation" assert inst.action[0].action[0].groupingBehavior == "logical-group" assert inst.action[0].action[0].selectionBehavior == "any" assert inst.action[0].action[0].title == "Consults and Referrals" assert inst.action[0].action[1].action[0].groupingBehavior == "logical-group" assert inst.action[0].action[1].action[0].selectionBehavior == "at-most-one" assert ( inst.action[0].action[1].action[1].action[0].definitionCanonical == "#metoprololTartrate25Prescription" ) assert ( inst.action[0] .action[1] .action[1] .action[0] .dynamicValue[0] .expression.expression == "'draft'" ) assert ( inst.action[0].action[1].action[1].action[0].dynamicValue[0].expression.language == "text/cql" ) assert inst.action[0].action[1].action[1].action[0].dynamicValue[0].path == "status" assert ( inst.action[0] .action[1] .action[1] .action[0] .dynamicValue[1] .expression.expression == "CardiologyChestPainLogic.Patient" ) assert ( inst.action[0].action[1].action[1].action[0].dynamicValue[1].expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[1].action[0].dynamicValue[1].path == "patient" ) assert ( inst.action[0] .action[1] .action[1] .action[0] .dynamicValue[2] .expression.expression == "CardiologyChestPainLogic.Practitioner" ) assert ( inst.action[0].action[1].action[1].action[0].dynamicValue[2].expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[1].action[0].dynamicValue[2].path == "prescriber" ) assert ( inst.action[0].action[1].action[1].action[0].textEquivalent == "metoprolol tartrate 25 mg tablet 1 tablet oral 2 time daily" ) assert ( inst.action[0].action[1].action[1].action[1].definitionCanonical == "#metoprololTartrate50Prescription" ) assert ( inst.action[0] .action[1] .action[1] .action[1] .dynamicValue[0] .expression.expression == "'draft'" ) assert ( inst.action[0].action[1].action[1].action[1].dynamicValue[0].expression.language == "text/cql" ) assert inst.action[0].action[1].action[1].action[1].dynamicValue[0].path == "status" assert ( inst.action[0] .action[1] .action[1] .action[1] .dynamicValue[1] .expression.expression == "CardiologyChestPainLogic.Patient" ) assert ( inst.action[0].action[1].action[1].action[1].dynamicValue[1].expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[1].action[1].dynamicValue[1].path == "patient" ) assert ( inst.action[0] .action[1] .action[1] .action[1] .dynamicValue[2] .expression.expression == "CardiologyChestPainLogic.Practitioner" ) assert ( inst.action[0].action[1].action[1].action[1].dynamicValue[2].expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[1].action[1].dynamicValue[2].path == "prescriber" ) assert ( inst.action[0].action[1].action[1].action[1].textEquivalent == "metoprolol tartrate 50 mg tablet 1 tablet oral 2 time daily" ) assert ( inst.action[0].action[1].action[1].action[2].definitionCanonical == "#amlodipinePrescription" ) assert ( inst.action[0] .action[1] .action[1] .action[2] .dynamicValue[0] .expression.expression == "'draft'" ) assert ( inst.action[0].action[1].action[1].action[2].dynamicValue[0].expression.language == "text/cql" ) assert inst.action[0].action[1].action[1].action[2].dynamicValue[0].path == "status" assert ( inst.action[0] .action[1] .action[1] .action[2] .dynamicValue[1] .expression.expression == "CardiologyChestPainLogic.Patient" ) assert ( inst.action[0].action[1].action[1].action[2].dynamicValue[1].expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[1].action[2].dynamicValue[1].path == "patient" ) assert ( inst.action[0] .action[1] .action[1] .action[2] .dynamicValue[2] .expression.expression == "CardiologyChestPainLogic.Practitioner" ) assert ( inst.action[0].action[1].action[1].action[2].dynamicValue[2].expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[1].action[2].dynamicValue[2].path == "prescriber" ) assert ( inst.action[0].action[1].action[1].action[2].textEquivalent == "amlodipine 5 tablet 1 tablet oral daily" ) assert inst.action[0].action[1].action[1].groupingBehavior == "logical-group" assert inst.action[0].action[1].action[1].selectionBehavior == "at-most-one" assert inst.action[0].action[1].action[1].title == "Antianginal Therapy" assert ( inst.action[0].action[1].action[2].action[0].definitionCanonical == "#nitroglycerinPrescription" ) assert ( inst.action[0] .action[1] .action[2] .action[0] .dynamicValue[0] .expression.expression == "'draft'" ) assert ( inst.action[0].action[1].action[2].action[0].dynamicValue[0].expression.language == "text/cql" ) assert inst.action[0].action[1].action[2].action[0].dynamicValue[0].path == "status" assert ( inst.action[0] .action[1] .action[2] .action[0] .dynamicValue[1] .expression.expression == "CardiologyChestPainLogic.Patient" ) assert ( inst.action[0].action[1].action[2].action[0].dynamicValue[1].expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[2].action[0].dynamicValue[1].path == "patient" ) assert ( inst.action[0] .action[1] .action[2] .action[0] .dynamicValue[2] .expression.expression == "CardiologyChestPainLogic.Practitioner" ) assert ( inst.action[0].action[1].action[2].action[0].dynamicValue[2].expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[2].action[0].dynamicValue[2].path == "prescriber" ) assert inst.action[0].action[1].action[2].action[0].textEquivalent == ( "nitroglycerin 0.4 mg tablet sub-lingual every 5 minutes as " "needed for chest pain; maximum 3 tablets" ) assert inst.action[0].action[1].action[2].groupingBehavior == "logical-group" assert inst.action[0].action[1].action[2].selectionBehavior == "at-most-one" assert inst.action[0].action[1].action[2].title == "Nitroglycerin" assert inst.action[0].action[1].description == ( "Consider the following medications for stable patients to be" " initiated prior to the cardiology consultation." ) assert inst.action[0].action[1].title == "Medications" assert inst.author[0].name == "Bruce Bray MD" assert inst.author[1].name == "Scott Wall MD" assert inst.author[2].name == "Aiden Abidov MD, PhD" assert inst.contained[0].id == "cardiology-chestPain-logic" assert inst.contained[1].id == "referralToCardiologyConsult" assert inst.contained[2].id == "metoprololTartrate25Prescription" assert inst.contained[3].id == "metoprololTartrate25Medication" assert inst.contained[4].id == "metoprololTartrate25Substance" assert inst.contained[5].id == "metoprololTartrate50Prescription" assert inst.contained[6].id == "metoprololTartrate50Medication" assert inst.contained[7].id == "metoprololTartrate50Substance" assert inst.contained[8].id == "nitroglycerinPrescription" assert inst.contained[9].id == "nitroglycerinMedication" assert inst.copyright == ( "© Copyright Cognitive Medical Systems, Inc. 9444 Waples " "Street Suite 300 San Diego, CA 92121" ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-08-29"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "example-cardiology-os" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:va.gov:kbs:knart:artifact:r1"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "bb7ccea6-9744-4743-854a-bcffd87191f6" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( { "valueUri": "urn:va.gov:kbs:contract:VA118-16-D-1008:to:VA-118-16-F-1008-0007" } ).valueUri ) assert inst.identifier[1].value == "CLIN0004AG" assert ( inst.identifier[2].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:cognitivemedicine.com:lab:jira"} ).valueUri ) assert inst.identifier[2].value == "KP-914" assert inst.library[0] == "#cardiology-chestPain-logic" assert inst.name == "ChestPainCoronaryArteryDiseaseOrderSetKNART" assert inst.publisher == "Department of Veterans Affairs" assert inst.relatedArtifact[0].display == ( "Cardiology: Chest Pain (CP) / Coronary Artery Disease (CAD) " "Clinical Content White Paper" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "NEED-A-URL-HERE"} ).valueUrl ) assert inst.relatedArtifact[0].type == "derived-from" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( {"valueUrl": "NEED-A-URL-HERE"} ).valueUrl ) assert inst.relatedArtifact[1].display == ( "Outcome CVD (coronary death, myocardial infarction, coronary" " insufficiency, angina, ischemic stroke, hemorrhagic stroke," " transient ischemic attack, peripheral artery disease, heart" " failure)" ) assert ( inst.relatedArtifact[1].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://www.framinghamheartstudy.org/risk-functions/cardiovascular-disease/10-year-risk.php" } ).valueUrl ) assert inst.relatedArtifact[1].type == "justification" assert ( inst.relatedArtifact[1].url == ExternalValidatorModel.model_validate( { "valueUrl": "https://www.framinghamheartstudy.org/risk-functions/cardiovascular-disease/10-year-risk.php" } ).valueUrl ) assert inst.relatedArtifact[2].display == ( "General cardiovascular risk profile for use in primary care:" " the Framingham Heart Study" ) assert ( inst.relatedArtifact[2].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://www.framinghamheartstudy.org/risk-functions/cardiovascular-disease/10-year-risk.php" } ).valueUrl ) assert inst.relatedArtifact[2].type == "justification" assert ( inst.relatedArtifact[2].url == ExternalValidatorModel.model_validate( { "valueUrl": "https://www.framinghamheartstudy.org/risk-functions/cardiovascular-disease/10-year-risk.php" } ).valueUrl ) assert ( inst.relatedArtifact[3].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "NEED-A-URL-HERE"} ).valueUrl ) assert inst.relatedArtifact[3].type == "justification" assert ( inst.relatedArtifact[3].url == ExternalValidatorModel.model_validate( {"valueUrl": "NEED-A-URL-HERE"} ).valueUrl ) assert ( inst.relatedArtifact[4].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "NEED-A-URL-HERE"} ).valueUrl ) assert inst.relatedArtifact[4].type == "justification" assert ( inst.relatedArtifact[4].url == ExternalValidatorModel.model_validate( {"valueUrl": "NEED-A-URL-HERE"} ).valueUrl ) assert ( inst.relatedArtifact[5].display == "LABEL: ASPIRIN 81 MG- aspirin tablet, coated" ) assert ( inst.relatedArtifact[5].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=b4064039-2345-4227-b83d-54dc13a838d3" } ).valueUrl ) assert inst.relatedArtifact[5].type == "justification" assert ( inst.relatedArtifact[5].url == ExternalValidatorModel.model_validate( { "valueUrl": "https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=b4064039-2345-4227-b83d-54dc13a838d3" } ).valueUrl ) assert inst.relatedArtifact[6].display == ( "LABEL: CLOPIDOGREL- clopidogrel bisulfate tablet, film " "coated" ) assert ( inst.relatedArtifact[6].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=7fe85155-bc00-406b-b097-e8aece187a8a" } ).valueUrl ) assert inst.relatedArtifact[6].type == "justification" assert ( inst.relatedArtifact[6].url == ExternalValidatorModel.model_validate( { "valueUrl": "https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=7fe85155-bc00-406b-b097-e8aece187a8a" } ).valueUrl ) assert ( inst.relatedArtifact[7].display == "LABEL: LIPITOR- atorvastatin calcium tablet, film coated" ) assert ( inst.relatedArtifact[7].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=7fe85155-bc00-406b-b097-e8aece187a8a" } ).valueUrl ) assert inst.relatedArtifact[7].type == "justification" assert ( inst.relatedArtifact[7].url == ExternalValidatorModel.model_validate( { "valueUrl": "https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=7fe85155-bc00-406b-b097-e8aece187a8a" } ).valueUrl ) assert inst.relatedArtifact[8].display == ( "LABEL: METOPROLOL SUCCINATE EXTENDED-RELEASE - metoprolol " "succinate tablet, film coated, extended release" ) assert ( inst.relatedArtifact[8].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=2d948600-35d8-4490-983b-918bdce488c8" } ).valueUrl ) assert inst.relatedArtifact[8].type == "justification" assert ( inst.relatedArtifact[8].url == ExternalValidatorModel.model_validate( { "valueUrl": "https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=2d948600-35d8-4490-983b-918bdce488c8" } ).valueUrl ) assert ( inst.relatedArtifact[9].display == "LABEL: NITROGLYCERIN- nitroglycerin tablet" ) assert ( inst.relatedArtifact[9].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=67bf2a15-b115-47ac-ae28-ce2dafd6b5c9" } ).valueUrl ) assert inst.relatedArtifact[9].type == "justification" assert ( inst.relatedArtifact[9].url == ExternalValidatorModel.model_validate( { "valueUrl": "https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=67bf2a15-b115-47ac-ae28-ce2dafd6b5c9" } ).valueUrl ) assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == ( "Chest Pain (CP) - Coronary Artery Disease (CAD) Order Set " "KNART" ) assert inst.type.coding[0].code == "order-set" assert inst.type.coding[0].display == "Order Set" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/plan-definition-type"} ).valueUri ) assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://va.gov/kas/orderset/B5-Cardiology-ChestPainCAD-OS"} ).valueUri ) assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "look up value" assert ( inst.useContext[0].valueCodeableConcept.coding[0].display == "appropriate snomed condition" ) assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version == "0.1" def test_plandefinition_5(base_settings): """No. 5 tests collection for PlanDefinition. Test File: plandefinition-example-cardiology-os.json """ filename = ( base_settings["unittest_data_dir"] / "plandefinition-example-cardiology-os.json" ) inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes()) assert "PlanDefinition" == inst.get_resource_type() impl_plandefinition_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PlanDefinition" == data["resourceType"] inst2 = plandefinition.PlanDefinition(**data) impl_plandefinition_5(inst2) def impl_plandefinition_6(inst): assert inst.action[0].cardinalityBehavior == "single" assert inst.action[0].condition[0].expression.expression == ( "exists ([Condition: Obesity]) or not exists ([Observation: " "BMI] O where O.effectiveDateTime 2 years or less before " "Today())" ) assert inst.action[0].condition[0].expression.language == "text/cql" assert inst.action[0].condition[0].kind == "applicability" assert inst.action[0].definitionCanonical == "#procedure" assert ( inst.action[0].description == "Measure, Weight, Height, Waist, Circumference; Calculate BMI" ) assert inst.action[0].goalId[0] == "reduce-bmi-ratio" assert inst.action[0].requiredBehavior == "must-unless-documented" assert inst.action[0].title == "Measure BMI" assert inst.author[0].name == "National Heart, Lung, and Blood Institute" assert inst.author[0].telecom[0].system == "url" assert ( inst.author[0].telecom[0].value == "https://www.nhlbi.nih.gov/health-pro/guidelines" ) assert inst.contained[0].id == "procedure" assert inst.experimental is True assert inst.goal[0].addresses[0].coding[0].code == "414916001" assert inst.goal[0].addresses[0].coding[0].display == "Obesity (disorder)" assert ( inst.goal[0].addresses[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.goal[0].category.text == "Treatment" assert inst.goal[0].description.text == "Reduce BMI to below 25" assert inst.goal[0].documentation[0].display == "Evaluation and Treatment Strategy" assert ( inst.goal[0].documentation[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://www.nhlbi.nih.gov/health-pro/guidelines/current/obesity-guidelines/e_textbook/txgd/42.htm" } ).valueUrl ) assert inst.goal[0].documentation[0].type == "justification" assert ( inst.goal[0].documentation[0].url == ExternalValidatorModel.model_validate( { "valueUrl": "https://www.nhlbi.nih.gov/health-pro/guidelines/current/obesity-guidelines/e_textbook/txgd/42.htm" } ).valueUrl ) assert inst.goal[0].id == "reduce-bmi-ratio" assert inst.goal[0].priority.text == "medium-priority" assert inst.goal[0].start.text == "When the patient's BMI Ratio is at or above 25" assert inst.goal[0].target[0].detailRange.high.unit == "kg/m2" assert float(inst.goal[0].target[0].detailRange.high.value) == float(24.9) assert inst.goal[0].target[0].due.code == "a" assert ( inst.goal[0].target[0].due.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.goal[0].target[0].due.unit == "yr" assert float(inst.goal[0].target[0].due.value) == float(1) assert inst.goal[0].target[0].measure.coding[0].code == "39156-5" assert ( inst.goal[0].target[0].measure.coding[0].display == "Body mass index (BMI) [Ratio]" ) assert ( inst.goal[0].target[0].measure.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.id == "protocol-example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org"} ).valueUri ) assert inst.identifier[0].value == "example-1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.purpose == ( "Example of A medical algorithm for assessment and treatment " "of overweight and obesity" ) assert ( inst.relatedArtifact[0].display == "Overweight and Obesity Treatment Guidelines" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "http://www.nhlbi.nih.gov/health-pro/guidelines/current/obesity-guidelines/e_textbook/txgd/algorthm/algorthm.htm" } ).valueUrl ) assert inst.relatedArtifact[0].type == "derived-from" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( { "valueUrl": "http://www.nhlbi.nih.gov/health-pro/guidelines/current/obesity-guidelines/e_textbook/txgd/algorthm/algorthm.htm" } ).valueUrl ) assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Obesity Assessment Protocol" assert inst.type.coding[0].code == "clinical-protocol" assert inst.useContext[0].code.code == "focus" assert inst.useContext[0].valueCodeableConcept.coding[0].code == "414916001" assert ( inst.useContext[0].valueCodeableConcept.coding[0].display == "Obesity (disorder)" ) assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_plandefinition_6(base_settings): """No. 6 tests collection for PlanDefinition. Test File: plandefinition-protocol-example.json """ filename = ( base_settings["unittest_data_dir"] / "plandefinition-protocol-example.json" ) inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes()) assert "PlanDefinition" == inst.get_resource_type() impl_plandefinition_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PlanDefinition" == data["resourceType"] inst2 = plandefinition.PlanDefinition(**data) impl_plandefinition_6(inst2) def impl_plandefinition_7(inst): assert ( inst.action[0].action[0].action[0].definitionCanonical == "#referralToMentalHealthCare" ) assert ( inst.action[0].action[0].action[0].dynamicValue[0].expression.expression == "Now()" ) assert ( inst.action[0].action[0].action[0].dynamicValue[0].expression.language == "text/cql" ) assert inst.action[0].action[0].action[0].dynamicValue[0].path == "timing.event" assert inst.action[0].action[0].action[0].dynamicValue[1].expression.expression == ( "Code '261QM0850X' from SuicideRiskLogic.\"NUCC Provider " "Taxonomy\" display 'Adult Mental Health'" ) assert ( inst.action[0].action[0].action[0].dynamicValue[1].expression.language == "text/cql" ) assert inst.action[0].action[0].action[0].dynamicValue[1].path == "specialty" assert ( inst.action[0].action[0].action[0].dynamicValue[2].expression.expression == "SuicideRiskLogic.ServiceRequestFulfillmentTime" ) assert ( inst.action[0].action[0].action[0].dynamicValue[2].expression.language == "text/cql" ) assert ( inst.action[0].action[0].action[0].dynamicValue[2].path == "occurrenceDateTime" ) assert ( inst.action[0].action[0].action[0].dynamicValue[3].expression.expression == "SuicideRiskLogic.Patient" ) assert ( inst.action[0].action[0].action[0].dynamicValue[3].expression.language == "text/cql" ) assert inst.action[0].action[0].action[0].dynamicValue[3].path == "subject" assert ( inst.action[0].action[0].action[0].dynamicValue[4].expression.expression == "SuicideRiskLogic.Practitioner" ) assert ( inst.action[0].action[0].action[0].dynamicValue[4].expression.language == "text/cql" ) assert inst.action[0].action[0].action[0].dynamicValue[4].path == "requester.agent" assert ( inst.action[0].action[0].action[0].dynamicValue[5].expression.expression == "SuicideRiskLogic.RiskAssessmentScore" ) assert ( inst.action[0].action[0].action[0].dynamicValue[5].expression.language == "text/cql" ) assert inst.action[0].action[0].action[0].dynamicValue[5].path == "reasonCode" assert ( inst.action[0].action[0].action[0].dynamicValue[6].expression.expression == "SuicideRiskLogic.RiskAssessment" ) assert ( inst.action[0].action[0].action[0].dynamicValue[6].expression.language == "text/cql" ) assert inst.action[0].action[0].action[0].dynamicValue[6].path == "reasonReference" assert inst.action[0].action[0].action[0].textEquivalent == ( "Refer to outpatient mental health program for evaluation and" " treatment of mental health conditions now" ) assert inst.action[0].action[0].groupingBehavior == "logical-group" assert inst.action[0].action[0].selectionBehavior == "any" assert inst.action[0].action[0].title == "Consults and Referrals" assert ( inst.action[0].action[1].action[0].action[0].action[0].definitionCanonical == "#citalopramPrescription" ) assert ( inst.action[0] .action[1] .action[0] .action[0] .action[0] .dynamicValue[0] .expression.expression == "'draft'" ) assert ( inst.action[0] .action[1] .action[0] .action[0] .action[0] .dynamicValue[0] .expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[0].path == "status" ) assert ( inst.action[0] .action[1] .action[0] .action[0] .action[0] .dynamicValue[1] .expression.expression == "SuicideRiskLogic.Patient" ) assert ( inst.action[0] .action[1] .action[0] .action[0] .action[0] .dynamicValue[1] .expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[1].path == "patient" ) assert ( inst.action[0] .action[1] .action[0] .action[0] .action[0] .dynamicValue[2] .expression.expression == "SuicideRiskLogic.Practitioner" ) assert ( inst.action[0] .action[1] .action[0] .action[0] .action[0] .dynamicValue[2] .expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[2].path == "prescriber" ) assert ( inst.action[0] .action[1] .action[0] .action[0] .action[0] .dynamicValue[3] .expression.expression == "SuicideRiskLogic.RiskAssessmentScore" ) assert ( inst.action[0] .action[1] .action[0] .action[0] .action[0] .dynamicValue[3] .expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[3].path == "reasonCode" ) assert ( inst.action[0] .action[1] .action[0] .action[0] .action[0] .dynamicValue[4] .expression.expression == "SuicideRiskLogic.RiskAssessment" ) assert ( inst.action[0] .action[1] .action[0] .action[0] .action[0] .dynamicValue[4] .expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[4].path == "reasonReference" ) assert inst.action[0].action[1].action[0].action[0].action[0].textEquivalent == ( "citalopram 20 mg tablet 1 tablet oral 1 time daily now (30 " "table; 3 refills)" ) assert inst.action[0].action[1].action[0].action[0].action[1].textEquivalent == ( "escitalopram 10 mg tablet 1 tablet oral 1 time daily now (30" " tablet; 3 refills)" ) assert inst.action[0].action[1].action[0].action[0].action[2].textEquivalent == ( "fluoxetine 20 mg capsule 1 capsule oral 1 time daily now (30" " tablet; 3 refills)" ) assert inst.action[0].action[1].action[0].action[0].action[3].textEquivalent == ( "paroxetine 20 mg tablet 1 tablet oral 1 time daily now (30 " "tablet; 3 refills)" ) assert inst.action[0].action[1].action[0].action[0].action[4].textEquivalent == ( "sertraline 50 mg tablet 1 tablet oral 1 time daily now (30 " "tablet; 3 refills)" ) assert ( inst.action[0] .action[1] .action[0] .action[0] .documentation[0] .document.contentType == "text/html" ) assert inst.action[0].action[1].action[0].action[0].documentation[ 0 ].document.title == ( "National Library of Medicine. DailyMed website. CITALOPRAM- " "citalopram hydrobromide tablet, film coated." ) assert ( inst.action[0].action[1].action[0].action[0].documentation[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "http://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=6daeb45c-451d-b135-bf8f-2d6dff4b6b01" } ).valueUrl ) assert ( inst.action[0].action[1].action[0].action[0].documentation[0].type == "citation" ) assert ( inst.action[0].action[1].action[0].action[0].documentation[0].url == ExternalValidatorModel.model_validate( { "valueUrl": "http://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=6daeb45c-451d-b135-bf8f-2d6dff4b6b01" } ).valueUrl ) assert ( inst.action[0].action[1].action[0].action[0].groupingBehavior == "logical-group" ) assert ( inst.action[0].action[1].action[0].action[0].selectionBehavior == "at-most-one" ) assert inst.action[0].action[1].action[0].action[0].title == ( "Selective Serotonin Reuptake Inhibitors (Choose a mazimum of" " one or document reasons for exception)" ) assert inst.action[0].action[1].action[0].action[1].textEquivalent == ( "Dopamine Norepinephrine Reuptake Inhibitors (Choose a " "maximum of one or document reasons for exception)" ) assert inst.action[0].action[1].action[0].action[2].textEquivalent == ( "Serotonin Norepinephrine Reuptake Inhibitors (Choose a " "maximum of one or doument reasons for exception)" ) assert inst.action[0].action[1].action[0].action[3].textEquivalent == ( "Norepinephrine-Serotonin Modulators (Choose a maximum of one" " or document reasons for exception)" ) assert ( inst.action[0].action[1].action[0].documentation[0].document.contentType == "text/html" ) assert ( inst.action[0].action[1].action[0].documentation[0].document.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/cqf-qualityOfEvidence" } ).valueUri ) assert ( inst.action[0] .action[1] .action[0] .documentation[0] .document.extension[0] .valueCodeableConcept.coding[0] .code == "high" ) assert ( inst.action[0] .action[1] .action[0] .documentation[0] .document.extension[0] .valueCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/evidence-quality"} ).valueUri ) assert ( inst.action[0] .action[1] .action[0] .documentation[0] .document.extension[0] .valueCodeableConcept.text == "High Quality" ) assert inst.action[0].action[1].action[0].documentation[0].document.title == ( "Practice Guideline for the Treatment of Patients with Major " "Depressive Disorder" ) assert ( inst.action[0].action[1].action[0].documentation[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf" } ).valueUrl ) assert inst.action[0].action[1].action[0].documentation[0].type == "citation" assert ( inst.action[0].action[1].action[0].documentation[0].url == ExternalValidatorModel.model_validate( { "valueUrl": "http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf" } ).valueUrl ) assert inst.action[0].action[1].action[0].groupingBehavior == "logical-group" assert inst.action[0].action[1].action[0].selectionBehavior == "at-most-one" assert inst.action[0].action[1].action[0].title == "First-Line Antidepressants" assert inst.action[0].action[1].groupingBehavior == "logical-group" assert inst.action[0].action[1].selectionBehavior == "at-most-one" assert inst.action[0].action[1].title == "Medications" assert inst.action[0].title == "Suicide Risk Assessment and Outpatient Management" assert ( inst.approvalDate == ExternalValidatorModel.model_validate({"valueDate": "2016-03-12"}).valueDate ) assert inst.author[0].name == "Motive Medical Intelligence" assert inst.author[0].telecom[0].system == "phone" assert inst.author[0].telecom[0].use == "work" assert inst.author[0].telecom[0].value == "415-362-4007" assert inst.author[0].telecom[1].system == "email" assert inst.author[0].telecom[1].use == "work" assert inst.author[0].telecom[1].value == "info@motivemi.com" assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "415-362-4007" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].use == "work" assert inst.contact[0].telecom[1].value == "info@motivemi.com" assert inst.contained[0].id == "referralToMentalHealthCare" assert inst.contained[1].id == "citalopramPrescription" assert inst.contained[2].id == "citalopramMedication" assert inst.contained[3].id == "citalopramSubstance" assert inst.copyright == ( "© Copyright 2016 Motive Medical Intelligence. All rights " "reserved." ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-15"} ).valueDateTime ) assert inst.description == ( "Orders to be applied to a patient characterized as low " "suicide risk." ) assert ( inst.effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-12-31"} ).valueDateTime ) assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-01"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "low-suicide-risk-order-set" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://motivemi.com/artifacts"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "mmi:low-suicide-risk-order-set" assert inst.jurisdiction[0].coding[0].code == "US" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert ( inst.lastReviewDate == ExternalValidatorModel.model_validate({"valueDate": "2016-08-15"}).valueDate ) assert ( inst.library[0] == "http://example.org/fhir/Library/suiciderisk-orderset-logic" ) assert inst.name == "LowSuicideRiskOrderSet" assert inst.publisher == "Motive Medical Intelligence" assert inst.purpose == ( "This order set helps ensure consistent application of " "appropriate orders for the care of low suicide risk " "patients." ) assert inst.relatedArtifact[0].display == ( "Practice Guideline for the Treatment of Patients with Major " "Depressive Disorder" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf" } ).valueUrl ) assert inst.relatedArtifact[0].type == "derived-from" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( { "valueUrl": "http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf" } ).valueUrl ) assert inst.relatedArtifact[1].resource == ( "http://example.org/fhir/ActivityDefinition/referralPrimaryCa" "reMentalHealth" ) assert inst.relatedArtifact[1].type == "composed-of" assert inst.relatedArtifact[2].resource == ( "http://example.org/fhir/ActivityDefinition/citalopramPrescri" "ption" ) assert inst.relatedArtifact[2].type == "composed-of" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Low Suicide Risk Order Set" assert inst.topic[0].text == "Suicide risk assessment" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://motivemi.com/artifacts/PlanDefinition/low-suicide-risk-order-set" } ).valueUri ) assert inst.usage == ( "This order set should be applied after assessing a patient " "for suicide risk, when the findings of that assessment " "indicate the patient has low suicide risk." ) assert inst.useContext[0].code.code == "age" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "D000328" assert inst.useContext[0].valueCodeableConcept.coding[0].display == "Adult" assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://meshb.nlm.nih.gov"} ).valueUri ) assert inst.useContext[1].code.code == "focus" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueCodeableConcept.coding[0].code == "87512008" assert ( inst.useContext[1].valueCodeableConcept.coding[0].display == "Mild major depression" ) assert ( inst.useContext[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[2].code.code == "focus" assert ( inst.useContext[2].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[2].valueCodeableConcept.coding[0].code == "40379007" assert ( inst.useContext[2].valueCodeableConcept.coding[0].display == "Major depression, recurrent, mild" ) assert ( inst.useContext[2].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[3].code.code == "focus" assert ( inst.useContext[3].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[3].valueCodeableConcept.coding[0].code == "394687007" assert ( inst.useContext[3].valueCodeableConcept.coding[0].display == "Low suicide risk" ) assert ( inst.useContext[3].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[4].code.code == "focus" assert ( inst.useContext[4].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[4].valueCodeableConcept.coding[0].code == "225337009" assert ( inst.useContext[4].valueCodeableConcept.coding[0].display == "Suicide risk assessment" ) assert ( inst.useContext[4].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[5].code.code == "user" assert ( inst.useContext[5].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[5].valueCodeableConcept.coding[0].code == "309343006" assert inst.useContext[5].valueCodeableConcept.coding[0].display == "Physician" assert ( inst.useContext[5].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[6].code.code == "venue" assert ( inst.useContext[6].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[6].valueCodeableConcept.coding[0].code == "440655000" assert ( inst.useContext[6].valueCodeableConcept.coding[0].display == "Outpatient environment" ) assert ( inst.useContext[6].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version == "1.0.0" def test_plandefinition_7(base_settings): """No. 7 tests collection for PlanDefinition. Test File: plandefinition-example.json """ filename = base_settings["unittest_data_dir"] / "plandefinition-example.json" inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes()) assert "PlanDefinition" == inst.get_resource_type() impl_plandefinition_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PlanDefinition" == data["resourceType"] inst2 = plandefinition.PlanDefinition(**data) impl_plandefinition_7(inst2) def impl_plandefinition_8(inst): assert inst.action[0].action[0].description == "Will offer Naloxone instead" assert inst.action[0].action[1].description == ( "Risk of overdose carefully considered and outweighed by " "benefit; snooze 3 mo" ) assert inst.action[0].action[2].description == "N/A - see comment; snooze 3 mo" assert inst.action[0].condition[0].expression.expression == "Inclusion Criteria" assert inst.action[0].condition[0].expression.language == "text/cql" assert inst.action[0].condition[0].kind == "applicability" assert inst.action[0].description == ( "Checking if the trigger prescription meets the inclusion " "criteria for recommendation #8 workflow." ) assert ( inst.action[0].documentation[0].document.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/cqf-strengthOfRecommendation" } ).valueUri ) assert ( inst.action[0] .documentation[0] .document.extension[0] .valueCodeableConcept.coding[0] .code == "strong" ) assert ( inst.action[0] .documentation[0] .document.extension[0] .valueCodeableConcept.coding[0] .display == "Strong" ) assert ( inst.action[0] .documentation[0] .document.extension[0] .valueCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/recommendation-strength" } ).valueUri ) assert ( inst.action[0].documentation[0].document.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/cqf-qualityOfEvidence" } ).valueUri ) assert ( inst.action[0] .documentation[0] .document.extension[1] .valueCodeableConcept.coding[0] .code == "low" ) assert ( inst.action[0] .documentation[0] .document.extension[1] .valueCodeableConcept.coding[0] .display == "Low quality" ) assert ( inst.action[0] .documentation[0] .document.extension[1] .valueCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/evidence-quality"} ).valueUri ) assert inst.action[0].documentation[0].type == "documentation" assert inst.action[0].dynamicValue[0].expression.expression == "Get Detail" assert inst.action[0].dynamicValue[0].expression.language == "text/cql" assert inst.action[0].dynamicValue[0].path == "action.description" assert inst.action[0].dynamicValue[1].expression.expression == "Get Summary" assert inst.action[0].dynamicValue[1].expression.language == "text/cql" assert inst.action[0].dynamicValue[1].path == "action.title" assert inst.action[0].dynamicValue[2].expression.expression == "Get Indicator" assert inst.action[0].dynamicValue[2].expression.language == "text/cql" assert inst.action[0].dynamicValue[2].path == "action.extension" assert inst.action[0].groupingBehavior == "visual-group" assert inst.action[0].selectionBehavior == "exactly-one" assert inst.action[0].title == ( "Existing patient exhibits risk factors for opioid-related " "harms." ) assert inst.action[0].trigger[0].name == "medication-prescribe" assert inst.action[0].trigger[0].type == "named-event" assert inst.author[0].name == "Kensaku Kawamoto, MD, PhD, MHS" assert inst.author[1].name == "Bryn Rhodes" assert inst.author[2].name == "Floyd Eisenberg, MD, MPH" assert inst.author[3].name == "Robert McClure, MD, MPH" assert inst.copyright == "© CDC 2016+." assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-03-19"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "opioidcds-08" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "cdc-opioid-guidance" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert ( inst.library[0] == "http://example.org/fhir/Library/opioidcds-recommendation-08" ) assert inst.name == "cdc-opioid-08" assert inst.publisher == "Centers for Disease Control and Prevention (CDC)" assert ( inst.relatedArtifact[0].display == "CDC guideline for prescribing opioids for chronic pain" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420" } ).valueUrl ) assert inst.relatedArtifact[0].type == "documentation" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( { "valueUrl": "https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420" } ).valueUrl ) assert inst.relatedArtifact[1].display == "MME Conversion Tables" assert ( inst.relatedArtifact[1].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf" } ).valueUrl ) assert inst.relatedArtifact[1].type == "documentation" assert ( inst.relatedArtifact[1].url == ExternalValidatorModel.model_validate( { "valueUrl": "https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf" } ).valueUrl ) assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "CDC Opioid Prescribing Guideline Recommendation #8" assert inst.topic[0].text == "Opioid Prescribing" assert inst.type.coding[0].code == "eca-rule" assert inst.type.coding[0].display == "ECA Rule" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/plan-definition-type"} ).valueUri ) assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/ig/opioid-cds/PlanDefinition/opioidcds-08" } ).valueUri ) assert inst.usage == ( "Before starting and periodically during continuation of " "opioid therapy, clinicians should evaluate risk factors for " "opioid-related harms." ) assert inst.useContext[0].code.code == "focus" assert inst.useContext[0].code.display == "Clinical Focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "182888003" assert ( inst.useContext[0].valueCodeableConcept.coding[0].display == "Medication requested (situation)" ) assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[1].code.code == "focus" assert inst.useContext[1].code.display == "Clinical Focus" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueCodeableConcept.coding[0].code == "82423001" assert ( inst.useContext[1].valueCodeableConcept.coding[0].display == "Chronic pain (finding)" ) assert ( inst.useContext[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version == "0.1.0" def test_plandefinition_8(base_settings): """No. 8 tests collection for PlanDefinition. Test File: plandefinition-opioidcds-08.json """ filename = base_settings["unittest_data_dir"] / "plandefinition-opioidcds-08.json" inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes()) assert "PlanDefinition" == inst.get_resource_type() impl_plandefinition_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PlanDefinition" == data["resourceType"] inst2 = plandefinition.PlanDefinition(**data) impl_plandefinition_8(inst2) def impl_plandefinition_9(inst): assert ( inst.action[0].action[0].dynamicValue[0].expression.expression == "Create Lactation Consult Request" ) assert inst.action[0].action[0].dynamicValue[0].expression.language == "text/cql" assert inst.action[0].action[0].dynamicValue[0].path == "/" assert ( inst.action[0].action[0].textEquivalent == "Create a lactation consult request" ) assert inst.action[0].action[0].title == "Create a lactation consult request." assert inst.action[0].action[0].type.coding[0].code == "create" assert ( inst.action[0].condition[0].expression.expression == "Should Create Lactation Consult" ) assert inst.action[0].condition[0].expression.language == "text/cql" assert inst.action[0].condition[0].kind == "applicability" assert inst.action[0].title == ( "Mother should be referred to a lactation specialist for " "consultation." ) assert inst.action[0].trigger[0].name == "Admission" assert inst.action[0].trigger[0].type == "named-event" assert inst.action[0].trigger[1].name == "Birth" assert inst.action[0].trigger[1].type == "named-event" assert inst.action[0].trigger[2].name == "Infant Transfer to Recovery" assert inst.action[0].trigger[2].type == "named-event" assert inst.action[0].trigger[3].name == "Transfer to Post-Partum" assert inst.action[0].trigger[3].type == "named-event" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-03-08"} ).valueDateTime ) assert inst.description == ( "Exclusive breastfeeding intervention intended to improve " "outcomes for exclusive breastmilk feeding of newborns by " "creating a lactation consult for the mother if appropriate." ) assert inst.experimental is True assert inst.id == "exclusive-breastfeeding-intervention-04" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "exclusive-breastfeeding-intervention-04" assert inst.library[0] == ( "http://example.org/fhir/Library/library-exclusive-" "breastfeeding-cds-logic" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.relatedArtifact[0].resource == ( "http://example.org/fhir/Measure/measure-exclusive-" "breastfeeding" ) assert inst.relatedArtifact[0].type == "derived-from" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Exclusive Breastfeeding Intervention-04" assert inst.topic[0].text == "Exclusive Breastfeeding" assert inst.version == "1.0.0" def test_plandefinition_9(base_settings): """No. 9 tests collection for PlanDefinition. Test File: plandefinition-exclusive-breastfeeding-intervention-04.json """ filename = ( base_settings["unittest_data_dir"] / "plandefinition-exclusive-breastfeeding-intervention-04.json" ) inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes()) assert "PlanDefinition" == inst.get_resource_type() impl_plandefinition_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PlanDefinition" == data["resourceType"] inst2 = plandefinition.PlanDefinition(**data) impl_plandefinition_9(inst2) def impl_plandefinition_10(inst): assert inst.action[0].action[0].description == "Will precribe immediate release" assert inst.action[0].action[1].description == ( "Risk of overdose carefully considered and outweighed by " "benefit; snooze 3 mo" ) assert inst.action[0].action[2].description == "N/A - see comment; snooze 3 mo" assert inst.action[0].condition[0].expression.description == ( "Check whether the opioid prescription for the existing " "patient is extended-release without any opioids-with-abuse-" "potential prescribed in the past 90 days." ) assert inst.action[0].condition[0].expression.expression == "Inclusion Criteria" assert inst.action[0].condition[0].expression.language == "text/cql" assert inst.action[0].condition[0].kind == "applicability" assert inst.action[0].description == ( "Checking if the trigger prescription meets the inclusion " "criteria for recommendation #4 workflow." ) assert ( inst.action[0].documentation[0].document.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/cqf-strengthOfRecommendation" } ).valueUri ) assert ( inst.action[0] .documentation[0] .document.extension[0] .valueCodeableConcept.coding[0] .code == "strong" ) assert ( inst.action[0] .documentation[0] .document.extension[0] .valueCodeableConcept.coding[0] .display == "Strong" ) assert ( inst.action[0] .documentation[0] .document.extension[0] .valueCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/recommendation-strength" } ).valueUri ) assert ( inst.action[0].documentation[0].document.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/cqf-qualityOfEvidence" } ).valueUri ) assert ( inst.action[0] .documentation[0] .document.extension[1] .valueCodeableConcept.coding[0] .code == "low" ) assert ( inst.action[0] .documentation[0] .document.extension[1] .valueCodeableConcept.coding[0] .display == "Low quality" ) assert ( inst.action[0] .documentation[0] .document.extension[1] .valueCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/evidence-quality"} ).valueUri ) assert inst.action[0].documentation[0].type == "documentation" assert inst.action[0].dynamicValue[0].expression.expression == "Get Summary" assert inst.action[0].dynamicValue[0].expression.language == "text/cql" assert inst.action[0].dynamicValue[0].path == "action.title" assert inst.action[0].dynamicValue[1].expression.expression == "Get Detail" assert inst.action[0].dynamicValue[1].expression.language == "text/cql" assert inst.action[0].dynamicValue[1].path == "action.description" assert inst.action[0].dynamicValue[2].expression.expression == "Get Indicator" assert inst.action[0].dynamicValue[2].expression.language == "text/cql" assert inst.action[0].dynamicValue[2].path == "activity.extension" assert inst.action[0].groupingBehavior == "visual-group" assert inst.action[0].selectionBehavior == "exactly-one" assert inst.action[0].title == "Extended-release opioid prescription triggered." assert inst.action[0].trigger[0].name == "medication-prescribe" assert inst.action[0].trigger[0].type == "named-event" assert inst.author[0].name == "Kensaku Kawamoto, MD, PhD, MHS" assert inst.author[1].name == "Bryn Rhodes" assert inst.author[2].name == "Floyd Eisenberg, MD, MPH" assert inst.author[3].name == "Robert McClure, MD, MPH" assert inst.copyright == "© CDC 2016+." assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-03-19"} ).valueDateTime ) assert inst.description == ( "When starting opioid therapy for chronic pain, clinicians " "should prescribe immediate-release opioids instead of " "extended-release/long-acting (ER/LA) opioids." ) assert inst.experimental is True assert inst.id == "opioidcds-04" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "cdc-opioid-guidance" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert ( inst.library[0] == "http://example.org/fhir/Library/opioidcds-recommendation-04" ) assert inst.name == "cdc-opioid-04" assert inst.publisher == "Centers for Disease Control and Prevention (CDC)" assert ( inst.relatedArtifact[0].display == "CDC guideline for prescribing opioids for chronic pain" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420" } ).valueUrl ) assert inst.relatedArtifact[0].type == "documentation" assert ( inst.relatedArtifact[0].url == ExternalValidatorModel.model_validate( { "valueUrl": "https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420" } ).valueUrl ) assert inst.relatedArtifact[1].display == "MME Conversion Tables" assert ( inst.relatedArtifact[1].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf" } ).valueUrl ) assert inst.relatedArtifact[1].type == "documentation" assert ( inst.relatedArtifact[1].url == ExternalValidatorModel.model_validate( { "valueUrl": "https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf" } ).valueUrl ) assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "CDC Opioid Prescribing Guideline Recommendation #4" assert inst.topic[0].text == "Opioid Prescribing" assert inst.type.coding[0].code == "eca-rule" assert inst.type.coding[0].display == "ECA Rule" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/plan-definition-type"} ).valueUri ) assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/ig/opioid-cds/PlanDefinition/opioidcds-04" } ).valueUri ) assert inst.usage == ( "Providers should use caution when prescribing extended-" "release/long-acting (ER/LA) opioids as they carry a higher " "risk and negligible benefit compared to immediate-release " "opioids." ) assert inst.useContext[0].code.code == "focus" assert inst.useContext[0].code.display == "Clinical Focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "182888003" assert ( inst.useContext[0].valueCodeableConcept.coding[0].display == "Medication requested (situation)" ) assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[1].code.code == "focus" assert inst.useContext[1].code.display == "Clinical Focus" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueCodeableConcept.coding[0].code == "82423001" assert ( inst.useContext[1].valueCodeableConcept.coding[0].display == "Chronic pain (finding)" ) assert ( inst.useContext[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version == "0.1.0" def test_plandefinition_10(base_settings): """No. 10 tests collection for PlanDefinition. Test File: plandefinition-opioidcds-04.json """ filename = base_settings["unittest_data_dir"] / "plandefinition-opioidcds-04.json" inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes()) assert "PlanDefinition" == inst.get_resource_type() impl_plandefinition_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PlanDefinition" == data["resourceType"] inst2 = plandefinition.PlanDefinition(**data) impl_plandefinition_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_practitioner.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Practitioner Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import practitioner from .conftest import ExternalValidatorModel # noqa: F401 def impl_practitioner_1(inst): assert inst.active is True assert inst.address[0].city == "Den helder" assert inst.address[0].country == "NLD" assert inst.address[0].line[0] == "Walvisbaai 3" assert inst.address[0].postalCode == "2333ZA" assert inst.address[0].use == "work" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1983-04-20"}).valueDate ) assert inst.gender == "male" assert inst.id == "f203" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.528.1.1007.3.1"} ).valueUri ) assert inst.identifier[0].type.text == "UZI-nummer" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345678903" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.bigregister.nl/"} ).valueUri ) assert inst.identifier[1].type.text == "BIG-nummer" assert inst.identifier[1].use == "official" assert inst.identifier[1].value == "12345678903" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].text == "Juri van Gelder" assert inst.name[0].use == "official" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "+31715269111" assert inst.text.status == "generated" def test_practitioner_1(base_settings): """No. 1 tests collection for Practitioner. Test File: practitioner-example-f203-jvg.json """ filename = base_settings["unittest_data_dir"] / "practitioner-example-f203-jvg.json" inst = practitioner.Practitioner.model_validate_json(filename.read_bytes()) assert "Practitioner" == inst.get_resource_type() impl_practitioner_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Practitioner" == data["resourceType"] inst2 = practitioner.Practitioner(**data) impl_practitioner_1(inst2) def impl_practitioner_2(inst): assert inst.active is True assert inst.address[0].city == "Den helder" assert inst.address[0].country == "NLD" assert inst.address[0].line[0] == "Walvisbaai 3" assert inst.address[0].line[1] == "C4 - Automatisering" assert inst.address[0].postalCode == "2333ZA" assert inst.address[0].use == "work" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1956-12-24"}).valueDate ) assert inst.gender == "male" assert inst.id == "f201" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.528.1.1007.3.1"} ).valueUri ) assert inst.identifier[0].type.text == "UZI-nummer" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345678901" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Bronsig" assert inst.name[0].given[0] == "Arend" assert inst.name[0].prefix[0] == "Dr." assert inst.name[0].text == "Dokter Bronsig" assert inst.name[0].use == "official" assert inst.qualification[0].code.coding[0].code == "41672002" assert inst.qualification[0].code.coding[0].display == "Pulmonologist" assert ( inst.qualification[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "+31715269111" assert inst.text.status == "generated" def test_practitioner_2(base_settings): """No. 2 tests collection for Practitioner. Test File: practitioner-example-f201-ab.json """ filename = base_settings["unittest_data_dir"] / "practitioner-example-f201-ab.json" inst = practitioner.Practitioner.model_validate_json(filename.read_bytes()) assert "Practitioner" == inst.get_resource_type() impl_practitioner_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Practitioner" == data["resourceType"] inst2 = practitioner.Practitioner(**data) impl_practitioner_2(inst2) def impl_practitioner_3(inst): assert inst.active is True assert inst.address[0].city == "Den helder" assert inst.address[0].country == "NLD" assert inst.address[0].line[0] == "Walvisbaai 3" assert inst.address[0].line[1] == "C4 - Automatisering" assert inst.address[0].postalCode == "2333ZA" assert inst.address[0].use == "work" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1960-06-12"}).valueDate ) assert inst.gender == "male" assert inst.id == "f202" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.528.1.1007.3.1"} ).valueUri ) assert inst.identifier[0].type.text == "UZI-nummer" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345678902" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.bigregister.nl/"} ).valueUri ) assert inst.identifier[1].type.text == "BIG-nummer" assert inst.identifier[1].use == "official" assert inst.identifier[1].value == "12345678902" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Maas" assert inst.name[0].given[0] == "Luigi" assert inst.name[0].prefix[0] == "Dr." assert inst.name[0].text == "Luigi Maas" assert inst.name[0].use == "official" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "+31715269111" assert inst.text.status == "generated" def test_practitioner_3(base_settings): """No. 3 tests collection for Practitioner. Test File: practitioner-example-f202-lm.json """ filename = base_settings["unittest_data_dir"] / "practitioner-example-f202-lm.json" inst = practitioner.Practitioner.model_validate_json(filename.read_bytes()) assert "Practitioner" == inst.get_resource_type() impl_practitioner_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Practitioner" == data["resourceType"] inst2 = practitioner.Practitioner(**data) impl_practitioner_3(inst2) def impl_practitioner_4(inst): assert inst.id == "xcda-author" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Hippocrates" assert inst.name[0].given[0] == "Harold" assert inst.name[0].suffix[0] == "MD" assert inst.text.status == "generated" def test_practitioner_4(base_settings): """No. 4 tests collection for Practitioner. Test File: practitioner-example-xcda-author.json """ filename = ( base_settings["unittest_data_dir"] / "practitioner-example-xcda-author.json" ) inst = practitioner.Practitioner.model_validate_json(filename.read_bytes()) assert "Practitioner" == inst.get_resource_type() impl_practitioner_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Practitioner" == data["resourceType"] inst2 = practitioner.Practitioner(**data) impl_practitioner_4(inst2) def impl_practitioner_5(inst): assert inst.address[0].city == "Amsterdam" assert inst.address[0].country == "NLD" assert inst.address[0].line[0] == "Galapagosweg 91" assert inst.address[0].postalCode == "1105 AZ" assert inst.address[0].use == "work" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1963-07-01"}).valueDate ) assert inst.communication[0].coding[0].code == "nl" assert inst.communication[0].coding[0].display == "Dutch" assert ( inst.communication[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:47"} ).valueUri ) assert inst.gender == "male" assert inst.id == "f003" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.528.1.1007.3.1"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "846100293" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.2.4.6.3"} ).valueUri ) assert inst.identifier[1].use == "usual" assert inst.identifier[1].value == "243HID3RT938" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Versteegh" assert inst.name[0].given[0] == "Marc" assert inst.name[0].suffix[0] == "MD" assert inst.name[0].use == "official" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "0205562431" assert inst.telecom[1].system == "email" assert inst.telecom[1].use == "work" assert inst.telecom[1].value == "m.versteegh@bmc.nl" assert inst.telecom[2].system == "fax" assert inst.telecom[2].use == "work" assert inst.telecom[2].value == "0205662948" assert inst.text.status == "generated" def test_practitioner_5(base_settings): """No. 5 tests collection for Practitioner. Test File: practitioner-example-f003-mv.json """ filename = base_settings["unittest_data_dir"] / "practitioner-example-f003-mv.json" inst = practitioner.Practitioner.model_validate_json(filename.read_bytes()) assert "Practitioner" == inst.get_resource_type() impl_practitioner_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Practitioner" == data["resourceType"] inst2 = practitioner.Practitioner(**data) impl_practitioner_5(inst2) def impl_practitioner_6(inst): assert inst.address[0].city == "Den Burg" assert inst.address[0].country == "NLD" assert inst.address[0].line[0] == "Galapagosweg 91" assert inst.address[0].postalCode == "9105 PZ" assert inst.address[0].use == "work" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1979-04-29"}).valueDate ) assert inst.gender == "male" assert inst.id == "f002" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.528.1.1007.3.1"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "730291637" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.2.4.6.3"} ).valueUri ) assert inst.identifier[1].use == "usual" assert inst.identifier[1].value == "174BIP3JH438" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Voigt" assert inst.name[0].given[0] == "Pieter" assert inst.name[0].suffix[0] == "MD" assert inst.name[0].use == "official" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "0205569336" assert inst.telecom[1].system == "email" assert inst.telecom[1].use == "work" assert inst.telecom[1].value == "p.voigt@bmc.nl" assert inst.telecom[2].system == "fax" assert inst.telecom[2].use == "work" assert inst.telecom[2].value == "0205669382" assert inst.text.status == "generated" def test_practitioner_6(base_settings): """No. 6 tests collection for Practitioner. Test File: practitioner-example-f002-pv.json """ filename = base_settings["unittest_data_dir"] / "practitioner-example-f002-pv.json" inst = practitioner.Practitioner.model_validate_json(filename.read_bytes()) assert "Practitioner" == inst.get_resource_type() impl_practitioner_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Practitioner" == data["resourceType"] inst2 = practitioner.Practitioner(**data) impl_practitioner_6(inst2) def impl_practitioner_7(inst): assert inst.active is True assert inst.address[0].city == "PleasantVille" assert inst.address[0].line[0] == "534 Erewhon St" assert inst.address[0].postalCode == "3999" assert inst.address[0].state == "Vic" assert inst.address[0].use == "home" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.acme.org/practitioners"} ).valueUri ) assert inst.identifier[0].value == "23" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Careful" assert inst.name[0].given[0] == "Adam" assert inst.name[0].prefix[0] == "Dr" assert inst.qualification[0].code.coding[0].code == "BS" assert inst.qualification[0].code.coding[0].display == "Bachelor of Science" assert ( inst.qualification[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0360/2.7"} ).valueUri ) assert inst.qualification[0].code.text == "Bachelor of Science" assert ( inst.qualification[0].identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/UniversityIdentifier"} ).valueUri ) assert inst.qualification[0].identifier[0].value == "12345" assert inst.qualification[0].issuer.display == "Example University" assert ( inst.qualification[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "1995"} ).valueDateTime ) assert inst.text.status == "generated" def test_practitioner_7(base_settings): """No. 7 tests collection for Practitioner. Test File: practitioner-example.json """ filename = base_settings["unittest_data_dir"] / "practitioner-example.json" inst = practitioner.Practitioner.model_validate_json(filename.read_bytes()) assert "Practitioner" == inst.get_resource_type() impl_practitioner_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Practitioner" == data["resourceType"] inst2 = practitioner.Practitioner(**data) impl_practitioner_7(inst2) def impl_practitioner_8(inst): assert inst.address[0].city == "Den Burg" assert inst.address[0].country == "NLD" assert inst.address[0].line[0] == "Galapagosweg 91" assert inst.address[0].postalCode == "9105 PZ" assert inst.address[0].use == "work" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1971-11-07"}).valueDate ) assert inst.gender == "female" assert inst.id == "f007" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.528.1.1007.3.1"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "874635264" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.2.4.6.3"} ).valueUri ) assert inst.identifier[1].use == "usual" assert inst.identifier[1].value == "567IUI51C154" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Heps" assert inst.name[0].given[0] == "Simone" assert inst.name[0].suffix[0] == "MD" assert inst.name[0].use == "official" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "020556936" assert inst.telecom[1].system == "email" assert inst.telecom[1].use == "work" assert inst.telecom[1].value == "S.M.Heps@bmc.nl" assert inst.telecom[2].system == "fax" assert inst.telecom[2].use == "work" assert inst.telecom[2].value == "0205669283" assert inst.text.status == "generated" def test_practitioner_8(base_settings): """No. 8 tests collection for Practitioner. Test File: practitioner-example-f007-sh.json """ filename = base_settings["unittest_data_dir"] / "practitioner-example-f007-sh.json" inst = practitioner.Practitioner.model_validate_json(filename.read_bytes()) assert "Practitioner" == inst.get_resource_type() impl_practitioner_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Practitioner" == data["resourceType"] inst2 = practitioner.Practitioner(**data) impl_practitioner_8(inst2) def impl_practitioner_9(inst): assert inst.address[0].city == "Den helder" assert inst.address[0].country == "NLD" assert inst.address[0].line[0] == "Walvisbaai 3" assert inst.address[0].postalCode == "2333ZA" assert inst.address[0].use == "work" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1967-11-05"}).valueDate ) assert inst.gender == "female" assert inst.id == "f204" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.528.1.1007.3.1"} ).valueUri ) assert inst.identifier[0].type.text == "UZI-nummer" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345678904" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].text == "Carla Espinosa" assert inst.name[0].use == "usual" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "+31715262169" assert inst.text.status == "generated" def test_practitioner_9(base_settings): """No. 9 tests collection for Practitioner. Test File: practitioner-example-f204-ce.json """ filename = base_settings["unittest_data_dir"] / "practitioner-example-f204-ce.json" inst = practitioner.Practitioner.model_validate_json(filename.read_bytes()) assert "Practitioner" == inst.get_resource_type() impl_practitioner_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Practitioner" == data["resourceType"] inst2 = practitioner.Practitioner(**data) impl_practitioner_9(inst2) def impl_practitioner_10(inst): assert inst.id == "xcda1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://healthcare.example.org/identifiers/staff"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "D234123" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Dopplemeyer" assert inst.name[0].given[0] == "Sherry" assert inst.telecom[0].system == "email" assert inst.telecom[0].value == "john.doe@healthcare.example.org" assert inst.text.status == "generated" def test_practitioner_10(base_settings): """No. 10 tests collection for Practitioner. Test File: practitioner-example-xcda1.json """ filename = base_settings["unittest_data_dir"] / "practitioner-example-xcda1.json" inst = practitioner.Practitioner.model_validate_json(filename.read_bytes()) assert "Practitioner" == inst.get_resource_type() impl_practitioner_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Practitioner" == data["resourceType"] inst2 = practitioner.Practitioner(**data) impl_practitioner_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_practitionerrole.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/PractitionerRole Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import practitionerrole from .conftest import ExternalValidatorModel # noqa: F401 def impl_practitionerrole_1(inst): assert inst.active is True assert inst.availabilityExceptions == ( "Adam is generally unavailable on public holidays and during " "the Christmas/New Year break" ) assert ( inst.availableTime[0].availableEndTime == ExternalValidatorModel.model_validate({"valueTime": "16:30:00"}).valueTime ) assert ( inst.availableTime[0].availableStartTime == ExternalValidatorModel.model_validate({"valueTime": "09:00:00"}).valueTime ) assert inst.availableTime[0].daysOfWeek[0] == "mon" assert inst.availableTime[0].daysOfWeek[1] == "tue" assert inst.availableTime[0].daysOfWeek[2] == "wed" assert ( inst.availableTime[1].availableEndTime == ExternalValidatorModel.model_validate({"valueTime": "12:00:00"}).valueTime ) assert ( inst.availableTime[1].availableStartTime == ExternalValidatorModel.model_validate({"valueTime": "09:00:00"}).valueTime ) assert inst.availableTime[1].daysOfWeek[0] == "thu" assert inst.availableTime[1].daysOfWeek[1] == "fri" assert inst.code[0].coding[0].code == "RP" assert ( inst.code[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0286"} ).valueUri ) assert inst.endpoint[0].reference == "Endpoint/example" assert inst.healthcareService[0].reference == "HealthcareService/example" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.acme.org/practitioners"} ).valueUri ) assert inst.identifier[0].value == "23" assert inst.location[0].display == "South Wing, second floor" assert inst.location[0].reference == "Location/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.notAvailable[0].description == "Adam will be on extended leave during May 2017" ) assert ( inst.notAvailable[0].during.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-05-20"} ).valueDateTime ) assert ( inst.notAvailable[0].during.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-05-01"} ).valueDateTime ) assert inst.organization.reference == "Organization/f001" assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-03-31"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-01-01"} ).valueDateTime ) assert inst.practitioner.display == "Dr Adam Careful" assert inst.practitioner.reference == "Practitioner/example" assert inst.specialty[0].coding[0].code == "408443003" assert inst.specialty[0].coding[0].display == "General medical practice" assert ( inst.specialty[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "(03) 5555 6473" assert inst.telecom[1].system == "email" assert inst.telecom[1].use == "work" assert inst.telecom[1].value == "adam.southern@example.org" assert inst.text.status == "generated" def test_practitionerrole_1(base_settings): """No. 1 tests collection for PractitionerRole. Test File: practitionerrole-example.json """ filename = base_settings["unittest_data_dir"] / "practitionerrole-example.json" inst = practitionerrole.PractitionerRole.model_validate_json(filename.read_bytes()) assert "PractitionerRole" == inst.get_resource_type() impl_practitionerrole_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PractitionerRole" == data["resourceType"] inst2 = practitionerrole.PractitionerRole(**data) impl_practitionerrole_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_procedure.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Procedure Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import procedure from .conftest import ExternalValidatorModel # noqa: F401 def impl_procedure_1(inst): assert inst.bodySite[0].coding[0].code == "272676008" assert inst.bodySite[0].coding[0].display == "Sphenoid bone" assert ( inst.bodySite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.coding[0].code == "367336001" assert inst.code.coding[0].display == "Chemotherapy" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.encounter.display == "Roel's encounter on January 28th, 2013" assert inst.encounter.reference == "Encounter/f202" assert inst.id == "f201" assert ( inst.instantiatesCanonical[0] == "http://example.org/fhir/PlanDefinition/KDN5" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == ( "Eerste neo-adjuvante TPF-kuur bij groot proces in sphenoid " "met intracraniale uitbreiding." ) assert ( inst.performedPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-28T14:27:00+01:00"} ).valueDateTime ) assert ( inst.performedPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-28T13:31:00+01:00"} ).valueDateTime ) assert inst.performer[0].actor.display == "Dokter Bronsig" assert inst.performer[0].actor.reference == "Practitioner/f201" assert inst.performer[0].function.coding[0].code == "310512001" assert inst.performer[0].function.coding[0].display == "Medical oncologist" assert ( inst.performer[0].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.reasonCode[0].text == "DiagnosticReport/f201" assert inst.status == "completed" assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" def test_procedure_1(base_settings): """No. 1 tests collection for Procedure. Test File: procedure-example-f201-tpf.json """ filename = base_settings["unittest_data_dir"] / "procedure-example-f201-tpf.json" inst = procedure.Procedure.model_validate_json(filename.read_bytes()) assert "Procedure" == inst.get_resource_type() impl_procedure_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Procedure" == data["resourceType"] inst2 = procedure.Procedure(**data) impl_procedure_1(inst2) def impl_procedure_2(inst): assert inst.basedOn[0].display == "Maternity care plan" assert inst.basedOn[0].reference == "CarePlan/preg" assert inst.code.coding[0].code == "62013009" assert inst.code.coding[0].display == "Ambulating patient (procedure)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Ambulation" assert inst.id == "ambulation" assert inst.identifier[0].value == "12345" assert ( inst.instantiatesUri[0] == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/protocol-for-hypertension-during-pregnancy" } ).valueUri ) assert ( inst.location.display == "Burgers University Medical Center, South Wing, second floor" ) assert inst.location.reference == "Location/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.display == "Carla Espinosa" assert inst.performer[0].actor.reference == "Practitioner/f204" assert inst.performer[0].onBehalfOf.display == "University Medical Hospital" assert inst.performer[0].onBehalfOf.reference == "Organization/f001" assert inst.reasonReference[0].display == "Blood Pressure" assert inst.reasonReference[0].reference == "Observation/blood-pressure" assert inst.status == "not-done" assert inst.statusReason.coding[0].code == "398254007" assert inst.statusReason.coding[0].display == " Pre-eclampsia (disorder)" assert ( inst.statusReason.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.statusReason.text == "Pre-eclampsia" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Ambulation ' "procedure was not done
" ) assert inst.text.status == "generated" def test_procedure_2(base_settings): """No. 2 tests collection for Procedure. Test File: procedure-example-ambulation.json """ filename = base_settings["unittest_data_dir"] / "procedure-example-ambulation.json" inst = procedure.Procedure.model_validate_json(filename.read_bytes()) assert "Procedure" == inst.get_resource_type() impl_procedure_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Procedure" == data["resourceType"] inst2 = procedure.Procedure(**data) impl_procedure_2(inst2) def impl_procedure_3(inst): assert inst.code.coding[0].code == "25267002" assert ( inst.code.coding[0].display == "Insertion of intracardiac pacemaker (procedure)" ) assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Implant Pacemaker" assert inst.focalDevice[0].action.coding[0].code == "implanted" assert ( inst.focalDevice[0].action.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/device-action"} ).valueUri ) assert inst.focalDevice[0].manipulated.reference == "Device/example-pacemaker" assert inst.followUp[0].text == "ROS 5 days - 2013-04-10" assert inst.id == "example-implant" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == ( "Routine Appendectomy. Appendix was inflamed and in retro-" "caecal position" ) assert ( inst.performedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-04-05"} ).valueDateTime ) assert inst.performer[0].actor.display == "Dr Cecil Surgeon" assert inst.performer[0].actor.reference == "Practitioner/example" assert inst.reasonCode[0].text == "Bradycardia" assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_procedure_3(base_settings): """No. 3 tests collection for Procedure. Test File: procedure-example-implant.json """ filename = base_settings["unittest_data_dir"] / "procedure-example-implant.json" inst = procedure.Procedure.model_validate_json(filename.read_bytes()) assert "Procedure" == inst.get_resource_type() impl_procedure_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Procedure" == data["resourceType"] inst2 = procedure.Procedure(**data) impl_procedure_3(inst2) def impl_procedure_4(inst): assert inst.code.coding[0].code == "76164006" assert inst.code.coding[0].display == "Biopsy of colon (procedure)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Biopsy of colon" assert inst.id == "colon-biopsy" assert inst.identifier[0].value == "12345" assert ( inst.location.display == "Burgers University Medical Center, South Wing, second floor" ) assert inst.location.reference == "Location/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.partOf[0].display == "Colonoscopy" assert inst.partOf[0].reference == "Procedure/colonoscopy" assert inst.performer[0].actor.display == "Dr Adam Careful" assert inst.performer[0].actor.reference == "Practitioner/example" assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Biopsy of colon,' " which was part of colonoscopy
" ) assert inst.text.status == "generated" def test_procedure_4(base_settings): """No. 4 tests collection for Procedure. Test File: procedure-example-colon-biopsy.json """ filename = ( base_settings["unittest_data_dir"] / "procedure-example-colon-biopsy.json" ) inst = procedure.Procedure.model_validate_json(filename.read_bytes()) assert "Procedure" == inst.get_resource_type() impl_procedure_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Procedure" == data["resourceType"] inst2 = procedure.Procedure(**data) impl_procedure_4(inst2) def impl_procedure_5(inst): assert inst.bodySite[0].coding[0].code == "83030008" assert inst.bodySite[0].coding[0].display == "Retropharyngeal area" assert ( inst.bodySite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.coding[0].code == "48387007" assert inst.code.coding[0].display == "Tracheotomy" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.encounter.reference == "Encounter/f003" assert inst.followUp[0].text == "described in care plan" assert inst.id == "f004" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome.text == "removal of the retropharyngeal abscess" assert ( inst.performedPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-22T10:30:10+01:00"} ).valueDateTime ) assert ( inst.performedPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-22T09:30:10+01:00"} ).valueDateTime ) assert inst.performer[0].actor.display == "A. Langeveld" assert inst.performer[0].actor.reference == "Practitioner/f005" assert inst.performer[0].function.coding[0].code == "01.000" assert inst.performer[0].function.coding[0].display == "Arts" assert ( inst.performer[0].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.2.4.15.111"} ).valueUri ) assert inst.performer[0].function.text == "Care role" assert inst.reasonCode[0].text == "ensure breathing during surgery" assert inst.report[0].display == "???????????" assert inst.report[0].reference == "DiagnosticReport/f001" assert inst.status == "completed" assert inst.subject.display == "P. van de Heuvel" assert inst.subject.reference == "Patient/f001" assert inst.text.status == "generated" def test_procedure_5(base_settings): """No. 5 tests collection for Procedure. Test File: procedure-example-f004-tracheotomy.json """ filename = ( base_settings["unittest_data_dir"] / "procedure-example-f004-tracheotomy.json" ) inst = procedure.Procedure.model_validate_json(filename.read_bytes()) assert "Procedure" == inst.get_resource_type() impl_procedure_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Procedure" == data["resourceType"] inst2 = procedure.Procedure(**data) impl_procedure_5(inst2) def impl_procedure_6(inst): assert inst.basedOn[0].display == "Order for health education" assert inst.basedOn[0].reference == "ServiceRequest/education" assert inst.category.coding[0].code == "311401005" assert inst.category.coding[0].display == "Patient education (procedure)" assert ( inst.category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category.text == "Education" assert inst.code.coding[0].code == "48023004" assert ( inst.code.coding[0].display == "Breast self-examination technique education (procedure)" ) assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Health education - breast examination" assert inst.id == "education" assert inst.location.display == "Southside Community Health Center" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.performedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.performer[0].actor.display == "Pamela Educator, RN" assert inst.reasonCode[0].text == "early detection of breast mass" assert inst.status == "completed" assert inst.subject.display == "Jane Doe" assert inst.text.div == ( '
Health education' " - breast examination for early detection of breast " "mass
" ) assert inst.text.status == "generated" def test_procedure_6(base_settings): """No. 6 tests collection for Procedure. Test File: procedure-example-education.json """ filename = base_settings["unittest_data_dir"] / "procedure-example-education.json" inst = procedure.Procedure.model_validate_json(filename.read_bytes()) assert "Procedure" == inst.get_resource_type() impl_procedure_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Procedure" == data["resourceType"] inst2 = procedure.Procedure(**data) impl_procedure_6(inst2) def impl_procedure_7(inst): assert inst.code.coding[0].code == "73761001" assert inst.code.coding[0].display == "Colonoscopy (procedure)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Colonoscopy" assert inst.complicationDetail[0].display == "Perforated intestine condition" assert inst.id == "colonoscopy" assert inst.identifier[0].value == "12345" assert ( inst.location.display == "Burgers University Medical Center, South Wing, second floor" ) assert inst.location.reference == "Location/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.display == "Dr Adam Careful" assert inst.performer[0].actor.reference == "Practitioner/example" assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Colonoscopy with' " complication
" ) assert inst.text.status == "generated" assert inst.usedReference[0].display == "Colonoscope device" def test_procedure_7(base_settings): """No. 7 tests collection for Procedure. Test File: procedure-example-colonoscopy.json """ filename = base_settings["unittest_data_dir"] / "procedure-example-colonoscopy.json" inst = procedure.Procedure.model_validate_json(filename.read_bytes()) assert "Procedure" == inst.get_resource_type() impl_procedure_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Procedure" == data["resourceType"] inst2 = procedure.Procedure(**data) impl_procedure_7(inst2) def impl_procedure_8(inst): assert ( inst.basedOn[0].display == "Order for the assessment of passive range of motion" ) assert inst.basedOn[0].reference == "ServiceRequest/physical-therapy" assert inst.bodySite[0].coding[0].code == "36701003" assert inst.bodySite[0].coding[0].display == "Both knees (body structure)" assert ( inst.bodySite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.bodySite[0].text == "Both knees" assert inst.category.coding[0].code == "386053000" assert inst.category.coding[0].display == "Evaluation procedure (procedure)" assert ( inst.category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category.text == "Evaluation" assert inst.code.coding[0].code == "710830005" assert ( inst.code.coding[0].display == "Assessment of passive range of motion (procedure)" ) assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Assessment of passive range of motion" assert inst.id == "physical-therapy" assert inst.location.display == "Sawbones Orthopedic Clinic" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.performedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-09-27"} ).valueDateTime ) assert inst.performer[0].actor.display == "Paul Therapist, PT" assert ( inst.reasonCode[0].text == "assessment of mobility limitations due to osteoarthritis" ) assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Assessment of ' "passive range of motion for both knees on Sept 27, 2016 due " "to osteoarthritis
" ) assert inst.text.status == "generated" def test_procedure_8(base_settings): """No. 8 tests collection for Procedure. Test File: procedure-example-physical-therapy.json """ filename = ( base_settings["unittest_data_dir"] / "procedure-example-physical-therapy.json" ) inst = procedure.Procedure.model_validate_json(filename.read_bytes()) assert "Procedure" == inst.get_resource_type() impl_procedure_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Procedure" == data["resourceType"] inst2 = procedure.Procedure(**data) impl_procedure_8(inst2) def impl_procedure_9(inst): assert inst.bodySite[0].coding[0].code == "83030008" assert inst.bodySite[0].coding[0].display == "Retropharyngeal area" assert ( inst.bodySite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.coding[0].code == "172960003" assert inst.code.coding[0].display == "Incision of retropharyngeal abscess" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.encounter.reference == "Encounter/f003" assert inst.followUp[0].text == "described in care plan" assert inst.id == "f003" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome.text == "removal of the retropharyngeal abscess" assert ( inst.performedPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-24T10:30:10+01:00"} ).valueDateTime ) assert ( inst.performedPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-24T09:30:10+01:00"} ).valueDateTime ) assert inst.performer[0].actor.display == "E.M.J.M. van den broek" assert inst.performer[0].actor.reference == "Practitioner/f001" assert inst.performer[0].function.coding[0].code == "01.000" assert inst.performer[0].function.coding[0].display == "Arts" assert ( inst.performer[0].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.2.4.15.111"} ).valueUri ) assert inst.performer[0].function.text == "Care role" assert inst.reasonCode[0].text == "abcess in retropharyngeal area" assert inst.report[0].display == "Lab results blood test" assert inst.report[0].reference == "DiagnosticReport/f001" assert inst.status == "completed" assert inst.subject.display == "P. van de Heuvel" assert inst.subject.reference == "Patient/f001" assert inst.text.status == "generated" def test_procedure_9(base_settings): """No. 9 tests collection for Procedure. Test File: procedure-example-f003-abscess.json """ filename = ( base_settings["unittest_data_dir"] / "procedure-example-f003-abscess.json" ) inst = procedure.Procedure.model_validate_json(filename.read_bytes()) assert "Procedure" == inst.get_resource_type() impl_procedure_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Procedure" == data["resourceType"] inst2 = procedure.Procedure(**data) impl_procedure_9(inst2) def impl_procedure_10(inst): assert inst.asserter.display == "Dr Cecil Surgeon" assert inst.asserter.reference == "Practitioner/example" assert inst.code.coding[0].code == "80146002" assert inst.code.coding[0].display == "Appendectomy (Procedure)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Appendectomy" assert inst.followUp[0].text == "ROS 5 days - 2013-04-10" assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == ( "Routine Appendectomy. Appendix was inflamed and in retro-" "caecal position" ) assert ( inst.performedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-04-05"} ).valueDateTime ) assert inst.performer[0].actor.display == "Dr Cecil Surgeon" assert inst.performer[0].actor.reference == "Practitioner/example" assert inst.reasonCode[0].text == ( "Generalized abdominal pain 24 hours. Localized in RIF with " "rebound and guarding" ) assert inst.recorder.display == "Dr Cecil Surgeon" assert inst.recorder.reference == "Practitioner/example" assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Routine ' "Appendectomy
" ) assert inst.text.status == "generated" def test_procedure_10(base_settings): """No. 10 tests collection for Procedure. Test File: procedure-example.json """ filename = base_settings["unittest_data_dir"] / "procedure-example.json" inst = procedure.Procedure.model_validate_json(filename.read_bytes()) assert "Procedure" == inst.get_resource_type() impl_procedure_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Procedure" == data["resourceType"] inst2 = procedure.Procedure(**data) impl_procedure_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_provenance.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Provenance Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import provenance from .conftest import ExternalValidatorModel # noqa: F401 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-DocumentCompletion"} ).valueUri ) assert inst.agent[0].type.coding[0].code == "VERF" assert ( inst.agent[0].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/contractsignertypecodes" } ).valueUri ) assert ( inst.agent[0].who.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.agent[0].who.identifier.value == "mailto://hhd@ssa.gov" 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.reason[0].coding[0].code == "TREAT" assert inst.reason[0].coding[0].display == "treatment" assert ( inst.reason[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2015-08-27T08:39:24+10:00"} ).valueInstant ) assert ( inst.signature[0].data == ExternalValidatorModel.model_validate( {"valueBase64Binary": "Li4u"} ).valueBase64Binary ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso-astm:E1762-95:2013"} ).valueUri ) assert ( inst.signature[0].when == ExternalValidatorModel.model_validate( {"valueInstant": "2015-08-27T08:39:24+10:00"} ).valueInstant ) assert inst.signature[0].who.reference == "Practitioner/xcda-author" assert inst.target[0].reference == "DocumentReference/example" assert inst.text.div == ( '
procedure record' " authored on 27-June 2015 by Harold Hippocrates, MD Content " "extracted from Referral received 26-June
" ) assert inst.text.status == "generated" def test_provenance_1(base_settings): """No. 1 tests collection for Provenance. Test File: provenance-example-sig.json """ filename = base_settings["unittest_data_dir"] / "provenance-example-sig.json" inst = provenance.Provenance.model_validate_json(filename.read_bytes()) assert "Provenance" == inst.get_resource_type() impl_provenance_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Provenance" == data["resourceType"] inst2 = provenance.Provenance(**data) impl_provenance_1(inst2) def impl_provenance_2(inst): assert inst.agent[0].role[0].coding[0].code == "AUT" assert ( inst.agent[0].role[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2016-05-26T00:41:10-04:00"} ).valueInstant ) assert ( inst.signature[0].data == ExternalValidatorModel.model_validate( {"valueBase64Binary": "dGhpcyBibG9iIGlzIHNuaXBwZWQ="} ).valueBase64Binary ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso-astm:E1762-95:2013"} ).valueUri ) assert ( inst.signature[0].when == ExternalValidatorModel.model_validate( {"valueInstant": "2016-05-26T00:41:10-04:00"} ).valueInstant ) assert inst.signature[0].who.reference == "Patient/72" assert inst.target[0].reference == "Consent/consent-example-signature" assert inst.text.status == "generated" def test_provenance_2(base_settings): """No. 2 tests collection for Provenance. Test File: provenance-consent-signature.json """ filename = base_settings["unittest_data_dir"] / "provenance-consent-signature.json" inst = provenance.Provenance.model_validate_json(filename.read_bytes()) assert "Provenance" == inst.get_resource_type() impl_provenance_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Provenance" == data["resourceType"] inst2 = provenance.Provenance(**data) impl_provenance_2(inst2) def impl_provenance_3(inst): assert inst.agent[0].type.coding[0].code == "AUT" assert ( inst.agent[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.agent[0].who.reference == "Patient/example" assert inst.entity[0].role == "source" assert inst.entity[0].what.identifier.type.coding[0].code == "CWL" assert inst.entity[0].what.identifier.type.coding[0].display == "lobSTR" assert ( inst.entity[0].what.identifier.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://github.com/common-workflow-language/workflows"} ).valueUri ) assert inst.entity[0].what.identifier.value == ( "https://github.com/common-workflow-" "language/workflows/blob/master/workflows/lobSTR/lobSTR-" "workflow.cwl" ) assert inst.id == "example-cwl" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurredPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-11-30"} ).valueDateTime ) assert inst.reason[0].text == ( "profiling Short Tandem Repeats (STRs) from high throughput " "sequencing data." ) assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2016-12-01T08:12:14+10:00"} ).valueInstant ) assert inst.target[0].reference == "MolecularSequence/example-pgx-1" assert inst.text.status == "generated" def test_provenance_3(base_settings): """No. 3 tests collection for Provenance. Test File: provenance-example-cwl.json """ filename = base_settings["unittest_data_dir"] / "provenance-example-cwl.json" inst = provenance.Provenance.model_validate_json(filename.read_bytes()) assert "Provenance" == inst.get_resource_type() impl_provenance_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Provenance" == data["resourceType"] inst2 = provenance.Provenance(**data) impl_provenance_3(inst2) def impl_provenance_4(inst): assert inst.agent[0].type.coding[0].code == "AUT" assert ( inst.agent[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.agent[0].who.reference == "Practitioner/example" assert inst.entity[0].role == "source" assert inst.entity[0].what.identifier.type.coding[0].code == "biocompute" assert inst.entity[0].what.identifier.type.coding[0].display == "obj.1001" assert ( inst.entity[0].what.identifier.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://hive.biochemistry.gwu.edu"} ).valueUri ) assert inst.entity[0].what.identifier.value == ( "https://hive.biochemistry.gwu.edu/cgi-" "bin/prd/htscsrs/servlet.cgi?pageid=bcoexample_1" ) assert inst.id == "example-biocompute-object" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurredPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-06-06"} ).valueDateTime ) assert inst.reason[0].text == "antiviral resistance detection" assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2016-06-09T08:12:14+10:00"} ).valueInstant ) assert inst.target[0].reference == "MolecularSequence/example" assert inst.text.status == "generated" def test_provenance_4(base_settings): """No. 4 tests collection for Provenance. Test File: provenance-example-biocompute-object.json """ filename = ( base_settings["unittest_data_dir"] / "provenance-example-biocompute-object.json" ) inst = provenance.Provenance.model_validate_json(filename.read_bytes()) assert "Provenance" == inst.get_resource_type() impl_provenance_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Provenance" == data["resourceType"] inst2 = provenance.Provenance(**data) impl_provenance_4(inst2) def impl_provenance_5(inst): assert inst.agent[0].type.coding[0].code == "AUT" assert ( inst.agent[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.agent[0].who.reference == "Practitioner/xcda-author" assert inst.agent[1].id == "a1" assert inst.agent[1].type.coding[0].code == "DEV" assert ( inst.agent[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.agent[1].who.reference == "Device/software" assert inst.entity[0].role == "source" assert inst.entity[0].what.display == "CDA Document in XDS repository" assert inst.entity[0].what.reference == "DocumentReference/example" assert inst.id == "example" assert inst.location.reference == "Location/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurredPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-06-28"} ).valueDateTime ) assert ( inst.occurredPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-06-27"} ).valueDateTime ) assert ( inst.policy[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/fhir/Consent/25"} ).valueUri ) assert inst.reason[0].coding[0].code == "3457005" assert inst.reason[0].coding[0].display == "Referral" assert ( inst.reason[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2015-06-27T08:39:24+10:00"} ).valueInstant ) assert inst.target[0].reference == "Procedure/example/_history/1" assert inst.text.status == "generated" def test_provenance_5(base_settings): """No. 5 tests collection for Provenance. Test File: provenance-example.json """ filename = base_settings["unittest_data_dir"] / "provenance-example.json" inst = provenance.Provenance.model_validate_json(filename.read_bytes()) assert "Provenance" == inst.get_resource_type() impl_provenance_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Provenance" == data["resourceType"] inst2 = provenance.Provenance(**data) impl_provenance_5(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_questionnaire.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Questionnaire Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import questionnaire from .conftest import ExternalValidatorModel # noqa: F401 def impl_questionnaire_1(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.experimental is False assert inst.id == "qs1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.item[0].item[0].linkId == "Person-display" assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].linkId == "Person-flyover" assert inst.item[0].item[1].text == ( "Demographics and administrative information about a person " "independent of a specific health-related context." ) assert inst.item[0].item[1].type == "display" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[2].extension[1].valueString == "string" assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].linkId == "Person.id-flyover" assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].item[1].linkId == "Person.id.value" assert inst.item[0].item[2].item[1].repeats is False assert inst.item[0].item[2].item[1].required is False assert inst.item[0].item[2].item[1].text == "Logical id of this artifact" assert inst.item[0].item[2].item[1].type == "string" assert inst.item[0].item[2].linkId == "Person.id" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[3].item[0].linkId == "Person.meta-flyover" assert inst.item[0].item[3].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content " "might not always be associated with version changes to the " "resource." ) assert inst.item[0].item[3].item[0].type == "display" assert inst.item[0].item[3].linkId == "Person.meta" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].text == "Metadata about the resource" assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "uri" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[4].item[0].linkId == "Person.implicitRules-flyover" assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].linkId == "Person.implicitRules.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert ( inst.item[0].item[4].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[4].item[1].type == "string" assert inst.item[0].item[4].linkId == "Person.implicitRules" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[5].extension[1].valueString == "code" assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].linkId == "Person.language-flyover" assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].item[1].linkId == "Person.language.value" assert inst.item[0].item[5].item[1].repeats is False assert inst.item[0].item[5].item[1].required is False assert inst.item[0].item[5].item[1].text == "language" assert inst.item[0].item[5].item[1].type == "choice" assert inst.item[0].item[5].linkId == "Person.language" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[6].extension[0].valueInteger == 1 assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[6].item[0].linkId == "Person.text-flyover" assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "Person.text" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert ( inst.item[0].item[6].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[7].item[0].linkId == "Person.contained-flyover" assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "Person.contained" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Contained, inline Resources" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[8].item[0].linkId == "Person.extension-flyover" assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "Person.extension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Additional content defined by implementations" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[9].item[0].linkId == "Person.modifierExtension-flyover" assert inst.item[0].item[9].item[0].type == "display" assert inst.item[0].item[9].linkId == "Person.modifierExtension" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].text == "Extensions that cannot be ignored" assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "Person" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == "A generic person record" assert inst.item[0].type == "group" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.publisher == "Health Level Seven International (Patient Administration)" assert inst.status == "draft" assert inst.version == "4.3.0" def test_questionnaire_1(base_settings): """No. 1 tests collection for Questionnaire. Test File: person-questionnaire.json """ filename = base_settings["unittest_data_dir"] / "person-questionnaire.json" inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_1(inst2) def impl_questionnaire_2(inst): assert inst.contained[0].id == "vs2" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-10-09T00:00:00+11:00"} ).valueDateTime ) assert inst.experimental is False assert inst.id == "qs1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.item[0].item[0].linkId == "DiagnosticReport-display" assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].linkId == "DiagnosticReport-flyover" assert inst.item[0].item[1].type == "display" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[2].extension[1].valueString == "string" assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].linkId == "DiagnosticReport.id-flyover" assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].item[1].linkId == "DiagnosticReport.id.value" assert inst.item[0].item[2].item[1].repeats is False assert inst.item[0].item[2].item[1].required is False assert inst.item[0].item[2].item[1].text == "Logical id of this artifact" assert inst.item[0].item[2].item[1].type == "string" assert inst.item[0].item[2].linkId == "DiagnosticReport.id" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[3].item[0].linkId == "DiagnosticReport.meta-flyover" assert inst.item[0].item[3].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content " "might not always be associated with version changes to the " "resource." ) assert inst.item[0].item[3].item[0].type == "display" assert inst.item[0].item[3].linkId == "DiagnosticReport.meta" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].text == "Metadata about the resource" assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "uri" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[4].item[0].linkId == "DiagnosticReport.implicitRules-flyover" ) assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].linkId == "DiagnosticReport.implicitRules.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert ( inst.item[0].item[4].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[4].item[1].type == "string" assert inst.item[0].item[4].linkId == "DiagnosticReport.implicitRules" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[5].extension[1].valueString == "code" assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].linkId == "DiagnosticReport.language-flyover" assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].item[1].linkId == "DiagnosticReport.language.value" assert inst.item[0].item[5].item[1].repeats is False assert inst.item[0].item[5].item[1].required is False assert inst.item[0].item[5].item[1].text == "language" assert inst.item[0].item[5].item[1].type == "choice" assert inst.item[0].item[5].linkId == "DiagnosticReport.language" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[6].extension[0].valueInteger == 1 assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[6].item[0].linkId == "DiagnosticReport.text-flyover" assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "DiagnosticReport.text" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert ( inst.item[0].item[6].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[7].item[0].linkId == "DiagnosticReport.contained-flyover" assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "DiagnosticReport.contained" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Contained, inline Resources" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[8].item[0].linkId == "DiagnosticReport.extension-flyover" assert inst.item[0].item[8].item[0].text == "An Extension" assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "DiagnosticReport.extension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Extension" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[9].item[0].linkId == "DiagnosticReport.modifierExtension-flyover" ) assert inst.item[0].item[9].item[0].type == "display" assert inst.item[0].item[9].linkId == "DiagnosticReport.modifierExtension" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].text == "Extensions that cannot be ignored" assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "DiagnosticReport" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == ( "A Diagnostic report - a combination of request information, " "atomic results, images, interpretation, as well as formatted" " reports" ) assert inst.item[0].type == "group" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.publisher == "Health Level Seven International (Clinical Genomics)" assert inst.status == "draft" assert inst.version == "4.3.0" def test_questionnaire_2(base_settings): """No. 2 tests collection for Questionnaire. Test File: hlaresult-questionnaire.json """ filename = base_settings["unittest_data_dir"] / "hlaresult-questionnaire.json" inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_2(inst2) def impl_questionnaire_3(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.experimental is False assert inst.id == "qs1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.item[0].item[0].linkId == "OperationOutcome-display" assert inst.item[0].item[0].text == ( "Can result from the failure of a REST call or be part of the" " response message returned from a request message." ) assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].linkId == "OperationOutcome-flyover" assert inst.item[0].item[1].text == ( "A collection of error, warning, or information messages that" " result from a system action." ) assert inst.item[0].item[1].type == "display" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[2].extension[1].valueString == "string" assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].linkId == "OperationOutcome.id-flyover" assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].item[1].linkId == "OperationOutcome.id.value" assert inst.item[0].item[2].item[1].repeats is False assert inst.item[0].item[2].item[1].required is False assert inst.item[0].item[2].item[1].text == "Logical id of this artifact" assert inst.item[0].item[2].item[1].type == "string" assert inst.item[0].item[2].linkId == "OperationOutcome.id" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[3].item[0].linkId == "OperationOutcome.meta-flyover" assert inst.item[0].item[3].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content " "might not always be associated with version changes to the " "resource." ) assert inst.item[0].item[3].item[0].type == "display" assert inst.item[0].item[3].linkId == "OperationOutcome.meta" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].text == "Metadata about the resource" assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "uri" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[4].item[0].linkId == "OperationOutcome.implicitRules-flyover" ) assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].linkId == "OperationOutcome.implicitRules.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert ( inst.item[0].item[4].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[4].item[1].type == "string" assert inst.item[0].item[4].linkId == "OperationOutcome.implicitRules" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[5].extension[1].valueString == "code" assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].linkId == "OperationOutcome.language-flyover" assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].item[1].linkId == "OperationOutcome.language.value" assert inst.item[0].item[5].item[1].repeats is False assert inst.item[0].item[5].item[1].required is False assert inst.item[0].item[5].item[1].text == "language" assert inst.item[0].item[5].item[1].type == "choice" assert inst.item[0].item[5].linkId == "OperationOutcome.language" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[6].extension[0].valueInteger == 1 assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[6].item[0].linkId == "OperationOutcome.text-flyover" assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "OperationOutcome.text" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert ( inst.item[0].item[6].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[7].item[0].linkId == "OperationOutcome.contained-flyover" assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "OperationOutcome.contained" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Contained, inline Resources" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[8].item[0].linkId == "OperationOutcome.extension-flyover" assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "OperationOutcome.extension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Additional content defined by implementations" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[9].item[0].linkId == "OperationOutcome.modifierExtension-flyover" ) assert inst.item[0].item[9].item[0].type == "display" assert inst.item[0].item[9].linkId == "OperationOutcome.modifierExtension" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].text == "Extensions that cannot be ignored" assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "OperationOutcome" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == "Information about the success/failure of an action" assert inst.item[0].type == "group" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.publisher == "Health Level Seven International (FHIR Infrastructure)" assert inst.status == "active" assert inst.version == "4.3.0" def test_questionnaire_3(base_settings): """No. 3 tests collection for Questionnaire. Test File: operationoutcome-questionnaire.json """ filename = ( base_settings["unittest_data_dir"] / "operationoutcome-questionnaire.json" ) inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_3(inst2) def impl_questionnaire_4(inst): assert inst.contained[0].id == "vs2" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.experimental is False assert inst.id == "qs1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.item[0].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[0].linkId == "EventDefinition-flyover" assert inst.item[0].item[0].text == ( "The EventDefinition resource provides a reusable description" " of when a particular event can occur." ) assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[1].extension[0].valueInteger == 1 assert ( inst.item[0].item[1].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[1].extension[1].valueString == "string" assert ( inst.item[0].item[1].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].item[0].linkId == "EventDefinition.id-flyover" assert inst.item[0].item[1].item[0].type == "display" assert inst.item[0].item[1].item[1].linkId == "EventDefinition.id.value" assert inst.item[0].item[1].item[1].repeats is False assert inst.item[0].item[1].item[1].required is False assert inst.item[0].item[1].item[1].text == "Logical id of this artifact" assert inst.item[0].item[1].item[1].type == "string" assert inst.item[0].item[1].linkId == "EventDefinition.id" assert inst.item[0].item[1].repeats is True assert inst.item[0].item[1].required is False assert inst.item[0].item[1].type == "group" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].linkId == "EventDefinition.meta-flyover" assert inst.item[0].item[2].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content " "might not always be associated with version changes to the " "resource." ) assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].linkId == "EventDefinition.meta" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].text == "Metadata about the resource" assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[3].extension[1].valueString == "uri" assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[3].item[0].linkId == "EventDefinition.implicitRules-flyover" ) assert inst.item[0].item[3].item[0].type == "display" assert inst.item[0].item[3].item[1].linkId == "EventDefinition.implicitRules.value" assert inst.item[0].item[3].item[1].repeats is False assert inst.item[0].item[3].item[1].required is False assert ( inst.item[0].item[3].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[3].item[1].type == "string" assert inst.item[0].item[3].linkId == "EventDefinition.implicitRules" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "code" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[4].item[0].linkId == "EventDefinition.language-flyover" assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].linkId == "EventDefinition.language.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert inst.item[0].item[4].item[1].text == "language" assert inst.item[0].item[4].item[1].type == "choice" assert inst.item[0].item[4].linkId == "EventDefinition.language" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].linkId == "EventDefinition.text-flyover" assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].linkId == "EventDefinition.text" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert ( inst.item[0].item[5].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[6].item[0].linkId == "EventDefinition.contained-flyover" assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "EventDefinition.contained" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert inst.item[0].item[6].text == "Contained, inline Resources" assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[7].item[0].linkId == "EventDefinition.extension-flyover" assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "EventDefinition.extension" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Additional content defined by implementations" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[8].item[0].linkId == "EventDefinition.modifierExtension-flyover" ) assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "EventDefinition.modifierExtension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Extensions that cannot be ignored" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[9].extension[0].valueInteger == 1 assert ( inst.item[0].item[9].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[9].extension[1].valueString == "uri" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[9].item[0].linkId == "EventDefinition.url-flyover" assert inst.item[0].item[9].item[0].type == "display" assert inst.item[0].item[9].item[1].linkId == "EventDefinition.url.value" assert inst.item[0].item[9].item[1].repeats is False assert inst.item[0].item[9].item[1].required is False assert inst.item[0].item[9].item[1].text == ( "Canonical identifier for this event definition, represented " "as a URI (globally unique)" ) assert inst.item[0].item[9].item[1].type == "string" assert inst.item[0].item[9].linkId == "EventDefinition.url" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "EventDefinition" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == "A description of when an event can occur" assert inst.item[0].type == "group" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.publisher == "Health Level Seven International (Clinical Decision Support)" ) assert inst.status == "draft" assert inst.version == "4.3.0" def test_questionnaire_4(base_settings): """No. 4 tests collection for Questionnaire. Test File: eventdefinition-questionnaire.json """ filename = base_settings["unittest_data_dir"] / "eventdefinition-questionnaire.json" inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_4(inst2) def impl_questionnaire_5(inst): assert inst.contained[0].id == "vs2" assert inst.contained[1].id == "vs3" assert inst.contained[2].id == "vs4" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.experimental is False assert inst.id == "qs1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.item[0].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[0].linkId == "ActivityDefinition-flyover" assert inst.item[0].item[0].text == ( "This resource allows for the definition of some activity to " "be performed, independent of a particular patient, " "practitioner, or other performance context." ) assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[1].extension[0].valueInteger == 1 assert ( inst.item[0].item[1].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[1].extension[1].valueString == "string" assert ( inst.item[0].item[1].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].item[0].linkId == "ActivityDefinition.id-flyover" assert inst.item[0].item[1].item[0].type == "display" assert inst.item[0].item[1].item[1].linkId == "ActivityDefinition.id.value" assert inst.item[0].item[1].item[1].repeats is False assert inst.item[0].item[1].item[1].required is False assert inst.item[0].item[1].item[1].text == "Logical id of this artifact" assert inst.item[0].item[1].item[1].type == "string" assert inst.item[0].item[1].linkId == "ActivityDefinition.id" assert inst.item[0].item[1].repeats is True assert inst.item[0].item[1].required is False assert inst.item[0].item[1].type == "group" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].linkId == "ActivityDefinition.meta-flyover" assert inst.item[0].item[2].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content " "might not always be associated with version changes to the " "resource." ) assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].linkId == "ActivityDefinition.meta" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].text == "Metadata about the resource" assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[3].extension[1].valueString == "uri" assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[3].item[0].linkId == "ActivityDefinition.implicitRules-flyover" ) assert inst.item[0].item[3].item[0].type == "display" assert ( inst.item[0].item[3].item[1].linkId == "ActivityDefinition.implicitRules.value" ) assert inst.item[0].item[3].item[1].repeats is False assert inst.item[0].item[3].item[1].required is False assert ( inst.item[0].item[3].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[3].item[1].type == "string" assert inst.item[0].item[3].linkId == "ActivityDefinition.implicitRules" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "code" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[4].item[0].linkId == "ActivityDefinition.language-flyover" assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].linkId == "ActivityDefinition.language.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert inst.item[0].item[4].item[1].text == "language" assert inst.item[0].item[4].item[1].type == "choice" assert inst.item[0].item[4].linkId == "ActivityDefinition.language" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].linkId == "ActivityDefinition.text-flyover" assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].linkId == "ActivityDefinition.text" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert ( inst.item[0].item[5].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[6].item[0].linkId == "ActivityDefinition.contained-flyover" assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "ActivityDefinition.contained" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert inst.item[0].item[6].text == "Contained, inline Resources" assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[7].item[0].linkId == "ActivityDefinition.extension-flyover" assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "ActivityDefinition.extension" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Additional content defined by implementations" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[8].item[0].linkId == "ActivityDefinition.modifierExtension-flyover" ) assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "ActivityDefinition.modifierExtension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Extensions that cannot be ignored" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[9].extension[0].valueInteger == 1 assert ( inst.item[0].item[9].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[9].extension[1].valueString == "uri" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[9].item[0].linkId == "ActivityDefinition.url-flyover" assert inst.item[0].item[9].item[0].type == "display" assert inst.item[0].item[9].item[1].linkId == "ActivityDefinition.url.value" assert inst.item[0].item[9].item[1].repeats is False assert inst.item[0].item[9].item[1].required is False assert inst.item[0].item[9].item[1].text == ( "Canonical identifier for this activity definition, " "represented as a URI (globally unique)" ) assert inst.item[0].item[9].item[1].type == "string" assert inst.item[0].item[9].linkId == "ActivityDefinition.url" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "ActivityDefinition" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == ( "The definition of a specific activity to be taken, " "independent of any particular patient or context" ) assert inst.item[0].type == "group" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.publisher == "Health Level Seven International (Clinical Decision Support)" ) assert inst.status == "draft" assert inst.version == "4.3.0" def test_questionnaire_5(base_settings): """No. 5 tests collection for Questionnaire. Test File: activitydefinition-questionnaire.json """ filename = ( base_settings["unittest_data_dir"] / "activitydefinition-questionnaire.json" ) inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_5(inst2) def impl_questionnaire_6(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-17T07:06:13+11:00"} ).valueDateTime ) assert inst.experimental is False assert inst.id == "qs1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs" } ).valueUri ) assert inst.item[0].extension[0].valueInteger == 1 assert ( inst.item[0].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].extension[1].valueInteger == 1 assert ( inst.item[0].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[0].linkId == "GuidanceResponse-flyover" assert inst.item[0].item[0].text == ( "A guidance response is the formal response to a guidance " "request, including any output parameters returned by the " "evaluation, as well as the description of any proposed " "actions to be taken." ) assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[1].extension[0].valueInteger == 1 assert ( inst.item[0].item[1].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[1].extension[1].valueString == "string" assert ( inst.item[0].item[1].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].item[0].linkId == "GuidanceResponse.id-flyover" assert inst.item[0].item[1].item[0].type == "display" assert inst.item[0].item[1].item[1].linkId == "GuidanceResponse.id.value" assert inst.item[0].item[1].item[1].repeats is False assert inst.item[0].item[1].item[1].required is False assert inst.item[0].item[1].item[1].text == "Logical id of this artifact" assert inst.item[0].item[1].item[1].type == "string" assert inst.item[0].item[1].linkId == "GuidanceResponse.id" assert inst.item[0].item[1].repeats is True assert inst.item[0].item[1].required is False assert inst.item[0].item[1].type == "group" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].linkId == "GuidanceResponse.meta-flyover" assert inst.item[0].item[2].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content " "might not always be associated with version changes to the " "resource." ) assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].linkId == "GuidanceResponse.meta" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].text == "Metadata about the resource" assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[3].extension[1].valueString == "uri" assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[3].item[0].linkId == "GuidanceResponse.implicitRules-flyover" ) assert inst.item[0].item[3].item[0].type == "display" assert inst.item[0].item[3].item[1].linkId == "GuidanceResponse.implicitRules.value" assert inst.item[0].item[3].item[1].repeats is False assert inst.item[0].item[3].item[1].required is False assert ( inst.item[0].item[3].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[3].item[1].type == "string" assert inst.item[0].item[3].linkId == "GuidanceResponse.implicitRules" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "code" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[4].item[0].linkId == "GuidanceResponse.language-flyover" assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].linkId == "GuidanceResponse.language.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert inst.item[0].item[4].item[1].text == "language" assert inst.item[0].item[4].item[1].type == "choice" assert inst.item[0].item[4].linkId == "GuidanceResponse.language" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].linkId == "GuidanceResponse.text-flyover" assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].linkId == "GuidanceResponse.text" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert ( inst.item[0].item[5].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[6].item[0].linkId == "GuidanceResponse.contained-flyover" assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "GuidanceResponse.contained" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert inst.item[0].item[6].text == "Contained, inline Resources" assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[7].item[0].linkId == "GuidanceResponse.extension-flyover" assert inst.item[0].item[7].item[0].text == "An Extension" assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "GuidanceResponse.extension" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Extension" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[8].item[0].linkId == "GuidanceResponse.modifierExtension-flyover" ) assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "GuidanceResponse.modifierExtension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Extensions that cannot be ignored" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs" } ).valueUri ) assert inst.item[0].item[9].extension[0].valueInteger == 1 assert ( inst.item[0].item[9].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[9].extension[1].valueInteger == 1 assert ( inst.item[0].item[9].extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[9].extension[2].valueString == "Identifier" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[9].item[0].linkId == "GuidanceResponse.requestIdentifier-flyover" ) assert inst.item[0].item[9].item[0].type == "display" assert ( inst.item[0].item[9].item[1].linkId == "GuidanceResponse.requestIdentifier.label" ) assert inst.item[0].item[9].item[1].repeats is False assert inst.item[0].item[9].item[1].required is False assert inst.item[0].item[9].item[1].text == "label:" assert inst.item[0].item[9].item[1].type == "string" assert ( inst.item[0].item[9].item[2].linkId == "GuidanceResponse.requestIdentifier.system" ) assert inst.item[0].item[9].item[2].repeats is False assert inst.item[0].item[9].item[2].required is False assert inst.item[0].item[9].item[2].text == "system:" assert inst.item[0].item[9].item[2].type == "string" assert ( inst.item[0].item[9].item[3].linkId == "GuidanceResponse.requestIdentifier.value" ) assert inst.item[0].item[9].item[3].repeats is False assert inst.item[0].item[9].item[3].required is False assert inst.item[0].item[9].item[3].text == "value:" assert inst.item[0].item[9].item[3].type == "string" assert inst.item[0].item[9].linkId == "GuidanceResponse.requestIdentifier" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is True assert inst.item[0].item[9].text == ( "The identifier of the request associated with this response," " if any" ) assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "GuidanceResponse" assert inst.item[0].repeats is False assert inst.item[0].required is True assert inst.item[0].text == "The formal response to a guidance request" assert inst.item[0].type == "group" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.publisher == "HL7" assert inst.status == "draft" assert inst.version == "4.3.0" def test_questionnaire_6(base_settings): """No. 6 tests collection for Questionnaire. Test File: cdshooksguidanceresponse-questionnaire.json """ filename = ( base_settings["unittest_data_dir"] / "cdshooksguidanceresponse-questionnaire.json" ) inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_6(inst2) def impl_questionnaire_7(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.experimental is False assert inst.id == "qs1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.item[0].item[0].linkId == "SearchParameter-display" assert inst.item[0].item[0].text == ( "In FHIR, search is not performed directly on a resource (by " "XML or JSON path), but on a named parameter that maps into " "the resource content." ) assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].linkId == "SearchParameter-flyover" assert inst.item[0].item[1].text == ( "A search parameter that defines a named search item that can" " be used to search/filter on a resource." ) assert inst.item[0].item[1].type == "display" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[2].extension[1].valueString == "string" assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].linkId == "SearchParameter.id-flyover" assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].item[1].linkId == "SearchParameter.id.value" assert inst.item[0].item[2].item[1].repeats is False assert inst.item[0].item[2].item[1].required is False assert inst.item[0].item[2].item[1].text == "Logical id of this artifact" assert inst.item[0].item[2].item[1].type == "string" assert inst.item[0].item[2].linkId == "SearchParameter.id" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[3].item[0].linkId == "SearchParameter.meta-flyover" assert inst.item[0].item[3].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content " "might not always be associated with version changes to the " "resource." ) assert inst.item[0].item[3].item[0].type == "display" assert inst.item[0].item[3].linkId == "SearchParameter.meta" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].text == "Metadata about the resource" assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "uri" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[4].item[0].linkId == "SearchParameter.implicitRules-flyover" ) assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].linkId == "SearchParameter.implicitRules.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert ( inst.item[0].item[4].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[4].item[1].type == "string" assert inst.item[0].item[4].linkId == "SearchParameter.implicitRules" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[5].extension[1].valueString == "code" assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].linkId == "SearchParameter.language-flyover" assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].item[1].linkId == "SearchParameter.language.value" assert inst.item[0].item[5].item[1].repeats is False assert inst.item[0].item[5].item[1].required is False assert inst.item[0].item[5].item[1].text == "language" assert inst.item[0].item[5].item[1].type == "choice" assert inst.item[0].item[5].linkId == "SearchParameter.language" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[6].extension[0].valueInteger == 1 assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[6].item[0].linkId == "SearchParameter.text-flyover" assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "SearchParameter.text" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert ( inst.item[0].item[6].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[7].item[0].linkId == "SearchParameter.contained-flyover" assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "SearchParameter.contained" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Contained, inline Resources" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[8].item[0].linkId == "SearchParameter.extension-flyover" assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "SearchParameter.extension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Additional content defined by implementations" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[9].item[0].linkId == "SearchParameter.modifierExtension-flyover" ) assert inst.item[0].item[9].item[0].type == "display" assert inst.item[0].item[9].linkId == "SearchParameter.modifierExtension" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].text == "Extensions that cannot be ignored" assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "SearchParameter" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == "Search parameter for a resource" assert inst.item[0].type == "group" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.publisher == "Health Level Seven International (FHIR Infrastructure)" assert inst.status == "draft" assert inst.version == "4.3.0" def test_questionnaire_7(base_settings): """No. 7 tests collection for Questionnaire. Test File: searchparameter-questionnaire.json """ filename = base_settings["unittest_data_dir"] / "searchparameter-questionnaire.json" inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_7(inst2) def impl_questionnaire_8(inst): assert inst.contained[0].id == "vs2" assert inst.contained[1].id == "vs3" assert inst.contained[2].id == "vs4" assert inst.contained[3].id == "vs5" assert inst.contained[4].id == "vs6" assert inst.contained[5].id == "vs7" assert inst.contained[6].id == "vs8" assert inst.contained[7].id == "vs9" assert inst.contained[8].id == "vs10" assert inst.contained[9].id == "vs11" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.experimental is False assert inst.id == "qs1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.item[0].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[0].linkId == "ExplanationOfBenefit-flyover" assert inst.item[0].item[0].text == ( "This resource provides: the claim details; adjudication " "details from the processing of a Claim; and optionally " "account balance information, for informing the subscriber of" " the benefits provided." ) assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[1].extension[0].valueInteger == 1 assert ( inst.item[0].item[1].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[1].extension[1].valueString == "string" assert ( inst.item[0].item[1].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].item[0].linkId == "ExplanationOfBenefit.id-flyover" assert inst.item[0].item[1].item[0].type == "display" assert inst.item[0].item[1].item[1].linkId == "ExplanationOfBenefit.id.value" assert inst.item[0].item[1].item[1].repeats is False assert inst.item[0].item[1].item[1].required is False assert inst.item[0].item[1].item[1].text == "Logical id of this artifact" assert inst.item[0].item[1].item[1].type == "string" assert inst.item[0].item[1].linkId == "ExplanationOfBenefit.id" assert inst.item[0].item[1].repeats is True assert inst.item[0].item[1].required is False assert inst.item[0].item[1].type == "group" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].linkId == "ExplanationOfBenefit.meta-flyover" assert inst.item[0].item[2].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content " "might not always be associated with version changes to the " "resource." ) assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].linkId == "ExplanationOfBenefit.meta" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].text == "Metadata about the resource" assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[3].extension[1].valueString == "uri" assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[3].item[0].linkId == "ExplanationOfBenefit.implicitRules-flyover" ) assert inst.item[0].item[3].item[0].type == "display" assert ( inst.item[0].item[3].item[1].linkId == "ExplanationOfBenefit.implicitRules.value" ) assert inst.item[0].item[3].item[1].repeats is False assert inst.item[0].item[3].item[1].required is False assert ( inst.item[0].item[3].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[3].item[1].type == "string" assert inst.item[0].item[3].linkId == "ExplanationOfBenefit.implicitRules" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "code" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[4].item[0].linkId == "ExplanationOfBenefit.language-flyover" ) assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].linkId == "ExplanationOfBenefit.language.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert inst.item[0].item[4].item[1].text == "language" assert inst.item[0].item[4].item[1].type == "choice" assert inst.item[0].item[4].linkId == "ExplanationOfBenefit.language" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].linkId == "ExplanationOfBenefit.text-flyover" assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].linkId == "ExplanationOfBenefit.text" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert ( inst.item[0].item[5].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[6].item[0].linkId == "ExplanationOfBenefit.contained-flyover" ) assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "ExplanationOfBenefit.contained" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert inst.item[0].item[6].text == "Contained, inline Resources" assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[7].item[0].linkId == "ExplanationOfBenefit.extension-flyover" ) assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "ExplanationOfBenefit.extension" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Additional content defined by implementations" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[8].item[0].linkId == "ExplanationOfBenefit.modifierExtension-flyover" ) assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "ExplanationOfBenefit.modifierExtension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Extensions that cannot be ignored" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[9].extension[0].valueString == "Identifier" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[9].item[0].linkId == "ExplanationOfBenefit.identifier-flyover" ) assert ( inst.item[0].item[9].item[0].text == "A unique identifier assigned to this explanation of benefit." ) assert inst.item[0].item[9].item[0].type == "display" assert ( inst.item[0].item[9].item[1].linkId == "ExplanationOfBenefit.identifier.label" ) assert inst.item[0].item[9].item[1].repeats is False assert inst.item[0].item[9].item[1].required is False assert inst.item[0].item[9].item[1].text == "label:" assert inst.item[0].item[9].item[1].type == "string" assert ( inst.item[0].item[9].item[2].linkId == "ExplanationOfBenefit.identifier.system" ) assert inst.item[0].item[9].item[2].repeats is False assert inst.item[0].item[9].item[2].required is False assert inst.item[0].item[9].item[2].text == "system:" assert inst.item[0].item[9].item[2].type == "string" assert ( inst.item[0].item[9].item[3].linkId == "ExplanationOfBenefit.identifier.value" ) assert inst.item[0].item[9].item[3].repeats is False assert inst.item[0].item[9].item[3].required is False assert inst.item[0].item[9].item[3].text == "value:" assert inst.item[0].item[9].item[3].type == "string" assert inst.item[0].item[9].linkId == "ExplanationOfBenefit.identifier" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].text == "Business Identifier for the resource" assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "ExplanationOfBenefit" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == "Explanation of Benefit resource" assert inst.item[0].type == "group" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.publisher == "Health Level Seven International (Financial Management)" assert inst.status == "draft" assert inst.version == "4.3.0" def test_questionnaire_8(base_settings): """No. 8 tests collection for Questionnaire. Test File: explanationofbenefit-questionnaire.json """ filename = ( base_settings["unittest_data_dir"] / "explanationofbenefit-questionnaire.json" ) inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_8(inst2) def impl_questionnaire_9(inst): assert inst.contained[0].id == "vs2" assert inst.contained[1].id == "vs3" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.experimental is False assert inst.id == "qs1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.item[0].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[0].linkId == "ImmunizationEvaluation-flyover" assert inst.item[0].item[0].text == ( "Describes a comparison of an immunization event against " "published recommendations to determine if the administration" ' is "valid" in relation to those recommendations.' ) assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[1].extension[0].valueInteger == 1 assert ( inst.item[0].item[1].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[1].extension[1].valueString == "string" assert ( inst.item[0].item[1].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].item[0].linkId == "ImmunizationEvaluation.id-flyover" assert inst.item[0].item[1].item[0].type == "display" assert inst.item[0].item[1].item[1].linkId == "ImmunizationEvaluation.id.value" assert inst.item[0].item[1].item[1].repeats is False assert inst.item[0].item[1].item[1].required is False assert inst.item[0].item[1].item[1].text == "Logical id of this artifact" assert inst.item[0].item[1].item[1].type == "string" assert inst.item[0].item[1].linkId == "ImmunizationEvaluation.id" assert inst.item[0].item[1].repeats is True assert inst.item[0].item[1].required is False assert inst.item[0].item[1].type == "group" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].linkId == "ImmunizationEvaluation.meta-flyover" assert inst.item[0].item[2].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content " "might not always be associated with version changes to the " "resource." ) assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].linkId == "ImmunizationEvaluation.meta" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].text == "Metadata about the resource" assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[3].extension[1].valueString == "uri" assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[3].item[0].linkId == "ImmunizationEvaluation.implicitRules-flyover" ) assert inst.item[0].item[3].item[0].type == "display" assert ( inst.item[0].item[3].item[1].linkId == "ImmunizationEvaluation.implicitRules.value" ) assert inst.item[0].item[3].item[1].repeats is False assert inst.item[0].item[3].item[1].required is False assert ( inst.item[0].item[3].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[3].item[1].type == "string" assert inst.item[0].item[3].linkId == "ImmunizationEvaluation.implicitRules" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "code" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[4].item[0].linkId == "ImmunizationEvaluation.language-flyover" ) assert inst.item[0].item[4].item[0].type == "display" assert ( inst.item[0].item[4].item[1].linkId == "ImmunizationEvaluation.language.value" ) assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert inst.item[0].item[4].item[1].text == "language" assert inst.item[0].item[4].item[1].type == "choice" assert inst.item[0].item[4].linkId == "ImmunizationEvaluation.language" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].linkId == "ImmunizationEvaluation.text-flyover" assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].linkId == "ImmunizationEvaluation.text" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert ( inst.item[0].item[5].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[6].item[0].linkId == "ImmunizationEvaluation.contained-flyover" ) assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "ImmunizationEvaluation.contained" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert inst.item[0].item[6].text == "Contained, inline Resources" assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[7].item[0].linkId == "ImmunizationEvaluation.extension-flyover" ) assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "ImmunizationEvaluation.extension" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Additional content defined by implementations" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[8].item[0].linkId == "ImmunizationEvaluation.modifierExtension-flyover" ) assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "ImmunizationEvaluation.modifierExtension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Extensions that cannot be ignored" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[9].extension[0].valueString == "Identifier" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[9].item[0].linkId == "ImmunizationEvaluation.identifier-flyover" ) assert inst.item[0].item[9].item[0].text == ( "A unique identifier assigned to this immunization evaluation" " record." ) assert inst.item[0].item[9].item[0].type == "display" assert ( inst.item[0].item[9].item[1].linkId == "ImmunizationEvaluation.identifier.label" ) assert inst.item[0].item[9].item[1].repeats is False assert inst.item[0].item[9].item[1].required is False assert inst.item[0].item[9].item[1].text == "label:" assert inst.item[0].item[9].item[1].type == "string" assert ( inst.item[0].item[9].item[2].linkId == "ImmunizationEvaluation.identifier.system" ) assert inst.item[0].item[9].item[2].repeats is False assert inst.item[0].item[9].item[2].required is False assert inst.item[0].item[9].item[2].text == "system:" assert inst.item[0].item[9].item[2].type == "string" assert ( inst.item[0].item[9].item[3].linkId == "ImmunizationEvaluation.identifier.value" ) assert inst.item[0].item[9].item[3].repeats is False assert inst.item[0].item[9].item[3].required is False assert inst.item[0].item[9].item[3].text == "value:" assert inst.item[0].item[9].item[3].type == "string" assert inst.item[0].item[9].linkId == "ImmunizationEvaluation.identifier" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].text == "Business identifier" assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "ImmunizationEvaluation" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == "Immunization evaluation information" assert inst.item[0].type == "group" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.publisher == ( "Health Level Seven International (Public Health and " "Emergency Response)" ) assert inst.status == "draft" assert inst.version == "4.3.0" def test_questionnaire_9(base_settings): """No. 9 tests collection for Questionnaire. Test File: immunizationevaluation-questionnaire.json """ filename = ( base_settings["unittest_data_dir"] / "immunizationevaluation-questionnaire.json" ) inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_9(inst2) def impl_questionnaire_10(inst): assert inst.contained[0].id == "vs2" assert inst.contained[1].id == "vs3" assert inst.contained[2].id == "vs4" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.experimental is False assert inst.id == "qs1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.item[0].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[0].linkId == "CoverageEligibilityResponse-flyover" assert inst.item[0].item[0].text == ( "This resource provides eligibility and plan details from the" " processing of an CoverageEligibilityRequest resource." ) assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[1].extension[0].valueInteger == 1 assert ( inst.item[0].item[1].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[1].extension[1].valueString == "string" assert ( inst.item[0].item[1].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[1].item[0].linkId == "CoverageEligibilityResponse.id-flyover" ) assert inst.item[0].item[1].item[0].type == "display" assert inst.item[0].item[1].item[1].linkId == "CoverageEligibilityResponse.id.value" assert inst.item[0].item[1].item[1].repeats is False assert inst.item[0].item[1].item[1].required is False assert inst.item[0].item[1].item[1].text == "Logical id of this artifact" assert inst.item[0].item[1].item[1].type == "string" assert inst.item[0].item[1].linkId == "CoverageEligibilityResponse.id" assert inst.item[0].item[1].repeats is True assert inst.item[0].item[1].required is False assert inst.item[0].item[1].type == "group" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[2].item[0].linkId == "CoverageEligibilityResponse.meta-flyover" ) assert inst.item[0].item[2].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content " "might not always be associated with version changes to the " "resource." ) assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].linkId == "CoverageEligibilityResponse.meta" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].text == "Metadata about the resource" assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[3].extension[1].valueString == "uri" assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[3].item[0].linkId == "CoverageEligibilityResponse.implicitRules-flyover" ) assert inst.item[0].item[3].item[0].type == "display" assert ( inst.item[0].item[3].item[1].linkId == "CoverageEligibilityResponse.implicitRules.value" ) assert inst.item[0].item[3].item[1].repeats is False assert inst.item[0].item[3].item[1].required is False assert ( inst.item[0].item[3].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[3].item[1].type == "string" assert inst.item[0].item[3].linkId == "CoverageEligibilityResponse.implicitRules" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "code" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[4].item[0].linkId == "CoverageEligibilityResponse.language-flyover" ) assert inst.item[0].item[4].item[0].type == "display" assert ( inst.item[0].item[4].item[1].linkId == "CoverageEligibilityResponse.language.value" ) assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert inst.item[0].item[4].item[1].text == "language" assert inst.item[0].item[4].item[1].type == "choice" assert inst.item[0].item[4].linkId == "CoverageEligibilityResponse.language" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[5].item[0].linkId == "CoverageEligibilityResponse.text-flyover" ) assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].linkId == "CoverageEligibilityResponse.text" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert ( inst.item[0].item[5].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[6].item[0].linkId == "CoverageEligibilityResponse.contained-flyover" ) assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "CoverageEligibilityResponse.contained" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert inst.item[0].item[6].text == "Contained, inline Resources" assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[7].item[0].linkId == "CoverageEligibilityResponse.extension-flyover" ) assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "CoverageEligibilityResponse.extension" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Additional content defined by implementations" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[8].item[0].linkId == "CoverageEligibilityResponse.modifierExtension-flyover" ) assert inst.item[0].item[8].item[0].type == "display" assert ( inst.item[0].item[8].linkId == "CoverageEligibilityResponse.modifierExtension" ) assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Extensions that cannot be ignored" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[9].extension[0].valueString == "Identifier" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[9].item[0].linkId == "CoverageEligibilityResponse.identifier-flyover" ) assert inst.item[0].item[9].item[0].text == ( "A unique identifier assigned to this coverage eligiblity " "request." ) assert inst.item[0].item[9].item[0].type == "display" assert ( inst.item[0].item[9].item[1].linkId == "CoverageEligibilityResponse.identifier.label" ) assert inst.item[0].item[9].item[1].repeats is False assert inst.item[0].item[9].item[1].required is False assert inst.item[0].item[9].item[1].text == "label:" assert inst.item[0].item[9].item[1].type == "string" assert ( inst.item[0].item[9].item[2].linkId == "CoverageEligibilityResponse.identifier.system" ) assert inst.item[0].item[9].item[2].repeats is False assert inst.item[0].item[9].item[2].required is False assert inst.item[0].item[9].item[2].text == "system:" assert inst.item[0].item[9].item[2].type == "string" assert ( inst.item[0].item[9].item[3].linkId == "CoverageEligibilityResponse.identifier.value" ) assert inst.item[0].item[9].item[3].repeats is False assert inst.item[0].item[9].item[3].required is False assert inst.item[0].item[9].item[3].text == "value:" assert inst.item[0].item[9].item[3].type == "string" assert inst.item[0].item[9].linkId == "CoverageEligibilityResponse.identifier" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert ( inst.item[0].item[9].text == "Business Identifier for coverage eligiblity request" ) assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "CoverageEligibilityResponse" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == "CoverageEligibilityResponse resource" assert inst.item[0].type == "group" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.publisher == "Health Level Seven International (Financial Management)" assert inst.status == "draft" assert inst.version == "4.3.0" def test_questionnaire_10(base_settings): """No. 10 tests collection for Questionnaire. Test File: coverageeligibilityresponse-questionnaire.json """ filename = ( base_settings["unittest_data_dir"] / "coverageeligibilityresponse-questionnaire.json" ) inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_questionnaireresponse.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import questionnaireresponse from .conftest import ExternalValidatorModel # noqa: F401 def impl_questionnaireresponse_1(inst): assert inst.author.reference == "#questauth" assert ( inst.authored == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-02-19T14:15:00-05:00"} ).valueDateTime ) assert inst.basedOn[0].reference == "#order" assert inst.contained[0].id == "patsub" assert inst.contained[1].id == "order" assert inst.contained[2].id == "questauth" assert inst.encounter.reference == "Encounter/example" assert inst.id == "3141" assert ( inst.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/NamingSystem/questionnaire-ids"} ).valueUri ) assert inst.identifier.value == "Q12349876" assert ( inst.item[0].item[0].answer[0].item[0].item[0].answer[0].valueCoding.code == "1" ) assert ( inst.item[0].item[0].answer[0].item[0].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://cancer.questionnaire.org/system/code/yesno"} ).valueUri ) assert inst.item[0].item[0].answer[0].item[0].item[0].linkId == "1.1.1.1" assert ( inst.item[0].item[0].answer[0].item[0].item[1].answer[0].valueCoding.code == "1" ) assert ( inst.item[0].item[0].answer[0].item[0].item[1].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://cancer.questionnaire.org/system/code/yesno"} ).valueUri ) assert inst.item[0].item[0].answer[0].item[0].item[1].linkId == "1.1.1.2" assert ( inst.item[0].item[0].answer[0].item[0].item[2].answer[0].valueCoding.code == "0" ) assert ( inst.item[0].item[0].answer[0].item[0].item[2].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://cancer.questionnaire.org/system/code/yesno"} ).valueUri ) assert inst.item[0].item[0].answer[0].item[0].item[2].linkId == "1.1.1.3" assert inst.item[0].item[0].answer[0].item[0].linkId == "1.1.1" assert inst.item[0].item[0].answer[0].valueCoding.code == "1" assert inst.item[0].item[0].answer[0].valueCoding.display == "Yes" assert ( inst.item[0].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://cancer.questionnaire.org/system/code/yesno"} ).valueUri ) assert inst.item[0].item[0].linkId == "1.1" assert inst.item[0].linkId == "1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.partOf[0].reference == "Procedure/f201" assert inst.status == "completed" assert inst.subject.reference == "#patsub" assert inst.text.status == "generated" def test_questionnaireresponse_1(base_settings): """No. 1 tests collection for QuestionnaireResponse. Test File: questionnaireresponse-example.json """ filename = base_settings["unittest_data_dir"] / "questionnaireresponse-example.json" inst = questionnaireresponse.QuestionnaireResponse.model_validate_json( filename.read_bytes() ) assert "QuestionnaireResponse" == inst.get_resource_type() impl_questionnaireresponse_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "QuestionnaireResponse" == data["resourceType"] inst2 = questionnaireresponse.QuestionnaireResponse(**data) impl_questionnaireresponse_1(inst2) def impl_questionnaireresponse_2(inst): assert ( inst.authored == ExternalValidatorModel.model_validate( {"valueDateTime": "2008-01-17"} ).valueDateTime ) assert inst.id == "ussg-fht-answers" assert ( inst.item[0].item[0].answer[0].valueDate == ExternalValidatorModel.model_validate({"valueDate": "2008-01-17"}).valueDate ) assert inst.item[0].item[0].linkId == "0.1" assert inst.item[0].item[0].text == "Date Done" assert inst.item[0].linkId == "0" assert ( inst.item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54126-8"} ).valueUri ) assert inst.item[1].item[0].item[0].answer[0].valueString == "Annie Proband" assert ( inst.item[1].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54125-0"} ).valueUri ) assert inst.item[1].item[0].item[0].linkId == "1.1.1" assert inst.item[1].item[0].item[0].text == "Name" assert inst.item[1].item[0].item[1].answer[0].valueCoding.code == "LA3-6" assert inst.item[1].item[0].item[1].answer[0].valueCoding.display == "Female" assert ( inst.item[1].item[0].item[1].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[1].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54131-8"} ).valueUri ) assert inst.item[1].item[0].item[1].linkId == "1.1.2" assert inst.item[1].item[0].item[1].text == "Gender" assert ( inst.item[1].item[0].item[2].answer[0].valueDate == ExternalValidatorModel.model_validate({"valueDate": "1966-04-04"}).valueDate ) assert ( inst.item[1].item[0].item[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/21112-8"} ).valueUri ) assert inst.item[1].item[0].item[2].linkId == "1.1.3" assert inst.item[1].item[0].item[2].text == "Date of Birth" assert inst.item[1].item[0].item[3].answer[0].valueCoding.code == "LA32-8" assert inst.item[1].item[0].item[3].answer[0].valueCoding.display == "No" assert ( inst.item[1].item[0].item[3].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[1].item[0].item[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54132-6"} ).valueUri ) assert inst.item[1].item[0].item[3].linkId == "1.1.4" assert inst.item[1].item[0].item[3].text == "Were you born a twin?" assert inst.item[1].item[0].item[4].answer[0].valueCoding.code == "LA32-8" assert inst.item[1].item[0].item[4].answer[0].valueCoding.display == "No" assert ( inst.item[1].item[0].item[4].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[1].item[0].item[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54128-4"} ).valueUri ) assert inst.item[1].item[0].item[4].linkId == "1.1.5" assert inst.item[1].item[0].item[4].text == "Were you adopted?" assert inst.item[1].item[0].item[5].answer[0].valueCoding.code == "LA32-8" assert inst.item[1].item[0].item[5].answer[0].valueCoding.display == "No" assert ( inst.item[1].item[0].item[5].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[1].item[0].item[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54135-9"} ).valueUri ) assert inst.item[1].item[0].item[5].linkId == "1.1.6" assert inst.item[1].item[0].item[5].text == ( "Are your parents related to each other in any way other than" " marriage?" ) assert ( inst.item[1] .item[0] .item[6] .answer[0] .item[0] .item[0] .answer[0] .valueCoding.code == "[in_i]" ) assert ( inst.item[1] .item[0] .item[6] .answer[0] .item[0] .item[0] .answer[0] .valueCoding.display == "inches" ) assert ( inst.item[1] .item[0] .item[6] .answer[0] .item[0] .item[0] .answer[0] .valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.item[1].item[0].item[6].answer[0].item[0].item[0].linkId == "1.1.7.1.1" assert inst.item[1].item[0].item[6].answer[0].item[0].item[0].text == "Units" assert inst.item[1].item[0].item[6].answer[0].item[0].linkId == "1.1.7.1" assert float(inst.item[1].item[0].item[6].answer[0].valueDecimal) == float(63) assert ( inst.item[1].item[0].item[6].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/8302-2"} ).valueUri ) assert inst.item[1].item[0].item[6].linkId == "1.1.7" assert inst.item[1].item[0].item[6].text == "Height" assert ( inst.item[1] .item[0] .item[7] .answer[0] .item[0] .item[0] .answer[0] .valueCoding.code == "[lb_av]" ) assert ( inst.item[1] .item[0] .item[7] .answer[0] .item[0] .item[0] .answer[0] .valueCoding.display == "pounds" ) assert ( inst.item[1] .item[0] .item[7] .answer[0] .item[0] .item[0] .answer[0] .valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.item[1].item[0].item[7].answer[0].item[0].item[0].linkId == "1.1.8.1.1" assert inst.item[1].item[0].item[7].answer[0].item[0].item[0].text == "Units" assert inst.item[1].item[0].item[7].answer[0].item[0].linkId == "1.1.8.1" assert float(inst.item[1].item[0].item[7].answer[0].valueDecimal) == float(127) assert ( inst.item[1].item[0].item[7].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/29463-7"} ).valueUri ) assert inst.item[1].item[0].item[7].linkId == "1.1.8" assert inst.item[1].item[0].item[7].text == "Weight" assert float(inst.item[1].item[0].item[8].answer[0].valueDecimal) == float(22.5) assert ( inst.item[1].item[0].item[8].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/39156-5"} ).valueUri ) assert inst.item[1].item[0].item[8].linkId == "1.1.9" assert inst.item[1].item[0].item[8].text == "Body mass index (BMI) [Ratio]" assert inst.item[1].item[0].item[9].answer[0].valueCoding.code == "LA4457-3" assert inst.item[1].item[0].item[9].answer[0].valueCoding.display == "White" assert ( inst.item[1].item[0].item[9].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[1].item[0].item[9].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54134-2"} ).valueUri ) assert inst.item[1].item[0].item[9].linkId == "1.1.10" assert inst.item[1].item[0].item[9].text == "Race" assert inst.item[1].item[0].linkId == "1.1" assert inst.item[1].linkId == "1" assert inst.item[1].text == "Your health information" assert ( inst.item[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54114-4"} ).valueUri ) assert inst.item[2].item[0].item[0].answer[0].valueCoding.code == "LA10405-1" assert inst.item[2].item[0].item[0].answer[0].valueCoding.display == "Daughter" assert ( inst.item[2].item[0].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54136-7"} ).valueUri ) assert inst.item[2].item[0].item[0].linkId == "2.1.1.1" assert inst.item[2].item[0].item[0].text == "Relationship to you" assert inst.item[2].item[0].item[1].answer[0].valueString == "Susan" assert ( inst.item[2].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54138-3"} ).valueUri ) assert inst.item[2].item[0].item[1].linkId == "2.1.1.2" assert inst.item[2].item[0].item[1].text == "Name" assert inst.item[2].item[0].item[2].answer[0].valueCoding.code == "LA3-6" assert inst.item[2].item[0].item[2].answer[0].valueCoding.display == "Female" assert ( inst.item[2].item[0].item[2].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[0].item[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54123-5"} ).valueUri ) assert inst.item[2].item[0].item[2].linkId == "2.1.1.3" assert inst.item[2].item[0].item[2].text == "Gender" assert float( inst.item[2].item[0].item[3].answer[0].item[0].item[0].answer[0].valueDecimal ) == float(17) assert ( inst.item[2].item[0].item[3].answer[0].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54141-7"} ).valueUri ) assert ( inst.item[2].item[0].item[3].answer[0].item[0].item[0].linkId == "2.1.1.4.2.2" ) assert inst.item[2].item[0].item[3].answer[0].item[0].item[0].text == "Age" assert inst.item[2].item[0].item[3].answer[0].item[0].linkId == "2.1.1.4.2" assert inst.item[2].item[0].item[3].answer[0].valueCoding.code == "LA33-6" assert inst.item[2].item[0].item[3].answer[0].valueCoding.display == "Yes" assert ( inst.item[2].item[0].item[3].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[0].item[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54139-1"} ).valueUri ) assert inst.item[2].item[0].item[3].linkId == "2.1.1.4" assert inst.item[2].item[0].item[3].text == "Living?" assert inst.item[2].item[0].item[4].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[0].item[4].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[0].item[4].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[0].item[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54121-9"} ).valueUri ) assert inst.item[2].item[0].item[4].linkId == "2.1.1.5" assert inst.item[2].item[0].item[4].text == "Was this person born a twin?" assert inst.item[2].item[0].item[5].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[0].item[5].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[0].item[5].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[0].item[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54122-7"} ).valueUri ) assert inst.item[2].item[0].item[5].linkId == "2.1.1.6" assert inst.item[2].item[0].item[5].text == "Was this person adopted?" assert inst.item[2].item[0].linkId == "2.1" assert ( inst.item[2].item[1].item[0].item[0].answer[0].valueCoding.code == "LA10415-0" ) assert ( inst.item[2].item[1].item[0].item[0].answer[0].valueCoding.display == "Brother" ) assert ( inst.item[2].item[1].item[0].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[1].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54136-7"} ).valueUri ) assert inst.item[2].item[1].item[0].item[0].linkId == "2.1.1.1" assert inst.item[2].item[1].item[0].item[0].text == "Relationship to you" assert inst.item[2].item[1].item[0].item[1].answer[0].valueString == "Brian" assert ( inst.item[2].item[1].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54138-3"} ).valueUri ) assert inst.item[2].item[1].item[0].item[1].linkId == "2.1.1.2" assert inst.item[2].item[1].item[0].item[1].text == "Name" assert inst.item[2].item[1].item[0].item[2].answer[0].valueCoding.code == "LA2-8" assert inst.item[2].item[1].item[0].item[2].answer[0].valueCoding.display == "Male" assert ( inst.item[2].item[1].item[0].item[2].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[1].item[0].item[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54123-5"} ).valueUri ) assert inst.item[2].item[1].item[0].item[2].linkId == "2.1.1.3" assert inst.item[2].item[1].item[0].item[2].text == "Gender" assert float( inst.item[2] .item[1] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueDecimal ) == float(32) assert ( inst.item[2].item[1].item[0].item[3].answer[0].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54141-7"} ).valueUri ) assert ( inst.item[2].item[1].item[0].item[3].answer[0].item[0].item[0].linkId == "2.1.1.4.2.2" ) assert inst.item[2].item[1].item[0].item[3].answer[0].item[0].item[0].text == "Age" assert inst.item[2].item[1].item[0].item[3].answer[0].item[0].linkId == "2.1.1.4.2" assert inst.item[2].item[1].item[0].item[3].answer[0].valueCoding.code == "LA33-6" assert inst.item[2].item[1].item[0].item[3].answer[0].valueCoding.display == "Yes" assert ( inst.item[2].item[1].item[0].item[3].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[1].item[0].item[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54139-1"} ).valueUri ) assert inst.item[2].item[1].item[0].item[3].linkId == "2.1.1.4" assert inst.item[2].item[1].item[0].item[3].text == "Living?" assert inst.item[2].item[1].item[0].item[4].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[1].item[0].item[4].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[1].item[0].item[4].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[1].item[0].item[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54121-9"} ).valueUri ) assert inst.item[2].item[1].item[0].item[4].linkId == "2.1.1.5" assert inst.item[2].item[1].item[0].item[4].text == "Was this person born a twin?" assert inst.item[2].item[1].item[0].item[5].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[1].item[0].item[5].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[1].item[0].item[5].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[1].item[0].item[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54122-7"} ).valueUri ) assert inst.item[2].item[1].item[0].item[5].linkId == "2.1.1.6" assert inst.item[2].item[1].item[0].item[5].text == "Was this person adopted?" assert inst.item[2].item[1].item[0].linkId == "2.1.1" assert ( inst.item[2].item[1].item[1].item[0].answer[0].valueCoding.code == "LA10550-4" ) assert ( inst.item[2].item[1].item[1].item[0].answer[0].valueCoding.display == "-- Other Cancer" ) assert ( inst.item[2].item[1].item[1].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.item[2].item[1].item[1].item[0].linkId == "2.1.2.1" assert inst.item[2].item[1].item[1].item[0].text == "Disease or Condition" assert ( inst.item[2].item[1].item[1].item[1].answer[0].valueCoding.code == "LA10397-0" ) assert inst.item[2].item[1].item[1].item[1].answer[0].valueCoding.display == "30-39" assert ( inst.item[2].item[1].item[1].item[1].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.item[2].item[1].item[1].item[1].linkId == "2.1.2.2" assert inst.item[2].item[1].item[1].item[1].text == "Age at Diagnosis" assert inst.item[2].item[1].item[1].linkId == "2.1.2" assert ( inst.item[2].item[1].item[1].text == "This family member's history of disease" ) assert inst.item[2].item[1].linkId == "2.1" assert ( inst.item[2].item[2].item[0].item[0].answer[0].valueCoding.code == "LA10418-4" ) assert ( inst.item[2].item[2].item[0].item[0].answer[0].valueCoding.display == "Sister" ) assert ( inst.item[2].item[2].item[0].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[2].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54136-7"} ).valueUri ) assert inst.item[2].item[2].item[0].item[0].linkId == "2.1.1.1" assert inst.item[2].item[2].item[0].item[0].text == "Relationship to you" assert inst.item[2].item[2].item[0].item[1].answer[0].valueString == "Janet" assert ( inst.item[2].item[2].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54138-3"} ).valueUri ) assert inst.item[2].item[2].item[0].item[1].linkId == "2.1.1.2" assert inst.item[2].item[2].item[0].item[1].text == "Name" assert inst.item[2].item[2].item[0].item[2].answer[0].valueCoding.code == "LA3-6" assert ( inst.item[2].item[2].item[0].item[2].answer[0].valueCoding.display == "Female" ) assert ( inst.item[2].item[2].item[0].item[2].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[2].item[0].item[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54123-5"} ).valueUri ) assert inst.item[2].item[2].item[0].item[2].linkId == "2.1.1.3" assert inst.item[2].item[2].item[0].item[2].text == "Gender" assert float( inst.item[2] .item[2] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueDecimal ) == float(36) assert ( inst.item[2].item[2].item[0].item[3].answer[0].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54141-7"} ).valueUri ) assert ( inst.item[2].item[2].item[0].item[3].answer[0].item[0].item[0].linkId == "2.1.1.4.2.2" ) assert inst.item[2].item[2].item[0].item[3].answer[0].item[0].item[0].text == "Age" assert inst.item[2].item[2].item[0].item[3].answer[0].item[0].linkId == "2.1.1.4.2" assert inst.item[2].item[2].item[0].item[3].answer[0].valueCoding.code == "LA33-6" assert inst.item[2].item[2].item[0].item[3].answer[0].valueCoding.display == "Yes" assert ( inst.item[2].item[2].item[0].item[3].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[2].item[0].item[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54139-1"} ).valueUri ) assert inst.item[2].item[2].item[0].item[3].linkId == "2.1.1.4" assert inst.item[2].item[2].item[0].item[3].text == "Living?" assert inst.item[2].item[2].item[0].item[4].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[2].item[0].item[4].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[2].item[0].item[4].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[2].item[0].item[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54121-9"} ).valueUri ) assert inst.item[2].item[2].item[0].item[4].linkId == "2.1.1.5" assert inst.item[2].item[2].item[0].item[4].text == "Was this person born a twin?" assert inst.item[2].item[2].item[0].item[5].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[2].item[0].item[5].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[2].item[0].item[5].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[2].item[0].item[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54122-7"} ).valueUri ) assert inst.item[2].item[2].item[0].item[5].linkId == "2.1.1.6" assert inst.item[2].item[2].item[0].item[5].text == "Was this person adopted?" assert inst.item[2].item[2].item[0].linkId == "2.1.1" assert ( inst.item[2].item[2].item[1].item[0].answer[0].valueCoding.code == "LA10536-3" ) assert ( inst.item[2].item[2].item[1].item[0].answer[0].valueCoding.display == "-- Breast Cancer" ) assert ( inst.item[2].item[2].item[1].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.item[2].item[2].item[1].item[0].linkId == "2.1.2.1" assert inst.item[2].item[2].item[1].item[0].text == "Disease or Condition" assert ( inst.item[2].item[2].item[1].item[1].answer[0].valueCoding.code == "LA10397-0" ) assert inst.item[2].item[2].item[1].item[1].answer[0].valueCoding.display == "30-39" assert ( inst.item[2].item[2].item[1].item[1].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.item[2].item[2].item[1].item[1].linkId == "2.1.2.2" assert inst.item[2].item[2].item[1].item[1].text == "Age at Diagnosis" assert inst.item[2].item[2].item[1].linkId == "2.1.2" assert ( inst.item[2].item[2].item[1].text == "This family member's history of disease" ) assert inst.item[2].item[2].linkId == "2.1" assert ( inst.item[2].item[3].item[0].item[0].answer[0].valueCoding.code == "LA10419-2" ) assert ( inst.item[2].item[3].item[0].item[0].answer[0].valueCoding.display == "Nephew" ) assert ( inst.item[2].item[3].item[0].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[3].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54136-7"} ).valueUri ) assert inst.item[2].item[3].item[0].item[0].linkId == "2.1.1.1" assert inst.item[2].item[3].item[0].item[0].text == "Relationship to you" assert inst.item[2].item[3].item[0].item[1].answer[0].valueString == "Ian" assert ( inst.item[2].item[3].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54138-3"} ).valueUri ) assert inst.item[2].item[3].item[0].item[1].linkId == "2.1.1.2" assert inst.item[2].item[3].item[0].item[1].text == "Name" assert inst.item[2].item[3].item[0].item[2].answer[0].valueCoding.code == "LA2-8" assert inst.item[2].item[3].item[0].item[2].answer[0].valueCoding.display == "Male" assert ( inst.item[2].item[3].item[0].item[2].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[3].item[0].item[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54123-5"} ).valueUri ) assert inst.item[2].item[3].item[0].item[2].linkId == "2.1.1.3" assert inst.item[2].item[3].item[0].item[2].text == "Gender" assert float( inst.item[2] .item[3] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueDecimal ) == float(16) assert ( inst.item[2].item[3].item[0].item[3].answer[0].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54141-7"} ).valueUri ) assert ( inst.item[2].item[3].item[0].item[3].answer[0].item[0].item[0].linkId == "2.1.1.4.2.2" ) assert inst.item[2].item[3].item[0].item[3].answer[0].item[0].item[0].text == "Age" assert inst.item[2].item[3].item[0].item[3].answer[0].item[0].linkId == "2.1.1.4.2" assert inst.item[2].item[3].item[0].item[3].answer[0].valueCoding.code == "LA33-6" assert inst.item[2].item[3].item[0].item[3].answer[0].valueCoding.display == "Yes" assert ( inst.item[2].item[3].item[0].item[3].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[3].item[0].item[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54139-1"} ).valueUri ) assert inst.item[2].item[3].item[0].item[3].linkId == "2.1.1.4" assert inst.item[2].item[3].item[0].item[3].text == "Living?" assert inst.item[2].item[3].item[0].item[4].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[3].item[0].item[4].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[3].item[0].item[4].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[3].item[0].item[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54121-9"} ).valueUri ) assert inst.item[2].item[3].item[0].item[4].linkId == "2.1.1.5" assert inst.item[2].item[3].item[0].item[4].text == "Was this person born a twin?" assert inst.item[2].item[3].item[0].item[5].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[3].item[0].item[5].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[3].item[0].item[5].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[3].item[0].item[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54122-7"} ).valueUri ) assert inst.item[2].item[3].item[0].item[5].linkId == "2.1.1.6" assert inst.item[2].item[3].item[0].item[5].text == "Was this person adopted?" assert inst.item[2].item[3].item[0].linkId == "2.1.1" assert inst.item[2].item[3].linkId == "2.1" assert ( inst.item[2].item[4].item[0].item[0].answer[0].valueCoding.code == "LA10420-0" ) assert inst.item[2].item[4].item[0].item[0].answer[0].valueCoding.display == "Niece" assert ( inst.item[2].item[4].item[0].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[4].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54136-7"} ).valueUri ) assert inst.item[2].item[4].item[0].item[0].linkId == "2.1.1.1" assert inst.item[2].item[4].item[0].item[0].text == "Relationship to you" assert inst.item[2].item[4].item[0].item[1].answer[0].valueString == "Helen" assert ( inst.item[2].item[4].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54138-3"} ).valueUri ) assert inst.item[2].item[4].item[0].item[1].linkId == "2.1.1.2" assert inst.item[2].item[4].item[0].item[1].text == "Name" assert inst.item[2].item[4].item[0].item[2].answer[0].valueCoding.code == "LA3-6" assert ( inst.item[2].item[4].item[0].item[2].answer[0].valueCoding.display == "Female" ) assert ( inst.item[2].item[4].item[0].item[2].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[4].item[0].item[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54123-5"} ).valueUri ) assert inst.item[2].item[4].item[0].item[2].linkId == "2.1.1.3" assert inst.item[2].item[4].item[0].item[2].text == "Gender" assert float( inst.item[2] .item[4] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueDecimal ) == float(15) assert ( inst.item[2].item[4].item[0].item[3].answer[0].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54141-7"} ).valueUri ) assert ( inst.item[2].item[4].item[0].item[3].answer[0].item[0].item[0].linkId == "2.1.1.4.2.2" ) assert inst.item[2].item[4].item[0].item[3].answer[0].item[0].item[0].text == "Age" assert inst.item[2].item[4].item[0].item[3].answer[0].item[0].linkId == "2.1.1.4.2" assert inst.item[2].item[4].item[0].item[3].answer[0].valueCoding.code == "LA33-6" assert inst.item[2].item[4].item[0].item[3].answer[0].valueCoding.display == "Yes" assert ( inst.item[2].item[4].item[0].item[3].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[4].item[0].item[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54139-1"} ).valueUri ) assert inst.item[2].item[4].item[0].item[3].linkId == "2.1.1.4" assert inst.item[2].item[4].item[0].item[3].text == "Living?" assert inst.item[2].item[4].item[0].item[4].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[4].item[0].item[4].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[4].item[0].item[4].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[4].item[0].item[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54121-9"} ).valueUri ) assert inst.item[2].item[4].item[0].item[4].linkId == "2.1.1.5" assert inst.item[2].item[4].item[0].item[4].text == "Was this person born a twin?" assert inst.item[2].item[4].item[0].item[5].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[4].item[0].item[5].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[4].item[0].item[5].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[4].item[0].item[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54122-7"} ).valueUri ) assert inst.item[2].item[4].item[0].item[5].linkId == "2.1.1.6" assert inst.item[2].item[4].item[0].item[5].text == "Was this person adopted?" assert inst.item[2].item[4].item[0].linkId == "2.1.1" assert inst.item[2].item[4].linkId == "2.1" assert ( inst.item[2].item[5].item[0].item[0].answer[0].valueCoding.code == "LA10416-8" ) assert ( inst.item[2].item[5].item[0].item[0].answer[0].valueCoding.display == "Father" ) assert ( inst.item[2].item[5].item[0].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[5].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54136-7"} ).valueUri ) assert inst.item[2].item[5].item[0].item[0].linkId == "2.1.1.1" assert inst.item[2].item[5].item[0].item[0].text == "Relationship to you" assert inst.item[2].item[5].item[0].item[1].answer[0].valueString == "Donald" assert ( inst.item[2].item[5].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54138-3"} ).valueUri ) assert inst.item[2].item[5].item[0].item[1].linkId == "2.1.1.2" assert inst.item[2].item[5].item[0].item[1].text == "Name" assert inst.item[2].item[5].item[0].item[2].answer[0].valueCoding.code == "LA2-8" assert inst.item[2].item[5].item[0].item[2].answer[0].valueCoding.display == "Male" assert ( inst.item[2].item[5].item[0].item[2].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[5].item[0].item[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54123-5"} ).valueUri ) assert inst.item[2].item[5].item[0].item[2].linkId == "2.1.1.3" assert inst.item[2].item[5].item[0].item[2].text == "Gender" assert float( inst.item[2] .item[5] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueDecimal ) == float(52) assert ( inst.item[2].item[5].item[0].item[3].answer[0].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54141-7"} ).valueUri ) assert ( inst.item[2].item[5].item[0].item[3].answer[0].item[0].item[0].linkId == "2.1.1.4.2.2" ) assert inst.item[2].item[5].item[0].item[3].answer[0].item[0].item[0].text == "Age" assert inst.item[2].item[5].item[0].item[3].answer[0].item[0].linkId == "2.1.1.4.2" assert inst.item[2].item[5].item[0].item[3].answer[0].valueCoding.code == "LA33-6" assert inst.item[2].item[5].item[0].item[3].answer[0].valueCoding.display == "Yes" assert ( inst.item[2].item[5].item[0].item[3].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[5].item[0].item[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54139-1"} ).valueUri ) assert inst.item[2].item[5].item[0].item[3].linkId == "2.1.1.4" assert inst.item[2].item[5].item[0].item[3].text == "Living?" assert inst.item[2].item[5].item[0].item[4].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[5].item[0].item[4].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[5].item[0].item[4].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[5].item[0].item[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54121-9"} ).valueUri ) assert inst.item[2].item[5].item[0].item[4].linkId == "2.1.1.5" assert inst.item[2].item[5].item[0].item[4].text == "Was this person born a twin?" assert inst.item[2].item[5].item[0].item[5].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[5].item[0].item[5].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[5].item[0].item[5].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[5].item[0].item[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54122-7"} ).valueUri ) assert inst.item[2].item[5].item[0].item[5].linkId == "2.1.1.6" assert inst.item[2].item[5].item[0].item[5].text == "Was this person adopted?" assert inst.item[2].item[5].item[0].linkId == "2.1.1" assert inst.item[2].item[5].linkId == "2.1" assert ( inst.item[2].item[6].item[0].item[0].answer[0].valueCoding.code == "LA10425-9" ) assert ( inst.item[2].item[6].item[0].item[0].answer[0].valueCoding.display == "Paternal Uncle" ) assert ( inst.item[2].item[6].item[0].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[6].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54136-7"} ).valueUri ) assert inst.item[2].item[6].item[0].item[0].linkId == "2.1.1.1" assert inst.item[2].item[6].item[0].item[0].text == "Relationship to you" assert inst.item[2].item[6].item[0].item[1].answer[0].valueString == "Eric" assert ( inst.item[2].item[6].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54138-3"} ).valueUri ) assert inst.item[2].item[6].item[0].item[1].linkId == "2.1.1.2" assert inst.item[2].item[6].item[0].item[1].text == "Name" assert inst.item[2].item[6].item[0].item[2].answer[0].valueCoding.code == "LA2-8" assert inst.item[2].item[6].item[0].item[2].answer[0].valueCoding.display == "Male" assert ( inst.item[2].item[6].item[0].item[2].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[6].item[0].item[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54123-5"} ).valueUri ) assert inst.item[2].item[6].item[0].item[2].linkId == "2.1.1.3" assert inst.item[2].item[6].item[0].item[2].text == "Gender" assert float( inst.item[2] .item[6] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueDecimal ) == float(56) assert ( inst.item[2].item[6].item[0].item[3].answer[0].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54141-7"} ).valueUri ) assert ( inst.item[2].item[6].item[0].item[3].answer[0].item[0].item[0].linkId == "2.1.1.4.2.2" ) assert inst.item[2].item[6].item[0].item[3].answer[0].item[0].item[0].text == "Age" assert inst.item[2].item[6].item[0].item[3].answer[0].item[0].linkId == "2.1.1.4.2" assert inst.item[2].item[6].item[0].item[3].answer[0].valueCoding.code == "LA33-6" assert inst.item[2].item[6].item[0].item[3].answer[0].valueCoding.display == "Yes" assert ( inst.item[2].item[6].item[0].item[3].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[6].item[0].item[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54139-1"} ).valueUri ) assert inst.item[2].item[6].item[0].item[3].linkId == "2.1.1.4" assert inst.item[2].item[6].item[0].item[3].text == "Living?" assert inst.item[2].item[6].item[0].item[4].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[6].item[0].item[4].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[6].item[0].item[4].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[6].item[0].item[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54121-9"} ).valueUri ) assert inst.item[2].item[6].item[0].item[4].linkId == "2.1.1.5" assert inst.item[2].item[6].item[0].item[4].text == "Was this person born a twin?" assert inst.item[2].item[6].item[0].item[5].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[6].item[0].item[5].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[6].item[0].item[5].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[6].item[0].item[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54122-7"} ).valueUri ) assert inst.item[2].item[6].item[0].item[5].linkId == "2.1.1.6" assert inst.item[2].item[6].item[0].item[5].text == "Was this person adopted?" assert inst.item[2].item[6].item[0].linkId == "2.1.1" assert inst.item[2].item[6].linkId == "2.1" assert ( inst.item[2].item[7].item[0].item[0].answer[0].valueCoding.code == "LA10421-8" ) assert ( inst.item[2].item[7].item[0].item[0].answer[0].valueCoding.display == "Paternal Aunt" ) assert ( inst.item[2].item[7].item[0].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[7].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54136-7"} ).valueUri ) assert inst.item[2].item[7].item[0].item[0].linkId == "2.1.1.1" assert inst.item[2].item[7].item[0].item[0].text == "Relationship to you" assert inst.item[2].item[7].item[0].item[1].answer[0].valueString == "Fiona" assert ( inst.item[2].item[7].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54138-3"} ).valueUri ) assert inst.item[2].item[7].item[0].item[1].linkId == "2.1.1.2" assert inst.item[2].item[7].item[0].item[1].text == "Name" assert inst.item[2].item[7].item[0].item[2].answer[0].valueCoding.code == "LA3-6" assert ( inst.item[2].item[7].item[0].item[2].answer[0].valueCoding.display == "Female" ) assert ( inst.item[2].item[7].item[0].item[2].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[7].item[0].item[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54123-5"} ).valueUri ) assert inst.item[2].item[7].item[0].item[2].linkId == "2.1.1.3" assert inst.item[2].item[7].item[0].item[2].text == "Gender" assert float( inst.item[2] .item[7] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueDecimal ) == float(57) assert ( inst.item[2].item[7].item[0].item[3].answer[0].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54141-7"} ).valueUri ) assert ( inst.item[2].item[7].item[0].item[3].answer[0].item[0].item[0].linkId == "2.1.1.4.2.2" ) assert inst.item[2].item[7].item[0].item[3].answer[0].item[0].item[0].text == "Age" assert inst.item[2].item[7].item[0].item[3].answer[0].item[0].linkId == "2.1.1.4.2" assert inst.item[2].item[7].item[0].item[3].answer[0].valueCoding.code == "LA33-6" assert inst.item[2].item[7].item[0].item[3].answer[0].valueCoding.display == "Yes" assert ( inst.item[2].item[7].item[0].item[3].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[7].item[0].item[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54139-1"} ).valueUri ) assert inst.item[2].item[7].item[0].item[3].linkId == "2.1.1.4" assert inst.item[2].item[7].item[0].item[3].text == "Living?" assert inst.item[2].item[7].item[0].item[4].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[7].item[0].item[4].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[7].item[0].item[4].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[7].item[0].item[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54121-9"} ).valueUri ) assert inst.item[2].item[7].item[0].item[4].linkId == "2.1.1.5" assert inst.item[2].item[7].item[0].item[4].text == "Was this person born a twin?" assert inst.item[2].item[7].item[0].item[5].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[7].item[0].item[5].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[7].item[0].item[5].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[7].item[0].item[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54122-7"} ).valueUri ) assert inst.item[2].item[7].item[0].item[5].linkId == "2.1.1.6" assert inst.item[2].item[7].item[0].item[5].text == "Was this person adopted?" assert inst.item[2].item[7].item[0].linkId == "2.1.1" assert ( inst.item[2].item[7].item[1].item[0].answer[0].valueCoding.code == "LA10543-9" ) assert ( inst.item[2].item[7].item[1].item[0].answer[0].valueCoding.display == "-- Skin Cancer" ) assert ( inst.item[2].item[7].item[1].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.item[2].item[7].item[1].item[0].linkId == "2.1.2.1" assert inst.item[2].item[7].item[1].item[0].text == "Disease or Condition" assert inst.item[2].item[7].item[1].linkId == "2.1.2" assert ( inst.item[2].item[7].item[1].text == "This family member's history of disease" ) assert inst.item[2].item[7].linkId == "2.1" assert ( inst.item[2].item[8].item[0].item[0].answer[0].valueCoding.code == "LA10423-4" ) assert ( inst.item[2].item[8].item[0].item[0].answer[0].valueCoding.display == "Paternal Grandfather" ) assert ( inst.item[2].item[8].item[0].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[8].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54136-7"} ).valueUri ) assert inst.item[2].item[8].item[0].item[0].linkId == "2.1.1.1" assert inst.item[2].item[8].item[0].item[0].text == "Relationship to you" assert inst.item[2].item[8].item[0].item[1].answer[0].valueString == "Bob" assert ( inst.item[2].item[8].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54138-3"} ).valueUri ) assert inst.item[2].item[8].item[0].item[1].linkId == "2.1.1.2" assert inst.item[2].item[8].item[0].item[1].text == "Name" assert inst.item[2].item[8].item[0].item[2].answer[0].valueCoding.code == "LA2-8" assert inst.item[2].item[8].item[0].item[2].answer[0].valueCoding.display == "Male" assert ( inst.item[2].item[8].item[0].item[2].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[8].item[0].item[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54123-5"} ).valueUri ) assert inst.item[2].item[8].item[0].item[2].linkId == "2.1.1.3" assert inst.item[2].item[8].item[0].item[2].text == "Gender" assert ( inst.item[2] .item[8] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueCoding.code == "LA10537-1" ) assert ( inst.item[2] .item[8] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueCoding.display == "-- Colon Cancer" ) assert ( inst.item[2] .item[8] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[8].item[0].item[3].answer[0].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54112-8"} ).valueUri ) assert ( inst.item[2].item[8].item[0].item[3].answer[0].item[0].item[0].linkId == "2.1.1.4.1.1" ) assert ( inst.item[2].item[8].item[0].item[3].answer[0].item[0].item[0].text == "Cause of Death" ) assert ( inst.item[2] .item[8] .item[0] .item[3] .answer[0] .item[0] .item[1] .answer[0] .valueCoding.code == "LA10400-2" ) assert ( inst.item[2] .item[8] .item[0] .item[3] .answer[0] .item[0] .item[1] .answer[0] .valueCoding.display == "OVER 60" ) assert ( inst.item[2] .item[8] .item[0] .item[3] .answer[0] .item[0] .item[1] .answer[0] .valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[8].item[0].item[3].answer[0].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54113-6"} ).valueUri ) assert ( inst.item[2].item[8].item[0].item[3].answer[0].item[0].item[1].linkId == "2.1.1.4.1.2" ) assert ( inst.item[2].item[8].item[0].item[3].answer[0].item[0].item[1].text == "Age at Death" ) assert inst.item[2].item[8].item[0].item[3].answer[0].item[0].linkId == "2.1.1.4.1" assert inst.item[2].item[8].item[0].item[3].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[8].item[0].item[3].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[8].item[0].item[3].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[8].item[0].item[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54139-1"} ).valueUri ) assert inst.item[2].item[8].item[0].item[3].linkId == "2.1.1.4" assert inst.item[2].item[8].item[0].item[3].text == "Living?" assert inst.item[2].item[8].item[0].item[4].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[8].item[0].item[4].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[8].item[0].item[4].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[8].item[0].item[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54121-9"} ).valueUri ) assert inst.item[2].item[8].item[0].item[4].linkId == "2.1.1.5" assert inst.item[2].item[8].item[0].item[4].text == "Was this person born a twin?" assert inst.item[2].item[8].item[0].item[5].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[8].item[0].item[5].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[8].item[0].item[5].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[8].item[0].item[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54122-7"} ).valueUri ) assert inst.item[2].item[8].item[0].item[5].linkId == "2.1.1.6" assert inst.item[2].item[8].item[0].item[5].text == "Was this person adopted?" assert inst.item[2].item[8].item[0].linkId == "2.1.1" assert ( inst.item[2].item[8].item[1].item[0].answer[0].valueCoding.code == "LA10537-1" ) assert ( inst.item[2].item[8].item[1].item[0].answer[0].valueCoding.display == "-- Colon Cancer" ) assert ( inst.item[2].item[8].item[1].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.item[2].item[8].item[1].item[0].linkId == "2.1.2.1" assert inst.item[2].item[8].item[1].item[0].text == "Disease or Condition" assert ( inst.item[2].item[8].item[1].item[1].answer[0].valueCoding.code == "LA10400-2" ) assert ( inst.item[2].item[8].item[1].item[1].answer[0].valueCoding.display == "OVER 60" ) assert ( inst.item[2].item[8].item[1].item[1].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.item[2].item[8].item[1].item[1].linkId == "2.1.2.2" assert inst.item[2].item[8].item[1].item[1].text == "Age at Diagnosis" assert inst.item[2].item[8].item[1].linkId == "2.1.2" assert ( inst.item[2].item[8].item[1].text == "This family member's history of disease" ) assert inst.item[2].item[8].linkId == "2.1" assert ( inst.item[2].item[9].item[0].item[0].answer[0].valueCoding.code == "LA10424-2" ) assert ( inst.item[2].item[9].item[0].item[0].answer[0].valueCoding.display == "Paternal Grandmother" ) assert ( inst.item[2].item[9].item[0].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[9].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54136-7"} ).valueUri ) assert inst.item[2].item[9].item[0].item[0].linkId == "2.1.1.1" assert inst.item[2].item[9].item[0].item[0].text == "Relationship to you" assert inst.item[2].item[9].item[0].item[1].answer[0].valueString == "Claire" assert ( inst.item[2].item[9].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54138-3"} ).valueUri ) assert inst.item[2].item[9].item[0].item[1].linkId == "2.1.1.2" assert inst.item[2].item[9].item[0].item[1].text == "Name" assert inst.item[2].item[9].item[0].item[2].answer[0].valueCoding.code == "LA3-6" assert ( inst.item[2].item[9].item[0].item[2].answer[0].valueCoding.display == "Female" ) assert ( inst.item[2].item[9].item[0].item[2].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[9].item[0].item[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54123-5"} ).valueUri ) assert inst.item[2].item[9].item[0].item[2].linkId == "2.1.1.3" assert inst.item[2].item[9].item[0].item[2].text == "Gender" assert ( inst.item[2] .item[9] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .item[0] .answer[0] .valueString == "Lou Gehrigs" ) assert ( inst.item[2] .item[9] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .item[0] .linkId == "2.1.1.4.1.1.1" ) assert ( inst.item[2] .item[9] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .item[0] .text == "Please specify" ) assert ( inst.item[2] .item[9] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueCoding.code == "LA10589-2" ) assert ( inst.item[2] .item[9] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueCoding.display == "-- Other/Unexpected" ) assert ( inst.item[2] .item[9] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[9].item[0].item[3].answer[0].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54112-8"} ).valueUri ) assert ( inst.item[2].item[9].item[0].item[3].answer[0].item[0].item[0].linkId == "2.1.1.4.1.1" ) assert ( inst.item[2].item[9].item[0].item[3].answer[0].item[0].item[0].text == "Cause of Death" ) assert ( inst.item[2] .item[9] .item[0] .item[3] .answer[0] .item[0] .item[1] .answer[0] .valueCoding.code == "LA10400-2" ) assert ( inst.item[2] .item[9] .item[0] .item[3] .answer[0] .item[0] .item[1] .answer[0] .valueCoding.display == "OVER 60" ) assert ( inst.item[2] .item[9] .item[0] .item[3] .answer[0] .item[0] .item[1] .answer[0] .valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[9].item[0].item[3].answer[0].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54113-6"} ).valueUri ) assert ( inst.item[2].item[9].item[0].item[3].answer[0].item[0].item[1].linkId == "2.1.1.4.1.2" ) assert ( inst.item[2].item[9].item[0].item[3].answer[0].item[0].item[1].text == "Age at Death" ) assert inst.item[2].item[9].item[0].item[3].answer[0].item[0].linkId == "2.1.1.4.1" assert inst.item[2].item[9].item[0].item[3].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[9].item[0].item[3].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[9].item[0].item[3].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[9].item[0].item[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54139-1"} ).valueUri ) assert inst.item[2].item[9].item[0].item[3].linkId == "2.1.1.4" assert inst.item[2].item[9].item[0].item[3].text == "Living?" assert inst.item[2].item[9].item[0].item[4].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[9].item[0].item[4].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[9].item[0].item[4].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[9].item[0].item[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54121-9"} ).valueUri ) assert inst.item[2].item[9].item[0].item[4].linkId == "2.1.1.5" assert inst.item[2].item[9].item[0].item[4].text == "Was this person born a twin?" assert inst.item[2].item[9].item[0].item[5].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[9].item[0].item[5].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[9].item[0].item[5].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[9].item[0].item[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54122-7"} ).valueUri ) assert inst.item[2].item[9].item[0].item[5].linkId == "2.1.1.6" assert inst.item[2].item[9].item[0].item[5].text == "Was this person adopted?" assert inst.item[2].item[9].item[0].linkId == "2.1.1" assert inst.item[2].item[9].linkId == "2.1" assert inst.item[2].linkId == "2" assert inst.item[2].text == "Family member health information" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.questionnaire == "http://hl7.org/fhir/Questionnaire/ussg-fht" assert inst.status == "in-progress" assert inst.subject.reference == "http://hl7.org/fhir/Patient/proband" assert ( inst.subject.type == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.text.status == "generated" def test_questionnaireresponse_2(base_settings): """No. 2 tests collection for QuestionnaireResponse. Test File: questionnaireresponse-example-ussg-fht-answers.json """ filename = ( base_settings["unittest_data_dir"] / "questionnaireresponse-example-ussg-fht-answers.json" ) inst = questionnaireresponse.QuestionnaireResponse.model_validate_json( filename.read_bytes() ) assert "QuestionnaireResponse" == inst.get_resource_type() impl_questionnaireresponse_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "QuestionnaireResponse" == data["resourceType"] inst2 = questionnaireresponse.QuestionnaireResponse(**data) impl_questionnaireresponse_2(inst2) def impl_questionnaireresponse_3(inst): assert inst.author.reference == "Practitioner/f201" assert ( inst.authored == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-06-18T00:00:00+01:00"} ).valueDateTime ) assert inst.id == "f201" assert inst.item[0].item[0].answer[0].valueString == "I am allergic to house dust" assert inst.item[0].item[0].linkId == "1.1" assert inst.item[0].item[0].text == "Do you have allergies?" assert inst.item[0].linkId == "1" assert inst.item[1].item[0].answer[0].valueString == "Male" assert inst.item[1].item[0].linkId == "2.1" assert inst.item[1].item[0].text == "What is your gender?" assert ( inst.item[1].item[1].answer[0].valueDate == ExternalValidatorModel.model_validate({"valueDate": "1960-03-13"}).valueDate ) assert inst.item[1].item[1].linkId == "2.2" assert inst.item[1].item[1].text == "What is your date of birth?" assert inst.item[1].item[2].answer[0].valueString == "The Netherlands" assert inst.item[1].item[2].linkId == "2.3" assert inst.item[1].item[2].text == "What is your country of birth?" assert inst.item[1].item[3].answer[0].valueString == "married" assert inst.item[1].item[3].linkId == "2.4" assert inst.item[1].item[3].text == "What is your marital status?" assert inst.item[1].linkId == "2" assert inst.item[1].text == "General questions" assert inst.item[2].item[0].answer[0].valueString == "No" assert inst.item[2].item[0].linkId == "3.1" assert inst.item[2].item[0].text == "Do you smoke?" assert inst.item[2].item[1].answer[0].valueString == "No, but I used to drink" assert inst.item[2].item[1].linkId == "3.2" assert inst.item[2].item[1].text == "Do you drink alchohol?" assert inst.item[2].linkId == "3" assert inst.item[2].text == "Intoxications" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.source.reference == "Practitioner/f201" assert inst.status == "completed" assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" def test_questionnaireresponse_3(base_settings): """No. 3 tests collection for QuestionnaireResponse. Test File: questionnaireresponse-example-f201-lifelines.json """ filename = ( base_settings["unittest_data_dir"] / "questionnaireresponse-example-f201-lifelines.json" ) inst = questionnaireresponse.QuestionnaireResponse.model_validate_json( filename.read_bytes() ) assert "QuestionnaireResponse" == inst.get_resource_type() impl_questionnaireresponse_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "QuestionnaireResponse" == data["resourceType"] inst2 = questionnaireresponse.QuestionnaireResponse(**data) impl_questionnaireresponse_3(inst2) def impl_questionnaireresponse_4(inst): assert inst.author.reference == "http://hl7.org/fhir/Practitioner/example" assert ( inst.author.type == ExternalValidatorModel.model_validate({"valueUri": "Practitioner"}).valueUri ) assert ( inst.authored == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-02-19T14:15:00+10:00"} ).valueDateTime ) assert inst.id == "bb" assert inst.item[0].item[0].item[0].answer[0].valueString == "Cathy Jones" assert inst.item[0].item[0].item[0].linkId == "nameOfChild" assert inst.item[0].item[0].item[0].text == "Name of child" assert inst.item[0].item[0].item[1].answer[0].valueCoding.code == "f" assert inst.item[0].item[0].item[1].linkId == "sex" assert inst.item[0].item[0].item[1].text == "Sex" assert inst.item[0].item[0].linkId == "group" assert float(inst.item[0].item[1].item[0].answer[0].valueDecimal) == float(3.25) assert inst.item[0].item[1].item[0].linkId == "birthWeight" assert inst.item[0].item[1].item[0].text == "Birth weight (kg)" assert float(inst.item[0].item[1].item[1].answer[0].valueDecimal) == float(44.3) assert inst.item[0].item[1].item[1].linkId == "birthLength" assert inst.item[0].item[1].item[1].text == "Birth length (cm)" assert ( inst.item[0].item[1].item[2].answer[0].item[0].item[0].answer[0].valueDate == ExternalValidatorModel.model_validate({"valueDate": "1972-11-30"}).valueDate ) assert ( inst.item[0].item[1].item[2].answer[0].item[0].item[0].linkId == "vitaminKDose1" ) assert inst.item[0].item[1].item[2].answer[0].item[0].item[0].text == "1st dose" assert ( inst.item[0].item[1].item[2].answer[0].item[0].item[1].answer[0].valueDate == ExternalValidatorModel.model_validate({"valueDate": "1972-12-11"}).valueDate ) assert ( inst.item[0].item[1].item[2].answer[0].item[0].item[1].linkId == "vitaminKDose2" ) assert inst.item[0].item[1].item[2].answer[0].item[0].item[1].text == "2nd dose" assert inst.item[0].item[1].item[2].answer[0].item[0].linkId == "vitaminKgivenDoses" assert inst.item[0].item[1].item[2].answer[0].valueCoding.code == "INJECTION" assert inst.item[0].item[1].item[2].linkId == "vitaminKgiven" assert inst.item[0].item[1].item[2].text == "Vitamin K given" assert ( inst.item[0].item[1].item[3].answer[0].item[0].answer[0].valueDate == ExternalValidatorModel.model_validate({"valueDate": "1972-12-04"}).valueDate ) assert inst.item[0].item[1].item[3].answer[0].item[0].linkId == "hepBgivenDate" assert inst.item[0].item[1].item[3].answer[0].item[0].text == "Date given" assert inst.item[0].item[1].item[3].answer[0].valueBoolean is True assert inst.item[0].item[1].item[3].linkId == "hepBgiven" assert inst.item[0].item[1].item[3].text == "Hep B given y / n" assert ( inst.item[0].item[1].item[4].answer[0].valueString == "Already able to speak Chinese" ) assert inst.item[0].item[1].item[4].linkId == "abnormalitiesAtBirth" assert inst.item[0].item[1].item[4].text == "Abnormalities noted at birth" assert inst.item[0].item[1].linkId == "neonatalInformation" assert inst.item[0].item[1].text == "Neonatal Information" assert inst.item[0].linkId == "birthDetails" assert inst.item[0].text == "Birth details - To be completed by health professional" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "completed" assert inst.subject.reference == "http://hl7.org/fhir/Patient/1" assert ( inst.subject.type == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.text.status == "generated" def test_questionnaireresponse_4(base_settings): """No. 4 tests collection for QuestionnaireResponse. Test File: questionnaireresponse-example-bluebook.json """ filename = ( base_settings["unittest_data_dir"] / "questionnaireresponse-example-bluebook.json" ) inst = questionnaireresponse.QuestionnaireResponse.model_validate_json( filename.read_bytes() ) assert "QuestionnaireResponse" == inst.get_resource_type() impl_questionnaireresponse_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "QuestionnaireResponse" == data["resourceType"] inst2 = questionnaireresponse.QuestionnaireResponse(**data) impl_questionnaireresponse_4(inst2) def impl_questionnaireresponse_5(inst): assert ( inst.authored == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-12-11T04:44:16Z"} ).valueDateTime ) assert inst.id == "gcs" assert inst.item[0].answer[0].valueCoding.code == "LA6560-2" assert inst.item[0].answer[0].valueCoding.display == "Confused" assert ( inst.item[0].answer[0].valueCoding.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/ordinalValue"} ).valueUri ) assert float(inst.item[0].answer[0].valueCoding.extension[0].valueDecimal) == float( 4 ) assert ( inst.item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.item[0].linkId == "1.1" assert inst.item[1].answer[0].valueCoding.code == "LA6566-9" assert inst.item[1].answer[0].valueCoding.display == "Localizing pain" assert ( inst.item[1].answer[0].valueCoding.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/ordinalValue"} ).valueUri ) assert float(inst.item[1].answer[0].valueCoding.extension[0].valueDecimal) == float( 5 ) assert ( inst.item[1].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.item[1].linkId == "1.2" assert inst.item[2].answer[0].valueCoding.code == "LA6556-0" assert inst.item[2].answer[0].valueCoding.display == "Eyes open spontaneously" assert ( inst.item[2].answer[0].valueCoding.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/ordinalValue"} ).valueUri ) assert float(inst.item[2].answer[0].valueCoding.extension[0].valueDecimal) == float( 4 ) assert ( inst.item[2].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.item[2].linkId == "1.3" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.questionnaire == "http://hl7.org/fhir/Questionnaire/gcs" assert inst.source.reference == "Practitioner/f007" assert inst.status == "completed" assert inst.subject.display == "Peter James Chalmers" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_questionnaireresponse_5(base_settings): """No. 5 tests collection for QuestionnaireResponse. Test File: questionnaireresponse-example-gcs.json """ filename = ( base_settings["unittest_data_dir"] / "questionnaireresponse-example-gcs.json" ) inst = questionnaireresponse.QuestionnaireResponse.model_validate_json( filename.read_bytes() ) assert "QuestionnaireResponse" == inst.get_resource_type() impl_questionnaireresponse_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "QuestionnaireResponse" == data["resourceType"] inst2 = questionnaireresponse.QuestionnaireResponse(**data) impl_questionnaireresponse_5(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_regulatedauthorization.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/RegulatedAuthorization Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import regulatedauthorization from .conftest import ExternalValidatorModel # noqa: F401 def impl_regulatedauthorization_1(inst): assert inst.holder.display == "EquiliDrugCo Holdings Inc." assert inst.holder.reference == "Organization/EqlidrugCo" assert inst.id == "basic-drug-auth" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.regulator.display == "FDA" assert inst.regulator.reference == "Organization/FDA" assert inst.status.coding[0].code == "active" assert ( inst.statusDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-01"} ).valueDateTime ) assert inst.subject[0].reference == "MedicinalProductDefinition/equilidem" assert inst.text.status == "generated" assert inst.type.text == "Regulatory Drug Marketing Approval" def test_regulatedauthorization_1(base_settings): """No. 1 tests collection for RegulatedAuthorization. Test File: regulatedauthorization-example-basic-drug-auth.json """ filename = ( base_settings["unittest_data_dir"] / "regulatedauthorization-example-basic-drug-auth.json" ) inst = regulatedauthorization.RegulatedAuthorization.model_validate_json( filename.read_bytes() ) assert "RegulatedAuthorization" == inst.get_resource_type() impl_regulatedauthorization_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RegulatedAuthorization" == data["resourceType"] inst2 = regulatedauthorization.RegulatedAuthorization(**data) impl_regulatedauthorization_1(inst2) def impl_regulatedauthorization_2(inst): assert ( inst.case.application[0].dateDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-01"} ).valueDateTime ) assert ( inst.case.application[0].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/applicationidentifier-number"} ).valueUri ) assert inst.case.application[0].identifier.value == "IA38G" assert ( inst.case.application[0].type.coding[0].code == "GroupTypeIAVariationNotification" ) assert ( inst.case.application[0].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://ema.europa.eu/example/marketingAuthorisationApplicationType" } ).valueUri ) assert ( inst.case.application[1].dateDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-01"} ).valueDateTime ) assert ( inst.case.application[1].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/applicationidentifier-number"} ).valueUri ) assert inst.case.application[1].identifier.value == "IA38F" assert ( inst.case.application[1].type.coding[0].code == "GroupTypeIAVariationNotification" ) assert ( inst.case.application[1].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://ema.europa.eu/example/marketingAuthorisationApplicationType" } ).valueUri ) assert ( inst.case.datePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-21"} ).valueDateTime ) assert ( inst.case.datePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-02"} ).valueDateTime ) assert ( inst.case.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/procedureidentifier-number"} ).valueUri ) assert inst.case.identifier.value == "EMEA/H/C/009999/IA/0099/G" assert inst.case.type.coding[0].code == "VariationTypeIA" assert ( inst.case.type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://ema.europa.eu/example/marketingAuthorisationProcedureType" } ).valueUri ) assert inst.holder.reference == "Organization/example" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/marketingAuthorisationNumber"} ).valueUri ) assert inst.identifier[0].value == "EU/1/11/999/001" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.region[0].coding[0].code == "EU" assert ( inst.region[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/country"} ).valueUri ) assert inst.regulator.reference == "Organization/example" assert inst.status.coding[0].code == "active" assert ( inst.status.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/authorisationstatus"} ).valueUri ) assert ( inst.statusDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-14"} ).valueDateTime ) assert inst.text.status == "generated" assert ( inst.validityPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2020-05-20"} ).valueDateTime ) assert ( inst.validityPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-03"} ).valueDateTime ) def test_regulatedauthorization_2(base_settings): """No. 2 tests collection for RegulatedAuthorization. Test File: regulatedauthorization-example.json """ filename = ( base_settings["unittest_data_dir"] / "regulatedauthorization-example.json" ) inst = regulatedauthorization.RegulatedAuthorization.model_validate_json( filename.read_bytes() ) assert "RegulatedAuthorization" == inst.get_resource_type() impl_regulatedauthorization_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RegulatedAuthorization" == data["resourceType"] inst2 = regulatedauthorization.RegulatedAuthorization(**data) impl_regulatedauthorization_2(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_relatedperson.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/RelatedPerson Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import relatedperson from .conftest import ExternalValidatorModel # noqa: F401 def impl_relatedperson_1(inst): assert inst.address[0].city == "PleasantVille" assert inst.address[0].line[0] == "534 Erewhon St" assert inst.address[0].postalCode == "3999" assert inst.address[0].state == "Vic" assert inst.address[0].use == "home" assert inst.gender == "male" assert inst.id == "peter" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Chalmers" assert inst.name[0].given[0] == "Peter" assert inst.name[0].given[1] == "James" assert inst.name[0].use == "official" assert inst.patient.reference == "Patient/animal" assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-03-11"} ).valueDateTime ) assert inst.photo[0].contentType == "image/jpeg" assert ( inst.photo[0].url == ExternalValidatorModel.model_validate({"valueUrl": "Binary/f012"}).valueUrl ) assert inst.relationship[0].coding[0].code == "C" assert ( inst.relationship[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0131"} ).valueUri ) assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "(03) 5555 6473" assert inst.text.status == "generated" def test_relatedperson_1(base_settings): """No. 1 tests collection for RelatedPerson. Test File: relatedperson-example-peter.json """ filename = base_settings["unittest_data_dir"] / "relatedperson-example-peter.json" inst = relatedperson.RelatedPerson.model_validate_json(filename.read_bytes()) assert "RelatedPerson" == inst.get_resource_type() impl_relatedperson_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RelatedPerson" == data["resourceType"] inst2 = relatedperson.RelatedPerson(**data) impl_relatedperson_1(inst2) def impl_relatedperson_2(inst): assert inst.gender == "female" assert inst.id == "f001" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.2.4.6.3"} ).valueUri ) assert inst.identifier[0].type.text == "BSN" assert inst.identifier[0].use == "official" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Abels" assert inst.name[0].given[0] == "Sarah" assert inst.name[0].use == "usual" assert inst.patient.reference == "Patient/f001" assert inst.relationship[0].coding[0].code == "SIGOTHR" assert ( inst.relationship[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "mobile" assert inst.telecom[0].value == "0690383372" assert inst.telecom[1].system == "email" assert inst.telecom[1].use == "home" assert inst.telecom[1].value == "s.abels@kpn.nl" assert inst.text.status == "generated" def test_relatedperson_2(base_settings): """No. 2 tests collection for RelatedPerson. Test File: relatedperson-example-f001-sarah.json """ filename = ( base_settings["unittest_data_dir"] / "relatedperson-example-f001-sarah.json" ) inst = relatedperson.RelatedPerson.model_validate_json(filename.read_bytes()) assert "RelatedPerson" == inst.get_resource_type() impl_relatedperson_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RelatedPerson" == data["resourceType"] inst2 = relatedperson.RelatedPerson(**data) impl_relatedperson_2(inst2) def impl_relatedperson_3(inst): assert inst.active is True assert inst.address[0].line[0] == "2222 Home Street" assert inst.address[0].use == "home" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1973-05-31"}).valueDate ) assert inst.gender == "female" assert inst.id == "newborn-mom" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/us-ssn"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "SS" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].value == "444222222" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Everywoman" assert inst.name[0].given[0] == "Eve" assert inst.name[0].use == "official" assert inst.patient.reference == "Patient/newborn" assert inst.relationship[0].coding[0].code == "NMTH" assert inst.relationship[0].coding[0].display == "natural mother" assert ( inst.relationship[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) assert inst.relationship[0].text == "Natural Mother" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "555-555-2003" assert inst.text.status == "generated" def test_relatedperson_3(base_settings): """No. 3 tests collection for RelatedPerson. Test File: relatedperson-example-newborn-mom.json """ filename = ( base_settings["unittest_data_dir"] / "relatedperson-example-newborn-mom.json" ) inst = relatedperson.RelatedPerson.model_validate_json(filename.read_bytes()) assert "RelatedPerson" == inst.get_resource_type() impl_relatedperson_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RelatedPerson" == data["resourceType"] inst2 = relatedperson.RelatedPerson(**data) impl_relatedperson_3(inst2) def impl_relatedperson_4(inst): assert inst.active is True assert inst.address[0].city == "Paris" assert inst.address[0].country == "FRA" assert inst.address[0].line[0] == "43, Place du Marché Sainte Catherine" assert inst.address[0].postalCode == "75004" assert inst.gender == "female" assert inst.id == "benedicte" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.2.250.1.61"} ).valueUri ) assert inst.identifier[0].type.text == "INSEE" assert inst.identifier[0].use == "usual" assert inst.identifier[0].value == "272117510400399" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "du Marché" assert inst.name[0].given[0] == "Bénédicte" assert inst.patient.reference == "Patient/example" assert inst.photo[0].contentType == "image/jpeg" assert ( inst.photo[0].url == ExternalValidatorModel.model_validate({"valueUrl": "Binary/f016"}).valueUrl ) assert inst.relationship[0].coding[0].code == "N" assert ( inst.relationship[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0131"} ).valueUri ) assert inst.relationship[0].coding[1].code == "WIFE" assert ( inst.relationship[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) assert inst.telecom[0].system == "phone" assert inst.telecom[0].value == "+33 (237) 998327" assert inst.text.status == "generated" def test_relatedperson_4(base_settings): """No. 4 tests collection for RelatedPerson. Test File: relatedperson-example.json """ filename = base_settings["unittest_data_dir"] / "relatedperson-example.json" inst = relatedperson.RelatedPerson.model_validate_json(filename.read_bytes()) assert "RelatedPerson" == inst.get_resource_type() impl_relatedperson_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RelatedPerson" == data["resourceType"] inst2 = relatedperson.RelatedPerson(**data) impl_relatedperson_4(inst2) def impl_relatedperson_5(inst): assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1963"}).valueDate ) assert inst.gender == "female" assert inst.id == "f002" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].text == "Ariadne Bor-Jansma" assert inst.name[0].use == "usual" assert inst.patient.reference == "Patient/f201" assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "1975"} ).valueDateTime ) assert inst.photo[0].contentType == "image/jpeg" assert inst.relationship[0].coding[0].code == "SIGOTHR" assert ( inst.relationship[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "home" assert inst.telecom[0].value == "+31201234567" assert inst.text.status == "generated" def test_relatedperson_5(base_settings): """No. 5 tests collection for RelatedPerson. Test File: relatedperson-example-f002-ariadne.json """ filename = ( base_settings["unittest_data_dir"] / "relatedperson-example-f002-ariadne.json" ) inst = relatedperson.RelatedPerson.model_validate_json(filename.read_bytes()) assert "RelatedPerson" == inst.get_resource_type() impl_relatedperson_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RelatedPerson" == data["resourceType"] inst2 = relatedperson.RelatedPerson(**data) impl_relatedperson_5(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_requestgroup.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/RequestGroup Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import requestgroup from .conftest import ExternalValidatorModel # noqa: F401 def impl_requestgroup_1(inst): assert ( inst.action[0] .action[0] .action[0] .action[0] .action[0] .extension[0] .extension[0] .url == ExternalValidatorModel.model_validate({"valueUri": "day"}).valueUri ) assert ( inst.action[0] .action[0] .action[0] .action[0] .action[0] .extension[0] .extension[0] .valueInteger == 1 ) assert ( inst.action[0] .action[0] .action[0] .action[0] .action[0] .extension[0] .extension[1] .url == ExternalValidatorModel.model_validate({"valueUri": "day"}).valueUri ) assert ( inst.action[0] .action[0] .action[0] .action[0] .action[0] .extension[0] .extension[1] .valueInteger == 8 ) assert ( inst.action[0].action[0].action[0].action[0].action[0].extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/timing-daysOfCycle"} ).valueUri ) assert inst.action[0].action[0].action[0].action[0].action[0].id == "action-1" assert ( inst.action[0].action[0].action[0].action[0].action[0].resource.reference == "#1111" ) assert ( inst.action[0].action[0].action[0].action[0].action[0].textEquivalent == "Gemcitabine 1250 mg/m² IV over 30 minutes on days 1 and 8" ) assert ( inst.action[0] .action[0] .action[0] .action[0] .action[1] .extension[0] .extension[0] .url == ExternalValidatorModel.model_validate({"valueUri": "day"}).valueUri ) assert ( inst.action[0] .action[0] .action[0] .action[0] .action[1] .extension[0] .extension[0] .valueInteger == 1 ) assert ( inst.action[0].action[0].action[0].action[0].action[1].extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/timing-daysOfCycle"} ).valueUri ) assert inst.action[0].action[0].action[0].action[0].action[1].id == "action-2" assert ( inst.action[0].action[0].action[0].action[0].action[1].relatedAction[0].actionId == "action-1" ) assert ( inst.action[0] .action[0] .action[0] .action[0] .action[1] .relatedAction[0] .relationship == "concurrent-with-start" ) assert ( inst.action[0].action[0].action[0].action[0].action[1].resource.reference == "#2222" ) assert ( inst.action[0].action[0].action[0].action[0].action[1].textEquivalent == "CARBOplatin AUC 5 IV over 30 minutes on Day 1" ) assert inst.action[0].action[0].action[0].action[0].id == "cycle-definition-1" assert ( inst.action[0].action[0].action[0].action[0].textEquivalent == "21-day cycle for 6 cycles" ) assert inst.action[0].action[0].action[0].action[0].timingTiming.repeat.count == 6 assert float( inst.action[0].action[0].action[0].action[0].timingTiming.repeat.duration ) == float(21) assert ( inst.action[0].action[0].action[0].action[0].timingTiming.repeat.durationUnit == "d" ) assert inst.action[0].action[0].action[0].groupingBehavior == "sentence-group" assert inst.action[0].action[0].action[0].selectionBehavior == "exactly-one" assert inst.action[0].action[0].selectionBehavior == "all" assert inst.action[0].selectionBehavior == "exactly-one" assert inst.author.reference == "Practitioner/1" assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-06T17:31:00Z"} ).valueDateTime ) assert inst.contained[0].id == "1111" assert inst.contained[1].id == "2222" assert inst.encounter.reference == "Encounter/example" assert inst.id == "kdn5-example" assert inst.identifier[0].value == "requestgroup-kdn5" assert ( inst.instantiatesCanonical[0] == "http://example.org/fhir/PlanDefinition/KDN5" ) assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.priority == "routine" assert inst.status == "draft" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Administer ' "gemcitabine and carboplatin.
" ) assert inst.text.status == "generated" def test_requestgroup_1(base_settings): """No. 1 tests collection for RequestGroup. Test File: requestgroup-kdn5-example.json """ filename = base_settings["unittest_data_dir"] / "requestgroup-kdn5-example.json" inst = requestgroup.RequestGroup.model_validate_json(filename.read_bytes()) assert "RequestGroup" == inst.get_resource_type() impl_requestgroup_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RequestGroup" == data["resourceType"] inst2 = requestgroup.RequestGroup(**data) impl_requestgroup_1(inst2) def impl_requestgroup_2(inst): assert inst.action[0].action[0].description == "Administer medication 1" assert inst.action[0].action[0].id == "medication-action-1" assert inst.action[0].action[0].resource.reference == "#medicationrequest-1" assert inst.action[0].action[0].type.coding[0].code == "create" assert inst.action[0].action[1].description == "Administer medication 2" assert inst.action[0].action[1].id == "medication-action-2" assert inst.action[0].action[1].relatedAction[0].actionId == "medication-action-1" assert inst.action[0].action[1].relatedAction[0].offsetDuration.code == "h" assert ( inst.action[0].action[1].relatedAction[0].offsetDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.action[0].action[1].relatedAction[0].offsetDuration.unit == "h" assert float( inst.action[0].action[1].relatedAction[0].offsetDuration.value ) == float(1) assert inst.action[0].action[1].relatedAction[0].relationship == "after-end" assert inst.action[0].action[1].resource.reference == "#medicationrequest-2" assert inst.action[0].action[1].type.coding[0].code == "create" assert inst.action[0].cardinalityBehavior == "single" assert ( inst.action[0].description == "Administer medications at the appropriate time" ) assert inst.action[0].groupingBehavior == "logical-group" assert inst.action[0].participant[0].reference == "Practitioner/1" assert inst.action[0].precheckBehavior == "yes" assert inst.action[0].prefix == "1" assert inst.action[0].requiredBehavior == "must" assert inst.action[0].selectionBehavior == "all" assert inst.action[0].textEquivalent == ( "Administer medication 1, followed an hour later by " "medication 2" ) assert ( inst.action[0].timingDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-06T19:00:00Z"} ).valueDateTime ) assert inst.action[0].title == "Administer Medications" assert inst.author.reference == "Practitioner/1" assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-06T17:31:00Z"} ).valueDateTime ) assert inst.contained[0].id == "medicationrequest-1" assert inst.contained[1].id == "medicationrequest-2" assert inst.encounter.reference == "Encounter/example" assert ( inst.groupIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/treatment-group"} ).valueUri ) assert inst.groupIdentifier.value == "00001" assert inst.id == "example" assert inst.identifier[0].value == "requestgroup-1" assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "Additional notes about the request group" assert inst.priority == "routine" assert inst.reasonCode[0].text == "Treatment" assert inst.status == "draft" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Example ' "RequestGroup illustrating related actions to administer " "medications in sequence with time delay.
" ) assert inst.text.status == "generated" def test_requestgroup_2(base_settings): """No. 2 tests collection for RequestGroup. Test File: requestgroup-example.json """ filename = base_settings["unittest_data_dir"] / "requestgroup-example.json" inst = requestgroup.RequestGroup.model_validate_json(filename.read_bytes()) assert "RequestGroup" == inst.get_resource_type() impl_requestgroup_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RequestGroup" == data["resourceType"] inst2 = requestgroup.RequestGroup(**data) impl_requestgroup_2(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_researchdefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ResearchDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import researchdefinition from .conftest import ExternalValidatorModel # noqa: F401 def impl_researchdefinition_1(inst): assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.population.reference == "ResearchElementDefinition/example" assert inst.status == "draft" assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" def test_researchdefinition_1(base_settings): """No. 1 tests collection for ResearchDefinition. Test File: researchdefinition-example.json """ filename = base_settings["unittest_data_dir"] / "researchdefinition-example.json" inst = researchdefinition.ResearchDefinition.model_validate_json( filename.read_bytes() ) assert "ResearchDefinition" == inst.get_resource_type() impl_researchdefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ResearchDefinition" == data["resourceType"] inst2 = researchdefinition.ResearchDefinition(**data) impl_researchdefinition_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_researchelementdefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ResearchElementDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import researchelementdefinition from .conftest import ExternalValidatorModel # noqa: F401 def impl_researchelementdefinition_1(inst): assert ( inst.characteristic[0].definitionCodeableConcept.text == "Diabetic patients over 65" ) assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "draft" assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" assert inst.type == "population" def test_researchelementdefinition_1(base_settings): """No. 1 tests collection for ResearchElementDefinition. Test File: researchelementdefinition-example.json """ filename = ( base_settings["unittest_data_dir"] / "researchelementdefinition-example.json" ) inst = researchelementdefinition.ResearchElementDefinition.model_validate_json( filename.read_bytes() ) assert "ResearchElementDefinition" == inst.get_resource_type() impl_researchelementdefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ResearchElementDefinition" == data["resourceType"] inst2 = researchelementdefinition.ResearchElementDefinition(**data) impl_researchelementdefinition_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_researchstudy.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ResearchStudy Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import researchstudy from .conftest import ExternalValidatorModel # noqa: F401 def impl_researchstudy_1(inst): assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "completed" assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" def test_researchstudy_1(base_settings): """No. 1 tests collection for ResearchStudy. Test File: researchstudy-example.json """ filename = base_settings["unittest_data_dir"] / "researchstudy-example.json" inst = researchstudy.ResearchStudy.model_validate_json(filename.read_bytes()) assert "ResearchStudy" == inst.get_resource_type() impl_researchstudy_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ResearchStudy" == data["resourceType"] inst2 = researchstudy.ResearchStudy(**data) impl_researchstudy_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_researchsubject.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ResearchSubject Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import researchsubject from .conftest import ExternalValidatorModel # noqa: F401 def impl_researchsubject_1(inst): assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/studysubjectids"} ).valueUri ) assert inst.identifier[0].type.text == "Subject id" assert inst.identifier[0].value == "123" assert inst.individual.reference == "Patient/example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "candidate" assert inst.study.reference == "ResearchStudy/example" assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" def test_researchsubject_1(base_settings): """No. 1 tests collection for ResearchSubject. Test File: researchsubject-example.json """ filename = base_settings["unittest_data_dir"] / "researchsubject-example.json" inst = researchsubject.ResearchSubject.model_validate_json(filename.read_bytes()) assert "ResearchSubject" == inst.get_resource_type() impl_researchsubject_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ResearchSubject" == data["resourceType"] inst2 = researchsubject.ResearchSubject(**data) impl_researchsubject_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_riskassessment.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/RiskAssessment Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import riskassessment from .conftest import ExternalValidatorModel # noqa: F401 def impl_riskassessment_1(inst): assert inst.contained[0].id == "group1" assert inst.id == "population" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "final" assert inst.subject.reference == "#group1" assert inst.text.status == "generated" def test_riskassessment_1(base_settings): """No. 1 tests collection for RiskAssessment. Test File: riskassessment-example-population.json """ filename = ( base_settings["unittest_data_dir"] / "riskassessment-example-population.json" ) inst = riskassessment.RiskAssessment.model_validate_json(filename.read_bytes()) assert "RiskAssessment" == inst.get_resource_type() impl_riskassessment_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RiskAssessment" == data["resourceType"] inst2 = riskassessment.RiskAssessment(**data) impl_riskassessment_1(inst2) def impl_riskassessment_2(inst): assert inst.basis[0].reference == "Patient/pat2" assert inst.basis[1].reference == "DiagnosticReport/lipids" assert inst.basis[2].reference == "Observation/blood-pressure" assert inst.encounter.reference == "Encounter/example" assert inst.id == "cardiac" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "risk-assessment-cardiac" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-07-19T16:04:00Z"} ).valueDateTime ) assert inst.performer.display == "http://cvdrisk.nhlbi.nih.gov/#cholesterol" assert inst.prediction[0].outcome.text == "Heart Attack" assert float(inst.prediction[0].probabilityDecimal) == float(0.02) assert inst.prediction[0].whenRange.high.code == "a" assert ( inst.prediction[0].whenRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[0].whenRange.high.unit == "years" assert float(inst.prediction[0].whenRange.high.value) == float(49) assert inst.prediction[0].whenRange.low.code == "a" assert ( inst.prediction[0].whenRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[0].whenRange.low.unit == "years" assert float(inst.prediction[0].whenRange.low.value) == float(39) assert inst.status == "final" assert inst.subject.reference == "Patient/pat2" assert inst.text.status == "additional" def test_riskassessment_2(base_settings): """No. 2 tests collection for RiskAssessment. Test File: riskassessment-example-cardiac.json """ filename = ( base_settings["unittest_data_dir"] / "riskassessment-example-cardiac.json" ) inst = riskassessment.RiskAssessment.model_validate_json(filename.read_bytes()) assert "RiskAssessment" == inst.get_resource_type() impl_riskassessment_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RiskAssessment" == data["resourceType"] inst2 = riskassessment.RiskAssessment(**data) impl_riskassessment_2(inst2) def impl_riskassessment_3(inst): assert inst.basis[0].reference == "List/prognosis" assert inst.id == "genetic" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.method.coding[0].code == "BRCAPRO" assert inst.note[0].text == "High degree of certainty" assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2006-01-13T23:01:00Z"} ).valueDateTime ) assert inst.prediction[0].outcome.text == "Breast Cancer" assert float(inst.prediction[0].probabilityDecimal) == float(0.000168) assert inst.prediction[0].whenRange.high.code == "a" assert ( inst.prediction[0].whenRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[0].whenRange.high.unit == "years" assert float(inst.prediction[0].whenRange.high.value) == float(53) assert inst.prediction[1].outcome.text == "Breast Cancer" assert float(inst.prediction[1].probabilityDecimal) == float(0.000368) assert inst.prediction[1].whenRange.high.code == "a" assert ( inst.prediction[1].whenRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[1].whenRange.high.unit == "years" assert float(inst.prediction[1].whenRange.high.value) == float(57) assert inst.prediction[1].whenRange.low.code == "a" assert ( inst.prediction[1].whenRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[1].whenRange.low.unit == "years" assert float(inst.prediction[1].whenRange.low.value) == float(54) assert inst.prediction[2].outcome.text == "Breast Cancer" assert float(inst.prediction[2].probabilityDecimal) == float(0.000594) assert inst.prediction[2].whenRange.high.code == "a" assert ( inst.prediction[2].whenRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[2].whenRange.high.unit == "years" assert float(inst.prediction[2].whenRange.high.value) == float(62) assert inst.prediction[2].whenRange.low.code == "a" assert ( inst.prediction[2].whenRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[2].whenRange.low.unit == "years" assert float(inst.prediction[2].whenRange.low.value) == float(58) assert inst.prediction[3].outcome.text == "Breast Cancer" assert float(inst.prediction[3].probabilityDecimal) == float(0.000838) assert inst.prediction[3].whenRange.high.code == "a" assert ( inst.prediction[3].whenRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[3].whenRange.high.unit == "years" assert float(inst.prediction[3].whenRange.high.value) == float(67) assert inst.prediction[3].whenRange.low.code == "a" assert ( inst.prediction[3].whenRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[3].whenRange.low.unit == "years" assert float(inst.prediction[3].whenRange.low.value) == float(63) assert inst.prediction[4].outcome.text == "Breast Cancer" assert float(inst.prediction[4].probabilityDecimal) == float(0.001089) assert inst.prediction[4].whenRange.high.code == "a" assert ( inst.prediction[4].whenRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[4].whenRange.high.unit == "years" assert float(inst.prediction[4].whenRange.high.value) == float(72) assert inst.prediction[4].whenRange.low.code == "a" assert ( inst.prediction[4].whenRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[4].whenRange.low.unit == "years" assert float(inst.prediction[4].whenRange.low.value) == float(68) assert inst.prediction[5].outcome.text == "Breast Cancer" assert float(inst.prediction[5].probabilityDecimal) == float(0.001327) assert inst.prediction[5].whenRange.high.code == "a" assert ( inst.prediction[5].whenRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[5].whenRange.high.unit == "years" assert float(inst.prediction[5].whenRange.high.value) == float(77) assert inst.prediction[5].whenRange.low.code == "a" assert ( inst.prediction[5].whenRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[5].whenRange.low.unit == "years" assert float(inst.prediction[5].whenRange.low.value) == float(73) assert inst.prediction[6].outcome.text == "Breast Cancer" assert float(inst.prediction[6].probabilityDecimal) == float(0.00153) assert inst.prediction[6].whenRange.high.code == "a" assert ( inst.prediction[6].whenRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[6].whenRange.high.unit == "years" assert float(inst.prediction[6].whenRange.high.value) == float(82) assert inst.prediction[6].whenRange.low.code == "a" assert ( inst.prediction[6].whenRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[6].whenRange.low.unit == "years" assert float(inst.prediction[6].whenRange.low.value) == float(78) assert inst.prediction[7].outcome.text == "Breast Cancer" assert float(inst.prediction[7].probabilityDecimal) == float(0.001663) assert inst.prediction[7].whenRange.high.code == "a" assert ( inst.prediction[7].whenRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[7].whenRange.high.unit == "years" assert float(inst.prediction[7].whenRange.high.value) == float(88) assert inst.prediction[7].whenRange.low.code == "a" assert ( inst.prediction[7].whenRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[7].whenRange.low.unit == "years" assert float(inst.prediction[7].whenRange.low.value) == float(83) assert inst.status == "final" assert inst.subject.reference == "Patient/b248b1b2-1686-4b94-9936-37d7a5f94b51" assert inst.text.status == "generated" def test_riskassessment_3(base_settings): """No. 3 tests collection for RiskAssessment. Test File: riskassessment-example.json """ filename = base_settings["unittest_data_dir"] / "riskassessment-example.json" inst = riskassessment.RiskAssessment.model_validate_json(filename.read_bytes()) assert "RiskAssessment" == inst.get_resource_type() impl_riskassessment_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RiskAssessment" == data["resourceType"] inst2 = riskassessment.RiskAssessment(**data) impl_riskassessment_3(inst2) def impl_riskassessment_4(inst): assert inst.basedOn.reference == "ImmunizationRecommendation/example" assert inst.basis[0].reference == "DiagnosticReport/example" assert inst.basis[1].reference == "Observation/example" assert inst.code.coding[0].code == "709510001" assert inst.code.coding[0].display == "Assessment of risk for disease (procedure)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://browser.ihtsdotools.org/"} ).valueUri ) assert inst.condition.reference == "Condition/example" assert inst.encounter.display == "Encounter with patient @example" assert inst.encounter.reference == "Encounter/example" assert inst.id == "riskexample" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "risk-assessment-breastcancer1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "This risk assessment is for reference only" assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-10-10"} ).valueDateTime ) assert inst.parent.reference == "DiagnosticReport/example" assert inst.performer.reference == "Practitioner/example" assert inst.prediction[0].outcome.text == "Breast Cancer" assert float(inst.prediction[0].probabilityDecimal) == float(0.000368) assert inst.prediction[0].whenRange.high.code == "a" assert ( inst.prediction[0].whenRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[0].whenRange.high.unit == "years" assert float(inst.prediction[0].whenRange.high.value) == float(57) assert inst.prediction[0].whenRange.low.code == "a" assert ( inst.prediction[0].whenRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[0].whenRange.low.unit == "years" assert float(inst.prediction[0].whenRange.low.value) == float(54) assert inst.status == "final" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Risk assessment ' "for reference only
" ) assert inst.text.status == "generated" def test_riskassessment_4(base_settings): """No. 4 tests collection for RiskAssessment. Test File: riskassessment-riskexample.json """ filename = base_settings["unittest_data_dir"] / "riskassessment-riskexample.json" inst = riskassessment.RiskAssessment.model_validate_json(filename.read_bytes()) assert "RiskAssessment" == inst.get_resource_type() impl_riskassessment_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RiskAssessment" == data["resourceType"] inst2 = riskassessment.RiskAssessment(**data) impl_riskassessment_4(inst2) def impl_riskassessment_5(inst): assert inst.basis[0].reference == "Observation/example-genetics-brcapat" assert inst.code.coding[0].code == "709510001" assert inst.code.coding[0].display == "Assessment of risk for disease (procedure)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://browser.ihtsdotools.org/"} ).valueUri ) assert inst.id == "breastcancer-risk" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "risk-assessment-breastcancer1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == ( "This risk assessment is based on BRCA1 and BRCA2 genetic " "mutation test" ) assert inst.performer.reference == "Practitioner/example" assert inst.prediction[0].outcome.text == "Unknown risk of developing breast cancer" assert inst.status == "final" assert inst.subject.reference == "Patient/example" assert inst.text.status == "additional" def test_riskassessment_5(base_settings): """No. 5 tests collection for RiskAssessment. Test File: riskassessment-example-breastcancer.json """ filename = ( base_settings["unittest_data_dir"] / "riskassessment-example-breastcancer.json" ) inst = riskassessment.RiskAssessment.model_validate_json(filename.read_bytes()) assert "RiskAssessment" == inst.get_resource_type() impl_riskassessment_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RiskAssessment" == data["resourceType"] inst2 = riskassessment.RiskAssessment(**data) impl_riskassessment_5(inst2) def impl_riskassessment_6(inst): assert inst.condition.display == "Ischemic Stroke" assert inst.condition.reference == "Condition/stroke" assert inst.id == "prognosis" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2010-11-22"} ).valueDateTime ) assert ( inst.prediction[0].outcome.coding[0].code == "249943000:363698007=72098002,260868000=6934004" ) assert ( inst.prediction[0].outcome.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.prediction[0].outcome.text == "permanent weakness of the left arm" assert inst.prediction[0].qualitativeRisk.coding[0].code == "moderate" assert inst.prediction[0].qualitativeRisk.coding[0].display == "moderate likelihood" assert ( inst.prediction[0].qualitativeRisk.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/risk-probability"} ).valueUri ) assert inst.status == "final" assert inst.subject.reference == "Patient/example" assert inst.text.status == "additional" def test_riskassessment_6(base_settings): """No. 6 tests collection for RiskAssessment. Test File: riskassessment-example-prognosis.json """ filename = ( base_settings["unittest_data_dir"] / "riskassessment-example-prognosis.json" ) inst = riskassessment.RiskAssessment.model_validate_json(filename.read_bytes()) assert "RiskAssessment" == inst.get_resource_type() impl_riskassessment_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RiskAssessment" == data["resourceType"] inst2 = riskassessment.RiskAssessment(**data) impl_riskassessment_6(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_schedule.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Schedule Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import schedule from .conftest import ExternalValidatorModel # noqa: F401 def impl_schedule_1(inst): assert inst.active is True assert inst.actor[0].display == "Dr. Beverly Crusher" assert inst.actor[0].reference == "Practitioner/1" assert inst.actor[1].display == "USS Enterprise-D Sickbay" assert inst.actor[1].reference == "Location/3" assert inst.comment == ( "The slots attached to this schedule are for genetic " "counselling in the USS Enterprise-D Sickbay." ) assert inst.id == "exampleloc1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/scheduleid"} ).valueUri ) assert inst.identifier[0].use == "usual" assert inst.identifier[0].value == "46" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.planningHorizon.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-12-25T09:30:00Z"} ).valueDateTime ) assert ( inst.planningHorizon.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-12-25T09:15:00Z"} ).valueDateTime ) assert inst.serviceCategory[0].coding[0].code == "17" assert inst.serviceCategory[0].coding[0].display == "General Practice" assert inst.serviceType[0].coding[0].code == "75" assert inst.serviceType[0].coding[0].display == "Genetic Counselling" assert inst.specialty[0].coding[0].code == "394580004" assert inst.specialty[0].coding[0].display == "Clinical genetics" assert inst.text.status == "generated" def test_schedule_1(base_settings): """No. 1 tests collection for Schedule. Test File: schedule-provider-location1-example.json """ filename = ( base_settings["unittest_data_dir"] / "schedule-provider-location1-example.json" ) inst = schedule.Schedule.model_validate_json(filename.read_bytes()) assert "Schedule" == inst.get_resource_type() impl_schedule_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Schedule" == data["resourceType"] inst2 = schedule.Schedule(**data) impl_schedule_1(inst2) def impl_schedule_2(inst): assert inst.active is True assert inst.actor[0].display == "Burgers UMC, South Wing, second floor" assert inst.actor[0].reference == "Location/1" assert inst.comment == ( "The slots attached to this schedule should be specialized to" " cover immunizations within the clinic" ) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/scheduleid"} ).valueUri ) assert inst.identifier[0].use == "usual" assert inst.identifier[0].value == "45" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.planningHorizon.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-12-25T09:30:00Z"} ).valueDateTime ) assert ( inst.planningHorizon.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-12-25T09:15:00Z"} ).valueDateTime ) assert inst.serviceCategory[0].coding[0].code == "17" assert inst.serviceCategory[0].coding[0].display == "General Practice" assert inst.serviceType[0].coding[0].code == "57" assert inst.serviceType[0].coding[0].display == "Immunization" assert inst.specialty[0].coding[0].code == "408480009" assert inst.specialty[0].coding[0].display == "Clinical immunology" assert inst.text.status == "generated" def test_schedule_2(base_settings): """No. 2 tests collection for Schedule. Test File: schedule-example.json """ filename = base_settings["unittest_data_dir"] / "schedule-example.json" inst = schedule.Schedule.model_validate_json(filename.read_bytes()) assert "Schedule" == inst.get_resource_type() impl_schedule_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Schedule" == data["resourceType"] inst2 = schedule.Schedule(**data) impl_schedule_2(inst2) def impl_schedule_3(inst): assert inst.active is True assert inst.actor[0].display == "Dr. Beverly Crusher" assert inst.actor[0].reference == "Practitioner/1" assert inst.actor[1].display == "Starfleet HQ Sickbay" assert inst.actor[1].reference == "Location/2" assert inst.comment == ( "The slots attached to this schedule are for neurosurgery " "operations at Starfleet HQ only." ) assert inst.id == "exampleloc2" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/scheduleid"} ).valueUri ) assert inst.identifier[0].use == "usual" assert inst.identifier[0].value == "47" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.planningHorizon.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-12-25T09:30:00Z"} ).valueDateTime ) assert ( inst.planningHorizon.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-12-25T09:15:00Z"} ).valueDateTime ) assert inst.serviceCategory[0].coding[0].code == "31" assert inst.serviceCategory[0].coding[0].display == "Specialist Surgical" assert inst.serviceType[0].coding[0].code == "221" assert inst.serviceType[0].coding[0].display == "Surgery - General" assert inst.specialty[0].coding[0].code == "394610002" assert inst.specialty[0].coding[0].display == "Surgery-Neurosurgery" assert inst.text.status == "generated" def test_schedule_3(base_settings): """No. 3 tests collection for Schedule. Test File: schedule-provider-location2-example.json """ filename = ( base_settings["unittest_data_dir"] / "schedule-provider-location2-example.json" ) inst = schedule.Schedule.model_validate_json(filename.read_bytes()) assert "Schedule" == inst.get_resource_type() impl_schedule_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Schedule" == data["resourceType"] inst2 = schedule.Schedule(**data) impl_schedule_3(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_searchparameter.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/SearchParameter Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import searchparameter from .conftest import ExternalValidatorModel # noqa: F401 def impl_searchparameter_1(inst): assert inst.code == "workflow" assert inst.description == "Optional Extensions Element" assert inst.experimental is True assert inst.id == "valueset-extensions-ValueSet-workflow" assert inst.name == "workflow" assert inst.status == "draft" assert inst.type == "token" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/valueset-extensions-ValueSet-workflow" } ).valueUri ) assert inst.version == "4.3.0" assert inst.xpath == ( "f:ValueSet/f:extension[@url='http://hl7.org/fhir/StructureDe" "finition/valueset-workflowStatus'] | /f:#workflowStatus" ) assert inst.xpathUsage == "normal" def test_searchparameter_1(base_settings): """No. 1 tests collection for SearchParameter. Test File: valueset-extensions-ValueSet-workflow.json """ filename = ( base_settings["unittest_data_dir"] / "valueset-extensions-ValueSet-workflow.json" ) inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_1(inst2) def impl_searchparameter_2(inst): assert inst.code == "author" assert inst.description == "Optional Extensions Element" assert inst.experimental is True assert inst.id == "codesystem-extensions-CodeSystem-author" assert inst.name == "author" assert inst.status == "draft" assert inst.type == "string" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/codesystem-extensions-CodeSystem-author" } ).valueUri ) assert inst.version == "4.3.0" assert inst.xpath == ( "f:CodeSystem/f:extension[@url='http://hl7.org/fhir/Structure" "Definition/codesystem-author'] | /f:#author" ) assert inst.xpathUsage == "normal" def test_searchparameter_2(base_settings): """No. 2 tests collection for SearchParameter. Test File: codesystem-extensions-CodeSystem-author.json """ filename = ( base_settings["unittest_data_dir"] / "codesystem-extensions-CodeSystem-author.json" ) inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_2(inst2) def impl_searchparameter_3(inst): assert inst.base[0] == "Patient" assert inst.code == "part-agree" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.description == ( "Search by url for a participation agreement, which is stored" " in a DocumentReference" ) assert inst.experimental is True assert inst.expression == ( "DocumentReference.extension('http://example.org/fhir/Structu" "reDefinition/participation-agreement')" ) assert inst.id == "example-extension" assert inst.name == "Example Search Parameter on an extension" assert inst.publisher == "Health Level Seven International (FHIR Infrastructure)" assert inst.status == "draft" assert inst.target[0] == "DocumentReference" assert inst.text.status == "generated" assert inst.type == "reference" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/example-extension"} ).valueUri ) assert inst.xpath == ( "f:DocumentReference/f:extension[@url='http://example.org/fhi" "r/StructureDefinition/participation-agreement']" ) assert inst.xpathUsage == "normal" def test_searchparameter_3(base_settings): """No. 3 tests collection for SearchParameter. Test File: searchparameter-example-extension.json """ filename = ( base_settings["unittest_data_dir"] / "searchparameter-example-extension.json" ) inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_3(inst2) def impl_searchparameter_4(inst): assert inst.base[0] == "QuestionnaireResponse" assert inst.code == "item-subject" assert inst.description == ( "Allows searching for QuestionnaireResponses by item value " "where the item has isSubject=true" ) assert inst.experimental is True assert inst.expression == ( "QuestionnaireResponse.item.where(extension('http://hl7.org/f" "hir/StructureDefinition/questionnaireresponse-" "isSubject').exists()).answer.value.ofType(Reference)" ) assert inst.id == ( "questionnaireresponse-extensions-QuestionnaireResponse-item-" "subject" ) assert inst.name == "item-subject" assert inst.status == "draft" assert inst.type == "reference" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/questionnaireresponse-extensions-QuestionnaireResponse-item-subject" } ).valueUri ) assert inst.version == "4.3.0" assert inst.xpathUsage == "normal" def test_searchparameter_4(base_settings): """No. 4 tests collection for SearchParameter. Test File: questionnaireresponse-extensions-QuestionnaireResponse-item-subject.json """ filename = ( base_settings["unittest_data_dir"] / "questionnaireresponse-extensions-QuestionnaireResponse-item-subject.json" ) inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_4(inst2) def impl_searchparameter_5(inst): assert inst.base[0] == "Resource" assert inst.code == "_filter" assert inst.contact[0].name == "FHIR Project" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-07-26"} ).valueDateTime ) assert inst.description == ( "This is the formal declaration for the _filter parameter, " "documented at [http://hl7.org/fhir/search_filter.html](http:" "//hl7.org/fhir/search_filter.html)" ) assert inst.experimental is False assert inst.id == "filter" assert inst.name == "FilterSearchParameter" assert inst.publisher == "Health Level Seven International (FHIR Infrastructure)" assert inst.purpose == ( "Support combination searches when the simple name=value " "basis of search cannot express what is required" ) assert inst.status == "draft" assert inst.text.status == "generated" assert inst.type == "special" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/filter"} ).valueUri ) assert inst.version == "1" def test_searchparameter_5(base_settings): """No. 5 tests collection for SearchParameter. Test File: searchparameter-filter.json """ filename = base_settings["unittest_data_dir"] / "searchparameter-filter.json" inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_5(inst2) def impl_searchparameter_6(inst): assert inst.base[0] == "Condition" assert inst.chain[0] == "name" assert inst.chain[1] == "identifier" assert inst.code == "subject" assert inst.contact[0].name == "[string]" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-10-23"} ).valueDateTime ) assert inst.description == "Search by condition subject" assert inst.experimental is True assert inst.expression == "Condition.subject" assert inst.id == "example-reference" assert inst.modifier[0] == "missing" assert inst.name == "Example Search Parameter" assert inst.publisher == "Health Level Seven International (FHIR Infrastructure)" assert inst.purpose == "Need to search Condition by subject" assert inst.status == "draft" assert inst.target[0] == "Organization" assert inst.text.status == "generated" assert inst.type == "reference" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/example-reference"} ).valueUri ) assert inst.xpathUsage == "normal" def test_searchparameter_6(base_settings): """No. 6 tests collection for SearchParameter. Test File: searchparameter-example-reference.json """ filename = ( base_settings["unittest_data_dir"] / "searchparameter-example-reference.json" ) inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_6(inst2) def impl_searchparameter_7(inst): assert inst.base[0] == "DiagnosticReport" assert inst.code == "assessed-condition" assert inst.description == "Condition assessed by genetic test" assert inst.experimental is True assert inst.expression == ( "DiagnosticReport.extension('http://hl7.org/fhir/StructureDef" "inition/DiagnosticReport-geneticsAssessedCondition')" ) assert inst.id == "diagnosticreport-genetic-DiagnosticReport-assessed-condition" assert inst.name == "assessed-condition" assert inst.status == "draft" assert inst.type == "reference" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/diagnosticreport-genetic-DiagnosticReport-assessed-condition" } ).valueUri ) assert inst.version == "4.3.0" assert inst.xpathUsage == "normal" def test_searchparameter_7(base_settings): """No. 7 tests collection for SearchParameter. Test File: diagnosticreport-genetic-DiagnosticReport-assessed-condition.json """ filename = ( base_settings["unittest_data_dir"] / "diagnosticreport-genetic-DiagnosticReport-assessed-condition.json" ) inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_7(inst2) def impl_searchparameter_8(inst): assert inst.base[0] == "Device" assert inst.code == "din" assert inst.description == "The donation identification number (DIN)" assert inst.experimental is True assert inst.expression == ( "Device.extension('http://hl7.org/fhir/SearchParameter/device" "-extensions-Device-din')" ) assert inst.id == "device-extensions-Device-din" assert inst.name == "din" assert inst.status == "draft" assert inst.type == "token" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/device-extensions-Device-din" } ).valueUri ) assert inst.version == "4.3.0" assert inst.xpathUsage == "normal" def test_searchparameter_8(base_settings): """No. 8 tests collection for SearchParameter. Test File: device-extensions-Device-din.json """ filename = base_settings["unittest_data_dir"] / "device-extensions-Device-din.json" inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_8(inst2) def impl_searchparameter_9(inst): assert inst.base[0] == "Observation" assert inst.code == "gene-identifier" assert inst.description == "HGNC gene symbol and identifier" assert inst.experimental is True assert inst.expression == ( "Observation.extension('http://hl7.org/fhir/StructureDefiniti" "on/observation-geneticsGene')" ) assert inst.id == "observation-genetic-Observation-gene-identifier" assert inst.name == "gene-identifier" assert inst.status == "draft" assert inst.type == "token" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/observation-genetic-Observation-gene-identifier" } ).valueUri ) assert inst.version == "4.3.0" assert inst.xpathUsage == "normal" def test_searchparameter_9(base_settings): """No. 9 tests collection for SearchParameter. Test File: observation-genetic-Observation-gene-identifier.json """ filename = ( base_settings["unittest_data_dir"] / "observation-genetic-Observation-gene-identifier.json" ) inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_9(inst2) def impl_searchparameter_10(inst): assert inst.code == "workflow" assert inst.description == "Optional Extensions Element" assert inst.experimental is True assert inst.id == "codesystem-extensions-CodeSystem-workflow" assert inst.name == "workflow" assert inst.status == "draft" assert inst.type == "token" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/codesystem-extensions-CodeSystem-workflow" } ).valueUri ) assert inst.version == "4.3.0" assert inst.xpath == ( "f:CodeSystem/f:extension[@url='http://hl7.org/fhir/Structure" "Definition/codesystem-workflowStatus'] | /f:#workflowStatus" ) assert inst.xpathUsage == "normal" def test_searchparameter_10(base_settings): """No. 10 tests collection for SearchParameter. Test File: codesystem-extensions-CodeSystem-workflow.json """ filename = ( base_settings["unittest_data_dir"] / "codesystem-extensions-CodeSystem-workflow.json" ) inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_servicerequest.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ServiceRequest Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import servicerequest from .conftest import ExternalValidatorModel # noqa: F401 def impl_servicerequest_1(inst): assert inst.asNeededCodeableConcept.text == "as needed to clear mucus" assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T17:23:07Z"} ).valueDateTime ) assert inst.basedOn[0].reference == "CarePlan/gpvisit" assert inst.code.coding[0].code == "34431008" assert inst.code.coding[0].display == "Physiotherapy of chest (regime/therapy)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.contained[0].id == "signature" assert inst.contained[1].id == "cystic-fibrosis" assert inst.id == "physiotherapy" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealth.org/placer-ids"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "PLAC" assert inst.identifier[0].type.coding[0].display == "Placer Identifier" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].type.text == "Placer" assert inst.identifier[0].value == "20170201-0001" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert float(inst.occurrenceTiming.repeat.duration) == float(15) assert float(inst.occurrenceTiming.repeat.durationMax) == float(25) assert inst.occurrenceTiming.repeat.durationUnit == "min" assert inst.occurrenceTiming.repeat.frequency == 1 assert inst.occurrenceTiming.repeat.frequencyMax == 4 assert float(inst.occurrenceTiming.repeat.period) == float(1) assert inst.occurrenceTiming.repeat.periodUnit == "d" assert inst.reasonReference[0].reference == "#cystic-fibrosis" assert inst.relevantHistory[0].display == "Author's Signature" assert inst.relevantHistory[0].reference == "#signature" assert inst.requester.display == "Dr Adam Careful" assert inst.requester.reference == "Practitioner/example" assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_servicerequest_1(base_settings): """No. 1 tests collection for ServiceRequest. Test File: servicerequest-example2.json """ filename = base_settings["unittest_data_dir"] / "servicerequest-example2.json" inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes()) assert "ServiceRequest" == inst.get_resource_type() impl_servicerequest_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ServiceRequest" == data["resourceType"] inst2 = servicerequest.ServiceRequest(**data) impl_servicerequest_1(inst2) def impl_servicerequest_2(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T17:23:07Z"} ).valueDateTime ) assert inst.code.coding[0].code == "359962006" assert inst.code.coding[0].display == "Turning patient in bed (procedure)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.doNotPerform is True assert inst.id == "do-not-turn" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealth.org/placer-ids"} ).valueUri ) assert inst.identifier[0].value == "20170201-0002" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.priority == "stat" assert inst.reasonReference[0].display == "Patient has a spinal fracture" assert inst.requester.display == "Dr Adam Careful" assert inst.requester.reference == "Practitioner/example" assert inst.status == "active" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_servicerequest_2(base_settings): """No. 2 tests collection for ServiceRequest. Test File: servicerequest-example3.json """ filename = base_settings["unittest_data_dir"] / "servicerequest-example3.json" inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes()) assert "ServiceRequest" == inst.get_resource_type() impl_servicerequest_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ServiceRequest" == data["resourceType"] inst2 = servicerequest.ServiceRequest(**data) impl_servicerequest_2(inst2) def impl_servicerequest_3(inst): assert inst.code.coding[0].code == "LIPID" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org/tests"} ).valueUri ) assert inst.code.text == "Lipid Panel" assert inst.contained[0].id == "fasting" assert inst.contained[1].id == "serum" assert inst.encounter.reference == "Encounter/example" assert inst.id == "lipid" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.3.4.5.6.7"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "PLAC" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].type.text == "Placer" assert inst.identifier[0].value == "2345234234234" assert inst.intent == "original-order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "patient is afraid of needles" assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-05-02T16:16:00-07:00"} ).valueDateTime ) assert inst.performer[0].reference == "Practitioner/f202" assert inst.reasonCode[0].coding[0].code == "V173" assert inst.reasonCode[0].coding[0].display == "Fam hx-ischem heart dis" assert ( inst.reasonCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/icd-9"} ).valueUri ) assert inst.requester.reference == "Practitioner/example" assert inst.specimen[0].display == "Serum specimen" assert inst.specimen[0].reference == "#serum" assert inst.status == "active" assert inst.subject.reference == "Patient/example" assert inst.supportingInfo[0].display == "Fasting status" assert inst.supportingInfo[0].reference == "#fasting" assert inst.text.status == "generated" def test_servicerequest_3(base_settings): """No. 3 tests collection for ServiceRequest. Test File: servicerequest-example-lipid.json """ filename = base_settings["unittest_data_dir"] / "servicerequest-example-lipid.json" inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes()) assert "ServiceRequest" == inst.get_resource_type() impl_servicerequest_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ServiceRequest" == data["resourceType"] inst2 = servicerequest.ServiceRequest(**data) impl_servicerequest_3(inst2) def impl_servicerequest_4(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-05"} ).valueDateTime ) assert inst.code.coding[0].code == "76164006" assert inst.code.coding[0].display == "Biopsy of colon (procedure)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Biopsy of colon" assert inst.id == "colon-biopsy" assert inst.identifier[0].value == "12345" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].display == "Dr Adam Careful" assert inst.performer[0].reference == "Practitioner/example" assert inst.requester.display == "Dr. Beverly Crusher" assert ( inst.requester.reference == "Practitioner/3ad0687e-f477-468c-afd5-fcc2bf897809" ) assert ( inst.requisition.system == ExternalValidatorModel.model_validate( {"valueUri": "http://bumc.org/requisitions"} ).valueUri ) assert inst.requisition.value == "req12345" assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_servicerequest_4(base_settings): """No. 4 tests collection for ServiceRequest. Test File: servicerequest-example-colonoscopy-bx.json """ filename = ( base_settings["unittest_data_dir"] / "servicerequest-example-colonoscopy-bx.json" ) inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes()) assert "ServiceRequest" == inst.get_resource_type() impl_servicerequest_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ServiceRequest" == data["resourceType"] inst2 = servicerequest.ServiceRequest(**data) impl_servicerequest_4(inst2) def impl_servicerequest_5(inst): assert inst.code.coding[0].code == "229115003" assert inst.code.coding[0].display == "Bench Press (regime/therapy)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "benchpress" assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.occurrenceTiming.repeat.count == 20 assert inst.occurrenceTiming.repeat.countMax == 30 assert inst.occurrenceTiming.repeat.frequency == 3 assert float(inst.occurrenceTiming.repeat.period) == float(1) assert inst.occurrenceTiming.repeat.periodUnit == "wk" assert inst.patientInstruction == ( "Start with 30kg 10-15 repetitions for three sets and " "increase in increments of 5kg when you feel ready" ) assert inst.status == "active" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_servicerequest_5(base_settings): """No. 5 tests collection for ServiceRequest. Test File: servicerequest-example4.json """ filename = base_settings["unittest_data_dir"] / "servicerequest-example4.json" inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes()) assert "ServiceRequest" == inst.get_resource_type() impl_servicerequest_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ServiceRequest" == data["resourceType"] inst2 = servicerequest.ServiceRequest(**data) impl_servicerequest_5(inst2) def impl_servicerequest_6(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-08-16"} ).valueDateTime ) assert inst.category[0].coding[0].code == "311401005" assert inst.category[0].coding[0].display == "Patient education (procedure)" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].text == "Education" assert inst.code.coding[0].code == "48023004" assert ( inst.code.coding[0].display == "Breast self-examination technique education (procedure)" ) assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Health education - breast examination" assert inst.id == "education" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.performer[0].display == "Pamela Educator, RN" assert inst.reasonCode[0].text == "early detection of breast mass" assert inst.requester.display == "Angela Care, MD" assert inst.status == "completed" assert inst.subject.display == "Jane Doe" assert inst.text.status == "generated" def test_servicerequest_6(base_settings): """No. 6 tests collection for ServiceRequest. Test File: servicerequest-example-edu.json """ filename = base_settings["unittest_data_dir"] / "servicerequest-example-edu.json" inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes()) assert "ServiceRequest" == inst.get_resource_type() impl_servicerequest_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ServiceRequest" == data["resourceType"] inst2 = servicerequest.ServiceRequest(**data) impl_servicerequest_6(inst2) def impl_servicerequest_7(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-02-20"} ).valueDateTime ) assert inst.code.coding[0].code == "40617009" assert inst.code.coding[0].display == "Artificial respiration (procedure)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Mechanical Ventilation" assert inst.id == "vent" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.orderDetail[0].coding[0].code == "243144002" assert ( inst.orderDetail[0].coding[0].display == "Patient triggered inspiratory assistance (procedure)" ) assert ( inst.orderDetail[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.orderDetail[0].text == "IPPB" assert inst.orderDetail[1].text == ( " Initial Settings : Sens: -1 cm H20 Pressure 15 cm H2O " "moderate flow: Monitor VS every 15 minutes x 4 at the start" " of mechanical ventilation, then routine for unit OR every 5" " hr" ) assert inst.performer[0].display == "Dr Cecil Surgeon" assert inst.performer[0].reference == "Practitioner/example" assert inst.reasonCode[0].text == "chronic obstructive lung disease (COLD)" assert inst.requester.display == "Dr. Beverly Crusher" assert ( inst.requester.reference == "Practitioner/3ad0687e-f477-468c-afd5-fcc2bf897809" ) assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_servicerequest_7(base_settings): """No. 7 tests collection for ServiceRequest. Test File: servicerequest-example-ventilation.json """ filename = ( base_settings["unittest_data_dir"] / "servicerequest-example-ventilation.json" ) inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes()) assert "ServiceRequest" == inst.get_resource_type() impl_servicerequest_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ServiceRequest" == data["resourceType"] inst2 = servicerequest.ServiceRequest(**data) impl_servicerequest_7(inst2) def impl_servicerequest_8(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-05"} ).valueDateTime ) assert inst.basedOn[0].display == "Maternity care plan" assert inst.basedOn[0].reference == "CarePlan/preg" assert inst.code.coding[0].code == "62013009" assert inst.code.coding[0].display == "Ambulating patient (procedure)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Ambulation" assert inst.id == "ambulation" assert inst.identifier[0].value == "45678" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.reasonReference[0].display == "Blood Pressure" assert inst.reasonReference[0].reference == "Observation/blood-pressure" assert inst.requester.display == "Dr. Beverly Crusher" assert ( inst.requester.reference == "Practitioner/3ad0687e-f477-468c-afd5-fcc2bf897809" ) assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_servicerequest_8(base_settings): """No. 8 tests collection for ServiceRequest. Test File: servicerequest-example-ambulation.json """ filename = ( base_settings["unittest_data_dir"] / "servicerequest-example-ambulation.json" ) inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes()) assert "ServiceRequest" == inst.get_resource_type() impl_servicerequest_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ServiceRequest" == data["resourceType"] inst2 = servicerequest.ServiceRequest(**data) impl_servicerequest_8(inst2) def impl_servicerequest_9(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-09-20"} ).valueDateTime ) assert inst.bodySite[0].coding[0].code == "36701003" assert inst.bodySite[0].coding[0].display == "Both knees (body structure)" assert ( inst.bodySite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.bodySite[0].text == "Both knees" assert inst.category[0].coding[0].code == "386053000" assert inst.category[0].coding[0].display == "Evaluation procedure (procedure)" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].text == "Evaluation" assert inst.code.coding[0].code == "710830005" assert ( inst.code.coding[0].display == "Assessment of passive range of motion (procedure)" ) assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Assessment of passive range of motion" assert inst.id == "physical-therapy" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-09-27"} ).valueDateTime ) assert inst.performer[0].display == "Paul Therapist, PT" assert ( inst.reasonCode[0].text == "assessment of mobility limitations due to osteoarthritis" ) assert inst.requester.display == "Ollie Ortho, MD" assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_servicerequest_9(base_settings): """No. 9 tests collection for ServiceRequest. Test File: servicerequest-example-pt.json """ filename = base_settings["unittest_data_dir"] / "servicerequest-example-pt.json" inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes()) assert "ServiceRequest" == inst.get_resource_type() impl_servicerequest_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ServiceRequest" == data["resourceType"] inst2 = servicerequest.ServiceRequest(**data) impl_servicerequest_9(inst2) def impl_servicerequest_10(inst): assert inst.code.coding[0].code == "24627-2" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.code.text == "Chest CT" assert inst.id == "di" assert inst.intent == "original-order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-05-08T09:33:27+07:00"} ).valueDateTime ) assert inst.reasonCode[0].text == "Check for metastatic disease" assert inst.requester.display == "Dr. Adam Careful" assert inst.requester.reference == "Practitioner/example" assert inst.status == "active" assert inst.subject.reference == "Patient/dicom" assert inst.text.status == "generated" def test_servicerequest_10(base_settings): """No. 10 tests collection for ServiceRequest. Test File: servicerequest-example-di.json """ filename = base_settings["unittest_data_dir"] / "servicerequest-example-di.json" inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes()) assert "ServiceRequest" == inst.get_resource_type() impl_servicerequest_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ServiceRequest" == data["resourceType"] inst2 = servicerequest.ServiceRequest(**data) impl_servicerequest_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_slot.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Slot Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import slot from .conftest import ExternalValidatorModel # noqa: F401 def impl_slot_1(inst): assert inst.comment == ( "Assessments should be performed before requesting " "appointments in this slot." ) assert ( inst.end == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-25T09:15:00Z"} ).valueInstant ) assert inst.id == "1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/identifiers/slots"} ).valueUri ) assert inst.identifier[0].value == "123132" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.overbooked is True assert inst.schedule.reference == "Schedule/example" assert inst.serviceCategory[0].coding[0].code == "17" assert inst.serviceCategory[0].coding[0].display == "General Practice" assert ( inst.start == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-25T09:00:00Z"} ).valueInstant ) assert inst.status == "busy" assert inst.text.status == "generated" def test_slot_1(base_settings): """No. 1 tests collection for Slot. Test File: slot-example-busy.json """ filename = base_settings["unittest_data_dir"] / "slot-example-busy.json" inst = slot.Slot.model_validate_json(filename.read_bytes()) assert "Slot" == inst.get_resource_type() impl_slot_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Slot" == data["resourceType"] inst2 = slot.Slot(**data) impl_slot_1(inst2) def impl_slot_2(inst): assert inst.appointmentType.coding[0].code == "WALKIN" assert ( inst.appointmentType.coding[0].display == "A previously unscheduled walk-in visit" ) assert ( inst.appointmentType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0276"} ).valueUri ) assert inst.comment == ( "Assessments should be performed before requesting " "appointments in this slot." ) assert ( inst.end == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-25T09:30:00Z"} ).valueInstant ) assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.schedule.reference == "Schedule/example" assert inst.serviceCategory[0].coding[0].code == "17" assert inst.serviceCategory[0].coding[0].display == "General Practice" assert inst.serviceType[0].coding[0].code == "57" assert inst.serviceType[0].coding[0].display == "Immunization" assert inst.specialty[0].coding[0].code == "408480009" assert inst.specialty[0].coding[0].display == "Clinical immunology" assert ( inst.start == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-25T09:15:00Z"} ).valueInstant ) assert inst.status == "free" assert inst.text.status == "generated" def test_slot_2(base_settings): """No. 2 tests collection for Slot. Test File: slot-example.json """ filename = base_settings["unittest_data_dir"] / "slot-example.json" inst = slot.Slot.model_validate_json(filename.read_bytes()) assert "Slot" == inst.get_resource_type() impl_slot_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Slot" == data["resourceType"] inst2 = slot.Slot(**data) impl_slot_2(inst2) def impl_slot_3(inst): assert inst.comment == "Dr Careful is out of the office" assert ( inst.end == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-25T09:45:00Z"} ).valueInstant ) assert inst.id == "3" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.schedule.reference == "Schedule/example" assert inst.serviceCategory[0].coding[0].code == "17" assert inst.serviceCategory[0].coding[0].display == "General Practice" assert ( inst.start == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-25T09:30:00Z"} ).valueInstant ) assert inst.status == "busy-unavailable" assert inst.text.status == "generated" def test_slot_3(base_settings): """No. 3 tests collection for Slot. Test File: slot-example-unavailable.json """ filename = base_settings["unittest_data_dir"] / "slot-example-unavailable.json" inst = slot.Slot.model_validate_json(filename.read_bytes()) assert "Slot" == inst.get_resource_type() impl_slot_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Slot" == data["resourceType"] inst2 = slot.Slot(**data) impl_slot_3(inst2) def impl_slot_4(inst): assert inst.comment == "Dr Careful is out of the office" assert ( inst.end == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-25T10:00:00Z"} ).valueInstant ) assert inst.id == "2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.schedule.reference == "Schedule/example" assert inst.serviceCategory[0].coding[0].code == "17" assert inst.serviceCategory[0].coding[0].display == "General Practice" assert ( inst.start == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-25T09:45:00Z"} ).valueInstant ) assert inst.status == "busy-tentative" assert inst.text.status == "generated" def test_slot_4(base_settings): """No. 4 tests collection for Slot. Test File: slot-example-tentative.json """ filename = base_settings["unittest_data_dir"] / "slot-example-tentative.json" inst = slot.Slot.model_validate_json(filename.read_bytes()) assert "Slot" == inst.get_resource_type() impl_slot_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Slot" == data["resourceType"] inst2 = slot.Slot(**data) impl_slot_4(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_specimen.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Specimen Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import specimen from .conftest import ExternalValidatorModel # noqa: F401 def impl_specimen_1(inst): assert ( inst.accessionIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://lab.acme.org/specimens/2011"} ).valueUri ) assert inst.accessionIdentifier.value == "X352356-ISO1" assert ( inst.collection.collectedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-16T07:03:00Z"} ).valueDateTime ) assert inst.collection.collector.reference == "Practitioner/f202" assert inst.collection.method.coding[0].code == "BAP" assert ( inst.collection.method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0488"} ).valueUri ) assert inst.contained[0].id == "stool" assert inst.id == "isolate" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "Patient dropped off specimen" assert inst.parent[0].reference == "#stool" assert ( inst.receivedTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-18T07:03:00Z"} ).valueDateTime ) assert inst.status == "available" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" assert inst.type.coding[0].code == "429951000124103" assert inst.type.coding[0].display == "Bacterial isolate specimen" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_specimen_1(base_settings): """No. 1 tests collection for Specimen. Test File: specimen-example-isolate.json """ filename = base_settings["unittest_data_dir"] / "specimen-example-isolate.json" inst = specimen.Specimen.model_validate_json(filename.read_bytes()) assert "Specimen" == inst.get_resource_type() impl_specimen_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Specimen" == data["resourceType"] inst2 = specimen.Specimen(**data) impl_specimen_1(inst2) def impl_specimen_2(inst): assert ( inst.accessionIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "https://vetmed.iastate.edu/vdl"} ).valueUri ) assert inst.accessionIdentifier.value == "20171120-1234" assert ( inst.collection.collectedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-11-14"} ).valueDateTime ) assert inst.collection.collector.display == "James Herriot, FRCVS" assert inst.container[0].type.coding[0].code == "RTT" assert inst.container[0].type.coding[0].display == "Red Top Tube" assert ( inst.container[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://vetmed.iastate.edu/vdl"} ).valueUri ) assert inst.container[0].type.text == "Red Top Blood Collection Tube" assert inst.id == "pooled-serum" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "Pooled serum sample from 30 individuals" assert inst.subject.reference == "Group/herd1" assert inst.text.status == "generated" assert inst.type.coding[0].code == "Serum sample, pooled" assert inst.type.coding[0].display == "Serum sample, pooled" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://vetmed.iastate.edu/vdl"} ).valueUri ) assert inst.type.text == "Pooled serum sample" def test_specimen_2(base_settings): """No. 2 tests collection for Specimen. Test File: specimen-example-pooled-serum.json """ filename = base_settings["unittest_data_dir"] / "specimen-example-pooled-serum.json" inst = specimen.Specimen.model_validate_json(filename.read_bytes()) assert "Specimen" == inst.get_resource_type() impl_specimen_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Specimen" == data["resourceType"] inst2 = specimen.Specimen(**data) impl_specimen_2(inst2) def impl_specimen_3(inst): assert ( inst.accessionIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://lab.acme.org/specimens/2015"} ).valueUri ) assert inst.accessionIdentifier.value == "X352356" assert ( inst.collection.collectedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-18T07:03:00Z"} ).valueDateTime ) assert inst.collection.collector.reference == "Practitioner/f202" assert inst.container[0].capacity.unit == "mls" assert float(inst.container[0].capacity.value) == float(50) assert inst.container[0].specimenQuantity.unit == "mls" assert float(inst.container[0].specimenQuantity.value) == float(10) assert inst.container[0].type.text == "Non-sterile specimen container" assert inst.id == "vma-urine" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.processing[0].additive[0].display == "6 N HCl" assert inst.processing[0].description == "Acidify to pH < 3.0 with 6 N HCl." assert inst.processing[0].procedure.coding[0].code == "ACID" assert ( inst.processing[0].procedure.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0373"} ).valueUri ) assert ( inst.processing[0].timeDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-18T08:10:00Z"} ).valueDateTime ) assert ( inst.receivedTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-18T07:03:00Z"} ).valueDateTime ) assert inst.status == "available" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" assert inst.type.coding[0].code == "RANDU" assert inst.type.coding[0].display == "Urine, Random" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0487"} ).valueUri ) def test_specimen_3(base_settings): """No. 3 tests collection for Specimen. Test File: specimen-example-urine.json """ filename = base_settings["unittest_data_dir"] / "specimen-example-urine.json" inst = specimen.Specimen.model_validate_json(filename.read_bytes()) assert "Specimen" == inst.get_resource_type() impl_specimen_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Specimen" == data["resourceType"] inst2 = specimen.Specimen(**data) impl_specimen_3(inst2) def impl_specimen_4(inst): assert ( inst.accessionIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/labs/accession-ids"} ).valueUri ) assert inst.accessionIdentifier.value == "20150816-00124" assert ( inst.collection.collectedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-16T06:40:17Z"} ).valueDateTime ) assert inst.collection.collector.reference == "Practitioner/f202" assert inst.container[0].type.coding[0].code == "SST" assert inst.container[0].type.coding[0].display == "Serum Separator Tube" assert ( inst.container[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/labs"} ).valueUri ) assert inst.id == "sst" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.request[0].reference == "ServiceRequest/ft4" assert inst.subject.reference == "Patient/pat2" assert inst.text.status == "generated" assert inst.type.coding[0].code == "119364003" assert inst.type.coding[0].display == "Serum sample" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_specimen_4(base_settings): """No. 4 tests collection for Specimen. Test File: specimen-example-serum.json """ filename = base_settings["unittest_data_dir"] / "specimen-example-serum.json" inst = specimen.Specimen.model_validate_json(filename.read_bytes()) assert "Specimen" == inst.get_resource_type() impl_specimen_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Specimen" == data["resourceType"] inst2 = specimen.Specimen(**data) impl_specimen_4(inst2) def impl_specimen_5(inst): assert ( inst.accessionIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://lab.acme.org/specimens/2011"} ).valueUri ) assert inst.accessionIdentifier.value == "X352356" assert inst.collection.bodySite.coding[0].code == "49852007" assert ( inst.collection.bodySite.coding[0].display == "Structure of median cubital vein (body structure)" ) assert ( inst.collection.bodySite.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.collection.bodySite.text == "Right median cubital vein" assert ( inst.collection.collectedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2011-05-30T06:15:00Z"} ).valueDateTime ) assert inst.collection.collector.reference == "Practitioner/example" assert inst.collection.method.coding[0].code == "LNV" assert ( inst.collection.method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0488"} ).valueUri ) assert inst.collection.quantity.unit == "mL" assert float(inst.collection.quantity.value) == float(6) assert inst.contained[0].id == "hep" assert inst.container[0].additiveReference.reference == "#hep" assert inst.container[0].capacity.unit == "mL" assert float(inst.container[0].capacity.value) == float(10) assert inst.container[0].description == "Green Gel tube" assert inst.container[0].identifier[0].value == "48736-15394-75465" assert inst.container[0].specimenQuantity.unit == "mL" assert float(inst.container[0].specimenQuantity.value) == float(6) assert inst.container[0].type.text == "Vacutainer" assert inst.id == "101" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ehr.acme.org/identifiers/collections"} ).valueUri ) assert inst.identifier[0].value == "23234352356" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "Specimen is grossly lipemic" assert ( inst.receivedTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2011-03-04T07:03:00Z"} ).valueDateTime ) assert inst.request[0].reference == "ServiceRequest/example" assert inst.status == "available" assert inst.subject.display == "Peter Patient" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" assert inst.type.coding[0].code == "122555007" assert inst.type.coding[0].display == "Venous blood specimen" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_specimen_5(base_settings): """No. 5 tests collection for Specimen. Test File: specimen-example.json """ filename = base_settings["unittest_data_dir"] / "specimen-example.json" inst = specimen.Specimen.model_validate_json(filename.read_bytes()) assert "Specimen" == inst.get_resource_type() impl_specimen_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Specimen" == data["resourceType"] inst2 = specimen.Specimen(**data) impl_specimen_5(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_specimendefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/SpecimenDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import specimendefinition from .conftest import ExternalValidatorModel # noqa: F401 def impl_specimendefinition_1(inst): assert inst.id == "2364" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patientPreparation[0].text == "12 hour fasting" assert inst.patientPreparation[1].coding[0].code == "263678003" assert inst.patientPreparation[1].coding[0].display == "At rest" assert ( inst.patientPreparation[1].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.text.status == "generated" assert inst.timeAspect == "preferrably morning time" assert inst.typeCollected.coding[0].code == "122555007" assert inst.typeCollected.coding[0].display == "Venous blood specimen" assert ( inst.typeCollected.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.typeTested[0].container.cap.coding[0].code == "yellow" assert inst.typeTested[0].container.cap.coding[0].display == "yellow cap" assert ( inst.typeTested[0].container.cap.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:6710:2017"} ).valueUri ) assert inst.typeTested[0].container.material.coding[0].code == "61088005" assert inst.typeTested[0].container.material.coding[0].display == "plastic" assert ( inst.typeTested[0].container.material.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.typeTested[0].container.minimumVolumeQuantity.code == "mL" assert ( inst.typeTested[0].container.minimumVolumeQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[0].container.minimumVolumeQuantity.unit == "ml" assert float(inst.typeTested[0].container.minimumVolumeQuantity.value) == float(2) assert inst.typeTested[0].container.type.coding[0].code == "702281005" assert inst.typeTested[0].container.type.coding[0].display == ( "Evacuated blood collection tube, thrombin/clot activator/gel" " separator" ) assert ( inst.typeTested[0].container.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.typeTested[0].handling[0].maxDuration.code == "min" assert ( inst.typeTested[0].handling[0].maxDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[0].handling[0].maxDuration.unit == "minute" assert float(inst.typeTested[0].handling[0].maxDuration.value) == float(60) assert ( inst.typeTested[0].handling[0].temperatureQualifier.text == "Ambient temperature" ) assert inst.typeTested[0].handling[0].temperatureRange.high.code == "Cel" assert ( inst.typeTested[0].handling[0].temperatureRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[0].handling[0].temperatureRange.high.unit == "°C" assert float(inst.typeTested[0].handling[0].temperatureRange.high.value) == float( 25 ) assert inst.typeTested[0].handling[0].temperatureRange.low.code == "Cel" assert ( inst.typeTested[0].handling[0].temperatureRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[0].handling[0].temperatureRange.low.unit == "°C" assert float(inst.typeTested[0].handling[0].temperatureRange.low.value) == float(15) assert inst.typeTested[0].handling[1].maxDuration.code == "h" assert ( inst.typeTested[0].handling[1].maxDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[0].handling[1].maxDuration.unit == "hour" assert float(inst.typeTested[0].handling[1].maxDuration.value) == float(8) assert ( inst.typeTested[0].handling[1].temperatureQualifier.text == "Refrigerated temperature" ) assert inst.typeTested[0].handling[1].temperatureRange.high.code == "Cel" assert ( inst.typeTested[0].handling[1].temperatureRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[0].handling[1].temperatureRange.high.unit == "°C" assert float(inst.typeTested[0].handling[1].temperatureRange.high.value) == float(8) assert inst.typeTested[0].handling[1].temperatureRange.low.code == "Cel" assert ( inst.typeTested[0].handling[1].temperatureRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[0].handling[1].temperatureRange.low.unit == "°C" assert float(inst.typeTested[0].handling[1].temperatureRange.low.value) == float(2) assert inst.typeTested[0].preference == "preferred" assert inst.typeTested[0].type.coding[0].code == "119364003" assert inst.typeTested[0].type.coding[0].display == "Serum specimen" assert ( inst.typeTested[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.typeTested[1].container.cap.coding[0].code == "green" assert inst.typeTested[1].container.cap.coding[0].display == "green cap" assert ( inst.typeTested[1].container.cap.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:6710:2017"} ).valueUri ) assert inst.typeTested[1].container.material.coding[0].code == "32039001" assert inst.typeTested[1].container.material.coding[0].display == "glass" assert ( inst.typeTested[1].container.material.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.typeTested[1].container.minimumVolumeQuantity.code == "mL" assert ( inst.typeTested[1].container.minimumVolumeQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[1].container.minimumVolumeQuantity.unit == "ml" assert float(inst.typeTested[1].container.minimumVolumeQuantity.value) == float(2) assert inst.typeTested[1].container.type.coding[0].code == "767390000" assert inst.typeTested[1].container.type.coding[0].display == ( "Evacuated blood collection tube with heparin lithium and gel" " separator" ) assert ( inst.typeTested[1].container.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.typeTested[1].handling[0].maxDuration.code == "min" assert ( inst.typeTested[1].handling[0].maxDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[1].handling[0].maxDuration.unit == "minute" assert float(inst.typeTested[1].handling[0].maxDuration.value) == float(60) assert ( inst.typeTested[1].handling[0].temperatureQualifier.text == "Ambient temperature" ) assert inst.typeTested[1].handling[0].temperatureRange.high.code == "Cel" assert ( inst.typeTested[1].handling[0].temperatureRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[1].handling[0].temperatureRange.high.unit == "°C" assert float(inst.typeTested[1].handling[0].temperatureRange.high.value) == float( 25 ) assert inst.typeTested[1].handling[0].temperatureRange.low.code == "Cel" assert ( inst.typeTested[1].handling[0].temperatureRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[1].handling[0].temperatureRange.low.unit == "°C" assert float(inst.typeTested[1].handling[0].temperatureRange.low.value) == float(15) assert inst.typeTested[1].handling[1].maxDuration.code == "h" assert ( inst.typeTested[1].handling[1].maxDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[1].handling[1].maxDuration.unit == "hour" assert float(inst.typeTested[1].handling[1].maxDuration.value) == float(8) assert ( inst.typeTested[1].handling[1].temperatureQualifier.text == "Refrigerated temperature" ) assert inst.typeTested[1].handling[1].temperatureRange.high.code == "Cel" assert ( inst.typeTested[1].handling[1].temperatureRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[1].handling[1].temperatureRange.high.unit == "°C" assert float(inst.typeTested[1].handling[1].temperatureRange.high.value) == float(8) assert inst.typeTested[1].handling[1].temperatureRange.low.code == "Cel" assert ( inst.typeTested[1].handling[1].temperatureRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[1].handling[1].temperatureRange.low.unit == "°C" assert float(inst.typeTested[1].handling[1].temperatureRange.low.value) == float(2) assert inst.typeTested[1].preference == "alternate" assert inst.typeTested[1].rejectionCriterion[0].coding[0].code == "insufficient" assert ( inst.typeTested[1].rejectionCriterion[0].coding[0].display == "insufficient specimen volume" ) assert ( inst.typeTested[1].rejectionCriterion[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/rejection-criteria"} ).valueUri ) assert inst.typeTested[1].rejectionCriterion[1].coding[0].code == "hemolized" assert ( inst.typeTested[1].rejectionCriterion[1].coding[0].display == "hemolized specimen" ) assert ( inst.typeTested[1].rejectionCriterion[1].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/rejection-criteria"} ).valueUri ) assert inst.typeTested[1].type.coding[0].code == "119361006" assert inst.typeTested[1].type.coding[0].display == "Plasma specimen" assert ( inst.typeTested[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_specimendefinition_1(base_settings): """No. 1 tests collection for SpecimenDefinition. Test File: specimendefinition-example-serum-plasma.json """ filename = ( base_settings["unittest_data_dir"] / "specimendefinition-example-serum-plasma.json" ) inst = specimendefinition.SpecimenDefinition.model_validate_json( filename.read_bytes() ) assert "SpecimenDefinition" == inst.get_resource_type() impl_specimendefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SpecimenDefinition" == data["resourceType"] inst2 = specimendefinition.SpecimenDefinition(**data) impl_specimendefinition_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_structuremap.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/StructureMap Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import structuremap from .conftest import ExternalValidatorModel # noqa: F401 def impl_structuremap_1(inst): assert inst.experimental is True assert inst.group[0].input[0].mode == "source" assert inst.group[0].input[0].name == "source" assert inst.group[0].input[0].type == "ActivityDefinition" assert inst.group[0].input[1].mode == "target" assert inst.group[0].input[1].name == "target" assert inst.group[0].input[1].type == "SupplyRequest" assert inst.group[0].name == "main" assert inst.group[0].rule[0].name == "status" assert inst.group[0].rule[0].source[0].context == "source" assert inst.group[0].rule[0].source[0].element == "id" assert inst.group[0].rule[0].source[0].variable == "a" assert inst.group[0].rule[0].target[0].context == "target" assert inst.group[0].rule[0].target[0].contextType == "variable" assert inst.group[0].rule[0].target[0].element == "status" assert inst.group[0].rule[0].target[0].parameter[0].valueString == "'draft'" assert inst.group[0].rule[0].target[0].transform == "evaluate" assert inst.group[0].rule[1].name == "category" assert inst.group[0].rule[1].source[0].context == "source" assert inst.group[0].rule[1].source[0].element == "id" assert inst.group[0].rule[1].source[0].variable == "a" assert inst.group[0].rule[1].target[0].context == "target" assert inst.group[0].rule[1].target[0].contextType == "variable" assert inst.group[0].rule[1].target[0].element == "category" assert inst.group[0].rule[1].target[0].parameter[0].valueString == "'non-stock'" assert inst.group[0].rule[1].target[0].transform == "evaluate" assert inst.group[0].rule[2].name == "priority" assert inst.group[0].rule[2].source[0].context == "source" assert inst.group[0].rule[2].source[0].element == "id" assert inst.group[0].rule[2].source[0].variable == "a" assert inst.group[0].rule[2].target[0].context == "target" assert inst.group[0].rule[2].target[0].contextType == "variable" assert inst.group[0].rule[2].target[0].element == "priority" assert inst.group[0].rule[2].target[0].parameter[0].valueString == "'routine'" assert inst.group[0].rule[2].target[0].transform == "evaluate" assert inst.group[0].rule[3].name == "quantity" assert inst.group[0].rule[3].source[0].context == "source" assert inst.group[0].rule[3].source[0].element == "quantity" assert inst.group[0].rule[3].source[0].variable == "a" assert inst.group[0].rule[3].target[0].context == "target" assert inst.group[0].rule[3].target[0].contextType == "variable" assert inst.group[0].rule[3].target[0].element == "category" assert inst.group[0].rule[3].target[0].transform == "copy" assert inst.group[0].rule[4].name == "item" assert inst.group[0].rule[4].source[0].context == "source" assert inst.group[0].rule[4].source[0].element == "code" assert inst.group[0].rule[4].source[0].variable == "a" assert inst.group[0].rule[4].target[0].context == "target" assert inst.group[0].rule[4].target[0].contextType == "variable" assert inst.group[0].rule[4].target[0].element == "orderedItem.itemCodeableConcept" assert inst.group[0].rule[4].target[0].transform == "copy" assert inst.group[0].rule[5].name == "when" assert inst.group[0].rule[5].source[0].context == "source" assert inst.group[0].rule[5].source[0].element == "id" assert inst.group[0].rule[5].source[0].variable == "a" assert inst.group[0].rule[5].target[0].context == "target" assert inst.group[0].rule[5].target[0].contextType == "variable" assert inst.group[0].rule[5].target[0].element == "occurrenceDateTime" assert inst.group[0].rule[5].target[0].parameter[0].valueString == "now()" assert inst.group[0].rule[5].target[0].transform == "evaluate" assert inst.group[0].rule[6].name == "authoredOn" assert inst.group[0].rule[6].source[0].context == "source" assert inst.group[0].rule[6].source[0].element == "id" assert inst.group[0].rule[6].source[0].variable == "a" assert inst.group[0].rule[6].target[0].context == "target" assert inst.group[0].rule[6].target[0].contextType == "variable" assert inst.group[0].rule[6].target[0].element == "authoredOn" assert inst.group[0].rule[6].target[0].parameter[0].valueString == "now()" assert inst.group[0].rule[6].target[0].transform == "evaluate" assert inst.group[0].typeMode == "none" assert inst.id == "supplyrequest-transform" assert inst.name == "Transform from an ActivityDefinition to a SupplyRequest" assert inst.status == "draft" assert inst.structure[0].mode == "source" assert ( inst.structure[0].url == "http://hl7.org/fhir/StructureDefinition/activitydefinition" ) assert inst.structure[1].mode == "target" assert ( inst.structure[1].url == "http://hl7.org/fhir/StructureDefinition/supplyrequest" ) assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureMap/supplyrequest-transform"} ).valueUri ) def test_structuremap_1(base_settings): """No. 1 tests collection for StructureMap. Test File: structuremap-supplyrequest-transform.json """ filename = ( base_settings["unittest_data_dir"] / "structuremap-supplyrequest-transform.json" ) inst = structuremap.StructureMap.model_validate_json(filename.read_bytes()) assert "StructureMap" == inst.get_resource_type() impl_structuremap_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "StructureMap" == data["resourceType"] inst2 = structuremap.StructureMap(**data) impl_structuremap_1(inst2) def impl_structuremap_2(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-09"} ).valueDateTime ) assert inst.description == "Example Structure Map" assert inst.experimental is True assert inst.group[0].documentation == "test -> testValue" assert inst.group[0].input[0].mode == "source" assert inst.group[0].input[0].name == "test" assert inst.group[0].name == "Examples" assert inst.group[0].rule[0].name == "rule1" assert inst.group[0].rule[0].source[0].context == "Source" assert inst.group[0].rule[0].source[0].element == "test" assert inst.group[0].rule[0].source[0].type == "SourceClassA" assert inst.group[0].rule[0].source[0].variable == "t" assert inst.group[0].rule[0].target[0].context == "Destination" assert inst.group[0].rule[0].target[0].contextType == "variable" assert inst.group[0].rule[0].target[0].element == "testValue" assert inst.group[0].rule[0].target[0].transform == "copy" assert inst.group[0].typeMode == "none" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:37843577-95fb-4adb-84c0-8837188a7bf3" assert inst.jurisdiction[0].coding[0].code == "009" assert inst.jurisdiction[0].coding[0].display == "Oceania" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert inst.name == "ExampleMap" assert inst.publisher == "HL7 FHIR Standard" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Example Map" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureMap/example"} ).valueUri ) assert inst.version == "0.1" def test_structuremap_2(base_settings): """No. 2 tests collection for StructureMap. Test File: structuremap-example.json """ filename = base_settings["unittest_data_dir"] / "structuremap-example.json" inst = structuremap.StructureMap.model_validate_json(filename.read_bytes()) assert "StructureMap" == inst.get_resource_type() impl_structuremap_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "StructureMap" == data["resourceType"] inst2 = structuremap.StructureMap(**data) impl_structuremap_2(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_subscription.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Subscription Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import subscription from .conftest import ExternalValidatorModel # noqa: F401 def impl_subscription_1(inst): assert ( inst.channel.endpoint == ExternalValidatorModel.model_validate( {"valueUrl": "https://biliwatch.com/customers/mount-auburn-miu/on-result"} ).valueUrl ) assert inst.channel.header[0] == "Authorization: Bearer secret-token-abc-123" assert inst.channel.payload == "application/fhir+json" assert inst.channel.type == "rest-hook" assert inst.contact[0].system == "phone" assert inst.contact[0].value == "ext 4123" assert inst.criteria == "Observation?code=http://loinc.org|1975-2" assert ( inst.end == ExternalValidatorModel.model_validate( {"valueInstant": "2021-01-01T00:00:00Z"} ).valueInstant ) assert inst.error == "Socket Error 10060 - can't connect to host" assert inst.id == "example-error" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.reason == "Monitor new neonatal function" assert inst.status == "error" assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" def test_subscription_1(base_settings): """No. 1 tests collection for Subscription. Test File: subscription-example-error.json """ filename = base_settings["unittest_data_dir"] / "subscription-example-error.json" inst = subscription.Subscription.model_validate_json(filename.read_bytes()) assert "Subscription" == inst.get_resource_type() impl_subscription_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Subscription" == data["resourceType"] inst2 = subscription.Subscription(**data) impl_subscription_1(inst2) def impl_subscription_2(inst): assert ( inst.channel.endpoint == ExternalValidatorModel.model_validate( {"valueUrl": "https://biliwatch.com/customers/mount-auburn-miu/on-result"} ).valueUrl ) assert inst.channel.header[0] == "Authorization: Bearer secret-token-abc-123" assert inst.channel.payload == "application/fhir+json" assert inst.channel.type == "rest-hook" assert inst.contact[0].system == "phone" assert inst.contact[0].value == "ext 4123" assert inst.criteria == "Observation?code=http://loinc.org|1975-2" assert ( inst.end == ExternalValidatorModel.model_validate( {"valueInstant": "2021-01-01T00:00:00Z"} ).valueInstant ) assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.reason == "Monitor new neonatal function" assert inst.status == "requested" assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" def test_subscription_2(base_settings): """No. 2 tests collection for Subscription. Test File: subscription-example.json """ filename = base_settings["unittest_data_dir"] / "subscription-example.json" inst = subscription.Subscription.model_validate_json(filename.read_bytes()) assert "Subscription" == inst.get_resource_type() impl_subscription_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Subscription" == data["resourceType"] inst2 = subscription.Subscription(**data) impl_subscription_2(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_subscriptionstatus.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/SubscriptionStatus Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import subscriptionstatus from .conftest import ExternalValidatorModel # noqa: F401 def impl_subscriptionstatus_1(inst): assert inst.eventsSinceSubscriptionStart == "1000" assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.notificationEvent[0].eventNumber == "1000" assert ( inst.notificationEvent[0].focus.reference == "urn:uuid:9986fc11-a845-4965-af24-45312fd0cc4e" ) assert inst.status == "active" assert inst.subscription.reference == "http://example.org/FHIR/R4B/Subscription/123" assert inst.text.status == "generated" assert inst.topic == "http://example.org/FHIR/R4B/SubscriptionTopic/admission" assert inst.type == "event-notification" def test_subscriptionstatus_1(base_settings): """No. 1 tests collection for SubscriptionStatus. Test File: subscriptionstatus-example.json """ filename = base_settings["unittest_data_dir"] / "subscriptionstatus-example.json" inst = subscriptionstatus.SubscriptionStatus.model_validate_json( filename.read_bytes() ) assert "SubscriptionStatus" == inst.get_resource_type() impl_subscriptionstatus_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SubscriptionStatus" == data["resourceType"] inst2 = subscriptionstatus.SubscriptionStatus(**data) impl_subscriptionstatus_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_subscriptiontopic.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/SubscriptionTopic Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import subscriptiontopic from .conftest import ExternalValidatorModel # noqa: F401 def impl_subscriptiontopic_1(inst): assert inst.canFilterBy[0].description == ( "Matching based on the Patient (subject) of an Encounter or " "based on the Patient's group membership (in/not-in)." ) assert inst.canFilterBy[0].filterParameter == "patient" assert inst.canFilterBy[0].modifier[0] == "=" assert inst.canFilterBy[0].modifier[1] == "in" assert inst.canFilterBy[0].modifier[2] == "not-in" assert ( inst.canFilterBy[0].resource == ExternalValidatorModel.model_validate({"valueUri": "Encounter"}).valueUri ) assert inst.description == "Example admission topic" assert ( inst.eventTrigger[0].description == "Patient admission is covered by HL7v2 ADT^A01" ) assert inst.eventTrigger[0].event.coding[0].code == "A01" assert ( inst.eventTrigger[0].event.coding[0].display == "ADT/ACK - Admit/visit notification" ) assert ( inst.eventTrigger[0].event.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0003"} ).valueUri ) assert ( inst.eventTrigger[0].resource == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/Encounter"} ).valueUri ) assert inst.id == "admission" assert inst.notificationShape[0].include[0] == "Encounter:patient" assert inst.notificationShape[0].include[1] == "Encounter:practitioner" assert inst.notificationShape[0].include[2] == "Encounter:service-provider" assert inst.notificationShape[0].include[3] == "Encounter:account" assert inst.notificationShape[0].include[4] == "Encounter:diagnosis" assert inst.notificationShape[0].include[5] == "Encounter:observation" assert inst.notificationShape[0].include[6] == "Encounter:location" assert ( inst.notificationShape[0].resource == ExternalValidatorModel.model_validate({"valueUri": "Encounter"}).valueUri ) assert ( inst.resourceTrigger[0].description == "Encounter resource moving to state 'in-progress'" ) assert inst.resourceTrigger[0].fhirPathCriteria == ( "%previous.status!='in-progress' and %current.status='in-" "progress'" ) assert inst.resourceTrigger[0].queryCriteria.current == "status=in-progress" assert inst.resourceTrigger[0].queryCriteria.previous == "status:not=in-progress" assert inst.resourceTrigger[0].queryCriteria.requireBoth is True assert inst.resourceTrigger[0].queryCriteria.resultForCreate == "test-passes" assert inst.resourceTrigger[0].queryCriteria.resultForDelete == "test-fails" assert ( inst.resourceTrigger[0].resource == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/Encounter"} ).valueUri ) assert inst.resourceTrigger[0].supportedInteraction[0] == "create" assert inst.resourceTrigger[0].supportedInteraction[1] == "update" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "admission" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/FHIR/R4B/SubscriptionTopic/admission"} ).valueUri ) def test_subscriptiontopic_1(base_settings): """No. 1 tests collection for SubscriptionTopic. Test File: subscriptiontopic-example-admission.json """ filename = ( base_settings["unittest_data_dir"] / "subscriptiontopic-example-admission.json" ) inst = subscriptiontopic.SubscriptionTopic.model_validate_json( filename.read_bytes() ) assert "SubscriptionTopic" == inst.get_resource_type() impl_subscriptiontopic_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SubscriptionTopic" == data["resourceType"] inst2 = subscriptiontopic.SubscriptionTopic(**data) impl_subscriptiontopic_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_substance.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Substance Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import substance from .conftest import ExternalValidatorModel # noqa: F401 def impl_substance_1(inst): assert inst.category[0].coding[0].code == "chemical" assert inst.category[0].coding[0].display == "Chemical" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/substance-category"} ).valueUri ) assert inst.code.coding[0].code == "333346007" assert inst.code.coding[0].display == "Silver nitrate 20% solution (product)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.description == "Solution for silver nitrate stain" assert inst.id == "f204" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org/identifiers/substances"} ).valueUri ) assert inst.identifier[0].value == "15970" assert ( inst.instance[0].expiry == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-01-01"} ).valueDateTime ) assert ( inst.instance[0].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org/identifiers/substances/lot"} ).valueUri ) assert inst.instance[0].identifier.value == "AB94687" assert inst.instance[0].quantity.code == "mL" assert ( inst.instance[0].quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.instance[0].quantity.unit == "mL" assert float(inst.instance[0].quantity.value) == float(100) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_substance_1(base_settings): """No. 1 tests collection for Substance. Test File: substance-example-silver-nitrate-product.json """ filename = ( base_settings["unittest_data_dir"] / "substance-example-silver-nitrate-product.json" ) inst = substance.Substance.model_validate_json(filename.read_bytes()) assert "Substance" == inst.get_resource_type() impl_substance_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Substance" == data["resourceType"] inst2 = substance.Substance(**data) impl_substance_1(inst2) def impl_substance_2(inst): assert inst.category[0].coding[0].code == "drug" assert inst.category[0].coding[0].display == "Drug or Medicament" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/substance-category"} ).valueUri ) assert inst.code.coding[0].code == "392259005" assert inst.code.coding[0].display == ( "Amoxicillin + clavulanate potassium 875mg/125mg tablet " "(product)" ) assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.contained[0].id == "ingr1" assert inst.contained[1].id == "ingr2" assert inst.description == "Augmentin 875" assert inst.id == "f205" assert inst.ingredient[0].quantity.denominator.code == "mg" assert ( inst.ingredient[0].quantity.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.ingredient[0].quantity.denominator.unit == "mg" assert float(inst.ingredient[0].quantity.denominator.value) == float(1000) assert inst.ingredient[0].quantity.numerator.code == "mg" assert ( inst.ingredient[0].quantity.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.ingredient[0].quantity.numerator.unit == "mg" assert float(inst.ingredient[0].quantity.numerator.value) == float(875) assert inst.ingredient[0].substanceReference.reference == "#ingr1" assert inst.ingredient[1].quantity.denominator.code == "mg" assert ( inst.ingredient[1].quantity.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.ingredient[1].quantity.denominator.unit == "mg" assert float(inst.ingredient[1].quantity.denominator.value) == float(1000) assert inst.ingredient[1].quantity.numerator.code == "mg" assert ( inst.ingredient[1].quantity.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.ingredient[1].quantity.numerator.unit == "mg" assert float(inst.ingredient[1].quantity.numerator.value) == float(125) assert inst.ingredient[1].substanceReference.reference == "#ingr2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_substance_2(base_settings): """No. 2 tests collection for Substance. Test File: substance-example-amoxicillin-clavulanate.json """ filename = ( base_settings["unittest_data_dir"] / "substance-example-amoxicillin-clavulanate.json" ) inst = substance.Substance.model_validate_json(filename.read_bytes()) assert "Substance" == inst.get_resource_type() impl_substance_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Substance" == data["resourceType"] inst2 = substance.Substance(**data) impl_substance_2(inst2) def impl_substance_3(inst): assert inst.category[0].coding[0].code == "chemical" assert inst.category[0].coding[0].display == "Chemical" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/substance-category"} ).valueUri ) assert inst.code.coding[0].code == "88480006" assert inst.code.coding[0].display == "Potassium" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "f203" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org/identifiers/substances"} ).valueUri ) assert inst.identifier[0].value == "1234" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_substance_3(base_settings): """No. 3 tests collection for Substance. Test File: substance-example-f203-potassium.json """ filename = ( base_settings["unittest_data_dir"] / "substance-example-f203-potassium.json" ) inst = substance.Substance.model_validate_json(filename.read_bytes()) assert "Substance" == inst.get_resource_type() impl_substance_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Substance" == data["resourceType"] inst2 = substance.Substance(**data) impl_substance_3(inst2) def impl_substance_4(inst): assert inst.code.coding[0].code == "406466009" assert inst.code.coding[0].display == "House dust allergen" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "f201" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_substance_4(base_settings): """No. 4 tests collection for Substance. Test File: substance-example-f201-dust.json """ filename = base_settings["unittest_data_dir"] / "substance-example-f201-dust.json" inst = substance.Substance.model_validate_json(filename.read_bytes()) assert "Substance" == inst.get_resource_type() impl_substance_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Substance" == data["resourceType"] inst2 = substance.Substance(**data) impl_substance_4(inst2) def impl_substance_5(inst): assert inst.category[0].coding[0].code == "allergen" assert inst.category[0].coding[0].display == "Allergen" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/substance-category"} ).valueUri ) assert inst.code.text == "apitoxin (Honey Bee Venom)" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org/identifiers/substances"} ).valueUri ) assert inst.identifier[0].value == "1463" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "active" assert inst.text.status == "generated" def test_substance_5(base_settings): """No. 5 tests collection for Substance. Test File: substance-example.json """ filename = base_settings["unittest_data_dir"] / "substance-example.json" inst = substance.Substance.model_validate_json(filename.read_bytes()) assert "Substance" == inst.get_resource_type() impl_substance_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Substance" == data["resourceType"] inst2 = substance.Substance(**data) impl_substance_5(inst2) def impl_substance_6(inst): assert inst.code.coding[0].code == "3092008" assert inst.code.coding[0].display == "Staphylococcus Aureus" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "f202" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_substance_6(base_settings): """No. 6 tests collection for Substance. Test File: substance-example-f202-staphylococcus.json """ filename = ( base_settings["unittest_data_dir"] / "substance-example-f202-staphylococcus.json" ) inst = substance.Substance.model_validate_json(filename.read_bytes()) assert "Substance" == inst.get_resource_type() impl_substance_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Substance" == data["resourceType"] inst2 = substance.Substance(**data) impl_substance_6(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_substancedefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/SubstanceDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import substancedefinition from .conftest import ExternalValidatorModel # noqa: F401 def impl_substancedefinition_1(inst): assert inst.classification[0].coding[0].code == "100000075670" assert inst.classification[0].coding[0].display == "Chemical" assert ( inst.classification[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.europa.eu/fhir/SubstanceType"} ).valueUri ) assert inst.code[0].code.coding[0].code == "SUB99611MIG" assert ( inst.code[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.europa.eu/fhir/Substance"} ).valueUri ) assert inst.domain.coding[0].code == "100000000012" assert inst.domain.coding[0].display == "Human use" assert ( inst.domain.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.europa.eu/fhir/Domain"} ).valueUri ) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.europa.eu/fhir/SMSId"} ).valueUri ) assert inst.identifier[0].value == "100000099270" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].language[0].coding[0].code == "100000072147" assert inst.name[0].language[0].coding[0].display == "English" assert ( inst.name[0].language[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.europa.eu/fhir/Language"} ).valueUri ) assert inst.name[0].name == "PARACETAMOL" assert inst.name[0].preferred is True assert inst.name[0].status.coding[0].code == "200000005004" assert inst.name[0].status.coding[0].display == "Current" assert ( inst.name[0].status.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.europa.eu/fhir/Status"} ).valueUri ) assert inst.name[1].language[0].coding[0].code == "100000072181" assert inst.name[1].language[0].coding[0].display == "Greek, Modern (1453-)" assert ( inst.name[1].language[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.europa.eu/fhir/Language"} ).valueUri ) assert inst.name[1].name == "ΠΑΡΑΚΕΤΑΜΌΛΗ" assert inst.name[1].preferred is False assert inst.name[1].status.coding[0].code == "200000005004" assert inst.name[1].status.coding[0].display == "Current" assert ( inst.name[1].status.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.europa.eu/fhir/Status"} ).valueUri ) assert inst.name[2].language[0].coding[0].code == "100000072142" assert inst.name[2].language[0].coding[0].display == "Bulgarian" assert ( inst.name[2].language[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.europa.eu/fhir/Language"} ).valueUri ) assert inst.name[2].name == "ПАРАЦЕТАМОЛ" assert inst.name[2].preferred is False assert inst.name[2].status.coding[0].code == "200000005004" assert inst.name[2].status.coding[0].display == "Current" assert ( inst.name[2].status.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.europa.eu/fhir/Status"} ).valueUri ) assert inst.name[3].language[0].coding[0].code == "100000072147" assert inst.name[3].language[0].coding[0].display == "English" assert ( inst.name[3].language[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.europa.eu/fhir/Language"} ).valueUri ) assert inst.name[3].name == "ACETAMINOPHEN" assert inst.name[3].preferred is False assert inst.name[3].status.coding[0].code == "200000005004" assert inst.name[3].status.coding[0].display == "Current" assert ( inst.name[3].status.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.europa.eu/fhir/Status"} ).valueUri ) assert inst.status.coding[0].code == "200000005004" assert inst.status.coding[0].display == "Current" assert ( inst.status.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.europa.eu/fhir/Status"} ).valueUri ) assert inst.text.status == "generated" def test_substancedefinition_1(base_settings): """No. 1 tests collection for SubstanceDefinition. Test File: substancedefinition-example.json """ filename = base_settings["unittest_data_dir"] / "substancedefinition-example.json" inst = substancedefinition.SubstanceDefinition.model_validate_json( filename.read_bytes() ) assert "SubstanceDefinition" == inst.get_resource_type() impl_substancedefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SubstanceDefinition" == data["resourceType"] inst2 = substancedefinition.SubstanceDefinition(**data) impl_substancedefinition_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_supplydelivery.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/SupplyDelivery Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import supplydelivery from .conftest import ExternalValidatorModel # noqa: F401 def impl_supplydelivery_1(inst): assert inst.basedOn[0].reference == "SupplyRequest/simpleorder" assert inst.destination.display == "Location 1" assert inst.id == "simpledelivery" assert inst.identifier[0].value == "Order10284" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-12-31"} ).valueDateTime ) assert inst.partOf[0].display == "Central Supply Restock" assert inst.status == "completed" assert inst.suppliedItem.itemCodeableConcept.coding[0].code == "BlueTubes" assert ( inst.suppliedItem.itemCodeableConcept.coding[0].display == "Blood collect tubes blue cap" ) assert float(inst.suppliedItem.quantity.value) == float(10) assert inst.supplier.display == "Vendor1" assert inst.text.status == "generated" assert inst.type.coding[0].code == "device" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/supply-item-type"} ).valueUri ) assert inst.type.text == "Blood collect tubes blue cap" def test_supplydelivery_1(base_settings): """No. 1 tests collection for SupplyDelivery. Test File: supplydelivery-example.json """ filename = base_settings["unittest_data_dir"] / "supplydelivery-example.json" inst = supplydelivery.SupplyDelivery.model_validate_json(filename.read_bytes()) assert "SupplyDelivery" == inst.get_resource_type() impl_supplydelivery_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SupplyDelivery" == data["resourceType"] inst2 = supplydelivery.SupplyDelivery(**data) impl_supplydelivery_1(inst2) def impl_supplydelivery_2(inst): assert inst.destination.display == "Home care dept" assert inst.id == "pumpdelivery" assert inst.identifier[0].assigner.display == "SupplierDeliveryNr" assert inst.identifier[0].value == "98398459409" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.display == "Mr. Belpit" assert inst.receiver[0].display == "Nurse Smith" assert inst.status == "in-progress" assert inst.supplier.display == "ACME distribution" assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" def test_supplydelivery_2(base_settings): """No. 2 tests collection for SupplyDelivery. Test File: supplydelivery-example-pumpdelivery.json """ filename = ( base_settings["unittest_data_dir"] / "supplydelivery-example-pumpdelivery.json" ) inst = supplydelivery.SupplyDelivery.model_validate_json(filename.read_bytes()) assert "SupplyDelivery" == inst.get_resource_type() impl_supplydelivery_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SupplyDelivery" == data["resourceType"] inst2 = supplydelivery.SupplyDelivery(**data) impl_supplydelivery_2(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_supplyrequest.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/SupplyRequest Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import supplyrequest from .conftest import ExternalValidatorModel # noqa: F401 def impl_supplyrequest_1(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-12-31"} ).valueDateTime ) assert inst.category.coding[0].code == "central" assert inst.category.coding[0].display == "Central Stock Resupply" assert inst.deliverFrom.display == "Location 1" assert inst.deliverTo.display == "GoodHealth Clinic Receiving" assert inst.id == "simpleorder" assert inst.identifier[0].value == "Order10284" assert inst.itemCodeableConcept.coding[0].code == "BlueTubes" assert inst.itemCodeableConcept.coding[0].display == "Blood collect tubes blue cap" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-12-31"} ).valueDateTime ) assert inst.priority == "asap" assert float(inst.quantity.value) == float(10) assert inst.reasonCode[0].coding[0].code == "stock_low" assert inst.reasonCode[0].coding[0].display == "Refill due to low stock" assert inst.requester.display == "Henry Seven" assert inst.status == "active" assert inst.supplier[0].display == "Vendor1" assert inst.text.status == "generated" def test_supplyrequest_1(base_settings): """No. 1 tests collection for SupplyRequest. Test File: supplyrequest-example-simpleorder.json """ filename = ( base_settings["unittest_data_dir"] / "supplyrequest-example-simpleorder.json" ) inst = supplyrequest.SupplyRequest.model_validate_json(filename.read_bytes()) assert "SupplyRequest" == inst.get_resource_type() impl_supplyrequest_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SupplyRequest" == data["resourceType"] inst2 = supplyrequest.SupplyRequest(**data) impl_supplyrequest_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_task.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Task Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import task from .conftest import ExternalValidatorModel # noqa: F401 def impl_task_1(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-31T08:25:05+10:00"} ).valueDateTime ) assert inst.basedOn[0].display == "General Wellness Careplan" assert inst.businessStatus.text == "test completed and posted" assert inst.code.text == "Lipid Panel" assert inst.description == ( "Create order for getting specimen, Set up inhouse testing, " "generate order for any sendouts and submit with specimen" ) assert inst.encounter.display == "Example In-Patient Encounter" assert inst.encounter.reference == "Encounter/example" assert ( inst.executionPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-31T18:45:05+10:00"} ).valueDateTime ) assert ( inst.executionPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-31T08:25:05+10:00"} ).valueDateTime ) assert inst.focus.display == "Lipid Panel Request" assert inst.focus.reference == "ServiceRequest/lipid" assert inst.for_fhir.display == "Peter James Chalmers" assert inst.for_fhir.reference == "Patient/example" assert ( inst.groupIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http:/goodhealth.org/accession/identifiers"} ).valueUri ) assert inst.groupIdentifier.use == "official" assert inst.groupIdentifier.value == "G20170201-001" assert inst.id == "example6" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http:/goodhealth.org/identifiers"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "20170201-001" assert inst.intent == "order" assert ( inst.lastModified == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-31T18:45:05+10:00"} ).valueDateTime ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.output[0].type.text == "DiagnosticReport generated" assert inst.output[0].valueReference.reference == "DiagnosticReport/lipids" assert inst.output[1].type.text == "collected specimen" assert inst.output[1].valueReference.reference == "Specimen/101" assert inst.owner.display == "Clinical Laboratory @ Acme Hospital" assert inst.owner.reference == "Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" assert inst.performerType[0].coding[0].code == "performer" assert inst.performerType[0].coding[0].display == "Performer" assert ( inst.performerType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/task-performer-type"} ).valueUri ) assert inst.performerType[0].text == "Performer" assert inst.priority == "routine" assert inst.reasonCode.text == ( "The Task.reason should only be included if there is no " "Task.focus or if it differs from the reason indicated on the" " focus" ) assert inst.requester.display == "Dr Adam Careful" assert inst.requester.reference == "Practitioner/example" assert ( inst.restriction.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-11-02T09:45:05+10:00"} ).valueDateTime ) assert inst.restriction.repetitions == 1 assert inst.status == "completed" assert inst.text.status == "generated" def test_task_1(base_settings): """No. 1 tests collection for Task. Test File: task-example6.json """ filename = base_settings["unittest_data_dir"] / "task-example6.json" inst = task.Task.model_validate_json(filename.read_bytes()) assert "Task" == inst.get_resource_type() impl_task_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Task" == data["resourceType"] inst2 = task.Task(**data) impl_task_1(inst2) def impl_task_2(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-12T08:25:05+10:00"} ).valueDateTime ) assert inst.code.coding[0].code == "poll" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/financialtaskcode"} ).valueUri ) assert inst.id == "fm-example2" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http:/happyvalley.com/task"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "20181012-005" assert inst.input[0].type.coding[0].code == "include" assert ( inst.input[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/financialtaskinputtype"} ).valueUri ) assert inst.input[0].valueCode == "ClaimResponse" assert inst.input[1].type.coding[0].code == "period" assert ( inst.input[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/financialtaskinputtype"} ).valueUri ) assert ( inst.input[1].valuePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-12"} ).valueDateTime ) assert ( inst.input[1].valuePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-01"} ).valueDateTime ) assert inst.intent == "order" assert ( inst.lastModified == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-12T08:25:05+10:00"} ).valueDateTime ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.owner.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://nationalinsurers.com/identifiers"} ).valueUri ) assert inst.owner.identifier.value == "12345" assert inst.priority == "stat" assert inst.requester.display == "Happy Valley Clinic" assert inst.requester.reference == "Organization/example" assert inst.status == "requested" assert inst.text.status == "generated" def test_task_2(base_settings): """No. 2 tests collection for Task. Test File: task-example-fm-poll.json """ filename = base_settings["unittest_data_dir"] / "task-example-fm-poll.json" inst = task.Task.model_validate_json(filename.read_bytes()) assert "Task" == inst.get_resource_type() impl_task_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Task" == data["resourceType"] inst2 = task.Task(**data) impl_task_2(inst2) def impl_task_3(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-31T08:25:05+10:00"} ).valueDateTime ) assert inst.basedOn[0].display == "General Wellness Careplan" assert inst.businessStatus.text == "waiting for specimen" assert inst.code.text == "Lipid Panel" assert inst.contained[0].id == "signature" assert inst.description == ( "Create order for getting specimen, Set up inhouse testing, " "generate order for any sendouts and submit with specimen" ) assert inst.encounter.display == "Example In-Patient Encounter" assert inst.encounter.reference == "Encounter/example" assert ( inst.executionPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-31T08:25:05+10:00"} ).valueDateTime ) assert inst.focus.display == "Lipid Panel Request" assert inst.focus.reference == "ServiceRequest/lipid" assert inst.for_fhir.display == "Peter James Chalmers" assert inst.for_fhir.reference == "Patient/example" assert ( inst.groupIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http:/goodhealth.org/accession/identifiers"} ).valueUri ) assert inst.groupIdentifier.use == "official" assert inst.groupIdentifier.value == "G20170201-001" assert inst.id == "example1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http:/goodhealth.org/identifiers"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "20170201-001" assert inst.intent == "order" assert ( inst.lastModified == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-31T09:45:05+10:00"} ).valueDateTime ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.owner.display == "Clinical Laboratory @ Acme Hospital" assert inst.owner.reference == "Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" assert inst.performerType[0].coding[0].code == "performer" assert inst.performerType[0].coding[0].display == "Performer" assert ( inst.performerType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/task-performer-type"} ).valueUri ) assert inst.performerType[0].text == "Performer" assert inst.priority == "routine" assert inst.reasonCode.text == ( "The Task.reason should only be included if there is no " "Task.focus or if it differs from the reason indicated on the" " focus" ) assert inst.relevantHistory[0].display == "Author's Signature" assert inst.relevantHistory[0].reference == "#signature" assert inst.requester.display == "Dr Adam Careful" assert inst.requester.reference == "Practitioner/example" assert ( inst.restriction.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-11-02T09:45:05+10:00"} ).valueDateTime ) assert inst.restriction.repetitions == 1 assert inst.status == "in-progress" assert inst.text.status == "generated" def test_task_3(base_settings): """No. 3 tests collection for Task. Test File: task-example1.json """ filename = base_settings["unittest_data_dir"] / "task-example1.json" inst = task.Task.model_validate_json(filename.read_bytes()) assert "Task" == inst.get_resource_type() impl_task_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Task" == data["resourceType"] inst2 = task.Task(**data) impl_task_3(inst2) def impl_task_4(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-04T08:25:05+10:00"} ).valueDateTime ) assert inst.code.coding[0].code == "reprocess" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/financialtaskcode"} ).valueUri ) assert ( inst.focus.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/claim"} ).valueUri ) assert inst.focus.identifier.value == "1501" assert inst.id == "fm-example4" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http:/happyvalley.com/task"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "20181012-006" assert inst.input[0].type.coding[0].code == "origresponse" assert ( inst.input[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/financialtaskinputtype"} ).valueUri ) assert ( inst.input[0].valueReference.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://nationalinsurers.com/claimresponse"} ).valueUri ) assert inst.input[0].valueReference.identifier.value == "CR201810040001234" assert inst.input[1].type.coding[0].code == "reference" assert ( inst.input[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/financialtaskinputtype"} ).valueUri ) assert inst.input[1].valueString == "BR12345" assert inst.input[2].type.coding[0].code == "item" assert ( inst.input[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/financialtaskinputtype"} ).valueUri ) assert inst.input[2].valuePositiveInt == 2 assert inst.input[3].type.coding[0].code == "item" assert ( inst.input[3].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/financialtaskinputtype"} ).valueUri ) assert inst.input[3].valuePositiveInt == 3 assert inst.intent == "order" assert ( inst.lastModified == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-04T08:25:05+10:00"} ).valueDateTime ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.owner.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://nationalinsurers.com/identifiers"} ).valueUri ) assert inst.owner.identifier.value == "12345" assert inst.priority == "stat" assert inst.requester.display == "Happy Valley Clinic" assert inst.requester.reference == "Organization/example" assert inst.status == "requested" assert inst.text.status == "generated" def test_task_4(base_settings): """No. 4 tests collection for Task. Test File: task-example-fm-reprocess.json """ filename = base_settings["unittest_data_dir"] / "task-example-fm-reprocess.json" inst = task.Task.model_validate_json(filename.read_bytes()) assert "Task" == inst.get_resource_type() impl_task_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Task" == data["resourceType"] inst2 = task.Task(**data) impl_task_4(inst2) def impl_task_5(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-03-10T22:39:32-04:00"} ).valueDateTime ) assert inst.code.text == "Refill Request" assert inst.focus.reference == "MedicationRequest/medrx002" assert inst.for_fhir.reference == "Patient/f001" assert inst.id == "example3" assert inst.intent == "order" assert ( inst.lastModified == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-03-10T22:39:32-04:00"} ).valueDateTime ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.owner.reference == "Practitioner/example" assert inst.requester.reference == "Patient/example" assert inst.status == "draft" assert inst.text.status == "generated" def test_task_5(base_settings): """No. 5 tests collection for Task. Test File: task-example3.json """ filename = base_settings["unittest_data_dir"] / "task-example3.json" inst = task.Task.model_validate_json(filename.read_bytes()) assert "Task" == inst.get_resource_type() impl_task_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Task" == data["resourceType"] inst2 = task.Task(**data) impl_task_5(inst2) def impl_task_6(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-04T08:25:05+10:00"} ).valueDateTime ) assert inst.code.coding[0].code == "status" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/financialtaskcode"} ).valueUri ) assert ( inst.focus.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/claim"} ).valueUri ) assert inst.focus.identifier.value == "1500" assert inst.id == "fm-example6" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http:/happyvalley.com/task"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "20181012-001" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://nationalinsurers.com/identifiers/12345"} ).valueUri ) assert inst.identifier[1].use == "official" assert inst.identifier[1].value == "123GB5674" assert inst.intent == "order" assert ( inst.lastModified == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-04T08:25:05+10:00"} ).valueDateTime ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.output[0].type.coding[0].code == "status" assert ( inst.output[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/financial-taskoutputtype"} ).valueUri ) assert inst.output[0].valueCode == "complete" assert ( inst.owner.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://nationalinsurers.com/identifiers"} ).valueUri ) assert inst.owner.identifier.value == "12345" assert inst.priority == "stat" assert inst.requester.display == "Happy Valley Clinic" assert inst.requester.reference == "Organization/example" assert inst.status == "completed" assert inst.text.status == "generated" def test_task_6(base_settings): """No. 6 tests collection for Task. Test File: task-example-fm-status-resp.json """ filename = base_settings["unittest_data_dir"] / "task-example-fm-status-resp.json" inst = task.Task.model_validate_json(filename.read_bytes()) assert "Task" == inst.get_resource_type() impl_task_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Task" == data["resourceType"] inst2 = task.Task(**data) impl_task_6(inst2) def impl_task_7(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-31T08:45:05+10:00"} ).valueDateTime ) assert inst.businessStatus.text == "waiting for patient" assert inst.code.text == "Specimen Collection" assert inst.encounter.display == "Example In-Patient Encounter" assert inst.encounter.reference == "Encounter/example" assert ( inst.executionPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-31T08:45:05+10:00"} ).valueDateTime ) assert inst.focus.display == "BloodDraw ServiceRequest" assert inst.for_fhir.display == "Peter James Chalmers" assert inst.for_fhir.reference == "Patient/example" assert ( inst.groupIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http:/goodhealth.org/accession/identifiers"} ).valueUri ) assert inst.groupIdentifier.use == "official" assert inst.groupIdentifier.value == "G20170201-001" assert inst.id == "example2" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http:/goodhealth.org/identifiers"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "20170201-002" assert inst.intent == "filler-order" assert ( inst.lastModified == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-31T09:45:05+10:00"} ).valueDateTime ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.owner.display == "Clinical Laboratory @ Acme Hospital" assert inst.owner.reference == "Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" assert inst.partOf[0].display == "Lipid Panel" assert inst.partOf[0].reference == "Task/example1" assert inst.performerType[0].coding[0].code == "performer" assert inst.performerType[0].coding[0].display == "Performer" assert ( inst.performerType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/task-performer-type"} ).valueUri ) assert inst.performerType[0].text == "Performer" assert inst.priority == "routine" assert inst.requester.display == "Clinical Laboratory @ Acme Hospital" assert ( inst.requester.reference == "Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" ) assert ( inst.restriction.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-11-01T09:45:05+10:00"} ).valueDateTime ) assert inst.restriction.repetitions == 1 assert inst.status == "accepted" assert inst.text.status == "generated" def test_task_7(base_settings): """No. 7 tests collection for Task. Test File: task-example2.json """ filename = base_settings["unittest_data_dir"] / "task-example2.json" inst = task.Task.model_validate_json(filename.read_bytes()) assert "Task" == inst.get_resource_type() impl_task_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Task" == data["resourceType"] inst2 = task.Task(**data) impl_task_7(inst2) def impl_task_8(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-04T08:25:05+10:00"} ).valueDateTime ) assert inst.code.coding[0].code == "release" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/financialtaskcode"} ).valueUri ) assert ( inst.focus.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/claim"} ).valueUri ) assert inst.focus.identifier.value == "1501" assert inst.id == "fm-example3" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http:/happyvalley.com/task"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "20181012-001" assert inst.input[0].type.coding[0].code == "origresponse" assert ( inst.input[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/financial-taskinputtype"} ).valueUri ) assert ( inst.input[0].valueReference.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://nationalinsurers.com/claimresponse"} ).valueUri ) assert inst.input[0].valueReference.identifier.value == "CR201810040001234" assert inst.intent == "order" assert ( inst.lastModified == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-04T08:25:05+10:00"} ).valueDateTime ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.owner.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://nationalinsurers.com/identifiers"} ).valueUri ) assert inst.owner.identifier.value == "12345" assert inst.priority == "stat" assert inst.requester.display == "Happy Valley Clinic" assert inst.requester.reference == "Organization/example" assert inst.status == "requested" assert inst.text.status == "generated" def test_task_8(base_settings): """No. 8 tests collection for Task. Test File: task-example-fm-release.json """ filename = base_settings["unittest_data_dir"] / "task-example-fm-release.json" inst = task.Task.model_validate_json(filename.read_bytes()) assert "Task" == inst.get_resource_type() impl_task_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Task" == data["resourceType"] inst2 = task.Task(**data) impl_task_8(inst2) def impl_task_9(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-04T08:25:05+10:00"} ).valueDateTime ) assert inst.code.coding[0].code == "cancel" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/financialtaskcode"} ).valueUri ) assert ( inst.focus.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/claim"} ).valueUri ) assert inst.focus.identifier.value == "1500" assert inst.id == "fm-example1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http:/happyvalley.com/task"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "20181012-001" assert inst.intent == "order" assert ( inst.lastModified == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-04T08:25:05+10:00"} ).valueDateTime ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.owner.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://nationalinsurers.com/identifiers"} ).valueUri ) assert inst.owner.identifier.value == "12345" assert inst.priority == "stat" assert inst.requester.display == "Happy Valley Clinic" assert inst.requester.reference == "Organization/example" assert inst.status == "requested" assert inst.text.status == "generated" def test_task_9(base_settings): """No. 9 tests collection for Task. Test File: task-example-fm-cancel.json """ filename = base_settings["unittest_data_dir"] / "task-example-fm-cancel.json" inst = task.Task.model_validate_json(filename.read_bytes()) assert "Task" == inst.get_resource_type() impl_task_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Task" == data["resourceType"] inst2 = task.Task(**data) impl_task_9(inst2) def impl_task_10(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-31T08:25:05+10:00"} ).valueDateTime ) assert inst.basedOn[0].display == "General Wellness Careplan" assert inst.businessStatus.text == "specimen received, test in progress" assert inst.code.text == "Lipid Panel" assert inst.description == ( "Create order for getting specimen, Set up inhouse testing, " "generate order for any sendouts and submit with specimen" ) assert inst.encounter.display == "Example In-Patient Encounter" assert inst.encounter.reference == "Encounter/example" assert ( inst.executionPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-31T08:25:05+10:00"} ).valueDateTime ) assert inst.focus.display == "Lipid Panel Request" assert inst.focus.reference == "ServiceRequest/lipid" assert inst.for_fhir.display == "Peter James Chalmers" assert inst.for_fhir.reference == "Patient/example" assert ( inst.groupIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http:/goodhealth.org/accession/identifiers"} ).valueUri ) assert inst.groupIdentifier.use == "official" assert inst.groupIdentifier.value == "G20170201-001" assert inst.id == "example5" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http:/goodhealth.org/identifiers"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "20170201-001" assert inst.intent == "order" assert ( inst.lastModified == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-31T16:45:05+10:00"} ).valueDateTime ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.output[0].type.text == "collected specimen" assert inst.output[0].valueReference.reference == "Specimen/101" assert inst.owner.display == "Clinical Laboratory @ Acme Hospital" assert inst.owner.reference == "Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" assert inst.performerType[0].coding[0].code == "performer" assert inst.performerType[0].coding[0].display == "Performer" assert ( inst.performerType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/task-performer-type"} ).valueUri ) assert inst.performerType[0].text == "Performer" assert inst.priority == "routine" assert inst.reasonCode.text == ( "The Task.reason should only be included if there is no " "Task.focus or if it differs from the reason indicated on the" " focus" ) assert inst.requester.display == "Dr Adam Careful" assert inst.requester.reference == "Practitioner/example" assert ( inst.restriction.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-11-02T09:45:05+10:00"} ).valueDateTime ) assert inst.restriction.repetitions == 1 assert inst.status == "in-progress" assert inst.text.status == "generated" def test_task_10(base_settings): """No. 10 tests collection for Task. Test File: task-example5.json """ filename = base_settings["unittest_data_dir"] / "task-example5.json" inst = task.Task.model_validate_json(filename.read_bytes()) assert "Task" == inst.get_resource_type() impl_task_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Task" == data["resourceType"] inst2 = task.Task(**data) impl_task_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_terminologycapabilities.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/TerminologyCapabilities Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import terminologycapabilities from .conftest import ExternalValidatorModel # noqa: F401 def impl_terminologycapabilities_1(inst): assert inst.codeSearch == "explicit" assert inst.contact[0].name == "System Administrator" assert inst.contact[0].telecom[0].system == "email" assert inst.contact[0].telecom[0].value == "wile@acme.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-01-04"} ).valueDateTime ) assert inst.description == ( "This is the FHIR capability statement for the main EHR at " "ACME for the private interface - it does not describe the " "public interface" ) assert inst.experimental is True assert inst.id == "example" assert inst.implementation.description == "Acme Terminology Server" assert ( inst.implementation.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://example.org/tx"} ).valueUrl ) assert inst.kind == "instance" assert inst.name == "ACME-EHR" assert inst.publisher == "ACME Corporation" assert inst.software.name == "TxServer" assert inst.software.version == "0.1.2" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "ACME EHR capability statement" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "urn:uuid:68d043b5-9ecf-4559-a57a-396e0d452311"} ).valueUri ) assert inst.version == "20130510" def test_terminologycapabilities_1(base_settings): """No. 1 tests collection for TerminologyCapabilities. Test File: terminologycapabilities-example.json """ filename = ( base_settings["unittest_data_dir"] / "terminologycapabilities-example.json" ) inst = terminologycapabilities.TerminologyCapabilities.model_validate_json( filename.read_bytes() ) assert "TerminologyCapabilities" == inst.get_resource_type() impl_terminologycapabilities_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "TerminologyCapabilities" == data["resourceType"] inst2 = terminologycapabilities.TerminologyCapabilities(**data) impl_terminologycapabilities_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_testreport.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/TestReport Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import testreport from .conftest import ExternalValidatorModel # noqa: F401 def impl_testreport_1(inst): assert inst.id == "testreport-example" assert ( inst.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier.value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9878" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-07T08:25:34-05:00"} ).valueDateTime ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "TestReport Example for TestScript Example" assert inst.participant[0].display == "Crucible" assert inst.participant[0].type == "test-engine" assert ( inst.participant[0].uri == ExternalValidatorModel.model_validate( {"valueUri": "http://projectcrucible.org"} ).valueUri ) assert inst.participant[1].display == "HealthIntersections STU3" assert inst.participant[1].type == "server" assert ( inst.participant[1].uri == ExternalValidatorModel.model_validate( {"valueUri": "http://fhir3.healthintersections.com.au/open"} ).valueUri ) assert inst.result == "pass" assert float(inst.score) == float(100.0) assert ( inst.setup.action[0].operation.detail == ExternalValidatorModel.model_validate( {"valueUri": "http://projectcrucible.org/permalink/1"} ).valueUri ) assert inst.setup.action[0].operation.message == "DELETE Patient" assert inst.setup.action[0].operation.result == "pass" assert ( inst.setup.action[1].assert_fhir.detail == "http://projectcrucible.org/permalink/1" ) assert inst.setup.action[1].assert_fhir.message == "HTTP 204" assert inst.setup.action[1].assert_fhir.result == "pass" assert ( inst.setup.action[2].operation.detail == ExternalValidatorModel.model_validate( {"valueUri": "http://projectcrucible.org/permalink/1"} ).valueUri ) assert ( inst.setup.action[2].operation.message == "POST Patient/fixture-patient-create" ) assert inst.setup.action[2].operation.result == "pass" assert ( inst.setup.action[3].assert_fhir.detail == "http://projectcrucible.org/permalink/1" ) assert inst.setup.action[3].assert_fhir.message == "HTTP 201" assert inst.setup.action[3].assert_fhir.result == "pass" assert inst.status == "completed" assert ( inst.teardown.action[0].operation.detail == ExternalValidatorModel.model_validate( {"valueUri": "http://projectcrucible.org/permalink/3"} ).valueUri ) assert ( inst.teardown.action[0].operation.message == "DELETE Patient/fixture-patient-create." ) assert inst.teardown.action[0].operation.result == "pass" assert inst.testScript.reference == "TestScript/testscript-example" assert ( inst.test[0].action[0].operation.detail == ExternalValidatorModel.model_validate( {"valueUri": "http://projectcrucible.org/permalink/2"} ).valueUri ) assert ( inst.test[0].action[0].operation.message == "GET Patient/fixture-patient-create" ) assert inst.test[0].action[0].operation.result == "pass" assert ( inst.test[0].action[1].assert_fhir.detail == "http://projectcrucible.org/permalink/2" ) assert inst.test[0].action[1].assert_fhir.message == "HTTP 200" assert inst.test[0].action[1].assert_fhir.result == "pass" assert ( inst.test[0].action[2].assert_fhir.detail == "http://projectcrucible.org/permalink/2" ) assert inst.test[0].action[2].assert_fhir.message == "Last-Modified Present" assert inst.test[0].action[2].assert_fhir.result == "pass" assert ( inst.test[0].action[3].assert_fhir.detail == "http://projectcrucible.org/permalink/2" ) assert inst.test[0].action[3].assert_fhir.message == "Response is Patient" assert inst.test[0].action[3].assert_fhir.result == "pass" assert ( inst.test[0].action[4].assert_fhir.detail == "http://projectcrucible.org/permalink/2" ) assert inst.test[0].action[4].assert_fhir.message == "Response validates" assert inst.test[0].action[4].assert_fhir.result == "pass" assert ( inst.test[0].action[5].assert_fhir.detail == "http://projectcrucible.org/permalink/2" ) assert ( inst.test[0].action[5].assert_fhir.message == "Patient.name.family 'Chalmers'" ) assert inst.test[0].action[5].assert_fhir.result == "pass" assert ( inst.test[0].action[6].assert_fhir.detail == "http://projectcrucible.org/permalink/2" ) assert inst.test[0].action[6].assert_fhir.message == "Patient.name.given 'Peter'" assert inst.test[0].action[6].assert_fhir.result == "pass" assert ( inst.test[0].action[7].assert_fhir.detail == "http://projectcrucible.org/permalink/2" ) assert ( inst.test[0].action[7].assert_fhir.message == "Patient.name.family 'Chalmers'" ) assert inst.test[0].action[7].assert_fhir.result == "pass" assert ( inst.test[0].action[8].assert_fhir.detail == "http://projectcrucible.org/permalink/2" ) assert ( inst.test[0].action[8].assert_fhir.message == "Patient.name.family 'Chalmers'" ) assert inst.test[0].action[8].assert_fhir.result == "pass" assert ( inst.test[0].action[9].assert_fhir.detail == "http://projectcrucible.org/permalink/2" ) assert inst.test[0].action[9].assert_fhir.message == "Patient expected values." assert inst.test[0].action[9].assert_fhir.result == "pass" assert inst.test[0].description == "Read a Patient and validate response." assert inst.test[0].id == "01-ReadPatient" assert inst.test[0].name == "Read Patient" assert inst.tester == "HL7 Execution Engine" assert inst.text.status == "generated" def test_testreport_1(base_settings): """No. 1 tests collection for TestReport. Test File: testreport-example.json """ filename = base_settings["unittest_data_dir"] / "testreport-example.json" inst = testreport.TestReport.model_validate_json(filename.read_bytes()) assert "TestReport" == inst.get_resource_type() impl_testreport_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "TestReport" == data["resourceType"] inst2 = testreport.TestReport(**data) impl_testreport_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_testscript.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/TestScript Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import testscript from .conftest import ExternalValidatorModel # noqa: F401 def impl_testscript_1(inst): assert inst.contact[0].name == "Support" assert inst.contact[0].telecom[0].system == "email" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "support@HL7.org" assert inst.copyright == "© HL7.org 2011+" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-18"} ).valueDateTime ) assert inst.destination[0].index == 1 assert inst.destination[0].profile.code == "FHIR-Server" assert inst.destination[1].index == 2 assert inst.destination[1].profile.code == "FHIR-Server" assert inst.experimental is True assert inst.id == "testscript-example-multisystem" assert ( inst.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier.value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9878" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America (the)" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert ( inst.metadata.capability[0].capabilities == "http://hl7.org/fhir/CapabilityStatement/example" ) assert inst.metadata.capability[0].description == "Patient Read Operation" assert inst.metadata.capability[0].destination == 1 assert ( inst.metadata.capability[0].link[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/http.html#read"} ).valueUri ) assert inst.metadata.capability[0].origin[0] == 1 assert inst.metadata.capability[0].required is True assert inst.metadata.capability[0].validated is False assert ( inst.metadata.capability[1].capabilities == "http://hl7.org/fhir/CapabilityStatement/example" ) assert inst.metadata.capability[1].description == "Patient Read Operation" assert inst.metadata.capability[1].destination == 2 assert ( inst.metadata.capability[1].link[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/http.html#read"} ).valueUri ) assert inst.metadata.capability[1].origin[0] == 1 assert inst.metadata.capability[1].required is True assert inst.metadata.capability[1].validated is False assert inst.metadata.link[0].description == ( "Demographics and other administrative information about an " "individual or animal receiving care or other health-related " "services." ) assert ( inst.metadata.link[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/patient.html"} ).valueUri ) assert inst.name == "testscript-example-multisystem" assert inst.origin[0].index == 1 assert inst.origin[0].profile.code == "FHIR-Client" assert inst.publisher == "HL7" assert inst.purpose == "Patient Read Operation" assert inst.status == "draft" assert inst.test[0].action[0].operation.accept == "xml" assert inst.test[0].action[0].operation.contentType == "xml" assert inst.test[0].action[0].operation.description == ( "Read a Patient from the first destination test system and " "perform basic validation." ) assert inst.test[0].action[0].operation.destination == 1 assert inst.test[0].action[0].operation.encodeRequestUrl is True assert inst.test[0].action[0].operation.origin == 1 assert inst.test[0].action[0].operation.params == "/${Dest1PatientResourceId}" assert inst.test[0].action[0].operation.requestId == "request-read-patient-01" assert inst.test[0].action[0].operation.resource == "Patient" assert inst.test[0].action[0].operation.type.code == "read" assert ( inst.test[0].action[0].operation.type.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" } ).valueUri ) assert inst.test[0].action[1].assert_fhir.description == ( "Confirm that the request method GET was sent by the client " "system under test." ) assert inst.test[0].action[1].assert_fhir.requestMethod == "get" assert inst.test[0].action[1].assert_fhir.warningOnly is False assert ( inst.test[0].action[2].assert_fhir.description == "Confirm that the client requested an Accept of xml." ) assert inst.test[0].action[2].assert_fhir.direction == "request" assert inst.test[0].action[2].assert_fhir.headerField == "Accept" assert inst.test[0].action[2].assert_fhir.operator == "contains" assert inst.test[0].action[2].assert_fhir.value == "xml" assert inst.test[0].action[2].assert_fhir.warningOnly is False assert ( inst.test[0].action[3].assert_fhir.description == "Confirm that the returned HTTP status is 200(OK)." ) assert inst.test[0].action[3].assert_fhir.direction == "response" assert inst.test[0].action[3].assert_fhir.response == "okay" assert inst.test[0].action[3].assert_fhir.warningOnly is False assert inst.test[0].action[4].assert_fhir.contentType == "xml" assert ( inst.test[0].action[4].assert_fhir.description == "Confirm that the returned format is XML." ) assert inst.test[0].action[4].assert_fhir.direction == "response" assert inst.test[0].action[4].assert_fhir.warningOnly is False assert ( inst.test[0].action[5].assert_fhir.description == "Confirm that the returned resource type is Patient." ) assert inst.test[0].action[5].assert_fhir.direction == "response" assert inst.test[0].action[5].assert_fhir.resource == "Patient" assert inst.test[0].action[5].assert_fhir.warningOnly is False assert inst.test[0].description == ( "Read a Patient from the first destination test system using " "the user defined dynamic variable ${Dest1PatientResourceId}." " Perform basic validation." ) assert inst.test[0].id == "01-ReadPatient-Destination1" assert inst.test[0].name == "ReadPatient-Destination1" assert inst.test[1].action[0].operation.accept == "xml" assert inst.test[1].action[0].operation.contentType == "xml" assert inst.test[1].action[0].operation.description == ( "Read a Patient from the second destination test system and " "perform basic validation." ) assert inst.test[1].action[0].operation.destination == 2 assert inst.test[1].action[0].operation.encodeRequestUrl is True assert inst.test[1].action[0].operation.origin == 1 assert inst.test[1].action[0].operation.params == "/${Dest2PatientResourceId}" assert inst.test[1].action[0].operation.requestHeader[0].field == "Accept-Charset" assert inst.test[1].action[0].operation.requestHeader[0].value == "utf-8" assert inst.test[1].action[0].operation.resource == "Patient" assert inst.test[1].action[0].operation.type.code == "read" assert ( inst.test[1].action[0].operation.type.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" } ).valueUri ) assert ( inst.test[1].action[1].assert_fhir.description == "Confirm that the client requested an Accept of xml." ) assert inst.test[1].action[1].assert_fhir.direction == "request" assert inst.test[1].action[1].assert_fhir.headerField == "Accept" assert inst.test[1].action[1].assert_fhir.operator == "contains" assert inst.test[1].action[1].assert_fhir.value == "xml" assert inst.test[1].action[1].assert_fhir.warningOnly is False assert ( inst.test[1].action[2].assert_fhir.description == "Confirm that the returned HTTP status is 200(OK)." ) assert inst.test[1].action[2].assert_fhir.direction == "response" assert inst.test[1].action[2].assert_fhir.response == "okay" assert inst.test[1].action[2].assert_fhir.warningOnly is False assert inst.test[1].action[3].assert_fhir.contentType == "xml" assert ( inst.test[1].action[3].assert_fhir.description == "Confirm that the returned format is XML." ) assert inst.test[1].action[3].assert_fhir.direction == "response" assert inst.test[1].action[3].assert_fhir.warningOnly is False assert ( inst.test[1].action[4].assert_fhir.description == "Confirm that the returned resource type is Patient." ) assert inst.test[1].action[4].assert_fhir.direction == "response" assert inst.test[1].action[4].assert_fhir.resource == "Patient" assert inst.test[1].action[4].assert_fhir.warningOnly is False assert inst.test[1].description == ( "Read a Patient from the second destination test system using" " the user defined dynamic variable " "${Dest2PatientResourceId}. Perform basic validation." ) assert inst.test[1].id == "02-ReadPatient-Destination2" assert inst.test[1].name == "ReadPatient-Destination2" assert inst.text.status == "generated" assert inst.title == "Multisystem Test Script" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/TestScript/testscript-example-multisystem" } ).valueUri ) assert inst.variable[0].defaultValue == "example" assert inst.variable[0].name == "Dest1PatientResourceId" assert inst.variable[1].defaultValue == "example" assert inst.variable[1].name == "Dest2PatientResourceId" assert inst.version == "1.0" def test_testscript_1(base_settings): """No. 1 tests collection for TestScript. Test File: testscript-example-multisystem.json """ filename = ( base_settings["unittest_data_dir"] / "testscript-example-multisystem.json" ) inst = testscript.TestScript.model_validate_json(filename.read_bytes()) assert "TestScript" == inst.get_resource_type() impl_testscript_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "TestScript" == data["resourceType"] inst2 = testscript.TestScript(**data) impl_testscript_1(inst2) def impl_testscript_2(inst): assert inst.contact[0].name == "Support" assert inst.contact[0].telecom[0].system == "email" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "support@HL7.org" assert inst.copyright == "© HL7.org 2011+" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-18"} ).valueDateTime ) assert inst.experimental is True assert inst.fixture[0].autocreate is False assert inst.fixture[0].autodelete is False assert inst.fixture[0].id == "fixture-patient-create" assert inst.fixture[0].resource.display == "Peter Chalmers" assert inst.fixture[0].resource.reference == "Patient/example" assert inst.fixture[1].autocreate is False assert inst.fixture[1].autodelete is False assert inst.fixture[1].id == "fixture-patient-update" assert inst.fixture[1].resource.display == "Donald Duck" assert inst.fixture[1].resource.reference == "Patient/pat1" assert inst.id == "testscript-example-history" assert ( inst.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier.value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9877" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America (the)" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert ( inst.metadata.capability[0].capabilities == "http://hl7.org/fhir/CapabilityStatement/example" ) assert ( inst.metadata.capability[0].description == "Patient Update, Delete and History (Instance) Operations" ) assert ( inst.metadata.capability[0].link[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/http.html#update"} ).valueUri ) assert ( inst.metadata.capability[0].link[1] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/http.html#delete"} ).valueUri ) assert ( inst.metadata.capability[0].link[2] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/http.html#history"} ).valueUri ) assert inst.metadata.capability[0].required is True assert inst.metadata.capability[0].validated is False assert inst.metadata.link[0].description == ( "Demographics and other administrative information about an " "individual or animal receiving care or other health-related " "services." ) assert ( inst.metadata.link[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/patient.html"} ).valueUri ) assert inst.name == "TestScript Example History" assert inst.profile[0].id == "bundle-profile" assert inst.profile[0].reference == "http://hl7.org/fhir/StructureDefinition/Bundle" assert inst.publisher == "HL7" assert inst.purpose == ( "Patient (Conditional) Create, Update, Delete and History " "(Instance) Operations" ) assert inst.setup.action[0].operation.accept == "json" assert inst.setup.action[0].operation.description == ( "Execute a delete operation to insure the patient does not " "exist on the server." ) assert inst.setup.action[0].operation.encodeRequestUrl is True assert inst.setup.action[0].operation.label == "SetupDeletePatient" assert inst.setup.action[0].operation.params == "/${createResourceId}" assert inst.setup.action[0].operation.resource == "Patient" assert inst.setup.action[0].operation.type.code == "delete" assert ( inst.setup.action[0].operation.type.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" } ).valueUri ) assert inst.setup.action[1].assert_fhir.description == ( "Confirm that the returned HTTP status is 200(OK) or 204(No " "Content)." ) assert inst.setup.action[1].assert_fhir.direction == "response" assert inst.setup.action[1].assert_fhir.operator == "in" assert inst.setup.action[1].assert_fhir.responseCode == "200,204" assert inst.setup.action[1].assert_fhir.warningOnly is False assert inst.setup.action[2].operation.accept == "json" assert inst.setup.action[2].operation.contentType == "json" assert inst.setup.action[2].operation.description == ( "Create patient resource on test server using the contents of" " fixture-patient-create" ) assert inst.setup.action[2].operation.encodeRequestUrl is True assert inst.setup.action[2].operation.label == "SetupCreatePatient" assert inst.setup.action[2].operation.params == "/${createResourceId}" assert inst.setup.action[2].operation.resource == "Patient" assert inst.setup.action[2].operation.sourceId == "fixture-patient-create" assert inst.setup.action[2].operation.type.code == "update" assert ( inst.setup.action[2].operation.type.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" } ).valueUri ) assert ( inst.setup.action[3].assert_fhir.description == "Confirm that the returned HTTP status is 201(Created)." ) assert inst.setup.action[3].assert_fhir.direction == "response" assert inst.setup.action[3].assert_fhir.responseCode == "201" assert inst.setup.action[3].assert_fhir.warningOnly is False assert inst.setup.action[4].operation.accept == "json" assert inst.setup.action[4].operation.contentType == "json" assert inst.setup.action[4].operation.description == ( "Update patient resource on test server using the contents of" " fixture-patient-update" ) assert inst.setup.action[4].operation.encodeRequestUrl is True assert inst.setup.action[4].operation.label == "SetupUpdatePatient" assert inst.setup.action[4].operation.params == "/${createResourceId}" assert inst.setup.action[4].operation.resource == "Patient" assert inst.setup.action[4].operation.sourceId == "fixture-patient-update" assert inst.setup.action[4].operation.type.code == "update" assert ( inst.setup.action[4].operation.type.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" } ).valueUri ) assert ( inst.setup.action[5].assert_fhir.description == "Confirm that the returned HTTP status is 200(OK)." ) assert inst.setup.action[5].assert_fhir.direction == "response" assert inst.setup.action[5].assert_fhir.responseCode == "200" assert inst.setup.action[5].assert_fhir.warningOnly is False assert inst.status == "draft" assert inst.test[0].action[0].operation.accept == "json" assert inst.test[0].action[0].operation.contentType == "json" assert inst.test[0].action[0].operation.description == ( "Get the Patient history on the test server using the id from" " fixture-patient-create." ) assert inst.test[0].action[0].operation.encodeRequestUrl is True assert inst.test[0].action[0].operation.resource == "Patient" assert inst.test[0].action[0].operation.targetId == "fixture-patient-create" assert inst.test[0].action[0].operation.type.code == "history" assert ( inst.test[0].action[0].operation.type.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" } ).valueUri ) assert ( inst.test[0].action[1].assert_fhir.description == "Confirm that the returned HTTP status is 200(OK)." ) assert inst.test[0].action[1].assert_fhir.direction == "response" assert inst.test[0].action[1].assert_fhir.response == "okay" assert inst.test[0].action[1].assert_fhir.warningOnly is False assert ( inst.test[0].action[2].assert_fhir.description == "Confirm that the returned resource type is Bundle." ) assert inst.test[0].action[2].assert_fhir.resource == "Bundle" assert inst.test[0].action[2].assert_fhir.warningOnly is False assert inst.test[0].action[3].assert_fhir.description == ( "Confirm that the returned Bundle conforms to the base FHIR " "specification." ) assert inst.test[0].action[3].assert_fhir.validateProfileId == "bundle-profile" assert inst.test[0].action[3].assert_fhir.warningOnly is False assert ( inst.test[0].action[4].assert_fhir.description == "Confirm that the returned Bundle type equals 'history'." ) assert inst.test[0].action[4].assert_fhir.operator == "equals" assert inst.test[0].action[4].assert_fhir.path == "fhir:Bundle/fhir:type/@value" assert inst.test[0].action[4].assert_fhir.value == "history" assert inst.test[0].action[4].assert_fhir.warningOnly is False assert ( inst.test[0].description == "Get the history for a known Patient and validate response." ) assert inst.test[0].id == "01-HistoryPatient" assert inst.test[0].name == "History Patient" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/TestScript/testscript-example-history"} ).valueUri ) assert inst.variable[0].name == "createResourceId" assert inst.variable[0].path == "Patient/id" assert inst.variable[0].sourceId == "fixture-patient-create" assert inst.version == "1.0" def test_testscript_2(base_settings): """No. 2 tests collection for TestScript. Test File: testscript-example-history.json """ filename = base_settings["unittest_data_dir"] / "testscript-example-history.json" inst = testscript.TestScript.model_validate_json(filename.read_bytes()) assert "TestScript" == inst.get_resource_type() impl_testscript_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "TestScript" == data["resourceType"] inst2 = testscript.TestScript(**data) impl_testscript_2(inst2) def impl_testscript_3(inst): assert inst.contact[0].name == "Support" assert inst.contact[0].telecom[0].system == "email" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "support@HL7.org" assert inst.copyright == "© HL7.org 2011+" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-18"} ).valueDateTime ) assert inst.description == ( "TestScript example resource with setup to delete if present " "and create a new instance of a Patient; and single test " "definition to update that Patient with various asserts." ) assert inst.experimental is True assert inst.fixture[0].autocreate is False assert inst.fixture[0].autodelete is False assert inst.fixture[0].id == "fixture-patient-create" assert inst.fixture[0].resource.display == "Peter Chalmers" assert inst.fixture[0].resource.reference == "Patient/example" assert inst.fixture[1].autocreate is False assert inst.fixture[1].autodelete is False assert inst.fixture[1].id == "fixture-patient-update" assert inst.fixture[1].resource.display == "Donald Duck" assert inst.fixture[1].resource.reference == "Patient/pat1" assert inst.id == "testscript-example-update" assert ( inst.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier.value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9882" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America (the)" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert ( inst.metadata.capability[0].capabilities == "http://hl7.org/fhir/CapabilityStatement/example" ) assert ( inst.metadata.capability[0].description == "Patient Update and Delete Operations" ) assert ( inst.metadata.capability[0].link[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/http.html#update"} ).valueUri ) assert ( inst.metadata.capability[0].link[1] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/http.html#delete"} ).valueUri ) assert inst.metadata.capability[0].required is True assert inst.metadata.capability[0].validated is False assert inst.metadata.link[0].description == ( "Demographics and other administrative information about an " "individual or animal receiving care or other health-related " "services." ) assert ( inst.metadata.link[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/patient.html"} ).valueUri ) assert inst.name == "TestScript Example Update" assert inst.profile[0].id == "patient-profile" assert ( inst.profile[0].reference == "http://hl7.org/fhir/StructureDefinition/Patient" ) assert inst.publisher == "HL7" assert inst.purpose == "Patient (Conditional) Create, Update, Delete Operations" assert inst.setup.action[0].operation.accept == "xml" assert inst.setup.action[0].operation.description == ( "Execute a delete operation to insure the patient does not " "exist on the server." ) assert inst.setup.action[0].operation.encodeRequestUrl is True assert inst.setup.action[0].operation.label == "SetupDeletePatient" assert inst.setup.action[0].operation.params == "/${createResourceId}" assert inst.setup.action[0].operation.resource == "Patient" assert inst.setup.action[0].operation.type.code == "delete" assert ( inst.setup.action[0].operation.type.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" } ).valueUri ) assert inst.setup.action[1].assert_fhir.description == ( "Confirm that the returned HTTP status is 200(OK) or 204(No " "Content)." ) assert inst.setup.action[1].assert_fhir.direction == "response" assert inst.setup.action[1].assert_fhir.operator == "in" assert inst.setup.action[1].assert_fhir.responseCode == "200,204" assert inst.setup.action[1].assert_fhir.warningOnly is False assert inst.setup.action[2].operation.accept == "xml" assert inst.setup.action[2].operation.contentType == "xml" assert inst.setup.action[2].operation.description == ( "Create patient resource on test server using the contents of" " fixture-patient-create" ) assert inst.setup.action[2].operation.encodeRequestUrl is True assert inst.setup.action[2].operation.label == "SetupCreatePatient" assert inst.setup.action[2].operation.params == "/${createResourceId}" assert inst.setup.action[2].operation.resource == "Patient" assert inst.setup.action[2].operation.sourceId == "fixture-patient-create" assert inst.setup.action[2].operation.type.code == "update" assert ( inst.setup.action[2].operation.type.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" } ).valueUri ) assert ( inst.setup.action[3].assert_fhir.description == "Confirm that the returned HTTP status is 201(Created)." ) assert inst.setup.action[3].assert_fhir.direction == "response" assert inst.setup.action[3].assert_fhir.responseCode == "201" assert inst.setup.action[3].assert_fhir.warningOnly is False assert inst.status == "draft" assert inst.test[0].action[0].operation.accept == "xml" assert inst.test[0].action[0].operation.contentType == "xml" assert inst.test[0].action[0].operation.description == ( "Update patient resource on test server using the contents of" " fixture-patient-update" ) assert inst.test[0].action[0].operation.encodeRequestUrl is True assert inst.test[0].action[0].operation.label == "SetupUpdatePatient" assert inst.test[0].action[0].operation.params == "/${createResourceId}" assert inst.test[0].action[0].operation.resource == "Patient" assert inst.test[0].action[0].operation.sourceId == "fixture-patient-update" assert inst.test[0].action[0].operation.type.code == "update" assert ( inst.test[0].action[0].operation.type.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" } ).valueUri ) assert ( inst.test[0].action[1].assert_fhir.description == "Confirm that the returned HTTP status is 200(OK)." ) assert inst.test[0].action[1].assert_fhir.response == "okay" assert inst.test[0].action[1].assert_fhir.warningOnly is False assert inst.test[0].action[2].assert_fhir.contentType == "xml" assert ( inst.test[0].action[2].assert_fhir.description == "Confirm that the returned format is XML." ) assert inst.test[0].action[2].assert_fhir.warningOnly is False assert inst.test[0].action[3].assert_fhir.description == ( "Confirm that the returned HTTP Header Last-Modified is " "present. Warning only as the server might not support " "versioning." ) assert inst.test[0].action[3].assert_fhir.headerField == "Last-Modified" assert inst.test[0].action[3].assert_fhir.operator == "notEmpty" assert inst.test[0].action[3].assert_fhir.warningOnly is True assert inst.test[0].description == "Update a Patient and validate response." assert inst.test[0].id == "01-UpdatePatient" assert inst.test[0].name == "Update Patient" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/TestScript/testscript-example-update"} ).valueUri ) assert inst.variable[0].name == "createResourceId" assert inst.variable[0].path == "Patient/id" assert inst.variable[0].sourceId == "fixture-patient-create" assert inst.version == "1.0" def test_testscript_3(base_settings): """No. 3 tests collection for TestScript. Test File: testscript-example-update.json """ filename = base_settings["unittest_data_dir"] / "testscript-example-update.json" inst = testscript.TestScript.model_validate_json(filename.read_bytes()) assert "TestScript" == inst.get_resource_type() impl_testscript_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "TestScript" == data["resourceType"] inst2 = testscript.TestScript(**data) impl_testscript_3(inst2) def impl_testscript_4(inst): assert inst.contact[0].name == "Support" assert inst.contact[0].telecom[0].system == "email" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "support@HL7.org" assert inst.copyright == "© HL7.org 2011+" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-18"} ).valueDateTime ) assert inst.description == ( "TestScript example resource with simple Patient search test." " The read tests will utilize user defined dynamic variables " "that will hold the Patient search parameter values." ) assert inst.experimental is True assert inst.fixture[0].autocreate is False assert inst.fixture[0].autodelete is False assert inst.fixture[0].id == "fixture-patient-create" assert inst.fixture[0].resource.display == "Peter Chalmers" assert inst.fixture[0].resource.reference == "Patient/example" assert inst.id == "testscript-example-search" assert ( inst.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier.value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9881" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America (the)" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert ( inst.metadata.capability[0].capabilities == "http://hl7.org/fhir/CapabilityStatement/example" ) assert inst.metadata.capability[0].description == "Patient Search Operation" assert ( inst.metadata.capability[0].link[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/http.html#search"} ).valueUri ) assert inst.metadata.capability[0].required is True assert inst.metadata.capability[0].validated is False assert inst.metadata.link[0].description == ( "Demographics and other administrative information about an " "individual or animal receiving care or other health-related " "services." ) assert ( inst.metadata.link[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/patient.html"} ).valueUri ) assert inst.name == "TestScript Example Search" assert inst.profile[0].id == "bundle-profile" assert inst.profile[0].reference == "http://hl7.org/fhir/StructureDefinition/Bundle" assert inst.publisher == "HL7" assert inst.purpose == "Patient Search Operation" assert inst.setup.action[0].operation.accept == "xml" assert ( inst.setup.action[0].operation.description == "Test simple search to verify server support." ) assert inst.setup.action[0].operation.encodeRequestUrl is True assert ( inst.setup.action[0].operation.params == "?family=DONTEXPECTAMATCH&given=DONTEXPECTAMATCH" ) assert inst.setup.action[0].operation.resource == "Patient" assert inst.setup.action[0].operation.type.code == "search" assert ( inst.setup.action[0].operation.type.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" } ).valueUri ) assert inst.setup.action[1].assert_fhir.description == ( "Confirm that the request url contains the family search " "parameter." ) assert inst.setup.action[1].assert_fhir.direction == "request" assert inst.setup.action[1].assert_fhir.operator == "contains" assert inst.setup.action[1].assert_fhir.requestURL == "family" assert inst.setup.action[1].assert_fhir.warningOnly is False assert ( inst.setup.action[2].assert_fhir.description == "Confirm that the returned HTTP status is 200(OK)." ) assert inst.setup.action[2].assert_fhir.direction == "response" assert inst.setup.action[2].assert_fhir.responseCode == "200" assert inst.setup.action[2].assert_fhir.warningOnly is False assert ( inst.setup.action[3].assert_fhir.description == "Confirm that the returned resource type is Bundle." ) assert inst.setup.action[3].assert_fhir.resource == "Bundle" assert inst.setup.action[3].assert_fhir.warningOnly is False assert inst.setup.action[4].assert_fhir.description == ( "Confirm that the returned Bundle correctly defines the " "navigation links." ) assert inst.setup.action[4].assert_fhir.navigationLinks is True assert inst.setup.action[4].assert_fhir.warningOnly is False assert inst.status == "draft" assert inst.test[0].action[0].operation.accept == "xml" assert inst.test[0].action[0].operation.contentType == "xml" assert inst.test[0].action[0].operation.description == ( "Create a Patient resource and capture the returned HTTP " "Header Location." ) assert inst.test[0].action[0].operation.encodeRequestUrl is True assert inst.test[0].action[0].operation.resource == "Patient" assert inst.test[0].action[0].operation.responseId == "PatientCreateResponse" assert inst.test[0].action[0].operation.sourceId == "fixture-patient-create" assert inst.test[0].action[0].operation.type.code == "create" assert ( inst.test[0].action[0].operation.type.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" } ).valueUri ) assert ( inst.test[0].action[1].assert_fhir.description == "Confirm that the returned HTTP status is 201(Created)." ) assert inst.test[0].action[1].assert_fhir.response == "created" assert inst.test[0].action[1].assert_fhir.warningOnly is False assert ( inst.test[0].action[2].assert_fhir.description == "Confirm that the returned HTTP Header Location is present." ) assert inst.test[0].action[2].assert_fhir.direction == "response" assert inst.test[0].action[2].assert_fhir.headerField == "Location" assert inst.test[0].action[2].assert_fhir.operator == "notEmpty" assert inst.test[0].action[2].assert_fhir.warningOnly is False assert inst.test[0].action[3].operation.accept == "xml" assert inst.test[0].action[3].operation.description == ( "Read the created Patient using the captured Location URL " "value." ) assert inst.test[0].action[3].operation.encodeRequestUrl is True assert inst.test[0].action[3].operation.type.code == "read" assert ( inst.test[0].action[3].operation.type.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" } ).valueUri ) assert inst.test[0].action[3].operation.url == "${PatientCreateLocation}" assert ( inst.test[0].action[4].assert_fhir.description == "Confirm that the returned HTTP status is 200(OK)." ) assert inst.test[0].action[4].assert_fhir.response == "okay" assert inst.test[0].action[4].assert_fhir.warningOnly is False assert ( inst.test[0].action[5].assert_fhir.description == "Confirm that the returned resource type is Patient." ) assert inst.test[0].action[5].assert_fhir.resource == "Patient" assert inst.test[0].action[5].assert_fhir.warningOnly is False assert inst.test[0].description == ( "Create a Patient resource and capture the returned HTTP " "Header Location. Then search for (read) that Patient using " "the Location URL value and validate the response." ) assert inst.test[0].id == "01-PatientCreateSearch" assert inst.test[0].name == "Patient Create Search" assert inst.test[1].action[0].operation.accept == "xml" assert ( inst.test[1].action[0].operation.description == "Search for Patient resources on the destination test system." ) assert inst.test[1].action[0].operation.encodeRequestUrl is True assert inst.test[1].action[0].operation.params == ( "?family=${PatientSearchFamilyName}&given=${PatientSearchGive" "nName}" ) assert inst.test[1].action[0].operation.resource == "Patient" assert inst.test[1].action[0].operation.type.code == "search" assert ( inst.test[1].action[0].operation.type.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" } ).valueUri ) assert ( inst.test[1].action[1].assert_fhir.description == "Confirm that the returned HTTP status is 200(OK)." ) assert inst.test[1].action[1].assert_fhir.response == "okay" assert inst.test[1].action[1].assert_fhir.warningOnly is False assert inst.test[1].action[2].assert_fhir.contentType == "xml" assert ( inst.test[1].action[2].assert_fhir.description == "Confirm that the returned format is XML." ) assert inst.test[1].action[2].assert_fhir.warningOnly is False assert ( inst.test[1].action[3].assert_fhir.description == "Confirm that the returned resource type is Bundle." ) assert inst.test[1].action[3].assert_fhir.resource == "Bundle" assert inst.test[1].action[3].assert_fhir.warningOnly is False assert inst.test[1].action[4].assert_fhir.description == ( "Confirm that the returned Bundle conforms to the base FHIR " "specification." ) assert inst.test[1].action[4].assert_fhir.validateProfileId == "bundle-profile" assert inst.test[1].action[4].assert_fhir.warningOnly is False assert ( inst.test[1].action[5].assert_fhir.description == "Confirm that the returned Bundle type equals 'searchset'." ) assert inst.test[1].action[5].assert_fhir.operator == "equals" assert inst.test[1].action[5].assert_fhir.path == "fhir:Bundle/fhir:type/@value" assert inst.test[1].action[5].assert_fhir.value == "searchset" assert inst.test[1].action[5].assert_fhir.warningOnly is False assert inst.test[1].action[6].assert_fhir.description == ( "Confirm that the returned Bundle total is greater than or " "equal to the number of returned entries." ) assert ( inst.test[1].action[6].assert_fhir.expression == "Bundle.total.toInteger() >= entry.count()" ) assert inst.test[1].action[6].assert_fhir.warningOnly is False assert inst.test[1].description == ( "Search for Patient resources using the user defined dynamic " "variables ${PatientSearchFamilyName} and " "${PatientSearchGivenName} and validate response." ) assert inst.test[1].id == "02-PatientSearchDynamic" assert inst.test[1].name == "Patient Search Dynamic" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/TestScript/testscript-example-search"} ).valueUri ) assert inst.variable[0].headerField == "Location" assert inst.variable[0].name == "PatientCreateLocation" assert inst.variable[0].sourceId == "PatientCreateResponse" assert inst.variable[1].description == ( "Enter patient search criteria for a known family name on the" " target system" ) assert inst.variable[1].hint == "[Family name]" assert inst.variable[1].name == "PatientSearchFamilyName" assert inst.variable[2].description == ( "Enter patient search criteria for a known given name on the " "target system" ) assert inst.variable[2].hint == "[Given name]" assert inst.variable[2].name == "PatientSearchGivenName" assert ( inst.variable[3].description == "Evaluate the returned Patient searchset Bundle.total value" ) assert inst.variable[3].expression == "Bundle.total.toInteger()" assert inst.variable[3].name == "PatientSearchBundleTotal" assert inst.version == "1.0" def test_testscript_4(base_settings): """No. 4 tests collection for TestScript. Test File: testscript-example-search.json """ filename = base_settings["unittest_data_dir"] / "testscript-example-search.json" inst = testscript.TestScript.model_validate_json(filename.read_bytes()) assert "TestScript" == inst.get_resource_type() impl_testscript_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "TestScript" == data["resourceType"] inst2 = testscript.TestScript(**data) impl_testscript_4(inst2) def impl_testscript_5(inst): assert inst.contact[0].name == "Support" assert inst.contact[0].telecom[0].system == "email" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "support@HL7.org" assert inst.copyright == "© HL7.org 2011+" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-18"} ).valueDateTime ) assert inst.description == ( "TestScript example resource with setup to delete if present " "and create a new instance of a Patient; and single test " "definition to read the created Patient with various asserts." ) assert inst.experimental is True assert inst.fixture[0].autocreate is False assert inst.fixture[0].autodelete is False assert inst.fixture[0].id == "fixture-patient-create" assert inst.fixture[0].resource.display == "Peter Chalmers" assert inst.fixture[0].resource.reference == "Patient/example" assert inst.fixture[1].autocreate is False assert inst.fixture[1].autodelete is False assert inst.fixture[1].id == "fixture-patient-minimum" assert inst.fixture[1].resource.display == "Peter Chalmers (minimum)" assert inst.fixture[1].resource.reference == "Patient/example" assert inst.id == "testscript-example" assert ( inst.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier.value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9876" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America (the)" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert ( inst.metadata.capability[0].capabilities == "http://hl7.org/fhir/CapabilityStatement/example" ) assert ( inst.metadata.capability[0].description == "Patient Update, Read and Delete Operations" ) assert ( inst.metadata.capability[0].link[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/http.html#delete"} ).valueUri ) assert ( inst.metadata.capability[0].link[1] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/http.html#read"} ).valueUri ) assert ( inst.metadata.capability[0].link[2] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/http.html#update"} ).valueUri ) assert inst.metadata.capability[0].required is True assert inst.metadata.capability[0].validated is False assert inst.metadata.link[0].description == ( "Demographics and other administrative information about an " "individual or animal receiving care or other health-related " "services." ) assert ( inst.metadata.link[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/patient.html"} ).valueUri ) assert inst.name == "TestScript Example" assert inst.profile[0].id == "patient-profile" assert ( inst.profile[0].reference == "http://hl7.org/fhir/StructureDefinition/Patient" ) assert inst.publisher == "HL7" assert inst.purpose == ( "Patient Conditional Create (Update), Read and Delete " "Operations" ) assert inst.setup.action[0].operation.accept == "json" assert inst.setup.action[0].operation.description == ( "Execute a delete operation to insure the patient does not " "exist on the server." ) assert inst.setup.action[0].operation.encodeRequestUrl is True assert inst.setup.action[0].operation.label == "SetupDeletePatient" assert inst.setup.action[0].operation.params == "/${createResourceId}" assert inst.setup.action[0].operation.resource == "Patient" assert inst.setup.action[0].operation.type.code == "delete" assert ( inst.setup.action[0].operation.type.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" } ).valueUri ) assert inst.setup.action[1].assert_fhir.description == ( "Confirm that the returned HTTP status is 200(OK) or 204(No " "Content)." ) assert inst.setup.action[1].assert_fhir.direction == "response" assert inst.setup.action[1].assert_fhir.operator == "in" assert inst.setup.action[1].assert_fhir.responseCode == "200,204" assert inst.setup.action[1].assert_fhir.warningOnly is False assert inst.setup.action[2].operation.accept == "json" assert inst.setup.action[2].operation.contentType == "json" assert inst.setup.action[2].operation.description == ( "Create patient resource on test server using the contents of" " fixture-patient-create" ) assert inst.setup.action[2].operation.encodeRequestUrl is True assert inst.setup.action[2].operation.label == "SetupCreatePatient" assert inst.setup.action[2].operation.params == "/${createResourceId}" assert inst.setup.action[2].operation.resource == "Patient" assert inst.setup.action[2].operation.sourceId == "fixture-patient-create" assert inst.setup.action[2].operation.type.code == "update" assert ( inst.setup.action[2].operation.type.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" } ).valueUri ) assert ( inst.setup.action[3].assert_fhir.description == "Confirm that the returned HTTP status is 201(Created)." ) assert inst.setup.action[3].assert_fhir.direction == "response" assert inst.setup.action[3].assert_fhir.responseCode == "201" assert inst.setup.action[3].assert_fhir.warningOnly is False assert inst.setup.action[4].operation.description == ( "Read the created patient resource on the test server using " "the id from fixture-patient-create. Verify contents." ) assert inst.setup.action[4].operation.encodeRequestUrl is True assert inst.setup.action[4].operation.resource == "Patient" assert inst.setup.action[4].operation.targetId == "fixture-patient-create" assert inst.setup.action[4].operation.type.code == "read" assert ( inst.setup.action[4].operation.type.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" } ).valueUri ) assert ( inst.setup.action[5].assert_fhir.description == "Confirm that the returned HTTP status is 200(OK)." ) assert inst.setup.action[5].assert_fhir.direction == "response" assert inst.setup.action[5].assert_fhir.response == "okay" assert inst.setup.action[5].assert_fhir.warningOnly is False assert ( inst.setup.action[6].assert_fhir.compareToSourceExpression == "Patient.name.first().family" ) assert ( inst.setup.action[6].assert_fhir.compareToSourceId == "fixture-patient-create" ) assert inst.setup.action[6].assert_fhir.description == ( "Confirm that the returned Patient contains the expected " "family name 'Chalmers'. Uses explicit compareToSourceId " "reference to fixture-patient-create used to create the " "Patient." ) assert inst.setup.action[6].assert_fhir.operator == "equals" assert inst.setup.action[6].assert_fhir.warningOnly is False assert inst.status == "draft" assert inst.teardown.action[0].operation.description == ( "Delete the patient resource on the test server using the id " "from fixture-patient-create." ) assert inst.teardown.action[0].operation.encodeRequestUrl is True assert inst.teardown.action[0].operation.resource == "Patient" assert inst.teardown.action[0].operation.targetId == "fixture-patient-create" assert inst.teardown.action[0].operation.type.code == "delete" assert ( inst.teardown.action[0].operation.type.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" } ).valueUri ) assert inst.test[0].action[0].operation.description == ( "Read the patient resource on the test server using the id " "from fixture-patient-create. Prevent URL encoding of the " "request." ) assert inst.test[0].action[0].operation.encodeRequestUrl is False assert inst.test[0].action[0].operation.resource == "Patient" assert inst.test[0].action[0].operation.responseId == "fixture-patient-read" assert inst.test[0].action[0].operation.targetId == "fixture-patient-create" assert inst.test[0].action[0].operation.type.code == "read" assert ( inst.test[0].action[0].operation.type.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" } ).valueUri ) assert ( inst.test[0].action[1].assert_fhir.description == "Confirm that the returned HTTP status is 200(OK)." ) assert inst.test[0].action[1].assert_fhir.direction == "response" assert inst.test[0].action[1].assert_fhir.label == "01-ReadPatientOK" assert inst.test[0].action[1].assert_fhir.response == "okay" assert inst.test[0].action[1].assert_fhir.warningOnly is False assert inst.test[0].action[2].assert_fhir.description == ( "Confirm that the returned HTTP Header Last-Modified is " "present. Warning only as the server might not support " "versioning." ) assert inst.test[0].action[2].assert_fhir.direction == "response" assert inst.test[0].action[2].assert_fhir.headerField == "Last-Modified" assert inst.test[0].action[2].assert_fhir.operator == "notEmpty" assert inst.test[0].action[2].assert_fhir.warningOnly is True assert ( inst.test[0].action[3].assert_fhir.description == "Confirm that the returned resource type is Patient." ) assert inst.test[0].action[3].assert_fhir.resource == "Patient" assert inst.test[0].action[3].assert_fhir.warningOnly is False assert inst.test[0].action[4].assert_fhir.description == ( "Confirm that the returned Patient conforms to the base FHIR " "specification." ) assert inst.test[0].action[4].assert_fhir.validateProfileId == "patient-profile" assert inst.test[0].action[4].assert_fhir.warningOnly is False assert inst.test[0].action[5].assert_fhir.description == ( "Confirm that the returned Patient contains the expected " "family name 'Chalmers'. Uses explicit sourceId reference to " "read responseId fixture." ) assert inst.test[0].action[5].assert_fhir.operator == "equals" assert ( inst.test[0].action[5].assert_fhir.path == "fhir:Patient/fhir:name/fhir:family/@value" ) assert inst.test[0].action[5].assert_fhir.sourceId == "fixture-patient-read" assert inst.test[0].action[5].assert_fhir.value == "Chalmers" assert inst.test[0].action[5].assert_fhir.warningOnly is False assert inst.test[0].action[6].assert_fhir.description == ( "Confirm that the returned Patient contains the expected " "given name 'Peter'. Uses explicit sourceId reference to read" " responseId fixture." ) assert inst.test[0].action[6].assert_fhir.operator == "equals" assert ( inst.test[0].action[6].assert_fhir.path == "fhir:Patient/fhir:name/fhir:given/@value" ) assert inst.test[0].action[6].assert_fhir.sourceId == "fixture-patient-read" assert inst.test[0].action[6].assert_fhir.value == "Peter" assert inst.test[0].action[6].assert_fhir.warningOnly is False assert ( inst.test[0].action[7].assert_fhir.compareToSourceId == "fixture-patient-create" ) assert ( inst.test[0].action[7].assert_fhir.compareToSourcePath == "fhir:Patient/fhir:name/fhir:family/@value" ) assert inst.test[0].action[7].assert_fhir.operator == "equals" assert ( inst.test[0].action[7].assert_fhir.path == "fhir:Patient/fhir:name/fhir:family/@value" ) assert inst.test[0].action[7].assert_fhir.warningOnly is False assert ( inst.test[0].action[8].assert_fhir.compareToSourceId == "fixture-patient-create" ) assert ( inst.test[0].action[8].assert_fhir.compareToSourcePath == "fhir:Patient/fhir:name/fhir:given/@value" ) assert ( inst.test[0].action[8].assert_fhir.path == "fhir:Patient/fhir:name/fhir:given/@value" ) assert inst.test[0].action[8].assert_fhir.sourceId == "fixture-patient-read" assert inst.test[0].action[8].assert_fhir.warningOnly is False assert inst.test[0].action[9].assert_fhir.description == ( "Confirm that the returned resource contains the expected " "retained elements and values. Warning only to provide users " "with reviewable results." ) assert inst.test[0].action[9].assert_fhir.minimumId == "fixture-patient-minimum" assert inst.test[0].action[9].assert_fhir.warningOnly is True assert inst.test[0].description == "Read a Patient and validate response." assert inst.test[0].id == "01-ReadPatient" assert inst.test[0].name == "Read Patient" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/TestScript/testscript-example"} ).valueUri ) assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "positive" assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variant-state"} ).valueUri ) assert inst.variable[0].name == "createResourceId" assert inst.variable[0].path == "Patient/id" assert inst.variable[0].sourceId == "fixture-patient-create" assert inst.version == "1.0" def test_testscript_5(base_settings): """No. 5 tests collection for TestScript. Test File: testscript-example.json """ filename = base_settings["unittest_data_dir"] / "testscript-example.json" inst = testscript.TestScript.model_validate_json(filename.read_bytes()) assert "TestScript" == inst.get_resource_type() impl_testscript_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "TestScript" == data["resourceType"] inst2 = testscript.TestScript(**data) impl_testscript_5(inst2) def impl_testscript_6(inst): assert inst.contact[0].name == "Support" assert inst.contact[0].telecom[0].system == "email" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "support@HL7.org" assert inst.copyright == "© HL7.org 2011+" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-18"} ).valueDateTime ) assert inst.description == ( "TestScript example resource with ported Sprinkler basic read" " tests R001, R002, R003, R004. The read tests will utilize " "user defined dynamic variables that will hold the Patient " "resource id values." ) assert inst.experimental is True assert inst.id == "testscript-example-readtest" assert ( inst.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier.value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9879" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America (the)" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert ( inst.metadata.capability[0].capabilities == "http://hl7.org/fhir/CapabilityStatement/example" ) assert inst.metadata.capability[0].description == "Patient Read Operation" assert ( inst.metadata.capability[0].link[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/http.html#read"} ).valueUri ) assert inst.metadata.capability[0].required is True assert inst.metadata.capability[0].validated is False assert inst.metadata.link[0].description == ( "Demographics and other administrative information about an " "individual or animal receiving care or other health-related " "services." ) assert ( inst.metadata.link[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/patient.html"} ).valueUri ) assert inst.name == "TestScript Example Read Test" assert inst.profile[0].id == "patient-profile" assert ( inst.profile[0].reference == "http://hl7.org/fhir/StructureDefinition/Patient" ) assert inst.publisher == "HL7" assert inst.purpose == "Patient Read Operation" assert inst.status == "draft" assert inst.test[0].action[0].operation.accept == "xml" assert inst.test[0].action[0].operation.description == ( "Read the known Patient resource on the destination test " "system using the user defined dynamic variable " "${KnownPatientResourceId}." ) assert inst.test[0].action[0].operation.encodeRequestUrl is True assert inst.test[0].action[0].operation.params == "/${KnownPatientResourceId}" assert inst.test[0].action[0].operation.resource == "Patient" assert inst.test[0].action[0].operation.type.code == "read" assert ( inst.test[0].action[0].operation.type.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" } ).valueUri ) assert ( inst.test[0].action[1].assert_fhir.description == "Confirm that the returned HTTP status is 200(OK)." ) assert inst.test[0].action[1].assert_fhir.response == "okay" assert inst.test[0].action[1].assert_fhir.warningOnly is False assert inst.test[0].action[2].assert_fhir.contentType == "xml" assert ( inst.test[0].action[2].assert_fhir.description == "Confirm that the returned format is XML." ) assert inst.test[0].action[2].assert_fhir.warningOnly is False assert inst.test[0].action[3].assert_fhir.description == ( "Confirm that the returned HTTP Header Last-Modified is " "present. Warning only as the server might not support " "versioning." ) assert inst.test[0].action[3].assert_fhir.headerField == "Last-Modified" assert inst.test[0].action[3].assert_fhir.operator == "notEmpty" assert inst.test[0].action[3].assert_fhir.warningOnly is True assert ( inst.test[0].action[4].assert_fhir.description == "Confirm that the returned resource type is Patient." ) assert inst.test[0].action[4].assert_fhir.resource == "Patient" assert inst.test[0].action[4].assert_fhir.warningOnly is False assert inst.test[0].action[5].assert_fhir.description == ( "Confirm that the returned Patient conforms to the base FHIR " "specification." ) assert inst.test[0].action[5].assert_fhir.validateProfileId == "patient-profile" assert inst.test[0].action[5].assert_fhir.warningOnly is False assert inst.test[0].description == "Read a known Patient and validate response." assert inst.test[0].id == "R001" assert inst.test[0].name == "Sprinkler Read Test R001" assert inst.test[1].action[0].operation.accept == "xml" assert inst.test[1].action[0].operation.encodeRequestUrl is True assert inst.test[1].action[0].operation.params == "/1" assert inst.test[1].action[0].operation.resource == "Patient" assert inst.test[1].action[0].operation.type.code == "read" assert ( inst.test[1].action[0].operation.type.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" } ).valueUri ) assert ( inst.test[1].action[1].assert_fhir.description == "Confirm that the returned HTTP status is 404(Not Found)." ) assert inst.test[1].action[1].assert_fhir.response == "notFound" assert inst.test[1].action[1].assert_fhir.warningOnly is False assert ( inst.test[1].description == "Read an unknown Resource Type and validate response." ) assert inst.test[1].id == "R002" assert inst.test[1].name == "Sprinkler Read Test R002" assert inst.test[2].action[0].operation.accept == "xml" assert inst.test[2].action[0].operation.description == ( "Attempt to read the non-existing Patient resource on the " "destination test system using the user defined dynamic " "variable ${NonExistsPatientResourceId}." ) assert inst.test[2].action[0].operation.encodeRequestUrl is True assert inst.test[2].action[0].operation.params == "/${NonExistsPatientResourceId}" assert inst.test[2].action[0].operation.resource == "Patient" assert inst.test[2].action[0].operation.type.code == "read" assert ( inst.test[2].action[0].operation.type.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" } ).valueUri ) assert ( inst.test[2].action[1].assert_fhir.description == "Confirm that the returned HTTP status is 404(Not Found)." ) assert inst.test[2].action[1].assert_fhir.response == "notFound" assert inst.test[2].action[1].assert_fhir.warningOnly is False assert ( inst.test[2].description == "Read a known, non-existing Patient and validate response." ) assert inst.test[2].id == "R003" assert inst.test[2].name == "Sprinkler Read Test R003" assert inst.test[3].action[0].operation.accept == "xml" assert inst.test[3].action[0].operation.description == ( "Attempt to read a Patient resource on the destination test " "system using known bad formatted resource id." ) assert inst.test[3].action[0].operation.encodeRequestUrl is True assert inst.test[3].action[0].operation.params == "/ID-may-not-contain-CAPITALS" assert inst.test[3].action[0].operation.resource == "Patient" assert inst.test[3].action[0].operation.type.code == "read" assert ( inst.test[3].action[0].operation.type.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes" } ).valueUri ) assert ( inst.test[3].action[1].assert_fhir.description == "Confirm that the returned HTTP status is 400(Bad Request)." ) assert inst.test[3].action[1].assert_fhir.response == "bad" assert inst.test[3].action[1].assert_fhir.warningOnly is False assert inst.test[3].description == ( "Read a Patient using a known bad formatted resource id and " "validate response." ) assert inst.test[3].id == "R004" assert inst.test[3].name == "Sprinkler Read Test R004" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/TestScript/testscript-example-readtest"} ).valueUri ) assert inst.variable[0].defaultValue == "example" assert inst.variable[0].name == "KnownPatientResourceId" assert inst.variable[1].defaultValue == "does-not-exist" assert inst.variable[1].name == "NonExistsPatientResourceId" assert inst.version == "1.0" def test_testscript_6(base_settings): """No. 6 tests collection for TestScript. Test File: testscript-example-readtest.json """ filename = base_settings["unittest_data_dir"] / "testscript-example-readtest.json" inst = testscript.TestScript.model_validate_json(filename.read_bytes()) assert "TestScript" == inst.get_resource_type() impl_testscript_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "TestScript" == data["resourceType"] inst2 = testscript.TestScript(**data) impl_testscript_6(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_valueset.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ValueSet Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import valueset from .conftest import ExternalValidatorModel # noqa: F401 def impl_valueset_1(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/device-status-reason"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-17T07:06:13+11:00"} ).valueDateTime ) assert inst.description == "The availability status reason of the device." assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "oo" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 2 assert inst.id == "device-status-reason" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.1081" assert inst.immutable is True assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2022-05-28T13:47:40.239+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablevalueset" ) assert inst.name == "FHIRDeviceStatusReason" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "FHIRDeviceStatusReason" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/device-status-reason"} ).valueUri ) assert inst.version == "4.3.0" def test_valueset_1(base_settings): """No. 1 tests collection for ValueSet. Test File: valueset-device-status-reason.json """ filename = base_settings["unittest_data_dir"] / "valueset-device-status-reason.json" inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_1(inst2) def impl_valueset_2(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/definition-resource-types"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.description == ( "A list of all the definition resource types defined in this " "version of the FHIR specification." ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "vocab" assert inst.id == "definition-resource-types" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.1056" assert inst.immutable is True assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2022-05-28T12:47:40.239+10:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablevalueset" ) assert inst.name == "DefinitionResourceType" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "DefinitionResourceType" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/definition-resource-types"} ).valueUri ) assert inst.version == "4.3.0" def test_valueset_2(base_settings): """No. 2 tests collection for ValueSet. Test File: valueset-definition-resource-types.json """ filename = ( base_settings["unittest_data_dir"] / "valueset-definition-resource-types.json" ) inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_2(inst2) def impl_valueset_3(inst): assert inst.compose.include[0].concept[0].code == "419161000" assert inst.compose.include[0].concept[0].display == "Unilateral left" assert inst.compose.include[0].concept[1].code == "419465000" assert inst.compose.include[0].concept[1].display == "Unilateral right" assert inst.compose.include[0].concept[2].code == "51440002" assert inst.compose.include[0].concept[2].display == "Bilateral" assert inst.compose.include[0].concept[3].code == "261183002" assert inst.compose.include[0].concept[3].display == "Upper" assert inst.compose.include[0].concept[4].code == "261122009" assert inst.compose.include[0].concept[4].display == "Lower" assert inst.compose.include[0].concept[5].code == "255561001" assert inst.compose.include[0].concept[5].display == "Medial" assert inst.compose.include[0].concept[6].code == "49370004" assert inst.compose.include[0].concept[6].display == "Lateral" assert inst.compose.include[0].concept[7].code == "264217000" assert inst.compose.include[0].concept[7].display == "Superior" assert inst.compose.include[0].concept[8].code == "261089000" assert inst.compose.include[0].concept[8].display == "Inferior" assert inst.compose.include[0].concept[9].code == "255551008" assert inst.compose.include[0].concept[9].display == "Posterior" assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.description == "SNOMED-CT concepts modifying the anatomic location" assert inst.experimental is True assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "oo" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "draft" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 1 assert inst.id == "bodystructure-relative-location" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.140" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2022-05-28T12:47:40.239+10:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablevalueset" ) assert inst.name == "BodystructureLocationQualifier" assert inst.publisher == "Order and Observation Workgroup" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Bodystructure Location Qualifier" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/bodystructure-relative-location"} ).valueUri ) assert inst.version == "4.3.0" def test_valueset_3(base_settings): """No. 3 tests collection for ValueSet. Test File: valueset-bodystructure-relative-location.json """ filename = ( base_settings["unittest_data_dir"] / "valueset-bodystructure-relative-location.json" ) inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_3(inst2) def impl_valueset_4(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/encounter-status"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-17T07:06:13+11:00"} ).valueDateTime ) assert inst.description == "Current state of the encounter." assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "pa" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 2 assert inst.id == "encounter-status" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.246" assert inst.immutable is True assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2022-05-28T13:47:40.239+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablevalueset" ) assert inst.name == "EncounterStatus" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "EncounterStatus" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/encounter-status"} ).valueUri ) assert inst.version == "4.3.0" def test_valueset_4(base_settings): """No. 4 tests collection for ValueSet. Test File: valueset-encounter-status.json """ filename = base_settings["unittest_data_dir"] / "valueset-encounter-status.json" inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_4(inst2) def impl_valueset_5(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentscope"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.copyright == "This is an example set." assert inst.description == "This value set includes the four Consent scope codes." assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "cbcc" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 2 assert inst.id == "consent-scope" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.761" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2022-05-28T12:47:40.239+10:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablevalueset" ) assert inst.name == "ConsentScopeCodes" assert inst.publisher == "CBCC" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Consent Scope Codes" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/consent-scope"} ).valueUri ) assert inst.version == "4.3.0" def test_valueset_5(base_settings): """No. 5 tests collection for ValueSet. Test File: valueset-consent-scope.json """ filename = base_settings["unittest_data_dir"] / "valueset-consent-scope.json" inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_5(inst2) def impl_valueset_6(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/report-status-codes"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-17T07:06:13+11:00"} ).valueDateTime ) assert inst.description == "The current status of the test report." assert inst.experimental is True assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "fhir" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 0 assert inst.id == "report-status-codes" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.724" assert inst.immutable is True assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2022-05-28T13:47:40.239+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablevalueset" ) assert inst.name == "TestReportStatus" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "TestReportStatus" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/report-status-codes"} ).valueUri ) assert inst.version == "4.3.0" def test_valueset_6(base_settings): """No. 6 tests collection for ValueSet. Test File: valueset-report-status-codes.json """ filename = base_settings["unittest_data_dir"] / "valueset-report-status-codes.json" inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_6(inst2) def impl_valueset_7(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/note-type"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-28T12:47:40+10:00"} ).valueDateTime ) assert inst.description == "The presentation types of notes." assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "fm" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 2 assert inst.id == "note-type" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.15" assert inst.immutable is True assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2022-05-28T12:47:40.239+10:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablevalueset" ) assert inst.name == "NoteType" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.div == ( '
" ) assert inst.text.status == "generated" assert inst.title == "NoteType" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/note-type"} ).valueUri ) assert inst.version == "4.3.0" def test_valueset_7(base_settings): """No. 7 tests collection for ValueSet. Test File: valueset-note-type.json """ filename = base_settings["unittest_data_dir"] / "valueset-note-type.json" inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_7(inst2) def impl_valueset_8(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://precision.fda.gov/apps/"} ).valueUri ) assert ( inst.compose.include[1].system == ExternalValidatorModel.model_validate( {"valueUri": "https://precision.fda.gov/jobs/"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.description == "This value set includes sequence quality method" assert inst.experimental is True assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "cg" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "draft" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 1 assert inst.id == "sequence-quality-method" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.223" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2022-05-28T12:47:40.239+10:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablevalueset" ) assert inst.name == "FDA-Method" assert inst.publisher == "FHIR Project team" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/sequence-quality-method"} ).valueUri ) assert inst.version == "4.3.0" def test_valueset_8(base_settings): """No. 8 tests collection for ValueSet. Test File: valueset-sequence-quality-method.json """ filename = ( base_settings["unittest_data_dir"] / "valueset-sequence-quality-method.json" ) inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_8(inst2) def impl_valueset_9(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/issue-severity"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-17T07:06:13+11:00"} ).valueDateTime ) assert inst.description == "How the issue affects the success of the action." assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "fhir" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "normative" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version" } ).valueUri ) assert inst.extension[2].valueCode == "4.0.0" assert ( inst.extension[3].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[3].valueInteger == 5 assert inst.id == "issue-severity" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.408" assert inst.immutable is True assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2022-05-28T13:47:40.239+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablevalueset" ) assert inst.name == "IssueSeverity" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "IssueSeverity" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/issue-severity"} ).valueUri ) assert inst.version == "4.3.0" def test_valueset_9(base_settings): """No. 9 tests collection for ValueSet. Test File: valueset-issue-severity.json """ filename = base_settings["unittest_data_dir"] / "valueset-issue-severity.json" inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_9(inst2) def impl_valueset_10(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.ensembl.org"} ).valueUri ) assert ( inst.compose.include[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.ncbi.nlm.nih.gov/nuccore"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.description == "This value set includes all Reference codes" assert inst.experimental is True assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "cg" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "draft" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 1 assert inst.id == "sequence-referenceSeq" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.221" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2022-05-28T12:47:40.239+10:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablevalueset" ) assert inst.name == "ENSEMBL" assert inst.publisher == "FHIR Project team" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/sequence-referenceSeq"} ).valueUri ) assert inst.version == "4.3.0" def test_valueset_10(base_settings): """No. 10 tests collection for ValueSet. Test File: valueset-sequence-referenceSeq.json """ filename = ( base_settings["unittest_data_dir"] / "valueset-sequence-referenceSeq.json" ) inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_10(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_verificationresult.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/VerificationResult Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import verificationresult from .conftest import ExternalValidatorModel # noqa: F401 def impl_verificationresult_1(inst): assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "attested" assert inst.text.status == "generated" def test_verificationresult_1(base_settings): """No. 1 tests collection for VerificationResult. Test File: verificationresult-example.json """ filename = base_settings["unittest_data_dir"] / "verificationresult-example.json" inst = verificationresult.VerificationResult.model_validate_json( filename.read_bytes() ) assert "VerificationResult" == inst.get_resource_type() impl_verificationresult_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "VerificationResult" == data["resourceType"] inst2 = verificationresult.VerificationResult(**data) impl_verificationresult_1(inst2) ================================================ FILE: fhir/resources/R4B/tests/test_visionprescription.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/VisionPrescription Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from .. import visionprescription from .conftest import ExternalValidatorModel # noqa: F401 def impl_visionprescription_1(inst): assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-06-15"} ).valueDateTime ) assert ( inst.dateWritten == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-06-15"} ).valueDateTime ) assert inst.encounter.reference == "Encounter/f001" assert inst.id == "33124" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.happysight.com/prescription"} ).valueUri ) assert inst.identifier[0].value == "15014" assert float(inst.lensSpecification[0].add) == float(1.75) assert inst.lensSpecification[0].axis == 160 assert float(inst.lensSpecification[0].backCurve) == float(8.7) assert inst.lensSpecification[0].brand == "OphthaGuard" assert inst.lensSpecification[0].color == "green" assert float(inst.lensSpecification[0].cylinder) == float(-2.25) assert float(inst.lensSpecification[0].diameter) == float(14.0) assert inst.lensSpecification[0].duration.code == "mo" assert ( inst.lensSpecification[0].duration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.lensSpecification[0].duration.unit == "mo" assert float(inst.lensSpecification[0].duration.value) == float(1) assert inst.lensSpecification[0].eye == "right" assert ( inst.lensSpecification[0].note[0].text == "Shade treatment for extreme light sensitivity" ) assert float(inst.lensSpecification[0].power) == float(-2.75) assert inst.lensSpecification[0].product.coding[0].code == "contact" assert ( inst.lensSpecification[0].product.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct" } ).valueUri ) assert float(inst.lensSpecification[1].add) == float(1.75) assert inst.lensSpecification[1].axis == 160 assert float(inst.lensSpecification[1].backCurve) == float(8.7) assert inst.lensSpecification[1].brand == "OphthaGuard" assert inst.lensSpecification[1].color == "green" assert float(inst.lensSpecification[1].cylinder) == float(-3.5) assert float(inst.lensSpecification[1].diameter) == float(14.0) assert inst.lensSpecification[1].duration.code == "mo" assert ( inst.lensSpecification[1].duration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.lensSpecification[1].duration.unit == "month" assert float(inst.lensSpecification[1].duration.value) == float(1) assert inst.lensSpecification[1].eye == "left" assert ( inst.lensSpecification[1].note[0].text == "Shade treatment for extreme light sensitivity" ) assert float(inst.lensSpecification[1].power) == float(-2.75) assert inst.lensSpecification[1].product.coding[0].code == "contact" assert ( inst.lensSpecification[1].product.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct" } ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert inst.prescriber.reference == "Practitioner/example" assert inst.status == "active" assert inst.text.div == ( '
Sample Contract ' "Lens prescription
" ) assert inst.text.status == "generated" def test_visionprescription_1(base_settings): """No. 1 tests collection for VisionPrescription. Test File: visionprescription-example-1.json """ filename = base_settings["unittest_data_dir"] / "visionprescription-example-1.json" inst = visionprescription.VisionPrescription.model_validate_json( filename.read_bytes() ) assert "VisionPrescription" == inst.get_resource_type() impl_visionprescription_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "VisionPrescription" == data["resourceType"] inst2 = visionprescription.VisionPrescription(**data) impl_visionprescription_1(inst2) def impl_visionprescription_2(inst): assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-06-15"} ).valueDateTime ) assert ( inst.dateWritten == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-06-15"} ).valueDateTime ) assert inst.id == "33123" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.happysight.com/prescription"} ).valueUri ) assert inst.identifier[0].value == "15013" assert float(inst.lensSpecification[0].add) == float(2.0) assert inst.lensSpecification[0].eye == "right" assert float(inst.lensSpecification[0].prism[0].amount) == float(0.5) assert inst.lensSpecification[0].prism[0].base == "down" assert inst.lensSpecification[0].product.coding[0].code == "lens" assert ( inst.lensSpecification[0].product.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct" } ).valueUri ) assert float(inst.lensSpecification[0].sphere) == float(-2.0) assert float(inst.lensSpecification[1].add) == float(2.0) assert inst.lensSpecification[1].axis == 180 assert float(inst.lensSpecification[1].cylinder) == float(-0.5) assert inst.lensSpecification[1].eye == "left" assert float(inst.lensSpecification[1].prism[0].amount) == float(0.5) assert inst.lensSpecification[1].prism[0].base == "up" assert inst.lensSpecification[1].product.coding[0].code == "lens" assert ( inst.lensSpecification[1].product.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct" } ).valueUri ) assert float(inst.lensSpecification[1].sphere) == float(-1.0) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert inst.prescriber.reference == "Practitioner/example" assert inst.status == "active" assert inst.text.status == "generated" def test_visionprescription_2(base_settings): """No. 2 tests collection for VisionPrescription. Test File: visionprescription-example.json """ filename = base_settings["unittest_data_dir"] / "visionprescription-example.json" inst = visionprescription.VisionPrescription.model_validate_json( filename.read_bytes() ) assert "VisionPrescription" == inst.get_resource_type() impl_visionprescription_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "VisionPrescription" == data["resourceType"] inst2 = visionprescription.VisionPrescription(**data) impl_visionprescription_2(inst2) ================================================ FILE: fhir/resources/R4B/testscript.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/TestScript Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class TestScript(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Describes a set of tests. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. """ __resource_type__ = "TestScript" contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the test script and/or its contents." " Copyright statements are generally legal restrictions on the use and " "publishing of the test script." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the test script was published. " "The date must change when the business version changes and it must " "change if the status code changes. In addition, it should change when " "the substantive content of the test script changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the test script", description=( "A free text natural language description of the test script from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) destination: typing.List[fhirtypes.TestScriptDestinationType] | None = Field( default=None, alias="destination", title=( "An abstract server representing a destination or receiver in a message" " exchange" ), description=( "An abstract server used in operations within this test script in the " "destination element." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this test script is authored for " "testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) fixture: typing.List[fhirtypes.TestScriptFixtureType] | None = Field( default=None, alias="fixture", title="Fixture in the test script - by reference (uri)", description=( "Fixture in the test script - by reference (uri). All fixtures are " "required for the test script to execute." ), json_schema_extra={ "element_property": True, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Additional identifier for the test script", description=( "A formal identifier that is used to identify this test script when it " "is represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for test script (if applicable)", description=( "A legal or geographic region in which the test script is intended to " "be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) metadata: fhirtypes.TestScriptMetadataType | None = Field( default=None, alias="metadata", title=( "Required capability that is assumed to function correctly on the FHIR " "server being tested" ), description=( "The required capability must exist and are assumed to function " "correctly on the FHIR server being tested." ), json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this test script (computer friendly)", description=( "A natural language name identifying the test script. This name should " "be usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) origin: typing.List[fhirtypes.TestScriptOriginType] | None = Field( default=None, alias="origin", title=( "An abstract server representing a client or sender in a message " "exchange" ), description=( "An abstract server used in operations within this test script in the " "origin element." ), json_schema_extra={ "element_property": True, }, ) profile: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="profile", title="Reference of the validation profile", description="Reference to the profile to be used for validation.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the test " "script." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this test script is defined", description=( "Explanation of why this test script is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) setup: fhirtypes.TestScriptSetupType | None = Field( default=None, alias="setup", title="A series of required setup operations before tests are executed", description=None, json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this test script. Enables tracking the life-cycle of the" " content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) teardown: fhirtypes.TestScriptTeardownType | None = Field( default=None, alias="teardown", title="A series of required clean up steps", description=( "A series of operations required to clean up after all the tests are " "executed (successfully or otherwise)." ), json_schema_extra={ "element_property": True, }, ) test: typing.List[fhirtypes.TestScriptTestType] | None = Field( default=None, alias="test", title="A test in this script", description=None, json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this test script (human friendly)", description="A short, descriptive, user-friendly title for the test script.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this test script, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this test script when it is " "referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which at which an authoritative " "instance of this test script is (or will be) published. This URL can " "be the target of a canonical reference. It SHALL remain the same when " "the test script is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate test script instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) variable: typing.List[fhirtypes.TestScriptVariableType] | None = Field( default=None, alias="variable", title="Placeholder for evaluated elements", description=( "Variable is set based either on element value in response body or on " "header field value in the response headers." ), json_schema_extra={ "element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the test script", description=( "The identifier that is used to identify this version of the test " "script when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the test script author" " and is not expected to be globally unique. For example, it might be a" " timestamp (e.g. yyyymmdd) if a managed version is not available. " "There is also no expectation that versions can be placed in a " "lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScript`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "origin", "destination", "metadata", "fixture", "profile", "variable", "setup", "test", "teardown", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScript`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("name", "name__ext"), ("status", "status__ext"), ("url", "url__ext"), ] return required_fields class TestScriptDestination(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An abstract server representing a destination or receiver in a message exchange. An abstract server used in operations within this test script in the destination element. """ __resource_type__ = "TestScriptDestination" index: fhirtypes.IntegerType | None = Field( default=None, alias="index", title="The index of the abstract destination server starting at 1", description=( "Abstract name given to a destination server in this test script. The " "name is provided as a number starting at 1." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) index__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_index", title="Extension field for ``index``." ) profile: fhirtypes.CodingType = Field( default=..., alias="profile", title=( "FHIR-Server | FHIR-SDC-FormManager | FHIR-SDC-FormReceiver | FHIR-SDC-" "FormProcessor" ), description="The type of destination profile the test system supports.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptDestination`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "index", "profile"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptDestination`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("index", "index__ext")] return required_fields class TestScriptFixture(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Fixture in the test script - by reference (uri). Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute. """ __resource_type__ = "TestScriptFixture" autocreate: bool | None = Field( default=None, alias="autocreate", title="Whether or not to implicitly create the fixture during setup", description=( "Whether or not to implicitly create the fixture during setup. If true," " the fixture is automatically created on each server being tested " "during setup, therefore no create operation is required for this " "fixture in the TestScript.setup section." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) autocreate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_autocreate", title="Extension field for ``autocreate``." ) autodelete: bool | None = Field( default=None, alias="autodelete", title="Whether or not to implicitly delete the fixture during teardown", description=( "Whether or not to implicitly delete the fixture during teardown. If " "true, the fixture is automatically deleted on each server being tested" " during teardown, therefore no delete operation is required for this " "fixture in the TestScript.teardown section." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) autodelete__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_autodelete", title="Extension field for ``autodelete``." ) resource: fhirtypes.ReferenceType | None = Field( default=None, alias="resource", title="Reference of the resource", description=( "Reference to the resource (containing the contents of the resource " "needed for operations)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptFixture`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "autocreate", "autodelete", "resource", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptFixture`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("autocreate", "autocreate__ext"), ("autodelete", "autodelete__ext"), ] return required_fields class TestScriptMetadata(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Required capability that is assumed to function correctly on the FHIR server being tested. The required capability must exist and are assumed to function correctly on the FHIR server being tested. """ __resource_type__ = "TestScriptMetadata" capability: typing.List[fhirtypes.TestScriptMetadataCapabilityType] = Field( default=..., alias="capability", title=( "Capabilities that are assumed to function correctly on the FHIR " "server being tested" ), description=( "Capabilities that must exist and are assumed to function correctly on " "the FHIR server being tested." ), json_schema_extra={ "element_property": True, }, ) link: typing.List[fhirtypes.TestScriptMetadataLinkType] | None = Field( default=None, alias="link", title="Links to the FHIR specification", description="A link to the FHIR specification that this test is covering.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptMetadata`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "link", "capability"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptMetadata`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptMetadataCapability(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Capabilities that are assumed to function correctly on the FHIR server being tested. Capabilities that must exist and are assumed to function correctly on the FHIR server being tested. """ __resource_type__ = "TestScriptMetadataCapability" capabilities: fhirtypes.CanonicalType | None = Field( default=None, alias="capabilities", title="Required Capability Statement", description=( "Minimum capabilities required of server for test script to execute " "successfully. If server does not meet at a minimum the referenced " "capability statement, then all tests in this script are skipped." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CapabilityStatement"], }, ) capabilities__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_capabilities", title="Extension field for ``capabilities``.", ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="The expected capabilities of the server", description=( "Description of the capabilities that this test script is requiring the" " server to support." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) destination: fhirtypes.IntegerType | None = Field( default=None, alias="destination", title="Which server these requirements apply to", description=None, json_schema_extra={ "element_property": True, }, ) destination__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_destination", title="Extension field for ``destination``." ) link: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="link", title="Links to the FHIR specification", description=( "Links to the FHIR specification that describes this interaction and " "the resources involved in more detail." ), json_schema_extra={ "element_property": True, }, ) link__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_link", title="Extension field for ``link``." ) origin: typing.List[fhirtypes.IntegerType | None] | None = Field( default=None, alias="origin", title="Which origin server these requirements apply to", description=None, json_schema_extra={ "element_property": True, }, ) origin__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_origin", title="Extension field for ``origin``." ) required: bool | None = Field( default=None, alias="required", title="Are the capabilities required?", description=( "Whether or not the test execution will require the given capabilities " "of the server in order for this test script to execute." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) required__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_required", title="Extension field for ``required``." ) validated: bool | None = Field( default=None, alias="validated", title="Are the capabilities validated?", description=( "Whether or not the test execution will validate the given capabilities" " of the server in order for this test script to execute." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) validated__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_validated", title="Extension field for ``validated``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptMetadataCapability`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "required", "validated", "description", "origin", "destination", "link", "capabilities", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptMetadataCapability`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("capabilities", "capabilities__ext"), ("required", "required__ext"), ("validated", "validated__ext"), ] return required_fields class TestScriptMetadataLink(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Links to the FHIR specification. A link to the FHIR specification that this test is covering. """ __resource_type__ = "TestScriptMetadataLink" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Short description", description="Short description of the link.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="URL to the specification", description=( "URL to a particular requirement or feature within the FHIR " "specification." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptMetadataLink`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "url", "description"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptMetadataLink`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("url", "url__ext")] return required_fields class TestScriptOrigin(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An abstract server representing a client or sender in a message exchange. An abstract server used in operations within this test script in the origin element. """ __resource_type__ = "TestScriptOrigin" index: fhirtypes.IntegerType | None = Field( default=None, alias="index", title="The index of the abstract origin server starting at 1", description=( "Abstract name given to an origin server in this test script. The name" " is provided as a number starting at 1." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) index__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_index", title="Extension field for ``index``." ) profile: fhirtypes.CodingType = Field( default=..., alias="profile", title="FHIR-Client | FHIR-SDC-FormFiller", description="The type of origin profile the test system supports.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptOrigin`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "index", "profile"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptOrigin`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("index", "index__ext")] return required_fields class TestScriptSetup(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A series of required setup operations before tests are executed. """ __resource_type__ = "TestScriptSetup" action: typing.List[fhirtypes.TestScriptSetupActionType] = Field( default=..., alias="action", title="A setup operation or assert to perform", description="Action would contain either an operation or an assertion.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptSetup`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "action"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptSetup`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptSetupAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A setup operation or assert to perform. Action would contain either an operation or an assertion. """ __resource_type__ = "TestScriptSetupAction" assert_fhir: fhirtypes.TestScriptSetupActionAssertType | None = Field( default=None, alias="assert", title="The assertion to perform", description=( "Evaluates the results of previous operations to determine if the " "server under test behaves appropriately." ), json_schema_extra={ "element_property": True, }, ) operation: fhirtypes.TestScriptSetupActionOperationType | None = Field( default=None, alias="operation", title="The setup operation to perform", description="The operation to perform.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptSetupAction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "operation", "assert"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptSetupAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptSetupActionAssert(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The assertion to perform. Evaluates the results of previous operations to determine if the server under test behaves appropriately. """ __resource_type__ = "TestScriptSetupActionAssert" compareToSourceExpression: fhirtypes.StringType | None = Field( default=None, alias="compareToSourceExpression", title="The FHIRPath expression to evaluate against the source fixture", description=( "The FHIRPath expression to evaluate against the source fixture. When " "compareToSourceId is defined, either compareToSourceExpression or " "compareToSourcePath must be defined, but not both." ), json_schema_extra={ "element_property": True, }, ) compareToSourceExpression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_compareToSourceExpression", title="Extension field for ``compareToSourceExpression``.", ) compareToSourceId: fhirtypes.StringType | None = Field( default=None, alias="compareToSourceId", title="Id of the source fixture to be evaluated", description=( "Id of the source fixture used as the contents to be evaluated by " 'either the "source/expression" or "sourceId/path" definition.' ), json_schema_extra={ "element_property": True, }, ) compareToSourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_compareToSourceId", title="Extension field for ``compareToSourceId``.", ) compareToSourcePath: fhirtypes.StringType | None = Field( default=None, alias="compareToSourcePath", title="XPath or JSONPath expression to evaluate against the source fixture", description=( "XPath or JSONPath expression to evaluate against the source fixture. " "When compareToSourceId is defined, either compareToSourceExpression or" " compareToSourcePath must be defined, but not both." ), json_schema_extra={ "element_property": True, }, ) compareToSourcePath__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_compareToSourcePath", title="Extension field for ``compareToSourcePath``.", ) contentType: fhirtypes.CodeType | None = Field( default=None, alias="contentType", title="Mime type to compare against the 'Content-Type' header", description=( "The mime-type contents to compare against the request or response " "message 'Content-Type' header." ), json_schema_extra={ "element_property": True, }, ) contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contentType", title="Extension field for ``contentType``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Tracking/reporting assertion description", description=( "The description would be used by test engines for tracking and " "reporting purposes." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) direction: fhirtypes.CodeType | None = Field( default=None, alias="direction", title="response | request", description="The direction to use for the assertion.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["response", "request"], }, ) direction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_direction", title="Extension field for ``direction``." ) expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="The FHIRPath expression to be evaluated", description=( "The FHIRPath expression to be evaluated against the request or " "response message contents - HTTP headers and payload." ), json_schema_extra={ "element_property": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) headerField: fhirtypes.StringType | None = Field( default=None, alias="headerField", title="HTTP header field name", description="The HTTP header field name e.g. 'Location'.", json_schema_extra={ "element_property": True, }, ) headerField__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_headerField", title="Extension field for ``headerField``." ) label: fhirtypes.StringType | None = Field( default=None, alias="label", title="Tracking/logging assertion label", description="The label would be used for tracking/logging purposes by test engines.", json_schema_extra={ "element_property": True, }, ) label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_label", title="Extension field for ``label``." ) minimumId: fhirtypes.StringType | None = Field( default=None, alias="minimumId", title="Fixture Id of minimum content resource", description=( "The ID of a fixture. Asserts that the response contains at a minimum " "the fixture specified by minimumId." ), json_schema_extra={ "element_property": True, }, ) minimumId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minimumId", title="Extension field for ``minimumId``." ) navigationLinks: bool | None = Field( default=None, alias="navigationLinks", title="Perform validation on navigation links?", description=( "Whether or not the test execution performs validation on the bundle " "navigation links." ), json_schema_extra={ "element_property": True, }, ) navigationLinks__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_navigationLinks", title="Extension field for ``navigationLinks``.", ) operator: fhirtypes.CodeType | None = Field( default=None, alias="operator", title=( "equals | notEquals | in | notIn | greaterThan | lessThan | empty | " "notEmpty | contains | notContains | eval" ), description=( "The operator type defines the conditional behavior of the assert. If " "not defined, the default is equals." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "equals", "notEquals", "in", "notIn", "greaterThan", "lessThan", "empty", "notEmpty", "contains", "notContains", "eval", ], }, ) operator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_operator", title="Extension field for ``operator``." ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="XPath or JSONPath expression", description=( "The XPath or JSONPath expression to be evaluated against the fixture " "representing the response received from server." ), json_schema_extra={ "element_property": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) requestMethod: fhirtypes.CodeType | None = Field( default=None, alias="requestMethod", title="delete | get | options | patch | post | put | head", description=( "The request method or HTTP operation code to compare against that used" " by the client system under test." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["delete", "get", "options", "patch", "post", "put", "head"], }, ) requestMethod__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requestMethod", title="Extension field for ``requestMethod``.", ) requestURL: fhirtypes.StringType | None = Field( default=None, alias="requestURL", title="Request URL comparison value", description="The value to use in a comparison against the request URL path string.", json_schema_extra={ "element_property": True, }, ) requestURL__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requestURL", title="Extension field for ``requestURL``." ) resource: fhirtypes.CodeType | None = Field( default=None, alias="resource", title="Resource type", description=( "The type of the resource. See " "http://build.fhir.org/resourcelist.html." ), json_schema_extra={ "element_property": True, }, ) resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resource", title="Extension field for ``resource``." ) response: fhirtypes.CodeType | None = Field( default=None, alias="response", title=( "okay | created | noContent | notModified | bad | forbidden | notFound " "| methodNotAllowed | conflict | gone | preconditionFailed | " "unprocessable" ), description=None, json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "okay", "created", "noContent", "notModified", "bad", "forbidden", "notFound", "methodNotAllowed", "conflict", "gone", "preconditionFailed", "unprocessable", ], }, ) response__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_response", title="Extension field for ``response``." ) responseCode: fhirtypes.StringType | None = Field( default=None, alias="responseCode", title="HTTP response code to test", description="The value of the HTTP response code to be tested.", json_schema_extra={ "element_property": True, }, ) responseCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_responseCode", title="Extension field for ``responseCode``.", ) sourceId: fhirtypes.IdType | None = Field( default=None, alias="sourceId", title="Fixture Id of source expression or headerField", description=( "Fixture to evaluate the XPath/JSONPath expression or the headerField " "against." ), json_schema_extra={ "element_property": True, }, ) sourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceId", title="Extension field for ``sourceId``." ) validateProfileId: fhirtypes.IdType | None = Field( default=None, alias="validateProfileId", title="Profile Id of validation profile reference", description="The ID of the Profile to validate against.", json_schema_extra={ "element_property": True, }, ) validateProfileId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_validateProfileId", title="Extension field for ``validateProfileId``.", ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The value to compare to", description=None, json_schema_extra={ "element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) warningOnly: bool | None = Field( default=None, alias="warningOnly", title="Will this assert produce a warning only on error?", description=( "Whether or not the test execution will produce a warning only on error" " for this assert." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) warningOnly__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_warningOnly", title="Extension field for ``warningOnly``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptSetupActionAssert`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "label", "description", "direction", "compareToSourceId", "compareToSourceExpression", "compareToSourcePath", "contentType", "expression", "headerField", "minimumId", "navigationLinks", "operator", "path", "requestMethod", "requestURL", "resource", "response", "responseCode", "sourceId", "validateProfileId", "value", "warningOnly", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionAssert`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("warningOnly", "warningOnly__ext")] return required_fields class TestScriptSetupActionOperation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The setup operation to perform. The operation to perform. """ __resource_type__ = "TestScriptSetupActionOperation" accept: fhirtypes.CodeType | None = Field( default=None, alias="accept", title="Mime type to accept in the payload of the response, with charset etc.", description="The mime-type to use for RESTful operation in the 'Accept' header.", json_schema_extra={ "element_property": True, }, ) accept__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_accept", title="Extension field for ``accept``." ) contentType: fhirtypes.CodeType | None = Field( default=None, alias="contentType", title="Mime type of the request payload contents, with charset etc.", description=( "The mime-type to use for RESTful operation in the 'Content-Type' " "header." ), json_schema_extra={ "element_property": True, }, ) contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contentType", title="Extension field for ``contentType``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Tracking/reporting operation description", description=( "The description would be used by test engines for tracking and " "reporting purposes." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) destination: fhirtypes.IntegerType | None = Field( default=None, alias="destination", title="Server responding to the request", description=( "The server where the request message is destined for. Must be one of " "the server numbers listed in TestScript.destination section." ), json_schema_extra={ "element_property": True, }, ) destination__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_destination", title="Extension field for ``destination``." ) encodeRequestUrl: bool | None = Field( default=None, alias="encodeRequestUrl", title="Whether or not to send the request url in encoded format", description=( "Whether or not to implicitly send the request url in encoded format. " "The default is true to match the standard RESTful client behavior. Set" " to false when communicating with a server that does not support " "encoded url paths." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) encodeRequestUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_encodeRequestUrl", title="Extension field for ``encodeRequestUrl``.", ) label: fhirtypes.StringType | None = Field( default=None, alias="label", title="Tracking/logging operation label", description="The label would be used for tracking/logging purposes by test engines.", json_schema_extra={ "element_property": True, }, ) label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_label", title="Extension field for ``label``." ) method: fhirtypes.CodeType | None = Field( default=None, alias="method", title="delete | get | options | patch | post | put | head", description=( "The HTTP method the test engine MUST use for this operation regardless" " of any other operation details." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["delete", "get", "options", "patch", "post", "put", "head"], }, ) method__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_method", title="Extension field for ``method``." ) origin: fhirtypes.IntegerType | None = Field( default=None, alias="origin", title="Server initiating the request", description=( "The server where the request message originates from. Must be one of " "the server numbers listed in TestScript.origin section." ), json_schema_extra={ "element_property": True, }, ) origin__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_origin", title="Extension field for ``origin``." ) params: fhirtypes.StringType | None = Field( default=None, alias="params", title="Explicitly defined path parameters", description=( "Path plus parameters after [type]. Used to set parts of the request " "URL explicitly." ), json_schema_extra={ "element_property": True, }, ) params__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_params", title="Extension field for ``params``." ) requestHeader: typing.List[ fhirtypes.TestScriptSetupActionOperationRequestHeaderType ] | None = Field( default=None, alias="requestHeader", title="Each operation can have one or more header elements", description="Header elements would be used to set HTTP headers.", json_schema_extra={ "element_property": True, }, ) requestId: fhirtypes.IdType | None = Field( default=None, alias="requestId", title="Fixture Id of mapped request", description="The fixture id (maybe new) to map to the request.", json_schema_extra={ "element_property": True, }, ) requestId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requestId", title="Extension field for ``requestId``." ) resource: fhirtypes.CodeType | None = Field( default=None, alias="resource", title="Resource type", description=( "The type of the resource. See " "http://build.fhir.org/resourcelist.html." ), json_schema_extra={ "element_property": True, }, ) resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resource", title="Extension field for ``resource``." ) responseId: fhirtypes.IdType | None = Field( default=None, alias="responseId", title="Fixture Id of mapped response", description="The fixture id (maybe new) to map to the response.", json_schema_extra={ "element_property": True, }, ) responseId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_responseId", title="Extension field for ``responseId``." ) sourceId: fhirtypes.IdType | None = Field( default=None, alias="sourceId", title="Fixture Id of body for PUT and POST requests", description="The id of the fixture used as the body of a PUT or POST request.", json_schema_extra={ "element_property": True, }, ) sourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceId", title="Extension field for ``sourceId``." ) targetId: fhirtypes.IdType | None = Field( default=None, alias="targetId", title=( "Id of fixture used for extracting the [id], [type], and [vid] for GET" " requests" ), description=None, json_schema_extra={ "element_property": True, }, ) targetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_targetId", title="Extension field for ``targetId``." ) type: fhirtypes.CodingType | None = Field( default=None, alias="type", title="The operation code type that will be executed", description="Server interaction or operation type.", json_schema_extra={ "element_property": True, }, ) url: fhirtypes.StringType | None = Field( default=None, alias="url", title="Request URL", description="Complete request URL.", json_schema_extra={ "element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptSetupActionOperation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "resource", "label", "description", "accept", "contentType", "destination", "encodeRequestUrl", "method", "origin", "params", "requestHeader", "requestId", "responseId", "sourceId", "targetId", "url", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionOperation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("encodeRequestUrl", "encodeRequestUrl__ext")] return required_fields class TestScriptSetupActionOperationRequestHeader(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Each operation can have one or more header elements. Header elements would be used to set HTTP headers. """ __resource_type__ = "TestScriptSetupActionOperationRequestHeader" field: fhirtypes.StringType | None = Field( default=None, alias="field", title="HTTP header field name", description='The HTTP header field e.g. "Accept".', json_schema_extra={ "element_property": True, "element_required": True, }, ) field__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_field", title="Extension field for ``field``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="HTTP headerfield value", description='The value of the header e.g. "application/fhir+xml".', json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptSetupActionOperationRequestHeader`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "field", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionOperationRequestHeader`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("field", "field__ext"), ("value", "value__ext")] return required_fields class TestScriptTeardown(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A series of required clean up steps. A series of operations required to clean up after all the tests are executed (successfully or otherwise). """ __resource_type__ = "TestScriptTeardown" action: typing.List[fhirtypes.TestScriptTeardownActionType] = Field( default=..., alias="action", title="One or more teardown operations to perform", description="The teardown action will only contain an operation.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptTeardown`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "action"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptTeardown`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptTeardownAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. One or more teardown operations to perform. The teardown action will only contain an operation. """ __resource_type__ = "TestScriptTeardownAction" operation: fhirtypes.TestScriptSetupActionOperationType = Field( default=..., alias="operation", title="The teardown operation to perform", description="An operation would involve a REST request to a server.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptTeardownAction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "operation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptTeardownAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptTest(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A test in this script. """ __resource_type__ = "TestScriptTest" action: typing.List[fhirtypes.TestScriptTestActionType] = Field( default=..., alias="action", title="A test operation or assert to perform", description="Action would contain either an operation or an assertion.", json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Tracking/reporting short description of the test", description=( "A short description of the test used by test engines for tracking and " "reporting purposes." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Tracking/logging name of this test", description=( "The name of this test used for tracking/logging purposes by test " "engines." ), json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptTest`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "description", "action"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptTest`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptTestAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A test operation or assert to perform. Action would contain either an operation or an assertion. """ __resource_type__ = "TestScriptTestAction" assert_fhir: fhirtypes.TestScriptSetupActionAssertType | None = Field( default=None, alias="assert", title="The setup assertion to perform", description=( "Evaluates the results of previous operations to determine if the " "server under test behaves appropriately." ), json_schema_extra={ "element_property": True, }, ) operation: fhirtypes.TestScriptSetupActionOperationType | None = Field( default=None, alias="operation", title="The setup operation to perform", description="An operation would involve a REST request to a server.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptTestAction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "operation", "assert"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptTestAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptVariable(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Placeholder for evaluated elements. Variable is set based either on element value in response body or on header field value in the response headers. """ __resource_type__ = "TestScriptVariable" defaultValue: fhirtypes.StringType | None = Field( default=None, alias="defaultValue", title="Default, hard-coded, or user-defined value for this variable", description="A default, hard-coded, or user-defined value for this variable.", json_schema_extra={ "element_property": True, }, ) defaultValue__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValue", title="Extension field for ``defaultValue``.", ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Natural language description of the variable", description=( "A free text natural language description of the variable and its " "purpose." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="The FHIRPath expression against the fixture body", description=( "The FHIRPath expression to evaluate against the fixture body. When " "variables are defined, only one of either expression, headerField or " "path must be specified." ), json_schema_extra={ "element_property": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) headerField: fhirtypes.StringType | None = Field( default=None, alias="headerField", title="HTTP header field name for source", description=( "Will be used to grab the HTTP header field value from the headers that" " sourceId is pointing to." ), json_schema_extra={ "element_property": True, }, ) headerField__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_headerField", title="Extension field for ``headerField``." ) hint: fhirtypes.StringType | None = Field( default=None, alias="hint", title="Hint help text for default value to enter", description=( "Displayable text string with hint help information to the user when " "entering a default value." ), json_schema_extra={ "element_property": True, }, ) hint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_hint", title="Extension field for ``hint``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Descriptive name for this variable", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="XPath or JSONPath against the fixture body", description=( "XPath or JSONPath to evaluate against the fixture body. When " "variables are defined, only one of either expression, headerField or " "path must be specified." ), json_schema_extra={ "element_property": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) sourceId: fhirtypes.IdType | None = Field( default=None, alias="sourceId", title="Fixture Id of source expression or headerField within this variable", description=( "Fixture to evaluate the XPath/JSONPath expression or the headerField " "against within this variable." ), json_schema_extra={ "element_property": True, }, ) sourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceId", title="Extension field for ``sourceId``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptVariable`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "defaultValue", "description", "expression", "headerField", "hint", "path", "sourceId", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptVariable`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields ================================================ FILE: fhir/resources/R4B/timing.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Timing Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, element, fhirtypes class Timing(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A timing schedule that specifies an event that may occur multiple times. Specifies an event that may occur multiple times. Timing schedules are used to record when things are planned, expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds, and may be used for reporting the schedule to which past regular activities were carried out. """ __resource_type__ = "Timing" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="BID | TID | QID | AM | PM | QD | QOD | +", description=( "A code for the timing schedule (or just text in code.text). Some codes" " such as BID are ubiquitous, but many institutions define their own " "additional codes. If a code is provided, the code is understood to be " "a complete statement of whatever is specified in the structured timing" " data, and either the code or the data may be used to interpret the " "Timing, with the exception that .repeat.bounds still applies over the " "code (and is not contained in the code)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) event: typing.List[fhirtypes.DateTimeType | None] | None = Field( default=None, alias="event", title="When the event occurs", description="Identifies specific times when the event occurs.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) event__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_event", title="Extension field for ``event``." ) repeat: fhirtypes.TimingRepeatType | None = Field( default=None, alias="repeat", title="When the event is to occur", description="A set of rules that describe when the event is scheduled.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Timing`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "event", "repeat", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Timing`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "event", "repeat", "code"] class TimingRepeat(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. When the event is to occur. A set of rules that describe when the event is scheduled. """ __resource_type__ = "TimingRepeat" boundsDuration: fhirtypes.DurationType | None = Field( default=None, alias="boundsDuration", title="Length/Range of lengths, or (Start and/or end) limits", description=( "Either a duration for the length of the timing schedule, a range of " "possible length, or outer bounds for start and/or end limits of the " "timing schedule." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e bounds[x] "one_of_many": "bounds", "one_of_many_required": False, }, ) boundsPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="boundsPeriod", title="Length/Range of lengths, or (Start and/or end) limits", description=( "Either a duration for the length of the timing schedule, a range of " "possible length, or outer bounds for start and/or end limits of the " "timing schedule." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e bounds[x] "one_of_many": "bounds", "one_of_many_required": False, }, ) boundsRange: fhirtypes.RangeType | None = Field( default=None, alias="boundsRange", title="Length/Range of lengths, or (Start and/or end) limits", description=( "Either a duration for the length of the timing schedule, a range of " "possible length, or outer bounds for start and/or end limits of the " "timing schedule." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e bounds[x] "one_of_many": "bounds", "one_of_many_required": False, }, ) count: fhirtypes.PositiveIntType | None = Field( default=None, alias="count", title="Number of times to repeat", description=( "A total count of the desired number of repetitions across the duration" " of the entire timing specification. If countMax is present, this " "element indicates the lower bound of the allowed range of count " "values." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_count", title="Extension field for ``count``." ) countMax: fhirtypes.PositiveIntType | None = Field( default=None, alias="countMax", title="Maximum number of times to repeat", description=( "If present, indicates that the count is a range - so to perform the " "action between [count] and [countMax] times." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) countMax__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_countMax", title="Extension field for ``countMax``." ) dayOfWeek: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="dayOfWeek", title="mon | tue | wed | thu | fri | sat | sun", description=( "If one or more days of week is provided, then the action happens only " "on the specified day(s)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], }, ) dayOfWeek__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_dayOfWeek", title="Extension field for ``dayOfWeek``." ) duration: fhirtypes.DecimalType | None = Field( default=None, alias="duration", title="How long when it happens", description=( "How long this thing happens for when it happens. If durationMax is " "present, this element indicates the lower bound of the allowed range " "of the duration." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) duration__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_duration", title="Extension field for ``duration``." ) durationMax: fhirtypes.DecimalType | None = Field( default=None, alias="durationMax", title="How long when it happens (Max)", description=( "If present, indicates that the duration is a range - so to perform the" " action between [duration] and [durationMax] time length." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) durationMax__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_durationMax", title="Extension field for ``durationMax``." ) durationUnit: fhirtypes.CodeType | None = Field( default=None, alias="durationUnit", title="s | min | h | d | wk | mo | a - unit of time (UCUM)", description="The units of time for the duration, in UCUM units.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["s", "min", "h", "d", "wk", "mo", "a"], }, ) durationUnit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_durationUnit", title="Extension field for ``durationUnit``.", ) frequency: fhirtypes.PositiveIntType | None = Field( default=None, alias="frequency", title="Event occurs frequency times per period", description=( "The number of times to repeat the action within the specified period. " "If frequencyMax is present, this element indicates the lower bound of " "the allowed range of the frequency." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) frequency__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_frequency", title="Extension field for ``frequency``." ) frequencyMax: fhirtypes.PositiveIntType | None = Field( default=None, alias="frequencyMax", title="Event occurs up to frequencyMax times per period", description=( "If present, indicates that the frequency is a range - so to repeat " "between [frequency] and [frequencyMax] times within the period or " "period range." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) frequencyMax__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_frequencyMax", title="Extension field for ``frequencyMax``.", ) offset: fhirtypes.UnsignedIntType | None = Field( default=None, alias="offset", title="Minutes from event (before or after)", description=( "The number of minutes from the event. If the event code does not " "indicate whether the minutes is before or after the event, then the " "offset is assumed to be after the event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) offset__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_offset", title="Extension field for ``offset``." ) period: fhirtypes.DecimalType | None = Field( default=None, alias="period", title="Event occurs frequency times per period", description=( "Indicates the duration of time over which repetitions are to occur; " 'e.g. to express "3 times per day", 3 would be the frequency and "1 ' 'day" would be the period. If periodMax is present, this element ' "indicates the lower bound of the allowed range of the period length." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) period__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_period", title="Extension field for ``period``." ) periodMax: fhirtypes.DecimalType | None = Field( default=None, alias="periodMax", title="Upper limit of period (3-4 hours)", description=( "If present, indicates that the period is a range from [period] to " '[periodMax], allowing expressing concepts such as "do this once every ' "3-5 days." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) periodMax__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_periodMax", title="Extension field for ``periodMax``." ) periodUnit: fhirtypes.CodeType | None = Field( default=None, alias="periodUnit", title="s | min | h | d | wk | mo | a - unit of time (UCUM)", description="The units of time for the period in UCUM units.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["s", "min", "h", "d", "wk", "mo", "a"], }, ) periodUnit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_periodUnit", title="Extension field for ``periodUnit``." ) timeOfDay: typing.List[fhirtypes.TimeType | None] | None = Field( default=None, alias="timeOfDay", title="Time of day for action", description="Specified time of day for action to take place.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) timeOfDay__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_timeOfDay", title="Extension field for ``timeOfDay``." ) when: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="when", title="Code for time period of occurrence", description=( "An approximate time period during the day, potentially linked to an " "event of daily living that indicates when the action should occur." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) when__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_when", title="Extension field for ``when``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TimingRepeat`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "boundsDuration", "boundsRange", "boundsPeriod", "count", "countMax", "duration", "durationMax", "durationUnit", "frequency", "frequencyMax", "period", "periodMax", "periodUnit", "dayOfWeek", "timeOfDay", "when", "offset", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TimingRepeat`` according to specification, with preserving the original sequence order. """ return [ "boundsDuration", "boundsRange", "boundsPeriod", "count", "countMax", "duration", "durationMax", "durationUnit", "frequency", "frequencyMax", "period", "periodMax", "periodUnit", "dayOfWeek", "timeOfDay", "when", "offset", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "bounds": ["boundsDuration", "boundsPeriod", "boundsRange"] } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/triggerdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/TriggerDefinition Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class TriggerDefinition(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Defines an expected trigger for a module. A description of a triggering event. Triggering events can be named events, data events, or periodic, as determined by the type element. """ __resource_type__ = "TriggerDefinition" condition: fhirtypes.ExpressionType | None = Field( default=None, alias="condition", title="Whether the event triggers (boolean expression)", description=( "A boolean-valued expression that is evaluated in the context of the " "container of the trigger definition and returns whether or not the " "trigger fires." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) data: typing.List[fhirtypes.DataRequirementType] | None = Field( default=None, alias="data", title="Triggering data of the event (multiple = 'and')", description=( "The triggering data of the event (if this is a data trigger). If more " "than one data is requirement is specified, then all the data " "requirements must be true." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name or URI that identifies the event", description=( "A formal name for the event. This may be an absolute URI that " "identifies the event formally (e.g. from a trigger registry), or a " "simple relative URI that identifies the event in a local context." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) timingDate: fhirtypes.DateType | None = Field( default=None, alias="timingDate", title="Timing of the event", description="The timing of the event (if this is a periodic trigger).", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timingDate", title="Extension field for ``timingDate``." ) timingDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="timingDateTime", title="Timing of the event", description="The timing of the event (if this is a periodic trigger).", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timingDateTime", title="Extension field for ``timingDateTime``.", ) timingReference: fhirtypes.ReferenceType | None = Field( default=None, alias="timingReference", title="Timing of the event", description="The timing of the event (if this is a periodic trigger).", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Schedule"], }, ) timingTiming: fhirtypes.TimingType | None = Field( default=None, alias="timingTiming", title="Timing of the event", description="The timing of the event (if this is a periodic trigger).", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "named-event | periodic | data-changed | data-added | data-modified | " "data-removed | data-accessed | data-access-ended" ), description="The type of triggering event.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "named-event", "periodic", "data-changed", "data-added", "data-modified", "data-removed", "data-accessed", "data-access-ended", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TriggerDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "type", "name", "timingTiming", "timingReference", "timingDate", "timingDateTime", "data", "condition", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TriggerDefinition`` according to specification, with preserving the original sequence order. """ return [ "type", "name", "timingTiming", "timingReference", "timingDate", "timingDateTime", "data", "condition", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "timing": [ "timingDate", "timingDateTime", "timingReference", "timingTiming", ] } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/usagecontext.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/UsageContext Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class UsageContext(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Describes the context of use for a conformance or knowledge resource. Specifies clinical/business/etc. metadata that can be used to retrieve, index and/or categorize an artifact. This metadata can either be specific to the applicable population (e.g., age category, DRG) or the specific context of care (e.g., venue, care setting, provider of care). """ __resource_type__ = "UsageContext" code: fhirtypes.CodingType = Field( default=..., alias="code", title="Type of context being specified", description=( "A code that identifies the type of context being specified by this " "usage context." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Value that defines the context", description=( "A value that defines the context specified in this context of use. The" " interpretation of the value is defined by the code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Value that defines the context", description=( "A value that defines the context specified in this context of use. The" " interpretation of the value is defined by the code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Value that defines the context", description=( "A value that defines the context specified in this context of use. The" " interpretation of the value is defined by the code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Value that defines the context", description=( "A value that defines the context specified in this context of use. The" " interpretation of the value is defined by the code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "PlanDefinition", "ResearchStudy", "InsurancePlan", "HealthcareService", "Group", "Location", "Organization", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``UsageContext`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "code", "valueCodeableConcept", "valueQuantity", "valueRange", "valueReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``UsageContext`` according to specification, with preserving the original sequence order. """ return [ "code", "valueCodeableConcept", "valueQuantity", "valueRange", "valueReference", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueCodeableConcept", "valueQuantity", "valueRange", "valueReference", ] } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/valueset.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ValueSet Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ValueSet(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A set of codes drawn from one or more code systems. A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [CodeSystem](codesystem.html) definitions and their use in [coded elements](terminologies.html). """ __resource_type__ = "ValueSet" compose: fhirtypes.ValueSetComposeType | None = Field( default=None, alias="compose", title="Content logical definition of the value set (CLD)", description=( "A set of criteria that define the contents of the value set by " "including or excluding codes selected from the specified code " "system(s) that the value set draws from. This is also known as the " "Content Logical Definition (CLD)." ), json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the value set and/or its contents. " "Copyright statements are generally legal restrictions on the use and " "publishing of the value set." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the value set was created or " "revised (e.g. the 'content logical definition')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the value set", description=( "A free text natural language description of the value set from a " "consumer's perspective. The textual description specifies the span of " "meanings for concepts to be included within the Value Set Expansion, " "and also may specify the intended use and limitations of the Value " "Set." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) expansion: fhirtypes.ValueSetExpansionType | None = Field( default=None, alias="expansion", title='Used when the value set is "expanded"', description=( 'A value set can also be "expanded", where the value set is turned into' " a simple collection of enumerated codes. This element holds the " "expansion, if it has been performed." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this value set is authored for " "testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the value set (business identifier)", description=( "A formal identifier that is used to identify this value set when it is" " represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) immutable: bool | None = Field( default=None, alias="immutable", title=( "Indicates whether or not any change to the content logical definition " "may occur" ), description=( "If this is set to 'true', then no new versions of the content logical " "definition can be created. Note: Other metadata might still change." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) immutable__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_immutable", title="Extension field for ``immutable``." ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for value set (if applicable)", description=( "A legal or geographic region in which the value set is intended to be " "used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this value set (computer friendly)", description=( "A natural language name identifying the value set. This name should be" " usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the organization or individual that published the value " "set." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this value set is defined", description=( "Explanation of why this value set is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this value set. Enables tracking the life-cycle of the " "content. The status of the value set applies to the value set " "definition (ValueSet.compose) and the associated ValueSet metadata. " "Expansions do not have a state." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this value set (human friendly)", description="A short, descriptive, user-friendly title for the value set.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this value set, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this value set when it is " "referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which at which an authoritative " "instance of this value set is (or will be) published. This URL can be " "the target of a canonical reference. It SHALL remain the same when the" " value set is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate value set instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the value set", description=( "The identifier that is used to identify this version of the value set " "when it is referenced in a specification, model, design or instance. " "This is an arbitrary value managed by the value set author and is not " "expected to be globally unique. For example, it might be a timestamp " "(e.g. yyyymmdd) if a managed version is not available. There is also " "no expectation that versions can be placed in a lexicographical " "sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSet`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "immutable", "purpose", "copyright", "compose", "expansion", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSet`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "immutable", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class ValueSetCompose(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Content logical definition of the value set (CLD). A set of criteria that define the contents of the value set by including or excluding codes selected from the specified code system(s) that the value set draws from. This is also known as the Content Logical Definition (CLD). """ __resource_type__ = "ValueSetCompose" exclude: typing.List[fhirtypes.ValueSetComposeIncludeType] | None = Field( default=None, alias="exclude", title="Explicitly exclude codes from a code system or other value sets", description=( "Exclude one or more codes from the value set based on code system " "filters and/or other value sets." ), json_schema_extra={ "element_property": True, }, ) inactive: bool | None = Field( default=None, alias="inactive", title="Whether inactive codes are in the value set", description=( "Whether inactive codes - codes that are not approved for current use -" " are in the value set. If inactive = true, inactive codes are to be " "included in the expansion, if inactive = false, the inactive codes " "will not be included in the expansion. If absent, the behavior is " "determined by the implementation, or by the applicable $expand " "parameters (but generally, inactive codes would be expected to be " "included)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) inactive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_inactive", title="Extension field for ``inactive``." ) include: typing.List[fhirtypes.ValueSetComposeIncludeType] = Field( default=..., alias="include", title="Include one or more codes from a code system or other value set(s)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lockedDate: fhirtypes.DateType | None = Field( default=None, alias="lockedDate", title="Fixed date for references with no specified version (transitive)", description=( "The Locked Date is the effective date that is used to determine the " "version of all referenced Code Systems and Value Set Definitions " "included in the compose that are not already tied to a specific " "version." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lockedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lockedDate", title="Extension field for ``lockedDate``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetCompose`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "lockedDate", "inactive", "include", "exclude", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetCompose`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "lockedDate", "inactive", "include"] class ValueSetComposeInclude(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Include one or more codes from a code system or other value set(s). """ __resource_type__ = "ValueSetComposeInclude" concept: typing.List[fhirtypes.ValueSetComposeIncludeConceptType] | None = Field( default=None, alias="concept", title="A concept defined in the system", description="Specifies a concept to be included or excluded.", json_schema_extra={ "element_property": True, }, ) filter: typing.List[fhirtypes.ValueSetComposeIncludeFilterType] | None = Field( default=None, alias="filter", title="Select codes/concepts by their properties (including relationships)", description=( "Select concepts by specify a matching criterion based on the " "properties (including relationships) defined by the system, or on " "filters defined by the system. If multiple filters are specified, they" " SHALL all be true." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) system: fhirtypes.UriType | None = Field( default=None, alias="system", title="The system the codes come from", description=( "An absolute URI which is the code system from which the selected codes" " come from." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) valueSet: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="valueSet", title="Select the contents included in this value set", description=( "Selects the concepts found in this value set (based on its value set " "definition). This is an absolute URI that is a reference to " "ValueSet.url. If multiple value sets are specified this includes the " "union of the contents of all of the referenced value sets." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) valueSet__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_valueSet", title="Extension field for ``valueSet``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Specific version of the code system referred to", description=( "The version of the code system that the codes are selected from, or " "the special version '*' for all versions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetComposeInclude`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "system", "version", "concept", "filter", "valueSet", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetComposeInclude`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "system", "version", "filter", "valueSet"] class ValueSetComposeIncludeConcept(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A concept defined in the system. Specifies a concept to be included or excluded. """ __resource_type__ = "ValueSetComposeIncludeConcept" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Code or expression from system", description="Specifies a code for the concept to be included or excluded.", json_schema_extra={ "element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) designation: typing.List[ fhirtypes.ValueSetComposeIncludeConceptDesignationType ] | None = Field( default=None, alias="designation", title="Additional representations for this concept", description=( "Additional representations for this concept when used in this value " "set - other languages, aliases, specialized purposes, used for " "particular purposes, etc." ), json_schema_extra={ "element_property": True, }, ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Text to display for this code for this value set in this valueset", description=( "The text to display to the user for this concept in the context of " "this valueset. If no display is provided, then applications using the " "value set use the display specified for the code by the system." ), json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetComposeIncludeConcept`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "display", "designation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetComposeIncludeConcept`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields class ValueSetComposeIncludeConceptDesignation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional representations for this concept. Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc. """ __resource_type__ = "ValueSetComposeIncludeConceptDesignation" language: fhirtypes.CodeType | None = Field( default=None, alias="language", title="Human language of the designation", description="The language this designation is defined for.", json_schema_extra={ "element_property": True, }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) use: fhirtypes.CodingType | None = Field( default=None, alias="use", title="Types of uses of designations", description="A code that represents types of uses of designations.", json_schema_extra={ "element_property": True, }, ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The text value for this designation", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetComposeIncludeConceptDesignation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "language", "use", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetComposeIncludeConceptDesignation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("value", "value__ext")] return required_fields class ValueSetComposeIncludeFilter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Select codes/concepts by their properties (including relationships). Select concepts by specify a matching criterion based on the properties (including relationships) defined by the system, or on filters defined by the system. If multiple filters are specified, they SHALL all be true. """ __resource_type__ = "ValueSetComposeIncludeFilter" op: fhirtypes.CodeType | None = Field( default=None, alias="op", title=( "= | is-a | descendent-of | is-not-a | regex | in | not-in | " "generalizes | exists" ), description="The kind of operation to perform as a part of the filter criteria.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "=", "is-a", "descendent-of", "is-not-a", "regex", "in", "not-in", "generalizes", "exists", ], }, ) op__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_op", title="Extension field for ``op``." ) property: fhirtypes.CodeType | None = Field( default=None, alias="property", title="A property/filter defined by the code system", description=( "A code that identifies a property or a filter defined in the code " "system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) property__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_property", title="Extension field for ``property``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="Code from the system, or regex criteria, or boolean value for exists", description=( "The match value may be either a code defined by the system, or a " "string value, which is a regex match on the literal string of the " "property value (if the filter represents a property defined in " "CodeSystem) or of the system filter value (if the filter represents a " "filter defined in CodeSystem) when the operation is 'regex', or one of" " the values (true and false), when the operation is 'exists'." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetComposeIncludeFilter`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "property", "op", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetComposeIncludeFilter`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "property", "op", "value"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("op", "op__ext"), ("property", "property__ext"), ("value", "value__ext"), ] return required_fields class ValueSetExpansion(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Used when the value set is "expanded". A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed. """ __resource_type__ = "ValueSetExpansion" contains: typing.List[fhirtypes.ValueSetExpansionContainsType] | None = Field( default=None, alias="contains", title="Codes in the value set", description="The codes that are contained in the value set expansion.", json_schema_extra={ "element_property": True, }, ) identifier: fhirtypes.UriType | None = Field( default=None, alias="identifier", title="Identifies the value set expansion (business identifier)", description=( "An identifier that uniquely identifies this expansion of the valueset," " based on a unique combination of the provided parameters, the system " "default parameters, and the underlying system code system versions " "etc. Systems may re-use the same identifier as long as those factors " "remain the same, and the expansion is the same, but are not required " "to do so. This is a business identifier." ), json_schema_extra={ "element_property": True, }, ) identifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_identifier", title="Extension field for ``identifier``." ) offset: fhirtypes.IntegerType | None = Field( default=None, alias="offset", title="Offset at which this resource starts", description=( "If paging is being used, the offset at which this resource starts. " "I.e. this resource is a partial view into the expansion. If paging is " "not being used, this element SHALL NOT be present." ), json_schema_extra={ "element_property": True, }, ) offset__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_offset", title="Extension field for ``offset``." ) parameter: typing.List[fhirtypes.ValueSetExpansionParameterType] | None = Field( default=None, alias="parameter", title="Parameter that controlled the expansion process", description=( "A parameter that controlled the expansion process. These parameters " "may be used by users of expanded value sets to check whether the " "expansion is suitable for a particular purpose, or to pick the correct" " expansion." ), json_schema_extra={ "element_property": True, }, ) timestamp: fhirtypes.DateTimeType | None = Field( default=None, alias="timestamp", title="Time ValueSet expansion happened", description="The time at which the expansion was produced by the expanding system.", json_schema_extra={ "element_property": True, "element_required": True, }, ) timestamp__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timestamp", title="Extension field for ``timestamp``." ) total: fhirtypes.IntegerType | None = Field( default=None, alias="total", title="Total number of codes in the expansion", description=( "The total number of concepts in the expansion. If the number of " "concept nodes in this resource is less than the stated number, then " "the server can return more using the offset parameter." ), json_schema_extra={ "element_property": True, }, ) total__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_total", title="Extension field for ``total``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetExpansion`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "timestamp", "total", "offset", "parameter", "contains", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetExpansion`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("timestamp", "timestamp__ext")] return required_fields class ValueSetExpansionContains(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Codes in the value set. The codes that are contained in the value set expansion. """ __resource_type__ = "ValueSetExpansionContains" abstract: bool | None = Field( default=None, alias="abstract", title="If user cannot select this entry", description=( "If true, this entry is included in the expansion for navigational " "purposes, and the user cannot select the code directly as a proper " "value." ), json_schema_extra={ "element_property": True, }, ) abstract__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_abstract", title="Extension field for ``abstract``." ) code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Code - if blank, this is not a selectable code", description=( "The code for this item in the expansion hierarchy. If this code is " "missing the entry in the hierarchy is a place holder (abstract) and " "does not represent a valid code in the value set." ), json_schema_extra={ "element_property": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) contains: typing.List[fhirtypes.ValueSetExpansionContainsType] | None = Field( default=None, alias="contains", title="Codes contained under this entry", description="Other codes and entries contained under this entry in the hierarchy.", json_schema_extra={ "element_property": True, }, ) designation: typing.List[ fhirtypes.ValueSetComposeIncludeConceptDesignationType ] | None = Field( default=None, alias="designation", title="Additional representations for this item", description=( "Additional representations for this item - other languages, aliases, " "specialized purposes, used for particular purposes, etc. These are " "relevant when the conditions of the expansion do not fix to a single " "correct representation." ), json_schema_extra={ "element_property": True, }, ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="User display for the concept", description="The recommended display for this item in the expansion.", json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) inactive: bool | None = Field( default=None, alias="inactive", title="If concept is inactive in the code system", description=( "If the concept is inactive in the code system that defines it. " "Inactive codes are those that are no longer to be used, but are " "maintained by the code system for understanding legacy data. It might " "not be known or specified whether an concept is inactive (and it may " "depend on the context of use)." ), json_schema_extra={ "element_property": True, }, ) inactive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_inactive", title="Extension field for ``inactive``." ) system: fhirtypes.UriType | None = Field( default=None, alias="system", title="System value for the code", description=( "An absolute URI which is the code system in which the code for this " "item in the expansion is defined." ), json_schema_extra={ "element_property": True, }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Version in which this code/display is defined", description=( "The version of the code system from this code was taken. Note that a " "well-maintained code system does not need the version reported, " "because the meaning of codes is consistent across versions. However " "this cannot consistently be assured, and when the meaning is not " "guaranteed to be consistent, the version SHOULD be exchanged." ), json_schema_extra={ "element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetExpansionContains`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "system", "abstract", "inactive", "version", "code", "display", "designation", "contains", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetExpansionContains`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ValueSetExpansionParameter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Parameter that controlled the expansion process. A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion. """ __resource_type__ = "ValueSetExpansionParameter" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name as assigned by the client or server", description=( "Name of the input parameter to the $expand operation; may be a server-" "assigned name for additional default or other server-supplied " "parameters used to control the expansion process." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value of the named parameter", description="The value of the parameter.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="Value of the named parameter", description="The value of the parameter.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Value of the named parameter", description="The value of the parameter.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Value of the named parameter", description="The value of the parameter.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Value of the named parameter", description="The value of the parameter.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Value of the named parameter", description="The value of the parameter.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="Value of the named parameter", description="The value of the parameter.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetExpansionParameter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "valueString", "valueBoolean", "valueInteger", "valueDecimal", "valueUri", "valueCode", "valueDateTime", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetExpansionParameter`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueCode", "valueDateTime", "valueDecimal", "valueInteger", "valueString", "valueUri", ] } return one_of_many_fields ================================================ FILE: fhir/resources/R4B/verificationresult.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/VerificationResult Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class VerificationResult(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Describes validation requirements, source(s), status and dates for one or more elements. """ __resource_type__ = "VerificationResult" attestation: fhirtypes.VerificationResultAttestationType | None = Field( default=None, alias="attestation", title="Information about the entity attesting to information", description=None, json_schema_extra={ "element_property": True, }, ) failureAction: fhirtypes.CodeableConceptType | None = Field( default=None, alias="failureAction", title="fatal | warn | rec-only | none", description="The result if validation fails (fatal; warning; record only; none).", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) frequency: fhirtypes.TimingType | None = Field( default=None, alias="frequency", title="Frequency of revalidation", description=None, json_schema_extra={ "element_property": True, }, ) lastPerformed: fhirtypes.DateTimeType | None = Field( default=None, alias="lastPerformed", title=( "The date/time validation was last completed (including failed " "validations)" ), description=None, json_schema_extra={ "element_property": True, }, ) lastPerformed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastPerformed", title="Extension field for ``lastPerformed``.", ) need: fhirtypes.CodeableConceptType | None = Field( default=None, alias="need", title="none | initial | periodic", description=( "The frequency with which the target must be validated (none; initial; " "periodic)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) nextScheduled: fhirtypes.DateType | None = Field( default=None, alias="nextScheduled", title="The date when target is next validated, if appropriate", description=None, json_schema_extra={ "element_property": True, }, ) nextScheduled__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_nextScheduled", title="Extension field for ``nextScheduled``.", ) primarySource: typing.List[ fhirtypes.VerificationResultPrimarySourceType ] | None = Field( default=None, alias="primarySource", title="Information about the primary source(s) involved in validation", description=None, json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "attested | validated | in-process | req-revalid | val-fail | reval-" "fail" ), description=( "The validation status of the target (attested; validated; in process; " "requires revalidation; validation failed; revalidation failed)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "attested", "validated", "in-process", "req-revalid", "val-fail", "reval-fail", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusDate: fhirtypes.DateTimeType | None = Field( default=None, alias="statusDate", title="When the validation status was updated", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_statusDate", title="Extension field for ``statusDate``." ) target: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="target", title="A resource that was validated", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) targetLocation: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="targetLocation", title="The fhirpath location(s) within the resource that was validated", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) targetLocation__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_targetLocation", title="Extension field for ``targetLocation``.", ) validationProcess: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="validationProcess", title=( "The primary process by which the target is validated (edit check; " "value set; primary source; multiple sources; standalone; in context)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) validationType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="validationType", title="nothing | primary | multiple", description=( "What the target is validated against (nothing; primary source; " "multiple sources)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) validator: typing.List[fhirtypes.VerificationResultValidatorType] | None = Field( default=None, alias="validator", title="Information about the entity validating information", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``VerificationResult`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "target", "targetLocation", "need", "status", "statusDate", "validationType", "validationProcess", "frequency", "lastPerformed", "nextScheduled", "failureAction", "primarySource", "attestation", "validator", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``VerificationResult`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "target", "targetLocation", "need", "status", "statusDate", "validationType", "validationProcess", "failureAction", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class VerificationResultAttestation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about the entity attesting to information. """ __resource_type__ = "VerificationResultAttestation" communicationMethod: fhirtypes.CodeableConceptType | None = Field( default=None, alias="communicationMethod", title="The method by which attested information was submitted/retrieved", description=( "The method by which attested information was submitted/retrieved " "(manual; API; Push)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateType | None = Field( default=None, alias="date", title="The date the information was attested to", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) onBehalfOf: fhirtypes.ReferenceType | None = Field( default=None, alias="onBehalfOf", title=( "When the who is asserting on behalf of another (organization or " "individual)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Organization", "Practitioner", "PractitionerRole", ], }, ) proxyIdentityCertificate: fhirtypes.StringType | None = Field( default=None, alias="proxyIdentityCertificate", title=( "A digital identity certificate associated with the proxy entity " "submitting attested information on behalf of the attestation source" ), description=None, json_schema_extra={ "element_property": True, }, ) proxyIdentityCertificate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_proxyIdentityCertificate", title="Extension field for ``proxyIdentityCertificate``.", ) proxySignature: fhirtypes.SignatureType | None = Field( default=None, alias="proxySignature", title="Proxy signature", description=( "Signed assertion by the proxy entity indicating that they have the " "right to submit attested information on behalf of the attestation " "source." ), json_schema_extra={ "element_property": True, }, ) sourceIdentityCertificate: fhirtypes.StringType | None = Field( default=None, alias="sourceIdentityCertificate", title="A digital identity certificate associated with the attestation source", description=None, json_schema_extra={ "element_property": True, }, ) sourceIdentityCertificate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceIdentityCertificate", title="Extension field for ``sourceIdentityCertificate``.", ) sourceSignature: fhirtypes.SignatureType | None = Field( default=None, alias="sourceSignature", title="Attester signature", description=( "Signed assertion by the attestation source that they have attested to " "the information." ), json_schema_extra={ "element_property": True, }, ) who: fhirtypes.ReferenceType | None = Field( default=None, alias="who", title="The individual or organization attesting to information", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``VerificationResultAttestation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "who", "onBehalfOf", "communicationMethod", "date", "sourceIdentityCertificate", "proxyIdentityCertificate", "proxySignature", "sourceSignature", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``VerificationResultAttestation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "who", "onBehalfOf", "communicationMethod", "date"] class VerificationResultPrimarySource(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about the primary source(s) involved in validation. """ __resource_type__ = "VerificationResultPrimarySource" canPushUpdates: fhirtypes.CodeableConceptType | None = Field( default=None, alias="canPushUpdates", title="yes | no | undetermined", description=( "Ability of the primary source to push updates/alerts (yes; no; " "undetermined)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) communicationMethod: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="communicationMethod", title="Method for exchanging information with the primary source", description="Method for communicating with the primary source (manual; API; Push).", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) pushTypeAvailable: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="pushTypeAvailable", title="specific | any | source", description=( "Type of alerts/updates the primary source can send (specific requested" " changes; any changes; as defined by source)." ), json_schema_extra={ "element_property": True, }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title=( "Type of primary source (License Board; Primary Education; Continuing " "Education; Postal Service; Relationship owner; Registration Authority;" " legal source; issuing source; authoritative source)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) validationDate: fhirtypes.DateTimeType | None = Field( default=None, alias="validationDate", title="When the target was validated against the primary source", description=None, json_schema_extra={ "element_property": True, }, ) validationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_validationDate", title="Extension field for ``validationDate``.", ) validationStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="validationStatus", title="successful | failed | unknown", description=( "Status of the validation of the target against the primary source " "(successful; failed; unknown)." ), json_schema_extra={ "element_property": True, }, ) who: fhirtypes.ReferenceType | None = Field( default=None, alias="who", title="Reference to the primary source", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Organization", "Practitioner", "PractitionerRole", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``VerificationResultPrimarySource`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "who", "type", "communicationMethod", "validationStatus", "validationDate", "canPushUpdates", "pushTypeAvailable", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``VerificationResultPrimarySource`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "communicationMethod", "canPushUpdates"] class VerificationResultValidator(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about the entity validating information. """ __resource_type__ = "VerificationResultValidator" attestationSignature: fhirtypes.SignatureType | None = Field( default=None, alias="attestationSignature", title="Validator signature", description=( "Signed assertion by the validator that they have validated the " "information." ), json_schema_extra={ "element_property": True, }, ) identityCertificate: fhirtypes.StringType | None = Field( default=None, alias="identityCertificate", title="A digital identity certificate associated with the validator", description=None, json_schema_extra={ "element_property": True, }, ) identityCertificate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_identityCertificate", title="Extension field for ``identityCertificate``.", ) organization: fhirtypes.ReferenceType = Field( default=..., alias="organization", title="Reference to the organization validating information", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``VerificationResultValidator`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "organization", "identityCertificate", "attestationSignature", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``VerificationResultValidator`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/R4B/visionprescription.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/VisionPrescription Release: R4B Version: 4.3.0 Build ID: c475c22 Last updated: 2022-05-28T12:47:40.239+10:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class VisionPrescription(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Prescription for vision correction products for a patient. An authorization for the provision of glasses and/or contact lenses to a patient. """ __resource_type__ = "VisionPrescription" created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Response creation date", description="The date this resource was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) dateWritten: fhirtypes.DateTimeType | None = Field( default=None, alias="dateWritten", title="When prescription was authorized", description="The date (and perhaps time) when the prescription was written.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) dateWritten__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dateWritten", title="Extension field for ``dateWritten``." ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Created during encounter / admission / stay", description=( "A reference to a resource that identifies the particular occurrence of" " contact between patient and health care provider during which the " "prescription was issued." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for vision prescription", description="A unique identifier assigned to this vision prescription.", json_schema_extra={ "element_property": True, }, ) lensSpecification: typing.List[ fhirtypes.VisionPrescriptionLensSpecificationType ] = Field( default=..., alias="lensSpecification", title="Vision lens authorization", description=( "Contain the details of the individual lens specifications and serves " "as the authorization for the fullfillment by certified professionals." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Who prescription is for", description=( "A resource reference to the person to whom the vision prescription " "applies." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) prescriber: fhirtypes.ReferenceType = Field( default=..., alias="prescriber", title="Who authorized the vision prescription", description=( "The healthcare professional responsible for authorizing the " "prescription." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``VisionPrescription`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "created", "patient", "encounter", "dateWritten", "prescriber", "lensSpecification", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``VisionPrescription`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "status", "created", "patient", "dateWritten", "prescriber", "lensSpecification", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("created", "created__ext"), ("dateWritten", "dateWritten__ext"), ("status", "status__ext"), ] return required_fields class VisionPrescriptionLensSpecification(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Vision lens authorization. Contain the details of the individual lens specifications and serves as the authorization for the fullfillment by certified professionals. """ __resource_type__ = "VisionPrescriptionLensSpecification" add: fhirtypes.DecimalType | None = Field( default=None, alias="add", title="Added power for multifocal levels", description=( "Power adjustment for multifocal lenses measured in dioptres (0.25 " "units)." ), json_schema_extra={ "element_property": True, }, ) add__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_add", title="Extension field for ``add``." ) axis: fhirtypes.IntegerType | None = Field( default=None, alias="axis", title="Lens meridian which contain no power for astigmatism", description="Adjustment for astigmatism measured in integer degrees.", json_schema_extra={ "element_property": True, }, ) axis__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_axis", title="Extension field for ``axis``." ) backCurve: fhirtypes.DecimalType | None = Field( default=None, alias="backCurve", title="Contact lens back curvature", description="Back curvature measured in millimetres.", json_schema_extra={ "element_property": True, }, ) backCurve__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_backCurve", title="Extension field for ``backCurve``." ) brand: fhirtypes.StringType | None = Field( default=None, alias="brand", title="Brand required", description="Brand recommendations or restrictions.", json_schema_extra={ "element_property": True, }, ) brand__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_brand", title="Extension field for ``brand``." ) color: fhirtypes.StringType | None = Field( default=None, alias="color", title="Color required", description="Special color or pattern.", json_schema_extra={ "element_property": True, }, ) color__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_color", title="Extension field for ``color``." ) cylinder: fhirtypes.DecimalType | None = Field( default=None, alias="cylinder", title="Lens power for astigmatism", description="Power adjustment for astigmatism measured in dioptres (0.25 units).", json_schema_extra={ "element_property": True, }, ) cylinder__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_cylinder", title="Extension field for ``cylinder``." ) diameter: fhirtypes.DecimalType | None = Field( default=None, alias="diameter", title="Contact lens diameter", description="Contact lens diameter measured in millimetres.", json_schema_extra={ "element_property": True, }, ) diameter__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_diameter", title="Extension field for ``diameter``." ) duration: fhirtypes.QuantityType | None = Field( default=None, alias="duration", title="Lens wear duration", description="The recommended maximum wear period for the lens.", json_schema_extra={ "element_property": True, }, ) eye: fhirtypes.CodeType | None = Field( default=None, alias="eye", title="right | left", description="The eye for which the lens specification applies.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["right", "left"], }, ) eye__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_eye", title="Extension field for ``eye``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Notes for coatings", description="Notes for special requirements such as coatings and lens materials.", json_schema_extra={ "element_property": True, }, ) power: fhirtypes.DecimalType | None = Field( default=None, alias="power", title="Contact lens power", description="Contact lens power measured in dioptres (0.25 units).", json_schema_extra={ "element_property": True, }, ) power__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_power", title="Extension field for ``power``." ) prism: typing.List[ fhirtypes.VisionPrescriptionLensSpecificationPrismType ] | None = Field( default=None, alias="prism", title="Eye alignment compensation", description="Allows for adjustment on two axis.", json_schema_extra={ "element_property": True, }, ) product: fhirtypes.CodeableConceptType = Field( default=..., alias="product", title="Product to be supplied", description=( "Identifies the type of vision correction product which is required for" " the patient." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sphere: fhirtypes.DecimalType | None = Field( default=None, alias="sphere", title="Power of the lens", description="Lens power measured in dioptres (0.25 units).", json_schema_extra={ "element_property": True, }, ) sphere__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sphere", title="Extension field for ``sphere``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``VisionPrescriptionLensSpecification`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "product", "eye", "sphere", "cylinder", "axis", "prism", "add", "power", "backCurve", "diameter", "duration", "color", "brand", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``VisionPrescriptionLensSpecification`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "product", "eye"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("eye", "eye__ext")] return required_fields class VisionPrescriptionLensSpecificationPrism(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Eye alignment compensation. Allows for adjustment on two axis. """ __resource_type__ = "VisionPrescriptionLensSpecificationPrism" amount: fhirtypes.DecimalType | None = Field( default=None, alias="amount", title="Amount of adjustment", description="Amount of prism to compensate for eye alignment in fractional units.", json_schema_extra={ "element_property": True, "element_required": True, }, ) amount__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_amount", title="Extension field for ``amount``." ) base: fhirtypes.CodeType | None = Field( default=None, alias="base", title="up | down | in | out", description="The relative base, or reference lens edge, for the prism.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["up", "down", "in", "out"], }, ) base__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_base", title="Extension field for ``base``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``VisionPrescriptionLensSpecificationPrism`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "amount", "base"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``VisionPrescriptionLensSpecificationPrism`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("amount", "amount__ext"), ("base", "base__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/__init__.py ================================================ from __future__ import annotations as _annotations from functools import lru_cache from typing import TYPE_CHECKING, cast from fhir_core.fhirabstractmodel import FHIRAbstractModel __author__ = "Md Nazrul Islam" __email__ = "email2nazrul@gmail.com" __fhir_version__ = "3.0.2" @lru_cache(maxsize=None, typed=True) def get_fhir_model_class(model_name: str) -> type[FHIRAbstractModel]: """ """ from . import fhirtypes as ft try: model_type = getattr(ft, model_name + "Type") if TYPE_CHECKING: from fhir_core.types import FhirBase model_type = cast(type[FhirBase], model_type) return model_type.get_model_klass() except AttributeError: raise ValueError(f"{model_name} is not a valid FHIR Model") ================================================ FILE: fhir/resources/STU3/account.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Account Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Account(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Tracks balance, charges, for patient or cost center. A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centers, etc. """ __resource_type__ = "Account" active: fhirtypes.PeriodType | None = Field( default=None, alias="active", title="Time window that transactions may be posted to this account", description=( "Indicates the period of time over which the account is allowed to have" " transactions posted to it. This period may be different to the " "coveragePeriod which is the duration of time that services may occur." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) balance: fhirtypes.MoneyType | None = Field( default=None, alias="balance", title="How much is in account?", description=( "Represents the sum of all credits less all debits associated with the " "account. Might be positive, zero or negative." ), json_schema_extra={ "element_property": True, }, ) coverage: typing.List[fhirtypes.AccountCoverageType] | None = Field( default=None, alias="coverage", title=( "The party(s) that are responsible for covering the payment of this " "account, and what order should they be applied to the account" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Explanation of purpose/use", description=( "Provides additional information about what the account tracks and how " "it is used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) guarantor: typing.List[fhirtypes.AccountGuarantorType] | None = Field( default=None, alias="guarantor", title="Responsible for the account", description="Parties financially responsible for the account.", json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Account number", description=( "Unique identifier used to reference the account. May or may not be " "intended for human use (e.g. credit card number)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Human-readable label", description=( "Name used for the account when displaying it to humans in reports, " "etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) owner: fhirtypes.ReferenceType | None = Field( default=None, alias="owner", title="Who is responsible?", description=( "Indicates the organization, department, etc. with responsibility for " "the account." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Transaction window", description=( "Identifies the period of time the account applies to; e.g. accounts " "created per fiscal year, quarter, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | inactive | entered-in-error", description="Indicates whether the account is presently used/usable or not.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "inactive", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="What is account tied to?", description=( "Identifies the patient, device, practitioner, location or other object" " the account is associated with." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Device", "Practitioner", "Location", "HealthcareService", "Organization", ], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="E.g. patient, expense, depreciation", description="Categorizes the account for reporting and searching purposes.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Account`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "type", "name", "subject", "period", "active", "balance", "coverage", "owner", "description", "guarantor", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Account`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "type", "name", "subject", "period", "active", "coverage", "owner", "description", ] class AccountCoverage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The party(s) that are responsible for covering the payment of this account, and what order should they be applied to the account. """ __resource_type__ = "AccountCoverage" coverage: fhirtypes.ReferenceType = Field( default=..., alias="coverage", title=( "The party(s) that are responsible for covering the payment of this " "account" ), description=( "The party(s) that are responsible for payment (or part of) of charges " "applied to this account (including self-pay). A coverage may only be " "resposible for specific types of charges, and the sequence of the " "coverages in the account could be important when processing billing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage"], }, ) priority: fhirtypes.PositiveIntType | None = Field( default=None, alias="priority", title="The priority of the coverage in the context of this account", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AccountCoverage`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "coverage", "priority"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AccountCoverage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "coverage", "priority"] class AccountGuarantor(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Responsible for the account. Parties financially responsible for the account. """ __resource_type__ = "AccountGuarantor" onHold: bool | None = Field( default=None, alias="onHold", title="Credit or other hold applied", description=( "A guarantor may be placed on credit hold or otherwise have their role " "temporarily suspended." ), json_schema_extra={ "element_property": True, }, ) onHold__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onHold", title="Extension field for ``onHold``." ) party: fhirtypes.ReferenceType = Field( default=..., alias="party", title="Responsible entity", description="The entity who is responsible.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "RelatedPerson", "Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Guarrantee account during", description=( "The timeframe during which the guarantor accepts responsibility for " "the account." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AccountGuarantor`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "party", "onHold", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AccountGuarantor`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/activitydefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ActivityDefinition Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ActivityDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The definition of a specific activity to be taken, independent of any particular patient or context. This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context. """ __resource_type__ = "ActivityDefinition" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the activity definition was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) bodySite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="bodySite", title="What part of body to perform on", description=( "Indicates the sites on the subject's body where the procedure should " "be performed (I.e. the target sites)." ), json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Detail type of activity", description=( "Detailed description of the type of activity; e.g. What lab test, what" " procedure, what kind of encounter." ), json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contributor: typing.List[fhirtypes.ContributorType] | None = Field( default=None, alias="contributor", title="A content contributor", description=( "A contributor to the content of the asset, including authors, editors," " reviewers, and endorsers." ), json_schema_extra={ "element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the activity definition and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the activity definition." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date this was last changed", description=( "The date (and optionally time) when the activity definition was " "published. The date must change if and when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the activity definition" " changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the activity definition", description=( "A free text natural language description of the activity definition " "from a consumer's perspective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) dosage: typing.List[fhirtypes.DosageType] | None = Field( default=None, alias="dosage", title="Detailed dosage instructions", description=( "Provides detailed dosage instructions in the same way that they are " "described for MedicationRequest resources." ), json_schema_extra={ "element_property": True, }, ) dynamicValue: typing.List[ fhirtypes.ActivityDefinitionDynamicValueType ] | None = Field( default=None, alias="dynamicValue", title="Dynamic aspects of the definition", description=( "Dynamic values that will be evaluated to produce values for elements " "of the resulting resource. For example, if the dosage of a medication " "must be computed based on the patient's weight, a dynamic value would " "be used to specify an expression that calculated the weight, and the " "path on the intent resource that would contain the result." ), json_schema_extra={ "element_property": True, }, ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the activity definition is expected to be used", description=( "The period during which the activity definition content was or is " "planned to be in active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A boolean value to indicate that this activity definition is authored " "for testing purposes (or education/evaluation/marketing), and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the activity definition", description=( "A formal identifier that is used to identify this activity definition " "when it is represented in other formats, or referenced in a " "specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for activity definition (if applicable)", description=( "A legal or geographic region in which the activity definition is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title="Kind of resource", description=( "A description of the kind of resource the activity definition is " "representing. For example, a MedicationRequest, a ProcedureRequest, or" " a CommunicationRequest. Typically, but not always, this is a Request " "resource." ), json_schema_extra={ "element_property": True, }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the activity definition was last reviewed", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval, but doesn't change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) library: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="library", title="Logic used by the asset", description=( "A reference to a Library resource containing any formal logic used by " "the asset." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Library"], }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where it should happen", description=( "Identifies the facility where the activity will occur; e.g. home, " "hospital, specific clinic, etc." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this activity definition (computer friendly)", description=( "A natural language name identifying the activity definition. This name" " should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) participant: typing.List[ fhirtypes.ActivityDefinitionParticipantType ] | None = Field( default=None, alias="participant", title="Who should participate in the action", description="Indicates who should participate in performing the action described.", json_schema_extra={ "element_property": True, }, ) productCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productCodeableConcept", title="What's administered/supplied", description=( "Identifies the food, drug or other product being consumed or supplied " "in the activity." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e product[x] "one_of_many": "product", "one_of_many_required": False, }, ) productReference: fhirtypes.ReferenceType | None = Field( default=None, alias="productReference", title="What's administered/supplied", description=( "Identifies the food, drug or other product being consumed or supplied " "in the activity." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e product[x] "one_of_many": "product", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication", "Substance"], }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the individual or organization that published the activity" " definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this activity definition is defined", description=( "Explaination of why this activity definition is needed and why it has " "been designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="How much is administered/consumed/supplied", description=( "Identifies the quantity expected to be consumed at once (per dose, per" " meal, etc.)." ), json_schema_extra={ "element_property": True, }, ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Additional documentation, citations, etc", description=( "Related artifacts such as additional documentation, justification, or " "bibliographic references." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this activity definition. Enables tracking the life-" "cycle of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) timingDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="timingDateTime", title="When activity is to occur", description=( "The period, timing or frequency upon which the described activity is " "to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timingDateTime", title="Extension field for ``timingDateTime``.", ) timingPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="timingPeriod", title="When activity is to occur", description=( "The period, timing or frequency upon which the described activity is " "to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingRange: fhirtypes.RangeType | None = Field( default=None, alias="timingRange", title="When activity is to occur", description=( "The period, timing or frequency upon which the described activity is " "to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingTiming: fhirtypes.TimingType | None = Field( default=None, alias="timingTiming", title="When activity is to occur", description=( "The period, timing or frequency upon which the described activity is " "to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this activity definition (human friendly)", description="A short, descriptive, user-friendly title for the activity definition.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) topic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="topic", title="E.g. Education, Treatment, Assessment, etc", description=( "Descriptive topics related to the content of the activity. Topics " "provide a high-level categorization of the activity that can be useful" " for filtering and searching." ), json_schema_extra={ "element_property": True, }, ) transform: fhirtypes.ReferenceType | None = Field( default=None, alias="transform", title="Transform to apply the template", description=( "A reference to a StructureMap resource that defines a transform that " "can be executed to produce the intent resource using the " "ActivityDefinition instance as the input." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureMap"], }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Logical URI to reference this activity definition (globally unique)", description=( "An absolute URI that is used to identify this activity definition when" " it is referenced in a specification, model, design or an instance. " "This SHALL be a URL, SHOULD be globally unique, and SHOULD be an " "address at which this activity definition is (or will be) published. " "The URL SHOULD include the major version of the activity definition. " "For more information see [Technical and Business " "Versions](resource.html#versions)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) usage: fhirtypes.StringType | None = Field( default=None, alias="usage", title="Describes the clinical usage of the asset", description=( "A detailed description of how the asset is used from a clinical " "perspective." ), json_schema_extra={ "element_property": True, }, ) usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usage", title="Extension field for ``usage``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Context the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching for appropriate activity definition instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the activity definition", description=( "The identifier that is used to identify this version of the activity " "definition when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the activity " "definition author and is not expected to be globally unique. For " "example, it might be a timestamp (e.g. yyyymmdd) if a managed version " "is not available. There is also no expectation that versions can be " "placed in a lexicographical sequence. To provide a version consistent " "with the Decision Support Service specification, use the format " "Major.Minor.Revision (e.g. 1.0.0). For more information on versioning " "knowledge assets, refer to the Decision Support Service specification." " Note that a version is required for non-experimental active assets." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ActivityDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "description", "purpose", "usage", "approvalDate", "lastReviewDate", "effectivePeriod", "useContext", "jurisdiction", "topic", "contributor", "contact", "copyright", "relatedArtifact", "library", "kind", "code", "timingTiming", "timingDateTime", "timingPeriod", "timingRange", "location", "participant", "productReference", "productReference", "productCodeableConcept", "quantity", "dosage", "bodySite", "transform", "dynamicValue", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ActivityDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "description", "effectivePeriod", "useContext", "jurisdiction", "contact", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "product": ["productCodeableConcept", "productReference"], "timing": ["timingDateTime", "timingPeriod", "timingRange", "timingTiming"], } return one_of_many_fields class ActivityDefinitionDynamicValue(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Dynamic aspects of the definition. Dynamic values that will be evaluated to produce values for elements of the resulting resource. For example, if the dosage of a medication must be computed based on the patient's weight, a dynamic value would be used to specify an expression that calculated the weight, and the path on the intent resource that would contain the result. """ __resource_type__ = "ActivityDefinitionDynamicValue" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Natural language description of the dynamic value", description=( "A brief, natural language description of the intended semantics of the" " dynamic value." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="An expression that provides the dynamic value for the customization", description="An expression specifying the value of the customized element.", json_schema_extra={ "element_property": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) language: fhirtypes.StringType | None = Field( default=None, alias="language", title="Language of the expression", description="The media type of the language for the expression.", json_schema_extra={ "element_property": True, }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="The path to the element to be set dynamically", description=( "The path to the element to be customized. This is the path on the " "resource that will hold the result of the calculation defined by the " "expression." ), json_schema_extra={ "element_property": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ActivityDefinitionDynamicValue`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "path", "language", "expression", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ActivityDefinitionDynamicValue`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ActivityDefinitionParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who should participate in the action. Indicates who should participate in performing the action described. """ __resource_type__ = "ActivityDefinitionParticipant" role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="E.g. Nurse, Surgeon, Parent, etc", description=( "The role the participant should play in performing the described " "action." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="patient | practitioner | related-person", description="The type of participant in the action.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["patient", "practitioner", "related-person"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ActivityDefinitionParticipant`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "role"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ActivityDefinitionParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/address.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Address Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Address(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An address expressed using postal conventions (as opposed to GPS or other location definition formats). An address expressed using postal conventions (as opposed to GPS or other location definition formats). This data type may be used to convey addresses for use in delivering mail as well as for visiting locations which might not be valid for mail delivery. There are a variety of postal address formats defined around the world. """ __resource_type__ = "Address" city: fhirtypes.StringType | None = Field( default=None, alias="city", title="Name of city, town etc.", description=( "The name of the city, town, village or other community or delivery " "center." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) city__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_city", title="Extension field for ``city``." ) country: fhirtypes.StringType | None = Field( default=None, alias="country", title="Country (e.g. can be ISO 3166 2 or 3 letter code)", description="Country - a nation as commonly understood or generally accepted.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) country__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_country", title="Extension field for ``country``." ) district: fhirtypes.StringType | None = Field( default=None, alias="district", title="District name (aka county)", description="The name of the administrative area (county).", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) district__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_district", title="Extension field for ``district``." ) line: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="line", title="Street name, number, direction & P.O. Box etc.", description=( "This component contains the house number, apartment number, street " "name, street direction, P.O. Box number, delivery hints, and similar " "address information." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) line__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_line", title="Extension field for ``line``." ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period when address was/is in use", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) postalCode: fhirtypes.StringType | None = Field( default=None, alias="postalCode", title="Postal code for area", description="A postal code designating a region defined by the postal service.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) postalCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_postalCode", title="Extension field for ``postalCode``." ) state: fhirtypes.StringType | None = Field( default=None, alias="state", title="Sub-unit of country (abbreviations ok)", description=( "Sub-unit of a country with limited sovereignty in a federally " "organized country. A code may be used if codes are in common use (i.e." " US 2 letter state codes)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) state__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_state", title="Extension field for ``state``." ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Text representation of the address", description="A full text representation of the address.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="postal | physical | both", description=( "Distinguishes between physical addresses (those you can visit) and " "mailing addresses (e.g. PO Boxes and care-of addresses). Most " "addresses are both." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["postal", "physical", "both"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="home | work | temp | old - purpose of this address", description="The purpose of this address.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["home", "work", "temp", "old"], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Address`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "use", "type", "text", "line", "city", "district", "state", "postalCode", "country", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Address`` according to specification, with preserving the original sequence order. """ return [ "use", "type", "text", "line", "city", "district", "state", "postalCode", "country", "period", ] ================================================ FILE: fhir/resources/STU3/adverseevent.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/AdverseEvent Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class AdverseEvent(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Medical care, research study or other healthcare event causing physical injury. Actual or potential/avoided event causing unintended physical injury resulting from or contributed to by medical care, a research study or other healthcare setting factors that requires additional monitoring, treatment, or hospitalization, or that results in death. """ __resource_type__ = "AdverseEvent" category: fhirtypes.CodeType | None = Field( default=None, alias="category", title=( "AE | PAE An adverse event is an event that caused harm to a patient," " an adverse reaction is a something that is a subject-specific event " "that is a result of an exposure to a medication, food, device or " "environmental substance, a potential adverse event is something that " "occurred and that could have caused harm to a patient but did not" ), description=( "The type of event which is important to characterize what occurred and" " caused harm to the subject, or had the potential to cause harm to the" " subject." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["AE", "PAE"], }, ) category__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_category", title="Extension field for ``category``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When the event occurred", description="The date (and perhaps time) when the adverse event occurred.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Description of the adverse event", description="Describes the adverse event in text.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) eventParticipant: fhirtypes.ReferenceType | None = Field( default=None, alias="eventParticipant", title="Who was involved in the adverse event or the potential adverse event", description=( "Parties that may or should contribute or have contributed information " "to the Act. Such information includes information leading to the " "decision to perform the Act and how to perform the Act (e.g. " "consultant), information that the Act itself seeks to reveal (e.g. " "informant of clinical history), or information about what Act was " "performed (e.g. informant witness)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "Device"], }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Business identifier for the event", description=( "The identifier(s) of this adverse event that are assigned by business " "processes and/or used to refer to it when a direct URL reference to " "the resource itsefl is not appropriate." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Location where adverse event occurred", description="The information about where the adverse event occurred.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) outcome: fhirtypes.CodeableConceptType | None = Field( default=None, alias="outcome", title=( "resolved | recovering | ongoing | resolvedWithSequelae | fatal | " "unknown" ), description="Describes the type of outcome from the adverse event.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reaction: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reaction", title="Adverse Reaction Events linked to exposure to substance", description=( "Includes information about the reaction that occurred as a result of " "exposure to a substance (for example, a drug or a chemical)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) recorder: fhirtypes.ReferenceType | None = Field( default=None, alias="recorder", title="Who recorded the adverse event", description=( "Information on who recorded the adverse event. May be the patient or " "a practitioner." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Practitioner", "RelatedPerson"], }, ) referenceDocument: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="referenceDocument", title="AdverseEvent.referenceDocument", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) seriousness: fhirtypes.CodeableConceptType | None = Field( default=None, alias="seriousness", title="Mild | Moderate | Severe", description="Describes the seriousness or severity of the adverse event.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) study: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="study", title="AdverseEvent.study", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ResearchStudy"], }, ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Subject or group impacted by event", description=( "This subject or group impacted by the event. With a prospective " "adverse event, there will be no subject as the adverse event was " "prevented." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "ResearchSubject", "Medication", "Device", ], }, ) subjectMedicalHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="subjectMedicalHistory", title="AdverseEvent.subjectMedicalHistory", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "AllergyIntolerance", "FamilyMemberHistory", "Immunization", "Procedure", ], }, ) suspectEntity: typing.List[fhirtypes.AdverseEventSuspectEntityType] | None = Field( default=None, alias="suspectEntity", title="The suspected agent causing the adverse event", description=( "Describes the entity that is suspected to have caused the adverse " "event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="actual | potential", description=( "This element defines the specific type of event that occurred or that " "was prevented from occurring." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AdverseEvent`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "category", "type", "subject", "date", "reaction", "location", "seriousness", "outcome", "recorder", "eventParticipant", "description", "suspectEntity", "subjectMedicalHistory", "referenceDocument", "study", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AdverseEvent`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "category", "type", "subject", "date", "reaction", "location", "seriousness", "outcome", "recorder", "eventParticipant", "description", "suspectEntity", "subjectMedicalHistory", "referenceDocument", "study", ] class AdverseEventSuspectEntity(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The suspected agent causing the adverse event. Describes the entity that is suspected to have caused the adverse event. """ __resource_type__ = "AdverseEventSuspectEntity" causality: fhirtypes.CodeType | None = Field( default=None, alias="causality", title="causality1 | causality2", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["causality1", "causality2"], }, ) causality__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_causality", title="Extension field for ``causality``." ) causalityAssessment: fhirtypes.CodeableConceptType | None = Field( default=None, alias="causalityAssessment", title="assess1 | assess2", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) causalityAuthor: fhirtypes.ReferenceType | None = Field( default=None, alias="causalityAuthor", title="AdverseEvent.suspectEntity.causalityAuthor", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) causalityMethod: fhirtypes.CodeableConceptType | None = Field( default=None, alias="causalityMethod", title="method1 | method2", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) causalityProductRelatedness: fhirtypes.StringType | None = Field( default=None, alias="causalityProductRelatedness", title="AdverseEvent.suspectEntity.causalityProductRelatedness", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) causalityProductRelatedness__ext: fhirtypes.FHIRPrimitiveExtensionType | None = ( Field( default=None, alias="_causalityProductRelatedness", title="Extension field for ``causalityProductRelatedness``.", ) ) causalityResult: fhirtypes.CodeableConceptType | None = Field( default=None, alias="causalityResult", title="result1 | result2", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instance: fhirtypes.ReferenceType = Field( default=..., alias="instance", title="Refers to the specific entity that caused the adverse event", description=( "Identifies the actual instance of what caused the adverse event. May " "be a substance, medication, medication administration, medication " "statement or a device." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Substance", "Medication", "MedicationAdministration", "MedicationStatement", "Device", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AdverseEventSuspectEntity`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "instance", "causality", "causalityAssessment", "causalityProductRelatedness", "causalityMethod", "causalityAuthor", "causalityResult", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AdverseEventSuspectEntity`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "instance", "causality", "causalityAssessment", "causalityProductRelatedness", "causalityMethod", "causalityAuthor", "causalityResult", ] ================================================ FILE: fhir/resources/STU3/age.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Age Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from . import quantity class Age(quantity.Quantity): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A duration of time during which an organism (or a process) has existed. """ __resource_type__ = "Age" @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Age`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "value", "comparator", "unit", "system", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Age`` according to specification, with preserving the original sequence order. """ return ["value", "comparator", "unit", "system", "code"] ================================================ FILE: fhir/resources/STU3/allergyintolerance.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/AllergyIntolerance Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class AllergyIntolerance(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Allergy or Intolerance (generally: Risk of adverse reaction to a substance). Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance. """ __resource_type__ = "AllergyIntolerance" assertedDate: fhirtypes.DateTimeType | None = Field( default=None, alias="assertedDate", title="Date record was believed accurate", description=( "The date on which the existance of the AllergyIntolerance was first " "asserted or acknowledged." ), json_schema_extra={ "element_property": True, }, ) assertedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_assertedDate", title="Extension field for ``assertedDate``.", ) asserter: fhirtypes.ReferenceType | None = Field( default=None, alias="asserter", title="Source of the information about the allergy", description="The source of the information about the allergy that is recorded.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "RelatedPerson", "Practitioner"], }, ) category: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="category", title="food | medication | environment | biologic", description="Category of the identified substance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["food", "medication", "environment", "biologic"], }, ) category__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_category", title="Extension field for ``category``." ) clinicalStatus: fhirtypes.CodeType | None = Field( default=None, alias="clinicalStatus", title="active | inactive | resolved", description="The clinical status of the allergy or intolerance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "inactive", "resolved"], }, ) clinicalStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_clinicalStatus", title="Extension field for ``clinicalStatus``.", ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Code that identifies the allergy or intolerance", description=( "Code for an allergy or intolerance statement (either a positive or a " "negated/excluded statement). This may be a code for a substance or " "pharmaceutical product that is considered to be responsible for the " 'adverse reaction risk (e.g., "Latex"), an allergy or intolerance ' 'condition (e.g., "Latex allergy"), or a negated/excluded code for a ' 'specific substance or class (e.g., "No latex allergy") or a general or' ' categorical negated statement (e.g., "No known allergy", "No known ' 'drug allergies").' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) criticality: fhirtypes.CodeType | None = Field( default=None, alias="criticality", title="low | high | unable-to-assess", description=( "Estimate of the potential clinical harm, or seriousness, of the " "reaction to the identified substance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["low", "high", "unable-to-assess"], }, ) criticality__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_criticality", title="Extension field for ``criticality``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External ids for this item", description=( "This records identifiers associated with this allergy/intolerance " "concern that are defined by business processes and/or used to refer to" " it when a direct URL reference to the resource itself is not " "appropriate (e.g. in CDA documents, or in written / printed " "documentation)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastOccurrence: fhirtypes.DateTimeType | None = Field( default=None, alias="lastOccurrence", title="Date(/time) of last known occurrence of a reaction", description=( "Represents the date and/or time of the last known occurrence of a " "reaction event." ), json_schema_extra={ "element_property": True, }, ) lastOccurrence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastOccurrence", title="Extension field for ``lastOccurrence``.", ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Additional text not captured in other fields", description=( "Additional narrative about the propensity for the Adverse Reaction, " "not captured in other fields." ), json_schema_extra={ "element_property": True, }, ) onsetAge: fhirtypes.AgeType | None = Field( default=None, alias="onsetAge", title="When allergy or intolerance was identified", description=( "Estimated or actual date, date-time, or age when allergy or " "intolerance was identified." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="onsetDateTime", title="When allergy or intolerance was identified", description=( "Estimated or actual date, date-time, or age when allergy or " "intolerance was identified." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onsetDateTime", title="Extension field for ``onsetDateTime``.", ) onsetPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="onsetPeriod", title="When allergy or intolerance was identified", description=( "Estimated or actual date, date-time, or age when allergy or " "intolerance was identified." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetRange: fhirtypes.RangeType | None = Field( default=None, alias="onsetRange", title="When allergy or intolerance was identified", description=( "Estimated or actual date, date-time, or age when allergy or " "intolerance was identified." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetString: fhirtypes.StringType | None = Field( default=None, alias="onsetString", title="When allergy or intolerance was identified", description=( "Estimated or actual date, date-time, or age when allergy or " "intolerance was identified." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onsetString", title="Extension field for ``onsetString``." ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Who the sensitivity is for", description="The patient who has the allergy or intolerance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) reaction: typing.List[fhirtypes.AllergyIntoleranceReactionType] | None = Field( default=None, alias="reaction", title="Adverse Reaction Events linked to exposure to substance", description=( "Details about each adverse reaction event linked to exposure to the " "identified substance." ), json_schema_extra={ "element_property": True, }, ) recorder: fhirtypes.ReferenceType | None = Field( default=None, alias="recorder", title="Who recorded the sensitivity", description=( "Individual who recorded the record and takes responsibility for its " "content." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "Patient"], }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="allergy | intolerance - Underlying mechanism (if known)", description=( "Identification of the underlying physiological mechanism for the " "reaction risk." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["allergy", "intolerance"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) verificationStatus: fhirtypes.CodeType | None = Field( default=None, alias="verificationStatus", title="unconfirmed | confirmed | refuted | entered-in-error", description=( "Assertion about certainty associated with the propensity, or potential" " risk, of a reaction to the identified substance (including " "pharmaceutical product)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["unconfirmed", "confirmed", "refuted", "entered-in-error"], }, ) verificationStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_verificationStatus", title="Extension field for ``verificationStatus``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AllergyIntolerance`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "clinicalStatus", "verificationStatus", "type", "category", "criticality", "code", "patient", "onsetDateTime", "onsetAge", "onsetPeriod", "onsetRange", "onsetString", "assertedDate", "recorder", "asserter", "lastOccurrence", "note", "reaction", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AllergyIntolerance`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "clinicalStatus", "verificationStatus", "type", "category", "criticality", "code", "patient", "asserter", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("verificationStatus", "verificationStatus__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "onset": [ "onsetAge", "onsetDateTime", "onsetPeriod", "onsetRange", "onsetString", ] } return one_of_many_fields class AllergyIntoleranceReaction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Adverse Reaction Events linked to exposure to substance. Details about each adverse reaction event linked to exposure to the identified substance. """ __resource_type__ = "AllergyIntoleranceReaction" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Description of the event as a whole", description=( "Text description about the reaction as a whole, including details of " "the manifestation if required." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) exposureRoute: fhirtypes.CodeableConceptType | None = Field( default=None, alias="exposureRoute", title="How the subject was exposed to the substance", description=( "Identification of the route by which the subject was exposed to the " "substance." ), json_schema_extra={ "element_property": True, }, ) manifestation: typing.List[fhirtypes.CodeableConceptType] = Field( default=..., alias="manifestation", title="Clinical symptoms/signs associated with the Event", description=( "Clinical symptoms and/or signs that are observed or associated with " "the adverse reaction event." ), json_schema_extra={ "element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Text about event not captured in other fields", description=( "Additional text about the adverse reaction event not captured in other" " fields." ), json_schema_extra={ "element_property": True, }, ) onset: fhirtypes.DateTimeType | None = Field( default=None, alias="onset", title="Date(/time) when manifestations showed", description="Record of the date and/or time of the onset of the Reaction.", json_schema_extra={ "element_property": True, }, ) onset__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onset", title="Extension field for ``onset``." ) severity: fhirtypes.CodeType | None = Field( default=None, alias="severity", title="mild | moderate | severe (of event as a whole)", description=( "Clinical assessment of the severity of the reaction event as a whole, " "potentially considering multiple different manifestations." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["mild", "moderate", "severe"], }, ) severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_severity", title="Extension field for ``severity``." ) substance: fhirtypes.CodeableConceptType | None = Field( default=None, alias="substance", title=( "Specific substance or pharmaceutical product considered to be " "responsible for event" ), description=( "Identification of the specific substance (or pharmaceutical product) " "considered to be responsible for the Adverse Reaction event. Note: the" " substance for a specific reaction may be different from the substance" " identified as the cause of the risk, but it must be consistent with " "it. For instance, it may be a more specific substance (e.g. a brand " "medication) or a composite product that includes the identified " "substance. It must be clinically safe to only process the 'code' and " "ignore the 'reaction.substance'." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AllergyIntoleranceReaction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "substance", "manifestation", "description", "onset", "severity", "exposureRoute", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AllergyIntoleranceReaction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/annotation.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Annotation Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Annotation(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Text node with attribution. A text note which also contains information about who made the statement and when. """ __resource_type__ = "Annotation" authorReference: fhirtypes.ReferenceType | None = Field( default=None, alias="authorReference", title="Individual responsible for the annotation", description="The individual responsible for making the annotation.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e author[x] "one_of_many": "author", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "Patient", "RelatedPerson"], }, ) authorString: fhirtypes.StringType | None = Field( default=None, alias="authorString", title="Individual responsible for the annotation", description="The individual responsible for making the annotation.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e author[x] "one_of_many": "author", "one_of_many_required": False, }, ) authorString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authorString", title="Extension field for ``authorString``.", ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="The annotation - text content", description="The text of the annotation.", json_schema_extra={ "element_property": True, "element_required": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) time: fhirtypes.DateTimeType | None = Field( default=None, alias="time", title="When the annotation was made", description="Indicates when this particular annotation was made.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) time__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_time", title="Extension field for ``time``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Annotation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "authorReference", "authorReference", "authorReference", "authorString", "time", "text", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Annotation`` according to specification, with preserving the original sequence order. """ return [ "authorReference", "authorReference", "authorReference", "authorString", "time", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("text", "text__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"author": ["authorReference", "authorString"]} return one_of_many_fields ================================================ FILE: fhir/resources/STU3/appointment.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Appointment Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Appointment(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s). """ __resource_type__ = "Appointment" appointmentType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="appointmentType", title=( "The style of appointment or patient that has been booked in the slot " "(not service type)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Additional comments", description="Additional comments about the appointment.", json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="The date that this appointment was initially created", description=( "The date that this appointment was initially created. This could be " "different to the meta.lastModified value on the initial entry, as this" " could have been before the resource was created on the FHIR server, " "and should remain unchanged over the lifespan of the appointment." ), json_schema_extra={ "element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Shown on a subject line in a meeting request, or appointment list", description=( "The brief description of the appointment as would be shown on a " "subject line in a meeting request, or appointment list. Detailed or " "expanded information should be put in the comment field." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) end: fhirtypes.InstantType | None = Field( default=None, alias="end", title="When appointment is to conclude", description="Date/Time that the appointment is to conclude.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_end", title="Extension field for ``end``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Ids for this item", description=( "This records identifiers associated with this appointment concern that" " are defined by business processes and/or used to refer to it when a " "direct URL reference to the resource itself is not appropriate (e.g. " "in CDA documents, or in written / printed documentation)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) incomingReferral: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="incomingReferral", title=( "The ReferralRequest provided as information to allocate to the " "Encounter" ), description=( "The referral request this appointment is allocated to assess (incoming" " referral)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ReferralRequest"], }, ) indication: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="indication", title="Reason the appointment is to takes place (resource)", description=( "Reason the appointment has been scheduled to take place, as specified " "using information from another resource. When the patient arrives and " "the encounter begins it may be used as the admission diagnosis. The " "indication will typically be a Condition (with other resources " "referenced in the evidence.detail), or a Procedure." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "Procedure"], }, ) minutesDuration: fhirtypes.PositiveIntType | None = Field( default=None, alias="minutesDuration", title="Can be less than start/end (e.g. estimate)", description=( "Number of minutes that the appointment is to take. This can be less " "than the duration between the start and end times (where actual time " "of appointment is only an estimate or is a planned appointment " "request)." ), json_schema_extra={ "element_property": True, }, ) minutesDuration__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minutesDuration", title="Extension field for ``minutesDuration``.", ) participant: typing.List[fhirtypes.AppointmentParticipantType] = Field( default=..., alias="participant", title="Participants involved in appointment", description="List of participants involved in the appointment.", json_schema_extra={ "element_property": True, }, ) priority: fhirtypes.UnsignedIntType | None = Field( default=None, alias="priority", title="Used to make informed decisions if needing to re-prioritize", description=( "The priority of the appointment. Can be used to make informed " "decisions if needing to re-prioritize appointments. (The iCal Standard" " specifies 0 as undefined, 1 as highest, 9 as lowest priority)." ), json_schema_extra={ "element_property": True, }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) reason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reason", title="Reason this appointment is scheduled", description=( "The reason that this appointment is being scheduled. This is more " "clinical than administrative." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) requestedPeriod: typing.List[fhirtypes.PeriodType] | None = Field( default=None, alias="requestedPeriod", title=( "Potential date/time interval(s) requested to allocate the appointment " "within" ), description=( "A set of date ranges (potentially including times) that the " "appointment is preferred to be scheduled within. When using these " "values, the minutes duration should be provided to indicate the length" " of the appointment to fill and populate the start/end times for the " "actual allocated time." ), json_schema_extra={ "element_property": True, }, ) serviceCategory: fhirtypes.CodeableConceptType | None = Field( default=None, alias="serviceCategory", title=( "A broad categorisation of the service that is to be performed during " "this appointment" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) serviceType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="serviceType", title="The specific service that is to be performed during this appointment", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) slot: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="slot", title="The slots that this appointment is filling", description=( "The slots from the participants' schedules that will be filled by the " "appointment." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Slot"], }, ) specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialty", title=( "The specialty of a practitioner that would be required to perform the " "service requested in this appointment" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) start: fhirtypes.InstantType | None = Field( default=None, alias="start", title="When appointment is to take place", description="Date/Time that the appointment is to take place.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_start", title="Extension field for ``start``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "proposed | pending | booked | arrived | fulfilled | cancelled | noshow" " | entered-in-error" ), description=( "The overall status of the Appointment. Each of the participants has " "their own participation status which indicates their involvement in " "the process, however this status indicates the shared status." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "proposed", "pending", "booked", "arrived", "fulfilled", "cancelled", "noshow", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInformation", title="Additional information to support the appointment", description=( "Additional information to support the appointment provided when making" " the appointment." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Appointment`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "serviceCategory", "serviceType", "specialty", "appointmentType", "reason", "indication", "priority", "description", "supportingInformation", "start", "end", "minutesDuration", "slot", "created", "comment", "incomingReferral", "participant", "requestedPeriod", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Appointment`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "serviceCategory", "serviceType", "specialty", "appointmentType", "reason", "start", "end", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class AppointmentParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Participants involved in appointment. List of participants involved in the appointment. """ __resource_type__ = "AppointmentParticipant" actor: fhirtypes.ReferenceType | None = Field( default=None, alias="actor", title="Person, Location/HealthcareService or Device", description=( "A Person, Location/HealthcareService or Device that is participating " "in the appointment." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "RelatedPerson", "Device", "HealthcareService", "Location", ], }, ) required: fhirtypes.CodeType | None = Field( default=None, alias="required", title="required | optional | information-only", description=( "Is this participant required to be present at the meeting. This covers" " a use-case where 2 doctors need to meet to discuss the results for a " "specific patient, and the patient is not required to be present." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["required", "optional", "information-only"], }, ) required__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_required", title="Extension field for ``required``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="accepted | declined | tentative | needs-action", description="Participation status of the actor.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["accepted", "declined", "tentative", "needs-action"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Role of participant in the appointment", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AppointmentParticipant`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "actor", "required", "status", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AppointmentParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "actor", "required"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/appointmentresponse.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/AppointmentResponse Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class AppointmentResponse(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection. """ __resource_type__ = "AppointmentResponse" actor: fhirtypes.ReferenceType | None = Field( default=None, alias="actor", title="Person, Location/HealthcareService or Device", description=( "A Person, Location/HealthcareService or Device that is participating " "in the appointment." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "RelatedPerson", "Device", "HealthcareService", "Location", ], }, ) appointment: fhirtypes.ReferenceType = Field( default=..., alias="appointment", title="Appointment this response relates to", description="Appointment that this response is replying to.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Appointment"], }, ) comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Additional comments", description="Additional comments about the appointment.", json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) end: fhirtypes.InstantType | None = Field( default=None, alias="end", title="Time from appointment, or requested new end time", description=( "This may be either the same as the appointment request to confirm the " "details of the appointment, or alternately a new time to request a re-" "negotiation of the end time." ), json_schema_extra={ "element_property": True, }, ) end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_end", title="Extension field for ``end``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Ids for this item", description=( "This records identifiers associated with this appointment response " "concern that are defined by business processes and/ or used to refer " "to it when a direct URL reference to the resource itself is not " "appropriate." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) participantStatus: fhirtypes.CodeType | None = Field( default=None, alias="participantStatus", title=( "accepted | declined | tentative | in-process | completed | needs-" "action | entered-in-error" ), description=( "Participation status of the participant. When the status is declined " "or tentative if the start/end times are different to the appointment, " "then these times should be interpreted as a requested time change. " "When the status is accepted, the times can either be the time of the " "appointment (as a confirmation of the time) or can be empty." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "accepted", "declined", "tentative", "in-process", "completed", "needs-action", "entered-in-error", ], }, ) participantStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_participantStatus", title="Extension field for ``participantStatus``.", ) participantType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="participantType", title="Role of participant in the appointment", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) start: fhirtypes.InstantType | None = Field( default=None, alias="start", title="Time from appointment, or requested new start time", description=( "Date/Time that the appointment is to take place, or requested new " "start time." ), json_schema_extra={ "element_property": True, }, ) start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_start", title="Extension field for ``start``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AppointmentResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "appointment", "start", "end", "participantType", "actor", "participantStatus", "comment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AppointmentResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "appointment", "participantType", "actor", "participantStatus", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("participantStatus", "participantStatus__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/attachment.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Attachment Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Attachment(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Content in a format defined elsewhere. For referring to data content defined in other formats. """ __resource_type__ = "Attachment" contentType: fhirtypes.CodeType | None = Field( default=None, alias="contentType", title="Mime type of the content, with charset etc.", description=( "Identifies the type of the data in the attachment and allows a method " "to be chosen to interpret or render the data. Includes mime type " "parameters such as charset where appropriate." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contentType", title="Extension field for ``contentType``." ) creation: fhirtypes.DateTimeType | None = Field( default=None, alias="creation", title="Date attachment was first created", description="The date that the attachment was first created.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) creation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_creation", title="Extension field for ``creation``." ) data: fhirtypes.Base64BinaryType | None = Field( default=None, alias="data", title="Data inline, base64ed", description=( "The actual data of the attachment - a sequence of bytes. In XML, " "represented using base64." ), json_schema_extra={ "element_property": True, }, ) data__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_data", title="Extension field for ``data``." ) hash: fhirtypes.Base64BinaryType | None = Field( default=None, alias="hash", title="Hash of the data (sha-1, base64ed)", description="The calculated hash of the data using SHA-1. Represented using base64.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) hash__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_hash", title="Extension field for ``hash``." ) language: fhirtypes.CodeType | None = Field( default=None, alias="language", title="Human language of the content (BCP-47)", description=( "The human language of the content. The value can be any valid value " "according to BCP 47." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) size: fhirtypes.UnsignedIntType | None = Field( default=None, alias="size", title="Number of bytes of content (if url provided)", description=( "The number of bytes of data that make up this attachment (before " "base64 encoding, if that is done)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) size__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_size", title="Extension field for ``size``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Label to display in place of the data", description="A label or set of text to display in place of the data.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Uri where the data can be found", description="An alternative location where the data can be accessed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Attachment`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "contentType", "language", "data", "url", "size", "hash", "title", "creation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Attachment`` according to specification, with preserving the original sequence order. """ return ["contentType", "language", "url", "size", "hash", "title", "creation"] ================================================ FILE: fhir/resources/STU3/auditevent.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/AuditEvent Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class AuditEvent(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Event record kept for security purposes. A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. """ __resource_type__ = "AuditEvent" action: fhirtypes.CodeType | None = Field( default=None, alias="action", title="Type of action performed during the event", description=( "Indicator for type of action performed during the event that generated" " the audit." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) action__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_action", title="Extension field for ``action``." ) agent: typing.List[fhirtypes.AuditEventAgentType] = Field( default=..., alias="agent", title="Actor involved in the event", description=( "An actor taking an active role in the event or activity that is " "logged." ), json_schema_extra={ "element_property": True, }, ) entity: typing.List[fhirtypes.AuditEventEntityType] | None = Field( default=None, alias="entity", title="Data or objects used", description="Specific instances of data or objects that have been accessed.", json_schema_extra={ "element_property": True, }, ) outcome: fhirtypes.CodeType | None = Field( default=None, alias="outcome", title="Whether the event succeeded or failed", description="Indicates whether the event succeeded or failed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) outcome__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_outcome", title="Extension field for ``outcome``." ) outcomeDesc: fhirtypes.StringType | None = Field( default=None, alias="outcomeDesc", title="Description of the event outcome", description="A free text description of the outcome of the event.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) outcomeDesc__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_outcomeDesc", title="Extension field for ``outcomeDesc``." ) purposeOfEvent: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="purposeOfEvent", title="The purposeOfUse of the event", description=( "The purposeOfUse (reason) that was used during the event being " "recorded." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) recorded: fhirtypes.InstantType | None = Field( default=None, alias="recorded", title="Time when the event occurred on source", description="The time when the event occurred on the source.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) recorded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recorded", title="Extension field for ``recorded``." ) source: fhirtypes.AuditEventSourceType = Field( default=..., alias="source", title="Audit Event Reporter", description="The system that is reporting the event.", json_schema_extra={ "element_property": True, }, ) subtype: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="subtype", title="More specific type/id for the event", description="Identifier for the category of event.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodingType = Field( default=..., alias="type", title="Type/identifier of event", description=( "Identifier for a family of the event. For example, a menu item, " "program, rule, policy, function code, application name or URL. It " "identifies the performed function." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AuditEvent`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "type", "subtype", "action", "recorded", "outcome", "outcomeDesc", "purposeOfEvent", "agent", "source", "entity", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AuditEvent`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "type", "subtype", "action", "recorded", "outcome", "outcomeDesc", "purposeOfEvent", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("recorded", "recorded__ext")] return required_fields class AuditEventAgent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Actor involved in the event. An actor taking an active role in the event or activity that is logged. """ __resource_type__ = "AuditEventAgent" altId: fhirtypes.StringType | None = Field( default=None, alias="altId", title="Alternative User id e.g. authentication", description=( "Alternative agent Identifier. For a human, this should be a user " "identifier text string from authentication system. This identifier " "would be one known to a common authentication system (e.g. single " "sign-on), if available." ), json_schema_extra={ "element_property": True, }, ) altId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_altId", title="Extension field for ``altId``." ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where", description="Where the event occurred.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) media: fhirtypes.CodingType | None = Field( default=None, alias="media", title="Type of media", description=( "Type of media involved. Used when the event is about " "exporting/importing onto media." ), json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Human-meaningful name for the agent", description=None, json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) network: fhirtypes.AuditEventAgentNetworkType | None = Field( default=None, alias="network", title="Logical network location for application activity", description=( "Logical network location for application activity, if the activity has" " a network location." ), json_schema_extra={ "element_property": True, }, ) policy: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="policy", title="Policy that authorized event", description=( "The policy or plan that authorized the activity being recorded. " "Typically, a single activity may have multiple applicable policies, " "such as patient consent, guarantor funding, etc. The policy would also" " indicate the security token used." ), json_schema_extra={ "element_property": True, }, ) policy__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_policy", title="Extension field for ``policy``." ) purposeOfUse: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="purposeOfUse", title="Reason given for this user", description=( "The reason (purpose of use), specific to this agent, that was used " "during the event being recorded." ), json_schema_extra={ "element_property": True, }, ) reference: fhirtypes.ReferenceType | None = Field( default=None, alias="reference", title="Direct reference to resource", description="Direct reference to a resource that identifies the agent.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Organization", "Device", "Patient", "RelatedPerson", ], }, ) requestor: bool | None = Field( default=None, alias="requestor", title="Whether user is initiator", description=( "Indicator that the user is or is not the requestor, or initiator, for " "the event being audited." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) requestor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requestor", title="Extension field for ``requestor``." ) role: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="role", title="Agent role in the event", description=( "The security role that the user was acting under, that come from local" " codes defined by the access control security system (e.g. RBAC, ABAC)" " used in the local context." ), json_schema_extra={ "element_property": True, }, ) userId: fhirtypes.IdentifierType | None = Field( default=None, alias="userId", title="Unique identifier for the user", description="Unique identifier for the user actively participating in the event.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AuditEventAgent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "role", "reference", "userId", "altId", "name", "requestor", "location", "policy", "media", "network", "purposeOfUse", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AuditEventAgent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "reference", "userId"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("requestor", "requestor__ext")] return required_fields class AuditEventAgentNetwork(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Logical network location for application activity. Logical network location for application activity, if the activity has a network location. """ __resource_type__ = "AuditEventAgentNetwork" address: fhirtypes.StringType | None = Field( default=None, alias="address", title="Identifier for the network access point of the user device", description=( "An identifier for the network access point of the user device for the " "audit event." ), json_schema_extra={ "element_property": True, }, ) address__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_address", title="Extension field for ``address``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="The type of network access point", description=( "An identifier for the type of network access point that originated the" " audit event." ), json_schema_extra={ "element_property": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AuditEventAgentNetwork`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "address", "type"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AuditEventAgentNetwork`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class AuditEventEntity(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Data or objects used. Specific instances of data or objects that have been accessed. """ __resource_type__ = "AuditEventEntity" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Descriptive text", description="Text that describes the entity in more detail.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) detail: typing.List[fhirtypes.AuditEventEntityDetailType] | None = Field( default=None, alias="detail", title="Additional Information about the entity", description=( "Tagged value pairs for conveying additional information about the " "entity." ), json_schema_extra={ "element_property": True, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Specific instance of object", description=( "Identifies a specific instance of the entity. The reference should " "always be version specific." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lifecycle: fhirtypes.CodingType | None = Field( default=None, alias="lifecycle", title="Life-cycle stage for the entity", description="Identifier for the data life-cycle stage for the entity.", json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Descriptor for entity", description="A name of the entity in the audit event.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) query: fhirtypes.Base64BinaryType | None = Field( default=None, alias="query", title="Query parameters", description="The query parameters for a query-type entities.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) query__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_query", title="Extension field for ``query``." ) reference: fhirtypes.ReferenceType | None = Field( default=None, alias="reference", title="Specific instance of resource", description=( "Identifies a specific instance of the entity. The reference should be " "version specific." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) role: fhirtypes.CodingType | None = Field( default=None, alias="role", title="What role the entity played", description=( "Code representing the role the entity played in the event being " "audited." ), json_schema_extra={ "element_property": True, }, ) securityLabel: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="securityLabel", title="Security labels on the entity", description="Security labels for the identified entity.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodingType | None = Field( default=None, alias="type", title="Type of entity involved", description="The type of the object that was involved in this audit event.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AuditEventEntity`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "reference", "type", "role", "lifecycle", "securityLabel", "name", "description", "query", "detail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AuditEventEntity`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "identifier", "reference", "name", "query"] class AuditEventEntityDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional Information about the entity. Tagged value pairs for conveying additional information about the entity. """ __resource_type__ = "AuditEventEntityDetail" type: fhirtypes.StringType | None = Field( default=None, alias="type", title="Name of the property", description="The type of extra detail provided in the value.", json_schema_extra={ "element_property": True, "element_required": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) value: fhirtypes.Base64BinaryType | None = Field( default=None, alias="value", title="Property value", description="The details, base64 encoded. Used to carry bulk information.", json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AuditEventEntityDetail`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AuditEventEntityDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext"), ("value", "value__ext")] return required_fields class AuditEventSource(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Audit Event Reporter. The system that is reporting the event. """ __resource_type__ = "AuditEventSource" identifier: fhirtypes.IdentifierType = Field( default=..., alias="identifier", title="The identity of source detecting the event", description="Identifier of the source where the event was detected.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) site: fhirtypes.StringType | None = Field( default=None, alias="site", title="Logical source location within the enterprise", description=( "Logical source location within the healthcare enterprise network. For" " example, a hospital or other provider location within a multi-entity " "provider group." ), json_schema_extra={ "element_property": True, }, ) site__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_site", title="Extension field for ``site``." ) type: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="type", title="The type of source where event originated", description="Code specifying the type of source where event originated.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AuditEventSource`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "site", "identifier", "type"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AuditEventSource`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "identifier"] ================================================ FILE: fhir/resources/STU3/backboneelement.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/BackboneElement Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class BackboneElement(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Base for elements defined inside a resource. Base definition for all elements that are defined inside a resource - but not those in a data type. """ __resource_type__ = "BackboneElement" modifierExtension: typing.List[fhirtypes.ExtensionType] | None = Field( default=None, alias="modifierExtension", title="Extensions that cannot be ignored", description=( "May be used to represent additional information that is not part of " "the basic definition of the element, and that modifies the " "understanding of the element that contains it. Usually modifier " "elements provide negation or qualification. In order to make the use " "of extensions safe and manageable, there is a strict set of governance" " applied to the definition and use of extensions. Though any " "implementer is allowed to define an extension, there is a set of " "requirements that SHALL be met as part of the definition of the " "extension. Applications processing a resource are required to check " "for modifier extensions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BackboneElement`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BackboneElement`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/basic.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Basic Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class Basic(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Resource for non-supported content. Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification. """ __resource_type__ = "Basic" author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="Who created", description="Indicates who was responsible for creating the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "Patient", "RelatedPerson"], }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Kind of Resource", description=( "Identifies the 'type' of resource - equivalent to the resource name " "for other resources." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) created: fhirtypes.DateType | None = Field( default=None, alias="created", title="When created", description="Identifies when the resource was first created.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description=( "Identifier assigned to the resource for business purposes, outside the" " context of FHIR." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Identifies the focus of this resource", description=( "Identifies the patient, practitioner, device or any other resource " 'that is the "focus" of this resource.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Basic`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "code", "subject", "created", "author", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Basic`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "code", "subject", "created", "author", ] ================================================ FILE: fhir/resources/STU3/binary.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Binary Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import fhirtypes, resource class Binary(resource.Resource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Pure binary content defined by a format other than FHIR. A binary resource can contain any content, whether text, image, pdf, zip archive, etc. """ __resource_type__ = "Binary" content: fhirtypes.Base64BinaryType | None = Field( default=None, alias="content", title="The actual content", description="The actual content, base64 encoded.", json_schema_extra={ "element_property": True, "element_required": True, }, ) content__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_content", title="Extension field for ``content``." ) contentType: fhirtypes.CodeType | None = Field( default=None, alias="contentType", title="MimeType of the binary content", description=( "MimeType of the binary content represented as a standard MimeType (BCP" " 13)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contentType", title="Extension field for ``contentType``." ) securityContext: fhirtypes.ReferenceType | None = Field( default=None, alias="securityContext", title="Access Control Management", description=( "Treat this binary as if it was this other resource for access control " "purposes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Binary`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "contentType", "securityContext", "content", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Binary`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "contentType", "securityContext"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("content", "content__ext"), ("contentType", "contentType__ext"), ] return required_fields ================================================ FILE: fhir/resources/STU3/bodysite.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/BodySite Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class BodySite(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specific and identified anatomical location. Record details about the anatomical location of a specimen or body part. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. """ __resource_type__ = "BodySite" active: bool | None = Field( default=None, alias="active", title="Whether this body site record is in active use", description="Whether this body site is in active use.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Named anatomical location", description="Named anatomical location - ideally coded where possible.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Anatomical location description", description="A summary, charactarization or explanation of the anatomic location.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Bodysite identifier", description="Identifier for this instance of the anatomical location.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) image: typing.List[fhirtypes.AttachmentType] | None = Field( default=None, alias="image", title="Attached images", description="Image or images used to identify a location.", json_schema_extra={ "element_property": True, }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Who this is about", description="The person to which the body site belongs.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) qualifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="qualifier", title="Modification to location code", description=( "Qualifier to refine the anatomical location. These include qualifiers" " for laterality, relative location, directionality, number, and plane." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BodySite`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "code", "qualifier", "description", "image", "patient", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BodySite`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "active", "code", "description", "patient", ] ================================================ FILE: fhir/resources/STU3/bundle.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Bundle Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, fhirtypes, resource class Bundle(resource.Resource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contains a collection of resources. A container for a collection of resources. """ __resource_type__ = "Bundle" entry: typing.List[fhirtypes.BundleEntryType] | None = Field( default=None, alias="entry", title="Entry in the bundle - will have a resource, or information", description=( "An entry in a bundle resource - will either contain a resource, or " "information about a resource (transactions and history only)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Persistent identifier for the bundle", description=( "A persistent identifier for the batch that won't change as a batch is " "copied from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) link: typing.List[fhirtypes.BundleLinkType] | None = Field( default=None, alias="link", title="Links related to this Bundle", description="A series of links that provide context to this bundle.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) signature: fhirtypes.SignatureType | None = Field( default=None, alias="signature", title="Digital Signature", description="Digital Signature - base64 encoded. XML-DSIg or a JWT.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) total: fhirtypes.UnsignedIntType | None = Field( default=None, alias="total", title="If search, the total number of matches", description=( "If a set of search matches, this is the total number of matches for " "the search (as opposed to the number of results in this bundle)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) total__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_total", title="Extension field for ``total``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "document | message | transaction | transaction-response | batch | " "batch-response | history | searchset | collection" ), description="Indicates the purpose of this bundle - how it was intended to be used.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "document", "message", "transaction", "transaction-response", "batch", "batch-response", "history", "searchset", "collection", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Bundle`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "identifier", "type", "total", "link", "entry", "signature", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Bundle`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "type", "total", "link", "entry", "signature", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields class BundleEntry(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Entry in the bundle - will have a resource, or information. An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only). """ __resource_type__ = "BundleEntry" fullUrl: fhirtypes.UriType | None = Field( default=None, alias="fullUrl", title="Absolute URL for resource (server address, or UUID/OID)", description=( "The Absolute URL for the resource. The fullUrl SHALL not disagree " "with the id in the resource. The fullUrl is a version independent " "reference to the resource. The fullUrl element SHALL have a value " "except that: * fullUrl can be empty on a POST (although it does not " "need to when specifying a temporary id for reference in the bundle) * " "Results from operations might involve resources that are not " "identified." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) fullUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fullUrl", title="Extension field for ``fullUrl``." ) link: typing.List[fhirtypes.BundleLinkType] | None = Field( default=None, alias="link", title="Links related to this entry", description="A series of links that provide context to this entry.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) request: fhirtypes.BundleEntryRequestType | None = Field( default=None, alias="request", title="Transaction Related Information", description=( "Additional information about how this entry should be processed as " "part of a transaction." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) resource: fhirtypes.ResourceType | None = Field( default=None, alias="resource", title="A resource in the bundle", description="The Resources for the entry.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) response: fhirtypes.BundleEntryResponseType | None = Field( default=None, alias="response", title="Transaction Related Information", description=( "Additional information about how this entry should be processed as " "part of a transaction." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) search: fhirtypes.BundleEntrySearchType | None = Field( default=None, alias="search", title="Search related information", description=( "Information about the search process that lead to the creation of this" " entry." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BundleEntry`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "link", "fullUrl", "resource", "search", "request", "response", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BundleEntry`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "link", "fullUrl", "resource", "search", "request", "response", ] class BundleEntryRequest(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Transaction Related Information. Additional information about how this entry should be processed as part of a transaction. """ __resource_type__ = "BundleEntryRequest" ifMatch: fhirtypes.StringType | None = Field( default=None, alias="ifMatch", title="For managing update contention", description=( "Only perform the operation if the Etag value matches. For more " 'information, see the API section ["Managing Resource ' 'Contention"](http.html#concurrency).' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ifMatch__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_ifMatch", title="Extension field for ``ifMatch``." ) ifModifiedSince: fhirtypes.InstantType | None = Field( default=None, alias="ifModifiedSince", title="For managing update contention", description=( "Only perform the operation if the last updated date matches. See the " 'API documentation for ["Conditional Read"](http.html#cread).' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ifModifiedSince__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_ifModifiedSince", title="Extension field for ``ifModifiedSince``.", ) ifNoneExist: fhirtypes.StringType | None = Field( default=None, alias="ifNoneExist", title="For conditional creates", description=( "Instruct the server not to perform the create if a specified resource " "already exists. For further information, see the API documentation for" ' ["Conditional Create"](http.html#ccreate). This is just the query ' 'portion of the URL - what follows the "?" (not including the "?").' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ifNoneExist__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_ifNoneExist", title="Extension field for ``ifNoneExist``." ) ifNoneMatch: fhirtypes.StringType | None = Field( default=None, alias="ifNoneMatch", title="For managing cache currency", description=( "If the ETag values match, return a 304 Not Modified status. See the " 'API documentation for ["Conditional Read"](http.html#cread).' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ifNoneMatch__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_ifNoneMatch", title="Extension field for ``ifNoneMatch``." ) method: fhirtypes.CodeType | None = Field( default=None, alias="method", title="GET | POST | PUT | DELETE", description=( "The HTTP verb for this entry in either a change history, or a " "transaction/ transaction response." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["GET", "POST", "PUT", "DELETE"], }, ) method__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_method", title="Extension field for ``method``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="URL for HTTP equivalent of this entry", description=( "The URL for this entry, relative to the root (the address to which the" " request is posted)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BundleEntryRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "method", "url", "ifNoneMatch", "ifModifiedSince", "ifMatch", "ifNoneExist", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BundleEntryRequest`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "method", "url", "ifNoneMatch", "ifModifiedSince", "ifMatch", "ifNoneExist", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("method", "method__ext"), ("url", "url__ext")] return required_fields class BundleEntryResponse(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Transaction Related Information. Additional information about how this entry should be processed as part of a transaction. """ __resource_type__ = "BundleEntryResponse" etag: fhirtypes.StringType | None = Field( default=None, alias="etag", title="The etag for the resource (if relevant)", description=( "The etag for the resource, it the operation for the entry produced a " "versioned resource (see [Resource Metadata and " "Versioning](http.html#versioning) and [Managing Resource " "Contention](http.html#concurrency))." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) etag__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_etag", title="Extension field for ``etag``." ) lastModified: fhirtypes.InstantType | None = Field( default=None, alias="lastModified", title="Server's date time modified", description="The date/time that the resource was modified on the server.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastModified__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastModified", title="Extension field for ``lastModified``.", ) location: fhirtypes.UriType | None = Field( default=None, alias="location", title="The location, if the operation returns a location", description="The location header created by processing this operation.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) location__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_location", title="Extension field for ``location``." ) outcome: fhirtypes.ResourceType | None = Field( default=None, alias="outcome", title="OperationOutcome with hints and warnings (for batch/transaction)", description=( "An OperationOutcome containing hints and warnings produced as part of " "processing this entry in a batch or transaction." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.StringType | None = Field( default=None, alias="status", title="Status response code (text optional)", description=( "The status code returned by processing this entry. The status SHALL " "start with a 3 digit HTTP code (e.g. 404) and may contain the standard" " HTTP description associated with the status code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BundleEntryResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "status", "location", "etag", "lastModified", "outcome", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BundleEntryResponse`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "status", "location", "etag", "lastModified", "outcome", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class BundleEntrySearch(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Search related information. Information about the search process that lead to the creation of this entry. """ __resource_type__ = "BundleEntrySearch" mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="match | include | outcome - why this is in the result set", description=( "Why this entry is in the result set - whether it's included as a match" " or because of an _include requirement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["match", "include", "outcome"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) score: fhirtypes.DecimalType | None = Field( default=None, alias="score", title="Search ranking (between 0 and 1)", description="When searching, the server's search ranking score for the entry.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) score__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_score", title="Extension field for ``score``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BundleEntrySearch`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "mode", "score"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BundleEntrySearch`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "mode", "score"] class BundleLink(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Links related to this Bundle. A series of links that provide context to this bundle. """ __resource_type__ = "BundleLink" relation: fhirtypes.StringType | None = Field( default=None, alias="relation", title=( "See http://www.iana.org/assignments/link-relations/link-" "relations.xhtml#link-relations-1" ), description=( "A name which details the functional use for this link - see " "[http://www.iana.org/assignments/link-relations/link-" "relations.xhtml#link-" "relations-1](http://www.iana.org/assignments/link-relations/link-" "relations.xhtml#link-relations-1)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) relation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_relation", title="Extension field for ``relation``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Reference details for the link", description="The reference details for the link.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BundleLink`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "relation", "url"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BundleLink`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "relation", "url"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("relation", "relation__ext"), ("url", "url__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/capabilitystatement.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CapabilityStatement Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class CapabilityStatement(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A statement of system capabilities. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. """ __resource_type__ = "CapabilityStatement" acceptUnknown: fhirtypes.CodeType | None = Field( default=None, alias="acceptUnknown", title="no | extensions | elements | both", description=( "A code that indicates whether the application accepts unknown elements" " or extensions when reading resources." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["no", "extensions", "elements", "both"], }, ) acceptUnknown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_acceptUnknown", title="Extension field for ``acceptUnknown``.", ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the capability statement and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the capability statement." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date this was last changed", description=( "The date (and optionally time) when the capability statement was " "published. The date must change if and when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the capability " "statement changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the capability statement", description=( "A free text natural language description of the capability statement " "from a consumer's perspective. Typically, this is used when the " "capability statement describes a desired rather than an actual " "solution, for example as a formal expression of requirements as part " "of an RFP." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) document: typing.List[fhirtypes.CapabilityStatementDocumentType] | None = Field( default=None, alias="document", title="Document definition", description="A document definition.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A boolean value to indicate that this capability statement is authored" " for testing purposes (or education/evaluation/marketing), and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) fhirVersion: fhirtypes.IdType | None = Field( default=None, alias="fhirVersion", title="FHIR Version the system uses", description=( "The version of the FHIR specification on which this capability " "statement is based." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) fhirVersion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fhirVersion", title="Extension field for ``fhirVersion``." ) format: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="format", title="formats supported (xml | json | ttl | mime type)", description=( "A list of the formats supported by this implementation using their " "content types." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["formats", "json", "ttl", "mime"], }, ) format__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_format", title="Extension field for ``format``." ) implementation: fhirtypes.CapabilityStatementImplementationType | None = Field( default=None, alias="implementation", title="If this describes a specific instance", description=( "Identifies a specific implementation instance that is described by the" " capability statement - i.e. a particular installation, rather than " "the capabilities of a software program." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) implementationGuide: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="implementationGuide", title="Implementation guides supported", description=( "A list of implementation guides that the server does (or should) " "support in their entirety." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) implementationGuide__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_implementationGuide", title="Extension field for ``implementationGuide``.", ) instantiates: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="instantiates", title="Canonical URL of another capability statement this implements", description=( "Reference to a canonical URL of another CapabilityStatement that this " "software implements or uses. This capability statement is a published " "API description that corresponds to a business service. The rest of " "the capability statement does not need to repeat the details of the " "referenced resource, but can do so." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiates__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiates", title="Extension field for ``instantiates``.", ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for capability statement (if applicable)", description=( "A legal or geographic region in which the capability statement is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title="instance | capability | requirements", description=( "The way that this statement is intended to be used, to describe an " "actual running instance of software, a particular product (kind not " "instance of software) or a class of implementation (e.g. a desired " "purchase)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["instance", "capability", "requirements"], }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) messaging: typing.List[fhirtypes.CapabilityStatementMessagingType] | None = Field( default=None, alias="messaging", title="If messaging is supported", description="A description of the messaging capabilities of the solution.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this capability statement (computer friendly)", description=( "A natural language name identifying the capability statement. This " "name should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) patchFormat: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="patchFormat", title="Patch formats supported", description=( "A list of the patch formats supported by this implementation using " "their content types." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patchFormat__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_patchFormat", title="Extension field for ``patchFormat``." ) profile: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="profile", title="Profiles for use cases supported", description=( "A list of profiles that represent different use cases supported by the" ' system. For a server, "supported by the system" means the system ' "hosts/produces a set of resources that are conformant to a particular " "profile, and allows clients that use its services to search using this" " profile and to find appropriate data. For a client, it means the " "system will search by this profile and process data according to the " "guidance implicit in the profile. See further discussion in [Using " "Profiles](profiling.html#profile-uses)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the individual or organization that published the " "capability statement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this capability statement is defined", description=( "Explaination of why this capability statement is needed and why it has" " been designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) rest: typing.List[fhirtypes.CapabilityStatementRestType] | None = Field( default=None, alias="rest", title="If the endpoint is a RESTful one", description="A definition of the restful capabilities of the solution, if any.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) software: fhirtypes.CapabilityStatementSoftwareType | None = Field( default=None, alias="software", title="Software that is covered by this capability statement", description=( "Software that is covered by this capability statement. It is used " "when the capability statement describes the capabilities of a " "particular software version, independent of an installation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this capability statement. Enables tracking the life-" "cycle of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this capability statement (human friendly)", description=( "A short, descriptive, user-friendly title for the capability " "statement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Logical URI to reference this capability statement (globally unique)", description=( "An absolute URI that is used to identify this capability statement " "when it is referenced in a specification, model, design or an " "instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD " "be an address at which this capability statement is (or will be) " "published. The URL SHOULD include the major version of the capability " "statement. For more information see [Technical and Business " "Versions](resource.html#versions)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Context the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching for appropriate capability statement instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the capability statement", description=( "The identifier that is used to identify this version of the capability" " statement when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the capability " "statement author and is not expected to be globally unique. For " "example, it might be a timestamp (e.g. yyyymmdd) if a managed version " "is not available. There is also no expectation that versions can be " "placed in a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatement`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "kind", "instantiates", "software", "implementation", "fhirVersion", "acceptUnknown", "format", "patchFormat", "implementationGuide", "profile", "rest", "messaging", "document", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatement`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "kind", "instantiates", "software", "implementation", "fhirVersion", "acceptUnknown", "format", "patchFormat", "implementationGuide", "profile", "rest", "messaging", "document", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("acceptUnknown", "acceptUnknown__ext"), ("date", "date__ext"), ("fhirVersion", "fhirVersion__ext"), ("format", "format__ext"), ("kind", "kind__ext"), ("status", "status__ext"), ] return required_fields class CapabilityStatementDocument(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Document definition. A document definition. """ __resource_type__ = "CapabilityStatementDocument" documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Description of document support", description=( "A description of how the application supports or uses the specified " "document profile. For example, when documents are created, what " "action is taken with consumed documents, etc." ), json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="producer | consumer", description=( "Mode of this document declaration - whether an application is a " "producer or consumer." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["producer", "consumer"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) profile: fhirtypes.ReferenceType = Field( default=..., alias="profile", title="Constraint on a resource used in the document", description="A constraint on a resource used in the document.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementDocument`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "mode", "documentation", "profile", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementDocument`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "profile"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("mode", "mode__ext")] return required_fields class CapabilityStatementImplementation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. If this describes a specific instance. Identifies a specific implementation instance that is described by the capability statement - i.e. a particular installation, rather than the capabilities of a software program. """ __resource_type__ = "CapabilityStatementImplementation" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Describes this specific instance", description=( "Information about the specific installation that this capability " "statement relates to." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Base URL for the installation", description=( "An absolute base URL for the implementation. This forms the base for " "REST interfaces as well as the mailbox and document interfaces." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementImplementation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "description", "url"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementImplementation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "description", "url"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("description", "description__ext")] return required_fields class CapabilityStatementMessaging(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. If messaging is supported. A description of the messaging capabilities of the solution. """ __resource_type__ = "CapabilityStatementMessaging" documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Messaging interface behavior details", description=( "Documentation about the system's messaging capabilities for this " "endpoint not otherwise documented by the capability statement. For " "example, the process for becoming an authorized messaging exchange " "partner." ), json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) endpoint: typing.List[ fhirtypes.CapabilityStatementMessagingEndpointType ] | None = Field( default=None, alias="endpoint", title="Where messages should be sent", description=( "An endpoint (network accessible address) to which messages and/or " "replies are to be sent." ), json_schema_extra={ "element_property": True, }, ) event: typing.List[fhirtypes.CapabilityStatementMessagingEventType] | None = Field( default=None, alias="event", title="Declare support for this event", description=( "A description of the solution's support for an event at this end-" "point." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reliableCache: fhirtypes.UnsignedIntType | None = Field( default=None, alias="reliableCache", title="Reliable Message Cache Length (min)", description=( "Length if the receiver's reliable messaging cache in minutes (if a " "receiver) or how long the cache length on the receiver should be (if a" " sender)." ), json_schema_extra={ "element_property": True, }, ) reliableCache__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reliableCache", title="Extension field for ``reliableCache``.", ) supportedMessage: typing.List[ fhirtypes.CapabilityStatementMessagingSupportedMessageType ] | None = Field( default=None, alias="supportedMessage", title="Messages supported by this system", description=( "References to message definitions for messages this system can send or" " receive." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementMessaging`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "endpoint", "reliableCache", "documentation", "supportedMessage", "event", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementMessaging`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "supportedMessage", "event"] class CapabilityStatementMessagingEndpoint(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Where messages should be sent. An endpoint (network accessible address) to which messages and/or replies are to be sent. """ __resource_type__ = "CapabilityStatementMessagingEndpoint" address: fhirtypes.UriType | None = Field( default=None, alias="address", title="Network address or identifier of the end-point", description=( "The network address of the end-point. For solutions that do not use " "network addresses for routing, it can be just an identifier." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) address__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_address", title="Extension field for ``address``." ) protocol: fhirtypes.CodingType = Field( default=..., alias="protocol", title="http | ftp | mllp +", description=( "A list of the messaging transport protocol(s) identifiers, supported " "by this endpoint." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementMessagingEndpoint`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "protocol", "address"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementMessagingEndpoint`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("address", "address__ext")] return required_fields class CapabilityStatementMessagingEvent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Declare support for this event. A description of the solution's support for an event at this end-point. """ __resource_type__ = "CapabilityStatementMessagingEvent" category: fhirtypes.CodeType | None = Field( default=None, alias="category", title="Consequence | Currency | Notification", description="The impact of the content of the message.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["Consequence", "Currency", "Notification"], }, ) category__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_category", title="Extension field for ``category``." ) code: fhirtypes.CodingType = Field( default=..., alias="code", title="Event type", description="A coded identifier of a supported messaging event.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Endpoint-specific event documentation", description=( "Guidance on how this event is handled, such as internal system trigger" " points, business rules, etc." ), json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) focus: fhirtypes.CodeType | None = Field( default=None, alias="focus", title="Resource that's focus of message", description=( "A resource associated with the event. This is the resource that " "defines the event." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) focus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_focus", title="Extension field for ``focus``." ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="sender | receiver", description=( "The mode of this event declaration - whether an application is a " "sender or receiver." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["sender", "receiver"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) request: fhirtypes.ReferenceType = Field( default=..., alias="request", title="Profile that describes the request", description="Information about the request for this event.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) response: fhirtypes.ReferenceType = Field( default=..., alias="response", title="Profile that describes the response", description="Information about the response for this event.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementMessagingEvent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "category", "mode", "focus", "request", "response", "documentation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementMessagingEvent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "request", "response"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("focus", "focus__ext"), ("mode", "mode__ext")] return required_fields class CapabilityStatementMessagingSupportedMessage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Messages supported by this system. References to message definitions for messages this system can send or receive. """ __resource_type__ = "CapabilityStatementMessagingSupportedMessage" definition: fhirtypes.ReferenceType = Field( default=..., alias="definition", title="Message supported by this system", description=( "Points to a message definition that identifies the messaging event, " "message structure, allowed responses, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MessageDefinition"], }, ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="sender | receiver", description=( "The mode of this event declaration - whether application is sender or " "receiver." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["sender", "receiver"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementMessagingSupportedMessage`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "mode", "definition"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementMessagingSupportedMessage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "mode", "definition"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("mode", "mode__ext")] return required_fields class CapabilityStatementRest(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. If the endpoint is a RESTful one. A definition of the restful capabilities of the solution, if any. """ __resource_type__ = "CapabilityStatementRest" compartment: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="compartment", title="Compartments served/used by system", description=( "An absolute URI which is a reference to the definition of a " "compartment that the system supports. The reference is to a " "CompartmentDefinition resource by its canonical URL ." ), json_schema_extra={ "element_property": True, }, ) compartment__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_compartment", title="Extension field for ``compartment``." ) documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="General description of implementation", description=( "Information about the system's restful capabilities that apply across " "all applications, such as security." ), json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) interaction: typing.List[ fhirtypes.CapabilityStatementRestInteractionType ] | None = Field( default=None, alias="interaction", title="What operations are supported?", description="A specification of restful operations supported by the system.", json_schema_extra={ "element_property": True, }, ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="client | server", description=( "Identifies whether this portion of the statement is describing the " "ability to initiate or receive restful operations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["client", "server"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) operation: typing.List[ fhirtypes.CapabilityStatementRestOperationType ] | None = Field( default=None, alias="operation", title="Definition of an operation or a custom query", description=( "Definition of an operation or a named query together with its " "parameters and their meaning and type." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) resource: typing.List[fhirtypes.CapabilityStatementRestResourceType] | None = Field( default=None, alias="resource", title="Resource served on the REST interface", description=( "A specification of the restful capabilities of the solution for a " "specific resource type." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) searchParam: typing.List[ fhirtypes.CapabilityStatementRestResourceSearchParamType ] | None = Field( default=None, alias="searchParam", title="Search parameters for searching all resources", description=( "Search parameters that are supported for searching all resources for " "implementations to support and/or make use of - either references to " "ones defined in the specification, or additional ones defined for/by " "the implementation." ), json_schema_extra={ "element_property": True, }, ) security: fhirtypes.CapabilityStatementRestSecurityType | None = Field( default=None, alias="security", title="Information about security of implementation", description=( "Information about security implementation from an interface " "perspective - what a client needs to know." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementRest`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "mode", "documentation", "security", "resource", "interaction", "searchParam", "operation", "compartment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementRest`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "mode", "security", "resource", "operation"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("mode", "mode__ext")] return required_fields class CapabilityStatementRestInteraction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What operations are supported?. A specification of restful operations supported by the system. """ __resource_type__ = "CapabilityStatementRestInteraction" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="transaction | batch | search-system | history-system", description="A coded identifier of the operation, supported by the system.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["transaction", "batch", "search-system", "history-system"], }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Anything special about operation behavior", description=( "Guidance specific to the implementation of this operation, such as " "limitations on the kind of transactions allowed, or information about " "system wide search is implemented." ), json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementRestInteraction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "documentation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestInteraction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields class CapabilityStatementRestOperation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of an operation or a custom query. Definition of an operation or a named query together with its parameters and their meaning and type. """ __resource_type__ = "CapabilityStatementRestOperation" definition: fhirtypes.ReferenceType = Field( default=..., alias="definition", title="The defined operation/query", description="Where the formal definition can be found.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["OperationDefinition"], }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name by which the operation/query is invoked", description=( "The name of the operation or query. For an operation, this is the name" " prefixed with $ and used in the URL. For a query, this is the name " "used in the _query parameter when the query is called." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementRestOperation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "definition"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestOperation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "definition"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields class CapabilityStatementRestResource(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Resource served on the REST interface. A specification of the restful capabilities of the solution for a specific resource type. """ __resource_type__ = "CapabilityStatementRestResource" conditionalCreate: bool | None = Field( default=None, alias="conditionalCreate", title="If allows/uses conditional create", description="A flag that indicates that the server supports conditional create.", json_schema_extra={ "element_property": True, }, ) conditionalCreate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_conditionalCreate", title="Extension field for ``conditionalCreate``.", ) conditionalDelete: fhirtypes.CodeType | None = Field( default=None, alias="conditionalDelete", title=( "not-supported | single | multiple - how conditional delete is " "supported" ), description="A code that indicates how the server supports conditional delete.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["not-supported", "single", "multiple"], }, ) conditionalDelete__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_conditionalDelete", title="Extension field for ``conditionalDelete``.", ) conditionalRead: fhirtypes.CodeType | None = Field( default=None, alias="conditionalRead", title="not-supported | modified-since | not-match | full-support", description="A code that indicates how the server supports conditional read.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "not-supported", "modified-since", "not-match", "full-support", ], }, ) conditionalRead__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_conditionalRead", title="Extension field for ``conditionalRead``.", ) conditionalUpdate: bool | None = Field( default=None, alias="conditionalUpdate", title="If allows/uses conditional update", description="A flag that indicates that the server supports conditional update.", json_schema_extra={ "element_property": True, }, ) conditionalUpdate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_conditionalUpdate", title="Extension field for ``conditionalUpdate``.", ) documentation: fhirtypes.MarkdownType | None = Field( default=None, alias="documentation", title="Additional information about the use of the resource type", description="Additional information about the resource type used by the system.", json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) interaction: typing.List[ fhirtypes.CapabilityStatementRestResourceInteractionType ] = Field( default=..., alias="interaction", title="What operations are supported?", description="Identifies a restful operation supported by the solution.", json_schema_extra={ "element_property": True, }, ) profile: fhirtypes.ReferenceType | None = Field( default=None, alias="profile", title="Base System profile for all uses of resource", description=( "A specification of the profile that describes the solution's overall " "support for the resource, including any constraints on cardinality, " "bindings, lengths or other limitations. See further discussion in " "[Using Profiles](profiling.html#profile-uses)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) readHistory: bool | None = Field( default=None, alias="readHistory", title="Whether vRead can return past versions", description=( "A flag for whether the server is able to return past versions as part " "of the vRead operation." ), json_schema_extra={ "element_property": True, }, ) readHistory__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_readHistory", title="Extension field for ``readHistory``." ) referencePolicy: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="referencePolicy", title="literal | logical | resolves | enforced | local", description="A set of flags that defines how references are supported.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["literal", "logical", "resolves", "enforced", "local"], }, ) referencePolicy__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_referencePolicy", title="Extension field for ``referencePolicy``.", ) searchInclude: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="searchInclude", title="_include values supported by the server", description="A list of _include values supported by the server.", json_schema_extra={ "element_property": True, }, ) searchInclude__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_searchInclude", title="Extension field for ``searchInclude``.", ) searchParam: typing.List[ fhirtypes.CapabilityStatementRestResourceSearchParamType ] | None = Field( default=None, alias="searchParam", title="Search parameters supported by implementation", description=( "Search parameters for implementations to support and/or make use of - " "either references to ones defined in the specification, or additional " "ones defined for/by the implementation." ), json_schema_extra={ "element_property": True, }, ) searchRevInclude: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="searchRevInclude", title="_revinclude values supported by the server", description=( "A list of _revinclude (reverse include) values supported by the " "server." ), json_schema_extra={ "element_property": True, }, ) searchRevInclude__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_searchRevInclude", title="Extension field for ``searchRevInclude``.", ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="A resource type that is supported", description="A type of resource exposed via the restful interface.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) updateCreate: bool | None = Field( default=None, alias="updateCreate", title="If update can commit to a new identity", description=( "A flag to indicate that the server allows or needs to allow the client" " to create new identities on the server (e.g. that is, the client PUTs" " to a location where there is no existing resource). Allowing this " "operation means that the server allows the client to create new " "identities on the server." ), json_schema_extra={ "element_property": True, }, ) updateCreate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_updateCreate", title="Extension field for ``updateCreate``.", ) versioning: fhirtypes.CodeType | None = Field( default=None, alias="versioning", title="no-version | versioned | versioned-update", description=( "This field is set to no-version to specify that the system does not " "support (server) or use (client) versioning for this resource type. If" " this has some other value, the server must at least correctly track " "and populate the versionId meta-property on resources. If the value is" " 'versioned-update', then the server supports all the versioning " "features, including using e-tags for version integrity in the API." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["no-version", "versioned", "versioned-update"], }, ) versioning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versioning", title="Extension field for ``versioning``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementRestResource`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "profile", "documentation", "interaction", "versioning", "readHistory", "updateCreate", "conditionalCreate", "conditionalRead", "conditionalUpdate", "conditionalDelete", "referencePolicy", "searchInclude", "searchRevInclude", "searchParam", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestResource`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "profile"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields class CapabilityStatementRestResourceInteraction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What operations are supported?. Identifies a restful operation supported by the solution. """ __resource_type__ = "CapabilityStatementRestResourceInteraction" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title=( "read | vread | update | patch | delete | history-instance | history-" "type | create | search-type" ), description="Coded identifier of the operation, supported by the system resource.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "read", "vread", "update", "patch", "delete", "history-instance", "history-type", "create", "search-type", ], }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Anything special about operation behavior", description=( "Guidance specific to the implementation of this operation, such as " "'delete is a logical delete' or 'updates are only allowed with version" " id' or 'creates permitted from pre-authorized certificates only'." ), json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementRestResourceInteraction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "documentation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestResourceInteraction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields class CapabilityStatementRestResourceSearchParam(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Search parameters supported by implementation. Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation. """ __resource_type__ = "CapabilityStatementRestResourceSearchParam" definition: fhirtypes.UriType | None = Field( default=None, alias="definition", title="Source of definition for parameter", description=( "An absolute URI that is a formal reference to where this parameter was" " first defined, so that a client can be confident of the meaning of " "the search parameter (a reference to [SearchParameter.url]())." ), json_schema_extra={ "element_property": True, }, ) definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Server-specific usage", description=( "This allows documentation of any distinct behaviors about how the " "search parameter is used. For example, text matching algorithms." ), json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name of search parameter", description="The name of the search parameter used in the interface.", json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "number | date | string | token | reference | composite | quantity | " "uri" ), description=( "The type of value a search parameter refers to, and how the content is" " interpreted." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "number", "date", "string", "token", "reference", "composite", "quantity", "uri", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementRestResourceSearchParam`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "definition", "type", "documentation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestResourceSearchParam`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext"), ("type", "type__ext")] return required_fields class CapabilityStatementRestSecurity(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about security of implementation. Information about security implementation from an interface perspective - what a client needs to know. """ __resource_type__ = "CapabilityStatementRestSecurity" certificate: typing.List[ fhirtypes.CapabilityStatementRestSecurityCertificateType ] | None = Field( default=None, alias="certificate", title="Certificates associated with security profiles", description=None, json_schema_extra={ "element_property": True, }, ) cors: bool | None = Field( default=None, alias="cors", title="Adds CORS Headers (http://enable-cors.org/)", description=( "Server adds CORS headers when responding to requests - this enables " "javascript applications to use the server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) cors__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_cors", title="Extension field for ``cors``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="General description of how security works", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) service: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="service", title="OAuth | SMART-on-FHIR | NTLM | Basic | Kerberos | Certificates", description="Types of security services that are supported/required by the system.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementRestSecurity`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "cors", "service", "description", "certificate", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestSecurity`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "cors", "service"] class CapabilityStatementRestSecurityCertificate(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Certificates associated with security profiles. """ __resource_type__ = "CapabilityStatementRestSecurityCertificate" blob: fhirtypes.Base64BinaryType | None = Field( default=None, alias="blob", title="Actual certificate", description=None, json_schema_extra={ "element_property": True, }, ) blob__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_blob", title="Extension field for ``blob``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="Mime type for certificates", description="Mime type for a certificate.", json_schema_extra={ "element_property": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementRestSecurityCertificate`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "blob"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestSecurityCertificate`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CapabilityStatementSoftware(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Software that is covered by this capability statement. Software that is covered by this capability statement. It is used when the capability statement describes the capabilities of a particular software version, independent of an installation. """ __resource_type__ = "CapabilityStatementSoftware" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="A name the software is known by", description="Name software is known by.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) releaseDate: fhirtypes.DateTimeType | None = Field( default=None, alias="releaseDate", title="Date this version released", description="Date this version of the software was released.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) releaseDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_releaseDate", title="Extension field for ``releaseDate``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Version covered by this statement", description="The version identifier for the software covered by this statement.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementSoftware`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "version", "releaseDate", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementSoftware`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "name", "version", "releaseDate"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/careplan.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CarePlan Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class CarePlan(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Healthcare plan for patient or group. Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions. """ __resource_type__ = "CarePlan" activity: typing.List[fhirtypes.CarePlanActivityType] | None = Field( default=None, alias="activity", title="Action to occur as part of plan", description=( "Identifies a planned action to occur as part of the plan. For " "example, a medication to be used, lab tests to perform, self-" "monitoring, education, etc." ), json_schema_extra={ "element_property": True, }, ) addresses: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="addresses", title="Health issues this plan addresses", description=( "Identifies the conditions/problems/concerns/diagnoses/etc. whose " "management and/or mitigation are handled by this plan." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) author: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="author", title="Who is responsible for contents of the plan", description=( "Identifies the individual(s) or ogranization who is responsible for " "the content of the care plan." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "RelatedPerson", "Organization", "CareTeam", ], }, ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Fulfills care plan", description="A care plan that is fulfilled in whole or in part by this care plan.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CarePlan"], }, ) careTeam: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="careTeam", title="Who's involved in plan?", description=( "Identifies all people and organizations who are expected to be " "involved in the care envisioned by this plan." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CareTeam"], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Type of plan", description=( 'Identifies what "kind" of plan this is to support differentiation ' 'between multiple co-existing plans; e.g. "Home health", "psychiatric",' ' "asthma", "disease management", "wellness plan", etc.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Created in context of", description=( "Identifies the original context in which this particular CarePlan was " "created." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) definition: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="definition", title="Protocol or definition", description=( "Identifies the protocol, questionnaire, guideline or other " "specification the care plan should be conducted in accordance with." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["PlanDefinition", "Questionnaire"], }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Summary of nature of plan", description="A description of the scope and nature of the plan.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) goal: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="goal", title="Desired outcome of plan", description="Describes the intended objective(s) of carrying out the care plan.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Goal"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Ids for this plan", description=( "This records identifiers associated with this care plan that are " "defined by business processes and/or used to refer to it when a direct" " URL reference to the resource itself is not appropriate (e.g. in CDA " "documents, or in written / printed documentation)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) intent: fhirtypes.CodeType | None = Field( default=None, alias="intent", title="proposal | plan | order | option", description=( "Indicates the level of authority/intentionality associated with the " "care plan and where the care plan fits into the workflow chain." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["proposal", "plan", "order", "option"], }, ) intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intent", title="Extension field for ``intent``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments about the plan", description="General notes about the care plan not covered elsewhere.", json_schema_extra={ "element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced CarePlan", description=( "A larger care plan of which this particular care plan is a component " "or step." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CarePlan"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period plan covers", description=( "Indicates when the plan did (or is intended to) come into effect and " "end." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) replaces: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="replaces", title="CarePlan replaced by this CarePlan", description=( "Completed or terminated care plan whose function is taken by this new " "care plan." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CarePlan"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "draft | active | suspended | completed | entered-in-error | cancelled " "| unknown" ), description=( "Indicates whether the plan is currently being acted upon, represents " "future intentions or is now a historical record." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "draft", "active", "suspended", "completed", "entered-in-error", "cancelled", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who care plan is for", description=( "Identifies the patient or group whose intended care is described by " "the plan." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInfo", title="Information considered as part of plan", description=( "Identifies portions of the patient's record that specifically " "influenced the formation of the plan. These might include co-" "morbidities, recent procedures, limitations, recent assessments, etc." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Human-friendly name for the CarePlan", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CarePlan`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "definition", "basedOn", "replaces", "partOf", "status", "intent", "category", "title", "description", "subject", "context", "period", "author", "careTeam", "addresses", "supportingInfo", "goal", "activity", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CarePlan`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "definition", "basedOn", "replaces", "partOf", "status", "intent", "category", "title", "description", "subject", "context", "period", "author", "addresses", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("intent", "intent__ext"), ("status", "status__ext")] return required_fields class CarePlanActivity(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Action to occur as part of plan. Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc. """ __resource_type__ = "CarePlanActivity" detail: fhirtypes.CarePlanActivityDetailType | None = Field( default=None, alias="detail", title="In-line definition of activity", description=( "A simple summary of a planned activity suitable for a general care " "plan system (e.g. form driven) that doesn't know about specific " "resources such as procedure etc." ), json_schema_extra={ "element_property": True, }, ) outcomeCodeableConcept: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="outcomeCodeableConcept", title="Results of the activity", description=( "Identifies the outcome at the point when the status of the activity is" " assessed. For example, the outcome of an education activity could be" " patient understands (or not)." ), json_schema_extra={ "element_property": True, }, ) outcomeReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="outcomeReference", title="Appointment, Encounter, Procedure, etc.", description=( "Details of the outcome or action resulting from the activity. The " 'reference to an "event" resource, such as Procedure or Encounter or ' "Observation, is the result/outcome of the activity itself. The " "activity can be conveyed using CarePlan.activity.detail OR using the " "CarePlan.activity.reference (a reference to a \u201crequest\u201d resource)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) progress: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="progress", title="Comments about the activity status/progress", description="Notes about the adherence/status/progress of the activity.", json_schema_extra={ "element_property": True, }, ) reference: fhirtypes.ReferenceType | None = Field( default=None, alias="reference", title="Activity details defined in specific resource", description=( "The details of the proposed activity represented in a specific " "resource." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Appointment", "CommunicationRequest", "DeviceRequest", "MedicationRequest", "NutritionOrder", "Task", "ProcedureRequest", "ReferralRequest", "VisionPrescription", "RequestGroup", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CarePlanActivity`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "outcomeCodeableConcept", "outcomeReference", "progress", "reference", "detail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CarePlanActivity`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CarePlanActivityDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. In-line definition of activity. A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc. """ __resource_type__ = "CarePlanActivityDetail" category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="diet | drug | encounter | observation | procedure | supply | other", description="High-level categorization of the type of activity in a care plan.", json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Detail type of activity", description=( "Detailed description of the type of planned activity; e.g. What lab " "test, what procedure, what kind of encounter." ), json_schema_extra={ "element_property": True, }, ) dailyAmount: fhirtypes.QuantityType | None = Field( default=None, alias="dailyAmount", title="How to consume/day?", description="Identifies the quantity expected to be consumed in a given day.", json_schema_extra={ "element_property": True, }, ) definition: fhirtypes.ReferenceType | None = Field( default=None, alias="definition", title="Protocol or definition", description=( "Identifies the protocol, questionnaire, guideline or other " "specification the planned activity should be conducted in accordance " "with." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "PlanDefinition", "ActivityDefinition", "Questionnaire", ], }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Extra info describing activity to perform", description=( "This provides a textual description of constraints on the intended " "activity occurrence, including relation to other activities. It may " "also include objectives, pre-conditions and end-conditions. Finally, " "it may convey specifics about the activity such as body site, method, " "route, etc." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) goal: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="goal", title="Goals this activity relates to", description=( "Internal reference that identifies the goals that this activity is " "intended to contribute towards meeting." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Goal"], }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where it should happen", description=( "Identifies the facility where the activity will occur; e.g. home, " "hospital, specific clinic, etc." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) performer: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="performer", title="Who will be responsible?", description="Identifies who's expected to be involved in the activity.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Organization", "RelatedPerson", "Patient", "CareTeam", ], }, ) productCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productCodeableConcept", title="What is to be administered/supplied", description=( "Identifies the food, drug or other product to be consumed or supplied " "in the activity." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e product[x] "one_of_many": "product", "one_of_many_required": False, }, ) productReference: fhirtypes.ReferenceType | None = Field( default=None, alias="productReference", title="What is to be administered/supplied", description=( "Identifies the food, drug or other product to be consumed or supplied " "in the activity." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e product[x] "one_of_many": "product", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication", "Substance"], }, ) prohibited: bool | None = Field( default=None, alias="prohibited", title="Do NOT do", description=( "If true, indicates that the described activity is one that must NOT be" " engaged in when following the plan. If false, indicates that the " "described activity is one that should be engaged in when following the" " plan." ), json_schema_extra={ "element_property": True, }, ) prohibited__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_prohibited", title="Extension field for ``prohibited``." ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="How much to administer/supply/consume", description=( "Identifies the quantity expected to be supplied, administered or " "consumed by the subject." ), json_schema_extra={ "element_property": True, }, ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Why activity should be done or why activity was prohibited", description=( "Provides the rationale that drove the inclusion of this particular " "activity as part of the plan or the reason why the activity was " "prohibited." ), json_schema_extra={ "element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Condition triggering need for activity", description=( "Provides the health condition(s) that drove the inclusion of this " "particular activity as part of the plan." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) scheduledPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="scheduledPeriod", title="When activity is to occur", description=( "The period, timing or frequency upon which the described activity is " "to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e scheduled[x] "one_of_many": "scheduled", "one_of_many_required": False, }, ) scheduledString: fhirtypes.StringType | None = Field( default=None, alias="scheduledString", title="When activity is to occur", description=( "The period, timing or frequency upon which the described activity is " "to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e scheduled[x] "one_of_many": "scheduled", "one_of_many_required": False, }, ) scheduledString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_scheduledString", title="Extension field for ``scheduledString``.", ) scheduledTiming: fhirtypes.TimingType | None = Field( default=None, alias="scheduledTiming", title="When activity is to occur", description=( "The period, timing or frequency upon which the described activity is " "to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e scheduled[x] "one_of_many": "scheduled", "one_of_many_required": False, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "not-started | scheduled | in-progress | on-hold | completed | " "cancelled | unknown" ), description="Identifies what progress is being made for the specific activity.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "not-started", "scheduled", "in-progress", "on-hold", "completed", "cancelled", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusReason: fhirtypes.StringType | None = Field( default=None, alias="statusReason", title="Reason for current status", description=( "Provides reason why the activity isn't yet started, is on hold, was " "cancelled, etc." ), json_schema_extra={ "element_property": True, }, ) statusReason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_statusReason", title="Extension field for ``statusReason``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CarePlanActivityDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "category", "definition", "code", "reasonCode", "reasonReference", "goal", "status", "statusReason", "prohibited", "scheduledTiming", "scheduledPeriod", "scheduledString", "location", "performer", "productCodeableConcept", "productReference", "productReference", "dailyAmount", "quantity", "description", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CarePlanActivityDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "product": ["productCodeableConcept", "productReference"], "scheduled": ["scheduledPeriod", "scheduledString", "scheduledTiming"], } return one_of_many_fields ================================================ FILE: fhir/resources/STU3/careteam.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CareTeam Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class CareTeam(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Planned participants in the coordination and delivery of care for a patient or group. The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient. """ __resource_type__ = "CareTeam" category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Type of team", description=( "Identifies what kind of team. This is to support differentiation " "between multiple co-existing teams, such as care plan team, episode of" " care team, longitudinal care team." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Encounter or episode associated with CareTeam", description=( "The encounter or episode of care that establishes the context for this" " care team." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Ids for this team", description=( "This records identifiers associated with this care team that are " "defined by business processes and/or used to refer to it when a direct" " URL reference to the resource itself is not appropriate." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) managingOrganization: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="managingOrganization", title="Organization responsible for the care team", description="The organization responsible for the care team.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name of the team, such as crisis assessment team", description=( "A label for human use intended to distinguish like teams. E.g. the " '"red" vs. "green" trauma teams.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the CareTeam", description=None, json_schema_extra={ "element_property": True, }, ) participant: typing.List[fhirtypes.CareTeamParticipantType] | None = Field( default=None, alias="participant", title="Members of the team", description=( "Identifies all people and organizations who are expected to be " "involved in the care team." ), json_schema_extra={ "element_property": True, }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period team covers", description=( "Indicates when the team did (or is intended to) come into effect and " "end." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Why the care team exists", description="Describes why the care team exists.", json_schema_extra={ "element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Why the care team exists", description="Condition(s) that this care team addresses.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="proposed | active | suspended | inactive | entered-in-error", description="Indicates the current state of the care team.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "proposed", "active", "suspended", "inactive", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Who care team is for", description=( "Identifies the patient or group whose intended care is handled by the " "team." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CareTeam`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "category", "name", "subject", "context", "period", "participant", "reasonCode", "reasonReference", "managingOrganization", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CareTeam`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "category", "name", "subject", "context", "period", "managingOrganization", ] class CareTeamParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Members of the team. Identifies all people and organizations who are expected to be involved in the care team. """ __resource_type__ = "CareTeamParticipant" member: fhirtypes.ReferenceType | None = Field( default=None, alias="member", title="Who is involved", description=( "The specific person or organization who is participating/expected to " "participate in the care team." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "RelatedPerson", "Patient", "Organization", "CareTeam", ], }, ) onBehalfOf: fhirtypes.ReferenceType | None = Field( default=None, alias="onBehalfOf", title="Organization of the practitioner", description="The organization of the practitioner.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period of participant", description=( "Indicates when the specific member or organization did (or is intended" " to) come into effect and end." ), json_schema_extra={ "element_property": True, }, ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="Type of involvement", description=( "Indicates specific responsibility of an individual within the care " 'team, such as "Primary care physician", "Trained social worker ' 'counselor", "Caregiver", etc.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CareTeamParticipant`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "role", "member", "onBehalfOf", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CareTeamParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "role", "member", "onBehalfOf"] ================================================ FILE: fhir/resources/STU3/chargeitem.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ChargeItem Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ChargeItem(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Item containing charge code(s) associated with the provision of healthcare provider products. The resource ChargeItem describes the provision of healthcare provider products for a certain patient, therefore referring not only to the product, but containing in addition details of the provision, like date, time, amounts and participating organizations and persons. Main Usage of the ChargeItem is to enable the billing process and internal cost allocation. """ __resource_type__ = "ChargeItem" account: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="account", title="Account to place this charge", description="Account into which this ChargeItems belongs.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Account"], }, ) bodysite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="bodysite", title="Anatomical location, if relevant", description="The anatomical location where the related service has been applied.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="A code that identifies the charge, like a billing code", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Encounter / Episode associated with event", description=( "The encounter or episode of care that establishes the context for this" " event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) definition: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="definition", title="Defining information about the code of this charge item", description=( "References the source of pricing information, rules of application for" " the code this ChargeItem uses." ), json_schema_extra={ "element_property": True, }, ) definition__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) enteredDate: fhirtypes.DateTimeType | None = Field( default=None, alias="enteredDate", title="Date the charge item was entered", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) enteredDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_enteredDate", title="Extension field for ``enteredDate``." ) enterer: fhirtypes.ReferenceType | None = Field( default=None, alias="enterer", title="Individual who was entering", description="The device, practitioner, etc. who entered the charge item.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Organization", "Patient", "Device", "RelatedPerson", ], }, ) factorOverride: fhirtypes.DecimalType | None = Field( default=None, alias="factorOverride", title="Factor overriding the associated rules", description=( "Factor overriding the factor determined by the rules associated with " "the code." ), json_schema_extra={ "element_property": True, }, ) factorOverride__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factorOverride", title="Extension field for ``factorOverride``.", ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Business Identifier for item", description="Identifiers assigned to this event performer or other systems.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the ChargeItem", description=( "Comments made about the event by the performer, subject or other " "participants." ), json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When the charged service was applied", description="Date/time(s) or duration when the charged service was applied.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="When the charged service was applied", description="Date/time(s) or duration when the charged service was applied.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceTiming: fhirtypes.TimingType | None = Field( default=None, alias="occurrenceTiming", title="When the charged service was applied", description="Date/time(s) or duration when the charged service was applied.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) overrideReason: fhirtypes.StringType | None = Field( default=None, alias="overrideReason", title="Reason for overriding the list price/factor", description=( "If the list price or the rule based factor associated with the code is" " overridden, this attribute can capture a text to indicate the reason" " for this action." ), json_schema_extra={ "element_property": True, }, ) overrideReason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_overrideReason", title="Extension field for ``overrideReason``.", ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced ChargeItem", description=( "ChargeItems can be grouped to larger ChargeItems covering the whole " "set." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ChargeItem"], }, ) participant: typing.List[fhirtypes.ChargeItemParticipantType] | None = Field( default=None, alias="participant", title="Who performed charged service", description=( "Indicates who or what performed or participated in the charged " "service." ), json_schema_extra={ "element_property": True, }, ) performingOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="performingOrganization", title="Organization providing the charged sevice", description="The organization requesting the service.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) priceOverride: fhirtypes.MoneyType | None = Field( default=None, alias="priceOverride", title="Price overriding the associated rules", description=( "Total price of the charge overriding the list price associated with " "the code." ), json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Quantity of which the charge item has been serviced", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reason", title="Why was the charged service rendered?", description="Describes why the event occurred in coded or textual form.", json_schema_extra={ "element_property": True, }, ) requestingOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="requestingOrganization", title="Organization requesting the charged service", description="The organization performing the service.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) service: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="service", title="Which rendered service is being charged?", description="Indicated the rendered service that caused this charge.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "DiagnosticReport", "ImagingStudy", "Immunization", "MedicationAdministration", "MedicationDispense", "Observation", "Procedure", "SupplyDelivery", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "planned | billable | not-billable | aborted | billed | entered-in-" "error | unknown" ), description="The current state of the ChargeItem.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "planned", "billable", "not-billable", "aborted", "billed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Individual service was done for/to", description=( "The individual or set of individuals the action is being or was " "performed on." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInformation", title="Further information supporting the this charge", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ChargeItem`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "definition", "status", "partOf", "code", "subject", "context", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "participant", "performingOrganization", "requestingOrganization", "quantity", "bodysite", "factorOverride", "priceOverride", "overrideReason", "enterer", "enteredDate", "reason", "service", "account", "note", "supportingInformation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ChargeItem`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "code", "subject", "context", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "quantity", "bodysite", "enterer", "enteredDate", "account", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "occurrence": ["occurrenceDateTime", "occurrencePeriod", "occurrenceTiming"] } return one_of_many_fields class ChargeItemParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who performed charged service. Indicates who or what performed or participated in the charged service. """ __resource_type__ = "ChargeItemParticipant" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Individual who was performing", description=( "The device, practitioner, etc. who performed or participated in the " "service." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Organization", "Patient", "Device", "RelatedPerson", ], }, ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="What type of performance was done", description=( "Describes the type of performance or participation(e.g. primary " "surgeon, anaesthesiologiest, etc.)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ChargeItemParticipant`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "role", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ChargeItemParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/claim.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Claim Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Claim(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Claim, Pre-determination or Pre-authorization. A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. """ __resource_type__ = "Claim" accident: fhirtypes.ClaimAccidentType | None = Field( default=None, alias="accident", title="Details about an accident", description="An accident which resulted in the need for healthcare services.", json_schema_extra={ "element_property": True, }, ) billablePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="billablePeriod", title="Period for charge submission", description="The billable period for which charges are being submitted.", json_schema_extra={ "element_property": True, }, ) careTeam: typing.List[fhirtypes.ClaimCareTeamType] | None = Field( default=None, alias="careTeam", title="Members of the care team", description=( "The members of the team who provided the overall service as well as " "their role and whether responsible and qualifications." ), json_schema_extra={ "element_property": True, }, ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Creation date", description=( "The date when the enclosed suite of services were performed or " "completed." ), json_schema_extra={ "element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) diagnosis: typing.List[fhirtypes.ClaimDiagnosisType] | None = Field( default=None, alias="diagnosis", title="List of Diagnosis", description="List of patient diagnosis for which care is sought.", json_schema_extra={ "element_property": True, }, ) employmentImpacted: fhirtypes.PeriodType | None = Field( default=None, alias="employmentImpacted", title="Period unable to work", description=( "The start and optional end dates of when the patient was precluded " "from working due to the treatable condition(s)." ), json_schema_extra={ "element_property": True, }, ) enterer: fhirtypes.ReferenceType | None = Field( default=None, alias="enterer", title="Author", description=( "Person who created the invoice/claim/pre-determination or pre-" "authorization." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) facility: fhirtypes.ReferenceType | None = Field( default=None, alias="facility", title="Servicing Facility", description="Facility where the services were provided.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) fundsReserve: fhirtypes.CodeableConceptType | None = Field( default=None, alias="fundsReserve", title="Funds requested to be reserved", description=( "In the case of a Pre-Determination/Pre-Authorization the provider may " "request that funds in the amount of the expected Benefit be reserved " "('Patient' or 'Provider') to pay for the Benefits determined on the " "subsequent claim(s). 'None' explicitly indicates no funds reserving is" " requested." ), json_schema_extra={ "element_property": True, }, ) hospitalization: fhirtypes.PeriodType | None = Field( default=None, alias="hospitalization", title="Period in hospital", description=( "The start and optional end dates of when the patient was confined to a" " treatment center." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Claim number", description=( "The business identifier for the instance: claim number, pre-" "determination or pre-authorization number." ), json_schema_extra={ "element_property": True, }, ) information: typing.List[fhirtypes.ClaimInformationType] | None = Field( default=None, alias="information", title=( "Exceptions, special considerations, the condition, situation, prior or" " concurrent issues" ), description=( "Additional information codes regarding exceptions, special " "considerations, the condition, situation, prior or concurrent issues. " "Often there are mutiple jurisdiction specific valuesets which are " "required." ), json_schema_extra={ "element_property": True, }, ) insurance: typing.List[fhirtypes.ClaimInsuranceType] | None = Field( default=None, alias="insurance", title="Insurance or medical plan", description="Financial instrument by which payment information for health care.", json_schema_extra={ "element_property": True, }, ) insurer: fhirtypes.ReferenceType | None = Field( default=None, alias="insurer", title="Target", description="The Insurer who is target of the request.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) item: typing.List[fhirtypes.ClaimItemType] | None = Field( default=None, alias="item", title="Goods and Services", description="First tier of goods and services.", json_schema_extra={ "element_property": True, }, ) organization: fhirtypes.ReferenceType | None = Field( default=None, alias="organization", title="Responsible organization", description=( "The organization which is responsible for the bill, claim pre-" "determination, pre-authorization." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) originalPrescription: fhirtypes.ReferenceType | None = Field( default=None, alias="originalPrescription", title="Original prescription if superceded by fulfiller", description=( "Original prescription which has been superceded by this prescription " "to support the dispensing of pharmacy services, medications or " "products. For example, a physician may prescribe a medication which " "the pharmacy determines is contraindicated, or for which the patient " "has an intolerance, and therefor issues a new precription for an " "alternate medication which has the same theraputic intent. The " "prescription from the pharmacy becomes the 'prescription' and that " "from the physician becomes the 'original prescription'." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicationRequest"], }, ) patient: fhirtypes.ReferenceType | None = Field( default=None, alias="patient", title="The subject of the Products and Services", description="Patient Resource.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) payee: fhirtypes.ClaimPayeeType | None = Field( default=None, alias="payee", title="Party to be paid any benefits payable", description="The party to be reimbursed for the services.", json_schema_extra={ "element_property": True, }, ) prescription: fhirtypes.ReferenceType | None = Field( default=None, alias="prescription", title="Prescription authorizing services or products", description="Prescription to support the dispensing of Pharmacy or Vision products.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicationRequest", "VisionPrescription"], }, ) priority: fhirtypes.CodeableConceptType | None = Field( default=None, alias="priority", title="Desired processing priority", description="Immediate (STAT), best effort (NORMAL), deferred (DEFER).", json_schema_extra={ "element_property": True, }, ) procedure: typing.List[fhirtypes.ClaimProcedureType] | None = Field( default=None, alias="procedure", title="Procedures performed", description=( "Ordered list of patient procedures performed to support the " "adjudication." ), json_schema_extra={ "element_property": True, }, ) provider: fhirtypes.ReferenceType | None = Field( default=None, alias="provider", title="Responsible provider", description=( "The provider which is responsible for the bill, claim pre-" "determination, pre-authorization." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) referral: fhirtypes.ReferenceType | None = Field( default=None, alias="referral", title="Treatment Referral", description=( "The referral resource which lists the date, practitioner, reason and " "other supporting information." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ReferralRequest"], }, ) related: typing.List[fhirtypes.ClaimRelatedType] | None = Field( default=None, alias="related", title="Related Claims which may be revelant to processing this claimn", description=( "Other claims which are related to this claim such as prior claim " "versions or for related services." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="subType", title="Finer grained claim type information", description=( "A finer grained suite of claim subtype codes which may convey " "Inpatient vs Outpatient and/or a specialty service. In the US the " "BillType." ), json_schema_extra={ "element_property": True, }, ) total: fhirtypes.MoneyType | None = Field( default=None, alias="total", title="Total claim cost", description="The total value of the claim.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Type or discipline", description=( "The category of claim, eg, oral, pharmacy, vision, insitutional, " "professional." ), json_schema_extra={ "element_property": True, }, ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="complete | proposed | exploratory | other", description=( "Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory " "(Pre-determination)." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["complete", "proposed", "exploratory", "other"], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Claim`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "type", "subType", "use", "patient", "billablePeriod", "created", "enterer", "insurer", "provider", "organization", "priority", "fundsReserve", "related", "prescription", "originalPrescription", "payee", "referral", "facility", "careTeam", "information", "diagnosis", "procedure", "insurance", "accident", "employmentImpacted", "hospitalization", "item", "total", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Claim`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "status"] class ClaimAccident(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details about an accident. An accident which resulted in the need for healthcare services. """ __resource_type__ = "ClaimAccident" date: fhirtypes.DateType | None = Field( default=None, alias="date", title="When the accident occurred see information codes see information codes", description="Date of an accident which these services are addressing.", json_schema_extra={ "element_property": True, "element_required": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) locationAddress: fhirtypes.AddressType | None = Field( default=None, alias="locationAddress", title="Accident Place", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="locationReference", title="Accident Place", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The nature of the accident", description="Type of accident: work, auto, etc.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimAccident`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "date", "type", "locationAddress", "locationReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimAccident`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("date", "date__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"location": ["locationAddress", "locationReference"]} return one_of_many_fields class ClaimCareTeam(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Members of the care team. The members of the team who provided the overall service as well as their role and whether responsible and qualifications. """ __resource_type__ = "ClaimCareTeam" provider: fhirtypes.ReferenceType = Field( default=..., alias="provider", title="Provider individual or organization", description="Member of the team who provided the overall service.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "Organization"], }, ) qualification: fhirtypes.CodeableConceptType | None = Field( default=None, alias="qualification", title="Type, classification or Specialization", description="The qualification which is applicable for this service.", json_schema_extra={ "element_property": True, }, ) responsible: bool | None = Field( default=None, alias="responsible", title="Billing provider", description=( "The party who is billing and responsible for the claimed good or " "service rendered to the patient." ), json_schema_extra={ "element_property": True, }, ) responsible__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_responsible", title="Extension field for ``responsible``." ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="Role on the team", description=( "The lead, assisting or supervising practitioner and their discipline " "if a multidisiplinary team." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Number to covey order of careTeam", description="Sequence of the careTeam which serves to order and provide a link.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimCareTeam`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "provider", "responsible", "role", "qualification", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimCareTeam`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields class ClaimDiagnosis(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. List of Diagnosis. List of patient diagnosis for which care is sought. """ __resource_type__ = "ClaimDiagnosis" diagnosisCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="diagnosisCodeableConcept", title="Patient's diagnosis", description="The diagnosis.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e diagnosis[x] "one_of_many": "diagnosis", "one_of_many_required": True, }, ) diagnosisReference: fhirtypes.ReferenceType | None = Field( default=None, alias="diagnosisReference", title="Patient's diagnosis", description="The diagnosis.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e diagnosis[x] "one_of_many": "diagnosis", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) packageCode: fhirtypes.CodeableConceptType | None = Field( default=None, alias="packageCode", title="Package billing code", description=( "The package billing code, for example DRG, based on the assigned " "grouping code system." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Number to covey order of diagnosis", description="Sequence of diagnosis which serves to provide a link.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Timing or nature of the diagnosis", description=( "The type of the Diagnosis, for example: admitting, primary, secondary," " discharge." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimDiagnosis`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "diagnosisCodeableConcept", "diagnosisReference", "type", "packageCode", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimDiagnosis`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "diagnosis": ["diagnosisCodeableConcept", "diagnosisReference"] } return one_of_many_fields class ClaimInformation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Exceptions, special considerations, the condition, situation, prior or concurrent issues. Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues. Often there are mutiple jurisdiction specific valuesets which are required. """ __resource_type__ = "ClaimInformation" category: fhirtypes.CodeableConceptType = Field( default=..., alias="category", title="General class of information", description=( "The general class of the information supplied: information; exception;" " accident, employment; onset, etc." ), json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Type of information", description=( "System and code pertaining to the specific information regarding " "special conditions relating to the setting, treatment or patient for " "which care is sought which may influence the adjudication." ), json_schema_extra={ "element_property": True, }, ) reason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reason", title="Reason associated with the information", description=( "For example, provides the reason for: the additional stay, or missing " "tooth or any other situation where a reason code is required in " "addition to the content." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Information instance identifier", description="Sequence of the information element which serves to provide a link.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) timingDate: fhirtypes.DateType | None = Field( default=None, alias="timingDate", title="When it occurred", description="The date when or period to which this information refers.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timingDate", title="Extension field for ``timingDate``." ) timingPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="timingPeriod", title="When it occurred", description="The date when or period to which this information refers.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Additional Data or supporting information", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Additional Data or supporting information", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Additional Data or supporting information", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Additional Data or supporting information", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimInformation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "category", "code", "timingDate", "timingPeriod", "valueString", "valueQuantity", "valueAttachment", "valueReference", "reason", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimInformation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "timing": ["timingDate", "timingPeriod"], "value": [ "valueAttachment", "valueQuantity", "valueReference", "valueString", ], } return one_of_many_fields class ClaimInsurance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Insurance or medical plan. Financial instrument by which payment information for health care. """ __resource_type__ = "ClaimInsurance" businessArrangement: fhirtypes.StringType | None = Field( default=None, alias="businessArrangement", title="Business agreement", description=( "The contract number of a business agreement which describes the terms " "and conditions." ), json_schema_extra={ "element_property": True, }, ) businessArrangement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_businessArrangement", title="Extension field for ``businessArrangement``.", ) claimResponse: fhirtypes.ReferenceType | None = Field( default=None, alias="claimResponse", title="Adjudication results", description="The Coverages adjudication details.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ClaimResponse"], }, ) coverage: fhirtypes.ReferenceType = Field( default=..., alias="coverage", title="Insurance information", description="Reference to the program or plan identification, underwriter or payor.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage"], }, ) focal: bool | None = Field( default=None, alias="focal", title="Is the focal Coverage", description=( "A flag to indicate that this Coverage is the focus for adjudication. " "The Coverage against which the claim is to be adjudicated." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) focal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_focal", title="Extension field for ``focal``." ) preAuthRef: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="preAuthRef", title="Pre-Authorization/Determination Reference", description="A list of references from the Insurer to which these services pertain.", json_schema_extra={ "element_property": True, }, ) preAuthRef__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_preAuthRef", title="Extension field for ``preAuthRef``." ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Service instance identifier", description=( "Sequence of coverage which serves to provide a link and convey " "coordination of benefit order." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimInsurance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "focal", "coverage", "businessArrangement", "preAuthRef", "claimResponse", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimInsurance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("focal", "focal__ext"), ("sequence", "sequence__ext")] return required_fields class ClaimItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Goods and Services. First tier of goods and services. """ __resource_type__ = "ClaimItem" bodySite: fhirtypes.CodeableConceptType | None = Field( default=None, alias="bodySite", title="Service Location", description="Physical service site on the patient (limb, tooth, etc).", json_schema_extra={ "element_property": True, }, ) careTeamLinkId: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="careTeamLinkId", title="Applicable careTeam members", description="CareTeam applicable for this service or product line.", json_schema_extra={ "element_property": True, }, ) careTeamLinkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_careTeamLinkId", title="Extension field for ``careTeamLinkId``.", ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Type of service or product", description=( "Health Care Service Type Codes to identify the classification of " "service or benefits." ), json_schema_extra={ "element_property": True, }, ) detail: typing.List[fhirtypes.ClaimItemDetailType] | None = Field( default=None, alias="detail", title="Additional items", description="Second tier of goods and services.", json_schema_extra={ "element_property": True, }, ) diagnosisLinkId: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="diagnosisLinkId", title="Applicable diagnoses", description="Diagnosis applicable for this service or product line.", json_schema_extra={ "element_property": True, }, ) diagnosisLinkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_diagnosisLinkId", title="Extension field for ``diagnosisLinkId``.", ) encounter: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="encounter", title="Encounters related to this billed item", description=( "A billed item may include goods or services provided in multiple " "encounters." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) informationLinkId: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="informationLinkId", title="Applicable exception and supporting information", description=( "Exceptions, special conditions and supporting information pplicable " "for this service or product line." ), json_schema_extra={ "element_property": True, }, ) informationLinkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_informationLinkId", title="Extension field for ``informationLinkId``.", ) locationAddress: fhirtypes.AddressType | None = Field( default=None, alias="locationAddress", title="Place of service", description="Where the service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="locationCodeableConcept", title="Place of service", description="Where the service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="locationReference", title="Place of service", description="Where the service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes, eg for Oral whether the " "treatment is cosmetic or associated with TMJ, or for medical whether " "the treatment was outside the clinic or out of office hours." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The quantity times the unit price for an addittional service or " "product or charge. For example, the formula: unit Quantity * unit " "Price (Cost per Point) * factor Number * points = net Amount. " "Quantity, factor and points are assumed to be 1 if not supplied." ), json_schema_extra={ "element_property": True, }, ) procedureLinkId: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="procedureLinkId", title="Applicable procedures", description="Procedures applicable for this service or product line.", json_schema_extra={ "element_property": True, }, ) procedureLinkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_procedureLinkId", title="Extension field for ``procedureLinkId``.", ) programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="programCode", title="Program specific reason for item inclusion", description=( "For programs which require reason codes for the inclusion or covering " "of this billed item under the program or sub-program." ), json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of Products or Services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of reveneu or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Service instance", description="A service line number.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) service: fhirtypes.CodeableConceptType | None = Field( default=None, alias="service", title="Billing Code", description=( "If this is an actual service or product line, ie. not a Group, then " "use code to indicate the Professional Service or Product supplied (eg." " CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,RXNorm,ACHI,CCI). If a grouping " "item then use a group code to indicate the type of thing being grouped" " eg. 'glasses' or 'compound'." ), json_schema_extra={ "element_property": True, }, ) servicedDate: fhirtypes.DateType | None = Field( default=None, alias="servicedDate", title="Date or dates of Service", description=( "The date or dates when the enclosed suite of services were performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_servicedDate", title="Extension field for ``servicedDate``.", ) servicedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="servicedPeriod", title="Date or dates of Service", description=( "The date or dates when the enclosed suite of services were performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) subSite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="subSite", title="Service Sub-location", description="A region or surface of the site, eg. limb region or tooth surface(s).", json_schema_extra={ "element_property": True, }, ) udi: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="udi", title="Unique Device Identifier", description="List of Unique Device Identifiers associated with this line item.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per point", description=( "If the item is a node then this is the fee for the product or service," " otherwise this is the total of the fees for the children of the " "group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "careTeamLinkId", "diagnosisLinkId", "procedureLinkId", "informationLinkId", "revenue", "category", "service", "modifier", "programCode", "servicedDate", "servicedPeriod", "locationCodeableConcept", "locationAddress", "locationReference", "quantity", "unitPrice", "factor", "net", "udi", "bodySite", "subSite", "encounter", "detail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "location": [ "locationAddress", "locationCodeableConcept", "locationReference", ], "serviced": ["servicedDate", "servicedPeriod"], } return one_of_many_fields class ClaimItemDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional items. Second tier of goods and services. """ __resource_type__ = "ClaimItemDetail" category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Type of service or product", description=( "Health Care Service Type Codes to identify the classification of " "service or benefits." ), json_schema_extra={ "element_property": True, }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes, eg for Oral whether the " "treatment is cosmetic or associated with TMJ, or for medical whether " "the treatment was outside the clinic or out of office hours." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total additional item cost", description=( "The quantity times the unit price for an addittional service or " "product or charge. For example, the formula: unit Quantity * unit " "Price (Cost per Point) * factor Number * points = net Amount. " "Quantity, factor and points are assumed to be 1 if not supplied." ), json_schema_extra={ "element_property": True, }, ) programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="programCode", title="Program specific reason for item inclusion", description=( "For programs which require reson codes for the inclusion, covering, of" " this billed item under the program or sub-program." ), json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of Products or Services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of reveneu or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Service instance", description="A service line number.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) service: fhirtypes.CodeableConceptType | None = Field( default=None, alias="service", title="Billing Code", description=( "If this is an actual service or product line, ie. not a Group, then " "use code to indicate the Professional Service or Product supplied (eg." " CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then " "use a group code to indicate the type of thing being grouped eg. " "'glasses' or 'compound'." ), json_schema_extra={ "element_property": True, }, ) subDetail: typing.List[fhirtypes.ClaimItemDetailSubDetailType] | None = Field( default=None, alias="subDetail", title="Additional items", description="Third tier of goods and services.", json_schema_extra={ "element_property": True, }, ) udi: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="udi", title="Unique Device Identifier", description="List of Unique Device Identifiers associated with this line item.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per point", description=( "If the item is a node then this is the fee for the product or service," " otherwise this is the total of the fees for the children of the " "group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimItemDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "revenue", "category", "service", "modifier", "programCode", "quantity", "unitPrice", "factor", "net", "udi", "subDetail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimItemDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields class ClaimItemDetailSubDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional items. Third tier of goods and services. """ __resource_type__ = "ClaimItemDetailSubDetail" category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Type of service or product", description=( "Health Care Service Type Codes to identify the classification of " "service or benefits." ), json_schema_extra={ "element_property": True, }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes, eg for Oral whether the " "treatment is cosmetic or associated with TMJ, or for medical whether " "the treatment was outside the clinic or out of office hours." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Net additional item cost", description=( "The quantity times the unit price for an addittional service or " "product or charge. For example, the formula: unit Quantity * unit " "Price (Cost per Point) * factor Number * points = net Amount. " "Quantity, factor and points are assumed to be 1 if not supplied." ), json_schema_extra={ "element_property": True, }, ) programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="programCode", title="Program specific reason for item inclusion", description=( "For programs which require reson codes for the inclusion, covering, of" " this billed item under the program or sub-program." ), json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of Products or Services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of reveneu or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Service instance", description="A service line number.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) service: fhirtypes.CodeableConceptType | None = Field( default=None, alias="service", title="Billing Code", description=( "A code to indicate the Professional Service or Product supplied (eg. " "CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI)." ), json_schema_extra={ "element_property": True, }, ) udi: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="udi", title="Unique Device Identifier", description="List of Unique Device Identifiers associated with this line item.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per point", description="The fee for an addittional service or product or charge.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "revenue", "category", "service", "modifier", "programCode", "quantity", "unitPrice", "factor", "net", "udi", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields class ClaimPayee(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Party to be paid any benefits payable. The party to be reimbursed for the services. """ __resource_type__ = "ClaimPayee" party: fhirtypes.ReferenceType | None = Field( default=None, alias="party", title="Party to receive the payable", description="Party to be reimbursed: Subscriber, provider, other.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Organization", "Patient", "RelatedPerson", ], }, ) resourceType: fhirtypes.CodingType | None = Field( default=None, alias="resourceType", title="organization | patient | practitioner | relatedperson", description=None, json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Type of party: Subscriber, Provider, other", description="Type of Party to be reimbursed: Subscriber, provider, other.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimPayee`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "resourceType", "party"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimPayee`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ClaimProcedure(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Procedures performed. Ordered list of patient procedures performed to support the adjudication. """ __resource_type__ = "ClaimProcedure" date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When the procedure was performed", description="Date and optionally time the procedure was performed .", json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) procedureCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="procedureCodeableConcept", title="Patient's list of procedures performed", description="The procedure code.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e procedure[x] "one_of_many": "procedure", "one_of_many_required": True, }, ) procedureReference: fhirtypes.ReferenceType | None = Field( default=None, alias="procedureReference", title="Patient's list of procedures performed", description="The procedure code.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e procedure[x] "one_of_many": "procedure", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Procedure"], }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Procedure sequence for reference", description="Sequence of procedures which serves to order and provide a link.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimProcedure`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "date", "procedureCodeableConcept", "procedureReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimProcedure`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "procedure": ["procedureCodeableConcept", "procedureReference"] } return one_of_many_fields class ClaimRelated(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Related Claims which may be revelant to processing this claimn. Other claims which are related to this claim such as prior claim versions or for related services. """ __resource_type__ = "ClaimRelated" claim: fhirtypes.ReferenceType | None = Field( default=None, alias="claim", title="Reference to the related claim", description=( "Other claims which are related to this claim such as prior claim " "versions or for related services." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Claim"], }, ) reference: fhirtypes.IdentifierType | None = Field( default=None, alias="reference", title="Related file or case reference", description=( "An alternate organizational reference to the case or file to which " "this particular claim pertains - eg Property/Casualy insurer claim # " "or Workers Compensation case # ." ), json_schema_extra={ "element_property": True, }, ) relationship: fhirtypes.CodeableConceptType | None = Field( default=None, alias="relationship", title="How the reference claim is related", description="For example prior or umbrella.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimRelated`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "claim", "relationship", "reference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimRelated`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/claimresponse.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ClaimResponse Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ClaimResponse(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Remittance resource. This resource provides the adjudication details from the processing of a Claim resource. """ __resource_type__ = "ClaimResponse" addItem: typing.List[fhirtypes.ClaimResponseAddItemType] | None = Field( default=None, alias="addItem", title="Insurer added line items", description="The first tier service adjudications for payor added services.", json_schema_extra={ "element_property": True, }, ) communicationRequest: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="communicationRequest", title="Request for additional information", description=( "Request for additional supporting or authorizing information, such as:" " documents, images or resources." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CommunicationRequest"], }, ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Creation date", description=( "The date when the enclosed suite of services were performed or " "completed." ), json_schema_extra={ "element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) disposition: fhirtypes.StringType | None = Field( default=None, alias="disposition", title="Disposition Message", description="A description of the status of the adjudication.", json_schema_extra={ "element_property": True, }, ) disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_disposition", title="Extension field for ``disposition``." ) error: typing.List[fhirtypes.ClaimResponseErrorType] | None = Field( default=None, alias="error", title="Processing errors", description="Mutually exclusive with Services Provided (Item).", json_schema_extra={ "element_property": True, }, ) form: fhirtypes.CodeableConceptType | None = Field( default=None, alias="form", title="Printed Form Identifier", description="The form to be used for printing the content.", json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Response number", description="The Response business identifier.", json_schema_extra={ "element_property": True, }, ) insurance: typing.List[fhirtypes.ClaimResponseInsuranceType] | None = Field( default=None, alias="insurance", title="Insurance or medical plan", description="Financial instrument by which payment information for health care.", json_schema_extra={ "element_property": True, }, ) insurer: fhirtypes.ReferenceType | None = Field( default=None, alias="insurer", title="Insurance issuing organization", description="The Insurer who produced this adjudicated response.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) item: typing.List[fhirtypes.ClaimResponseItemType] | None = Field( default=None, alias="item", title="Line items", description="The first tier service adjudications for submitted services.", json_schema_extra={ "element_property": True, }, ) outcome: fhirtypes.CodeableConceptType | None = Field( default=None, alias="outcome", title="complete | error | partial", description="Processing outcome errror, partial or complete processing.", json_schema_extra={ "element_property": True, }, ) patient: fhirtypes.ReferenceType | None = Field( default=None, alias="patient", title="The subject of the Products and Services", description="Patient Resource.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) payeeType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="payeeType", title="Party to be paid any benefits payable", description="Party to be reimbursed: Subscriber, provider, other.", json_schema_extra={ "element_property": True, }, ) payment: fhirtypes.ClaimResponsePaymentType | None = Field( default=None, alias="payment", title="Payment details, if paid", description="Payment details for the claim if the claim has been paid.", json_schema_extra={ "element_property": True, }, ) processNote: typing.List[fhirtypes.ClaimResponseProcessNoteType] | None = Field( default=None, alias="processNote", title="Processing notes", description="Note text.", json_schema_extra={ "element_property": True, }, ) request: fhirtypes.ReferenceType | None = Field( default=None, alias="request", title="Id of resource triggering adjudication", description="Original request resource referrence.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Claim"], }, ) requestOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="requestOrganization", title="Responsible organization", description=( "The organization which is responsible for the services rendered to the" " patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) requestProvider: fhirtypes.ReferenceType | None = Field( default=None, alias="requestProvider", title="Responsible practitioner", description=( "The practitioner who is responsible for the services rendered to the " "patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) reserved: fhirtypes.CodingType | None = Field( default=None, alias="reserved", title="Funds reserved status", description="Status of funds reservation (For provider, for Patient, None).", json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) totalBenefit: fhirtypes.MoneyType | None = Field( default=None, alias="totalBenefit", title="Total benefit payable for the Claim", description=( "Total amount of benefit payable (Equal to sum of the Benefit amounts " "from all detail lines and additions less the Unallocated Deductible)." ), json_schema_extra={ "element_property": True, }, ) totalCost: fhirtypes.MoneyType | None = Field( default=None, alias="totalCost", title="Total Cost of service from the Claim", description="The total cost of the services reported.", json_schema_extra={ "element_property": True, }, ) unallocDeductable: fhirtypes.MoneyType | None = Field( default=None, alias="unallocDeductable", title="Unallocated deductible", description=( "The amount of deductible applied which was not allocated to any " "particular service line." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "patient", "created", "insurer", "requestProvider", "requestOrganization", "request", "outcome", "disposition", "payeeType", "item", "addItem", "error", "totalCost", "unallocDeductable", "totalBenefit", "payment", "reserved", "form", "processNote", "communicationRequest", "insurance", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponse`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "status"] class ClaimResponseAddItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Insurer added line items. The first tier service adjudications for payor added services. """ __resource_type__ = "ClaimResponseAddItem" adjudication: typing.List[ fhirtypes.ClaimResponseItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Added items adjudication", description="The adjudications results.", json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Type of service or product", description=( "Health Care Service Type Codes to identify the classification of " "service or benefits." ), json_schema_extra={ "element_property": True, }, ) detail: typing.List[fhirtypes.ClaimResponseAddItemDetailType] | None = Field( default=None, alias="detail", title="Added items details", description="The second tier service adjudications for payor added services.", json_schema_extra={ "element_property": True, }, ) fee: fhirtypes.MoneyType | None = Field( default=None, alias="fee", title="Professional fee or Product charge", description="The fee charged for the professional service or product..", json_schema_extra={ "element_property": True, }, ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes, eg for Oral whether the " "treatment is cosmetic or associated with TMJ, or for medical whether " "the treatment was outside the clinic or out of office hours." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="List of note numbers which apply", description="A list of note references to the notes provided below.", json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of reveneu or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) sequenceLinkId: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="sequenceLinkId", title="Service instances", description=( "List of input service items which this service line is intended to " "replace." ), json_schema_extra={ "element_property": True, }, ) sequenceLinkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_sequenceLinkId", title="Extension field for ``sequenceLinkId``.", ) service: fhirtypes.CodeableConceptType | None = Field( default=None, alias="service", title="Group, Service or Product", description="A code to indicate the Professional Service or Product supplied.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseAddItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequenceLinkId", "revenue", "category", "service", "modifier", "fee", "noteNumber", "adjudication", "detail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseAddItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ClaimResponseAddItemDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Added items details. The second tier service adjudications for payor added services. """ __resource_type__ = "ClaimResponseAddItemDetail" adjudication: typing.List[ fhirtypes.ClaimResponseItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Added items detail adjudication", description="The adjudications results.", json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Type of service or product", description=( "Health Care Service Type Codes to identify the classification of " "service or benefits." ), json_schema_extra={ "element_property": True, }, ) fee: fhirtypes.MoneyType | None = Field( default=None, alias="fee", title="Professional fee or Product charge", description="The fee charged for the professional service or product..", json_schema_extra={ "element_property": True, }, ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes, eg for Oral whether the " "treatment is cosmetic or associated with TMJ, or for medical whether " "the treatment was outside the clinic or out of office hours." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="List of note numbers which apply", description="A list of note references to the notes provided below.", json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of reveneu or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) service: fhirtypes.CodeableConceptType | None = Field( default=None, alias="service", title="Service or Product", description="A code to indicate the Professional Service or Product supplied.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseAddItemDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "revenue", "category", "service", "modifier", "fee", "noteNumber", "adjudication", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseAddItemDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ClaimResponseError(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Processing errors. Mutually exclusive with Services Provided (Item). """ __resource_type__ = "ClaimResponseError" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Error code detailing processing issues", description=( "An error code,from a specified code system, which details why the " "claim could not be adjudicated." ), json_schema_extra={ "element_property": True, }, ) detailSequenceLinkId: fhirtypes.PositiveIntType | None = Field( default=None, alias="detailSequenceLinkId", title="Detail sequence number", description=( "The sequence number of the addition within the line item submitted " "which contains the error. This value is omitted when the error is not " "related to an Addition." ), json_schema_extra={ "element_property": True, }, ) detailSequenceLinkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detailSequenceLinkId", title="Extension field for ``detailSequenceLinkId``.", ) sequenceLinkId: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequenceLinkId", title="Item sequence number", description=( "The sequence number of the line item submitted which contains the " "error. This value is omitted when the error is elsewhere." ), json_schema_extra={ "element_property": True, }, ) sequenceLinkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequenceLinkId", title="Extension field for ``sequenceLinkId``.", ) subdetailSequenceLinkId: fhirtypes.PositiveIntType | None = Field( default=None, alias="subdetailSequenceLinkId", title="Subdetail sequence number", description=( "The sequence number of the addition within the line item submitted " "which contains the error. This value is omitted when the error is not " "related to an Addition." ), json_schema_extra={ "element_property": True, }, ) subdetailSequenceLinkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subdetailSequenceLinkId", title="Extension field for ``subdetailSequenceLinkId``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseError`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequenceLinkId", "detailSequenceLinkId", "subdetailSequenceLinkId", "code", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseError`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ClaimResponseInsurance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Insurance or medical plan. Financial instrument by which payment information for health care. """ __resource_type__ = "ClaimResponseInsurance" businessArrangement: fhirtypes.StringType | None = Field( default=None, alias="businessArrangement", title="Business agreement", description=( "The contract number of a business agreement which describes the terms " "and conditions." ), json_schema_extra={ "element_property": True, }, ) businessArrangement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_businessArrangement", title="Extension field for ``businessArrangement``.", ) claimResponse: fhirtypes.ReferenceType | None = Field( default=None, alias="claimResponse", title="Adjudication results", description="The Coverages adjudication details.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ClaimResponse"], }, ) coverage: fhirtypes.ReferenceType = Field( default=..., alias="coverage", title="Insurance information", description="Reference to the program or plan identification, underwriter or payor.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage"], }, ) focal: bool | None = Field( default=None, alias="focal", title="Is the focal Coverage", description=( "The instance number of the Coverage which is the focus for " "adjudication. The Coverage against which the claim is to be " "adjudicated." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) focal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_focal", title="Extension field for ``focal``." ) preAuthRef: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="preAuthRef", title="Pre-Authorization/Determination Reference", description="A list of references from the Insurer to which these services pertain.", json_schema_extra={ "element_property": True, }, ) preAuthRef__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_preAuthRef", title="Extension field for ``preAuthRef``." ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Service instance identifier", description="A service line item.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseInsurance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "focal", "coverage", "businessArrangement", "preAuthRef", "claimResponse", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseInsurance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("focal", "focal__ext"), ("sequence", "sequence__ext")] return required_fields class ClaimResponseItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Line items. The first tier service adjudications for submitted services. """ __resource_type__ = "ClaimResponseItem" adjudication: typing.List[ fhirtypes.ClaimResponseItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Adjudication details", description="The adjudication results.", json_schema_extra={ "element_property": True, }, ) detail: typing.List[fhirtypes.ClaimResponseItemDetailType] | None = Field( default=None, alias="detail", title="Detail line items", description="The second tier service adjudications for submitted services.", json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="List of note numbers which apply", description="A list of note references to the notes provided below.", json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) sequenceLinkId: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequenceLinkId", title="Service instance", description="A service line number.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequenceLinkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequenceLinkId", title="Extension field for ``sequenceLinkId``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequenceLinkId", "noteNumber", "adjudication", "detail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequenceLinkId", "sequenceLinkId__ext")] return required_fields class ClaimResponseItemAdjudication(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Adjudication details. The adjudication results. """ __resource_type__ = "ClaimResponseItemAdjudication" amount: fhirtypes.MoneyType | None = Field( default=None, alias="amount", title="Monetary amount", description="Monetary amount associated with the code.", json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType = Field( default=..., alias="category", title="Adjudication category such as co-pay, eligible, benefit, etc.", description="Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.", json_schema_extra={ "element_property": True, }, ) reason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reason", title="Explanation of Adjudication outcome", description="Adjudication reason such as limit reached.", json_schema_extra={ "element_property": True, }, ) value: fhirtypes.DecimalType | None = Field( default=None, alias="value", title="Non-monetary value", description=( "A non-monetary value for example a percentage. Mutually exclusive to " "the amount element above." ), json_schema_extra={ "element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseItemAdjudication`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "category", "reason", "amount", "value", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseItemAdjudication`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ClaimResponseItemDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Detail line items. The second tier service adjudications for submitted services. """ __resource_type__ = "ClaimResponseItemDetail" adjudication: typing.List[ fhirtypes.ClaimResponseItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Detail level adjudication details", description="The adjudications results.", json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="List of note numbers which apply", description="A list of note references to the notes provided below.", json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) sequenceLinkId: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequenceLinkId", title="Service instance", description="A service line number.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequenceLinkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequenceLinkId", title="Extension field for ``sequenceLinkId``.", ) subDetail: typing.List[ fhirtypes.ClaimResponseItemDetailSubDetailType ] | None = Field( default=None, alias="subDetail", title="Subdetail line items", description="The third tier service adjudications for submitted services.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseItemDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequenceLinkId", "noteNumber", "adjudication", "subDetail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseItemDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequenceLinkId", "sequenceLinkId__ext")] return required_fields class ClaimResponseItemDetailSubDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Subdetail line items. The third tier service adjudications for submitted services. """ __resource_type__ = "ClaimResponseItemDetailSubDetail" adjudication: typing.List[ fhirtypes.ClaimResponseItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Subdetail level adjudication details", description="The adjudications results.", json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="List of note numbers which apply", description="A list of note references to the notes provided below.", json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) sequenceLinkId: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequenceLinkId", title="Service instance", description="A service line number.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequenceLinkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequenceLinkId", title="Extension field for ``sequenceLinkId``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequenceLinkId", "noteNumber", "adjudication", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequenceLinkId", "sequenceLinkId__ext")] return required_fields class ClaimResponsePayment(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Payment details, if paid. Payment details for the claim if the claim has been paid. """ __resource_type__ = "ClaimResponsePayment" adjustment: fhirtypes.MoneyType | None = Field( default=None, alias="adjustment", title="Payment adjustment for non-Claim issues", description=( "Adjustment to the payment of this transaction which is not related to " "adjudication of this transaction." ), json_schema_extra={ "element_property": True, }, ) adjustmentReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="adjustmentReason", title="Explanation for the non-claim adjustment", description="Reason for the payment adjustment.", json_schema_extra={ "element_property": True, }, ) amount: fhirtypes.MoneyType | None = Field( default=None, alias="amount", title="Payable amount after adjustment", description="Payable less any payment adjustment.", json_schema_extra={ "element_property": True, }, ) date: fhirtypes.DateType | None = Field( default=None, alias="date", title="Expected data of Payment", description="Estimated payment data.", json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Identifier of the payment instrument", description="Payment identifier.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Partial or Complete", description="Whether this represents partial or complete payment of the claim.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponsePayment`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "adjustment", "adjustmentReason", "date", "amount", "identifier", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponsePayment`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ClaimResponseProcessNote(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Processing notes. Note text. """ __resource_type__ = "ClaimResponseProcessNote" language: fhirtypes.CodeableConceptType | None = Field( default=None, alias="language", title="Language if different from the resource", description=( "The ISO-639-1 alpha 2 code in lower case for the language, optionally " "followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in" ' upper case; e.g. "en" for English, or "en-US" for American English ' 'versus "en-EN" for England English.' ), json_schema_extra={ "element_property": True, }, ) number: fhirtypes.PositiveIntType | None = Field( default=None, alias="number", title="Sequence Number for this note", description=( "An integer associated with each note which may be referred to from " "each service line item." ), json_schema_extra={ "element_property": True, }, ) number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_number", title="Extension field for ``number``." ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Note explanatory text", description="The note text.", json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="display | print | printoper", description="The note purpose: Print/Display.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseProcessNote`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "number", "type", "text", "language", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseProcessNote`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/clinicalimpression.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ClinicalImpression Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ClinicalImpression(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A clinical assessment performed when planning treatments and management strategies for a patient. A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. """ __resource_type__ = "ClinicalImpression" action: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="action", title="Action taken as part of assessment procedure", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "ReferralRequest", "ProcedureRequest", "Procedure", "MedicationRequest", "Appointment", ], }, ) assessor: fhirtypes.ReferenceType | None = Field( default=None, alias="assessor", title="The clinician performing the assessment", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Kind of assessment performed", description="Categorizes the type of clinical assessment performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Encounter or Episode created from", description=( "The encounter or episode of care this impression was created as part " "of." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When the assessment was documented", description="Indicates when the documentation of the assessment was complete.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Why/how the assessment was performed", description=( "A summary of the context and/or cause of the assessment - why / where " "was it performed, and what patient events/status prompted it." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) effectiveDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="effectiveDateTime", title="Time of assessment", description="The point in time or period over which the subject was assessed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_effectiveDateTime", title="Extension field for ``effectiveDateTime``.", ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="Time of assessment", description="The point in time or period over which the subject was assessed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) finding: typing.List[fhirtypes.ClinicalImpressionFindingType] | None = Field( default=None, alias="finding", title="Possible or likely findings and diagnoses", description=( "Specific findings or diagnoses that was considered likely or relevant " "to ongoing treatment." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description=( "A unique identifier assigned to the clinical impression that remains " "consistent regardless of what server the impression is stored on." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) investigation: typing.List[ fhirtypes.ClinicalImpressionInvestigationType ] | None = Field( default=None, alias="investigation", title="One or more sets of investigations (signs, symptions, etc.)", description=( "One or more sets of investigations (signs, symptions, etc.). The " "actual grouping of investigations vary greatly depending on the type " "and context of the assessment. These investigations may include data " "generated during the assessment process, or data previously generated " "and recorded that is pertinent to the outcomes." ), json_schema_extra={ "element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the ClinicalImpression", description=( "Commentary about the impression, typically recorded after the " "impression itself was made, though supplemental notes by the original " "author could also appear." ), json_schema_extra={ "element_property": True, }, ) previous: fhirtypes.ReferenceType | None = Field( default=None, alias="previous", title="Reference to last assessment", description=( "A reference to the last assesment that was conducted bon this patient." " Assessments are often/usually ongoing in nature; a care provider " "(practitioner or team) will make new assessments on an ongoing basis " "as new data arises or the patient's conditions changes." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ClinicalImpression"], }, ) problem: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="problem", title="Relevant impressions of patient state", description="This a list of the relevant problems/conditions for a patient.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "AllergyIntolerance"], }, ) prognosisCodeableConcept: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="prognosisCodeableConcept", title="Estimate of likely outcome", description=None, json_schema_extra={ "element_property": True, }, ) prognosisReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="prognosisReference", title="RiskAssessment expressing likely outcome", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["RiskAssessment"], }, ) protocol: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="protocol", title="Clinical Protocol followed", description=( "Reference to a specific published clinical protocol that was followed " "during this assessment, and/or that provides evidence in support of " "the diagnosis." ), json_schema_extra={ "element_property": True, }, ) protocol__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_protocol", title="Extension field for ``protocol``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | completed | entered-in-error", description="Identifies the workflow status of the assessment.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "completed", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Patient or group assessed", description="The patient or group of individuals assessed as part of this record.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) summary: fhirtypes.StringType | None = Field( default=None, alias="summary", title="Summary of the assessment", description="A text summary of the investigations and the diagnosis.", json_schema_extra={ "element_property": True, }, ) summary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_summary", title="Extension field for ``summary``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClinicalImpression`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "code", "description", "subject", "context", "effectiveDateTime", "effectivePeriod", "date", "assessor", "previous", "problem", "investigation", "protocol", "summary", "finding", "prognosisCodeableConcept", "prognosisReference", "action", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClinicalImpression`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "code", "description", "subject", "context", "effectiveDateTime", "effectivePeriod", "date", "assessor", "problem", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"effective": ["effectiveDateTime", "effectivePeriod"]} return one_of_many_fields class ClinicalImpressionFinding(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Possible or likely findings and diagnoses. Specific findings or diagnoses that was considered likely or relevant to ongoing treatment. """ __resource_type__ = "ClinicalImpressionFinding" basis: fhirtypes.StringType | None = Field( default=None, alias="basis", title="Which investigations support finding", description="Which investigations support finding or diagnosis.", json_schema_extra={ "element_property": True, }, ) basis__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_basis", title="Extension field for ``basis``." ) itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="itemCodeableConcept", title="What was found", description=( "Specific text, code or reference for finding or diagnosis, which may " "include ruled-out or resolved conditions." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": True, }, ) itemReference: fhirtypes.ReferenceType | None = Field( default=None, alias="itemReference", title="What was found", description=( "Specific text, code or reference for finding or diagnosis, which may " "include ruled-out or resolved conditions." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "Observation"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClinicalImpressionFinding`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "itemCodeableConcept", "itemReference", "itemReference", "basis", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClinicalImpressionFinding`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"item": ["itemCodeableConcept", "itemReference"]} return one_of_many_fields class ClinicalImpressionInvestigation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. One or more sets of investigations (signs, symptions, etc.). One or more sets of investigations (signs, symptions, etc.). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes. """ __resource_type__ = "ClinicalImpressionInvestigation" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="A name/code for the set", description=( 'A name/code for the group ("set") of investigations. Typically, this ' 'will be something like "signs", "symptoms", "clinical", "diagnostic", ' "but the list is not constrained, and others such groups such as " "(exposure|family|travel|nutitirional) history may be used." ), json_schema_extra={ "element_property": True, }, ) item: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="item", title="Record of a specific investigation", description="A record of a specific investigation that was undertaken.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Observation", "QuestionnaireResponse", "FamilyMemberHistory", "DiagnosticReport", "RiskAssessment", "ImagingStudy", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClinicalImpressionInvestigation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "item"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClinicalImpressionInvestigation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/codeableconcept.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CodeableConcept Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class CodeableConcept(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Concept - reference to a terminology or just text. A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. """ __resource_type__ = "CodeableConcept" coding: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="coding", title="Code defined by a terminology system", description="A reference to a code defined by a terminology system.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Plain text representation of the concept", description=( "A human language representation of the concept as " "seen/selected/uttered by the user who entered the data and/or which " "represents the intended meaning of the user." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CodeableConcept`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "coding", "text"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CodeableConcept`` according to specification, with preserving the original sequence order. """ return ["coding", "text"] ================================================ FILE: fhir/resources/STU3/codesystem.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CodeSystem Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class CodeSystem(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A set of codes drawn from one or more code systems. A code system resource specifies a set of codes drawn from one or more code systems. """ __resource_type__ = "CodeSystem" caseSensitive: bool | None = Field( default=None, alias="caseSensitive", title="If code comparison is case sensitive", description=( "If code comparison is case sensitive when codes within this system are" " compared to each other." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) caseSensitive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_caseSensitive", title="Extension field for ``caseSensitive``.", ) compositional: bool | None = Field( default=None, alias="compositional", title="If code system defines a post-composition grammar", description="True If code system defines a post-composition grammar.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) compositional__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_compositional", title="Extension field for ``compositional``.", ) concept: typing.List[fhirtypes.CodeSystemConceptType] | None = Field( default=None, alias="concept", title="Concepts in the code system", description=( "Concepts that are in the code system. The concept definitions are " "inherently hierarchical, but the definitions must be consulted to " "determine what the meaning of the hierarchical relationships are." ), json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) content: fhirtypes.CodeType | None = Field( default=None, alias="content", title="not-present | example | fragment | complete", description=( "How much of the content of the code system - the concepts and codes it" " defines - are represented in this resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["not-present", "example", "fragment", "complete"], }, ) content__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_content", title="Extension field for ``content``." ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the code system and/or its contents." " Copyright statements are generally legal restrictions on the use and " "publishing of the code system." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) count: fhirtypes.UnsignedIntType | None = Field( default=None, alias="count", title="Total concepts in the code system", description=( "The total number of concepts defined by the code system. Where the " "code system has a compositional grammar, the count refers to the " "number of base (primitive) concepts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_count", title="Extension field for ``count``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date this was last changed", description=( "The date (and optionally time) when the code system was published. " "The date must change if and when the business version changes and it " "must change if the status code changes. In addition, it should change " "when the substantive content of the code system changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the code system", description=( "A free text natural language description of the code system from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A boolean value to indicate that this code system is authored for " "testing purposes (or education/evaluation/marketing), and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) filter: typing.List[fhirtypes.CodeSystemFilterType] | None = Field( default=None, alias="filter", title="Filter that can be used in a value set", description=( "A filter that can be used in a value set compose statement when " "selecting concepts using a filter." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) hierarchyMeaning: fhirtypes.CodeType | None = Field( default=None, alias="hierarchyMeaning", title="grouped-by | is-a | part-of | classified-with", description="The meaning of the hierarchy of concepts.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["grouped-by", "is-a", "part-of", "classified-with"], }, ) hierarchyMeaning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_hierarchyMeaning", title="Extension field for ``hierarchyMeaning``.", ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Additional identifier for the code system", description=( "A formal identifier that is used to identify this code system when it " "is represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for code system (if applicable)", description=( "A legal or geographic region in which the code system is intended to " "be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this code system (computer friendly)", description=( "A natural language name identifying the code system. This name should " "be usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) property: typing.List[fhirtypes.CodeSystemPropertyType] | None = Field( default=None, alias="property", title="Additional information supplied about each concept", description=( "A property defines an additional slot through which additional " "information can be provided about a concept." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the individual or organization that published the code " "system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this code system is defined", description=( "Explaination of why this code system is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this code system. Enables tracking the life-cycle of the" " content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this code system (human friendly)", description="A short, descriptive, user-friendly title for the code system.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Logical URI to reference this code system (globally unique) " "(Coding.system)" ), description=( "An absolute URI that is used to identify this code system when it is " "referenced in a specification, model, design or an instance. This " "SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at" " which this code system is (or will be) published. The URL SHOULD " "include the major version of the code system. For more information see" " [Technical and Business Versions](resource.html#versions). This is " "used in [Coding]{datatypes.html#Coding}.system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Context the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching for appropriate code system instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueSet: fhirtypes.UriType | None = Field( default=None, alias="valueSet", title="Canonical URL for value set with entire code system", description="Canonical URL of value set that contains the entire code system.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueSet", title="Extension field for ``valueSet``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the code system (Coding.version)", description=( "The identifier that is used to identify this version of the code " "system when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the code system author" " and is not expected to be globally unique. For example, it might be a" " timestamp (e.g. yyyymmdd) if a managed version is not available. " "There is also no expectation that versions can be placed in a " "lexicographical sequence. This is used in " "[Coding]{datatypes.html#Coding}.version." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionNeeded: bool | None = Field( default=None, alias="versionNeeded", title="If definitions are not stable", description=( "This flag is used to signify that the code system has not (or does " "not) maintain the definitions, and a version must be specified when " "referencing this code system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) versionNeeded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionNeeded", title="Extension field for ``versionNeeded``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CodeSystem`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "caseSensitive", "valueSet", "hierarchyMeaning", "compositional", "versionNeeded", "content", "count", "filter", "property", "concept", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CodeSystem`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "caseSensitive", "valueSet", "hierarchyMeaning", "compositional", "versionNeeded", "content", "count", "filter", "property", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("content", "content__ext"), ("status", "status__ext")] return required_fields class CodeSystemConcept(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Concepts in the code system. Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meaning of the hierarchical relationships are. """ __resource_type__ = "CodeSystemConcept" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Code that identifies concept", description=( "A code - a text symbol - that uniquely identifies the concept within " "the code system." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) concept: typing.List[fhirtypes.CodeSystemConceptType] | None = Field( default=None, alias="concept", title="Child Concepts (is-a/contains/categorizes)", description=( "Defines children of a concept to produce a hierarchy of concepts. The " "nature of the relationships is variable (is-a/contains/categorizes) - " "see hierarchyMeaning." ), json_schema_extra={ "element_property": True, }, ) definition: fhirtypes.StringType | None = Field( default=None, alias="definition", title="Formal definition", description=( "The formal definition of the concept. The code system resource does " "not make formal definitions required, because of the prevalence of " "legacy systems. However, they are highly recommended, as without them " "there is no formal meaning associated with the concept." ), json_schema_extra={ "element_property": True, }, ) definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) designation: typing.List[fhirtypes.CodeSystemConceptDesignationType] | None = Field( default=None, alias="designation", title="Additional representations for the concept", description=( "Additional representations for the concept - other languages, aliases," " specialized purposes, used for particular purposes, etc." ), json_schema_extra={ "element_property": True, }, ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Text to display to the user", description=( "A human readable string that is the recommended default way to present" " this concept to a user." ), json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) property: typing.List[fhirtypes.CodeSystemConceptPropertyType] | None = Field( default=None, alias="property", title="Property value for the concept", description="A property value for this concept.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CodeSystemConcept`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "display", "definition", "designation", "property", "concept", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CodeSystemConcept`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields class CodeSystemConceptDesignation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional representations for the concept. Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc. """ __resource_type__ = "CodeSystemConceptDesignation" language: fhirtypes.CodeType | None = Field( default=None, alias="language", title="Human language of the designation", description="The language this designation is defined for.", json_schema_extra={ "element_property": True, }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) use: fhirtypes.CodingType | None = Field( default=None, alias="use", title="Details how this designation would be used", description="A code that details how this designation would be used.", json_schema_extra={ "element_property": True, }, ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The text value for this designation", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CodeSystemConceptDesignation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "language", "use", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CodeSystemConceptDesignation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("value", "value__ext")] return required_fields class CodeSystemConceptProperty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Property value for the concept. A property value for this concept. """ __resource_type__ = "CodeSystemConceptProperty" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Reference to CodeSystem.property.code", description="A code that is a reference to CodeSystem.property.code.", json_schema_extra={ "element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CodeSystemConceptProperty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "valueCode", "valueCoding", "valueString", "valueInteger", "valueBoolean", "valueDateTime", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CodeSystemConceptProperty`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueCode", "valueCoding", "valueDateTime", "valueInteger", "valueString", ] } return one_of_many_fields class CodeSystemFilter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Filter that can be used in a value set. A filter that can be used in a value set compose statement when selecting concepts using a filter. """ __resource_type__ = "CodeSystemFilter" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Code that identifies the filter", description="The code that identifies this filter when it is used in the instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="How or why the filter is used", description="A description of how or why the filter is used.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) operator: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="operator", title="Operators that can be used with filter", description="A list of operators that can be used with the filter.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) operator__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_operator", title="Extension field for ``operator``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="What to use for the value", description="A description of what the value for the filter should be.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CodeSystemFilter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "description", "operator", "value", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CodeSystemFilter`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "description", "operator", "value"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("code", "code__ext"), ("operator", "operator__ext"), ("value", "value__ext"), ] return required_fields class CodeSystemProperty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional information supplied about each concept. A property defines an additional slot through which additional information can be provided about a concept. """ __resource_type__ = "CodeSystemProperty" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title=( "Identifies the property on the concepts, and when referred to in " "operations" ), description=( "A code that is used to identify the property. The code is used " "internally (in CodeSystem.concept.property.code) and also externally, " "such as in property filters." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Why the property is defined, and/or what it conveys", description=( "A description of the property- why it is defined, and how its value " "might be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="code | Coding | string | integer | boolean | dateTime", description=( 'The type of the property value. Properties of type "code" contain a ' "code defined by the code system (e.g. a reference to anotherr defined " "concept)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "code", "Coding", "string", "integer", "boolean", "dateTime", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) uri: fhirtypes.UriType | None = Field( default=None, alias="uri", title="Formal identifier for the property", description=( "Reference to the formal meaning of the property. One possible source " "of meaning is the [Concept Properties](codesystem-concept-" "properties.html) code system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uri", title="Extension field for ``uri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CodeSystemProperty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "uri", "description", "type", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CodeSystemProperty`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "uri", "description", "type"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext"), ("type", "type__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/coding.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Coding Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Coding(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A reference to a code defined by a terminology system. """ __resource_type__ = "Coding" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Symbol in syntax defined by the system", description=( "A symbol in syntax defined by the system. The symbol may be a " "predefined code or an expression in a syntax defined by the coding " "system (e.g. post-coordination)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Representation defined by the system", description=( "A representation of the meaning of the code in the system, following " "the rules of the system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) system: fhirtypes.UriType | None = Field( default=None, alias="system", title="Identity of the terminology system", description=( "The identification of the code system that defines the meaning of the " "symbol in the code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) userSelected: bool | None = Field( default=None, alias="userSelected", title="If this coding was chosen directly by the user", description=( "Indicates that this coding was chosen by a user directly - i.e. off a " "pick list of available items (codes or displays)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) userSelected__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_userSelected", title="Extension field for ``userSelected``.", ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Version of the system - if relevant", description=( "The version of the code system which was used when choosing this code." " Note that a well-maintained code system does not need the version " "reported, because the meaning of codes is consistent across versions. " "However this cannot consistently be assured. and when the meaning is " "not guaranteed to be consistent, the version SHOULD be exchanged." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Coding`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "system", "version", "code", "display", "userSelected", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Coding`` according to specification, with preserving the original sequence order. """ return ["system", "version", "code", "display", "userSelected"] ================================================ FILE: fhir/resources/STU3/communication.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Communication Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Communication(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A record of information transmitted from a sender to a receiver. An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition. """ __resource_type__ = "Communication" basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Request fulfilled by this communication", description=( "An order, proposal or plan fulfilled in whole or in part by this " "Communication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Message category", description=( "The type of message conveyed such as alert, notification, reminder, " "instruction, etc." ), json_schema_extra={ "element_property": True, }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Encounter or episode leading to message", description="The encounter within which the communication was sent.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) definition: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="definition", title="Instantiates protocol or definition", description=( "A protocol, guideline, or other definition that was adhered to in " "whole or in part by this communication event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["PlanDefinition", "ActivityDefinition"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique identifier", description=( "Identifiers associated with this Communication that are defined by " "business processes and/ or used to refer to it when a direct URL " "reference to the resource itself is not appropriate (e.g. in CDA " "documents, or in written / printed documentation)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) medium: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="medium", title="A channel of communication", description="A channel that was used for this communication (e.g. email, fax).", json_schema_extra={ "element_property": True, }, ) notDone: bool | None = Field( default=None, alias="notDone", title="Communication did not occur", description=( "If true, indicates that the described communication event did not " "actually occur." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) notDone__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_notDone", title="Extension field for ``notDone``." ) notDoneReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="notDoneReason", title="Why communication did not occur", description=( "Describes why the communication event did not occur in coded and/or " "textual form." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the communication", description=( "Additional notes or commentary about the communication by the sender, " "receiver or other interested parties." ), json_schema_extra={ "element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of this action", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) payload: typing.List[fhirtypes.CommunicationPayloadType] | None = Field( default=None, alias="payload", title="Message payload", description=( "Text, attachment(s), or resource(s) that was communicated to the " "recipient." ), json_schema_extra={ "element_property": True, }, ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Indication for message", description="The reason or justification for the communication.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Why was communication done?", description=( "Indicates another resource whose existence justifies this " "communication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "Observation"], }, ) received: fhirtypes.DateTimeType | None = Field( default=None, alias="received", title="When received", description="The time when this communication arrived at the destination.", json_schema_extra={ "element_property": True, }, ) received__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_received", title="Extension field for ``received``." ) recipient: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="recipient", title="Message recipient", description=( "The entity (e.g. person, organization, clinical information system, or" " device) which was the target of the communication. If receipts need " "to be tracked by individual, a separate resource instance will need to" " be created for each recipient. \u00a0Multiple recipient communications are" " intended where either a receipt(s) is not tracked (e.g. a mass mail-" "out) or is captured in aggregate (all emails confirmed received by a " "particular time)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Organization", "Patient", "Practitioner", "RelatedPerson", "Group", ], }, ) sender: fhirtypes.ReferenceType | None = Field( default=None, alias="sender", title="Message sender", description=( "The entity (e.g. person, organization, clinical information system, or" " device) which was the source of the communication." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Organization", "Patient", "Practitioner", "RelatedPerson", ], }, ) sent: fhirtypes.DateTimeType | None = Field( default=None, alias="sent", title="When sent", description="The time when this communication was sent.", json_schema_extra={ "element_property": True, }, ) sent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sent", title="Extension field for ``sent``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "preparation | in-progress | suspended | aborted | completed | entered-" "in-error" ), description="The status of the transmission.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "preparation", "in-progress", "suspended", "aborted", "completed", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Focus of message", description="The patient or group that was the focus of this communication.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) topic: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="topic", title="Focal resources", description=( "The resources which were responsible for or related to producing this " "communication." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Communication`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "definition", "basedOn", "partOf", "status", "notDone", "notDoneReason", "category", "medium", "subject", "recipient", "topic", "context", "sent", "received", "sender", "reasonCode", "reasonReference", "payload", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Communication`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "definition", "basedOn", "partOf", "status", "notDone", "notDoneReason", "subject", "context", "reasonCode", "reasonReference", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class CommunicationPayload(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Message payload. Text, attachment(s), or resource(s) that was communicated to the recipient. """ __resource_type__ = "CommunicationPayload" contentAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="contentAttachment", title="Message part content", description=( "A communicated content (or for multi-part communications, one portion " "of the communication)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, }, ) contentReference: fhirtypes.ReferenceType | None = Field( default=None, alias="contentReference", title="Message part content", description=( "A communicated content (or for multi-part communications, one portion " "of the communication)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) contentString: fhirtypes.StringType | None = Field( default=None, alias="contentString", title="Message part content", description=( "A communicated content (or for multi-part communications, one portion " "of the communication)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, }, ) contentString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contentString", title="Extension field for ``contentString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CommunicationPayload`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "contentString", "contentAttachment", "contentReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CommunicationPayload`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "content": ["contentAttachment", "contentReference", "contentString"] } return one_of_many_fields ================================================ FILE: fhir/resources/STU3/communicationrequest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CommunicationRequest Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class CommunicationRequest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A request for information to be sent to a receiver. A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition. """ __resource_type__ = "CommunicationRequest" authoredOn: fhirtypes.DateTimeType | None = Field( default=None, alias="authoredOn", title="When request transitioned to being actionable", description=( "For draft requests, indicates the date of initial creation. For " "requests with other statuses, indicates the date of activation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoredOn", title="Extension field for ``authoredOn``." ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Fulfills plan or proposal", description=( "A plan or proposal that is fulfilled in whole or in part by this " "request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Message category", description=( "The type of message to be sent such as alert, notification, reminder, " "instruction, etc." ), json_schema_extra={ "element_property": True, }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Encounter or episode leading to message", description=( "The encounter or episode of care within which the communication " "request was created." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) groupIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="groupIdentifier", title="Composite request this is part of", description=( "A shared identifier common to all requests that were authorized more " "or less simultaneously by a single author, representing the identifier" " of the requisition, prescription or similar form." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique identifier", description=( "A unique ID of this request for reference purposes. It must be " "provided if user wants it returned as part of any output, otherwise it" " will be autogenerated, if needed, by CDS system. Does not need to be " "the actual ID of the source system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) medium: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="medium", title="A channel of communication", description="A channel that was used for this communication (e.g. email, fax).", json_schema_extra={ "element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about communication request", description=( "Comments made about the request by the requester, sender, recipient, " "subject or other participants." ), json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When scheduled", description="The time when this communication is to occur.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="When scheduled", description="The time when this communication is to occur.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) payload: typing.List[fhirtypes.CommunicationRequestPayloadType] | None = Field( default=None, alias="payload", title="Message payload", description=( "Text, attachment(s), or resource(s) to be communicated to the " "recipient." ), json_schema_extra={ "element_property": True, }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="Message urgency", description=( "Characterizes how quickly the proposed act must be initiated. Includes" " concepts such as stat, urgent, routine." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Why is communication needed?", description="Describes why the request is being made in coded or textual form.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Why is communication needed?", description="Indicates another resource whose existence justifies this request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "Observation"], }, ) recipient: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="recipient", title="Message recipient", description=( "The entity (e.g. person, organization, clinical information system, " "device, group, or care team) which is the intended target of the " "communication." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Organization", "Patient", "Practitioner", "RelatedPerson", "Group", "CareTeam", ], }, ) replaces: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="replaces", title="Request(s) replaced by this request", description=( "Completed or terminated request(s) whose function is taken by this new" " request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CommunicationRequest"], }, ) requester: fhirtypes.CommunicationRequestRequesterType | None = Field( default=None, alias="requester", title="Who/what is requesting service", description=( "The individual who initiated the request and has responsibility for " "its activation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sender: fhirtypes.ReferenceType | None = Field( default=None, alias="sender", title="Message sender", description=( "The entity (e.g. person, organization, clinical information system, or" " device) which is to be the source of the communication." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Organization", "Patient", "Practitioner", "RelatedPerson", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "draft | active | suspended | cancelled | completed | entered-in-error " "| unknown" ), description="The status of the proposal or order.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "draft", "active", "suspended", "cancelled", "completed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Focus of message", description="The patient or group that is the focus of this communication request.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) topic: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="topic", title="Focal resources", description=( "The resources which were related to producing this communication " "request." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CommunicationRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "replaces", "groupIdentifier", "status", "category", "priority", "medium", "subject", "recipient", "topic", "context", "payload", "occurrenceDateTime", "occurrencePeriod", "authoredOn", "sender", "requester", "reasonCode", "reasonReference", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CommunicationRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "basedOn", "replaces", "groupIdentifier", "status", "priority", "context", "occurrenceDateTime", "occurrencePeriod", "authoredOn", "requester", "reasonCode", "reasonReference", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"occurrence": ["occurrenceDateTime", "occurrencePeriod"]} return one_of_many_fields class CommunicationRequestPayload(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Message payload. Text, attachment(s), or resource(s) to be communicated to the recipient. """ __resource_type__ = "CommunicationRequestPayload" contentAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="contentAttachment", title="Message part content", description=( "The communicated content (or for multi-part communications, one " "portion of the communication)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, }, ) contentReference: fhirtypes.ReferenceType | None = Field( default=None, alias="contentReference", title="Message part content", description=( "The communicated content (or for multi-part communications, one " "portion of the communication)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) contentString: fhirtypes.StringType | None = Field( default=None, alias="contentString", title="Message part content", description=( "The communicated content (or for multi-part communications, one " "portion of the communication)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, }, ) contentString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contentString", title="Extension field for ``contentString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CommunicationRequestPayload`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "contentString", "contentAttachment", "contentReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CommunicationRequestPayload`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "content": ["contentAttachment", "contentReference", "contentString"] } return one_of_many_fields class CommunicationRequestRequester(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who/what is requesting service. The individual who initiated the request and has responsibility for its activation. """ __resource_type__ = "CommunicationRequestRequester" agent: fhirtypes.ReferenceType = Field( default=..., alias="agent", title="Individual making the request", description="The device, practitioner, etc. who initiated the request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Organization", "Patient", "RelatedPerson", "Device", ], }, ) onBehalfOf: fhirtypes.ReferenceType | None = Field( default=None, alias="onBehalfOf", title="Organization agent is acting for", description="The organization the device or practitioner was acting on behalf of.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CommunicationRequestRequester`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "agent", "onBehalfOf"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CommunicationRequestRequester`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "agent", "onBehalfOf"] ================================================ FILE: fhir/resources/STU3/compartmentdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CompartmentDefinition Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class CompartmentDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Compartment Definition for a resource. A compartment definition that defines how resources are accessed on a server. """ __resource_type__ = "CompartmentDefinition" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Patient | Encounter | RelatedPerson | Practitioner | Device", description="Which compartment this definition describes.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "Patient", "Encounter", "RelatedPerson", "Practitioner", "Device", ], }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date this was last changed", description=( "The date (and optionally time) when the compartment definition was " "published. The date must change if and when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the compartment " "definition changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the compartment definition", description=( "A free text natural language description of the compartment definition" " from a consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A boolean value to indicate that this compartment definition is " "authored for testing purposes (or education/evaluation/marketing), and" " is not intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for compartment definition (if applicable)", description=( "A legal or geographic region in which the compartment definition is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this compartment definition (computer friendly)", description=( "A natural language name identifying the compartment definition. This " "name should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the individual or organization that published the " "compartment definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this compartment definition is defined", description=( "Explaination of why this compartment definition is needed and why it " "has been designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) resource: typing.List[fhirtypes.CompartmentDefinitionResourceType] | None = Field( default=None, alias="resource", title="How a resource is related to the compartment", description="Information about how a resource is related to the compartment.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) search: bool | None = Field( default=None, alias="search", title="Whether the search syntax is supported", description="Whether the search syntax is supported,.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) search__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_search", title="Extension field for ``search``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this compartment definition. Enables tracking the life-" "cycle of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this compartment definition (human friendly)", description=( "A short, descriptive, user-friendly title for the compartment " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Logical URI to reference this compartment definition (globally unique)", description=( "An absolute URI that is used to identify this compartment definition " "when it is referenced in a specification, model, design or an " "instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD " "be an address at which this compartment definition is (or will be) " "published. The URL SHOULD include the major version of the compartment" " definition. For more information see [Technical and Business " "Versions](resource.html#versions)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Context the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching for appropriate compartment definition " "instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CompartmentDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "purpose", "useContext", "jurisdiction", "code", "search", "resource", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CompartmentDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "code", "search", "resource", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("code", "code__ext"), ("name", "name__ext"), ("search", "search__ext"), ("status", "status__ext"), ("url", "url__ext"), ] return required_fields class CompartmentDefinitionResource(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. How a resource is related to the compartment. Information about how a resource is related to the compartment. """ __resource_type__ = "CompartmentDefinitionResource" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Name of resource type", description="The name of a resource supported by the server.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Additional documentation about the resource and compartment", description=None, json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) param: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="param", title="Search Parameter Name, or chained parameters", description=( "The name of a search parameter that represents the link to the " "compartment. More than one may be listed because a resource may be " "linked to a compartment in more than one way,." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) param__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_param", title="Extension field for ``param``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CompartmentDefinitionResource`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "param", "documentation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CompartmentDefinitionResource`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "param"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/composition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Composition Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Composition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A set of resources composed into a single coherent clinical statement with clinical attestation. A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained. """ __resource_type__ = "Composition" attester: typing.List[fhirtypes.CompositionAttesterType] | None = Field( default=None, alias="attester", title="Attests to accuracy of composition", description=( "A participant who has attested to the accuracy of the " "composition/document." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) author: typing.List[fhirtypes.ReferenceType] = Field( default=..., alias="author", title="Who and/or what authored the composition", description=( "Identifies who is responsible for the information in the composition, " "not necessarily who typed it in." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Device", "Patient", "RelatedPerson", ], }, ) class_fhir: fhirtypes.CodeableConceptType | None = Field( default=None, alias="class", title="Categorization of Composition", description=( "A categorization for the type of the composition - helps for indexing " "and searching. This may be implied by or derived from the code " "specified in the Composition Type." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) confidentiality: fhirtypes.CodeType | None = Field( default=None, alias="confidentiality", title="As defined by affinity domain", description="The code specifying the level of confidentiality of the Composition.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) confidentiality__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_confidentiality", title="Extension field for ``confidentiality``.", ) custodian: fhirtypes.ReferenceType | None = Field( default=None, alias="custodian", title="Organization which maintains the composition", description=( "Identifies the organization or group who is responsible for ongoing " "maintenance of and access to the composition/document information." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Composition editing time", description=( "The composition editing time, when the composition was last logically " "changed by the author." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Context of the Composition", description=( "Describes the clinical encounter or type of care this documentation is" " associated with." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) event: typing.List[fhirtypes.CompositionEventType] | None = Field( default=None, alias="event", title="The clinical service(s) being documented", description=( "The clinical service, such as a colonoscopy or an appendectomy, being " "documented." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Logical identifier of composition (version-independent)", description=( "Logical identifier for the composition, assigned when created. This " "identifier stays constant as the composition is changed over time." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) relatesTo: typing.List[fhirtypes.CompositionRelatesToType] | None = Field( default=None, alias="relatesTo", title="Relationships to other compositions/documents", description=( "Relationships that this composition has with other compositions or " "documents that already exist." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) section: typing.List[fhirtypes.CompositionSectionType] | None = Field( default=None, alias="section", title="Composition is broken into sections", description="The root of the sections that make up the composition.", json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="preliminary | final | amended | entered-in-error", description=( "The workflow/clinical status of this composition. The status is a " "marker for the clinical standing of the document." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["preliminary", "final", "amended", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who and/or what the composition is about", description=( "Who or what the composition is about. The composition can be about a " "person, (patient or healthcare practitioner), a device (e.g. a " "machine) or even a group of subjects (such as a document about a herd " "of livestock, or a set of patients that share a common exposure)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Human Readable name/title", description="Official human-readable label for the composition.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Kind of composition (LOINC if possible)", description=( "Specifies the particular kind of composition (e.g. History and " "Physical, Discharge Summary, Progress Note). This usually equates to " "the purpose of making the composition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Composition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "type", "class", "subject", "encounter", "date", "author", "title", "confidentiality", "attester", "custodian", "relatesTo", "event", "section", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Composition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "type", "class", "subject", "encounter", "date", "author", "title", "confidentiality", "attester", "custodian", "relatesTo", "event", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("date", "date__ext"), ("status", "status__ext"), ("title", "title__ext"), ] return required_fields class CompositionAttester(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Attests to accuracy of composition. A participant who has attested to the accuracy of the composition/document. """ __resource_type__ = "CompositionAttester" mode: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="mode", title="personal | professional | legal | official", description="The type of attestation the authenticator offers.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["personal", "professional", "legal", "official"], }, ) mode__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) party: fhirtypes.ReferenceType | None = Field( default=None, alias="party", title="Who attested the composition", description="Who attested the composition in the specified way.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Practitioner", "Organization"], }, ) time: fhirtypes.DateTimeType | None = Field( default=None, alias="time", title="When the composition was attested", description="When the composition was attested by the party.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) time__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_time", title="Extension field for ``time``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CompositionAttester`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "mode", "time", "party"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CompositionAttester`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "mode", "time", "party"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("mode", "mode__ext")] return required_fields class CompositionEvent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The clinical service(s) being documented. The clinical service, such as a colonoscopy or an appendectomy, being documented. """ __resource_type__ = "CompositionEvent" code: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="code", title="Code(s) that apply to the event being documented", description=( "This list of codes represents the main clinical acts, such as a " "colonoscopy or an appendectomy, being documented. In some cases, the " 'event is inherent in the typeCode, such as a "History and Physical ' 'Report" in which the procedure being documented is necessarily a ' '"History and Physical" act.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) detail: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="detail", title="The event(s) being documented", description=( "The description and/or reference of the event(s) being documented. For" " example, this could be used to document such a colonoscopy or an " "appendectomy." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="The period covered by the documentation", description=( "The period of time covered by the documentation. There is no assertion" " that the documentation is a complete representation for this period, " "only that it documents events during this time." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CompositionEvent`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "period", "detail"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CompositionEvent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "period", "detail"] class CompositionRelatesTo(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Relationships to other compositions/documents. Relationships that this composition has with other compositions or documents that already exist. """ __resource_type__ = "CompositionRelatesTo" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="replaces | transforms | signs | appends", description=( "The type of relationship that this composition has with anther " "composition or document." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["replaces", "transforms", "signs", "appends"], }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) targetIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="targetIdentifier", title="Target of the relationship", description="The target composition/document of this relationship.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e target[x] "one_of_many": "target", "one_of_many_required": True, }, ) targetReference: fhirtypes.ReferenceType | None = Field( default=None, alias="targetReference", title="Target of the relationship", description="The target composition/document of this relationship.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e target[x] "one_of_many": "target", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Composition"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CompositionRelatesTo`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "targetIdentifier", "targetReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CompositionRelatesTo`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "targetIdentifier", "targetReference"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"target": ["targetIdentifier", "targetReference"]} return one_of_many_fields class CompositionSection(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Composition is broken into sections. The root of the sections that make up the composition. """ __resource_type__ = "CompositionSection" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Classification of section (recommended)", description=( "A code identifying the kind of content contained within the section. " "This must be consistent with the section title." ), json_schema_extra={ "element_property": True, }, ) emptyReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="emptyReason", title="Why the section is empty", description=( "If the section is empty, why the list is empty. An empty section " "typically has some text explaining the empty reason." ), json_schema_extra={ "element_property": True, }, ) entry: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="entry", title="A reference to data that supports this section", description=( "A reference to the actual resource from which the narrative in the " "section is derived." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="working | snapshot | changes", description=( "How the entry list was prepared - whether it is a working list that is" " suitable for being maintained on an ongoing basis, or if it " "represents a snapshot of a list of items from another source, or " "whether it is a prepared list where items may be marked as added, " "modified or deleted." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["working", "snapshot", "changes"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) orderedBy: fhirtypes.CodeableConceptType | None = Field( default=None, alias="orderedBy", title="Order of section entries", description="Specifies the order applied to the items in the section entries.", json_schema_extra={ "element_property": True, }, ) section: typing.List[fhirtypes.CompositionSectionType] | None = Field( default=None, alias="section", title="Nested Section", description="A nested sub-section within this section.", json_schema_extra={ "element_property": True, }, ) text: fhirtypes.NarrativeType | None = Field( default=None, alias="text", title="Text summary of the section, for human interpretation", description=( "A human-readable narrative that contains the attested content of the " "section, used to represent the content of the resource to a human. The" " narrative need not encode all the structured data, but is required to" ' contain sufficient detail to make it "clinically safe" for a human to' " just read the narrative." ), json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Label for section (e.g. for ToC)", description=( "The label for this particular section. This will be part of the " "rendered content for the document, and is often used to build a table " "of contents." ), json_schema_extra={ "element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CompositionSection`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "title", "code", "text", "mode", "orderedBy", "entry", "emptyReason", "section", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CompositionSection`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "mode"] ================================================ FILE: fhir/resources/STU3/conceptmap.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ConceptMap Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ConceptMap(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A map from one set of concepts to one or more other concepts. A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models. """ __resource_type__ = "ConceptMap" contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the concept map and/or its contents." " Copyright statements are generally legal restrictions on the use and " "publishing of the concept map." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date this was last changed", description=( "The date (and optionally time) when the concept map was published. " "The date must change if and when the business version changes and it " "must change if the status code changes. In addition, it should change " "when the substantive content of the concept map changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the concept map", description=( "A free text natural language description of the concept map from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A boolean value to indicate that this concept map is authored for " "testing purposes (or education/evaluation/marketing), and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) group: typing.List[fhirtypes.ConceptMapGroupType] | None = Field( default=None, alias="group", title="Same source and target systems", description="A group of mappings that all have the same source and target system.", json_schema_extra={ "element_property": True, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Additional identifier for the concept map", description=( "A formal identifier that is used to identify this concept map when it " "is represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for concept map (if applicable)", description=( "A legal or geographic region in which the concept map is intended to " "be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this concept map (computer friendly)", description=( "A natural language name identifying the concept map. This name should " "be usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the individual or organization that published the concept " "map." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this concept map is defined", description=( "Explaination of why this concept map is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) sourceReference: fhirtypes.ReferenceType | None = Field( default=None, alias="sourceReference", title="Identifies the source of the concepts which are being mapped", description=( "The source value set that specifies the concepts that are being " "mapped." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e source[x] "one_of_many": "source", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) sourceUri: fhirtypes.UriType | None = Field( default=None, alias="sourceUri", title="Identifies the source of the concepts which are being mapped", description=( "The source value set that specifies the concepts that are being " "mapped." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e source[x] "one_of_many": "source", "one_of_many_required": False, }, ) sourceUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceUri", title="Extension field for ``sourceUri``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this concept map. Enables tracking the life-cycle of the" " content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) targetReference: fhirtypes.ReferenceType | None = Field( default=None, alias="targetReference", title="Provides context to the mappings", description=( "The target value set provides context to the mappings. Note that the " "mapping is made between concepts, not between value sets, but the " "value set provides important context about how the concept mapping " "choices are made." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e target[x] "one_of_many": "target", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) targetUri: fhirtypes.UriType | None = Field( default=None, alias="targetUri", title="Provides context to the mappings", description=( "The target value set provides context to the mappings. Note that the " "mapping is made between concepts, not between value sets, but the " "value set provides important context about how the concept mapping " "choices are made." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e target[x] "one_of_many": "target", "one_of_many_required": False, }, ) targetUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_targetUri", title="Extension field for ``targetUri``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this concept map (human friendly)", description="A short, descriptive, user-friendly title for the concept map.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Logical URI to reference this concept map (globally unique)", description=( "An absolute URI that is used to identify this concept map when it is " "referenced in a specification, model, design or an instance. This " "SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at" " which this concept map is (or will be) published. The URL SHOULD " "include the major version of the concept map. For more information see" " [Technical and Business Versions](resource.html#versions)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Context the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching for appropriate concept map instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the concept map", description=( "The identifier that is used to identify this version of the concept " "map when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the concept map author" " and is not expected to be globally unique. For example, it might be a" " timestamp (e.g. yyyymmdd) if a managed version is not available. " "There is also no expectation that versions can be placed in a " "lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConceptMap`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "sourceUri", "sourceReference", "targetUri", "targetReference", "group", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConceptMap`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "sourceUri", "sourceReference", "targetUri", "targetReference", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "source": ["sourceReference", "sourceUri"], "target": ["targetReference", "targetUri"], } return one_of_many_fields class ConceptMapGroup(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Same source and target systems. A group of mappings that all have the same source and target system. """ __resource_type__ = "ConceptMapGroup" element: typing.List[fhirtypes.ConceptMapGroupElementType] = Field( default=..., alias="element", title="Mappings for a concept from the source set", description=( "Mappings for an individual concept in the source to one or more " "concepts in the target." ), json_schema_extra={ "element_property": True, }, ) source: fhirtypes.UriType | None = Field( default=None, alias="source", title="Code System (if value set crosses code systems)", description=( "An absolute URI that identifies the Code System (if the source is a " "value set that crosses more than one code system)." ), json_schema_extra={ "element_property": True, }, ) source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_source", title="Extension field for ``source``." ) sourceVersion: fhirtypes.StringType | None = Field( default=None, alias="sourceVersion", title="Specific version of the code system", description=( "The specific version of the code system, as determined by the code " "system authority." ), json_schema_extra={ "element_property": True, }, ) sourceVersion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceVersion", title="Extension field for ``sourceVersion``.", ) target: fhirtypes.UriType | None = Field( default=None, alias="target", title="System of the target (if necessary)", description=( "An absolute URI that identifies the code system of the target code (if" " the target is a value set that cross code systems)." ), json_schema_extra={ "element_property": True, }, ) target__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_target", title="Extension field for ``target``." ) targetVersion: fhirtypes.StringType | None = Field( default=None, alias="targetVersion", title="Specific version of the code system", description=( "The specific version of the code system, as determined by the code " "system authority." ), json_schema_extra={ "element_property": True, }, ) targetVersion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_targetVersion", title="Extension field for ``targetVersion``.", ) unmapped: fhirtypes.ConceptMapGroupUnmappedType | None = Field( default=None, alias="unmapped", title="When no match in the mappings", description="What to do when there is no match in the mappings in the group.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConceptMapGroup`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "source", "sourceVersion", "target", "targetVersion", "element", "unmapped", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConceptMapGroup`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ConceptMapGroupElement(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Mappings for a concept from the source set. Mappings for an individual concept in the source to one or more concepts in the target. """ __resource_type__ = "ConceptMapGroupElement" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Identifies element being mapped", description="Identity (code or path) or the element/item being mapped.", json_schema_extra={ "element_property": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Display for the code", description=( "The display for the code. The display is only provided to help editors" " when editing the concept map." ), json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) target: typing.List[fhirtypes.ConceptMapGroupElementTargetType] | None = Field( default=None, alias="target", title="Concept in target system for element", description="A concept from the target value set that this concept maps to.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConceptMapGroupElement`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "display", "target"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConceptMapGroupElement`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ConceptMapGroupElementTarget(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Concept in target system for element. A concept from the target value set that this concept maps to. """ __resource_type__ = "ConceptMapGroupElementTarget" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Code that identifies the target element", description="Identity (code or path) or the element/item that the map refers to.", json_schema_extra={ "element_property": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Description of status/issues in mapping", description=( "A description of status/issues in mapping that conveys additional " "information not represented in the structured data." ), json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) dependsOn: typing.List[ fhirtypes.ConceptMapGroupElementTargetDependsOnType ] | None = Field( default=None, alias="dependsOn", title="Other elements required for this mapping (from context)", description=( "A set of additional dependencies for this mapping to hold. This " "mapping is only applicable if the specified element can be resolved, " "and it has the specified value." ), json_schema_extra={ "element_property": True, }, ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Display for the code", description=( "The display for the code. The display is only provided to help editors" " when editing the concept map." ), json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) equivalence: fhirtypes.CodeType | None = Field( default=None, alias="equivalence", title=( "relatedto | equivalent | equal | wider | subsumes | narrower | " "specializes | inexact | unmatched | disjoint" ), description=( "The equivalence between the source and target concepts (counting for " "the dependencies and products). The equivalence is read from target to" " source (e.g. the target is 'wider' than the source)." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "relatedto", "equivalent", "equal", "wider", "subsumes", "narrower", "specializes", "inexact", "unmatched", "disjoint", ], }, ) equivalence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_equivalence", title="Extension field for ``equivalence``." ) product: typing.List[ fhirtypes.ConceptMapGroupElementTargetDependsOnType ] | None = Field( default=None, alias="product", title="Other concepts that this mapping also produces", description=( "A set of additional outcomes from this mapping to other elements. To " "properly execute this mapping, the specified element must be mapped to" " some data element or source that is in context. The mapping may still" " be useful without a place for the additional data elements, but the " "equivalence cannot be relied on." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConceptMapGroupElementTarget`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "display", "equivalence", "comment", "dependsOn", "product", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConceptMapGroupElementTarget`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ConceptMapGroupElementTargetDependsOn(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Other elements required for this mapping (from context). A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value. """ __resource_type__ = "ConceptMapGroupElementTargetDependsOn" code: fhirtypes.StringType | None = Field( default=None, alias="code", title="Value of the referenced element", description=( "Identity (code or path) or the element/item/ValueSet that the map " "depends on / refers to." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Display for the code", description=( "The display for the code. The display is only provided to help editors" " when editing the concept map." ), json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) property: fhirtypes.UriType | None = Field( default=None, alias="property", title="Reference to property mapping depends on", description=( "A reference to an element that holds a coded value that corresponds to" " a code system property. The idea is that the information model " "carries an element somwhere that is labeled to correspond with a code " "system property." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) property__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_property", title="Extension field for ``property``." ) system: fhirtypes.UriType | None = Field( default=None, alias="system", title="Code System (if necessary)", description=( "An absolute URI that identifies the code system of the dependency code" " (if the source/dependency is a value set that crosses code systems)." ), json_schema_extra={ "element_property": True, }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConceptMapGroupElementTargetDependsOn`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "property", "system", "code", "display", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConceptMapGroupElementTargetDependsOn`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext"), ("property", "property__ext")] return required_fields class ConceptMapGroupUnmapped(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. When no match in the mappings. What to do when there is no match in the mappings in the group. """ __resource_type__ = "ConceptMapGroupUnmapped" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Fixed code when mode = fixed", description=( "The fixed code to use when the mode = 'fixed' - all unmapped codes " "are mapped to a single fixed code." ), json_schema_extra={ "element_property": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Display for the code", description=( "The display for the code. The display is only provided to help editors" " when editing the concept map." ), json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="provided | fixed | other-map", description=( "Defines which action to take if there is no match in the group. One of" " 3 actions is possible: use the unmapped code (this is useful when " "doing a mapping between versions, and only a few codes have changed), " "use a fixed code (a default code), or alternatively, a reference to a " "different concept map can be provided (by canonical URL)." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["provided", "fixed", "other-map"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Canonical URL for other concept map", description="The canonical URL of the map to use if this map contains no mapping.", json_schema_extra={ "element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConceptMapGroupUnmapped`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "mode", "code", "display", "url", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConceptMapGroupUnmapped`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("mode", "mode__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/condition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Condition Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Condition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Detailed information about conditions, problems or diagnoses. A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern. """ __resource_type__ = "Condition" abatementAge: fhirtypes.AgeType | None = Field( default=None, alias="abatementAge", title="If/when in resolution/remission", description=( "The date or estimated date that the condition resolved or went into " 'remission. This is called "abatement" because of the many overloaded ' 'connotations associated with "remission" or "resolution" - Conditions ' "are never really resolved, but they can abate." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e abatement[x] "one_of_many": "abatement", "one_of_many_required": False, }, ) abatementBoolean: bool | None = Field( default=None, alias="abatementBoolean", title="If/when in resolution/remission", description=( "The date or estimated date that the condition resolved or went into " 'remission. This is called "abatement" because of the many overloaded ' 'connotations associated with "remission" or "resolution" - Conditions ' "are never really resolved, but they can abate." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e abatement[x] "one_of_many": "abatement", "one_of_many_required": False, }, ) abatementBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_abatementBoolean", title="Extension field for ``abatementBoolean``.", ) abatementDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="abatementDateTime", title="If/when in resolution/remission", description=( "The date or estimated date that the condition resolved or went into " 'remission. This is called "abatement" because of the many overloaded ' 'connotations associated with "remission" or "resolution" - Conditions ' "are never really resolved, but they can abate." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e abatement[x] "one_of_many": "abatement", "one_of_many_required": False, }, ) abatementDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_abatementDateTime", title="Extension field for ``abatementDateTime``.", ) abatementPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="abatementPeriod", title="If/when in resolution/remission", description=( "The date or estimated date that the condition resolved or went into " 'remission. This is called "abatement" because of the many overloaded ' 'connotations associated with "remission" or "resolution" - Conditions ' "are never really resolved, but they can abate." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e abatement[x] "one_of_many": "abatement", "one_of_many_required": False, }, ) abatementRange: fhirtypes.RangeType | None = Field( default=None, alias="abatementRange", title="If/when in resolution/remission", description=( "The date or estimated date that the condition resolved or went into " 'remission. This is called "abatement" because of the many overloaded ' 'connotations associated with "remission" or "resolution" - Conditions ' "are never really resolved, but they can abate." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e abatement[x] "one_of_many": "abatement", "one_of_many_required": False, }, ) abatementString: fhirtypes.StringType | None = Field( default=None, alias="abatementString", title="If/when in resolution/remission", description=( "The date or estimated date that the condition resolved or went into " 'remission. This is called "abatement" because of the many overloaded ' 'connotations associated with "remission" or "resolution" - Conditions ' "are never really resolved, but they can abate." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e abatement[x] "one_of_many": "abatement", "one_of_many_required": False, }, ) abatementString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_abatementString", title="Extension field for ``abatementString``.", ) assertedDate: fhirtypes.DateTimeType | None = Field( default=None, alias="assertedDate", title="Date record was believed accurate", description=( "The date on which the existance of the Condition was first asserted or" " acknowledged." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) assertedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_assertedDate", title="Extension field for ``assertedDate``.", ) asserter: fhirtypes.ReferenceType | None = Field( default=None, alias="asserter", title="Person who asserts this condition", description="Individual who is making the condition statement.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "Patient", "RelatedPerson"], }, ) bodySite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="bodySite", title="Anatomical location, if relevant", description="The anatomical location where this condition manifests itself.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="problem-list-item | encounter-diagnosis", description="A category assigned to the condition.", json_schema_extra={ "element_property": True, }, ) clinicalStatus: fhirtypes.CodeType | None = Field( default=None, alias="clinicalStatus", title="active | recurrence | inactive | remission | resolved", description="The clinical status of the condition.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "active", "recurrence", "inactive", "remission", "resolved", ], }, ) clinicalStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_clinicalStatus", title="Extension field for ``clinicalStatus``.", ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Identification of the condition, problem or diagnosis", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Encounter or episode when condition first asserted", description="Encounter during which the condition was first asserted.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) evidence: typing.List[fhirtypes.ConditionEvidenceType] | None = Field( default=None, alias="evidence", title="Supporting evidence", description=( "Supporting Evidence / manifestations that are the basis on which this " "condition is suspected or confirmed." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Ids for this condition", description=( "This records identifiers associated with this condition that are " "defined by business processes and/or used to refer to it when a direct" " URL reference to the resource itself is not appropriate (e.g. in CDA " "documents, or in written / printed documentation)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Additional information about the Condition", description=( "Additional information about the Condition. This is a general " "notes/comments entry for description of the Condition, its diagnosis " "and prognosis." ), json_schema_extra={ "element_property": True, }, ) onsetAge: fhirtypes.AgeType | None = Field( default=None, alias="onsetAge", title="Estimated or actual date, date-time, or age", description=( "Estimated or actual date or date-time the condition began, in the " "opinion of the clinician." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="onsetDateTime", title="Estimated or actual date, date-time, or age", description=( "Estimated or actual date or date-time the condition began, in the " "opinion of the clinician." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onsetDateTime", title="Extension field for ``onsetDateTime``.", ) onsetPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="onsetPeriod", title="Estimated or actual date, date-time, or age", description=( "Estimated or actual date or date-time the condition began, in the " "opinion of the clinician." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetRange: fhirtypes.RangeType | None = Field( default=None, alias="onsetRange", title="Estimated or actual date, date-time, or age", description=( "Estimated or actual date or date-time the condition began, in the " "opinion of the clinician." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetString: fhirtypes.StringType | None = Field( default=None, alias="onsetString", title="Estimated or actual date, date-time, or age", description=( "Estimated or actual date or date-time the condition began, in the " "opinion of the clinician." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onsetString", title="Extension field for ``onsetString``." ) severity: fhirtypes.CodeableConceptType | None = Field( default=None, alias="severity", title="Subjective severity of condition", description=( "A subjective assessment of the severity of the condition as evaluated " "by the clinician." ), json_schema_extra={ "element_property": True, }, ) stage: fhirtypes.ConditionStageType | None = Field( default=None, alias="stage", title="Stage/grade, usually assessed formally", description=( "Clinical stage or grade of a condition. May include formal severity " "assessments." ), json_schema_extra={ "element_property": True, }, ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who has the condition?", description=( "Indicates the patient or group who the condition record is associated " "with." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) verificationStatus: fhirtypes.CodeType | None = Field( default=None, alias="verificationStatus", title=( "provisional | differential | confirmed | refuted | entered-in-error | " "unknown" ), description=( "The verification status to support the clinical status of the " "condition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "provisional", "differential", "confirmed", "refuted", "entered-in-error", "unknown", ], }, ) verificationStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_verificationStatus", title="Extension field for ``verificationStatus``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Condition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "clinicalStatus", "verificationStatus", "category", "severity", "code", "bodySite", "subject", "context", "onsetDateTime", "onsetAge", "onsetPeriod", "onsetRange", "onsetString", "abatementDateTime", "abatementAge", "abatementBoolean", "abatementPeriod", "abatementRange", "abatementString", "assertedDate", "asserter", "stage", "evidence", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Condition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "clinicalStatus", "verificationStatus", "code", "bodySite", "subject", "context", "onsetDateTime", "onsetAge", "onsetPeriod", "onsetRange", "onsetString", "assertedDate", "asserter", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "abatement": [ "abatementAge", "abatementBoolean", "abatementDateTime", "abatementPeriod", "abatementRange", "abatementString", ], "onset": [ "onsetAge", "onsetDateTime", "onsetPeriod", "onsetRange", "onsetString", ], } return one_of_many_fields class ConditionEvidence(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Supporting evidence. Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed. """ __resource_type__ = "ConditionEvidence" code: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="code", title="Manifestation/symptom", description=( "A manifestation or symptom that led to the recording of this " "condition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) detail: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="detail", title="Supporting information found elsewhere", description="Links to other relevant information, including pathology reports.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConditionEvidence`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "detail"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConditionEvidence`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "detail"] class ConditionStage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Stage/grade, usually assessed formally. Clinical stage or grade of a condition. May include formal severity assessments. """ __resource_type__ = "ConditionStage" assessment: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="assessment", title="Formal record of assessment", description=( "Reference to a formal record of the evidence on which the staging " "assessment is based." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "ClinicalImpression", "DiagnosticReport", "Observation", ], }, ) summary: fhirtypes.CodeableConceptType | None = Field( default=None, alias="summary", title="Simple summary (disease specific)", description=( 'A simple summary of the stage such as "Stage 3". The determination of ' "the stage is disease-specific." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConditionStage`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "summary", "assessment"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConditionStage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/consent.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Consent Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Consent(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A healthcare consumer's policy choices to permits or denies recipients or roles to perform actions for specific purposes and periods of time. A record of a healthcare consumer’s policy choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time. """ __resource_type__ = "Consent" action: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="action", title="Actions controlled by this consent", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) actor: typing.List[fhirtypes.ConsentActorType] | None = Field( default=None, alias="actor", title="Who|what controlled by this consent (or group, by role)", description=( "Who or what is controlled by this consent. Use group to identify a set" " of actors by some property they share (e.g. 'admitting officers')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Classification of the consent statement - for indexing/retrieval", description=( "A classification of the type of consents found in the statement. This " "element supports indexing and retrieval of consent statements." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) consentingParty: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="consentingParty", title="Who is agreeing to the policy and exceptions", description=( "Either the Grantor, which is the entity responsible for granting the " "rights listed in a Consent Directive or the Grantee, which is the " "entity responsible for complying with the Consent Directive, including" " any obligations or limitations on authorizations and enforcement of " "prohibitions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Organization", "Patient", "Practitioner", "RelatedPerson", ], }, ) data: typing.List[fhirtypes.ConsentDataType] | None = Field( default=None, alias="data", title="Data controlled by this consent", description=( "The resources controlled by this consent, if specific resources are " "referenced." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dataPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="dataPeriod", title="Timeframe for data controlled by this consent", description=( "Clinical or Operational Relevant period of time that bounds the data " "controlled by this consent." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="dateTime", title="When this Consent was created or indexed", description="When this Consent was issued / created / indexed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dateTime", title="Extension field for ``dateTime``." ) except_fhir: typing.List[fhirtypes.ConsentExceptType] | None = Field( default=None, alias="except", title="Additional rule - addition or removal of permissions", description=( "An exception to the base policy of this consent. An exception can be " "an addition or removal of access permissions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Identifier for this record (external references)", description="Unique identifier for this copy of the Consent Statement.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) organization: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="organization", title="Custodian of the consent", description=( "The organization that manages the consent, and the framework within " "which it is executed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Who the consent applies to", description="The patient/healthcare consumer to whom this consent applies.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Period that this consent applies", description="Relevant time or time-period when this Consent is applicable.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) policy: typing.List[fhirtypes.ConsentPolicyType] | None = Field( default=None, alias="policy", title="Policies covered by this consent", description=( "The references to the policies that are included in this consent " "scope. Policies may be organizational, but are often defined " "jurisdictionally, or in law." ), json_schema_extra={ "element_property": True, }, ) policyRule: fhirtypes.UriType | None = Field( default=None, alias="policyRule", title="Policy that this consents to", description="A referece to the specific computable policy.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) policyRule__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_policyRule", title="Extension field for ``policyRule``." ) purpose: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="purpose", title="Context of activities for which the agreement is made", description=( "The context of the activities a user is taking - why the user is " "accessing the data - that are controlled by this consent." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) securityLabel: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="securityLabel", title="Security Labels that define affected resources", description=( "A set of security labels that define which resources are controlled by" " this consent. If more than one label is specified, all resources must" " have all the specified labels." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sourceAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="sourceAttachment", title="Source from which this consent is taken", description=( "The source on which this consent statement is based. The source might " "be a scanned original paper form, or a reference to a consent that " "links back to such a source, a reference to a document repository " "(e.g. XDS) that stores the original consent document." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e source[x] "one_of_many": "source", "one_of_many_required": False, }, ) sourceIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="sourceIdentifier", title="Source from which this consent is taken", description=( "The source on which this consent statement is based. The source might " "be a scanned original paper form, or a reference to a consent that " "links back to such a source, a reference to a document repository " "(e.g. XDS) that stores the original consent document." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e source[x] "one_of_many": "source", "one_of_many_required": False, }, ) sourceReference: fhirtypes.ReferenceType | None = Field( default=None, alias="sourceReference", title="Source from which this consent is taken", description=( "The source on which this consent statement is based. The source might " "be a scanned original paper form, or a reference to a consent that " "links back to such a source, a reference to a document repository " "(e.g. XDS) that stores the original consent document." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e source[x] "one_of_many": "source", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Consent", "DocumentReference", "Contract", "QuestionnaireResponse", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | proposed | active | rejected | inactive | entered-in-error", description="Indicates the current state of this consent.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "draft", "proposed", "active", "rejected", "inactive", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Consent`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "category", "patient", "period", "dateTime", "consentingParty", "actor", "action", "organization", "sourceAttachment", "sourceIdentifier", "sourceReference", "sourceReference", "sourceReference", "sourceReference", "policy", "policyRule", "securityLabel", "purpose", "dataPeriod", "data", "except", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Consent`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "category", "patient", "period", "dateTime", "consentingParty", "actor", "action", "organization", "sourceAttachment", "sourceIdentifier", "sourceReference", "sourceReference", "sourceReference", "sourceReference", "policyRule", "securityLabel", "purpose", "dataPeriod", "data", "except", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "source": ["sourceAttachment", "sourceIdentifier", "sourceReference"] } return one_of_many_fields class ConsentActor(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who|what controlled by this consent (or group, by role). Who or what is controlled by this consent. Use group to identify a set of actors by some property they share (e.g. 'admitting officers'). """ __resource_type__ = "ConsentActor" reference: fhirtypes.ReferenceType = Field( default=..., alias="reference", title="Resource for the actor (or group, by role)", description=( "The resource that identifies the actor. To identify a actors by type, " "use group to identify a set of actors by some property they share " "(e.g. 'admitting officers')." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Group", "CareTeam", "Organization", "Patient", "Practitioner", "RelatedPerson", ], }, ) role: fhirtypes.CodeableConceptType = Field( default=..., alias="role", title="How the actor is involved", description=( "How the individual is involved in the resources content that is " "described in the consent." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConsentActor`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "role", "reference"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConsentActor`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ConsentData(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Data controlled by this consent. The resources controlled by this consent, if specific resources are referenced. """ __resource_type__ = "ConsentData" meaning: fhirtypes.CodeType | None = Field( default=None, alias="meaning", title="instance | related | dependents | authoredby", description=( "How the resource reference is interpreted when testing consent " "restrictions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["instance", "related", "dependents", "authoredby"], }, ) meaning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_meaning", title="Extension field for ``meaning``." ) reference: fhirtypes.ReferenceType = Field( default=..., alias="reference", title="The actual data reference", description=( "A reference to a specific resource that defines which resources are " "covered by this consent." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConsentData`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "meaning", "reference"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConsentData`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "meaning", "reference"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("meaning", "meaning__ext")] return required_fields class ConsentExcept(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional rule - addition or removal of permissions. An exception to the base policy of this consent. An exception can be an addition or removal of access permissions. """ __resource_type__ = "ConsentExcept" action: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="action", title="Actions controlled by this exception", description="Actions controlled by this Exception.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) actor: typing.List[fhirtypes.ConsentExceptActorType] | None = Field( default=None, alias="actor", title="Who|what controlled by this exception (or group, by role)", description=( "Who or what is controlled by this Exception. Use group to identify a " "set of actors by some property they share (e.g. 'admitting officers')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) class_fhir: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="class", title="e.g. Resource Type, Profile, or CDA etc", description=( "The class of information covered by this exception. The type can be a " "FHIR resource type, a profile on a type, or a CDA document, or some " "other type that indicates what sort of information the consent relates" " to." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="code", title="e.g. LOINC or SNOMED CT code, etc in the content", description="If this code is found in an instance, then the exception applies.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) data: typing.List[fhirtypes.ConsentExceptDataType] | None = Field( default=None, alias="data", title="Data controlled by this exception", description=( "The resources controlled by this exception, if specific resources are " "referenced." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dataPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="dataPeriod", title="Timeframe for data controlled by this exception", description=( "Clinical or Operational Relevant period of time that bounds the data " "controlled by this exception." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Timeframe for this exception", description="The timeframe in this exception is valid.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) purpose: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="purpose", title="Context of activities covered by this exception", description=( "The context of the activities a user is taking - why the user is " "accessing the data - that are controlled by this exception." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) securityLabel: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="securityLabel", title="Security Labels that define affected resources", description=( "A set of security labels that define which resources are controlled by" " this exception. If more than one label is specified, all resources " "must have all the specified labels." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="deny | permit", description=( "Action to take - permit or deny - when the exception conditions are " "met." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["deny", "permit"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConsentExcept`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "period", "actor", "action", "securityLabel", "purpose", "class", "code", "dataPeriod", "data", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConsentExcept`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "period", "actor", "action", "securityLabel", "purpose", "class", "code", "dataPeriod", "data", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields class ConsentExceptActor(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who|what controlled by this exception (or group, by role). Who or what is controlled by this Exception. Use group to identify a set of actors by some property they share (e.g. 'admitting officers'). """ __resource_type__ = "ConsentExceptActor" reference: fhirtypes.ReferenceType = Field( default=..., alias="reference", title="Resource for the actor (or group, by role)", description=( "The resource that identifies the actor. To identify a actors by type, " "use group to identify a set of actors by some property they share " "(e.g. 'admitting officers')." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Group", "CareTeam", "Organization", "Patient", "Practitioner", "RelatedPerson", ], }, ) role: fhirtypes.CodeableConceptType = Field( default=..., alias="role", title="How the actor is involved", description=( "How the individual is involved in the resources content that is " "described in the exception." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConsentExceptActor`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "role", "reference"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConsentExceptActor`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ConsentExceptData(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Data controlled by this exception. The resources controlled by this exception, if specific resources are referenced. """ __resource_type__ = "ConsentExceptData" meaning: fhirtypes.CodeType | None = Field( default=None, alias="meaning", title="instance | related | dependents | authoredby", description=( "How the resource reference is interpreted when testing consent " "restrictions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["instance", "related", "dependents", "authoredby"], }, ) meaning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_meaning", title="Extension field for ``meaning``." ) reference: fhirtypes.ReferenceType = Field( default=..., alias="reference", title="The actual data reference", description=( "A reference to a specific resource that defines which resources are " "covered by this consent." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConsentExceptData`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "meaning", "reference"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConsentExceptData`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "meaning", "reference"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("meaning", "meaning__ext")] return required_fields class ConsentPolicy(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Policies covered by this consent. The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law. """ __resource_type__ = "ConsentPolicy" authority: fhirtypes.UriType | None = Field( default=None, alias="authority", title="Enforcement source for policy", description=( "Entity or Organization having regulatory jurisdiction or " "accountability for \u00a0enforcing policies pertaining to Consent " "Directives." ), json_schema_extra={ "element_property": True, }, ) authority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authority", title="Extension field for ``authority``." ) uri: fhirtypes.UriType | None = Field( default=None, alias="uri", title="Specific policy covered by this consent", description=( "The references to the policies that are included in this consent " "scope. Policies may be organizational, but are often defined " "jurisdictionally, or in law." ), json_schema_extra={ "element_property": True, }, ) uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uri", title="Extension field for ``uri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConsentPolicy`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "authority", "uri"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConsentPolicy`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/contactdetail.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ContactDetail Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class ContactDetail(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contact information. Specifies contact information for a person or organization. """ __resource_type__ = "ContactDetail" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name of an individual to contact", description="The name of an individual to contact.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="Contact details for individual or organization", description=( "The contact details for the individual (if a name was provided) or the" " organization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContactDetail`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "name", "telecom"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContactDetail`` according to specification, with preserving the original sequence order. """ return ["name", "telecom"] ================================================ FILE: fhir/resources/STU3/contactpoint.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ContactPoint Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class ContactPoint(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details of a Technology mediated contact point (phone, fax, email, etc.). Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc. """ __resource_type__ = "ContactPoint" period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period when the contact point was/is in use", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) rank: fhirtypes.PositiveIntType | None = Field( default=None, alias="rank", title="Specify preferred order of use (1 = highest)", description=( "Specifies a preferred order in which to use a set of contacts. " "Contacts are ranked with lower values coming before higher values." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) rank__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rank", title="Extension field for ``rank``." ) system: fhirtypes.CodeType | None = Field( default=None, alias="system", title="phone | fax | email | pager | url | sms | other", description=( "Telecommunications form for contact point - what communications system" " is required to make use of the contact." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["phone", "fax", "email", "pager", "url", "sms", "other"], }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="home | work | temp | old | mobile - purpose of this contact point", description="Identifies the purpose for the contact point.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["home", "work", "temp", "old", "mobile"], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The actual contact point details", description=( "The actual contact point details, in a form that is meaningful to the " "designated communication system (i.e. phone number or email address)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContactPoint`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "system", "value", "use", "rank", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContactPoint`` according to specification, with preserving the original sequence order. """ return ["system", "value", "use", "rank", "period"] ================================================ FILE: fhir/resources/STU3/contract.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Contract Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Contract(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Legal Agreement. A formal agreement between parties regarding the conduct of business, exchange of information or other matters. """ __resource_type__ = "Contract" action: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="action", title="Action stipulated by this Contract", description=None, json_schema_extra={ "element_property": True, }, ) actionReason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="actionReason", title="Rationale for the stiplulated action", description="Reason for action stipulated by this Contract.", json_schema_extra={ "element_property": True, }, ) agent: typing.List[fhirtypes.ContractAgentType] | None = Field( default=None, alias="agent", title="Entity being ascribed responsibility", description=( "An actor taking a role in an activity for which it can be assigned " "some degree of responsibility for the activity taking place." ), json_schema_extra={ "element_property": True, }, ) applies: fhirtypes.PeriodType | None = Field( default=None, alias="applies", title="Effective time", description="Relevant time or time-period when this Contract is applicable.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authority: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="authority", title="Authority under which this Contract has standing", description=( "A formally or informally recognized grouping of people, principals, " "organizations, or jurisdictions formed for the purpose of achieving " "some form of collective action such as the promulgation, " "administration and enforcement of contracts and policies." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) bindingAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="bindingAttachment", title="Binding Contract", description=( "Legally binding Contract: This is the signed and legally recognized " 'representation of the Contract, which is considered the "source of ' 'truth" and which would be the basis for legal action related to ' "enforcement of this Contract." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e binding[x] "one_of_many": "binding", "one_of_many_required": False, }, ) bindingReference: fhirtypes.ReferenceType | None = Field( default=None, alias="bindingReference", title="Binding Contract", description=( "Legally binding Contract: This is the signed and legally recognized " 'representation of the Contract, which is considered the "source of ' 'truth" and which would be the basis for legal action related to ' "enforcement of this Contract." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e binding[x] "one_of_many": "binding", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Composition", "DocumentReference", "QuestionnaireResponse", ], }, ) contentDerivative: fhirtypes.CodeableConceptType | None = Field( default=None, alias="contentDerivative", title="Content derived from the basal information", description=( "The minimal content derived from the basal information source at a " "specific stage in its lifecycle." ), json_schema_extra={ "element_property": True, }, ) decisionType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="decisionType", title="Decision by Grantor", description=( "The type of decision made by a grantor with respect to an offer made " "by a grantee." ), json_schema_extra={ "element_property": True, }, ) domain: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="domain", title="Domain in which this Contract applies", description=( "Recognized governance framework or system operating with a " "circumscribed scope in accordance with specified principles, policies," " processes or procedures for managing rights, actions, or behaviors of" " parties or principals relative to resources." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) friendly: typing.List[fhirtypes.ContractFriendlyType] | None = Field( default=None, alias="friendly", title="Contract Friendly Language", description=( 'The "patient friendly language" versionof the Contract in whole or in ' 'parts. "Patient friendly language" means the representation of the ' "Contract and Contract Provisions in a manner that is readily " "accessible and understandable by a layperson in accordance with best " "practices for communication styles that ensure that those agreeing to " "or signing the Contract understand the roles, actions, obligations, " "responsibilities, and implication of the agreement." ), json_schema_extra={ "element_property": True, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Contract number", description="Unique identifier for this Contract.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued: fhirtypes.DateTimeType | None = Field( default=None, alias="issued", title="When this Contract was issued", description="When this Contract was issued.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issued", title="Extension field for ``issued``." ) legal: typing.List[fhirtypes.ContractLegalType] | None = Field( default=None, alias="legal", title="Contract Legal Language", description="List of Legal expressions or representations of this Contract.", json_schema_extra={ "element_property": True, }, ) rule: typing.List[fhirtypes.ContractRuleType] | None = Field( default=None, alias="rule", title="Computable Contract Language", description=( "List of Computable Policy Rule Language Representations of this " "Contract." ), json_schema_extra={ "element_property": True, }, ) securityLabel: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="securityLabel", title="Security Labels that define affected resources", description=( "A set of security labels that define which resources are controlled by" " this consent. If more than one label is specified, all resources must" " have all the specified labels." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) signer: typing.List[fhirtypes.ContractSignerType] | None = Field( default=None, alias="signer", title="Contract Signatory", description=( "Parties with legal standing in the Contract, including the principal " "parties, the grantor(s) and grantee(s), which are any person or " "organization bound by the contract, and any ancillary parties, which " "facilitate the execution of the contract such as a notary or witness." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "amended | appended | cancelled | disputed | entered-in-error | " "executable | executed | negotiable | offered | policy | rejected | " "renewed | revoked | resolved | terminated" ), description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "amended", "appended", "cancelled", "disputed", "entered-in-error", "executable", "executed", "negotiable", "offered", "policy", "rejected", "renewed", "revoked", "resolved", "terminated", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="subType", title="Subtype within the context of type", description=( "More specific type or specialization of an overarching or more general" " contract such as auto insurance, home owner insurance, prenupial " "agreement, Advanced-Directive, or privacy consent." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subject: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="subject", title="Contract Target Entity", description=( "The target entity impacted by or of interest to parties to the " "agreement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) term: typing.List[fhirtypes.ContractTermType] | None = Field( default=None, alias="term", title="Contract Term List", description=( "One or more Contract Provisions, which may be related and conveyed as " "a group, and may contain nested groups." ), json_schema_extra={ "element_property": True, }, ) topic: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="topic", title="Context of the Contract", description="The matter of concern in the context of this agreement.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Type or form", description=( "Type of Contract such as an insurance policy, real estate contract, a " "will, power of attorny, Privacy or Security policy , trust framework " "agreement, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valuedItem: typing.List[fhirtypes.ContractValuedItemType] | None = Field( default=None, alias="valuedItem", title="Contract Valued Item List", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Contract`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "issued", "applies", "subject", "topic", "authority", "domain", "type", "subType", "action", "actionReason", "decisionType", "contentDerivative", "securityLabel", "agent", "signer", "valuedItem", "term", "bindingAttachment", "bindingReference", "bindingReference", "bindingReference", "friendly", "legal", "rule", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Contract`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "issued", "applies", "subject", "topic", "type", "subType", "securityLabel", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"binding": ["bindingAttachment", "bindingReference"]} return one_of_many_fields class ContractAgent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Entity being ascribed responsibility. An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place. """ __resource_type__ = "ContractAgent" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Contract Agent Type", description="Who or what parties are assigned roles in this Contract.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Contract", "Device", "Group", "Location", "Organization", "Patient", "Practitioner", "RelatedPerson", "Substance", ], }, ) role: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="role", title="Role type of the agent", description="Role type of agent assigned roles in this Contract.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractAgent`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "actor", "role"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractAgent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ContractFriendly(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contract Friendly Language. The "patient friendly language" versionof the Contract in whole or in parts. "Patient friendly language" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement. """ __resource_type__ = "ContractFriendly" contentAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="contentAttachment", title="Easily comprehended representation of this Contract", description=( "Human readable rendering of this Contract in a format and " "representation intended to enhance comprehension and ensure " "understandability." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, }, ) contentReference: fhirtypes.ReferenceType | None = Field( default=None, alias="contentReference", title="Easily comprehended representation of this Contract", description=( "Human readable rendering of this Contract in a format and " "representation intended to enhance comprehension and ensure " "understandability." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Composition", "DocumentReference", "QuestionnaireResponse", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractFriendly`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "contentAttachment", "contentReference", "contentReference", "contentReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractFriendly`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"content": ["contentAttachment", "contentReference"]} return one_of_many_fields class ContractLegal(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contract Legal Language. List of Legal expressions or representations of this Contract. """ __resource_type__ = "ContractLegal" contentAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="contentAttachment", title="Contract Legal Text", description="Contract legal text in human renderable form.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, }, ) contentReference: fhirtypes.ReferenceType | None = Field( default=None, alias="contentReference", title="Contract Legal Text", description="Contract legal text in human renderable form.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Composition", "DocumentReference", "QuestionnaireResponse", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractLegal`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "contentAttachment", "contentReference", "contentReference", "contentReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractLegal`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"content": ["contentAttachment", "contentReference"]} return one_of_many_fields class ContractRule(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Computable Contract Language. List of Computable Policy Rule Language Representations of this Contract. """ __resource_type__ = "ContractRule" contentAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="contentAttachment", title="Computable Contract Rules", description=( "Computable Contract conveyed using a policy rule language (e.g. XACML," " DKAL, SecPal)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, }, ) contentReference: fhirtypes.ReferenceType | None = Field( default=None, alias="contentReference", title="Computable Contract Rules", description=( "Computable Contract conveyed using a policy rule language (e.g. XACML," " DKAL, SecPal)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractRule`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "contentAttachment", "contentReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractRule`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"content": ["contentAttachment", "contentReference"]} return one_of_many_fields class ContractSigner(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contract Signatory. Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness. """ __resource_type__ = "ContractSigner" party: fhirtypes.ReferenceType = Field( default=..., alias="party", title="Contract Signatory Party", description="Party which is a signator to this Contract.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Organization", "Patient", "Practitioner", "RelatedPerson", ], }, ) signature: typing.List[fhirtypes.SignatureType] = Field( default=..., alias="signature", title="Contract Documentation Signature", description="Legally binding Contract DSIG signature contents in Base64.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodingType = Field( default=..., alias="type", title="Contract Signatory Role", description="Role of this Contract signer, e.g. notary, grantee.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractSigner`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "party", "signature"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractSigner`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ContractTerm(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contract Term List. One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups. """ __resource_type__ = "ContractTerm" action: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="action", title="Contract Term Activity", description="Action stipulated by this Contract Provision.", json_schema_extra={ "element_property": True, }, ) actionReason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="actionReason", title="Purpose for the Contract Term Action", description=( "Reason or purpose for the action stipulated by this Contract " "Provision." ), json_schema_extra={ "element_property": True, }, ) agent: typing.List[fhirtypes.ContractTermAgentType] | None = Field( default=None, alias="agent", title="Contract Term Agent List", description=( "An actor taking a role in an activity for which it can be assigned " "some degree of responsibility for the activity taking place." ), json_schema_extra={ "element_property": True, }, ) applies: fhirtypes.PeriodType | None = Field( default=None, alias="applies", title="Contract Term Effective Time", description=( "Relevant time or time-period when this Contract Provision is " "applicable." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) group: typing.List[fhirtypes.ContractTermType] | None = Field( default=None, alias="group", title="Nested Contract Term Group", description="Nested group of Contract Provisions.", json_schema_extra={ "element_property": True, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Contract Term Number", description="Unique identifier for this particular Contract Provision.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued: fhirtypes.DateTimeType | None = Field( default=None, alias="issued", title="Contract Term Issue Date Time", description="When this Contract Provision was issued.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issued", title="Extension field for ``issued``." ) securityLabel: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="securityLabel", title="Security Labels that define affected terms", description=( "A set of security labels that define which terms are controlled by " "this condition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subType", title="Contract Term Type specific classification", description=( "Subtype of this Contract Provision, e.g. life time maximum payment for" " a contract term for specific valued item, e.g. disability payment." ), json_schema_extra={ "element_property": True, }, ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Human readable Contract term text", description="Human readable form of this Contract Provision.", json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) topic: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="topic", title="Context of the Contract term", description=( "The matter of concern in the context of this provision of the " "agrement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Contract Term Type or Form", description=( "Type of Contract Provision such as specific requirements, purposes for" " actions, obligations, prohibitions, e.g. life time maximum benefit." ), json_schema_extra={ "element_property": True, }, ) valuedItem: typing.List[fhirtypes.ContractTermValuedItemType] | None = Field( default=None, alias="valuedItem", title="Contract Term Valued Item List", description="Contract Provision Valued Item List.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractTerm`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "issued", "applies", "type", "subType", "topic", "action", "actionReason", "securityLabel", "agent", "text", "valuedItem", "group", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractTerm`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "identifier", "issued", "applies", "topic", "securityLabel", ] class ContractTermAgent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contract Term Agent List. An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place. """ __resource_type__ = "ContractTermAgent" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Contract Term Agent Subject", description="The agent assigned a role in this Contract Provision.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Contract", "Device", "Group", "Location", "Organization", "Patient", "Practitioner", "RelatedPerson", "Substance", ], }, ) role: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="role", title="Type of the Contract Term Agent", description=( "Role played by the agent assigned this role in the execution of this " "Contract Provision." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractTermAgent`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "actor", "role"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractTermAgent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ContractTermValuedItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contract Term Valued Item List. Contract Provision Valued Item List. """ __resource_type__ = "ContractTermValuedItem" effectiveTime: fhirtypes.DateTimeType | None = Field( default=None, alias="effectiveTime", title="Contract Term Valued Item Effective Tiem", description=( "Indicates the time during which this Contract Term ValuedItem " "information is effective." ), json_schema_extra={ "element_property": True, }, ) effectiveTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_effectiveTime", title="Extension field for ``effectiveTime``.", ) entityCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="entityCodeableConcept", title="Contract Term Valued Item Type", description="Specific type of Contract Provision Valued Item that may be priced.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e entity[x] "one_of_many": "entity", "one_of_many_required": False, }, ) entityReference: fhirtypes.ReferenceType | None = Field( default=None, alias="entityReference", title="Contract Term Valued Item Type", description="Specific type of Contract Provision Valued Item that may be priced.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e entity[x] "one_of_many": "entity", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Contract Term Valued Item Price Scaling Factor", description=( "A real number that represents a multiplier used in determining the " "overall value of the Contract Provision Valued Item delivered. The " "concept of a Factor allows for a discount or surcharge multiplier to " "be applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Contract Term Valued Item Number", description="Identifies a Contract Provision Valued Item instance.", json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total Contract Term Valued Item Value", description=( "Expresses the product of the Contract Provision Valued Item " "unitQuantity and the unitPriceAmt. For example, the formula: unit " "Quantity * unit Price (Cost per Point) * factor Number * points = net" " Amount. Quantity, factor and points are assumed to be 1 if not " "supplied." ), json_schema_extra={ "element_property": True, }, ) points: fhirtypes.DecimalType | None = Field( default=None, alias="points", title="Contract Term Valued Item Difficulty Scaling Factor", description=( "An amount that expresses the weighting (based on difficulty, cost " "and/or resource intensiveness) associated with the Contract Provision " "Valued Item delivered. The concept of Points allows for assignment of " "point values for a Contract ProvisionValued Item, such that a monetary" " amount can be assigned to each point." ), json_schema_extra={ "element_property": True, }, ) points__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_points", title="Extension field for ``points``." ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Contract Term Valued Item Count", description=( "Specifies the units by which the Contract Provision Valued Item is " "measured or counted, and quantifies the countable or measurable " "Contract Term Valued Item instances." ), json_schema_extra={ "element_property": True, }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Contract Term Valued Item fee, charge, or cost", description="A Contract Provision Valued Item unit valuation measure.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractTermValuedItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "entityCodeableConcept", "entityReference", "identifier", "effectiveTime", "quantity", "unitPrice", "factor", "points", "net", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractTermValuedItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"entity": ["entityCodeableConcept", "entityReference"]} return one_of_many_fields class ContractValuedItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contract Valued Item List. """ __resource_type__ = "ContractValuedItem" effectiveTime: fhirtypes.DateTimeType | None = Field( default=None, alias="effectiveTime", title="Contract Valued Item Effective Tiem", description=( "Indicates the time during which this Contract ValuedItem information " "is effective." ), json_schema_extra={ "element_property": True, }, ) effectiveTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_effectiveTime", title="Extension field for ``effectiveTime``.", ) entityCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="entityCodeableConcept", title="Contract Valued Item Type", description="Specific type of Contract Valued Item that may be priced.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e entity[x] "one_of_many": "entity", "one_of_many_required": False, }, ) entityReference: fhirtypes.ReferenceType | None = Field( default=None, alias="entityReference", title="Contract Valued Item Type", description="Specific type of Contract Valued Item that may be priced.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e entity[x] "one_of_many": "entity", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Contract Valued Item Price Scaling Factor", description=( "A real number that represents a multiplier used in determining the " "overall value of the Contract Valued Item delivered. The concept of a " "Factor allows for a discount or surcharge multiplier to be applied to " "a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Contract Valued Item Number", description="Identifies a Contract Valued Item instance.", json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total Contract Valued Item Value", description=( "Expresses the product of the Contract Valued Item unitQuantity and the" " unitPriceAmt. For example, the formula: unit Quantity * unit Price " "(Cost per Point) * factor Number * points = net Amount. Quantity, " "factor and points are assumed to be 1 if not supplied." ), json_schema_extra={ "element_property": True, }, ) points: fhirtypes.DecimalType | None = Field( default=None, alias="points", title="Contract Valued Item Difficulty Scaling Factor", description=( "An amount that expresses the weighting (based on difficulty, cost " "and/or resource intensiveness) associated with the Contract Valued " "Item delivered. The concept of Points allows for assignment of point " "values for a Contract Valued Item, such that a monetary amount can be " "assigned to each point." ), json_schema_extra={ "element_property": True, }, ) points__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_points", title="Extension field for ``points``." ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of Contract Valued Items", description=( "Specifies the units by which the Contract Valued Item is measured or " "counted, and quantifies the countable or measurable Contract Valued " "Item instances." ), json_schema_extra={ "element_property": True, }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Contract Valued Item fee, charge, or cost", description="A Contract Valued Item unit valuation measure.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractValuedItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "entityCodeableConcept", "entityReference", "identifier", "effectiveTime", "quantity", "unitPrice", "factor", "points", "net", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractValuedItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"entity": ["entityCodeableConcept", "entityReference"]} return one_of_many_fields ================================================ FILE: fhir/resources/STU3/contributor.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Contributor Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Contributor(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contributor information. A contributor to the content of a knowledge asset, including authors, editors, reviewers, and endorsers. """ __resource_type__ = "Contributor" contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details of the contributor", description=( "Contact details to assist a user in finding and communicating with the" " contributor." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Who contributed the content", description=( "The name of the individual or organization responsible for the " "contribution." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="author | editor | reviewer | endorser", description="The type of contributor.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["author", "editor", "reviewer", "endorser"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Contributor`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "type", "name", "contact"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Contributor`` according to specification, with preserving the original sequence order. """ return ["type", "name", "contact"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext"), ("type", "type__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/count.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Count Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from . import quantity class Count(quantity.Quantity): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A measured or measurable amount. A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. """ __resource_type__ = "Count" @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Count`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "value", "comparator", "unit", "system", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Count`` according to specification, with preserving the original sequence order. """ return ["value", "comparator", "unit", "system", "code"] ================================================ FILE: fhir/resources/STU3/coverage.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Coverage Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Coverage(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Insurance or medical plan or a payment agreement. Financial instrument which may be used to reimburse or pay for health care products and services. """ __resource_type__ = "Coverage" beneficiary: fhirtypes.ReferenceType | None = Field( default=None, alias="beneficiary", title="Plan Beneficiary", description=( "The party who benefits from the insurance coverage., the patient when " "services are provided." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) contract: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="contract", title="Contract details", description="The policy(s) which constitute this insurance coverage.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Contract"], }, ) dependent: fhirtypes.StringType | None = Field( default=None, alias="dependent", title="Dependent number", description="A unique identifier for a dependent under the coverage.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dependent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dependent", title="Extension field for ``dependent``." ) grouping: fhirtypes.CoverageGroupingType | None = Field( default=None, alias="grouping", title="Additional coverage classifications", description=( "A suite of underwrite specific classifiers, for example may be used to" " identify a class of coverage or employer group, Policy, Plan." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="The primary coverage ID", description=( "The main (and possibly only) identifier for the coverage - often " "referred to as a Member Id, Certificate number, Personal Health Number" " or Case ID. May be constructed as the concatination of the " "Coverage.SubscriberID and the Coverage.dependant." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) network: fhirtypes.StringType | None = Field( default=None, alias="network", title="Insurer network", description=( "The insurer-specific identifier for the insurer-defined network of " "providers to which the beneficiary may seek treatment which will be " "covered at the 'in-network' rate, otherwise 'out of network' terms and" " conditions apply." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) network__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_network", title="Extension field for ``network``." ) order: fhirtypes.PositiveIntType | None = Field( default=None, alias="order", title="Relative order of the coverage", description=( "The order of applicability of this coverage relative to other " "coverages which are currently inforce. Note, there may be gaps in the " "numbering and this does not imply primary, secondard etc. as the " "specific positioning of coverages depends upon the episode of care." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) order__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_order", title="Extension field for ``order``." ) payor: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="payor", title="Identifier for the plan or agreement issuer", description=( "The program or plan underwriter or payor including both insurance and " "non-insurance agreements, such as patient-pay agreements. May provide " "multiple identifiers such as insurance company identifier or business " "identifier (BIN number)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization", "Patient", "RelatedPerson"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Coverage start and end dates", description=( "Time period during which the coverage is in force. A missing start " "date indicates the start date isn't known, a missing end date means " "the coverage is continuing to be in force." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) policyHolder: fhirtypes.ReferenceType | None = Field( default=None, alias="policyHolder", title="Owner of the policy", description=( "The party who 'owns' the insurance policy, may be an individual, " "corporation or the subscriber's employer." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "RelatedPerson", "Organization"], }, ) relationship: fhirtypes.CodeableConceptType | None = Field( default=None, alias="relationship", title="Beneficiary relationship to the Subscriber", description="The relationship of beneficiary (patient) to the subscriber.", json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.StringType | None = Field( default=None, alias="sequence", title="The plan instance or sequence counter", description=( "An optional counter for a particular instance of the identified " "coverage which increments upon each renewal." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subscriber: fhirtypes.ReferenceType | None = Field( default=None, alias="subscriber", title="Subscriber to the policy", description=( "The party who has signed-up for or 'owns' the contractual relationship" " to the policy or to whom the benefit of the policy for services " "rendered to them or their family is due." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "RelatedPerson"], }, ) subscriberId: fhirtypes.StringType | None = Field( default=None, alias="subscriberId", title="ID assigned to the Subscriber", description="The insurer assigned ID for the Subscriber.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subscriberId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subscriberId", title="Extension field for ``subscriberId``.", ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Type of coverage such as medical or accident", description=( "The type of coverage: social program, medical plan, accident coverage " "(workers compensation, auto), group health or payment by an individual" " or organization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Coverage`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "type", "policyHolder", "subscriber", "subscriberId", "beneficiary", "relationship", "period", "payor", "grouping", "dependent", "sequence", "order", "network", "contract", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Coverage`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "type", "policyHolder", "subscriber", "subscriberId", "beneficiary", "period", "payor", "dependent", "sequence", "order", "network", ] class CoverageGrouping(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional coverage classifications. A suite of underwrite specific classifiers, for example may be used to identify a class of coverage or employer group, Policy, Plan. """ __resource_type__ = "CoverageGrouping" classDisplay: fhirtypes.StringType | None = Field( default=None, alias="classDisplay", title="Display text for the class", description="A short description for the class.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) classDisplay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_classDisplay", title="Extension field for ``classDisplay``.", ) class_fhir: fhirtypes.StringType | None = Field( default=None, alias="class", title="An identifier for the class", description=( "Identifies a style or collective of coverage issues by the " "underwriter, for example may be used to identify a class of coverage " "such as a level of deductables or co-payment." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) class__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_class", title="Extension field for ``class_fhir``." ) group: fhirtypes.StringType | None = Field( default=None, alias="group", title="An identifier for the group", description=( "Identifies a style or collective of coverage issued by the " "underwriter, for example may be used to identify an employer group. " "May also be referred to as a Policy or Group ID." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) group__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_group", title="Extension field for ``group``." ) groupDisplay: fhirtypes.StringType | None = Field( default=None, alias="groupDisplay", title="Display text for an identifier for the group", description="A short description for the group.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) groupDisplay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_groupDisplay", title="Extension field for ``groupDisplay``.", ) plan: fhirtypes.StringType | None = Field( default=None, alias="plan", title="An identifier for the plan", description=( "Identifies a style or collective of coverage issued by the " "underwriter, for example may be used to identify a collection of " "benefits provided to employees. May be referred to as a Section or " "Division ID." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) plan__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_plan", title="Extension field for ``plan``." ) planDisplay: fhirtypes.StringType | None = Field( default=None, alias="planDisplay", title="Display text for the plan", description="A short description for the plan.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) planDisplay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_planDisplay", title="Extension field for ``planDisplay``." ) subClass: fhirtypes.StringType | None = Field( default=None, alias="subClass", title="An identifier for the subsection of the class", description=( "Identifies a sub-style or sub-collective of coverage issues by the " "underwriter, for example may be used to identify a subclass of " "coverage such as a sub-level of deductables or co-payment." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subClass__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subClass", title="Extension field for ``subClass``." ) subClassDisplay: fhirtypes.StringType | None = Field( default=None, alias="subClassDisplay", title="Display text for the subsection of the subclass", description="A short description for the subclass.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subClassDisplay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subClassDisplay", title="Extension field for ``subClassDisplay``.", ) subGroup: fhirtypes.StringType | None = Field( default=None, alias="subGroup", title="An identifier for the subsection of the group", description=( "Identifies a style or collective of coverage issued by the " "underwriter, for example may be used to identify a subset of an " "employer group." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subGroup__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subGroup", title="Extension field for ``subGroup``." ) subGroupDisplay: fhirtypes.StringType | None = Field( default=None, alias="subGroupDisplay", title="Display text for the subsection of the group", description="A short description for the subgroup.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subGroupDisplay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subGroupDisplay", title="Extension field for ``subGroupDisplay``.", ) subPlan: fhirtypes.StringType | None = Field( default=None, alias="subPlan", title="An identifier for the subsection of the plan", description=( "Identifies a sub-style or sub-collective of coverage issued by the " "underwriter, for example may be used to identify a subset of a " "collection of benefits provided to employees." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subPlan__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subPlan", title="Extension field for ``subPlan``." ) subPlanDisplay: fhirtypes.StringType | None = Field( default=None, alias="subPlanDisplay", title="Display text for the subsection of the plan", description="A short description for the subplan.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subPlanDisplay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subPlanDisplay", title="Extension field for ``subPlanDisplay``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageGrouping`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "group", "groupDisplay", "subGroup", "subGroupDisplay", "plan", "planDisplay", "subPlan", "subPlanDisplay", "class", "classDisplay", "subClass", "subClassDisplay", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageGrouping`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "group", "groupDisplay", "subGroup", "subGroupDisplay", "plan", "planDisplay", "subPlan", "subPlanDisplay", "class", "classDisplay", "subClass", "subClassDisplay", ] ================================================ FILE: fhir/resources/STU3/dataelement.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DataElement Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class DataElement(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Resource data element. The formal description of a single piece of information that can be gathered and reported. """ __resource_type__ = "DataElement" contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the data element and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the data element." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date this was last changed", description=( "The date (and optionally time) when the data element was published. " "The date must change if and when the business version changes and it " "must change if the status code changes. In addition, it should change " "when the substantive content of the data element changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) element: typing.List[fhirtypes.ElementDefinitionType] = Field( default=..., alias="element", title="Definition of element", description=( "Defines the structure, type, allowed values and other constraining " "characteristics of the data element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A boolean value to indicate that this data element is authored for " "testing purposes (or education/evaluation/marketing), and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the data element", description=( "A formal identifier that is used to identify this data element when it" " is represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for data element (if applicable)", description=( "A legal or geographic region in which the data element is intended to " "be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) mapping: typing.List[fhirtypes.DataElementMappingType] | None = Field( default=None, alias="mapping", title="External specification mapped to", description=( "Identifies a specification (other than a terminology) that the " "elements which make up the DataElement have some correspondence with." ), json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this data element (computer friendly)", description=( "A natural language name identifying the data element. This name should" " be usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the individual or organization that published the data " "element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this data element. Enables tracking the life-cycle of " "the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) stringency: fhirtypes.CodeType | None = Field( default=None, alias="stringency", title=( "comparable | fully-specified | equivalent | convertable | scaleable | " "flexible" ), description="Identifies how precise the data element is in its definition.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "comparable", "fully-specified", "equivalent", "convertable", "scaleable", "flexible", ], }, ) stringency__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_stringency", title="Extension field for ``stringency``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this data element (human friendly)", description="A short, descriptive, user-friendly title for the data element.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Logical URI to reference this data element (globally unique)", description=( "An absolute URI that is used to identify this data element when it is " "referenced in a specification, model, design or an instance. This " "SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at" " which this data element is (or will be) published. The URL SHOULD " "include the major version of the data element. For more information " "see [Technical and Business Versions](resource.html#versions)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Context the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching for appropriate data element instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the data element", description=( "The identifier that is used to identify this version of the data " "element when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the data element " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DataElement`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "status", "experimental", "date", "publisher", "name", "title", "contact", "useContext", "jurisdiction", "copyright", "stringency", "mapping", "element", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DataElement`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "status", "experimental", "date", "publisher", "name", "title", "contact", "useContext", "jurisdiction", "stringency", "element", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class DataElementMapping(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. External specification mapped to. Identifies a specification (other than a terminology) that the elements which make up the DataElement have some correspondence with. """ __resource_type__ = "DataElementMapping" comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Versions, issues, scope limitations, etc.", description=( "Comments about this mapping, including version notes, issues, scope " "limitations, and other important notes for usage." ), json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) identity: fhirtypes.IdType | None = Field( default=None, alias="identity", title="Internal id when this mapping is used", description=( "An internal id that is used to identify this mapping set when specific" " mappings are made on a per-element basis." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) identity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_identity", title="Extension field for ``identity``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Names what this mapping refers to", description="A name for the specification that is being mapped to.", json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) uri: fhirtypes.UriType | None = Field( default=None, alias="uri", title="Identifies what this mapping refers to", description=( "An absolute URI that identifies the specification that this mapping is" " expressed to." ), json_schema_extra={ "element_property": True, }, ) uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uri", title="Extension field for ``uri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DataElementMapping`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identity", "uri", "name", "comment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DataElementMapping`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("identity", "identity__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/datarequirement.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DataRequirement Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class DataRequirement(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Describes a required data item. Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data. """ __resource_type__ = "DataRequirement" codeFilter: typing.List[fhirtypes.DataRequirementCodeFilterType] | None = Field( default=None, alias="codeFilter", title="What codes are expected", description=( "Code filters specify additional constraints on the data, specifying " "the value set of interest for a particular element of the data." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dateFilter: typing.List[fhirtypes.DataRequirementDateFilterType] | None = Field( default=None, alias="dateFilter", title="What dates/date ranges are expected", description=( "Date filters specify additional constraints on the data in terms of " "the applicable date range for specific elements." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) mustSupport: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="mustSupport", title=( "Indicates that specific structure elements are referenced by the " "knowledge module" ), description=( "Indicates that specific elements of the type are referenced by the " "knowledge module and must be supported by the consumer in order to " "obtain an effective evaluation. This does not mean that a value is " "required for this element, only that the consuming system must " "understand the element and be able to provide values for it if they " "are available. Note that the value for this element can be a path to " "allow references to nested elements. In that case, all the elements " "along the path must be supported." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) mustSupport__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_mustSupport", title="Extension field for ``mustSupport``." ) profile: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="profile", title="The profile of the required data", description=( "The profile of the required data, specified as the uri of the profile " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) profile__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="The type of the required data", description=( "The type of the required data, specified as the type name of a " "resource. For profiles, this value is set to the type of the base " "resource of the profile." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DataRequirement`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "type", "profile", "mustSupport", "codeFilter", "dateFilter", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DataRequirement`` according to specification, with preserving the original sequence order. """ return ["type", "profile", "mustSupport", "codeFilter", "dateFilter"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields class DataRequirementCodeFilter(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What codes are expected. Code filters specify additional constraints on the data, specifying the value set of interest for a particular element of the data. """ __resource_type__ = "DataRequirementCodeFilter" path: fhirtypes.StringType | None = Field( default=None, alias="path", title="The code-valued attribute of the filter", description=( "The code-valued attribute of the filter. The specified path must be " "resolvable from the type of the required data. The path is allowed to " "contain qualifiers (.) to traverse sub-elements, as well as indexers " "([x]) to traverse multiple-cardinality sub-elements. Note that the " "index must be an integer constant. The path must resolve to an element" " of type code, Coding, or CodeableConcept." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) valueCode: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="valueCode", title="What code is expected", description=( "The codes for the code filter. Only one of valueSet, valueCode, " "valueCoding, or valueCodeableConcept may be specified. If values are " "given, the filter will return only those data items for which the " "code-valued attribute specified by the path has a value that is one of" " the specified codes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueCode__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueCodeableConcept: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="valueCodeableConcept", title="What CodeableConcept is expected", description=( "The CodeableConcepts for the code filter. Only one of valueSet, " "valueCode, valueConding, or valueCodeableConcept may be specified. If " "values are given, the filter will return only those data items for " "which the code-valued attribute specified by the path has a value that" " is one of the specified CodeableConcepts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueCoding: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="valueCoding", title="What Coding is expected", description=( "The Codings for the code filter. Only one of valueSet, valueCode, " "valueConding, or valueCodeableConcept may be specified. If values are " "given, the filter will return only those data items for which the " "code-valued attribute specified by the path has a value that is one of" " the specified Codings." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueSetReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueSetReference", title="Valueset for the filter", description=( "The valueset for the code filter. The valueSet and value elements are " "exclusive. If valueSet is specified, the filter will return only those" " data items for which the value of the code-valued element specified " "in the path is a member of the specified valueset." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e valueSet[x] "one_of_many": "valueSet", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) valueSetString: fhirtypes.StringType | None = Field( default=None, alias="valueSetString", title="Valueset for the filter", description=( "The valueset for the code filter. The valueSet and value elements are " "exclusive. If valueSet is specified, the filter will return only those" " data items for which the value of the code-valued element specified " "in the path is a member of the specified valueset." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e valueSet[x] "one_of_many": "valueSet", "one_of_many_required": False, }, ) valueSetString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueSetString", title="Extension field for ``valueSetString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DataRequirementCodeFilter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "path", "valueSetString", "valueSetReference", "valueCode", "valueCoding", "valueCodeableConcept", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DataRequirementCodeFilter`` according to specification, with preserving the original sequence order. """ return [ "path", "valueSetString", "valueSetReference", "valueCode", "valueCoding", "valueCodeableConcept", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("path", "path__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"valueSet": ["valueSetReference", "valueSetString"]} return one_of_many_fields class DataRequirementDateFilter(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What dates/date ranges are expected. Date filters specify additional constraints on the data in terms of the applicable date range for specific elements. """ __resource_type__ = "DataRequirementDateFilter" path: fhirtypes.StringType | None = Field( default=None, alias="path", title="The date-valued attribute of the filter", description=( "The date-valued attribute of the filter. The specified path must be " "resolvable from the type of the required data. The path is allowed to " "contain qualifiers (.) to traverse sub-elements, as well as indexers " "([x]) to traverse multiple-cardinality sub-elements. Note that the " "index must be an integer constant. The path must resolve to an element" " of type dateTime, Period, Schedule, or Timing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="The value of the filter, as a Period, DateTime, or Duration value", description=( "The value of the filter. If period is specified, the filter will " "return only those data items that fall within the bounds determined by" " the Period, inclusive of the period boundaries. If dateTime is " "specified, the filter will return only those data items that are equal" " to the specified dateTime. If a Duration is specified, the filter " "will return only those data items that fall within Duration from now." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDuration: fhirtypes.DurationType | None = Field( default=None, alias="valueDuration", title="The value of the filter, as a Period, DateTime, or Duration value", description=( "The value of the filter. If period is specified, the filter will " "return only those data items that fall within the bounds determined by" " the Period, inclusive of the period boundaries. If dateTime is " "specified, the filter will return only those data items that are equal" " to the specified dateTime. If a Duration is specified, the filter " "will return only those data items that fall within Duration from now." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="The value of the filter, as a Period, DateTime, or Duration value", description=( "The value of the filter. If period is specified, the filter will " "return only those data items that fall within the bounds determined by" " the Period, inclusive of the period boundaries. If dateTime is " "specified, the filter will return only those data items that are equal" " to the specified dateTime. If a Duration is specified, the filter " "will return only those data items that fall within Duration from now." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DataRequirementDateFilter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "path", "valueDateTime", "valuePeriod", "valueDuration", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DataRequirementDateFilter`` according to specification, with preserving the original sequence order. """ return ["path", "valueDateTime", "valuePeriod", "valueDuration"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("path", "path__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": ["valueDateTime", "valueDuration", "valuePeriod"] } return one_of_many_fields ================================================ FILE: fhir/resources/STU3/detectedissue.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DetectedIssue Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class DetectedIssue(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Clinical issue with action. Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. """ __resource_type__ = "DetectedIssue" author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="The provider or device that identified the issue", description=( "Individual or device responsible for the issue being raised. For " "example, a decision support application or a pharmacist conducting a " "medication review." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "Device"], }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Issue Category, e.g. drug-drug, duplicate therapy, etc.", description="Identifies the general type of issue identified.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When identified", description=( "The date or date-time when the detected issue was initially " "identified." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) detail: fhirtypes.StringType | None = Field( default=None, alias="detail", title="Description and context", description="A textual explanation of the detected issue.", json_schema_extra={ "element_property": True, }, ) detail__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detail", title="Extension field for ``detail``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Unique id for the detected issue", description="Business identifier associated with the detected issue record.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) implicated: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="implicated", title="Problem resource", description=( "Indicates the resource representing the current activity or proposed " "activity that is potentially problematic." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) mitigation: typing.List[fhirtypes.DetectedIssueMitigationType] | None = Field( default=None, alias="mitigation", title="Step taken to address", description=( "Indicates an action that has been taken or is committed to to reduce " "or eliminate the likelihood of the risk identified by the detected " "issue from manifesting. Can also reflect an observation of known " "mitigating factors that may reduce/eliminate the need for any action." ), json_schema_extra={ "element_property": True, }, ) patient: fhirtypes.ReferenceType | None = Field( default=None, alias="patient", title="Associated patient", description=( "Indicates the patient whose record the detected issue is associated " "with." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) reference: fhirtypes.UriType | None = Field( default=None, alias="reference", title="Authority for issue", description=( "The literature, knowledge-base or similar reference that describes the" " propensity for the detected issue identified." ), json_schema_extra={ "element_property": True, }, ) reference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reference", title="Extension field for ``reference``." ) severity: fhirtypes.CodeType | None = Field( default=None, alias="severity", title="high | moderate | low", description=( "Indicates the degree of importance associated with the identified " "issue based on the potential impact on the patient." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["high", "moderate", "low"], }, ) severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_severity", title="Extension field for ``severity``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="registered | preliminary | final | amended +", description="Indicates the status of the detected issue.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["registered", "preliminary", "final", "amended", "+"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DetectedIssue`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "category", "severity", "patient", "date", "author", "implicated", "detail", "reference", "mitigation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DetectedIssue`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "category", "severity", "patient", "date", "author", "implicated", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class DetectedIssueMitigation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Step taken to address. Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the detected issue from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action. """ __resource_type__ = "DetectedIssueMitigation" action: fhirtypes.CodeableConceptType = Field( default=..., alias="action", title="What mitigation?", description=( "Describes the action that was taken or the observation that was made " "that reduces/eliminates the risk associated with the identified issue." ), json_schema_extra={ "element_property": True, }, ) author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="Who is committing?", description=( "Identifies the practitioner who determined the mitigation and takes " "responsibility for the mitigation step occurring." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date committed", description="Indicates when the mitigating action was documented.", json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DetectedIssueMitigation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "action", "date", "author"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DetectedIssueMitigation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/device.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Device Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Device(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Item used in healthcare. This resource identifies an instance or a type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. Medical devices include durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. Non-medical devices may include items such as a machine, cellphone, computer, application, etc. """ __resource_type__ = "Device" contact: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="contact", title="Details for human/organization for support", description=( "Contact details for an organization or a particular human that is " "responsible for the device." ), json_schema_extra={ "element_property": True, }, ) expirationDate: fhirtypes.DateTimeType | None = Field( default=None, alias="expirationDate", title="Date and time of expiry of this device (if applicable)", description=( "The date and time beyond which this device is no longer valid or " "should not be used (if applicable)." ), json_schema_extra={ "element_property": True, }, ) expirationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expirationDate", title="Extension field for ``expirationDate``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Instance identifier", description=( "Unique instance identifiers assigned to a device by manufacturers " "other organizations or owners." ), json_schema_extra={ "element_property": True, }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where the resource is found", description="The place where the device can be found.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) lotNumber: fhirtypes.StringType | None = Field( default=None, alias="lotNumber", title="Lot number of manufacture", description="Lot number assigned by the manufacturer.", json_schema_extra={ "element_property": True, }, ) lotNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lotNumber", title="Extension field for ``lotNumber``." ) manufactureDate: fhirtypes.DateTimeType | None = Field( default=None, alias="manufactureDate", title="Date when the device was made", description="The date and time when the device was manufactured.", json_schema_extra={ "element_property": True, }, ) manufactureDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_manufactureDate", title="Extension field for ``manufactureDate``.", ) manufacturer: fhirtypes.StringType | None = Field( default=None, alias="manufacturer", title="Name of device manufacturer", description="A name of the manufacturer.", json_schema_extra={ "element_property": True, }, ) manufacturer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_manufacturer", title="Extension field for ``manufacturer``.", ) model: fhirtypes.StringType | None = Field( default=None, alias="model", title="Model id assigned by the manufacturer", description=( 'The "model" is an identifier assigned by the manufacturer to identify ' "the product by its type. This number is shared by the all devices sold" " as the same type." ), json_schema_extra={ "element_property": True, }, ) model__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_model", title="Extension field for ``model``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Device notes and comments", description=( "Descriptive information, usage information or implantation information" " that is not captured in an existing element." ), json_schema_extra={ "element_property": True, }, ) owner: fhirtypes.ReferenceType | None = Field( default=None, alias="owner", title="Organization responsible for device", description=( "An organization that is responsible for the provision and ongoing " "maintenance of the device." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) patient: fhirtypes.ReferenceType | None = Field( default=None, alias="patient", title="Patient to whom Device is affixed", description="Patient information, If the device is affixed to a person.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) safety: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="safety", title="Safety Characteristics of Device", description=( "Provides additional safety characteristics about a medical device. " "For example devices containing latex." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | inactive | entered-in-error | unknown", description="Status of the Device availability.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "inactive", "entered-in-error", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="What kind of device this is", description="Code or identifier to identify a kind of device.", json_schema_extra={ "element_property": True, }, ) udi: fhirtypes.DeviceUdiType | None = Field( default=None, alias="udi", title="Unique Device Identifier (UDI) Barcode string", description=( "[Unique device identifier (UDI)](device.html#5.11.3.2.2) assigned to " "device label or package." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Network address to contact device", description="A network address on which the device may be contacted directly.", json_schema_extra={ "element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Version number (i.e. software)", description=( "The version of the device, if the device has multiple releases under " "the same model, or if the device is software or carries firmware." ), json_schema_extra={ "element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Device`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "udi", "status", "type", "lotNumber", "manufacturer", "manufactureDate", "expirationDate", "model", "version", "patient", "owner", "contact", "location", "url", "note", "safety", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Device`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "udi", "status", "safety"] class DeviceUdi(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Unique Device Identifier (UDI) Barcode string. [Unique device identifier (UDI)](device.html#5.11.3.2.2) assigned to device label or package. """ __resource_type__ = "DeviceUdi" carrierAIDC: fhirtypes.Base64BinaryType | None = Field( default=None, alias="carrierAIDC", title="UDI Machine Readable Barcode String", description=( "The full UDI carrier of the Automatic Identification and Data Capture " "(AIDC) technology representation of the barcode string as printed on " "the packaging of the device - E.g a barcode or RFID. Because of " "limitations on character sets in XML and the need to round-trip JSON " "data through XML, AIDC Formats *SHALL* be base64 encoded." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) carrierAIDC__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_carrierAIDC", title="Extension field for ``carrierAIDC``." ) carrierHRF: fhirtypes.StringType | None = Field( default=None, alias="carrierHRF", title="UDI Human Readable Barcode String", description=( "The full UDI carrier as the human readable form (HRF) representation " "of the barcode string as printed on the packaging of the device." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) carrierHRF__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_carrierHRF", title="Extension field for ``carrierHRF``." ) deviceIdentifier: fhirtypes.StringType | None = Field( default=None, alias="deviceIdentifier", title="Mandatory fixed portion of UDI", description=( "The device identifier (DI) is a mandatory, fixed portion of a UDI that" " identifies the labeler and the specific version or model of a device." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) deviceIdentifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deviceIdentifier", title="Extension field for ``deviceIdentifier``.", ) entryType: fhirtypes.CodeType | None = Field( default=None, alias="entryType", title="barcode | rfid | manual +", description="A coded entry to indicate how the data was entered.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["barcode", "rfid", "manual", "+"], }, ) entryType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_entryType", title="Extension field for ``entryType``." ) issuer: fhirtypes.UriType | None = Field( default=None, alias="issuer", title="UDI Issuing Organization", description=( "Organization that is charged with issuing UDIs for devices. For " "example, the US FDA issuers include : 1) GS1: " "http://hl7.org/fhir/NamingSystem/gs1-di, 2) HIBCC: " "http://hl7.org/fhir/NamingSystem/hibcc-dI, 3) ICCBBA for blood " "containers: http://hl7.org/fhir/NamingSystem/iccbba-blood-di, 4) " "ICCBA for other devices: http://hl7.org/fhir/NamingSystem/iccbba-" "other-di." ), json_schema_extra={ "element_property": True, }, ) issuer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issuer", title="Extension field for ``issuer``." ) jurisdiction: fhirtypes.UriType | None = Field( default=None, alias="jurisdiction", title="Regional UDI authority", description=( "The identity of the authoritative source for UDI generation within a " "jurisdiction. All UDIs are globally unique within a single namespace." " with the appropriate repository uri as the system. For example, " "UDIs of devices managed in the U.S. by the FDA, the value is " "http://hl7.org/fhir/NamingSystem/fda-udi." ), json_schema_extra={ "element_property": True, }, ) jurisdiction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_jurisdiction", title="Extension field for ``jurisdiction``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Device Name as appears on UDI label", description="Name of device as used in labeling or catalog.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceUdi`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "deviceIdentifier", "name", "jurisdiction", "carrierHRF", "carrierAIDC", "issuer", "entryType", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceUdi`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "deviceIdentifier", "name", "carrierHRF", "carrierAIDC", ] ================================================ FILE: fhir/resources/STU3/devicecomponent.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DeviceComponent Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class DeviceComponent(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An instance of a medical-related component of a medical device. The characteristics, operational status and capabilities of a medical- related component of a medical device. """ __resource_type__ = "DeviceComponent" identifier: fhirtypes.IdentifierType = Field( default=..., alias="identifier", title="Instance id assigned by the software stack", description=( "The locally assigned unique identification by the software. For " "example: handle ID." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) languageCode: fhirtypes.CodeableConceptType | None = Field( default=None, alias="languageCode", title=( "Language code for the human-readable text strings produced by the " "device" ), description=( "The language code for the human-readable text string produced by the " "device. This language code will follow the IETF language tag. Example:" " en-US." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastSystemChange: fhirtypes.InstantType | None = Field( default=None, alias="lastSystemChange", title="Recent system change timestamp", description=( "The timestamp for the most recent system change which includes device " "configuration or setting change." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastSystemChange__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastSystemChange", title="Extension field for ``lastSystemChange``.", ) measurementPrinciple: fhirtypes.CodeType | None = Field( default=None, alias="measurementPrinciple", title=( "other | chemical | electrical | impedance | nuclear | optical | " "thermal | biological | mechanical | acoustical | manual+" ), description=( "The physical principle of the measurement. For example: thermal, " "chemical, acoustical, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "other", "chemical", "electrical", "impedance", "nuclear", "optical", "thermal", "biological", "mechanical", "acoustical", "manual+", ], }, ) measurementPrinciple__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_measurementPrinciple", title="Extension field for ``measurementPrinciple``.", ) operationalStatus: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="operationalStatus", title=( "Current operational status of the component, for example On, Off or " "Standby" ), description=( "The current operational status of the device. For example: On, Off, " "Standby, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) parameterGroup: fhirtypes.CodeableConceptType | None = Field( default=None, alias="parameterGroup", title="Current supported parameter group", description=( "The parameter group supported by the current device component that is " "based on some nomenclature, e.g. cardiovascular." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) parent: fhirtypes.ReferenceType | None = Field( default=None, alias="parent", title="Parent resource link", description=( "The link to the parent resource. For example: Channel is linked to its" " VMD parent." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DeviceComponent"], }, ) productionSpecification: typing.List[ fhirtypes.DeviceComponentProductionSpecificationType ] | None = Field( default=None, alias="productionSpecification", title="Specification details such as Component Revisions, or Serial Numbers", description=( "The production specification such as component revision, serial " "number, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) source: fhirtypes.ReferenceType | None = Field( default=None, alias="source", title="Top-level device resource link", description=( "The link to the source Device that contains administrative device " "information such as manufacture, serial number, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="What kind of component it is", description=( "The component type as defined in the object-oriented or metric " "nomenclature partition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceComponent`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "type", "lastSystemChange", "source", "parent", "operationalStatus", "parameterGroup", "measurementPrinciple", "productionSpecification", "languageCode", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceComponent`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "type", "lastSystemChange", "source", "parent", "operationalStatus", "parameterGroup", "measurementPrinciple", "productionSpecification", "languageCode", ] class DeviceComponentProductionSpecification(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specification details such as Component Revisions, or Serial Numbers. The production specification such as component revision, serial number, etc. """ __resource_type__ = "DeviceComponentProductionSpecification" componentId: fhirtypes.IdentifierType | None = Field( default=None, alias="componentId", title="Internal component unique identification", description=( "The internal component unique identification. This is a provision for " "manufacture specific standard components using a private OID. " "11073-10101 has a partition for private OID semantic that the " "manufacturer can make use of." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) productionSpec: fhirtypes.StringType | None = Field( default=None, alias="productionSpec", title="A printable string defining the component", description="The printable string defining the component.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) productionSpec__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_productionSpec", title="Extension field for ``productionSpec``.", ) specType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="specType", title=( "Type or kind of production specification, for example serial number or" " software revision" ), description=( "The specification type, such as, serial number, part number, hardware " "revision, software revision, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceComponentProductionSpecification`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "specType", "componentId", "productionSpec", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceComponentProductionSpecification`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "specType", "componentId", "productionSpec"] ================================================ FILE: fhir/resources/STU3/devicemetric.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DeviceMetric Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class DeviceMetric(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Measurement, calculation or setting capability of a medical device. Describes a measurement, calculation or setting capability of a medical device. """ __resource_type__ = "DeviceMetric" calibration: typing.List[fhirtypes.DeviceMetricCalibrationType] | None = Field( default=None, alias="calibration", title=( "Describes the calibrations that have been performed or that are " "required to be performed" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) category: fhirtypes.CodeType | None = Field( default=None, alias="category", title="measurement | setting | calculation | unspecified", description=( "Indicates the category of the observation generation process. A " "DeviceMetric can be for example a setting, measurement, or " "calculation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["measurement", "setting", "calculation", "unspecified"], }, ) category__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_category", title="Extension field for ``category``." ) color: fhirtypes.CodeType | None = Field( default=None, alias="color", title="black | red | green | yellow | blue | magenta | cyan | white", description=( "Describes the color representation for the metric. This is often used " "to aid clinicians to track and identify parameter types by color. In " "practice, consider a Patient Monitor that has ECG/HR and Pleth for " "example; the parameters are displayed in different characteristic " "colors, such as HR-blue, BP-green, and PR and SpO2- magenta." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white", ], }, ) color__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_color", title="Extension field for ``color``." ) identifier: fhirtypes.IdentifierType = Field( default=..., alias="identifier", title="Unique identifier of this DeviceMetric", description=( "Describes the unique identification of this metric that has been " "assigned by the device or gateway software. For example: handle ID. " "It should be noted that in order to make the identifier unique, the " "system element of the identifier should be set to the unique " "identifier of the device." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) measurementPeriod: fhirtypes.TimingType | None = Field( default=None, alias="measurementPeriod", title="Describes the measurement repetition time", description=( "Describes the measurement repetition time. This is not necessarily the" " same as the update period. The measurement repetition time can range " "from milliseconds up to hours. An example for a measurement repetition" " time in the range of milliseconds is the sampling rate of an ECG. An " "example for a measurement repetition time in the range of hours is a " "NIBP that is triggered automatically every hour. The update period may" " be different than the measurement repetition time, if the device does" " not update the published observed value with the same frequency as it" " was measured." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) operationalStatus: fhirtypes.CodeType | None = Field( default=None, alias="operationalStatus", title="on | off | standby | entered-in-error", description=( "Indicates current operational state of the device. For example: On, " "Off, Standby, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["on", "off", "standby", "entered-in-error"], }, ) operationalStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_operationalStatus", title="Extension field for ``operationalStatus``.", ) parent: fhirtypes.ReferenceType | None = Field( default=None, alias="parent", title="Describes the link to the parent DeviceComponent", description=( "Describes the link to the DeviceComponent that this DeviceMetric " "belongs to and that provide information about the location of this " "DeviceMetric in the containment structure of the parent Device. An " "example would be a DeviceComponent that represents a Channel. This " "reference can be used by a client application to distinguish " "DeviceMetrics that have the same type, but should be interpreted based" " on their containment location." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DeviceComponent"], }, ) source: fhirtypes.ReferenceType | None = Field( default=None, alias="source", title="Describes the link to the source Device", description=( "Describes the link to the Device that this DeviceMetric belongs to " "and that contains administrative device information such as " "manufacturer, serial number, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Identity of metric, for example Heart Rate or PEEP Setting", description=( "Describes the type of the metric. For example: Heart Rate, PEEP " "Setting, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) unit: fhirtypes.CodeableConceptType | None = Field( default=None, alias="unit", title="Unit of Measure for the Metric", description=( "Describes the unit that an observed value determined for this metric " "will have. For example: Percent, Seconds, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceMetric`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "type", "unit", "source", "parent", "operationalStatus", "color", "category", "measurementPeriod", "calibration", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceMetric`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "type", "unit", "source", "parent", "operationalStatus", "color", "category", "measurementPeriod", "calibration", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("category", "category__ext")] return required_fields class DeviceMetricCalibration(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Describes the calibrations that have been performed or that are required to be performed. """ __resource_type__ = "DeviceMetricCalibration" state: fhirtypes.CodeType | None = Field( default=None, alias="state", title="not-calibrated | calibration-required | calibrated | unspecified", description="Describes the state of the calibration.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "not-calibrated", "calibration-required", "calibrated", "unspecified", ], }, ) state__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_state", title="Extension field for ``state``." ) time: fhirtypes.InstantType | None = Field( default=None, alias="time", title="Describes the time last calibration has been performed", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) time__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_time", title="Extension field for ``time``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="unspecified | offset | gain | two-point", description="Describes the type of the calibration method.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["unspecified", "offset", "gain", "two-point"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceMetricCalibration`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "state", "time"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceMetricCalibration`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "state", "time"] ================================================ FILE: fhir/resources/STU3/devicerequest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DeviceRequest Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class DeviceRequest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Medical device request. Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker. """ __resource_type__ = "DeviceRequest" authoredOn: fhirtypes.DateTimeType | None = Field( default=None, alias="authoredOn", title="When recorded", description="When the request transitioned to being actionable.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoredOn", title="Extension field for ``authoredOn``." ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="What request fulfills", description="Plan/proposal/order fulfilled by this request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) codeCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="codeCodeableConcept", title="Device requested", description="The details of the device to be used.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e code[x] "one_of_many": "code", "one_of_many_required": True, }, ) codeReference: fhirtypes.ReferenceType | None = Field( default=None, alias="codeReference", title="Device requested", description="The details of the device to be used.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e code[x] "one_of_many": "code", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Encounter or Episode motivating request", description=( "An encounter that provides additional context in which this request is" " made." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) definition: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="definition", title="Protocol or definition", description=( "Protocol or definition followed by this request. For example: The " "proposed act must be performed if the indicated conditions occur, " "e.g.., shortness of breath, SpO2 less than x%." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ActivityDefinition", "PlanDefinition"], }, ) groupIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="groupIdentifier", title="Identifier of composite request", description="Composite request this is part of.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Request identifier", description="Identifiers assigned to this order by the orderer or by the receiver.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) intent: fhirtypes.CodeableConceptType = Field( default=..., alias="intent", title="proposal | plan | original-order | encoded | reflex-order", description=( "Whether the request is a proposal, plan, an original order or a reflex" " order." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Notes or comments", description=( "Details about this request that were not represented at all or " "sufficiently in one of the attributes provided in a class. These may " "include for example a comment, an instruction, or a note associated " "with the statement." ), json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="Desired time or schedule for use", description=( "The timing schedule for the use of the device. The Schedule data type " 'allows many different expressions, for example. "Every 8 hours"; ' '"Three times a day"; "1/2 an hour before breakfast for 10 days from ' '23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="Desired time or schedule for use", description=( "The timing schedule for the use of the device. The Schedule data type " 'allows many different expressions, for example. "Every 8 hours"; ' '"Three times a day"; "1/2 an hour before breakfast for 10 days from ' '23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceTiming: fhirtypes.TimingType | None = Field( default=None, alias="occurrenceTiming", title="Desired time or schedule for use", description=( "The timing schedule for the use of the device. The Schedule data type " 'allows many different expressions, for example. "Every 8 hours"; ' '"Three times a day"; "1/2 an hour before breakfast for 10 days from ' '23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) performer: fhirtypes.ReferenceType | None = Field( default=None, alias="performer", title="Requested Filler", description="The desired perfomer for doing the diagnostic testing.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Organization", "Patient", "Device", "RelatedPerson", "HealthcareService", ], }, ) performerType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="performerType", title="Fille role", description="Desired type of performer for doing the diagnostic testing.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) priorRequest: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="priorRequest", title="What request replaces", description=( "The request takes the place of the referenced completed or terminated " "request(s)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title=( "Indicates how quickly the {{title}} should be addressed with respect " "to other requests" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Coded Reason for request", description="Reason or justification for the use of this device.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Linked Reason for request", description="Reason or justification for the use of this device.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="relevantHistory", title="Request provenance", description="Key events in the history of the request.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Provenance"], }, ) requester: fhirtypes.DeviceRequestRequesterType | None = Field( default=None, alias="requester", title="Who/what is requesting diagnostics", description=( "The individual who initiated the request and has responsibility for " "its activation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | suspended | completed | entered-in-error | cancelled", description="The status of the request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "draft", "active", "suspended", "completed", "entered-in-error", "cancelled", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Focus of request", description="The patient who will use the device.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group", "Location", "Device"], }, ) supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInfo", title="Additional clinical information", description=( "Additional clinical information about the patient that may influence " "the request fulfilment. For example, this may includes body where on " "the subject's the device will be used ( i.e. the target site)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "definition", "basedOn", "priorRequest", "groupIdentifier", "status", "intent", "priority", "codeReference", "codeCodeableConcept", "subject", "context", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "authoredOn", "requester", "performerType", "performer", "reasonCode", "reasonReference", "supportingInfo", "note", "relevantHistory", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "definition", "basedOn", "priorRequest", "groupIdentifier", "status", "intent", "priority", "codeReference", "codeCodeableConcept", "subject", "context", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "authoredOn", "requester", "performerType", "performer", "reasonCode", "reasonReference", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "code": ["codeCodeableConcept", "codeReference"], "occurrence": [ "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", ], } return one_of_many_fields class DeviceRequestRequester(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who/what is requesting diagnostics. The individual who initiated the request and has responsibility for its activation. """ __resource_type__ = "DeviceRequestRequester" agent: fhirtypes.ReferenceType = Field( default=..., alias="agent", title="Individual making the request", description="The device, practitioner, etc. who initiated the request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device", "Practitioner", "Organization"], }, ) onBehalfOf: fhirtypes.ReferenceType | None = Field( default=None, alias="onBehalfOf", title="Organization agent is acting for", description="The organization the device or practitioner was acting on behalf of.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceRequestRequester`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "agent", "onBehalfOf"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceRequestRequester`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "agent", "onBehalfOf"] ================================================ FILE: fhir/resources/STU3/deviceusestatement.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DeviceUseStatement Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class DeviceUseStatement(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Record of use of a device. A record of a device being used by a patient where the record is the result of a report from the patient or another clinician. """ __resource_type__ = "DeviceUseStatement" bodySite: fhirtypes.CodeableConceptType | None = Field( default=None, alias="bodySite", title="Target body site", description=( "Indicates the site on the subject's body where the device was used ( " "i.e. the target site)." ), json_schema_extra={ "element_property": True, }, ) device: fhirtypes.ReferenceType = Field( default=..., alias="device", title="Reference to device used", description="The details of the device used.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External identifier for this record", description="An external identifier for this statement such as an IRI.", json_schema_extra={ "element_property": True, }, ) indication: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="indication", title="Why device was used", description="Reason or justification for the use of the device.", json_schema_extra={ "element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Addition details (comments, instructions)", description=( "Details about the device statement that were not represented at all or" " sufficiently in one of the attributes provided in a class. These may " "include for example a comment, an instruction, or a note associated " "with the statement." ), json_schema_extra={ "element_property": True, }, ) recordedOn: fhirtypes.DateTimeType | None = Field( default=None, alias="recordedOn", title="When statement was recorded", description="The time at which the statement was made/recorded.", json_schema_extra={ "element_property": True, }, ) recordedOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recordedOn", title="Extension field for ``recordedOn``." ) source: fhirtypes.ReferenceType | None = Field( default=None, alias="source", title="Who made the statement", description="Who reported the device was being used by the patient.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Practitioner", "RelatedPerson"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | completed | entered-in-error +", description=( "A code representing the patient or other source's judgment about the " "state of the device used that this statement is about. Generally this" " will be active or completed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "completed", "entered-in-error", "+"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Patient using device", description="The patient who used the device.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) timingDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="timingDateTime", title="How often the device was used", description="How often the device was used.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timingDateTime", title="Extension field for ``timingDateTime``.", ) timingPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="timingPeriod", title="How often the device was used", description="How often the device was used.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingTiming: fhirtypes.TimingType | None = Field( default=None, alias="timingTiming", title="How often the device was used", description="How often the device was used.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) whenUsed: fhirtypes.PeriodType | None = Field( default=None, alias="whenUsed", title="Period device was used", description="The time period over which the device was used.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceUseStatement`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "subject", "whenUsed", "timingTiming", "timingPeriod", "timingDateTime", "recordedOn", "source", "device", "indication", "bodySite", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceUseStatement`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "status"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "timing": ["timingDateTime", "timingPeriod", "timingTiming"] } return one_of_many_fields ================================================ FILE: fhir/resources/STU3/diagnosticreport.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DiagnosticReport Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class DiagnosticReport(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A Diagnostic report - a combination of request information, atomic results, images, interpretation, as well as formatted reports. The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports. """ __resource_type__ = "DiagnosticReport" basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="What was requested", description="Details concerning a test or procedure requested.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CarePlan", "ImmunizationRecommendation", "MedicationRequest", "NutritionOrder", "ProcedureRequest", "ReferralRequest", ], }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Service category", description=( "A code that classifies the clinical discipline, department or " "diagnostic service that created the report (e.g. cardiology, " "biochemistry, hematology, MRI). This is used for searching, sorting " "and display purposes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Name/Code for this diagnostic report", description="A code or name that describes this diagnostic report.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) codedDiagnosis: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="codedDiagnosis", title="Codes for the conclusion", description=None, json_schema_extra={ "element_property": True, }, ) conclusion: fhirtypes.StringType | None = Field( default=None, alias="conclusion", title="Clinical Interpretation of test results", description=( "Concise and clinically contextualized impression / summary of the " "diagnostic report." ), json_schema_extra={ "element_property": True, }, ) conclusion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_conclusion", title="Extension field for ``conclusion``." ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Health care event when test ordered", description=( "The healthcare event (e.g. a patient and healthcare provider " "interaction) which this DiagnosticReport per is about." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) effectiveDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="effectiveDateTime", title="Clinically relevant time/time-period for report", description=( "The time or time-period the observed values are related to. When the " "subject of the report is a patient, this is usually either the time of" " the procedure or of specimen collection(s), but very often the source" " of the date/time is not known, only the date/time itself." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_effectiveDateTime", title="Extension field for ``effectiveDateTime``.", ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="Clinically relevant time/time-period for report", description=( "The time or time-period the observed values are related to. When the " "subject of the report is a patient, this is usually either the time of" " the procedure or of specimen collection(s), but very often the source" " of the date/time is not known, only the date/time itself." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier for report", description="Identifiers assigned to this report by the performer or other systems.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) image: typing.List[fhirtypes.DiagnosticReportImageType] | None = Field( default=None, alias="image", title="Key images associated with this report", description=( "A list of key images associated with this report. The images are " "generally created during the diagnostic process, and may be directly " "of the patient, or of treated specimens (i.e. slides of interest)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) imagingStudy: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="imagingStudy", title=( "Reference to full details of imaging associated with the diagnostic " "report" ), description=( "One or more links to full details of any imaging performed during the " "diagnostic investigation. Typically, this is imaging performed by " "DICOM enabled modalities, but this is not required. A fully enabled " "PACS viewer can use this information to provide views of the source " "images." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ImagingStudy", "ImagingManifest"], }, ) issued: fhirtypes.InstantType | None = Field( default=None, alias="issued", title="DateTime this version was released", description=( "The date and time that this version of the report was released from " "the source diagnostic service." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issued", title="Extension field for ``issued``." ) performer: typing.List[fhirtypes.DiagnosticReportPerformerType] | None = Field( default=None, alias="performer", title="Participants in producing the report", description="Indicates who or what participated in producing the report.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) presentedForm: typing.List[fhirtypes.AttachmentType] | None = Field( default=None, alias="presentedForm", title="Entire report as issued", description=( "Rich text representation of the entire result as issued by the " "diagnostic service. Multiple formats are allowed but they SHALL be " "semantically equivalent." ), json_schema_extra={ "element_property": True, }, ) result: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="result", title="Observations - simple, or complex nested groups", description=( "Observations that are part of this diagnostic report. Observations can" ' be simple name/value pairs (e.g. "atomic" results), or they can be ' "grouping observations that include references to other members of the " 'group (e.g. "panels").' ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Observation"], }, ) specimen: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="specimen", title="Specimens this report is based on", description="Details about the specimens on which this diagnostic report is based.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Specimen"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="registered | partial | preliminary | final +", description="The status of the diagnostic report as a whole.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["registered", "partial", "preliminary", "final", "+"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="The subject of the report - usually, but not always, the patient", description=( "The subject of the report. Usually, but not always, this is a patient." " However diagnostic services also perform analyses on specimens " "collected from a variety of other sources." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group", "Device", "Location"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DiagnosticReport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "status", "category", "code", "subject", "context", "effectiveDateTime", "effectivePeriod", "issued", "performer", "specimen", "result", "imagingStudy", "image", "conclusion", "codedDiagnosis", "presentedForm", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DiagnosticReport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "category", "code", "subject", "context", "effectiveDateTime", "effectivePeriod", "issued", "performer", "image", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"effective": ["effectiveDateTime", "effectivePeriod"]} return one_of_many_fields class DiagnosticReportImage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Key images associated with this report. A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest). """ __resource_type__ = "DiagnosticReportImage" comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Comment about the image (e.g. explanation)", description=( "A comment about the image. Typically, this is used to provide an " "explanation for why the image is included, or to draw the viewer's " "attention to important features." ), json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) link: fhirtypes.ReferenceType = Field( default=..., alias="link", title="Reference to the image source", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Media"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DiagnosticReportImage`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "comment", "link"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DiagnosticReportImage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "link"] class DiagnosticReportPerformer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Participants in producing the report. Indicates who or what participated in producing the report. """ __resource_type__ = "DiagnosticReportPerformer" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Practitioner or Organization participant", description=( "The reference to the practitioner or organization involved in " "producing the report. For example, the diagnostic service that is " "responsible for issuing the report." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "Organization"], }, ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="Type of performer", description=( "Describes the type of participation (e.g. a responsible party, " "author, or verifier)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DiagnosticReportPerformer`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "role", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DiagnosticReportPerformer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "role", "actor"] ================================================ FILE: fhir/resources/STU3/distance.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Distance Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from . import quantity class Distance(quantity.Quantity): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A length - a value with a unit that is a physical distance. """ __resource_type__ = "Distance" @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Distance`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "value", "comparator", "unit", "system", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Distance`` according to specification, with preserving the original sequence order. """ return ["value", "comparator", "unit", "system", "code"] ================================================ FILE: fhir/resources/STU3/documentmanifest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DocumentManifest Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class DocumentManifest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A list that defines a set of documents. A collection of documents compiled for a purpose together with metadata that applies to the collection. """ __resource_type__ = "DocumentManifest" author: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="author", title="Who and/or what authored the manifest", description=( "Identifies who is responsible for creating the manifest, and adding " "documents to it." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Organization", "Device", "Patient", "RelatedPerson", ], }, ) content: typing.List[fhirtypes.DocumentManifestContentType] = Field( default=..., alias="content", title="The items included", description="The list of Documents included in the manifest.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="When this document manifest created", description=( "When the document manifest was created for submission to the server " "(not necessarily the same thing as the actual resource last modified " "time, since it may be modified, replicated, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Human-readable description (title)", description=( "Human-readable description of the source document. This is sometimes " 'known as the "title".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Other identifiers for the manifest", description=( "Other identifiers associated with the document manifest, including " "version independent identifiers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) masterIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="masterIdentifier", title="Unique Identifier for the set of documents", description=( "A single identifier that uniquely identifies this manifest. " "Principally used to refer to the manifest in non-FHIR contexts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) recipient: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="recipient", title="Intended to get notified about this set of documents", description=( "A patient, practitioner, or organization for which this set of " "documents is intended." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "RelatedPerson", "Organization", ], }, ) related: typing.List[fhirtypes.DocumentManifestRelatedType] | None = Field( default=None, alias="related", title="Related things", description="Related identifiers or resources associated with the DocumentManifest.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) source: fhirtypes.UriType | None = Field( default=None, alias="source", title="The source system/application/software", description=( "Identifies the source system, application, or software that produced " "the document manifest." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_source", title="Extension field for ``source``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="current | superseded | entered-in-error", description="The status of this document manifest.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["current", "superseded", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="The subject of the set of documents", description=( "Who or what the set of documents is about. The documents can be about " "a person, (patient or healthcare practitioner), a device (i.e. " "machine) or even a group of subjects (such as a document about a herd " "of farm animals, or a set of patients that share a common exposure). " "If the documents cross more than one subject, then more than one " "subject is allowed here (unusual use case)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Practitioner", "Group", "Device"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Kind of document set", description=( "Specifies the kind of this set of documents (e.g. Patient Summary, " "Discharge Summary, Prescription, etc.). The type of a set of documents" " may be the same as one of the documents in it - especially if there " "is only one - but it may be wider." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DocumentManifest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "masterIdentifier", "identifier", "status", "type", "subject", "created", "author", "recipient", "source", "description", "content", "related", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DocumentManifest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "masterIdentifier", "identifier", "status", "type", "subject", "created", "author", "recipient", "source", "description", "content", "related", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class DocumentManifestContent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The items included. The list of Documents included in the manifest. """ __resource_type__ = "DocumentManifestContent" pAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="pAttachment", title="Contents of this set of documents", description=( "The list of references to document content, or Attachment that consist" " of the parts of this document manifest. Usually, these would be " "document references, but direct references to Media or Attachments are" " also allowed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e p[x] "one_of_many": "p", "one_of_many_required": True, }, ) pReference: fhirtypes.ReferenceType | None = Field( default=None, alias="pReference", title="Contents of this set of documents", description=( "The list of references to document content, or Attachment that consist" " of the parts of this document manifest. Usually, these would be " "document references, but direct references to Media or Attachments are" " also allowed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e p[x] "one_of_many": "p", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DocumentManifestContent`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "pAttachment", "pReference"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DocumentManifestContent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "pAttachment", "pReference"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"p": ["pAttachment", "pReference"]} return one_of_many_fields class DocumentManifestRelated(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Related things. Related identifiers or resources associated with the DocumentManifest. """ __resource_type__ = "DocumentManifestRelated" identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Identifiers of things that are related", description=( "Related identifier to this DocumentManifest. For example, Order " "numbers, accession numbers, XDW workflow numbers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ref: fhirtypes.ReferenceType | None = Field( default=None, alias="ref", title="Related Resource", description=( "Related Resource to this DocumentManifest. For example, Order, " "ProcedureRequest, Procedure, EligibilityRequest, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DocumentManifestRelated`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "identifier", "ref"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DocumentManifestRelated`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "identifier", "ref"] ================================================ FILE: fhir/resources/STU3/documentreference.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DocumentReference Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class DocumentReference(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A reference to a document. """ __resource_type__ = "DocumentReference" authenticator: fhirtypes.ReferenceType | None = Field( default=None, alias="authenticator", title="Who/what authenticated the document", description=( "Which person or organization authenticates that this document is " "valid." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "Organization"], }, ) author: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="author", title="Who and/or what authored the document", description=( "Identifies who is responsible for adding the information to the " "document." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Organization", "Device", "Patient", "RelatedPerson", ], }, ) class_fhir: fhirtypes.CodeableConceptType | None = Field( default=None, alias="class", title="Categorization of document", description=( "A categorization for the type of document referenced - helps for " "indexing and searching. This may be implied by or derived from the " "code specified in the DocumentReference.type." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) content: typing.List[fhirtypes.DocumentReferenceContentType] = Field( default=..., alias="content", title="Document referenced", description=( "The document and format referenced. There may be multiple content " "element repetitions, each with a different format." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) context: fhirtypes.DocumentReferenceContextType | None = Field( default=None, alias="context", title="Clinical context of document", description="The clinical context in which the document was prepared.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Document creation time", description="When the document was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) custodian: fhirtypes.ReferenceType | None = Field( default=None, alias="custodian", title="Organization which maintains the document", description=( "Identifies the organization or group who is responsible for ongoing " "maintenance of and access to the document." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Human-readable description (title)", description=( "Human-readable description of the source document. This is sometimes " 'known as the "title".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) docStatus: fhirtypes.CodeType | None = Field( default=None, alias="docStatus", title="preliminary | final | appended | amended | entered-in-error", description="The status of the underlying document.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "preliminary", "final", "appended", "amended", "entered-in-error", ], }, ) docStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_docStatus", title="Extension field for ``docStatus``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Other identifiers for the document", description=( "Other identifiers associated with the document, including version " "independent identifiers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) indexed: fhirtypes.InstantType | None = Field( default=None, alias="indexed", title="When this document reference was created", description="When the document reference was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) indexed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_indexed", title="Extension field for ``indexed``." ) masterIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="masterIdentifier", title="Master Version Specific Identifier", description=( "Document identifier as assigned by the source of the document. This " "identifier is specific to this version of the document. This unique " "identifier may be used elsewhere to identify this version of the " "document." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) relatesTo: typing.List[fhirtypes.DocumentReferenceRelatesToType] | None = Field( default=None, alias="relatesTo", title="Relationships to other documents", description=( "Relationships that this document has with other document references " "that already exist." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) securityLabel: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="securityLabel", title="Document security-tags", description=( "A set of Security-Tag codes specifying the level of privacy/security " "of the Document. Note that DocumentReference.meta.security contains " 'the security labels of the "reference" to the document, while ' "DocumentReference.securityLabel contains a snapshot of the security " "labels on the document the reference refers to." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="current | superseded | entered-in-error", description="The status of this document reference.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["current", "superseded", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Who/what is the subject of the document", description=( "Who or what the document is about. The document can be about a person," " (patient or healthcare practitioner), a device (e.g. a machine) or " "even a group of subjects (such as a document about a herd of farm " "animals, or a set of patients that share a common exposure)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Practitioner", "Group", "Device"], }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Kind of document (LOINC if possible)", description=( "Specifies the particular kind of document referenced (e.g. History " "and Physical, Discharge Summary, Progress Note). This usually equates " "to the purpose of making the document referenced." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DocumentReference`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "masterIdentifier", "identifier", "status", "docStatus", "type", "class", "subject", "created", "indexed", "author", "authenticator", "custodian", "relatesTo", "description", "securityLabel", "content", "context", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DocumentReference`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "masterIdentifier", "identifier", "status", "docStatus", "type", "class", "subject", "created", "indexed", "author", "authenticator", "custodian", "relatesTo", "description", "securityLabel", "content", "context", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("indexed", "indexed__ext"), ("status", "status__ext")] return required_fields class DocumentReferenceContent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Document referenced. The document and format referenced. There may be multiple content element repetitions, each with a different format. """ __resource_type__ = "DocumentReferenceContent" attachment: fhirtypes.AttachmentType = Field( default=..., alias="attachment", title="Where to access the document", description=( "The document or URL of the document along with critical metadata to " "prove content has integrity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) format: fhirtypes.CodingType | None = Field( default=None, alias="format", title="Format/content rules for the document", description=( "An identifier of the document encoding, structure, and template that " "the document conforms to beyond the base format indicated in the " "mimeType." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DocumentReferenceContent`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "attachment", "format"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DocumentReferenceContent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "attachment", "format"] class DocumentReferenceContext(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Clinical context of document. The clinical context in which the document was prepared. """ __resource_type__ = "DocumentReferenceContext" encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Context of the document content", description=( "Describes the clinical encounter or type of care that the document " "content is associated with." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) event: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="event", title="Main clinical acts documented", description=( "This list of codes represents the main clinical acts, such as a " "colonoscopy or an appendectomy, being documented. In some cases, the " 'event is inherent in the typeCode, such as a "History and Physical ' 'Report" in which the procedure being documented is necessarily a ' '"History and Physical" act.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) facilityType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="facilityType", title="Kind of facility where patient was seen", description="The kind of facility where the patient was seen.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time of service that is being documented", description=( "The time period over which the service that is described by the " "document was provided." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) practiceSetting: fhirtypes.CodeableConceptType | None = Field( default=None, alias="practiceSetting", title=( "Additional details about where the content was created (e.g. clinical " "specialty)" ), description=( "This property may convey specifics about the practice setting where " "the content was created, often reflecting the clinical specialty." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) related: typing.List[fhirtypes.DocumentReferenceContextRelatedType] | None = Field( default=None, alias="related", title="Related identifiers or resources", description=( "Related identifiers or resources associated with the " "DocumentReference." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sourcePatientInfo: fhirtypes.ReferenceType | None = Field( default=None, alias="sourcePatientInfo", title="Patient demographics from source", description=( "The Patient Information as known when the document was published. May " "be a reference to a version specific, or contained." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DocumentReferenceContext`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "encounter", "event", "period", "facilityType", "practiceSetting", "sourcePatientInfo", "related", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DocumentReferenceContext`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "encounter", "event", "period", "facilityType", "practiceSetting", "sourcePatientInfo", "related", ] class DocumentReferenceContextRelated(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Related identifiers or resources. Related identifiers or resources associated with the DocumentReference. """ __resource_type__ = "DocumentReferenceContextRelated" identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Identifier of related objects or events", description=( "Related identifier to this DocumentReference. If both id and ref are " "present they shall refer to the same thing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ref: fhirtypes.ReferenceType | None = Field( default=None, alias="ref", title="Related Resource", description=( "Related Resource to this DocumentReference. If both id and ref are " "present they shall refer to the same thing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DocumentReferenceContextRelated`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "identifier", "ref"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DocumentReferenceContextRelated`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "identifier", "ref"] class DocumentReferenceRelatesTo(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Relationships to other documents. Relationships that this document has with other document references that already exist. """ __resource_type__ = "DocumentReferenceRelatesTo" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="replaces | transforms | signs | appends", description="The type of relationship that this document has with anther document.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["replaces", "transforms", "signs", "appends"], }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) target: fhirtypes.ReferenceType = Field( default=..., alias="target", title="Target of the relationship", description="The target document of this relationship.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DocumentReferenceRelatesTo`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "target"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DocumentReferenceRelatesTo`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "target"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/domainresource.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DomainResource Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import fhirtypes, resource class DomainResource(resource.Resource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A resource with narrative, extensions, and contained resources. A resource that includes narrative, extensions, and contained resources. """ __resource_type__ = "DomainResource" contained: typing.List[fhirtypes.ResourceType] | None = Field( default=None, alias="contained", title="Contained, inline Resources", description=( "These resources do not have an independent existence apart from the " "resource that contains them - they cannot be identified independently," " and nor can they have their own independent transaction scope." ), json_schema_extra={ "element_property": True, }, ) extension: typing.List[fhirtypes.ExtensionType] | None = Field( default=None, alias="extension", title="Additional Content defined by implementations", description=( "May be used to represent additional information that is not part of " "the basic definition of the resource. In order to make the use of " "extensions safe and manageable, there is a strict set of governance " "applied to the definition and use of extensions. Though any " "implementer is allowed to define an extension, there is a set of " "requirements that SHALL be met as part of the definition of the " "extension." ), json_schema_extra={ "element_property": True, }, ) modifierExtension: typing.List[fhirtypes.ExtensionType] | None = Field( default=None, alias="modifierExtension", title="Extensions that cannot be ignored", description=( "May be used to represent additional information that is not part of " "the basic definition of the resource, and that modifies the " "understanding of the element that contains it. Usually modifier " "elements provide negation or qualification. In order to make the use " "of extensions safe and manageable, there is a strict set of governance" " applied to the definition and use of extensions. Though any " "implementer is allowed to define an extension, there is a set of " "requirements that SHALL be met as part of the definition of the " "extension. Applications processing a resource are required to check " "for modifier extensions." ), json_schema_extra={ "element_property": True, }, ) text: fhirtypes.NarrativeType | None = Field( default=None, alias="text", title="Text summary of the resource, for human interpretation", description=( "A human-readable narrative that contains a summary of the resource, " "and may be used to represent the content of the resource to a human. " "The narrative need not encode all the structured data, but is required" ' to contain sufficient detail to make it "clinically safe" for a human' " to just read the narrative. Resource definitions may define what " "content should be represented in the narrative to ensure clinical " "safety." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DomainResource`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DomainResource`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules"] ================================================ FILE: fhir/resources/STU3/dosage.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Dosage Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Dosage(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. How the medication is/was taken or should be taken. Indicates how the medication is/was taken or should be taken by the patient. """ __resource_type__ = "Dosage" additionalInstruction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="additionalInstruction", title='Supplemental instruction - e.g. "with meals"', description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) asNeededBoolean: bool | None = Field( default=None, alias="asNeededBoolean", title='Take "as needed" (for x)', description=( "Indicates whether the Medication is only taken when needed within a " "specific dosing schedule (Boolean option), or it indicates the " "precondition for taking the Medication (CodeableConcept)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e asNeeded[x] "one_of_many": "asNeeded", "one_of_many_required": False, }, ) asNeededBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_asNeededBoolean", title="Extension field for ``asNeededBoolean``.", ) asNeededCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="asNeededCodeableConcept", title='Take "as needed" (for x)', description=( "Indicates whether the Medication is only taken when needed within a " "specific dosing schedule (Boolean option), or it indicates the " "precondition for taking the Medication (CodeableConcept)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e asNeeded[x] "one_of_many": "asNeeded", "one_of_many_required": False, }, ) doseQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="doseQuantity", title="Amount of medication per dose", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e dose[x] "one_of_many": "dose", "one_of_many_required": False, }, ) doseRange: fhirtypes.RangeType | None = Field( default=None, alias="doseRange", title="Amount of medication per dose", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e dose[x] "one_of_many": "dose", "one_of_many_required": False, }, ) maxDosePerAdministration: fhirtypes.QuantityType | None = Field( default=None, alias="maxDosePerAdministration", title="Upper limit on medication per administration", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maxDosePerLifetime: fhirtypes.QuantityType | None = Field( default=None, alias="maxDosePerLifetime", title="Upper limit on medication per lifetime of the patient", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maxDosePerPeriod: fhirtypes.RatioType | None = Field( default=None, alias="maxDosePerPeriod", title="Upper limit on medication per unit of time", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="Technique for administering medication", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patientInstruction: fhirtypes.StringType | None = Field( default=None, alias="patientInstruction", title="Patient or consumer oriented instructions", description="Instructions in terms that are understood by the patient or consumer.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patientInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patientInstruction", title="Extension field for ``patientInstruction``.", ) rateQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="rateQuantity", title="Amount of medication per unit of time", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e rate[x] "one_of_many": "rate", "one_of_many_required": False, }, ) rateRange: fhirtypes.RangeType | None = Field( default=None, alias="rateRange", title="Amount of medication per unit of time", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e rate[x] "one_of_many": "rate", "one_of_many_required": False, }, ) rateRatio: fhirtypes.RatioType | None = Field( default=None, alias="rateRatio", title="Amount of medication per unit of time", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e rate[x] "one_of_many": "rate", "one_of_many_required": False, }, ) route: fhirtypes.CodeableConceptType | None = Field( default=None, alias="route", title="How drug should enter body", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sequence: fhirtypes.IntegerType | None = Field( default=None, alias="sequence", title="The order of the dosage instructions", description=( "Indicates the order in which the dosage instructions should be applied" " or interpreted." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) site: fhirtypes.CodeableConceptType | None = Field( default=None, alias="site", title="Body site to administer to", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Free text dosage instructions e.g. SIG", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) timing: fhirtypes.TimingType | None = Field( default=None, alias="timing", title="When medication should be administered", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Dosage`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "sequence", "text", "additionalInstruction", "patientInstruction", "timing", "asNeededBoolean", "asNeededCodeableConcept", "site", "route", "method", "doseRange", "doseQuantity", "maxDosePerPeriod", "maxDosePerAdministration", "maxDosePerLifetime", "rateRatio", "rateRange", "rateQuantity", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Dosage`` according to specification, with preserving the original sequence order. """ return [ "sequence", "text", "additionalInstruction", "patientInstruction", "timing", "asNeededBoolean", "asNeededCodeableConcept", "site", "route", "method", "doseRange", "doseQuantity", "maxDosePerPeriod", "maxDosePerAdministration", "maxDosePerLifetime", "rateRatio", "rateRange", "rateQuantity", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "asNeeded": ["asNeededBoolean", "asNeededCodeableConcept"], "dose": ["doseQuantity", "doseRange"], "rate": ["rateQuantity", "rateRange", "rateRatio"], } return one_of_many_fields ================================================ FILE: fhir/resources/STU3/duration.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Duration Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from . import quantity class Duration(quantity.Quantity): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A length of time. """ __resource_type__ = "Duration" @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Duration`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "value", "comparator", "unit", "system", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Duration`` according to specification, with preserving the original sequence order. """ return ["value", "comparator", "unit", "system", "code"] ================================================ FILE: fhir/resources/STU3/element.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Element Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from fhir_core import fhirabstractmodel from pydantic import Field from . import fhirtypes class Element(fhirabstractmodel.FHIRAbstractModel): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Base for all elements. Base definition for all elements in a resource. """ __resource_type__ = "Element" extension: typing.List[fhirtypes.ExtensionType] | None = Field( default=None, alias="extension", title="Additional Content defined by implementations", description=( "May be used to represent additional information that is not part of " "the basic definition of the element. In order to make the use of " "extensions safe and manageable, there is a strict set of governance " "applied to the definition and use of extensions. Though any " "implementer is allowed to define an extension, there is a set of " "requirements that SHALL be met as part of the definition of the " "extension." ), json_schema_extra={ "element_property": True, }, ) id: fhirtypes.StringType | None = Field( default=None, alias="id", title="xml:id (or equivalent in JSON)", description=( "unique id for the element within a resource (for internal references)." " This may be any string value that does not contain spaces." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Element`` according to specification, with preserving the original sequence order. """ return ["id", "extension"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Element`` according to specification, with preserving the original sequence order. """ return [] ================================================ FILE: fhir/resources/STU3/elementdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ElementDefinition Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class ElementDefinition(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of an element in a resource or extension. Captures constraints on each element within the resource, profile, or extension. """ __resource_type__ = "ElementDefinition" alias: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="alias", title="Other names", description="Identifies additional names by which this element might also be known.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_alias", title="Extension field for ``alias``." ) base: fhirtypes.ElementDefinitionBaseType | None = Field( default=None, alias="base", title="Base definition information for tools", description=( "Information about the base definition of the element, provided to make" " it unnecessary for tools to trace the deviation of the element " "through the derived and related profiles. This information is provided" " when the element definition is not the original definition of an " "element - i.g. either in a constraint on another type, or for elements" " from a super type in a snap shot." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) binding: fhirtypes.ElementDefinitionBindingType | None = Field( default=None, alias="binding", title="ValueSet details if this is coded", description=( "Binds to a value set if this element is coded (code, Coding, " "CodeableConcept, Quantity), or the data types (string, uri)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="code", title="Corresponding codes in terminologies", description=( "A code that has the same meaning as the element in a particular " "terminology." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comment: fhirtypes.MarkdownType | None = Field( default=None, alias="comment", title="Comments about the use of this element", description=( "Explanatory notes and implementation guidance about the data element, " "including notes about how to use the data properly, exceptions to " "proper use, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) condition: typing.List[fhirtypes.IdType | None] | None = Field( default=None, alias="condition", title="Reference to invariant about presence", description=( "A reference to an invariant that may make additional statements about " "the cardinality or value in the instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) condition__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_condition", title="Extension field for ``condition``." ) constraint: typing.List[fhirtypes.ElementDefinitionConstraintType] | None = Field( default=None, alias="constraint", title="Condition that must evaluate to true", description=( "Formal constraints such as co-occurrence and other constraints that " "can be computationally evaluated within the context of the instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contentReference: fhirtypes.UriType | None = Field( default=None, alias="contentReference", title="Reference to definition of content for the element", description=( "Identifies the identity of an element defined elsewhere in the profile" " whose content rules should be applied to the current element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contentReference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contentReference", title="Extension field for ``contentReference``.", ) defaultValueAddress: fhirtypes.AddressType | None = Field( default=None, alias="defaultValueAddress", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueAge: fhirtypes.AgeType | None = Field( default=None, alias="defaultValueAge", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="defaultValueAnnotation", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="defaultValueAttachment", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="defaultValueBase64Binary", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueBase64Binary", title="Extension field for ``defaultValueBase64Binary``.", ) defaultValueBoolean: bool | None = Field( default=None, alias="defaultValueBoolean", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueBoolean", title="Extension field for ``defaultValueBoolean``.", ) defaultValueCode: fhirtypes.CodeType | None = Field( default=None, alias="defaultValueCode", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueCode", title="Extension field for ``defaultValueCode``.", ) defaultValueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="defaultValueCodeableConcept", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueCoding: fhirtypes.CodingType | None = Field( default=None, alias="defaultValueCoding", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="defaultValueContactPoint", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueCount: fhirtypes.CountType | None = Field( default=None, alias="defaultValueCount", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDate: fhirtypes.DateType | None = Field( default=None, alias="defaultValueDate", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueDate", title="Extension field for ``defaultValueDate``.", ) defaultValueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="defaultValueDateTime", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueDateTime", title="Extension field for ``defaultValueDateTime``.", ) defaultValueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="defaultValueDecimal", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueDecimal", title="Extension field for ``defaultValueDecimal``.", ) defaultValueDistance: fhirtypes.DistanceType | None = Field( default=None, alias="defaultValueDistance", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDuration: fhirtypes.DurationType | None = Field( default=None, alias="defaultValueDuration", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="defaultValueHumanName", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueId: fhirtypes.IdType | None = Field( default=None, alias="defaultValueId", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueId", title="Extension field for ``defaultValueId``.", ) defaultValueIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="defaultValueIdentifier", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueInstant: fhirtypes.InstantType | None = Field( default=None, alias="defaultValueInstant", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueInstant", title="Extension field for ``defaultValueInstant``.", ) defaultValueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="defaultValueInteger", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueInteger", title="Extension field for ``defaultValueInteger``.", ) defaultValueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="defaultValueMarkdown", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueMarkdown", title="Extension field for ``defaultValueMarkdown``.", ) defaultValueMeta: fhirtypes.MetaType | None = Field( default=None, alias="defaultValueMeta", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueMoney: fhirtypes.MoneyType | None = Field( default=None, alias="defaultValueMoney", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueOid: fhirtypes.OidType | None = Field( default=None, alias="defaultValueOid", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueOid", title="Extension field for ``defaultValueOid``.", ) defaultValuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="defaultValuePeriod", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="defaultValuePositiveInt", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValuePositiveInt", title="Extension field for ``defaultValuePositiveInt``.", ) defaultValueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="defaultValueQuantity", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueRange: fhirtypes.RangeType | None = Field( default=None, alias="defaultValueRange", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueRatio: fhirtypes.RatioType | None = Field( default=None, alias="defaultValueRatio", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="defaultValueReference", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="defaultValueSampledData", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueSignature: fhirtypes.SignatureType | None = Field( default=None, alias="defaultValueSignature", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueString: fhirtypes.StringType | None = Field( default=None, alias="defaultValueString", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueString", title="Extension field for ``defaultValueString``.", ) defaultValueTime: fhirtypes.TimeType | None = Field( default=None, alias="defaultValueTime", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueTime", title="Extension field for ``defaultValueTime``.", ) defaultValueTiming: fhirtypes.TimingType | None = Field( default=None, alias="defaultValueTiming", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="defaultValueUnsignedInt", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueUnsignedInt", title="Extension field for ``defaultValueUnsignedInt``.", ) defaultValueUri: fhirtypes.UriType | None = Field( default=None, alias="defaultValueUri", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueUri", title="Extension field for ``defaultValueUri``.", ) definition: fhirtypes.MarkdownType | None = Field( default=None, alias="definition", title="Full formal definition as narrative text", description=( "Provides a complete explanation of the meaning of the data element for" " human readability. For the case of elements derived from existing " "elements (e.g. constraints), the definition SHALL be consistent with " "the base definition, but convey the meaning of the element in the " "particular context of use of the resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) example: typing.List[fhirtypes.ElementDefinitionExampleType] | None = Field( default=None, alias="example", title="Example value (as defined for type)", description=( "A sample value for this element demonstrating the type of information " "that would typically be found in the element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) fixedAddress: fhirtypes.AddressType | None = Field( default=None, alias="fixedAddress", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedAge: fhirtypes.AgeType | None = Field( default=None, alias="fixedAge", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="fixedAnnotation", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="fixedAttachment", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="fixedBase64Binary", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedBase64Binary", title="Extension field for ``fixedBase64Binary``.", ) fixedBoolean: bool | None = Field( default=None, alias="fixedBoolean", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedBoolean", title="Extension field for ``fixedBoolean``.", ) fixedCode: fhirtypes.CodeType | None = Field( default=None, alias="fixedCode", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedCode", title="Extension field for ``fixedCode``." ) fixedCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="fixedCodeableConcept", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedCoding: fhirtypes.CodingType | None = Field( default=None, alias="fixedCoding", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="fixedContactPoint", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedCount: fhirtypes.CountType | None = Field( default=None, alias="fixedCount", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedDate: fhirtypes.DateType | None = Field( default=None, alias="fixedDate", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedDate", title="Extension field for ``fixedDate``." ) fixedDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="fixedDateTime", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedDateTime", title="Extension field for ``fixedDateTime``.", ) fixedDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="fixedDecimal", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedDecimal", title="Extension field for ``fixedDecimal``.", ) fixedDistance: fhirtypes.DistanceType | None = Field( default=None, alias="fixedDistance", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedDuration: fhirtypes.DurationType | None = Field( default=None, alias="fixedDuration", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="fixedHumanName", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedId: fhirtypes.IdType | None = Field( default=None, alias="fixedId", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedId", title="Extension field for ``fixedId``." ) fixedIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="fixedIdentifier", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedInstant: fhirtypes.InstantType | None = Field( default=None, alias="fixedInstant", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedInstant", title="Extension field for ``fixedInstant``.", ) fixedInteger: fhirtypes.IntegerType | None = Field( default=None, alias="fixedInteger", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedInteger", title="Extension field for ``fixedInteger``.", ) fixedMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="fixedMarkdown", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedMarkdown", title="Extension field for ``fixedMarkdown``.", ) fixedMeta: fhirtypes.MetaType | None = Field( default=None, alias="fixedMeta", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedMoney: fhirtypes.MoneyType | None = Field( default=None, alias="fixedMoney", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedOid: fhirtypes.OidType | None = Field( default=None, alias="fixedOid", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedOid", title="Extension field for ``fixedOid``." ) fixedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="fixedPeriod", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedPositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="fixedPositiveInt", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedPositiveInt", title="Extension field for ``fixedPositiveInt``.", ) fixedQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="fixedQuantity", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedRange: fhirtypes.RangeType | None = Field( default=None, alias="fixedRange", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedRatio: fhirtypes.RatioType | None = Field( default=None, alias="fixedRatio", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedReference: fhirtypes.ReferenceType | None = Field( default=None, alias="fixedReference", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="fixedSampledData", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedSignature: fhirtypes.SignatureType | None = Field( default=None, alias="fixedSignature", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedString: fhirtypes.StringType | None = Field( default=None, alias="fixedString", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedString", title="Extension field for ``fixedString``." ) fixedTime: fhirtypes.TimeType | None = Field( default=None, alias="fixedTime", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedTime", title="Extension field for ``fixedTime``." ) fixedTiming: fhirtypes.TimingType | None = Field( default=None, alias="fixedTiming", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="fixedUnsignedInt", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedUnsignedInt", title="Extension field for ``fixedUnsignedInt``.", ) fixedUri: fhirtypes.UriType | None = Field( default=None, alias="fixedUri", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance. For purposes of comparison, non-significant whitespace " "is ignored, and all values must be an exact match (case and accent " "sensitive). Missing elements/attributes must also be missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedUri", title="Extension field for ``fixedUri``." ) isModifier: bool | None = Field( default=None, alias="isModifier", title="If this modifies the meaning of other elements", description=( "If true, the value of this element affects the interpretation of the " "element or resource that contains it, and the value of the element " "cannot be ignored. Typically, this is used for status, negation and " "qualification codes. The effect of this is that the element cannot be " "ignored by systems: they SHALL either recognize the element and " "process it, and/or a pre-determination has been made that it is not " "relevant to their particular system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) isModifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isModifier", title="Extension field for ``isModifier``." ) isSummary: bool | None = Field( default=None, alias="isSummary", title="Include when _summary = true?", description=( "Whether the element should be included if a client requests a search " "with the parameter _summary=true." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) isSummary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isSummary", title="Extension field for ``isSummary``." ) label: fhirtypes.StringType | None = Field( default=None, alias="label", title="Name for element to display with or prompt for element", description=( "A single preferred label which is the text to display beside the " "element indicating its meaning or to use to prompt for the element in " "a user display or form." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_label", title="Extension field for ``label``." ) mapping: typing.List[fhirtypes.ElementDefinitionMappingType] | None = Field( default=None, alias="mapping", title="Map element to another set of definitions", description=( "Identifies a concept from an external specification that roughly " "corresponds to this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) max: fhirtypes.StringType | None = Field( default=None, alias="max", title="Maximum Cardinality (a number or *)", description=( "The maximum number of times this element is permitted to appear in the" " instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_max", title="Extension field for ``max``." ) maxLength: fhirtypes.IntegerType | None = Field( default=None, alias="maxLength", title="Max length for strings", description=( "Indicates the maximum length in characters that is permitted to be " "present in conformant instances and which is expected to be supported " "by conformant consumers that support the element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maxLength__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxLength", title="Extension field for ``maxLength``." ) maxValueDate: fhirtypes.DateType | None = Field( default=None, alias="maxValueDate", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValueDate", title="Extension field for ``maxValueDate``.", ) maxValueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="maxValueDateTime", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValueDateTime", title="Extension field for ``maxValueDateTime``.", ) maxValueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="maxValueDecimal", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValueDecimal", title="Extension field for ``maxValueDecimal``.", ) maxValueInstant: fhirtypes.InstantType | None = Field( default=None, alias="maxValueInstant", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValueInstant", title="Extension field for ``maxValueInstant``.", ) maxValueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="maxValueInteger", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValueInteger", title="Extension field for ``maxValueInteger``.", ) maxValuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="maxValuePositiveInt", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValuePositiveInt", title="Extension field for ``maxValuePositiveInt``.", ) maxValueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="maxValueQuantity", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueTime: fhirtypes.TimeType | None = Field( default=None, alias="maxValueTime", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValueTime", title="Extension field for ``maxValueTime``.", ) maxValueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="maxValueUnsignedInt", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValueUnsignedInt", title="Extension field for ``maxValueUnsignedInt``.", ) meaningWhenMissing: fhirtypes.MarkdownType | None = Field( default=None, alias="meaningWhenMissing", title="Implicit meaning when this element is missing", description=( "The Implicit meaning that is to be understood when this element is " "missing (e.g. 'when this element is missing, the period is ongoing'." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) meaningWhenMissing__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_meaningWhenMissing", title="Extension field for ``meaningWhenMissing``.", ) min: fhirtypes.UnsignedIntType | None = Field( default=None, alias="min", title="Minimum Cardinality", description="The minimum number of times this element SHALL appear in the instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_min", title="Extension field for ``min``." ) minValueDate: fhirtypes.DateType | None = Field( default=None, alias="minValueDate", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValueDate", title="Extension field for ``minValueDate``.", ) minValueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="minValueDateTime", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValueDateTime", title="Extension field for ``minValueDateTime``.", ) minValueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="minValueDecimal", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValueDecimal", title="Extension field for ``minValueDecimal``.", ) minValueInstant: fhirtypes.InstantType | None = Field( default=None, alias="minValueInstant", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValueInstant", title="Extension field for ``minValueInstant``.", ) minValueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="minValueInteger", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValueInteger", title="Extension field for ``minValueInteger``.", ) minValuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="minValuePositiveInt", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValuePositiveInt", title="Extension field for ``minValuePositiveInt``.", ) minValueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="minValueQuantity", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueTime: fhirtypes.TimeType | None = Field( default=None, alias="minValueTime", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValueTime", title="Extension field for ``minValueTime``.", ) minValueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="minValueUnsignedInt", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValueUnsignedInt", title="Extension field for ``minValueUnsignedInt``.", ) mustSupport: bool | None = Field( default=None, alias="mustSupport", title="If the element must supported", description=( "If true, implementations that produce or consume resources SHALL " 'provide "support" for the element in some meaningful way. If false, ' "the element may be ignored and not supported." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) mustSupport__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mustSupport", title="Extension field for ``mustSupport``." ) orderMeaning: fhirtypes.StringType | None = Field( default=None, alias="orderMeaning", title="What the order of the elements means", description=( "If present, indicates that the order of the repeating element has " "meaning and describes what that meaning is. If absent, it means that " "the order of the element has no meaning." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) orderMeaning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_orderMeaning", title="Extension field for ``orderMeaning``.", ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="Path of the element in the hierarchy of elements", description=( 'The path identifies the element and is expressed as a "."-separated ' "list of ancestor elements, beginning with the name of the resource or " "extension." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) patternAddress: fhirtypes.AddressType | None = Field( default=None, alias="patternAddress", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternAge: fhirtypes.AgeType | None = Field( default=None, alias="patternAge", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="patternAnnotation", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="patternAttachment", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="patternBase64Binary", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternBase64Binary", title="Extension field for ``patternBase64Binary``.", ) patternBoolean: bool | None = Field( default=None, alias="patternBoolean", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternBoolean", title="Extension field for ``patternBoolean``.", ) patternCode: fhirtypes.CodeType | None = Field( default=None, alias="patternCode", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternCode", title="Extension field for ``patternCode``." ) patternCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="patternCodeableConcept", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternCoding: fhirtypes.CodingType | None = Field( default=None, alias="patternCoding", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="patternContactPoint", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternCount: fhirtypes.CountType | None = Field( default=None, alias="patternCount", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternDate: fhirtypes.DateType | None = Field( default=None, alias="patternDate", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternDate", title="Extension field for ``patternDate``." ) patternDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="patternDateTime", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternDateTime", title="Extension field for ``patternDateTime``.", ) patternDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="patternDecimal", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternDecimal", title="Extension field for ``patternDecimal``.", ) patternDistance: fhirtypes.DistanceType | None = Field( default=None, alias="patternDistance", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternDuration: fhirtypes.DurationType | None = Field( default=None, alias="patternDuration", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="patternHumanName", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternId: fhirtypes.IdType | None = Field( default=None, alias="patternId", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternId", title="Extension field for ``patternId``." ) patternIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="patternIdentifier", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternInstant: fhirtypes.InstantType | None = Field( default=None, alias="patternInstant", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternInstant", title="Extension field for ``patternInstant``.", ) patternInteger: fhirtypes.IntegerType | None = Field( default=None, alias="patternInteger", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternInteger", title="Extension field for ``patternInteger``.", ) patternMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="patternMarkdown", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternMarkdown", title="Extension field for ``patternMarkdown``.", ) patternMeta: fhirtypes.MetaType | None = Field( default=None, alias="patternMeta", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternMoney: fhirtypes.MoneyType | None = Field( default=None, alias="patternMoney", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternOid: fhirtypes.OidType | None = Field( default=None, alias="patternOid", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternOid", title="Extension field for ``patternOid``." ) patternPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="patternPeriod", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternPositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="patternPositiveInt", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternPositiveInt", title="Extension field for ``patternPositiveInt``.", ) patternQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="patternQuantity", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternRange: fhirtypes.RangeType | None = Field( default=None, alias="patternRange", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternRatio: fhirtypes.RatioType | None = Field( default=None, alias="patternRatio", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternReference: fhirtypes.ReferenceType | None = Field( default=None, alias="patternReference", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="patternSampledData", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternSignature: fhirtypes.SignatureType | None = Field( default=None, alias="patternSignature", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternString: fhirtypes.StringType | None = Field( default=None, alias="patternString", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternString", title="Extension field for ``patternString``.", ) patternTime: fhirtypes.TimeType | None = Field( default=None, alias="patternTime", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternTime", title="Extension field for ``patternTime``." ) patternTiming: fhirtypes.TimingType | None = Field( default=None, alias="patternTiming", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="patternUnsignedInt", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternUnsignedInt", title="Extension field for ``patternUnsignedInt``.", ) patternUri: fhirtypes.UriType | None = Field( default=None, alias="patternUri", title="Value must have at least these property values", description=( "Specifies a value that the value in the instance SHALL follow - that " "is, any value in the pattern must be found in the instance. Other " "additional values may be found too. This is effectively constraint by " "example. The values of elements present in the pattern must match " "exactly (case-sensitive, accent-sensitive, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternUri", title="Extension field for ``patternUri``." ) representation: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="representation", title="xmlAttr | xmlText | typeAttr | cdaText | xhtml", description=( "Codes that define how this element is represented in instances, when " "the deviation varies from the normal case." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["xmlAttr", "xmlText", "typeAttr", "cdaText", "xhtml"], }, ) representation__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_representation", title="Extension field for ``representation``.", ) requirements: fhirtypes.MarkdownType | None = Field( default=None, alias="requirements", title="Why this resource has been created", description=( "This element is for traceability of why the element was created and " "why the constraints exist as they do. This may be used to point to " "source materials or specifications that drove the structure of this " "element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) requirements__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requirements", title="Extension field for ``requirements``.", ) short: fhirtypes.StringType | None = Field( default=None, alias="short", title="Concise definition for space-constrained presentation", description=( "A concise description of what this element means (e.g. for use in " "autogenerated summaries)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) short__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_short", title="Extension field for ``short``." ) sliceName: fhirtypes.StringType | None = Field( default=None, alias="sliceName", title="Name for this particular element (in a set of slices)", description=( "The name of this element definition slice, when slicing is working. " "The name must be a token with no dots or spaces. This is a unique name" " referring to a specific set of constraints applied to this element, " "used to provide a name to different slices of the same element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sliceName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sliceName", title="Extension field for ``sliceName``." ) slicing: fhirtypes.ElementDefinitionSlicingType | None = Field( default=None, alias="slicing", title="This element is sliced - slices follow", description=( "Indicates that the element is sliced into a set of alternative " "definitions (i.e. in a structure definition, there are multiple " "different constraints on a single element in the base resource). " "Slicing can be used in any resource that has cardinality ..* on the " "base resource, or any resource with a choice of types. The set of " "slices is any elements that come after this in the element sequence " "that have the same path, until a shorter path occurs (the shorter path" " terminates the set)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: typing.List[fhirtypes.ElementDefinitionTypeType] | None = Field( default=None, alias="type", title="Data type and Profile for this element", description=( "The data type or resource that the value of this element is permitted " "to be." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "path", "representation", "sliceName", "label", "code", "slicing", "short", "definition", "comment", "requirements", "alias", "min", "max", "base", "contentReference", "type", "defaultValueBase64Binary", "defaultValueBoolean", "defaultValueCode", "defaultValueDate", "defaultValueDateTime", "defaultValueDecimal", "defaultValueId", "defaultValueInstant", "defaultValueInteger", "defaultValueMarkdown", "defaultValueOid", "defaultValuePositiveInt", "defaultValueString", "defaultValueTime", "defaultValueUnsignedInt", "defaultValueUri", "defaultValueAddress", "defaultValueAge", "defaultValueAnnotation", "defaultValueAttachment", "defaultValueCodeableConcept", "defaultValueCoding", "defaultValueContactPoint", "defaultValueCount", "defaultValueDistance", "defaultValueDuration", "defaultValueHumanName", "defaultValueIdentifier", "defaultValueMoney", "defaultValuePeriod", "defaultValueQuantity", "defaultValueRange", "defaultValueRatio", "defaultValueReference", "defaultValueSampledData", "defaultValueSignature", "defaultValueTiming", "defaultValueMeta", "meaningWhenMissing", "orderMeaning", "fixedBase64Binary", "fixedBoolean", "fixedCode", "fixedDate", "fixedDateTime", "fixedDecimal", "fixedId", "fixedInstant", "fixedInteger", "fixedMarkdown", "fixedOid", "fixedPositiveInt", "fixedString", "fixedTime", "fixedUnsignedInt", "fixedUri", "fixedAddress", "fixedAge", "fixedAnnotation", "fixedAttachment", "fixedCodeableConcept", "fixedCoding", "fixedContactPoint", "fixedCount", "fixedDistance", "fixedDuration", "fixedHumanName", "fixedIdentifier", "fixedMoney", "fixedPeriod", "fixedQuantity", "fixedRange", "fixedRatio", "fixedReference", "fixedSampledData", "fixedSignature", "fixedTiming", "fixedMeta", "patternBase64Binary", "patternBoolean", "patternCode", "patternDate", "patternDateTime", "patternDecimal", "patternId", "patternInstant", "patternInteger", "patternMarkdown", "patternOid", "patternPositiveInt", "patternString", "patternTime", "patternUnsignedInt", "patternUri", "patternAddress", "patternAge", "patternAnnotation", "patternAttachment", "patternCodeableConcept", "patternCoding", "patternContactPoint", "patternCount", "patternDistance", "patternDuration", "patternHumanName", "patternIdentifier", "patternMoney", "patternPeriod", "patternQuantity", "patternRange", "patternRatio", "patternReference", "patternSampledData", "patternSignature", "patternTiming", "patternMeta", "example", "minValueDate", "minValueDateTime", "minValueInstant", "minValueTime", "minValueDecimal", "minValueInteger", "minValuePositiveInt", "minValueUnsignedInt", "minValueQuantity", "maxValueDate", "maxValueDateTime", "maxValueInstant", "maxValueTime", "maxValueDecimal", "maxValueInteger", "maxValuePositiveInt", "maxValueUnsignedInt", "maxValueQuantity", "maxLength", "condition", "constraint", "mustSupport", "isModifier", "isSummary", "binding", "mapping", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinition`` according to specification, with preserving the original sequence order. """ return [ "path", "representation", "sliceName", "label", "code", "slicing", "short", "definition", "comment", "requirements", "alias", "min", "max", "base", "contentReference", "type", "defaultValueBase64Binary", "defaultValueBoolean", "defaultValueCode", "defaultValueDate", "defaultValueDateTime", "defaultValueDecimal", "defaultValueId", "defaultValueInstant", "defaultValueInteger", "defaultValueMarkdown", "defaultValueOid", "defaultValuePositiveInt", "defaultValueString", "defaultValueTime", "defaultValueUnsignedInt", "defaultValueUri", "defaultValueAddress", "defaultValueAge", "defaultValueAnnotation", "defaultValueAttachment", "defaultValueCodeableConcept", "defaultValueCoding", "defaultValueContactPoint", "defaultValueCount", "defaultValueDistance", "defaultValueDuration", "defaultValueHumanName", "defaultValueIdentifier", "defaultValueMoney", "defaultValuePeriod", "defaultValueQuantity", "defaultValueRange", "defaultValueRatio", "defaultValueReference", "defaultValueSampledData", "defaultValueSignature", "defaultValueTiming", "defaultValueMeta", "meaningWhenMissing", "orderMeaning", "fixedBase64Binary", "fixedBoolean", "fixedCode", "fixedDate", "fixedDateTime", "fixedDecimal", "fixedId", "fixedInstant", "fixedInteger", "fixedMarkdown", "fixedOid", "fixedPositiveInt", "fixedString", "fixedTime", "fixedUnsignedInt", "fixedUri", "fixedAddress", "fixedAge", "fixedAnnotation", "fixedAttachment", "fixedCodeableConcept", "fixedCoding", "fixedContactPoint", "fixedCount", "fixedDistance", "fixedDuration", "fixedHumanName", "fixedIdentifier", "fixedMoney", "fixedPeriod", "fixedQuantity", "fixedRange", "fixedRatio", "fixedReference", "fixedSampledData", "fixedSignature", "fixedTiming", "fixedMeta", "patternBase64Binary", "patternBoolean", "patternCode", "patternDate", "patternDateTime", "patternDecimal", "patternId", "patternInstant", "patternInteger", "patternMarkdown", "patternOid", "patternPositiveInt", "patternString", "patternTime", "patternUnsignedInt", "patternUri", "patternAddress", "patternAge", "patternAnnotation", "patternAttachment", "patternCodeableConcept", "patternCoding", "patternContactPoint", "patternCount", "patternDistance", "patternDuration", "patternHumanName", "patternIdentifier", "patternMoney", "patternPeriod", "patternQuantity", "patternRange", "patternRatio", "patternReference", "patternSampledData", "patternSignature", "patternTiming", "patternMeta", "example", "minValueDate", "minValueDateTime", "minValueInstant", "minValueTime", "minValueDecimal", "minValueInteger", "minValuePositiveInt", "minValueUnsignedInt", "minValueQuantity", "maxValueDate", "maxValueDateTime", "maxValueInstant", "maxValueTime", "maxValueDecimal", "maxValueInteger", "maxValuePositiveInt", "maxValueUnsignedInt", "maxValueQuantity", "maxLength", "condition", "constraint", "mustSupport", "isModifier", "isSummary", "binding", "mapping", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("path", "path__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "defaultValue": [ "defaultValueAddress", "defaultValueAge", "defaultValueAnnotation", "defaultValueAttachment", "defaultValueBase64Binary", "defaultValueBoolean", "defaultValueCode", "defaultValueCodeableConcept", "defaultValueCoding", "defaultValueContactPoint", "defaultValueCount", "defaultValueDate", "defaultValueDateTime", "defaultValueDecimal", "defaultValueDistance", "defaultValueDuration", "defaultValueHumanName", "defaultValueId", "defaultValueIdentifier", "defaultValueInstant", "defaultValueInteger", "defaultValueMarkdown", "defaultValueMeta", "defaultValueMoney", "defaultValueOid", "defaultValuePeriod", "defaultValuePositiveInt", "defaultValueQuantity", "defaultValueRange", "defaultValueRatio", "defaultValueReference", "defaultValueSampledData", "defaultValueSignature", "defaultValueString", "defaultValueTime", "defaultValueTiming", "defaultValueUnsignedInt", "defaultValueUri", ], "fixed": [ "fixedAddress", "fixedAge", "fixedAnnotation", "fixedAttachment", "fixedBase64Binary", "fixedBoolean", "fixedCode", "fixedCodeableConcept", "fixedCoding", "fixedContactPoint", "fixedCount", "fixedDate", "fixedDateTime", "fixedDecimal", "fixedDistance", "fixedDuration", "fixedHumanName", "fixedId", "fixedIdentifier", "fixedInstant", "fixedInteger", "fixedMarkdown", "fixedMeta", "fixedMoney", "fixedOid", "fixedPeriod", "fixedPositiveInt", "fixedQuantity", "fixedRange", "fixedRatio", "fixedReference", "fixedSampledData", "fixedSignature", "fixedString", "fixedTime", "fixedTiming", "fixedUnsignedInt", "fixedUri", ], "maxValue": [ "maxValueDate", "maxValueDateTime", "maxValueDecimal", "maxValueInstant", "maxValueInteger", "maxValuePositiveInt", "maxValueQuantity", "maxValueTime", "maxValueUnsignedInt", ], "minValue": [ "minValueDate", "minValueDateTime", "minValueDecimal", "minValueInstant", "minValueInteger", "minValuePositiveInt", "minValueQuantity", "minValueTime", "minValueUnsignedInt", ], "pattern": [ "patternAddress", "patternAge", "patternAnnotation", "patternAttachment", "patternBase64Binary", "patternBoolean", "patternCode", "patternCodeableConcept", "patternCoding", "patternContactPoint", "patternCount", "patternDate", "patternDateTime", "patternDecimal", "patternDistance", "patternDuration", "patternHumanName", "patternId", "patternIdentifier", "patternInstant", "patternInteger", "patternMarkdown", "patternMeta", "patternMoney", "patternOid", "patternPeriod", "patternPositiveInt", "patternQuantity", "patternRange", "patternRatio", "patternReference", "patternSampledData", "patternSignature", "patternString", "patternTime", "patternTiming", "patternUnsignedInt", "patternUri", ], } return one_of_many_fields class ElementDefinitionBase(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Base definition information for tools. Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. This information is provided when the element definition is not the original definition of an element - i.g. either in a constraint on another type, or for elements from a super type in a snap shot. """ __resource_type__ = "ElementDefinitionBase" max: fhirtypes.StringType | None = Field( default=None, alias="max", title="Max cardinality of the base element", description="Maximum cardinality of the base element identified by the path.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_max", title="Extension field for ``max``." ) min: fhirtypes.UnsignedIntType | None = Field( default=None, alias="min", title="Min cardinality of the base element", description="Minimum cardinality of the base element identified by the path.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_min", title="Extension field for ``min``." ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="Path that identifies the base element", description=( "The Path that identifies the base element - this matches the " "ElementDefinition.path for that element. Across FHIR, there is only " "one base definition of any element - that is, an element definition on" " a [StructureDefinition](structuredefinition.html#) without a " "StructureDefinition.base." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionBase`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "path", "min", "max"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionBase`` according to specification, with preserving the original sequence order. """ return ["path", "min", "max"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("max", "max__ext"), ("min", "min__ext"), ("path", "path__ext"), ] return required_fields class ElementDefinitionBinding(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. ValueSet details if this is coded. Binds to a value set if this element is coded (code, Coding, CodeableConcept, Quantity), or the data types (string, uri). """ __resource_type__ = "ElementDefinitionBinding" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Human explanation of the value set", description="Describes the intended use of this particular set of codes.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) strength: fhirtypes.CodeType | None = Field( default=None, alias="strength", title="required | extensible | preferred | example", description=( "Indicates the degree of conformance expectations associated with this " "binding - that is, the degree to which the provided value set must be " "adhered to in the instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["required", "extensible", "preferred", "example"], }, ) strength__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_strength", title="Extension field for ``strength``." ) valueSetReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueSetReference", title="Source of value set", description=( "Points to the value set or external definition (e.g. implicit value " "set) that identifies the set of codes to be used. If the binding " "refers to an explicit value set - the normal case - then use a " "Reference(ValueSet) preferably containing the canonical URL for the " "value set. If the reference is to an implicit value set - usually, an " "IETF RFC that defines a grammar, such as mime types - then use a uri." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e valueSet[x] "one_of_many": "valueSet", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) valueSetUri: fhirtypes.UriType | None = Field( default=None, alias="valueSetUri", title="Source of value set", description=( "Points to the value set or external definition (e.g. implicit value " "set) that identifies the set of codes to be used. If the binding " "refers to an explicit value set - the normal case - then use a " "Reference(ValueSet) preferably containing the canonical URL for the " "value set. If the reference is to an implicit value set - usually, an " "IETF RFC that defines a grammar, such as mime types - then use a uri." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e valueSet[x] "one_of_many": "valueSet", "one_of_many_required": False, }, ) valueSetUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueSetUri", title="Extension field for ``valueSetUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionBinding`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "strength", "description", "valueSetUri", "valueSetReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionBinding`` according to specification, with preserving the original sequence order. """ return ["strength", "description", "valueSetUri", "valueSetReference"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("strength", "strength__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"valueSet": ["valueSetReference", "valueSetUri"]} return one_of_many_fields class ElementDefinitionConstraint(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Condition that must evaluate to true. Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance. """ __resource_type__ = "ElementDefinitionConstraint" expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="FHIRPath expression of constraint", description=( "A [FHIRPath](http://hl7.org/fluentpath) expression of constraint that " "can be executed to see if this constraint is met." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) human: fhirtypes.StringType | None = Field( default=None, alias="human", title="Human description of constraint", description=( "Text that can be used to describe the constraint in messages " "identifying that the constraint has been violated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) human__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_human", title="Extension field for ``human``." ) key: fhirtypes.IdType | None = Field( default=None, alias="key", title="Target of 'condition' reference above", description=( "Allows identification of which elements have their cardinalities " "impacted by the constraint. Will not be referenced for constraints " "that do not affect cardinality." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) key__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_key", title="Extension field for ``key``." ) requirements: fhirtypes.StringType | None = Field( default=None, alias="requirements", title="Why this constraint is necessary or appropriate", description="Description of why this constraint is necessary or appropriate.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) requirements__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requirements", title="Extension field for ``requirements``.", ) severity: fhirtypes.CodeType | None = Field( default=None, alias="severity", title="error | warning", description=( "Identifies the impact constraint violation has on the conformance of " "the instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["error", "warning"], }, ) severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_severity", title="Extension field for ``severity``." ) source: fhirtypes.UriType | None = Field( default=None, alias="source", title="Reference to original source of constraint", description=( "A reference to the original source of the constraint, for traceability" " purposes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_source", title="Extension field for ``source``." ) xpath: fhirtypes.StringType | None = Field( default=None, alias="xpath", title="XPath expression of constraint", description=( "An XPath expression of constraint that can be executed to see if this " "constraint is met." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) xpath__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_xpath", title="Extension field for ``xpath``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionConstraint`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "key", "requirements", "severity", "human", "expression", "xpath", "source", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionConstraint`` according to specification, with preserving the original sequence order. """ return [ "key", "requirements", "severity", "human", "expression", "xpath", "source", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("expression", "expression__ext"), ("human", "human__ext"), ("key", "key__ext"), ("severity", "severity__ext"), ] return required_fields class ElementDefinitionExample(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Example value (as defined for type). A sample value for this element demonstrating the type of information that would typically be found in the element. """ __resource_type__ = "ElementDefinitionExample" label: fhirtypes.StringType | None = Field( default=None, alias="label", title="Describes the purpose of this example", description="Describes the purpose of this example amoung the set of examples.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_label", title="Extension field for ``label``." ) valueAddress: fhirtypes.AddressType | None = Field( default=None, alias="valueAddress", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAge: fhirtypes.AgeType | None = Field( default=None, alias="valueAge", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="valueAnnotation", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="valueBase64Binary", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBase64Binary", title="Extension field for ``valueBase64Binary``.", ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="valueContactPoint", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCount: fhirtypes.CountType | None = Field( default=None, alias="valueCount", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueDistance: fhirtypes.DistanceType | None = Field( default=None, alias="valueDistance", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDuration: fhirtypes.DurationType | None = Field( default=None, alias="valueDuration", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="valueHumanName", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId: fhirtypes.IdType | None = Field( default=None, alias="valueId", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueId", title="Extension field for ``valueId``." ) valueIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="valueIdentifier", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInstant: fhirtypes.InstantType | None = Field( default=None, alias="valueInstant", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInstant", title="Extension field for ``valueInstant``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="valueMarkdown", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueMarkdown", title="Extension field for ``valueMarkdown``.", ) valueMeta: fhirtypes.MetaType | None = Field( default=None, alias="valueMeta", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueMoney: fhirtypes.MoneyType | None = Field( default=None, alias="valueMoney", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueOid: fhirtypes.OidType | None = Field( default=None, alias="valueOid", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueOid", title="Extension field for ``valueOid``." ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="valuePositiveInt", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valuePositiveInt", title="Extension field for ``valuePositiveInt``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="valueSampledData", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueSignature: fhirtypes.SignatureType | None = Field( default=None, alias="valueSignature", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) valueTiming: fhirtypes.TimingType | None = Field( default=None, alias="valueTiming", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="valueUnsignedInt", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUnsignedInt", title="Extension field for ``valueUnsignedInt``.", ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionExample`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "label", "valueBase64Binary", "valueBoolean", "valueCode", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInstant", "valueInteger", "valueMarkdown", "valueOid", "valuePositiveInt", "valueString", "valueTime", "valueUnsignedInt", "valueUri", "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueCodeableConcept", "valueCoding", "valueContactPoint", "valueCount", "valueDistance", "valueDuration", "valueHumanName", "valueIdentifier", "valueMoney", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueReference", "valueSampledData", "valueSignature", "valueTiming", "valueMeta", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionExample`` according to specification, with preserving the original sequence order. """ return [ "label", "valueBase64Binary", "valueBoolean", "valueCode", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInstant", "valueInteger", "valueMarkdown", "valueOid", "valuePositiveInt", "valueString", "valueTime", "valueUnsignedInt", "valueUri", "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueCodeableConcept", "valueCoding", "valueContactPoint", "valueCount", "valueDistance", "valueDuration", "valueHumanName", "valueIdentifier", "valueMoney", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueReference", "valueSampledData", "valueSignature", "valueTiming", "valueMeta", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("label", "label__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueBase64Binary", "valueBoolean", "valueCode", "valueCodeableConcept", "valueCoding", "valueContactPoint", "valueCount", "valueDate", "valueDateTime", "valueDecimal", "valueDistance", "valueDuration", "valueHumanName", "valueId", "valueIdentifier", "valueInstant", "valueInteger", "valueMarkdown", "valueMeta", "valueMoney", "valueOid", "valuePeriod", "valuePositiveInt", "valueQuantity", "valueRange", "valueRatio", "valueReference", "valueSampledData", "valueSignature", "valueString", "valueTime", "valueTiming", "valueUnsignedInt", "valueUri", ] } return one_of_many_fields class ElementDefinitionMapping(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Map element to another set of definitions. Identifies a concept from an external specification that roughly corresponds to this element. """ __resource_type__ = "ElementDefinitionMapping" comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Comments about the mapping or its use", description="Comments that provide information about the mapping or its use.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) identity: fhirtypes.IdType | None = Field( default=None, alias="identity", title="Reference to mapping declaration", description="An internal reference to the definition of a mapping.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) identity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_identity", title="Extension field for ``identity``." ) language: fhirtypes.CodeType | None = Field( default=None, alias="language", title="Computable language of mapping", description="Identifies the computable language in which mapping.map is expressed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) map: fhirtypes.StringType | None = Field( default=None, alias="map", title="Details of the mapping", description=( "Expresses what part of the target specification corresponds to this " "element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) map__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_map", title="Extension field for ``map``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionMapping`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "identity", "language", "map", "comment"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionMapping`` according to specification, with preserving the original sequence order. """ return ["identity", "language", "map", "comment"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("identity", "identity__ext"), ("map", "map__ext")] return required_fields class ElementDefinitionSlicing(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. This element is sliced - slices follow. Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set). """ __resource_type__ = "ElementDefinitionSlicing" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Text description of how slicing works (or not)", description=( "A human-readable text description of how the slicing works. If there " "is no discriminator, this is required to be present to provide " "whatever information is possible about how the slices can be " "differentiated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) discriminator: typing.List[ fhirtypes.ElementDefinitionSlicingDiscriminatorType ] | None = Field( default=None, alias="discriminator", title="Element values that are used to distinguish the slices", description=( "Designates which child elements are used to discriminate between the " "slices when processing an instance. If one or more discriminators are " "provided, the value of the child elements in the instance data SHALL " "completely distinguish which slice the element in the resource matches" " based on the allowed values for those elements in each of the slices." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ordered: bool | None = Field( default=None, alias="ordered", title="If elements must be in same order as slices", description=( "If the matching elements have to occur in the same order as defined in" " the profile." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ordered__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_ordered", title="Extension field for ``ordered``." ) rules: fhirtypes.CodeType | None = Field( default=None, alias="rules", title="closed | open | openAtEnd", description=( "Whether additional slices are allowed or not. When the slices are " "ordered, profile authors can also say that additional slices are only " "allowed at the end." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["closed", "open", "openAtEnd"], }, ) rules__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rules", title="Extension field for ``rules``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionSlicing`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "discriminator", "description", "ordered", "rules"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionSlicing`` according to specification, with preserving the original sequence order. """ return ["discriminator", "description", "ordered", "rules"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("rules", "rules__ext")] return required_fields class ElementDefinitionSlicingDiscriminator(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Element values that are used to distinguish the slices. Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices. """ __resource_type__ = "ElementDefinitionSlicingDiscriminator" path: fhirtypes.StringType | None = Field( default=None, alias="path", title="Path to element value", description=( "A FHIRPath expression, using a restricted subset of FHIRPath, that is " "used to identify the element on which discrimination is based." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="value | exists | pattern | type | profile", description="How the element value is interpreted when discrimination is evaluated.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["value", "exists", "pattern", "type", "profile"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionSlicingDiscriminator`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "type", "path"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionSlicingDiscriminator`` according to specification, with preserving the original sequence order. """ return ["type", "path"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("path", "path__ext"), ("type", "type__ext")] return required_fields class ElementDefinitionType(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Data type and Profile for this element. The data type or resource that the value of this element is permitted to be. """ __resource_type__ = "ElementDefinitionType" aggregation: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="aggregation", title="contained | referenced | bundled - how aggregated", description=( "If the type is a reference to another resource, how the resource is or" " can be aggregated - is it a contained resource, or a reference, and " "if the context is a bundle, is it included in the bundle." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["contained", "referenced", "bundled"], }, ) aggregation__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_aggregation", title="Extension field for ``aggregation``." ) code: fhirtypes.UriType | None = Field( default=None, alias="code", title="Data type or Resource (reference to definition)", description=( "URL of Data type or Resource that is a(or the) type used for this " "element. References are URLs that are relative to " 'http://hl7.org/fhir/StructureDefinition e.g. "string" is a reference ' "to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are " "only allowed in logical models." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) profile: fhirtypes.UriType | None = Field( default=None, alias="profile", title="Profile (StructureDefinition) to apply (or IG)", description=( "Identifies a profile structure or implementation Guide that SHALL hold" " for the datatype this element refers to. Can be a local reference - " "to a contained StructureDefinition, or a reference to another " "StructureDefinition or Implementation Guide by a canonical URL. When " "an implementation guide is specified, the resource SHALL conform to at" " least one profile defined in the implementation guide." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) targetProfile: fhirtypes.UriType | None = Field( default=None, alias="targetProfile", title="Profile (StructureDefinition) to apply to reference target (or IG)", description=( "Identifies a profile structure or implementation Guide that SHALL hold" " for the target of the reference this element refers to. Can be a " "local reference - to a contained StructureDefinition, or a reference " "to another StructureDefinition or Implementation Guide by a canonical " "URL. When an implementation guide is specified, the resource SHALL " "conform to at least one profile defined in the implementation guide." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) targetProfile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_targetProfile", title="Extension field for ``targetProfile``.", ) versioning: fhirtypes.CodeType | None = Field( default=None, alias="versioning", title="either | independent | specific", description=( "Whether this reference needs to be version specific or version " "independent, or whether either can be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["either", "independent", "specific"], }, ) versioning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versioning", title="Extension field for ``versioning``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionType`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "code", "profile", "targetProfile", "aggregation", "versioning", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionType`` according to specification, with preserving the original sequence order. """ return ["code", "profile", "targetProfile", "aggregation", "versioning"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/eligibilityrequest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/EligibilityRequest Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class EligibilityRequest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Determine insurance validity and scope of coverage. The EligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an EligibilityResponse, with information regarding whether the stated coverage is valid and in- force and optionally to provide the insurance details of the policy. """ __resource_type__ = "EligibilityRequest" benefitCategory: fhirtypes.CodeableConceptType | None = Field( default=None, alias="benefitCategory", title="Type of services covered", description="Dental, Vision, Medical, Pharmacy, Rehab etc.", json_schema_extra={ "element_property": True, }, ) benefitSubCategory: fhirtypes.CodeableConceptType | None = Field( default=None, alias="benefitSubCategory", title="Detailed services covered within the type", description="Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.", json_schema_extra={ "element_property": True, }, ) businessArrangement: fhirtypes.StringType | None = Field( default=None, alias="businessArrangement", title="Business agreement", description=( "The contract number of a business agreement which describes the terms " "and conditions." ), json_schema_extra={ "element_property": True, }, ) businessArrangement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_businessArrangement", title="Extension field for ``businessArrangement``.", ) coverage: fhirtypes.ReferenceType | None = Field( default=None, alias="coverage", title="Insurance or medical plan", description="Financial instrument by which payment information for health care.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage"], }, ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Creation date", description="The date when this resource was created.", json_schema_extra={ "element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) enterer: fhirtypes.ReferenceType | None = Field( default=None, alias="enterer", title="Author", description=( "Person who created the invoice/claim/pre-determination or pre-" "authorization." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) facility: fhirtypes.ReferenceType | None = Field( default=None, alias="facility", title="Servicing Facility", description="Facility where the services were provided.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier", description="The Response business identifier.", json_schema_extra={ "element_property": True, }, ) insurer: fhirtypes.ReferenceType | None = Field( default=None, alias="insurer", title="Target", description="The Insurer who is target of the request.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) organization: fhirtypes.ReferenceType | None = Field( default=None, alias="organization", title="Responsible organization", description=( "The organization which is responsible for the services rendered to the" " patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) patient: fhirtypes.ReferenceType | None = Field( default=None, alias="patient", title="The subject of the Products and Services", description="Patient Resource.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) priority: fhirtypes.CodeableConceptType | None = Field( default=None, alias="priority", title="Desired processing priority", description="Immediate (STAT), best effort (NORMAL), deferred (DEFER).", json_schema_extra={ "element_property": True, }, ) provider: fhirtypes.ReferenceType | None = Field( default=None, alias="provider", title="Responsible practitioner", description=( "The practitioner who is responsible for the services rendered to the " "patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) servicedDate: fhirtypes.DateType | None = Field( default=None, alias="servicedDate", title="Estimated date or dates of Service", description=( "The date or dates when the enclosed suite of services were performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_servicedDate", title="Extension field for ``servicedDate``.", ) servicedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="servicedPeriod", title="Estimated date or dates of Service", description=( "The date or dates when the enclosed suite of services were performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EligibilityRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "priority", "patient", "servicedDate", "servicedPeriod", "created", "enterer", "provider", "organization", "insurer", "facility", "coverage", "businessArrangement", "benefitCategory", "benefitSubCategory", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EligibilityRequest`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "status"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"serviced": ["servicedDate", "servicedPeriod"]} return one_of_many_fields ================================================ FILE: fhir/resources/STU3/eligibilityresponse.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/EligibilityResponse Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class EligibilityResponse(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. EligibilityResponse resource. This resource provides eligibility and plan details from the processing of an Eligibility resource. """ __resource_type__ = "EligibilityResponse" created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Creation date", description=( "The date when the enclosed suite of services were performed or " "completed." ), json_schema_extra={ "element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) disposition: fhirtypes.StringType | None = Field( default=None, alias="disposition", title="Disposition Message", description="A description of the status of the adjudication.", json_schema_extra={ "element_property": True, }, ) disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_disposition", title="Extension field for ``disposition``." ) error: typing.List[fhirtypes.EligibilityResponseErrorType] | None = Field( default=None, alias="error", title="Processing errors", description="Mutually exclusive with Services Provided (Item).", json_schema_extra={ "element_property": True, }, ) form: fhirtypes.CodeableConceptType | None = Field( default=None, alias="form", title="Printed Form Identifier", description="The form to be used for printing the content.", json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier", description="The Response business identifier.", json_schema_extra={ "element_property": True, }, ) inforce: bool | None = Field( default=None, alias="inforce", title="Coverage inforce indicator", description=( "Flag indicating if the coverage provided is inforce currently if no " "service date(s) specified or for the whole duration of the service " "dates." ), json_schema_extra={ "element_property": True, }, ) inforce__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_inforce", title="Extension field for ``inforce``." ) insurance: typing.List[fhirtypes.EligibilityResponseInsuranceType] | None = Field( default=None, alias="insurance", title="Details by insurance coverage", description=( "The insurer may provide both the details for the requested coverage as" " well as details for additional coverages known to the insurer." ), json_schema_extra={ "element_property": True, }, ) insurer: fhirtypes.ReferenceType | None = Field( default=None, alias="insurer", title="Insurer issuing the coverage", description="The Insurer who produced this adjudicated response.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) outcome: fhirtypes.CodeableConceptType | None = Field( default=None, alias="outcome", title="complete | error | partial", description="Transaction status: error, complete.", json_schema_extra={ "element_property": True, }, ) request: fhirtypes.ReferenceType | None = Field( default=None, alias="request", title="Eligibility reference", description="Original request resource reference.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["EligibilityRequest"], }, ) requestOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="requestOrganization", title="Responsible organization", description=( "The organization which is responsible for the services rendered to the" " patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) requestProvider: fhirtypes.ReferenceType | None = Field( default=None, alias="requestProvider", title="Responsible practitioner", description=( "The practitioner who is responsible for the services rendered to the " "patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EligibilityResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "created", "requestProvider", "requestOrganization", "request", "outcome", "disposition", "insurer", "inforce", "insurance", "form", "error", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EligibilityResponse`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "status"] class EligibilityResponseError(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Processing errors. Mutually exclusive with Services Provided (Item). """ __resource_type__ = "EligibilityResponseError" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Error code detailing processing issues", description=( "An error code,from a specified code system, which details why the " "eligibility check could not be performed." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EligibilityResponseError`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EligibilityResponseError`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EligibilityResponseInsurance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details by insurance coverage. The insurer may provide both the details for the requested coverage as well as details for additional coverages known to the insurer. """ __resource_type__ = "EligibilityResponseInsurance" benefitBalance: typing.List[ fhirtypes.EligibilityResponseInsuranceBenefitBalanceType ] | None = Field( default=None, alias="benefitBalance", title="Benefits by Category", description="Benefits and optionally current balances by Category.", json_schema_extra={ "element_property": True, }, ) contract: fhirtypes.ReferenceType | None = Field( default=None, alias="contract", title="Contract details", description="The contract resource which may provide more detailed information.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Contract"], }, ) coverage: fhirtypes.ReferenceType | None = Field( default=None, alias="coverage", title="Updated Coverage details", description="A suite of updated or additional Coverages from the Insurer.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EligibilityResponseInsurance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "coverage", "contract", "benefitBalance", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EligibilityResponseInsurance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EligibilityResponseInsuranceBenefitBalance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Benefits by Category. Benefits and optionally current balances by Category. """ __resource_type__ = "EligibilityResponseInsuranceBenefitBalance" category: fhirtypes.CodeableConceptType = Field( default=..., alias="category", title="Type of services covered", description="Dental, Vision, Medical, Pharmacy, Rehab etc.", json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Description of the benefit or services covered", description=( "A richer description of the benefit, for example 'DENT2 covers 100% of" " basic, 50% of major but exclused Ortho, Implants and Costmetic " "services'." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) excluded: bool | None = Field( default=None, alias="excluded", title="Excluded from the plan", description=( "True if the indicated class of service is excluded from the plan, " "missing or False indicated the service is included in the coverage." ), json_schema_extra={ "element_property": True, }, ) excluded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_excluded", title="Extension field for ``excluded``." ) financial: typing.List[ fhirtypes.EligibilityResponseInsuranceBenefitBalanceFinancialType ] | None = Field( default=None, alias="financial", title="Benefit Summary", description="Benefits Used to date.", json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Short name for the benefit", description="A short name or tag for the benefit, for example MED01, or DENT2.", json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) network: fhirtypes.CodeableConceptType | None = Field( default=None, alias="network", title="In or out of network", description="Network designation.", json_schema_extra={ "element_property": True, }, ) subCategory: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subCategory", title="Detailed services covered within the type", description="Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.", json_schema_extra={ "element_property": True, }, ) term: fhirtypes.CodeableConceptType | None = Field( default=None, alias="term", title="Annual or lifetime", description=( "The term or period of the values such as 'maximum lifetime benefit' or" " 'maximum annual vistis'." ), json_schema_extra={ "element_property": True, }, ) unit: fhirtypes.CodeableConceptType | None = Field( default=None, alias="unit", title="Individual or family", description="Unit designation: individual or family.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EligibilityResponseInsuranceBenefitBalance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "category", "subCategory", "excluded", "name", "description", "network", "unit", "term", "financial", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EligibilityResponseInsuranceBenefitBalance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EligibilityResponseInsuranceBenefitBalanceFinancial( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Benefit Summary. Benefits Used to date. """ __resource_type__ = "EligibilityResponseInsuranceBenefitBalanceFinancial" allowedMoney: fhirtypes.MoneyType | None = Field( default=None, alias="allowedMoney", title="Benefits allowed", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e allowed[x] "one_of_many": "allowed", "one_of_many_required": False, }, ) allowedString: fhirtypes.StringType | None = Field( default=None, alias="allowedString", title="Benefits allowed", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e allowed[x] "one_of_many": "allowed", "one_of_many_required": False, }, ) allowedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allowedString", title="Extension field for ``allowedString``.", ) allowedUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="allowedUnsignedInt", title="Benefits allowed", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e allowed[x] "one_of_many": "allowed", "one_of_many_required": False, }, ) allowedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allowedUnsignedInt", title="Extension field for ``allowedUnsignedInt``.", ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Deductable, visits, benefit amount", description=None, json_schema_extra={ "element_property": True, }, ) usedMoney: fhirtypes.MoneyType | None = Field( default=None, alias="usedMoney", title="Benefits used", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e used[x] "one_of_many": "used", "one_of_many_required": False, }, ) usedUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="usedUnsignedInt", title="Benefits used", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e used[x] "one_of_many": "used", "one_of_many_required": False, }, ) usedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usedUnsignedInt", title="Extension field for ``usedUnsignedInt``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EligibilityResponseInsuranceBenefitBalanceFinancial`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "allowedUnsignedInt", "allowedString", "allowedMoney", "usedUnsignedInt", "usedMoney", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EligibilityResponseInsuranceBenefitBalanceFinancial`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "allowed": ["allowedMoney", "allowedString", "allowedUnsignedInt"], "used": ["usedMoney", "usedUnsignedInt"], } return one_of_many_fields ================================================ FILE: fhir/resources/STU3/encounter.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Encounter Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Encounter(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An interaction during which services are provided to the patient. An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. """ __resource_type__ = "Encounter" account: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="account", title="The set of accounts that may be used for billing for this Encounter", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Account"], }, ) appointment: fhirtypes.ReferenceType | None = Field( default=None, alias="appointment", title="The appointment that scheduled this encounter", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Appointment"], }, ) classHistory: typing.List[fhirtypes.EncounterClassHistoryType] | None = Field( default=None, alias="classHistory", title="List of past encounter classes", description=( "The class history permits the tracking of the encounters transitions " "without needing to go through the resource history. This would be " "used for a case where an admission starts of as an emergency " "encounter, then transisions into an inpatient scenario. Doing this and" " not restarting a new encounter ensures that any lab/diagnostic " "results can more easily follow the patient and not require re-" "processing and not get lost or cancelled during a kindof discharge " "from emergency to inpatient." ), json_schema_extra={ "element_property": True, }, ) class_fhir: fhirtypes.CodingType | None = Field( default=None, alias="class", title="inpatient | outpatient | ambulatory | emergency +", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) diagnosis: typing.List[fhirtypes.EncounterDiagnosisType] | None = Field( default=None, alias="diagnosis", title="The list of diagnosis relevant to this encounter", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) episodeOfCare: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="episodeOfCare", title="Episode(s) of care that this encounter should be recorded against", description=( "Where a specific encounter should be classified as a part of a " "specific episode(s) of care this field should be used. This " "association can facilitate grouping of related encounters together for" " a specific purpose, such as government reporting, issue tracking, " "association via a common problem. The association is recorded on the " "encounter as these are typically created after the episode of care, " "and grouped on entry rather than editing the episode of care to append" " another encounter to it (the episode of care could span years)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["EpisodeOfCare"], }, ) hospitalization: fhirtypes.EncounterHospitalizationType | None = Field( default=None, alias="hospitalization", title="Details about the admission to a healthcare service", description=None, json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifier(s) by which this encounter is known", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) incomingReferral: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="incomingReferral", title="The ReferralRequest that initiated this encounter", description="The referral request this encounter satisfies (incoming referral).", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ReferralRequest"], }, ) length: fhirtypes.DurationType | None = Field( default=None, alias="length", title="Quantity of time the encounter lasted (less time absent)", description=( "Quantity of time the encounter lasted. This excludes the time during " "leaves of absence." ), json_schema_extra={ "element_property": True, }, ) location: typing.List[fhirtypes.EncounterLocationType] | None = Field( default=None, alias="location", title="List of locations where the patient has been", description="List of locations where the patient has been during this encounter.", json_schema_extra={ "element_property": True, }, ) partOf: fhirtypes.ReferenceType | None = Field( default=None, alias="partOf", title="Another Encounter this encounter is part of", description=( "Another Encounter of which this encounter is a part of " "(administratively or in time)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) participant: typing.List[fhirtypes.EncounterParticipantType] | None = Field( default=None, alias="participant", title="List of participants involved in the encounter", description="The\u00a0list of\u00a0people\u00a0responsible for providing the service.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="The start and end time of the encounter", description=None, json_schema_extra={ "element_property": True, }, ) priority: fhirtypes.CodeableConceptType | None = Field( default=None, alias="priority", title="Indicates the urgency of the encounter", description=None, json_schema_extra={ "element_property": True, }, ) reason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reason", title="Reason the encounter takes place (code)", description=( "Reason the encounter takes place, expressed as a code. For admissions," " this can be used for a coded admission diagnosis." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) serviceProvider: fhirtypes.ReferenceType | None = Field( default=None, alias="serviceProvider", title="The custodian organization of this Encounter record", description=( "An organization that is in charge of maintaining the information of " "this Encounter (e.g. who maintains the report or the master service " "catalog item, etc.). This MAY be the same as the organization on the " "Patient record, however it could be different. This MAY not be not the" " Service Delivery Location's Organization." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "planned | arrived | triaged | in-progress | onleave | finished | " "cancelled +" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "planned", "arrived", "triaged", "in-progress", "onleave", "finished", "cancelled", "+", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusHistory: typing.List[fhirtypes.EncounterStatusHistoryType] | None = Field( default=None, alias="statusHistory", title="List of past encounter statuses", description=( "The status history permits the encounter resource to contain the " "status history without needing to read through the historical versions" " of the resource, or even have the server store them." ), json_schema_extra={ "element_property": True, }, ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="The patient ro group present at the encounter", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Specific type of encounter", description=( "Specific type of encounter (e.g. e-mail consultation, surgical day-" "care, skilled nursing, rehabilitation)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Encounter`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "statusHistory", "class", "classHistory", "type", "priority", "subject", "episodeOfCare", "incomingReferral", "participant", "appointment", "period", "length", "reason", "diagnosis", "account", "hospitalization", "location", "serviceProvider", "partOf", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Encounter`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "class", "type", "subject", "episodeOfCare", "participant", "appointment", "reason", "diagnosis", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class EncounterClassHistory(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. List of past encounter classes. The class history permits the tracking of the encounters transitions without needing to go through the resource history. This would be used for a case where an admission starts of as an emergency encounter, then transisions into an inpatient scenario. Doing this and not restarting a new encounter ensures that any lab/diagnostic results can more easily follow the patient and not require re-processing and not get lost or cancelled during a kindof discharge from emergency to inpatient. """ __resource_type__ = "EncounterClassHistory" class_fhir: fhirtypes.CodingType = Field( default=..., alias="class", title="inpatient | outpatient | ambulatory | emergency +", description=None, json_schema_extra={ "element_property": True, }, ) period: fhirtypes.PeriodType = Field( default=..., alias="period", title="The time that the episode was in the specified class", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EncounterClassHistory`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "class", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EncounterClassHistory`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EncounterDiagnosis(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The list of diagnosis relevant to this encounter. """ __resource_type__ = "EncounterDiagnosis" condition: fhirtypes.ReferenceType = Field( default=..., alias="condition", title="Reason the encounter takes place (resource)", description=( "Reason the encounter takes place, as specified using information from " "another resource. For admissions, this is the admission diagnosis. The" " indication will typically be a Condition (with other resources " "referenced in the evidence.detail), or a Procedure." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "Procedure"], }, ) rank: fhirtypes.PositiveIntType | None = Field( default=None, alias="rank", title="Ranking of the diagnosis (for each role type)", description=None, json_schema_extra={ "element_property": True, }, ) rank__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rank", title="Extension field for ``rank``." ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title=( "Role that this diagnosis has within the encounter (e.g. admission, " "billing, discharge \u2026)" ), description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EncounterDiagnosis`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "condition", "role", "rank"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EncounterDiagnosis`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EncounterHospitalization(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details about the admission to a healthcare service. """ __resource_type__ = "EncounterHospitalization" admitSource: fhirtypes.CodeableConceptType | None = Field( default=None, alias="admitSource", title="From where patient was admitted (physician referral, transfer)", description=None, json_schema_extra={ "element_property": True, }, ) destination: fhirtypes.ReferenceType | None = Field( default=None, alias="destination", title="Location to which the patient is discharged", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) dietPreference: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="dietPreference", title="Diet preferences reported by the patient", description=None, json_schema_extra={ "element_property": True, }, ) dischargeDisposition: fhirtypes.CodeableConceptType | None = Field( default=None, alias="dischargeDisposition", title="Category or kind of location after discharge", description=None, json_schema_extra={ "element_property": True, }, ) origin: fhirtypes.ReferenceType | None = Field( default=None, alias="origin", title="The location from which the patient came before admission", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) preAdmissionIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="preAdmissionIdentifier", title="Pre-admission identifier", description=None, json_schema_extra={ "element_property": True, }, ) reAdmission: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reAdmission", title=( "The type of hospital re-admission that has occurred (if any). If the " "value is absent, then this is not identified as a readmission" ), description="Whether this hospitalization is a readmission and why if known.", json_schema_extra={ "element_property": True, }, ) specialArrangement: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialArrangement", title="Wheelchair, translator, stretcher, etc.", description=( "Any special requests that have been made for this hospitalization " "encounter, such as the provision of specific equipment or other " "things." ), json_schema_extra={ "element_property": True, }, ) specialCourtesy: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialCourtesy", title="Special courtesies (VIP, board member)", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EncounterHospitalization`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "preAdmissionIdentifier", "origin", "admitSource", "reAdmission", "dietPreference", "specialCourtesy", "specialArrangement", "destination", "dischargeDisposition", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EncounterHospitalization`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EncounterLocation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. List of locations where the patient has been. List of locations where the patient has been during this encounter. """ __resource_type__ = "EncounterLocation" location: fhirtypes.ReferenceType = Field( default=..., alias="location", title="Location the encounter takes place", description="The location where the encounter takes place.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period during which the patient was present at the location", description=None, json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="planned | active | reserved | completed", description=( "The status of the participants' presence at the specified location " "during the period specified. If the participant is is no longer at the" " location, then the period will have an end date/time." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["planned", "active", "reserved", "completed"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EncounterLocation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "location", "status", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EncounterLocation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EncounterParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. List of participants involved in the encounter. The list of people responsible for providing the service. """ __resource_type__ = "EncounterParticipant" individual: fhirtypes.ReferenceType | None = Field( default=None, alias="individual", title="Persons involved in the encounter other than the patient", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "RelatedPerson"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Period of time during the encounter that the participant participated", description=( "The period of time that the specified participant participated in the " "encounter. These can overlap or be sub-sets of the overall encounter's" " period." ), json_schema_extra={ "element_property": True, }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Role of participant in encounter", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EncounterParticipant`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "period", "individual"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EncounterParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "individual"] class EncounterStatusHistory(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. List of past encounter statuses. The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them. """ __resource_type__ = "EncounterStatusHistory" period: fhirtypes.PeriodType = Field( default=..., alias="period", title="The time that the episode was in the specified status", description=None, json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "planned | arrived | triaged | in-progress | onleave | finished | " "cancelled +" ), description=None, json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "planned", "arrived", "triaged", "in-progress", "onleave", "finished", "cancelled", "+", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EncounterStatusHistory`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "status", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EncounterStatusHistory`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/endpoint.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Endpoint Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class Endpoint(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The technical details of an endpoint that can be used for electronic services. The technical details of an endpoint that can be used for electronic services, such as for web services providing XDS.b or a REST endpoint for another FHIR server. This may include any security context information. """ __resource_type__ = "Endpoint" address: fhirtypes.UriType | None = Field( default=None, alias="address", title="The technical base address for connecting to this endpoint", description="The uri that describes the actual end-point to connect to.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) address__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_address", title="Extension field for ``address``." ) connectionType: fhirtypes.CodingType = Field( default=..., alias="connectionType", title="Protocol/Profile/Standard to be used with this endpoint connection", description=( "A coded value that represents the technical details of the usage of " "this endpoint, such as what WSDLs should be used in what way. (e.g. " "XDS.b/DICOM/cds-hook)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="contact", title="Contact details for source (e.g. troubleshooting)", description=( "Contact details for a human to contact about the subscription. The " "primary use of this for system administrator troubleshooting." ), json_schema_extra={ "element_property": True, }, ) header: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="header", title="Usage depends on the channel type", description="Additional headers / information to send as part of the notification.", json_schema_extra={ "element_property": True, }, ) header__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_header", title="Extension field for ``header``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifies this endpoint across multiple systems", description=( "Identifier for the organization that is used to identify the endpoint " "across multiple disparate systems." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) managingOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="managingOrganization", title=( "Organization that manages this endpoint (may not be the organization " "that exposes the endpoint)" ), description=( "The organization that manages this endpoint (even if technically " "another organisation is hosting this in the cloud, it is the " "organisation associated with the data)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="A name that this endpoint can be identified by", description="A friendly name that this endpoint can be referred to with.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) payloadMimeType: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="payloadMimeType", title=( "Mimetype to send. If not specified, the content could be anything " "(including no payload, if the connectionType defined this)" ), description=( "The mime type to send the payload in - e.g. application/fhir+xml, " "application/fhir+json. If the mime type is not specified, then the " "sender could send any content (including no content depending on the " "connectionType)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) payloadMimeType__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_payloadMimeType", title="Extension field for ``payloadMimeType``.", ) payloadType: typing.List[fhirtypes.CodeableConceptType] = Field( default=..., alias="payloadType", title=( "The type of content that may be used at this endpoint (e.g. XDS " "Discharge summaries)" ), description=( "The payload type describes the acceptable content that can be " "communicated on the endpoint." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Interval the endpoint is expected to be operational", description="The interval during which the endpoint is expected to be operational.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | suspended | error | off | entered-in-error | test", description="active | suspended | error | off | test.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "active", "suspended", "error", "off", "entered-in-error", "test", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Endpoint`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "connectionType", "name", "managingOrganization", "contact", "period", "payloadType", "payloadMimeType", "address", "header", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Endpoint`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "connectionType", "name", "managingOrganization", "period", "payloadType", "payloadMimeType", "address", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("address", "address__ext"), ("status", "status__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/enrollmentrequest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/EnrollmentRequest Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class EnrollmentRequest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Enrollment request. This resource provides the insurance enrollment details to the insurer regarding a specified coverage. """ __resource_type__ = "EnrollmentRequest" coverage: fhirtypes.ReferenceType | None = Field( default=None, alias="coverage", title="Insurance information", description="Reference to the program or plan identification, underwriter or payor.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage"], }, ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Creation date", description="The date when this resource was created.", json_schema_extra={ "element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier", description="The Response business identifier.", json_schema_extra={ "element_property": True, }, ) insurer: fhirtypes.ReferenceType | None = Field( default=None, alias="insurer", title="Target", description="The Insurer who is target of the request.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) organization: fhirtypes.ReferenceType | None = Field( default=None, alias="organization", title="Responsible organization", description=( "The organization which is responsible for the services rendered to the" " patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) provider: fhirtypes.ReferenceType | None = Field( default=None, alias="provider", title="Responsible practitioner", description=( "The practitioner who is responsible for the services rendered to the " "patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="The subject of the Products and Services", description="Patient Resource.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EnrollmentRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "created", "insurer", "provider", "organization", "subject", "coverage", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EnrollmentRequest`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "status"] ================================================ FILE: fhir/resources/STU3/enrollmentresponse.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/EnrollmentResponse Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class EnrollmentResponse(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. EnrollmentResponse resource. This resource provides enrollment and plan details from the processing of an Enrollment resource. """ __resource_type__ = "EnrollmentResponse" created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Creation date", description=( "The date when the enclosed suite of services were performed or " "completed." ), json_schema_extra={ "element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) disposition: fhirtypes.StringType | None = Field( default=None, alias="disposition", title="Disposition Message", description="A description of the status of the adjudication.", json_schema_extra={ "element_property": True, }, ) disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_disposition", title="Extension field for ``disposition``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier", description="The Response business identifier.", json_schema_extra={ "element_property": True, }, ) organization: fhirtypes.ReferenceType | None = Field( default=None, alias="organization", title="Insurer", description="The Insurer who produced this adjudicated response.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) outcome: fhirtypes.CodeableConceptType | None = Field( default=None, alias="outcome", title="complete | error | partial", description="Processing status: error, complete.", json_schema_extra={ "element_property": True, }, ) request: fhirtypes.ReferenceType | None = Field( default=None, alias="request", title="Claim reference", description="Original request resource reference.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["EnrollmentRequest"], }, ) requestOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="requestOrganization", title="Responsible organization", description=( "The organization which is responsible for the services rendered to the" " patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) requestProvider: fhirtypes.ReferenceType | None = Field( default=None, alias="requestProvider", title="Responsible practitioner", description=( "The practitioner who is responsible for the services rendered to the " "patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EnrollmentResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "request", "outcome", "disposition", "created", "organization", "requestProvider", "requestOrganization", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EnrollmentResponse`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "status"] ================================================ FILE: fhir/resources/STU3/episodeofcare.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/EpisodeOfCare Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class EpisodeOfCare(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An association of a Patient with an Organization and Healthcare Provider(s) for a period of time that the Organization assumes some level of responsibility. An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. """ __resource_type__ = "EpisodeOfCare" account: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="account", title=( "The set of accounts that may be used for billing for this " "EpisodeOfCare" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Account"], }, ) careManager: fhirtypes.ReferenceType | None = Field( default=None, alias="careManager", title="Care manager/care co-ordinator for the patient", description=( "The practitioner that is the care manager/care co-ordinator for this " "patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) diagnosis: typing.List[fhirtypes.EpisodeOfCareDiagnosisType] | None = Field( default=None, alias="diagnosis", title="The list of diagnosis relevant to this episode of care", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier(s) relevant for this EpisodeOfCare", description=( "The EpisodeOfCare may be known by different identifiers for different " "contexts of use, such as when an external agency is tracking the " "Episode for funding purposes." ), json_schema_extra={ "element_property": True, }, ) managingOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="managingOrganization", title="Organization that assumes care", description=( "The organization that has assumed the specific responsibilities for " "the specified duration." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="The patient who is the focus of this episode of care", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Interval during responsibility is assumed", description=( "The interval during which the managing organization assumes the " "defined responsibility." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) referralRequest: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="referralRequest", title="Originating Referral Request(s)", description=( "Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming" " referrals." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ReferralRequest"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "planned | waitlist | active | onhold | finished | cancelled | entered-" "in-error" ), description="planned | waitlist | active | onhold | finished | cancelled.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "planned", "waitlist", "active", "onhold", "finished", "cancelled", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusHistory: typing.List[fhirtypes.EpisodeOfCareStatusHistoryType] | None = Field( default=None, alias="statusHistory", title=( "Past list of status codes (the current status may be included to cover" " the start date of the status)" ), description=( "The history of statuses that the EpisodeOfCare has been through " "(without requiring processing the history of the resource)." ), json_schema_extra={ "element_property": True, }, ) team: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="team", title="Other practitioners facilitating this episode of care", description=( "The list of practitioners that may be facilitating this episode of " "care for specific purposes." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CareTeam"], }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Type/class - e.g. specialist referral, disease management", description=( "A classification of the type of episode of care; e.g. specialist " "referral, disease management, type of funded care." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EpisodeOfCare`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "statusHistory", "type", "diagnosis", "patient", "managingOrganization", "period", "referralRequest", "careManager", "team", "account", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EpisodeOfCare`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "status", "type", "diagnosis", "patient", "managingOrganization", "period", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class EpisodeOfCareDiagnosis(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The list of diagnosis relevant to this episode of care. """ __resource_type__ = "EpisodeOfCareDiagnosis" condition: fhirtypes.ReferenceType = Field( default=..., alias="condition", title="Conditions/problems/diagnoses this episode of care is for", description=( "A list of conditions/problems/diagnoses that this episode of care is " "intended to be providing care for." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) rank: fhirtypes.PositiveIntType | None = Field( default=None, alias="rank", title="Ranking of the diagnosis (for each role type)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) rank__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rank", title="Extension field for ``rank``." ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title=( "Role that this diagnosis has within the episode of care (e.g. " "admission, billing, discharge \u2026)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EpisodeOfCareDiagnosis`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "condition", "role", "rank"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EpisodeOfCareDiagnosis`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "condition", "role", "rank"] class EpisodeOfCareStatusHistory(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Past list of status codes (the current status may be included to cover the start date of the status). The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource). """ __resource_type__ = "EpisodeOfCareStatusHistory" period: fhirtypes.PeriodType = Field( default=..., alias="period", title="Duration the EpisodeOfCare was in the specified status", description="The period during this EpisodeOfCare that the specific status applied.", json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "planned | waitlist | active | onhold | finished | cancelled | entered-" "in-error" ), description="planned | waitlist | active | onhold | finished | cancelled.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "planned", "waitlist", "active", "onhold", "finished", "cancelled", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EpisodeOfCareStatusHistory`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "status", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EpisodeOfCareStatusHistory`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/expansionprofile.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ExpansionProfile Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ExpansionProfile(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Defines behaviour and contraints on the ValueSet Expansion operation. Resource to define constraints on the Expansion of a FHIR ValueSet. """ __resource_type__ = "ExpansionProfile" activeOnly: bool | None = Field( default=None, alias="activeOnly", title="Include or exclude inactive concepts in the expansion", description=( "Controls whether inactive concepts are included or excluded in value " "set expansions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) activeOnly__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_activeOnly", title="Extension field for ``activeOnly``." ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date this was last changed", description=( "The date (and optionally time) when the expansion profile was " "published. The date must change if and when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the expansion profile " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the expansion profile", description=( "A free text natural language description of the expansion profile from" " a consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) designation: fhirtypes.ExpansionProfileDesignationType | None = Field( default=None, alias="designation", title="When the expansion profile imposes designation contraints", description=( "A set of criteria that provide the constraints imposed on the value " "set expansion by including or excluding designations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) displayLanguage: fhirtypes.CodeType | None = Field( default=None, alias="displayLanguage", title=( "Specify the language for the display element of codes in the value set" " expansion" ), description=( "Specifies the language to be used for description in the expansions " "i.e. the language to be used for ValueSet.expansion.contains.display." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) displayLanguage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_displayLanguage", title="Extension field for ``displayLanguage``.", ) excludeNested: bool | None = Field( default=None, alias="excludeNested", title="Nested codes in the expansion or not", description=( "Controls whether or not the value set expansion nests codes or not " "(i.e. ValueSet.expansion.contains.contains)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) excludeNested__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_excludeNested", title="Extension field for ``excludeNested``.", ) excludeNotForUI: bool | None = Field( default=None, alias="excludeNotForUI", title=( "Include or exclude codes which cannot be rendered in user interfaces " "in the value set expansion" ), description=( "Controls whether or not the value set expansion includes codes which " "cannot be displayed in user interfaces." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) excludeNotForUI__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_excludeNotForUI", title="Extension field for ``excludeNotForUI``.", ) excludePostCoordinated: bool | None = Field( default=None, alias="excludePostCoordinated", title=( "Include or exclude codes which are post coordinated expressions in the" " value set expansion" ), description=( "Controls whether or not the value set expansion includes post " "coordinated codes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) excludePostCoordinated__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_excludePostCoordinated", title="Extension field for ``excludePostCoordinated``.", ) excludedSystem: fhirtypes.ExpansionProfileExcludedSystemType | None = Field( default=None, alias="excludedSystem", title="Systems/Versions to be exclude", description=( "Code system, or a particular version of a code system to be excluded " "from value set expansions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A boolean value to indicate that this expansion profile is authored " "for testing purposes (or education/evaluation/marketing), and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) fixedVersion: typing.List[ fhirtypes.ExpansionProfileFixedVersionType ] | None = Field( default=None, alias="fixedVersion", title="Fix use of a code system to a particular version", description="Fix use of a particular code system to a particular version.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Additional identifier for the expansion profile", description=( "A formal identifier that is used to identify this expansion profile " "when it is represented in other formats, or referenced in a " "specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) includeDefinition: bool | None = Field( default=None, alias="includeDefinition", title="Include or exclude the value set definition in the expansion", description=( "Controls whether the value set definition is included or excluded in " "value set expansions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) includeDefinition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_includeDefinition", title="Extension field for ``includeDefinition``.", ) includeDesignations: bool | None = Field( default=None, alias="includeDesignations", title="Whether the expansion should include concept designations", description=( "Controls whether concept designations are to be included or excluded " "in value set expansions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) includeDesignations__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_includeDesignations", title="Extension field for ``includeDesignations``.", ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for expansion profile (if applicable)", description=( "A legal or geographic region in which the expansion profile is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) limitedExpansion: bool | None = Field( default=None, alias="limitedExpansion", title=( "Controls behaviour of the value set expand operation when value sets " "are too large to be completely expanded" ), description=( "If the value set being expanded is incomplete (because it is too big " "to expand), return a limited expansion (a subset) with an indicator " "that expansion is incomplete, using the extension " "[http://hl7.org/fhir/StructureDefinition/valueset-" "toocostly](extension-valueset-toocostly.html)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) limitedExpansion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_limitedExpansion", title="Extension field for ``limitedExpansion``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this expansion profile (computer friendly)", description=( "A natural language name identifying the expansion profile. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the individual or organization that published the " "expansion profile." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this expansion profile. Enables tracking the life-cycle " "of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Logical URI to reference this expansion profile (globally unique)", description=( "An absolute URI that is used to identify this expansion profile when " "it is referenced in a specification, model, design or an instance. " "This SHALL be a URL, SHOULD be globally unique, and SHOULD be an " "address at which this expansion profile is (or will be) published. The" " URL SHOULD include the major version of the expansion profile. For " "more information see [Technical and Business " "Versions](resource.html#versions)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Context the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching for appropriate expansion profile instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the expansion profile", description=( "The identifier that is used to identify this version of the expansion " "profile when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the expansion profile " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExpansionProfile`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "fixedVersion", "excludedSystem", "includeDesignations", "designation", "includeDefinition", "activeOnly", "excludeNested", "excludeNotForUI", "excludePostCoordinated", "displayLanguage", "limitedExpansion", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExpansionProfile`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "fixedVersion", "excludedSystem", "includeDesignations", "designation", "includeDefinition", "activeOnly", "excludeNested", "excludeNotForUI", "excludePostCoordinated", "displayLanguage", "limitedExpansion", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class ExpansionProfileDesignation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. When the expansion profile imposes designation contraints. A set of criteria that provide the constraints imposed on the value set expansion by including or excluding designations. """ __resource_type__ = "ExpansionProfileDesignation" exclude: fhirtypes.ExpansionProfileDesignationExcludeType | None = Field( default=None, alias="exclude", title="Designations to be excluded", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) include: fhirtypes.ExpansionProfileDesignationIncludeType | None = Field( default=None, alias="include", title="Designations to be included", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExpansionProfileDesignation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "include", "exclude"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExpansionProfileDesignation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "include", "exclude"] class ExpansionProfileDesignationExclude(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Designations to be excluded. """ __resource_type__ = "ExpansionProfileDesignationExclude" designation: typing.List[ fhirtypes.ExpansionProfileDesignationExcludeDesignationType ] | None = Field( default=None, alias="designation", title="The designation to be excluded", description="A data group for each designation to be excluded.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExpansionProfileDesignationExclude`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "designation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExpansionProfileDesignationExclude`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "designation"] class ExpansionProfileDesignationExcludeDesignation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The designation to be excluded. A data group for each designation to be excluded. """ __resource_type__ = "ExpansionProfileDesignationExcludeDesignation" language: fhirtypes.CodeType | None = Field( default=None, alias="language", title="Human language of the designation to be excluded", description="The language this designation is defined for.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) use: fhirtypes.CodingType | None = Field( default=None, alias="use", title="What kind of Designation to exclude", description="Which kinds of designation to exclude from the expansion.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExpansionProfileDesignationExcludeDesignation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "language", "use"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExpansionProfileDesignationExcludeDesignation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "language", "use"] class ExpansionProfileDesignationInclude(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Designations to be included. """ __resource_type__ = "ExpansionProfileDesignationInclude" designation: typing.List[ fhirtypes.ExpansionProfileDesignationIncludeDesignationType ] | None = Field( default=None, alias="designation", title="The designation to be included", description="A data group for each designation to be included.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExpansionProfileDesignationInclude`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "designation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExpansionProfileDesignationInclude`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "designation"] class ExpansionProfileDesignationIncludeDesignation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The designation to be included. A data group for each designation to be included. """ __resource_type__ = "ExpansionProfileDesignationIncludeDesignation" language: fhirtypes.CodeType | None = Field( default=None, alias="language", title="Human language of the designation to be included", description="The language this designation is defined for.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) use: fhirtypes.CodingType | None = Field( default=None, alias="use", title="What kind of Designation to include", description="Which kinds of designation to include in the expansion.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExpansionProfileDesignationIncludeDesignation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "language", "use"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExpansionProfileDesignationIncludeDesignation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "language", "use"] class ExpansionProfileExcludedSystem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Systems/Versions to be exclude. Code system, or a particular version of a code system to be excluded from value set expansions. """ __resource_type__ = "ExpansionProfileExcludedSystem" system: fhirtypes.UriType | None = Field( default=None, alias="system", title="The specific code system to be excluded", description="An absolute URI which is the code system to be excluded.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Specific version of the code system referred to", description=( "The version of the code system from which codes in the expansion " "should be excluded." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExpansionProfileExcludedSystem`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "system", "version"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExpansionProfileExcludedSystem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "system", "version"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("system", "system__ext")] return required_fields class ExpansionProfileFixedVersion(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Fix use of a code system to a particular version. Fix use of a particular code system to a particular version. """ __resource_type__ = "ExpansionProfileFixedVersion" mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="default | check | override", description=( "How to manage the intersection between a fixed version in a value set," " and this fixed version of the system in the expansion profile." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["default", "check", "override"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) system: fhirtypes.UriType | None = Field( default=None, alias="system", title="System to have its version fixed", description="The specific system for which to fix the version.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Specific version of the code system referred to", description=( "The version of the code system from which codes in the expansion " "should be included." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExpansionProfileFixedVersion`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "system", "version", "mode"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExpansionProfileFixedVersion`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "system", "version", "mode"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("mode", "mode__ext"), ("system", "system__ext"), ("version", "version__ext"), ] return required_fields ================================================ FILE: fhir/resources/STU3/explanationofbenefit.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ExplanationOfBenefit Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ExplanationOfBenefit(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Explanation of Benefit resource. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. """ __resource_type__ = "ExplanationOfBenefit" accident: fhirtypes.ExplanationOfBenefitAccidentType | None = Field( default=None, alias="accident", title="Details of an accident", description="An accident which resulted in the need for healthcare services.", json_schema_extra={ "element_property": True, }, ) addItem: typing.List[fhirtypes.ExplanationOfBenefitAddItemType] | None = Field( default=None, alias="addItem", title="Insurer added line items", description="The first tier service adjudications for payor added services.", json_schema_extra={ "element_property": True, }, ) benefitBalance: typing.List[ fhirtypes.ExplanationOfBenefitBenefitBalanceType ] | None = Field( default=None, alias="benefitBalance", title="Balance by Benefit Category", description=None, json_schema_extra={ "element_property": True, }, ) billablePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="billablePeriod", title="Period for charge submission", description="The billable period for which charges are being submitted.", json_schema_extra={ "element_property": True, }, ) careTeam: typing.List[fhirtypes.ExplanationOfBenefitCareTeamType] | None = Field( default=None, alias="careTeam", title="Care Team members", description=( "The members of the team who provided the overall service as well as " "their role and whether responsible and qualifications." ), json_schema_extra={ "element_property": True, }, ) claim: fhirtypes.ReferenceType | None = Field( default=None, alias="claim", title="Claim reference", description=( "The business identifier for the instance: invoice number, claim " "number, pre-determination or pre-authorization number." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Claim"], }, ) claimResponse: fhirtypes.ReferenceType | None = Field( default=None, alias="claimResponse", title="Claim response reference", description=( "The business identifier for the instance: invoice number, claim " "number, pre-determination or pre-authorization number." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ClaimResponse"], }, ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Creation date", description="The date when the EOB was created.", json_schema_extra={ "element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) diagnosis: typing.List[fhirtypes.ExplanationOfBenefitDiagnosisType] | None = Field( default=None, alias="diagnosis", title="List of Diagnosis", description="Ordered list of patient diagnosis for which care is sought.", json_schema_extra={ "element_property": True, }, ) disposition: fhirtypes.StringType | None = Field( default=None, alias="disposition", title="Disposition Message", description="A description of the status of the adjudication.", json_schema_extra={ "element_property": True, }, ) disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_disposition", title="Extension field for ``disposition``." ) employmentImpacted: fhirtypes.PeriodType | None = Field( default=None, alias="employmentImpacted", title="Period unable to work", description=( "The start and optional end dates of when the patient was precluded " "from working due to the treatable condition(s)." ), json_schema_extra={ "element_property": True, }, ) enterer: fhirtypes.ReferenceType | None = Field( default=None, alias="enterer", title="Author", description="The person who created the explanation of benefit.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) facility: fhirtypes.ReferenceType | None = Field( default=None, alias="facility", title="Servicing Facility", description="Facility where the services were provided.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) form: fhirtypes.CodeableConceptType | None = Field( default=None, alias="form", title="Printed Form Identifier", description="The form to be used for printing the content.", json_schema_extra={ "element_property": True, }, ) hospitalization: fhirtypes.PeriodType | None = Field( default=None, alias="hospitalization", title="Period in hospital", description=( "The start and optional end dates of when the patient was confined to a" " treatment center." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier", description="The EOB Business Identifier.", json_schema_extra={ "element_property": True, }, ) information: typing.List[ fhirtypes.ExplanationOfBenefitInformationType ] | None = Field( default=None, alias="information", title=( "Exceptions, special considerations, the condition, situation, prior or" " concurrent issues" ), description=( "Additional information codes regarding exceptions, special " "considerations, the condition, situation, prior or concurrent issues. " "Often there are mutiple jurisdiction specific valuesets which are " "required." ), json_schema_extra={ "element_property": True, }, ) insurance: fhirtypes.ExplanationOfBenefitInsuranceType | None = Field( default=None, alias="insurance", title="Insurance or medical plan", description="Financial instrument by which payment information for health care.", json_schema_extra={ "element_property": True, }, ) insurer: fhirtypes.ReferenceType | None = Field( default=None, alias="insurer", title="Insurer responsible for the EOB", description="The insurer which is responsible for the explanation of benefit.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) item: typing.List[fhirtypes.ExplanationOfBenefitItemType] | None = Field( default=None, alias="item", title="Goods and Services", description="First tier of goods and services.", json_schema_extra={ "element_property": True, }, ) organization: fhirtypes.ReferenceType | None = Field( default=None, alias="organization", title="Responsible organization for the claim", description="The provider which is responsible for the claim.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) originalPrescription: fhirtypes.ReferenceType | None = Field( default=None, alias="originalPrescription", title="Original prescription if superceded by fulfiller", description=( "Original prescription which has been superceded by this prescription " "to support the dispensing of pharmacy services, medications or " "products. For example, a physician may prescribe a medication which " "the pharmacy determines is contraindicated, or for which the patient " "has an intolerance, and therefor issues a new precription for an " "alternate medication which has the same theraputic intent. The " "prescription from the pharmacy becomes the 'prescription' and that " "from the physician becomes the 'original prescription'." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicationRequest"], }, ) outcome: fhirtypes.CodeableConceptType | None = Field( default=None, alias="outcome", title="complete | error | partial", description="Processing outcome errror, partial or complete processing.", json_schema_extra={ "element_property": True, }, ) patient: fhirtypes.ReferenceType | None = Field( default=None, alias="patient", title="The subject of the Products and Services", description="Patient Resource.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) payee: fhirtypes.ExplanationOfBenefitPayeeType | None = Field( default=None, alias="payee", title="Party to be paid any benefits payable", description="The party to be reimbursed for the services.", json_schema_extra={ "element_property": True, }, ) payment: fhirtypes.ExplanationOfBenefitPaymentType | None = Field( default=None, alias="payment", title="Payment (if paid)", description="Payment details for the claim if the claim has been paid.", json_schema_extra={ "element_property": True, }, ) precedence: fhirtypes.PositiveIntType | None = Field( default=None, alias="precedence", title="Precedence (primary, secondary, etc.)", description=None, json_schema_extra={ "element_property": True, }, ) precedence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_precedence", title="Extension field for ``precedence``." ) prescription: fhirtypes.ReferenceType | None = Field( default=None, alias="prescription", title="Prescription authorizing services or products", description="Prescription to support the dispensing of Pharmacy or Vision products.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicationRequest", "VisionPrescription"], }, ) procedure: typing.List[fhirtypes.ExplanationOfBenefitProcedureType] | None = Field( default=None, alias="procedure", title="Procedures performed", description=( "Ordered list of patient procedures performed to support the " "adjudication." ), json_schema_extra={ "element_property": True, }, ) processNote: typing.List[ fhirtypes.ExplanationOfBenefitProcessNoteType ] | None = Field( default=None, alias="processNote", title="Processing notes", description="Note text.", json_schema_extra={ "element_property": True, }, ) provider: fhirtypes.ReferenceType | None = Field( default=None, alias="provider", title="Responsible provider for the claim", description="The provider which is responsible for the claim.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) referral: fhirtypes.ReferenceType | None = Field( default=None, alias="referral", title="Treatment Referral", description=( "The referral resource which lists the date, practitioner, reason and " "other supporting information." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ReferralRequest"], }, ) related: typing.List[fhirtypes.ExplanationOfBenefitRelatedType] | None = Field( default=None, alias="related", title="Related Claims which may be revelant to processing this claim", description=( "Other claims which are related to this claim such as prior claim " "versions or for related services." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="subType", title="Finer grained claim type information", description=( "A finer grained suite of claim subtype codes which may convey " "Inpatient vs Outpatient and/or a specialty service. In the US the " "BillType." ), json_schema_extra={ "element_property": True, }, ) totalBenefit: fhirtypes.MoneyType | None = Field( default=None, alias="totalBenefit", title="Total benefit payable for the Claim", description=( "Total amount of benefit payable (Equal to sum of the Benefit amounts " "from all detail lines and additions less the Unallocated Deductable)." ), json_schema_extra={ "element_property": True, }, ) totalCost: fhirtypes.MoneyType | None = Field( default=None, alias="totalCost", title="Total Cost of service from the Claim", description="The total cost of the services reported.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Type or discipline", description=( "The category of claim, eg, oral, pharmacy, vision, insitutional, " "professional." ), json_schema_extra={ "element_property": True, }, ) unallocDeductable: fhirtypes.MoneyType | None = Field( default=None, alias="unallocDeductable", title="Unallocated deductable", description=( "The amount of deductable applied which was not allocated to any " "particular service line." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefit`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "type", "subType", "patient", "billablePeriod", "created", "enterer", "insurer", "provider", "organization", "referral", "facility", "claim", "claimResponse", "outcome", "disposition", "related", "prescription", "originalPrescription", "payee", "information", "careTeam", "diagnosis", "procedure", "precedence", "insurance", "accident", "employmentImpacted", "hospitalization", "item", "addItem", "totalCost", "unallocDeductable", "totalBenefit", "payment", "form", "processNote", "benefitBalance", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefit`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "status"] class ExplanationOfBenefitAccident(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details of an accident. An accident which resulted in the need for healthcare services. """ __resource_type__ = "ExplanationOfBenefitAccident" date: fhirtypes.DateType | None = Field( default=None, alias="date", title="When the accident occurred", description="Date of an accident which these services are addressing.", json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) locationAddress: fhirtypes.AddressType | None = Field( default=None, alias="locationAddress", title="Accident Place", description="Where the accident occurred.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="locationReference", title="Accident Place", description="Where the accident occurred.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The nature of the accident", description="Type of accident: work, auto, etc.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitAccident`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "date", "type", "locationAddress", "locationReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitAccident`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"location": ["locationAddress", "locationReference"]} return one_of_many_fields class ExplanationOfBenefitAddItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Insurer added line items. The first tier service adjudications for payor added services. """ __resource_type__ = "ExplanationOfBenefitAddItem" adjudication: typing.List[ fhirtypes.ExplanationOfBenefitItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Added items adjudication", description="The adjudications results.", json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Type of service or product", description=( "Health Care Service Type Codes to identify the classification of " "service or benefits." ), json_schema_extra={ "element_property": True, }, ) detail: typing.List[fhirtypes.ExplanationOfBenefitAddItemDetailType] | None = Field( default=None, alias="detail", title="Added items details", description="The second tier service adjudications for payor added services.", json_schema_extra={ "element_property": True, }, ) fee: fhirtypes.MoneyType | None = Field( default=None, alias="fee", title="Professional fee or Product charge", description="The fee charged for the professional service or product.", json_schema_extra={ "element_property": True, }, ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes, eg for Oral whether the " "treatment is cosmetic or associated with TMJ, or for medical whether " "the treatment was outside the clinic or out of office hours." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="List of note numbers which apply", description="A list of note references to the notes provided below.", json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of reveneu or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) sequenceLinkId: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="sequenceLinkId", title="Service instances", description=( "List of input service items which this service line is intended to " "replace." ), json_schema_extra={ "element_property": True, }, ) sequenceLinkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_sequenceLinkId", title="Extension field for ``sequenceLinkId``.", ) service: fhirtypes.CodeableConceptType | None = Field( default=None, alias="service", title="Billing Code", description=( "If this is an actual service or product line, ie. not a Group, then " "use code to indicate the Professional Service or Product supplied (eg." " CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then " "use a group code to indicate the type of thing being grouped eg. " "'glasses' or 'compound'." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitAddItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequenceLinkId", "revenue", "category", "service", "modifier", "fee", "noteNumber", "adjudication", "detail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitAddItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitAddItemDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Added items details. The second tier service adjudications for payor added services. """ __resource_type__ = "ExplanationOfBenefitAddItemDetail" adjudication: typing.List[ fhirtypes.ExplanationOfBenefitItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Added items detail adjudication", description="The adjudications results.", json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Type of service or product", description=( "Health Care Service Type Codes to identify the classification of " "service or benefits." ), json_schema_extra={ "element_property": True, }, ) fee: fhirtypes.MoneyType | None = Field( default=None, alias="fee", title="Professional fee or Product charge", description="The fee charged for the professional service or product.", json_schema_extra={ "element_property": True, }, ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes, eg for Oral whether the " "treatment is cosmetic or associated with TMJ, or for medical whether " "the treatment was outside the clinic or out of office hours." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="List of note numbers which apply", description="A list of note references to the notes provided below.", json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of reveneu or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) service: fhirtypes.CodeableConceptType | None = Field( default=None, alias="service", title="Billing Code", description=( "A code to indicate the Professional Service or Product supplied (eg. " "CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitAddItemDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "revenue", "category", "service", "modifier", "fee", "noteNumber", "adjudication", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitAddItemDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitBenefitBalance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Balance by Benefit Category. """ __resource_type__ = "ExplanationOfBenefitBenefitBalance" category: fhirtypes.CodeableConceptType = Field( default=..., alias="category", title="Type of services covered", description="Dental, Vision, Medical, Pharmacy, Rehab etc.", json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Description of the benefit or services covered", description=( "A richer description of the benefit, for example 'DENT2 covers 100% of" " basic, 50% of major but exclused Ortho, Implants and Costmetic " "services'." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) excluded: bool | None = Field( default=None, alias="excluded", title="Excluded from the plan", description=( "True if the indicated class of service is excluded from the plan, " "missing or False indicated the service is included in the coverage." ), json_schema_extra={ "element_property": True, }, ) excluded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_excluded", title="Extension field for ``excluded``." ) financial: typing.List[ fhirtypes.ExplanationOfBenefitBenefitBalanceFinancialType ] | None = Field( default=None, alias="financial", title="Benefit Summary", description="Benefits Used to date.", json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Short name for the benefit", description="A short name or tag for the benefit, for example MED01, or DENT2.", json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) network: fhirtypes.CodeableConceptType | None = Field( default=None, alias="network", title="In or out of network", description="Network designation.", json_schema_extra={ "element_property": True, }, ) subCategory: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subCategory", title="Detailed services covered within the type", description="Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.", json_schema_extra={ "element_property": True, }, ) term: fhirtypes.CodeableConceptType | None = Field( default=None, alias="term", title="Annual or lifetime", description=( "The term or period of the values such as 'maximum lifetime benefit' or" " 'maximum annual vistis'." ), json_schema_extra={ "element_property": True, }, ) unit: fhirtypes.CodeableConceptType | None = Field( default=None, alias="unit", title="Individual or family", description="Unit designation: individual or family.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitBenefitBalance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "category", "subCategory", "excluded", "name", "description", "network", "unit", "term", "financial", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitBenefitBalance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitBenefitBalanceFinancial(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Benefit Summary. Benefits Used to date. """ __resource_type__ = "ExplanationOfBenefitBenefitBalanceFinancial" allowedMoney: fhirtypes.MoneyType | None = Field( default=None, alias="allowedMoney", title="Benefits allowed", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e allowed[x] "one_of_many": "allowed", "one_of_many_required": False, }, ) allowedString: fhirtypes.StringType | None = Field( default=None, alias="allowedString", title="Benefits allowed", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e allowed[x] "one_of_many": "allowed", "one_of_many_required": False, }, ) allowedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allowedString", title="Extension field for ``allowedString``.", ) allowedUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="allowedUnsignedInt", title="Benefits allowed", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e allowed[x] "one_of_many": "allowed", "one_of_many_required": False, }, ) allowedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allowedUnsignedInt", title="Extension field for ``allowedUnsignedInt``.", ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Deductable, visits, benefit amount", description=None, json_schema_extra={ "element_property": True, }, ) usedMoney: fhirtypes.MoneyType | None = Field( default=None, alias="usedMoney", title="Benefits used", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e used[x] "one_of_many": "used", "one_of_many_required": False, }, ) usedUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="usedUnsignedInt", title="Benefits used", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e used[x] "one_of_many": "used", "one_of_many_required": False, }, ) usedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usedUnsignedInt", title="Extension field for ``usedUnsignedInt``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitBenefitBalanceFinancial`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "allowedUnsignedInt", "allowedString", "allowedMoney", "usedUnsignedInt", "usedMoney", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitBenefitBalanceFinancial`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "allowed": ["allowedMoney", "allowedString", "allowedUnsignedInt"], "used": ["usedMoney", "usedUnsignedInt"], } return one_of_many_fields class ExplanationOfBenefitCareTeam(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Care Team members. The members of the team who provided the overall service as well as their role and whether responsible and qualifications. """ __resource_type__ = "ExplanationOfBenefitCareTeam" provider: fhirtypes.ReferenceType = Field( default=..., alias="provider", title="Member of the Care Team", description="The members of the team who provided the overall service.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "Organization"], }, ) qualification: fhirtypes.CodeableConceptType | None = Field( default=None, alias="qualification", title="Type, classification or Specialization", description="The qualification which is applicable for this service.", json_schema_extra={ "element_property": True, }, ) responsible: bool | None = Field( default=None, alias="responsible", title="Billing practitioner", description=( "The practitioner who is billing and responsible for the claimed " "services rendered to the patient." ), json_schema_extra={ "element_property": True, }, ) responsible__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_responsible", title="Extension field for ``responsible``." ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="Role on the team", description=( "The lead, assisting or supervising practitioner and their discipline " "if a multidisiplinary team." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Number to covey order of careteam", description="Sequence of careteam which serves to order and provide a link.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitCareTeam`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "provider", "responsible", "role", "qualification", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitCareTeam`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields class ExplanationOfBenefitDiagnosis(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. List of Diagnosis. Ordered list of patient diagnosis for which care is sought. """ __resource_type__ = "ExplanationOfBenefitDiagnosis" diagnosisCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="diagnosisCodeableConcept", title="Patient's diagnosis", description="The diagnosis.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e diagnosis[x] "one_of_many": "diagnosis", "one_of_many_required": True, }, ) diagnosisReference: fhirtypes.ReferenceType | None = Field( default=None, alias="diagnosisReference", title="Patient's diagnosis", description="The diagnosis.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e diagnosis[x] "one_of_many": "diagnosis", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) packageCode: fhirtypes.CodeableConceptType | None = Field( default=None, alias="packageCode", title="Package billing code", description=( "The package billing code, for example DRG, based on the assigned " "grouping code system." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Number to covey order of diagnosis", description="Sequence of diagnosis which serves to provide a link.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Timing or nature of the diagnosis", description=( "The type of the Diagnosis, for example: admitting, primary, secondary," " discharge." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitDiagnosis`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "diagnosisCodeableConcept", "diagnosisReference", "type", "packageCode", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitDiagnosis`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "diagnosis": ["diagnosisCodeableConcept", "diagnosisReference"] } return one_of_many_fields class ExplanationOfBenefitInformation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Exceptions, special considerations, the condition, situation, prior or concurrent issues. Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues. Often there are mutiple jurisdiction specific valuesets which are required. """ __resource_type__ = "ExplanationOfBenefitInformation" category: fhirtypes.CodeableConceptType = Field( default=..., alias="category", title="General class of information", description=( "The general class of the information supplied: information; exception;" " accident, employment; onset, etc." ), json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Type of information", description=( "System and code pertaining to the specific information regarding " "special conditions relating to the setting, treatment or patient for " "which care is sought which may influence the adjudication." ), json_schema_extra={ "element_property": True, }, ) reason: fhirtypes.CodingType | None = Field( default=None, alias="reason", title="Reason associated with the information", description=( "For example, provides the reason for: the additional stay, or missing " "tooth or any other situation where a reason code is required in " "addition to the content." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Information instance identifier", description="Sequence of the information element which serves to provide a link.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) timingDate: fhirtypes.DateType | None = Field( default=None, alias="timingDate", title="When it occurred", description="The date when or period to which this information refers.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timingDate", title="Extension field for ``timingDate``." ) timingPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="timingPeriod", title="When it occurred", description="The date when or period to which this information refers.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Additional Data or supporting information", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Additional Data or supporting information", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Additional Data or supporting information", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Additional Data or supporting information", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitInformation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "category", "code", "timingDate", "timingPeriod", "valueString", "valueQuantity", "valueAttachment", "valueReference", "reason", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitInformation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "timing": ["timingDate", "timingPeriod"], "value": [ "valueAttachment", "valueQuantity", "valueReference", "valueString", ], } return one_of_many_fields class ExplanationOfBenefitInsurance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Insurance or medical plan. Financial instrument by which payment information for health care. """ __resource_type__ = "ExplanationOfBenefitInsurance" coverage: fhirtypes.ReferenceType | None = Field( default=None, alias="coverage", title="Insurance information", description="Reference to the program or plan identification, underwriter or payor.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage"], }, ) preAuthRef: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="preAuthRef", title="Pre-Authorization/Determination Reference", description="A list of references from the Insurer to which these services pertain.", json_schema_extra={ "element_property": True, }, ) preAuthRef__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_preAuthRef", title="Extension field for ``preAuthRef``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitInsurance`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "coverage", "preAuthRef"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitInsurance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Goods and Services. First tier of goods and services. """ __resource_type__ = "ExplanationOfBenefitItem" adjudication: typing.List[ fhirtypes.ExplanationOfBenefitItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Adjudication details", description="The adjudications results.", json_schema_extra={ "element_property": True, }, ) bodySite: fhirtypes.CodeableConceptType | None = Field( default=None, alias="bodySite", title="Service Location", description="Physical service site on the patient (limb, tooth, etc).", json_schema_extra={ "element_property": True, }, ) careTeamLinkId: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="careTeamLinkId", title="Applicable careteam members", description="Careteam applicable for this service or product line.", json_schema_extra={ "element_property": True, }, ) careTeamLinkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_careTeamLinkId", title="Extension field for ``careTeamLinkId``.", ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Type of service or product", description=( "Health Care Service Type Codes to identify the classification of " "service or benefits." ), json_schema_extra={ "element_property": True, }, ) detail: typing.List[fhirtypes.ExplanationOfBenefitItemDetailType] | None = Field( default=None, alias="detail", title="Additional items", description="Second tier of goods and services.", json_schema_extra={ "element_property": True, }, ) diagnosisLinkId: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="diagnosisLinkId", title="Applicable diagnoses", description="Diagnosis applicable for this service or product line.", json_schema_extra={ "element_property": True, }, ) diagnosisLinkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_diagnosisLinkId", title="Extension field for ``diagnosisLinkId``.", ) encounter: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="encounter", title="Encounters related to this billed item", description=( "A billed item may include goods or services provided in multiple " "encounters." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) informationLinkId: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="informationLinkId", title="Applicable exception and supporting information", description=( "Exceptions, special conditions and supporting information pplicable " "for this service or product line." ), json_schema_extra={ "element_property": True, }, ) informationLinkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_informationLinkId", title="Extension field for ``informationLinkId``.", ) locationAddress: fhirtypes.AddressType | None = Field( default=None, alias="locationAddress", title="Place of service", description="Where the service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="locationCodeableConcept", title="Place of service", description="Where the service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="locationReference", title="Place of service", description="Where the service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes, eg for Oral whether the " "treatment is cosmetic or associated with TMJ, or for medical whether " "the treatment was outside the clinic or out of office hours." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The quantity times the unit price for an addittional service or " "product or charge. For example, the formula: unit Quantity * unit " "Price (Cost per Point) * factor Number * points = net Amount. " "Quantity, factor and points are assumed to be 1 if not supplied." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="List of note numbers which apply", description="A list of note references to the notes provided below.", json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) procedureLinkId: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="procedureLinkId", title="Applicable procedures", description="Procedures applicable for this service or product line.", json_schema_extra={ "element_property": True, }, ) procedureLinkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_procedureLinkId", title="Extension field for ``procedureLinkId``.", ) programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="programCode", title="Program specific reason for item inclusion", description=( "For programs which require reson codes for the inclusion, covering, of" " this billed item under the program or sub-program." ), json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of Products or Services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of reveneu or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Service instance", description="A service line number.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) service: fhirtypes.CodeableConceptType | None = Field( default=None, alias="service", title="Billing Code", description=( "If this is an actual service or product line, ie. not a Group, then " "use code to indicate the Professional Service or Product supplied (eg." " CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then " "use a group code to indicate the type of thing being grouped eg. " "'glasses' or 'compound'." ), json_schema_extra={ "element_property": True, }, ) servicedDate: fhirtypes.DateType | None = Field( default=None, alias="servicedDate", title="Date or dates of Service", description=( "The date or dates when the enclosed suite of services were performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_servicedDate", title="Extension field for ``servicedDate``.", ) servicedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="servicedPeriod", title="Date or dates of Service", description=( "The date or dates when the enclosed suite of services were performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) subSite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="subSite", title="Service Sub-location", description="A region or surface of the site, eg. limb region or tooth surface(s).", json_schema_extra={ "element_property": True, }, ) udi: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="udi", title="Unique Device Identifier", description="List of Unique Device Identifiers associated with this line item.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per point", description=( "If the item is a node then this is the fee for the product or service," " otherwise this is the total of the fees for the children of the " "group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "careTeamLinkId", "diagnosisLinkId", "procedureLinkId", "informationLinkId", "revenue", "category", "service", "modifier", "programCode", "servicedDate", "servicedPeriod", "locationCodeableConcept", "locationAddress", "locationReference", "quantity", "unitPrice", "factor", "net", "udi", "bodySite", "subSite", "encounter", "noteNumber", "adjudication", "detail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "location": [ "locationAddress", "locationCodeableConcept", "locationReference", ], "serviced": ["servicedDate", "servicedPeriod"], } return one_of_many_fields class ExplanationOfBenefitItemAdjudication(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Adjudication details. The adjudications results. """ __resource_type__ = "ExplanationOfBenefitItemAdjudication" amount: fhirtypes.MoneyType | None = Field( default=None, alias="amount", title="Monetary amount", description="Monitory amount associated with the code.", json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType = Field( default=..., alias="category", title="Adjudication category such as co-pay, eligible, benefit, etc.", description="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", json_schema_extra={ "element_property": True, }, ) reason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reason", title="Explanation of Adjudication outcome", description="Adjudication reason such as limit reached.", json_schema_extra={ "element_property": True, }, ) value: fhirtypes.DecimalType | None = Field( default=None, alias="value", title="Non-monitory value", description=( "A non-monetary value for example a percentage. Mutually exclusive to " "the amount element above." ), json_schema_extra={ "element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitItemAdjudication`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "category", "reason", "amount", "value", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItemAdjudication`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitItemDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional items. Second tier of goods and services. """ __resource_type__ = "ExplanationOfBenefitItemDetail" adjudication: typing.List[ fhirtypes.ExplanationOfBenefitItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Detail level adjudication details", description="The adjudications results.", json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Type of service or product", description=( "Health Care Service Type Codes to identify the classification of " "service or benefits." ), json_schema_extra={ "element_property": True, }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes, eg for Oral whether the " "treatment is cosmetic or associated with TMJ, or for medical whether " "the treatment was outside the clinic or out of office hours." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total additional item cost", description=( "The quantity times the unit price for an addittional service or " "product or charge. For example, the formula: unit Quantity * unit " "Price (Cost per Point) * factor Number * points = net Amount. " "Quantity, factor and points are assumed to be 1 if not supplied." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="List of note numbers which apply", description="A list of note references to the notes provided below.", json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="programCode", title="Program specific reason for item inclusion", description=( "For programs which require reson codes for the inclusion, covering, of" " this billed item under the program or sub-program." ), json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of Products or Services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of reveneu or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Service instance", description="A service line number.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) service: fhirtypes.CodeableConceptType | None = Field( default=None, alias="service", title="Billing Code", description=( "If this is an actual service or product line, ie. not a Group, then " "use code to indicate the Professional Service or Product supplied (eg." " CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then " "use a group code to indicate the type of thing being grouped eg. " "'glasses' or 'compound'." ), json_schema_extra={ "element_property": True, }, ) subDetail: typing.List[ fhirtypes.ExplanationOfBenefitItemDetailSubDetailType ] | None = Field( default=None, alias="subDetail", title="Additional items", description="Third tier of goods and services.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Group or type of product or service", description="The type of product or service.", json_schema_extra={ "element_property": True, }, ) udi: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="udi", title="Unique Device Identifier", description="List of Unique Device Identifiers associated with this line item.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per point", description=( "If the item is a node then this is the fee for the product or service," " otherwise this is the total of the fees for the children of the " "group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitItemDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "type", "revenue", "category", "service", "modifier", "programCode", "quantity", "unitPrice", "factor", "net", "udi", "noteNumber", "adjudication", "subDetail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItemDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields class ExplanationOfBenefitItemDetailSubDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional items. Third tier of goods and services. """ __resource_type__ = "ExplanationOfBenefitItemDetailSubDetail" adjudication: typing.List[ fhirtypes.ExplanationOfBenefitItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Language if different from the resource", description="The adjudications results.", json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Type of service or product", description=( "Health Care Service Type Codes to identify the classification of " "service or benefits." ), json_schema_extra={ "element_property": True, }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes, eg for Oral whether the " "treatment is cosmetic or associated with TMJ, or for medical whether " "the treatment was outside the clinic or out of office hours." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Net additional item cost", description=( "The quantity times the unit price for an addittional service or " "product or charge. For example, the formula: unit Quantity * unit " "Price (Cost per Point) * factor Number * points = net Amount. " "Quantity, factor and points are assumed to be 1 if not supplied." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="List of note numbers which apply", description="A list of note references to the notes provided below.", json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="programCode", title="Program specific reason for item inclusion", description=( "For programs which require reson codes for the inclusion, covering, of" " this billed item under the program or sub-program." ), json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of Products or Services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of reveneu or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Service instance", description="A service line number.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) service: fhirtypes.CodeableConceptType | None = Field( default=None, alias="service", title="Billing Code", description=( "A code to indicate the Professional Service or Product supplied (eg. " "CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI)." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Type of product or service", description="The type of product or service.", json_schema_extra={ "element_property": True, }, ) udi: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="udi", title="Unique Device Identifier", description="List of Unique Device Identifiers associated with this line item.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per point", description="The fee for an addittional service or product or charge.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "type", "revenue", "category", "service", "modifier", "programCode", "quantity", "unitPrice", "factor", "net", "udi", "noteNumber", "adjudication", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields class ExplanationOfBenefitPayee(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Party to be paid any benefits payable. The party to be reimbursed for the services. """ __resource_type__ = "ExplanationOfBenefitPayee" party: fhirtypes.ReferenceType | None = Field( default=None, alias="party", title="Party to receive the payable", description="Party to be reimbursed: Subscriber, provider, other.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Organization", "Patient", "RelatedPerson", ], }, ) resourceType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="resourceType", title="organization | patient | practitioner | relatedperson", description=None, json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Type of party: Subscriber, Provider, other", description="Type of Party to be reimbursed: Subscriber, provider, other.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitPayee`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "resourceType", "party"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitPayee`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitPayment(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Payment (if paid). Payment details for the claim if the claim has been paid. """ __resource_type__ = "ExplanationOfBenefitPayment" adjustment: fhirtypes.MoneyType | None = Field( default=None, alias="adjustment", title="Payment adjustment for non-Claim issues", description=( "Adjustment to the payment of this transaction which is not related to " "adjudication of this transaction." ), json_schema_extra={ "element_property": True, }, ) adjustmentReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="adjustmentReason", title="Explanation for the non-claim adjustment", description="Reason for the payment adjustment.", json_schema_extra={ "element_property": True, }, ) amount: fhirtypes.MoneyType | None = Field( default=None, alias="amount", title="Payable amount after adjustment", description="Payable less any payment adjustment.", json_schema_extra={ "element_property": True, }, ) date: fhirtypes.DateType | None = Field( default=None, alias="date", title="Expected date of Payment", description="Estimated payment date.", json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Identifier of the payment instrument", description="Payment identifer.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Partial or Complete", description="Whether this represents partial or complete payment of the claim.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitPayment`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "adjustment", "adjustmentReason", "date", "amount", "identifier", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitPayment`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitProcedure(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Procedures performed. Ordered list of patient procedures performed to support the adjudication. """ __resource_type__ = "ExplanationOfBenefitProcedure" date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When the procedure was performed", description="Date and optionally time the procedure was performed .", json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) procedureCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="procedureCodeableConcept", title="Patient's list of procedures performed", description="The procedure code.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e procedure[x] "one_of_many": "procedure", "one_of_many_required": True, }, ) procedureReference: fhirtypes.ReferenceType | None = Field( default=None, alias="procedureReference", title="Patient's list of procedures performed", description="The procedure code.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e procedure[x] "one_of_many": "procedure", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Procedure"], }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Procedure sequence for reference", description="Sequence of procedures which serves to order and provide a link.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitProcedure`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "date", "procedureCodeableConcept", "procedureReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitProcedure`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "procedure": ["procedureCodeableConcept", "procedureReference"] } return one_of_many_fields class ExplanationOfBenefitProcessNote(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Processing notes. Note text. """ __resource_type__ = "ExplanationOfBenefitProcessNote" language: fhirtypes.CodeableConceptType | None = Field( default=None, alias="language", title="Language if different from the resource", description=( "The ISO-639-1 alpha 2 code in lower case for the language, optionally " "followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in" ' upper case; e.g. "en" for English, or "en-US" for American English ' 'versus "en-EN" for England English.' ), json_schema_extra={ "element_property": True, }, ) number: fhirtypes.PositiveIntType | None = Field( default=None, alias="number", title="Sequence number for this note", description=( "An integer associated with each note which may be referred to from " "each service line item." ), json_schema_extra={ "element_property": True, }, ) number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_number", title="Extension field for ``number``." ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Note explanitory text", description="The note text.", json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="display | print | printoper", description="The note purpose: Print/Display.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitProcessNote`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "number", "type", "text", "language", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitProcessNote`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitRelated(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Related Claims which may be revelant to processing this claim. Other claims which are related to this claim such as prior claim versions or for related services. """ __resource_type__ = "ExplanationOfBenefitRelated" claim: fhirtypes.ReferenceType | None = Field( default=None, alias="claim", title="Reference to the related claim", description=( "Other claims which are related to this claim such as prior claim " "versions or for related services." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Claim"], }, ) reference: fhirtypes.IdentifierType | None = Field( default=None, alias="reference", title="Related file or case reference", description=( "An alternate organizational reference to the case or file to which " "this particular claim pertains - eg Property/Casualy insurer claim # " "or Workers Compensation case # ." ), json_schema_extra={ "element_property": True, }, ) relationship: fhirtypes.CodeableConceptType | None = Field( default=None, alias="relationship", title="How the reference claim is related", description="For example prior or umbrella.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitRelated`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "claim", "relationship", "reference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitRelated`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/extension.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Extension Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Extension(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Optional Extensions Element. Optional Extension Element - found in all resources. """ __resource_type__ = "Extension" url: fhirtypes.UriType | None = Field( default=None, alias="url", title="identifies the meaning of the extension", description=( "Source of the definition for the extension code - a logical name or a " "URL." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) valueAddress: fhirtypes.AddressType | None = Field( default=None, alias="valueAddress", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueAge: fhirtypes.AgeType | None = Field( default=None, alias="valueAge", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="valueAnnotation", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="valueBase64Binary", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="valueContactPoint", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCount: fhirtypes.CountType | None = Field( default=None, alias="valueCount", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDistance: fhirtypes.DistanceType | None = Field( default=None, alias="valueDistance", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDuration: fhirtypes.DurationType | None = Field( default=None, alias="valueDuration", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="valueHumanName", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueId: fhirtypes.IdType | None = Field( default=None, alias="valueId", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="valueIdentifier", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInstant: fhirtypes.InstantType | None = Field( default=None, alias="valueInstant", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="valueMarkdown", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueMeta: fhirtypes.MetaType | None = Field( default=None, alias="valueMeta", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueMoney: fhirtypes.MoneyType | None = Field( default=None, alias="valueMoney", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueOid: fhirtypes.OidType | None = Field( default=None, alias="valueOid", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="valuePositiveInt", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="valueSampledData", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueSignature: fhirtypes.SignatureType | None = Field( default=None, alias="valueSignature", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueTiming: fhirtypes.TimingType | None = Field( default=None, alias="valueTiming", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="valueUnsignedInt", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="Value of extension", description=( "Value of extension - may be a resource or one of a constrained set of " "the data types (see Extensibility in the spec for list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Extension`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "url", "valueBase64Binary", "valueBoolean", "valueCode", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInstant", "valueInteger", "valueMarkdown", "valueOid", "valuePositiveInt", "valueString", "valueTime", "valueUnsignedInt", "valueUri", "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueCodeableConcept", "valueCoding", "valueContactPoint", "valueCount", "valueDistance", "valueDuration", "valueHumanName", "valueIdentifier", "valueMoney", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueReference", "valueSampledData", "valueSignature", "valueTiming", "valueMeta", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Extension`` according to specification, with preserving the original sequence order. """ return [] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueBase64Binary", "valueBoolean", "valueCode", "valueCodeableConcept", "valueCoding", "valueContactPoint", "valueCount", "valueDate", "valueDateTime", "valueDecimal", "valueDistance", "valueDuration", "valueHumanName", "valueId", "valueIdentifier", "valueInstant", "valueInteger", "valueMarkdown", "valueMeta", "valueMoney", "valueOid", "valuePeriod", "valuePositiveInt", "valueQuantity", "valueRange", "valueRatio", "valueReference", "valueSampledData", "valueSignature", "valueString", "valueTime", "valueTiming", "valueUnsignedInt", "valueUri", ] } return one_of_many_fields ================================================ FILE: fhir/resources/STU3/familymemberhistory.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/FamilyMemberHistory Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class FamilyMemberHistory(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about patient's relatives, relevant for patient. Significant health events and conditions for a person related to the patient relevant in the context of care for the patient. """ __resource_type__ = "FamilyMemberHistory" ageAge: fhirtypes.AgeType | None = Field( default=None, alias="ageAge", title="(approximate) age", description=( "The age of the relative at the time the family member history is " "recorded." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e age[x] "one_of_many": "age", "one_of_many_required": False, }, ) ageRange: fhirtypes.RangeType | None = Field( default=None, alias="ageRange", title="(approximate) age", description=( "The age of the relative at the time the family member history is " "recorded." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e age[x] "one_of_many": "age", "one_of_many_required": False, }, ) ageString: fhirtypes.StringType | None = Field( default=None, alias="ageString", title="(approximate) age", description=( "The age of the relative at the time the family member history is " "recorded." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e age[x] "one_of_many": "age", "one_of_many_required": False, }, ) ageString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_ageString", title="Extension field for ``ageString``." ) bornDate: fhirtypes.DateType | None = Field( default=None, alias="bornDate", title="(approximate) date of birth", description="The actual or approximate date of birth of the relative.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e born[x] "one_of_many": "born", "one_of_many_required": False, }, ) bornDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_bornDate", title="Extension field for ``bornDate``." ) bornPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="bornPeriod", title="(approximate) date of birth", description="The actual or approximate date of birth of the relative.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e born[x] "one_of_many": "born", "one_of_many_required": False, }, ) bornString: fhirtypes.StringType | None = Field( default=None, alias="bornString", title="(approximate) date of birth", description="The actual or approximate date of birth of the relative.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e born[x] "one_of_many": "born", "one_of_many_required": False, }, ) bornString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_bornString", title="Extension field for ``bornString``." ) condition: typing.List[fhirtypes.FamilyMemberHistoryConditionType] | None = Field( default=None, alias="condition", title="Condition that the related person had", description=( "The significant Conditions (or condition) that the family member had. " "This is a repeating section to allow a system to represent more than " "one condition per resource, though there is nothing stopping multiple " "resources - one per condition." ), json_schema_extra={ "element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When history was captured/updated", description="The date (and possibly time) when the family member history was taken.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) deceasedAge: fhirtypes.AgeType | None = Field( default=None, alias="deceasedAge", title="Dead? How old/when?", description=( "Deceased flag or the actual or approximate age of the relative at the " "time of death for the family member history record." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedBoolean: bool | None = Field( default=None, alias="deceasedBoolean", title="Dead? How old/when?", description=( "Deceased flag or the actual or approximate age of the relative at the " "time of death for the family member history record." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deceasedBoolean", title="Extension field for ``deceasedBoolean``.", ) deceasedDate: fhirtypes.DateType | None = Field( default=None, alias="deceasedDate", title="Dead? How old/when?", description=( "Deceased flag or the actual or approximate age of the relative at the " "time of death for the family member history record." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deceasedDate", title="Extension field for ``deceasedDate``.", ) deceasedRange: fhirtypes.RangeType | None = Field( default=None, alias="deceasedRange", title="Dead? How old/when?", description=( "Deceased flag or the actual or approximate age of the relative at the " "time of death for the family member history record." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedString: fhirtypes.StringType | None = Field( default=None, alias="deceasedString", title="Dead? How old/when?", description=( "Deceased flag or the actual or approximate age of the relative at the " "time of death for the family member history record." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deceasedString", title="Extension field for ``deceasedString``.", ) definition: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="definition", title="Instantiates protocol or definition", description=( "A protocol or questionnaire that was adhered to in whole or in part by" " this event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["PlanDefinition", "Questionnaire"], }, ) estimatedAge: bool | None = Field( default=None, alias="estimatedAge", title="Age is estimated?", description="If true, indicates that the age value specified is an estimated value.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) estimatedAge__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_estimatedAge", title="Extension field for ``estimatedAge``.", ) gender: fhirtypes.CodeType | None = Field( default=None, alias="gender", title="male | female | other | unknown", description=( "Administrative Gender - the gender that the relative is considered to " "have for administration and record keeping purposes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["male", "female", "other", "unknown"], }, ) gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_gender", title="Extension field for ``gender``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Id(s) for this record", description=( "This records identifiers associated with this family member history " "record that are defined by business processes and/ or used to refer to" " it when a direct URL reference to the resource itself is not " "appropriate (e.g. in CDA documents, or in written / printed " "documentation)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="The family member described", description=( 'This will either be a name or a description; e.g. "Aunt Susan", "my ' 'cousin with the red hair".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) notDone: bool | None = Field( default=None, alias="notDone", title="The taking of a family member's history did not occur", description=( "If true, indicates the taking of an individual family member's history" " did not occur. The notDone element should not be used to document " "negated conditions, such as a family member that did not have a " "condition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) notDone__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_notDone", title="Extension field for ``notDone``." ) notDoneReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="notDoneReason", title="subject-unknown | withheld | unable-to-obtain | deferred", description="Describes why the family member's history is absent.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="General note about related person", description=( "This property allows a non condition-specific note to the made about " "the related person. Ideally, the note would be in the condition " "property, but this is not always possible." ), json_schema_extra={ "element_property": True, }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Patient history is about", description="The person who this history concerns.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Why was family member history performed?", description=( "Describes why the family member history occurred in coded or textual " "form." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Why was family member history performed?", description=( "Indicates a Condition, Observation, AllergyIntolerance, or " "QuestionnaireResponse that justifies this family member history event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "AllergyIntolerance", "QuestionnaireResponse", ], }, ) relationship: fhirtypes.CodeableConceptType = Field( default=..., alias="relationship", title="Relationship to the subject", description=( "The type of relationship this person has to the patient (father, " "mother, brother etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="partial | completed | entered-in-error | health-unknown", description=( "A code specifying the status of the record of the family history of a " "specific family member." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "partial", "completed", "entered-in-error", "health-unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``FamilyMemberHistory`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "definition", "status", "notDone", "notDoneReason", "patient", "date", "name", "relationship", "gender", "bornPeriod", "bornDate", "bornString", "ageAge", "ageRange", "ageString", "estimatedAge", "deceasedBoolean", "deceasedAge", "deceasedRange", "deceasedDate", "deceasedString", "reasonCode", "reasonReference", "note", "condition", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``FamilyMemberHistory`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "definition", "status", "notDone", "notDoneReason", "patient", "date", "name", "relationship", "gender", "ageAge", "ageRange", "ageString", "estimatedAge", "deceasedBoolean", "deceasedAge", "deceasedRange", "deceasedDate", "deceasedString", "reasonCode", "reasonReference", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "age": ["ageAge", "ageRange", "ageString"], "born": ["bornDate", "bornPeriod", "bornString"], "deceased": [ "deceasedAge", "deceasedBoolean", "deceasedDate", "deceasedRange", "deceasedString", ], } return one_of_many_fields class FamilyMemberHistoryCondition(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Condition that the related person had. The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition. """ __resource_type__ = "FamilyMemberHistoryCondition" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Condition suffered by relation", description=( "The actual condition specified. Could be a coded condition (like MI or" " Diabetes) or a less specific string like 'cancer' depending on how " "much is known about the condition and the capabilities of the creating" " system." ), json_schema_extra={ "element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Extra information about condition", description=( "An area where general notes can be placed about this specific " "condition." ), json_schema_extra={ "element_property": True, }, ) onsetAge: fhirtypes.AgeType | None = Field( default=None, alias="onsetAge", title="When condition first manifested", description=( "Either the age of onset, range of approximate age or descriptive " "string can be recorded. For conditions with multiple occurrences, " "this describes the first known occurrence." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="onsetPeriod", title="When condition first manifested", description=( "Either the age of onset, range of approximate age or descriptive " "string can be recorded. For conditions with multiple occurrences, " "this describes the first known occurrence." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetRange: fhirtypes.RangeType | None = Field( default=None, alias="onsetRange", title="When condition first manifested", description=( "Either the age of onset, range of approximate age or descriptive " "string can be recorded. For conditions with multiple occurrences, " "this describes the first known occurrence." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetString: fhirtypes.StringType | None = Field( default=None, alias="onsetString", title="When condition first manifested", description=( "Either the age of onset, range of approximate age or descriptive " "string can be recorded. For conditions with multiple occurrences, " "this describes the first known occurrence." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onsetString", title="Extension field for ``onsetString``." ) outcome: fhirtypes.CodeableConceptType | None = Field( default=None, alias="outcome", title="deceased | permanent disability | etc.", description=( "Indicates what happened as a result of this condition. If the " "condition resulted in death, deceased date is captured on the " "relation." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``FamilyMemberHistoryCondition`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "outcome", "onsetAge", "onsetRange", "onsetPeriod", "onsetString", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``FamilyMemberHistoryCondition`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "onset": ["onsetAge", "onsetPeriod", "onsetRange", "onsetString"] } return one_of_many_fields ================================================ FILE: fhir/resources/STU3/fhirprimitiveextension.py ================================================ from __future__ import annotations as _annotations import typing from fhir_core import fhirabstractmodel from pydantic import Field, model_validator from pydantic_core import PydanticCustomError from . import fhirtypes __author__ = "Md Nazrul Islam" __email__ = "email2nazrul@gmail.com" class FHIRPrimitiveExtension(fhirabstractmodel.FHIRAbstractModel): """@see: https://www.hl7.org/fhir/extensibility.html Extensibility feature for FHIR Primitive Data Types.""" __resource_type__ = "FHIRPrimitiveExtension" id: typing.Optional[fhirtypes.StringType] = Field( default=None, alias="id", title="Type `String`", description="Unique id for inter-element referencing", # if property is an element of this resource. json_schema_extra={"element_property": False}, ) extension: typing.Optional[typing.List[fhirtypes.ExtensionType]] = Field( None, alias="extension", title="List of `Extension` items (represented as `dict` in JSON)", description="Additional content defined by implementations", # if property is an element of this resource. json_schema_extra={"element_property": False}, ) @model_validator(mode="before") def validate_extension_or_fhir_comment_required( cls, values: typing.Dict[str, typing.Any] ) -> typing.Dict[str, typing.Any]: """Conditional Required Validation""" extension = values.get("extension", None) fhir_comments = values.get("fhir_comments", None) if ( values.get("id", None) is None and extension is None and fhir_comments is None ): raise PydanticCustomError( "model_validation_format", "One of field value is required.", {}, ) return values @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``FHIRPrimitiveExtension`` according to specification, with preserving original sequence order. """ return ["id", "extension"] ================================================ FILE: fhir/resources/STU3/fhirresourcemodel.py ================================================ from typing import Optional, Union from fhir_core.fhirabstractmodel import FHIRAbstractModel from .fhirtypes import IdType, StringType class FHIRResourceModel(FHIRAbstractModel): """Abstract base model class for all FHIR elements.""" __resource_type__ = "FHIRAbstractResource" id: Optional[Union[IdType, StringType]] = None def relative_base(self) -> str: """ """ return self.__resource_type__ def relative_path(self) -> str: if self.id is None: return self.relative_base() return "{0}/{1}".format(self.relative_base(), self.id) ================================================ FILE: fhir/resources/STU3/fhirtypes.py ================================================ from __future__ import annotations as _annotations from typing import TYPE_CHECKING from fhir_core.types import ( Base64BinaryType, BooleanType, CanonicalType, CodeType, DateTimeType, DateType, DecimalType, IdType, InstantType, Integer64Type, IntegerType, MarkdownType, OidType, PositiveIntType, StringType, TimeType, UnsignedIntType, UriType, UrlType, UuidType, XhtmlType, create_fhir_element_or_resource_type, create_fhir_type, ) __author__ = "Md Nazrul Islam" __email__ = "email2nazrul@gmail.com" # The dependency hierarchy is circular due to Extension being referenced in FHIRPrimitiveExtension # which itself is referenced in every resource. Extension is also referenced in several resources and refers to several resources. # Pydantic fields can not use forward references as this causes the "class not fully defined" error at runtime: https://docs.pydantic.dev/2.12/errors/usage_errors/#class-not-fully-defined # To properly allow type checkers to type check, use type aliases during type checking and the create_fhir_type workaround at runtime. if TYPE_CHECKING: from . import ( account, activitydefinition, address, adverseevent, age, allergyintolerance, annotation, appointment, appointmentresponse, attachment, auditevent, backboneelement, basic, binary, bodysite, bundle, capabilitystatement, careplan, careteam, chargeitem, claim, claimresponse, clinicalimpression, codeableconcept, codesystem, coding, communication, communicationrequest, compartmentdefinition, composition, conceptmap, condition, consent, contactdetail, contactpoint, contract, contributor, count, coverage, dataelement, datarequirement, detectedissue, device, devicecomponent, devicemetric, devicerequest, deviceusestatement, diagnosticreport, distance, documentmanifest, documentreference, domainresource, dosage, duration, element, elementdefinition, eligibilityrequest, eligibilityresponse, encounter, endpoint, enrollmentrequest, enrollmentresponse, episodeofcare, expansionprofile, explanationofbenefit, extension, familymemberhistory, flag, goal, graphdefinition, group, guidanceresponse, healthcareservice, humanname, identifier, imagingmanifest, imagingstudy, immunization, immunizationrecommendation, implementationguide, library, linkage, list, location, measure, measurereport, media, medication, medicationadministration, medicationdispense, medicationrequest, medicationstatement, messagedefinition, messageheader, meta, metadataresource, money, namingsystem, narrative, nutritionorder, observation, operationdefinition, operationoutcome, organization, parameterdefinition, parameters, patient, paymentnotice, paymentreconciliation, period, person, plandefinition, practitioner, practitionerrole, procedure, procedurerequest, processrequest, processresponse, provenance, quantity, questionnaire, questionnaireresponse, range, ratio, reference, referralrequest, relatedartifact, relatedperson, requestgroup, researchstudy, researchsubject, resource, riskassessment, sampleddata, schedule, searchparameter, sequence, servicedefinition, signature, slot, specimen, structuredefinition, structuremap, subscription, substance, supplydelivery, supplyrequest, task, testreport, testscript, timing, triggerdefinition, usagecontext, valueset, visionprescription, ) from .fhirprimitiveextension import FHIRPrimitiveExtension FHIRPrimitiveExtensionType = FHIRPrimitiveExtension AccountType = account.Account AccountCoverageType = account.AccountCoverage AccountGuarantorType = account.AccountGuarantor ActivityDefinitionType = activitydefinition.ActivityDefinition ActivityDefinitionDynamicValueType = ( activitydefinition.ActivityDefinitionDynamicValue ) ActivityDefinitionParticipantType = activitydefinition.ActivityDefinitionParticipant AddressType = address.Address AdverseEventType = adverseevent.AdverseEvent AdverseEventSuspectEntityType = adverseevent.AdverseEventSuspectEntity AgeType = age.Age AllergyIntoleranceType = allergyintolerance.AllergyIntolerance AllergyIntoleranceReactionType = allergyintolerance.AllergyIntoleranceReaction AnnotationType = annotation.Annotation AppointmentType = appointment.Appointment AppointmentParticipantType = appointment.AppointmentParticipant AppointmentResponseType = appointmentresponse.AppointmentResponse AttachmentType = attachment.Attachment AuditEventType = auditevent.AuditEvent AuditEventAgentType = auditevent.AuditEventAgent AuditEventAgentNetworkType = auditevent.AuditEventAgentNetwork AuditEventEntityType = auditevent.AuditEventEntity AuditEventEntityDetailType = auditevent.AuditEventEntityDetail AuditEventSourceType = auditevent.AuditEventSource BackboneElementType = backboneelement.BackboneElement BasicType = basic.Basic BinaryType = binary.Binary BodySiteType = bodysite.BodySite BundleType = bundle.Bundle BundleEntryType = bundle.BundleEntry BundleEntryRequestType = bundle.BundleEntryRequest BundleEntryResponseType = bundle.BundleEntryResponse BundleEntrySearchType = bundle.BundleEntrySearch BundleLinkType = bundle.BundleLink CapabilityStatementType = capabilitystatement.CapabilityStatement CapabilityStatementDocumentType = capabilitystatement.CapabilityStatementDocument CapabilityStatementImplementationType = ( capabilitystatement.CapabilityStatementImplementation ) CapabilityStatementMessagingType = capabilitystatement.CapabilityStatementMessaging CapabilityStatementMessagingEndpointType = ( capabilitystatement.CapabilityStatementMessagingEndpoint ) CapabilityStatementMessagingEventType = ( capabilitystatement.CapabilityStatementMessagingEvent ) CapabilityStatementMessagingSupportedMessageType = ( capabilitystatement.CapabilityStatementMessagingSupportedMessage ) CapabilityStatementRestType = capabilitystatement.CapabilityStatementRest CapabilityStatementRestInteractionType = ( capabilitystatement.CapabilityStatementRestInteraction ) CapabilityStatementRestOperationType = ( capabilitystatement.CapabilityStatementRestOperation ) CapabilityStatementRestResourceType = ( capabilitystatement.CapabilityStatementRestResource ) CapabilityStatementRestResourceInteractionType = ( capabilitystatement.CapabilityStatementRestResourceInteraction ) CapabilityStatementRestResourceSearchParamType = ( capabilitystatement.CapabilityStatementRestResourceSearchParam ) CapabilityStatementRestSecurityType = ( capabilitystatement.CapabilityStatementRestSecurity ) CapabilityStatementRestSecurityCertificateType = ( capabilitystatement.CapabilityStatementRestSecurityCertificate ) CapabilityStatementSoftwareType = capabilitystatement.CapabilityStatementSoftware CarePlanType = careplan.CarePlan CarePlanActivityType = careplan.CarePlanActivity CarePlanActivityDetailType = careplan.CarePlanActivityDetail CareTeamType = careteam.CareTeam CareTeamParticipantType = careteam.CareTeamParticipant ChargeItemType = chargeitem.ChargeItem ChargeItemParticipantType = chargeitem.ChargeItemParticipant ClaimType = claim.Claim ClaimAccidentType = claim.ClaimAccident ClaimCareTeamType = claim.ClaimCareTeam ClaimDiagnosisType = claim.ClaimDiagnosis ClaimInformationType = claim.ClaimInformation ClaimInsuranceType = claim.ClaimInsurance ClaimItemType = claim.ClaimItem ClaimItemDetailType = claim.ClaimItemDetail ClaimItemDetailSubDetailType = claim.ClaimItemDetailSubDetail ClaimPayeeType = claim.ClaimPayee ClaimProcedureType = claim.ClaimProcedure ClaimRelatedType = claim.ClaimRelated ClaimResponseType = claimresponse.ClaimResponse ClaimResponseAddItemType = claimresponse.ClaimResponseAddItem ClaimResponseAddItemDetailType = claimresponse.ClaimResponseAddItemDetail ClaimResponseErrorType = claimresponse.ClaimResponseError ClaimResponseInsuranceType = claimresponse.ClaimResponseInsurance ClaimResponseItemType = claimresponse.ClaimResponseItem ClaimResponseItemAdjudicationType = claimresponse.ClaimResponseItemAdjudication ClaimResponseItemDetailType = claimresponse.ClaimResponseItemDetail ClaimResponseItemDetailSubDetailType = ( claimresponse.ClaimResponseItemDetailSubDetail ) ClaimResponsePaymentType = claimresponse.ClaimResponsePayment ClaimResponseProcessNoteType = claimresponse.ClaimResponseProcessNote ClinicalImpressionType = clinicalimpression.ClinicalImpression ClinicalImpressionFindingType = clinicalimpression.ClinicalImpressionFinding ClinicalImpressionInvestigationType = ( clinicalimpression.ClinicalImpressionInvestigation ) CodeSystemType = codesystem.CodeSystem CodeSystemConceptType = codesystem.CodeSystemConcept CodeSystemConceptDesignationType = codesystem.CodeSystemConceptDesignation CodeSystemConceptPropertyType = codesystem.CodeSystemConceptProperty CodeSystemFilterType = codesystem.CodeSystemFilter CodeSystemPropertyType = codesystem.CodeSystemProperty CodeableConceptType = codeableconcept.CodeableConcept CodingType = coding.Coding CommunicationType = communication.Communication CommunicationPayloadType = communication.CommunicationPayload CommunicationRequestType = communicationrequest.CommunicationRequest CommunicationRequestPayloadType = communicationrequest.CommunicationRequestPayload CommunicationRequestRequesterType = ( communicationrequest.CommunicationRequestRequester ) CompartmentDefinitionType = compartmentdefinition.CompartmentDefinition CompartmentDefinitionResourceType = ( compartmentdefinition.CompartmentDefinitionResource ) CompositionType = composition.Composition CompositionAttesterType = composition.CompositionAttester CompositionEventType = composition.CompositionEvent CompositionRelatesToType = composition.CompositionRelatesTo CompositionSectionType = composition.CompositionSection ConceptMapType = conceptmap.ConceptMap ConceptMapGroupType = conceptmap.ConceptMapGroup ConceptMapGroupElementType = conceptmap.ConceptMapGroupElement ConceptMapGroupElementTargetType = conceptmap.ConceptMapGroupElementTarget ConceptMapGroupElementTargetDependsOnType = ( conceptmap.ConceptMapGroupElementTargetDependsOn ) ConceptMapGroupUnmappedType = conceptmap.ConceptMapGroupUnmapped ConditionType = condition.Condition ConditionEvidenceType = condition.ConditionEvidence ConditionStageType = condition.ConditionStage ConsentType = consent.Consent ConsentActorType = consent.ConsentActor ConsentDataType = consent.ConsentData ConsentExceptType = consent.ConsentExcept ConsentExceptActorType = consent.ConsentExceptActor ConsentExceptDataType = consent.ConsentExceptData ConsentPolicyType = consent.ConsentPolicy ContactDetailType = contactdetail.ContactDetail ContactPointType = contactpoint.ContactPoint ContractType = contract.Contract ContractAgentType = contract.ContractAgent ContractFriendlyType = contract.ContractFriendly ContractLegalType = contract.ContractLegal ContractRuleType = contract.ContractRule ContractSignerType = contract.ContractSigner ContractTermType = contract.ContractTerm ContractTermAgentType = contract.ContractTermAgent ContractTermValuedItemType = contract.ContractTermValuedItem ContractValuedItemType = contract.ContractValuedItem ContributorType = contributor.Contributor CountType = count.Count CoverageType = coverage.Coverage CoverageGroupingType = coverage.CoverageGrouping DataElementType = dataelement.DataElement DataElementMappingType = dataelement.DataElementMapping DataRequirementType = datarequirement.DataRequirement DataRequirementCodeFilterType = datarequirement.DataRequirementCodeFilter DataRequirementDateFilterType = datarequirement.DataRequirementDateFilter DetectedIssueType = detectedissue.DetectedIssue DetectedIssueMitigationType = detectedissue.DetectedIssueMitigation DeviceType = device.Device DeviceComponentType = devicecomponent.DeviceComponent DeviceComponentProductionSpecificationType = ( devicecomponent.DeviceComponentProductionSpecification ) DeviceMetricType = devicemetric.DeviceMetric DeviceMetricCalibrationType = devicemetric.DeviceMetricCalibration DeviceRequestType = devicerequest.DeviceRequest DeviceRequestRequesterType = devicerequest.DeviceRequestRequester DeviceUdiType = device.DeviceUdi DeviceUseStatementType = deviceusestatement.DeviceUseStatement DiagnosticReportType = diagnosticreport.DiagnosticReport DiagnosticReportImageType = diagnosticreport.DiagnosticReportImage DiagnosticReportPerformerType = diagnosticreport.DiagnosticReportPerformer DistanceType = distance.Distance DocumentManifestType = documentmanifest.DocumentManifest DocumentManifestContentType = documentmanifest.DocumentManifestContent DocumentManifestRelatedType = documentmanifest.DocumentManifestRelated DocumentReferenceType = documentreference.DocumentReference DocumentReferenceContentType = documentreference.DocumentReferenceContent DocumentReferenceContextType = documentreference.DocumentReferenceContext DocumentReferenceContextRelatedType = ( documentreference.DocumentReferenceContextRelated ) DocumentReferenceRelatesToType = documentreference.DocumentReferenceRelatesTo DomainResourceType = domainresource.DomainResource DosageType = dosage.Dosage DurationType = duration.Duration ElementType = element.Element ElementDefinitionType = elementdefinition.ElementDefinition ElementDefinitionBaseType = elementdefinition.ElementDefinitionBase ElementDefinitionBindingType = elementdefinition.ElementDefinitionBinding ElementDefinitionConstraintType = elementdefinition.ElementDefinitionConstraint ElementDefinitionExampleType = elementdefinition.ElementDefinitionExample ElementDefinitionMappingType = elementdefinition.ElementDefinitionMapping ElementDefinitionSlicingType = elementdefinition.ElementDefinitionSlicing ElementDefinitionSlicingDiscriminatorType = ( elementdefinition.ElementDefinitionSlicingDiscriminator ) ElementDefinitionTypeType = elementdefinition.ElementDefinitionType EligibilityRequestType = eligibilityrequest.EligibilityRequest EligibilityResponseType = eligibilityresponse.EligibilityResponse EligibilityResponseErrorType = eligibilityresponse.EligibilityResponseError EligibilityResponseInsuranceType = eligibilityresponse.EligibilityResponseInsurance EligibilityResponseInsuranceBenefitBalanceType = ( eligibilityresponse.EligibilityResponseInsuranceBenefitBalance ) EligibilityResponseInsuranceBenefitBalanceFinancialType = ( eligibilityresponse.EligibilityResponseInsuranceBenefitBalanceFinancial ) EncounterType = encounter.Encounter EncounterClassHistoryType = encounter.EncounterClassHistory EncounterDiagnosisType = encounter.EncounterDiagnosis EncounterHospitalizationType = encounter.EncounterHospitalization EncounterLocationType = encounter.EncounterLocation EncounterParticipantType = encounter.EncounterParticipant EncounterStatusHistoryType = encounter.EncounterStatusHistory EndpointType = endpoint.Endpoint EnrollmentRequestType = enrollmentrequest.EnrollmentRequest EnrollmentResponseType = enrollmentresponse.EnrollmentResponse EpisodeOfCareType = episodeofcare.EpisodeOfCare EpisodeOfCareDiagnosisType = episodeofcare.EpisodeOfCareDiagnosis EpisodeOfCareStatusHistoryType = episodeofcare.EpisodeOfCareStatusHistory ExpansionProfileType = expansionprofile.ExpansionProfile ExpansionProfileDesignationType = expansionprofile.ExpansionProfileDesignation ExpansionProfileDesignationExcludeType = ( expansionprofile.ExpansionProfileDesignationExclude ) ExpansionProfileDesignationExcludeDesignationType = ( expansionprofile.ExpansionProfileDesignationExcludeDesignation ) ExpansionProfileDesignationIncludeType = ( expansionprofile.ExpansionProfileDesignationInclude ) ExpansionProfileDesignationIncludeDesignationType = ( expansionprofile.ExpansionProfileDesignationIncludeDesignation ) ExpansionProfileExcludedSystemType = expansionprofile.ExpansionProfileExcludedSystem ExpansionProfileFixedVersionType = expansionprofile.ExpansionProfileFixedVersion ExplanationOfBenefitType = explanationofbenefit.ExplanationOfBenefit ExplanationOfBenefitAccidentType = explanationofbenefit.ExplanationOfBenefitAccident ExplanationOfBenefitAddItemType = explanationofbenefit.ExplanationOfBenefitAddItem ExplanationOfBenefitAddItemDetailType = ( explanationofbenefit.ExplanationOfBenefitAddItemDetail ) ExplanationOfBenefitBenefitBalanceType = ( explanationofbenefit.ExplanationOfBenefitBenefitBalance ) ExplanationOfBenefitBenefitBalanceFinancialType = ( explanationofbenefit.ExplanationOfBenefitBenefitBalanceFinancial ) ExplanationOfBenefitCareTeamType = explanationofbenefit.ExplanationOfBenefitCareTeam ExplanationOfBenefitDiagnosisType = ( explanationofbenefit.ExplanationOfBenefitDiagnosis ) ExplanationOfBenefitInformationType = ( explanationofbenefit.ExplanationOfBenefitInformation ) ExplanationOfBenefitInsuranceType = ( explanationofbenefit.ExplanationOfBenefitInsurance ) ExplanationOfBenefitItemType = explanationofbenefit.ExplanationOfBenefitItem ExplanationOfBenefitItemAdjudicationType = ( explanationofbenefit.ExplanationOfBenefitItemAdjudication ) ExplanationOfBenefitItemDetailType = ( explanationofbenefit.ExplanationOfBenefitItemDetail ) ExplanationOfBenefitItemDetailSubDetailType = ( explanationofbenefit.ExplanationOfBenefitItemDetailSubDetail ) ExplanationOfBenefitPayeeType = explanationofbenefit.ExplanationOfBenefitPayee ExplanationOfBenefitPaymentType = explanationofbenefit.ExplanationOfBenefitPayment ExplanationOfBenefitProcedureType = ( explanationofbenefit.ExplanationOfBenefitProcedure ) ExplanationOfBenefitProcessNoteType = ( explanationofbenefit.ExplanationOfBenefitProcessNote ) ExplanationOfBenefitRelatedType = explanationofbenefit.ExplanationOfBenefitRelated ExtensionType = extension.Extension FamilyMemberHistoryType = familymemberhistory.FamilyMemberHistory FamilyMemberHistoryConditionType = familymemberhistory.FamilyMemberHistoryCondition FlagType = flag.Flag GoalType = goal.Goal GoalTargetType = goal.GoalTarget GraphDefinitionType = graphdefinition.GraphDefinition GraphDefinitionLinkType = graphdefinition.GraphDefinitionLink GraphDefinitionLinkTargetType = graphdefinition.GraphDefinitionLinkTarget GraphDefinitionLinkTargetCompartmentType = ( graphdefinition.GraphDefinitionLinkTargetCompartment ) GroupType = group.Group GroupCharacteristicType = group.GroupCharacteristic GroupMemberType = group.GroupMember GuidanceResponseType = guidanceresponse.GuidanceResponse HealthcareServiceType = healthcareservice.HealthcareService HealthcareServiceAvailableTimeType = ( healthcareservice.HealthcareServiceAvailableTime ) HealthcareServiceNotAvailableType = healthcareservice.HealthcareServiceNotAvailable HumanNameType = humanname.HumanName IdentifierType = identifier.Identifier ImagingManifestType = imagingmanifest.ImagingManifest ImagingManifestStudyType = imagingmanifest.ImagingManifestStudy ImagingManifestStudySeriesType = imagingmanifest.ImagingManifestStudySeries ImagingManifestStudySeriesInstanceType = ( imagingmanifest.ImagingManifestStudySeriesInstance ) ImagingStudyType = imagingstudy.ImagingStudy ImagingStudySeriesType = imagingstudy.ImagingStudySeries ImagingStudySeriesInstanceType = imagingstudy.ImagingStudySeriesInstance ImmunizationType = immunization.Immunization ImmunizationExplanationType = immunization.ImmunizationExplanation ImmunizationPractitionerType = immunization.ImmunizationPractitioner ImmunizationReactionType = immunization.ImmunizationReaction ImmunizationRecommendationType = ( immunizationrecommendation.ImmunizationRecommendation ) ImmunizationRecommendationRecommendationType = ( immunizationrecommendation.ImmunizationRecommendationRecommendation ) ImmunizationRecommendationRecommendationDateCriterionType = ( immunizationrecommendation.ImmunizationRecommendationRecommendationDateCriterion ) ImmunizationRecommendationRecommendationProtocolType = ( immunizationrecommendation.ImmunizationRecommendationRecommendationProtocol ) ImmunizationVaccinationProtocolType = immunization.ImmunizationVaccinationProtocol ImplementationGuideType = implementationguide.ImplementationGuide ImplementationGuideDependencyType = ( implementationguide.ImplementationGuideDependency ) ImplementationGuideGlobalType = implementationguide.ImplementationGuideGlobal ImplementationGuidePackageType = implementationguide.ImplementationGuidePackage ImplementationGuidePackageResourceType = ( implementationguide.ImplementationGuidePackageResource ) ImplementationGuidePageType = implementationguide.ImplementationGuidePage LibraryType = library.Library LinkageType = linkage.Linkage LinkageItemType = linkage.LinkageItem ListType = list.List ListEntryType = list.ListEntry LocationType = location.Location LocationPositionType = location.LocationPosition MeasureType = measure.Measure MeasureGroupType = measure.MeasureGroup MeasureGroupPopulationType = measure.MeasureGroupPopulation MeasureGroupStratifierType = measure.MeasureGroupStratifier MeasureReportType = measurereport.MeasureReport MeasureReportGroupType = measurereport.MeasureReportGroup MeasureReportGroupPopulationType = measurereport.MeasureReportGroupPopulation MeasureReportGroupStratifierType = measurereport.MeasureReportGroupStratifier MeasureReportGroupStratifierStratumType = ( measurereport.MeasureReportGroupStratifierStratum ) MeasureReportGroupStratifierStratumPopulationType = ( measurereport.MeasureReportGroupStratifierStratumPopulation ) MeasureSupplementalDataType = measure.MeasureSupplementalData MediaType = media.Media MedicationType = medication.Medication MedicationAdministrationType = medicationadministration.MedicationAdministration MedicationAdministrationDosageType = ( medicationadministration.MedicationAdministrationDosage ) MedicationAdministrationPerformerType = ( medicationadministration.MedicationAdministrationPerformer ) MedicationDispenseType = medicationdispense.MedicationDispense MedicationDispensePerformerType = medicationdispense.MedicationDispensePerformer MedicationDispenseSubstitutionType = ( medicationdispense.MedicationDispenseSubstitution ) MedicationIngredientType = medication.MedicationIngredient MedicationPackageType = medication.MedicationPackage MedicationPackageBatchType = medication.MedicationPackageBatch MedicationPackageContentType = medication.MedicationPackageContent MedicationRequestType = medicationrequest.MedicationRequest MedicationRequestDispenseRequestType = ( medicationrequest.MedicationRequestDispenseRequest ) MedicationRequestRequesterType = medicationrequest.MedicationRequestRequester MedicationRequestSubstitutionType = medicationrequest.MedicationRequestSubstitution MedicationStatementType = medicationstatement.MedicationStatement MessageDefinitionType = messagedefinition.MessageDefinition MessageDefinitionAllowedResponseType = ( messagedefinition.MessageDefinitionAllowedResponse ) MessageDefinitionFocusType = messagedefinition.MessageDefinitionFocus MessageHeaderType = messageheader.MessageHeader MessageHeaderDestinationType = messageheader.MessageHeaderDestination MessageHeaderResponseType = messageheader.MessageHeaderResponse MessageHeaderSourceType = messageheader.MessageHeaderSource MetaType = meta.Meta MetadataResourceType = metadataresource.MetadataResource MoneyType = money.Money NamingSystemType = namingsystem.NamingSystem NamingSystemUniqueIdType = namingsystem.NamingSystemUniqueId NarrativeType = narrative.Narrative NutritionOrderType = nutritionorder.NutritionOrder NutritionOrderEnteralFormulaType = nutritionorder.NutritionOrderEnteralFormula NutritionOrderEnteralFormulaAdministrationType = ( nutritionorder.NutritionOrderEnteralFormulaAdministration ) NutritionOrderOralDietType = nutritionorder.NutritionOrderOralDiet NutritionOrderOralDietNutrientType = nutritionorder.NutritionOrderOralDietNutrient NutritionOrderOralDietTextureType = nutritionorder.NutritionOrderOralDietTexture NutritionOrderSupplementType = nutritionorder.NutritionOrderSupplement ObservationType = observation.Observation ObservationComponentType = observation.ObservationComponent ObservationReferenceRangeType = observation.ObservationReferenceRange ObservationRelatedType = observation.ObservationRelated OperationDefinitionType = operationdefinition.OperationDefinition OperationDefinitionOverloadType = operationdefinition.OperationDefinitionOverload OperationDefinitionParameterType = operationdefinition.OperationDefinitionParameter OperationDefinitionParameterBindingType = ( operationdefinition.OperationDefinitionParameterBinding ) OperationOutcomeType = operationoutcome.OperationOutcome OperationOutcomeIssueType = operationoutcome.OperationOutcomeIssue OrganizationType = organization.Organization OrganizationContactType = organization.OrganizationContact ParameterDefinitionType = parameterdefinition.ParameterDefinition ParametersType = parameters.Parameters ParametersParameterType = parameters.ParametersParameter PatientType = patient.Patient PatientAnimalType = patient.PatientAnimal PatientCommunicationType = patient.PatientCommunication PatientContactType = patient.PatientContact PatientLinkType = patient.PatientLink PaymentNoticeType = paymentnotice.PaymentNotice PaymentReconciliationType = paymentreconciliation.PaymentReconciliation PaymentReconciliationDetailType = paymentreconciliation.PaymentReconciliationDetail PaymentReconciliationProcessNoteType = ( paymentreconciliation.PaymentReconciliationProcessNote ) PeriodType = period.Period PersonType = person.Person PersonLinkType = person.PersonLink PlanDefinitionType = plandefinition.PlanDefinition PlanDefinitionActionType = plandefinition.PlanDefinitionAction PlanDefinitionActionConditionType = plandefinition.PlanDefinitionActionCondition PlanDefinitionActionDynamicValueType = ( plandefinition.PlanDefinitionActionDynamicValue ) PlanDefinitionActionParticipantType = plandefinition.PlanDefinitionActionParticipant PlanDefinitionActionRelatedActionType = ( plandefinition.PlanDefinitionActionRelatedAction ) PlanDefinitionGoalType = plandefinition.PlanDefinitionGoal PlanDefinitionGoalTargetType = plandefinition.PlanDefinitionGoalTarget PractitionerType = practitioner.Practitioner PractitionerQualificationType = practitioner.PractitionerQualification PractitionerRoleType = practitionerrole.PractitionerRole PractitionerRoleAvailableTimeType = practitionerrole.PractitionerRoleAvailableTime PractitionerRoleNotAvailableType = practitionerrole.PractitionerRoleNotAvailable ProcedureType = procedure.Procedure ProcedureFocalDeviceType = procedure.ProcedureFocalDevice ProcedurePerformerType = procedure.ProcedurePerformer ProcedureRequestType = procedurerequest.ProcedureRequest ProcedureRequestRequesterType = procedurerequest.ProcedureRequestRequester ProcessRequestType = processrequest.ProcessRequest ProcessRequestItemType = processrequest.ProcessRequestItem ProcessResponseType = processresponse.ProcessResponse ProcessResponseProcessNoteType = processresponse.ProcessResponseProcessNote ProvenanceType = provenance.Provenance ProvenanceAgentType = provenance.ProvenanceAgent ProvenanceEntityType = provenance.ProvenanceEntity QuantityType = quantity.Quantity QuestionnaireType = questionnaire.Questionnaire QuestionnaireItemType = questionnaire.QuestionnaireItem QuestionnaireItemEnableWhenType = questionnaire.QuestionnaireItemEnableWhen QuestionnaireItemOptionType = questionnaire.QuestionnaireItemOption QuestionnaireResponseType = questionnaireresponse.QuestionnaireResponse QuestionnaireResponseItemType = questionnaireresponse.QuestionnaireResponseItem QuestionnaireResponseItemAnswerType = ( questionnaireresponse.QuestionnaireResponseItemAnswer ) RangeType = range.Range RatioType = ratio.Ratio ReferenceType = reference.Reference ReferralRequestType = referralrequest.ReferralRequest ReferralRequestRequesterType = referralrequest.ReferralRequestRequester RelatedArtifactType = relatedartifact.RelatedArtifact RelatedPersonType = relatedperson.RelatedPerson RequestGroupType = requestgroup.RequestGroup RequestGroupActionType = requestgroup.RequestGroupAction RequestGroupActionConditionType = requestgroup.RequestGroupActionCondition RequestGroupActionRelatedActionType = requestgroup.RequestGroupActionRelatedAction ResearchStudyType = researchstudy.ResearchStudy ResearchStudyArmType = researchstudy.ResearchStudyArm ResearchSubjectType = researchsubject.ResearchSubject ResourceType = resource.Resource RiskAssessmentType = riskassessment.RiskAssessment RiskAssessmentPredictionType = riskassessment.RiskAssessmentPrediction SampledDataType = sampleddata.SampledData ScheduleType = schedule.Schedule SearchParameterType = searchparameter.SearchParameter SearchParameterComponentType = searchparameter.SearchParameterComponent SequenceType = sequence.Sequence SequenceQualityType = sequence.SequenceQuality SequenceReferenceSeqType = sequence.SequenceReferenceSeq SequenceRepositoryType = sequence.SequenceRepository SequenceVariantType = sequence.SequenceVariant ServiceDefinitionType = servicedefinition.ServiceDefinition SignatureType = signature.Signature SlotType = slot.Slot SpecimenType = specimen.Specimen SpecimenCollectionType = specimen.SpecimenCollection SpecimenContainerType = specimen.SpecimenContainer SpecimenProcessingType = specimen.SpecimenProcessing StructureDefinitionType = structuredefinition.StructureDefinition StructureDefinitionDifferentialType = ( structuredefinition.StructureDefinitionDifferential ) StructureDefinitionMappingType = structuredefinition.StructureDefinitionMapping StructureDefinitionSnapshotType = structuredefinition.StructureDefinitionSnapshot StructureMapType = structuremap.StructureMap StructureMapGroupType = structuremap.StructureMapGroup StructureMapGroupInputType = structuremap.StructureMapGroupInput StructureMapGroupRuleType = structuremap.StructureMapGroupRule StructureMapGroupRuleDependentType = structuremap.StructureMapGroupRuleDependent StructureMapGroupRuleSourceType = structuremap.StructureMapGroupRuleSource StructureMapGroupRuleTargetType = structuremap.StructureMapGroupRuleTarget StructureMapGroupRuleTargetParameterType = ( structuremap.StructureMapGroupRuleTargetParameter ) StructureMapStructureType = structuremap.StructureMapStructure SubscriptionType = subscription.Subscription SubscriptionChannelType = subscription.SubscriptionChannel SubstanceType = substance.Substance SubstanceIngredientType = substance.SubstanceIngredient SubstanceInstanceType = substance.SubstanceInstance SupplyDeliveryType = supplydelivery.SupplyDelivery SupplyDeliverySuppliedItemType = supplydelivery.SupplyDeliverySuppliedItem SupplyRequestType = supplyrequest.SupplyRequest SupplyRequestOrderedItemType = supplyrequest.SupplyRequestOrderedItem SupplyRequestRequesterType = supplyrequest.SupplyRequestRequester TaskType = task.Task TaskInputType = task.TaskInput TaskOutputType = task.TaskOutput TaskRequesterType = task.TaskRequester TaskRestrictionType = task.TaskRestriction TestReportType = testreport.TestReport TestReportParticipantType = testreport.TestReportParticipant TestReportSetupType = testreport.TestReportSetup TestReportSetupActionType = testreport.TestReportSetupAction TestReportSetupActionAssertType = testreport.TestReportSetupActionAssert TestReportSetupActionOperationType = testreport.TestReportSetupActionOperation TestReportTeardownType = testreport.TestReportTeardown TestReportTeardownActionType = testreport.TestReportTeardownAction TestReportTestType = testreport.TestReportTest TestReportTestActionType = testreport.TestReportTestAction TestScriptType = testscript.TestScript TestScriptDestinationType = testscript.TestScriptDestination TestScriptFixtureType = testscript.TestScriptFixture TestScriptMetadataType = testscript.TestScriptMetadata TestScriptMetadataCapabilityType = testscript.TestScriptMetadataCapability TestScriptMetadataLinkType = testscript.TestScriptMetadataLink TestScriptOriginType = testscript.TestScriptOrigin TestScriptRuleType = testscript.TestScriptRule TestScriptRuleParamType = testscript.TestScriptRuleParam TestScriptRulesetType = testscript.TestScriptRuleset TestScriptRulesetRuleType = testscript.TestScriptRulesetRule TestScriptRulesetRuleParamType = testscript.TestScriptRulesetRuleParam TestScriptSetupType = testscript.TestScriptSetup TestScriptSetupActionType = testscript.TestScriptSetupAction TestScriptSetupActionAssertType = testscript.TestScriptSetupActionAssert TestScriptSetupActionAssertRuleType = testscript.TestScriptSetupActionAssertRule TestScriptSetupActionAssertRuleParamType = ( testscript.TestScriptSetupActionAssertRuleParam ) TestScriptSetupActionAssertRulesetType = ( testscript.TestScriptSetupActionAssertRuleset ) TestScriptSetupActionAssertRulesetRuleType = ( testscript.TestScriptSetupActionAssertRulesetRule ) TestScriptSetupActionAssertRulesetRuleParamType = ( testscript.TestScriptSetupActionAssertRulesetRuleParam ) TestScriptSetupActionOperationType = testscript.TestScriptSetupActionOperation TestScriptSetupActionOperationRequestHeaderType = ( testscript.TestScriptSetupActionOperationRequestHeader ) TestScriptTeardownType = testscript.TestScriptTeardown TestScriptTeardownActionType = testscript.TestScriptTeardownAction TestScriptTestType = testscript.TestScriptTest TestScriptTestActionType = testscript.TestScriptTestAction TestScriptVariableType = testscript.TestScriptVariable TimingType = timing.Timing TimingRepeatType = timing.TimingRepeat TriggerDefinitionType = triggerdefinition.TriggerDefinition UsageContextType = usagecontext.UsageContext ValueSetType = valueset.ValueSet ValueSetComposeType = valueset.ValueSetCompose ValueSetComposeIncludeType = valueset.ValueSetComposeInclude ValueSetComposeIncludeConceptType = valueset.ValueSetComposeIncludeConcept ValueSetComposeIncludeConceptDesignationType = ( valueset.ValueSetComposeIncludeConceptDesignation ) ValueSetComposeIncludeFilterType = valueset.ValueSetComposeIncludeFilter ValueSetExpansionType = valueset.ValueSetExpansion ValueSetExpansionContainsType = valueset.ValueSetExpansionContains ValueSetExpansionParameterType = valueset.ValueSetExpansionParameter VisionPrescriptionType = visionprescription.VisionPrescription VisionPrescriptionDispenseType = visionprescription.VisionPrescriptionDispense else: FHIRPrimitiveExtensionType = create_fhir_type( "FHIRPrimitiveExtensionType", "fhir.resources.STU3.fhirprimitiveextension.FHIRPrimitiveExtension", ) ElementType = create_fhir_element_or_resource_type( "ElementType", "fhir.resources.STU3.element.Element" ) ResourceType = create_fhir_element_or_resource_type( "ResourceType", "fhir.resources.STU3.resource.Resource" ) AccountType = create_fhir_type("AccountType", "fhir.resources.STU3.account.Account") AccountCoverageType = create_fhir_type( "AccountCoverageType", "fhir.resources.STU3.account.AccountCoverage" ) AccountGuarantorType = create_fhir_type( "AccountGuarantorType", "fhir.resources.STU3.account.AccountGuarantor" ) ActivityDefinitionType = create_fhir_type( "ActivityDefinitionType", "fhir.resources.STU3.activitydefinition.ActivityDefinition", ) ActivityDefinitionDynamicValueType = create_fhir_type( "ActivityDefinitionDynamicValueType", "fhir.resources.STU3.activitydefinition.ActivityDefinitionDynamicValue", ) ActivityDefinitionParticipantType = create_fhir_type( "ActivityDefinitionParticipantType", "fhir.resources.STU3.activitydefinition.ActivityDefinitionParticipant", ) AddressType = create_fhir_type("AddressType", "fhir.resources.STU3.address.Address") AdverseEventType = create_fhir_type( "AdverseEventType", "fhir.resources.STU3.adverseevent.AdverseEvent" ) AdverseEventSuspectEntityType = create_fhir_type( "AdverseEventSuspectEntityType", "fhir.resources.STU3.adverseevent.AdverseEventSuspectEntity", ) AgeType = create_fhir_type("AgeType", "fhir.resources.STU3.age.Age") AllergyIntoleranceType = create_fhir_type( "AllergyIntoleranceType", "fhir.resources.STU3.allergyintolerance.AllergyIntolerance", ) AllergyIntoleranceReactionType = create_fhir_type( "AllergyIntoleranceReactionType", "fhir.resources.STU3.allergyintolerance.AllergyIntoleranceReaction", ) AnnotationType = create_fhir_type( "AnnotationType", "fhir.resources.STU3.annotation.Annotation" ) AppointmentType = create_fhir_type( "AppointmentType", "fhir.resources.STU3.appointment.Appointment" ) AppointmentParticipantType = create_fhir_type( "AppointmentParticipantType", "fhir.resources.STU3.appointment.AppointmentParticipant", ) AppointmentResponseType = create_fhir_type( "AppointmentResponseType", "fhir.resources.STU3.appointmentresponse.AppointmentResponse", ) AttachmentType = create_fhir_type( "AttachmentType", "fhir.resources.STU3.attachment.Attachment" ) AuditEventType = create_fhir_type( "AuditEventType", "fhir.resources.STU3.auditevent.AuditEvent" ) AuditEventAgentType = create_fhir_type( "AuditEventAgentType", "fhir.resources.STU3.auditevent.AuditEventAgent" ) AuditEventAgentNetworkType = create_fhir_type( "AuditEventAgentNetworkType", "fhir.resources.STU3.auditevent.AuditEventAgentNetwork", ) AuditEventEntityType = create_fhir_type( "AuditEventEntityType", "fhir.resources.STU3.auditevent.AuditEventEntity" ) AuditEventEntityDetailType = create_fhir_type( "AuditEventEntityDetailType", "fhir.resources.STU3.auditevent.AuditEventEntityDetail", ) AuditEventSourceType = create_fhir_type( "AuditEventSourceType", "fhir.resources.STU3.auditevent.AuditEventSource" ) BackboneElementType = create_fhir_type( "BackboneElementType", "fhir.resources.STU3.backboneelement.BackboneElement" ) BasicType = create_fhir_type("BasicType", "fhir.resources.STU3.basic.Basic") BinaryType = create_fhir_type("BinaryType", "fhir.resources.STU3.binary.Binary") BodySiteType = create_fhir_type( "BodySiteType", "fhir.resources.STU3.bodysite.BodySite" ) BundleType = create_fhir_type("BundleType", "fhir.resources.STU3.bundle.Bundle") BundleEntryType = create_fhir_type( "BundleEntryType", "fhir.resources.STU3.bundle.BundleEntry" ) BundleEntryRequestType = create_fhir_type( "BundleEntryRequestType", "fhir.resources.STU3.bundle.BundleEntryRequest" ) BundleEntryResponseType = create_fhir_type( "BundleEntryResponseType", "fhir.resources.STU3.bundle.BundleEntryResponse" ) BundleEntrySearchType = create_fhir_type( "BundleEntrySearchType", "fhir.resources.STU3.bundle.BundleEntrySearch" ) BundleLinkType = create_fhir_type( "BundleLinkType", "fhir.resources.STU3.bundle.BundleLink" ) CapabilityStatementType = create_fhir_type( "CapabilityStatementType", "fhir.resources.STU3.capabilitystatement.CapabilityStatement", ) CapabilityStatementDocumentType = create_fhir_type( "CapabilityStatementDocumentType", "fhir.resources.STU3.capabilitystatement.CapabilityStatementDocument", ) CapabilityStatementImplementationType = create_fhir_type( "CapabilityStatementImplementationType", "fhir.resources.STU3.capabilitystatement.CapabilityStatementImplementation", ) CapabilityStatementMessagingType = create_fhir_type( "CapabilityStatementMessagingType", "fhir.resources.STU3.capabilitystatement.CapabilityStatementMessaging", ) CapabilityStatementMessagingEndpointType = create_fhir_type( "CapabilityStatementMessagingEndpointType", "fhir.resources.STU3.capabilitystatement.CapabilityStatementMessagingEndpoint", ) CapabilityStatementMessagingEventType = create_fhir_type( "CapabilityStatementMessagingEventType", "fhir.resources.STU3.capabilitystatement.CapabilityStatementMessagingEvent", ) CapabilityStatementMessagingSupportedMessageType = create_fhir_type( "CapabilityStatementMessagingSupportedMessageType", "fhir.resources.STU3.capabilitystatement.CapabilityStatementMessagingSupportedMessage", ) CapabilityStatementRestType = create_fhir_type( "CapabilityStatementRestType", "fhir.resources.STU3.capabilitystatement.CapabilityStatementRest", ) CapabilityStatementRestInteractionType = create_fhir_type( "CapabilityStatementRestInteractionType", "fhir.resources.STU3.capabilitystatement.CapabilityStatementRestInteraction", ) CapabilityStatementRestOperationType = create_fhir_type( "CapabilityStatementRestOperationType", "fhir.resources.STU3.capabilitystatement.CapabilityStatementRestOperation", ) CapabilityStatementRestResourceType = create_fhir_type( "CapabilityStatementRestResourceType", "fhir.resources.STU3.capabilitystatement.CapabilityStatementRestResource", ) CapabilityStatementRestResourceInteractionType = create_fhir_type( "CapabilityStatementRestResourceInteractionType", "fhir.resources.STU3.capabilitystatement.CapabilityStatementRestResourceInteraction", ) CapabilityStatementRestResourceSearchParamType = create_fhir_type( "CapabilityStatementRestResourceSearchParamType", "fhir.resources.STU3.capabilitystatement.CapabilityStatementRestResourceSearchParam", ) CapabilityStatementRestSecurityType = create_fhir_type( "CapabilityStatementRestSecurityType", "fhir.resources.STU3.capabilitystatement.CapabilityStatementRestSecurity", ) CapabilityStatementRestSecurityCertificateType = create_fhir_type( "CapabilityStatementRestSecurityCertificateType", "fhir.resources.STU3.capabilitystatement.CapabilityStatementRestSecurityCertificate", ) CapabilityStatementSoftwareType = create_fhir_type( "CapabilityStatementSoftwareType", "fhir.resources.STU3.capabilitystatement.CapabilityStatementSoftware", ) CarePlanType = create_fhir_type( "CarePlanType", "fhir.resources.STU3.careplan.CarePlan" ) CarePlanActivityType = create_fhir_type( "CarePlanActivityType", "fhir.resources.STU3.careplan.CarePlanActivity" ) CarePlanActivityDetailType = create_fhir_type( "CarePlanActivityDetailType", "fhir.resources.STU3.careplan.CarePlanActivityDetail", ) CareTeamType = create_fhir_type( "CareTeamType", "fhir.resources.STU3.careteam.CareTeam" ) CareTeamParticipantType = create_fhir_type( "CareTeamParticipantType", "fhir.resources.STU3.careteam.CareTeamParticipant" ) ChargeItemType = create_fhir_type( "ChargeItemType", "fhir.resources.STU3.chargeitem.ChargeItem" ) ChargeItemParticipantType = create_fhir_type( "ChargeItemParticipantType", "fhir.resources.STU3.chargeitem.ChargeItemParticipant", ) ClaimType = create_fhir_type("ClaimType", "fhir.resources.STU3.claim.Claim") ClaimAccidentType = create_fhir_type( "ClaimAccidentType", "fhir.resources.STU3.claim.ClaimAccident" ) ClaimCareTeamType = create_fhir_type( "ClaimCareTeamType", "fhir.resources.STU3.claim.ClaimCareTeam" ) ClaimDiagnosisType = create_fhir_type( "ClaimDiagnosisType", "fhir.resources.STU3.claim.ClaimDiagnosis" ) ClaimInformationType = create_fhir_type( "ClaimInformationType", "fhir.resources.STU3.claim.ClaimInformation" ) ClaimInsuranceType = create_fhir_type( "ClaimInsuranceType", "fhir.resources.STU3.claim.ClaimInsurance" ) ClaimItemType = create_fhir_type( "ClaimItemType", "fhir.resources.STU3.claim.ClaimItem" ) ClaimItemDetailType = create_fhir_type( "ClaimItemDetailType", "fhir.resources.STU3.claim.ClaimItemDetail" ) ClaimItemDetailSubDetailType = create_fhir_type( "ClaimItemDetailSubDetailType", "fhir.resources.STU3.claim.ClaimItemDetailSubDetail", ) ClaimPayeeType = create_fhir_type( "ClaimPayeeType", "fhir.resources.STU3.claim.ClaimPayee" ) ClaimProcedureType = create_fhir_type( "ClaimProcedureType", "fhir.resources.STU3.claim.ClaimProcedure" ) ClaimRelatedType = create_fhir_type( "ClaimRelatedType", "fhir.resources.STU3.claim.ClaimRelated" ) ClaimResponseType = create_fhir_type( "ClaimResponseType", "fhir.resources.STU3.claimresponse.ClaimResponse" ) ClaimResponseAddItemType = create_fhir_type( "ClaimResponseAddItemType", "fhir.resources.STU3.claimresponse.ClaimResponseAddItem", ) ClaimResponseAddItemDetailType = create_fhir_type( "ClaimResponseAddItemDetailType", "fhir.resources.STU3.claimresponse.ClaimResponseAddItemDetail", ) ClaimResponseErrorType = create_fhir_type( "ClaimResponseErrorType", "fhir.resources.STU3.claimresponse.ClaimResponseError" ) ClaimResponseInsuranceType = create_fhir_type( "ClaimResponseInsuranceType", "fhir.resources.STU3.claimresponse.ClaimResponseInsurance", ) ClaimResponseItemType = create_fhir_type( "ClaimResponseItemType", "fhir.resources.STU3.claimresponse.ClaimResponseItem" ) ClaimResponseItemAdjudicationType = create_fhir_type( "ClaimResponseItemAdjudicationType", "fhir.resources.STU3.claimresponse.ClaimResponseItemAdjudication", ) ClaimResponseItemDetailType = create_fhir_type( "ClaimResponseItemDetailType", "fhir.resources.STU3.claimresponse.ClaimResponseItemDetail", ) ClaimResponseItemDetailSubDetailType = create_fhir_type( "ClaimResponseItemDetailSubDetailType", "fhir.resources.STU3.claimresponse.ClaimResponseItemDetailSubDetail", ) ClaimResponsePaymentType = create_fhir_type( "ClaimResponsePaymentType", "fhir.resources.STU3.claimresponse.ClaimResponsePayment", ) ClaimResponseProcessNoteType = create_fhir_type( "ClaimResponseProcessNoteType", "fhir.resources.STU3.claimresponse.ClaimResponseProcessNote", ) ClinicalImpressionType = create_fhir_type( "ClinicalImpressionType", "fhir.resources.STU3.clinicalimpression.ClinicalImpression", ) ClinicalImpressionFindingType = create_fhir_type( "ClinicalImpressionFindingType", "fhir.resources.STU3.clinicalimpression.ClinicalImpressionFinding", ) ClinicalImpressionInvestigationType = create_fhir_type( "ClinicalImpressionInvestigationType", "fhir.resources.STU3.clinicalimpression.ClinicalImpressionInvestigation", ) CodeSystemType = create_fhir_type( "CodeSystemType", "fhir.resources.STU3.codesystem.CodeSystem" ) CodeSystemConceptType = create_fhir_type( "CodeSystemConceptType", "fhir.resources.STU3.codesystem.CodeSystemConcept" ) CodeSystemConceptDesignationType = create_fhir_type( "CodeSystemConceptDesignationType", "fhir.resources.STU3.codesystem.CodeSystemConceptDesignation", ) CodeSystemConceptPropertyType = create_fhir_type( "CodeSystemConceptPropertyType", "fhir.resources.STU3.codesystem.CodeSystemConceptProperty", ) CodeSystemFilterType = create_fhir_type( "CodeSystemFilterType", "fhir.resources.STU3.codesystem.CodeSystemFilter" ) CodeSystemPropertyType = create_fhir_type( "CodeSystemPropertyType", "fhir.resources.STU3.codesystem.CodeSystemProperty" ) CodeableConceptType = create_fhir_type( "CodeableConceptType", "fhir.resources.STU3.codeableconcept.CodeableConcept" ) CodingType = create_fhir_type("CodingType", "fhir.resources.STU3.coding.Coding") CommunicationType = create_fhir_type( "CommunicationType", "fhir.resources.STU3.communication.Communication" ) CommunicationPayloadType = create_fhir_type( "CommunicationPayloadType", "fhir.resources.STU3.communication.CommunicationPayload", ) CommunicationRequestType = create_fhir_type( "CommunicationRequestType", "fhir.resources.STU3.communicationrequest.CommunicationRequest", ) CommunicationRequestPayloadType = create_fhir_type( "CommunicationRequestPayloadType", "fhir.resources.STU3.communicationrequest.CommunicationRequestPayload", ) CommunicationRequestRequesterType = create_fhir_type( "CommunicationRequestRequesterType", "fhir.resources.STU3.communicationrequest.CommunicationRequestRequester", ) CompartmentDefinitionType = create_fhir_type( "CompartmentDefinitionType", "fhir.resources.STU3.compartmentdefinition.CompartmentDefinition", ) CompartmentDefinitionResourceType = create_fhir_type( "CompartmentDefinitionResourceType", "fhir.resources.STU3.compartmentdefinition.CompartmentDefinitionResource", ) CompositionType = create_fhir_type( "CompositionType", "fhir.resources.STU3.composition.Composition" ) CompositionAttesterType = create_fhir_type( "CompositionAttesterType", "fhir.resources.STU3.composition.CompositionAttester" ) CompositionEventType = create_fhir_type( "CompositionEventType", "fhir.resources.STU3.composition.CompositionEvent" ) CompositionRelatesToType = create_fhir_type( "CompositionRelatesToType", "fhir.resources.STU3.composition.CompositionRelatesTo", ) CompositionSectionType = create_fhir_type( "CompositionSectionType", "fhir.resources.STU3.composition.CompositionSection" ) ConceptMapType = create_fhir_type( "ConceptMapType", "fhir.resources.STU3.conceptmap.ConceptMap" ) ConceptMapGroupType = create_fhir_type( "ConceptMapGroupType", "fhir.resources.STU3.conceptmap.ConceptMapGroup" ) ConceptMapGroupElementType = create_fhir_type( "ConceptMapGroupElementType", "fhir.resources.STU3.conceptmap.ConceptMapGroupElement", ) ConceptMapGroupElementTargetType = create_fhir_type( "ConceptMapGroupElementTargetType", "fhir.resources.STU3.conceptmap.ConceptMapGroupElementTarget", ) ConceptMapGroupElementTargetDependsOnType = create_fhir_type( "ConceptMapGroupElementTargetDependsOnType", "fhir.resources.STU3.conceptmap.ConceptMapGroupElementTargetDependsOn", ) ConceptMapGroupUnmappedType = create_fhir_type( "ConceptMapGroupUnmappedType", "fhir.resources.STU3.conceptmap.ConceptMapGroupUnmapped", ) ConditionType = create_fhir_type( "ConditionType", "fhir.resources.STU3.condition.Condition" ) ConditionEvidenceType = create_fhir_type( "ConditionEvidenceType", "fhir.resources.STU3.condition.ConditionEvidence" ) ConditionStageType = create_fhir_type( "ConditionStageType", "fhir.resources.STU3.condition.ConditionStage" ) ConsentType = create_fhir_type("ConsentType", "fhir.resources.STU3.consent.Consent") ConsentActorType = create_fhir_type( "ConsentActorType", "fhir.resources.STU3.consent.ConsentActor" ) ConsentDataType = create_fhir_type( "ConsentDataType", "fhir.resources.STU3.consent.ConsentData" ) ConsentExceptType = create_fhir_type( "ConsentExceptType", "fhir.resources.STU3.consent.ConsentExcept" ) ConsentExceptActorType = create_fhir_type( "ConsentExceptActorType", "fhir.resources.STU3.consent.ConsentExceptActor" ) ConsentExceptDataType = create_fhir_type( "ConsentExceptDataType", "fhir.resources.STU3.consent.ConsentExceptData" ) ConsentPolicyType = create_fhir_type( "ConsentPolicyType", "fhir.resources.STU3.consent.ConsentPolicy" ) ContactDetailType = create_fhir_type( "ContactDetailType", "fhir.resources.STU3.contactdetail.ContactDetail" ) ContactPointType = create_fhir_type( "ContactPointType", "fhir.resources.STU3.contactpoint.ContactPoint" ) ContractType = create_fhir_type( "ContractType", "fhir.resources.STU3.contract.Contract" ) ContractAgentType = create_fhir_type( "ContractAgentType", "fhir.resources.STU3.contract.ContractAgent" ) ContractFriendlyType = create_fhir_type( "ContractFriendlyType", "fhir.resources.STU3.contract.ContractFriendly" ) ContractLegalType = create_fhir_type( "ContractLegalType", "fhir.resources.STU3.contract.ContractLegal" ) ContractRuleType = create_fhir_type( "ContractRuleType", "fhir.resources.STU3.contract.ContractRule" ) ContractSignerType = create_fhir_type( "ContractSignerType", "fhir.resources.STU3.contract.ContractSigner" ) ContractTermType = create_fhir_type( "ContractTermType", "fhir.resources.STU3.contract.ContractTerm" ) ContractTermAgentType = create_fhir_type( "ContractTermAgentType", "fhir.resources.STU3.contract.ContractTermAgent" ) ContractTermValuedItemType = create_fhir_type( "ContractTermValuedItemType", "fhir.resources.STU3.contract.ContractTermValuedItem", ) ContractValuedItemType = create_fhir_type( "ContractValuedItemType", "fhir.resources.STU3.contract.ContractValuedItem" ) ContributorType = create_fhir_type( "ContributorType", "fhir.resources.STU3.contributor.Contributor" ) CountType = create_fhir_type("CountType", "fhir.resources.STU3.count.Count") CoverageType = create_fhir_type( "CoverageType", "fhir.resources.STU3.coverage.Coverage" ) CoverageGroupingType = create_fhir_type( "CoverageGroupingType", "fhir.resources.STU3.coverage.CoverageGrouping" ) DataElementType = create_fhir_type( "DataElementType", "fhir.resources.STU3.dataelement.DataElement" ) DataElementMappingType = create_fhir_type( "DataElementMappingType", "fhir.resources.STU3.dataelement.DataElementMapping" ) DataRequirementType = create_fhir_type( "DataRequirementType", "fhir.resources.STU3.datarequirement.DataRequirement" ) DataRequirementCodeFilterType = create_fhir_type( "DataRequirementCodeFilterType", "fhir.resources.STU3.datarequirement.DataRequirementCodeFilter", ) DataRequirementDateFilterType = create_fhir_type( "DataRequirementDateFilterType", "fhir.resources.STU3.datarequirement.DataRequirementDateFilter", ) DetectedIssueType = create_fhir_type( "DetectedIssueType", "fhir.resources.STU3.detectedissue.DetectedIssue" ) DetectedIssueMitigationType = create_fhir_type( "DetectedIssueMitigationType", "fhir.resources.STU3.detectedissue.DetectedIssueMitigation", ) DeviceType = create_fhir_type("DeviceType", "fhir.resources.STU3.device.Device") DeviceComponentType = create_fhir_type( "DeviceComponentType", "fhir.resources.STU3.devicecomponent.DeviceComponent" ) DeviceComponentProductionSpecificationType = create_fhir_type( "DeviceComponentProductionSpecificationType", "fhir.resources.STU3.devicecomponent.DeviceComponentProductionSpecification", ) DeviceMetricType = create_fhir_type( "DeviceMetricType", "fhir.resources.STU3.devicemetric.DeviceMetric" ) DeviceMetricCalibrationType = create_fhir_type( "DeviceMetricCalibrationType", "fhir.resources.STU3.devicemetric.DeviceMetricCalibration", ) DeviceRequestType = create_fhir_type( "DeviceRequestType", "fhir.resources.STU3.devicerequest.DeviceRequest" ) DeviceRequestRequesterType = create_fhir_type( "DeviceRequestRequesterType", "fhir.resources.STU3.devicerequest.DeviceRequestRequester", ) DeviceUdiType = create_fhir_type( "DeviceUdiType", "fhir.resources.STU3.device.DeviceUdi" ) DeviceUseStatementType = create_fhir_type( "DeviceUseStatementType", "fhir.resources.STU3.deviceusestatement.DeviceUseStatement", ) DiagnosticReportType = create_fhir_type( "DiagnosticReportType", "fhir.resources.STU3.diagnosticreport.DiagnosticReport" ) DiagnosticReportImageType = create_fhir_type( "DiagnosticReportImageType", "fhir.resources.STU3.diagnosticreport.DiagnosticReportImage", ) DiagnosticReportPerformerType = create_fhir_type( "DiagnosticReportPerformerType", "fhir.resources.STU3.diagnosticreport.DiagnosticReportPerformer", ) DistanceType = create_fhir_type( "DistanceType", "fhir.resources.STU3.distance.Distance" ) DocumentManifestType = create_fhir_type( "DocumentManifestType", "fhir.resources.STU3.documentmanifest.DocumentManifest" ) DocumentManifestContentType = create_fhir_type( "DocumentManifestContentType", "fhir.resources.STU3.documentmanifest.DocumentManifestContent", ) DocumentManifestRelatedType = create_fhir_type( "DocumentManifestRelatedType", "fhir.resources.STU3.documentmanifest.DocumentManifestRelated", ) DocumentReferenceType = create_fhir_type( "DocumentReferenceType", "fhir.resources.STU3.documentreference.DocumentReference", ) DocumentReferenceContentType = create_fhir_type( "DocumentReferenceContentType", "fhir.resources.STU3.documentreference.DocumentReferenceContent", ) DocumentReferenceContextType = create_fhir_type( "DocumentReferenceContextType", "fhir.resources.STU3.documentreference.DocumentReferenceContext", ) DocumentReferenceContextRelatedType = create_fhir_type( "DocumentReferenceContextRelatedType", "fhir.resources.STU3.documentreference.DocumentReferenceContextRelated", ) DocumentReferenceRelatesToType = create_fhir_type( "DocumentReferenceRelatesToType", "fhir.resources.STU3.documentreference.DocumentReferenceRelatesTo", ) DomainResourceType = create_fhir_type( "DomainResourceType", "fhir.resources.STU3.domainresource.DomainResource" ) DosageType = create_fhir_type("DosageType", "fhir.resources.STU3.dosage.Dosage") DurationType = create_fhir_type( "DurationType", "fhir.resources.STU3.duration.Duration" ) ElementDefinitionType = create_fhir_type( "ElementDefinitionType", "fhir.resources.STU3.elementdefinition.ElementDefinition", ) ElementDefinitionBaseType = create_fhir_type( "ElementDefinitionBaseType", "fhir.resources.STU3.elementdefinition.ElementDefinitionBase", ) ElementDefinitionBindingType = create_fhir_type( "ElementDefinitionBindingType", "fhir.resources.STU3.elementdefinition.ElementDefinitionBinding", ) ElementDefinitionConstraintType = create_fhir_type( "ElementDefinitionConstraintType", "fhir.resources.STU3.elementdefinition.ElementDefinitionConstraint", ) ElementDefinitionExampleType = create_fhir_type( "ElementDefinitionExampleType", "fhir.resources.STU3.elementdefinition.ElementDefinitionExample", ) ElementDefinitionMappingType = create_fhir_type( "ElementDefinitionMappingType", "fhir.resources.STU3.elementdefinition.ElementDefinitionMapping", ) ElementDefinitionSlicingType = create_fhir_type( "ElementDefinitionSlicingType", "fhir.resources.STU3.elementdefinition.ElementDefinitionSlicing", ) ElementDefinitionSlicingDiscriminatorType = create_fhir_type( "ElementDefinitionSlicingDiscriminatorType", "fhir.resources.STU3.elementdefinition.ElementDefinitionSlicingDiscriminator", ) ElementDefinitionTypeType = create_fhir_type( "ElementDefinitionTypeType", "fhir.resources.STU3.elementdefinition.ElementDefinitionType", ) EligibilityRequestType = create_fhir_type( "EligibilityRequestType", "fhir.resources.STU3.eligibilityrequest.EligibilityRequest", ) EligibilityResponseType = create_fhir_type( "EligibilityResponseType", "fhir.resources.STU3.eligibilityresponse.EligibilityResponse", ) EligibilityResponseErrorType = create_fhir_type( "EligibilityResponseErrorType", "fhir.resources.STU3.eligibilityresponse.EligibilityResponseError", ) EligibilityResponseInsuranceType = create_fhir_type( "EligibilityResponseInsuranceType", "fhir.resources.STU3.eligibilityresponse.EligibilityResponseInsurance", ) EligibilityResponseInsuranceBenefitBalanceType = create_fhir_type( "EligibilityResponseInsuranceBenefitBalanceType", "fhir.resources.STU3.eligibilityresponse.EligibilityResponseInsuranceBenefitBalance", ) EligibilityResponseInsuranceBenefitBalanceFinancialType = create_fhir_type( "EligibilityResponseInsuranceBenefitBalanceFinancialType", "fhir.resources.STU3.eligibilityresponse.EligibilityResponseInsuranceBenefitBalanceFinancial", ) EncounterType = create_fhir_type( "EncounterType", "fhir.resources.STU3.encounter.Encounter" ) EncounterClassHistoryType = create_fhir_type( "EncounterClassHistoryType", "fhir.resources.STU3.encounter.EncounterClassHistory", ) EncounterDiagnosisType = create_fhir_type( "EncounterDiagnosisType", "fhir.resources.STU3.encounter.EncounterDiagnosis" ) EncounterHospitalizationType = create_fhir_type( "EncounterHospitalizationType", "fhir.resources.STU3.encounter.EncounterHospitalization", ) EncounterLocationType = create_fhir_type( "EncounterLocationType", "fhir.resources.STU3.encounter.EncounterLocation" ) EncounterParticipantType = create_fhir_type( "EncounterParticipantType", "fhir.resources.STU3.encounter.EncounterParticipant" ) EncounterStatusHistoryType = create_fhir_type( "EncounterStatusHistoryType", "fhir.resources.STU3.encounter.EncounterStatusHistory", ) EndpointType = create_fhir_type( "EndpointType", "fhir.resources.STU3.endpoint.Endpoint" ) EnrollmentRequestType = create_fhir_type( "EnrollmentRequestType", "fhir.resources.STU3.enrollmentrequest.EnrollmentRequest", ) EnrollmentResponseType = create_fhir_type( "EnrollmentResponseType", "fhir.resources.STU3.enrollmentresponse.EnrollmentResponse", ) EpisodeOfCareType = create_fhir_type( "EpisodeOfCareType", "fhir.resources.STU3.episodeofcare.EpisodeOfCare" ) EpisodeOfCareDiagnosisType = create_fhir_type( "EpisodeOfCareDiagnosisType", "fhir.resources.STU3.episodeofcare.EpisodeOfCareDiagnosis", ) EpisodeOfCareStatusHistoryType = create_fhir_type( "EpisodeOfCareStatusHistoryType", "fhir.resources.STU3.episodeofcare.EpisodeOfCareStatusHistory", ) ExpansionProfileType = create_fhir_type( "ExpansionProfileType", "fhir.resources.STU3.expansionprofile.ExpansionProfile" ) ExpansionProfileDesignationType = create_fhir_type( "ExpansionProfileDesignationType", "fhir.resources.STU3.expansionprofile.ExpansionProfileDesignation", ) ExpansionProfileDesignationExcludeType = create_fhir_type( "ExpansionProfileDesignationExcludeType", "fhir.resources.STU3.expansionprofile.ExpansionProfileDesignationExclude", ) ExpansionProfileDesignationExcludeDesignationType = create_fhir_type( "ExpansionProfileDesignationExcludeDesignationType", "fhir.resources.STU3.expansionprofile.ExpansionProfileDesignationExcludeDesignation", ) ExpansionProfileDesignationIncludeType = create_fhir_type( "ExpansionProfileDesignationIncludeType", "fhir.resources.STU3.expansionprofile.ExpansionProfileDesignationInclude", ) ExpansionProfileDesignationIncludeDesignationType = create_fhir_type( "ExpansionProfileDesignationIncludeDesignationType", "fhir.resources.STU3.expansionprofile.ExpansionProfileDesignationIncludeDesignation", ) ExpansionProfileExcludedSystemType = create_fhir_type( "ExpansionProfileExcludedSystemType", "fhir.resources.STU3.expansionprofile.ExpansionProfileExcludedSystem", ) ExpansionProfileFixedVersionType = create_fhir_type( "ExpansionProfileFixedVersionType", "fhir.resources.STU3.expansionprofile.ExpansionProfileFixedVersion", ) ExplanationOfBenefitType = create_fhir_type( "ExplanationOfBenefitType", "fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefit", ) ExplanationOfBenefitAccidentType = create_fhir_type( "ExplanationOfBenefitAccidentType", "fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitAccident", ) ExplanationOfBenefitAddItemType = create_fhir_type( "ExplanationOfBenefitAddItemType", "fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitAddItem", ) ExplanationOfBenefitAddItemDetailType = create_fhir_type( "ExplanationOfBenefitAddItemDetailType", "fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitAddItemDetail", ) ExplanationOfBenefitBenefitBalanceType = create_fhir_type( "ExplanationOfBenefitBenefitBalanceType", "fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitBenefitBalance", ) ExplanationOfBenefitBenefitBalanceFinancialType = create_fhir_type( "ExplanationOfBenefitBenefitBalanceFinancialType", "fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitBenefitBalanceFinancial", ) ExplanationOfBenefitCareTeamType = create_fhir_type( "ExplanationOfBenefitCareTeamType", "fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitCareTeam", ) ExplanationOfBenefitDiagnosisType = create_fhir_type( "ExplanationOfBenefitDiagnosisType", "fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitDiagnosis", ) ExplanationOfBenefitInformationType = create_fhir_type( "ExplanationOfBenefitInformationType", "fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitInformation", ) ExplanationOfBenefitInsuranceType = create_fhir_type( "ExplanationOfBenefitInsuranceType", "fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitInsurance", ) ExplanationOfBenefitItemType = create_fhir_type( "ExplanationOfBenefitItemType", "fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitItem", ) ExplanationOfBenefitItemAdjudicationType = create_fhir_type( "ExplanationOfBenefitItemAdjudicationType", "fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitItemAdjudication", ) ExplanationOfBenefitItemDetailType = create_fhir_type( "ExplanationOfBenefitItemDetailType", "fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitItemDetail", ) ExplanationOfBenefitItemDetailSubDetailType = create_fhir_type( "ExplanationOfBenefitItemDetailSubDetailType", "fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitItemDetailSubDetail", ) ExplanationOfBenefitPayeeType = create_fhir_type( "ExplanationOfBenefitPayeeType", "fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitPayee", ) ExplanationOfBenefitPaymentType = create_fhir_type( "ExplanationOfBenefitPaymentType", "fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitPayment", ) ExplanationOfBenefitProcedureType = create_fhir_type( "ExplanationOfBenefitProcedureType", "fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitProcedure", ) ExplanationOfBenefitProcessNoteType = create_fhir_type( "ExplanationOfBenefitProcessNoteType", "fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitProcessNote", ) ExplanationOfBenefitRelatedType = create_fhir_type( "ExplanationOfBenefitRelatedType", "fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitRelated", ) ExtensionType = create_fhir_type( "ExtensionType", "fhir.resources.STU3.extension.Extension" ) FamilyMemberHistoryType = create_fhir_type( "FamilyMemberHistoryType", "fhir.resources.STU3.familymemberhistory.FamilyMemberHistory", ) FamilyMemberHistoryConditionType = create_fhir_type( "FamilyMemberHistoryConditionType", "fhir.resources.STU3.familymemberhistory.FamilyMemberHistoryCondition", ) FlagType = create_fhir_type("FlagType", "fhir.resources.STU3.flag.Flag") GoalType = create_fhir_type("GoalType", "fhir.resources.STU3.goal.Goal") GoalTargetType = create_fhir_type( "GoalTargetType", "fhir.resources.STU3.goal.GoalTarget" ) GraphDefinitionType = create_fhir_type( "GraphDefinitionType", "fhir.resources.STU3.graphdefinition.GraphDefinition" ) GraphDefinitionLinkType = create_fhir_type( "GraphDefinitionLinkType", "fhir.resources.STU3.graphdefinition.GraphDefinitionLink", ) GraphDefinitionLinkTargetType = create_fhir_type( "GraphDefinitionLinkTargetType", "fhir.resources.STU3.graphdefinition.GraphDefinitionLinkTarget", ) GraphDefinitionLinkTargetCompartmentType = create_fhir_type( "GraphDefinitionLinkTargetCompartmentType", "fhir.resources.STU3.graphdefinition.GraphDefinitionLinkTargetCompartment", ) GroupType = create_fhir_type("GroupType", "fhir.resources.STU3.group.Group") GroupCharacteristicType = create_fhir_type( "GroupCharacteristicType", "fhir.resources.STU3.group.GroupCharacteristic" ) GroupMemberType = create_fhir_type( "GroupMemberType", "fhir.resources.STU3.group.GroupMember" ) GuidanceResponseType = create_fhir_type( "GuidanceResponseType", "fhir.resources.STU3.guidanceresponse.GuidanceResponse" ) HealthcareServiceType = create_fhir_type( "HealthcareServiceType", "fhir.resources.STU3.healthcareservice.HealthcareService", ) HealthcareServiceAvailableTimeType = create_fhir_type( "HealthcareServiceAvailableTimeType", "fhir.resources.STU3.healthcareservice.HealthcareServiceAvailableTime", ) HealthcareServiceNotAvailableType = create_fhir_type( "HealthcareServiceNotAvailableType", "fhir.resources.STU3.healthcareservice.HealthcareServiceNotAvailable", ) HumanNameType = create_fhir_type( "HumanNameType", "fhir.resources.STU3.humanname.HumanName" ) IdentifierType = create_fhir_type( "IdentifierType", "fhir.resources.STU3.identifier.Identifier" ) ImagingManifestType = create_fhir_type( "ImagingManifestType", "fhir.resources.STU3.imagingmanifest.ImagingManifest" ) ImagingManifestStudyType = create_fhir_type( "ImagingManifestStudyType", "fhir.resources.STU3.imagingmanifest.ImagingManifestStudy", ) ImagingManifestStudySeriesType = create_fhir_type( "ImagingManifestStudySeriesType", "fhir.resources.STU3.imagingmanifest.ImagingManifestStudySeries", ) ImagingManifestStudySeriesInstanceType = create_fhir_type( "ImagingManifestStudySeriesInstanceType", "fhir.resources.STU3.imagingmanifest.ImagingManifestStudySeriesInstance", ) ImagingStudyType = create_fhir_type( "ImagingStudyType", "fhir.resources.STU3.imagingstudy.ImagingStudy" ) ImagingStudySeriesType = create_fhir_type( "ImagingStudySeriesType", "fhir.resources.STU3.imagingstudy.ImagingStudySeries" ) ImagingStudySeriesInstanceType = create_fhir_type( "ImagingStudySeriesInstanceType", "fhir.resources.STU3.imagingstudy.ImagingStudySeriesInstance", ) ImmunizationType = create_fhir_type( "ImmunizationType", "fhir.resources.STU3.immunization.Immunization" ) ImmunizationExplanationType = create_fhir_type( "ImmunizationExplanationType", "fhir.resources.STU3.immunization.ImmunizationExplanation", ) ImmunizationPractitionerType = create_fhir_type( "ImmunizationPractitionerType", "fhir.resources.STU3.immunization.ImmunizationPractitioner", ) ImmunizationReactionType = create_fhir_type( "ImmunizationReactionType", "fhir.resources.STU3.immunization.ImmunizationReaction", ) ImmunizationRecommendationType = create_fhir_type( "ImmunizationRecommendationType", "fhir.resources.STU3.immunizationrecommendation.ImmunizationRecommendation", ) ImmunizationRecommendationRecommendationType = create_fhir_type( "ImmunizationRecommendationRecommendationType", "fhir.resources.STU3.immunizationrecommendation.ImmunizationRecommendationRecommendation", ) ImmunizationRecommendationRecommendationDateCriterionType = create_fhir_type( "ImmunizationRecommendationRecommendationDateCriterionType", "fhir.resources.STU3.immunizationrecommendation.ImmunizationRecommendationRecommendationDateCriterion", ) ImmunizationRecommendationRecommendationProtocolType = create_fhir_type( "ImmunizationRecommendationRecommendationProtocolType", "fhir.resources.STU3.immunizationrecommendation.ImmunizationRecommendationRecommendationProtocol", ) ImmunizationVaccinationProtocolType = create_fhir_type( "ImmunizationVaccinationProtocolType", "fhir.resources.STU3.immunization.ImmunizationVaccinationProtocol", ) ImplementationGuideType = create_fhir_type( "ImplementationGuideType", "fhir.resources.STU3.implementationguide.ImplementationGuide", ) ImplementationGuideDependencyType = create_fhir_type( "ImplementationGuideDependencyType", "fhir.resources.STU3.implementationguide.ImplementationGuideDependency", ) ImplementationGuideGlobalType = create_fhir_type( "ImplementationGuideGlobalType", "fhir.resources.STU3.implementationguide.ImplementationGuideGlobal", ) ImplementationGuidePackageType = create_fhir_type( "ImplementationGuidePackageType", "fhir.resources.STU3.implementationguide.ImplementationGuidePackage", ) ImplementationGuidePackageResourceType = create_fhir_type( "ImplementationGuidePackageResourceType", "fhir.resources.STU3.implementationguide.ImplementationGuidePackageResource", ) ImplementationGuidePageType = create_fhir_type( "ImplementationGuidePageType", "fhir.resources.STU3.implementationguide.ImplementationGuidePage", ) LibraryType = create_fhir_type("LibraryType", "fhir.resources.STU3.library.Library") LinkageType = create_fhir_type("LinkageType", "fhir.resources.STU3.linkage.Linkage") LinkageItemType = create_fhir_type( "LinkageItemType", "fhir.resources.STU3.linkage.LinkageItem" ) ListType = create_fhir_type("ListType", "fhir.resources.STU3.list.List") ListEntryType = create_fhir_type( "ListEntryType", "fhir.resources.STU3.list.ListEntry" ) LocationType = create_fhir_type( "LocationType", "fhir.resources.STU3.location.Location" ) LocationPositionType = create_fhir_type( "LocationPositionType", "fhir.resources.STU3.location.LocationPosition" ) MeasureType = create_fhir_type("MeasureType", "fhir.resources.STU3.measure.Measure") MeasureGroupType = create_fhir_type( "MeasureGroupType", "fhir.resources.STU3.measure.MeasureGroup" ) MeasureGroupPopulationType = create_fhir_type( "MeasureGroupPopulationType", "fhir.resources.STU3.measure.MeasureGroupPopulation", ) MeasureGroupStratifierType = create_fhir_type( "MeasureGroupStratifierType", "fhir.resources.STU3.measure.MeasureGroupStratifier", ) MeasureReportType = create_fhir_type( "MeasureReportType", "fhir.resources.STU3.measurereport.MeasureReport" ) MeasureReportGroupType = create_fhir_type( "MeasureReportGroupType", "fhir.resources.STU3.measurereport.MeasureReportGroup" ) MeasureReportGroupPopulationType = create_fhir_type( "MeasureReportGroupPopulationType", "fhir.resources.STU3.measurereport.MeasureReportGroupPopulation", ) MeasureReportGroupStratifierType = create_fhir_type( "MeasureReportGroupStratifierType", "fhir.resources.STU3.measurereport.MeasureReportGroupStratifier", ) MeasureReportGroupStratifierStratumType = create_fhir_type( "MeasureReportGroupStratifierStratumType", "fhir.resources.STU3.measurereport.MeasureReportGroupStratifierStratum", ) MeasureReportGroupStratifierStratumPopulationType = create_fhir_type( "MeasureReportGroupStratifierStratumPopulationType", "fhir.resources.STU3.measurereport.MeasureReportGroupStratifierStratumPopulation", ) MeasureSupplementalDataType = create_fhir_type( "MeasureSupplementalDataType", "fhir.resources.STU3.measure.MeasureSupplementalData", ) MediaType = create_fhir_type("MediaType", "fhir.resources.STU3.media.Media") MedicationType = create_fhir_type( "MedicationType", "fhir.resources.STU3.medication.Medication" ) MedicationAdministrationType = create_fhir_type( "MedicationAdministrationType", "fhir.resources.STU3.medicationadministration.MedicationAdministration", ) MedicationAdministrationDosageType = create_fhir_type( "MedicationAdministrationDosageType", "fhir.resources.STU3.medicationadministration.MedicationAdministrationDosage", ) MedicationAdministrationPerformerType = create_fhir_type( "MedicationAdministrationPerformerType", "fhir.resources.STU3.medicationadministration.MedicationAdministrationPerformer", ) MedicationDispenseType = create_fhir_type( "MedicationDispenseType", "fhir.resources.STU3.medicationdispense.MedicationDispense", ) MedicationDispensePerformerType = create_fhir_type( "MedicationDispensePerformerType", "fhir.resources.STU3.medicationdispense.MedicationDispensePerformer", ) MedicationDispenseSubstitutionType = create_fhir_type( "MedicationDispenseSubstitutionType", "fhir.resources.STU3.medicationdispense.MedicationDispenseSubstitution", ) MedicationIngredientType = create_fhir_type( "MedicationIngredientType", "fhir.resources.STU3.medication.MedicationIngredient", ) MedicationPackageType = create_fhir_type( "MedicationPackageType", "fhir.resources.STU3.medication.MedicationPackage" ) MedicationPackageBatchType = create_fhir_type( "MedicationPackageBatchType", "fhir.resources.STU3.medication.MedicationPackageBatch", ) MedicationPackageContentType = create_fhir_type( "MedicationPackageContentType", "fhir.resources.STU3.medication.MedicationPackageContent", ) MedicationRequestType = create_fhir_type( "MedicationRequestType", "fhir.resources.STU3.medicationrequest.MedicationRequest", ) MedicationRequestDispenseRequestType = create_fhir_type( "MedicationRequestDispenseRequestType", "fhir.resources.STU3.medicationrequest.MedicationRequestDispenseRequest", ) MedicationRequestRequesterType = create_fhir_type( "MedicationRequestRequesterType", "fhir.resources.STU3.medicationrequest.MedicationRequestRequester", ) MedicationRequestSubstitutionType = create_fhir_type( "MedicationRequestSubstitutionType", "fhir.resources.STU3.medicationrequest.MedicationRequestSubstitution", ) MedicationStatementType = create_fhir_type( "MedicationStatementType", "fhir.resources.STU3.medicationstatement.MedicationStatement", ) MessageDefinitionType = create_fhir_type( "MessageDefinitionType", "fhir.resources.STU3.messagedefinition.MessageDefinition", ) MessageDefinitionAllowedResponseType = create_fhir_type( "MessageDefinitionAllowedResponseType", "fhir.resources.STU3.messagedefinition.MessageDefinitionAllowedResponse", ) MessageDefinitionFocusType = create_fhir_type( "MessageDefinitionFocusType", "fhir.resources.STU3.messagedefinition.MessageDefinitionFocus", ) MessageHeaderType = create_fhir_type( "MessageHeaderType", "fhir.resources.STU3.messageheader.MessageHeader" ) MessageHeaderDestinationType = create_fhir_type( "MessageHeaderDestinationType", "fhir.resources.STU3.messageheader.MessageHeaderDestination", ) MessageHeaderResponseType = create_fhir_type( "MessageHeaderResponseType", "fhir.resources.STU3.messageheader.MessageHeaderResponse", ) MessageHeaderSourceType = create_fhir_type( "MessageHeaderSourceType", "fhir.resources.STU3.messageheader.MessageHeaderSource", ) MetaType = create_fhir_type("MetaType", "fhir.resources.STU3.meta.Meta") MetadataResourceType = create_fhir_type( "MetadataResourceType", "fhir.resources.STU3.metadataresource.MetadataResource" ) MoneyType = create_fhir_type("MoneyType", "fhir.resources.STU3.money.Money") NamingSystemType = create_fhir_type( "NamingSystemType", "fhir.resources.STU3.namingsystem.NamingSystem" ) NamingSystemUniqueIdType = create_fhir_type( "NamingSystemUniqueIdType", "fhir.resources.STU3.namingsystem.NamingSystemUniqueId", ) NarrativeType = create_fhir_type( "NarrativeType", "fhir.resources.STU3.narrative.Narrative" ) NutritionOrderType = create_fhir_type( "NutritionOrderType", "fhir.resources.STU3.nutritionorder.NutritionOrder" ) NutritionOrderEnteralFormulaType = create_fhir_type( "NutritionOrderEnteralFormulaType", "fhir.resources.STU3.nutritionorder.NutritionOrderEnteralFormula", ) NutritionOrderEnteralFormulaAdministrationType = create_fhir_type( "NutritionOrderEnteralFormulaAdministrationType", "fhir.resources.STU3.nutritionorder.NutritionOrderEnteralFormulaAdministration", ) NutritionOrderOralDietType = create_fhir_type( "NutritionOrderOralDietType", "fhir.resources.STU3.nutritionorder.NutritionOrderOralDiet", ) NutritionOrderOralDietNutrientType = create_fhir_type( "NutritionOrderOralDietNutrientType", "fhir.resources.STU3.nutritionorder.NutritionOrderOralDietNutrient", ) NutritionOrderOralDietTextureType = create_fhir_type( "NutritionOrderOralDietTextureType", "fhir.resources.STU3.nutritionorder.NutritionOrderOralDietTexture", ) NutritionOrderSupplementType = create_fhir_type( "NutritionOrderSupplementType", "fhir.resources.STU3.nutritionorder.NutritionOrderSupplement", ) ObservationType = create_fhir_type( "ObservationType", "fhir.resources.STU3.observation.Observation" ) ObservationComponentType = create_fhir_type( "ObservationComponentType", "fhir.resources.STU3.observation.ObservationComponent", ) ObservationReferenceRangeType = create_fhir_type( "ObservationReferenceRangeType", "fhir.resources.STU3.observation.ObservationReferenceRange", ) ObservationRelatedType = create_fhir_type( "ObservationRelatedType", "fhir.resources.STU3.observation.ObservationRelated" ) OperationDefinitionType = create_fhir_type( "OperationDefinitionType", "fhir.resources.STU3.operationdefinition.OperationDefinition", ) OperationDefinitionOverloadType = create_fhir_type( "OperationDefinitionOverloadType", "fhir.resources.STU3.operationdefinition.OperationDefinitionOverload", ) OperationDefinitionParameterType = create_fhir_type( "OperationDefinitionParameterType", "fhir.resources.STU3.operationdefinition.OperationDefinitionParameter", ) OperationDefinitionParameterBindingType = create_fhir_type( "OperationDefinitionParameterBindingType", "fhir.resources.STU3.operationdefinition.OperationDefinitionParameterBinding", ) OperationOutcomeType = create_fhir_type( "OperationOutcomeType", "fhir.resources.STU3.operationoutcome.OperationOutcome" ) OperationOutcomeIssueType = create_fhir_type( "OperationOutcomeIssueType", "fhir.resources.STU3.operationoutcome.OperationOutcomeIssue", ) OrganizationType = create_fhir_type( "OrganizationType", "fhir.resources.STU3.organization.Organization" ) OrganizationContactType = create_fhir_type( "OrganizationContactType", "fhir.resources.STU3.organization.OrganizationContact", ) ParameterDefinitionType = create_fhir_type( "ParameterDefinitionType", "fhir.resources.STU3.parameterdefinition.ParameterDefinition", ) ParametersType = create_fhir_type( "ParametersType", "fhir.resources.STU3.parameters.Parameters" ) ParametersParameterType = create_fhir_type( "ParametersParameterType", "fhir.resources.STU3.parameters.ParametersParameter" ) PatientType = create_fhir_type("PatientType", "fhir.resources.STU3.patient.Patient") PatientAnimalType = create_fhir_type( "PatientAnimalType", "fhir.resources.STU3.patient.PatientAnimal" ) PatientCommunicationType = create_fhir_type( "PatientCommunicationType", "fhir.resources.STU3.patient.PatientCommunication" ) PatientContactType = create_fhir_type( "PatientContactType", "fhir.resources.STU3.patient.PatientContact" ) PatientLinkType = create_fhir_type( "PatientLinkType", "fhir.resources.STU3.patient.PatientLink" ) PaymentNoticeType = create_fhir_type( "PaymentNoticeType", "fhir.resources.STU3.paymentnotice.PaymentNotice" ) PaymentReconciliationType = create_fhir_type( "PaymentReconciliationType", "fhir.resources.STU3.paymentreconciliation.PaymentReconciliation", ) PaymentReconciliationDetailType = create_fhir_type( "PaymentReconciliationDetailType", "fhir.resources.STU3.paymentreconciliation.PaymentReconciliationDetail", ) PaymentReconciliationProcessNoteType = create_fhir_type( "PaymentReconciliationProcessNoteType", "fhir.resources.STU3.paymentreconciliation.PaymentReconciliationProcessNote", ) PeriodType = create_fhir_type("PeriodType", "fhir.resources.STU3.period.Period") PersonType = create_fhir_type("PersonType", "fhir.resources.STU3.person.Person") PersonLinkType = create_fhir_type( "PersonLinkType", "fhir.resources.STU3.person.PersonLink" ) PlanDefinitionType = create_fhir_type( "PlanDefinitionType", "fhir.resources.STU3.plandefinition.PlanDefinition" ) PlanDefinitionActionType = create_fhir_type( "PlanDefinitionActionType", "fhir.resources.STU3.plandefinition.PlanDefinitionAction", ) PlanDefinitionActionConditionType = create_fhir_type( "PlanDefinitionActionConditionType", "fhir.resources.STU3.plandefinition.PlanDefinitionActionCondition", ) PlanDefinitionActionDynamicValueType = create_fhir_type( "PlanDefinitionActionDynamicValueType", "fhir.resources.STU3.plandefinition.PlanDefinitionActionDynamicValue", ) PlanDefinitionActionParticipantType = create_fhir_type( "PlanDefinitionActionParticipantType", "fhir.resources.STU3.plandefinition.PlanDefinitionActionParticipant", ) PlanDefinitionActionRelatedActionType = create_fhir_type( "PlanDefinitionActionRelatedActionType", "fhir.resources.STU3.plandefinition.PlanDefinitionActionRelatedAction", ) PlanDefinitionGoalType = create_fhir_type( "PlanDefinitionGoalType", "fhir.resources.STU3.plandefinition.PlanDefinitionGoal", ) PlanDefinitionGoalTargetType = create_fhir_type( "PlanDefinitionGoalTargetType", "fhir.resources.STU3.plandefinition.PlanDefinitionGoalTarget", ) PractitionerType = create_fhir_type( "PractitionerType", "fhir.resources.STU3.practitioner.Practitioner" ) PractitionerQualificationType = create_fhir_type( "PractitionerQualificationType", "fhir.resources.STU3.practitioner.PractitionerQualification", ) PractitionerRoleType = create_fhir_type( "PractitionerRoleType", "fhir.resources.STU3.practitionerrole.PractitionerRole" ) PractitionerRoleAvailableTimeType = create_fhir_type( "PractitionerRoleAvailableTimeType", "fhir.resources.STU3.practitionerrole.PractitionerRoleAvailableTime", ) PractitionerRoleNotAvailableType = create_fhir_type( "PractitionerRoleNotAvailableType", "fhir.resources.STU3.practitionerrole.PractitionerRoleNotAvailable", ) ProcedureType = create_fhir_type( "ProcedureType", "fhir.resources.STU3.procedure.Procedure" ) ProcedureFocalDeviceType = create_fhir_type( "ProcedureFocalDeviceType", "fhir.resources.STU3.procedure.ProcedureFocalDevice" ) ProcedurePerformerType = create_fhir_type( "ProcedurePerformerType", "fhir.resources.STU3.procedure.ProcedurePerformer" ) ProcedureRequestType = create_fhir_type( "ProcedureRequestType", "fhir.resources.STU3.procedurerequest.ProcedureRequest" ) ProcedureRequestRequesterType = create_fhir_type( "ProcedureRequestRequesterType", "fhir.resources.STU3.procedurerequest.ProcedureRequestRequester", ) ProcessRequestType = create_fhir_type( "ProcessRequestType", "fhir.resources.STU3.processrequest.ProcessRequest" ) ProcessRequestItemType = create_fhir_type( "ProcessRequestItemType", "fhir.resources.STU3.processrequest.ProcessRequestItem", ) ProcessResponseType = create_fhir_type( "ProcessResponseType", "fhir.resources.STU3.processresponse.ProcessResponse" ) ProcessResponseProcessNoteType = create_fhir_type( "ProcessResponseProcessNoteType", "fhir.resources.STU3.processresponse.ProcessResponseProcessNote", ) ProvenanceType = create_fhir_type( "ProvenanceType", "fhir.resources.STU3.provenance.Provenance" ) ProvenanceAgentType = create_fhir_type( "ProvenanceAgentType", "fhir.resources.STU3.provenance.ProvenanceAgent" ) ProvenanceEntityType = create_fhir_type( "ProvenanceEntityType", "fhir.resources.STU3.provenance.ProvenanceEntity" ) QuantityType = create_fhir_type( "QuantityType", "fhir.resources.STU3.quantity.Quantity" ) QuestionnaireType = create_fhir_type( "QuestionnaireType", "fhir.resources.STU3.questionnaire.Questionnaire" ) QuestionnaireItemType = create_fhir_type( "QuestionnaireItemType", "fhir.resources.STU3.questionnaire.QuestionnaireItem" ) QuestionnaireItemEnableWhenType = create_fhir_type( "QuestionnaireItemEnableWhenType", "fhir.resources.STU3.questionnaire.QuestionnaireItemEnableWhen", ) QuestionnaireItemOptionType = create_fhir_type( "QuestionnaireItemOptionType", "fhir.resources.STU3.questionnaire.QuestionnaireItemOption", ) QuestionnaireResponseType = create_fhir_type( "QuestionnaireResponseType", "fhir.resources.STU3.questionnaireresponse.QuestionnaireResponse", ) QuestionnaireResponseItemType = create_fhir_type( "QuestionnaireResponseItemType", "fhir.resources.STU3.questionnaireresponse.QuestionnaireResponseItem", ) QuestionnaireResponseItemAnswerType = create_fhir_type( "QuestionnaireResponseItemAnswerType", "fhir.resources.STU3.questionnaireresponse.QuestionnaireResponseItemAnswer", ) RangeType = create_fhir_type("RangeType", "fhir.resources.STU3.range.Range") RatioType = create_fhir_type("RatioType", "fhir.resources.STU3.ratio.Ratio") ReferenceType = create_fhir_type( "ReferenceType", "fhir.resources.STU3.reference.Reference" ) ReferralRequestType = create_fhir_type( "ReferralRequestType", "fhir.resources.STU3.referralrequest.ReferralRequest" ) ReferralRequestRequesterType = create_fhir_type( "ReferralRequestRequesterType", "fhir.resources.STU3.referralrequest.ReferralRequestRequester", ) RelatedArtifactType = create_fhir_type( "RelatedArtifactType", "fhir.resources.STU3.relatedartifact.RelatedArtifact" ) RelatedPersonType = create_fhir_type( "RelatedPersonType", "fhir.resources.STU3.relatedperson.RelatedPerson" ) RequestGroupType = create_fhir_type( "RequestGroupType", "fhir.resources.STU3.requestgroup.RequestGroup" ) RequestGroupActionType = create_fhir_type( "RequestGroupActionType", "fhir.resources.STU3.requestgroup.RequestGroupAction" ) RequestGroupActionConditionType = create_fhir_type( "RequestGroupActionConditionType", "fhir.resources.STU3.requestgroup.RequestGroupActionCondition", ) RequestGroupActionRelatedActionType = create_fhir_type( "RequestGroupActionRelatedActionType", "fhir.resources.STU3.requestgroup.RequestGroupActionRelatedAction", ) ResearchStudyType = create_fhir_type( "ResearchStudyType", "fhir.resources.STU3.researchstudy.ResearchStudy" ) ResearchStudyArmType = create_fhir_type( "ResearchStudyArmType", "fhir.resources.STU3.researchstudy.ResearchStudyArm" ) ResearchSubjectType = create_fhir_type( "ResearchSubjectType", "fhir.resources.STU3.researchsubject.ResearchSubject" ) RiskAssessmentType = create_fhir_type( "RiskAssessmentType", "fhir.resources.STU3.riskassessment.RiskAssessment" ) RiskAssessmentPredictionType = create_fhir_type( "RiskAssessmentPredictionType", "fhir.resources.STU3.riskassessment.RiskAssessmentPrediction", ) SampledDataType = create_fhir_type( "SampledDataType", "fhir.resources.STU3.sampleddata.SampledData" ) ScheduleType = create_fhir_type( "ScheduleType", "fhir.resources.STU3.schedule.Schedule" ) SearchParameterType = create_fhir_type( "SearchParameterType", "fhir.resources.STU3.searchparameter.SearchParameter" ) SearchParameterComponentType = create_fhir_type( "SearchParameterComponentType", "fhir.resources.STU3.searchparameter.SearchParameterComponent", ) SequenceType = create_fhir_type( "SequenceType", "fhir.resources.STU3.sequence.Sequence" ) SequenceQualityType = create_fhir_type( "SequenceQualityType", "fhir.resources.STU3.sequence.SequenceQuality" ) SequenceReferenceSeqType = create_fhir_type( "SequenceReferenceSeqType", "fhir.resources.STU3.sequence.SequenceReferenceSeq" ) SequenceRepositoryType = create_fhir_type( "SequenceRepositoryType", "fhir.resources.STU3.sequence.SequenceRepository" ) SequenceVariantType = create_fhir_type( "SequenceVariantType", "fhir.resources.STU3.sequence.SequenceVariant" ) ServiceDefinitionType = create_fhir_type( "ServiceDefinitionType", "fhir.resources.STU3.servicedefinition.ServiceDefinition", ) SignatureType = create_fhir_type( "SignatureType", "fhir.resources.STU3.signature.Signature" ) SlotType = create_fhir_type("SlotType", "fhir.resources.STU3.slot.Slot") SpecimenType = create_fhir_type( "SpecimenType", "fhir.resources.STU3.specimen.Specimen" ) SpecimenCollectionType = create_fhir_type( "SpecimenCollectionType", "fhir.resources.STU3.specimen.SpecimenCollection" ) SpecimenContainerType = create_fhir_type( "SpecimenContainerType", "fhir.resources.STU3.specimen.SpecimenContainer" ) SpecimenProcessingType = create_fhir_type( "SpecimenProcessingType", "fhir.resources.STU3.specimen.SpecimenProcessing" ) StructureDefinitionType = create_fhir_type( "StructureDefinitionType", "fhir.resources.STU3.structuredefinition.StructureDefinition", ) StructureDefinitionDifferentialType = create_fhir_type( "StructureDefinitionDifferentialType", "fhir.resources.STU3.structuredefinition.StructureDefinitionDifferential", ) StructureDefinitionMappingType = create_fhir_type( "StructureDefinitionMappingType", "fhir.resources.STU3.structuredefinition.StructureDefinitionMapping", ) StructureDefinitionSnapshotType = create_fhir_type( "StructureDefinitionSnapshotType", "fhir.resources.STU3.structuredefinition.StructureDefinitionSnapshot", ) StructureMapType = create_fhir_type( "StructureMapType", "fhir.resources.STU3.structuremap.StructureMap" ) StructureMapGroupType = create_fhir_type( "StructureMapGroupType", "fhir.resources.STU3.structuremap.StructureMapGroup" ) StructureMapGroupInputType = create_fhir_type( "StructureMapGroupInputType", "fhir.resources.STU3.structuremap.StructureMapGroupInput", ) StructureMapGroupRuleType = create_fhir_type( "StructureMapGroupRuleType", "fhir.resources.STU3.structuremap.StructureMapGroupRule", ) StructureMapGroupRuleDependentType = create_fhir_type( "StructureMapGroupRuleDependentType", "fhir.resources.STU3.structuremap.StructureMapGroupRuleDependent", ) StructureMapGroupRuleSourceType = create_fhir_type( "StructureMapGroupRuleSourceType", "fhir.resources.STU3.structuremap.StructureMapGroupRuleSource", ) StructureMapGroupRuleTargetType = create_fhir_type( "StructureMapGroupRuleTargetType", "fhir.resources.STU3.structuremap.StructureMapGroupRuleTarget", ) StructureMapGroupRuleTargetParameterType = create_fhir_type( "StructureMapGroupRuleTargetParameterType", "fhir.resources.STU3.structuremap.StructureMapGroupRuleTargetParameter", ) StructureMapStructureType = create_fhir_type( "StructureMapStructureType", "fhir.resources.STU3.structuremap.StructureMapStructure", ) SubscriptionType = create_fhir_type( "SubscriptionType", "fhir.resources.STU3.subscription.Subscription" ) SubscriptionChannelType = create_fhir_type( "SubscriptionChannelType", "fhir.resources.STU3.subscription.SubscriptionChannel", ) SubstanceType = create_fhir_type( "SubstanceType", "fhir.resources.STU3.substance.Substance" ) SubstanceIngredientType = create_fhir_type( "SubstanceIngredientType", "fhir.resources.STU3.substance.SubstanceIngredient" ) SubstanceInstanceType = create_fhir_type( "SubstanceInstanceType", "fhir.resources.STU3.substance.SubstanceInstance" ) SupplyDeliveryType = create_fhir_type( "SupplyDeliveryType", "fhir.resources.STU3.supplydelivery.SupplyDelivery" ) SupplyDeliverySuppliedItemType = create_fhir_type( "SupplyDeliverySuppliedItemType", "fhir.resources.STU3.supplydelivery.SupplyDeliverySuppliedItem", ) SupplyRequestType = create_fhir_type( "SupplyRequestType", "fhir.resources.STU3.supplyrequest.SupplyRequest" ) SupplyRequestOrderedItemType = create_fhir_type( "SupplyRequestOrderedItemType", "fhir.resources.STU3.supplyrequest.SupplyRequestOrderedItem", ) SupplyRequestRequesterType = create_fhir_type( "SupplyRequestRequesterType", "fhir.resources.STU3.supplyrequest.SupplyRequestRequester", ) TaskType = create_fhir_type("TaskType", "fhir.resources.STU3.task.Task") TaskInputType = create_fhir_type( "TaskInputType", "fhir.resources.STU3.task.TaskInput" ) TaskOutputType = create_fhir_type( "TaskOutputType", "fhir.resources.STU3.task.TaskOutput" ) TaskRequesterType = create_fhir_type( "TaskRequesterType", "fhir.resources.STU3.task.TaskRequester" ) TaskRestrictionType = create_fhir_type( "TaskRestrictionType", "fhir.resources.STU3.task.TaskRestriction" ) TestReportType = create_fhir_type( "TestReportType", "fhir.resources.STU3.testreport.TestReport" ) TestReportParticipantType = create_fhir_type( "TestReportParticipantType", "fhir.resources.STU3.testreport.TestReportParticipant", ) TestReportSetupType = create_fhir_type( "TestReportSetupType", "fhir.resources.STU3.testreport.TestReportSetup" ) TestReportSetupActionType = create_fhir_type( "TestReportSetupActionType", "fhir.resources.STU3.testreport.TestReportSetupAction", ) TestReportSetupActionAssertType = create_fhir_type( "TestReportSetupActionAssertType", "fhir.resources.STU3.testreport.TestReportSetupActionAssert", ) TestReportSetupActionOperationType = create_fhir_type( "TestReportSetupActionOperationType", "fhir.resources.STU3.testreport.TestReportSetupActionOperation", ) TestReportTeardownType = create_fhir_type( "TestReportTeardownType", "fhir.resources.STU3.testreport.TestReportTeardown" ) TestReportTeardownActionType = create_fhir_type( "TestReportTeardownActionType", "fhir.resources.STU3.testreport.TestReportTeardownAction", ) TestReportTestType = create_fhir_type( "TestReportTestType", "fhir.resources.STU3.testreport.TestReportTest" ) TestReportTestActionType = create_fhir_type( "TestReportTestActionType", "fhir.resources.STU3.testreport.TestReportTestAction", ) TestScriptType = create_fhir_type( "TestScriptType", "fhir.resources.STU3.testscript.TestScript" ) TestScriptDestinationType = create_fhir_type( "TestScriptDestinationType", "fhir.resources.STU3.testscript.TestScriptDestination", ) TestScriptFixtureType = create_fhir_type( "TestScriptFixtureType", "fhir.resources.STU3.testscript.TestScriptFixture" ) TestScriptMetadataType = create_fhir_type( "TestScriptMetadataType", "fhir.resources.STU3.testscript.TestScriptMetadata" ) TestScriptMetadataCapabilityType = create_fhir_type( "TestScriptMetadataCapabilityType", "fhir.resources.STU3.testscript.TestScriptMetadataCapability", ) TestScriptMetadataLinkType = create_fhir_type( "TestScriptMetadataLinkType", "fhir.resources.STU3.testscript.TestScriptMetadataLink", ) TestScriptOriginType = create_fhir_type( "TestScriptOriginType", "fhir.resources.STU3.testscript.TestScriptOrigin" ) TestScriptRuleType = create_fhir_type( "TestScriptRuleType", "fhir.resources.STU3.testscript.TestScriptRule" ) TestScriptRuleParamType = create_fhir_type( "TestScriptRuleParamType", "fhir.resources.STU3.testscript.TestScriptRuleParam" ) TestScriptRulesetType = create_fhir_type( "TestScriptRulesetType", "fhir.resources.STU3.testscript.TestScriptRuleset" ) TestScriptRulesetRuleType = create_fhir_type( "TestScriptRulesetRuleType", "fhir.resources.STU3.testscript.TestScriptRulesetRule", ) TestScriptRulesetRuleParamType = create_fhir_type( "TestScriptRulesetRuleParamType", "fhir.resources.STU3.testscript.TestScriptRulesetRuleParam", ) TestScriptSetupType = create_fhir_type( "TestScriptSetupType", "fhir.resources.STU3.testscript.TestScriptSetup" ) TestScriptSetupActionType = create_fhir_type( "TestScriptSetupActionType", "fhir.resources.STU3.testscript.TestScriptSetupAction", ) TestScriptSetupActionAssertType = create_fhir_type( "TestScriptSetupActionAssertType", "fhir.resources.STU3.testscript.TestScriptSetupActionAssert", ) TestScriptSetupActionAssertRuleType = create_fhir_type( "TestScriptSetupActionAssertRuleType", "fhir.resources.STU3.testscript.TestScriptSetupActionAssertRule", ) TestScriptSetupActionAssertRuleParamType = create_fhir_type( "TestScriptSetupActionAssertRuleParamType", "fhir.resources.STU3.testscript.TestScriptSetupActionAssertRuleParam", ) TestScriptSetupActionAssertRulesetType = create_fhir_type( "TestScriptSetupActionAssertRulesetType", "fhir.resources.STU3.testscript.TestScriptSetupActionAssertRuleset", ) TestScriptSetupActionAssertRulesetRuleType = create_fhir_type( "TestScriptSetupActionAssertRulesetRuleType", "fhir.resources.STU3.testscript.TestScriptSetupActionAssertRulesetRule", ) TestScriptSetupActionAssertRulesetRuleParamType = create_fhir_type( "TestScriptSetupActionAssertRulesetRuleParamType", "fhir.resources.STU3.testscript.TestScriptSetupActionAssertRulesetRuleParam", ) TestScriptSetupActionOperationType = create_fhir_type( "TestScriptSetupActionOperationType", "fhir.resources.STU3.testscript.TestScriptSetupActionOperation", ) TestScriptSetupActionOperationRequestHeaderType = create_fhir_type( "TestScriptSetupActionOperationRequestHeaderType", "fhir.resources.STU3.testscript.TestScriptSetupActionOperationRequestHeader", ) TestScriptTeardownType = create_fhir_type( "TestScriptTeardownType", "fhir.resources.STU3.testscript.TestScriptTeardown" ) TestScriptTeardownActionType = create_fhir_type( "TestScriptTeardownActionType", "fhir.resources.STU3.testscript.TestScriptTeardownAction", ) TestScriptTestType = create_fhir_type( "TestScriptTestType", "fhir.resources.STU3.testscript.TestScriptTest" ) TestScriptTestActionType = create_fhir_type( "TestScriptTestActionType", "fhir.resources.STU3.testscript.TestScriptTestAction", ) TestScriptVariableType = create_fhir_type( "TestScriptVariableType", "fhir.resources.STU3.testscript.TestScriptVariable" ) TimingType = create_fhir_type("TimingType", "fhir.resources.STU3.timing.Timing") TimingRepeatType = create_fhir_type( "TimingRepeatType", "fhir.resources.STU3.timing.TimingRepeat" ) TriggerDefinitionType = create_fhir_type( "TriggerDefinitionType", "fhir.resources.STU3.triggerdefinition.TriggerDefinition", ) UsageContextType = create_fhir_type( "UsageContextType", "fhir.resources.STU3.usagecontext.UsageContext" ) ValueSetType = create_fhir_type( "ValueSetType", "fhir.resources.STU3.valueset.ValueSet" ) ValueSetComposeType = create_fhir_type( "ValueSetComposeType", "fhir.resources.STU3.valueset.ValueSetCompose" ) ValueSetComposeIncludeType = create_fhir_type( "ValueSetComposeIncludeType", "fhir.resources.STU3.valueset.ValueSetComposeInclude", ) ValueSetComposeIncludeConceptType = create_fhir_type( "ValueSetComposeIncludeConceptType", "fhir.resources.STU3.valueset.ValueSetComposeIncludeConcept", ) ValueSetComposeIncludeConceptDesignationType = create_fhir_type( "ValueSetComposeIncludeConceptDesignationType", "fhir.resources.STU3.valueset.ValueSetComposeIncludeConceptDesignation", ) ValueSetComposeIncludeFilterType = create_fhir_type( "ValueSetComposeIncludeFilterType", "fhir.resources.STU3.valueset.ValueSetComposeIncludeFilter", ) ValueSetExpansionType = create_fhir_type( "ValueSetExpansionType", "fhir.resources.STU3.valueset.ValueSetExpansion" ) ValueSetExpansionContainsType = create_fhir_type( "ValueSetExpansionContainsType", "fhir.resources.STU3.valueset.ValueSetExpansionContains", ) ValueSetExpansionParameterType = create_fhir_type( "ValueSetExpansionParameterType", "fhir.resources.STU3.valueset.ValueSetExpansionParameter", ) VisionPrescriptionType = create_fhir_type( "VisionPrescriptionType", "fhir.resources.STU3.visionprescription.VisionPrescription", ) VisionPrescriptionDispenseType = create_fhir_type( "VisionPrescriptionDispenseType", "fhir.resources.STU3.visionprescription.VisionPrescriptionDispense", ) __all__ = [ "BooleanType", "StringType", "Base64BinaryType", "CodeType", "IdType", "IntegerType", "Integer64Type", "DecimalType", "UnsignedIntType", "PositiveIntType", "CanonicalType", "UriType", "OidType", "UuidType", "UrlType", "MarkdownType", "XhtmlType", "DateType", "DateTimeType", "InstantType", "TimeType", "FHIRPrimitiveExtensionType", "AccountType", "AccountCoverageType", "AccountGuarantorType", "ActivityDefinitionType", "ActivityDefinitionDynamicValueType", "ActivityDefinitionParticipantType", "AddressType", "AdverseEventType", "AdverseEventSuspectEntityType", "AgeType", "AllergyIntoleranceType", "AllergyIntoleranceReactionType", "AnnotationType", "AppointmentType", "AppointmentParticipantType", "AppointmentResponseType", "AttachmentType", "AuditEventType", "AuditEventAgentType", "AuditEventAgentNetworkType", "AuditEventEntityType", "AuditEventEntityDetailType", "AuditEventSourceType", "BackboneElementType", "BasicType", "BinaryType", "BodySiteType", "BundleType", "BundleEntryType", "BundleEntryRequestType", "BundleEntryResponseType", "BundleEntrySearchType", "BundleLinkType", "CapabilityStatementType", "CapabilityStatementDocumentType", "CapabilityStatementImplementationType", "CapabilityStatementMessagingType", "CapabilityStatementMessagingEndpointType", "CapabilityStatementMessagingEventType", "CapabilityStatementMessagingSupportedMessageType", "CapabilityStatementRestType", "CapabilityStatementRestInteractionType", "CapabilityStatementRestOperationType", "CapabilityStatementRestResourceType", "CapabilityStatementRestResourceInteractionType", "CapabilityStatementRestResourceSearchParamType", "CapabilityStatementRestSecurityType", "CapabilityStatementRestSecurityCertificateType", "CapabilityStatementSoftwareType", "CarePlanType", "CarePlanActivityType", "CarePlanActivityDetailType", "CareTeamType", "CareTeamParticipantType", "ChargeItemType", "ChargeItemParticipantType", "ClaimType", "ClaimAccidentType", "ClaimCareTeamType", "ClaimDiagnosisType", "ClaimInformationType", "ClaimInsuranceType", "ClaimItemType", "ClaimItemDetailType", "ClaimItemDetailSubDetailType", "ClaimPayeeType", "ClaimProcedureType", "ClaimRelatedType", "ClaimResponseType", "ClaimResponseAddItemType", "ClaimResponseAddItemDetailType", "ClaimResponseErrorType", "ClaimResponseInsuranceType", "ClaimResponseItemType", "ClaimResponseItemAdjudicationType", "ClaimResponseItemDetailType", "ClaimResponseItemDetailSubDetailType", "ClaimResponsePaymentType", "ClaimResponseProcessNoteType", "ClinicalImpressionType", "ClinicalImpressionFindingType", "ClinicalImpressionInvestigationType", "CodeSystemType", "CodeSystemConceptType", "CodeSystemConceptDesignationType", "CodeSystemConceptPropertyType", "CodeSystemFilterType", "CodeSystemPropertyType", "CodeableConceptType", "CodingType", "CommunicationType", "CommunicationPayloadType", "CommunicationRequestType", "CommunicationRequestPayloadType", "CommunicationRequestRequesterType", "CompartmentDefinitionType", "CompartmentDefinitionResourceType", "CompositionType", "CompositionAttesterType", "CompositionEventType", "CompositionRelatesToType", "CompositionSectionType", "ConceptMapType", "ConceptMapGroupType", "ConceptMapGroupElementType", "ConceptMapGroupElementTargetType", "ConceptMapGroupElementTargetDependsOnType", "ConceptMapGroupUnmappedType", "ConditionType", "ConditionEvidenceType", "ConditionStageType", "ConsentType", "ConsentActorType", "ConsentDataType", "ConsentExceptType", "ConsentExceptActorType", "ConsentExceptDataType", "ConsentPolicyType", "ContactDetailType", "ContactPointType", "ContractType", "ContractAgentType", "ContractFriendlyType", "ContractLegalType", "ContractRuleType", "ContractSignerType", "ContractTermType", "ContractTermAgentType", "ContractTermValuedItemType", "ContractValuedItemType", "ContributorType", "CountType", "CoverageType", "CoverageGroupingType", "DataElementType", "DataElementMappingType", "DataRequirementType", "DataRequirementCodeFilterType", "DataRequirementDateFilterType", "DetectedIssueType", "DetectedIssueMitigationType", "DeviceType", "DeviceComponentType", "DeviceComponentProductionSpecificationType", "DeviceMetricType", "DeviceMetricCalibrationType", "DeviceRequestType", "DeviceRequestRequesterType", "DeviceUdiType", "DeviceUseStatementType", "DiagnosticReportType", "DiagnosticReportImageType", "DiagnosticReportPerformerType", "DistanceType", "DocumentManifestType", "DocumentManifestContentType", "DocumentManifestRelatedType", "DocumentReferenceType", "DocumentReferenceContentType", "DocumentReferenceContextType", "DocumentReferenceContextRelatedType", "DocumentReferenceRelatesToType", "DomainResourceType", "DosageType", "DurationType", "ElementType", "ElementDefinitionType", "ElementDefinitionBaseType", "ElementDefinitionBindingType", "ElementDefinitionConstraintType", "ElementDefinitionExampleType", "ElementDefinitionMappingType", "ElementDefinitionSlicingType", "ElementDefinitionSlicingDiscriminatorType", "ElementDefinitionTypeType", "EligibilityRequestType", "EligibilityResponseType", "EligibilityResponseErrorType", "EligibilityResponseInsuranceType", "EligibilityResponseInsuranceBenefitBalanceType", "EligibilityResponseInsuranceBenefitBalanceFinancialType", "EncounterType", "EncounterClassHistoryType", "EncounterDiagnosisType", "EncounterHospitalizationType", "EncounterLocationType", "EncounterParticipantType", "EncounterStatusHistoryType", "EndpointType", "EnrollmentRequestType", "EnrollmentResponseType", "EpisodeOfCareType", "EpisodeOfCareDiagnosisType", "EpisodeOfCareStatusHistoryType", "ExpansionProfileType", "ExpansionProfileDesignationType", "ExpansionProfileDesignationExcludeType", "ExpansionProfileDesignationExcludeDesignationType", "ExpansionProfileDesignationIncludeType", "ExpansionProfileDesignationIncludeDesignationType", "ExpansionProfileExcludedSystemType", "ExpansionProfileFixedVersionType", "ExplanationOfBenefitType", "ExplanationOfBenefitAccidentType", "ExplanationOfBenefitAddItemType", "ExplanationOfBenefitAddItemDetailType", "ExplanationOfBenefitBenefitBalanceType", "ExplanationOfBenefitBenefitBalanceFinancialType", "ExplanationOfBenefitCareTeamType", "ExplanationOfBenefitDiagnosisType", "ExplanationOfBenefitInformationType", "ExplanationOfBenefitInsuranceType", "ExplanationOfBenefitItemType", "ExplanationOfBenefitItemAdjudicationType", "ExplanationOfBenefitItemDetailType", "ExplanationOfBenefitItemDetailSubDetailType", "ExplanationOfBenefitPayeeType", "ExplanationOfBenefitPaymentType", "ExplanationOfBenefitProcedureType", "ExplanationOfBenefitProcessNoteType", "ExplanationOfBenefitRelatedType", "ExtensionType", "FamilyMemberHistoryType", "FamilyMemberHistoryConditionType", "FlagType", "GoalType", "GoalTargetType", "GraphDefinitionType", "GraphDefinitionLinkType", "GraphDefinitionLinkTargetType", "GraphDefinitionLinkTargetCompartmentType", "GroupType", "GroupCharacteristicType", "GroupMemberType", "GuidanceResponseType", "HealthcareServiceType", "HealthcareServiceAvailableTimeType", "HealthcareServiceNotAvailableType", "HumanNameType", "IdentifierType", "ImagingManifestType", "ImagingManifestStudyType", "ImagingManifestStudySeriesType", "ImagingManifestStudySeriesInstanceType", "ImagingStudyType", "ImagingStudySeriesType", "ImagingStudySeriesInstanceType", "ImmunizationType", "ImmunizationExplanationType", "ImmunizationPractitionerType", "ImmunizationReactionType", "ImmunizationRecommendationType", "ImmunizationRecommendationRecommendationType", "ImmunizationRecommendationRecommendationDateCriterionType", "ImmunizationRecommendationRecommendationProtocolType", "ImmunizationVaccinationProtocolType", "ImplementationGuideType", "ImplementationGuideDependencyType", "ImplementationGuideGlobalType", "ImplementationGuidePackageType", "ImplementationGuidePackageResourceType", "ImplementationGuidePageType", "LibraryType", "LinkageType", "LinkageItemType", "ListType", "ListEntryType", "LocationType", "LocationPositionType", "MeasureType", "MeasureGroupType", "MeasureGroupPopulationType", "MeasureGroupStratifierType", "MeasureReportType", "MeasureReportGroupType", "MeasureReportGroupPopulationType", "MeasureReportGroupStratifierType", "MeasureReportGroupStratifierStratumType", "MeasureReportGroupStratifierStratumPopulationType", "MeasureSupplementalDataType", "MediaType", "MedicationType", "MedicationAdministrationType", "MedicationAdministrationDosageType", "MedicationAdministrationPerformerType", "MedicationDispenseType", "MedicationDispensePerformerType", "MedicationDispenseSubstitutionType", "MedicationIngredientType", "MedicationPackageType", "MedicationPackageBatchType", "MedicationPackageContentType", "MedicationRequestType", "MedicationRequestDispenseRequestType", "MedicationRequestRequesterType", "MedicationRequestSubstitutionType", "MedicationStatementType", "MessageDefinitionType", "MessageDefinitionAllowedResponseType", "MessageDefinitionFocusType", "MessageHeaderType", "MessageHeaderDestinationType", "MessageHeaderResponseType", "MessageHeaderSourceType", "MetaType", "MetadataResourceType", "MoneyType", "NamingSystemType", "NamingSystemUniqueIdType", "NarrativeType", "NutritionOrderType", "NutritionOrderEnteralFormulaType", "NutritionOrderEnteralFormulaAdministrationType", "NutritionOrderOralDietType", "NutritionOrderOralDietNutrientType", "NutritionOrderOralDietTextureType", "NutritionOrderSupplementType", "ObservationType", "ObservationComponentType", "ObservationReferenceRangeType", "ObservationRelatedType", "OperationDefinitionType", "OperationDefinitionOverloadType", "OperationDefinitionParameterType", "OperationDefinitionParameterBindingType", "OperationOutcomeType", "OperationOutcomeIssueType", "OrganizationType", "OrganizationContactType", "ParameterDefinitionType", "ParametersType", "ParametersParameterType", "PatientType", "PatientAnimalType", "PatientCommunicationType", "PatientContactType", "PatientLinkType", "PaymentNoticeType", "PaymentReconciliationType", "PaymentReconciliationDetailType", "PaymentReconciliationProcessNoteType", "PeriodType", "PersonType", "PersonLinkType", "PlanDefinitionType", "PlanDefinitionActionType", "PlanDefinitionActionConditionType", "PlanDefinitionActionDynamicValueType", "PlanDefinitionActionParticipantType", "PlanDefinitionActionRelatedActionType", "PlanDefinitionGoalType", "PlanDefinitionGoalTargetType", "PractitionerType", "PractitionerQualificationType", "PractitionerRoleType", "PractitionerRoleAvailableTimeType", "PractitionerRoleNotAvailableType", "ProcedureType", "ProcedureFocalDeviceType", "ProcedurePerformerType", "ProcedureRequestType", "ProcedureRequestRequesterType", "ProcessRequestType", "ProcessRequestItemType", "ProcessResponseType", "ProcessResponseProcessNoteType", "ProvenanceType", "ProvenanceAgentType", "ProvenanceEntityType", "QuantityType", "QuestionnaireType", "QuestionnaireItemType", "QuestionnaireItemEnableWhenType", "QuestionnaireItemOptionType", "QuestionnaireResponseType", "QuestionnaireResponseItemType", "QuestionnaireResponseItemAnswerType", "RangeType", "RatioType", "ReferenceType", "ReferralRequestType", "ReferralRequestRequesterType", "RelatedArtifactType", "RelatedPersonType", "RequestGroupType", "RequestGroupActionType", "RequestGroupActionConditionType", "RequestGroupActionRelatedActionType", "ResearchStudyType", "ResearchStudyArmType", "ResearchSubjectType", "ResourceType", "RiskAssessmentType", "RiskAssessmentPredictionType", "SampledDataType", "ScheduleType", "SearchParameterType", "SearchParameterComponentType", "SequenceType", "SequenceQualityType", "SequenceReferenceSeqType", "SequenceRepositoryType", "SequenceVariantType", "ServiceDefinitionType", "SignatureType", "SlotType", "SpecimenType", "SpecimenCollectionType", "SpecimenContainerType", "SpecimenProcessingType", "StructureDefinitionType", "StructureDefinitionDifferentialType", "StructureDefinitionMappingType", "StructureDefinitionSnapshotType", "StructureMapType", "StructureMapGroupType", "StructureMapGroupInputType", "StructureMapGroupRuleType", "StructureMapGroupRuleDependentType", "StructureMapGroupRuleSourceType", "StructureMapGroupRuleTargetType", "StructureMapGroupRuleTargetParameterType", "StructureMapStructureType", "SubscriptionType", "SubscriptionChannelType", "SubstanceType", "SubstanceIngredientType", "SubstanceInstanceType", "SupplyDeliveryType", "SupplyDeliverySuppliedItemType", "SupplyRequestType", "SupplyRequestOrderedItemType", "SupplyRequestRequesterType", "TaskType", "TaskInputType", "TaskOutputType", "TaskRequesterType", "TaskRestrictionType", "TestReportType", "TestReportParticipantType", "TestReportSetupType", "TestReportSetupActionType", "TestReportSetupActionAssertType", "TestReportSetupActionOperationType", "TestReportTeardownType", "TestReportTeardownActionType", "TestReportTestType", "TestReportTestActionType", "TestScriptType", "TestScriptDestinationType", "TestScriptFixtureType", "TestScriptMetadataType", "TestScriptMetadataCapabilityType", "TestScriptMetadataLinkType", "TestScriptOriginType", "TestScriptRuleType", "TestScriptRuleParamType", "TestScriptRulesetType", "TestScriptRulesetRuleType", "TestScriptRulesetRuleParamType", "TestScriptSetupType", "TestScriptSetupActionType", "TestScriptSetupActionAssertType", "TestScriptSetupActionAssertRuleType", "TestScriptSetupActionAssertRuleParamType", "TestScriptSetupActionAssertRulesetType", "TestScriptSetupActionAssertRulesetRuleType", "TestScriptSetupActionAssertRulesetRuleParamType", "TestScriptSetupActionOperationType", "TestScriptSetupActionOperationRequestHeaderType", "TestScriptTeardownType", "TestScriptTeardownActionType", "TestScriptTestType", "TestScriptTestActionType", "TestScriptVariableType", "TimingType", "TimingRepeatType", "TriggerDefinitionType", "UsageContextType", "ValueSetType", "ValueSetComposeType", "ValueSetComposeIncludeType", "ValueSetComposeIncludeConceptType", "ValueSetComposeIncludeConceptDesignationType", "ValueSetComposeIncludeFilterType", "ValueSetExpansionType", "ValueSetExpansionContainsType", "ValueSetExpansionParameterType", "VisionPrescriptionType", "VisionPrescriptionDispenseType", ] ================================================ FILE: fhir/resources/STU3/flag.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Flag Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class Flag(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Key information to flag to healthcare providers. Prospective warnings of potential issues when providing care to the patient. """ __resource_type__ = "Flag" author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="Flag creator", description="The person, organization or device that created the flag.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Organization", "Patient", "Practitioner", ], }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Clinical, administrative, etc.", description=( "Allows an flag to be divided into different categories like clinical, " "administrative etc. Intended to be used as a means of filtering which " "flags are displayed to particular user or in a given context." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Coded or textual message to display to user", description=( "The coded value or textual component of the flag to display to the " "user." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Alert relevant during encounter", description="This alert is only relevant during the encounter.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description=( "Identifier assigned to the flag for external use (outside the FHIR " "environment)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period when flag is active", description=( "The period of time from the activation of the flag to inactivation of " "the flag. If the flag is active, the end of the period should be " "unspecified." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | inactive | entered-in-error", description="Supports basic workflow.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "inactive", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who/What is flag about?", description=( "The patient, location, group , organization , or practitioner, etc. " "this is about record this flag is associated with." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Location", "Group", "Organization", "Practitioner", "PlanDefinition", "Medication", "Procedure", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Flag`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "category", "code", "subject", "period", "encounter", "author", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Flag`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "category", "code", "subject", "period", "encounter", "author", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/goal.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Goal Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Goal(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Describes the intended objective(s) for a patient, group or organization. Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc. """ __resource_type__ = "Goal" addresses: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="addresses", title="Issues addressed by this goal", description=( "The identified conditions and other health record elements that are " "intended to be addressed by the goal." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "MedicationStatement", "NutritionOrder", "ProcedureRequest", "RiskAssessment", ], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="E.g. Treatment, dietary, behavioral, etc.", description="Indicates a category the goal falls within.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.CodeableConceptType = Field( default=..., alias="description", title="Code or text describing goal", description=( "Human-readable and/or coded description of a specific desired " 'objective of care, such as "control blood pressure" or "negotiate an ' 'obstacle course" or "dance with child at wedding".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) expressedBy: fhirtypes.ReferenceType | None = Field( default=None, alias="expressedBy", title="Who's responsible for creating Goal?", description="Indicates whose goal this is - patient goal, practitioner goal, etc.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Practitioner", "RelatedPerson"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Ids for this goal", description=( "This records identifiers associated with this care plan that are " "defined by business processes and/or used to refer to it when a direct" " URL reference to the resource itself is not appropriate (e.g. in CDA " "documents, or in written / printed documentation)." ), json_schema_extra={ "element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments about the goal", description="Any comments related to the goal.", json_schema_extra={ "element_property": True, }, ) outcomeCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="outcomeCode", title="What result was achieved regarding the goal?", description=( "Identifies the change (or lack of change) at the point when the status" " of the goal is assessed." ), json_schema_extra={ "element_property": True, }, ) outcomeReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="outcomeReference", title="Observation that resulted from goal", description="Details of what's changed (or not changed).", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Observation"], }, ) priority: fhirtypes.CodeableConceptType | None = Field( default=None, alias="priority", title="high-priority | medium-priority | low-priority", description=( "Identifies the mutually agreed level of importance associated with " "reaching/sustaining the goal." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) startCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="startCodeableConcept", title="When goal pursuit begins", description="The date or event after which the goal should begin being pursued.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e start[x] "one_of_many": "start", "one_of_many_required": False, }, ) startDate: fhirtypes.DateType | None = Field( default=None, alias="startDate", title="When goal pursuit begins", description="The date or event after which the goal should begin being pursued.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e start[x] "one_of_many": "start", "one_of_many_required": False, }, ) startDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_startDate", title="Extension field for ``startDate``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "proposed | accepted | planned | in-progress | on-target | ahead-of-" "target | behind-target | sustaining | achieved | on-hold | cancelled |" " entered-in-error | rejected" ), description=( "Indicates whether the goal has been reached and is still considered " "relevant." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "proposed", "accepted", "planned", "in-progress", "on-target", "ahead-of-target", "behind-target", "sustaining", "achieved", "on-hold", "cancelled", "entered-in-error", "rejected", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusDate: fhirtypes.DateType | None = Field( default=None, alias="statusDate", title="When goal status took effect", description=( "Identifies when the current status. I.e. When initially created, when" " achieved, when cancelled, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_statusDate", title="Extension field for ``statusDate``." ) statusReason: fhirtypes.StringType | None = Field( default=None, alias="statusReason", title="Reason for current status", description="Captures the reason for the current status.", json_schema_extra={ "element_property": True, }, ) statusReason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_statusReason", title="Extension field for ``statusReason``.", ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Who this goal is intended for", description=( "Identifies the patient, group or organization for whom the goal is " "being established." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group", "Organization"], }, ) target: fhirtypes.GoalTargetType | None = Field( default=None, alias="target", title="Target outcome for the goal", description="Indicates what should be done by when.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Goal`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "category", "priority", "description", "subject", "startDate", "startCodeableConcept", "target", "statusDate", "statusReason", "expressedBy", "addresses", "note", "outcomeCode", "outcomeReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Goal`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "status", "category", "priority", "description", "subject", "startDate", "startCodeableConcept", "statusDate", "expressedBy", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"start": ["startCodeableConcept", "startDate"]} return one_of_many_fields class GoalTarget(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Target outcome for the goal. Indicates what should be done by when. """ __resource_type__ = "GoalTarget" detailCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="detailCodeableConcept", title="The target value to be achieved", description=( "The target value of the focus to be achieved to signify the " "fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low" " or both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any focus value at " "or below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any focus value at or above the" " low value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="detailQuantity", title="The target value to be achieved", description=( "The target value of the focus to be achieved to signify the " "fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low" " or both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any focus value at " "or below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any focus value at or above the" " low value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailRange: fhirtypes.RangeType | None = Field( default=None, alias="detailRange", title="The target value to be achieved", description=( "The target value of the focus to be achieved to signify the " "fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low" " or both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any focus value at " "or below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any focus value at or above the" " low value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) dueDate: fhirtypes.DateType | None = Field( default=None, alias="dueDate", title="Reach goal on or before", description=( "Indicates either the date or the duration after start by which the " "goal should be met." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e due[x] "one_of_many": "due", "one_of_many_required": False, }, ) dueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dueDate", title="Extension field for ``dueDate``." ) dueDuration: fhirtypes.DurationType | None = Field( default=None, alias="dueDuration", title="Reach goal on or before", description=( "Indicates either the date or the duration after start by which the " "goal should be met." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e due[x] "one_of_many": "due", "one_of_many_required": False, }, ) measure: fhirtypes.CodeableConceptType | None = Field( default=None, alias="measure", title="The parameter whose value is being tracked", description=( "The parameter whose value is being tracked, e.g. body weight, blood " "pressure, or hemoglobin A1c level." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GoalTarget`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "measure", "detailQuantity", "detailRange", "detailCodeableConcept", "dueDate", "dueDuration", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GoalTarget`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "measure", "detailQuantity", "detailRange", "detailCodeableConcept", "dueDate", "dueDuration", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "detail": ["detailCodeableConcept", "detailQuantity", "detailRange"], "due": ["dueDate", "dueDuration"], } return one_of_many_fields ================================================ FILE: fhir/resources/STU3/graphdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/GraphDefinition Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class GraphDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of an graph of resources. A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set. """ __resource_type__ = "GraphDefinition" contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date this was last changed", description=( "The date (and optionally time) when the graph definition was " "published. The date must change if and when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the graph definition " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the graph definition", description=( "A free text natural language description of the graph definition from " "a consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A boolean value to indicate that this graph definition is authored for" " testing purposes (or education/evaluation/marketing), and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for graph definition (if applicable)", description=( "A legal or geographic region in which the graph definition is intended" " to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) link: typing.List[fhirtypes.GraphDefinitionLinkType] | None = Field( default=None, alias="link", title="Links this graph makes rules about", description=None, json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this graph definition (computer friendly)", description=( "A natural language name identifying the graph definition. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) profile: fhirtypes.UriType | None = Field( default=None, alias="profile", title="Profile on base resource", description="The profile that describes the use of the base resource.", json_schema_extra={ "element_property": True, }, ) profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the individual or organization that published the graph " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this graph definition is defined", description=( "Explaination of why this graph definition is needed and why it has " "been designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) start: fhirtypes.CodeType | None = Field( default=None, alias="start", title="Type of resource at which the graph starts", description="The type of FHIR resource at which instances of this graph start.", json_schema_extra={ "element_property": True, "element_required": True, }, ) start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_start", title="Extension field for ``start``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this graph definition. Enables tracking the life-cycle " "of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Logical URI to reference this graph definition (globally unique)", description=( "An absolute URI that is used to identify this graph definition when it" " is referenced in a specification, model, design or an instance. This " "SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at" " which this graph definition is (or will be) published. The URL SHOULD" " include the major version of the graph definition. For more " "information see [Technical and Business " "Versions](resource.html#versions)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Context the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching for appropriate graph definition instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the graph definition", description=( "The identifier that is used to identify this version of the graph " "definition when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the graph definition " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GraphDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "version", "name", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "start", "profile", "link", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GraphDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "version", "name", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("name", "name__ext"), ("start", "start__ext"), ("status", "status__ext"), ] return required_fields class GraphDefinitionLink(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Links this graph makes rules about. """ __resource_type__ = "GraphDefinitionLink" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Why this link is specified", description=( "Information about why this link is of interest in this graph " "definition." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) max: fhirtypes.StringType | None = Field( default=None, alias="max", title="Maximum occurrences for this link", description=None, json_schema_extra={ "element_property": True, }, ) max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_max", title="Extension field for ``max``." ) min: fhirtypes.IntegerType | None = Field( default=None, alias="min", title="Minimum occurrences for this link", description=None, json_schema_extra={ "element_property": True, }, ) min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_min", title="Extension field for ``min``." ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="Path in the resource that contains the link", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) sliceName: fhirtypes.StringType | None = Field( default=None, alias="sliceName", title="Which slice (if profiled)", description=None, json_schema_extra={ "element_property": True, }, ) sliceName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sliceName", title="Extension field for ``sliceName``." ) target: typing.List[fhirtypes.GraphDefinitionLinkTargetType] = Field( default=..., alias="target", title="Potential target for the link", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GraphDefinitionLink`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "path", "sliceName", "min", "max", "description", "target", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GraphDefinitionLink`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("path", "path__ext")] return required_fields class GraphDefinitionLinkTarget(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Potential target for the link. """ __resource_type__ = "GraphDefinitionLinkTarget" compartment: typing.List[ fhirtypes.GraphDefinitionLinkTargetCompartmentType ] | None = Field( default=None, alias="compartment", title="Compartment Consistency Rules", description=None, json_schema_extra={ "element_property": True, }, ) link: typing.List[fhirtypes.GraphDefinitionLinkType] | None = Field( default=None, alias="link", title="Additional links from target resource", description=None, json_schema_extra={ "element_property": True, }, ) profile: fhirtypes.UriType | None = Field( default=None, alias="profile", title="Profile for the target resource", description=None, json_schema_extra={ "element_property": True, }, ) profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="Type of resource this link refers to", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GraphDefinitionLinkTarget`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "profile", "compartment", "link", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GraphDefinitionLinkTarget`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields class GraphDefinitionLinkTargetCompartment(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Compartment Consistency Rules. """ __resource_type__ = "GraphDefinitionLinkTargetCompartment" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Identifies the compartment", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Documentation for FHIRPath expression", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="Custom rule, as a FHIRPath expression", description=None, json_schema_extra={ "element_property": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) rule: fhirtypes.CodeType | None = Field( default=None, alias="rule", title="identical | matching | different | custom", description="identical | matching | different | no-rule | custom.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["identical", "matching", "different", "custom"], }, ) rule__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rule", title="Extension field for ``rule``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GraphDefinitionLinkTargetCompartment`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "rule", "expression", "description", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GraphDefinitionLinkTargetCompartment`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext"), ("rule", "rule__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/group.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Group Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Group(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Group of multiple entities. Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization. """ __resource_type__ = "Group" active: bool | None = Field( default=None, alias="active", title="Whether this group's record is in active use", description=( "Indicates whether the record for the group is available for use or is " "merely being retained for historical purposes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) actual: bool | None = Field( default=None, alias="actual", title="Descriptive or actual", description=( "If true, indicates that the resource refers to a specific group of " "real individuals. If false, the group defines a set of intended " "individuals." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) actual__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_actual", title="Extension field for ``actual``." ) characteristic: typing.List[fhirtypes.GroupCharacteristicType] | None = Field( default=None, alias="characteristic", title="Trait of group members", description="Identifies the traits shared by members of the group.", json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Kind of Group members", description=( 'Provides a specific type of resource the group includes; e.g. "cow", ' '"syringe", etc.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique id", description="A unique business identifier for this group.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) member: typing.List[fhirtypes.GroupMemberType] | None = Field( default=None, alias="member", title="Who or what is in group", description="Identifies the resource instances that are members of the group.", json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Label for Group", description=( "A label assigned to the group for human identification and " "communication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) quantity: fhirtypes.UnsignedIntType | None = Field( default=None, alias="quantity", title="Number of members", description=( "A count of the number of resource instances that are part of the " "group." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) quantity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_quantity", title="Extension field for ``quantity``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="person | animal | practitioner | device | medication | substance", description=( "Identifies the broad classification of the kind of resources the group" " includes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "person", "animal", "practitioner", "device", "medication", "substance", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Group`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "type", "actual", "code", "name", "quantity", "characteristic", "member", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Group`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "active", "type", "actual", "code", "name", "quantity", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("actual", "actual__ext"), ("type", "type__ext")] return required_fields class GroupCharacteristic(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Trait of group members. Identifies the traits shared by members of the group. """ __resource_type__ = "GroupCharacteristic" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Kind of characteristic", description="A code that identifies the kind of trait being asserted.", json_schema_extra={ "element_property": True, }, ) exclude: bool | None = Field( default=None, alias="exclude", title="Group includes or excludes", description=( "If true, indicates the characteristic is one that is NOT held by " "members of the group." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) exclude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_exclude", title="Extension field for ``exclude``." ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Period over which characteristic is tested", description=( "The period over which the characteristic is tested; e.g. the patient " "had an operation during the month of June." ), json_schema_extra={ "element_property": True, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value held by characteristic", description=( "The value of the trait that holds (or does not hold - see 'exclude') " "for members of the group." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Value held by characteristic", description=( "The value of the trait that holds (or does not hold - see 'exclude') " "for members of the group." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Value held by characteristic", description=( "The value of the trait that holds (or does not hold - see 'exclude') " "for members of the group." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Value held by characteristic", description=( "The value of the trait that holds (or does not hold - see 'exclude') " "for members of the group." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GroupCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "valueCodeableConcept", "valueBoolean", "valueQuantity", "valueRange", "exclude", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GroupCharacteristic`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("exclude", "exclude__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueCodeableConcept", "valueQuantity", "valueRange", ] } return one_of_many_fields class GroupMember(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who or what is in group. Identifies the resource instances that are members of the group. """ __resource_type__ = "GroupMember" entity: fhirtypes.ReferenceType = Field( default=..., alias="entity", title="Reference to the group member", description=( "A reference to the entity that is a member of the group. Must be " "consistent with Group.type." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "Device", "Medication", "Substance", ], }, ) inactive: bool | None = Field( default=None, alias="inactive", title="If member is no longer in group", description=( "A flag to indicate that the member is no longer in the group, but " "previously may have been a member." ), json_schema_extra={ "element_property": True, }, ) inactive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_inactive", title="Extension field for ``inactive``." ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Period member belonged to the group", description="The period that the member was in the group, if known.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GroupMember`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "entity", "period", "inactive"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GroupMember`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/guidanceresponse.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/GuidanceResponse Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class GuidanceResponse(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The formal response to a guidance request. A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken. """ __resource_type__ = "GuidanceResponse" context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Encounter or Episode during which the response was returned", description=( "Allows the context of the guidance response to be provided if " "available. In a service context, this would likely be unavailable." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) dataRequirement: typing.List[fhirtypes.DataRequirementType] | None = Field( default=None, alias="dataRequirement", title="Additional required data", description=( "If the evaluation could not be completed due to lack of information, " "or additional information would potentially result in a more accurate " "response, this element will a description of the data required in " "order to proceed with the evaluation. A subsequent request to the " "service should include this data." ), json_schema_extra={ "element_property": True, }, ) evaluationMessage: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="evaluationMessage", title="Messages resulting from the evaluation of the artifact or artifacts", description=( "Messages resulting from the evaluation of the artifact or artifacts. " "As part of evaluating the request, the engine may produce " "informational or warning messages. These messages will be provided by " "this element." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["OperationOutcome"], }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Business identifier", description=( "Allows a service to provide a unique, business identifier for the " "response." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) module: fhirtypes.ReferenceType = Field( default=..., alias="module", title="A reference to a knowledge module", description="A reference to the knowledge module that was invoked.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ServiceDefinition"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Additional notes about the response", description=( "Provides a mechanism to communicate additional information about the " "response." ), json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When the guidance response was processed", description="Indicates when the guidance response was processed.", json_schema_extra={ "element_property": True, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) outputParameters: fhirtypes.ReferenceType | None = Field( default=None, alias="outputParameters", title="The output parameters of the evaluation, if any", description=( "The output parameters of the evaluation, if any. Many modules will " "result in the return of specific resources such as procedure or " "communication requests that are returned as part of the operation " "result. However, modules may define specific outputs that would be " "returned as the result of the evaluation, and these would be returned " "in this element." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Parameters"], }, ) performer: fhirtypes.ReferenceType | None = Field( default=None, alias="performer", title="Device returning the guidance", description="Provides a reference to the device that performed the guidance.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) reasonCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reasonCodeableConcept", title="Reason for the response", description=( "Indicates the reason the request was initiated. This is typically " "provided as a parameter to the evaluation and echoed by the service, " "although for some use cases, such as subscription- or event-based " "scenarios, it may provide an indication of the cause for the response." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e reason[x] "one_of_many": "reason", "one_of_many_required": False, }, ) reasonReference: fhirtypes.ReferenceType | None = Field( default=None, alias="reasonReference", title="Reason for the response", description=( "Indicates the reason the request was initiated. This is typically " "provided as a parameter to the evaluation and echoed by the service, " "although for some use cases, such as subscription- or event-based " "scenarios, it may provide an indication of the cause for the response." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e reason[x] "one_of_many": "reason", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) requestId: fhirtypes.IdType | None = Field( default=None, alias="requestId", title="The id of the request associated with this response, if any", description=( "The id of the request associated with this response. If an id was " "given as part of the request, it will be reproduced here to enable the" " requester to more easily identify the response in a multi-request " "scenario." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) requestId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requestId", title="Extension field for ``requestId``." ) result: fhirtypes.ReferenceType | None = Field( default=None, alias="result", title="Proposed actions, if any", description="The actions, if any, produced by the evaluation of the artifact.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CarePlan", "RequestGroup"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "success | data-requested | data-required | in-progress | failure | " "entered-in-error" ), description=( "The status of the response. If the evaluation is completed " "successfully, the status will indicate success. However, in order to " "complete the evaluation, the engine may require more information. In " "this case, the status will be data-required, and the response will " "contain a description of the additional required information. If the " "evaluation completed successfully, but the engine determines that a " "potentially more accurate response could be provided if more data was " "available, the status will be data-requested, and the response will " "contain a description of the additional requested information." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "success", "data-requested", "data-required", "in-progress", "failure", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Patient the request was performed for", description="The patient for which the request was processed.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GuidanceResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "requestId", "identifier", "module", "status", "subject", "context", "occurrenceDateTime", "performer", "reasonCodeableConcept", "reasonReference", "note", "evaluationMessage", "outputParameters", "result", "dataRequirement", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GuidanceResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "requestId", "identifier", "module", "status", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"reason": ["reasonCodeableConcept", "reasonReference"]} return one_of_many_fields ================================================ FILE: fhir/resources/STU3/healthcareservice.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/HealthcareService Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class HealthcareService(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The details of a healthcare service available at a location. """ __resource_type__ = "HealthcareService" active: bool | None = Field( default=None, alias="active", title="Whether this healthcareservice is in active use", description="Whether this healthcareservice record is in active use.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) appointmentRequired: bool | None = Field( default=None, alias="appointmentRequired", title="If an appointment is required for access to this service", description=( "Indicates whether or not a prospective consumer will require an " "appointment for a particular service at a site to be provided by the " "Organization. Indicates if an appointment is required for access to " "this service." ), json_schema_extra={ "element_property": True, }, ) appointmentRequired__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_appointmentRequired", title="Extension field for ``appointmentRequired``.", ) availabilityExceptions: fhirtypes.StringType | None = Field( default=None, alias="availabilityExceptions", title="Description of availability exceptions", description=( "A description of site availability exceptions, e.g. public holiday " "availability. Succinctly describing all possible exceptions to normal " "site availability as details in the available Times and not available " "Times." ), json_schema_extra={ "element_property": True, }, ) availabilityExceptions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_availabilityExceptions", title="Extension field for ``availabilityExceptions``.", ) availableTime: typing.List[ fhirtypes.HealthcareServiceAvailableTimeType ] | None = Field( default=None, alias="availableTime", title="Times the Service Site is available", description="A collection of times that the Service Site is available.", json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Broad category of service being performed or delivered", description="Identifies the broad category of service being performed or delivered.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) characteristic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="characteristic", title="Collection of characteristics (attributes)", description=None, json_schema_extra={ "element_property": True, }, ) comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title=( "Additional description and/or any specific issues not covered " "elsewhere" ), description=( "Any additional description of the service and/or any specific issues " "not covered by the other attributes, which can be displayed as further" " detail under the serviceName." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) coverageArea: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="coverageArea", title="Location(s) service is inteded for/available to", description=( "The location(s) that this service is available to (not where the " "service is provided)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) eligibility: fhirtypes.CodeableConceptType | None = Field( default=None, alias="eligibility", title="Specific eligibility requirements required to use the service", description=( "Does this service have specific eligibility requirements that need to " "be met in order to use the service?" ), json_schema_extra={ "element_property": True, }, ) eligibilityNote: fhirtypes.StringType | None = Field( default=None, alias="eligibilityNote", title="Describes the eligibility conditions for the service", description=None, json_schema_extra={ "element_property": True, }, ) eligibilityNote__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_eligibilityNote", title="Extension field for ``eligibilityNote``.", ) endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title=( "Technical endpoints providing access to services operated for the " "location" ), description=( "Technical endpoints providing access to services operated for the " "specific healthcare services defined at this resource." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) extraDetails: fhirtypes.StringType | None = Field( default=None, alias="extraDetails", title=( "Extra details about the service that can't be placed in the other " "fields" ), description=None, json_schema_extra={ "element_property": True, }, ) extraDetails__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_extraDetails", title="Extension field for ``extraDetails``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External identifiers for this item", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) location: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="location", title="Location(s) where service may be provided", description="The location(s) where this healthcare service may be provided.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Description of service as presented to a consumer while searching", description=( "Further description of the service as it would be presented to a " "consumer while searching." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) notAvailable: typing.List[ fhirtypes.HealthcareServiceNotAvailableType ] | None = Field( default=None, alias="notAvailable", title="Not available during this time due to provided reason", description=( "The HealthcareService is not available during this period of time due " "to the provided reason." ), json_schema_extra={ "element_property": True, }, ) photo: fhirtypes.AttachmentType | None = Field( default=None, alias="photo", title="Facilitates quick identification of the service", description=( "If there is a photo/symbol associated with this HealthcareService, it " "may be included here to facilitate quick identification of the service" " in a list." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) programName: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="programName", title="Program Names that categorize the service", description="Program Names that can be used to categorize the service.", json_schema_extra={ "element_property": True, }, ) programName__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_programName", title="Extension field for ``programName``." ) providedBy: fhirtypes.ReferenceType | None = Field( default=None, alias="providedBy", title="Organization that provides this service", description="The organization that provides this healthcare service.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) referralMethod: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="referralMethod", title="Ways that the service accepts referrals", description=( "Ways that the service accepts referrals, if this is not provided then " "it is implied that no referral is required." ), json_schema_extra={ "element_property": True, }, ) serviceProvisionCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="serviceProvisionCode", title="Conditions under which service is available/offered", description=( "The code(s) that detail the conditions under which the healthcare " "service is available/offered." ), json_schema_extra={ "element_property": True, }, ) specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialty", title="Specialties handled by the HealthcareService", description=( "Collection of specialties handled by the service site. This is more of" " a medical term." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="Contacts related to the healthcare service", description="List of contacts related to this specific healthcare service.", json_schema_extra={ "element_property": True, }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Type of service that may be delivered or performed", description="The specific type of service that may be delivered or performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``HealthcareService`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "providedBy", "category", "type", "specialty", "location", "name", "comment", "extraDetails", "photo", "telecom", "coverageArea", "serviceProvisionCode", "eligibility", "eligibilityNote", "programName", "characteristic", "referralMethod", "appointmentRequired", "availableTime", "notAvailable", "availabilityExceptions", "endpoint", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``HealthcareService`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "active", "providedBy", "category", "type", "specialty", "location", "name", "comment", "photo", ] class HealthcareServiceAvailableTime(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Times the Service Site is available. A collection of times that the Service Site is available. """ __resource_type__ = "HealthcareServiceAvailableTime" allDay: bool | None = Field( default=None, alias="allDay", title="Always available? e.g. 24 hour service", description=( "Is this always available? (hence times are irrelevant) e.g. 24 hour " "service." ), json_schema_extra={ "element_property": True, }, ) allDay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allDay", title="Extension field for ``allDay``." ) availableEndTime: fhirtypes.TimeType | None = Field( default=None, alias="availableEndTime", title="Closing time of day (ignored if allDay = true)", description=( "The closing time of day. Note: If the AllDay flag is set, then this " "time is ignored." ), json_schema_extra={ "element_property": True, }, ) availableEndTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_availableEndTime", title="Extension field for ``availableEndTime``.", ) availableStartTime: fhirtypes.TimeType | None = Field( default=None, alias="availableStartTime", title="Opening time of day (ignored if allDay = true)", description=( "The opening time of day. Note: If the AllDay flag is set, then this " "time is ignored." ), json_schema_extra={ "element_property": True, }, ) availableStartTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_availableStartTime", title="Extension field for ``availableStartTime``.", ) daysOfWeek: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="daysOfWeek", title="mon | tue | wed | thu | fri | sat | sun", description=( "Indicates which days of the week are available between the start and " "end Times." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], }, ) daysOfWeek__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_daysOfWeek", title="Extension field for ``daysOfWeek``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``HealthcareServiceAvailableTime`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "daysOfWeek", "allDay", "availableStartTime", "availableEndTime", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``HealthcareServiceAvailableTime`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class HealthcareServiceNotAvailable(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Not available during this time due to provided reason. The HealthcareService is not available during this period of time due to the provided reason. """ __resource_type__ = "HealthcareServiceNotAvailable" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Reason presented to the user explaining why time not available", description=( "The reason that can be presented to the user as to why this time is " "not available." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) during: fhirtypes.PeriodType | None = Field( default=None, alias="during", title="Service not availablefrom this date", description=( "Service is not available (seasonally or for a public holiday) from " "this date." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``HealthcareServiceNotAvailable`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "description", "during"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``HealthcareServiceNotAvailable`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("description", "description__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/humanname.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/HumanName Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class HumanName(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Name of a human - parts and usage. A human's name with the ability to identify parts and usage. """ __resource_type__ = "HumanName" family: fhirtypes.StringType | None = Field( default=None, alias="family", title="Family name (often called 'Surname')", description=( "The part of a name that links to the genealogy. In some cultures (e.g." " Eritrea) the family name of a son is the first name of his father." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) family__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_family", title="Extension field for ``family``." ) given: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="given", title="Given names (not always 'first'). Includes middle names", description="Given name.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) given__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_given", title="Extension field for ``given``." ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period when name was/is in use", description=( "Indicates the period of time when this name was valid for the named " "person." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) prefix: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="prefix", title="Parts that come before the name", description=( "Part of the name that is acquired as a title due to academic, legal, " "employment or nobility status, etc. and that appears at the start of " "the name." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) prefix__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_prefix", title="Extension field for ``prefix``." ) suffix: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="suffix", title="Parts that come after the name", description=( "Part of the name that is acquired as a title due to academic, legal, " "employment or nobility status, etc. and that appears at the end of the" " name." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) suffix__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_suffix", title="Extension field for ``suffix``." ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Text representation of the full name", description="A full text representation of the name.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="usual | official | temp | nickname | anonymous | old | maiden", description="Identifies the purpose for this name.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "usual", "official", "temp", "nickname", "anonymous", "old", "maiden", ], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``HumanName`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "use", "text", "family", "given", "prefix", "suffix", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``HumanName`` according to specification, with preserving the original sequence order. """ return ["use", "text", "family", "given", "prefix", "suffix", "period"] ================================================ FILE: fhir/resources/STU3/identifier.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Identifier Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Identifier(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An identifier intended for computation. A technical identifier - identifies some entity uniquely and unambiguously. """ __resource_type__ = "Identifier" assigner: fhirtypes.ReferenceType | None = Field( default=None, alias="assigner", title="Organization that issued id (may be just text)", description="Organization that issued/manages the identifier.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period when id is/was valid for use", description="Time period during which identifier is/was valid for use.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) system: fhirtypes.UriType | None = Field( default=None, alias="system", title="The namespace for the identifier value", description=( "Establishes the namespace for the value - that is, a URL that " "describes a set values that are unique." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Description of identifier", description=( "A coded type for the identifier that can be used to determine which " "identifier to use for a specific purpose." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="usual | official | temp | secondary (If known)", description="The purpose of this identifier.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["usual", "official", "temp", "secondary"], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The value that is unique", description=( "The portion of the identifier typically relevant to the user and which" " is unique within the context of the system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Identifier`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "use", "type", "system", "value", "period", "assigner", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Identifier`` according to specification, with preserving the original sequence order. """ return ["use", "type", "system", "value", "period", "assigner"] ================================================ FILE: fhir/resources/STU3/imagingmanifest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ImagingManifest Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ImagingManifest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Key Object Selection. A text description of the DICOM SOP instances selected in the ImagingManifest; or the reason for, or significance of, the selection. """ __resource_type__ = "ImagingManifest" author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="Author (human or machine)", description=( "Author of ImagingManifest. It can be a human author or a device which " "made the decision of the SOP instances selected. For example, a " "radiologist selected a set of imaging SOP instances to attach in a " "diagnostic report, and a CAD application may author a selection to " "describe SOP instances it used to generate a detection conclusion." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Device", "Organization", "Patient", "RelatedPerson", ], }, ) authoringTime: fhirtypes.DateTimeType | None = Field( default=None, alias="authoringTime", title="Time when the selection of instances was made", description=( "Date and time when the selection of the referenced instances were " "made. It is (typically) different from the creation date of the " "selection resource, and from dates associated with the referenced " "instances (e.g. capture time of the referenced image)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authoringTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoringTime", title="Extension field for ``authoringTime``.", ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Description text", description=( "Free text narrative description of the ImagingManifest. The value " "may be derived from the DICOM Standard Part 16, CID-7010 descriptions " "(e.g. Best in Set, Complete Study Content). Note that those values " "cover the wide range of uses of the DICOM Key Object Selection object," " several of which are not supported by ImagingManifest. Specifically, " "there is no expected behavior associated with descriptions that " "suggest referenced images be removed or not used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="SOP Instance UID", description=( "Unique identifier of the DICOM Key Object Selection (KOS) that this " "resource represents." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Patient of the selected objects", description=( "A patient resource reference which is the patient subject of all DICOM" " SOP Instances in this ImagingManifest." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) study: typing.List[fhirtypes.ImagingManifestStudyType] = Field( default=..., alias="study", title="Study identity of the selected instances", description=( "Study identity and locating information of the DICOM SOP instances in " "the selection." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImagingManifest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "patient", "authoringTime", "author", "description", "study", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImagingManifest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "patient", "authoringTime", "author", "description", "study", ] class ImagingManifestStudy(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Study identity of the selected instances. Study identity and locating information of the DICOM SOP instances in the selection. """ __resource_type__ = "ImagingManifestStudy" endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title="Study access service endpoint", description=( "The network service providing access (e.g., query, view, or retrieval)" " for the study. See implementation notes for information about using " "DICOM endpoints. A study-level endpoint applies to each series in the " "study, unless overridden by a series-level endpoint with the same " "Endpoint.type." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) imagingStudy: fhirtypes.ReferenceType | None = Field( default=None, alias="imagingStudy", title="Reference to ImagingStudy", description="Reference to the Imaging Study in FHIR form.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ImagingStudy"], }, ) series: typing.List[fhirtypes.ImagingManifestStudySeriesType] = Field( default=..., alias="series", title="Series identity of the selected instances", description=( "Series identity and locating information of the DICOM SOP instances in" " the selection." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) uid: fhirtypes.OidType | None = Field( default=None, alias="uid", title="Study instance UID", description="Study instance UID of the SOP instances in the selection.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) uid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uid", title="Extension field for ``uid``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImagingManifestStudy`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "uid", "imagingStudy", "endpoint", "series", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImagingManifestStudy`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "uid", "imagingStudy", "endpoint", "series"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("uid", "uid__ext")] return required_fields class ImagingManifestStudySeries(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Series identity of the selected instances. Series identity and locating information of the DICOM SOP instances in the selection. """ __resource_type__ = "ImagingManifestStudySeries" endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title="Series access endpoint", description=( "The network service providing access (e.g., query, view, or retrieval)" " for this series. See implementation notes for information about using" " DICOM endpoints. A series-level endpoint, if present, has precedence " "over a study-level endpoint with the same Endpoint.type." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) instance: typing.List[fhirtypes.ImagingManifestStudySeriesInstanceType] = Field( default=..., alias="instance", title="The selected instance", description="Identity and locating information of the selected DICOM SOP instances.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) uid: fhirtypes.OidType | None = Field( default=None, alias="uid", title="Series instance UID", description="Series instance UID of the SOP instances in the selection.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) uid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uid", title="Extension field for ``uid``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImagingManifestStudySeries`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "uid", "endpoint", "instance"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImagingManifestStudySeries`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "uid", "endpoint", "instance"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("uid", "uid__ext")] return required_fields class ImagingManifestStudySeriesInstance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The selected instance. Identity and locating information of the selected DICOM SOP instances. """ __resource_type__ = "ImagingManifestStudySeriesInstance" sopClass: fhirtypes.OidType | None = Field( default=None, alias="sopClass", title="SOP class UID of instance", description="SOP class UID of the selected instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) sopClass__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sopClass", title="Extension field for ``sopClass``." ) uid: fhirtypes.OidType | None = Field( default=None, alias="uid", title="Selected instance UID", description="SOP Instance UID of the selected instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) uid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uid", title="Extension field for ``uid``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImagingManifestStudySeriesInstance`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "sopClass", "uid"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImagingManifestStudySeriesInstance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "sopClass", "uid"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sopClass", "sopClass__ext"), ("uid", "uid__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/imagingstudy.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ImagingStudy Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ImagingStudy(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A set of images produced in single study (one or more series of references images). Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities. """ __resource_type__ = "ImagingStudy" accession: fhirtypes.IdentifierType | None = Field( default=None, alias="accession", title='Related workflow identifier ("Accession Number")', description=( "Accession Number is an identifier related to some aspect of imaging " "workflow and data management. Usage may vary across different " "institutions. See for instance [IHE Radiology Technical Framework " "Volume 1 Appendix A](http://www.ihe.net/uploadedFiles/Documents/Radiol" "ogy/IHE_RAD_TF_Rev13.0_Vol1_FT_2014-07-30.pdf)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) availability: fhirtypes.CodeType | None = Field( default=None, alias="availability", title="ONLINE | OFFLINE | NEARLINE | UNAVAILABLE", description="Availability of study (online, offline, or nearline).", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["ONLINE", "OFFLINE", "NEARLINE", "UNAVAILABLE"], }, ) availability__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_availability", title="Extension field for ``availability``.", ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Request fulfilled", description=( "A list of the diagnostic requests that resulted in this imaging study " "being performed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ReferralRequest", "CarePlan", "ProcedureRequest"], }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Originating context", description="The encounter or episode at which the request is initiated.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Institution-generated description", description=( "Institution-generated description or classification of the Study " "performed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title="Study access endpoint", description=( "The network service providing access (e.g., query, view, or retrieval)" " for the study. See implementation notes for information about using " "DICOM endpoints. A study-level endpoint applies to each series in the " "study, unless overridden by a series-level endpoint with the same " "Endpoint.type." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Other identifiers for the study", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) interpreter: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="interpreter", title="Who interpreted images", description="Who read the study and interpreted the images or other content.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) modalityList: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="modalityList", title="All series modality if actual acquisition modalities", description=( "A list of all the Series.ImageModality values that are actual " "acquisition modalities, i.e. those in the DICOM Context Group 29 " "(value set OID 1.2.840.10008.6.1.19)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) numberOfInstances: fhirtypes.UnsignedIntType | None = Field( default=None, alias="numberOfInstances", title="Number of Study Related Instances", description=( "Number of SOP Instances in Study. This value given may be larger than " "the number of instance elements this resource contains due to resource" " availability, security, or other factors. This element should be " "present if any instance elements are present." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) numberOfInstances__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_numberOfInstances", title="Extension field for ``numberOfInstances``.", ) numberOfSeries: fhirtypes.UnsignedIntType | None = Field( default=None, alias="numberOfSeries", title="Number of Study Related Series", description=( "Number of Series in the Study. This value given may be larger than the" " number of series elements this Resource contains due to resource " "availability, security, or other factors. This element should be " "present if any series elements are present." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) numberOfSeries__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_numberOfSeries", title="Extension field for ``numberOfSeries``.", ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Who the images are of", description="The patient imaged in the study.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) procedureCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="procedureCode", title="The performed procedure code", description="The code for the performed procedure type.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) procedureReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="procedureReference", title="The performed Procedure reference", description="A reference to the performed Procedure.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Procedure"], }, ) reason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reason", title="Why the study was requested", description=( "Description of clinical condition indicating why the ImagingStudy was " "requested." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) referrer: fhirtypes.ReferenceType | None = Field( default=None, alias="referrer", title="Referring physician", description="The requesting/referring physician.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) series: typing.List[fhirtypes.ImagingStudySeriesType] | None = Field( default=None, alias="series", title="Each study has one or more series of instances", description="Each study has one or more series of images or other content.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) started: fhirtypes.DateTimeType | None = Field( default=None, alias="started", title="When the study was started", description="Date and time the study started.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) started__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_started", title="Extension field for ``started``." ) uid: fhirtypes.OidType | None = Field( default=None, alias="uid", title="Formal DICOM identifier for the study", description="Formal identifier for the study.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) uid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uid", title="Extension field for ``uid``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImagingStudy`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "uid", "accession", "identifier", "availability", "modalityList", "patient", "context", "started", "basedOn", "referrer", "interpreter", "endpoint", "numberOfSeries", "numberOfInstances", "procedureReference", "procedureCode", "reason", "description", "series", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImagingStudy`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "uid", "accession", "identifier", "availability", "modalityList", "patient", "context", "started", "basedOn", "referrer", "interpreter", "endpoint", "numberOfSeries", "numberOfInstances", "procedureReference", "procedureCode", "reason", "description", "series", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("uid", "uid__ext")] return required_fields class ImagingStudySeries(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Each study has one or more series of instances. Each study has one or more series of images or other content. """ __resource_type__ = "ImagingStudySeries" availability: fhirtypes.CodeType | None = Field( default=None, alias="availability", title="ONLINE | OFFLINE | NEARLINE | UNAVAILABLE", description="Availability of series (online, offline or nearline).", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["ONLINE", "OFFLINE", "NEARLINE", "UNAVAILABLE"], }, ) availability__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_availability", title="Extension field for ``availability``.", ) bodySite: fhirtypes.CodingType | None = Field( default=None, alias="bodySite", title="Body part examined", description=( "The anatomic structures examined. See DICOM Part 16 Annex L (http://di" "com.nema.org/medical/dicom/current/output/chtml/part16/chapter_L.html)" " for DICOM to SNOMED-CT mappings. The bodySite may indicate the " "laterality of body part imaged; if so, it shall be consistent with any" " content of ImagingStudy.series.laterality." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="A short human readable summary of the series", description="A description of the series.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title="Series access endpoint", description=( "The network service providing access (e.g., query, view, or retrieval)" " for this series. See implementation notes for information about using" " DICOM endpoints. A series-level endpoint, if present, has precedence " "over a study-level endpoint with the same Endpoint.type." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) instance: typing.List[fhirtypes.ImagingStudySeriesInstanceType] | None = Field( default=None, alias="instance", title="A single SOP instance from the series", description=( "A single SOP instance within the series, e.g. an image, or " "presentation state." ), json_schema_extra={ "element_property": True, }, ) laterality: fhirtypes.CodingType | None = Field( default=None, alias="laterality", title="Body part laterality", description=( "The laterality of the (possibly paired) anatomic structures examined. " "E.g., the left knee, both lungs, or unpaired abdomen. If present, " "shall be consistent with any laterality information indicated in " "ImagingStudy.series.bodySite." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) modality: fhirtypes.CodingType = Field( default=..., alias="modality", title="The modality of the instances in the series", description="The modality of this series sequence.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) number: fhirtypes.UnsignedIntType | None = Field( default=None, alias="number", title="Numeric identifier of this series", description="The numeric identifier of this series in the study.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_number", title="Extension field for ``number``." ) numberOfInstances: fhirtypes.UnsignedIntType | None = Field( default=None, alias="numberOfInstances", title="Number of Series Related Instances", description=( "Number of SOP Instances in the Study. The value given may be larger " "than the number of instance elements this resource contains due to " "resource availability, security, or other factors. This element should" " be present if any instance elements are present." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) numberOfInstances__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_numberOfInstances", title="Extension field for ``numberOfInstances``.", ) performer: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="performer", title="Who performed the series", description=( "The physician or operator (often the radiology technician) who " "performed the series. The performer is recorded at the series level, " "since each series in a study may be performed by a different " "practitioner, at different times, and using different devices. A " "series may be performed by multiple practitioners." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) started: fhirtypes.DateTimeType | None = Field( default=None, alias="started", title="When the series started", description="The date and time the series was started.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) started__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_started", title="Extension field for ``started``." ) uid: fhirtypes.OidType | None = Field( default=None, alias="uid", title="Formal DICOM identifier for this series", description="Formal identifier for this series.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) uid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uid", title="Extension field for ``uid``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImagingStudySeries`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "uid", "number", "modality", "description", "numberOfInstances", "availability", "endpoint", "bodySite", "laterality", "started", "performer", "instance", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImagingStudySeries`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "uid", "number", "modality", "description", "numberOfInstances", "availability", "endpoint", "bodySite", "laterality", "started", "performer", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("uid", "uid__ext")] return required_fields class ImagingStudySeriesInstance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A single SOP instance from the series. A single SOP instance within the series, e.g. an image, or presentation state. """ __resource_type__ = "ImagingStudySeriesInstance" number: fhirtypes.UnsignedIntType | None = Field( default=None, alias="number", title="The number of this instance in the series", description="The number of instance in the series.", json_schema_extra={ "element_property": True, }, ) number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_number", title="Extension field for ``number``." ) sopClass: fhirtypes.OidType | None = Field( default=None, alias="sopClass", title="DICOM class type", description="DICOM instance type.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sopClass__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sopClass", title="Extension field for ``sopClass``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Description of instance", description="The description of the instance.", json_schema_extra={ "element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) uid: fhirtypes.OidType | None = Field( default=None, alias="uid", title="Formal DICOM identifier for this instance", description="Formal identifier for this image or other content.", json_schema_extra={ "element_property": True, "element_required": True, }, ) uid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uid", title="Extension field for ``uid``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImagingStudySeriesInstance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "uid", "number", "sopClass", "title", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImagingStudySeriesInstance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sopClass", "sopClass__ext"), ("uid", "uid__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/immunization.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Immunization Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Immunization(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Immunization event information. Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed. """ __resource_type__ = "Immunization" date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Vaccination administration date", description="Date vaccine administered or was to be administered.", json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) doseQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="doseQuantity", title="Amount of vaccine administered", description="The quantity of vaccine product that was administered.", json_schema_extra={ "element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter administered as part of", description=( "The visit or admission or other contact between patient and health " "care provider the immunization was performed as part of." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) expirationDate: fhirtypes.DateType | None = Field( default=None, alias="expirationDate", title="Vaccine expiration date", description="Date vaccine batch expires.", json_schema_extra={ "element_property": True, }, ) expirationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expirationDate", title="Extension field for ``expirationDate``.", ) explanation: fhirtypes.ImmunizationExplanationType | None = Field( default=None, alias="explanation", title="Administration/non-administration reasons", description="Reasons why a vaccine was or was not administered.", json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description="A unique identifier assigned to this immunization record.", json_schema_extra={ "element_property": True, }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where vaccination occurred", description=( "The service delivery location where the vaccine administration " "occurred." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) lotNumber: fhirtypes.StringType | None = Field( default=None, alias="lotNumber", title="Vaccine lot number", description="Lot number of the vaccine product.", json_schema_extra={ "element_property": True, }, ) lotNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lotNumber", title="Extension field for ``lotNumber``." ) manufacturer: fhirtypes.ReferenceType | None = Field( default=None, alias="manufacturer", title="Vaccine manufacturer", description="Name of vaccine manufacturer.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) notGiven: bool | None = Field( default=None, alias="notGiven", title="Flag for whether immunization was given", description="Indicates if the vaccination was or was not given.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) notGiven__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_notGiven", title="Extension field for ``notGiven``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Vaccination notes", description=( "Extra information about the immunization that is not conveyed by the " "other attributes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Who was immunized", description="The patient who either received or did not receive the immunization.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) practitioner: typing.List[fhirtypes.ImmunizationPractitionerType] | None = Field( default=None, alias="practitioner", title="Who performed event", description="Indicates who or what performed the event.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) primarySource: bool | None = Field( default=None, alias="primarySource", title="Indicates context the data was recorded in", description=( "An indication that the content of the record is based on information " "from the person who administered the vaccine. This reflects the " "context under which the data was originally recorded." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) primarySource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_primarySource", title="Extension field for ``primarySource``.", ) reaction: typing.List[fhirtypes.ImmunizationReactionType] | None = Field( default=None, alias="reaction", title="Details of a reaction that follows immunization", description=( "Categorical data indicating that an adverse event is associated in " "time to an immunization." ), json_schema_extra={ "element_property": True, }, ) reportOrigin: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reportOrigin", title="Indicates the source of a secondarily reported record", description=( "The source of the data when the report of the immunization event is " "not based on information from the person who administered the vaccine." ), json_schema_extra={ "element_property": True, }, ) route: fhirtypes.CodeableConceptType | None = Field( default=None, alias="route", title="How vaccine entered body", description="The path by which the vaccine product is taken into the body.", json_schema_extra={ "element_property": True, }, ) site: fhirtypes.CodeableConceptType | None = Field( default=None, alias="site", title="Body site vaccine was administered", description="Body site where vaccine was administered.", json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="completed | entered-in-error", description="Indicates the current status of the vaccination event.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["completed", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) vaccinationProtocol: typing.List[ fhirtypes.ImmunizationVaccinationProtocolType ] | None = Field( default=None, alias="vaccinationProtocol", title="What protocol was followed", description=( "Contains information about the protocol(s) under which the vaccine was" " administered." ), json_schema_extra={ "element_property": True, }, ) vaccineCode: fhirtypes.CodeableConceptType = Field( default=..., alias="vaccineCode", title="Vaccine product administered", description="Vaccine that was administered or was to be administered.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Immunization`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "notGiven", "vaccineCode", "patient", "encounter", "date", "primarySource", "reportOrigin", "location", "manufacturer", "lotNumber", "expirationDate", "site", "route", "doseQuantity", "practitioner", "note", "explanation", "reaction", "vaccinationProtocol", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Immunization`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "status", "notGiven", "practitioner", "note", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("notGiven", "notGiven__ext"), ("primarySource", "primarySource__ext"), ("status", "status__ext"), ] return required_fields class ImmunizationExplanation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Administration/non-administration reasons. Reasons why a vaccine was or was not administered. """ __resource_type__ = "ImmunizationExplanation" reason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reason", title="Why immunization occurred", description="Reasons why a vaccine was administered.", json_schema_extra={ "element_property": True, }, ) reasonNotGiven: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonNotGiven", title="Why immunization did not occur", description="Reason why a vaccine was not administered.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImmunizationExplanation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "reason", "reasonNotGiven"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImmunizationExplanation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ImmunizationPractitioner(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who performed event. Indicates who or what performed the event. """ __resource_type__ = "ImmunizationPractitioner" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Individual who was performing", description="The device, practitioner, etc. who performed the action.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="What type of performance was done", description=( "Describes the type of performance (e.g. ordering provider, " "administering provider, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImmunizationPractitioner`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "role", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImmunizationPractitioner`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "role", "actor"] class ImmunizationReaction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details of a reaction that follows immunization. Categorical data indicating that an adverse event is associated in time to an immunization. """ __resource_type__ = "ImmunizationReaction" date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When reaction started", description="Date of reaction to the immunization.", json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) detail: fhirtypes.ReferenceType | None = Field( default=None, alias="detail", title="Additional information on reaction", description="Details of the reaction.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Observation"], }, ) reported: bool | None = Field( default=None, alias="reported", title="Indicates self-reported reaction", description="Self-reported indicator.", json_schema_extra={ "element_property": True, }, ) reported__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reported", title="Extension field for ``reported``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImmunizationReaction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "date", "detail", "reported"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImmunizationReaction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ImmunizationVaccinationProtocol(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What protocol was followed. Contains information about the protocol(s) under which the vaccine was administered. """ __resource_type__ = "ImmunizationVaccinationProtocol" authority: fhirtypes.ReferenceType | None = Field( default=None, alias="authority", title="Who is responsible for protocol", description="Indicates the authority who published the protocol. E.g. ACIP.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Details of vaccine protocol", description=( "Contains the description about the protocol under which the vaccine " "was administered." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) doseSequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="doseSequence", title="Dose number within series", description="Nominal position in a series.", json_schema_extra={ "element_property": True, }, ) doseSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doseSequence", title="Extension field for ``doseSequence``.", ) doseStatus: fhirtypes.CodeableConceptType = Field( default=..., alias="doseStatus", title="Indicates if dose counts towards immunity", description=( 'Indicates if the immunization event should "count" against the ' "protocol." ), json_schema_extra={ "element_property": True, }, ) doseStatusReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="doseStatusReason", title="Why dose does (not) count", description=( "Provides an explanation as to why an immunization event should or " "should not count against the protocol." ), json_schema_extra={ "element_property": True, }, ) series: fhirtypes.StringType | None = Field( default=None, alias="series", title="Name of vaccine series", description=( "One possible path to achieve presumed immunity against a disease - " "within the context of an authority." ), json_schema_extra={ "element_property": True, }, ) series__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_series", title="Extension field for ``series``." ) seriesDoses: fhirtypes.PositiveIntType | None = Field( default=None, alias="seriesDoses", title="Recommended number of doses for immunity", description="The recommended number of doses to achieve immunity.", json_schema_extra={ "element_property": True, }, ) seriesDoses__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_seriesDoses", title="Extension field for ``seriesDoses``." ) targetDisease: typing.List[fhirtypes.CodeableConceptType] = Field( default=..., alias="targetDisease", title="Disease immunized against", description="The targeted disease.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImmunizationVaccinationProtocol`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "doseSequence", "description", "authority", "series", "seriesDoses", "targetDisease", "doseStatus", "doseStatusReason", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImmunizationVaccinationProtocol`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/immunizationrecommendation.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ImmunizationRecommendation(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Guidance or advice relating to an immunization. A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility according to a published schedule) with optional supporting justification. """ __resource_type__ = "ImmunizationRecommendation" identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description="A unique identifier assigned to this particular recommendation record.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Who this profile is for", description="The patient the recommendations are for.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) recommendation: typing.List[ fhirtypes.ImmunizationRecommendationRecommendationType ] = Field( default=..., alias="recommendation", title="Vaccine administration recommendations", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImmunizationRecommendation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "patient", "recommendation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImmunizationRecommendation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "patient", "recommendation", ] class ImmunizationRecommendationRecommendation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Vaccine administration recommendations. """ __resource_type__ = "ImmunizationRecommendationRecommendation" date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date recommendation created", description="The date the immunization recommendation was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) dateCriterion: typing.List[ fhirtypes.ImmunizationRecommendationRecommendationDateCriterionType ] | None = Field( default=None, alias="dateCriterion", title="Dates governing proposed immunization", description=( "Vaccine date recommendations. For example, earliest date to " "administer, latest date to administer, etc." ), json_schema_extra={ "element_property": True, }, ) doseNumber: fhirtypes.PositiveIntType | None = Field( default=None, alias="doseNumber", title="Recommended dose number", description=( "The next recommended dose number (e.g. dose 2 is the next recommended " "dose)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) doseNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doseNumber", title="Extension field for ``doseNumber``." ) forecastStatus: fhirtypes.CodeableConceptType = Field( default=..., alias="forecastStatus", title="Vaccine administration status", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) protocol: fhirtypes.ImmunizationRecommendationRecommendationProtocolType | None = ( Field( default=None, alias="protocol", title="Protocol used by recommendation", description=( "Contains information about the protocol under which the vaccine was " "administered." ), json_schema_extra={ "element_property": True, }, ) ) supportingImmunization: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingImmunization", title="Past immunizations supporting recommendation", description=( "Immunization event history that supports the status and " "recommendation." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Immunization"], }, ) supportingPatientInformation: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingPatientInformation", title="Patient observations supporting recommendation", description=( "Patient Information that supports the status and recommendation. This" " includes patient observations, adverse reactions and " "allergy/intolerance information." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Observation", "AllergyIntolerance"], }, ) targetDisease: fhirtypes.CodeableConceptType | None = Field( default=None, alias="targetDisease", title="Disease to be immunized against", description="The targeted disease for the recommendation.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) vaccineCode: fhirtypes.CodeableConceptType | None = Field( default=None, alias="vaccineCode", title="Vaccine recommendation applies to", description="Vaccine that pertains to the recommendation.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImmunizationRecommendationRecommendation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "date", "vaccineCode", "targetDisease", "doseNumber", "forecastStatus", "dateCriterion", "protocol", "supportingImmunization", "supportingPatientInformation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImmunizationRecommendationRecommendation`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "date", "vaccineCode", "targetDisease", "doseNumber", "forecastStatus", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("date", "date__ext")] return required_fields class ImmunizationRecommendationRecommendationDateCriterion( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Dates governing proposed immunization. Vaccine date recommendations. For example, earliest date to administer, latest date to administer, etc. """ __resource_type__ = "ImmunizationRecommendationRecommendationDateCriterion" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Type of date", description=( "Date classification of recommendation. For example, earliest date to " "give, latest date to give, etc." ), json_schema_extra={ "element_property": True, }, ) value: fhirtypes.DateTimeType | None = Field( default=None, alias="value", title="Recommended date", description="The date whose meaning is specified by dateCriterion.code.", json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImmunizationRecommendationRecommendationDateCriterion`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImmunizationRecommendationRecommendationDateCriterion`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("value", "value__ext")] return required_fields class ImmunizationRecommendationRecommendationProtocol(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Protocol used by recommendation. Contains information about the protocol under which the vaccine was administered. """ __resource_type__ = "ImmunizationRecommendationRecommendationProtocol" authority: fhirtypes.ReferenceType | None = Field( default=None, alias="authority", title="Who is responsible for protocol", description=( "Indicates the authority who published the protocol. For example, " "ACIP." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Protocol details", description=( "Contains the description about the protocol under which the vaccine " "was administered." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) doseSequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="doseSequence", title="Dose number within sequence", description=( "Indicates the nominal position in a series of the next dose. This is " "the recommended dose number as per a specified protocol." ), json_schema_extra={ "element_property": True, }, ) doseSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doseSequence", title="Extension field for ``doseSequence``.", ) series: fhirtypes.StringType | None = Field( default=None, alias="series", title="Name of vaccination series", description=( "One possible path to achieve presumed immunity against a disease - " "within the context of an authority." ), json_schema_extra={ "element_property": True, }, ) series__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_series", title="Extension field for ``series``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImmunizationRecommendationRecommendationProtocol`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "doseSequence", "description", "authority", "series", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImmunizationRecommendationRecommendationProtocol`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/implementationguide.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ImplementationGuide Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ImplementationGuide(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A set of rules about how FHIR is used. A set of rules of how FHIR is used to solve a particular problem. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. """ __resource_type__ = "ImplementationGuide" binary: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="binary", title="Image, css, script, etc.", description=( "A binary file that is included in the implementation guide when it is" " published." ), json_schema_extra={ "element_property": True, }, ) binary__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_binary", title="Extension field for ``binary``." ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the implementation guide and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the implementation guide." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date this was last changed", description=( "The date (and optionally time) when the implementation guide was " "published. The date must change if and when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the implementation " "guide changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) dependency: typing.List[fhirtypes.ImplementationGuideDependencyType] | None = Field( default=None, alias="dependency", title="Another Implementation guide this depends on", description=( "Another implementation guide that this implementation depends on. " "Typically, an implementation guide uses value sets, profiles " "etc.defined in other implementation guides." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the implementation guide", description=( "A free text natural language description of the implementation guide " "from a consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A boolean value to indicate that this implementation guide is authored" " for testing purposes (or education/evaluation/marketing), and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) fhirVersion: fhirtypes.IdType | None = Field( default=None, alias="fhirVersion", title="FHIR Version this Implementation Guide targets", description=( "The version of the FHIR specification on which this " "ImplementationGuide is based - this is the formal version of the " "specification, without the revision number, e.g. " "[publication].[major].[minor], which is 3.0.2 for this version." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) fhirVersion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fhirVersion", title="Extension field for ``fhirVersion``." ) global_fhir: typing.List[fhirtypes.ImplementationGuideGlobalType] | None = Field( default=None, alias="global", title="Profiles that apply globally", description=( "A set of profiles that all resources covered by this implementation " "guide must conform to." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for implementation guide (if applicable)", description=( "A legal or geographic region in which the implementation guide is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this implementation guide (computer friendly)", description=( "A natural language name identifying the implementation guide. This " "name should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) package: typing.List[fhirtypes.ImplementationGuidePackageType] | None = Field( default=None, alias="package", title="Group of resources as used in .page.package", description=( "A logical group of resources. Logical groups can be used when building" " pages." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) page: fhirtypes.ImplementationGuidePageType | None = Field( default=None, alias="page", title="Page/Section in the Guide", description=( "A page / section in the implementation guide. The root page is the " "implementation guide home page." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the individual or organization that published the " "implementation guide." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this implementation guide. Enables tracking the life-" "cycle of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Logical URI to reference this implementation guide (globally unique)", description=( "An absolute URI that is used to identify this implementation guide " "when it is referenced in a specification, model, design or an " "instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD " "be an address at which this implementation guide is (or will be) " "published. The URL SHOULD include the major version of the " "implementation guide. For more information see [Technical and Business" " Versions](resource.html#versions)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Context the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching for appropriate implementation guide instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the implementation guide", description=( "The identifier that is used to identify this version of the " "implementation guide when it is referenced in a specification, model, " "design or instance. This is an arbitrary value managed by the " "implementation guide author and is not expected to be globally unique." " For example, it might be a timestamp (e.g. yyyymmdd) if a managed " "version is not available. There is also no expectation that versions " "can be placed in a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuide`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "version", "name", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "copyright", "fhirVersion", "dependency", "package", "global", "binary", "page", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuide`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "version", "name", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "fhirVersion", "dependency", "package", "global", "page", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("name", "name__ext"), ("status", "status__ext"), ("url", "url__ext"), ] return required_fields class ImplementationGuideDependency(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Another Implementation guide this depends on. Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, profiles etc.defined in other implementation guides. """ __resource_type__ = "ImplementationGuideDependency" type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="reference | inclusion", description="How the dependency is represented when the guide is published.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["reference", "inclusion"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) uri: fhirtypes.UriType | None = Field( default=None, alias="uri", title="Where to find dependency", description="Where the dependency is located.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uri", title="Extension field for ``uri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuideDependency`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "uri"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuideDependency`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "uri"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext"), ("uri", "uri__ext")] return required_fields class ImplementationGuideGlobal(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Profiles that apply globally. A set of profiles that all resources covered by this implementation guide must conform to. """ __resource_type__ = "ImplementationGuideGlobal" profile: fhirtypes.ReferenceType = Field( default=..., alias="profile", title="Profile that all resources must conform to", description="A reference to the profile that all instances must conform to.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="Type this profiles applies to", description="The type of resource that all instances must conform to.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuideGlobal`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "profile"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuideGlobal`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "profile"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields class ImplementationGuidePackage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Group of resources as used in .page.package. A logical group of resources. Logical groups can be used when building pages. """ __resource_type__ = "ImplementationGuidePackage" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Human readable text describing the package", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name used .page.package", description="The name for the group, as used in page.package.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) resource: typing.List[fhirtypes.ImplementationGuidePackageResourceType] = Field( default=..., alias="resource", title="Resource in the implementation guide", description=( "A resource that is part of the implementation guide. Conformance " "resources (value set, structure definition, capability statements " "etc.) are obvious candidates for inclusion, but any kind of resource " "can be included as an example resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuidePackage`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "description", "resource", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuidePackage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "name", "resource"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields class ImplementationGuidePackageResource(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Resource in the implementation guide. A resource that is part of the implementation guide. Conformance resources (value set, structure definition, capability statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource. """ __resource_type__ = "ImplementationGuidePackageResource" acronym: fhirtypes.StringType | None = Field( default=None, alias="acronym", title="Short code to identify the resource", description=( "A short code that may be used to identify the resource throughout the " "implementation guide." ), json_schema_extra={ "element_property": True, }, ) acronym__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_acronym", title="Extension field for ``acronym``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Reason why included in guide", description=( "A description of the reason that a resource has been included in the " "implementation guide." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) example: bool | None = Field( default=None, alias="example", title="If not an example, has its normal meaning", description=( "Whether a resource is included in the guide as part of the rules " "defined by the guide, or just as an example of a resource that " "conforms to the rules and/or help implementers understand the intent " "of the guide." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) example__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_example", title="Extension field for ``example``." ) exampleFor: fhirtypes.ReferenceType | None = Field( default=None, alias="exampleFor", title="Resource this is an example of (if applicable)", description=( "Another resource that this resource is an example for. This is mostly " "used for resources that are included as examples of " "StructureDefinitions." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Human Name for the resource", description=( "A human assigned name for the resource. All resources SHOULD have a " "name, but the name may be extracted from the resource (e.g. " "ValueSet.name)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) sourceReference: fhirtypes.ReferenceType | None = Field( default=None, alias="sourceReference", title="Location of the resource", description="Where this resource is found.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e source[x] "one_of_many": "source", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) sourceUri: fhirtypes.UriType | None = Field( default=None, alias="sourceUri", title="Location of the resource", description="Where this resource is found.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e source[x] "one_of_many": "source", "one_of_many_required": True, }, ) sourceUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceUri", title="Extension field for ``sourceUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuidePackageResource`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "example", "name", "description", "acronym", "sourceUri", "sourceReference", "exampleFor", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuidePackageResource`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "example", "name", "sourceUri", "sourceReference"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("example", "example__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"source": ["sourceReference", "sourceUri"]} return one_of_many_fields class ImplementationGuidePage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Page/Section in the Guide. A page / section in the implementation guide. The root page is the implementation guide home page. """ __resource_type__ = "ImplementationGuidePage" format: fhirtypes.CodeType | None = Field( default=None, alias="format", title="Format of the page (e.g. html, markdown, etc.)", description="The format of the page.", json_schema_extra={ "element_property": True, }, ) format__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_format", title="Extension field for ``format``." ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title=( "page | example | list | include | directory | dictionary | toc | " "resource" ), description=( "The kind of page that this is. Some pages are autogenerated (list, " "example), and other kinds are of interest so that tools can navigate " "the user to the page of interest." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "page", "example", "list", "include", "directory", "dictionary", "toc", "resource", ], }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) package: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="package", title="Name of package to include", description=( "For constructed pages, a list of packages to include in the page (or " "else empty for everything)." ), json_schema_extra={ "element_property": True, }, ) package__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_package", title="Extension field for ``package``." ) page: typing.List[fhirtypes.ImplementationGuidePageType] | None = Field( default=None, alias="page", title="Nested Pages / Sections", description="Nested Pages/Sections under this page.", json_schema_extra={ "element_property": True, }, ) source: fhirtypes.UriType | None = Field( default=None, alias="source", title="Where to find that page", description="The source address for the page.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_source", title="Extension field for ``source``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Short title shown for navigational assistance", description=( "A short title used to represent this page in navigational structures " "such as table of contents, bread crumbs, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) type: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="type", title="Kind of resource to include in the list", description="For constructed pages, what kind of resources to include in the list.", json_schema_extra={ "element_property": True, }, ) type__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuidePage`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "source", "title", "kind", "type", "package", "format", "page", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuidePage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "source", "title", "kind"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("kind", "kind__ext"), ("source", "source__ext"), ("title", "title__ext"), ] return required_fields ================================================ FILE: fhir/resources/STU3/library.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Library Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class Library(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Represents a library of quality improvement components. The Library resource is a general-purpose container for knowledge asset definitions. It can be used to describe and expose existing knowledge assets such as logic libraries and information model descriptions, as well as to describe a collection of knowledge assets. """ __resource_type__ = "Library" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the library was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) content: typing.List[fhirtypes.AttachmentType] | None = Field( default=None, alias="content", title="Contents of the library, either embedded or referenced", description=( "The content of the library as an Attachment. The content may be a " "reference to a url, or may be directly embedded as a base-64 string. " "Either way, the contentType of the attachment determines how to " "interpret the content." ), json_schema_extra={ "element_property": True, }, ) contributor: typing.List[fhirtypes.ContributorType] | None = Field( default=None, alias="contributor", title="A content contributor", description=( "A contributor to the content of the library, including authors, " "editors, reviewers, and endorsers." ), json_schema_extra={ "element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the library and/or its contents. " "Copyright statements are generally legal restrictions on the use and " "publishing of the library." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) dataRequirement: typing.List[fhirtypes.DataRequirementType] | None = Field( default=None, alias="dataRequirement", title="What data is referenced by this library", description=( "Describes a set of data that must be provided in order to be able to " "successfully perform the computations defined by the library." ), json_schema_extra={ "element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date this was last changed", description=( "The date (and optionally time) when the library was published. The " "date must change if and when the business version changes and it must " "change if the status code changes. In addition, it should change when " "the substantive content of the library changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the library", description=( "A free text natural language description of the library from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the library is expected to be used", description=( "The period during which the library content was or is planned to be in" " active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A boolean value to indicate that this library is authored for testing " "purposes (or education/evaluation/marketing), and is not intended to " "be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the library", description=( "A formal identifier that is used to identify this library when it is " "represented in other formats, or referenced in a specification, model," " design or an instance. e.g. CMS or NQF identifiers for a measure " "artifact. Note that at least one identifier is required for non-" "experimental active artifacts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for library (if applicable)", description=( "A legal or geographic region in which the library is intended to be " "used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the library was last reviewed", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval, but doesn't change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this library (computer friendly)", description=( "A natural language name identifying the library. This name should be " "usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) parameter: typing.List[fhirtypes.ParameterDefinitionType] | None = Field( default=None, alias="parameter", title="Parameters defined by the library", description="The parameter element defines parameters used by the library.", json_schema_extra={ "element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description="The name of the individual or organization that published the library.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this library is defined", description=( "Explaination of why this library is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Additional documentation, citations, etc.", description=( "Related artifacts such as additional documentation, justification, or " "bibliographic references." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this library. Enables tracking the life-cycle of the " "content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this library (human friendly)", description="A short, descriptive, user-friendly title for the library.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) topic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="topic", title="E.g. Education, Treatment, Assessment, etc", description=( "Descriptive topics related to the content of the library. Topics " "provide a high-level categorization of the library that can be useful " "for filtering and searching." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title=( "logic-library | model-definition | asset-collection | module-" "definition" ), description=( "Identifies the type of library such as a Logic Library, Model " "Definition, Asset Collection, or Module Definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Logical URI to reference this library (globally unique)", description=( "An absolute URI that is used to identify this library when it is " "referenced in a specification, model, design or an instance. This " "SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at" " which this library is (or will be) published. The URL SHOULD include " "the major version of the library. For more information see [Technical " "and Business Versions](resource.html#versions)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) usage: fhirtypes.StringType | None = Field( default=None, alias="usage", title="Describes the clinical usage of the library", description=( "A detailed description of how the library is used from a clinical " "perspective." ), json_schema_extra={ "element_property": True, }, ) usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usage", title="Extension field for ``usage``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Context the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching for appropriate library instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the library", description=( "The identifier that is used to identify this version of the library " "when it is referenced in a specification, model, design or instance. " "This is an arbitrary value managed by the library author and is not " "expected to be globally unique. For example, it might be a timestamp " "(e.g. yyyymmdd) if a managed version is not available. There is also " "no expectation that versions can be placed in a lexicographical " "sequence. To provide a version consistent with the Decision Support " "Service specification, use the format Major.Minor.Revision (e.g. " "1.0.0). For more information on versioning knowledge assets, refer to " "the Decision Support Service specification. Note that a version is " "required for non-experimental active artifacts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Library`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "status", "experimental", "type", "date", "publisher", "description", "purpose", "usage", "approvalDate", "lastReviewDate", "effectivePeriod", "useContext", "jurisdiction", "topic", "contributor", "contact", "copyright", "relatedArtifact", "parameter", "dataRequirement", "content", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Library`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "type", "date", "publisher", "description", "effectivePeriod", "useContext", "jurisdiction", "contact", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/linkage.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Linkage Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Linkage(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Links records for 'same' item. Identifies two or more records (resource instances) that are referring to the same real-world "occurrence". """ __resource_type__ = "Linkage" active: bool | None = Field( default=None, alias="active", title="Whether this linkage assertion is active or not", description=( "Indicates whether the asserted set of linkages are considered to be " '"in effect".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="Who is responsible for linkages", description=( "Identifies the user or organization responsible for asserting the " "linkages and who establishes the context for evaluating the nature of " "each linkage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "Organization"], }, ) item: typing.List[fhirtypes.LinkageItemType] = Field( default=..., alias="item", title="Item to be linked", description=( "Identifies one of the records that is considered to refer to the same " "real-world occurrence as well as how the items hould be evaluated " "within the collection of linked items." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Linkage`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "active", "author", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Linkage`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "active", "author", "item"] class LinkageItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Item to be linked. Identifies one of the records that is considered to refer to the same real- world occurrence as well as how the items hould be evaluated within the collection of linked items. """ __resource_type__ = "LinkageItem" resource: fhirtypes.ReferenceType = Field( default=..., alias="resource", title="Resource being linked", description="The resource instance being linked as part of the group.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="source | alternate | historical", description=( 'Distinguishes which item is "source of truth" (if any) and which items' " are no longer considered to be current representations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["source", "alternate", "historical"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``LinkageItem`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "resource"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``LinkageItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "resource"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/list.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/List Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class List(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information summarized from a list of other resources. A set of information summarized from a list of other resources. """ __resource_type__ = "List" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="What the purpose of this list is", description="This code defines the purpose of the list - why it was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When the list was prepared", description="The date that the list was prepared.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) emptyReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="emptyReason", title="Why list is empty", description="If the list is empty, why the list is empty.", json_schema_extra={ "element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Context in which list created", description="The encounter that is the context in which this list was created.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) entry: typing.List[fhirtypes.ListEntryType] | None = Field( default=None, alias="entry", title="Entries in the list", description="Entries in this list.", json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description=( "Identifier for the List assigned for business purposes outside the " "context of FHIR." ), json_schema_extra={ "element_property": True, }, ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="working | snapshot | changes", description=( "How this list was prepared - whether it is a working list that is " "suitable for being maintained on an ongoing basis, or if it represents" " a snapshot of a list of items from another source, or whether it is a" " prepared list where items may be marked as added, modified or " "deleted." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["working", "snapshot", "changes"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments about the list", description="Comments that apply to the overall list.", json_schema_extra={ "element_property": True, }, ) orderedBy: fhirtypes.CodeableConceptType | None = Field( default=None, alias="orderedBy", title="What order the list has", description="What order applies to the items in the list.", json_schema_extra={ "element_property": True, }, ) source: fhirtypes.ReferenceType | None = Field( default=None, alias="source", title="Who and/or what defined the list contents (aka Author)", description=( "The entity responsible for deciding what the contents of the list " "were. Where the list was created by a human, this is the same as the " "author of the list." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "Patient", "Device"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="current | retired | entered-in-error", description="Indicates the current state of this list.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["current", "retired", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="If all resources have the same subject", description=( "The common subject (or patient) of the resources that are in the list," " if there is one." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group", "Device", "Location"], }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Descriptive name for the list", description="A label for the list assigned by the author.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``List`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "mode", "title", "code", "subject", "encounter", "date", "source", "orderedBy", "note", "entry", "emptyReason", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``List`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "status", "mode", "title", "code", "subject", "date", "source", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("mode", "mode__ext"), ("status", "status__ext")] return required_fields class ListEntry(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Entries in the list. Entries in this list. """ __resource_type__ = "ListEntry" date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When item added to list", description="When this item was added to the list.", json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) deleted: bool | None = Field( default=None, alias="deleted", title="If this item is actually marked as deleted", description="True if this item is marked as deleted in the list.", json_schema_extra={ "element_property": True, }, ) deleted__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deleted", title="Extension field for ``deleted``." ) flag: fhirtypes.CodeableConceptType | None = Field( default=None, alias="flag", title="Status/Workflow information about this item", description=( "The flag allows the system constructing the list to indicate the role " "and significance of the item in the list." ), json_schema_extra={ "element_property": True, }, ) item: fhirtypes.ReferenceType = Field( default=..., alias="item", title="Actual entry", description="A reference to the actual resource from which data was derived.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ListEntry`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "flag", "deleted", "date", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ListEntry`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/location.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Location Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Location(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details and position information for a physical place. Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated. """ __resource_type__ = "Location" address: fhirtypes.AddressType | None = Field( default=None, alias="address", title="Physical location", description=None, json_schema_extra={ "element_property": True, }, ) alias: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="alias", title=( "A list of\u00a0alternate names that the location is known as, or was known " "as in the past" ), description=None, json_schema_extra={ "element_property": True, }, ) alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_alias", title="Extension field for ``alias``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title=( "Additional details about the location that could be displayed as " "further information to identify the location beyond its name" ), description=( "Description of the Location, which helps in finding or referencing the" " place." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title=( "Technical endpoints providing access to services operated for the " "location" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique code or number identifying the location to its users", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) managingOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="managingOrganization", title="Organization responsible for provisioning and upkeep", description=( "The organization responsible for the provisioning and upkeep of the " "location." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="instance | kind", description=( "Indicates whether a resource instance represents a specific location " "or a class of locations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["instance", "kind"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name of the location as used by humans", description="Name of the location as used by humans. Does not need to be unique.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) operationalStatus: fhirtypes.CodingType | None = Field( default=None, alias="operationalStatus", title="The Operational status of the location (typically only for a bed/room)", description=( "The Operational status covers operation values most relevant to beds " "(but can also apply to rooms/units/chair/etc such as an isolation " "unit/dialisys chair). This typically covers concepts such as " "contamination, housekeeping and other activities\u00a0like maintenance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) partOf: fhirtypes.ReferenceType | None = Field( default=None, alias="partOf", title="Another Location this one is physically part of", description="Another Location which this Location is physically part of.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) physicalType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="physicalType", title="Physical form of the location", description="Physical form of the location, e.g. building, room, vehicle, road.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) position: fhirtypes.LocationPositionType | None = Field( default=None, alias="position", title="The absolute geographic location", description=( "The absolute geographic location of the Location, expressed using the " "WGS84 datum (This is the same co-ordinate system used in KML)." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | suspended | inactive", description=( "The status property covers the general availability of the resource, " "not the current value which may be covered by the operationStatus, or " "by a schedule/slots if they are configured for the location." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "suspended", "inactive"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="Contact details of the location", description=( "The contact details of communication devices available at the " "location. This can include phone numbers, fax numbers, mobile numbers," " email addresses and web sites." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Type of function performed", description="Indicates the type of function performed at the location.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Location`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "operationalStatus", "name", "alias", "description", "mode", "type", "telecom", "address", "physicalType", "position", "managingOrganization", "partOf", "endpoint", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Location`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "operationalStatus", "name", "description", "mode", "type", "physicalType", "managingOrganization", ] class LocationPosition(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The absolute geographic location. The absolute geographic location of the Location, expressed using the WGS84 datum (This is the same co-ordinate system used in KML). """ __resource_type__ = "LocationPosition" altitude: fhirtypes.DecimalType | None = Field( default=None, alias="altitude", title="Altitude with WGS84 datum", description=( "Altitude. The value domain and the interpretation are the same as for " "the text of the altitude element in KML (see notes below)." ), json_schema_extra={ "element_property": True, }, ) altitude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_altitude", title="Extension field for ``altitude``." ) latitude: fhirtypes.DecimalType | None = Field( default=None, alias="latitude", title="Latitude with WGS84 datum", description=( "Latitude. The value domain and the interpretation are the same as for " "the text of the latitude element in KML (see notes below)." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) latitude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_latitude", title="Extension field for ``latitude``." ) longitude: fhirtypes.DecimalType | None = Field( default=None, alias="longitude", title="Longitude with WGS84 datum", description=( "Longitude. The value domain and the interpretation are the same as for" " the text of the longitude element in KML (see notes below)." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) longitude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_longitude", title="Extension field for ``longitude``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``LocationPosition`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "longitude", "latitude", "altitude", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``LocationPosition`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("latitude", "latitude__ext"), ("longitude", "longitude__ext"), ] return required_fields ================================================ FILE: fhir/resources/STU3/measure.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Measure Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Measure(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A quality measure definition. The Measure resource provides the definition of a quality measure. """ __resource_type__ = "Measure" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the measure was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) clinicalRecommendationStatement: fhirtypes.MarkdownType | None = Field( default=None, alias="clinicalRecommendationStatement", title="Summary of clinical guidelines", description=( "Provides a summary of relevant clinical guidelines or other clinical " "recommendations supporting the measure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) clinicalRecommendationStatement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_clinicalRecommendationStatement", title="Extension field for ``clinicalRecommendationStatement``.", ) compositeScoring: fhirtypes.CodeableConceptType | None = Field( default=None, alias="compositeScoring", title="opportunity | all-or-nothing | linear | weighted", description=( "If this is a composite measure, the scoring method used to combine the" " component measures to determine the composite score." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contributor: typing.List[fhirtypes.ContributorType] | None = Field( default=None, alias="contributor", title="A content contributor", description=( "A contributor to the content of the measure, including authors, " "editors, reviewers, and endorsers." ), json_schema_extra={ "element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the measure and/or its contents. " "Copyright statements are generally legal restrictions on the use and " "publishing of the measure." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date this was last changed", description=( "The date (and optionally time) when the measure was published. The " "date must change if and when the business version changes and it must " "change if the status code changes. In addition, it should change when " "the substantive content of the measure changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) definition: typing.List[fhirtypes.MarkdownType | None] | None = Field( default=None, alias="definition", title="Defined terms used in the measure documentation", description="Provides a description of an individual term used within the measure.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) definition__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the measure", description=( "A free text natural language description of the measure from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) disclaimer: fhirtypes.MarkdownType | None = Field( default=None, alias="disclaimer", title="Disclaimer for use of the measure or its referenced content", description=( "Notices and disclaimers regarding the use of the measure, or related " "to intellectual property (such as code systems) referenced by the " "measure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) disclaimer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_disclaimer", title="Extension field for ``disclaimer``." ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the measure is expected to be used", description=( "The period during which the measure content was or is planned to be in" " active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A boolean value to indicate that this measure is authored for testing " "purposes (or education/evaluation/marketing), and is not intended to " "be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) group: typing.List[fhirtypes.MeasureGroupType] | None = Field( default=None, alias="group", title="Population criteria group", description="A group of population criteria for the measure.", json_schema_extra={ "element_property": True, }, ) guidance: fhirtypes.MarkdownType | None = Field( default=None, alias="guidance", title="Additional guidance for implementers", description=( "Additional guidance for the measure including how it can be used in a " "clinical context, and the intent of the measure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) guidance__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_guidance", title="Extension field for ``guidance``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the measure", description=( "A formal identifier that is used to identify this measure when it is " "represented in other formats, or referenced in a specification, model," " design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) improvementNotation: fhirtypes.StringType | None = Field( default=None, alias="improvementNotation", title=( "Improvement notation for the measure, e.g. higher score indicates " "better quality" ), description=( "Information on whether an increase or decrease in score is the " "preferred result (e.g., a higher score indicates better quality OR a " "lower score indicates better quality OR quality is whthin a range)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) improvementNotation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_improvementNotation", title="Extension field for ``improvementNotation``.", ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for measure (if applicable)", description=( "A legal or geographic region in which the measure is intended to be " "used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the measure was last reviewed", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval, but doesn't change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) library: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="library", title="Logic used by the measure", description=( "A reference to a Library resource containing the formal logic used by " "the measure." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Library"], }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this measure (computer friendly)", description=( "A natural language name identifying the measure. This name should be " "usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description="The name of the individual or organization that published the measure.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this measure is defined", description=( "Explaination of why this measure is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) rateAggregation: fhirtypes.StringType | None = Field( default=None, alias="rateAggregation", title="How is rate aggregation performed for this measure", description=( "Describes how to combine the information calculated, based on logic in" " each of several populations, into one summarized result." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) rateAggregation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rateAggregation", title="Extension field for ``rateAggregation``.", ) rationale: fhirtypes.MarkdownType | None = Field( default=None, alias="rationale", title="Why does this measure exist", description=( "Provides a succint statement of the need for the measure. Usually " "includes statements pertaining to importance criterion: impact, gap in" " care, and evidence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) rationale__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rationale", title="Extension field for ``rationale``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Additional documentation, citations, etc", description=( "Related artifacts such as additional documentation, justification, or " "bibliographic references." ), json_schema_extra={ "element_property": True, }, ) riskAdjustment: fhirtypes.StringType | None = Field( default=None, alias="riskAdjustment", title="How is risk adjustment applied for this measure", description=( "A description of the risk adjustment factors that may impact the " "resulting score for the measure and how they may be accounted for when" " computing and reporting measure results." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) riskAdjustment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_riskAdjustment", title="Extension field for ``riskAdjustment``.", ) scoring: fhirtypes.CodeableConceptType | None = Field( default=None, alias="scoring", title="proportion | ratio | continuous-variable | cohort", description=( "Indicates how the calculation is performed for the measure, including " "proportion, ratio, continuous variable, and cohort. The value set is " "extensible, allowing additional measure scoring types to be " "represented." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) set: fhirtypes.StringType | None = Field( default=None, alias="set", title="The measure set, e.g. Preventive Care and Screening", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) set__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_set", title="Extension field for ``set``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this measure. Enables tracking the life-cycle of the " "content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) supplementalData: typing.List[fhirtypes.MeasureSupplementalDataType] | None = Field( default=None, alias="supplementalData", title="What other data should be reported with the measure", description=( "The supplemental data criteria for the measure report, specified as " "either the name of a valid CQL expression within a referenced library," " or a valid FHIR Resource Path." ), json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this measure (human friendly)", description="A short, descriptive, user-friendly title for the measure.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) topic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="topic", title="E.g. Education, Treatment, Assessment, etc", description=( "Descriptive topics related to the content of the measure. Topics " "provide a high-level categorization of the type of the measure that " "can be useful for filtering and searching." ), json_schema_extra={ "element_property": True, }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="process | outcome | structure | patient-reported-outcome | composite", description=( "Indicates whether the measure is used to examine a process, an outcome" " over time, a patient-reported outcome, or a structure measure such as" " utilization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Logical URI to reference this measure (globally unique)", description=( "An absolute URI that is used to identify this measure when it is " "referenced in a specification, model, design or an instance. This " "SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at" " which this measure is (or will be) published. The URL SHOULD include " "the major version of the measure. For more information see [Technical " "and Business Versions](resource.html#versions)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) usage: fhirtypes.StringType | None = Field( default=None, alias="usage", title="Describes the clinical usage of the measure", description=( "A detailed description of how the measure is used from a clinical " "perspective." ), json_schema_extra={ "element_property": True, }, ) usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usage", title="Extension field for ``usage``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Context the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching for appropriate measure instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the measure", description=( "The identifier that is used to identify this version of the measure " "when it is referenced in a specification, model, design or instance. " "This is an arbitrary value managed by the measure author and is not " "expected to be globally unique. For example, it might be a timestamp " "(e.g. yyyymmdd) if a managed version is not available. There is also " "no expectation that versions can be placed in a lexicographical " "sequence. To provide a version consistent with the Decision Support " "Service specification, use the format Major.Minor.Revision (e.g. " "1.0.0). For more information on versioning knowledge assets, refer to " "the Decision Support Service specification. Note that a version is " "required for non-experimental active artifacts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Measure`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "description", "purpose", "usage", "approvalDate", "lastReviewDate", "effectivePeriod", "useContext", "jurisdiction", "topic", "contributor", "contact", "copyright", "relatedArtifact", "library", "disclaimer", "scoring", "compositeScoring", "type", "riskAdjustment", "rateAggregation", "rationale", "clinicalRecommendationStatement", "improvementNotation", "definition", "guidance", "set", "group", "supplementalData", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Measure`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "description", "effectivePeriod", "useContext", "jurisdiction", "contact", "disclaimer", "scoring", "compositeScoring", "type", "riskAdjustment", "rateAggregation", "rationale", "clinicalRecommendationStatement", "improvementNotation", "definition", "guidance", "set", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class MeasureGroup(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Population criteria group. A group of population criteria for the measure. """ __resource_type__ = "MeasureGroup" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Summary description", description="The human readable description of this population group.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) identifier: fhirtypes.IdentifierType = Field( default=..., alias="identifier", title="Unique identifier", description=( "A unique identifier for the group. This identifier will used to report" " data for the group in the measure report." ), json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Short name", description="Optional name or short description of this group.", json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) population: typing.List[fhirtypes.MeasureGroupPopulationType] | None = Field( default=None, alias="population", title="Population criteria", description="A population criteria for the measure.", json_schema_extra={ "element_property": True, }, ) stratifier: typing.List[fhirtypes.MeasureGroupStratifierType] | None = Field( default=None, alias="stratifier", title="Stratifier criteria for the measure", description=( "The stratifier criteria for the measure report, specified as either " "the name of a valid CQL expression defined within a referenced " "library, or a valid FHIR Resource Path." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureGroup`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "name", "description", "population", "stratifier", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureGroup`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MeasureGroupPopulation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Population criteria. A population criteria for the measure. """ __resource_type__ = "MeasureGroupPopulation" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title=( "initial-population | numerator | numerator-exclusion | denominator | " "denominator-exclusion | denominator-exception | measure-population | " "measure-population-exclusion | measure-observation" ), description="The type of population criteria.", json_schema_extra={ "element_property": True, }, ) criteria: fhirtypes.StringType | None = Field( default=None, alias="criteria", title=( "The name of a valid referenced CQL expression (may be namespaced) that" " defines this population criteria" ), description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) criteria__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_criteria", title="Extension field for ``criteria``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="The human readable description of this population criteria", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Unique identifier", description=( "A unique identifier for the population criteria. This identifier is " "used to report data against this criteria within the measure report." ), json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Short name", description="Optional name or short description of this population.", json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureGroupPopulation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "code", "name", "description", "criteria", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureGroupPopulation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("criteria", "criteria__ext")] return required_fields class MeasureGroupStratifier(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Stratifier criteria for the measure. The stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a referenced library, or a valid FHIR Resource Path. """ __resource_type__ = "MeasureGroupStratifier" criteria: fhirtypes.StringType | None = Field( default=None, alias="criteria", title="How the measure should be stratified", description=( "The criteria for the stratifier. This must be the name of an " "expression defined within a referenced library." ), json_schema_extra={ "element_property": True, }, ) criteria__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_criteria", title="Extension field for ``criteria``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title=( "The identifier for the stratifier used to coordinate the reported data" " back to this stratifier" ), description=None, json_schema_extra={ "element_property": True, }, ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="Path to the stratifier", description=( "The path to an element that defines the stratifier, specified as a " "valid FHIR resource path." ), json_schema_extra={ "element_property": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureGroupStratifier`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "criteria", "path", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureGroupStratifier`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MeasureSupplementalData(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What other data should be reported with the measure. The supplemental data criteria for the measure report, specified as either the name of a valid CQL expression within a referenced library, or a valid FHIR Resource Path. """ __resource_type__ = "MeasureSupplementalData" criteria: fhirtypes.StringType | None = Field( default=None, alias="criteria", title="Expression describing additional data to be reported", description=( "The criteria for the supplemental data. This must be the name of a " "valid expression defined within a referenced library, and defines the " "data to be returned for this element." ), json_schema_extra={ "element_property": True, }, ) criteria__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_criteria", title="Extension field for ``criteria``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Identifier, unique within the measure", description="An identifier for the supplemental data.", json_schema_extra={ "element_property": True, }, ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="Path to the supplemental data element", description=( "The supplemental data to be supplied as part of the measure response, " "specified as a valid FHIR Resource Path." ), json_schema_extra={ "element_property": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) usage: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="usage", title="supplemental-data | risk-adjustment-factor", description=( "An indicator of the intended usage for the supplemental data element. " "Supplemental data indicates the data is additional information " "requested to augment the measure information. Risk adjustment factor " "indicates the data is additional information used to calculate risk " "adjustment factors when applying a risk model to the measure " "calculation." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureSupplementalData`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "usage", "criteria", "path", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureSupplementalData`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/measurereport.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MeasureReport Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MeasureReport(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Results of a measure evaluation. The MeasureReport resource contains the results of evaluating a measure. """ __resource_type__ = "MeasureReport" date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When the report was generated", description="The date this measure report was generated.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) evaluatedResources: fhirtypes.ReferenceType | None = Field( default=None, alias="evaluatedResources", title="What data was evaluated to produce the measure score", description=( "A reference to a Bundle containing the Resources that were used in the" " evaluation of this report." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Bundle"], }, ) group: typing.List[fhirtypes.MeasureReportGroupType] | None = Field( default=None, alias="group", title="Measure results for each group", description=( "The results of the calculation, one for each population group in the " "measure." ), json_schema_extra={ "element_property": True, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Additional identifier for the Report", description=( "A formal identifier that is used to identify this report when it is " "represented in other formats, or referenced in a specification, model," " design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) measure: fhirtypes.ReferenceType = Field( default=..., alias="measure", title="What measure was evaluated", description="A reference to the Measure that was evaluated to produce this report.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Measure"], }, ) patient: fhirtypes.ReferenceType | None = Field( default=None, alias="patient", title="What patient the report is for", description="Optional Patient if the report was requested for a single patient.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) period: fhirtypes.PeriodType = Field( default=..., alias="period", title="What period the report covers", description="The reporting period for which the report was calculated.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reportingOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="reportingOrganization", title="Who is reporting the data", description="Reporting Organization.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="complete | pending | error", description=( "The report status. No data will be available until the report status " "is complete." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["complete", "pending", "error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="individual | patient-list | summary", description=( "The type of measure report. This may be an individual report, which " "provides a single patient's score for the measure; a patient listing, " "which returns the list of patients that meet the various criteria in " "the measure; or a summary report, which returns a population count for" " each of the criteria in the measure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["individual", "patient-list", "summary"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureReport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "type", "measure", "patient", "date", "reportingOrganization", "period", "group", "evaluatedResources", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureReport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "type", "measure", "patient", "date", "reportingOrganization", "period", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext"), ("type", "type__ext")] return required_fields class MeasureReportGroup(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Measure results for each group. The results of the calculation, one for each population group in the measure. """ __resource_type__ = "MeasureReportGroup" identifier: fhirtypes.IdentifierType = Field( default=..., alias="identifier", title="What group of the measure", description=( "The identifier of the population group as defined in the measure " "definition." ), json_schema_extra={ "element_property": True, }, ) measureScore: fhirtypes.DecimalType | None = Field( default=None, alias="measureScore", title="What score this group achieved", description=( "The measure score for this population group, calculated as appropriate" " for the measure type and scoring method, and based on the contents of" " the populations defined in the group." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) measureScore__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_measureScore", title="Extension field for ``measureScore``.", ) population: typing.List[fhirtypes.MeasureReportGroupPopulationType] | None = Field( default=None, alias="population", title="The populations in the group", description=( "The populations that make up the population group, one for each type " "of population appropriate for the measure." ), json_schema_extra={ "element_property": True, }, ) stratifier: typing.List[fhirtypes.MeasureReportGroupStratifierType] | None = Field( default=None, alias="stratifier", title="Stratification results", description=( "When a measure includes multiple stratifiers, there will be a " "stratifier group for each stratifier defined by the measure." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureReportGroup`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "population", "measureScore", "stratifier", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureReportGroup`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "measureScore"] class MeasureReportGroupPopulation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The populations in the group. The populations that make up the population group, one for each type of population appropriate for the measure. """ __resource_type__ = "MeasureReportGroupPopulation" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title=( "initial-population | numerator | numerator-exclusion | denominator | " "denominator-exclusion | denominator-exception | measure-population | " "measure-population-exclusion | measure-score" ), description="The type of the population.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) count: fhirtypes.IntegerType | None = Field( default=None, alias="count", title="Size of the population", description="The number of members of the population.", json_schema_extra={ "element_property": True, }, ) count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_count", title="Extension field for ``count``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Population identifier as defined in the measure", description=( "The identifier of the population being reported, as defined by the " "population element of the measure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patients: fhirtypes.ReferenceType | None = Field( default=None, alias="patients", title="For patient-list reports, the patients in this population", description=( "This element refers to a List of patient level MeasureReport " "resources, one for each patient in this population." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["List"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureReportGroupPopulation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "code", "count", "patients", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureReportGroupPopulation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "identifier", "code"] class MeasureReportGroupStratifier(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Stratification results. When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure. """ __resource_type__ = "MeasureReportGroupStratifier" identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="What stratifier of the group", description=( "The identifier of this stratifier, as defined in the measure " "definition." ), json_schema_extra={ "element_property": True, }, ) stratum: typing.List[ fhirtypes.MeasureReportGroupStratifierStratumType ] | None = Field( default=None, alias="stratum", title="Stratum results, one for each unique value in the stratifier", description=( "This element contains the results for a single stratum within the " "stratifier. For example, when stratifying on administrative gender, " "there will be four strata, one for each possible gender value." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureReportGroupStratifier`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "identifier", "stratum"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureReportGroupStratifier`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MeasureReportGroupStratifierStratum(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Stratum results, one for each unique value in the stratifier. This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value. """ __resource_type__ = "MeasureReportGroupStratifierStratum" measureScore: fhirtypes.DecimalType | None = Field( default=None, alias="measureScore", title="What score this stratum achieved", description=( "The measure score for this stratum, calculated as appropriate for the " "measure type and scoring method, and based on only the members of this" " stratum." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) measureScore__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_measureScore", title="Extension field for ``measureScore``.", ) population: typing.List[ fhirtypes.MeasureReportGroupStratifierStratumPopulationType ] | None = Field( default=None, alias="population", title="Population results in this stratum", description=( "The populations that make up the stratum, one for each type of " "population appropriate to the measure." ), json_schema_extra={ "element_property": True, }, ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The stratum value, e.g. male", description=( "The value for this stratum, expressed as a string. When defining " "stratifiers on complex values, the value must be rendered such that " "the value for each stratum within the stratifier is unique." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureReportGroupStratifierStratum`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "value", "population", "measureScore", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureReportGroupStratifierStratum`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "measureScore"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("value", "value__ext")] return required_fields class MeasureReportGroupStratifierStratumPopulation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Population results in this stratum. The populations that make up the stratum, one for each type of population appropriate to the measure. """ __resource_type__ = "MeasureReportGroupStratifierStratumPopulation" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title=( "initial-population | numerator | numerator-exclusion | denominator | " "denominator-exclusion | denominator-exception | measure-population | " "measure-population-exclusion | measure-score" ), description="The type of the population.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) count: fhirtypes.IntegerType | None = Field( default=None, alias="count", title="Size of the population", description="The number of members of the population in this stratum.", json_schema_extra={ "element_property": True, }, ) count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_count", title="Extension field for ``count``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Population identifier as defined in the measure", description=( "The identifier of the population being reported, as defined by the " "population element of the measure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patients: fhirtypes.ReferenceType | None = Field( default=None, alias="patients", title="For patient-list reports, the patients in this population", description=( "This element refers to a List of patient level MeasureReport " "resources, one for each patient in this population in this stratum." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["List"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureReportGroupStratifierStratumPopulation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "code", "count", "patients", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureReportGroupStratifierStratumPopulation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "identifier", "code"] ================================================ FILE: fhir/resources/STU3/media.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Media Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class Media(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference. """ __resource_type__ = "Media" basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Procedure that caused this media to be created", description=( "A procedure that is fulfilled in whole or in part by the creation of " "this media." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ProcedureRequest"], }, ) bodySite: fhirtypes.CodeableConceptType | None = Field( default=None, alias="bodySite", title="Body part in media", description=( "Indicates the site on the subject's body where the media was collected" " (i.e. the target site)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) content: fhirtypes.AttachmentType = Field( default=..., alias="content", title="Actual Media - reference or data", description=( "The actual content of the media - inline or by direct reference to the" " media source file." ), json_schema_extra={ "element_property": True, }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Encounter / Episode associated with media", description=( "The encounter or episode of care that establishes the context for this" " media." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) device: fhirtypes.ReferenceType | None = Field( default=None, alias="device", title="Observing Device", description="The device used to collect the media.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device", "DeviceMetric"], }, ) duration: fhirtypes.UnsignedIntType | None = Field( default=None, alias="duration", title="Length in seconds (audio / video)", description="The duration of the recording in seconds - for audio and video.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) duration__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_duration", title="Extension field for ``duration``." ) frames: fhirtypes.PositiveIntType | None = Field( default=None, alias="frames", title="Number of frames if > 1 (photo)", description=( "The number of frames in a photo. This is used with a multi-page fax, " "or an imaging acquisition context that takes multiple slices in a " "single image, or an animated gif. If there is more than one frame, " "this SHALL have a value in order to alert interface software that a " "multi-frame capable rendering widget is required." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) frames__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_frames", title="Extension field for ``frames``." ) height: fhirtypes.PositiveIntType | None = Field( default=None, alias="height", title="Height of the image in pixels (photo/video)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) height__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_height", title="Extension field for ``height``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifier(s) for the image", description=( "Identifiers associated with the image - these may include identifiers " "for the image itself, identifiers for the context of its collection " "(e.g. series ids) and context ids such as accession numbers or other " "workflow identifiers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the media", description=( "Comments made about the media by the performer, subject or other " "participants." ), json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When Media was collected", description="The date and time(s) at which the media was collected.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="When Media was collected", description="The date and time(s) at which the media was collected.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) operator: fhirtypes.ReferenceType | None = Field( default=None, alias="operator", title="The person who generated the image", description="The person who administered the collection of the image.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Why was event performed?", description="Describes why the event occurred in coded or textual form.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Who/What this Media is a record of", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "Group", "Device", "Specimen", ], }, ) subtype: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subtype", title="The type of acquisition equipment/process", description=( "Details of the type of the media - usually, how it was acquired (what " "type of device). If images sourced from a DICOM system, are wrapped in" " a Media resource, then this is the modality." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="photo | video | audio", description=( "Whether the media is a photo (still image), an audio recording, or a " "video recording." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["photo", "video", "audio"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) view: fhirtypes.CodeableConceptType | None = Field( default=None, alias="view", title="Imaging view, e.g. Lateral or Antero-posterior", description="The name of the imaging view e.g. Lateral or Antero-posterior (AP).", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) width: fhirtypes.PositiveIntType | None = Field( default=None, alias="width", title="Width of the image in pixels (photo/video)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) width__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_width", title="Extension field for ``width``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Media`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "type", "subtype", "view", "subject", "context", "occurrenceDateTime", "occurrencePeriod", "operator", "reasonCode", "bodySite", "device", "height", "width", "frames", "duration", "content", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Media`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "basedOn", "type", "subtype", "view", "subject", "context", "occurrenceDateTime", "occurrencePeriod", "operator", "reasonCode", "bodySite", "device", "height", "width", "frames", "duration", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"occurrence": ["occurrenceDateTime", "occurrencePeriod"]} return one_of_many_fields ================================================ FILE: fhir/resources/STU3/medication.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Medication Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Medication(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of a Medication. This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication. """ __resource_type__ = "Medication" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Codes that identify this medication", description=( "A code (or set of codes) that specify this medication, or a textual " "description if no code is available. Usage note: This could be a " "standard medication code such as a code from RxNorm, SNOMED CT, IDMP " "etc. It could also be a national or local formulary code, optionally " "with translations to other code systems." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) form: fhirtypes.CodeableConceptType | None = Field( default=None, alias="form", title="powder | tablets | capsule +", description="Describes the form of the item. Powder; tablets; capsule.", json_schema_extra={ "element_property": True, }, ) image: typing.List[fhirtypes.AttachmentType] | None = Field( default=None, alias="image", title="Picture of the medication", description="Photo(s) or graphic representation(s) of the medication.", json_schema_extra={ "element_property": True, }, ) ingredient: typing.List[fhirtypes.MedicationIngredientType] | None = Field( default=None, alias="ingredient", title="Active or inactive ingredient", description="Identifies a particular constituent of interest in the product.", json_schema_extra={ "element_property": True, }, ) isBrand: bool | None = Field( default=None, alias="isBrand", title="True if a brand", description="Set to true if the item is attributable to a specific manufacturer.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) isBrand__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isBrand", title="Extension field for ``isBrand``." ) isOverTheCounter: bool | None = Field( default=None, alias="isOverTheCounter", title="True if medication does not require a prescription", description=( "Set to true if the medication can be obtained without an order from a " "prescriber." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) isOverTheCounter__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isOverTheCounter", title="Extension field for ``isOverTheCounter``.", ) manufacturer: fhirtypes.ReferenceType | None = Field( default=None, alias="manufacturer", title="Manufacturer of the item", description=( "Describes the details of the manufacturer of the medication product. " "This is not intended to represent the distributor of a medication " "product." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) package: fhirtypes.MedicationPackageType | None = Field( default=None, alias="package", title="Details about packaged medications", description="Information that only applies to packages (not products).", json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | inactive | entered-in-error", description="A code to indicate if the medication is in active use.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "inactive", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Medication`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "code", "status", "isBrand", "isOverTheCounter", "manufacturer", "form", "ingredient", "package", "image", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Medication`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "code", "status", "isBrand", "isOverTheCounter", "manufacturer", ] class MedicationIngredient(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Active or inactive ingredient. Identifies a particular constituent of interest in the product. """ __resource_type__ = "MedicationIngredient" amount: fhirtypes.RatioType | None = Field( default=None, alias="amount", title="Quantity of ingredient present", description=( "Specifies how many (or how much) of the items there are in this " "Medication. For example, 250 mg per tablet. This is expressed as a " "ratio where the numerator is 250mg and the denominator is 1 tablet." ), json_schema_extra={ "element_property": True, }, ) isActive: bool | None = Field( default=None, alias="isActive", title="Active ingredient indicator", description=( "Indication of whether this\u00a0ingredient affects\u00a0the therapeutic action " "of the drug." ), json_schema_extra={ "element_property": True, }, ) isActive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isActive", title="Extension field for ``isActive``." ) itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="itemCodeableConcept", title="The product contained", description=( "The actual ingredient - either a substance (simple ingredient) or " "another medication." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": True, }, ) itemReference: fhirtypes.ReferenceType | None = Field( default=None, alias="itemReference", title="The product contained", description=( "The actual ingredient - either a substance (simple ingredient) or " "another medication." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Substance", "Medication"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationIngredient`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "itemCodeableConcept", "itemReference", "itemReference", "isActive", "amount", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationIngredient`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"item": ["itemCodeableConcept", "itemReference"]} return one_of_many_fields class MedicationPackage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details about packaged medications. Information that only applies to packages (not products). """ __resource_type__ = "MedicationPackage" batch: typing.List[fhirtypes.MedicationPackageBatchType] | None = Field( default=None, alias="batch", title="Identifies a single production run", description=( "Information about a group of medication produced or packaged from one " "production run." ), json_schema_extra={ "element_property": True, }, ) container: fhirtypes.CodeableConceptType | None = Field( default=None, alias="container", title="E.g. box, vial, blister-pack", description="The kind of container that this package comes as.", json_schema_extra={ "element_property": True, }, ) content: typing.List[fhirtypes.MedicationPackageContentType] | None = Field( default=None, alias="content", title="What is in the package", description="A set of components that go to make up the described item.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationPackage`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "container", "content", "batch"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationPackage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationPackageBatch(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Identifies a single production run. Information about a group of medication produced or packaged from one production run. """ __resource_type__ = "MedicationPackageBatch" expirationDate: fhirtypes.DateTimeType | None = Field( default=None, alias="expirationDate", title="When batch will expire", description="When this specific batch of product will expire.", json_schema_extra={ "element_property": True, }, ) expirationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expirationDate", title="Extension field for ``expirationDate``.", ) lotNumber: fhirtypes.StringType | None = Field( default=None, alias="lotNumber", title="Identifier assigned to batch", description="The assigned lot number of a batch of the specified product.", json_schema_extra={ "element_property": True, }, ) lotNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lotNumber", title="Extension field for ``lotNumber``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationPackageBatch`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "lotNumber", "expirationDate"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationPackageBatch`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationPackageContent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What is in the package. A set of components that go to make up the described item. """ __resource_type__ = "MedicationPackageContent" amount: fhirtypes.QuantityType | None = Field( default=None, alias="amount", title="Quantity present in the package", description="The amount of the product that is in the package.", json_schema_extra={ "element_property": True, }, ) itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="itemCodeableConcept", title="The item in the package", description="Identifies one of the items in the package.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": True, }, ) itemReference: fhirtypes.ReferenceType | None = Field( default=None, alias="itemReference", title="The item in the package", description="Identifies one of the items in the package.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationPackageContent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "itemCodeableConcept", "itemReference", "amount", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationPackageContent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"item": ["itemCodeableConcept", "itemReference"]} return one_of_many_fields ================================================ FILE: fhir/resources/STU3/medicationadministration.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MedicationAdministration Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MedicationAdministration(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Administration of medication to a patient. Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner. """ __resource_type__ = "MedicationAdministration" category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Type of medication usage", description=( "Indicates the type of medication administration and where the " "medication is expected to be consumed or administered." ), json_schema_extra={ "element_property": True, }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Encounter or Episode of Care administered as part of", description=( "The visit, admission or other contact between patient and health care " "provider the medication administration was performed as part of." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) definition: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="definition", title="Instantiates protocol or definition", description=( "A protocol, guideline, orderset or other definition that was adhered " "to in whole or in part by this event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["PlanDefinition", "ActivityDefinition"], }, ) device: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="device", title="Device used to administer", description=( "The device used in administering the medication to the patient. For " "example, a particular infusion pump." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) dosage: fhirtypes.MedicationAdministrationDosageType | None = Field( default=None, alias="dosage", title="Details of how medication was taken", description=( "Describes the medication dosage information details e.g. dose, rate, " "site, route, etc." ), json_schema_extra={ "element_property": True, }, ) effectiveDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="effectiveDateTime", title="Start and end time of administration", description=( "A specific date/time or interval of time during which the " "administration took place (or did not take place, when the 'notGiven' " "attribute is true). For many administrations, such as swallowing a " "tablet the use of dateTime is more appropriate." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": True, }, ) effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_effectiveDateTime", title="Extension field for ``effectiveDateTime``.", ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="Start and end time of administration", description=( "A specific date/time or interval of time during which the " "administration took place (or did not take place, when the 'notGiven' " "attribute is true). For many administrations, such as swallowing a " "tablet the use of dateTime is more appropriate." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": True, }, ) eventHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="eventHistory", title="A list of events of interest in the lifecycle", description=( "A summary of the events of interest that have occurred, such as when " "the administration was verified." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Provenance"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External identifier", description=( "External identifier - FHIR will generate its own internal identifiers " "(probably URLs) which do not need to be explicitly managed by the " "resource. The identifier here is one that would be used by another " "non-FHIR system - for example an automated medication pump would " "provide a record each time it operated; an administration while the " "patient was off the ward might be made with a different system and " "entered after the event. Particularly important if these records have" " to be updated." ), json_schema_extra={ "element_property": True, }, ) medicationCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="medicationCodeableConcept", title="What was administered", description=( "Identifies the medication that was administered. This is either a link" " to a resource representing the details of the medication or a simple " "attribute carrying a code that identifies the medication from a known " "list of medications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e medication[x] "one_of_many": "medication", "one_of_many_required": True, }, ) medicationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="medicationReference", title="What was administered", description=( "Identifies the medication that was administered. This is either a link" " to a resource representing the details of the medication or a simple " "attribute carrying a code that identifies the medication from a known " "list of medications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e medication[x] "one_of_many": "medication", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication"], }, ) notGiven: bool | None = Field( default=None, alias="notGiven", title="True if medication not administered", description=( "Set this to true if the record is saying that the medication was NOT " "administered." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) notGiven__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_notGiven", title="Extension field for ``notGiven``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Information about the administration", description=( "Extra information about the medication administration that is not " "conveyed by the other attributes." ), json_schema_extra={ "element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced event", description="A larger event of which this particular event is a component or step.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicationAdministration", "Procedure"], }, ) performer: typing.List[ fhirtypes.MedicationAdministrationPerformerType ] | None = Field( default=None, alias="performer", title="Who administered substance", description=( "The individual who was responsible for giving the medication to the " "patient." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) prescription: fhirtypes.ReferenceType | None = Field( default=None, alias="prescription", title="Request administration performed against", description=( "The original request, instruction or authority to perform the " "administration." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicationRequest"], }, ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Reason administration performed", description="A code indicating why the medication was given.", json_schema_extra={ "element_property": True, }, ) reasonNotGiven: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonNotGiven", title="Reason administration not performed", description="A code indicating why the administration was not performed.", json_schema_extra={ "element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title=( "Condition or Observation that supports why the medication was " "administered" ), description=( "Condition or observation that supports why the medication was " "administered." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "Observation"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "in-progress | on-hold | completed | entered-in-error | stopped | " "unknown" ), description=( "Will generally be set to show that the administration has been " "completed. For some long running administrations such as infusions it" " is possible for an administration to be started but not completed or " "it may be paused while some other process is under way." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "in-progress", "on-hold", "completed", "entered-in-error", "stopped", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who received medication", description="The person or animal or group receiving the medication.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInformation", title="Additional information to support administration", description=( "Additional information (for example, patient height and weight) that " "supports the administration of the medication." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationAdministration`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "definition", "partOf", "status", "category", "medicationCodeableConcept", "medicationReference", "subject", "context", "supportingInformation", "effectiveDateTime", "effectivePeriod", "performer", "notGiven", "reasonNotGiven", "reasonCode", "reasonReference", "prescription", "device", "note", "dosage", "eventHistory", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationAdministration`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "definition", "partOf", "status", "medicationCodeableConcept", "medicationReference", "subject", "effectiveDateTime", "effectivePeriod", "performer", "notGiven", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "effective": ["effectiveDateTime", "effectivePeriod"], "medication": ["medicationCodeableConcept", "medicationReference"], } return one_of_many_fields class MedicationAdministrationDosage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details of how medication was taken. Describes the medication dosage information details e.g. dose, rate, site, route, etc. """ __resource_type__ = "MedicationAdministrationDosage" dose: fhirtypes.QuantityType | None = Field( default=None, alias="dose", title="Amount of medication per dose", description=( "The amount of the medication given at one administration event. Use " "this value when the administration is essentially an instantaneous " "event such as a swallowing a tablet or giving an injection." ), json_schema_extra={ "element_property": True, }, ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="How drug was administered", description=( "A coded value indicating the method by which the medication is " "intended to be or was introduced into or on the body. This attribute " "will most often NOT be populated. It is most commonly used for " "injections. For example, Slow Push, Deep IV." ), json_schema_extra={ "element_property": True, }, ) rateQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="rateQuantity", title="Dose quantity per unit of time", description=( "Identifies the speed with which the medication was or will be " "introduced into the patient. Typically the rate for an infusion e.g. " "100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per " "unit of time e.g. 500 ml per 2 hours. Other examples: 200 mcg/min or" " 200 mcg/1 minute; 1 liter/8 hours." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e rate[x] "one_of_many": "rate", "one_of_many_required": False, }, ) rateRatio: fhirtypes.RatioType | None = Field( default=None, alias="rateRatio", title="Dose quantity per unit of time", description=( "Identifies the speed with which the medication was or will be " "introduced into the patient. Typically the rate for an infusion e.g. " "100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per " "unit of time e.g. 500 ml per 2 hours. Other examples: 200 mcg/min or" " 200 mcg/1 minute; 1 liter/8 hours." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e rate[x] "one_of_many": "rate", "one_of_many_required": False, }, ) route: fhirtypes.CodeableConceptType | None = Field( default=None, alias="route", title="Path of substance into body", description=( "A code specifying the route or physiological path of administration of" " a therapeutic agent into or onto the patient. For example, topical, " "intravenous, etc." ), json_schema_extra={ "element_property": True, }, ) site: fhirtypes.CodeableConceptType | None = Field( default=None, alias="site", title="Body site administered to", description=( "A coded specification of the anatomic site where the medication first " 'entered the body. For example, "left arm".' ), json_schema_extra={ "element_property": True, }, ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Free text dosage instructions e.g. SIG", description=( "Free text dosage can be used for cases where the dosage administered " "is too complex to code. When coded dosage is present, the free text " "dosage may still be present for display to humans. The dosage " "instructions should reflect the dosage of the medication that was " "administered." ), json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationAdministrationDosage`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "text", "site", "route", "method", "dose", "rateRatio", "rateQuantity", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationAdministrationDosage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"rate": ["rateQuantity", "rateRatio"]} return one_of_many_fields class MedicationAdministrationPerformer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who administered substance. The individual who was responsible for giving the medication to the patient. """ __resource_type__ = "MedicationAdministrationPerformer" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Individual who was performing", description="The device, practitioner, etc. who performed the action.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Patient", "RelatedPerson", "Device", ], }, ) onBehalfOf: fhirtypes.ReferenceType | None = Field( default=None, alias="onBehalfOf", title="Organization organization was acting for", description="The organization the device or practitioner was acting on behalf of.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationAdministrationPerformer`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "actor", "onBehalfOf"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationAdministrationPerformer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "actor"] ================================================ FILE: fhir/resources/STU3/medicationdispense.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MedicationDispense Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MedicationDispense(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Dispensing a medication to a named patient. Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order. """ __resource_type__ = "MedicationDispense" authorizingPrescription: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="authorizingPrescription", title="Medication order that authorizes the dispense", description="Indicates the medication order that is being dispensed against.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicationRequest"], }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Type of medication dispense", description=( "Indicates type of medication dispense and where the medication is " "expected to be consumed or administered." ), json_schema_extra={ "element_property": True, }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Encounter / Episode associated with event", description=( "The encounter or episode of care that establishes the context for this" " event." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) daysSupply: fhirtypes.QuantityType | None = Field( default=None, alias="daysSupply", title="Amount of medication expressed as a timing amount", description="The amount of medication expressed as a timing amount.", json_schema_extra={ "element_property": True, }, ) destination: fhirtypes.ReferenceType | None = Field( default=None, alias="destination", title="Where the medication was sent", description=( "Identification of the facility/location where the medication was " "shipped to, as part of the dispense event." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) detectedIssue: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="detectedIssue", title="Clinical issue with action", description=( "Indicates an actual or potential clinical issue with or between one or" " more active or proposed clinical actions for a patient; e.g. Drug-" "drug interaction, duplicate therapy, dosage alert etc." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DetectedIssue"], }, ) dosageInstruction: typing.List[fhirtypes.DosageType] | None = Field( default=None, alias="dosageInstruction", title=( "How the medication is to be used by the patient or administered by the" " caregiver" ), description="Indicates how the medication is to be used by the patient.", json_schema_extra={ "element_property": True, }, ) eventHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="eventHistory", title="A list of releveant lifecycle events", description=( "A summary of the events of interest that have occurred, such as when " "the dispense was verified." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Provenance"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External identifier", description=( "Identifier assigned by the dispensing facility - this is an identifier" " assigned outside FHIR." ), json_schema_extra={ "element_property": True, }, ) medicationCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="medicationCodeableConcept", title="What medication was supplied", description=( "Identifies the medication being administered. This is either a link to" " a resource representing the details of the medication or a simple " "attribute carrying a code that identifies the medication from a known " "list of medications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e medication[x] "one_of_many": "medication", "one_of_many_required": True, }, ) medicationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="medicationReference", title="What medication was supplied", description=( "Identifies the medication being administered. This is either a link to" " a resource representing the details of the medication or a simple " "attribute carrying a code that identifies the medication from a known " "list of medications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e medication[x] "one_of_many": "medication", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication"], }, ) notDone: bool | None = Field( default=None, alias="notDone", title="Whether the dispense was or was not performed", description="True if the dispense was not performed for some reason.", json_schema_extra={ "element_property": True, }, ) notDone__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_notDone", title="Extension field for ``notDone``." ) notDoneReasonCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="notDoneReasonCodeableConcept", title="Why a dispense was not performed", description="Indicates the reason why a dispense was not performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e notDoneReason[x] "one_of_many": "notDoneReason", "one_of_many_required": False, }, ) notDoneReasonReference: fhirtypes.ReferenceType | None = Field( default=None, alias="notDoneReasonReference", title="Why a dispense was not performed", description="Indicates the reason why a dispense was not performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e notDoneReason[x] "one_of_many": "notDoneReason", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DetectedIssue"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Information about the dispense", description=( "Extra information about the dispense that could not be conveyed in the" " other attributes." ), json_schema_extra={ "element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Event that dispense is part of", description="The procedure that the dispense is done because of.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Procedure"], }, ) performer: typing.List[fhirtypes.MedicationDispensePerformerType] | None = Field( default=None, alias="performer", title="Who performed event", description=( "Indicates who or what performed the event. It should be assumed that " "the performer is the dispenser of the medication." ), json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Amount dispensed", description=( "The amount of medication that has been dispensed. Includes unit of " "measure." ), json_schema_extra={ "element_property": True, }, ) receiver: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="receiver", title="Who collected the medication", description=( "Identifies the person who picked up the medication. This will usually" " be a patient or their caregiver, but some cases exist where it can be" " a healthcare professional." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Practitioner"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "preparation | in-progress | on-hold | completed | entered-in-error | " "stopped" ), description="A code specifying the state of the set of dispense events.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "preparation", "in-progress", "on-hold", "completed", "entered-in-error", "stopped", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Who the dispense is for", description=( "A link to a resource representing the person or the group to whom the " "medication will be given." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) substitution: fhirtypes.MedicationDispenseSubstitutionType | None = Field( default=None, alias="substitution", title="Whether a substitution was performed on the dispense", description=( "Indicates whether or not substitution was made as part of the " "dispense. In some cases substitution will be expected but does not " "happen, in other cases substitution is not expected but does happen. " "This block explains what substitution did or did not happen and why. " "If nothing is specified, substitution was not done." ), json_schema_extra={ "element_property": True, }, ) supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInformation", title="Information that supports the dispensing of the medication", description="Additional information that supports the medication being dispensed.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Trial fill, partial fill, emergency fill, etc.", description=( "Indicates the type of dispensing event that is performed. For example," " Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, " "Samples, etc." ), json_schema_extra={ "element_property": True, }, ) whenHandedOver: fhirtypes.DateTimeType | None = Field( default=None, alias="whenHandedOver", title="When product was given out", description=( "The time the dispensed product was provided to the patient or their " "representative." ), json_schema_extra={ "element_property": True, }, ) whenHandedOver__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_whenHandedOver", title="Extension field for ``whenHandedOver``.", ) whenPrepared: fhirtypes.DateTimeType | None = Field( default=None, alias="whenPrepared", title="When product was packaged and reviewed", description="The time when the dispensed product was packaged and reviewed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) whenPrepared__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_whenPrepared", title="Extension field for ``whenPrepared``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationDispense`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "partOf", "status", "category", "medicationCodeableConcept", "medicationReference", "subject", "context", "supportingInformation", "performer", "authorizingPrescription", "type", "quantity", "daysSupply", "whenPrepared", "whenHandedOver", "destination", "receiver", "note", "dosageInstruction", "substitution", "detectedIssue", "notDone", "notDoneReasonCodeableConcept", "notDoneReasonReference", "eventHistory", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationDispense`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "status", "medicationCodeableConcept", "medicationReference", "subject", "whenPrepared", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "medication": ["medicationCodeableConcept", "medicationReference"], "notDoneReason": ["notDoneReasonCodeableConcept", "notDoneReasonReference"], } return one_of_many_fields class MedicationDispensePerformer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who performed event. Indicates who or what performed the event. It should be assumed that the performer is the dispenser of the medication. """ __resource_type__ = "MedicationDispensePerformer" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Individual who was performing", description=( "The device, practitioner, etc. who performed the action. It should be" " assumed that the actor is the dispenser of the medication." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Organization", "Patient", "Device", "RelatedPerson", ], }, ) onBehalfOf: fhirtypes.ReferenceType | None = Field( default=None, alias="onBehalfOf", title="Organization organization was acting for", description="The organization the device or practitioner was acting on behalf of.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationDispensePerformer`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "actor", "onBehalfOf"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationDispensePerformer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationDispenseSubstitution(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Whether a substitution was performed on the dispense. Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but does not happen, in other cases substitution is not expected but does happen. This block explains what substitution did or did not happen and why. If nothing is specified, substitution was not done. """ __resource_type__ = "MedicationDispenseSubstitution" reason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reason", title="Why was substitution made", description=( "Indicates the reason for the substitution of (or lack of substitution)" " from what was prescribed." ), json_schema_extra={ "element_property": True, }, ) responsibleParty: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="responsibleParty", title="Who is responsible for the substitution", description=( "The person or organization that has primary responsibility for the " "substitution." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title=( "Code signifying whether a different drug was dispensed from what was " "prescribed" ), description=( "A code signifying whether a different drug was dispensed from what was" " prescribed." ), json_schema_extra={ "element_property": True, }, ) wasSubstituted: bool | None = Field( default=None, alias="wasSubstituted", title="Whether a substitution was or was not performed on the dispense", description=( "True if the dispenser dispensed a different drug or product from what " "was prescribed." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) wasSubstituted__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_wasSubstituted", title="Extension field for ``wasSubstituted``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationDispenseSubstitution`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "wasSubstituted", "type", "reason", "responsibleParty", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationDispenseSubstitution`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("wasSubstituted", "wasSubstituted__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/medicationrequest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MedicationRequest Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MedicationRequest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Ordering of medication for patient or group. An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationRequest" rather than "MedicationPrescription" or "MedicationOrder" to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns. """ __resource_type__ = "MedicationRequest" authoredOn: fhirtypes.DateTimeType | None = Field( default=None, alias="authoredOn", title="When request was initially authored", description=( "The date (and perhaps time) when the prescription was initially " "written or authored on." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoredOn", title="Extension field for ``authoredOn``." ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="What request fulfills", description=( "A plan or request that is fulfilled in whole or in part by this " "medication request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CarePlan", "MedicationRequest", "ProcedureRequest", "ReferralRequest", ], }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Type of medication usage", description=( "Indicates the type of medication order and where the medication is " "expected to be consumed or administered." ), json_schema_extra={ "element_property": True, }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Created during encounter/admission/stay", description=( "A link to an encounter, or episode of care, that identifies the " "particular occurrence or set occurrences of contact between patient " "and health care provider." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) definition: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="definition", title="Protocol or definition", description="Protocol or definition followed by this request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ActivityDefinition", "PlanDefinition"], }, ) detectedIssue: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="detectedIssue", title="Clinical Issue with action", description=( "Indicates an actual or potential clinical issue with or between one or" " more active or proposed clinical actions for a patient; e.g. Drug-" "drug interaction, duplicate therapy, dosage alert etc." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DetectedIssue"], }, ) dispenseRequest: fhirtypes.MedicationRequestDispenseRequestType | None = Field( default=None, alias="dispenseRequest", title="Medication supply authorization", description=( "Indicates the specific details for the dispense or medication supply " "part of a medication request (also known as a Medication Prescription " "or Medication Order). Note that this information is not always sent " "with the order. There may be in some settings (e.g. hospitals) " "institutional or system support for completing the dispense details in" " the pharmacy department." ), json_schema_extra={ "element_property": True, }, ) dosageInstruction: typing.List[fhirtypes.DosageType] | None = Field( default=None, alias="dosageInstruction", title="How the medication should be taken", description="Indicates how the medication is to be used by the patient.", json_schema_extra={ "element_property": True, }, ) eventHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="eventHistory", title="A list of events of interest in the lifecycle", description=( "Links to Provenance records for past versions of this resource or " "fulfilling request or event resources that identify key state " "transitions or updates that are likely to be relevant to a user " "looking at the current version of the resource." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Provenance"], }, ) groupIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="groupIdentifier", title="Composite request this is part of", description=( "A shared identifier common to all requests that were authorized more " "or less simultaneously by a single author, representing the identifier" " of the requisition or prescription." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External ids for this request", description=( "This records identifiers associated with this medication request that " "are defined by business processes and/or used to refer to it when a " "direct URL reference to the resource itself is not appropriate. For " "example a re-imbursement system might issue its own id for each " "prescription that is created. This is particularly important where " "FHIR only provides part of an entire workflow process where records " "must be tracked through an entire system." ), json_schema_extra={ "element_property": True, }, ) intent: fhirtypes.CodeType | None = Field( default=None, alias="intent", title="proposal | plan | order | instance-order", description="Whether the request is a proposal, plan, or an original order.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["proposal", "plan", "order", "instance-order"], }, ) intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intent", title="Extension field for ``intent``." ) medicationCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="medicationCodeableConcept", title="Medication to be taken", description=( "Identifies the medication being requested. This is a link to a " "resource that represents the medication which may be the details of " "the medication or simply an attribute carrying a code that identifies " "the medication from a known list of medications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e medication[x] "one_of_many": "medication", "one_of_many_required": True, }, ) medicationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="medicationReference", title="Medication to be taken", description=( "Identifies the medication being requested. This is a link to a " "resource that represents the medication which may be the details of " "the medication or simply an attribute carrying a code that identifies " "the medication from a known list of medications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e medication[x] "one_of_many": "medication", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Information about the prescription", description=( "Extra information about the prescription that could not be conveyed by" " the other attributes." ), json_schema_extra={ "element_property": True, }, ) priorPrescription: fhirtypes.ReferenceType | None = Field( default=None, alias="priorPrescription", title="An order/prescription that is being replaced", description=( "A link to a resource representing an earlier order related order or " "prescription." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicationRequest"], }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | stat | asap", description=( "Indicates how quickly the Medication Request should be addressed with " "respect to other requests." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "stat", "asap"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Reason or indication for writing the prescription", description="The reason or the indication for ordering the medication.", json_schema_extra={ "element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title=( "Condition or Observation that supports why the prescription is being " "written" ), description="Condition or observation that supports why the medication was ordered.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "Observation"], }, ) recorder: fhirtypes.ReferenceType | None = Field( default=None, alias="recorder", title="Person who entered the request", description=( "The person who entered the order on behalf of another individual for " "example in the case of a verbal or a telephone order." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) requester: fhirtypes.MedicationRequestRequesterType | None = Field( default=None, alias="requester", title="Who/What requested the Request", description=( "The individual, organization or device that initiated the request and " "has responsibility for its activation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "active | on-hold | cancelled | completed | entered-in-error | stopped " "| draft | unknown" ), description=( "A code specifying the current state of the order. Generally this will" " be active or completed state." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "active", "on-hold", "cancelled", "completed", "entered-in-error", "stopped", "draft", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who or group medication request is for", description=( "A link to a resource representing the person or set of individuals to " "whom the medication will be given." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) substitution: fhirtypes.MedicationRequestSubstitutionType | None = Field( default=None, alias="substitution", title="Any restrictions on medication substitution", description=( "Indicates whether or not substitution can or should be part of the " "dispense. In some cases substitution must happen, in other cases " "substitution must not happen. This block explains the prescriber's " "intent. If nothing is specified substitution may be done." ), json_schema_extra={ "element_property": True, }, ) supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInformation", title="Information to support ordering of the medication", description=( "Include additional information (for example, patient height and " "weight) that supports the ordering of the medication." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "definition", "basedOn", "groupIdentifier", "status", "intent", "category", "priority", "medicationCodeableConcept", "medicationReference", "subject", "context", "supportingInformation", "authoredOn", "requester", "recorder", "reasonCode", "reasonReference", "note", "dosageInstruction", "dispenseRequest", "substitution", "priorPrescription", "detectedIssue", "eventHistory", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "definition", "basedOn", "groupIdentifier", "status", "intent", "priority", "medicationCodeableConcept", "medicationReference", "subject", "authoredOn", "requester", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("intent", "intent__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "medication": ["medicationCodeableConcept", "medicationReference"] } return one_of_many_fields class MedicationRequestDispenseRequest(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Medication supply authorization. Indicates the specific details for the dispense or medication supply part of a medication request (also known as a Medication Prescription or Medication Order). Note that this information is not always sent with the order. There may be in some settings (e.g. hospitals) institutional or system support for completing the dispense details in the pharmacy department. """ __resource_type__ = "MedicationRequestDispenseRequest" expectedSupplyDuration: fhirtypes.DurationType | None = Field( default=None, alias="expectedSupplyDuration", title="Number of days supply per dispense", description=( "Identifies the period time over which the supplied product is expected" " to be used, or the length of time the dispense is expected to last." ), json_schema_extra={ "element_property": True, }, ) numberOfRepeatsAllowed: fhirtypes.PositiveIntType | None = Field( default=None, alias="numberOfRepeatsAllowed", title="Number of refills authorized", description=( "An integer indicating the number of times, in addition to the original" " dispense, (aka refills or repeats) that the patient can receive the " "prescribed medication. Usage Notes: This integer does not include the " "original order dispense. This means that if an order indicates " 'dispense 30 tablets plus "3 repeats", then the order can be dispensed ' "a total of 4 times and the patient can receive a total of 120 tablets." ), json_schema_extra={ "element_property": True, }, ) numberOfRepeatsAllowed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_numberOfRepeatsAllowed", title="Extension field for ``numberOfRepeatsAllowed``.", ) performer: fhirtypes.ReferenceType | None = Field( default=None, alias="performer", title="Intended dispenser", description=( "Indicates the intended dispensing Organization specified by the " "prescriber." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Amount of medication to supply per dispense", description="The amount that is to be dispensed for one fill.", json_schema_extra={ "element_property": True, }, ) validityPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="validityPeriod", title="Time period supply is authorized for", description=( "This indicates the validity period of a prescription (stale dating the" " Prescription)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationRequestDispenseRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "validityPeriod", "numberOfRepeatsAllowed", "quantity", "expectedSupplyDuration", "performer", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationRequestDispenseRequest`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationRequestRequester(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who/What requested the Request. The individual, organization or device that initiated the request and has responsibility for its activation. """ __resource_type__ = "MedicationRequestRequester" agent: fhirtypes.ReferenceType = Field( default=..., alias="agent", title="Who ordered the initial medication(s)", description=( "The healthcare professional responsible for authorizing the initial " "prescription." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Organization", "Patient", "RelatedPerson", "Device", ], }, ) onBehalfOf: fhirtypes.ReferenceType | None = Field( default=None, alias="onBehalfOf", title="Organization agent is acting for", description="The organization the device or practitioner was acting on behalf of.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationRequestRequester`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "agent", "onBehalfOf"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationRequestRequester`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "agent", "onBehalfOf"] class MedicationRequestSubstitution(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Any restrictions on medication substitution. Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen. This block explains the prescriber's intent. If nothing is specified substitution may be done. """ __resource_type__ = "MedicationRequestSubstitution" allowed: bool | None = Field( default=None, alias="allowed", title="Whether substitution is allowed or not", description=( "True if the prescriber allows a different drug to be dispensed from " "what was prescribed." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) allowed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allowed", title="Extension field for ``allowed``." ) reason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reason", title="Why should (not) substitution be made", description=( "Indicates the reason for the substitution, or why substitution must or" " must not be performed." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationRequestSubstitution`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "allowed", "reason"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationRequestSubstitution`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("allowed", "allowed__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/medicationstatement.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MedicationStatement Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class MedicationStatement(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Record of medication being taken by a patient. A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from sources such as the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information. """ __resource_type__ = "MedicationStatement" basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Fulfils plan, proposal or order", description=( "A plan, proposal or order that is fulfilled in whole or in part by " "this event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "MedicationRequest", "CarePlan", "ProcedureRequest", "ReferralRequest", ], }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Type of medication usage", description=( "Indicates where type of medication statement and where the medication " "is expected to be consumed or administered." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Encounter / Episode associated with MedicationStatement", description=( "The encounter or episode of care that establishes the context for this" " MedicationStatement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) dateAsserted: fhirtypes.DateTimeType | None = Field( default=None, alias="dateAsserted", title="When the statement was asserted?", description=( "The date when the medication statement was asserted by the information" " source." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dateAsserted__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dateAsserted", title="Extension field for ``dateAsserted``.", ) derivedFrom: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="derivedFrom", title="Additional supporting information", description=( "Allows linking the MedicationStatement to the underlying " "MedicationRequest, or to other information that supports or is used to" " derive the MedicationStatement." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) dosage: typing.List[fhirtypes.DosageType] | None = Field( default=None, alias="dosage", title="Details of how medication is/was taken or should be taken", description="Indicates how the medication is/was or should be taken by the patient.", json_schema_extra={ "element_property": True, }, ) effectiveDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="effectiveDateTime", title="The date/time or interval when the medication was taken", description=( "The interval of time during which it is being asserted that the " "patient was taking the medication (or was not taking, when the " "wasNotGiven element is true)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_effectiveDateTime", title="Extension field for ``effectiveDateTime``.", ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="The date/time or interval when the medication was taken", description=( "The interval of time during which it is being asserted that the " "patient was taking the medication (or was not taking, when the " "wasNotGiven element is true)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External identifier", description=( "External identifier - FHIR will generate its own internal identifiers " "(probably URLs) which do not need to be explicitly managed by the " "resource. The identifier here is one that would be used by another " "non-FHIR system - for example an automated medication pump would " "provide a record each time it operated; an administration while the " "patient was off the ward might be made with a different system and " "entered after the event. Particularly important if these records have" " to be updated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) informationSource: fhirtypes.ReferenceType | None = Field( default=None, alias="informationSource", title=( "Person or organization that provided the information about the taking " "of this medication" ), description=( "The person or organization that provided the information about the " "taking of this medication. Note: Use derivedFrom when a " "MedicationStatement is derived from other resources, e.g Claim or " "MedicationRequest." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "RelatedPerson", "Organization", ], }, ) medicationCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="medicationCodeableConcept", title="What medication was taken", description=( "Identifies the medication being administered. This is either a link to" " a resource representing the details of the medication or a simple " "attribute carrying a code that identifies the medication from a known " "list of medications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e medication[x] "one_of_many": "medication", "one_of_many_required": True, }, ) medicationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="medicationReference", title="What medication was taken", description=( "Identifies the medication being administered. This is either a link to" " a resource representing the details of the medication or a simple " "attribute carrying a code that identifies the medication from a known " "list of medications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e medication[x] "one_of_many": "medication", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Further information about the statement", description=( "Provides extra information about the medication statement that is not " "conveyed by the other attributes." ), json_schema_extra={ "element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced event", description="A larger event of which this particular event is a component or step.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "MedicationAdministration", "MedicationDispense", "MedicationStatement", "Procedure", "Observation", ], }, ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Reason for why the medication is being/was taken", description="A reason for why the medication is being/was taken.", json_schema_extra={ "element_property": True, }, ) reasonNotTaken: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonNotTaken", title="True if asserting medication was not given", description="A code indicating why the medication was not taken.", json_schema_extra={ "element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title=( "Condition or observation that supports why the medication is being/was" " taken" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "Observation"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | completed | entered-in-error | intended | stopped | on-hold", description=( "A code representing the patient or other source's judgment about the " "state of the medication used that this statement is about. Generally " "this will be active or completed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "active", "completed", "entered-in-error", "intended", "stopped", "on-hold", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who is/was taking the medication", description="The person, animal or group who is/was taking the medication.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) taken: fhirtypes.CodeType | None = Field( default=None, alias="taken", title="y | n | unk | na", description=( "Indicator of the certainty of whether the medication was taken by the " "patient." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["y", "n", "unk", "na"], }, ) taken__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_taken", title="Extension field for ``taken``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationStatement`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "partOf", "context", "status", "category", "medicationCodeableConcept", "medicationReference", "effectiveDateTime", "effectivePeriod", "dateAsserted", "informationSource", "subject", "derivedFrom", "taken", "reasonNotTaken", "reasonCode", "reasonReference", "note", "dosage", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationStatement`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "basedOn", "partOf", "context", "status", "category", "medicationCodeableConcept", "medicationReference", "effectiveDateTime", "effectivePeriod", "dateAsserted", "subject", "taken", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext"), ("taken", "taken__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "effective": ["effectiveDateTime", "effectivePeriod"], "medication": ["medicationCodeableConcept", "medicationReference"], } return one_of_many_fields ================================================ FILE: fhir/resources/STU3/messagedefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MessageDefinition Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MessageDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A resource that defines a type of message that can be exchanged between systems. Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted. """ __resource_type__ = "MessageDefinition" allowedResponse: typing.List[ fhirtypes.MessageDefinitionAllowedResponseType ] | None = Field( default=None, alias="allowedResponse", title="Responses to this message", description=( "Indicates what types of messages may be sent as an application-level " "response to this message." ), json_schema_extra={ "element_property": True, }, ) base: fhirtypes.ReferenceType | None = Field( default=None, alias="base", title="Definition this one is based on", description=( "The MessageDefinition that is the basis for the contents of this " "resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MessageDefinition"], }, ) category: fhirtypes.CodeType | None = Field( default=None, alias="category", title="Consequence | Currency | Notification", description="The impact of the content of the message.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["Consequence", "Currency", "Notification"], }, ) category__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_category", title="Extension field for ``category``." ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the message definition and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the message definition." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date this was last changed", description=( "The date (and optionally time) when the message definition was " "published. The date must change if and when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the message definition " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the message definition", description=( "A free text natural language description of the message definition " "from a consumer's perspective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) event: fhirtypes.CodingType = Field( default=..., alias="event", title="Event type", description="A coded identifier of a supported messaging event.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A boolean value to indicate that this message definition is authored " "for testing purposes (or education/evaluation/marketing), and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) focus: typing.List[fhirtypes.MessageDefinitionFocusType] | None = Field( default=None, alias="focus", title="Resource(s) that are the subject of the event", description=( "Identifies the resource (or resources) that are being addressed by the" " event. For example, the Encounter for an admit message or two " "Account records for a merge." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Additional identifier for the message definition", description=( "A formal identifier that is used to identify this message definition " "when it is represented in other formats, or referenced in a " "specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for message definition (if applicable)", description=( "A legal or geographic region in which the message definition is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this message definition (computer friendly)", description=( "A natural language name identifying the message definition. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) parent: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="parent", title="Protocol/workflow this is part of", description=( "Identifies a protocol or workflow that this MessageDefinition " "represents a step in." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ActivityDefinition", "PlanDefinition"], }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the individual or organization that published the message " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this message definition is defined", description=( "Explaination of why this message definition is needed and why it has " "been designed as it has." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) replaces: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="replaces", title="Takes the place of", description="A MessageDefinition that is superseded by this definition.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MessageDefinition"], }, ) responseRequired: bool | None = Field( default=None, alias="responseRequired", title="Is a response required?", description="Indicates whether a response is required for this message.", json_schema_extra={ "element_property": True, }, ) responseRequired__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_responseRequired", title="Extension field for ``responseRequired``.", ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this message definition. Enables tracking the life-cycle" " of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this message definition (human friendly)", description="A short, descriptive, user-friendly title for the message definition.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Logical URI to reference this message definition (globally unique)", description=( "An absolute URI that is used to identify this message definition when " "it is referenced in a specification, model, design or an instance. " "This SHALL be a URL, SHOULD be globally unique, and SHOULD be an " "address at which this message definition is (or will be) published. " "The URL SHOULD include the major version of the message definition. " "For more information see [Technical and Business " "Versions](resource.html#versions)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Context the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching for appropriate message definition instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the message definition", description=( "The identifier that is used to identify this version of the message " "definition when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the message definition" " author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MessageDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "base", "parent", "replaces", "event", "category", "focus", "responseRequired", "allowedResponse", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MessageDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "base", "parent", "replaces", "event", "category", "focus", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("date", "date__ext"), ("status", "status__ext")] return required_fields class MessageDefinitionAllowedResponse(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Responses to this message. Indicates what types of messages may be sent as an application-level response to this message. """ __resource_type__ = "MessageDefinitionAllowedResponse" message: fhirtypes.ReferenceType = Field( default=..., alias="message", title="Reference to allowed message definition response", description=( "A reference to the message definition that must be adhered to by this " "supported response." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MessageDefinition"], }, ) situation: fhirtypes.MarkdownType | None = Field( default=None, alias="situation", title="When should this response be used", description=( "Provides a description of the circumstances in which this response " "should be used (as opposed to one of the alternative responses)." ), json_schema_extra={ "element_property": True, }, ) situation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_situation", title="Extension field for ``situation``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MessageDefinitionAllowedResponse`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "message", "situation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MessageDefinitionAllowedResponse`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MessageDefinitionFocus(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Resource(s) that are the subject of the event. Identifies the resource (or resources) that are being addressed by the event. For example, the Encounter for an admit message or two Account records for a merge. """ __resource_type__ = "MessageDefinitionFocus" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Type of resource", description="The kind of resource that must be the focus for this message.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) max: fhirtypes.StringType | None = Field( default=None, alias="max", title="Maximum number of focuses of this type", description=( "Identifies the maximum number of resources of this type that must be " "pointed to by a message in order for it to be valid against this " "MessageDefinition." ), json_schema_extra={ "element_property": True, }, ) max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_max", title="Extension field for ``max``." ) min: fhirtypes.UnsignedIntType | None = Field( default=None, alias="min", title="Minimum number of focuses of this type", description=( "Identifies the minimum number of resources of this type that must be " "pointed to by a message in order for it to be valid against this " "MessageDefinition." ), json_schema_extra={ "element_property": True, }, ) min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_min", title="Extension field for ``min``." ) profile: fhirtypes.ReferenceType | None = Field( default=None, alias="profile", title="Profile that must be adhered to by focus", description=( "A profile that reflects constraints for the focal resource (and " "potentially for related resources)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MessageDefinitionFocus`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "profile", "min", "max"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MessageDefinitionFocus`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/messageheader.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MessageHeader Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MessageHeader(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A resource that describes a message that is exchanged between systems. The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. """ __resource_type__ = "MessageHeader" author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="The source of the decision", description=( "The logical author of the message - the person or device that decided " "the described event should happen. When there is more than one " "candidate, pick the most proximal to the MessageHeader. Can provide " "other authors in extensions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) destination: typing.List[fhirtypes.MessageHeaderDestinationType] | None = Field( default=None, alias="destination", title="Message destination application(s)", description="The destination application which the message is intended for.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) enterer: fhirtypes.ReferenceType | None = Field( default=None, alias="enterer", title="The source of the data entry", description=( "The person or device that performed the data entry leading to this " "message. When there is more than one candidate, pick the most proximal" " to the message. Can provide other enterers in extensions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) event: fhirtypes.CodingType = Field( default=..., alias="event", title="Code for the event this message represents", description=( "Code that identifies the event this message represents and connects it" " with its definition. Events defined as part of the FHIR specification" ' have the system value "http://hl7.org/fhir/message-events".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) focus: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="focus", title="The actual content of the message", description=( "The actual data of the message - a reference to the root/focus class " "of the event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) reason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reason", title="Cause of event", description=( "Coded indication of the cause for the event - indicates a reason for " "the occurrence of the event that is a focus of this message." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) receiver: fhirtypes.ReferenceType | None = Field( default=None, alias="receiver", title='Intended "real-world" recipient for the data', description=( "Allows data conveyed by a message to be addressed to a particular " "person or department when routing to a specific application isn't " "sufficient." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "Organization"], }, ) response: fhirtypes.MessageHeaderResponseType | None = Field( default=None, alias="response", title="If this is a reply to prior message", description=( "Information about the message that this message is a response to. " "Only present if this message is a response." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) responsible: fhirtypes.ReferenceType | None = Field( default=None, alias="responsible", title="Final responsibility for event", description=( "The person or organization that accepts overall responsibility for the" " contents of the message. The implication is that the message event " "happened under the policies of the responsible party." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "Organization"], }, ) sender: fhirtypes.ReferenceType | None = Field( default=None, alias="sender", title="Real world sender of the message", description=( "Identifies the sending system to allow the use of a trust " "relationship." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "Organization"], }, ) source: fhirtypes.MessageHeaderSourceType = Field( default=..., alias="source", title="Message source application", description="The source application from which this message originated.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) timestamp: fhirtypes.InstantType | None = Field( default=None, alias="timestamp", title="Time that the message was sent", description="The time that the message was sent.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) timestamp__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timestamp", title="Extension field for ``timestamp``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MessageHeader`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "event", "destination", "receiver", "sender", "timestamp", "enterer", "author", "source", "responsible", "reason", "response", "focus", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MessageHeader`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "event", "destination", "receiver", "sender", "timestamp", "enterer", "author", "source", "responsible", "reason", "response", "focus", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("timestamp", "timestamp__ext")] return required_fields class MessageHeaderDestination(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Message destination application(s). The destination application which the message is intended for. """ __resource_type__ = "MessageHeaderDestination" endpoint: fhirtypes.UriType | None = Field( default=None, alias="endpoint", title="Actual destination address or id", description="Indicates where the message should be routed to.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) endpoint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_endpoint", title="Extension field for ``endpoint``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name of system", description="Human-readable name for the target system.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) target: fhirtypes.ReferenceType | None = Field( default=None, alias="target", title="Particular delivery destination within the destination", description=( "Identifies the target end system in situations where the initial " "message transmission is to an intermediary system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MessageHeaderDestination`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "target", "endpoint"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MessageHeaderDestination`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "name", "target", "endpoint"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("endpoint", "endpoint__ext")] return required_fields class MessageHeaderResponse(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. If this is a reply to prior message. Information about the message that this message is a response to. Only present if this message is a response. """ __resource_type__ = "MessageHeaderResponse" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="ok | transient-error | fatal-error", description=( "Code that identifies the type of response to the message - whether it " "was successful or not, and whether it should be resent or not." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["ok", "transient-error", "fatal-error"], }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) details: fhirtypes.ReferenceType | None = Field( default=None, alias="details", title="Specific list of hints/warnings/errors", description="Full details of any issues found in the message.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["OperationOutcome"], }, ) identifier: fhirtypes.IdType | None = Field( default=None, alias="identifier", title="Id of original message", description=( "The MessageHeader.id of the message to which this message is a " "response." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) identifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_identifier", title="Extension field for ``identifier``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MessageHeaderResponse`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "identifier", "code", "details"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MessageHeaderResponse`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "identifier", "code", "details"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext"), ("identifier", "identifier__ext")] return required_fields class MessageHeaderSource(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Message source application. The source application from which this message originated. """ __resource_type__ = "MessageHeaderSource" contact: fhirtypes.ContactPointType | None = Field( default=None, alias="contact", title="Human contact for problems", description=( "An e-mail, phone, website or other contact point to use to resolve " "issues with message communications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endpoint: fhirtypes.UriType | None = Field( default=None, alias="endpoint", title="Actual message source address or id", description="Identifies the routing target to send acknowledgements to.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) endpoint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_endpoint", title="Extension field for ``endpoint``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name of system", description="Human-readable name for the source system.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) software: fhirtypes.StringType | None = Field( default=None, alias="software", title="Name of software running the system", description="May include configuration or other information useful in debugging.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) software__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_software", title="Extension field for ``software``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Version of software running", description=( "Can convey versions of multiple systems in situations where a message " "passes through multiple hands." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MessageHeaderSource`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "software", "version", "contact", "endpoint", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MessageHeaderSource`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "name", "software", "version", "contact", "endpoint", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("endpoint", "endpoint__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/meta.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Meta Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Meta(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Metadata about a resource. The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource. """ __resource_type__ = "Meta" lastUpdated: fhirtypes.InstantType | None = Field( default=None, alias="lastUpdated", title="When the resource version last changed", description="When the resource last changed - e.g. when the version changed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastUpdated__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastUpdated", title="Extension field for ``lastUpdated``." ) profile: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="profile", title="Profiles this resource claims to conform to", description=( "A list of profiles (references to " "[StructureDefinition](structuredefinition.html#) resources) that this " "resource claims to conform to. The URL is a reference to " "[StructureDefinition.url]()." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) profile__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) security: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="security", title="Security Labels applied to this resource", description=( "Security labels applied to this resource. These tags connect specific " "resources to the overall security policy and infrastructure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) tag: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="tag", title="Tags applied to this resource", description=( "Tags applied to this resource. Tags are intended to be used to " "identify and relate resources to process and workflow, and " "applications are not required to consider the tags when interpreting " "the meaning of a resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) versionId: fhirtypes.IdType | None = Field( default=None, alias="versionId", title="Version specific identifier", description=( "The version specific identifier, as it appears in the version portion " "of the URL. This values changes when the resource is created, updated," " or deleted." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) versionId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionId", title="Extension field for ``versionId``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Meta`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "versionId", "lastUpdated", "profile", "security", "tag", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Meta`` according to specification, with preserving the original sequence order. """ return ["versionId", "lastUpdated", "profile", "security", "tag"] ================================================ FILE: fhir/resources/STU3/metadataresource.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MetadataResource Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class MetadataResource(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Common Ancestor declaration for definitional resources. Common Ancestor declaration for conformance and knowledge artifact resources. """ __resource_type__ = "MetadataResource" contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date this was last changed", description=( "The date (and optionally time) when the metadata resource was " "published. The date must change if and when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the metadata resource " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the metadata resource", description=( "A free text natural language description of the metadata resource from" " a consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A boolean value to indicate that this metadata resource is authored " "for testing purposes (or education/evaluation/marketing), and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for metadata resource (if applicable)", description=( "A legal or geographic region in which the metadata resource is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this metadata resource (computer friendly)", description=( "A natural language name identifying the metadata resource. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the individual or organization that published the metadata" " resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this metadata resource. Enables tracking the life-cycle " "of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this metadata resource (human friendly)", description="A short, descriptive, user-friendly title for the metadata resource.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Logical URI to reference this metadata resource (globally unique)", description=( "An absolute URI that is used to identify this metadata resource when " "it is referenced in a specification, model, design or an instance. " "This SHALL be a URL, SHOULD be globally unique, and SHOULD be an " "address at which this metadata resource is (or will be) published. The" " URL SHOULD include the major version of the metadata resource. For " "more information see [Technical and Business " "Versions](resource.html#versions)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Context the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching for appropriate metadata resource instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the metadata resource", description=( "The identifier that is used to identify this version of the metadata " "resource when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the metadata resource " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MetadataResource`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "description", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MetadataResource`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/money.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Money Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from . import quantity class Money(quantity.Quantity): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An amount of economic utility in some recognized currency. """ __resource_type__ = "Money" @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Money`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "value", "comparator", "unit", "system", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Money`` according to specification, with preserving the original sequence order. """ return ["value", "comparator", "unit", "system", "code"] ================================================ FILE: fhir/resources/STU3/namingsystem.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/NamingSystem Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class NamingSystem(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. System of unique identification. A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. """ __resource_type__ = "NamingSystem" contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date this was last changed", description=( "The date (and optionally time) when the naming system was published. " "The date must change if and when the business version changes and it " "must change if the status code changes. In addition, it should change " "when the substantive content of the naming system changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the naming system", description=( "A free text natural language description of the naming system from a " "consumer's perspective. Details about what the namespace identifies " "including scope, granularity, version labeling, etc." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for naming system (if applicable)", description=( "A legal or geographic region in which the naming system is intended to" " be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title="codesystem | identifier | root", description=( "Indicates the purpose for the naming system - what kinds of things " "does it make unique?" ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["codesystem", "identifier", "root"], }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this naming system (computer friendly)", description=( "A natural language name identifying the naming system. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the individual or organization that published the naming " "system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) replacedBy: fhirtypes.ReferenceType | None = Field( default=None, alias="replacedBy", title="Use this instead", description=( "For naming systems that are retired, indicates the naming system that " "should be used in their place (if any)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["NamingSystem"], }, ) responsible: fhirtypes.StringType | None = Field( default=None, alias="responsible", title="Who maintains system namespace?", description=( "The name of the organization that is responsible for issuing " "identifiers or codes for this namespace and ensuring their non-" "collision." ), json_schema_extra={ "element_property": True, }, ) responsible__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_responsible", title="Extension field for ``responsible``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this naming system. Enables tracking the life-cycle of " "the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="e.g. driver, provider, patient, bank etc.", description=( "Categorizes a naming system for easier search by grouping related " "naming systems." ), json_schema_extra={ "element_property": True, }, ) uniqueId: typing.List[fhirtypes.NamingSystemUniqueIdType] = Field( default=..., alias="uniqueId", title="Unique identifiers used for system", description=( "Indicates how the system may be identified when referenced in " "electronic exchange." ), json_schema_extra={ "element_property": True, }, ) usage: fhirtypes.StringType | None = Field( default=None, alias="usage", title="How/where is it used", description=( "Provides guidance on the use of the namespace, including the handling " "of formatting characters, use of upper vs. lower case, etc." ), json_schema_extra={ "element_property": True, }, ) usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usage", title="Extension field for ``usage``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Context the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching for appropriate naming system instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NamingSystem`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "name", "status", "kind", "date", "publisher", "contact", "responsible", "type", "description", "useContext", "jurisdiction", "usage", "uniqueId", "replacedBy", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NamingSystem`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "name", "status", "date", "publisher", "contact", "useContext", "jurisdiction", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("date", "date__ext"), ("kind", "kind__ext"), ("name", "name__ext"), ("status", "status__ext"), ] return required_fields class NamingSystemUniqueId(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Unique identifiers used for system. Indicates how the system may be identified when referenced in electronic exchange. """ __resource_type__ = "NamingSystemUniqueId" comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Notes about identifier usage", description="Notes about the past or intended usage of this identifier.", json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="When is identifier valid?", description=( "Identifies the period of time over which this identifier is considered" " appropriate to refer to the naming system. Outside of this window, " "the identifier might be non-deterministic." ), json_schema_extra={ "element_property": True, }, ) preferred: bool | None = Field( default=None, alias="preferred", title="Is this the id that should be used for this type", description=( 'Indicates whether this identifier is the "preferred" identifier of ' "this type." ), json_schema_extra={ "element_property": True, }, ) preferred__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preferred", title="Extension field for ``preferred``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="oid | uuid | uri | other", description=( "Identifies the unique identifier scheme used for this particular " "identifier." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["oid", "uuid", "uri", "other"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The unique identifier", description=( "The string that should be sent over the wire to identify the code " "system or identifier system." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NamingSystemUniqueId`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "value", "preferred", "comment", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NamingSystemUniqueId`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext"), ("value", "value__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/narrative.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Narrative Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Narrative(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A human-readable formatted text, including images. """ __resource_type__ = "Narrative" div: fhirtypes.XhtmlType | None = Field( default=None, alias="div", title="Limited xhtml content", description="The actual narrative content, a stripped down version of XHTML.", json_schema_extra={ "element_property": True, "element_required": True, }, ) div__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_div", title="Extension field for ``div``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="generated | extensions | additional | empty", description=( "The status of the narrative - whether it's entirely generated (from " "just the defined data or the extensions too), or whether a human " "authored it and it may contain additional data." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["generated", "extensions", "additional", "empty"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Narrative`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "status", "div"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Narrative`` according to specification, with preserving the original sequence order. """ return [] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("div", "div__ext"), ("status", "status__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/nutritionorder.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/NutritionOrder Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class NutritionOrder(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Diet, formula or nutritional supplement request. A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. """ __resource_type__ = "NutritionOrder" allergyIntolerance: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="allergyIntolerance", title=( "List of the patient's food and nutrition-related allergies and " "intolerances" ), description=( "A link to a record of allergies or intolerances which should be " "included in the nutrition order." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["AllergyIntolerance"], }, ) dateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="dateTime", title="Date and time the nutrition order was requested", description="The date and time that this nutrition order was requested.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) dateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dateTime", title="Extension field for ``dateTime``." ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="The encounter associated with this nutrition order", description=( "An encounter that provides additional information about the healthcare" " context in which this request is made." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) enteralFormula: fhirtypes.NutritionOrderEnteralFormulaType | None = Field( default=None, alias="enteralFormula", title="Enteral formula components", description=( "Feeding provided through the gastrointestinal tract via a tube, " "catheter, or stoma that delivers nutrition distal to the oral cavity." ), json_schema_extra={ "element_property": True, }, ) excludeFoodModifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="excludeFoodModifier", title=( "Order-specific modifier about the type of food that should not be " "given" ), description=( "This modifier is used to convey order-specific modifiers about the " "type of food that should NOT be given. These can be derived from " "patient allergies, intolerances, or preferences such as No Red Meat, " "No Soy or No Wheat or Gluten-Free. While it should not be necessary " "to repeat allergy or intolerance information captured in the " "referenced AllergyIntolerance resource in the excludeFoodModifier, " "this element may be used to convey additional specificity related to " "foods that should be eliminated from the patient\u2019s diet for any " "reason. This modifier applies to the entire nutrition order inclusive" " of the oral diet, nutritional supplements and enteral formula " "feedings." ), json_schema_extra={ "element_property": True, }, ) foodPreferenceModifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="foodPreferenceModifier", title="Order-specific modifier about the type of food that should be given", description=( "This modifier is used to convey order-specific modifiers about the " "type of food that should be given. These can be derived from patient " "allergies, intolerances, or preferences such as Halal, Vegan or " "Kosher. This modifier applies to the entire nutrition order inclusive " "of the oral diet, nutritional supplements and enteral formula " "feedings." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifiers assigned to this order", description=( "Identifiers assigned to this order by the order sender or by the order" " receiver." ), json_schema_extra={ "element_property": True, }, ) oralDiet: fhirtypes.NutritionOrderOralDietType | None = Field( default=None, alias="oralDiet", title="Oral diet components", description="Diet given orally in contrast to enteral (tube) feeding.", json_schema_extra={ "element_property": True, }, ) orderer: fhirtypes.ReferenceType | None = Field( default=None, alias="orderer", title="Who ordered the diet, formula or nutritional supplement", description=( "The practitioner that holds legal responsibility for ordering the " "diet, nutritional supplement, or formula feedings." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="The person who requires the diet, formula or nutritional supplement", description=( "The person (patient) who needs the nutrition order for an oral diet, " "nutritional supplement and/or enteral or formula feeding." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "proposed | draft | planned | requested | active | on-hold | completed " "| cancelled | entered-in-error" ), description="The workflow status of the nutrition order/request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "proposed", "draft", "planned", "requested", "active", "on-hold", "completed", "cancelled", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) supplement: typing.List[fhirtypes.NutritionOrderSupplementType] | None = Field( default=None, alias="supplement", title="Supplement components", description=( "Oral nutritional products given in order to add further nutritional " "value to the patient's diet." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrder`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "patient", "encounter", "dateTime", "orderer", "allergyIntolerance", "foodPreferenceModifier", "excludeFoodModifier", "oralDiet", "supplement", "enteralFormula", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrder`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "status", "patient", "dateTime", "orderer", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("dateTime", "dateTime__ext")] return required_fields class NutritionOrderEnteralFormula(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Enteral formula components. Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity. """ __resource_type__ = "NutritionOrderEnteralFormula" additiveProductName: fhirtypes.StringType | None = Field( default=None, alias="additiveProductName", title="Product or brand name of the modular additive", description=( "The product or brand name of the type of modular component to be added" " to the formula." ), json_schema_extra={ "element_property": True, }, ) additiveProductName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_additiveProductName", title="Extension field for ``additiveProductName``.", ) additiveType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="additiveType", title="Type of modular component to add to the feeding", description=( "Indicates the type of modular component such as protein, carbohydrate," " fat or fiber to be provided in addition to or mixed with the base " "formula." ), json_schema_extra={ "element_property": True, }, ) administration: typing.List[ fhirtypes.NutritionOrderEnteralFormulaAdministrationType ] | None = Field( default=None, alias="administration", title="Formula feeding instruction as structured data", description=( "Formula administration instructions as structured data. This " "repeating structure allows for changing the administration rate or " "volume over time for both bolus and continuous feeding. An example of" " this would be an instruction to increase the rate of continuous " "feeding every 2 hours." ), json_schema_extra={ "element_property": True, }, ) administrationInstruction: fhirtypes.StringType | None = Field( default=None, alias="administrationInstruction", title="Formula feeding instructions expressed as text", description=( "Free text formula administration, feeding instructions or additional " "instructions or information." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) administrationInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_administrationInstruction", title="Extension field for ``administrationInstruction``.", ) baseFormulaProductName: fhirtypes.StringType | None = Field( default=None, alias="baseFormulaProductName", title="Product or brand name of the enteral or infant formula", description=( "The product or brand name of the enteral or infant formula product " 'such as "ACME Adult Standard Formula".' ), json_schema_extra={ "element_property": True, }, ) baseFormulaProductName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_baseFormulaProductName", title="Extension field for ``baseFormulaProductName``.", ) baseFormulaType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="baseFormulaType", title="Type of enteral or infant formula", description=( "The type of enteral or infant formula such as an adult standard " "formula with fiber or a soy-based infant formula." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) caloricDensity: fhirtypes.QuantityType | None = Field( default=None, alias="caloricDensity", title="Amount of energy per specified volume that is required", description=( "The amount of energy (calories) that the formula should provide per " "specified volume, typically per mL or fluid oz. For example, an " "infant may require a formula that provides 24 calories per fluid ounce" " or an adult may require an enteral formula that provides 1.5 " "calorie/mL." ), json_schema_extra={ "element_property": True, }, ) maxVolumeToDeliver: fhirtypes.QuantityType | None = Field( default=None, alias="maxVolumeToDeliver", title="Upper limit on formula volume per unit of time", description=( "The maximum total quantity of formula that may be administered to a " "subject over the period of time, e.g. 1440 mL over 24 hours." ), json_schema_extra={ "element_property": True, }, ) routeofAdministration: fhirtypes.CodeableConceptType | None = Field( default=None, alias="routeofAdministration", title="How the formula should enter the patient's gastrointestinal tract", description=( "The route or physiological path of administration into the patient's " "gastrointestinal tract for purposes of providing the formula feeding," " e.g. nasogastric tube." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrderEnteralFormula`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "baseFormulaType", "baseFormulaProductName", "additiveType", "additiveProductName", "caloricDensity", "routeofAdministration", "administration", "maxVolumeToDeliver", "administrationInstruction", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrderEnteralFormula`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "baseFormulaType", "administrationInstruction"] class NutritionOrderEnteralFormulaAdministration(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Formula feeding instruction as structured data. Formula administration instructions as structured data. This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding. An example of this would be an instruction to increase the rate of continuous feeding every 2 hours. """ __resource_type__ = "NutritionOrderEnteralFormulaAdministration" quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="The volume of formula to provide", description=( "The volume of formula to provide to the patient per the specified " "administration schedule." ), json_schema_extra={ "element_property": True, }, ) rateQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="rateQuantity", title="Speed with which the formula is provided per period of time", description=( "The rate of administration of formula via a feeding pump, e.g. 60 mL " "per hour, according to the specified schedule." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e rate[x] "one_of_many": "rate", "one_of_many_required": False, }, ) rateRatio: fhirtypes.RatioType | None = Field( default=None, alias="rateRatio", title="Speed with which the formula is provided per period of time", description=( "The rate of administration of formula via a feeding pump, e.g. 60 mL " "per hour, according to the specified schedule." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e rate[x] "one_of_many": "rate", "one_of_many_required": False, }, ) schedule: fhirtypes.TimingType | None = Field( default=None, alias="schedule", title="Scheduled frequency of enteral feeding", description=( "The time period and frequency at which the enteral formula should be " "delivered to the patient." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrderEnteralFormulaAdministration`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "schedule", "quantity", "rateQuantity", "rateRatio", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrderEnteralFormulaAdministration`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"rate": ["rateQuantity", "rateRatio"]} return one_of_many_fields class NutritionOrderOralDiet(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Oral diet components. Diet given orally in contrast to enteral (tube) feeding. """ __resource_type__ = "NutritionOrderOralDiet" fluidConsistencyType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="fluidConsistencyType", title="The required consistency of fluids and liquids provided to the patient", description=( "The required consistency (e.g. honey-thick, nectar-thick, thin, " "thickened.) of liquids or fluids served to the patient." ), json_schema_extra={ "element_property": True, }, ) instruction: fhirtypes.StringType | None = Field( default=None, alias="instruction", title="Instructions or additional information about the oral diet", description=( "Free text or additional instructions or information pertaining to the " "oral diet." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instruction", title="Extension field for ``instruction``." ) nutrient: typing.List[fhirtypes.NutritionOrderOralDietNutrientType] | None = Field( default=None, alias="nutrient", title="Required nutrient modifications", description=( "Class that defines the quantity and type of nutrient modifications " "(for example carbohydrate, fiber or sodium) required for the oral " "diet." ), json_schema_extra={ "element_property": True, }, ) schedule: typing.List[fhirtypes.TimingType] | None = Field( default=None, alias="schedule", title="Scheduled frequency of diet", description=( "The time period and frequency at which the diet should be given. The " "diet should be given for the combination of all schedules if more than" " one schedule is present." ), json_schema_extra={ "element_property": True, }, ) texture: typing.List[fhirtypes.NutritionOrderOralDietTextureType] | None = Field( default=None, alias="texture", title="Required texture modifications", description=( "Class that describes any texture modifications required for the " "patient to safely consume various types of solid foods." ), json_schema_extra={ "element_property": True, }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title=( "Type of oral diet or diet restrictions that describe what can be " "consumed orally" ), description=( "The kind of diet or dietary restriction such as fiber restricted diet " "or diabetic diet." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrderOralDiet`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "schedule", "nutrient", "texture", "fluidConsistencyType", "instruction", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrderOralDiet`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "instruction"] class NutritionOrderOralDietNutrient(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Required nutrient modifications. Class that defines the quantity and type of nutrient modifications (for example carbohydrate, fiber or sodium) required for the oral diet. """ __resource_type__ = "NutritionOrderOralDietNutrient" amount: fhirtypes.QuantityType | None = Field( default=None, alias="amount", title="Quantity of the specified nutrient", description="The quantity of the specified nutrient to include in diet.", json_schema_extra={ "element_property": True, }, ) modifier: fhirtypes.CodeableConceptType | None = Field( default=None, alias="modifier", title="Type of nutrient that is being modified", description="The nutrient that is being modified such as carbohydrate or sodium.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrderOralDietNutrient`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "modifier", "amount"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrderOralDietNutrient`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class NutritionOrderOralDietTexture(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Required texture modifications. Class that describes any texture modifications required for the patient to safely consume various types of solid foods. """ __resource_type__ = "NutritionOrderOralDietTexture" foodType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="foodType", title=( "Concepts that are used to identify an entity that is ingested for " "nutritional purposes" ), description=( "The food type(s) (e.g. meats, all foods) that the texture " "modification applies to. This could be all foods types." ), json_schema_extra={ "element_property": True, }, ) modifier: fhirtypes.CodeableConceptType | None = Field( default=None, alias="modifier", title="Code to indicate how to alter the texture of the foods, e.g. pureed", description=( "Any texture modifications (for solid foods) that should be made, e.g. " "easy to chew, chopped, ground, and pureed." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrderOralDietTexture`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "modifier", "foodType"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrderOralDietTexture`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class NutritionOrderSupplement(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Supplement components. Oral nutritional products given in order to add further nutritional value to the patient's diet. """ __resource_type__ = "NutritionOrderSupplement" instruction: fhirtypes.StringType | None = Field( default=None, alias="instruction", title="Instructions or additional information about the oral supplement", description=( "Free text or additional instructions or information pertaining to the " "oral supplement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instruction", title="Extension field for ``instruction``." ) productName: fhirtypes.StringType | None = Field( default=None, alias="productName", title="Product or brand name of the nutritional supplement", description=( 'The product or brand name of the nutritional supplement such as "Acme ' 'Protein Shake".' ), json_schema_extra={ "element_property": True, }, ) productName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_productName", title="Extension field for ``productName``." ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Amount of the nutritional supplement", description="The amount of the nutritional supplement to be given.", json_schema_extra={ "element_property": True, }, ) schedule: typing.List[fhirtypes.TimingType] | None = Field( default=None, alias="schedule", title="Scheduled frequency of supplement", description=( "The time period and frequency at which the supplement(s) should be " "given. The supplement should be given for the combination of all " "schedules if more than one schedule is present." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Type of supplement product requested", description=( "The kind of nutritional supplement product required such as a high " "protein or pediatric clear liquid supplement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrderSupplement`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "productName", "schedule", "quantity", "instruction", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrderSupplement`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "instruction"] ================================================ FILE: fhir/resources/STU3/observation.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Observation Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Observation(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Measurements and simple assertions. Measurements and simple assertions made about a patient, device or other subject. """ __resource_type__ = "Observation" basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Fulfills plan, proposal or order", description=( "A plan, proposal or order that is fulfilled in whole or in part by " "this event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CarePlan", "DeviceRequest", "ImmunizationRecommendation", "MedicationRequest", "NutritionOrder", "ProcedureRequest", "ReferralRequest", ], }, ) bodySite: fhirtypes.CodeableConceptType | None = Field( default=None, alias="bodySite", title="Observed body part", description=( "Indicates the site on the subject's body where the observation was " "made (i.e. the target site)." ), json_schema_extra={ "element_property": True, }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Classification of type of observation", description="A code that classifies the general type of observation being made.", json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Type of observation (code / type)", description=( "Describes what was observed. Sometimes this is called the observation " '"name".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Comments about result", description=( "May include statements about significant, unexpected or unreliable " "values, or information about the source of the value where this may be" " relevant to the interpretation of the result." ), json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) component: typing.List[fhirtypes.ObservationComponentType] | None = Field( default=None, alias="component", title="Component results", description=( "Some observations have multiple component observations. These " "component observations are expressed as separate code value pairs that" " share the same attributes. Examples include systolic and diastolic " "component observations for blood pressure measurement and multiple " "component observations for genetics observations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Healthcare event during which this observation is made", description=( "The healthcare event (e.g. a patient and healthcare provider " "interaction) during which this observation is made." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) dataAbsentReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="dataAbsentReason", title="Why the result is missing", description=( "Provides a reason why the expected value in the element " "Observation.value[x] is missing." ), json_schema_extra={ "element_property": True, }, ) device: fhirtypes.ReferenceType | None = Field( default=None, alias="device", title="(Measurement) Device", description="The device used to generate the observation data.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device", "DeviceMetric"], }, ) effectiveDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="effectiveDateTime", title="Clinically relevant time/time-period for observation", description=( "The time or time-period the observed value is asserted as being true. " "For biological subjects - e.g. human patients - this is usually called" ' the "physiologically relevant time". This is usually either the time ' "of the procedure or of specimen collection, but very often the source " "of the date/time is not known, only the date/time itself." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_effectiveDateTime", title="Extension field for ``effectiveDateTime``.", ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="Clinically relevant time/time-period for observation", description=( "The time or time-period the observed value is asserted as being true. " "For biological subjects - e.g. human patients - this is usually called" ' the "physiologically relevant time". This is usually either the time ' "of the procedure or of specimen collection, but very often the source " "of the date/time is not known, only the date/time itself." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for observation", description="A unique identifier assigned to this observation.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) interpretation: fhirtypes.CodeableConceptType | None = Field( default=None, alias="interpretation", title="High, low, normal, etc.", description=( "The assessment made based on the result of the observation. Intended " "as a simple compact code often placed adjacent to the result value in " "reports and flow sheets to signal the meaning/normalcy status of the " "result. Otherwise known as abnormal flag." ), json_schema_extra={ "element_property": True, }, ) issued: fhirtypes.InstantType | None = Field( default=None, alias="issued", title="Date/Time this was made available", description=( "The date and time this observation was made available to providers, " "typically after the results have been reviewed and verified." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issued", title="Extension field for ``issued``." ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="How it was done", description="Indicates the mechanism used to perform the observation.", json_schema_extra={ "element_property": True, }, ) performer: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="performer", title="Who is responsible for the observation", description='Who was responsible for asserting the observed value as "true".', json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Organization", "Patient", "RelatedPerson", ], }, ) referenceRange: typing.List[fhirtypes.ObservationReferenceRangeType] | None = Field( default=None, alias="referenceRange", title="Provides guide for interpretation", description=( "Guidance on how to interpret the value by comparison to a normal or " "recommended range." ), json_schema_extra={ "element_property": True, }, ) related: typing.List[fhirtypes.ObservationRelatedType] | None = Field( default=None, alias="related", title="Resource related to this observation", description=( "A reference to another resource (usually another Observation) whose " "relationship is defined by the relationship type code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) specimen: fhirtypes.ReferenceType | None = Field( default=None, alias="specimen", title="Specimen used for this observation", description="The specimen that was used when this observation was made.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Specimen"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="registered | preliminary | final | amended +", description="The status of the result value.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["registered", "preliminary", "final", "amended", "+"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Who and/or what this is about", description=( "The patient, or group of patients, location, or device whose " "characteristics (direct or indirect) are described by the observation " "and into whose record the observation is placed. Comments: Indirect " "characteristics may be those of a specimen, fetus, donor, other " "observer (for example a relative or EMT), or any observation made " "about the subject." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group", "Device", "Location"], }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="valueSampledData", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Observation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "status", "category", "code", "subject", "context", "effectiveDateTime", "effectivePeriod", "issued", "performer", "valueQuantity", "valueCodeableConcept", "valueString", "valueBoolean", "valueRange", "valueRatio", "valueSampledData", "valueAttachment", "valueTime", "valueDateTime", "valuePeriod", "dataAbsentReason", "interpretation", "comment", "bodySite", "method", "specimen", "device", "referenceRange", "related", "component", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Observation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "basedOn", "status", "code", "subject", "effectiveDateTime", "effectivePeriod", "issued", "performer", "valueQuantity", "valueCodeableConcept", "valueString", "valueBoolean", "valueRange", "valueRatio", "valueSampledData", "valueAttachment", "valueTime", "valueDateTime", "valuePeriod", "related", "component", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "effective": ["effectiveDateTime", "effectivePeriod"], "value": [ "valueAttachment", "valueBoolean", "valueCodeableConcept", "valueDateTime", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueSampledData", "valueString", "valueTime", ], } return one_of_many_fields class ObservationComponent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Component results. Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same attributes. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations. """ __resource_type__ = "ObservationComponent" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Type of component observation (code / type)", description=( "Describes what was observed. Sometimes this is called the observation " '"code".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dataAbsentReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="dataAbsentReason", title="Why the component result is missing", description=( "Provides a reason why the expected value in the element " "Observation.value[x] is missing." ), json_schema_extra={ "element_property": True, }, ) interpretation: fhirtypes.CodeableConceptType | None = Field( default=None, alias="interpretation", title="High, low, normal, etc.", description=( "The assessment made based on the result of the observation. Intended " "as a simple compact code often placed adjacent to the result value in " "reports and flow sheets to signal the meaning/normalcy status of the " "result. Otherwise known as abnormal flag." ), json_schema_extra={ "element_property": True, }, ) referenceRange: typing.List[fhirtypes.ObservationReferenceRangeType] | None = Field( default=None, alias="referenceRange", title="Provides guide for interpretation of component result", description=( "Guidance on how to interpret the value by comparison to a normal or " "recommended range." ), json_schema_extra={ "element_property": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="valueSampledData", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ObservationComponent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "valueQuantity", "valueCodeableConcept", "valueString", "valueRange", "valueRatio", "valueSampledData", "valueAttachment", "valueTime", "valueDateTime", "valuePeriod", "dataAbsentReason", "interpretation", "referenceRange", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ObservationComponent`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "code", "valueQuantity", "valueCodeableConcept", "valueString", "valueRange", "valueRatio", "valueSampledData", "valueAttachment", "valueTime", "valueDateTime", "valuePeriod", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueCodeableConcept", "valueDateTime", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueSampledData", "valueString", "valueTime", ] } return one_of_many_fields class ObservationReferenceRange(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Provides guide for interpretation. Guidance on how to interpret the value by comparison to a normal or recommended range. """ __resource_type__ = "ObservationReferenceRange" age: fhirtypes.RangeType | None = Field( default=None, alias="age", title="Applicable age range, if relevant", description=( "The age at which this reference range is applicable. This is a " "neonatal age (e.g. number of weeks at term) if the meaning says so." ), json_schema_extra={ "element_property": True, }, ) appliesTo: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="appliesTo", title="Reference range population", description=( "Codes to indicate the target population this reference range applies " "to. For example, a reference range may be based on the normal " "population or a particular sex or race." ), json_schema_extra={ "element_property": True, }, ) high: fhirtypes.QuantityType | None = Field( default=None, alias="high", title="High Range, if relevant", description=( "The value of the high bound of the reference range. The high bound of" " the reference range endpoint is inclusive of the value (e.g. " "reference range is >=5 - <=9). If the high bound is omitted, it is " "assumed to be meaningless (e.g. reference range is >= 2.3)." ), json_schema_extra={ "element_property": True, }, ) low: fhirtypes.QuantityType | None = Field( default=None, alias="low", title="Low Range, if relevant", description=( "The value of the low bound of the reference range. The low bound of " "the reference range endpoint is inclusive of the value (e.g. " "reference range is >=5 - <=9). If the low bound is omitted, it is " "assumed to be meaningless (e.g. reference range is <=2.3)." ), json_schema_extra={ "element_property": True, }, ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Text based reference range in an observation", description=( "Text based reference range in an observation which may be used when a " "quantitative range is not appropriate for an observation. An example " 'would be a reference value of "Negative" or a list or table of ' "'normals'." ), json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Reference range qualifier", description=( "Codes to indicate the what part of the targeted reference population " "it applies to. For example, the normal or therapeutic range." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ObservationReferenceRange`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "low", "high", "type", "appliesTo", "age", "text", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ObservationReferenceRange`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ObservationRelated(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Resource related to this observation. A reference to another resource (usually another Observation) whose relationship is defined by the relationship type code. """ __resource_type__ = "ObservationRelated" target: fhirtypes.ReferenceType = Field( default=..., alias="target", title="Resource that is related to this one", description=( "A reference to the observation or " "[QuestionnaireResponse](questionnaireresponse.html#) resource that is " "related to this observation." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Observation", "QuestionnaireResponse", "Sequence", ], }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "has-member | derived-from | sequel-to | replaces | qualified-by | " "interfered-by" ), description=( "A code specifying the kind of relationship that exists with the target" " resource." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "has-member", "derived-from", "sequel-to", "replaces", "qualified-by", "interfered-by", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ObservationRelated`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "target"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ObservationRelated`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/operationdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/OperationDefinition Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class OperationDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of an operation or a named query. A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). """ __resource_type__ = "OperationDefinition" base: fhirtypes.ReferenceType | None = Field( default=None, alias="base", title="Marks this as a profile of the base", description=( "Indicates that this operation definition is a constraining profile on " "the base." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["OperationDefinition"], }, ) code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Name used to invoke the operation", description="The name used to invoke the operation.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Additional information about use", description="Additional information about how to use this operation or named query.", json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date this was last changed", description=( "The date (and optionally time) when the operation definition was " "published. The date must change if and when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the operation " "definition changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the operation definition", description=( "A free text natural language description of the operation definition " "from a consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A boolean value to indicate that this operation definition is authored" " for testing purposes (or education/evaluation/marketing), and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) idempotent: bool | None = Field( default=None, alias="idempotent", title="Whether content is unchanged by the operation", description=( "Operations that are idempotent (see [HTTP specification definition of " "idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) " "may be invoked by performing an HTTP GET operation instead of a POST." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) idempotent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_idempotent", title="Extension field for ``idempotent``." ) instance: bool | None = Field( default=None, alias="instance", title="Invoke on an instance?", description=( "Indicates whether this operation can be invoked on a particular " "instance of one of the given types." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) instance__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instance", title="Extension field for ``instance``." ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for operation definition (if applicable)", description=( "A legal or geographic region in which the operation definition is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title="operation | query", description="Whether this is an operation or a named query.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["operation", "query"], }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this operation definition (computer friendly)", description=( "A natural language name identifying the operation definition. This " "name should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) overload: typing.List[fhirtypes.OperationDefinitionOverloadType] | None = Field( default=None, alias="overload", title="Define overloaded variants for when generating code", description=( "Defines an appropriate combination of parameters to use when invoking " "this operation, to help code generators when generating overloaded " "parameter sets for this operation." ), json_schema_extra={ "element_property": True, }, ) parameter: typing.List[fhirtypes.OperationDefinitionParameterType] | None = Field( default=None, alias="parameter", title="Parameters for the operation/query", description="The parameters for the operation/query.", json_schema_extra={ "element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the individual or organization that published the " "operation definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this operation definition is defined", description=( "Explaination of why this operation definition is needed and why it has" " been designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) resource: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="resource", title="Types this operation applies to", description="The types on which this operation can be executed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) resource__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_resource", title="Extension field for ``resource``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this operation definition. Enables tracking the life-" "cycle of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) system: bool | None = Field( default=None, alias="system", title="Invoke at the system level?", description=( "Indicates whether this operation or named query can be invoked at the " "system level (e.g. without needing to choose a resource type for the " "context)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) type: bool | None = Field( default=None, alias="type", title="Invole at the type level?", description=( "Indicates whether this operation or named query can be invoked at the " "resource type level for any given resource type level (e.g. without " "needing to choose a specific resource id for the context)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Logical URI to reference this operation definition (globally unique)", description=( "An absolute URI that is used to identify this operation definition " "when it is referenced in a specification, model, design or an " "instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD " "be an address at which this operation definition is (or will be) " "published. The URL SHOULD include the major version of the operation " "definition. For more information see [Technical and Business " "Versions](resource.html#versions)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Context the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching for appropriate operation definition instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the operation definition", description=( "The identifier that is used to identify this version of the operation " "definition when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the operation " "definition author and is not expected to be globally unique. For " "example, it might be a timestamp (e.g. yyyymmdd) if a managed version " "is not available. There is also no expectation that versions can be " "placed in a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OperationDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "version", "name", "status", "kind", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "idempotent", "code", "comment", "base", "resource", "system", "type", "instance", "parameter", "overload", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OperationDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "version", "name", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "idempotent", "code", "base", "resource", "system", "type", "instance", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("code", "code__ext"), ("instance", "instance__ext"), ("kind", "kind__ext"), ("name", "name__ext"), ("status", "status__ext"), ("system", "system__ext"), ("type", "type__ext"), ] return required_fields class OperationDefinitionOverload(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Define overloaded variants for when generating code. Defines an appropriate combination of parameters to use when invoking this operation, to help code generators when generating overloaded parameter sets for this operation. """ __resource_type__ = "OperationDefinitionOverload" comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Comments to go on overload", description=None, json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) parameterName: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="parameterName", title="Name of parameter to include in overload", description=None, json_schema_extra={ "element_property": True, }, ) parameterName__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_parameterName", title="Extension field for ``parameterName``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OperationDefinitionOverload`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "parameterName", "comment"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OperationDefinitionOverload`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class OperationDefinitionParameter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Parameters for the operation/query. The parameters for the operation/query. """ __resource_type__ = "OperationDefinitionParameter" binding: fhirtypes.OperationDefinitionParameterBindingType | None = Field( default=None, alias="binding", title="ValueSet details if this is coded", description=( "Binds to a value set if this parameter is coded (code, Coding, " "CodeableConcept)." ), json_schema_extra={ "element_property": True, }, ) documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Description of meaning/use", description="Describes the meaning or use of this parameter.", json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) max: fhirtypes.StringType | None = Field( default=None, alias="max", title="Maximum Cardinality (a number or *)", description=( "The maximum number of times this element is permitted to appear in the" " request or response." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_max", title="Extension field for ``max``." ) min: fhirtypes.IntegerType | None = Field( default=None, alias="min", title="Minimum Cardinality", description=( "The minimum number of times this parameter SHALL appear in the request" " or response." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_min", title="Extension field for ``min``." ) name: fhirtypes.CodeType | None = Field( default=None, alias="name", title="Name in Parameters.parameter.name or in URL", description="The name of used to identify the parameter.", json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) part: typing.List[fhirtypes.OperationDefinitionParameterType] | None = Field( default=None, alias="part", title="Parts of a nested Parameter", description="The parts of a nested Parameter.", json_schema_extra={ "element_property": True, }, ) profile: fhirtypes.ReferenceType | None = Field( default=None, alias="profile", title="Profile on the type", description="A profile the specifies the rules that this parameter must conform to.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) searchType: fhirtypes.CodeType | None = Field( default=None, alias="searchType", title=( "number | date | string | token | reference | composite | quantity | " "uri" ), description=( "How the parameter is understood as a search parameter. This is only " "used if the parameter type is 'string'." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "number", "date", "string", "token", "reference", "composite", "quantity", "uri", ], }, ) searchType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_searchType", title="Extension field for ``searchType``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="What type this parameter has", description="The type for this parameter.", json_schema_extra={ "element_property": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="in | out", description="Whether this is an input or an output parameter.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["in", "out"], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OperationDefinitionParameter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "use", "min", "max", "documentation", "type", "searchType", "profile", "binding", "part", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OperationDefinitionParameter`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("max", "max__ext"), ("min", "min__ext"), ("name", "name__ext"), ("use", "use__ext"), ] return required_fields class OperationDefinitionParameterBinding(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. ValueSet details if this is coded. Binds to a value set if this parameter is coded (code, Coding, CodeableConcept). """ __resource_type__ = "OperationDefinitionParameterBinding" strength: fhirtypes.CodeType | None = Field( default=None, alias="strength", title="required | extensible | preferred | example", description=( "Indicates the degree of conformance expectations associated with this " "binding - that is, the degree to which the provided value set must be " "adhered to in the instances." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["required", "extensible", "preferred", "example"], }, ) strength__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_strength", title="Extension field for ``strength``." ) valueSetReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueSetReference", title="Source of value set", description=( "Points to the value set or external definition (e.g. implicit value " "set) that identifies the set of codes to be used." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e valueSet[x] "one_of_many": "valueSet", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) valueSetUri: fhirtypes.UriType | None = Field( default=None, alias="valueSetUri", title="Source of value set", description=( "Points to the value set or external definition (e.g. implicit value " "set) that identifies the set of codes to be used." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e valueSet[x] "one_of_many": "valueSet", "one_of_many_required": True, }, ) valueSetUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueSetUri", title="Extension field for ``valueSetUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OperationDefinitionParameterBinding`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "strength", "valueSetUri", "valueSetReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OperationDefinitionParameterBinding`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("strength", "strength__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"valueSet": ["valueSetReference", "valueSetUri"]} return one_of_many_fields ================================================ FILE: fhir/resources/STU3/operationoutcome.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/OperationOutcome Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class OperationOutcome(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about the success/failure of an action. A collection of error, warning or information messages that result from a system action. """ __resource_type__ = "OperationOutcome" issue: typing.List[fhirtypes.OperationOutcomeIssueType] = Field( default=..., alias="issue", title="A single issue associated with the action", description=( "An error, warning or information message that results from a system " "action." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OperationOutcome`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "issue", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OperationOutcome`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "issue"] class OperationOutcomeIssue(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A single issue associated with the action. An error, warning or information message that results from a system action. """ __resource_type__ = "OperationOutcomeIssue" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Error or warning code", description=( "Describes the type of the issue. The system that creates an " "OperationOutcome SHALL choose the most applicable code from the " "IssueType value set, and may additional provide its own code for the " "error in the details element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) details: fhirtypes.CodeableConceptType | None = Field( default=None, alias="details", title="Additional details about the error", description=( "Additional details about the error. This may be a text description of " "the error, or a system code that identifies the error." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) diagnostics: fhirtypes.StringType | None = Field( default=None, alias="diagnostics", title="Additional diagnostic information about the issue", description=( "Additional diagnostic information about the issue. Typically, this " "may be a description of how a value is erroneous, or a stack dump to " "help trace the issue." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) diagnostics__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_diagnostics", title="Extension field for ``diagnostics``." ) expression: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="expression", title="FHIRPath of element(s) related to issue", description=( "A simple FHIRPath limited to element names, repetition indicators and " "the default child access that identifies one of the elements in the " "resource that caused this issue to be raised." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) expression__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) location: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="location", title="Path of element(s) related to issue", description=( "For resource issues, this will be a simple XPath limited to element " "names, repetition indicators and the default child access that " "identifies one of the elements in the resource that caused this issue " 'to be raised. For HTTP errors, will be "http." + the parameter name.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) location__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_location", title="Extension field for ``location``." ) severity: fhirtypes.CodeType | None = Field( default=None, alias="severity", title="fatal | error | warning | information", description=( "Indicates whether the issue indicates a variation from successful " "processing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["fatal", "error", "warning", "information"], }, ) severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_severity", title="Extension field for ``severity``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OperationOutcomeIssue`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "severity", "code", "details", "diagnostics", "location", "expression", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OperationOutcomeIssue`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "severity", "code", "details", "diagnostics", "location", "expression", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext"), ("severity", "severity__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/organization.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Organization Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Organization(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A grouping of people or organizations with a common purpose. A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc. """ __resource_type__ = "Organization" active: bool | None = Field( default=None, alias="active", title="Whether the organization's record is still in active use", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) address: typing.List[fhirtypes.AddressType] | None = Field( default=None, alias="address", title="An address for the organization", description=None, json_schema_extra={ "element_property": True, }, ) alias: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="alias", title=( "A list of\u00a0alternate names that the organization is known as, or was " "known as in the past" ), description=None, json_schema_extra={ "element_property": True, }, ) alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_alias", title="Extension field for ``alias``." ) contact: typing.List[fhirtypes.OrganizationContactType] | None = Field( default=None, alias="contact", title="Contact for the organization for a certain purpose", description=None, json_schema_extra={ "element_property": True, }, ) endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title=( "Technical endpoints providing access to services operated for the " "organization" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifies this organization across multiple systems", description=( "Identifier for the organization that is used to identify the " "organization across multiple disparate systems." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name used for the organization", description="A name associated with the organization.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) partOf: fhirtypes.ReferenceType | None = Field( default=None, alias="partOf", title="The organization of which this organization forms a part", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="A contact detail for the organization", description=None, json_schema_extra={ "element_property": True, }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Kind of organization", description="The kind(s) of organization that this is.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Organization`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "type", "name", "alias", "telecom", "address", "partOf", "contact", "endpoint", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Organization`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "active", "type", "name", "partOf", ] class OrganizationContact(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contact for the organization for a certain purpose. """ __resource_type__ = "OrganizationContact" address: fhirtypes.AddressType | None = Field( default=None, alias="address", title="Visiting or postal addresses for the contact", description=None, json_schema_extra={ "element_property": True, }, ) name: fhirtypes.HumanNameType | None = Field( default=None, alias="name", title="A name associated with the contact", description=None, json_schema_extra={ "element_property": True, }, ) purpose: fhirtypes.CodeableConceptType | None = Field( default=None, alias="purpose", title="The type of contact", description="Indicates a purpose for which the contact can be reached.", json_schema_extra={ "element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="Contact details (telephone, email, etc.) for a contact", description=( "A contact detail (e.g. a telephone number or an email address) by " "which the party may be contacted." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OrganizationContact`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "purpose", "name", "telecom", "address", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OrganizationContact`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/parameterdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ParameterDefinition Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class ParameterDefinition(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of a parameter to a module. The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse. """ __resource_type__ = "ParameterDefinition" documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="A brief description of the parameter", description=( "A brief discussion of what the parameter is for and how it is used by " "the module." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) max: fhirtypes.StringType | None = Field( default=None, alias="max", title="Maximum cardinality (a number of *)", description=( "The maximum number of times this element is permitted to appear in the" " request or response." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_max", title="Extension field for ``max``." ) min: fhirtypes.IntegerType | None = Field( default=None, alias="min", title="Minimum cardinality", description=( "The minimum number of times this parameter SHALL appear in the request" " or response." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_min", title="Extension field for ``min``." ) name: fhirtypes.CodeType | None = Field( default=None, alias="name", title="Name used to access the parameter value", description=( "The name of the parameter used to allow access to the value of the " "parameter in evaluation contexts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) profile: fhirtypes.ReferenceType | None = Field( default=None, alias="profile", title="What profile the value is expected to be", description=( "If specified, this indicates a profile that the input data must " "conform to, or that the output data will conform to." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="What type of value", description="The type of the parameter.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="in | out", description="Whether the parameter is input or output for the module.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["in", "out"], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ParameterDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "name", "use", "min", "max", "documentation", "type", "profile", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ParameterDefinition`` according to specification, with preserving the original sequence order. """ return ["name", "use", "min", "max", "documentation", "type", "profile"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext"), ("use", "use__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/parameters.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Parameters Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, fhirtypes, resource class Parameters(resource.Resource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Operation Request or Response. This special resource type is used to represent an operation request and response (operations.html). It has no other use, and there is no RESTful endpoint associated with it. """ __resource_type__ = "Parameters" parameter: typing.List[fhirtypes.ParametersParameterType] | None = Field( default=None, alias="parameter", title="Operation Parameter", description="A parameter passed to or received from the operation.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Parameters`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "language", "parameter"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Parameters`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "parameter"] class ParametersParameter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Operation Parameter. A parameter passed to or received from the operation. """ __resource_type__ = "ParametersParameter" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name from the definition", description="The name of the parameter (reference to the operation definition).", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) part: typing.List[fhirtypes.ParametersParameterType] | None = Field( default=None, alias="part", title="Named part of a multi-part parameter", description="A named part of a multi-part parameter.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) resource: fhirtypes.ResourceType | None = Field( default=None, alias="resource", title="If parameter is a whole resource", description="If the parameter is a whole resource.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueAddress: fhirtypes.AddressType | None = Field( default=None, alias="valueAddress", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueAge: fhirtypes.AgeType | None = Field( default=None, alias="valueAge", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="valueAnnotation", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="valueBase64Binary", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBase64Binary", title="Extension field for ``valueBase64Binary``.", ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="valueContactPoint", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCount: fhirtypes.CountType | None = Field( default=None, alias="valueCount", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueDistance: fhirtypes.DistanceType | None = Field( default=None, alias="valueDistance", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDuration: fhirtypes.DurationType | None = Field( default=None, alias="valueDuration", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="valueHumanName", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueId: fhirtypes.IdType | None = Field( default=None, alias="valueId", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueId", title="Extension field for ``valueId``." ) valueIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="valueIdentifier", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInstant: fhirtypes.InstantType | None = Field( default=None, alias="valueInstant", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInstant", title="Extension field for ``valueInstant``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="valueMarkdown", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueMarkdown", title="Extension field for ``valueMarkdown``.", ) valueMeta: fhirtypes.MetaType | None = Field( default=None, alias="valueMeta", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueMoney: fhirtypes.MoneyType | None = Field( default=None, alias="valueMoney", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueOid: fhirtypes.OidType | None = Field( default=None, alias="valueOid", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueOid", title="Extension field for ``valueOid``." ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="valuePositiveInt", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valuePositiveInt", title="Extension field for ``valuePositiveInt``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="valueSampledData", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueSignature: fhirtypes.SignatureType | None = Field( default=None, alias="valueSignature", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) valueTiming: fhirtypes.TimingType | None = Field( default=None, alias="valueTiming", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="valueUnsignedInt", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUnsignedInt", title="Extension field for ``valueUnsignedInt``.", ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="If parameter is a data type", description="If the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ParametersParameter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "valueBase64Binary", "valueBoolean", "valueCode", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInstant", "valueInteger", "valueMarkdown", "valueOid", "valuePositiveInt", "valueString", "valueTime", "valueUnsignedInt", "valueUri", "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueCodeableConcept", "valueCoding", "valueContactPoint", "valueCount", "valueDistance", "valueDuration", "valueHumanName", "valueIdentifier", "valueMoney", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueReference", "valueSampledData", "valueSignature", "valueTiming", "valueMeta", "resource", "part", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ParametersParameter`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "name", "valueBase64Binary", "valueBoolean", "valueCode", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInstant", "valueInteger", "valueMarkdown", "valueOid", "valuePositiveInt", "valueString", "valueTime", "valueUnsignedInt", "valueUri", "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueCodeableConcept", "valueCoding", "valueContactPoint", "valueCount", "valueDistance", "valueDuration", "valueHumanName", "valueIdentifier", "valueMoney", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueReference", "valueSampledData", "valueSignature", "valueTiming", "valueMeta", "resource", "part", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueBase64Binary", "valueBoolean", "valueCode", "valueCodeableConcept", "valueCoding", "valueContactPoint", "valueCount", "valueDate", "valueDateTime", "valueDecimal", "valueDistance", "valueDuration", "valueHumanName", "valueId", "valueIdentifier", "valueInstant", "valueInteger", "valueMarkdown", "valueMeta", "valueMoney", "valueOid", "valuePeriod", "valuePositiveInt", "valueQuantity", "valueRange", "valueRatio", "valueReference", "valueSampledData", "valueSignature", "valueString", "valueTime", "valueTiming", "valueUnsignedInt", "valueUri", ] } return one_of_many_fields ================================================ FILE: fhir/resources/STU3/patient.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Patient Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Patient(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about an individual or animal receiving health care services. Demographics and other administrative information about an individual or animal receiving care or other health-related services. """ __resource_type__ = "Patient" active: bool | None = Field( default=None, alias="active", title="Whether this patient's record is in active use", description="Whether this patient record is in active use.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) address: typing.List[fhirtypes.AddressType] | None = Field( default=None, alias="address", title="Addresses for the individual", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) animal: fhirtypes.PatientAnimalType | None = Field( default=None, alias="animal", title="This patient is known to be an animal (non-human)", description="This patient is known to be an animal.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) birthDate: fhirtypes.DateType | None = Field( default=None, alias="birthDate", title="The date of birth for the individual", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) birthDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_birthDate", title="Extension field for ``birthDate``." ) communication: typing.List[fhirtypes.PatientCommunicationType] | None = Field( default=None, alias="communication", title=( "A list of Languages which may be used to communicate with the patient " "about his or her health" ), description=( "Languages which may be used to communicate with the patient about his " "or her health." ), json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.PatientContactType] | None = Field( default=None, alias="contact", title="A contact party (e.g. guardian, partner, friend) for the patient", description=None, json_schema_extra={ "element_property": True, }, ) deceasedBoolean: bool | None = Field( default=None, alias="deceasedBoolean", title="Indicates if the individual is deceased or not", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deceasedBoolean", title="Extension field for ``deceasedBoolean``.", ) deceasedDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="deceasedDateTime", title="Indicates if the individual is deceased or not", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deceasedDateTime", title="Extension field for ``deceasedDateTime``.", ) gender: fhirtypes.CodeType | None = Field( default=None, alias="gender", title="male | female | other | unknown", description=( "Administrative Gender - the gender that the patient is considered to " "have for administration and record keeping purposes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["male", "female", "other", "unknown"], }, ) gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_gender", title="Extension field for ``gender``." ) generalPractitioner: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="generalPractitioner", title="Patient's nominated primary care provider", description="Patient's nominated care provider.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization", "Practitioner"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="An identifier for this patient", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) link: typing.List[fhirtypes.PatientLinkType] | None = Field( default=None, alias="link", title="Link to another patient resource that concerns the same actual person", description=( "Link to another patient resource that concerns the same actual " "patient." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) managingOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="managingOrganization", title="Organization that is the custodian of the patient record", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) maritalStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="maritalStatus", title="Marital (civil) status of a patient", description="This field contains a patient's most recent marital (civil) status.", json_schema_extra={ "element_property": True, }, ) multipleBirthBoolean: bool | None = Field( default=None, alias="multipleBirthBoolean", title="Whether patient is part of a multiple birth", description=( "Indicates whether the patient is part of a multiple (bool) or " "indicates the actual birth order (integer)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e multipleBirth[x] "one_of_many": "multipleBirth", "one_of_many_required": False, }, ) multipleBirthBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_multipleBirthBoolean", title="Extension field for ``multipleBirthBoolean``.", ) multipleBirthInteger: fhirtypes.IntegerType | None = Field( default=None, alias="multipleBirthInteger", title="Whether patient is part of a multiple birth", description=( "Indicates whether the patient is part of a multiple (bool) or " "indicates the actual birth order (integer)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e multipleBirth[x] "one_of_many": "multipleBirth", "one_of_many_required": False, }, ) multipleBirthInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_multipleBirthInteger", title="Extension field for ``multipleBirthInteger``.", ) name: typing.List[fhirtypes.HumanNameType] | None = Field( default=None, alias="name", title="A name associated with the patient", description="A name associated with the individual.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) photo: typing.List[fhirtypes.AttachmentType] | None = Field( default=None, alias="photo", title="Image of the patient", description=None, json_schema_extra={ "element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="A contact detail for the individual", description=( "A contact detail (e.g. a telephone number or an email address) by " "which the individual may be contacted." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Patient`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "name", "telecom", "gender", "birthDate", "deceasedBoolean", "deceasedDateTime", "address", "maritalStatus", "multipleBirthBoolean", "multipleBirthInteger", "photo", "contact", "animal", "communication", "generalPractitioner", "managingOrganization", "link", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Patient`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "active", "name", "telecom", "gender", "birthDate", "deceasedBoolean", "deceasedDateTime", "address", "animal", "managingOrganization", "link", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "deceased": ["deceasedBoolean", "deceasedDateTime"], "multipleBirth": ["multipleBirthBoolean", "multipleBirthInteger"], } return one_of_many_fields class PatientAnimal(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. This patient is known to be an animal (non-human). This patient is known to be an animal. """ __resource_type__ = "PatientAnimal" breed: fhirtypes.CodeableConceptType | None = Field( default=None, alias="breed", title="E.g. Poodle, Angus", description="Identifies the detailed categorization of the kind of animal.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) genderStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="genderStatus", title="E.g. Neutered, Intact", description="Indicates the current state of the animal's reproductive organs.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) species: fhirtypes.CodeableConceptType = Field( default=..., alias="species", title="E.g. Dog, Cow", description=( "Identifies the high level taxonomic categorization of the kind of " "animal." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PatientAnimal`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "species", "breed", "genderStatus", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PatientAnimal`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "species", "breed", "genderStatus"] class PatientCommunication(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A list of Languages which may be used to communicate with the patient about his or her health. Languages which may be used to communicate with the patient about his or her health. """ __resource_type__ = "PatientCommunication" language: fhirtypes.CodeableConceptType = Field( default=..., alias="language", title=( "The language which can be used to communicate with the patient about " "his or her health" ), description=( "The ISO-639-1 alpha 2 code in lower case for the language, optionally " "followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in" ' upper case; e.g. "en" for English, or "en-US" for American English ' 'versus "en-EN" for England English.' ), json_schema_extra={ "element_property": True, }, ) preferred: bool | None = Field( default=None, alias="preferred", title="Language preference indicator", description=( "Indicates whether or not the patient prefers this language (over other" " languages he masters up a certain level)." ), json_schema_extra={ "element_property": True, }, ) preferred__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preferred", title="Extension field for ``preferred``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PatientCommunication`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "language", "preferred"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PatientCommunication`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class PatientContact(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A contact party (e.g. guardian, partner, friend) for the patient. """ __resource_type__ = "PatientContact" address: fhirtypes.AddressType | None = Field( default=None, alias="address", title="Address for the contact person", description=None, json_schema_extra={ "element_property": True, }, ) gender: fhirtypes.CodeType | None = Field( default=None, alias="gender", title="male | female | other | unknown", description=( "Administrative Gender - the gender that the contact person is " "considered to have for administration and record keeping purposes." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["male", "female", "other", "unknown"], }, ) gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_gender", title="Extension field for ``gender``." ) name: fhirtypes.HumanNameType | None = Field( default=None, alias="name", title="A name associated with the contact person", description=None, json_schema_extra={ "element_property": True, }, ) organization: fhirtypes.ReferenceType | None = Field( default=None, alias="organization", title="Organization that is associated with the contact", description=( "Organization on behalf of which the contact is acting or for which the" " contact is working." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title=( "The period during which this contact person or organization is valid " "to be contacted relating to this patient" ), description=None, json_schema_extra={ "element_property": True, }, ) relationship: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="relationship", title="The kind of relationship", description=( "The nature of the relationship between the patient and the contact " "person." ), json_schema_extra={ "element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="A contact detail for the person", description=( "A contact detail for the person, e.g. a telephone number or an email " "address." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PatientContact`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "relationship", "name", "telecom", "address", "gender", "organization", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PatientContact`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class PatientLink(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Link to another patient resource that concerns the same actual person. Link to another patient resource that concerns the same actual patient. """ __resource_type__ = "PatientLink" other: fhirtypes.ReferenceType = Field( default=..., alias="other", title="The other patient or related person resource that the link refers to", description="The other patient resource that the link refers to.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "RelatedPerson"], }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="replaced-by | replaces | refer | seealso - type of link", description=( "The type of link between this patient resource and another patient " "resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["replaced-by", "replaces", "refer", "seealso"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PatientLink`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "other", "type"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PatientLink`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "other", "type"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/paymentnotice.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/PaymentNotice Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class PaymentNotice(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. PaymentNotice request. This resource provides the status of the payment for goods and services rendered, and the request and response resource references. """ __resource_type__ = "PaymentNotice" created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Creation date", description="The date when this resource was created.", json_schema_extra={ "element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier", description="The notice business identifier.", json_schema_extra={ "element_property": True, }, ) organization: fhirtypes.ReferenceType | None = Field( default=None, alias="organization", title="Responsible organization", description=( "The organization which is responsible for the services rendered to the" " patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) paymentStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="paymentStatus", title="Whether payment has been sent or cleared", description=( "The payment status, typically paid: payment sent, cleared: payment " "received." ), json_schema_extra={ "element_property": True, }, ) provider: fhirtypes.ReferenceType | None = Field( default=None, alias="provider", title="Responsible practitioner", description=( "The practitioner who is responsible for the services rendered to the " "patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) request: fhirtypes.ReferenceType | None = Field( default=None, alias="request", title="Request reference", description="Reference of resource for which payment is being made.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) response: fhirtypes.ReferenceType | None = Field( default=None, alias="response", title="Response reference", description="Reference of response to resource for which payment is being made.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusDate: fhirtypes.DateType | None = Field( default=None, alias="statusDate", title="Payment or clearing date", description="The date when the above payment action occurrred.", json_schema_extra={ "element_property": True, }, ) statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_statusDate", title="Extension field for ``statusDate``." ) target: fhirtypes.ReferenceType | None = Field( default=None, alias="target", title="Insurer or Regulatory body", description="The Insurer who is target of the request.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PaymentNotice`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "request", "response", "statusDate", "created", "target", "provider", "organization", "paymentStatus", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PaymentNotice`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "status"] ================================================ FILE: fhir/resources/STU3/paymentreconciliation.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/PaymentReconciliation Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class PaymentReconciliation(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. PaymentReconciliation resource. This resource provides payment details and claim references supporting a bulk payment. """ __resource_type__ = "PaymentReconciliation" created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Creation date", description=( "The date when the enclosed suite of services were performed or " "completed." ), json_schema_extra={ "element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) detail: typing.List[fhirtypes.PaymentReconciliationDetailType] | None = Field( default=None, alias="detail", title="List of settlements", description=( "List of individual settlement amounts and the corresponding " "transaction." ), json_schema_extra={ "element_property": True, }, ) disposition: fhirtypes.StringType | None = Field( default=None, alias="disposition", title="Disposition Message", description="A description of the status of the adjudication.", json_schema_extra={ "element_property": True, }, ) disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_disposition", title="Extension field for ``disposition``." ) form: fhirtypes.CodeableConceptType | None = Field( default=None, alias="form", title="Printed Form Identifier", description="The form to be used for printing the content.", json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier", description="The Response business identifier.", json_schema_extra={ "element_property": True, }, ) organization: fhirtypes.ReferenceType | None = Field( default=None, alias="organization", title="Insurer", description="The Insurer who produced this adjudicated response.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) outcome: fhirtypes.CodeableConceptType | None = Field( default=None, alias="outcome", title="complete | error | partial", description="Transaction status: error, complete.", json_schema_extra={ "element_property": True, }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Period covered", description=( "The period of time for which payments have been gathered into this " "bulk payment for settlement." ), json_schema_extra={ "element_property": True, }, ) processNote: typing.List[ fhirtypes.PaymentReconciliationProcessNoteType ] | None = Field( default=None, alias="processNote", title="Processing comments", description="Suite of notes.", json_schema_extra={ "element_property": True, }, ) request: fhirtypes.ReferenceType | None = Field( default=None, alias="request", title="Claim reference", description="Original request resource reference.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ProcessRequest"], }, ) requestOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="requestOrganization", title="Responsible organization", description=( "The organization which is responsible for the services rendered to the" " patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) requestProvider: fhirtypes.ReferenceType | None = Field( default=None, alias="requestProvider", title="Responsible practitioner", description=( "The practitioner who is responsible for the services rendered to the " "patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) total: fhirtypes.MoneyType | None = Field( default=None, alias="total", title="Total amount of Payment", description="Total payment amount.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PaymentReconciliation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "period", "created", "organization", "request", "outcome", "disposition", "requestProvider", "requestOrganization", "detail", "form", "total", "processNote", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PaymentReconciliation`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "status"] class PaymentReconciliationDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. List of settlements. List of individual settlement amounts and the corresponding transaction. """ __resource_type__ = "PaymentReconciliationDetail" amount: fhirtypes.MoneyType | None = Field( default=None, alias="amount", title="Amount being paid", description="Amount paid for this detail.", json_schema_extra={ "element_property": True, }, ) date: fhirtypes.DateType | None = Field( default=None, alias="date", title="Invoice date", description="The date of the invoice or financial resource.", json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) payee: fhirtypes.ReferenceType | None = Field( default=None, alias="payee", title="Organization which is receiving the payment", description="The organization which is receiving the payment.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) request: fhirtypes.ReferenceType | None = Field( default=None, alias="request", title="Claim", description="The claim or financial resource.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) response: fhirtypes.ReferenceType | None = Field( default=None, alias="response", title="Claim Response", description="The claim response resource.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) submitter: fhirtypes.ReferenceType | None = Field( default=None, alias="submitter", title="Organization which submitted the claim", description="The Organization which submitted the claim or financial transaction.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Type code", description=( "Code to indicate the nature of the payment, adjustment, funds advance," " etc." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PaymentReconciliationDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "request", "response", "submitter", "payee", "date", "amount", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PaymentReconciliationDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class PaymentReconciliationProcessNote(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Processing comments. Suite of notes. """ __resource_type__ = "PaymentReconciliationProcessNote" text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Comment on the processing", description="The note text.", json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="display | print | printoper", description="The note purpose: Print/Display.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PaymentReconciliationProcessNote`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "text"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PaymentReconciliationProcessNote`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/period.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Period Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Period(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Time range defined by start and end date/time. A time period defined by a start and end date and optionally time. """ __resource_type__ = "Period" end: fhirtypes.DateTimeType | None = Field( default=None, alias="end", title="End time with inclusive boundary, if not ongoing", description=( "The end of the period. If the end of the period is missing, it means " "that the period is ongoing. The start may be in the past, and the end " "date in the future, which means that period is expected/planned to end" " at that time." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_end", title="Extension field for ``end``." ) start: fhirtypes.DateTimeType | None = Field( default=None, alias="start", title="Starting time with inclusive boundary", description="The start of the period. The boundary is inclusive.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_start", title="Extension field for ``start``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Period`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "start", "end"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Period`` according to specification, with preserving the original sequence order. """ return ["start", "end"] ================================================ FILE: fhir/resources/STU3/person.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Person Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Person(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A generic person record. Demographics and administrative information about a person independent of a specific health-related context. """ __resource_type__ = "Person" active: bool | None = Field( default=None, alias="active", title="This person's record is in active use", description="Whether this person's record is in active use.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) address: typing.List[fhirtypes.AddressType] | None = Field( default=None, alias="address", title="One or more addresses for the person", description=None, json_schema_extra={ "element_property": True, }, ) birthDate: fhirtypes.DateType | None = Field( default=None, alias="birthDate", title="The date on which the person was born", description="The birth date for the person.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) birthDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_birthDate", title="Extension field for ``birthDate``." ) gender: fhirtypes.CodeType | None = Field( default=None, alias="gender", title="male | female | other | unknown", description="Administrative Gender.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["male", "female", "other", "unknown"], }, ) gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_gender", title="Extension field for ``gender``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="A human identifier for this person", description="Identifier for a person within a particular scope.", json_schema_extra={ "element_property": True, }, ) link: typing.List[fhirtypes.PersonLinkType] | None = Field( default=None, alias="link", title="Link to a resource that concerns the same actual person", description=None, json_schema_extra={ "element_property": True, }, ) managingOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="managingOrganization", title="The organization that is the custodian of the person record", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) name: typing.List[fhirtypes.HumanNameType] | None = Field( default=None, alias="name", title="A name associated with the person", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) photo: fhirtypes.AttachmentType | None = Field( default=None, alias="photo", title="Image of the person", description=( "An image that can be displayed as a thumbnail of the person to enhance" " the identification of the individual." ), json_schema_extra={ "element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="A contact detail for the person", description=( "A contact detail for the person, e.g. a telephone number or an email " "address." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Person`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "name", "telecom", "gender", "birthDate", "address", "photo", "managingOrganization", "active", "link", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Person`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "name", "telecom", "gender", "birthDate", "managingOrganization", "active", ] class PersonLink(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Link to a resource that concerns the same actual person. """ __resource_type__ = "PersonLink" assurance: fhirtypes.CodeType | None = Field( default=None, alias="assurance", title="level1 | level2 | level3 | level4", description=( "Level of assurance that this link is actually associated with the " "target resource." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["level1", "level2", "level3", "level4"], }, ) assurance__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_assurance", title="Extension field for ``assurance``." ) target: fhirtypes.ReferenceType = Field( default=..., alias="target", title="The resource to which this actual person is associated", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "RelatedPerson", "Person", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PersonLink`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "target", "assurance"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PersonLink`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/plandefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/PlanDefinition Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class PlanDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The definition of a plan for a series of actions, independent of any specific patient or context. This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols. """ __resource_type__ = "PlanDefinition" action: typing.List[fhirtypes.PlanDefinitionActionType] | None = Field( default=None, alias="action", title="Action defined by the plan", description="An action to be taken as part of the plan.", json_schema_extra={ "element_property": True, }, ) approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the plan definition was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contributor: typing.List[fhirtypes.ContributorType] | None = Field( default=None, alias="contributor", title="A content contributor", description=( "A contributor to the content of the asset, including authors, editors," " reviewers, and endorsers." ), json_schema_extra={ "element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the plan definition and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the plan definition." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date this was last changed", description=( "The date (and optionally time) when the plan definition was " "published. The date must change if and when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the plan definition " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the plan definition", description=( "A free text natural language description of the plan definition from a" " consumer's perspective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the plan definition is expected to be used", description=( "The period during which the plan definition content was or is planned " "to be in active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A boolean value to indicate that this plan definition is authored for " "testing purposes (or education/evaluation/marketing), and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) goal: typing.List[fhirtypes.PlanDefinitionGoalType] | None = Field( default=None, alias="goal", title="What the plan is trying to accomplish", description=( "Goals that describe what the activities within the plan are intended " "to achieve. For example, weight loss, restoring an activity of daily " "living, obtaining herd immunity via immunization, meeting a process " "improvement objective, etc." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the plan definition", description=( "A formal identifier that is used to identify this plan definition when" " it is represented in other formats, or referenced in a specification," " model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for plan definition (if applicable)", description=( "A legal or geographic region in which the plan definition is intended " "to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the plan definition was last reviewed", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval, but doesn't change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) library: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="library", title="Logic used by the plan definition", description=( "A reference to a Library resource containing any formal logic used by " "the plan definition." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Library"], }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this plan definition (computer friendly)", description=( "A natural language name identifying the plan definition. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the individual or organization that published the plan " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this plan definition is defined", description=( "Explaination of why this plan definition is needed and why it has been" " designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Related artifacts for the asset", description=( "Related artifacts such as additional documentation, justification, or " "bibliographic references." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this plan definition. Enables tracking the life-cycle of" " the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this plan definition (human friendly)", description="A short, descriptive, user-friendly title for the plan definition.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) topic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="topic", title="E.g. Education, Treatment, Assessment, etc", description=( "Descriptive topics related to the content of the plan definition. " "Topics provide a high-level categorization of the definition that can " "be useful for filtering and searching." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="order-set | protocol | eca-rule", description=( "The type of asset the plan definition represents, e.g. an order set, " "protocol, or event-condition-action rule." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Logical URI to reference this plan definition (globally unique)", description=( "An absolute URI that is used to identify this plan definition when it " "is referenced in a specification, model, design or an instance. This " "SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at" " which this plan definition is (or will be) published. The URL SHOULD " "include the major version of the plan definition. For more information" " see [Technical and Business Versions](resource.html#versions)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) usage: fhirtypes.StringType | None = Field( default=None, alias="usage", title="Describes the clinical usage of the asset", description=( "A detailed description of how the asset is used from a clinical " "perspective." ), json_schema_extra={ "element_property": True, }, ) usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usage", title="Extension field for ``usage``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Context the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching for appropriate plan definition instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the plan definition", description=( "The identifier that is used to identify this version of the plan " "definition when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the plan definition " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence. To provide a version consistent with the " "Decision Support Service specification, use the format " "Major.Minor.Revision (e.g. 1.0.0). For more information on versioning " "knowledge assets, refer to the Decision Support Service specification." " Note that a version is required for non-experimental active " "artifacts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "type", "status", "experimental", "date", "publisher", "description", "purpose", "usage", "approvalDate", "lastReviewDate", "effectivePeriod", "useContext", "jurisdiction", "topic", "contributor", "contact", "copyright", "relatedArtifact", "library", "goal", "action", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "type", "status", "experimental", "date", "publisher", "description", "effectivePeriod", "useContext", "jurisdiction", "contact", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class PlanDefinitionAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Action defined by the plan. An action to be taken as part of the plan. """ __resource_type__ = "PlanDefinitionAction" action: typing.List[fhirtypes.PlanDefinitionActionType] | None = Field( default=None, alias="action", title="A sub-action", description=( "Sub actions that are contained within the action. The behavior of this" " action determines the functionality of the sub-actions. For example, " "a selection behavior of at-most-one indicates that of the sub-actions," " at most one may be chosen as part of realizing the action definition." ), json_schema_extra={ "element_property": True, }, ) cardinalityBehavior: fhirtypes.CodeType | None = Field( default=None, alias="cardinalityBehavior", title="single | multiple", description="Defines whether the action can be selected multiple times.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["single", "multiple"], }, ) cardinalityBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_cardinalityBehavior", title="Extension field for ``cardinalityBehavior``.", ) code: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="code", title="Code representing the meaning of the action or sub-actions", description=( "A code that provides meaning for the action or action group. For " "example, a section may have a LOINC code for a the section of a " "documentation template." ), json_schema_extra={ "element_property": True, }, ) condition: typing.List[fhirtypes.PlanDefinitionActionConditionType] | None = Field( default=None, alias="condition", title="Whether or not the action is applicable", description=( "An expression that describes applicability criteria, or start/stop " "conditions for the action." ), json_schema_extra={ "element_property": True, }, ) definition: fhirtypes.ReferenceType | None = Field( default=None, alias="definition", title="Description of the activity to be performed", description=( "A reference to an ActivityDefinition that describes the action to be " "taken in detail, or a PlanDefinition that describes a series of " "actions to be taken." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ActivityDefinition", "PlanDefinition"], }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Short description of the action", description=( "A short description of the action used to provide a summary to display" " to the user." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) documentation: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="documentation", title="Supporting documentation for the intended performer of the action", description=( "Didactic or other informational resources associated with the action " "that can be provided to the CDS recipient. Information resources can " "include inline text commentary and links to web resources." ), json_schema_extra={ "element_property": True, }, ) dynamicValue: typing.List[ fhirtypes.PlanDefinitionActionDynamicValueType ] | None = Field( default=None, alias="dynamicValue", title="Dynamic aspects of the definition", description=( "Customizations that should be applied to the statically defined " "resource. For example, if the dosage of a medication must be computed " "based on the patient's weight, a customization would be used to " "specify an expression that calculated the weight, and the path on the " "resource that would contain the result." ), json_schema_extra={ "element_property": True, }, ) goalId: typing.List[fhirtypes.IdType | None] | None = Field( default=None, alias="goalId", title="What goals this action supports", description=( "Identifies goals that this action supports. The reference must be to a" " goal element defined within this plan definition." ), json_schema_extra={ "element_property": True, }, ) goalId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_goalId", title="Extension field for ``goalId``." ) groupingBehavior: fhirtypes.CodeType | None = Field( default=None, alias="groupingBehavior", title="visual-group | logical-group | sentence-group", description="Defines the grouping behavior for the action and its children.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["visual-group", "logical-group", "sentence-group"], }, ) groupingBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_groupingBehavior", title="Extension field for ``groupingBehavior``.", ) input: typing.List[fhirtypes.DataRequirementType] | None = Field( default=None, alias="input", title="Input data requirements", description="Defines input data requirements for the action.", json_schema_extra={ "element_property": True, }, ) label: fhirtypes.StringType | None = Field( default=None, alias="label", title="User-visible label for the action (e.g. 1. or A.)", description="A user-visible label for the action.", json_schema_extra={ "element_property": True, }, ) label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_label", title="Extension field for ``label``." ) output: typing.List[fhirtypes.DataRequirementType] | None = Field( default=None, alias="output", title="Output data definition", description="Defines the outputs of the action, if any.", json_schema_extra={ "element_property": True, }, ) participant: typing.List[ fhirtypes.PlanDefinitionActionParticipantType ] | None = Field( default=None, alias="participant", title="Who should participate in the action", description="Indicates who should participate in performing the action described.", json_schema_extra={ "element_property": True, }, ) precheckBehavior: fhirtypes.CodeType | None = Field( default=None, alias="precheckBehavior", title="yes | no", description="Defines whether the action should usually be preselected.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["yes", "no"], }, ) precheckBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_precheckBehavior", title="Extension field for ``precheckBehavior``.", ) reason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reason", title="Why the action should be performed", description="A description of why this action is necessary or appropriate.", json_schema_extra={ "element_property": True, }, ) relatedAction: typing.List[ fhirtypes.PlanDefinitionActionRelatedActionType ] | None = Field( default=None, alias="relatedAction", title="Relationship to another action", description=( 'A relationship to another action such as "before" or "30-60 minutes ' 'after start of".' ), json_schema_extra={ "element_property": True, }, ) requiredBehavior: fhirtypes.CodeType | None = Field( default=None, alias="requiredBehavior", title="must | could | must-unless-documented", description="Defines the requiredness behavior for the action.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["must", "could", "must-unless-documented"], }, ) requiredBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requiredBehavior", title="Extension field for ``requiredBehavior``.", ) selectionBehavior: fhirtypes.CodeType | None = Field( default=None, alias="selectionBehavior", title="any | all | all-or-none | exactly-one | at-most-one | one-or-more", description="Defines the selection behavior for the action and its children.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "any", "all", "all-or-none", "exactly-one", "at-most-one", "one-or-more", ], }, ) selectionBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_selectionBehavior", title="Extension field for ``selectionBehavior``.", ) textEquivalent: fhirtypes.StringType | None = Field( default=None, alias="textEquivalent", title=( "Static text equivalent of the action, used if the dynamic aspects " "cannot be interpreted by the receiving system" ), description=( "A text equivalent of the action to be performed. This provides a " "human-interpretable description of the action when the definition is " "consumed by a system that may not be capable of interpreting it " "dynamically." ), json_schema_extra={ "element_property": True, }, ) textEquivalent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_textEquivalent", title="Extension field for ``textEquivalent``.", ) timingDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="timingDateTime", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timingDateTime", title="Extension field for ``timingDateTime``.", ) timingDuration: fhirtypes.DurationType | None = Field( default=None, alias="timingDuration", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="timingPeriod", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingRange: fhirtypes.RangeType | None = Field( default=None, alias="timingRange", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingTiming: fhirtypes.TimingType | None = Field( default=None, alias="timingTiming", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="User-visible title", description="The title of the action displayed to a user.", json_schema_extra={ "element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) transform: fhirtypes.ReferenceType | None = Field( default=None, alias="transform", title="Transform to apply the template", description=( "A reference to a StructureMap resource that defines a transform that " "can be executed to produce the intent resource using the " "ActivityDefinition instance as the input." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureMap"], }, ) triggerDefinition: typing.List[fhirtypes.TriggerDefinitionType] | None = Field( default=None, alias="triggerDefinition", title="When the action should be triggered", description="A description of when the action should be triggered.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodingType | None = Field( default=None, alias="type", title="create | update | remove | fire-event", description="The type of action to perform (create, update, remove).", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionAction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "label", "title", "description", "textEquivalent", "code", "reason", "documentation", "goalId", "triggerDefinition", "condition", "input", "output", "relatedAction", "timingDateTime", "timingPeriod", "timingDuration", "timingRange", "timingTiming", "participant", "type", "groupingBehavior", "selectionBehavior", "requiredBehavior", "precheckBehavior", "cardinalityBehavior", "definition", "transform", "dynamicValue", "action", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "timing": [ "timingDateTime", "timingDuration", "timingPeriod", "timingRange", "timingTiming", ] } return one_of_many_fields class PlanDefinitionActionCondition(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Whether or not the action is applicable. An expression that describes applicability criteria, or start/stop conditions for the action. """ __resource_type__ = "PlanDefinitionActionCondition" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Natural language description of the condition", description=( "A brief, natural language description of the condition that " "effectively communicates the intended semantics." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="Boolean-valued expression", description=( "An expression that returns true or false, indicating whether or not " "the condition is satisfied." ), json_schema_extra={ "element_property": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title="applicability | start | stop", description="The kind of condition.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["applicability", "start", "stop"], }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) language: fhirtypes.StringType | None = Field( default=None, alias="language", title="Language of the expression", description="The media type of the language for the expression.", json_schema_extra={ "element_property": True, }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionActionCondition`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "kind", "description", "language", "expression", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionCondition`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("kind", "kind__ext")] return required_fields class PlanDefinitionActionDynamicValue(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Dynamic aspects of the definition. Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result. """ __resource_type__ = "PlanDefinitionActionDynamicValue" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Natural language description of the dynamic value", description=( "A brief, natural language description of the intended semantics of the" " dynamic value." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="An expression that provides the dynamic value for the customization", description="An expression specifying the value of the customized element.", json_schema_extra={ "element_property": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) language: fhirtypes.StringType | None = Field( default=None, alias="language", title="Language of the expression", description="The media type of the language for the expression.", json_schema_extra={ "element_property": True, }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="The path to the element to be set dynamically", description=( "The path to the element to be customized. This is the path on the " "resource that will hold the result of the calculation defined by the " "expression." ), json_schema_extra={ "element_property": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionActionDynamicValue`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "path", "language", "expression", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionDynamicValue`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class PlanDefinitionActionParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who should participate in the action. Indicates who should participate in performing the action described. """ __resource_type__ = "PlanDefinitionActionParticipant" role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="E.g. Nurse, Surgeon, Parent, etc", description=( "The role the participant should play in performing the described " "action." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="patient | practitioner | related-person", description="The type of participant in the action.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["patient", "practitioner", "related-person"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionActionParticipant`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "role"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields class PlanDefinitionActionRelatedAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Relationship to another action. A relationship to another action such as "before" or "30-60 minutes after start of". """ __resource_type__ = "PlanDefinitionActionRelatedAction" actionId: fhirtypes.IdType | None = Field( default=None, alias="actionId", title="What action is this related to", description="The element id of the related action.", json_schema_extra={ "element_property": True, "element_required": True, }, ) actionId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_actionId", title="Extension field for ``actionId``." ) offsetDuration: fhirtypes.DurationType | None = Field( default=None, alias="offsetDuration", title="Time offset for the relationship", description=( "A duration or range of durations to apply to the relationship. For " "example, 30-60 minutes before." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e offset[x] "one_of_many": "offset", "one_of_many_required": False, }, ) offsetRange: fhirtypes.RangeType | None = Field( default=None, alias="offsetRange", title="Time offset for the relationship", description=( "A duration or range of durations to apply to the relationship. For " "example, 30-60 minutes before." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e offset[x] "one_of_many": "offset", "one_of_many_required": False, }, ) relationship: fhirtypes.CodeType | None = Field( default=None, alias="relationship", title=( "before-start | before | before-end | concurrent-with-start | " "concurrent | concurrent-with-end | after-start | after | after-end" ), description="The relationship of this action to the related action.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "before-start", "before", "before-end", "concurrent-with-start", "concurrent", "concurrent-with-end", "after-start", "after", "after-end", ], }, ) relationship__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_relationship", title="Extension field for ``relationship``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionActionRelatedAction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "actionId", "relationship", "offsetDuration", "offsetRange", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionRelatedAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("actionId", "actionId__ext"), ("relationship", "relationship__ext"), ] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"offset": ["offsetDuration", "offsetRange"]} return one_of_many_fields class PlanDefinitionGoal(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What the plan is trying to accomplish. Goals that describe what the activities within the plan are intended to achieve. For example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc. """ __resource_type__ = "PlanDefinitionGoal" addresses: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="addresses", title="What does the goal address", description=( "Identifies problems, conditions, issues, or concerns the goal is " "intended to address." ), json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="E.g. Treatment, dietary, behavioral, etc", description="Indicates a category the goal falls within.", json_schema_extra={ "element_property": True, }, ) description: fhirtypes.CodeableConceptType = Field( default=..., alias="description", title="Code or text describing the goal", description=( "Human-readable and/or coded description of a specific desired " 'objective of care, such as "control blood pressure" or "negotiate an ' 'obstacle course" or "dance with child at wedding".' ), json_schema_extra={ "element_property": True, }, ) documentation: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="documentation", title="Supporting documentation for the goal", description=( "Didactic or other informational resources associated with the goal " "that provide further supporting information about the goal. " "Information resources can include inline text commentary and links to " "web resources." ), json_schema_extra={ "element_property": True, }, ) priority: fhirtypes.CodeableConceptType | None = Field( default=None, alias="priority", title="high-priority | medium-priority | low-priority", description=( "Identifies the expected level of importance associated with " "reaching/sustaining the defined goal." ), json_schema_extra={ "element_property": True, }, ) start: fhirtypes.CodeableConceptType | None = Field( default=None, alias="start", title="When goal pursuit begins", description="The event after which the goal should begin being pursued.", json_schema_extra={ "element_property": True, }, ) target: typing.List[fhirtypes.PlanDefinitionGoalTargetType] | None = Field( default=None, alias="target", title="Target outcome for the goal", description="Indicates what should be done and within what timeframe.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionGoal`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "category", "description", "priority", "start", "addresses", "documentation", "target", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionGoal`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class PlanDefinitionGoalTarget(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Target outcome for the goal. Indicates what should be done and within what timeframe. """ __resource_type__ = "PlanDefinitionGoalTarget" detailCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="detailCodeableConcept", title="The target value to be achieved", description=( "The target value of the measure to be achieved to signify fulfillment " "of the goal, e.g. 150 pounds or 7.0%. Either the high or low or both " "values of the range can be specified. Whan a low value is missing, it " "indicates that the goal is achieved at any value at or below the high " "value. Similarly, if the high value is missing, it indicates that the " "goal is achieved at any value at or above the low value." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="detailQuantity", title="The target value to be achieved", description=( "The target value of the measure to be achieved to signify fulfillment " "of the goal, e.g. 150 pounds or 7.0%. Either the high or low or both " "values of the range can be specified. Whan a low value is missing, it " "indicates that the goal is achieved at any value at or below the high " "value. Similarly, if the high value is missing, it indicates that the " "goal is achieved at any value at or above the low value." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailRange: fhirtypes.RangeType | None = Field( default=None, alias="detailRange", title="The target value to be achieved", description=( "The target value of the measure to be achieved to signify fulfillment " "of the goal, e.g. 150 pounds or 7.0%. Either the high or low or both " "values of the range can be specified. Whan a low value is missing, it " "indicates that the goal is achieved at any value at or below the high " "value. Similarly, if the high value is missing, it indicates that the " "goal is achieved at any value at or above the low value." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) due: fhirtypes.DurationType | None = Field( default=None, alias="due", title="Reach goal within", description=( "Indicates the timeframe after the start of the goal in which the goal " "should be met." ), json_schema_extra={ "element_property": True, }, ) measure: fhirtypes.CodeableConceptType | None = Field( default=None, alias="measure", title="The parameter whose value is to be tracked", description=( "The parameter whose value is to be tracked, e.g. body weigth, blood " "pressure, or hemoglobin A1c level." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionGoalTarget`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "measure", "detailQuantity", "detailRange", "detailCodeableConcept", "due", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionGoalTarget`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "detail": ["detailCodeableConcept", "detailQuantity", "detailRange"] } return one_of_many_fields ================================================ FILE: fhir/resources/STU3/practitioner.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Practitioner Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Practitioner(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A person with a formal responsibility in the provisioning of healthcare or related services. A person who is directly or indirectly involved in the provisioning of healthcare. """ __resource_type__ = "Practitioner" active: bool | None = Field( default=None, alias="active", title="Whether this practitioner's record is in active use", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) address: typing.List[fhirtypes.AddressType] | None = Field( default=None, alias="address", title=( "Address(es) of the practitioner that are not role specific (typically " "home address)" ), description=( "Address(es) of the practitioner that are not role specific (typically " "home address). Work addresses are not typically entered in this " "property as they are usually role dependent." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) birthDate: fhirtypes.DateType | None = Field( default=None, alias="birthDate", title="The date on which the practitioner was born", description="The date of birth for the practitioner.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) birthDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_birthDate", title="Extension field for ``birthDate``." ) communication: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="communication", title="A language the practitioner is able to use in patient communication", description=None, json_schema_extra={ "element_property": True, }, ) gender: fhirtypes.CodeType | None = Field( default=None, alias="gender", title="male | female | other | unknown", description=( "Administrative Gender - the gender that the person is considered to " "have for administration and record keeping purposes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["male", "female", "other", "unknown"], }, ) gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_gender", title="Extension field for ``gender``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="A identifier for the person as this agent", description="An identifier that applies to this person in this role.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: typing.List[fhirtypes.HumanNameType] | None = Field( default=None, alias="name", title="The name(s) associated with the practitioner", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) photo: typing.List[fhirtypes.AttachmentType] | None = Field( default=None, alias="photo", title="Image of the person", description=None, json_schema_extra={ "element_property": True, }, ) qualification: typing.List[fhirtypes.PractitionerQualificationType] | None = Field( default=None, alias="qualification", title="Qualifications obtained by training and certification", description=None, json_schema_extra={ "element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="A contact detail for the practitioner (that apply to all roles)", description=( "A contact detail for the practitioner, e.g. a telephone number or an " "email address." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Practitioner`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "name", "telecom", "address", "gender", "birthDate", "photo", "qualification", "communication", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Practitioner`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "active", "name", "telecom", "address", "gender", "birthDate", ] class PractitionerQualification(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Qualifications obtained by training and certification. """ __resource_type__ = "PractitionerQualification" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Coded representation of the qualification", description=None, json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="An identifier for this qualification for the practitioner", description=( "An identifier that applies to this person's qualification in this " "role." ), json_schema_extra={ "element_property": True, }, ) issuer: fhirtypes.ReferenceType | None = Field( default=None, alias="issuer", title="Organization that regulates and issues the qualification", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Period during which the qualification is valid", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PractitionerQualification`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "code", "period", "issuer", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PractitionerQualification`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/practitionerrole.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/PractitionerRole Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class PractitionerRole(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Roles/organizations the practitioner is associated with. A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time. """ __resource_type__ = "PractitionerRole" active: bool | None = Field( default=None, alias="active", title="Whether this practitioner's record is in active use", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) availabilityExceptions: fhirtypes.StringType | None = Field( default=None, alias="availabilityExceptions", title="Description of availability exceptions", description=( "A description of site availability exceptions, e.g. public holiday " "availability. Succinctly describing all possible exceptions to normal " "site availability as details in the available Times and not available " "Times." ), json_schema_extra={ "element_property": True, }, ) availabilityExceptions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_availabilityExceptions", title="Extension field for ``availabilityExceptions``.", ) availableTime: typing.List[ fhirtypes.PractitionerRoleAvailableTimeType ] | None = Field( default=None, alias="availableTime", title="Times the Service Site is available", description="A collection of times that the Service Site is available.", json_schema_extra={ "element_property": True, }, ) code: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="code", title="Roles which this practitioner may perform", description=( "Roles which this practitioner is authorized to perform for the " "organization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title=( "Technical endpoints providing access to services operated for the " "practitioner with this role" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) healthcareService: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="healthcareService", title=( "The list of healthcare services that this worker provides for this " "role's Organization/Location(s)" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["HealthcareService"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifiers that are specific to a role/location", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) location: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="location", title="The location(s) at which this practitioner provides care", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) notAvailable: typing.List[ fhirtypes.PractitionerRoleNotAvailableType ] | None = Field( default=None, alias="notAvailable", title="Not available during this time due to provided reason", description=( "The HealthcareService is not available during this period of time due " "to the provided reason." ), json_schema_extra={ "element_property": True, }, ) organization: fhirtypes.ReferenceType | None = Field( default=None, alias="organization", title="Organization where the roles are available", description="The organization where the Practitioner performs the roles associated.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title=( "The period during which the practitioner is authorized to perform in " "these role(s)" ), description=( "The period during which the person is authorized to act as a " "practitioner in these role(s) for the organization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) practitioner: fhirtypes.ReferenceType | None = Field( default=None, alias="practitioner", title=( "Practitioner that is able to provide the defined services for the " "organation" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialty", title="Specific specialty of the practitioner", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="Contact details that are specific to the role/location/service", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PractitionerRole`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "period", "practitioner", "organization", "code", "specialty", "location", "healthcareService", "telecom", "availableTime", "notAvailable", "availabilityExceptions", "endpoint", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PractitionerRole`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "active", "period", "practitioner", "organization", "code", "specialty", "location", "telecom", ] class PractitionerRoleAvailableTime(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Times the Service Site is available. A collection of times that the Service Site is available. """ __resource_type__ = "PractitionerRoleAvailableTime" allDay: bool | None = Field( default=None, alias="allDay", title="Always available? e.g. 24 hour service", description=( "Is this always available? (hence times are irrelevant) e.g. 24 hour " "service." ), json_schema_extra={ "element_property": True, }, ) allDay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allDay", title="Extension field for ``allDay``." ) availableEndTime: fhirtypes.TimeType | None = Field( default=None, alias="availableEndTime", title="Closing time of day (ignored if allDay = true)", description=( "The closing time of day. Note: If the AllDay flag is set, then this " "time is ignored." ), json_schema_extra={ "element_property": True, }, ) availableEndTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_availableEndTime", title="Extension field for ``availableEndTime``.", ) availableStartTime: fhirtypes.TimeType | None = Field( default=None, alias="availableStartTime", title="Opening time of day (ignored if allDay = true)", description=( "The opening time of day. Note: If the AllDay flag is set, then this " "time is ignored." ), json_schema_extra={ "element_property": True, }, ) availableStartTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_availableStartTime", title="Extension field for ``availableStartTime``.", ) daysOfWeek: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="daysOfWeek", title="mon | tue | wed | thu | fri | sat | sun", description=( "Indicates which days of the week are available between the start and " "end Times." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], }, ) daysOfWeek__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_daysOfWeek", title="Extension field for ``daysOfWeek``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PractitionerRoleAvailableTime`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "daysOfWeek", "allDay", "availableStartTime", "availableEndTime", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PractitionerRoleAvailableTime`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class PractitionerRoleNotAvailable(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Not available during this time due to provided reason. The HealthcareService is not available during this period of time due to the provided reason. """ __resource_type__ = "PractitionerRoleNotAvailable" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Reason presented to the user explaining why time not available", description=( "The reason that can be presented to the user as to why this time is " "not available." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) during: fhirtypes.PeriodType | None = Field( default=None, alias="during", title="Service not availablefrom this date", description=( "Service is not available (seasonally or for a public holiday) from " "this date." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PractitionerRoleNotAvailable`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "description", "during"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PractitionerRoleNotAvailable`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("description", "description__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/procedure.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Procedure Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Procedure(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An action that is being or was performed on a patient. An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy. """ __resource_type__ = "Procedure" basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="A request for this procedure", description=( "A reference to a resource that contains details of the request for " "this procedure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CarePlan", "ProcedureRequest", "ReferralRequest"], }, ) bodySite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="bodySite", title="Target body sites", description=( "Detailed and structured anatomical location information. Multiple " "locations are allowed - e.g. multiple punch biopsies of a lesion." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Classification of the procedure", description=( "A code that classifies the procedure for searching, sorting and " 'display purposes (e.g. "Surgical Procedure").' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Identification of the procedure", description=( "The specific procedure that is performed. Use text if the exact nature" ' of the procedure cannot be coded (e.g. "Laparoscopic Appendectomy").' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) complication: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="complication", title="Complication following the procedure", description=( "Any complications that occurred during the procedure, or in the " "immediate post-performance period. These are generally tracked " "separately from the notes, which will typically describe the procedure" " itself rather than any 'post procedure' issues." ), json_schema_extra={ "element_property": True, }, ) complicationDetail: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="complicationDetail", title="A condition that\u00a0is a result of the procedure", description=( "Any complications that occurred during the procedure, or in the " "immediate post-performance period." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Encounter or episode associated with the procedure", description="The encounter during which the procedure was performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) definition: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="definition", title="Instantiates protocol or definition", description=( "A protocol, guideline, orderset or other definition that was adhered " "to in whole or in part by this procedure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "PlanDefinition", "ActivityDefinition", "HealthcareService", ], }, ) focalDevice: typing.List[fhirtypes.ProcedureFocalDeviceType] | None = Field( default=None, alias="focalDevice", title="Device changed in procedure", description=( "A device that is implanted, removed or otherwise manipulated " "(calibration, battery replacement, fitting a prosthesis, attaching a " "wound-vac, etc.) as a focal portion of the Procedure." ), json_schema_extra={ "element_property": True, }, ) followUp: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="followUp", title="Instructions for follow up", description=( "If the procedure required specific follow up - e.g. removal of " "sutures. The followup may be represented as a simple note, or could " "potentially be more complex in which case the CarePlan resource can be" " used." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Identifiers for this procedure", description=( "This records identifiers associated with this procedure that are " "defined by business processes and/or used to refer to it when a direct" " URL reference to the resource itself is not appropriate (e.g. in CDA " "documents, or in written / printed documentation)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where the procedure happened", description=( "The location where the procedure actually happened. E.g. a newborn at" " home, a tracheostomy at a restaurant." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) notDone: bool | None = Field( default=None, alias="notDone", title="True if procedure was not performed as scheduled", description=( "Set this to true if the record is saying that the procedure was NOT " "performed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) notDone__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_notDone", title="Extension field for ``notDone``." ) notDoneReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="notDoneReason", title="Reason procedure was not performed", description="A code indicating why the procedure was not performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Additional information about the procedure", description="Any other notes about the procedure. E.g. the operative notes.", json_schema_extra={ "element_property": True, }, ) outcome: fhirtypes.CodeableConceptType | None = Field( default=None, alias="outcome", title="The result of procedure", description=( "The outcome of the procedure - did it resolve reasons for the " "procedure being performed?" ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced event", description=( "A larger event of which this particular procedure is a component or " "step." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Procedure", "Observation", "MedicationAdministration", ], }, ) performedDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="performedDateTime", title="Date/Period the procedure was performed", description=( "The date(time)/period over which the procedure was performed. Allows a" " period to support complex procedures that span more than one date, " "and also allows for the length of the procedure to be captured." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e performed[x] "one_of_many": "performed", "one_of_many_required": False, }, ) performedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_performedDateTime", title="Extension field for ``performedDateTime``.", ) performedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="performedPeriod", title="Date/Period the procedure was performed", description=( "The date(time)/period over which the procedure was performed. Allows a" " period to support complex procedures that span more than one date, " "and also allows for the length of the procedure to be captured." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e performed[x] "one_of_many": "performed", "one_of_many_required": False, }, ) performer: typing.List[fhirtypes.ProcedurePerformerType] | None = Field( default=None, alias="performer", title="The people who performed the procedure", description="Limited to 'real' people rather than equipment.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Coded reason procedure performed", description=( "The coded reason why the procedure was performed. This may be coded " "entity of some type, or may simply be present as text." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Condition that is the reason the procedure performed", description="The condition that is the reason why the procedure was performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "Observation"], }, ) report: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="report", title="Any report resulting from the procedure", description=( "This could be a histology result, pathology report, surgical report, " "etc.." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DiagnosticReport"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "preparation | in-progress | suspended | aborted | completed | entered-" "in-error | unknown" ), description=( "A code specifying the state of the procedure. Generally this will be " "in-progress or completed state." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "preparation", "in-progress", "suspended", "aborted", "completed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who the procedure was performed on", description="The person, animal or group on which the procedure was performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) usedCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="usedCode", title="Coded items used during the procedure", description="Identifies coded items that were used as part of the procedure.", json_schema_extra={ "element_property": True, }, ) usedReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="usedReference", title="Items used during procedure", description=( "Identifies medications, devices and any other substance used as part " "of the procedure." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device", "Medication", "Substance"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Procedure`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "definition", "basedOn", "partOf", "status", "notDone", "notDoneReason", "category", "code", "subject", "context", "performedDateTime", "performedPeriod", "performer", "location", "reasonCode", "reasonReference", "bodySite", "outcome", "report", "complication", "complicationDetail", "followUp", "note", "focalDevice", "usedReference", "usedCode", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Procedure`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "definition", "basedOn", "partOf", "status", "notDone", "notDoneReason", "category", "code", "subject", "context", "performedDateTime", "performedPeriod", "performer", "location", "reasonCode", "reasonReference", "bodySite", "outcome", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"performed": ["performedDateTime", "performedPeriod"]} return one_of_many_fields class ProcedureFocalDevice(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Device changed in procedure. A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure. """ __resource_type__ = "ProcedureFocalDevice" action: fhirtypes.CodeableConceptType | None = Field( default=None, alias="action", title="Kind of change to device", description="The kind of change that happened to the device during the procedure.", json_schema_extra={ "element_property": True, }, ) manipulated: fhirtypes.ReferenceType = Field( default=..., alias="manipulated", title="Device that was changed", description="The device that was manipulated (changed) during the procedure.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ProcedureFocalDevice`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "action", "manipulated"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ProcedureFocalDevice`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ProcedurePerformer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The people who performed the procedure. Limited to 'real' people rather than equipment. """ __resource_type__ = "ProcedurePerformer" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="The reference to the practitioner", description="The practitioner who was involved in the procedure.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Organization", "Patient", "RelatedPerson", "Device", ], }, ) onBehalfOf: fhirtypes.ReferenceType | None = Field( default=None, alias="onBehalfOf", title="Organization the device or practitioner was acting for", description="The organization the device or practitioner was acting on behalf of.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="The role the actor was in", description="For example: surgeon, anaethetist, endoscopist.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ProcedurePerformer`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "role", "actor", "onBehalfOf"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ProcedurePerformer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "role", "actor"] ================================================ FILE: fhir/resources/STU3/procedurerequest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ProcedureRequest Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ProcedureRequest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A request for a procedure or diagnostic to be performed. A record of a request for diagnostic investigations, treatments, or operations to be performed. """ __resource_type__ = "ProcedureRequest" asNeededBoolean: bool | None = Field( default=None, alias="asNeededBoolean", title="Preconditions for procedure or diagnostic", description=( "If a CodeableConcept is present, it indicates the pre-condition for " 'performing the procedure. For example "pain", "on flare-up", etc.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e asNeeded[x] "one_of_many": "asNeeded", "one_of_many_required": False, }, ) asNeededBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_asNeededBoolean", title="Extension field for ``asNeededBoolean``.", ) asNeededCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="asNeededCodeableConcept", title="Preconditions for procedure or diagnostic", description=( "If a CodeableConcept is present, it indicates the pre-condition for " 'performing the procedure. For example "pain", "on flare-up", etc.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e asNeeded[x] "one_of_many": "asNeeded", "one_of_many_required": False, }, ) authoredOn: fhirtypes.DateTimeType | None = Field( default=None, alias="authoredOn", title="Date request signed", description="When the request transitioned to being actionable.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoredOn", title="Extension field for ``authoredOn``." ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="What request fulfills", description="Plan/proposal/order fulfilled by this request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) bodySite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="bodySite", title="Location on Body", description=( "Anatomic location where the procedure should be performed. This is the" " target site." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Classification of procedure", description=( "A code that classifies the procedure for searching, sorting and " 'display purposes (e.g. "Surgical Procedure").' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="What is being requested/ordered", description=( "A code that identifies a particular procedure, diagnostic " "investigation, or panel of investigations, that have been requested." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Encounter or Episode during which request was created", description=( "An encounter or episode of care that provides additional information " "about the healthcare context in which this request is made." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) definition: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="definition", title="Protocol or definition", description="Protocol or definition followed by this request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ActivityDefinition", "PlanDefinition"], }, ) doNotPerform: bool | None = Field( default=None, alias="doNotPerform", title="True if procedure should not be performed", description=( "Set this to true if the record is saying that the procedure should NOT" " be performed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doNotPerform", title="Extension field for ``doNotPerform``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifiers assigned to this order", description=( "Identifiers assigned to this order instance by the orderer and/or the " "receiver and/or order fulfiller." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) intent: fhirtypes.CodeType | None = Field( default=None, alias="intent", title="proposal | plan | order +", description=( "Whether the request is a proposal, plan, an original order or a reflex" " order." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["proposal", "plan", "order", "+"], }, ) intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intent", title="Extension field for ``intent``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments", description=( "Any other notes and comments made about the service request. For " 'example, letting provider know that "patient hates needles" or other ' "provider instructions." ), json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When procedure should occur", description="The date/time at which the diagnostic testing should occur.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="When procedure should occur", description="The date/time at which the diagnostic testing should occur.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceTiming: fhirtypes.TimingType | None = Field( default=None, alias="occurrenceTiming", title="When procedure should occur", description="The date/time at which the diagnostic testing should occur.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) performer: fhirtypes.ReferenceType | None = Field( default=None, alias="performer", title="Requested perfomer", description=( "The desired perfomer for doing the diagnostic testing. For example, " "the surgeon, dermatopathologist, endoscopist, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Organization", "Patient", "Device", "RelatedPerson", "HealthcareService", ], }, ) performerType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="performerType", title="Performer role", description="Desired type of performer for doing the diagnostic testing.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Indicates how quickly the ProcedureRequest should be addressed with " "respect to other requests." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Explanation/Justification for test", description=( "An explanation or justification for why this diagnostic investigation " "is being requested in coded or textual form. This is often for " "billing purposes. May relate to the resources referred to in " "supportingInformation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Explanation/Justification for test", description=( "Indicates another resource that provides a justification for why this " "diagnostic investigation is being requested. May relate to the " "resources referred to in supportingInformation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "Observation"], }, ) relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="relevantHistory", title="Request provenance", description="Key events in the history of the request.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Provenance"], }, ) replaces: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="replaces", title="What request replaces", description=( "The request takes the place of the referenced completed or terminated " "request(s)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) requester: fhirtypes.ProcedureRequestRequesterType | None = Field( default=None, alias="requester", title="Who/what is requesting procedure or diagnostic", description=( "The individual who initiated the request and has responsibility for " "its activation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) requisition: fhirtypes.IdentifierType | None = Field( default=None, alias="requisition", title="Composite Request ID", description=( "A shared identifier common to all procedure or diagnostic requests " "that were authorized more or less simultaneously by a single author, " "representing the composite or group identifier." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) specimen: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="specimen", title="Procedure Samples", description="One or more specimens that the laboratory procedure will use.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Specimen"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | suspended | completed | entered-in-error | cancelled", description="The status of the order.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "draft", "active", "suspended", "completed", "entered-in-error", "cancelled", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Individual the service is ordered for", description=( "On whom or what the procedure or diagnostic is to be performed. This " "is usually a human patient, but can also be requested on animals, " "groups of humans or animals, devices such as dialysis machines, or " "even locations (typically for environmental scans)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group", "Location", "Device"], }, ) supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInfo", title="Additional clinical information", description=( "Additional clinical information about the patient or specimen that may" " influence the procedure or diagnostics or their interpretations. " "This information includes diagnosis, clinical findings and other " "observations. In laboratory ordering these are typically referred to " 'as "ask at order entry questions (AOEs)". This includes observations ' "explicitly requested by the producer (filler) to provide context or " "supporting information needed to complete the order. For example, " "reporting the amount of inspired oxygen for blood gas measurements." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ProcedureRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "definition", "basedOn", "replaces", "requisition", "status", "intent", "priority", "doNotPerform", "category", "code", "subject", "context", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "asNeededBoolean", "asNeededCodeableConcept", "authoredOn", "requester", "performerType", "performer", "reasonCode", "reasonReference", "supportingInfo", "specimen", "bodySite", "note", "relevantHistory", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ProcedureRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "definition", "basedOn", "replaces", "requisition", "status", "intent", "priority", "doNotPerform", "category", "code", "subject", "context", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "asNeededBoolean", "asNeededCodeableConcept", "authoredOn", "requester", "performerType", "performer", "reasonCode", "reasonReference", "specimen", "bodySite", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("intent", "intent__ext"), ("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "asNeeded": ["asNeededBoolean", "asNeededCodeableConcept"], "occurrence": [ "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", ], } return one_of_many_fields class ProcedureRequestRequester(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who/what is requesting procedure or diagnostic. The individual who initiated the request and has responsibility for its activation. """ __resource_type__ = "ProcedureRequestRequester" agent: fhirtypes.ReferenceType = Field( default=..., alias="agent", title="Individual making the request", description="The device, practitioner or organization who initiated the request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device", "Practitioner", "Organization"], }, ) onBehalfOf: fhirtypes.ReferenceType | None = Field( default=None, alias="onBehalfOf", title="Organization agent is acting for", description="The organization the device or practitioner was acting on behalf of.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ProcedureRequestRequester`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "agent", "onBehalfOf"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ProcedureRequestRequester`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "agent", "onBehalfOf"] ================================================ FILE: fhir/resources/STU3/processrequest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ProcessRequest Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ProcessRequest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Request to perform some action on or in regards to an existing resource. This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources. """ __resource_type__ = "ProcessRequest" action: fhirtypes.CodeType | None = Field( default=None, alias="action", title="cancel | poll | reprocess | status", description=( "The type of processing action being requested, for example Reversal, " "Readjudication, StatusRequest,PendedRequest." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["cancel", "poll", "reprocess", "status"], }, ) action__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_action", title="Extension field for ``action``." ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Creation date", description="The date when this resource was created.", json_schema_extra={ "element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) exclude: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="exclude", title="Resource type(s) to exclude", description="Names of resource types to exclude.", json_schema_extra={ "element_property": True, }, ) exclude__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_exclude", title="Extension field for ``exclude``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier", description="The ProcessRequest business identifier.", json_schema_extra={ "element_property": True, }, ) include: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="include", title="Resource type(s) to include", description="Names of resource types to include.", json_schema_extra={ "element_property": True, }, ) include__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_include", title="Extension field for ``include``." ) item: typing.List[fhirtypes.ProcessRequestItemType] | None = Field( default=None, alias="item", title="Items to re-adjudicate", description=( "List of top level items to be re-adjudicated, if none specified then " "the entire submission is re-adjudicated." ), json_schema_extra={ "element_property": True, }, ) nullify: bool | None = Field( default=None, alias="nullify", title="Remove history", description="If true remove all history excluding audit.", json_schema_extra={ "element_property": True, }, ) nullify__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_nullify", title="Extension field for ``nullify``." ) organization: fhirtypes.ReferenceType | None = Field( default=None, alias="organization", title="Responsible organization", description=( "The organization which is responsible for the action speccified in " "this request." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Selection period", description=( "A period of time during which the fulfilling resources would have been" " created." ), json_schema_extra={ "element_property": True, }, ) provider: fhirtypes.ReferenceType | None = Field( default=None, alias="provider", title="Responsible practitioner", description=( "The practitioner who is responsible for the action specified in this " "request." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) reference: fhirtypes.StringType | None = Field( default=None, alias="reference", title="Reference number/string", description="A reference to supply which authenticates the process.", json_schema_extra={ "element_property": True, }, ) reference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reference", title="Extension field for ``reference``." ) request: fhirtypes.ReferenceType | None = Field( default=None, alias="request", title="Reference to the Request resource", description="Reference of resource which is the target or subject of this action.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) response: fhirtypes.ReferenceType | None = Field( default=None, alias="response", title="Reference to the Response resource", description=( "Reference of a prior response to resource which is the target or " "subject of this action." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) target: fhirtypes.ReferenceType | None = Field( default=None, alias="target", title="Party which is the target of the request", description="The organization which is the target of the request.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ProcessRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "action", "target", "created", "provider", "organization", "request", "response", "nullify", "reference", "item", "include", "exclude", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ProcessRequest`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "status"] class ProcessRequestItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Items to re-adjudicate. List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated. """ __resource_type__ = "ProcessRequestItem" sequenceLinkId: fhirtypes.IntegerType | None = Field( default=None, alias="sequenceLinkId", title="Service instance", description="A service line number.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequenceLinkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequenceLinkId", title="Extension field for ``sequenceLinkId``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ProcessRequestItem`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "sequenceLinkId"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ProcessRequestItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequenceLinkId", "sequenceLinkId__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/processresponse.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ProcessResponse Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ProcessResponse(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. ProcessResponse resource. This resource provides processing status, errors and notes from the processing of a resource. """ __resource_type__ = "ProcessResponse" communicationRequest: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="communicationRequest", title="Request for additional information", description=( "Request for additional supporting or authorizing information, such as:" " documents, images or resources." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CommunicationRequest"], }, ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Creation date", description=( "The date when the enclosed suite of services were performed or " "completed." ), json_schema_extra={ "element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) disposition: fhirtypes.StringType | None = Field( default=None, alias="disposition", title="Disposition Message", description="A description of the status of the adjudication or processing.", json_schema_extra={ "element_property": True, }, ) disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_disposition", title="Extension field for ``disposition``." ) error: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="error", title="Error code", description="Processing errors.", json_schema_extra={ "element_property": True, }, ) form: fhirtypes.CodeableConceptType | None = Field( default=None, alias="form", title="Printed Form Identifier", description="The form to be used for printing the content.", json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier", description="The Response business identifier.", json_schema_extra={ "element_property": True, }, ) organization: fhirtypes.ReferenceType | None = Field( default=None, alias="organization", title="Authoring Organization", description="The organization who produced this adjudicated response.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) outcome: fhirtypes.CodeableConceptType | None = Field( default=None, alias="outcome", title="Processing outcome", description="Transaction status: error, complete, held.", json_schema_extra={ "element_property": True, }, ) processNote: typing.List[fhirtypes.ProcessResponseProcessNoteType] | None = Field( default=None, alias="processNote", title="Processing comments or additional requirements", description=( "Suite of processing notes or additional requirements if the processing" " has been held." ), json_schema_extra={ "element_property": True, }, ) request: fhirtypes.ReferenceType | None = Field( default=None, alias="request", title="Request reference", description="Original request resource reference.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) requestOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="requestOrganization", title="Responsible organization", description=( "The organization which is responsible for the services rendered to the" " patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) requestProvider: fhirtypes.ReferenceType | None = Field( default=None, alias="requestProvider", title="Responsible Practitioner", description=( "The practitioner who is responsible for the services rendered to the " "patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ProcessResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "created", "organization", "request", "outcome", "disposition", "requestProvider", "requestOrganization", "form", "processNote", "error", "communicationRequest", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ProcessResponse`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "status"] class ProcessResponseProcessNote(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Processing comments or additional requirements. Suite of processing notes or additional requirements if the processing has been held. """ __resource_type__ = "ProcessResponseProcessNote" text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Comment on the processing", description="The note text.", json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="display | print | printoper", description="The note purpose: Print/Display.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ProcessResponseProcessNote`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "text"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ProcessResponseProcessNote`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/provenance.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Provenance Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Provenance(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who, What, When for a set of resources. Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies. """ __resource_type__ = "Provenance" activity: fhirtypes.CodingType | None = Field( default=None, alias="activity", title="Activity that occurred", description=( "An activity is something that occurs over a period of time and acts " "upon or with entities; it may include consuming, processing, " "transforming, modifying, relocating, using, or generating entities." ), json_schema_extra={ "element_property": True, }, ) agent: typing.List[fhirtypes.ProvenanceAgentType] = Field( default=..., alias="agent", title="Actor involved", description=( "An actor taking a role in an activity for which it can be assigned " "some degree of responsibility for the activity taking place." ), json_schema_extra={ "element_property": True, }, ) entity: typing.List[fhirtypes.ProvenanceEntityType] | None = Field( default=None, alias="entity", title="An entity used in this activity", description=None, json_schema_extra={ "element_property": True, }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where the activity occurred, if relevant", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="When the activity occurred", description="The period during which the activity occurred.", json_schema_extra={ "element_property": True, }, ) policy: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="policy", title="Policy or plan the activity was defined by", description=( "Policy or plan the activity was defined by. Typically, a single " "activity may have multiple applicable policy documents, such as " "patient consent, guarantor funding, etc." ), json_schema_extra={ "element_property": True, }, ) policy__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_policy", title="Extension field for ``policy``." ) reason: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="reason", title="Reason the activity is occurring", description="The reason that the activity was taking place.", json_schema_extra={ "element_property": True, }, ) recorded: fhirtypes.InstantType | None = Field( default=None, alias="recorded", title="When the activity was recorded / updated", description="The instant of time at which the activity was recorded.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) recorded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recorded", title="Extension field for ``recorded``." ) signature: typing.List[fhirtypes.SignatureType] | None = Field( default=None, alias="signature", title="Signature on target", description=( "A digital signature on the target Reference(s). The signer should " "match a Provenance.agent. The purpose of the signature is indicated." ), json_schema_extra={ "element_property": True, }, ) target: typing.List[fhirtypes.ReferenceType] = Field( default=..., alias="target", title="Target Reference(s) (usually version specific)", description=( "The Reference(s) that were generated or updated by the activity " "described in this resource. A provenance can point to more than one " "target if multiple resources were created/updated by the same " "activity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Provenance`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "target", "period", "recorded", "policy", "location", "reason", "activity", "agent", "entity", "signature", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Provenance`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "target", "recorded"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("recorded", "recorded__ext")] return required_fields class ProvenanceAgent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Actor involved. An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place. """ __resource_type__ = "ProvenanceAgent" onBehalfOfReference: fhirtypes.ReferenceType | None = Field( default=None, alias="onBehalfOfReference", title="Who the agent is representing", description="The individual, device, or organization for whom the change was made.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onBehalfOf[x] "one_of_many": "onBehalfOf", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "RelatedPerson", "Patient", "Device", "Organization", ], }, ) onBehalfOfUri: fhirtypes.UriType | None = Field( default=None, alias="onBehalfOfUri", title="Who the agent is representing", description="The individual, device, or organization for whom the change was made.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onBehalfOf[x] "one_of_many": "onBehalfOf", "one_of_many_required": False, }, ) onBehalfOfUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onBehalfOfUri", title="Extension field for ``onBehalfOfUri``.", ) relatedAgentType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="relatedAgentType", title="Type of relationship between agents", description="The type of relationship between agents.", json_schema_extra={ "element_property": True, }, ) role: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="role", title="What the agents role was", description=( "The function of the agent with respect to the activity. The security " "role enabling the agent with respect to the activity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) whoReference: fhirtypes.ReferenceType | None = Field( default=None, alias="whoReference", title="Who participated", description="The individual, device or organization that participated in the event.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e who[x] "one_of_many": "who", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "RelatedPerson", "Patient", "Device", "Organization", ], }, ) whoUri: fhirtypes.UriType | None = Field( default=None, alias="whoUri", title="Who participated", description="The individual, device or organization that participated in the event.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e who[x] "one_of_many": "who", "one_of_many_required": True, }, ) whoUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_whoUri", title="Extension field for ``whoUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ProvenanceAgent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "role", "whoUri", "whoReference", "whoReference", "whoReference", "whoReference", "whoReference", "onBehalfOfUri", "onBehalfOfReference", "onBehalfOfReference", "onBehalfOfReference", "onBehalfOfReference", "onBehalfOfReference", "relatedAgentType", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ProvenanceAgent`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "role", "whoUri", "whoReference", "whoReference", "whoReference", "whoReference", "whoReference", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "onBehalfOf": ["onBehalfOfReference", "onBehalfOfUri"], "who": ["whoReference", "whoUri"], } return one_of_many_fields class ProvenanceEntity(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An entity used in this activity. """ __resource_type__ = "ProvenanceEntity" agent: typing.List[fhirtypes.ProvenanceAgentType] | None = Field( default=None, alias="agent", title="Entity is attributed to this agent", description=( "The entity is attributed to an agent to express the agent's " "responsibility for that entity, possibly along with other agents. This" " description can be understood as shorthand for saying that the agent " "was responsible for the activity which generated the entity." ), json_schema_extra={ "element_property": True, }, ) role: fhirtypes.CodeType | None = Field( default=None, alias="role", title="derivation | revision | quotation | source | removal", description="How the entity was used during the activity.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["derivation", "revision", "quotation", "source", "removal"], }, ) role__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_role", title="Extension field for ``role``." ) whatIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="whatIdentifier", title="Identity of entity", description=( "Identity of the Entity used. May be a logical or physical uri and " "maybe absolute or relative." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e what[x] "one_of_many": "what", "one_of_many_required": True, }, ) whatReference: fhirtypes.ReferenceType | None = Field( default=None, alias="whatReference", title="Identity of entity", description=( "Identity of the Entity used. May be a logical or physical uri and " "maybe absolute or relative." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e what[x] "one_of_many": "what", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) whatUri: fhirtypes.UriType | None = Field( default=None, alias="whatUri", title="Identity of entity", description=( "Identity of the Entity used. May be a logical or physical uri and " "maybe absolute or relative." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e what[x] "one_of_many": "what", "one_of_many_required": True, }, ) whatUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_whatUri", title="Extension field for ``whatUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ProvenanceEntity`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "role", "whatUri", "whatReference", "whatIdentifier", "agent", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ProvenanceEntity`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "role", "whatUri", "whatReference", "whatIdentifier", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("role", "role__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"what": ["whatIdentifier", "whatReference", "whatUri"]} return one_of_many_fields ================================================ FILE: fhir/resources/STU3/quantity.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SimpleQuantity Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Quantity(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A measured or measurable amount. A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. """ __resource_type__ = "Quantity" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Coded form of the unit", description=( "A computer processable form of the unit in some unit representation " "system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) comparator: fhirtypes.CodeType | None = Field( default=None, alias="comparator", title="< | <= | >= | > - how to understand the value", description=( "How the value should be understood and represented - whether the " "actual value is greater or less than the stated value due to " 'measurement issues; e.g. if the comparator is "<" , then the real ' "value is < stated value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comparator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comparator", title="Extension field for ``comparator``." ) system: fhirtypes.UriType | None = Field( default=None, alias="system", title="System that defines coded unit form", description=( "The identification of the system that provides the coded form of the " "unit." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) unit: fhirtypes.StringType | None = Field( default=None, alias="unit", title="Unit representation", description="A human-readable form of the unit.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) unit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_unit", title="Extension field for ``unit``." ) value: fhirtypes.DecimalType | None = Field( default=None, alias="value", title="Numerical value (with implicit precision)", description=( "The value of the measured amount. The value includes an implicit " "precision in the presentation of the value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Quantity`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "value", "comparator", "unit", "system", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Quantity`` according to specification, with preserving the original sequence order. """ return ["value", "comparator", "unit", "system", "code"] ================================================ FILE: fhir/resources/STU3/questionnaire.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Questionnaire Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Questionnaire(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A structured set of questions. A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection. """ __resource_type__ = "Questionnaire" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the questionnaire was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) code: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="code", title="Concept that represents the overall questionnaire", description=( "An identifier for this question or group of questions in a particular " "terminology such as LOINC." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the questionnaire and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the questionnaire." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date this was last changed", description=( "The date (and optionally time) when the questionnaire was published. " "The date must change if and when the business version changes and it " "must change if the status code changes. In addition, it should change " "when the substantive content of the questionnaire changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the questionnaire", description=( "A free text natural language description of the questionnaire from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the questionnaire is expected to be used", description=( "The period during which the questionnaire content was or is planned to" " be in active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A boolean value to indicate that this questionnaire is authored for " "testing purposes (or education/evaluation/marketing), and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the questionnaire", description=( "A formal identifier that is used to identify this questionnaire when " "it is represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) item: typing.List[fhirtypes.QuestionnaireItemType] | None = Field( default=None, alias="item", title="Questions and sections within the Questionnaire", description=( "A particular question, question grouping or display text that is part " "of the questionnaire." ), json_schema_extra={ "element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for questionnaire (if applicable)", description=( "A legal or geographic region in which the questionnaire is intended to" " be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the questionnaire was last reviewed", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval, but doesn't change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this questionnaire (computer friendly)", description=( "A natural language name identifying the questionnaire. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the individual or organization that published the " "questionnaire." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this questionnaire is defined", description=( "Explaination of why this questionnaire is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this questionnaire. Enables tracking the life-cycle of " "the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subjectType: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="subjectType", title="Resource that can be subject of QuestionnaireResponse", description=( "The types of subjects that can be the subject of responses created for" " the questionnaire." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subjectType__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_subjectType", title="Extension field for ``subjectType``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this questionnaire (human friendly)", description="A short, descriptive, user-friendly title for the questionnaire.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Logical URI to reference this questionnaire (globally unique)", description=( "An absolute URI that is used to identify this questionnaire when it is" " referenced in a specification, model, design or an instance. This " "SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at" " which this questionnaire is (or will be) published. The URL SHOULD " "include the major version of the questionnaire. For more information " "see [Technical and Business Versions](resource.html#versions)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Context the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching for appropriate questionnaire instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the questionnaire", description=( "The identifier that is used to identify this version of the " "questionnaire when it is referenced in a specification, model, design " "or instance. This is an arbitrary value managed by the questionnaire " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Questionnaire`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "description", "purpose", "approvalDate", "lastReviewDate", "effectivePeriod", "useContext", "jurisdiction", "contact", "copyright", "code", "subjectType", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Questionnaire`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "effectivePeriod", "useContext", "jurisdiction", "contact", "code", "subjectType", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class QuestionnaireItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Questions and sections within the Questionnaire. A particular question, question grouping or display text that is part of the questionnaire. """ __resource_type__ = "QuestionnaireItem" code: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="code", title="Corresponding concept for this item in a terminology", description=( "A terminology code that corresponds to this group or question (e.g. a " "code from LOINC, which defines many questions and answers)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) definition: fhirtypes.UriType | None = Field( default=None, alias="definition", title="ElementDefinition - details for the item", description=( "A reference to an [ElementDefinition](elementdefinition.html) that " "provides the details for the item. If a definition is provided, then " "the following element values can be inferred from the definition: * " "code (ElementDefinition.code) * type (ElementDefinition.type) * " "required (ElementDefinition.min) * repeats (ElementDefinition.max) * " "maxLength (ElementDefinition.maxLength) * options " "(ElementDefinition.binding) Any information provided in these " "elements on a Questionnaire Item overrides the information from the " "definition." ), json_schema_extra={ "element_property": True, }, ) definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) enableWhen: typing.List[fhirtypes.QuestionnaireItemEnableWhenType] | None = Field( default=None, alias="enableWhen", title="Only allow data when", description=( "A constraint indicating that this item should only be enabled " "(displayed/allow answers to be captured) when the specified condition " "is true." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) initialAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="initialAttachment", title="Default value when item is first rendered", description=( "The value that should be defaulted when initially rendering the " "questionnaire for user input." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e initial[x] "one_of_many": "initial", "one_of_many_required": False, }, ) initialBoolean: bool | None = Field( default=None, alias="initialBoolean", title="Default value when item is first rendered", description=( "The value that should be defaulted when initially rendering the " "questionnaire for user input." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e initial[x] "one_of_many": "initial", "one_of_many_required": False, }, ) initialBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_initialBoolean", title="Extension field for ``initialBoolean``.", ) initialCoding: fhirtypes.CodingType | None = Field( default=None, alias="initialCoding", title="Default value when item is first rendered", description=( "The value that should be defaulted when initially rendering the " "questionnaire for user input." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e initial[x] "one_of_many": "initial", "one_of_many_required": False, }, ) initialDate: fhirtypes.DateType | None = Field( default=None, alias="initialDate", title="Default value when item is first rendered", description=( "The value that should be defaulted when initially rendering the " "questionnaire for user input." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e initial[x] "one_of_many": "initial", "one_of_many_required": False, }, ) initialDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_initialDate", title="Extension field for ``initialDate``." ) initialDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="initialDateTime", title="Default value when item is first rendered", description=( "The value that should be defaulted when initially rendering the " "questionnaire for user input." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e initial[x] "one_of_many": "initial", "one_of_many_required": False, }, ) initialDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_initialDateTime", title="Extension field for ``initialDateTime``.", ) initialDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="initialDecimal", title="Default value when item is first rendered", description=( "The value that should be defaulted when initially rendering the " "questionnaire for user input." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e initial[x] "one_of_many": "initial", "one_of_many_required": False, }, ) initialDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_initialDecimal", title="Extension field for ``initialDecimal``.", ) initialInteger: fhirtypes.IntegerType | None = Field( default=None, alias="initialInteger", title="Default value when item is first rendered", description=( "The value that should be defaulted when initially rendering the " "questionnaire for user input." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e initial[x] "one_of_many": "initial", "one_of_many_required": False, }, ) initialInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_initialInteger", title="Extension field for ``initialInteger``.", ) initialQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="initialQuantity", title="Default value when item is first rendered", description=( "The value that should be defaulted when initially rendering the " "questionnaire for user input." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e initial[x] "one_of_many": "initial", "one_of_many_required": False, }, ) initialReference: fhirtypes.ReferenceType | None = Field( default=None, alias="initialReference", title="Default value when item is first rendered", description=( "The value that should be defaulted when initially rendering the " "questionnaire for user input." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e initial[x] "one_of_many": "initial", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) initialString: fhirtypes.StringType | None = Field( default=None, alias="initialString", title="Default value when item is first rendered", description=( "The value that should be defaulted when initially rendering the " "questionnaire for user input." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e initial[x] "one_of_many": "initial", "one_of_many_required": False, }, ) initialString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_initialString", title="Extension field for ``initialString``.", ) initialTime: fhirtypes.TimeType | None = Field( default=None, alias="initialTime", title="Default value when item is first rendered", description=( "The value that should be defaulted when initially rendering the " "questionnaire for user input." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e initial[x] "one_of_many": "initial", "one_of_many_required": False, }, ) initialTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_initialTime", title="Extension field for ``initialTime``." ) initialUri: fhirtypes.UriType | None = Field( default=None, alias="initialUri", title="Default value when item is first rendered", description=( "The value that should be defaulted when initially rendering the " "questionnaire for user input." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e initial[x] "one_of_many": "initial", "one_of_many_required": False, }, ) initialUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_initialUri", title="Extension field for ``initialUri``." ) item: typing.List[fhirtypes.QuestionnaireItemType] | None = Field( default=None, alias="item", title="Nested questionnaire items", description=( "Text, questions and other groups to be nested beneath a question or " "group." ), json_schema_extra={ "element_property": True, }, ) linkId: fhirtypes.StringType | None = Field( default=None, alias="linkId", title="Unique id for item in questionnaire", description=( "An identifier that is unique within the Questionnaire allowing linkage" " to the equivalent item in a QuestionnaireResponse resource." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) maxLength: fhirtypes.IntegerType | None = Field( default=None, alias="maxLength", title="No more than this many characters", description=( "The maximum number of characters that are permitted in the answer to " 'be considered a "valid" QuestionnaireResponse.' ), json_schema_extra={ "element_property": True, }, ) maxLength__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxLength", title="Extension field for ``maxLength``." ) option: typing.List[fhirtypes.QuestionnaireItemOptionType] | None = Field( default=None, alias="option", title="Permitted answer", description='One of the permitted answers for a "choice" or "open-choice" question.', json_schema_extra={ "element_property": True, }, ) options: fhirtypes.ReferenceType | None = Field( default=None, alias="options", title="Valueset containing permitted answers", description=( "A reference to a value set containing a list of codes representing " 'permitted answers for a "choice" or "open-choice" question.' ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) prefix: fhirtypes.StringType | None = Field( default=None, alias="prefix", title='E.g. "1(a)", "2.5.3"', description=( "A short label for a particular group, question or set of display text " "within the questionnaire used for reference by the individual " "completing the questionnaire." ), json_schema_extra={ "element_property": True, }, ) prefix__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_prefix", title="Extension field for ``prefix``." ) readOnly: bool | None = Field( default=None, alias="readOnly", title="Don't allow human editing", description=( "An indication, when true, that the value cannot be changed by a human " "respondent to the Questionnaire." ), json_schema_extra={ "element_property": True, }, ) readOnly__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_readOnly", title="Extension field for ``readOnly``." ) repeats: bool | None = Field( default=None, alias="repeats", title="Whether the item may repeat", description=( "An indication, if true, that the item may occur multiple times in the " "response, collecting multiple answers answers for questions or " "multiple sets of answers for groups." ), json_schema_extra={ "element_property": True, }, ) repeats__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_repeats", title="Extension field for ``repeats``." ) required: bool | None = Field( default=None, alias="required", title="Whether the item must be included in data results", description=( 'An indication, if true, that the item must be present in a "completed"' " QuestionnaireResponse. If false, the item may be skipped when " "answering the questionnaire." ), json_schema_extra={ "element_property": True, }, ) required__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_required", title="Extension field for ``required``." ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Primary text for the item", description=( "The name of a section, the text of a question or text content for a " "display item." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="group | display | boolean | decimal | integer | date | dateTime +", description=( "The type of questionnaire item this is - whether text for display, a " "grouping of other items or a particular type of data to be captured " "(string, integer, coded choice, etc.)." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "group", "display", "boolean", "decimal", "integer", "date", "dateTime", "+", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``QuestionnaireItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "linkId", "definition", "code", "prefix", "text", "type", "enableWhen", "required", "repeats", "readOnly", "maxLength", "options", "option", "initialBoolean", "initialDecimal", "initialInteger", "initialDate", "initialDateTime", "initialTime", "initialString", "initialUri", "initialAttachment", "initialCoding", "initialQuantity", "initialReference", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``QuestionnaireItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "text", "enableWhen"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("linkId", "linkId__ext"), ("type", "type__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "initial": [ "initialAttachment", "initialBoolean", "initialCoding", "initialDate", "initialDateTime", "initialDecimal", "initialInteger", "initialQuantity", "initialReference", "initialString", "initialTime", "initialUri", ] } return one_of_many_fields class QuestionnaireItemEnableWhen(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Only allow data when. A constraint indicating that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true. """ __resource_type__ = "QuestionnaireItemEnableWhen" answerAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="answerAttachment", title="Value question must have", description=( "An answer that the referenced question must match in order for the " "item to be enabled." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": False, }, ) answerBoolean: bool | None = Field( default=None, alias="answerBoolean", title="Value question must have", description=( "An answer that the referenced question must match in order for the " "item to be enabled." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": False, }, ) answerBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerBoolean", title="Extension field for ``answerBoolean``.", ) answerCoding: fhirtypes.CodingType | None = Field( default=None, alias="answerCoding", title="Value question must have", description=( "An answer that the referenced question must match in order for the " "item to be enabled." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": False, }, ) answerDate: fhirtypes.DateType | None = Field( default=None, alias="answerDate", title="Value question must have", description=( "An answer that the referenced question must match in order for the " "item to be enabled." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": False, }, ) answerDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerDate", title="Extension field for ``answerDate``." ) answerDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="answerDateTime", title="Value question must have", description=( "An answer that the referenced question must match in order for the " "item to be enabled." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": False, }, ) answerDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerDateTime", title="Extension field for ``answerDateTime``.", ) answerDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="answerDecimal", title="Value question must have", description=( "An answer that the referenced question must match in order for the " "item to be enabled." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": False, }, ) answerDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerDecimal", title="Extension field for ``answerDecimal``.", ) answerInteger: fhirtypes.IntegerType | None = Field( default=None, alias="answerInteger", title="Value question must have", description=( "An answer that the referenced question must match in order for the " "item to be enabled." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": False, }, ) answerInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerInteger", title="Extension field for ``answerInteger``.", ) answerQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="answerQuantity", title="Value question must have", description=( "An answer that the referenced question must match in order for the " "item to be enabled." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": False, }, ) answerReference: fhirtypes.ReferenceType | None = Field( default=None, alias="answerReference", title="Value question must have", description=( "An answer that the referenced question must match in order for the " "item to be enabled." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) answerString: fhirtypes.StringType | None = Field( default=None, alias="answerString", title="Value question must have", description=( "An answer that the referenced question must match in order for the " "item to be enabled." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": False, }, ) answerString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerString", title="Extension field for ``answerString``.", ) answerTime: fhirtypes.TimeType | None = Field( default=None, alias="answerTime", title="Value question must have", description=( "An answer that the referenced question must match in order for the " "item to be enabled." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": False, }, ) answerTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerTime", title="Extension field for ``answerTime``." ) answerUri: fhirtypes.UriType | None = Field( default=None, alias="answerUri", title="Value question must have", description=( "An answer that the referenced question must match in order for the " "item to be enabled." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": False, }, ) answerUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerUri", title="Extension field for ``answerUri``." ) hasAnswer: bool | None = Field( default=None, alias="hasAnswer", title="Enable when answered or not", description=( "An indication that this item should be enabled only if the specified " "question is answered (hasAnswer=true) or not answered " "(hasAnswer=false)." ), json_schema_extra={ "element_property": True, }, ) hasAnswer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_hasAnswer", title="Extension field for ``hasAnswer``." ) question: fhirtypes.StringType | None = Field( default=None, alias="question", title="Question that determines whether item is enabled", description=( "The linkId for the question whose answer (or lack of answer) governs " "whether this item is enabled." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) question__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_question", title="Extension field for ``question``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``QuestionnaireItemEnableWhen`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "question", "hasAnswer", "answerBoolean", "answerDecimal", "answerInteger", "answerDate", "answerDateTime", "answerTime", "answerString", "answerUri", "answerAttachment", "answerCoding", "answerQuantity", "answerReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``QuestionnaireItemEnableWhen`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("question", "question__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "answer": [ "answerAttachment", "answerBoolean", "answerCoding", "answerDate", "answerDateTime", "answerDecimal", "answerInteger", "answerQuantity", "answerReference", "answerString", "answerTime", "answerUri", ] } return one_of_many_fields class QuestionnaireItemOption(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Permitted answer. One of the permitted answers for a "choice" or "open-choice" question. """ __resource_type__ = "QuestionnaireItemOption" valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Answer value", description="A potential answer that's allowed as the answer to this question.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="Answer value", description="A potential answer that's allowed as the answer to this question.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Answer value", description="A potential answer that's allowed as the answer to this question.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Answer value", description="A potential answer that's allowed as the answer to this question.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Answer value", description="A potential answer that's allowed as the answer to this question.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``QuestionnaireItemOption`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "valueInteger", "valueDate", "valueTime", "valueString", "valueCoding", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``QuestionnaireItemOption`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueCoding", "valueDate", "valueInteger", "valueString", "valueTime", ] } return one_of_many_fields ================================================ FILE: fhir/resources/STU3/questionnaireresponse.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class QuestionnaireResponse(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A structured set of questions and their answers. A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to. """ __resource_type__ = "QuestionnaireResponse" author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="Person who received and recorded the answers", description=( "Person who received the answers to the questions in the " "QuestionnaireResponse and recorded them in the system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Practitioner", "Patient", "RelatedPerson", ], }, ) authored: fhirtypes.DateTimeType | None = Field( default=None, alias="authored", title="Date the answers were gathered", description="The date and/or time that this set of answers were last changed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authored__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authored", title="Extension field for ``authored``." ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Request fulfilled by this QuestionnaireResponse", description=( "The order, proposal or plan that is fulfilled in whole or in part by " "this QuestionnaireResponse. For example, a ProcedureRequest seeking " "an intake assessment or a decision support recommendation to assess " "for post-partum depression." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ReferralRequest", "CarePlan", "ProcedureRequest"], }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Encounter or Episode during which questionnaire was completed", description=( "The encounter or episode of care with primary association to the " "questionnaire response." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Unique id for this set of answers", description=( "A business identifier assigned to a particular completed (or partially" " completed) questionnaire." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) item: typing.List[fhirtypes.QuestionnaireResponseItemType] | None = Field( default=None, alias="item", title="Groups and questions", description=( "A group or question item from the original questionnaire for which " "answers are provided." ), json_schema_extra={ "element_property": True, }, ) parent: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="parent", title="Part of this action", description=( "A procedure or observation that this questionnaire was performed as " "part of the execution of. For example, the surgery a checklist was " "executed as part of." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Observation", "Procedure"], }, ) questionnaire: fhirtypes.ReferenceType | None = Field( default=None, alias="questionnaire", title="Form being answered", description=( "The Questionnaire that defines and organizes the questions for which " "answers are being provided." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Questionnaire"], }, ) source: fhirtypes.ReferenceType | None = Field( default=None, alias="source", title="The person who answered the questions", description="The person who answered the questions about the subject.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Practitioner", "RelatedPerson"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="in-progress | completed | amended | entered-in-error | stopped", description=( "The position of the questionnaire response within its overall " "lifecycle." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "in-progress", "completed", "amended", "entered-in-error", "stopped", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="The subject of the questions", description=( "The subject of the questionnaire response. This could be a patient, " "organization, practitioner, device, etc. This is who/what the answers" " apply to, but is not necessarily the source of information." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``QuestionnaireResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "parent", "questionnaire", "status", "subject", "context", "authored", "author", "source", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``QuestionnaireResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "basedOn", "parent", "questionnaire", "status", "subject", "context", "authored", "author", "source", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class QuestionnaireResponseItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Groups and questions. A group or question item from the original questionnaire for which answers are provided. """ __resource_type__ = "QuestionnaireResponseItem" answer: typing.List[fhirtypes.QuestionnaireResponseItemAnswerType] | None = Field( default=None, alias="answer", title="The response(s) to the question", description="The respondent's answer(s) to the question.", json_schema_extra={ "element_property": True, }, ) definition: fhirtypes.UriType | None = Field( default=None, alias="definition", title="ElementDefinition - details for the item", description=( "A reference to an [ElementDefinition](elementdefinition.html) that " "provides the details for the item." ), json_schema_extra={ "element_property": True, }, ) definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) item: typing.List[fhirtypes.QuestionnaireResponseItemType] | None = Field( default=None, alias="item", title="Nested questionnaire response items", description="Questions or sub-groups nested beneath a question or group.", json_schema_extra={ "element_property": True, }, ) linkId: fhirtypes.StringType | None = Field( default=None, alias="linkId", title="Pointer to specific item from Questionnaire", description=( "The item from the Questionnaire that corresponds to this item in the " "QuestionnaireResponse resource." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="The subject this group's answers are about", description=( "More specific subject this section's answers are about, details the " "subject given in QuestionnaireResponse." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Name for group or question text", description=( "Text that is displayed above the contents of the group or as the text " "of the question being answered." ), json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``QuestionnaireResponseItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "linkId", "definition", "text", "subject", "answer", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``QuestionnaireResponseItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("linkId", "linkId__ext")] return required_fields class QuestionnaireResponseItemAnswer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The response(s) to the question. The respondent's answer(s) to the question. """ __resource_type__ = "QuestionnaireResponseItemAnswer" item: typing.List[fhirtypes.QuestionnaireResponseItemType] | None = Field( default=None, alias="item", title="Nested groups and questions", description="Nested groups and/or questions found within this particular answer.", json_schema_extra={ "element_property": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``QuestionnaireResponseItemAnswer`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "valueBoolean", "valueDecimal", "valueInteger", "valueDate", "valueDateTime", "valueTime", "valueString", "valueUri", "valueAttachment", "valueCoding", "valueQuantity", "valueReference", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``QuestionnaireResponseItemAnswer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueBoolean", "valueCoding", "valueDate", "valueDateTime", "valueDecimal", "valueInteger", "valueQuantity", "valueReference", "valueString", "valueTime", "valueUri", ] } return one_of_many_fields ================================================ FILE: fhir/resources/STU3/range.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Range Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Range(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Set of values bounded by low and high. A set of ordered Quantities defined by a low and high limit. """ __resource_type__ = "Range" high: fhirtypes.QuantityType | None = Field( default=None, alias="high", title="High limit", description="The high limit. The boundary is inclusive.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) low: fhirtypes.QuantityType | None = Field( default=None, alias="low", title="Low limit", description="The low limit. The boundary is inclusive.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Range`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "low", "high"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Range`` according to specification, with preserving the original sequence order. """ return ["low", "high"] ================================================ FILE: fhir/resources/STU3/ratio.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Ratio Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Ratio(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A ratio of two Quantity values - a numerator and a denominator. A relationship of two Quantity values - expressed as a numerator and a denominator. """ __resource_type__ = "Ratio" denominator: fhirtypes.QuantityType | None = Field( default=None, alias="denominator", title="Denominator value", description="The value of the denominator.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) numerator: fhirtypes.QuantityType | None = Field( default=None, alias="numerator", title="Numerator value", description="The value of the numerator.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Ratio`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "numerator", "denominator"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Ratio`` according to specification, with preserving the original sequence order. """ return ["numerator", "denominator"] ================================================ FILE: fhir/resources/STU3/reference.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Reference Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Reference(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A reference from one resource to another. """ __resource_type__ = "Reference" display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Text alternative for the resource", description=( "Plain text narrative that identifies the resource in addition to the " "resource reference." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Logical reference, when literal reference is not known", description=( "An identifier for the other resource. This is used when there is no " "way to reference the other resource directly, either because the " "entity is not available through a FHIR server, or because there is no " "way for the author of the resource to convert a known identifier to an" " actual location. There is no requirement that a Reference.identifier " "point to something that is actually exposed as a FHIR instance, but it" " SHALL point to a business concept that would be expected to be " "exposed as a FHIR instance, and that instance would need to be of a " "FHIR resource type allowed by the reference." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reference: fhirtypes.StringType | None = Field( default=None, alias="reference", title="Literal reference, Relative, internal or absolute URL", description=( "A reference to a location at which the other resource is found. The " "reference may be a relative reference, in which case it is relative to" " the service base URL, or an absolute URL that resolves to the " "location where the resource is found. The reference may be version " "specific or not. If the reference is not to a FHIR RESTful server, " "then it should be assumed to be version specific. Internal fragment " "references (start with '#') refer to contained resources." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reference", title="Extension field for ``reference``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Reference`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "reference", "identifier", "display"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Reference`` according to specification, with preserving the original sequence order. """ return ["reference", "identifier", "display"] ================================================ FILE: fhir/resources/STU3/referralrequest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ReferralRequest Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ReferralRequest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A request for referral or transfer of care. Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization. """ __resource_type__ = "ReferralRequest" authoredOn: fhirtypes.DateTimeType | None = Field( default=None, alias="authoredOn", title="Date of creation/activation", description=( "Date/DateTime of creation for draft requests and date of activation " "for active requests." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoredOn", title="Extension field for ``authoredOn``." ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Request fulfilled by this request", description=( "Indicates any plans, proposals or orders that this request is intended" " to satisfy - in whole or in part." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ReferralRequest", "CarePlan", "ProcedureRequest"], }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Originating encounter", description=( "The encounter at which the request for referral or transfer of care is" " initiated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) definition: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="definition", title="Instantiates protocol or definition", description=( "A protocol, guideline, orderset or other definition that is adhered to" " in whole or in part by this request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ActivityDefinition", "PlanDefinition"], }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="A textual description of the referral", description=( "The reason element gives a short description of why the referral is " "being made, the description expands on this to support a more complete" " clinical summary." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) groupIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="groupIdentifier", title="Composite request this is part of", description=( 'The business identifier of the logical "grouping" request/order that ' "this referral is a part of." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description=( "Business identifier that uniquely identifies the referral/care " "transfer request instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) intent: fhirtypes.CodeType | None = Field( default=None, alias="intent", title="proposal | plan | order", description=( 'Distinguishes the "level" of authorization/demand implicit in this ' "request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["proposal", "plan", "order"], }, ) intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intent", title="Extension field for ``intent``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about referral request", description="Comments made about the referral request by any of the participants.", json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When the service(s) requested in the referral should occur", description=( "The period of time within which the services identified in the " "referral/transfer of care is specified or required to occur." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="When the service(s) requested in the referral should occur", description=( "The period of time within which the services identified in the " "referral/transfer of care is specified or required to occur." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="Urgency of referral / transfer of care request", description=( "An indication of the urgency of referral (or where applicable the type" " of transfer of care) request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reasonCode", title="Reason for referral / transfer of care request", description=( "Description of clinical condition indicating why referral/transfer of " "care is requested. For example: Pathological Anomalies, Disabled " "(physical or mental), Behavioral Management." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="reasonReference", title="Why is service needed?", description="Indicates another resource whose existence justifies this request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "Observation"], }, ) recipient: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="recipient", title="Receiver of referral / transfer of care request", description=( "The healthcare provider(s) or provider organization(s) who/which is to" " receive the referral/transfer of care request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Organization", "HealthcareService", ], }, ) relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="relevantHistory", title="Key events in history of request", description=( "Links to Provenance records for past versions of this resource or " "fulfilling request or event resources that identify key state " "transitions or updates that are likely to be relevant to a user " "looking at the current version of the resource." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Provenance"], }, ) replaces: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="replaces", title="Request(s) replaced by this request", description=( "Completed or terminated request(s) whose function is taken by this new" " request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ReferralRequest"], }, ) requester: fhirtypes.ReferralRequestRequesterType | None = Field( default=None, alias="requester", title="Who/what is requesting service", description=( "The individual who initiated the request and has responsibility for " "its activation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) serviceRequested: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="serviceRequested", title="Actions requested as part of the referral", description=( "The service(s) that is/are requested to be provided to the patient. " "For example: cardiac pacemaker insertion." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) specialty: fhirtypes.CodeableConceptType | None = Field( default=None, alias="specialty", title="The clinical specialty (discipline) that the referral is requested for", description=( "Indication of the clinical domain or discipline to which the referral " "or transfer of care request is sent. For example: Cardiology " "Gastroenterology Diabetology." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "draft | active | suspended | cancelled | completed | entered-in-error " "| unknown" ), description=( "The status of the authorization/intention reflected by the referral " "request record." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "draft", "active", "suspended", "cancelled", "completed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Patient referred to care or transfer", description=( "The patient who is the subject of a referral or transfer of care " "request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInfo", title="Additonal information to support referral or transfer of care request", description=( "Any additional (administrative, financial or clinical) information " "required to support request for referral or transfer of care. For " "example: Presenting problems/chief complaints Medical History Family " "History Alerts Allergy/Intolerance and Adverse Reactions Medications " "Observations/Assessments (may include cognitive and fundtional " "assessments) Diagnostic Reports Care Plan." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Referral/Transition of care request type", description=( "An indication of the type of referral (or where applicable the type of" " transfer of care) request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ReferralRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "definition", "basedOn", "replaces", "groupIdentifier", "status", "intent", "type", "priority", "serviceRequested", "subject", "context", "occurrenceDateTime", "occurrencePeriod", "authoredOn", "requester", "specialty", "recipient", "reasonCode", "reasonReference", "description", "supportingInfo", "note", "relevantHistory", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ReferralRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "definition", "basedOn", "replaces", "groupIdentifier", "status", "intent", "type", "priority", "serviceRequested", "subject", "context", "occurrenceDateTime", "occurrencePeriod", "authoredOn", "requester", "recipient", "reasonCode", "reasonReference", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("intent", "intent__ext"), ("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"occurrence": ["occurrenceDateTime", "occurrencePeriod"]} return one_of_many_fields class ReferralRequestRequester(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who/what is requesting service. The individual who initiated the request and has responsibility for its activation. """ __resource_type__ = "ReferralRequestRequester" agent: fhirtypes.ReferenceType = Field( default=..., alias="agent", title="Individual making the request", description="The device, practitioner, etc. who initiated the request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Organization", "Patient", "RelatedPerson", "Device", ], }, ) onBehalfOf: fhirtypes.ReferenceType | None = Field( default=None, alias="onBehalfOf", title="Organization agent is acting for", description="The organization the device or practitioner was acting on behalf of.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ReferralRequestRequester`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "agent", "onBehalfOf"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ReferralRequestRequester`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "agent", "onBehalfOf"] ================================================ FILE: fhir/resources/STU3/relatedartifact.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/RelatedArtifact Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class RelatedArtifact(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Related artifacts for a knowledge resource. Related artifacts such as additional documentation, justification, or bibliographic references. """ __resource_type__ = "RelatedArtifact" citation: fhirtypes.StringType | None = Field( default=None, alias="citation", title="Bibliographic citation for the artifact", description=( "A bibliographic citation for the related artifact. This text SHOULD be" " formatted according to an accepted citation format." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) citation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_citation", title="Extension field for ``citation``." ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Brief description of the related artifact", description=( "A brief description of the document or knowledge resource being " "referenced, suitable for display to a consumer." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) document: fhirtypes.AttachmentType | None = Field( default=None, alias="document", title="What document is being referenced", description=( "The document being referenced, represented as an attachment. This is " "exclusive with the resource element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) resource: fhirtypes.ReferenceType | None = Field( default=None, alias="resource", title="What resource is being referenced", description=( "The related resource, such as a library, value set, profile, or other " "knowledge resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "documentation | justification | citation | predecessor | successor | " "derived-from | depends-on | composed-of" ), description="The type of relationship to the related artifact.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "documentation", "justification", "citation", "predecessor", "successor", "derived-from", "depends-on", "composed-of", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Where the artifact can be accessed", description=( "A url for the artifact that can be followed to access the actual " "content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RelatedArtifact`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "type", "display", "citation", "url", "document", "resource", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RelatedArtifact`` according to specification, with preserving the original sequence order. """ return ["type", "display", "citation", "url", "document", "resource"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/relatedperson.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/RelatedPerson Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class RelatedPerson(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An person that is related to a patient, but who is not a direct target of care. Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process. """ __resource_type__ = "RelatedPerson" active: bool | None = Field( default=None, alias="active", title="Whether this related person's record is in active use", description="Whether this related person record is in active use.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) address: typing.List[fhirtypes.AddressType] | None = Field( default=None, alias="address", title="Address where the related person can be contacted or visited", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) birthDate: fhirtypes.DateType | None = Field( default=None, alias="birthDate", title="The date on which the related person was born", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) birthDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_birthDate", title="Extension field for ``birthDate``." ) gender: fhirtypes.CodeType | None = Field( default=None, alias="gender", title="male | female | other | unknown", description=( "Administrative Gender - the gender that the person is considered to " "have for administration and record keeping purposes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["male", "female", "other", "unknown"], }, ) gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_gender", title="Extension field for ``gender``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="A human identifier for this person", description="Identifier for a person within a particular scope.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: typing.List[fhirtypes.HumanNameType] | None = Field( default=None, alias="name", title="A name associated with the person", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="The patient this person is related to", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Period of time that this relationship is considered valid", description=( "The period of time that this relationship is considered to be valid. " "If there are no dates defined, then the interval is unknown." ), json_schema_extra={ "element_property": True, }, ) photo: typing.List[fhirtypes.AttachmentType] | None = Field( default=None, alias="photo", title="Image of the person", description=None, json_schema_extra={ "element_property": True, }, ) relationship: fhirtypes.CodeableConceptType | None = Field( default=None, alias="relationship", title="The nature of the relationship", description=( "The nature of the relationship between a patient and the related " "person." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="A contact detail for the person", description=( "A contact detail for the person, e.g. a telephone number or an email " "address." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RelatedPerson`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "patient", "relationship", "name", "telecom", "gender", "birthDate", "address", "photo", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RelatedPerson`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "active", "patient", "relationship", "name", "telecom", "gender", "birthDate", "address", ] ================================================ FILE: fhir/resources/STU3/requestgroup.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/RequestGroup Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class RequestGroup(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A group of related requests. A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one". """ __resource_type__ = "RequestGroup" action: typing.List[fhirtypes.RequestGroupActionType] | None = Field( default=None, alias="action", title="Proposed actions, if any", description="The actions, if any, produced by the evaluation of the artifact.", json_schema_extra={ "element_property": True, }, ) author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="Device or practitioner that authored the request group", description="Provides a reference to the author of the request group.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device", "Practitioner"], }, ) authoredOn: fhirtypes.DateTimeType | None = Field( default=None, alias="authoredOn", title="When the request group was authored", description="Indicates when the request group was created.", json_schema_extra={ "element_property": True, }, ) authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoredOn", title="Extension field for ``authoredOn``." ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Fulfills plan, proposal, or order", description=( "A plan, proposal or order that is fulfilled in whole or in part by " "this request." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Encounter or Episode for the request group", description="Describes the context of the request group, if any.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) definition: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="definition", title="Instantiates protocol or definition", description=( "A protocol, guideline, orderset or other definition that is adhered to" " in whole or in part by this request." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) groupIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="groupIdentifier", title="Composite request this is part of", description=( "A shared identifier common to all requests that were authorized more " "or less simultaneously by a single author, representing the identifier" " of the requisition, prescription or similar form." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description=( "Allows a service to provide a unique, business identifier for the " "request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) intent: fhirtypes.CodeType | None = Field( default=None, alias="intent", title="proposal | plan | order", description=( "Indicates the level of authority/intentionality associated with the " "request and where the request fits into the workflow chain." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["proposal", "plan", "order"], }, ) intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intent", title="Extension field for ``intent``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Additional notes about the response", description=( "Provides a mechanism to communicate additional information about the " "response." ), json_schema_extra={ "element_property": True, }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Indicates how quickly the request should be addressed with respect to " "other requests." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) reasonCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reasonCodeableConcept", title="Reason for the request group", description=( "Indicates the reason the request group was created. This is typically " "provided as a parameter to the evaluation and echoed by the service, " "although for some use cases, such as subscription- or event-based " "scenarios, it may provide an indication of the cause for the response." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e reason[x] "one_of_many": "reason", "one_of_many_required": False, }, ) reasonReference: fhirtypes.ReferenceType | None = Field( default=None, alias="reasonReference", title="Reason for the request group", description=( "Indicates the reason the request group was created. This is typically " "provided as a parameter to the evaluation and echoed by the service, " "although for some use cases, such as subscription- or event-based " "scenarios, it may provide an indication of the cause for the response." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e reason[x] "one_of_many": "reason", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) replaces: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="replaces", title="Request(s) replaced by this request", description=( "Completed or terminated request(s) whose function is taken by this new" " request." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "draft | active | suspended | cancelled | completed | entered-in-error " "| unknown" ), description=( "The current state of the request. For request groups, the status " "reflects the status of all the requests in the group." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "draft", "active", "suspended", "cancelled", "completed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Who the request group is about", description="The subject for which the request group was created.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RequestGroup`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "definition", "basedOn", "replaces", "groupIdentifier", "status", "intent", "priority", "subject", "context", "authoredOn", "author", "reasonCodeableConcept", "reasonReference", "note", "action", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RequestGroup`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "groupIdentifier", "status", "intent", "priority", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("intent", "intent__ext"), ("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"reason": ["reasonCodeableConcept", "reasonReference"]} return one_of_many_fields class RequestGroupAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Proposed actions, if any. The actions, if any, produced by the evaluation of the artifact. """ __resource_type__ = "RequestGroupAction" action: typing.List[fhirtypes.RequestGroupActionType] | None = Field( default=None, alias="action", title="Sub action", description="Sub actions.", json_schema_extra={ "element_property": True, }, ) cardinalityBehavior: fhirtypes.CodeType | None = Field( default=None, alias="cardinalityBehavior", title="single | multiple", description="Defines whether the action can be selected multiple times.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["single", "multiple"], }, ) cardinalityBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_cardinalityBehavior", title="Extension field for ``cardinalityBehavior``.", ) code: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="code", title="Code representing the meaning of the action or sub-actions", description=( "A code that provides meaning for the action or action group. For " "example, a section may have a LOINC code for a the section of a " "documentation template." ), json_schema_extra={ "element_property": True, }, ) condition: typing.List[fhirtypes.RequestGroupActionConditionType] | None = Field( default=None, alias="condition", title="Whether or not the action is applicable", description=( "An expression that describes applicability criteria, or start/stop " "conditions for the action." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Short description of the action", description=( "A short description of the action used to provide a summary to display" " to the user." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) documentation: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="documentation", title="Supporting documentation for the intended performer of the action", description=( "Didactic or other informational resources associated with the action " "that can be provided to the CDS recipient. Information resources can " "include inline text commentary and links to web resources." ), json_schema_extra={ "element_property": True, }, ) groupingBehavior: fhirtypes.CodeType | None = Field( default=None, alias="groupingBehavior", title="visual-group | logical-group | sentence-group", description="Defines the grouping behavior for the action and its children.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["visual-group", "logical-group", "sentence-group"], }, ) groupingBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_groupingBehavior", title="Extension field for ``groupingBehavior``.", ) label: fhirtypes.StringType | None = Field( default=None, alias="label", title="User-visible label for the action (e.g. 1. or A.)", description="A user-visible label for the action.", json_schema_extra={ "element_property": True, }, ) label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_label", title="Extension field for ``label``." ) participant: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="participant", title="Who should perform the action", description="The participant that should perform or be responsible for this action.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Person", "Practitioner", "RelatedPerson", ], }, ) precheckBehavior: fhirtypes.CodeType | None = Field( default=None, alias="precheckBehavior", title="yes | no", description="Defines whether the action should usually be preselected.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["yes", "no"], }, ) precheckBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_precheckBehavior", title="Extension field for ``precheckBehavior``.", ) relatedAction: typing.List[ fhirtypes.RequestGroupActionRelatedActionType ] | None = Field( default=None, alias="relatedAction", title="Relationship to another action", description=( 'A relationship to another action such as "before" or "30-60 minutes ' 'after start of".' ), json_schema_extra={ "element_property": True, }, ) requiredBehavior: fhirtypes.CodeType | None = Field( default=None, alias="requiredBehavior", title="must | could | must-unless-documented", description="Defines the requiredness behavior for the action.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["must", "could", "must-unless-documented"], }, ) requiredBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requiredBehavior", title="Extension field for ``requiredBehavior``.", ) resource: fhirtypes.ReferenceType | None = Field( default=None, alias="resource", title="The target of the action", description=( "The resource that is the target of the action (e.g. " "CommunicationRequest)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) selectionBehavior: fhirtypes.CodeType | None = Field( default=None, alias="selectionBehavior", title="any | all | all-or-none | exactly-one | at-most-one | one-or-more", description="Defines the selection behavior for the action and its children.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "any", "all", "all-or-none", "exactly-one", "at-most-one", "one-or-more", ], }, ) selectionBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_selectionBehavior", title="Extension field for ``selectionBehavior``.", ) textEquivalent: fhirtypes.StringType | None = Field( default=None, alias="textEquivalent", title=( "Static text equivalent of the action, used if the dynamic aspects " "cannot be interpreted by the receiving system" ), description=( "A text equivalent of the action to be performed. This provides a " "human-interpretable description of the action when the definition is " "consumed by a system that may not be capable of interpreting it " "dynamically." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) textEquivalent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_textEquivalent", title="Extension field for ``textEquivalent``.", ) timingDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="timingDateTime", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timingDateTime", title="Extension field for ``timingDateTime``.", ) timingDuration: fhirtypes.DurationType | None = Field( default=None, alias="timingDuration", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="timingPeriod", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingRange: fhirtypes.RangeType | None = Field( default=None, alias="timingRange", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingTiming: fhirtypes.TimingType | None = Field( default=None, alias="timingTiming", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="User-visible title", description="The title of the action displayed to a user.", json_schema_extra={ "element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) type: fhirtypes.CodingType | None = Field( default=None, alias="type", title="create | update | remove | fire-event", description="The type of action to perform (create, update, remove).", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RequestGroupAction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "label", "title", "description", "textEquivalent", "code", "documentation", "condition", "relatedAction", "timingDateTime", "timingPeriod", "timingDuration", "timingRange", "timingTiming", "participant", "type", "groupingBehavior", "selectionBehavior", "requiredBehavior", "precheckBehavior", "cardinalityBehavior", "resource", "action", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RequestGroupAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "description", "textEquivalent"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "timing": [ "timingDateTime", "timingDuration", "timingPeriod", "timingRange", "timingTiming", ] } return one_of_many_fields class RequestGroupActionCondition(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Whether or not the action is applicable. An expression that describes applicability criteria, or start/stop conditions for the action. """ __resource_type__ = "RequestGroupActionCondition" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Natural language description of the condition", description=( "A brief, natural language description of the condition that " "effectively communicates the intended semantics." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="Boolean-valued expression", description=( "An expression that returns true or false, indicating whether or not " "the condition is satisfied." ), json_schema_extra={ "element_property": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title="applicability | start | stop", description="The kind of condition.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["applicability", "start", "stop"], }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) language: fhirtypes.StringType | None = Field( default=None, alias="language", title="Language of the expression", description="The media type of the language for the expression.", json_schema_extra={ "element_property": True, }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RequestGroupActionCondition`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "kind", "description", "language", "expression", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RequestGroupActionCondition`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("kind", "kind__ext")] return required_fields class RequestGroupActionRelatedAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Relationship to another action. A relationship to another action such as "before" or "30-60 minutes after start of". """ __resource_type__ = "RequestGroupActionRelatedAction" actionId: fhirtypes.IdType | None = Field( default=None, alias="actionId", title="What action this is related to", description="The element id of the action this is related to.", json_schema_extra={ "element_property": True, "element_required": True, }, ) actionId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_actionId", title="Extension field for ``actionId``." ) offsetDuration: fhirtypes.DurationType | None = Field( default=None, alias="offsetDuration", title="Time offset for the relationship", description=( "A duration or range of durations to apply to the relationship. For " "example, 30-60 minutes before." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e offset[x] "one_of_many": "offset", "one_of_many_required": False, }, ) offsetRange: fhirtypes.RangeType | None = Field( default=None, alias="offsetRange", title="Time offset for the relationship", description=( "A duration or range of durations to apply to the relationship. For " "example, 30-60 minutes before." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e offset[x] "one_of_many": "offset", "one_of_many_required": False, }, ) relationship: fhirtypes.CodeType | None = Field( default=None, alias="relationship", title=( "before-start | before | before-end | concurrent-with-start | " "concurrent | concurrent-with-end | after-start | after | after-end" ), description="The relationship of this action to the related action.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "before-start", "before", "before-end", "concurrent-with-start", "concurrent", "concurrent-with-end", "after-start", "after", "after-end", ], }, ) relationship__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_relationship", title="Extension field for ``relationship``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RequestGroupActionRelatedAction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "actionId", "relationship", "offsetDuration", "offsetRange", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RequestGroupActionRelatedAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("actionId", "actionId__ext"), ("relationship", "relationship__ext"), ] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"offset": ["offsetDuration", "offsetRange"]} return one_of_many_fields ================================================ FILE: fhir/resources/STU3/researchstudy.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ResearchStudy Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ResearchStudy(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Investigation to increase healthcare-related patient-independent knowledge. A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. A ResearchStudy involves the gathering of information about human or animal subjects. """ __resource_type__ = "ResearchStudy" arm: typing.List[fhirtypes.ResearchStudyArmType] | None = Field( default=None, alias="arm", title="Defined path through the study for a subject", description=( "Describes an expected sequence of events for one of the participants " "of a study. E.g. Exposure to drug A, wash-out, exposure to drug B, " "wash-out, follow-up." ), json_schema_extra={ "element_property": True, }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Classifications for the study", description=( "Codes categorizing the type of study such as investigational vs. " "observational, type of blinding, type of randomization, safety vs. " "efficacy, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the study", description=( "Contact details to assist a user in learning more about or engaging " "with the study." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="What this is study doing", description="A full description of how the study is being conducted.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) enrollment: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="enrollment", title="Inclusion & exclusion criteria", description=( "Reference to a Group that defines the criteria for and quantity of " 'subjects participating in the study. E.g. " 200 female Europeans ' 'between the ages of 20 and 45 with early onset diabetes".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) focus: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="focus", title="Drugs, devices, conditions, etc. under study", description=( "The condition(s), medication(s), food(s), therapy(ies), device(s) or " "other concerns or interventions that the study is seeking to gain more" " information about." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for study", description=( "Identifiers assigned to this research study by the sponsor or other " "systems." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Geographic region(s) for study", description=( "Indicates a country, state or other region where the study is taking " "place." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) keyword: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="keyword", title="Used to search for the study", description="Key terms to aid in searching for or filtering the study.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the event", description=( "Comments made about the event by the performer, subject or other " "participants." ), json_schema_extra={ "element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of larger study", description=( "A larger research study of which this particular study is a component " "or step." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ResearchStudy"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="When the study began and ended", description=( "Identifies the start date and the expected (or actual, depending on " "status) end date for the study." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) principalInvestigator: fhirtypes.ReferenceType | None = Field( default=None, alias="principalInvestigator", title="The individual responsible for the study", description=( "Indicates the individual who has primary oversite of the execution of " "the study." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) protocol: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="protocol", title="Steps followed in executing study", description=( "The set of steps expected to be performed as part of the execution of " "the study." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["PlanDefinition"], }, ) reasonStopped: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reasonStopped", title="Reason for terminating study early", description=( "A description and/or code explaining the premature termination of the " "study." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="References and dependencies", description="Citations, references and other related documents.", json_schema_extra={ "element_property": True, }, ) site: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="site", title="Location involved in study execution", description=( "Clinic, hospital or other healthcare location that is participating in" " the study." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) sponsor: fhirtypes.ReferenceType | None = Field( default=None, alias="sponsor", title="Organization responsible for the study", description="The organization responsible for the execution of the study.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "draft | in-progress | suspended | stopped | completed | entered-in-" "error" ), description="The current state of the study.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "draft", "in-progress", "suspended", "stopped", "completed", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this study", description="A short, descriptive user-friendly label for the study.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ResearchStudy`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "title", "protocol", "partOf", "status", "category", "focus", "contact", "relatedArtifact", "keyword", "jurisdiction", "description", "enrollment", "period", "sponsor", "principalInvestigator", "site", "reasonStopped", "note", "arm", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ResearchStudy`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "title", "protocol", "partOf", "status", "category", "focus", "contact", "keyword", "jurisdiction", "enrollment", "period", "sponsor", "principalInvestigator", "site", "reasonStopped", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class ResearchStudyArm(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Defined path through the study for a subject. Describes an expected sequence of events for one of the participants of a study. E.g. Exposure to drug A, wash-out, exposure to drug B, wash-out, follow-up. """ __resource_type__ = "ResearchStudyArm" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Categorization of study arm", description=( "Categorization of study arm, e.g. experimental, active comparator, " "placebo comparater." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Short explanation of study path", description=( "A succinct description of the path through the study that would be " "followed by a subject adhering to this arm." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Label for study arm", description="Unique, human-readable label for this arm of the study.", json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ResearchStudyArm`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "code", "description"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ResearchStudyArm`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/researchsubject.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ResearchSubject Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class ResearchSubject(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Investigation to increase healthcare-related patient-independent knowledge. A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. A ResearchStudy involves the gathering of information about human or animal subjects. """ __resource_type__ = "ResearchSubject" actualArm: fhirtypes.StringType | None = Field( default=None, alias="actualArm", title="What path was followed", description=( "The name of the arm in the study the subject actually followed as part" " of this study." ), json_schema_extra={ "element_property": True, }, ) actualArm__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_actualArm", title="Extension field for ``actualArm``." ) assignedArm: fhirtypes.StringType | None = Field( default=None, alias="assignedArm", title="What path should be followed", description=( "The name of the arm in the study the subject is expected to follow as " "part of this study." ), json_schema_extra={ "element_property": True, }, ) assignedArm__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_assignedArm", title="Extension field for ``assignedArm``." ) consent: fhirtypes.ReferenceType | None = Field( default=None, alias="consent", title="Agreement to participate in study", description=( "A record of the patient's informed agreement to participate in the " "study." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Consent"], }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Business Identifier for research subject", description=( "Identifiers assigned to this research study by the sponsor or other " "systems." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) individual: fhirtypes.ReferenceType = Field( default=..., alias="individual", title="Who is part of study", description="The record of the person or animal who is involved in the study.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Start and end of participation", description=( "The dates the subject began and ended their participation in the " "study." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="candidate | enrolled | active | suspended | withdrawn | completed", description="The current state of the subject.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "candidate", "enrolled", "active", "suspended", "withdrawn", "completed", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) study: fhirtypes.ReferenceType = Field( default=..., alias="study", title="Study subject is part of", description="Reference to the study the subject is participating in.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ResearchStudy"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ResearchSubject`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "period", "study", "individual", "assignedArm", "actualArm", "consent", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ResearchSubject`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "period", "study", "individual", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/resource.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Resource Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import fhirresourcemodel, fhirtypes class Resource(fhirresourcemodel.FHIRResourceModel): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Base Resource. This is the base resource type for everything. """ __resource_type__ = "Resource" id: fhirtypes.IdType | None = Field( default=None, alias="id", title="Logical id of this artifact", description=( "The logical id of the resource, as used in the URL for the resource. " "Once assigned, this value never changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) implicitRules: fhirtypes.UriType | None = Field( default=None, alias="implicitRules", title="A set of rules under which this content was created", description=( "A reference to a set of rules that were followed when the resource was" " constructed, and which must be understood when processing the " "content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) implicitRules__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_implicitRules", title="Extension field for ``implicitRules``.", ) language: fhirtypes.CodeType | None = Field( default=None, alias="language", title="Language of the resource content", description="The base language in which the resource is written.", json_schema_extra={ "element_property": True, }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) meta: fhirtypes.MetaType | None = Field( default=None, alias="meta", title="Metadata about the resource", description=( "The metadata about the resource. This is content that is maintained by" " the infrastructure. Changes to the content may not always be " "associated with version changes to the resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Resource`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "language"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Resource`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules"] ================================================ FILE: fhir/resources/STU3/riskassessment.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/RiskAssessment Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class RiskAssessment(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Potential outcomes for a subject with likelihood. An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. """ __resource_type__ = "RiskAssessment" basedOn: fhirtypes.ReferenceType | None = Field( default=None, alias="basedOn", title="Request fulfilled by this assessment", description="A reference to the request that is fulfilled by this risk assessment.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) basis: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basis", title="Information used in assessment", description=( "Indicates the source data considered as part of the assessment " "(FamilyHistory, Observations, Procedures, Conditions, etc.)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Type of assessment", description="The type of the risk assessment performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Comments on the risk assessment", description="Additional comments about the risk assessment.", json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) condition: fhirtypes.ReferenceType | None = Field( default=None, alias="condition", title="Condition assessed", description=( "For assessments or prognosis specific to a particular condition, " "indicates the condition being assessed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Where was assessment performed?", description="The encounter where the assessment was performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Unique identifier for the assessment", description="Business identifier assigned to the risk assessment.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="Evaluation mechanism", description="The algorithm, process or mechanism used to evaluate the risk.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) mitigation: fhirtypes.StringType | None = Field( default=None, alias="mitigation", title="How to reduce risk", description=( "A description of the steps that might be taken to reduce the " "identified risk(s)." ), json_schema_extra={ "element_property": True, }, ) mitigation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mitigation", title="Extension field for ``mitigation``." ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When was assessment made?", description="The date (and possibly time) the risk assessment was performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="When was assessment made?", description="The date (and possibly time) the risk assessment was performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) parent: fhirtypes.ReferenceType | None = Field( default=None, alias="parent", title="Part of this occurrence", description=( "A reference to a resource that this risk assessment is part of, such " "as a Procedure." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) performer: fhirtypes.ReferenceType | None = Field( default=None, alias="performer", title="Who did assessment?", description="The provider or software application that performed the assessment.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "Device"], }, ) prediction: typing.List[fhirtypes.RiskAssessmentPredictionType] | None = Field( default=None, alias="prediction", title="Outcome predicted", description="Describes the expected outcome for the subject.", json_schema_extra={ "element_property": True, }, ) reasonCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reasonCodeableConcept", title="Why the assessment was necessary?", description="The reason the risk assessment was performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e reason[x] "one_of_many": "reason", "one_of_many_required": False, }, ) reasonReference: fhirtypes.ReferenceType | None = Field( default=None, alias="reasonReference", title="Why the assessment was necessary?", description="The reason the risk assessment was performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e reason[x] "one_of_many": "reason", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="registered | preliminary | final | amended +", description=( "The status of the RiskAssessment, using the same statuses as an " "Observation." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["registered", "preliminary", "final", "amended", "+"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Who/what does assessment apply to?", description="The patient or group the risk assessment applies to.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RiskAssessment`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "parent", "status", "method", "code", "subject", "context", "occurrenceDateTime", "occurrencePeriod", "condition", "performer", "reasonCodeableConcept", "reasonReference", "basis", "prediction", "mitigation", "comment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RiskAssessment`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "method", "code", "subject", "context", "occurrenceDateTime", "occurrencePeriod", "condition", "performer", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "occurrence": ["occurrenceDateTime", "occurrencePeriod"], "reason": ["reasonCodeableConcept", "reasonReference"], } return one_of_many_fields class RiskAssessmentPrediction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Outcome predicted. Describes the expected outcome for the subject. """ __resource_type__ = "RiskAssessmentPrediction" outcome: fhirtypes.CodeableConceptType = Field( default=..., alias="outcome", title="Possible outcome for the subject", description=( "One of the potential outcomes for the patient (e.g. remission, death," " a particular condition)." ), json_schema_extra={ "element_property": True, }, ) probabilityDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="probabilityDecimal", title="Likelihood of specified outcome", description="How likely is the outcome (in the specified timeframe).", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e probability[x] "one_of_many": "probability", "one_of_many_required": False, }, ) probabilityDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_probabilityDecimal", title="Extension field for ``probabilityDecimal``.", ) probabilityRange: fhirtypes.RangeType | None = Field( default=None, alias="probabilityRange", title="Likelihood of specified outcome", description="How likely is the outcome (in the specified timeframe).", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e probability[x] "one_of_many": "probability", "one_of_many_required": False, }, ) qualitativeRisk: fhirtypes.CodeableConceptType | None = Field( default=None, alias="qualitativeRisk", title="Likelihood of specified outcome as a qualitative value", description=( "How likely is the outcome (in the specified timeframe), expressed as a" " qualitative value (e.g. low, medium, high)." ), json_schema_extra={ "element_property": True, }, ) rationale: fhirtypes.StringType | None = Field( default=None, alias="rationale", title="Explanation of prediction", description="Additional information explaining the basis for the prediction.", json_schema_extra={ "element_property": True, }, ) rationale__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rationale", title="Extension field for ``rationale``." ) relativeRisk: fhirtypes.DecimalType | None = Field( default=None, alias="relativeRisk", title="Relative likelihood", description=( "Indicates the risk for this particular subject (with their specific " "characteristics) divided by the risk of the population in general. " "(Numbers greater than 1 = higher risk than the population, numbers " "less than 1 = lower risk.)." ), json_schema_extra={ "element_property": True, }, ) relativeRisk__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_relativeRisk", title="Extension field for ``relativeRisk``.", ) whenPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="whenPeriod", title="Timeframe or age range", description=( "Indicates the period of time or age range of the subject to which the " "specified probability applies." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e when[x] "one_of_many": "when", "one_of_many_required": False, }, ) whenRange: fhirtypes.RangeType | None = Field( default=None, alias="whenRange", title="Timeframe or age range", description=( "Indicates the period of time or age range of the subject to which the " "specified probability applies." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e when[x] "one_of_many": "when", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RiskAssessmentPrediction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "outcome", "probabilityDecimal", "probabilityRange", "qualitativeRisk", "relativeRisk", "whenPeriod", "whenRange", "rationale", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RiskAssessmentPrediction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "probability": ["probabilityDecimal", "probabilityRange"], "when": ["whenPeriod", "whenRange"], } return one_of_many_fields ================================================ FILE: fhir/resources/STU3/sampleddata.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SampledData Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class SampledData(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A series of measurements taken by a device. A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data. """ __resource_type__ = "SampledData" data: fhirtypes.StringType | None = Field( default=None, alias="data", title='Decimal values with spaces, or "E" | "U" | "L"', description=( "A series of data points which are decimal values separated by a single" ' space (character u20). The special values "E" (error), "L" (below ' 'detection limit) and "U" (above detection limit) can also be used in ' "place of a decimal value." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) data__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_data", title="Extension field for ``data``." ) dimensions: fhirtypes.PositiveIntType | None = Field( default=None, alias="dimensions", title="Number of sample points at each time point", description=( "The number of sample points at each time point. If this value is " "greater than one, then the dimensions will be interlaced - all the " "sample points for a point in time will be recorded at once." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) dimensions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dimensions", title="Extension field for ``dimensions``." ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Multiply data by this before adding to origin", description=( "A correction factor that is applied to the sampled data points before " "they are added to the origin." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) lowerLimit: fhirtypes.DecimalType | None = Field( default=None, alias="lowerLimit", title="Lower limit of detection", description=( "The lower limit of detection of the measured points. This is needed if" ' any of the data points have the value "L" (lower than detection ' "limit)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lowerLimit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lowerLimit", title="Extension field for ``lowerLimit``." ) origin: fhirtypes.QuantityType = Field( default=..., alias="origin", title="Zero value and units", description=( "The base quantity that a measured value of zero represents. In " "addition, this provides the units of the entire measurement series." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) period: fhirtypes.DecimalType | None = Field( default=None, alias="period", title="Number of milliseconds between samples", description="The length of time between sampling times, measured in milliseconds.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) period__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_period", title="Extension field for ``period``." ) upperLimit: fhirtypes.DecimalType | None = Field( default=None, alias="upperLimit", title="Upper limit of detection", description=( "The upper limit of detection of the measured points. This is needed if" ' any of the data points have the value "U" (higher than detection ' "limit)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) upperLimit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_upperLimit", title="Extension field for ``upperLimit``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SampledData`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "origin", "period", "factor", "lowerLimit", "upperLimit", "dimensions", "data", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SampledData`` according to specification, with preserving the original sequence order. """ return ["origin", "period", "factor", "lowerLimit", "upperLimit", "dimensions"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("data", "data__ext"), ("dimensions", "dimensions__ext"), ("period", "period__ext"), ] return required_fields ================================================ FILE: fhir/resources/STU3/schedule.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Schedule Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class Schedule(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A container for slots of time that may be available for booking appointments. """ __resource_type__ = "Schedule" active: bool | None = Field( default=None, alias="active", title="Whether this schedule is in active use", description=( "Whether this schedule record is in active use, or should not be used " "(such as was entered in error)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) actor: typing.List[fhirtypes.ReferenceType] = Field( default=..., alias="actor", title=( "The resource this Schedule resource is providing availability " "information for. These are expected to usually be one of " "HealthcareService, Location, Practitioner, PractitionerRole, Device, " "Patient or RelatedPerson" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Device", "HealthcareService", "Location", ], }, ) comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title=( "Comments on the availability to describe any extended information. " "Such as custom constraints on the slots that may be associated" ), description=None, json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Ids for this item", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) planningHorizon: fhirtypes.PeriodType | None = Field( default=None, alias="planningHorizon", title=( "The period of time that the slots that are attached to this Schedule " "resource cover (even if none exist). These cover the amount of time " "that an organization's planning horizon; the interval for which they " "are currently accepting appointments. This does not define a " '"template" for planning outside these dates' ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) serviceCategory: fhirtypes.CodeableConceptType | None = Field( default=None, alias="serviceCategory", title=( "A broad categorisation of the service that is to be performed during " "this appointment" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) serviceType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="serviceType", title="The specific service that is to be performed during this appointment", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialty", title=( "The specialty of a practitioner that would be required to perform the " "service requested in this appointment" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Schedule`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "serviceCategory", "serviceType", "specialty", "actor", "planningHorizon", "comment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Schedule`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "active", "serviceCategory", "serviceType", "specialty", "actor", "planningHorizon", ] ================================================ FILE: fhir/resources/STU3/searchparameter.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SearchParameter Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class SearchParameter(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Search Parameter for a resource. A search parameter that defines a named search item that can be used to search/filter on a resource. """ __resource_type__ = "SearchParameter" base: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="base", title="The resource type(s) this search parameter applies to", description=( "The base resource type(s) that this search parameter can be used " "against." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) base__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_base", title="Extension field for ``base``." ) chain: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="chain", title="Chained names supported", description=( "Contains the names of any search parameters which may be chained to " "the containing search parameter. Chained parameters may be added to " "search parameters of type reference, and specify that resources will " "only be returned if they contain a reference to a resource which " "matches the chained parameter value. Values for this field should be " "drawn from SearchParameter.code for a parameter on the target resource" " type." ), json_schema_extra={ "element_property": True, }, ) chain__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_chain", title="Extension field for ``chain``." ) code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Code used in URL", description=( "The code used in the URL or the parameter name in a parameters " "resource for this search parameter." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) comparator: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="comparator", title="eq | ne | gt | lt | ge | le | sa | eb | ap", description="Comparators supported for the search parameter.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["eq", "ne", "gt", "lt", "ge", "le", "sa", "eb", "ap"], }, ) comparator__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_comparator", title="Extension field for ``comparator``." ) component: typing.List[fhirtypes.SearchParameterComponentType] | None = Field( default=None, alias="component", title="For Composite resources to define the parts", description="Used to define the parts of a composite search parameter.", json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date this was last changed", description=( "The date (and optionally time) when the search parameter was " "published. The date must change if and when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the search parameter " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) derivedFrom: fhirtypes.UriType | None = Field( default=None, alias="derivedFrom", title="Original Definition for the search parameter", description=( "Where this search parameter is originally defined. If a derivedFrom is" " provided, then the details in the search parameter must be consistent" " with the definition from which it is defined. I.e. the parameter " "should have the same meaning, and (usually) the functionality should " "be a proper subset of the underlying search parameter." ), json_schema_extra={ "element_property": True, }, ) derivedFrom__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_derivedFrom", title="Extension field for ``derivedFrom``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the search parameter", description=( "A free text natural language description of the search parameter from " "a consumer's perspective. and how it used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A boolean value to indicate that this search parameter is authored for" " testing purposes (or education/evaluation/marketing), and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="FHIRPath expression that extracts the values", description=( "A FHIRPath expression that returns a set of elements for the search " "parameter." ), json_schema_extra={ "element_property": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for search parameter (if applicable)", description=( "A legal or geographic region in which the search parameter is intended" " to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) modifier: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="modifier", title=( "missing | exact | contains | not | text | in | not-in | below | above " "| type" ), description="A modifier supported for the search parameter.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "missing", "exact", "contains", "not", "text", "in", "not-in", "below", "above", "type", ], }, ) modifier__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_modifier", title="Extension field for ``modifier``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this search parameter (computer friendly)", description=( "A natural language name identifying the search parameter. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the individual or organization that published the search " "parameter." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this search parameter is defined", description=( "Explaination of why this search parameter is needed and why it has " "been designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this search parameter. Enables tracking the life-cycle " "of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) target: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="target", title="Types of resource (if a resource reference)", description="Types of resource (if a resource is referenced).", json_schema_extra={ "element_property": True, }, ) target__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_target", title="Extension field for ``target``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "number | date | string | token | reference | composite | quantity | " "uri" ), description=( "The type of value a search parameter refers to, and how the content is" " interpreted." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "number", "date", "string", "token", "reference", "composite", "quantity", "uri", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Logical URI to reference this search parameter (globally unique)", description=( "An absolute URI that is used to identify this search parameter when it" " is referenced in a specification, model, design or an instance. This " "SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at" " which this search parameter is (or will be) published. The URL SHOULD" " include the major version of the search parameter. For more " "information see [Technical and Business " "Versions](resource.html#versions)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Context the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching for appropriate search parameter instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the search parameter", description=( "The identifier that is used to identify this version of the search " "parameter when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the search parameter " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) xpath: fhirtypes.StringType | None = Field( default=None, alias="xpath", title="XPath that extracts the values", description=( "An XPath expression that returns a set of elements for the search " "parameter." ), json_schema_extra={ "element_property": True, }, ) xpath__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_xpath", title="Extension field for ``xpath``." ) xpathUsage: fhirtypes.CodeType | None = Field( default=None, alias="xpathUsage", title="normal | phonetic | nearby | distance | other", description=( "How the search parameter relates to the set of elements returned by " "evaluating the xpath query." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["normal", "phonetic", "nearby", "distance", "other"], }, ) xpathUsage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_xpathUsage", title="Extension field for ``xpathUsage``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SearchParameter`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "version", "name", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "purpose", "code", "base", "type", "derivedFrom", "description", "expression", "xpath", "xpathUsage", "target", "comparator", "modifier", "chain", "component", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SearchParameter`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "version", "name", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "code", "base", "type", "description", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("base", "base__ext"), ("code", "code__ext"), ("description", "description__ext"), ("name", "name__ext"), ("status", "status__ext"), ("type", "type__ext"), ("url", "url__ext"), ] return required_fields class SearchParameterComponent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. For Composite resources to define the parts. Used to define the parts of a composite search parameter. """ __resource_type__ = "SearchParameterComponent" definition: fhirtypes.ReferenceType = Field( default=..., alias="definition", title="Defines how the part works", description="The definition of the search parameter that describes this part.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SearchParameter"], }, ) expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="Subexpression relative to main expression", description=( "A sub-expression that defines how to extract values for this component" " from the output of the main SearchParameter.expression." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SearchParameterComponent`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "definition", "expression"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SearchParameterComponent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("expression", "expression__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/sequence.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Sequence Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Sequence(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about a biological sequence. Raw data describing a biological sequence. """ __resource_type__ = "Sequence" coordinateSystem: fhirtypes.IntegerType | None = Field( default=None, alias="coordinateSystem", title=( "Base number of coordinate system (0 for 0-based numbering or " "coordinates, inclusive start, exclusive end, 1 for 1-based numbering, " "inclusive start, inclusive end)" ), description=( "Whether the sequence is numbered starting at 0 (0-based numbering or " "coordinates, inclusive start, exclusive end) or starting at 1 (1-based" " numbering, inclusive start and inclusive end)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) coordinateSystem__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_coordinateSystem", title="Extension field for ``coordinateSystem``.", ) device: fhirtypes.ReferenceType | None = Field( default=None, alias="device", title="The method for sequencing", description="The method for sequencing, for example, chip information.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique ID for this particular sequence. This is a FHIR-defined id", description=( "A unique identifier for this particular sequence instance. This is a " "FHIR-defined id." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) observedSeq: fhirtypes.StringType | None = Field( default=None, alias="observedSeq", title="Sequence that was observed", description=( "Sequence that was observed. It is the result marked by referenceSeq " "along with variant records on referenceSeq. This shall starts from " "referenceSeq.windowStart and end by referenceSeq.windowEnd." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) observedSeq__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_observedSeq", title="Extension field for ``observedSeq``." ) patient: fhirtypes.ReferenceType | None = Field( default=None, alias="patient", title="Who and/or what this is about", description="The patient whose sequencing results are described by this resource.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) performer: fhirtypes.ReferenceType | None = Field( default=None, alias="performer", title="Who should be responsible for test result", description="The organization or lab that should be responsible for this result.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) pointer: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="pointer", title="Pointer to next atomic sequence", description="Pointer to next atomic sequence which at most contains one variant.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Sequence"], }, ) quality: typing.List[fhirtypes.SequenceQualityType] | None = Field( default=None, alias="quality", title="An set of value as quality of sequence", description=( "An experimental feature attribute that defines the quality of the " "feature in a quantitative way, such as a phred quality score ([SO:0001" "686](http://www.sequenceontology.org/browser/current_svn/term/SO:00016" "86))." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="The number of copies of the seqeunce of interest. (RNASeq)", description="The number of copies of the seqeunce of interest. (RNASeq).", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) readCoverage: fhirtypes.IntegerType | None = Field( default=None, alias="readCoverage", title=( "Average number of reads representing a given nucleotide in the " "reconstructed sequence" ), description=( "Coverage (read depth or depth) is the average number of reads " "representing a given nucleotide in the reconstructed sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) readCoverage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_readCoverage", title="Extension field for ``readCoverage``.", ) referenceSeq: fhirtypes.SequenceReferenceSeqType | None = Field( default=None, alias="referenceSeq", title="A sequence used as reference", description=( "A sequence that is used as a reference to describe variants that are " "present in a sequence analyzed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) repository: typing.List[fhirtypes.SequenceRepositoryType] | None = Field( default=None, alias="repository", title=( "External repository which contains detailed report related with " "observedSeq in this resource" ), description=( "Configurations of the external repository. The repository shall store " "target's observedSeq or records related with target's observedSeq." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) specimen: fhirtypes.ReferenceType | None = Field( default=None, alias="specimen", title="Specimen used for sequencing", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Specimen"], }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="aa | dna | rna", description="Amino Acid Sequence/ DNA Sequence / RNA Sequence.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["aa", "dna", "rna"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) variant: typing.List[fhirtypes.SequenceVariantType] | None = Field( default=None, alias="variant", title="Variant in sequence", description=( "The definition of variant here originates from Sequence ontology ([var" "iant_of](http://www.sequenceontology.org/browser/current_svn/term/vari" "ant_of)). This element can represent amino acid or nucleic sequence " "change(including insertion,deletion,SNP,etc.) It can represent some " "complex mutation or segment variation with the assist of CIGAR string." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Sequence`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "type", "coordinateSystem", "patient", "specimen", "device", "performer", "quantity", "referenceSeq", "variant", "observedSeq", "quality", "readCoverage", "repository", "pointer", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Sequence`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "type", "coordinateSystem", "patient", "specimen", "device", "performer", "quantity", "referenceSeq", "variant", "observedSeq", "quality", "readCoverage", "repository", "pointer", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("coordinateSystem", "coordinateSystem__ext")] return required_fields class SequenceQuality(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An set of value as quality of sequence. An experimental feature attribute that defines the quality of the feature in a quantitative way, such as a phred quality score ([SO:0001686](http://w ww.sequenceontology.org/browser/current_svn/term/SO:0001686)). """ __resource_type__ = "SequenceQuality" end: fhirtypes.IntegerType | None = Field( default=None, alias="end", title="End position of the sequence", description=( "End position of the sequence.If the coordinate system is 0-based then " "end is is exclusive and does not include the last position. If the " "coordinate system is 1-base, then end is inclusive and includes the " "last position." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_end", title="Extension field for ``end``." ) fScore: fhirtypes.DecimalType | None = Field( default=None, alias="fScore", title="F-score", description=( "Harmonic mean of Recall and Precision, computed as: 2 * precision * " "recall / (precision + recall)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) fScore__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fScore", title="Extension field for ``fScore``." ) gtFP: fhirtypes.DecimalType | None = Field( default=None, alias="gtFP", title=( "False positives where the non-REF alleles in the Truth and Query Call " "Sets match" ), description=( "The number of false positives where the non-REF alleles in the Truth " "and Query Call Sets match (i.e. cases where the truth is 1/1 and the " "query is 0/1 or similar)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) gtFP__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_gtFP", title="Extension field for ``gtFP``." ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="Method to get quality", description="Which method is used to get sequence quality.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) precision: fhirtypes.DecimalType | None = Field( default=None, alias="precision", title="Precision of comparison", description="QUERY.TP / (QUERY.TP + QUERY.FP).", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) precision__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_precision", title="Extension field for ``precision``." ) queryFP: fhirtypes.DecimalType | None = Field( default=None, alias="queryFP", title="False positives", description=( "False positives, i.e. the number of sites in the Query Call Set for " "which there is no path through the Truth Call Set that is consistent " "with this site. Sites with correct variant but incorrect genotype are " "counted here." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) queryFP__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_queryFP", title="Extension field for ``queryFP``." ) queryTP: fhirtypes.DecimalType | None = Field( default=None, alias="queryTP", title="True positives from the perspective of the query data", description=( "True positives, from the perspective of the query data, i.e. the " "number of sites in the Query Call Set for which there are paths " "through the Truth Call Set that are consistent with all of the alleles" " at this site, and for which there is an accurate genotype call for " "the event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) queryTP__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_queryTP", title="Extension field for ``queryTP``." ) recall: fhirtypes.DecimalType | None = Field( default=None, alias="recall", title="Recall of comparison", description="TRUTH.TP / (TRUTH.TP + TRUTH.FN).", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) recall__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recall", title="Extension field for ``recall``." ) score: fhirtypes.QuantityType | None = Field( default=None, alias="score", title="Quality score for the comparison", description=( "The score of an experimentally derived feature such as a p-value ([SO:" "0001685](http://www.sequenceontology.org/browser/current_svn/term/SO:0" "001685))." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) standardSequence: fhirtypes.CodeableConceptType | None = Field( default=None, alias="standardSequence", title="Standard sequence for comparison", description="Gold standard sequence used for comparing against.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) start: fhirtypes.IntegerType | None = Field( default=None, alias="start", title="Start position of the sequence", description=( "Start position of the sequence. If the coordinate system is either " "0-based or 1-based, then start position is inclusive." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_start", title="Extension field for ``start``." ) truthFN: fhirtypes.DecimalType | None = Field( default=None, alias="truthFN", title="False negatives", description=( "False negatives, i.e. the number of sites in the Truth Call Set for " "which there is no path through the Query Call Set that is consistent " "with all of the alleles at this site, or sites for which there is an " "inaccurate genotype call for the event. Sites with correct variant but" " incorrect genotype are counted here." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) truthFN__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_truthFN", title="Extension field for ``truthFN``." ) truthTP: fhirtypes.DecimalType | None = Field( default=None, alias="truthTP", title="True positives from the perspective of the truth data", description=( "True positives, from the perspective of the truth data, i.e. the " "number of sites in the Truth Call Set for which there are paths " "through the Query Call Set that are consistent with all of the alleles" " at this site, and for which there is an accurate genotype call for " "the event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) truthTP__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_truthTP", title="Extension field for ``truthTP``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="indel | snp | unknown", description="INDEL / SNP / Undefined variant.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["indel", "snp", "unknown"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SequenceQuality`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "standardSequence", "start", "end", "score", "method", "truthTP", "queryTP", "truthFN", "queryFP", "gtFP", "precision", "recall", "fScore", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SequenceQuality`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "standardSequence", "start", "end", "score", "method", "truthTP", "queryTP", "truthFN", "queryFP", "gtFP", "precision", "recall", "fScore", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields class SequenceReferenceSeq(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A sequence used as reference. A sequence that is used as a reference to describe variants that are present in a sequence analyzed. """ __resource_type__ = "SequenceReferenceSeq" chromosome: fhirtypes.CodeableConceptType | None = Field( default=None, alias="chromosome", title="Chromosome containing genetic finding", description=( "Structural unit composed of a nucleic acid molecule which controls its" " own replication through the interaction of specific proteins at one " "or more origins of replication ([SO:0000340](http://www.sequenceontolo" "gy.org/browser/current_svn/term/SO:0000340))." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) genomeBuild: fhirtypes.StringType | None = Field( default=None, alias="genomeBuild", title=( "The Genome Build used for reference, following GRCh build versions " "e.g. 'GRCh 37'" ), description=( "The Genome Build used for reference, following GRCh build versions " "e.g. 'GRCh 37'. Version number must be included if a versioned " "release of a primary build was used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) genomeBuild__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_genomeBuild", title="Extension field for ``genomeBuild``." ) referenceSeqId: fhirtypes.CodeableConceptType | None = Field( default=None, alias="referenceSeqId", title="Reference identifier", description=( "Reference identifier of reference sequence submitted to NCBI. It must " "match the type in the Sequence.type field. For example, the prefix, " "\u201cNG_\u201d identifies reference sequence for genes, \u201cNM_\u201d for messenger RNA" " transcripts, and \u201cNP_\u201d for amino acid sequences." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) referenceSeqPointer: fhirtypes.ReferenceType | None = Field( default=None, alias="referenceSeqPointer", title="A Pointer to another Sequence entity as reference sequence", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Sequence"], }, ) referenceSeqString: fhirtypes.StringType | None = Field( default=None, alias="referenceSeqString", title="A string to represent reference sequence", description='A string like "ACGT".', json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) referenceSeqString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_referenceSeqString", title="Extension field for ``referenceSeqString``.", ) strand: fhirtypes.IntegerType | None = Field( default=None, alias="strand", title="Directionality of DNA ( +1/-1)", description=( 'Directionality of DNA sequence. Available values are "1" for the plus ' "strand (5' to 3')/Watson/Sense/positive and \"-1\" for the minus " "strand(3' to 5')/Crick/Antisense/negative." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) strand__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_strand", title="Extension field for ``strand``." ) windowEnd: fhirtypes.IntegerType | None = Field( default=None, alias="windowEnd", title="End position of the window on the reference sequence", description=( "End position of the window on the reference sequence. If the " "coordinate system is 0-based then end is is exclusive and does not " "include the last position. If the coordinate system is 1-base, then " "end is inclusive and includes the last position." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) windowEnd__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_windowEnd", title="Extension field for ``windowEnd``." ) windowStart: fhirtypes.IntegerType | None = Field( default=None, alias="windowStart", title="Start position of the window on the reference sequence", description=( "Start position of the window on the reference sequence. If the " "coordinate system is either 0-based or 1-based, then start position is" " inclusive." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) windowStart__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_windowStart", title="Extension field for ``windowStart``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SequenceReferenceSeq`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "chromosome", "genomeBuild", "referenceSeqId", "referenceSeqPointer", "referenceSeqString", "strand", "windowStart", "windowEnd", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SequenceReferenceSeq`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "chromosome", "genomeBuild", "referenceSeqId", "referenceSeqPointer", "referenceSeqString", "strand", "windowStart", "windowEnd", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("windowEnd", "windowEnd__ext"), ("windowStart", "windowStart__ext"), ] return required_fields class SequenceRepository(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. External repository which contains detailed report related with observedSeq in this resource. Configurations of the external repository. The repository shall store target's observedSeq or records related with target's observedSeq. """ __resource_type__ = "SequenceRepository" datasetId: fhirtypes.StringType | None = Field( default=None, alias="datasetId", title="Id of the dataset that used to call for dataset in repository", description=( "Id of the variant in this external repository. The server will " "understand how to use this id to call for more info about datasets in " "external repository." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) datasetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_datasetId", title="Extension field for ``datasetId``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Repository's name", description=( "URI of an external repository which contains further details about the" " genetics data." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) readsetId: fhirtypes.StringType | None = Field( default=None, alias="readsetId", title="Id of the read", description="Id of the read in this external repository.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) readsetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_readsetId", title="Extension field for ``readsetId``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="directlink | openapi | login | oauth | other", description=( "Click and see / RESTful API / Need login to see / RESTful API with " "authentication / Other ways to see resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["directlink", "openapi", "login", "oauth", "other"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="URI of the repository", description=( "URI of an external repository which contains further details about the" " genetics data." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) variantsetId: fhirtypes.StringType | None = Field( default=None, alias="variantsetId", title="Id of the variantset that used to call for variantset in repository", description=( "Id of the variantset in this external repository. The server will " "understand how to use this id to call for more info about variantsets " "in external repository." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) variantsetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_variantsetId", title="Extension field for ``variantsetId``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SequenceRepository`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "url", "name", "datasetId", "variantsetId", "readsetId", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SequenceRepository`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "url", "name", "datasetId", "variantsetId", "readsetId", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields class SequenceVariant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Variant in sequence. The definition of variant here originates from Sequence ontology ([variant_ of](http://www.sequenceontology.org/browser/current_svn/term/variant_of)). This element can represent amino acid or nucleic sequence change(including insertion,deletion,SNP,etc.) It can represent some complex mutation or segment variation with the assist of CIGAR string. """ __resource_type__ = "SequenceVariant" cigar: fhirtypes.StringType | None = Field( default=None, alias="cigar", title="Extended CIGAR string for aligning the sequence with reference bases", description=( "Extended CIGAR string for aligning the sequence with reference bases. " "See detailed documentation [here](http://support.illumina.com/help/Seq" "uencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/" "CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) cigar__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_cigar", title="Extension field for ``cigar``." ) end: fhirtypes.IntegerType | None = Field( default=None, alias="end", title="End position of the variant on the reference sequence", description=( "End position of the variant on the reference sequence.If the " "coordinate system is 0-based then end is is exclusive and does not " "include the last position. If the coordinate system is 1-base, then " "end is inclusive and includes the last position." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_end", title="Extension field for ``end``." ) observedAllele: fhirtypes.StringType | None = Field( default=None, alias="observedAllele", title="Allele that was observed", description=( "An allele is one of a set of coexisting sequence variants of a gene ([" "SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/S" "O:0001023)). Nucleotide(s)/amino acids from start position of " "sequence to stop position of sequence on the positive (+) strand of " "the observed sequence. When the sequence type is DNA, it should be " "the sequence on the positive (+) strand. This will lay in the range " "between variant.start and variant.end." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) observedAllele__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_observedAllele", title="Extension field for ``observedAllele``.", ) referenceAllele: fhirtypes.StringType | None = Field( default=None, alias="referenceAllele", title="Allele in the reference sequence", description=( "An allele is one of a set of coexisting sequence variants of a gene ([" "SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/S" "O:0001023)). Nucleotide(s)/amino acids from start position of sequence" " to stop position of sequence on the positive (+) strand of the " "reference sequence. When the sequence type is DNA, it should be the " "sequence on the positive (+) strand. This will lay in the range " "between variant.start and variant.end." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) referenceAllele__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_referenceAllele", title="Extension field for ``referenceAllele``.", ) start: fhirtypes.IntegerType | None = Field( default=None, alias="start", title="Start position of the variant on the reference sequence", description=( "Start position of the variant on the reference sequence.If the " "coordinate system is either 0-based or 1-based, then start position is" " inclusive." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_start", title="Extension field for ``start``." ) variantPointer: fhirtypes.ReferenceType | None = Field( default=None, alias="variantPointer", title="Pointer to observed variant information", description="A pointer to an Observation containing variant information.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Observation"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SequenceVariant`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "start", "end", "observedAllele", "referenceAllele", "cigar", "variantPointer", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SequenceVariant`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "start", "end", "observedAllele", "referenceAllele", "cigar", "variantPointer", ] ================================================ FILE: fhir/resources/STU3/servicedefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ServiceDefinition Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class ServiceDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A description of decision support service functionality. The ServiceDefinition describes a unit of decision support functionality that is made available as a service, such as immunization modules or drug- drug interaction checking. """ __resource_type__ = "ServiceDefinition" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the service definition was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contributor: typing.List[fhirtypes.ContributorType] | None = Field( default=None, alias="contributor", title="A content contributor", description=( "A contributor to the content of the module, including authors, " "editors, reviewers, and endorsers." ), json_schema_extra={ "element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the service definition and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the service definition." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) dataRequirement: typing.List[fhirtypes.DataRequirementType] | None = Field( default=None, alias="dataRequirement", title="What data is used by the module", description=( "Data requirements are a machine processable description of the data " "required by the module in order to perform a successful evaluation." ), json_schema_extra={ "element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date this was last changed", description=( "The date (and optionally time) when the service definition was " "published. The date must change if and when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the service definition " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the service definition", description=( "A free text natural language description of the service definition " "from a consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the service definition is expected to be used", description=( "The period during which the service definition content was or is " "planned to be in active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A boolean value to indicate that this service definition is authored " "for testing purposes (or education/evaluation/marketing), and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the service definition", description=( "A formal identifier that is used to identify this service definition " "when it is represented in other formats, or referenced in a " "specification, model, design or an instance. This is used for CMS or " "NQF identifiers for a measure artifact. Note that at least one " "identifier is required for non-experimental active artifacts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for service definition (if applicable)", description=( "A legal or geographic region in which the service definition is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the service definition was last reviewed", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval, but doesn't change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this service definition (computer friendly)", description=( "A natural language name identifying the service definition. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) operationDefinition: fhirtypes.ReferenceType | None = Field( default=None, alias="operationDefinition", title="Operation to invoke", description="A reference to the operation that is used to invoke this service.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["OperationDefinition"], }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the individual or organization that published the service " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this service definition is defined", description=( "Explaination of why this service definition is needed and why it has " "been designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Additional documentation, citations, etc", description=( "Related resources such as additional documentation, justification, or " "bibliographic references." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this service definition. Enables tracking the life-cycle" " of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this service definition (human friendly)", description="A short, descriptive, user-friendly title for the service definition.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) topic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="topic", title="E.g. Education, Treatment, Assessment, etc", description=( "Descriptive topics related to the module. Topics provide a high-level " "categorization of the module that can be useful for filtering and " "searching." ), json_schema_extra={ "element_property": True, }, ) trigger: typing.List[fhirtypes.TriggerDefinitionType] | None = Field( default=None, alias="trigger", title='"when" the module should be invoked', description=( "The trigger element defines when the rule should be invoked. This " "information is used by consumers of the rule to determine how to " "integrate the rule into a specific workflow." ), json_schema_extra={ "element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Logical URI to reference this service definition (globally unique)", description=( "An absolute URI that is used to identify this service definition when " "it is referenced in a specification, model, design or an instance. " "This SHALL be a URL, SHOULD be globally unique, and SHOULD be an " "address at which this service definition is (or will be) published. " "The URL SHOULD include the major version of the service definition. " "For more information see [Technical and Business " "Versions](resource.html#versions)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) usage: fhirtypes.StringType | None = Field( default=None, alias="usage", title="Describes the clinical usage of the module", description=( "A detailed description of how the module is used from a clinical " "perspective." ), json_schema_extra={ "element_property": True, }, ) usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usage", title="Extension field for ``usage``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Context the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching for appropriate service definition instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the service definition", description=( "The identifier that is used to identify this version of the service " "definition when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the service definition" " author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ServiceDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "description", "purpose", "usage", "approvalDate", "lastReviewDate", "effectivePeriod", "useContext", "jurisdiction", "topic", "contributor", "contact", "copyright", "relatedArtifact", "trigger", "dataRequirement", "operationDefinition", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ServiceDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "effectivePeriod", "useContext", "jurisdiction", "contact", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/signature.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Signature Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Signature(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A digital Signature - XML DigSig, JWT, Graphical image of signature, etc.. A digital signature along with supporting context. The signature may be electronic/cryptographic in nature, or a graphical image representing a hand-written signature, or a signature process. Different signature approaches have different utilities. """ __resource_type__ = "Signature" blob: fhirtypes.Base64BinaryType | None = Field( default=None, alias="blob", title="The actual signature content (XML DigSig. JWT, picture, etc.)", description=( "The base64 encoding of the Signature content. When signature is not " "recorded electronically this element would be empty." ), json_schema_extra={ "element_property": True, }, ) blob__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_blob", title="Extension field for ``blob``." ) contentType: fhirtypes.CodeType | None = Field( default=None, alias="contentType", title="The technical format of the signature", description=( "A mime type that indicates the technical format of the signature. " "Important mime types are application/signature+xml for X ML DigSig, " "application/jwt for JWT, and image/* for a graphical image of a " "signature, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contentType", title="Extension field for ``contentType``." ) onBehalfOfReference: fhirtypes.ReferenceType | None = Field( default=None, alias="onBehalfOfReference", title="The party represented", description=( "A reference to an application-usable description of the identity that " "is represented by the signature." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e onBehalfOf[x] "one_of_many": "onBehalfOf", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "RelatedPerson", "Patient", "Device", "Organization", ], }, ) onBehalfOfUri: fhirtypes.UriType | None = Field( default=None, alias="onBehalfOfUri", title="The party represented", description=( "A reference to an application-usable description of the identity that " "is represented by the signature." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e onBehalfOf[x] "one_of_many": "onBehalfOf", "one_of_many_required": False, }, ) onBehalfOfUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onBehalfOfUri", title="Extension field for ``onBehalfOfUri``.", ) type: typing.List[fhirtypes.CodingType] = Field( default=..., alias="type", title="Indication of the reason the entity signed the object(s)", description=( "An indication of the reason that the entity signed this document. This" " may be explicitly included as part of the signature information and " "can be used when determining accountability for various actions " "concerning the document." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) when: fhirtypes.InstantType | None = Field( default=None, alias="when", title="When the signature was created", description="When the digital signature was signed.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) when__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_when", title="Extension field for ``when``." ) whoReference: fhirtypes.ReferenceType | None = Field( default=None, alias="whoReference", title="Who signed", description=( "A reference to an application-usable description of the identity that " "signed (e.g. the signature used their private key)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e who[x] "one_of_many": "who", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "RelatedPerson", "Patient", "Device", "Organization", ], }, ) whoUri: fhirtypes.UriType | None = Field( default=None, alias="whoUri", title="Who signed", description=( "A reference to an application-usable description of the identity that " "signed (e.g. the signature used their private key)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e who[x] "one_of_many": "who", "one_of_many_required": True, }, ) whoUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_whoUri", title="Extension field for ``whoUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Signature`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "type", "when", "whoUri", "whoReference", "whoReference", "whoReference", "whoReference", "whoReference", "onBehalfOfUri", "onBehalfOfReference", "onBehalfOfReference", "onBehalfOfReference", "onBehalfOfReference", "onBehalfOfReference", "contentType", "blob", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Signature`` according to specification, with preserving the original sequence order. """ return [ "type", "when", "whoUri", "whoReference", "whoReference", "whoReference", "whoReference", "whoReference", "onBehalfOfUri", "onBehalfOfReference", "onBehalfOfReference", "onBehalfOfReference", "onBehalfOfReference", "onBehalfOfReference", "contentType", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("when", "when__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "onBehalfOf": ["onBehalfOfReference", "onBehalfOfUri"], "who": ["whoReference", "whoUri"], } return one_of_many_fields ================================================ FILE: fhir/resources/STU3/slot.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Slot Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class Slot(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A slot of time on a schedule that may be available for booking appointments. """ __resource_type__ = "Slot" appointmentType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="appointmentType", title=( "The style of appointment or patient that may be booked in the slot " "(not service type)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title=( "Comments on the slot to describe any extended information. Such as " "custom constraints on the slot" ), description=None, json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) end: fhirtypes.InstantType | None = Field( default=None, alias="end", title="Date/Time that the slot is to conclude", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_end", title="Extension field for ``end``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Ids for this item", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) overbooked: bool | None = Field( default=None, alias="overbooked", title=( "This slot has already been overbooked, appointments are unlikely to be" " accepted for this time" ), description=None, json_schema_extra={ "element_property": True, }, ) overbooked__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_overbooked", title="Extension field for ``overbooked``." ) schedule: fhirtypes.ReferenceType = Field( default=..., alias="schedule", title=( "The schedule resource that this slot defines an interval of status " "information" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Schedule"], }, ) serviceCategory: fhirtypes.CodeableConceptType | None = Field( default=None, alias="serviceCategory", title=( "A broad categorisation of the service that is to be performed during " "this appointment" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) serviceType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="serviceType", title=( "The type of appointments that can be booked into this slot (ideally " "this would be an identifiable service - which is at a location, rather" " than the location itself). If provided then this overrides the value " "provided on the availability resource" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialty", title=( "The specialty of a practitioner that would be required to perform the " "service requested in this appointment" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) start: fhirtypes.InstantType | None = Field( default=None, alias="start", title="Date/Time that the slot is to begin", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_start", title="Extension field for ``start``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="busy | free | busy-unavailable | busy-tentative | entered-in-error", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "busy", "free", "busy-unavailable", "busy-tentative", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Slot`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "serviceCategory", "serviceType", "specialty", "appointmentType", "schedule", "status", "start", "end", "overbooked", "comment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Slot`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "serviceCategory", "serviceType", "specialty", "appointmentType", "schedule", "status", "start", "end", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("end", "end__ext"), ("start", "start__ext"), ("status", "status__ext"), ] return required_fields ================================================ FILE: fhir/resources/STU3/specimen.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Specimen Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Specimen(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Sample for analysis. A sample to be used for analysis. """ __resource_type__ = "Specimen" accessionIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="accessionIdentifier", title="Identifier assigned by the lab", description=( "The identifier assigned by the lab when accessioning specimen(s). This" " is not necessarily the same as the specimen identifier, depending on " "local lab procedures." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) collection: fhirtypes.SpecimenCollectionType | None = Field( default=None, alias="collection", title="Collection details", description="Details concerning the specimen collection.", json_schema_extra={ "element_property": True, }, ) container: typing.List[fhirtypes.SpecimenContainerType] | None = Field( default=None, alias="container", title="Direct container of specimen (tube/slide, etc.)", description=( "The container holding the specimen. The recursive nature of " "containers; i.e. blood in tube in tray in rack is not addressed here." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Identifier", description="Id for specimen.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments", description=( "To communicate any details or issues about the specimen or during the " "specimen collection. (for example: broken vial, sent with patient, " "frozen)." ), json_schema_extra={ "element_property": True, }, ) parent: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="parent", title="Specimen from which this specimen originated", description=( "Reference to the parent (source) specimen which is used when the " "specimen was either derived from or a component of another specimen." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Specimen"], }, ) processing: typing.List[fhirtypes.SpecimenProcessingType] | None = Field( default=None, alias="processing", title="Processing and processing step details", description="Details concerning processing and processing steps for the specimen.", json_schema_extra={ "element_property": True, }, ) receivedTime: fhirtypes.DateTimeType | None = Field( default=None, alias="receivedTime", title="The time when specimen was received for processing", description="Time when specimen was received for processing or testing.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) receivedTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_receivedTime", title="Extension field for ``receivedTime``.", ) request: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="request", title="Why the specimen was collected", description=( "Details concerning a test or procedure request that required a " "specimen to be collected." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ProcedureRequest"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="available | unavailable | unsatisfactory | entered-in-error", description="The availability of the specimen.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "available", "unavailable", "unsatisfactory", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title=( "Where the specimen came from. This may be from the patient(s) or from " "the environment or a device" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group", "Device", "Substance"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Kind of material that forms the specimen", description="The kind of material that forms the specimen.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Specimen`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "accessionIdentifier", "status", "type", "subject", "receivedTime", "parent", "request", "collection", "processing", "container", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Specimen`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "accessionIdentifier", "status", "type", "subject", "receivedTime", ] class SpecimenCollection(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Collection details. Details concerning the specimen collection. """ __resource_type__ = "SpecimenCollection" bodySite: fhirtypes.CodeableConceptType | None = Field( default=None, alias="bodySite", title="Anatomical collection site", description=( "Anatomical location from which the specimen was collected (if subject " "is a patient). This is the target site. This element is not used for " "environmental specimens." ), json_schema_extra={ "element_property": True, }, ) collectedDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="collectedDateTime", title="Collection time", description=( "Time when specimen was collected from subject - the physiologically " "relevant time." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e collected[x] "one_of_many": "collected", "one_of_many_required": False, }, ) collectedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_collectedDateTime", title="Extension field for ``collectedDateTime``.", ) collectedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="collectedPeriod", title="Collection time", description=( "Time when specimen was collected from subject - the physiologically " "relevant time." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e collected[x] "one_of_many": "collected", "one_of_many_required": False, }, ) collector: fhirtypes.ReferenceType | None = Field( default=None, alias="collector", title="Who collected the specimen", description="Person who collected the specimen.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="Technique used to perform collection", description=( "A coded value specifying the technique that is used to perform the " "procedure." ), json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="The quantity of specimen collected", description=( "The quantity of specimen collected; for instance the volume of a blood" " sample, or the physical measurement of an anatomic pathology sample." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SpecimenCollection`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "collector", "collectedDateTime", "collectedPeriod", "quantity", "method", "bodySite", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SpecimenCollection`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "collector", "collectedDateTime", "collectedPeriod", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"collected": ["collectedDateTime", "collectedPeriod"]} return one_of_many_fields class SpecimenContainer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Direct container of specimen (tube/slide, etc.). The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here. """ __resource_type__ = "SpecimenContainer" additiveCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="additiveCodeableConcept", title="Additive associated with container", description=( "Introduced substance to preserve, maintain or enhance the specimen. " "Examples: Formalin, Citrate, EDTA." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e additive[x] "one_of_many": "additive", "one_of_many_required": False, }, ) additiveReference: fhirtypes.ReferenceType | None = Field( default=None, alias="additiveReference", title="Additive associated with container", description=( "Introduced substance to preserve, maintain or enhance the specimen. " "Examples: Formalin, Citrate, EDTA." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e additive[x] "one_of_many": "additive", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Substance"], }, ) capacity: fhirtypes.QuantityType | None = Field( default=None, alias="capacity", title="Container volume or size", description="The capacity (volume or other measure) the container may contain.", json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Textual description of the container", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Id for the container", description=( "Id for container. There may be multiple; a manufacturer's bar code, " "lab assigned identifier, etc. The container ID may differ from the " "specimen id in some circumstances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) specimenQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="specimenQuantity", title="Quantity of specimen within container", description=( "The quantity of specimen in the container; may be volume, dimensions, " "or other appropriate measurements, depending on the specimen type." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Kind of container directly associated with specimen", description=( "The type of container associated with the specimen (e.g. slide, " "aliquot, etc.)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SpecimenContainer`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "description", "type", "capacity", "specimenQuantity", "additiveCodeableConcept", "additiveReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SpecimenContainer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "identifier"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "additive": ["additiveCodeableConcept", "additiveReference"] } return one_of_many_fields class SpecimenProcessing(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Processing and processing step details. Details concerning processing and processing steps for the specimen. """ __resource_type__ = "SpecimenProcessing" additive: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="additive", title="Material used in the processing step", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Substance"], }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Textual description of procedure", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) procedure: fhirtypes.CodeableConceptType | None = Field( default=None, alias="procedure", title="Indicates the treatment step applied to the specimen", description="A coded value specifying the procedure used to process the specimen.", json_schema_extra={ "element_property": True, }, ) timeDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="timeDateTime", title="Date and time of specimen processing", description=( "A record of the time or period when the specimen processing occurred." " For example the time of sample fixation or the period of time the " "sample was in formalin." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e time[x] "one_of_many": "time", "one_of_many_required": False, }, ) timeDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timeDateTime", title="Extension field for ``timeDateTime``.", ) timePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="timePeriod", title="Date and time of specimen processing", description=( "A record of the time or period when the specimen processing occurred." " For example the time of sample fixation or the period of time the " "sample was in formalin." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e time[x] "one_of_many": "time", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SpecimenProcessing`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "procedure", "additive", "timeDateTime", "timePeriod", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SpecimenProcessing`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"time": ["timeDateTime", "timePeriod"]} return one_of_many_fields ================================================ FILE: fhir/resources/STU3/structuredefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/StructureDefinition Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class StructureDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Structural Definition. A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types. """ __resource_type__ = "StructureDefinition" abstract: bool | None = Field( default=None, alias="abstract", title="Whether the structure is abstract", description=( "Whether structure this definition describes is abstract or not - that" " is, whether the structure is not intended to be instantiated. For " "Resources and Data types, abstract types will never be exchanged " "between systems." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) abstract__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_abstract", title="Extension field for ``abstract``." ) baseDefinition: fhirtypes.UriType | None = Field( default=None, alias="baseDefinition", title="Definition that this type is constrained/specialized from", description=( "An absolute URI that is the base structure from which this type is " "derived, either by specialization or constraint." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) baseDefinition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_baseDefinition", title="Extension field for ``baseDefinition``.", ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) context: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="context", title="Where the extension can be used in instances", description=( "Identifies the types of resource or data type elements to which the " "extension can be applied." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) context__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_context", title="Extension field for ``context``." ) contextInvariant: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="contextInvariant", title="FHIRPath invariants - when the extension can be used", description=( "A set of rules as Fluent Invariants about when the extension can be " "used (e.g. co-occurrence variants for the extension)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contextInvariant__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_contextInvariant", title="Extension field for ``contextInvariant``.", ) contextType: fhirtypes.CodeType | None = Field( default=None, alias="contextType", title="resource | datatype | extension", description=( "If this is an extension, Identifies the context within FHIR resources " "where the extension can be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["resource", "datatype", "extension"], }, ) contextType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contextType", title="Extension field for ``contextType``." ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the structure definition and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the structure definition." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date this was last changed", description=( "The date (and optionally time) when the structure definition was " "published. The date must change if and when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the structure " "definition changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) derivation: fhirtypes.CodeType | None = Field( default=None, alias="derivation", title="specialization | constraint - How relates to base definition", description="How the type relates to the baseDefinition.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["specialization", "constraint"], }, ) derivation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_derivation", title="Extension field for ``derivation``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the structure definition", description=( "A free text natural language description of the structure definition " "from a consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) differential: fhirtypes.StructureDefinitionDifferentialType | None = Field( default=None, alias="differential", title="Differential view of the structure", description=( "A differential view is expressed relative to the base " "StructureDefinition - a statement of differences that it applies." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A boolean value to indicate that this structure definition is authored" " for testing purposes (or education/evaluation/marketing), and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) fhirVersion: fhirtypes.IdType | None = Field( default=None, alias="fhirVersion", title="FHIR Version this StructureDefinition targets", description=( "The version of the FHIR specification on which this " "StructureDefinition is based - this is the formal version of the " "specification, without the revision number, e.g. " "[publication].[major].[minor], which is 3.0.2 for this version." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) fhirVersion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fhirVersion", title="Extension field for ``fhirVersion``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the structure definition", description=( "A formal identifier that is used to identify this structure definition" " when it is represented in other formats, or referenced in a " "specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for structure definition (if applicable)", description=( "A legal or geographic region in which the structure definition is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) keyword: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="keyword", title="Assist with indexing and finding", description=( "A set of key words or terms from external terminologies that may be " "used to assist with indexing and searching of templates." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title="primitive-type | complex-type | resource | logical", description="Defines the kind of structure that this definition is describing.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["primitive-type", "complex-type", "resource", "logical"], }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) mapping: typing.List[fhirtypes.StructureDefinitionMappingType] | None = Field( default=None, alias="mapping", title="External specification that the content is mapped to", description="An external specification that the content is mapped to.", json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this structure definition (computer friendly)", description=( "A natural language name identifying the structure definition. This " "name should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the individual or organization that published the " "structure definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this structure definition is defined", description=( "Explaination of why this structure definition is needed and why it has" " been designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) snapshot: fhirtypes.StructureDefinitionSnapshotType | None = Field( default=None, alias="snapshot", title="Snapshot view of the structure", description=( "A snapshot view is expressed in a stand alone form that can be used " "and interpreted without considering the base StructureDefinition." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this structure definition. Enables tracking the life-" "cycle of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this structure definition (human friendly)", description=( "A short, descriptive, user-friendly title for the structure " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="Type defined or constrained by this structure", description=( "The type this structure describes. If the derivation kind is " "'specialization' then this is the master definition for a type, and " "there is always one of these (a data type, an extension, a resource, " "including abstract ones). Otherwise the structure definition is a " "constraint on the stated type (and in this case, the type cannot be an" " abstract type)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Logical URI to reference this structure definition (globally unique)", description=( "An absolute URI that is used to identify this structure definition " "when it is referenced in a specification, model, design or an " "instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD " "be an address at which this structure definition is (or will be) " "published. The URL SHOULD include the major version of the structure " "definition. For more information see [Technical and Business " "Versions](resource.html#versions)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Context the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching for appropriate structure definition instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the structure definition", description=( "The identifier that is used to identify this version of the structure " "definition when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the structure " "definition author and is not expected to be globally unique. For " "example, it might be a timestamp (e.g. yyyymmdd) if a managed version " "is not available. There is also no expectation that versions can be " "placed in a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "keyword", "fhirVersion", "mapping", "kind", "abstract", "contextType", "context", "contextInvariant", "type", "baseDefinition", "derivation", "snapshot", "differential", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "keyword", "fhirVersion", "kind", "abstract", "contextType", "context", "contextInvariant", "type", "baseDefinition", "derivation", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("abstract", "abstract__ext"), ("kind", "kind__ext"), ("name", "name__ext"), ("status", "status__ext"), ("type", "type__ext"), ("url", "url__ext"), ] return required_fields class StructureDefinitionDifferential(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Differential view of the structure. A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies. """ __resource_type__ = "StructureDefinitionDifferential" element: typing.List[fhirtypes.ElementDefinitionType] = Field( default=..., alias="element", title="Definition of elements in the resource (if no StructureDefinition)", description="Captures constraints on each element within the resource.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureDefinitionDifferential`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "element"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureDefinitionDifferential`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class StructureDefinitionMapping(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. External specification that the content is mapped to. An external specification that the content is mapped to. """ __resource_type__ = "StructureDefinitionMapping" comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Versions, Issues, Scope limitations etc.", description=( "Comments about this mapping, including version notes, issues, scope " "limitations, and other important notes for usage." ), json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) identity: fhirtypes.IdType | None = Field( default=None, alias="identity", title="Internal id when this mapping is used", description=( "An Internal id that is used to identify this mapping set when specific" " mappings are made." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) identity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_identity", title="Extension field for ``identity``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Names what this mapping refers to", description="A name for the specification that is being mapped to.", json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) uri: fhirtypes.UriType | None = Field( default=None, alias="uri", title="Identifies what this mapping refers to", description=( "An absolute URI that identifies the specification that this mapping is" " expressed to." ), json_schema_extra={ "element_property": True, }, ) uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uri", title="Extension field for ``uri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureDefinitionMapping`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identity", "uri", "name", "comment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureDefinitionMapping`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("identity", "identity__ext")] return required_fields class StructureDefinitionSnapshot(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Snapshot view of the structure. A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition. """ __resource_type__ = "StructureDefinitionSnapshot" element: typing.List[fhirtypes.ElementDefinitionType] = Field( default=..., alias="element", title="Definition of elements in the resource (if no StructureDefinition)", description="Captures constraints on each element within the resource.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureDefinitionSnapshot`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "element"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureDefinitionSnapshot`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/structuremap.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/StructureMap Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class StructureMap(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A Map of relationships between 2 structures that can be used to transform data. """ __resource_type__ = "StructureMap" contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the structure map and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the structure map." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date this was last changed", description=( "The date (and optionally time) when the structure map was published. " "The date must change if and when the business version changes and it " "must change if the status code changes. In addition, it should change " "when the substantive content of the structure map changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the structure map", description=( "A free text natural language description of the structure map from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A boolean value to indicate that this structure map is authored for " "testing purposes (or education/evaluation/marketing), and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) group: typing.List[fhirtypes.StructureMapGroupType] = Field( default=..., alias="group", title="Named sections for reader convenience", description=( "Organizes the mapping into managable chunks for human review/ease of " "maintenance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the structure map", description=( "A formal identifier that is used to identify this structure map when " "it is represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) import_fhir: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="import", title="Other maps used by this map (canonical URLs)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) import__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_import", title="Extension field for ``import_fhir``." ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for structure map (if applicable)", description=( "A legal or geographic region in which the structure map is intended to" " be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this structure map (computer friendly)", description=( "A natural language name identifying the structure map. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the individual or organization that published the " "structure map." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this structure map is defined", description=( "Explaination of why this structure map is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this structure map. Enables tracking the life-cycle of " "the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) structure: typing.List[fhirtypes.StructureMapStructureType] | None = Field( default=None, alias="structure", title="Structure Definition used by this map", description=( "A structure definition used by this map. The structure definition may " "describe instances that are converted, or the instances that are " "produced." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this structure map (human friendly)", description="A short, descriptive, user-friendly title for the structure map.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Logical URI to reference this structure map (globally unique)", description=( "An absolute URI that is used to identify this structure map when it is" " referenced in a specification, model, design or an instance. This " "SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at" " which this structure map is (or will be) published. The URL SHOULD " "include the major version of the structure map. For more information " "see [Technical and Business Versions](resource.html#versions)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Context the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching for appropriate structure map instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the structure map", description=( "The identifier that is used to identify this version of the structure " "map when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the structure map " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMap`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "structure", "import", "group", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMap`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "structure", "import", "group", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("name", "name__ext"), ("status", "status__ext"), ("url", "url__ext"), ] return required_fields class StructureMapGroup(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Named sections for reader convenience. Organizes the mapping into managable chunks for human review/ease of maintenance. """ __resource_type__ = "StructureMapGroup" documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Additional description/explaination for group", description=( "Additional supporting documentation that explains the purpose of the " "group and the types of mappings within it." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) extends: fhirtypes.IdType | None = Field( default=None, alias="extends", title="Another group that this group adds rules to", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) extends__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_extends", title="Extension field for ``extends``." ) input: typing.List[fhirtypes.StructureMapGroupInputType] = Field( default=..., alias="input", title="Named instance provided when invoking the map", description=( "A name assigned to an instance of data. The instance must be provided " "when the mapping is invoked." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.IdType | None = Field( default=None, alias="name", title="Human-readable label", description="A unique name for the group for the convenience of human readers.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) rule: typing.List[fhirtypes.StructureMapGroupRuleType] = Field( default=..., alias="rule", title="Transform Rule from source to target", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) typeMode: fhirtypes.CodeType | None = Field( default=None, alias="typeMode", title="none | types | type-and-types", description=( "If this is the default rule set to apply for thie source type, or this" " combination of types." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["none", "types", "type-and-types"], }, ) typeMode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_typeMode", title="Extension field for ``typeMode``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapGroup`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "extends", "typeMode", "documentation", "input", "rule", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapGroup`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "name", "extends", "typeMode", "documentation", "input", "rule", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext"), ("typeMode", "typeMode__ext")] return required_fields class StructureMapGroupInput(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Named instance provided when invoking the map. A name assigned to an instance of data. The instance must be provided when the mapping is invoked. """ __resource_type__ = "StructureMapGroupInput" documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Documentation for this instance of data", description=None, json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="source | target", description="Mode for this instance of data.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["source", "target"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) name: fhirtypes.IdType | None = Field( default=None, alias="name", title="Name for this instance of data", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) type: fhirtypes.StringType | None = Field( default=None, alias="type", title="Type for this instance of data", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapGroupInput`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "type", "mode", "documentation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapGroupInput`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "name", "type", "mode"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("mode", "mode__ext"), ("name", "name__ext")] return required_fields class StructureMapGroupRule(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Transform Rule from source to target. """ __resource_type__ = "StructureMapGroupRule" dependent: typing.List[fhirtypes.StructureMapGroupRuleDependentType] | None = Field( default=None, alias="dependent", title="Which other rules to apply in the context of this rule", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Documentation for this instance of data", description=None, json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) name: fhirtypes.IdType | None = Field( default=None, alias="name", title="Name of the rule for internal references", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) rule: typing.List[fhirtypes.StructureMapGroupRuleType] | None = Field( default=None, alias="rule", title="Rules contained in this rule", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) source: typing.List[fhirtypes.StructureMapGroupRuleSourceType] = Field( default=..., alias="source", title="Source inputs to the mapping", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) target: typing.List[fhirtypes.StructureMapGroupRuleTargetType] | None = Field( default=None, alias="target", title="Content to create because of this mapping rule", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapGroupRule`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "source", "target", "rule", "dependent", "documentation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapGroupRule`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "name", "source", "target", "rule", "dependent"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields class StructureMapGroupRuleDependent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Which other rules to apply in the context of this rule. """ __resource_type__ = "StructureMapGroupRuleDependent" name: fhirtypes.IdType | None = Field( default=None, alias="name", title="Name of a rule or group to apply", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) variable: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="variable", title="Variable to pass to the rule or group", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) variable__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_variable", title="Extension field for ``variable``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapGroupRuleDependent`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "variable"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapGroupRuleDependent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "name", "variable"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext"), ("variable", "variable__ext")] return required_fields class StructureMapGroupRuleSource(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Source inputs to the mapping. """ __resource_type__ = "StructureMapGroupRuleSource" check: fhirtypes.StringType | None = Field( default=None, alias="check", title=( "FHIRPath expression - must be true or the mapping engine throws an " "error instead of completing" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) check__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_check", title="Extension field for ``check``." ) condition: fhirtypes.StringType | None = Field( default=None, alias="condition", title="FHIRPath expression - must be true or the rule does not apply", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) condition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_condition", title="Extension field for ``condition``." ) context: fhirtypes.IdType | None = Field( default=None, alias="context", title="Type or variable this rule applies to", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) context__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_context", title="Extension field for ``context``." ) defaultValueAddress: fhirtypes.AddressType | None = Field( default=None, alias="defaultValueAddress", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueAge: fhirtypes.AgeType | None = Field( default=None, alias="defaultValueAge", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="defaultValueAnnotation", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="defaultValueAttachment", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="defaultValueBase64Binary", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueBase64Binary", title="Extension field for ``defaultValueBase64Binary``.", ) defaultValueBoolean: bool | None = Field( default=None, alias="defaultValueBoolean", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueBoolean", title="Extension field for ``defaultValueBoolean``.", ) defaultValueCode: fhirtypes.CodeType | None = Field( default=None, alias="defaultValueCode", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueCode", title="Extension field for ``defaultValueCode``.", ) defaultValueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="defaultValueCodeableConcept", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueCoding: fhirtypes.CodingType | None = Field( default=None, alias="defaultValueCoding", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="defaultValueContactPoint", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueCount: fhirtypes.CountType | None = Field( default=None, alias="defaultValueCount", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDate: fhirtypes.DateType | None = Field( default=None, alias="defaultValueDate", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueDate", title="Extension field for ``defaultValueDate``.", ) defaultValueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="defaultValueDateTime", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueDateTime", title="Extension field for ``defaultValueDateTime``.", ) defaultValueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="defaultValueDecimal", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueDecimal", title="Extension field for ``defaultValueDecimal``.", ) defaultValueDistance: fhirtypes.DistanceType | None = Field( default=None, alias="defaultValueDistance", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDuration: fhirtypes.DurationType | None = Field( default=None, alias="defaultValueDuration", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="defaultValueHumanName", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueId: fhirtypes.IdType | None = Field( default=None, alias="defaultValueId", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueId", title="Extension field for ``defaultValueId``.", ) defaultValueIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="defaultValueIdentifier", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueInstant: fhirtypes.InstantType | None = Field( default=None, alias="defaultValueInstant", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueInstant", title="Extension field for ``defaultValueInstant``.", ) defaultValueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="defaultValueInteger", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueInteger", title="Extension field for ``defaultValueInteger``.", ) defaultValueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="defaultValueMarkdown", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueMarkdown", title="Extension field for ``defaultValueMarkdown``.", ) defaultValueMeta: fhirtypes.MetaType | None = Field( default=None, alias="defaultValueMeta", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueMoney: fhirtypes.MoneyType | None = Field( default=None, alias="defaultValueMoney", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueOid: fhirtypes.OidType | None = Field( default=None, alias="defaultValueOid", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueOid", title="Extension field for ``defaultValueOid``.", ) defaultValuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="defaultValuePeriod", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="defaultValuePositiveInt", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValuePositiveInt", title="Extension field for ``defaultValuePositiveInt``.", ) defaultValueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="defaultValueQuantity", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueRange: fhirtypes.RangeType | None = Field( default=None, alias="defaultValueRange", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueRatio: fhirtypes.RatioType | None = Field( default=None, alias="defaultValueRatio", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="defaultValueReference", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="defaultValueSampledData", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueSignature: fhirtypes.SignatureType | None = Field( default=None, alias="defaultValueSignature", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueString: fhirtypes.StringType | None = Field( default=None, alias="defaultValueString", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueString", title="Extension field for ``defaultValueString``.", ) defaultValueTime: fhirtypes.TimeType | None = Field( default=None, alias="defaultValueTime", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueTime", title="Extension field for ``defaultValueTime``.", ) defaultValueTiming: fhirtypes.TimingType | None = Field( default=None, alias="defaultValueTiming", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="defaultValueUnsignedInt", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueUnsignedInt", title="Extension field for ``defaultValueUnsignedInt``.", ) defaultValueUri: fhirtypes.UriType | None = Field( default=None, alias="defaultValueUri", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueUri", title="Extension field for ``defaultValueUri``.", ) element: fhirtypes.StringType | None = Field( default=None, alias="element", title="Optional field for this source", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) element__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_element", title="Extension field for ``element``." ) listMode: fhirtypes.CodeType | None = Field( default=None, alias="listMode", title="first | not_first | last | not_last | only_one", description="How to handle the list mode for this element.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["first", "not_first", "last", "not_last", "only_one"], }, ) listMode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_listMode", title="Extension field for ``listMode``." ) max: fhirtypes.StringType | None = Field( default=None, alias="max", title="Specified maximum cardinality (number or *)", description=( 'Specified maximum cardinality for the element - a number or a "*". ' "This is optional; if present, it acts an implicit check on the input " "content (* just serves as documentation; it's the default value)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_max", title="Extension field for ``max``." ) min: fhirtypes.IntegerType | None = Field( default=None, alias="min", title="Specified minimum cardinality", description=( "Specified minimum cardinality for the element. This is optional; if " "present, it acts an implicit check on the input content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_min", title="Extension field for ``min``." ) type: fhirtypes.StringType | None = Field( default=None, alias="type", title="Rule only applies if source has this type", description=( "Specified type for the element. This works as a condition on the " "mapping - use for polymorphic elements." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) variable: fhirtypes.IdType | None = Field( default=None, alias="variable", title="Named context for field, if a field is specified", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) variable__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_variable", title="Extension field for ``variable``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapGroupRuleSource`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "context", "min", "max", "type", "defaultValueBase64Binary", "defaultValueBoolean", "defaultValueCode", "defaultValueDate", "defaultValueDateTime", "defaultValueDecimal", "defaultValueId", "defaultValueInstant", "defaultValueInteger", "defaultValueMarkdown", "defaultValueOid", "defaultValuePositiveInt", "defaultValueString", "defaultValueTime", "defaultValueUnsignedInt", "defaultValueUri", "defaultValueAddress", "defaultValueAge", "defaultValueAnnotation", "defaultValueAttachment", "defaultValueCodeableConcept", "defaultValueCoding", "defaultValueContactPoint", "defaultValueCount", "defaultValueDistance", "defaultValueDuration", "defaultValueHumanName", "defaultValueIdentifier", "defaultValueMoney", "defaultValuePeriod", "defaultValueQuantity", "defaultValueRange", "defaultValueRatio", "defaultValueReference", "defaultValueSampledData", "defaultValueSignature", "defaultValueTiming", "defaultValueMeta", "element", "listMode", "variable", "condition", "check", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapGroupRuleSource`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "context", "min", "max", "type", "defaultValueBase64Binary", "defaultValueBoolean", "defaultValueCode", "defaultValueDate", "defaultValueDateTime", "defaultValueDecimal", "defaultValueId", "defaultValueInstant", "defaultValueInteger", "defaultValueMarkdown", "defaultValueOid", "defaultValuePositiveInt", "defaultValueString", "defaultValueTime", "defaultValueUnsignedInt", "defaultValueUri", "defaultValueAddress", "defaultValueAge", "defaultValueAnnotation", "defaultValueAttachment", "defaultValueCodeableConcept", "defaultValueCoding", "defaultValueContactPoint", "defaultValueCount", "defaultValueDistance", "defaultValueDuration", "defaultValueHumanName", "defaultValueIdentifier", "defaultValueMoney", "defaultValuePeriod", "defaultValueQuantity", "defaultValueRange", "defaultValueRatio", "defaultValueReference", "defaultValueSampledData", "defaultValueSignature", "defaultValueTiming", "defaultValueMeta", "element", "listMode", "variable", "condition", "check", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("context", "context__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "defaultValue": [ "defaultValueAddress", "defaultValueAge", "defaultValueAnnotation", "defaultValueAttachment", "defaultValueBase64Binary", "defaultValueBoolean", "defaultValueCode", "defaultValueCodeableConcept", "defaultValueCoding", "defaultValueContactPoint", "defaultValueCount", "defaultValueDate", "defaultValueDateTime", "defaultValueDecimal", "defaultValueDistance", "defaultValueDuration", "defaultValueHumanName", "defaultValueId", "defaultValueIdentifier", "defaultValueInstant", "defaultValueInteger", "defaultValueMarkdown", "defaultValueMeta", "defaultValueMoney", "defaultValueOid", "defaultValuePeriod", "defaultValuePositiveInt", "defaultValueQuantity", "defaultValueRange", "defaultValueRatio", "defaultValueReference", "defaultValueSampledData", "defaultValueSignature", "defaultValueString", "defaultValueTime", "defaultValueTiming", "defaultValueUnsignedInt", "defaultValueUri", ] } return one_of_many_fields class StructureMapGroupRuleTarget(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Content to create because of this mapping rule. """ __resource_type__ = "StructureMapGroupRuleTarget" context: fhirtypes.IdType | None = Field( default=None, alias="context", title="Type or variable this rule applies to", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) context__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_context", title="Extension field for ``context``." ) contextType: fhirtypes.CodeType | None = Field( default=None, alias="contextType", title="type | variable", description="How to interpret the context.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["type", "variable"], }, ) contextType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contextType", title="Extension field for ``contextType``." ) element: fhirtypes.StringType | None = Field( default=None, alias="element", title="Field to create in the context", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) element__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_element", title="Extension field for ``element``." ) listMode: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="listMode", title="first | share | last | collate", description="If field is a list, how to manage the list.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["first", "share", "last", "collate"], }, ) listMode__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_listMode", title="Extension field for ``listMode``." ) listRuleId: fhirtypes.IdType | None = Field( default=None, alias="listRuleId", title="Internal rule reference for shared list items", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) listRuleId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_listRuleId", title="Extension field for ``listRuleId``." ) parameter: typing.List[ fhirtypes.StructureMapGroupRuleTargetParameterType ] | None = Field( default=None, alias="parameter", title="Parameters to the transform", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) transform: fhirtypes.CodeType | None = Field( default=None, alias="transform", title="create | copy +", description="How the data is copied / created.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["create", "copy", "+"], }, ) transform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_transform", title="Extension field for ``transform``." ) variable: fhirtypes.IdType | None = Field( default=None, alias="variable", title="Named context for field, if desired, and a field is specified", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) variable__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_variable", title="Extension field for ``variable``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapGroupRuleTarget`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "context", "contextType", "element", "variable", "listMode", "listRuleId", "transform", "parameter", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapGroupRuleTarget`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "context", "contextType", "element", "variable", "listMode", "listRuleId", "transform", "parameter", ] class StructureMapGroupRuleTargetParameter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Parameters to the transform. """ __resource_type__ = "StructureMapGroupRuleTargetParameter" valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Parameter value - variable or literal", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Parameter value - variable or literal", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueId: fhirtypes.IdType | None = Field( default=None, alias="valueId", title="Parameter value - variable or literal", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueId", title="Extension field for ``valueId``." ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Parameter value - variable or literal", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Parameter value - variable or literal", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapGroupRuleTargetParameter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "valueId", "valueString", "valueBoolean", "valueInteger", "valueDecimal", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapGroupRuleTargetParameter`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "valueId", "valueString", "valueBoolean", "valueInteger", "valueDecimal", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueDecimal", "valueId", "valueInteger", "valueString", ] } return one_of_many_fields class StructureMapStructure(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Structure Definition used by this map. A structure definition used by this map. The structure definition may describe instances that are converted, or the instances that are produced. """ __resource_type__ = "StructureMapStructure" alias: fhirtypes.StringType | None = Field( default=None, alias="alias", title="Name for type in this map", description="The name used for this type in the map.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) alias__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_alias", title="Extension field for ``alias``." ) documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Documentation on use of structure", description="Documentation that describes how the structure is used in the mapping.", json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="source | queried | target | produced", description="How the referenced structure is used in this mapping.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["source", "queried", "target", "produced"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Canonical URL for structure definition", description="The canonical URL that identifies the structure.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapStructure`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "url", "mode", "alias", "documentation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapStructure`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "url", "mode", "alias"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("mode", "mode__ext"), ("url", "url__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/subscription.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Subscription Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Subscription(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A server push subscription criteria. The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system is able to take an appropriate action. """ __resource_type__ = "Subscription" channel: fhirtypes.SubscriptionChannelType = Field( default=..., alias="channel", title="The channel on which to report matches to the criteria", description=( "Details where to send notifications when resources are received that " "meet the criteria." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="contact", title="Contact details for source (e.g. troubleshooting)", description=( "Contact details for a human to contact about the subscription. The " "primary use of this for system administrator troubleshooting." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) criteria: fhirtypes.StringType | None = Field( default=None, alias="criteria", title="Rule for server push criteria", description=( "The rules that the server should use to determine when to generate " "notifications for this subscription." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) criteria__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_criteria", title="Extension field for ``criteria``." ) end: fhirtypes.InstantType | None = Field( default=None, alias="end", title="When to automatically delete the subscription", description="The time for the server to turn the subscription off.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_end", title="Extension field for ``end``." ) error: fhirtypes.StringType | None = Field( default=None, alias="error", title="Latest error note", description=( "A record of the last error that occurred when the server processed a " "notification." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) error__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_error", title="Extension field for ``error``." ) reason: fhirtypes.StringType | None = Field( default=None, alias="reason", title="Description of why this subscription was created", description="A description of why this subscription is defined.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) reason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reason", title="Extension field for ``reason``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="requested | active | error | off", description=( "The status of the subscription, which marks the server state for " "managing the subscription." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["requested", "active", "error", "off"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) tag: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="tag", title="A tag to add to matching resources", description=( "A tag to add to any resource that matches the criteria, after the " "subscription is processed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Subscription`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "status", "contact", "end", "reason", "criteria", "error", "channel", "tag", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Subscription`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "status", "contact", "end", "reason", "criteria", "error", "channel", "tag", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("criteria", "criteria__ext"), ("reason", "reason__ext"), ("status", "status__ext"), ] return required_fields class SubscriptionChannel(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The channel on which to report matches to the criteria. Details where to send notifications when resources are received that meet the criteria. """ __resource_type__ = "SubscriptionChannel" endpoint: fhirtypes.UriType | None = Field( default=None, alias="endpoint", title="Where the channel points to", description="The uri that describes the actual end-point to send messages to.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endpoint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_endpoint", title="Extension field for ``endpoint``." ) header: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="header", title="Usage depends on the channel type", description="Additional headers / information to send as part of the notification.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) header__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_header", title="Extension field for ``header``." ) payload: fhirtypes.StringType | None = Field( default=None, alias="payload", title="Mimetype to send, or omit for no payload", description=( "The mime type to send the payload in - either application/fhir+xml, or" " application/fhir+json. If the payload is not present, then there is " "no payload in the notification, just a notification." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) payload__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_payload", title="Extension field for ``payload``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="rest-hook | websocket | email | sms | message", description="The type of channel to send notifications on.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["rest-hook", "websocket", "email", "sms", "message"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubscriptionChannel`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "endpoint", "payload", "header", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubscriptionChannel`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "endpoint", "payload", "header"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/substance.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Substance Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Substance(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A homogeneous material with a definite composition. """ __resource_type__ = "Substance" category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="What class/type of substance this is", description=( "A code that classifies the general type of substance. This is used " "for searching, sorting and display purposes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="What substance this is", description="A code (or set of codes) that identify this substance.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Textual description of the substance, comments", description=( "A description of the substance - its appearance, handling " "requirements, and other usage notes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique identifier", description="Unique identifier for the substance.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ingredient: typing.List[fhirtypes.SubstanceIngredientType] | None = Field( default=None, alias="ingredient", title="Composition information about the substance", description="A substance can be composed of other substances.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instance: typing.List[fhirtypes.SubstanceInstanceType] | None = Field( default=None, alias="instance", title="If this describes a specific package/container of the substance", description=( "Substance may be used to describe a kind of substance, or a specific " "package/container of the substance: an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | inactive | entered-in-error", description="A code to indicate if the substance is actively used.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "inactive", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Substance`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "category", "code", "description", "instance", "ingredient", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Substance`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "category", "code", "description", "instance", "ingredient", ] class SubstanceIngredient(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Composition information about the substance. A substance can be composed of other substances. """ __resource_type__ = "SubstanceIngredient" quantity: fhirtypes.RatioType | None = Field( default=None, alias="quantity", title="Optional amount (concentration)", description="The amount of the ingredient in the substance - a concentration ratio.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) substanceCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="substanceCodeableConcept", title="A component of the substance", description="Another substance that is a component of this substance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e substance[x] "one_of_many": "substance", "one_of_many_required": True, }, ) substanceReference: fhirtypes.ReferenceType | None = Field( default=None, alias="substanceReference", title="A component of the substance", description="Another substance that is a component of this substance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e substance[x] "one_of_many": "substance", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Substance"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceIngredient`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "quantity", "substanceCodeableConcept", "substanceReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceIngredient`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "quantity", "substanceCodeableConcept", "substanceReference", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "substance": ["substanceCodeableConcept", "substanceReference"] } return one_of_many_fields class SubstanceInstance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. If this describes a specific package/container of the substance. Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance. """ __resource_type__ = "SubstanceInstance" expiry: fhirtypes.DateTimeType | None = Field( default=None, alias="expiry", title="When no longer valid to use", description=( "When the substance is no longer valid to use. For some substances, a " "single arbitrary date is used for expiry." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) expiry__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expiry", title="Extension field for ``expiry``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Identifier of the package/container", description=( "Identifier associated with the package/container (usually a label " "affixed directly)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Amount of substance in the package", description="The amount of the substance.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceInstance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "expiry", "quantity", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceInstance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "identifier", "expiry", "quantity"] ================================================ FILE: fhir/resources/STU3/supplydelivery.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SupplyDelivery Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class SupplyDelivery(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Delivery of bulk Supplies. Record of delivery of what is supplied. """ __resource_type__ = "SupplyDelivery" basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Fulfills plan, proposal or order", description=( "A plan, proposal or order that is fulfilled in whole or in part by " "this event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SupplyRequest"], }, ) destination: fhirtypes.ReferenceType | None = Field( default=None, alias="destination", title="Where the Supply was sent", description=( "Identification of the facility/location where the Supply was shipped " "to, as part of the dispense event." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="External identifier", description=( "Identifier assigned by the dispensing facility when the item(s) is " "dispensed." ), json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When event occurred", description="The date or time(s) the activity occurred.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="When event occurred", description="The date or time(s) the activity occurred.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceTiming: fhirtypes.TimingType | None = Field( default=None, alias="occurrenceTiming", title="When event occurred", description="The date or time(s) the activity occurred.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced event", description="A larger event of which this particular event is a component or step.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SupplyDelivery", "Contract"], }, ) patient: fhirtypes.ReferenceType | None = Field( default=None, alias="patient", title="Patient for whom the item is supplied", description=( "A link to a resource representing the person whom the delivered item " "is for." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) receiver: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="receiver", title="Who collected the Supply", description="Identifies the person who picked up the Supply.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="in-progress | completed | abandoned | entered-in-error", description="A code specifying the state of the dispense event.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "in-progress", "completed", "abandoned", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) suppliedItem: fhirtypes.SupplyDeliverySuppliedItemType | None = Field( default=None, alias="suppliedItem", title="The item that is delivered or supplied", description="The item that is being delivered or has been supplied.", json_schema_extra={ "element_property": True, }, ) supplier: fhirtypes.ReferenceType | None = Field( default=None, alias="supplier", title="Dispenser", description=( "The individual responsible for dispensing the medication, supplier or " "device." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "Organization"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Category of dispense event", description=( "Indicates the type of dispensing event that is performed. Examples " "include: Trial Fill, Completion of Trial, Partial Fill, Emergency " "Fill, Samples, etc." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SupplyDelivery`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "partOf", "status", "patient", "type", "suppliedItem", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "supplier", "destination", "receiver", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SupplyDelivery`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "basedOn", "partOf", "status", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "occurrence": ["occurrenceDateTime", "occurrencePeriod", "occurrenceTiming"] } return one_of_many_fields class SupplyDeliverySuppliedItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The item that is delivered or supplied. The item that is being delivered or has been supplied. """ __resource_type__ = "SupplyDeliverySuppliedItem" itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="itemCodeableConcept", title="Medication, Substance, or Device supplied", description=( "Identifies the medication, substance or device being dispensed. This " "is either a link to a resource representing the details of the item or" " a code that identifies the item from a known list." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": False, }, ) itemReference: fhirtypes.ReferenceType | None = Field( default=None, alias="itemReference", title="Medication, Substance, or Device supplied", description=( "Identifies the medication, substance or device being dispensed. This " "is either a link to a resource representing the details of the item or" " a code that identifies the item from a known list." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication", "Substance", "Device"], }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Amount dispensed", description=( "The amount of supply that has been dispensed. Includes unit of " "measure." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SupplyDeliverySuppliedItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "quantity", "itemCodeableConcept", "itemReference", "itemReference", "itemReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SupplyDeliverySuppliedItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"item": ["itemCodeableConcept", "itemReference"]} return one_of_many_fields ================================================ FILE: fhir/resources/STU3/supplyrequest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SupplyRequest Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class SupplyRequest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Request for a medication, substance or device. A record of a request for a medication, substance or device used in the healthcare setting. """ __resource_type__ = "SupplyRequest" authoredOn: fhirtypes.DateTimeType | None = Field( default=None, alias="authoredOn", title="When the request was made", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoredOn", title="Extension field for ``authoredOn``." ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="The kind of supply (central, non-stock, etc.)", description=( "Category of supply, e.g. central, non-stock, etc. This is used to " "support work flows associated with the supply process." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) deliverFrom: fhirtypes.ReferenceType | None = Field( default=None, alias="deliverFrom", title="The origin of the supply", description="Where the supply is expected to come from.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization", "Location"], }, ) deliverTo: fhirtypes.ReferenceType | None = Field( default=None, alias="deliverTo", title="The destination of the supply", description="Where the supply is destined to go.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization", "Location", "Patient"], }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Unique identifier", description="Unique identifier for this supply request.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When the request should be fulfilled", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="When the request should be fulfilled", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceTiming: fhirtypes.TimingType | None = Field( default=None, alias="occurrenceTiming", title="When the request should be fulfilled", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) orderedItem: fhirtypes.SupplyRequestOrderedItemType | None = Field( default=None, alias="orderedItem", title="The item being requested", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Indicates how quickly this SupplyRequest should be addressed with " "respect to other requests." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) reasonCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reasonCodeableConcept", title="Why the supply item was requested", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e reason[x] "one_of_many": "reason", "one_of_many_required": False, }, ) reasonReference: fhirtypes.ReferenceType | None = Field( default=None, alias="reasonReference", title="Why the supply item was requested", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e reason[x] "one_of_many": "reason", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) requester: fhirtypes.SupplyRequestRequesterType | None = Field( default=None, alias="requester", title="Who/what is requesting service", description=( "The individual who initiated the request and has responsibility for " "its activation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | suspended +", description="Status of the supply request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "suspended", "+"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) supplier: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supplier", title="Who is intended to fulfill the request", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SupplyRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "category", "priority", "orderedItem", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "authoredOn", "requester", "supplier", "reasonCodeableConcept", "reasonReference", "deliverFrom", "deliverTo", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SupplyRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "status", "category", "priority", "orderedItem", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "authoredOn", "requester", "supplier", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "occurrence": [ "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", ], "reason": ["reasonCodeableConcept", "reasonReference"], } return one_of_many_fields class SupplyRequestOrderedItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The item being requested. """ __resource_type__ = "SupplyRequestOrderedItem" itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="itemCodeableConcept", title="Medication, Substance, or Device requested to be supplied", description=( "The item that is requested to be supplied. This is either a link to a " "resource representing the details of the item or a code that " "identifies the item from a known list." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": False, }, ) itemReference: fhirtypes.ReferenceType | None = Field( default=None, alias="itemReference", title="Medication, Substance, or Device requested to be supplied", description=( "The item that is requested to be supplied. This is either a link to a " "resource representing the details of the item or a code that " "identifies the item from a known list." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication", "Substance", "Device"], }, ) quantity: fhirtypes.QuantityType = Field( default=..., alias="quantity", title="The requested amount of the item indicated", description="The amount that is being ordered of the indicated item.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SupplyRequestOrderedItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "quantity", "itemCodeableConcept", "itemReference", "itemReference", "itemReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SupplyRequestOrderedItem`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "quantity", "itemCodeableConcept", "itemReference", "itemReference", "itemReference", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"item": ["itemCodeableConcept", "itemReference"]} return one_of_many_fields class SupplyRequestRequester(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who/what is requesting service. The individual who initiated the request and has responsibility for its activation. """ __resource_type__ = "SupplyRequestRequester" agent: fhirtypes.ReferenceType = Field( default=..., alias="agent", title="Individual making the request", description="The device, practitioner, etc. who initiated the request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Organization", "Patient", "RelatedPerson", "Device", ], }, ) onBehalfOf: fhirtypes.ReferenceType | None = Field( default=None, alias="onBehalfOf", title="Organization agent is acting for", description="The organization the device or practitioner was acting on behalf of.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SupplyRequestRequester`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "agent", "onBehalfOf"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SupplyRequestRequester`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "agent"] ================================================ FILE: fhir/resources/STU3/task.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Task Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Task(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A task to be performed. """ __resource_type__ = "Task" authoredOn: fhirtypes.DateTimeType | None = Field( default=None, alias="authoredOn", title="Task Creation Date", description="The date and time this task was created.", json_schema_extra={ "element_property": True, }, ) authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoredOn", title="Extension field for ``authoredOn``." ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Request fulfilled by this task", description=( "BasedOn refers to a higher-level authorization that triggered the " 'creation of the task. It references a "request" resource such as a ' "ProcedureRequest, MedicationRequest, ProcedureRequest, CarePlan, etc. " 'which is distinct from the "request" resource the task is seeking to ' "fulfil. This latter resource is referenced by FocusOn. For example, " "based on a ProcedureRequest (= BasedOn), a task is created to fulfil a" " procedureRequest ( = FocusOn ) to collect a specimen from a patient." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) businessStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="businessStatus", title='E.g. "Specimen collected", "IV prepped"', description="Contains business-specific nuances of the business state.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Task Type", description="A name or code (or both) briefly describing what the task involves.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Healthcare event during which this task originated", description=( "The healthcare event (e.g. a patient and healthcare provider " "interaction) during which this task was created." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) definitionReference: fhirtypes.ReferenceType | None = Field( default=None, alias="definitionReference", title="Formal definition of task", description=( "A reference to a formal or informal definition of the task. For " "example, a protocol, a step within a defined workflow definition, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e definition[x] "one_of_many": "definition", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ActivityDefinition"], }, ) definitionUri: fhirtypes.UriType | None = Field( default=None, alias="definitionUri", title="Formal definition of task", description=( "A reference to a formal or informal definition of the task. For " "example, a protocol, a step within a defined workflow definition, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e definition[x] "one_of_many": "definition", "one_of_many_required": False, }, ) definitionUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definitionUri", title="Extension field for ``definitionUri``.", ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Human-readable explanation of task", description="A free-text description of what is to be performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) executionPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="executionPeriod", title="Start and end time of execution", description=( "Identifies the time action was first taken against the task (start) " "and/or the time final action was taken against the task prior to " "marking it as completed (end)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) focus: fhirtypes.ReferenceType | None = Field( default=None, alias="focus", title="What task is acting on", description=( "The request being actioned or the resource being manipulated by this " "task." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) for_fhir: fhirtypes.ReferenceType | None = Field( default=None, alias="for", title="Beneficiary of the Task", description=( "The entity who benefits from the performance of the service specified " "in the task (e.g., the patient)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) groupIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="groupIdentifier", title="Requisition or grouper id", description=( "An identifier that links together multiple tasks and other requests " "that were created in the same context." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Task Instance Identifier", description="The business identifier for this task.", json_schema_extra={ "element_property": True, }, ) input: typing.List[fhirtypes.TaskInputType] | None = Field( default=None, alias="input", title="Information used to perform task", description=( "Additional information that may be needed in the execution of the " "task." ), json_schema_extra={ "element_property": True, }, ) intent: fhirtypes.CodeType | None = Field( default=None, alias="intent", title="proposal | plan | order +", description=( 'Indicates the "level" of actionability associated with the Task. I.e.' " Is this a proposed task, a planned task, an actionable task, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["proposal", "plan", "order", "+"], }, ) intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intent", title="Extension field for ``intent``." ) lastModified: fhirtypes.DateTimeType | None = Field( default=None, alias="lastModified", title="Task Last Modified Date", description="The date and time of last modification to this task.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastModified__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastModified", title="Extension field for ``lastModified``.", ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the task", description="Free-text information captured about the task as it progresses.", json_schema_extra={ "element_property": True, }, ) output: typing.List[fhirtypes.TaskOutputType] | None = Field( default=None, alias="output", title="Information produced as part of task", description="Outputs produced by the Task.", json_schema_extra={ "element_property": True, }, ) owner: fhirtypes.ReferenceType | None = Field( default=None, alias="owner", title="Responsible individual", description=( "Individual organization or Device currently responsible for task " "execution." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Organization", "Patient", "Practitioner", "RelatedPerson", ], }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Composite task", description="Task that this particular task is part of.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Task"], }, ) performerType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="performerType", title=( "requester | dispatcher | scheduler | performer | monitor | manager | " "acquirer | reviewer" ), description="The type of participant that can execute the task.", json_schema_extra={ "element_property": True, }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="normal | urgent | asap | stat", description=( "Indicates how quickly the Task should be addressed with respect to " "other requests." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["normal", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) reason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reason", title="Why task is needed", description="A description or code indicating why this task needs to be performed.", json_schema_extra={ "element_property": True, }, ) relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="relevantHistory", title="Key events in history of the Task", description=( "Links to Provenance records for past versions of this Task that " "identify key state transitions or updates that are likely to be " "relevant to a user looking at the current version of the task." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Provenance"], }, ) requester: fhirtypes.TaskRequesterType | None = Field( default=None, alias="requester", title="Who is asking for task to be done", description="The creator of the task.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) restriction: fhirtypes.TaskRestrictionType | None = Field( default=None, alias="restriction", title="Constraints on fulfillment tasks", description=( "If the Task.focus is a request resource and the task is seeking " "fulfillment (i.e is asking for the request to be actioned), this " "element identifies any limitations on what parts of the referenced " "request should be actioned." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | requested | received | accepted | +", description="The current status of the task.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "requested", "received", "accepted", "+"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="statusReason", title="Reason for current status", description="An explanation as to why this task is held, failed, was refused, etc.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Task`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "definitionUri", "definitionReference", "basedOn", "groupIdentifier", "partOf", "status", "statusReason", "businessStatus", "intent", "priority", "code", "description", "focus", "for", "context", "executionPeriod", "authoredOn", "lastModified", "requester", "performerType", "owner", "reason", "note", "relevantHistory", "restriction", "input", "output", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Task`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "definitionUri", "definitionReference", "basedOn", "groupIdentifier", "partOf", "status", "statusReason", "businessStatus", "intent", "code", "description", "focus", "for", "context", "executionPeriod", "lastModified", "requester", "owner", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("intent", "intent__ext"), ("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"definition": ["definitionReference", "definitionUri"]} return one_of_many_fields class TaskInput(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information used to perform task. Additional information that may be needed in the execution of the task. """ __resource_type__ = "TaskInput" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Label for the input", description=( "A code or description indicating how the input is intended to be used " "as part of the task execution." ), json_schema_extra={ "element_property": True, }, ) valueAddress: fhirtypes.AddressType | None = Field( default=None, alias="valueAddress", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAge: fhirtypes.AgeType | None = Field( default=None, alias="valueAge", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="valueAnnotation", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="valueBase64Binary", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBase64Binary", title="Extension field for ``valueBase64Binary``.", ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="valueContactPoint", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCount: fhirtypes.CountType | None = Field( default=None, alias="valueCount", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueDistance: fhirtypes.DistanceType | None = Field( default=None, alias="valueDistance", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDuration: fhirtypes.DurationType | None = Field( default=None, alias="valueDuration", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="valueHumanName", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId: fhirtypes.IdType | None = Field( default=None, alias="valueId", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueId", title="Extension field for ``valueId``." ) valueIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="valueIdentifier", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInstant: fhirtypes.InstantType | None = Field( default=None, alias="valueInstant", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInstant", title="Extension field for ``valueInstant``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="valueMarkdown", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueMarkdown", title="Extension field for ``valueMarkdown``.", ) valueMeta: fhirtypes.MetaType | None = Field( default=None, alias="valueMeta", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueMoney: fhirtypes.MoneyType | None = Field( default=None, alias="valueMoney", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueOid: fhirtypes.OidType | None = Field( default=None, alias="valueOid", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueOid", title="Extension field for ``valueOid``." ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="valuePositiveInt", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valuePositiveInt", title="Extension field for ``valuePositiveInt``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="valueSampledData", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueSignature: fhirtypes.SignatureType | None = Field( default=None, alias="valueSignature", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) valueTiming: fhirtypes.TimingType | None = Field( default=None, alias="valueTiming", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="valueUnsignedInt", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUnsignedInt", title="Extension field for ``valueUnsignedInt``.", ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TaskInput`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueBase64Binary", "valueBoolean", "valueCode", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInstant", "valueInteger", "valueMarkdown", "valueOid", "valuePositiveInt", "valueString", "valueTime", "valueUnsignedInt", "valueUri", "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueCodeableConcept", "valueCoding", "valueContactPoint", "valueCount", "valueDistance", "valueDuration", "valueHumanName", "valueIdentifier", "valueMoney", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueReference", "valueSampledData", "valueSignature", "valueTiming", "valueMeta", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TaskInput`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueBase64Binary", "valueBoolean", "valueCode", "valueCodeableConcept", "valueCoding", "valueContactPoint", "valueCount", "valueDate", "valueDateTime", "valueDecimal", "valueDistance", "valueDuration", "valueHumanName", "valueId", "valueIdentifier", "valueInstant", "valueInteger", "valueMarkdown", "valueMeta", "valueMoney", "valueOid", "valuePeriod", "valuePositiveInt", "valueQuantity", "valueRange", "valueRatio", "valueReference", "valueSampledData", "valueSignature", "valueString", "valueTime", "valueTiming", "valueUnsignedInt", "valueUri", ] } return one_of_many_fields class TaskOutput(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information produced as part of task. Outputs produced by the Task. """ __resource_type__ = "TaskOutput" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Label for output", description="The name of the Output parameter.", json_schema_extra={ "element_property": True, }, ) valueAddress: fhirtypes.AddressType | None = Field( default=None, alias="valueAddress", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAge: fhirtypes.AgeType | None = Field( default=None, alias="valueAge", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="valueAnnotation", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="valueBase64Binary", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBase64Binary", title="Extension field for ``valueBase64Binary``.", ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="valueContactPoint", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCount: fhirtypes.CountType | None = Field( default=None, alias="valueCount", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueDistance: fhirtypes.DistanceType | None = Field( default=None, alias="valueDistance", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDuration: fhirtypes.DurationType | None = Field( default=None, alias="valueDuration", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="valueHumanName", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId: fhirtypes.IdType | None = Field( default=None, alias="valueId", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueId", title="Extension field for ``valueId``." ) valueIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="valueIdentifier", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInstant: fhirtypes.InstantType | None = Field( default=None, alias="valueInstant", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInstant", title="Extension field for ``valueInstant``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="valueMarkdown", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueMarkdown", title="Extension field for ``valueMarkdown``.", ) valueMeta: fhirtypes.MetaType | None = Field( default=None, alias="valueMeta", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueMoney: fhirtypes.MoneyType | None = Field( default=None, alias="valueMoney", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueOid: fhirtypes.OidType | None = Field( default=None, alias="valueOid", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueOid", title="Extension field for ``valueOid``." ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="valuePositiveInt", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valuePositiveInt", title="Extension field for ``valuePositiveInt``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="valueSampledData", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueSignature: fhirtypes.SignatureType | None = Field( default=None, alias="valueSignature", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) valueTiming: fhirtypes.TimingType | None = Field( default=None, alias="valueTiming", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="valueUnsignedInt", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUnsignedInt", title="Extension field for ``valueUnsignedInt``.", ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TaskOutput`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueBase64Binary", "valueBoolean", "valueCode", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInstant", "valueInteger", "valueMarkdown", "valueOid", "valuePositiveInt", "valueString", "valueTime", "valueUnsignedInt", "valueUri", "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueCodeableConcept", "valueCoding", "valueContactPoint", "valueCount", "valueDistance", "valueDuration", "valueHumanName", "valueIdentifier", "valueMoney", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueReference", "valueSampledData", "valueSignature", "valueTiming", "valueMeta", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TaskOutput`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueBase64Binary", "valueBoolean", "valueCode", "valueCodeableConcept", "valueCoding", "valueContactPoint", "valueCount", "valueDate", "valueDateTime", "valueDecimal", "valueDistance", "valueDuration", "valueHumanName", "valueId", "valueIdentifier", "valueInstant", "valueInteger", "valueMarkdown", "valueMeta", "valueMoney", "valueOid", "valuePeriod", "valuePositiveInt", "valueQuantity", "valueRange", "valueRatio", "valueReference", "valueSampledData", "valueSignature", "valueString", "valueTime", "valueTiming", "valueUnsignedInt", "valueUri", ] } return one_of_many_fields class TaskRequester(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who is asking for task to be done. The creator of the task. """ __resource_type__ = "TaskRequester" agent: fhirtypes.ReferenceType = Field( default=..., alias="agent", title="Individual asking for task", description="The device, practitioner, etc. who initiated the task.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Organization", "Patient", "Practitioner", "RelatedPerson", ], }, ) onBehalfOf: fhirtypes.ReferenceType | None = Field( default=None, alias="onBehalfOf", title="Organization individual is acting for", description=( "The organization the device or practitioner was acting on behalf of " "when they initiated the task." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TaskRequester`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "agent", "onBehalfOf"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TaskRequester`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "agent"] class TaskRestriction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Constraints on fulfillment tasks. If the Task.focus is a request resource and the task is seeking fulfillment (i.e is asking for the request to be actioned), this element identifies any limitations on what parts of the referenced request should be actioned. """ __resource_type__ = "TaskRestriction" period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="When fulfillment sought", description="Over what time-period is fulfillment sought.", json_schema_extra={ "element_property": True, }, ) recipient: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="recipient", title="For whom is fulfillment sought?", description=( "For requests that are targeted to more than on potential " "recipient/target, for whom is fulfillment sought?" ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "RelatedPerson", "Group", "Organization", ], }, ) repetitions: fhirtypes.PositiveIntType | None = Field( default=None, alias="repetitions", title="How many times to repeat", description="Indicates the number of times the requested action should occur.", json_schema_extra={ "element_property": True, }, ) repetitions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_repetitions", title="Extension field for ``repetitions``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TaskRestriction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "repetitions", "period", "recipient", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TaskRestriction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/testreport.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/TestReport Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class TestReport(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Describes the results of a TestScript execution. A summary of information based on the results of executing a TestScript. """ __resource_type__ = "TestReport" identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="External identifier", description=( "Identifier for the TestScript assigned for external purposes outside " "the context of FHIR." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued: fhirtypes.DateTimeType | None = Field( default=None, alias="issued", title="When the TestScript was executed and this TestReport was generated", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issued", title="Extension field for ``issued``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Informal name of the executed TestScript", description="A free text natural language name identifying the executed TestScript.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) participant: typing.List[fhirtypes.TestReportParticipantType] | None = Field( default=None, alias="participant", title=( "A participant in the test execution, either the execution engine, a " "client, or a server" ), description=None, json_schema_extra={ "element_property": True, }, ) result: fhirtypes.CodeType | None = Field( default=None, alias="result", title="pass | fail | pending", description="The overall result from the execution of the TestScript.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["pass", "fail", "pending"], }, ) result__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_result", title="Extension field for ``result``." ) score: fhirtypes.DecimalType | None = Field( default=None, alias="score", title=( "The final score (percentage of tests passed) resulting from the " "execution of the TestScript" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) score__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_score", title="Extension field for ``score``." ) setup: fhirtypes.TestReportSetupType | None = Field( default=None, alias="setup", title=( "The results of the series of required setup operations before the " "tests were executed" ), description=None, json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="completed | in-progress | waiting | stopped | entered-in-error", description="The current state of this test report.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "completed", "in-progress", "waiting", "stopped", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) teardown: fhirtypes.TestReportTeardownType | None = Field( default=None, alias="teardown", title="The results of running the series of required clean up steps", description=( "The results of the series of operations required to clean up after the" " all the tests were executed (successfully or otherwise)." ), json_schema_extra={ "element_property": True, }, ) test: typing.List[fhirtypes.TestReportTestType] | None = Field( default=None, alias="test", title="A test executed from the test script", description=None, json_schema_extra={ "element_property": True, }, ) testScript: fhirtypes.ReferenceType = Field( default=..., alias="testScript", title=( "Reference to the version-specific TestScript that was executed to " "produce this TestReport" ), description=( "Ideally this is an absolute URL that is used to identify the version-" "specific TestScript that was executed, matching the `TestScript.url`." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["TestScript"], }, ) tester: fhirtypes.StringType | None = Field( default=None, alias="tester", title="Name of the tester producing this report (Organization or individual)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) tester__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_tester", title="Extension field for ``tester``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "name", "status", "testScript", "result", "score", "tester", "issued", "participant", "setup", "test", "teardown", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "name", "status", "testScript", "result", "score", "tester", "issued", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("result", "result__ext"), ("status", "status__ext")] return required_fields class TestReportParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A participant in the test execution, either the execution engine, a client, or a server. """ __resource_type__ = "TestReportParticipant" display: fhirtypes.StringType | None = Field( default=None, alias="display", title="The display name of the participant", description=None, json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="test-engine | client | server", description="The type of participant.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["test-engine", "client", "server"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) uri: fhirtypes.UriType | None = Field( default=None, alias="uri", title="The uri of the participant. An absolute URL is preferred", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uri", title="Extension field for ``uri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportParticipant`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "uri", "display"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext"), ("uri", "uri__ext")] return required_fields class TestReportSetup(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The results of the series of required setup operations before the tests were executed. """ __resource_type__ = "TestReportSetup" action: typing.List[fhirtypes.TestReportSetupActionType] = Field( default=..., alias="action", title="A setup operation or assert that was executed", description="Action would contain either an operation or an assertion.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportSetup`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "action"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportSetup`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestReportSetupAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A setup operation or assert that was executed. Action would contain either an operation or an assertion. """ __resource_type__ = "TestReportSetupAction" assert_fhir: fhirtypes.TestReportSetupActionAssertType | None = Field( default=None, alias="assert", title="The assertion to perform", description="The results of the assertion performed on the previous operations.", json_schema_extra={ "element_property": True, }, ) operation: fhirtypes.TestReportSetupActionOperationType | None = Field( default=None, alias="operation", title="The operation to perform", description="The operation performed.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportSetupAction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "operation", "assert"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportSetupAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestReportSetupActionAssert(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The assertion to perform. The results of the assertion performed on the previous operations. """ __resource_type__ = "TestReportSetupActionAssert" detail: fhirtypes.StringType | None = Field( default=None, alias="detail", title="A link to further details on the result", description=None, json_schema_extra={ "element_property": True, }, ) detail__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detail", title="Extension field for ``detail``." ) message: fhirtypes.MarkdownType | None = Field( default=None, alias="message", title="A message associated with the result", description="An explanatory message associated with the result.", json_schema_extra={ "element_property": True, }, ) message__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_message", title="Extension field for ``message``." ) result: fhirtypes.CodeType | None = Field( default=None, alias="result", title="pass | skip | fail | warning | error", description="The result of this assertion.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["pass", "skip", "fail", "warning", "error"], }, ) result__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_result", title="Extension field for ``result``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportSetupActionAssert`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "result", "message", "detail"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportSetupActionAssert`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("result", "result__ext")] return required_fields class TestReportSetupActionOperation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The operation to perform. The operation performed. """ __resource_type__ = "TestReportSetupActionOperation" detail: fhirtypes.UriType | None = Field( default=None, alias="detail", title="A link to further details on the result", description=None, json_schema_extra={ "element_property": True, }, ) detail__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detail", title="Extension field for ``detail``." ) message: fhirtypes.MarkdownType | None = Field( default=None, alias="message", title="A message associated with the result", description="An explanatory message associated with the result.", json_schema_extra={ "element_property": True, }, ) message__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_message", title="Extension field for ``message``." ) result: fhirtypes.CodeType | None = Field( default=None, alias="result", title="pass | skip | fail | warning | error", description="The result of this operation.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["pass", "skip", "fail", "warning", "error"], }, ) result__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_result", title="Extension field for ``result``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportSetupActionOperation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "result", "message", "detail"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportSetupActionOperation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("result", "result__ext")] return required_fields class TestReportTeardown(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The results of running the series of required clean up steps. The results of the series of operations required to clean up after the all the tests were executed (successfully or otherwise). """ __resource_type__ = "TestReportTeardown" action: typing.List[fhirtypes.TestReportTeardownActionType] = Field( default=..., alias="action", title="One or more teardown operations performed", description="The teardown action will only contain an operation.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportTeardown`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "action"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportTeardown`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestReportTeardownAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. One or more teardown operations performed. The teardown action will only contain an operation. """ __resource_type__ = "TestReportTeardownAction" operation: fhirtypes.TestReportSetupActionOperationType = Field( default=..., alias="operation", title="The teardown operation performed", description="An operation would involve a REST request to a server.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportTeardownAction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "operation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportTeardownAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestReportTest(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A test executed from the test script. """ __resource_type__ = "TestReportTest" action: typing.List[fhirtypes.TestReportTestActionType] = Field( default=..., alias="action", title="A test operation or assert that was performed", description="Action would contain either an operation or an assertion.", json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Tracking/reporting short description of the test", description=( "A short description of the test used by test engines for tracking and " "reporting purposes." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Tracking/logging name of this test", description=( "The name of this test used for tracking/logging purposes by test " "engines." ), json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportTest`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "description", "action"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportTest`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestReportTestAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A test operation or assert that was performed. Action would contain either an operation or an assertion. """ __resource_type__ = "TestReportTestAction" assert_fhir: fhirtypes.TestReportSetupActionAssertType | None = Field( default=None, alias="assert", title="The assertion performed", description="The results of the assertion performed on the previous operations.", json_schema_extra={ "element_property": True, }, ) operation: fhirtypes.TestReportSetupActionOperationType | None = Field( default=None, alias="operation", title="The operation performed", description="An operation would involve a REST request to a server.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportTestAction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "operation", "assert"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportTestAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/STU3/tests/__init__.py ================================================ __author__ = "Md Nazrul Islam" __email__ = "email2nazrul@gmail.com" __fhir_version__ = "3.0.2" ================================================ FILE: fhir/resources/STU3/tests/conftest.py ================================================ import hashlib import io import os import pathlib import shutil import sys import tempfile import zipfile from os.path import dirname import pytest from fhir_core.types import ( Base64BinaryType, DateTimeType, DateType, InstantType, TimeType, UriType, UrlType, ) from pydantic import BaseModel, Field EXAMPLE_RESOURCES_URL = ( "https://github.com/nazrulworld/hl7-archives/raw/" "0.4.0/FHIR/STU3/" "3.0.2-examples-json.zip" ) ROOT_PATH = dirname(dirname(dirname(dirname(os.path.abspath(__file__))))) CACHE_PATH = os.path.join(ROOT_PATH, ".cache") def download_and_store(url, path): """ """ import requests try: sys.stdout.write("Attempting to download from {0}\n".format(url)) ret = requests.get(url) except requests.HTTPError as exc: raise LookupError("Failed to download. Full error: {0!s}".format(exc)) else: if not ret.ok: raise Exception("Failed to download {0}".format(url)) with io.open(path, "wb") as handle: for chunk in ret.iter_content(): handle.write(chunk) sys.stdout.write( "Download has been completed, now saved to {0}\n".format(path) ) def expand(self, local): """Expand the ZIP file at the given path to the cache directory.""" path = os.path.join(self.cache, local) assert os.path.exists(path) import zipfile # import here as we can bypass its use with a manual unzip with zipfile.ZipFile(path) as z: z.extractall(self.cache) @pytest.fixture(scope="session") def base_settings(): if not os.path.exists(CACHE_PATH): os.makedirs(CACHE_PATH) settings = {} example_data_file_uri = EXAMPLE_RESOURCES_URL example_data_file_id = hashlib.md5(example_data_file_uri.encode()).hexdigest() example_data_file_location = os.path.join( CACHE_PATH, (example_data_file_id + ".zip") ) if not os.path.exists(example_data_file_location): download_and_store(example_data_file_uri, example_data_file_location) temp_data_dir = tempfile.mkdtemp() # extract all files from archive and put into temp dir with zipfile.ZipFile(example_data_file_location) as z: z.extractall(temp_data_dir) zip_dir_name = pathlib.Path(EXAMPLE_RESOURCES_URL).name[:-4] if "FHIR_UNITTEST_DATADIR" not in os.environ: os.environ.setdefault( "FHIR_UNITTEST_DATADIR", os.path.join(temp_data_dir, zip_dir_name) ) settings["unittest_data_dir"] = pathlib.Path(os.environ["FHIR_UNITTEST_DATADIR"]) yield settings os.environ.pop("FHIR_UNITTEST_DATADIR") shutil.rmtree(temp_data_dir) class ExternalValidatorModel(BaseModel): """This model is used to validate datetime objects against in the tests""" valueDate: DateType = Field(None, title="Date") valueTime: TimeType = Field(None, title="Time") valueDateTime: DateTimeType = Field(None, title="DateTime") valueInstant: InstantType = Field(None, title="Instant") valueUri: UriType = Field(None, title="Uri") valueUrl: UrlType = Field(None, title="Url") valueBase64Binary: Base64BinaryType = Field(None, title="Base64Binary") ================================================ FILE: fhir/resources/STU3/tests/test_bundle.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Bundle Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from .. import bundle from .conftest import ExternalValidatorModel def impl_bundle_1(inst): assert ( inst.entry[0].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/tx-sct"} ).valueUri ) assert inst.entry[0].resource.id == "tx-sct" assert ( inst.entry[1].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/tx-rxnorm"} ).valueUri ) assert inst.entry[1].resource.id == "tx-rxnorm" assert ( inst.entry[2].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/tx-loinc"} ).valueUri ) assert inst.entry[2].resource.id == "tx-loinc" assert ( inst.entry[3].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/tx-ucum"} ).valueUri ) assert inst.entry[3].resource.id == "tx-ucum" assert ( inst.entry[4].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/tx-nci"} ).valueUri ) assert inst.entry[4].resource.id == "tx-nci" assert ( inst.entry[5].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/tx-cpt"} ).valueUri ) assert inst.entry[5].resource.id == "tx-cpt" assert ( inst.entry[6].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/tx-ndf-rt"} ).valueUri ) assert inst.entry[6].resource.id == "tx-ndf-rt" assert ( inst.entry[7].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/tx-unii"} ).valueUri ) assert inst.entry[7].resource.id == "tx-unii" assert ( inst.entry[8].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/tx-ndc"} ).valueUri ) assert inst.entry[8].resource.id == "tx-ndc" assert ( inst.entry[9].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/tx-cvx"} ).valueUri ) assert inst.entry[9].resource.id == "tx-cvx" assert inst.id == "terminologies" assert inst.type == "collection" def test_bundle_1(base_settings): """No. 1 tests collection for Bundle. Test File: bundle-namingsystem-terminologies(terminologies).json """ filename = ( base_settings["unittest_data_dir"] / "bundle-namingsystem-terminologies(terminologies).json" ) inst = bundle.Bundle.model_validate_json(filename.read_bytes()) assert "Bundle" == inst.get_resource_type() impl_bundle_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Bundle" == data["resourceType"] inst2 = bundle.Bundle(**data) impl_bundle_1(inst2) ================================================ FILE: fhir/resources/STU3/tests/test_capabilitystatement.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/CapabilityStatement Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from .. import capabilitystatement from .conftest import ExternalValidatorModel def impl_capabilitystatement_1(inst): assert inst.acceptUnknown == "no" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.experimental is True assert inst.fhirVersion == "3.0.2" assert inst.format[0] == "xml" assert inst.format[1] == "json" assert inst.id == "base2" assert inst.kind == "capability" assert inst.name == "Base FHIR Capability Statement (Empty)" assert inst.publisher == "FHIR Project Team" assert inst.rest[0].documentation == "An empty Capability Statement" assert inst.rest[0].mode == "server" assert inst.rest[0].resource[0].interaction[0].code == "read" assert ( inst.rest[0].resource[0].interaction[0].documentation == "Read CapabilityStatement Resource" ) assert inst.rest[0].resource[0].type == "CapabilityStatement" assert inst.rest[0].security.cors is True assert inst.rest[0].security.description == ( "This is the Capability Statement to declare that the server " "supports SMART-on-FHIR. See the SMART-on-FHIR docs for the " "extension that would go with such a server" ) assert inst.rest[0].security.service[0].coding[0].code == "SMART-on-FHIR" assert inst.rest[0].security.service[0].coding[0].display == "SMART-on-FHIR" assert ( inst.rest[0].security.service[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-security-service"} ).valueUri ) assert inst.rest[0].security.service[0].text == "See http://docs.smarthealthit.org/" assert inst.software.name == "Insert your softwware name here..." assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CapabilityStatement/base2"} ).valueUri ) assert inst.version == "3.0.2-11200" def test_capabilitystatement_1(base_settings): """No. 1 tests collection for CapabilityStatement. Test File: capabilitystatement-capabilitystatement-base2(base2).json """ filename = ( base_settings["unittest_data_dir"] / "capabilitystatement-capabilitystatement-base2(base2).json" ) inst = capabilitystatement.CapabilityStatement.model_validate_json( filename.read_bytes() ) assert "CapabilityStatement" == inst.get_resource_type() impl_capabilitystatement_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CapabilityStatement" == data["resourceType"] inst2 = capabilitystatement.CapabilityStatement(**data) impl_capabilitystatement_1(inst2) def impl_capabilitystatement_2(inst): assert inst.acceptUnknown == "both" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.experimental is True assert inst.fhirVersion == "3.0.2" assert inst.format[0] == "xml" assert inst.format[1] == "json" assert inst.id == "base" assert inst.kind == "capability" assert inst.name == "Base FHIR Capability Statement (Full)" assert inst.publisher == "FHIR Project Team" assert inst.rest[0].documentation == "All the functionality defined in FHIR" assert inst.rest[0].interaction[0].code == "transaction" assert inst.rest[0].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].interaction[1].code == "batch" assert inst.rest[0].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].interaction[2].code == "history-system" assert inst.rest[0].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].interaction[3].code == "search-system" assert inst.rest[0].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].mode == "server" assert ( inst.rest[0].operation[0].definition.reference == "http://hl7.org/fhir/OperationDefinition/resource-validate" ) assert inst.rest[0].operation[0].name == "validate" assert ( inst.rest[0].operation[1].definition.reference == "http://hl7.org/fhir/OperationDefinition/resource-meta" ) assert inst.rest[0].operation[1].name == "meta" assert ( inst.rest[0].operation[2].definition.reference == "http://hl7.org/fhir/OperationDefinition/resource-meta-add" ) assert inst.rest[0].operation[2].name == "meta-add" assert ( inst.rest[0].operation[3].definition.reference == "http://hl7.org/fhir/OperationDefinition/resource-meta-delete" ) assert inst.rest[0].operation[3].name == "meta-delete" assert inst.rest[0].operation[4].definition.reference == ( "http://hl7.org/fhir/OperationDefinition/activitydefinition-" "apply" ) assert inst.rest[0].operation[4].name == "apply" assert inst.rest[0].operation[5].definition.reference == ( "http://hl7.org/fhir/OperationDefinition/activitydefinition-" "data-requirements" ) assert inst.rest[0].operation[5].name == "data-requirements" assert inst.rest[0].operation[6].definition.reference == ( "http://hl7.org/fhir/OperationDefinition/capabilitystatement-" "subset" ) assert inst.rest[0].operation[6].name == "subset" assert inst.rest[0].operation[7].definition.reference == ( "http://hl7.org/fhir/OperationDefinition/capabilitystatement-" "implements" ) assert inst.rest[0].operation[7].name == "implements" assert inst.rest[0].operation[8].definition.reference == ( "http://hl7.org/fhir/OperationDefinition/capabilitystatement-" "conforms" ) assert inst.rest[0].operation[8].name == "conforms" assert ( inst.rest[0].operation[9].definition.reference == "http://hl7.org/fhir/OperationDefinition/codesystem-lookup" ) assert inst.rest[0].operation[9].name == "lookup" assert inst.rest[0].resource[0].conditionalCreate is True assert inst.rest[0].resource[0].conditionalDelete == "multiple" assert inst.rest[0].resource[0].conditionalUpdate is True assert inst.rest[0].resource[0].interaction[0].code == "read" assert inst.rest[0].resource[0].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[0].interaction[1].code == "vread" assert inst.rest[0].resource[0].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[0].interaction[2].code == "update" assert inst.rest[0].resource[0].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[0].interaction[3].code == "delete" assert inst.rest[0].resource[0].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[0].interaction[4].code == "history-instance" assert inst.rest[0].resource[0].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[0].interaction[5].code == "history-type" assert inst.rest[0].resource[0].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[0].interaction[6].code == "create" assert inst.rest[0].resource[0].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[0].interaction[7].code == "search-type" assert inst.rest[0].resource[0].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[0].profile.reference == "http://hl7.org/fhir/StructureDefinition/Account" ) assert inst.rest[0].resource[0].referencePolicy[0] == "literal" assert inst.rest[0].resource[0].referencePolicy[1] == "logical" assert inst.rest[0].resource[0].searchInclude[0] == "Account.owner" assert inst.rest[0].resource[0].searchInclude[1] == "Account.subject" assert inst.rest[0].resource[0].searchInclude[2] == "Account.patient" assert ( inst.rest[0].resource[0].searchParam[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Account-owner"} ).valueUri ) assert ( inst.rest[0].resource[0].searchParam[0].documentation == "Who is responsible?" ) assert inst.rest[0].resource[0].searchParam[0].name == "owner" assert inst.rest[0].resource[0].searchParam[0].type == "reference" assert ( inst.rest[0].resource[0].searchParam[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Account-identifier"} ).valueUri ) assert inst.rest[0].resource[0].searchParam[1].documentation == "Account number" assert inst.rest[0].resource[0].searchParam[1].name == "identifier" assert inst.rest[0].resource[0].searchParam[1].type == "token" assert ( inst.rest[0].resource[0].searchParam[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Account-period"} ).valueUri ) assert inst.rest[0].resource[0].searchParam[2].documentation == "Transaction window" assert inst.rest[0].resource[0].searchParam[2].name == "period" assert inst.rest[0].resource[0].searchParam[2].type == "date" assert ( inst.rest[0].resource[0].searchParam[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Account-balance"} ).valueUri ) assert ( inst.rest[0].resource[0].searchParam[3].documentation == "How much is in account?" ) assert inst.rest[0].resource[0].searchParam[3].name == "balance" assert inst.rest[0].resource[0].searchParam[3].type == "quantity" assert ( inst.rest[0].resource[0].searchParam[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Account-subject"} ).valueUri ) assert ( inst.rest[0].resource[0].searchParam[4].documentation == "What is account tied to?" ) assert inst.rest[0].resource[0].searchParam[4].name == "subject" assert inst.rest[0].resource[0].searchParam[4].type == "reference" assert ( inst.rest[0].resource[0].searchParam[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Account-patient"} ).valueUri ) assert ( inst.rest[0].resource[0].searchParam[5].documentation == "What is account tied to?" ) assert inst.rest[0].resource[0].searchParam[5].name == "patient" assert inst.rest[0].resource[0].searchParam[5].type == "reference" assert ( inst.rest[0].resource[0].searchParam[6].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Account-name"} ).valueUri ) assert ( inst.rest[0].resource[0].searchParam[6].documentation == "Human-readable label" ) assert inst.rest[0].resource[0].searchParam[6].name == "name" assert inst.rest[0].resource[0].searchParam[6].type == "string" assert ( inst.rest[0].resource[0].searchParam[7].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Account-type"} ).valueUri ) assert ( inst.rest[0].resource[0].searchParam[7].documentation == "E.g. patient, expense, depreciation" ) assert inst.rest[0].resource[0].searchParam[7].name == "type" assert inst.rest[0].resource[0].searchParam[7].type == "token" assert ( inst.rest[0].resource[0].searchParam[8].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Account-status"} ).valueUri ) assert ( inst.rest[0].resource[0].searchParam[8].documentation == "active | inactive | entered-in-error" ) assert inst.rest[0].resource[0].searchParam[8].name == "status" assert inst.rest[0].resource[0].searchParam[8].type == "token" assert inst.rest[0].resource[0].searchRevInclude[0] == "ChargeItem.account" assert inst.rest[0].resource[0].type == "Account" assert inst.rest[0].resource[1].conditionalCreate is True assert inst.rest[0].resource[1].conditionalDelete == "multiple" assert inst.rest[0].resource[1].conditionalUpdate is True assert inst.rest[0].resource[1].interaction[0].code == "read" assert inst.rest[0].resource[1].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[1].interaction[1].code == "vread" assert inst.rest[0].resource[1].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[1].interaction[2].code == "update" assert inst.rest[0].resource[1].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[1].interaction[3].code == "delete" assert inst.rest[0].resource[1].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[1].interaction[4].code == "history-instance" assert inst.rest[0].resource[1].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[1].interaction[5].code == "history-type" assert inst.rest[0].resource[1].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[1].interaction[6].code == "create" assert inst.rest[0].resource[1].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[1].interaction[7].code == "search-type" assert inst.rest[0].resource[1].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[1].profile.reference == "http://hl7.org/fhir/StructureDefinition/ActivityDefinition" ) assert inst.rest[0].resource[1].referencePolicy[0] == "literal" assert inst.rest[0].resource[1].referencePolicy[1] == "logical" assert inst.rest[0].resource[1].searchInclude[0] == "ActivityDefinition.successor" assert ( inst.rest[0].resource[1].searchInclude[1] == "ActivityDefinition.derived-from" ) assert inst.rest[0].resource[1].searchInclude[2] == "ActivityDefinition.predecessor" assert inst.rest[0].resource[1].searchInclude[3] == "ActivityDefinition.composed-of" assert inst.rest[0].resource[1].searchInclude[4] == "ActivityDefinition.depends-on" assert ( inst.rest[0].resource[1].searchParam[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/ActivityDefinition-date"} ).valueUri ) assert ( inst.rest[0].resource[1].searchParam[0].documentation == "The activity definition publication date" ) assert inst.rest[0].resource[1].searchParam[0].name == "date" assert inst.rest[0].resource[1].searchParam[0].type == "date" assert ( inst.rest[0].resource[1].searchParam[1].definition == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/ActivityDefinition-identifier" } ).valueUri ) assert ( inst.rest[0].resource[1].searchParam[1].documentation == "External identifier for the activity definition" ) assert inst.rest[0].resource[1].searchParam[1].name == "identifier" assert inst.rest[0].resource[1].searchParam[1].type == "token" assert ( inst.rest[0].resource[1].searchParam[2].definition == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/ActivityDefinition-successor" } ).valueUri ) assert ( inst.rest[0].resource[1].searchParam[2].documentation == "What resource is being referenced" ) assert inst.rest[0].resource[1].searchParam[2].name == "successor" assert inst.rest[0].resource[1].searchParam[2].type == "reference" assert ( inst.rest[0].resource[1].searchParam[3].definition == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/ActivityDefinition-jurisdiction" } ).valueUri ) assert ( inst.rest[0].resource[1].searchParam[3].documentation == "Intended jurisdiction for the activity definition" ) assert inst.rest[0].resource[1].searchParam[3].name == "jurisdiction" assert inst.rest[0].resource[1].searchParam[3].type == "token" assert ( inst.rest[0].resource[1].searchParam[4].definition == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/ActivityDefinition-description" } ).valueUri ) assert ( inst.rest[0].resource[1].searchParam[4].documentation == "The description of the activity definition" ) assert inst.rest[0].resource[1].searchParam[4].name == "description" assert inst.rest[0].resource[1].searchParam[4].type == "string" assert ( inst.rest[0].resource[1].searchParam[5].definition == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/ActivityDefinition-derived-from" } ).valueUri ) assert ( inst.rest[0].resource[1].searchParam[5].documentation == "What resource is being referenced" ) assert inst.rest[0].resource[1].searchParam[5].name == "derived-from" assert inst.rest[0].resource[1].searchParam[5].type == "reference" assert ( inst.rest[0].resource[1].searchParam[6].definition == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/ActivityDefinition-predecessor" } ).valueUri ) assert ( inst.rest[0].resource[1].searchParam[6].documentation == "What resource is being referenced" ) assert inst.rest[0].resource[1].searchParam[6].name == "predecessor" assert inst.rest[0].resource[1].searchParam[6].type == "reference" assert ( inst.rest[0].resource[1].searchParam[7].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/ActivityDefinition-title"} ).valueUri ) assert ( inst.rest[0].resource[1].searchParam[7].documentation == "The human-friendly name of the activity definition" ) assert inst.rest[0].resource[1].searchParam[7].name == "title" assert inst.rest[0].resource[1].searchParam[7].type == "string" assert ( inst.rest[0].resource[1].searchParam[8].definition == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/ActivityDefinition-composed-of" } ).valueUri ) assert ( inst.rest[0].resource[1].searchParam[8].documentation == "What resource is being referenced" ) assert inst.rest[0].resource[1].searchParam[8].name == "composed-of" assert inst.rest[0].resource[1].searchParam[8].type == "reference" assert ( inst.rest[0].resource[1].searchParam[9].definition == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/ActivityDefinition-version" } ).valueUri ) assert ( inst.rest[0].resource[1].searchParam[9].documentation == "The business version of the activity definition" ) assert inst.rest[0].resource[1].searchParam[9].name == "version" assert inst.rest[0].resource[1].searchParam[9].type == "token" assert inst.rest[0].resource[1].searchRevInclude[0] == "Communication.definition" assert inst.rest[0].resource[1].searchRevInclude[1] == "DeviceRequest.definition" assert inst.rest[0].resource[1].searchRevInclude[2] == "Procedure.definition" assert inst.rest[0].resource[1].searchRevInclude[3] == "ProcedureRequest.definition" assert inst.rest[0].resource[1].searchRevInclude[4] == "ReferralRequest.definition" assert inst.rest[0].resource[1].type == "ActivityDefinition" assert inst.rest[0].resource[2].conditionalCreate is True assert inst.rest[0].resource[2].conditionalDelete == "multiple" assert inst.rest[0].resource[2].conditionalUpdate is True assert inst.rest[0].resource[2].interaction[0].code == "read" assert inst.rest[0].resource[2].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[2].interaction[1].code == "vread" assert inst.rest[0].resource[2].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[2].interaction[2].code == "update" assert inst.rest[0].resource[2].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[2].interaction[3].code == "delete" assert inst.rest[0].resource[2].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[2].interaction[4].code == "history-instance" assert inst.rest[0].resource[2].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[2].interaction[5].code == "history-type" assert inst.rest[0].resource[2].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[2].interaction[6].code == "create" assert inst.rest[0].resource[2].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[2].interaction[7].code == "search-type" assert inst.rest[0].resource[2].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[2].profile.reference == "http://hl7.org/fhir/StructureDefinition/AdverseEvent" ) assert inst.rest[0].resource[2].referencePolicy[0] == "literal" assert inst.rest[0].resource[2].referencePolicy[1] == "logical" assert inst.rest[0].resource[2].searchInclude[0] == "AdverseEvent.recorder" assert inst.rest[0].resource[2].searchInclude[1] == "AdverseEvent.study" assert inst.rest[0].resource[2].searchInclude[2] == "AdverseEvent.reaction" assert inst.rest[0].resource[2].searchInclude[3] == "AdverseEvent.subject" assert inst.rest[0].resource[2].searchInclude[4] == "AdverseEvent.substance" assert inst.rest[0].resource[2].searchInclude[5] == "AdverseEvent.location" assert ( inst.rest[0].resource[2].searchParam[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/AdverseEvent-date"} ).valueUri ) assert ( inst.rest[0].resource[2].searchParam[0].documentation == "When the event occurred" ) assert inst.rest[0].resource[2].searchParam[0].name == "date" assert inst.rest[0].resource[2].searchParam[0].type == "date" assert ( inst.rest[0].resource[2].searchParam[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/AdverseEvent-recorder"} ).valueUri ) assert ( inst.rest[0].resource[2].searchParam[1].documentation == "Who recorded the adverse event" ) assert inst.rest[0].resource[2].searchParam[1].name == "recorder" assert inst.rest[0].resource[2].searchParam[1].type == "reference" assert ( inst.rest[0].resource[2].searchParam[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/AdverseEvent-study"} ).valueUri ) assert inst.rest[0].resource[2].searchParam[2].documentation == "AdverseEvent.study" assert inst.rest[0].resource[2].searchParam[2].name == "study" assert inst.rest[0].resource[2].searchParam[2].type == "reference" assert ( inst.rest[0].resource[2].searchParam[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/AdverseEvent-reaction"} ).valueUri ) assert ( inst.rest[0].resource[2].searchParam[3].documentation == "Adverse Reaction Events linked to exposure to substance" ) assert inst.rest[0].resource[2].searchParam[3].name == "reaction" assert inst.rest[0].resource[2].searchParam[3].type == "reference" assert ( inst.rest[0].resource[2].searchParam[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/AdverseEvent-seriousness"} ).valueUri ) assert ( inst.rest[0].resource[2].searchParam[4].documentation == "Mild | Moderate | Severe" ) assert inst.rest[0].resource[2].searchParam[4].name == "seriousness" assert inst.rest[0].resource[2].searchParam[4].type == "token" assert ( inst.rest[0].resource[2].searchParam[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/AdverseEvent-subject"} ).valueUri ) assert ( inst.rest[0].resource[2].searchParam[5].documentation == "Subject or group impacted by event" ) assert inst.rest[0].resource[2].searchParam[5].name == "subject" assert inst.rest[0].resource[2].searchParam[5].type == "reference" assert ( inst.rest[0].resource[2].searchParam[6].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/AdverseEvent-substance"} ).valueUri ) assert ( inst.rest[0].resource[2].searchParam[6].documentation == "Refers to the specific entity that caused the adverse event" ) assert inst.rest[0].resource[2].searchParam[6].name == "substance" assert inst.rest[0].resource[2].searchParam[6].type == "reference" assert ( inst.rest[0].resource[2].searchParam[7].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/AdverseEvent-location"} ).valueUri ) assert ( inst.rest[0].resource[2].searchParam[7].documentation == "Location where adverse event occurred" ) assert inst.rest[0].resource[2].searchParam[7].name == "location" assert inst.rest[0].resource[2].searchParam[7].type == "reference" assert ( inst.rest[0].resource[2].searchParam[8].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/AdverseEvent-category"} ).valueUri ) assert inst.rest[0].resource[2].searchParam[8].name == "category" assert inst.rest[0].resource[2].searchParam[8].type == "token" assert ( inst.rest[0].resource[2].searchParam[9].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/AdverseEvent-type"} ).valueUri ) assert inst.rest[0].resource[2].searchParam[9].documentation == "actual | potential" assert inst.rest[0].resource[2].searchParam[9].name == "type" assert inst.rest[0].resource[2].searchParam[9].type == "token" assert inst.rest[0].resource[2].type == "AdverseEvent" assert inst.rest[0].resource[3].conditionalCreate is True assert inst.rest[0].resource[3].conditionalDelete == "multiple" assert inst.rest[0].resource[3].conditionalUpdate is True assert inst.rest[0].resource[3].interaction[0].code == "read" assert inst.rest[0].resource[3].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[3].interaction[1].code == "vread" assert inst.rest[0].resource[3].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[3].interaction[2].code == "update" assert inst.rest[0].resource[3].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[3].interaction[3].code == "delete" assert inst.rest[0].resource[3].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[3].interaction[4].code == "history-instance" assert inst.rest[0].resource[3].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[3].interaction[5].code == "history-type" assert inst.rest[0].resource[3].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[3].interaction[6].code == "create" assert inst.rest[0].resource[3].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[3].interaction[7].code == "search-type" assert inst.rest[0].resource[3].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[3].profile.reference == "http://hl7.org/fhir/StructureDefinition/AllergyIntolerance" ) assert inst.rest[0].resource[3].referencePolicy[0] == "literal" assert inst.rest[0].resource[3].referencePolicy[1] == "logical" assert inst.rest[0].resource[3].searchInclude[0] == "AllergyIntolerance.recorder" assert inst.rest[0].resource[3].searchInclude[1] == "AllergyIntolerance.asserter" assert inst.rest[0].resource[3].searchInclude[2] == "AllergyIntolerance.patient" assert ( inst.rest[0].resource[3].searchParam[0].definition == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/AllergyIntolerance-severity" } ).valueUri ) assert ( inst.rest[0].resource[3].searchParam[0].documentation == "mild | moderate | severe (of event as a whole)" ) assert inst.rest[0].resource[3].searchParam[0].name == "severity" assert inst.rest[0].resource[3].searchParam[0].type == "token" assert ( inst.rest[0].resource[3].searchParam[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/clinical-date"} ).valueUri ) assert ( inst.rest[0].resource[3].searchParam[1].documentation == "Date record was believed accurate" ) assert inst.rest[0].resource[3].searchParam[1].name == "date" assert inst.rest[0].resource[3].searchParam[1].type == "date" assert ( inst.rest[0].resource[3].searchParam[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/clinical-identifier"} ).valueUri ) assert ( inst.rest[0].resource[3].searchParam[2].documentation == "External ids for this item" ) assert inst.rest[0].resource[3].searchParam[2].name == "identifier" assert inst.rest[0].resource[3].searchParam[2].type == "token" assert ( inst.rest[0].resource[3].searchParam[3].definition == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/AllergyIntolerance-manifestation" } ).valueUri ) assert ( inst.rest[0].resource[3].searchParam[3].documentation == "Clinical symptoms/signs associated with the Event" ) assert inst.rest[0].resource[3].searchParam[3].name == "manifestation" assert inst.rest[0].resource[3].searchParam[3].type == "token" assert ( inst.rest[0].resource[3].searchParam[4].definition == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/AllergyIntolerance-recorder" } ).valueUri ) assert ( inst.rest[0].resource[3].searchParam[4].documentation == "Who recorded the sensitivity" ) assert inst.rest[0].resource[3].searchParam[4].name == "recorder" assert inst.rest[0].resource[3].searchParam[4].type == "reference" assert ( inst.rest[0].resource[3].searchParam[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/clinical-code"} ).valueUri ) assert ( inst.rest[0].resource[3].searchParam[5].documentation == "Code that identifies the allergy or intolerance" ) assert inst.rest[0].resource[3].searchParam[5].name == "code" assert inst.rest[0].resource[3].searchParam[5].type == "token" assert ( inst.rest[0].resource[3].searchParam[6].definition == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/AllergyIntolerance-verification-status" } ).valueUri ) assert ( inst.rest[0].resource[3].searchParam[6].documentation == "unconfirmed | confirmed | refuted | entered-in-error" ) assert inst.rest[0].resource[3].searchParam[6].name == "verification-status" assert inst.rest[0].resource[3].searchParam[6].type == "token" assert ( inst.rest[0].resource[3].searchParam[7].definition == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/AllergyIntolerance-criticality" } ).valueUri ) assert ( inst.rest[0].resource[3].searchParam[7].documentation == "low | high | unable-to-assess" ) assert inst.rest[0].resource[3].searchParam[7].name == "criticality" assert inst.rest[0].resource[3].searchParam[7].type == "token" assert ( inst.rest[0].resource[3].searchParam[8].definition == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/AllergyIntolerance-clinical-status" } ).valueUri ) assert ( inst.rest[0].resource[3].searchParam[8].documentation == "active | inactive | resolved" ) assert inst.rest[0].resource[3].searchParam[8].name == "clinical-status" assert inst.rest[0].resource[3].searchParam[8].type == "token" assert ( inst.rest[0].resource[3].searchParam[9].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/clinical-type"} ).valueUri ) assert ( inst.rest[0].resource[3].searchParam[9].documentation == "allergy | intolerance - Underlying mechanism (if known)" ) assert inst.rest[0].resource[3].searchParam[9].name == "type" assert inst.rest[0].resource[3].searchParam[9].type == "token" assert inst.rest[0].resource[3].searchRevInclude[0] == "ClinicalImpression.problem" assert ( inst.rest[0].resource[3].searchRevInclude[1] == "ImmunizationRecommendation.information" ) assert inst.rest[0].resource[3].type == "AllergyIntolerance" assert inst.rest[0].resource[4].conditionalCreate is True assert inst.rest[0].resource[4].conditionalDelete == "multiple" assert inst.rest[0].resource[4].conditionalUpdate is True assert inst.rest[0].resource[4].interaction[0].code == "read" assert inst.rest[0].resource[4].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[4].interaction[1].code == "vread" assert inst.rest[0].resource[4].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[4].interaction[2].code == "update" assert inst.rest[0].resource[4].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[4].interaction[3].code == "delete" assert inst.rest[0].resource[4].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[4].interaction[4].code == "history-instance" assert inst.rest[0].resource[4].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[4].interaction[5].code == "history-type" assert inst.rest[0].resource[4].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[4].interaction[6].code == "create" assert inst.rest[0].resource[4].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[4].interaction[7].code == "search-type" assert inst.rest[0].resource[4].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[4].profile.reference == "http://hl7.org/fhir/StructureDefinition/Appointment" ) assert inst.rest[0].resource[4].referencePolicy[0] == "literal" assert inst.rest[0].resource[4].referencePolicy[1] == "logical" assert inst.rest[0].resource[4].searchInclude[0] == "Appointment.actor" assert inst.rest[0].resource[4].searchInclude[1] == "Appointment.practitioner" assert inst.rest[0].resource[4].searchInclude[2] == "Appointment.incomingreferral" assert inst.rest[0].resource[4].searchInclude[3] == "Appointment.patient" assert inst.rest[0].resource[4].searchInclude[4] == "Appointment.location" assert ( inst.rest[0].resource[4].searchParam[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Appointment-date"} ).valueUri ) assert ( inst.rest[0].resource[4].searchParam[0].documentation == "Appointment date/time." ) assert inst.rest[0].resource[4].searchParam[0].name == "date" assert inst.rest[0].resource[4].searchParam[0].type == "date" assert ( inst.rest[0].resource[4].searchParam[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Appointment-actor"} ).valueUri ) assert ( inst.rest[0].resource[4].searchParam[1].documentation == "Any one of the individuals participating in the appointment" ) assert inst.rest[0].resource[4].searchParam[1].name == "actor" assert inst.rest[0].resource[4].searchParam[1].type == "reference" assert ( inst.rest[0].resource[4].searchParam[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Appointment-identifier"} ).valueUri ) assert ( inst.rest[0].resource[4].searchParam[2].documentation == "An Identifier of the Appointment" ) assert inst.rest[0].resource[4].searchParam[2].name == "identifier" assert inst.rest[0].resource[4].searchParam[2].type == "token" assert ( inst.rest[0].resource[4].searchParam[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Appointment-practitioner"} ).valueUri ) assert inst.rest[0].resource[4].searchParam[3].documentation == ( "One of the individuals of the appointment is this " "practitioner" ) assert inst.rest[0].resource[4].searchParam[3].name == "practitioner" assert inst.rest[0].resource[4].searchParam[3].type == "reference" assert ( inst.rest[0].resource[4].searchParam[4].definition == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/Appointment-incomingreferral" } ).valueUri ) assert inst.rest[0].resource[4].searchParam[4].documentation == ( "The ReferralRequest provided as information to allocate to " "the Encounter" ) assert inst.rest[0].resource[4].searchParam[4].name == "incomingreferral" assert inst.rest[0].resource[4].searchParam[4].type == "reference" assert ( inst.rest[0].resource[4].searchParam[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Appointment-part-status"} ).valueUri ) assert inst.rest[0].resource[4].searchParam[5].documentation == ( "The Participation status of the subject, or other " "participant on the appointment. Can be used to locate " "participants that have not responded to meeting requests." ) assert inst.rest[0].resource[4].searchParam[5].name == "part-status" assert inst.rest[0].resource[4].searchParam[5].type == "token" assert ( inst.rest[0].resource[4].searchParam[6].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Appointment-patient"} ).valueUri ) assert ( inst.rest[0].resource[4].searchParam[6].documentation == "One of the individuals of the appointment is this patient" ) assert inst.rest[0].resource[4].searchParam[6].name == "patient" assert inst.rest[0].resource[4].searchParam[6].type == "reference" assert ( inst.rest[0].resource[4].searchParam[7].definition == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/Appointment-appointment-type" } ).valueUri ) assert inst.rest[0].resource[4].searchParam[7].documentation == ( "The style of appointment or patient that has been booked in " "the slot (not service type)" ) assert inst.rest[0].resource[4].searchParam[7].name == "appointment-type" assert inst.rest[0].resource[4].searchParam[7].type == "token" assert ( inst.rest[0].resource[4].searchParam[8].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Appointment-service-type"} ).valueUri ) assert inst.rest[0].resource[4].searchParam[8].documentation == ( "The specific service that is to be performed during this " "appointment" ) assert inst.rest[0].resource[4].searchParam[8].name == "service-type" assert inst.rest[0].resource[4].searchParam[8].type == "token" assert ( inst.rest[0].resource[4].searchParam[9].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Appointment-location"} ).valueUri ) assert inst.rest[0].resource[4].searchParam[9].documentation == ( "This location is listed in the participants of the " "appointment" ) assert inst.rest[0].resource[4].searchParam[9].name == "location" assert inst.rest[0].resource[4].searchParam[9].type == "reference" assert ( inst.rest[0].resource[4].searchRevInclude[0] == "AppointmentResponse.appointment" ) assert inst.rest[0].resource[4].searchRevInclude[1] == "CarePlan.activity-reference" assert inst.rest[0].resource[4].searchRevInclude[2] == "ClinicalImpression.action" assert inst.rest[0].resource[4].searchRevInclude[3] == "Encounter.appointment" assert inst.rest[0].resource[4].type == "Appointment" assert inst.rest[0].resource[5].conditionalCreate is True assert inst.rest[0].resource[5].conditionalDelete == "multiple" assert inst.rest[0].resource[5].conditionalUpdate is True assert inst.rest[0].resource[5].interaction[0].code == "read" assert inst.rest[0].resource[5].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[5].interaction[1].code == "vread" assert inst.rest[0].resource[5].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[5].interaction[2].code == "update" assert inst.rest[0].resource[5].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[5].interaction[3].code == "delete" assert inst.rest[0].resource[5].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[5].interaction[4].code == "history-instance" assert inst.rest[0].resource[5].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[5].interaction[5].code == "history-type" assert inst.rest[0].resource[5].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[5].interaction[6].code == "create" assert inst.rest[0].resource[5].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[5].interaction[7].code == "search-type" assert inst.rest[0].resource[5].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[5].profile.reference == "http://hl7.org/fhir/StructureDefinition/AppointmentResponse" ) assert inst.rest[0].resource[5].referencePolicy[0] == "literal" assert inst.rest[0].resource[5].referencePolicy[1] == "logical" assert inst.rest[0].resource[5].searchInclude[0] == "AppointmentResponse.actor" assert ( inst.rest[0].resource[5].searchInclude[1] == "AppointmentResponse.practitioner" ) assert inst.rest[0].resource[5].searchInclude[2] == "AppointmentResponse.patient" assert ( inst.rest[0].resource[5].searchInclude[3] == "AppointmentResponse.appointment" ) assert inst.rest[0].resource[5].searchInclude[4] == "AppointmentResponse.location" assert ( inst.rest[0].resource[5].searchParam[0].definition == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/AppointmentResponse-actor" } ).valueUri ) assert inst.rest[0].resource[5].searchParam[0].documentation == ( "The Person, Location/HealthcareService or Device that this " "appointment response replies for" ) assert inst.rest[0].resource[5].searchParam[0].name == "actor" assert inst.rest[0].resource[5].searchParam[0].type == "reference" assert ( inst.rest[0].resource[5].searchParam[1].definition == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/AppointmentResponse-identifier" } ).valueUri ) assert ( inst.rest[0].resource[5].searchParam[1].documentation == "An Identifier in this appointment response" ) assert inst.rest[0].resource[5].searchParam[1].name == "identifier" assert inst.rest[0].resource[5].searchParam[1].type == "token" assert ( inst.rest[0].resource[5].searchParam[2].definition == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/AppointmentResponse-practitioner" } ).valueUri ) assert ( inst.rest[0].resource[5].searchParam[2].documentation == "This Response is for this Practitioner" ) assert inst.rest[0].resource[5].searchParam[2].name == "practitioner" assert inst.rest[0].resource[5].searchParam[2].type == "reference" assert ( inst.rest[0].resource[5].searchParam[3].definition == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/AppointmentResponse-part-status" } ).valueUri ) assert ( inst.rest[0].resource[5].searchParam[3].documentation == "The participants acceptance status for this appointment" ) assert inst.rest[0].resource[5].searchParam[3].name == "part-status" assert inst.rest[0].resource[5].searchParam[3].type == "token" assert ( inst.rest[0].resource[5].searchParam[4].definition == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/AppointmentResponse-patient" } ).valueUri ) assert ( inst.rest[0].resource[5].searchParam[4].documentation == "This Response is for this Patient" ) assert inst.rest[0].resource[5].searchParam[4].name == "patient" assert inst.rest[0].resource[5].searchParam[4].type == "reference" assert ( inst.rest[0].resource[5].searchParam[5].definition == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/AppointmentResponse-appointment" } ).valueUri ) assert ( inst.rest[0].resource[5].searchParam[5].documentation == "The appointment that the response is attached to" ) assert inst.rest[0].resource[5].searchParam[5].name == "appointment" assert inst.rest[0].resource[5].searchParam[5].type == "reference" assert ( inst.rest[0].resource[5].searchParam[6].definition == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/AppointmentResponse-location" } ).valueUri ) assert ( inst.rest[0].resource[5].searchParam[6].documentation == "This Response is for this Location" ) assert inst.rest[0].resource[5].searchParam[6].name == "location" assert inst.rest[0].resource[5].searchParam[6].type == "reference" assert inst.rest[0].resource[5].type == "AppointmentResponse" assert inst.rest[0].resource[6].conditionalCreate is True assert inst.rest[0].resource[6].conditionalDelete == "multiple" assert inst.rest[0].resource[6].conditionalUpdate is True assert inst.rest[0].resource[6].interaction[0].code == "read" assert inst.rest[0].resource[6].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[6].interaction[1].code == "vread" assert inst.rest[0].resource[6].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[6].interaction[2].code == "update" assert inst.rest[0].resource[6].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[6].interaction[3].code == "delete" assert inst.rest[0].resource[6].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[6].interaction[4].code == "history-instance" assert inst.rest[0].resource[6].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[6].interaction[5].code == "history-type" assert inst.rest[0].resource[6].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[6].interaction[6].code == "create" assert inst.rest[0].resource[6].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[6].interaction[7].code == "search-type" assert inst.rest[0].resource[6].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[6].profile.reference == "http://hl7.org/fhir/StructureDefinition/AuditEvent" ) assert inst.rest[0].resource[6].referencePolicy[0] == "literal" assert inst.rest[0].resource[6].referencePolicy[1] == "logical" assert inst.rest[0].resource[6].searchInclude[0] == "AuditEvent.agent" assert inst.rest[0].resource[6].searchInclude[1] == "AuditEvent.patient" assert inst.rest[0].resource[6].searchInclude[2] == "AuditEvent.entity" assert ( inst.rest[0].resource[6].searchParam[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/AuditEvent-date"} ).valueUri ) assert ( inst.rest[0].resource[6].searchParam[0].documentation == "Time when the event occurred on source" ) assert inst.rest[0].resource[6].searchParam[0].name == "date" assert inst.rest[0].resource[6].searchParam[0].type == "date" assert ( inst.rest[0].resource[6].searchParam[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/AuditEvent-entity-type"} ).valueUri ) assert ( inst.rest[0].resource[6].searchParam[1].documentation == "Type of entity involved" ) assert inst.rest[0].resource[6].searchParam[1].name == "entity-type" assert inst.rest[0].resource[6].searchParam[1].type == "token" assert ( inst.rest[0].resource[6].searchParam[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/AuditEvent-agent"} ).valueUri ) assert ( inst.rest[0].resource[6].searchParam[2].documentation == "Direct reference to resource" ) assert inst.rest[0].resource[6].searchParam[2].name == "agent" assert inst.rest[0].resource[6].searchParam[2].type == "reference" assert ( inst.rest[0].resource[6].searchParam[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/AuditEvent-address"} ).valueUri ) assert ( inst.rest[0].resource[6].searchParam[3].documentation == "Identifier for the network access point of the user device" ) assert inst.rest[0].resource[6].searchParam[3].name == "address" assert inst.rest[0].resource[6].searchParam[3].type == "string" assert ( inst.rest[0].resource[6].searchParam[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/AuditEvent-entity-role"} ).valueUri ) assert ( inst.rest[0].resource[6].searchParam[4].documentation == "What role the entity played" ) assert inst.rest[0].resource[6].searchParam[4].name == "entity-role" assert inst.rest[0].resource[6].searchParam[4].type == "token" assert ( inst.rest[0].resource[6].searchParam[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/AuditEvent-source"} ).valueUri ) assert ( inst.rest[0].resource[6].searchParam[5].documentation == "The identity of source detecting the event" ) assert inst.rest[0].resource[6].searchParam[5].name == "source" assert inst.rest[0].resource[6].searchParam[5].type == "token" assert ( inst.rest[0].resource[6].searchParam[6].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/AuditEvent-type"} ).valueUri ) assert ( inst.rest[0].resource[6].searchParam[6].documentation == "Type/identifier of event" ) assert inst.rest[0].resource[6].searchParam[6].name == "type" assert inst.rest[0].resource[6].searchParam[6].type == "token" assert ( inst.rest[0].resource[6].searchParam[7].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/AuditEvent-altid"} ).valueUri ) assert ( inst.rest[0].resource[6].searchParam[7].documentation == "Alternative User id e.g. authentication" ) assert inst.rest[0].resource[6].searchParam[7].name == "altid" assert inst.rest[0].resource[6].searchParam[7].type == "token" assert ( inst.rest[0].resource[6].searchParam[8].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/AuditEvent-site"} ).valueUri ) assert ( inst.rest[0].resource[6].searchParam[8].documentation == "Logical source location within the enterprise" ) assert inst.rest[0].resource[6].searchParam[8].name == "site" assert inst.rest[0].resource[6].searchParam[8].type == "token" assert ( inst.rest[0].resource[6].searchParam[9].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/AuditEvent-agent-name"} ).valueUri ) assert ( inst.rest[0].resource[6].searchParam[9].documentation == "Human-meaningful name for the agent" ) assert inst.rest[0].resource[6].searchParam[9].name == "agent-name" assert inst.rest[0].resource[6].searchParam[9].type == "string" assert inst.rest[0].resource[6].type == "AuditEvent" assert inst.rest[0].resource[7].conditionalCreate is True assert inst.rest[0].resource[7].conditionalDelete == "multiple" assert inst.rest[0].resource[7].conditionalUpdate is True assert inst.rest[0].resource[7].interaction[0].code == "read" assert inst.rest[0].resource[7].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[7].interaction[1].code == "vread" assert inst.rest[0].resource[7].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[7].interaction[2].code == "update" assert inst.rest[0].resource[7].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[7].interaction[3].code == "delete" assert inst.rest[0].resource[7].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[7].interaction[4].code == "history-instance" assert inst.rest[0].resource[7].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[7].interaction[5].code == "history-type" assert inst.rest[0].resource[7].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[7].interaction[6].code == "create" assert inst.rest[0].resource[7].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[7].interaction[7].code == "search-type" assert inst.rest[0].resource[7].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[7].profile.reference == "http://hl7.org/fhir/StructureDefinition/Basic" ) assert inst.rest[0].resource[7].referencePolicy[0] == "literal" assert inst.rest[0].resource[7].referencePolicy[1] == "logical" assert inst.rest[0].resource[7].searchInclude[0] == "Basic.subject" assert inst.rest[0].resource[7].searchInclude[1] == "Basic.patient" assert inst.rest[0].resource[7].searchInclude[2] == "Basic.author" assert ( inst.rest[0].resource[7].searchParam[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Basic-identifier"} ).valueUri ) assert ( inst.rest[0].resource[7].searchParam[0].documentation == "Business identifier" ) assert inst.rest[0].resource[7].searchParam[0].name == "identifier" assert inst.rest[0].resource[7].searchParam[0].type == "token" assert ( inst.rest[0].resource[7].searchParam[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Basic-code"} ).valueUri ) assert inst.rest[0].resource[7].searchParam[1].documentation == "Kind of Resource" assert inst.rest[0].resource[7].searchParam[1].name == "code" assert inst.rest[0].resource[7].searchParam[1].type == "token" assert ( inst.rest[0].resource[7].searchParam[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Basic-subject"} ).valueUri ) assert ( inst.rest[0].resource[7].searchParam[2].documentation == "Identifies the focus of this resource" ) assert inst.rest[0].resource[7].searchParam[2].name == "subject" assert inst.rest[0].resource[7].searchParam[2].type == "reference" assert ( inst.rest[0].resource[7].searchParam[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Basic-created"} ).valueUri ) assert inst.rest[0].resource[7].searchParam[3].documentation == "When created" assert inst.rest[0].resource[7].searchParam[3].name == "created" assert inst.rest[0].resource[7].searchParam[3].type == "date" assert ( inst.rest[0].resource[7].searchParam[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Basic-patient"} ).valueUri ) assert ( inst.rest[0].resource[7].searchParam[4].documentation == "Identifies the focus of this resource" ) assert inst.rest[0].resource[7].searchParam[4].name == "patient" assert inst.rest[0].resource[7].searchParam[4].type == "reference" assert ( inst.rest[0].resource[7].searchParam[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Basic-author"} ).valueUri ) assert inst.rest[0].resource[7].searchParam[5].documentation == "Who created" assert inst.rest[0].resource[7].searchParam[5].name == "author" assert inst.rest[0].resource[7].searchParam[5].type == "reference" assert inst.rest[0].resource[7].type == "Basic" assert inst.rest[0].resource[8].conditionalCreate is True assert inst.rest[0].resource[8].conditionalDelete == "multiple" assert inst.rest[0].resource[8].conditionalUpdate is True assert inst.rest[0].resource[8].interaction[0].code == "read" assert inst.rest[0].resource[8].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[8].interaction[1].code == "vread" assert inst.rest[0].resource[8].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[8].interaction[2].code == "update" assert inst.rest[0].resource[8].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[8].interaction[3].code == "delete" assert inst.rest[0].resource[8].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[8].interaction[4].code == "history-instance" assert inst.rest[0].resource[8].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[8].interaction[5].code == "history-type" assert inst.rest[0].resource[8].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[8].interaction[6].code == "create" assert inst.rest[0].resource[8].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[8].interaction[7].code == "search-type" assert inst.rest[0].resource[8].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[8].profile.reference == "http://hl7.org/fhir/StructureDefinition/Binary" ) assert inst.rest[0].resource[8].referencePolicy[0] == "literal" assert inst.rest[0].resource[8].referencePolicy[1] == "logical" assert ( inst.rest[0].resource[8].searchParam[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Binary-contenttype"} ).valueUri ) assert ( inst.rest[0].resource[8].searchParam[0].documentation == "MimeType of the binary content" ) assert inst.rest[0].resource[8].searchParam[0].name == "contenttype" assert inst.rest[0].resource[8].searchParam[0].type == "token" assert inst.rest[0].resource[8].type == "Binary" assert inst.rest[0].resource[9].conditionalCreate is True assert inst.rest[0].resource[9].conditionalDelete == "multiple" assert inst.rest[0].resource[9].conditionalUpdate is True assert inst.rest[0].resource[9].interaction[0].code == "read" assert inst.rest[0].resource[9].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[9].interaction[1].code == "vread" assert inst.rest[0].resource[9].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[9].interaction[2].code == "update" assert inst.rest[0].resource[9].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[9].interaction[3].code == "delete" assert inst.rest[0].resource[9].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[9].interaction[4].code == "history-instance" assert inst.rest[0].resource[9].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[9].interaction[5].code == "history-type" assert inst.rest[0].resource[9].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[9].interaction[6].code == "create" assert inst.rest[0].resource[9].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[9].interaction[7].code == "search-type" assert inst.rest[0].resource[9].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[9].profile.reference == "http://hl7.org/fhir/StructureDefinition/BodySite" ) assert inst.rest[0].resource[9].referencePolicy[0] == "literal" assert inst.rest[0].resource[9].referencePolicy[1] == "logical" assert inst.rest[0].resource[9].searchInclude[0] == "BodySite.patient" assert ( inst.rest[0].resource[9].searchParam[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/BodySite-identifier"} ).valueUri ) assert ( inst.rest[0].resource[9].searchParam[0].documentation == "Identifier for this instance of the anatomical location" ) assert inst.rest[0].resource[9].searchParam[0].name == "identifier" assert inst.rest[0].resource[9].searchParam[0].type == "token" assert ( inst.rest[0].resource[9].searchParam[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/BodySite-code"} ).valueUri ) assert ( inst.rest[0].resource[9].searchParam[1].documentation == "Named anatomical location" ) assert inst.rest[0].resource[9].searchParam[1].name == "code" assert inst.rest[0].resource[9].searchParam[1].type == "token" assert ( inst.rest[0].resource[9].searchParam[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/BodySite-patient"} ).valueUri ) assert ( inst.rest[0].resource[9].searchParam[2].documentation == "Patient to whom bodysite belongs" ) assert inst.rest[0].resource[9].searchParam[2].name == "patient" assert inst.rest[0].resource[9].searchParam[2].type == "reference" assert inst.rest[0].resource[9].type == "BodySite" assert ( inst.rest[0].searchParam[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/DomainResource-text"} ).valueUri ) assert ( inst.rest[0].searchParam[0].documentation == "Search on the narrative of the resource" ) assert inst.rest[0].searchParam[0].name == "_text" assert inst.rest[0].searchParam[0].type == "string" assert ( inst.rest[0].searchParam[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-query"} ).valueUri ) assert inst.rest[0].searchParam[1].documentation == ( "A custom search profile that describes a specific defined " "query operation" ) assert inst.rest[0].searchParam[1].name == "_query" assert inst.rest[0].searchParam[1].type == "token" assert ( inst.rest[0].searchParam[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-profile"} ).valueUri ) assert ( inst.rest[0].searchParam[2].documentation == "Profiles this resource claims to conform to" ) assert inst.rest[0].searchParam[2].name == "_profile" assert inst.rest[0].searchParam[2].type == "uri" assert ( inst.rest[0].searchParam[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-lastUpdated"} ).valueUri ) assert ( inst.rest[0].searchParam[3].documentation == "When the resource version last changed" ) assert inst.rest[0].searchParam[3].name == "_lastUpdated" assert inst.rest[0].searchParam[3].type == "date" assert ( inst.rest[0].searchParam[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-tag"} ).valueUri ) assert inst.rest[0].searchParam[4].documentation == "Tags applied to this resource" assert inst.rest[0].searchParam[4].name == "_tag" assert inst.rest[0].searchParam[4].type == "token" assert ( inst.rest[0].searchParam[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-security"} ).valueUri ) assert ( inst.rest[0].searchParam[5].documentation == "Security Labels applied to this resource" ) assert inst.rest[0].searchParam[5].name == "_security" assert inst.rest[0].searchParam[5].type == "token" assert ( inst.rest[0].searchParam[6].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-id"} ).valueUri ) assert inst.rest[0].searchParam[6].documentation == "Logical id of this artifact" assert inst.rest[0].searchParam[6].name == "_id" assert inst.rest[0].searchParam[6].type == "token" assert ( inst.rest[0].searchParam[7].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-content"} ).valueUri ) assert ( inst.rest[0].searchParam[7].documentation == "Search on the entire content of the resource" ) assert inst.rest[0].searchParam[7].name == "_content" assert inst.rest[0].searchParam[7].type == "string" assert inst.rest[0].security.cors is True assert inst.rest[0].security.description == ( "This is the Capability Statement to declare that the server " "supports SMART-on-FHIR. See the SMART-on-FHIR docs for the " "extension that would go with such a server" ) assert inst.rest[0].security.service[0].coding[0].code == "SMART-on-FHIR" assert inst.rest[0].security.service[0].coding[0].display == "SMART-on-FHIR" assert ( inst.rest[0].security.service[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-security-service"} ).valueUri ) assert inst.rest[0].security.service[0].text == "See http://docs.smarthealthit.org/" assert inst.software.name == "Insert your softwware name here..." assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CapabilityStatement/base"} ).valueUri ) assert inst.version == "3.0.2-11200" def test_capabilitystatement_2(base_settings): """No. 2 tests collection for CapabilityStatement. Test File: capabilitystatement-capabilitystatement-base(base).json """ filename = ( base_settings["unittest_data_dir"] / "capabilitystatement-capabilitystatement-base(base).json" ) inst = capabilitystatement.CapabilityStatement.model_validate_json( filename.read_bytes() ) assert "CapabilityStatement" == inst.get_resource_type() impl_capabilitystatement_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CapabilityStatement" == data["resourceType"] inst2 = capabilitystatement.CapabilityStatement(**data) impl_capabilitystatement_2(inst2) ================================================ FILE: fhir/resources/STU3/tests/test_codesystem.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/CodeSystem Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from .. import codesystem from .conftest import ExternalValidatorModel def impl_codesystem_1(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "proposal" assert inst.concept[0].definition == ( "The request is a suggestion made by someone/something that " "doesn't have an intention to ensure it occurs and without " "providing an authorization to act" ) assert inst.concept[0].display == "Proposal" assert inst.concept[1].code == "plan" assert inst.concept[1].definition == ( "The request represents an intension to ensure something " "occurs without providing an authorization for others to act" ) assert inst.concept[1].display == "Plan" assert inst.concept[2].code == "order" assert inst.concept[2].concept[0].code == "original-order" assert ( inst.concept[2].concept[0].definition == "The request represents an original authorization for action" ) assert inst.concept[2].concept[0].display == "Original Order" assert inst.concept[2].concept[1].code == "reflex-order" assert inst.concept[2].concept[1].display == "Reflex Order" assert inst.concept[2].concept[2].code == "filler-order" assert inst.concept[2].concept[2].concept[0].code == "instance-order" assert inst.concept[2].concept[2].concept[0].definition == ( "An order created in fulfillment of a broader order that " "represents the authorization for a single activity " "occurrence. E.g. The administration of a single dose of a " "drug." ) assert inst.concept[2].concept[2].concept[0].display == "Instance Order" assert inst.concept[2].concept[2].definition == ( "The request represents the view of an authorization " "instantiated by a fulfilling system representing the details" " of the fulfiller's intention to act upon a submitted order" ) assert inst.concept[2].concept[2].display == "Filler Order" assert inst.concept[2].definition == ( "The request represents a request/demand and authorization " "for action" ) assert inst.concept[2].display == "Order" assert inst.concept[3].code == "option" assert inst.concept[3].display == "Option" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert inst.content == "complete" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.description == ( "Codes indicating the degree of authority/intentionality " "associated with a request" ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status" } ).valueUri ) assert inst.extension[0].valueString == "Informative" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[1].valueInteger == 3 assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[2].valueCode == "oo" assert inst.id == "request-intent" assert ( inst.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier.value == "urn:oid:2.16.840.1.113883.4.642.1.105" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2019-10-24T11:53:00+11:00"} ).valueInstant ) assert inst.name == "RequestIntent" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/request-intent"} ).valueUri ) assert ( inst.valueSet == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/request-intent"} ).valueUri ) assert inst.version == "3.0.2" def test_codesystem_1(base_settings): """No. 1 tests collection for CodeSystem. Test File: codesystem-codesystem-request-intent(request-intent).json """ filename = ( base_settings["unittest_data_dir"] / "codesystem-codesystem-request-intent(request-intent).json" ) inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_1(inst2) def impl_codesystem_2(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "as" assert inst.concept[0].definition == "Child Asthma Program" assert inst.concept[0].display == "Child Asthma" assert inst.concept[1].code == "hd" assert inst.concept[1].definition == "Heamodialisis Program." assert inst.concept[1].display == "Heamodialisis" assert inst.concept[2].code == "auscr" assert inst.concept[2].definition == "Autism Screening Program." assert inst.concept[2].display == "Autism Screening" assert inst.concept[3].code == "none" assert inst.concept[3].definition == "No program code applies." assert inst.concept[3].display == "None" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.content == "complete" assert inst.copyright == "This is an example set." assert ( inst.description == "This value set includes sample Program Reason Span codes." ) assert inst.experimental is True assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "fm" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status" } ).valueUri ) assert inst.extension[1].valueString == "Draft" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 1 assert inst.id == "ex-program-code" assert ( inst.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier.value == "urn:oid:2.16.840.1.113883.4.642.1.569" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2019-10-24T11:53:00+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/shareablecodesystem"} ).valueUri ) assert inst.name == "Example Program Reason Codes" assert inst.publisher == "Financial Management" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ex-programcode"} ).valueUri ) assert ( inst.valueSet == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/ex-program-code"} ).valueUri ) assert inst.version == "3.0.2" def test_codesystem_2(base_settings): """No. 2 tests collection for CodeSystem. Test File: codesystem-codesystem-ex-program-code(ex-program-code).json """ filename = ( base_settings["unittest_data_dir"] / "codesystem-codesystem-ex-program-code(ex-program-code).json" ) inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_2(inst2) def impl_codesystem_3(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "nilknown" assert inst.concept[0].display == "Nil Known" assert inst.concept[1].code == "notasked" assert inst.concept[1].definition == ( "The investigation to find out whether there are items for " "this list has not occurred." ) assert inst.concept[1].display == "Not Asked" assert inst.concept[2].code == "withheld" assert inst.concept[2].display == "Information Withheld" assert inst.concept[3].code == "unavailable" assert inst.concept[3].definition == ( "Information to populate this list cannot be obtained; e.g. " "unconscious patient." ) assert inst.concept[3].display == "Unavailable" assert inst.concept[4].code == "notstarted" assert ( inst.concept[4].definition == "The work to populate this list has not yet begun." ) assert inst.concept[4].display == "Not Started" assert inst.concept[5].code == "closed" assert inst.concept[5].definition == ( "This list has now closed or has ceased to be relevant or " "useful." ) assert inst.concept[5].display == "Closed" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.content == "complete" assert inst.description == ( "General reasons for a list to be empty. Reasons are either " "related to a summary list (i.e. problem or medication list) " "or to a workflow related list (i.e. consultation list)." ) assert inst.experimental is True assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status" } ).valueUri ) assert inst.extension[0].valueString == "Informative" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[1].valueInteger == 2 assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[2].valueCode == "sd" assert inst.id == "list-empty-reason" assert ( inst.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier.value == "urn:oid:2.16.840.1.113883.4.642.1.314" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2019-10-24T11:53:00+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/shareablecodesystem"} ).valueUri ) assert inst.name == "List Empty Reasons" assert inst.publisher == "FHIR Project" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/list-empty-reason"} ).valueUri ) assert ( inst.valueSet == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/list-empty-reason"} ).valueUri ) assert inst.version == "3.0.2" def test_codesystem_3(base_settings): """No. 3 tests collection for CodeSystem. Test File: codesystem-codesystem-list-empty-reason(list-empty-reason).json """ filename = ( base_settings["unittest_data_dir"] / "codesystem-codesystem-list-empty-reason(list-empty-reason).json" ) inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_3(inst2) def impl_codesystem_4(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "complete" assert inst.concept[0].definition == "The report is complete and ready for use" assert inst.concept[0].display == "Complete" assert inst.concept[1].code == "pending" assert inst.concept[1].definition == "The report is currently being generated" assert inst.concept[1].display == "Pending" assert inst.concept[2].code == "error" assert ( inst.concept[2].definition == "An error occurred attempting to generate the report" ) assert inst.concept[2].display == "Error" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert inst.content == "complete" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.description == "The status of the measure report" assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status" } ).valueUri ) assert inst.extension[0].valueString == "Informative" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[1].valueInteger == 2 assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[2].valueCode == "cqi" assert inst.id == "measure-report-status" assert ( inst.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier.value == "urn:oid:2.16.840.1.113883.4.642.1.760" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2019-10-24T11:53:00+11:00"} ).valueInstant ) assert inst.name == "MeasureReportStatus" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/measure-report-status"} ).valueUri ) assert ( inst.valueSet == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/measure-report-status"} ).valueUri ) assert inst.version == "3.0.2" def test_codesystem_4(base_settings): """No. 4 tests collection for CodeSystem. Test File: codesystem-codesystem-measure-report-status(measure-report-status).json """ filename = ( base_settings["unittest_data_dir"] / "codesystem-codesystem-measure-report-status(measure-report-status).json" ) inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_4(inst2) def impl_codesystem_5(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "inactive" assert inst.concept[0].definition == ( "True if the concept is not considered active - e.g. not a " "valid concept any more. Property type is boolean, default " "value is false" ) assert inst.concept[0].display == "Inactive" assert inst.concept[1].code == "deprecated" assert inst.concept[1].display == "Deprecated" assert inst.concept[2].code == "notSelectable" assert inst.concept[2].display == "Not Selectable" assert inst.concept[3].code == "parent" assert inst.concept[3].definition == ( "The concept identified in this property is a parent of the " "concept on which it is a property. The property type will be" " 'code'. The meaning of 'parent' is defined by the " "hierarchyMeaning attribute" ) assert inst.concept[3].display == "Parent" assert inst.concept[4].code == "child" assert inst.concept[4].definition == ( "The concept identified in this property is a child of the " "concept on which it is a property. The property type will be" " 'code'. The meaning of 'child' is defined by the " "hierarchyMeaning attribute" ) assert inst.concept[4].display == "Child" assert inst.content == "complete" assert inst.description == ( "A set of common concept properties for use on coded systems " "through out the FHIR eco-system." ) assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status" } ).valueUri ) assert inst.extension[0].valueString == "Informative" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[1].valueInteger == 0 assert inst.id == "concept-properties" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2019-10-24T11:53:00+11:00"} ).valueInstant ) assert inst.name == "FHIR Defined Concept Properties" assert inst.publisher == "FHIR Project" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/concept-properties"} ).valueUri ) assert ( inst.valueSet == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/concept-properties"} ).valueUri ) def test_codesystem_5(base_settings): """No. 5 tests collection for CodeSystem. Test File: codesystem-codesystem-concept-properties(concept-properties).json """ filename = ( base_settings["unittest_data_dir"] / "codesystem-codesystem-concept-properties(concept-properties).json" ) inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_5(inst2) def impl_codesystem_6(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "current" assert ( inst.concept[0].definition == "This is the current reference for this document." ) assert inst.concept[0].display == "Current" assert inst.concept[1].code == "superseded" assert ( inst.concept[1].definition == "This reference has been superseded by another reference." ) assert inst.concept[1].display == "Superseded" assert inst.concept[2].code == "entered-in-error" assert inst.concept[2].definition == "This reference was created in error." assert inst.concept[2].display == "Entered in Error" assert inst.content == "complete" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.description == "The status of the document reference." assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status" } ).valueUri ) assert inst.extension[0].valueString == "Informative" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[1].valueInteger == 3 assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[2].valueCode == "sd" assert inst.id == "document-reference-status" assert ( inst.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier.value == "urn:oid:2.16.840.1.113883.4.642.1.8" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2019-10-24T11:53:00+11:00"} ).valueInstant ) assert inst.name == "DocumentReferenceStatus" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/document-reference-status"} ).valueUri ) assert ( inst.valueSet == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/document-reference-status"} ).valueUri ) assert inst.version == "3.0.2" def test_codesystem_6(base_settings): """No. 6 tests collection for CodeSystem. Test File: codesystem-codesystem-document-reference-status(document-reference-status).json """ filename = ( base_settings["unittest_data_dir"] / "codesystem-codesystem-document-reference-status(document-reference-status).json" ) inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_6(inst2) def impl_codesystem_7(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "ampoule" assert inst.concept[0].definition == "A sealed glass capsule containing a liquid" assert inst.concept[0].display == "Ampoule" assert inst.concept[1].code == "bottle" assert inst.concept[1].definition == ( "A container, typically made of glass or plastic and with a " "narrow neck, used for storing liquids." ) assert inst.concept[1].display == "Bottle" assert inst.concept[2].code == "box" assert inst.concept[2].definition == ( "A container with a flat base and sides, typically square or " "rectangular and having a lid." ) assert inst.concept[2].display == "Box" assert inst.concept[3].code == "cartridge" assert inst.concept[3].definition == ( "A device of various configuration and composition used with " "a syringe for the application of anesthetic or other " "materials to a patient." ) assert inst.concept[3].display == "Cartridge" assert inst.concept[4].code == "container" assert inst.concept[4].definition == "A package intended to store pharmaceuticals." assert inst.concept[4].display == "Container" assert inst.concept[5].code == "tube" assert inst.concept[5].definition == ( "A long, hollow cylinder of metal, plastic, glass, etc., for " "holding medications, typically creams or ointments" ) assert inst.concept[5].display == "Tube" assert inst.concept[6].code == "unitdose" assert inst.concept[6].definition == ( "A dose of medicine prepared in an individual package for " "convenience, safety or monitoring." ) assert inst.concept[6].display == "Unit Dose Blister" assert inst.concept[7].code == "vial" assert inst.concept[7].definition == ( "A small container, typically cylindrical and made of glass, " "used especially for holding liquid medications." ) assert inst.concept[7].display == "Vial" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert inst.content == "complete" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.description == ( "A coded concept defining the kind of container a medication " "package is packaged in" ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status" } ).valueUri ) assert inst.extension[0].valueString == "Informative" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[1].valueInteger == 1 assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[2].valueCode == "phx" assert inst.id == "medication-package-form" assert ( inst.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier.value == "urn:oid:2.16.840.1.113883.4.642.1.362" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2019-10-24T11:53:00+11:00"} ).valueInstant ) assert inst.name == "MedicationContainer" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/medication-package-form"} ).valueUri ) assert ( inst.valueSet == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/medication-package-form"} ).valueUri ) assert inst.version == "3.0.2" def test_codesystem_7(base_settings): """No. 7 tests collection for CodeSystem. Test File: codesystem-codesystem-medication-package-form(medication-package-form).json """ filename = ( base_settings["unittest_data_dir"] / "codesystem-codesystem-medication-package-form(medication-package-form).json" ) inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_7(inst2) def impl_codesystem_8(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "unlikely" assert inst.concept[0].definition == ( "There is a low level of clinical certainty that the reaction" " was caused by the identified substance." ) assert inst.concept[0].display == "Unlikely" assert inst.concept[1].code == "likely" assert inst.concept[1].definition == ( "There is a high level of clinical certainty that the " "reaction was caused by the identified substance." ) assert inst.concept[1].display == "Likely" assert inst.concept[2].code == "confirmed" assert inst.concept[2].definition == ( "There is a very high level of clinical certainty that the " "reaction was due to the identified substance, which may " "include clinical evidence by testing or rechallenge." ) assert inst.concept[2].display == "Confirmed" assert inst.concept[3].code == "unknown" assert inst.concept[3].definition == ( "The clinical certainty that the reaction was caused by the " "identified substance is unknown. It is an explicit " "assertion that certainty is not known." ) assert inst.concept[3].display == "Unknown" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert inst.content == "complete" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.description == ( "Statement about the degree of clinical certainty that a " "specific substance was the cause of the manifestation in a " "reaction event." ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status" } ).valueUri ) assert inst.extension[0].valueString == "Informative" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[1].valueInteger == 0 assert inst.id == "reaction-event-certainty" assert ( inst.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier.value == "urn:oid:2.16.840.1.113883.4.642.1.860" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2019-10-24T11:53:00+11:00"} ).valueInstant ) assert inst.name == "AllergyIntoleranceCertainty" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/reaction-event-certainty"} ).valueUri ) assert ( inst.valueSet == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/reaction-event-certainty"} ).valueUri ) assert inst.version == "3.0.2" def test_codesystem_8(base_settings): """No. 8 tests collection for CodeSystem. Test File: codesystem-codesystem-reaction-event-certainty(reaction-event-certainty).json """ filename = ( base_settings["unittest_data_dir"] / "codesystem-codesystem-reaction-event-certainty(reaction-event-certainty).json" ) inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_8(inst2) def impl_codesystem_9(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "311405" assert inst.concept[0].definition == "Dentist General Practitioner (DDS, DDM)." assert inst.concept[0].display == "Dentist" assert inst.concept[1].code == "604215" assert inst.concept[1].definition == "Ophthalmologist." assert inst.concept[1].display == "Ophthalmologist" assert inst.concept[2].code == "604210" assert inst.concept[2].definition == "Optometrist." assert inst.concept[2].display == "Optometrist" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.content == "complete" assert inst.copyright == "This is an example set." assert ( inst.description == "This value set includes sample Provider Qualification codes." ) assert inst.experimental is True assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "fm" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status" } ).valueUri ) assert inst.extension[1].valueString == "Draft" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 1 assert inst.id == "provider-qualification" assert ( inst.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier.value == "urn:oid:2.16.840.1.113883.4.642.1.563" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2019-10-24T11:53:00+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/shareablecodesystem"} ).valueUri ) assert inst.name == "Example Provider Qualification Codes" assert inst.publisher == "Financial Management" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ex-providerqualification"} ).valueUri ) assert ( inst.valueSet == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/provider-qualification"} ).valueUri ) assert inst.version == "3.0.2" def test_codesystem_9(base_settings): """No. 9 tests collection for CodeSystem. Test File: codesystem-codesystem-provider-qualification(provider-qualification).json """ filename = ( base_settings["unittest_data_dir"] / "codesystem-codesystem-provider-qualification(provider-qualification).json" ) inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_9(inst2) def impl_codesystem_10(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "in-progress" assert inst.concept[0].definition == "Supply has been requested, but not delivered." assert inst.concept[0].display == "In Progress" assert inst.concept[1].code == "completed" assert inst.concept[1].definition == 'Supply has been delivered ("completed").' assert inst.concept[1].display == "Delivered" assert inst.concept[2].code == "abandoned" assert inst.concept[2].definition == "Delivery was not completed." assert inst.concept[2].display == "Abandoned" assert inst.concept[3].code == "entered-in-error" assert inst.concept[3].display == "Entered In Error" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert inst.content == "complete" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.description == "Status of the supply delivery." assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status" } ).valueUri ) assert inst.extension[0].valueString == "Informative" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[1].valueInteger == 1 assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[2].valueCode == "oo" assert inst.id == "supplydelivery-status" assert ( inst.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier.value == "urn:oid:2.16.840.1.113883.4.642.1.687" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2019-10-24T11:53:00+11:00"} ).valueInstant ) assert inst.name == "SupplyDeliveryStatus" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/supplydelivery-status"} ).valueUri ) assert ( inst.valueSet == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/supplydelivery-status"} ).valueUri ) assert inst.version == "3.0.2" def test_codesystem_10(base_settings): """No. 10 tests collection for CodeSystem. Test File: codesystem-codesystem-supplydelivery-status(supplydelivery-status).json """ filename = ( base_settings["unittest_data_dir"] / "codesystem-codesystem-supplydelivery-status(supplydelivery-status).json" ) inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_10(inst2) ================================================ FILE: fhir/resources/STU3/tests/test_compartmentdefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/CompartmentDefinition Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from .. import compartmentdefinition from .conftest import ExternalValidatorModel def impl_compartmentdefinition_1(inst): assert inst.code == "RelatedPerson" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "relatedPerson" assert inst.name == "Base FHIR compartment definition for RelatedPerson" assert inst.publisher == "FHIR Project Team" assert inst.resource[0].code == "Account" assert inst.resource[1].code == "ActivityDefinition" assert inst.resource[2].code == "AdverseEvent" assert inst.resource[2].param[0] == "recorder" assert inst.resource[3].code == "AllergyIntolerance" assert inst.resource[3].param[0] == "asserter" assert inst.resource[4].code == "Appointment" assert inst.resource[4].param[0] == "actor" assert inst.resource[5].code == "AppointmentResponse" assert inst.resource[5].param[0] == "actor" assert inst.resource[6].code == "AuditEvent" assert inst.resource[7].code == "Basic" assert inst.resource[7].param[0] == "author" assert inst.resource[8].code == "Binary" assert inst.resource[9].code == "BodySite" assert inst.search is True assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CompartmentDefinition/relatedPerson"} ).valueUri ) def test_compartmentdefinition_1(base_settings): """No. 1 tests collection for CompartmentDefinition. Test File: compartmentdefinition-compartmentdefinition-relatedperson(relatedPerson).json """ filename = ( base_settings["unittest_data_dir"] / "compartmentdefinition-compartmentdefinition-relatedperson(relatedPerson).json" ) inst = compartmentdefinition.CompartmentDefinition.model_validate_json( filename.read_bytes() ) assert "CompartmentDefinition" == inst.get_resource_type() impl_compartmentdefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CompartmentDefinition" == data["resourceType"] inst2 = compartmentdefinition.CompartmentDefinition(**data) impl_compartmentdefinition_1(inst2) def impl_compartmentdefinition_2(inst): assert inst.code == "Patient" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "patient" assert inst.name == "Base FHIR compartment definition for Patient" assert inst.publisher == "FHIR Project Team" assert inst.resource[0].code == "Account" assert inst.resource[0].param[0] == "subject" assert inst.resource[1].code == "ActivityDefinition" assert inst.resource[2].code == "AdverseEvent" assert inst.resource[2].param[0] == "subject" assert inst.resource[3].code == "AllergyIntolerance" assert inst.resource[3].param[0] == "patient" assert inst.resource[3].param[1] == "recorder" assert inst.resource[3].param[2] == "asserter" assert inst.resource[4].code == "Appointment" assert inst.resource[4].param[0] == "actor" assert inst.resource[5].code == "AppointmentResponse" assert inst.resource[5].param[0] == "actor" assert inst.resource[6].code == "AuditEvent" assert inst.resource[6].param[0] == "patient" assert inst.resource[6].param[1] == "agent.patient" assert inst.resource[6].param[2] == "entity.patient" assert inst.resource[7].code == "Basic" assert inst.resource[7].param[0] == "patient" assert inst.resource[7].param[1] == "author" assert inst.resource[8].code == "Binary" assert inst.resource[9].code == "BodySite" assert inst.resource[9].param[0] == "patient" assert inst.search is True assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CompartmentDefinition/patient"} ).valueUri ) def test_compartmentdefinition_2(base_settings): """No. 2 tests collection for CompartmentDefinition. Test File: compartmentdefinition-compartmentdefinition-patient(patient).json """ filename = ( base_settings["unittest_data_dir"] / "compartmentdefinition-compartmentdefinition-patient(patient).json" ) inst = compartmentdefinition.CompartmentDefinition.model_validate_json( filename.read_bytes() ) assert "CompartmentDefinition" == inst.get_resource_type() impl_compartmentdefinition_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CompartmentDefinition" == data["resourceType"] inst2 = compartmentdefinition.CompartmentDefinition(**data) impl_compartmentdefinition_2(inst2) def impl_compartmentdefinition_3(inst): assert inst.code == "Encounter" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "encounter" assert inst.name == "Base FHIR compartment definition for Encounter" assert inst.publisher == "FHIR Project Team" assert inst.resource[0].code == "Account" assert inst.resource[1].code == "ActivityDefinition" assert inst.resource[2].code == "AdverseEvent" assert inst.resource[3].code == "AllergyIntolerance" assert inst.resource[4].code == "Appointment" assert inst.resource[5].code == "AppointmentResponse" assert inst.resource[6].code == "AuditEvent" assert inst.resource[7].code == "Basic" assert inst.resource[8].code == "Binary" assert inst.resource[9].code == "BodySite" assert inst.search is True assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CompartmentDefinition/encounter"} ).valueUri ) def test_compartmentdefinition_3(base_settings): """No. 3 tests collection for CompartmentDefinition. Test File: compartmentdefinition-compartmentdefinition-encounter(encounter).json """ filename = ( base_settings["unittest_data_dir"] / "compartmentdefinition-compartmentdefinition-encounter(encounter).json" ) inst = compartmentdefinition.CompartmentDefinition.model_validate_json( filename.read_bytes() ) assert "CompartmentDefinition" == inst.get_resource_type() impl_compartmentdefinition_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CompartmentDefinition" == data["resourceType"] inst2 = compartmentdefinition.CompartmentDefinition(**data) impl_compartmentdefinition_3(inst2) def impl_compartmentdefinition_4(inst): assert inst.code == "Device" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.description == ( "There is an instance of the practitioner compartment for " "each Device resource, and the identity of the compartment is" " the same as the Device. The set of resources associated " "with a particular device" ) assert inst.experimental is True assert inst.id == "device" assert inst.name == "Base FHIR compartment definition for Device" assert inst.publisher == "FHIR Project Team" assert inst.resource[0].code == "Account" assert inst.resource[0].param[0] == "subject" assert inst.resource[1].code == "ActivityDefinition" assert inst.resource[2].code == "AdverseEvent" assert inst.resource[3].code == "AllergyIntolerance" assert inst.resource[4].code == "Appointment" assert inst.resource[4].param[0] == "actor" assert inst.resource[5].code == "AppointmentResponse" assert inst.resource[5].param[0] == "actor" assert inst.resource[6].code == "AuditEvent" assert inst.resource[6].param[0] == "agent" assert inst.resource[7].code == "Basic" assert inst.resource[8].code == "Binary" assert inst.resource[9].code == "BodySite" assert inst.search is True assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CompartmentDefinition/device"} ).valueUri ) def test_compartmentdefinition_4(base_settings): """No. 4 tests collection for CompartmentDefinition. Test File: compartmentdefinition-compartmentdefinition-device(device).json """ filename = ( base_settings["unittest_data_dir"] / "compartmentdefinition-compartmentdefinition-device(device).json" ) inst = compartmentdefinition.CompartmentDefinition.model_validate_json( filename.read_bytes() ) assert "CompartmentDefinition" == inst.get_resource_type() impl_compartmentdefinition_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CompartmentDefinition" == data["resourceType"] inst2 = compartmentdefinition.CompartmentDefinition(**data) impl_compartmentdefinition_4(inst2) def impl_compartmentdefinition_5(inst): assert inst.code == "Practitioner" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "practitioner" assert inst.name == "Base FHIR compartment definition for Practitioner" assert inst.publisher == "FHIR Project Team" assert inst.resource[0].code == "Account" assert inst.resource[0].param[0] == "subject" assert inst.resource[1].code == "ActivityDefinition" assert inst.resource[2].code == "AdverseEvent" assert inst.resource[2].param[0] == "recorder" assert inst.resource[3].code == "AllergyIntolerance" assert inst.resource[3].param[0] == "recorder" assert inst.resource[3].param[1] == "asserter" assert inst.resource[4].code == "Appointment" assert inst.resource[4].param[0] == "actor" assert inst.resource[5].code == "AppointmentResponse" assert inst.resource[5].param[0] == "actor" assert inst.resource[6].code == "AuditEvent" assert inst.resource[6].param[0] == "agent" assert inst.resource[7].code == "Basic" assert inst.resource[7].param[0] == "author" assert inst.resource[8].code == "Binary" assert inst.resource[9].code == "BodySite" assert inst.search is True assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CompartmentDefinition/practitioner"} ).valueUri ) def test_compartmentdefinition_5(base_settings): """No. 5 tests collection for CompartmentDefinition. Test File: compartmentdefinition-compartmentdefinition-practitioner(practitioner).json """ filename = ( base_settings["unittest_data_dir"] / "compartmentdefinition-compartmentdefinition-practitioner(practitioner).json" ) inst = compartmentdefinition.CompartmentDefinition.model_validate_json( filename.read_bytes() ) assert "CompartmentDefinition" == inst.get_resource_type() impl_compartmentdefinition_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CompartmentDefinition" == data["resourceType"] inst2 = compartmentdefinition.CompartmentDefinition(**data) impl_compartmentdefinition_5(inst2) ================================================ FILE: fhir/resources/STU3/tests/test_conceptmap.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ConceptMap Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from .. import conceptmap from .conftest import ExternalValidatorModel def impl_conceptmap_1(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.group[0].element[0].code == "in-progress" assert inst.group[0].element[0].target[0].code == "active" assert inst.group[0].element[0].target[0].equivalence == "equal" assert inst.group[0].element[1].code == "on-hold" assert inst.group[0].element[1].target[0].code == "suspended" assert inst.group[0].element[1].target[0].equivalence == "equal" assert inst.group[0].element[2].code == "completed" assert inst.group[0].element[2].target[0].code == "completed" assert inst.group[0].element[2].target[0].equivalence == "equal" assert inst.group[0].element[3].code == "entered-in-error" assert inst.group[0].element[3].target[0].code == "nullified" assert inst.group[0].element[3].target[0].equivalence == "equal" assert inst.group[0].element[4].code == "stopped" assert inst.group[0].element[4].target[0].code == "aborted" assert inst.group[0].element[4].target[0].equivalence == "equal" assert ( inst.group[0].source == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/medication-dispense-status"} ).valueUri ) assert ( inst.group[0].target == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/v3/ActStatus"} ).valueUri ) assert inst.id == "cm-medication-dispense-status-v3" assert inst.name == "v3 map for MedicationDispenseStatus" assert inst.publisher == "HL7 (FHIR Project)" assert ( inst.sourceReference.reference == "http://hl7.org/fhir/ValueSet/medication-dispense-status" ) assert inst.status == "draft" assert inst.targetReference.reference == "http://hl7.org/fhir/ValueSet/v3-ActStatus" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/ConceptMap/cm-medication-dispense-status-v3" } ).valueUri ) def test_conceptmap_1(base_settings): """No. 1 tests collection for ConceptMap. Test File: conceptmap-cm-medication-dispense-status-v3.json """ filename = ( base_settings["unittest_data_dir"] / "conceptmap-cm-medication-dispense-status-v3.json" ) inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_1(inst2) def impl_conceptmap_2(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.group[0].element[0].code == "active" assert inst.group[0].element[0].target[0].code == "active" assert inst.group[0].element[0].target[0].equivalence == "equal" assert inst.group[0].element[1].code == "on-hold" assert inst.group[0].element[1].target[0].code == "suspended" assert inst.group[0].element[1].target[0].equivalence == "equal" assert inst.group[0].element[2].code == "cancelled" assert inst.group[0].element[2].target[0].code == "cancelled" assert inst.group[0].element[2].target[0].equivalence == "equal" assert inst.group[0].element[3].code == "completed" assert inst.group[0].element[3].target[0].code == "completed" assert inst.group[0].element[3].target[0].equivalence == "equal" assert inst.group[0].element[4].code == "entered-in-error" assert inst.group[0].element[4].target[0].code == "nullified" assert inst.group[0].element[4].target[0].equivalence == "equal" assert inst.group[0].element[5].code == "stopped" assert inst.group[0].element[5].target[0].code == "aborted" assert inst.group[0].element[5].target[0].equivalence == "equal" assert inst.group[0].element[6].code == "draft" assert inst.group[0].element[6].target[0].code == "new" assert inst.group[0].element[6].target[0].equivalence == "equal" assert ( inst.group[0].source == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/medication-request-status"} ).valueUri ) assert ( inst.group[0].target == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/v3/ActStatus"} ).valueUri ) assert inst.id == "cm-medication-request-status-v3" assert inst.name == "v3 map for MedicationRequestStatus" assert inst.publisher == "HL7 (FHIR Project)" assert ( inst.sourceReference.reference == "http://hl7.org/fhir/ValueSet/medication-request-status" ) assert inst.status == "draft" assert inst.targetReference.reference == "http://hl7.org/fhir/ValueSet/v3-ActStatus" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/ConceptMap/cm-medication-request-status-v3" } ).valueUri ) def test_conceptmap_2(base_settings): """No. 2 tests collection for ConceptMap. Test File: conceptmap-cm-medication-request-status-v3.json """ filename = ( base_settings["unittest_data_dir"] / "conceptmap-cm-medication-request-status-v3.json" ) inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_2(inst2) def impl_conceptmap_3(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.group[0].element[0].code == "in-progress" assert inst.group[0].element[0].target[0].code == "active" assert inst.group[0].element[0].target[0].equivalence == "equal" assert inst.group[0].element[1].code == "on-hold" assert inst.group[0].element[1].target[0].code == "suspended" assert inst.group[0].element[1].target[0].equivalence == "equal" assert inst.group[0].element[2].code == "completed" assert inst.group[0].element[2].target[0].code == "completed" assert inst.group[0].element[2].target[0].equivalence == "equal" assert inst.group[0].element[3].code == "entered-in-error" assert inst.group[0].element[3].target[0].code == "nullified" assert inst.group[0].element[3].target[0].equivalence == "equal" assert inst.group[0].element[4].code == "stopped" assert inst.group[0].element[4].target[0].code == "aborted" assert inst.group[0].element[4].target[0].equivalence == "equal" assert ( inst.group[0].source == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/medication-admin-status"} ).valueUri ) assert ( inst.group[0].target == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/v3/ActStatus"} ).valueUri ) assert inst.id == "cm-medication-admin-status-v3" assert inst.name == "v3 map for MedicationAdministrationStatus" assert inst.publisher == "HL7 (FHIR Project)" assert ( inst.sourceReference.reference == "http://hl7.org/fhir/ValueSet/medication-admin-status" ) assert inst.status == "draft" assert inst.targetReference.reference == "http://hl7.org/fhir/ValueSet/v3-ActStatus" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/cm-medication-admin-status-v3"} ).valueUri ) def test_conceptmap_3(base_settings): """No. 3 tests collection for ConceptMap. Test File: conceptmap-cm-medication-admin-status-v3.json """ filename = ( base_settings["unittest_data_dir"] / "conceptmap-cm-medication-admin-status-v3.json" ) inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_3(inst2) def impl_conceptmap_4(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.group[0].element[0].code == "phone" assert inst.group[0].element[0].target[0].code == "PH" assert inst.group[0].element[0].target[0].equivalence == "equivalent" assert inst.group[0].element[1].code == "fax" assert inst.group[0].element[1].target[0].code == "FX" assert inst.group[0].element[1].target[0].equivalence == "equivalent" assert inst.group[0].element[2].code == "email" assert inst.group[0].element[2].target[0].code == "Internet" assert inst.group[0].element[2].target[0].comment == "for email addresses" assert inst.group[0].element[2].target[0].equivalence == "narrower" assert inst.group[0].element[3].code == "pager" assert inst.group[0].element[3].target[0].code == "BP" assert inst.group[0].element[3].target[0].equivalence == "equivalent" assert inst.group[0].element[4].code == "url" assert inst.group[0].element[4].target[0].code == "Internet" assert ( inst.group[0].element[4].target[0].comment == "for non-email kinds of addresses" ) assert inst.group[0].element[4].target[0].equivalence == "narrower" assert ( inst.group[0].source == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/contact-point-system"} ).valueUri ) assert ( inst.group[0].target == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/v2/0202"} ).valueUri ) assert inst.id == "cm-contact-point-system-v2" assert inst.name == "v2 map for ContactPointSystem" assert inst.publisher == "HL7 (FHIR Project)" assert ( inst.sourceReference.reference == "http://hl7.org/fhir/ValueSet/contact-point-system" ) assert inst.status == "draft" assert inst.targetReference.reference == "http://hl7.org/fhir/ValueSet/v2-0202" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/cm-contact-point-system-v2"} ).valueUri ) def test_conceptmap_4(base_settings): """No. 4 tests collection for ConceptMap. Test File: conceptmap-cm-contact-point-system-v2.json """ filename = ( base_settings["unittest_data_dir"] / "conceptmap-cm-contact-point-system-v2.json" ) inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_4(inst2) def impl_conceptmap_5(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.group[0].element[0].code == "unknown" assert inst.group[0].element[0].target[0].code == "UNK" assert inst.group[0].element[0].target[0].equivalence == "equal" assert inst.group[0].element[1].code == "asked" assert inst.group[0].element[1].target[0].code == "ASKU" assert inst.group[0].element[1].target[0].equivalence == "equal" assert inst.group[0].element[2].code == "temp" assert inst.group[0].element[2].target[0].code == "NAV" assert inst.group[0].element[2].target[0].equivalence == "equal" assert inst.group[0].element[3].code == "not-asked" assert inst.group[0].element[3].target[0].code == "NASK" assert inst.group[0].element[3].target[0].equivalence == "equal" assert inst.group[0].element[4].code == "masked" assert inst.group[0].element[4].target[0].code == "MSK" assert inst.group[0].element[4].target[0].equivalence == "equal" assert inst.group[0].element[5].code == "unsupported" assert inst.group[0].element[5].target[0].code == "NA" assert inst.group[0].element[5].target[0].equivalence == "wider" assert inst.group[0].element[6].code == "error" assert inst.group[0].element[6].target[0].code == "NA" assert inst.group[0].element[6].target[0].equivalence == "wider" assert inst.group[0].element[7].code == "NaN" assert inst.group[0].element[7].target[0].code == "NA" assert inst.group[0].element[7].target[0].equivalence == "wider" assert inst.group[0].element[8].code == "not-performed" assert inst.group[0].element[8].target[0].code == "NA" assert inst.group[0].element[8].target[0].equivalence == "wider" assert ( inst.group[0].source == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/data-absent-reason"} ).valueUri ) assert ( inst.group[0].target == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/v3/NullFlavor"} ).valueUri ) assert inst.id == "cm-data-absent-reason-v3" assert inst.name == "v3 map for DataAbsentReason" assert inst.publisher == "HL7 (FHIR Project)" assert ( inst.sourceReference.reference == "http://hl7.org/fhir/ValueSet/data-absent-reason" ) assert inst.status == "draft" assert ( inst.targetReference.reference == "http://hl7.org/fhir/ValueSet/v3-NullFlavor" ) assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/cm-data-absent-reason-v3"} ).valueUri ) def test_conceptmap_5(base_settings): """No. 5 tests collection for ConceptMap. Test File: conceptmap-cm-data-absent-reason-v3.json """ filename = ( base_settings["unittest_data_dir"] / "conceptmap-cm-data-absent-reason-v3.json" ) inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_5(inst2) def impl_conceptmap_6(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.group[0].element[0].code == "preliminary" assert inst.group[0].element[0].target[0].code == "active" assert inst.group[0].element[0].target[0].equivalence == "equivalent" assert inst.group[0].element[1].code == "final" assert inst.group[0].element[1].target[0].code == "completed" assert inst.group[0].element[1].target[0].equivalence == "wider" assert inst.group[0].element[2].code == "amended" assert inst.group[0].element[2].target[0].code == "completed" assert inst.group[0].element[2].target[0].equivalence == "wider" assert inst.group[0].element[3].code == "entered-in-error" assert inst.group[0].element[3].target[0].code == "nullified" assert inst.group[0].element[3].target[0].equivalence == "equivalent" assert ( inst.group[0].source == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/composition-status"} ).valueUri ) assert ( inst.group[0].target == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/v3/ActStatus"} ).valueUri ) assert inst.id == "cm-composition-status-v3" assert inst.name == "v3 map for CompositionStatus" assert inst.publisher == "HL7 (FHIR Project)" assert ( inst.sourceReference.reference == "http://hl7.org/fhir/ValueSet/composition-status" ) assert inst.status == "draft" assert inst.targetReference.reference == "http://hl7.org/fhir/ValueSet/v3-ActStatus" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/cm-composition-status-v3"} ).valueUri ) def test_conceptmap_6(base_settings): """No. 6 tests collection for ConceptMap. Test File: conceptmap-cm-composition-status-v3.json """ filename = ( base_settings["unittest_data_dir"] / "conceptmap-cm-composition-status-v3.json" ) inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_6(inst2) def impl_conceptmap_7(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.group[0].element[0].code == "high" assert inst.group[0].element[0].target[0].code == "H" assert inst.group[0].element[0].target[0].equivalence == "equal" assert inst.group[0].element[1].code == "moderate" assert inst.group[0].element[1].target[0].code == "M" assert inst.group[0].element[1].target[0].equivalence == "equal" assert inst.group[0].element[2].code == "low" assert inst.group[0].element[2].target[0].code == "L" assert inst.group[0].element[2].target[0].equivalence == "equal" assert ( inst.group[0].source == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/detectedissue-severity"} ).valueUri ) assert ( inst.group[0].target == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/v3/ObservationValue"} ).valueUri ) assert inst.id == "cm-detectedissue-severity-v3" assert inst.name == "v3 map for DetectedIssueSeverity" assert inst.publisher == "HL7 (FHIR Project)" assert ( inst.sourceReference.reference == "http://hl7.org/fhir/ValueSet/detectedissue-severity" ) assert inst.status == "draft" assert ( inst.targetReference.reference == "http://hl7.org/fhir/ValueSet/v3-SeverityObservation" ) assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/cm-detectedissue-severity-v3"} ).valueUri ) def test_conceptmap_7(base_settings): """No. 7 tests collection for ConceptMap. Test File: conceptmap-cm-detectedissue-severity-v3.json """ filename = ( base_settings["unittest_data_dir"] / "conceptmap-cm-detectedissue-severity-v3.json" ) inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_7(inst2) def impl_conceptmap_8(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.group[0].element[0].code == "postal" assert inst.group[0].element[0].target[0].code == "PHYS" assert inst.group[0].element[0].target[0].equivalence == "equal" assert inst.group[0].element[1].code == "physical" assert inst.group[0].element[1].target[0].code == "PST" assert inst.group[0].element[1].target[0].equivalence == "equal" assert ( inst.group[0].source == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/address-type"} ).valueUri ) assert ( inst.group[0].target == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/v3/AddressUse"} ).valueUri ) assert inst.id == "cm-address-type-v3" assert inst.name == "v3 map for AddressType" assert inst.publisher == "HL7 (FHIR Project)" assert inst.sourceReference.reference == "http://hl7.org/fhir/ValueSet/address-type" assert inst.status == "draft" assert ( inst.targetReference.reference == "http://hl7.org/fhir/ValueSet/v3-AddressUse" ) assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/cm-address-type-v3"} ).valueUri ) def test_conceptmap_8(base_settings): """No. 8 tests collection for ConceptMap. Test File: conceptmap-cm-address-type-v3.json """ filename = base_settings["unittest_data_dir"] / "conceptmap-cm-address-type-v3.json" inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_8(inst2) def impl_conceptmap_9(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.group[0].element[0].code == "active" assert inst.group[0].element[0].target[0].code == "active" assert inst.group[0].element[0].target[0].equivalence == "equal" assert inst.group[0].element[1].code == "completed" assert inst.group[0].element[1].target[0].code == "completed" assert inst.group[0].element[1].target[0].equivalence == "equal" assert inst.group[0].element[2].code == "entered-in-error" assert inst.group[0].element[2].target[0].code == "nullified" assert inst.group[0].element[2].target[0].equivalence == "equal" assert inst.group[0].element[3].code == "stopped" assert inst.group[0].element[3].target[0].code == "aborted" assert inst.group[0].element[3].target[0].equivalence == "equal" assert inst.group[0].element[4].code == "on-hold" assert inst.group[0].element[4].target[0].code == "suspended" assert inst.group[0].element[4].target[0].equivalence == "equal" assert ( inst.group[0].source == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/medication-statement-status"} ).valueUri ) assert ( inst.group[0].target == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/v3/ActStatus"} ).valueUri ) assert inst.id == "cm-medication-statement-status-v3" assert inst.name == "v3 map for MedicationStatementStatus" assert inst.publisher == "HL7 (FHIR Project)" assert ( inst.sourceReference.reference == "http://hl7.org/fhir/ValueSet/medication-statement-status" ) assert inst.status == "draft" assert inst.targetReference.reference == "http://hl7.org/fhir/ValueSet/v3-ActStatus" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/ConceptMap/cm-medication-statement-status-v3" } ).valueUri ) def test_conceptmap_9(base_settings): """No. 9 tests collection for ConceptMap. Test File: conceptmap-cm-medication-statement-status-v3.json """ filename = ( base_settings["unittest_data_dir"] / "conceptmap-cm-medication-statement-status-v3.json" ) inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_9(inst2) def impl_conceptmap_10(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.group[0].element[0].code == "male" assert inst.group[0].element[0].target[0].code == "M" assert inst.group[0].element[0].target[0].equivalence == "equal" assert inst.group[0].element[1].code == "female" assert inst.group[0].element[1].target[0].code == "F" assert inst.group[0].element[1].target[0].equivalence == "equal" assert inst.group[0].element[2].code == "other" assert inst.group[0].element[2].target[0].code == "UN" assert inst.group[0].element[2].target[0].equivalence == "wider" assert inst.group[0].element[3].code == "unknown" assert inst.group[0].element[3].target[0].code == "UNK" assert inst.group[0].element[3].target[0].equivalence == "equal" assert ( inst.group[0].source == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/administrative-gender"} ).valueUri ) assert ( inst.group[0].target == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/v3/AdministrativeGender"} ).valueUri ) assert inst.id == "cm-administrative-gender-v3" assert inst.name == "v3 map for AdministrativeGender" assert inst.publisher == "HL7 (FHIR Project)" assert ( inst.sourceReference.reference == "http://hl7.org/fhir/ValueSet/administrative-gender" ) assert inst.status == "draft" assert ( inst.targetReference.reference == "http://hl7.org/fhir/ValueSet/v3-AdministrativeGender" ) assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/cm-administrative-gender-v3"} ).valueUri ) def test_conceptmap_10(base_settings): """No. 10 tests collection for ConceptMap. Test File: conceptmap-cm-administrative-gender-v3.json """ filename = ( base_settings["unittest_data_dir"] / "conceptmap-cm-administrative-gender-v3.json" ) inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_10(inst2) ================================================ FILE: fhir/resources/STU3/tests/test_operationdefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/OperationDefinition Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from .. import operationdefinition from .conftest import ExternalValidatorModel def impl_operationdefinition_1(inst): assert inst.code == "everything" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.id == "Patient-everything" assert inst.instance is True assert inst.kind == "operation" assert inst.name == "Fetch Patient Record" assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 0 assert inst.parameter[0].name == "start" assert inst.parameter[0].type == "date" assert inst.parameter[0].use == "in" assert inst.parameter[1].max == "1" assert inst.parameter[1].min == 0 assert inst.parameter[1].name == "end" assert inst.parameter[1].type == "date" assert inst.parameter[1].use == "in" assert inst.parameter[2].documentation == 'The bundle type is "searchset"' assert inst.parameter[2].max == "1" assert inst.parameter[2].min == 1 assert inst.parameter[2].name == "return" assert inst.parameter[2].type == "Bundle" assert inst.parameter[2].use == "out" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "Patient" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "generated" assert inst.type is True assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/OperationDefinition/Patient-everything"} ).valueUri ) def test_operationdefinition_1(base_settings): """No. 1 tests collection for OperationDefinition. Test File: operationdefinition-operation-patient-everything(Patient-everything).json """ filename = ( base_settings["unittest_data_dir"] / "operationdefinition-operation-patient-everything(Patient-everything).json" ) inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_1(inst2) def impl_operationdefinition_2(inst): assert inst.code == "find" assert inst.comment == ( "Note that servers may support searching by a functional " "list, and not support this operation that allows clients to " "find the list directly" ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.id == "List-find" assert inst.instance is False assert inst.kind == "operation" assert inst.name == "Find a functional list" assert inst.parameter[0].documentation == ( "The id of a patient resource located on the server on which " "this operation is executed" ) assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 1 assert inst.parameter[0].name == "patient" assert inst.parameter[0].type == "id" assert inst.parameter[0].use == "in" assert ( inst.parameter[1].documentation == "The code for the functional list that is being found" ) assert inst.parameter[1].max == "1" assert inst.parameter[1].min == 1 assert inst.parameter[1].name == "name" assert inst.parameter[1].type == "code" assert inst.parameter[1].use == "in" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "List" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "generated" assert inst.type is True assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/OperationDefinition/List-find"} ).valueUri ) def test_operationdefinition_2(base_settings): """No. 2 tests collection for OperationDefinition. Test File: operationdefinition-operation-list-find(List-find).json """ filename = ( base_settings["unittest_data_dir"] / "operationdefinition-operation-list-find(List-find).json" ) inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_2(inst2) def impl_operationdefinition_3(inst): assert inst.code == "questionnaire" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.id == "StructureDefinition-questionnaire" assert inst.instance is True assert inst.kind == "operation" assert inst.name == "Build Questionnaire" assert inst.parameter[0].documentation == ( "A logical profile identifier (i.e. " "'StructureDefinition.identifier''). The server must know the" " profile or be able to retrieve it from other known " "repositories." ) assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 0 assert inst.parameter[0].name == "identifier" assert inst.parameter[0].type == "uri" assert inst.parameter[0].use == "in" assert inst.parameter[1].documentation == ( "The [StructureDefinition](structuredefinition.html) is " "provided directly as part of the request. Servers may choose" " not to accept profiles in this fashion" ) assert inst.parameter[1].max == "1" assert inst.parameter[1].min == 0 assert inst.parameter[1].name == "profile" assert inst.parameter[1].searchType == "token" assert inst.parameter[1].type == "string" assert inst.parameter[1].use == "in" assert inst.parameter[2].documentation == ( "The profile's official URL (i.e. 'StructureDefinition.url')." " The server must know the profile or be able to retrieve it " "from other known repositories." ) assert inst.parameter[2].max == "1" assert inst.parameter[2].min == 0 assert inst.parameter[2].name == "url" assert inst.parameter[2].type == "uri" assert inst.parameter[2].use == "in" assert inst.parameter[3].documentation == ( "If true, the questionnaire will only include those elements " "marked as \"mustSupport='true'\" in the StructureDefinition." ) assert inst.parameter[3].max == "1" assert inst.parameter[3].min == 0 assert inst.parameter[3].name == "supportedOnly" assert inst.parameter[3].type == "boolean" assert inst.parameter[3].use == "in" assert inst.parameter[4].documentation == ( "The questionnaire form generated based on the " "StructureDefinition." ) assert inst.parameter[4].max == "1" assert inst.parameter[4].min == 1 assert inst.parameter[4].name == "return" assert inst.parameter[4].type == "Questionnaire" assert inst.parameter[4].use == "out" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "StructureDefinition" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "generated" assert inst.type is True assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/OperationDefinition/StructureDefinition-questionnaire" } ).valueUri ) def test_operationdefinition_3(base_settings): """No. 3 tests collection for OperationDefinition. Test File: operationdefinition-operation-structuredefinition-questionnaire(StructureDefinition-questionnaire).json """ filename = ( base_settings["unittest_data_dir"] / "operationdefinition-operation-structuredefinition-questionnaire(StructureDefinition-questionnaire).json" ) inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_3(inst2) def impl_operationdefinition_4(inst): assert inst.code == "populatelink" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.id == "Questionnaire-populatelink" assert inst.instance is True assert inst.kind == "operation" assert inst.name == "Generate a link to a Questionnaire completion webpage" assert inst.parameter[0].documentation == ( "A logical questionnaire identifier (i.e. " "''Questionnaire.identifier''). The server must know the " "questionnaire or be able to retrieve it from other known " "repositories." ) assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 0 assert inst.parameter[0].name == "identifier" assert inst.parameter[0].type == "uri" assert inst.parameter[0].use == "in" assert inst.parameter[1].documentation == ( "The [Questionnaire](questionnaire.html) is provided directly" " as part of the request. Servers may choose not to accept " "questionnaires in this fashion" ) assert inst.parameter[1].max == "1" assert inst.parameter[1].min == 0 assert inst.parameter[1].name == "questionnaire" assert inst.parameter[1].type == "Questionnaire" assert inst.parameter[1].use == "in" assert inst.parameter[2].max == "1" assert inst.parameter[2].min == 0 assert inst.parameter[2].name == "questionnaireRef" assert ( inst.parameter[2].profile.reference == "http://hl7.org/fhir/StructureDefinition/Questionnaire" ) assert inst.parameter[2].type == "Reference" assert inst.parameter[2].use == "in" assert inst.parameter[3].max == "*" assert inst.parameter[3].min == 0 assert inst.parameter[3].name == "content" assert inst.parameter[3].type == "Reference" assert inst.parameter[3].use == "in" assert inst.parameter[4].documentation == ( "If specified and set to 'true' (and the server is capable), " "the server should use what resources and other knowledge it " "has about the referenced subject when pre-populating answers" " to questions." ) assert inst.parameter[4].max == "1" assert inst.parameter[4].min == 0 assert inst.parameter[4].name == "local" assert inst.parameter[4].type == "boolean" assert inst.parameter[4].use == "in" assert inst.parameter[5].documentation == ( "The URL for the web form that supports capturing the " "information defined by questionnaire, possibly partially (or" " fully)-populated with a set of answers for the specified " "Questionnaire" ) assert inst.parameter[5].max == "1" assert inst.parameter[5].min == 1 assert inst.parameter[5].name == "link" assert inst.parameter[5].type == "uri" assert inst.parameter[5].use == "out" assert inst.parameter[6].max == "1" assert inst.parameter[6].min == 0 assert inst.parameter[6].name == "issues" assert inst.parameter[6].type == "OperationOutcome" assert inst.parameter[6].use == "out" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "Questionnaire" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "generated" assert inst.type is True assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/OperationDefinition/Questionnaire-populatelink" } ).valueUri ) def test_operationdefinition_4(base_settings): """No. 4 tests collection for OperationDefinition. Test File: operationdefinition-operation-questionnaire-populatelink(Questionnaire-populatelink).json """ filename = ( base_settings["unittest_data_dir"] / "operationdefinition-operation-questionnaire-populatelink(Questionnaire-populatelink).json" ) inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_4(inst2) def impl_operationdefinition_5(inst): assert inst.code == "apply" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.description == ( "The apply operation realizes a definition in a specific " "context" ) assert inst.id == "ActivityDefinition-apply" assert inst.instance is True assert inst.kind == "operation" assert inst.name == "Apply" assert ( inst.parameter[0].documentation == "The patient that is the target of the activity to be applied" ) assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 1 assert inst.parameter[0].name == "patient" assert ( inst.parameter[0].profile.reference == "http://hl7.org/fhir/StructureDefinition/Patient" ) assert inst.parameter[0].type == "Reference" assert inst.parameter[0].use == "in" assert inst.parameter[1].documentation == "The encounter in context, if any" assert inst.parameter[1].max == "1" assert inst.parameter[1].min == 0 assert inst.parameter[1].name == "encounter" assert ( inst.parameter[1].profile.reference == "http://hl7.org/fhir/StructureDefinition/Encounter" ) assert inst.parameter[1].type == "Reference" assert inst.parameter[1].use == "in" assert inst.parameter[2].documentation == "The practitioner in context" assert inst.parameter[2].max == "1" assert inst.parameter[2].min == 0 assert inst.parameter[2].name == "practitioner" assert ( inst.parameter[2].profile.reference == "http://hl7.org/fhir/StructureDefinition/Practitioner" ) assert inst.parameter[2].type == "Reference" assert inst.parameter[2].use == "in" assert inst.parameter[3].documentation == "The organization in context" assert inst.parameter[3].max == "1" assert inst.parameter[3].min == 0 assert inst.parameter[3].name == "organization" assert ( inst.parameter[3].profile.reference == "http://hl7.org/fhir/StructureDefinition/Organization" ) assert inst.parameter[3].type == "Reference" assert inst.parameter[3].use == "in" assert inst.parameter[4].documentation == ( "The type of user initiating the request, e.g. patient, " "healthcare provider, or specific type of healthcare provider" " (physician, nurse, etc.)" ) assert inst.parameter[4].max == "1" assert inst.parameter[4].min == 0 assert inst.parameter[4].name == "userType" assert inst.parameter[4].type == "CodeableConcept" assert inst.parameter[4].use == "in" assert ( inst.parameter[5].documentation == "Preferred language of the person using the system" ) assert inst.parameter[5].max == "1" assert inst.parameter[5].min == 0 assert inst.parameter[5].name == "userLanguage" assert inst.parameter[5].type == "CodeableConcept" assert inst.parameter[5].use == "in" assert inst.parameter[6].max == "1" assert inst.parameter[6].min == 0 assert inst.parameter[6].name == "userTaskContext" assert inst.parameter[6].type == "CodeableConcept" assert inst.parameter[6].use == "in" assert inst.parameter[7].documentation == ( "The current setting of the request (inpatient, outpatient, " "etc)" ) assert inst.parameter[7].max == "1" assert inst.parameter[7].min == 0 assert inst.parameter[7].name == "setting" assert inst.parameter[7].type == "CodeableConcept" assert inst.parameter[7].use == "in" assert ( inst.parameter[8].documentation == "Additional detail about the setting of the request, if any" ) assert inst.parameter[8].max == "1" assert inst.parameter[8].min == 0 assert inst.parameter[8].name == "settingContext" assert inst.parameter[8].type == "CodeableConcept" assert inst.parameter[8].use == "in" assert ( inst.parameter[9].documentation == "The resource that is the result of applying the definition" ) assert inst.parameter[9].max == "1" assert inst.parameter[9].min == 1 assert inst.parameter[9].name == "return" assert inst.parameter[9].type == "Any" assert inst.parameter[9].use == "out" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "ActivityDefinition" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "generated" assert inst.type is False assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/OperationDefinition/ActivityDefinition-apply" } ).valueUri ) def test_operationdefinition_5(base_settings): """No. 5 tests collection for OperationDefinition. Test File: operationdefinition-operation-activitydefinition-apply(ActivityDefinition-apply).json """ filename = ( base_settings["unittest_data_dir"] / "operationdefinition-operation-activitydefinition-apply(ActivityDefinition-apply).json" ) inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_5(inst2) def impl_operationdefinition_6(inst): assert inst.code == "expand" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.id == "ValueSet-expand" assert inst.instance is True assert inst.kind == "operation" assert inst.name == "Value Set Expansion" assert inst.parameter[0].documentation == ( "A canonical url for a value set. The server must know the " "value set (e.g. it is defined explicitly in the server's " "value sets, or it is defined implicitly by some code system " "known to the server" ) assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 0 assert inst.parameter[0].name == "url" assert inst.parameter[0].type == "uri" assert inst.parameter[0].use == "in" assert inst.parameter[1].documentation == ( "The value set is provided directly as part of the request. " "Servers may choose not to accept value sets in this fashion" ) assert inst.parameter[1].max == "1" assert inst.parameter[1].min == 0 assert inst.parameter[1].name == "valueSet" assert inst.parameter[1].type == "ValueSet" assert inst.parameter[1].use == "in" assert inst.parameter[2].max == "1" assert inst.parameter[2].min == 0 assert inst.parameter[2].name == "context" assert inst.parameter[2].type == "uri" assert inst.parameter[2].use == "in" assert inst.parameter[3].max == "1" assert inst.parameter[3].min == 0 assert inst.parameter[3].name == "filter" assert inst.parameter[3].type == "string" assert inst.parameter[3].use == "in" assert inst.parameter[4].max == "1" assert inst.parameter[4].min == 0 assert inst.parameter[4].name == "profile" assert inst.parameter[4].type == "uri" assert inst.parameter[4].use == "in" assert inst.parameter[5].max == "1" assert inst.parameter[5].min == 0 assert inst.parameter[5].name == "date" assert inst.parameter[5].type == "dateTime" assert inst.parameter[5].use == "in" assert inst.parameter[6].documentation == ( "Paging support - where to start if a subset is desired " "(default = 0). Offset is number of records (not number of " "pages)" ) assert inst.parameter[6].max == "1" assert inst.parameter[6].min == 0 assert inst.parameter[6].name == "offset" assert inst.parameter[6].type == "integer" assert inst.parameter[6].use == "in" assert inst.parameter[7].max == "1" assert inst.parameter[7].min == 0 assert inst.parameter[7].name == "count" assert inst.parameter[7].type == "integer" assert inst.parameter[7].use == "in" assert inst.parameter[8].documentation == ( "Controls whether concept designations are to be included or " "excluded in value set expansions. Overrides the value in the" " expansion profile if there is one" ) assert inst.parameter[8].max == "1" assert inst.parameter[8].min == 0 assert inst.parameter[8].name == "includeDesignations" assert inst.parameter[8].type == "boolean" assert inst.parameter[8].use == "in" assert inst.parameter[9].documentation == ( "Controls whether the value set definition is included or " "excluded in value set expansions. Overrides the value in the" " expansion profile if there is one" ) assert inst.parameter[9].max == "1" assert inst.parameter[9].min == 0 assert inst.parameter[9].name == "includeDefinition" assert inst.parameter[9].type == "boolean" assert inst.parameter[9].use == "in" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "ValueSet" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "generated" assert inst.type is True assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/OperationDefinition/ValueSet-expand"} ).valueUri ) def test_operationdefinition_6(base_settings): """No. 6 tests collection for OperationDefinition. Test File: operationdefinition-operation-valueset-expand(ValueSet-expand).json """ filename = ( base_settings["unittest_data_dir"] / "operationdefinition-operation-valueset-expand(ValueSet-expand).json" ) inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_6(inst2) def impl_operationdefinition_7(inst): assert inst.code == "meta-delete" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.description == ( "This operation takes a meta, and deletes the profiles, tags," " and security labels found in it from the nominated " "resource. This operation can also be used on historical " "entries" ) assert inst.id == "Resource-meta-delete" assert inst.instance is True assert inst.kind == "operation" assert inst.name == "Delete profiles, tags, and security labels for a resource" assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 1 assert inst.parameter[0].name == "meta" assert inst.parameter[0].type == "Meta" assert inst.parameter[0].use == "in" assert inst.parameter[1].documentation == "Resulting meta for the resource" assert inst.parameter[1].max == "1" assert inst.parameter[1].min == 1 assert inst.parameter[1].name == "return" assert inst.parameter[1].type == "Meta" assert inst.parameter[1].use == "out" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "Resource" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "generated" assert inst.type is False assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/OperationDefinition/Resource-meta-delete"} ).valueUri ) def test_operationdefinition_7(base_settings): """No. 7 tests collection for OperationDefinition. Test File: operationdefinition-operation-resource-meta-delete(Resource-meta-delete).json """ filename = ( base_settings["unittest_data_dir"] / "operationdefinition-operation-resource-meta-delete(Resource-meta-delete).json" ) inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_7(inst2) def impl_operationdefinition_8(inst): assert inst.code == "data-requirements" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.description == ( "The data-requirements operation aggregates and returns the " "parameters and data requirements for the activity definition" " and all its dependencies as a single module definition " "library" ) assert inst.id == "ActivityDefinition-data-requirements" assert inst.instance is True assert inst.kind == "operation" assert inst.name == "Data Requirements" assert inst.parameter[0].documentation == ( "The result of the requirements gathering represented as a " "module-definition Library that describes the aggregate " "parameters, data requirements, and dependencies of the " "activity definition" ) assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 1 assert inst.parameter[0].name == "return" assert inst.parameter[0].type == "Library" assert inst.parameter[0].use == "out" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "ActivityDefinition" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "generated" assert inst.type is False assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/OperationDefinition/ActivityDefinition-data-requirements" } ).valueUri ) def test_operationdefinition_8(base_settings): """No. 8 tests collection for OperationDefinition. Test File: operationdefinition-operation-activitydefinition-data-requirements(ActivityDefinition-data-requirements).json """ filename = ( base_settings["unittest_data_dir"] / "operationdefinition-operation-activitydefinition-data-requirements(ActivityDefinition-data-requirements).json" ) inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_8(inst2) def impl_operationdefinition_9(inst): assert inst.code == "closure" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.id == "ConceptMap-closure" assert inst.instance is False assert inst.kind == "operation" assert inst.name == "Closure Table Maintenance" assert inst.parameter[0].documentation == ( "The name that defines the particular context for the " "subsumption based closure table" ) assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 1 assert inst.parameter[0].name == "name" assert inst.parameter[0].type == "string" assert inst.parameter[0].use == "in" assert inst.parameter[1].documentation == "Concepts to add to the closure table" assert inst.parameter[1].max == "*" assert inst.parameter[1].min == 0 assert inst.parameter[1].name == "concept" assert inst.parameter[1].type == "Coding" assert inst.parameter[1].use == "in" assert inst.parameter[2].documentation == ( "A request to resynchronise - request to send all new entries" " since the nominated version was sent by the server" ) assert inst.parameter[2].max == "1" assert inst.parameter[2].min == 0 assert inst.parameter[2].name == "version" assert inst.parameter[2].type == "id" assert inst.parameter[2].use == "in" assert inst.parameter[3].max == "1" assert inst.parameter[3].min == 1 assert inst.parameter[3].name == "return" assert inst.parameter[3].type == "ConceptMap" assert inst.parameter[3].use == "out" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "ConceptMap" assert inst.status == "draft" assert inst.system is True assert inst.text.status == "generated" assert inst.type is False assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/OperationDefinition/ConceptMap-closure"} ).valueUri ) def test_operationdefinition_9(base_settings): """No. 9 tests collection for OperationDefinition. Test File: operationdefinition-operation-conceptmap-closure(ConceptMap-closure).json """ filename = ( base_settings["unittest_data_dir"] / "operationdefinition-operation-conceptmap-closure(ConceptMap-closure).json" ) inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_9(inst2) def impl_operationdefinition_10(inst): assert inst.code == "conforms" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.id == "CapabilityStatement-conforms" assert inst.instance is False assert inst.kind == "operation" assert inst.name == "Test if a server implements a client's required operations" assert inst.parameter[0].documentation == ( "The canonical URL for the left-hand system's capability " "statement" ) assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 0 assert inst.parameter[0].name == "left" assert inst.parameter[0].type == "uri" assert inst.parameter[0].use == "in" assert inst.parameter[1].documentation == ( "The canonical URL for the right-hand system's capability " "statement" ) assert inst.parameter[1].max == "1" assert inst.parameter[1].min == 0 assert inst.parameter[1].name == "right" assert inst.parameter[1].type == "uri" assert inst.parameter[1].use == "in" assert inst.parameter[2].documentation == ( "What kind of comparison to perform - server to server, or " "client to server (use the codes 'server/server' or " "'client/server')" ) assert inst.parameter[2].max == "1" assert inst.parameter[2].min == 0 assert inst.parameter[2].name == "mode" assert inst.parameter[2].type == "code" assert inst.parameter[2].use == "in" assert inst.parameter[3].documentation == "Outcome of the CapabilityStatement test" assert inst.parameter[3].max == "1" assert inst.parameter[3].min == 1 assert inst.parameter[3].name == "issues" assert inst.parameter[3].type == "OperationOutcome" assert inst.parameter[3].use == "out" assert inst.parameter[4].documentation == ( "The intersection of the functionality described by the " "CapabilityStatement resources" ) assert inst.parameter[4].max == "1" assert inst.parameter[4].min == 0 assert inst.parameter[4].name == "union" assert inst.parameter[4].type == "CapabilityStatement" assert inst.parameter[4].use == "out" assert inst.parameter[5].documentation == ( "The union of the functionality described by the " "CapabilityStatement resources" ) assert inst.parameter[5].max == "1" assert inst.parameter[5].min == 0 assert inst.parameter[5].name == "intersection" assert inst.parameter[5].type == "CapabilityStatement" assert inst.parameter[5].use == "out" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "CapabilityStatement" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "generated" assert inst.type is True assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/OperationDefinition/CapabilityStatement-conforms" } ).valueUri ) def test_operationdefinition_10(base_settings): """No. 10 tests collection for OperationDefinition. Test File: operationdefinition-operation-capabilitystatement-conforms(CapabilityStatement-conforms).json """ filename = ( base_settings["unittest_data_dir"] / "operationdefinition-operation-capabilitystatement-conforms(CapabilityStatement-conforms).json" ) inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_10(inst2) ================================================ FILE: fhir/resources/STU3/tests/test_questionnaire.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Questionnaire Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from .. import questionnaire from .conftest import ExternalValidatorModel def impl_questionnaire_1(inst): assert inst.contained[0].id == "vs2" assert inst.contained[1].id == "vs3" assert inst.contained[2].id == "vs4" assert inst.contained[3].id == "vs5" assert inst.contained[4].id == "vs6" assert inst.contained[5].id == "vs7" assert inst.contained[6].id == "vs8" assert inst.contained[7].id == "vs9" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-05-12T00:00:00+10:00"} ).valueDateTime ) assert inst.id == "qs1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs" } ).valueUri ) assert inst.item[0].extension[0].valueInteger == 1 assert ( inst.item[0].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].extension[1].valueInteger == 1 assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].text == "Group of elements for HDL Cholesterol result." assert inst.item[0].item[1].type == "display" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[2].extension[1].valueString == "string" assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].item[1].linkId == "Observation.id.value" assert inst.item[0].item[2].item[1].repeats is False assert inst.item[0].item[2].item[1].required is False assert inst.item[0].item[2].item[1].text == "Logical id of this artifact" assert inst.item[0].item[2].item[1].type == "string" assert inst.item[0].item[2].linkId == "Observation.id" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[3].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content may" " not always be associated with version changes to the " "resource." ) assert inst.item[0].item[3].item[0].type == "display" assert inst.item[0].item[3].linkId == "Observation.meta" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].text == "Metadata about the resource" assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "uri" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].linkId == "Observation.implicitRules.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert ( inst.item[0].item[4].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[4].item[1].type == "string" assert inst.item[0].item[4].linkId == "Observation.implicitRules" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[5].extension[1].valueString == "code" assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].item[1].linkId == "Observation.language.value" assert inst.item[0].item[5].item[1].repeats is False assert inst.item[0].item[5].item[1].required is False assert inst.item[0].item[5].item[1].text == "language" assert inst.item[0].item[5].item[1].type == "choice" assert inst.item[0].item[5].linkId == "Observation.language" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[6].extension[0].valueInteger == 1 assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "Observation.text" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert ( inst.item[0].item[6].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "Observation.contained" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Contained, inline Resources" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "Observation.extension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Additional Content defined by implementations" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[9].item[0].type == "display" assert inst.item[0].item[9].linkId == "Observation.modifierExtension" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].text == "Extensions that cannot be ignored" assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "Observation" assert inst.item[0].repeats is False assert inst.item[0].required is True assert inst.item[0].text == "HDL Cholesterol Result" assert inst.item[0].type == "group" assert inst.publisher == "Grahame Grieve" assert inst.status == "draft" def test_questionnaire_1(base_settings): """No. 1 tests collection for Questionnaire. Test File: questionnaire-hdlcholesterol-questionnaire(qs1).json """ filename = ( base_settings["unittest_data_dir"] / "questionnaire-hdlcholesterol-questionnaire(qs1).json" ) inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_1(inst2) def impl_questionnaire_2(inst): assert inst.contained[0].id == "vs2" assert inst.contained[1].id == "vs3" assert inst.contained[2].id == "vs4" assert inst.contained[3].id == "vs5" assert inst.contained[4].id == "vs6" assert inst.contained[5].id == "vs7" assert inst.contained[6].id == "vs8" assert inst.contained[7].id == "vs9" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-05-12T00:00:00+10:00"} ).valueDateTime ) assert inst.id == "qs1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs" } ).valueUri ) assert inst.item[0].extension[0].valueInteger == 1 assert ( inst.item[0].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].extension[1].valueInteger == 1 assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].text == "Group of elements for Triglyceride result." assert inst.item[0].item[1].type == "display" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[2].extension[1].valueString == "string" assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].item[1].linkId == "Observation.id.value" assert inst.item[0].item[2].item[1].repeats is False assert inst.item[0].item[2].item[1].required is False assert inst.item[0].item[2].item[1].text == "Logical id of this artifact" assert inst.item[0].item[2].item[1].type == "string" assert inst.item[0].item[2].linkId == "Observation.id" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[3].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content may" " not always be associated with version changes to the " "resource." ) assert inst.item[0].item[3].item[0].type == "display" assert inst.item[0].item[3].linkId == "Observation.meta" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].text == "Metadata about the resource" assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "uri" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].linkId == "Observation.implicitRules.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert ( inst.item[0].item[4].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[4].item[1].type == "string" assert inst.item[0].item[4].linkId == "Observation.implicitRules" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[5].extension[1].valueString == "code" assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].item[1].linkId == "Observation.language.value" assert inst.item[0].item[5].item[1].repeats is False assert inst.item[0].item[5].item[1].required is False assert inst.item[0].item[5].item[1].text == "language" assert inst.item[0].item[5].item[1].type == "choice" assert inst.item[0].item[5].linkId == "Observation.language" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[6].extension[0].valueInteger == 1 assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "Observation.text" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert ( inst.item[0].item[6].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "Observation.contained" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Contained, inline Resources" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "Observation.extension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Additional Content defined by implementations" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[9].item[0].type == "display" assert inst.item[0].item[9].linkId == "Observation.modifierExtension" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].text == "Extensions that cannot be ignored" assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "Observation" assert inst.item[0].repeats is False assert inst.item[0].required is True assert inst.item[0].text == "Triglyceride Result" assert inst.item[0].type == "group" assert inst.publisher == "Grahame Grieve" assert inst.status == "draft" def test_questionnaire_2(base_settings): """No. 2 tests collection for Questionnaire. Test File: questionnaire-triglyceride-questionnaire(qs1).json """ filename = ( base_settings["unittest_data_dir"] / "questionnaire-triglyceride-questionnaire(qs1).json" ) inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_2(inst2) def impl_questionnaire_3(inst): assert inst.contained[0].id == "vs2" assert inst.contained[1].id == "vs3" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.id == "qs1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.item[0].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[0].text == ( "A booking of a healthcare event among patient(s), " "practitioner(s), related person(s) and/or device(s) for a " "specific date/time. This may result in one or more " "Encounter(s)." ) assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[1].extension[0].valueInteger == 1 assert ( inst.item[0].item[1].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[1].extension[1].valueString == "string" assert ( inst.item[0].item[1].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].item[0].type == "display" assert inst.item[0].item[1].item[1].linkId == "Appointment.id.value" assert inst.item[0].item[1].item[1].repeats is False assert inst.item[0].item[1].item[1].required is False assert inst.item[0].item[1].item[1].text == "Logical id of this artifact" assert inst.item[0].item[1].item[1].type == "string" assert inst.item[0].item[1].linkId == "Appointment.id" assert inst.item[0].item[1].repeats is True assert inst.item[0].item[1].required is False assert inst.item[0].item[1].type == "group" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content may" " not always be associated with version changes to the " "resource." ) assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].linkId == "Appointment.meta" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].text == "Metadata about the resource" assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[3].extension[1].valueString == "uri" assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[3].item[0].type == "display" assert inst.item[0].item[3].item[1].linkId == "Appointment.implicitRules.value" assert inst.item[0].item[3].item[1].repeats is False assert inst.item[0].item[3].item[1].required is False assert ( inst.item[0].item[3].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[3].item[1].type == "string" assert inst.item[0].item[3].linkId == "Appointment.implicitRules" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "code" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].linkId == "Appointment.language.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert inst.item[0].item[4].item[1].text == "language" assert inst.item[0].item[4].item[1].type == "choice" assert inst.item[0].item[4].linkId == "Appointment.language" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].linkId == "Appointment.text" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert ( inst.item[0].item[5].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "Appointment.contained" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert inst.item[0].item[6].text == "Contained, inline Resources" assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "Appointment.extension" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Additional Content defined by implementations" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "Appointment.modifierExtension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Extensions that cannot be ignored" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[9].extension[0].valueString == "Identifier" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[9].item[0].type == "display" assert inst.item[0].item[9].item[1].linkId == "Appointment.identifier.label" assert inst.item[0].item[9].item[1].repeats is False assert inst.item[0].item[9].item[1].required is False assert inst.item[0].item[9].item[1].text == "label:" assert inst.item[0].item[9].item[1].type == "string" assert inst.item[0].item[9].item[2].linkId == "Appointment.identifier.system" assert inst.item[0].item[9].item[2].repeats is False assert inst.item[0].item[9].item[2].required is False assert inst.item[0].item[9].item[2].text == "system:" assert inst.item[0].item[9].item[2].type == "string" assert inst.item[0].item[9].item[3].linkId == "Appointment.identifier.value" assert inst.item[0].item[9].item[3].repeats is False assert inst.item[0].item[9].item[3].required is False assert inst.item[0].item[9].item[3].text == "value:" assert inst.item[0].item[9].item[3].type == "string" assert inst.item[0].item[9].linkId == "Appointment.identifier" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].text == "External Ids for this item" assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "Appointment" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == ( "A booking of a healthcare event among patient(s), " "practitioner(s), related person(s) and/or device(s) for a " "specific date/time. This may result in one or more " "Encounter(s)" ) assert inst.item[0].type == "group" assert inst.publisher == "Health Level Seven International (Patient Administration)" assert inst.status == "draft" def test_questionnaire_3(base_settings): """No. 3 tests collection for Questionnaire. Test File: questionnaire-appointment-questionnaire(qs1).json """ filename = ( base_settings["unittest_data_dir"] / "questionnaire-appointment-questionnaire(qs1).json" ) inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_3(inst2) def impl_questionnaire_4(inst): assert inst.contained[0].id == "vs2" assert inst.contained[1].id == "vs3" assert inst.contained[2].id == "vs4" assert inst.contained[3].id == "vs5" assert inst.contained[4].id == "vs6" assert inst.contained[5].id == "vs7" assert inst.contained[6].id == "vs8" assert inst.contained[7].id == "vs9" assert inst.contained[8].id == "vs10" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.id == "qs1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.item[0].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[0].text == ( "A formal agreement between parties regarding the conduct of " "business, exchange of information or other matters." ) assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[1].extension[0].valueInteger == 1 assert ( inst.item[0].item[1].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[1].extension[1].valueString == "string" assert ( inst.item[0].item[1].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].item[0].type == "display" assert inst.item[0].item[1].item[1].linkId == "Contract.id.value" assert inst.item[0].item[1].item[1].repeats is False assert inst.item[0].item[1].item[1].required is False assert inst.item[0].item[1].item[1].text == "Logical id of this artifact" assert inst.item[0].item[1].item[1].type == "string" assert inst.item[0].item[1].linkId == "Contract.id" assert inst.item[0].item[1].repeats is True assert inst.item[0].item[1].required is False assert inst.item[0].item[1].type == "group" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content may" " not always be associated with version changes to the " "resource." ) assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].linkId == "Contract.meta" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].text == "Metadata about the resource" assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[3].extension[1].valueString == "uri" assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[3].item[0].type == "display" assert inst.item[0].item[3].item[1].linkId == "Contract.implicitRules.value" assert inst.item[0].item[3].item[1].repeats is False assert inst.item[0].item[3].item[1].required is False assert ( inst.item[0].item[3].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[3].item[1].type == "string" assert inst.item[0].item[3].linkId == "Contract.implicitRules" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "code" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].linkId == "Contract.language.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert inst.item[0].item[4].item[1].text == "language" assert inst.item[0].item[4].item[1].type == "choice" assert inst.item[0].item[4].linkId == "Contract.language" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].linkId == "Contract.text" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert ( inst.item[0].item[5].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "Contract.contained" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert inst.item[0].item[6].text == "Contained, inline Resources" assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "Contract.extension" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Additional Content defined by implementations" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "Contract.modifierExtension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Extensions that cannot be ignored" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[9].extension[0].valueInteger == 1 assert ( inst.item[0].item[9].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[9].extension[1].valueString == "Identifier" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[9].item[0].text == "Unique identifier for this Contract." assert inst.item[0].item[9].item[0].type == "display" assert inst.item[0].item[9].item[1].linkId == "Contract.identifier.label" assert inst.item[0].item[9].item[1].repeats is False assert inst.item[0].item[9].item[1].required is False assert inst.item[0].item[9].item[1].text == "label:" assert inst.item[0].item[9].item[1].type == "string" assert inst.item[0].item[9].item[2].linkId == "Contract.identifier.system" assert inst.item[0].item[9].item[2].repeats is False assert inst.item[0].item[9].item[2].required is False assert inst.item[0].item[9].item[2].text == "system:" assert inst.item[0].item[9].item[2].type == "string" assert inst.item[0].item[9].item[3].linkId == "Contract.identifier.value" assert inst.item[0].item[9].item[3].repeats is False assert inst.item[0].item[9].item[3].required is False assert inst.item[0].item[9].item[3].text == "value:" assert inst.item[0].item[9].item[3].type == "string" assert inst.item[0].item[9].linkId == "Contract.identifier" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].text == "Contract number" assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "Contract" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == "Legal Agreement" assert inst.item[0].type == "group" assert inst.publisher == "Health Level Seven International (Financial Management)" assert inst.status == "draft" def test_questionnaire_4(base_settings): """No. 4 tests collection for Questionnaire. Test File: questionnaire-contract-questionnaire(qs1).json """ filename = ( base_settings["unittest_data_dir"] / "questionnaire-contract-questionnaire(qs1).json" ) inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_4(inst2) def impl_questionnaire_5(inst): assert inst.contained[0].id == "vs2" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.id == "qs1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.item[0].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[0].text == ( "A text description of the DICOM SOP instances selected in " "the ImagingManifest; or the reason for, or significance of, " "the selection." ) assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[1].extension[0].valueInteger == 1 assert ( inst.item[0].item[1].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[1].extension[1].valueString == "string" assert ( inst.item[0].item[1].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].item[0].type == "display" assert inst.item[0].item[1].item[1].linkId == "ImagingManifest.id.value" assert inst.item[0].item[1].item[1].repeats is False assert inst.item[0].item[1].item[1].required is False assert inst.item[0].item[1].item[1].text == "Logical id of this artifact" assert inst.item[0].item[1].item[1].type == "string" assert inst.item[0].item[1].linkId == "ImagingManifest.id" assert inst.item[0].item[1].repeats is True assert inst.item[0].item[1].required is False assert inst.item[0].item[1].type == "group" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content may" " not always be associated with version changes to the " "resource." ) assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].linkId == "ImagingManifest.meta" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].text == "Metadata about the resource" assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[3].extension[1].valueString == "uri" assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[3].item[0].type == "display" assert inst.item[0].item[3].item[1].linkId == "ImagingManifest.implicitRules.value" assert inst.item[0].item[3].item[1].repeats is False assert inst.item[0].item[3].item[1].required is False assert ( inst.item[0].item[3].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[3].item[1].type == "string" assert inst.item[0].item[3].linkId == "ImagingManifest.implicitRules" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "code" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].linkId == "ImagingManifest.language.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert inst.item[0].item[4].item[1].text == "language" assert inst.item[0].item[4].item[1].type == "choice" assert inst.item[0].item[4].linkId == "ImagingManifest.language" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].linkId == "ImagingManifest.text" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert ( inst.item[0].item[5].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "ImagingManifest.contained" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert inst.item[0].item[6].text == "Contained, inline Resources" assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "ImagingManifest.extension" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Additional Content defined by implementations" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "ImagingManifest.modifierExtension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Extensions that cannot be ignored" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[9].extension[0].valueInteger == 1 assert ( inst.item[0].item[9].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[9].extension[1].valueString == "Identifier" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[9].item[0].text == ( "Unique identifier of the DICOM Key Object Selection (KOS) " "that this resource represents." ) assert inst.item[0].item[9].item[0].type == "display" assert inst.item[0].item[9].item[1].linkId == "ImagingManifest.identifier.label" assert inst.item[0].item[9].item[1].repeats is False assert inst.item[0].item[9].item[1].required is False assert inst.item[0].item[9].item[1].text == "label:" assert inst.item[0].item[9].item[1].type == "string" assert inst.item[0].item[9].item[2].linkId == "ImagingManifest.identifier.system" assert inst.item[0].item[9].item[2].repeats is False assert inst.item[0].item[9].item[2].required is False assert inst.item[0].item[9].item[2].text == "system:" assert inst.item[0].item[9].item[2].type == "string" assert inst.item[0].item[9].item[3].linkId == "ImagingManifest.identifier.value" assert inst.item[0].item[9].item[3].repeats is False assert inst.item[0].item[9].item[3].required is False assert inst.item[0].item[9].item[3].text == "value:" assert inst.item[0].item[9].item[3].type == "string" assert inst.item[0].item[9].linkId == "ImagingManifest.identifier" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].text == "SOP Instance UID" assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "ImagingManifest" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == "Key Object Selection" assert inst.item[0].type == "group" assert inst.publisher == "Health Level Seven International (Imaging Integration)" assert inst.status == "draft" def test_questionnaire_5(base_settings): """No. 5 tests collection for Questionnaire. Test File: questionnaire-imagingmanifest-questionnaire(qs1).json """ filename = ( base_settings["unittest_data_dir"] / "questionnaire-imagingmanifest-questionnaire(qs1).json" ) inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_5(inst2) def impl_questionnaire_6(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.id == "qs1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.item[0].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[0].text == ( "A summary of information based on the results of executing a" " TestScript." ) assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[1].extension[0].valueInteger == 1 assert ( inst.item[0].item[1].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[1].extension[1].valueString == "string" assert ( inst.item[0].item[1].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].item[0].type == "display" assert inst.item[0].item[1].item[1].linkId == "TestReport.id.value" assert inst.item[0].item[1].item[1].repeats is False assert inst.item[0].item[1].item[1].required is False assert inst.item[0].item[1].item[1].text == "Logical id of this artifact" assert inst.item[0].item[1].item[1].type == "string" assert inst.item[0].item[1].linkId == "TestReport.id" assert inst.item[0].item[1].repeats is True assert inst.item[0].item[1].required is False assert inst.item[0].item[1].type == "group" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content may" " not always be associated with version changes to the " "resource." ) assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].linkId == "TestReport.meta" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].text == "Metadata about the resource" assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[3].extension[1].valueString == "uri" assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[3].item[0].type == "display" assert inst.item[0].item[3].item[1].linkId == "TestReport.implicitRules.value" assert inst.item[0].item[3].item[1].repeats is False assert inst.item[0].item[3].item[1].required is False assert ( inst.item[0].item[3].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[3].item[1].type == "string" assert inst.item[0].item[3].linkId == "TestReport.implicitRules" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "code" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].linkId == "TestReport.language.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert inst.item[0].item[4].item[1].text == "language" assert inst.item[0].item[4].item[1].type == "choice" assert inst.item[0].item[4].linkId == "TestReport.language" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].linkId == "TestReport.text" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert ( inst.item[0].item[5].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "TestReport.contained" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert inst.item[0].item[6].text == "Contained, inline Resources" assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "TestReport.extension" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Additional Content defined by implementations" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "TestReport.modifierExtension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Extensions that cannot be ignored" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[9].extension[0].valueInteger == 1 assert ( inst.item[0].item[9].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[9].extension[1].valueString == "Identifier" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[9].item[0].text == ( "Identifier for the TestScript assigned for external purposes" " outside the context of FHIR." ) assert inst.item[0].item[9].item[0].type == "display" assert inst.item[0].item[9].item[1].linkId == "TestReport.identifier.label" assert inst.item[0].item[9].item[1].repeats is False assert inst.item[0].item[9].item[1].required is False assert inst.item[0].item[9].item[1].text == "label:" assert inst.item[0].item[9].item[1].type == "string" assert inst.item[0].item[9].item[2].linkId == "TestReport.identifier.system" assert inst.item[0].item[9].item[2].repeats is False assert inst.item[0].item[9].item[2].required is False assert inst.item[0].item[9].item[2].text == "system:" assert inst.item[0].item[9].item[2].type == "string" assert inst.item[0].item[9].item[3].linkId == "TestReport.identifier.value" assert inst.item[0].item[9].item[3].repeats is False assert inst.item[0].item[9].item[3].required is False assert inst.item[0].item[9].item[3].text == "value:" assert inst.item[0].item[9].item[3].type == "string" assert inst.item[0].item[9].linkId == "TestReport.identifier" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].text == "External identifier" assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "TestReport" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == "Describes the results of a TestScript execution" assert inst.item[0].type == "group" assert inst.publisher == "Health Level Seven International (FHIR Infrastructure)" assert inst.status == "draft" def test_questionnaire_6(base_settings): """No. 6 tests collection for Questionnaire. Test File: questionnaire-testreport-questionnaire(qs1).json """ filename = ( base_settings["unittest_data_dir"] / "questionnaire-testreport-questionnaire(qs1).json" ) inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_6(inst2) def impl_questionnaire_7(inst): assert inst.contained[0].id == "vs2" assert inst.contained[1].id == "vs3" assert inst.contained[2].id == "vs4" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.id == "qs1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.item[0].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[0].text == ( "A record of a device being used by a patient where the " "record is the result of a report from the patient or another" " clinician." ) assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[1].extension[0].valueInteger == 1 assert ( inst.item[0].item[1].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[1].extension[1].valueString == "string" assert ( inst.item[0].item[1].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].item[0].type == "display" assert inst.item[0].item[1].item[1].linkId == "DeviceUseStatement.id.value" assert inst.item[0].item[1].item[1].repeats is False assert inst.item[0].item[1].item[1].required is False assert inst.item[0].item[1].item[1].text == "Logical id of this artifact" assert inst.item[0].item[1].item[1].type == "string" assert inst.item[0].item[1].linkId == "DeviceUseStatement.id" assert inst.item[0].item[1].repeats is True assert inst.item[0].item[1].required is False assert inst.item[0].item[1].type == "group" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content may" " not always be associated with version changes to the " "resource." ) assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].linkId == "DeviceUseStatement.meta" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].text == "Metadata about the resource" assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[3].extension[1].valueString == "uri" assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[3].item[0].type == "display" assert ( inst.item[0].item[3].item[1].linkId == "DeviceUseStatement.implicitRules.value" ) assert inst.item[0].item[3].item[1].repeats is False assert inst.item[0].item[3].item[1].required is False assert ( inst.item[0].item[3].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[3].item[1].type == "string" assert inst.item[0].item[3].linkId == "DeviceUseStatement.implicitRules" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "code" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].linkId == "DeviceUseStatement.language.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert inst.item[0].item[4].item[1].text == "language" assert inst.item[0].item[4].item[1].type == "choice" assert inst.item[0].item[4].linkId == "DeviceUseStatement.language" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].linkId == "DeviceUseStatement.text" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert ( inst.item[0].item[5].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "DeviceUseStatement.contained" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert inst.item[0].item[6].text == "Contained, inline Resources" assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "DeviceUseStatement.extension" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Additional Content defined by implementations" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "DeviceUseStatement.modifierExtension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Extensions that cannot be ignored" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[9].extension[0].valueString == "Identifier" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[9].item[0].text == "An external identifier for this statement such as an IRI." ) assert inst.item[0].item[9].item[0].type == "display" assert inst.item[0].item[9].item[1].linkId == "DeviceUseStatement.identifier.label" assert inst.item[0].item[9].item[1].repeats is False assert inst.item[0].item[9].item[1].required is False assert inst.item[0].item[9].item[1].text == "label:" assert inst.item[0].item[9].item[1].type == "string" assert inst.item[0].item[9].item[2].linkId == "DeviceUseStatement.identifier.system" assert inst.item[0].item[9].item[2].repeats is False assert inst.item[0].item[9].item[2].required is False assert inst.item[0].item[9].item[2].text == "system:" assert inst.item[0].item[9].item[2].type == "string" assert inst.item[0].item[9].item[3].linkId == "DeviceUseStatement.identifier.value" assert inst.item[0].item[9].item[3].repeats is False assert inst.item[0].item[9].item[3].required is False assert inst.item[0].item[9].item[3].text == "value:" assert inst.item[0].item[9].item[3].type == "string" assert inst.item[0].item[9].linkId == "DeviceUseStatement.identifier" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].text == "External identifier for this record" assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "DeviceUseStatement" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == "Record of use of a device" assert inst.item[0].type == "group" assert ( inst.publisher == "Health Level Seven International (Orders and Observations)" ) assert inst.status == "draft" def test_questionnaire_7(base_settings): """No. 7 tests collection for Questionnaire. Test File: questionnaire-deviceusestatement-questionnaire(qs1).json """ filename = ( base_settings["unittest_data_dir"] / "questionnaire-deviceusestatement-questionnaire(qs1).json" ) inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_7(inst2) def impl_questionnaire_8(inst): assert inst.contained[0].id == "vs2" assert inst.contained[1].id == "vs3" assert inst.contained[2].id == "vs4" assert inst.contained[3].id == "vs5" assert inst.contained[4].id == "vs6" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-03-25T00:00:00+11:00"} ).valueDateTime ) assert inst.id == "qs1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].text == ( "This profile defines how to represent heart rate " "observations in FHIR using a standard LOINC code and UCUM " "units of measure." ) assert inst.item[0].item[1].type == "display" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[2].extension[1].valueString == "string" assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].item[1].linkId == "Observation.id.value" assert inst.item[0].item[2].item[1].repeats is False assert inst.item[0].item[2].item[1].required is False assert inst.item[0].item[2].item[1].text == "Logical id of this artifact" assert inst.item[0].item[2].item[1].type == "string" assert inst.item[0].item[2].linkId == "Observation.id" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[3].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content may" " not always be associated with version changes to the " "resource." ) assert inst.item[0].item[3].item[0].type == "display" assert inst.item[0].item[3].linkId == "Observation.meta" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].text == "Metadata about the resource" assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "uri" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].linkId == "Observation.implicitRules.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert ( inst.item[0].item[4].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[4].item[1].type == "string" assert inst.item[0].item[4].linkId == "Observation.implicitRules" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[5].extension[1].valueString == "code" assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].item[1].linkId == "Observation.language.value" assert inst.item[0].item[5].item[1].repeats is False assert inst.item[0].item[5].item[1].required is False assert inst.item[0].item[5].item[1].text == "language" assert inst.item[0].item[5].item[1].type == "choice" assert inst.item[0].item[5].linkId == "Observation.language" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[6].extension[0].valueInteger == 1 assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "Observation.text" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert ( inst.item[0].item[6].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "Observation.contained" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Contained, inline Resources" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "Observation.extension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Additional Content defined by implementations" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[9].item[0].type == "display" assert inst.item[0].item[9].linkId == "Observation.modifierExtension" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].text == "Extensions that cannot be ignored" assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "Observation" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == "FHIR Heart Rate Profile" assert inst.item[0].type == "group" assert inst.publisher == ( "Health Level Seven International (Orders and Observations " "Workgroup)" ) assert inst.status == "draft" def test_questionnaire_8(base_settings): """No. 8 tests collection for Questionnaire. Test File: questionnaire-heartrate-questionnaire(qs1).json """ filename = ( base_settings["unittest_data_dir"] / "questionnaire-heartrate-questionnaire(qs1).json" ) inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_8(inst2) def impl_questionnaire_9(inst): assert inst.contained[0].id == "vs2" assert inst.contained[1].id == "vs3" assert inst.contained[2].id == "vs4" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.id == "qs1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].type == "display" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[2].extension[1].valueString == "string" assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].item[1].linkId == "Composition.id.value" assert inst.item[0].item[2].item[1].repeats is False assert inst.item[0].item[2].item[1].required is False assert inst.item[0].item[2].item[1].text == "Logical id of this artifact" assert inst.item[0].item[2].item[1].type == "string" assert inst.item[0].item[2].linkId == "Composition.id" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[3].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content may" " not always be associated with version changes to the " "resource." ) assert inst.item[0].item[3].item[0].type == "display" assert inst.item[0].item[3].linkId == "Composition.meta" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].text == "Metadata about the resource" assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "uri" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].linkId == "Composition.implicitRules.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert ( inst.item[0].item[4].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[4].item[1].type == "string" assert inst.item[0].item[4].linkId == "Composition.implicitRules" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[5].extension[1].valueString == "code" assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].item[1].linkId == "Composition.language.value" assert inst.item[0].item[5].item[1].repeats is False assert inst.item[0].item[5].item[1].required is False assert inst.item[0].item[5].item[1].text == "language" assert inst.item[0].item[5].item[1].type == "choice" assert inst.item[0].item[5].linkId == "Composition.language" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[6].extension[0].valueInteger == 1 assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "Composition.text" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert ( inst.item[0].item[6].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "Composition.contained" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Contained, inline Resources" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "Composition.extension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Additional Content defined by implementations" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[9].item[0].type == "display" assert inst.item[0].item[9].linkId == "Composition.modifierExtension" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].text == "Extensions that cannot be ignored" assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "Composition" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == ( "A set of resources composed into a single coherent clinical " "statement with clinical attestation" ) assert inst.item[0].type == "group" assert inst.publisher == "Health Level Seven International (Structured Documents)" assert inst.status == "draft" def test_questionnaire_9(base_settings): """No. 9 tests collection for Questionnaire. Test File: questionnaire-composition-questionnaire(qs1).json """ filename = ( base_settings["unittest_data_dir"] / "questionnaire-composition-questionnaire(qs1).json" ) inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_9(inst2) def impl_questionnaire_10(inst): assert inst.contained[0].id == "vs2" assert inst.contained[1].id == "vs3" assert inst.contained[2].id == "vs4" assert inst.contained[3].id == "vs5" assert inst.contained[4].id == "vs6" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-03-25T00:00:00+11:00"} ).valueDateTime ) assert inst.id == "qs1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].text == ( "The FHIR Vitals Signs profile sets a minimum expectations " "for the Observation Resource to record, search and fetch the" " vital signs associated with a patient." ) assert inst.item[0].item[1].type == "display" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[2].extension[1].valueString == "string" assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].item[1].linkId == "Observation.id.value" assert inst.item[0].item[2].item[1].repeats is False assert inst.item[0].item[2].item[1].required is False assert inst.item[0].item[2].item[1].text == "Logical id of this artifact" assert inst.item[0].item[2].item[1].type == "string" assert inst.item[0].item[2].linkId == "Observation.id" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[3].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content may" " not always be associated with version changes to the " "resource." ) assert inst.item[0].item[3].item[0].type == "display" assert inst.item[0].item[3].linkId == "Observation.meta" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].text == "Metadata about the resource" assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "uri" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].linkId == "Observation.implicitRules.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert ( inst.item[0].item[4].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[4].item[1].type == "string" assert inst.item[0].item[4].linkId == "Observation.implicitRules" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[5].extension[1].valueString == "code" assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].item[1].linkId == "Observation.language.value" assert inst.item[0].item[5].item[1].repeats is False assert inst.item[0].item[5].item[1].required is False assert inst.item[0].item[5].item[1].text == "language" assert inst.item[0].item[5].item[1].type == "choice" assert inst.item[0].item[5].linkId == "Observation.language" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[6].extension[0].valueInteger == 1 assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "Observation.text" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert ( inst.item[0].item[6].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "Observation.contained" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Contained, inline Resources" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "Observation.extension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Additional Content defined by implementations" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[9].item[0].type == "display" assert inst.item[0].item[9].linkId == "Observation.modifierExtension" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].text == "Extensions that cannot be ignored" assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "Observation" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == "FHIR Vital Signs Profile" assert inst.item[0].type == "group" assert inst.publisher == ( "Health Level Seven International (Orders and Observations " "Workgroup)" ) assert inst.status == "draft" def test_questionnaire_10(base_settings): """No. 10 tests collection for Questionnaire. Test File: questionnaire-vitalsigns-questionnaire(qs1).json """ filename = ( base_settings["unittest_data_dir"] / "questionnaire-vitalsigns-questionnaire(qs1).json" ) inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_10(inst2) ================================================ FILE: fhir/resources/STU3/tests/test_searchparameter.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/SearchParameter Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from .. import searchparameter from .conftest import ExternalValidatorModel def impl_searchparameter_1(inst): assert inst.code == "effective" assert inst.description == "Optional Extensions Element" assert inst.experimental is True assert inst.id == "valueset-extensions-ValueSet-effective" assert inst.name == "effective" assert inst.status == "draft" assert inst.type == "date" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/valueset-extensions-ValueSet-effective" } ).valueUri ) assert inst.xpath == ( "f:ValueSet/f:extension[@url='http://hl7.org/fhir/StructureDe" "finition/valueset-effectiveDate'] | /f:#effectiveDate" ) assert inst.xpathUsage == "normal" def test_searchparameter_1(base_settings): """No. 1 tests collection for SearchParameter. Test File: searchparameter-valueset-extensions-ValueSet-effective.json """ filename = ( base_settings["unittest_data_dir"] / "searchparameter-valueset-extensions-ValueSet-effective.json" ) inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_1(inst2) def impl_searchparameter_2(inst): assert inst.base[0] == "Observation" assert inst.code == "dna-variant" assert inst.description == "HGVS DNA variant" assert inst.experimental is True assert inst.id == "observation-genetic-Observation-dna-variant" assert inst.name == "dna-variant" assert inst.status == "draft" assert inst.type == "string" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/observation-genetic-Observation-dna-variant" } ).valueUri ) assert inst.xpathUsage == "normal" def test_searchparameter_2(base_settings): """No. 2 tests collection for SearchParameter. Test File: searchparameter-observation-genetic-Observation-dna-variant.json """ filename = ( base_settings["unittest_data_dir"] / "searchparameter-observation-genetic-Observation-dna-variant.json" ) inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_2(inst2) def impl_searchparameter_3(inst): assert inst.base[0] == "Observation" assert inst.code == "gene-dnavariant" assert inst.description == "HGNC gene symbol and HGVS DNA Variant" assert inst.experimental is True assert inst.id == "observation-genetic-Observation-gene-dnavariant" assert inst.name == "gene-dnavariant" assert inst.status == "draft" assert inst.type == "string" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/observation-genetic-Observation-gene-dnavariant" } ).valueUri ) assert inst.xpathUsage == "normal" def test_searchparameter_3(base_settings): """No. 3 tests collection for SearchParameter. Test File: searchparameter-observation-genetic-Observation-gene-dnavariant.json """ filename = ( base_settings["unittest_data_dir"] / "searchparameter-observation-genetic-Observation-gene-dnavariant.json" ) inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_3(inst2) def impl_searchparameter_4(inst): assert inst.code == "alias" assert inst.description == "Include Locations that contain the provided alias" assert inst.experimental is True assert inst.id == "location-extensions-Location-alias" assert inst.name == "alias" assert inst.status == "draft" assert inst.type == "string" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/location-extensions-Location-alias" } ).valueUri ) assert inst.xpath == ( "f:Location/f:extension[@url='http://hl7.org/fhir/StructureDe" "finition/location-alias'] | /f:#alias" ) assert inst.xpathUsage == "normal" def test_searchparameter_4(base_settings): """No. 4 tests collection for SearchParameter. Test File: searchparameter-location-extensions-Location-alias.json """ filename = ( base_settings["unittest_data_dir"] / "searchparameter-location-extensions-Location-alias.json" ) inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_4(inst2) def impl_searchparameter_5(inst): assert inst.base[0] == "Condition" assert inst.code == "definition" assert inst.description == "Matches on the definition extension value" assert inst.experimental is True assert inst.id == "condition-extensions-Condition-definition" assert inst.name == "definition" assert inst.status == "draft" assert inst.type == "reference" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/condition-extensions-Condition-definition" } ).valueUri ) assert inst.xpath == ( "f:Condition/f:extension[@url='http://hl7.org/fhir/StructureD" "efinition/condition-definition'] | f:Condition/f:extension[@" "url='http://hl7.org/fhir/StructureDefinition/condition-" "definition']" ) assert inst.xpathUsage == "normal" def test_searchparameter_5(base_settings): """No. 5 tests collection for SearchParameter. Test File: searchparameter-condition-extensions-Condition-definition.json """ filename = ( base_settings["unittest_data_dir"] / "searchparameter-condition-extensions-Condition-definition.json" ) inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_5(inst2) def impl_searchparameter_6(inst): assert inst.code == "author" assert inst.description == "Optional Extensions Element" assert inst.experimental is True assert inst.id == "codesystem-extensions-CodeSystem-author" assert inst.name == "author" assert inst.status == "draft" assert inst.type == "string" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/codesystem-extensions-CodeSystem-author" } ).valueUri ) assert inst.xpath == ( "f:CodeSystem/f:extension[@url='http://hl7.org/fhir/Structure" "Definition/codesystem-author'] | /f:#author" ) assert inst.xpathUsage == "normal" def test_searchparameter_6(base_settings): """No. 6 tests collection for SearchParameter. Test File: searchparameter-codesystem-extensions-CodeSystem-author.json """ filename = ( base_settings["unittest_data_dir"] / "searchparameter-codesystem-extensions-CodeSystem-author.json" ) inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_6(inst2) def impl_searchparameter_7(inst): assert inst.code == "end" assert inst.description == "Optional Extensions Element" assert inst.experimental is True assert inst.id == "codesystem-extensions-CodeSystem-end" assert inst.name == "end" assert inst.status == "draft" assert inst.type == "date" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/codesystem-extensions-CodeSystem-end" } ).valueUri ) assert inst.xpath == ( "f:CodeSystem/f:extension[@url='http://hl7.org/fhir/Structure" "Definition/codesystem-expirationDate'] | /f:#expirationDate" ) assert inst.xpathUsage == "normal" def test_searchparameter_7(base_settings): """No. 7 tests collection for SearchParameter. Test File: searchparameter-codesystem-extensions-CodeSystem-end.json """ filename = ( base_settings["unittest_data_dir"] / "searchparameter-codesystem-extensions-CodeSystem-end.json" ) inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_7(inst2) def impl_searchparameter_8(inst): assert inst.code == "effective" assert inst.description == "Optional Extensions Element" assert inst.experimental is True assert inst.id == "codesystem-extensions-CodeSystem-effective" assert inst.name == "effective" assert inst.status == "draft" assert inst.type == "date" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/codesystem-extensions-CodeSystem-effective" } ).valueUri ) assert inst.xpath == ( "f:CodeSystem/f:extension[@url='http://hl7.org/fhir/Structure" "Definition/codesystem-effectiveDate'] | /f:#effectiveDate" ) assert inst.xpathUsage == "normal" def test_searchparameter_8(base_settings): """No. 8 tests collection for SearchParameter. Test File: searchparameter-codesystem-extensions-CodeSystem-effective.json """ filename = ( base_settings["unittest_data_dir"] / "searchparameter-codesystem-extensions-CodeSystem-effective.json" ) inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_8(inst2) def impl_searchparameter_9(inst): assert inst.base[0] == "Observation" assert inst.code == "amino-acid-change" assert inst.description == "HGVS Protein Change" assert inst.experimental is True assert inst.id == "observation-genetic-Observation-amino-acid-change" assert inst.name == "amino-acid-change" assert inst.status == "draft" assert inst.type == "string" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/observation-genetic-Observation-amino-acid-change" } ).valueUri ) assert inst.xpathUsage == "normal" def test_searchparameter_9(base_settings): """No. 9 tests collection for SearchParameter. Test File: searchparameter-observation-genetic-Observation-amino-acid-change.json """ filename = ( base_settings["unittest_data_dir"] / "searchparameter-observation-genetic-Observation-amino-acid-change.json" ) inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_9(inst2) def impl_searchparameter_10(inst): assert inst.base[0] == "DiagnosticReport" assert inst.code == "assessed-condition" assert inst.description == "Condition assessed by genetic test" assert inst.experimental is True assert inst.id == "diagnosticreport-genetic-DiagnosticReport-assessed-condition" assert inst.name == "assessed-condition" assert inst.status == "draft" assert inst.type == "reference" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/SearchParameter/diagnosticreport-genetic-DiagnosticReport-assessed-condition" } ).valueUri ) assert inst.xpathUsage == "normal" def test_searchparameter_10(base_settings): """No. 10 tests collection for SearchParameter. Test File: searchparameter-diagnosticreport-genetic-DiagnosticReport-assessed-condition.json """ filename = ( base_settings["unittest_data_dir"] / "searchparameter-diagnosticreport-genetic-DiagnosticReport-assessed-condition.json" ) inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_10(inst2) ================================================ FILE: fhir/resources/STU3/tests/test_valueset.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ValueSet Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from .. import valueset from .conftest import ExternalValidatorModel def impl_valueset_1(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/message-reasons-encounter"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.description == ( "Example Message Reasons. These are the set of codes that " "might be used an updating an encounter using admin-update." ) assert inst.experimental is True assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status" } ).valueUri ) assert inst.extension[0].valueString == "Informative" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[1].valueInteger == 1 assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[2].valueCode == "inm" assert inst.id == "message-reason-encounter" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.365" assert inst.immutable is True assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2019-10-24T11:53:00+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/shareablevalueset"} ).valueUri ) assert inst.name == "Example Message Reason Codes" assert inst.publisher == "FHIR Project" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/message-reason-encounter"} ).valueUri ) assert inst.version == "3.0.2" def test_valueset_1(base_settings): """No. 1 tests collection for ValueSet. Test File: valueset-valueset-message-reason-encounter(message-reason-encounter).json """ filename = ( base_settings["unittest_data_dir"] / "valueset-valueset-message-reason-encounter(message-reason-encounter).json" ) inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_1(inst2) def impl_valueset_2(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/implant-status"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.description == ( "A set codes that define the functional status of an " "implanted device." ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status" } ).valueUri ) assert inst.extension[0].valueString == "Informative" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[1].valueInteger == 0 assert inst.id == "implant-status" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.865" assert inst.immutable is True assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2019-10-24T11:53:00+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/shareablevalueset"} ).valueUri ) assert inst.name == "Implant Status" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/implant-status"} ).valueUri ) assert inst.version == "3.0.2" def test_valueset_2(base_settings): """No. 2 tests collection for ValueSet. Test File: valueset-valueset-implant-status(implant-status).json """ filename = ( base_settings["unittest_data_dir"] / "valueset-valueset-implant-status(implant-status).json" ) inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_2(inst2) def impl_valueset_3(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/action-selection-behavior"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.description == "Defines selection behavior of a group" assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status" } ).valueUri ) assert inst.extension[0].valueString == "Informative" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[1].valueInteger == 2 assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[2].valueCode == "cds" assert inst.id == "action-selection-behavior" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.784" assert inst.immutable is True assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2019-10-24T11:53:00+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/shareablevalueset"} ).valueUri ) assert inst.name == "ActionSelectionBehavior" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/action-selection-behavior"} ).valueUri ) assert inst.version == "3.0.2" def test_valueset_3(base_settings): """No. 3 tests collection for ValueSet. Test File: valueset-valueset-action-selection-behavior(action-selection-behavior).json """ filename = ( base_settings["unittest_data_dir"] / "valueset-valueset-action-selection-behavior(action-selection-behavior).json" ) inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_3(inst2) def impl_valueset_4(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/search-param-type"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.description == "Data types allowed to be used for search parameters." assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status" } ).valueUri ) assert inst.extension[0].valueString == "Informative" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[1].valueInteger == 4 assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[2].valueCode == "fhir" assert inst.id == "search-param-type" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.11" assert inst.immutable is True assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2019-10-24T11:53:00+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/shareablevalueset"} ).valueUri ) assert inst.name == "SearchParamType" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/search-param-type"} ).valueUri ) assert inst.version == "3.0.2" def test_valueset_4(base_settings): """No. 4 tests collection for ValueSet. Test File: valueset-valueset-search-param-type(search-param-type).json """ filename = ( base_settings["unittest_data_dir"] / "valueset-valueset-search-param-type(search-param-type).json" ) inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_4(inst2) def impl_valueset_5(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.copyright == ( "This content from LOINC® is copyright © 1995 Regenstrief " "Institute, Inc. and the LOINC Committee, and available at no" " cost under the license at http://loinc.org/terms-of-use." ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.description == ( "This value set includes all the LOINC codes which relate to " "Diagnostic Observations." ) assert inst.experimental is True assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status" } ).valueUri ) assert inst.extension[0].valueString == "Informative" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[1].valueInteger == 3 assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[2].valueCode == "oo" assert inst.id == "report-codes" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.228" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2019-10-24T11:53:00+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/shareablevalueset"} ).valueUri ) assert inst.name == "LOINC Diagnostic Report Codes" assert inst.publisher == "FHIR Project team" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/report-codes"} ).valueUri ) assert inst.version == "3.0.2" def test_valueset_5(base_settings): """No. 5 tests collection for ValueSet. Test File: valueset-valueset-report-codes(report-codes).json """ filename = ( base_settings["unittest_data_dir"] / "valueset-valueset-report-codes(report-codes).json" ) inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_5(inst2) def impl_valueset_6(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/observation-relationshiptypes"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.description == "Codes specifying how two observations are related." assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status" } ).valueUri ) assert inst.extension[0].valueString == "Informative" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[1].valueInteger == 5 assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[2].valueCode == "oo" assert inst.id == "observation-relationshiptypes" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.389" assert inst.immutable is True assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2019-10-24T11:53:00+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/shareablevalueset"} ).valueUri ) assert inst.name == "ObservationRelationshipType" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/observation-relationshiptypes"} ).valueUri ) assert inst.version == "3.0.2" def test_valueset_6(base_settings): """No. 6 tests collection for ValueSet. Test File: valueset-valueset-observation-relationshiptypes(observation-relationshiptypes).json """ filename = ( base_settings["unittest_data_dir"] / "valueset-valueset-observation-relationshiptypes(observation-relationshiptypes).json" ) inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_6(inst2) def impl_valueset_7(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/bundle-type"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.description == ( "Indicates the purpose of a bundle - how it was intended to " "be used." ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status" } ).valueUri ) assert inst.extension[0].valueString == "Informative" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[1].valueInteger == 5 assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[2].valueCode == "fhir" assert inst.id == "bundle-type" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.612" assert inst.immutable is True assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2019-10-24T11:53:00+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/shareablevalueset"} ).valueUri ) assert inst.name == "BundleType" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/bundle-type"} ).valueUri ) assert inst.version == "3.0.2" def test_valueset_7(base_settings): """No. 7 tests collection for ValueSet. Test File: valueset-valueset-bundle-type(bundle-type).json """ filename = ( base_settings["unittest_data_dir"] / "valueset-valueset-bundle-type(bundle-type).json" ) inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_7(inst2) def impl_valueset_8(inst): assert inst.compose.include[0].filter[0].op == "is-a" assert inst.compose.include[0].filter[0].property == "concept" assert inst.compose.include[0].filter[0].value == "_ActAccountCode" assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/v3/ActCode"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.description == ( "This examples value set defines the set of codes that can be" " used to represent the type of an account." ) assert inst.experimental is True assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status" } ).valueUri ) assert inst.extension[0].valueString == "Informative" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[1].valueInteger == 1 assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[2].valueCode == "pa" assert inst.id == "account-type" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.716" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2019-10-24T11:53:00+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/shareablevalueset"} ).valueUri ) assert inst.name == "Account Types" assert inst.publisher == "FHIR Project team" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/account-type"} ).valueUri ) assert inst.version == "3.0.2" def test_valueset_8(base_settings): """No. 8 tests collection for ValueSet. Test File: valueset-valueset-account-type(account-type).json """ filename = ( base_settings["unittest_data_dir"] / "valueset-valueset-account-type(account-type).json" ) inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_8(inst2) def impl_valueset_9(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/testscript-operation-codes"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert inst.description == ( "This value set defines a set of codes that are used to " "indicate the supported operations of a testing engine or " "tool." ) assert inst.experimental is True assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status" } ).valueUri ) assert inst.extension[0].valueString == "Informative" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[1].valueInteger == 2 assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[2].valueCode == "fhir" assert inst.id == "testscript-operation-codes" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.690" assert inst.immutable is True assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2019-10-24T11:53:00+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/shareablevalueset"} ).valueUri ) assert inst.name == "TestScriptOperationCode" assert inst.publisher == "FHIR Project team" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/testscript-operation-codes"} ).valueUri ) assert inst.version == "3.0.2" def test_valueset_9(base_settings): """No. 9 tests collection for ValueSet. Test File: valueset-valueset-testscript-operation-codes(testscript-operation-codes).json """ filename = ( base_settings["unittest_data_dir"] / "valueset-valueset-testscript-operation-codes(testscript-operation-codes).json" ) inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_9(inst2) def impl_valueset_10(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.hl7.org/fhir/contractsignertypecodes"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-24T11:53:00+11:00"} ).valueDateTime ) assert ( inst.description == "This value set includes sample Contract Signer Type codes." ) assert inst.experimental is True assert inst.extensible is True assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status" } ).valueUri ) assert inst.extension[0].valueString == "Informative" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[1].valueInteger == 1 assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[2].valueCode == "fm" assert inst.id == "contract-signer-type" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.725" assert inst.immutable is True assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2019-10-24T11:53:00+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/shareablevalueset"} ).valueUri ) assert inst.name == "Contract Signer Type Codes" assert inst.publisher == "Financial Management" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/contract-signer-type"} ).valueUri ) assert inst.version == "3.0.2" def test_valueset_10(base_settings): """No. 10 tests collection for ValueSet. Test File: valueset-valueset-contract-signer-type(contract-signer-type).json """ filename = ( base_settings["unittest_data_dir"] / "valueset-valueset-contract-signer-type(contract-signer-type).json" ) inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_10(inst2) ================================================ FILE: fhir/resources/STU3/testscript.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/TestScript Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class TestScript(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Describes a set of tests. A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification. """ __resource_type__ = "TestScript" contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the test script and/or its contents." " Copyright statements are generally legal restrictions on the use and " "publishing of the test script." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date this was last changed", description=( "The date (and optionally time) when the test script was published. " "The date must change if and when the business version changes and it " "must change if the status code changes. In addition, it should change " "when the substantive content of the test script changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the test script", description=( "A free text natural language description of the test script from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) destination: typing.List[fhirtypes.TestScriptDestinationType] | None = Field( default=None, alias="destination", title=( "An abstract server representing a destination or receiver in a message" " exchange" ), description=( "An abstract server used in operations within this test script in the " "destination element." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A boolean value to indicate that this test script is authored for " "testing purposes (or education/evaluation/marketing), and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) fixture: typing.List[fhirtypes.TestScriptFixtureType] | None = Field( default=None, alias="fixture", title="Fixture in the test script - by reference (uri)", description=( "Fixture in the test script - by reference (uri). All fixtures are " "required for the test script to execute." ), json_schema_extra={ "element_property": True, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Additional identifier for the test script", description=( "A formal identifier that is used to identify this test script when it " "is represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for test script (if applicable)", description=( "A legal or geographic region in which the test script is intended to " "be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) metadata: fhirtypes.TestScriptMetadataType | None = Field( default=None, alias="metadata", title=( "Required capability that is assumed to function correctly on the FHIR " "server being tested" ), description=( "The required capability must exist and are assumed to function " "correctly on the FHIR server being tested." ), json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this test script (computer friendly)", description=( "A natural language name identifying the test script. This name should " "be usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) origin: typing.List[fhirtypes.TestScriptOriginType] | None = Field( default=None, alias="origin", title=( "An abstract server representing a client or sender in a message " "exchange" ), description=( "An abstract server used in operations within this test script in the " "origin element." ), json_schema_extra={ "element_property": True, }, ) profile: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="profile", title="Reference of the validation profile", description="Reference to the profile to be used for validation.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the individual or organization that published the test " "script." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this test script is defined", description=( "Explaination of why this test script is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) rule: typing.List[fhirtypes.TestScriptRuleType] | None = Field( default=None, alias="rule", title="Assert rule used within the test script", description="Assert rule to be used in one or more asserts within the test script.", json_schema_extra={ "element_property": True, }, ) ruleset: typing.List[fhirtypes.TestScriptRulesetType] | None = Field( default=None, alias="ruleset", title="Assert ruleset used within the test script", description=( "Contains one or more rules. Offers a way to group rules so assertions" " could reference the group of rules and have them all applied." ), json_schema_extra={ "element_property": True, }, ) setup: fhirtypes.TestScriptSetupType | None = Field( default=None, alias="setup", title="A series of required setup operations before tests are executed", description=None, json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this test script. Enables tracking the life-cycle of the" " content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) teardown: fhirtypes.TestScriptTeardownType | None = Field( default=None, alias="teardown", title="A series of required clean up steps", description=( "A series of operations required to clean up after the all the tests " "are executed (successfully or otherwise)." ), json_schema_extra={ "element_property": True, }, ) test: typing.List[fhirtypes.TestScriptTestType] | None = Field( default=None, alias="test", title="A test in this script", description=None, json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this test script (human friendly)", description="A short, descriptive, user-friendly title for the test script.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Logical URI to reference this test script (globally unique)", description=( "An absolute URI that is used to identify this test script when it is " "referenced in a specification, model, design or an instance. This " "SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at" " which this test script is (or will be) published. The URL SHOULD " "include the major version of the test script. For more information see" " [Technical and Business Versions](resource.html#versions)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Context the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching for appropriate test script instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) variable: typing.List[fhirtypes.TestScriptVariableType] | None = Field( default=None, alias="variable", title="Placeholder for evaluated elements", description=( "Variable is set based either on element value in response body or on " "header field value in the response headers." ), json_schema_extra={ "element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the test script", description=( "The identifier that is used to identify this version of the test " "script when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the test script author" " and is not expected to be globally unique. For example, it might be a" " timestamp (e.g. yyyymmdd) if a managed version is not available. " "There is also no expectation that versions can be placed in a " "lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScript`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "origin", "destination", "metadata", "fixture", "profile", "variable", "rule", "ruleset", "setup", "test", "teardown", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScript`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("name", "name__ext"), ("status", "status__ext"), ("url", "url__ext"), ] return required_fields class TestScriptDestination(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An abstract server representing a destination or receiver in a message exchange. An abstract server used in operations within this test script in the destination element. """ __resource_type__ = "TestScriptDestination" index: fhirtypes.IntegerType | None = Field( default=None, alias="index", title="The index of the abstract destination server starting at 1", description=( "Abstract name given to a destination server in this test script. The " "name is provided as a number starting at 1." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) index__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_index", title="Extension field for ``index``." ) profile: fhirtypes.CodingType = Field( default=..., alias="profile", title=( "FHIR-Server | FHIR-SDC-FormManager | FHIR-SDC-FormReceiver | FHIR-SDC-" "FormProcessor" ), description="The type of destination profile the test system supports.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptDestination`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "index", "profile"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptDestination`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("index", "index__ext")] return required_fields class TestScriptFixture(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Fixture in the test script - by reference (uri). Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute. """ __resource_type__ = "TestScriptFixture" autocreate: bool | None = Field( default=None, alias="autocreate", title="Whether or not to implicitly create the fixture during setup", description=( "Whether or not to implicitly create the fixture during setup. If true," " the fixture is automatically created on each server being tested " "during setup, therefore no create operation is required for this " "fixture in the TestScript.setup section." ), json_schema_extra={ "element_property": True, }, ) autocreate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_autocreate", title="Extension field for ``autocreate``." ) autodelete: bool | None = Field( default=None, alias="autodelete", title="Whether or not to implicitly delete the fixture during teardown", description=( "Whether or not to implicitly delete the fixture during teardown. If " "true, the fixture is automatically deleted on each server being tested" " during teardown, therefore no delete operation is required for this " "fixture in the TestScript.teardown section." ), json_schema_extra={ "element_property": True, }, ) autodelete__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_autodelete", title="Extension field for ``autodelete``." ) resource: fhirtypes.ReferenceType | None = Field( default=None, alias="resource", title="Reference of the resource", description=( "Reference to the resource (containing the contents of the resource " "needed for operations)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptFixture`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "autocreate", "autodelete", "resource", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptFixture`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptMetadata(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Required capability that is assumed to function correctly on the FHIR server being tested. The required capability must exist and are assumed to function correctly on the FHIR server being tested. """ __resource_type__ = "TestScriptMetadata" capability: typing.List[fhirtypes.TestScriptMetadataCapabilityType] = Field( default=..., alias="capability", title=( "Capabilities that are assumed to function correctly on the FHIR " "server being tested" ), description=( "Capabilities that must exist and are assumed to function correctly on " "the FHIR server being tested." ), json_schema_extra={ "element_property": True, }, ) link: typing.List[fhirtypes.TestScriptMetadataLinkType] | None = Field( default=None, alias="link", title="Links to the FHIR specification", description="A link to the FHIR specification that this test is covering.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptMetadata`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "link", "capability"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptMetadata`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptMetadataCapability(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Capabilities that are assumed to function correctly on the FHIR server being tested. Capabilities that must exist and are assumed to function correctly on the FHIR server being tested. """ __resource_type__ = "TestScriptMetadataCapability" capabilities: fhirtypes.ReferenceType = Field( default=..., alias="capabilities", title="Required Capability Statement", description=( "Minimum capabilities required of server for test script to execute " "successfully. If server does not meet at a minimum the referenced " "capability statement, then all tests in this script are skipped." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CapabilityStatement"], }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="The expected capabilities of the server", description=( "Description of the capabilities that this test script is requiring the" " server to support." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) destination: fhirtypes.IntegerType | None = Field( default=None, alias="destination", title="Which server these requirements apply to", description=None, json_schema_extra={ "element_property": True, }, ) destination__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_destination", title="Extension field for ``destination``." ) link: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="link", title="Links to the FHIR specification", description=( "Links to the FHIR specification that describes this interaction and " "the resources involved in more detail." ), json_schema_extra={ "element_property": True, }, ) link__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_link", title="Extension field for ``link``." ) origin: typing.List[fhirtypes.IntegerType | None] | None = Field( default=None, alias="origin", title="Which origin server these requirements apply to", description=None, json_schema_extra={ "element_property": True, }, ) origin__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_origin", title="Extension field for ``origin``." ) required: bool | None = Field( default=None, alias="required", title="Are the capabilities required?", description=( "Whether or not the test execution will require the given capabilities " "of the server in order for this test script to execute." ), json_schema_extra={ "element_property": True, }, ) required__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_required", title="Extension field for ``required``." ) validated: bool | None = Field( default=None, alias="validated", title="Are the capabilities validated?", description=( "Whether or not the test execution will validate the given capabilities" " of the server in order for this test script to execute." ), json_schema_extra={ "element_property": True, }, ) validated__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_validated", title="Extension field for ``validated``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptMetadataCapability`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "required", "validated", "description", "origin", "destination", "link", "capabilities", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptMetadataCapability`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptMetadataLink(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Links to the FHIR specification. A link to the FHIR specification that this test is covering. """ __resource_type__ = "TestScriptMetadataLink" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Short description", description="Short description of the link.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="URL to the specification", description=( "URL to a particular requirement or feature within the FHIR " "specification." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptMetadataLink`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "url", "description"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptMetadataLink`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("url", "url__ext")] return required_fields class TestScriptOrigin(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An abstract server representing a client or sender in a message exchange. An abstract server used in operations within this test script in the origin element. """ __resource_type__ = "TestScriptOrigin" index: fhirtypes.IntegerType | None = Field( default=None, alias="index", title="The index of the abstract origin server starting at 1", description=( "Abstract name given to an origin server in this test script. The name" " is provided as a number starting at 1." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) index__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_index", title="Extension field for ``index``." ) profile: fhirtypes.CodingType = Field( default=..., alias="profile", title="FHIR-Client | FHIR-SDC-FormFiller", description="The type of origin profile the test system supports.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptOrigin`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "index", "profile"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptOrigin`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("index", "index__ext")] return required_fields class TestScriptRule(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Assert rule used within the test script. Assert rule to be used in one or more asserts within the test script. """ __resource_type__ = "TestScriptRule" param: typing.List[fhirtypes.TestScriptRuleParamType] | None = Field( default=None, alias="param", title="Rule parameter template", description=( "Each rule template can take one or more parameters for rule " "evaluation." ), json_schema_extra={ "element_property": True, }, ) resource: fhirtypes.ReferenceType = Field( default=..., alias="resource", title="Assert rule resource reference", description=( "Reference to the resource (containing the contents of the rule needed " "for assertions)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptRule`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "resource", "param"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptRule`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptRuleParam(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Rule parameter template. Each rule template can take one or more parameters for rule evaluation. """ __resource_type__ = "TestScriptRuleParam" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Parameter name matching external assert rule parameter", description=( "Descriptive name for this parameter that matches the external assert " "rule parameter name." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="Parameter value defined either explicitly or dynamically", description=( "The explicit or dynamic value for the parameter that will be passed on" " to the external rule template." ), json_schema_extra={ "element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptRuleParam`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptRuleParam`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields class TestScriptRuleset(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Assert ruleset used within the test script. Contains one or more rules. Offers a way to group rules so assertions could reference the group of rules and have them all applied. """ __resource_type__ = "TestScriptRuleset" resource: fhirtypes.ReferenceType = Field( default=..., alias="resource", title="Assert ruleset resource reference", description=( "Reference to the resource (containing the contents of the ruleset " "needed for assertions)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) rule: typing.List[fhirtypes.TestScriptRulesetRuleType] = Field( default=..., alias="rule", title="The referenced rule within the ruleset", description="The referenced rule within the external ruleset template.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptRuleset`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "resource", "rule"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptRuleset`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptRulesetRule(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The referenced rule within the ruleset. The referenced rule within the external ruleset template. """ __resource_type__ = "TestScriptRulesetRule" param: typing.List[fhirtypes.TestScriptRulesetRuleParamType] | None = Field( default=None, alias="param", title="Ruleset rule parameter template", description=( "Each rule template can take one or more parameters for rule " "evaluation." ), json_schema_extra={ "element_property": True, }, ) ruleId: fhirtypes.IdType | None = Field( default=None, alias="ruleId", title="Id of referenced rule within the ruleset", description="Id of the referenced rule within the external ruleset template.", json_schema_extra={ "element_property": True, "element_required": True, }, ) ruleId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_ruleId", title="Extension field for ``ruleId``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptRulesetRule`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "ruleId", "param"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptRulesetRule`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("ruleId", "ruleId__ext")] return required_fields class TestScriptRulesetRuleParam(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Ruleset rule parameter template. Each rule template can take one or more parameters for rule evaluation. """ __resource_type__ = "TestScriptRulesetRuleParam" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Parameter name matching external assert ruleset rule parameter", description=( "Descriptive name for this parameter that matches the external assert " "ruleset rule parameter name." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="Parameter value defined either explicitly or dynamically", description=( "The value for the parameter that will be passed on to the external " "ruleset rule template." ), json_schema_extra={ "element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptRulesetRuleParam`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptRulesetRuleParam`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields class TestScriptSetup(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A series of required setup operations before tests are executed. """ __resource_type__ = "TestScriptSetup" action: typing.List[fhirtypes.TestScriptSetupActionType] = Field( default=..., alias="action", title="A setup operation or assert to perform", description="Action would contain either an operation or an assertion.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptSetup`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "action"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptSetup`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptSetupAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A setup operation or assert to perform. Action would contain either an operation or an assertion. """ __resource_type__ = "TestScriptSetupAction" assert_fhir: fhirtypes.TestScriptSetupActionAssertType | None = Field( default=None, alias="assert", title="The assertion to perform", description=( "Evaluates the results of previous operations to determine if the " "server under test behaves appropriately." ), json_schema_extra={ "element_property": True, }, ) operation: fhirtypes.TestScriptSetupActionOperationType | None = Field( default=None, alias="operation", title="The setup operation to perform", description="The operation to perform.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptSetupAction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "operation", "assert"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptSetupAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptSetupActionAssert(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The assertion to perform. Evaluates the results of previous operations to determine if the server under test behaves appropriately. """ __resource_type__ = "TestScriptSetupActionAssert" compareToSourceExpression: fhirtypes.StringType | None = Field( default=None, alias="compareToSourceExpression", title="The fluentpath expression to evaluate against the source fixture", description=( "The fluentpath expression to evaluate against the source fixture. When" " compareToSourceId is defined, either compareToSourceExpression or " "compareToSourcePath must be defined, but not both." ), json_schema_extra={ "element_property": True, }, ) compareToSourceExpression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_compareToSourceExpression", title="Extension field for ``compareToSourceExpression``.", ) compareToSourceId: fhirtypes.StringType | None = Field( default=None, alias="compareToSourceId", title="Id of the source fixture to be evaluated", description=( "Id of the source fixture used as the contents to be evaluated by " 'either the "source/expression" or "sourceId/path" definition.' ), json_schema_extra={ "element_property": True, }, ) compareToSourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_compareToSourceId", title="Extension field for ``compareToSourceId``.", ) compareToSourcePath: fhirtypes.StringType | None = Field( default=None, alias="compareToSourcePath", title="XPath or JSONPath expression to evaluate against the source fixture", description=( "XPath or JSONPath expression to evaluate against the source fixture. " "When compareToSourceId is defined, either compareToSourceExpression or" " compareToSourcePath must be defined, but not both." ), json_schema_extra={ "element_property": True, }, ) compareToSourcePath__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_compareToSourcePath", title="Extension field for ``compareToSourcePath``.", ) contentType: fhirtypes.CodeType | None = Field( default=None, alias="contentType", title="xml | json | ttl | none", description=( "The content-type or mime-type to use for RESTful operation in the " "'Content-Type' header." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["xml", "json", "ttl", "none"], }, ) contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contentType", title="Extension field for ``contentType``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Tracking/reporting assertion description", description=( "The description would be used by test engines for tracking and " "reporting purposes." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) direction: fhirtypes.CodeType | None = Field( default=None, alias="direction", title="response | request", description="The direction to use for the assertion.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["response", "request"], }, ) direction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_direction", title="Extension field for ``direction``." ) expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="The fluentpath expression to be evaluated", description=( "The fluentpath expression to be evaluated against the request or " "response message contents - HTTP headers and payload." ), json_schema_extra={ "element_property": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) headerField: fhirtypes.StringType | None = Field( default=None, alias="headerField", title="HTTP header field name", description="The HTTP header field name e.g. 'Location'.", json_schema_extra={ "element_property": True, }, ) headerField__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_headerField", title="Extension field for ``headerField``." ) label: fhirtypes.StringType | None = Field( default=None, alias="label", title="Tracking/logging assertion label", description="The label would be used for tracking/logging purposes by test engines.", json_schema_extra={ "element_property": True, }, ) label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_label", title="Extension field for ``label``." ) minimumId: fhirtypes.StringType | None = Field( default=None, alias="minimumId", title="Fixture Id of minimum content resource", description=( "The ID of a fixture. Asserts that the response contains at a minimum " "the fixture specified by minimumId." ), json_schema_extra={ "element_property": True, }, ) minimumId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minimumId", title="Extension field for ``minimumId``." ) navigationLinks: bool | None = Field( default=None, alias="navigationLinks", title="Perform validation on navigation links?", description=( "Whether or not the test execution performs validation on the bundle " "navigation links." ), json_schema_extra={ "element_property": True, }, ) navigationLinks__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_navigationLinks", title="Extension field for ``navigationLinks``.", ) operator: fhirtypes.CodeType | None = Field( default=None, alias="operator", title=( "equals | notEquals | in | notIn | greaterThan | lessThan | empty | " "notEmpty | contains | notContains | eval" ), description=( "The operator type defines the conditional behavior of the assert. If " "not defined, the default is equals." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "equals", "notEquals", "in", "notIn", "greaterThan", "lessThan", "empty", "notEmpty", "contains", "notContains", "eval", ], }, ) operator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_operator", title="Extension field for ``operator``." ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="XPath or JSONPath expression", description=( "The XPath or JSONPath expression to be evaluated against the fixture " "representing the response received from server." ), json_schema_extra={ "element_property": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) requestMethod: fhirtypes.CodeType | None = Field( default=None, alias="requestMethod", title="delete | get | options | patch | post | put", description=( "The request method or HTTP operation code to compare against that used" " by the client system under test." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["delete", "get", "options", "patch", "post", "put"], }, ) requestMethod__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requestMethod", title="Extension field for ``requestMethod``.", ) requestURL: fhirtypes.StringType | None = Field( default=None, alias="requestURL", title="Request URL comparison value", description="The value to use in a comparison against the request URL path string.", json_schema_extra={ "element_property": True, }, ) requestURL__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requestURL", title="Extension field for ``requestURL``." ) resource: fhirtypes.CodeType | None = Field( default=None, alias="resource", title="Resource type", description=( "The type of the resource. See " "http://hl7.org/fhir/STU3/resourcelist.html." ), json_schema_extra={ "element_property": True, }, ) resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resource", title="Extension field for ``resource``." ) response: fhirtypes.CodeType | None = Field( default=None, alias="response", title=( "okay | created | noContent | notModified | bad | forbidden | notFound " "| methodNotAllowed | conflict | gone | preconditionFailed | " "unprocessable" ), description=None, json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "okay", "created", "noContent", "notModified", "bad", "forbidden", "notFound", "methodNotAllowed", "conflict", "gone", "preconditionFailed", "unprocessable", ], }, ) response__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_response", title="Extension field for ``response``." ) responseCode: fhirtypes.StringType | None = Field( default=None, alias="responseCode", title="HTTP response code to test", description="The value of the HTTP response code to be tested.", json_schema_extra={ "element_property": True, }, ) responseCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_responseCode", title="Extension field for ``responseCode``.", ) rule: fhirtypes.TestScriptSetupActionAssertRuleType | None = Field( default=None, alias="rule", title="The reference to a TestScript.rule", description="The TestScript.rule this assert will evaluate.", json_schema_extra={ "element_property": True, }, ) ruleset: fhirtypes.TestScriptSetupActionAssertRulesetType | None = Field( default=None, alias="ruleset", title="The reference to a TestScript.ruleset", description="The TestScript.ruleset this assert will evaluate.", json_schema_extra={ "element_property": True, }, ) sourceId: fhirtypes.IdType | None = Field( default=None, alias="sourceId", title="Fixture Id of source expression or headerField", description=( "Fixture to evaluate the XPath/JSONPath expression or the headerField " "against." ), json_schema_extra={ "element_property": True, }, ) sourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceId", title="Extension field for ``sourceId``." ) validateProfileId: fhirtypes.IdType | None = Field( default=None, alias="validateProfileId", title="Profile Id of validation profile reference", description="The ID of the Profile to validate against.", json_schema_extra={ "element_property": True, }, ) validateProfileId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_validateProfileId", title="Extension field for ``validateProfileId``.", ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The value to compare to", description=None, json_schema_extra={ "element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) warningOnly: bool | None = Field( default=None, alias="warningOnly", title="Will this assert produce a warning only on error?", description=( "Whether or not the test execution will produce a warning only on error" " for this assert." ), json_schema_extra={ "element_property": True, }, ) warningOnly__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_warningOnly", title="Extension field for ``warningOnly``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptSetupActionAssert`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "label", "description", "direction", "compareToSourceId", "compareToSourceExpression", "compareToSourcePath", "contentType", "expression", "headerField", "minimumId", "navigationLinks", "operator", "path", "requestMethod", "requestURL", "resource", "response", "responseCode", "rule", "ruleset", "sourceId", "validateProfileId", "value", "warningOnly", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionAssert`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptSetupActionAssertRule(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The reference to a TestScript.rule. The TestScript.rule this assert will evaluate. """ __resource_type__ = "TestScriptSetupActionAssertRule" param: typing.List[ fhirtypes.TestScriptSetupActionAssertRuleParamType ] | None = Field( default=None, alias="param", title="Rule parameter template", description=( "Each rule template can take one or more parameters for rule " "evaluation." ), json_schema_extra={ "element_property": True, }, ) ruleId: fhirtypes.IdType | None = Field( default=None, alias="ruleId", title="Id of the TestScript.rule", description="The TestScript.rule id value this assert will evaluate.", json_schema_extra={ "element_property": True, "element_required": True, }, ) ruleId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_ruleId", title="Extension field for ``ruleId``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptSetupActionAssertRule`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "ruleId", "param"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionAssertRule`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("ruleId", "ruleId__ext")] return required_fields class TestScriptSetupActionAssertRuleParam(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Rule parameter template. Each rule template can take one or more parameters for rule evaluation. """ __resource_type__ = "TestScriptSetupActionAssertRuleParam" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Parameter name matching external assert rule parameter", description=( "Descriptive name for this parameter that matches the external assert " "rule parameter name." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="Parameter value defined either explicitly or dynamically", description=( "The value for the parameter that will be passed on to the external " "rule template." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptSetupActionAssertRuleParam`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionAssertRuleParam`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext"), ("value", "value__ext")] return required_fields class TestScriptSetupActionAssertRuleset(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The reference to a TestScript.ruleset. The TestScript.ruleset this assert will evaluate. """ __resource_type__ = "TestScriptSetupActionAssertRuleset" rule: typing.List[ fhirtypes.TestScriptSetupActionAssertRulesetRuleType ] | None = Field( default=None, alias="rule", title="The referenced rule within the ruleset", description="The referenced rule within the external ruleset template.", json_schema_extra={ "element_property": True, }, ) rulesetId: fhirtypes.IdType | None = Field( default=None, alias="rulesetId", title="Id of the TestScript.ruleset", description="The TestScript.ruleset id value this assert will evaluate.", json_schema_extra={ "element_property": True, "element_required": True, }, ) rulesetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rulesetId", title="Extension field for ``rulesetId``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptSetupActionAssertRuleset`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "rulesetId", "rule"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionAssertRuleset`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("rulesetId", "rulesetId__ext")] return required_fields class TestScriptSetupActionAssertRulesetRule(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The referenced rule within the ruleset. The referenced rule within the external ruleset template. """ __resource_type__ = "TestScriptSetupActionAssertRulesetRule" param: typing.List[ fhirtypes.TestScriptSetupActionAssertRulesetRuleParamType ] | None = Field( default=None, alias="param", title="Rule parameter template", description=( "Each rule template can take one or more parameters for rule " "evaluation." ), json_schema_extra={ "element_property": True, }, ) ruleId: fhirtypes.IdType | None = Field( default=None, alias="ruleId", title="Id of referenced rule within the ruleset", description="Id of the referenced rule within the external ruleset template.", json_schema_extra={ "element_property": True, "element_required": True, }, ) ruleId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_ruleId", title="Extension field for ``ruleId``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptSetupActionAssertRulesetRule`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "ruleId", "param"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionAssertRulesetRule`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("ruleId", "ruleId__ext")] return required_fields class TestScriptSetupActionAssertRulesetRuleParam(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Rule parameter template. Each rule template can take one or more parameters for rule evaluation. """ __resource_type__ = "TestScriptSetupActionAssertRulesetRuleParam" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Parameter name matching external assert ruleset rule parameter", description=( "Descriptive name for this parameter that matches the external assert " "ruleset rule parameter name." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="Parameter value defined either explicitly or dynamically", description=( "The value for the parameter that will be passed on to the external " "ruleset rule template." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptSetupActionAssertRulesetRuleParam`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionAssertRulesetRuleParam`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext"), ("value", "value__ext")] return required_fields class TestScriptSetupActionOperation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The setup operation to perform. The operation to perform. """ __resource_type__ = "TestScriptSetupActionOperation" accept: fhirtypes.CodeType | None = Field( default=None, alias="accept", title="xml | json | ttl | none", description=( "The content-type or mime-type to use for RESTful operation in the " "'Accept' header." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["xml", "json", "ttl", "none"], }, ) accept__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_accept", title="Extension field for ``accept``." ) contentType: fhirtypes.CodeType | None = Field( default=None, alias="contentType", title="xml | json | ttl | none", description=( "The content-type or mime-type to use for RESTful operation in the " "'Content-Type' header." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["xml", "json", "ttl", "none"], }, ) contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contentType", title="Extension field for ``contentType``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Tracking/reporting operation description", description=( "The description would be used by test engines for tracking and " "reporting purposes." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) destination: fhirtypes.IntegerType | None = Field( default=None, alias="destination", title="Server responding to the request", description=( "The server where the request message is destined for. Must be one of " "the server numbers listed in TestScript.destination section." ), json_schema_extra={ "element_property": True, }, ) destination__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_destination", title="Extension field for ``destination``." ) encodeRequestUrl: bool | None = Field( default=None, alias="encodeRequestUrl", title="Whether or not to send the request url in encoded format", description=( "Whether or not to implicitly send the request url in encoded format. " "The default is true to match the standard RESTful client behavior. Set" " to false when communicating with a server that does not support " "encoded url paths." ), json_schema_extra={ "element_property": True, }, ) encodeRequestUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_encodeRequestUrl", title="Extension field for ``encodeRequestUrl``.", ) label: fhirtypes.StringType | None = Field( default=None, alias="label", title="Tracking/logging operation label", description="The label would be used for tracking/logging purposes by test engines.", json_schema_extra={ "element_property": True, }, ) label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_label", title="Extension field for ``label``." ) origin: fhirtypes.IntegerType | None = Field( default=None, alias="origin", title="Server initiating the request", description=( "The server where the request message originates from. Must be one of " "the server numbers listed in TestScript.origin section." ), json_schema_extra={ "element_property": True, }, ) origin__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_origin", title="Extension field for ``origin``." ) params: fhirtypes.StringType | None = Field( default=None, alias="params", title="Explicitly defined path parameters", description=( "Path plus parameters after [type]. Used to set parts of the request " "URL explicitly." ), json_schema_extra={ "element_property": True, }, ) params__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_params", title="Extension field for ``params``." ) requestHeader: typing.List[ fhirtypes.TestScriptSetupActionOperationRequestHeaderType ] | None = Field( default=None, alias="requestHeader", title="Each operation can have one or more header elements", description="Header elements would be used to set HTTP headers.", json_schema_extra={ "element_property": True, }, ) requestId: fhirtypes.IdType | None = Field( default=None, alias="requestId", title="Fixture Id of mapped request", description="The fixture id (maybe new) to map to the request.", json_schema_extra={ "element_property": True, }, ) requestId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requestId", title="Extension field for ``requestId``." ) resource: fhirtypes.CodeType | None = Field( default=None, alias="resource", title="Resource type", description=( "The type of the resource. See " "http://hl7.org/fhir/STU3/resourcelist.html." ), json_schema_extra={ "element_property": True, }, ) resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resource", title="Extension field for ``resource``." ) responseId: fhirtypes.IdType | None = Field( default=None, alias="responseId", title="Fixture Id of mapped response", description="The fixture id (maybe new) to map to the response.", json_schema_extra={ "element_property": True, }, ) responseId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_responseId", title="Extension field for ``responseId``." ) sourceId: fhirtypes.IdType | None = Field( default=None, alias="sourceId", title="Fixture Id of body for PUT and POST requests", description="The id of the fixture used as the body of a PUT or POST request.", json_schema_extra={ "element_property": True, }, ) sourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceId", title="Extension field for ``sourceId``." ) targetId: fhirtypes.IdType | None = Field( default=None, alias="targetId", title=( "Id of fixture used for extracting the [id], [type], and [vid] for GET" " requests" ), description=None, json_schema_extra={ "element_property": True, }, ) targetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_targetId", title="Extension field for ``targetId``." ) type: fhirtypes.CodingType | None = Field( default=None, alias="type", title="The operation code type that will be executed", description="Server interaction or operation type.", json_schema_extra={ "element_property": True, }, ) url: fhirtypes.StringType | None = Field( default=None, alias="url", title="Request URL", description="Complete request URL.", json_schema_extra={ "element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptSetupActionOperation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "resource", "label", "description", "accept", "contentType", "destination", "encodeRequestUrl", "origin", "params", "requestHeader", "requestId", "responseId", "sourceId", "targetId", "url", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionOperation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptSetupActionOperationRequestHeader(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Each operation can have one or more header elements. Header elements would be used to set HTTP headers. """ __resource_type__ = "TestScriptSetupActionOperationRequestHeader" field: fhirtypes.StringType | None = Field( default=None, alias="field", title="HTTP header field name", description='The HTTP header field e.g. "Accept".', json_schema_extra={ "element_property": True, "element_required": True, }, ) field__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_field", title="Extension field for ``field``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="HTTP headerfield value", description='The value of the header e.g. "application/fhir+xml".', json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptSetupActionOperationRequestHeader`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "field", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionOperationRequestHeader`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("field", "field__ext"), ("value", "value__ext")] return required_fields class TestScriptTeardown(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A series of required clean up steps. A series of operations required to clean up after the all the tests are executed (successfully or otherwise). """ __resource_type__ = "TestScriptTeardown" action: typing.List[fhirtypes.TestScriptTeardownActionType] = Field( default=..., alias="action", title="One or more teardown operations to perform", description="The teardown action will only contain an operation.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptTeardown`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "action"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptTeardown`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptTeardownAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. One or more teardown operations to perform. The teardown action will only contain an operation. """ __resource_type__ = "TestScriptTeardownAction" operation: fhirtypes.TestScriptSetupActionOperationType = Field( default=..., alias="operation", title="The teardown operation to perform", description="An operation would involve a REST request to a server.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptTeardownAction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "operation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptTeardownAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptTest(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A test in this script. """ __resource_type__ = "TestScriptTest" action: typing.List[fhirtypes.TestScriptTestActionType] = Field( default=..., alias="action", title="A test operation or assert to perform", description="Action would contain either an operation or an assertion.", json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Tracking/reporting short description of the test", description=( "A short description of the test used by test engines for tracking and " "reporting purposes." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Tracking/logging name of this test", description=( "The name of this test used for tracking/logging purposes by test " "engines." ), json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptTest`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "description", "action"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptTest`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptTestAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A test operation or assert to perform. Action would contain either an operation or an assertion. """ __resource_type__ = "TestScriptTestAction" assert_fhir: fhirtypes.TestScriptSetupActionAssertType | None = Field( default=None, alias="assert", title="The setup assertion to perform", description=( "Evaluates the results of previous operations to determine if the " "server under test behaves appropriately." ), json_schema_extra={ "element_property": True, }, ) operation: fhirtypes.TestScriptSetupActionOperationType | None = Field( default=None, alias="operation", title="The setup operation to perform", description="An operation would involve a REST request to a server.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptTestAction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "operation", "assert"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptTestAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptVariable(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Placeholder for evaluated elements. Variable is set based either on element value in response body or on header field value in the response headers. """ __resource_type__ = "TestScriptVariable" defaultValue: fhirtypes.StringType | None = Field( default=None, alias="defaultValue", title="Default, hard-coded, or user-defined value for this variable", description="A default, hard-coded, or user-defined value for this variable.", json_schema_extra={ "element_property": True, }, ) defaultValue__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValue", title="Extension field for ``defaultValue``.", ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Natural language description of the variable", description=( "A free text natural language description of the variable and its " "purpose." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="The fluentpath expression against the fixture body", description=( "The fluentpath expression to evaluate against the fixture body. When " "variables are defined, only one of either expression, headerField or " "path must be specified." ), json_schema_extra={ "element_property": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) headerField: fhirtypes.StringType | None = Field( default=None, alias="headerField", title="HTTP header field name for source", description=( "Will be used to grab the HTTP header field value from the headers that" " sourceId is pointing to." ), json_schema_extra={ "element_property": True, }, ) headerField__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_headerField", title="Extension field for ``headerField``." ) hint: fhirtypes.StringType | None = Field( default=None, alias="hint", title="Hint help text for default value to enter", description=( "Displayable text string with hint help information to the user when " "entering a default value." ), json_schema_extra={ "element_property": True, }, ) hint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_hint", title="Extension field for ``hint``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Descriptive name for this variable", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="XPath or JSONPath against the fixture body", description=( "XPath or JSONPath to evaluate against the fixture body. When " "variables are defined, only one of either expression, headerField or " "path must be specified." ), json_schema_extra={ "element_property": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) sourceId: fhirtypes.IdType | None = Field( default=None, alias="sourceId", title="Fixture Id of source expression or headerField within this variable", description=( "Fixture to evaluate the XPath/JSONPath expression or the headerField " "against within this variable." ), json_schema_extra={ "element_property": True, }, ) sourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceId", title="Extension field for ``sourceId``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptVariable`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "defaultValue", "description", "expression", "headerField", "hint", "path", "sourceId", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptVariable`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields ================================================ FILE: fhir/resources/STU3/timing.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Timing Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class Timing(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A timing schedule that specifies an event that may occur multiple times. Specifies an event that may occur multiple times. Timing schedules are used to record when things are planned, expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds, and may be used for reporting the schedule to which past regular activities were carried out. """ __resource_type__ = "Timing" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="BID | TID | QID | AM | PM | QD | QOD | Q4H | Q6H +", description=( "A code for the timing schedule. Some codes such as BID are ubiquitous," " but many institutions define their own additional codes. If a code is" " provided, the code is understood to be a complete statement of " "whatever is specified in the structured timing data, and either the " "code or the data may be used to interpret the Timing, with the " "exception that .repeat.bounds still applies over the code (and is not " "contained in the code)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) event: typing.List[fhirtypes.DateTimeType | None] | None = Field( default=None, alias="event", title="When the event occurs", description="Identifies specific times when the event occurs.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) event__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_event", title="Extension field for ``event``." ) repeat: fhirtypes.TimingRepeatType | None = Field( default=None, alias="repeat", title="When the event is to occur", description="A set of rules that describe when the event is scheduled.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Timing`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "event", "repeat", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Timing`` according to specification, with preserving the original sequence order. """ return ["event", "repeat", "code"] class TimingRepeat(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. When the event is to occur. A set of rules that describe when the event is scheduled. """ __resource_type__ = "TimingRepeat" boundsDuration: fhirtypes.DurationType | None = Field( default=None, alias="boundsDuration", title="Length/Range of lengths, or (Start and/or end) limits", description=( "Either a duration for the length of the timing schedule, a range of " "possible length, or outer bounds for start and/or end limits of the " "timing schedule." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e bounds[x] "one_of_many": "bounds", "one_of_many_required": False, }, ) boundsPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="boundsPeriod", title="Length/Range of lengths, or (Start and/or end) limits", description=( "Either a duration for the length of the timing schedule, a range of " "possible length, or outer bounds for start and/or end limits of the " "timing schedule." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e bounds[x] "one_of_many": "bounds", "one_of_many_required": False, }, ) boundsRange: fhirtypes.RangeType | None = Field( default=None, alias="boundsRange", title="Length/Range of lengths, or (Start and/or end) limits", description=( "Either a duration for the length of the timing schedule, a range of " "possible length, or outer bounds for start and/or end limits of the " "timing schedule." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e bounds[x] "one_of_many": "bounds", "one_of_many_required": False, }, ) count: fhirtypes.IntegerType | None = Field( default=None, alias="count", title="Number of times to repeat", description="A total count of the desired number of repetitions.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_count", title="Extension field for ``count``." ) countMax: fhirtypes.IntegerType | None = Field( default=None, alias="countMax", title="Maximum number of times to repeat", description=( "A maximum value for the count of the desired repetitions (e.g. do " "something 6-8 times)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) countMax__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_countMax", title="Extension field for ``countMax``." ) dayOfWeek: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="dayOfWeek", title="mon | tue | wed | thu | fri | sat | sun", description=( "If one or more days of week is provided, then the action happens only " "on the specified day(s)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], }, ) dayOfWeek__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_dayOfWeek", title="Extension field for ``dayOfWeek``." ) duration: fhirtypes.DecimalType | None = Field( default=None, alias="duration", title="How long when it happens", description="How long this thing happens for when it happens.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) duration__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_duration", title="Extension field for ``duration``." ) durationMax: fhirtypes.DecimalType | None = Field( default=None, alias="durationMax", title="How long when it happens (Max)", description="The upper limit of how long this thing happens for when it happens.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) durationMax__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_durationMax", title="Extension field for ``durationMax``." ) durationUnit: fhirtypes.CodeType | None = Field( default=None, alias="durationUnit", title="s | min | h | d | wk | mo | a - unit of time (UCUM)", description="The units of time for the duration, in UCUM units.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["s", "min", "h", "d", "wk", "mo", "a"], }, ) durationUnit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_durationUnit", title="Extension field for ``durationUnit``.", ) frequency: fhirtypes.IntegerType | None = Field( default=None, alias="frequency", title="Event occurs frequency times per period", description=( "The number of times to repeat the action within the specified period /" " period range (i.e. both period and periodMax provided)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) frequency__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_frequency", title="Extension field for ``frequency``." ) frequencyMax: fhirtypes.IntegerType | None = Field( default=None, alias="frequencyMax", title="Event occurs up to frequencyMax times per period", description=( "If present, indicates that the frequency is a range - so to repeat " "between [frequency] and [frequencyMax] times within the period or " "period range." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) frequencyMax__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_frequencyMax", title="Extension field for ``frequencyMax``.", ) offset: fhirtypes.UnsignedIntType | None = Field( default=None, alias="offset", title="Minutes from event (before or after)", description=( "The number of minutes from the event. If the event code does not " "indicate whether the minutes is before or after the event, then the " "offset is assumed to be after the event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) offset__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_offset", title="Extension field for ``offset``." ) period: fhirtypes.DecimalType | None = Field( default=None, alias="period", title="Event occurs frequency times per period", description=( "Indicates the duration of time over which repetitions are to occur; " 'e.g. to express "3 times per day", 3 would be the frequency and "1 ' 'day" would be the period.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) period__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_period", title="Extension field for ``period``." ) periodMax: fhirtypes.DecimalType | None = Field( default=None, alias="periodMax", title="Upper limit of period (3-4 hours)", description=( "If present, indicates that the period is a range from [period] to " '[periodMax], allowing expressing concepts such as "do this once every ' "3-5 days." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) periodMax__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_periodMax", title="Extension field for ``periodMax``." ) periodUnit: fhirtypes.CodeType | None = Field( default=None, alias="periodUnit", title="s | min | h | d | wk | mo | a - unit of time (UCUM)", description="The units of time for the period in UCUM units.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["s", "min", "h", "d", "wk", "mo", "a"], }, ) periodUnit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_periodUnit", title="Extension field for ``periodUnit``." ) timeOfDay: typing.List[fhirtypes.TimeType | None] | None = Field( default=None, alias="timeOfDay", title="Time of day for action", description="Specified time of day for action to take place.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) timeOfDay__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_timeOfDay", title="Extension field for ``timeOfDay``." ) when: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="when", title="Regular life events the event is tied to", description="Real world events that the occurrence of the event should be tied to.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) when__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_when", title="Extension field for ``when``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TimingRepeat`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "boundsDuration", "boundsRange", "boundsPeriod", "count", "countMax", "duration", "durationMax", "durationUnit", "frequency", "frequencyMax", "period", "periodMax", "periodUnit", "dayOfWeek", "timeOfDay", "when", "offset", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TimingRepeat`` according to specification, with preserving the original sequence order. """ return [ "boundsDuration", "boundsRange", "boundsPeriod", "count", "countMax", "duration", "durationMax", "durationUnit", "frequency", "frequencyMax", "period", "periodMax", "periodUnit", "dayOfWeek", "timeOfDay", "when", "offset", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "bounds": ["boundsDuration", "boundsPeriod", "boundsRange"] } return one_of_many_fields ================================================ FILE: fhir/resources/STU3/triggerdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/TriggerDefinition Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class TriggerDefinition(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Defines an expected trigger for a module. A description of a triggering event. """ __resource_type__ = "TriggerDefinition" eventData: fhirtypes.DataRequirementType | None = Field( default=None, alias="eventData", title="Triggering data of the event", description="The triggering data of the event (if this is a data trigger).", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) eventName: fhirtypes.StringType | None = Field( default=None, alias="eventName", title="Triggering event name", description="The name of the event (if this is a named-event trigger).", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) eventName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_eventName", title="Extension field for ``eventName``." ) eventTimingDate: fhirtypes.DateType | None = Field( default=None, alias="eventTimingDate", title="Timing of the event", description="The timing of the event (if this is a period trigger).", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e eventTiming[x] "one_of_many": "eventTiming", "one_of_many_required": False, }, ) eventTimingDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_eventTimingDate", title="Extension field for ``eventTimingDate``.", ) eventTimingDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="eventTimingDateTime", title="Timing of the event", description="The timing of the event (if this is a period trigger).", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e eventTiming[x] "one_of_many": "eventTiming", "one_of_many_required": False, }, ) eventTimingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_eventTimingDateTime", title="Extension field for ``eventTimingDateTime``.", ) eventTimingReference: fhirtypes.ReferenceType | None = Field( default=None, alias="eventTimingReference", title="Timing of the event", description="The timing of the event (if this is a period trigger).", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e eventTiming[x] "one_of_many": "eventTiming", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Schedule"], }, ) eventTimingTiming: fhirtypes.TimingType | None = Field( default=None, alias="eventTimingTiming", title="Timing of the event", description="The timing of the event (if this is a period trigger).", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e eventTiming[x] "one_of_many": "eventTiming", "one_of_many_required": False, }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "named-event | periodic | data-added | data-modified | data-removed | " "data-accessed | data-access-ended" ), description="The type of triggering event.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "named-event", "periodic", "data-added", "data-modified", "data-removed", "data-accessed", "data-access-ended", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TriggerDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "type", "eventName", "eventTimingTiming", "eventTimingReference", "eventTimingDate", "eventTimingDateTime", "eventData", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TriggerDefinition`` according to specification, with preserving the original sequence order. """ return [ "type", "eventName", "eventTimingTiming", "eventTimingReference", "eventTimingDate", "eventTimingDateTime", "eventData", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "eventTiming": [ "eventTimingDate", "eventTimingDateTime", "eventTimingReference", "eventTimingTiming", ] } return one_of_many_fields ================================================ FILE: fhir/resources/STU3/usagecontext.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/UsageContext Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class UsageContext(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Describes the context of use for a conformance or knowledge resource. Specifies clinical/business/etc metadata that can be used to retrieve, index and/or categorize an artifact. This metadata can either be specific to the applicable population (e.g., age category, DRG) or the specific context of care (e.g., venue, care setting, provider of care). """ __resource_type__ = "UsageContext" code: fhirtypes.CodingType = Field( default=..., alias="code", title="Type of context being specified", description=( "A code that identifies the type of context being specified by this " "usage context." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Value that defines the context", description=( "A value that defines the context specified in this context of use. The" " interpretation of the value is defined by the code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Value that defines the context", description=( "A value that defines the context specified in this context of use. The" " interpretation of the value is defined by the code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Value that defines the context", description=( "A value that defines the context specified in this context of use. The" " interpretation of the value is defined by the code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``UsageContext`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "code", "valueCodeableConcept", "valueQuantity", "valueRange", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``UsageContext`` according to specification, with preserving the original sequence order. """ return ["code", "valueCodeableConcept", "valueQuantity", "valueRange"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": ["valueCodeableConcept", "valueQuantity", "valueRange"] } return one_of_many_fields ================================================ FILE: fhir/resources/STU3/valueset.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ValueSet Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ValueSet(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A set of codes drawn from one or more code systems. A value set specifies a set of codes drawn from one or more code systems. """ __resource_type__ = "ValueSet" compose: fhirtypes.ValueSetComposeType | None = Field( default=None, alias="compose", title="Definition of the content of the value set (CLD)", description=( "A set of criteria that define the content logical definition of the " "value set by including or excluding codes from outside this value set." ' This I also known as the "Content Logical Definition" (CLD).' ), json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the value set and/or its contents. " "Copyright statements are generally legal restrictions on the use and " "publishing of the value set." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date this was last changed", description=( "The date (and optionally time) when the value set was published. The " "date must change if and when the business version changes and it must " "change if the status code changes. In addition, it should change when " "the substantive content of the value set changes. (e.g. the 'content " "logical definition')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the value set", description=( "A free text natural language description of the value set from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) expansion: fhirtypes.ValueSetExpansionType | None = Field( default=None, alias="expansion", title='Used when the value set is "expanded"', description=( 'A value set can also be "expanded", where the value set is turned into' " a simple collection of enumerated codes. This element holds the " "expansion, if it has been performed." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A boolean value to indicate that this value set is authored for " "testing purposes (or education/evaluation/marketing), and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) extensible: bool | None = Field( default=None, alias="extensible", title="Whether this is intended to be used with an extensible binding", description="Whether this is intended to be used with an extensible binding or not.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) extensible__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_extensible", title="Extension field for ``extensible``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the value set", description=( "A formal identifier that is used to identify this value set when it is" " represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) immutable: bool | None = Field( default=None, alias="immutable", title=( "Indicates whether or not any change to the content logical definition " "may occur" ), description=( "If this is set to 'true', then no new versions of the content logical " "definition can be created. Note: Other metadata might still change." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) immutable__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_immutable", title="Extension field for ``immutable``." ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for value set (if applicable)", description=( "A legal or geographic region in which the value set is intended to be " "used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this value set (computer friendly)", description=( "A natural language name identifying the value set. This name should be" " usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher (organization or individual)", description=( "The name of the individual or organization that published the value " "set." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this value set is defined", description=( "Explaination of why this value set is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this value set. Enables tracking the life-cycle of the " "content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this value set (human friendly)", description="A short, descriptive, user-friendly title for the value set.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Logical URI to reference this value set (globally unique)", description=( "An absolute URI that is used to identify this value set when it is " "referenced in a specification, model, design or an instance. This " "SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at" " which this value set is (or will be) published. The URL SHOULD " "include the major version of the value set. For more information see " "[Technical and Business Versions](resource.html#versions)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Context the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching for appropriate value set instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the value set", description=( "The identifier that is used to identify this version of the value set " "when it is referenced in a specification, model, design or instance. " "This is an arbitrary value managed by the value set author and is not " "expected to be globally unique. For example, it might be a timestamp " "(e.g. yyyymmdd) if a managed version is not available. There is also " "no expectation that versions can be placed in a lexicographical " "sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSet`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "immutable", "purpose", "copyright", "extensible", "compose", "expansion", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSet`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "immutable", "extensible", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class ValueSetCompose(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of the content of the value set (CLD). A set of criteria that define the content logical definition of the value set by including or excluding codes from outside this value set. This I also known as the "Content Logical Definition" (CLD). """ __resource_type__ = "ValueSetCompose" exclude: typing.List[fhirtypes.ValueSetComposeIncludeType] | None = Field( default=None, alias="exclude", title="Explicitly exclude codes from a code system or other value sets", description=( "Exclude one or more codes from the value set based on code system " "filters and/or other value sets." ), json_schema_extra={ "element_property": True, }, ) inactive: bool | None = Field( default=None, alias="inactive", title="Whether inactive codes are in the value set", description=( "Whether inactive codes - codes that are not approved for current use -" " are in the value set. If inactive = true, inactive codes are to be " "included in the expansion, if inactive = false, the inactive codes " "will not be included in the expansion. If absent, the behavior is " "determined by the implementation, or by the applicable " "ExpansionProfile (but generally, inactive codes would be expected to " "be included)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) inactive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_inactive", title="Extension field for ``inactive``." ) include: typing.List[fhirtypes.ValueSetComposeIncludeType] = Field( default=..., alias="include", title="Include one or more codes from a code system or other value set(s)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lockedDate: fhirtypes.DateType | None = Field( default=None, alias="lockedDate", title="Fixed date for version-less references (transitive)", description=( "If a locked date is defined, then the Content Logical Definition must " "be evaluated using the current version as of the locked date for " "referenced code system(s) and value set instances where " "ValueSet.compose.include.version is not defined." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lockedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lockedDate", title="Extension field for ``lockedDate``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetCompose`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "lockedDate", "inactive", "include", "exclude", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetCompose`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "lockedDate", "inactive", "include"] class ValueSetComposeInclude(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Include one or more codes from a code system or other value set(s). """ __resource_type__ = "ValueSetComposeInclude" concept: typing.List[fhirtypes.ValueSetComposeIncludeConceptType] | None = Field( default=None, alias="concept", title="A concept defined in the system", description="Specifies a concept to be included or excluded.", json_schema_extra={ "element_property": True, }, ) filter: typing.List[fhirtypes.ValueSetComposeIncludeFilterType] | None = Field( default=None, alias="filter", title="Select codes/concepts by their properties (including relationships)", description=( "Select concepts by specify a matching criteria based on the properties" " (including relationships) defined by the system. If multiple filters " "are specified, they SHALL all be true." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) system: fhirtypes.UriType | None = Field( default=None, alias="system", title="The system the codes come from", description=( "An absolute URI which is the code system from which the selected codes" " come from." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) valueSet: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="valueSet", title="Select only contents included in this value set", description=( "Selects concepts found in this value set. This is an absolute URI that" " is a reference to ValueSet.url." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueSet__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_valueSet", title="Extension field for ``valueSet``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Specific version of the code system referred to", description="The version of the code system that the codes are selected from.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetComposeInclude`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "system", "version", "concept", "filter", "valueSet", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetComposeInclude`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "system", "version", "filter", "valueSet"] class ValueSetComposeIncludeConcept(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A concept defined in the system. Specifies a concept to be included or excluded. """ __resource_type__ = "ValueSetComposeIncludeConcept" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Code or expression from system", description="Specifies a code for the concept to be included or excluded.", json_schema_extra={ "element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) designation: typing.List[ fhirtypes.ValueSetComposeIncludeConceptDesignationType ] | None = Field( default=None, alias="designation", title="Additional representations for this concept", description=( "Additional representations for this concept when used in this value " "set - other languages, aliases, specialized purposes, used for " "particular purposes, etc." ), json_schema_extra={ "element_property": True, }, ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Text to display for this code for this value set in this valueset", description=( "The text to display to the user for this concept in the context of " "this valueset. If no display is provided, then applications using the " "value set use the display specified for the code by the system." ), json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetComposeIncludeConcept`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "display", "designation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetComposeIncludeConcept`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields class ValueSetComposeIncludeConceptDesignation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional representations for this concept. Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc. """ __resource_type__ = "ValueSetComposeIncludeConceptDesignation" language: fhirtypes.CodeType | None = Field( default=None, alias="language", title="Human language of the designation", description="The language this designation is defined for.", json_schema_extra={ "element_property": True, }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) use: fhirtypes.CodingType | None = Field( default=None, alias="use", title="Details how this designation would be used", description="A code that details how this designation would be used.", json_schema_extra={ "element_property": True, }, ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The text value for this designation", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetComposeIncludeConceptDesignation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "language", "use", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetComposeIncludeConceptDesignation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("value", "value__ext")] return required_fields class ValueSetComposeIncludeFilter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Select codes/concepts by their properties (including relationships). Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true. """ __resource_type__ = "ValueSetComposeIncludeFilter" op: fhirtypes.CodeType | None = Field( default=None, alias="op", title=( "= | is-a | descendent-of | is-not-a | regex | in | not-in | " "generalizes | exists" ), description="The kind of operation to perform as a part of the filter criteria.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "=", "is-a", "descendent-of", "is-not-a", "regex", "in", "not-in", "generalizes", "exists", ], }, ) op__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_op", title="Extension field for ``op``." ) property: fhirtypes.CodeType | None = Field( default=None, alias="property", title="A property defined by the code system", description="A code that identifies a property defined in the code system.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) property__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_property", title="Extension field for ``property``." ) value: fhirtypes.CodeType | None = Field( default=None, alias="value", title="Code from the system, or regex criteria, or boolean value for exists", description=( "The match value may be either a code defined by the system, or a " "string value, which is a regex match on the literal string of the " "property value when the operation is 'regex', or one of the values " "(true and false), when the operation is 'exists'." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetComposeIncludeFilter`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "property", "op", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetComposeIncludeFilter`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "property", "op", "value"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("op", "op__ext"), ("property", "property__ext"), ("value", "value__ext"), ] return required_fields class ValueSetExpansion(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Used when the value set is "expanded". A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed. """ __resource_type__ = "ValueSetExpansion" contains: typing.List[fhirtypes.ValueSetExpansionContainsType] | None = Field( default=None, alias="contains", title="Codes in the value set", description="The codes that are contained in the value set expansion.", json_schema_extra={ "element_property": True, }, ) identifier: fhirtypes.UriType | None = Field( default=None, alias="identifier", title="Uniquely identifies this expansion", description=( "An identifier that uniquely identifies this expansion of the valueset." " Systems may re-use the same identifier as long as the expansion and " "the definition remain the same, but are not required to do so." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) identifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_identifier", title="Extension field for ``identifier``." ) offset: fhirtypes.IntegerType | None = Field( default=None, alias="offset", title="Offset at which this resource starts", description=( "If paging is being used, the offset at which this resource starts. " "I.e. this resource is a partial view into the expansion. If paging is " "not being used, this element SHALL not be present." ), json_schema_extra={ "element_property": True, }, ) offset__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_offset", title="Extension field for ``offset``." ) parameter: typing.List[fhirtypes.ValueSetExpansionParameterType] | None = Field( default=None, alias="parameter", title="Parameter that controlled the expansion process", description=( "A parameter that controlled the expansion process. These parameters " "may be used by users of expanded value sets to check whether the " "expansion is suitable for a particular purpose, or to pick the correct" " expansion." ), json_schema_extra={ "element_property": True, }, ) timestamp: fhirtypes.DateTimeType | None = Field( default=None, alias="timestamp", title="Time ValueSet expansion happened", description="The time at which the expansion was produced by the expanding system.", json_schema_extra={ "element_property": True, "element_required": True, }, ) timestamp__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timestamp", title="Extension field for ``timestamp``." ) total: fhirtypes.IntegerType | None = Field( default=None, alias="total", title="Total number of codes in the expansion", description=( "The total number of concepts in the expansion. If the number of " "concept nodes in this resource is less than the stated number, then " "the server can return more using the offset parameter." ), json_schema_extra={ "element_property": True, }, ) total__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_total", title="Extension field for ``total``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetExpansion`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "timestamp", "total", "offset", "parameter", "contains", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetExpansion`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("identifier", "identifier__ext"), ("timestamp", "timestamp__ext"), ] return required_fields class ValueSetExpansionContains(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Codes in the value set. The codes that are contained in the value set expansion. """ __resource_type__ = "ValueSetExpansionContains" abstract: bool | None = Field( default=None, alias="abstract", title="If user cannot select this entry", description=( "If true, this entry is included in the expansion for navigational " "purposes, and the user cannot select the code directly as a proper " "value." ), json_schema_extra={ "element_property": True, }, ) abstract__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_abstract", title="Extension field for ``abstract``." ) code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Code - if blank, this is not a selectable code", description=( "The code for this item in the expansion hierarchy. If this code is " "missing the entry in the hierarchy is a place holder (abstract) and " "does not represent a valid code in the value set." ), json_schema_extra={ "element_property": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) contains: typing.List[fhirtypes.ValueSetExpansionContainsType] | None = Field( default=None, alias="contains", title="Codes contained under this entry", description="Other codes and entries contained under this entry in the hierarchy.", json_schema_extra={ "element_property": True, }, ) designation: typing.List[ fhirtypes.ValueSetComposeIncludeConceptDesignationType ] | None = Field( default=None, alias="designation", title="Additional representations for this item", description=( "Additional representations for this item - other languages, aliases, " "specialized purposes, used for particular purposes, etc. These are " "relevant when the conditions of the expansion do not fix to a single " "correct representation." ), json_schema_extra={ "element_property": True, }, ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="User display for the concept", description="The recommended display for this item in the expansion.", json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) inactive: bool | None = Field( default=None, alias="inactive", title="If concept is inactive in the code system", description=( "If the concept is inactive in the code system that defines it. " "Inactive codes are those that are no longer to be used, but are " "maintained by the code system for understanding legacy data." ), json_schema_extra={ "element_property": True, }, ) inactive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_inactive", title="Extension field for ``inactive``." ) system: fhirtypes.UriType | None = Field( default=None, alias="system", title="System value for the code", description=( "An absolute URI which is the code system in which the code for this " "item in the expansion is defined." ), json_schema_extra={ "element_property": True, }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Version in which this code/display is defined", description=( "The version of this code system that defined this code and/or display." " This should only be used with code systems that do not enforce " "concept permanence." ), json_schema_extra={ "element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetExpansionContains`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "system", "abstract", "inactive", "version", "code", "display", "designation", "contains", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetExpansionContains`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ValueSetExpansionParameter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Parameter that controlled the expansion process. A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion. """ __resource_type__ = "ValueSetExpansionParameter" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name as assigned by the server", description="The name of the parameter.", json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value of the named parameter", description="The value of the parameter.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="Value of the named parameter", description="The value of the parameter.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Value of the named parameter", description="The value of the parameter.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Value of the named parameter", description="The value of the parameter.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Value of the named parameter", description="The value of the parameter.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="Value of the named parameter", description="The value of the parameter.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetExpansionParameter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "valueString", "valueBoolean", "valueInteger", "valueDecimal", "valueUri", "valueCode", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetExpansionParameter`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueCode", "valueDecimal", "valueInteger", "valueString", "valueUri", ] } return one_of_many_fields ================================================ FILE: fhir/resources/STU3/visionprescription.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/VisionPrescription Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class VisionPrescription(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Prescription for vision correction products for a patient. An authorization for the supply of glasses and/or contact lenses to a patient. """ __resource_type__ = "VisionPrescription" dateWritten: fhirtypes.DateTimeType | None = Field( default=None, alias="dateWritten", title="When prescription was authorized", description="The date (and perhaps time) when the prescription was written.", json_schema_extra={ "element_property": True, }, ) dateWritten__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dateWritten", title="Extension field for ``dateWritten``." ) dispense: typing.List[fhirtypes.VisionPrescriptionDispenseType] | None = Field( default=None, alias="dispense", title="Vision supply authorization", description="Deals with details of the dispense part of the supply specification.", json_schema_extra={ "element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Created during encounter / admission / stay", description=( "A link to a resource that identifies the particular occurrence of " "contact between patient and health care provider." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description=( "Business identifier which may be used by other parties to reference or" " identify the prescription." ), json_schema_extra={ "element_property": True, }, ) patient: fhirtypes.ReferenceType | None = Field( default=None, alias="patient", title="Who prescription is for", description=( "A link to a resource representing the person to whom the vision " "products will be supplied." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) prescriber: fhirtypes.ReferenceType | None = Field( default=None, alias="prescriber", title="Who authorizes the vision product", description=( "The healthcare professional responsible for authorizing the " "prescription." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) reasonCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reasonCodeableConcept", title="Reason or indication for writing the prescription", description="Can be the reason or the indication for writing the prescription.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e reason[x] "one_of_many": "reason", "one_of_many_required": False, }, ) reasonReference: fhirtypes.ReferenceType | None = Field( default=None, alias="reasonReference", title="Reason or indication for writing the prescription", description="Can be the reason or the indication for writing the prescription.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e reason[x] "one_of_many": "reason", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``VisionPrescription`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "patient", "encounter", "dateWritten", "prescriber", "reasonCodeableConcept", "reasonReference", "dispense", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``VisionPrescription`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "status"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"reason": ["reasonCodeableConcept", "reasonReference"]} return one_of_many_fields class VisionPrescriptionDispense(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Vision supply authorization. Deals with details of the dispense part of the supply specification. """ __resource_type__ = "VisionPrescriptionDispense" add: fhirtypes.DecimalType | None = Field( default=None, alias="add", title="Lens add", description=( "Power adjustment for multifocal lenses measured in diopters (0.25 " "units)." ), json_schema_extra={ "element_property": True, }, ) add__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_add", title="Extension field for ``add``." ) axis: fhirtypes.IntegerType | None = Field( default=None, alias="axis", title="Lens axis", description="Adjustment for astigmatism measured in integer degrees.", json_schema_extra={ "element_property": True, }, ) axis__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_axis", title="Extension field for ``axis``." ) backCurve: fhirtypes.DecimalType | None = Field( default=None, alias="backCurve", title="Contact lens back curvature", description="Back curvature measured in millimeters.", json_schema_extra={ "element_property": True, }, ) backCurve__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_backCurve", title="Extension field for ``backCurve``." ) base: fhirtypes.CodeType | None = Field( default=None, alias="base", title="up | down | in | out", description="The relative base, or reference lens edge, for the prism.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["up", "down", "in", "out"], }, ) base__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_base", title="Extension field for ``base``." ) brand: fhirtypes.StringType | None = Field( default=None, alias="brand", title="Brand required", description="Brand recommendations or restrictions.", json_schema_extra={ "element_property": True, }, ) brand__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_brand", title="Extension field for ``brand``." ) color: fhirtypes.StringType | None = Field( default=None, alias="color", title="Color required", description="Special color or pattern.", json_schema_extra={ "element_property": True, }, ) color__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_color", title="Extension field for ``color``." ) cylinder: fhirtypes.DecimalType | None = Field( default=None, alias="cylinder", title="Lens cylinder", description="Power adjustment for astigmatism measured in diopters (0.25 units).", json_schema_extra={ "element_property": True, }, ) cylinder__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_cylinder", title="Extension field for ``cylinder``." ) diameter: fhirtypes.DecimalType | None = Field( default=None, alias="diameter", title="Contact lens diameter", description="Contact lens diameter measured in millimeters.", json_schema_extra={ "element_property": True, }, ) diameter__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_diameter", title="Extension field for ``diameter``." ) duration: fhirtypes.QuantityType | None = Field( default=None, alias="duration", title="Lens wear duration", description="The recommended maximum wear period for the lens.", json_schema_extra={ "element_property": True, }, ) eye: fhirtypes.CodeType | None = Field( default=None, alias="eye", title="right | left", description="The eye for which the lens applies.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["right", "left"], }, ) eye__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_eye", title="Extension field for ``eye``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Notes for coatings", description="Notes for special requirements such as coatings and lens materials.", json_schema_extra={ "element_property": True, }, ) power: fhirtypes.DecimalType | None = Field( default=None, alias="power", title="Contact lens power", description="Contact lens power measured in diopters (0.25 units).", json_schema_extra={ "element_property": True, }, ) power__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_power", title="Extension field for ``power``." ) prism: fhirtypes.DecimalType | None = Field( default=None, alias="prism", title="Lens prism", description="Amount of prism to compensate for eye alignment in fractional units.", json_schema_extra={ "element_property": True, }, ) prism__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_prism", title="Extension field for ``prism``." ) product: fhirtypes.CodeableConceptType | None = Field( default=None, alias="product", title="Product to be supplied", description=( "Identifies the type of vision correction product which is required for" " the patient." ), json_schema_extra={ "element_property": True, }, ) sphere: fhirtypes.DecimalType | None = Field( default=None, alias="sphere", title="Lens sphere", description="Lens power measured in diopters (0.25 units).", json_schema_extra={ "element_property": True, }, ) sphere__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sphere", title="Extension field for ``sphere``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``VisionPrescriptionDispense`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "product", "eye", "sphere", "cylinder", "axis", "prism", "base", "add", "power", "backCurve", "diameter", "duration", "color", "brand", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``VisionPrescriptionDispense`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/__init__.py ================================================ from __future__ import annotations as _annotations from functools import lru_cache from typing import TYPE_CHECKING, cast if TYPE_CHECKING: from fhir_core.fhirabstractmodel import FHIRAbstractModel __author__ = "Md Nazrul Islam" __email__ = "email2nazrul@gmail.com" __version__ = "8.2.1" __fhir_version__ = "5.0.0" @lru_cache(maxsize=None, typed=True) def get_fhir_model_class(model_name: str) -> type[FHIRAbstractModel]: """ """ from . import fhirtypes as ft try: model_type = getattr(ft, model_name + "Type") if TYPE_CHECKING: from fhir_core.types import FhirBase model_type = cast("type[FhirBase]", model_type) return model_type.get_model_klass() except AttributeError: raise ValueError(f"{model_name} is not a valid FHIR Model") ================================================ FILE: fhir/resources/account.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Account Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Account(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Tracks balance, charges, for patient or cost center. A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centers, etc. """ __resource_type__ = "Account" balance: typing.List[fhirtypes.AccountBalanceType] | None = Field( default=None, alias="balance", title="Calculated account balance(s)", description=( "The calculated account balances - these are calculated and processed " "by the finance system. The balances with a `term` that is not current" " are usually generated/updated by an invoicing or similar process." ), json_schema_extra={ "element_property": True, }, ) billingStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="billingStatus", title="Tracks the lifecycle of the account through the billing process", description=( "The BillingStatus tracks the lifecycle of the account through the " "billing process. It indicates how transactions are treated when they " "are allocated to the account." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) calculatedAt: fhirtypes.InstantType | None = Field( default=None, alias="calculatedAt", title="Time the balance amount was calculated", description=None, json_schema_extra={ "element_property": True, }, ) calculatedAt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_calculatedAt", title="Extension field for ``calculatedAt``.", ) coverage: typing.List[fhirtypes.AccountCoverageType] | None = Field( default=None, alias="coverage", title=( "The party(s) that are responsible for covering the payment of this " "account, and what order should they be applied to the account" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) currency: fhirtypes.CodeableConceptType | None = Field( default=None, alias="currency", title="The base or default currency", description="The default currency for the account.", json_schema_extra={ "element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Explanation of purpose/use", description=( "Provides additional information about what the account tracks and how " "it is used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) diagnosis: typing.List[fhirtypes.AccountDiagnosisType] | None = Field( default=None, alias="diagnosis", title="The list of diagnoses relevant to this account", description=( "When using an account for billing a specific Encounter the set of " "diagnoses that are relevant for billing are stored here on the account" " where they are able to be sequenced appropriately prior to processing" " to produce claim(s)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) guarantor: typing.List[fhirtypes.AccountGuarantorType] | None = Field( default=None, alias="guarantor", title="The parties ultimately responsible for balancing the Account", description=( "The parties responsible for balancing the account if other payment " "options fall short." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Account number", description=( "Unique identifier used to reference the account. Might or might not " "be intended for human use (e.g. credit card number)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Human-readable label", description=( "Name used for the account when displaying it to humans in reports, " "etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) owner: fhirtypes.ReferenceType | None = Field( default=None, alias="owner", title="Entity managing the Account", description=( "Indicates the service area, hospital, department, etc. with " "responsibility for managing the Account." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) procedure: typing.List[fhirtypes.AccountProcedureType] | None = Field( default=None, alias="procedure", title="The list of procedures relevant to this account", description=( "When using an account for billing a specific Encounter the set of " "procedures that are relevant for billing are stored here on the " "account where they are able to be sequenced appropriately prior to " "processing to produce claim(s)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) relatedAccount: typing.List[fhirtypes.AccountRelatedAccountType] | None = Field( default=None, alias="relatedAccount", title="Other associated accounts related to this account", description=None, json_schema_extra={ "element_property": True, }, ) servicePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="servicePeriod", title="Transaction window", description="The date range of services associated with this account.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | inactive | entered-in-error | on-hold | unknown", description="Indicates whether the account is presently used/usable or not.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "active", "inactive", "entered-in-error", "on-hold", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="subject", title="The entity that caused the expenses", description=( "Identifies the entity which incurs the expenses. While the immediate " "recipients of services or goods might be entities related to the " "subject, the expenses were ultimately incurred by the subject of the " "Account." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Device", "Practitioner", "PractitionerRole", "Location", "HealthcareService", "Organization", ], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="E.g. patient, expense, depreciation", description="Categorizes the account for reporting and searching purposes.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Account`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "billingStatus", "type", "name", "subject", "servicePeriod", "coverage", "owner", "description", "guarantor", "diagnosis", "procedure", "relatedAccount", "currency", "balance", "calculatedAt", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Account`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "billingStatus", "type", "name", "subject", "servicePeriod", "coverage", "owner", "description", "diagnosis", "procedure", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class AccountBalance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Calculated account balance(s). The calculated account balances - these are calculated and processed by the finance system. The balances with a `term` that is not current are usually generated/updated by an invoicing or similar process. """ __resource_type__ = "AccountBalance" aggregate: fhirtypes.CodeableConceptType | None = Field( default=None, alias="aggregate", title="Who is expected to pay this part of the balance", description=None, json_schema_extra={ "element_property": True, }, ) amount: fhirtypes.MoneyType = Field( default=..., alias="amount", title="Calculated amount", description=( "The actual balance value calculated for the age defined in the term " "property." ), json_schema_extra={ "element_property": True, }, ) estimate: bool | None = Field( default=None, alias="estimate", title="Estimated balance", description=( "The amount is only an estimated value - this is likely common for " "`current` term balances, but not with known terms (that were generated" " by a backend process)." ), json_schema_extra={ "element_property": True, }, ) estimate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_estimate", title="Extension field for ``estimate``." ) term: fhirtypes.CodeableConceptType | None = Field( default=None, alias="term", title="current | 30 | 60 | 90 | 120", description=( "The term of the account balances - The balance value is the amount " "that was outstanding for this age." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AccountBalance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "aggregate", "term", "estimate", "amount", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AccountBalance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class AccountCoverage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The party(s) that are responsible for covering the payment of this account, and what order should they be applied to the account. """ __resource_type__ = "AccountCoverage" coverage: fhirtypes.ReferenceType = Field( default=..., alias="coverage", title=( "The party(s), such as insurances, that may contribute to the payment " "of this account" ), description=( "The party(s) that contribute to payment (or part of) of the charges " "applied to this account (including self-pay). A coverage may only be " "responsible for specific types of charges, and the sequence of the " "coverages in the account could be important when processing billing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage"], }, ) priority: fhirtypes.PositiveIntType | None = Field( default=None, alias="priority", title="The priority of the coverage in the context of this account", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AccountCoverage`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "coverage", "priority"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AccountCoverage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "coverage", "priority"] class AccountDiagnosis(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The list of diagnoses relevant to this account. When using an account for billing a specific Encounter the set of diagnoses that are relevant for billing are stored here on the account where they are able to be sequenced appropriately prior to processing to produce claim(s). """ __resource_type__ = "AccountDiagnosis" condition: fhirtypes.CodeableReferenceType = Field( default=..., alias="condition", title="The diagnosis relevant to the account", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) dateOfDiagnosis: fhirtypes.DateTimeType | None = Field( default=None, alias="dateOfDiagnosis", title="Date of the diagnosis (when coded diagnosis)", description="Ranking of the diagnosis (for each type).", json_schema_extra={ "element_property": True, }, ) dateOfDiagnosis__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dateOfDiagnosis", title="Extension field for ``dateOfDiagnosis``.", ) onAdmission: bool | None = Field( default=None, alias="onAdmission", title="Diagnosis present on Admission", description="Was the Diagnosis present on Admission in the related Encounter.", json_schema_extra={ "element_property": True, }, ) onAdmission__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onAdmission", title="Extension field for ``onAdmission``." ) packageCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="packageCode", title="Package Code specific for billing", description=( "The package code can be used to group diagnoses that may be priced or " "delivered as a single product. Such as DRGs." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Ranking of the diagnosis (for each type)", description=None, json_schema_extra={ "element_property": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title=( "Type that this diagnosis has relevant to the account (e.g. admission, " "billing, discharge \u2026)" ), description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AccountDiagnosis`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "condition", "dateOfDiagnosis", "type", "onAdmission", "packageCode", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AccountDiagnosis`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "condition"] class AccountGuarantor(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The parties ultimately responsible for balancing the Account. The parties responsible for balancing the account if other payment options fall short. """ __resource_type__ = "AccountGuarantor" onHold: bool | None = Field( default=None, alias="onHold", title="Credit or other hold applied", description=( "A guarantor may be placed on credit hold or otherwise have their role " "temporarily suspended." ), json_schema_extra={ "element_property": True, }, ) onHold__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onHold", title="Extension field for ``onHold``." ) party: fhirtypes.ReferenceType = Field( default=..., alias="party", title="Responsible entity", description="The entity who is responsible.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "RelatedPerson", "Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Guarantee account during", description=( "The timeframe during which the guarantor accepts responsibility for " "the account." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AccountGuarantor`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "party", "onHold", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AccountGuarantor`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class AccountProcedure(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The list of procedures relevant to this account. When using an account for billing a specific Encounter the set of procedures that are relevant for billing are stored here on the account where they are able to be sequenced appropriately prior to processing to produce claim(s). """ __resource_type__ = "AccountProcedure" code: fhirtypes.CodeableReferenceType = Field( default=..., alias="code", title="The procedure relevant to the account", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Procedure"], }, ) dateOfService: fhirtypes.DateTimeType | None = Field( default=None, alias="dateOfService", title="Date of the procedure (when coded procedure)", description=( "Date of the procedure when using a coded procedure. If using a " "reference to a procedure, then the date on the procedure should be " "used." ), json_schema_extra={ "element_property": True, }, ) dateOfService__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dateOfService", title="Extension field for ``dateOfService``.", ) device: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="device", title="Any devices that were associated with the procedure", description=( "Any devices that were associated with the procedure relevant to the " "account." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) packageCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="packageCode", title="Package Code specific for billing", description=( "The package code can be used to group procedures that may be priced or" " delivered as a single product. Such as DRGs." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Ranking of the procedure (for each type)", description=None, json_schema_extra={ "element_property": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="How this procedure value should be used in charging the account", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AccountProcedure`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "code", "dateOfService", "type", "packageCode", "device", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AccountProcedure`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "device"] class AccountRelatedAccount(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Other associated accounts related to this account. """ __resource_type__ = "AccountRelatedAccount" account: fhirtypes.ReferenceType = Field( default=..., alias="account", title="Reference to an associated Account", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Account"], }, ) relationship: fhirtypes.CodeableConceptType | None = Field( default=None, alias="relationship", title="Relationship of the associated Account", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AccountRelatedAccount`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "relationship", "account"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AccountRelatedAccount`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/activitydefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ActivityDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ActivityDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The definition of a specific activity to be taken, independent of any particular patient or context. This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context. """ __resource_type__ = "ActivityDefinition" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the activity definition was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) asNeededBoolean: bool | None = Field( default=None, alias="asNeededBoolean", title="Preconditions for service", description=( "If a CodeableConcept is present, it indicates the pre-condition for " 'performing the service. For example "pain", "on flare-up", etc.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e asNeeded[x] "one_of_many": "asNeeded", "one_of_many_required": False, }, ) asNeededBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_asNeededBoolean", title="Extension field for ``asNeededBoolean``.", ) asNeededCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="asNeededCodeableConcept", title="Preconditions for service", description=( "If a CodeableConcept is present, it indicates the pre-condition for " 'performing the service. For example "pain", "on flare-up", etc.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e asNeeded[x] "one_of_many": "asNeeded", "one_of_many_required": False, }, ) author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the content", description=( "An individiual or organization primarily involved in the creation and " "maintenance of the content." ), json_schema_extra={ "element_property": True, }, ) bodySite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="bodySite", title="What part of body to perform on", description=( "Indicates the sites on the subject's body where the procedure should " "be performed (I.e. the target sites)." ), json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Detail type of activity", description=( "Detailed description of the type of activity; e.g. What lab test, what" " procedure, what kind of encounter." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the activity definition and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the activity definition." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the activity definition was last " "significantly changed. The date must change when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the activity definition" " changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the activity definition", description=( "A free text natural language description of the activity definition " "from a consumer's perspective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) doNotPerform: bool | None = Field( default=None, alias="doNotPerform", title="True if the activity should not be performed", description=( "Set this to true if the definition is to indicate that a particular " "activity should NOT be performed. If true, this element should be " "interpreted to reinforce a negative coding. For example NPO as a code " "with a doNotPerform of true would still indicate to NOT perform the " "action." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doNotPerform", title="Extension field for ``doNotPerform``.", ) dosage: typing.List[fhirtypes.DosageType] | None = Field( default=None, alias="dosage", title="Detailed dosage instructions", description=( "Provides detailed dosage instructions in the same way that they are " "described for MedicationRequest resources." ), json_schema_extra={ "element_property": True, }, ) dynamicValue: typing.List[ fhirtypes.ActivityDefinitionDynamicValueType ] | None = Field( default=None, alias="dynamicValue", title="Dynamic aspects of the definition", description=( "Dynamic values that will be evaluated to produce values for elements " "of the resulting resource. For example, if the dosage of a medication " "must be computed based on the patient's weight, a dynamic value would " "be used to specify an expression that calculated the weight, and the " "path on the request resource that would contain the result." ), json_schema_extra={ "element_property": True, }, ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the content", description=( "An individual or organization primarily responsible for internal " "coherence of the content." ), json_schema_extra={ "element_property": True, }, ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the activity definition is expected to be used", description=( "The period during which the activity definition content was or is " "planned to be in active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the content", description=( "An individual or organization asserted by the publisher to be " "responsible for officially endorsing the content for use in some " "setting." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this activity definition is authored " "for testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the activity definition", description=( "A formal identifier that is used to identify this activity definition " "when it is represented in other formats, or referenced in a " "specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) intent: fhirtypes.CodeType | None = Field( default=None, alias="intent", title=( "proposal | plan | directive | order | original-order | reflex-order | " "filler-order | instance-order | option" ), description=( "Indicates the level of authority/intentionality associated with the " "activity and where the request should fit into the workflow chain." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "proposal", "plan", "directive", "order", "original-order", "reflex-order", "filler-order", "instance-order", "option", ], }, ) intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intent", title="Extension field for ``intent``." ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for activity definition (if applicable)", description=( "A legal or geographic region in which the activity definition is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title="Kind of resource", description=( "A description of the kind of resource the activity definition is " "representing. For example, a MedicationRequest, a ServiceRequest, or a" " CommunicationRequest." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the activity definition was last reviewed by the publisher", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) library: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="library", title="Logic used by the activity definition", description=( "A reference to a Library resource containing any formal logic used by " "the activity definition." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Library"], }, ) library__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_library", title="Extension field for ``library``." ) location: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="location", title="Where it should happen", description=( "Identifies the facility where the activity will occur; e.g. home, " "hospital, specific clinic, etc." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this activity definition (computer friendly)", description=( "A natural language name identifying the activity definition. This name" " should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) observationRequirement: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="observationRequirement", title="What observations are required to perform this action", description=( "Defines observation requirements for the action to be performed, such " "as body weight or surface area." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) observationRequirement__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_observationRequirement", title="Extension field for ``observationRequirement``.", ) observationResultRequirement: typing.List[ fhirtypes.CanonicalType | None ] | None = Field( default=None, alias="observationResultRequirement", title="What observations must be produced by this action", description=( "Defines the observations that are expected to be produced by the " "action." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) observationResultRequirement__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_observationResultRequirement", title="Extension field for ``observationResultRequirement``.", ) participant: typing.List[ fhirtypes.ActivityDefinitionParticipantType ] | None = Field( default=None, alias="participant", title="Who should participate in the action", description="Indicates who should participate in performing the action described.", json_schema_extra={ "element_property": True, }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Indicates how quickly the activity should be addressed with respect " "to other requests." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) productCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productCodeableConcept", title="What's administered/supplied", description=( "Identifies the food, drug or other product being consumed or supplied " "in the activity." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e product[x] "one_of_many": "product", "one_of_many_required": False, }, ) productReference: fhirtypes.ReferenceType | None = Field( default=None, alias="productReference", title="What's administered/supplied", description=( "Identifies the food, drug or other product being consumed or supplied " "in the activity." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e product[x] "one_of_many": "product", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Medication", "Ingredient", "Substance", "SubstanceDefinition", ], }, ) profile: fhirtypes.CanonicalType | None = Field( default=None, alias="profile", title="What profile the resource needs to conform to", description=( "A profile to which the target of the activity definition is expected " "to conform." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the activity definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this activity definition is defined", description=( "Explanation of why this activity definition is needed and why it has " "been designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="How much is administered/consumed/supplied", description=( "Identifies the quantity expected to be consumed at once (per dose, per" " meal, etc.)." ), json_schema_extra={ "element_property": True, }, ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Additional documentation, citations, etc", description=( "Related artifacts such as additional documentation, justification, or " "bibliographic references." ), json_schema_extra={ "element_property": True, }, ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the content", description=( "An individual or organization asserted by the publisher to be " "primarily responsible for review of some aspect of the content." ), json_schema_extra={ "element_property": True, }, ) specimenRequirement: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="specimenRequirement", title="What specimens are required to perform this action", description=( "Defines specimen requirements for the action to be performed, such as " "required specimens for a lab test." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SpecimenDefinition"], }, ) specimenRequirement__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_specimenRequirement", title="Extension field for ``specimenRequirement``.", ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this activity definition. Enables tracking the life-" "cycle of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subjectCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="subjectCanonical", title="Type of individual the activity definition is intended for", description=( "A code, group definition, or canonical reference that describes or " "identifies the intended subject of the activity being defined. " "Canonical references are allowed to support the definition of " "protocols for drug and substance quality specifications, and is " "allowed to reference a MedicinalProductDefinition, " "SubstanceDefinition, AdministrableProductDefinition, " "ManufacturedItemDefinition, or PackagedProductDefinition resource." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["EvidenceVariable"], }, ) subjectCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subjectCanonical", title="Extension field for ``subjectCanonical``.", ) subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subjectCodeableConcept", title="Type of individual the activity definition is intended for", description=( "A code, group definition, or canonical reference that describes or " "identifies the intended subject of the activity being defined. " "Canonical references are allowed to support the definition of " "protocols for drug and substance quality specifications, and is " "allowed to reference a MedicinalProductDefinition, " "SubstanceDefinition, AdministrableProductDefinition, " "ManufacturedItemDefinition, or PackagedProductDefinition resource." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, }, ) subjectReference: fhirtypes.ReferenceType | None = Field( default=None, alias="subjectReference", title="Type of individual the activity definition is intended for", description=( "A code, group definition, or canonical reference that describes or " "identifies the intended subject of the activity being defined. " "Canonical references are allowed to support the definition of " "protocols for drug and substance quality specifications, and is " "allowed to reference a MedicinalProductDefinition, " "SubstanceDefinition, AdministrableProductDefinition, " "ManufacturedItemDefinition, or PackagedProductDefinition resource." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Group", "MedicinalProductDefinition", "SubstanceDefinition", "AdministrableProductDefinition", "ManufacturedItemDefinition", "PackagedProductDefinition", ], }, ) subtitle: fhirtypes.StringType | None = Field( default=None, alias="subtitle", title="Subordinate title of the activity definition", description=( "An explanatory or alternate title for the activity definition giving " "additional information about its content." ), json_schema_extra={ "element_property": True, }, ) subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subtitle", title="Extension field for ``subtitle``." ) timingAge: fhirtypes.AgeType | None = Field( default=None, alias="timingAge", title="When activity is to occur", description="The timing or frequency upon which the described activity is to occur.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDuration: fhirtypes.DurationType | None = Field( default=None, alias="timingDuration", title="When activity is to occur", description="The timing or frequency upon which the described activity is to occur.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingRange: fhirtypes.RangeType | None = Field( default=None, alias="timingRange", title="When activity is to occur", description="The timing or frequency upon which the described activity is to occur.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingTiming: fhirtypes.TimingType | None = Field( default=None, alias="timingTiming", title="When activity is to occur", description="The timing or frequency upon which the described activity is to occur.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this activity definition (human friendly)", description="A short, descriptive, user-friendly title for the activity definition.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) topic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="topic", title="E.g. Education, Treatment, Assessment, etc", description=( "Descriptive topics related to the content of the activity. Topics " "provide a high-level categorization of the activity that can be useful" " for filtering and searching." ), json_schema_extra={ "element_property": True, }, ) transform: fhirtypes.CanonicalType | None = Field( default=None, alias="transform", title="Transform to apply the template", description=( "A reference to a StructureMap resource that defines a transform that " "can be executed to produce the intent resource using the " "ActivityDefinition instance as the input." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureMap"], }, ) transform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_transform", title="Extension field for ``transform``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this activity definition, represented as a " "URI (globally unique)" ), description=( "An absolute URI that is used to identify this activity definition when" " it is referenced in a specification, model, design or an instance; " "also called its canonical identifier. This SHOULD be globally unique " "and SHOULD be a literal address at which an authoritative instance of " "this activity definition is (or will be) published. This URL can be " "the target of a canonical reference. It SHALL remain the same when the" " activity definition is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) usage: fhirtypes.MarkdownType | None = Field( default=None, alias="usage", title="Describes the clinical usage of the activity definition", description=( "A detailed description of how the activity definition is used from a " "clinical perspective." ), json_schema_extra={ "element_property": True, }, ) usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usage", title="Extension field for ``usage``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate activity definition instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the activity definition", description=( "The identifier that is used to identify this version of the activity " "definition when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the activity " "definition author and is not expected to be globally unique. For " "example, it might be a timestamp (e.g. yyyymmdd) if a managed version " "is not available. There is also no expectation that versions can be " "placed in a lexicographical sequence. To provide a version consistent " "with the Decision Support Service specification, use the format " "Major.Minor.Revision (e.g. 1.0.0). For more information on versioning " "knowledge assets, refer to the Decision Support Service specification." " Note that a version is required for non-experimental active assets." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ActivityDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "subtitle", "status", "experimental", "subjectCodeableConcept", "subjectReference", "subjectCanonical", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "usage", "copyright", "copyrightLabel", "approvalDate", "lastReviewDate", "effectivePeriod", "topic", "author", "editor", "reviewer", "endorser", "relatedArtifact", "library", "kind", "profile", "code", "intent", "priority", "doNotPerform", "timingTiming", "timingAge", "timingRange", "timingDuration", "asNeededBoolean", "asNeededCodeableConcept", "location", "participant", "productReference", "productCodeableConcept", "quantity", "dosage", "bodySite", "specimenRequirement", "observationRequirement", "observationResultRequirement", "transform", "dynamicValue", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ActivityDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "effectivePeriod", "kind", "code", "doNotPerform", "asNeededBoolean", "asNeededCodeableConcept", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "asNeeded": ["asNeededBoolean", "asNeededCodeableConcept"], "product": ["productCodeableConcept", "productReference"], "subject": [ "subjectCanonical", "subjectCodeableConcept", "subjectReference", ], "timing": ["timingAge", "timingDuration", "timingRange", "timingTiming"], "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"], } return one_of_many_fields class ActivityDefinitionDynamicValue(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Dynamic aspects of the definition. Dynamic values that will be evaluated to produce values for elements of the resulting resource. For example, if the dosage of a medication must be computed based on the patient's weight, a dynamic value would be used to specify an expression that calculated the weight, and the path on the request resource that would contain the result. """ __resource_type__ = "ActivityDefinitionDynamicValue" expression: fhirtypes.ExpressionType = Field( default=..., alias="expression", title="An expression that provides the dynamic value for the customization", description="An expression specifying the value of the customized element.", json_schema_extra={ "element_property": True, }, ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="The path to the element to be set dynamically", description=( "The path to the element to be customized. This is the path on the " "resource that will hold the result of the calculation defined by the " "expression. The specified path SHALL be a FHIRPath resolvable on the " "specified target type of the ActivityDefinition, and SHALL consist " "only of identifiers, constant indexers, and a restricted subset of " "functions. The path is allowed to contain qualifiers (.) to traverse " "sub-elements, as well as indexers ([x]) to traverse multiple-" "cardinality sub-elements (see the [Simple FHIRPath " "Profile](fhirpath.html#simple) for full details)." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ActivityDefinitionDynamicValue`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "path", "expression"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ActivityDefinitionDynamicValue`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("path", "path__ext")] return required_fields class ActivityDefinitionParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who should participate in the action. Indicates who should participate in performing the action described. """ __resource_type__ = "ActivityDefinitionParticipant" function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="E.g. Author, Reviewer, Witness, etc", description=( "Indicates how the actor will be involved in the action - author, " "reviewer, witness, etc." ), json_schema_extra={ "element_property": True, }, ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="E.g. Nurse, Surgeon, Parent, etc", description=( "The role the participant should play in performing the described " "action." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "careteam | device | group | healthcareservice | location | " "organization | patient | practitioner | practitionerrole | " "relatedperson" ), description="The type of participant in the action.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "careteam", "device", "group", "healthcareservice", "location", "organization", "patient", "practitioner", "practitionerrole", "relatedperson", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) typeCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="typeCanonical", title="Who or what can participate", description="The type of participant in the action.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CapabilityStatement"], }, ) typeCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_typeCanonical", title="Extension field for ``typeCanonical``.", ) typeReference: fhirtypes.ReferenceType | None = Field( default=None, alias="typeReference", title="Who or what can participate", description="The type of participant in the action.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CareTeam", "Device", "DeviceDefinition", "Endpoint", "Group", "HealthcareService", "Location", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ActivityDefinitionParticipant`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "typeCanonical", "typeReference", "role", "function", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ActivityDefinitionParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/actordefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ActorDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class ActorDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An application that exchanges data. Describes an actor - a human or an application that plays a role in data exchange, and that may have obligations associated with the role the actor plays. """ __resource_type__ = "ActorDefinition" capabilities: fhirtypes.CanonicalType | None = Field( default=None, alias="capabilities", title="CapabilityStatement for the actor (if applicable)", description="The capability statement for the actor (if the concept is applicable).", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CapabilityStatement"], }, ) capabilities__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_capabilities", title="Extension field for ``capabilities``.", ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the actor definition and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the actor definition." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the actor definition was last " "significantly changed. The date must change when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the actor definition " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) derivedFrom: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="derivedFrom", title="Definition of this actor in another context / IG", description=( "A url that identifies the definition of this actor in another IG " "(which IG must be listed in the dependencies). This actor inherits all" " the obligations etc. as defined in the other IG." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ActorDefinition"], }, ) derivedFrom__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_derivedFrom", title="Extension field for ``derivedFrom``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the actor", description="A free text natural language description of the actor.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) documentation: fhirtypes.MarkdownType | None = Field( default=None, alias="documentation", title="Functionality associated with the actor", description="Documentation about the functionality of the actor.", json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this actor definition is authored for" " testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the actor definition (business identifier)", description=( "A formal identifier that is used to identify this actor definition " "when it is represented in other formats, or referenced in a " "specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for actor definition (if applicable)", description=( "A legal or geographic region in which the actor definition is intended" " to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this actor definition (computer friendly)", description=( "A natural language name identifying the actor definition. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the actor definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this actor definition is defined", description=( "Explanation of why this actor definition is needed and why it has been" " designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) reference: typing.List[fhirtypes.UrlType | None] | None = Field( default=None, alias="reference", title="Reference to more information about the actor", description=( "A reference to additional documentation about the actor, but " "description and documentation." ), json_schema_extra={ "element_property": True, }, ) reference__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_reference", title="Extension field for ``reference``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this actor definition. Enables tracking the life-cycle " "of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this actor definition (human friendly)", description="A short, descriptive, user-friendly title for the actor definition.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="person | system", description="Whether the actor represents a human or an appliction.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["person", "system"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this actor definition, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this actor definition when it" " is referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which an authoritative instance of this" " actor definition is (or will be) published. This URL can be the " "target of a canonical reference. It SHALL remain the same when the " "actor definition is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate actor definition instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the actor definition", description=( "The identifier that is used to identify this version of the actor " "definition when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the actor definition " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ActorDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "copyrightLabel", "type", "documentation", "reference", "capabilities", "derivedFrom", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ActorDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "type", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext"), ("type", "type__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields ================================================ FILE: fhir/resources/address.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Address Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class Address(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An address expressed using postal conventions (as opposed to GPS or other location definition formats). An address expressed using postal conventions (as opposed to GPS or other location definition formats). This data type may be used to convey addresses for use in delivering mail as well as for visiting locations which might not be valid for mail delivery. There are a variety of postal address formats defined around the world. The ISO21090-codedString may be used to provide a coded representation of the contents of strings in an Address. """ __resource_type__ = "Address" city: fhirtypes.StringType | None = Field( default=None, alias="city", title="Name of city, town etc.", description=( "The name of the city, town, suburb, village or other community or " "delivery center." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) city__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_city", title="Extension field for ``city``." ) country: fhirtypes.StringType | None = Field( default=None, alias="country", title="Country (e.g. may be ISO 3166 2 or 3 letter code)", description="Country - a nation as commonly understood or generally accepted.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) country__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_country", title="Extension field for ``country``." ) district: fhirtypes.StringType | None = Field( default=None, alias="district", title="District name (aka county)", description="The name of the administrative area (county).", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) district__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_district", title="Extension field for ``district``." ) line: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="line", title="Street name, number, direction & P.O. Box etc.", description=( "This component contains the house number, apartment number, street " "name, street direction, P.O. Box number, delivery hints, and similar " "address information." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) line__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_line", title="Extension field for ``line``." ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period when address was/is in use", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) postalCode: fhirtypes.StringType | None = Field( default=None, alias="postalCode", title="Postal code for area", description="A postal code designating a region defined by the postal service.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) postalCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_postalCode", title="Extension field for ``postalCode``." ) state: fhirtypes.StringType | None = Field( default=None, alias="state", title="Sub-unit of country (abbreviations ok)", description=( "Sub-unit of a country with limited sovereignty in a federally " "organized country. A code may be used if codes are in common use (e.g." " US 2 letter state codes)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) state__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_state", title="Extension field for ``state``." ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Text representation of the address", description=( "Specifies the entire address as it should be displayed e.g. on a " "postal label. This may be provided instead of or as well as the " "specific parts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="postal | physical | both", description=( "Distinguishes between physical addresses (those you can visit) and " "mailing addresses (e.g. PO Boxes and care-of addresses). Most " "addresses are both." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["postal", "physical", "both"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="home | work | temp | old | billing - purpose of this address", description="The purpose of this address.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["home", "work", "temp", "old", "billing"], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Address`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "use", "type", "text", "line", "city", "district", "state", "postalCode", "country", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Address`` according to specification, with preserving the original sequence order. """ return [ "use", "type", "text", "line", "city", "district", "state", "postalCode", "country", "period", ] ================================================ FILE: fhir/resources/administrableproductdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/AdministrableProductDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class AdministrableProductDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A medicinal product in the final form, suitable for administration - after any mixing of multiple components. A medicinal product in the final form which is suitable for administering to a patient (after any mixing of multiple components, dissolution etc. has been performed). """ __resource_type__ = "AdministrableProductDefinition" administrableDoseForm: fhirtypes.CodeableConceptType | None = Field( default=None, alias="administrableDoseForm", title=( "The dose form of the final product after necessary reconstitution or " "processing" ), description=( "The dose form of the final product after necessary reconstitution or " "processing. Contrasts to the manufactured dose form (see " "ManufacturedItemDefinition). If the manufactured form was 'powder for " "solution for injection', the administrable dose form could be " "'solution for injection' (once mixed with another item having " "manufactured form 'solvent for solution for injection')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title=( "A general description of the product, when in its final form, suitable" " for administration e.g. effervescent blue liquid, to be swallowed" ), description=( "A general description of the product, when in its final form, suitable" " for administration e.g. effervescent blue liquid, to be swallowed. " "Intended to be used when the other structured properties of this " "resource are insufficient or cannot be supported. It is not intended " "to duplicate information already carried elswehere." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) device: fhirtypes.ReferenceType | None = Field( default=None, alias="device", title=( "A device that is integral to the medicinal product, in effect being " 'considered as an "ingredient" of the medicinal product' ), description=( "A device that is integral to the medicinal product, in effect being " 'considered as an "ingredient" of the medicinal product. This is not ' "intended for devices that are just co-packaged." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DeviceDefinition"], }, ) formOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="formOf", title=( "References a product from which one or more of the constituent parts " "of that product can be prepared and used as described by this " "administrable product" ), description=( "References a product from which one or more of the constituent parts " "of that product can be prepared and used as described by this " "administrable product. If this administrable product describes the " "administration of a crushed tablet, the 'formOf' would be the product " "representing a distribution containing tablets and possibly also a " "cream. This is distinct from the 'producedFrom' which refers to the " "specific components of the product that are used in this preparation, " "rather than the product as a whole." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicinalProductDefinition"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="An identifier for the administrable product", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ingredient: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="ingredient", title=( "The ingredients of this administrable medicinal product. This is only " "needed if the ingredients are not specified either using " "ManufacturedItemDefiniton, or using by incoming references from the " "Ingredient resource" ), description=( "The ingredients of this administrable medicinal product. This is only " "needed if the ingredients are not specified either using " "ManufacturedItemDefiniton (via " "AdministrableProductDefinition.producedFrom) to state which component " "items are used to make this, or using by incoming references from the " "Ingredient resource, to state in detail which substances exist within " "this. This element allows a basic coded ingredient to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) producedFrom: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="producedFrom", title=( "Indicates the specific manufactured items that are part of the " "'formOf' product that are used in the preparation of this specific " "administrable form" ), description=( "Indicates the specific manufactured items that are part of the " "'formOf' product that are used in the preparation of this specific " "administrable form. In some cases, an administrable form might use " "all of the items from the overall product (or there might only be one " "item), while in other cases, an administrable form might use only a " "subset of the items available in the overall product. For example, an" " administrable form might involve combining a liquid and a powder " "available as part of an overall product, but not involve applying the " "also supplied cream." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ManufacturedItemDefinition"], }, ) property: typing.List[ fhirtypes.AdministrableProductDefinitionPropertyType ] | None = Field( default=None, alias="property", title="Characteristics e.g. a product's onset of action", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) routeOfAdministration: typing.List[ fhirtypes.AdministrableProductDefinitionRouteOfAdministrationType ] = Field( default=..., alias="routeOfAdministration", title=( "The path by which the product is taken into or makes contact with the " "body" ), description=( "The path by which the product is taken into or makes contact with the " "body. In some regions this is referred to as the licenced or approved " "route. RouteOfAdministration cannot be used when the 'formOf' product " "already uses MedicinalProductDefinition.route (and vice versa)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this administrable product. Enables tracking the life-" "cycle of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) unitOfPresentation: fhirtypes.CodeableConceptType | None = Field( default=None, alias="unitOfPresentation", title=( "The presentation type in which this item is given to a patient. e.g. " "for a spray - 'puff'" ), description=( "The presentation type in which this item is given to a patient. e.g. " "for a spray - 'puff' (as in 'contains 100 mcg per puff'), or for a " "liquid - 'vial' (as in 'contains 5 ml per vial')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AdministrableProductDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "formOf", "administrableDoseForm", "unitOfPresentation", "producedFrom", "ingredient", "device", "description", "property", "routeOfAdministration", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AdministrableProductDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "formOf", "administrableDoseForm", "unitOfPresentation", "producedFrom", "ingredient", "device", "property", "routeOfAdministration", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class AdministrableProductDefinitionProperty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Characteristics e.g. a product's onset of action. """ __resource_type__ = "AdministrableProductDefinitionProperty" status: fhirtypes.CodeableConceptType | None = Field( default=None, alias="status", title="The status of characteristic e.g. assigned or pending", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="A code expressing the type of characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="valueMarkdown", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueMarkdown", title="Extension field for ``valueMarkdown``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Binary"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AdministrableProductDefinitionProperty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueCodeableConcept", "valueQuantity", "valueDate", "valueBoolean", "valueMarkdown", "valueAttachment", "valueReference", "status", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AdministrableProductDefinitionProperty`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "valueCodeableConcept", "valueQuantity", "valueDate", "valueBoolean", "valueMarkdown", "valueAttachment", "valueReference", "status", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueBoolean", "valueCodeableConcept", "valueDate", "valueMarkdown", "valueQuantity", "valueReference", ] } return one_of_many_fields class AdministrableProductDefinitionRouteOfAdministration( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The path by which the product is taken into or makes contact with the body. The path by which the product is taken into or makes contact with the body. In some regions this is referred to as the licenced or approved route. RouteOfAdministration cannot be used when the 'formOf' product already uses MedicinalProductDefinition.route (and vice versa). """ __resource_type__ = "AdministrableProductDefinitionRouteOfAdministration" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Coded expression for the route", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) firstDose: fhirtypes.QuantityType | None = Field( default=None, alias="firstDose", title=( "The first dose (dose quantity) administered can be specified for the " "product" ), description=( "The first dose (dose quantity) administered can be specified for the " "product, using a numerical value and its unit of measurement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maxDosePerDay: fhirtypes.QuantityType | None = Field( default=None, alias="maxDosePerDay", title="The maximum dose quantity to be administered in any one 24-h period", description=( "The maximum dose per day (maximum dose quantity to be administered in " "any one 24-h period) that can be administered." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maxDosePerTreatmentPeriod: fhirtypes.RatioType | None = Field( default=None, alias="maxDosePerTreatmentPeriod", title="The maximum dose per treatment period that can be administered", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maxSingleDose: fhirtypes.QuantityType | None = Field( default=None, alias="maxSingleDose", title="The maximum single dose that can be administered", description=( "The maximum single dose that can be administered, specified using a " "numerical value and its unit of measurement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maxTreatmentPeriod: fhirtypes.DurationType | None = Field( default=None, alias="maxTreatmentPeriod", title=( "The maximum treatment period during which the product can be " "administered" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) targetSpecies: typing.List[ fhirtypes.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesType ] | None = Field( default=None, alias="targetSpecies", title="A species for which this route applies", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AdministrableProductDefinitionRouteOfAdministration`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "firstDose", "maxSingleDose", "maxDosePerDay", "maxDosePerTreatmentPeriod", "maxTreatmentPeriod", "targetSpecies", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AdministrableProductDefinitionRouteOfAdministration`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "code", "firstDose", "maxSingleDose", "maxDosePerDay", "maxDosePerTreatmentPeriod", "maxTreatmentPeriod", "targetSpecies", ] class AdministrableProductDefinitionRouteOfAdministrationTargetSpecies( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A species for which this route applies. """ __resource_type__ = ( "AdministrableProductDefinitionRouteOfAdministrationTargetSpecies" ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Coded expression for the species", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) withdrawalPeriod: typing.List[ fhirtypes.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodType ] | None = Field( default=None, alias="withdrawalPeriod", title=( "A species specific time during which consumption of animal product is " "not appropriate" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AdministrableProductDefinitionRouteOfAdministrationTargetSpecies`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "withdrawalPeriod"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AdministrableProductDefinitionRouteOfAdministrationTargetSpecies`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "withdrawalPeriod"] class AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriod( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A species specific time during which consumption of animal product is not appropriate. """ __resource_type__ = "AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriod" supportingInformation: fhirtypes.StringType | None = Field( default=None, alias="supportingInformation", title="Extra information about the withdrawal period", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) supportingInformation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_supportingInformation", title="Extension field for ``supportingInformation``.", ) tissue: fhirtypes.CodeableConceptType = Field( default=..., alias="tissue", title=( "The type of tissue for which the withdrawal period applies, e.g. meat," " milk" ), description=( "Coded expression for the type of tissue for which the withdrawal " "period applies, e.g. meat, milk." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) value: fhirtypes.QuantityType = Field( default=..., alias="value", title="A value for the time", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriod`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "tissue", "value", "supportingInformation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriod`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "tissue", "value", "supportingInformation"] ================================================ FILE: fhir/resources/adverseevent.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/AdverseEvent Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class AdverseEvent(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An event that may be related to unintended effects on a patient or research participant. An event (i.e. any change to current patient status) that may be related to unintended effects on a patient or research participant. The unintended effects may require additional monitoring, treatment, hospitalization, or may result in death. The AdverseEvent resource also extends to potential or avoided events that could have had such effects. There are two major domains where the AdverseEvent resource is expected to be used. One is in clinical care reported adverse events and the other is in reporting adverse events in clinical research trial management. Adverse events can be reported by healthcare providers, patients, caregivers or by medical products manufacturers. Given the differences between these two concepts, we recommend consulting the domain specific implementation guides when implementing the AdverseEvent Resource. The implementation guides include specific extensions, value sets and constraints. """ __resource_type__ = "AdverseEvent" actuality: fhirtypes.CodeType | None = Field( default=None, alias="actuality", title="actual | potential", description=( "Whether the event actually happened or was a near miss. Note that this" " is independent of whether anyone was affected or harmed or how " "severely." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["actual", "potential"], }, ) actuality__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_actuality", title="Extension field for ``actuality``." ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title=( "wrong-patient | procedure-mishap | medication-mishap | device | " "unsafe-physical-environment | hospital-aquired-infection | wrong-body-" "site" ), description="The overall type of event, intended for search and filtering purposes.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Event or incident that occurred or was averted", description=( "Specific event that occurred or that was averted, such as patient " "fall, wrong organ removed, or wrong blood transfused." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contributingFactor: typing.List[ fhirtypes.AdverseEventContributingFactorType ] | None = Field( default=None, alias="contributingFactor", title=( "Contributing factors suspected to have increased the probability or " "severity of the adverse event" ), description=( "The contributing factors suspected to have increased the probability " "or severity of the adverse event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) detected: fhirtypes.DateTimeType | None = Field( default=None, alias="detected", title="When the event was detected", description=( "Estimated or actual date the AdverseEvent began, in the opinion of the" " reporter." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) detected__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detected", title="Extension field for ``detected``." ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="The Encounter associated with the start of the AdverseEvent", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) expectedInResearchStudy: bool | None = Field( default=None, alias="expectedInResearchStudy", title="Considered likely or probable or anticipated in the research study", description=( "Considered likely or probable or anticipated in the research study. " "Whether the reported event matches any of the outcomes for the patient" " that are considered by the study as known or likely." ), json_schema_extra={ "element_property": True, }, ) expectedInResearchStudy__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expectedInResearchStudy", title="Extension field for ``expectedInResearchStudy``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier for the event", description=( "Business identifiers assigned to this adverse event by the performer " "or other systems which remain constant as the resource is updated and " "propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Location where adverse event occurred", description="The information about where the adverse event occurred.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) mitigatingAction: typing.List[ fhirtypes.AdverseEventMitigatingActionType ] | None = Field( default=None, alias="mitigatingAction", title=( "Ameliorating actions taken after the adverse event occured in order to" " reduce the extent of harm" ), description=( "The ameliorating action taken after the adverse event occured in order" " to reduce the extent of harm." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comment on adverse event", description=( "Comments made about the adverse event by the performer, subject or " "other participants." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When the event occurred", description="The date (and perhaps time) when the adverse event occurred.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="When the event occurred", description="The date (and perhaps time) when the adverse event occurred.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceTiming: fhirtypes.TimingType | None = Field( default=None, alias="occurrenceTiming", title="When the event occurred", description="The date (and perhaps time) when the adverse event occurred.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) outcome: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="outcome", title="Type of outcome from the adverse event", description=( "Describes the type of outcome from the adverse event, such as " "resolved, recovering, ongoing, resolved-with-sequelae, or fatal." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) participant: typing.List[fhirtypes.AdverseEventParticipantType] | None = Field( default=None, alias="participant", title=( "Who was involved in the adverse event or the potential adverse event " "and what they did" ), description=( "Indicates who or what participated in the adverse event and how they " "were involved." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) preventiveAction: typing.List[ fhirtypes.AdverseEventPreventiveActionType ] | None = Field( default=None, alias="preventiveAction", title="Preventive actions that contributed to avoiding the adverse event", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) recordedDate: fhirtypes.DateTimeType | None = Field( default=None, alias="recordedDate", title="When the event was recorded", description=( "The date on which the existence of the AdverseEvent was first " "recorded." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) recordedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recordedDate", title="Extension field for ``recordedDate``.", ) recorder: fhirtypes.ReferenceType | None = Field( default=None, alias="recorder", title="Who recorded the adverse event", description=( "Information on who recorded the adverse event. May be the patient or " "a practitioner." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "ResearchSubject", ], }, ) resultingEffect: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="resultingEffect", title="Effect on the subject due to this event", description=( "Information about the condition that occurred as a result of the " "adverse event, such as hives due to the exposure to a substance (for " "example, a drug or a chemical) or a broken leg as a result of the " "fall." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "Observation"], }, ) seriousness: fhirtypes.CodeableConceptType | None = Field( default=None, alias="seriousness", title="Seriousness or gravity of the event", description=( "Assessment whether this event, or averted event, was of clinical " "importance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="in-progress | completed | entered-in-error | unknown", description="The current state of the adverse event or potential adverse event.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["in-progress", "completed", "entered-in-error", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) study: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="study", title="Research study that the subject is enrolled in", description="The research study that the subject is enrolled in.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ResearchStudy"], }, ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Subject impacted by event", description="This subject or group impacted by the event.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Group", "Practitioner", "RelatedPerson", "ResearchSubject", ], }, ) supportingInfo: typing.List[ fhirtypes.AdverseEventSupportingInfoType ] | None = Field( default=None, alias="supportingInfo", title="Supporting information relevant to the event", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) suspectEntity: typing.List[fhirtypes.AdverseEventSuspectEntityType] | None = Field( default=None, alias="suspectEntity", title="The suspected agent causing the adverse event", description=( "Describes the entity that is suspected to have caused the adverse " "event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AdverseEvent`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "actuality", "category", "code", "subject", "encounter", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "detected", "recordedDate", "resultingEffect", "location", "seriousness", "outcome", "recorder", "participant", "study", "expectedInResearchStudy", "suspectEntity", "contributingFactor", "preventiveAction", "mitigatingAction", "supportingInfo", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AdverseEvent`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "actuality", "category", "code", "subject", "encounter", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "detected", "recordedDate", "resultingEffect", "location", "seriousness", "outcome", "recorder", "participant", "study", "suspectEntity", "contributingFactor", "preventiveAction", "mitigatingAction", "supportingInfo", "note", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("actuality", "actuality__ext"), ("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "occurrence": ["occurrenceDateTime", "occurrencePeriod", "occurrenceTiming"] } return one_of_many_fields class AdverseEventContributingFactor(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contributing factors suspected to have increased the probability or severity of the adverse event. The contributing factors suspected to have increased the probability or severity of the adverse event. """ __resource_type__ = "AdverseEventContributingFactor" itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="itemCodeableConcept", title=( "Item suspected to have increased the probability or severity of the " "adverse event" ), description=( "The item that is suspected to have increased the probability or " "severity of the adverse event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": True, }, ) itemReference: fhirtypes.ReferenceType | None = Field( default=None, alias="itemReference", title=( "Item suspected to have increased the probability or severity of the " "adverse event" ), description=( "The item that is suspected to have increased the probability or " "severity of the adverse event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "AllergyIntolerance", "FamilyMemberHistory", "Immunization", "Procedure", "Device", "DeviceUsage", "DocumentReference", "MedicationAdministration", "MedicationStatement", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AdverseEventContributingFactor`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "itemReference", "itemCodeableConcept", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AdverseEventContributingFactor`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "itemReference", "itemCodeableConcept"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"item": ["itemCodeableConcept", "itemReference"]} return one_of_many_fields class AdverseEventMitigatingAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Ameliorating actions taken after the adverse event occured in order to reduce the extent of harm. The ameliorating action taken after the adverse event occured in order to reduce the extent of harm. """ __resource_type__ = "AdverseEventMitigatingAction" itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="itemCodeableConcept", title=( "Ameliorating action taken after the adverse event occured in order to " "reduce the extent of harm" ), description=( "The ameliorating action taken after the adverse event occured in order" " to reduce the extent of harm." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": True, }, ) itemReference: fhirtypes.ReferenceType | None = Field( default=None, alias="itemReference", title=( "Ameliorating action taken after the adverse event occured in order to " "reduce the extent of harm" ), description=( "The ameliorating action taken after the adverse event occured in order" " to reduce the extent of harm." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Procedure", "DocumentReference", "MedicationAdministration", "MedicationRequest", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AdverseEventMitigatingAction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "itemReference", "itemCodeableConcept", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AdverseEventMitigatingAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "itemReference", "itemCodeableConcept"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"item": ["itemCodeableConcept", "itemReference"]} return one_of_many_fields class AdverseEventParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who was involved in the adverse event or the potential adverse event and what they did. Indicates who or what participated in the adverse event and how they were involved. """ __resource_type__ = "AdverseEventParticipant" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Who was involved in the adverse event or the potential adverse event", description="Indicates who or what participated in the event.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", "Patient", "Device", "RelatedPerson", "ResearchSubject", ], }, ) function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="Type of involvement", description=( "Distinguishes the type of involvement of the actor in the adverse " "event, such as contributor or informant." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AdverseEventParticipant`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "function", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AdverseEventParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "function", "actor"] class AdverseEventPreventiveAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Preventive actions that contributed to avoiding the adverse event. """ __resource_type__ = "AdverseEventPreventiveAction" itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="itemCodeableConcept", title="Action that contributed to avoiding the adverse event", description="The action that contributed to avoiding the adverse event.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": True, }, ) itemReference: fhirtypes.ReferenceType | None = Field( default=None, alias="itemReference", title="Action that contributed to avoiding the adverse event", description="The action that contributed to avoiding the adverse event.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Immunization", "Procedure", "DocumentReference", "MedicationAdministration", "MedicationRequest", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AdverseEventPreventiveAction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "itemReference", "itemCodeableConcept", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AdverseEventPreventiveAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "itemReference", "itemCodeableConcept"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"item": ["itemCodeableConcept", "itemReference"]} return one_of_many_fields class AdverseEventSupportingInfo(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Supporting information relevant to the event. """ __resource_type__ = "AdverseEventSupportingInfo" itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="itemCodeableConcept", title="Subject medical history or document relevant to this adverse event", description=( "Relevant past history for the subject. In a clinical care context, an " "example being a patient had an adverse event following a pencillin " "administration and the patient had a previously documented penicillin " "allergy. In a clinical trials context, an example is a bunion or rash " "that was present prior to the study. Additionally, the supporting item" " can be a document that is relevant to this instance of the adverse " "event that is not part of the subject's medical history. For example, " "a clinical note, staff list, or material safety data sheet (MSDS). " "Supporting information is not a contributing factor, preventive " "action, or mitigating action." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": True, }, ) itemReference: fhirtypes.ReferenceType | None = Field( default=None, alias="itemReference", title="Subject medical history or document relevant to this adverse event", description=( "Relevant past history for the subject. In a clinical care context, an " "example being a patient had an adverse event following a pencillin " "administration and the patient had a previously documented penicillin " "allergy. In a clinical trials context, an example is a bunion or rash " "that was present prior to the study. Additionally, the supporting item" " can be a document that is relevant to this instance of the adverse " "event that is not part of the subject's medical history. For example, " "a clinical note, staff list, or material safety data sheet (MSDS). " "Supporting information is not a contributing factor, preventive " "action, or mitigating action." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "AllergyIntolerance", "FamilyMemberHistory", "Immunization", "Procedure", "DocumentReference", "MedicationAdministration", "MedicationStatement", "QuestionnaireResponse", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AdverseEventSupportingInfo`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "itemReference", "itemCodeableConcept", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AdverseEventSupportingInfo`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "itemReference", "itemCodeableConcept"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"item": ["itemCodeableConcept", "itemReference"]} return one_of_many_fields class AdverseEventSuspectEntity(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The suspected agent causing the adverse event. Describes the entity that is suspected to have caused the adverse event. """ __resource_type__ = "AdverseEventSuspectEntity" causality: fhirtypes.AdverseEventSuspectEntityCausalityType | None = Field( default=None, alias="causality", title="Information on the possible cause of the event", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instanceCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="instanceCodeableConcept", title="Refers to the specific entity that caused the adverse event", description=( "Identifies the actual instance of what caused the adverse event. May " "be a substance, medication, medication administration, medication " "statement or a device." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e instance[x] "one_of_many": "instance", "one_of_many_required": True, }, ) instanceReference: fhirtypes.ReferenceType | None = Field( default=None, alias="instanceReference", title="Refers to the specific entity that caused the adverse event", description=( "Identifies the actual instance of what caused the adverse event. May " "be a substance, medication, medication administration, medication " "statement or a device." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e instance[x] "one_of_many": "instance", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Immunization", "Procedure", "Substance", "Medication", "MedicationAdministration", "MedicationStatement", "Device", "BiologicallyDerivedProduct", "ResearchStudy", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AdverseEventSuspectEntity`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "instanceCodeableConcept", "instanceReference", "causality", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AdverseEventSuspectEntity`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "instanceCodeableConcept", "instanceReference", "causality", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "instance": ["instanceCodeableConcept", "instanceReference"] } return one_of_many_fields class AdverseEventSuspectEntityCausality(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information on the possible cause of the event. """ __resource_type__ = "AdverseEventSuspectEntityCausality" assessmentMethod: fhirtypes.CodeableConceptType | None = Field( default=None, alias="assessmentMethod", title=( "Method of evaluating the relatedness of the suspected entity to the " "event" ), description=( "The method of evaluating the relatedness of the suspected entity to " "the event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="Author of the information on the possible cause of the event", description="The author of the information on the possible cause of the event.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Patient", "RelatedPerson", "ResearchSubject", ], }, ) entityRelatedness: fhirtypes.CodeableConceptType | None = Field( default=None, alias="entityRelatedness", title=( "Result of the assessment regarding the relatedness of the suspected " "entity to the event" ), description=( "The result of the assessment regarding the relatedness of the " "suspected entity to the event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AdverseEventSuspectEntityCausality`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "assessmentMethod", "entityRelatedness", "author", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AdverseEventSuspectEntityCausality`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "assessmentMethod", "entityRelatedness", "author"] ================================================ FILE: fhir/resources/age.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Age Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from . import quantity class Age(quantity.Quantity): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A duration of time during which an organism (or a process) has existed. """ __resource_type__ = "Age" @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Age`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "value", "comparator", "unit", "system", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Age`` according to specification, with preserving the original sequence order. """ return ["value", "comparator", "unit", "system", "code"] ================================================ FILE: fhir/resources/allergyintolerance.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/AllergyIntolerance Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class AllergyIntolerance(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Allergy or Intolerance (generally: Risk of adverse reaction to a substance). Risk of harmful or undesirable physiological response which is specific to an individual and associated with exposure to a substance. """ __resource_type__ = "AllergyIntolerance" category: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="category", title="food | medication | environment | biologic", description="Category of the identified substance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["food", "medication", "environment", "biologic"], }, ) category__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_category", title="Extension field for ``category``." ) clinicalStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="clinicalStatus", title="active | inactive | resolved", description="The clinical status of the allergy or intolerance.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Code that identifies the allergy or intolerance", description=( "Code for an allergy or intolerance statement (either a positive or a " "negated/excluded statement). This may be a code for a substance or " "pharmaceutical product that is considered to be responsible for the " 'adverse reaction risk (e.g., "Latex"), an allergy or intolerance ' 'condition (e.g., "Latex allergy"), or a negated/excluded code for a ' 'specific substance or class (e.g., "No latex allergy") or a general or' ' categorical negated statement (e.g., "No known allergy", "No known ' 'drug allergies"). Note: the substance for a specific reaction may be ' "different from the substance identified as the cause of the risk, but " "it must be consistent with it. For instance, it may be a more specific" " substance (e.g. a brand medication) or a composite product that " "includes the identified substance. It must be clinically safe to only " "process the 'code' and ignore the 'reaction.substance'. If a " "receiving system is unable to confirm that " "AllergyIntolerance.reaction.substance falls within the semantic scope " "of AllergyIntolerance.code, then the receiving system should ignore " "AllergyIntolerance.reaction.substance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) criticality: fhirtypes.CodeType | None = Field( default=None, alias="criticality", title="low | high | unable-to-assess", description=( "Estimate of the potential clinical harm, or seriousness, of the " "reaction to the identified substance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["low", "high", "unable-to-assess"], }, ) criticality__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_criticality", title="Extension field for ``criticality``." ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter when the allergy or intolerance was asserted", description="The encounter when the allergy or intolerance was asserted.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External ids for this item", description=( "Business identifiers assigned to this AllergyIntolerance by the " "performer or other systems which remain constant as the resource is " "updated and propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastOccurrence: fhirtypes.DateTimeType | None = Field( default=None, alias="lastOccurrence", title="Date(/time) of last known occurrence of a reaction", description=( "Represents the date and/or time of the last known occurrence of a " "reaction event." ), json_schema_extra={ "element_property": True, }, ) lastOccurrence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastOccurrence", title="Extension field for ``lastOccurrence``.", ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Additional text not captured in other fields", description=( "Additional narrative about the propensity for the Adverse Reaction, " "not captured in other fields." ), json_schema_extra={ "element_property": True, }, ) onsetAge: fhirtypes.AgeType | None = Field( default=None, alias="onsetAge", title="When allergy or intolerance was identified", description=( "Estimated or actual date, date-time, or age when allergy or " "intolerance was identified." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="onsetDateTime", title="When allergy or intolerance was identified", description=( "Estimated or actual date, date-time, or age when allergy or " "intolerance was identified." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onsetDateTime", title="Extension field for ``onsetDateTime``.", ) onsetPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="onsetPeriod", title="When allergy or intolerance was identified", description=( "Estimated or actual date, date-time, or age when allergy or " "intolerance was identified." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetRange: fhirtypes.RangeType | None = Field( default=None, alias="onsetRange", title="When allergy or intolerance was identified", description=( "Estimated or actual date, date-time, or age when allergy or " "intolerance was identified." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetString: fhirtypes.StringType | None = Field( default=None, alias="onsetString", title="When allergy or intolerance was identified", description=( "Estimated or actual date, date-time, or age when allergy or " "intolerance was identified." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onsetString", title="Extension field for ``onsetString``." ) participant: typing.List[ fhirtypes.AllergyIntoleranceParticipantType ] | None = Field( default=None, alias="participant", title=( "Who or what participated in the activities related to the allergy or " "intolerance and how they were involved" ), description=( "Indicates who or what participated in the activities related to the " "allergy or intolerance and how they were involved." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Who the allergy or intolerance is for", description="The patient who has the allergy or intolerance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) reaction: typing.List[fhirtypes.AllergyIntoleranceReactionType] | None = Field( default=None, alias="reaction", title="Adverse Reaction Events linked to exposure to substance", description=( "Details about each adverse reaction event linked to exposure to the " "identified substance." ), json_schema_extra={ "element_property": True, }, ) recordedDate: fhirtypes.DateTimeType | None = Field( default=None, alias="recordedDate", title="Date allergy or intolerance was first recorded", description=( "The recordedDate represents when this particular AllergyIntolerance " "record was created in the system, which is often a system-generated " "date." ), json_schema_extra={ "element_property": True, }, ) recordedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recordedDate", title="Extension field for ``recordedDate``.", ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="allergy | intolerance - Underlying mechanism (if known)", description=( "Identification of the underlying physiological mechanism for the " "reaction risk." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) verificationStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="verificationStatus", title="unconfirmed | presumed | confirmed | refuted | entered-in-error", description=( "Assertion about certainty associated with the propensity, or potential" " risk, of a reaction to the identified substance (including " "pharmaceutical product). The verification status pertains to the " "allergy or intolerance, itself, not to any specific AllergyIntolerance" " attribute." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AllergyIntolerance`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "clinicalStatus", "verificationStatus", "type", "category", "criticality", "code", "patient", "encounter", "onsetDateTime", "onsetAge", "onsetPeriod", "onsetRange", "onsetString", "recordedDate", "participant", "lastOccurrence", "note", "reaction", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AllergyIntolerance`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "clinicalStatus", "verificationStatus", "type", "category", "criticality", "code", "patient", "participant", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "onset": [ "onsetAge", "onsetDateTime", "onsetPeriod", "onsetRange", "onsetString", ] } return one_of_many_fields class AllergyIntoleranceParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who or what participated in the activities related to the allergy or intolerance and how they were involved. Indicates who or what participated in the activities related to the allergy or intolerance and how they were involved. """ __resource_type__ = "AllergyIntoleranceParticipant" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title=( "Who or what participated in the activities related to the allergy or " "intolerance" ), description=( "Indicates who or what participated in the activities related to the " "allergy or intolerance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Patient", "RelatedPerson", "Device", "Organization", "CareTeam", ], }, ) function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="Type of involvement", description=( "Distinguishes the type of involvement of the actor in the activities " "related to the allergy or intolerance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AllergyIntoleranceParticipant`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "function", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AllergyIntoleranceParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "function", "actor"] class AllergyIntoleranceReaction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Adverse Reaction Events linked to exposure to substance. Details about each adverse reaction event linked to exposure to the identified substance. """ __resource_type__ = "AllergyIntoleranceReaction" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Description of the event as a whole", description=( "Text description about the reaction as a whole, including details of " "the manifestation if required." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) exposureRoute: fhirtypes.CodeableConceptType | None = Field( default=None, alias="exposureRoute", title="How the subject was exposed to the substance", description=( "Identification of the route by which the subject was exposed to the " "substance." ), json_schema_extra={ "element_property": True, }, ) manifestation: typing.List[fhirtypes.CodeableReferenceType] = Field( default=..., alias="manifestation", title="Clinical symptoms/signs associated with the Event", description=( "Clinical symptoms and/or signs that are observed or associated with " "the adverse reaction event." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Observation"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Text about event not captured in other fields", description=( "Additional text about the adverse reaction event not captured in other" " fields." ), json_schema_extra={ "element_property": True, }, ) onset: fhirtypes.DateTimeType | None = Field( default=None, alias="onset", title="Date(/time) when manifestations showed", description="Record of the date and/or time of the onset of the Reaction.", json_schema_extra={ "element_property": True, }, ) onset__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onset", title="Extension field for ``onset``." ) severity: fhirtypes.CodeType | None = Field( default=None, alias="severity", title="mild | moderate | severe (of event as a whole)", description=( "Clinical assessment of the severity of the reaction event as a whole, " "potentially considering multiple different manifestations." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["mild", "moderate", "severe"], }, ) severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_severity", title="Extension field for ``severity``." ) substance: fhirtypes.CodeableConceptType | None = Field( default=None, alias="substance", title=( "Specific substance or pharmaceutical product considered to be " "responsible for event" ), description=( "Identification of the specific substance (or pharmaceutical product) " "considered to be responsible for the Adverse Reaction event. Note: the" " substance for a specific reaction may be different from the substance" " identified as the cause of the risk, but it must be consistent with " "it. For instance, it may be a more specific substance (e.g. a brand " "medication) or a composite product that includes the identified " "substance. It must be clinically safe to only process the 'code' and " "ignore the 'reaction.substance'. If a receiving system is unable to " "confirm that AllergyIntolerance.reaction.substance falls within the " "semantic scope of AllergyIntolerance.code, then the receiving system " "should ignore AllergyIntolerance.reaction.substance." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AllergyIntoleranceReaction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "substance", "manifestation", "description", "onset", "severity", "exposureRoute", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AllergyIntoleranceReaction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/annotation.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Annotation Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class Annotation(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Text node with attribution. A text note which also contains information about who made the statement and when. """ __resource_type__ = "Annotation" authorReference: fhirtypes.ReferenceType | None = Field( default=None, alias="authorReference", title="Individual responsible for the annotation", description="The individual responsible for making the annotation.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e author[x] "one_of_many": "author", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Patient", "RelatedPerson", "Organization", ], }, ) authorString: fhirtypes.StringType | None = Field( default=None, alias="authorString", title="Individual responsible for the annotation", description="The individual responsible for making the annotation.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e author[x] "one_of_many": "author", "one_of_many_required": False, }, ) authorString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authorString", title="Extension field for ``authorString``.", ) text: fhirtypes.MarkdownType | None = Field( default=None, alias="text", title="The annotation - text content (as markdown)", description="The text of the annotation in markdown format.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) time: fhirtypes.DateTimeType | None = Field( default=None, alias="time", title="When the annotation was made", description="Indicates when this particular annotation was made.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) time__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_time", title="Extension field for ``time``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Annotation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "authorReference", "authorString", "time", "text"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Annotation`` according to specification, with preserving the original sequence order. """ return ["authorReference", "authorString", "time", "text"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("text", "text__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"author": ["authorReference", "authorString"]} return one_of_many_fields ================================================ FILE: fhir/resources/appointment.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Appointment Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Appointment(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s). """ __resource_type__ = "Appointment" account: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="account", title="The set of accounts that may be used for billing for this Appointment", description=( "The set of accounts that is expected to be used for billing the " "activities that result from this Appointment." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Account"], }, ) appointmentType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="appointmentType", title=( "The style of appointment or patient that has been booked in the slot " "(not service type)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="The request this appointment is allocated to assess", description=( "The request this appointment is allocated to assess (e.g. incoming " "referral or procedure request)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CarePlan", "DeviceRequest", "MedicationRequest", "ServiceRequest", ], }, ) cancellationDate: fhirtypes.DateTimeType | None = Field( default=None, alias="cancellationDate", title="When the appointment was cancelled", description="The date/time describing when the appointment was cancelled.", json_schema_extra={ "element_property": True, }, ) cancellationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_cancellationDate", title="Extension field for ``cancellationDate``.", ) cancellationReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="cancellationReason", title="The coded reason for the appointment being cancelled", description=( "The coded reason for the appointment being cancelled. This is often " "used in reporting/billing/futher processing to determine if further " "actions are required, or specific fees apply." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) class_fhir: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="class", title="Classification when becoming an encounter", description=( "Concepts representing classification of patient encounter such as " "ambulatory (outpatient), inpatient, emergency, home health or others " "due to local variations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="The date that this appointment was initially created", description=( "The date that this appointment was initially created. This could be " "different to the meta.lastModified value on the initial entry, as this" " could have been before the resource was created on the FHIR server, " "and should remain unchanged over the lifespan of the appointment." ), json_schema_extra={ "element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Shown on a subject line in a meeting request, or appointment list", description=( "The brief description of the appointment as would be shown on a " "subject line in a meeting request, or appointment list. Detailed or " "expanded information should be put in the note field." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) end: fhirtypes.InstantType | None = Field( default=None, alias="end", title="When appointment is to conclude", description="Date/Time that the appointment is to conclude.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_end", title="Extension field for ``end``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Ids for this item", description=( "This records identifiers associated with this appointment concern that" " are defined by business processes and/or used to refer to it when a " "direct URL reference to the resource itself is not appropriate (e.g. " "in CDA documents, or in written / printed documentation)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) minutesDuration: fhirtypes.PositiveIntType | None = Field( default=None, alias="minutesDuration", title="Can be less than start/end (e.g. estimate)", description=( "Number of minutes that the appointment is to take. This can be less " "than the duration between the start and end times. For example, where" " the actual time of appointment is only an estimate or if a 30 minute " "appointment is being requested, but any time would work. Also, if " "there is, for example, a planned 15 minute break in the middle of a " "long appointment, the duration may be 15 minutes less than the " "difference between the start and end." ), json_schema_extra={ "element_property": True, }, ) minutesDuration__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minutesDuration", title="Extension field for ``minutesDuration``.", ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Additional comments", description="Additional notes/comments about the appointment.", json_schema_extra={ "element_property": True, }, ) occurrenceChanged: bool | None = Field( default=None, alias="occurrenceChanged", title="Indicates that this appointment varies from a recurrence pattern", description="This appointment varies from the recurring pattern.", json_schema_extra={ "element_property": True, }, ) occurrenceChanged__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceChanged", title="Extension field for ``occurrenceChanged``.", ) originatingAppointment: fhirtypes.ReferenceType | None = Field( default=None, alias="originatingAppointment", title="The originating appointment in a recurring set of appointments", description=( "The originating appointment in a recurring set of related " "appointments." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Appointment"], }, ) participant: typing.List[fhirtypes.AppointmentParticipantType] = Field( default=..., alias="participant", title="Participants involved in appointment", description="List of participants involved in the appointment.", json_schema_extra={ "element_property": True, }, ) patientInstruction: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="patientInstruction", title="Detailed information and instructions for the patient", description=( "While Appointment.note contains information for internal use, " "Appointment.patientInstructions is used to capture patient facing " "information about the Appointment (e.g. please bring your referral or " "fast from 8pm night before)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference", "Binary", "Communication"], }, ) previousAppointment: fhirtypes.ReferenceType | None = Field( default=None, alias="previousAppointment", title="The previous appointment in a series", description="The previous appointment in a series of related appointments.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Appointment"], }, ) priority: fhirtypes.CodeableConceptType | None = Field( default=None, alias="priority", title="Used to make informed decisions if needing to re-prioritize", description=( "The priority of the appointment. Can be used to make informed " "decisions if needing to re-prioritize appointments. (The iCal Standard" " specifies 0 as undefined, 1 as highest, 9 as lowest priority)." ), json_schema_extra={ "element_property": True, }, ) reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="reason", title="Reason this appointment is scheduled", description=( "The reason that this appointment is being scheduled. This is more " "clinical than administrative. This can be coded, or as specified using" " information from another resource. When the patient arrives and the " "encounter begins it may be used as the admission diagnosis. The " "indication will typically be a Condition (with other resources " "referenced in the evidence.detail), or a Procedure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Procedure", "Observation", "ImmunizationRecommendation", ], }, ) recurrenceId: fhirtypes.PositiveIntType | None = Field( default=None, alias="recurrenceId", title="The sequence number in the recurrence", description=( "The sequence number that identifies a specific appointment in a " "recurring pattern." ), json_schema_extra={ "element_property": True, }, ) recurrenceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recurrenceId", title="Extension field for ``recurrenceId``.", ) recurrenceTemplate: typing.List[ fhirtypes.AppointmentRecurrenceTemplateType ] | None = Field( default=None, alias="recurrenceTemplate", title=( "Details of the recurrence pattern/template used to generate " "occurrences" ), description=( "The details of the recurrence pattern or template that is used to " "generate recurring appointments." ), json_schema_extra={ "element_property": True, }, ) replaces: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="replaces", title="Appointment replaced by this Appointment", description=( "Appointment replaced by this Appointment in cases where there is a " "cancellation, the details of the cancellation can be found in the " "cancellationReason property (on the referenced resource)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Appointment"], }, ) requestedPeriod: typing.List[fhirtypes.PeriodType] | None = Field( default=None, alias="requestedPeriod", title=( "Potential date/time interval(s) requested to allocate the appointment " "within" ), description=( "A set of date ranges (potentially including times) that the " "appointment is preferred to be scheduled within. The duration " "(usually in minutes) could also be provided to indicate the length of " "the appointment to fill and populate the start/end times for the " "actual allocated time. However, in other situations the duration may " "be calculated by the scheduling system." ), json_schema_extra={ "element_property": True, }, ) serviceCategory: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="serviceCategory", title=( "A broad categorization of the service that is to be performed during " "this appointment" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) serviceType: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="serviceType", title="The specific service that is to be performed during this appointment", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["HealthcareService"], }, ) slot: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="slot", title="The slots that this appointment is filling", description=( "The slots from the participants' schedules that will be filled by the " "appointment." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Slot"], }, ) specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialty", title=( "The specialty of a practitioner that would be required to perform the " "service requested in this appointment" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) start: fhirtypes.InstantType | None = Field( default=None, alias="start", title="When appointment is to take place", description="Date/Time that the appointment is to take place.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_start", title="Extension field for ``start``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "proposed | pending | booked | arrived | fulfilled | cancelled | noshow" " | entered-in-error | checked-in | waitlist" ), description=( "The overall status of the Appointment. Each of the participants has " "their own participation status which indicates their involvement in " "the process, however this status indicates the shared status." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "proposed", "pending", "booked", "arrived", "fulfilled", "cancelled", "noshow", "entered-in-error", "checked-in", "waitlist", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="The patient or group associated with the appointment", description=( "The patient or group associated with the appointment, if they are to " "be present (usually) then they should also be included in the " "participant backbone element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInformation", title="Additional information to support the appointment", description=( "Additional information to support the appointment provided when making" " the appointment." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) virtualService: typing.List[fhirtypes.VirtualServiceDetailType] | None = Field( default=None, alias="virtualService", title="Connection details of a virtual service (e.g. conference call)", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Appointment`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "cancellationReason", "class", "serviceCategory", "serviceType", "specialty", "appointmentType", "reason", "priority", "description", "replaces", "virtualService", "supportingInformation", "previousAppointment", "originatingAppointment", "start", "end", "minutesDuration", "requestedPeriod", "slot", "account", "created", "cancellationDate", "note", "patientInstruction", "basedOn", "subject", "participant", "recurrenceId", "occurrenceChanged", "recurrenceTemplate", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Appointment`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "cancellationReason", "class", "serviceCategory", "serviceType", "specialty", "appointmentType", "reason", "start", "end", "subject", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class AppointmentParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Participants involved in appointment. List of participants involved in the appointment. """ __resource_type__ = "AppointmentParticipant" actor: fhirtypes.ReferenceType | None = Field( default=None, alias="actor", title=( "The individual, device, location, or service participating in the " "appointment" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Group", "Practitioner", "PractitionerRole", "CareTeam", "RelatedPerson", "Device", "HealthcareService", "Location", ], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Participation period of the actor", description=None, json_schema_extra={ "element_property": True, }, ) required: bool | None = Field( default=None, alias="required", title="The participant is required to attend (optional when false)", description=( "Whether this participant is required to be present at the meeting. If " "false, the participant is optional." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) required__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_required", title="Extension field for ``required``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="accepted | declined | tentative | needs-action", description="Participation status of the actor.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["accepted", "declined", "tentative", "needs-action"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Role of participant in the appointment", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AppointmentParticipant`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "period", "actor", "required", "status", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AppointmentParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "actor", "required", "status"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class AppointmentRecurrenceTemplate(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details of the recurrence pattern/template used to generate occurrences. The details of the recurrence pattern or template that is used to generate recurring appointments. """ __resource_type__ = "AppointmentRecurrenceTemplate" excludingDate: typing.List[fhirtypes.DateType | None] | None = Field( default=None, alias="excludingDate", title="Any dates that should be excluded from the series", description=( "Any dates, such as holidays, that should be excluded from the " "recurrence." ), json_schema_extra={ "element_property": True, }, ) excludingDate__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_excludingDate", title="Extension field for ``excludingDate``.", ) excludingRecurrenceId: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="excludingRecurrenceId", title="Any recurrence IDs that should be excluded from the recurrence", description=( "Any dates, such as holidays, that should be excluded from the " "recurrence." ), json_schema_extra={ "element_property": True, }, ) excludingRecurrenceId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_excludingRecurrenceId", title="Extension field for ``excludingRecurrenceId``.", ) lastOccurrenceDate: fhirtypes.DateType | None = Field( default=None, alias="lastOccurrenceDate", title="The date when the recurrence should end", description="Recurring appointments will not occur after this date.", json_schema_extra={ "element_property": True, }, ) lastOccurrenceDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastOccurrenceDate", title="Extension field for ``lastOccurrenceDate``.", ) monthlyTemplate: fhirtypes.AppointmentRecurrenceTemplateMonthlyTemplateType | None = Field( default=None, alias="monthlyTemplate", title="Information about monthly recurring appointments", description=None, json_schema_extra={ "element_property": True, }, ) occurrenceCount: fhirtypes.PositiveIntType | None = Field( default=None, alias="occurrenceCount", title="The number of planned occurrences", description="How many appointments are planned in the recurrence.", json_schema_extra={ "element_property": True, }, ) occurrenceCount__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceCount", title="Extension field for ``occurrenceCount``.", ) occurrenceDate: typing.List[fhirtypes.DateType | None] | None = Field( default=None, alias="occurrenceDate", title="Specific dates for a recurring set of appointments (no template)", description="The list of specific dates that will have appointments generated.", json_schema_extra={ "element_property": True, }, ) occurrenceDate__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_occurrenceDate", title="Extension field for ``occurrenceDate``.", ) recurrenceType: fhirtypes.CodeableConceptType = Field( default=..., alias="recurrenceType", title="The frequency of the recurrence", description="How often the appointment series should recur.", json_schema_extra={ "element_property": True, }, ) timezone: fhirtypes.CodeableConceptType | None = Field( default=None, alias="timezone", title="The timezone of the occurrences", description="The timezone of the recurring appointment occurrences.", json_schema_extra={ "element_property": True, }, ) weeklyTemplate: fhirtypes.AppointmentRecurrenceTemplateWeeklyTemplateType | None = ( Field( default=None, alias="weeklyTemplate", title="Information about weekly recurring appointments", description=None, json_schema_extra={ "element_property": True, }, ) ) yearlyTemplate: fhirtypes.AppointmentRecurrenceTemplateYearlyTemplateType | None = ( Field( default=None, alias="yearlyTemplate", title="Information about yearly recurring appointments", description=None, json_schema_extra={ "element_property": True, }, ) ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AppointmentRecurrenceTemplate`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "timezone", "recurrenceType", "lastOccurrenceDate", "occurrenceCount", "occurrenceDate", "weeklyTemplate", "monthlyTemplate", "yearlyTemplate", "excludingDate", "excludingRecurrenceId", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AppointmentRecurrenceTemplate`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class AppointmentRecurrenceTemplateMonthlyTemplate(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about monthly recurring appointments. """ __resource_type__ = "AppointmentRecurrenceTemplateMonthlyTemplate" dayOfMonth: fhirtypes.PositiveIntType | None = Field( default=None, alias="dayOfMonth", title="Recurs on a specific day of the month", description=( "Indicates that appointments in the series of recurring appointments " "should occur on a specific day of the month." ), json_schema_extra={ "element_property": True, }, ) dayOfMonth__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dayOfMonth", title="Extension field for ``dayOfMonth``." ) dayOfWeek: fhirtypes.CodingType | None = Field( default=None, alias="dayOfWeek", title="Indicates which day of the week the appointment should occur", description=( "Indicates which day of the week the recurring appointments should " "occur each nth week." ), json_schema_extra={ "element_property": True, }, ) monthInterval: fhirtypes.PositiveIntType | None = Field( default=None, alias="monthInterval", title="Recurs every nth month", description="Indicates that recurring appointments should occur every nth month.", json_schema_extra={ "element_property": True, "element_required": True, }, ) monthInterval__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_monthInterval", title="Extension field for ``monthInterval``.", ) nthWeekOfMonth: fhirtypes.CodingType | None = Field( default=None, alias="nthWeekOfMonth", title="Indicates which week of the month the appointment should occur", description=( "Indicates which week within a month the appointments in the series of " "recurring appointments should occur on." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AppointmentRecurrenceTemplateMonthlyTemplate`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "dayOfMonth", "nthWeekOfMonth", "dayOfWeek", "monthInterval", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AppointmentRecurrenceTemplateMonthlyTemplate`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("monthInterval", "monthInterval__ext")] return required_fields class AppointmentRecurrenceTemplateWeeklyTemplate(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about weekly recurring appointments. """ __resource_type__ = "AppointmentRecurrenceTemplateWeeklyTemplate" friday: bool | None = Field( default=None, alias="friday", title="Recurs on Friday", description="Indicates that recurring appointments should occur on Fridays.", json_schema_extra={ "element_property": True, }, ) friday__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_friday", title="Extension field for ``friday``." ) monday: bool | None = Field( default=None, alias="monday", title="Recurs on Mondays", description="Indicates that recurring appointments should occur on Mondays.", json_schema_extra={ "element_property": True, }, ) monday__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_monday", title="Extension field for ``monday``." ) saturday: bool | None = Field( default=None, alias="saturday", title="Recurs on Saturday", description="Indicates that recurring appointments should occur on Saturdays.", json_schema_extra={ "element_property": True, }, ) saturday__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_saturday", title="Extension field for ``saturday``." ) sunday: bool | None = Field( default=None, alias="sunday", title="Recurs on Sunday", description="Indicates that recurring appointments should occur on Sundays.", json_schema_extra={ "element_property": True, }, ) sunday__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sunday", title="Extension field for ``sunday``." ) thursday: bool | None = Field( default=None, alias="thursday", title="Recurs on Thursday", description="Indicates that recurring appointments should occur on Thursdays.", json_schema_extra={ "element_property": True, }, ) thursday__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_thursday", title="Extension field for ``thursday``." ) tuesday: bool | None = Field( default=None, alias="tuesday", title="Recurs on Tuesday", description="Indicates that recurring appointments should occur on Tuesdays.", json_schema_extra={ "element_property": True, }, ) tuesday__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_tuesday", title="Extension field for ``tuesday``." ) wednesday: bool | None = Field( default=None, alias="wednesday", title="Recurs on Wednesday", description="Indicates that recurring appointments should occur on Wednesdays.", json_schema_extra={ "element_property": True, }, ) wednesday__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_wednesday", title="Extension field for ``wednesday``." ) weekInterval: fhirtypes.PositiveIntType | None = Field( default=None, alias="weekInterval", title="Recurs every nth week", description=( "The interval defines if the recurrence is every nth week. The default " "is every week, so it is expected that this value will be 2 or more. " "e.g. For recurring every second week this interval would be 2, or " "every third week the interval would be 3." ), json_schema_extra={ "element_property": True, }, ) weekInterval__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_weekInterval", title="Extension field for ``weekInterval``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AppointmentRecurrenceTemplateWeeklyTemplate`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday", "weekInterval", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AppointmentRecurrenceTemplateWeeklyTemplate`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class AppointmentRecurrenceTemplateYearlyTemplate(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about yearly recurring appointments. """ __resource_type__ = "AppointmentRecurrenceTemplateYearlyTemplate" yearInterval: fhirtypes.PositiveIntType | None = Field( default=None, alias="yearInterval", title="Recurs every nth year", description="Appointment recurs every nth year.", json_schema_extra={ "element_property": True, "element_required": True, }, ) yearInterval__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_yearInterval", title="Extension field for ``yearInterval``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AppointmentRecurrenceTemplateYearlyTemplate`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "yearInterval"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AppointmentRecurrenceTemplateYearlyTemplate`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("yearInterval", "yearInterval__ext")] return required_fields ================================================ FILE: fhir/resources/appointmentresponse.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/AppointmentResponse Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class AppointmentResponse(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection. """ __resource_type__ = "AppointmentResponse" actor: fhirtypes.ReferenceType | None = Field( default=None, alias="actor", title="Person(s), Location, HealthcareService, or Device", description=( "A Person, Location, HealthcareService, or Device that is participating" " in the appointment." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Group", "Practitioner", "PractitionerRole", "RelatedPerson", "Device", "HealthcareService", "Location", ], }, ) appointment: fhirtypes.ReferenceType = Field( default=..., alias="appointment", title="Appointment this response relates to", description="Appointment that this response is replying to.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Appointment"], }, ) comment: fhirtypes.MarkdownType | None = Field( default=None, alias="comment", title="Additional comments", description="Additional comments about the appointment.", json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) end: fhirtypes.InstantType | None = Field( default=None, alias="end", title="Time from appointment, or requested new end time", description=( "This may be either the same as the appointment request to confirm the " "details of the appointment, or alternately a new time to request a re-" "negotiation of the end time." ), json_schema_extra={ "element_property": True, }, ) end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_end", title="Extension field for ``end``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Ids for this item", description=( "This records identifiers associated with this appointment response " "concern that are defined by business processes and/ or used to refer " "to it when a direct URL reference to the resource itself is not " "appropriate." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) occurrenceDate: fhirtypes.DateType | None = Field( default=None, alias="occurrenceDate", title="Original date within a recurring request", description=( "The original date within a recurring request. This could be used in " "place of the recurrenceId to be more direct (or where the template is " "provided through the simple list of dates in " "`Appointment.occurrenceDate`)." ), json_schema_extra={ "element_property": True, }, ) occurrenceDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDate", title="Extension field for ``occurrenceDate``.", ) participantStatus: fhirtypes.CodeType | None = Field( default=None, alias="participantStatus", title="accepted | declined | tentative | needs-action | entered-in-error", description=( "Participation status of the participant. When the status is declined " "or tentative if the start/end times are different to the appointment, " "then these times should be interpreted as a requested time change. " "When the status is accepted, the times can either be the time of the " "appointment (as a confirmation of the time) or can be empty." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "accepted", "declined", "tentative", "needs-action", "entered-in-error", ], }, ) participantStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_participantStatus", title="Extension field for ``participantStatus``.", ) participantType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="participantType", title="Role of participant in the appointment", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) proposedNewTime: bool | None = Field( default=None, alias="proposedNewTime", title="Indicator for a counter proposal", description=( "Indicates that the response is proposing a different time that was " "initially requested. The new proposed time will be indicated in the " "start and end properties." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) proposedNewTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_proposedNewTime", title="Extension field for ``proposedNewTime``.", ) recurrenceId: fhirtypes.PositiveIntType | None = Field( default=None, alias="recurrenceId", title="The recurrence ID of the specific recurring request", description=( "The recurrence ID (sequence number) of the specific appointment when " "responding to a recurring request." ), json_schema_extra={ "element_property": True, }, ) recurrenceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recurrenceId", title="Extension field for ``recurrenceId``.", ) recurring: bool | None = Field( default=None, alias="recurring", title="This response is for all occurrences in a recurring request", description=( "Indicates that this AppointmentResponse applies to all occurrences in " "a recurring request." ), json_schema_extra={ "element_property": True, }, ) recurring__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recurring", title="Extension field for ``recurring``." ) start: fhirtypes.InstantType | None = Field( default=None, alias="start", title="Time from appointment, or requested new start time", description=( "Date/Time that the appointment is to take place, or requested new " "start time." ), json_schema_extra={ "element_property": True, }, ) start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_start", title="Extension field for ``start``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AppointmentResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "appointment", "proposedNewTime", "start", "end", "participantType", "actor", "participantStatus", "comment", "recurring", "occurrenceDate", "recurrenceId", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AppointmentResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "appointment", "proposedNewTime", "participantType", "actor", "participantStatus", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("participantStatus", "participantStatus__ext")] return required_fields ================================================ FILE: fhir/resources/artifactassessment.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ArtifactAssessment Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ArtifactAssessment(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Adds metadata-supported comments, classifiers or ratings related to a Resource. This Resource provides one or more comments, classifiers or ratings about a Resource and supports attribution and rights management metadata for the added content. """ __resource_type__ = "ArtifactAssessment" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the artifact assessment was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) artifactCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="artifactCanonical", title="The artifact assessed, commented upon or rated", description=( "A reference to a resource, canonical resource, or non-FHIR resource " "which the comment or assessment is about." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e artifact[x] "one_of_many": "artifact", "one_of_many_required": True, }, ) artifactCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_artifactCanonical", title="Extension field for ``artifactCanonical``.", ) artifactReference: fhirtypes.ReferenceType | None = Field( default=None, alias="artifactReference", title="The artifact assessed, commented upon or rated", description=( "A reference to a resource, canonical resource, or non-FHIR resource " "which the comment or assessment is about." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e artifact[x] "one_of_many": "artifact", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) artifactUri: fhirtypes.UriType | None = Field( default=None, alias="artifactUri", title="The artifact assessed, commented upon or rated", description=( "A reference to a resource, canonical resource, or non-FHIR resource " "which the comment or assessment is about." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e artifact[x] "one_of_many": "artifact", "one_of_many_required": True, }, ) artifactUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_artifactUri", title="Extension field for ``artifactUri``." ) citeAsMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="citeAsMarkdown", title="How to cite the comment or rating", description=( "Display of or reference to the bibliographic citation of the comment, " "classifier, or rating." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e citeAs[x] "one_of_many": "citeAs", "one_of_many_required": False, }, ) citeAsMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_citeAsMarkdown", title="Extension field for ``citeAsMarkdown``.", ) citeAsReference: fhirtypes.ReferenceType | None = Field( default=None, alias="citeAsReference", title="How to cite the comment or rating", description=( "Display of or reference to the bibliographic citation of the comment, " "classifier, or rating." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e citeAs[x] "one_of_many": "citeAs", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Citation"], }, ) content: typing.List[fhirtypes.ArtifactAssessmentContentType] | None = Field( default=None, alias="content", title="Comment, classifier, or rating content", description="A component comment, classifier, or rating of the artifact.", json_schema_extra={ "element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the artifact assessment and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the artifact assessment." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the artifact assessment was " "published. The date must change when the disposition changes and it " "must change if the workflow status code changes. In addition, it " "should change when the substantive content of the artifact assessment " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) disposition: fhirtypes.CodeType | None = Field( default=None, alias="disposition", title=( "unresolved | not-persuasive | persuasive | persuasive-with-" "modification | not-persuasive-with-modification" ), description=( "Indicates the disposition of the responsible party to the comment or " "change request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "unresolved", "not-persuasive", "persuasive", "persuasive-with-modification", "not-persuasive-with-modification", ], }, ) disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_disposition", title="Extension field for ``disposition``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the artifact assessment", description=( "A formal identifier that is used to identify this artifact assessment " "when it is represented in other formats, or referenced in a " "specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the artifact assessment was last reviewed by the publisher", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="A short title for the assessment for use in displaying and selecting", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) workflowStatus: fhirtypes.CodeType | None = Field( default=None, alias="workflowStatus", title=( "submitted | triaged | waiting-for-input | resolved-no-change | " "resolved-change-required | deferred | duplicate | applied | published " "| entered-in-error" ), description="Indicates the workflow status of the comment or change request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "submitted", "triaged", "waiting-for-input", "resolved-no-change", "resolved-change-required", "deferred", "duplicate", "applied", "published", "entered-in-error", ], }, ) workflowStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_workflowStatus", title="Extension field for ``workflowStatus``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ArtifactAssessment`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "title", "citeAsReference", "citeAsMarkdown", "date", "copyright", "approvalDate", "lastReviewDate", "artifactReference", "artifactCanonical", "artifactUri", "content", "workflowStatus", "disposition", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ArtifactAssessment`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "title", "date", "lastReviewDate", "artifactReference", "artifactCanonical", "artifactUri", "workflowStatus", "disposition", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "artifact": ["artifactCanonical", "artifactReference", "artifactUri"], "citeAs": ["citeAsMarkdown", "citeAsReference"], } return one_of_many_fields class ArtifactAssessmentContent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Comment, classifier, or rating content. A component comment, classifier, or rating of the artifact. """ __resource_type__ = "ArtifactAssessmentContent" author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="Who authored the content", description="Indicates who or what authored the content.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "Organization", "Device", ], }, ) classifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="classifier", title="Rating, classifier, or assessment", description="Represents a rating, classifier, or assessment of the artifact.", json_schema_extra={ "element_property": True, }, ) component: typing.List[fhirtypes.ArtifactAssessmentContentType] | None = Field( default=None, alias="component", title="Contained content", description="If the informationType is container, the components of the content.", json_schema_extra={ "element_property": True, }, ) freeToShare: bool | None = Field( default=None, alias="freeToShare", title="Acceptable to publicly share the resource content", description="Acceptable to publicly share the comment, classifier or rating.", json_schema_extra={ "element_property": True, }, ) freeToShare__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_freeToShare", title="Extension field for ``freeToShare``." ) informationType: fhirtypes.CodeType | None = Field( default=None, alias="informationType", title="comment | classifier | rating | container | response | change-request", description="The type of information this component of the content represents.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "comment", "classifier", "rating", "container", "response", "change-request", ], }, ) informationType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_informationType", title="Extension field for ``informationType``.", ) path: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="path", title="What the comment is directed to", description=( "A URI that points to what the comment is about, such as a line of text" " in the CQL, or a specific element in a resource." ), json_schema_extra={ "element_property": True, }, ) path__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Quantitative rating", description="A quantitative rating of the artifact.", json_schema_extra={ "element_property": True, }, ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Additional information", description=( "Additional related artifacts that provide supporting documentation, " "additional evidence, or further information related to the content." ), json_schema_extra={ "element_property": True, }, ) summary: fhirtypes.MarkdownType | None = Field( default=None, alias="summary", title="Brief summary of the content", description="A brief summary of the content of this component.", json_schema_extra={ "element_property": True, }, ) summary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_summary", title="Extension field for ``summary``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="What type of content", description="Indicates what type of content this component represents.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ArtifactAssessmentContent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "informationType", "summary", "type", "classifier", "quantity", "author", "path", "relatedArtifact", "freeToShare", "component", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ArtifactAssessmentContent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/attachment.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Attachment Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class Attachment(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Content in a format defined elsewhere. For referring to data content defined in other formats. """ __resource_type__ = "Attachment" contentType: fhirtypes.CodeType | None = Field( default=None, alias="contentType", title="Mime type of the content, with charset etc.", description=( "Identifies the type of the data in the attachment and allows a method " "to be chosen to interpret or render the data. Includes mime type " "parameters such as charset where appropriate." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contentType", title="Extension field for ``contentType``." ) creation: fhirtypes.DateTimeType | None = Field( default=None, alias="creation", title="Date attachment was first created", description="The date that the attachment was first created.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) creation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_creation", title="Extension field for ``creation``." ) data: fhirtypes.Base64BinaryType | None = Field( default=None, alias="data", title="Data inline, base64ed", description=( "The actual data of the attachment - a sequence of bytes, base64 " "encoded." ), json_schema_extra={ "element_property": True, }, ) data__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_data", title="Extension field for ``data``." ) duration: fhirtypes.DecimalType | None = Field( default=None, alias="duration", title="Length in seconds (audio / video)", description="The duration of the recording in seconds - for audio and video.", json_schema_extra={ "element_property": True, }, ) duration__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_duration", title="Extension field for ``duration``." ) frames: fhirtypes.PositiveIntType | None = Field( default=None, alias="frames", title="Number of frames if > 1 (photo)", description=( "The number of frames in a photo. This is used with a multi-page fax, " "or an imaging acquisition context that takes multiple slices in a " "single image, or an animated gif. If there is more than one frame, " "this SHALL have a value in order to alert interface software that a " "multi-frame capable rendering widget is required." ), json_schema_extra={ "element_property": True, }, ) frames__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_frames", title="Extension field for ``frames``." ) hash: fhirtypes.Base64BinaryType | None = Field( default=None, alias="hash", title="Hash of the data (sha-1, base64ed)", description="The calculated hash of the data using SHA-1. Represented using base64.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) hash__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_hash", title="Extension field for ``hash``." ) height: fhirtypes.PositiveIntType | None = Field( default=None, alias="height", title="Height of the image in pixels (photo/video)", description=None, json_schema_extra={ "element_property": True, }, ) height__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_height", title="Extension field for ``height``." ) language: fhirtypes.CodeType | None = Field( default=None, alias="language", title="Human language of the content (BCP-47)", description=( "The human language of the content. The value can be any valid value " "according to BCP 47." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) pages: fhirtypes.PositiveIntType | None = Field( default=None, alias="pages", title="Number of printed pages", description="The number of pages when printed.", json_schema_extra={ "element_property": True, }, ) pages__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_pages", title="Extension field for ``pages``." ) size: fhirtypes.Integer64Type | None = Field( default=None, alias="size", title="Number of bytes of content (if url provided)", description=( "The number of bytes of data that make up this attachment (before " "base64 encoding, if that is done)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) size__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_size", title="Extension field for ``size``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Label to display in place of the data", description="A label or set of text to display in place of the data.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UrlType | None = Field( default=None, alias="url", title="Uri where the data can be found", description="A location where the data can be accessed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) width: fhirtypes.PositiveIntType | None = Field( default=None, alias="width", title="Width of the image in pixels (photo/video)", description=None, json_schema_extra={ "element_property": True, }, ) width__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_width", title="Extension field for ``width``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Attachment`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "contentType", "language", "data", "url", "size", "hash", "title", "creation", "height", "width", "frames", "duration", "pages", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Attachment`` according to specification, with preserving the original sequence order. """ return ["contentType", "language", "url", "size", "hash", "title", "creation"] ================================================ FILE: fhir/resources/auditevent.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/AuditEvent Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class AuditEvent(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Record of an event. A record of an event relevant for purposes such as operations, privacy, security, maintenance, and performance analysis. """ __resource_type__ = "AuditEvent" action: fhirtypes.CodeType | None = Field( default=None, alias="action", title="Type of action performed during the event", description=( "Indicator for type of action performed during the event that generated" " the audit." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) action__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_action", title="Extension field for ``action``." ) agent: typing.List[fhirtypes.AuditEventAgentType] = Field( default=..., alias="agent", title="Actor involved in the event", description=( "An actor taking an active role in the event or activity that is " "logged." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authorization: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="authorization", title="Authorization related to the event", description=( "The authorization (e.g., PurposeOfUse) that was used during the event " "being recorded." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Workflow authorization within which this event occurred", description=( "Allows tracing of authorizatino for the events and tracking whether " "proposals/recommendations were acted upon." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CarePlan", "DeviceRequest", "ImmunizationRecommendation", "MedicationRequest", "NutritionOrder", "ServiceRequest", "Task", ], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Type/identifier of event", description="Classification of the type of event.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Specific type of event", description="Describes what happened. The most specific code for the event.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title=( "Encounter within which this event occurred or which the event is " "tightly associated" ), description=( "This will typically be the encounter the event occurred, but some " "events may be initiated prior to or after the official completion of " "an encounter but still be tied to the context of the encounter (e.g. " "pre-admission lab tests)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) entity: typing.List[fhirtypes.AuditEventEntityType] | None = Field( default=None, alias="entity", title="Data or objects used", description="Specific instances of data or objects that have been accessed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) occurredDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurredDateTime", title="When the activity occurred", description="The time or period during which the activity occurred.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e occurred[x] "one_of_many": "occurred", "one_of_many_required": False, }, ) occurredDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurredDateTime", title="Extension field for ``occurredDateTime``.", ) occurredPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurredPeriod", title="When the activity occurred", description="The time or period during which the activity occurred.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e occurred[x] "one_of_many": "occurred", "one_of_many_required": False, }, ) outcome: fhirtypes.AuditEventOutcomeType | None = Field( default=None, alias="outcome", title="Whether the event succeeded or failed", description=( "Indicates whether the event succeeded or failed. A free text " "descripiton can be given in outcome.text." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patient: fhirtypes.ReferenceType | None = Field( default=None, alias="patient", title=( "The patient is the subject of the data used/created/updated/deleted " "during the activity" ), description=( "The patient element is available to enable deterministic tracking of " "activities that involve the patient as the subject of the data used in" " an activity." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) recorded: fhirtypes.InstantType | None = Field( default=None, alias="recorded", title="Time when the event was recorded", description="The time when the event was recorded.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) recorded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recorded", title="Extension field for ``recorded``." ) severity: fhirtypes.CodeType | None = Field( default=None, alias="severity", title=( "emergency | alert | critical | error | warning | notice | " "informational | debug" ), description=( "Indicates and enables segmentation of various severity including " "debugging from critical." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "emergency", "alert", "critical", "error", "warning", "notice", "informational", "debug", ], }, ) severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_severity", title="Extension field for ``severity``." ) source: fhirtypes.AuditEventSourceType = Field( default=..., alias="source", title="Audit Event Reporter", description="The actor that is reporting the event.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AuditEvent`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "category", "code", "action", "severity", "occurredPeriod", "occurredDateTime", "recorded", "outcome", "authorization", "basedOn", "patient", "encounter", "agent", "source", "entity", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AuditEvent`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "category", "code", "action", "severity", "recorded", "outcome", "authorization", "agent", "source", "entity", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("recorded", "recorded__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"occurred": ["occurredDateTime", "occurredPeriod"]} return one_of_many_fields class AuditEventAgent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Actor involved in the event. An actor taking an active role in the event or activity that is logged. """ __resource_type__ = "AuditEventAgent" authorization: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="authorization", title="Allowable authorization for this agent", description=( "The authorization (e.g., PurposeOfUse) that was used during the event " "being recorded." ), json_schema_extra={ "element_property": True, }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="The agent location when the event occurred", description=( "Where the agent location is known, the agent location when the event " "occurred." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) networkReference: fhirtypes.ReferenceType | None = Field( default=None, alias="networkReference", title="This agent network location for the activity", description=( "When the event utilizes a network there should be an agent describing " "the local system, and an agent describing remote system, with the " "network interface details." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e network[x] "one_of_many": "network", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) networkString: fhirtypes.StringType | None = Field( default=None, alias="networkString", title="This agent network location for the activity", description=( "When the event utilizes a network there should be an agent describing " "the local system, and an agent describing remote system, with the " "network interface details." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e network[x] "one_of_many": "network", "one_of_many_required": False, }, ) networkString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_networkString", title="Extension field for ``networkString``.", ) networkUri: fhirtypes.UriType | None = Field( default=None, alias="networkUri", title="This agent network location for the activity", description=( "When the event utilizes a network there should be an agent describing " "the local system, and an agent describing remote system, with the " "network interface details." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e network[x] "one_of_many": "network", "one_of_many_required": False, }, ) networkUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_networkUri", title="Extension field for ``networkUri``." ) policy: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="policy", title="Policy that authorized the agent participation in the event", description=( "Where the policy(ies) are known that authorized the agent " "participation in the event. Typically, a single activity may have " "multiple applicable policies, such as patient consent, guarantor " "funding, etc. The policy would also indicate the security token used." ), json_schema_extra={ "element_property": True, }, ) policy__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_policy", title="Extension field for ``policy``." ) requestor: bool | None = Field( default=None, alias="requestor", title="Whether user is initiator", description=( "Indicator that the user is or is not the requestor, or initiator, for " "the event being audited." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) requestor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requestor", title="Extension field for ``requestor``." ) role: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="role", title="Agent role in the event", description=( "The structural roles of the agent indicating the agent's competency. " "The security role enabling the agent with respect to the activity." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="How agent participated", description="The Functional Role of the user when performing the event.", json_schema_extra={ "element_property": True, }, ) who: fhirtypes.ReferenceType = Field( default=..., alias="who", title="Identifier of who", description="Reference to who this agent is that was involved in the event.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", "Patient", "Device", "RelatedPerson", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AuditEventAgent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "role", "who", "requestor", "location", "policy", "networkReference", "networkUri", "networkString", "authorization", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AuditEventAgent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "who", "requestor"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "network": ["networkReference", "networkString", "networkUri"] } return one_of_many_fields class AuditEventEntity(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Data or objects used. Specific instances of data or objects that have been accessed. """ __resource_type__ = "AuditEventEntity" agent: typing.List[fhirtypes.AuditEventAgentType] | None = Field( default=None, alias="agent", title="Entity is attributed to this agent", description=( "The entity is attributed to an agent to express the agent's " "responsibility for that entity in the activity. This is most used to " "indicate when persistence media (the entity) are used by an agent. For" " example when importing data from a device, the device would be " "described in an entity, and the user importing data from that media " "would be indicated as the entity.agent." ), json_schema_extra={ "element_property": True, }, ) detail: typing.List[fhirtypes.AuditEventEntityDetailType] | None = Field( default=None, alias="detail", title="Additional Information about the entity", description=( "Tagged value pairs for conveying additional information about the " "entity." ), json_schema_extra={ "element_property": True, }, ) query: fhirtypes.Base64BinaryType | None = Field( default=None, alias="query", title="Query parameters", description="The query parameters for a query-type entities.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) query__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_query", title="Extension field for ``query``." ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="What role the entity played", description=( "Code representing the role the entity played in the event being " "audited." ), json_schema_extra={ "element_property": True, }, ) securityLabel: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="securityLabel", title="Security labels on the entity", description="Security labels for the identified entity.", json_schema_extra={ "element_property": True, }, ) what: fhirtypes.ReferenceType | None = Field( default=None, alias="what", title="Specific instance of resource", description=( "Identifies a specific instance of the entity. The reference should be " "version specific. This is allowed to be a Parameters resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AuditEventEntity`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "what", "role", "securityLabel", "query", "detail", "agent", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AuditEventEntity`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "what", "query"] class AuditEventEntityDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional Information about the entity. Tagged value pairs for conveying additional information about the entity. """ __resource_type__ = "AuditEventEntityDetail" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Name of the property", description="The type of extra detail provided in the value.", json_schema_extra={ "element_property": True, }, ) valueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="valueBase64Binary", title="Property value", description="The value of the extra detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBase64Binary", title="Extension field for ``valueBase64Binary``.", ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Property value", description="The value of the extra detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Property value", description="The value of the extra detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Property value", description="The value of the extra detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Property value", description="The value of the extra detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="Property value", description="The value of the extra detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Property value", description="The value of the extra detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Property value", description="The value of the extra detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="Property value", description="The value of the extra detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Property value", description="The value of the extra detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Property value", description="The value of the extra detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AuditEventEntityDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueQuantity", "valueCodeableConcept", "valueString", "valueBoolean", "valueInteger", "valueRange", "valueRatio", "valueTime", "valueDateTime", "valuePeriod", "valueBase64Binary", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AuditEventEntityDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBase64Binary", "valueBoolean", "valueCodeableConcept", "valueDateTime", "valueInteger", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueString", "valueTime", ] } return one_of_many_fields class AuditEventOutcome(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Whether the event succeeded or failed. Indicates whether the event succeeded or failed. A free text descripiton can be given in outcome.text. """ __resource_type__ = "AuditEventOutcome" code: fhirtypes.CodingType = Field( default=..., alias="code", title="Whether the event succeeded or failed", description="Indicates whether the event succeeded or failed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) detail: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="detail", title="Additional outcome detail", description=( "Additional details about the error. This may be a text description of " "the error or a system code that identifies the error." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AuditEventOutcome`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "detail"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AuditEventOutcome`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "detail"] class AuditEventSource(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Audit Event Reporter. The actor that is reporting the event. """ __resource_type__ = "AuditEventSource" observer: fhirtypes.ReferenceType = Field( default=..., alias="observer", title="The identity of source detecting the event", description="Identifier of the source where the event was detected.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", "Patient", "Device", "RelatedPerson", ], }, ) site: fhirtypes.ReferenceType | None = Field( default=None, alias="site", title="Logical source location within the enterprise", description=( "Logical source location within the healthcare enterprise network. For" " example, a hospital or other provider location within a multi-entity " "provider group." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="The type of source where event originated", description="Code specifying the type of source where event originated.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AuditEventSource`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "site", "observer", "type"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AuditEventSource`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "observer"] ================================================ FILE: fhir/resources/availability.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Availability Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, element, fhirtypes class Availability(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Availability data for an {item}. """ __resource_type__ = "Availability" availableTime: typing.List[fhirtypes.AvailabilityAvailableTimeType] | None = Field( default=None, alias="availableTime", title="Times the {item} is available", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) notAvailableTime: typing.List[ fhirtypes.AvailabilityNotAvailableTimeType ] | None = Field( default=None, alias="notAvailableTime", title="Not available during this time due to provided reason", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Availability`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "availableTime", "notAvailableTime"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Availability`` according to specification, with preserving the original sequence order. """ return ["availableTime", "notAvailableTime"] class AvailabilityAvailableTime(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Times the {item} is available. """ __resource_type__ = "AvailabilityAvailableTime" allDay: bool | None = Field( default=None, alias="allDay", title="Always available? i.e. 24 hour service", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) allDay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allDay", title="Extension field for ``allDay``." ) availableEndTime: fhirtypes.TimeType | None = Field( default=None, alias="availableEndTime", title="Closing time of day (ignored if allDay = true)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) availableEndTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_availableEndTime", title="Extension field for ``availableEndTime``.", ) availableStartTime: fhirtypes.TimeType | None = Field( default=None, alias="availableStartTime", title="Opening time of day (ignored if allDay = true)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) availableStartTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_availableStartTime", title="Extension field for ``availableStartTime``.", ) daysOfWeek: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="daysOfWeek", title="mon | tue | wed | thu | fri | sat | sun", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], }, ) daysOfWeek__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_daysOfWeek", title="Extension field for ``daysOfWeek``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AvailabilityAvailableTime`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "daysOfWeek", "allDay", "availableStartTime", "availableEndTime", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AvailabilityAvailableTime`` according to specification, with preserving the original sequence order. """ return ["daysOfWeek", "allDay", "availableStartTime", "availableEndTime"] class AvailabilityNotAvailableTime(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Not available during this time due to provided reason. """ __resource_type__ = "AvailabilityNotAvailableTime" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Reason presented to the user explaining why time not available", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) during: fhirtypes.PeriodType | None = Field( default=None, alias="during", title="Service not available during this period", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``AvailabilityNotAvailableTime`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "description", "during"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``AvailabilityNotAvailableTime`` according to specification, with preserving the original sequence order. """ return ["description", "during"] ================================================ FILE: fhir/resources/backboneelement.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/BackboneElement Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import element, fhirtypes class BackboneElement(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Base for elements defined inside a resource. Base definition for all elements that are defined inside a resource - but not those in a data type. """ __resource_type__ = "BackboneElement" modifierExtension: typing.List[fhirtypes.ExtensionType] | None = Field( default=None, alias="modifierExtension", title="Extensions that cannot be ignored even if unrecognized", description=( "May be used to represent additional information that is not part of " "the basic definition of the element and that modifies the " "understanding of the element in which it is contained and/or the " "understanding of the containing element's descendants. Usually " "modifier elements provide negation or qualification. To make the use " "of extensions safe and managable, there is a strict set of governance " "applied to the definition and use of extensions. Though any " "implementer can define an extension, there is a set of requirements " "that SHALL be met as part of the definition of the extension. " "Applications processing a resource are required to check for modifier " "extensions. Modifier extensions SHALL NOT change the meaning of any " "elements on Resource or DomainResource (including cannot change the " "meaning of modifierExtension itself)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BackboneElement`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BackboneElement`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/backbonetype.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/BackboneType Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class BackboneType(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Base for datatypes that can carry modifier extensions. Base definition for the few data types that are allowed to carry modifier extensions. """ __resource_type__ = "BackboneType" modifierExtension: typing.List[fhirtypes.ExtensionType] | None = Field( default=None, alias="modifierExtension", title="Extensions that cannot be ignored even if unrecognized", description=( "May be used to represent additional information that is not part of " "the basic definition of the element and that modifies the " "understanding of the element in which it is contained and/or the " "understanding of the containing element's descendants. Usually " "modifier elements provide negation or qualification. To make the use " "of extensions safe and managable, there is a strict set of governance " "applied to the definition and use of extensions. Though any " "implementer can define an extension, there is a set of requirements " "that SHALL be met as part of the definition of the extension. " "Applications processing a resource are required to check for modifier " "extensions. Modifier extensions SHALL NOT change the meaning of any " "elements on Resource or DomainResource (including cannot change the " "meaning of modifierExtension itself)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BackboneType`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BackboneType`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/base.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Base Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from fhir_core import fhirabstractmodel class Base(fhirabstractmodel.FHIRAbstractModel): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Base for all types and resources. Base definition for all types defined in FHIR type system. """ __resource_type__ = "Base" @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Base`` according to specification, with preserving the original sequence order. """ return [] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Base`` according to specification, with preserving the original sequence order. """ return [] ================================================ FILE: fhir/resources/basic.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Basic Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class Basic(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Resource for non-supported content. Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification. """ __resource_type__ = "Basic" author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="Who created", description="Indicates who was responsible for creating the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Patient", "RelatedPerson", "Organization", "Device", "CareTeam", ], }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Kind of Resource", description=( "Identifies the 'type' of resource - equivalent to the resource name " "for other resources." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="When created", description="Identifies when the resource was first created.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description=( "Identifier assigned to the resource for business purposes, outside the" " context of FHIR." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Identifies the focus of this resource", description=( "Identifies the patient, practitioner, device or any other resource " 'that is the "focus" of this resource.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Basic`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "code", "subject", "created", "author", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Basic`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "code", "subject", "created", "author", ] ================================================ FILE: fhir/resources/binary.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Binary Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import fhirtypes, resource class Binary(resource.Resource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Pure binary content defined by a format other than FHIR. A resource that represents the data of a single raw artifact as digital content accessible in its native format. A Binary resource can contain any content, whether text, image, pdf, zip archive, etc. """ __resource_type__ = "Binary" contentType: fhirtypes.CodeType | None = Field( default=None, alias="contentType", title="MimeType of the binary content", description=( "MimeType of the binary content represented as a standard MimeType (BCP" " 13)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contentType", title="Extension field for ``contentType``." ) data: fhirtypes.Base64BinaryType | None = Field( default=None, alias="data", title="The actual content", description="The actual content, base64 encoded.", json_schema_extra={ "element_property": True, }, ) data__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_data", title="Extension field for ``data``." ) securityContext: fhirtypes.ReferenceType | None = Field( default=None, alias="securityContext", title=( "Identifies another resource to use as proxy when enforcing access " "control" ), description=( "This element identifies another resource that can be used as a proxy " "of the security sensitivity to use when deciding and enforcing access " "control rules for the Binary resource. Given that the Binary resource " "contains very few elements that can be used to determine the " "sensitivity of the data and relationships to individuals, the " "referenced resource stands in as a proxy equivalent for this purpose. " "This referenced resource may be related to the Binary (e.g. " "DocumentReference), or may be some non-related Resource purely as a " "security proxy. E.g. to identify that the binary resource relates to a" " patient, and access should only be granted to applications that have " "access to the patient." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Binary`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "contentType", "securityContext", "data", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Binary`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "contentType", "securityContext"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("contentType", "contentType__ext")] return required_fields ================================================ FILE: fhir/resources/biologicallyderivedproduct.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/BiologicallyDerivedProduct Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class BiologicallyDerivedProduct(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. This resource reflects an instance of a biologically derived product. This resource reflects an instance of a biologically derived product. A material substance originating from a biological entity intended to be transplanted or infused into another (possibly the same) biological entity. """ __resource_type__ = "BiologicallyDerivedProduct" biologicalSourceEvent: fhirtypes.IdentifierType | None = Field( default=None, alias="biologicalSourceEvent", title=( "An identifier that supports traceability to the event during which " "material in this product from one or more biological entities was " "obtained or pooled" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) collection: fhirtypes.BiologicallyDerivedProductCollectionType | None = Field( default=None, alias="collection", title="How this product was collected", description=None, json_schema_extra={ "element_property": True, }, ) division: fhirtypes.StringType | None = Field( default=None, alias="division", title="A unique identifier for an aliquot of a product", description=( "A unique identifier for an aliquot of a product. Used to distinguish " "individual aliquots of a product carrying the same biologicalSource " "and productCode identifiers." ), json_schema_extra={ "element_property": True, }, ) division__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_division", title="Extension field for ``division``." ) expirationDate: fhirtypes.DateTimeType | None = Field( default=None, alias="expirationDate", title="Date, and where relevant time, of expiration", description=None, json_schema_extra={ "element_property": True, }, ) expirationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expirationDate", title="Extension field for ``expirationDate``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Instance identifier", description=( "Unique instance identifiers assigned to a biologically derived " "product. Note: This is a business identifier, not a resource " "identifier." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) parent: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="parent", title="The parent biologically-derived product", description="Parent product (if any) for this biologically-derived product.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["BiologicallyDerivedProduct"], }, ) processingFacility: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="processingFacility", title=( "Processing facilities responsible for the labeling and distribution of" " this biologically derived product" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) productCategory: fhirtypes.CodingType | None = Field( default=None, alias="productCategory", title="organ | tissue | fluid | cells | biologicalAgent", description="Broad category of this product.", json_schema_extra={ "element_property": True, }, ) productCode: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productCode", title="A code that identifies the kind of this biologically derived product", description=( "A codified value that systematically supports characterization and " "classification of medical products of human origin inclusive of " "processing conditions such as additives, volumes and handling " "conditions." ), json_schema_extra={ "element_property": True, }, ) productStatus: fhirtypes.CodingType | None = Field( default=None, alias="productStatus", title="available | unavailable", description="Whether the product is currently available.", json_schema_extra={ "element_property": True, }, ) property: typing.List[ fhirtypes.BiologicallyDerivedProductPropertyType ] | None = Field( default=None, alias="property", title=( "A property that is specific to this BiologicallyDerviedProduct " "instance" ), description=None, json_schema_extra={ "element_property": True, }, ) request: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="request", title="Request to obtain and/or infuse this product", description="Request to obtain and/or infuse this biologically derived product.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ServiceRequest"], }, ) storageTempRequirements: fhirtypes.RangeType | None = Field( default=None, alias="storageTempRequirements", title="Product storage temperature requirements", description=( "The temperature requirements for storage of the biologically-derived " "product." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BiologicallyDerivedProduct`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "productCategory", "productCode", "parent", "request", "identifier", "biologicalSourceEvent", "processingFacility", "division", "productStatus", "expirationDate", "collection", "storageTempRequirements", "property", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BiologicallyDerivedProduct`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "biologicalSourceEvent", ] class BiologicallyDerivedProductCollection(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. How this product was collected. """ __resource_type__ = "BiologicallyDerivedProductCollection" collectedDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="collectedDateTime", title="Time of product collection", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e collected[x] "one_of_many": "collected", "one_of_many_required": False, }, ) collectedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_collectedDateTime", title="Extension field for ``collectedDateTime``.", ) collectedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="collectedPeriod", title="Time of product collection", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e collected[x] "one_of_many": "collected", "one_of_many_required": False, }, ) collector: fhirtypes.ReferenceType | None = Field( default=None, alias="collector", title="Individual performing collection", description="Healthcare professional who is performing the collection.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) source: fhirtypes.ReferenceType | None = Field( default=None, alias="source", title=( "The patient who underwent the medical procedure to collect the product" " or the organization that facilitated the collection" ), description=( "The patient or entity, such as a hospital or vendor in the case of a " "processed/manipulated/manufactured product, providing the product." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Organization"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BiologicallyDerivedProductCollection`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "collector", "source", "collectedDateTime", "collectedPeriod", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BiologicallyDerivedProductCollection`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"collected": ["collectedDateTime", "collectedPeriod"]} return one_of_many_fields class BiologicallyDerivedProductProperty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A property that is specific to this BiologicallyDerviedProduct instance. """ __resource_type__ = "BiologicallyDerivedProductProperty" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Code that specifies the property", description=( "Code that specifies the property. It should reference an established " "coding system." ), json_schema_extra={ "element_property": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Property values", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Property values", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Property values", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Property values", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="Property values", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Property values", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Property values", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="Property values", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Property values", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BiologicallyDerivedProductProperty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueBoolean", "valueInteger", "valueCodeableConcept", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueString", "valueAttachment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BiologicallyDerivedProductProperty`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueBoolean", "valueCodeableConcept", "valueInteger", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueString", ] } return one_of_many_fields ================================================ FILE: fhir/resources/biologicallyderivedproductdispense.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/BiologicallyDerivedProductDispense Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class BiologicallyDerivedProductDispense(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A record of dispensation of a biologically derived product. This resource reflects an instance of a biologically derived product dispense. The supply or dispense of a biologically derived product from the supply organization or department (e.g. hospital transfusion laboratory) to the clinical team responsible for clinical application. """ __resource_type__ = "BiologicallyDerivedProductDispense" basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="The order or request that this dispense is fulfilling", description=( "The order or request that the dispense is fulfilling. This is a " "reference to a ServiceRequest resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ServiceRequest"], }, ) destination: fhirtypes.ReferenceType | None = Field( default=None, alias="destination", title="Where the product was dispatched to", description=( "Link to a resource identifying the physical location that the product " "was dispatched to." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier for this dispense", description=( "Unique instance identifiers assigned to a biologically derived product" " dispense. Note: This is a business identifier, not a resource " "identifier." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where the dispense occurred", description="The physical location where the dispense was performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) matchStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="matchStatus", title="Indicates the type of matching associated with the dispense", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Additional notes", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) originRelationshipType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="originRelationshipType", title="Relationship between the donor and intended recipient", description=( "Indicates the relationship between the donor of the biologically " "derived product and the intended recipient." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Short description", description="A larger event of which this particular event is a component.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["BiologicallyDerivedProductDispense"], }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="The intended recipient of the dispensed product", description=( "A link to a resource representing the patient that the product is " "dispensed for." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) performer: typing.List[ fhirtypes.BiologicallyDerivedProductDispensePerformerType ] | None = Field( default=None, alias="performer", title="Indicates who or what performed an action", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) preparedDate: fhirtypes.DateTimeType | None = Field( default=None, alias="preparedDate", title="When product was selected/matched", description="When the product was selected/ matched.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) preparedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preparedDate", title="Extension field for ``preparedDate``.", ) product: fhirtypes.ReferenceType = Field( default=..., alias="product", title="The BiologicallyDerivedProduct that is dispensed", description=( "A link to a resource identifying the biologically derived product that" " is being dispensed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["BiologicallyDerivedProduct"], }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Amount dispensed", description=( "The amount of product in the dispense. Quantity will depend on the " "product being dispensed. Examples are: volume; cell count; " "concentration." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "preparation | in-progress | allocated | issued | unfulfilled | " "returned | entered-in-error | unknown" ), description="A code specifying the state of the dispense event.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "preparation", "in-progress", "allocated", "issued", "unfulfilled", "returned", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) usageInstruction: fhirtypes.StringType | None = Field( default=None, alias="usageInstruction", title="Specific instructions for use", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) usageInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usageInstruction", title="Extension field for ``usageInstruction``.", ) whenHandedOver: fhirtypes.DateTimeType | None = Field( default=None, alias="whenHandedOver", title="When the product was dispatched", description="When the product was dispatched for clinical use.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) whenHandedOver__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_whenHandedOver", title="Extension field for ``whenHandedOver``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BiologicallyDerivedProductDispense`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "partOf", "status", "originRelationshipType", "product", "patient", "matchStatus", "performer", "location", "quantity", "preparedDate", "whenHandedOver", "destination", "note", "usageInstruction", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BiologicallyDerivedProductDispense`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "basedOn", "partOf", "status", "originRelationshipType", "product", "patient", "matchStatus", "performer", "location", "quantity", "preparedDate", "whenHandedOver", "destination", "note", "usageInstruction", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class BiologicallyDerivedProductDispensePerformer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Indicates who or what performed an action. """ __resource_type__ = "BiologicallyDerivedProductDispensePerformer" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Who performed the action", description="Identifies the person responsible for the action.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="Identifies the function of the performer during the dispense", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BiologicallyDerivedProductDispensePerformer`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "function", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BiologicallyDerivedProductDispensePerformer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "function", "actor"] ================================================ FILE: fhir/resources/bodystructure.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/BodyStructure Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class BodyStructure(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specific and identified anatomical structure. Record details about an anatomical structure. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. """ __resource_type__ = "BodyStructure" active: bool | None = Field( default=None, alias="active", title="Whether this record is in active use", description="Whether this body site is in active use.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Text description", description="A summary, characterization or explanation of the body structure.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) excludedStructure: typing.List[ fhirtypes.BodyStructureIncludedStructureType ] | None = Field( default=None, alias="excludedStructure", title="Excluded anatomic locations(s)", description=( "The anatomical location(s) or region(s) not occupied or represented by" " the specimen, lesion, or body structure." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Bodystructure identifier", description="Identifier for this instance of the anatomical structure.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) image: typing.List[fhirtypes.AttachmentType] | None = Field( default=None, alias="image", title="Attached images", description="Image or images used to identify a location.", json_schema_extra={ "element_property": True, }, ) includedStructure: typing.List[ fhirtypes.BodyStructureIncludedStructureType ] = Field( default=..., alias="includedStructure", title="Included anatomic location(s)", description=( "The anatomical location(s) or region(s) of the specimen, lesion, or " "body structure." ), json_schema_extra={ "element_property": True, }, ) morphology: fhirtypes.CodeableConceptType | None = Field( default=None, alias="morphology", title="Kind of Structure", description=( "The kind of structure being represented by the body structure at " "`BodyStructure.location`. This can define both normal and abnormal " "morphologies." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Who this is about", description="The person to which the body site belongs.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BodyStructure`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "morphology", "includedStructure", "excludedStructure", "description", "image", "patient", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BodyStructure`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "active", "morphology", "description", "patient", ] class BodyStructureIncludedStructure(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Included anatomic location(s). The anatomical location(s) or region(s) of the specimen, lesion, or body structure. """ __resource_type__ = "BodyStructureIncludedStructure" bodyLandmarkOrientation: typing.List[ fhirtypes.BodyStructureIncludedStructureBodyLandmarkOrientationType ] | None = Field( default=None, alias="bodyLandmarkOrientation", title="Landmark relative location", description=( "Body locations in relation to a specific body landmark (tatoo, scar, " "other body structure)." ), json_schema_extra={ "element_property": True, }, ) laterality: fhirtypes.CodeableConceptType | None = Field( default=None, alias="laterality", title="Code that represents the included structure laterality", description=None, json_schema_extra={ "element_property": True, }, ) qualifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="qualifier", title="Code that represents the included structure qualifier", description=None, json_schema_extra={ "element_property": True, }, ) spatialReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="spatialReference", title="Cartesian reference for structure", description="XY or XYZ-coordinate orientation for structure.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ImagingSelection"], }, ) structure: fhirtypes.CodeableConceptType = Field( default=..., alias="structure", title="Code that represents the included structure", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BodyStructureIncludedStructure`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "structure", "laterality", "bodyLandmarkOrientation", "spatialReference", "qualifier", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BodyStructureIncludedStructure`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "structure"] class BodyStructureIncludedStructureBodyLandmarkOrientation( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Landmark relative location. Body locations in relation to a specific body landmark (tatoo, scar, other body structure). """ __resource_type__ = "BodyStructureIncludedStructureBodyLandmarkOrientation" clockFacePosition: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="clockFacePosition", title="Clockface orientation", description=( "An description of the direction away from a landmark something is " "located based on a radial clock dial." ), json_schema_extra={ "element_property": True, }, ) distanceFromLandmark: typing.List[ fhirtypes.BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmarkType ] | None = Field( default=None, alias="distanceFromLandmark", title="Landmark relative location", description=( "The distance in centimeters a certain observation is made from a body " "landmark." ), json_schema_extra={ "element_property": True, }, ) landmarkDescription: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="landmarkDescription", title="Body ]andmark description", description=( "A description of a landmark on the body used as a reference to locate " "something else." ), json_schema_extra={ "element_property": True, }, ) surfaceOrientation: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="surfaceOrientation", title="Relative landmark surface orientation", description="The surface area a body location is in relation to a landmark.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BodyStructureIncludedStructureBodyLandmarkOrientation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "landmarkDescription", "clockFacePosition", "distanceFromLandmark", "surfaceOrientation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BodyStructureIncludedStructureBodyLandmarkOrientation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmark( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Landmark relative location. The distance in centimeters a certain observation is made from a body landmark. """ __resource_type__ = ( "BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmark" ) device: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="device", title="Measurement device", description="An instrument, tool, analyzer, etc. used in the measurement.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) value: typing.List[fhirtypes.QuantityType] | None = Field( default=None, alias="value", title="Measured distance from body landmark", description="The measured distance (e.g., in cm) from a body landmark.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmark`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "device", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmark`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/bundle.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Bundle Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, fhirtypes, resource class Bundle(resource.Resource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contains a collection of resources. A container for a collection of resources. """ __resource_type__ = "Bundle" entry: typing.List[fhirtypes.BundleEntryType] | None = Field( default=None, alias="entry", title="Entry in the bundle - will have a resource or information", description=( "An entry in a bundle resource - will either contain a resource or " "information about a resource (transactions and history only)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Persistent identifier for the bundle", description=( "A persistent identifier for the bundle that won't change as a bundle " "is copied from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issues: fhirtypes.ResourceType | None = Field( default=None, alias="issues", title="Issues with the Bundle", description=( "Captures issues and warnings that relate to the construction of the " "Bundle and the content within it." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) link: typing.List[fhirtypes.BundleLinkType] | None = Field( default=None, alias="link", title="Links related to this Bundle", description="A series of links that provide context to this bundle.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) signature: fhirtypes.SignatureType | None = Field( default=None, alias="signature", title="Digital Signature", description="Digital Signature - base64 encoded. XML-DSig or a JWS.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) timestamp: fhirtypes.InstantType | None = Field( default=None, alias="timestamp", title="When the bundle was assembled", description=( "The date/time that the bundle was assembled - i.e. when the resources " "were placed in the bundle." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) timestamp__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timestamp", title="Extension field for ``timestamp``." ) total: fhirtypes.UnsignedIntType | None = Field( default=None, alias="total", title="If search, the total number of matches", description=( "If a set of search matches, this is the (potentially estimated) total " "number of entries of type 'match' across all pages in the search. It " "does not include search.mode = 'include' or 'outcome' entries and it " "does not provide a count of the number of entries in the Bundle." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) total__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_total", title="Extension field for ``total``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "document | message | transaction | transaction-response | batch | " "batch-response | history | searchset | collection | subscription-" "notification" ), description="Indicates the purpose of this bundle - how it is intended to be used.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "document", "message", "transaction", "transaction-response", "batch", "batch-response", "history", "searchset", "collection", "subscription-notification", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Bundle`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "identifier", "type", "timestamp", "total", "link", "entry", "signature", "issues", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Bundle`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "identifier", "type", "timestamp", "total", "link", "entry", "signature", "issues", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields class BundleEntry(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Entry in the bundle - will have a resource or information. An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only). """ __resource_type__ = "BundleEntry" fullUrl: fhirtypes.UriType | None = Field( default=None, alias="fullUrl", title=( "URI for resource (e.g. the absolute URL server address, URI for " "UUID/OID, etc.)" ), description=( "The Absolute URL for the resource. Except for transactions and " "batches, each entry in a Bundle must have a fullUrl. The fullUrl SHALL" " NOT disagree with the id in the resource - i.e. if the fullUrl is not" " a urn:uuid, the URL shall be version-independent URL consistent with " "the Resource.id. The fullUrl is a version independent reference to the" " resource. Even when not required, fullUrl MAY be set to a urn:uuid to" " allow referencing entries in a transaction. The fullUrl can be an " "arbitrary URI and is not limited to urn:uuid, urn:oid, http, and " "https. The fullUrl element SHALL have a value except when: * invoking" " a create * invoking or responding to an operation where the body is " "not a single identified resource * invoking or returning the results " "of a search or history operation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) fullUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fullUrl", title="Extension field for ``fullUrl``." ) link: typing.List[fhirtypes.BundleLinkType] | None = Field( default=None, alias="link", title="Links related to this entry", description="A series of links that provide context to this entry.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) request: fhirtypes.BundleEntryRequestType | None = Field( default=None, alias="request", title="Additional execution information (transaction/batch/history)", description=( "Additional information about how this entry should be processed as " "part of a transaction or batch. For history, it shows how the entry " "was processed to create the version contained in the entry." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) resource: fhirtypes.ResourceType | None = Field( default=None, alias="resource", title="A resource in the bundle", description=( "The Resource for the entry. The purpose/meaning of the resource is " "determined by the Bundle.type. This is allowed to be a Parameters " "resource if and only if it is referenced by something else within the " "Bundle that provides context/meaning." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) response: fhirtypes.BundleEntryResponseType | None = Field( default=None, alias="response", title="Results of execution (transaction/batch/history)", description=( "Indicates the results of processing the corresponding 'request' entry " "in the batch or transaction being responded to or what the results of " "an operation where when returning history." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) search: fhirtypes.BundleEntrySearchType | None = Field( default=None, alias="search", title="Search related information", description=( "Information about the search process that lead to the creation of this" " entry." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BundleEntry`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "link", "fullUrl", "resource", "search", "request", "response", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BundleEntry`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "link", "fullUrl", "resource", "search", "request", "response", ] class BundleEntryRequest(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional execution information (transaction/batch/history). Additional information about how this entry should be processed as part of a transaction or batch. For history, it shows how the entry was processed to create the version contained in the entry. """ __resource_type__ = "BundleEntryRequest" ifMatch: fhirtypes.StringType | None = Field( default=None, alias="ifMatch", title="For managing update contention", description=( "Only perform the operation if the Etag value matches. For more " 'information, see the API section ["Managing Resource ' 'Contention"](http.html#concurrency).' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ifMatch__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_ifMatch", title="Extension field for ``ifMatch``." ) ifModifiedSince: fhirtypes.InstantType | None = Field( default=None, alias="ifModifiedSince", title="For managing cache currency", description=( "Only perform the operation if the last updated date matches. See the " 'API documentation for ["Conditional Read"](http.html#cread).' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ifModifiedSince__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_ifModifiedSince", title="Extension field for ``ifModifiedSince``.", ) ifNoneExist: fhirtypes.StringType | None = Field( default=None, alias="ifNoneExist", title="For conditional creates", description=( "Instruct the server not to perform the create if a specified resource " "already exists. For further information, see the API documentation for" ' ["Conditional Create"](http.html#ccreate). This is just the query ' 'portion of the URL - what follows the "?" (not including the "?").' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ifNoneExist__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_ifNoneExist", title="Extension field for ``ifNoneExist``." ) ifNoneMatch: fhirtypes.StringType | None = Field( default=None, alias="ifNoneMatch", title="For managing cache validation", description=( "If the ETag values match, return a 304 Not Modified status. See the " 'API documentation for ["Conditional Read"](http.html#cread).' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ifNoneMatch__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_ifNoneMatch", title="Extension field for ``ifNoneMatch``." ) method: fhirtypes.CodeType | None = Field( default=None, alias="method", title="GET | HEAD | POST | PUT | DELETE | PATCH", description=( "In a transaction or batch, this is the HTTP action to be executed for " "this entry. In a history bundle, this indicates the HTTP action that " "occurred." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["GET", "HEAD", "POST", "PUT", "DELETE", "PATCH"], }, ) method__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_method", title="Extension field for ``method``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="URL for HTTP equivalent of this entry", description=( "The URL for this entry, relative to the root (the address to which the" " request is posted)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BundleEntryRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "method", "url", "ifNoneMatch", "ifModifiedSince", "ifMatch", "ifNoneExist", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BundleEntryRequest`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "method", "url", "ifNoneMatch", "ifModifiedSince", "ifMatch", "ifNoneExist", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("method", "method__ext"), ("url", "url__ext")] return required_fields class BundleEntryResponse(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Results of execution (transaction/batch/history). Indicates the results of processing the corresponding 'request' entry in the batch or transaction being responded to or what the results of an operation where when returning history. """ __resource_type__ = "BundleEntryResponse" etag: fhirtypes.StringType | None = Field( default=None, alias="etag", title="The Etag for the resource (if relevant)", description=( "The Etag for the resource, if the operation for the entry produced a " "versioned resource (see [Resource Metadata and " "Versioning](http.html#versioning) and [Managing Resource " "Contention](http.html#concurrency))." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) etag__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_etag", title="Extension field for ``etag``." ) lastModified: fhirtypes.InstantType | None = Field( default=None, alias="lastModified", title="Server's date time modified", description="The date/time that the resource was modified on the server.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastModified__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastModified", title="Extension field for ``lastModified``.", ) location: fhirtypes.UriType | None = Field( default=None, alias="location", title="The location (if the operation returns a location)", description=( "The location header created by processing this operation, populated if" " the operation returns a location." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) location__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_location", title="Extension field for ``location``." ) outcome: fhirtypes.ResourceType | None = Field( default=None, alias="outcome", title="OperationOutcome with hints and warnings (for batch/transaction)", description=( "An OperationOutcome containing hints and warnings produced as part of " "processing this entry in a batch or transaction." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.StringType | None = Field( default=None, alias="status", title="Status response code (text optional)", description=( "The status code returned by processing this entry. The status SHALL " "start with a 3 digit HTTP code (e.g. 404) and may contain the standard" " HTTP description associated with the status code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BundleEntryResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "status", "location", "etag", "lastModified", "outcome", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BundleEntryResponse`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "status", "location", "etag", "lastModified", "outcome", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class BundleEntrySearch(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Search related information. Information about the search process that lead to the creation of this entry. """ __resource_type__ = "BundleEntrySearch" mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="match | include - why this is in the result set", description=( "Why this entry is in the result set - whether it's included as a match" " or because of an _include requirement, or to convey information or " "warning information about the search process." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["match", "include"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) score: fhirtypes.DecimalType | None = Field( default=None, alias="score", title="Search ranking (between 0 and 1)", description="When searching, the server's search ranking score for the entry.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) score__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_score", title="Extension field for ``score``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BundleEntrySearch`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "mode", "score"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BundleEntrySearch`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "mode", "score"] class BundleLink(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Links related to this Bundle. A series of links that provide context to this bundle. """ __resource_type__ = "BundleLink" relation: fhirtypes.CodeType | None = Field( default=None, alias="relation", title=( "See http://www.iana.org/assignments/link-relations/link-" "relations.xhtml#link-relations-1" ), description=( "A name which details the functional use for this link - see " "[http://www.iana.org/assignments/link-relations/link-" "relations.xhtml#link-" "relations-1](http://www.iana.org/assignments/link-relations/link-" "relations.xhtml#link-relations-1)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) relation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_relation", title="Extension field for ``relation``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Reference details for the link", description="The reference details for the link.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``BundleLink`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "relation", "url"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``BundleLink`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "relation", "url"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("relation", "relation__ext"), ("url", "url__ext")] return required_fields ================================================ FILE: fhir/resources/canonicalresource.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CanonicalResource Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class CanonicalResource(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Common Interface declaration for definitional resources. Common Interface declaration for conformance and knowledge artifact resources. """ __resource_type__ = "CanonicalResource" contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the {{title}} and/or its contents. " "Copyright statements are generally legal restrictions on the use and " "publishing of the {{title}}." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the {{title}} was last " "significantly changed. The date must change when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the {{title}} changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the {{title}}", description=( "A free text natural language description of the {{title}} from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this {{title}} is authored for " "testing purposes (or education/evaluation/marketing) and is not " "intended for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the {{title}}", description=( "A formal identifier that is used to identify this {{title}} when it is" " represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for {{title}} (if applicable)", description=( "A legal or geographic region in which the {{title}} is intended to be " "used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this {{title}} (computer friendly)", description=( "A natural language name identifying the {{title}}. This name should be" " usable as an identifier for the resource by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the {{title}}." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this {{title}} is defined", description=( "Explanation of why this {{title}} is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description="The current state of this {{title}}. ", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this {{title}} (human friendly)", description="A short, descriptive, user-friendly title for the {{title}}.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this {{title}}, represented as an absolute " "URI (globally unique)" ), description=( "An absolute URI that is used to identify this {{title}} when it is " "referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which an authoritative instance of this" " {{title}} is (or will be) published. This URL can be the target of a " "canonical reference. It SHALL remain the same when the {{title}} is " "stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate {{title}}s." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the {{title}}", description=( "The identifier that is used to identify this version of the {{title}} " "when it is referenced in a specification, model, design or instance. " "This is an arbitrary value managed by the {{title}} author and is not " "expected to be globally unique. For example, it might be a timestamp " "(e.g. yyyymmdd) if a managed version is not available. There is also " "no expectation that versions can be placed in a lexicographical " "sequence without additional knowledge. (See the versionAlgorithm " "element.)" ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CanonicalResource`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "copyrightLabel", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CanonicalResource`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields ================================================ FILE: fhir/resources/capabilitystatement.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CapabilityStatement Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class CapabilityStatement(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A statement of system capabilities. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server or Client for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. """ __resource_type__ = "CapabilityStatement" acceptLanguage: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="acceptLanguage", title="Languages supported", description=( "A list of the languages supported by this implementation that are " "usefully supported in the ```Accept-Language``` header." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) acceptLanguage__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_acceptLanguage", title="Extension field for ``acceptLanguage``.", ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the capability statement and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the capability statement." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the capability statement was last" " significantly changed. The date must change when the business version" " changes and it must change if the status code changes. In addition, " "it should change when the substantive content of the capability " "statement changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the capability statement", description=( "A free text natural language description of the capability statement " "from a consumer's perspective. Typically, this is used when the " "capability statement describes a desired rather than an actual " "solution, for example as a formal expression of requirements as part " "of an RFP." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) document: typing.List[fhirtypes.CapabilityStatementDocumentType] | None = Field( default=None, alias="document", title="Document definition", description="A document definition.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this capability statement is authored" " for testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) fhirVersion: fhirtypes.CodeType | None = Field( default=None, alias="fhirVersion", title="FHIR Version the system supports", description=( "The version of the FHIR specification that this CapabilityStatement " "describes (which SHALL be the same as the FHIR version of the " "CapabilityStatement itself). There is no default value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) fhirVersion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fhirVersion", title="Extension field for ``fhirVersion``." ) format: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="format", title="formats supported (xml | json | ttl | mime type)", description=( "A list of the formats supported by this implementation using their " "content types." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["formats", "json", "ttl", "mime"], }, ) format__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_format", title="Extension field for ``format``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title=( "Additional identifier for the CapabilityStatement (business " "identifier)" ), description=( "A formal identifier that is used to identify this CapabilityStatement " "when it is represented in other formats, or referenced in a " "specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) implementation: fhirtypes.CapabilityStatementImplementationType | None = Field( default=None, alias="implementation", title="If this describes a specific instance", description=( "Identifies a specific implementation instance that is described by the" " capability statement - i.e. a particular installation, rather than " "the capabilities of a software program." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) implementationGuide: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="implementationGuide", title="Implementation guides supported", description=( "A list of implementation guides that the server does (or should) " "support in their entirety." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ImplementationGuide"], }, ) implementationGuide__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_implementationGuide", title="Extension field for ``implementationGuide``.", ) imports: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="imports", title="Canonical URL of another capability statement this adds to", description=( "Reference to a canonical URL of another CapabilityStatement that this " "software adds to. The capability statement automatically includes " "everything in the other statement, and it is not duplicated, though " "the server may repeat the same resources, interactions and operations " "to add additional details to them." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CapabilityStatement"], }, ) imports__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_imports", title="Extension field for ``imports``." ) instantiates: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="instantiates", title="Canonical URL of another capability statement this implements", description=( "Reference to a canonical URL of another CapabilityStatement that this " "software implements. This capability statement is a published API " "description that corresponds to a business service. The server may " "actually implement a subset of the capability statement it claims to " "implement, so the capability statement must specify the full " "capability details." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CapabilityStatement"], }, ) instantiates__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiates", title="Extension field for ``instantiates``.", ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for capability statement (if applicable)", description=( "A legal or geographic region in which the capability statement is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title="instance | capability | requirements", description=( "The way that this statement is intended to be used, to describe an " "actual running instance of software, a particular product (kind, not " "instance of software) or a class of implementation (e.g. a desired " "purchase)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["instance", "capability", "requirements"], }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) messaging: typing.List[fhirtypes.CapabilityStatementMessagingType] | None = Field( default=None, alias="messaging", title="If messaging is supported", description="A description of the messaging capabilities of the solution.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this capability statement (computer friendly)", description=( "A natural language name identifying the capability statement. This " "name should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) patchFormat: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="patchFormat", title="Patch formats supported", description=( "A list of the patch formats supported by this implementation using " "their content types." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patchFormat__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_patchFormat", title="Extension field for ``patchFormat``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the capability statement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this capability statement is defined", description=( "Explanation of why this capability statement is needed and why it has " "been designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) rest: typing.List[fhirtypes.CapabilityStatementRestType] | None = Field( default=None, alias="rest", title="If the endpoint is a RESTful one", description="A definition of the restful capabilities of the solution, if any.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) software: fhirtypes.CapabilityStatementSoftwareType | None = Field( default=None, alias="software", title="Software that is covered by this capability statement", description=( "Software that is covered by this capability statement. It is used " "when the capability statement describes the capabilities of a " "particular software version, independent of an installation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this capability statement. Enables tracking the life-" "cycle of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this capability statement (human friendly)", description=( "A short, descriptive, user-friendly title for the capability " "statement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this capability statement, represented as a " "URI (globally unique)" ), description=( "An absolute URI that is used to identify this capability statement " "when it is referenced in a specification, model, design or an " "instance; also called its canonical identifier. This SHOULD be " "globally unique and SHOULD be a literal address at which an " "authoritative instance of this capability statement is (or will be) " "published. This URL can be the target of a canonical reference. It " "SHALL remain the same when the capability statement is stored on " "different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate capability statement instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the capability statement", description=( "The identifier that is used to identify this version of the capability" " statement when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the capability " "statement author and is not expected to be globally unique. For " "example, it might be a timestamp (e.g. yyyymmdd) if a managed version " "is not available. There is also no expectation that versions can be " "placed in a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatement`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "copyrightLabel", "kind", "instantiates", "imports", "software", "implementation", "fhirVersion", "format", "patchFormat", "acceptLanguage", "implementationGuide", "rest", "messaging", "document", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatement`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "kind", "instantiates", "imports", "software", "implementation", "fhirVersion", "format", "patchFormat", "acceptLanguage", "implementationGuide", "rest", "messaging", "document", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("date", "date__ext"), ("fhirVersion", "fhirVersion__ext"), ("format", "format__ext"), ("kind", "kind__ext"), ("status", "status__ext"), ] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields class CapabilityStatementDocument(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Document definition. A document definition. """ __resource_type__ = "CapabilityStatementDocument" documentation: fhirtypes.MarkdownType | None = Field( default=None, alias="documentation", title="Description of document support", description=( "A description of how the application supports or uses the specified " "document profile. For example, when documents are created, what " "action is taken with consumed documents, etc." ), json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="producer | consumer", description=( "Mode of this document declaration - whether an application is a " "producer or consumer." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["producer", "consumer"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) profile: fhirtypes.CanonicalType | None = Field( default=None, alias="profile", title="Constraint on the resources used in the document", description=( "A profile on the document Bundle that constrains which resources are " "present, and their contents." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementDocument`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "mode", "documentation", "profile", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementDocument`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "mode", "profile"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("mode", "mode__ext"), ("profile", "profile__ext")] return required_fields class CapabilityStatementImplementation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. If this describes a specific instance. Identifies a specific implementation instance that is described by the capability statement - i.e. a particular installation, rather than the capabilities of a software program. """ __resource_type__ = "CapabilityStatementImplementation" custodian: fhirtypes.ReferenceType | None = Field( default=None, alias="custodian", title="Organization that manages the data", description=( "The organization responsible for the management of the instance and " "oversight of the data on the server at the specified URL." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Describes this specific instance", description=( "Information about the specific installation that this capability " "statement relates to." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) url: fhirtypes.UrlType | None = Field( default=None, alias="url", title="Base URL for the installation", description=( "An absolute base URL for the implementation. This forms the base for " "REST interfaces as well as the mailbox and document interfaces." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementImplementation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "url", "custodian", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementImplementation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "description", "url", "custodian"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("description", "description__ext")] return required_fields class CapabilityStatementMessaging(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. If messaging is supported. A description of the messaging capabilities of the solution. """ __resource_type__ = "CapabilityStatementMessaging" documentation: fhirtypes.MarkdownType | None = Field( default=None, alias="documentation", title="Messaging interface behavior details", description=( "Documentation about the system's messaging capabilities for this " "endpoint not otherwise documented by the capability statement. For " "example, the process for becoming an authorized messaging exchange " "partner." ), json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) endpoint: typing.List[ fhirtypes.CapabilityStatementMessagingEndpointType ] | None = Field( default=None, alias="endpoint", title="Where messages should be sent", description=( "An endpoint (network accessible address) to which messages and/or " "replies are to be sent." ), json_schema_extra={ "element_property": True, }, ) reliableCache: fhirtypes.UnsignedIntType | None = Field( default=None, alias="reliableCache", title="Reliable Message Cache Length (min)", description=( "Length if the receiver's reliable messaging cache in minutes (if a " "receiver) or how long the cache length on the receiver should be (if a" " sender)." ), json_schema_extra={ "element_property": True, }, ) reliableCache__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reliableCache", title="Extension field for ``reliableCache``.", ) supportedMessage: typing.List[ fhirtypes.CapabilityStatementMessagingSupportedMessageType ] | None = Field( default=None, alias="supportedMessage", title="Messages supported by this system", description=( "References to message definitions for messages this system can send or" " receive." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementMessaging`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "endpoint", "reliableCache", "documentation", "supportedMessage", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementMessaging`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "supportedMessage"] class CapabilityStatementMessagingEndpoint(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Where messages should be sent. An endpoint (network accessible address) to which messages and/or replies are to be sent. """ __resource_type__ = "CapabilityStatementMessagingEndpoint" address: fhirtypes.UrlType | None = Field( default=None, alias="address", title="Network address or identifier of the end-point", description=( "The network address of the endpoint. For solutions that do not use " "network addresses for routing, it can be just an identifier." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) address__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_address", title="Extension field for ``address``." ) protocol: fhirtypes.CodingType = Field( default=..., alias="protocol", title="http | ftp | mllp +", description=( "A list of the messaging transport protocol(s) identifiers, supported " "by this endpoint." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementMessagingEndpoint`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "protocol", "address"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementMessagingEndpoint`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("address", "address__ext")] return required_fields class CapabilityStatementMessagingSupportedMessage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Messages supported by this system. References to message definitions for messages this system can send or receive. """ __resource_type__ = "CapabilityStatementMessagingSupportedMessage" definition: fhirtypes.CanonicalType | None = Field( default=None, alias="definition", title="Message supported by this system", description=( "Points to a message definition that identifies the messaging event, " "message structure, allowed responses, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MessageDefinition"], }, ) definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="sender | receiver", description=( "The mode of this event declaration - whether application is sender or " "receiver." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["sender", "receiver"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementMessagingSupportedMessage`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "mode", "definition"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementMessagingSupportedMessage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "mode", "definition"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("definition", "definition__ext"), ("mode", "mode__ext")] return required_fields class CapabilityStatementRest(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. If the endpoint is a RESTful one. A definition of the restful capabilities of the solution, if any. """ __resource_type__ = "CapabilityStatementRest" compartment: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="compartment", title="Compartments served/used by system", description=( "An absolute URI which is a reference to the definition of a " "compartment that the system supports. The reference is to a " "CompartmentDefinition resource by its canonical URL ." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CompartmentDefinition"], }, ) compartment__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_compartment", title="Extension field for ``compartment``." ) documentation: fhirtypes.MarkdownType | None = Field( default=None, alias="documentation", title="General description of implementation", description=( "Information about the system's restful capabilities that apply across " "all applications, such as security." ), json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) interaction: typing.List[ fhirtypes.CapabilityStatementRestInteractionType ] | None = Field( default=None, alias="interaction", title="What operations are supported?", description="A specification of restful operations supported by the system.", json_schema_extra={ "element_property": True, }, ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="client | server", description=( "Identifies whether this portion of the statement is describing the " "ability to initiate or receive restful operations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["client", "server"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) operation: typing.List[ fhirtypes.CapabilityStatementRestResourceOperationType ] | None = Field( default=None, alias="operation", title="Definition of a system level operation", description=( "Definition of an operation or a named query together with its " "parameters and their meaning and type." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) resource: typing.List[fhirtypes.CapabilityStatementRestResourceType] | None = Field( default=None, alias="resource", title="Resource served on the REST interface", description=( "A specification of the restful capabilities of the solution for a " "specific resource type." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) searchParam: typing.List[ fhirtypes.CapabilityStatementRestResourceSearchParamType ] | None = Field( default=None, alias="searchParam", title="Search parameters for searching all resources", description=( "Search parameters that are supported for searching all resources for " "implementations to support and/or make use of - either references to " "ones defined in the specification, or additional ones defined for/by " "the implementation. This is only for searches executed against the " "system-level endpoint." ), json_schema_extra={ "element_property": True, }, ) security: fhirtypes.CapabilityStatementRestSecurityType | None = Field( default=None, alias="security", title="Information about security of implementation", description=( "Information about security implementation from an interface " "perspective - what a client needs to know." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementRest`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "mode", "documentation", "security", "resource", "interaction", "searchParam", "operation", "compartment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementRest`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "mode", "security", "resource", "operation"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("mode", "mode__ext")] return required_fields class CapabilityStatementRestInteraction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What operations are supported?. A specification of restful operations supported by the system. """ __resource_type__ = "CapabilityStatementRestInteraction" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="transaction | batch | search-system | history-system", description="A coded identifier of the operation, supported by the system.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["transaction", "batch", "search-system", "history-system"], }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) documentation: fhirtypes.MarkdownType | None = Field( default=None, alias="documentation", title="Anything special about operation behavior", description=( "Guidance specific to the implementation of this operation, such as " "limitations on the kind of transactions allowed, or information about " "system wide search is implemented." ), json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementRestInteraction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "documentation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestInteraction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields class CapabilityStatementRestResource(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Resource served on the REST interface. A specification of the restful capabilities of the solution for a specific resource type. """ __resource_type__ = "CapabilityStatementRestResource" conditionalCreate: bool | None = Field( default=None, alias="conditionalCreate", title="If allows/uses conditional create", description="A flag that indicates that the server supports conditional create.", json_schema_extra={ "element_property": True, }, ) conditionalCreate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_conditionalCreate", title="Extension field for ``conditionalCreate``.", ) conditionalDelete: fhirtypes.CodeType | None = Field( default=None, alias="conditionalDelete", title=( "not-supported | single | multiple - how conditional delete is " "supported" ), description="A code that indicates how the server supports conditional delete.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["not-supported", "single", "multiple"], }, ) conditionalDelete__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_conditionalDelete", title="Extension field for ``conditionalDelete``.", ) conditionalPatch: bool | None = Field( default=None, alias="conditionalPatch", title="If allows/uses conditional patch", description="A flag that indicates that the server supports conditional patch.", json_schema_extra={ "element_property": True, }, ) conditionalPatch__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_conditionalPatch", title="Extension field for ``conditionalPatch``.", ) conditionalRead: fhirtypes.CodeType | None = Field( default=None, alias="conditionalRead", title="not-supported | modified-since | not-match | full-support", description="A code that indicates how the server supports conditional read.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "not-supported", "modified-since", "not-match", "full-support", ], }, ) conditionalRead__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_conditionalRead", title="Extension field for ``conditionalRead``.", ) conditionalUpdate: bool | None = Field( default=None, alias="conditionalUpdate", title="If allows/uses conditional update", description="A flag that indicates that the server supports conditional update.", json_schema_extra={ "element_property": True, }, ) conditionalUpdate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_conditionalUpdate", title="Extension field for ``conditionalUpdate``.", ) documentation: fhirtypes.MarkdownType | None = Field( default=None, alias="documentation", title="Additional information about the use of the resource type", description="Additional information about the resource type used by the system.", json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) interaction: typing.List[ fhirtypes.CapabilityStatementRestResourceInteractionType ] | None = Field( default=None, alias="interaction", title="What operations are supported?", description="Identifies a restful operation supported by the solution.", json_schema_extra={ "element_property": True, }, ) operation: typing.List[ fhirtypes.CapabilityStatementRestResourceOperationType ] | None = Field( default=None, alias="operation", title="Definition of a resource operation", description=( "Definition of an operation or a named query together with its " "parameters and their meaning and type. Consult the definition of the " "operation for details about how to invoke the operation, and the " "parameters." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) profile: fhirtypes.CanonicalType | None = Field( default=None, alias="profile", title="System-wide profile", description=( "A system-wide profile that is applied across *all* instances of the " "resource supported by the system. For example, if declared on " 'Observation, this profile is the "superset" of capabilities for ' "laboratory *and* vitals *and* other domains. See further discussion in" " [Using Profiles](profiling.html#profile-uses)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) readHistory: bool | None = Field( default=None, alias="readHistory", title="Whether vRead can return past versions", description=( "A flag for whether the server is able to return past versions as part " "of the vRead operation." ), json_schema_extra={ "element_property": True, }, ) readHistory__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_readHistory", title="Extension field for ``readHistory``." ) referencePolicy: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="referencePolicy", title="literal | logical | resolves | enforced | local", description="A set of flags that defines how references are supported.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["literal", "logical", "resolves", "enforced", "local"], }, ) referencePolicy__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_referencePolicy", title="Extension field for ``referencePolicy``.", ) searchInclude: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="searchInclude", title="_include values supported by the server", description="A list of _include values supported by the server.", json_schema_extra={ "element_property": True, }, ) searchInclude__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_searchInclude", title="Extension field for ``searchInclude``.", ) searchParam: typing.List[ fhirtypes.CapabilityStatementRestResourceSearchParamType ] | None = Field( default=None, alias="searchParam", title="Search parameters supported by implementation", description=( "Search parameters for implementations to support and/or make use of - " "either references to ones defined in the specification, or additional " "ones defined for/by the implementation." ), json_schema_extra={ "element_property": True, }, ) searchRevInclude: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="searchRevInclude", title="_revinclude values supported by the server", description=( "A list of _revinclude (reverse include) values supported by the " "server." ), json_schema_extra={ "element_property": True, }, ) searchRevInclude__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_searchRevInclude", title="Extension field for ``searchRevInclude``.", ) supportedProfile: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="supportedProfile", title="Use-case specific profiles", description=( "A list of profiles representing different use cases the system " "hosts/produces. A supported profile is a statement about the " "functionality of the data and services provided by the server (or the " "client) for supported use cases. For example, a system can define and " "declare multiple Observation profiles for laboratory observations, " "vital sign observations, etc. By declaring supported profiles, systems" " provide a way to determine whether individual resources are " "conformant. See further discussion in [Using " "Profiles](profiling.html#profile-uses)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) supportedProfile__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_supportedProfile", title="Extension field for ``supportedProfile``.", ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="A resource type that is supported", description="A type of resource exposed via the restful interface.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) updateCreate: bool | None = Field( default=None, alias="updateCreate", title="If update can commit to a new identity", description=( "A flag to indicate that the server allows or needs to allow the client" " to create new identities on the server (that is, the client PUTs to a" " location where there is no existing resource). Allowing this " "operation means that the server allows the client to create new " "identities on the server." ), json_schema_extra={ "element_property": True, }, ) updateCreate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_updateCreate", title="Extension field for ``updateCreate``.", ) versioning: fhirtypes.CodeType | None = Field( default=None, alias="versioning", title="no-version | versioned | versioned-update", description=( "This field is set to no-version to specify that the system does not " "support (server) or use (client) versioning for this resource type. If" " this has some other value, the server must at least correctly track " "and populate the versionId meta-property on resources. If the value is" " 'versioned-update', then the server supports all the versioning " "features, including using e-tags for version integrity in the API." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["no-version", "versioned", "versioned-update"], }, ) versioning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versioning", title="Extension field for ``versioning``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementRestResource`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "profile", "supportedProfile", "documentation", "interaction", "versioning", "readHistory", "updateCreate", "conditionalCreate", "conditionalRead", "conditionalUpdate", "conditionalPatch", "conditionalDelete", "referencePolicy", "searchInclude", "searchRevInclude", "searchParam", "operation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestResource`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "profile", "supportedProfile", "operation"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields class CapabilityStatementRestResourceInteraction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What operations are supported?. Identifies a restful operation supported by the solution. """ __resource_type__ = "CapabilityStatementRestResourceInteraction" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title=( "read | vread | update | patch | delete | history-instance | history-" "type | create | search-type" ), description="Coded identifier of the operation, supported by the system resource.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "read", "vread", "update", "patch", "delete", "history-instance", "history-type", "create", "search-type", ], }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) documentation: fhirtypes.MarkdownType | None = Field( default=None, alias="documentation", title="Anything special about operation behavior", description=( "Guidance specific to the implementation of this operation, such as " "'delete is a logical delete' or 'updates are only allowed with version" " id' or 'creates permitted from pre-authorized certificates only'." ), json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementRestResourceInteraction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "documentation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestResourceInteraction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields class CapabilityStatementRestResourceOperation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of a resource operation. Definition of an operation or a named query together with its parameters and their meaning and type. Consult the definition of the operation for details about how to invoke the operation, and the parameters. """ __resource_type__ = "CapabilityStatementRestResourceOperation" definition: fhirtypes.CanonicalType | None = Field( default=None, alias="definition", title="The defined operation/query", description=( "Where the formal definition can be found. If a server references the " "base definition of an Operation (i.e. from the specification itself " "such as ```http://hl7.org/fhir/OperationDefinition/ValueSet-" "expand```), that means it supports the full capabilities of the " "operation - e.g. both GET and POST invocation. If it only supports a " "subset, it must define its own custom " "[OperationDefinition](operationdefinition.html#) with a 'base' of the " "original OperationDefinition. The custom definition would describe " "the specific subset of functionality supported." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["OperationDefinition"], }, ) definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) documentation: fhirtypes.MarkdownType | None = Field( default=None, alias="documentation", title="Specific details about operation behavior", description=( "Documentation that describes anything special about the operation " "behavior, possibly detailing different behavior for system, type and " "instance-level invocation of the operation." ), json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name by which the operation/query is invoked", description=( "The name of the operation or query. For an operation, this name is " "prefixed with $ and used in the URL. For a query, this is the name " "used in the _query parameter when the query is called. This SHOULD be " "the same as the OperationDefinition.code of the defining " "OperationDefinition. However, it can sometimes differ if necessary to" " disambiguate when a server supports multiple OperationDefinition that" " happen to share the same code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementRestResourceOperation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "definition", "documentation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestResourceOperation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "name", "definition"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("definition", "definition__ext"), ("name", "name__ext")] return required_fields class CapabilityStatementRestResourceSearchParam(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Search parameters supported by implementation. Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation. """ __resource_type__ = "CapabilityStatementRestResourceSearchParam" definition: fhirtypes.CanonicalType | None = Field( default=None, alias="definition", title="Source of definition for parameter", description=( "An absolute URI that is a formal reference to where this parameter was" " first defined, so that a client can be confident of the meaning of " "the search parameter (a reference to " "[SearchParameter.url](searchparameter-" "definitions.html#SearchParameter.url)). This element SHALL be " "populated if the search parameter refers to a SearchParameter defined " "by the FHIR core specification or externally defined IGs." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SearchParameter"], }, ) definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) documentation: fhirtypes.MarkdownType | None = Field( default=None, alias="documentation", title="Server-specific usage", description=( "This allows documentation of any distinct behaviors about how the " "search parameter is used. For example, text matching algorithms." ), json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for parameter in search url", description=( "The label used for the search parameter in this particular system's " "API - i.e. the 'name' portion of the name-value pair that will appear " "as part of the search URL. This SHOULD be the same as the " "SearchParameter.code of the defining SearchParameter. However, it can" " sometimes differ if necessary to disambiguate when a server supports " "multiple SearchParameters that happen to share the same code." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "number | date | string | token | reference | composite | quantity | " "uri | special" ), description=( "The type of value a search parameter refers to, and how the content is" " interpreted." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "number", "date", "string", "token", "reference", "composite", "quantity", "uri", "special", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementRestResourceSearchParam`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "definition", "type", "documentation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestResourceSearchParam`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext"), ("type", "type__ext")] return required_fields class CapabilityStatementRestSecurity(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about security of implementation. Information about security implementation from an interface perspective - what a client needs to know. """ __resource_type__ = "CapabilityStatementRestSecurity" cors: bool | None = Field( default=None, alias="cors", title="Adds CORS Headers (http://enable-cors.org/)", description=( "Server adds CORS headers when responding to requests - this enables " "Javascript applications to use the server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) cors__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_cors", title="Extension field for ``cors``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="General description of how security works", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) service: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="service", title="OAuth | SMART-on-FHIR | NTLM | Basic | Kerberos | Certificates", description="Types of security services that are supported/required by the system.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementRestSecurity`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "cors", "service", "description", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestSecurity`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "cors", "service"] class CapabilityStatementSoftware(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Software that is covered by this capability statement. Software that is covered by this capability statement. It is used when the capability statement describes the capabilities of a particular software version, independent of an installation. """ __resource_type__ = "CapabilityStatementSoftware" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="A name the software is known by", description="Name the software is known by.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) releaseDate: fhirtypes.DateTimeType | None = Field( default=None, alias="releaseDate", title="Date this version was released", description="Date this version of the software was released.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) releaseDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_releaseDate", title="Extension field for ``releaseDate``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Version covered by this statement", description="The version identifier for the software covered by this statement.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CapabilityStatementSoftware`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "version", "releaseDate", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CapabilityStatementSoftware`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "name", "version", "releaseDate"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields ================================================ FILE: fhir/resources/careplan.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CarePlan Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class CarePlan(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Healthcare plan for patient or group. Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions. """ __resource_type__ = "CarePlan" activity: typing.List[fhirtypes.CarePlanActivityType] | None = Field( default=None, alias="activity", title="Action to occur or has occurred as part of plan", description=( "Identifies an action that has occurred or is a planned action to occur" " as part of the plan. For example, a medication to be used, lab tests " "to perform, self-monitoring that has occurred, education etc." ), json_schema_extra={ "element_property": True, }, ) addresses: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="addresses", title="Health issues this plan addresses", description=( "Identifies the conditions/problems/concerns/diagnoses/etc. whose " "management and/or mitigation are handled by this plan." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Fulfills plan, proposal or order", description=( "A higher-level request resource (i.e. a plan, proposal or order) that " "is fulfilled in whole or in part by this care plan." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CarePlan", "ServiceRequest", "RequestOrchestration", "NutritionOrder", ], }, ) careTeam: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="careTeam", title="Who's involved in plan?", description=( "Identifies all people and organizations who are expected to be " "involved in the care envisioned by this plan." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CareTeam"], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Type of plan", description=( 'Identifies what "kind" of plan this is to support differentiation ' 'between multiple co-existing plans; e.g. "Home health", "psychiatric",' ' "asthma", "disease management", "wellness plan", etc.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contributor: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="contributor", title="Who provided the content of the care plan", description=( "Identifies the individual(s), organization or device who provided the " "contents of the care plan." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "Device", "RelatedPerson", "Organization", "CareTeam", ], }, ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Date record was first recorded", description=( "Represents when this particular CarePlan record was created in the " "system, which is often a system-generated date." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) custodian: fhirtypes.ReferenceType | None = Field( default=None, alias="custodian", title="Who is the designated responsible party", description=( "When populated, the custodian is responsible for the care plan. The " "care plan is attributed to the custodian." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "Device", "RelatedPerson", "Organization", "CareTeam", ], }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Summary of nature of plan", description="A description of the scope and nature of the plan.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="The Encounter during which this CarePlan was created", description=( "The Encounter during which this CarePlan was created or to which the " "creation of this record is tightly associated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) goal: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="goal", title="Desired outcome of plan", description="Describes the intended objective(s) of carrying out the care plan.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Goal"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Ids for this plan", description=( "Business identifiers assigned to this care plan by the performer or " "other systems which remain constant as the resource is updated and " "propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="instantiatesCanonical", title="Instantiates FHIR protocol or definition", description=( "The URL pointing to a FHIR-defined protocol, guideline, questionnaire " "or other definition that is adhered to in whole or in part by this " "CarePlan." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "PlanDefinition", "Questionnaire", "Measure", "ActivityDefinition", "OperationDefinition", ], }, ) instantiatesCanonical__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="instantiatesUri", title="Instantiates external protocol or definition", description=( "The URL pointing to an externally maintained protocol, guideline, " "questionnaire or other definition that is adhered to in whole or in " "part by this CarePlan." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) intent: fhirtypes.CodeType | None = Field( default=None, alias="intent", title="proposal | plan | order | option | directive", description=( "Indicates the level of authority/intentionality associated with the " "care plan and where the care plan fits into the workflow chain." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["proposal", "plan", "order", "option", "directive"], }, ) intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intent", title="Extension field for ``intent``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments about the plan", description="General notes about the care plan not covered elsewhere.", json_schema_extra={ "element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced CarePlan", description=( "A larger care plan of which this particular care plan is a component " "or step." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CarePlan"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period plan covers", description=( "Indicates when the plan did (or is intended to) come into effect and " "end." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) replaces: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="replaces", title="CarePlan replaced by this CarePlan", description=( "Completed or terminated care plan whose function is taken by this new " "care plan." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CarePlan"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "draft | active | on-hold | revoked | completed | entered-in-error | " "unknown" ), description=( "Indicates whether the plan is currently being acted upon, represents " "future intentions or is now a historical record." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "draft", "active", "on-hold", "revoked", "completed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who the care plan is for", description=( "Identifies the patient or group whose intended care is described by " "the plan." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInfo", title="Information considered as part of plan", description=( "Identifies portions of the patient's record that specifically " "influenced the formation of the plan. These might include " "comorbidities, recent procedures, limitations, recent assessments, " "etc." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Human-friendly name for the care plan", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CarePlan`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "replaces", "partOf", "status", "intent", "category", "title", "description", "subject", "encounter", "period", "created", "custodian", "contributor", "careTeam", "addresses", "supportingInfo", "goal", "activity", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CarePlan`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "replaces", "partOf", "status", "intent", "category", "title", "description", "subject", "encounter", "period", "created", "custodian", "addresses", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("intent", "intent__ext"), ("status", "status__ext")] return required_fields class CarePlanActivity(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Action to occur or has occurred as part of plan. Identifies an action that has occurred or is a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring that has occurred, education etc. """ __resource_type__ = "CarePlanActivity" performedActivity: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="performedActivity", title=( "Results of the activity (concept, or Appointment, Encounter, " "Procedure, etc.)" ), description=( "Identifies the activity that was performed. For example, an activity " "could be patient education, exercise, or a medication administration. " 'The reference to an "event" resource, such as Procedure or Encounter ' "or Observation, represents the activity that was performed. The " "requested activity can be conveyed using the " "CarePlan.activity.plannedActivityReference (a reference to a \u201crequest\u201d" " resource)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) plannedActivityReference: fhirtypes.ReferenceType | None = Field( default=None, alias="plannedActivityReference", title="Activity that is intended to be part of the care plan", description=( "The details of the proposed activity represented in a specific " "resource." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Appointment", "CommunicationRequest", "DeviceRequest", "MedicationRequest", "NutritionOrder", "Task", "ServiceRequest", "VisionPrescription", "RequestOrchestration", "ImmunizationRecommendation", "SupplyRequest", ], }, ) progress: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="progress", title="Comments about the activity status/progress", description="Notes about the adherence/status/progress of the activity.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CarePlanActivity`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "performedActivity", "progress", "plannedActivityReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CarePlanActivity`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/careteam.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CareTeam Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class CareTeam(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Planned participants in the coordination and delivery of care. The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care. """ __resource_type__ = "CareTeam" category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Type of team", description=( "Identifies what kind of team. This is to support differentiation " "between multiple co-existing teams, such as care plan team, episode of" " care team, longitudinal care team." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Ids for this team", description=( "Business identifiers assigned to this care team by the performer or " "other systems which remain constant as the resource is updated and " "propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) managingOrganization: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="managingOrganization", title="Organization responsible for the care team", description="The organization responsible for the care team.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name of the team, such as crisis assessment team", description=( "A label for human use intended to distinguish like teams. E.g. the " '"red" vs. "green" trauma teams.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the CareTeam", description=None, json_schema_extra={ "element_property": True, }, ) participant: typing.List[fhirtypes.CareTeamParticipantType] | None = Field( default=None, alias="participant", title="Members of the team", description=( "Identifies all people and organizations who are expected to be " "involved in the care team." ), json_schema_extra={ "element_property": True, }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period team covers", description=( "Indicates when the team did (or is intended to) come into effect and " "end." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="reason", title="Why the care team exists", description="Describes why the care team exists.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="proposed | active | suspended | inactive | entered-in-error", description="Indicates the current state of the care team.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "proposed", "active", "suspended", "inactive", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Who care team is for", description=( "Identifies the patient or group whose intended care is handled by the " "team." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="A contact detail for the care team (that applies to all members)", description=( "A central contact detail for the care team (that applies to all " "members)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CareTeam`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "category", "name", "subject", "period", "participant", "reason", "managingOrganization", "telecom", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CareTeam`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "category", "name", "subject", "period", "managingOrganization", ] class CareTeamParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Members of the team. Identifies all people and organizations who are expected to be involved in the care team. """ __resource_type__ = "CareTeamParticipant" coveragePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="coveragePeriod", title="When the member is generally available within this care team", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e coverage[x] "one_of_many": "coverage", "one_of_many_required": False, }, ) coverageTiming: fhirtypes.TimingType | None = Field( default=None, alias="coverageTiming", title="When the member is generally available within this care team", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e coverage[x] "one_of_many": "coverage", "one_of_many_required": False, }, ) member: fhirtypes.ReferenceType | None = Field( default=None, alias="member", title="Who is involved", description=( "The specific person or organization who is participating/expected to " "participate in the care team." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "RelatedPerson", "Patient", "Organization", "CareTeam", ], }, ) onBehalfOf: fhirtypes.ReferenceType | None = Field( default=None, alias="onBehalfOf", title="Organization of the practitioner", description="The organization of the practitioner.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="Type of involvement", description=( "Indicates specific responsibility of an individual within the care " 'team, such as "Primary care physician", "Trained social worker ' 'counselor", "Caregiver", etc.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CareTeamParticipant`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "role", "member", "onBehalfOf", "coveragePeriod", "coverageTiming", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CareTeamParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "role", "member", "onBehalfOf"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"coverage": ["coveragePeriod", "coverageTiming"]} return one_of_many_fields ================================================ FILE: fhir/resources/chargeitem.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ChargeItem Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ChargeItem(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Item containing charge code(s) associated with the provision of healthcare provider products. The resource ChargeItem describes the provision of healthcare provider products for a certain patient, therefore referring not only to the product, but containing in addition details of the provision, like date, time, amounts and participating organizations and persons. Main Usage of the ChargeItem is to enable the billing process and internal cost allocation. """ __resource_type__ = "ChargeItem" account: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="account", title="Account to place this charge", description="Account into which this ChargeItems belongs.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Account"], }, ) bodysite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="bodysite", title="Anatomical location, if relevant", description="The anatomical location where the related service has been applied.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="A code that identifies the charge, like a billing code", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) costCenter: fhirtypes.ReferenceType | None = Field( default=None, alias="costCenter", title="Organization that has ownership of the (potential, future) revenue", description="The financial cost center permits the tracking of charge attribution.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) definitionCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="definitionCanonical", title="Resource defining the code of this ChargeItem", description=( "References the source of pricing information, rules of application for" " the code this ChargeItem uses." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ChargeItemDefinition"], }, ) definitionCanonical__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_definitionCanonical", title="Extension field for ``definitionCanonical``.", ) definitionUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="definitionUri", title="Defining information about the code of this charge item", description=( "References the (external) source of pricing information, rules of " "application for the code this ChargeItem uses." ), json_schema_extra={ "element_property": True, }, ) definitionUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_definitionUri", title="Extension field for ``definitionUri``.", ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter associated with this ChargeItem", description=( "This ChargeItem has the details of how the associated Encounter should" " be billed or otherwise be handled by finance systems." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) enteredDate: fhirtypes.DateTimeType | None = Field( default=None, alias="enteredDate", title="Date the charge item was entered", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) enteredDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_enteredDate", title="Extension field for ``enteredDate``." ) enterer: fhirtypes.ReferenceType | None = Field( default=None, alias="enterer", title="Individual who was entering", description="The device, practitioner, etc. who entered the charge item.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Patient", "Device", "RelatedPerson", ], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for item", description="Identifiers assigned to this event performer or other systems.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the ChargeItem", description=( "Comments made about the event by the performer, subject or other " "participants." ), json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When the charged service was applied", description="Date/time(s) or duration when the charged service was applied.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="When the charged service was applied", description="Date/time(s) or duration when the charged service was applied.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceTiming: fhirtypes.TimingType | None = Field( default=None, alias="occurrenceTiming", title="When the charged service was applied", description="Date/time(s) or duration when the charged service was applied.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) overrideReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="overrideReason", title="Reason for overriding the list price/factor", description=( "If the list price or the rule-based factor associated with the code is" " overridden, this attribute can capture a text to indicate the reason" " for this action." ), json_schema_extra={ "element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced ChargeItem", description=( "ChargeItems can be grouped to larger ChargeItems covering the whole " "set." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ChargeItem"], }, ) performer: typing.List[fhirtypes.ChargeItemPerformerType] | None = Field( default=None, alias="performer", title="Who performed charged service", description=( "Indicates who or what performed or participated in the charged " "service." ), json_schema_extra={ "element_property": True, }, ) performingOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="performingOrganization", title="Organization providing the charged service", description="The organization performing the service.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) product: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="product", title="Product charged", description=( "Identifies the device, food, drug or other product being charged " "either by type code or reference to an instance." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device", "Medication", "Substance"], }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Quantity of which the charge item has been serviced", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reason", title="Why was the charged service rendered?", description="Describes why the event occurred in coded or textual form.", json_schema_extra={ "element_property": True, }, ) requestingOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="requestingOrganization", title="Organization requesting the charged service", description="The organization requesting the service.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) service: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="service", title="Which rendered service is being charged?", description="Indicated the rendered service that caused this charge.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "DiagnosticReport", "ImagingStudy", "Immunization", "MedicationAdministration", "MedicationDispense", "MedicationRequest", "Observation", "Procedure", "ServiceRequest", "SupplyDelivery", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "planned | billable | not-billable | aborted | billed | entered-in-" "error | unknown" ), description="The current state of the ChargeItem.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "planned", "billable", "not-billable", "aborted", "billed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Individual service was done for/to", description=( "The individual or set of individuals the action is being or was " "performed on." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInformation", title="Further information supporting this charge", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) totalPriceComponent: fhirtypes.MonetaryComponentType | None = Field( default=None, alias="totalPriceComponent", title="Total price overriding the associated rules", description="The total price for the chargable item, accounting for the quantity.", json_schema_extra={ "element_property": True, }, ) unitPriceComponent: fhirtypes.MonetaryComponentType | None = Field( default=None, alias="unitPriceComponent", title="Unit price overriding the associated rules", description="The unit price of the chargable item.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ChargeItem`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "definitionUri", "definitionCanonical", "status", "partOf", "code", "subject", "encounter", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "performer", "performingOrganization", "requestingOrganization", "costCenter", "quantity", "bodysite", "unitPriceComponent", "totalPriceComponent", "overrideReason", "enterer", "enteredDate", "reason", "service", "product", "account", "note", "supportingInformation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ChargeItem`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "code", "subject", "encounter", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "quantity", "bodysite", "enterer", "enteredDate", "account", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "occurrence": ["occurrenceDateTime", "occurrencePeriod", "occurrenceTiming"] } return one_of_many_fields class ChargeItemPerformer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who performed charged service. Indicates who or what performed or participated in the charged service. """ __resource_type__ = "ChargeItemPerformer" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Individual who was performing", description=( "The device, practitioner, etc. who performed or participated in the " "service." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "HealthcareService", "CareTeam", "Patient", "Device", "RelatedPerson", ], }, ) function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="What type of performance was done", description=( "Describes the type of performance or participation(e.g. primary " "surgeon, anesthesiologiest, etc.)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ChargeItemPerformer`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "function", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ChargeItemPerformer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/chargeitemdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ChargeItemDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ChargeItemDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of properties and rules about how the price and the applicability of a ChargeItem can be determined. The ChargeItemDefinition resource provides the properties that apply to the (billing) codes necessary to calculate costs and prices. The properties may differ largely depending on type and realm, therefore this resource gives only a rough structure and requires profiling for each type of billing code system. """ __resource_type__ = "ChargeItemDefinition" applicability: typing.List[ fhirtypes.ChargeItemDefinitionApplicabilityType ] | None = Field( default=None, alias="applicability", title="Whether or not the billing code is applicable", description="Expressions that describe applicability criteria for the billing code.", json_schema_extra={ "element_property": True, }, ) approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the charge item definition was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Billing code or product type this definition applies to", description=( "The defined billing details in this resource pertain to the given " "billing code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the charge item definition and/or " "its contents. Copyright statements are generally legal restrictions on" " the use and publishing of the charge item definition." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the charge item definition was " "last significantly changed. The date must change when the business " "version changes and it must change if the status code changes. In " "addition, it should change when the substantive content of the charge " "item definition changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) derivedFromUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="derivedFromUri", title="Underlying externally-defined charge item definition", description=( "The URL pointing to an externally-defined charge item definition that " "is adhered to in whole or in part by this definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) derivedFromUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_derivedFromUri", title="Extension field for ``derivedFromUri``.", ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the charge item definition", description=( "A free text natural language description of the charge item definition" " from a consumer's perspective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this charge item definition is " "authored for testing purposes (or education/evaluation/marketing) and " "is not intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the charge item definition", description=( "A formal identifier that is used to identify this charge item " "definition when it is represented in other formats, or referenced in a" " specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instance: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="instance", title="Instances this definition applies to", description=( "The defined billing details in this resource pertain to the given " "product instance(s)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Medication", "Substance", "Device", "DeviceDefinition", "ActivityDefinition", "PlanDefinition", "HealthcareService", ], }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for charge item definition (if applicable)", description=( "A legal or geographic region in which the charge item definition is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the charge item definition was last reviewed by the publisher", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this charge item definition (computer friendly)", description=( "A natural language name identifying the ChargeItemDefinition. This " "name should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) partOf: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="partOf", title=( "A larger definition of which this particular definition is a component" " or step" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ChargeItemDefinition"], }, ) partOf__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_partOf", title="Extension field for ``partOf``." ) propertyGroup: typing.List[ fhirtypes.ChargeItemDefinitionPropertyGroupType ] | None = Field( default=None, alias="propertyGroup", title="Group of properties which are applicable under the same conditions", description=( "Group of properties which are applicable under the same conditions. If" " no applicability rules are established for the group, then all " "properties always apply." ), json_schema_extra={ "element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the charge item definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this charge item definition is defined", description=( "Explanation of why this charge item definition is needed and why it " "has been designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) replaces: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="replaces", title=( "Completed or terminated request(s) whose function is taken by this new" " request" ), description=( "As new versions of a protocol or guideline are defined, allows " "identification of what versions are replaced by a new instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ChargeItemDefinition"], }, ) replaces__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_replaces", title="Extension field for ``replaces``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description="The current state of the ChargeItemDefinition.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this charge item definition (human friendly)", description=( "A short, descriptive, user-friendly title for the charge item " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this charge item definition, represented as a" " URI (globally unique)" ), description=( "An absolute URI that is used to identify this charge item definition " "when it is referenced in a specification, model, design or an " "instance; also called its canonical identifier. This SHOULD be " "globally unique and SHOULD be a literal address at which an " "authoritative instance of this charge item definition is (or will be) " "published. This URL can be the target of a canonical reference. It " "SHALL remain the same when the charge item definition is stored on " "different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate charge item definition " "instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the charge item definition", description=( "The identifier that is used to identify this version of the charge " "item definition when it is referenced in a specification, model, " "design or instance. This is an arbitrary value managed by the charge " "item definition author and is not expected to be globally unique. For " "example, it might be a timestamp (e.g. yyyymmdd) if a managed version " "is not available. There is also no expectation that versions can be " "placed in a lexicographical sequence. To provide a version consistent " "with the Decision Support Service specification, use the format " "Major.Minor.Revision (e.g. 1.0.0). For more information on versioning " "knowledge assets, refer to the Decision Support Service specification." " Note that a version is required for non-experimental active assets." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ChargeItemDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "derivedFromUri", "partOf", "replaces", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "copyrightLabel", "approvalDate", "lastReviewDate", "code", "instance", "applicability", "propertyGroup", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ChargeItemDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "derivedFromUri", "partOf", "replaces", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "code", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields class ChargeItemDefinitionApplicability(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Whether or not the billing code is applicable. Expressions that describe applicability criteria for the billing code. """ __resource_type__ = "ChargeItemDefinitionApplicability" condition: fhirtypes.ExpressionType | None = Field( default=None, alias="condition", title="Boolean-valued expression", description=( "An expression that returns true or false, indicating whether the " "condition is satisfied. When using FHIRPath expressions, the %context " "environment variable must be replaced at runtime with the ChargeItem " "resource to which this definition is applied." ), json_schema_extra={ "element_property": True, }, ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the charge item definition is expected to be used", description=( "The period during which the charge item definition content was or is " "planned to be in active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) relatedArtifact: fhirtypes.RelatedArtifactType | None = Field( default=None, alias="relatedArtifact", title=( "Reference to / quotation of the external source of the group of " "properties" ), description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ChargeItemDefinitionApplicability`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "condition", "effectivePeriod", "relatedArtifact", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ChargeItemDefinitionApplicability`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "effectivePeriod"] class ChargeItemDefinitionPropertyGroup(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Group of properties which are applicable under the same conditions. Group of properties which are applicable under the same conditions. If no applicability rules are established for the group, then all properties always apply. """ __resource_type__ = "ChargeItemDefinitionPropertyGroup" applicability: typing.List[ fhirtypes.ChargeItemDefinitionApplicabilityType ] | None = Field( default=None, alias="applicability", title="Conditions under which the priceComponent is applicable", description=( "Expressions that describe applicability criteria for the " "priceComponent." ), json_schema_extra={ "element_property": True, }, ) priceComponent: typing.List[fhirtypes.MonetaryComponentType] | None = Field( default=None, alias="priceComponent", title="Components of total line item price", description=( "The price for a ChargeItem may be calculated as a base price with " "surcharges/deductions that apply in certain conditions. A " "ChargeItemDefinition resource that defines the prices, factors and " "conditions that apply to a billing code is currently under " "development. The priceComponent element can be used to offer " "transparency to the recipient of the Invoice of how the prices have " "been calculated." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ChargeItemDefinitionPropertyGroup`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "applicability", "priceComponent", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ChargeItemDefinitionPropertyGroup`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/citation.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Citation Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Citation(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A description of identification, location, or contributorship of a publication (article or artifact). The Citation Resource enables reference to any knowledge artifact for purposes of identification and attribution. The Citation Resource supports existing reference structures and developing publication practices such as versioning, expressing complex contributorship roles, and referencing computable resources. """ __resource_type__ = "Citation" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the citation record was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the citation record", description="Who authored or created the citation record.", json_schema_extra={ "element_property": True, }, ) citedArtifact: fhirtypes.CitationCitedArtifactType | None = Field( default=None, alias="citedArtifact", title="The article or artifact being described", description=None, json_schema_extra={ "element_property": True, }, ) classification: typing.List[fhirtypes.CitationClassificationType] | None = Field( default=None, alias="classification", title="The assignment to an organizing scheme", description=None, json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher of the citation record", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title=( "Use and/or publishing restrictions for the citation record, not for " "the cited artifact" ), description=None, json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title=( "Copyright holder and year(s) for the ciation record, not for the cited" " artifact" ), description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) currentState: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="currentState", title="The status of the citation record", description=None, json_schema_extra={ "element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the citation record was last " "significantly changed. The date must change when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the citation record " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the citation", description=( "A free text natural language description of the citation from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the citation record", description="Who edited or revised the citation record.", json_schema_extra={ "element_property": True, }, ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the citation record is expected to be used", description=( "The period during which the citation record content was or is planned " "to be in active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the citation record", description=None, json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this citation record is authored for " "testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifier for the citation record itself", description=( "A formal identifier that is used to identify this citation record when" " it is represented in other formats, or referenced in a specification," " model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for citation record (if applicable)", description=( "A legal or geographic region in which the citation record is intended " "to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the citation record was last reviewed by the publisher", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this citation record (computer friendly)", description=( "A natural language name identifying the citation record. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Used for general notes and annotations not coded elsewhere", description=None, json_schema_extra={ "element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title=( "The publisher of the citation record, not the publisher of the article" " or artifact being cited" ), description=( "The name of the organization or individual that published the citation" " record." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this citation is defined", description=( "Explanation of why this citation is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Artifact related to the citation record", description=None, json_schema_extra={ "element_property": True, }, ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the citation record", description=None, json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this summary. Enables tracking the life-cycle of the " "content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusDate: typing.List[fhirtypes.CitationStatusDateType] | None = Field( default=None, alias="statusDate", title="An effective date or period for a status of the citation record", description=( "The state or status of the citation record paired with an effective " "date or period for that state." ), json_schema_extra={ "element_property": True, }, ) summary: typing.List[fhirtypes.CitationSummaryType] | None = Field( default=None, alias="summary", title="A human-readable display of key concepts to represent the citation", description=None, json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this citation record (human friendly)", description="A short, descriptive, user-friendly title for the citation record.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this citation record, represented as a " "globally unique URI" ), description=( "An absolute URI that is used to identify this citation record when it " "is referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which an authoritative instance of this" " summary is (or will be) published. This URL can be the target of a " "canonical reference. It SHALL remain the same when the summary is " "stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the citation record content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate citation record instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the citation record", description=( "The identifier that is used to identify this version of the citation " "record when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the citation record " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Citation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "copyrightLabel", "approvalDate", "lastReviewDate", "effectivePeriod", "author", "editor", "reviewer", "endorser", "summary", "classification", "note", "currentState", "statusDate", "relatedArtifact", "citedArtifact", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Citation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "effectivePeriod", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields class CitationCitedArtifact(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The article or artifact being described. """ __resource_type__ = "CitationCitedArtifact" abstract: typing.List[fhirtypes.CitationCitedArtifactAbstractType] | None = Field( default=None, alias="abstract", title="Summary of the article or artifact", description=( "The abstract may be used to convey article-contained abstracts, " "externally-created abstracts, or other descriptive summaries." ), json_schema_extra={ "element_property": True, }, ) classification: typing.List[ fhirtypes.CitationCitedArtifactClassificationType ] | None = Field( default=None, alias="classification", title="The assignment to an organizing scheme", description=None, json_schema_extra={ "element_property": True, }, ) contributorship: fhirtypes.CitationCitedArtifactContributorshipType | None = Field( default=None, alias="contributorship", title="Attribution of authors and other contributors", description=( "This element is used to list authors and other contributors, their " "contact information, specific contributions, and summary statements." ), json_schema_extra={ "element_property": True, }, ) currentState: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="currentState", title="The status of the cited artifact", description=None, json_schema_extra={ "element_property": True, }, ) dateAccessed: fhirtypes.DateTimeType | None = Field( default=None, alias="dateAccessed", title="When the cited artifact was accessed", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dateAccessed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dateAccessed", title="Extension field for ``dateAccessed``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique identifier. May include DOI, PMID, PMCID, etc", description=( "A formal identifier that is used to identify the cited artifact when " "it is represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Any additional information or content for the article or artifact", description=None, json_schema_extra={ "element_property": True, }, ) part: fhirtypes.CitationCitedArtifactPartType | None = Field( default=None, alias="part", title="The component of the article or artifact", description=None, json_schema_extra={ "element_property": True, }, ) publicationForm: typing.List[ fhirtypes.CitationCitedArtifactPublicationFormType ] | None = Field( default=None, alias="publicationForm", title=( "If multiple, used to represent alternative forms of the article that " "are not separate citations" ), description=None, json_schema_extra={ "element_property": True, }, ) relatedIdentifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="relatedIdentifier", title=( "Identifier not unique to the cited artifact. May include trial " "registry identifiers" ), description=( "A formal identifier that is used to identify things closely related to" " the cited artifact." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) relatesTo: typing.List[fhirtypes.CitationCitedArtifactRelatesToType] | None = Field( default=None, alias="relatesTo", title="The artifact related to the cited artifact", description=None, json_schema_extra={ "element_property": True, }, ) statusDate: typing.List[ fhirtypes.CitationCitedArtifactStatusDateType ] | None = Field( default=None, alias="statusDate", title="An effective date or period for a status of the cited artifact", description=( "An effective date or period, historical or future, actual or expected," " for a status of the cited artifact." ), json_schema_extra={ "element_property": True, }, ) title: typing.List[fhirtypes.CitationCitedArtifactTitleType] | None = Field( default=None, alias="title", title="The title details of the article or artifact", description=None, json_schema_extra={ "element_property": True, }, ) version: fhirtypes.CitationCitedArtifactVersionType | None = Field( default=None, alias="version", title="The defined version of the cited artifact", description=None, json_schema_extra={ "element_property": True, }, ) webLocation: typing.List[ fhirtypes.CitationCitedArtifactWebLocationType ] | None = Field( default=None, alias="webLocation", title="Used for any URL for the article or artifact cited", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifact`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "relatedIdentifier", "dateAccessed", "version", "currentState", "statusDate", "title", "abstract", "part", "relatesTo", "publicationForm", "webLocation", "classification", "contributorship", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifact`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "identifier", "relatedIdentifier", "dateAccessed"] class CitationCitedArtifactAbstract(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Summary of the article or artifact. The abstract may be used to convey article-contained abstracts, externally- created abstracts, or other descriptive summaries. """ __resource_type__ = "CitationCitedArtifactAbstract" copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Copyright notice for the abstract", description=None, json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) language: fhirtypes.CodeableConceptType | None = Field( default=None, alias="language", title="Used to express the specific language", description="Used to express the specific language of the abstract.", json_schema_extra={ "element_property": True, }, ) text: fhirtypes.MarkdownType | None = Field( default=None, alias="text", title="Abstract content", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The kind of abstract", description="Used to express the reason for or classification of the abstract.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactAbstract`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "language", "text", "copyright", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactAbstract`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("text", "text__ext")] return required_fields class CitationCitedArtifactClassification(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The assignment to an organizing scheme. """ __resource_type__ = "CitationCitedArtifactClassification" artifactAssessment: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="artifactAssessment", title="Complex or externally created classification", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ArtifactAssessment"], }, ) classifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="classifier", title="The specific classification value", description=None, json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The kind of classifier (e.g. publication type, keyword)", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactClassification`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "classifier", "artifactAssessment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactClassification`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationCitedArtifactContributorship(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Attribution of authors and other contributors. This element is used to list authors and other contributors, their contact information, specific contributions, and summary statements. """ __resource_type__ = "CitationCitedArtifactContributorship" complete: bool | None = Field( default=None, alias="complete", title="Indicates if the list includes all authors and/or contributors", description=None, json_schema_extra={ "element_property": True, }, ) complete__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_complete", title="Extension field for ``complete``." ) entry: typing.List[ fhirtypes.CitationCitedArtifactContributorshipEntryType ] | None = Field( default=None, alias="entry", title="An individual entity named as a contributor", description=( "An individual entity named as a contributor, for example in the author" " list or contributor list." ), json_schema_extra={ "element_property": True, }, ) summary: typing.List[ fhirtypes.CitationCitedArtifactContributorshipSummaryType ] | None = Field( default=None, alias="summary", title=( "Used to record a display of the author/contributor list without " "separate data element for each list member" ), description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactContributorship`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "complete", "entry", "summary"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactContributorship`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationCitedArtifactContributorshipEntry(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An individual entity named as a contributor. An individual entity named as a contributor, for example in the author list or contributor list. """ __resource_type__ = "CitationCitedArtifactContributorshipEntry" affiliation: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="affiliation", title="Organizational affiliation", description="Organization affiliated with the contributor.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization", "PractitionerRole"], }, ) contributionInstance: typing.List[ fhirtypes.CitationCitedArtifactContributorshipEntryContributionInstanceType ] | None = Field( default=None, alias="contributionInstance", title="Contributions with accounting for time or number", description=None, json_schema_extra={ "element_property": True, }, ) contributionType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="contributionType", title="The specific contribution", description=( "This element identifies the specific nature of an individual\u2019s " "contribution with respect to the cited work." ), json_schema_extra={ "element_property": True, }, ) contributor: fhirtypes.ReferenceType = Field( default=..., alias="contributor", title="The identity of the individual contributor", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "Organization"], }, ) correspondingContact: bool | None = Field( default=None, alias="correspondingContact", title="Whether the contributor is the corresponding contributor for the role", description=None, json_schema_extra={ "element_property": True, }, ) correspondingContact__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_correspondingContact", title="Extension field for ``correspondingContact``.", ) forenameInitials: fhirtypes.StringType | None = Field( default=None, alias="forenameInitials", title="For citation styles that use initials", description=None, json_schema_extra={ "element_property": True, }, ) forenameInitials__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_forenameInitials", title="Extension field for ``forenameInitials``.", ) rankingOrder: fhirtypes.PositiveIntType | None = Field( default=None, alias="rankingOrder", title="Ranked order of contribution", description=( "Provides a numerical ranking to represent the degree of " "contributorship relative to other contributors, such as 1 for first " "author and 2 for second author." ), json_schema_extra={ "element_property": True, }, ) rankingOrder__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rankingOrder", title="Extension field for ``rankingOrder``.", ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="The role of the contributor (e.g. author, editor, reviewer, funder)", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactContributorshipEntry`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "contributor", "forenameInitials", "affiliation", "contributionType", "role", "contributionInstance", "correspondingContact", "rankingOrder", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactContributorshipEntry`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationCitedArtifactContributorshipEntryContributionInstance( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contributions with accounting for time or number. """ __resource_type__ = "CitationCitedArtifactContributorshipEntryContributionInstance" time: fhirtypes.DateTimeType | None = Field( default=None, alias="time", title="The time that the contribution was made", description=None, json_schema_extra={ "element_property": True, }, ) time__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_time", title="Extension field for ``time``." ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="The specific contribution", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactContributorshipEntryContributionInstance`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "time"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactContributorshipEntryContributionInstance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationCitedArtifactContributorshipSummary(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Used to record a display of the author/contributor list without separate data element for each list member. """ __resource_type__ = "CitationCitedArtifactContributorshipSummary" source: fhirtypes.CodeableConceptType | None = Field( default=None, alias="source", title="Used to code the producer or rule for creating the display string", description=None, json_schema_extra={ "element_property": True, }, ) style: fhirtypes.CodeableConceptType | None = Field( default=None, alias="style", title="The format for the display string", description=( "The format for the display string, such as author last name with first" " letter capitalized followed by forename initials." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title=( "Such as author list, contributorship statement, funding statement, " "acknowledgements statement, or conflicts of interest statement" ), description=( "Used most commonly to express an author list or a contributorship " "statement." ), json_schema_extra={ "element_property": True, }, ) value: fhirtypes.MarkdownType | None = Field( default=None, alias="value", title=( "The display string for the author list, contributor list, or " "contributorship statement" ), description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactContributorshipSummary`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "style", "source", "value", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactContributorshipSummary`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("value", "value__ext")] return required_fields class CitationCitedArtifactPart(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The component of the article or artifact. """ __resource_type__ = "CitationCitedArtifactPart" baseCitation: fhirtypes.ReferenceType | None = Field( default=None, alias="baseCitation", title="The citation for the full article or artifact", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Citation"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The kind of component", description=None, json_schema_extra={ "element_property": True, }, ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The specification of the component", description=None, json_schema_extra={ "element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactPart`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "value", "baseCitation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactPart`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationCitedArtifactPublicationForm(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. If multiple, used to represent alternative forms of the article that are not separate citations. """ __resource_type__ = "CitationCitedArtifactPublicationForm" accessionNumber: fhirtypes.StringType | None = Field( default=None, alias="accessionNumber", title="Entry number or identifier for inclusion in a database", description=None, json_schema_extra={ "element_property": True, }, ) accessionNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_accessionNumber", title="Extension field for ``accessionNumber``.", ) articleDate: fhirtypes.DateTimeType | None = Field( default=None, alias="articleDate", title=( "The date the article was added to the database, or the date the " "article was released" ), description=None, json_schema_extra={ "element_property": True, }, ) articleDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_articleDate", title="Extension field for ``articleDate``." ) citedMedium: fhirtypes.CodeableConceptType | None = Field( default=None, alias="citedMedium", title="Internet or Print", description=( 'Describes the form of the medium cited. Common codes are "Internet" or' ' "Print". The CitedMedium value set has 6 codes. The codes internet, ' "print, and offline-digital-storage are the common codes for a typical " "publication form, though internet and print are more common for study " "citations. Three additional codes (each appending one of the primary " 'codes with "-without-issue" are used for situations when a study is ' "published both within an issue (of a periodical release as commonly " "done for journals) AND is published separately from the issue (as " "commonly done with early online publication), to represent specific " "identification of the publication form not associated with the issue." ), json_schema_extra={ "element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Copyright notice for the full article or artifact", description=None, json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) firstPage: fhirtypes.StringType | None = Field( default=None, alias="firstPage", title="Used for isolated representation of first page", description=None, json_schema_extra={ "element_property": True, }, ) firstPage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_firstPage", title="Extension field for ``firstPage``." ) issue: fhirtypes.StringType | None = Field( default=None, alias="issue", title=( "Issue, part or supplement of journal or other collection in which the " "article is published" ), description=None, json_schema_extra={ "element_property": True, }, ) issue__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issue", title="Extension field for ``issue``." ) language: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="language", title="Language(s) in which this form of the article is published", description=( "The language or languages in which this form of the article is " "published." ), json_schema_extra={ "element_property": True, }, ) lastPage: fhirtypes.StringType | None = Field( default=None, alias="lastPage", title="Used for isolated representation of last page", description=None, json_schema_extra={ "element_property": True, }, ) lastPage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastPage", title="Extension field for ``lastPage``." ) lastRevisionDate: fhirtypes.DateTimeType | None = Field( default=None, alias="lastRevisionDate", title="The date the article was last revised or updated in the database", description=None, json_schema_extra={ "element_property": True, }, ) lastRevisionDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastRevisionDate", title="Extension field for ``lastRevisionDate``.", ) pageCount: fhirtypes.StringType | None = Field( default=None, alias="pageCount", title="Number of pages or screens", description=( "Actual or approximate number of pages or screens. Distinct from " "reporting the page numbers." ), json_schema_extra={ "element_property": True, }, ) pageCount__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_pageCount", title="Extension field for ``pageCount``." ) pageString: fhirtypes.StringType | None = Field( default=None, alias="pageString", title="Used for full display of pagination", description=None, json_schema_extra={ "element_property": True, }, ) pageString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_pageString", title="Extension field for ``pageString``." ) publicationDateSeason: fhirtypes.StringType | None = Field( default=None, alias="publicationDateSeason", title="Season in which the cited artifact was published", description="Spring, Summer, Fall/Autumn, Winter.", json_schema_extra={ "element_property": True, }, ) publicationDateSeason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publicationDateSeason", title="Extension field for ``publicationDateSeason``.", ) publicationDateText: fhirtypes.StringType | None = Field( default=None, alias="publicationDateText", title=( "Text representation of the date on which the issue of the cited " "artifact was published" ), description=None, json_schema_extra={ "element_property": True, }, ) publicationDateText__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publicationDateText", title="Extension field for ``publicationDateText``.", ) publishedIn: fhirtypes.CitationCitedArtifactPublicationFormPublishedInType | None = Field( default=None, alias="publishedIn", title="The collection the cited article or artifact is published in", description=None, json_schema_extra={ "element_property": True, }, ) volume: fhirtypes.StringType | None = Field( default=None, alias="volume", title=( "Volume number of journal or other collection in which the article is " "published" ), description=None, json_schema_extra={ "element_property": True, }, ) volume__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_volume", title="Extension field for ``volume``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactPublicationForm`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "publishedIn", "citedMedium", "volume", "issue", "articleDate", "publicationDateText", "publicationDateSeason", "lastRevisionDate", "language", "accessionNumber", "pageString", "firstPage", "lastPage", "pageCount", "copyright", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactPublicationForm`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationCitedArtifactPublicationFormPublishedIn(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The collection the cited article or artifact is published in. """ __resource_type__ = "CitationCitedArtifactPublicationFormPublishedIn" identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title=( "Journal identifiers include ISSN, ISO Abbreviation and NLMuniqueID; " "Book identifiers include ISBN" ), description=None, json_schema_extra={ "element_property": True, }, ) publisher: fhirtypes.ReferenceType | None = Field( default=None, alias="publisher", title="Name of or resource describing the publisher", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) publisherLocation: fhirtypes.StringType | None = Field( default=None, alias="publisherLocation", title="Geographic location of the publisher", description=None, json_schema_extra={ "element_property": True, }, ) publisherLocation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisherLocation", title="Extension field for ``publisherLocation``.", ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name of the database or title of the book or journal", description=None, json_schema_extra={ "element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Kind of container (e.g. Periodical, database, or book)", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactPublicationFormPublishedIn`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "identifier", "title", "publisher", "publisherLocation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactPublicationFormPublishedIn`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationCitedArtifactRelatesTo(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The artifact related to the cited artifact. """ __resource_type__ = "CitationCitedArtifactRelatesTo" citation: fhirtypes.MarkdownType | None = Field( default=None, alias="citation", title="Bibliographic citation for the artifact", description=( "A bibliographic citation for the related artifact. This text SHOULD be" " formatted according to an accepted citation format." ), json_schema_extra={ "element_property": True, }, ) citation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_citation", title="Extension field for ``citation``." ) classifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="classifier", title="Additional classifiers", description="Provides additional classifiers of the related artifact.", json_schema_extra={ "element_property": True, }, ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Brief description of the related artifact", description=( "A brief description of the document or knowledge resource being " "referenced, suitable for display to a consumer." ), json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) document: fhirtypes.AttachmentType | None = Field( default=None, alias="document", title="What document is being referenced", description=( "The document being referenced, represented as an attachment. Do not " "use this element if using the resource element to provide the " "canonical to the related artifact." ), json_schema_extra={ "element_property": True, }, ) label: fhirtypes.StringType | None = Field( default=None, alias="label", title="Short label", description=( "A short label that can be used to reference the related artifact from " "elsewhere in the containing artifact, such as a footnote index." ), json_schema_extra={ "element_property": True, }, ) label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_label", title="Extension field for ``label``." ) resource: fhirtypes.CanonicalType | None = Field( default=None, alias="resource", title="What artifact is being referenced", description=( "The related artifact, such as a library, value set, profile, or other " "knowledge resource." ), json_schema_extra={ "element_property": True, }, ) resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resource", title="Extension field for ``resource``." ) resourceReference: fhirtypes.ReferenceType | None = Field( default=None, alias="resourceReference", title="What artifact, if not a conformance resource", description=( "The related artifact, if the artifact is not a canonical resource, or " "a resource reference to a canonical resource." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "documentation | justification | citation | predecessor | successor | " "derived-from | depends-on | composed-of | part-of | amends | amended-" "with | appends | appended-with | cites | cited-by | comments-on | " "comment-in | contains | contained-in | corrects | correction-in | " "replaces | replaced-with | retracts | retracted-by | signs | similar-" "to | supports | supported-with | transforms | transformed-into | " "transformed-with | documents | specification-of | created-with | cite-" "as | reprint | reprint-of" ), description="The type of relationship to the related artifact.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "documentation", "justification", "citation", "predecessor", "successor", "derived-from", "depends-on", "composed-of", "part-of", "amends", "amended-with", "appends", "appended-with", "cites", "cited-by", "comments-on", "comment-in", "contains", "contained-in", "corrects", "correction-in", "replaces", "replaced-with", "retracts", "retracted-by", "signs", "similar-to", "supports", "supported-with", "transforms", "transformed-into", "transformed-with", "documents", "specification-of", "created-with", "cite-as", "reprint", "reprint-of", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactRelatesTo`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "classifier", "label", "display", "citation", "document", "resource", "resourceReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactRelatesTo`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields class CitationCitedArtifactStatusDate(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An effective date or period for a status of the cited artifact. An effective date or period, historical or future, actual or expected, for a status of the cited artifact. """ __resource_type__ = "CitationCitedArtifactStatusDate" activity: fhirtypes.CodeableConceptType = Field( default=..., alias="activity", title="Classification of the status", description="A definition of the status associated with a date or period.", json_schema_extra={ "element_property": True, }, ) actual: bool | None = Field( default=None, alias="actual", title="Either occurred or expected", description=None, json_schema_extra={ "element_property": True, }, ) actual__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_actual", title="Extension field for ``actual``." ) period: fhirtypes.PeriodType = Field( default=..., alias="period", title="When the status started and/or ended", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactStatusDate`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "activity", "actual", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactStatusDate`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationCitedArtifactTitle(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The title details of the article or artifact. """ __resource_type__ = "CitationCitedArtifactTitle" language: fhirtypes.CodeableConceptType | None = Field( default=None, alias="language", title="Used to express the specific language", description="Used to express the specific language of the title.", json_schema_extra={ "element_property": True, }, ) text: fhirtypes.MarkdownType | None = Field( default=None, alias="text", title="The title of the article or artifact", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="The kind of title", description="Used to express the reason for or classification of the title.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactTitle`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "language", "text"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactTitle`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("text", "text__ext")] return required_fields class CitationCitedArtifactVersion(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The defined version of the cited artifact. """ __resource_type__ = "CitationCitedArtifactVersion" baseCitation: fhirtypes.ReferenceType | None = Field( default=None, alias="baseCitation", title="Citation for the main version of the cited artifact", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Citation"], }, ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The version number or other version identifier", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactVersion`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "value", "baseCitation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactVersion`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("value", "value__ext")] return required_fields class CitationCitedArtifactWebLocation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Used for any URL for the article or artifact cited. """ __resource_type__ = "CitationCitedArtifactWebLocation" classifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="classifier", title="Code the reason for different URLs, e.g. abstract and full-text", description="A characterization of the object expected at the web location.", json_schema_extra={ "element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="The specific URL", description=None, json_schema_extra={ "element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationCitedArtifactWebLocation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "classifier", "url"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactWebLocation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationClassification(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The assignment to an organizing scheme. """ __resource_type__ = "CitationClassification" classifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="classifier", title="The specific classification value", description=None, json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The kind of classifier (e.g. publication type, keyword)", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationClassification`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "classifier"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationClassification`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationStatusDate(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An effective date or period for a status of the citation record. The state or status of the citation record paired with an effective date or period for that state. """ __resource_type__ = "CitationStatusDate" activity: fhirtypes.CodeableConceptType = Field( default=..., alias="activity", title="Classification of the status", description=( "The state or status of the citation record (that will be paired with " "the period)." ), json_schema_extra={ "element_property": True, }, ) actual: bool | None = Field( default=None, alias="actual", title="Either occurred or expected", description=( "Whether the status date is actual (has occurred) or expected " "(estimated or anticipated)." ), json_schema_extra={ "element_property": True, }, ) actual__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_actual", title="Extension field for ``actual``." ) period: fhirtypes.PeriodType = Field( default=..., alias="period", title="When the status started and/or ended", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationStatusDate`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "activity", "actual", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationStatusDate`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CitationSummary(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A human-readable display of key concepts to represent the citation. """ __resource_type__ = "CitationSummary" style: fhirtypes.CodeableConceptType | None = Field( default=None, alias="style", title="Format for display of the citation summary", description=None, json_schema_extra={ "element_property": True, }, ) text: fhirtypes.MarkdownType | None = Field( default=None, alias="text", title="The human-readable display of the citation summary", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CitationSummary`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "style", "text"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CitationSummary`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "text"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("text", "text__ext")] return required_fields ================================================ FILE: fhir/resources/claim.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Claim Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Claim(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Claim, Pre-determination or Pre-authorization. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. """ __resource_type__ = "Claim" accident: fhirtypes.ClaimAccidentType | None = Field( default=None, alias="accident", title="Details of the event", description=( "Details of an accident which resulted in injuries which required the " "products and services listed in the claim." ), json_schema_extra={ "element_property": True, }, ) billablePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="billablePeriod", title="Relevant time frame for the claim", description="The period for which charges are being submitted.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) careTeam: typing.List[fhirtypes.ClaimCareTeamType] | None = Field( default=None, alias="careTeam", title="Members of the care team", description="The members of the team who provided the products and services.", json_schema_extra={ "element_property": True, }, ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Resource creation date", description="The date this resource was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) diagnosis: typing.List[fhirtypes.ClaimDiagnosisType] | None = Field( default=None, alias="diagnosis", title="Pertinent diagnosis information", description="Information about diagnoses relevant to the claim items.", json_schema_extra={ "element_property": True, }, ) diagnosisRelatedGroup: fhirtypes.CodeableConceptType | None = Field( default=None, alias="diagnosisRelatedGroup", title="Package billing code", description=( "A package billing code or bundle code used to group products and " "services to a particular health condition (such as heart attack) which" " is based on a predetermined grouping code system." ), json_schema_extra={ "element_property": True, }, ) encounter: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="encounter", title="Encounters associated with the listed treatments", description="Healthcare encounters related to this claim.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) enterer: fhirtypes.ReferenceType | None = Field( default=None, alias="enterer", title="Author of the claim", description=( "Individual who created the claim, predetermination or " "preauthorization." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Patient", "RelatedPerson", ], }, ) event: typing.List[fhirtypes.ClaimEventType] | None = Field( default=None, alias="event", title="Event information", description="Information code for an event with a corresponding date or period.", json_schema_extra={ "element_property": True, }, ) facility: fhirtypes.ReferenceType | None = Field( default=None, alias="facility", title="Servicing facility", description="Facility where the services were provided.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location", "Organization"], }, ) fundsReserve: fhirtypes.CodeableConceptType | None = Field( default=None, alias="fundsReserve", title="For whom to reserve funds", description=( "A code to indicate whether and for whom funds are to be reserved for " "future claims." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for claim", description="A unique identifier assigned to this claim.", json_schema_extra={ "element_property": True, }, ) insurance: typing.List[fhirtypes.ClaimInsuranceType] | None = Field( default=None, alias="insurance", title="Patient insurance information", description=( "Financial instruments for reimbursement for the health care products " "and services specified on the claim." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) insurer: fhirtypes.ReferenceType | None = Field( default=None, alias="insurer", title="Target", description="The Insurer who is target of the request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) item: typing.List[fhirtypes.ClaimItemType] | None = Field( default=None, alias="item", title="Product or service provided", description=( "A claim line. Either a simple product or service or a 'group' of " "details which can each be a simple items or groups of sub-details." ), json_schema_extra={ "element_property": True, }, ) originalPrescription: fhirtypes.ReferenceType | None = Field( default=None, alias="originalPrescription", title="Original prescription if superseded by fulfiller", description=( "Original prescription which has been superseded by this prescription " "to support the dispensing of pharmacy services, medications or " "products." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "DeviceRequest", "MedicationRequest", "VisionPrescription", ], }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="The recipient of the products and services", description=( "The party to whom the professional services and/or products have been " "supplied or are being considered and for whom actual or forecast " "reimbursement is sought." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) patientPaid: fhirtypes.MoneyType | None = Field( default=None, alias="patientPaid", title="Paid by the patient", description=( "The amount paid by the patient, in total at the claim claim level or " "specifically for the item and detail level, to the provider for goods " "and services." ), json_schema_extra={ "element_property": True, }, ) payee: fhirtypes.ClaimPayeeType | None = Field( default=None, alias="payee", title="Recipient of benefits payable", description=( "The party to be reimbursed for cost of the products and services " "according to the terms of the policy." ), json_schema_extra={ "element_property": True, }, ) prescription: fhirtypes.ReferenceType | None = Field( default=None, alias="prescription", title="Prescription authorizing services and products", description=( "Prescription is the document/authorization given to the claim author " "for them to provide products and services for which consideration " "(reimbursement) is sought. Could be a RX for medications, an 'order' " "for oxygen or wheelchair or physiotherapy treatments." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "DeviceRequest", "MedicationRequest", "VisionPrescription", ], }, ) priority: fhirtypes.CodeableConceptType | None = Field( default=None, alias="priority", title="Desired processing urgency", description=( "The provider-required urgency of processing the request. Typical " "values include: stat, normal, deferred." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) procedure: typing.List[fhirtypes.ClaimProcedureType] | None = Field( default=None, alias="procedure", title="Clinical procedures performed", description=( "Procedures performed on the patient relevant to the billing items with" " the claim." ), json_schema_extra={ "element_property": True, }, ) provider: fhirtypes.ReferenceType | None = Field( default=None, alias="provider", title="Party responsible for the claim", description=( "The provider which is responsible for the claim, predetermination or " "preauthorization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) referral: fhirtypes.ReferenceType | None = Field( default=None, alias="referral", title="Treatment referral", description=( "The referral information received by the claim author, it is not to be" " used when the author generates a referral for a patient. A copy of " "that referral may be provided as supporting information. Some insurers" " require proof of referral to pay for services or to pay specialist " "rates for services." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ServiceRequest"], }, ) related: typing.List[fhirtypes.ClaimRelatedType] | None = Field( default=None, alias="related", title="Prior or corollary claims", description=( "Other claims which are related to this claim such as prior submissions" " or claims for related services or for the same event." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subType", title="More granular claim type", description=( "A finer grained suite of claim type codes which may convey additional " "information such as Inpatient vs Outpatient and/or a specialty " "service." ), json_schema_extra={ "element_property": True, }, ) supportingInfo: typing.List[fhirtypes.ClaimSupportingInfoType] | None = Field( default=None, alias="supportingInfo", title="Supporting information", description=( "Additional information codes regarding exceptions, special " "considerations, the condition, situation, prior or concurrent issues." ), json_schema_extra={ "element_property": True, }, ) total: fhirtypes.MoneyType | None = Field( default=None, alias="total", title="Total claim cost", description="The total value of the all the items in the claim.", json_schema_extra={ "element_property": True, }, ) traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="traceNumber", title="Number for tracking", description=( "Trace number for tracking purposes. May be defined at the jurisdiction" " level or between trading partners." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Category or discipline", description=( "The category of claim, e.g. oral, pharmacy, vision, institutional, " "professional." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="claim | preauthorization | predetermination", description=( "A code to indicate whether the nature of the request is: Claim - A " "request to an Insurer to adjudicate the supplied charges for health " "care goods and services under the identified policy and to pay the " "determined Benefit amount, if any; Preauthorization - A request to an " "Insurer to adjudicate the supplied proposed future charges for health " "care goods and services under the identified policy and to approve the" " services and provide the expected benefit amounts and potentially to " "reserve funds to pay the benefits when Claims for the indicated " "services are later submitted; or, Pre-determination - A request to an " "Insurer to adjudicate the supplied 'what if' charges for health care " "goods and services under the identified policy and report back what " "the Benefit payable would be had the services actually been provided." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["claim", "preauthorization", "predetermination"], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Claim`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "traceNumber", "status", "type", "subType", "use", "patient", "billablePeriod", "created", "enterer", "insurer", "provider", "priority", "fundsReserve", "related", "prescription", "originalPrescription", "payee", "referral", "encounter", "facility", "diagnosisRelatedGroup", "event", "careTeam", "supportingInfo", "diagnosis", "procedure", "insurance", "accident", "patientPaid", "item", "total", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Claim`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "status", "type", "use", "patient", "billablePeriod", "created", "insurer", "provider", "priority", "insurance", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("created", "created__ext"), ("status", "status__ext"), ("use", "use__ext"), ] return required_fields class ClaimAccident(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details of the event. Details of an accident which resulted in injuries which required the products and services listed in the claim. """ __resource_type__ = "ClaimAccident" date: fhirtypes.DateType | None = Field( default=None, alias="date", title="When the incident occurred", description=( "Date of an accident event related to the products and services " "contained in the claim." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) locationAddress: fhirtypes.AddressType | None = Field( default=None, alias="locationAddress", title="Where the event occurred", description="The physical location of the accident event.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="locationReference", title="Where the event occurred", description="The physical location of the accident event.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The nature of the accident", description=( "The type or context of the accident event for the purposes of " "selection of potential insurance coverages and determination of " "coordination between insurers." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimAccident`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "date", "type", "locationAddress", "locationReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimAccident`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("date", "date__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"location": ["locationAddress", "locationReference"]} return one_of_many_fields class ClaimCareTeam(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Members of the care team. The members of the team who provided the products and services. """ __resource_type__ = "ClaimCareTeam" provider: fhirtypes.ReferenceType = Field( default=..., alias="provider", title="Practitioner or organization", description="Member of the team who provided the product or service.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) responsible: bool | None = Field( default=None, alias="responsible", title="Indicator of the lead practitioner", description=( "The party who is billing and/or responsible for the claimed products " "or services." ), json_schema_extra={ "element_property": True, }, ) responsible__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_responsible", title="Extension field for ``responsible``." ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="Function within the team", description=( "The lead, assisting or supervising practitioner and their discipline " "if a multidisciplinary team." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Order of care team", description="A number to uniquely identify care team entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) specialty: fhirtypes.CodeableConceptType | None = Field( default=None, alias="specialty", title="Practitioner or provider specialization", description=( "The specialization of the practitioner or provider which is applicable" " for this service." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimCareTeam`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "provider", "responsible", "role", "specialty", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimCareTeam`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields class ClaimDiagnosis(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Pertinent diagnosis information. Information about diagnoses relevant to the claim items. """ __resource_type__ = "ClaimDiagnosis" diagnosisCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="diagnosisCodeableConcept", title="Nature of illness or problem", description=( "The nature of illness or problem in a coded form or as a reference to " "an external defined Condition." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e diagnosis[x] "one_of_many": "diagnosis", "one_of_many_required": True, }, ) diagnosisReference: fhirtypes.ReferenceType | None = Field( default=None, alias="diagnosisReference", title="Nature of illness or problem", description=( "The nature of illness or problem in a coded form or as a reference to " "an external defined Condition." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e diagnosis[x] "one_of_many": "diagnosis", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) onAdmission: fhirtypes.CodeableConceptType | None = Field( default=None, alias="onAdmission", title="Present on admission", description=( "Indication of whether the diagnosis was present on admission to a " "facility." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Diagnosis instance identifier", description="A number to uniquely identify diagnosis entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Timing or nature of the diagnosis", description="When the condition was observed or the relative ranking.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimDiagnosis`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "diagnosisCodeableConcept", "diagnosisReference", "type", "onAdmission", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimDiagnosis`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "diagnosis": ["diagnosisCodeableConcept", "diagnosisReference"] } return one_of_many_fields class ClaimEvent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Event information. Information code for an event with a corresponding date or period. """ __resource_type__ = "ClaimEvent" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Specific event", description="A coded event such as when a service is expected or a card printed.", json_schema_extra={ "element_property": True, }, ) whenDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="whenDateTime", title="Occurance date or period", description=( "A date or period in the past or future indicating when the event " "occurred or is expectd to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e when[x] "one_of_many": "when", "one_of_many_required": True, }, ) whenDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_whenDateTime", title="Extension field for ``whenDateTime``.", ) whenPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="whenPeriod", title="Occurance date or period", description=( "A date or period in the past or future indicating when the event " "occurred or is expectd to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e when[x] "one_of_many": "when", "one_of_many_required": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimEvent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "whenDateTime", "whenPeriod", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimEvent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"when": ["whenDateTime", "whenPeriod"]} return one_of_many_fields class ClaimInsurance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Patient insurance information. Financial instruments for reimbursement for the health care products and services specified on the claim. """ __resource_type__ = "ClaimInsurance" businessArrangement: fhirtypes.StringType | None = Field( default=None, alias="businessArrangement", title="Additional provider contract number", description=( "A business agreement number established between the provider and the " "insurer for special business processing purposes." ), json_schema_extra={ "element_property": True, }, ) businessArrangement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_businessArrangement", title="Extension field for ``businessArrangement``.", ) claimResponse: fhirtypes.ReferenceType | None = Field( default=None, alias="claimResponse", title="Adjudication results", description=( "The result of the adjudication of the line items for the Coverage " "specified in this insurance." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ClaimResponse"], }, ) coverage: fhirtypes.ReferenceType = Field( default=..., alias="coverage", title="Insurance information", description=( "Reference to the insurance card level information contained in the " "Coverage resource. The coverage issuing insurer will use these details" " to locate the patient's actual coverage within the insurer's " "information system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage"], }, ) focal: bool | None = Field( default=None, alias="focal", title="Coverage to be used for adjudication", description=( "A flag to indicate that this Coverage is to be used for adjudication " "of this claim when set to true." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) focal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_focal", title="Extension field for ``focal``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Pre-assigned Claim number", description=( "The business identifier to be used when the claim is sent for " "adjudication against this insurance policy." ), json_schema_extra={ "element_property": True, }, ) preAuthRef: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="preAuthRef", title="Prior authorization reference number", description=( "Reference numbers previously provided by the insurer to the provider " "to be quoted on subsequent claims containing services or products " "related to the prior authorization." ), json_schema_extra={ "element_property": True, }, ) preAuthRef__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_preAuthRef", title="Extension field for ``preAuthRef``." ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Insurance instance identifier", description=( "A number to uniquely identify insurance entries and provide a sequence" " of coverages to convey coordination of benefit order." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimInsurance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "focal", "identifier", "coverage", "businessArrangement", "preAuthRef", "claimResponse", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimInsurance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "sequence", "focal", "coverage"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("focal", "focal__ext"), ("sequence", "sequence__ext")] return required_fields class ClaimItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Product or service provided. A claim line. Either a simple product or service or a 'group' of details which can each be a simple items or groups of sub-details. """ __resource_type__ = "ClaimItem" bodySite: typing.List[fhirtypes.ClaimItemBodySiteType] | None = Field( default=None, alias="bodySite", title="Anatomical location", description="Physical location where the service is performed or applies.", json_schema_extra={ "element_property": True, }, ) careTeamSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="careTeamSequence", title="Applicable careTeam members", description="CareTeam members related to this service or product.", json_schema_extra={ "element_property": True, }, ) careTeamSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_careTeamSequence", title="Extension field for ``careTeamSequence``.", ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Benefit classification", description=( "Code to identify the general type of benefits under which products and" " services are provided." ), json_schema_extra={ "element_property": True, }, ) detail: typing.List[fhirtypes.ClaimItemDetailType] | None = Field( default=None, alias="detail", title="Product or service provided", description=( "A claim detail line. Either a simple (a product or service) or a " "'group' of sub-details which are simple items." ), json_schema_extra={ "element_property": True, }, ) diagnosisSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="diagnosisSequence", title="Applicable diagnoses", description="Diagnosis applicable for this service or product.", json_schema_extra={ "element_property": True, }, ) diagnosisSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_diagnosisSequence", title="Extension field for ``diagnosisSequence``.", ) encounter: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="encounter", title="Encounters associated with the listed treatments", description="Healthcare encounters related to this claim.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) informationSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="informationSequence", title="Applicable exception and supporting information", description=( "Exceptions, special conditions and supporting information applicable " "for this service or product." ), json_schema_extra={ "element_property": True, }, ) informationSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_informationSequence", title="Extension field for ``informationSequence``.", ) locationAddress: fhirtypes.AddressType | None = Field( default=None, alias="locationAddress", title="Place of service or where product was supplied", description="Where the product or service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="locationCodeableConcept", title="Place of service or where product was supplied", description="Where the product or service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="locationReference", title="Place of service or where product was supplied", description="Where the product or service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Product or service billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The total amount claimed for the group (if a grouper) or the line " "item. Net = unit price * quantity * factor." ), json_schema_extra={ "element_property": True, }, ) patientPaid: fhirtypes.MoneyType | None = Field( default=None, alias="patientPaid", title="Paid by the patient", description=( "The amount paid by the patient, in total at the claim claim level or " "specifically for the item and detail level, to the provider for goods " "and services." ), json_schema_extra={ "element_property": True, }, ) procedureSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="procedureSequence", title="Applicable procedures", description="Procedures applicable for this service or product.", json_schema_extra={ "element_property": True, }, ) procedureSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_procedureSequence", title="Extension field for ``procedureSequence``.", ) productOrService: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrService", title="Billing, service, product, or drug code", description=( "When the value is a group code then this item collects a set of " "related item details, otherwise this contains the product, service, " "drug or other billing code for the item. This element may be the start" " of a range of .productOrService codes used in conjunction with " ".productOrServiceEnd or it may be a solo element where " ".productOrServiceEnd is not used." ), json_schema_extra={ "element_property": True, }, ) productOrServiceEnd: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrServiceEnd", title="End of a range of codes", description=( "This contains the end of a range of product, service, drug or other " "billing codes for the item. This element is not used when the " ".productOrService is a group code. This value may only be present when" " a .productOfService code has been provided to convey the start of the" " range. Typically this value may be used only with preauthorizations " "and not with claims." ), json_schema_extra={ "element_property": True, }, ) programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="programCode", title="Program the product or service is provided under", description="Identifies the program under which this may be recovered.", json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) request: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="request", title="Request or Referral for Service", description="Request or Referral for Goods or Service to be rendered.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "DeviceRequest", "MedicationRequest", "NutritionOrder", "ServiceRequest", "SupplyRequest", "VisionPrescription", ], }, ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of revenue or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Item instance identifier", description="A number to uniquely identify item entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) servicedDate: fhirtypes.DateType | None = Field( default=None, alias="servicedDate", title="Date or dates of service or product delivery", description=( "The date or dates when the service or product was supplied, performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_servicedDate", title="Extension field for ``servicedDate``.", ) servicedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="servicedPeriod", title="Date or dates of service or product delivery", description=( "The date or dates when the service or product was supplied, performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) tax: fhirtypes.MoneyType | None = Field( default=None, alias="tax", title="Total tax", description="The total of taxes applicable for this product or service.", json_schema_extra={ "element_property": True, }, ) traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="traceNumber", title="Number for tracking", description=( "Trace number for tracking purposes. May be defined at the jurisdiction" " level or between trading partners." ), json_schema_extra={ "element_property": True, }, ) udi: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="udi", title="Unique device identifier", description="Unique Device Identifiers associated with this line item.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description=( "If the item is not a group then this is the fee for the product or " "service, otherwise this is the total of the fees for the details of " "the group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "traceNumber", "careTeamSequence", "diagnosisSequence", "procedureSequence", "informationSequence", "revenue", "category", "productOrService", "productOrServiceEnd", "request", "modifier", "programCode", "servicedDate", "servicedPeriod", "locationCodeableConcept", "locationAddress", "locationReference", "patientPaid", "quantity", "unitPrice", "factor", "tax", "net", "udi", "bodySite", "encounter", "detail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "location": [ "locationAddress", "locationCodeableConcept", "locationReference", ], "serviced": ["servicedDate", "servicedPeriod"], } return one_of_many_fields class ClaimItemBodySite(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Anatomical location. Physical location where the service is performed or applies. """ __resource_type__ = "ClaimItemBodySite" site: typing.List[fhirtypes.CodeableReferenceType] = Field( default=..., alias="site", title="Location", description="Physical service site on the patient (limb, tooth, etc.).", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["BodyStructure"], }, ) subSite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="subSite", title="Sub-location", description=( "A region or surface of the bodySite, e.g. limb region or tooth " "surface(s)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimItemBodySite`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "site", "subSite"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimItemBodySite`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ClaimItemDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Product or service provided. A claim detail line. Either a simple (a product or service) or a 'group' of sub-details which are simple items. """ __resource_type__ = "ClaimItemDetail" category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Benefit classification", description=( "Code to identify the general type of benefits under which products and" " services are provided." ), json_schema_extra={ "element_property": True, }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The total amount claimed for the group (if a grouper) or the line " "item.detail. Net = unit price * quantity * factor." ), json_schema_extra={ "element_property": True, }, ) patientPaid: fhirtypes.MoneyType | None = Field( default=None, alias="patientPaid", title="Paid by the patient", description=( "The amount paid by the patient, in total at the claim claim level or " "specifically for the item and detail level, to the provider for goods " "and services." ), json_schema_extra={ "element_property": True, }, ) productOrService: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrService", title="Billing, service, product, or drug code", description=( "When the value is a group code then this item collects a set of " "related item details, otherwise this contains the product, service, " "drug or other billing code for the item. This element may be the start" " of a range of .productOrService codes used in conjunction with " ".productOrServiceEnd or it may be a solo element where " ".productOrServiceEnd is not used." ), json_schema_extra={ "element_property": True, }, ) productOrServiceEnd: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrServiceEnd", title="End of a range of codes", description=( "This contains the end of a range of product, service, drug or other " "billing codes for the item. This element is not used when the " ".productOrService is a group code. This value may only be present when" " a .productOfService code has been provided to convey the start of the" " range. Typically this value may be used only with preauthorizations " "and not with claims." ), json_schema_extra={ "element_property": True, }, ) programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="programCode", title="Program the product or service is provided under", description="Identifies the program under which this may be recovered.", json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of revenue or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Item instance identifier", description="A number to uniquely identify item entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) subDetail: typing.List[fhirtypes.ClaimItemDetailSubDetailType] | None = Field( default=None, alias="subDetail", title="Product or service provided", description=( "A claim detail line. Either a simple (a product or service) or a " "'group' of sub-details which are simple items." ), json_schema_extra={ "element_property": True, }, ) tax: fhirtypes.MoneyType | None = Field( default=None, alias="tax", title="Total tax", description="The total of taxes applicable for this product or service.", json_schema_extra={ "element_property": True, }, ) traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="traceNumber", title="Number for tracking", description=( "Trace number for tracking purposes. May be defined at the jurisdiction" " level or between trading partners." ), json_schema_extra={ "element_property": True, }, ) udi: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="udi", title="Unique device identifier", description="Unique Device Identifiers associated with this line item.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description=( "If the item is not a group then this is the fee for the product or " "service, otherwise this is the total of the fees for the details of " "the group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimItemDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "traceNumber", "revenue", "category", "productOrService", "productOrServiceEnd", "modifier", "programCode", "patientPaid", "quantity", "unitPrice", "factor", "tax", "net", "udi", "subDetail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimItemDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields class ClaimItemDetailSubDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Product or service provided. A claim detail line. Either a simple (a product or service) or a 'group' of sub-details which are simple items. """ __resource_type__ = "ClaimItemDetailSubDetail" category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Benefit classification", description=( "Code to identify the general type of benefits under which products and" " services are provided." ), json_schema_extra={ "element_property": True, }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The total amount claimed for line item.detail.subDetail. Net = unit " "price * quantity * factor." ), json_schema_extra={ "element_property": True, }, ) patientPaid: fhirtypes.MoneyType | None = Field( default=None, alias="patientPaid", title="Paid by the patient", description=( "The amount paid by the patient, in total at the claim claim level or " "specifically for the item and detail level, to the provider for goods " "and services." ), json_schema_extra={ "element_property": True, }, ) productOrService: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrService", title="Billing, service, product, or drug code", description=( "When the value is a group code then this item collects a set of " "related item details, otherwise this contains the product, service, " "drug or other billing code for the item. This element may be the start" " of a range of .productOrService codes used in conjunction with " ".productOrServiceEnd or it may be a solo element where " ".productOrServiceEnd is not used." ), json_schema_extra={ "element_property": True, }, ) productOrServiceEnd: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrServiceEnd", title="End of a range of codes", description=( "This contains the end of a range of product, service, drug or other " "billing codes for the item. This element is not used when the " ".productOrService is a group code. This value may only be present when" " a .productOfService code has been provided to convey the start of the" " range. Typically this value may be used only with preauthorizations " "and not with claims." ), json_schema_extra={ "element_property": True, }, ) programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="programCode", title="Program the product or service is provided under", description="Identifies the program under which this may be recovered.", json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of revenue or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Item instance identifier", description="A number to uniquely identify item entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) tax: fhirtypes.MoneyType | None = Field( default=None, alias="tax", title="Total tax", description="The total of taxes applicable for this product or service.", json_schema_extra={ "element_property": True, }, ) traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="traceNumber", title="Number for tracking", description=( "Trace number for tracking purposes. May be defined at the jurisdiction" " level or between trading partners." ), json_schema_extra={ "element_property": True, }, ) udi: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="udi", title="Unique device identifier", description="Unique Device Identifiers associated with this line item.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description=( "If the item is not a group then this is the fee for the product or " "service, otherwise this is the total of the fees for the details of " "the group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "traceNumber", "revenue", "category", "productOrService", "productOrServiceEnd", "modifier", "programCode", "patientPaid", "quantity", "unitPrice", "factor", "tax", "net", "udi", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields class ClaimPayee(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Recipient of benefits payable. The party to be reimbursed for cost of the products and services according to the terms of the policy. """ __resource_type__ = "ClaimPayee" party: fhirtypes.ReferenceType | None = Field( default=None, alias="party", title="Recipient reference", description=( "Reference to the individual or organization to whom any payment will " "be made." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Patient", "RelatedPerson", ], }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Category of recipient", description="Type of Party to be reimbursed: subscriber, provider, other.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimPayee`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "party"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimPayee`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ClaimProcedure(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Clinical procedures performed. Procedures performed on the patient relevant to the billing items with the claim. """ __resource_type__ = "ClaimProcedure" date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When the procedure was performed", description="Date and optionally time the procedure was performed.", json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) procedureCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="procedureCodeableConcept", title="Specific clinical procedure", description=( "The code or reference to a Procedure resource which identifies the " "clinical intervention performed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e procedure[x] "one_of_many": "procedure", "one_of_many_required": True, }, ) procedureReference: fhirtypes.ReferenceType | None = Field( default=None, alias="procedureReference", title="Specific clinical procedure", description=( "The code or reference to a Procedure resource which identifies the " "clinical intervention performed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e procedure[x] "one_of_many": "procedure", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Procedure"], }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Procedure instance identifier", description="A number to uniquely identify procedure entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Category of Procedure", description="When the condition was observed or the relative ranking.", json_schema_extra={ "element_property": True, }, ) udi: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="udi", title="Unique device identifier", description="Unique Device Identifiers associated with this line item.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimProcedure`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "type", "date", "procedureCodeableConcept", "procedureReference", "udi", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimProcedure`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "procedure": ["procedureCodeableConcept", "procedureReference"] } return one_of_many_fields class ClaimRelated(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Prior or corollary claims. Other claims which are related to this claim such as prior submissions or claims for related services or for the same event. """ __resource_type__ = "ClaimRelated" claim: fhirtypes.ReferenceType | None = Field( default=None, alias="claim", title="Reference to the related claim", description="Reference to a related claim.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Claim"], }, ) reference: fhirtypes.IdentifierType | None = Field( default=None, alias="reference", title="File or case reference", description=( "An alternate organizational reference to the case or file to which " "this particular claim pertains." ), json_schema_extra={ "element_property": True, }, ) relationship: fhirtypes.CodeableConceptType | None = Field( default=None, alias="relationship", title="How the reference claim is related", description="A code to convey how the claims are related.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimRelated`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "claim", "relationship", "reference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimRelated`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ClaimSupportingInfo(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Supporting information. Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues. """ __resource_type__ = "ClaimSupportingInfo" category: fhirtypes.CodeableConceptType = Field( default=..., alias="category", title="Classification of the supplied information", description=( "The general class of the information supplied: information; exception;" " accident, employment; onset, etc." ), json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Type of information", description=( "System and code pertaining to the specific information regarding " "special conditions relating to the setting, treatment or patient for " "which care is sought." ), json_schema_extra={ "element_property": True, }, ) reason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reason", title="Explanation for the information", description=( "Provides the reason in the situation where a reason code is required " "in addition to the content." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Information instance identifier", description="A number to uniquely identify supporting information entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) timingDate: fhirtypes.DateType | None = Field( default=None, alias="timingDate", title="When it occurred", description="The date when or period to which this information refers.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timingDate", title="Extension field for ``timingDate``." ) timingPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="timingPeriod", title="When it occurred", description="The date when or period to which this information refers.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Data to be provided", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Data to be provided", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="valueIdentifier", title="Data to be provided", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Data to be provided", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Data to be provided", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Data to be provided", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimSupportingInfo`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "category", "code", "timingDate", "timingPeriod", "valueBoolean", "valueString", "valueQuantity", "valueAttachment", "valueReference", "valueIdentifier", "reason", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimSupportingInfo`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "timing": ["timingDate", "timingPeriod"], "value": [ "valueAttachment", "valueBoolean", "valueIdentifier", "valueQuantity", "valueReference", "valueString", ], } return one_of_many_fields ================================================ FILE: fhir/resources/claimresponse.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ClaimResponse Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ClaimResponse(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Response to a claim predetermination or preauthorization. This resource provides the adjudication details from the processing of a Claim resource. """ __resource_type__ = "ClaimResponse" addItem: typing.List[fhirtypes.ClaimResponseAddItemType] | None = Field( default=None, alias="addItem", title="Insurer added line items", description=( "The first-tier service adjudications for payor added product or " "service lines." ), json_schema_extra={ "element_property": True, }, ) adjudication: typing.List[ fhirtypes.ClaimResponseItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Header-level adjudication", description=( "The adjudication results which are presented at the header level " "rather than at the line-item or add-item levels." ), json_schema_extra={ "element_property": True, }, ) communicationRequest: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="communicationRequest", title="Request for additional information", description="Request for additional supporting or authorizing information.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CommunicationRequest"], }, ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Response creation date", description="The date this resource was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) decision: fhirtypes.CodeableConceptType | None = Field( default=None, alias="decision", title="Result of the adjudication", description=( "The result of the claim, predetermination, or preauthorization " "adjudication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) diagnosisRelatedGroup: fhirtypes.CodeableConceptType | None = Field( default=None, alias="diagnosisRelatedGroup", title="Package billing code", description=( "A package billing code or bundle code used to group products and " "services to a particular health condition (such as heart attack) which" " is based on a predetermined grouping code system." ), json_schema_extra={ "element_property": True, }, ) disposition: fhirtypes.StringType | None = Field( default=None, alias="disposition", title="Disposition Message", description="A human readable description of the status of the adjudication.", json_schema_extra={ "element_property": True, }, ) disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_disposition", title="Extension field for ``disposition``." ) encounter: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="encounter", title="Encounters associated with the listed treatments", description="Healthcare encounters related to this claim.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) error: typing.List[fhirtypes.ClaimResponseErrorType] | None = Field( default=None, alias="error", title="Processing errors", description="Errors encountered during the processing of the adjudication.", json_schema_extra={ "element_property": True, }, ) event: typing.List[fhirtypes.ClaimResponseEventType] | None = Field( default=None, alias="event", title="Event information", description="Information code for an event with a corresponding date or period.", json_schema_extra={ "element_property": True, }, ) form: fhirtypes.AttachmentType | None = Field( default=None, alias="form", title="Printed reference or actual form", description=( "The actual form, by reference or inclusion, for printing the content " "or an EOB." ), json_schema_extra={ "element_property": True, }, ) formCode: fhirtypes.CodeableConceptType | None = Field( default=None, alias="formCode", title="Printed form identifier", description="A code for the form to be used for printing the content.", json_schema_extra={ "element_property": True, }, ) fundsReserve: fhirtypes.CodeableConceptType | None = Field( default=None, alias="fundsReserve", title="Funds reserved status", description=( "A code, used only on a response to a preauthorization, to indicate " "whether the benefits payable have been reserved and for whom." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for a claim response", description="A unique identifier assigned to this claim response.", json_schema_extra={ "element_property": True, }, ) insurance: typing.List[fhirtypes.ClaimResponseInsuranceType] | None = Field( default=None, alias="insurance", title="Patient insurance information", description=( "Financial instruments for reimbursement for the health care products " "and services specified on the claim." ), json_schema_extra={ "element_property": True, }, ) insurer: fhirtypes.ReferenceType | None = Field( default=None, alias="insurer", title="Party responsible for reimbursement", description=( "The party responsible for authorization, adjudication and " "reimbursement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) item: typing.List[fhirtypes.ClaimResponseItemType] | None = Field( default=None, alias="item", title="Adjudication for claim line items", description=( "A claim line. Either a simple (a product or service) or a 'group' of " "details which can also be a simple items or groups of sub-details." ), json_schema_extra={ "element_property": True, }, ) outcome: fhirtypes.CodeType | None = Field( default=None, alias="outcome", title="queued | complete | error | partial", description=( "The outcome of the claim, predetermination, or preauthorization " "processing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["queued", "complete", "error", "partial"], }, ) outcome__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_outcome", title="Extension field for ``outcome``." ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="The recipient of the products and services", description=( "The party to whom the professional services and/or products have been " "supplied or are being considered and for whom actual for facast " "reimbursement is sought." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) payeeType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="payeeType", title="Party to be paid any benefits payable", description="Type of Party to be reimbursed: subscriber, provider, other.", json_schema_extra={ "element_property": True, }, ) payment: fhirtypes.ClaimResponsePaymentType | None = Field( default=None, alias="payment", title="Payment Details", description="Payment details for the adjudication of the claim.", json_schema_extra={ "element_property": True, }, ) preAuthPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="preAuthPeriod", title="Preauthorization reference effective period", description="The time frame during which this authorization is effective.", json_schema_extra={ "element_property": True, }, ) preAuthRef: fhirtypes.StringType | None = Field( default=None, alias="preAuthRef", title="Preauthorization reference", description=( "Reference from the Insurer which is used in later communications which" " refers to this adjudication." ), json_schema_extra={ "element_property": True, }, ) preAuthRef__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preAuthRef", title="Extension field for ``preAuthRef``." ) processNote: typing.List[fhirtypes.ClaimResponseProcessNoteType] | None = Field( default=None, alias="processNote", title="Note concerning adjudication", description=( "A note that describes or explains adjudication results in a human " "readable form." ), json_schema_extra={ "element_property": True, }, ) request: fhirtypes.ReferenceType | None = Field( default=None, alias="request", title="Id of resource triggering adjudication", description="Original request resource reference.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Claim"], }, ) requestor: fhirtypes.ReferenceType | None = Field( default=None, alias="requestor", title="Party responsible for the claim", description=( "The provider which is responsible for the claim, predetermination or " "preauthorization." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subType", title="More granular claim type", description=( "A finer grained suite of claim type codes which may convey additional " "information such as Inpatient vs Outpatient and/or a specialty " "service." ), json_schema_extra={ "element_property": True, }, ) total: typing.List[fhirtypes.ClaimResponseTotalType] | None = Field( default=None, alias="total", title="Adjudication totals", description="Categorized monetary totals for the adjudication.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="traceNumber", title="Number for tracking", description=( "Trace number for tracking purposes. May be defined at the jurisdiction" " level or between trading partners." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="More granular claim type", description=( "A finer grained suite of claim type codes which may convey additional " "information such as Inpatient vs Outpatient and/or a specialty " "service." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="claim | preauthorization | predetermination", description=( "A code to indicate whether the nature of the request is: Claim - A " "request to an Insurer to adjudicate the supplied charges for health " "care goods and services under the identified policy and to pay the " "determined Benefit amount, if any; Preauthorization - A request to an " "Insurer to adjudicate the supplied proposed future charges for health " "care goods and services under the identified policy and to approve the" " services and provide the expected benefit amounts and potentially to " "reserve funds to pay the benefits when Claims for the indicated " "services are later submitted; or, Pre-determination - A request to an " "Insurer to adjudicate the supplied 'what if' charges for health care " "goods and services under the identified policy and report back what " "the Benefit payable would be had the services actually been provided." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["claim", "preauthorization", "predetermination"], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "traceNumber", "status", "type", "subType", "use", "patient", "created", "insurer", "requestor", "request", "outcome", "decision", "disposition", "preAuthRef", "preAuthPeriod", "event", "payeeType", "encounter", "diagnosisRelatedGroup", "item", "addItem", "adjudication", "total", "payment", "fundsReserve", "formCode", "form", "processNote", "communicationRequest", "insurance", "error", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "status", "type", "use", "patient", "created", "insurer", "request", "outcome", "decision", "total", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("created", "created__ext"), ("outcome", "outcome__ext"), ("status", "status__ext"), ("use", "use__ext"), ] return required_fields class ClaimResponseAddItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Insurer added line items. The first-tier service adjudications for payor added product or service lines. """ __resource_type__ = "ClaimResponseAddItem" adjudication: typing.List[ fhirtypes.ClaimResponseItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Added items adjudication", description="The adjudication results.", json_schema_extra={ "element_property": True, }, ) bodySite: typing.List[fhirtypes.ClaimResponseAddItemBodySiteType] | None = Field( default=None, alias="bodySite", title="Anatomical location", description="Physical location where the service is performed or applies.", json_schema_extra={ "element_property": True, }, ) detail: typing.List[fhirtypes.ClaimResponseAddItemDetailType] | None = Field( default=None, alias="detail", title="Insurer added line details", description="The second-tier service adjudications for payor added services.", json_schema_extra={ "element_property": True, }, ) detailSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="detailSequence", title="Detail sequence number", description=( "The sequence number of the details within the claim item which this " "line is intended to replace." ), json_schema_extra={ "element_property": True, }, ) detailSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_detailSequence", title="Extension field for ``detailSequence``.", ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) itemSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="itemSequence", title="Item sequence number", description="Claim items which this service line is intended to replace.", json_schema_extra={ "element_property": True, }, ) itemSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_itemSequence", title="Extension field for ``itemSequence``.", ) locationAddress: fhirtypes.AddressType | None = Field( default=None, alias="locationAddress", title="Place of service or where product was supplied", description="Where the product or service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="locationCodeableConcept", title="Place of service or where product was supplied", description="Where the product or service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="locationReference", title="Place of service or where product was supplied", description="Where the product or service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The total amount claimed for the group (if a grouper) or the addItem. " "Net = unit price * quantity * factor." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="Applicable note numbers", description=( "The numbers associated with notes below which apply to the " "adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) productOrService: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrService", title="Billing, service, product, or drug code", description=( "When the value is a group code then this item collects a set of " "related item details, otherwise this contains the product, service, " "drug or other billing code for the item. This element may be the start" " of a range of .productOrService codes used in conjunction with " ".productOrServiceEnd or it may be a solo element where " ".productOrServiceEnd is not used." ), json_schema_extra={ "element_property": True, }, ) productOrServiceEnd: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrServiceEnd", title="End of a range of codes", description=( "This contains the end of a range of product, service, drug or other " "billing codes for the item. This element is not used when the " ".productOrService is a group code. This value may only be present when" " a .productOfService code has been provided to convey the start of the" " range. Typically this value may be used only with preauthorizations " "and not with claims." ), json_schema_extra={ "element_property": True, }, ) programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="programCode", title="Program the product or service is provided under", description="Identifies the program under which this may be recovered.", json_schema_extra={ "element_property": True, }, ) provider: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="provider", title="Authorized providers", description=( "The providers who are authorized for the services rendered to the " "patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) request: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="request", title="Request or Referral for Service", description="Request or Referral for Goods or Service to be rendered.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "DeviceRequest", "MedicationRequest", "NutritionOrder", "ServiceRequest", "SupplyRequest", "VisionPrescription", ], }, ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of revenue or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) reviewOutcome: fhirtypes.ClaimResponseItemReviewOutcomeType | None = Field( default=None, alias="reviewOutcome", title="Added items adjudication results", description=( "The high-level results of the adjudication if adjudication has been " "performed." ), json_schema_extra={ "element_property": True, }, ) servicedDate: fhirtypes.DateType | None = Field( default=None, alias="servicedDate", title="Date or dates of service or product delivery", description=( "The date or dates when the service or product was supplied, performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_servicedDate", title="Extension field for ``servicedDate``.", ) servicedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="servicedPeriod", title="Date or dates of service or product delivery", description=( "The date or dates when the service or product was supplied, performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) subdetailSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="subdetailSequence", title="Subdetail sequence number", description=( "The sequence number of the sub-details within the details within the " "claim item which this line is intended to replace." ), json_schema_extra={ "element_property": True, }, ) subdetailSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_subdetailSequence", title="Extension field for ``subdetailSequence``.", ) tax: fhirtypes.MoneyType | None = Field( default=None, alias="tax", title="Total tax", description="The total of taxes applicable for this product or service.", json_schema_extra={ "element_property": True, }, ) traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="traceNumber", title="Number for tracking", description=( "Trace number for tracking purposes. May be defined at the jurisdiction" " level or between trading partners." ), json_schema_extra={ "element_property": True, }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description=( "If the item is not a group then this is the fee for the product or " "service, otherwise this is the total of the fees for the details of " "the group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseAddItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "itemSequence", "detailSequence", "subdetailSequence", "traceNumber", "provider", "revenue", "productOrService", "productOrServiceEnd", "request", "modifier", "programCode", "servicedDate", "servicedPeriod", "locationCodeableConcept", "locationAddress", "locationReference", "quantity", "unitPrice", "factor", "tax", "net", "bodySite", "noteNumber", "reviewOutcome", "adjudication", "detail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseAddItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "location": [ "locationAddress", "locationCodeableConcept", "locationReference", ], "serviced": ["servicedDate", "servicedPeriod"], } return one_of_many_fields class ClaimResponseAddItemBodySite(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Anatomical location. Physical location where the service is performed or applies. """ __resource_type__ = "ClaimResponseAddItemBodySite" site: typing.List[fhirtypes.CodeableReferenceType] = Field( default=..., alias="site", title="Location", description="Physical service site on the patient (limb, tooth, etc.).", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["BodyStructure"], }, ) subSite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="subSite", title="Sub-location", description=( "A region or surface of the bodySite, e.g. limb region or tooth " "surface(s)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseAddItemBodySite`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "site", "subSite"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseAddItemBodySite`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ClaimResponseAddItemDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Insurer added line details. The second-tier service adjudications for payor added services. """ __resource_type__ = "ClaimResponseAddItemDetail" adjudication: typing.List[ fhirtypes.ClaimResponseItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Added items detail adjudication", description="The adjudication results.", json_schema_extra={ "element_property": True, }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The total amount claimed for the group (if a grouper) or the " "addItem.detail. Net = unit price * quantity * factor." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="Applicable note numbers", description=( "The numbers associated with notes below which apply to the " "adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) productOrService: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrService", title="Billing, service, product, or drug code", description=( "When the value is a group code then this item collects a set of " "related item details, otherwise this contains the product, service, " "drug or other billing code for the item. This element may be the start" " of a range of .productOrService codes used in conjunction with " ".productOrServiceEnd or it may be a solo element where " ".productOrServiceEnd is not used." ), json_schema_extra={ "element_property": True, }, ) productOrServiceEnd: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrServiceEnd", title="End of a range of codes", description=( "This contains the end of a range of product, service, drug or other " "billing codes for the item. This element is not used when the " ".productOrService is a group code. This value may only be present when" " a .productOfService code has been provided to convey the start of the" " range. Typically this value may be used only with preauthorizations " "and not with claims." ), json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of revenue or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) reviewOutcome: fhirtypes.ClaimResponseItemReviewOutcomeType | None = Field( default=None, alias="reviewOutcome", title="Added items detail level adjudication results", description=( "The high-level results of the adjudication if adjudication has been " "performed." ), json_schema_extra={ "element_property": True, }, ) subDetail: typing.List[ fhirtypes.ClaimResponseAddItemDetailSubDetailType ] | None = Field( default=None, alias="subDetail", title="Insurer added line items", description="The third-tier service adjudications for payor added services.", json_schema_extra={ "element_property": True, }, ) tax: fhirtypes.MoneyType | None = Field( default=None, alias="tax", title="Total tax", description="The total of taxes applicable for this product or service.", json_schema_extra={ "element_property": True, }, ) traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="traceNumber", title="Number for tracking", description=( "Trace number for tracking purposes. May be defined at the jurisdiction" " level or between trading partners." ), json_schema_extra={ "element_property": True, }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description=( "If the item is not a group then this is the fee for the product or " "service, otherwise this is the total of the fees for the details of " "the group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseAddItemDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "traceNumber", "revenue", "productOrService", "productOrServiceEnd", "modifier", "quantity", "unitPrice", "factor", "tax", "net", "noteNumber", "reviewOutcome", "adjudication", "subDetail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseAddItemDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ClaimResponseAddItemDetailSubDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Insurer added line items. The third-tier service adjudications for payor added services. """ __resource_type__ = "ClaimResponseAddItemDetailSubDetail" adjudication: typing.List[ fhirtypes.ClaimResponseItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Added items subdetail adjudication", description="The adjudication results.", json_schema_extra={ "element_property": True, }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The total amount claimed for the addItem.detail.subDetail. Net = unit " "price * quantity * factor." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="Applicable note numbers", description=( "The numbers associated with notes below which apply to the " "adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) productOrService: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrService", title="Billing, service, product, or drug code", description=( "When the value is a group code then this item collects a set of " "related item details, otherwise this contains the product, service, " "drug or other billing code for the item. This element may be the start" " of a range of .productOrService codes used in conjunction with " ".productOrServiceEnd or it may be a solo element where " ".productOrServiceEnd is not used." ), json_schema_extra={ "element_property": True, }, ) productOrServiceEnd: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrServiceEnd", title="End of a range of codes", description=( "This contains the end of a range of product, service, drug or other " "billing codes for the item. This element is not used when the " ".productOrService is a group code. This value may only be present when" " a .productOfService code has been provided to convey the start of the" " range. Typically this value may be used only with preauthorizations " "and not with claims." ), json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of revenue or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) reviewOutcome: fhirtypes.ClaimResponseItemReviewOutcomeType | None = Field( default=None, alias="reviewOutcome", title="Added items subdetail level adjudication results", description=( "The high-level results of the adjudication if adjudication has been " "performed." ), json_schema_extra={ "element_property": True, }, ) tax: fhirtypes.MoneyType | None = Field( default=None, alias="tax", title="Total tax", description="The total of taxes applicable for this product or service.", json_schema_extra={ "element_property": True, }, ) traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="traceNumber", title="Number for tracking", description=( "Trace number for tracking purposes. May be defined at the jurisdiction" " level or between trading partners." ), json_schema_extra={ "element_property": True, }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description=( "If the item is not a group then this is the fee for the product or " "service, otherwise this is the total of the fees for the details of " "the group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseAddItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "traceNumber", "revenue", "productOrService", "productOrServiceEnd", "modifier", "quantity", "unitPrice", "factor", "tax", "net", "noteNumber", "reviewOutcome", "adjudication", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseAddItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ClaimResponseError(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Processing errors. Errors encountered during the processing of the adjudication. """ __resource_type__ = "ClaimResponseError" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Error code detailing processing issues", description=( "An error code, from a specified code system, which details why the " "claim could not be adjudicated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) detailSequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="detailSequence", title="Detail sequence number", description=( "The sequence number of the detail within the line item submitted which" " contains the error. This value is omitted when the error occurs " "outside of the item structure." ), json_schema_extra={ "element_property": True, }, ) detailSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detailSequence", title="Extension field for ``detailSequence``.", ) expression: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="expression", title="FHIRPath of element(s) related to issue", description=( "A [simple subset of FHIRPath](fhirpath.html#simple) limited to element" " names, repetition indicators and the default child accessor that " "identifies one of the elements in the resource that caused this issue " "to be raised." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) expression__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) itemSequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="itemSequence", title="Item sequence number", description=( "The sequence number of the line item submitted which contains the " "error. This value is omitted when the error occurs outside of the item" " structure." ), json_schema_extra={ "element_property": True, }, ) itemSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_itemSequence", title="Extension field for ``itemSequence``.", ) subDetailSequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="subDetailSequence", title="Subdetail sequence number", description=( "The sequence number of the sub-detail within the detail within the " "line item submitted which contains the error. This value is omitted " "when the error occurs outside of the item structure." ), json_schema_extra={ "element_property": True, }, ) subDetailSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subDetailSequence", title="Extension field for ``subDetailSequence``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseError`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "itemSequence", "detailSequence", "subDetailSequence", "code", "expression", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseError`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "expression"] class ClaimResponseEvent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Event information. Information code for an event with a corresponding date or period. """ __resource_type__ = "ClaimResponseEvent" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Specific event", description="A coded event such as when a service is expected or a card printed.", json_schema_extra={ "element_property": True, }, ) whenDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="whenDateTime", title="Occurance date or period", description=( "A date or period in the past or future indicating when the event " "occurred or is expectd to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e when[x] "one_of_many": "when", "one_of_many_required": True, }, ) whenDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_whenDateTime", title="Extension field for ``whenDateTime``.", ) whenPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="whenPeriod", title="Occurance date or period", description=( "A date or period in the past or future indicating when the event " "occurred or is expectd to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e when[x] "one_of_many": "when", "one_of_many_required": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseEvent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "whenDateTime", "whenPeriod", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseEvent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"when": ["whenDateTime", "whenPeriod"]} return one_of_many_fields class ClaimResponseInsurance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Patient insurance information. Financial instruments for reimbursement for the health care products and services specified on the claim. """ __resource_type__ = "ClaimResponseInsurance" businessArrangement: fhirtypes.StringType | None = Field( default=None, alias="businessArrangement", title="Additional provider contract number", description=( "A business agreement number established between the provider and the " "insurer for special business processing purposes." ), json_schema_extra={ "element_property": True, }, ) businessArrangement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_businessArrangement", title="Extension field for ``businessArrangement``.", ) claimResponse: fhirtypes.ReferenceType | None = Field( default=None, alias="claimResponse", title="Adjudication results", description=( "The result of the adjudication of the line items for the Coverage " "specified in this insurance." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ClaimResponse"], }, ) coverage: fhirtypes.ReferenceType = Field( default=..., alias="coverage", title="Insurance information", description=( "Reference to the insurance card level information contained in the " "Coverage resource. The coverage issuing insurer will use these details" " to locate the patient's actual coverage within the insurer's " "information system." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage"], }, ) focal: bool | None = Field( default=None, alias="focal", title="Coverage to be used for adjudication", description=( "A flag to indicate that this Coverage is to be used for adjudication " "of this claim when set to true." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) focal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_focal", title="Extension field for ``focal``." ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Insurance instance identifier", description=( "A number to uniquely identify insurance entries and provide a sequence" " of coverages to convey coordination of benefit order." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseInsurance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "focal", "coverage", "businessArrangement", "claimResponse", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseInsurance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("focal", "focal__ext"), ("sequence", "sequence__ext")] return required_fields class ClaimResponseItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Adjudication for claim line items. A claim line. Either a simple (a product or service) or a 'group' of details which can also be a simple items or groups of sub-details. """ __resource_type__ = "ClaimResponseItem" adjudication: typing.List[ fhirtypes.ClaimResponseItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Adjudication details", description=( "If this item is a group then the values here are a summary of the " "adjudication of the detail items. If this item is a simple product or " "service then this is the result of the adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) detail: typing.List[fhirtypes.ClaimResponseItemDetailType] | None = Field( default=None, alias="detail", title="Adjudication for claim details", description=( "A claim detail. Either a simple (a product or service) or a 'group' of" " sub-details which are simple items." ), json_schema_extra={ "element_property": True, }, ) itemSequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="itemSequence", title="Claim item instance identifier", description="A number to uniquely reference the claim item entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) itemSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_itemSequence", title="Extension field for ``itemSequence``.", ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="Applicable note numbers", description=( "The numbers associated with notes below which apply to the " "adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) reviewOutcome: fhirtypes.ClaimResponseItemReviewOutcomeType | None = Field( default=None, alias="reviewOutcome", title="Adjudication results", description=( "The high-level results of the adjudication if adjudication has been " "performed." ), json_schema_extra={ "element_property": True, }, ) traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="traceNumber", title="Number for tracking", description=( "Trace number for tracking purposes. May be defined at the jurisdiction" " level or between trading partners." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "itemSequence", "traceNumber", "noteNumber", "reviewOutcome", "adjudication", "detail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("itemSequence", "itemSequence__ext")] return required_fields class ClaimResponseItemAdjudication(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Adjudication details. If this item is a group then the values here are a summary of the adjudication of the detail items. If this item is a simple product or service then this is the result of the adjudication of this item. """ __resource_type__ = "ClaimResponseItemAdjudication" amount: fhirtypes.MoneyType | None = Field( default=None, alias="amount", title="Monetary amount", description="Monetary amount associated with the category.", json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType = Field( default=..., alias="category", title="Type of adjudication information", description=( "A code to indicate the information type of this adjudication record. " "Information types may include the value submitted, maximum values or " "percentages allowed or payable under the plan, amounts that: the " "patient is responsible for in aggregate or pertaining to this item; " "amounts paid by other coverages; and, the benefit payable for this " "item." ), json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Non-monetary value", description=( "A non-monetary value associated with the category. Mutually exclusive " "to the amount element above." ), json_schema_extra={ "element_property": True, }, ) reason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reason", title="Explanation of adjudication outcome", description=( "A code supporting the understanding of the adjudication result and " "explaining variance from expected amount." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseItemAdjudication`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "category", "reason", "amount", "quantity", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseItemAdjudication`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ClaimResponseItemDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Adjudication for claim details. A claim detail. Either a simple (a product or service) or a 'group' of sub- details which are simple items. """ __resource_type__ = "ClaimResponseItemDetail" adjudication: typing.List[ fhirtypes.ClaimResponseItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Detail level adjudication details", description="The adjudication results.", json_schema_extra={ "element_property": True, }, ) detailSequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="detailSequence", title="Claim detail instance identifier", description="A number to uniquely reference the claim detail entry.", json_schema_extra={ "element_property": True, "element_required": True, }, ) detailSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detailSequence", title="Extension field for ``detailSequence``.", ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="Applicable note numbers", description=( "The numbers associated with notes below which apply to the " "adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) reviewOutcome: fhirtypes.ClaimResponseItemReviewOutcomeType | None = Field( default=None, alias="reviewOutcome", title="Detail level adjudication results", description=( "The high-level results of the adjudication if adjudication has been " "performed." ), json_schema_extra={ "element_property": True, }, ) subDetail: typing.List[ fhirtypes.ClaimResponseItemDetailSubDetailType ] | None = Field( default=None, alias="subDetail", title="Adjudication for claim sub-details", description="A sub-detail adjudication of a simple product or service.", json_schema_extra={ "element_property": True, }, ) traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="traceNumber", title="Number for tracking", description=( "Trace number for tracking purposes. May be defined at the jurisdiction" " level or between trading partners." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseItemDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "detailSequence", "traceNumber", "noteNumber", "reviewOutcome", "adjudication", "subDetail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseItemDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("detailSequence", "detailSequence__ext")] return required_fields class ClaimResponseItemDetailSubDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Adjudication for claim sub-details. A sub-detail adjudication of a simple product or service. """ __resource_type__ = "ClaimResponseItemDetailSubDetail" adjudication: typing.List[ fhirtypes.ClaimResponseItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Subdetail level adjudication details", description="The adjudication results.", json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="Applicable note numbers", description=( "The numbers associated with notes below which apply to the " "adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) reviewOutcome: fhirtypes.ClaimResponseItemReviewOutcomeType | None = Field( default=None, alias="reviewOutcome", title="Subdetail level adjudication results", description=( "The high-level results of the adjudication if adjudication has been " "performed." ), json_schema_extra={ "element_property": True, }, ) subDetailSequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="subDetailSequence", title="Claim sub-detail instance identifier", description="A number to uniquely reference the claim sub-detail entry.", json_schema_extra={ "element_property": True, "element_required": True, }, ) subDetailSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subDetailSequence", title="Extension field for ``subDetailSequence``.", ) traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="traceNumber", title="Number for tracking", description=( "Trace number for tracking purposes. May be defined at the jurisdiction" " level or between trading partners." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "subDetailSequence", "traceNumber", "noteNumber", "reviewOutcome", "adjudication", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("subDetailSequence", "subDetailSequence__ext")] return required_fields class ClaimResponseItemReviewOutcome(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Adjudication results. The high-level results of the adjudication if adjudication has been performed. """ __resource_type__ = "ClaimResponseItemReviewOutcome" decision: fhirtypes.CodeableConceptType | None = Field( default=None, alias="decision", title="Result of the adjudication", description=( "The result of the claim, predetermination, or preauthorization " "adjudication." ), json_schema_extra={ "element_property": True, }, ) preAuthPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="preAuthPeriod", title="Preauthorization reference effective period", description="The time frame during which this authorization is effective.", json_schema_extra={ "element_property": True, }, ) preAuthRef: fhirtypes.StringType | None = Field( default=None, alias="preAuthRef", title="Preauthorization reference", description=( "Reference from the Insurer which is used in later communications which" " refers to this adjudication." ), json_schema_extra={ "element_property": True, }, ) preAuthRef__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preAuthRef", title="Extension field for ``preAuthRef``." ) reason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reason", title="Reason for result of the adjudication", description=( "The reasons for the result of the claim, predetermination, or " "preauthorization adjudication." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseItemReviewOutcome`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "decision", "reason", "preAuthRef", "preAuthPeriod", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseItemReviewOutcome`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ClaimResponsePayment(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Payment Details. Payment details for the adjudication of the claim. """ __resource_type__ = "ClaimResponsePayment" adjustment: fhirtypes.MoneyType | None = Field( default=None, alias="adjustment", title="Payment adjustment for non-claim issues", description=( "Total amount of all adjustments to this payment included in this " "transaction which are not related to this claim's adjudication." ), json_schema_extra={ "element_property": True, }, ) adjustmentReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="adjustmentReason", title="Explanation for the adjustment", description="Reason for the payment adjustment.", json_schema_extra={ "element_property": True, }, ) amount: fhirtypes.MoneyType = Field( default=..., alias="amount", title="Payable amount after adjustment", description="Benefits payable less any payment adjustment.", json_schema_extra={ "element_property": True, }, ) date: fhirtypes.DateType | None = Field( default=None, alias="date", title="Expected date of payment", description=( "Estimated date the payment will be issued or the actual issue date of " "payment." ), json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Business identifier for the payment", description="Issuer's unique identifier for the payment instrument.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Partial or complete payment", description=( "Whether this represents partial or complete payment of the benefits " "payable." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponsePayment`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "adjustment", "adjustmentReason", "date", "amount", "identifier", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponsePayment`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ClaimResponseProcessNote(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Note concerning adjudication. A note that describes or explains adjudication results in a human readable form. """ __resource_type__ = "ClaimResponseProcessNote" language: fhirtypes.CodeableConceptType | None = Field( default=None, alias="language", title="Language of the text", description="A code to define the language used in the text of the note.", json_schema_extra={ "element_property": True, }, ) number: fhirtypes.PositiveIntType | None = Field( default=None, alias="number", title="Note instance identifier", description="A number to uniquely identify a note entry.", json_schema_extra={ "element_property": True, }, ) number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_number", title="Extension field for ``number``." ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Note explanatory text", description="The explanation or description associated with the processing.", json_schema_extra={ "element_property": True, "element_required": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Note purpose", description="The business purpose of the note text.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseProcessNote`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "number", "type", "text", "language", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseProcessNote`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("text", "text__ext")] return required_fields class ClaimResponseTotal(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Adjudication totals. Categorized monetary totals for the adjudication. """ __resource_type__ = "ClaimResponseTotal" amount: fhirtypes.MoneyType = Field( default=..., alias="amount", title="Financial total for the category", description="Monetary total amount associated with the category.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) category: fhirtypes.CodeableConceptType = Field( default=..., alias="category", title="Type of adjudication information", description=( "A code to indicate the information type of this adjudication record. " "Information types may include: the value submitted, maximum values or " "percentages allowed or payable under the plan, amounts that the " "patient is responsible for in aggregate or pertaining to this item, " "amounts paid by other coverages, and the benefit payable for this " "item." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClaimResponseTotal`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "category", "amount"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClaimResponseTotal`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "category", "amount"] ================================================ FILE: fhir/resources/clinicalimpression.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ClinicalImpression Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ClinicalImpression(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A clinical assessment performed when planning treatments and management strategies for a patient. A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. """ __resource_type__ = "ClinicalImpression" changePattern: fhirtypes.CodeableConceptType | None = Field( default=None, alias="changePattern", title=( "Change in the status/pattern of a subject's condition since previously" " assessed, such as worsening, improving, or no change" ), description=( "Change in the status/pattern of a subject's condition since previously" " assessed, such as worsening, improving, or no change. It is a " "subjective assessment of the direction of the change." ), json_schema_extra={ "element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When the assessment was documented", description="Indicates when the documentation of the assessment was complete.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Why/how the assessment was performed", description=( "A summary of the context and/or cause of the assessment - why / where " "it was performed, and what patient events/status prompted it." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) effectiveDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="effectiveDateTime", title="Time of assessment", description="The point in time or period over which the subject was assessed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_effectiveDateTime", title="Extension field for ``effectiveDateTime``.", ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="Time of assessment", description="The point in time or period over which the subject was assessed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="The Encounter during which this ClinicalImpression was created", description=( "The Encounter during which this ClinicalImpression was created or to " "which the creation of this record is tightly associated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) finding: typing.List[fhirtypes.ClinicalImpressionFindingType] | None = Field( default=None, alias="finding", title="Possible or likely findings and diagnoses", description=( "Specific findings or diagnoses that were considered likely or relevant" " to ongoing treatment." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description=( "Business identifiers assigned to this clinical impression by the " "performer or other systems which remain constant as the resource is " "updated and propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the ClinicalImpression", description=( "Commentary about the impression, typically recorded after the " "impression itself was made, though supplemental notes by the original " "author could also appear." ), json_schema_extra={ "element_property": True, }, ) performer: fhirtypes.ReferenceType | None = Field( default=None, alias="performer", title="The clinician performing the assessment", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) previous: fhirtypes.ReferenceType | None = Field( default=None, alias="previous", title="Reference to last assessment", description=( "A reference to the last assessment that was conducted on this patient." " Assessments are often/usually ongoing in nature; a care provider " "(practitioner or team) will make new assessments on an ongoing basis " "as new data arises or the patient's conditions changes." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ClinicalImpression"], }, ) problem: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="problem", title="Relevant impressions of patient state", description="A list of the relevant problems/conditions for a patient.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "AllergyIntolerance"], }, ) prognosisCodeableConcept: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="prognosisCodeableConcept", title="Estimate of likely outcome", description=None, json_schema_extra={ "element_property": True, }, ) prognosisReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="prognosisReference", title="RiskAssessment expressing likely outcome", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["RiskAssessment"], }, ) protocol: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="protocol", title="Clinical Protocol followed", description=( "Reference to a specific published clinical protocol that was followed " "during this assessment, and/or that provides evidence in support of " "the diagnosis." ), json_schema_extra={ "element_property": True, }, ) protocol__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_protocol", title="Extension field for ``protocol``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "preparation | in-progress | not-done | on-hold | stopped | completed |" " entered-in-error | unknown" ), description="Identifies the workflow status of the assessment.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "preparation", "in-progress", "not-done", "on-hold", "stopped", "completed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="statusReason", title="Reason for current status", description="Captures the reason for the current state of the ClinicalImpression.", json_schema_extra={ "element_property": True, }, ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Patient or group assessed", description="The patient or group of individuals assessed as part of this record.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) summary: fhirtypes.StringType | None = Field( default=None, alias="summary", title="Summary of the assessment", description="A text summary of the investigations and the diagnosis.", json_schema_extra={ "element_property": True, }, ) summary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_summary", title="Extension field for ``summary``." ) supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInfo", title="Information supporting the clinical impression", description=( "Information supporting the clinical impression, which can contain " "investigation results." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClinicalImpression`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "statusReason", "description", "subject", "encounter", "effectiveDateTime", "effectivePeriod", "date", "performer", "previous", "problem", "changePattern", "protocol", "summary", "finding", "prognosisCodeableConcept", "prognosisReference", "supportingInfo", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClinicalImpression`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "description", "subject", "encounter", "effectiveDateTime", "effectivePeriod", "date", "performer", "problem", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"effective": ["effectiveDateTime", "effectivePeriod"]} return one_of_many_fields class ClinicalImpressionFinding(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Possible or likely findings and diagnoses. Specific findings or diagnoses that were considered likely or relevant to ongoing treatment. """ __resource_type__ = "ClinicalImpressionFinding" basis: fhirtypes.StringType | None = Field( default=None, alias="basis", title="Which investigations support finding", description="Which investigations support finding or diagnosis.", json_schema_extra={ "element_property": True, }, ) basis__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_basis", title="Extension field for ``basis``." ) item: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="item", title="What was found", description=( "Specific text, code or reference for finding or diagnosis, which may " "include ruled-out or resolved conditions." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "Observation", "DocumentReference"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClinicalImpressionFinding`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "item", "basis"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClinicalImpressionFinding`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/clinicalusedefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ClinicalUseDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ClinicalUseDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A single issue - either an indication, contraindication, interaction or an undesirable effect for a medicinal product, medication, device or procedure. """ __resource_type__ = "ClinicalUseDefinition" category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title=( "A categorisation of the issue, primarily for dividing warnings into " 'subject heading areas such as "Pregnancy", "Overdose"' ), description=( "A categorisation of the issue, primarily for dividing warnings into " 'subject heading areas such as "Pregnancy and Lactation", "Overdose", ' '"Effects on Ability to Drive and Use Machines".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contraindication: fhirtypes.ClinicalUseDefinitionContraindicationType | None = ( Field( default=None, alias="contraindication", title="Specifics for when this is a contraindication", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier for this issue", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) indication: fhirtypes.ClinicalUseDefinitionIndicationType | None = Field( default=None, alias="indication", title="Specifics for when this is an indication", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) interaction: fhirtypes.ClinicalUseDefinitionInteractionType | None = Field( default=None, alias="interaction", title="Specifics for when this is an interaction", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) library: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="library", title="Logic used by the clinical use definition", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Library"], }, ) library__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_library", title="Extension field for ``library``." ) population: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="population", title="The population group to which this applies", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) status: fhirtypes.CodeableConceptType | None = Field( default=None, alias="status", title="Whether this is a current issue or one that has been retired etc", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subject: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="subject", title=( "The medication, product, substance, device, procedure etc. for which " "this is an indication" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "MedicinalProductDefinition", "Medication", "ActivityDefinition", "PlanDefinition", "Device", "DeviceDefinition", "Substance", "NutritionProduct", "BiologicallyDerivedProduct", ], }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "indication | contraindication | interaction | undesirable-effect | " "warning" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "indication", "contraindication", "interaction", "undesirable-effect", "warning", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) undesirableEffect: fhirtypes.ClinicalUseDefinitionUndesirableEffectType | None = ( Field( default=None, alias="undesirableEffect", title="A possible negative outcome from the use of this treatment", description=( "Describe the possible undesirable effects (negative outcomes) from the" " use of the medicinal product as treatment." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ) warning: fhirtypes.ClinicalUseDefinitionWarningType | None = Field( default=None, alias="warning", title=( "Critical environmental, health or physical risks or hazards. For " "example 'Do not operate heavy machinery', 'May cause drowsiness'" ), description=( "A critical piece of information about environmental, health or " "physical risks or hazards that serve as caution to the user. For " "example 'Do not operate heavy machinery', 'May cause drowsiness', or " "'Get medical advice/attention if you feel unwell'." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClinicalUseDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "type", "category", "subject", "status", "contraindication", "indication", "interaction", "population", "library", "undesirableEffect", "warning", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "type", "category", "subject", "status", "contraindication", "indication", "interaction", "population", "library", "undesirableEffect", "warning", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields class ClinicalUseDefinitionContraindication(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specifics for when this is a contraindication. """ __resource_type__ = "ClinicalUseDefinitionContraindication" applicability: fhirtypes.ExpressionType | None = Field( default=None, alias="applicability", title=( "An expression that returns true or false, indicating whether the " "indication is applicable or not, after having applied its other " "elements" ), description=None, json_schema_extra={ "element_property": True, }, ) comorbidity: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="comorbidity", title="A comorbidity (concurrent condition) or coinfection", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) diseaseStatus: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="diseaseStatus", title="The status of the disease or symptom for the contraindication", description=( "The status of the disease or symptom for the contraindication, for " 'example "chronic" or "metastatic".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) diseaseSymptomProcedure: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="diseaseSymptomProcedure", title=( "The situation that is being documented as contraindicating against " "this item" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) indication: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="indication", title="The indication which this is a contraidication for", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ClinicalUseDefinition"], }, ) otherTherapy: typing.List[ fhirtypes.ClinicalUseDefinitionContraindicationOtherTherapyType ] | None = Field( default=None, alias="otherTherapy", title=( "Information about use of the product in relation to other therapies " "described as part of the contraindication" ), description=( "Information about the use of the medicinal product in relation to " "other therapies described as part of the contraindication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClinicalUseDefinitionContraindication`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "diseaseSymptomProcedure", "diseaseStatus", "comorbidity", "indication", "applicability", "otherTherapy", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionContraindication`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "diseaseSymptomProcedure", "diseaseStatus", "comorbidity", "indication", "otherTherapy", ] class ClinicalUseDefinitionContraindicationOtherTherapy( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about use of the product in relation to other therapies described as part of the contraindication. Information about the use of the medicinal product in relation to other therapies described as part of the contraindication. """ __resource_type__ = "ClinicalUseDefinitionContraindicationOtherTherapy" relationshipType: fhirtypes.CodeableConceptType = Field( default=..., alias="relationshipType", title=( "The type of relationship between the product " "indication/contraindication and another therapy" ), description=( "The type of relationship between the medicinal product indication or " "contraindication and another therapy." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) treatment: fhirtypes.CodeableReferenceType = Field( default=..., alias="treatment", title=( "Reference to a specific medication, substance etc. as part of an " "indication or contraindication" ), description=( "Reference to a specific medication (active substance, medicinal " "product or class of products, biological, food etc.) as part of an " "indication or contraindication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "MedicinalProductDefinition", "Medication", "Substance", "SubstanceDefinition", "NutritionProduct", "BiologicallyDerivedProduct", "ActivityDefinition", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClinicalUseDefinitionContraindicationOtherTherapy`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "relationshipType", "treatment"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionContraindicationOtherTherapy`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "relationshipType", "treatment"] class ClinicalUseDefinitionIndication(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specifics for when this is an indication. """ __resource_type__ = "ClinicalUseDefinitionIndication" applicability: fhirtypes.ExpressionType | None = Field( default=None, alias="applicability", title=( "An expression that returns true or false, indicating whether the " "indication is applicable or not, after having applied its other " "elements" ), description=None, json_schema_extra={ "element_property": True, }, ) comorbidity: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="comorbidity", title="A comorbidity or coinfection as part of the indication", description=( "A comorbidity (concurrent condition) or coinfection as part of the " "indication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) diseaseStatus: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="diseaseStatus", title="The status of the disease or symptom for the indication", description=( "The status of the disease or symptom for the indication, for example " '"chronic" or "metastatic".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) diseaseSymptomProcedure: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="diseaseSymptomProcedure", title="The situation that is being documented as an indicaton for this item", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) durationRange: fhirtypes.RangeType | None = Field( default=None, alias="durationRange", title="Timing or duration information", description=( "Timing or duration information, that may be associated with use with " "the indicated condition e.g. Adult patients suffering from myocardial " "infarction (from a few days until less than 35 days), ischaemic stroke" " (from 7 days until less than 6 months)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e duration[x] "one_of_many": "duration", "one_of_many_required": False, }, ) durationString: fhirtypes.StringType | None = Field( default=None, alias="durationString", title="Timing or duration information", description=( "Timing or duration information, that may be associated with use with " "the indicated condition e.g. Adult patients suffering from myocardial " "infarction (from a few days until less than 35 days), ischaemic stroke" " (from 7 days until less than 6 months)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e duration[x] "one_of_many": "duration", "one_of_many_required": False, }, ) durationString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_durationString", title="Extension field for ``durationString``.", ) intendedEffect: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="intendedEffect", title="The intended effect, aim or strategy to be achieved", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) otherTherapy: typing.List[ fhirtypes.ClinicalUseDefinitionContraindicationOtherTherapyType ] | None = Field( default=None, alias="otherTherapy", title=( "The use of the medicinal product in relation to other therapies " "described as part of the indication" ), description=( "Information about the use of the medicinal product in relation to " "other therapies described as part of the indication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) undesirableEffect: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="undesirableEffect", title=( "An unwanted side effect or negative outcome of the subject of this " "resource when being used for this indication" ), description=( "An unwanted side effect or negative outcome that may happen if you use" " the drug (or other subject of this resource) for this indication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ClinicalUseDefinition"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClinicalUseDefinitionIndication`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "diseaseSymptomProcedure", "diseaseStatus", "comorbidity", "intendedEffect", "durationRange", "durationString", "undesirableEffect", "applicability", "otherTherapy", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionIndication`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "diseaseSymptomProcedure", "diseaseStatus", "comorbidity", "intendedEffect", "durationRange", "durationString", "undesirableEffect", "otherTherapy", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"duration": ["durationRange", "durationString"]} return one_of_many_fields class ClinicalUseDefinitionInteraction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specifics for when this is an interaction. """ __resource_type__ = "ClinicalUseDefinitionInteraction" effect: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="effect", title=( 'The effect of the interaction, for example "reduced gastric absorption' ' of primary medication"' ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) incidence: fhirtypes.CodeableConceptType | None = Field( default=None, alias="incidence", title="The incidence of the interaction, e.g. theoretical, observed", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) interactant: typing.List[ fhirtypes.ClinicalUseDefinitionInteractionInteractantType ] | None = Field( default=None, alias="interactant", title=( "The specific medication, product, food etc. or laboratory test that " "interacts" ), description=( "The specific medication, product, food, substance etc. or laboratory " "test that interacts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) management: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="management", title="Actions for managing the interaction", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title=( "The type of the interaction e.g. drug-drug interaction, drug-lab test " "interaction" ), description=( "The type of the interaction e.g. drug-drug interaction, drug-food " "interaction, drug-lab test interaction." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClinicalUseDefinitionInteraction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "interactant", "type", "effect", "incidence", "management", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionInteraction`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "interactant", "type", "effect", "incidence", "management", ] class ClinicalUseDefinitionInteractionInteractant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The specific medication, product, food etc. or laboratory test that interacts. The specific medication, product, food, substance etc. or laboratory test that interacts. """ __resource_type__ = "ClinicalUseDefinitionInteractionInteractant" itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="itemCodeableConcept", title=( "The specific medication, product, food etc. or laboratory test that " "interacts" ), description=( "The specific medication, product, food, substance etc. or laboratory " "test that interacts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": True, }, ) itemReference: fhirtypes.ReferenceType | None = Field( default=None, alias="itemReference", title=( "The specific medication, product, food etc. or laboratory test that " "interacts" ), description=( "The specific medication, product, food, substance etc. or laboratory " "test that interacts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "MedicinalProductDefinition", "Medication", "Substance", "NutritionProduct", "BiologicallyDerivedProduct", "ObservationDefinition", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClinicalUseDefinitionInteractionInteractant`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "itemReference", "itemCodeableConcept", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionInteractionInteractant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "itemReference", "itemCodeableConcept"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"item": ["itemCodeableConcept", "itemReference"]} return one_of_many_fields class ClinicalUseDefinitionUndesirableEffect(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A possible negative outcome from the use of this treatment. Describe the possible undesirable effects (negative outcomes) from the use of the medicinal product as treatment. """ __resource_type__ = "ClinicalUseDefinitionUndesirableEffect" classification: fhirtypes.CodeableConceptType | None = Field( default=None, alias="classification", title="High level classification of the effect", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) frequencyOfOccurrence: fhirtypes.CodeableConceptType | None = Field( default=None, alias="frequencyOfOccurrence", title="How often the effect is seen", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) symptomConditionEffect: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="symptomConditionEffect", title="The situation in which the undesirable effect may manifest", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClinicalUseDefinitionUndesirableEffect`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "symptomConditionEffect", "classification", "frequencyOfOccurrence", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionUndesirableEffect`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "symptomConditionEffect", "classification", "frequencyOfOccurrence", ] class ClinicalUseDefinitionWarning(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Critical environmental, health or physical risks or hazards. For example 'Do not operate heavy machinery', 'May cause drowsiness'. A critical piece of information about environmental, health or physical risks or hazards that serve as caution to the user. For example 'Do not operate heavy machinery', 'May cause drowsiness', or 'Get medical advice/attention if you feel unwell'. """ __resource_type__ = "ClinicalUseDefinitionWarning" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="A coded or unformatted textual definition of this warning", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="A textual definition of this warning, with formatting", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ClinicalUseDefinitionWarning`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "description", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionWarning`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "description", "code"] ================================================ FILE: fhir/resources/codeableconcept.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CodeableConcept Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class CodeableConcept(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Concept - reference to a terminology or just text. A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. """ __resource_type__ = "CodeableConcept" coding: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="coding", title="Code defined by a terminology system", description="A reference to a code defined by a terminology system.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Plain text representation of the concept", description=( "A human language representation of the concept as " "seen/selected/uttered by the user who entered the data and/or which " "represents the intended meaning of the user." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CodeableConcept`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "coding", "text"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CodeableConcept`` according to specification, with preserving the original sequence order. """ return ["coding", "text"] ================================================ FILE: fhir/resources/codeablereference.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CodeableReference Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class CodeableReference(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Reference to a resource or a concept. A reference to a resource (by instance), or instead, a reference to a concept defined in a terminology or ontology (by class). """ __resource_type__ = "CodeableReference" concept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="concept", title="Reference to a concept (by class)", description=( "A reference to a concept - e.g. the information is identified by its " "general class to the degree of precision found in the terminology." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reference: fhirtypes.ReferenceType | None = Field( default=None, alias="reference", title="Reference to a resource (by instance)", description=( "A reference to a resource the provides exact details about the " "information being referenced." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CodeableReference`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "concept", "reference"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CodeableReference`` according to specification, with preserving the original sequence order. """ return ["concept", "reference"] ================================================ FILE: fhir/resources/codesystem.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CodeSystem Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class CodeSystem(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Declares the existence of and describes a code system or code system supplement. The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content. """ __resource_type__ = "CodeSystem" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the CodeSystem was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the CodeSystem", description=( "An individiual or organization primarily involved in the creation and " "maintenance of the CodeSystem." ), json_schema_extra={ "element_property": True, }, ) caseSensitive: bool | None = Field( default=None, alias="caseSensitive", title="If code comparison is case sensitive", description=( "If code comparison is case sensitive when codes within this system are" " compared to each other." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) caseSensitive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_caseSensitive", title="Extension field for ``caseSensitive``.", ) compositional: bool | None = Field( default=None, alias="compositional", title="If code system defines a compositional grammar", description="The code system defines a compositional (post-coordination) grammar.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) compositional__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_compositional", title="Extension field for ``compositional``.", ) concept: typing.List[fhirtypes.CodeSystemConceptType] | None = Field( default=None, alias="concept", title="Concepts in the code system", description=( "Concepts that are in the code system. The concept definitions are " "inherently hierarchical, but the definitions must be consulted to " "determine what the meanings of the hierarchical relationships are." ), json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) content: fhirtypes.CodeType | None = Field( default=None, alias="content", title="not-present | example | fragment | complete | supplement", description=( "The extent of the content of the code system (the concepts and codes " "it defines) are represented in this resource instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "not-present", "example", "fragment", "complete", "supplement", ], }, ) content__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_content", title="Extension field for ``content``." ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the code system and/or its contents." " Copyright statements are generally legal restrictions on the use and " "publishing of the code system." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) count: fhirtypes.UnsignedIntType | None = Field( default=None, alias="count", title="Total concepts in the code system", description=( "The total number of concepts defined by the code system. Where the " "code system has a compositional grammar, the basis of this count is " "defined by the system steward." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_count", title="Extension field for ``count``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the code system was last " "significantly changed. The date must change when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the code system " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the code system", description=( "A free text natural language description of the code system from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the CodeSystem", description=( "An individual or organization primarily responsible for internal " "coherence of the CodeSystem." ), json_schema_extra={ "element_property": True, }, ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the CodeSystem is expected to be used", description=( "The period during which the CodeSystem content was or is planned to be" " in active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the CodeSystem", description=( "An individual or organization asserted by the publisher to be " "responsible for officially endorsing the CodeSystem for use in some " "setting." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this code system is authored for " "testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) filter: typing.List[fhirtypes.CodeSystemFilterType] | None = Field( default=None, alias="filter", title="Filter that can be used in a value set", description=( "A filter that can be used in a value set compose statement when " "selecting concepts using a filter." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) hierarchyMeaning: fhirtypes.CodeType | None = Field( default=None, alias="hierarchyMeaning", title="grouped-by | is-a | part-of | classified-with", description=( "The meaning of the hierarchy of concepts as represented in this " "resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["grouped-by", "is-a", "part-of", "classified-with"], }, ) hierarchyMeaning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_hierarchyMeaning", title="Extension field for ``hierarchyMeaning``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the code system (business identifier)", description=( "A formal identifier that is used to identify this code system when it " "is represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for code system (if applicable)", description=( "A legal or geographic region in which the code system is intended to " "be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the CodeSystem was last reviewed by the publisher", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this code system (computer friendly)", description=( "A natural language name identifying the code system. This name should " "be usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) property: typing.List[fhirtypes.CodeSystemPropertyType] | None = Field( default=None, alias="property", title="Additional information supplied about each concept", description=( "A property defines an additional slot through which additional " "information can be provided about a concept." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the code system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this code system is defined", description=( "Explanation of why this code system is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Additional documentation, citations, etc", description=( "Related artifacts such as additional documentation, justification, " "dependencies, bibliographic references, and predecessor and successor " "artifacts." ), json_schema_extra={ "element_property": True, }, ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the CodeSystem", description=( "An individual or organization asserted by the publisher to be " "primarily responsible for review of some aspect of the CodeSystem." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this code system. Enables tracking the life-cycle of the" " content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) supplements: fhirtypes.CanonicalType | None = Field( default=None, alias="supplements", title="Canonical URL of Code System this adds designations and properties to", description=( "The canonical URL of the code system that this code system supplement " "is adding designations and properties to." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CodeSystem"], }, ) supplements__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_supplements", title="Extension field for ``supplements``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this code system (human friendly)", description="A short, descriptive, user-friendly title for the code system.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) topic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="topic", title="E.g. Education, Treatment, Assessment, etc", description=( "Descriptions related to the content of the CodeSystem. Topics provide " "a high-level categorization as well as keywords for the CodeSystem " "that can be useful for filtering and searching." ), json_schema_extra={ "element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this code system, represented as a URI " "(globally unique) (Coding.system)" ), description=( "An absolute URI that is used to identify this code system when it is " "referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which an authoritative instance of this" " code system is (or will be) published. This URL can be the target of " "a canonical reference. It SHALL remain the same when the code system " "is stored on different servers. This is used in " "[Coding](datatypes.html#Coding).system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate code system instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueSet: fhirtypes.CanonicalType | None = Field( default=None, alias="valueSet", title="Canonical reference to the value set with entire code system", description=( "Canonical reference to the value set that contains all codes in the " "code system independent of code status." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueSet", title="Extension field for ``valueSet``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the code system (Coding.version)", description=( "The identifier that is used to identify this version of the code " "system when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the code system author" " and is not expected to be globally unique. For example, it might be a" " timestamp (e.g. yyyymmdd) if a managed version is not available. " "There is also no expectation that versions can be placed in a " "lexicographical sequence. This is used in " "[Coding](datatypes.html#Coding).version." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which " "CodeSystem is more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which " "CodeSystem is more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) versionNeeded: bool | None = Field( default=None, alias="versionNeeded", title="If definitions are not stable", description=( "This flag is used to signify that the code system does not commit to " "concept permanence across versions. If true, a version must be " "specified when referencing this code system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) versionNeeded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionNeeded", title="Extension field for ``versionNeeded``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CodeSystem`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "copyrightLabel", "approvalDate", "lastReviewDate", "effectivePeriod", "topic", "author", "editor", "reviewer", "endorser", "relatedArtifact", "caseSensitive", "valueSet", "hierarchyMeaning", "compositional", "versionNeeded", "content", "supplements", "count", "filter", "property", "concept", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CodeSystem`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "effectivePeriod", "caseSensitive", "valueSet", "hierarchyMeaning", "compositional", "versionNeeded", "content", "supplements", "count", "filter", "property", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("content", "content__ext"), ("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields class CodeSystemConcept(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Concepts in the code system. Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meanings of the hierarchical relationships are. """ __resource_type__ = "CodeSystemConcept" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Code that identifies concept", description=( "A code - a text symbol - that uniquely identifies the concept within " "the code system." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) concept: typing.List[fhirtypes.CodeSystemConceptType] | None = Field( default=None, alias="concept", title="Child Concepts (is-a/contains/categorizes)", description=( "Defines children of a concept to produce a hierarchy of concepts. The " "nature of the relationships is variable (is-a/contains/categorizes) - " "see hierarchyMeaning." ), json_schema_extra={ "element_property": True, }, ) definition: fhirtypes.StringType | None = Field( default=None, alias="definition", title="Formal definition", description=( "The formal definition of the concept. The code system resource does " "not make formal definitions required, because of the prevalence of " "legacy systems. However, they are highly recommended, as without them " "there is no formal meaning associated with the concept." ), json_schema_extra={ "element_property": True, }, ) definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) designation: typing.List[fhirtypes.CodeSystemConceptDesignationType] | None = Field( default=None, alias="designation", title="Additional representations for the concept", description=( "Additional representations for the concept - other languages, aliases," " specialized purposes, used for particular purposes, etc." ), json_schema_extra={ "element_property": True, }, ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Text to display to the user", description=( "A human readable string that is the recommended default way to present" " this concept to a user." ), json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) property: typing.List[fhirtypes.CodeSystemConceptPropertyType] | None = Field( default=None, alias="property", title="Property value for the concept", description="A property value for this concept.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CodeSystemConcept`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "display", "definition", "designation", "property", "concept", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CodeSystemConcept`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields class CodeSystemConceptDesignation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional representations for the concept. Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc. """ __resource_type__ = "CodeSystemConceptDesignation" additionalUse: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="additionalUse", title="Additional ways how this designation would be used", description=( "Additional codes that detail how this designation would be used, if " "there is more than one use." ), json_schema_extra={ "element_property": True, }, ) language: fhirtypes.CodeType | None = Field( default=None, alias="language", title="Human language of the designation", description="The language this designation is defined for.", json_schema_extra={ "element_property": True, }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) use: fhirtypes.CodingType | None = Field( default=None, alias="use", title="Details how this designation would be used", description="A code that details how this designation would be used.", json_schema_extra={ "element_property": True, }, ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The text value for this designation", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CodeSystemConceptDesignation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "language", "use", "additionalUse", "value", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CodeSystemConceptDesignation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("value", "value__ext")] return required_fields class CodeSystemConceptProperty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Property value for the concept. A property value for this concept. """ __resource_type__ = "CodeSystemConceptProperty" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Reference to CodeSystem.property.code", description="A code that is a reference to CodeSystem.property.code.", json_schema_extra={ "element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CodeSystemConceptProperty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "valueCode", "valueCoding", "valueString", "valueInteger", "valueBoolean", "valueDateTime", "valueDecimal", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CodeSystemConceptProperty`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueCode", "valueCoding", "valueDateTime", "valueDecimal", "valueInteger", "valueString", ] } return one_of_many_fields class CodeSystemFilter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Filter that can be used in a value set. A filter that can be used in a value set compose statement when selecting concepts using a filter. """ __resource_type__ = "CodeSystemFilter" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Code that identifies the filter", description=( "The code that identifies this filter when it is used as a filter in " "[ValueSet](valueset.html#).compose.include.filter." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="How or why the filter is used", description="A description of how or why the filter is used.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) operator: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="operator", title=( "= | is-a | descendent-of | is-not-a | regex | in | not-in | " "generalizes | child-of | descendent-leaf | exists" ), description="A list of operators that can be used with the filter.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "=", "is-a", "descendent-of", "is-not-a", "regex", "in", "not-in", "generalizes", "child-of", "descendent-leaf", "exists", ], }, ) operator__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_operator", title="Extension field for ``operator``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="What to use for the value", description="A description of what the value for the filter should be.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CodeSystemFilter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "description", "operator", "value", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CodeSystemFilter`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "description", "operator", "value"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("code", "code__ext"), ("operator", "operator__ext"), ("value", "value__ext"), ] return required_fields class CodeSystemProperty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional information supplied about each concept. A property defines an additional slot through which additional information can be provided about a concept. """ __resource_type__ = "CodeSystemProperty" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title=( "Identifies the property on the concepts, and when referred to in " "operations" ), description=( "A code that is used to identify the property. The code is used " "internally (in CodeSystem.concept.property.code) and also externally, " "such as in property filters." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Why the property is defined, and/or what it conveys", description=( "A description of the property- why it is defined, and how its value " "might be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="code | Coding | string | integer | boolean | dateTime | decimal", description=( 'The type of the property value. Properties of type "code" contain a ' "code defined by the code system (e.g. a reference to another defined " "concept)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "code", "Coding", "string", "integer", "boolean", "dateTime", "decimal", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) uri: fhirtypes.UriType | None = Field( default=None, alias="uri", title="Formal identifier for the property", description=( "Reference to the formal meaning of the property. One possible source " "of meaning is the [Concept Properties](codesystem-concept-" "properties.html) code system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uri", title="Extension field for ``uri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CodeSystemProperty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "uri", "description", "type", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CodeSystemProperty`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "uri", "description", "type"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext"), ("type", "type__ext")] return required_fields ================================================ FILE: fhir/resources/coding.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Coding Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class Coding(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A reference to a code defined by a terminology system. """ __resource_type__ = "Coding" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Symbol in syntax defined by the system", description=( "A symbol in syntax defined by the system. The symbol may be a " "predefined code or an expression in a syntax defined by the coding " "system (e.g. post-coordination)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Representation defined by the system", description=( "A representation of the meaning of the code in the system, following " "the rules of the system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) system: fhirtypes.UriType | None = Field( default=None, alias="system", title="Identity of the terminology system", description=( "The identification of the code system that defines the meaning of the " "symbol in the code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) userSelected: bool | None = Field( default=None, alias="userSelected", title="If this coding was chosen directly by the user", description=( "Indicates that this coding was chosen by a user directly - e.g. off a " "pick list of available items (codes or displays)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) userSelected__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_userSelected", title="Extension field for ``userSelected``.", ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Version of the system - if relevant", description=( "The version of the code system which was used when choosing this code." " Note that a well-maintained code system does not need the version " "reported, because the meaning of codes is consistent across versions. " "However this cannot consistently be assured, and when the meaning is " "not guaranteed to be consistent, the version SHOULD be exchanged." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Coding`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "system", "version", "code", "display", "userSelected", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Coding`` according to specification, with preserving the original sequence order. """ return ["system", "version", "code", "display", "userSelected"] ================================================ FILE: fhir/resources/communication.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Communication Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Communication(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A clinical or business level record of information being transmitted or shared. A clinical or business level record of information being transmitted or shared; e.g. an alert that was sent to a responsible provider, a public health agency communication to a provider/reporter in response to a case report for a reportable condition. """ __resource_type__ = "Communication" about: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="about", title="Resources that pertain to this communication", description=( "Other resources that pertain to this communication and to which this " "communication should be associated." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Request fulfilled by this communication", description=( "An order, proposal or plan fulfilled in whole or in part by this " "Communication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Message category", description=( "The type of message conveyed such as alert, notification, reminder, " "instruction, etc." ), json_schema_extra={ "element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="The Encounter during which this Communication was created", description=( "The Encounter during which this Communication was created or to which " "the creation of this record is tightly associated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique identifier", description=( "Business identifiers assigned to this communication by the performer " "or other systems which remain constant as the resource is updated and " "propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) inResponseTo: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="inResponseTo", title="Reply to", description="Prior communication that this communication is in response to.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Communication"], }, ) instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="instantiatesCanonical", title="Instantiates FHIR protocol or definition", description=( "The URL pointing to a FHIR-defined protocol, guideline, orderset or " "other definition that is adhered to in whole or in part by this " "Communication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "PlanDefinition", "ActivityDefinition", "Measure", "OperationDefinition", "Questionnaire", ], }, ) instantiatesCanonical__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="instantiatesUri", title="Instantiates external protocol or definition", description=( "The URL pointing to an externally maintained protocol, guideline, " "orderset or other definition that is adhered to in whole or in part by" " this Communication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) medium: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="medium", title="A channel of communication", description="A channel that was used for this communication (e.g. email, fax).", json_schema_extra={ "element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the communication", description=( "Additional notes or commentary about the communication by the sender, " "receiver or other interested parties." ), json_schema_extra={ "element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced event (e.g. Communication, Procedure)", description=( "A larger event (e.g. Communication, Procedure) of which this " "particular communication is a component or step." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) payload: typing.List[fhirtypes.CommunicationPayloadType] | None = Field( default=None, alias="payload", title="Message payload", description=( "Text, attachment(s), or resource(s) that was communicated to the " "recipient." ), json_schema_extra={ "element_property": True, }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Characterizes how quickly the planned or in progress communication " "must be addressed. Includes concepts such as stat, urgent, routine." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="reason", title="Indication for message", description="The reason or justification for the communication.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) received: fhirtypes.DateTimeType | None = Field( default=None, alias="received", title="When received", description="The time when this communication arrived at the destination.", json_schema_extra={ "element_property": True, }, ) received__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_received", title="Extension field for ``received``." ) recipient: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="recipient", title="Who the information is shared with", description=( "The entity (e.g. person, organization, clinical information system, " "care team or device) which is the target of the communication." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CareTeam", "Device", "Group", "HealthcareService", "Location", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Endpoint", ], }, ) sender: fhirtypes.ReferenceType | None = Field( default=None, alias="sender", title="Who shares the information", description=( "The entity (e.g. person, organization, clinical information system, or" " device) which is the source of the communication." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "HealthcareService", "Endpoint", "CareTeam", ], }, ) sent: fhirtypes.DateTimeType | None = Field( default=None, alias="sent", title="When sent", description="The time when this communication was sent.", json_schema_extra={ "element_property": True, }, ) sent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sent", title="Extension field for ``sent``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "preparation | in-progress | not-done | on-hold | stopped | completed |" " entered-in-error | unknown" ), description="The status of the transmission.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "preparation", "in-progress", "not-done", "on-hold", "stopped", "completed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="statusReason", title="Reason for current status", description="Captures the reason for the current state of the Communication.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Focus of message", description="The patient or group that was the focus of this communication.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) topic: fhirtypes.CodeableConceptType | None = Field( default=None, alias="topic", title="Description of the purpose/content", description=( "Description of the purpose/content, similar to a subject line in an " "email." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Communication`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "partOf", "inResponseTo", "status", "statusReason", "category", "priority", "medium", "subject", "topic", "about", "encounter", "sent", "received", "recipient", "sender", "reason", "payload", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Communication`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "partOf", "status", "statusReason", "priority", "subject", "encounter", "reason", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class CommunicationPayload(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Message payload. Text, attachment(s), or resource(s) that was communicated to the recipient. """ __resource_type__ = "CommunicationPayload" contentAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="contentAttachment", title="Message part content", description=( "A communicated content (or for multi-part communications, one portion " "of the communication)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, }, ) contentCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="contentCodeableConcept", title="Message part content", description=( "A communicated content (or for multi-part communications, one portion " "of the communication)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, }, ) contentReference: fhirtypes.ReferenceType | None = Field( default=None, alias="contentReference", title="Message part content", description=( "A communicated content (or for multi-part communications, one portion " "of the communication)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CommunicationPayload`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "contentAttachment", "contentReference", "contentCodeableConcept", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CommunicationPayload`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "content": [ "contentAttachment", "contentCodeableConcept", "contentReference", ] } return one_of_many_fields ================================================ FILE: fhir/resources/communicationrequest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CommunicationRequest Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class CommunicationRequest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A request for information to be sent to a receiver. A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition. """ __resource_type__ = "CommunicationRequest" about: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="about", title="Resources that pertain to this communication request", description=( "Other resources that pertain to this communication request and to " "which this communication request should be associated." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) authoredOn: fhirtypes.DateTimeType | None = Field( default=None, alias="authoredOn", title="When request transitioned to being actionable", description=( "For draft requests, indicates the date of initial creation. For " "requests with other statuses, indicates the date of activation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoredOn", title="Extension field for ``authoredOn``." ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Fulfills plan or proposal", description=( "A plan or proposal that is fulfilled in whole or in part by this " "request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Message category", description=( "The type of message to be sent such as alert, notification, reminder, " "instruction, etc." ), json_schema_extra={ "element_property": True, }, ) doNotPerform: bool | None = Field( default=None, alias="doNotPerform", title="True if request is prohibiting action", description=( "If true indicates that the CommunicationRequest is asking for the " "specified action to *not* occur." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doNotPerform", title="Extension field for ``doNotPerform``.", ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="The Encounter during which this CommunicationRequest was created", description=( "The Encounter during which this CommunicationRequest was created or to" " which the creation of this record is tightly associated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) groupIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="groupIdentifier", title="Composite request this is part of", description=( "A shared identifier common to multiple independent Request instances " "that were activated/authorized more or less simultaneously by a single" " author. The presence of the same identifier on each request ties " "those requests together and may have business ramifications in terms " "of reporting of results, billing, etc. E.g. a requisition number " "shared by a set of lab tests ordered together, or a prescription " "number shared by all meds ordered at one time." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique identifier", description=( "Business identifiers assigned to this communication request by the " "performer or other systems which remain constant as the resource is " "updated and propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) informationProvider: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="informationProvider", title="Who should share the information", description=( "The entity (e.g. person, organization, clinical information system, or" " device) which is to be the source of the communication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "HealthcareService", "Endpoint", ], }, ) intent: fhirtypes.CodeType | None = Field( default=None, alias="intent", title=( "proposal | plan | directive | order | original-order | reflex-order | " "filler-order | instance-order | option" ), description=( "Indicates the level of authority/intentionality associated with the " "CommunicationRequest and where the request fits into the workflow " "chain." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "proposal", "plan", "directive", "order", "original-order", "reflex-order", "filler-order", "instance-order", "option", ], }, ) intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intent", title="Extension field for ``intent``." ) medium: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="medium", title="A channel of communication", description="A channel that was used for this communication (e.g. email, fax).", json_schema_extra={ "element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about communication request", description=( "Comments made about the request by the requester, sender, recipient, " "subject or other participants." ), json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When scheduled", description="The time when this communication is to occur.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="When scheduled", description="The time when this communication is to occur.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) payload: typing.List[fhirtypes.CommunicationRequestPayloadType] | None = Field( default=None, alias="payload", title="Message payload", description=( "Text, attachment(s), or resource(s) to be communicated to the " "recipient." ), json_schema_extra={ "element_property": True, }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Characterizes how quickly the proposed act must be initiated. Includes" " concepts such as stat, urgent, routine." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="reason", title="Why is communication needed?", description="Describes why the request is being made in coded or textual form.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) recipient: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="recipient", title="Who to share the information with", description=( "The entity (e.g. person, organization, clinical information system, " "device, group, or care team) which is the intended target of the " "communication." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Group", "CareTeam", "HealthcareService", "Endpoint", ], }, ) replaces: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="replaces", title="Request(s) replaced by this request", description=( "Completed or terminated request(s) whose function is taken by this new" " request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CommunicationRequest"], }, ) requester: fhirtypes.ReferenceType | None = Field( default=None, alias="requester", title="Who asks for the information to be shared", description=( "The device, individual, or organization who asks for the information " "to be shared." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Patient", "RelatedPerson", "Device", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "draft | active | on-hold | revoked | completed | entered-in-error | " "unknown" ), description="The status of the proposal or order.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "draft", "active", "on-hold", "revoked", "completed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="statusReason", title="Reason for current status", description="Captures the reason for the current state of the CommunicationRequest.", json_schema_extra={ "element_property": True, }, ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Focus of message", description="The patient or group that is the focus of this communication request.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CommunicationRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "replaces", "groupIdentifier", "status", "statusReason", "intent", "category", "priority", "doNotPerform", "medium", "subject", "about", "encounter", "payload", "occurrenceDateTime", "occurrencePeriod", "authoredOn", "requester", "recipient", "informationProvider", "reason", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CommunicationRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "basedOn", "replaces", "groupIdentifier", "status", "intent", "priority", "doNotPerform", "encounter", "occurrenceDateTime", "occurrencePeriod", "authoredOn", "requester", "informationProvider", "reason", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("intent", "intent__ext"), ("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"occurrence": ["occurrenceDateTime", "occurrencePeriod"]} return one_of_many_fields class CommunicationRequestPayload(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Message payload. Text, attachment(s), or resource(s) to be communicated to the recipient. """ __resource_type__ = "CommunicationRequestPayload" contentAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="contentAttachment", title="Message part content", description=( "The communicated content (or for multi-part communications, one " "portion of the communication)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, }, ) contentCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="contentCodeableConcept", title="Message part content", description=( "The communicated content (or for multi-part communications, one " "portion of the communication)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, }, ) contentReference: fhirtypes.ReferenceType | None = Field( default=None, alias="contentReference", title="Message part content", description=( "The communicated content (or for multi-part communications, one " "portion of the communication)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CommunicationRequestPayload`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "contentAttachment", "contentReference", "contentCodeableConcept", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CommunicationRequestPayload`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "content": [ "contentAttachment", "contentCodeableConcept", "contentReference", ] } return one_of_many_fields ================================================ FILE: fhir/resources/compartmentdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CompartmentDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class CompartmentDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Compartment Definition for a resource. A compartment definition that defines how resources are accessed on a server. """ __resource_type__ = "CompartmentDefinition" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title=( "Patient | Encounter | RelatedPerson | Practitioner | Device | " "EpisodeOfCare" ), description="Which compartment this definition describes.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "Patient", "Encounter", "RelatedPerson", "Practitioner", "Device", "EpisodeOfCare", ], }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the compartment definition was " "last significantly changed. The date must change when the business " "version changes and it must change if the status code changes. In " "addition, it should change when the substantive content of the " "compartment definition changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the compartment definition", description=( "A free text natural language description of the compartment definition" " from a consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this compartment definition is " "authored for testing purposes (or education/evaluation/marketing) and " "is not intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this compartment definition (computer friendly)", description=( "A natural language name identifying the compartment definition. This " "name should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the compartment definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this compartment definition is defined", description=( "Explanation of why this compartment definition is needed and why it " "has been designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) resource: typing.List[fhirtypes.CompartmentDefinitionResourceType] | None = Field( default=None, alias="resource", title="How a resource is related to the compartment", description="Information about how a resource is related to the compartment.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) search: bool | None = Field( default=None, alias="search", title="Whether the search syntax is supported", description="Whether the search syntax is supported,.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) search__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_search", title="Extension field for ``search``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this compartment definition. Enables tracking the life-" "cycle of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this compartment definition (human friendly)", description=( "A short, descriptive, user-friendly title for the capability " "statement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this compartment definition, represented as a" " URI (globally unique)" ), description=( "An absolute URI that is used to identify this compartment definition " "when it is referenced in a specification, model, design or an " "instance; also called its canonical identifier. This SHOULD be " "globally unique and SHOULD be a literal address at which an " "authoritative instance of this compartment definition is (or will be) " "published. This URL can be the target of a canonical reference. It " "SHALL remain the same when the compartment definition is stored on " "different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate compartment definition " "instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the compartment definition", description=( "The identifier that is used to identify this version of the " "compartment definition when it is referenced in a specification, " "model, design or instance. This is an arbitrary value managed by the " "compartment definition author and is not expected to be globally " "unique. For example, it might be a timestamp (e.g. yyyymmdd) if a " "managed version is not available. There is also no expectation that " "versions can be placed in a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CompartmentDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "purpose", "code", "search", "resource", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CompartmentDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "code", "search", "resource", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("code", "code__ext"), ("name", "name__ext"), ("search", "search__ext"), ("status", "status__ext"), ("url", "url__ext"), ] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields class CompartmentDefinitionResource(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. How a resource is related to the compartment. Information about how a resource is related to the compartment. """ __resource_type__ = "CompartmentDefinitionResource" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Name of resource type", description="The name of a resource supported by the server.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Additional documentation about the resource and compartment", description=None, json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) endParam: fhirtypes.UriType | None = Field( default=None, alias="endParam", title="Search Param for interpreting $everything.end", description=( "Search Parameter for mapping requests made with $everything.end (e.g. " "on [Patient.$everything](patient-operation-everything.html))." ), json_schema_extra={ "element_property": True, }, ) endParam__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_endParam", title="Extension field for ``endParam``." ) param: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="param", title="Search Parameter Name, or chained parameters", description=( "The name of a search parameter that represents the link to the " "compartment. More than one may be listed because a resource may be " "linked to a compartment in more than one way,." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) param__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_param", title="Extension field for ``param``." ) startParam: fhirtypes.UriType | None = Field( default=None, alias="startParam", title="Search Param for interpreting $everything.start", description=( "Search Parameter for mapping requests made with $everything.start " "(e.g. on [Patient.$everything](patient-operation-everything.html))." ), json_schema_extra={ "element_property": True, }, ) startParam__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_startParam", title="Extension field for ``startParam``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CompartmentDefinitionResource`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "param", "documentation", "startParam", "endParam", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CompartmentDefinitionResource`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "param"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields ================================================ FILE: fhir/resources/composition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Composition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Composition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A set of resources composed into a single coherent clinical statement with clinical attestation. A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.). """ __resource_type__ = "Composition" attester: typing.List[fhirtypes.CompositionAttesterType] | None = Field( default=None, alias="attester", title="Attests to accuracy of composition", description=( "A participant who has attested to the accuracy of the " "composition/document." ), json_schema_extra={ "element_property": True, }, ) author: typing.List[fhirtypes.ReferenceType] = Field( default=..., alias="author", title="Who and/or what authored the composition", description=( "Identifies who is responsible for the information in the composition, " "not necessarily who typed it in." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Device", "Patient", "RelatedPerson", "Organization", ], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Categorization of Composition", description=( "A categorization for the type of the composition - helps for indexing " "and searching. This may be implied by or derived from the code " "specified in the Composition Type." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) custodian: fhirtypes.ReferenceType | None = Field( default=None, alias="custodian", title="Organization which maintains the composition", description=( "Identifies the organization or group who is responsible for ongoing " "maintenance of and access to the composition/document information." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Composition editing time", description=( "The composition editing time, when the composition was last logically " "changed by the author." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Context of the Composition", description=( "Describes the clinical encounter or type of care this documentation is" " associated with." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) event: typing.List[fhirtypes.CompositionEventType] | None = Field( default=None, alias="event", title="The clinical service(s) being documented", description=( "The clinical service, such as a colonoscopy or an appendectomy, being " "documented." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Version-independent identifier for the Composition", description=( "A version-independent identifier for the Composition. This identifier " "stays constant as the composition is changed over time." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this Composition (computer friendly)", description=( "A natural language name identifying the {{title}}. This name should be" " usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="For any additional notes", description=None, json_schema_extra={ "element_property": True, }, ) relatesTo: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatesTo", title="Relationships to other compositions/documents", description=( "Relationships that this composition has with other compositions or " "documents that already exist." ), json_schema_extra={ "element_property": True, }, ) section: typing.List[fhirtypes.CompositionSectionType] | None = Field( default=None, alias="section", title="Composition is broken into sections", description="The root of the sections that make up the composition.", json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "registered | partial | preliminary | final | amended | corrected | " "appended | cancelled | entered-in-error | deprecated | unknown" ), description=( "The workflow/clinical status of this composition. The status is a " "marker for the clinical standing of the document." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "registered", "partial", "preliminary", "final", "amended", "corrected", "appended", "cancelled", "entered-in-error", "deprecated", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="subject", title="Who and/or what the composition is about", description=( "Who or what the composition is about. The composition can be about a " "person, (patient or healthcare practitioner), a device (e.g. a " "machine) or even a group of subjects (such as a document about a herd " "of livestock, or a set of patients that share a common exposure)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Human Readable name/title", description="Official human-readable label for the composition.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Kind of composition (LOINC if possible)", description=( "Specifies the particular kind of composition (e.g. History and " "Physical, Discharge Summary, Progress Note). This usually equates to " "the purpose of making the composition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this Composition, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this Composition when it is " "referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which an authoritative instance of this" " Composition is (or will be) published. This URL can be the target of " "a canonical reference. It SHALL remain the same when the Composition " "is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate Composition instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title=( "An explicitly assigned identifer of a variation of the content in the " "Composition" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Composition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "status", "type", "category", "subject", "encounter", "date", "useContext", "author", "name", "title", "note", "attester", "custodian", "relatesTo", "event", "section", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Composition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "status", "type", "category", "subject", "encounter", "date", "useContext", "author", "name", "title", "custodian", "event", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("date", "date__ext"), ("status", "status__ext"), ("title", "title__ext"), ] return required_fields class CompositionAttester(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Attests to accuracy of composition. A participant who has attested to the accuracy of the composition/document. """ __resource_type__ = "CompositionAttester" mode: fhirtypes.CodeableConceptType = Field( default=..., alias="mode", title="personal | professional | legal | official", description="The type of attestation the authenticator offers.", json_schema_extra={ "element_property": True, }, ) party: fhirtypes.ReferenceType | None = Field( default=None, alias="party", title="Who attested the composition", description="Who attested the composition in the specified way.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "RelatedPerson", "Practitioner", "PractitionerRole", "Organization", ], }, ) time: fhirtypes.DateTimeType | None = Field( default=None, alias="time", title="When the composition was attested", description="When the composition was attested by the party.", json_schema_extra={ "element_property": True, }, ) time__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_time", title="Extension field for ``time``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CompositionAttester`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "mode", "time", "party"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CompositionAttester`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CompositionEvent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The clinical service(s) being documented. The clinical service, such as a colonoscopy or an appendectomy, being documented. """ __resource_type__ = "CompositionEvent" detail: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="detail", title="The event(s) being documented, as code(s), reference(s), or both", description=( "Represents the main clinical acts, such as a colonoscopy or an " "appendectomy, being documented. In some cases, the event is inherent " 'in the typeCode, such as a "History and Physical Report" in which case' ' the procedure being documented is necessarily a "History and ' 'Physical" act. The events may be included as a code or as a reference ' "to an other resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="The period covered by the documentation", description=( "The period of time covered by the documentation. There is no assertion" " that the documentation is a complete representation for this period, " "only that it documents events during this time." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CompositionEvent`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "period", "detail"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CompositionEvent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "period", "detail"] class CompositionSection(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Composition is broken into sections. The root of the sections that make up the composition. """ __resource_type__ = "CompositionSection" author: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="author", title="Who and/or what authored the section", description=( "Identifies who is responsible for the information in this section, not" " necessarily who typed it in." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Device", "Patient", "RelatedPerson", "Organization", ], }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Classification of section (recommended)", description=( "A code identifying the kind of content contained within the section. " "This must be consistent with the section title." ), json_schema_extra={ "element_property": True, }, ) emptyReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="emptyReason", title="Why the section is empty", description=( "If the section is empty, why the list is empty. An empty section " "typically has some text explaining the empty reason." ), json_schema_extra={ "element_property": True, }, ) entry: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="entry", title="A reference to data that supports this section", description=( "A reference to the actual resource from which the narrative in the " "section is derived." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) focus: fhirtypes.ReferenceType | None = Field( default=None, alias="focus", title=( "Who/what the section is about, when it is not about the subject of " "composition" ), description=( "The actual focus of the section when it is not the subject of the " "composition, but instead represents something or someone associated " "with the subject such as (for a patient subject) a spouse, parent, " "fetus, or donor. If not focus is specified, the focus is assumed to be" " focus of the parent section, or, for a section in the Composition " "itself, the subject of the composition. Sections with a focus SHALL " "only include resources where the logical subject (patient, subject, " "focus, etc.) matches the section focus, or the resources have no " "logical subject (few resources)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) orderedBy: fhirtypes.CodeableConceptType | None = Field( default=None, alias="orderedBy", title="Order of section entries", description="Specifies the order applied to the items in the section entries.", json_schema_extra={ "element_property": True, }, ) section: typing.List[fhirtypes.CompositionSectionType] | None = Field( default=None, alias="section", title="Nested Section", description="A nested sub-section within this section.", json_schema_extra={ "element_property": True, }, ) text: fhirtypes.NarrativeType | None = Field( default=None, alias="text", title="Text summary of the section, for human interpretation", description=( "A human-readable narrative that contains the attested content of the " "section, used to represent the content of the resource to a human. The" " narrative need not encode all the structured data, but is required to" ' contain sufficient detail to make it "clinically safe" for a human to' " just read the narrative." ), json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Label for section (e.g. for ToC)", description=( "The label for this particular section. This will be part of the " "rendered content for the document, and is often used to build a table " "of contents." ), json_schema_extra={ "element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CompositionSection`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "title", "code", "author", "focus", "text", "orderedBy", "entry", "emptyReason", "section", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CompositionSection`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/conceptmap.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ConceptMap Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ConceptMap(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A map from one set of concepts to one or more other concepts. A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models. """ __resource_type__ = "ConceptMap" additionalAttribute: typing.List[ fhirtypes.ConceptMapAdditionalAttributeType ] | None = Field( default=None, alias="additionalAttribute", title=( "Definition of an additional attribute to act as a data source or " "target" ), description=( "An additionalAttribute defines an additional data element found in the" " source or target data model where the data will come from or be " "mapped to. Some mappings are based on data in addition to the source " "data element, where codes in multiple fields are combined to a single " "field (or vice versa)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the ConceptMap was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the ConceptMap", description=( "An individiual or organization primarily involved in the creation and " "maintenance of the ConceptMap." ), json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the concept map and/or its contents." " Copyright statements are generally legal restrictions on the use and " "publishing of the concept map." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the concept map was last " "significantly changed. The date must change when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the concept map " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the concept map", description=( "A free text natural language description of the concept map from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the ConceptMap", description=( "An individual or organization primarily responsible for internal " "coherence of the ConceptMap." ), json_schema_extra={ "element_property": True, }, ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the ConceptMap is expected to be used", description=( "The period during which the ConceptMap content was or is planned to be" " in active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the ConceptMap", description=( "An individual or organization asserted by the publisher to be " "responsible for officially endorsing the ConceptMap for use in some " "setting." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this concept map is authored for " "testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) group: typing.List[fhirtypes.ConceptMapGroupType] | None = Field( default=None, alias="group", title="Same source and target systems", description="A group of mappings that all have the same source and target system.", json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the concept map", description=( "A formal identifier that is used to identify this concept map when it " "is represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for concept map (if applicable)", description=( "A legal or geographic region in which the concept map is intended to " "be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the ConceptMap was last reviewed by the publisher", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this concept map (computer friendly)", description=( "A natural language name identifying the concept map. This name should " "be usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) property: typing.List[fhirtypes.ConceptMapPropertyType] | None = Field( default=None, alias="property", title="Additional properties of the mapping", description=( "A property defines a slot through which additional information can be " "provided about a map from source -> target." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the concept map." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this concept map is defined", description=( "Explanation of why this concept map is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Additional documentation, citations, etc", description=( "Related artifacts such as additional documentation, justification, " "dependencies, bibliographic references, and predecessor and successor " "artifacts." ), json_schema_extra={ "element_property": True, }, ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the ConceptMap", description=( "An individual or organization asserted by the publisher to be " "primarily responsible for review of some aspect of the ConceptMap." ), json_schema_extra={ "element_property": True, }, ) sourceScopeCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="sourceScopeCanonical", title="The source value set that contains the concepts that are being mapped", description=( "Identifier for the source value set that contains the concepts that " "are being mapped and provides context for the mappings. Limits the " "scope of the map to source codes (ConceptMap.group.element code or " "valueSet) that are members of this value set." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e sourceScope[x] "one_of_many": "sourceScope", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) sourceScopeCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceScopeCanonical", title="Extension field for ``sourceScopeCanonical``.", ) sourceScopeUri: fhirtypes.UriType | None = Field( default=None, alias="sourceScopeUri", title="The source value set that contains the concepts that are being mapped", description=( "Identifier for the source value set that contains the concepts that " "are being mapped and provides context for the mappings. Limits the " "scope of the map to source codes (ConceptMap.group.element code or " "valueSet) that are members of this value set." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e sourceScope[x] "one_of_many": "sourceScope", "one_of_many_required": False, }, ) sourceScopeUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceScopeUri", title="Extension field for ``sourceScopeUri``.", ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this concept map. Enables tracking the life-cycle of the" " content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) targetScopeCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="targetScopeCanonical", title="The target value set which provides context for the mappings", description=( "Identifier for the target value set that provides important context " "about how the mapping choices are made. Limits the scope of the map " "to target codes (ConceptMap.group.element.target code or valueSet) " "that are members of this value set." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e targetScope[x] "one_of_many": "targetScope", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) targetScopeCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_targetScopeCanonical", title="Extension field for ``targetScopeCanonical``.", ) targetScopeUri: fhirtypes.UriType | None = Field( default=None, alias="targetScopeUri", title="The target value set which provides context for the mappings", description=( "Identifier for the target value set that provides important context " "about how the mapping choices are made. Limits the scope of the map " "to target codes (ConceptMap.group.element.target code or valueSet) " "that are members of this value set." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e targetScope[x] "one_of_many": "targetScope", "one_of_many_required": False, }, ) targetScopeUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_targetScopeUri", title="Extension field for ``targetScopeUri``.", ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this concept map (human friendly)", description="A short, descriptive, user-friendly title for the concept map.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) topic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="topic", title="E.g. Education, Treatment, Assessment, etc", description=( "Descriptions related to the content of the ConceptMap. Topics provide " "a high-level categorization as well as keywords for the ConceptMap " "that can be useful for filtering and searching." ), json_schema_extra={ "element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this concept map, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this concept map when it is " "referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which an authoritative instance of this" " concept map is (or will be) published. This URL can be the target of " "a canonical reference. It SHALL remain the same when the concept map " "is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate concept map instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the concept map", description=( "The identifier that is used to identify this version of the concept " "map when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the concept map author" " and is not expected to be globally unique. For example, it might be a" " timestamp (e.g. yyyymmdd) if a managed version is not available. " "There is also no expectation that versions can be placed in a " "lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which " "ConceptMap is more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which " "ConceptMap is more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConceptMap`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "copyrightLabel", "approvalDate", "lastReviewDate", "effectivePeriod", "topic", "author", "editor", "reviewer", "endorser", "relatedArtifact", "property", "additionalAttribute", "sourceScopeUri", "sourceScopeCanonical", "targetScopeUri", "targetScopeCanonical", "group", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConceptMap`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "effectivePeriod", "property", "additionalAttribute", "sourceScopeUri", "sourceScopeCanonical", "targetScopeUri", "targetScopeCanonical", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "sourceScope": ["sourceScopeCanonical", "sourceScopeUri"], "targetScope": ["targetScopeCanonical", "targetScopeUri"], "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"], } return one_of_many_fields class ConceptMapAdditionalAttribute(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of an additional attribute to act as a data source or target. An additionalAttribute defines an additional data element found in the source or target data model where the data will come from or be mapped to. Some mappings are based on data in addition to the source data element, where codes in multiple fields are combined to a single field (or vice versa). """ __resource_type__ = "ConceptMapAdditionalAttribute" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Identifies this additional attribute through this resource", description=( "A code that is used to identify this additional data attribute. The " "code is used internally in " "ConceptMap.group.element.target.dependsOn.attribute and " "ConceptMap.group.element.target.product.attribute." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title=( "Why the additional attribute is defined, and/or what the data element " "it refers to is" ), description=( "A description of the additional attribute and/or the data element it " "refers to - why it is defined, and how the value might be used in " "mappings, and a discussion of issues associated with the use of the " "data element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="code | Coding | string | boolean | Quantity", description=( "The type of the source data contained in this concept map for this " "data element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["code", "Coding", "string", "boolean", "Quantity"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) uri: fhirtypes.UriType | None = Field( default=None, alias="uri", title="Formal identifier for the data element referred to in this attribte", description=( "Reference to the formal definition of the source/target data element. " "For elements defined by the FHIR specification, or using a FHIR " "logical model, the correct format is {canonical-url}#{element-id}." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uri", title="Extension field for ``uri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConceptMapAdditionalAttribute`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "uri", "description", "type", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConceptMapAdditionalAttribute`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "uri", "description", "type"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext"), ("type", "type__ext")] return required_fields class ConceptMapGroup(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Same source and target systems. A group of mappings that all have the same source and target system. """ __resource_type__ = "ConceptMapGroup" element: typing.List[fhirtypes.ConceptMapGroupElementType] = Field( default=..., alias="element", title="Mappings for a concept from the source set", description=( "Mappings for an individual concept in the source to one or more " "concepts in the target." ), json_schema_extra={ "element_property": True, }, ) source: fhirtypes.CanonicalType | None = Field( default=None, alias="source", title="Source system where concepts to be mapped are defined", description=( "An absolute URI that identifies the source system where the concepts " "to be mapped are defined." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CodeSystem"], }, ) source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_source", title="Extension field for ``source``." ) target: fhirtypes.CanonicalType | None = Field( default=None, alias="target", title="Target system that the concepts are to be mapped to", description=( "An absolute URI that identifies the target system that the concepts " "will be mapped to." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CodeSystem"], }, ) target__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_target", title="Extension field for ``target``." ) unmapped: fhirtypes.ConceptMapGroupUnmappedType | None = Field( default=None, alias="unmapped", title=( "What to do when there is no mapping target for the source concept and " "ConceptMap.group.element.noMap is not true" ), description=( "What to do when there is no mapping to a target concept from the " "source concept and ConceptMap.group.element.noMap is not true. This " 'provides the "default" to be applied when there is no target concept ' "mapping specified or the expansion of " "ConceptMap.group.element.target.valueSet is empty." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConceptMapGroup`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "source", "target", "element", "unmapped", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConceptMapGroup`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ConceptMapGroupElement(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Mappings for a concept from the source set. Mappings for an individual concept in the source to one or more concepts in the target. """ __resource_type__ = "ConceptMapGroupElement" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Identifies element being mapped", description="Identity (code or path) or the element/item being mapped.", json_schema_extra={ "element_property": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Display for the code", description=( "The display for the code. The display is only provided to help editors" " when editing the concept map." ), json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) noMap: bool | None = Field( default=None, alias="noMap", title="No mapping to a target concept for this source concept", description=( "If noMap = true this indicates that no mapping to a target concept " "exists for this source concept." ), json_schema_extra={ "element_property": True, }, ) noMap__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_noMap", title="Extension field for ``noMap``." ) target: typing.List[fhirtypes.ConceptMapGroupElementTargetType] | None = Field( default=None, alias="target", title="Concept in target system for element", description="A concept from the target value set that this concept maps to.", json_schema_extra={ "element_property": True, }, ) valueSet: fhirtypes.CanonicalType | None = Field( default=None, alias="valueSet", title="Identifies the set of concepts being mapped", description=( "The set of concepts from the ConceptMap.group.source code system which" " are all being mapped to the target as part of this mapping rule." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueSet", title="Extension field for ``valueSet``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConceptMapGroupElement`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "display", "valueSet", "noMap", "target", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConceptMapGroupElement`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ConceptMapGroupElementTarget(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Concept in target system for element. A concept from the target value set that this concept maps to. """ __resource_type__ = "ConceptMapGroupElementTarget" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Code that identifies the target element", description="Identity (code or path) or the element/item that the map refers to.", json_schema_extra={ "element_property": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Description of status/issues in mapping", description=( "A description of status/issues in mapping that conveys additional " "information not represented in the structured data." ), json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) dependsOn: typing.List[ fhirtypes.ConceptMapGroupElementTargetDependsOnType ] | None = Field( default=None, alias="dependsOn", title="Other properties required for this mapping", description=( "A set of additional dependencies for this mapping to hold. This " "mapping is only applicable if the specified data attribute can be " "resolved, and it has the specified value." ), json_schema_extra={ "element_property": True, }, ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Display for the code", description=( "The display for the code. The display is only provided to help editors" " when editing the concept map." ), json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) product: typing.List[ fhirtypes.ConceptMapGroupElementTargetDependsOnType ] | None = Field( default=None, alias="product", title="Other data elements that this mapping also produces", description=( "Product is the output of a ConceptMap that provides additional values " "that go in other attributes / data elemnts of the target data." ), json_schema_extra={ "element_property": True, }, ) property: typing.List[ fhirtypes.ConceptMapGroupElementTargetPropertyType ] | None = Field( default=None, alias="property", title="Property value for the source -> target mapping", description="A property value for this source -> target mapping.", json_schema_extra={ "element_property": True, }, ) relationship: fhirtypes.CodeType | None = Field( default=None, alias="relationship", title=( "related-to | equivalent | source-is-narrower-than-target | source-is-" "broader-than-target | not-related-to" ), description=( "The relationship between the source and target concepts. The " "relationship is read from source to target (e.g. source-is-narrower-" "than-target)." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "related-to", "equivalent", "source-is-narrower-than-target", "source-is-broader-than-target", "not-related-to", ], }, ) relationship__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_relationship", title="Extension field for ``relationship``.", ) valueSet: fhirtypes.CanonicalType | None = Field( default=None, alias="valueSet", title="Identifies the set of target concepts", description=( "The set of concepts from the ConceptMap.group.target code system which" " are all being mapped to as part of this mapping rule. The effect of " "using this data element is the same as having multiple " "ConceptMap.group.element.target elements with one for each concept in " "the ConceptMap.group.element.target.valueSet value set." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueSet", title="Extension field for ``valueSet``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConceptMapGroupElementTarget`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "display", "valueSet", "relationship", "comment", "property", "dependsOn", "product", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConceptMapGroupElementTarget`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("relationship", "relationship__ext")] return required_fields class ConceptMapGroupElementTargetDependsOn(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Other properties required for this mapping. A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified data attribute can be resolved, and it has the specified value. """ __resource_type__ = "ConceptMapGroupElementTargetDependsOn" attribute: fhirtypes.CodeType | None = Field( default=None, alias="attribute", title=( "A reference to a mapping attribute defined in " "ConceptMap.additionalAttribute" ), description=( "A reference to the additional attribute that holds a value the map " "depends on." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) attribute__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_attribute", title="Extension field for ``attribute``." ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value of the referenced data element", description="Data element value that the map depends on / produces.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="Value of the referenced data element", description="Data element value that the map depends on / produces.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Value of the referenced data element", description="Data element value that the map depends on / produces.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Value of the referenced data element", description="Data element value that the map depends on / produces.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueSet: fhirtypes.CanonicalType | None = Field( default=None, alias="valueSet", title="The mapping depends on a data element with a value from this value set", description=( "This mapping applies if the data element value is a code from this " "value set." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueSet", title="Extension field for ``valueSet``." ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Value of the referenced data element", description="Data element value that the map depends on / produces.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConceptMapGroupElementTargetDependsOn`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "attribute", "valueCode", "valueCoding", "valueString", "valueBoolean", "valueQuantity", "valueSet", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConceptMapGroupElementTargetDependsOn`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("attribute", "attribute__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueCode", "valueCoding", "valueQuantity", "valueString", ] } return one_of_many_fields class ConceptMapGroupElementTargetProperty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Property value for the source -> target mapping. A property value for this source -> target mapping. """ __resource_type__ = "ConceptMapGroupElementTargetProperty" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Reference to ConceptMap.property.code", description="A reference to a mapping property defined in ConceptMap.property.", json_schema_extra={ "element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value of the property for this concept", description=( "The value of this property. If the type chosen for this element is " "'code', then the property SHALL be defined in a ConceptMap.property " "element." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="Value of the property for this concept", description=( "The value of this property. If the type chosen for this element is " "'code', then the property SHALL be defined in a ConceptMap.property " "element." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Value of the property for this concept", description=( "The value of this property. If the type chosen for this element is " "'code', then the property SHALL be defined in a ConceptMap.property " "element." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Value of the property for this concept", description=( "The value of this property. If the type chosen for this element is " "'code', then the property SHALL be defined in a ConceptMap.property " "element." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Value of the property for this concept", description=( "The value of this property. If the type chosen for this element is " "'code', then the property SHALL be defined in a ConceptMap.property " "element." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Value of the property for this concept", description=( "The value of this property. If the type chosen for this element is " "'code', then the property SHALL be defined in a ConceptMap.property " "element." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Value of the property for this concept", description=( "The value of this property. If the type chosen for this element is " "'code', then the property SHALL be defined in a ConceptMap.property " "element." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConceptMapGroupElementTargetProperty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "valueCoding", "valueString", "valueInteger", "valueBoolean", "valueDateTime", "valueDecimal", "valueCode", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConceptMapGroupElementTargetProperty`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueCode", "valueCoding", "valueDateTime", "valueDecimal", "valueInteger", "valueString", ] } return one_of_many_fields class ConceptMapGroupUnmapped(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What to do when there is no mapping target for the source concept and ConceptMap.group.element.noMap is not true. What to do when there is no mapping to a target concept from the source concept and ConceptMap.group.element.noMap is not true. This provides the "default" to be applied when there is no target concept mapping specified or the expansion of ConceptMap.group.element.target.valueSet is empty. """ __resource_type__ = "ConceptMapGroupUnmapped" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Fixed code when mode = fixed", description=( "The fixed code to use when the mode = 'fixed' - all unmapped codes " "are mapped to a single fixed code." ), json_schema_extra={ "element_property": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Display for the code", description=( "The display for the code. The display is only provided to help editors" " when editing the concept map." ), json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="use-source-code | fixed | other-map", description=( "Defines which action to take if there is no match for the source " "concept in the target system designated for the group. One of 3 " "actions are possible: use the unmapped source code (this is useful " "when doing a mapping between versions, and only a few codes have " "changed), use a fixed code (a default code), or alternatively, a " "reference to a different concept map can be provided (by canonical " "URL)." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["use-source-code", "fixed", "other-map"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) otherMap: fhirtypes.CanonicalType | None = Field( default=None, alias="otherMap", title=( "canonical reference to an additional ConceptMap to use for mapping if " "the source concept is unmapped" ), description=( "The canonical reference to an additional ConceptMap resource instance " "to use for mapping if this ConceptMap resource contains no matching " "mapping for the source concept." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ConceptMap"], }, ) otherMap__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_otherMap", title="Extension field for ``otherMap``." ) relationship: fhirtypes.CodeType | None = Field( default=None, alias="relationship", title=( "related-to | equivalent | source-is-narrower-than-target | source-is-" "broader-than-target | not-related-to" ), description=( "The default relationship value to apply between the source and target " "concepts when the source code is unmapped and the mode is 'fixed' or " "'use-source-code'." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "related-to", "equivalent", "source-is-narrower-than-target", "source-is-broader-than-target", "not-related-to", ], }, ) relationship__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_relationship", title="Extension field for ``relationship``.", ) valueSet: fhirtypes.CanonicalType | None = Field( default=None, alias="valueSet", title="Fixed code set when mode = fixed", description=( "The set of fixed codes to use when the mode = 'fixed' - all unmapped " "codes are mapped to each of the fixed codes." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueSet", title="Extension field for ``valueSet``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConceptMapGroupUnmapped`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "mode", "code", "display", "valueSet", "relationship", "otherMap", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConceptMapGroupUnmapped`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("mode", "mode__ext")] return required_fields class ConceptMapProperty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional properties of the mapping. A property defines a slot through which additional information can be provided about a map from source -> target. """ __resource_type__ = "ConceptMapProperty" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title=( "Identifies the property on the mappings, and when referred to in the " "$translate operation" ), description=( "A code that is used to identify the property. The code is used " "internally (in ConceptMap.group.element.target.property.code) and also" " in the $translate operation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Why the property is defined, and/or what it conveys", description=( "A description of the property - why it is defined, and how its value " "might be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) system: fhirtypes.CanonicalType | None = Field( default=None, alias="system", title="The CodeSystem from which code values come", description=( "The CodeSystem that defines the codes from which values of type " "```code``` in property values." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CodeSystem"], }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="Coding | string | integer | boolean | dateTime | decimal | code", description="The type of the property value.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "Coding", "string", "integer", "boolean", "dateTime", "decimal", "code", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) uri: fhirtypes.UriType | None = Field( default=None, alias="uri", title="Formal identifier for the property", description="Reference to the formal meaning of the property.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uri", title="Extension field for ``uri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConceptMapProperty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "uri", "description", "type", "system", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConceptMapProperty`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "uri", "description", "type", "system"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext"), ("type", "type__ext")] return required_fields ================================================ FILE: fhir/resources/condition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Condition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Condition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Detailed information about conditions, problems or diagnoses. A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern. """ __resource_type__ = "Condition" abatementAge: fhirtypes.AgeType | None = Field( default=None, alias="abatementAge", title="When in resolution/remission", description=( "The date or estimated date that the condition resolved or went into " 'remission. This is called "abatement" because of the many overloaded ' 'connotations associated with "remission" or "resolution" - Some ' "conditions, such as chronic conditions, are never really resolved, but" " they can abate." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e abatement[x] "one_of_many": "abatement", "one_of_many_required": False, }, ) abatementDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="abatementDateTime", title="When in resolution/remission", description=( "The date or estimated date that the condition resolved or went into " 'remission. This is called "abatement" because of the many overloaded ' 'connotations associated with "remission" or "resolution" - Some ' "conditions, such as chronic conditions, are never really resolved, but" " they can abate." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e abatement[x] "one_of_many": "abatement", "one_of_many_required": False, }, ) abatementDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_abatementDateTime", title="Extension field for ``abatementDateTime``.", ) abatementPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="abatementPeriod", title="When in resolution/remission", description=( "The date or estimated date that the condition resolved or went into " 'remission. This is called "abatement" because of the many overloaded ' 'connotations associated with "remission" or "resolution" - Some ' "conditions, such as chronic conditions, are never really resolved, but" " they can abate." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e abatement[x] "one_of_many": "abatement", "one_of_many_required": False, }, ) abatementRange: fhirtypes.RangeType | None = Field( default=None, alias="abatementRange", title="When in resolution/remission", description=( "The date or estimated date that the condition resolved or went into " 'remission. This is called "abatement" because of the many overloaded ' 'connotations associated with "remission" or "resolution" - Some ' "conditions, such as chronic conditions, are never really resolved, but" " they can abate." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e abatement[x] "one_of_many": "abatement", "one_of_many_required": False, }, ) abatementString: fhirtypes.StringType | None = Field( default=None, alias="abatementString", title="When in resolution/remission", description=( "The date or estimated date that the condition resolved or went into " 'remission. This is called "abatement" because of the many overloaded ' 'connotations associated with "remission" or "resolution" - Some ' "conditions, such as chronic conditions, are never really resolved, but" " they can abate." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e abatement[x] "one_of_many": "abatement", "one_of_many_required": False, }, ) abatementString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_abatementString", title="Extension field for ``abatementString``.", ) bodySite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="bodySite", title="Anatomical location, if relevant", description="The anatomical location where this condition manifests itself.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="problem-list-item | encounter-diagnosis", description="A category assigned to the condition.", json_schema_extra={ "element_property": True, }, ) clinicalStatus: fhirtypes.CodeableConceptType = Field( default=..., alias="clinicalStatus", title=( "active | recurrence | relapse | inactive | remission | resolved | " "unknown" ), description="The clinical status of the condition.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Identification of the condition, problem or diagnosis", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="The Encounter during which this Condition was created", description=( "The Encounter during which this Condition was created or to which the " "creation of this record is tightly associated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) evidence: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="evidence", title="Supporting evidence for the verification status", description=( "Supporting evidence / manifestations that are the basis of the " "Condition's verification status, such as evidence that confirmed or " "refuted the condition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Ids for this condition", description=( "Business identifiers assigned to this condition by the performer or " "other systems which remain constant as the resource is updated and " "propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Additional information about the Condition", description=( "Additional information about the Condition. This is a general " "notes/comments entry for description of the Condition, its diagnosis " "and prognosis." ), json_schema_extra={ "element_property": True, }, ) onsetAge: fhirtypes.AgeType | None = Field( default=None, alias="onsetAge", title="Estimated or actual date, date-time, or age", description=( "Estimated or actual date or date-time the condition began, in the " "opinion of the clinician." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="onsetDateTime", title="Estimated or actual date, date-time, or age", description=( "Estimated or actual date or date-time the condition began, in the " "opinion of the clinician." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onsetDateTime", title="Extension field for ``onsetDateTime``.", ) onsetPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="onsetPeriod", title="Estimated or actual date, date-time, or age", description=( "Estimated or actual date or date-time the condition began, in the " "opinion of the clinician." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetRange: fhirtypes.RangeType | None = Field( default=None, alias="onsetRange", title="Estimated or actual date, date-time, or age", description=( "Estimated or actual date or date-time the condition began, in the " "opinion of the clinician." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetString: fhirtypes.StringType | None = Field( default=None, alias="onsetString", title="Estimated or actual date, date-time, or age", description=( "Estimated or actual date or date-time the condition began, in the " "opinion of the clinician." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onsetString", title="Extension field for ``onsetString``." ) participant: typing.List[fhirtypes.ConditionParticipantType] | None = Field( default=None, alias="participant", title=( "Who or what participated in the activities related to the condition " "and how they were involved" ), description=( "Indicates who or what participated in the activities related to the " "condition and how they were involved." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) recordedDate: fhirtypes.DateTimeType | None = Field( default=None, alias="recordedDate", title="Date condition was first recorded", description=( "The recordedDate represents when this particular Condition record was " "created in the system, which is often a system-generated date." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) recordedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recordedDate", title="Extension field for ``recordedDate``.", ) severity: fhirtypes.CodeableConceptType | None = Field( default=None, alias="severity", title="Subjective severity of condition", description=( "A subjective assessment of the severity of the condition as evaluated " "by the clinician." ), json_schema_extra={ "element_property": True, }, ) stage: typing.List[fhirtypes.ConditionStageType] | None = Field( default=None, alias="stage", title="Stage/grade, usually assessed formally", description=( 'A simple summary of the stage such as "Stage 3" or "Early Onset". The ' "determination of the stage is disease-specific, such as cancer, " "retinopathy of prematurity, kidney diseases, Alzheimer's, or Parkinson" " disease." ), json_schema_extra={ "element_property": True, }, ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who has the condition?", description=( "Indicates the patient or group who the condition record is associated " "with." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) verificationStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="verificationStatus", title=( "unconfirmed | provisional | differential | confirmed | refuted | " "entered-in-error" ), description=( "The verification status to support the clinical status of the " "condition. The verification status pertains to the condition, itself," " not to any specific condition attribute." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Condition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "clinicalStatus", "verificationStatus", "category", "severity", "code", "bodySite", "subject", "encounter", "onsetDateTime", "onsetAge", "onsetPeriod", "onsetRange", "onsetString", "abatementDateTime", "abatementAge", "abatementPeriod", "abatementRange", "abatementString", "recordedDate", "participant", "stage", "evidence", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Condition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "clinicalStatus", "verificationStatus", "code", "bodySite", "subject", "encounter", "onsetDateTime", "onsetAge", "onsetPeriod", "onsetRange", "onsetString", "recordedDate", "participant", "evidence", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "abatement": [ "abatementAge", "abatementDateTime", "abatementPeriod", "abatementRange", "abatementString", ], "onset": [ "onsetAge", "onsetDateTime", "onsetPeriod", "onsetRange", "onsetString", ], } return one_of_many_fields class ConditionParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who or what participated in the activities related to the condition and how they were involved. Indicates who or what participated in the activities related to the condition and how they were involved. """ __resource_type__ = "ConditionParticipant" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Who or what participated in the activities related to the condition", description=( "Indicates who or what participated in the activities related to the " "condition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Patient", "RelatedPerson", "Device", "Organization", "CareTeam", ], }, ) function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="Type of involvement", description=( "Distinguishes the type of involvement of the actor in the activities " "related to the condition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConditionParticipant`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "function", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConditionParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "function", "actor"] class ConditionStage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Stage/grade, usually assessed formally. A simple summary of the stage such as "Stage 3" or "Early Onset". The determination of the stage is disease-specific, such as cancer, retinopathy of prematurity, kidney diseases, Alzheimer's, or Parkinson disease. """ __resource_type__ = "ConditionStage" assessment: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="assessment", title="Formal record of assessment", description=( "Reference to a formal record of the evidence on which the staging " "assessment is based." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "ClinicalImpression", "DiagnosticReport", "Observation", ], }, ) summary: fhirtypes.CodeableConceptType | None = Field( default=None, alias="summary", title="Simple summary (disease specific)", description=( 'A simple summary of the stage such as "Stage 3" or "Early Onset". The ' "determination of the stage is disease-specific, such as cancer, " "retinopathy of prematurity, kidney diseases, Alzheimer's, or Parkinson" " disease." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Kind of staging", description="The kind of staging, such as pathological or clinical staging.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConditionStage`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "summary", "assessment", "type"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConditionStage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/conditiondefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ConditionDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ConditionDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A definition of a condition. A definition of a condition and information relevant to managing it. """ __resource_type__ = "ConditionDefinition" bodySite: fhirtypes.CodeableConceptType | None = Field( default=None, alias="bodySite", title="Anatomical location, if relevant", description="The anatomical location where this condition manifests itself.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Identification of the condition, problem or diagnosis", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the condition definition was last" " significantly changed. The date must change when the business version" " changes and it must change if the status code changes. In addition, " "it should change when the substantive content of the condition " "definition changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) definition: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="definition", title="Formal Definition for the condition", description=( "Formal definitions of the condition. These may be references to " "ontologies, published clinical protocols or research papers." ), json_schema_extra={ "element_property": True, }, ) definition__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the condition definition", description=( "A free text natural language description of the condition definition " "from a consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this condition definition is authored" " for testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) hasBodySite: bool | None = Field( default=None, alias="hasBodySite", title="Whether bodySite is appropriate", description="Whether bodySite is appropriate to collect for this condition.", json_schema_extra={ "element_property": True, }, ) hasBodySite__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_hasBodySite", title="Extension field for ``hasBodySite``." ) hasSeverity: bool | None = Field( default=None, alias="hasSeverity", title="Whether Severity is appropriate", description="Whether Severity is appropriate to collect for this condition.", json_schema_extra={ "element_property": True, }, ) hasSeverity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_hasSeverity", title="Extension field for ``hasSeverity``." ) hasStage: bool | None = Field( default=None, alias="hasStage", title="Whether stage is appropriate", description="Whether stage is appropriate to collect for this condition.", json_schema_extra={ "element_property": True, }, ) hasStage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_hasStage", title="Extension field for ``hasStage``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the condition definition", description=( "A formal identifier that is used to identify this condition definition" " when it is represented in other formats, or referenced in a " "specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for condition definition (if applicable)", description=( "A legal or geographic region in which the condition definition is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) medication: typing.List[fhirtypes.ConditionDefinitionMedicationType] | None = Field( default=None, alias="medication", title="Medications particularly relevant for this condition", description=None, json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this condition definition (computer friendly)", description=( "A natural language name identifying the condition definition. This " "name should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) observation: typing.List[ fhirtypes.ConditionDefinitionObservationType ] | None = Field( default=None, alias="observation", title="Observations particularly relevant to this condition", description=None, json_schema_extra={ "element_property": True, }, ) plan: typing.List[fhirtypes.ConditionDefinitionPlanType] | None = Field( default=None, alias="plan", title="Plan that is appropriate", description=None, json_schema_extra={ "element_property": True, }, ) precondition: typing.List[ fhirtypes.ConditionDefinitionPreconditionType ] | None = Field( default=None, alias="precondition", title="Observation that suggets this condition", description="An observation that suggests that this condition applies.", json_schema_extra={ "element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the condition definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) questionnaire: typing.List[ fhirtypes.ConditionDefinitionQuestionnaireType ] | None = Field( default=None, alias="questionnaire", title="Questionnaire for this condition", description=None, json_schema_extra={ "element_property": True, }, ) severity: fhirtypes.CodeableConceptType | None = Field( default=None, alias="severity", title="Subjective severity of condition", description=( "A subjective assessment of the severity of the condition as evaluated " "by the clinician." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) stage: fhirtypes.CodeableConceptType | None = Field( default=None, alias="stage", title="Stage/grade, usually assessed formally", description=( "Clinical stage or grade of a condition. May include formal severity " "assessments." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this condition definition. Enables tracking the life-" "cycle of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subtitle: fhirtypes.StringType | None = Field( default=None, alias="subtitle", title="Subordinate title of the event definition", description=( "An explanatory or alternate title for the event definition giving " "additional information about its content." ), json_schema_extra={ "element_property": True, }, ) subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subtitle", title="Extension field for ``subtitle``." ) team: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="team", title="Appropriate team for this condition", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CareTeam"], }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this condition definition (human friendly)", description=( "A short, descriptive, user-friendly title for the condition " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this condition definition, represented as a " "URI (globally unique)" ), description=( "An absolute URI that is used to identify this condition definition " "when it is referenced in a specification, model, design or an " "instance; also called its canonical identifier. This SHOULD be " "globally unique and SHOULD be a literal address at which an " "authoritative instance of this condition definition is (or will be) " "published. This URL can be the target of a canonical reference. It " "SHALL remain the same when the condition definition is stored on " "different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate condition definition instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the condition definition", description=( "The identifier that is used to identify this version of the condition " "definition when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the condition " "definition author and is not expected to be globally unique. For " "example, it might be a timestamp (e.g. yyyymmdd) if a managed version " "is not available. There is also no expectation that versions can be " "placed in a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConditionDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "subtitle", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "code", "severity", "bodySite", "stage", "hasSeverity", "hasBodySite", "hasStage", "definition", "observation", "medication", "precondition", "team", "questionnaire", "plan", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConditionDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "code", "severity", "bodySite", "stage", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields class ConditionDefinitionMedication(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Medications particularly relevant for this condition. """ __resource_type__ = "ConditionDefinitionMedication" category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Category that is relevant", description=None, json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Code for relevant Medication", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConditionDefinitionMedication`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "category", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConditionDefinitionMedication`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ConditionDefinitionObservation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Observations particularly relevant to this condition. """ __resource_type__ = "ConditionDefinitionObservation" category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Category that is relevant", description=None, json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Code for relevant Observation", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConditionDefinitionObservation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "category", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConditionDefinitionObservation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ConditionDefinitionPlan(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Plan that is appropriate. """ __resource_type__ = "ConditionDefinitionPlan" reference: fhirtypes.ReferenceType = Field( default=..., alias="reference", title="The actual plan", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["PlanDefinition"], }, ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="Use for the plan", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConditionDefinitionPlan`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "role", "reference"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConditionDefinitionPlan`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ConditionDefinitionPrecondition(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Observation that suggets this condition. An observation that suggests that this condition applies. """ __resource_type__ = "ConditionDefinitionPrecondition" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Code for relevant Observation", description=None, json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="sensitive | specific", description="Kind of pre-condition.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["sensitive", "specific"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Value of Observation", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Value of Observation", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConditionDefinitionPrecondition`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "code", "valueCodeableConcept", "valueQuantity", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConditionDefinitionPrecondition`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"value": ["valueCodeableConcept", "valueQuantity"]} return one_of_many_fields class ConditionDefinitionQuestionnaire(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Questionnaire for this condition. """ __resource_type__ = "ConditionDefinitionQuestionnaire" purpose: fhirtypes.CodeType | None = Field( default=None, alias="purpose", title="preadmit | diff-diagnosis | outcome", description="Use of the questionnaire.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["preadmit", "diff-diagnosis", "outcome"], }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) reference: fhirtypes.ReferenceType = Field( default=..., alias="reference", title="Specific Questionnaire", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Questionnaire"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConditionDefinitionQuestionnaire`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "purpose", "reference"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConditionDefinitionQuestionnaire`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("purpose", "purpose__ext")] return required_fields ================================================ FILE: fhir/resources/consent.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Consent Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Consent(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A healthcare consumer's or third party's choices to permit or deny recipients or roles to perform actions for specific purposes and periods of time. A record of a healthcare consumer’s choices or choices made on their behalf by a third party, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time. """ __resource_type__ = "Consent" category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Classification of the consent statement - for indexing/retrieval", description=( "A classification of the type of consents found in the statement. This " "element supports indexing and retrieval of consent statements." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) controller: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="controller", title="Consent Enforcer", description="The actor that controls/enforces the access according to the consent.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "HealthcareService", "Organization", "Patient", "Practitioner", ], }, ) date: fhirtypes.DateType | None = Field( default=None, alias="date", title="Fully executed date of the consent", description="Date the consent instance was agreed to.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) decision: fhirtypes.CodeType | None = Field( default=None, alias="decision", title="deny | permit", description="Action to take - permit or deny - as default.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["deny", "permit"], }, ) decision__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_decision", title="Extension field for ``decision``." ) grantee: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="grantee", title="Who is agreeing to the policy and rules", description=( "The entity responsible for complying with the Consent Directive, " "including any obligations or limitations on authorizations and " "enforcement of prohibitions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CareTeam", "HealthcareService", "Organization", "Patient", "Practitioner", "RelatedPerson", "PractitionerRole", ], }, ) grantor: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="grantor", title="Who is granting rights according to the policy and rules", description=( "The entity responsible for granting the rights listed in a Consent " "Directive." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CareTeam", "HealthcareService", "Organization", "Patient", "Practitioner", "RelatedPerson", "PractitionerRole", ], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifier for this record (external references)", description="Unique identifier for this copy of the Consent Statement.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) manager: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="manager", title="Consent workflow management", description="The actor that manages the consent through its lifecycle.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "HealthcareService", "Organization", "Patient", "Practitioner", ], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Effective period for this Consent", description=( "Effective period for this Consent Resource and all provisions unless " "specified in that provision." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) policyBasis: fhirtypes.ConsentPolicyBasisType | None = Field( default=None, alias="policyBasis", title="Computable version of the backing policy", description=( "A Reference or URL used to uniquely identify the policy the " "organization will enforce for this Consent. This Reference or URL " "should be specific to the version of the policy and should be " "dereferencable to a computable policy of some form." ), json_schema_extra={ "element_property": True, }, ) policyText: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="policyText", title="Human Readable Policy", description=( "A Reference to the human readable policy explaining the basis for the " "Consent." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) provision: typing.List[fhirtypes.ConsentProvisionType] | None = Field( default=None, alias="provision", title="Constraints to the base Consent.policyRule/Consent.policy", description=( "An exception to the base policy of this consent. An exception can be " "an addition or removal of access permissions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) regulatoryBasis: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="regulatoryBasis", title="Regulations establishing base Consent", description=( "A set of codes that indicate the regulatory basis (if any) that this " "consent supports." ), json_schema_extra={ "element_property": True, }, ) sourceAttachment: typing.List[fhirtypes.AttachmentType] | None = Field( default=None, alias="sourceAttachment", title="Source from which this consent is taken", description=( "The source on which this consent statement is based. The source might " "be a scanned original paper form." ), json_schema_extra={ "element_property": True, }, ) sourceReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="sourceReference", title="Source from which this consent is taken", description=( "A reference to a consent that links back to such a source, a reference" " to a document repository (e.g. XDS) that stores the original consent " "document." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Consent", "DocumentReference", "Contract", "QuestionnaireResponse", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | inactive | not-done | entered-in-error | unknown", description="Indicates the current state of this Consent resource.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "draft", "active", "inactive", "not-done", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Who the consent applies to", description=( "The patient/healthcare practitioner or group of persons to whom this " "consent applies." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Practitioner", "Group"], }, ) verification: typing.List[fhirtypes.ConsentVerificationType] | None = Field( default=None, alias="verification", title="Consent Verified by patient or family", description=( "Whether a treatment instruction (e.g. artificial respiration: yes or " "no) was verified with the patient, his/her family or another " "authorized person." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Consent`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "category", "subject", "date", "period", "grantor", "grantee", "manager", "controller", "sourceAttachment", "sourceReference", "regulatoryBasis", "policyBasis", "policyText", "verification", "decision", "provision", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Consent`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "category", "subject", "date", "period", "grantor", "grantee", "verification", "decision", "provision", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class ConsentPolicyBasis(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Computable version of the backing policy. A Reference or URL used to uniquely identify the policy the organization will enforce for this Consent. This Reference or URL should be specific to the version of the policy and should be dereferencable to a computable policy of some form. """ __resource_type__ = "ConsentPolicyBasis" reference: fhirtypes.ReferenceType | None = Field( default=None, alias="reference", title="Reference backing policy resource", description=( "A Reference that identifies the policy the organization will enforce " "for this Consent." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) url: fhirtypes.UrlType | None = Field( default=None, alias="url", title="URL to a computable backing policy", description=( "A URL that links to a computable version of the policy the " "organization will enforce for this Consent." ), json_schema_extra={ "element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConsentPolicyBasis`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "reference", "url"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConsentPolicyBasis`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ConsentProvision(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Constraints to the base Consent.policyRule/Consent.policy. An exception to the base policy of this consent. An exception can be an addition or removal of access permissions. """ __resource_type__ = "ConsentProvision" action: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="action", title="Actions controlled by this provision", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) actor: typing.List[fhirtypes.ConsentProvisionActorType] | None = Field( default=None, alias="actor", title="Who|what controlled by this provision (or group, by role)", description=( "Who or what is controlled by this provision. Use group to identify a " "set of actors by some property they share (e.g. 'admitting officers')." ), json_schema_extra={ "element_property": True, }, ) code: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="code", title="e.g. LOINC or SNOMED CT code, etc. in the content", description="If this code is found in an instance, then the provision applies.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) data: typing.List[fhirtypes.ConsentProvisionDataType] | None = Field( default=None, alias="data", title="Data controlled by this provision", description=( "The resources controlled by this provision if specific resources are " "referenced." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dataPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="dataPeriod", title="Timeframe for data controlled by this provision", description=( "Clinical or Operational Relevant period of time that bounds the data " "controlled by this provision." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) documentType: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="documentType", title="e.g. Resource Type, Profile, CDA, etc", description=( "The documentType(s) covered by this provision. The type can be a CDA " "document, or some other type that indicates what sort of information " "the consent relates to." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) expression: fhirtypes.ExpressionType | None = Field( default=None, alias="expression", title="A computable expression of the consent", description=( "A computable (FHIRPath or other) definition of what is controlled by " "this consent." ), json_schema_extra={ "element_property": True, }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Timeframe for this provision", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) provision: typing.List[fhirtypes.ConsentProvisionType] | None = Field( default=None, alias="provision", title="Nested Exception Provisions", description=( "Provisions which provide exceptions to the base provision or " "subprovisions." ), json_schema_extra={ "element_property": True, }, ) purpose: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="purpose", title="Context of activities covered by this provision", description=( "The context of the activities a user is taking - why the user is " "accessing the data - that are controlled by this provision." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) resourceType: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="resourceType", title="e.g. Resource Type, Profile, etc", description=( "The resourceType(s) covered by this provision. The type can be a FHIR " "resource type or a profile on a type that indicates what information " "the consent relates to." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) securityLabel: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="securityLabel", title="Security Labels that define affected resources", description=( "A security label, comprised of 0..* security label fields (Privacy " "tags), which define which resources are controlled by this exception." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConsentProvision`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "period", "actor", "action", "securityLabel", "purpose", "documentType", "resourceType", "code", "dataPeriod", "data", "expression", "provision", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConsentProvision`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "period", "action", "securityLabel", "purpose", "documentType", "resourceType", "code", "dataPeriod", "data", ] class ConsentProvisionActor(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who|what controlled by this provision (or group, by role). Who or what is controlled by this provision. Use group to identify a set of actors by some property they share (e.g. 'admitting officers'). """ __resource_type__ = "ConsentProvisionActor" reference: fhirtypes.ReferenceType | None = Field( default=None, alias="reference", title="Resource for the actor (or group, by role)", description=( "The resource that identifies the actor. To identify actors by type, " "use group to identify a set of actors by some property they share " "(e.g. 'admitting officers')." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Group", "CareTeam", "Organization", "Patient", "Practitioner", "RelatedPerson", "PractitionerRole", ], }, ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="How the actor is involved", description=( "How the individual is involved in the resources content that is " "described in the exception." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConsentProvisionActor`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "role", "reference"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConsentProvisionActor`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ConsentProvisionData(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Data controlled by this provision. The resources controlled by this provision if specific resources are referenced. """ __resource_type__ = "ConsentProvisionData" meaning: fhirtypes.CodeType | None = Field( default=None, alias="meaning", title="instance | related | dependents | authoredby", description=( "How the resource reference is interpreted when testing consent " "restrictions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["instance", "related", "dependents", "authoredby"], }, ) meaning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_meaning", title="Extension field for ``meaning``." ) reference: fhirtypes.ReferenceType = Field( default=..., alias="reference", title="The actual data reference", description=( "A reference to a specific resource that defines which resources are " "covered by this consent." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConsentProvisionData`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "meaning", "reference"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConsentProvisionData`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "meaning", "reference"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("meaning", "meaning__ext")] return required_fields class ConsentVerification(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Consent Verified by patient or family. Whether a treatment instruction (e.g. artificial respiration: yes or no) was verified with the patient, his/her family or another authorized person. """ __resource_type__ = "ConsentVerification" verificationDate: typing.List[fhirtypes.DateTimeType | None] | None = Field( default=None, alias="verificationDate", title="When consent verified", description="Date(s) verification was collected.", json_schema_extra={ "element_property": True, }, ) verificationDate__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_verificationDate", title="Extension field for ``verificationDate``.", ) verificationType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="verificationType", title="Business case of verification", description=( "Extensible list of verification type starting with verification and " "re-validation." ), json_schema_extra={ "element_property": True, }, ) verified: bool | None = Field( default=None, alias="verified", title="Has been verified", description="Has the instruction been verified.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) verified__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_verified", title="Extension field for ``verified``." ) verifiedBy: fhirtypes.ReferenceType | None = Field( default=None, alias="verifiedBy", title="Person conducting verification", description=( "The person who conducted the verification/validation of the Grantor " "decision." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Organization", "Practitioner", "PractitionerRole", ], }, ) verifiedWith: fhirtypes.ReferenceType | None = Field( default=None, alias="verifiedWith", title="Person who verified", description=( "Who verified the instruction (Patient, Relative or other Authorized " "Person)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "RelatedPerson"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ConsentVerification`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "verified", "verificationType", "verifiedBy", "verifiedWith", "verificationDate", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ConsentVerification`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "verified"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("verified", "verified__ext")] return required_fields ================================================ FILE: fhir/resources/contactdetail.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ContactDetail Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class ContactDetail(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contact information. Specifies contact information for a person or organization. """ __resource_type__ = "ContactDetail" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name of an individual to contact", description="The name of an individual to contact.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="Contact details for individual or organization", description=( "The contact details for the individual (if a name was provided) or the" " organization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContactDetail`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "name", "telecom"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContactDetail`` according to specification, with preserving the original sequence order. """ return ["name", "telecom"] ================================================ FILE: fhir/resources/contactpoint.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ContactPoint Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class ContactPoint(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details of a Technology mediated contact point (phone, fax, email, etc.). Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc. """ __resource_type__ = "ContactPoint" period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period when the contact point was/is in use", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) rank: fhirtypes.PositiveIntType | None = Field( default=None, alias="rank", title="Specify preferred order of use (1 = highest)", description=( "Specifies a preferred order in which to use a set of contacts. " "ContactPoints with lower rank values are more preferred than those " "with higher rank values." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) rank__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rank", title="Extension field for ``rank``." ) system: fhirtypes.CodeType | None = Field( default=None, alias="system", title="phone | fax | email | pager | url | sms | other", description=( "Telecommunications form for contact point - what communications system" " is required to make use of the contact." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["phone", "fax", "email", "pager", "url", "sms", "other"], }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="home | work | temp | old | mobile - purpose of this contact point", description="Identifies the purpose for the contact point.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["home", "work", "temp", "old", "mobile"], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The actual contact point details", description=( "The actual contact point details, in a form that is meaningful to the " "designated communication system (i.e. phone number or email address)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContactPoint`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "system", "value", "use", "rank", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContactPoint`` according to specification, with preserving the original sequence order. """ return ["system", "value", "use", "rank", "period"] ================================================ FILE: fhir/resources/contract.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Contract Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Contract(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Legal Agreement. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. """ __resource_type__ = "Contract" alias: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="alias", title="Acronym or short name", description=( "Alternative representation of the title for this Contract definition, " "derivative, or instance in any legal state., e.g., a domain specific " "contract number related to legislation." ), json_schema_extra={ "element_property": True, }, ) alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_alias", title="Extension field for ``alias``." ) applies: fhirtypes.PeriodType | None = Field( default=None, alias="applies", title="Effective time", description="Relevant time or time-period when this Contract is applicable.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="Source of Contract", description=( "The individual or organization that authored the Contract definition, " "derivative, or instance in any legal state." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "Organization", ], }, ) authority: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="authority", title="Authority under which this Contract has standing", description=( "A formally or informally recognized grouping of people, principals, " "organizations, or jurisdictions formed for the purpose of achieving " "some form of collective action such as the promulgation, " "administration and enforcement of contracts and policies." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) contentDefinition: fhirtypes.ContractContentDefinitionType | None = Field( default=None, alias="contentDefinition", title="Contract precursor content", description=( "Precusory content developed with a focus and intent of supporting the " "formation a Contract instance, which may be associated with and " "transformable into a Contract." ), json_schema_extra={ "element_property": True, }, ) contentDerivative: fhirtypes.CodeableConceptType | None = Field( default=None, alias="contentDerivative", title="Content derived from the basal information", description=( "The minimal content derived from the basal information source at a " "specific stage in its lifecycle." ), json_schema_extra={ "element_property": True, }, ) domain: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="domain", title=( "A sphere of control governed by an authoritative jurisdiction, " "organization, or person" ), description=( "Recognized governance framework or system operating with a " "circumscribed scope in accordance with specified principles, policies," " processes or procedures for managing rights, actions, or behaviors of" " parties or principals relative to resources." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) expirationType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="expirationType", title="Contract cessation cause", description=( "Event resulting in discontinuation or termination of this Contract " "instance by one or more parties to the contract." ), json_schema_extra={ "element_property": True, }, ) friendly: typing.List[fhirtypes.ContractFriendlyType] | None = Field( default=None, alias="friendly", title="Contract Friendly Language", description=( 'The "patient friendly language" versionof the Contract in whole or in ' 'parts. "Patient friendly language" means the representation of the ' "Contract and Contract Provisions in a manner that is readily " "accessible and understandable by a layperson in accordance with best " "practices for communication styles that ensure that those agreeing to " "or signing the Contract understand the roles, actions, obligations, " "responsibilities, and implication of the agreement." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Contract number", description=( "Unique identifier for this Contract or a derivative that references a " "Source Contract." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesCanonical: fhirtypes.ReferenceType | None = Field( default=None, alias="instantiatesCanonical", title="Source Contract Definition", description=( "The URL pointing to a FHIR-defined Contract Definition that is adhered" " to in whole or part by this Contract." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Contract"], }, ) instantiatesUri: fhirtypes.UriType | None = Field( default=None, alias="instantiatesUri", title="External Contract Definition", description=( "The URL pointing to an externally maintained definition that is " "adhered to in whole or in part by this Contract." ), json_schema_extra={ "element_property": True, }, ) instantiatesUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) issued: fhirtypes.DateTimeType | None = Field( default=None, alias="issued", title="When this Contract was issued", description="When this Contract was issued.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issued", title="Extension field for ``issued``." ) legal: typing.List[fhirtypes.ContractLegalType] | None = Field( default=None, alias="legal", title="Contract Legal Language", description="List of Legal expressions or representations of this Contract.", json_schema_extra={ "element_property": True, }, ) legalState: fhirtypes.CodeableConceptType | None = Field( default=None, alias="legalState", title="Negotiation status", description=( "Legal states of the formation of a legal instrument, which is a " "formally executed written document that can be formally attributed to " "its author, records and formally expresses a legally enforceable act, " "process, or contractual duty, obligation, or right, and therefore " "evidences that act, process, or agreement." ), json_schema_extra={ "element_property": True, }, ) legallyBindingAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="legallyBindingAttachment", title="Binding Contract", description=( "Legally binding Contract: This is the signed and legally recognized " 'representation of the Contract, which is considered the "source of ' 'truth" and which would be the basis for legal action related to ' "enforcement of this Contract." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e legallyBinding[x] "one_of_many": "legallyBinding", "one_of_many_required": False, }, ) legallyBindingReference: fhirtypes.ReferenceType | None = Field( default=None, alias="legallyBindingReference", title="Binding Contract", description=( "Legally binding Contract: This is the signed and legally recognized " 'representation of the Contract, which is considered the "source of ' 'truth" and which would be the basis for legal action related to ' "enforcement of this Contract." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e legallyBinding[x] "one_of_many": "legallyBinding", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Composition", "DocumentReference", "QuestionnaireResponse", "Contract", ], }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Computer friendly designation", description=( "A natural language name identifying this Contract definition, " "derivative, or instance in any legal state. Provides additional " "information about its content. This name should be usable as an " "identifier for the module by machine processing applications such as " "code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="relevantHistory", title="Key event in Contract History", description=( "Links to Provenance records for past versions of this Contract " "definition, derivative, or instance, which identify key state " "transitions or updates that are likely to be relevant to a user " "looking at the current version of the Contract. The Provenance.entity" " indicates the target that was changed in the update (see " "[Provenance.entity](provenance-definitions.html#Provenance.entity))." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Provenance"], }, ) rule: typing.List[fhirtypes.ContractRuleType] | None = Field( default=None, alias="rule", title="Computable Contract Language", description=( "List of Computable Policy Rule Language Representations of this " "Contract." ), json_schema_extra={ "element_property": True, }, ) scope: fhirtypes.CodeableConceptType | None = Field( default=None, alias="scope", title="Range of Legal Concerns", description=( "A selector of legal concerns for this Contract definition, derivative," " or instance in any legal state." ), json_schema_extra={ "element_property": True, }, ) signer: typing.List[fhirtypes.ContractSignerType] | None = Field( default=None, alias="signer", title="Contract Signatory", description=( "Parties with legal standing in the Contract, including the principal " "parties, the grantor(s) and grantee(s), which are any person or " "organization bound by the contract, and any ancillary parties, which " "facilitate the execution of the contract such as a notary or witness." ), json_schema_extra={ "element_property": True, }, ) site: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="site", title="Specific Location", description="Sites in which the contract is complied with, exercised, or in force.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "amended | appended | cancelled | disputed | entered-in-error | " "executable +" ), description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "amended", "appended", "cancelled", "disputed", "entered-in-error", "executable", "+", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="subType", title="Subtype within the context of type", description=( "Sub-category for the Contract that distinguishes the kinds of systems " "that would be interested in the Contract within the context of the " "Contract's scope." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subject: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="subject", title="Contract Target Entity", description=( "The target entity impacted by or of interest to parties to the " "agreement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) subtitle: fhirtypes.StringType | None = Field( default=None, alias="subtitle", title="Subordinate Friendly name", description=( "A more detailed or qualifying explanatory or alternate user-friendly " "title for this Contract definition, derivative, or instance in any " "legal state." ), json_schema_extra={ "element_property": True, }, ) subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subtitle", title="Extension field for ``subtitle``." ) supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInfo", title="Extra Information", description=( "Information that may be needed by/relevant to the performer in their " "execution of this term action." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) term: typing.List[fhirtypes.ContractTermType] | None = Field( default=None, alias="term", title="Contract Term List", description=( "One or more Contract Provisions, which may be related and conveyed as " "a group, and may contain nested groups." ), json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Human Friendly name", description=( "A short, descriptive, user-friendly title for this Contract " "definition, derivative, or instance in any legal state." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) topicCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="topicCodeableConcept", title="Focus of contract interest", description=( "Narrows the range of legal concerns to focus on the achievement of " "specific contractual objectives." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e topic[x] "one_of_many": "topic", "one_of_many_required": False, }, ) topicReference: fhirtypes.ReferenceType | None = Field( default=None, alias="topicReference", title="Focus of contract interest", description=( "Narrows the range of legal concerns to focus on the achievement of " "specific contractual objectives." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e topic[x] "one_of_many": "topic", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Legal instrument category", description=( "A high-level category for the legal instrument, whether constructed as" " a Contract definition, derivative, or instance in any legal state. " "Provides additional information about its content within the context " "of the Contract's scope to distinguish the kinds of systems that would" " be interested in the contract." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Basal definition", description=( "Canonical identifier for this contract, represented as a URI (globally" " unique)." ), json_schema_extra={ "element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business edition", description=( "An edition identifier used for business purposes to label business " "significant variants." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Contract`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "url", "version", "status", "legalState", "instantiatesCanonical", "instantiatesUri", "contentDerivative", "issued", "applies", "expirationType", "subject", "authority", "domain", "site", "name", "title", "subtitle", "alias", "author", "scope", "topicCodeableConcept", "topicReference", "type", "subType", "contentDefinition", "term", "supportingInfo", "relevantHistory", "signer", "friendly", "legal", "rule", "legallyBindingAttachment", "legallyBindingReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Contract`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "version", "status", "issued", "applies", "subject", "name", "title", "type", "subType", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "legallyBinding": ["legallyBindingAttachment", "legallyBindingReference"], "topic": ["topicCodeableConcept", "topicReference"], } return one_of_many_fields class ContractContentDefinition(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contract precursor content. Precusory content developed with a focus and intent of supporting the formation a Contract instance, which may be associated with and transformable into a Contract. """ __resource_type__ = "ContractContentDefinition" copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Publication Ownership", description=( "A copyright statement relating to Contract precursor content. " "Copyright statements are generally legal restrictions on the use and " "publishing of the Contract precursor content." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) publicationDate: fhirtypes.DateTimeType | None = Field( default=None, alias="publicationDate", title="When published", description=( "The date (and optionally time) when the contract was last " "significantly changed. The date must change when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the contract changes." ), json_schema_extra={ "element_property": True, }, ) publicationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publicationDate", title="Extension field for ``publicationDate``.", ) publicationStatus: fhirtypes.CodeType | None = Field( default=None, alias="publicationStatus", title=( "amended | appended | cancelled | disputed | entered-in-error | " "executable +" ), description=None, json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "amended", "appended", "cancelled", "disputed", "entered-in-error", "executable", "+", ], }, ) publicationStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publicationStatus", title="Extension field for ``publicationStatus``.", ) publisher: fhirtypes.ReferenceType | None = Field( default=None, alias="publisher", title="Publisher Entity", description=( "The individual or organization that published the Contract precursor " "content." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) subType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subType", title="Detailed Content Type Definition", description="Detailed Precusory content type.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Content structure and use", description=( "Precusory content structure and use, i.e., a boilerplate, template, " "application for a contract such as an insurance policy or benefits " "under a program, e.g., workers compensation." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractContentDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "subType", "publisher", "publicationDate", "publicationStatus", "copyright", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractContentDefinition`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("publicationStatus", "publicationStatus__ext")] return required_fields class ContractFriendly(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contract Friendly Language. The "patient friendly language" versionof the Contract in whole or in parts. "Patient friendly language" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement. """ __resource_type__ = "ContractFriendly" contentAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="contentAttachment", title="Easily comprehended representation of this Contract", description=( "Human readable rendering of this Contract in a format and " "representation intended to enhance comprehension and ensure " "understandability." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, }, ) contentReference: fhirtypes.ReferenceType | None = Field( default=None, alias="contentReference", title="Easily comprehended representation of this Contract", description=( "Human readable rendering of this Contract in a format and " "representation intended to enhance comprehension and ensure " "understandability." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Composition", "DocumentReference", "QuestionnaireResponse", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractFriendly`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "contentAttachment", "contentReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractFriendly`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"content": ["contentAttachment", "contentReference"]} return one_of_many_fields class ContractLegal(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contract Legal Language. List of Legal expressions or representations of this Contract. """ __resource_type__ = "ContractLegal" contentAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="contentAttachment", title="Contract Legal Text", description="Contract legal text in human renderable form.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, }, ) contentReference: fhirtypes.ReferenceType | None = Field( default=None, alias="contentReference", title="Contract Legal Text", description="Contract legal text in human renderable form.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Composition", "DocumentReference", "QuestionnaireResponse", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractLegal`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "contentAttachment", "contentReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractLegal`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"content": ["contentAttachment", "contentReference"]} return one_of_many_fields class ContractRule(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Computable Contract Language. List of Computable Policy Rule Language Representations of this Contract. """ __resource_type__ = "ContractRule" contentAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="contentAttachment", title="Computable Contract Rules", description=( "Computable Contract conveyed using a policy rule language (e.g. XACML," " DKAL, SecPal)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, }, ) contentReference: fhirtypes.ReferenceType | None = Field( default=None, alias="contentReference", title="Computable Contract Rules", description=( "Computable Contract conveyed using a policy rule language (e.g. XACML," " DKAL, SecPal)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e content[x] "one_of_many": "content", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractRule`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "contentAttachment", "contentReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractRule`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"content": ["contentAttachment", "contentReference"]} return one_of_many_fields class ContractSigner(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contract Signatory. Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness. """ __resource_type__ = "ContractSigner" party: fhirtypes.ReferenceType = Field( default=..., alias="party", title="Contract Signatory Party", description="Party which is a signator to this Contract.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", ], }, ) signature: typing.List[fhirtypes.SignatureType] = Field( default=..., alias="signature", title="Contract Documentation Signature", description="Legally binding Contract DSIG signature contents in Base64.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodingType = Field( default=..., alias="type", title="Contract Signatory Role", description="Role of this Contract signer, e.g. notary, grantee.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractSigner`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "party", "signature"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractSigner`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ContractTerm(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contract Term List. One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups. """ __resource_type__ = "ContractTerm" action: typing.List[fhirtypes.ContractTermActionType] | None = Field( default=None, alias="action", title="Entity being ascribed responsibility", description=( "An actor taking a role in an activity for which it can be assigned " "some degree of responsibility for the activity taking place." ), json_schema_extra={ "element_property": True, }, ) applies: fhirtypes.PeriodType | None = Field( default=None, alias="applies", title="Contract Term Effective Time", description=( "Relevant time or time-period when this Contract Provision is " "applicable." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) asset: typing.List[fhirtypes.ContractTermAssetType] | None = Field( default=None, alias="asset", title="Contract Term Asset List", description=None, json_schema_extra={ "element_property": True, }, ) group: typing.List[fhirtypes.ContractTermType] | None = Field( default=None, alias="group", title="Nested Contract Term Group", description="Nested group of Contract Provisions.", json_schema_extra={ "element_property": True, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Contract Term Number", description="Unique identifier for this particular Contract Provision.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued: fhirtypes.DateTimeType | None = Field( default=None, alias="issued", title="Contract Term Issue Date Time", description="When this Contract Provision was issued.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issued", title="Extension field for ``issued``." ) offer: fhirtypes.ContractTermOfferType = Field( default=..., alias="offer", title="Context of the Contract term", description=( "The matter of concern in the context of this provision of the " "agrement." ), json_schema_extra={ "element_property": True, }, ) securityLabel: typing.List[fhirtypes.ContractTermSecurityLabelType] | None = Field( default=None, alias="securityLabel", title="Protection for the Term", description=( "Security labels that protect the handling of information about the " "term and its elements, which may be specifically identified." ), json_schema_extra={ "element_property": True, }, ) subType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subType", title="Contract Term Type specific classification", description=( "A specialized legal clause or condition based on overarching contract " "type." ), json_schema_extra={ "element_property": True, }, ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Term Statement", description="Statement of a provision in a policy or a contract.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) topicCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="topicCodeableConcept", title="Term Concern", description="The entity that the term applies to.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e topic[x] "one_of_many": "topic", "one_of_many_required": False, }, ) topicReference: fhirtypes.ReferenceType | None = Field( default=None, alias="topicReference", title="Term Concern", description="The entity that the term applies to.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e topic[x] "one_of_many": "topic", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Contract Term Type or Form", description=( "A legal clause or condition contained within a contract that requires " "one or both parties to perform a particular requirement by some " "specified time or prevents one or both parties from performing a " "particular requirement by some specified time." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractTerm`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "issued", "applies", "topicCodeableConcept", "topicReference", "type", "subType", "text", "securityLabel", "offer", "asset", "action", "group", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractTerm`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "identifier", "issued", "applies", "text"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"topic": ["topicCodeableConcept", "topicReference"]} return one_of_many_fields class ContractTermAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Entity being ascribed responsibility. An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place. """ __resource_type__ = "ContractTermAction" context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title="Episode associated with action", description=( "Encounter or Episode with primary association to the specified term " "activity." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) contextLinkId: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="contextLinkId", title="Pointer to specific item", description=( "Id [identifier??] of the clause or question text related to the " "requester of this action in the referenced form or " "QuestionnaireResponse." ), json_schema_extra={ "element_property": True, }, ) contextLinkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_contextLinkId", title="Extension field for ``contextLinkId``.", ) doNotPerform: bool | None = Field( default=None, alias="doNotPerform", title="True if the term prohibits the action", description=None, json_schema_extra={ "element_property": True, }, ) doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doNotPerform", title="Extension field for ``doNotPerform``.", ) intent: fhirtypes.CodeableConceptType = Field( default=..., alias="intent", title="Purpose for the Contract Term Action", description=( "Reason or purpose for the action stipulated by this Contract " "Provision." ), json_schema_extra={ "element_property": True, }, ) linkId: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="linkId", title="Pointer to specific item", description=( "Id [identifier??] of the clause or question text related to this " "action in the referenced form or QuestionnaireResponse." ), json_schema_extra={ "element_property": True, }, ) linkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments about the action", description=( "Comments made about the term action made by the requester, performer, " "subject or other participants." ), json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When action happens", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="When action happens", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceTiming: fhirtypes.TimingType | None = Field( default=None, alias="occurrenceTiming", title="When action happens", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) performer: fhirtypes.ReferenceType | None = Field( default=None, alias="performer", title="Actor that wil execute (or not) the action", description=( "Indicates who or what is being asked to perform (or not perform) the " "ction." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "RelatedPerson", "Patient", "Practitioner", "PractitionerRole", "CareTeam", "Device", "Substance", "Organization", "Location", ], }, ) performerLinkId: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="performerLinkId", title="Pointer to specific item", description=( "Id [identifier??] of the clause or question text related to the reason" " type or reference of this action in the referenced form or " "QuestionnaireResponse." ), json_schema_extra={ "element_property": True, }, ) performerLinkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_performerLinkId", title="Extension field for ``performerLinkId``.", ) performerRole: fhirtypes.CodeableConceptType | None = Field( default=None, alias="performerRole", title="Competency of the performer", description=( "The type of role or competency of an individual desired or required to" " perform or not perform the action." ), json_schema_extra={ "element_property": True, }, ) performerType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="performerType", title="Kind of service performer", description=( "The type of individual that is desired or required to perform or not " "perform the action." ), json_schema_extra={ "element_property": True, }, ) reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="reason", title="Why is action (not) needed?", description=( "Rationale for the action to be performed or not performed. Describes " "why the action is permitted or prohibited. Either a coded concept, or " "another resource whose existence justifies permitting or not " "permitting this action." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "DiagnosticReport", "DocumentReference", "Questionnaire", "QuestionnaireResponse", ], }, ) reasonLinkId: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="reasonLinkId", title="Pointer to specific item", description=( "Id [identifier??] of the clause or question text related to the reason" " type or reference of this action in the referenced form or " "QuestionnaireResponse." ), json_schema_extra={ "element_property": True, }, ) reasonLinkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_reasonLinkId", title="Extension field for ``reasonLinkId``.", ) requester: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="requester", title="Who asked for action", description=( "Who or what initiated the action and has responsibility for its " "activation." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "RelatedPerson", "Practitioner", "PractitionerRole", "Device", "Group", "Organization", ], }, ) requesterLinkId: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="requesterLinkId", title="Pointer to specific item", description=( "Id [identifier??] of the clause or question text related to the " "requester of this action in the referenced form or " "QuestionnaireResponse." ), json_schema_extra={ "element_property": True, }, ) requesterLinkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_requesterLinkId", title="Extension field for ``requesterLinkId``.", ) securityLabelNumber: typing.List[fhirtypes.UnsignedIntType | None] | None = Field( default=None, alias="securityLabelNumber", title="Action restriction numbers", description="Security labels that protects the action.", json_schema_extra={ "element_property": True, }, ) securityLabelNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_securityLabelNumber", title="Extension field for ``securityLabelNumber``.", ) status: fhirtypes.CodeableConceptType = Field( default=..., alias="status", title="State of the action", description="Current state of the term action.", json_schema_extra={ "element_property": True, }, ) subject: typing.List[fhirtypes.ContractTermActionSubjectType] | None = Field( default=None, alias="subject", title="Entity of the action", description=None, json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Type or form of the action", description=( "Activity or service obligation to be done or not done, performed or " "not performed, effectuated or not by this Contract term." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractTermAction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "doNotPerform", "type", "subject", "intent", "linkId", "status", "context", "contextLinkId", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "requester", "requesterLinkId", "performerType", "performerRole", "performer", "performerLinkId", "reason", "reasonLinkId", "note", "securityLabelNumber", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractTermAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "occurrence": ["occurrenceDateTime", "occurrencePeriod", "occurrenceTiming"] } return one_of_many_fields class ContractTermActionSubject(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Entity of the action. """ __resource_type__ = "ContractTermActionSubject" reference: typing.List[fhirtypes.ReferenceType] = Field( default=..., alias="reference", title="Entity of the action", description="The entity the action is performed or not performed on or for.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "RelatedPerson", "Practitioner", "PractitionerRole", "Device", "Group", "Organization", ], }, ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="Role type of the agent", description="Role type of agent assigned roles in this Contract.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractTermActionSubject`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "reference", "role"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractTermActionSubject`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ContractTermAsset(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contract Term Asset List. """ __resource_type__ = "ContractTermAsset" answer: typing.List[fhirtypes.ContractTermOfferAnswerType] | None = Field( default=None, alias="answer", title="Response to assets", description=None, json_schema_extra={ "element_property": True, }, ) condition: fhirtypes.StringType | None = Field( default=None, alias="condition", title="Quality desctiption of asset", description=( "Description of the quality and completeness of the asset that may be a" " factor in its valuation." ), json_schema_extra={ "element_property": True, }, ) condition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_condition", title="Extension field for ``condition``." ) context: typing.List[fhirtypes.ContractTermAssetContextType] | None = Field( default=None, alias="context", title="Circumstance of the asset", description=None, json_schema_extra={ "element_property": True, }, ) linkId: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="linkId", title="Pointer to asset text", description=( "Id [identifier??] of the clause or question text about the asset in " "the referenced form or QuestionnaireResponse." ), json_schema_extra={ "element_property": True, }, ) linkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) period: typing.List[fhirtypes.PeriodType] | None = Field( default=None, alias="period", title="Time period of the asset", description="Asset relevant contractual time period.", json_schema_extra={ "element_property": True, }, ) periodType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="periodType", title="Asset availability types", description="Type of Asset availability for use or ownership.", json_schema_extra={ "element_property": True, }, ) relationship: fhirtypes.CodingType | None = Field( default=None, alias="relationship", title="Kinship of the asset", description=( "Specifies the applicability of the term to an asset resource instance," " and instances it refers to or instances that refer to it, and/or are " "owned by the offeree." ), json_schema_extra={ "element_property": True, }, ) scope: fhirtypes.CodeableConceptType | None = Field( default=None, alias="scope", title="Range of asset", description="Differentiates the kind of the asset .", json_schema_extra={ "element_property": True, }, ) securityLabelNumber: typing.List[fhirtypes.UnsignedIntType | None] | None = Field( default=None, alias="securityLabelNumber", title="Asset restriction numbers", description="Security labels that protects the asset.", json_schema_extra={ "element_property": True, }, ) securityLabelNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_securityLabelNumber", title="Extension field for ``securityLabelNumber``.", ) subtype: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="subtype", title="Asset sub-category", description="May be a subtype or part of an offered asset.", json_schema_extra={ "element_property": True, }, ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Asset clause or question text", description=( "Clause or question text (Prose Object) concerning the asset in a " "linked form, such as a QuestionnaireResponse used in the formation of " "the contract." ), json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Asset category", description="Target entity type about which the term may be concerned.", json_schema_extra={ "element_property": True, }, ) typeReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="typeReference", title="Associated entities", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) usePeriod: typing.List[fhirtypes.PeriodType] | None = Field( default=None, alias="usePeriod", title="Time period", description="Time period of asset use.", json_schema_extra={ "element_property": True, }, ) valuedItem: typing.List[fhirtypes.ContractTermAssetValuedItemType] | None = Field( default=None, alias="valuedItem", title="Contract Valued Item List", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractTermAsset`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "scope", "type", "typeReference", "subtype", "relationship", "context", "condition", "periodType", "period", "usePeriod", "text", "linkId", "answer", "securityLabelNumber", "valuedItem", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractTermAsset`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ContractTermAssetContext(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Circumstance of the asset. """ __resource_type__ = "ContractTermAssetContext" code: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="code", title="Codeable asset context", description=( "Coded representation of the context generally or of the Referenced " "entity, such as the asset holder type or location." ), json_schema_extra={ "element_property": True, }, ) reference: fhirtypes.ReferenceType | None = Field( default=None, alias="reference", title="Creator,custodian or owner", description=( "Asset context reference may include the creator, custodian, or owning " "Person or Organization (e.g., bank, repository), location held, e.g.," " building, jurisdiction." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Context description", description=None, json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractTermAssetContext`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "reference", "code", "text"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractTermAssetContext`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ContractTermAssetValuedItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contract Valued Item List. """ __resource_type__ = "ContractTermAssetValuedItem" effectiveTime: fhirtypes.DateTimeType | None = Field( default=None, alias="effectiveTime", title="Contract Valued Item Effective Tiem", description=( "Indicates the time during which this Contract ValuedItem information " "is effective." ), json_schema_extra={ "element_property": True, }, ) effectiveTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_effectiveTime", title="Extension field for ``effectiveTime``.", ) entityCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="entityCodeableConcept", title="Contract Valued Item Type", description="Specific type of Contract Valued Item that may be priced.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e entity[x] "one_of_many": "entity", "one_of_many_required": False, }, ) entityReference: fhirtypes.ReferenceType | None = Field( default=None, alias="entityReference", title="Contract Valued Item Type", description="Specific type of Contract Valued Item that may be priced.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e entity[x] "one_of_many": "entity", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Contract Valued Item Price Scaling Factor", description=( "A real number that represents a multiplier used in determining the " "overall value of the Contract Valued Item delivered. The concept of a " "Factor allows for a discount or surcharge multiplier to be applied to " "a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Contract Valued Item Number", description="Identifies a Contract Valued Item instance.", json_schema_extra={ "element_property": True, }, ) linkId: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="linkId", title="Pointer to specific item", description=( "Id of the clause or question text related to the context of this " "valuedItem in the referenced form or QuestionnaireResponse." ), json_schema_extra={ "element_property": True, }, ) linkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total Contract Valued Item Value", description=( "Expresses the product of the Contract Valued Item unitQuantity and the" " unitPriceAmt. For example, the formula: unit Quantity * unit Price " "(Cost per Point) * factor Number * points = net Amount. Quantity, " "factor and points are assumed to be 1 if not supplied." ), json_schema_extra={ "element_property": True, }, ) payment: fhirtypes.StringType | None = Field( default=None, alias="payment", title="Terms of valuation", description=None, json_schema_extra={ "element_property": True, }, ) payment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_payment", title="Extension field for ``payment``." ) paymentDate: fhirtypes.DateTimeType | None = Field( default=None, alias="paymentDate", title="When payment is due", description=None, json_schema_extra={ "element_property": True, }, ) paymentDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_paymentDate", title="Extension field for ``paymentDate``." ) points: fhirtypes.DecimalType | None = Field( default=None, alias="points", title="Contract Valued Item Difficulty Scaling Factor", description=( "An amount that expresses the weighting (based on difficulty, cost " "and/or resource intensiveness) associated with the Contract Valued " "Item delivered. The concept of Points allows for assignment of point " "values for a Contract Valued Item, such that a monetary amount can be " "assigned to each point." ), json_schema_extra={ "element_property": True, }, ) points__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_points", title="Extension field for ``points``." ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of Contract Valued Items", description=( "Specifies the units by which the Contract Valued Item is measured or " "counted, and quantifies the countable or measurable Contract Valued " "Item instances." ), json_schema_extra={ "element_property": True, }, ) recipient: fhirtypes.ReferenceType | None = Field( default=None, alias="recipient", title="Who will receive payment", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", ], }, ) responsible: fhirtypes.ReferenceType | None = Field( default=None, alias="responsible", title="Who will make payment", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", ], }, ) securityLabelNumber: typing.List[fhirtypes.UnsignedIntType | None] | None = Field( default=None, alias="securityLabelNumber", title="Security Labels that define affected terms", description=( "A set of security labels that define which terms are controlled by " "this condition." ), json_schema_extra={ "element_property": True, }, ) securityLabelNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_securityLabelNumber", title="Extension field for ``securityLabelNumber``.", ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Contract Valued Item fee, charge, or cost", description="A Contract Valued Item unit valuation measure.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractTermAssetValuedItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "entityCodeableConcept", "entityReference", "identifier", "effectiveTime", "quantity", "unitPrice", "factor", "points", "net", "payment", "paymentDate", "responsible", "recipient", "linkId", "securityLabelNumber", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractTermAssetValuedItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"entity": ["entityCodeableConcept", "entityReference"]} return one_of_many_fields class ContractTermOffer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Context of the Contract term. The matter of concern in the context of this provision of the agrement. """ __resource_type__ = "ContractTermOffer" answer: typing.List[fhirtypes.ContractTermOfferAnswerType] | None = Field( default=None, alias="answer", title="Response to offer text", description=None, json_schema_extra={ "element_property": True, }, ) decision: fhirtypes.CodeableConceptType | None = Field( default=None, alias="decision", title="Accepting party choice", description=( "Type of choice made by accepting party with respect to an offer made " "by an offeror/ grantee." ), json_schema_extra={ "element_property": True, }, ) decisionMode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="decisionMode", title="How decision is conveyed", description="How the decision about a Contract was conveyed.", json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Offer business ID", description="Unique identifier for this particular Contract Provision.", json_schema_extra={ "element_property": True, }, ) linkId: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="linkId", title="Pointer to text", description=( "The id of the clause or question text of the offer in the referenced " "questionnaire/response." ), json_schema_extra={ "element_property": True, }, ) linkId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) party: typing.List[fhirtypes.ContractTermOfferPartyType] | None = Field( default=None, alias="party", title="Offer Recipient", description=None, json_schema_extra={ "element_property": True, }, ) securityLabelNumber: typing.List[fhirtypes.UnsignedIntType | None] | None = Field( default=None, alias="securityLabelNumber", title="Offer restriction numbers", description="Security labels that protects the offer.", json_schema_extra={ "element_property": True, }, ) securityLabelNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_securityLabelNumber", title="Extension field for ``securityLabelNumber``.", ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Human readable offer text", description="Human readable form of this Contract Offer.", json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) topic: fhirtypes.ReferenceType | None = Field( default=None, alias="topic", title="Negotiable offer asset", description=( "The owner of an asset has the residual control rights over the asset: " "the right to decide all usages of the asset in any way not " "inconsistent with a prior contract, custom, or law (Hart, 1995, p. " "30)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Contract Offer Type or Form", description=( "Type of Contract Provision such as specific requirements, purposes for" " actions, obligations, prohibitions, e.g. life time maximum benefit." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractTermOffer`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "party", "topic", "type", "decision", "decisionMode", "answer", "text", "linkId", "securityLabelNumber", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractTermOffer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "topic"] class ContractTermOfferAnswer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Response to offer text. """ __resource_type__ = "ContractTermOfferAnswer" valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="The actual answer response", description=( "Response to an offer clause or question text, which enables selection" " of values to be agreed to, e.g., the period of participation, the " "date of occupancy of a rental, warranty duration, or whether " "biospecimen may be used for further research." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="The actual answer response", description=( "Response to an offer clause or question text, which enables selection" " of values to be agreed to, e.g., the period of participation, the " "date of occupancy of a rental, warranty duration, or whether " "biospecimen may be used for further research." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="The actual answer response", description=( "Response to an offer clause or question text, which enables selection" " of values to be agreed to, e.g., the period of participation, the " "date of occupancy of a rental, warranty duration, or whether " "biospecimen may be used for further research." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="The actual answer response", description=( "Response to an offer clause or question text, which enables selection" " of values to be agreed to, e.g., the period of participation, the " "date of occupancy of a rental, warranty duration, or whether " "biospecimen may be used for further research." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="The actual answer response", description=( "Response to an offer clause or question text, which enables selection" " of values to be agreed to, e.g., the period of participation, the " "date of occupancy of a rental, warranty duration, or whether " "biospecimen may be used for further research." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="The actual answer response", description=( "Response to an offer clause or question text, which enables selection" " of values to be agreed to, e.g., the period of participation, the " "date of occupancy of a rental, warranty duration, or whether " "biospecimen may be used for further research." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="The actual answer response", description=( "Response to an offer clause or question text, which enables selection" " of values to be agreed to, e.g., the period of participation, the " "date of occupancy of a rental, warranty duration, or whether " "biospecimen may be used for further research." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="The actual answer response", description=( "Response to an offer clause or question text, which enables selection" " of values to be agreed to, e.g., the period of participation, the " "date of occupancy of a rental, warranty duration, or whether " "biospecimen may be used for further research." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="The actual answer response", description=( "Response to an offer clause or question text, which enables selection" " of values to be agreed to, e.g., the period of participation, the " "date of occupancy of a rental, warranty duration, or whether " "biospecimen may be used for further research." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="The actual answer response", description=( "Response to an offer clause or question text, which enables selection" " of values to be agreed to, e.g., the period of participation, the " "date of occupancy of a rental, warranty duration, or whether " "biospecimen may be used for further research." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="The actual answer response", description=( "Response to an offer clause or question text, which enables selection" " of values to be agreed to, e.g., the period of participation, the " "date of occupancy of a rental, warranty duration, or whether " "biospecimen may be used for further research." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="The actual answer response", description=( "Response to an offer clause or question text, which enables selection" " of values to be agreed to, e.g., the period of participation, the " "date of occupancy of a rental, warranty duration, or whether " "biospecimen may be used for further research." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractTermOfferAnswer`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "valueBoolean", "valueDecimal", "valueInteger", "valueDate", "valueDateTime", "valueTime", "valueString", "valueUri", "valueAttachment", "valueCoding", "valueQuantity", "valueReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractTermOfferAnswer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueBoolean", "valueCoding", "valueDate", "valueDateTime", "valueDecimal", "valueInteger", "valueQuantity", "valueReference", "valueString", "valueTime", "valueUri", ] } return one_of_many_fields class ContractTermOfferParty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Offer Recipient. """ __resource_type__ = "ContractTermOfferParty" reference: typing.List[fhirtypes.ReferenceType] = Field( default=..., alias="reference", title="Referenced entity", description="Participant in the offer.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "RelatedPerson", "Practitioner", "PractitionerRole", "Device", "Group", "Organization", ], }, ) role: fhirtypes.CodeableConceptType = Field( default=..., alias="role", title="Participant engagement type", description="How the party participates in the offer.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractTermOfferParty`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "reference", "role"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractTermOfferParty`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ContractTermSecurityLabel(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Protection for the Term. Security labels that protect the handling of information about the term and its elements, which may be specifically identified. """ __resource_type__ = "ContractTermSecurityLabel" category: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="category", title="Applicable Policy", description=( "Security label privacy tag that specifies the applicable privacy and " "security policies governing this term and/or term elements." ), json_schema_extra={ "element_property": True, }, ) classification: fhirtypes.CodingType = Field( default=..., alias="classification", title="Confidentiality Protection", description=( "Security label privacy tag that specifies the level of confidentiality" " protection required for this term and/or term elements." ), json_schema_extra={ "element_property": True, }, ) control: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="control", title="Handling Instructions", description=( "Security label privacy tag that specifies the manner in which term " "and/or term elements are to be protected." ), json_schema_extra={ "element_property": True, }, ) number: typing.List[fhirtypes.UnsignedIntType | None] | None = Field( default=None, alias="number", title="Link to Security Labels", description=( "Number used to link this term or term element to the applicable " "Security Label." ), json_schema_extra={ "element_property": True, }, ) number__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_number", title="Extension field for ``number``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ContractTermSecurityLabel`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "number", "classification", "category", "control", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ContractTermSecurityLabel`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/contributor.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Contributor Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class Contributor(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contributor information. A contributor to the content of a knowledge asset, including authors, editors, reviewers, and endorsers. """ __resource_type__ = "Contributor" contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details of the contributor", description=( "Contact details to assist a user in finding and communicating with the" " contributor." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Who contributed the content", description=( "The name of the individual or organization responsible for the " "contribution." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="author | editor | reviewer | endorser", description="The type of contributor.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["author", "editor", "reviewer", "endorser"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Contributor`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "type", "name", "contact"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Contributor`` according to specification, with preserving the original sequence order. """ return ["type", "name", "contact"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext"), ("type", "type__ext")] return required_fields ================================================ FILE: fhir/resources/count.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Count Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from . import quantity class Count(quantity.Quantity): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A measured or measurable amount. A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. """ __resource_type__ = "Count" @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Count`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "value", "comparator", "unit", "system", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Count`` according to specification, with preserving the original sequence order. """ return ["value", "comparator", "unit", "system", "code"] ================================================ FILE: fhir/resources/coverage.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Coverage Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Coverage(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Insurance or medical plan or a payment agreement. Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment. """ __resource_type__ = "Coverage" beneficiary: fhirtypes.ReferenceType = Field( default=..., alias="beneficiary", title="Plan beneficiary", description=( "The party who benefits from the insurance coverage; the patient when " "products and/or services are provided." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) class_fhir: typing.List[fhirtypes.CoverageClassType] | None = Field( default=None, alias="class", title="Additional coverage classifications", description="A suite of underwriter specific classifiers.", json_schema_extra={ "element_property": True, }, ) contract: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="contract", title="Contract details", description="The policy(s) which constitute this insurance coverage.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Contract"], }, ) costToBeneficiary: typing.List[ fhirtypes.CoverageCostToBeneficiaryType ] | None = Field( default=None, alias="costToBeneficiary", title="Patient payments for services/products", description=( "A suite of codes indicating the cost category and associated amount " "which have been detailed in the policy and may have been included on " "the health card." ), json_schema_extra={ "element_property": True, }, ) dependent: fhirtypes.StringType | None = Field( default=None, alias="dependent", title="Dependent number", description="A designator for a dependent under the coverage.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dependent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dependent", title="Extension field for ``dependent``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier(s) for this coverage", description="The identifier of the coverage as issued by the insurer.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) insurancePlan: fhirtypes.ReferenceType | None = Field( default=None, alias="insurancePlan", title="Insurance plan details", description=( "The insurance plan details, benefits and costs, which constitute this " "insurance coverage." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["InsurancePlan"], }, ) insurer: fhirtypes.ReferenceType | None = Field( default=None, alias="insurer", title="Issuer of the policy", description="The program or plan underwriter, payor, insurance company.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title="insurance | self-pay | other", description=( "The nature of the coverage be it insurance, or cash payment such as " "self-pay." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["insurance", "self-pay", "other"], }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) network: fhirtypes.StringType | None = Field( default=None, alias="network", title="Insurer network", description=( "The insurer-specific identifier for the insurer-defined network of " "providers to which the beneficiary may seek treatment which will be " "covered at the 'in-network' rate, otherwise 'out of network' terms and" " conditions apply." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) network__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_network", title="Extension field for ``network``." ) order: fhirtypes.PositiveIntType | None = Field( default=None, alias="order", title="Relative order of the coverage", description=( "The order of applicability of this coverage relative to other " "coverages which are currently in force. Note, there may be gaps in the" " numbering and this does not imply primary, secondary etc. as the " "specific positioning of coverages depends upon the episode of care. " "For example; a patient might have (0) auto insurance (1) their own " "health insurance and (2) spouse's health insurance. When claiming for " "treatments which were not the result of an auto accident then only " "coverages (1) and (2) above would be applicatble and would apply in " "the order specified in parenthesis." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) order__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_order", title="Extension field for ``order``." ) paymentBy: typing.List[fhirtypes.CoveragePaymentByType] | None = Field( default=None, alias="paymentBy", title="Self-pay parties and responsibility", description=( "Link to the paying party and optionally what specifically they will be" " responsible to pay." ), json_schema_extra={ "element_property": True, }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Coverage start and end dates", description=( "Time period during which the coverage is in force. A missing start " "date indicates the start date isn't known, a missing end date means " "the coverage is continuing to be in force." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) policyHolder: fhirtypes.ReferenceType | None = Field( default=None, alias="policyHolder", title="Owner of the policy", description="The party who 'owns' the insurance policy.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "RelatedPerson", "Organization"], }, ) relationship: fhirtypes.CodeableConceptType | None = Field( default=None, alias="relationship", title="Beneficiary relationship to the subscriber", description="The relationship of beneficiary (patient) to the subscriber.", json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subrogation: bool | None = Field( default=None, alias="subrogation", title="Reimbursement to insurer", description=( "When 'subrogation=true' this insurance instance has been included not " "for adjudication but to provide insurers with the details to recover " "costs." ), json_schema_extra={ "element_property": True, }, ) subrogation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subrogation", title="Extension field for ``subrogation``." ) subscriber: fhirtypes.ReferenceType | None = Field( default=None, alias="subscriber", title="Subscriber to the policy", description=( "The party who has signed-up for or 'owns' the contractual relationship" " to the policy or to whom the benefit of the policy for services " "rendered to them or their family is due." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "RelatedPerson"], }, ) subscriberId: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="subscriberId", title="ID assigned to the subscriber", description="The insurer assigned ID for the Subscriber.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Coverage category such as medical or accident", description=( "The type of coverage: social program, medical plan, accident coverage " "(workers compensation, auto), group health or payment by an individual" " or organization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Coverage`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "kind", "paymentBy", "type", "policyHolder", "subscriber", "subscriberId", "beneficiary", "dependent", "relationship", "period", "insurer", "class", "order", "network", "costToBeneficiary", "subrogation", "contract", "insurancePlan", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Coverage`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "kind", "type", "policyHolder", "subscriber", "subscriberId", "beneficiary", "dependent", "period", "insurer", "order", "network", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("kind", "kind__ext"), ("status", "status__ext")] return required_fields class CoverageClass(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional coverage classifications. A suite of underwriter specific classifiers. """ __resource_type__ = "CoverageClass" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Human readable description of the type and value", description="A short description for the class.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Type of class such as 'group' or 'plan'", description=( "The type of classification for which an insurer-specific class label " "or number and optional name is provided. For example, type may be " "used to identify a class of coverage or employer group, policy, or " "plan." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) value: fhirtypes.IdentifierType = Field( default=..., alias="value", title="Value associated with the type", description="The alphanumeric identifier associated with the insurer issued label.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageClass`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "value", "name"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageClass`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "value", "name"] class CoverageCostToBeneficiary(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Patient payments for services/products. A suite of codes indicating the cost category and associated amount which have been detailed in the policy and may have been included on the health card. """ __resource_type__ = "CoverageCostToBeneficiary" category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Benefit classification", description=( "Code to identify the general type of benefits under which products and" " services are provided." ), json_schema_extra={ "element_property": True, }, ) exception: typing.List[ fhirtypes.CoverageCostToBeneficiaryExceptionType ] | None = Field( default=None, alias="exception", title="Exceptions for patient payments", description=( "A suite of codes indicating exceptions or reductions to patient costs " "and their effective periods." ), json_schema_extra={ "element_property": True, }, ) network: fhirtypes.CodeableConceptType | None = Field( default=None, alias="network", title="In or out of network", description=( "Is a flag to indicate whether the benefits refer to in-network " "providers or out-of-network providers." ), json_schema_extra={ "element_property": True, }, ) term: fhirtypes.CodeableConceptType | None = Field( default=None, alias="term", title="Annual or lifetime", description=( "The term or period of the values such as 'maximum lifetime benefit' or" " 'maximum annual visits'." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Cost category", description="The category of patient centric costs associated with treatment.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) unit: fhirtypes.CodeableConceptType | None = Field( default=None, alias="unit", title="Individual or family", description="Indicates if the benefits apply to an individual or to the family.", json_schema_extra={ "element_property": True, }, ) valueMoney: fhirtypes.MoneyType | None = Field( default=None, alias="valueMoney", title="The amount or percentage due from the beneficiary", description="The amount due from the patient for the cost category.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="The amount or percentage due from the beneficiary", description="The amount due from the patient for the cost category.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageCostToBeneficiary`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "category", "network", "unit", "term", "valueQuantity", "valueMoney", "exception", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageCostToBeneficiary`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "valueQuantity", "valueMoney"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"value": ["valueMoney", "valueQuantity"]} return one_of_many_fields class CoverageCostToBeneficiaryException(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Exceptions for patient payments. A suite of codes indicating exceptions or reductions to patient costs and their effective periods. """ __resource_type__ = "CoverageCostToBeneficiaryException" period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="The effective period of the exception", description="The timeframe the exception is in force.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Exception category", description="The code for the specific exception.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageCostToBeneficiaryException`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageCostToBeneficiaryException`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "period"] class CoveragePaymentBy(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Self-pay parties and responsibility. Link to the paying party and optionally what specifically they will be responsible to pay. """ __resource_type__ = "CoveragePaymentBy" party: fhirtypes.ReferenceType = Field( default=..., alias="party", title="Parties performing self-payment", description=( "The list of parties providing non-insurance payment for the treatment " "costs." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "RelatedPerson", "Organization"], }, ) responsibility: fhirtypes.StringType | None = Field( default=None, alias="responsibility", title="Party's responsibility", description=" Description of the financial responsibility.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) responsibility__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_responsibility", title="Extension field for ``responsibility``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoveragePaymentBy`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "party", "responsibility"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoveragePaymentBy`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "party", "responsibility"] ================================================ FILE: fhir/resources/coverageeligibilityrequest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CoverageEligibilityRequest Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class CoverageEligibilityRequest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. CoverageEligibilityRequest resource. The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy. """ __resource_type__ = "CoverageEligibilityRequest" created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Creation date", description="The date when this resource was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) enterer: fhirtypes.ReferenceType | None = Field( default=None, alias="enterer", title="Author", description="Person who created the request.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) event: typing.List[fhirtypes.CoverageEligibilityRequestEventType] | None = Field( default=None, alias="event", title="Event information", description="Information code for an event with a corresponding date or period.", json_schema_extra={ "element_property": True, }, ) facility: fhirtypes.ReferenceType | None = Field( default=None, alias="facility", title="Servicing facility", description="Facility where the services are intended to be provided.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for coverage eligiblity request", description="A unique identifier assigned to this coverage eligiblity request.", json_schema_extra={ "element_property": True, }, ) insurance: typing.List[ fhirtypes.CoverageEligibilityRequestInsuranceType ] | None = Field( default=None, alias="insurance", title="Patient insurance information", description=( "Financial instruments for reimbursement for the health care products " "and services." ), json_schema_extra={ "element_property": True, }, ) insurer: fhirtypes.ReferenceType = Field( default=..., alias="insurer", title="Coverage issuer", description=( "The Insurer who issued the coverage in question and is the recipient " "of the request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) item: typing.List[fhirtypes.CoverageEligibilityRequestItemType] | None = Field( default=None, alias="item", title="Item to be evaluated for eligibiity", description=( "Service categories or billable services for which benefit details " "and/or an authorization prior to service delivery may be required by " "the payor." ), json_schema_extra={ "element_property": True, }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Intended recipient of products and services", description=( "The party who is the beneficiary of the supplied coverage and for whom" " eligibility is sought." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) priority: fhirtypes.CodeableConceptType | None = Field( default=None, alias="priority", title="Desired processing priority", description="When the requestor expects the processor to complete processing.", json_schema_extra={ "element_property": True, }, ) provider: fhirtypes.ReferenceType | None = Field( default=None, alias="provider", title="Party responsible for the request", description="The provider which is responsible for the request.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) purpose: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="purpose", title="auth-requirements | benefits | discovery | validation", description=( "Code to specify whether requesting: prior authorization requirements " "for some service categories or billing codes; benefits for coverages " "specified or discovered; discovery and return of coverages for the " "patient; and/or validation that the specified coverage is in-force at " "the date/period specified or 'now' if not specified." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["auth-requirements", "benefits", "discovery", "validation"], }, ) purpose__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) servicedDate: fhirtypes.DateType | None = Field( default=None, alias="servicedDate", title="Estimated date or dates of service", description=( "The date or dates when the enclosed suite of services were performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_servicedDate", title="Extension field for ``servicedDate``.", ) servicedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="servicedPeriod", title="Estimated date or dates of service", description=( "The date or dates when the enclosed suite of services were performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) supportingInfo: typing.List[ fhirtypes.CoverageEligibilityRequestSupportingInfoType ] | None = Field( default=None, alias="supportingInfo", title="Supporting information", description=( "Additional information codes regarding exceptions, special " "considerations, the condition, situation, prior or concurrent issues." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageEligibilityRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "priority", "purpose", "patient", "event", "servicedDate", "servicedPeriod", "created", "enterer", "provider", "insurer", "facility", "supportingInfo", "insurance", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageEligibilityRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "status", "purpose", "patient", "created", "insurer", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("created", "created__ext"), ("purpose", "purpose__ext"), ("status", "status__ext"), ] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"serviced": ["servicedDate", "servicedPeriod"]} return one_of_many_fields class CoverageEligibilityRequestEvent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Event information. Information code for an event with a corresponding date or period. """ __resource_type__ = "CoverageEligibilityRequestEvent" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Specific event", description="A coded event such as when a service is expected or a card printed.", json_schema_extra={ "element_property": True, }, ) whenDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="whenDateTime", title="Occurance date or period", description=( "A date or period in the past or future indicating when the event " "occurred or is expectd to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e when[x] "one_of_many": "when", "one_of_many_required": True, }, ) whenDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_whenDateTime", title="Extension field for ``whenDateTime``.", ) whenPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="whenPeriod", title="Occurance date or period", description=( "A date or period in the past or future indicating when the event " "occurred or is expectd to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e when[x] "one_of_many": "when", "one_of_many_required": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageEligibilityRequestEvent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "whenDateTime", "whenPeriod", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageEligibilityRequestEvent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"when": ["whenDateTime", "whenPeriod"]} return one_of_many_fields class CoverageEligibilityRequestInsurance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Patient insurance information. Financial instruments for reimbursement for the health care products and services. """ __resource_type__ = "CoverageEligibilityRequestInsurance" businessArrangement: fhirtypes.StringType | None = Field( default=None, alias="businessArrangement", title="Additional provider contract number", description=( "A business agreement number established between the provider and the " "insurer for special business processing purposes." ), json_schema_extra={ "element_property": True, }, ) businessArrangement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_businessArrangement", title="Extension field for ``businessArrangement``.", ) coverage: fhirtypes.ReferenceType = Field( default=..., alias="coverage", title="Insurance information", description=( "Reference to the insurance card level information contained in the " "Coverage resource. The coverage issuing insurer will use these details" " to locate the patient's actual coverage within the insurer's " "information system." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage"], }, ) focal: bool | None = Field( default=None, alias="focal", title="Applicable coverage", description=( "A flag to indicate that this Coverage is to be used for evaluation of " "this request when set to true." ), json_schema_extra={ "element_property": True, }, ) focal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_focal", title="Extension field for ``focal``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageEligibilityRequestInsurance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "focal", "coverage", "businessArrangement", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageEligibilityRequestInsurance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CoverageEligibilityRequestItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Item to be evaluated for eligibiity. Service categories or billable services for which benefit details and/or an authorization prior to service delivery may be required by the payor. """ __resource_type__ = "CoverageEligibilityRequestItem" category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Benefit classification", description=( "Code to identify the general type of benefits under which products and" " services are provided." ), json_schema_extra={ "element_property": True, }, ) detail: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="detail", title="Product or service details", description="The plan/proposal/order describing the proposed service in detail.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) diagnosis: typing.List[ fhirtypes.CoverageEligibilityRequestItemDiagnosisType ] | None = Field( default=None, alias="diagnosis", title="Applicable diagnosis", description="Patient diagnosis for which care is sought.", json_schema_extra={ "element_property": True, }, ) facility: fhirtypes.ReferenceType | None = Field( default=None, alias="facility", title="Servicing facility", description="Facility where the services will be provided.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location", "Organization"], }, ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Product or service billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) productOrService: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrService", title="Billing, service, product, or drug code", description=( "This contains the product, service, drug or other billing code for the" " item." ), json_schema_extra={ "element_property": True, }, ) provider: fhirtypes.ReferenceType | None = Field( default=None, alias="provider", title="Perfoming practitioner", description=( "The practitioner who is responsible for the product or service to be " "rendered to the patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) supportingInfoSequence: typing.List[ fhirtypes.PositiveIntType | None ] | None = Field( default=None, alias="supportingInfoSequence", title="Applicable exception or supporting information", description=( "Exceptions, special conditions and supporting information applicable " "for this service or product line." ), json_schema_extra={ "element_property": True, }, ) supportingInfoSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_supportingInfoSequence", title="Extension field for ``supportingInfoSequence``.", ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description="The amount charged to the patient by the provider for a single unit.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageEligibilityRequestItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "supportingInfoSequence", "category", "productOrService", "modifier", "provider", "quantity", "unitPrice", "facility", "diagnosis", "detail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageEligibilityRequestItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CoverageEligibilityRequestItemDiagnosis(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Applicable diagnosis. Patient diagnosis for which care is sought. """ __resource_type__ = "CoverageEligibilityRequestItemDiagnosis" diagnosisCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="diagnosisCodeableConcept", title="Nature of illness or problem", description=( "The nature of illness or problem in a coded form or as a reference to " "an external defined Condition." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e diagnosis[x] "one_of_many": "diagnosis", "one_of_many_required": False, }, ) diagnosisReference: fhirtypes.ReferenceType | None = Field( default=None, alias="diagnosisReference", title="Nature of illness or problem", description=( "The nature of illness or problem in a coded form or as a reference to " "an external defined Condition." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e diagnosis[x] "one_of_many": "diagnosis", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageEligibilityRequestItemDiagnosis`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "diagnosisCodeableConcept", "diagnosisReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageEligibilityRequestItemDiagnosis`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "diagnosis": ["diagnosisCodeableConcept", "diagnosisReference"] } return one_of_many_fields class CoverageEligibilityRequestSupportingInfo(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Supporting information. Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues. """ __resource_type__ = "CoverageEligibilityRequestSupportingInfo" appliesToAll: bool | None = Field( default=None, alias="appliesToAll", title="Applies to all items", description=( "The supporting materials are applicable for all detail items, " "product/servce categories and specific billing codes." ), json_schema_extra={ "element_property": True, }, ) appliesToAll__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_appliesToAll", title="Extension field for ``appliesToAll``.", ) information: fhirtypes.ReferenceType = Field( default=..., alias="information", title="Data to be provided", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Information instance identifier", description="A number to uniquely identify supporting information entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageEligibilityRequestSupportingInfo`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "information", "appliesToAll", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageEligibilityRequestSupportingInfo`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields ================================================ FILE: fhir/resources/coverageeligibilityresponse.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/CoverageEligibilityResponse Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class CoverageEligibilityResponse(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. CoverageEligibilityResponse resource. This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource. """ __resource_type__ = "CoverageEligibilityResponse" created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Response creation date", description="The date this resource was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) disposition: fhirtypes.StringType | None = Field( default=None, alias="disposition", title="Disposition Message", description="A human readable description of the status of the adjudication.", json_schema_extra={ "element_property": True, }, ) disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_disposition", title="Extension field for ``disposition``." ) error: typing.List[fhirtypes.CoverageEligibilityResponseErrorType] | None = Field( default=None, alias="error", title="Processing errors", description="Errors encountered during the processing of the request.", json_schema_extra={ "element_property": True, }, ) event: typing.List[fhirtypes.CoverageEligibilityResponseEventType] | None = Field( default=None, alias="event", title="Event information", description="Information code for an event with a corresponding date or period.", json_schema_extra={ "element_property": True, }, ) form: fhirtypes.CodeableConceptType | None = Field( default=None, alias="form", title="Printed form identifier", description="A code for the form to be used for printing the content.", json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for coverage eligiblity request", description="A unique identifier assigned to this coverage eligiblity request.", json_schema_extra={ "element_property": True, }, ) insurance: typing.List[ fhirtypes.CoverageEligibilityResponseInsuranceType ] | None = Field( default=None, alias="insurance", title="Patient insurance information", description=( "Financial instruments for reimbursement for the health care products " "and services." ), json_schema_extra={ "element_property": True, }, ) insurer: fhirtypes.ReferenceType = Field( default=..., alias="insurer", title="Coverage issuer", description=( "The Insurer who issued the coverage in question and is the author of " "the response." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) outcome: fhirtypes.CodeType | None = Field( default=None, alias="outcome", title="queued | complete | error | partial", description="The outcome of the request processing.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["queued", "complete", "error", "partial"], }, ) outcome__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_outcome", title="Extension field for ``outcome``." ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Intended recipient of products and services", description=( "The party who is the beneficiary of the supplied coverage and for whom" " eligibility is sought." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) preAuthRef: fhirtypes.StringType | None = Field( default=None, alias="preAuthRef", title="Preauthorization reference", description=( "A reference from the Insurer to which these services pertain to be " "used on further communication and as proof that the request occurred." ), json_schema_extra={ "element_property": True, }, ) preAuthRef__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preAuthRef", title="Extension field for ``preAuthRef``." ) purpose: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="purpose", title="auth-requirements | benefits | discovery | validation", description=( "Code to specify whether requesting: prior authorization requirements " "for some service categories or billing codes; benefits for coverages " "specified or discovered; discovery and return of coverages for the " "patient; and/or validation that the specified coverage is in-force at " "the date/period specified or 'now' if not specified." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["auth-requirements", "benefits", "discovery", "validation"], }, ) purpose__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) request: fhirtypes.ReferenceType = Field( default=..., alias="request", title="Eligibility request reference", description="Reference to the original request resource.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CoverageEligibilityRequest"], }, ) requestor: fhirtypes.ReferenceType | None = Field( default=None, alias="requestor", title="Party responsible for the request", description="The provider which is responsible for the request.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) servicedDate: fhirtypes.DateType | None = Field( default=None, alias="servicedDate", title="Estimated date or dates of service", description=( "The date or dates when the enclosed suite of services were performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_servicedDate", title="Extension field for ``servicedDate``.", ) servicedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="servicedPeriod", title="Estimated date or dates of service", description=( "The date or dates when the enclosed suite of services were performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageEligibilityResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "purpose", "patient", "event", "servicedDate", "servicedPeriod", "created", "requestor", "request", "outcome", "disposition", "insurer", "insurance", "preAuthRef", "form", "error", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageEligibilityResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "status", "purpose", "patient", "created", "request", "outcome", "insurer", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("created", "created__ext"), ("outcome", "outcome__ext"), ("purpose", "purpose__ext"), ("status", "status__ext"), ] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"serviced": ["servicedDate", "servicedPeriod"]} return one_of_many_fields class CoverageEligibilityResponseError(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Processing errors. Errors encountered during the processing of the request. """ __resource_type__ = "CoverageEligibilityResponseError" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Error code detailing processing issues", description=( "An error code,from a specified code system, which details why the " "eligibility check could not be performed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) expression: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="expression", title="FHIRPath of element(s) related to issue", description=( "A [simple subset of FHIRPath](fhirpath.html#simple) limited to element" " names, repetition indicators and the default child accessor that " "identifies one of the elements in the resource that caused this issue " "to be raised." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) expression__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageEligibilityResponseError`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "expression"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageEligibilityResponseError`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "expression"] class CoverageEligibilityResponseEvent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Event information. Information code for an event with a corresponding date or period. """ __resource_type__ = "CoverageEligibilityResponseEvent" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Specific event", description="A coded event such as when a service is expected or a card printed.", json_schema_extra={ "element_property": True, }, ) whenDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="whenDateTime", title="Occurance date or period", description=( "A date or period in the past or future indicating when the event " "occurred or is expectd to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e when[x] "one_of_many": "when", "one_of_many_required": True, }, ) whenDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_whenDateTime", title="Extension field for ``whenDateTime``.", ) whenPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="whenPeriod", title="Occurance date or period", description=( "A date or period in the past or future indicating when the event " "occurred or is expectd to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e when[x] "one_of_many": "when", "one_of_many_required": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageEligibilityResponseEvent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "whenDateTime", "whenPeriod", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageEligibilityResponseEvent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"when": ["whenDateTime", "whenPeriod"]} return one_of_many_fields class CoverageEligibilityResponseInsurance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Patient insurance information. Financial instruments for reimbursement for the health care products and services. """ __resource_type__ = "CoverageEligibilityResponseInsurance" benefitPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="benefitPeriod", title="When the benefits are applicable", description="The term of the benefits documented in this response.", json_schema_extra={ "element_property": True, }, ) coverage: fhirtypes.ReferenceType = Field( default=..., alias="coverage", title="Insurance information", description=( "Reference to the insurance card level information contained in the " "Coverage resource. The coverage issuing insurer will use these details" " to locate the patient's actual coverage within the insurer's " "information system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage"], }, ) inforce: bool | None = Field( default=None, alias="inforce", title="Coverage inforce indicator", description=( "Flag indicating if the coverage provided is inforce currently if no " "service date(s) specified or for the whole duration of the service " "dates." ), json_schema_extra={ "element_property": True, }, ) inforce__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_inforce", title="Extension field for ``inforce``." ) item: typing.List[ fhirtypes.CoverageEligibilityResponseInsuranceItemType ] | None = Field( default=None, alias="item", title="Benefits and authorization details", description=( "Benefits and optionally current balances, and authorization details by" " category or service." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageEligibilityResponseInsurance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "coverage", "inforce", "benefitPeriod", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageEligibilityResponseInsurance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "coverage"] class CoverageEligibilityResponseInsuranceItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Benefits and authorization details. Benefits and optionally current balances, and authorization details by category or service. """ __resource_type__ = "CoverageEligibilityResponseInsuranceItem" authorizationRequired: bool | None = Field( default=None, alias="authorizationRequired", title="Authorization required flag", description=( "A boolean flag indicating whether a preauthorization is required prior" " to actual service delivery." ), json_schema_extra={ "element_property": True, }, ) authorizationRequired__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authorizationRequired", title="Extension field for ``authorizationRequired``.", ) authorizationSupporting: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="authorizationSupporting", title="Type of required supporting materials", description=( "Codes or comments regarding information or actions associated with the" " preauthorization." ), json_schema_extra={ "element_property": True, }, ) authorizationUrl: fhirtypes.UriType | None = Field( default=None, alias="authorizationUrl", title="Preauthorization requirements endpoint", description=( "A web location for obtaining requirements or descriptive information " "regarding the preauthorization." ), json_schema_extra={ "element_property": True, }, ) authorizationUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authorizationUrl", title="Extension field for ``authorizationUrl``.", ) benefit: typing.List[ fhirtypes.CoverageEligibilityResponseInsuranceItemBenefitType ] | None = Field( default=None, alias="benefit", title="Benefit Summary", description="Benefits used to date.", json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Benefit classification", description=( "Code to identify the general type of benefits under which products and" " services are provided." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Description of the benefit or services covered", description="A richer description of the benefit or services covered.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) excluded: bool | None = Field( default=None, alias="excluded", title="Excluded from the plan", description=( "True if the indicated class of service is excluded from the plan, " "missing or False indicates the product or service is included in the " "coverage." ), json_schema_extra={ "element_property": True, }, ) excluded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_excluded", title="Extension field for ``excluded``." ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Product or service billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Short name for the benefit", description="A short name or tag for the benefit.", json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) network: fhirtypes.CodeableConceptType | None = Field( default=None, alias="network", title="In or out of network", description=( "Is a flag to indicate whether the benefits refer to in-network " "providers or out-of-network providers." ), json_schema_extra={ "element_property": True, }, ) productOrService: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrService", title="Billing, service, product, or drug code", description=( "This contains the product, service, drug or other billing code for the" " item." ), json_schema_extra={ "element_property": True, }, ) provider: fhirtypes.ReferenceType | None = Field( default=None, alias="provider", title="Performing practitioner", description=( "The practitioner who is eligible for the provision of the product or " "service." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) term: fhirtypes.CodeableConceptType | None = Field( default=None, alias="term", title="Annual or lifetime", description=( "The term or period of the values such as 'maximum lifetime benefit' or" " 'maximum annual visits'." ), json_schema_extra={ "element_property": True, }, ) unit: fhirtypes.CodeableConceptType | None = Field( default=None, alias="unit", title="Individual or family", description="Indicates if the benefits apply to an individual or to the family.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageEligibilityResponseInsuranceItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "category", "productOrService", "modifier", "provider", "excluded", "name", "description", "network", "unit", "term", "benefit", "authorizationRequired", "authorizationSupporting", "authorizationUrl", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageEligibilityResponseInsuranceItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class CoverageEligibilityResponseInsuranceItemBenefit(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Benefit Summary. Benefits used to date. """ __resource_type__ = "CoverageEligibilityResponseInsuranceItemBenefit" allowedMoney: fhirtypes.MoneyType | None = Field( default=None, alias="allowedMoney", title="Benefits allowed", description="The quantity of the benefit which is permitted under the coverage.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e allowed[x] "one_of_many": "allowed", "one_of_many_required": False, }, ) allowedString: fhirtypes.StringType | None = Field( default=None, alias="allowedString", title="Benefits allowed", description="The quantity of the benefit which is permitted under the coverage.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e allowed[x] "one_of_many": "allowed", "one_of_many_required": False, }, ) allowedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allowedString", title="Extension field for ``allowedString``.", ) allowedUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="allowedUnsignedInt", title="Benefits allowed", description="The quantity of the benefit which is permitted under the coverage.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e allowed[x] "one_of_many": "allowed", "one_of_many_required": False, }, ) allowedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allowedUnsignedInt", title="Extension field for ``allowedUnsignedInt``.", ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Benefit classification", description="Classification of benefit being provided.", json_schema_extra={ "element_property": True, }, ) usedMoney: fhirtypes.MoneyType | None = Field( default=None, alias="usedMoney", title="Benefits used", description="The quantity of the benefit which have been consumed to date.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e used[x] "one_of_many": "used", "one_of_many_required": False, }, ) usedString: fhirtypes.StringType | None = Field( default=None, alias="usedString", title="Benefits used", description="The quantity of the benefit which have been consumed to date.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e used[x] "one_of_many": "used", "one_of_many_required": False, }, ) usedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usedString", title="Extension field for ``usedString``." ) usedUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="usedUnsignedInt", title="Benefits used", description="The quantity of the benefit which have been consumed to date.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e used[x] "one_of_many": "used", "one_of_many_required": False, }, ) usedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usedUnsignedInt", title="Extension field for ``usedUnsignedInt``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``CoverageEligibilityResponseInsuranceItemBenefit`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "allowedUnsignedInt", "allowedString", "allowedMoney", "usedUnsignedInt", "usedString", "usedMoney", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``CoverageEligibilityResponseInsuranceItemBenefit`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "allowed": ["allowedMoney", "allowedString", "allowedUnsignedInt"], "used": ["usedMoney", "usedString", "usedUnsignedInt"], } return one_of_many_fields ================================================ FILE: fhir/resources/datarequirement.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DataRequirement Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, element, fhirtypes class DataRequirement(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Describes a required data item. Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data. """ __resource_type__ = "DataRequirement" codeFilter: typing.List[fhirtypes.DataRequirementCodeFilterType] | None = Field( default=None, alias="codeFilter", title="What codes are expected", description=( "Code filters specify additional constraints on the data, specifying " "the value set of interest for a particular element of the data. Each " "code filter defines an additional constraint on the data, i.e. code " "filters are AND'ed, not OR'ed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dateFilter: typing.List[fhirtypes.DataRequirementDateFilterType] | None = Field( default=None, alias="dateFilter", title="What dates/date ranges are expected", description=( "Date filters specify additional constraints on the data in terms of " "the applicable date range for specific elements. Each date filter " "specifies an additional constraint on the data, i.e. date filters are " "AND'ed, not OR'ed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) limit: fhirtypes.PositiveIntType | None = Field( default=None, alias="limit", title="Number of results", description=( "Specifies a maximum number of results that are required (uses the " "_count search parameter)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) limit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_limit", title="Extension field for ``limit``." ) mustSupport: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="mustSupport", title=( "Indicates specific structure elements that are referenced by the " "knowledge module" ), description=( "Indicates that specific elements of the type are referenced by the " "knowledge module and must be supported by the consumer in order to " "obtain an effective evaluation. This does not mean that a value is " "required for this element, only that the consuming system must " "understand the element and be able to provide values for it if they " "are available. The value of mustSupport SHALL be a FHIRPath " "resolvable on the type of the DataRequirement. The path SHALL consist " "only of identifiers, constant indexers, and .resolve() (see the " "[Simple FHIRPath Profile](fhirpath.html#simple) for full details)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) mustSupport__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_mustSupport", title="Extension field for ``mustSupport``." ) profile: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="profile", title="The profile of the required data", description=( "The profile of the required data, specified as the uri of the profile " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) profile__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) sort: typing.List[fhirtypes.DataRequirementSortType] | None = Field( default=None, alias="sort", title="Order of the results", description="Specifies the order of the results to be returned.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subjectCodeableConcept", title=( "E.g. Patient, Practitioner, RelatedPerson, Organization, Location, " "Device" ), description=( "The intended subjects of the data requirement. If this element is not " "provided, a Patient subject is assumed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, }, ) subjectReference: fhirtypes.ReferenceType | None = Field( default=None, alias="subjectReference", title=( "E.g. Patient, Practitioner, RelatedPerson, Organization, Location, " "Device" ), description=( "The intended subjects of the data requirement. If this element is not " "provided, a Patient subject is assumed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="The type of the required data", description=( "The type of the required data, specified as the type name of a " "resource. For profiles, this value is set to the type of the base " "resource of the profile." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) valueFilter: typing.List[fhirtypes.DataRequirementValueFilterType] | None = Field( default=None, alias="valueFilter", title="What values are expected", description=( "Value filters specify additional constraints on the data for elements " "other than code-valued or date-valued. Each value filter specifies an " "additional constraint on the data (i.e. valueFilters are AND'ed, not " "OR'ed)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DataRequirement`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "type", "profile", "subjectCodeableConcept", "subjectReference", "mustSupport", "codeFilter", "dateFilter", "valueFilter", "limit", "sort", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DataRequirement`` according to specification, with preserving the original sequence order. """ return [ "type", "profile", "subjectCodeableConcept", "subjectReference", "mustSupport", "codeFilter", "dateFilter", "valueFilter", "limit", "sort", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"subject": ["subjectCodeableConcept", "subjectReference"]} return one_of_many_fields class DataRequirementCodeFilter(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What codes are expected. Code filters specify additional constraints on the data, specifying the value set of interest for a particular element of the data. Each code filter defines an additional constraint on the data, i.e. code filters are AND'ed, not OR'ed. """ __resource_type__ = "DataRequirementCodeFilter" code: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="code", title="What code is expected", description=( "The codes for the code filter. If values are given, the filter will " "return only those data items for which the code-valued attribute " "specified by the path has a value that is one of the specified codes. " "If codes are specified in addition to a value set, the filter returns " "items matching a code in the value set or one of the specified codes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="A code-valued attribute to filter on", description=( "The code-valued attribute of the filter. The specified path SHALL be a" " FHIRPath resolvable on the specified type of the DataRequirement, and" " SHALL consist only of identifiers, constant indexers, and .resolve()." " The path is allowed to contain qualifiers (.) to traverse sub-" "elements, as well as indexers ([x]) to traverse multiple-cardinality " "sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) " "for full details). Note that the index must be an integer constant. " "The path must resolve to an element of type code, Coding, or " "CodeableConcept." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) searchParam: fhirtypes.StringType | None = Field( default=None, alias="searchParam", title="A coded (token) parameter to search on", description=( "A token parameter that refers to a search parameter defined on the " "specified type of the DataRequirement, and which searches on elements " "of type code, Coding, or CodeableConcept." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) searchParam__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_searchParam", title="Extension field for ``searchParam``." ) valueSet: fhirtypes.CanonicalType | None = Field( default=None, alias="valueSet", title="ValueSet for the filter", description=( "The valueset for the code filter. The valueSet and code elements are " "additive. If valueSet is specified, the filter will return only those " "data items for which the value of the code-valued element specified in" " the path is a member of the specified valueset." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueSet", title="Extension field for ``valueSet``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DataRequirementCodeFilter`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "path", "searchParam", "valueSet", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DataRequirementCodeFilter`` according to specification, with preserving the original sequence order. """ return ["path", "searchParam", "valueSet", "code"] class DataRequirementDateFilter(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What dates/date ranges are expected. Date filters specify additional constraints on the data in terms of the applicable date range for specific elements. Each date filter specifies an additional constraint on the data, i.e. date filters are AND'ed, not OR'ed. """ __resource_type__ = "DataRequirementDateFilter" path: fhirtypes.StringType | None = Field( default=None, alias="path", title="A date-valued attribute to filter on", description=( "The date-valued attribute of the filter. The specified path SHALL be a" " FHIRPath resolvable on the specified type of the DataRequirement, and" " SHALL consist only of identifiers, constant indexers, and .resolve()." " The path is allowed to contain qualifiers (.) to traverse sub-" "elements, as well as indexers ([x]) to traverse multiple-cardinality " "sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) " "for full details). Note that the index must be an integer constant. " "The path must resolve to an element of type date, dateTime, Period, " "Schedule, or Timing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) searchParam: fhirtypes.StringType | None = Field( default=None, alias="searchParam", title="A date valued parameter to search on", description=( "A date parameter that refers to a search parameter defined on the " "specified type of the DataRequirement, and which searches on elements " "of type date, dateTime, Period, Schedule, or Timing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) searchParam__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_searchParam", title="Extension field for ``searchParam``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="The value of the filter, as a Period, DateTime, or Duration value", description=( "The value of the filter. If period is specified, the filter will " "return only those data items that fall within the bounds determined by" " the Period, inclusive of the period boundaries. If dateTime is " "specified, the filter will return only those data items that are equal" " to the specified dateTime. If a Duration is specified, the filter " "will return only those data items that fall within Duration before " "now." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDuration: fhirtypes.DurationType | None = Field( default=None, alias="valueDuration", title="The value of the filter, as a Period, DateTime, or Duration value", description=( "The value of the filter. If period is specified, the filter will " "return only those data items that fall within the bounds determined by" " the Period, inclusive of the period boundaries. If dateTime is " "specified, the filter will return only those data items that are equal" " to the specified dateTime. If a Duration is specified, the filter " "will return only those data items that fall within Duration before " "now." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="The value of the filter, as a Period, DateTime, or Duration value", description=( "The value of the filter. If period is specified, the filter will " "return only those data items that fall within the bounds determined by" " the Period, inclusive of the period boundaries. If dateTime is " "specified, the filter will return only those data items that are equal" " to the specified dateTime. If a Duration is specified, the filter " "will return only those data items that fall within Duration before " "now." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DataRequirementDateFilter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "path", "searchParam", "valueDateTime", "valuePeriod", "valueDuration", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DataRequirementDateFilter`` according to specification, with preserving the original sequence order. """ return ["path", "searchParam", "valueDateTime", "valuePeriod", "valueDuration"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": ["valueDateTime", "valueDuration", "valuePeriod"] } return one_of_many_fields class DataRequirementSort(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Order of the results. Specifies the order of the results to be returned. """ __resource_type__ = "DataRequirementSort" direction: fhirtypes.CodeType | None = Field( default=None, alias="direction", title="ascending | descending", description="The direction of the sort, ascending or descending.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["ascending", "descending"], }, ) direction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_direction", title="Extension field for ``direction``." ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="The name of the attribute to perform the sort", description=( "The attribute of the sort. The specified path must be resolvable from " "the type of the required data. The path is allowed to contain " "qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to " "traverse multiple-cardinality sub-elements. Note that the index must " "be an integer constant." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DataRequirementSort`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "path", "direction"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DataRequirementSort`` according to specification, with preserving the original sequence order. """ return ["path", "direction"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("direction", "direction__ext"), ("path", "path__ext")] return required_fields class DataRequirementValueFilter(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What values are expected. Value filters specify additional constraints on the data for elements other than code-valued or date-valued. Each value filter specifies an additional constraint on the data (i.e. valueFilters are AND'ed, not OR'ed). """ __resource_type__ = "DataRequirementValueFilter" comparator: fhirtypes.CodeType | None = Field( default=None, alias="comparator", title="eq | gt | lt | ge | le | sa | eb", description="The comparator to be used to determine whether the value is matching.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["eq", "gt", "lt", "ge", "le", "sa", "eb"], }, ) comparator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comparator", title="Extension field for ``comparator``." ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="An attribute to filter on", description=( "The attribute of the filter. The specified path SHALL be a FHIRPath " "resolvable on the specified type of the DataRequirement, and SHALL " "consist only of identifiers, constant indexers, and .resolve(). The " "path is allowed to contain qualifiers (.) to traverse sub-elements, as" " well as indexers ([x]) to traverse multiple-cardinality sub-elements " "(see the [Simple FHIRPath Profile](fhirpath.html#simple) for full " "details). Note that the index must be an integer constant. The path " "must resolve to an element of a type that is comparable to the " "valueFilter.value[x] element for the filter." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) searchParam: fhirtypes.StringType | None = Field( default=None, alias="searchParam", title="A parameter to search on", description=( "A search parameter defined on the specified type of the " "DataRequirement, and which searches on elements of a type compatible " "with the type of the valueFilter.value[x] for the filter." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) searchParam__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_searchParam", title="Extension field for ``searchParam``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="The value of the filter, as a Period, DateTime, or Duration value", description="The value of the filter.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDuration: fhirtypes.DurationType | None = Field( default=None, alias="valueDuration", title="The value of the filter, as a Period, DateTime, or Duration value", description="The value of the filter.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="The value of the filter, as a Period, DateTime, or Duration value", description="The value of the filter.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DataRequirementValueFilter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "path", "searchParam", "comparator", "valueDateTime", "valuePeriod", "valueDuration", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DataRequirementValueFilter`` according to specification, with preserving the original sequence order. """ return [ "path", "searchParam", "comparator", "valueDateTime", "valuePeriod", "valueDuration", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": ["valueDateTime", "valueDuration", "valuePeriod"] } return one_of_many_fields ================================================ FILE: fhir/resources/datatype.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DataType Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from . import element class DataType(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Reuseable Types. The base class for all re-useable types defined as part of the FHIR Specification. """ __resource_type__ = "DataType" @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DataType`` according to specification, with preserving the original sequence order. """ return ["id", "extension"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DataType`` according to specification, with preserving the original sequence order. """ return [] ================================================ FILE: fhir/resources/detectedissue.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DetectedIssue Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class DetectedIssue(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Clinical issue with action. Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, gaps in care, etc. """ __resource_type__ = "DetectedIssue" author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="The provider or device that identified the issue", description=( "Individual or device responsible for the issue being raised. For " "example, a decision support application or a pharmacist conducting a " "medication review." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "RelatedPerson", "Practitioner", "PractitionerRole", "Device", ], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Type of detected issue, e.g. drug-drug, duplicate therapy, etc", description="A code that classifies the general type of detected issue.", json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title=( "Specific type of detected issue, e.g. drug-drug, duplicate therapy, " "etc" ), description="Identifies the specific type of issue identified.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) detail: fhirtypes.MarkdownType | None = Field( default=None, alias="detail", title="Description and context", description="A textual explanation of the detected issue.", json_schema_extra={ "element_property": True, }, ) detail__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detail", title="Extension field for ``detail``." ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter detected issue is part of", description="The encounter during which this issue was detected.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) evidence: typing.List[fhirtypes.DetectedIssueEvidenceType] | None = Field( default=None, alias="evidence", title="Supporting evidence", description=( "Supporting evidence or manifestations that provide the basis for " "identifying the detected issue such as a GuidanceResponse or " "MeasureReport." ), json_schema_extra={ "element_property": True, }, ) identifiedDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="identifiedDateTime", title="When identified", description="The date or period when the detected issue was initially identified.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e identified[x] "one_of_many": "identified", "one_of_many_required": False, }, ) identifiedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_identifiedDateTime", title="Extension field for ``identifiedDateTime``.", ) identifiedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="identifiedPeriod", title="When identified", description="The date or period when the detected issue was initially identified.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e identified[x] "one_of_many": "identified", "one_of_many_required": False, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique id for the detected issue", description="Business identifier associated with the detected issue record.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) implicated: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="implicated", title="Problem resource", description=( "Indicates the resource representing the current activity or proposed " "activity that is potentially problematic." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) mitigation: typing.List[fhirtypes.DetectedIssueMitigationType] | None = Field( default=None, alias="mitigation", title="Step taken to address", description=( "Indicates an action that has been taken or is committed to reduce or " "eliminate the likelihood of the risk identified by the detected issue " "from manifesting. Can also reflect an observation of known mitigating" " factors that may reduce/eliminate the need for any action." ), json_schema_extra={ "element_property": True, }, ) reference: fhirtypes.UriType | None = Field( default=None, alias="reference", title="Authority for issue", description=( "The literature, knowledge-base or similar reference that describes the" " propensity for the detected issue identified." ), json_schema_extra={ "element_property": True, }, ) reference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reference", title="Extension field for ``reference``." ) severity: fhirtypes.CodeType | None = Field( default=None, alias="severity", title="high | moderate | low", description=( "Indicates the degree of importance associated with the identified " "issue based on the potential impact on the patient." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["high", "moderate", "low"], }, ) severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_severity", title="Extension field for ``severity``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="preliminary | final | entered-in-error | mitigated", description="Indicates the status of the detected issue.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["preliminary", "final", "entered-in-error", "mitigated"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Associated subject", description=( "Indicates the subject whose record the detected issue is associated " "with." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Group", "Device", "Location", "Organization", "Procedure", "Practitioner", "Medication", "Substance", "BiologicallyDerivedProduct", "NutritionProduct", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DetectedIssue`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "category", "code", "severity", "subject", "encounter", "identifiedDateTime", "identifiedPeriod", "author", "implicated", "evidence", "detail", "reference", "mitigation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DetectedIssue`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "code", "severity", "subject", "encounter", "identifiedDateTime", "identifiedPeriod", "author", "implicated", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"identified": ["identifiedDateTime", "identifiedPeriod"]} return one_of_many_fields class DetectedIssueEvidence(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Supporting evidence. Supporting evidence or manifestations that provide the basis for identifying the detected issue such as a GuidanceResponse or MeasureReport. """ __resource_type__ = "DetectedIssueEvidence" code: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="code", title="Manifestation", description="A manifestation that led to the recording of this detected issue.", json_schema_extra={ "element_property": True, }, ) detail: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="detail", title="Supporting information", description=( "Links to resources that constitute evidence for the detected issue " "such as a GuidanceResponse or MeasureReport." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DetectedIssueEvidence`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "detail"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DetectedIssueEvidence`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class DetectedIssueMitigation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Step taken to address. Indicates an action that has been taken or is committed to reduce or eliminate the likelihood of the risk identified by the detected issue from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action. """ __resource_type__ = "DetectedIssueMitigation" action: fhirtypes.CodeableConceptType = Field( default=..., alias="action", title="What mitigation?", description=( "Describes the action that was taken or the observation that was made " "that reduces/eliminates the risk associated with the identified issue." ), json_schema_extra={ "element_property": True, }, ) author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="Who is committing?", description=( "Identifies the practitioner who determined the mitigation and takes " "responsibility for the mitigation step occurring." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date committed", description="Indicates when the mitigating action was documented.", json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Additional notes about the mitigation", description=( "Clinicians may add additional notes or justifications about the " "mitigation action. For example, patient can have this drug because " "they have had it before without any issues. Multiple justifications " "may be provided." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DetectedIssueMitigation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "action", "date", "author", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DetectedIssueMitigation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/device.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Device Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Device(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Item used in healthcare. A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. """ __resource_type__ = "Device" availabilityStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="availabilityStatus", title="lost | damaged | destroyed | available", description="The availability of the device.", json_schema_extra={ "element_property": True, }, ) biologicalSourceEvent: fhirtypes.IdentifierType | None = Field( default=None, alias="biologicalSourceEvent", title=( "An identifier that supports traceability to the event during which " "material in this product from one or more biological entities was " "obtained or pooled" ), description=None, json_schema_extra={ "element_property": True, }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Indicates a high-level grouping of the device", description="Devices may be associated with one or more categories.", json_schema_extra={ "element_property": True, }, ) conformsTo: typing.List[fhirtypes.DeviceConformsToType] | None = Field( default=None, alias="conformsTo", title=( "Identifies the standards, specifications, or formal guidances for the " "capabilities supported by the device" ), description=( "Identifies the standards, specifications, or formal guidances for the " "capabilities supported by the device. The device may be certified as " "conformant to these specifications e.g., communication, performance, " "process, measurement, or specialization standards." ), json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="contact", title="Details for human/organization for support", description=( "Contact details for an organization or a particular human that is " "responsible for the device." ), json_schema_extra={ "element_property": True, }, ) cycle: fhirtypes.CountType | None = Field( default=None, alias="cycle", title=( "The series of occurrences that repeats during the operation of the " "device" ), description=None, json_schema_extra={ "element_property": True, }, ) definition: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="definition", title="The reference to the definition for the device", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DeviceDefinition"], }, ) displayName: fhirtypes.StringType | None = Field( default=None, alias="displayName", title="The name used to display by default when the device is referenced", description=( "The name used to display by default when the device is referenced. " "Based on intent of use by the resource creator, this may reflect one " "of the names in Device.name, or may be another simple name." ), json_schema_extra={ "element_property": True, }, ) displayName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_displayName", title="Extension field for ``displayName``." ) duration: fhirtypes.DurationType | None = Field( default=None, alias="duration", title=( "A measurement of time during the device's operation (e.g., days, " "hours, mins, etc.)" ), description=None, json_schema_extra={ "element_property": True, }, ) endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title=( "Technical endpoints providing access to electronic services provided " "by the device" ), description=( "Technical endpoints providing access to services provided by the " "device defined at this resource." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) expirationDate: fhirtypes.DateTimeType | None = Field( default=None, alias="expirationDate", title="Date and time of expiry of this device (if applicable)", description=( "The date and time beyond which this device is no longer valid or " "should not be used (if applicable)." ), json_schema_extra={ "element_property": True, }, ) expirationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expirationDate", title="Extension field for ``expirationDate``.", ) gateway: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="gateway", title=( "Linked device acting as a communication/data collector, translator or " "controller" ), description=( "The linked device acting as a communication controller, data " "collector, translator, or concentrator for the current device (e.g., " "mobile phone application that relays a blood pressure device's data)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Instance identifier", description=( "Unique instance identifiers assigned to a device by manufacturers " "other organizations or owners." ), json_schema_extra={ "element_property": True, }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where the device is found", description="The place where the device can be found.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) lotNumber: fhirtypes.StringType | None = Field( default=None, alias="lotNumber", title="Lot number of manufacture", description="Lot number assigned by the manufacturer.", json_schema_extra={ "element_property": True, }, ) lotNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lotNumber", title="Extension field for ``lotNumber``." ) manufactureDate: fhirtypes.DateTimeType | None = Field( default=None, alias="manufactureDate", title="Date when the device was made", description="The date and time when the device was manufactured.", json_schema_extra={ "element_property": True, }, ) manufactureDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_manufactureDate", title="Extension field for ``manufactureDate``.", ) manufacturer: fhirtypes.StringType | None = Field( default=None, alias="manufacturer", title="Name of device manufacturer", description=( "A name of the manufacturer or entity legally responsible for the " "device." ), json_schema_extra={ "element_property": True, }, ) manufacturer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_manufacturer", title="Extension field for ``manufacturer``.", ) mode: fhirtypes.CodeableConceptType | None = Field( default=None, alias="mode", title="The designated condition for performing a task", description="The designated condition for performing a task with the device.", json_schema_extra={ "element_property": True, }, ) modelNumber: fhirtypes.StringType | None = Field( default=None, alias="modelNumber", title="The manufacturer's model number for the device", description=None, json_schema_extra={ "element_property": True, }, ) modelNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_modelNumber", title="Extension field for ``modelNumber``." ) name: typing.List[fhirtypes.DeviceNameType] | None = Field( default=None, alias="name", title=( "The name or names of the device as known to the manufacturer and/or " "patient" ), description=( "This represents the manufacturer's name of the device as provided by " "the device, from a UDI label, or by a person describing the Device. " "This typically would be used when a person provides the name(s) or " "when the device represents one of the names available from " "DeviceDefinition." ), json_schema_extra={ "element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Device notes and comments", description=( "Descriptive information, usage information or implantation information" " that is not captured in an existing element." ), json_schema_extra={ "element_property": True, }, ) owner: fhirtypes.ReferenceType | None = Field( default=None, alias="owner", title="Organization responsible for device", description=( "An organization that is responsible for the provision and ongoing " "maintenance of the device." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) parent: fhirtypes.ReferenceType | None = Field( default=None, alias="parent", title=( "The higher level or encompassing device that this device is a logical " "part of" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) partNumber: fhirtypes.StringType | None = Field( default=None, alias="partNumber", title="The part number or catalog number of the device", description=None, json_schema_extra={ "element_property": True, }, ) partNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_partNumber", title="Extension field for ``partNumber``." ) property: typing.List[fhirtypes.DevicePropertyType] | None = Field( default=None, alias="property", title=( "Inherent, essentially fixed, characteristics of the device. e.g., " "time properties, size, material, etc." ), description=( "Static or essentially fixed characteristics or features of the device " "(e.g., time or timing attributes, resolution, accuracy, intended use " "or instructions for use, and physical attributes) that are not " "otherwise captured in more specific attributes." ), json_schema_extra={ "element_property": True, }, ) safety: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="safety", title="Safety Characteristics of Device", description=( "Provides additional safety characteristics about a medical device. " "For example devices containing latex." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) serialNumber: fhirtypes.StringType | None = Field( default=None, alias="serialNumber", title="Serial number assigned by the manufacturer", description=( "The serial number assigned by the organization when the device was " "manufactured." ), json_schema_extra={ "element_property": True, }, ) serialNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_serialNumber", title="Extension field for ``serialNumber``.", ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | inactive | entered-in-error", description=( "The Device record status. This is not the status of the device like " "availability." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "inactive", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="The kind or type of device", description=( "The kind or type of device. A device instance may have more than one " "type - in which case those are the types that apply to the specific " "instance of the device." ), json_schema_extra={ "element_property": True, }, ) udiCarrier: typing.List[fhirtypes.DeviceUdiCarrierType] | None = Field( default=None, alias="udiCarrier", title="Unique Device Identifier (UDI) Barcode string", description=( "Unique device identifier (UDI) assigned to device label or package. " "Note that the Device may include multiple udiCarriers as it either may" " include just the udiCarrier for the jurisdiction it is sold, or for " "multiple jurisdictions it could have been sold." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Network address to contact device", description="A network address on which the device may be contacted directly.", json_schema_extra={ "element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) version: typing.List[fhirtypes.DeviceVersionType] | None = Field( default=None, alias="version", title=( "The actual design of the device or software version running on the " "device" ), description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Device`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "displayName", "definition", "udiCarrier", "status", "availabilityStatus", "biologicalSourceEvent", "manufacturer", "manufactureDate", "expirationDate", "lotNumber", "serialNumber", "name", "modelNumber", "partNumber", "category", "type", "version", "conformsTo", "property", "mode", "cycle", "duration", "owner", "contact", "location", "url", "endpoint", "gateway", "note", "safety", "parent", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Device`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "udiCarrier", "status", "safety", ] class DeviceConformsTo(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Identifies the standards, specifications, or formal guidances for the capabilities supported by the device. Identifies the standards, specifications, or formal guidances for the capabilities supported by the device. The device may be certified as conformant to these specifications e.g., communication, performance, process, measurement, or specialization standards. """ __resource_type__ = "DeviceConformsTo" category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title=( "Describes the common type of the standard, specification, or formal " "guidance. communication | performance | measurement" ), description="Describes the type of the standard, specification, or formal guidance.", json_schema_extra={ "element_property": True, }, ) specification: fhirtypes.CodeableConceptType = Field( default=..., alias="specification", title=( "Identifies the standard, specification, or formal guidance that the " "device adheres to" ), description=( "Code that identifies the specific standard, specification, protocol, " "formal guidance, regulation, legislation, or certification scheme to " "which the device adheres." ), json_schema_extra={ "element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Specific form or variant of the standard", description=( "Identifies the specific form or variant of the standard, " "specification, or formal guidance. This may be a 'version number', " "release, document edition, publication year, or other label." ), json_schema_extra={ "element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceConformsTo`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "category", "specification", "version", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceConformsTo`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class DeviceName(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The name or names of the device as known to the manufacturer and/or patient. This represents the manufacturer's name of the device as provided by the device, from a UDI label, or by a person describing the Device. This typically would be used when a person provides the name(s) or when the device represents one of the names available from DeviceDefinition. """ __resource_type__ = "DeviceName" display: bool | None = Field( default=None, alias="display", title="The preferred device name", description="Indicates the default or preferred name to be displayed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="registered-name | user-friendly-name | patient-reported-name", description=( "Indicates the kind of name. RegisteredName | UserFriendlyName | " "PatientReportedName." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "registered-name", "user-friendly-name", "patient-reported-name", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The term that names the device", description="The actual name that identifies the device.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceName`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "value", "type", "display"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceName`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "value", "type", "display"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext"), ("value", "value__ext")] return required_fields class DeviceProperty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Inherent, essentially fixed, characteristics of the device. e.g., time properties, size, material, etc.. Static or essentially fixed characteristics or features of the device (e.g., time or timing attributes, resolution, accuracy, intended use or instructions for use, and physical attributes) that are not otherwise captured in more specific attributes. """ __resource_type__ = "DeviceProperty" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Code that specifies the property being represented", description=( "Code that specifies the property, such as resolution, color, size, " "being represented." ), json_schema_extra={ "element_property": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Value of the property", description=( "The value of the property specified by the associated property.type " "code." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value of the property", description=( "The value of the property specified by the associated property.type " "code." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Value of the property", description=( "The value of the property specified by the associated property.type " "code." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Value of the property", description=( "The value of the property specified by the associated property.type " "code." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Value of the property", description=( "The value of the property specified by the associated property.type " "code." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Value of the property", description=( "The value of the property specified by the associated property.type " "code." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Value of the property", description=( "The value of the property specified by the associated property.type " "code." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceProperty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueQuantity", "valueCodeableConcept", "valueString", "valueBoolean", "valueInteger", "valueRange", "valueAttachment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceProperty`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueBoolean", "valueCodeableConcept", "valueInteger", "valueQuantity", "valueRange", "valueString", ] } return one_of_many_fields class DeviceUdiCarrier(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Unique Device Identifier (UDI) Barcode string. Unique device identifier (UDI) assigned to device label or package. Note that the Device may include multiple udiCarriers as it either may include just the udiCarrier for the jurisdiction it is sold, or for multiple jurisdictions it could have been sold. """ __resource_type__ = "DeviceUdiCarrier" carrierAIDC: fhirtypes.Base64BinaryType | None = Field( default=None, alias="carrierAIDC", title="UDI Machine Readable Barcode String", description=( "The full UDI carrier of the Automatic Identification and Data Capture " "(AIDC) technology representation of the barcode string as printed on " "the packaging of the device - e.g., a barcode or RFID. Because of " "limitations on character sets in XML and the need to round-trip JSON " "data through XML, AIDC Formats *SHALL* be base64 encoded." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) carrierAIDC__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_carrierAIDC", title="Extension field for ``carrierAIDC``." ) carrierHRF: fhirtypes.StringType | None = Field( default=None, alias="carrierHRF", title="UDI Human Readable Barcode String", description=( "The full UDI carrier as the human readable form (HRF) representation " "of the barcode string as printed on the packaging of the device." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) carrierHRF__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_carrierHRF", title="Extension field for ``carrierHRF``." ) deviceIdentifier: fhirtypes.StringType | None = Field( default=None, alias="deviceIdentifier", title="Mandatory fixed portion of UDI", description=( "The device identifier (DI) is a mandatory, fixed portion of a UDI that" " identifies the labeler and the specific version or model of a device." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) deviceIdentifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deviceIdentifier", title="Extension field for ``deviceIdentifier``.", ) entryType: fhirtypes.CodeType | None = Field( default=None, alias="entryType", title=( "barcode | rfid | manual | card | self-reported | electronic-" "transmission | unknown" ), description="A coded entry to indicate how the data was entered.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "barcode", "rfid", "manual", "card", "self-reported", "electronic-transmission", "unknown", ], }, ) entryType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_entryType", title="Extension field for ``entryType``." ) issuer: fhirtypes.UriType | None = Field( default=None, alias="issuer", title="UDI Issuing Organization", description=( "Organization that is charged with issuing UDIs for devices. For " "example, the US FDA issuers include: 1) GS1: " "http://hl7.org/fhir/NamingSystem/gs1-di, 2) HIBCC: " "http://hl7.org/fhir/NamingSystem/hibcc-diI, 3) ICCBBA for blood " "containers: http://hl7.org/fhir/NamingSystem/iccbba-blood-di, 4) " "ICCBA for other devices: http://hl7.org/fhir/NamingSystem/iccbba-" "other-di # Informationsstelle f\u00fcr Arzneispezialit\u00e4ten (IFA GmbH) (EU " "only): http://hl7.org/fhir/NamingSystem/ifa-gmbh-di." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) issuer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issuer", title="Extension field for ``issuer``." ) jurisdiction: fhirtypes.UriType | None = Field( default=None, alias="jurisdiction", title="Regional UDI authority", description=( "The identity of the authoritative source for UDI generation within a " "jurisdiction. All UDIs are globally unique within a single namespace " "with the appropriate repository uri as the system. For example, UDIs " "of devices managed in the U.S. by the FDA, the value is " "http://hl7.org/fhir/NamingSystem/us-fda-udi or in the European Union " "by the European Commission http://hl7.org/fhir/NamingSystem/eu-ec-udi." ), json_schema_extra={ "element_property": True, }, ) jurisdiction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_jurisdiction", title="Extension field for ``jurisdiction``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceUdiCarrier`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "deviceIdentifier", "issuer", "jurisdiction", "carrierAIDC", "carrierHRF", "entryType", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceUdiCarrier`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "deviceIdentifier", "issuer", "carrierAIDC", "carrierHRF", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("deviceIdentifier", "deviceIdentifier__ext"), ("issuer", "issuer__ext"), ] return required_fields class DeviceVersion(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The actual design of the device or software version running on the device. """ __resource_type__ = "DeviceVersion" component: fhirtypes.IdentifierType | None = Field( default=None, alias="component", title=( "The hardware or software module of the device to which the version " "applies" ), description=None, json_schema_extra={ "element_property": True, }, ) installDate: fhirtypes.DateTimeType | None = Field( default=None, alias="installDate", title="The date the version was installed on the device", description=None, json_schema_extra={ "element_property": True, }, ) installDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_installDate", title="Extension field for ``installDate``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The type of the device version, e.g. manufacturer, approved, internal", description=None, json_schema_extra={ "element_property": True, }, ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The version text", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceVersion`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "component", "installDate", "value", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceVersion`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("value", "value__ext")] return required_fields ================================================ FILE: fhir/resources/deviceassociation.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DeviceAssociation Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class DeviceAssociation(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A record of association or dissociation of a device with a patient. """ __resource_type__ = "DeviceAssociation" bodyStructure: fhirtypes.ReferenceType | None = Field( default=None, alias="bodyStructure", title="Current anatomical location of the device in/on subject", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["BodyStructure"], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Describes the relationship between the device and subject", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) device: fhirtypes.ReferenceType = Field( default=..., alias="device", title="Reference to the devices associated with the patient or group", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Instance identifier", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) operation: typing.List[fhirtypes.DeviceAssociationOperationType] | None = Field( default=None, alias="operation", title=( "The details about the device when it is in use to describe its " "operation" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Begin and end dates and times for the device association", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeableConceptType = Field( default=..., alias="status", title="implanted | explanted | attached | entered-in-error | unknown", description="Indicates the state of the Device association.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) statusReason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="statusReason", title="The reasons given for the current association status", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title=( "The individual, group of individuals or device that the device is on " "or associated with" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Group", "Practitioner", "RelatedPerson", "Device", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceAssociation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "device", "category", "status", "statusReason", "subject", "bodyStructure", "period", "operation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceAssociation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "device", "category", "status", "statusReason", "subject", "bodyStructure", "period", "operation", ] class DeviceAssociationOperation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The details about the device when it is in use to describe its operation. """ __resource_type__ = "DeviceAssociationOperation" operator: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="operator", title="The individual performing the action enabled by the device", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Practitioner", "RelatedPerson"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Begin and end dates and times for the device's operation", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeableConceptType = Field( default=..., alias="status", title="Device operational condition", description="Device operational condition corresponding to the association.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceAssociationOperation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "status", "operator", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceAssociationOperation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "status", "operator", "period"] ================================================ FILE: fhir/resources/devicedefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DeviceDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class DeviceDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An instance of a medical-related component of a medical device. The characteristics, operational status and capabilities of a medical- related component of a medical device. """ __resource_type__ = "DeviceDefinition" chargeItem: typing.List[fhirtypes.DeviceDefinitionChargeItemType] | None = Field( default=None, alias="chargeItem", title="Billing code or reference associated with the device", description=None, json_schema_extra={ "element_property": True, }, ) classification: typing.List[ fhirtypes.DeviceDefinitionClassificationType ] | None = Field( default=None, alias="classification", title="What kind of device or device system this is", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) conformsTo: typing.List[fhirtypes.DeviceDefinitionConformsToType] | None = Field( default=None, alias="conformsTo", title=( "Identifies the standards, specifications, or formal guidances for the " "capabilities supported by the device" ), description=( "Identifies the standards, specifications, or formal guidances for the " "capabilities supported by the device. The device may be certified as " "conformant to these specifications e.g., communication, performance, " "process, measurement, or specialization standards." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="contact", title="Details for human/organization for support", description=( "Contact details for an organization or a particular human that is " "responsible for the device." ), json_schema_extra={ "element_property": True, }, ) correctiveAction: fhirtypes.DeviceDefinitionCorrectiveActionType | None = Field( default=None, alias="correctiveAction", title="Tracking of latest field safety corrective action", description=None, json_schema_extra={ "element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Additional information to describe the device", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) deviceName: typing.List[fhirtypes.DeviceDefinitionDeviceNameType] | None = Field( default=None, alias="deviceName", title="The name or names of the device as given by the manufacturer", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) guideline: fhirtypes.DeviceDefinitionGuidelineType | None = Field( default=None, alias="guideline", title=( "Information aimed at providing directions for the usage of this model " "of device" ), description=None, json_schema_extra={ "element_property": True, }, ) hasPart: typing.List[fhirtypes.DeviceDefinitionHasPartType] | None = Field( default=None, alias="hasPart", title="A device, part of the current one", description="A device that is part (for example a component) of the present device.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Instance identifier", description=( "Unique instance identifiers assigned to a device by the software, " "manufacturers, other organizations or owners. For example: handle ID. " "The identifier is typically valued if the udiDeviceIdentifier, " "partNumber or modelNumber is not valued and represents a different " "type of identifier. However, it is permissible to still include those" " identifiers in DeviceDefinition.identifier with the appropriate " "identifier.type." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) languageCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="languageCode", title=( "Language code for the human-readable text strings produced by the " "device (all supported)" ), description=None, json_schema_extra={ "element_property": True, }, ) link: typing.List[fhirtypes.DeviceDefinitionLinkType] | None = Field( default=None, alias="link", title=( "An associated device, attached to, used with, communicating with or " "linking a previous or new device model to the focal device" ), description=None, json_schema_extra={ "element_property": True, }, ) manufacturer: fhirtypes.ReferenceType | None = Field( default=None, alias="manufacturer", title="Name of device manufacturer", description=( "A name of the manufacturer or legal representative e.g. labeler. " "Whether this is the actual manufacturer or the labeler or responsible " "depends on implementation and jurisdiction." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) material: typing.List[fhirtypes.DeviceDefinitionMaterialType] | None = Field( default=None, alias="material", title="A substance used to create the material(s) of which the device is made", description=None, json_schema_extra={ "element_property": True, }, ) modelNumber: fhirtypes.StringType | None = Field( default=None, alias="modelNumber", title=( "The catalog or model number for the device for example as defined by " "the manufacturer" ), description=( "The model number for the device for example as defined by the " "manufacturer or labeler, or other agency." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) modelNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_modelNumber", title="Extension field for ``modelNumber``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Device notes and comments", description=( "Descriptive information, usage information or implantation information" " that is not captured in an existing element." ), json_schema_extra={ "element_property": True, }, ) owner: fhirtypes.ReferenceType | None = Field( default=None, alias="owner", title="Organization responsible for device", description=( "An organization that is responsible for the provision and ongoing " "maintenance of the device." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) packaging: typing.List[fhirtypes.DeviceDefinitionPackagingType] | None = Field( default=None, alias="packaging", title=( "Information about the packaging of the device, i.e. how the device is " "packaged" ), description=None, json_schema_extra={ "element_property": True, }, ) partNumber: fhirtypes.StringType | None = Field( default=None, alias="partNumber", title="The part number or catalog number of the device", description=None, json_schema_extra={ "element_property": True, }, ) partNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_partNumber", title="Extension field for ``partNumber``." ) productionIdentifierInUDI: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="productionIdentifierInUDI", title=( "lot-number | manufactured-date | serial-number | expiration-date | " "biological-source | software-version" ), description=( "Indicates the production identifier(s) that are expected to appear in " "the UDI carrier on the device label." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "lot-number", "manufactured-date", "serial-number", "expiration-date", "biological-source", "software-version", ], }, ) productionIdentifierInUDI__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_productionIdentifierInUDI", title="Extension field for ``productionIdentifierInUDI``.", ) property: typing.List[fhirtypes.DeviceDefinitionPropertyType] | None = Field( default=None, alias="property", title=( "Inherent, essentially fixed, characteristics of this kind of device, " "e.g., time properties, size, etc" ), description=( "Static or essentially fixed characteristics or features of this kind " "of device that are otherwise not captured in more specific attributes," " e.g., time or timing attributes, resolution, accuracy, and physical " "attributes." ), json_schema_extra={ "element_property": True, }, ) regulatoryIdentifier: typing.List[ fhirtypes.DeviceDefinitionRegulatoryIdentifierType ] | None = Field( default=None, alias="regulatoryIdentifier", title="Regulatory identifier(s) associated with this device", description=( "Identifier associated with the regulatory documentation (certificates," " technical documentation, post-market surveillance documentation and " "reports) of a set of device models sharing the same intended purpose, " "risk class and essential design and manufacturing characteristics. One" " example is the Basic UDI-DI in Europe." ), json_schema_extra={ "element_property": True, }, ) safety: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="safety", title="Safety characteristics of the device", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) shelfLifeStorage: typing.List[fhirtypes.ProductShelfLifeType] | None = Field( default=None, alias="shelfLifeStorage", title="Shelf Life and storage information", description=None, json_schema_extra={ "element_property": True, }, ) udiDeviceIdentifier: typing.List[ fhirtypes.DeviceDefinitionUdiDeviceIdentifierType ] | None = Field( default=None, alias="udiDeviceIdentifier", title="Unique Device Identifier (UDI) Barcode string", description=( "Unique device identifier (UDI) assigned to device label or package. " "Note that the Device may include multiple udiCarriers as it either may" " include just the udiCarrier for the jurisdiction it is sold, or for " "multiple jurisdictions it could have been sold." ), json_schema_extra={ "element_property": True, }, ) version: typing.List[fhirtypes.DeviceDefinitionVersionType] | None = Field( default=None, alias="version", title="The version of the device or software", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "description", "identifier", "udiDeviceIdentifier", "regulatoryIdentifier", "partNumber", "manufacturer", "deviceName", "modelNumber", "classification", "conformsTo", "hasPart", "packaging", "version", "safety", "shelfLifeStorage", "languageCode", "property", "owner", "contact", "link", "note", "material", "productionIdentifierInUDI", "guideline", "correctiveAction", "chargeItem", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "manufacturer", "deviceName", "modelNumber", "classification", "conformsTo", "hasPart", "safety", ] class DeviceDefinitionChargeItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Billing code or reference associated with the device. """ __resource_type__ = "DeviceDefinitionChargeItem" chargeItemCode: fhirtypes.CodeableReferenceType = Field( default=..., alias="chargeItemCode", title="The code or reference for the charge item", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ChargeItemDefinition"], }, ) count: fhirtypes.QuantityType = Field( default=..., alias="count", title="Coefficient applicable to the billing code", description=None, json_schema_extra={ "element_property": True, }, ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="A specific time period in which this charge item applies", description=None, json_schema_extra={ "element_property": True, }, ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context to which this charge item applies", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDefinitionChargeItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "chargeItemCode", "count", "effectivePeriod", "useContext", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDefinitionChargeItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class DeviceDefinitionClassification(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What kind of device or device system this is. """ __resource_type__ = "DeviceDefinitionClassification" justification: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="justification", title="Further information qualifying this classification of the device model", description=None, json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="A classification or risk class of the device model", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDefinitionClassification`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "justification"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDefinitionClassification`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type"] class DeviceDefinitionConformsTo(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Identifies the standards, specifications, or formal guidances for the capabilities supported by the device. Identifies the standards, specifications, or formal guidances for the capabilities supported by the device. The device may be certified as conformant to these specifications e.g., communication, performance, process, measurement, or specialization standards. """ __resource_type__ = "DeviceDefinitionConformsTo" category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title=( "Describes the common type of the standard, specification, or formal " "guidance" ), description="Describes the type of the standard, specification, or formal guidance.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) source: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="source", title=( "Standard, regulation, certification, or guidance website, document, or" " other publication, or similar, supporting the conformance" ), description=None, json_schema_extra={ "element_property": True, }, ) specification: fhirtypes.CodeableConceptType = Field( default=..., alias="specification", title=( "Identifies the standard, specification, or formal guidance that the " "device adheres to the Device Specification type" ), description=( "Code that identifies the specific standard, specification, protocol, " "formal guidance, regulation, legislation, or certification scheme to " "which the device adheres." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="version", title=( "The specific form or variant of the standard, specification or formal " "guidance" ), description=( "Identifies the specific form or variant of the standard, " "specification, or formal guidance. This may be a 'version number', " "release, document edition, publication year, or other label." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDefinitionConformsTo`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "category", "specification", "version", "source", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDefinitionConformsTo`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "category", "specification", "version"] class DeviceDefinitionCorrectiveAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Tracking of latest field safety corrective action. """ __resource_type__ = "DeviceDefinitionCorrectiveAction" period: fhirtypes.PeriodType = Field( default=..., alias="period", title="Start and end dates of the corrective action", description=None, json_schema_extra={ "element_property": True, }, ) recall: bool | None = Field( default=None, alias="recall", title="Whether the corrective action was a recall", description="Whether the last corrective action known for this device was a recall.", json_schema_extra={ "element_property": True, "element_required": True, }, ) recall__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recall", title="Extension field for ``recall``." ) scope: fhirtypes.CodeType | None = Field( default=None, alias="scope", title="model | lot-numbers | serial-numbers", description=( "The scope of the corrective action - whether the action targeted all " "units of a given device model, or only a specific set of batches " "identified by lot numbers, or individually identified devices " "identified by the serial name." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["model", "lot-numbers", "serial-numbers"], }, ) scope__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_scope", title="Extension field for ``scope``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDefinitionCorrectiveAction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "recall", "scope", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDefinitionCorrectiveAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("recall", "recall__ext")] return required_fields class DeviceDefinitionDeviceName(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The name or names of the device as given by the manufacturer. """ __resource_type__ = "DeviceDefinitionDeviceName" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="A name that is used to refer to the device", description=( "A human-friendly name that is used to refer to the device - depending " "on the type, it can be the brand name, the common name or alias, or " "other." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="registered-name | user-friendly-name | patient-reported-name", description=( "The type of deviceName. RegisteredName | UserFriendlyName | " "PatientReportedName." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "registered-name", "user-friendly-name", "patient-reported-name", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDefinitionDeviceName`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "type"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDefinitionDeviceName`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "name", "type"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext"), ("type", "type__ext")] return required_fields class DeviceDefinitionGuideline(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information aimed at providing directions for the usage of this model of device. """ __resource_type__ = "DeviceDefinitionGuideline" contraindication: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="contraindication", title=( "A specific situation when a device should not be used because it may " "cause harm" ), description=None, json_schema_extra={ "element_property": True, }, ) indication: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="indication", title="A clinical condition for which the device was designed to be used", description=None, json_schema_extra={ "element_property": True, }, ) intendedUse: fhirtypes.StringType | None = Field( default=None, alias="intendedUse", title=( "A description of the general purpose or medical use of the device or " "its function" ), description=None, json_schema_extra={ "element_property": True, }, ) intendedUse__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intendedUse", title="Extension field for ``intendedUse``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="A source of information or reference for this guideline", description=None, json_schema_extra={ "element_property": True, }, ) usageInstruction: fhirtypes.MarkdownType | None = Field( default=None, alias="usageInstruction", title=( "Detailed written and visual directions for the user on how to use the " "device" ), description=None, json_schema_extra={ "element_property": True, }, ) usageInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usageInstruction", title="Extension field for ``usageInstruction``.", ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The circumstances that form the setting for using the device", description=None, json_schema_extra={ "element_property": True, }, ) warning: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="warning", title=( "Specific hazard alert information that a user needs to know before " "using the device" ), description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDefinitionGuideline`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "useContext", "usageInstruction", "relatedArtifact", "indication", "contraindication", "warning", "intendedUse", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDefinitionGuideline`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class DeviceDefinitionHasPart(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A device, part of the current one. A device that is part (for example a component) of the present device. """ __resource_type__ = "DeviceDefinitionHasPart" count: fhirtypes.IntegerType | None = Field( default=None, alias="count", title="Number of occurrences of the part", description="Number of instances of the component device in the current device.", json_schema_extra={ "element_property": True, }, ) count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_count", title="Extension field for ``count``." ) reference: fhirtypes.ReferenceType = Field( default=..., alias="reference", title="Reference to the part", description="Reference to the device that is part of the current device.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DeviceDefinition"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDefinitionHasPart`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "reference", "count"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDefinitionHasPart`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "reference"] class DeviceDefinitionLink(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An associated device, attached to, used with, communicating with or linking a previous or new device model to the focal device. """ __resource_type__ = "DeviceDefinitionLink" relatedDevice: fhirtypes.CodeableReferenceType = Field( default=..., alias="relatedDevice", title="A reference to the linked device", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DeviceDefinition"], }, ) relation: fhirtypes.CodingType = Field( default=..., alias="relation", title=( "The type indicates the relationship of the related device to the " "device instance" ), description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDefinitionLink`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "relation", "relatedDevice"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDefinitionLink`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class DeviceDefinitionMaterial(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A substance used to create the material(s) of which the device is made. """ __resource_type__ = "DeviceDefinitionMaterial" allergenicIndicator: bool | None = Field( default=None, alias="allergenicIndicator", title="Whether the substance is a known or suspected allergen", description=None, json_schema_extra={ "element_property": True, }, ) allergenicIndicator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allergenicIndicator", title="Extension field for ``allergenicIndicator``.", ) alternate: bool | None = Field( default=None, alias="alternate", title="Indicates an alternative material of the device", description=None, json_schema_extra={ "element_property": True, }, ) alternate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_alternate", title="Extension field for ``alternate``." ) substance: fhirtypes.CodeableConceptType = Field( default=..., alias="substance", title=( "A relevant substance that the device contains, may contain, or is made" " of" ), description=( "A substance that the device contains, may contain, or is made of - for" " example latex - to be used to determine patient compatibility. This " "is not intended to represent the composition of the device, only the " "clinically relevant materials." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDefinitionMaterial`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "substance", "alternate", "allergenicIndicator", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDefinitionMaterial`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class DeviceDefinitionPackaging(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about the packaging of the device, i.e. how the device is packaged. """ __resource_type__ = "DeviceDefinitionPackaging" count: fhirtypes.IntegerType | None = Field( default=None, alias="count", title="The number of items contained in the package (devices or sub-packages)", description=None, json_schema_extra={ "element_property": True, }, ) count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_count", title="Extension field for ``count``." ) distributor: typing.List[ fhirtypes.DeviceDefinitionPackagingDistributorType ] | None = Field( default=None, alias="distributor", title="An organization that distributes the packaged device", description=None, json_schema_extra={ "element_property": True, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Business identifier of the packaged medication", description="The business identifier of the packaged medication.", json_schema_extra={ "element_property": True, }, ) packaging: typing.List[fhirtypes.DeviceDefinitionPackagingType] | None = Field( default=None, alias="packaging", title="Allows packages within packages", description=None, json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="A code that defines the specific type of packaging", description=None, json_schema_extra={ "element_property": True, }, ) udiDeviceIdentifier: typing.List[ fhirtypes.DeviceDefinitionUdiDeviceIdentifierType ] | None = Field( default=None, alias="udiDeviceIdentifier", title="Unique Device Identifier (UDI) Barcode string on the packaging", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDefinitionPackaging`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "type", "count", "distributor", "udiDeviceIdentifier", "packaging", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDefinitionPackaging`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class DeviceDefinitionPackagingDistributor(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An organization that distributes the packaged device. """ __resource_type__ = "DeviceDefinitionPackagingDistributor" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Distributor's human-readable name", description=None, json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) organizationReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="organizationReference", title="Distributor as an Organization resource", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDefinitionPackagingDistributor`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "organizationReference"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDefinitionPackagingDistributor`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class DeviceDefinitionProperty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Inherent, essentially fixed, characteristics of this kind of device, e.g., time properties, size, etc. Static or essentially fixed characteristics or features of this kind of device that are otherwise not captured in more specific attributes, e.g., time or timing attributes, resolution, accuracy, and physical attributes. """ __resource_type__ = "DeviceDefinitionProperty" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Code that specifies the property being represented", description=( "Code that specifies the property such as a resolution or color being " "represented." ), json_schema_extra={ "element_property": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Value of the property", description=( "The value of the property specified by the associated property.type " "code." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value of the property", description=( "The value of the property specified by the associated property.type " "code." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Value of the property", description=( "The value of the property specified by the associated property.type " "code." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Value of the property", description=( "The value of the property specified by the associated property.type " "code." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Value of the property", description=( "The value of the property specified by the associated property.type " "code." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Value of the property", description=( "The value of the property specified by the associated property.type " "code." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Value of the property", description=( "The value of the property specified by the associated property.type " "code." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDefinitionProperty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueQuantity", "valueCodeableConcept", "valueString", "valueBoolean", "valueInteger", "valueRange", "valueAttachment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDefinitionProperty`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueBoolean", "valueCodeableConcept", "valueInteger", "valueQuantity", "valueRange", "valueString", ] } return one_of_many_fields class DeviceDefinitionRegulatoryIdentifier(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Regulatory identifier(s) associated with this device. Identifier associated with the regulatory documentation (certificates, technical documentation, post-market surveillance documentation and reports) of a set of device models sharing the same intended purpose, risk class and essential design and manufacturing characteristics. One example is the Basic UDI-DI in Europe. """ __resource_type__ = "DeviceDefinitionRegulatoryIdentifier" deviceIdentifier: fhirtypes.StringType | None = Field( default=None, alias="deviceIdentifier", title="The identifier itself", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) deviceIdentifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deviceIdentifier", title="Extension field for ``deviceIdentifier``.", ) issuer: fhirtypes.UriType | None = Field( default=None, alias="issuer", title="The organization that issued this identifier", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) issuer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issuer", title="Extension field for ``issuer``." ) jurisdiction: fhirtypes.UriType | None = Field( default=None, alias="jurisdiction", title="The jurisdiction to which the deviceIdentifier applies", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) jurisdiction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_jurisdiction", title="Extension field for ``jurisdiction``.", ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="basic | master | license", description="The type of identifier itself.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["basic", "master", "license"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDefinitionRegulatoryIdentifier`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "deviceIdentifier", "issuer", "jurisdiction", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDefinitionRegulatoryIdentifier`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("deviceIdentifier", "deviceIdentifier__ext"), ("issuer", "issuer__ext"), ("jurisdiction", "jurisdiction__ext"), ("type", "type__ext"), ] return required_fields class DeviceDefinitionUdiDeviceIdentifier(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Unique Device Identifier (UDI) Barcode string. Unique device identifier (UDI) assigned to device label or package. Note that the Device may include multiple udiCarriers as it either may include just the udiCarrier for the jurisdiction it is sold, or for multiple jurisdictions it could have been sold. """ __resource_type__ = "DeviceDefinitionUdiDeviceIdentifier" deviceIdentifier: fhirtypes.StringType | None = Field( default=None, alias="deviceIdentifier", title=( "The identifier that is to be associated with every Device that " "references this DeviceDefintiion for the issuer and jurisdiction " "provided in the DeviceDefinition.udiDeviceIdentifier" ), description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) deviceIdentifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deviceIdentifier", title="Extension field for ``deviceIdentifier``.", ) issuer: fhirtypes.UriType | None = Field( default=None, alias="issuer", title="The organization that assigns the identifier algorithm", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) issuer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issuer", title="Extension field for ``issuer``." ) jurisdiction: fhirtypes.UriType | None = Field( default=None, alias="jurisdiction", title="The jurisdiction to which the deviceIdentifier applies", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) jurisdiction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_jurisdiction", title="Extension field for ``jurisdiction``.", ) marketDistribution: typing.List[ fhirtypes.DeviceDefinitionUdiDeviceIdentifierMarketDistributionType ] | None = Field( default=None, alias="marketDistribution", title="Indicates whether and when the device is available on the market", description="Indicates where and when the device is available on the market.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDefinitionUdiDeviceIdentifier`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "deviceIdentifier", "issuer", "jurisdiction", "marketDistribution", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDefinitionUdiDeviceIdentifier`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("deviceIdentifier", "deviceIdentifier__ext"), ("issuer", "issuer__ext"), ("jurisdiction", "jurisdiction__ext"), ] return required_fields class DeviceDefinitionUdiDeviceIdentifierMarketDistribution( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Indicates whether and when the device is available on the market. Indicates where and when the device is available on the market. """ __resource_type__ = "DeviceDefinitionUdiDeviceIdentifierMarketDistribution" marketPeriod: fhirtypes.PeriodType = Field( default=..., alias="marketPeriod", title="Begin and end dates for the commercial distribution of the device", description=None, json_schema_extra={ "element_property": True, }, ) subJurisdiction: fhirtypes.UriType | None = Field( default=None, alias="subJurisdiction", title="National state or territory where the device is commercialized", description=( "National state or territory to which the marketDistribution recers, " "typically where the device is commercialized." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) subJurisdiction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subJurisdiction", title="Extension field for ``subJurisdiction``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDefinitionUdiDeviceIdentifierMarketDistribution`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "marketPeriod", "subJurisdiction", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDefinitionUdiDeviceIdentifierMarketDistribution`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("subJurisdiction", "subJurisdiction__ext")] return required_fields class DeviceDefinitionVersion(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The version of the device or software. """ __resource_type__ = "DeviceDefinitionVersion" component: fhirtypes.IdentifierType | None = Field( default=None, alias="component", title=( "The hardware or software module of the device to which the version " "applies" ), description=None, json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The type of the device version, e.g. manufacturer, approved, internal", description=None, json_schema_extra={ "element_property": True, }, ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The version text", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDefinitionVersion`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "component", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDefinitionVersion`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("value", "value__ext")] return required_fields ================================================ FILE: fhir/resources/devicedispense.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DeviceDispense Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class DeviceDispense(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A record of dispensation of a device. A record of dispensation of a device - i.e., assigning a device to a patient, or to a professional for their use. """ __resource_type__ = "DeviceDispense" basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="The order or request that this dispense is fulfilling", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CarePlan", "DeviceRequest"], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Type of device dispense", description="Indicates the type of device dispense.", json_schema_extra={ "element_property": True, }, ) destination: fhirtypes.ReferenceType | None = Field( default=None, alias="destination", title="Where the device was sent or should be sent", description=( "Identification of the facility/location where the device was /should " "be shipped to, as part of the dispense process." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) device: fhirtypes.CodeableReferenceType = Field( default=..., alias="device", title="What device was supplied", description=( "Identifies the device being dispensed. This is either a link to a " "resource representing the details of the device or a simple attribute " "carrying a code that identifies the device from a known list of " "devices." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device", "DeviceDefinition"], }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter associated with event", description="The encounter that establishes the context for this event.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) eventHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="eventHistory", title="A list of relevant lifecycle events", description=( "A summary of the events of interest that have occurred, such as when " "the dispense was verified." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Provenance"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier for this dispensation", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where the dispense occurred", description="The principal physical location where the dispense was performed.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Information about the dispense", description=( "Extra information about the dispense that could not be conveyed in the" " other attributes." ), json_schema_extra={ "element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="The bigger event that this dispense is a part of", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Procedure"], }, ) performer: typing.List[fhirtypes.DeviceDispensePerformerType] | None = Field( default=None, alias="performer", title="Who performed event", description="Indicates who or what performed the event.", json_schema_extra={ "element_property": True, }, ) preparedDate: fhirtypes.DateTimeType | None = Field( default=None, alias="preparedDate", title="When product was packaged and reviewed", description="The time when the dispensed product was packaged and reviewed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) preparedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preparedDate", title="Extension field for ``preparedDate``.", ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Amount dispensed", description="The number of devices that have been dispensed.", json_schema_extra={ "element_property": True, }, ) receiver: fhirtypes.ReferenceType | None = Field( default=None, alias="receiver", title="Who collected the device or where the medication was delivered", description=( "Identifies the person who picked up the device or the person or " "location where the device was delivered. This may be a patient or " "their caregiver, but some cases exist where it can be a healthcare " "professional or a location." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "RelatedPerson", "Location", "PractitionerRole", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "preparation | in-progress | cancelled | on-hold | completed | entered-" "in-error | stopped | declined | unknown" ), description="A code specifying the state of the set of dispense events.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "preparation", "in-progress", "cancelled", "on-hold", "completed", "entered-in-error", "stopped", "declined", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusReason: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="statusReason", title="Why a dispense was or was not performed", description="Indicates the reason why a dispense was or was not performed.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DetectedIssue"], }, ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who the dispense is for", description=( "A link to a resource representing the person to whom the device is " "intended." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Practitioner"], }, ) supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInformation", title="Information that supports the dispensing of the device", description="Additional information that supports the device being dispensed.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Trial fill, partial fill, emergency fill, etc", description="Indicates the type of dispensing event that is performed.", json_schema_extra={ "element_property": True, }, ) usageInstruction: fhirtypes.MarkdownType | None = Field( default=None, alias="usageInstruction", title="Full representation of the usage instructions", description="The full representation of the instructions.", json_schema_extra={ "element_property": True, }, ) usageInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usageInstruction", title="Extension field for ``usageInstruction``.", ) whenHandedOver: fhirtypes.DateTimeType | None = Field( default=None, alias="whenHandedOver", title="When product was given out", description=( "The time the dispensed product was made available to the patient or " "their representative." ), json_schema_extra={ "element_property": True, }, ) whenHandedOver__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_whenHandedOver", title="Extension field for ``whenHandedOver``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDispense`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "partOf", "status", "statusReason", "category", "device", "subject", "receiver", "encounter", "supportingInformation", "performer", "location", "type", "quantity", "preparedDate", "whenHandedOver", "destination", "note", "usageInstruction", "eventHistory", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDispense`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "device", "subject", "preparedDate", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class DeviceDispensePerformer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who performed event. Indicates who or what performed the event. """ __resource_type__ = "DeviceDispensePerformer" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Individual who was performing", description=( "The device, practitioner, etc. who performed the action. It should be" " assumed that the actor is the dispenser of the device." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Patient", "Device", "RelatedPerson", "CareTeam", ], }, ) function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="Who performed the dispense and what they did", description=( "Distinguishes the type of performer in the dispense. For example, " "date enterer, packager, final checker." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceDispensePerformer`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "function", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceDispensePerformer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/devicemetric.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DeviceMetric Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class DeviceMetric(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Measurement, calculation or setting capability of a medical device. Describes a measurement, calculation or setting capability of a device. """ __resource_type__ = "DeviceMetric" calibration: typing.List[fhirtypes.DeviceMetricCalibrationType] | None = Field( default=None, alias="calibration", title=( "Describes the calibrations that have been performed or that are " "required to be performed" ), description=None, json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeType | None = Field( default=None, alias="category", title="measurement | setting | calculation | unspecified", description=( "Indicates the category of the observation generation process. A " "DeviceMetric can be for example a setting, measurement, or " "calculation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["measurement", "setting", "calculation", "unspecified"], }, ) category__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_category", title="Extension field for ``category``." ) color: fhirtypes.CodeType | None = Field( default=None, alias="color", title="Color name (from CSS4) or #RRGGBB code", description=( "The preferred color associated with the metric (e.g., display color). " "This is often used to aid clinicians to track and identify parameter " "types by color. In practice, consider a Patient Monitor that has " "ECG/HR and Pleth; the metrics are displayed in different " "characteristic colors, such as HR in blue, BP in green, and PR and " "SpO2 in magenta." ), json_schema_extra={ "element_property": True, }, ) color__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_color", title="Extension field for ``color``." ) device: fhirtypes.ReferenceType = Field( default=..., alias="device", title="Describes the link to the Device", description=( "Describes the link to the Device. This is also known as a channel " "device." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Instance identifier", description=( "Instance identifiers assigned to a device, by the device or gateway " "software, manufacturers, other organizations or owners. For example, " "handle ID." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) measurementFrequency: fhirtypes.QuantityType | None = Field( default=None, alias="measurementFrequency", title="Indicates how often the metric is taken or recorded", description=( "The frequency at which the metric is taken or recorded. Devices " "measure metrics at a wide range of frequencies; for example, an ECG " "might sample measurements in the millisecond range, while an NIBP " "might trigger only once an hour. Less often, the measurementFrequency " "may be based on a unit other than time, such as distance (e.g. for a " "measuring wheel). The update period may be different than the " "measurement frequency, if the device does not update the published " "observed value with the same frequency as it was measured." ), json_schema_extra={ "element_property": True, }, ) operationalStatus: fhirtypes.CodeType | None = Field( default=None, alias="operationalStatus", title="on | off | standby | entered-in-error", description=( "Indicates current operational state of the device. For example: On, " "Off, Standby, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["on", "off", "standby", "entered-in-error"], }, ) operationalStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_operationalStatus", title="Extension field for ``operationalStatus``.", ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Identity of metric, for example Heart Rate or PEEP Setting", description=( "Describes the type of the metric. For example: Heart Rate, PEEP " "Setting, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) unit: fhirtypes.CodeableConceptType | None = Field( default=None, alias="unit", title="Unit of Measure for the Metric", description=( "Describes the unit that an observed value determined for this metric " "will have. For example: Percent, Seconds, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceMetric`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "type", "unit", "device", "operationalStatus", "color", "category", "measurementFrequency", "calibration", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceMetric`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "type", "unit", "device", "operationalStatus", "category", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("category", "category__ext")] return required_fields class DeviceMetricCalibration(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Describes the calibrations that have been performed or that are required to be performed. """ __resource_type__ = "DeviceMetricCalibration" state: fhirtypes.CodeType | None = Field( default=None, alias="state", title="not-calibrated | calibration-required | calibrated | unspecified", description="Describes the state of the calibration.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "not-calibrated", "calibration-required", "calibrated", "unspecified", ], }, ) state__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_state", title="Extension field for ``state``." ) time: fhirtypes.InstantType | None = Field( default=None, alias="time", title="Describes the time last calibration has been performed", description=None, json_schema_extra={ "element_property": True, }, ) time__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_time", title="Extension field for ``time``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="unspecified | offset | gain | two-point", description="Describes the type of the calibration method.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["unspecified", "offset", "gain", "two-point"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceMetricCalibration`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "state", "time"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceMetricCalibration`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/devicerequest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DeviceRequest Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class DeviceRequest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Medical device request. Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker. """ __resource_type__ = "DeviceRequest" asNeeded: bool | None = Field( default=None, alias="asNeeded", title="PRN status of request", description=( "This status is to indicate whether the request is a PRN or may be " "given as needed." ), json_schema_extra={ "element_property": True, }, ) asNeeded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_asNeeded", title="Extension field for ``asNeeded``." ) asNeededFor: fhirtypes.CodeableConceptType | None = Field( default=None, alias="asNeededFor", title="Device usage reason", description="The reason for using the device.", json_schema_extra={ "element_property": True, }, ) authoredOn: fhirtypes.DateTimeType | None = Field( default=None, alias="authoredOn", title="When recorded", description="When the request transitioned to being actionable.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoredOn", title="Extension field for ``authoredOn``." ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="What request fulfills", description="Plan/proposal/order fulfilled by this request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) code: fhirtypes.CodeableReferenceType = Field( default=..., alias="code", title="Device requested", description="The details of the device to be used.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device", "DeviceDefinition"], }, ) doNotPerform: bool | None = Field( default=None, alias="doNotPerform", title="True if the request is to stop or not to start using the device", description=( "If true, indicates that the provider is asking for the patient to " "either stop using or to not start using the specified device or " "category of devices. For example, the patient has undergone surgery " "and the provider is indicating that the patient should not wear " "contact lenses." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doNotPerform", title="Extension field for ``doNotPerform``.", ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter motivating request", description=( "An encounter that provides additional context in which this request is" " made." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) groupIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="groupIdentifier", title="Identifier of composite request", description=( "A shared identifier common to multiple independent Request instances " "that were activated/authorized more or less simultaneously by a single" " author. The presence of the same identifier on each request ties " "those requests together and may have business ramifications in terms " "of reporting of results, billing, etc. E.g. a requisition number " "shared by a set of lab tests ordered together, or a prescription " "number shared by all meds ordered at one time." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Request identifier", description="Identifiers assigned to this order by the orderer or by the receiver.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="instantiatesCanonical", title="Instantiates FHIR protocol or definition", description=( "The URL pointing to a FHIR-defined protocol, guideline, orderset or " "other definition that is adhered to in whole or in part by this " "DeviceRequest." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ActivityDefinition", "PlanDefinition"], }, ) instantiatesCanonical__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="instantiatesUri", title="Instantiates external protocol or definition", description=( "The URL pointing to an externally maintained protocol, guideline, " "orderset or other definition that is adhered to in whole or in part by" " this DeviceRequest." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) insurance: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="insurance", title="Associated insurance coverage", description=( "Insurance plans, coverage extensions, pre-authorizations and/or pre-" "determinations that may be required for delivering the requested " "service." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage", "ClaimResponse"], }, ) intent: fhirtypes.CodeType | None = Field( default=None, alias="intent", title=( "proposal | plan | directive | order | original-order | reflex-order | " "filler-order | instance-order | option" ), description=( "Whether the request is a proposal, plan, an original order or a reflex" " order." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "proposal", "plan", "directive", "order", "original-order", "reflex-order", "filler-order", "instance-order", "option", ], }, ) intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intent", title="Extension field for ``intent``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Notes or comments", description=( "Details about this request that were not represented at all or " "sufficiently in one of the attributes provided in a class. These may " "include for example a comment, an instruction, or a note associated " "with the statement." ), json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="Desired time or schedule for use", description=( "The timing schedule for the use of the device. The Schedule data type " 'allows many different expressions, for example. "Every 8 hours"; ' '"Three times a day"; "1/2 an hour before breakfast for 10 days from ' '23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="Desired time or schedule for use", description=( "The timing schedule for the use of the device. The Schedule data type " 'allows many different expressions, for example. "Every 8 hours"; ' '"Three times a day"; "1/2 an hour before breakfast for 10 days from ' '23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceTiming: fhirtypes.TimingType | None = Field( default=None, alias="occurrenceTiming", title="Desired time or schedule for use", description=( "The timing schedule for the use of the device. The Schedule data type " 'allows many different expressions, for example. "Every 8 hours"; ' '"Three times a day"; "1/2 an hour before breakfast for 10 days from ' '23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) parameter: typing.List[fhirtypes.DeviceRequestParameterType] | None = Field( default=None, alias="parameter", title="Device details", description=( "Specific parameters for the ordered item. For example, the prism " "value for lenses." ), json_schema_extra={ "element_property": True, }, ) performer: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="performer", title="Requested Filler", description=( "The desired individual or entity to provide the device to the subject " "of the request (e.g., patient, location)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", "HealthcareService", "Patient", "Device", "RelatedPerson", ], }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Indicates how quickly the request should be addressed with respect to " "other requests." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) quantity: fhirtypes.IntegerType | None = Field( default=None, alias="quantity", title="Quantity of devices to supply", description="The number of devices to be provided.", json_schema_extra={ "element_property": True, }, ) quantity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_quantity", title="Extension field for ``quantity``." ) reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="reason", title="Coded/Linked Reason for request", description="Reason or justification for the use of this device.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "DiagnosticReport", "DocumentReference", ], }, ) relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="relevantHistory", title="Request provenance", description="Key events in the history of the request.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Provenance"], }, ) replaces: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="replaces", title="What request replaces", description=( "The request takes the place of the referenced completed or terminated " "request(s)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DeviceRequest"], }, ) requester: fhirtypes.ReferenceType | None = Field( default=None, alias="requester", title="Who/what submitted the device request", description=( "The individual or entity who initiated the request and has " "responsibility for its activation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Practitioner", "PractitionerRole", "Organization", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "draft | active | on-hold | revoked | completed | entered-in-error | " "unknown" ), description="The status of the request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "draft", "active", "on-hold", "revoked", "completed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Focus of request", description="The patient who will use the device.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group", "Location", "Device"], }, ) supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInfo", title="Additional clinical information", description=( "Additional clinical information about the patient that may influence " "the request fulfilment. For example, this may include where on the " "subject's body the device will be used (i.e. the target site)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "replaces", "groupIdentifier", "status", "intent", "priority", "doNotPerform", "code", "quantity", "parameter", "subject", "encounter", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "authoredOn", "requester", "performer", "reason", "asNeeded", "asNeededFor", "insurance", "supportingInfo", "note", "relevantHistory", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "replaces", "groupIdentifier", "status", "intent", "priority", "doNotPerform", "code", "subject", "encounter", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "authoredOn", "requester", "performer", "reason", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("intent", "intent__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "occurrence": ["occurrenceDateTime", "occurrencePeriod", "occurrenceTiming"] } return one_of_many_fields class DeviceRequestParameter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Device details. Specific parameters for the ordered item. For example, the prism value for lenses. """ __resource_type__ = "DeviceRequestParameter" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Device detail", description="A code or string that identifies the device detail being asserted.", json_schema_extra={ "element_property": True, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value of detail", description="The value of the device detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Value of detail", description="The value of the device detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Value of detail", description="The value of the device detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Value of detail", description="The value of the device detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceRequestParameter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "valueCodeableConcept", "valueQuantity", "valueRange", "valueBoolean", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceRequestParameter`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueCodeableConcept", "valueQuantity", "valueRange", ] } return one_of_many_fields ================================================ FILE: fhir/resources/deviceusage.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DeviceUsage Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class DeviceUsage(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Record of use of a device. A record of a device being used by a patient where the record is the result of a report from the patient or a clinician. """ __resource_type__ = "DeviceUsage" adherence: fhirtypes.DeviceUsageAdherenceType | None = Field( default=None, alias="adherence", title="How device is being used", description="This indicates how or if the device is being used.", json_schema_extra={ "element_property": True, }, ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Fulfills plan, proposal or order", description=( "A plan, proposal or order that is fulfilled in whole or in part by " "this DeviceUsage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ServiceRequest"], }, ) bodySite: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="bodySite", title="Target body site", description=( "Indicates the anotomic location on the subject's body where the device" " was used ( i.e. the target)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["BodyStructure"], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="The category of the statement - classifying how the statement is made", description=( "This attribute indicates a category for the statement - The device " "statement may be made in an inpatient or outpatient settting " "(inpatient | outpatient | community | patientspecified)." ), json_schema_extra={ "element_property": True, }, ) context: fhirtypes.ReferenceType | None = Field( default=None, alias="context", title=( "The encounter or episode of care that establishes the context for this" " device use statement" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter", "EpisodeOfCare"], }, ) dateAsserted: fhirtypes.DateTimeType | None = Field( default=None, alias="dateAsserted", title="When the statement was made (and recorded)", description="The time at which the statement was recorded by informationSource.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dateAsserted__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dateAsserted", title="Extension field for ``dateAsserted``.", ) derivedFrom: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="derivedFrom", title="Supporting information", description=( "Allows linking the DeviceUsage to the underlying Request, or to other " "information that supports or is used to derive the DeviceUsage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "ServiceRequest", "Procedure", "Claim", "Observation", "QuestionnaireResponse", "DocumentReference", ], }, ) device: fhirtypes.CodeableReferenceType = Field( default=..., alias="device", title="Code or Reference to device used", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device", "DeviceDefinition"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External identifier for this record", description="An external identifier for this statement such as an IRI.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) informationSource: fhirtypes.ReferenceType | None = Field( default=None, alias="informationSource", title="Who made the statement", description="Who reported the device was being used by the patient.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Organization", ], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Addition details (comments, instructions)", description=( "Details about the device statement that were not represented at all or" " sufficiently in one of the attributes provided in a class. These may " "include for example a comment, an instruction, or a note associated " "with the statement." ), json_schema_extra={ "element_property": True, }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Patient using device", description="The patient who used the device.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="reason", title="Why device was used", description=( "Reason or justification for the use of the device. A coded concept, or" " another resource whose existence justifies this DeviceUsage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "DiagnosticReport", "DocumentReference", "Procedure", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | completed | not-done | entered-in-error +", description=( "A code representing the patient or other source's judgment about the " "state of the device used that this statement is about. Generally this" " will be active or completed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "completed", "not-done", "entered-in-error", "+"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) timingDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="timingDateTime", title="How often the device was used", description="How often the device was used.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timingDateTime", title="Extension field for ``timingDateTime``.", ) timingPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="timingPeriod", title="How often the device was used", description="How often the device was used.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingTiming: fhirtypes.TimingType | None = Field( default=None, alias="timingTiming", title="How often the device was used", description="How often the device was used.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) usageReason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="usageReason", title=( "The reason for asserting the usage status - for example forgot, lost, " "stolen, broken" ), description=None, json_schema_extra={ "element_property": True, }, ) usageStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="usageStatus", title=( "The status of the device usage, for example always, sometimes, never. " "This is not the same as the status of the statement" ), description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceUsage`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "status", "category", "patient", "derivedFrom", "context", "timingTiming", "timingPeriod", "timingDateTime", "dateAsserted", "usageStatus", "usageReason", "adherence", "informationSource", "device", "reason", "bodySite", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceUsage`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "basedOn", "status", "patient", "derivedFrom", "context", "timingTiming", "timingPeriod", "timingDateTime", "dateAsserted", "informationSource", "device", "reason", "bodySite", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "timing": ["timingDateTime", "timingPeriod", "timingTiming"] } return one_of_many_fields class DeviceUsageAdherence(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. How device is being used. This indicates how or if the device is being used. """ __resource_type__ = "DeviceUsageAdherence" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="always | never | sometimes", description="Type of adherence.", json_schema_extra={ "element_property": True, }, ) reason: typing.List[fhirtypes.CodeableConceptType] = Field( default=..., alias="reason", title="lost | stolen | prescribed | broken | burned | forgot", description="Reason for adherence type.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DeviceUsageAdherence`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "reason"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DeviceUsageAdherence`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/diagnosticreport.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DiagnosticReport Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class DiagnosticReport(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A Diagnostic report - a combination of request information, atomic results, images, interpretation, as well as formatted reports. The findings and interpretation of diagnostic tests performed on patients, groups of patients, products, substances, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports. The report also includes non-clinical context such as batch analysis and stability reporting of products and substances. """ __resource_type__ = "DiagnosticReport" basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="What was requested", description="Details concerning a service requested.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CarePlan", "ImmunizationRecommendation", "MedicationRequest", "NutritionOrder", "ServiceRequest", ], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Service category", description=( "A code that classifies the clinical discipline, department or " "diagnostic service that created the report (e.g. cardiology, " "biochemistry, hematology, MRI). This is used for searching, sorting " "and display purposes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Name/Code for this diagnostic report", description="A code or name that describes this diagnostic report.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) composition: fhirtypes.ReferenceType | None = Field( default=None, alias="composition", title="Reference to a Composition resource for the DiagnosticReport structure", description=( "Reference to a Composition resource instance that provides structure " "for organizing the contents of the DiagnosticReport." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Composition"], }, ) conclusion: fhirtypes.MarkdownType | None = Field( default=None, alias="conclusion", title="Clinical conclusion (interpretation) of test results", description=( "Concise and clinically contextualized summary conclusion " "(interpretation/impression) of the diagnostic report." ), json_schema_extra={ "element_property": True, }, ) conclusion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_conclusion", title="Extension field for ``conclusion``." ) conclusionCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="conclusionCode", title="Codes for the clinical conclusion of test results", description=( "One or more codes that represent the summary conclusion " "(interpretation/impression) of the diagnostic report." ), json_schema_extra={ "element_property": True, }, ) effectiveDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="effectiveDateTime", title="Clinically relevant time/time-period for report", description=( "The time or time-period the observed values are related to. When the " "subject of the report is a patient, this is usually either the time of" " the procedure or of specimen collection(s), but very often the source" " of the date/time is not known, only the date/time itself." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_effectiveDateTime", title="Extension field for ``effectiveDateTime``.", ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="Clinically relevant time/time-period for report", description=( "The time or time-period the observed values are related to. When the " "subject of the report is a patient, this is usually either the time of" " the procedure or of specimen collection(s), but very often the source" " of the date/time is not known, only the date/time itself." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Health care event when test ordered", description=( "The healthcare event (e.g. a patient and healthcare provider " "interaction) which this DiagnosticReport is about." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier for report", description="Identifiers assigned to this report by the performer or other systems.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued: fhirtypes.InstantType | None = Field( default=None, alias="issued", title="DateTime this version was made", description=( "The date and time that this version of the report was made available " "to providers, typically after the report was reviewed and verified." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issued", title="Extension field for ``issued``." ) media: typing.List[fhirtypes.DiagnosticReportMediaType] | None = Field( default=None, alias="media", title="Key images or data associated with this report", description=( "A list of key images or data associated with this report. The images " "or data are generally created during the diagnostic process, and may " "be directly of the patient, or of treated specimens (i.e. slides of " "interest)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments about the diagnostic report", description=None, json_schema_extra={ "element_property": True, }, ) performer: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="performer", title="Responsible Diagnostic Service", description="The diagnostic service that is responsible for issuing the report.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", ], }, ) presentedForm: typing.List[fhirtypes.AttachmentType] | None = Field( default=None, alias="presentedForm", title="Entire report as issued", description=( "Rich text representation of the entire result as issued by the " "diagnostic service. Multiple formats are allowed but they SHALL be " "semantically equivalent." ), json_schema_extra={ "element_property": True, }, ) result: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="result", title="Observations", description=( "[Observations](observation.html) that are part of this diagnostic " "report." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Observation"], }, ) resultsInterpreter: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="resultsInterpreter", title="Primary result interpreter", description=( "The practitioner or organization that is responsible for the report's " "conclusions and interpretations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", ], }, ) specimen: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="specimen", title="Specimens this report is based on", description="Details about the specimens on which this diagnostic report is based.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Specimen"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "registered | partial | preliminary | modified | final | amended | " "corrected | appended | cancelled | entered-in-error | unknown" ), description="The status of the diagnostic report.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "registered", "partial", "preliminary", "modified", "final", "amended", "corrected", "appended", "cancelled", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) study: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="study", title=( "Reference to full details of an analysis associated with the " "diagnostic report" ), description=( "One or more links to full details of any study performed during the " "diagnostic investigation. An ImagingStudy might comprise a set of " "radiologic images obtained via a procedure that are analyzed as a " "group. Typically, this is imaging performed by DICOM enabled " "modalities, but this is not required. A fully enabled PACS viewer can " "use this information to provide views of the source images. A " "GenomicStudy might comprise one or more analyses, each serving a " "specific purpose. These analyses may vary in method (e.g., " "karyotyping, CNV, or SNV detection), performer, software, devices " "used, or regions targeted." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["GenomicStudy", "ImagingStudy"], }, ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="The subject of the report - usually, but not always, the patient", description=( "The subject of the report. Usually, but not always, this is a patient." " However, diagnostic services also perform analyses on specimens " "collected from a variety of other sources." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Group", "Device", "Location", "Organization", "Practitioner", "Medication", "Substance", "BiologicallyDerivedProduct", ], }, ) supportingInfo: typing.List[ fhirtypes.DiagnosticReportSupportingInfoType ] | None = Field( default=None, alias="supportingInfo", title="Additional information supporting the diagnostic report", description=( "This backbone element contains supporting information that was used in" " the creation of the report not included in the results already " "included in the report." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DiagnosticReport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "status", "category", "code", "subject", "encounter", "effectiveDateTime", "effectivePeriod", "issued", "performer", "resultsInterpreter", "specimen", "result", "note", "study", "supportingInfo", "media", "composition", "conclusion", "conclusionCode", "presentedForm", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DiagnosticReport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "category", "code", "subject", "encounter", "effectiveDateTime", "effectivePeriod", "issued", "performer", "resultsInterpreter", "media", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"effective": ["effectiveDateTime", "effectivePeriod"]} return one_of_many_fields class DiagnosticReportMedia(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Key images or data associated with this report. A list of key images or data associated with this report. The images or data are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest). """ __resource_type__ = "DiagnosticReportMedia" comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Comment about the image or data (e.g. explanation)", description=( "A comment about the image or data. Typically, this is used to provide " "an explanation for why the image or data is included, or to draw the " "viewer's attention to important features." ), json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) link: fhirtypes.ReferenceType = Field( default=..., alias="link", title="Reference to the image or data source", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DiagnosticReportMedia`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "comment", "link"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DiagnosticReportMedia`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "link"] class DiagnosticReportSupportingInfo(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional information supporting the diagnostic report. This backbone element contains supporting information that was used in the creation of the report not included in the results already included in the report. """ __resource_type__ = "DiagnosticReportSupportingInfo" reference: fhirtypes.ReferenceType = Field( default=..., alias="reference", title="Supporting information reference", description="The reference for the supporting information in the diagnostic report.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Procedure", "Observation", "DiagnosticReport", "Citation", ], }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Supporting information role code", description=( "The code value for the role of the supporting information in the " "diagnostic report." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DiagnosticReportSupportingInfo`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "reference"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DiagnosticReportSupportingInfo`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/distance.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Distance Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from . import quantity class Distance(quantity.Quantity): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A length - a value with a unit that is a physical distance. """ __resource_type__ = "Distance" @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Distance`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "value", "comparator", "unit", "system", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Distance`` according to specification, with preserving the original sequence order. """ return ["value", "comparator", "unit", "system", "code"] ================================================ FILE: fhir/resources/documentreference.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DocumentReference Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class DocumentReference(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A reference to a document. A reference to a document of any kind for any purpose. While the term “document” implies a more narrow focus, for this resource this "document" encompasses *any* serialized object with a mime-type, it includes formal patient-centric documents (CDA), clinical notes, scanned paper, non-patient specific documents like policy text, as well as a photo, video, or audio recording acquired or used in healthcare. The DocumentReference resource provides metadata about the document so that the document can be discovered and managed. The actual content may be inline base64 encoded data or provided by direct reference. """ __resource_type__ = "DocumentReference" attester: typing.List[fhirtypes.DocumentReferenceAttesterType] | None = Field( default=None, alias="attester", title="Attests to accuracy of the document", description="A participant who has authenticated the accuracy of the document.", json_schema_extra={ "element_property": True, }, ) author: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="author", title="Who and/or what authored the document", description=( "Identifies who is responsible for adding the information to the " "document." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Device", "Patient", "RelatedPerson", "CareTeam", ], }, ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Procedure that caused this media to be created", description=( "A procedure that is fulfilled in whole or in part by the creation of " "this media." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Appointment", "AppointmentResponse", "CarePlan", "Claim", "CommunicationRequest", "Contract", "CoverageEligibilityRequest", "DeviceRequest", "EnrollmentRequest", "ImmunizationRecommendation", "MedicationRequest", "NutritionOrder", "RequestOrchestration", "ServiceRequest", "SupplyRequest", "VisionPrescription", ], }, ) bodySite: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="bodySite", title="Body part included", description="The anatomic structures included in the document.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["BodyStructure"], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Categorization of document", description=( "A categorization for the type of document referenced - helps for " "indexing and searching. This may be implied by or derived from the " "code specified in the DocumentReference.type." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) content: typing.List[fhirtypes.DocumentReferenceContentType] = Field( default=..., alias="content", title="Document referenced", description=( "The document and format referenced. If there are multiple content " "element repetitions, these must all represent the same document in " "different format, or attachment metadata." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) context: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="context", title="Context of the document content", description=( "Describes the clinical encounter or type of care that the document " "content is associated with." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Appointment", "Encounter", "EpisodeOfCare"], }, ) custodian: fhirtypes.ReferenceType | None = Field( default=None, alias="custodian", title="Organization which maintains the document", description=( "Identifies the organization or group who is responsible for ongoing " "maintenance of and access to the document." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) date: fhirtypes.InstantType | None = Field( default=None, alias="date", title="When this document reference was created", description="When the document reference was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Human-readable description", description="Human-readable description of the source document.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) docStatus: fhirtypes.CodeType | None = Field( default=None, alias="docStatus", title=( "registered | partial | preliminary | final | amended | corrected | " "appended | cancelled | entered-in-error | deprecated | unknown" ), description="The status of the underlying document.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "registered", "partial", "preliminary", "final", "amended", "corrected", "appended", "cancelled", "entered-in-error", "deprecated", "unknown", ], }, ) docStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_docStatus", title="Extension field for ``docStatus``." ) event: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="event", title="Main clinical acts documented", description=( "This list of codes represents the main clinical acts, such as a " "colonoscopy or an appendectomy, being documented. In some cases, the " 'event is inherent in the type Code, such as a "History and Physical ' 'Report" in which the procedure being documented is necessarily a ' '"History and Physical" act.' ), json_schema_extra={ "element_property": True, }, ) facilityType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="facilityType", title="Kind of facility where patient was seen", description="The kind of facility where the patient was seen.", json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifiers for the document", description=( "Other business identifiers associated with the document, including " "version independent identifiers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) modality: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modality", title="Imaging modality used", description=( "Imaging modality used. This may include both acquisition and non-" "acquisition modalities." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time of service that is being documented", description=( "The time period over which the service that is described by the " "document was provided." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) practiceSetting: fhirtypes.CodeableConceptType | None = Field( default=None, alias="practiceSetting", title=( "Additional details about where the content was created (e.g. clinical " "specialty)" ), description=( "This property may convey specifics about the practice setting where " "the content was created, often reflecting the clinical specialty." ), json_schema_extra={ "element_property": True, }, ) relatesTo: typing.List[fhirtypes.DocumentReferenceRelatesToType] | None = Field( default=None, alias="relatesTo", title="Relationships to other documents", description=( "Relationships that this document has with other document references " "that already exist." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) securityLabel: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="securityLabel", title="Document security-tags", description=( "A set of Security-Tag codes specifying the level of privacy/security " "of the Document found at DocumentReference.content.attachment.url. " "Note that DocumentReference.meta.security contains the security labels" " of the data elements in DocumentReference, while " "DocumentReference.securityLabel contains the security labels for the " "document the reference refers to. The distinction recognizes that the " "document may contain sensitive information, while the " "DocumentReference is metadata about the document and thus might not be" " as sensitive as the document. For example: a psychotherapy episode " "may contain highly sensitive information, while the metadata may " "simply indicate that some episode happened." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="current | superseded | entered-in-error", description="The status of this document reference.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["current", "superseded", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Who/what is the subject of the document", description=( "Who or what the document is about. The document can be about a person," " (patient or healthcare practitioner), a device (e.g. a machine) or " "even a group of subjects (such as a document about a herd of farm " "animals, or a set of patients that share a common exposure)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Kind of document (LOINC if possible)", description=( "Specifies the particular kind of document referenced (e.g. History " "and Physical, Discharge Summary, Progress Note). This usually equates " "to the purpose of making the document referenced." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title=( "An explicitly assigned identifer of a variation of the content in the " "DocumentReference" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DocumentReference`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "version", "basedOn", "status", "docStatus", "modality", "type", "category", "subject", "context", "event", "bodySite", "facilityType", "practiceSetting", "period", "date", "author", "attester", "custodian", "relatesTo", "description", "securityLabel", "content", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DocumentReference`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "version", "status", "docStatus", "modality", "type", "category", "subject", "bodySite", "period", "date", "author", "relatesTo", "description", "securityLabel", "content", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class DocumentReferenceAttester(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Attests to accuracy of the document. A participant who has authenticated the accuracy of the document. """ __resource_type__ = "DocumentReferenceAttester" mode: fhirtypes.CodeableConceptType = Field( default=..., alias="mode", title="personal | professional | legal | official", description="The type of attestation the authenticator offers.", json_schema_extra={ "element_property": True, }, ) party: fhirtypes.ReferenceType | None = Field( default=None, alias="party", title="Who attested the document", description="Who attested the document in the specified way.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "RelatedPerson", "Practitioner", "PractitionerRole", "Organization", ], }, ) time: fhirtypes.DateTimeType | None = Field( default=None, alias="time", title="When the document was attested", description="When the document was attested by the party.", json_schema_extra={ "element_property": True, }, ) time__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_time", title="Extension field for ``time``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DocumentReferenceAttester`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "mode", "time", "party"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DocumentReferenceAttester`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class DocumentReferenceContent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Document referenced. The document and format referenced. If there are multiple content element repetitions, these must all represent the same document in different format, or attachment metadata. """ __resource_type__ = "DocumentReferenceContent" attachment: fhirtypes.AttachmentType = Field( default=..., alias="attachment", title="Where to access the document", description=( "The document or URL of the document along with critical metadata to " "prove content has integrity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) profile: typing.List[fhirtypes.DocumentReferenceContentProfileType] | None = Field( default=None, alias="profile", title="Content profile rules for the document", description=( "An identifier of the document constraints, encoding, structure, and " "template that the document conforms to beyond the base format " "indicated in the mimeType." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DocumentReferenceContent`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "attachment", "profile"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DocumentReferenceContent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "attachment", "profile"] class DocumentReferenceContentProfile(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Content profile rules for the document. An identifier of the document constraints, encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType. """ __resource_type__ = "DocumentReferenceContentProfile" valueCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="valueCanonical", title="Code|uri|canonical", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCanonical", title="Extension field for ``valueCanonical``.", ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Code|uri|canonical", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="Code|uri|canonical", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DocumentReferenceContentProfile`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "valueCoding", "valueUri", "valueCanonical", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DocumentReferenceContentProfile`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "valueCoding", "valueUri", "valueCanonical"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"value": ["valueCanonical", "valueCoding", "valueUri"]} return one_of_many_fields class DocumentReferenceRelatesTo(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Relationships to other documents. Relationships that this document has with other document references that already exist. """ __resource_type__ = "DocumentReferenceRelatesTo" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="The relationship type with another document", description="The type of relationship that this document has with anther document.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) target: fhirtypes.ReferenceType = Field( default=..., alias="target", title="Target of the relationship", description="The target document of this relationship.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DocumentReferenceRelatesTo`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "target"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DocumentReferenceRelatesTo`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "target"] ================================================ FILE: fhir/resources/domainresource.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/DomainResource Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import fhirtypes, resource class DomainResource(resource.Resource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A resource with narrative, extensions, and contained resources. A resource that includes narrative, extensions, and contained resources. """ __resource_type__ = "DomainResource" contained: typing.List[fhirtypes.ResourceType] | None = Field( default=None, alias="contained", title="Contained, inline Resources", description=( "These resources do not have an independent existence apart from the " "resource that contains them - they cannot be identified independently," " nor can they have their own independent transaction scope. This is " "allowed to be a Parameters resource if and only if it is referenced by" " a resource that provides context/meaning." ), json_schema_extra={ "element_property": True, }, ) extension: typing.List[fhirtypes.ExtensionType] | None = Field( default=None, alias="extension", title="Additional content defined by implementations", description=( "May be used to represent additional information that is not part of " "the basic definition of the resource. To make the use of extensions " "safe and managable, there is a strict set of governance applied to the" " definition and use of extensions. Though any implementer can define " "an extension, there is a set of requirements that SHALL be met as part" " of the definition of the extension." ), json_schema_extra={ "element_property": True, }, ) modifierExtension: typing.List[fhirtypes.ExtensionType] | None = Field( default=None, alias="modifierExtension", title="Extensions that cannot be ignored", description=( "May be used to represent additional information that is not part of " "the basic definition of the resource and that modifies the " "understanding of the element that contains it and/or the understanding" " of the containing element's descendants. Usually modifier elements " "provide negation or qualification. To make the use of extensions safe " "and managable, there is a strict set of governance applied to the " "definition and use of extensions. Though any implementer is allowed to" " define an extension, there is a set of requirements that SHALL be met" " as part of the definition of the extension. Applications processing a" " resource are required to check for modifier extensions. Modifier " "extensions SHALL NOT change the meaning of any elements on Resource or" " DomainResource (including cannot change the meaning of " "modifierExtension itself)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) text: fhirtypes.NarrativeType | None = Field( default=None, alias="text", title="Text summary of the resource, for human interpretation", description=( "A human-readable narrative that contains a summary of the resource and" " can be used to represent the content of the resource to a human. The " "narrative need not encode all the structured data, but is required to " 'contain sufficient detail to make it "clinically safe" for a human to ' "just read the narrative. Resource definitions may define what content " "should be represented in the narrative to ensure clinical safety." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DomainResource`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DomainResource`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "modifierExtension"] ================================================ FILE: fhir/resources/dosage.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Dosage Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backbonetype, element, fhirtypes class Dosage(backbonetype.BackboneType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. How the medication is/was taken or should be taken. Indicates how the medication is/was taken or should be taken by the patient. """ __resource_type__ = "Dosage" additionalInstruction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="additionalInstruction", title=( 'Supplemental instruction or warnings to the patient - e.g. "with ' 'meals", "may cause drowsiness"' ), description=( "Supplemental instructions to the patient on how to take the medication" ' (e.g. "with meals" or"take half to one hour before food") or ' 'warnings for the patient about the medication (e.g. "may cause ' 'drowsiness" or "avoid exposure of skin to direct sunlight or ' 'sunlamps").' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) asNeeded: bool | None = Field( default=None, alias="asNeeded", title='Take "as needed"', description=( "Indicates whether the Medication is only taken when needed within a " "specific dosing schedule (Boolean option)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) asNeeded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_asNeeded", title="Extension field for ``asNeeded``." ) asNeededFor: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="asNeededFor", title='Take "as needed" (for x)', description=( "Indicates whether the Medication is only taken based on a precondition" " for taking the Medication (CodeableConcept)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) doseAndRate: typing.List[fhirtypes.DosageDoseAndRateType] | None = Field( default=None, alias="doseAndRate", title=( "Amount of medication administered, to be administered or typical " "amount to be administered" ), description=( "Depending on the resource,this is the amount of medication " "administered, to be administered or typical amount to be " "administered." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maxDosePerAdministration: fhirtypes.QuantityType | None = Field( default=None, alias="maxDosePerAdministration", title="Upper limit on medication per administration", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maxDosePerLifetime: fhirtypes.QuantityType | None = Field( default=None, alias="maxDosePerLifetime", title="Upper limit on medication per lifetime of the patient", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maxDosePerPeriod: typing.List[fhirtypes.RatioType] | None = Field( default=None, alias="maxDosePerPeriod", title="Upper limit on medication per unit of time", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="Technique for administering medication", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patientInstruction: fhirtypes.StringType | None = Field( default=None, alias="patientInstruction", title="Patient or consumer oriented instructions", description="Instructions in terms that are understood by the patient or consumer.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patientInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patientInstruction", title="Extension field for ``patientInstruction``.", ) route: fhirtypes.CodeableConceptType | None = Field( default=None, alias="route", title="How drug should enter body", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sequence: fhirtypes.IntegerType | None = Field( default=None, alias="sequence", title="The order of the dosage instructions", description=( "Indicates the order in which the dosage instructions should be applied" " or interpreted." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) site: fhirtypes.CodeableConceptType | None = Field( default=None, alias="site", title="Body site to administer to", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Free text dosage instructions e.g. SIG", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) timing: fhirtypes.TimingType | None = Field( default=None, alias="timing", title="When medication should be administered", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Dosage`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "text", "additionalInstruction", "patientInstruction", "timing", "asNeeded", "asNeededFor", "site", "route", "method", "doseAndRate", "maxDosePerPeriod", "maxDosePerAdministration", "maxDosePerLifetime", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Dosage`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "sequence", "text", "additionalInstruction", "patientInstruction", "timing", "asNeeded", "asNeededFor", "site", "route", "method", "doseAndRate", "maxDosePerPeriod", "maxDosePerAdministration", "maxDosePerLifetime", ] class DosageDoseAndRate(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Amount of medication administered, to be administered or typical amount to be administered. Depending on the resource,this is the amount of medication administered, to be administered or typical amount to be administered. """ __resource_type__ = "DosageDoseAndRate" doseQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="doseQuantity", title="Amount of medication per dose", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e dose[x] "one_of_many": "dose", "one_of_many_required": False, }, ) doseRange: fhirtypes.RangeType | None = Field( default=None, alias="doseRange", title="Amount of medication per dose", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e dose[x] "one_of_many": "dose", "one_of_many_required": False, }, ) rateQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="rateQuantity", title="Amount of medication per unit of time", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e rate[x] "one_of_many": "rate", "one_of_many_required": False, }, ) rateRange: fhirtypes.RangeType | None = Field( default=None, alias="rateRange", title="Amount of medication per unit of time", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e rate[x] "one_of_many": "rate", "one_of_many_required": False, }, ) rateRatio: fhirtypes.RatioType | None = Field( default=None, alias="rateRatio", title="Amount of medication per unit of time", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e rate[x] "one_of_many": "rate", "one_of_many_required": False, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The kind of dose or rate specified", description=( "The kind of dose or rate specified, for example, ordered or " "calculated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``DosageDoseAndRate`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "type", "doseRange", "doseQuantity", "rateRatio", "rateRange", "rateQuantity", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``DosageDoseAndRate`` according to specification, with preserving the original sequence order. """ return [ "type", "doseRange", "doseQuantity", "rateRatio", "rateRange", "rateQuantity", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "dose": ["doseQuantity", "doseRange"], "rate": ["rateQuantity", "rateRange", "rateRatio"], } return one_of_many_fields ================================================ FILE: fhir/resources/duration.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Duration Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from . import quantity class Duration(quantity.Quantity): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A length of time. """ __resource_type__ = "Duration" @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Duration`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "value", "comparator", "unit", "system", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Duration`` according to specification, with preserving the original sequence order. """ return ["value", "comparator", "unit", "system", "code"] ================================================ FILE: fhir/resources/element.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Element Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import base, fhirtypes class Element(base.Base): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Base for all elements. Base definition for all elements in a resource. """ __resource_type__ = "Element" extension: typing.List[fhirtypes.ExtensionType] | None = Field( default=None, alias="extension", title="Additional content defined by implementations", description=( "May be used to represent additional information that is not part of " "the basic definition of the element. To make the use of extensions " "safe and managable, there is a strict set of governance applied to the" " definition and use of extensions. Though any implementer can define " "an extension, there is a set of requirements that SHALL be met as part" " of the definition of the extension." ), json_schema_extra={ "element_property": True, }, ) id: fhirtypes.StringType | None = Field( default=None, alias="id", title="Unique id for inter-element referencing", description=( "Unique id for the element within a resource (for internal references)." " This may be any string value that does not contain spaces." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Element`` according to specification, with preserving the original sequence order. """ return ["id", "extension"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Element`` according to specification, with preserving the original sequence order. """ return [] ================================================ FILE: fhir/resources/elementdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ElementDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backbonetype, element, fhirtypes class ElementDefinition(backbonetype.BackboneType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of an element in a resource or extension. Captures constraints on each element within the resource, profile, or extension. """ __resource_type__ = "ElementDefinition" alias: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="alias", title="Other names", description="Identifies additional names by which this element might also be known.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_alias", title="Extension field for ``alias``." ) base: fhirtypes.ElementDefinitionBaseType | None = Field( default=None, alias="base", title="Base definition information for tools", description=( "Information about the base definition of the element, provided to make" " it unnecessary for tools to trace the deviation of the element " "through the derived and related profiles. When the element definition " "is not the original definition of an element - e.g. either in a " "constraint on another type, or for elements from a super type in a " "snap shot - then the information in provided in the element definition" " may be different to the base definition. On the original definition " "of the element, it will be same." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) binding: fhirtypes.ElementDefinitionBindingType | None = Field( default=None, alias="binding", title="ValueSet details if this is coded", description=( "Binds to a value set if this element is coded (code, Coding, " "CodeableConcept, Quantity), or the data types (string, uri)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="code", title="Corresponding codes in terminologies", description=( "A code that has the same meaning as the element in a particular " "terminology." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comment: fhirtypes.MarkdownType | None = Field( default=None, alias="comment", title="Comments about the use of this element", description=( "Explanatory notes and implementation guidance about the data element, " "including notes about how to use the data properly, exceptions to " "proper use, etc. (Note: The text you are reading is specified in " "ElementDefinition.comment)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) condition: typing.List[fhirtypes.IdType | None] | None = Field( default=None, alias="condition", title="Reference to invariant about presence", description=( "A reference to an invariant that may make additional statements about " "the cardinality or value in the instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) condition__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_condition", title="Extension field for ``condition``." ) constraint: typing.List[fhirtypes.ElementDefinitionConstraintType] | None = Field( default=None, alias="constraint", title="Condition that must evaluate to true", description=( "Formal constraints such as co-occurrence and other constraints that " "can be computationally evaluated within the context of the instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contentReference: fhirtypes.UriType | None = Field( default=None, alias="contentReference", title="Reference to definition of content for the element", description=( "Identifies an element defined elsewhere in the definition whose " "content rules should be applied to the current element. " "ContentReferences bring across all the rules that are in the " "ElementDefinition for the element, including definitions, cardinality " "constraints, bindings, invariants etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contentReference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contentReference", title="Extension field for ``contentReference``.", ) defaultValueAddress: fhirtypes.AddressType | None = Field( default=None, alias="defaultValueAddress", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueAge: fhirtypes.AgeType | None = Field( default=None, alias="defaultValueAge", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="defaultValueAnnotation", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="defaultValueAttachment", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueAvailability: fhirtypes.AvailabilityType | None = Field( default=None, alias="defaultValueAvailability", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="defaultValueBase64Binary", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueBase64Binary", title="Extension field for ``defaultValueBase64Binary``.", ) defaultValueBoolean: bool | None = Field( default=None, alias="defaultValueBoolean", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueBoolean", title="Extension field for ``defaultValueBoolean``.", ) defaultValueCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="defaultValueCanonical", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueCanonical", title="Extension field for ``defaultValueCanonical``.", ) defaultValueCode: fhirtypes.CodeType | None = Field( default=None, alias="defaultValueCode", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueCode", title="Extension field for ``defaultValueCode``.", ) defaultValueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="defaultValueCodeableConcept", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueCodeableReference: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="defaultValueCodeableReference", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueCoding: fhirtypes.CodingType | None = Field( default=None, alias="defaultValueCoding", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueContactDetail: fhirtypes.ContactDetailType | None = Field( default=None, alias="defaultValueContactDetail", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="defaultValueContactPoint", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueCount: fhirtypes.CountType | None = Field( default=None, alias="defaultValueCount", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDataRequirement: fhirtypes.DataRequirementType | None = Field( default=None, alias="defaultValueDataRequirement", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDate: fhirtypes.DateType | None = Field( default=None, alias="defaultValueDate", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueDate", title="Extension field for ``defaultValueDate``.", ) defaultValueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="defaultValueDateTime", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueDateTime", title="Extension field for ``defaultValueDateTime``.", ) defaultValueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="defaultValueDecimal", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueDecimal", title="Extension field for ``defaultValueDecimal``.", ) defaultValueDistance: fhirtypes.DistanceType | None = Field( default=None, alias="defaultValueDistance", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDosage: fhirtypes.DosageType | None = Field( default=None, alias="defaultValueDosage", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueDuration: fhirtypes.DurationType | None = Field( default=None, alias="defaultValueDuration", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueExpression: fhirtypes.ExpressionType | None = Field( default=None, alias="defaultValueExpression", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueExtendedContactDetail: fhirtypes.ExtendedContactDetailType | None = Field( default=None, alias="defaultValueExtendedContactDetail", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="defaultValueHumanName", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueId: fhirtypes.IdType | None = Field( default=None, alias="defaultValueId", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueId", title="Extension field for ``defaultValueId``.", ) defaultValueIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="defaultValueIdentifier", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueInstant: fhirtypes.InstantType | None = Field( default=None, alias="defaultValueInstant", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueInstant", title="Extension field for ``defaultValueInstant``.", ) defaultValueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="defaultValueInteger", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueInteger", title="Extension field for ``defaultValueInteger``.", ) defaultValueInteger64: fhirtypes.Integer64Type | None = Field( default=None, alias="defaultValueInteger64", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueInteger64__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueInteger64", title="Extension field for ``defaultValueInteger64``.", ) defaultValueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="defaultValueMarkdown", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueMarkdown", title="Extension field for ``defaultValueMarkdown``.", ) defaultValueMeta: fhirtypes.MetaType | None = Field( default=None, alias="defaultValueMeta", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueMoney: fhirtypes.MoneyType | None = Field( default=None, alias="defaultValueMoney", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueOid: fhirtypes.OidType | None = Field( default=None, alias="defaultValueOid", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueOid", title="Extension field for ``defaultValueOid``.", ) defaultValueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field( default=None, alias="defaultValueParameterDefinition", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="defaultValuePeriod", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="defaultValuePositiveInt", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValuePositiveInt", title="Extension field for ``defaultValuePositiveInt``.", ) defaultValueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="defaultValueQuantity", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueRange: fhirtypes.RangeType | None = Field( default=None, alias="defaultValueRange", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueRatio: fhirtypes.RatioType | None = Field( default=None, alias="defaultValueRatio", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueRatioRange: fhirtypes.RatioRangeType | None = Field( default=None, alias="defaultValueRatioRange", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="defaultValueReference", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field( default=None, alias="defaultValueRelatedArtifact", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="defaultValueSampledData", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueSignature: fhirtypes.SignatureType | None = Field( default=None, alias="defaultValueSignature", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueString: fhirtypes.StringType | None = Field( default=None, alias="defaultValueString", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueString", title="Extension field for ``defaultValueString``.", ) defaultValueTime: fhirtypes.TimeType | None = Field( default=None, alias="defaultValueTime", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueTime", title="Extension field for ``defaultValueTime``.", ) defaultValueTiming: fhirtypes.TimingType | None = Field( default=None, alias="defaultValueTiming", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field( default=None, alias="defaultValueTriggerDefinition", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="defaultValueUnsignedInt", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueUnsignedInt", title="Extension field for ``defaultValueUnsignedInt``.", ) defaultValueUri: fhirtypes.UriType | None = Field( default=None, alias="defaultValueUri", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueUri", title="Extension field for ``defaultValueUri``.", ) defaultValueUrl: fhirtypes.UrlType | None = Field( default=None, alias="defaultValueUrl", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueUrl", title="Extension field for ``defaultValueUrl``.", ) defaultValueUsageContext: fhirtypes.UsageContextType | None = Field( default=None, alias="defaultValueUsageContext", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueUuid: fhirtypes.UuidType | None = Field( default=None, alias="defaultValueUuid", title="Specified value if missing from instance", description=( "The value that should be used if there is no value stated in the " "instance (e.g. 'if not otherwise specified, the abstract is false')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e defaultValue[x] "one_of_many": "defaultValue", "one_of_many_required": False, }, ) defaultValueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValueUuid", title="Extension field for ``defaultValueUuid``.", ) definition: fhirtypes.MarkdownType | None = Field( default=None, alias="definition", title="Full formal definition as narrative text", description=( "Provides a complete explanation of the meaning of the data element for" " human readability. For the case of elements derived from existing " "elements (e.g. constraints), the definition SHALL be consistent with " "the base definition, but convey the meaning of the element in the " "particular context of use of the resource. (Note: The text you are " "reading is specified in ElementDefinition.definition)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) example: typing.List[fhirtypes.ElementDefinitionExampleType] | None = Field( default=None, alias="example", title="Example value (as defined for type)", description=( "A sample value for this element demonstrating the type of information " "that would typically be found in the element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) fixedAddress: fhirtypes.AddressType | None = Field( default=None, alias="fixedAddress", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedAge: fhirtypes.AgeType | None = Field( default=None, alias="fixedAge", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="fixedAnnotation", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="fixedAttachment", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedAvailability: fhirtypes.AvailabilityType | None = Field( default=None, alias="fixedAvailability", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="fixedBase64Binary", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedBase64Binary", title="Extension field for ``fixedBase64Binary``.", ) fixedBoolean: bool | None = Field( default=None, alias="fixedBoolean", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedBoolean", title="Extension field for ``fixedBoolean``.", ) fixedCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="fixedCanonical", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedCanonical", title="Extension field for ``fixedCanonical``.", ) fixedCode: fhirtypes.CodeType | None = Field( default=None, alias="fixedCode", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedCode", title="Extension field for ``fixedCode``." ) fixedCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="fixedCodeableConcept", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedCodeableReference: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="fixedCodeableReference", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedCoding: fhirtypes.CodingType | None = Field( default=None, alias="fixedCoding", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedContactDetail: fhirtypes.ContactDetailType | None = Field( default=None, alias="fixedContactDetail", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="fixedContactPoint", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedCount: fhirtypes.CountType | None = Field( default=None, alias="fixedCount", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedDataRequirement: fhirtypes.DataRequirementType | None = Field( default=None, alias="fixedDataRequirement", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedDate: fhirtypes.DateType | None = Field( default=None, alias="fixedDate", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedDate", title="Extension field for ``fixedDate``." ) fixedDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="fixedDateTime", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedDateTime", title="Extension field for ``fixedDateTime``.", ) fixedDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="fixedDecimal", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedDecimal", title="Extension field for ``fixedDecimal``.", ) fixedDistance: fhirtypes.DistanceType | None = Field( default=None, alias="fixedDistance", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedDosage: fhirtypes.DosageType | None = Field( default=None, alias="fixedDosage", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedDuration: fhirtypes.DurationType | None = Field( default=None, alias="fixedDuration", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedExpression: fhirtypes.ExpressionType | None = Field( default=None, alias="fixedExpression", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedExtendedContactDetail: fhirtypes.ExtendedContactDetailType | None = Field( default=None, alias="fixedExtendedContactDetail", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="fixedHumanName", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedId: fhirtypes.IdType | None = Field( default=None, alias="fixedId", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedId", title="Extension field for ``fixedId``." ) fixedIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="fixedIdentifier", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedInstant: fhirtypes.InstantType | None = Field( default=None, alias="fixedInstant", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedInstant", title="Extension field for ``fixedInstant``.", ) fixedInteger: fhirtypes.IntegerType | None = Field( default=None, alias="fixedInteger", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedInteger", title="Extension field for ``fixedInteger``.", ) fixedInteger64: fhirtypes.Integer64Type | None = Field( default=None, alias="fixedInteger64", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedInteger64__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedInteger64", title="Extension field for ``fixedInteger64``.", ) fixedMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="fixedMarkdown", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedMarkdown", title="Extension field for ``fixedMarkdown``.", ) fixedMeta: fhirtypes.MetaType | None = Field( default=None, alias="fixedMeta", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedMoney: fhirtypes.MoneyType | None = Field( default=None, alias="fixedMoney", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedOid: fhirtypes.OidType | None = Field( default=None, alias="fixedOid", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedOid", title="Extension field for ``fixedOid``." ) fixedParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field( default=None, alias="fixedParameterDefinition", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="fixedPeriod", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedPositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="fixedPositiveInt", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedPositiveInt", title="Extension field for ``fixedPositiveInt``.", ) fixedQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="fixedQuantity", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedRange: fhirtypes.RangeType | None = Field( default=None, alias="fixedRange", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedRatio: fhirtypes.RatioType | None = Field( default=None, alias="fixedRatio", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedRatioRange: fhirtypes.RatioRangeType | None = Field( default=None, alias="fixedRatioRange", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedReference: fhirtypes.ReferenceType | None = Field( default=None, alias="fixedReference", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field( default=None, alias="fixedRelatedArtifact", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="fixedSampledData", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedSignature: fhirtypes.SignatureType | None = Field( default=None, alias="fixedSignature", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedString: fhirtypes.StringType | None = Field( default=None, alias="fixedString", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedString", title="Extension field for ``fixedString``." ) fixedTime: fhirtypes.TimeType | None = Field( default=None, alias="fixedTime", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedTime", title="Extension field for ``fixedTime``." ) fixedTiming: fhirtypes.TimingType | None = Field( default=None, alias="fixedTiming", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field( default=None, alias="fixedTriggerDefinition", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="fixedUnsignedInt", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedUnsignedInt", title="Extension field for ``fixedUnsignedInt``.", ) fixedUri: fhirtypes.UriType | None = Field( default=None, alias="fixedUri", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedUri", title="Extension field for ``fixedUri``." ) fixedUrl: fhirtypes.UrlType | None = Field( default=None, alias="fixedUrl", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedUrl", title="Extension field for ``fixedUrl``." ) fixedUsageContext: fhirtypes.UsageContextType | None = Field( default=None, alias="fixedUsageContext", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedUuid: fhirtypes.UuidType | None = Field( default=None, alias="fixedUuid", title="Value must be exactly this", description=( "Specifies a value that SHALL be exactly the value for this element in" " the instance, if present. For purposes of comparison, non-significant" " whitespace is ignored, and all values must be an exact match (case " "and accent sensitive). Missing elements/attributes must also be " "missing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fixed[x] "one_of_many": "fixed", "one_of_many_required": False, }, ) fixedUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fixedUuid", title="Extension field for ``fixedUuid``." ) isModifier: bool | None = Field( default=None, alias="isModifier", title="If this modifies the meaning of other elements", description=( "If true, the value of this element affects the interpretation of the " "element or resource that contains it, and the value of the element " "cannot be ignored. Typically, this is used for status, negation and " "qualification codes. The effect of this is that the element cannot be " "ignored by systems: they SHALL either recognize the element and " "process it, and/or a pre-determination has been made that it is not " "relevant to their particular system. When used on the root element in " "an extension definition, this indicates whether or not the extension " "is a modifier extension." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) isModifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isModifier", title="Extension field for ``isModifier``." ) isModifierReason: fhirtypes.StringType | None = Field( default=None, alias="isModifierReason", title="Reason that this element is marked as a modifier", description=( "Explains how that element affects the interpretation of the resource " "or element that contains it." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) isModifierReason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isModifierReason", title="Extension field for ``isModifierReason``.", ) isSummary: bool | None = Field( default=None, alias="isSummary", title="Include when _summary = true?", description=( "Whether the element should be included if a client requests a search " "with the parameter _summary=true." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) isSummary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isSummary", title="Extension field for ``isSummary``." ) label: fhirtypes.StringType | None = Field( default=None, alias="label", title="Name for element to display with or prompt for element", description=( "A single preferred label which is the text to display beside the " "element indicating its meaning or to use to prompt for the element in " "a user display or form." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_label", title="Extension field for ``label``." ) mapping: typing.List[fhirtypes.ElementDefinitionMappingType] | None = Field( default=None, alias="mapping", title="Map element to another set of definitions", description=( "Identifies a concept from an external specification that roughly " "corresponds to this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) max: fhirtypes.StringType | None = Field( default=None, alias="max", title="Maximum Cardinality (a number or *)", description=( "The maximum number of times this element is permitted to appear in the" " instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_max", title="Extension field for ``max``." ) maxLength: fhirtypes.IntegerType | None = Field( default=None, alias="maxLength", title="Max length for string type data", description=( "Indicates the maximum length in characters that is permitted to be " "present in conformant instances and which is expected to be supported " "by conformant consumers that support the element. ```maxLength``` " "SHOULD only be used on primitive data types that have a string " "representation (see " "[http://hl7.org/fhir/StructureDefinition/structuredefinition-type-" "characteristics](http://hl7.org/fhir/extensions/StructureDefinition-" "structuredefinition-type-characteristics.html))." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maxLength__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxLength", title="Extension field for ``maxLength``." ) maxValueDate: fhirtypes.DateType | None = Field( default=None, alias="maxValueDate", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValueDate", title="Extension field for ``maxValueDate``.", ) maxValueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="maxValueDateTime", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValueDateTime", title="Extension field for ``maxValueDateTime``.", ) maxValueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="maxValueDecimal", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValueDecimal", title="Extension field for ``maxValueDecimal``.", ) maxValueInstant: fhirtypes.InstantType | None = Field( default=None, alias="maxValueInstant", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValueInstant", title="Extension field for ``maxValueInstant``.", ) maxValueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="maxValueInteger", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValueInteger", title="Extension field for ``maxValueInteger``.", ) maxValueInteger64: fhirtypes.Integer64Type | None = Field( default=None, alias="maxValueInteger64", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueInteger64__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValueInteger64", title="Extension field for ``maxValueInteger64``.", ) maxValuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="maxValuePositiveInt", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValuePositiveInt", title="Extension field for ``maxValuePositiveInt``.", ) maxValueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="maxValueQuantity", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueTime: fhirtypes.TimeType | None = Field( default=None, alias="maxValueTime", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValueTime", title="Extension field for ``maxValueTime``.", ) maxValueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="maxValueUnsignedInt", title="Maximum Allowed Value (for some types)", description=( "The maximum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e maxValue[x] "one_of_many": "maxValue", "one_of_many_required": False, }, ) maxValueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxValueUnsignedInt", title="Extension field for ``maxValueUnsignedInt``.", ) meaningWhenMissing: fhirtypes.MarkdownType | None = Field( default=None, alias="meaningWhenMissing", title="Implicit meaning when this element is missing", description=( "The Implicit meaning that is to be understood when this element is " "missing (e.g. 'when this element is missing, the period is ongoing')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) meaningWhenMissing__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_meaningWhenMissing", title="Extension field for ``meaningWhenMissing``.", ) min: fhirtypes.UnsignedIntType | None = Field( default=None, alias="min", title="Minimum Cardinality", description="The minimum number of times this element SHALL appear in the instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_min", title="Extension field for ``min``." ) minValueDate: fhirtypes.DateType | None = Field( default=None, alias="minValueDate", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValueDate", title="Extension field for ``minValueDate``.", ) minValueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="minValueDateTime", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValueDateTime", title="Extension field for ``minValueDateTime``.", ) minValueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="minValueDecimal", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValueDecimal", title="Extension field for ``minValueDecimal``.", ) minValueInstant: fhirtypes.InstantType | None = Field( default=None, alias="minValueInstant", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValueInstant", title="Extension field for ``minValueInstant``.", ) minValueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="minValueInteger", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValueInteger", title="Extension field for ``minValueInteger``.", ) minValueInteger64: fhirtypes.Integer64Type | None = Field( default=None, alias="minValueInteger64", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueInteger64__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValueInteger64", title="Extension field for ``minValueInteger64``.", ) minValuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="minValuePositiveInt", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValuePositiveInt", title="Extension field for ``minValuePositiveInt``.", ) minValueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="minValueQuantity", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueTime: fhirtypes.TimeType | None = Field( default=None, alias="minValueTime", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValueTime", title="Extension field for ``minValueTime``.", ) minValueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="minValueUnsignedInt", title="Minimum Allowed Value (for some types)", description=( "The minimum allowed value for the element. The value is inclusive. " "This is allowed for the types date, dateTime, instant, time, decimal, " "integer, and Quantity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e minValue[x] "one_of_many": "minValue", "one_of_many_required": False, }, ) minValueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minValueUnsignedInt", title="Extension field for ``minValueUnsignedInt``.", ) mustHaveValue: bool | None = Field( default=None, alias="mustHaveValue", title=( "For primitives, that a value must be present - not replaced by an " "extension" ), description=( "Specifies for a primitive data type that the value of the data type " "cannot be replaced by an extension." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) mustHaveValue__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mustHaveValue", title="Extension field for ``mustHaveValue``.", ) mustSupport: bool | None = Field( default=None, alias="mustSupport", title="If the element must be supported (discouraged - see obligations)", description=( "If true, implementations that produce or consume resources SHALL " 'provide "support" for the element in some meaningful way. Note that ' "this is being phased out and replaced by obligations (see below). If " "false, the element may be ignored and not supported. If false, whether" " to populate or use the data element in any way is at the discretion " "of the implementation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) mustSupport__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mustSupport", title="Extension field for ``mustSupport``." ) orderMeaning: fhirtypes.StringType | None = Field( default=None, alias="orderMeaning", title="What the order of the elements means", description=( "If present, indicates that the order of the repeating element has " "meaning and describes what that meaning is. If absent, it means that " "the order of the element has no meaning." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) orderMeaning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_orderMeaning", title="Extension field for ``orderMeaning``.", ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="Path of the element in the hierarchy of elements", description=( 'The path identifies the element and is expressed as a "."-separated ' "list of ancestor elements, beginning with the name of the resource or " "extension." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) patternAddress: fhirtypes.AddressType | None = Field( default=None, alias="patternAddress", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternAge: fhirtypes.AgeType | None = Field( default=None, alias="patternAge", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="patternAnnotation", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="patternAttachment", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternAvailability: fhirtypes.AvailabilityType | None = Field( default=None, alias="patternAvailability", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="patternBase64Binary", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternBase64Binary", title="Extension field for ``patternBase64Binary``.", ) patternBoolean: bool | None = Field( default=None, alias="patternBoolean", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternBoolean", title="Extension field for ``patternBoolean``.", ) patternCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="patternCanonical", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternCanonical", title="Extension field for ``patternCanonical``.", ) patternCode: fhirtypes.CodeType | None = Field( default=None, alias="patternCode", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternCode", title="Extension field for ``patternCode``." ) patternCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="patternCodeableConcept", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternCodeableReference: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="patternCodeableReference", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternCoding: fhirtypes.CodingType | None = Field( default=None, alias="patternCoding", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternContactDetail: fhirtypes.ContactDetailType | None = Field( default=None, alias="patternContactDetail", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="patternContactPoint", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternCount: fhirtypes.CountType | None = Field( default=None, alias="patternCount", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternDataRequirement: fhirtypes.DataRequirementType | None = Field( default=None, alias="patternDataRequirement", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternDate: fhirtypes.DateType | None = Field( default=None, alias="patternDate", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternDate", title="Extension field for ``patternDate``." ) patternDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="patternDateTime", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternDateTime", title="Extension field for ``patternDateTime``.", ) patternDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="patternDecimal", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternDecimal", title="Extension field for ``patternDecimal``.", ) patternDistance: fhirtypes.DistanceType | None = Field( default=None, alias="patternDistance", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternDosage: fhirtypes.DosageType | None = Field( default=None, alias="patternDosage", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternDuration: fhirtypes.DurationType | None = Field( default=None, alias="patternDuration", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternExpression: fhirtypes.ExpressionType | None = Field( default=None, alias="patternExpression", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternExtendedContactDetail: fhirtypes.ExtendedContactDetailType | None = Field( default=None, alias="patternExtendedContactDetail", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="patternHumanName", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternId: fhirtypes.IdType | None = Field( default=None, alias="patternId", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternId", title="Extension field for ``patternId``." ) patternIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="patternIdentifier", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternInstant: fhirtypes.InstantType | None = Field( default=None, alias="patternInstant", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternInstant", title="Extension field for ``patternInstant``.", ) patternInteger: fhirtypes.IntegerType | None = Field( default=None, alias="patternInteger", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternInteger", title="Extension field for ``patternInteger``.", ) patternInteger64: fhirtypes.Integer64Type | None = Field( default=None, alias="patternInteger64", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternInteger64__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternInteger64", title="Extension field for ``patternInteger64``.", ) patternMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="patternMarkdown", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternMarkdown", title="Extension field for ``patternMarkdown``.", ) patternMeta: fhirtypes.MetaType | None = Field( default=None, alias="patternMeta", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternMoney: fhirtypes.MoneyType | None = Field( default=None, alias="patternMoney", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternOid: fhirtypes.OidType | None = Field( default=None, alias="patternOid", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternOid", title="Extension field for ``patternOid``." ) patternParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field( default=None, alias="patternParameterDefinition", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="patternPeriod", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternPositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="patternPositiveInt", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternPositiveInt", title="Extension field for ``patternPositiveInt``.", ) patternQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="patternQuantity", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternRange: fhirtypes.RangeType | None = Field( default=None, alias="patternRange", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternRatio: fhirtypes.RatioType | None = Field( default=None, alias="patternRatio", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternRatioRange: fhirtypes.RatioRangeType | None = Field( default=None, alias="patternRatioRange", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternReference: fhirtypes.ReferenceType | None = Field( default=None, alias="patternReference", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field( default=None, alias="patternRelatedArtifact", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="patternSampledData", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternSignature: fhirtypes.SignatureType | None = Field( default=None, alias="patternSignature", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternString: fhirtypes.StringType | None = Field( default=None, alias="patternString", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternString", title="Extension field for ``patternString``.", ) patternTime: fhirtypes.TimeType | None = Field( default=None, alias="patternTime", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternTime", title="Extension field for ``patternTime``." ) patternTiming: fhirtypes.TimingType | None = Field( default=None, alias="patternTiming", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field( default=None, alias="patternTriggerDefinition", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="patternUnsignedInt", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternUnsignedInt", title="Extension field for ``patternUnsignedInt``.", ) patternUri: fhirtypes.UriType | None = Field( default=None, alias="patternUri", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternUri", title="Extension field for ``patternUri``." ) patternUrl: fhirtypes.UrlType | None = Field( default=None, alias="patternUrl", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternUrl", title="Extension field for ``patternUrl``." ) patternUsageContext: fhirtypes.UsageContextType | None = Field( default=None, alias="patternUsageContext", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternUuid: fhirtypes.UuidType | None = Field( default=None, alias="patternUuid", title="Value must have at least these property values", description=( "Specifies a value that each occurrence of the element in the instance " "SHALL follow - that is, any value in the pattern must be found in the " "instance, if the element has a value. Other additional values may be " "found too. This is effectively constraint by example. When " "pattern[x] is used to constrain a primitive, it means that the value " "provided in the pattern[x] must match the instance value exactly. " "When an element within a pattern[x] is used to constrain an array, it " "means that each element provided in the pattern[x] must (recursively) " "match at least one element from the instance array. When pattern[x] " "is used to constrain a complex object, it means that each property in " "the pattern must be present in the complex object, and its value must " "recursively match -- i.e., 1. If primitive: it must match exactly the" " pattern value 2. If a complex object: it must match (recursively) the" " pattern value 3. If an array: it must match (recursively) the pattern" " value If a pattern[x] is declared on a repeating element, the " "pattern applies to all repetitions. If the desire is for a pattern to" " apply to only one element or a subset of elements, slicing must be " "used. See [Examples of Patterns](elementdefinition-" "examples.html#pattern-examples) for examples of pattern usage and the " "effect it will have." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e pattern[x] "one_of_many": "pattern", "one_of_many_required": False, }, ) patternUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_patternUuid", title="Extension field for ``patternUuid``." ) representation: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="representation", title="xmlAttr | xmlText | typeAttr | cdaText | xhtml", description=( "Codes that define how this element is represented in instances, when " "the deviation varies from the normal case. No extensions are allowed " "on elements with a representation of 'xmlAttr', no matter what FHIR " "serialization format is used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["xmlAttr", "xmlText", "typeAttr", "cdaText", "xhtml"], }, ) representation__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_representation", title="Extension field for ``representation``.", ) requirements: fhirtypes.MarkdownType | None = Field( default=None, alias="requirements", title="Why this resource has been created", description=( "This element is for traceability of why the element was created and " "why the constraints exist as they do. This may be used to point to " "source materials or specifications that drove the structure of this " "element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) requirements__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requirements", title="Extension field for ``requirements``.", ) short: fhirtypes.StringType | None = Field( default=None, alias="short", title="Concise definition for space-constrained presentation", description=( "A concise description of what this element means (e.g. for use in " "autogenerated summaries)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) short__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_short", title="Extension field for ``short``." ) sliceIsConstraining: bool | None = Field( default=None, alias="sliceIsConstraining", title=( "If this slice definition constrains an inherited slice definition (or " "not)" ), description=( "If true, indicates that this slice definition is constraining a slice " "definition with the same name in an inherited profile. If false, the " "slice is not overriding any slice in an inherited profile. If missing," " the slice might or might not be overriding a slice in an inherited " "profile, depending on the sliceName." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sliceIsConstraining__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sliceIsConstraining", title="Extension field for ``sliceIsConstraining``.", ) sliceName: fhirtypes.StringType | None = Field( default=None, alias="sliceName", title="Name for this particular element (in a set of slices)", description=( "The name of this element definition slice, when slicing is working. " "The name must be a token with no dots or spaces. This is a unique name" " referring to a specific set of constraints applied to this element, " "used to provide a name to different slices of the same element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sliceName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sliceName", title="Extension field for ``sliceName``." ) slicing: fhirtypes.ElementDefinitionSlicingType | None = Field( default=None, alias="slicing", title="This element is sliced - slices follow", description=( "Indicates that the element is sliced into a set of alternative " "definitions (i.e. in a structure definition, there are multiple " "different constraints on a single element in the base resource). " "Slicing can be used in any resource that has cardinality ..* on the " "base resource, or any resource with a choice of types. The set of " "slices is any elements that come after this in the element sequence " "that have the same path, until a shorter path occurs (the shorter path" " terminates the set)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: typing.List[fhirtypes.ElementDefinitionTypeType] | None = Field( default=None, alias="type", title="Data type and Profile for this element", description=( "The data type or resource that the value of this element is permitted " "to be." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueAlternatives: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="valueAlternatives", title="Extensions that are allowed to replace a primitive value", description=( "Specifies a list of extensions that can appear in place of a primitive" " value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) valueAlternatives__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_valueAlternatives", title="Extension field for ``valueAlternatives``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "path", "representation", "sliceName", "sliceIsConstraining", "label", "code", "slicing", "short", "definition", "comment", "requirements", "alias", "min", "max", "base", "contentReference", "type", "defaultValueBase64Binary", "defaultValueBoolean", "defaultValueCanonical", "defaultValueCode", "defaultValueDate", "defaultValueDateTime", "defaultValueDecimal", "defaultValueId", "defaultValueInstant", "defaultValueInteger", "defaultValueInteger64", "defaultValueMarkdown", "defaultValueOid", "defaultValuePositiveInt", "defaultValueString", "defaultValueTime", "defaultValueUnsignedInt", "defaultValueUri", "defaultValueUrl", "defaultValueUuid", "defaultValueAddress", "defaultValueAge", "defaultValueAnnotation", "defaultValueAttachment", "defaultValueCodeableConcept", "defaultValueCodeableReference", "defaultValueCoding", "defaultValueContactPoint", "defaultValueCount", "defaultValueDistance", "defaultValueDuration", "defaultValueHumanName", "defaultValueIdentifier", "defaultValueMoney", "defaultValuePeriod", "defaultValueQuantity", "defaultValueRange", "defaultValueRatio", "defaultValueRatioRange", "defaultValueReference", "defaultValueSampledData", "defaultValueSignature", "defaultValueTiming", "defaultValueContactDetail", "defaultValueDataRequirement", "defaultValueExpression", "defaultValueParameterDefinition", "defaultValueRelatedArtifact", "defaultValueTriggerDefinition", "defaultValueUsageContext", "defaultValueAvailability", "defaultValueExtendedContactDetail", "defaultValueDosage", "defaultValueMeta", "meaningWhenMissing", "orderMeaning", "fixedBase64Binary", "fixedBoolean", "fixedCanonical", "fixedCode", "fixedDate", "fixedDateTime", "fixedDecimal", "fixedId", "fixedInstant", "fixedInteger", "fixedInteger64", "fixedMarkdown", "fixedOid", "fixedPositiveInt", "fixedString", "fixedTime", "fixedUnsignedInt", "fixedUri", "fixedUrl", "fixedUuid", "fixedAddress", "fixedAge", "fixedAnnotation", "fixedAttachment", "fixedCodeableConcept", "fixedCodeableReference", "fixedCoding", "fixedContactPoint", "fixedCount", "fixedDistance", "fixedDuration", "fixedHumanName", "fixedIdentifier", "fixedMoney", "fixedPeriod", "fixedQuantity", "fixedRange", "fixedRatio", "fixedRatioRange", "fixedReference", "fixedSampledData", "fixedSignature", "fixedTiming", "fixedContactDetail", "fixedDataRequirement", "fixedExpression", "fixedParameterDefinition", "fixedRelatedArtifact", "fixedTriggerDefinition", "fixedUsageContext", "fixedAvailability", "fixedExtendedContactDetail", "fixedDosage", "fixedMeta", "patternBase64Binary", "patternBoolean", "patternCanonical", "patternCode", "patternDate", "patternDateTime", "patternDecimal", "patternId", "patternInstant", "patternInteger", "patternInteger64", "patternMarkdown", "patternOid", "patternPositiveInt", "patternString", "patternTime", "patternUnsignedInt", "patternUri", "patternUrl", "patternUuid", "patternAddress", "patternAge", "patternAnnotation", "patternAttachment", "patternCodeableConcept", "patternCodeableReference", "patternCoding", "patternContactPoint", "patternCount", "patternDistance", "patternDuration", "patternHumanName", "patternIdentifier", "patternMoney", "patternPeriod", "patternQuantity", "patternRange", "patternRatio", "patternRatioRange", "patternReference", "patternSampledData", "patternSignature", "patternTiming", "patternContactDetail", "patternDataRequirement", "patternExpression", "patternParameterDefinition", "patternRelatedArtifact", "patternTriggerDefinition", "patternUsageContext", "patternAvailability", "patternExtendedContactDetail", "patternDosage", "patternMeta", "example", "minValueDate", "minValueDateTime", "minValueInstant", "minValueTime", "minValueDecimal", "minValueInteger", "minValueInteger64", "minValuePositiveInt", "minValueUnsignedInt", "minValueQuantity", "maxValueDate", "maxValueDateTime", "maxValueInstant", "maxValueTime", "maxValueDecimal", "maxValueInteger", "maxValueInteger64", "maxValuePositiveInt", "maxValueUnsignedInt", "maxValueQuantity", "maxLength", "condition", "constraint", "mustHaveValue", "valueAlternatives", "mustSupport", "isModifier", "isModifierReason", "isSummary", "binding", "mapping", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinition`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "path", "representation", "sliceName", "sliceIsConstraining", "label", "code", "slicing", "short", "definition", "comment", "requirements", "alias", "min", "max", "base", "contentReference", "type", "defaultValueBase64Binary", "defaultValueBoolean", "defaultValueCanonical", "defaultValueCode", "defaultValueDate", "defaultValueDateTime", "defaultValueDecimal", "defaultValueId", "defaultValueInstant", "defaultValueInteger", "defaultValueInteger64", "defaultValueMarkdown", "defaultValueOid", "defaultValuePositiveInt", "defaultValueString", "defaultValueTime", "defaultValueUnsignedInt", "defaultValueUri", "defaultValueUrl", "defaultValueUuid", "defaultValueAddress", "defaultValueAge", "defaultValueAnnotation", "defaultValueAttachment", "defaultValueCodeableConcept", "defaultValueCodeableReference", "defaultValueCoding", "defaultValueContactPoint", "defaultValueCount", "defaultValueDistance", "defaultValueDuration", "defaultValueHumanName", "defaultValueIdentifier", "defaultValueMoney", "defaultValuePeriod", "defaultValueQuantity", "defaultValueRange", "defaultValueRatio", "defaultValueRatioRange", "defaultValueReference", "defaultValueSampledData", "defaultValueSignature", "defaultValueTiming", "defaultValueContactDetail", "defaultValueDataRequirement", "defaultValueExpression", "defaultValueParameterDefinition", "defaultValueRelatedArtifact", "defaultValueTriggerDefinition", "defaultValueUsageContext", "defaultValueAvailability", "defaultValueExtendedContactDetail", "defaultValueDosage", "defaultValueMeta", "meaningWhenMissing", "orderMeaning", "fixedBase64Binary", "fixedBoolean", "fixedCanonical", "fixedCode", "fixedDate", "fixedDateTime", "fixedDecimal", "fixedId", "fixedInstant", "fixedInteger", "fixedInteger64", "fixedMarkdown", "fixedOid", "fixedPositiveInt", "fixedString", "fixedTime", "fixedUnsignedInt", "fixedUri", "fixedUrl", "fixedUuid", "fixedAddress", "fixedAge", "fixedAnnotation", "fixedAttachment", "fixedCodeableConcept", "fixedCodeableReference", "fixedCoding", "fixedContactPoint", "fixedCount", "fixedDistance", "fixedDuration", "fixedHumanName", "fixedIdentifier", "fixedMoney", "fixedPeriod", "fixedQuantity", "fixedRange", "fixedRatio", "fixedRatioRange", "fixedReference", "fixedSampledData", "fixedSignature", "fixedTiming", "fixedContactDetail", "fixedDataRequirement", "fixedExpression", "fixedParameterDefinition", "fixedRelatedArtifact", "fixedTriggerDefinition", "fixedUsageContext", "fixedAvailability", "fixedExtendedContactDetail", "fixedDosage", "fixedMeta", "patternBase64Binary", "patternBoolean", "patternCanonical", "patternCode", "patternDate", "patternDateTime", "patternDecimal", "patternId", "patternInstant", "patternInteger", "patternInteger64", "patternMarkdown", "patternOid", "patternPositiveInt", "patternString", "patternTime", "patternUnsignedInt", "patternUri", "patternUrl", "patternUuid", "patternAddress", "patternAge", "patternAnnotation", "patternAttachment", "patternCodeableConcept", "patternCodeableReference", "patternCoding", "patternContactPoint", "patternCount", "patternDistance", "patternDuration", "patternHumanName", "patternIdentifier", "patternMoney", "patternPeriod", "patternQuantity", "patternRange", "patternRatio", "patternRatioRange", "patternReference", "patternSampledData", "patternSignature", "patternTiming", "patternContactDetail", "patternDataRequirement", "patternExpression", "patternParameterDefinition", "patternRelatedArtifact", "patternTriggerDefinition", "patternUsageContext", "patternAvailability", "patternExtendedContactDetail", "patternDosage", "patternMeta", "example", "minValueDate", "minValueDateTime", "minValueInstant", "minValueTime", "minValueDecimal", "minValueInteger", "minValueInteger64", "minValuePositiveInt", "minValueUnsignedInt", "minValueQuantity", "maxValueDate", "maxValueDateTime", "maxValueInstant", "maxValueTime", "maxValueDecimal", "maxValueInteger", "maxValueInteger64", "maxValuePositiveInt", "maxValueUnsignedInt", "maxValueQuantity", "maxLength", "condition", "constraint", "mustHaveValue", "valueAlternatives", "mustSupport", "isModifier", "isModifierReason", "isSummary", "binding", "mapping", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("path", "path__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "defaultValue": [ "defaultValueAddress", "defaultValueAge", "defaultValueAnnotation", "defaultValueAttachment", "defaultValueAvailability", "defaultValueBase64Binary", "defaultValueBoolean", "defaultValueCanonical", "defaultValueCode", "defaultValueCodeableConcept", "defaultValueCodeableReference", "defaultValueCoding", "defaultValueContactDetail", "defaultValueContactPoint", "defaultValueCount", "defaultValueDataRequirement", "defaultValueDate", "defaultValueDateTime", "defaultValueDecimal", "defaultValueDistance", "defaultValueDosage", "defaultValueDuration", "defaultValueExpression", "defaultValueExtendedContactDetail", "defaultValueHumanName", "defaultValueId", "defaultValueIdentifier", "defaultValueInstant", "defaultValueInteger", "defaultValueInteger64", "defaultValueMarkdown", "defaultValueMeta", "defaultValueMoney", "defaultValueOid", "defaultValueParameterDefinition", "defaultValuePeriod", "defaultValuePositiveInt", "defaultValueQuantity", "defaultValueRange", "defaultValueRatio", "defaultValueRatioRange", "defaultValueReference", "defaultValueRelatedArtifact", "defaultValueSampledData", "defaultValueSignature", "defaultValueString", "defaultValueTime", "defaultValueTiming", "defaultValueTriggerDefinition", "defaultValueUnsignedInt", "defaultValueUri", "defaultValueUrl", "defaultValueUsageContext", "defaultValueUuid", ], "fixed": [ "fixedAddress", "fixedAge", "fixedAnnotation", "fixedAttachment", "fixedAvailability", "fixedBase64Binary", "fixedBoolean", "fixedCanonical", "fixedCode", "fixedCodeableConcept", "fixedCodeableReference", "fixedCoding", "fixedContactDetail", "fixedContactPoint", "fixedCount", "fixedDataRequirement", "fixedDate", "fixedDateTime", "fixedDecimal", "fixedDistance", "fixedDosage", "fixedDuration", "fixedExpression", "fixedExtendedContactDetail", "fixedHumanName", "fixedId", "fixedIdentifier", "fixedInstant", "fixedInteger", "fixedInteger64", "fixedMarkdown", "fixedMeta", "fixedMoney", "fixedOid", "fixedParameterDefinition", "fixedPeriod", "fixedPositiveInt", "fixedQuantity", "fixedRange", "fixedRatio", "fixedRatioRange", "fixedReference", "fixedRelatedArtifact", "fixedSampledData", "fixedSignature", "fixedString", "fixedTime", "fixedTiming", "fixedTriggerDefinition", "fixedUnsignedInt", "fixedUri", "fixedUrl", "fixedUsageContext", "fixedUuid", ], "maxValue": [ "maxValueDate", "maxValueDateTime", "maxValueDecimal", "maxValueInstant", "maxValueInteger", "maxValueInteger64", "maxValuePositiveInt", "maxValueQuantity", "maxValueTime", "maxValueUnsignedInt", ], "minValue": [ "minValueDate", "minValueDateTime", "minValueDecimal", "minValueInstant", "minValueInteger", "minValueInteger64", "minValuePositiveInt", "minValueQuantity", "minValueTime", "minValueUnsignedInt", ], "pattern": [ "patternAddress", "patternAge", "patternAnnotation", "patternAttachment", "patternAvailability", "patternBase64Binary", "patternBoolean", "patternCanonical", "patternCode", "patternCodeableConcept", "patternCodeableReference", "patternCoding", "patternContactDetail", "patternContactPoint", "patternCount", "patternDataRequirement", "patternDate", "patternDateTime", "patternDecimal", "patternDistance", "patternDosage", "patternDuration", "patternExpression", "patternExtendedContactDetail", "patternHumanName", "patternId", "patternIdentifier", "patternInstant", "patternInteger", "patternInteger64", "patternMarkdown", "patternMeta", "patternMoney", "patternOid", "patternParameterDefinition", "patternPeriod", "patternPositiveInt", "patternQuantity", "patternRange", "patternRatio", "patternRatioRange", "patternReference", "patternRelatedArtifact", "patternSampledData", "patternSignature", "patternString", "patternTime", "patternTiming", "patternTriggerDefinition", "patternUnsignedInt", "patternUri", "patternUrl", "patternUsageContext", "patternUuid", ], } return one_of_many_fields class ElementDefinitionBase(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Base definition information for tools. Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. When the element definition is not the original definition of an element - e.g. either in a constraint on another type, or for elements from a super type in a snap shot - then the information in provided in the element definition may be different to the base definition. On the original definition of the element, it will be same. """ __resource_type__ = "ElementDefinitionBase" max: fhirtypes.StringType | None = Field( default=None, alias="max", title="Max cardinality of the base element", description="Maximum cardinality of the base element identified by the path.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_max", title="Extension field for ``max``." ) min: fhirtypes.UnsignedIntType | None = Field( default=None, alias="min", title="Min cardinality of the base element", description="Minimum cardinality of the base element identified by the path.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_min", title="Extension field for ``min``." ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="Path that identifies the base element", description=( "The Path that identifies the base element - this matches the " "ElementDefinition.path for that element. Across FHIR, there is only " "one base definition of any element - that is, an element definition on" " a [StructureDefinition](structuredefinition.html#) without a " "StructureDefinition.base." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionBase`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "path", "min", "max"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionBase`` according to specification, with preserving the original sequence order. """ return ["path", "min", "max"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("max", "max__ext"), ("min", "min__ext"), ("path", "path__ext"), ] return required_fields class ElementDefinitionBinding(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. ValueSet details if this is coded. Binds to a value set if this element is coded (code, Coding, CodeableConcept, Quantity), or the data types (string, uri). """ __resource_type__ = "ElementDefinitionBinding" additional: typing.List[ fhirtypes.ElementDefinitionBindingAdditionalType ] | None = Field( default=None, alias="additional", title="Additional Bindings - more rules about the binding", description=( "Additional bindings that help applications implementing this element. " "Additional bindings do not replace the main binding but provide more " "information and/or context." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Intended use of codes in the bound value set", description="Describes the intended use of this particular set of codes.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) strength: fhirtypes.CodeType | None = Field( default=None, alias="strength", title="required | extensible | preferred | example", description=( "Indicates the degree of conformance expectations associated with this " "binding - that is, the degree to which the provided value set must be " "adhered to in the instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["required", "extensible", "preferred", "example"], }, ) strength__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_strength", title="Extension field for ``strength``." ) valueSet: fhirtypes.CanonicalType | None = Field( default=None, alias="valueSet", title="Source of value set", description=( "Refers to the value set that identifies the set of codes the binding " "refers to." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueSet", title="Extension field for ``valueSet``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionBinding`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "strength", "description", "valueSet", "additional"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionBinding`` according to specification, with preserving the original sequence order. """ return ["strength", "description", "valueSet", "additional"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("strength", "strength__ext")] return required_fields class ElementDefinitionBindingAdditional(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional Bindings - more rules about the binding. Additional bindings that help applications implementing this element. Additional bindings do not replace the main binding but provide more information and/or context. """ __resource_type__ = "ElementDefinitionBindingAdditional" any: bool | None = Field( default=None, alias="any", title="Whether binding can applies to all repeats, or just one", description=( "Whether the binding applies to all repeats, or just to any one of " "them. This is only relevant for elements that can repeat." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) any__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_any", title="Extension field for ``any``." ) documentation: fhirtypes.MarkdownType | None = Field( default=None, alias="documentation", title="Documentation of the purpose of use of the binding", description=( "Documentation of the purpose of use of the bindingproviding additional" " information about how it is intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) purpose: fhirtypes.CodeType | None = Field( default=None, alias="purpose", title=( "maximum | minimum | required | extensible | candidate | current | " "preferred | ui | starter | component" ), description="The use of this additional binding.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "maximum", "minimum", "required", "extensible", "candidate", "current", "preferred", "ui", "starter", "component", ], }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) shortDoco: fhirtypes.StringType | None = Field( default=None, alias="shortDoco", title="Concise documentation - for summary tables", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) shortDoco__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_shortDoco", title="Extension field for ``shortDoco``." ) usage: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="usage", title="Qualifies the usage - jurisdiction, gender, workflow status etc.", description=( "Qualifies the usage of the binding. Typically bindings are qualified " "by jurisdiction, but they may also be qualified by gender, workflow " "status, clinical domain etc. The information to decide whether a usege" " context applies is usually outside the resource, determined by " "context, and this might present challenges for validation tooling." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueSet: fhirtypes.CanonicalType | None = Field( default=None, alias="valueSet", title="The value set for the additional binding", description="The valueSet that is being bound for the purpose.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueSet", title="Extension field for ``valueSet``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionBindingAdditional`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "purpose", "valueSet", "documentation", "shortDoco", "usage", "any", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionBindingAdditional`` according to specification, with preserving the original sequence order. """ return ["purpose", "valueSet", "documentation", "shortDoco", "usage", "any"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("purpose", "purpose__ext"), ("valueSet", "valueSet__ext")] return required_fields class ElementDefinitionConstraint(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Condition that must evaluate to true. Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance. """ __resource_type__ = "ElementDefinitionConstraint" expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="FHIRPath expression of constraint", description=( "A [FHIRPath](fhirpath.html) expression of constraint that can be " "executed to see if this constraint is met." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) human: fhirtypes.StringType | None = Field( default=None, alias="human", title="Human description of constraint", description=( "Text that can be used to describe the constraint in messages " "identifying that the constraint has been violated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) human__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_human", title="Extension field for ``human``." ) key: fhirtypes.IdType | None = Field( default=None, alias="key", title="Target of 'condition' reference above", description=( "Allows identification of which elements have their cardinalities " "impacted by the constraint. Will not be referenced for constraints " "that do not affect cardinality." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) key__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_key", title="Extension field for ``key``." ) requirements: fhirtypes.MarkdownType | None = Field( default=None, alias="requirements", title="Why this constraint is necessary or appropriate", description="Description of why this constraint is necessary or appropriate.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) requirements__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requirements", title="Extension field for ``requirements``.", ) severity: fhirtypes.CodeType | None = Field( default=None, alias="severity", title="error | warning", description=( "Identifies the impact constraint violation has on the conformance of " "the instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["error", "warning"], }, ) severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_severity", title="Extension field for ``severity``." ) source: fhirtypes.CanonicalType | None = Field( default=None, alias="source", title="Reference to original source of constraint", description=( "A reference to the original source of the constraint, for traceability" " purposes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_source", title="Extension field for ``source``." ) suppress: bool | None = Field( default=None, alias="suppress", title="Suppress warning or hint in profile", description=( "If true, indicates that the warning or best practice guideline should " "be suppressed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) suppress__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_suppress", title="Extension field for ``suppress``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionConstraint`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "key", "requirements", "severity", "suppress", "human", "expression", "source", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionConstraint`` according to specification, with preserving the original sequence order. """ return [ "key", "requirements", "severity", "suppress", "human", "expression", "source", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("human", "human__ext"), ("key", "key__ext"), ("severity", "severity__ext"), ] return required_fields class ElementDefinitionExample(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Example value (as defined for type). A sample value for this element demonstrating the type of information that would typically be found in the element. """ __resource_type__ = "ElementDefinitionExample" label: fhirtypes.StringType | None = Field( default=None, alias="label", title="Describes the purpose of this example", description="Describes the purpose of this example among the set of examples.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_label", title="Extension field for ``label``." ) valueAddress: fhirtypes.AddressType | None = Field( default=None, alias="valueAddress", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAge: fhirtypes.AgeType | None = Field( default=None, alias="valueAge", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="valueAnnotation", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAvailability: fhirtypes.AvailabilityType | None = Field( default=None, alias="valueAvailability", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="valueBase64Binary", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBase64Binary", title="Extension field for ``valueBase64Binary``.", ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="valueCanonical", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCanonical", title="Extension field for ``valueCanonical``.", ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCodeableReference: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="valueCodeableReference", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueContactDetail: fhirtypes.ContactDetailType | None = Field( default=None, alias="valueContactDetail", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="valueContactPoint", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCount: fhirtypes.CountType | None = Field( default=None, alias="valueCount", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDataRequirement: fhirtypes.DataRequirementType | None = Field( default=None, alias="valueDataRequirement", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueDistance: fhirtypes.DistanceType | None = Field( default=None, alias="valueDistance", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDosage: fhirtypes.DosageType | None = Field( default=None, alias="valueDosage", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDuration: fhirtypes.DurationType | None = Field( default=None, alias="valueDuration", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueExpression: fhirtypes.ExpressionType | None = Field( default=None, alias="valueExpression", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueExtendedContactDetail: fhirtypes.ExtendedContactDetailType | None = Field( default=None, alias="valueExtendedContactDetail", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="valueHumanName", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId: fhirtypes.IdType | None = Field( default=None, alias="valueId", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueId", title="Extension field for ``valueId``." ) valueIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="valueIdentifier", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInstant: fhirtypes.InstantType | None = Field( default=None, alias="valueInstant", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInstant", title="Extension field for ``valueInstant``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueInteger64: fhirtypes.Integer64Type | None = Field( default=None, alias="valueInteger64", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger64__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger64", title="Extension field for ``valueInteger64``.", ) valueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="valueMarkdown", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueMarkdown", title="Extension field for ``valueMarkdown``.", ) valueMeta: fhirtypes.MetaType | None = Field( default=None, alias="valueMeta", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueMoney: fhirtypes.MoneyType | None = Field( default=None, alias="valueMoney", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueOid: fhirtypes.OidType | None = Field( default=None, alias="valueOid", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueOid", title="Extension field for ``valueOid``." ) valueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field( default=None, alias="valueParameterDefinition", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="valuePositiveInt", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valuePositiveInt", title="Extension field for ``valuePositiveInt``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRatioRange: fhirtypes.RatioRangeType | None = Field( default=None, alias="valueRatioRange", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field( default=None, alias="valueRelatedArtifact", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="valueSampledData", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueSignature: fhirtypes.SignatureType | None = Field( default=None, alias="valueSignature", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) valueTiming: fhirtypes.TimingType | None = Field( default=None, alias="valueTiming", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field( default=None, alias="valueTriggerDefinition", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="valueUnsignedInt", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUnsignedInt", title="Extension field for ``valueUnsignedInt``.", ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) valueUrl: fhirtypes.UrlType | None = Field( default=None, alias="valueUrl", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUrl", title="Extension field for ``valueUrl``." ) valueUsageContext: fhirtypes.UsageContextType | None = Field( default=None, alias="valueUsageContext", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUuid: fhirtypes.UuidType | None = Field( default=None, alias="valueUuid", title="Value of Example (one of allowed types)", description=( "The actual value for the element, which must be one of the types " "allowed for this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUuid", title="Extension field for ``valueUuid``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionExample`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "label", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInstant", "valueInteger", "valueInteger64", "valueMarkdown", "valueOid", "valuePositiveInt", "valueString", "valueTime", "valueUnsignedInt", "valueUri", "valueUrl", "valueUuid", "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueCodeableConcept", "valueCodeableReference", "valueCoding", "valueContactPoint", "valueCount", "valueDistance", "valueDuration", "valueHumanName", "valueIdentifier", "valueMoney", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueRatioRange", "valueReference", "valueSampledData", "valueSignature", "valueTiming", "valueContactDetail", "valueDataRequirement", "valueExpression", "valueParameterDefinition", "valueRelatedArtifact", "valueTriggerDefinition", "valueUsageContext", "valueAvailability", "valueExtendedContactDetail", "valueDosage", "valueMeta", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionExample`` according to specification, with preserving the original sequence order. """ return [ "label", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInstant", "valueInteger", "valueInteger64", "valueMarkdown", "valueOid", "valuePositiveInt", "valueString", "valueTime", "valueUnsignedInt", "valueUri", "valueUrl", "valueUuid", "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueCodeableConcept", "valueCodeableReference", "valueCoding", "valueContactPoint", "valueCount", "valueDistance", "valueDuration", "valueHumanName", "valueIdentifier", "valueMoney", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueRatioRange", "valueReference", "valueSampledData", "valueSignature", "valueTiming", "valueContactDetail", "valueDataRequirement", "valueExpression", "valueParameterDefinition", "valueRelatedArtifact", "valueTriggerDefinition", "valueUsageContext", "valueAvailability", "valueExtendedContactDetail", "valueDosage", "valueMeta", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("label", "label__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueAvailability", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueCodeableConcept", "valueCodeableReference", "valueCoding", "valueContactDetail", "valueContactPoint", "valueCount", "valueDataRequirement", "valueDate", "valueDateTime", "valueDecimal", "valueDistance", "valueDosage", "valueDuration", "valueExpression", "valueExtendedContactDetail", "valueHumanName", "valueId", "valueIdentifier", "valueInstant", "valueInteger", "valueInteger64", "valueMarkdown", "valueMeta", "valueMoney", "valueOid", "valueParameterDefinition", "valuePeriod", "valuePositiveInt", "valueQuantity", "valueRange", "valueRatio", "valueRatioRange", "valueReference", "valueRelatedArtifact", "valueSampledData", "valueSignature", "valueString", "valueTime", "valueTiming", "valueTriggerDefinition", "valueUnsignedInt", "valueUri", "valueUrl", "valueUsageContext", "valueUuid", ] } return one_of_many_fields class ElementDefinitionMapping(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Map element to another set of definitions. Identifies a concept from an external specification that roughly corresponds to this element. """ __resource_type__ = "ElementDefinitionMapping" comment: fhirtypes.MarkdownType | None = Field( default=None, alias="comment", title="Comments about the mapping or its use", description="Comments that provide information about the mapping or its use.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) identity: fhirtypes.IdType | None = Field( default=None, alias="identity", title="Reference to mapping declaration", description="An internal reference to the definition of a mapping.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) identity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_identity", title="Extension field for ``identity``." ) language: fhirtypes.CodeType | None = Field( default=None, alias="language", title="Computable language of mapping", description="Identifies the computable language in which mapping.map is expressed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) map: fhirtypes.StringType | None = Field( default=None, alias="map", title="Details of the mapping", description=( "Expresses what part of the target specification corresponds to this " "element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) map__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_map", title="Extension field for ``map``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionMapping`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "identity", "language", "map", "comment"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionMapping`` according to specification, with preserving the original sequence order. """ return ["identity", "language", "map", "comment"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("identity", "identity__ext"), ("map", "map__ext")] return required_fields class ElementDefinitionSlicing(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. This element is sliced - slices follow. Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set). """ __resource_type__ = "ElementDefinitionSlicing" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Text description of how slicing works (or not)", description=( "A human-readable text description of how the slicing works. If there " "is no discriminator, this is required to be present to provide " "whatever information is possible about how the slices can be " "differentiated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) discriminator: typing.List[ fhirtypes.ElementDefinitionSlicingDiscriminatorType ] | None = Field( default=None, alias="discriminator", title="Element values that are used to distinguish the slices", description=( "Designates which child elements are used to discriminate between the " "slices when processing an instance. If one or more discriminators are " "provided, the value of the child elements in the instance data SHALL " "completely distinguish which slice the element in the resource matches" " based on the allowed values for those elements in each of the slices." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ordered: bool | None = Field( default=None, alias="ordered", title="If elements must be in same order as slices", description=( "If the matching elements have to occur in the same order as defined in" " the profile." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ordered__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_ordered", title="Extension field for ``ordered``." ) rules: fhirtypes.CodeType | None = Field( default=None, alias="rules", title="closed | open | openAtEnd", description=( "Whether additional slices are allowed or not. When the slices are " "ordered, profile authors can also say that additional slices are only " "allowed at the end." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["closed", "open", "openAtEnd"], }, ) rules__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rules", title="Extension field for ``rules``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionSlicing`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "discriminator", "description", "ordered", "rules"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionSlicing`` according to specification, with preserving the original sequence order. """ return ["discriminator", "description", "ordered", "rules"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("rules", "rules__ext")] return required_fields class ElementDefinitionSlicingDiscriminator(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Element values that are used to distinguish the slices. Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices. """ __resource_type__ = "ElementDefinitionSlicingDiscriminator" path: fhirtypes.StringType | None = Field( default=None, alias="path", title="Path to element value", description=( "A FHIRPath expression, using [the simple subset of " "FHIRPath](fhirpath.html#simple), that is used to identify the element " "on which discrimination is based." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="value | exists | type | profile | position", description="How the element value is interpreted when discrimination is evaluated.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["value", "exists", "type", "profile", "position"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionSlicingDiscriminator`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "type", "path"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionSlicingDiscriminator`` according to specification, with preserving the original sequence order. """ return ["type", "path"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("path", "path__ext"), ("type", "type__ext")] return required_fields class ElementDefinitionType(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Data type and Profile for this element. The data type or resource that the value of this element is permitted to be. """ __resource_type__ = "ElementDefinitionType" aggregation: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="aggregation", title="contained | referenced | bundled - how aggregated", description=( "If the type is a reference to another resource, how the resource is or" " can be aggregated - is it a contained resource, or a reference, and " "if the context is a bundle, is it included in the bundle." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["contained", "referenced", "bundled"], }, ) aggregation__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_aggregation", title="Extension field for ``aggregation``." ) code: fhirtypes.UriType | None = Field( default=None, alias="code", title="Data type or Resource (reference to definition)", description=( "URL of Data type or Resource that is a(or the) type used for this " "element. References are URLs that are relative to " 'http://hl7.org/fhir/StructureDefinition e.g. "string" is a reference ' "to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are " "only allowed in logical models." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) profile: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="profile", title="Profiles (StructureDefinition or IG) - one must apply", description=( "Identifies a profile structure or implementation Guide that applies to" " the datatype this element refers to. If any profiles are specified, " "then the content must conform to at least one of them. The URL can be " "a local reference - to a contained StructureDefinition, or a reference" " to another StructureDefinition or Implementation Guide by a canonical" " URL. When an implementation guide is specified, the type SHALL " "conform to at least one profile defined in the implementation guide." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition", "ImplementationGuide"], }, ) profile__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) targetProfile: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="targetProfile", title=( "Profile (StructureDefinition or IG) on the Reference/canonical target " "- one must apply" ), description=( 'Used when the type is "Reference" or "canonical", and identifies a ' "profile structure or implementation Guide that applies to the target " "of the reference this element refers to. If any profiles are " "specified, then the content must conform to at least one of them. The " "URL can be a local reference - to a contained StructureDefinition, or " "a reference to another StructureDefinition or Implementation Guide by " "a canonical URL. When an implementation guide is specified, the target" " resource SHALL conform to at least one profile defined in the " "implementation guide." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition", "ImplementationGuide"], }, ) targetProfile__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_targetProfile", title="Extension field for ``targetProfile``.", ) versioning: fhirtypes.CodeType | None = Field( default=None, alias="versioning", title="either | independent | specific", description=( "Whether this reference needs to be version specific or version " "independent, or whether either can be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["either", "independent", "specific"], }, ) versioning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versioning", title="Extension field for ``versioning``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ElementDefinitionType`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "code", "profile", "targetProfile", "aggregation", "versioning", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ElementDefinitionType`` according to specification, with preserving the original sequence order. """ return ["code", "profile", "targetProfile", "aggregation", "versioning"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields ================================================ FILE: fhir/resources/encounter.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Encounter Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Encounter(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An interaction during which services are provided to the patient. An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. Encounter is primarily used to record information about the actual activities that occurred, where Appointment is used to record planned activities. """ __resource_type__ = "Encounter" account: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="account", title="The set of accounts that may be used for billing for this Encounter", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Account"], }, ) actualPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="actualPeriod", title="The actual start and end time of the encounter", description=None, json_schema_extra={ "element_property": True, }, ) admission: fhirtypes.EncounterAdmissionType | None = Field( default=None, alias="admission", title="Details about the admission to a healthcare service", description=( "Details about the stay during which a healthcare service is provided." " This does not describe the event of admitting the patient, but " "rather any information that is relevant from the time of admittance " "until the time of discharge." ), json_schema_extra={ "element_property": True, }, ) appointment: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="appointment", title="The appointment that scheduled this encounter", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Appointment"], }, ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="The request that initiated this encounter", description=( "The request this encounter satisfies (e.g. incoming referral or " "procedure request)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CarePlan", "DeviceRequest", "MedicationRequest", "ServiceRequest", ], }, ) careTeam: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="careTeam", title="The group(s) that are allocated to participate in this encounter", description=( "The group(s) of individuals, organizations that are allocated to " "participate in this encounter. The participants backbone will record " "the actuals of when these individuals participated during the " "encounter." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CareTeam"], }, ) class_fhir: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="class", title=( "Classification of patient encounter context - e.g. Inpatient, " "outpatient" ), description=( "Concepts representing classification of patient encounter such as " "ambulatory (outpatient), inpatient, emergency, home health or others " "due to local variations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) diagnosis: typing.List[fhirtypes.EncounterDiagnosisType] | None = Field( default=None, alias="diagnosis", title="The list of diagnosis relevant to this encounter", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dietPreference: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="dietPreference", title="Diet preferences reported by the patient", description=None, json_schema_extra={ "element_property": True, }, ) episodeOfCare: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="episodeOfCare", title="Episode(s) of care that this encounter should be recorded against", description=( "Where a specific encounter should be classified as a part of a " "specific episode(s) of care this field should be used. This " "association can facilitate grouping of related encounters together for" " a specific purpose, such as government reporting, issue tracking, " "association via a common problem. The association is recorded on the " "encounter as these are typically created after the episode of care and" " grouped on entry rather than editing the episode of care to append " "another encounter to it (the episode of care could span years)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["EpisodeOfCare"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifier(s) by which this encounter is known", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) length: fhirtypes.DurationType | None = Field( default=None, alias="length", title="Actual quantity of time the encounter lasted (less time absent)", description=( "Actual quantity of time the encounter lasted. This excludes the time " "during leaves of absence. When missing it is the time in between the " "start and end values." ), json_schema_extra={ "element_property": True, }, ) location: typing.List[fhirtypes.EncounterLocationType] | None = Field( default=None, alias="location", title="List of locations where the patient has been", description="List of locations where the patient has been during this encounter.", json_schema_extra={ "element_property": True, }, ) partOf: fhirtypes.ReferenceType | None = Field( default=None, alias="partOf", title="Another Encounter this encounter is part of", description=( "Another Encounter of which this encounter is a part of " "(administratively or in time)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) participant: typing.List[fhirtypes.EncounterParticipantType] | None = Field( default=None, alias="participant", title="List of participants involved in the encounter", description="The list of people responsible for providing the service.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) plannedEndDate: fhirtypes.DateTimeType | None = Field( default=None, alias="plannedEndDate", title="The planned end date/time (or discharge date) of the encounter", description=None, json_schema_extra={ "element_property": True, }, ) plannedEndDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_plannedEndDate", title="Extension field for ``plannedEndDate``.", ) plannedStartDate: fhirtypes.DateTimeType | None = Field( default=None, alias="plannedStartDate", title="The planned start date/time (or admission date) of the encounter", description=None, json_schema_extra={ "element_property": True, }, ) plannedStartDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_plannedStartDate", title="Extension field for ``plannedStartDate``.", ) priority: fhirtypes.CodeableConceptType | None = Field( default=None, alias="priority", title="Indicates the urgency of the encounter", description=None, json_schema_extra={ "element_property": True, }, ) reason: typing.List[fhirtypes.EncounterReasonType] | None = Field( default=None, alias="reason", title=( "The list of medical reasons that are expected to be addressed during " "the episode of care" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) serviceProvider: fhirtypes.ReferenceType | None = Field( default=None, alias="serviceProvider", title="The organization (facility) responsible for this encounter", description=( "The organization that is primarily responsible for this Encounter's " "services. This MAY be the same as the organization on the Patient " "record, however it could be different, such as if the actor performing" " the services was from an external organization (which may be billed " "seperately) for an external consultation. Refer to the colonoscopy " "example on the Encounter examples tab." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) serviceType: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="serviceType", title="Specific type of service", description=( "Broad categorization of the service that is to be provided (e.g. " "cardiology)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["HealthcareService"], }, ) specialArrangement: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialArrangement", title="Wheelchair, translator, stretcher, etc", description=( "Any special requests that have been made for this encounter, such as " "the provision of specific equipment or other things." ), json_schema_extra={ "element_property": True, }, ) specialCourtesy: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialCourtesy", title="Special courtesies (VIP, board member)", description=( "Special courtesies that may be provided to the patient during the " "encounter (VIP, board member, professional courtesy)." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "planned | in-progress | on-hold | discharged | completed | cancelled |" " discontinued | entered-in-error | unknown" ), description=( "The current state of the encounter (not the state of the patient " "within the encounter - that is subjectState)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "planned", "in-progress", "on-hold", "discharged", "completed", "cancelled", "discontinued", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="The patient or group related to this encounter", description=( "The patient or group related to this encounter. In some use-cases the " "patient MAY not be present, such as a case meeting about a patient " "between several practitioners or a careteam." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) subjectStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subjectStatus", title="The current status of the subject in relation to the Encounter", description=( "The subjectStatus value can be used to track the patient's status " "within the encounter. It details whether the patient has arrived or " "departed, has been triaged or is currently in a waiting status." ), json_schema_extra={ "element_property": True, }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title=( "Specific type of encounter (e.g. e-mail consultation, surgical day-" "care, ...)" ), description=( "Specific type of encounter (e.g. e-mail consultation, surgical day-" "care, skilled nursing, rehabilitation)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) virtualService: typing.List[fhirtypes.VirtualServiceDetailType] | None = Field( default=None, alias="virtualService", title="Connection details of a virtual service (e.g. conference call)", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Encounter`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "class", "priority", "type", "serviceType", "subject", "subjectStatus", "episodeOfCare", "basedOn", "careTeam", "partOf", "serviceProvider", "participant", "appointment", "virtualService", "actualPeriod", "plannedStartDate", "plannedEndDate", "length", "reason", "diagnosis", "account", "dietPreference", "specialArrangement", "specialCourtesy", "admission", "location", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Encounter`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "class", "type", "serviceType", "subject", "episodeOfCare", "participant", "appointment", "reason", "diagnosis", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class EncounterAdmission(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details about the admission to a healthcare service. Details about the stay during which a healthcare service is provided. This does not describe the event of admitting the patient, but rather any information that is relevant from the time of admittance until the time of discharge. """ __resource_type__ = "EncounterAdmission" admitSource: fhirtypes.CodeableConceptType | None = Field( default=None, alias="admitSource", title="From where patient was admitted (physician referral, transfer)", description=None, json_schema_extra={ "element_property": True, }, ) destination: fhirtypes.ReferenceType | None = Field( default=None, alias="destination", title="Location/organization to which the patient is discharged", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location", "Organization"], }, ) dischargeDisposition: fhirtypes.CodeableConceptType | None = Field( default=None, alias="dischargeDisposition", title="Category or kind of location after discharge", description=None, json_schema_extra={ "element_property": True, }, ) origin: fhirtypes.ReferenceType | None = Field( default=None, alias="origin", title="The location/organization from which the patient came before admission", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location", "Organization"], }, ) preAdmissionIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="preAdmissionIdentifier", title="Pre-admission identifier", description=None, json_schema_extra={ "element_property": True, }, ) reAdmission: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reAdmission", title="Indicates that the patient is being re-admitted", description=( "Indicates that this encounter is directly related to a prior " "admission, often because the conditions addressed in the prior " "admission were not fully addressed." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EncounterAdmission`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "preAdmissionIdentifier", "origin", "admitSource", "reAdmission", "destination", "dischargeDisposition", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EncounterAdmission`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EncounterDiagnosis(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The list of diagnosis relevant to this encounter. """ __resource_type__ = "EncounterDiagnosis" condition: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="condition", title="The diagnosis relevant to the encounter", description=( "The coded diagnosis or a reference to a Condition (with other " "resources referenced in the evidence.detail), the use property will " "indicate the purpose of this specific diagnosis." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) use: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="use", title=( "Role that this diagnosis has within the encounter (e.g. admission, " "billing, discharge \u2026)" ), description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EncounterDiagnosis`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "condition", "use"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EncounterDiagnosis`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "condition"] class EncounterLocation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. List of locations where the patient has been. List of locations where the patient has been during this encounter. """ __resource_type__ = "EncounterLocation" form: fhirtypes.CodeableConceptType | None = Field( default=None, alias="form", title=( "The physical type of the location (usually the level in the location " "hierarchy - bed, room, ward, virtual etc.)" ), description=( "This will be used to specify the required levels (bed/ward/room/etc.) " "desired to be recorded to simplify either messaging or query." ), json_schema_extra={ "element_property": True, }, ) location: fhirtypes.ReferenceType = Field( default=..., alias="location", title="Location the encounter takes place", description="The location where the encounter takes place.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period during which the patient was present at the location", description=None, json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="planned | active | reserved | completed", description=( "The status of the participants' presence at the specified location " "during the period specified. If the participant is no longer at the " "location, then the period will have an end date/time." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["planned", "active", "reserved", "completed"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EncounterLocation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "location", "status", "form", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EncounterLocation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EncounterParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. List of participants involved in the encounter. The list of people responsible for providing the service. """ __resource_type__ = "EncounterParticipant" actor: fhirtypes.ReferenceType | None = Field( default=None, alias="actor", title="The individual, device, or service participating in the encounter", description=( "Person involved in the encounter, the patient/group is also included " "here to indicate that the patient was actually participating in the " "encounter. Not including the patient here covers use cases such as a " "case meeting between practitioners about a patient - non contact " "times." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Group", "RelatedPerson", "Practitioner", "PractitionerRole", "Device", "HealthcareService", ], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Period of time during the encounter that the participant participated", description=( "The period of time that the specified participant participated in the " "encounter. These can overlap or be sub-sets of the overall encounter's" " period." ), json_schema_extra={ "element_property": True, }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Role of participant in encounter", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EncounterParticipant`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "period", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EncounterParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "actor"] class EncounterReason(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The list of medical reasons that are expected to be addressed during the episode of care. """ __resource_type__ = "EncounterReason" use: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="use", title="What the reason value should be used for/as", description=( "What the reason value should be used as e.g. Chief Complaint, Health " "Concern, Health Maintenance (including screening)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) value: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="value", title="Reason the encounter takes place (core or reference)", description=( "Reason the encounter takes place, expressed as a code or a reference " "to another resource. For admissions, this can be used for a coded " "admission diagnosis." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "DiagnosticReport", "Observation", "ImmunizationRecommendation", "Procedure", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EncounterReason`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "use", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EncounterReason`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "use", "value"] ================================================ FILE: fhir/resources/encounterhistory.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/EncounterHistory Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class EncounterHistory(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A record of significant events/milestones key data throughout the history of an Encounter. A record of significant events/milestones key data throughout the history of an Encounter, often tracked for specific purposes such as billing. """ __resource_type__ = "EncounterHistory" actualPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="actualPeriod", title=( "The actual start and end time associated with this set of values " "associated with the encounter" ), description=( "The start and end time associated with this set of values associated " "with the encounter, may be different to the planned times for various " "reasons." ), json_schema_extra={ "element_property": True, }, ) class_fhir: fhirtypes.CodeableConceptType = Field( default=..., alias="class", title="Classification of patient encounter", description=( "Concepts representing classification of patient encounter such as " "ambulatory (outpatient), inpatient, emergency, home health or others " "due to local variations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="The Encounter associated with this set of historic values", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifier(s) by which this encounter is known", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) length: fhirtypes.DurationType | None = Field( default=None, alias="length", title="Actual quantity of time the encounter lasted (less time absent)", description=( "Actual quantity of time the encounter lasted. This excludes the time " "during leaves of absence. When missing it is the time in between the " "start and end values." ), json_schema_extra={ "element_property": True, }, ) location: typing.List[fhirtypes.EncounterHistoryLocationType] | None = Field( default=None, alias="location", title="Location of the patient at this point in the encounter", description=( "The location of the patient at this point in the encounter, the " "multiple cardinality permits de-normalizing the levels of the location" " hierarchy, such as site/ward/room/bed." ), json_schema_extra={ "element_property": True, }, ) plannedEndDate: fhirtypes.DateTimeType | None = Field( default=None, alias="plannedEndDate", title="The planned end date/time (or discharge date) of the encounter", description=None, json_schema_extra={ "element_property": True, }, ) plannedEndDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_plannedEndDate", title="Extension field for ``plannedEndDate``.", ) plannedStartDate: fhirtypes.DateTimeType | None = Field( default=None, alias="plannedStartDate", title="The planned start date/time (or admission date) of the encounter", description=None, json_schema_extra={ "element_property": True, }, ) plannedStartDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_plannedStartDate", title="Extension field for ``plannedStartDate``.", ) serviceType: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="serviceType", title="Specific type of service", description=( "Broad categorization of the service that is to be provided (e.g. " "cardiology)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["HealthcareService"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "planned | in-progress | on-hold | discharged | completed | cancelled |" " discontinued | entered-in-error | unknown" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "planned", "in-progress", "on-hold", "discharged", "completed", "cancelled", "discontinued", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="The patient or group related to this encounter", description=( "The patient or group related to this encounter. In some use-cases the " "patient MAY not be present, such as a case meeting about a patient " "between several practitioners or a careteam." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) subjectStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subjectStatus", title="The current status of the subject in relation to the Encounter", description=( "The subjectStatus value can be used to track the patient's status " "within the encounter. It details whether the patient has arrived or " "departed, has been triaged or is currently in a waiting status." ), json_schema_extra={ "element_property": True, }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Specific type of encounter", description=( "Specific type of encounter (e.g. e-mail consultation, surgical day-" "care, skilled nursing, rehabilitation)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EncounterHistory`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "encounter", "identifier", "status", "class", "type", "serviceType", "subject", "subjectStatus", "actualPeriod", "plannedStartDate", "plannedEndDate", "length", "location", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EncounterHistory`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "class", "type", "serviceType", "subject", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class EncounterHistoryLocation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Location of the patient at this point in the encounter. The location of the patient at this point in the encounter, the multiple cardinality permits de-normalizing the levels of the location hierarchy, such as site/ward/room/bed. """ __resource_type__ = "EncounterHistoryLocation" form: fhirtypes.CodeableConceptType | None = Field( default=None, alias="form", title=( "The physical type of the location (usually the level in the location " "hierarchy - bed, room, ward, virtual etc.)" ), description=( "This will be used to specify the required levels (bed/ward/room/etc.) " "desired to be recorded to simplify either messaging or query." ), json_schema_extra={ "element_property": True, }, ) location: fhirtypes.ReferenceType = Field( default=..., alias="location", title="Location the encounter takes place", description="The location where the encounter takes place.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EncounterHistoryLocation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "location", "form"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EncounterHistoryLocation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/endpoint.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Endpoint Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Endpoint(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The technical details of an endpoint that can be used for electronic services. The technical details of an endpoint that can be used for electronic services, such as for web services providing XDS.b, a REST endpoint for another FHIR server, or a s/Mime email address. This may include any security context information. """ __resource_type__ = "Endpoint" address: fhirtypes.UrlType | None = Field( default=None, alias="address", title="The technical base address for connecting to this endpoint", description="The uri that describes the actual end-point to connect to.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) address__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_address", title="Extension field for ``address``." ) connectionType: typing.List[fhirtypes.CodeableConceptType] = Field( default=..., alias="connectionType", title="Protocol/Profile/Standard to be used with this endpoint connection", description=( "A coded value that represents the technical details of the usage of " "this endpoint, such as what WSDLs should be used in what way. (e.g. " "XDS.b/DICOM/cds-hook)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="contact", title="Contact details for source (e.g. troubleshooting)", description=( "Contact details for a human to contact about the endpoint. The primary" " use of this for system administrator troubleshooting." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title=( "Additional details about the endpoint that could be displayed as " "further information to identify the description beyond its name" ), description=( "The description of the endpoint and what it is for (typically used as " "supplemental information in an endpoint directory describing its " "usage/purpose)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) environmentType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="environmentType", title="The type of environment(s) exposed at this endpoint", description=( "The type of environment(s) exposed at this endpoint (dev, prod, test, " "etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) header: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="header", title="Usage depends on the channel type", description="Additional headers / information to send as part of the notification.", json_schema_extra={ "element_property": True, }, ) header__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_header", title="Extension field for ``header``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifies this endpoint across multiple systems", description=( "Identifier for the organization that is used to identify the endpoint " "across multiple disparate systems." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) managingOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="managingOrganization", title=( "Organization that manages this endpoint (might not be the organization" " that exposes the endpoint)" ), description=( "The organization that manages this endpoint (even if technically " "another organization is hosting this in the cloud, it is the " "organization associated with the data)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="A name that this endpoint can be identified by", description="A friendly name that this endpoint can be referred to with.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) payload: typing.List[fhirtypes.EndpointPayloadType] | None = Field( default=None, alias="payload", title="Set of payloads that are provided by this endpoint", description="The set of payloads that are provided/available at this endpoint.", json_schema_extra={ "element_property": True, }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Interval the endpoint is expected to be operational", description="The interval during which the endpoint is expected to be operational.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | suspended | error | off | entered-in-error | test", description=( "The endpoint status represents the general expected availability of an" " endpoint." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "active", "suspended", "error", "off", "entered-in-error", "test", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Endpoint`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "connectionType", "name", "description", "environmentType", "managingOrganization", "contact", "period", "payload", "address", "header", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Endpoint`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "connectionType", "name", "description", "environmentType", "managingOrganization", "period", "address", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("address", "address__ext"), ("status", "status__ext")] return required_fields class EndpointPayload(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Set of payloads that are provided by this endpoint. The set of payloads that are provided/available at this endpoint. """ __resource_type__ = "EndpointPayload" mimeType: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="mimeType", title=( "Mimetype to send. If not specified, the content could be anything " "(including no payload, if the connectionType defined this)" ), description=( "The mime type to send the payload in - e.g. application/fhir+xml, " "application/fhir+json. If the mime type is not specified, then the " "sender could send any content (including no content depending on the " "connectionType)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) mimeType__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_mimeType", title="Extension field for ``mimeType``." ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title=( "The type of content that may be used at this endpoint (e.g. XDS " "Discharge summaries)" ), description=( "The payload type describes the acceptable content that can be " "communicated on the endpoint." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EndpointPayload`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "mimeType"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EndpointPayload`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "mimeType"] ================================================ FILE: fhir/resources/enrollmentrequest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/EnrollmentRequest Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class EnrollmentRequest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Enroll in coverage. This resource provides the insurance enrollment details to the insurer regarding a specified coverage. """ __resource_type__ = "EnrollmentRequest" candidate: fhirtypes.ReferenceType | None = Field( default=None, alias="candidate", title="The subject to be enrolled", description="Patient Resource.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) coverage: fhirtypes.ReferenceType | None = Field( default=None, alias="coverage", title="Insurance information", description="Reference to the program or plan identification, underwriter or payor.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage"], }, ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Creation date", description="The date when this resource was created.", json_schema_extra={ "element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier", description="The Response business identifier.", json_schema_extra={ "element_property": True, }, ) insurer: fhirtypes.ReferenceType | None = Field( default=None, alias="insurer", title="Target", description="The Insurer who is target of the request.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) provider: fhirtypes.ReferenceType | None = Field( default=None, alias="provider", title="Responsible practitioner", description=( "The practitioner who is responsible for the services rendered to the " "patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EnrollmentRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "created", "insurer", "provider", "candidate", "coverage", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EnrollmentRequest`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "modifierExtension", "status"] ================================================ FILE: fhir/resources/enrollmentresponse.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/EnrollmentResponse Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class EnrollmentResponse(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. EnrollmentResponse resource. This resource provides enrollment and plan details from the processing of an EnrollmentRequest resource. """ __resource_type__ = "EnrollmentResponse" created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Creation date", description=( "The date when the enclosed suite of services were performed or " "completed." ), json_schema_extra={ "element_property": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) disposition: fhirtypes.StringType | None = Field( default=None, alias="disposition", title="Disposition Message", description="A description of the status of the adjudication.", json_schema_extra={ "element_property": True, }, ) disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_disposition", title="Extension field for ``disposition``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier", description="The Response business identifier.", json_schema_extra={ "element_property": True, }, ) organization: fhirtypes.ReferenceType | None = Field( default=None, alias="organization", title="Insurer", description="The Insurer who produced this adjudicated response.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) outcome: fhirtypes.CodeType | None = Field( default=None, alias="outcome", title="queued | complete | error | partial", description="Processing status: error, complete.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["queued", "complete", "error", "partial"], }, ) outcome__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_outcome", title="Extension field for ``outcome``." ) request: fhirtypes.ReferenceType | None = Field( default=None, alias="request", title="Claim reference", description="Original request resource reference.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["EnrollmentRequest"], }, ) requestProvider: fhirtypes.ReferenceType | None = Field( default=None, alias="requestProvider", title="Responsible practitioner", description=( "The practitioner who is responsible for the services rendered to the " "patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EnrollmentResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "request", "outcome", "disposition", "created", "organization", "requestProvider", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EnrollmentResponse`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "modifierExtension", "status"] ================================================ FILE: fhir/resources/episodeofcare.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/EpisodeOfCare Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class EpisodeOfCare(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An association of a Patient with an Organization and Healthcare Provider(s) for a period of time that the Organization assumes some level of responsibility. An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. """ __resource_type__ = "EpisodeOfCare" account: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="account", title=( "The set of accounts that may be used for billing for this " "EpisodeOfCare" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Account"], }, ) careManager: fhirtypes.ReferenceType | None = Field( default=None, alias="careManager", title="Care manager/care coordinator for the patient", description=( "The practitioner that is the care manager/care coordinator for this " "patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) careTeam: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="careTeam", title="Other practitioners facilitating this episode of care", description=( "The list of practitioners that may be facilitating this episode of " "care for specific purposes." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CareTeam"], }, ) diagnosis: typing.List[fhirtypes.EpisodeOfCareDiagnosisType] | None = Field( default=None, alias="diagnosis", title=( "The list of medical conditions that were addressed during the episode " "of care" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier(s) relevant for this EpisodeOfCare", description=( "The EpisodeOfCare may be known by different identifiers for different " "contexts of use, such as when an external agency is tracking the " "Episode for funding purposes." ), json_schema_extra={ "element_property": True, }, ) managingOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="managingOrganization", title="Organization that assumes responsibility for care coordination", description=( "The organization that has assumed the specific responsibilities for " "care coordination, care delivery, or other services for the specified " "duration." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="The patient who is the focus of this episode of care", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Interval during responsibility is assumed", description=( "The interval during which the managing organization assumes the " "defined responsibility." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reason: typing.List[fhirtypes.EpisodeOfCareReasonType] | None = Field( default=None, alias="reason", title=( "The list of medical reasons that are expected to be addressed during " "the episode of care" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) referralRequest: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="referralRequest", title="Originating Referral Request(s)", description=( "Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming" " referrals." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ServiceRequest"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "planned | waitlist | active | onhold | finished | cancelled | entered-" "in-error" ), description="planned | waitlist | active | onhold | finished | cancelled.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "planned", "waitlist", "active", "onhold", "finished", "cancelled", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusHistory: typing.List[fhirtypes.EpisodeOfCareStatusHistoryType] | None = Field( default=None, alias="statusHistory", title=( "Past list of status codes (the current status may be included to cover" " the start date of the status)" ), description=( "The history of statuses that the EpisodeOfCare has been through " "(without requiring processing the history of the resource)." ), json_schema_extra={ "element_property": True, }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Type/class - e.g. specialist referral, disease management", description=( "A classification of the type of episode of care; e.g. specialist " "referral, disease management, type of funded care." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EpisodeOfCare`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "statusHistory", "type", "reason", "diagnosis", "patient", "managingOrganization", "period", "referralRequest", "careManager", "careTeam", "account", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EpisodeOfCare`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "status", "type", "reason", "diagnosis", "patient", "managingOrganization", "period", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class EpisodeOfCareDiagnosis(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The list of medical conditions that were addressed during the episode of care. """ __resource_type__ = "EpisodeOfCareDiagnosis" condition: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="condition", title="The medical condition that was addressed during the episode of care", description=( "The medical condition that was addressed during the episode of care, " "expressed as a text, code or a reference to another resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) use: fhirtypes.CodeableConceptType | None = Field( default=None, alias="use", title=( "Role that this diagnosis has within the episode of care (e.g. " "admission, billing, discharge \u2026)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EpisodeOfCareDiagnosis`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "condition", "use"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EpisodeOfCareDiagnosis`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "condition", "use"] class EpisodeOfCareReason(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The list of medical reasons that are expected to be addressed during the episode of care. """ __resource_type__ = "EpisodeOfCareReason" use: fhirtypes.CodeableConceptType | None = Field( default=None, alias="use", title="What the reason value should be used for/as", description=( "What the reason value should be used as e.g. Chief Complaint, Health " "Concern, Health Maintenance (including screening)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) value: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="value", title="Medical reason to be addressed", description=( "The medical reason that is expected to be addressed during the episode" " of care, expressed as a text, code or a reference to another " "resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Procedure", "Observation", "HealthcareService", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EpisodeOfCareReason`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "use", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EpisodeOfCareReason`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "use", "value"] class EpisodeOfCareStatusHistory(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Past list of status codes (the current status may be included to cover the start date of the status). The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource). """ __resource_type__ = "EpisodeOfCareStatusHistory" period: fhirtypes.PeriodType = Field( default=..., alias="period", title="Duration the EpisodeOfCare was in the specified status", description="The period during this EpisodeOfCare that the specific status applied.", json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "planned | waitlist | active | onhold | finished | cancelled | entered-" "in-error" ), description="planned | waitlist | active | onhold | finished | cancelled.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "planned", "waitlist", "active", "onhold", "finished", "cancelled", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EpisodeOfCareStatusHistory`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "status", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EpisodeOfCareStatusHistory`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields ================================================ FILE: fhir/resources/eventdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/EventDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class EventDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A description of when an event can occur. The EventDefinition resource provides a reusable description of when a particular event can occur. """ __resource_type__ = "EventDefinition" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the event definition was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the content", description=( "An individiual or organization primarily involved in the creation and " "maintenance of the content." ), json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the event definition and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the event definition." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the event definition was last " "significantly changed. The date must change when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the event definition " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the event definition", description=( "A free text natural language description of the event definition from " "a consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the content", description=( "An individual or organization primarily responsible for internal " "coherence of the content." ), json_schema_extra={ "element_property": True, }, ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the event definition is expected to be used", description=( "The period during which the event definition content was or is planned" " to be in active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the content", description=( "An individual or organization asserted by the publisher to be " "responsible for officially endorsing the content for use in some " "setting." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this event definition is authored for" " testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the event definition", description=( "A formal identifier that is used to identify this event definition " "when it is represented in other formats, or referenced in a " "specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for event definition (if applicable)", description=( "A legal or geographic region in which the event definition is intended" " to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the event definition was last reviewed by the publisher", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this event definition (computer friendly)", description=( "A natural language name identifying the event definition. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the event definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this event definition is defined", description=( "Explanation of why this event definition is needed and why it has been" " designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Additional documentation, citations, etc", description=( "Related resources such as additional documentation, justification, or " "bibliographic references." ), json_schema_extra={ "element_property": True, }, ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the content", description=( "An individual or organization asserted by the publisher to be " "primarily responsible for review of some aspect of the content." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this event definition. Enables tracking the life-cycle " "of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subjectCodeableConcept", title="Type of individual the event definition is focused on", description=( "A code or group definition that describes the intended subject of the " "event definition." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, }, ) subjectReference: fhirtypes.ReferenceType | None = Field( default=None, alias="subjectReference", title="Type of individual the event definition is focused on", description=( "A code or group definition that describes the intended subject of the " "event definition." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) subtitle: fhirtypes.StringType | None = Field( default=None, alias="subtitle", title="Subordinate title of the event definition", description=( "An explanatory or alternate title for the event definition giving " "additional information about its content." ), json_schema_extra={ "element_property": True, }, ) subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subtitle", title="Extension field for ``subtitle``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this event definition (human friendly)", description="A short, descriptive, user-friendly title for the event definition.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) topic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="topic", title="E.g. Education, Treatment, Assessment, etc", description=( "Descriptive topics related to the module. Topics provide a high-level " "categorization of the module that can be useful for filtering and " "searching." ), json_schema_extra={ "element_property": True, }, ) trigger: typing.List[fhirtypes.TriggerDefinitionType] = Field( default=..., alias="trigger", title="\"when\" the event occurs (multiple = 'or')", description=( "The trigger element defines when the event occurs. If more than one " "trigger condition is specified, the event fires whenever any one of " "the trigger conditions is met." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this event definition, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this event definition when it" " is referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which an authoritative instance of this" " event definition is (or will be) published. This URL can be the " "target of a canonical reference. It SHALL remain the same when the " "event definition is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) usage: fhirtypes.MarkdownType | None = Field( default=None, alias="usage", title="Describes the clinical usage of the event definition", description=( "A detailed description of how the event definition is used from a " "clinical perspective." ), json_schema_extra={ "element_property": True, }, ) usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usage", title="Extension field for ``usage``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate event definition instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the event definition", description=( "The identifier that is used to identify this version of the event " "definition when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the event definition " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EventDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "subtitle", "status", "experimental", "subjectCodeableConcept", "subjectReference", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "usage", "copyright", "copyrightLabel", "approvalDate", "lastReviewDate", "effectivePeriod", "topic", "author", "editor", "reviewer", "endorser", "relatedArtifact", "trigger", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EventDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "approvalDate", "lastReviewDate", "effectivePeriod", "trigger", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "subject": ["subjectCodeableConcept", "subjectReference"], "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"], } return one_of_many_fields ================================================ FILE: fhir/resources/evidence.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Evidence Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Evidence(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Single evidence bit. The Evidence Resource provides a machine-interpretable expression of an evidence concept including the evidence variables (e.g., population, exposures/interventions, comparators, outcomes, measured variables, confounding variables), the statistics, and the certainty of this evidence. """ __resource_type__ = "Evidence" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the summary was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) assertion: fhirtypes.MarkdownType | None = Field( default=None, alias="assertion", title="Declarative description of the Evidence", description=None, json_schema_extra={ "element_property": True, }, ) assertion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_assertion", title="Extension field for ``assertion``." ) author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the content", description=( "An individiual, organization, or device primarily involved in the " "creation and maintenance of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) certainty: typing.List[fhirtypes.EvidenceCertaintyType] | None = Field( default=None, alias="certainty", title="Certainty or quality of the evidence", description=( "Assessment of certainty, confidence in the estimates, or quality of " "the evidence." ), json_schema_extra={ "element_property": True, }, ) citeAsMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="citeAsMarkdown", title="Citation for this evidence", description="Citation Resource or display of suggested citation for this evidence.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e citeAs[x] "one_of_many": "citeAs", "one_of_many_required": False, }, ) citeAsMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_citeAsMarkdown", title="Extension field for ``citeAsMarkdown``.", ) citeAsReference: fhirtypes.ReferenceType | None = Field( default=None, alias="citeAsReference", title="Citation for this evidence", description="Citation Resource or display of suggested citation for this evidence.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e citeAs[x] "one_of_many": "citeAs", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Citation"], }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the Evidence and/or its contents. " "Copyright statements are generally legal restrictions on the use and " "publishing of the Evidence." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the summary was last " "significantly changed. The date must change when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the summary changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Description of the particular summary", description=( "A free text natural language description of the evidence from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the content", description=( "An individiual, organization, or device primarily responsible for " "internal coherence of the content." ), json_schema_extra={ "element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the content", description=( "An individiual, organization, or device responsible for officially " "endorsing the content for use in some setting." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this resource is authored for testing" " purposes (or education/evaluation/marketing) and is not intended to " "be used for genuine usage." ), json_schema_extra={ "element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the summary", description=( "A formal identifier that is used to identify this summary when it is " "represented in other formats, or referenced in a specification, model," " design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the summary was last reviewed by the publisher", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this summary (machine friendly)", description=( "A natural language name identifying the evidence. This name should be " "usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Footnotes and/or explanatory notes", description=None, json_schema_extra={ "element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the evidence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this Evidence is defined", description=( "Explanation of why this Evidence is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Link or citation to artifact associated with the summary", description=None, json_schema_extra={ "element_property": True, }, ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the content", description=( "An individiual, organization, or device primarily responsible for " "review of some aspect of the content." ), json_schema_extra={ "element_property": True, }, ) statistic: typing.List[fhirtypes.EvidenceStatisticType] | None = Field( default=None, alias="statistic", title="Values and parameters for a single statistic", description=None, json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this summary. Enables tracking the life-cycle of the " "content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) studyDesign: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="studyDesign", title="The design of the study that produced this evidence", description=( "The design of the study that produced this evidence. The design is " "described with any number of study design characteristics." ), json_schema_extra={ "element_property": True, }, ) synthesisType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="synthesisType", title="The method to combine studies", description=None, json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this summary (human friendly)", description="A short, descriptive, user-friendly title for the summary.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this evidence, represented as a globally " "unique URI" ), description=( "An absolute URI that is used to identify this evidence when it is " "referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which an authoritative instance of this" " summary is (or will be) published. This URL can be the target of a " "canonical reference. It SHALL remain the same when the summary is " "stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate evidence instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) variableDefinition: typing.List[fhirtypes.EvidenceVariableDefinitionType] = Field( default=..., alias="variableDefinition", title="Evidence variable such as population, exposure, or outcome", description=None, json_schema_extra={ "element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of this summary", description=( "The identifier that is used to identify this version of the summary " "when it is referenced in a specification, model, design or instance. " "This is an arbitrary value managed by the summary author and is not " "expected to be globally unique. For example, it might be a timestamp " "(e.g. yyyymmdd) if a managed version is not available. There is also " "no expectation that versions can be placed in a lexicographical " "sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Evidence`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "citeAsReference", "citeAsMarkdown", "status", "experimental", "date", "approvalDate", "lastReviewDate", "publisher", "contact", "author", "editor", "reviewer", "endorser", "useContext", "purpose", "copyright", "copyrightLabel", "relatedArtifact", "description", "assertion", "note", "variableDefinition", "synthesisType", "studyDesign", "statistic", "certainty", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Evidence`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "title", "status", "date", "publisher", "contact", "author", "endorser", "useContext", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "citeAs": ["citeAsMarkdown", "citeAsReference"], "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"], } return one_of_many_fields class EvidenceCertainty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Certainty or quality of the evidence. Assessment of certainty, confidence in the estimates, or quality of the evidence. """ __resource_type__ = "EvidenceCertainty" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Textual description of certainty", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Footnotes and/or explanatory notes", description=None, json_schema_extra={ "element_property": True, }, ) rater: fhirtypes.StringType | None = Field( default=None, alias="rater", title="Individual or group who did the rating", description=None, json_schema_extra={ "element_property": True, }, ) rater__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rater", title="Extension field for ``rater``." ) rating: fhirtypes.CodeableConceptType | None = Field( default=None, alias="rating", title="Assessment or judgement of the aspect", description=None, json_schema_extra={ "element_property": True, }, ) subcomponent: typing.List[fhirtypes.EvidenceCertaintyType] | None = Field( default=None, alias="subcomponent", title="A domain or subdomain of certainty", description=None, json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Aspect of certainty being rated", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceCertainty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "note", "type", "rating", "rater", "subcomponent", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceCertainty`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EvidenceStatistic(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Values and parameters for a single statistic. """ __resource_type__ = "EvidenceStatistic" attributeEstimate: typing.List[ fhirtypes.EvidenceStatisticAttributeEstimateType ] | None = Field( default=None, alias="attributeEstimate", title="An attribute of the Statistic", description=( "A statistical attribute of the statistic such as a measure of " "heterogeneity." ), json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Associated category for categorical variable", description=( "When the measured variable is handled categorically, the category " "element is used to define which category the statistic is reporting." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Description of content", description="A description of the content value of the statistic.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) modelCharacteristic: typing.List[ fhirtypes.EvidenceStatisticModelCharacteristicType ] | None = Field( default=None, alias="modelCharacteristic", title="An aspect of the statistical model", description="A component of the method to generate the statistic.", json_schema_extra={ "element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Footnotes and/or explanatory notes", description=None, json_schema_extra={ "element_property": True, }, ) numberAffected: fhirtypes.UnsignedIntType | None = Field( default=None, alias="numberAffected", title="The number of participants affected", description=( "The number of participants affected where the unit of analysis is the " "same as sampleSize.knownDataCount and sampleSize.numberOfParticipants." ), json_schema_extra={ "element_property": True, }, ) numberAffected__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_numberAffected", title="Extension field for ``numberAffected``.", ) numberOfEvents: fhirtypes.UnsignedIntType | None = Field( default=None, alias="numberOfEvents", title="The number of events associated with the statistic", description=( "The number of events associated with the statistic, where the unit of " "analysis is different from numberAffected, sampleSize.knownDataCount " "and sampleSize.numberOfParticipants." ), json_schema_extra={ "element_property": True, }, ) numberOfEvents__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_numberOfEvents", title="Extension field for ``numberOfEvents``.", ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Statistic value", description=None, json_schema_extra={ "element_property": True, }, ) sampleSize: fhirtypes.EvidenceStatisticSampleSizeType | None = Field( default=None, alias="sampleSize", title="Number of samples in the statistic", description=None, json_schema_extra={ "element_property": True, }, ) statisticType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="statisticType", title="Type of statistic, e.g., relative risk", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceStatistic`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "note", "statisticType", "category", "quantity", "numberOfEvents", "numberAffected", "sampleSize", "attributeEstimate", "modelCharacteristic", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceStatistic`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EvidenceStatisticAttributeEstimate(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An attribute of the Statistic. A statistical attribute of the statistic such as a measure of heterogeneity. """ __resource_type__ = "EvidenceStatisticAttributeEstimate" attributeEstimate: typing.List[ fhirtypes.EvidenceStatisticAttributeEstimateType ] | None = Field( default=None, alias="attributeEstimate", title=( "A nested attribute estimate; which is the attribute estimate of an " "attribute estimate" ), description=None, json_schema_extra={ "element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Textual description of the attribute estimate", description="Human-readable summary of the estimate.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) level: fhirtypes.DecimalType | None = Field( default=None, alias="level", title="Level of confidence interval, e.g., 0.95 for 95% confidence interval", description="Use 95 for a 95% confidence interval.", json_schema_extra={ "element_property": True, }, ) level__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_level", title="Extension field for ``level``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Footnote or explanatory note about the estimate", description=None, json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title=( "The singular quantity of the attribute estimate, for attribute " "estimates represented as single values; also used to report unit of " "measure" ), description=None, json_schema_extra={ "element_property": True, }, ) range: fhirtypes.RangeType | None = Field( default=None, alias="range", title="Lower and upper bound values of the attribute estimate", description="Lower bound of confidence interval.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The type of attribute estimate, e.g., confidence interval or p value", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceStatisticAttributeEstimate`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "note", "type", "quantity", "level", "range", "attributeEstimate", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceStatisticAttributeEstimate`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EvidenceStatisticModelCharacteristic(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An aspect of the statistical model. A component of the method to generate the statistic. """ __resource_type__ = "EvidenceStatisticModelCharacteristic" attributeEstimate: typing.List[ fhirtypes.EvidenceStatisticAttributeEstimateType ] | None = Field( default=None, alias="attributeEstimate", title="An attribute of the statistic used as a model characteristic", description=None, json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Model specification", description="Description of a component of the method to generate the statistic.", json_schema_extra={ "element_property": True, }, ) value: fhirtypes.QuantityType | None = Field( default=None, alias="value", title="Numerical value to complete model specification", description=( "Further specification of the quantified value of the component of the " "method to generate the statistic." ), json_schema_extra={ "element_property": True, }, ) variable: typing.List[ fhirtypes.EvidenceStatisticModelCharacteristicVariableType ] | None = Field( default=None, alias="variable", title="A variable adjusted for in the adjusted analysis", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceStatisticModelCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "value", "variable", "attributeEstimate", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceStatisticModelCharacteristic`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EvidenceStatisticModelCharacteristicVariable(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A variable adjusted for in the adjusted analysis. """ __resource_type__ = "EvidenceStatisticModelCharacteristicVariable" handling: fhirtypes.CodeType | None = Field( default=None, alias="handling", title="continuous | dichotomous | ordinal | polychotomous", description="How the variable is classified for use in adjusted analysis.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["continuous", "dichotomous", "ordinal", "polychotomous"], }, ) handling__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_handling", title="Extension field for ``handling``." ) valueCategory: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="valueCategory", title="Description for grouping of ordinal or polychotomous variables", description=None, json_schema_extra={ "element_property": True, }, ) valueQuantity: typing.List[fhirtypes.QuantityType] | None = Field( default=None, alias="valueQuantity", title="Discrete value for grouping of ordinal or polychotomous variables", description=None, json_schema_extra={ "element_property": True, }, ) valueRange: typing.List[fhirtypes.RangeType] | None = Field( default=None, alias="valueRange", title="Range of values for grouping of ordinal or polychotomous variables", description=None, json_schema_extra={ "element_property": True, }, ) variableDefinition: fhirtypes.ReferenceType = Field( default=..., alias="variableDefinition", title="Description of the variable", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group", "EvidenceVariable"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceStatisticModelCharacteristicVariable`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "variableDefinition", "handling", "valueCategory", "valueQuantity", "valueRange", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceStatisticModelCharacteristicVariable`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EvidenceStatisticSampleSize(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Number of samples in the statistic. """ __resource_type__ = "EvidenceStatisticSampleSize" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Textual description of sample size for statistic", description="Human-readable summary of population sample size.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) knownDataCount: fhirtypes.UnsignedIntType | None = Field( default=None, alias="knownDataCount", title="Number of participants with known results for measured variables", description=None, json_schema_extra={ "element_property": True, }, ) knownDataCount__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_knownDataCount", title="Extension field for ``knownDataCount``.", ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Footnote or explanatory note about the sample size", description=None, json_schema_extra={ "element_property": True, }, ) numberOfParticipants: fhirtypes.UnsignedIntType | None = Field( default=None, alias="numberOfParticipants", title="Cumulative number of participants", description=( "A human-readable string to clarify or explain concepts about the " "sample size." ), json_schema_extra={ "element_property": True, }, ) numberOfParticipants__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_numberOfParticipants", title="Extension field for ``numberOfParticipants``.", ) numberOfStudies: fhirtypes.UnsignedIntType | None = Field( default=None, alias="numberOfStudies", title="Number of contributing studies", description="Number of participants in the population.", json_schema_extra={ "element_property": True, }, ) numberOfStudies__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_numberOfStudies", title="Extension field for ``numberOfStudies``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceStatisticSampleSize`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "note", "numberOfStudies", "numberOfParticipants", "knownDataCount", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceStatisticSampleSize`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EvidenceVariableDefinition(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Evidence variable such as population, exposure, or outcome. """ __resource_type__ = "EvidenceVariableDefinition" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="A text description or summary of the variable", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) directnessMatch: fhirtypes.CodeableConceptType | None = Field( default=None, alias="directnessMatch", title="low | moderate | high | exact", description=( "Indication of quality of match between intended variable to actual " "variable." ), json_schema_extra={ "element_property": True, }, ) intended: fhirtypes.ReferenceType | None = Field( default=None, alias="intended", title="Definition of the intended variable related to the Evidence", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group", "EvidenceVariable"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Footnotes and/or explanatory notes", description=None, json_schema_extra={ "element_property": True, }, ) observed: fhirtypes.ReferenceType | None = Field( default=None, alias="observed", title="Definition of the actual variable related to the statistic(s)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group", "EvidenceVariable"], }, ) variableRole: fhirtypes.CodeableConceptType = Field( default=..., alias="variableRole", title=( "population | subpopulation | exposure | referenceExposure | " "measuredVariable | confounder" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceVariableDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "note", "variableRole", "observed", "intended", "directnessMatch", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceVariableDefinition`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "variableRole", "observed"] ================================================ FILE: fhir/resources/evidencereport.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/EvidenceReport Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class EvidenceReport(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A EvidenceReport. The EvidenceReport Resource is a specialized container for a collection of resources and codeable concepts, adapted to support compositions of Evidence, EvidenceVariable, and Citation resources and related concepts. """ __resource_type__ = "EvidenceReport" author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the content", description=( "An individiual, organization, or device primarily involved in the " "creation and maintenance of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) citeAsMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="citeAsMarkdown", title="Citation for this report", description="Citation Resource or display of suggested citation for this report.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e citeAs[x] "one_of_many": "citeAs", "one_of_many_required": False, }, ) citeAsMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_citeAsMarkdown", title="Extension field for ``citeAsMarkdown``.", ) citeAsReference: fhirtypes.ReferenceType | None = Field( default=None, alias="citeAsReference", title="Citation for this report", description="Citation Resource or display of suggested citation for this report.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e citeAs[x] "one_of_many": "citeAs", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Citation"], }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the content", description=( "An individiual, organization, or device primarily responsible for " "internal coherence of the content." ), json_schema_extra={ "element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the content", description=( "An individiual, organization, or device responsible for officially " "endorsing the content for use in some setting." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique identifier for the evidence report", description=( "A formal identifier that is used to identify this EvidenceReport when " "it is represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Used for footnotes and annotations", description=None, json_schema_extra={ "element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the evidence report." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Link, description or reference to artifact associated with the report", description=None, json_schema_extra={ "element_property": True, }, ) relatedIdentifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="relatedIdentifier", title=( "Identifiers for articles that may relate to more than one evidence " "report" ), description=( "A formal identifier that is used to identify things closely related to" " this EvidenceReport." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) relatesTo: typing.List[fhirtypes.EvidenceReportRelatesToType] | None = Field( default=None, alias="relatesTo", title="Relationships to other compositions/documents", description=( "Relationships that this composition has with other compositions or " "documents that already exist." ), json_schema_extra={ "element_property": True, }, ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the content", description=( "An individiual, organization, or device primarily responsible for " "review of some aspect of the content." ), json_schema_extra={ "element_property": True, }, ) section: typing.List[fhirtypes.EvidenceReportSectionType] | None = Field( default=None, alias="section", title="Composition is broken into sections", description="The root of the sections that make up the composition.", json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this summary. Enables tracking the life-cycle of the " "content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.EvidenceReportSubjectType = Field( default=..., alias="subject", title="Focus of the report", description=( 'Specifies the subject or focus of the report. Answers "What is this ' 'report about?".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Kind of report", description=( "Specifies the kind of report, such as grouping of classifiers, search " "results, or human-compiled expression." ), json_schema_extra={ "element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this EvidenceReport, represented as a " "globally unique URI" ), description=( "An absolute URI that is used to identify this EvidenceReport when it " "is referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which an authoritative instance of this" " summary is (or will be) published. This URL can be the target of a " "canonical reference. It SHALL remain the same when the summary is " "stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate evidence report instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceReport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "status", "useContext", "identifier", "relatedIdentifier", "citeAsReference", "citeAsMarkdown", "type", "note", "relatedArtifact", "subject", "publisher", "contact", "author", "editor", "reviewer", "endorser", "relatesTo", "section", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceReport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "status", "useContext", "identifier", "relatedIdentifier", "subject", "publisher", "contact", "author", "endorser", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"citeAs": ["citeAsMarkdown", "citeAsReference"]} return one_of_many_fields class EvidenceReportRelatesTo(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Relationships to other compositions/documents. Relationships that this composition has with other compositions or documents that already exist. """ __resource_type__ = "EvidenceReportRelatesTo" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title=( "replaces | amends | appends | transforms | replacedWith | amendedWith " "| appendedWith | transformedWith" ), description=( "The type of relationship that this composition has with anther " "composition or document." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "replaces", "amends", "appends", "transforms", "replacedWith", "amendedWith", "appendedWith", "transformedWith", ], }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) target: fhirtypes.EvidenceReportRelatesToTargetType = Field( default=..., alias="target", title="Target of the relationship", description="The target composition/document of this relationship.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceReportRelatesTo`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "target"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceReportRelatesTo`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields class EvidenceReportRelatesToTarget(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Target of the relationship. The target composition/document of this relationship. """ __resource_type__ = "EvidenceReportRelatesToTarget" display: fhirtypes.MarkdownType | None = Field( default=None, alias="display", title="Target of the relationship Display", description=None, json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Target of the relationship Identifier", description=None, json_schema_extra={ "element_property": True, }, ) resource: fhirtypes.ReferenceType | None = Field( default=None, alias="resource", title="Target of the relationship Resource reference", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Target of the relationship URL", description=None, json_schema_extra={ "element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceReportRelatesToTarget`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "url", "identifier", "display", "resource", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceReportRelatesToTarget`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EvidenceReportSection(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Composition is broken into sections. The root of the sections that make up the composition. """ __resource_type__ = "EvidenceReportSection" author: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="author", title="Who and/or what authored the section", description=( "Identifies who is responsible for the information in this section, not" " necessarily who typed it in." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Device", "Group", "Organization", ], }, ) emptyReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="emptyReason", title="Why the section is empty", description=( "If the section is empty, why the list is empty. An empty section " "typically has some text explaining the empty reason." ), json_schema_extra={ "element_property": True, }, ) entryClassifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="entryClassifier", title="Extensible classifiers as content", description="Specifies any type of classification of the evidence report.", json_schema_extra={ "element_property": True, }, ) entryQuantity: typing.List[fhirtypes.QuantityType] | None = Field( default=None, alias="entryQuantity", title="Quantity as content", description=None, json_schema_extra={ "element_property": True, }, ) entryReference: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="entryReference", title="Reference to resources as content", description=( "A reference to the actual resource from which the narrative in the " "section is derived." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) focus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="focus", title="Classification of section (recommended)", description=( "A code identifying the kind of content contained within the section. " "This should be consistent with the section title." ), json_schema_extra={ "element_property": True, }, ) focusReference: fhirtypes.ReferenceType | None = Field( default=None, alias="focusReference", title="Classification of section by Resource", description=( "A definitional Resource identifying the kind of content contained " "within the section. This should be consistent with the section title." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="working | snapshot | changes", description=( "How the entry list was prepared - whether it is a working list that is" " suitable for being maintained on an ongoing basis, or if it " "represents a snapshot of a list of items from another source, or " "whether it is a prepared list where items may be marked as added, " "modified or deleted." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["working", "snapshot", "changes"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) orderedBy: fhirtypes.CodeableConceptType | None = Field( default=None, alias="orderedBy", title="Order of section entries", description="Specifies the order applied to the items in the section entries.", json_schema_extra={ "element_property": True, }, ) section: typing.List[fhirtypes.EvidenceReportSectionType] | None = Field( default=None, alias="section", title="Nested Section", description="A nested sub-section within this section.", json_schema_extra={ "element_property": True, }, ) text: fhirtypes.NarrativeType | None = Field( default=None, alias="text", title="Text summary of the section, for human interpretation", description=( "A human-readable narrative that contains the attested content of the " "section, used to represent the content of the resource to a human. The" " narrative need not encode all the structured data, but is peferred to" " contain sufficient detail to make it acceptable for a human to just " "read the narrative." ), json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Label for section (e.g. for ToC)", description=( "The label for this particular section. This will be part of the " "rendered content for the document, and is often used to build a table " "of contents." ), json_schema_extra={ "element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceReportSection`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "title", "focus", "focusReference", "author", "text", "mode", "orderedBy", "entryClassifier", "entryReference", "entryQuantity", "emptyReason", "section", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceReportSection`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EvidenceReportSubject(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Focus of the report. Specifies the subject or focus of the report. Answers "What is this report about?". """ __resource_type__ = "EvidenceReportSubject" characteristic: typing.List[ fhirtypes.EvidenceReportSubjectCharacteristicType ] | None = Field( default=None, alias="characteristic", title="Characteristic", description=None, json_schema_extra={ "element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Footnotes and/or explanatory notes", description="Used for general notes and annotations not coded elsewhere.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceReportSubject`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "characteristic", "note"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceReportSubject`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class EvidenceReportSubjectCharacteristic(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Characteristic. """ __resource_type__ = "EvidenceReportSubjectCharacteristic" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Characteristic code", description=None, json_schema_extra={ "element_property": True, }, ) exclude: bool | None = Field( default=None, alias="exclude", title="Is used to express not the characteristic", description=None, json_schema_extra={ "element_property": True, }, ) exclude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_exclude", title="Extension field for ``exclude``." ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Timeframe for the characteristic", description=None, json_schema_extra={ "element_property": True, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Characteristic value", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Characteristic value", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Characteristic value", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Characteristic value", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Characteristic value", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceReportSubjectCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "valueReference", "valueCodeableConcept", "valueBoolean", "valueQuantity", "valueRange", "exclude", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceReportSubjectCharacteristic`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueCodeableConcept", "valueQuantity", "valueRange", "valueReference", ] } return one_of_many_fields ================================================ FILE: fhir/resources/evidencevariable.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/EvidenceVariable Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class EvidenceVariable(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A definition of an exposure, outcome, or other variable. The EvidenceVariable resource describes an element that knowledge (Evidence) is about. """ __resource_type__ = "EvidenceVariable" actual: bool | None = Field( default=None, alias="actual", title="Actual or conceptual", description=( "True if the actual variable measured, false if a conceptual " "representation of the intended variable." ), json_schema_extra={ "element_property": True, }, ) actual__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_actual", title="Extension field for ``actual``." ) approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the resource was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage. See guidance around (not) making local changes to elements " "[here](canonicalresource.html#localization)." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the content", description=( "An individiual or organization primarily involved in the creation and " "maintenance of the content." ), json_schema_extra={ "element_property": True, }, ) category: typing.List[fhirtypes.EvidenceVariableCategoryType] | None = Field( default=None, alias="category", title="A grouping for ordinal or polychotomous variables", description=None, json_schema_extra={ "element_property": True, }, ) characteristic: typing.List[ fhirtypes.EvidenceVariableCharacteristicType ] | None = Field( default=None, alias="characteristic", title="A defining factor of the EvidenceVariable", description=( "A defining factor of the EvidenceVariable. Multiple characteristics " 'are applied with "and" semantics.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the resource and/or its contents. " "Copyright statements are generally legal restrictions on the use and " "publishing of the resource." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the evidence variable was last " "significantly changed. The date must change when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the evidence variable " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the evidence variable", description=( "A free text natural language description of the evidence variable from" " a consumer's perspective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the content", description=( "An individual or organization primarily responsible for internal " "coherence of the content." ), json_schema_extra={ "element_property": True, }, ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the resource is expected to be used", description=( "The period during which the resource content was or is planned to be " "in active use." ), json_schema_extra={ "element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the content", description=( "An individual or organization asserted by the publisher to be " "responsible for officially endorsing the content for use in some " "setting." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this resource is authored for testing" " purposes (or education/evaluation/marketing) and is not intended to " "be used for genuine usage." ), json_schema_extra={ "element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) handling: fhirtypes.CodeType | None = Field( default=None, alias="handling", title="continuous | dichotomous | ordinal | polychotomous", description="The method of handling in statistical analysis.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["continuous", "dichotomous", "ordinal", "polychotomous"], }, ) handling__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_handling", title="Extension field for ``handling``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the evidence variable", description=( "A formal identifier that is used to identify this evidence variable " "when it is represented in other formats, or referenced in a " "specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the resource was last reviewed by the publisher", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this evidence variable (computer friendly)", description=( "A natural language name identifying the evidence variable. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Used for footnotes or explanatory notes", description=( "A human-readable string to clarify or explain concepts about the " "resource." ), json_schema_extra={ "element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the evidence variable." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this EvidenceVariable is defined", description=( "Explanation of why this EvidenceVariable is needed and why it has been" " designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Additional documentation, citations, etc", description=( "Related artifacts such as additional documentation, justification, or " "bibliographic references." ), json_schema_extra={ "element_property": True, }, ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the content", description=( "An individual or organization asserted by the publisher to be " "primarily responsible for review of some aspect of the content." ), json_schema_extra={ "element_property": True, }, ) shortTitle: fhirtypes.StringType | None = Field( default=None, alias="shortTitle", title="Title for use in informal contexts", description=( "The short title provides an alternate title for use in informal " "descriptive contexts where the full, formal title is not necessary." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) shortTitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_shortTitle", title="Extension field for ``shortTitle``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this evidence variable. Enables tracking the life-cycle " "of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this evidence variable (human friendly)", description="A short, descriptive, user-friendly title for the evidence variable.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this evidence variable, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this evidence variable when " "it is referenced in a specification, model, design or an instance; " "also called its canonical identifier. This SHOULD be globally unique " "and SHOULD be a literal address at which an authoritative instance of " "this evidence variable is (or will be) published. This URL can be the " "target of a canonical reference. It SHALL remain the same when the " "evidence variable is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate evidence variable instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the evidence variable", description=( "The identifier that is used to identify this version of the evidence " "variable when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the evidence variable " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence. To provide a version consistent with the " "Decision Support Service specification, use the format " "Major.Minor.Revision (e.g. 1.0.0). For more information on versioning " "knowledge assets, refer to the Decision Support Service specification." " Note that a version is required for non-experimental active " "artifacts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceVariable`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "shortTitle", "status", "experimental", "date", "publisher", "contact", "description", "note", "useContext", "purpose", "copyright", "copyrightLabel", "approvalDate", "lastReviewDate", "effectivePeriod", "author", "editor", "reviewer", "endorser", "relatedArtifact", "actual", "characteristic", "handling", "category", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceVariable`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "shortTitle", "status", "date", "publisher", "contact", "description", "useContext", "characteristic", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields class EvidenceVariableCategory(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A grouping for ordinal or polychotomous variables. """ __resource_type__ = "EvidenceVariableCategory" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Description of the grouping", description=None, json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Definition of the grouping", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Definition of the grouping", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Definition of the grouping", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceVariableCategory`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "valueCodeableConcept", "valueQuantity", "valueRange", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceVariableCategory`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": ["valueCodeableConcept", "valueQuantity", "valueRange"] } return one_of_many_fields class EvidenceVariableCharacteristic(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A defining factor of the EvidenceVariable. A defining factor of the EvidenceVariable. Multiple characteristics are applied with "and" semantics. """ __resource_type__ = "EvidenceVariableCharacteristic" definitionByCombination: fhirtypes.EvidenceVariableCharacteristicDefinitionByCombinationType | None = Field( default=None, alias="definitionByCombination", title="Used to specify how two or more characteristics are combined", description=( "Defines the characteristic as a combination of two or more " "characteristics." ), json_schema_extra={ "element_property": True, }, ) definitionByTypeAndValue: fhirtypes.EvidenceVariableCharacteristicDefinitionByTypeAndValueType | None = Field( default=None, alias="definitionByTypeAndValue", title="Defines the characteristic using type and value", description="Defines the characteristic using both a type and value[x] elements.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) definitionCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="definitionCanonical", title=( "Defines the characteristic (without using type and value) by a " "Canonical" ), description="Defines the characteristic using Canonical.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["EvidenceVariable", "Evidence"], }, ) definitionCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definitionCanonical", title="Extension field for ``definitionCanonical``.", ) definitionCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="definitionCodeableConcept", title=( "Defines the characteristic (without using type and value) by a " "CodeableConcept" ), description="Defines the characteristic using CodeableConcept.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) definitionExpression: fhirtypes.ExpressionType | None = Field( default=None, alias="definitionExpression", title=( "Defines the characteristic (without using type and value) by an " "expression" ), description="Defines the characteristic using Expression.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) definitionId: fhirtypes.IdType | None = Field( default=None, alias="definitionId", title="Defines the characteristic (without using type and value) by an id", description="Defines the characteristic using id.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) definitionId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definitionId", title="Extension field for ``definitionId``.", ) definitionReference: fhirtypes.ReferenceType | None = Field( default=None, alias="definitionReference", title=( "Defines the characteristic (without using type and value) by a " "Reference" ), description="Defines the characteristic using a Reference.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["EvidenceVariable", "Group", "Evidence"], }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the characteristic", description=( "A short, natural language description of the characteristic that could" " be used to communicate the criteria to an end-user." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) durationQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="durationQuantity", title="Length of time in which the characteristic is met", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e duration[x] "one_of_many": "duration", "one_of_many_required": False, }, ) durationRange: fhirtypes.RangeType | None = Field( default=None, alias="durationRange", title="Length of time in which the characteristic is met", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e duration[x] "one_of_many": "duration", "one_of_many_required": False, }, ) exclude: bool | None = Field( default=None, alias="exclude", title=( "Whether the characteristic is an inclusion criterion or exclusion " "criterion" ), description=( "When true, this characteristic is an exclusion criterion. In other " "words, not matching this characteristic definition is equivalent to " "meeting this criterion." ), json_schema_extra={ "element_property": True, }, ) exclude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_exclude", title="Extension field for ``exclude``." ) instancesQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="instancesQuantity", title="Number of occurrences meeting the characteristic", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e instances[x] "one_of_many": "instances", "one_of_many_required": False, }, ) instancesRange: fhirtypes.RangeType | None = Field( default=None, alias="instancesRange", title="Number of occurrences meeting the characteristic", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e instances[x] "one_of_many": "instances", "one_of_many_required": False, }, ) linkId: fhirtypes.IdType | None = Field( default=None, alias="linkId", title="Label for internal linking", description="Label used for when a characteristic refers to another characteristic.", json_schema_extra={ "element_property": True, }, ) linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Used for footnotes or explanatory notes", description=( "A human-readable string to clarify or explain concepts about the " "characteristic." ), json_schema_extra={ "element_property": True, }, ) timeFromEvent: typing.List[ fhirtypes.EvidenceVariableCharacteristicTimeFromEventType ] | None = Field( default=None, alias="timeFromEvent", title="Timing in which the characteristic is determined", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceVariableCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "linkId", "description", "note", "exclude", "definitionReference", "definitionCanonical", "definitionCodeableConcept", "definitionExpression", "definitionId", "definitionByTypeAndValue", "definitionByCombination", "instancesQuantity", "instancesRange", "durationQuantity", "durationRange", "timeFromEvent", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceVariableCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "definitionReference", "definitionCanonical", "definitionCodeableConcept", "definitionExpression", "definitionId", "definitionByTypeAndValue", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "duration": ["durationQuantity", "durationRange"], "instances": ["instancesQuantity", "instancesRange"], } return one_of_many_fields class EvidenceVariableCharacteristicDefinitionByCombination( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Used to specify how two or more characteristics are combined. Defines the characteristic as a combination of two or more characteristics. """ __resource_type__ = "EvidenceVariableCharacteristicDefinitionByCombination" characteristic: typing.List[fhirtypes.EvidenceVariableCharacteristicType] = Field( default=..., alias="characteristic", title="A defining factor of the characteristic", description=None, json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeType | None = Field( default=None, alias="code", title=( "all-of | any-of | at-least | at-most | statistical | net-effect | " "dataset" ), description=( "Used to specify if two or more characteristics are combined with OR or" " AND." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "all-of", "any-of", "at-least", "at-most", "statistical", "net-effect", "dataset", ], }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) threshold: fhirtypes.PositiveIntType | None = Field( default=None, alias="threshold", title='Provides the value of "n" when "at-least" or "at-most" codes are used', description=None, json_schema_extra={ "element_property": True, }, ) threshold__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_threshold", title="Extension field for ``threshold``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceVariableCharacteristicDefinitionByCombination`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "threshold", "characteristic", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceVariableCharacteristicDefinitionByCombination`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields class EvidenceVariableCharacteristicDefinitionByTypeAndValue( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Defines the characteristic using type and value. Defines the characteristic using both a type and value[x] elements. """ __resource_type__ = "EvidenceVariableCharacteristicDefinitionByTypeAndValue" device: fhirtypes.ReferenceType | None = Field( default=None, alias="device", title="Device used for determining characteristic", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device", "DeviceMetric"], }, ) method: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="method", title="Method for how the characteristic value was determined", description=None, json_schema_extra={ "element_property": True, }, ) offset: fhirtypes.CodeableConceptType | None = Field( default=None, alias="offset", title="Reference point for valueQuantity or valueRange", description=( "Defines the reference point for comparison when valueQuantity or " "valueRange is not compared to zero." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Expresses the type of characteristic", description="Used to express the type of characteristic.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Defines the characteristic when coupled with characteristic.type", description="Defines the characteristic when paired with characteristic.type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Defines the characteristic when coupled with characteristic.type", description="Defines the characteristic when paired with characteristic.type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId: fhirtypes.IdType | None = Field( default=None, alias="valueId", title="Defines the characteristic when coupled with characteristic.type", description="Defines the characteristic when paired with characteristic.type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueId", title="Extension field for ``valueId``." ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Defines the characteristic when coupled with characteristic.type", description="Defines the characteristic when paired with characteristic.type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Defines the characteristic when coupled with characteristic.type", description="Defines the characteristic when paired with characteristic.type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Defines the characteristic when coupled with characteristic.type", description="Defines the characteristic when paired with characteristic.type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceVariableCharacteristicDefinitionByTypeAndValue`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "method", "device", "valueCodeableConcept", "valueBoolean", "valueQuantity", "valueRange", "valueReference", "valueId", "offset", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceVariableCharacteristicDefinitionByTypeAndValue`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "valueCodeableConcept", "valueBoolean", "valueQuantity", "valueRange", "valueReference", "valueId", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueCodeableConcept", "valueId", "valueQuantity", "valueRange", "valueReference", ] } return one_of_many_fields class EvidenceVariableCharacteristicTimeFromEvent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Timing in which the characteristic is determined. """ __resource_type__ = "EvidenceVariableCharacteristicTimeFromEvent" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Human readable description", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) eventCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="eventCodeableConcept", title="The event used as a base point (reference point) in time", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e event[x] "one_of_many": "event", "one_of_many_required": False, }, ) eventDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="eventDateTime", title="The event used as a base point (reference point) in time", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e event[x] "one_of_many": "event", "one_of_many_required": False, }, ) eventDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_eventDateTime", title="Extension field for ``eventDateTime``.", ) eventId: fhirtypes.IdType | None = Field( default=None, alias="eventId", title="The event used as a base point (reference point) in time", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e event[x] "one_of_many": "event", "one_of_many_required": False, }, ) eventId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_eventId", title="Extension field for ``eventId``." ) eventReference: fhirtypes.ReferenceType | None = Field( default=None, alias="eventReference", title="The event used as a base point (reference point) in time", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e event[x] "one_of_many": "event", "one_of_many_required": False, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Used for footnotes or explanatory notes", description=( "A human-readable string to clarify or explain concepts about the " "timeFromEvent." ), json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title=( "Used to express the observation at a defined amount of time before or " "after the event" ), description=None, json_schema_extra={ "element_property": True, }, ) range: fhirtypes.RangeType | None = Field( default=None, alias="range", title=( "Used to express the observation within a period before and/or after " "the event" ), description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``EvidenceVariableCharacteristicTimeFromEvent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "note", "eventCodeableConcept", "eventReference", "eventDateTime", "eventId", "quantity", "range", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``EvidenceVariableCharacteristicTimeFromEvent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "event": [ "eventCodeableConcept", "eventDateTime", "eventId", "eventReference", ] } return one_of_many_fields ================================================ FILE: fhir/resources/examplescenario.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ExampleScenario Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ExampleScenario(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Example of workflow instance. """ __resource_type__ = "ExampleScenario" actor: typing.List[fhirtypes.ExampleScenarioActorType] | None = Field( default=None, alias="actor", title="Individual involved in exchange", description=( "A system or person who shares or receives an instance within the " "scenario." ), json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the example scenario and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the example scenario." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the example scenario was last " "significantly changed. The date must change when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the example scenario " "changes. (e.g. the 'content logical definition')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the ExampleScenario", description=( "A free text natural language description of the ExampleScenario from a" " consumer's perspective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this example scenario is authored for" " testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the example scenario", description=( "A formal identifier that is used to identify this example scenario " "when it is represented in other formats, or referenced in a " "specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instance: typing.List[fhirtypes.ExampleScenarioInstanceType] | None = Field( default=None, alias="instance", title="Data used in the scenario", description="A single data collection that is shared as part of the scenario.", json_schema_extra={ "element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for example scenario (if applicable)", description=( "A legal or geographic region in which the example scenario is intended" " to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="To be removed?", description="Temporarily retained for tooling purposes.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) process: typing.List[fhirtypes.ExampleScenarioProcessType] | None = Field( default=None, alias="process", title="Major process within scenario", description=( "A group of operations that represents a significant step within a " "scenario." ), json_schema_extra={ "element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the example scenario." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="The purpose of the example, e.g. to illustrate a scenario", description=( "What the example scenario resource is created for. This should not be " "used to show the business purpose of the scenario itself, but the " "purpose of documenting a scenario." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this example scenario. Enables tracking the life-cycle " "of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this example scenario (human friendly)", description="A short, descriptive, user-friendly title for the ExampleScenario.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this example scenario, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this example scenario when it" " is referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which an authoritative instance of this" " example scenario is (or will be) published. This URL can be the " "target of a canonical reference. It SHALL remain the same when the " "example scenario is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate example scenario instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the example scenario", description=( "The identifier that is used to identify this version of the example " "scenario when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the example scenario " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExampleScenario`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "copyrightLabel", "actor", "instance", "process", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExampleScenario`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields class ExampleScenarioActor(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Individual involved in exchange. A system or person who shares or receives an instance within the scenario. """ __resource_type__ = "ExampleScenarioActor" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Details about actor", description="An explanation of who/what the actor is and its role in the scenario.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) key: fhirtypes.StringType | None = Field( default=None, alias="key", title="ID or acronym of the actor", description=( "A unique string within the scenario that is used to reference the " "actor." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) key__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_key", title="Extension field for ``key``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Label for actor when rendering", description=( "The human-readable name for the actor used when rendering the " "scenario." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="person | system", description="The category of actor - person or system.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["person", "system"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExampleScenarioActor`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "key", "type", "title", "description", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExampleScenarioActor`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("key", "key__ext"), ("title", "title__ext"), ("type", "type__ext"), ] return required_fields class ExampleScenarioInstance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Data used in the scenario. A single data collection that is shared as part of the scenario. """ __resource_type__ = "ExampleScenarioInstance" containedInstance: typing.List[ fhirtypes.ExampleScenarioInstanceContainedInstanceType ] | None = Field( default=None, alias="containedInstance", title="Resources contained in the instance", description=( "References to other instances that can be found within this instance " "(e.g. the observations contained in a bundle)." ), json_schema_extra={ "element_property": True, }, ) content: fhirtypes.ReferenceType | None = Field( default=None, alias="content", title="Example instance data", description=( "Points to an instance (typically an example) that shows the data that " "would corespond to this instance." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Human-friendly description of the instance", description="An explanation of what the instance contains and what it's for.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) key: fhirtypes.StringType | None = Field( default=None, alias="key", title="ID or acronym of the instance", description=( "A unique string within the scenario that is used to reference the " "instance." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) key__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_key", title="Extension field for ``key``." ) structureProfileCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="structureProfileCanonical", title="Rules instance adheres to", description=( "Refers to a profile, template or other ruleset the instance adheres " "to." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e structureProfile[x] "one_of_many": "structureProfile", "one_of_many_required": False, }, ) structureProfileCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_structureProfileCanonical", title="Extension field for ``structureProfileCanonical``.", ) structureProfileUri: fhirtypes.UriType | None = Field( default=None, alias="structureProfileUri", title="Rules instance adheres to", description=( "Refers to a profile, template or other ruleset the instance adheres " "to." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e structureProfile[x] "one_of_many": "structureProfile", "one_of_many_required": False, }, ) structureProfileUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_structureProfileUri", title="Extension field for ``structureProfileUri``.", ) structureType: fhirtypes.CodingType = Field( default=..., alias="structureType", title="Data structure for example", description=( "A code indicating the kind of data structure (FHIR resource or some " "other standard) this is an instance of." ), json_schema_extra={ "element_property": True, }, ) structureVersion: fhirtypes.StringType | None = Field( default=None, alias="structureVersion", title="E.g. 4.0.1", description=( "Conveys the version of the data structure instantiated. I.e. what " "release of FHIR, X12, OpenEHR, etc. is instance compliant with." ), json_schema_extra={ "element_property": True, }, ) structureVersion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_structureVersion", title="Extension field for ``structureVersion``.", ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Label for instance", description=( "A short descriptive label the instance to be used in tables or " "diagrams." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) version: typing.List[fhirtypes.ExampleScenarioInstanceVersionType] | None = Field( default=None, alias="version", title="Snapshot of instance that changes", description="Represents the instance as it was at a specific time-point.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExampleScenarioInstance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "key", "structureType", "structureVersion", "structureProfileCanonical", "structureProfileUri", "title", "description", "content", "version", "containedInstance", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExampleScenarioInstance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("key", "key__ext"), ("title", "title__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "structureProfile": ["structureProfileCanonical", "structureProfileUri"] } return one_of_many_fields class ExampleScenarioInstanceContainedInstance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Resources contained in the instance. References to other instances that can be found within this instance (e.g. the observations contained in a bundle). """ __resource_type__ = "ExampleScenarioInstanceContainedInstance" instanceReference: fhirtypes.StringType | None = Field( default=None, alias="instanceReference", title="Key of contained instance", description="A reference to the key of an instance found within this one.", json_schema_extra={ "element_property": True, "element_required": True, }, ) instanceReference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instanceReference", title="Extension field for ``instanceReference``.", ) versionReference: fhirtypes.StringType | None = Field( default=None, alias="versionReference", title="Key of contained instance version", description=( "A reference to the key of a specific version of an instance in this " "instance." ), json_schema_extra={ "element_property": True, }, ) versionReference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionReference", title="Extension field for ``versionReference``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExampleScenarioInstanceContainedInstance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "instanceReference", "versionReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExampleScenarioInstanceContainedInstance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("instanceReference", "instanceReference__ext")] return required_fields class ExampleScenarioInstanceVersion(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Snapshot of instance that changes. Represents the instance as it was at a specific time-point. """ __resource_type__ = "ExampleScenarioInstanceVersion" content: fhirtypes.ReferenceType | None = Field( default=None, alias="content", title="Example instance version data", description=( "Points to an instance (typically an example) that shows the data that " "would flow at this point in the scenario." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Details about version", description=( "An explanation of what this specific version of the instance contains " "and represents." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) key: fhirtypes.StringType | None = Field( default=None, alias="key", title="ID or acronym of the version", description=( "A unique string within the instance that is used to reference the " "version of the instance." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) key__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_key", title="Extension field for ``key``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Label for instance version", description=( "A short descriptive label the version to be used in tables or " "diagrams." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExampleScenarioInstanceVersion`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "key", "title", "description", "content", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExampleScenarioInstanceVersion`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("key", "key__ext"), ("title", "title__ext")] return required_fields class ExampleScenarioProcess(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Major process within scenario. A group of operations that represents a significant step within a scenario. """ __resource_type__ = "ExampleScenarioProcess" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Human-friendly description of the process", description="An explanation of what the process represents and what it does.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) postConditions: fhirtypes.MarkdownType | None = Field( default=None, alias="postConditions", title="Status after successful completion", description=( "Description of the final state of the actors, environment and data " "after the process has been successfully completed." ), json_schema_extra={ "element_property": True, }, ) postConditions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_postConditions", title="Extension field for ``postConditions``.", ) preConditions: fhirtypes.MarkdownType | None = Field( default=None, alias="preConditions", title="Status before process starts", description=( "Description of the initial state of the actors, environment and data " "before the process starts." ), json_schema_extra={ "element_property": True, }, ) preConditions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preConditions", title="Extension field for ``preConditions``.", ) step: typing.List[fhirtypes.ExampleScenarioProcessStepType] | None = Field( default=None, alias="step", title="Event within of the process", description="A significant action that occurs as part of the process.", json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Label for procss", description=( "A short descriptive label the process to be used in tables or " "diagrams." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExampleScenarioProcess`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "title", "description", "preConditions", "postConditions", "step", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExampleScenarioProcess`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "title"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("title", "title__ext")] return required_fields class ExampleScenarioProcessStep(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Event within of the process. A significant action that occurs as part of the process. """ __resource_type__ = "ExampleScenarioProcessStep" alternative: typing.List[ fhirtypes.ExampleScenarioProcessStepAlternativeType ] | None = Field( default=None, alias="alternative", title="Alternate non-typical step action", description=( "Indicates an alternative step that can be taken instead of the sub-" "process, scenario or operation. E.g. to represent non-happy-" "path/exceptional/atypical circumstances." ), json_schema_extra={ "element_property": True, }, ) number: fhirtypes.StringType | None = Field( default=None, alias="number", title="Sequential number of the step", description="The sequential number of the step, e.g. 1.2.5.", json_schema_extra={ "element_property": True, }, ) number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_number", title="Extension field for ``number``." ) operation: fhirtypes.ExampleScenarioProcessStepOperationType | None = Field( default=None, alias="operation", title="Step is simple action", description="The step represents a single operation invoked on receiver by sender.", json_schema_extra={ "element_property": True, }, ) pause: bool | None = Field( default=None, alias="pause", title="Pause in the flow?", description=( "If true, indicates that, following this step, there is a pause in the " "flow and the subsequent step will occur at some later time (triggered " "by some event)." ), json_schema_extra={ "element_property": True, }, ) pause__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_pause", title="Extension field for ``pause``." ) process: fhirtypes.ExampleScenarioProcessType | None = Field( default=None, alias="process", title="Step is nested process", description="Indicates that the step is a complex sub-process with its own steps.", json_schema_extra={ "element_property": True, }, ) workflow: fhirtypes.CanonicalType | None = Field( default=None, alias="workflow", title="Step is nested workflow", description="Indicates that the step is defined by a seaparate scenario instance.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ExampleScenario"], }, ) workflow__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_workflow", title="Extension field for ``workflow``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExampleScenarioProcessStep`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "number", "process", "workflow", "operation", "alternative", "pause", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExampleScenarioProcessStep`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExampleScenarioProcessStepAlternative(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Alternate non-typical step action. Indicates an alternative step that can be taken instead of the sub-process, scenario or operation. E.g. to represent non-happy- path/exceptional/atypical circumstances. """ __resource_type__ = "ExampleScenarioProcessStepAlternative" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Human-readable description of option", description=( "A human-readable description of the alternative explaining when the " "alternative should occur rather than the base step." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) step: typing.List[fhirtypes.ExampleScenarioProcessStepType] | None = Field( default=None, alias="step", title="Alternative action(s)", description=( "Indicates the operation, sub-process or scenario that happens if the " "alternative option is selected." ), json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Label for alternative", description=( "The label to display for the alternative that gives a sense of the " "circumstance in which the alternative should be invoked." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExampleScenarioProcessStepAlternative`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "title", "description", "step"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExampleScenarioProcessStepAlternative`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("title", "title__ext")] return required_fields class ExampleScenarioProcessStepOperation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Step is simple action. The step represents a single operation invoked on receiver by sender. """ __resource_type__ = "ExampleScenarioProcessStepOperation" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Human-friendly description of the operation", description="An explanation of what the operation represents and what it does.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) initiator: fhirtypes.StringType | None = Field( default=None, alias="initiator", title="Who starts the operation", description="The system that invokes the action/transmits the data.", json_schema_extra={ "element_property": True, }, ) initiator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_initiator", title="Extension field for ``initiator``." ) initiatorActive: bool | None = Field( default=None, alias="initiatorActive", title="Initiator stays active?", description="If false, the initiator is deactivated right after the operation.", json_schema_extra={ "element_property": True, }, ) initiatorActive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_initiatorActive", title="Extension field for ``initiatorActive``.", ) receiver: fhirtypes.StringType | None = Field( default=None, alias="receiver", title="Who receives the operation", description="The system on which the action is invoked/receives the data.", json_schema_extra={ "element_property": True, }, ) receiver__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_receiver", title="Extension field for ``receiver``." ) receiverActive: bool | None = Field( default=None, alias="receiverActive", title="Receiver stays active?", description="If false, the receiver is deactivated right after the operation.", json_schema_extra={ "element_property": True, }, ) receiverActive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_receiverActive", title="Extension field for ``receiverActive``.", ) request: fhirtypes.ExampleScenarioInstanceContainedInstanceType | None = Field( default=None, alias="request", title="Instance transmitted on invocation", description=( "A reference to the instance that is transmitted from requester to " "receiver as part of the invocation of the operation." ), json_schema_extra={ "element_property": True, }, ) response: fhirtypes.ExampleScenarioInstanceContainedInstanceType | None = Field( default=None, alias="response", title="Instance transmitted on invocation response", description=( "A reference to the instance that is transmitted from receiver to " "requester as part of the operation's synchronous response (if any)." ), json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Label for step", description="A short descriptive label the step to be used in tables or diagrams.", json_schema_extra={ "element_property": True, "element_required": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) type: fhirtypes.CodingType | None = Field( default=None, alias="type", title="Kind of action", description="The standardized type of action (FHIR or otherwise).", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExampleScenarioProcessStepOperation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "title", "initiator", "receiver", "description", "initiatorActive", "receiverActive", "request", "response", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExampleScenarioProcessStepOperation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("title", "title__ext")] return required_fields ================================================ FILE: fhir/resources/explanationofbenefit.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ExplanationOfBenefit Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ExplanationOfBenefit(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Explanation of Benefit resource. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. """ __resource_type__ = "ExplanationOfBenefit" accident: fhirtypes.ExplanationOfBenefitAccidentType | None = Field( default=None, alias="accident", title="Details of the event", description=( "Details of a accident which resulted in injuries which required the " "products and services listed in the claim." ), json_schema_extra={ "element_property": True, }, ) addItem: typing.List[fhirtypes.ExplanationOfBenefitAddItemType] | None = Field( default=None, alias="addItem", title="Insurer added line items", description=( "The first-tier service adjudications for payor added product or " "service lines." ), json_schema_extra={ "element_property": True, }, ) adjudication: typing.List[ fhirtypes.ExplanationOfBenefitItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Header-level adjudication", description=( "The adjudication results which are presented at the header level " "rather than at the line-item or add-item levels." ), json_schema_extra={ "element_property": True, }, ) benefitBalance: typing.List[ fhirtypes.ExplanationOfBenefitBenefitBalanceType ] | None = Field( default=None, alias="benefitBalance", title="Balance by Benefit Category", description=None, json_schema_extra={ "element_property": True, }, ) benefitPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="benefitPeriod", title="When the benefits are applicable", description="The term of the benefits documented in this response.", json_schema_extra={ "element_property": True, }, ) billablePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="billablePeriod", title="Relevant time frame for the claim", description="The period for which charges are being submitted.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) careTeam: typing.List[fhirtypes.ExplanationOfBenefitCareTeamType] | None = Field( default=None, alias="careTeam", title="Care Team members", description="The members of the team who provided the products and services.", json_schema_extra={ "element_property": True, }, ) claim: fhirtypes.ReferenceType | None = Field( default=None, alias="claim", title="Claim reference", description=( "The business identifier for the instance of the adjudication request: " "claim predetermination or preauthorization." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Claim"], }, ) claimResponse: fhirtypes.ReferenceType | None = Field( default=None, alias="claimResponse", title="Claim response reference", description=( "The business identifier for the instance of the adjudication response:" " claim, predetermination or preauthorization response." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ClaimResponse"], }, ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Response creation date", description="The date this resource was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) decision: fhirtypes.CodeableConceptType | None = Field( default=None, alias="decision", title="Result of the adjudication", description=( "The result of the claim, predetermination, or preauthorization " "adjudication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) diagnosis: typing.List[fhirtypes.ExplanationOfBenefitDiagnosisType] | None = Field( default=None, alias="diagnosis", title="Pertinent diagnosis information", description="Information about diagnoses relevant to the claim items.", json_schema_extra={ "element_property": True, }, ) diagnosisRelatedGroup: fhirtypes.CodeableConceptType | None = Field( default=None, alias="diagnosisRelatedGroup", title="Package billing code", description=( "A package billing code or bundle code used to group products and " "services to a particular health condition (such as heart attack) which" " is based on a predetermined grouping code system." ), json_schema_extra={ "element_property": True, }, ) disposition: fhirtypes.StringType | None = Field( default=None, alias="disposition", title="Disposition Message", description="A human readable description of the status of the adjudication.", json_schema_extra={ "element_property": True, }, ) disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_disposition", title="Extension field for ``disposition``." ) encounter: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="encounter", title="Encounters associated with the listed treatments", description="Healthcare encounters related to this claim.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) enterer: fhirtypes.ReferenceType | None = Field( default=None, alias="enterer", title="Author of the claim", description=( "Individual who created the claim, predetermination or " "preauthorization." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Patient", "RelatedPerson", ], }, ) event: typing.List[fhirtypes.ExplanationOfBenefitEventType] | None = Field( default=None, alias="event", title="Event information", description="Information code for an event with a corresponding date or period.", json_schema_extra={ "element_property": True, }, ) facility: fhirtypes.ReferenceType | None = Field( default=None, alias="facility", title="Servicing Facility", description="Facility where the services were provided.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location", "Organization"], }, ) form: fhirtypes.AttachmentType | None = Field( default=None, alias="form", title="Printed reference or actual form", description=( "The actual form, by reference or inclusion, for printing the content " "or an EOB." ), json_schema_extra={ "element_property": True, }, ) formCode: fhirtypes.CodeableConceptType | None = Field( default=None, alias="formCode", title="Printed form identifier", description="A code for the form to be used for printing the content.", json_schema_extra={ "element_property": True, }, ) fundsReserve: fhirtypes.CodeableConceptType | None = Field( default=None, alias="fundsReserve", title="Funds reserved status", description=( "A code, used only on a response to a preauthorization, to indicate " "whether the benefits payable have been reserved and for whom." ), json_schema_extra={ "element_property": True, }, ) fundsReserveRequested: fhirtypes.CodeableConceptType | None = Field( default=None, alias="fundsReserveRequested", title="For whom to reserve funds", description=( "A code to indicate whether and for whom funds are to be reserved for " "future claims." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for the resource", description="A unique identifier assigned to this explanation of benefit.", json_schema_extra={ "element_property": True, }, ) insurance: typing.List[fhirtypes.ExplanationOfBenefitInsuranceType] | None = Field( default=None, alias="insurance", title="Patient insurance information", description=( "Financial instruments for reimbursement for the health care products " "and services specified on the claim." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) insurer: fhirtypes.ReferenceType | None = Field( default=None, alias="insurer", title="Party responsible for reimbursement", description=( "The party responsible for authorization, adjudication and " "reimbursement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) item: typing.List[fhirtypes.ExplanationOfBenefitItemType] | None = Field( default=None, alias="item", title="Product or service provided", description=( "A claim line. Either a simple (a product or service) or a 'group' of " "details which can also be a simple items or groups of sub-details." ), json_schema_extra={ "element_property": True, }, ) originalPrescription: fhirtypes.ReferenceType | None = Field( default=None, alias="originalPrescription", title="Original prescription if superceded by fulfiller", description=( "Original prescription which has been superseded by this prescription " "to support the dispensing of pharmacy services, medications or " "products." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicationRequest"], }, ) outcome: fhirtypes.CodeType | None = Field( default=None, alias="outcome", title="queued | complete | error | partial", description=( "The outcome of the claim, predetermination, or preauthorization " "processing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["queued", "complete", "error", "partial"], }, ) outcome__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_outcome", title="Extension field for ``outcome``." ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="The recipient of the products and services", description=( "The party to whom the professional services and/or products have been " "supplied or are being considered and for whom actual for forecast " "reimbursement is sought." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) patientPaid: fhirtypes.MoneyType | None = Field( default=None, alias="patientPaid", title="Paid by the patient", description=( "The amount paid by the patient, in total at the claim claim level or " "specifically for the item and detail level, to the provider for goods " "and services." ), json_schema_extra={ "element_property": True, }, ) payee: fhirtypes.ExplanationOfBenefitPayeeType | None = Field( default=None, alias="payee", title="Recipient of benefits payable", description=( "The party to be reimbursed for cost of the products and services " "according to the terms of the policy." ), json_schema_extra={ "element_property": True, }, ) payment: fhirtypes.ExplanationOfBenefitPaymentType | None = Field( default=None, alias="payment", title="Payment Details", description="Payment details for the adjudication of the claim.", json_schema_extra={ "element_property": True, }, ) preAuthRef: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="preAuthRef", title="Preauthorization reference", description=( "Reference from the Insurer which is used in later communications which" " refers to this adjudication." ), json_schema_extra={ "element_property": True, }, ) preAuthRef__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_preAuthRef", title="Extension field for ``preAuthRef``." ) preAuthRefPeriod: typing.List[fhirtypes.PeriodType] | None = Field( default=None, alias="preAuthRefPeriod", title="Preauthorization in-effect period", description=( "The timeframe during which the supplied preauthorization reference may" " be quoted on claims to obtain the adjudication as provided." ), json_schema_extra={ "element_property": True, }, ) precedence: fhirtypes.PositiveIntType | None = Field( default=None, alias="precedence", title="Precedence (primary, secondary, etc.)", description=( "This indicates the relative order of a series of EOBs related to " "different coverages for the same suite of services." ), json_schema_extra={ "element_property": True, }, ) precedence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_precedence", title="Extension field for ``precedence``." ) prescription: fhirtypes.ReferenceType | None = Field( default=None, alias="prescription", title="Prescription authorizing services or products", description=( "Prescription is the document/authorization given to the claim author " "for them to provide products and services for which consideration " "(reimbursement) is sought. Could be a RX for medications, an 'order' " "for oxygen or wheelchair or physiotherapy treatments." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicationRequest", "VisionPrescription"], }, ) priority: fhirtypes.CodeableConceptType | None = Field( default=None, alias="priority", title="Desired processing urgency", description=( "The provider-required urgency of processing the request. Typical " "values include: stat, normal deferred." ), json_schema_extra={ "element_property": True, }, ) procedure: typing.List[fhirtypes.ExplanationOfBenefitProcedureType] | None = Field( default=None, alias="procedure", title="Clinical procedures performed", description=( "Procedures performed on the patient relevant to the billing items with" " the claim." ), json_schema_extra={ "element_property": True, }, ) processNote: typing.List[ fhirtypes.ExplanationOfBenefitProcessNoteType ] | None = Field( default=None, alias="processNote", title="Note concerning adjudication", description=( "A note that describes or explains adjudication results in a human " "readable form." ), json_schema_extra={ "element_property": True, }, ) provider: fhirtypes.ReferenceType | None = Field( default=None, alias="provider", title="Party responsible for the claim", description=( "The provider which is responsible for the claim, predetermination or " "preauthorization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) referral: fhirtypes.ReferenceType | None = Field( default=None, alias="referral", title="Treatment Referral", description=( "The referral information received by the claim author, it is not to be" " used when the author generates a referral for a patient. A copy of " "that referral may be provided as supporting information. Some insurers" " require proof of referral to pay for services or to pay specialist " "rates for services." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ServiceRequest"], }, ) related: typing.List[fhirtypes.ExplanationOfBenefitRelatedType] | None = Field( default=None, alias="related", title="Prior or corollary claims", description=( "Other claims which are related to this claim such as prior submissions" " or claims for related services or for the same event." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subType", title="More granular claim type", description=( "A finer grained suite of claim type codes which may convey additional " "information such as Inpatient vs Outpatient and/or a specialty " "service." ), json_schema_extra={ "element_property": True, }, ) supportingInfo: typing.List[ fhirtypes.ExplanationOfBenefitSupportingInfoType ] | None = Field( default=None, alias="supportingInfo", title="Supporting information", description=( "Additional information codes regarding exceptions, special " "considerations, the condition, situation, prior or concurrent issues." ), json_schema_extra={ "element_property": True, }, ) total: typing.List[fhirtypes.ExplanationOfBenefitTotalType] | None = Field( default=None, alias="total", title="Adjudication totals", description="Categorized monetary totals for the adjudication.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="traceNumber", title="Number for tracking", description=( "Trace number for tracking purposes. May be defined at the jurisdiction" " level or between trading partners." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Category or discipline", description=( "The category of claim, e.g. oral, pharmacy, vision, institutional, " "professional." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="claim | preauthorization | predetermination", description=( "A code to indicate whether the nature of the request is: Claim - A " "request to an Insurer to adjudicate the supplied charges for health " "care goods and services under the identified policy and to pay the " "determined Benefit amount, if any; Preauthorization - A request to an " "Insurer to adjudicate the supplied proposed future charges for health " "care goods and services under the identified policy and to approve the" " services and provide the expected benefit amounts and potentially to " "reserve funds to pay the benefits when Claims for the indicated " "services are later submitted; or, Pre-determination - A request to an " "Insurer to adjudicate the supplied 'what if' charges for health care " "goods and services under the identified policy and report back what " "the Benefit payable would be had the services actually been provided." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["claim", "preauthorization", "predetermination"], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefit`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "traceNumber", "status", "type", "subType", "use", "patient", "billablePeriod", "created", "enterer", "insurer", "provider", "priority", "fundsReserveRequested", "fundsReserve", "related", "prescription", "originalPrescription", "event", "payee", "referral", "encounter", "facility", "claim", "claimResponse", "outcome", "decision", "disposition", "preAuthRef", "preAuthRefPeriod", "diagnosisRelatedGroup", "careTeam", "supportingInfo", "diagnosis", "procedure", "precedence", "insurance", "accident", "patientPaid", "item", "addItem", "adjudication", "total", "payment", "formCode", "form", "processNote", "benefitPeriod", "benefitBalance", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefit`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "status", "type", "use", "patient", "billablePeriod", "created", "insurer", "provider", "outcome", "decision", "insurance", "total", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("created", "created__ext"), ("outcome", "outcome__ext"), ("status", "status__ext"), ("use", "use__ext"), ] return required_fields class ExplanationOfBenefitAccident(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details of the event. Details of a accident which resulted in injuries which required the products and services listed in the claim. """ __resource_type__ = "ExplanationOfBenefitAccident" date: fhirtypes.DateType | None = Field( default=None, alias="date", title="When the incident occurred", description=( "Date of an accident event related to the products and services " "contained in the claim." ), json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) locationAddress: fhirtypes.AddressType | None = Field( default=None, alias="locationAddress", title="Where the event occurred", description="The physical location of the accident event.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="locationReference", title="Where the event occurred", description="The physical location of the accident event.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The nature of the accident", description=( "The type or context of the accident event for the purposes of " "selection of potential insurance coverages and determination of " "coordination between insurers." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitAccident`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "date", "type", "locationAddress", "locationReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitAccident`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"location": ["locationAddress", "locationReference"]} return one_of_many_fields class ExplanationOfBenefitAddItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Insurer added line items. The first-tier service adjudications for payor added product or service lines. """ __resource_type__ = "ExplanationOfBenefitAddItem" adjudication: typing.List[ fhirtypes.ExplanationOfBenefitItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Added items adjudication", description="The adjudication results.", json_schema_extra={ "element_property": True, }, ) bodySite: typing.List[ fhirtypes.ExplanationOfBenefitAddItemBodySiteType ] | None = Field( default=None, alias="bodySite", title="Anatomical location", description="Physical location where the service is performed or applies.", json_schema_extra={ "element_property": True, }, ) detail: typing.List[fhirtypes.ExplanationOfBenefitAddItemDetailType] | None = Field( default=None, alias="detail", title="Insurer added line items", description="The second-tier service adjudications for payor added services.", json_schema_extra={ "element_property": True, }, ) detailSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="detailSequence", title="Detail sequence number", description=( "The sequence number of the details within the claim item which this " "line is intended to replace." ), json_schema_extra={ "element_property": True, }, ) detailSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_detailSequence", title="Extension field for ``detailSequence``.", ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) itemSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="itemSequence", title="Item sequence number", description="Claim items which this service line is intended to replace.", json_schema_extra={ "element_property": True, }, ) itemSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_itemSequence", title="Extension field for ``itemSequence``.", ) locationAddress: fhirtypes.AddressType | None = Field( default=None, alias="locationAddress", title="Place of service or where product was supplied", description="Where the product or service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="locationCodeableConcept", title="Place of service or where product was supplied", description="Where the product or service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="locationReference", title="Place of service or where product was supplied", description="Where the product or service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The total amount claimed for the group (if a grouper) or the addItem. " "Net = unit price * quantity * factor." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="Applicable note numbers", description=( "The numbers associated with notes below which apply to the " "adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) patientPaid: fhirtypes.MoneyType | None = Field( default=None, alias="patientPaid", title="Paid by the patient", description=( "The amount paid by the patient, in total at the claim claim level or " "specifically for the item and detail level, to the provider for goods " "and services." ), json_schema_extra={ "element_property": True, }, ) productOrService: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrService", title="Billing, service, product, or drug code", description=( "When the value is a group code then this item collects a set of " "related item details, otherwise this contains the product, service, " "drug or other billing code for the item. This element may be the start" " of a range of .productOrService codes used in conjunction with " ".productOrServiceEnd or it may be a solo element where " ".productOrServiceEnd is not used." ), json_schema_extra={ "element_property": True, }, ) productOrServiceEnd: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrServiceEnd", title="End of a range of codes", description=( "This contains the end of a range of product, service, drug or other " "billing codes for the item. This element is not used when the " ".productOrService is a group code. This value may only be present when" " a .productOfService code has been provided to convey the start of the" " range. Typically this value may be used only with preauthorizations " "and not with claims." ), json_schema_extra={ "element_property": True, }, ) programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="programCode", title="Program the product or service is provided under", description="Identifies the program under which this may be recovered.", json_schema_extra={ "element_property": True, }, ) provider: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="provider", title="Authorized providers", description=( "The providers who are authorized for the services rendered to the " "patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) request: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="request", title="Request or Referral for Service", description="Request or Referral for Goods or Service to be rendered.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "DeviceRequest", "MedicationRequest", "NutritionOrder", "ServiceRequest", "SupplyRequest", "VisionPrescription", ], }, ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of revenue or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) reviewOutcome: fhirtypes.ExplanationOfBenefitItemReviewOutcomeType | None = Field( default=None, alias="reviewOutcome", title="Additem level adjudication results", description=( "The high-level results of the adjudication if adjudication has been " "performed." ), json_schema_extra={ "element_property": True, }, ) servicedDate: fhirtypes.DateType | None = Field( default=None, alias="servicedDate", title="Date or dates of service or product delivery", description=( "The date or dates when the service or product was supplied, performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_servicedDate", title="Extension field for ``servicedDate``.", ) servicedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="servicedPeriod", title="Date or dates of service or product delivery", description=( "The date or dates when the service or product was supplied, performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) subDetailSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="subDetailSequence", title="Subdetail sequence number", description=( "The sequence number of the sub-details woithin the details within the " "claim item which this line is intended to replace." ), json_schema_extra={ "element_property": True, }, ) subDetailSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_subDetailSequence", title="Extension field for ``subDetailSequence``.", ) tax: fhirtypes.MoneyType | None = Field( default=None, alias="tax", title="Total tax", description="The total of taxes applicable for this product or service.", json_schema_extra={ "element_property": True, }, ) traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="traceNumber", title="Number for tracking", description=( "Trace number for tracking purposes. May be defined at the jurisdiction" " level or between trading partners." ), json_schema_extra={ "element_property": True, }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description=( "If the item is not a group then this is the fee for the product or " "service, otherwise this is the total of the fees for the details of " "the group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitAddItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "itemSequence", "detailSequence", "subDetailSequence", "traceNumber", "provider", "revenue", "productOrService", "productOrServiceEnd", "request", "modifier", "programCode", "servicedDate", "servicedPeriod", "locationCodeableConcept", "locationAddress", "locationReference", "patientPaid", "quantity", "unitPrice", "factor", "tax", "net", "bodySite", "noteNumber", "reviewOutcome", "adjudication", "detail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitAddItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "location": [ "locationAddress", "locationCodeableConcept", "locationReference", ], "serviced": ["servicedDate", "servicedPeriod"], } return one_of_many_fields class ExplanationOfBenefitAddItemBodySite(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Anatomical location. Physical location where the service is performed or applies. """ __resource_type__ = "ExplanationOfBenefitAddItemBodySite" site: typing.List[fhirtypes.CodeableReferenceType] = Field( default=..., alias="site", title="Location", description="Physical service site on the patient (limb, tooth, etc.).", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["BodyStructure"], }, ) subSite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="subSite", title="Sub-location", description=( "A region or surface of the bodySite, e.g. limb region or tooth " "surface(s)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitAddItemBodySite`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "site", "subSite"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitAddItemBodySite`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitAddItemDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Insurer added line items. The second-tier service adjudications for payor added services. """ __resource_type__ = "ExplanationOfBenefitAddItemDetail" adjudication: typing.List[ fhirtypes.ExplanationOfBenefitItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Added items adjudication", description="The adjudication results.", json_schema_extra={ "element_property": True, }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The total amount claimed for the group (if a grouper) or the " "addItem.detail. Net = unit price * quantity * factor." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="Applicable note numbers", description=( "The numbers associated with notes below which apply to the " "adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) patientPaid: fhirtypes.MoneyType | None = Field( default=None, alias="patientPaid", title="Paid by the patient", description=( "The amount paid by the patient, in total at the claim claim level or " "specifically for the item and detail level, to the provider for goods " "and services." ), json_schema_extra={ "element_property": True, }, ) productOrService: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrService", title="Billing, service, product, or drug code", description=( "When the value is a group code then this item collects a set of " "related item details, otherwise this contains the product, service, " "drug or other billing code for the item. This element may be the start" " of a range of .productOrService codes used in conjunction with " ".productOrServiceEnd or it may be a solo element where " ".productOrServiceEnd is not used." ), json_schema_extra={ "element_property": True, }, ) productOrServiceEnd: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrServiceEnd", title="End of a range of codes", description=( "This contains the end of a range of product, service, drug or other " "billing codes for the item. This element is not used when the " ".productOrService is a group code. This value may only be present when" " a .productOfService code has been provided to convey the start of the" " range. Typically this value may be used only with preauthorizations " "and not with claims." ), json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of revenue or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) reviewOutcome: fhirtypes.ExplanationOfBenefitItemReviewOutcomeType | None = Field( default=None, alias="reviewOutcome", title="Additem detail level adjudication results", description=( "The high-level results of the adjudication if adjudication has been " "performed." ), json_schema_extra={ "element_property": True, }, ) subDetail: typing.List[ fhirtypes.ExplanationOfBenefitAddItemDetailSubDetailType ] | None = Field( default=None, alias="subDetail", title="Insurer added line items", description="The third-tier service adjudications for payor added services.", json_schema_extra={ "element_property": True, }, ) tax: fhirtypes.MoneyType | None = Field( default=None, alias="tax", title="Total tax", description="The total of taxes applicable for this product or service.", json_schema_extra={ "element_property": True, }, ) traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="traceNumber", title="Number for tracking", description=( "Trace number for tracking purposes. May be defined at the jurisdiction" " level or between trading partners." ), json_schema_extra={ "element_property": True, }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description=( "If the item is not a group then this is the fee for the product or " "service, otherwise this is the total of the fees for the details of " "the group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitAddItemDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "traceNumber", "revenue", "productOrService", "productOrServiceEnd", "modifier", "patientPaid", "quantity", "unitPrice", "factor", "tax", "net", "noteNumber", "reviewOutcome", "adjudication", "subDetail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitAddItemDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitAddItemDetailSubDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Insurer added line items. The third-tier service adjudications for payor added services. """ __resource_type__ = "ExplanationOfBenefitAddItemDetailSubDetail" adjudication: typing.List[ fhirtypes.ExplanationOfBenefitItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Added items adjudication", description="The adjudication results.", json_schema_extra={ "element_property": True, }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The total amount claimed for the addItem.detail.subDetail. Net = unit " "price * quantity * factor." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="Applicable note numbers", description=( "The numbers associated with notes below which apply to the " "adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) patientPaid: fhirtypes.MoneyType | None = Field( default=None, alias="patientPaid", title="Paid by the patient", description=( "The amount paid by the patient, in total at the claim claim level or " "specifically for the item and detail level, to the provider for goods " "and services." ), json_schema_extra={ "element_property": True, }, ) productOrService: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrService", title="Billing, service, product, or drug code", description=( "When the value is a group code then this item collects a set of " "related item details, otherwise this contains the product, service, " "drug or other billing code for the item. This element may be the start" " of a range of .productOrService codes used in conjunction with " ".productOrServiceEnd or it may be a solo element where " ".productOrServiceEnd is not used." ), json_schema_extra={ "element_property": True, }, ) productOrServiceEnd: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrServiceEnd", title="End of a range of codes", description=( "This contains the end of a range of product, service, drug or other " "billing codes for the item. This element is not used when the " ".productOrService is a group code. This value may only be present when" " a .productOfService code has been provided to convey the start of the" " range. Typically this value may be used only with preauthorizations " "and not with claims." ), json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of revenue or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) reviewOutcome: fhirtypes.ExplanationOfBenefitItemReviewOutcomeType | None = Field( default=None, alias="reviewOutcome", title="Additem subdetail level adjudication results", description=( "The high-level results of the adjudication if adjudication has been " "performed." ), json_schema_extra={ "element_property": True, }, ) tax: fhirtypes.MoneyType | None = Field( default=None, alias="tax", title="Total tax", description="The total of taxes applicable for this product or service.", json_schema_extra={ "element_property": True, }, ) traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="traceNumber", title="Number for tracking", description=( "Trace number for tracking purposes. May be defined at the jurisdiction" " level or between trading partners." ), json_schema_extra={ "element_property": True, }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description=( "If the item is not a group then this is the fee for the product or " "service, otherwise this is the total of the fees for the details of " "the group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitAddItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "traceNumber", "revenue", "productOrService", "productOrServiceEnd", "modifier", "patientPaid", "quantity", "unitPrice", "factor", "tax", "net", "noteNumber", "reviewOutcome", "adjudication", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitAddItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitBenefitBalance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Balance by Benefit Category. """ __resource_type__ = "ExplanationOfBenefitBenefitBalance" category: fhirtypes.CodeableConceptType = Field( default=..., alias="category", title="Benefit classification", description=( "Code to identify the general type of benefits under which products and" " services are provided." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Description of the benefit or services covered", description="A richer description of the benefit or services covered.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) excluded: bool | None = Field( default=None, alias="excluded", title="Excluded from the plan", description=( "True if the indicated class of service is excluded from the plan, " "missing or False indicates the product or service is included in the " "coverage." ), json_schema_extra={ "element_property": True, }, ) excluded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_excluded", title="Extension field for ``excluded``." ) financial: typing.List[ fhirtypes.ExplanationOfBenefitBenefitBalanceFinancialType ] | None = Field( default=None, alias="financial", title="Benefit Summary", description="Benefits Used to date.", json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Short name for the benefit", description="A short name or tag for the benefit.", json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) network: fhirtypes.CodeableConceptType | None = Field( default=None, alias="network", title="In or out of network", description=( "Is a flag to indicate whether the benefits refer to in-network " "providers or out-of-network providers." ), json_schema_extra={ "element_property": True, }, ) term: fhirtypes.CodeableConceptType | None = Field( default=None, alias="term", title="Annual or lifetime", description=( "The term or period of the values such as 'maximum lifetime benefit' or" " 'maximum annual visits'." ), json_schema_extra={ "element_property": True, }, ) unit: fhirtypes.CodeableConceptType | None = Field( default=None, alias="unit", title="Individual or family", description="Indicates if the benefits apply to an individual or to the family.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitBenefitBalance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "category", "excluded", "name", "description", "network", "unit", "term", "financial", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitBenefitBalance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitBenefitBalanceFinancial(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Benefit Summary. Benefits Used to date. """ __resource_type__ = "ExplanationOfBenefitBenefitBalanceFinancial" allowedMoney: fhirtypes.MoneyType | None = Field( default=None, alias="allowedMoney", title="Benefits allowed", description="The quantity of the benefit which is permitted under the coverage.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e allowed[x] "one_of_many": "allowed", "one_of_many_required": False, }, ) allowedString: fhirtypes.StringType | None = Field( default=None, alias="allowedString", title="Benefits allowed", description="The quantity of the benefit which is permitted under the coverage.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e allowed[x] "one_of_many": "allowed", "one_of_many_required": False, }, ) allowedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allowedString", title="Extension field for ``allowedString``.", ) allowedUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="allowedUnsignedInt", title="Benefits allowed", description="The quantity of the benefit which is permitted under the coverage.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e allowed[x] "one_of_many": "allowed", "one_of_many_required": False, }, ) allowedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allowedUnsignedInt", title="Extension field for ``allowedUnsignedInt``.", ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Benefit classification", description="Classification of benefit being provided.", json_schema_extra={ "element_property": True, }, ) usedMoney: fhirtypes.MoneyType | None = Field( default=None, alias="usedMoney", title="Benefits used", description="The quantity of the benefit which have been consumed to date.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e used[x] "one_of_many": "used", "one_of_many_required": False, }, ) usedUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="usedUnsignedInt", title="Benefits used", description="The quantity of the benefit which have been consumed to date.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e used[x] "one_of_many": "used", "one_of_many_required": False, }, ) usedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usedUnsignedInt", title="Extension field for ``usedUnsignedInt``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitBenefitBalanceFinancial`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "allowedUnsignedInt", "allowedString", "allowedMoney", "usedUnsignedInt", "usedMoney", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitBenefitBalanceFinancial`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "allowed": ["allowedMoney", "allowedString", "allowedUnsignedInt"], "used": ["usedMoney", "usedUnsignedInt"], } return one_of_many_fields class ExplanationOfBenefitCareTeam(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Care Team members. The members of the team who provided the products and services. """ __resource_type__ = "ExplanationOfBenefitCareTeam" provider: fhirtypes.ReferenceType = Field( default=..., alias="provider", title="Practitioner or organization", description="Member of the team who provided the product or service.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) responsible: bool | None = Field( default=None, alias="responsible", title="Indicator of the lead practitioner", description=( "The party who is billing and/or responsible for the claimed products " "or services." ), json_schema_extra={ "element_property": True, }, ) responsible__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_responsible", title="Extension field for ``responsible``." ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="Function within the team", description=( "The lead, assisting or supervising practitioner and their discipline " "if a multidisciplinary team." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Order of care team", description="A number to uniquely identify care team entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) specialty: fhirtypes.CodeableConceptType | None = Field( default=None, alias="specialty", title="Practitioner or provider specialization", description=( "The specialization of the practitioner or provider which is applicable" " for this service." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitCareTeam`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "provider", "responsible", "role", "specialty", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitCareTeam`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields class ExplanationOfBenefitDiagnosis(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Pertinent diagnosis information. Information about diagnoses relevant to the claim items. """ __resource_type__ = "ExplanationOfBenefitDiagnosis" diagnosisCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="diagnosisCodeableConcept", title="Nature of illness or problem", description=( "The nature of illness or problem in a coded form or as a reference to " "an external defined Condition." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e diagnosis[x] "one_of_many": "diagnosis", "one_of_many_required": True, }, ) diagnosisReference: fhirtypes.ReferenceType | None = Field( default=None, alias="diagnosisReference", title="Nature of illness or problem", description=( "The nature of illness or problem in a coded form or as a reference to " "an external defined Condition." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e diagnosis[x] "one_of_many": "diagnosis", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) onAdmission: fhirtypes.CodeableConceptType | None = Field( default=None, alias="onAdmission", title="Present on admission", description=( "Indication of whether the diagnosis was present on admission to a " "facility." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Diagnosis instance identifier", description="A number to uniquely identify diagnosis entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Timing or nature of the diagnosis", description="When the condition was observed or the relative ranking.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitDiagnosis`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "diagnosisCodeableConcept", "diagnosisReference", "type", "onAdmission", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitDiagnosis`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "diagnosis": ["diagnosisCodeableConcept", "diagnosisReference"] } return one_of_many_fields class ExplanationOfBenefitEvent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Event information. Information code for an event with a corresponding date or period. """ __resource_type__ = "ExplanationOfBenefitEvent" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Specific event", description="A coded event such as when a service is expected or a card printed.", json_schema_extra={ "element_property": True, }, ) whenDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="whenDateTime", title="Occurance date or period", description=( "A date or period in the past or future indicating when the event " "occurred or is expectd to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e when[x] "one_of_many": "when", "one_of_many_required": True, }, ) whenDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_whenDateTime", title="Extension field for ``whenDateTime``.", ) whenPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="whenPeriod", title="Occurance date or period", description=( "A date or period in the past or future indicating when the event " "occurred or is expectd to occur." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e when[x] "one_of_many": "when", "one_of_many_required": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitEvent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "whenDateTime", "whenPeriod", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitEvent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"when": ["whenDateTime", "whenPeriod"]} return one_of_many_fields class ExplanationOfBenefitInsurance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Patient insurance information. Financial instruments for reimbursement for the health care products and services specified on the claim. """ __resource_type__ = "ExplanationOfBenefitInsurance" coverage: fhirtypes.ReferenceType = Field( default=..., alias="coverage", title="Insurance information", description=( "Reference to the insurance card level information contained in the " "Coverage resource. The coverage issuing insurer will use these details" " to locate the patient's actual coverage within the insurer's " "information system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage"], }, ) focal: bool | None = Field( default=None, alias="focal", title="Coverage to be used for adjudication", description=( "A flag to indicate that this Coverage is to be used for adjudication " "of this claim when set to true." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) focal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_focal", title="Extension field for ``focal``." ) preAuthRef: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="preAuthRef", title="Prior authorization reference number", description=( "Reference numbers previously provided by the insurer to the provider " "to be quoted on subsequent claims containing services or products " "related to the prior authorization." ), json_schema_extra={ "element_property": True, }, ) preAuthRef__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_preAuthRef", title="Extension field for ``preAuthRef``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitInsurance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "focal", "coverage", "preAuthRef", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitInsurance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "focal", "coverage"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("focal", "focal__ext")] return required_fields class ExplanationOfBenefitItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Product or service provided. A claim line. Either a simple (a product or service) or a 'group' of details which can also be a simple items or groups of sub-details. """ __resource_type__ = "ExplanationOfBenefitItem" adjudication: typing.List[ fhirtypes.ExplanationOfBenefitItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Adjudication details", description=( "If this item is a group then the values here are a summary of the " "adjudication of the detail items. If this item is a simple product or " "service then this is the result of the adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) bodySite: typing.List[ fhirtypes.ExplanationOfBenefitItemBodySiteType ] | None = Field( default=None, alias="bodySite", title="Anatomical location", description="Physical location where the service is performed or applies.", json_schema_extra={ "element_property": True, }, ) careTeamSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="careTeamSequence", title="Applicable care team members", description="Care team members related to this service or product.", json_schema_extra={ "element_property": True, }, ) careTeamSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_careTeamSequence", title="Extension field for ``careTeamSequence``.", ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Benefit classification", description=( "Code to identify the general type of benefits under which products and" " services are provided." ), json_schema_extra={ "element_property": True, }, ) detail: typing.List[fhirtypes.ExplanationOfBenefitItemDetailType] | None = Field( default=None, alias="detail", title="Additional items", description="Second-tier of goods and services.", json_schema_extra={ "element_property": True, }, ) diagnosisSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="diagnosisSequence", title="Applicable diagnoses", description="Diagnoses applicable for this service or product.", json_schema_extra={ "element_property": True, }, ) diagnosisSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_diagnosisSequence", title="Extension field for ``diagnosisSequence``.", ) encounter: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="encounter", title="Encounters associated with the listed treatments", description="Healthcare encounters related to this claim.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) informationSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="informationSequence", title="Applicable exception and supporting information", description=( "Exceptions, special conditions and supporting information applicable " "for this service or product." ), json_schema_extra={ "element_property": True, }, ) informationSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_informationSequence", title="Extension field for ``informationSequence``.", ) locationAddress: fhirtypes.AddressType | None = Field( default=None, alias="locationAddress", title="Place of service or where product was supplied", description="Where the product or service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="locationCodeableConcept", title="Place of service or where product was supplied", description="Where the product or service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, }, ) locationReference: fhirtypes.ReferenceType | None = Field( default=None, alias="locationReference", title="Place of service or where product was supplied", description="Where the product or service was provided.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e location[x] "one_of_many": "location", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Product or service billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The total amount claimed for the group (if a grouper) or the line " "item. Net = unit price * quantity * factor." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="Applicable note numbers", description=( "The numbers associated with notes below which apply to the " "adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) patientPaid: fhirtypes.MoneyType | None = Field( default=None, alias="patientPaid", title="Paid by the patient", description=( "The amount paid by the patient, in total at the claim claim level or " "specifically for the item and detail level, to the provider for goods " "and services." ), json_schema_extra={ "element_property": True, }, ) procedureSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="procedureSequence", title="Applicable procedures", description="Procedures applicable for this service or product.", json_schema_extra={ "element_property": True, }, ) procedureSequence__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_procedureSequence", title="Extension field for ``procedureSequence``.", ) productOrService: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrService", title="Billing, service, product, or drug code", description=( "When the value is a group code then this item collects a set of " "related item details, otherwise this contains the product, service, " "drug or other billing code for the item. This element may be the start" " of a range of .productOrService codes used in conjunction with " ".productOrServiceEnd or it may be a solo element where " ".productOrServiceEnd is not used." ), json_schema_extra={ "element_property": True, }, ) productOrServiceEnd: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrServiceEnd", title="End of a range of codes", description=( "This contains the end of a range of product, service, drug or other " "billing codes for the item. This element is not used when the " ".productOrService is a group code. This value may only be present when" " a .productOfService code has been provided to convey the start of the" " range. Typically this value may be used only with preauthorizations " "and not with claims." ), json_schema_extra={ "element_property": True, }, ) programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="programCode", title="Program the product or service is provided under", description="Identifies the program under which this may be recovered.", json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) request: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="request", title="Request or Referral for Service", description="Request or Referral for Goods or Service to be rendered.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "DeviceRequest", "MedicationRequest", "NutritionOrder", "ServiceRequest", "SupplyRequest", "VisionPrescription", ], }, ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of revenue or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) reviewOutcome: fhirtypes.ExplanationOfBenefitItemReviewOutcomeType | None = Field( default=None, alias="reviewOutcome", title="Adjudication results", description=( "The high-level results of the adjudication if adjudication has been " "performed." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Item instance identifier", description="A number to uniquely identify item entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) servicedDate: fhirtypes.DateType | None = Field( default=None, alias="servicedDate", title="Date or dates of service or product delivery", description=( "The date or dates when the service or product was supplied, performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_servicedDate", title="Extension field for ``servicedDate``.", ) servicedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="servicedPeriod", title="Date or dates of service or product delivery", description=( "The date or dates when the service or product was supplied, performed " "or completed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) tax: fhirtypes.MoneyType | None = Field( default=None, alias="tax", title="Total tax", description="The total of taxes applicable for this product or service.", json_schema_extra={ "element_property": True, }, ) traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="traceNumber", title="Number for tracking", description=( "Trace number for tracking purposes. May be defined at the jurisdiction" " level or between trading partners." ), json_schema_extra={ "element_property": True, }, ) udi: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="udi", title="Unique device identifier", description="Unique Device Identifiers associated with this line item.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description=( "If the item is not a group then this is the fee for the product or " "service, otherwise this is the total of the fees for the details of " "the group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "careTeamSequence", "diagnosisSequence", "procedureSequence", "informationSequence", "traceNumber", "revenue", "category", "productOrService", "productOrServiceEnd", "request", "modifier", "programCode", "servicedDate", "servicedPeriod", "locationCodeableConcept", "locationAddress", "locationReference", "patientPaid", "quantity", "unitPrice", "factor", "tax", "net", "udi", "bodySite", "encounter", "noteNumber", "reviewOutcome", "adjudication", "detail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "location": [ "locationAddress", "locationCodeableConcept", "locationReference", ], "serviced": ["servicedDate", "servicedPeriod"], } return one_of_many_fields class ExplanationOfBenefitItemAdjudication(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Adjudication details. If this item is a group then the values here are a summary of the adjudication of the detail items. If this item is a simple product or service then this is the result of the adjudication of this item. """ __resource_type__ = "ExplanationOfBenefitItemAdjudication" amount: fhirtypes.MoneyType | None = Field( default=None, alias="amount", title="Monetary amount", description="Monetary amount associated with the category.", json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType = Field( default=..., alias="category", title="Type of adjudication information", description=( "A code to indicate the information type of this adjudication record. " "Information types may include: the value submitted, maximum values or " "percentages allowed or payable under the plan, amounts that the " "patient is responsible for in-aggregate or pertaining to this item, " "amounts paid by other coverages, and the benefit payable for this " "item." ), json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Non-monitary value", description=( "A non-monetary value associated with the category. Mutually exclusive " "to the amount element above." ), json_schema_extra={ "element_property": True, }, ) reason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reason", title="Explanation of adjudication outcome", description=( "A code supporting the understanding of the adjudication result and " "explaining variance from expected amount." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitItemAdjudication`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "category", "reason", "amount", "quantity", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItemAdjudication`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitItemBodySite(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Anatomical location. Physical location where the service is performed or applies. """ __resource_type__ = "ExplanationOfBenefitItemBodySite" site: typing.List[fhirtypes.CodeableReferenceType] = Field( default=..., alias="site", title="Location", description="Physical service site on the patient (limb, tooth, etc.).", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["BodyStructure"], }, ) subSite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="subSite", title="Sub-location", description=( "A region or surface of the bodySite, e.g. limb region or tooth " "surface(s)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitItemBodySite`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "site", "subSite"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItemBodySite`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitItemDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional items. Second-tier of goods and services. """ __resource_type__ = "ExplanationOfBenefitItemDetail" adjudication: typing.List[ fhirtypes.ExplanationOfBenefitItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Detail level adjudication details", description="The adjudication results.", json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Benefit classification", description=( "Code to identify the general type of benefits under which products and" " services are provided." ), json_schema_extra={ "element_property": True, }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The total amount claimed for the group (if a grouper) or the line " "item.detail. Net = unit price * quantity * factor." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="Applicable note numbers", description=( "The numbers associated with notes below which apply to the " "adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) patientPaid: fhirtypes.MoneyType | None = Field( default=None, alias="patientPaid", title="Paid by the patient", description=( "The amount paid by the patient, in total at the claim claim level or " "specifically for the item and detail level, to the provider for goods " "and services." ), json_schema_extra={ "element_property": True, }, ) productOrService: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrService", title="Billing, service, product, or drug code", description=( "When the value is a group code then this item collects a set of " "related item details, otherwise this contains the product, service, " "drug or other billing code for the item. This element may be the start" " of a range of .productOrService codes used in conjunction with " ".productOrServiceEnd or it may be a solo element where " ".productOrServiceEnd is not used." ), json_schema_extra={ "element_property": True, }, ) productOrServiceEnd: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrServiceEnd", title="End of a range of codes", description=( "This contains the end of a range of product, service, drug or other " "billing codes for the item. This element is not used when the " ".productOrService is a group code. This value may only be present when" " a .productOfService code has been provided to convey the start of the" " range. Typically this value may be used only with preauthorizations " "and not with claims." ), json_schema_extra={ "element_property": True, }, ) programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="programCode", title="Program the product or service is provided under", description="Identifies the program under which this may be recovered.", json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of revenue or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) reviewOutcome: fhirtypes.ExplanationOfBenefitItemReviewOutcomeType | None = Field( default=None, alias="reviewOutcome", title="Detail level adjudication results", description=( "The high-level results of the adjudication if adjudication has been " "performed." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Product or service provided", description=( "A claim detail line. Either a simple (a product or service) or a " "'group' of sub-details which are simple items." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) subDetail: typing.List[ fhirtypes.ExplanationOfBenefitItemDetailSubDetailType ] | None = Field( default=None, alias="subDetail", title="Additional items", description="Third-tier of goods and services.", json_schema_extra={ "element_property": True, }, ) tax: fhirtypes.MoneyType | None = Field( default=None, alias="tax", title="Total tax", description="The total of taxes applicable for this product or service.", json_schema_extra={ "element_property": True, }, ) traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="traceNumber", title="Number for tracking", description=( "Trace number for tracking purposes. May be defined at the jurisdiction" " level or between trading partners." ), json_schema_extra={ "element_property": True, }, ) udi: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="udi", title="Unique device identifier", description="Unique Device Identifiers associated with this line item.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description=( "If the item is not a group then this is the fee for the product or " "service, otherwise this is the total of the fees for the details of " "the group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitItemDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "traceNumber", "revenue", "category", "productOrService", "productOrServiceEnd", "modifier", "programCode", "patientPaid", "quantity", "unitPrice", "factor", "tax", "net", "udi", "noteNumber", "reviewOutcome", "adjudication", "subDetail", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItemDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields class ExplanationOfBenefitItemDetailSubDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional items. Third-tier of goods and services. """ __resource_type__ = "ExplanationOfBenefitItemDetailSubDetail" adjudication: typing.List[ fhirtypes.ExplanationOfBenefitItemAdjudicationType ] | None = Field( default=None, alias="adjudication", title="Subdetail level adjudication details", description="The adjudication results.", json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Benefit classification", description=( "Code to identify the general type of benefits under which products and" " services are provided." ), json_schema_extra={ "element_property": True, }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Price scaling factor", description=( "A real number that represents a multiplier used in determining the " "overall value of services delivered and/or goods received. The concept" " of a Factor allows for a discount or surcharge multiplier to be " "applied to a monetary amount." ), json_schema_extra={ "element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modifier", title="Service/Product billing modifiers", description=( "Item typification or modifiers codes to convey additional context for " "the product or service." ), json_schema_extra={ "element_property": True, }, ) net: fhirtypes.MoneyType | None = Field( default=None, alias="net", title="Total item cost", description=( "The total amount claimed for the line item.detail.subDetail. Net = " "unit price * quantity * factor." ), json_schema_extra={ "element_property": True, }, ) noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field( default=None, alias="noteNumber", title="Applicable note numbers", description=( "The numbers associated with notes below which apply to the " "adjudication of this item." ), json_schema_extra={ "element_property": True, }, ) noteNumber__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_noteNumber", title="Extension field for ``noteNumber``." ) patientPaid: fhirtypes.MoneyType | None = Field( default=None, alias="patientPaid", title="Paid by the patient", description=( "The amount paid by the patient, in total at the claim claim level or " "specifically for the item and detail level, to the provider for goods " "and services." ), json_schema_extra={ "element_property": True, }, ) productOrService: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrService", title="Billing, service, product, or drug code", description=( "When the value is a group code then this item collects a set of " "related item details, otherwise this contains the product, service, " "drug or other billing code for the item. This element may be the start" " of a range of .productOrService codes used in conjunction with " ".productOrServiceEnd or it may be a solo element where " ".productOrServiceEnd is not used." ), json_schema_extra={ "element_property": True, }, ) productOrServiceEnd: fhirtypes.CodeableConceptType | None = Field( default=None, alias="productOrServiceEnd", title="End of a range of codes", description=( "This contains the end of a range of product, service, drug or other " "billing codes for the item. This element is not used when the " ".productOrService is a group code. This value may only be present when" " a .productOfService code has been provided to convey the start of the" " range. Typically this value may be used only with preauthorizations " "and not with claims." ), json_schema_extra={ "element_property": True, }, ) programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="programCode", title="Program the product or service is provided under", description="Identifies the program under which this may be recovered.", json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Count of products or services", description="The number of repetitions of a service or product.", json_schema_extra={ "element_property": True, }, ) revenue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="revenue", title="Revenue or cost center code", description=( "The type of revenue or cost center providing the product and/or " "service." ), json_schema_extra={ "element_property": True, }, ) reviewOutcome: fhirtypes.ExplanationOfBenefitItemReviewOutcomeType | None = Field( default=None, alias="reviewOutcome", title="Subdetail level adjudication results", description=( "The high-level results of the adjudication if adjudication has been " "performed." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Product or service provided", description=( "A claim detail line. Either a simple (a product or service) or a " "'group' of sub-details which are simple items." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) tax: fhirtypes.MoneyType | None = Field( default=None, alias="tax", title="Total tax", description="The total of taxes applicable for this product or service.", json_schema_extra={ "element_property": True, }, ) traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="traceNumber", title="Number for tracking", description=( "Trace number for tracking purposes. May be defined at the jurisdiction" " level or between trading partners." ), json_schema_extra={ "element_property": True, }, ) udi: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="udi", title="Unique device identifier", description="Unique Device Identifiers associated with this line item.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) unitPrice: fhirtypes.MoneyType | None = Field( default=None, alias="unitPrice", title="Fee, charge or cost per item", description=( "If the item is not a group then this is the fee for the product or " "service, otherwise this is the total of the fees for the details of " "the group." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "traceNumber", "revenue", "category", "productOrService", "productOrServiceEnd", "modifier", "programCode", "patientPaid", "quantity", "unitPrice", "factor", "tax", "net", "udi", "noteNumber", "reviewOutcome", "adjudication", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItemDetailSubDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields class ExplanationOfBenefitItemReviewOutcome(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Adjudication results. The high-level results of the adjudication if adjudication has been performed. """ __resource_type__ = "ExplanationOfBenefitItemReviewOutcome" decision: fhirtypes.CodeableConceptType | None = Field( default=None, alias="decision", title="Result of the adjudication", description=( "The result of the claim, predetermination, or preauthorization " "adjudication." ), json_schema_extra={ "element_property": True, }, ) preAuthPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="preAuthPeriod", title="Preauthorization reference effective period", description="The time frame during which this authorization is effective.", json_schema_extra={ "element_property": True, }, ) preAuthRef: fhirtypes.StringType | None = Field( default=None, alias="preAuthRef", title="Preauthorization reference", description=( "Reference from the Insurer which is used in later communications which" " refers to this adjudication." ), json_schema_extra={ "element_property": True, }, ) preAuthRef__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preAuthRef", title="Extension field for ``preAuthRef``." ) reason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reason", title="Reason for result of the adjudication", description=( "The reasons for the result of the claim, predetermination, or " "preauthorization adjudication." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitItemReviewOutcome`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "decision", "reason", "preAuthRef", "preAuthPeriod", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItemReviewOutcome`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitPayee(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Recipient of benefits payable. The party to be reimbursed for cost of the products and services according to the terms of the policy. """ __resource_type__ = "ExplanationOfBenefitPayee" party: fhirtypes.ReferenceType | None = Field( default=None, alias="party", title="Recipient reference", description=( "Reference to the individual or organization to whom any payment will " "be made." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Patient", "RelatedPerson", ], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Category of recipient", description="Type of Party to be reimbursed: Subscriber, provider, other.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitPayee`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "party"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitPayee`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitPayment(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Payment Details. Payment details for the adjudication of the claim. """ __resource_type__ = "ExplanationOfBenefitPayment" adjustment: fhirtypes.MoneyType | None = Field( default=None, alias="adjustment", title="Payment adjustment for non-claim issues", description=( "Total amount of all adjustments to this payment included in this " "transaction which are not related to this claim's adjudication." ), json_schema_extra={ "element_property": True, }, ) adjustmentReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="adjustmentReason", title="Explanation for the variance", description="Reason for the payment adjustment.", json_schema_extra={ "element_property": True, }, ) amount: fhirtypes.MoneyType | None = Field( default=None, alias="amount", title="Payable amount after adjustment", description="Benefits payable less any payment adjustment.", json_schema_extra={ "element_property": True, }, ) date: fhirtypes.DateType | None = Field( default=None, alias="date", title="Expected date of payment", description=( "Estimated date the payment will be issued or the actual issue date of " "payment." ), json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Business identifier for the payment", description="Issuer's unique identifier for the payment instrument.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Partial or complete payment", description=( "Whether this represents partial or complete payment of the benefits " "payable." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitPayment`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "adjustment", "adjustmentReason", "date", "amount", "identifier", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitPayment`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitProcedure(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Clinical procedures performed. Procedures performed on the patient relevant to the billing items with the claim. """ __resource_type__ = "ExplanationOfBenefitProcedure" date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When the procedure was performed", description="Date and optionally time the procedure was performed.", json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) procedureCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="procedureCodeableConcept", title="Specific clinical procedure", description=( "The code or reference to a Procedure resource which identifies the " "clinical intervention performed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e procedure[x] "one_of_many": "procedure", "one_of_many_required": True, }, ) procedureReference: fhirtypes.ReferenceType | None = Field( default=None, alias="procedureReference", title="Specific clinical procedure", description=( "The code or reference to a Procedure resource which identifies the " "clinical intervention performed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e procedure[x] "one_of_many": "procedure", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Procedure"], }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Procedure instance identifier", description="A number to uniquely identify procedure entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Category of Procedure", description="When the condition was observed or the relative ranking.", json_schema_extra={ "element_property": True, }, ) udi: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="udi", title="Unique device identifier", description="Unique Device Identifiers associated with this line item.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitProcedure`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "type", "date", "procedureCodeableConcept", "procedureReference", "udi", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitProcedure`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "procedure": ["procedureCodeableConcept", "procedureReference"] } return one_of_many_fields class ExplanationOfBenefitProcessNote(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Note concerning adjudication. A note that describes or explains adjudication results in a human readable form. """ __resource_type__ = "ExplanationOfBenefitProcessNote" language: fhirtypes.CodeableConceptType | None = Field( default=None, alias="language", title="Language of the text", description="A code to define the language used in the text of the note.", json_schema_extra={ "element_property": True, }, ) number: fhirtypes.PositiveIntType | None = Field( default=None, alias="number", title="Note instance identifier", description="A number to uniquely identify a note entry.", json_schema_extra={ "element_property": True, }, ) number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_number", title="Extension field for ``number``." ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Note explanatory text", description="The explanation or description associated with the processing.", json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Note purpose", description="The business purpose of the note text.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitProcessNote`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "number", "type", "text", "language", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitProcessNote`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitRelated(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Prior or corollary claims. Other claims which are related to this claim such as prior submissions or claims for related services or for the same event. """ __resource_type__ = "ExplanationOfBenefitRelated" claim: fhirtypes.ReferenceType | None = Field( default=None, alias="claim", title="Reference to the related claim", description="Reference to a related claim.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Claim"], }, ) reference: fhirtypes.IdentifierType | None = Field( default=None, alias="reference", title="File or case reference", description=( "An alternate organizational reference to the case or file to which " "this particular claim pertains." ), json_schema_extra={ "element_property": True, }, ) relationship: fhirtypes.CodeableConceptType | None = Field( default=None, alias="relationship", title="How the reference claim is related", description="A code to convey how the claims are related.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitRelated`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "claim", "relationship", "reference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitRelated`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ExplanationOfBenefitSupportingInfo(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Supporting information. Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues. """ __resource_type__ = "ExplanationOfBenefitSupportingInfo" category: fhirtypes.CodeableConceptType = Field( default=..., alias="category", title="Classification of the supplied information", description=( "The general class of the information supplied: information; exception;" " accident, employment; onset, etc." ), json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Type of information", description=( "System and code pertaining to the specific information regarding " "special conditions relating to the setting, treatment or patient for " "which care is sought." ), json_schema_extra={ "element_property": True, }, ) reason: fhirtypes.CodingType | None = Field( default=None, alias="reason", title="Explanation for the information", description=( "Provides the reason in the situation where a reason code is required " "in addition to the content." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Information instance identifier", description="A number to uniquely identify supporting information entries.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) timingDate: fhirtypes.DateType | None = Field( default=None, alias="timingDate", title="When it occurred", description="The date when or period to which this information refers.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timingDate", title="Extension field for ``timingDate``." ) timingPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="timingPeriod", title="When it occurred", description="The date when or period to which this information refers.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Data to be provided", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Data to be provided", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="valueIdentifier", title="Data to be provided", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Data to be provided", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Data to be provided", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Data to be provided", description=( "Additional data or information such as resources, documents, images " "etc. including references to the data or the actual inclusion of the " "data." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitSupportingInfo`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "category", "code", "timingDate", "timingPeriod", "valueBoolean", "valueString", "valueQuantity", "valueAttachment", "valueReference", "valueIdentifier", "reason", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitSupportingInfo`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sequence", "sequence__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "timing": ["timingDate", "timingPeriod"], "value": [ "valueAttachment", "valueBoolean", "valueIdentifier", "valueQuantity", "valueReference", "valueString", ], } return one_of_many_fields class ExplanationOfBenefitTotal(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Adjudication totals. Categorized monetary totals for the adjudication. """ __resource_type__ = "ExplanationOfBenefitTotal" amount: fhirtypes.MoneyType = Field( default=..., alias="amount", title="Financial total for the category", description="Monetary total amount associated with the category.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) category: fhirtypes.CodeableConceptType = Field( default=..., alias="category", title="Type of adjudication information", description=( "A code to indicate the information type of this adjudication record. " "Information types may include: the value submitted, maximum values or " "percentages allowed or payable under the plan, amounts that the " "patient is responsible for in aggregate or pertaining to this item, " "amounts paid by other coverages, and the benefit payable for this " "item." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExplanationOfBenefitTotal`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "category", "amount"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitTotal`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "category", "amount"] ================================================ FILE: fhir/resources/expression.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Expression Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class Expression(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An expression that can be used to generate a value. A expression that is evaluated in a specified context and returns a value. The context of use of the expression must specify the context in which the expression is evaluated, and how the result of the expression is used. """ __resource_type__ = "Expression" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Natural language description of the condition", description=( "A brief, natural language description of the condition that " "effectively communicates the intended semantics." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="Expression in specified language", description="An expression in the specified language that returns a value.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) language: fhirtypes.CodeType | None = Field( default=None, alias="language", title="text/cql | text/fhirpath | application/x-fhir-query | etc.", description="The media type of the language for the expression.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "text/cql", "text/fhirpath", "application/x-fhir-query", "etc.", ], }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) name: fhirtypes.CodeType | None = Field( default=None, alias="name", title="Short name assigned to expression for reuse", description=( "A short name assigned to the expression to allow for multiple reuse of" " the expression in the context where it is defined." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) reference: fhirtypes.UriType | None = Field( default=None, alias="reference", title="Where the expression is found", description="A URI that defines where the expression is found.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reference", title="Extension field for ``reference``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Expression`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "description", "name", "language", "expression", "reference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Expression`` according to specification, with preserving the original sequence order. """ return ["description", "name", "language", "expression", "reference"] ================================================ FILE: fhir/resources/extendedcontactdetail.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ExtendedContactDetail Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class ExtendedContactDetail(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Contact information. Specifies contact information for a specific purpose over a period of time, might be handled/monitored by a specific named person or organization. """ __resource_type__ = "ExtendedContactDetail" address: fhirtypes.AddressType | None = Field( default=None, alias="address", title="Address for the contact", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: typing.List[fhirtypes.HumanNameType] | None = Field( default=None, alias="name", title="Name of an individual to contact", description=( "The name of an individual to contact, some types of contact detail are" " usually blank." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) organization: fhirtypes.ReferenceType | None = Field( default=None, alias="organization", title="This contact detail is handled/monitored by a specific organization", description=( "This contact detail is handled/monitored by a specific organization. " "If the name is provided in the contact, then it is referring to the " "named individual within this organization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Period that this contact was valid for usage", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) purpose: fhirtypes.CodeableConceptType | None = Field( default=None, alias="purpose", title="The type of contact", description="The purpose/type of contact.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="Contact details (e.g.phone/fax/url)", description="The contact details application for the purpose defined.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ExtendedContactDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "purpose", "name", "telecom", "address", "organization", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ExtendedContactDetail`` according to specification, with preserving the original sequence order. """ return ["purpose", "name", "telecom", "address", "organization", "period"] ================================================ FILE: fhir/resources/extension.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Extension Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class Extension(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Optional Extensions Element. Optional Extension Element - found in all resources. """ __resource_type__ = "Extension" url: fhirtypes.UriType | None = Field( default=None, alias="url", title="identifies the meaning of the extension", description=( "Source of the definition for the extension code - a logical name or a " "URL." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) valueAddress: fhirtypes.AddressType | None = Field( default=None, alias="valueAddress", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueAge: fhirtypes.AgeType | None = Field( default=None, alias="valueAge", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="valueAnnotation", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueAvailability: fhirtypes.AvailabilityType | None = Field( default=None, alias="valueAvailability", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="valueBase64Binary", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="valueCanonical", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCodeableReference: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="valueCodeableReference", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueContactDetail: fhirtypes.ContactDetailType | None = Field( default=None, alias="valueContactDetail", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="valueContactPoint", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCount: fhirtypes.CountType | None = Field( default=None, alias="valueCount", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDataRequirement: fhirtypes.DataRequirementType | None = Field( default=None, alias="valueDataRequirement", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDistance: fhirtypes.DistanceType | None = Field( default=None, alias="valueDistance", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDosage: fhirtypes.DosageType | None = Field( default=None, alias="valueDosage", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDuration: fhirtypes.DurationType | None = Field( default=None, alias="valueDuration", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueExpression: fhirtypes.ExpressionType | None = Field( default=None, alias="valueExpression", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueExtendedContactDetail: fhirtypes.ExtendedContactDetailType | None = Field( default=None, alias="valueExtendedContactDetail", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="valueHumanName", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueId: fhirtypes.IdType | None = Field( default=None, alias="valueId", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="valueIdentifier", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInstant: fhirtypes.InstantType | None = Field( default=None, alias="valueInstant", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInteger64: fhirtypes.Integer64Type | None = Field( default=None, alias="valueInteger64", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="valueMarkdown", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueMeta: fhirtypes.MetaType | None = Field( default=None, alias="valueMeta", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueMoney: fhirtypes.MoneyType | None = Field( default=None, alias="valueMoney", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueOid: fhirtypes.OidType | None = Field( default=None, alias="valueOid", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field( default=None, alias="valueParameterDefinition", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="valuePositiveInt", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRatioRange: fhirtypes.RatioRangeType | None = Field( default=None, alias="valueRatioRange", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field( default=None, alias="valueRelatedArtifact", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="valueSampledData", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueSignature: fhirtypes.SignatureType | None = Field( default=None, alias="valueSignature", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueTiming: fhirtypes.TimingType | None = Field( default=None, alias="valueTiming", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field( default=None, alias="valueTriggerDefinition", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="valueUnsignedInt", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUrl: fhirtypes.UrlType | None = Field( default=None, alias="valueUrl", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUsageContext: fhirtypes.UsageContextType | None = Field( default=None, alias="valueUsageContext", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUuid: fhirtypes.UuidType | None = Field( default=None, alias="valueUuid", title="Value of extension", description=( "Value of extension - must be one of a constrained set of the data " "types (see [Extensibility](extensibility.html) for a list)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Extension`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "url", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInstant", "valueInteger", "valueInteger64", "valueMarkdown", "valueOid", "valuePositiveInt", "valueString", "valueTime", "valueUnsignedInt", "valueUri", "valueUrl", "valueUuid", "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueCodeableConcept", "valueCodeableReference", "valueCoding", "valueContactPoint", "valueCount", "valueDistance", "valueDuration", "valueHumanName", "valueIdentifier", "valueMoney", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueRatioRange", "valueReference", "valueSampledData", "valueSignature", "valueTiming", "valueContactDetail", "valueDataRequirement", "valueExpression", "valueParameterDefinition", "valueRelatedArtifact", "valueTriggerDefinition", "valueUsageContext", "valueAvailability", "valueExtendedContactDetail", "valueDosage", "valueMeta", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Extension`` according to specification, with preserving the original sequence order. """ return [] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueAvailability", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueCodeableConcept", "valueCodeableReference", "valueCoding", "valueContactDetail", "valueContactPoint", "valueCount", "valueDataRequirement", "valueDate", "valueDateTime", "valueDecimal", "valueDistance", "valueDosage", "valueDuration", "valueExpression", "valueExtendedContactDetail", "valueHumanName", "valueId", "valueIdentifier", "valueInstant", "valueInteger", "valueInteger64", "valueMarkdown", "valueMeta", "valueMoney", "valueOid", "valueParameterDefinition", "valuePeriod", "valuePositiveInt", "valueQuantity", "valueRange", "valueRatio", "valueRatioRange", "valueReference", "valueRelatedArtifact", "valueSampledData", "valueSignature", "valueString", "valueTime", "valueTiming", "valueTriggerDefinition", "valueUnsignedInt", "valueUri", "valueUrl", "valueUsageContext", "valueUuid", ] } return one_of_many_fields ================================================ FILE: fhir/resources/familymemberhistory.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/FamilyMemberHistory Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class FamilyMemberHistory(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about patient's relatives, relevant for patient. Significant health conditions for a person related to the patient relevant in the context of care for the patient. """ __resource_type__ = "FamilyMemberHistory" ageAge: fhirtypes.AgeType | None = Field( default=None, alias="ageAge", title="(approximate) age", description=( "The age of the relative at the time the family member history is " "recorded." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e age[x] "one_of_many": "age", "one_of_many_required": False, }, ) ageRange: fhirtypes.RangeType | None = Field( default=None, alias="ageRange", title="(approximate) age", description=( "The age of the relative at the time the family member history is " "recorded." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e age[x] "one_of_many": "age", "one_of_many_required": False, }, ) ageString: fhirtypes.StringType | None = Field( default=None, alias="ageString", title="(approximate) age", description=( "The age of the relative at the time the family member history is " "recorded." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e age[x] "one_of_many": "age", "one_of_many_required": False, }, ) ageString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_ageString", title="Extension field for ``ageString``." ) bornDate: fhirtypes.DateType | None = Field( default=None, alias="bornDate", title="(approximate) date of birth", description="The actual or approximate date of birth of the relative.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e born[x] "one_of_many": "born", "one_of_many_required": False, }, ) bornDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_bornDate", title="Extension field for ``bornDate``." ) bornPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="bornPeriod", title="(approximate) date of birth", description="The actual or approximate date of birth of the relative.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e born[x] "one_of_many": "born", "one_of_many_required": False, }, ) bornString: fhirtypes.StringType | None = Field( default=None, alias="bornString", title="(approximate) date of birth", description="The actual or approximate date of birth of the relative.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e born[x] "one_of_many": "born", "one_of_many_required": False, }, ) bornString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_bornString", title="Extension field for ``bornString``." ) condition: typing.List[fhirtypes.FamilyMemberHistoryConditionType] | None = Field( default=None, alias="condition", title="Condition that the related person had", description=( "The significant Conditions (or condition) that the family member had. " "This is a repeating section to allow a system to represent more than " "one condition per resource, though there is nothing stopping multiple " "resources - one per condition." ), json_schema_extra={ "element_property": True, }, ) dataAbsentReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="dataAbsentReason", title="subject-unknown | withheld | unable-to-obtain | deferred", description="Describes why the family member's history is not available.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When history was recorded or last updated", description=( "The date (and possibly time) when the family member history was " "recorded or last updated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) deceasedAge: fhirtypes.AgeType | None = Field( default=None, alias="deceasedAge", title="Dead? How old/when?", description=( "Deceased flag or the actual or approximate age of the relative at the " "time of death for the family member history record." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedBoolean: bool | None = Field( default=None, alias="deceasedBoolean", title="Dead? How old/when?", description=( "Deceased flag or the actual or approximate age of the relative at the " "time of death for the family member history record." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deceasedBoolean", title="Extension field for ``deceasedBoolean``.", ) deceasedDate: fhirtypes.DateType | None = Field( default=None, alias="deceasedDate", title="Dead? How old/when?", description=( "Deceased flag or the actual or approximate age of the relative at the " "time of death for the family member history record." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deceasedDate", title="Extension field for ``deceasedDate``.", ) deceasedRange: fhirtypes.RangeType | None = Field( default=None, alias="deceasedRange", title="Dead? How old/when?", description=( "Deceased flag or the actual or approximate age of the relative at the " "time of death for the family member history record." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedString: fhirtypes.StringType | None = Field( default=None, alias="deceasedString", title="Dead? How old/when?", description=( "Deceased flag or the actual or approximate age of the relative at the " "time of death for the family member history record." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deceasedString", title="Extension field for ``deceasedString``.", ) estimatedAge: bool | None = Field( default=None, alias="estimatedAge", title="Age is estimated?", description="If true, indicates that the age value specified is an estimated value.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) estimatedAge__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_estimatedAge", title="Extension field for ``estimatedAge``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Id(s) for this record", description=( "Business identifiers assigned to this family member history by the " "performer or other systems which remain constant as the resource is " "updated and propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="instantiatesCanonical", title="Instantiates FHIR protocol or definition", description=( "The URL pointing to a FHIR-defined protocol, guideline, orderset or " "other definition that is adhered to in whole or in part by this " "FamilyMemberHistory." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "PlanDefinition", "Questionnaire", "ActivityDefinition", "Measure", "OperationDefinition", ], }, ) instantiatesCanonical__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="instantiatesUri", title="Instantiates external protocol or definition", description=( "The URL pointing to an externally maintained protocol, guideline, " "orderset or other definition that is adhered to in whole or in part by" " this FamilyMemberHistory." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="The family member described", description=( 'This will either be a name or a description; e.g. "Aunt Susan", "my ' 'cousin with the red hair".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="General note about related person", description=( "This property allows a non condition-specific note to the made about " "the related person. Ideally, the note would be in the condition " "property, but this is not always possible." ), json_schema_extra={ "element_property": True, }, ) participant: typing.List[ fhirtypes.FamilyMemberHistoryParticipantType ] | None = Field( default=None, alias="participant", title=( "Who or what participated in the activities related to the family " "member history and how they were involved" ), description=( "Indicates who or what participated in the activities related to the " "family member history and how they were involved." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Patient history is about", description="The person who this history concerns.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) procedure: typing.List[fhirtypes.FamilyMemberHistoryProcedureType] | None = Field( default=None, alias="procedure", title="Procedures that the related person had", description=( "The significant Procedures (or procedure) that the family member had. " "This is a repeating section to allow a system to represent more than " "one procedure per resource, though there is nothing stopping multiple " "resources - one per procedure." ), json_schema_extra={ "element_property": True, }, ) reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="reason", title="Why was family member history performed?", description=( "Describes why the family member history occurred in coded or textual " "form, or Indicates a Condition, Observation, AllergyIntolerance, or " "QuestionnaireResponse that justifies this family member history event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "AllergyIntolerance", "QuestionnaireResponse", "DiagnosticReport", "DocumentReference", ], }, ) relationship: fhirtypes.CodeableConceptType = Field( default=..., alias="relationship", title="Relationship to the subject", description=( "The type of relationship this person has to the patient (father, " "mother, brother etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sex: fhirtypes.CodeableConceptType | None = Field( default=None, alias="sex", title="male | female | other | unknown", description="The birth sex of the family member.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="partial | completed | entered-in-error | health-unknown", description=( "A code specifying the status of the record of the family history of a " "specific family member." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "partial", "completed", "entered-in-error", "health-unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``FamilyMemberHistory`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "status", "dataAbsentReason", "patient", "date", "participant", "name", "relationship", "sex", "bornPeriod", "bornDate", "bornString", "ageAge", "ageRange", "ageString", "estimatedAge", "deceasedBoolean", "deceasedAge", "deceasedRange", "deceasedDate", "deceasedString", "reason", "note", "condition", "procedure", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``FamilyMemberHistory`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "status", "dataAbsentReason", "patient", "date", "participant", "name", "relationship", "sex", "ageAge", "ageRange", "ageString", "estimatedAge", "deceasedBoolean", "deceasedAge", "deceasedRange", "deceasedDate", "deceasedString", "reason", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "age": ["ageAge", "ageRange", "ageString"], "born": ["bornDate", "bornPeriod", "bornString"], "deceased": [ "deceasedAge", "deceasedBoolean", "deceasedDate", "deceasedRange", "deceasedString", ], } return one_of_many_fields class FamilyMemberHistoryCondition(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Condition that the related person had. The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition. """ __resource_type__ = "FamilyMemberHistoryCondition" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Condition suffered by relation", description=( "The actual condition specified. Could be a coded condition (like MI or" " Diabetes) or a less specific string like 'cancer' depending on how " "much is known about the condition and the capabilities of the creating" " system." ), json_schema_extra={ "element_property": True, }, ) contributedToDeath: bool | None = Field( default=None, alias="contributedToDeath", title="Whether the condition contributed to the cause of death", description=( "This condition contributed to the cause of death of the related " "person. If contributedToDeath is not populated, then it is unknown." ), json_schema_extra={ "element_property": True, }, ) contributedToDeath__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contributedToDeath", title="Extension field for ``contributedToDeath``.", ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Extra information about condition", description=( "An area where general notes can be placed about this specific " "condition." ), json_schema_extra={ "element_property": True, }, ) onsetAge: fhirtypes.AgeType | None = Field( default=None, alias="onsetAge", title="When condition first manifested", description=( "Either the age of onset, range of approximate age or descriptive " "string can be recorded. For conditions with multiple occurrences, " "this describes the first known occurrence." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="onsetPeriod", title="When condition first manifested", description=( "Either the age of onset, range of approximate age or descriptive " "string can be recorded. For conditions with multiple occurrences, " "this describes the first known occurrence." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetRange: fhirtypes.RangeType | None = Field( default=None, alias="onsetRange", title="When condition first manifested", description=( "Either the age of onset, range of approximate age or descriptive " "string can be recorded. For conditions with multiple occurrences, " "this describes the first known occurrence." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetString: fhirtypes.StringType | None = Field( default=None, alias="onsetString", title="When condition first manifested", description=( "Either the age of onset, range of approximate age or descriptive " "string can be recorded. For conditions with multiple occurrences, " "this describes the first known occurrence." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e onset[x] "one_of_many": "onset", "one_of_many_required": False, }, ) onsetString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_onsetString", title="Extension field for ``onsetString``." ) outcome: fhirtypes.CodeableConceptType | None = Field( default=None, alias="outcome", title="deceased | permanent disability | etc", description=( "Indicates what happened following the condition. If the condition " "resulted in death, deceased date is captured on the relation." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``FamilyMemberHistoryCondition`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "outcome", "contributedToDeath", "onsetAge", "onsetRange", "onsetPeriod", "onsetString", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``FamilyMemberHistoryCondition`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "onset": ["onsetAge", "onsetPeriod", "onsetRange", "onsetString"] } return one_of_many_fields class FamilyMemberHistoryParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who or what participated in the activities related to the family member history and how they were involved. Indicates who or what participated in the activities related to the family member history and how they were involved. """ __resource_type__ = "FamilyMemberHistoryParticipant" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title=( "Who or what participated in the activities related to the family " "member history" ), description=( "Indicates who or what participated in the activities related to the " "family member history." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Patient", "RelatedPerson", "Device", "Organization", "CareTeam", ], }, ) function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="Type of involvement", description=( "Distinguishes the type of involvement of the actor in the activities " "related to the family member history." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``FamilyMemberHistoryParticipant`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "function", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``FamilyMemberHistoryParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "function", "actor"] class FamilyMemberHistoryProcedure(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Procedures that the related person had. The significant Procedures (or procedure) that the family member had. This is a repeating section to allow a system to represent more than one procedure per resource, though there is nothing stopping multiple resources - one per procedure. """ __resource_type__ = "FamilyMemberHistoryProcedure" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Procedures performed on the related person", description=( "The actual procedure specified. Could be a coded procedure or a less " "specific string depending on how much is known about the procedure and" " the capabilities of the creating system." ), json_schema_extra={ "element_property": True, }, ) contributedToDeath: bool | None = Field( default=None, alias="contributedToDeath", title="Whether the procedure contributed to the cause of death", description=( "This procedure contributed to the cause of death of the related " "person. If contributedToDeath is not populated, then it is unknown." ), json_schema_extra={ "element_property": True, }, ) contributedToDeath__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contributedToDeath", title="Extension field for ``contributedToDeath``.", ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Extra information about the procedure", description=( "An area where general notes can be placed about this specific " "procedure." ), json_schema_extra={ "element_property": True, }, ) outcome: fhirtypes.CodeableConceptType | None = Field( default=None, alias="outcome", title="What happened following the procedure", description=( "Indicates what happened following the procedure. If the procedure " "resulted in death, deceased date is captured on the relation." ), json_schema_extra={ "element_property": True, }, ) performedAge: fhirtypes.AgeType | None = Field( default=None, alias="performedAge", title="When the procedure was performed", description=( "Estimated or actual date, date-time, period, or age when the procedure" " was performed. Allows a period to support complex procedures that " "span more than one date, and also allows for the length of the " "procedure to be captured." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e performed[x] "one_of_many": "performed", "one_of_many_required": False, }, ) performedDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="performedDateTime", title="When the procedure was performed", description=( "Estimated or actual date, date-time, period, or age when the procedure" " was performed. Allows a period to support complex procedures that " "span more than one date, and also allows for the length of the " "procedure to be captured." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e performed[x] "one_of_many": "performed", "one_of_many_required": False, }, ) performedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_performedDateTime", title="Extension field for ``performedDateTime``.", ) performedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="performedPeriod", title="When the procedure was performed", description=( "Estimated or actual date, date-time, period, or age when the procedure" " was performed. Allows a period to support complex procedures that " "span more than one date, and also allows for the length of the " "procedure to be captured." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e performed[x] "one_of_many": "performed", "one_of_many_required": False, }, ) performedRange: fhirtypes.RangeType | None = Field( default=None, alias="performedRange", title="When the procedure was performed", description=( "Estimated or actual date, date-time, period, or age when the procedure" " was performed. Allows a period to support complex procedures that " "span more than one date, and also allows for the length of the " "procedure to be captured." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e performed[x] "one_of_many": "performed", "one_of_many_required": False, }, ) performedString: fhirtypes.StringType | None = Field( default=None, alias="performedString", title="When the procedure was performed", description=( "Estimated or actual date, date-time, period, or age when the procedure" " was performed. Allows a period to support complex procedures that " "span more than one date, and also allows for the length of the " "procedure to be captured." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e performed[x] "one_of_many": "performed", "one_of_many_required": False, }, ) performedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_performedString", title="Extension field for ``performedString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``FamilyMemberHistoryProcedure`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "outcome", "contributedToDeath", "performedAge", "performedRange", "performedPeriod", "performedString", "performedDateTime", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``FamilyMemberHistoryProcedure`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "performed": [ "performedAge", "performedDateTime", "performedPeriod", "performedRange", "performedString", ] } return one_of_many_fields ================================================ FILE: fhir/resources/fhirprimitiveextension.py ================================================ from __future__ import annotations as _annotations import typing from fhir_core import fhirabstractmodel from pydantic import Field, model_validator from pydantic_core import PydanticCustomError from . import fhirtypes __author__ = "Md Nazrul Islam" __email__ = "email2nazrul@gmail.com" class FHIRPrimitiveExtension(fhirabstractmodel.FHIRAbstractModel): """@see: https://www.hl7.org/fhir/extensibility.html Extensibility feature for FHIR Primitive Data Types.""" __resource_type__ = "FHIRPrimitiveExtension" id: typing.Optional[fhirtypes.StringType] = Field( default=None, alias="id", title="Type `String`", description="Unique id for inter-element referencing", # if property is an element of this resource. json_schema_extra={"element_property": False}, ) extension: typing.Optional[typing.List[fhirtypes.ExtensionType]] = Field( None, alias="extension", title="List of `Extension` items (represented as `dict` in JSON)", description="Additional content defined by implementations", # if property is an element of this resource. json_schema_extra={"element_property": False}, ) @model_validator(mode="before") def validate_extension_or_fhir_comment_required( cls, values: typing.Dict[str, typing.Any] ) -> typing.Dict[str, typing.Any]: """Conditional Required Validation""" extension = values.get("extension", None) fhir_comments = values.get("fhir_comments", None) if ( values.get("id", None) is None and extension is None and fhir_comments is None ): raise PydanticCustomError( "model_validation_format", "One of field value is required.", {}, ) return values @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``FHIRPrimitiveExtension`` according to specification, with preserving original sequence order. """ return ["id", "extension"] ================================================ FILE: fhir/resources/fhirresourcemodel.py ================================================ from typing import Optional, Union from fhir_core.fhirabstractmodel import FHIRAbstractModel from .fhirtypes import IdType, StringType class FHIRResourceModel(FHIRAbstractModel): """Abstract base model class for all FHIR elements.""" __resource_type__ = "FHIRAbstractResource" id: Optional[Union[IdType, StringType]] = None def relative_base(self) -> str: """ """ return self.__resource_type__ def relative_path(self) -> str: if self.id is None: return self.relative_base() return "{0}/{1}".format(self.relative_base(), self.id) ================================================ FILE: fhir/resources/fhirtypes.py ================================================ from __future__ import annotations as _annotations from typing import TYPE_CHECKING from fhir_core.types import ( Base64BinaryType, BooleanType, CanonicalType, CodeType, DateTimeType, DateType, DecimalType, IdType, InstantType, Integer64Type, IntegerType, MarkdownType, OidType, PositiveIntType, StringType, TimeType, UnsignedIntType, UriType, UrlType, UuidType, XhtmlType, create_fhir_element_or_resource_type, create_fhir_type, ) __author__ = "Md Nazrul Islam" __email__ = "email2nazrul@gmail.com" # The dependency hierarchy is circular due to Extension being referenced in FHIRPrimitiveExtension # which itself is referenced in every resource. Extension is also referenced in several resources and refers to several resources. # Pydantic fields can not use forward references as this causes the "class not fully defined" error at runtime: https://docs.pydantic.dev/2.12/errors/usage_errors/#class-not-fully-defined # To properly allow type checkers to type check, use type aliases during type checking and the create_fhir_type workaround at runtime. if TYPE_CHECKING: from . import ( account, activitydefinition, actordefinition, address, administrableproductdefinition, adverseevent, age, allergyintolerance, annotation, appointment, appointmentresponse, artifactassessment, attachment, auditevent, availability, backboneelement, backbonetype, base, basic, binary, biologicallyderivedproduct, biologicallyderivedproductdispense, bodystructure, bundle, canonicalresource, capabilitystatement, careplan, careteam, chargeitem, chargeitemdefinition, citation, claim, claimresponse, clinicalimpression, clinicalusedefinition, codeableconcept, codeablereference, codesystem, coding, communication, communicationrequest, compartmentdefinition, composition, conceptmap, condition, conditiondefinition, consent, contactdetail, contactpoint, contract, contributor, count, coverage, coverageeligibilityrequest, coverageeligibilityresponse, datarequirement, datatype, detectedissue, device, deviceassociation, devicedefinition, devicedispense, devicemetric, devicerequest, deviceusage, diagnosticreport, distance, documentreference, domainresource, dosage, duration, element, elementdefinition, encounter, encounterhistory, endpoint, enrollmentrequest, enrollmentresponse, episodeofcare, eventdefinition, evidence, evidencereport, evidencevariable, examplescenario, explanationofbenefit, expression, extendedcontactdetail, extension, familymemberhistory, flag, formularyitem, genomicstudy, goal, graphdefinition, group, guidanceresponse, healthcareservice, humanname, identifier, imagingselection, imagingstudy, immunization, immunizationevaluation, immunizationrecommendation, implementationguide, ingredient, insuranceplan, inventoryitem, inventoryreport, invoice, library, linkage, list, location, manufactureditemdefinition, marketingstatus, measure, measurereport, medication, medicationadministration, medicationdispense, medicationknowledge, medicationrequest, medicationstatement, medicinalproductdefinition, messagedefinition, messageheader, meta, metadataresource, molecularsequence, monetarycomponent, money, namingsystem, narrative, nutritionintake, nutritionorder, nutritionproduct, observation, observationdefinition, operationdefinition, operationoutcome, organization, organizationaffiliation, packagedproductdefinition, parameterdefinition, parameters, patient, paymentnotice, paymentreconciliation, period, permission, person, plandefinition, practitioner, practitionerrole, primitivetype, procedure, productshelflife, provenance, quantity, questionnaire, questionnaireresponse, range, ratio, ratiorange, reference, regulatedauthorization, relatedartifact, relatedperson, requestorchestration, requirements, researchstudy, researchsubject, resource, riskassessment, sampleddata, schedule, searchparameter, servicerequest, signature, slot, specimen, specimendefinition, structuredefinition, structuremap, subscription, subscriptionstatus, subscriptiontopic, substance, substancedefinition, substancenucleicacid, substancepolymer, substanceprotein, substancereferenceinformation, substancesourcematerial, supplydelivery, supplyrequest, task, terminologycapabilities, testplan, testreport, testscript, timing, transport, triggerdefinition, usagecontext, valueset, verificationresult, virtualservicedetail, visionprescription, ) from .fhirprimitiveextension import FHIRPrimitiveExtension FHIRPrimitiveExtensionType = FHIRPrimitiveExtension AccountType = account.Account AccountBalanceType = account.AccountBalance AccountCoverageType = account.AccountCoverage AccountDiagnosisType = account.AccountDiagnosis AccountGuarantorType = account.AccountGuarantor AccountProcedureType = account.AccountProcedure AccountRelatedAccountType = account.AccountRelatedAccount ActivityDefinitionType = activitydefinition.ActivityDefinition ActivityDefinitionDynamicValueType = ( activitydefinition.ActivityDefinitionDynamicValue ) ActivityDefinitionParticipantType = activitydefinition.ActivityDefinitionParticipant ActorDefinitionType = actordefinition.ActorDefinition AddressType = address.Address AdministrableProductDefinitionType = ( administrableproductdefinition.AdministrableProductDefinition ) AdministrableProductDefinitionPropertyType = ( administrableproductdefinition.AdministrableProductDefinitionProperty ) AdministrableProductDefinitionRouteOfAdministrationType = ( administrableproductdefinition.AdministrableProductDefinitionRouteOfAdministration ) AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesType = ( administrableproductdefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpecies ) AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodType = ( administrableproductdefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriod ) AdverseEventType = adverseevent.AdverseEvent AdverseEventContributingFactorType = adverseevent.AdverseEventContributingFactor AdverseEventMitigatingActionType = adverseevent.AdverseEventMitigatingAction AdverseEventParticipantType = adverseevent.AdverseEventParticipant AdverseEventPreventiveActionType = adverseevent.AdverseEventPreventiveAction AdverseEventSupportingInfoType = adverseevent.AdverseEventSupportingInfo AdverseEventSuspectEntityType = adverseevent.AdverseEventSuspectEntity AdverseEventSuspectEntityCausalityType = ( adverseevent.AdverseEventSuspectEntityCausality ) AgeType = age.Age AllergyIntoleranceType = allergyintolerance.AllergyIntolerance AllergyIntoleranceParticipantType = allergyintolerance.AllergyIntoleranceParticipant AllergyIntoleranceReactionType = allergyintolerance.AllergyIntoleranceReaction AnnotationType = annotation.Annotation AppointmentType = appointment.Appointment AppointmentParticipantType = appointment.AppointmentParticipant AppointmentRecurrenceTemplateType = appointment.AppointmentRecurrenceTemplate AppointmentRecurrenceTemplateMonthlyTemplateType = ( appointment.AppointmentRecurrenceTemplateMonthlyTemplate ) AppointmentRecurrenceTemplateWeeklyTemplateType = ( appointment.AppointmentRecurrenceTemplateWeeklyTemplate ) AppointmentRecurrenceTemplateYearlyTemplateType = ( appointment.AppointmentRecurrenceTemplateYearlyTemplate ) AppointmentResponseType = appointmentresponse.AppointmentResponse ArtifactAssessmentType = artifactassessment.ArtifactAssessment ArtifactAssessmentContentType = artifactassessment.ArtifactAssessmentContent AttachmentType = attachment.Attachment AuditEventType = auditevent.AuditEvent AuditEventAgentType = auditevent.AuditEventAgent AuditEventEntityType = auditevent.AuditEventEntity AuditEventEntityDetailType = auditevent.AuditEventEntityDetail AuditEventOutcomeType = auditevent.AuditEventOutcome AuditEventSourceType = auditevent.AuditEventSource AvailabilityType = availability.Availability AvailabilityAvailableTimeType = availability.AvailabilityAvailableTime AvailabilityNotAvailableTimeType = availability.AvailabilityNotAvailableTime BackboneElementType = backboneelement.BackboneElement BackboneTypeType = backbonetype.BackboneType BaseType = base.Base BasicType = basic.Basic BinaryType = binary.Binary BiologicallyDerivedProductType = ( biologicallyderivedproduct.BiologicallyDerivedProduct ) BiologicallyDerivedProductCollectionType = ( biologicallyderivedproduct.BiologicallyDerivedProductCollection ) BiologicallyDerivedProductDispenseType = ( biologicallyderivedproductdispense.BiologicallyDerivedProductDispense ) BiologicallyDerivedProductDispensePerformerType = ( biologicallyderivedproductdispense.BiologicallyDerivedProductDispensePerformer ) BiologicallyDerivedProductPropertyType = ( biologicallyderivedproduct.BiologicallyDerivedProductProperty ) BodyStructureType = bodystructure.BodyStructure BodyStructureIncludedStructureType = bodystructure.BodyStructureIncludedStructure BodyStructureIncludedStructureBodyLandmarkOrientationType = ( bodystructure.BodyStructureIncludedStructureBodyLandmarkOrientation ) BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmarkType = ( bodystructure.BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmark ) BundleType = bundle.Bundle BundleEntryType = bundle.BundleEntry BundleEntryRequestType = bundle.BundleEntryRequest BundleEntryResponseType = bundle.BundleEntryResponse BundleEntrySearchType = bundle.BundleEntrySearch BundleLinkType = bundle.BundleLink CanonicalResourceType = canonicalresource.CanonicalResource CapabilityStatementType = capabilitystatement.CapabilityStatement CapabilityStatementDocumentType = capabilitystatement.CapabilityStatementDocument CapabilityStatementImplementationType = ( capabilitystatement.CapabilityStatementImplementation ) CapabilityStatementMessagingType = capabilitystatement.CapabilityStatementMessaging CapabilityStatementMessagingEndpointType = ( capabilitystatement.CapabilityStatementMessagingEndpoint ) CapabilityStatementMessagingSupportedMessageType = ( capabilitystatement.CapabilityStatementMessagingSupportedMessage ) CapabilityStatementRestType = capabilitystatement.CapabilityStatementRest CapabilityStatementRestInteractionType = ( capabilitystatement.CapabilityStatementRestInteraction ) CapabilityStatementRestResourceType = ( capabilitystatement.CapabilityStatementRestResource ) CapabilityStatementRestResourceInteractionType = ( capabilitystatement.CapabilityStatementRestResourceInteraction ) CapabilityStatementRestResourceOperationType = ( capabilitystatement.CapabilityStatementRestResourceOperation ) CapabilityStatementRestResourceSearchParamType = ( capabilitystatement.CapabilityStatementRestResourceSearchParam ) CapabilityStatementRestSecurityType = ( capabilitystatement.CapabilityStatementRestSecurity ) CapabilityStatementSoftwareType = capabilitystatement.CapabilityStatementSoftware CarePlanType = careplan.CarePlan CarePlanActivityType = careplan.CarePlanActivity CareTeamType = careteam.CareTeam CareTeamParticipantType = careteam.CareTeamParticipant ChargeItemType = chargeitem.ChargeItem ChargeItemDefinitionType = chargeitemdefinition.ChargeItemDefinition ChargeItemDefinitionApplicabilityType = ( chargeitemdefinition.ChargeItemDefinitionApplicability ) ChargeItemDefinitionPropertyGroupType = ( chargeitemdefinition.ChargeItemDefinitionPropertyGroup ) ChargeItemPerformerType = chargeitem.ChargeItemPerformer CitationType = citation.Citation CitationCitedArtifactType = citation.CitationCitedArtifact CitationCitedArtifactAbstractType = citation.CitationCitedArtifactAbstract CitationCitedArtifactClassificationType = ( citation.CitationCitedArtifactClassification ) CitationCitedArtifactContributorshipType = ( citation.CitationCitedArtifactContributorship ) CitationCitedArtifactContributorshipEntryType = ( citation.CitationCitedArtifactContributorshipEntry ) CitationCitedArtifactContributorshipEntryContributionInstanceType = ( citation.CitationCitedArtifactContributorshipEntryContributionInstance ) CitationCitedArtifactContributorshipSummaryType = ( citation.CitationCitedArtifactContributorshipSummary ) CitationCitedArtifactPartType = citation.CitationCitedArtifactPart CitationCitedArtifactPublicationFormType = ( citation.CitationCitedArtifactPublicationForm ) CitationCitedArtifactPublicationFormPublishedInType = ( citation.CitationCitedArtifactPublicationFormPublishedIn ) CitationCitedArtifactRelatesToType = citation.CitationCitedArtifactRelatesTo CitationCitedArtifactStatusDateType = citation.CitationCitedArtifactStatusDate CitationCitedArtifactTitleType = citation.CitationCitedArtifactTitle CitationCitedArtifactVersionType = citation.CitationCitedArtifactVersion CitationCitedArtifactWebLocationType = citation.CitationCitedArtifactWebLocation CitationClassificationType = citation.CitationClassification CitationStatusDateType = citation.CitationStatusDate CitationSummaryType = citation.CitationSummary ClaimType = claim.Claim ClaimAccidentType = claim.ClaimAccident ClaimCareTeamType = claim.ClaimCareTeam ClaimDiagnosisType = claim.ClaimDiagnosis ClaimEventType = claim.ClaimEvent ClaimInsuranceType = claim.ClaimInsurance ClaimItemType = claim.ClaimItem ClaimItemBodySiteType = claim.ClaimItemBodySite ClaimItemDetailType = claim.ClaimItemDetail ClaimItemDetailSubDetailType = claim.ClaimItemDetailSubDetail ClaimPayeeType = claim.ClaimPayee ClaimProcedureType = claim.ClaimProcedure ClaimRelatedType = claim.ClaimRelated ClaimResponseType = claimresponse.ClaimResponse ClaimResponseAddItemType = claimresponse.ClaimResponseAddItem ClaimResponseAddItemBodySiteType = claimresponse.ClaimResponseAddItemBodySite ClaimResponseAddItemDetailType = claimresponse.ClaimResponseAddItemDetail ClaimResponseAddItemDetailSubDetailType = ( claimresponse.ClaimResponseAddItemDetailSubDetail ) ClaimResponseErrorType = claimresponse.ClaimResponseError ClaimResponseEventType = claimresponse.ClaimResponseEvent ClaimResponseInsuranceType = claimresponse.ClaimResponseInsurance ClaimResponseItemType = claimresponse.ClaimResponseItem ClaimResponseItemAdjudicationType = claimresponse.ClaimResponseItemAdjudication ClaimResponseItemDetailType = claimresponse.ClaimResponseItemDetail ClaimResponseItemDetailSubDetailType = ( claimresponse.ClaimResponseItemDetailSubDetail ) ClaimResponseItemReviewOutcomeType = claimresponse.ClaimResponseItemReviewOutcome ClaimResponsePaymentType = claimresponse.ClaimResponsePayment ClaimResponseProcessNoteType = claimresponse.ClaimResponseProcessNote ClaimResponseTotalType = claimresponse.ClaimResponseTotal ClaimSupportingInfoType = claim.ClaimSupportingInfo ClinicalImpressionType = clinicalimpression.ClinicalImpression ClinicalImpressionFindingType = clinicalimpression.ClinicalImpressionFinding ClinicalUseDefinitionType = clinicalusedefinition.ClinicalUseDefinition ClinicalUseDefinitionContraindicationType = ( clinicalusedefinition.ClinicalUseDefinitionContraindication ) ClinicalUseDefinitionContraindicationOtherTherapyType = ( clinicalusedefinition.ClinicalUseDefinitionContraindicationOtherTherapy ) ClinicalUseDefinitionIndicationType = ( clinicalusedefinition.ClinicalUseDefinitionIndication ) ClinicalUseDefinitionInteractionType = ( clinicalusedefinition.ClinicalUseDefinitionInteraction ) ClinicalUseDefinitionInteractionInteractantType = ( clinicalusedefinition.ClinicalUseDefinitionInteractionInteractant ) ClinicalUseDefinitionUndesirableEffectType = ( clinicalusedefinition.ClinicalUseDefinitionUndesirableEffect ) ClinicalUseDefinitionWarningType = ( clinicalusedefinition.ClinicalUseDefinitionWarning ) CodeSystemType = codesystem.CodeSystem CodeSystemConceptType = codesystem.CodeSystemConcept CodeSystemConceptDesignationType = codesystem.CodeSystemConceptDesignation CodeSystemConceptPropertyType = codesystem.CodeSystemConceptProperty CodeSystemFilterType = codesystem.CodeSystemFilter CodeSystemPropertyType = codesystem.CodeSystemProperty CodeableConceptType = codeableconcept.CodeableConcept CodeableReferenceType = codeablereference.CodeableReference CodingType = coding.Coding CommunicationType = communication.Communication CommunicationPayloadType = communication.CommunicationPayload CommunicationRequestType = communicationrequest.CommunicationRequest CommunicationRequestPayloadType = communicationrequest.CommunicationRequestPayload CompartmentDefinitionType = compartmentdefinition.CompartmentDefinition CompartmentDefinitionResourceType = ( compartmentdefinition.CompartmentDefinitionResource ) CompositionType = composition.Composition CompositionAttesterType = composition.CompositionAttester CompositionEventType = composition.CompositionEvent CompositionSectionType = composition.CompositionSection ConceptMapType = conceptmap.ConceptMap ConceptMapAdditionalAttributeType = conceptmap.ConceptMapAdditionalAttribute ConceptMapGroupType = conceptmap.ConceptMapGroup ConceptMapGroupElementType = conceptmap.ConceptMapGroupElement ConceptMapGroupElementTargetType = conceptmap.ConceptMapGroupElementTarget ConceptMapGroupElementTargetDependsOnType = ( conceptmap.ConceptMapGroupElementTargetDependsOn ) ConceptMapGroupElementTargetPropertyType = ( conceptmap.ConceptMapGroupElementTargetProperty ) ConceptMapGroupUnmappedType = conceptmap.ConceptMapGroupUnmapped ConceptMapPropertyType = conceptmap.ConceptMapProperty ConditionType = condition.Condition ConditionDefinitionType = conditiondefinition.ConditionDefinition ConditionDefinitionMedicationType = ( conditiondefinition.ConditionDefinitionMedication ) ConditionDefinitionObservationType = ( conditiondefinition.ConditionDefinitionObservation ) ConditionDefinitionPlanType = conditiondefinition.ConditionDefinitionPlan ConditionDefinitionPreconditionType = ( conditiondefinition.ConditionDefinitionPrecondition ) ConditionDefinitionQuestionnaireType = ( conditiondefinition.ConditionDefinitionQuestionnaire ) ConditionParticipantType = condition.ConditionParticipant ConditionStageType = condition.ConditionStage ConsentType = consent.Consent ConsentPolicyBasisType = consent.ConsentPolicyBasis ConsentProvisionType = consent.ConsentProvision ConsentProvisionActorType = consent.ConsentProvisionActor ConsentProvisionDataType = consent.ConsentProvisionData ConsentVerificationType = consent.ConsentVerification ContactDetailType = contactdetail.ContactDetail ContactPointType = contactpoint.ContactPoint ContractType = contract.Contract ContractContentDefinitionType = contract.ContractContentDefinition ContractFriendlyType = contract.ContractFriendly ContractLegalType = contract.ContractLegal ContractRuleType = contract.ContractRule ContractSignerType = contract.ContractSigner ContractTermType = contract.ContractTerm ContractTermActionType = contract.ContractTermAction ContractTermActionSubjectType = contract.ContractTermActionSubject ContractTermAssetType = contract.ContractTermAsset ContractTermAssetContextType = contract.ContractTermAssetContext ContractTermAssetValuedItemType = contract.ContractTermAssetValuedItem ContractTermOfferType = contract.ContractTermOffer ContractTermOfferAnswerType = contract.ContractTermOfferAnswer ContractTermOfferPartyType = contract.ContractTermOfferParty ContractTermSecurityLabelType = contract.ContractTermSecurityLabel ContributorType = contributor.Contributor CountType = count.Count CoverageType = coverage.Coverage CoverageClassType = coverage.CoverageClass CoverageCostToBeneficiaryType = coverage.CoverageCostToBeneficiary CoverageCostToBeneficiaryExceptionType = coverage.CoverageCostToBeneficiaryException CoverageEligibilityRequestType = ( coverageeligibilityrequest.CoverageEligibilityRequest ) CoverageEligibilityRequestEventType = ( coverageeligibilityrequest.CoverageEligibilityRequestEvent ) CoverageEligibilityRequestInsuranceType = ( coverageeligibilityrequest.CoverageEligibilityRequestInsurance ) CoverageEligibilityRequestItemType = ( coverageeligibilityrequest.CoverageEligibilityRequestItem ) CoverageEligibilityRequestItemDiagnosisType = ( coverageeligibilityrequest.CoverageEligibilityRequestItemDiagnosis ) CoverageEligibilityRequestSupportingInfoType = ( coverageeligibilityrequest.CoverageEligibilityRequestSupportingInfo ) CoverageEligibilityResponseType = ( coverageeligibilityresponse.CoverageEligibilityResponse ) CoverageEligibilityResponseErrorType = ( coverageeligibilityresponse.CoverageEligibilityResponseError ) CoverageEligibilityResponseEventType = ( coverageeligibilityresponse.CoverageEligibilityResponseEvent ) CoverageEligibilityResponseInsuranceType = ( coverageeligibilityresponse.CoverageEligibilityResponseInsurance ) CoverageEligibilityResponseInsuranceItemType = ( coverageeligibilityresponse.CoverageEligibilityResponseInsuranceItem ) CoverageEligibilityResponseInsuranceItemBenefitType = ( coverageeligibilityresponse.CoverageEligibilityResponseInsuranceItemBenefit ) CoveragePaymentByType = coverage.CoveragePaymentBy DataRequirementType = datarequirement.DataRequirement DataRequirementCodeFilterType = datarequirement.DataRequirementCodeFilter DataRequirementDateFilterType = datarequirement.DataRequirementDateFilter DataRequirementSortType = datarequirement.DataRequirementSort DataRequirementValueFilterType = datarequirement.DataRequirementValueFilter DataTypeType = datatype.DataType DetectedIssueType = detectedissue.DetectedIssue DetectedIssueEvidenceType = detectedissue.DetectedIssueEvidence DetectedIssueMitigationType = detectedissue.DetectedIssueMitigation DeviceType = device.Device DeviceAssociationType = deviceassociation.DeviceAssociation DeviceAssociationOperationType = deviceassociation.DeviceAssociationOperation DeviceConformsToType = device.DeviceConformsTo DeviceDefinitionType = devicedefinition.DeviceDefinition DeviceDefinitionChargeItemType = devicedefinition.DeviceDefinitionChargeItem DeviceDefinitionClassificationType = devicedefinition.DeviceDefinitionClassification DeviceDefinitionConformsToType = devicedefinition.DeviceDefinitionConformsTo DeviceDefinitionCorrectiveActionType = ( devicedefinition.DeviceDefinitionCorrectiveAction ) DeviceDefinitionDeviceNameType = devicedefinition.DeviceDefinitionDeviceName DeviceDefinitionGuidelineType = devicedefinition.DeviceDefinitionGuideline DeviceDefinitionHasPartType = devicedefinition.DeviceDefinitionHasPart DeviceDefinitionLinkType = devicedefinition.DeviceDefinitionLink DeviceDefinitionMaterialType = devicedefinition.DeviceDefinitionMaterial DeviceDefinitionPackagingType = devicedefinition.DeviceDefinitionPackaging DeviceDefinitionPackagingDistributorType = ( devicedefinition.DeviceDefinitionPackagingDistributor ) DeviceDefinitionPropertyType = devicedefinition.DeviceDefinitionProperty DeviceDefinitionRegulatoryIdentifierType = ( devicedefinition.DeviceDefinitionRegulatoryIdentifier ) DeviceDefinitionUdiDeviceIdentifierType = ( devicedefinition.DeviceDefinitionUdiDeviceIdentifier ) DeviceDefinitionUdiDeviceIdentifierMarketDistributionType = ( devicedefinition.DeviceDefinitionUdiDeviceIdentifierMarketDistribution ) DeviceDefinitionVersionType = devicedefinition.DeviceDefinitionVersion DeviceDispenseType = devicedispense.DeviceDispense DeviceDispensePerformerType = devicedispense.DeviceDispensePerformer DeviceMetricType = devicemetric.DeviceMetric DeviceMetricCalibrationType = devicemetric.DeviceMetricCalibration DeviceNameType = device.DeviceName DevicePropertyType = device.DeviceProperty DeviceRequestType = devicerequest.DeviceRequest DeviceRequestParameterType = devicerequest.DeviceRequestParameter DeviceUdiCarrierType = device.DeviceUdiCarrier DeviceUsageType = deviceusage.DeviceUsage DeviceUsageAdherenceType = deviceusage.DeviceUsageAdherence DeviceVersionType = device.DeviceVersion DiagnosticReportType = diagnosticreport.DiagnosticReport DiagnosticReportMediaType = diagnosticreport.DiagnosticReportMedia DiagnosticReportSupportingInfoType = diagnosticreport.DiagnosticReportSupportingInfo DistanceType = distance.Distance DocumentReferenceType = documentreference.DocumentReference DocumentReferenceAttesterType = documentreference.DocumentReferenceAttester DocumentReferenceContentType = documentreference.DocumentReferenceContent DocumentReferenceContentProfileType = ( documentreference.DocumentReferenceContentProfile ) DocumentReferenceRelatesToType = documentreference.DocumentReferenceRelatesTo DomainResourceType = domainresource.DomainResource DosageType = dosage.Dosage DosageDoseAndRateType = dosage.DosageDoseAndRate DurationType = duration.Duration ElementType = element.Element ElementDefinitionType = elementdefinition.ElementDefinition ElementDefinitionBaseType = elementdefinition.ElementDefinitionBase ElementDefinitionBindingType = elementdefinition.ElementDefinitionBinding ElementDefinitionBindingAdditionalType = ( elementdefinition.ElementDefinitionBindingAdditional ) ElementDefinitionConstraintType = elementdefinition.ElementDefinitionConstraint ElementDefinitionExampleType = elementdefinition.ElementDefinitionExample ElementDefinitionMappingType = elementdefinition.ElementDefinitionMapping ElementDefinitionSlicingType = elementdefinition.ElementDefinitionSlicing ElementDefinitionSlicingDiscriminatorType = ( elementdefinition.ElementDefinitionSlicingDiscriminator ) ElementDefinitionTypeType = elementdefinition.ElementDefinitionType EncounterType = encounter.Encounter EncounterAdmissionType = encounter.EncounterAdmission EncounterDiagnosisType = encounter.EncounterDiagnosis EncounterHistoryType = encounterhistory.EncounterHistory EncounterHistoryLocationType = encounterhistory.EncounterHistoryLocation EncounterLocationType = encounter.EncounterLocation EncounterParticipantType = encounter.EncounterParticipant EncounterReasonType = encounter.EncounterReason EndpointType = endpoint.Endpoint EndpointPayloadType = endpoint.EndpointPayload EnrollmentRequestType = enrollmentrequest.EnrollmentRequest EnrollmentResponseType = enrollmentresponse.EnrollmentResponse EpisodeOfCareType = episodeofcare.EpisodeOfCare EpisodeOfCareDiagnosisType = episodeofcare.EpisodeOfCareDiagnosis EpisodeOfCareReasonType = episodeofcare.EpisodeOfCareReason EpisodeOfCareStatusHistoryType = episodeofcare.EpisodeOfCareStatusHistory EventDefinitionType = eventdefinition.EventDefinition EvidenceType = evidence.Evidence EvidenceCertaintyType = evidence.EvidenceCertainty EvidenceReportType = evidencereport.EvidenceReport EvidenceReportRelatesToType = evidencereport.EvidenceReportRelatesTo EvidenceReportRelatesToTargetType = evidencereport.EvidenceReportRelatesToTarget EvidenceReportSectionType = evidencereport.EvidenceReportSection EvidenceReportSubjectType = evidencereport.EvidenceReportSubject EvidenceReportSubjectCharacteristicType = ( evidencereport.EvidenceReportSubjectCharacteristic ) EvidenceStatisticType = evidence.EvidenceStatistic EvidenceStatisticAttributeEstimateType = evidence.EvidenceStatisticAttributeEstimate EvidenceStatisticModelCharacteristicType = ( evidence.EvidenceStatisticModelCharacteristic ) EvidenceStatisticModelCharacteristicVariableType = ( evidence.EvidenceStatisticModelCharacteristicVariable ) EvidenceStatisticSampleSizeType = evidence.EvidenceStatisticSampleSize EvidenceVariableType = evidencevariable.EvidenceVariable EvidenceVariableCategoryType = evidencevariable.EvidenceVariableCategory EvidenceVariableCharacteristicType = evidencevariable.EvidenceVariableCharacteristic EvidenceVariableCharacteristicDefinitionByCombinationType = ( evidencevariable.EvidenceVariableCharacteristicDefinitionByCombination ) EvidenceVariableCharacteristicDefinitionByTypeAndValueType = ( evidencevariable.EvidenceVariableCharacteristicDefinitionByTypeAndValue ) EvidenceVariableCharacteristicTimeFromEventType = ( evidencevariable.EvidenceVariableCharacteristicTimeFromEvent ) EvidenceVariableDefinitionType = evidence.EvidenceVariableDefinition ExampleScenarioType = examplescenario.ExampleScenario ExampleScenarioActorType = examplescenario.ExampleScenarioActor ExampleScenarioInstanceType = examplescenario.ExampleScenarioInstance ExampleScenarioInstanceContainedInstanceType = ( examplescenario.ExampleScenarioInstanceContainedInstance ) ExampleScenarioInstanceVersionType = examplescenario.ExampleScenarioInstanceVersion ExampleScenarioProcessType = examplescenario.ExampleScenarioProcess ExampleScenarioProcessStepType = examplescenario.ExampleScenarioProcessStep ExampleScenarioProcessStepAlternativeType = ( examplescenario.ExampleScenarioProcessStepAlternative ) ExampleScenarioProcessStepOperationType = ( examplescenario.ExampleScenarioProcessStepOperation ) ExplanationOfBenefitType = explanationofbenefit.ExplanationOfBenefit ExplanationOfBenefitAccidentType = explanationofbenefit.ExplanationOfBenefitAccident ExplanationOfBenefitAddItemType = explanationofbenefit.ExplanationOfBenefitAddItem ExplanationOfBenefitAddItemBodySiteType = ( explanationofbenefit.ExplanationOfBenefitAddItemBodySite ) ExplanationOfBenefitAddItemDetailType = ( explanationofbenefit.ExplanationOfBenefitAddItemDetail ) ExplanationOfBenefitAddItemDetailSubDetailType = ( explanationofbenefit.ExplanationOfBenefitAddItemDetailSubDetail ) ExplanationOfBenefitBenefitBalanceType = ( explanationofbenefit.ExplanationOfBenefitBenefitBalance ) ExplanationOfBenefitBenefitBalanceFinancialType = ( explanationofbenefit.ExplanationOfBenefitBenefitBalanceFinancial ) ExplanationOfBenefitCareTeamType = explanationofbenefit.ExplanationOfBenefitCareTeam ExplanationOfBenefitDiagnosisType = ( explanationofbenefit.ExplanationOfBenefitDiagnosis ) ExplanationOfBenefitEventType = explanationofbenefit.ExplanationOfBenefitEvent ExplanationOfBenefitInsuranceType = ( explanationofbenefit.ExplanationOfBenefitInsurance ) ExplanationOfBenefitItemType = explanationofbenefit.ExplanationOfBenefitItem ExplanationOfBenefitItemAdjudicationType = ( explanationofbenefit.ExplanationOfBenefitItemAdjudication ) ExplanationOfBenefitItemBodySiteType = ( explanationofbenefit.ExplanationOfBenefitItemBodySite ) ExplanationOfBenefitItemDetailType = ( explanationofbenefit.ExplanationOfBenefitItemDetail ) ExplanationOfBenefitItemDetailSubDetailType = ( explanationofbenefit.ExplanationOfBenefitItemDetailSubDetail ) ExplanationOfBenefitItemReviewOutcomeType = ( explanationofbenefit.ExplanationOfBenefitItemReviewOutcome ) ExplanationOfBenefitPayeeType = explanationofbenefit.ExplanationOfBenefitPayee ExplanationOfBenefitPaymentType = explanationofbenefit.ExplanationOfBenefitPayment ExplanationOfBenefitProcedureType = ( explanationofbenefit.ExplanationOfBenefitProcedure ) ExplanationOfBenefitProcessNoteType = ( explanationofbenefit.ExplanationOfBenefitProcessNote ) ExplanationOfBenefitRelatedType = explanationofbenefit.ExplanationOfBenefitRelated ExplanationOfBenefitSupportingInfoType = ( explanationofbenefit.ExplanationOfBenefitSupportingInfo ) ExplanationOfBenefitTotalType = explanationofbenefit.ExplanationOfBenefitTotal ExpressionType = expression.Expression ExtendedContactDetailType = extendedcontactdetail.ExtendedContactDetail ExtensionType = extension.Extension FamilyMemberHistoryType = familymemberhistory.FamilyMemberHistory FamilyMemberHistoryConditionType = familymemberhistory.FamilyMemberHistoryCondition FamilyMemberHistoryParticipantType = ( familymemberhistory.FamilyMemberHistoryParticipant ) FamilyMemberHistoryProcedureType = familymemberhistory.FamilyMemberHistoryProcedure FlagType = flag.Flag FormularyItemType = formularyitem.FormularyItem GenomicStudyType = genomicstudy.GenomicStudy GenomicStudyAnalysisType = genomicstudy.GenomicStudyAnalysis GenomicStudyAnalysisDeviceType = genomicstudy.GenomicStudyAnalysisDevice GenomicStudyAnalysisInputType = genomicstudy.GenomicStudyAnalysisInput GenomicStudyAnalysisOutputType = genomicstudy.GenomicStudyAnalysisOutput GenomicStudyAnalysisPerformerType = genomicstudy.GenomicStudyAnalysisPerformer GoalType = goal.Goal GoalTargetType = goal.GoalTarget GraphDefinitionType = graphdefinition.GraphDefinition GraphDefinitionLinkType = graphdefinition.GraphDefinitionLink GraphDefinitionLinkCompartmentType = graphdefinition.GraphDefinitionLinkCompartment GraphDefinitionNodeType = graphdefinition.GraphDefinitionNode GroupType = group.Group GroupCharacteristicType = group.GroupCharacteristic GroupMemberType = group.GroupMember GuidanceResponseType = guidanceresponse.GuidanceResponse HealthcareServiceType = healthcareservice.HealthcareService HealthcareServiceEligibilityType = healthcareservice.HealthcareServiceEligibility HumanNameType = humanname.HumanName IdentifierType = identifier.Identifier ImagingSelectionType = imagingselection.ImagingSelection ImagingSelectionInstanceType = imagingselection.ImagingSelectionInstance ImagingSelectionInstanceImageRegion2DType = ( imagingselection.ImagingSelectionInstanceImageRegion2D ) ImagingSelectionInstanceImageRegion3DType = ( imagingselection.ImagingSelectionInstanceImageRegion3D ) ImagingSelectionPerformerType = imagingselection.ImagingSelectionPerformer ImagingStudyType = imagingstudy.ImagingStudy ImagingStudySeriesType = imagingstudy.ImagingStudySeries ImagingStudySeriesInstanceType = imagingstudy.ImagingStudySeriesInstance ImagingStudySeriesPerformerType = imagingstudy.ImagingStudySeriesPerformer ImmunizationType = immunization.Immunization ImmunizationEvaluationType = immunizationevaluation.ImmunizationEvaluation ImmunizationPerformerType = immunization.ImmunizationPerformer ImmunizationProgramEligibilityType = immunization.ImmunizationProgramEligibility ImmunizationProtocolAppliedType = immunization.ImmunizationProtocolApplied ImmunizationReactionType = immunization.ImmunizationReaction ImmunizationRecommendationType = ( immunizationrecommendation.ImmunizationRecommendation ) ImmunizationRecommendationRecommendationType = ( immunizationrecommendation.ImmunizationRecommendationRecommendation ) ImmunizationRecommendationRecommendationDateCriterionType = ( immunizationrecommendation.ImmunizationRecommendationRecommendationDateCriterion ) ImplementationGuideType = implementationguide.ImplementationGuide ImplementationGuideDefinitionType = ( implementationguide.ImplementationGuideDefinition ) ImplementationGuideDefinitionGroupingType = ( implementationguide.ImplementationGuideDefinitionGrouping ) ImplementationGuideDefinitionPageType = ( implementationguide.ImplementationGuideDefinitionPage ) ImplementationGuideDefinitionParameterType = ( implementationguide.ImplementationGuideDefinitionParameter ) ImplementationGuideDefinitionResourceType = ( implementationguide.ImplementationGuideDefinitionResource ) ImplementationGuideDefinitionTemplateType = ( implementationguide.ImplementationGuideDefinitionTemplate ) ImplementationGuideDependsOnType = implementationguide.ImplementationGuideDependsOn ImplementationGuideGlobalType = implementationguide.ImplementationGuideGlobal ImplementationGuideManifestType = implementationguide.ImplementationGuideManifest ImplementationGuideManifestPageType = ( implementationguide.ImplementationGuideManifestPage ) ImplementationGuideManifestResourceType = ( implementationguide.ImplementationGuideManifestResource ) IngredientType = ingredient.Ingredient IngredientManufacturerType = ingredient.IngredientManufacturer IngredientSubstanceType = ingredient.IngredientSubstance IngredientSubstanceStrengthType = ingredient.IngredientSubstanceStrength IngredientSubstanceStrengthReferenceStrengthType = ( ingredient.IngredientSubstanceStrengthReferenceStrength ) InsurancePlanType = insuranceplan.InsurancePlan InsurancePlanCoverageType = insuranceplan.InsurancePlanCoverage InsurancePlanCoverageBenefitType = insuranceplan.InsurancePlanCoverageBenefit InsurancePlanCoverageBenefitLimitType = ( insuranceplan.InsurancePlanCoverageBenefitLimit ) InsurancePlanPlanType = insuranceplan.InsurancePlanPlan InsurancePlanPlanGeneralCostType = insuranceplan.InsurancePlanPlanGeneralCost InsurancePlanPlanSpecificCostType = insuranceplan.InsurancePlanPlanSpecificCost InsurancePlanPlanSpecificCostBenefitType = ( insuranceplan.InsurancePlanPlanSpecificCostBenefit ) InsurancePlanPlanSpecificCostBenefitCostType = ( insuranceplan.InsurancePlanPlanSpecificCostBenefitCost ) InventoryItemType = inventoryitem.InventoryItem InventoryItemAssociationType = inventoryitem.InventoryItemAssociation InventoryItemCharacteristicType = inventoryitem.InventoryItemCharacteristic InventoryItemDescriptionType = inventoryitem.InventoryItemDescription InventoryItemInstanceType = inventoryitem.InventoryItemInstance InventoryItemNameType = inventoryitem.InventoryItemName InventoryItemResponsibleOrganizationType = ( inventoryitem.InventoryItemResponsibleOrganization ) InventoryReportType = inventoryreport.InventoryReport InventoryReportInventoryListingType = ( inventoryreport.InventoryReportInventoryListing ) InventoryReportInventoryListingItemType = ( inventoryreport.InventoryReportInventoryListingItem ) InvoiceType = invoice.Invoice InvoiceLineItemType = invoice.InvoiceLineItem InvoiceParticipantType = invoice.InvoiceParticipant LibraryType = library.Library LinkageType = linkage.Linkage LinkageItemType = linkage.LinkageItem ListType = list.List ListEntryType = list.ListEntry LocationType = location.Location LocationPositionType = location.LocationPosition ManufacturedItemDefinitionType = ( manufactureditemdefinition.ManufacturedItemDefinition ) ManufacturedItemDefinitionComponentType = ( manufactureditemdefinition.ManufacturedItemDefinitionComponent ) ManufacturedItemDefinitionComponentConstituentType = ( manufactureditemdefinition.ManufacturedItemDefinitionComponentConstituent ) ManufacturedItemDefinitionPropertyType = ( manufactureditemdefinition.ManufacturedItemDefinitionProperty ) MarketingStatusType = marketingstatus.MarketingStatus MeasureType = measure.Measure MeasureGroupType = measure.MeasureGroup MeasureGroupPopulationType = measure.MeasureGroupPopulation MeasureGroupStratifierType = measure.MeasureGroupStratifier MeasureGroupStratifierComponentType = measure.MeasureGroupStratifierComponent MeasureReportType = measurereport.MeasureReport MeasureReportGroupType = measurereport.MeasureReportGroup MeasureReportGroupPopulationType = measurereport.MeasureReportGroupPopulation MeasureReportGroupStratifierType = measurereport.MeasureReportGroupStratifier MeasureReportGroupStratifierStratumType = ( measurereport.MeasureReportGroupStratifierStratum ) MeasureReportGroupStratifierStratumComponentType = ( measurereport.MeasureReportGroupStratifierStratumComponent ) MeasureReportGroupStratifierStratumPopulationType = ( measurereport.MeasureReportGroupStratifierStratumPopulation ) MeasureSupplementalDataType = measure.MeasureSupplementalData MeasureTermType = measure.MeasureTerm MedicationType = medication.Medication MedicationAdministrationType = medicationadministration.MedicationAdministration MedicationAdministrationDosageType = ( medicationadministration.MedicationAdministrationDosage ) MedicationAdministrationPerformerType = ( medicationadministration.MedicationAdministrationPerformer ) MedicationBatchType = medication.MedicationBatch MedicationDispenseType = medicationdispense.MedicationDispense MedicationDispensePerformerType = medicationdispense.MedicationDispensePerformer MedicationDispenseSubstitutionType = ( medicationdispense.MedicationDispenseSubstitution ) MedicationIngredientType = medication.MedicationIngredient MedicationKnowledgeType = medicationknowledge.MedicationKnowledge MedicationKnowledgeCostType = medicationknowledge.MedicationKnowledgeCost MedicationKnowledgeDefinitionalType = ( medicationknowledge.MedicationKnowledgeDefinitional ) MedicationKnowledgeDefinitionalDrugCharacteristicType = ( medicationknowledge.MedicationKnowledgeDefinitionalDrugCharacteristic ) MedicationKnowledgeDefinitionalIngredientType = ( medicationknowledge.MedicationKnowledgeDefinitionalIngredient ) MedicationKnowledgeIndicationGuidelineType = ( medicationknowledge.MedicationKnowledgeIndicationGuideline ) MedicationKnowledgeIndicationGuidelineDosingGuidelineType = ( medicationknowledge.MedicationKnowledgeIndicationGuidelineDosingGuideline ) MedicationKnowledgeIndicationGuidelineDosingGuidelineDosageType = ( medicationknowledge.MedicationKnowledgeIndicationGuidelineDosingGuidelineDosage ) MedicationKnowledgeIndicationGuidelineDosingGuidelinePatientCharacteristicType = ( medicationknowledge.MedicationKnowledgeIndicationGuidelineDosingGuidelinePatientCharacteristic ) MedicationKnowledgeMedicineClassificationType = ( medicationknowledge.MedicationKnowledgeMedicineClassification ) MedicationKnowledgeMonitoringProgramType = ( medicationknowledge.MedicationKnowledgeMonitoringProgram ) MedicationKnowledgeMonographType = medicationknowledge.MedicationKnowledgeMonograph MedicationKnowledgePackagingType = medicationknowledge.MedicationKnowledgePackaging MedicationKnowledgeRegulatoryType = ( medicationknowledge.MedicationKnowledgeRegulatory ) MedicationKnowledgeRegulatoryMaxDispenseType = ( medicationknowledge.MedicationKnowledgeRegulatoryMaxDispense ) MedicationKnowledgeRegulatorySubstitutionType = ( medicationknowledge.MedicationKnowledgeRegulatorySubstitution ) MedicationKnowledgeRelatedMedicationKnowledgeType = ( medicationknowledge.MedicationKnowledgeRelatedMedicationKnowledge ) MedicationKnowledgeStorageGuidelineType = ( medicationknowledge.MedicationKnowledgeStorageGuideline ) MedicationKnowledgeStorageGuidelineEnvironmentalSettingType = ( medicationknowledge.MedicationKnowledgeStorageGuidelineEnvironmentalSetting ) MedicationRequestType = medicationrequest.MedicationRequest MedicationRequestDispenseRequestType = ( medicationrequest.MedicationRequestDispenseRequest ) MedicationRequestDispenseRequestInitialFillType = ( medicationrequest.MedicationRequestDispenseRequestInitialFill ) MedicationRequestSubstitutionType = medicationrequest.MedicationRequestSubstitution MedicationStatementType = medicationstatement.MedicationStatement MedicationStatementAdherenceType = medicationstatement.MedicationStatementAdherence MedicinalProductDefinitionType = ( medicinalproductdefinition.MedicinalProductDefinition ) MedicinalProductDefinitionCharacteristicType = ( medicinalproductdefinition.MedicinalProductDefinitionCharacteristic ) MedicinalProductDefinitionContactType = ( medicinalproductdefinition.MedicinalProductDefinitionContact ) MedicinalProductDefinitionCrossReferenceType = ( medicinalproductdefinition.MedicinalProductDefinitionCrossReference ) MedicinalProductDefinitionNameType = ( medicinalproductdefinition.MedicinalProductDefinitionName ) MedicinalProductDefinitionNamePartType = ( medicinalproductdefinition.MedicinalProductDefinitionNamePart ) MedicinalProductDefinitionNameUsageType = ( medicinalproductdefinition.MedicinalProductDefinitionNameUsage ) MedicinalProductDefinitionOperationType = ( medicinalproductdefinition.MedicinalProductDefinitionOperation ) MessageDefinitionType = messagedefinition.MessageDefinition MessageDefinitionAllowedResponseType = ( messagedefinition.MessageDefinitionAllowedResponse ) MessageDefinitionFocusType = messagedefinition.MessageDefinitionFocus MessageHeaderType = messageheader.MessageHeader MessageHeaderDestinationType = messageheader.MessageHeaderDestination MessageHeaderResponseType = messageheader.MessageHeaderResponse MessageHeaderSourceType = messageheader.MessageHeaderSource MetaType = meta.Meta MetadataResourceType = metadataresource.MetadataResource MolecularSequenceType = molecularsequence.MolecularSequence MolecularSequenceRelativeType = molecularsequence.MolecularSequenceRelative MolecularSequenceRelativeEditType = molecularsequence.MolecularSequenceRelativeEdit MolecularSequenceRelativeStartingSequenceType = ( molecularsequence.MolecularSequenceRelativeStartingSequence ) MonetaryComponentType = monetarycomponent.MonetaryComponent MoneyType = money.Money NamingSystemType = namingsystem.NamingSystem NamingSystemUniqueIdType = namingsystem.NamingSystemUniqueId NarrativeType = narrative.Narrative NutritionIntakeType = nutritionintake.NutritionIntake NutritionIntakeConsumedItemType = nutritionintake.NutritionIntakeConsumedItem NutritionIntakeIngredientLabelType = nutritionintake.NutritionIntakeIngredientLabel NutritionIntakePerformerType = nutritionintake.NutritionIntakePerformer NutritionOrderType = nutritionorder.NutritionOrder NutritionOrderEnteralFormulaType = nutritionorder.NutritionOrderEnteralFormula NutritionOrderEnteralFormulaAdditiveType = ( nutritionorder.NutritionOrderEnteralFormulaAdditive ) NutritionOrderEnteralFormulaAdministrationType = ( nutritionorder.NutritionOrderEnteralFormulaAdministration ) NutritionOrderEnteralFormulaAdministrationScheduleType = ( nutritionorder.NutritionOrderEnteralFormulaAdministrationSchedule ) NutritionOrderOralDietType = nutritionorder.NutritionOrderOralDiet NutritionOrderOralDietNutrientType = nutritionorder.NutritionOrderOralDietNutrient NutritionOrderOralDietScheduleType = nutritionorder.NutritionOrderOralDietSchedule NutritionOrderOralDietTextureType = nutritionorder.NutritionOrderOralDietTexture NutritionOrderSupplementType = nutritionorder.NutritionOrderSupplement NutritionOrderSupplementScheduleType = ( nutritionorder.NutritionOrderSupplementSchedule ) NutritionProductType = nutritionproduct.NutritionProduct NutritionProductCharacteristicType = nutritionproduct.NutritionProductCharacteristic NutritionProductIngredientType = nutritionproduct.NutritionProductIngredient NutritionProductInstanceType = nutritionproduct.NutritionProductInstance NutritionProductNutrientType = nutritionproduct.NutritionProductNutrient ObservationType = observation.Observation ObservationComponentType = observation.ObservationComponent ObservationDefinitionType = observationdefinition.ObservationDefinition ObservationDefinitionComponentType = ( observationdefinition.ObservationDefinitionComponent ) ObservationDefinitionQualifiedValueType = ( observationdefinition.ObservationDefinitionQualifiedValue ) ObservationReferenceRangeType = observation.ObservationReferenceRange ObservationTriggeredByType = observation.ObservationTriggeredBy OperationDefinitionType = operationdefinition.OperationDefinition OperationDefinitionOverloadType = operationdefinition.OperationDefinitionOverload OperationDefinitionParameterType = operationdefinition.OperationDefinitionParameter OperationDefinitionParameterBindingType = ( operationdefinition.OperationDefinitionParameterBinding ) OperationDefinitionParameterReferencedFromType = ( operationdefinition.OperationDefinitionParameterReferencedFrom ) OperationOutcomeType = operationoutcome.OperationOutcome OperationOutcomeIssueType = operationoutcome.OperationOutcomeIssue OrganizationType = organization.Organization OrganizationAffiliationType = organizationaffiliation.OrganizationAffiliation OrganizationQualificationType = organization.OrganizationQualification PackagedProductDefinitionType = packagedproductdefinition.PackagedProductDefinition PackagedProductDefinitionLegalStatusOfSupplyType = ( packagedproductdefinition.PackagedProductDefinitionLegalStatusOfSupply ) PackagedProductDefinitionPackagingType = ( packagedproductdefinition.PackagedProductDefinitionPackaging ) PackagedProductDefinitionPackagingContainedItemType = ( packagedproductdefinition.PackagedProductDefinitionPackagingContainedItem ) PackagedProductDefinitionPackagingPropertyType = ( packagedproductdefinition.PackagedProductDefinitionPackagingProperty ) ParameterDefinitionType = parameterdefinition.ParameterDefinition ParametersType = parameters.Parameters ParametersParameterType = parameters.ParametersParameter PatientType = patient.Patient PatientCommunicationType = patient.PatientCommunication PatientContactType = patient.PatientContact PatientLinkType = patient.PatientLink PaymentNoticeType = paymentnotice.PaymentNotice PaymentReconciliationType = paymentreconciliation.PaymentReconciliation PaymentReconciliationAllocationType = ( paymentreconciliation.PaymentReconciliationAllocation ) PaymentReconciliationProcessNoteType = ( paymentreconciliation.PaymentReconciliationProcessNote ) PeriodType = period.Period PermissionType = permission.Permission PermissionJustificationType = permission.PermissionJustification PermissionRuleType = permission.PermissionRule PermissionRuleActivityType = permission.PermissionRuleActivity PermissionRuleDataType = permission.PermissionRuleData PermissionRuleDataResourceType = permission.PermissionRuleDataResource PersonType = person.Person PersonCommunicationType = person.PersonCommunication PersonLinkType = person.PersonLink PlanDefinitionType = plandefinition.PlanDefinition PlanDefinitionActionType = plandefinition.PlanDefinitionAction PlanDefinitionActionConditionType = plandefinition.PlanDefinitionActionCondition PlanDefinitionActionDynamicValueType = ( plandefinition.PlanDefinitionActionDynamicValue ) PlanDefinitionActionInputType = plandefinition.PlanDefinitionActionInput PlanDefinitionActionOutputType = plandefinition.PlanDefinitionActionOutput PlanDefinitionActionParticipantType = plandefinition.PlanDefinitionActionParticipant PlanDefinitionActionRelatedActionType = ( plandefinition.PlanDefinitionActionRelatedAction ) PlanDefinitionActorType = plandefinition.PlanDefinitionActor PlanDefinitionActorOptionType = plandefinition.PlanDefinitionActorOption PlanDefinitionGoalType = plandefinition.PlanDefinitionGoal PlanDefinitionGoalTargetType = plandefinition.PlanDefinitionGoalTarget PractitionerType = practitioner.Practitioner PractitionerCommunicationType = practitioner.PractitionerCommunication PractitionerQualificationType = practitioner.PractitionerQualification PractitionerRoleType = practitionerrole.PractitionerRole PrimitiveTypeType = primitivetype.PrimitiveType ProcedureType = procedure.Procedure ProcedureFocalDeviceType = procedure.ProcedureFocalDevice ProcedurePerformerType = procedure.ProcedurePerformer ProductShelfLifeType = productshelflife.ProductShelfLife ProvenanceType = provenance.Provenance ProvenanceAgentType = provenance.ProvenanceAgent ProvenanceEntityType = provenance.ProvenanceEntity QuantityType = quantity.Quantity QuestionnaireType = questionnaire.Questionnaire QuestionnaireItemType = questionnaire.QuestionnaireItem QuestionnaireItemAnswerOptionType = questionnaire.QuestionnaireItemAnswerOption QuestionnaireItemEnableWhenType = questionnaire.QuestionnaireItemEnableWhen QuestionnaireItemInitialType = questionnaire.QuestionnaireItemInitial QuestionnaireResponseType = questionnaireresponse.QuestionnaireResponse QuestionnaireResponseItemType = questionnaireresponse.QuestionnaireResponseItem QuestionnaireResponseItemAnswerType = ( questionnaireresponse.QuestionnaireResponseItemAnswer ) RangeType = range.Range RatioType = ratio.Ratio RatioRangeType = ratiorange.RatioRange ReferenceType = reference.Reference RegulatedAuthorizationType = regulatedauthorization.RegulatedAuthorization RegulatedAuthorizationCaseType = regulatedauthorization.RegulatedAuthorizationCase RelatedArtifactType = relatedartifact.RelatedArtifact RelatedPersonType = relatedperson.RelatedPerson RelatedPersonCommunicationType = relatedperson.RelatedPersonCommunication RequestOrchestrationType = requestorchestration.RequestOrchestration RequestOrchestrationActionType = requestorchestration.RequestOrchestrationAction RequestOrchestrationActionConditionType = ( requestorchestration.RequestOrchestrationActionCondition ) RequestOrchestrationActionDynamicValueType = ( requestorchestration.RequestOrchestrationActionDynamicValue ) RequestOrchestrationActionInputType = ( requestorchestration.RequestOrchestrationActionInput ) RequestOrchestrationActionOutputType = ( requestorchestration.RequestOrchestrationActionOutput ) RequestOrchestrationActionParticipantType = ( requestorchestration.RequestOrchestrationActionParticipant ) RequestOrchestrationActionRelatedActionType = ( requestorchestration.RequestOrchestrationActionRelatedAction ) RequirementsType = requirements.Requirements RequirementsStatementType = requirements.RequirementsStatement ResearchStudyType = researchstudy.ResearchStudy ResearchStudyAssociatedPartyType = researchstudy.ResearchStudyAssociatedParty ResearchStudyComparisonGroupType = researchstudy.ResearchStudyComparisonGroup ResearchStudyLabelType = researchstudy.ResearchStudyLabel ResearchStudyObjectiveType = researchstudy.ResearchStudyObjective ResearchStudyOutcomeMeasureType = researchstudy.ResearchStudyOutcomeMeasure ResearchStudyProgressStatusType = researchstudy.ResearchStudyProgressStatus ResearchStudyRecruitmentType = researchstudy.ResearchStudyRecruitment ResearchSubjectType = researchsubject.ResearchSubject ResearchSubjectProgressType = researchsubject.ResearchSubjectProgress ResourceType = resource.Resource RiskAssessmentType = riskassessment.RiskAssessment RiskAssessmentPredictionType = riskassessment.RiskAssessmentPrediction SampledDataType = sampleddata.SampledData ScheduleType = schedule.Schedule SearchParameterType = searchparameter.SearchParameter SearchParameterComponentType = searchparameter.SearchParameterComponent ServiceRequestType = servicerequest.ServiceRequest ServiceRequestOrderDetailType = servicerequest.ServiceRequestOrderDetail ServiceRequestOrderDetailParameterType = ( servicerequest.ServiceRequestOrderDetailParameter ) ServiceRequestPatientInstructionType = ( servicerequest.ServiceRequestPatientInstruction ) SignatureType = signature.Signature SlotType = slot.Slot SpecimenType = specimen.Specimen SpecimenCollectionType = specimen.SpecimenCollection SpecimenContainerType = specimen.SpecimenContainer SpecimenDefinitionType = specimendefinition.SpecimenDefinition SpecimenDefinitionTypeTestedType = specimendefinition.SpecimenDefinitionTypeTested SpecimenDefinitionTypeTestedContainerType = ( specimendefinition.SpecimenDefinitionTypeTestedContainer ) SpecimenDefinitionTypeTestedContainerAdditiveType = ( specimendefinition.SpecimenDefinitionTypeTestedContainerAdditive ) SpecimenDefinitionTypeTestedHandlingType = ( specimendefinition.SpecimenDefinitionTypeTestedHandling ) SpecimenFeatureType = specimen.SpecimenFeature SpecimenProcessingType = specimen.SpecimenProcessing StructureDefinitionType = structuredefinition.StructureDefinition StructureDefinitionContextType = structuredefinition.StructureDefinitionContext StructureDefinitionDifferentialType = ( structuredefinition.StructureDefinitionDifferential ) StructureDefinitionMappingType = structuredefinition.StructureDefinitionMapping StructureDefinitionSnapshotType = structuredefinition.StructureDefinitionSnapshot StructureMapType = structuremap.StructureMap StructureMapConstType = structuremap.StructureMapConst StructureMapGroupType = structuremap.StructureMapGroup StructureMapGroupInputType = structuremap.StructureMapGroupInput StructureMapGroupRuleType = structuremap.StructureMapGroupRule StructureMapGroupRuleDependentType = structuremap.StructureMapGroupRuleDependent StructureMapGroupRuleSourceType = structuremap.StructureMapGroupRuleSource StructureMapGroupRuleTargetType = structuremap.StructureMapGroupRuleTarget StructureMapGroupRuleTargetParameterType = ( structuremap.StructureMapGroupRuleTargetParameter ) StructureMapStructureType = structuremap.StructureMapStructure SubscriptionType = subscription.Subscription SubscriptionFilterByType = subscription.SubscriptionFilterBy SubscriptionParameterType = subscription.SubscriptionParameter SubscriptionStatusType = subscriptionstatus.SubscriptionStatus SubscriptionStatusNotificationEventType = ( subscriptionstatus.SubscriptionStatusNotificationEvent ) SubscriptionTopicType = subscriptiontopic.SubscriptionTopic SubscriptionTopicCanFilterByType = subscriptiontopic.SubscriptionTopicCanFilterBy SubscriptionTopicEventTriggerType = subscriptiontopic.SubscriptionTopicEventTrigger SubscriptionTopicNotificationShapeType = ( subscriptiontopic.SubscriptionTopicNotificationShape ) SubscriptionTopicResourceTriggerType = ( subscriptiontopic.SubscriptionTopicResourceTrigger ) SubscriptionTopicResourceTriggerQueryCriteriaType = ( subscriptiontopic.SubscriptionTopicResourceTriggerQueryCriteria ) SubstanceType = substance.Substance SubstanceDefinitionType = substancedefinition.SubstanceDefinition SubstanceDefinitionCharacterizationType = ( substancedefinition.SubstanceDefinitionCharacterization ) SubstanceDefinitionCodeType = substancedefinition.SubstanceDefinitionCode SubstanceDefinitionMoietyType = substancedefinition.SubstanceDefinitionMoiety SubstanceDefinitionMolecularWeightType = ( substancedefinition.SubstanceDefinitionMolecularWeight ) SubstanceDefinitionNameType = substancedefinition.SubstanceDefinitionName SubstanceDefinitionNameOfficialType = ( substancedefinition.SubstanceDefinitionNameOfficial ) SubstanceDefinitionPropertyType = substancedefinition.SubstanceDefinitionProperty SubstanceDefinitionRelationshipType = ( substancedefinition.SubstanceDefinitionRelationship ) SubstanceDefinitionSourceMaterialType = ( substancedefinition.SubstanceDefinitionSourceMaterial ) SubstanceDefinitionStructureType = substancedefinition.SubstanceDefinitionStructure SubstanceDefinitionStructureRepresentationType = ( substancedefinition.SubstanceDefinitionStructureRepresentation ) SubstanceIngredientType = substance.SubstanceIngredient SubstanceNucleicAcidType = substancenucleicacid.SubstanceNucleicAcid SubstanceNucleicAcidSubunitType = substancenucleicacid.SubstanceNucleicAcidSubunit SubstanceNucleicAcidSubunitLinkageType = ( substancenucleicacid.SubstanceNucleicAcidSubunitLinkage ) SubstanceNucleicAcidSubunitSugarType = ( substancenucleicacid.SubstanceNucleicAcidSubunitSugar ) SubstancePolymerType = substancepolymer.SubstancePolymer SubstancePolymerMonomerSetType = substancepolymer.SubstancePolymerMonomerSet SubstancePolymerMonomerSetStartingMaterialType = ( substancepolymer.SubstancePolymerMonomerSetStartingMaterial ) SubstancePolymerRepeatType = substancepolymer.SubstancePolymerRepeat SubstancePolymerRepeatRepeatUnitType = ( substancepolymer.SubstancePolymerRepeatRepeatUnit ) SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationType = ( substancepolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisation ) SubstancePolymerRepeatRepeatUnitStructuralRepresentationType = ( substancepolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentation ) SubstanceProteinType = substanceprotein.SubstanceProtein SubstanceProteinSubunitType = substanceprotein.SubstanceProteinSubunit SubstanceReferenceInformationType = ( substancereferenceinformation.SubstanceReferenceInformation ) SubstanceReferenceInformationGeneType = ( substancereferenceinformation.SubstanceReferenceInformationGene ) SubstanceReferenceInformationGeneElementType = ( substancereferenceinformation.SubstanceReferenceInformationGeneElement ) SubstanceReferenceInformationTargetType = ( substancereferenceinformation.SubstanceReferenceInformationTarget ) SubstanceSourceMaterialType = substancesourcematerial.SubstanceSourceMaterial SubstanceSourceMaterialFractionDescriptionType = ( substancesourcematerial.SubstanceSourceMaterialFractionDescription ) SubstanceSourceMaterialOrganismType = ( substancesourcematerial.SubstanceSourceMaterialOrganism ) SubstanceSourceMaterialOrganismAuthorType = ( substancesourcematerial.SubstanceSourceMaterialOrganismAuthor ) SubstanceSourceMaterialOrganismHybridType = ( substancesourcematerial.SubstanceSourceMaterialOrganismHybrid ) SubstanceSourceMaterialOrganismOrganismGeneralType = ( substancesourcematerial.SubstanceSourceMaterialOrganismOrganismGeneral ) SubstanceSourceMaterialPartDescriptionType = ( substancesourcematerial.SubstanceSourceMaterialPartDescription ) SupplyDeliveryType = supplydelivery.SupplyDelivery SupplyDeliverySuppliedItemType = supplydelivery.SupplyDeliverySuppliedItem SupplyRequestType = supplyrequest.SupplyRequest SupplyRequestParameterType = supplyrequest.SupplyRequestParameter TaskType = task.Task TaskInputType = task.TaskInput TaskOutputType = task.TaskOutput TaskPerformerType = task.TaskPerformer TaskRestrictionType = task.TaskRestriction TerminologyCapabilitiesType = terminologycapabilities.TerminologyCapabilities TerminologyCapabilitiesClosureType = ( terminologycapabilities.TerminologyCapabilitiesClosure ) TerminologyCapabilitiesCodeSystemType = ( terminologycapabilities.TerminologyCapabilitiesCodeSystem ) TerminologyCapabilitiesCodeSystemVersionType = ( terminologycapabilities.TerminologyCapabilitiesCodeSystemVersion ) TerminologyCapabilitiesCodeSystemVersionFilterType = ( terminologycapabilities.TerminologyCapabilitiesCodeSystemVersionFilter ) TerminologyCapabilitiesExpansionType = ( terminologycapabilities.TerminologyCapabilitiesExpansion ) TerminologyCapabilitiesExpansionParameterType = ( terminologycapabilities.TerminologyCapabilitiesExpansionParameter ) TerminologyCapabilitiesImplementationType = ( terminologycapabilities.TerminologyCapabilitiesImplementation ) TerminologyCapabilitiesSoftwareType = ( terminologycapabilities.TerminologyCapabilitiesSoftware ) TerminologyCapabilitiesTranslationType = ( terminologycapabilities.TerminologyCapabilitiesTranslation ) TerminologyCapabilitiesValidateCodeType = ( terminologycapabilities.TerminologyCapabilitiesValidateCode ) TestPlanType = testplan.TestPlan TestPlanDependencyType = testplan.TestPlanDependency TestPlanTestCaseType = testplan.TestPlanTestCase TestPlanTestCaseAssertionType = testplan.TestPlanTestCaseAssertion TestPlanTestCaseDependencyType = testplan.TestPlanTestCaseDependency TestPlanTestCaseTestDataType = testplan.TestPlanTestCaseTestData TestPlanTestCaseTestRunType = testplan.TestPlanTestCaseTestRun TestPlanTestCaseTestRunScriptType = testplan.TestPlanTestCaseTestRunScript TestReportType = testreport.TestReport TestReportParticipantType = testreport.TestReportParticipant TestReportSetupType = testreport.TestReportSetup TestReportSetupActionType = testreport.TestReportSetupAction TestReportSetupActionAssertType = testreport.TestReportSetupActionAssert TestReportSetupActionAssertRequirementType = ( testreport.TestReportSetupActionAssertRequirement ) TestReportSetupActionOperationType = testreport.TestReportSetupActionOperation TestReportTeardownType = testreport.TestReportTeardown TestReportTeardownActionType = testreport.TestReportTeardownAction TestReportTestType = testreport.TestReportTest TestReportTestActionType = testreport.TestReportTestAction TestScriptType = testscript.TestScript TestScriptDestinationType = testscript.TestScriptDestination TestScriptFixtureType = testscript.TestScriptFixture TestScriptMetadataType = testscript.TestScriptMetadata TestScriptMetadataCapabilityType = testscript.TestScriptMetadataCapability TestScriptMetadataLinkType = testscript.TestScriptMetadataLink TestScriptOriginType = testscript.TestScriptOrigin TestScriptScopeType = testscript.TestScriptScope TestScriptSetupType = testscript.TestScriptSetup TestScriptSetupActionType = testscript.TestScriptSetupAction TestScriptSetupActionAssertType = testscript.TestScriptSetupActionAssert TestScriptSetupActionAssertRequirementType = ( testscript.TestScriptSetupActionAssertRequirement ) TestScriptSetupActionOperationType = testscript.TestScriptSetupActionOperation TestScriptSetupActionOperationRequestHeaderType = ( testscript.TestScriptSetupActionOperationRequestHeader ) TestScriptTeardownType = testscript.TestScriptTeardown TestScriptTeardownActionType = testscript.TestScriptTeardownAction TestScriptTestType = testscript.TestScriptTest TestScriptTestActionType = testscript.TestScriptTestAction TestScriptVariableType = testscript.TestScriptVariable TimingType = timing.Timing TimingRepeatType = timing.TimingRepeat TransportType = transport.Transport TransportInputType = transport.TransportInput TransportOutputType = transport.TransportOutput TransportRestrictionType = transport.TransportRestriction TriggerDefinitionType = triggerdefinition.TriggerDefinition UsageContextType = usagecontext.UsageContext ValueSetType = valueset.ValueSet ValueSetComposeType = valueset.ValueSetCompose ValueSetComposeIncludeType = valueset.ValueSetComposeInclude ValueSetComposeIncludeConceptType = valueset.ValueSetComposeIncludeConcept ValueSetComposeIncludeConceptDesignationType = ( valueset.ValueSetComposeIncludeConceptDesignation ) ValueSetComposeIncludeFilterType = valueset.ValueSetComposeIncludeFilter ValueSetExpansionType = valueset.ValueSetExpansion ValueSetExpansionContainsType = valueset.ValueSetExpansionContains ValueSetExpansionContainsPropertyType = valueset.ValueSetExpansionContainsProperty ValueSetExpansionContainsPropertySubPropertyType = ( valueset.ValueSetExpansionContainsPropertySubProperty ) ValueSetExpansionParameterType = valueset.ValueSetExpansionParameter ValueSetExpansionPropertyType = valueset.ValueSetExpansionProperty ValueSetScopeType = valueset.ValueSetScope VerificationResultType = verificationresult.VerificationResult VerificationResultAttestationType = verificationresult.VerificationResultAttestation VerificationResultPrimarySourceType = ( verificationresult.VerificationResultPrimarySource ) VerificationResultValidatorType = verificationresult.VerificationResultValidator VirtualServiceDetailType = virtualservicedetail.VirtualServiceDetail VisionPrescriptionType = visionprescription.VisionPrescription VisionPrescriptionLensSpecificationType = ( visionprescription.VisionPrescriptionLensSpecification ) VisionPrescriptionLensSpecificationPrismType = ( visionprescription.VisionPrescriptionLensSpecificationPrism ) else: FHIRPrimitiveExtensionType = create_fhir_type( "FHIRPrimitiveExtensionType", "fhir.resources.fhirprimitiveextension.FHIRPrimitiveExtension", ) ElementType = create_fhir_element_or_resource_type( "ElementType", "fhir.resources.element.Element" ) ResourceType = create_fhir_element_or_resource_type( "ResourceType", "fhir.resources.resource.Resource" ) AccountType = create_fhir_type("AccountType", "fhir.resources.account.Account") AccountBalanceType = create_fhir_type( "AccountBalanceType", "fhir.resources.account.AccountBalance" ) AccountCoverageType = create_fhir_type( "AccountCoverageType", "fhir.resources.account.AccountCoverage" ) AccountDiagnosisType = create_fhir_type( "AccountDiagnosisType", "fhir.resources.account.AccountDiagnosis" ) AccountGuarantorType = create_fhir_type( "AccountGuarantorType", "fhir.resources.account.AccountGuarantor" ) AccountProcedureType = create_fhir_type( "AccountProcedureType", "fhir.resources.account.AccountProcedure" ) AccountRelatedAccountType = create_fhir_type( "AccountRelatedAccountType", "fhir.resources.account.AccountRelatedAccount" ) ActivityDefinitionType = create_fhir_type( "ActivityDefinitionType", "fhir.resources.activitydefinition.ActivityDefinition" ) ActivityDefinitionDynamicValueType = create_fhir_type( "ActivityDefinitionDynamicValueType", "fhir.resources.activitydefinition.ActivityDefinitionDynamicValue", ) ActivityDefinitionParticipantType = create_fhir_type( "ActivityDefinitionParticipantType", "fhir.resources.activitydefinition.ActivityDefinitionParticipant", ) ActorDefinitionType = create_fhir_type( "ActorDefinitionType", "fhir.resources.actordefinition.ActorDefinition" ) AddressType = create_fhir_type("AddressType", "fhir.resources.address.Address") AdministrableProductDefinitionType = create_fhir_type( "AdministrableProductDefinitionType", "fhir.resources.administrableproductdefinition.AdministrableProductDefinition", ) AdministrableProductDefinitionPropertyType = create_fhir_type( "AdministrableProductDefinitionPropertyType", "fhir.resources.administrableproductdefinition.AdministrableProductDefinitionProperty", ) AdministrableProductDefinitionRouteOfAdministrationType = create_fhir_type( "AdministrableProductDefinitionRouteOfAdministrationType", "fhir.resources.administrableproductdefinition.AdministrableProductDefinitionRouteOfAdministration", ) AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesType = create_fhir_type( "AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesType", "fhir.resources.administrableproductdefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpecies", ) AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodType = create_fhir_type( "AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodType", "fhir.resources.administrableproductdefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriod", ) AdverseEventType = create_fhir_type( "AdverseEventType", "fhir.resources.adverseevent.AdverseEvent" ) AdverseEventContributingFactorType = create_fhir_type( "AdverseEventContributingFactorType", "fhir.resources.adverseevent.AdverseEventContributingFactor", ) AdverseEventMitigatingActionType = create_fhir_type( "AdverseEventMitigatingActionType", "fhir.resources.adverseevent.AdverseEventMitigatingAction", ) AdverseEventParticipantType = create_fhir_type( "AdverseEventParticipantType", "fhir.resources.adverseevent.AdverseEventParticipant", ) AdverseEventPreventiveActionType = create_fhir_type( "AdverseEventPreventiveActionType", "fhir.resources.adverseevent.AdverseEventPreventiveAction", ) AdverseEventSupportingInfoType = create_fhir_type( "AdverseEventSupportingInfoType", "fhir.resources.adverseevent.AdverseEventSupportingInfo", ) AdverseEventSuspectEntityType = create_fhir_type( "AdverseEventSuspectEntityType", "fhir.resources.adverseevent.AdverseEventSuspectEntity", ) AdverseEventSuspectEntityCausalityType = create_fhir_type( "AdverseEventSuspectEntityCausalityType", "fhir.resources.adverseevent.AdverseEventSuspectEntityCausality", ) AgeType = create_fhir_type("AgeType", "fhir.resources.age.Age") AllergyIntoleranceType = create_fhir_type( "AllergyIntoleranceType", "fhir.resources.allergyintolerance.AllergyIntolerance" ) AllergyIntoleranceParticipantType = create_fhir_type( "AllergyIntoleranceParticipantType", "fhir.resources.allergyintolerance.AllergyIntoleranceParticipant", ) AllergyIntoleranceReactionType = create_fhir_type( "AllergyIntoleranceReactionType", "fhir.resources.allergyintolerance.AllergyIntoleranceReaction", ) AnnotationType = create_fhir_type( "AnnotationType", "fhir.resources.annotation.Annotation" ) AppointmentType = create_fhir_type( "AppointmentType", "fhir.resources.appointment.Appointment" ) AppointmentParticipantType = create_fhir_type( "AppointmentParticipantType", "fhir.resources.appointment.AppointmentParticipant", ) AppointmentRecurrenceTemplateType = create_fhir_type( "AppointmentRecurrenceTemplateType", "fhir.resources.appointment.AppointmentRecurrenceTemplate", ) AppointmentRecurrenceTemplateMonthlyTemplateType = create_fhir_type( "AppointmentRecurrenceTemplateMonthlyTemplateType", "fhir.resources.appointment.AppointmentRecurrenceTemplateMonthlyTemplate", ) AppointmentRecurrenceTemplateWeeklyTemplateType = create_fhir_type( "AppointmentRecurrenceTemplateWeeklyTemplateType", "fhir.resources.appointment.AppointmentRecurrenceTemplateWeeklyTemplate", ) AppointmentRecurrenceTemplateYearlyTemplateType = create_fhir_type( "AppointmentRecurrenceTemplateYearlyTemplateType", "fhir.resources.appointment.AppointmentRecurrenceTemplateYearlyTemplate", ) AppointmentResponseType = create_fhir_type( "AppointmentResponseType", "fhir.resources.appointmentresponse.AppointmentResponse", ) ArtifactAssessmentType = create_fhir_type( "ArtifactAssessmentType", "fhir.resources.artifactassessment.ArtifactAssessment" ) ArtifactAssessmentContentType = create_fhir_type( "ArtifactAssessmentContentType", "fhir.resources.artifactassessment.ArtifactAssessmentContent", ) AttachmentType = create_fhir_type( "AttachmentType", "fhir.resources.attachment.Attachment" ) AuditEventType = create_fhir_type( "AuditEventType", "fhir.resources.auditevent.AuditEvent" ) AuditEventAgentType = create_fhir_type( "AuditEventAgentType", "fhir.resources.auditevent.AuditEventAgent" ) AuditEventEntityType = create_fhir_type( "AuditEventEntityType", "fhir.resources.auditevent.AuditEventEntity" ) AuditEventEntityDetailType = create_fhir_type( "AuditEventEntityDetailType", "fhir.resources.auditevent.AuditEventEntityDetail" ) AuditEventOutcomeType = create_fhir_type( "AuditEventOutcomeType", "fhir.resources.auditevent.AuditEventOutcome" ) AuditEventSourceType = create_fhir_type( "AuditEventSourceType", "fhir.resources.auditevent.AuditEventSource" ) AvailabilityType = create_fhir_type( "AvailabilityType", "fhir.resources.availability.Availability" ) AvailabilityAvailableTimeType = create_fhir_type( "AvailabilityAvailableTimeType", "fhir.resources.availability.AvailabilityAvailableTime", ) AvailabilityNotAvailableTimeType = create_fhir_type( "AvailabilityNotAvailableTimeType", "fhir.resources.availability.AvailabilityNotAvailableTime", ) BackboneElementType = create_fhir_type( "BackboneElementType", "fhir.resources.backboneelement.BackboneElement" ) BackboneTypeType = create_fhir_type( "BackboneTypeType", "fhir.resources.backbonetype.BackboneType" ) BaseType = create_fhir_type("BaseType", "fhir.resources.base.Base") BasicType = create_fhir_type("BasicType", "fhir.resources.basic.Basic") BinaryType = create_fhir_type("BinaryType", "fhir.resources.binary.Binary") BiologicallyDerivedProductType = create_fhir_type( "BiologicallyDerivedProductType", "fhir.resources.biologicallyderivedproduct.BiologicallyDerivedProduct", ) BiologicallyDerivedProductCollectionType = create_fhir_type( "BiologicallyDerivedProductCollectionType", "fhir.resources.biologicallyderivedproduct.BiologicallyDerivedProductCollection", ) BiologicallyDerivedProductDispenseType = create_fhir_type( "BiologicallyDerivedProductDispenseType", "fhir.resources.biologicallyderivedproductdispense.BiologicallyDerivedProductDispense", ) BiologicallyDerivedProductDispensePerformerType = create_fhir_type( "BiologicallyDerivedProductDispensePerformerType", "fhir.resources.biologicallyderivedproductdispense.BiologicallyDerivedProductDispensePerformer", ) BiologicallyDerivedProductPropertyType = create_fhir_type( "BiologicallyDerivedProductPropertyType", "fhir.resources.biologicallyderivedproduct.BiologicallyDerivedProductProperty", ) BodyStructureType = create_fhir_type( "BodyStructureType", "fhir.resources.bodystructure.BodyStructure" ) BodyStructureIncludedStructureType = create_fhir_type( "BodyStructureIncludedStructureType", "fhir.resources.bodystructure.BodyStructureIncludedStructure", ) BodyStructureIncludedStructureBodyLandmarkOrientationType = create_fhir_type( "BodyStructureIncludedStructureBodyLandmarkOrientationType", "fhir.resources.bodystructure.BodyStructureIncludedStructureBodyLandmarkOrientation", ) BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmarkType = create_fhir_type( "BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmarkType", "fhir.resources.bodystructure.BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmark", ) BundleType = create_fhir_type("BundleType", "fhir.resources.bundle.Bundle") BundleEntryType = create_fhir_type( "BundleEntryType", "fhir.resources.bundle.BundleEntry" ) BundleEntryRequestType = create_fhir_type( "BundleEntryRequestType", "fhir.resources.bundle.BundleEntryRequest" ) BundleEntryResponseType = create_fhir_type( "BundleEntryResponseType", "fhir.resources.bundle.BundleEntryResponse" ) BundleEntrySearchType = create_fhir_type( "BundleEntrySearchType", "fhir.resources.bundle.BundleEntrySearch" ) BundleLinkType = create_fhir_type( "BundleLinkType", "fhir.resources.bundle.BundleLink" ) CanonicalResourceType = create_fhir_type( "CanonicalResourceType", "fhir.resources.canonicalresource.CanonicalResource" ) CapabilityStatementType = create_fhir_type( "CapabilityStatementType", "fhir.resources.capabilitystatement.CapabilityStatement", ) CapabilityStatementDocumentType = create_fhir_type( "CapabilityStatementDocumentType", "fhir.resources.capabilitystatement.CapabilityStatementDocument", ) CapabilityStatementImplementationType = create_fhir_type( "CapabilityStatementImplementationType", "fhir.resources.capabilitystatement.CapabilityStatementImplementation", ) CapabilityStatementMessagingType = create_fhir_type( "CapabilityStatementMessagingType", "fhir.resources.capabilitystatement.CapabilityStatementMessaging", ) CapabilityStatementMessagingEndpointType = create_fhir_type( "CapabilityStatementMessagingEndpointType", "fhir.resources.capabilitystatement.CapabilityStatementMessagingEndpoint", ) CapabilityStatementMessagingSupportedMessageType = create_fhir_type( "CapabilityStatementMessagingSupportedMessageType", "fhir.resources.capabilitystatement.CapabilityStatementMessagingSupportedMessage", ) CapabilityStatementRestType = create_fhir_type( "CapabilityStatementRestType", "fhir.resources.capabilitystatement.CapabilityStatementRest", ) CapabilityStatementRestInteractionType = create_fhir_type( "CapabilityStatementRestInteractionType", "fhir.resources.capabilitystatement.CapabilityStatementRestInteraction", ) CapabilityStatementRestResourceType = create_fhir_type( "CapabilityStatementRestResourceType", "fhir.resources.capabilitystatement.CapabilityStatementRestResource", ) CapabilityStatementRestResourceInteractionType = create_fhir_type( "CapabilityStatementRestResourceInteractionType", "fhir.resources.capabilitystatement.CapabilityStatementRestResourceInteraction", ) CapabilityStatementRestResourceOperationType = create_fhir_type( "CapabilityStatementRestResourceOperationType", "fhir.resources.capabilitystatement.CapabilityStatementRestResourceOperation", ) CapabilityStatementRestResourceSearchParamType = create_fhir_type( "CapabilityStatementRestResourceSearchParamType", "fhir.resources.capabilitystatement.CapabilityStatementRestResourceSearchParam", ) CapabilityStatementRestSecurityType = create_fhir_type( "CapabilityStatementRestSecurityType", "fhir.resources.capabilitystatement.CapabilityStatementRestSecurity", ) CapabilityStatementSoftwareType = create_fhir_type( "CapabilityStatementSoftwareType", "fhir.resources.capabilitystatement.CapabilityStatementSoftware", ) CarePlanType = create_fhir_type("CarePlanType", "fhir.resources.careplan.CarePlan") CarePlanActivityType = create_fhir_type( "CarePlanActivityType", "fhir.resources.careplan.CarePlanActivity" ) CareTeamType = create_fhir_type("CareTeamType", "fhir.resources.careteam.CareTeam") CareTeamParticipantType = create_fhir_type( "CareTeamParticipantType", "fhir.resources.careteam.CareTeamParticipant" ) ChargeItemType = create_fhir_type( "ChargeItemType", "fhir.resources.chargeitem.ChargeItem" ) ChargeItemDefinitionType = create_fhir_type( "ChargeItemDefinitionType", "fhir.resources.chargeitemdefinition.ChargeItemDefinition", ) ChargeItemDefinitionApplicabilityType = create_fhir_type( "ChargeItemDefinitionApplicabilityType", "fhir.resources.chargeitemdefinition.ChargeItemDefinitionApplicability", ) ChargeItemDefinitionPropertyGroupType = create_fhir_type( "ChargeItemDefinitionPropertyGroupType", "fhir.resources.chargeitemdefinition.ChargeItemDefinitionPropertyGroup", ) ChargeItemPerformerType = create_fhir_type( "ChargeItemPerformerType", "fhir.resources.chargeitem.ChargeItemPerformer" ) CitationType = create_fhir_type("CitationType", "fhir.resources.citation.Citation") CitationCitedArtifactType = create_fhir_type( "CitationCitedArtifactType", "fhir.resources.citation.CitationCitedArtifact" ) CitationCitedArtifactAbstractType = create_fhir_type( "CitationCitedArtifactAbstractType", "fhir.resources.citation.CitationCitedArtifactAbstract", ) CitationCitedArtifactClassificationType = create_fhir_type( "CitationCitedArtifactClassificationType", "fhir.resources.citation.CitationCitedArtifactClassification", ) CitationCitedArtifactContributorshipType = create_fhir_type( "CitationCitedArtifactContributorshipType", "fhir.resources.citation.CitationCitedArtifactContributorship", ) CitationCitedArtifactContributorshipEntryType = create_fhir_type( "CitationCitedArtifactContributorshipEntryType", "fhir.resources.citation.CitationCitedArtifactContributorshipEntry", ) CitationCitedArtifactContributorshipEntryContributionInstanceType = create_fhir_type( "CitationCitedArtifactContributorshipEntryContributionInstanceType", "fhir.resources.citation.CitationCitedArtifactContributorshipEntryContributionInstance", ) CitationCitedArtifactContributorshipSummaryType = create_fhir_type( "CitationCitedArtifactContributorshipSummaryType", "fhir.resources.citation.CitationCitedArtifactContributorshipSummary", ) CitationCitedArtifactPartType = create_fhir_type( "CitationCitedArtifactPartType", "fhir.resources.citation.CitationCitedArtifactPart", ) CitationCitedArtifactPublicationFormType = create_fhir_type( "CitationCitedArtifactPublicationFormType", "fhir.resources.citation.CitationCitedArtifactPublicationForm", ) CitationCitedArtifactPublicationFormPublishedInType = create_fhir_type( "CitationCitedArtifactPublicationFormPublishedInType", "fhir.resources.citation.CitationCitedArtifactPublicationFormPublishedIn", ) CitationCitedArtifactRelatesToType = create_fhir_type( "CitationCitedArtifactRelatesToType", "fhir.resources.citation.CitationCitedArtifactRelatesTo", ) CitationCitedArtifactStatusDateType = create_fhir_type( "CitationCitedArtifactStatusDateType", "fhir.resources.citation.CitationCitedArtifactStatusDate", ) CitationCitedArtifactTitleType = create_fhir_type( "CitationCitedArtifactTitleType", "fhir.resources.citation.CitationCitedArtifactTitle", ) CitationCitedArtifactVersionType = create_fhir_type( "CitationCitedArtifactVersionType", "fhir.resources.citation.CitationCitedArtifactVersion", ) CitationCitedArtifactWebLocationType = create_fhir_type( "CitationCitedArtifactWebLocationType", "fhir.resources.citation.CitationCitedArtifactWebLocation", ) CitationClassificationType = create_fhir_type( "CitationClassificationType", "fhir.resources.citation.CitationClassification" ) CitationStatusDateType = create_fhir_type( "CitationStatusDateType", "fhir.resources.citation.CitationStatusDate" ) CitationSummaryType = create_fhir_type( "CitationSummaryType", "fhir.resources.citation.CitationSummary" ) ClaimType = create_fhir_type("ClaimType", "fhir.resources.claim.Claim") ClaimAccidentType = create_fhir_type( "ClaimAccidentType", "fhir.resources.claim.ClaimAccident" ) ClaimCareTeamType = create_fhir_type( "ClaimCareTeamType", "fhir.resources.claim.ClaimCareTeam" ) ClaimDiagnosisType = create_fhir_type( "ClaimDiagnosisType", "fhir.resources.claim.ClaimDiagnosis" ) ClaimEventType = create_fhir_type( "ClaimEventType", "fhir.resources.claim.ClaimEvent" ) ClaimInsuranceType = create_fhir_type( "ClaimInsuranceType", "fhir.resources.claim.ClaimInsurance" ) ClaimItemType = create_fhir_type("ClaimItemType", "fhir.resources.claim.ClaimItem") ClaimItemBodySiteType = create_fhir_type( "ClaimItemBodySiteType", "fhir.resources.claim.ClaimItemBodySite" ) ClaimItemDetailType = create_fhir_type( "ClaimItemDetailType", "fhir.resources.claim.ClaimItemDetail" ) ClaimItemDetailSubDetailType = create_fhir_type( "ClaimItemDetailSubDetailType", "fhir.resources.claim.ClaimItemDetailSubDetail" ) ClaimPayeeType = create_fhir_type( "ClaimPayeeType", "fhir.resources.claim.ClaimPayee" ) ClaimProcedureType = create_fhir_type( "ClaimProcedureType", "fhir.resources.claim.ClaimProcedure" ) ClaimRelatedType = create_fhir_type( "ClaimRelatedType", "fhir.resources.claim.ClaimRelated" ) ClaimResponseType = create_fhir_type( "ClaimResponseType", "fhir.resources.claimresponse.ClaimResponse" ) ClaimResponseAddItemType = create_fhir_type( "ClaimResponseAddItemType", "fhir.resources.claimresponse.ClaimResponseAddItem" ) ClaimResponseAddItemBodySiteType = create_fhir_type( "ClaimResponseAddItemBodySiteType", "fhir.resources.claimresponse.ClaimResponseAddItemBodySite", ) ClaimResponseAddItemDetailType = create_fhir_type( "ClaimResponseAddItemDetailType", "fhir.resources.claimresponse.ClaimResponseAddItemDetail", ) ClaimResponseAddItemDetailSubDetailType = create_fhir_type( "ClaimResponseAddItemDetailSubDetailType", "fhir.resources.claimresponse.ClaimResponseAddItemDetailSubDetail", ) ClaimResponseErrorType = create_fhir_type( "ClaimResponseErrorType", "fhir.resources.claimresponse.ClaimResponseError" ) ClaimResponseEventType = create_fhir_type( "ClaimResponseEventType", "fhir.resources.claimresponse.ClaimResponseEvent" ) ClaimResponseInsuranceType = create_fhir_type( "ClaimResponseInsuranceType", "fhir.resources.claimresponse.ClaimResponseInsurance", ) ClaimResponseItemType = create_fhir_type( "ClaimResponseItemType", "fhir.resources.claimresponse.ClaimResponseItem" ) ClaimResponseItemAdjudicationType = create_fhir_type( "ClaimResponseItemAdjudicationType", "fhir.resources.claimresponse.ClaimResponseItemAdjudication", ) ClaimResponseItemDetailType = create_fhir_type( "ClaimResponseItemDetailType", "fhir.resources.claimresponse.ClaimResponseItemDetail", ) ClaimResponseItemDetailSubDetailType = create_fhir_type( "ClaimResponseItemDetailSubDetailType", "fhir.resources.claimresponse.ClaimResponseItemDetailSubDetail", ) ClaimResponseItemReviewOutcomeType = create_fhir_type( "ClaimResponseItemReviewOutcomeType", "fhir.resources.claimresponse.ClaimResponseItemReviewOutcome", ) ClaimResponsePaymentType = create_fhir_type( "ClaimResponsePaymentType", "fhir.resources.claimresponse.ClaimResponsePayment" ) ClaimResponseProcessNoteType = create_fhir_type( "ClaimResponseProcessNoteType", "fhir.resources.claimresponse.ClaimResponseProcessNote", ) ClaimResponseTotalType = create_fhir_type( "ClaimResponseTotalType", "fhir.resources.claimresponse.ClaimResponseTotal" ) ClaimSupportingInfoType = create_fhir_type( "ClaimSupportingInfoType", "fhir.resources.claim.ClaimSupportingInfo" ) ClinicalImpressionType = create_fhir_type( "ClinicalImpressionType", "fhir.resources.clinicalimpression.ClinicalImpression" ) ClinicalImpressionFindingType = create_fhir_type( "ClinicalImpressionFindingType", "fhir.resources.clinicalimpression.ClinicalImpressionFinding", ) ClinicalUseDefinitionType = create_fhir_type( "ClinicalUseDefinitionType", "fhir.resources.clinicalusedefinition.ClinicalUseDefinition", ) ClinicalUseDefinitionContraindicationType = create_fhir_type( "ClinicalUseDefinitionContraindicationType", "fhir.resources.clinicalusedefinition.ClinicalUseDefinitionContraindication", ) ClinicalUseDefinitionContraindicationOtherTherapyType = create_fhir_type( "ClinicalUseDefinitionContraindicationOtherTherapyType", "fhir.resources.clinicalusedefinition.ClinicalUseDefinitionContraindicationOtherTherapy", ) ClinicalUseDefinitionIndicationType = create_fhir_type( "ClinicalUseDefinitionIndicationType", "fhir.resources.clinicalusedefinition.ClinicalUseDefinitionIndication", ) ClinicalUseDefinitionInteractionType = create_fhir_type( "ClinicalUseDefinitionInteractionType", "fhir.resources.clinicalusedefinition.ClinicalUseDefinitionInteraction", ) ClinicalUseDefinitionInteractionInteractantType = create_fhir_type( "ClinicalUseDefinitionInteractionInteractantType", "fhir.resources.clinicalusedefinition.ClinicalUseDefinitionInteractionInteractant", ) ClinicalUseDefinitionUndesirableEffectType = create_fhir_type( "ClinicalUseDefinitionUndesirableEffectType", "fhir.resources.clinicalusedefinition.ClinicalUseDefinitionUndesirableEffect", ) ClinicalUseDefinitionWarningType = create_fhir_type( "ClinicalUseDefinitionWarningType", "fhir.resources.clinicalusedefinition.ClinicalUseDefinitionWarning", ) CodeSystemType = create_fhir_type( "CodeSystemType", "fhir.resources.codesystem.CodeSystem" ) CodeSystemConceptType = create_fhir_type( "CodeSystemConceptType", "fhir.resources.codesystem.CodeSystemConcept" ) CodeSystemConceptDesignationType = create_fhir_type( "CodeSystemConceptDesignationType", "fhir.resources.codesystem.CodeSystemConceptDesignation", ) CodeSystemConceptPropertyType = create_fhir_type( "CodeSystemConceptPropertyType", "fhir.resources.codesystem.CodeSystemConceptProperty", ) CodeSystemFilterType = create_fhir_type( "CodeSystemFilterType", "fhir.resources.codesystem.CodeSystemFilter" ) CodeSystemPropertyType = create_fhir_type( "CodeSystemPropertyType", "fhir.resources.codesystem.CodeSystemProperty" ) CodeableConceptType = create_fhir_type( "CodeableConceptType", "fhir.resources.codeableconcept.CodeableConcept" ) CodeableReferenceType = create_fhir_type( "CodeableReferenceType", "fhir.resources.codeablereference.CodeableReference" ) CodingType = create_fhir_type("CodingType", "fhir.resources.coding.Coding") CommunicationType = create_fhir_type( "CommunicationType", "fhir.resources.communication.Communication" ) CommunicationPayloadType = create_fhir_type( "CommunicationPayloadType", "fhir.resources.communication.CommunicationPayload" ) CommunicationRequestType = create_fhir_type( "CommunicationRequestType", "fhir.resources.communicationrequest.CommunicationRequest", ) CommunicationRequestPayloadType = create_fhir_type( "CommunicationRequestPayloadType", "fhir.resources.communicationrequest.CommunicationRequestPayload", ) CompartmentDefinitionType = create_fhir_type( "CompartmentDefinitionType", "fhir.resources.compartmentdefinition.CompartmentDefinition", ) CompartmentDefinitionResourceType = create_fhir_type( "CompartmentDefinitionResourceType", "fhir.resources.compartmentdefinition.CompartmentDefinitionResource", ) CompositionType = create_fhir_type( "CompositionType", "fhir.resources.composition.Composition" ) CompositionAttesterType = create_fhir_type( "CompositionAttesterType", "fhir.resources.composition.CompositionAttester" ) CompositionEventType = create_fhir_type( "CompositionEventType", "fhir.resources.composition.CompositionEvent" ) CompositionSectionType = create_fhir_type( "CompositionSectionType", "fhir.resources.composition.CompositionSection" ) ConceptMapType = create_fhir_type( "ConceptMapType", "fhir.resources.conceptmap.ConceptMap" ) ConceptMapAdditionalAttributeType = create_fhir_type( "ConceptMapAdditionalAttributeType", "fhir.resources.conceptmap.ConceptMapAdditionalAttribute", ) ConceptMapGroupType = create_fhir_type( "ConceptMapGroupType", "fhir.resources.conceptmap.ConceptMapGroup" ) ConceptMapGroupElementType = create_fhir_type( "ConceptMapGroupElementType", "fhir.resources.conceptmap.ConceptMapGroupElement" ) ConceptMapGroupElementTargetType = create_fhir_type( "ConceptMapGroupElementTargetType", "fhir.resources.conceptmap.ConceptMapGroupElementTarget", ) ConceptMapGroupElementTargetDependsOnType = create_fhir_type( "ConceptMapGroupElementTargetDependsOnType", "fhir.resources.conceptmap.ConceptMapGroupElementTargetDependsOn", ) ConceptMapGroupElementTargetPropertyType = create_fhir_type( "ConceptMapGroupElementTargetPropertyType", "fhir.resources.conceptmap.ConceptMapGroupElementTargetProperty", ) ConceptMapGroupUnmappedType = create_fhir_type( "ConceptMapGroupUnmappedType", "fhir.resources.conceptmap.ConceptMapGroupUnmapped", ) ConceptMapPropertyType = create_fhir_type( "ConceptMapPropertyType", "fhir.resources.conceptmap.ConceptMapProperty" ) ConditionType = create_fhir_type( "ConditionType", "fhir.resources.condition.Condition" ) ConditionDefinitionType = create_fhir_type( "ConditionDefinitionType", "fhir.resources.conditiondefinition.ConditionDefinition", ) ConditionDefinitionMedicationType = create_fhir_type( "ConditionDefinitionMedicationType", "fhir.resources.conditiondefinition.ConditionDefinitionMedication", ) ConditionDefinitionObservationType = create_fhir_type( "ConditionDefinitionObservationType", "fhir.resources.conditiondefinition.ConditionDefinitionObservation", ) ConditionDefinitionPlanType = create_fhir_type( "ConditionDefinitionPlanType", "fhir.resources.conditiondefinition.ConditionDefinitionPlan", ) ConditionDefinitionPreconditionType = create_fhir_type( "ConditionDefinitionPreconditionType", "fhir.resources.conditiondefinition.ConditionDefinitionPrecondition", ) ConditionDefinitionQuestionnaireType = create_fhir_type( "ConditionDefinitionQuestionnaireType", "fhir.resources.conditiondefinition.ConditionDefinitionQuestionnaire", ) ConditionParticipantType = create_fhir_type( "ConditionParticipantType", "fhir.resources.condition.ConditionParticipant" ) ConditionStageType = create_fhir_type( "ConditionStageType", "fhir.resources.condition.ConditionStage" ) ConsentType = create_fhir_type("ConsentType", "fhir.resources.consent.Consent") ConsentPolicyBasisType = create_fhir_type( "ConsentPolicyBasisType", "fhir.resources.consent.ConsentPolicyBasis" ) ConsentProvisionType = create_fhir_type( "ConsentProvisionType", "fhir.resources.consent.ConsentProvision" ) ConsentProvisionActorType = create_fhir_type( "ConsentProvisionActorType", "fhir.resources.consent.ConsentProvisionActor" ) ConsentProvisionDataType = create_fhir_type( "ConsentProvisionDataType", "fhir.resources.consent.ConsentProvisionData" ) ConsentVerificationType = create_fhir_type( "ConsentVerificationType", "fhir.resources.consent.ConsentVerification" ) ContactDetailType = create_fhir_type( "ContactDetailType", "fhir.resources.contactdetail.ContactDetail" ) ContactPointType = create_fhir_type( "ContactPointType", "fhir.resources.contactpoint.ContactPoint" ) ContractType = create_fhir_type("ContractType", "fhir.resources.contract.Contract") ContractContentDefinitionType = create_fhir_type( "ContractContentDefinitionType", "fhir.resources.contract.ContractContentDefinition", ) ContractFriendlyType = create_fhir_type( "ContractFriendlyType", "fhir.resources.contract.ContractFriendly" ) ContractLegalType = create_fhir_type( "ContractLegalType", "fhir.resources.contract.ContractLegal" ) ContractRuleType = create_fhir_type( "ContractRuleType", "fhir.resources.contract.ContractRule" ) ContractSignerType = create_fhir_type( "ContractSignerType", "fhir.resources.contract.ContractSigner" ) ContractTermType = create_fhir_type( "ContractTermType", "fhir.resources.contract.ContractTerm" ) ContractTermActionType = create_fhir_type( "ContractTermActionType", "fhir.resources.contract.ContractTermAction" ) ContractTermActionSubjectType = create_fhir_type( "ContractTermActionSubjectType", "fhir.resources.contract.ContractTermActionSubject", ) ContractTermAssetType = create_fhir_type( "ContractTermAssetType", "fhir.resources.contract.ContractTermAsset" ) ContractTermAssetContextType = create_fhir_type( "ContractTermAssetContextType", "fhir.resources.contract.ContractTermAssetContext", ) ContractTermAssetValuedItemType = create_fhir_type( "ContractTermAssetValuedItemType", "fhir.resources.contract.ContractTermAssetValuedItem", ) ContractTermOfferType = create_fhir_type( "ContractTermOfferType", "fhir.resources.contract.ContractTermOffer" ) ContractTermOfferAnswerType = create_fhir_type( "ContractTermOfferAnswerType", "fhir.resources.contract.ContractTermOfferAnswer" ) ContractTermOfferPartyType = create_fhir_type( "ContractTermOfferPartyType", "fhir.resources.contract.ContractTermOfferParty" ) ContractTermSecurityLabelType = create_fhir_type( "ContractTermSecurityLabelType", "fhir.resources.contract.ContractTermSecurityLabel", ) ContributorType = create_fhir_type( "ContributorType", "fhir.resources.contributor.Contributor" ) CountType = create_fhir_type("CountType", "fhir.resources.count.Count") CoverageType = create_fhir_type("CoverageType", "fhir.resources.coverage.Coverage") CoverageClassType = create_fhir_type( "CoverageClassType", "fhir.resources.coverage.CoverageClass" ) CoverageCostToBeneficiaryType = create_fhir_type( "CoverageCostToBeneficiaryType", "fhir.resources.coverage.CoverageCostToBeneficiary", ) CoverageCostToBeneficiaryExceptionType = create_fhir_type( "CoverageCostToBeneficiaryExceptionType", "fhir.resources.coverage.CoverageCostToBeneficiaryException", ) CoverageEligibilityRequestType = create_fhir_type( "CoverageEligibilityRequestType", "fhir.resources.coverageeligibilityrequest.CoverageEligibilityRequest", ) CoverageEligibilityRequestEventType = create_fhir_type( "CoverageEligibilityRequestEventType", "fhir.resources.coverageeligibilityrequest.CoverageEligibilityRequestEvent", ) CoverageEligibilityRequestInsuranceType = create_fhir_type( "CoverageEligibilityRequestInsuranceType", "fhir.resources.coverageeligibilityrequest.CoverageEligibilityRequestInsurance", ) CoverageEligibilityRequestItemType = create_fhir_type( "CoverageEligibilityRequestItemType", "fhir.resources.coverageeligibilityrequest.CoverageEligibilityRequestItem", ) CoverageEligibilityRequestItemDiagnosisType = create_fhir_type( "CoverageEligibilityRequestItemDiagnosisType", "fhir.resources.coverageeligibilityrequest.CoverageEligibilityRequestItemDiagnosis", ) CoverageEligibilityRequestSupportingInfoType = create_fhir_type( "CoverageEligibilityRequestSupportingInfoType", "fhir.resources.coverageeligibilityrequest.CoverageEligibilityRequestSupportingInfo", ) CoverageEligibilityResponseType = create_fhir_type( "CoverageEligibilityResponseType", "fhir.resources.coverageeligibilityresponse.CoverageEligibilityResponse", ) CoverageEligibilityResponseErrorType = create_fhir_type( "CoverageEligibilityResponseErrorType", "fhir.resources.coverageeligibilityresponse.CoverageEligibilityResponseError", ) CoverageEligibilityResponseEventType = create_fhir_type( "CoverageEligibilityResponseEventType", "fhir.resources.coverageeligibilityresponse.CoverageEligibilityResponseEvent", ) CoverageEligibilityResponseInsuranceType = create_fhir_type( "CoverageEligibilityResponseInsuranceType", "fhir.resources.coverageeligibilityresponse.CoverageEligibilityResponseInsurance", ) CoverageEligibilityResponseInsuranceItemType = create_fhir_type( "CoverageEligibilityResponseInsuranceItemType", "fhir.resources.coverageeligibilityresponse.CoverageEligibilityResponseInsuranceItem", ) CoverageEligibilityResponseInsuranceItemBenefitType = create_fhir_type( "CoverageEligibilityResponseInsuranceItemBenefitType", "fhir.resources.coverageeligibilityresponse.CoverageEligibilityResponseInsuranceItemBenefit", ) CoveragePaymentByType = create_fhir_type( "CoveragePaymentByType", "fhir.resources.coverage.CoveragePaymentBy" ) DataRequirementType = create_fhir_type( "DataRequirementType", "fhir.resources.datarequirement.DataRequirement" ) DataRequirementCodeFilterType = create_fhir_type( "DataRequirementCodeFilterType", "fhir.resources.datarequirement.DataRequirementCodeFilter", ) DataRequirementDateFilterType = create_fhir_type( "DataRequirementDateFilterType", "fhir.resources.datarequirement.DataRequirementDateFilter", ) DataRequirementSortType = create_fhir_type( "DataRequirementSortType", "fhir.resources.datarequirement.DataRequirementSort" ) DataRequirementValueFilterType = create_fhir_type( "DataRequirementValueFilterType", "fhir.resources.datarequirement.DataRequirementValueFilter", ) DataTypeType = create_fhir_type("DataTypeType", "fhir.resources.datatype.DataType") DetectedIssueType = create_fhir_type( "DetectedIssueType", "fhir.resources.detectedissue.DetectedIssue" ) DetectedIssueEvidenceType = create_fhir_type( "DetectedIssueEvidenceType", "fhir.resources.detectedissue.DetectedIssueEvidence", ) DetectedIssueMitigationType = create_fhir_type( "DetectedIssueMitigationType", "fhir.resources.detectedissue.DetectedIssueMitigation", ) DeviceType = create_fhir_type("DeviceType", "fhir.resources.device.Device") DeviceAssociationType = create_fhir_type( "DeviceAssociationType", "fhir.resources.deviceassociation.DeviceAssociation" ) DeviceAssociationOperationType = create_fhir_type( "DeviceAssociationOperationType", "fhir.resources.deviceassociation.DeviceAssociationOperation", ) DeviceConformsToType = create_fhir_type( "DeviceConformsToType", "fhir.resources.device.DeviceConformsTo" ) DeviceDefinitionType = create_fhir_type( "DeviceDefinitionType", "fhir.resources.devicedefinition.DeviceDefinition" ) DeviceDefinitionChargeItemType = create_fhir_type( "DeviceDefinitionChargeItemType", "fhir.resources.devicedefinition.DeviceDefinitionChargeItem", ) DeviceDefinitionClassificationType = create_fhir_type( "DeviceDefinitionClassificationType", "fhir.resources.devicedefinition.DeviceDefinitionClassification", ) DeviceDefinitionConformsToType = create_fhir_type( "DeviceDefinitionConformsToType", "fhir.resources.devicedefinition.DeviceDefinitionConformsTo", ) DeviceDefinitionCorrectiveActionType = create_fhir_type( "DeviceDefinitionCorrectiveActionType", "fhir.resources.devicedefinition.DeviceDefinitionCorrectiveAction", ) DeviceDefinitionDeviceNameType = create_fhir_type( "DeviceDefinitionDeviceNameType", "fhir.resources.devicedefinition.DeviceDefinitionDeviceName", ) DeviceDefinitionGuidelineType = create_fhir_type( "DeviceDefinitionGuidelineType", "fhir.resources.devicedefinition.DeviceDefinitionGuideline", ) DeviceDefinitionHasPartType = create_fhir_type( "DeviceDefinitionHasPartType", "fhir.resources.devicedefinition.DeviceDefinitionHasPart", ) DeviceDefinitionLinkType = create_fhir_type( "DeviceDefinitionLinkType", "fhir.resources.devicedefinition.DeviceDefinitionLink", ) DeviceDefinitionMaterialType = create_fhir_type( "DeviceDefinitionMaterialType", "fhir.resources.devicedefinition.DeviceDefinitionMaterial", ) DeviceDefinitionPackagingType = create_fhir_type( "DeviceDefinitionPackagingType", "fhir.resources.devicedefinition.DeviceDefinitionPackaging", ) DeviceDefinitionPackagingDistributorType = create_fhir_type( "DeviceDefinitionPackagingDistributorType", "fhir.resources.devicedefinition.DeviceDefinitionPackagingDistributor", ) DeviceDefinitionPropertyType = create_fhir_type( "DeviceDefinitionPropertyType", "fhir.resources.devicedefinition.DeviceDefinitionProperty", ) DeviceDefinitionRegulatoryIdentifierType = create_fhir_type( "DeviceDefinitionRegulatoryIdentifierType", "fhir.resources.devicedefinition.DeviceDefinitionRegulatoryIdentifier", ) DeviceDefinitionUdiDeviceIdentifierType = create_fhir_type( "DeviceDefinitionUdiDeviceIdentifierType", "fhir.resources.devicedefinition.DeviceDefinitionUdiDeviceIdentifier", ) DeviceDefinitionUdiDeviceIdentifierMarketDistributionType = create_fhir_type( "DeviceDefinitionUdiDeviceIdentifierMarketDistributionType", "fhir.resources.devicedefinition.DeviceDefinitionUdiDeviceIdentifierMarketDistribution", ) DeviceDefinitionVersionType = create_fhir_type( "DeviceDefinitionVersionType", "fhir.resources.devicedefinition.DeviceDefinitionVersion", ) DeviceDispenseType = create_fhir_type( "DeviceDispenseType", "fhir.resources.devicedispense.DeviceDispense" ) DeviceDispensePerformerType = create_fhir_type( "DeviceDispensePerformerType", "fhir.resources.devicedispense.DeviceDispensePerformer", ) DeviceMetricType = create_fhir_type( "DeviceMetricType", "fhir.resources.devicemetric.DeviceMetric" ) DeviceMetricCalibrationType = create_fhir_type( "DeviceMetricCalibrationType", "fhir.resources.devicemetric.DeviceMetricCalibration", ) DeviceNameType = create_fhir_type( "DeviceNameType", "fhir.resources.device.DeviceName" ) DevicePropertyType = create_fhir_type( "DevicePropertyType", "fhir.resources.device.DeviceProperty" ) DeviceRequestType = create_fhir_type( "DeviceRequestType", "fhir.resources.devicerequest.DeviceRequest" ) DeviceRequestParameterType = create_fhir_type( "DeviceRequestParameterType", "fhir.resources.devicerequest.DeviceRequestParameter", ) DeviceUdiCarrierType = create_fhir_type( "DeviceUdiCarrierType", "fhir.resources.device.DeviceUdiCarrier" ) DeviceUsageType = create_fhir_type( "DeviceUsageType", "fhir.resources.deviceusage.DeviceUsage" ) DeviceUsageAdherenceType = create_fhir_type( "DeviceUsageAdherenceType", "fhir.resources.deviceusage.DeviceUsageAdherence" ) DeviceVersionType = create_fhir_type( "DeviceVersionType", "fhir.resources.device.DeviceVersion" ) DiagnosticReportType = create_fhir_type( "DiagnosticReportType", "fhir.resources.diagnosticreport.DiagnosticReport" ) DiagnosticReportMediaType = create_fhir_type( "DiagnosticReportMediaType", "fhir.resources.diagnosticreport.DiagnosticReportMedia", ) DiagnosticReportSupportingInfoType = create_fhir_type( "DiagnosticReportSupportingInfoType", "fhir.resources.diagnosticreport.DiagnosticReportSupportingInfo", ) DistanceType = create_fhir_type("DistanceType", "fhir.resources.distance.Distance") DocumentReferenceType = create_fhir_type( "DocumentReferenceType", "fhir.resources.documentreference.DocumentReference" ) DocumentReferenceAttesterType = create_fhir_type( "DocumentReferenceAttesterType", "fhir.resources.documentreference.DocumentReferenceAttester", ) DocumentReferenceContentType = create_fhir_type( "DocumentReferenceContentType", "fhir.resources.documentreference.DocumentReferenceContent", ) DocumentReferenceContentProfileType = create_fhir_type( "DocumentReferenceContentProfileType", "fhir.resources.documentreference.DocumentReferenceContentProfile", ) DocumentReferenceRelatesToType = create_fhir_type( "DocumentReferenceRelatesToType", "fhir.resources.documentreference.DocumentReferenceRelatesTo", ) DomainResourceType = create_fhir_type( "DomainResourceType", "fhir.resources.domainresource.DomainResource" ) DosageType = create_fhir_type("DosageType", "fhir.resources.dosage.Dosage") DosageDoseAndRateType = create_fhir_type( "DosageDoseAndRateType", "fhir.resources.dosage.DosageDoseAndRate" ) DurationType = create_fhir_type("DurationType", "fhir.resources.duration.Duration") ElementDefinitionType = create_fhir_type( "ElementDefinitionType", "fhir.resources.elementdefinition.ElementDefinition" ) ElementDefinitionBaseType = create_fhir_type( "ElementDefinitionBaseType", "fhir.resources.elementdefinition.ElementDefinitionBase", ) ElementDefinitionBindingType = create_fhir_type( "ElementDefinitionBindingType", "fhir.resources.elementdefinition.ElementDefinitionBinding", ) ElementDefinitionBindingAdditionalType = create_fhir_type( "ElementDefinitionBindingAdditionalType", "fhir.resources.elementdefinition.ElementDefinitionBindingAdditional", ) ElementDefinitionConstraintType = create_fhir_type( "ElementDefinitionConstraintType", "fhir.resources.elementdefinition.ElementDefinitionConstraint", ) ElementDefinitionExampleType = create_fhir_type( "ElementDefinitionExampleType", "fhir.resources.elementdefinition.ElementDefinitionExample", ) ElementDefinitionMappingType = create_fhir_type( "ElementDefinitionMappingType", "fhir.resources.elementdefinition.ElementDefinitionMapping", ) ElementDefinitionSlicingType = create_fhir_type( "ElementDefinitionSlicingType", "fhir.resources.elementdefinition.ElementDefinitionSlicing", ) ElementDefinitionSlicingDiscriminatorType = create_fhir_type( "ElementDefinitionSlicingDiscriminatorType", "fhir.resources.elementdefinition.ElementDefinitionSlicingDiscriminator", ) ElementDefinitionTypeType = create_fhir_type( "ElementDefinitionTypeType", "fhir.resources.elementdefinition.ElementDefinitionType", ) EncounterType = create_fhir_type( "EncounterType", "fhir.resources.encounter.Encounter" ) EncounterAdmissionType = create_fhir_type( "EncounterAdmissionType", "fhir.resources.encounter.EncounterAdmission" ) EncounterDiagnosisType = create_fhir_type( "EncounterDiagnosisType", "fhir.resources.encounter.EncounterDiagnosis" ) EncounterHistoryType = create_fhir_type( "EncounterHistoryType", "fhir.resources.encounterhistory.EncounterHistory" ) EncounterHistoryLocationType = create_fhir_type( "EncounterHistoryLocationType", "fhir.resources.encounterhistory.EncounterHistoryLocation", ) EncounterLocationType = create_fhir_type( "EncounterLocationType", "fhir.resources.encounter.EncounterLocation" ) EncounterParticipantType = create_fhir_type( "EncounterParticipantType", "fhir.resources.encounter.EncounterParticipant" ) EncounterReasonType = create_fhir_type( "EncounterReasonType", "fhir.resources.encounter.EncounterReason" ) EndpointType = create_fhir_type("EndpointType", "fhir.resources.endpoint.Endpoint") EndpointPayloadType = create_fhir_type( "EndpointPayloadType", "fhir.resources.endpoint.EndpointPayload" ) EnrollmentRequestType = create_fhir_type( "EnrollmentRequestType", "fhir.resources.enrollmentrequest.EnrollmentRequest" ) EnrollmentResponseType = create_fhir_type( "EnrollmentResponseType", "fhir.resources.enrollmentresponse.EnrollmentResponse" ) EpisodeOfCareType = create_fhir_type( "EpisodeOfCareType", "fhir.resources.episodeofcare.EpisodeOfCare" ) EpisodeOfCareDiagnosisType = create_fhir_type( "EpisodeOfCareDiagnosisType", "fhir.resources.episodeofcare.EpisodeOfCareDiagnosis", ) EpisodeOfCareReasonType = create_fhir_type( "EpisodeOfCareReasonType", "fhir.resources.episodeofcare.EpisodeOfCareReason" ) EpisodeOfCareStatusHistoryType = create_fhir_type( "EpisodeOfCareStatusHistoryType", "fhir.resources.episodeofcare.EpisodeOfCareStatusHistory", ) EventDefinitionType = create_fhir_type( "EventDefinitionType", "fhir.resources.eventdefinition.EventDefinition" ) EvidenceType = create_fhir_type("EvidenceType", "fhir.resources.evidence.Evidence") EvidenceCertaintyType = create_fhir_type( "EvidenceCertaintyType", "fhir.resources.evidence.EvidenceCertainty" ) EvidenceReportType = create_fhir_type( "EvidenceReportType", "fhir.resources.evidencereport.EvidenceReport" ) EvidenceReportRelatesToType = create_fhir_type( "EvidenceReportRelatesToType", "fhir.resources.evidencereport.EvidenceReportRelatesTo", ) EvidenceReportRelatesToTargetType = create_fhir_type( "EvidenceReportRelatesToTargetType", "fhir.resources.evidencereport.EvidenceReportRelatesToTarget", ) EvidenceReportSectionType = create_fhir_type( "EvidenceReportSectionType", "fhir.resources.evidencereport.EvidenceReportSection", ) EvidenceReportSubjectType = create_fhir_type( "EvidenceReportSubjectType", "fhir.resources.evidencereport.EvidenceReportSubject", ) EvidenceReportSubjectCharacteristicType = create_fhir_type( "EvidenceReportSubjectCharacteristicType", "fhir.resources.evidencereport.EvidenceReportSubjectCharacteristic", ) EvidenceStatisticType = create_fhir_type( "EvidenceStatisticType", "fhir.resources.evidence.EvidenceStatistic" ) EvidenceStatisticAttributeEstimateType = create_fhir_type( "EvidenceStatisticAttributeEstimateType", "fhir.resources.evidence.EvidenceStatisticAttributeEstimate", ) EvidenceStatisticModelCharacteristicType = create_fhir_type( "EvidenceStatisticModelCharacteristicType", "fhir.resources.evidence.EvidenceStatisticModelCharacteristic", ) EvidenceStatisticModelCharacteristicVariableType = create_fhir_type( "EvidenceStatisticModelCharacteristicVariableType", "fhir.resources.evidence.EvidenceStatisticModelCharacteristicVariable", ) EvidenceStatisticSampleSizeType = create_fhir_type( "EvidenceStatisticSampleSizeType", "fhir.resources.evidence.EvidenceStatisticSampleSize", ) EvidenceVariableType = create_fhir_type( "EvidenceVariableType", "fhir.resources.evidencevariable.EvidenceVariable" ) EvidenceVariableCategoryType = create_fhir_type( "EvidenceVariableCategoryType", "fhir.resources.evidencevariable.EvidenceVariableCategory", ) EvidenceVariableCharacteristicType = create_fhir_type( "EvidenceVariableCharacteristicType", "fhir.resources.evidencevariable.EvidenceVariableCharacteristic", ) EvidenceVariableCharacteristicDefinitionByCombinationType = create_fhir_type( "EvidenceVariableCharacteristicDefinitionByCombinationType", "fhir.resources.evidencevariable.EvidenceVariableCharacteristicDefinitionByCombination", ) EvidenceVariableCharacteristicDefinitionByTypeAndValueType = create_fhir_type( "EvidenceVariableCharacteristicDefinitionByTypeAndValueType", "fhir.resources.evidencevariable.EvidenceVariableCharacteristicDefinitionByTypeAndValue", ) EvidenceVariableCharacteristicTimeFromEventType = create_fhir_type( "EvidenceVariableCharacteristicTimeFromEventType", "fhir.resources.evidencevariable.EvidenceVariableCharacteristicTimeFromEvent", ) EvidenceVariableDefinitionType = create_fhir_type( "EvidenceVariableDefinitionType", "fhir.resources.evidence.EvidenceVariableDefinition", ) ExampleScenarioType = create_fhir_type( "ExampleScenarioType", "fhir.resources.examplescenario.ExampleScenario" ) ExampleScenarioActorType = create_fhir_type( "ExampleScenarioActorType", "fhir.resources.examplescenario.ExampleScenarioActor", ) ExampleScenarioInstanceType = create_fhir_type( "ExampleScenarioInstanceType", "fhir.resources.examplescenario.ExampleScenarioInstance", ) ExampleScenarioInstanceContainedInstanceType = create_fhir_type( "ExampleScenarioInstanceContainedInstanceType", "fhir.resources.examplescenario.ExampleScenarioInstanceContainedInstance", ) ExampleScenarioInstanceVersionType = create_fhir_type( "ExampleScenarioInstanceVersionType", "fhir.resources.examplescenario.ExampleScenarioInstanceVersion", ) ExampleScenarioProcessType = create_fhir_type( "ExampleScenarioProcessType", "fhir.resources.examplescenario.ExampleScenarioProcess", ) ExampleScenarioProcessStepType = create_fhir_type( "ExampleScenarioProcessStepType", "fhir.resources.examplescenario.ExampleScenarioProcessStep", ) ExampleScenarioProcessStepAlternativeType = create_fhir_type( "ExampleScenarioProcessStepAlternativeType", "fhir.resources.examplescenario.ExampleScenarioProcessStepAlternative", ) ExampleScenarioProcessStepOperationType = create_fhir_type( "ExampleScenarioProcessStepOperationType", "fhir.resources.examplescenario.ExampleScenarioProcessStepOperation", ) ExplanationOfBenefitType = create_fhir_type( "ExplanationOfBenefitType", "fhir.resources.explanationofbenefit.ExplanationOfBenefit", ) ExplanationOfBenefitAccidentType = create_fhir_type( "ExplanationOfBenefitAccidentType", "fhir.resources.explanationofbenefit.ExplanationOfBenefitAccident", ) ExplanationOfBenefitAddItemType = create_fhir_type( "ExplanationOfBenefitAddItemType", "fhir.resources.explanationofbenefit.ExplanationOfBenefitAddItem", ) ExplanationOfBenefitAddItemBodySiteType = create_fhir_type( "ExplanationOfBenefitAddItemBodySiteType", "fhir.resources.explanationofbenefit.ExplanationOfBenefitAddItemBodySite", ) ExplanationOfBenefitAddItemDetailType = create_fhir_type( "ExplanationOfBenefitAddItemDetailType", "fhir.resources.explanationofbenefit.ExplanationOfBenefitAddItemDetail", ) ExplanationOfBenefitAddItemDetailSubDetailType = create_fhir_type( "ExplanationOfBenefitAddItemDetailSubDetailType", "fhir.resources.explanationofbenefit.ExplanationOfBenefitAddItemDetailSubDetail", ) ExplanationOfBenefitBenefitBalanceType = create_fhir_type( "ExplanationOfBenefitBenefitBalanceType", "fhir.resources.explanationofbenefit.ExplanationOfBenefitBenefitBalance", ) ExplanationOfBenefitBenefitBalanceFinancialType = create_fhir_type( "ExplanationOfBenefitBenefitBalanceFinancialType", "fhir.resources.explanationofbenefit.ExplanationOfBenefitBenefitBalanceFinancial", ) ExplanationOfBenefitCareTeamType = create_fhir_type( "ExplanationOfBenefitCareTeamType", "fhir.resources.explanationofbenefit.ExplanationOfBenefitCareTeam", ) ExplanationOfBenefitDiagnosisType = create_fhir_type( "ExplanationOfBenefitDiagnosisType", "fhir.resources.explanationofbenefit.ExplanationOfBenefitDiagnosis", ) ExplanationOfBenefitEventType = create_fhir_type( "ExplanationOfBenefitEventType", "fhir.resources.explanationofbenefit.ExplanationOfBenefitEvent", ) ExplanationOfBenefitInsuranceType = create_fhir_type( "ExplanationOfBenefitInsuranceType", "fhir.resources.explanationofbenefit.ExplanationOfBenefitInsurance", ) ExplanationOfBenefitItemType = create_fhir_type( "ExplanationOfBenefitItemType", "fhir.resources.explanationofbenefit.ExplanationOfBenefitItem", ) ExplanationOfBenefitItemAdjudicationType = create_fhir_type( "ExplanationOfBenefitItemAdjudicationType", "fhir.resources.explanationofbenefit.ExplanationOfBenefitItemAdjudication", ) ExplanationOfBenefitItemBodySiteType = create_fhir_type( "ExplanationOfBenefitItemBodySiteType", "fhir.resources.explanationofbenefit.ExplanationOfBenefitItemBodySite", ) ExplanationOfBenefitItemDetailType = create_fhir_type( "ExplanationOfBenefitItemDetailType", "fhir.resources.explanationofbenefit.ExplanationOfBenefitItemDetail", ) ExplanationOfBenefitItemDetailSubDetailType = create_fhir_type( "ExplanationOfBenefitItemDetailSubDetailType", "fhir.resources.explanationofbenefit.ExplanationOfBenefitItemDetailSubDetail", ) ExplanationOfBenefitItemReviewOutcomeType = create_fhir_type( "ExplanationOfBenefitItemReviewOutcomeType", "fhir.resources.explanationofbenefit.ExplanationOfBenefitItemReviewOutcome", ) ExplanationOfBenefitPayeeType = create_fhir_type( "ExplanationOfBenefitPayeeType", "fhir.resources.explanationofbenefit.ExplanationOfBenefitPayee", ) ExplanationOfBenefitPaymentType = create_fhir_type( "ExplanationOfBenefitPaymentType", "fhir.resources.explanationofbenefit.ExplanationOfBenefitPayment", ) ExplanationOfBenefitProcedureType = create_fhir_type( "ExplanationOfBenefitProcedureType", "fhir.resources.explanationofbenefit.ExplanationOfBenefitProcedure", ) ExplanationOfBenefitProcessNoteType = create_fhir_type( "ExplanationOfBenefitProcessNoteType", "fhir.resources.explanationofbenefit.ExplanationOfBenefitProcessNote", ) ExplanationOfBenefitRelatedType = create_fhir_type( "ExplanationOfBenefitRelatedType", "fhir.resources.explanationofbenefit.ExplanationOfBenefitRelated", ) ExplanationOfBenefitSupportingInfoType = create_fhir_type( "ExplanationOfBenefitSupportingInfoType", "fhir.resources.explanationofbenefit.ExplanationOfBenefitSupportingInfo", ) ExplanationOfBenefitTotalType = create_fhir_type( "ExplanationOfBenefitTotalType", "fhir.resources.explanationofbenefit.ExplanationOfBenefitTotal", ) ExpressionType = create_fhir_type( "ExpressionType", "fhir.resources.expression.Expression" ) ExtendedContactDetailType = create_fhir_type( "ExtendedContactDetailType", "fhir.resources.extendedcontactdetail.ExtendedContactDetail", ) ExtensionType = create_fhir_type( "ExtensionType", "fhir.resources.extension.Extension" ) FamilyMemberHistoryType = create_fhir_type( "FamilyMemberHistoryType", "fhir.resources.familymemberhistory.FamilyMemberHistory", ) FamilyMemberHistoryConditionType = create_fhir_type( "FamilyMemberHistoryConditionType", "fhir.resources.familymemberhistory.FamilyMemberHistoryCondition", ) FamilyMemberHistoryParticipantType = create_fhir_type( "FamilyMemberHistoryParticipantType", "fhir.resources.familymemberhistory.FamilyMemberHistoryParticipant", ) FamilyMemberHistoryProcedureType = create_fhir_type( "FamilyMemberHistoryProcedureType", "fhir.resources.familymemberhistory.FamilyMemberHistoryProcedure", ) FlagType = create_fhir_type("FlagType", "fhir.resources.flag.Flag") FormularyItemType = create_fhir_type( "FormularyItemType", "fhir.resources.formularyitem.FormularyItem" ) GenomicStudyType = create_fhir_type( "GenomicStudyType", "fhir.resources.genomicstudy.GenomicStudy" ) GenomicStudyAnalysisType = create_fhir_type( "GenomicStudyAnalysisType", "fhir.resources.genomicstudy.GenomicStudyAnalysis" ) GenomicStudyAnalysisDeviceType = create_fhir_type( "GenomicStudyAnalysisDeviceType", "fhir.resources.genomicstudy.GenomicStudyAnalysisDevice", ) GenomicStudyAnalysisInputType = create_fhir_type( "GenomicStudyAnalysisInputType", "fhir.resources.genomicstudy.GenomicStudyAnalysisInput", ) GenomicStudyAnalysisOutputType = create_fhir_type( "GenomicStudyAnalysisOutputType", "fhir.resources.genomicstudy.GenomicStudyAnalysisOutput", ) GenomicStudyAnalysisPerformerType = create_fhir_type( "GenomicStudyAnalysisPerformerType", "fhir.resources.genomicstudy.GenomicStudyAnalysisPerformer", ) GoalType = create_fhir_type("GoalType", "fhir.resources.goal.Goal") GoalTargetType = create_fhir_type( "GoalTargetType", "fhir.resources.goal.GoalTarget" ) GraphDefinitionType = create_fhir_type( "GraphDefinitionType", "fhir.resources.graphdefinition.GraphDefinition" ) GraphDefinitionLinkType = create_fhir_type( "GraphDefinitionLinkType", "fhir.resources.graphdefinition.GraphDefinitionLink" ) GraphDefinitionLinkCompartmentType = create_fhir_type( "GraphDefinitionLinkCompartmentType", "fhir.resources.graphdefinition.GraphDefinitionLinkCompartment", ) GraphDefinitionNodeType = create_fhir_type( "GraphDefinitionNodeType", "fhir.resources.graphdefinition.GraphDefinitionNode" ) GroupType = create_fhir_type("GroupType", "fhir.resources.group.Group") GroupCharacteristicType = create_fhir_type( "GroupCharacteristicType", "fhir.resources.group.GroupCharacteristic" ) GroupMemberType = create_fhir_type( "GroupMemberType", "fhir.resources.group.GroupMember" ) GuidanceResponseType = create_fhir_type( "GuidanceResponseType", "fhir.resources.guidanceresponse.GuidanceResponse" ) HealthcareServiceType = create_fhir_type( "HealthcareServiceType", "fhir.resources.healthcareservice.HealthcareService" ) HealthcareServiceEligibilityType = create_fhir_type( "HealthcareServiceEligibilityType", "fhir.resources.healthcareservice.HealthcareServiceEligibility", ) HumanNameType = create_fhir_type( "HumanNameType", "fhir.resources.humanname.HumanName" ) IdentifierType = create_fhir_type( "IdentifierType", "fhir.resources.identifier.Identifier" ) ImagingSelectionType = create_fhir_type( "ImagingSelectionType", "fhir.resources.imagingselection.ImagingSelection" ) ImagingSelectionInstanceType = create_fhir_type( "ImagingSelectionInstanceType", "fhir.resources.imagingselection.ImagingSelectionInstance", ) ImagingSelectionInstanceImageRegion2DType = create_fhir_type( "ImagingSelectionInstanceImageRegion2DType", "fhir.resources.imagingselection.ImagingSelectionInstanceImageRegion2D", ) ImagingSelectionInstanceImageRegion3DType = create_fhir_type( "ImagingSelectionInstanceImageRegion3DType", "fhir.resources.imagingselection.ImagingSelectionInstanceImageRegion3D", ) ImagingSelectionPerformerType = create_fhir_type( "ImagingSelectionPerformerType", "fhir.resources.imagingselection.ImagingSelectionPerformer", ) ImagingStudyType = create_fhir_type( "ImagingStudyType", "fhir.resources.imagingstudy.ImagingStudy" ) ImagingStudySeriesType = create_fhir_type( "ImagingStudySeriesType", "fhir.resources.imagingstudy.ImagingStudySeries" ) ImagingStudySeriesInstanceType = create_fhir_type( "ImagingStudySeriesInstanceType", "fhir.resources.imagingstudy.ImagingStudySeriesInstance", ) ImagingStudySeriesPerformerType = create_fhir_type( "ImagingStudySeriesPerformerType", "fhir.resources.imagingstudy.ImagingStudySeriesPerformer", ) ImmunizationType = create_fhir_type( "ImmunizationType", "fhir.resources.immunization.Immunization" ) ImmunizationEvaluationType = create_fhir_type( "ImmunizationEvaluationType", "fhir.resources.immunizationevaluation.ImmunizationEvaluation", ) ImmunizationPerformerType = create_fhir_type( "ImmunizationPerformerType", "fhir.resources.immunization.ImmunizationPerformer" ) ImmunizationProgramEligibilityType = create_fhir_type( "ImmunizationProgramEligibilityType", "fhir.resources.immunization.ImmunizationProgramEligibility", ) ImmunizationProtocolAppliedType = create_fhir_type( "ImmunizationProtocolAppliedType", "fhir.resources.immunization.ImmunizationProtocolApplied", ) ImmunizationReactionType = create_fhir_type( "ImmunizationReactionType", "fhir.resources.immunization.ImmunizationReaction" ) ImmunizationRecommendationType = create_fhir_type( "ImmunizationRecommendationType", "fhir.resources.immunizationrecommendation.ImmunizationRecommendation", ) ImmunizationRecommendationRecommendationType = create_fhir_type( "ImmunizationRecommendationRecommendationType", "fhir.resources.immunizationrecommendation.ImmunizationRecommendationRecommendation", ) ImmunizationRecommendationRecommendationDateCriterionType = create_fhir_type( "ImmunizationRecommendationRecommendationDateCriterionType", "fhir.resources.immunizationrecommendation.ImmunizationRecommendationRecommendationDateCriterion", ) ImplementationGuideType = create_fhir_type( "ImplementationGuideType", "fhir.resources.implementationguide.ImplementationGuide", ) ImplementationGuideDefinitionType = create_fhir_type( "ImplementationGuideDefinitionType", "fhir.resources.implementationguide.ImplementationGuideDefinition", ) ImplementationGuideDefinitionGroupingType = create_fhir_type( "ImplementationGuideDefinitionGroupingType", "fhir.resources.implementationguide.ImplementationGuideDefinitionGrouping", ) ImplementationGuideDefinitionPageType = create_fhir_type( "ImplementationGuideDefinitionPageType", "fhir.resources.implementationguide.ImplementationGuideDefinitionPage", ) ImplementationGuideDefinitionParameterType = create_fhir_type( "ImplementationGuideDefinitionParameterType", "fhir.resources.implementationguide.ImplementationGuideDefinitionParameter", ) ImplementationGuideDefinitionResourceType = create_fhir_type( "ImplementationGuideDefinitionResourceType", "fhir.resources.implementationguide.ImplementationGuideDefinitionResource", ) ImplementationGuideDefinitionTemplateType = create_fhir_type( "ImplementationGuideDefinitionTemplateType", "fhir.resources.implementationguide.ImplementationGuideDefinitionTemplate", ) ImplementationGuideDependsOnType = create_fhir_type( "ImplementationGuideDependsOnType", "fhir.resources.implementationguide.ImplementationGuideDependsOn", ) ImplementationGuideGlobalType = create_fhir_type( "ImplementationGuideGlobalType", "fhir.resources.implementationguide.ImplementationGuideGlobal", ) ImplementationGuideManifestType = create_fhir_type( "ImplementationGuideManifestType", "fhir.resources.implementationguide.ImplementationGuideManifest", ) ImplementationGuideManifestPageType = create_fhir_type( "ImplementationGuideManifestPageType", "fhir.resources.implementationguide.ImplementationGuideManifestPage", ) ImplementationGuideManifestResourceType = create_fhir_type( "ImplementationGuideManifestResourceType", "fhir.resources.implementationguide.ImplementationGuideManifestResource", ) IngredientType = create_fhir_type( "IngredientType", "fhir.resources.ingredient.Ingredient" ) IngredientManufacturerType = create_fhir_type( "IngredientManufacturerType", "fhir.resources.ingredient.IngredientManufacturer" ) IngredientSubstanceType = create_fhir_type( "IngredientSubstanceType", "fhir.resources.ingredient.IngredientSubstance" ) IngredientSubstanceStrengthType = create_fhir_type( "IngredientSubstanceStrengthType", "fhir.resources.ingredient.IngredientSubstanceStrength", ) IngredientSubstanceStrengthReferenceStrengthType = create_fhir_type( "IngredientSubstanceStrengthReferenceStrengthType", "fhir.resources.ingredient.IngredientSubstanceStrengthReferenceStrength", ) InsurancePlanType = create_fhir_type( "InsurancePlanType", "fhir.resources.insuranceplan.InsurancePlan" ) InsurancePlanCoverageType = create_fhir_type( "InsurancePlanCoverageType", "fhir.resources.insuranceplan.InsurancePlanCoverage", ) InsurancePlanCoverageBenefitType = create_fhir_type( "InsurancePlanCoverageBenefitType", "fhir.resources.insuranceplan.InsurancePlanCoverageBenefit", ) InsurancePlanCoverageBenefitLimitType = create_fhir_type( "InsurancePlanCoverageBenefitLimitType", "fhir.resources.insuranceplan.InsurancePlanCoverageBenefitLimit", ) InsurancePlanPlanType = create_fhir_type( "InsurancePlanPlanType", "fhir.resources.insuranceplan.InsurancePlanPlan" ) InsurancePlanPlanGeneralCostType = create_fhir_type( "InsurancePlanPlanGeneralCostType", "fhir.resources.insuranceplan.InsurancePlanPlanGeneralCost", ) InsurancePlanPlanSpecificCostType = create_fhir_type( "InsurancePlanPlanSpecificCostType", "fhir.resources.insuranceplan.InsurancePlanPlanSpecificCost", ) InsurancePlanPlanSpecificCostBenefitType = create_fhir_type( "InsurancePlanPlanSpecificCostBenefitType", "fhir.resources.insuranceplan.InsurancePlanPlanSpecificCostBenefit", ) InsurancePlanPlanSpecificCostBenefitCostType = create_fhir_type( "InsurancePlanPlanSpecificCostBenefitCostType", "fhir.resources.insuranceplan.InsurancePlanPlanSpecificCostBenefitCost", ) InventoryItemType = create_fhir_type( "InventoryItemType", "fhir.resources.inventoryitem.InventoryItem" ) InventoryItemAssociationType = create_fhir_type( "InventoryItemAssociationType", "fhir.resources.inventoryitem.InventoryItemAssociation", ) InventoryItemCharacteristicType = create_fhir_type( "InventoryItemCharacteristicType", "fhir.resources.inventoryitem.InventoryItemCharacteristic", ) InventoryItemDescriptionType = create_fhir_type( "InventoryItemDescriptionType", "fhir.resources.inventoryitem.InventoryItemDescription", ) InventoryItemInstanceType = create_fhir_type( "InventoryItemInstanceType", "fhir.resources.inventoryitem.InventoryItemInstance", ) InventoryItemNameType = create_fhir_type( "InventoryItemNameType", "fhir.resources.inventoryitem.InventoryItemName" ) InventoryItemResponsibleOrganizationType = create_fhir_type( "InventoryItemResponsibleOrganizationType", "fhir.resources.inventoryitem.InventoryItemResponsibleOrganization", ) InventoryReportType = create_fhir_type( "InventoryReportType", "fhir.resources.inventoryreport.InventoryReport" ) InventoryReportInventoryListingType = create_fhir_type( "InventoryReportInventoryListingType", "fhir.resources.inventoryreport.InventoryReportInventoryListing", ) InventoryReportInventoryListingItemType = create_fhir_type( "InventoryReportInventoryListingItemType", "fhir.resources.inventoryreport.InventoryReportInventoryListingItem", ) InvoiceType = create_fhir_type("InvoiceType", "fhir.resources.invoice.Invoice") InvoiceLineItemType = create_fhir_type( "InvoiceLineItemType", "fhir.resources.invoice.InvoiceLineItem" ) InvoiceParticipantType = create_fhir_type( "InvoiceParticipantType", "fhir.resources.invoice.InvoiceParticipant" ) LibraryType = create_fhir_type("LibraryType", "fhir.resources.library.Library") LinkageType = create_fhir_type("LinkageType", "fhir.resources.linkage.Linkage") LinkageItemType = create_fhir_type( "LinkageItemType", "fhir.resources.linkage.LinkageItem" ) ListType = create_fhir_type("ListType", "fhir.resources.list.List") ListEntryType = create_fhir_type("ListEntryType", "fhir.resources.list.ListEntry") LocationType = create_fhir_type("LocationType", "fhir.resources.location.Location") LocationPositionType = create_fhir_type( "LocationPositionType", "fhir.resources.location.LocationPosition" ) ManufacturedItemDefinitionType = create_fhir_type( "ManufacturedItemDefinitionType", "fhir.resources.manufactureditemdefinition.ManufacturedItemDefinition", ) ManufacturedItemDefinitionComponentType = create_fhir_type( "ManufacturedItemDefinitionComponentType", "fhir.resources.manufactureditemdefinition.ManufacturedItemDefinitionComponent", ) ManufacturedItemDefinitionComponentConstituentType = create_fhir_type( "ManufacturedItemDefinitionComponentConstituentType", "fhir.resources.manufactureditemdefinition.ManufacturedItemDefinitionComponentConstituent", ) ManufacturedItemDefinitionPropertyType = create_fhir_type( "ManufacturedItemDefinitionPropertyType", "fhir.resources.manufactureditemdefinition.ManufacturedItemDefinitionProperty", ) MarketingStatusType = create_fhir_type( "MarketingStatusType", "fhir.resources.marketingstatus.MarketingStatus" ) MeasureType = create_fhir_type("MeasureType", "fhir.resources.measure.Measure") MeasureGroupType = create_fhir_type( "MeasureGroupType", "fhir.resources.measure.MeasureGroup" ) MeasureGroupPopulationType = create_fhir_type( "MeasureGroupPopulationType", "fhir.resources.measure.MeasureGroupPopulation" ) MeasureGroupStratifierType = create_fhir_type( "MeasureGroupStratifierType", "fhir.resources.measure.MeasureGroupStratifier" ) MeasureGroupStratifierComponentType = create_fhir_type( "MeasureGroupStratifierComponentType", "fhir.resources.measure.MeasureGroupStratifierComponent", ) MeasureReportType = create_fhir_type( "MeasureReportType", "fhir.resources.measurereport.MeasureReport" ) MeasureReportGroupType = create_fhir_type( "MeasureReportGroupType", "fhir.resources.measurereport.MeasureReportGroup" ) MeasureReportGroupPopulationType = create_fhir_type( "MeasureReportGroupPopulationType", "fhir.resources.measurereport.MeasureReportGroupPopulation", ) MeasureReportGroupStratifierType = create_fhir_type( "MeasureReportGroupStratifierType", "fhir.resources.measurereport.MeasureReportGroupStratifier", ) MeasureReportGroupStratifierStratumType = create_fhir_type( "MeasureReportGroupStratifierStratumType", "fhir.resources.measurereport.MeasureReportGroupStratifierStratum", ) MeasureReportGroupStratifierStratumComponentType = create_fhir_type( "MeasureReportGroupStratifierStratumComponentType", "fhir.resources.measurereport.MeasureReportGroupStratifierStratumComponent", ) MeasureReportGroupStratifierStratumPopulationType = create_fhir_type( "MeasureReportGroupStratifierStratumPopulationType", "fhir.resources.measurereport.MeasureReportGroupStratifierStratumPopulation", ) MeasureSupplementalDataType = create_fhir_type( "MeasureSupplementalDataType", "fhir.resources.measure.MeasureSupplementalData" ) MeasureTermType = create_fhir_type( "MeasureTermType", "fhir.resources.measure.MeasureTerm" ) MedicationType = create_fhir_type( "MedicationType", "fhir.resources.medication.Medication" ) MedicationAdministrationType = create_fhir_type( "MedicationAdministrationType", "fhir.resources.medicationadministration.MedicationAdministration", ) MedicationAdministrationDosageType = create_fhir_type( "MedicationAdministrationDosageType", "fhir.resources.medicationadministration.MedicationAdministrationDosage", ) MedicationAdministrationPerformerType = create_fhir_type( "MedicationAdministrationPerformerType", "fhir.resources.medicationadministration.MedicationAdministrationPerformer", ) MedicationBatchType = create_fhir_type( "MedicationBatchType", "fhir.resources.medication.MedicationBatch" ) MedicationDispenseType = create_fhir_type( "MedicationDispenseType", "fhir.resources.medicationdispense.MedicationDispense" ) MedicationDispensePerformerType = create_fhir_type( "MedicationDispensePerformerType", "fhir.resources.medicationdispense.MedicationDispensePerformer", ) MedicationDispenseSubstitutionType = create_fhir_type( "MedicationDispenseSubstitutionType", "fhir.resources.medicationdispense.MedicationDispenseSubstitution", ) MedicationIngredientType = create_fhir_type( "MedicationIngredientType", "fhir.resources.medication.MedicationIngredient" ) MedicationKnowledgeType = create_fhir_type( "MedicationKnowledgeType", "fhir.resources.medicationknowledge.MedicationKnowledge", ) MedicationKnowledgeCostType = create_fhir_type( "MedicationKnowledgeCostType", "fhir.resources.medicationknowledge.MedicationKnowledgeCost", ) MedicationKnowledgeDefinitionalType = create_fhir_type( "MedicationKnowledgeDefinitionalType", "fhir.resources.medicationknowledge.MedicationKnowledgeDefinitional", ) MedicationKnowledgeDefinitionalDrugCharacteristicType = create_fhir_type( "MedicationKnowledgeDefinitionalDrugCharacteristicType", "fhir.resources.medicationknowledge.MedicationKnowledgeDefinitionalDrugCharacteristic", ) MedicationKnowledgeDefinitionalIngredientType = create_fhir_type( "MedicationKnowledgeDefinitionalIngredientType", "fhir.resources.medicationknowledge.MedicationKnowledgeDefinitionalIngredient", ) MedicationKnowledgeIndicationGuidelineType = create_fhir_type( "MedicationKnowledgeIndicationGuidelineType", "fhir.resources.medicationknowledge.MedicationKnowledgeIndicationGuideline", ) MedicationKnowledgeIndicationGuidelineDosingGuidelineType = create_fhir_type( "MedicationKnowledgeIndicationGuidelineDosingGuidelineType", "fhir.resources.medicationknowledge.MedicationKnowledgeIndicationGuidelineDosingGuideline", ) MedicationKnowledgeIndicationGuidelineDosingGuidelineDosageType = create_fhir_type( "MedicationKnowledgeIndicationGuidelineDosingGuidelineDosageType", "fhir.resources.medicationknowledge.MedicationKnowledgeIndicationGuidelineDosingGuidelineDosage", ) MedicationKnowledgeIndicationGuidelineDosingGuidelinePatientCharacteristicType = create_fhir_type( "MedicationKnowledgeIndicationGuidelineDosingGuidelinePatientCharacteristicType", "fhir.resources.medicationknowledge.MedicationKnowledgeIndicationGuidelineDosingGuidelinePatientCharacteristic", ) MedicationKnowledgeMedicineClassificationType = create_fhir_type( "MedicationKnowledgeMedicineClassificationType", "fhir.resources.medicationknowledge.MedicationKnowledgeMedicineClassification", ) MedicationKnowledgeMonitoringProgramType = create_fhir_type( "MedicationKnowledgeMonitoringProgramType", "fhir.resources.medicationknowledge.MedicationKnowledgeMonitoringProgram", ) MedicationKnowledgeMonographType = create_fhir_type( "MedicationKnowledgeMonographType", "fhir.resources.medicationknowledge.MedicationKnowledgeMonograph", ) MedicationKnowledgePackagingType = create_fhir_type( "MedicationKnowledgePackagingType", "fhir.resources.medicationknowledge.MedicationKnowledgePackaging", ) MedicationKnowledgeRegulatoryType = create_fhir_type( "MedicationKnowledgeRegulatoryType", "fhir.resources.medicationknowledge.MedicationKnowledgeRegulatory", ) MedicationKnowledgeRegulatoryMaxDispenseType = create_fhir_type( "MedicationKnowledgeRegulatoryMaxDispenseType", "fhir.resources.medicationknowledge.MedicationKnowledgeRegulatoryMaxDispense", ) MedicationKnowledgeRegulatorySubstitutionType = create_fhir_type( "MedicationKnowledgeRegulatorySubstitutionType", "fhir.resources.medicationknowledge.MedicationKnowledgeRegulatorySubstitution", ) MedicationKnowledgeRelatedMedicationKnowledgeType = create_fhir_type( "MedicationKnowledgeRelatedMedicationKnowledgeType", "fhir.resources.medicationknowledge.MedicationKnowledgeRelatedMedicationKnowledge", ) MedicationKnowledgeStorageGuidelineType = create_fhir_type( "MedicationKnowledgeStorageGuidelineType", "fhir.resources.medicationknowledge.MedicationKnowledgeStorageGuideline", ) MedicationKnowledgeStorageGuidelineEnvironmentalSettingType = create_fhir_type( "MedicationKnowledgeStorageGuidelineEnvironmentalSettingType", "fhir.resources.medicationknowledge.MedicationKnowledgeStorageGuidelineEnvironmentalSetting", ) MedicationRequestType = create_fhir_type( "MedicationRequestType", "fhir.resources.medicationrequest.MedicationRequest" ) MedicationRequestDispenseRequestType = create_fhir_type( "MedicationRequestDispenseRequestType", "fhir.resources.medicationrequest.MedicationRequestDispenseRequest", ) MedicationRequestDispenseRequestInitialFillType = create_fhir_type( "MedicationRequestDispenseRequestInitialFillType", "fhir.resources.medicationrequest.MedicationRequestDispenseRequestInitialFill", ) MedicationRequestSubstitutionType = create_fhir_type( "MedicationRequestSubstitutionType", "fhir.resources.medicationrequest.MedicationRequestSubstitution", ) MedicationStatementType = create_fhir_type( "MedicationStatementType", "fhir.resources.medicationstatement.MedicationStatement", ) MedicationStatementAdherenceType = create_fhir_type( "MedicationStatementAdherenceType", "fhir.resources.medicationstatement.MedicationStatementAdherence", ) MedicinalProductDefinitionType = create_fhir_type( "MedicinalProductDefinitionType", "fhir.resources.medicinalproductdefinition.MedicinalProductDefinition", ) MedicinalProductDefinitionCharacteristicType = create_fhir_type( "MedicinalProductDefinitionCharacteristicType", "fhir.resources.medicinalproductdefinition.MedicinalProductDefinitionCharacteristic", ) MedicinalProductDefinitionContactType = create_fhir_type( "MedicinalProductDefinitionContactType", "fhir.resources.medicinalproductdefinition.MedicinalProductDefinitionContact", ) MedicinalProductDefinitionCrossReferenceType = create_fhir_type( "MedicinalProductDefinitionCrossReferenceType", "fhir.resources.medicinalproductdefinition.MedicinalProductDefinitionCrossReference", ) MedicinalProductDefinitionNameType = create_fhir_type( "MedicinalProductDefinitionNameType", "fhir.resources.medicinalproductdefinition.MedicinalProductDefinitionName", ) MedicinalProductDefinitionNamePartType = create_fhir_type( "MedicinalProductDefinitionNamePartType", "fhir.resources.medicinalproductdefinition.MedicinalProductDefinitionNamePart", ) MedicinalProductDefinitionNameUsageType = create_fhir_type( "MedicinalProductDefinitionNameUsageType", "fhir.resources.medicinalproductdefinition.MedicinalProductDefinitionNameUsage", ) MedicinalProductDefinitionOperationType = create_fhir_type( "MedicinalProductDefinitionOperationType", "fhir.resources.medicinalproductdefinition.MedicinalProductDefinitionOperation", ) MessageDefinitionType = create_fhir_type( "MessageDefinitionType", "fhir.resources.messagedefinition.MessageDefinition" ) MessageDefinitionAllowedResponseType = create_fhir_type( "MessageDefinitionAllowedResponseType", "fhir.resources.messagedefinition.MessageDefinitionAllowedResponse", ) MessageDefinitionFocusType = create_fhir_type( "MessageDefinitionFocusType", "fhir.resources.messagedefinition.MessageDefinitionFocus", ) MessageHeaderType = create_fhir_type( "MessageHeaderType", "fhir.resources.messageheader.MessageHeader" ) MessageHeaderDestinationType = create_fhir_type( "MessageHeaderDestinationType", "fhir.resources.messageheader.MessageHeaderDestination", ) MessageHeaderResponseType = create_fhir_type( "MessageHeaderResponseType", "fhir.resources.messageheader.MessageHeaderResponse", ) MessageHeaderSourceType = create_fhir_type( "MessageHeaderSourceType", "fhir.resources.messageheader.MessageHeaderSource" ) MetaType = create_fhir_type("MetaType", "fhir.resources.meta.Meta") MetadataResourceType = create_fhir_type( "MetadataResourceType", "fhir.resources.metadataresource.MetadataResource" ) MolecularSequenceType = create_fhir_type( "MolecularSequenceType", "fhir.resources.molecularsequence.MolecularSequence" ) MolecularSequenceRelativeType = create_fhir_type( "MolecularSequenceRelativeType", "fhir.resources.molecularsequence.MolecularSequenceRelative", ) MolecularSequenceRelativeEditType = create_fhir_type( "MolecularSequenceRelativeEditType", "fhir.resources.molecularsequence.MolecularSequenceRelativeEdit", ) MolecularSequenceRelativeStartingSequenceType = create_fhir_type( "MolecularSequenceRelativeStartingSequenceType", "fhir.resources.molecularsequence.MolecularSequenceRelativeStartingSequence", ) MonetaryComponentType = create_fhir_type( "MonetaryComponentType", "fhir.resources.monetarycomponent.MonetaryComponent" ) MoneyType = create_fhir_type("MoneyType", "fhir.resources.money.Money") NamingSystemType = create_fhir_type( "NamingSystemType", "fhir.resources.namingsystem.NamingSystem" ) NamingSystemUniqueIdType = create_fhir_type( "NamingSystemUniqueIdType", "fhir.resources.namingsystem.NamingSystemUniqueId" ) NarrativeType = create_fhir_type( "NarrativeType", "fhir.resources.narrative.Narrative" ) NutritionIntakeType = create_fhir_type( "NutritionIntakeType", "fhir.resources.nutritionintake.NutritionIntake" ) NutritionIntakeConsumedItemType = create_fhir_type( "NutritionIntakeConsumedItemType", "fhir.resources.nutritionintake.NutritionIntakeConsumedItem", ) NutritionIntakeIngredientLabelType = create_fhir_type( "NutritionIntakeIngredientLabelType", "fhir.resources.nutritionintake.NutritionIntakeIngredientLabel", ) NutritionIntakePerformerType = create_fhir_type( "NutritionIntakePerformerType", "fhir.resources.nutritionintake.NutritionIntakePerformer", ) NutritionOrderType = create_fhir_type( "NutritionOrderType", "fhir.resources.nutritionorder.NutritionOrder" ) NutritionOrderEnteralFormulaType = create_fhir_type( "NutritionOrderEnteralFormulaType", "fhir.resources.nutritionorder.NutritionOrderEnteralFormula", ) NutritionOrderEnteralFormulaAdditiveType = create_fhir_type( "NutritionOrderEnteralFormulaAdditiveType", "fhir.resources.nutritionorder.NutritionOrderEnteralFormulaAdditive", ) NutritionOrderEnteralFormulaAdministrationType = create_fhir_type( "NutritionOrderEnteralFormulaAdministrationType", "fhir.resources.nutritionorder.NutritionOrderEnteralFormulaAdministration", ) NutritionOrderEnteralFormulaAdministrationScheduleType = create_fhir_type( "NutritionOrderEnteralFormulaAdministrationScheduleType", "fhir.resources.nutritionorder.NutritionOrderEnteralFormulaAdministrationSchedule", ) NutritionOrderOralDietType = create_fhir_type( "NutritionOrderOralDietType", "fhir.resources.nutritionorder.NutritionOrderOralDiet", ) NutritionOrderOralDietNutrientType = create_fhir_type( "NutritionOrderOralDietNutrientType", "fhir.resources.nutritionorder.NutritionOrderOralDietNutrient", ) NutritionOrderOralDietScheduleType = create_fhir_type( "NutritionOrderOralDietScheduleType", "fhir.resources.nutritionorder.NutritionOrderOralDietSchedule", ) NutritionOrderOralDietTextureType = create_fhir_type( "NutritionOrderOralDietTextureType", "fhir.resources.nutritionorder.NutritionOrderOralDietTexture", ) NutritionOrderSupplementType = create_fhir_type( "NutritionOrderSupplementType", "fhir.resources.nutritionorder.NutritionOrderSupplement", ) NutritionOrderSupplementScheduleType = create_fhir_type( "NutritionOrderSupplementScheduleType", "fhir.resources.nutritionorder.NutritionOrderSupplementSchedule", ) NutritionProductType = create_fhir_type( "NutritionProductType", "fhir.resources.nutritionproduct.NutritionProduct" ) NutritionProductCharacteristicType = create_fhir_type( "NutritionProductCharacteristicType", "fhir.resources.nutritionproduct.NutritionProductCharacteristic", ) NutritionProductIngredientType = create_fhir_type( "NutritionProductIngredientType", "fhir.resources.nutritionproduct.NutritionProductIngredient", ) NutritionProductInstanceType = create_fhir_type( "NutritionProductInstanceType", "fhir.resources.nutritionproduct.NutritionProductInstance", ) NutritionProductNutrientType = create_fhir_type( "NutritionProductNutrientType", "fhir.resources.nutritionproduct.NutritionProductNutrient", ) ObservationType = create_fhir_type( "ObservationType", "fhir.resources.observation.Observation" ) ObservationComponentType = create_fhir_type( "ObservationComponentType", "fhir.resources.observation.ObservationComponent" ) ObservationDefinitionType = create_fhir_type( "ObservationDefinitionType", "fhir.resources.observationdefinition.ObservationDefinition", ) ObservationDefinitionComponentType = create_fhir_type( "ObservationDefinitionComponentType", "fhir.resources.observationdefinition.ObservationDefinitionComponent", ) ObservationDefinitionQualifiedValueType = create_fhir_type( "ObservationDefinitionQualifiedValueType", "fhir.resources.observationdefinition.ObservationDefinitionQualifiedValue", ) ObservationReferenceRangeType = create_fhir_type( "ObservationReferenceRangeType", "fhir.resources.observation.ObservationReferenceRange", ) ObservationTriggeredByType = create_fhir_type( "ObservationTriggeredByType", "fhir.resources.observation.ObservationTriggeredBy", ) OperationDefinitionType = create_fhir_type( "OperationDefinitionType", "fhir.resources.operationdefinition.OperationDefinition", ) OperationDefinitionOverloadType = create_fhir_type( "OperationDefinitionOverloadType", "fhir.resources.operationdefinition.OperationDefinitionOverload", ) OperationDefinitionParameterType = create_fhir_type( "OperationDefinitionParameterType", "fhir.resources.operationdefinition.OperationDefinitionParameter", ) OperationDefinitionParameterBindingType = create_fhir_type( "OperationDefinitionParameterBindingType", "fhir.resources.operationdefinition.OperationDefinitionParameterBinding", ) OperationDefinitionParameterReferencedFromType = create_fhir_type( "OperationDefinitionParameterReferencedFromType", "fhir.resources.operationdefinition.OperationDefinitionParameterReferencedFrom", ) OperationOutcomeType = create_fhir_type( "OperationOutcomeType", "fhir.resources.operationoutcome.OperationOutcome" ) OperationOutcomeIssueType = create_fhir_type( "OperationOutcomeIssueType", "fhir.resources.operationoutcome.OperationOutcomeIssue", ) OrganizationType = create_fhir_type( "OrganizationType", "fhir.resources.organization.Organization" ) OrganizationAffiliationType = create_fhir_type( "OrganizationAffiliationType", "fhir.resources.organizationaffiliation.OrganizationAffiliation", ) OrganizationQualificationType = create_fhir_type( "OrganizationQualificationType", "fhir.resources.organization.OrganizationQualification", ) PackagedProductDefinitionType = create_fhir_type( "PackagedProductDefinitionType", "fhir.resources.packagedproductdefinition.PackagedProductDefinition", ) PackagedProductDefinitionLegalStatusOfSupplyType = create_fhir_type( "PackagedProductDefinitionLegalStatusOfSupplyType", "fhir.resources.packagedproductdefinition.PackagedProductDefinitionLegalStatusOfSupply", ) PackagedProductDefinitionPackagingType = create_fhir_type( "PackagedProductDefinitionPackagingType", "fhir.resources.packagedproductdefinition.PackagedProductDefinitionPackaging", ) PackagedProductDefinitionPackagingContainedItemType = create_fhir_type( "PackagedProductDefinitionPackagingContainedItemType", "fhir.resources.packagedproductdefinition.PackagedProductDefinitionPackagingContainedItem", ) PackagedProductDefinitionPackagingPropertyType = create_fhir_type( "PackagedProductDefinitionPackagingPropertyType", "fhir.resources.packagedproductdefinition.PackagedProductDefinitionPackagingProperty", ) ParameterDefinitionType = create_fhir_type( "ParameterDefinitionType", "fhir.resources.parameterdefinition.ParameterDefinition", ) ParametersType = create_fhir_type( "ParametersType", "fhir.resources.parameters.Parameters" ) ParametersParameterType = create_fhir_type( "ParametersParameterType", "fhir.resources.parameters.ParametersParameter" ) PatientType = create_fhir_type("PatientType", "fhir.resources.patient.Patient") PatientCommunicationType = create_fhir_type( "PatientCommunicationType", "fhir.resources.patient.PatientCommunication" ) PatientContactType = create_fhir_type( "PatientContactType", "fhir.resources.patient.PatientContact" ) PatientLinkType = create_fhir_type( "PatientLinkType", "fhir.resources.patient.PatientLink" ) PaymentNoticeType = create_fhir_type( "PaymentNoticeType", "fhir.resources.paymentnotice.PaymentNotice" ) PaymentReconciliationType = create_fhir_type( "PaymentReconciliationType", "fhir.resources.paymentreconciliation.PaymentReconciliation", ) PaymentReconciliationAllocationType = create_fhir_type( "PaymentReconciliationAllocationType", "fhir.resources.paymentreconciliation.PaymentReconciliationAllocation", ) PaymentReconciliationProcessNoteType = create_fhir_type( "PaymentReconciliationProcessNoteType", "fhir.resources.paymentreconciliation.PaymentReconciliationProcessNote", ) PeriodType = create_fhir_type("PeriodType", "fhir.resources.period.Period") PermissionType = create_fhir_type( "PermissionType", "fhir.resources.permission.Permission" ) PermissionJustificationType = create_fhir_type( "PermissionJustificationType", "fhir.resources.permission.PermissionJustification", ) PermissionRuleType = create_fhir_type( "PermissionRuleType", "fhir.resources.permission.PermissionRule" ) PermissionRuleActivityType = create_fhir_type( "PermissionRuleActivityType", "fhir.resources.permission.PermissionRuleActivity" ) PermissionRuleDataType = create_fhir_type( "PermissionRuleDataType", "fhir.resources.permission.PermissionRuleData" ) PermissionRuleDataResourceType = create_fhir_type( "PermissionRuleDataResourceType", "fhir.resources.permission.PermissionRuleDataResource", ) PersonType = create_fhir_type("PersonType", "fhir.resources.person.Person") PersonCommunicationType = create_fhir_type( "PersonCommunicationType", "fhir.resources.person.PersonCommunication" ) PersonLinkType = create_fhir_type( "PersonLinkType", "fhir.resources.person.PersonLink" ) PlanDefinitionType = create_fhir_type( "PlanDefinitionType", "fhir.resources.plandefinition.PlanDefinition" ) PlanDefinitionActionType = create_fhir_type( "PlanDefinitionActionType", "fhir.resources.plandefinition.PlanDefinitionAction" ) PlanDefinitionActionConditionType = create_fhir_type( "PlanDefinitionActionConditionType", "fhir.resources.plandefinition.PlanDefinitionActionCondition", ) PlanDefinitionActionDynamicValueType = create_fhir_type( "PlanDefinitionActionDynamicValueType", "fhir.resources.plandefinition.PlanDefinitionActionDynamicValue", ) PlanDefinitionActionInputType = create_fhir_type( "PlanDefinitionActionInputType", "fhir.resources.plandefinition.PlanDefinitionActionInput", ) PlanDefinitionActionOutputType = create_fhir_type( "PlanDefinitionActionOutputType", "fhir.resources.plandefinition.PlanDefinitionActionOutput", ) PlanDefinitionActionParticipantType = create_fhir_type( "PlanDefinitionActionParticipantType", "fhir.resources.plandefinition.PlanDefinitionActionParticipant", ) PlanDefinitionActionRelatedActionType = create_fhir_type( "PlanDefinitionActionRelatedActionType", "fhir.resources.plandefinition.PlanDefinitionActionRelatedAction", ) PlanDefinitionActorType = create_fhir_type( "PlanDefinitionActorType", "fhir.resources.plandefinition.PlanDefinitionActor" ) PlanDefinitionActorOptionType = create_fhir_type( "PlanDefinitionActorOptionType", "fhir.resources.plandefinition.PlanDefinitionActorOption", ) PlanDefinitionGoalType = create_fhir_type( "PlanDefinitionGoalType", "fhir.resources.plandefinition.PlanDefinitionGoal" ) PlanDefinitionGoalTargetType = create_fhir_type( "PlanDefinitionGoalTargetType", "fhir.resources.plandefinition.PlanDefinitionGoalTarget", ) PractitionerType = create_fhir_type( "PractitionerType", "fhir.resources.practitioner.Practitioner" ) PractitionerCommunicationType = create_fhir_type( "PractitionerCommunicationType", "fhir.resources.practitioner.PractitionerCommunication", ) PractitionerQualificationType = create_fhir_type( "PractitionerQualificationType", "fhir.resources.practitioner.PractitionerQualification", ) PractitionerRoleType = create_fhir_type( "PractitionerRoleType", "fhir.resources.practitionerrole.PractitionerRole" ) PrimitiveTypeType = create_fhir_type( "PrimitiveTypeType", "fhir.resources.primitivetype.PrimitiveType" ) ProcedureType = create_fhir_type( "ProcedureType", "fhir.resources.procedure.Procedure" ) ProcedureFocalDeviceType = create_fhir_type( "ProcedureFocalDeviceType", "fhir.resources.procedure.ProcedureFocalDevice" ) ProcedurePerformerType = create_fhir_type( "ProcedurePerformerType", "fhir.resources.procedure.ProcedurePerformer" ) ProductShelfLifeType = create_fhir_type( "ProductShelfLifeType", "fhir.resources.productshelflife.ProductShelfLife" ) ProvenanceType = create_fhir_type( "ProvenanceType", "fhir.resources.provenance.Provenance" ) ProvenanceAgentType = create_fhir_type( "ProvenanceAgentType", "fhir.resources.provenance.ProvenanceAgent" ) ProvenanceEntityType = create_fhir_type( "ProvenanceEntityType", "fhir.resources.provenance.ProvenanceEntity" ) QuantityType = create_fhir_type("QuantityType", "fhir.resources.quantity.Quantity") QuestionnaireType = create_fhir_type( "QuestionnaireType", "fhir.resources.questionnaire.Questionnaire" ) QuestionnaireItemType = create_fhir_type( "QuestionnaireItemType", "fhir.resources.questionnaire.QuestionnaireItem" ) QuestionnaireItemAnswerOptionType = create_fhir_type( "QuestionnaireItemAnswerOptionType", "fhir.resources.questionnaire.QuestionnaireItemAnswerOption", ) QuestionnaireItemEnableWhenType = create_fhir_type( "QuestionnaireItemEnableWhenType", "fhir.resources.questionnaire.QuestionnaireItemEnableWhen", ) QuestionnaireItemInitialType = create_fhir_type( "QuestionnaireItemInitialType", "fhir.resources.questionnaire.QuestionnaireItemInitial", ) QuestionnaireResponseType = create_fhir_type( "QuestionnaireResponseType", "fhir.resources.questionnaireresponse.QuestionnaireResponse", ) QuestionnaireResponseItemType = create_fhir_type( "QuestionnaireResponseItemType", "fhir.resources.questionnaireresponse.QuestionnaireResponseItem", ) QuestionnaireResponseItemAnswerType = create_fhir_type( "QuestionnaireResponseItemAnswerType", "fhir.resources.questionnaireresponse.QuestionnaireResponseItemAnswer", ) RangeType = create_fhir_type("RangeType", "fhir.resources.range.Range") RatioType = create_fhir_type("RatioType", "fhir.resources.ratio.Ratio") RatioRangeType = create_fhir_type( "RatioRangeType", "fhir.resources.ratiorange.RatioRange" ) ReferenceType = create_fhir_type( "ReferenceType", "fhir.resources.reference.Reference" ) RegulatedAuthorizationType = create_fhir_type( "RegulatedAuthorizationType", "fhir.resources.regulatedauthorization.RegulatedAuthorization", ) RegulatedAuthorizationCaseType = create_fhir_type( "RegulatedAuthorizationCaseType", "fhir.resources.regulatedauthorization.RegulatedAuthorizationCase", ) RelatedArtifactType = create_fhir_type( "RelatedArtifactType", "fhir.resources.relatedartifact.RelatedArtifact" ) RelatedPersonType = create_fhir_type( "RelatedPersonType", "fhir.resources.relatedperson.RelatedPerson" ) RelatedPersonCommunicationType = create_fhir_type( "RelatedPersonCommunicationType", "fhir.resources.relatedperson.RelatedPersonCommunication", ) RequestOrchestrationType = create_fhir_type( "RequestOrchestrationType", "fhir.resources.requestorchestration.RequestOrchestration", ) RequestOrchestrationActionType = create_fhir_type( "RequestOrchestrationActionType", "fhir.resources.requestorchestration.RequestOrchestrationAction", ) RequestOrchestrationActionConditionType = create_fhir_type( "RequestOrchestrationActionConditionType", "fhir.resources.requestorchestration.RequestOrchestrationActionCondition", ) RequestOrchestrationActionDynamicValueType = create_fhir_type( "RequestOrchestrationActionDynamicValueType", "fhir.resources.requestorchestration.RequestOrchestrationActionDynamicValue", ) RequestOrchestrationActionInputType = create_fhir_type( "RequestOrchestrationActionInputType", "fhir.resources.requestorchestration.RequestOrchestrationActionInput", ) RequestOrchestrationActionOutputType = create_fhir_type( "RequestOrchestrationActionOutputType", "fhir.resources.requestorchestration.RequestOrchestrationActionOutput", ) RequestOrchestrationActionParticipantType = create_fhir_type( "RequestOrchestrationActionParticipantType", "fhir.resources.requestorchestration.RequestOrchestrationActionParticipant", ) RequestOrchestrationActionRelatedActionType = create_fhir_type( "RequestOrchestrationActionRelatedActionType", "fhir.resources.requestorchestration.RequestOrchestrationActionRelatedAction", ) RequirementsType = create_fhir_type( "RequirementsType", "fhir.resources.requirements.Requirements" ) RequirementsStatementType = create_fhir_type( "RequirementsStatementType", "fhir.resources.requirements.RequirementsStatement" ) ResearchStudyType = create_fhir_type( "ResearchStudyType", "fhir.resources.researchstudy.ResearchStudy" ) ResearchStudyAssociatedPartyType = create_fhir_type( "ResearchStudyAssociatedPartyType", "fhir.resources.researchstudy.ResearchStudyAssociatedParty", ) ResearchStudyComparisonGroupType = create_fhir_type( "ResearchStudyComparisonGroupType", "fhir.resources.researchstudy.ResearchStudyComparisonGroup", ) ResearchStudyLabelType = create_fhir_type( "ResearchStudyLabelType", "fhir.resources.researchstudy.ResearchStudyLabel" ) ResearchStudyObjectiveType = create_fhir_type( "ResearchStudyObjectiveType", "fhir.resources.researchstudy.ResearchStudyObjective", ) ResearchStudyOutcomeMeasureType = create_fhir_type( "ResearchStudyOutcomeMeasureType", "fhir.resources.researchstudy.ResearchStudyOutcomeMeasure", ) ResearchStudyProgressStatusType = create_fhir_type( "ResearchStudyProgressStatusType", "fhir.resources.researchstudy.ResearchStudyProgressStatus", ) ResearchStudyRecruitmentType = create_fhir_type( "ResearchStudyRecruitmentType", "fhir.resources.researchstudy.ResearchStudyRecruitment", ) ResearchSubjectType = create_fhir_type( "ResearchSubjectType", "fhir.resources.researchsubject.ResearchSubject" ) ResearchSubjectProgressType = create_fhir_type( "ResearchSubjectProgressType", "fhir.resources.researchsubject.ResearchSubjectProgress", ) RiskAssessmentType = create_fhir_type( "RiskAssessmentType", "fhir.resources.riskassessment.RiskAssessment" ) RiskAssessmentPredictionType = create_fhir_type( "RiskAssessmentPredictionType", "fhir.resources.riskassessment.RiskAssessmentPrediction", ) SampledDataType = create_fhir_type( "SampledDataType", "fhir.resources.sampleddata.SampledData" ) ScheduleType = create_fhir_type("ScheduleType", "fhir.resources.schedule.Schedule") SearchParameterType = create_fhir_type( "SearchParameterType", "fhir.resources.searchparameter.SearchParameter" ) SearchParameterComponentType = create_fhir_type( "SearchParameterComponentType", "fhir.resources.searchparameter.SearchParameterComponent", ) ServiceRequestType = create_fhir_type( "ServiceRequestType", "fhir.resources.servicerequest.ServiceRequest" ) ServiceRequestOrderDetailType = create_fhir_type( "ServiceRequestOrderDetailType", "fhir.resources.servicerequest.ServiceRequestOrderDetail", ) ServiceRequestOrderDetailParameterType = create_fhir_type( "ServiceRequestOrderDetailParameterType", "fhir.resources.servicerequest.ServiceRequestOrderDetailParameter", ) ServiceRequestPatientInstructionType = create_fhir_type( "ServiceRequestPatientInstructionType", "fhir.resources.servicerequest.ServiceRequestPatientInstruction", ) SignatureType = create_fhir_type( "SignatureType", "fhir.resources.signature.Signature" ) SlotType = create_fhir_type("SlotType", "fhir.resources.slot.Slot") SpecimenType = create_fhir_type("SpecimenType", "fhir.resources.specimen.Specimen") SpecimenCollectionType = create_fhir_type( "SpecimenCollectionType", "fhir.resources.specimen.SpecimenCollection" ) SpecimenContainerType = create_fhir_type( "SpecimenContainerType", "fhir.resources.specimen.SpecimenContainer" ) SpecimenDefinitionType = create_fhir_type( "SpecimenDefinitionType", "fhir.resources.specimendefinition.SpecimenDefinition" ) SpecimenDefinitionTypeTestedType = create_fhir_type( "SpecimenDefinitionTypeTestedType", "fhir.resources.specimendefinition.SpecimenDefinitionTypeTested", ) SpecimenDefinitionTypeTestedContainerType = create_fhir_type( "SpecimenDefinitionTypeTestedContainerType", "fhir.resources.specimendefinition.SpecimenDefinitionTypeTestedContainer", ) SpecimenDefinitionTypeTestedContainerAdditiveType = create_fhir_type( "SpecimenDefinitionTypeTestedContainerAdditiveType", "fhir.resources.specimendefinition.SpecimenDefinitionTypeTestedContainerAdditive", ) SpecimenDefinitionTypeTestedHandlingType = create_fhir_type( "SpecimenDefinitionTypeTestedHandlingType", "fhir.resources.specimendefinition.SpecimenDefinitionTypeTestedHandling", ) SpecimenFeatureType = create_fhir_type( "SpecimenFeatureType", "fhir.resources.specimen.SpecimenFeature" ) SpecimenProcessingType = create_fhir_type( "SpecimenProcessingType", "fhir.resources.specimen.SpecimenProcessing" ) StructureDefinitionType = create_fhir_type( "StructureDefinitionType", "fhir.resources.structuredefinition.StructureDefinition", ) StructureDefinitionContextType = create_fhir_type( "StructureDefinitionContextType", "fhir.resources.structuredefinition.StructureDefinitionContext", ) StructureDefinitionDifferentialType = create_fhir_type( "StructureDefinitionDifferentialType", "fhir.resources.structuredefinition.StructureDefinitionDifferential", ) StructureDefinitionMappingType = create_fhir_type( "StructureDefinitionMappingType", "fhir.resources.structuredefinition.StructureDefinitionMapping", ) StructureDefinitionSnapshotType = create_fhir_type( "StructureDefinitionSnapshotType", "fhir.resources.structuredefinition.StructureDefinitionSnapshot", ) StructureMapType = create_fhir_type( "StructureMapType", "fhir.resources.structuremap.StructureMap" ) StructureMapConstType = create_fhir_type( "StructureMapConstType", "fhir.resources.structuremap.StructureMapConst" ) StructureMapGroupType = create_fhir_type( "StructureMapGroupType", "fhir.resources.structuremap.StructureMapGroup" ) StructureMapGroupInputType = create_fhir_type( "StructureMapGroupInputType", "fhir.resources.structuremap.StructureMapGroupInput", ) StructureMapGroupRuleType = create_fhir_type( "StructureMapGroupRuleType", "fhir.resources.structuremap.StructureMapGroupRule" ) StructureMapGroupRuleDependentType = create_fhir_type( "StructureMapGroupRuleDependentType", "fhir.resources.structuremap.StructureMapGroupRuleDependent", ) StructureMapGroupRuleSourceType = create_fhir_type( "StructureMapGroupRuleSourceType", "fhir.resources.structuremap.StructureMapGroupRuleSource", ) StructureMapGroupRuleTargetType = create_fhir_type( "StructureMapGroupRuleTargetType", "fhir.resources.structuremap.StructureMapGroupRuleTarget", ) StructureMapGroupRuleTargetParameterType = create_fhir_type( "StructureMapGroupRuleTargetParameterType", "fhir.resources.structuremap.StructureMapGroupRuleTargetParameter", ) StructureMapStructureType = create_fhir_type( "StructureMapStructureType", "fhir.resources.structuremap.StructureMapStructure" ) SubscriptionType = create_fhir_type( "SubscriptionType", "fhir.resources.subscription.Subscription" ) SubscriptionFilterByType = create_fhir_type( "SubscriptionFilterByType", "fhir.resources.subscription.SubscriptionFilterBy" ) SubscriptionParameterType = create_fhir_type( "SubscriptionParameterType", "fhir.resources.subscription.SubscriptionParameter" ) SubscriptionStatusType = create_fhir_type( "SubscriptionStatusType", "fhir.resources.subscriptionstatus.SubscriptionStatus" ) SubscriptionStatusNotificationEventType = create_fhir_type( "SubscriptionStatusNotificationEventType", "fhir.resources.subscriptionstatus.SubscriptionStatusNotificationEvent", ) SubscriptionTopicType = create_fhir_type( "SubscriptionTopicType", "fhir.resources.subscriptiontopic.SubscriptionTopic" ) SubscriptionTopicCanFilterByType = create_fhir_type( "SubscriptionTopicCanFilterByType", "fhir.resources.subscriptiontopic.SubscriptionTopicCanFilterBy", ) SubscriptionTopicEventTriggerType = create_fhir_type( "SubscriptionTopicEventTriggerType", "fhir.resources.subscriptiontopic.SubscriptionTopicEventTrigger", ) SubscriptionTopicNotificationShapeType = create_fhir_type( "SubscriptionTopicNotificationShapeType", "fhir.resources.subscriptiontopic.SubscriptionTopicNotificationShape", ) SubscriptionTopicResourceTriggerType = create_fhir_type( "SubscriptionTopicResourceTriggerType", "fhir.resources.subscriptiontopic.SubscriptionTopicResourceTrigger", ) SubscriptionTopicResourceTriggerQueryCriteriaType = create_fhir_type( "SubscriptionTopicResourceTriggerQueryCriteriaType", "fhir.resources.subscriptiontopic.SubscriptionTopicResourceTriggerQueryCriteria", ) SubstanceType = create_fhir_type( "SubstanceType", "fhir.resources.substance.Substance" ) SubstanceDefinitionType = create_fhir_type( "SubstanceDefinitionType", "fhir.resources.substancedefinition.SubstanceDefinition", ) SubstanceDefinitionCharacterizationType = create_fhir_type( "SubstanceDefinitionCharacterizationType", "fhir.resources.substancedefinition.SubstanceDefinitionCharacterization", ) SubstanceDefinitionCodeType = create_fhir_type( "SubstanceDefinitionCodeType", "fhir.resources.substancedefinition.SubstanceDefinitionCode", ) SubstanceDefinitionMoietyType = create_fhir_type( "SubstanceDefinitionMoietyType", "fhir.resources.substancedefinition.SubstanceDefinitionMoiety", ) SubstanceDefinitionMolecularWeightType = create_fhir_type( "SubstanceDefinitionMolecularWeightType", "fhir.resources.substancedefinition.SubstanceDefinitionMolecularWeight", ) SubstanceDefinitionNameType = create_fhir_type( "SubstanceDefinitionNameType", "fhir.resources.substancedefinition.SubstanceDefinitionName", ) SubstanceDefinitionNameOfficialType = create_fhir_type( "SubstanceDefinitionNameOfficialType", "fhir.resources.substancedefinition.SubstanceDefinitionNameOfficial", ) SubstanceDefinitionPropertyType = create_fhir_type( "SubstanceDefinitionPropertyType", "fhir.resources.substancedefinition.SubstanceDefinitionProperty", ) SubstanceDefinitionRelationshipType = create_fhir_type( "SubstanceDefinitionRelationshipType", "fhir.resources.substancedefinition.SubstanceDefinitionRelationship", ) SubstanceDefinitionSourceMaterialType = create_fhir_type( "SubstanceDefinitionSourceMaterialType", "fhir.resources.substancedefinition.SubstanceDefinitionSourceMaterial", ) SubstanceDefinitionStructureType = create_fhir_type( "SubstanceDefinitionStructureType", "fhir.resources.substancedefinition.SubstanceDefinitionStructure", ) SubstanceDefinitionStructureRepresentationType = create_fhir_type( "SubstanceDefinitionStructureRepresentationType", "fhir.resources.substancedefinition.SubstanceDefinitionStructureRepresentation", ) SubstanceIngredientType = create_fhir_type( "SubstanceIngredientType", "fhir.resources.substance.SubstanceIngredient" ) SubstanceNucleicAcidType = create_fhir_type( "SubstanceNucleicAcidType", "fhir.resources.substancenucleicacid.SubstanceNucleicAcid", ) SubstanceNucleicAcidSubunitType = create_fhir_type( "SubstanceNucleicAcidSubunitType", "fhir.resources.substancenucleicacid.SubstanceNucleicAcidSubunit", ) SubstanceNucleicAcidSubunitLinkageType = create_fhir_type( "SubstanceNucleicAcidSubunitLinkageType", "fhir.resources.substancenucleicacid.SubstanceNucleicAcidSubunitLinkage", ) SubstanceNucleicAcidSubunitSugarType = create_fhir_type( "SubstanceNucleicAcidSubunitSugarType", "fhir.resources.substancenucleicacid.SubstanceNucleicAcidSubunitSugar", ) SubstancePolymerType = create_fhir_type( "SubstancePolymerType", "fhir.resources.substancepolymer.SubstancePolymer" ) SubstancePolymerMonomerSetType = create_fhir_type( "SubstancePolymerMonomerSetType", "fhir.resources.substancepolymer.SubstancePolymerMonomerSet", ) SubstancePolymerMonomerSetStartingMaterialType = create_fhir_type( "SubstancePolymerMonomerSetStartingMaterialType", "fhir.resources.substancepolymer.SubstancePolymerMonomerSetStartingMaterial", ) SubstancePolymerRepeatType = create_fhir_type( "SubstancePolymerRepeatType", "fhir.resources.substancepolymer.SubstancePolymerRepeat", ) SubstancePolymerRepeatRepeatUnitType = create_fhir_type( "SubstancePolymerRepeatRepeatUnitType", "fhir.resources.substancepolymer.SubstancePolymerRepeatRepeatUnit", ) SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationType = create_fhir_type( "SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationType", "fhir.resources.substancepolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisation", ) SubstancePolymerRepeatRepeatUnitStructuralRepresentationType = create_fhir_type( "SubstancePolymerRepeatRepeatUnitStructuralRepresentationType", "fhir.resources.substancepolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentation", ) SubstanceProteinType = create_fhir_type( "SubstanceProteinType", "fhir.resources.substanceprotein.SubstanceProtein" ) SubstanceProteinSubunitType = create_fhir_type( "SubstanceProteinSubunitType", "fhir.resources.substanceprotein.SubstanceProteinSubunit", ) SubstanceReferenceInformationType = create_fhir_type( "SubstanceReferenceInformationType", "fhir.resources.substancereferenceinformation.SubstanceReferenceInformation", ) SubstanceReferenceInformationGeneType = create_fhir_type( "SubstanceReferenceInformationGeneType", "fhir.resources.substancereferenceinformation.SubstanceReferenceInformationGene", ) SubstanceReferenceInformationGeneElementType = create_fhir_type( "SubstanceReferenceInformationGeneElementType", "fhir.resources.substancereferenceinformation.SubstanceReferenceInformationGeneElement", ) SubstanceReferenceInformationTargetType = create_fhir_type( "SubstanceReferenceInformationTargetType", "fhir.resources.substancereferenceinformation.SubstanceReferenceInformationTarget", ) SubstanceSourceMaterialType = create_fhir_type( "SubstanceSourceMaterialType", "fhir.resources.substancesourcematerial.SubstanceSourceMaterial", ) SubstanceSourceMaterialFractionDescriptionType = create_fhir_type( "SubstanceSourceMaterialFractionDescriptionType", "fhir.resources.substancesourcematerial.SubstanceSourceMaterialFractionDescription", ) SubstanceSourceMaterialOrganismType = create_fhir_type( "SubstanceSourceMaterialOrganismType", "fhir.resources.substancesourcematerial.SubstanceSourceMaterialOrganism", ) SubstanceSourceMaterialOrganismAuthorType = create_fhir_type( "SubstanceSourceMaterialOrganismAuthorType", "fhir.resources.substancesourcematerial.SubstanceSourceMaterialOrganismAuthor", ) SubstanceSourceMaterialOrganismHybridType = create_fhir_type( "SubstanceSourceMaterialOrganismHybridType", "fhir.resources.substancesourcematerial.SubstanceSourceMaterialOrganismHybrid", ) SubstanceSourceMaterialOrganismOrganismGeneralType = create_fhir_type( "SubstanceSourceMaterialOrganismOrganismGeneralType", "fhir.resources.substancesourcematerial.SubstanceSourceMaterialOrganismOrganismGeneral", ) SubstanceSourceMaterialPartDescriptionType = create_fhir_type( "SubstanceSourceMaterialPartDescriptionType", "fhir.resources.substancesourcematerial.SubstanceSourceMaterialPartDescription", ) SupplyDeliveryType = create_fhir_type( "SupplyDeliveryType", "fhir.resources.supplydelivery.SupplyDelivery" ) SupplyDeliverySuppliedItemType = create_fhir_type( "SupplyDeliverySuppliedItemType", "fhir.resources.supplydelivery.SupplyDeliverySuppliedItem", ) SupplyRequestType = create_fhir_type( "SupplyRequestType", "fhir.resources.supplyrequest.SupplyRequest" ) SupplyRequestParameterType = create_fhir_type( "SupplyRequestParameterType", "fhir.resources.supplyrequest.SupplyRequestParameter", ) TaskType = create_fhir_type("TaskType", "fhir.resources.task.Task") TaskInputType = create_fhir_type("TaskInputType", "fhir.resources.task.TaskInput") TaskOutputType = create_fhir_type( "TaskOutputType", "fhir.resources.task.TaskOutput" ) TaskPerformerType = create_fhir_type( "TaskPerformerType", "fhir.resources.task.TaskPerformer" ) TaskRestrictionType = create_fhir_type( "TaskRestrictionType", "fhir.resources.task.TaskRestriction" ) TerminologyCapabilitiesType = create_fhir_type( "TerminologyCapabilitiesType", "fhir.resources.terminologycapabilities.TerminologyCapabilities", ) TerminologyCapabilitiesClosureType = create_fhir_type( "TerminologyCapabilitiesClosureType", "fhir.resources.terminologycapabilities.TerminologyCapabilitiesClosure", ) TerminologyCapabilitiesCodeSystemType = create_fhir_type( "TerminologyCapabilitiesCodeSystemType", "fhir.resources.terminologycapabilities.TerminologyCapabilitiesCodeSystem", ) TerminologyCapabilitiesCodeSystemVersionType = create_fhir_type( "TerminologyCapabilitiesCodeSystemVersionType", "fhir.resources.terminologycapabilities.TerminologyCapabilitiesCodeSystemVersion", ) TerminologyCapabilitiesCodeSystemVersionFilterType = create_fhir_type( "TerminologyCapabilitiesCodeSystemVersionFilterType", "fhir.resources.terminologycapabilities.TerminologyCapabilitiesCodeSystemVersionFilter", ) TerminologyCapabilitiesExpansionType = create_fhir_type( "TerminologyCapabilitiesExpansionType", "fhir.resources.terminologycapabilities.TerminologyCapabilitiesExpansion", ) TerminologyCapabilitiesExpansionParameterType = create_fhir_type( "TerminologyCapabilitiesExpansionParameterType", "fhir.resources.terminologycapabilities.TerminologyCapabilitiesExpansionParameter", ) TerminologyCapabilitiesImplementationType = create_fhir_type( "TerminologyCapabilitiesImplementationType", "fhir.resources.terminologycapabilities.TerminologyCapabilitiesImplementation", ) TerminologyCapabilitiesSoftwareType = create_fhir_type( "TerminologyCapabilitiesSoftwareType", "fhir.resources.terminologycapabilities.TerminologyCapabilitiesSoftware", ) TerminologyCapabilitiesTranslationType = create_fhir_type( "TerminologyCapabilitiesTranslationType", "fhir.resources.terminologycapabilities.TerminologyCapabilitiesTranslation", ) TerminologyCapabilitiesValidateCodeType = create_fhir_type( "TerminologyCapabilitiesValidateCodeType", "fhir.resources.terminologycapabilities.TerminologyCapabilitiesValidateCode", ) TestPlanType = create_fhir_type("TestPlanType", "fhir.resources.testplan.TestPlan") TestPlanDependencyType = create_fhir_type( "TestPlanDependencyType", "fhir.resources.testplan.TestPlanDependency" ) TestPlanTestCaseType = create_fhir_type( "TestPlanTestCaseType", "fhir.resources.testplan.TestPlanTestCase" ) TestPlanTestCaseAssertionType = create_fhir_type( "TestPlanTestCaseAssertionType", "fhir.resources.testplan.TestPlanTestCaseAssertion", ) TestPlanTestCaseDependencyType = create_fhir_type( "TestPlanTestCaseDependencyType", "fhir.resources.testplan.TestPlanTestCaseDependency", ) TestPlanTestCaseTestDataType = create_fhir_type( "TestPlanTestCaseTestDataType", "fhir.resources.testplan.TestPlanTestCaseTestData", ) TestPlanTestCaseTestRunType = create_fhir_type( "TestPlanTestCaseTestRunType", "fhir.resources.testplan.TestPlanTestCaseTestRun" ) TestPlanTestCaseTestRunScriptType = create_fhir_type( "TestPlanTestCaseTestRunScriptType", "fhir.resources.testplan.TestPlanTestCaseTestRunScript", ) TestReportType = create_fhir_type( "TestReportType", "fhir.resources.testreport.TestReport" ) TestReportParticipantType = create_fhir_type( "TestReportParticipantType", "fhir.resources.testreport.TestReportParticipant" ) TestReportSetupType = create_fhir_type( "TestReportSetupType", "fhir.resources.testreport.TestReportSetup" ) TestReportSetupActionType = create_fhir_type( "TestReportSetupActionType", "fhir.resources.testreport.TestReportSetupAction" ) TestReportSetupActionAssertType = create_fhir_type( "TestReportSetupActionAssertType", "fhir.resources.testreport.TestReportSetupActionAssert", ) TestReportSetupActionAssertRequirementType = create_fhir_type( "TestReportSetupActionAssertRequirementType", "fhir.resources.testreport.TestReportSetupActionAssertRequirement", ) TestReportSetupActionOperationType = create_fhir_type( "TestReportSetupActionOperationType", "fhir.resources.testreport.TestReportSetupActionOperation", ) TestReportTeardownType = create_fhir_type( "TestReportTeardownType", "fhir.resources.testreport.TestReportTeardown" ) TestReportTeardownActionType = create_fhir_type( "TestReportTeardownActionType", "fhir.resources.testreport.TestReportTeardownAction", ) TestReportTestType = create_fhir_type( "TestReportTestType", "fhir.resources.testreport.TestReportTest" ) TestReportTestActionType = create_fhir_type( "TestReportTestActionType", "fhir.resources.testreport.TestReportTestAction" ) TestScriptType = create_fhir_type( "TestScriptType", "fhir.resources.testscript.TestScript" ) TestScriptDestinationType = create_fhir_type( "TestScriptDestinationType", "fhir.resources.testscript.TestScriptDestination" ) TestScriptFixtureType = create_fhir_type( "TestScriptFixtureType", "fhir.resources.testscript.TestScriptFixture" ) TestScriptMetadataType = create_fhir_type( "TestScriptMetadataType", "fhir.resources.testscript.TestScriptMetadata" ) TestScriptMetadataCapabilityType = create_fhir_type( "TestScriptMetadataCapabilityType", "fhir.resources.testscript.TestScriptMetadataCapability", ) TestScriptMetadataLinkType = create_fhir_type( "TestScriptMetadataLinkType", "fhir.resources.testscript.TestScriptMetadataLink" ) TestScriptOriginType = create_fhir_type( "TestScriptOriginType", "fhir.resources.testscript.TestScriptOrigin" ) TestScriptScopeType = create_fhir_type( "TestScriptScopeType", "fhir.resources.testscript.TestScriptScope" ) TestScriptSetupType = create_fhir_type( "TestScriptSetupType", "fhir.resources.testscript.TestScriptSetup" ) TestScriptSetupActionType = create_fhir_type( "TestScriptSetupActionType", "fhir.resources.testscript.TestScriptSetupAction" ) TestScriptSetupActionAssertType = create_fhir_type( "TestScriptSetupActionAssertType", "fhir.resources.testscript.TestScriptSetupActionAssert", ) TestScriptSetupActionAssertRequirementType = create_fhir_type( "TestScriptSetupActionAssertRequirementType", "fhir.resources.testscript.TestScriptSetupActionAssertRequirement", ) TestScriptSetupActionOperationType = create_fhir_type( "TestScriptSetupActionOperationType", "fhir.resources.testscript.TestScriptSetupActionOperation", ) TestScriptSetupActionOperationRequestHeaderType = create_fhir_type( "TestScriptSetupActionOperationRequestHeaderType", "fhir.resources.testscript.TestScriptSetupActionOperationRequestHeader", ) TestScriptTeardownType = create_fhir_type( "TestScriptTeardownType", "fhir.resources.testscript.TestScriptTeardown" ) TestScriptTeardownActionType = create_fhir_type( "TestScriptTeardownActionType", "fhir.resources.testscript.TestScriptTeardownAction", ) TestScriptTestType = create_fhir_type( "TestScriptTestType", "fhir.resources.testscript.TestScriptTest" ) TestScriptTestActionType = create_fhir_type( "TestScriptTestActionType", "fhir.resources.testscript.TestScriptTestAction" ) TestScriptVariableType = create_fhir_type( "TestScriptVariableType", "fhir.resources.testscript.TestScriptVariable" ) TimingType = create_fhir_type("TimingType", "fhir.resources.timing.Timing") TimingRepeatType = create_fhir_type( "TimingRepeatType", "fhir.resources.timing.TimingRepeat" ) TransportType = create_fhir_type( "TransportType", "fhir.resources.transport.Transport" ) TransportInputType = create_fhir_type( "TransportInputType", "fhir.resources.transport.TransportInput" ) TransportOutputType = create_fhir_type( "TransportOutputType", "fhir.resources.transport.TransportOutput" ) TransportRestrictionType = create_fhir_type( "TransportRestrictionType", "fhir.resources.transport.TransportRestriction" ) TriggerDefinitionType = create_fhir_type( "TriggerDefinitionType", "fhir.resources.triggerdefinition.TriggerDefinition" ) UsageContextType = create_fhir_type( "UsageContextType", "fhir.resources.usagecontext.UsageContext" ) ValueSetType = create_fhir_type("ValueSetType", "fhir.resources.valueset.ValueSet") ValueSetComposeType = create_fhir_type( "ValueSetComposeType", "fhir.resources.valueset.ValueSetCompose" ) ValueSetComposeIncludeType = create_fhir_type( "ValueSetComposeIncludeType", "fhir.resources.valueset.ValueSetComposeInclude" ) ValueSetComposeIncludeConceptType = create_fhir_type( "ValueSetComposeIncludeConceptType", "fhir.resources.valueset.ValueSetComposeIncludeConcept", ) ValueSetComposeIncludeConceptDesignationType = create_fhir_type( "ValueSetComposeIncludeConceptDesignationType", "fhir.resources.valueset.ValueSetComposeIncludeConceptDesignation", ) ValueSetComposeIncludeFilterType = create_fhir_type( "ValueSetComposeIncludeFilterType", "fhir.resources.valueset.ValueSetComposeIncludeFilter", ) ValueSetExpansionType = create_fhir_type( "ValueSetExpansionType", "fhir.resources.valueset.ValueSetExpansion" ) ValueSetExpansionContainsType = create_fhir_type( "ValueSetExpansionContainsType", "fhir.resources.valueset.ValueSetExpansionContains", ) ValueSetExpansionContainsPropertyType = create_fhir_type( "ValueSetExpansionContainsPropertyType", "fhir.resources.valueset.ValueSetExpansionContainsProperty", ) ValueSetExpansionContainsPropertySubPropertyType = create_fhir_type( "ValueSetExpansionContainsPropertySubPropertyType", "fhir.resources.valueset.ValueSetExpansionContainsPropertySubProperty", ) ValueSetExpansionParameterType = create_fhir_type( "ValueSetExpansionParameterType", "fhir.resources.valueset.ValueSetExpansionParameter", ) ValueSetExpansionPropertyType = create_fhir_type( "ValueSetExpansionPropertyType", "fhir.resources.valueset.ValueSetExpansionProperty", ) ValueSetScopeType = create_fhir_type( "ValueSetScopeType", "fhir.resources.valueset.ValueSetScope" ) VerificationResultType = create_fhir_type( "VerificationResultType", "fhir.resources.verificationresult.VerificationResult" ) VerificationResultAttestationType = create_fhir_type( "VerificationResultAttestationType", "fhir.resources.verificationresult.VerificationResultAttestation", ) VerificationResultPrimarySourceType = create_fhir_type( "VerificationResultPrimarySourceType", "fhir.resources.verificationresult.VerificationResultPrimarySource", ) VerificationResultValidatorType = create_fhir_type( "VerificationResultValidatorType", "fhir.resources.verificationresult.VerificationResultValidator", ) VirtualServiceDetailType = create_fhir_type( "VirtualServiceDetailType", "fhir.resources.virtualservicedetail.VirtualServiceDetail", ) VisionPrescriptionType = create_fhir_type( "VisionPrescriptionType", "fhir.resources.visionprescription.VisionPrescription" ) VisionPrescriptionLensSpecificationType = create_fhir_type( "VisionPrescriptionLensSpecificationType", "fhir.resources.visionprescription.VisionPrescriptionLensSpecification", ) VisionPrescriptionLensSpecificationPrismType = create_fhir_type( "VisionPrescriptionLensSpecificationPrismType", "fhir.resources.visionprescription.VisionPrescriptionLensSpecificationPrism", ) __all__ = [ "BooleanType", "StringType", "Base64BinaryType", "CodeType", "IdType", "IntegerType", "Integer64Type", "DecimalType", "UnsignedIntType", "PositiveIntType", "CanonicalType", "UriType", "OidType", "UuidType", "UrlType", "MarkdownType", "XhtmlType", "DateType", "DateTimeType", "InstantType", "TimeType", "FHIRPrimitiveExtensionType", "AccountType", "AccountBalanceType", "AccountCoverageType", "AccountDiagnosisType", "AccountGuarantorType", "AccountProcedureType", "AccountRelatedAccountType", "ActivityDefinitionType", "ActivityDefinitionDynamicValueType", "ActivityDefinitionParticipantType", "ActorDefinitionType", "AddressType", "AdministrableProductDefinitionType", "AdministrableProductDefinitionPropertyType", "AdministrableProductDefinitionRouteOfAdministrationType", "AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesType", "AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodType", "AdverseEventType", "AdverseEventContributingFactorType", "AdverseEventMitigatingActionType", "AdverseEventParticipantType", "AdverseEventPreventiveActionType", "AdverseEventSupportingInfoType", "AdverseEventSuspectEntityType", "AdverseEventSuspectEntityCausalityType", "AgeType", "AllergyIntoleranceType", "AllergyIntoleranceParticipantType", "AllergyIntoleranceReactionType", "AnnotationType", "AppointmentType", "AppointmentParticipantType", "AppointmentRecurrenceTemplateType", "AppointmentRecurrenceTemplateMonthlyTemplateType", "AppointmentRecurrenceTemplateWeeklyTemplateType", "AppointmentRecurrenceTemplateYearlyTemplateType", "AppointmentResponseType", "ArtifactAssessmentType", "ArtifactAssessmentContentType", "AttachmentType", "AuditEventType", "AuditEventAgentType", "AuditEventEntityType", "AuditEventEntityDetailType", "AuditEventOutcomeType", "AuditEventSourceType", "AvailabilityType", "AvailabilityAvailableTimeType", "AvailabilityNotAvailableTimeType", "BackboneElementType", "BackboneTypeType", "BaseType", "BasicType", "BinaryType", "BiologicallyDerivedProductType", "BiologicallyDerivedProductCollectionType", "BiologicallyDerivedProductDispenseType", "BiologicallyDerivedProductDispensePerformerType", "BiologicallyDerivedProductPropertyType", "BodyStructureType", "BodyStructureIncludedStructureType", "BodyStructureIncludedStructureBodyLandmarkOrientationType", "BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmarkType", "BundleType", "BundleEntryType", "BundleEntryRequestType", "BundleEntryResponseType", "BundleEntrySearchType", "BundleLinkType", "CanonicalResourceType", "CapabilityStatementType", "CapabilityStatementDocumentType", "CapabilityStatementImplementationType", "CapabilityStatementMessagingType", "CapabilityStatementMessagingEndpointType", "CapabilityStatementMessagingSupportedMessageType", "CapabilityStatementRestType", "CapabilityStatementRestInteractionType", "CapabilityStatementRestResourceType", "CapabilityStatementRestResourceInteractionType", "CapabilityStatementRestResourceOperationType", "CapabilityStatementRestResourceSearchParamType", "CapabilityStatementRestSecurityType", "CapabilityStatementSoftwareType", "CarePlanType", "CarePlanActivityType", "CareTeamType", "CareTeamParticipantType", "ChargeItemType", "ChargeItemDefinitionType", "ChargeItemDefinitionApplicabilityType", "ChargeItemDefinitionPropertyGroupType", "ChargeItemPerformerType", "CitationType", "CitationCitedArtifactType", "CitationCitedArtifactAbstractType", "CitationCitedArtifactClassificationType", "CitationCitedArtifactContributorshipType", "CitationCitedArtifactContributorshipEntryType", "CitationCitedArtifactContributorshipEntryContributionInstanceType", "CitationCitedArtifactContributorshipSummaryType", "CitationCitedArtifactPartType", "CitationCitedArtifactPublicationFormType", "CitationCitedArtifactPublicationFormPublishedInType", "CitationCitedArtifactRelatesToType", "CitationCitedArtifactStatusDateType", "CitationCitedArtifactTitleType", "CitationCitedArtifactVersionType", "CitationCitedArtifactWebLocationType", "CitationClassificationType", "CitationStatusDateType", "CitationSummaryType", "ClaimType", "ClaimAccidentType", "ClaimCareTeamType", "ClaimDiagnosisType", "ClaimEventType", "ClaimInsuranceType", "ClaimItemType", "ClaimItemBodySiteType", "ClaimItemDetailType", "ClaimItemDetailSubDetailType", "ClaimPayeeType", "ClaimProcedureType", "ClaimRelatedType", "ClaimResponseType", "ClaimResponseAddItemType", "ClaimResponseAddItemBodySiteType", "ClaimResponseAddItemDetailType", "ClaimResponseAddItemDetailSubDetailType", "ClaimResponseErrorType", "ClaimResponseEventType", "ClaimResponseInsuranceType", "ClaimResponseItemType", "ClaimResponseItemAdjudicationType", "ClaimResponseItemDetailType", "ClaimResponseItemDetailSubDetailType", "ClaimResponseItemReviewOutcomeType", "ClaimResponsePaymentType", "ClaimResponseProcessNoteType", "ClaimResponseTotalType", "ClaimSupportingInfoType", "ClinicalImpressionType", "ClinicalImpressionFindingType", "ClinicalUseDefinitionType", "ClinicalUseDefinitionContraindicationType", "ClinicalUseDefinitionContraindicationOtherTherapyType", "ClinicalUseDefinitionIndicationType", "ClinicalUseDefinitionInteractionType", "ClinicalUseDefinitionInteractionInteractantType", "ClinicalUseDefinitionUndesirableEffectType", "ClinicalUseDefinitionWarningType", "CodeSystemType", "CodeSystemConceptType", "CodeSystemConceptDesignationType", "CodeSystemConceptPropertyType", "CodeSystemFilterType", "CodeSystemPropertyType", "CodeableConceptType", "CodeableReferenceType", "CodingType", "CommunicationType", "CommunicationPayloadType", "CommunicationRequestType", "CommunicationRequestPayloadType", "CompartmentDefinitionType", "CompartmentDefinitionResourceType", "CompositionType", "CompositionAttesterType", "CompositionEventType", "CompositionSectionType", "ConceptMapType", "ConceptMapAdditionalAttributeType", "ConceptMapGroupType", "ConceptMapGroupElementType", "ConceptMapGroupElementTargetType", "ConceptMapGroupElementTargetDependsOnType", "ConceptMapGroupElementTargetPropertyType", "ConceptMapGroupUnmappedType", "ConceptMapPropertyType", "ConditionType", "ConditionDefinitionType", "ConditionDefinitionMedicationType", "ConditionDefinitionObservationType", "ConditionDefinitionPlanType", "ConditionDefinitionPreconditionType", "ConditionDefinitionQuestionnaireType", "ConditionParticipantType", "ConditionStageType", "ConsentType", "ConsentPolicyBasisType", "ConsentProvisionType", "ConsentProvisionActorType", "ConsentProvisionDataType", "ConsentVerificationType", "ContactDetailType", "ContactPointType", "ContractType", "ContractContentDefinitionType", "ContractFriendlyType", "ContractLegalType", "ContractRuleType", "ContractSignerType", "ContractTermType", "ContractTermActionType", "ContractTermActionSubjectType", "ContractTermAssetType", "ContractTermAssetContextType", "ContractTermAssetValuedItemType", "ContractTermOfferType", "ContractTermOfferAnswerType", "ContractTermOfferPartyType", "ContractTermSecurityLabelType", "ContributorType", "CountType", "CoverageType", "CoverageClassType", "CoverageCostToBeneficiaryType", "CoverageCostToBeneficiaryExceptionType", "CoverageEligibilityRequestType", "CoverageEligibilityRequestEventType", "CoverageEligibilityRequestInsuranceType", "CoverageEligibilityRequestItemType", "CoverageEligibilityRequestItemDiagnosisType", "CoverageEligibilityRequestSupportingInfoType", "CoverageEligibilityResponseType", "CoverageEligibilityResponseErrorType", "CoverageEligibilityResponseEventType", "CoverageEligibilityResponseInsuranceType", "CoverageEligibilityResponseInsuranceItemType", "CoverageEligibilityResponseInsuranceItemBenefitType", "CoveragePaymentByType", "DataRequirementType", "DataRequirementCodeFilterType", "DataRequirementDateFilterType", "DataRequirementSortType", "DataRequirementValueFilterType", "DataTypeType", "DetectedIssueType", "DetectedIssueEvidenceType", "DetectedIssueMitigationType", "DeviceType", "DeviceAssociationType", "DeviceAssociationOperationType", "DeviceConformsToType", "DeviceDefinitionType", "DeviceDefinitionChargeItemType", "DeviceDefinitionClassificationType", "DeviceDefinitionConformsToType", "DeviceDefinitionCorrectiveActionType", "DeviceDefinitionDeviceNameType", "DeviceDefinitionGuidelineType", "DeviceDefinitionHasPartType", "DeviceDefinitionLinkType", "DeviceDefinitionMaterialType", "DeviceDefinitionPackagingType", "DeviceDefinitionPackagingDistributorType", "DeviceDefinitionPropertyType", "DeviceDefinitionRegulatoryIdentifierType", "DeviceDefinitionUdiDeviceIdentifierType", "DeviceDefinitionUdiDeviceIdentifierMarketDistributionType", "DeviceDefinitionVersionType", "DeviceDispenseType", "DeviceDispensePerformerType", "DeviceMetricType", "DeviceMetricCalibrationType", "DeviceNameType", "DevicePropertyType", "DeviceRequestType", "DeviceRequestParameterType", "DeviceUdiCarrierType", "DeviceUsageType", "DeviceUsageAdherenceType", "DeviceVersionType", "DiagnosticReportType", "DiagnosticReportMediaType", "DiagnosticReportSupportingInfoType", "DistanceType", "DocumentReferenceType", "DocumentReferenceAttesterType", "DocumentReferenceContentType", "DocumentReferenceContentProfileType", "DocumentReferenceRelatesToType", "DomainResourceType", "DosageType", "DosageDoseAndRateType", "DurationType", "ElementType", "ElementDefinitionType", "ElementDefinitionBaseType", "ElementDefinitionBindingType", "ElementDefinitionBindingAdditionalType", "ElementDefinitionConstraintType", "ElementDefinitionExampleType", "ElementDefinitionMappingType", "ElementDefinitionSlicingType", "ElementDefinitionSlicingDiscriminatorType", "ElementDefinitionTypeType", "EncounterType", "EncounterAdmissionType", "EncounterDiagnosisType", "EncounterHistoryType", "EncounterHistoryLocationType", "EncounterLocationType", "EncounterParticipantType", "EncounterReasonType", "EndpointType", "EndpointPayloadType", "EnrollmentRequestType", "EnrollmentResponseType", "EpisodeOfCareType", "EpisodeOfCareDiagnosisType", "EpisodeOfCareReasonType", "EpisodeOfCareStatusHistoryType", "EventDefinitionType", "EvidenceType", "EvidenceCertaintyType", "EvidenceReportType", "EvidenceReportRelatesToType", "EvidenceReportRelatesToTargetType", "EvidenceReportSectionType", "EvidenceReportSubjectType", "EvidenceReportSubjectCharacteristicType", "EvidenceStatisticType", "EvidenceStatisticAttributeEstimateType", "EvidenceStatisticModelCharacteristicType", "EvidenceStatisticModelCharacteristicVariableType", "EvidenceStatisticSampleSizeType", "EvidenceVariableType", "EvidenceVariableCategoryType", "EvidenceVariableCharacteristicType", "EvidenceVariableCharacteristicDefinitionByCombinationType", "EvidenceVariableCharacteristicDefinitionByTypeAndValueType", "EvidenceVariableCharacteristicTimeFromEventType", "EvidenceVariableDefinitionType", "ExampleScenarioType", "ExampleScenarioActorType", "ExampleScenarioInstanceType", "ExampleScenarioInstanceContainedInstanceType", "ExampleScenarioInstanceVersionType", "ExampleScenarioProcessType", "ExampleScenarioProcessStepType", "ExampleScenarioProcessStepAlternativeType", "ExampleScenarioProcessStepOperationType", "ExplanationOfBenefitType", "ExplanationOfBenefitAccidentType", "ExplanationOfBenefitAddItemType", "ExplanationOfBenefitAddItemBodySiteType", "ExplanationOfBenefitAddItemDetailType", "ExplanationOfBenefitAddItemDetailSubDetailType", "ExplanationOfBenefitBenefitBalanceType", "ExplanationOfBenefitBenefitBalanceFinancialType", "ExplanationOfBenefitCareTeamType", "ExplanationOfBenefitDiagnosisType", "ExplanationOfBenefitEventType", "ExplanationOfBenefitInsuranceType", "ExplanationOfBenefitItemType", "ExplanationOfBenefitItemAdjudicationType", "ExplanationOfBenefitItemBodySiteType", "ExplanationOfBenefitItemDetailType", "ExplanationOfBenefitItemDetailSubDetailType", "ExplanationOfBenefitItemReviewOutcomeType", "ExplanationOfBenefitPayeeType", "ExplanationOfBenefitPaymentType", "ExplanationOfBenefitProcedureType", "ExplanationOfBenefitProcessNoteType", "ExplanationOfBenefitRelatedType", "ExplanationOfBenefitSupportingInfoType", "ExplanationOfBenefitTotalType", "ExpressionType", "ExtendedContactDetailType", "ExtensionType", "FamilyMemberHistoryType", "FamilyMemberHistoryConditionType", "FamilyMemberHistoryParticipantType", "FamilyMemberHistoryProcedureType", "FlagType", "FormularyItemType", "GenomicStudyType", "GenomicStudyAnalysisType", "GenomicStudyAnalysisDeviceType", "GenomicStudyAnalysisInputType", "GenomicStudyAnalysisOutputType", "GenomicStudyAnalysisPerformerType", "GoalType", "GoalTargetType", "GraphDefinitionType", "GraphDefinitionLinkType", "GraphDefinitionLinkCompartmentType", "GraphDefinitionNodeType", "GroupType", "GroupCharacteristicType", "GroupMemberType", "GuidanceResponseType", "HealthcareServiceType", "HealthcareServiceEligibilityType", "HumanNameType", "IdentifierType", "ImagingSelectionType", "ImagingSelectionInstanceType", "ImagingSelectionInstanceImageRegion2DType", "ImagingSelectionInstanceImageRegion3DType", "ImagingSelectionPerformerType", "ImagingStudyType", "ImagingStudySeriesType", "ImagingStudySeriesInstanceType", "ImagingStudySeriesPerformerType", "ImmunizationType", "ImmunizationEvaluationType", "ImmunizationPerformerType", "ImmunizationProgramEligibilityType", "ImmunizationProtocolAppliedType", "ImmunizationReactionType", "ImmunizationRecommendationType", "ImmunizationRecommendationRecommendationType", "ImmunizationRecommendationRecommendationDateCriterionType", "ImplementationGuideType", "ImplementationGuideDefinitionType", "ImplementationGuideDefinitionGroupingType", "ImplementationGuideDefinitionPageType", "ImplementationGuideDefinitionParameterType", "ImplementationGuideDefinitionResourceType", "ImplementationGuideDefinitionTemplateType", "ImplementationGuideDependsOnType", "ImplementationGuideGlobalType", "ImplementationGuideManifestType", "ImplementationGuideManifestPageType", "ImplementationGuideManifestResourceType", "IngredientType", "IngredientManufacturerType", "IngredientSubstanceType", "IngredientSubstanceStrengthType", "IngredientSubstanceStrengthReferenceStrengthType", "InsurancePlanType", "InsurancePlanCoverageType", "InsurancePlanCoverageBenefitType", "InsurancePlanCoverageBenefitLimitType", "InsurancePlanPlanType", "InsurancePlanPlanGeneralCostType", "InsurancePlanPlanSpecificCostType", "InsurancePlanPlanSpecificCostBenefitType", "InsurancePlanPlanSpecificCostBenefitCostType", "InventoryItemType", "InventoryItemAssociationType", "InventoryItemCharacteristicType", "InventoryItemDescriptionType", "InventoryItemInstanceType", "InventoryItemNameType", "InventoryItemResponsibleOrganizationType", "InventoryReportType", "InventoryReportInventoryListingType", "InventoryReportInventoryListingItemType", "InvoiceType", "InvoiceLineItemType", "InvoiceParticipantType", "LibraryType", "LinkageType", "LinkageItemType", "ListType", "ListEntryType", "LocationType", "LocationPositionType", "ManufacturedItemDefinitionType", "ManufacturedItemDefinitionComponentType", "ManufacturedItemDefinitionComponentConstituentType", "ManufacturedItemDefinitionPropertyType", "MarketingStatusType", "MeasureType", "MeasureGroupType", "MeasureGroupPopulationType", "MeasureGroupStratifierType", "MeasureGroupStratifierComponentType", "MeasureReportType", "MeasureReportGroupType", "MeasureReportGroupPopulationType", "MeasureReportGroupStratifierType", "MeasureReportGroupStratifierStratumType", "MeasureReportGroupStratifierStratumComponentType", "MeasureReportGroupStratifierStratumPopulationType", "MeasureSupplementalDataType", "MeasureTermType", "MedicationType", "MedicationAdministrationType", "MedicationAdministrationDosageType", "MedicationAdministrationPerformerType", "MedicationBatchType", "MedicationDispenseType", "MedicationDispensePerformerType", "MedicationDispenseSubstitutionType", "MedicationIngredientType", "MedicationKnowledgeType", "MedicationKnowledgeCostType", "MedicationKnowledgeDefinitionalType", "MedicationKnowledgeDefinitionalDrugCharacteristicType", "MedicationKnowledgeDefinitionalIngredientType", "MedicationKnowledgeIndicationGuidelineType", "MedicationKnowledgeIndicationGuidelineDosingGuidelineType", "MedicationKnowledgeIndicationGuidelineDosingGuidelineDosageType", "MedicationKnowledgeIndicationGuidelineDosingGuidelinePatientCharacteristicType", "MedicationKnowledgeMedicineClassificationType", "MedicationKnowledgeMonitoringProgramType", "MedicationKnowledgeMonographType", "MedicationKnowledgePackagingType", "MedicationKnowledgeRegulatoryType", "MedicationKnowledgeRegulatoryMaxDispenseType", "MedicationKnowledgeRegulatorySubstitutionType", "MedicationKnowledgeRelatedMedicationKnowledgeType", "MedicationKnowledgeStorageGuidelineType", "MedicationKnowledgeStorageGuidelineEnvironmentalSettingType", "MedicationRequestType", "MedicationRequestDispenseRequestType", "MedicationRequestDispenseRequestInitialFillType", "MedicationRequestSubstitutionType", "MedicationStatementType", "MedicationStatementAdherenceType", "MedicinalProductDefinitionType", "MedicinalProductDefinitionCharacteristicType", "MedicinalProductDefinitionContactType", "MedicinalProductDefinitionCrossReferenceType", "MedicinalProductDefinitionNameType", "MedicinalProductDefinitionNamePartType", "MedicinalProductDefinitionNameUsageType", "MedicinalProductDefinitionOperationType", "MessageDefinitionType", "MessageDefinitionAllowedResponseType", "MessageDefinitionFocusType", "MessageHeaderType", "MessageHeaderDestinationType", "MessageHeaderResponseType", "MessageHeaderSourceType", "MetaType", "MetadataResourceType", "MolecularSequenceType", "MolecularSequenceRelativeType", "MolecularSequenceRelativeEditType", "MolecularSequenceRelativeStartingSequenceType", "MonetaryComponentType", "MoneyType", "NamingSystemType", "NamingSystemUniqueIdType", "NarrativeType", "NutritionIntakeType", "NutritionIntakeConsumedItemType", "NutritionIntakeIngredientLabelType", "NutritionIntakePerformerType", "NutritionOrderType", "NutritionOrderEnteralFormulaType", "NutritionOrderEnteralFormulaAdditiveType", "NutritionOrderEnteralFormulaAdministrationType", "NutritionOrderEnteralFormulaAdministrationScheduleType", "NutritionOrderOralDietType", "NutritionOrderOralDietNutrientType", "NutritionOrderOralDietScheduleType", "NutritionOrderOralDietTextureType", "NutritionOrderSupplementType", "NutritionOrderSupplementScheduleType", "NutritionProductType", "NutritionProductCharacteristicType", "NutritionProductIngredientType", "NutritionProductInstanceType", "NutritionProductNutrientType", "ObservationType", "ObservationComponentType", "ObservationDefinitionType", "ObservationDefinitionComponentType", "ObservationDefinitionQualifiedValueType", "ObservationReferenceRangeType", "ObservationTriggeredByType", "OperationDefinitionType", "OperationDefinitionOverloadType", "OperationDefinitionParameterType", "OperationDefinitionParameterBindingType", "OperationDefinitionParameterReferencedFromType", "OperationOutcomeType", "OperationOutcomeIssueType", "OrganizationType", "OrganizationAffiliationType", "OrganizationQualificationType", "PackagedProductDefinitionType", "PackagedProductDefinitionLegalStatusOfSupplyType", "PackagedProductDefinitionPackagingType", "PackagedProductDefinitionPackagingContainedItemType", "PackagedProductDefinitionPackagingPropertyType", "ParameterDefinitionType", "ParametersType", "ParametersParameterType", "PatientType", "PatientCommunicationType", "PatientContactType", "PatientLinkType", "PaymentNoticeType", "PaymentReconciliationType", "PaymentReconciliationAllocationType", "PaymentReconciliationProcessNoteType", "PeriodType", "PermissionType", "PermissionJustificationType", "PermissionRuleType", "PermissionRuleActivityType", "PermissionRuleDataType", "PermissionRuleDataResourceType", "PersonType", "PersonCommunicationType", "PersonLinkType", "PlanDefinitionType", "PlanDefinitionActionType", "PlanDefinitionActionConditionType", "PlanDefinitionActionDynamicValueType", "PlanDefinitionActionInputType", "PlanDefinitionActionOutputType", "PlanDefinitionActionParticipantType", "PlanDefinitionActionRelatedActionType", "PlanDefinitionActorType", "PlanDefinitionActorOptionType", "PlanDefinitionGoalType", "PlanDefinitionGoalTargetType", "PractitionerType", "PractitionerCommunicationType", "PractitionerQualificationType", "PractitionerRoleType", "PrimitiveTypeType", "ProcedureType", "ProcedureFocalDeviceType", "ProcedurePerformerType", "ProductShelfLifeType", "ProvenanceType", "ProvenanceAgentType", "ProvenanceEntityType", "QuantityType", "QuestionnaireType", "QuestionnaireItemType", "QuestionnaireItemAnswerOptionType", "QuestionnaireItemEnableWhenType", "QuestionnaireItemInitialType", "QuestionnaireResponseType", "QuestionnaireResponseItemType", "QuestionnaireResponseItemAnswerType", "RangeType", "RatioType", "RatioRangeType", "ReferenceType", "RegulatedAuthorizationType", "RegulatedAuthorizationCaseType", "RelatedArtifactType", "RelatedPersonType", "RelatedPersonCommunicationType", "RequestOrchestrationType", "RequestOrchestrationActionType", "RequestOrchestrationActionConditionType", "RequestOrchestrationActionDynamicValueType", "RequestOrchestrationActionInputType", "RequestOrchestrationActionOutputType", "RequestOrchestrationActionParticipantType", "RequestOrchestrationActionRelatedActionType", "RequirementsType", "RequirementsStatementType", "ResearchStudyType", "ResearchStudyAssociatedPartyType", "ResearchStudyComparisonGroupType", "ResearchStudyLabelType", "ResearchStudyObjectiveType", "ResearchStudyOutcomeMeasureType", "ResearchStudyProgressStatusType", "ResearchStudyRecruitmentType", "ResearchSubjectType", "ResearchSubjectProgressType", "ResourceType", "RiskAssessmentType", "RiskAssessmentPredictionType", "SampledDataType", "ScheduleType", "SearchParameterType", "SearchParameterComponentType", "ServiceRequestType", "ServiceRequestOrderDetailType", "ServiceRequestOrderDetailParameterType", "ServiceRequestPatientInstructionType", "SignatureType", "SlotType", "SpecimenType", "SpecimenCollectionType", "SpecimenContainerType", "SpecimenDefinitionType", "SpecimenDefinitionTypeTestedType", "SpecimenDefinitionTypeTestedContainerType", "SpecimenDefinitionTypeTestedContainerAdditiveType", "SpecimenDefinitionTypeTestedHandlingType", "SpecimenFeatureType", "SpecimenProcessingType", "StructureDefinitionType", "StructureDefinitionContextType", "StructureDefinitionDifferentialType", "StructureDefinitionMappingType", "StructureDefinitionSnapshotType", "StructureMapType", "StructureMapConstType", "StructureMapGroupType", "StructureMapGroupInputType", "StructureMapGroupRuleType", "StructureMapGroupRuleDependentType", "StructureMapGroupRuleSourceType", "StructureMapGroupRuleTargetType", "StructureMapGroupRuleTargetParameterType", "StructureMapStructureType", "SubscriptionType", "SubscriptionFilterByType", "SubscriptionParameterType", "SubscriptionStatusType", "SubscriptionStatusNotificationEventType", "SubscriptionTopicType", "SubscriptionTopicCanFilterByType", "SubscriptionTopicEventTriggerType", "SubscriptionTopicNotificationShapeType", "SubscriptionTopicResourceTriggerType", "SubscriptionTopicResourceTriggerQueryCriteriaType", "SubstanceType", "SubstanceDefinitionType", "SubstanceDefinitionCharacterizationType", "SubstanceDefinitionCodeType", "SubstanceDefinitionMoietyType", "SubstanceDefinitionMolecularWeightType", "SubstanceDefinitionNameType", "SubstanceDefinitionNameOfficialType", "SubstanceDefinitionPropertyType", "SubstanceDefinitionRelationshipType", "SubstanceDefinitionSourceMaterialType", "SubstanceDefinitionStructureType", "SubstanceDefinitionStructureRepresentationType", "SubstanceIngredientType", "SubstanceNucleicAcidType", "SubstanceNucleicAcidSubunitType", "SubstanceNucleicAcidSubunitLinkageType", "SubstanceNucleicAcidSubunitSugarType", "SubstancePolymerType", "SubstancePolymerMonomerSetType", "SubstancePolymerMonomerSetStartingMaterialType", "SubstancePolymerRepeatType", "SubstancePolymerRepeatRepeatUnitType", "SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationType", "SubstancePolymerRepeatRepeatUnitStructuralRepresentationType", "SubstanceProteinType", "SubstanceProteinSubunitType", "SubstanceReferenceInformationType", "SubstanceReferenceInformationGeneType", "SubstanceReferenceInformationGeneElementType", "SubstanceReferenceInformationTargetType", "SubstanceSourceMaterialType", "SubstanceSourceMaterialFractionDescriptionType", "SubstanceSourceMaterialOrganismType", "SubstanceSourceMaterialOrganismAuthorType", "SubstanceSourceMaterialOrganismHybridType", "SubstanceSourceMaterialOrganismOrganismGeneralType", "SubstanceSourceMaterialPartDescriptionType", "SupplyDeliveryType", "SupplyDeliverySuppliedItemType", "SupplyRequestType", "SupplyRequestParameterType", "TaskType", "TaskInputType", "TaskOutputType", "TaskPerformerType", "TaskRestrictionType", "TerminologyCapabilitiesType", "TerminologyCapabilitiesClosureType", "TerminologyCapabilitiesCodeSystemType", "TerminologyCapabilitiesCodeSystemVersionType", "TerminologyCapabilitiesCodeSystemVersionFilterType", "TerminologyCapabilitiesExpansionType", "TerminologyCapabilitiesExpansionParameterType", "TerminologyCapabilitiesImplementationType", "TerminologyCapabilitiesSoftwareType", "TerminologyCapabilitiesTranslationType", "TerminologyCapabilitiesValidateCodeType", "TestPlanType", "TestPlanDependencyType", "TestPlanTestCaseType", "TestPlanTestCaseAssertionType", "TestPlanTestCaseDependencyType", "TestPlanTestCaseTestDataType", "TestPlanTestCaseTestRunType", "TestPlanTestCaseTestRunScriptType", "TestReportType", "TestReportParticipantType", "TestReportSetupType", "TestReportSetupActionType", "TestReportSetupActionAssertType", "TestReportSetupActionAssertRequirementType", "TestReportSetupActionOperationType", "TestReportTeardownType", "TestReportTeardownActionType", "TestReportTestType", "TestReportTestActionType", "TestScriptType", "TestScriptDestinationType", "TestScriptFixtureType", "TestScriptMetadataType", "TestScriptMetadataCapabilityType", "TestScriptMetadataLinkType", "TestScriptOriginType", "TestScriptScopeType", "TestScriptSetupType", "TestScriptSetupActionType", "TestScriptSetupActionAssertType", "TestScriptSetupActionAssertRequirementType", "TestScriptSetupActionOperationType", "TestScriptSetupActionOperationRequestHeaderType", "TestScriptTeardownType", "TestScriptTeardownActionType", "TestScriptTestType", "TestScriptTestActionType", "TestScriptVariableType", "TimingType", "TimingRepeatType", "TransportType", "TransportInputType", "TransportOutputType", "TransportRestrictionType", "TriggerDefinitionType", "UsageContextType", "ValueSetType", "ValueSetComposeType", "ValueSetComposeIncludeType", "ValueSetComposeIncludeConceptType", "ValueSetComposeIncludeConceptDesignationType", "ValueSetComposeIncludeFilterType", "ValueSetExpansionType", "ValueSetExpansionContainsType", "ValueSetExpansionContainsPropertyType", "ValueSetExpansionContainsPropertySubPropertyType", "ValueSetExpansionParameterType", "ValueSetExpansionPropertyType", "ValueSetScopeType", "VerificationResultType", "VerificationResultAttestationType", "VerificationResultPrimarySourceType", "VerificationResultValidatorType", "VirtualServiceDetailType", "VisionPrescriptionType", "VisionPrescriptionLensSpecificationType", "VisionPrescriptionLensSpecificationPrismType", ] ================================================ FILE: fhir/resources/flag.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Flag Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class Flag(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Key information to flag to healthcare providers. Prospective warnings of potential issues when providing care to the patient. """ __resource_type__ = "Flag" author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="Flag creator", description="The person, organization or device that created the flag.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Organization", "Patient", "RelatedPerson", "Practitioner", "PractitionerRole", ], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Clinical, administrative, etc", description=( "Allows a flag to be divided into different categories like clinical, " "administrative etc. Intended to be used as a means of filtering which " "flags are displayed to particular user or in a given context." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Coded or textual message to display to user", description=( "The coded value or textual component of the flag to display to the " "user." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Alert relevant during encounter", description="This alert is only relevant during the encounter.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description=( "Business identifiers assigned to this flag by the performer or other " "systems which remain constant as the resource is updated and " "propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period when flag is active", description=( "The period of time from the activation of the flag to inactivation of " "the flag. If the flag is active, the end of the period should be " "unspecified." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | inactive | entered-in-error", description="Supports basic workflow.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "inactive", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who/What is flag about?", description=( "The patient, related person, location, group, organization, or " "practitioner etc. this is about record this flag is associated with." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "RelatedPerson", "Location", "Group", "Organization", "Practitioner", "PractitionerRole", "PlanDefinition", "Medication", "Procedure", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Flag`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "category", "code", "subject", "period", "encounter", "author", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Flag`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "category", "code", "subject", "period", "encounter", "author", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields ================================================ FILE: fhir/resources/formularyitem.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/FormularyItem Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class FormularyItem(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of a FormularyItem. This resource describes a product or service that is available through a program and includes the conditions and constraints of availability. All of the information in this resource is specific to the inclusion of the item in the formulary and is not inherent to the item itself. """ __resource_type__ = "FormularyItem" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Codes that identify this formulary item", description=( "A code (or set of codes) that specify the product or service that is " "identified by this formulary item." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier for this formulary item", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | entered-in-error | inactive", description=( "The validity about the information of the formulary item and not of " "the underlying product or service itself." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "entered-in-error", "inactive"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``FormularyItem`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "code", "status", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``FormularyItem`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "code", "status", ] ================================================ FILE: fhir/resources/genomicstudy.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/GenomicStudy Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class GenomicStudy(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Genomic Study. A GenomicStudy is a set of analyses performed to analyze and generate genomic data. """ __resource_type__ = "GenomicStudy" analysis: typing.List[fhirtypes.GenomicStudyAnalysisType] | None = Field( default=None, alias="analysis", title="Genomic Analysis Event", description=( "The details about a specific analysis that was performed in this " "GenomicStudy." ), json_schema_extra={ "element_property": True, }, ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Event resources that the genomic study is based on", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ServiceRequest", "Task"], }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Description of the genomic study", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="The healthcare event with which this genomics study is associated", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifiers for this genomic study", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="instantiatesCanonical", title="The defined protocol that describes the study", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["PlanDefinition"], }, ) instantiatesCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesUri: fhirtypes.UriType | None = Field( default=None, alias="instantiatesUri", title=( "The URL pointing to an externally maintained protocol that describes " "the study" ), description=None, json_schema_extra={ "element_property": True, }, ) instantiatesUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) interpreter: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="interpreter", title="Healthcare professionals who interpreted the genomic study", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments related to the genomic study", description=None, json_schema_extra={ "element_property": True, }, ) reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="reason", title="Why the genomic study was performed", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "Observation"], }, ) referrer: fhirtypes.ReferenceType | None = Field( default=None, alias="referrer", title="Healthcare professional who requested or referred the genomic study", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) startDate: fhirtypes.DateTimeType | None = Field( default=None, alias="startDate", title="When the genomic study was started", description=None, json_schema_extra={ "element_property": True, }, ) startDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_startDate", title="Extension field for ``startDate``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="registered | available | cancelled | entered-in-error | unknown", description="The status of the genomic study.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "registered", "available", "cancelled", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="The primary subject of the genomic study", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Group", "Substance", "BiologicallyDerivedProduct", "NutritionProduct", ], }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title=( "The type of the study (e.g., Familial variant segregation, Functional " "variation detection, or Gene expression profiling)" ), description=( "The type of the study, e.g., Familial variant segregation, Functional " "variation detection, or Gene expression profiling." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GenomicStudy`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "type", "subject", "encounter", "startDate", "basedOn", "referrer", "interpreter", "reason", "instantiatesCanonical", "instantiatesUri", "note", "description", "analysis", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GenomicStudy`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "type", "subject", "encounter", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class GenomicStudyAnalysis(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Genomic Analysis Event. The details about a specific analysis that was performed in this GenomicStudy. """ __resource_type__ = "GenomicStudyAnalysis" changeType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="changeType", title=( "Type of the genomic changes studied in the analysis (e.g., DNA, RNA, " "or AA change)" ), description=( "Type of the genomic changes studied in the analysis, e.g., DNA, RNA, " "or amino acid change." ), json_schema_extra={ "element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="The date of the analysis event", description=None, json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) device: typing.List[fhirtypes.GenomicStudyAnalysisDeviceType] | None = Field( default=None, alias="device", title=( "Devices used for the analysis (e.g., instruments, software), with " "settings and parameters" ), description=None, json_schema_extra={ "element_property": True, }, ) focus: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="focus", title=( "What the genomic analysis is about, when it is not about the subject " "of record" ), description=( "The focus of a genomic analysis when it is not the patient of record " "representing something or someone associated with the patient such as " "a spouse, parent, child, or sibling. For example, in trio testing, the" " GenomicStudy.subject would be the child (proband) and the " "GenomicStudy.analysis.focus of a specific analysis would be the " "parent." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) genomeBuild: fhirtypes.CodeableConceptType | None = Field( default=None, alias="genomeBuild", title="Genome build that is used in this analysis", description="The reference genome build that is used in this analysis.", json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifiers for the analysis event", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) input: typing.List[fhirtypes.GenomicStudyAnalysisInputType] | None = Field( default=None, alias="input", title="Inputs for the analysis event", description=None, json_schema_extra={ "element_property": True, }, ) instantiatesCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="instantiatesCanonical", title="The defined protocol that describes the analysis", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["PlanDefinition", "ActivityDefinition"], }, ) instantiatesCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesUri: fhirtypes.UriType | None = Field( default=None, alias="instantiatesUri", title=( "The URL pointing to an externally maintained protocol that describes " "the analysis" ), description=None, json_schema_extra={ "element_property": True, }, ) instantiatesUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) methodType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="methodType", title=( "Type of the methods used in the analysis (e.g., FISH, Karyotyping, " "MSI)" ), description=( "Type of the methods used in the analysis, e.g., Fluorescence in situ " "hybridization (FISH), Karyotyping, or Microsatellite instability " "testing (MSI)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Any notes capture with the analysis event", description=None, json_schema_extra={ "element_property": True, }, ) output: typing.List[fhirtypes.GenomicStudyAnalysisOutputType] | None = Field( default=None, alias="output", title="Outputs for the analysis event", description=None, json_schema_extra={ "element_property": True, }, ) performer: typing.List[fhirtypes.GenomicStudyAnalysisPerformerType] | None = Field( default=None, alias="performer", title="Performer for the analysis event", description=None, json_schema_extra={ "element_property": True, }, ) protocolPerformed: fhirtypes.ReferenceType | None = Field( default=None, alias="protocolPerformed", title="The protocol that was performed for the analysis event", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Procedure", "Task"], }, ) regionsCalled: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="regionsCalled", title="Genomic regions actually called in the analysis event (BED file)", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference", "Observation"], }, ) regionsStudied: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="regionsStudied", title="The genomic regions to be studied in the analysis (BED file)", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference", "Observation"], }, ) specimen: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="specimen", title="The specimen used in the analysis event", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Specimen"], }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name of the analysis event (human friendly)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GenomicStudyAnalysis`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "methodType", "changeType", "genomeBuild", "instantiatesCanonical", "instantiatesUri", "title", "focus", "specimen", "date", "note", "protocolPerformed", "regionsStudied", "regionsCalled", "input", "output", "performer", "device", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GenomicStudyAnalysis`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "identifier", "methodType", "title", "focus", "specimen", ] class GenomicStudyAnalysisDevice(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Devices used for the analysis (e.g., instruments, software), with settings and parameters. """ __resource_type__ = "GenomicStudyAnalysisDevice" device: fhirtypes.ReferenceType | None = Field( default=None, alias="device", title="Device used for the analysis", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="Specific function for the device used for the analysis", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GenomicStudyAnalysisDevice`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "device", "function"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GenomicStudyAnalysisDevice`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class GenomicStudyAnalysisInput(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Inputs for the analysis event. """ __resource_type__ = "GenomicStudyAnalysisInput" file: fhirtypes.ReferenceType | None = Field( default=None, alias="file", title="File containing input data", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) generatedByIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="generatedByIdentifier", title=( "The analysis event or other GenomicStudy that generated this input " "file" ), description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e generatedBy[x] "one_of_many": "generatedBy", "one_of_many_required": False, }, ) generatedByReference: fhirtypes.ReferenceType | None = Field( default=None, alias="generatedByReference", title=( "The analysis event or other GenomicStudy that generated this input " "file" ), description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e generatedBy[x] "one_of_many": "generatedBy", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["GenomicStudy"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Type of input data (e.g., BAM, CRAM, or FASTA)", description="Type of input data, e.g., BAM, CRAM, or FASTA.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GenomicStudyAnalysisInput`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "file", "type", "generatedByIdentifier", "generatedByReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GenomicStudyAnalysisInput`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "file"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "generatedBy": ["generatedByIdentifier", "generatedByReference"] } return one_of_many_fields class GenomicStudyAnalysisOutput(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Outputs for the analysis event. """ __resource_type__ = "GenomicStudyAnalysisOutput" file: fhirtypes.ReferenceType | None = Field( default=None, alias="file", title="File containing output data", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Type of output data (e.g., VCF, MAF, or BAM)", description="Type of output data, e.g., VCF, MAF, or BAM.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GenomicStudyAnalysisOutput`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "file", "type"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GenomicStudyAnalysisOutput`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "file", "type"] class GenomicStudyAnalysisPerformer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Performer for the analysis event. """ __resource_type__ = "GenomicStudyAnalysisPerformer" actor: fhirtypes.ReferenceType | None = Field( default=None, alias="actor", title=( "The organization, healthcare professional, or others who participated " "in performing this analysis" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Device", ], }, ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="Role of the actor for this analysis", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GenomicStudyAnalysisPerformer`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "actor", "role"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GenomicStudyAnalysisPerformer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/goal.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Goal Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Goal(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Describes the intended objective(s) for a patient, group or organization. Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc. """ __resource_type__ = "Goal" achievementStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="achievementStatus", title=( "in-progress | improving | worsening | no-change | achieved | " "sustaining | not-achieved | no-progress | not-attainable" ), description=( "Describes the progression, or lack thereof, towards the goal against " "the target." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) addresses: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="addresses", title="Issues addressed by this goal", description=( "The identified conditions and other health record elements that are " "intended to be addressed by the goal." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "MedicationStatement", "MedicationRequest", "NutritionOrder", "ServiceRequest", "RiskAssessment", "Procedure", ], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="E.g. Treatment, dietary, behavioral, etc", description="Indicates a category the goal falls within.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) continuous: bool | None = Field( default=None, alias="continuous", title=( "After meeting the goal, ongoing activity is needed to sustain the goal" " objective" ), description=None, json_schema_extra={ "element_property": True, }, ) continuous__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_continuous", title="Extension field for ``continuous``." ) description: fhirtypes.CodeableConceptType = Field( default=..., alias="description", title="Code or text describing goal", description=( "Human-readable and/or coded description of a specific desired " 'objective of care, such as "control blood pressure" or "negotiate an ' 'obstacle course" or "dance with child at wedding".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Ids for this goal", description=( "Business identifiers assigned to this goal by the performer or other " "systems which remain constant as the resource is updated and " "propagates from server to server." ), json_schema_extra={ "element_property": True, }, ) lifecycleStatus: fhirtypes.CodeType | None = Field( default=None, alias="lifecycleStatus", title=( "proposed | planned | accepted | active | on-hold | completed | " "cancelled | entered-in-error | rejected" ), description="The state of the goal throughout its lifecycle.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "proposed", "planned", "accepted", "active", "on-hold", "completed", "cancelled", "entered-in-error", "rejected", ], }, ) lifecycleStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lifecycleStatus", title="Extension field for ``lifecycleStatus``.", ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments about the goal", description="Any comments related to the goal.", json_schema_extra={ "element_property": True, }, ) outcome: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="outcome", title="What result was achieved regarding the goal?", description=( "Identifies the change (or lack of change) at the point when the status" " of the goal is assessed." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Observation"], }, ) priority: fhirtypes.CodeableConceptType | None = Field( default=None, alias="priority", title="high-priority | medium-priority | low-priority", description=( "Identifies the mutually agreed level of importance associated with " "reaching/sustaining the goal." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) source: fhirtypes.ReferenceType | None = Field( default=None, alias="source", title="Who's responsible for creating Goal?", description="Indicates whose goal this is - patient goal, practitioner goal, etc.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "CareTeam", ], }, ) startCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="startCodeableConcept", title="When goal pursuit begins", description="The date or event after which the goal should begin being pursued.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e start[x] "one_of_many": "start", "one_of_many_required": False, }, ) startDate: fhirtypes.DateType | None = Field( default=None, alias="startDate", title="When goal pursuit begins", description="The date or event after which the goal should begin being pursued.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e start[x] "one_of_many": "start", "one_of_many_required": False, }, ) startDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_startDate", title="Extension field for ``startDate``." ) statusDate: fhirtypes.DateType | None = Field( default=None, alias="statusDate", title="When goal status took effect", description=( "Identifies when the current status. I.e. When initially created, when" " achieved, when cancelled, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_statusDate", title="Extension field for ``statusDate``." ) statusReason: fhirtypes.StringType | None = Field( default=None, alias="statusReason", title="Reason for current status", description="Captures the reason for the current status.", json_schema_extra={ "element_property": True, }, ) statusReason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_statusReason", title="Extension field for ``statusReason``.", ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who this goal is intended for", description=( "Identifies the patient, group or organization for whom the goal is " "being established." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group", "Organization"], }, ) target: typing.List[fhirtypes.GoalTargetType] | None = Field( default=None, alias="target", title="Target outcome for the goal", description="Indicates what should be done by when.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Goal`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "lifecycleStatus", "achievementStatus", "category", "continuous", "priority", "description", "subject", "startDate", "startCodeableConcept", "target", "statusDate", "statusReason", "source", "addresses", "note", "outcome", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Goal`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "lifecycleStatus", "achievementStatus", "category", "priority", "description", "subject", "startDate", "startCodeableConcept", "statusDate", "source", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("lifecycleStatus", "lifecycleStatus__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"start": ["startCodeableConcept", "startDate"]} return one_of_many_fields class GoalTarget(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Target outcome for the goal. Indicates what should be done by when. """ __resource_type__ = "GoalTarget" detailBoolean: bool | None = Field( default=None, alias="detailBoolean", title="The target value to be achieved", description=( "The target value of the focus to be achieved to signify the " "fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low" " or both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any focus value at " "or below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any focus value at or above the" " low value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detailBoolean", title="Extension field for ``detailBoolean``.", ) detailCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="detailCodeableConcept", title="The target value to be achieved", description=( "The target value of the focus to be achieved to signify the " "fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low" " or both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any focus value at " "or below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any focus value at or above the" " low value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailInteger: fhirtypes.IntegerType | None = Field( default=None, alias="detailInteger", title="The target value to be achieved", description=( "The target value of the focus to be achieved to signify the " "fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low" " or both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any focus value at " "or below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any focus value at or above the" " low value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detailInteger", title="Extension field for ``detailInteger``.", ) detailQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="detailQuantity", title="The target value to be achieved", description=( "The target value of the focus to be achieved to signify the " "fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low" " or both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any focus value at " "or below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any focus value at or above the" " low value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailRange: fhirtypes.RangeType | None = Field( default=None, alias="detailRange", title="The target value to be achieved", description=( "The target value of the focus to be achieved to signify the " "fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low" " or both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any focus value at " "or below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any focus value at or above the" " low value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailRatio: fhirtypes.RatioType | None = Field( default=None, alias="detailRatio", title="The target value to be achieved", description=( "The target value of the focus to be achieved to signify the " "fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low" " or both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any focus value at " "or below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any focus value at or above the" " low value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailString: fhirtypes.StringType | None = Field( default=None, alias="detailString", title="The target value to be achieved", description=( "The target value of the focus to be achieved to signify the " "fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low" " or both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any focus value at " "or below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any focus value at or above the" " low value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detailString", title="Extension field for ``detailString``.", ) dueDate: fhirtypes.DateType | None = Field( default=None, alias="dueDate", title="Reach goal on or before", description=( "Indicates either the date or the duration after start by which the " "goal should be met." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e due[x] "one_of_many": "due", "one_of_many_required": False, }, ) dueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dueDate", title="Extension field for ``dueDate``." ) dueDuration: fhirtypes.DurationType | None = Field( default=None, alias="dueDuration", title="Reach goal on or before", description=( "Indicates either the date or the duration after start by which the " "goal should be met." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e due[x] "one_of_many": "due", "one_of_many_required": False, }, ) measure: fhirtypes.CodeableConceptType | None = Field( default=None, alias="measure", title="The parameter whose value is being tracked", description=( "The parameter whose value is being tracked, e.g. body weight, blood " "pressure, or hemoglobin A1c level." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GoalTarget`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "measure", "detailQuantity", "detailRange", "detailCodeableConcept", "detailString", "detailBoolean", "detailInteger", "detailRatio", "dueDate", "dueDuration", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GoalTarget`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "measure", "detailQuantity", "detailRange", "detailCodeableConcept", "detailString", "detailBoolean", "detailInteger", "detailRatio", "dueDate", "dueDuration", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "detail": [ "detailBoolean", "detailCodeableConcept", "detailInteger", "detailQuantity", "detailRange", "detailRatio", "detailString", ], "due": ["dueDate", "dueDuration"], } return one_of_many_fields ================================================ FILE: fhir/resources/graphdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/GraphDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class GraphDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of a graph of resources. A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set. """ __resource_type__ = "GraphDefinition" contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the graph definition and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the graph definition." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the graph definition was last " "significantly changed. The date must change when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the graph definition " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the graph definition", description=( "A free text natural language description of the graph definition from " "a consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this graph definition is authored for" " testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the GraphDefinition (business identifier)", description=( "A formal identifier that is used to identify this GraphDefinition when" " it is represented in other formats, or referenced in a specification," " model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for graph definition (if applicable)", description=( "A legal or geographic region in which the graph definition is intended" " to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) link: typing.List[fhirtypes.GraphDefinitionLinkType] | None = Field( default=None, alias="link", title="Links this graph makes rules about", description=None, json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this graph definition (computer friendly)", description=( "A natural language name identifying the graph definition. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) node: typing.List[fhirtypes.GraphDefinitionNodeType] | None = Field( default=None, alias="node", title="Potential target for the link", description=None, json_schema_extra={ "element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the graph definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this graph definition is defined", description=( "Explanation of why this graph definition is needed and why it has been" " designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) start: fhirtypes.IdType | None = Field( default=None, alias="start", title="Starting Node", description=( "The Node at which instances of this graph start. If there is no " "nominated start, the graph can start at any of the nodes." ), json_schema_extra={ "element_property": True, }, ) start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_start", title="Extension field for ``start``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this graph definition. Enables tracking the life-cycle " "of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this graph definition (human friendly)", description=( "A short, descriptive, user-friendly title for the capability " "statement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this graph definition, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this graph definition when it" " is referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which an authoritative instance of this" " graph definition is (or will be) published. This URL can be the " "target of a canonical reference. It SHALL remain the same when the " "graph definition is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate graph definition instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the graph definition", description=( "The identifier that is used to identify this version of the graph " "definition when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the graph definition " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GraphDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "copyrightLabel", "start", "node", "link", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GraphDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext"), ("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields class GraphDefinitionLink(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Links this graph makes rules about. """ __resource_type__ = "GraphDefinitionLink" compartment: typing.List[ fhirtypes.GraphDefinitionLinkCompartmentType ] | None = Field( default=None, alias="compartment", title="Compartment Consistency Rules", description=None, json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Why this link is specified", description=( "Information about why this link is of interest in this graph " "definition." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) max: fhirtypes.StringType | None = Field( default=None, alias="max", title="Maximum occurrences for this link", description=None, json_schema_extra={ "element_property": True, }, ) max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_max", title="Extension field for ``max``." ) min: fhirtypes.IntegerType | None = Field( default=None, alias="min", title="Minimum occurrences for this link", description=None, json_schema_extra={ "element_property": True, }, ) min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_min", title="Extension field for ``min``." ) params: fhirtypes.StringType | None = Field( default=None, alias="params", title="Criteria for reverse lookup", description="A set of parameters to look up.", json_schema_extra={ "element_property": True, }, ) params__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_params", title="Extension field for ``params``." ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="Path in the resource that contains the link", description=( "A FHIRPath expression that identifies one of FHIR References to other " "resources." ), json_schema_extra={ "element_property": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) sliceName: fhirtypes.StringType | None = Field( default=None, alias="sliceName", title="Which slice (if profiled)", description=None, json_schema_extra={ "element_property": True, }, ) sliceName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sliceName", title="Extension field for ``sliceName``." ) sourceId: fhirtypes.IdType | None = Field( default=None, alias="sourceId", title="Source Node for this link", description="The source node for this link.", json_schema_extra={ "element_property": True, "element_required": True, }, ) sourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceId", title="Extension field for ``sourceId``." ) targetId: fhirtypes.IdType | None = Field( default=None, alias="targetId", title="Target Node for this link", description="The target node for this link.", json_schema_extra={ "element_property": True, "element_required": True, }, ) targetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_targetId", title="Extension field for ``targetId``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GraphDefinitionLink`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "min", "max", "sourceId", "path", "sliceName", "targetId", "params", "compartment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GraphDefinitionLink`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("sourceId", "sourceId__ext"), ("targetId", "targetId__ext")] return required_fields class GraphDefinitionLinkCompartment(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Compartment Consistency Rules. """ __resource_type__ = "GraphDefinitionLinkCompartment" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title=( "Patient | Encounter | RelatedPerson | Practitioner | Device | " "EpisodeOfCare" ), description="Identifies the compartment.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "Patient", "Encounter", "RelatedPerson", "Practitioner", "Device", "EpisodeOfCare", ], }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Documentation for FHIRPath expression", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="Custom rule, as a FHIRPath expression", description=None, json_schema_extra={ "element_property": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) rule: fhirtypes.CodeType | None = Field( default=None, alias="rule", title="identical | matching | different | custom", description="identical | matching | different | no-rule | custom.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["identical", "matching", "different", "custom"], }, ) rule__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rule", title="Extension field for ``rule``." ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="where | requires", description=( "Defines how the compartment rule is used - whether it it is used to " "test whether resources are subject to the rule, or whether it is a " "rule that must be followed." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["where", "requires"], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GraphDefinitionLinkCompartment`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "use", "rule", "code", "expression", "description", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GraphDefinitionLinkCompartment`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("code", "code__ext"), ("rule", "rule__ext"), ("use", "use__ext"), ] return required_fields class GraphDefinitionNode(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Potential target for the link. """ __resource_type__ = "GraphDefinitionNode" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Why this node is specified", description=( "Information about why this node is of interest in this graph " "definition." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) nodeId: fhirtypes.IdType | None = Field( default=None, alias="nodeId", title="Internal ID - target for link references", description="Internal ID of node - target for link references.", json_schema_extra={ "element_property": True, "element_required": True, }, ) nodeId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_nodeId", title="Extension field for ``nodeId``." ) profile: fhirtypes.CanonicalType | None = Field( default=None, alias="profile", title="Profile for the target resource", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="Type of resource this link refers to", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GraphDefinitionNode`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "nodeId", "description", "type", "profile", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GraphDefinitionNode`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("nodeId", "nodeId__ext"), ("type", "type__ext")] return required_fields ================================================ FILE: fhir/resources/group.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Group Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Group(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Group of multiple entities. Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively, and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization. """ __resource_type__ = "Group" active: bool | None = Field( default=None, alias="active", title="Whether this group's record is in active use", description=( "Indicates whether the record for the group is available for use or is " "merely being retained for historical purposes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) characteristic: typing.List[fhirtypes.GroupCharacteristicType] | None = Field( default=None, alias="characteristic", title="Include / Exclude group members by Trait", description=( "Identifies traits whose presence r absence is shared by members of the" " group." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Kind of Group members", description=( 'Provides a specific type of resource the group includes; e.g. "cow", ' '"syringe", etc.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the group", description=( "Explanation of what the group represents and how it is intended to be " "used." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for this Group", description=( "Business identifiers assigned to this participant by one of the " "applications involved. These identifiers remain constant as the " "resource is updated and propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) managingEntity: fhirtypes.ReferenceType | None = Field( default=None, alias="managingEntity", title="Entity that is the custodian of the Group's definition", description=( "Entity responsible for defining and maintaining Group characteristics " "and/or registered members." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Organization", "RelatedPerson", "Practitioner", "PractitionerRole", ], }, ) member: typing.List[fhirtypes.GroupMemberType] | None = Field( default=None, alias="member", title="Who or what is in group", description="Identifies the resource instances that are members of the group.", json_schema_extra={ "element_property": True, }, ) membership: fhirtypes.CodeType | None = Field( default=None, alias="membership", title="definitional | enumerated", description=( "Basis for membership in the Group: * 'definitional': The " "Group.characteristics specified are both necessary and sufficient to " "determine membership. All entities that meet the criteria are " "considered to be members of the group, whether referenced by the group" " or not. If members are present, they are individuals that happen to " "be known as meeting the Group.characteristics. The list cannot be " "presumed to be complete. * 'enumerated': The Group.characteristics are" " necessary but not sufficient to determine membership. Membership is " "determined by being listed as one of the Group.member." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["definitional", "enumerated"], }, ) membership__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_membership", title="Extension field for ``membership``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Label for Group", description=( "A label assigned to the group for human identification and " "communication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) quantity: fhirtypes.UnsignedIntType | None = Field( default=None, alias="quantity", title="Number of members", description=( "A count of the number of resource instances that are part of the " "group." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) quantity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_quantity", title="Extension field for ``quantity``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "person | animal | practitioner | device | careteam | healthcareservice" " | location | organization | relatedperson | specimen" ), description=( "Identifies the broad classification of the kind of resources the group" " includes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "person", "animal", "practitioner", "device", "careteam", "healthcareservice", "location", "organization", "relatedperson", "specimen", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Group`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "type", "membership", "code", "name", "description", "quantity", "managingEntity", "characteristic", "member", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Group`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "active", "type", "membership", "code", "name", "quantity", "managingEntity", "characteristic", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("membership", "membership__ext"), ("type", "type__ext")] return required_fields class GroupCharacteristic(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Include / Exclude group members by Trait. Identifies traits whose presence r absence is shared by members of the group. """ __resource_type__ = "GroupCharacteristic" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Kind of characteristic", description="A code that identifies the kind of trait being asserted.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) exclude: bool | None = Field( default=None, alias="exclude", title="Group includes or excludes", description=( "If true, indicates the characteristic is one that is NOT held by " "members of the group." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) exclude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_exclude", title="Extension field for ``exclude``." ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Period over which characteristic is tested", description=( "The period over which the characteristic is tested; e.g. the patient " "had an operation during the month of June." ), json_schema_extra={ "element_property": True, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value held by characteristic", description=( "The value of the trait that holds (or does not hold - see 'exclude') " "for members of the group." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Value held by characteristic", description=( "The value of the trait that holds (or does not hold - see 'exclude') " "for members of the group." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Value held by characteristic", description=( "The value of the trait that holds (or does not hold - see 'exclude') " "for members of the group." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Value held by characteristic", description=( "The value of the trait that holds (or does not hold - see 'exclude') " "for members of the group." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Value held by characteristic", description=( "The value of the trait that holds (or does not hold - see 'exclude') " "for members of the group." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GroupCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "valueCodeableConcept", "valueBoolean", "valueQuantity", "valueRange", "valueReference", "exclude", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GroupCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "code", "valueCodeableConcept", "valueBoolean", "valueQuantity", "valueRange", "valueReference", "exclude", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("exclude", "exclude__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueCodeableConcept", "valueQuantity", "valueRange", "valueReference", ] } return one_of_many_fields class GroupMember(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who or what is in group. Identifies the resource instances that are members of the group. """ __resource_type__ = "GroupMember" entity: fhirtypes.ReferenceType = Field( default=..., alias="entity", title="Reference to the group member", description=( "A reference to the entity that is a member of the group. Must be " "consistent with Group.type. If the entity is another group, then the " "type must be the same." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CareTeam", "Device", "Group", "HealthcareService", "Location", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Specimen", ], }, ) inactive: bool | None = Field( default=None, alias="inactive", title="If member is no longer in group", description=( "A flag to indicate that the member is no longer in the group, but " "previously may have been a member." ), json_schema_extra={ "element_property": True, }, ) inactive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_inactive", title="Extension field for ``inactive``." ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Period member belonged to the group", description="The period that the member was in the group, if known.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GroupMember`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "entity", "period", "inactive"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GroupMember`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/guidanceresponse.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/GuidanceResponse Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class GuidanceResponse(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The formal response to a guidance request. A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken. """ __resource_type__ = "GuidanceResponse" dataRequirement: typing.List[fhirtypes.DataRequirementType] | None = Field( default=None, alias="dataRequirement", title="Additional required data", description=( "If the evaluation could not be completed due to lack of information, " "or additional information would potentially result in a more accurate " "response, this element will a description of the data required in " "order to proceed with the evaluation. A subsequent request to the " "service should include this data." ), json_schema_extra={ "element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter during which the response was returned", description=( "The encounter during which this response was created or to which the " "creation of this record is tightly associated." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) evaluationMessage: fhirtypes.ReferenceType | None = Field( default=None, alias="evaluationMessage", title="Messages resulting from the evaluation of the artifact or artifacts", description=( "Messages resulting from the evaluation of the artifact or artifacts. " "As part of evaluating the request, the engine may produce " "informational or warning messages. These messages will be provided by " "this element." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["OperationOutcome"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description=( "Allows a service to provide unique, business identifiers for the " "response." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) moduleCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="moduleCanonical", title="What guidance was requested", description=( "An identifier, CodeableConcept or canonical reference to the guidance " "that was requested." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e module[x] "one_of_many": "module", "one_of_many_required": True, }, ) moduleCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_moduleCanonical", title="Extension field for ``moduleCanonical``.", ) moduleCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="moduleCodeableConcept", title="What guidance was requested", description=( "An identifier, CodeableConcept or canonical reference to the guidance " "that was requested." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e module[x] "one_of_many": "module", "one_of_many_required": True, }, ) moduleUri: fhirtypes.UriType | None = Field( default=None, alias="moduleUri", title="What guidance was requested", description=( "An identifier, CodeableConcept or canonical reference to the guidance " "that was requested." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e module[x] "one_of_many": "module", "one_of_many_required": True, }, ) moduleUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_moduleUri", title="Extension field for ``moduleUri``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Additional notes about the response", description=( "Provides a mechanism to communicate additional information about the " "response." ), json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When the guidance response was processed", description="Indicates when the guidance response was processed.", json_schema_extra={ "element_property": True, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) outputParameters: fhirtypes.ReferenceType | None = Field( default=None, alias="outputParameters", title="The output parameters of the evaluation, if any", description=( "The output parameters of the evaluation, if any. Many modules will " "result in the return of specific resources such as procedure or " "communication requests that are returned as part of the operation " "result. However, modules may define specific outputs that would be " "returned as the result of the evaluation, and these would be returned " "in this element." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Parameters"], }, ) performer: fhirtypes.ReferenceType | None = Field( default=None, alias="performer", title="Device returning the guidance", description="Provides a reference to the device that performed the guidance.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="reason", title="Why guidance is needed", description=( "Describes the reason for the guidance response in coded or textual " "form, or Indicates the reason the request was initiated. This is " "typically provided as a parameter to the evaluation and echoed by the " "service, although for some use cases, such as subscription- or event-" "based scenarios, it may provide an indication of the cause for the " "response." ), json_schema_extra={ "element_property": True, }, ) requestIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="requestIdentifier", title="The identifier of the request associated with this response, if any", description=( "The identifier of the request associated with this response. If an " "identifier was given as part of the request, it will be reproduced " "here to enable the requester to more easily identify the response in a" " multi-request scenario." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) result: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="result", title="Proposed actions, if any", description="The actions, if any, produced by the evaluation of the artifact.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Appointment", "AppointmentResponse", "CarePlan", "Claim", "CommunicationRequest", "Contract", "CoverageEligibilityRequest", "DeviceRequest", "EnrollmentRequest", "ImmunizationRecommendation", "MedicationRequest", "NutritionOrder", "RequestOrchestration", "ServiceRequest", "SupplyRequest", "Task", "VisionPrescription", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "success | data-requested | data-required | in-progress | failure | " "entered-in-error" ), description=( "The status of the response. If the evaluation is completed " "successfully, the status will indicate success. However, in order to " "complete the evaluation, the engine may require more information. In " "this case, the status will be data-required, and the response will " "contain a description of the additional required information. If the " "evaluation completed successfully, but the engine determines that a " "potentially more accurate response could be provided if more data was " "available, the status will be data-requested, and the response will " "contain a description of the additional requested information." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "success", "data-requested", "data-required", "in-progress", "failure", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Patient the request was performed for", description="The patient for which the request was processed.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``GuidanceResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "requestIdentifier", "identifier", "moduleUri", "moduleCanonical", "moduleCodeableConcept", "status", "subject", "encounter", "occurrenceDateTime", "performer", "reason", "note", "evaluationMessage", "outputParameters", "result", "dataRequirement", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``GuidanceResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "requestIdentifier", "identifier", "moduleUri", "moduleCanonical", "moduleCodeableConcept", "status", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "module": ["moduleCanonical", "moduleCodeableConcept", "moduleUri"] } return one_of_many_fields ================================================ FILE: fhir/resources/healthcareservice.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/HealthcareService Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class HealthcareService(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The details of a healthcare service available at a location. """ __resource_type__ = "HealthcareService" active: bool | None = Field( default=None, alias="active", title="Whether this HealthcareService record is in active use", description=( "This flag is used to mark the record to not be used. This is not used " "when a center is closed for maintenance, or for holidays, the " "notAvailable period is to be used for this." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) appointmentRequired: bool | None = Field( default=None, alias="appointmentRequired", title="If an appointment is required for access to this service", description=( "Indicates whether or not a prospective consumer will require an " "appointment for a particular service at a site to be provided by the " "Organization. Indicates if an appointment is required for access to " "this service." ), json_schema_extra={ "element_property": True, }, ) appointmentRequired__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_appointmentRequired", title="Extension field for ``appointmentRequired``.", ) availability: typing.List[fhirtypes.AvailabilityType] | None = Field( default=None, alias="availability", title="Times the healthcare service is available (including exceptions)", description="A collection of times that the healthcare service is available.", json_schema_extra={ "element_property": True, }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Broad category of service being performed or delivered", description="Identifies the broad category of service being performed or delivered.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) characteristic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="characteristic", title="Collection of characteristics (attributes)", description=None, json_schema_extra={ "element_property": True, }, ) comment: fhirtypes.MarkdownType | None = Field( default=None, alias="comment", title=( "Additional description and/or any specific issues not covered " "elsewhere" ), description=( "Any additional description of the service and/or any specific issues " "not covered by the other attributes, which can be displayed as further" " detail under the serviceName." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) communication: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="communication", title="The language that this service is offered in", description=( "Some services are specifically made available in multiple languages, " "this property permits a directory to declare the languages this is " "offered in. Typically this is only provided where a service operates " "in communities with mixed languages used." ), json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ExtendedContactDetailType] | None = Field( default=None, alias="contact", title="Official contact details for the HealthcareService", description=( "The contact details of communication devices available relevant to the" " specific HealthcareService. This can include addresses, phone " "numbers, fax numbers, mobile numbers, email addresses and web sites." ), json_schema_extra={ "element_property": True, }, ) coverageArea: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="coverageArea", title="Location(s) service is intended for/available to", description=( "The location(s) that this service is available to (not where the " "service is provided)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) eligibility: typing.List[fhirtypes.HealthcareServiceEligibilityType] | None = Field( default=None, alias="eligibility", title="Specific eligibility requirements required to use the service", description=( "Does this service have specific eligibility requirements that need to " "be met in order to use the service?" ), json_schema_extra={ "element_property": True, }, ) endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title=( "Technical endpoints providing access to electronic services operated " "for the healthcare service" ), description=( "Technical endpoints providing access to services operated for the " "specific healthcare services defined at this resource." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) extraDetails: fhirtypes.MarkdownType | None = Field( default=None, alias="extraDetails", title=( "Extra details about the service that can't be placed in the other " "fields" ), description=None, json_schema_extra={ "element_property": True, }, ) extraDetails__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_extraDetails", title="Extension field for ``extraDetails``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External identifiers for this item", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) location: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="location", title="Location(s) where service may be provided", description="The location(s) where this healthcare service may be provided.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Description of service as presented to a consumer while searching", description=( "Further description of the service as it would be presented to a " "consumer while searching." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) offeredIn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="offeredIn", title="The service within which this service is offered", description=( "When the HealthcareService is representing a specific, schedulable " "service, the availableIn property can refer to a generic service." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["HealthcareService"], }, ) photo: fhirtypes.AttachmentType | None = Field( default=None, alias="photo", title="Facilitates quick identification of the service", description=( "If there is a photo/symbol associated with this HealthcareService, it " "may be included here to facilitate quick identification of the service" " in a list." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) program: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="program", title="Programs that this service is applicable to", description=None, json_schema_extra={ "element_property": True, }, ) providedBy: fhirtypes.ReferenceType | None = Field( default=None, alias="providedBy", title="Organization that provides this service", description="The organization that provides this healthcare service.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) referralMethod: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="referralMethod", title="Ways that the service accepts referrals", description=( "Ways that the service accepts referrals, if this is not provided then " "it is implied that no referral is required." ), json_schema_extra={ "element_property": True, }, ) serviceProvisionCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="serviceProvisionCode", title="Conditions under which service is available/offered", description=( "The code(s) that detail the conditions under which the healthcare " "service is available/offered." ), json_schema_extra={ "element_property": True, }, ) specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialty", title="Specialties handled by the HealthcareService", description=( "Collection of specialties handled by the Healthcare service. This is " "more of a medical term." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Type of service that may be delivered or performed", description="The specific type of service that may be delivered or performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``HealthcareService`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "providedBy", "offeredIn", "category", "type", "specialty", "location", "name", "comment", "extraDetails", "photo", "contact", "coverageArea", "serviceProvisionCode", "eligibility", "program", "characteristic", "communication", "referralMethod", "appointmentRequired", "availability", "endpoint", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``HealthcareService`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "active", "providedBy", "category", "type", "specialty", "location", "name", "comment", "photo", ] class HealthcareServiceEligibility(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specific eligibility requirements required to use the service. Does this service have specific eligibility requirements that need to be met in order to use the service? """ __resource_type__ = "HealthcareServiceEligibility" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Coded value for the eligibility", description=None, json_schema_extra={ "element_property": True, }, ) comment: fhirtypes.MarkdownType | None = Field( default=None, alias="comment", title="Describes the eligibility conditions for the service", description=None, json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``HealthcareServiceEligibility`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "comment"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``HealthcareServiceEligibility`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/humanname.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/HumanName Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class HumanName(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Name of a human or other living entity - parts and usage. A name, normally of a human, that can be used for other living entities (e.g. animals but not organizations) that have been assigned names by a human and may need the use of name parts or the need for usage information. """ __resource_type__ = "HumanName" family: fhirtypes.StringType | None = Field( default=None, alias="family", title="Family name (often called 'Surname')", description=( "The part of a name that links to the genealogy. In some cultures (e.g." " Eritrea) the family name of a son is the first name of his father." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) family__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_family", title="Extension field for ``family``." ) given: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="given", title="Given names (not always 'first'). Includes middle names", description="Given name.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) given__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_given", title="Extension field for ``given``." ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period when name was/is in use", description=( "Indicates the period of time when this name was valid for the named " "person." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) prefix: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="prefix", title="Parts that come before the name", description=( "Part of the name that is acquired as a title due to academic, legal, " "employment or nobility status, etc. and that appears at the start of " "the name." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) prefix__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_prefix", title="Extension field for ``prefix``." ) suffix: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="suffix", title="Parts that come after the name", description=( "Part of the name that is acquired as a title due to academic, legal, " "employment or nobility status, etc. and that appears at the end of the" " name." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) suffix__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_suffix", title="Extension field for ``suffix``." ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Text representation of the full name", description=( "Specifies the entire name as it should be displayed e.g. on an " "application UI. This may be provided instead of or as well as the " "specific parts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="usual | official | temp | nickname | anonymous | old | maiden", description="Identifies the purpose for this name.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "usual", "official", "temp", "nickname", "anonymous", "old", "maiden", ], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``HumanName`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "use", "text", "family", "given", "prefix", "suffix", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``HumanName`` according to specification, with preserving the original sequence order. """ return ["use", "text", "family", "given", "prefix", "suffix", "period"] ================================================ FILE: fhir/resources/identifier.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Identifier Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class Identifier(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An identifier intended for computation. An identifier - identifies some entity uniquely and unambiguously. Typically this is used for business identifiers. """ __resource_type__ = "Identifier" assigner: fhirtypes.ReferenceType | None = Field( default=None, alias="assigner", title="Organization that issued id (may be just text)", description="Organization that issued/manages the identifier.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Time period when id is/was valid for use", description="Time period during which identifier is/was valid for use.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) system: fhirtypes.UriType | None = Field( default=None, alias="system", title="The namespace for the identifier value", description=( "Establishes the namespace for the value - that is, an absolute URL " "that describes a set values that are unique." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Description of identifier", description=( "A coded type for the identifier that can be used to determine which " "identifier to use for a specific purpose." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="usual | official | temp | secondary | old (If known)", description="The purpose of this identifier.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["usual", "official", "temp", "secondary", "old"], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The value that is unique", description=( "The portion of the identifier typically relevant to the user and which" " is unique within the context of the system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Identifier`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "use", "type", "system", "value", "period", "assigner", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Identifier`` according to specification, with preserving the original sequence order. """ return ["use", "type", "system", "value", "period", "assigner"] ================================================ FILE: fhir/resources/imagingselection.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ImagingSelection Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ImagingSelection(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A selection of DICOM SOP instances and/or frames. A selection of DICOM SOP instances and/or frames within a single Study and Series. This might include additional specifics such as an image region, an Observation UID or a Segmentation Number, allowing linkage to an Observation Resource or transferring this information along with the ImagingStudy Resource. """ __resource_type__ = "ImagingSelection" basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Associated request", description=( "A list of the diagnostic requests that resulted in this imaging " "selection being performed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CarePlan", "ServiceRequest", "Appointment", "AppointmentResponse", "Task", ], }, ) bodySite: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="bodySite", title="Body part examined", description=( "The anatomic structures examined. See DICOM Part 16 Annex L (http://di" "com.nema.org/medical/dicom/current/output/chtml/part16/chapter_L.html)" " for DICOM to SNOMED-CT mappings." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["BodyStructure"], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Classifies the imaging selection", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Imaging Selection purpose text or code", description="Reason for referencing the selected content.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) derivedFrom: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="derivedFrom", title="The imaging study from which the imaging selection is derived", description="The imaging study from which the imaging selection is made.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ImagingStudy", "DocumentReference"], }, ) endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title=( "The network service providing retrieval for the images referenced in " "the imaging selection" ), description=( "The network service providing retrieval access to the selected images," " frames, etc. See implementation notes for information about using " "DICOM endpoints." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) focus: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="focus", title="Related resource that is the focus for the imaging selection", description=( "The actual focus of an observation when it is not the patient of " "record representing something or someone associated with the patient " "such as a spouse, parent, fetus, or donor. For example, fetus " "observations in a mother's record. The focus of an observation could " "also be an existing condition, an intervention, the subject's diet, " "another observation of the subject, or a body structure such as tumor" " or implanted device. An example use case would be using the " "Observation resource to capture whether the mother is trained to " "change her child's tracheostomy tube. In this example, the child is " "the patient of record and the mother is the focus." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ImagingSelection"], }, ) frameOfReferenceUid: fhirtypes.IdType | None = Field( default=None, alias="frameOfReferenceUid", title="The Frame of Reference UID for the selected images", description=( "The Frame of Reference UID identifying the coordinate system that " "conveys spatial and/or temporal information for the selected images or" " frames." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) frameOfReferenceUid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_frameOfReferenceUid", title="Extension field for ``frameOfReferenceUid``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for Imaging Selection", description="A unique identifier assigned to this imaging selection.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instance: typing.List[fhirtypes.ImagingSelectionInstanceType] | None = Field( default=None, alias="instance", title="The selected instances", description=( "Each imaging selection includes one or more selected DICOM SOP " "instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued: fhirtypes.InstantType | None = Field( default=None, alias="issued", title="Date / Time when this imaging selection was created", description="The date and time this imaging selection was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issued", title="Extension field for ``issued``." ) performer: typing.List[fhirtypes.ImagingSelectionPerformerType] | None = Field( default=None, alias="performer", title="Selector of the instances (human or machine)", description="Selector of the instances \u2013 human or machine.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) seriesNumber: fhirtypes.UnsignedIntType | None = Field( default=None, alias="seriesNumber", title="DICOM Series Number", description=( "The Series Number for the DICOM Series from which the images were " "selected." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) seriesNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_seriesNumber", title="Extension field for ``seriesNumber``.", ) seriesUid: fhirtypes.IdType | None = Field( default=None, alias="seriesUid", title="DICOM Series Instance UID", description=( "The Series Instance UID for the DICOM Series from which the images " "were selected." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) seriesUid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_seriesUid", title="Extension field for ``seriesUid``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="available | entered-in-error | unknown", description=( "The current state of the ImagingSelection resource. This is not the " "status of any ImagingStudy, ServiceRequest, or Task resources " "associated with the ImagingSelection." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["available", "entered-in-error", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) studyUid: fhirtypes.IdType | None = Field( default=None, alias="studyUid", title="DICOM Study Instance UID", description=( "The Study Instance UID for the DICOM Study from which the images were " "selected." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) studyUid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_studyUid", title="Extension field for ``studyUid``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Subject of the selected instances", description=( "The patient, or group of patients, location, device, organization, " "procedure or practitioner this imaging selection is about and into " "whose or what record the imaging selection is placed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Group", "Device", "Location", "Organization", "Procedure", "Practitioner", "Medication", "Substance", "Specimen", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImagingSelection`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "subject", "issued", "performer", "basedOn", "category", "code", "studyUid", "derivedFrom", "endpoint", "seriesUid", "seriesNumber", "frameOfReferenceUid", "bodySite", "focus", "instance", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImagingSelection`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "subject", "issued", "performer", "basedOn", "category", "code", "studyUid", "derivedFrom", "endpoint", "seriesUid", "seriesNumber", "frameOfReferenceUid", "bodySite", "focus", "instance", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class ImagingSelectionInstance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The selected instances. Each imaging selection includes one or more selected DICOM SOP instances. """ __resource_type__ = "ImagingSelectionInstance" imageRegion2D: typing.List[ fhirtypes.ImagingSelectionInstanceImageRegion2DType ] | None = Field( default=None, alias="imageRegion2D", title="A specific 2D region in a DICOM image / frame", description=( "Each imaging selection instance or frame list might includes an image " "region, specified by a region type and a set of 2D coordinates." " If the parent imagingSelection.instance contains a subset " "element of type frame, the image region applies to all frames in the " "subset list." ), json_schema_extra={ "element_property": True, }, ) imageRegion3D: typing.List[ fhirtypes.ImagingSelectionInstanceImageRegion3DType ] | None = Field( default=None, alias="imageRegion3D", title="A specific 3D region in a DICOM frame of reference", description=( "Each imaging selection might includes a 3D image region, specified by " "a region type and a set of 3D coordinates." ), json_schema_extra={ "element_property": True, }, ) number: fhirtypes.UnsignedIntType | None = Field( default=None, alias="number", title="DICOM Instance Number", description="The Instance Number for the selected DICOM instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_number", title="Extension field for ``number``." ) sopClass: fhirtypes.CodingType | None = Field( default=None, alias="sopClass", title="DICOM SOP Class UID", description="The SOP Class UID for the selected DICOM instance.", json_schema_extra={ "element_property": True, }, ) subset: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="subset", title="The selected subset of the SOP Instance", description=( "Selected subset of the SOP Instance. The content and format of the " "subset item is determined by the SOP Class of the selected instance." " May be one of: - A list of frame numbers selected from " "a multiframe SOP Instance. - A list of Content Item Observation" " UID values selected from a DICOM SR or other structured document SOP " "Instance. - A list of segment numbers selected from a " "segmentation SOP Instance. - A list of Region of Interest (ROI)" " numbers selected from a radiotherapy structure set SOP Instance." ), json_schema_extra={ "element_property": True, }, ) subset__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_subset", title="Extension field for ``subset``." ) uid: fhirtypes.IdType | None = Field( default=None, alias="uid", title="DICOM SOP Instance UID", description="The SOP Instance UID for the selected DICOM instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) uid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uid", title="Extension field for ``uid``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImagingSelectionInstance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "uid", "number", "sopClass", "subset", "imageRegion2D", "imageRegion3D", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImagingSelectionInstance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "uid", "number"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("uid", "uid__ext")] return required_fields class ImagingSelectionInstanceImageRegion2D(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A specific 2D region in a DICOM image / frame. Each imaging selection instance or frame list might includes an image region, specified by a region type and a set of 2D coordinates. If the parent imagingSelection.instance contains a subset element of type frame, the image region applies to all frames in the subset list. """ __resource_type__ = "ImagingSelectionInstanceImageRegion2D" coordinate: typing.List[fhirtypes.DecimalType | None] | None = Field( default=None, alias="coordinate", title="Specifies the coordinates that define the image region", description=( "The coordinates describing the image region. Encoded as a set of " "(column, row) pairs that denote positions in the selected image / " "frames specified with sub-pixel resolution. The origin at the " "TLHC of the TLHC pixel is 0.0\\0.0, the BRHC of the TLHC pixel is " "1.0\\1.0, and the BRHC of the BRHC pixel is the number of columns\\rows " "in the image / frames. The values must be within the range 0\\0 to the " "number of columns\\rows in the image / frames." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) coordinate__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_coordinate", title="Extension field for ``coordinate``." ) regionType: fhirtypes.CodeType | None = Field( default=None, alias="regionType", title="point | polyline | interpolated | circle | ellipse", description="Specifies the type of image region.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["point", "polyline", "interpolated", "circle", "ellipse"], }, ) regionType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_regionType", title="Extension field for ``regionType``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImagingSelectionInstanceImageRegion2D`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "regionType", "coordinate"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImagingSelectionInstanceImageRegion2D`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("coordinate", "coordinate__ext"), ("regionType", "regionType__ext"), ] return required_fields class ImagingSelectionInstanceImageRegion3D(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A specific 3D region in a DICOM frame of reference. Each imaging selection might includes a 3D image region, specified by a region type and a set of 3D coordinates. """ __resource_type__ = "ImagingSelectionInstanceImageRegion3D" coordinate: typing.List[fhirtypes.DecimalType | None] | None = Field( default=None, alias="coordinate", title="Specifies the coordinates that define the image region", description=( "The coordinates describing the image region. Encoded as an ordered set" " of (x,y,z) triplets (in mm and may be negative) that define a region " "of interest in the patient-relative Reference Coordinate System " "defined by ImagingSelection.frameOfReferenceUid element." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) coordinate__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_coordinate", title="Extension field for ``coordinate``." ) regionType: fhirtypes.CodeType | None = Field( default=None, alias="regionType", title="point | multipoint | polyline | polygon | ellipse | ellipsoid", description="Specifies the type of image region.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "point", "multipoint", "polyline", "polygon", "ellipse", "ellipsoid", ], }, ) regionType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_regionType", title="Extension field for ``regionType``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImagingSelectionInstanceImageRegion3D`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "regionType", "coordinate"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImagingSelectionInstanceImageRegion3D`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("coordinate", "coordinate__ext"), ("regionType", "regionType__ext"), ] return required_fields class ImagingSelectionPerformer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Selector of the instances (human or machine). Selector of the instances – human or machine. """ __resource_type__ = "ImagingSelectionPerformer" actor: fhirtypes.ReferenceType | None = Field( default=None, alias="actor", title="Author (human or machine)", description="Author \u2013 human or machine.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Device", "Organization", "CareTeam", "Patient", "RelatedPerson", "HealthcareService", ], }, ) function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="Type of performer", description="Distinguishes the type of involvement of the performer.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImagingSelectionPerformer`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "function", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImagingSelectionPerformer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "function", "actor"] ================================================ FILE: fhir/resources/imagingstudy.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ImagingStudy Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ImagingStudy(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A set of images produced in single study (one or more series of references images). Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities. """ __resource_type__ = "ImagingStudy" basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Request fulfilled", description=( "A list of the diagnostic requests that resulted in this imaging study " "being performed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CarePlan", "ServiceRequest", "Appointment", "AppointmentResponse", "Task", ], }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Institution-generated description", description=( "The Imaging Manager description of the study. Institution-generated " "description or classification of the Study (component) performed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter with which this imaging study is associated", description=( "The healthcare event (e.g. a patient and healthcare provider " "interaction) during which this ImagingStudy is made." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title="Study access endpoint", description=( "The network service providing access (e.g., query, view, or retrieval)" " for the study. See implementation notes for information about using " "DICOM endpoints. A study-level endpoint applies to each series in the " "study, unless overridden by a series-level endpoint with the same " "Endpoint.connectionType." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifiers for the whole study", description="Identifiers for the ImagingStudy such as DICOM Study Instance UID.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where ImagingStudy occurred", description="The principal physical location where the ImagingStudy was performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) modality: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="modality", title="All of the distinct values for series' modalities", description=( "A list of all the distinct values of series.modality. This may include" " both acquisition and non-acquisition modalities." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="User-defined comments", description=( "Per the recommended DICOM mapping, this element is derived from the " "Study Description attribute (0008,1030). Observations or findings " "about the imaging study should be recorded in another resource, e.g. " "Observation, and not in this element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) numberOfInstances: fhirtypes.UnsignedIntType | None = Field( default=None, alias="numberOfInstances", title="Number of Study Related Instances", description=( "Number of SOP Instances in Study. This value given may be larger than " "the number of instance elements this resource contains due to resource" " availability, security, or other factors. This element should be " "present if any instance elements are present." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) numberOfInstances__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_numberOfInstances", title="Extension field for ``numberOfInstances``.", ) numberOfSeries: fhirtypes.UnsignedIntType | None = Field( default=None, alias="numberOfSeries", title="Number of Study Related Series", description=( "Number of Series in the Study. This value given may be larger than the" " number of series elements this Resource contains due to resource " "availability, security, or other factors. This element should be " "present if any series elements are present." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) numberOfSeries__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_numberOfSeries", title="Extension field for ``numberOfSeries``.", ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced event", description=( "A larger event of which this particular ImagingStudy is a component or" " step. For example, an ImagingStudy as part of a procedure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Procedure"], }, ) procedure: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="procedure", title="The performed procedure or code", description=( "This field corresponds to the DICOM Procedure Code Sequence " "(0008,1032). This is different from the FHIR Procedure resource that " "may include the ImagingStudy." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["PlanDefinition", "ActivityDefinition"], }, ) reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="reason", title="Why the study was requested / performed", description=( "Description of clinical condition indicating why the ImagingStudy was " "requested, and/or Indicates another resource whose existence justifies" " this Study." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "DiagnosticReport", "DocumentReference", ], }, ) referrer: fhirtypes.ReferenceType | None = Field( default=None, alias="referrer", title="Referring physician", description="The requesting/referring physician.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) series: typing.List[fhirtypes.ImagingStudySeriesType] | None = Field( default=None, alias="series", title="Each study has one or more series of instances", description="Each study has one or more series of images or other content.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) started: fhirtypes.DateTimeType | None = Field( default=None, alias="started", title="When the study was started", description="Date and time the study started.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) started__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_started", title="Extension field for ``started``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="registered | available | cancelled | entered-in-error | unknown", description=( "The current state of the ImagingStudy resource. This is not the status" " of any ServiceRequest or Task resources associated with the " "ImagingStudy." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "registered", "available", "cancelled", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who or what is the subject of the study", description="The subject, typically a patient, of the imaging study.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Device", "Group"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImagingStudy`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "modality", "subject", "encounter", "started", "basedOn", "partOf", "referrer", "endpoint", "numberOfSeries", "numberOfInstances", "procedure", "location", "reason", "note", "description", "series", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImagingStudy`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "modality", "subject", "encounter", "started", "basedOn", "partOf", "referrer", "endpoint", "numberOfSeries", "numberOfInstances", "procedure", "location", "reason", "note", "description", "series", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class ImagingStudySeries(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Each study has one or more series of instances. Each study has one or more series of images or other content. """ __resource_type__ = "ImagingStudySeries" bodySite: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="bodySite", title="Body part examined", description=( "The anatomic structures examined. See DICOM Part 16 Annex L (http://di" "com.nema.org/medical/dicom/current/output/chtml/part16/chapter_L.html)" " for DICOM to SNOMED-CT mappings. The bodySite may indicate the " "laterality of body part imaged; if so, it shall be consistent with any" " content of ImagingStudy.series.laterality." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["BodyStructure"], }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="A short human readable summary of the series", description="A description of the series.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title="Series access endpoint", description=( "The network service providing access (e.g., query, view, or retrieval)" " for this series. See implementation notes for information about using" " DICOM endpoints. A series-level endpoint, if present, has precedence " "over a study-level endpoint with the same Endpoint.connectionType." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) instance: typing.List[fhirtypes.ImagingStudySeriesInstanceType] | None = Field( default=None, alias="instance", title="A single SOP instance from the series", description=( "A single SOP instance within the series, e.g. an image, or " "presentation state." ), json_schema_extra={ "element_property": True, }, ) laterality: fhirtypes.CodeableConceptType | None = Field( default=None, alias="laterality", title="Body part laterality", description=( "The laterality of the (possibly paired) anatomic structures examined. " "E.g., the left knee, both lungs, or unpaired abdomen. If present, " "shall be consistent with any laterality information indicated in " "ImagingStudy.series.bodySite." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) modality: fhirtypes.CodeableConceptType = Field( default=..., alias="modality", title="The modality used for this series", description=( "The distinct modality for this series. This may include both " "acquisition and non-acquisition modalities." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) number: fhirtypes.UnsignedIntType | None = Field( default=None, alias="number", title="Numeric identifier of this series", description="The numeric identifier of this series in the study.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_number", title="Extension field for ``number``." ) numberOfInstances: fhirtypes.UnsignedIntType | None = Field( default=None, alias="numberOfInstances", title="Number of Series Related Instances", description=( "Number of SOP Instances in the Study. The value given may be larger " "than the number of instance elements this resource contains due to " "resource availability, security, or other factors. This element should" " be present if any instance elements are present." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) numberOfInstances__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_numberOfInstances", title="Extension field for ``numberOfInstances``.", ) performer: typing.List[fhirtypes.ImagingStudySeriesPerformerType] | None = Field( default=None, alias="performer", title="Who performed the series", description="Indicates who or what performed the series and how they were involved.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) specimen: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="specimen", title="Specimen imaged", description="The specimen imaged, e.g., for whole slide imaging of a biopsy.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Specimen"], }, ) started: fhirtypes.DateTimeType | None = Field( default=None, alias="started", title="When the series started", description="The date and time the series was started.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) started__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_started", title="Extension field for ``started``." ) uid: fhirtypes.IdType | None = Field( default=None, alias="uid", title="DICOM Series Instance UID for the series", description="The DICOM Series Instance UID for the series.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) uid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uid", title="Extension field for ``uid``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImagingStudySeries`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "uid", "number", "modality", "description", "numberOfInstances", "endpoint", "bodySite", "laterality", "specimen", "started", "performer", "instance", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImagingStudySeries`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "uid", "number", "modality", "description", "numberOfInstances", "endpoint", "bodySite", "laterality", "specimen", "started", "performer", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("uid", "uid__ext")] return required_fields class ImagingStudySeriesInstance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A single SOP instance from the series. A single SOP instance within the series, e.g. an image, or presentation state. """ __resource_type__ = "ImagingStudySeriesInstance" number: fhirtypes.UnsignedIntType | None = Field( default=None, alias="number", title="The number of this instance in the series", description="The number of instance in the series.", json_schema_extra={ "element_property": True, }, ) number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_number", title="Extension field for ``number``." ) sopClass: fhirtypes.CodingType = Field( default=..., alias="sopClass", title="DICOM class type", description="DICOM instance type.", json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Description of instance", description="The description of the instance.", json_schema_extra={ "element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) uid: fhirtypes.IdType | None = Field( default=None, alias="uid", title="DICOM SOP Instance UID", description="The DICOM SOP Instance UID for this image or other DICOM content.", json_schema_extra={ "element_property": True, "element_required": True, }, ) uid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uid", title="Extension field for ``uid``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImagingStudySeriesInstance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "uid", "sopClass", "number", "title", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImagingStudySeriesInstance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("uid", "uid__ext")] return required_fields class ImagingStudySeriesPerformer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who performed the series. Indicates who or what performed the series and how they were involved. """ __resource_type__ = "ImagingStudySeriesPerformer" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Who performed the series", description="Indicates who or what performed the series.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", "Patient", "Device", "RelatedPerson", "HealthcareService", ], }, ) function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="Type of performance", description="Distinguishes the type of involvement of the performer in the series.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImagingStudySeriesPerformer`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "function", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImagingStudySeriesPerformer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "function", "actor"] ================================================ FILE: fhir/resources/immunization.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Immunization Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Immunization(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Immunization event information. Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party. """ __resource_type__ = "Immunization" administeredProduct: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="administeredProduct", title="Product that was administered", description=( "An indication of which product was administered to the patient. This " "is typically a more detailed representation of the concept conveyed by" " the vaccineCode data element. If a Medication resource is referenced," " it may be to a stand-alone resource or a contained resource within " "the Immunization resource." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication"], }, ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Authority that the immunization event is based on", description=( "A plan, order or recommendation fulfilled in whole or in part by this " "immunization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CarePlan", "MedicationRequest", "ServiceRequest", "ImmunizationRecommendation", ], }, ) doseQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="doseQuantity", title="Amount of vaccine administered", description="The quantity of vaccine product that was administered.", json_schema_extra={ "element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter immunization was part of", description=( "The visit or admission or other contact between patient and health " "care provider the immunization was performed as part of." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) expirationDate: fhirtypes.DateType | None = Field( default=None, alias="expirationDate", title="Vaccine expiration date", description="Date vaccine batch expires.", json_schema_extra={ "element_property": True, }, ) expirationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expirationDate", title="Extension field for ``expirationDate``.", ) fundingSource: fhirtypes.CodeableConceptType | None = Field( default=None, alias="fundingSource", title="Funding source for the vaccine", description=( "Indicates the source of the vaccine actually administered. This may be" " different than the patient eligibility (e.g. the patient may be " "eligible for a publically purchased vaccine but due to inventory " "issues, vaccine purchased with private funds was actually " "administered)." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description="A unique identifier assigned to this immunization record.", json_schema_extra={ "element_property": True, }, ) informationSource: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="informationSource", title="Indicates the source of a reported record", description=( "Typically the source of the data when the report of the immunization " "event is not based on information from the person who administered the" " vaccine." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Organization", ], }, ) isSubpotent: bool | None = Field( default=None, alias="isSubpotent", title="Dose potency", description=( "Indication if a dose is considered to be subpotent. By default, a dose" " should be considered to be potent." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) isSubpotent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isSubpotent", title="Extension field for ``isSubpotent``." ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where immunization occurred", description=( "The service delivery location where the vaccine administration " "occurred." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) lotNumber: fhirtypes.StringType | None = Field( default=None, alias="lotNumber", title="Vaccine lot number", description="Lot number of the vaccine product.", json_schema_extra={ "element_property": True, }, ) lotNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lotNumber", title="Extension field for ``lotNumber``." ) manufacturer: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="manufacturer", title="Vaccine manufacturer", description="Name of vaccine manufacturer.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Additional immunization notes", description=( "Extra information about the immunization that is not conveyed by the " "other attributes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="Vaccine administration date", description="Date vaccine administered or was to be administered.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": True, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrenceString: fhirtypes.StringType | None = Field( default=None, alias="occurrenceString", title="Vaccine administration date", description="Date vaccine administered or was to be administered.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": True, }, ) occurrenceString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceString", title="Extension field for ``occurrenceString``.", ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Who was immunized", description="The patient who either received or did not receive the immunization.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) performer: typing.List[fhirtypes.ImmunizationPerformerType] | None = Field( default=None, alias="performer", title="Who performed event", description="Indicates who performed the immunization event.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) primarySource: bool | None = Field( default=None, alias="primarySource", title="Indicates context the data was captured in", description=( "Indicates whether the data contained in the resource was captured by " "the individual/organization which was responsible for the " "administration of the vaccine rather than as 'secondary reported' data" " documented by a third party. A value of 'true' means this data " "originated with the individual/organization which was responsible for " "the administration of the vaccine." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) primarySource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_primarySource", title="Extension field for ``primarySource``.", ) programEligibility: typing.List[ fhirtypes.ImmunizationProgramEligibilityType ] | None = Field( default=None, alias="programEligibility", title="Patient eligibility for a specific vaccination program", description="Indicates a patient's eligibility for a funding program.", json_schema_extra={ "element_property": True, }, ) protocolApplied: typing.List[ fhirtypes.ImmunizationProtocolAppliedType ] | None = Field( default=None, alias="protocolApplied", title="Protocol followed by the provider", description=( "The protocol (set of recommendations) being followed by the provider " "who administered the dose." ), json_schema_extra={ "element_property": True, }, ) reaction: typing.List[fhirtypes.ImmunizationReactionType] | None = Field( default=None, alias="reaction", title="Details of a reaction that follows immunization", description=( "Categorical data indicating that an adverse event is associated in " "time to an immunization." ), json_schema_extra={ "element_property": True, }, ) reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="reason", title="Why immunization occurred", description=( "Describes why the immunization occurred in coded or textual form, or " "Indicates another resource (Condition, Observation or " "DiagnosticReport) whose existence justifies this immunization." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "Observation", "DiagnosticReport"], }, ) route: fhirtypes.CodeableConceptType | None = Field( default=None, alias="route", title="How vaccine entered body", description="The path by which the vaccine product is taken into the body.", json_schema_extra={ "element_property": True, }, ) site: fhirtypes.CodeableConceptType | None = Field( default=None, alias="site", title="Body site vaccine was administered", description="Body site where vaccine was administered.", json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="completed | entered-in-error | not-done", description="Indicates the current status of the immunization event.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["completed", "entered-in-error", "not-done"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="statusReason", title="Reason for current status", description="Indicates the reason the immunization event was not performed.", json_schema_extra={ "element_property": True, }, ) subpotentReason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="subpotentReason", title="Reason for being subpotent", description="Reason why a dose is considered to be subpotent.", json_schema_extra={ "element_property": True, }, ) supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInformation", title="Additional information in support of the immunization", description=( "Additional information that is relevant to the immunization (e.g. for " "a vaccine recipient who is pregnant, the gestational age of the " "fetus). The reason why a vaccine was given (e.g. occupation, " "underlying medical condition) should be conveyed in " "Immunization.reason, not as supporting information. The reason why a " "vaccine was not given (e.g. contraindication) should be conveyed in " "Immunization.statusReason, not as supporting information." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) vaccineCode: fhirtypes.CodeableConceptType = Field( default=..., alias="vaccineCode", title="Vaccine administered", description="Vaccine that was administered or was to be administered.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Immunization`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "status", "statusReason", "vaccineCode", "administeredProduct", "manufacturer", "lotNumber", "expirationDate", "patient", "encounter", "supportingInformation", "occurrenceDateTime", "occurrenceString", "primarySource", "informationSource", "location", "site", "route", "doseQuantity", "performer", "note", "reason", "isSubpotent", "subpotentReason", "programEligibility", "fundingSource", "reaction", "protocolApplied", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Immunization`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "basedOn", "status", "vaccineCode", "patient", "occurrenceDateTime", "occurrenceString", "primarySource", "performer", "note", "isSubpotent", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"occurrence": ["occurrenceDateTime", "occurrenceString"]} return one_of_many_fields class ImmunizationPerformer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who performed event. Indicates who performed the immunization event. """ __resource_type__ = "ImmunizationPerformer" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Individual or organization who was performing", description="The practitioner or organization who performed the action.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Patient", "RelatedPerson", ], }, ) function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="What type of performance was done", description=( "Describes the type of performance (e.g. ordering provider, " "administering provider, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImmunizationPerformer`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "function", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImmunizationPerformer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "function", "actor"] class ImmunizationProgramEligibility(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Patient eligibility for a specific vaccination program. Indicates a patient's eligibility for a funding program. """ __resource_type__ = "ImmunizationProgramEligibility" program: fhirtypes.CodeableConceptType = Field( default=..., alias="program", title="The program that eligibility is declared for", description="Indicates which program the patient had their eligility evaluated for.", json_schema_extra={ "element_property": True, }, ) programStatus: fhirtypes.CodeableConceptType = Field( default=..., alias="programStatus", title="The patient's eligibility status for the program", description=( "Indicates the patient's eligility status for for a specific payment " "program." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImmunizationProgramEligibility`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "program", "programStatus"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImmunizationProgramEligibility`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ImmunizationProtocolApplied(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Protocol followed by the provider. The protocol (set of recommendations) being followed by the provider who administered the dose. """ __resource_type__ = "ImmunizationProtocolApplied" authority: fhirtypes.ReferenceType | None = Field( default=None, alias="authority", title="Who is responsible for publishing the recommendations", description=( "Indicates the authority who published the protocol (e.g. ACIP) that is" " being followed." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) doseNumber: fhirtypes.StringType | None = Field( default=None, alias="doseNumber", title="Dose number within series", description=( "Nominal position in a series as intended by the practitioner " "administering the dose." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) doseNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doseNumber", title="Extension field for ``doseNumber``." ) series: fhirtypes.StringType | None = Field( default=None, alias="series", title="Name of vaccine series", description=( "One possible path to achieve presumed immunity against a disease - " "within the context of an authority." ), json_schema_extra={ "element_property": True, }, ) series__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_series", title="Extension field for ``series``." ) seriesDoses: fhirtypes.StringType | None = Field( default=None, alias="seriesDoses", title="Recommended number of doses for immunity", description=( "The recommended number of doses to achieve immunity as intended by the" " practitioner administering the dose." ), json_schema_extra={ "element_property": True, }, ) seriesDoses__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_seriesDoses", title="Extension field for ``seriesDoses``." ) targetDisease: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="targetDisease", title="Vaccine preventatable disease being targeted", description=( "The vaccine preventable disease the dose is being administered " "against." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImmunizationProtocolApplied`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "series", "authority", "targetDisease", "doseNumber", "seriesDoses", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImmunizationProtocolApplied`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("doseNumber", "doseNumber__ext")] return required_fields class ImmunizationReaction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details of a reaction that follows immunization. Categorical data indicating that an adverse event is associated in time to an immunization. """ __resource_type__ = "ImmunizationReaction" date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When reaction started", description="Date of reaction to the immunization.", json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) manifestation: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="manifestation", title="Additional information on reaction", description="Details of the reaction.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Observation"], }, ) reported: bool | None = Field( default=None, alias="reported", title="Indicates self-reported reaction", description="Self-reported indicator.", json_schema_extra={ "element_property": True, }, ) reported__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reported", title="Extension field for ``reported``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImmunizationReaction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "date", "manifestation", "reported", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImmunizationReaction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/immunizationevaluation.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ImmunizationEvaluation Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class ImmunizationEvaluation(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Immunization evaluation information. Describes a comparison of an immunization event against published recommendations to determine if the administration is "valid" in relation to those recommendations. """ __resource_type__ = "ImmunizationEvaluation" authority: fhirtypes.ReferenceType | None = Field( default=None, alias="authority", title="Who is responsible for publishing the recommendations", description="Indicates the authority who published the protocol (e.g. ACIP).", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date evaluation was performed", description=( "The date the evaluation of the vaccine administration event was " "performed." ), json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Evaluation notes", description="Additional information about the evaluation.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) doseNumber: fhirtypes.StringType | None = Field( default=None, alias="doseNumber", title="Dose number within series", description=( "Nominal position in a series as determined by the outcome of the " "evaluation process." ), json_schema_extra={ "element_property": True, }, ) doseNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doseNumber", title="Extension field for ``doseNumber``." ) doseStatus: fhirtypes.CodeableConceptType = Field( default=..., alias="doseStatus", title="Status of the dose relative to published recommendations", description=( "Indicates if the dose is valid or not valid with respect to the " "published recommendations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) doseStatusReason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="doseStatusReason", title="Reason why the doese is considered valid, invalid or some other status", description=( "Provides an explanation as to why the vaccine administration event is " "valid or not relative to the published recommendations." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description="A unique identifier assigned to this immunization evaluation record.", json_schema_extra={ "element_property": True, }, ) immunizationEvent: fhirtypes.ReferenceType = Field( default=..., alias="immunizationEvent", title="Immunization being evaluated", description="The vaccine administration event being evaluated.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Immunization"], }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Who this evaluation is for", description="The individual for whom the evaluation is being done.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) series: fhirtypes.StringType | None = Field( default=None, alias="series", title="Name of vaccine series", description=( "One possible path to achieve presumed immunity against a disease - " "within the context of an authority." ), json_schema_extra={ "element_property": True, }, ) series__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_series", title="Extension field for ``series``." ) seriesDoses: fhirtypes.StringType | None = Field( default=None, alias="seriesDoses", title="Recommended number of doses for immunity", description=( "The recommended number of doses to achieve immunity as determined by " "the outcome of the evaluation process." ), json_schema_extra={ "element_property": True, }, ) seriesDoses__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_seriesDoses", title="Extension field for ``seriesDoses``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="completed | entered-in-error", description=( "Indicates the current status of the evaluation of the vaccination " "administration event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["completed", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) targetDisease: fhirtypes.CodeableConceptType = Field( default=..., alias="targetDisease", title="The vaccine preventable disease schedule being evaluated", description="The vaccine preventable disease the dose is being evaluated against.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImmunizationEvaluation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "patient", "date", "authority", "targetDisease", "immunizationEvent", "doseStatus", "doseStatusReason", "description", "series", "doseNumber", "seriesDoses", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImmunizationEvaluation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "status", "patient", "targetDisease", "immunizationEvent", "doseStatus", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields ================================================ FILE: fhir/resources/immunizationrecommendation.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ImmunizationRecommendation(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Guidance or advice relating to an immunization. A patient's point-in-time set of recommendations (i.e. forecasting) according to a published schedule with optional supporting justification. """ __resource_type__ = "ImmunizationRecommendation" authority: fhirtypes.ReferenceType | None = Field( default=None, alias="authority", title="Who is responsible for protocol", description="Indicates the authority who published the protocol (e.g. ACIP).", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date recommendation(s) created", description="The date the immunization recommendation(s) were created.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description="A unique identifier assigned to this particular recommendation record.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Who this profile is for", description="The patient the recommendation(s) are for.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) recommendation: typing.List[ fhirtypes.ImmunizationRecommendationRecommendationType ] = Field( default=..., alias="recommendation", title="Vaccine administration recommendations", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImmunizationRecommendation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "patient", "date", "authority", "recommendation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImmunizationRecommendation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "patient", "date", "recommendation", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("date", "date__ext")] return required_fields class ImmunizationRecommendationRecommendation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Vaccine administration recommendations. """ __resource_type__ = "ImmunizationRecommendationRecommendation" contraindicatedVaccineCode: typing.List[ fhirtypes.CodeableConceptType ] | None = Field( default=None, alias="contraindicatedVaccineCode", title="Vaccine which is contraindicated to fulfill the recommendation", description="Vaccine(s) which should not be used to fulfill the recommendation.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dateCriterion: typing.List[ fhirtypes.ImmunizationRecommendationRecommendationDateCriterionType ] | None = Field( default=None, alias="dateCriterion", title="Dates governing proposed immunization", description=( "Vaccine date recommendations. For example, earliest date to " "administer, latest date to administer, etc." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Protocol details", description=( "Contains the description about the protocol under which the vaccine " "was administered." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) doseNumber: fhirtypes.StringType | None = Field( default=None, alias="doseNumber", title="Recommended dose number within series", description=( "Nominal position of the recommended dose in a series as determined by " "the evaluation and forecasting process (e.g. dose 2 is the next " "recommended dose)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) doseNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doseNumber", title="Extension field for ``doseNumber``." ) forecastReason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="forecastReason", title="Vaccine administration status reason", description="The reason for the assigned forecast status.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) forecastStatus: fhirtypes.CodeableConceptType = Field( default=..., alias="forecastStatus", title="Vaccine recommendation status", description=( "Indicates the patient status with respect to the path to immunity for " "the target disease." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) series: fhirtypes.StringType | None = Field( default=None, alias="series", title="Name of vaccination series", description=( "One possible path to achieve presumed immunity against a disease - " "within the context of an authority." ), json_schema_extra={ "element_property": True, }, ) series__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_series", title="Extension field for ``series``." ) seriesDoses: fhirtypes.StringType | None = Field( default=None, alias="seriesDoses", title="Recommended number of doses for immunity", description=( "The recommended number of doses to achieve immunity as determined by " "the evaluation and forecasting process." ), json_schema_extra={ "element_property": True, }, ) seriesDoses__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_seriesDoses", title="Extension field for ``seriesDoses``." ) supportingImmunization: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingImmunization", title="Past immunizations supporting recommendation", description=( "Immunization event history and/or evaluation that supports the status " "and recommendation." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Immunization", "ImmunizationEvaluation"], }, ) supportingPatientInformation: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingPatientInformation", title="Patient observations supporting recommendation", description=( "Patient Information that supports the status and recommendation. This" " includes patient observations, adverse reactions and " "allergy/intolerance information." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) targetDisease: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="targetDisease", title="Disease to be immunized against", description="The targeted disease for the recommendation.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) vaccineCode: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="vaccineCode", title="Vaccine or vaccine group recommendation applies to", description="Vaccine(s) or vaccine group that pertain to the recommendation.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImmunizationRecommendationRecommendation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "vaccineCode", "targetDisease", "contraindicatedVaccineCode", "forecastStatus", "forecastReason", "dateCriterion", "description", "series", "doseNumber", "seriesDoses", "supportingImmunization", "supportingPatientInformation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImmunizationRecommendationRecommendation`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "vaccineCode", "targetDisease", "contraindicatedVaccineCode", "forecastStatus", "forecastReason", "doseNumber", ] class ImmunizationRecommendationRecommendationDateCriterion( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Dates governing proposed immunization. Vaccine date recommendations. For example, earliest date to administer, latest date to administer, etc. """ __resource_type__ = "ImmunizationRecommendationRecommendationDateCriterion" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Type of date", description=( "Date classification of recommendation. For example, earliest date to " "give, latest date to give, etc." ), json_schema_extra={ "element_property": True, }, ) value: fhirtypes.DateTimeType | None = Field( default=None, alias="value", title="Recommended date", description="The date whose meaning is specified by dateCriterion.code.", json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImmunizationRecommendationRecommendationDateCriterion`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImmunizationRecommendationRecommendationDateCriterion`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("value", "value__ext")] return required_fields ================================================ FILE: fhir/resources/implementationguide.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ImplementationGuide Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ImplementationGuide(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A set of rules about how FHIR is used. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. """ __resource_type__ = "ImplementationGuide" contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the implementation guide and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the implementation guide." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the implementation guide was last" " significantly changed. The date must change when the business version" " changes and it must change if the status code changes. In addition, " "it should change when the substantive content of the implementation " "guide changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) definition: fhirtypes.ImplementationGuideDefinitionType | None = Field( default=None, alias="definition", title="Information needed to build the IG", description=( "The information needed by an IG publisher tool to publish the whole " "implementation guide." ), json_schema_extra={ "element_property": True, }, ) dependsOn: typing.List[fhirtypes.ImplementationGuideDependsOnType] | None = Field( default=None, alias="dependsOn", title="Another Implementation guide this depends on", description=( "Another implementation guide that this implementation depends on. " "Typically, an implementation guide uses value sets, profiles " "etc.defined in other implementation guides." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the implementation guide", description=( "A free text natural language description of the implementation guide " "from a consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this implementation guide is authored" " for testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) fhirVersion: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="fhirVersion", title="FHIR Version(s) this Implementation Guide targets", description=( "The version(s) of the FHIR specification that this ImplementationGuide" " targets - e.g. describes how to use. The value of this element is the" " formal version of the specification, without the revision number, " "e.g. [publication].[major].[minor], which is 4.6.0. for this version." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) fhirVersion__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_fhirVersion", title="Extension field for ``fhirVersion``." ) global_fhir: typing.List[fhirtypes.ImplementationGuideGlobalType] | None = Field( default=None, alias="global", title="Profiles that apply globally", description=( "A set of profiles that all resources covered by this implementation " "guide must conform to." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title=( "Additional identifier for the implementation guide (business " "identifier)" ), description=( "A formal identifier that is used to identify this implementation guide" " when it is represented in other formats, or referenced in a " "specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for implementation guide (if applicable)", description=( "A legal or geographic region in which the implementation guide is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) license: fhirtypes.CodeType | None = Field( default=None, alias="license", title="SPDX license code for this IG (or not-open-source)", description=( "The license that applies to this Implementation Guide, using an SPDX " "license code, or 'not-open-source'." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) license__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_license", title="Extension field for ``license``." ) manifest: fhirtypes.ImplementationGuideManifestType | None = Field( default=None, alias="manifest", title="Information about an assembled IG", description=( "Information about an assembled implementation guide, created by the " "publication tooling." ), json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this implementation guide (computer friendly)", description=( "A natural language name identifying the implementation guide. This " "name should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) packageId: fhirtypes.IdType | None = Field( default=None, alias="packageId", title="NPM Package name for IG", description=( "The NPM package name for this Implementation Guide, used in the NPM " "package distribution, which is the primary mechanism by which FHIR " "based tooling manages IG dependencies. This value must be globally " "unique, and should be assigned with care." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) packageId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_packageId", title="Extension field for ``packageId``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the implementation guide." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this implementation guide is defined", description=( "Explanation of why this implementation guide is needed and why it has " "been designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this implementation guide. Enables tracking the life-" "cycle of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this implementation guide (human friendly)", description=( "A short, descriptive, user-friendly title for the implementation " "guide." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this implementation guide, represented as a " "URI (globally unique)" ), description=( "An absolute URI that is used to identify this implementation guide " "when it is referenced in a specification, model, design or an " "instance; also called its canonical identifier. This SHOULD be " "globally unique and SHOULD be a literal address at which an " "authoritative instance of this implementation guide is (or will be) " "published. This URL can be the target of a canonical reference. It " "SHALL remain the same when the implementation guide is stored on " "different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate implementation guide instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the implementation guide", description=( "The identifier that is used to identify this version of the " "implementation guide when it is referenced in a specification, model, " "design or instance. This is an arbitrary value managed by the " "implementation guide author and is not expected to be globally unique." " For example, it might be a timestamp (e.g. yyyymmdd) if a managed " "version is not available. There is also no expectation that versions " "can be placed in a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuide`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "copyrightLabel", "packageId", "license", "fhirVersion", "dependsOn", "global", "definition", "manifest", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuide`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "packageId", "license", "fhirVersion", "dependsOn", "global", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("fhirVersion", "fhirVersion__ext"), ("name", "name__ext"), ("packageId", "packageId__ext"), ("status", "status__ext"), ("url", "url__ext"), ] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields class ImplementationGuideDefinition(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information needed to build the IG. The information needed by an IG publisher tool to publish the whole implementation guide. """ __resource_type__ = "ImplementationGuideDefinition" grouping: typing.List[ fhirtypes.ImplementationGuideDefinitionGroupingType ] | None = Field( default=None, alias="grouping", title="Grouping used to present related resources in the IG", description=( "A logical group of resources. Logical groups can be used when building" " pages." ), json_schema_extra={ "element_property": True, }, ) page: fhirtypes.ImplementationGuideDefinitionPageType | None = Field( default=None, alias="page", title="Page/Section in the Guide", description=( "A page / section in the implementation guide. The root page is the " "implementation guide home page." ), json_schema_extra={ "element_property": True, }, ) parameter: typing.List[ fhirtypes.ImplementationGuideDefinitionParameterType ] | None = Field( default=None, alias="parameter", title="Defines how IG is built by tools", description=( "A set of parameters that defines how the implementation guide is " "built. The parameters are defined by the relevant tools that build the" " implementation guides." ), json_schema_extra={ "element_property": True, }, ) resource: typing.List[ fhirtypes.ImplementationGuideDefinitionResourceType ] | None = Field( default=None, alias="resource", title="Resource in the implementation guide", description=( "A resource that is part of the implementation guide. Conformance " "resources (value set, structure definition, capability statements " "etc.) are obvious candidates for inclusion, but any kind of resource " "can be included as an example resource." ), json_schema_extra={ "element_property": True, }, ) template: typing.List[ fhirtypes.ImplementationGuideDefinitionTemplateType ] | None = Field( default=None, alias="template", title="A template for building resources", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuideDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "grouping", "resource", "page", "parameter", "template", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuideDefinition`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ImplementationGuideDefinitionGrouping(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Grouping used to present related resources in the IG. A logical group of resources. Logical groups can be used when building pages. """ __resource_type__ = "ImplementationGuideDefinitionGrouping" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Human readable text describing the package", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Descriptive name for the package", description=( "The human-readable title to display for the package of resources when " "rendering the implementation guide." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuideDefinitionGrouping`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "description"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuideDefinitionGrouping`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields class ImplementationGuideDefinitionPage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Page/Section in the Guide. A page / section in the implementation guide. The root page is the implementation guide home page. """ __resource_type__ = "ImplementationGuideDefinitionPage" generation: fhirtypes.CodeType | None = Field( default=None, alias="generation", title="html | markdown | xml | generated", description="A code that indicates how the page is generated.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["html", "markdown", "xml", "generated"], }, ) generation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_generation", title="Extension field for ``generation``." ) name: fhirtypes.UrlType | None = Field( default=None, alias="name", title="Name of the page when published", description="The url by which the page should be known when published.", json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) page: typing.List[fhirtypes.ImplementationGuideDefinitionPageType] | None = Field( default=None, alias="page", title="Nested Pages / Sections", description="Nested Pages/Sections under this page.", json_schema_extra={ "element_property": True, }, ) sourceMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="sourceMarkdown", title="Source for page", description="Indicates the URL or the actual content to provide for the page.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e source[x] "one_of_many": "source", "one_of_many_required": False, }, ) sourceMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceMarkdown", title="Extension field for ``sourceMarkdown``.", ) sourceString: fhirtypes.StringType | None = Field( default=None, alias="sourceString", title="Source for page", description="Indicates the URL or the actual content to provide for the page.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e source[x] "one_of_many": "source", "one_of_many_required": False, }, ) sourceString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceString", title="Extension field for ``sourceString``.", ) sourceUrl: fhirtypes.UrlType | None = Field( default=None, alias="sourceUrl", title="Source for page", description="Indicates the URL or the actual content to provide for the page.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e source[x] "one_of_many": "source", "one_of_many_required": False, }, ) sourceUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceUrl", title="Extension field for ``sourceUrl``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Short title shown for navigational assistance", description=( "A short title used to represent this page in navigational structures " "such as table of contents, bread crumbs, etc." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuideDefinitionPage`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sourceUrl", "sourceString", "sourceMarkdown", "name", "title", "generation", "page", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuideDefinitionPage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("generation", "generation__ext"), ("name", "name__ext"), ("title", "title__ext"), ] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"source": ["sourceMarkdown", "sourceString", "sourceUrl"]} return one_of_many_fields class ImplementationGuideDefinitionParameter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Defines how IG is built by tools. A set of parameters that defines how the implementation guide is built. The parameters are defined by the relevant tools that build the implementation guides. """ __resource_type__ = "ImplementationGuideDefinitionParameter" code: fhirtypes.CodingType = Field( default=..., alias="code", title="Code that identifies parameter", description="A tool-specific code that defines the parameter.", json_schema_extra={ "element_property": True, }, ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="Value for named type", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuideDefinitionParameter`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuideDefinitionParameter`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("value", "value__ext")] return required_fields class ImplementationGuideDefinitionResource(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Resource in the implementation guide. A resource that is part of the implementation guide. Conformance resources (value set, structure definition, capability statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource. """ __resource_type__ = "ImplementationGuideDefinitionResource" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Reason why included in guide", description=( "A description of the reason that a resource has been included in the " "implementation guide." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) fhirVersion: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="fhirVersion", title="Versions this applies to (if different to IG)", description=( "Indicates the FHIR Version(s) this artifact is intended to apply to. " "If no versions are specified, the resource is assumed to apply to all " "the versions stated in ImplementationGuide.fhirVersion." ), json_schema_extra={ "element_property": True, }, ) fhirVersion__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_fhirVersion", title="Extension field for ``fhirVersion``." ) groupingId: fhirtypes.IdType | None = Field( default=None, alias="groupingId", title="Grouping this is part of", description="Reference to the id of the grouping this resource appears in.", json_schema_extra={ "element_property": True, }, ) groupingId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_groupingId", title="Extension field for ``groupingId``." ) isExample: bool | None = Field( default=None, alias="isExample", title="Is this an example", description="If true, indicates the resource is an example instance.", json_schema_extra={ "element_property": True, }, ) isExample__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isExample", title="Extension field for ``isExample``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Human readable name for the resource", description=( "A human assigned name for the resource. All resources SHOULD have a " "name, but the name may be extracted from the resource (e.g. " "ValueSet.name)." ), json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) profile: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="profile", title="Profile(s) this is an example of", description="If present, indicates profile(s) the instance is valid against.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) profile__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) reference: fhirtypes.ReferenceType = Field( default=..., alias="reference", title="Location of the resource", description="Where this resource is found.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuideDefinitionResource`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "reference", "fhirVersion", "name", "description", "isExample", "profile", "groupingId", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuideDefinitionResource`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ImplementationGuideDefinitionTemplate(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A template for building resources. """ __resource_type__ = "ImplementationGuideDefinitionTemplate" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Type of template specified", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) scope: fhirtypes.StringType | None = Field( default=None, alias="scope", title="The scope in which the template applies", description=None, json_schema_extra={ "element_property": True, }, ) scope__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_scope", title="Extension field for ``scope``." ) source: fhirtypes.StringType | None = Field( default=None, alias="source", title="The source location for the template", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_source", title="Extension field for ``source``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuideDefinitionTemplate`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "source", "scope"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuideDefinitionTemplate`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext"), ("source", "source__ext")] return required_fields class ImplementationGuideDependsOn(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Another Implementation guide this depends on. Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, profiles etc.defined in other implementation guides. """ __resource_type__ = "ImplementationGuideDependsOn" packageId: fhirtypes.IdType | None = Field( default=None, alias="packageId", title="NPM Package name for IG this depends on", description=( "The NPM package name for the Implementation Guide that this IG depends" " on." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) packageId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_packageId", title="Extension field for ``packageId``." ) reason: fhirtypes.MarkdownType | None = Field( default=None, alias="reason", title="Why dependency exists", description=( "A description explaining the nature of the dependency on the listed " "IG." ), json_schema_extra={ "element_property": True, }, ) reason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reason", title="Extension field for ``reason``." ) uri: fhirtypes.CanonicalType | None = Field( default=None, alias="uri", title="Identity of the IG that this depends on", description="A canonical reference to the Implementation guide for the dependency.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ImplementationGuide"], }, ) uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uri", title="Extension field for ``uri``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Version of the IG", description=( "The version of the IG that is depended on, when the correct version is" " required to understand the IG correctly." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuideDependsOn`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "uri", "packageId", "version", "reason", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuideDependsOn`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "uri", "packageId", "version"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("uri", "uri__ext")] return required_fields class ImplementationGuideGlobal(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Profiles that apply globally. A set of profiles that all resources covered by this implementation guide must conform to. """ __resource_type__ = "ImplementationGuideGlobal" profile: fhirtypes.CanonicalType | None = Field( default=None, alias="profile", title="Profile that all resources must conform to", description="A reference to the profile that all instances must conform to.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="Type this profile applies to", description="The type of resource that all instances must conform to.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuideGlobal`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "profile"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuideGlobal`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "profile"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("profile", "profile__ext"), ("type", "type__ext")] return required_fields class ImplementationGuideManifest(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about an assembled IG. Information about an assembled implementation guide, created by the publication tooling. """ __resource_type__ = "ImplementationGuideManifest" image: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="image", title="Image within the IG", description="Indicates a relative path to an image that exists within the IG.", json_schema_extra={ "element_property": True, }, ) image__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_image", title="Extension field for ``image``." ) other: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="other", title="Additional linkable file in IG", description=( "Indicates the relative path of an additional non-page, non-image file " "that is part of the IG - e.g. zip, jar and similar files that could be" " the target of a hyperlink in a derived IG." ), json_schema_extra={ "element_property": True, }, ) other__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_other", title="Extension field for ``other``." ) page: typing.List[fhirtypes.ImplementationGuideManifestPageType] | None = Field( default=None, alias="page", title="HTML page within the parent IG", description="Information about a page within the IG.", json_schema_extra={ "element_property": True, }, ) rendering: fhirtypes.UrlType | None = Field( default=None, alias="rendering", title="Location of rendered implementation guide", description=( "A pointer to official web page, PDF or other rendering of the " "implementation guide." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) rendering__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rendering", title="Extension field for ``rendering``." ) resource: typing.List[fhirtypes.ImplementationGuideManifestResourceType] = Field( default=..., alias="resource", title="Resource in the implementation guide", description=( "A resource that is part of the implementation guide. Conformance " "resources (value set, structure definition, capability statements " "etc.) are obvious candidates for inclusion, but any kind of resource " "can be included as an example resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuideManifest`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "rendering", "resource", "page", "image", "other", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuideManifest`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "rendering", "resource"] class ImplementationGuideManifestPage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. HTML page within the parent IG. Information about a page within the IG. """ __resource_type__ = "ImplementationGuideManifestPage" anchor: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="anchor", title="Anchor available on the page", description="The name of an anchor available on the page.", json_schema_extra={ "element_property": True, }, ) anchor__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_anchor", title="Extension field for ``anchor``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="HTML page name", description="Relative path to the page.", json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Title of the page, for references", description="Label for the page intended for human display.", json_schema_extra={ "element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuideManifestPage`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "title", "anchor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuideManifestPage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields class ImplementationGuideManifestResource(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Resource in the implementation guide. A resource that is part of the implementation guide. Conformance resources (value set, structure definition, capability statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource. """ __resource_type__ = "ImplementationGuideManifestResource" isExample: bool | None = Field( default=None, alias="isExample", title="Is this an example", description="If true, indicates the resource is an example instance.", json_schema_extra={ "element_property": True, }, ) isExample__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isExample", title="Extension field for ``isExample``." ) profile: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="profile", title="Profile(s) this is an example of", description="If present, indicates profile(s) the instance is valid against.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) profile__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) reference: fhirtypes.ReferenceType = Field( default=..., alias="reference", title="Location of the resource", description="Where this resource is found.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) relativePath: fhirtypes.UrlType | None = Field( default=None, alias="relativePath", title="Relative path for page in IG", description="The relative path for primary page for this resource within the IG.", json_schema_extra={ "element_property": True, }, ) relativePath__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_relativePath", title="Extension field for ``relativePath``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ImplementationGuideManifestResource`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "reference", "isExample", "profile", "relativePath", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ImplementationGuideManifestResource`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "reference"] ================================================ FILE: fhir/resources/ingredient.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Ingredient Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Ingredient(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An ingredient of a manufactured item or pharmaceutical product. """ __resource_type__ = "Ingredient" allergenicIndicator: bool | None = Field( default=None, alias="allergenicIndicator", title="If the ingredient is a known or suspected allergen", description=( "If the ingredient is a known or suspected allergen. Note that this is " "a property of the substance, so if a reference to a " "SubstanceDefinition is used to decribe that (rather than just a code)," " the allergen information should go there, not here." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) allergenicIndicator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allergenicIndicator", title="Extension field for ``allergenicIndicator``.", ) comment: fhirtypes.MarkdownType | None = Field( default=None, alias="comment", title=( "A place for providing any notes that are relevant to the component, " "e.g. removed during process, adjusted for loss on drying" ), description=None, json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) for_fhir: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="for", title="The product which this ingredient is a constituent part of", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "MedicinalProductDefinition", "AdministrableProductDefinition", "ManufacturedItemDefinition", ], }, ) function: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="function", title=( "Precise action within the drug product, e.g. antioxidant, alkalizing " "agent" ), description=( "A classification of the ingredient identifying its precise purpose(s) " "in the drug product. This extends the Ingredient.role to add more " "detail. Example: antioxidant, alkalizing agent." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) group: fhirtypes.CodeableConceptType | None = Field( default=None, alias="group", title=( "A classification of the ingredient according to where in the physical " "item it tends to be used, such the outer shell of a tablet, inner body" " or ink" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="An identifier or code by which the ingredient can be referenced", description=( "The identifier(s) of this Ingredient that are assigned by business " "processes and/or used to refer to it when a direct URL reference to " "the resource itself is not appropriate." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) manufacturer: typing.List[fhirtypes.IngredientManufacturerType] | None = Field( default=None, alias="manufacturer", title="An organization that manufactures this ingredient", description=( "The organization(s) that manufacture this ingredient. Can be used to " "indicate: 1) Organizations we are aware of that manufacture " "this ingredient 2) Specific Manufacturer(s) currently being " "used 3) Set of organisations allowed to manufacture this " "ingredient for this product Users must be clear on the " "application of context relevant to their use case." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) role: fhirtypes.CodeableConceptType = Field( default=..., alias="role", title="Purpose of the ingredient within the product, e.g. active, inactive", description=( "A classification of the ingredient identifying its purpose within the " "product, e.g. active, inactive." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this ingredient. Enables tracking the life-cycle of the " "content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) substance: fhirtypes.IngredientSubstanceType = Field( default=..., alias="substance", title="The substance that comprises this ingredient", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Ingredient`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "for", "role", "function", "group", "allergenicIndicator", "comment", "manufacturer", "substance", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Ingredient`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "for", "role", "function", "group", "allergenicIndicator", "manufacturer", "substance", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class IngredientManufacturer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An organization that manufactures this ingredient. The organization(s) that manufacture this ingredient. Can be used to indicate: 1) Organizations we are aware of that manufacture this ingredient 2) Specific Manufacturer(s) currently being used 3) Set of organisations allowed to manufacture this ingredient for this product Users must be clear on the application of context relevant to their use case. """ __resource_type__ = "IngredientManufacturer" manufacturer: fhirtypes.ReferenceType = Field( default=..., alias="manufacturer", title="An organization that manufactures this ingredient", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) role: fhirtypes.CodeType | None = Field( default=None, alias="role", title="allowed | possible | actual", description=( "The way in which this manufacturer is associated with the ingredient. " "For example whether it is a possible one (others allowed), or an " "exclusive authorized one for this ingredient. Note that this is not " "the manufacturing process role." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["allowed", "possible", "actual"], }, ) role__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_role", title="Extension field for ``role``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``IngredientManufacturer`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "role", "manufacturer"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``IngredientManufacturer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "role", "manufacturer"] class IngredientSubstance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The substance that comprises this ingredient. """ __resource_type__ = "IngredientSubstance" code: fhirtypes.CodeableReferenceType = Field( default=..., alias="code", title="A code or full resource that represents the ingredient substance", description="A code or full resource that represents the ingredient's substance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SubstanceDefinition"], }, ) strength: typing.List[fhirtypes.IngredientSubstanceStrengthType] | None = Field( default=None, alias="strength", title=( "The quantity of substance, per presentation, or per volume or mass, " "and type of quantity" ), description=( "The quantity of substance in the unit of presentation, or in the " "volume (or mass) of the single pharmaceutical product or manufactured " "item. The allowed repetitions do not represent different strengths, " "but are different representations - mathematically equivalent - of a " "single strength." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``IngredientSubstance`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "strength"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``IngredientSubstance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "strength"] class IngredientSubstanceStrength(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The quantity of substance, per presentation, or per volume or mass, and type of quantity. The quantity of substance in the unit of presentation, or in the volume (or mass) of the single pharmaceutical product or manufactured item. The allowed repetitions do not represent different strengths, but are different representations - mathematically equivalent - of a single strength. """ __resource_type__ = "IngredientSubstanceStrength" basis: fhirtypes.CodeableConceptType | None = Field( default=None, alias="basis", title=( "A code that indicates if the strength is, for example, based on the " "ingredient substance as stated or on the substance base (when the " "ingredient is a salt)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) concentrationCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="concentrationCodeableConcept", title="The strength per unitary volume (or mass)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e concentration[x] "one_of_many": "concentration", "one_of_many_required": False, }, ) concentrationQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="concentrationQuantity", title="The strength per unitary volume (or mass)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e concentration[x] "one_of_many": "concentration", "one_of_many_required": False, }, ) concentrationRatio: fhirtypes.RatioType | None = Field( default=None, alias="concentrationRatio", title="The strength per unitary volume (or mass)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e concentration[x] "one_of_many": "concentration", "one_of_many_required": False, }, ) concentrationRatioRange: fhirtypes.RatioRangeType | None = Field( default=None, alias="concentrationRatioRange", title="The strength per unitary volume (or mass)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e concentration[x] "one_of_many": "concentration", "one_of_many_required": False, }, ) country: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="country", title="Where the strength range applies", description="The country or countries for which the strength range applies.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) measurementPoint: fhirtypes.StringType | None = Field( default=None, alias="measurementPoint", title="When strength is measured at a particular point or distance", description=( "For when strength is measured at a particular point or distance. There" " are products where strength is measured at a particular point. For " "example, the strength of the ingredient in some inhalers is measured " "at a particular position relative to the point of aerosolization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) measurementPoint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_measurementPoint", title="Extension field for ``measurementPoint``.", ) presentationCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="presentationCodeableConcept", title="The quantity of substance in the unit of presentation", description=( "The quantity of substance in the unit of presentation, or in the " "volume (or mass) of the single pharmaceutical product or manufactured " "item. Unit of presentation refers to the quantity that the item occurs" " in e.g. a strength per tablet size, perhaps 'per 20mg' (the size of " "the tablet). It is not generally normalized as a unitary unit, which " "would be 'per mg')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e presentation[x] "one_of_many": "presentation", "one_of_many_required": False, }, ) presentationQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="presentationQuantity", title="The quantity of substance in the unit of presentation", description=( "The quantity of substance in the unit of presentation, or in the " "volume (or mass) of the single pharmaceutical product or manufactured " "item. Unit of presentation refers to the quantity that the item occurs" " in e.g. a strength per tablet size, perhaps 'per 20mg' (the size of " "the tablet). It is not generally normalized as a unitary unit, which " "would be 'per mg')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e presentation[x] "one_of_many": "presentation", "one_of_many_required": False, }, ) presentationRatio: fhirtypes.RatioType | None = Field( default=None, alias="presentationRatio", title="The quantity of substance in the unit of presentation", description=( "The quantity of substance in the unit of presentation, or in the " "volume (or mass) of the single pharmaceutical product or manufactured " "item. Unit of presentation refers to the quantity that the item occurs" " in e.g. a strength per tablet size, perhaps 'per 20mg' (the size of " "the tablet). It is not generally normalized as a unitary unit, which " "would be 'per mg')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e presentation[x] "one_of_many": "presentation", "one_of_many_required": False, }, ) presentationRatioRange: fhirtypes.RatioRangeType | None = Field( default=None, alias="presentationRatioRange", title="The quantity of substance in the unit of presentation", description=( "The quantity of substance in the unit of presentation, or in the " "volume (or mass) of the single pharmaceutical product or manufactured " "item. Unit of presentation refers to the quantity that the item occurs" " in e.g. a strength per tablet size, perhaps 'per 20mg' (the size of " "the tablet). It is not generally normalized as a unitary unit, which " "would be 'per mg')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e presentation[x] "one_of_many": "presentation", "one_of_many_required": False, }, ) referenceStrength: typing.List[ fhirtypes.IngredientSubstanceStrengthReferenceStrengthType ] | None = Field( default=None, alias="referenceStrength", title="Strength expressed in terms of a reference substance", description=( "Strength expressed in terms of a reference substance. For when the " "ingredient strength is additionally expressed as equivalent to the " "strength of some other closely related substance (e.g. salt vs. base)." " Reference strength represents the strength (quantitative composition)" " of the active moiety of the active substance. There are situations " "when the active substance and active moiety are different, therefore " "both a strength and a reference strength are needed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) textConcentration: fhirtypes.StringType | None = Field( default=None, alias="textConcentration", title=( "Text of either the whole concentration strength or a part of it (rest " "being in Strength.concentration as a ratio)" ), description=( "A textual represention of either the whole of the concentration " "strength or a part of it - with the rest being in " "Strength.concentration as a ratio." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) textConcentration__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_textConcentration", title="Extension field for ``textConcentration``.", ) textPresentation: fhirtypes.StringType | None = Field( default=None, alias="textPresentation", title=( "Text of either the whole presentation strength or a part of it (rest " "being in Strength.presentation as a ratio)" ), description=( "A textual represention of either the whole of the presentation " "strength or a part of it - with the rest being in " "Strength.presentation as a ratio." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) textPresentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_textPresentation", title="Extension field for ``textPresentation``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``IngredientSubstanceStrength`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "presentationRatio", "presentationRatioRange", "presentationCodeableConcept", "presentationQuantity", "textPresentation", "concentrationRatio", "concentrationRatioRange", "concentrationCodeableConcept", "concentrationQuantity", "textConcentration", "basis", "measurementPoint", "country", "referenceStrength", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``IngredientSubstanceStrength`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "presentationRatio", "presentationRatioRange", "presentationCodeableConcept", "presentationQuantity", "textPresentation", "concentrationRatio", "concentrationRatioRange", "concentrationCodeableConcept", "concentrationQuantity", "textConcentration", "basis", "measurementPoint", "country", "referenceStrength", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "concentration": [ "concentrationCodeableConcept", "concentrationQuantity", "concentrationRatio", "concentrationRatioRange", ], "presentation": [ "presentationCodeableConcept", "presentationQuantity", "presentationRatio", "presentationRatioRange", ], } return one_of_many_fields class IngredientSubstanceStrengthReferenceStrength(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Strength expressed in terms of a reference substance. Strength expressed in terms of a reference substance. For when the ingredient strength is additionally expressed as equivalent to the strength of some other closely related substance (e.g. salt vs. base). Reference strength represents the strength (quantitative composition) of the active moiety of the active substance. There are situations when the active substance and active moiety are different, therefore both a strength and a reference strength are needed. """ __resource_type__ = "IngredientSubstanceStrengthReferenceStrength" country: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="country", title="Where the strength range applies", description="The country or countries for which the strength range applies.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) measurementPoint: fhirtypes.StringType | None = Field( default=None, alias="measurementPoint", title="When strength is measured at a particular point or distance", description="For when strength is measured at a particular point or distance.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) measurementPoint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_measurementPoint", title="Extension field for ``measurementPoint``.", ) strengthQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="strengthQuantity", title="Strength expressed in terms of a reference substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e strength[x] "one_of_many": "strength", "one_of_many_required": True, }, ) strengthRatio: fhirtypes.RatioType | None = Field( default=None, alias="strengthRatio", title="Strength expressed in terms of a reference substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e strength[x] "one_of_many": "strength", "one_of_many_required": True, }, ) strengthRatioRange: fhirtypes.RatioRangeType | None = Field( default=None, alias="strengthRatioRange", title="Strength expressed in terms of a reference substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e strength[x] "one_of_many": "strength", "one_of_many_required": True, }, ) substance: fhirtypes.CodeableReferenceType = Field( default=..., alias="substance", title="Relevant reference substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SubstanceDefinition"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``IngredientSubstanceStrengthReferenceStrength`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "substance", "strengthRatio", "strengthRatioRange", "strengthQuantity", "measurementPoint", "country", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``IngredientSubstanceStrengthReferenceStrength`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "substance", "strengthRatio", "strengthRatioRange", "strengthQuantity", "measurementPoint", "country", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "strength": ["strengthQuantity", "strengthRatio", "strengthRatioRange"] } return one_of_many_fields ================================================ FILE: fhir/resources/insuranceplan.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/InsurancePlan Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class InsurancePlan(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details of a Health Insurance product/plan provided by an organization. """ __resource_type__ = "InsurancePlan" administeredBy: fhirtypes.ReferenceType | None = Field( default=None, alias="administeredBy", title="Product administrator", description=( "An organization which administer other services such as underwriting, " "customer service and/or claims processing on behalf of the health " "insurance product owner." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) alias: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="alias", title="Alternate names", description=( "A list of alternate names that the product is known as, or was known " "as in the past." ), json_schema_extra={ "element_property": True, }, ) alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_alias", title="Extension field for ``alias``." ) contact: typing.List[fhirtypes.ExtendedContactDetailType] | None = Field( default=None, alias="contact", title="Official contact details relevant to the health insurance plan/product", description=( "The contact details of communication devices available relevant to the" " specific Insurance Plan/Product. This can include addresses, phone " "numbers, fax numbers, mobile numbers, email addresses and web sites." ), json_schema_extra={ "element_property": True, }, ) coverage: typing.List[fhirtypes.InsurancePlanCoverageType] | None = Field( default=None, alias="coverage", title="Coverage details", description="Details about the coverage offered by the insurance product.", json_schema_extra={ "element_property": True, }, ) coverageArea: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="coverageArea", title="Where product applies", description=( "The geographic region in which a health insurance product's benefits " "apply." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title="Technical endpoint", description=( "The technical endpoints providing access to services operated for the " "health insurance product." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for Product", description=( "Business identifiers assigned to this health insurance product which " "remain constant as the resource is updated and propagates from server " "to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Official name", description=( "Official name of the health insurance product as designated by the " "owner." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) network: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="network", title="What networks are Included", description="Reference to the network included in the health insurance product.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) ownedBy: fhirtypes.ReferenceType | None = Field( default=None, alias="ownedBy", title="Product issuer", description=( "The entity that is providing the health insurance product and " "underwriting the risk. This is typically an insurance carriers, other" " third-party payers, or health plan sponsors comonly referred to as " "'payers'." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="When the product is available", description="The period of time that the health insurance product is available.", json_schema_extra={ "element_property": True, }, ) plan: typing.List[fhirtypes.InsurancePlanPlanType] | None = Field( default=None, alias="plan", title="Plan details", description="Details about an insurance plan.", json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description="The current state of the health insurance product.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Kind of product", description="The kind of health insurance product.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InsurancePlan`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "type", "name", "alias", "period", "ownedBy", "administeredBy", "coverageArea", "contact", "endpoint", "network", "coverage", "plan", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InsurancePlan`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "type", "name", "ownedBy", "administeredBy", "coverageArea", ] class InsurancePlanCoverage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Coverage details. Details about the coverage offered by the insurance product. """ __resource_type__ = "InsurancePlanCoverage" benefit: typing.List[fhirtypes.InsurancePlanCoverageBenefitType] = Field( default=..., alias="benefit", title="List of benefits", description="Specific benefits under this type of coverage.", json_schema_extra={ "element_property": True, }, ) network: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="network", title="What networks provide coverage", description="Reference to the network that providing the type of coverage.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Type of coverage", description=( "Type of coverage (Medical; Dental; Mental Health; Substance Abuse; " "Vision; Drug; Short Term; Long Term Care; Hospice; Home Health)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InsurancePlanCoverage`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "network", "benefit"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InsurancePlanCoverage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class InsurancePlanCoverageBenefit(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. List of benefits. Specific benefits under this type of coverage. """ __resource_type__ = "InsurancePlanCoverageBenefit" limit: typing.List[fhirtypes.InsurancePlanCoverageBenefitLimitType] | None = Field( default=None, alias="limit", title="Benefit limits", description="The specific limits on the benefit.", json_schema_extra={ "element_property": True, }, ) requirement: fhirtypes.StringType | None = Field( default=None, alias="requirement", title="Referral requirements", description="The referral requirements to have access/coverage for this benefit.", json_schema_extra={ "element_property": True, }, ) requirement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requirement", title="Extension field for ``requirement``." ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Type of benefit", description=( "Type of benefit (primary care; speciality care; inpatient; " "outpatient)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InsurancePlanCoverageBenefit`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "requirement", "limit"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InsurancePlanCoverageBenefit`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class InsurancePlanCoverageBenefitLimit(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Benefit limits. The specific limits on the benefit. """ __resource_type__ = "InsurancePlanCoverageBenefitLimit" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Benefit limit details", description="The specific limit on the benefit.", json_schema_extra={ "element_property": True, }, ) value: fhirtypes.QuantityType | None = Field( default=None, alias="value", title="Maximum value allowed", description=( "The maximum amount of a service item a plan will pay for a covered " "benefit. For examples. wellness visits, or eyeglasses." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InsurancePlanCoverageBenefitLimit`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "value", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InsurancePlanCoverageBenefitLimit`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class InsurancePlanPlan(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Plan details. Details about an insurance plan. """ __resource_type__ = "InsurancePlanPlan" coverageArea: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="coverageArea", title="Where product applies", description=( "The geographic region in which a health insurance plan's benefits " "apply." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) generalCost: typing.List[fhirtypes.InsurancePlanPlanGeneralCostType] | None = Field( default=None, alias="generalCost", title="Overall costs", description="Overall costs associated with the plan.", json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for Product", description=( "Business identifiers assigned to this health insurance plan which " "remain constant as the resource is updated and propagates from server " "to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) network: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="network", title="What networks provide coverage", description="Reference to the network that providing the type of coverage.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) specificCost: typing.List[ fhirtypes.InsurancePlanPlanSpecificCostType ] | None = Field( default=None, alias="specificCost", title="Specific costs", description="Costs associated with the coverage provided by the product.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Type of plan", description='Type of plan. For example, "Platinum" or "High Deductable".', json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InsurancePlanPlan`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "type", "coverageArea", "network", "generalCost", "specificCost", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InsurancePlanPlan`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "identifier", "coverageArea"] class InsurancePlanPlanGeneralCost(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Overall costs. Overall costs associated with the plan. """ __resource_type__ = "InsurancePlanPlanGeneralCost" comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Additional cost information", description=( "Additional information about the general costs associated with this " "plan." ), json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) cost: fhirtypes.MoneyType | None = Field( default=None, alias="cost", title="Cost value", description="Value of the cost.", json_schema_extra={ "element_property": True, }, ) groupSize: fhirtypes.PositiveIntType | None = Field( default=None, alias="groupSize", title="Number of enrollees", description="Number of participants enrolled in the plan.", json_schema_extra={ "element_property": True, }, ) groupSize__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_groupSize", title="Extension field for ``groupSize``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Type of cost", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InsurancePlanPlanGeneralCost`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "groupSize", "cost", "comment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InsurancePlanPlanGeneralCost`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class InsurancePlanPlanSpecificCost(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specific costs. Costs associated with the coverage provided by the product. """ __resource_type__ = "InsurancePlanPlanSpecificCost" benefit: typing.List[ fhirtypes.InsurancePlanPlanSpecificCostBenefitType ] | None = Field( default=None, alias="benefit", title="Benefits list", description="List of the specific benefits under this category of benefit.", json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType = Field( default=..., alias="category", title="General category of benefit", description=( "General category of benefit (Medical; Dental; Vision; Drug; Mental " "Health; Substance Abuse; Hospice, Home Health)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InsurancePlanPlanSpecificCost`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "category", "benefit"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InsurancePlanPlanSpecificCost`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class InsurancePlanPlanSpecificCostBenefit(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Benefits list. List of the specific benefits under this category of benefit. """ __resource_type__ = "InsurancePlanPlanSpecificCostBenefit" cost: typing.List[ fhirtypes.InsurancePlanPlanSpecificCostBenefitCostType ] | None = Field( default=None, alias="cost", title="List of the costs", description="List of the costs associated with a specific benefit.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Type of specific benefit", description=( "Type of specific benefit (preventative; primary care office visit; " "speciality office visit; hospitalization; emergency room; urgent " "care)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InsurancePlanPlanSpecificCostBenefit`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "cost"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InsurancePlanPlanSpecificCostBenefit`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class InsurancePlanPlanSpecificCostBenefitCost(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. List of the costs. List of the costs associated with a specific benefit. """ __resource_type__ = "InsurancePlanPlanSpecificCostBenefitCost" applicability: fhirtypes.CodeableConceptType | None = Field( default=None, alias="applicability", title="in-network | out-of-network | other", description=( "Whether the cost applies to in-network or out-of-network providers " "(in-network; out-of-network; other)." ), json_schema_extra={ "element_property": True, }, ) qualifiers: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="qualifiers", title="Additional information about the cost", description=( "Additional information about the cost, such as information about " "funding sources (e.g. HSA, HRA, FSA, RRA)." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Type of cost", description=( "Type of cost (copay; individual cap; family cap; coinsurance; " "deductible)." ), json_schema_extra={ "element_property": True, }, ) value: fhirtypes.QuantityType | None = Field( default=None, alias="value", title="The actual cost value", description=( "The actual cost value. (some of the costs may be represented as " "percentages rather than currency, e.g. 10% coinsurance)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InsurancePlanPlanSpecificCostBenefitCost`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "applicability", "qualifiers", "value", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InsurancePlanPlanSpecificCostBenefitCost`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/integer64.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/integer64 Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import fhirtypes, primitivetype class Integer64(primitivetype.PrimitiveType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Primitive Type integer64. A very large whole number """ __resource_type__ = "integer64" value: fhirtypes.Integer64Type | None = Field( default=None, alias="value", title="Primitive value for integer64", description="Primitive value for integer64", json_schema_extra={ "element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Integer64`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Integer64`` according to specification, with preserving the original sequence order. """ return [] ================================================ FILE: fhir/resources/inventoryitem.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/InventoryItem Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class InventoryItem(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A functional description of an inventory item used in inventory and supply- related workflows. """ __resource_type__ = "InventoryItem" association: typing.List[fhirtypes.InventoryItemAssociationType] | None = Field( default=None, alias="association", title="Association with other items or products", description=None, json_schema_extra={ "element_property": True, }, ) baseUnit: fhirtypes.CodeableConceptType | None = Field( default=None, alias="baseUnit", title=( "The base unit of measure - the unit in which the product is used or " "counted" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Category or class of the item", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) characteristic: typing.List[ fhirtypes.InventoryItemCharacteristicType ] | None = Field( default=None, alias="characteristic", title="Characteristic of the item", description="The descriptive or identifying characteristics of the item.", json_schema_extra={ "element_property": True, }, ) code: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="code", title="Code designating the specific type of item", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.InventoryItemDescriptionType | None = Field( default=None, alias="description", title="Descriptive characteristics of the item", description="The descriptive characteristics of the inventory item.", json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier for the inventory item", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instance: fhirtypes.InventoryItemInstanceType | None = Field( default=None, alias="instance", title="Instances or occurrences of the product", description=None, json_schema_extra={ "element_property": True, }, ) inventoryStatus: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="inventoryStatus", title="The usage status like recalled, in use, discarded", description=( "The usage status e.g. recalled, in use, discarded... This can be used " "to indicate that the items have been taken out of inventory, or are in" " use, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: typing.List[fhirtypes.InventoryItemNameType] | None = Field( default=None, alias="name", title=( "The item name(s) - the brand name, or common name, functional name, " "generic name or others" ), description=( "The item name(s) - the brand name, or common name, functional name, " "generic name." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) netContent: fhirtypes.QuantityType | None = Field( default=None, alias="netContent", title="Net content or amount present in the item", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) productReference: fhirtypes.ReferenceType | None = Field( default=None, alias="productReference", title="Link to a product resource used in clinical workflows", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Medication", "Device", "NutritionProduct", "BiologicallyDerivedProduct", ], }, ) responsibleOrganization: typing.List[ fhirtypes.InventoryItemResponsibleOrganizationType ] | None = Field( default=None, alias="responsibleOrganization", title="Organization(s) responsible for the product", description=None, json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | inactive | entered-in-error | unknown", description="Status of the item entry.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "inactive", "entered-in-error", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InventoryItem`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "category", "code", "name", "responsibleOrganization", "description", "inventoryStatus", "baseUnit", "netContent", "association", "characteristic", "instance", "productReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InventoryItem`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "category", "code", "name", "inventoryStatus", "baseUnit", "netContent", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class InventoryItemAssociation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Association with other items or products. """ __resource_type__ = "InventoryItemAssociation" associationType: fhirtypes.CodeableConceptType = Field( default=..., alias="associationType", title="The type of association between the device and the other item", description=( "This attribute defined the type of association when establishing " "associations or relations between items, e.g. 'packaged within' or " "'used with' or 'to be mixed with." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) quantity: fhirtypes.RatioType = Field( default=..., alias="quantity", title="The quantity of the product in this product", description=( "The quantity of the related product in this product - Numerator is the" " quantity of the related product. Denominator is the quantity of the " "present product. For example a value of 20 means that this product " "contains 20 units of the related product; a value of 1:20 means the " "inverse - that the contained product contains 20 units of the present " "product." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) relatedItem: fhirtypes.ReferenceType = Field( default=..., alias="relatedItem", title="The related item or product", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "InventoryItem", "Medication", "MedicationKnowledge", "Device", "DeviceDefinition", "NutritionProduct", "BiologicallyDerivedProduct", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InventoryItemAssociation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "associationType", "relatedItem", "quantity", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InventoryItemAssociation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "associationType", "relatedItem", "quantity"] class InventoryItemCharacteristic(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Characteristic of the item. The descriptive or identifying characteristics of the item. """ __resource_type__ = "InventoryItemCharacteristic" characteristicType: fhirtypes.CodeableConceptType = Field( default=..., alias="characteristicType", title="The characteristic that is being defined", description="The type of characteristic that is being defined.", json_schema_extra={ "element_property": True, }, ) valueAddress: fhirtypes.AddressType | None = Field( default=None, alias="valueAddress", title="The value of the attribute", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="valueAnnotation", title="The value of the attribute", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="The value of the attribute", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="The value of the attribute", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="The value of the attribute", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="The value of the attribute", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueDuration: fhirtypes.DurationType | None = Field( default=None, alias="valueDuration", title="The value of the attribute", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="The value of the attribute", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="The value of the attribute", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="The value of the attribute", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="The value of the attribute", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="The value of the attribute", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueUrl: fhirtypes.UrlType | None = Field( default=None, alias="valueUrl", title="The value of the attribute", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUrl", title="Extension field for ``valueUrl``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InventoryItemCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "characteristicType", "valueString", "valueInteger", "valueDecimal", "valueBoolean", "valueUrl", "valueDateTime", "valueQuantity", "valueRange", "valueRatio", "valueAnnotation", "valueAddress", "valueDuration", "valueCodeableConcept", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InventoryItemCharacteristic`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAddress", "valueAnnotation", "valueBoolean", "valueCodeableConcept", "valueDateTime", "valueDecimal", "valueDuration", "valueInteger", "valueQuantity", "valueRange", "valueRatio", "valueString", "valueUrl", ] } return one_of_many_fields class InventoryItemDescription(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Descriptive characteristics of the item. The descriptive characteristics of the inventory item. """ __resource_type__ = "InventoryItemDescription" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Textual description of the item", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) language: fhirtypes.CodeType | None = Field( default=None, alias="language", title="The language that is used in the item description", description=( "The language for the item description, when an item must be described " "in different languages and those languages may be authoritative and " "not translations of a 'main' language." ), json_schema_extra={ "element_property": True, }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InventoryItemDescription`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "language", "description"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InventoryItemDescription`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class InventoryItemInstance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Instances or occurrences of the product. """ __resource_type__ = "InventoryItemInstance" expiry: fhirtypes.DateTimeType | None = Field( default=None, alias="expiry", title="The expiry date or date and time for the product", description=None, json_schema_extra={ "element_property": True, }, ) expiry__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expiry", title="Extension field for ``expiry``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="The identifier for the physical instance, typically a serial number", description=None, json_schema_extra={ "element_property": True, }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="The location that the item is associated with", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) lotNumber: fhirtypes.StringType | None = Field( default=None, alias="lotNumber", title="The lot or batch number of the item", description=None, json_schema_extra={ "element_property": True, }, ) lotNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lotNumber", title="Extension field for ``lotNumber``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="The subject that the item is associated with", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Organization"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InventoryItemInstance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "lotNumber", "expiry", "subject", "location", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InventoryItemInstance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class InventoryItemName(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The item name(s) - the brand name, or common name, functional name, generic name or others. The item name(s) - the brand name, or common name, functional name, generic name. """ __resource_type__ = "InventoryItemName" language: fhirtypes.CodeType | None = Field( default=None, alias="language", title="The language used to express the item name", description="The language that the item name is expressed in.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="The name or designation of the item", description="The name or designation that the item is given.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) nameType: fhirtypes.CodingType = Field( default=..., alias="nameType", title="The type of name e.g. 'brand-name', 'functional-name', 'common-name'", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InventoryItemName`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "nameType", "language", "name"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InventoryItemName`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "nameType", "language", "name"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("language", "language__ext"), ("name", "name__ext")] return required_fields class InventoryItemResponsibleOrganization(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Organization(s) responsible for the product. """ __resource_type__ = "InventoryItemResponsibleOrganization" organization: fhirtypes.ReferenceType = Field( default=..., alias="organization", title="An organization that is associated with the item", description=( "An organization that has an association with the item, e.g. " "manufacturer, distributor, responsible, etc." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) role: fhirtypes.CodeableConceptType = Field( default=..., alias="role", title="The role of the organization e.g. manufacturer, distributor, or other", description="The role of the organization e.g. manufacturer, distributor, etc.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InventoryItemResponsibleOrganization`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "role", "organization"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InventoryItemResponsibleOrganization`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/inventoryreport.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/InventoryReport Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class InventoryReport(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A report of inventory or stock items. """ __resource_type__ = "InventoryReport" countType: fhirtypes.CodeType | None = Field( default=None, alias="countType", title="snapshot | difference", description=( "Whether the report is about the current inventory count (snapshot) or " "a differential change in inventory (change)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["snapshot", "difference"], }, ) countType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_countType", title="Extension field for ``countType``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier for the report", description="Business identifier for the InventoryReport.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) inventoryListing: typing.List[ fhirtypes.InventoryReportInventoryListingType ] | None = Field( default=None, alias="inventoryListing", title="An inventory listing section (grouped by any of the attributes)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="A note associated with the InventoryReport", description=None, json_schema_extra={ "element_property": True, }, ) operationType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="operationType", title="addition | subtraction", description="What type of operation is being performed - addition or subtraction.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) operationTypeReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="operationTypeReason", title=( "The reason for this count - regular count, ad-hoc count, new arrivals," " etc" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reportedDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="reportedDateTime", title="When the report has been submitted", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) reportedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reportedDateTime", title="Extension field for ``reportedDateTime``.", ) reporter: fhirtypes.ReferenceType | None = Field( default=None, alias="reporter", title="Who submits the report", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Patient", "RelatedPerson", "Device", ], }, ) reportingPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="reportingPeriod", title="The period the report refers to", description=None, json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | requested | active | entered-in-error", description=( "The status of the inventory check or notification - whether this is " "draft (e.g. the report is still pending some updates) or active." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "requested", "active", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InventoryReport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "countType", "operationType", "operationTypeReason", "reportedDateTime", "reporter", "reportingPeriod", "inventoryListing", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InventoryReport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "countType", "operationType", "operationTypeReason", "reportedDateTime", "inventoryListing", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("countType", "countType__ext"), ("reportedDateTime", "reportedDateTime__ext"), ("status", "status__ext"), ] return required_fields class InventoryReportInventoryListing(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An inventory listing section (grouped by any of the attributes). """ __resource_type__ = "InventoryReportInventoryListing" countingDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="countingDateTime", title="The date and time when the items were counted", description=None, json_schema_extra={ "element_property": True, }, ) countingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_countingDateTime", title="Extension field for ``countingDateTime``.", ) item: typing.List[fhirtypes.InventoryReportInventoryListingItemType] | None = Field( default=None, alias="item", title="The item or items in this listing", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) itemStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="itemStatus", title="The status of the items that are being reported", description="The status of the items.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Location of the inventory items", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InventoryReportInventoryListing`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "location", "itemStatus", "countingDateTime", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InventoryReportInventoryListing`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "itemStatus", "item"] class InventoryReportInventoryListingItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The item or items in this listing. """ __resource_type__ = "InventoryReportInventoryListingItem" category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="The inventory category or classification of the items being reported", description=( "The inventory category or classification of the items being reported. " "This is meant not for defining the product, but for inventory " "categories e.g. 'pending recount' or 'damaged'." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) item: fhirtypes.CodeableReferenceType = Field( default=..., alias="item", title="The code or reference to the item type", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Medication", "Device", "Medication", "NutritionProduct", "InventoryItem", "BiologicallyDerivedProduct", "InventoryItem", ], }, ) quantity: fhirtypes.QuantityType = Field( default=..., alias="quantity", title="The quantity of the item or items being reported", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InventoryReportInventoryListingItem`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "category", "quantity", "item"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InventoryReportInventoryListingItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "category", "quantity", "item"] ================================================ FILE: fhir/resources/invoice.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Invoice Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Invoice(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Invoice containing ChargeItems from an Account. Invoice containing collected ChargeItems from an Account with calculated individual and total price for Billing purpose. """ __resource_type__ = "Invoice" account: fhirtypes.ReferenceType | None = Field( default=None, alias="account", title="Account that is being balanced", description="Account which is supposed to be balanced with this Invoice.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Account"], }, ) cancelledReason: fhirtypes.StringType | None = Field( default=None, alias="cancelledReason", title="Reason for cancellation of this Invoice", description=( "In case of Invoice cancellation a reason must be given (entered in " "error, superseded by corrected invoice etc.)." ), json_schema_extra={ "element_property": True, }, ) cancelledReason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_cancelledReason", title="Extension field for ``cancelledReason``.", ) creation: fhirtypes.DateTimeType | None = Field( default=None, alias="creation", title="When posted", description="Date/time(s) of when this Invoice was posted.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) creation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_creation", title="Extension field for ``creation``." ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="DEPRICATED", description="Depricared by the element below.", json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for item", description=( "Identifier of this Invoice, often used for reference in correspondence" " about this invoice or for tracking of payments." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issuer: fhirtypes.ReferenceType | None = Field( default=None, alias="issuer", title="Issuing Organization of Invoice", description="The organizationissuing the Invoice.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) lineItem: typing.List[fhirtypes.InvoiceLineItemType] | None = Field( default=None, alias="lineItem", title="Line items of this Invoice", description=( "Each line item represents one charge for goods and services rendered. " "Details such.ofType(date), code and amount are found in the referenced" " ChargeItem resource." ), json_schema_extra={ "element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the invoice", description=( "Comments made about the invoice by the issuer, subject, or other " "participants." ), json_schema_extra={ "element_property": True, }, ) participant: typing.List[fhirtypes.InvoiceParticipantType] | None = Field( default=None, alias="participant", title="Participant in creation of this Invoice", description=( "Indicates who or what performed or participated in the charged " "service." ), json_schema_extra={ "element_property": True, }, ) paymentTerms: fhirtypes.MarkdownType | None = Field( default=None, alias="paymentTerms", title="Payment details", description=( "Payment details such as banking details, period of payment, " "deductibles, methods of payment." ), json_schema_extra={ "element_property": True, }, ) paymentTerms__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_paymentTerms", title="Extension field for ``paymentTerms``.", ) periodDate: fhirtypes.DateType | None = Field( default=None, alias="periodDate", title="Billing date or period", description="Date/time(s) range of services included in this invoice.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e period[x] "one_of_many": "period", "one_of_many_required": False, }, ) periodDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_periodDate", title="Extension field for ``periodDate``." ) periodPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="periodPeriod", title="Billing date or period", description="Date/time(s) range of services included in this invoice.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e period[x] "one_of_many": "period", "one_of_many_required": False, }, ) recipient: fhirtypes.ReferenceType | None = Field( default=None, alias="recipient", title="Recipient of this invoice", description=( "The individual or Organization responsible for balancing of this " "invoice." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization", "Patient", "RelatedPerson"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | issued | balanced | cancelled | entered-in-error", description="The current state of the Invoice.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "draft", "issued", "balanced", "cancelled", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Recipient(s) of goods and services", description=( "The individual or set of individuals receiving the goods and services " "billed in this invoice." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) totalGross: fhirtypes.MoneyType | None = Field( default=None, alias="totalGross", title="Gross total of this Invoice", description="Invoice total, tax included.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) totalNet: fhirtypes.MoneyType | None = Field( default=None, alias="totalNet", title="Net total of this Invoice", description="Invoice total , taxes excluded.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) totalPriceComponent: typing.List[fhirtypes.MonetaryComponentType] | None = Field( default=None, alias="totalPriceComponent", title="Components of Invoice total", description=( "The total amount for the Invoice may be calculated as the sum of the " "line items with surcharges/deductions that apply in certain " "conditions. The priceComponent element can be used to offer " "transparency to the recipient of the Invoice of how the total price " "was calculated." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Type of Invoice", description=( "Type of Invoice depending on domain, realm an usage (e.g. " "internal/external, dental, preliminary)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Invoice`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "cancelledReason", "type", "subject", "recipient", "date", "creation", "periodDate", "periodPeriod", "participant", "issuer", "account", "lineItem", "totalPriceComponent", "totalNet", "totalGross", "paymentTerms", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Invoice`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "type", "subject", "recipient", "creation", "periodDate", "periodPeriod", "totalNet", "totalGross", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"period": ["periodDate", "periodPeriod"]} return one_of_many_fields class InvoiceLineItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Line items of this Invoice. Each line item represents one charge for goods and services rendered. Details such.ofType(date), code and amount are found in the referenced ChargeItem resource. """ __resource_type__ = "InvoiceLineItem" chargeItemCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="chargeItemCodeableConcept", title=( "Reference to ChargeItem containing details of this line item or an " "inline billing code" ), description=( "The ChargeItem contains information such as the billing code, date, " "amount etc. If no further details are required for the lineItem, " "inline billing codes can be added using the CodeableConcept data type " "instead of the Reference." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e chargeItem[x] "one_of_many": "chargeItem", "one_of_many_required": True, }, ) chargeItemReference: fhirtypes.ReferenceType | None = Field( default=None, alias="chargeItemReference", title=( "Reference to ChargeItem containing details of this line item or an " "inline billing code" ), description=( "The ChargeItem contains information such as the billing code, date, " "amount etc. If no further details are required for the lineItem, " "inline billing codes can be added using the CodeableConcept data type " "instead of the Reference." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e chargeItem[x] "one_of_many": "chargeItem", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ChargeItem"], }, ) priceComponent: typing.List[fhirtypes.MonetaryComponentType] | None = Field( default=None, alias="priceComponent", title="Components of total line item price", description=( "The price for a ChargeItem may be calculated as a base price with " "surcharges/deductions that apply in certain conditions. A " "ChargeItemDefinition resource that defines the prices, factors and " "conditions that apply to a billing code is currently under " "development. The priceComponent element can be used to offer " "transparency to the recipient of the Invoice as to how the prices have" " been calculated." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.PositiveIntType | None = Field( default=None, alias="sequence", title="Sequence number of line item", description="Sequence in which the items appear on the invoice.", json_schema_extra={ "element_property": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) servicedDate: fhirtypes.DateType | None = Field( default=None, alias="servicedDate", title="Service data or period", description="Date/time(s) range when this service was delivered or completed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_servicedDate", title="Extension field for ``servicedDate``.", ) servicedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="servicedPeriod", title="Service data or period", description="Date/time(s) range when this service was delivered or completed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e serviced[x] "one_of_many": "serviced", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InvoiceLineItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "servicedDate", "servicedPeriod", "chargeItemReference", "chargeItemCodeableConcept", "priceComponent", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InvoiceLineItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "chargeItem": ["chargeItemCodeableConcept", "chargeItemReference"], "serviced": ["servicedDate", "servicedPeriod"], } return one_of_many_fields class InvoiceParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Participant in creation of this Invoice. Indicates who or what performed or participated in the charged service. """ __resource_type__ = "InvoiceParticipant" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Individual who was involved", description=( "The device, practitioner, etc. who performed or participated in the " "service." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "Organization", "Patient", "PractitionerRole", "Device", "RelatedPerson", ], }, ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="Type of involvement in creation of this Invoice", description=( "Describes the type of involvement (e.g. transcriptionist, creator " "etc.). If the invoice has been created automatically, the Participant " "may be a billing engine or another kind of device." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``InvoiceParticipant`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "role", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``InvoiceParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/library.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Library Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class Library(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Represents a library of quality improvement components. The Library resource is a general-purpose container for knowledge asset definitions. It can be used to describe and expose existing knowledge assets such as logic libraries and information model descriptions, as well as to describe a collection of knowledge assets. """ __resource_type__ = "Library" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the library was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the content", description=( "An individiual or organization primarily involved in the creation and " "maintenance of the content." ), json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) content: typing.List[fhirtypes.AttachmentType] | None = Field( default=None, alias="content", title="Contents of the library, either embedded or referenced", description=( "The content of the library as an Attachment. The content may be a " "reference to a url, or may be directly embedded as a base-64 string. " "Either way, the contentType of the attachment determines how to " "interpret the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the library and/or its contents. " "Copyright statements are generally legal restrictions on the use and " "publishing of the library." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) dataRequirement: typing.List[fhirtypes.DataRequirementType] | None = Field( default=None, alias="dataRequirement", title="What data is referenced by this library", description=( "Describes a set of data that must be provided in order to be able to " "successfully perform the computations defined by the library." ), json_schema_extra={ "element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the library was last " "significantly changed. The date must change when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the library changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the library", description=( "A free text natural language description of the library from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the content", description=( "An individual or organization primarily responsible for internal " "coherence of the content." ), json_schema_extra={ "element_property": True, }, ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the library is expected to be used", description=( "The period during which the library content was or is planned to be in" " active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the content", description=( "An individual or organization asserted by the publisher to be " "responsible for officially endorsing the content for use in some " "setting." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this library is authored for testing " "purposes (or education/evaluation/marketing) and is not intended to be" " used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the library", description=( "A formal identifier that is used to identify this library when it is " "represented in other formats, or referenced in a specification, model," " design or an instance. e.g. CMS or NQF identifiers for a measure " "artifact. Note that at least one identifier is required for non-" "experimental active artifacts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for library (if applicable)", description=( "A legal or geographic region in which the library is intended to be " "used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the library was last reviewed by the publisher", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this library (computer friendly)", description=( "A natural language name identifying the library. This name should be " "usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) parameter: typing.List[fhirtypes.ParameterDefinitionType] | None = Field( default=None, alias="parameter", title="Parameters defined by the library", description="The parameter element defines parameters used by the library.", json_schema_extra={ "element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the library." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this library is defined", description=( "Explanation of why this library is needed and why it has been designed" " as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Additional documentation, citations, etc", description=( "Related artifacts such as additional documentation, justification, or " "bibliographic references." ), json_schema_extra={ "element_property": True, }, ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the content", description=( "An individual or organization asserted by the publisher to be " "primarily responsible for review of some aspect of the content." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this library. Enables tracking the life-cycle of the " "content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subjectCodeableConcept", title="Type of individual the library content is focused on", description=( "A code or group definition that describes the intended subject of the " "contents of the library." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, }, ) subjectReference: fhirtypes.ReferenceType | None = Field( default=None, alias="subjectReference", title="Type of individual the library content is focused on", description=( "A code or group definition that describes the intended subject of the " "contents of the library." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) subtitle: fhirtypes.StringType | None = Field( default=None, alias="subtitle", title="Subordinate title of the library", description=( "An explanatory or alternate title for the library giving additional " "information about its content." ), json_schema_extra={ "element_property": True, }, ) subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subtitle", title="Extension field for ``subtitle``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this library (human friendly)", description="A short, descriptive, user-friendly title for the library.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) topic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="topic", title="E.g. Education, Treatment, Assessment, etc", description=( "Descriptive topics related to the content of the library. Topics " "provide a high-level categorization of the library that can be useful " "for filtering and searching." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title=( "logic-library | model-definition | asset-collection | module-" "definition" ), description=( "Identifies the type of library such as a Logic Library, Model " "Definition, Asset Collection, or Module Definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this library, represented as a URI (globally " "unique)" ), description=( "An absolute URI that is used to identify this library when it is " "referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which an authoritative instance of this" " library is (or will be) published. This URL can be the target of a " "canonical reference. It SHALL remain the same when the library is " "stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) usage: fhirtypes.MarkdownType | None = Field( default=None, alias="usage", title="Describes the clinical usage of the library", description=( "A detailed description of how the library is used from a clinical " "perspective." ), json_schema_extra={ "element_property": True, }, ) usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usage", title="Extension field for ``usage``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate library instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the library", description=( "The identifier that is used to identify this version of the library " "when it is referenced in a specification, model, design or instance. " "This is an arbitrary value managed by the library author and is not " "expected to be globally unique. For example, it might be a timestamp " "(e.g. yyyymmdd) if a managed version is not available. There is also " "no expectation that versions can be placed in a lexicographical " "sequence. To provide a version consistent with the Decision Support " "Service specification, use the format Major.Minor.Revision (e.g. " "1.0.0). For more information on versioning knowledge assets, refer to " "the Decision Support Service specification. Note that a version is " "required for non-experimental active artifacts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Library`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "subtitle", "status", "experimental", "type", "subjectCodeableConcept", "subjectReference", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "usage", "copyright", "copyrightLabel", "approvalDate", "lastReviewDate", "effectivePeriod", "topic", "author", "editor", "reviewer", "endorser", "relatedArtifact", "parameter", "dataRequirement", "content", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Library`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "type", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "effectivePeriod", "content", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "subject": ["subjectCodeableConcept", "subjectReference"], "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"], } return one_of_many_fields ================================================ FILE: fhir/resources/linkage.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Linkage Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Linkage(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Links records for 'same' item. Identifies two or more records (resource instances) that refer to the same real-world "occurrence". """ __resource_type__ = "Linkage" active: bool | None = Field( default=None, alias="active", title="Whether this linkage assertion is active or not", description=( "Indicates whether the asserted set of linkages are considered to be " '"in effect".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="Who is responsible for linkages", description=( "Identifies the user or organization responsible for asserting the " "linkages as well as the user or organization who establishes the " "context in which the nature of each linkage is evaluated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) item: typing.List[fhirtypes.LinkageItemType] = Field( default=..., alias="item", title="Item to be linked", description=( "Identifies which record considered as the reference to the same real-" "world occurrence as well as how the items should be evaluated within " "the collection of linked items." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Linkage`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "active", "author", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Linkage`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "active", "author", "item", ] class LinkageItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Item to be linked. Identifies which record considered as the reference to the same real-world occurrence as well as how the items should be evaluated within the collection of linked items. """ __resource_type__ = "LinkageItem" resource: fhirtypes.ReferenceType = Field( default=..., alias="resource", title="Resource being linked", description="The resource instance being linked as part of the group.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="source | alternate | historical", description=( 'Distinguishes which item is "source of truth" (if any) and which items' " are no longer considered to be current representations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["source", "alternate", "historical"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``LinkageItem`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "resource"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``LinkageItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "resource"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields ================================================ FILE: fhir/resources/list.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/List Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class List(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A list is a curated collection of resources. A List is a curated collection of resources, for things such as problem lists, allergy lists, facility list, organization list, etc. """ __resource_type__ = "List" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="What the purpose of this list is", description="This code defines the purpose of the list - why it was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When the list was prepared", description="Date list was last reviewed/revised and determined to be 'current'.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) emptyReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="emptyReason", title="Why list is empty", description="If the list is empty, why the list is empty.", json_schema_extra={ "element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Context in which list created", description="The encounter that is the context in which this list was created.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) entry: typing.List[fhirtypes.ListEntryType] | None = Field( default=None, alias="entry", title="Entries in the list", description="Entries in this list.", json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description=( "Identifier for the List assigned for business purposes outside the " "context of FHIR." ), json_schema_extra={ "element_property": True, }, ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="working | snapshot | changes", description=( "How this list was prepared - whether it is a working list that is " "suitable for being maintained on an ongoing basis, or if it represents" " a snapshot of a list of items from another source, or whether it is a" " prepared list where items may be marked as added, modified or " "deleted." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["working", "snapshot", "changes"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments about the list", description="Comments that apply to the overall list.", json_schema_extra={ "element_property": True, }, ) orderedBy: fhirtypes.CodeableConceptType | None = Field( default=None, alias="orderedBy", title="What order the list has", description="What order applies to the items in the list.", json_schema_extra={ "element_property": True, }, ) source: fhirtypes.ReferenceType | None = Field( default=None, alias="source", title="Who and/or what defined the list contents (aka Author)", description=( "The entity responsible for deciding what the contents of the list " "were. Where the list was created by a human, this is the same as the " "author of the list." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Patient", "Device", "Organization", "RelatedPerson", "CareTeam", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="current | retired | entered-in-error", description="Indicates the current state of this list.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["current", "retired", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="subject", title="If all resources have the same subject(s)", description=( "The common subject(s) (or patient(s)) of the resources that are in the" " list if there is one (or a set of subjects)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Descriptive name for the list", description="A label for the list assigned by the author.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``List`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "mode", "title", "code", "subject", "encounter", "date", "source", "orderedBy", "note", "entry", "emptyReason", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``List`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "status", "mode", "title", "code", "subject", "date", "source", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("mode", "mode__ext"), ("status", "status__ext")] return required_fields class ListEntry(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Entries in the list. Entries in this list. """ __resource_type__ = "ListEntry" date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When item added to list", description="When this item was added to the list.", json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) deleted: bool | None = Field( default=None, alias="deleted", title="If this item is actually marked as deleted", description="True if this item is marked as deleted in the list.", json_schema_extra={ "element_property": True, }, ) deleted__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deleted", title="Extension field for ``deleted``." ) flag: fhirtypes.CodeableConceptType | None = Field( default=None, alias="flag", title="Status/Workflow information about this item", description=( "The flag allows the system constructing the list to indicate the role " "and significance of the item in the list." ), json_schema_extra={ "element_property": True, }, ) item: fhirtypes.ReferenceType = Field( default=..., alias="item", title="Actual entry", description="A reference to the actual resource from which data was derived.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ListEntry`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "flag", "deleted", "date", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ListEntry`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/location.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Location Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Location(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details and position information for a place. Details and position information for a place where services are provided and resources and participants may be stored, found, contained, or accommodated. """ __resource_type__ = "Location" address: fhirtypes.AddressType | None = Field( default=None, alias="address", title="Physical location", description=None, json_schema_extra={ "element_property": True, }, ) alias: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="alias", title=( "A list of alternate names that the location is known as, or was known " "as, in the past" ), description=None, json_schema_extra={ "element_property": True, }, ) alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_alias", title="Extension field for ``alias``." ) characteristic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="characteristic", title="Collection of characteristics (attributes)", description=None, json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ExtendedContactDetailType] | None = Field( default=None, alias="contact", title="Official contact details for the location", description=( "The contact details of communication devices available at the " "location. This can include addresses, phone numbers, fax numbers, " "mobile numbers, email addresses and web sites." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title=( "Additional details about the location that could be displayed as " "further information to identify the location beyond its name" ), description=( "Description of the Location, which helps in finding or referencing the" " place." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title=( "Technical endpoints providing access to services operated for the " "location" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) form: fhirtypes.CodeableConceptType | None = Field( default=None, alias="form", title="Physical form of the location", description=( "Physical form of the location, e.g. building, room, vehicle, road, " "virtual." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) hoursOfOperation: typing.List[fhirtypes.AvailabilityType] | None = Field( default=None, alias="hoursOfOperation", title=( "What days/times during a week is this location usually open (including" " exceptions)" ), description=( "What days/times during a week is this location usually open, and any " "exceptions where the location is not available." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique code or number identifying the location to its users", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) managingOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="managingOrganization", title="Organization responsible for provisioning and upkeep", description=( "The organization responsible for the provisioning and upkeep of the " "location." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="instance | kind", description=( "Indicates whether a resource instance represents a specific location " "or a class of locations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["instance", "kind"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name of the location as used by humans", description="Name of the location as used by humans. Does not need to be unique.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) operationalStatus: fhirtypes.CodingType | None = Field( default=None, alias="operationalStatus", title="The operational status of the location (typically only for a bed/room)", description=( "The operational status covers operation values most relevant to beds " "(but can also apply to rooms/units/chairs/etc. such as an isolation " "unit/dialysis chair). This typically covers concepts such as " "contamination, housekeeping, and other activities like maintenance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) partOf: fhirtypes.ReferenceType | None = Field( default=None, alias="partOf", title="Another Location this one is physically a part of", description="Another Location of which this Location is physically a part of.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) position: fhirtypes.LocationPositionType | None = Field( default=None, alias="position", title="The absolute geographic location", description=( "The absolute geographic location of the Location, expressed using the " "WGS84 datum (This is the same co-ordinate system used in KML)." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | suspended | inactive", description=( "The status property covers the general availability of the resource, " "not the current value which may be covered by the operationStatus, or " "by a schedule/slots if they are configured for the location." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "suspended", "inactive"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Type of function performed", description="Indicates the type of function performed at the location.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) virtualService: typing.List[fhirtypes.VirtualServiceDetailType] | None = Field( default=None, alias="virtualService", title="Connection details of a virtual service (e.g. conference call)", description=( "Connection details of a virtual service (e.g. shared conference call " "facility with dedicated number/details)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Location`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "operationalStatus", "name", "alias", "description", "mode", "type", "contact", "address", "form", "position", "managingOrganization", "partOf", "characteristic", "hoursOfOperation", "virtualService", "endpoint", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Location`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "operationalStatus", "name", "description", "mode", "type", "form", "managingOrganization", ] class LocationPosition(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The absolute geographic location. The absolute geographic location of the Location, expressed using the WGS84 datum (This is the same co-ordinate system used in KML). """ __resource_type__ = "LocationPosition" altitude: fhirtypes.DecimalType | None = Field( default=None, alias="altitude", title="Altitude with WGS84 datum", description=( "Altitude. The value domain and the interpretation are the same as for " "the text of the altitude element in KML (see notes on Location main " "page)." ), json_schema_extra={ "element_property": True, }, ) altitude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_altitude", title="Extension field for ``altitude``." ) latitude: fhirtypes.DecimalType | None = Field( default=None, alias="latitude", title="Latitude with WGS84 datum", description=( "Latitude. The value domain and the interpretation are the same as for " "the text of the latitude element in KML (see notes on Location main " "page)." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) latitude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_latitude", title="Extension field for ``latitude``." ) longitude: fhirtypes.DecimalType | None = Field( default=None, alias="longitude", title="Longitude with WGS84 datum", description=( "Longitude. The value domain and the interpretation are the same as for" " the text of the longitude element in KML (see notes on Location main " "page)." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) longitude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_longitude", title="Extension field for ``longitude``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``LocationPosition`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "longitude", "latitude", "altitude", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``LocationPosition`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("latitude", "latitude__ext"), ("longitude", "longitude__ext"), ] return required_fields ================================================ FILE: fhir/resources/manufactureditemdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ManufacturedItemDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ManufacturedItemDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The definition and characteristics of a medicinal manufactured item, such as a tablet or capsule, as contained in a packaged medicinal product. """ __resource_type__ = "ManufacturedItemDefinition" component: typing.List[ fhirtypes.ManufacturedItemDefinitionComponentType ] | None = Field( default=None, alias="component", title=( "Physical parts of the manufactured item, that it is intrisically made " "from. This is distinct from the ingredients that are part of its " "chemical makeup" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique identifier", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ingredient: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="ingredient", title=( "The ingredients of this manufactured item. Only needed if these are " "not specified by incoming references from the Ingredient resource" ), description=( "The ingredients of this manufactured item. This is only needed if the " "ingredients are not specified by incoming references from the " "Ingredient resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) manufacturedDoseForm: fhirtypes.CodeableConceptType = Field( default=..., alias="manufacturedDoseForm", title="Dose form as manufactured (before any necessary transformation)", description=( "Dose form as manufactured and before any transformation into the " "pharmaceutical product." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) manufacturer: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="manufacturer", title="Manufacturer of the item, one of several possible", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) marketingStatus: typing.List[fhirtypes.MarketingStatusType] | None = Field( default=None, alias="marketingStatus", title=( "Allows specifying that an item is on the market for sale, or that it " "is not available, and the dates and locations associated" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="A descriptive name applied to this item", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) property: typing.List[ fhirtypes.ManufacturedItemDefinitionPropertyType ] | None = Field( default=None, alias="property", title="General characteristics of this item", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this item. Enables tracking the life-cycle of the " "content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) unitOfPresentation: fhirtypes.CodeableConceptType | None = Field( default=None, alias="unitOfPresentation", title="The \u201creal-world\u201d units in which the quantity of the item is described", description=( "The \u201creal-world\u201d units in which the quantity of the manufactured item " "is described." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ManufacturedItemDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "name", "manufacturedDoseForm", "unitOfPresentation", "manufacturer", "marketingStatus", "ingredient", "property", "component", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ManufacturedItemDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "name", "manufacturedDoseForm", "unitOfPresentation", "manufacturer", "marketingStatus", "ingredient", "property", "component", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class ManufacturedItemDefinitionComponent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Physical parts of the manufactured item, that it is intrisically made from. This is distinct from the ingredients that are part of its chemical makeup. """ __resource_type__ = "ManufacturedItemDefinitionComponent" amount: typing.List[fhirtypes.QuantityType] | None = Field( default=None, alias="amount", title=( "The measurable amount of total quantity of all substances in the " "component, expressable in different ways (e.g. by mass or volume)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) component: typing.List[ fhirtypes.ManufacturedItemDefinitionComponentType ] | None = Field( default=None, alias="component", title="A component that this component contains or is made from", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) constituent: typing.List[ fhirtypes.ManufacturedItemDefinitionComponentConstituentType ] | None = Field( default=None, alias="constituent", title=( "A reference to a constituent of the manufactured item as a whole, " "linked here so that its component location within the item can be " "indicated. This not where the item's ingredient are primarily stated " "(for which see Ingredient.for or " "ManufacturedItemDefinition.ingredient)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) function: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="function", title=( "The function of this component within the item e.g. delivers active " "ingredient, masks taste" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) property: typing.List[ fhirtypes.ManufacturedItemDefinitionPropertyType ] | None = Field( default=None, alias="property", title="General characteristics of this component", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Defining type of the component e.g. shell, layer, ink", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ManufacturedItemDefinitionComponent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "function", "amount", "constituent", "property", "component", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ManufacturedItemDefinitionComponent`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "function", "amount", "constituent", "property", "component", ] class ManufacturedItemDefinitionComponentConstituent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A reference to a constituent of the manufactured item as a whole, linked here so that its component location within the item can be indicated. This not where the item's ingredient are primarily stated (for which see Ingredient.for or ManufacturedItemDefinition.ingredient). """ __resource_type__ = "ManufacturedItemDefinitionComponentConstituent" amount: typing.List[fhirtypes.QuantityType] | None = Field( default=None, alias="amount", title=( "The measurable amount of the substance, expressable in different ways " "(e.g. by mass or volume)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) function: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="function", title="The function of this constituent within the component e.g. binder", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) hasIngredient: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="hasIngredient", title="The ingredient that is the constituent of the given component", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Ingredient"], }, ) location: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="location", title=( "The physical location of the constituent/ingredient within the " "component" ), description=( "The physical location of the constituent/ingredient within the " "component. Example \u2013 if the component is the bead in the capsule, then" " the location would be where the ingredient resides within the product" " part \u2013 intragranular, extra-granular, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ManufacturedItemDefinitionComponentConstituent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "amount", "location", "function", "hasIngredient", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ManufacturedItemDefinitionComponentConstituent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "amount", "location", "function", "hasIngredient"] class ManufacturedItemDefinitionProperty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. General characteristics of this item. """ __resource_type__ = "ManufacturedItemDefinitionProperty" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="A code expressing the type of characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="valueMarkdown", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueMarkdown", title="Extension field for ``valueMarkdown``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Binary"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ManufacturedItemDefinitionProperty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueCodeableConcept", "valueQuantity", "valueDate", "valueBoolean", "valueMarkdown", "valueAttachment", "valueReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ManufacturedItemDefinitionProperty`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "valueCodeableConcept", "valueQuantity", "valueDate", "valueBoolean", "valueMarkdown", "valueAttachment", "valueReference", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueBoolean", "valueCodeableConcept", "valueDate", "valueMarkdown", "valueQuantity", "valueReference", ] } return one_of_many_fields ================================================ FILE: fhir/resources/marketingstatus.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MarketingStatus Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backbonetype, fhirtypes class MarketingStatus(backbonetype.BackboneType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The marketing status describes the date when a medicinal product is actually put on the market or the date as of which it is no longer available. """ __resource_type__ = "MarketingStatus" country: fhirtypes.CodeableConceptType | None = Field( default=None, alias="country", title=( "The country in which the marketing authorization has been granted " "shall be specified It should be specified using the ISO 3166 \u2011 1 " "alpha-2 code elements" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dateRange: fhirtypes.PeriodType | None = Field( default=None, alias="dateRange", title=( "The date when the Medicinal Product is placed on the market by the " "Marketing Authorization Holder (or where applicable, the " "manufacturer/distributor) in a country and/or jurisdiction shall be " "provided A complete date consisting of day, month and year shall be " "specified using the ISO 8601 date format NOTE \u201cPlaced on the market\u201d " "refers to the release of the Medicinal Product into the distribution " "chain" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: fhirtypes.CodeableConceptType | None = Field( default=None, alias="jurisdiction", title=( "Where a Medicines Regulatory Agency has granted a marketing " "authorization for which specific provisions within a jurisdiction " "apply, the jurisdiction can be specified using an appropriate " "controlled terminology The controlled term and the controlled term " "identifier shall be specified" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) restoreDate: fhirtypes.DateTimeType | None = Field( default=None, alias="restoreDate", title=( "The date when the Medicinal Product is placed on the market by the " "Marketing Authorization Holder (or where applicable, the " "manufacturer/distributor) in a country and/or jurisdiction shall be " "provided A complete date consisting of day, month and year shall be " "specified using the ISO 8601 date format NOTE \u201cPlaced on the market\u201d " "refers to the release of the Medicinal Product into the distribution " "chain" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) restoreDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_restoreDate", title="Extension field for ``restoreDate``." ) status: fhirtypes.CodeableConceptType = Field( default=..., alias="status", title=( "This attribute provides information on the status of the marketing of " "the medicinal product See ISO/TS 20443 for more information and " "examples" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MarketingStatus`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "country", "jurisdiction", "status", "dateRange", "restoreDate", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MarketingStatus`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "country", "jurisdiction", "status", "dateRange", "restoreDate", ] ================================================ FILE: fhir/resources/measure.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Measure Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Measure(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A quality measure definition. The Measure resource provides the definition of a quality measure. """ __resource_type__ = "Measure" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the measure was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the content", description=( "An individiual or organization primarily involved in the creation and " "maintenance of the content." ), json_schema_extra={ "element_property": True, }, ) basis: fhirtypes.CodeType | None = Field( default=None, alias="basis", title="Population basis", description=( "The population basis specifies the type of elements in the population." " For a subject-based measure, this is boolean (because the subject and" " the population basis are the same, and the population criteria define" " yes/no values for each individual in the population). For measures " "that have a population basis that is different than the subject, this " "element specifies the type of the population basis. For example, an " "encounter-based measure has a subject of Patient and a population " "basis of Encounter, and the population criteria all return lists of " "Encounters." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) basis__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_basis", title="Extension field for ``basis``." ) clinicalRecommendationStatement: fhirtypes.MarkdownType | None = Field( default=None, alias="clinicalRecommendationStatement", title="Summary of clinical guidelines", description=( "Provides a summary of relevant clinical guidelines or other clinical " "recommendations supporting the measure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) clinicalRecommendationStatement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_clinicalRecommendationStatement", title="Extension field for ``clinicalRecommendationStatement``.", ) compositeScoring: fhirtypes.CodeableConceptType | None = Field( default=None, alias="compositeScoring", title="opportunity | all-or-nothing | linear | weighted", description=( "If this is a composite measure, the scoring method used to combine the" " component measures to determine the composite score." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the measure and/or its contents. " "Copyright statements are generally legal restrictions on the use and " "publishing of the measure." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the measure was last " "significantly changed. The date must change when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the measure changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the measure", description=( "A free text natural language description of the measure from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) disclaimer: fhirtypes.MarkdownType | None = Field( default=None, alias="disclaimer", title="Disclaimer for use of the measure or its referenced content", description=( "Notices and disclaimers regarding the use of the measure or related to" " intellectual property (such as code systems) referenced by the " "measure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) disclaimer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_disclaimer", title="Extension field for ``disclaimer``." ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the content", description=( "An individual or organization primarily responsible for internal " "coherence of the content." ), json_schema_extra={ "element_property": True, }, ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the measure is expected to be used", description=( "The period during which the measure content was or is planned to be in" " active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the content", description=( "An individual or organization asserted by the publisher to be " "responsible for officially endorsing the content for use in some " "setting." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this measure is authored for testing " "purposes (or education/evaluation/marketing) and is not intended to be" " used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) group: typing.List[fhirtypes.MeasureGroupType] | None = Field( default=None, alias="group", title="Population criteria group", description="A group of population criteria for the measure.", json_schema_extra={ "element_property": True, }, ) guidance: fhirtypes.MarkdownType | None = Field( default=None, alias="guidance", title="Additional guidance for implementers (deprecated)", description=( "Additional guidance for the measure including how it can be used in a " "clinical context, and the intent of the measure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) guidance__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_guidance", title="Extension field for ``guidance``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the measure", description=( "A formal identifier that is used to identify this measure when it is " "represented in other formats, or referenced in a specification, model," " design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) improvementNotation: fhirtypes.CodeableConceptType | None = Field( default=None, alias="improvementNotation", title="increase | decrease", description=( "Information on whether an increase or decrease in score is the " "preferred result (e.g., a higher score indicates better quality OR a " "lower score indicates better quality OR quality is within a range)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for measure (if applicable)", description=( "A legal or geographic region in which the measure is intended to be " "used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the measure was last reviewed by the publisher", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) library: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="library", title="Logic used by the measure", description=( "A reference to a Library resource containing the formal logic used by " "the measure." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Library"], }, ) library__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_library", title="Extension field for ``library``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this measure (computer friendly)", description=( "A natural language name identifying the measure. This name should be " "usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the measure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this measure is defined", description=( "Explanation of why this measure is needed and why it has been designed" " as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) rateAggregation: fhirtypes.MarkdownType | None = Field( default=None, alias="rateAggregation", title="How is rate aggregation performed for this measure", description=( "Describes how to combine the information calculated, based on logic in" " each of several populations, into one summarized result." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) rateAggregation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rateAggregation", title="Extension field for ``rateAggregation``.", ) rationale: fhirtypes.MarkdownType | None = Field( default=None, alias="rationale", title="Detailed description of why the measure exists", description=( "Provides a succinct statement of the need for the measure. Usually " "includes statements pertaining to importance criterion: impact, gap in" " care, and evidence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) rationale__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rationale", title="Extension field for ``rationale``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Additional documentation, citations, etc", description=( "Related artifacts such as additional documentation, justification, or " "bibliographic references." ), json_schema_extra={ "element_property": True, }, ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the content", description=( "An individual or organization asserted by the publisher to be " "primarily responsible for review of some aspect of the content." ), json_schema_extra={ "element_property": True, }, ) riskAdjustment: fhirtypes.MarkdownType | None = Field( default=None, alias="riskAdjustment", title="How risk adjustment is applied for this measure", description=( "A description of the risk adjustment factors that may impact the " "resulting score for the measure and how they may be accounted for when" " computing and reporting measure results." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) riskAdjustment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_riskAdjustment", title="Extension field for ``riskAdjustment``.", ) scoring: fhirtypes.CodeableConceptType | None = Field( default=None, alias="scoring", title="proportion | ratio | continuous-variable | cohort", description=( "Indicates how the calculation is performed for the measure, including " "proportion, ratio, continuous-variable, and cohort. The value set is " "extensible, allowing additional measure scoring types to be " "represented." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) scoringUnit: fhirtypes.CodeableConceptType | None = Field( default=None, alias="scoringUnit", title="What units?", description=( "Defines the expected units of measure for the measure score. This " "element SHOULD be specified as a UCUM unit." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this measure. Enables tracking the life-cycle of the " "content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subjectCodeableConcept", title=( "E.g. Patient, Practitioner, RelatedPerson, Organization, Location, " "Device" ), description=( "The intended subjects for the measure. If this element is not " "provided, a Patient subject is assumed, but the subject of the measure" " can be anything." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, }, ) subjectReference: fhirtypes.ReferenceType | None = Field( default=None, alias="subjectReference", title=( "E.g. Patient, Practitioner, RelatedPerson, Organization, Location, " "Device" ), description=( "The intended subjects for the measure. If this element is not " "provided, a Patient subject is assumed, but the subject of the measure" " can be anything." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) subtitle: fhirtypes.StringType | None = Field( default=None, alias="subtitle", title="Subordinate title of the measure", description=( "An explanatory or alternate title for the measure giving additional " "information about its content." ), json_schema_extra={ "element_property": True, }, ) subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subtitle", title="Extension field for ``subtitle``." ) supplementalData: typing.List[fhirtypes.MeasureSupplementalDataType] | None = Field( default=None, alias="supplementalData", title="What other data should be reported with the measure", description=( "The supplemental data criteria for the measure report, specified as " "either the name of a valid CQL expression within a referenced library," " or a valid FHIR Resource Path." ), json_schema_extra={ "element_property": True, }, ) term: typing.List[fhirtypes.MeasureTermType] | None = Field( default=None, alias="term", title="Defined terms used in the measure documentation", description="Provides a description of an individual term used within the measure.", json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this measure (human friendly)", description="A short, descriptive, user-friendly title for the measure.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) topic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="topic", title=( "The category of the measure, such as Education, Treatment, Assessment," " etc" ), description=( "Descriptive topics related to the content of the measure. Topics " "provide a high-level categorization grouping types of measures that " "can be useful for filtering and searching." ), json_schema_extra={ "element_property": True, }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="process | outcome | structure | patient-reported-outcome | composite", description=( "Indicates whether the measure is used to examine a process, an outcome" " over time, a patient-reported outcome, or a structure measure such as" " utilization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this measure, represented as a URI (globally " "unique)" ), description=( "An absolute URI that is used to identify this measure when it is " "referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which an authoritative instance of this" " measure is (or will be) published. This URL can be the target of a " "canonical reference. It SHALL remain the same when the measure is " "stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) usage: fhirtypes.MarkdownType | None = Field( default=None, alias="usage", title="Describes the clinical usage of the measure", description=( "A detailed description, from a clinical perspective, of how the " "measure is used." ), json_schema_extra={ "element_property": True, }, ) usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usage", title="Extension field for ``usage``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate measure instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the measure", description=( "The identifier that is used to identify this version of the measure " "when it is referenced in a specification, model, design or instance. " "This is an arbitrary value managed by the measure author and is not " "expected to be globally unique. For example, it might be a timestamp " "(e.g. yyyymmdd) if a managed version is not available. There is also " "no expectation that versions can be placed in a lexicographical " "sequence. To provide a version consistent with the Decision Support " "Service specification, use the format Major.Minor.Revision (e.g. " "1.0.0). For more information on versioning knowledge assets, refer to " "the Decision Support Service specification. Note that a version is " "required for non-experimental active artifacts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Measure`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "subtitle", "status", "experimental", "subjectCodeableConcept", "subjectReference", "basis", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "usage", "copyright", "copyrightLabel", "approvalDate", "lastReviewDate", "effectivePeriod", "topic", "author", "editor", "reviewer", "endorser", "relatedArtifact", "library", "disclaimer", "scoring", "scoringUnit", "compositeScoring", "type", "riskAdjustment", "rateAggregation", "rationale", "clinicalRecommendationStatement", "improvementNotation", "term", "guidance", "group", "supplementalData", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Measure`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "basis", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "effectivePeriod", "disclaimer", "scoring", "scoringUnit", "compositeScoring", "type", "riskAdjustment", "rateAggregation", "rationale", "clinicalRecommendationStatement", "improvementNotation", "guidance", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "subject": ["subjectCodeableConcept", "subjectReference"], "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"], } return one_of_many_fields class MeasureGroup(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Population criteria group. A group of population criteria for the measure. """ __resource_type__ = "MeasureGroup" basis: fhirtypes.CodeType | None = Field( default=None, alias="basis", title="Population basis", description=( "The population basis specifies the type of elements in the population." " For a subject-based measure, this is boolean (because the subject and" " the population basis are the same, and the population criteria define" " yes/no values for each individual in the population). For measures " "that have a population basis that is different than the subject, this " "element specifies the type of the population basis. For example, an " "encounter-based measure has a subject of Patient and a population " "basis of Encounter, and the population criteria all return lists of " "Encounters." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) basis__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_basis", title="Extension field for ``basis``." ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Meaning of the group", description=( "Indicates a meaning for the group. This can be as simple as a unique " "identifier, or it can establish meaning in a broader context by " "drawing from a terminology, allowing groups to be correlated across " "measures." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Summary description", description="The human readable description of this population group.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) improvementNotation: fhirtypes.CodeableConceptType | None = Field( default=None, alias="improvementNotation", title="increase | decrease", description=( "Information on whether an increase or decrease in score is the " "preferred result (e.g., a higher score indicates better quality OR a " "lower score indicates better quality OR quality is within a range)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) library: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="library", title="Logic used by the measure group", description=( "A reference to a Library resource containing the formal logic used by " "the measure group." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Library"], }, ) library__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_library", title="Extension field for ``library``." ) linkId: fhirtypes.StringType | None = Field( default=None, alias="linkId", title="Unique id for group in measure", description=( "An identifier that is unique within the Measure allowing linkage to " "the equivalent item in a MeasureReport resource." ), json_schema_extra={ "element_property": True, }, ) linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) population: typing.List[fhirtypes.MeasureGroupPopulationType] | None = Field( default=None, alias="population", title="Population criteria", description="A population criteria for the measure.", json_schema_extra={ "element_property": True, }, ) rateAggregation: fhirtypes.MarkdownType | None = Field( default=None, alias="rateAggregation", title="How is rate aggregation performed for this measure", description=( "Describes how to combine the information calculated, based on logic in" " each of several populations, into one summarized result." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) rateAggregation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rateAggregation", title="Extension field for ``rateAggregation``.", ) scoring: fhirtypes.CodeableConceptType | None = Field( default=None, alias="scoring", title="proportion | ratio | continuous-variable | cohort", description=( "Indicates how the calculation is performed for the measure, including " "proportion, ratio, continuous-variable, and cohort. The value set is " "extensible, allowing additional measure scoring types to be " "represented." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) scoringUnit: fhirtypes.CodeableConceptType | None = Field( default=None, alias="scoringUnit", title="What units?", description=( "Defines the expected units of measure for the measure score. This " "element SHOULD be specified as a UCUM unit." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) stratifier: typing.List[fhirtypes.MeasureGroupStratifierType] | None = Field( default=None, alias="stratifier", title="Stratifier criteria for the measure", description=( "The stratifier criteria for the measure report, specified as either " "the name of a valid CQL expression defined within a referenced library" " or a valid FHIR Resource Path." ), json_schema_extra={ "element_property": True, }, ) subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subjectCodeableConcept", title=( "E.g. Patient, Practitioner, RelatedPerson, Organization, Location, " "Device" ), description=( "The intended subjects for the measure. If this element is not " "provided, a Patient subject is assumed, but the subject of the measure" " can be anything." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, }, ) subjectReference: fhirtypes.ReferenceType | None = Field( default=None, alias="subjectReference", title=( "E.g. Patient, Practitioner, RelatedPerson, Organization, Location, " "Device" ), description=( "The intended subjects for the measure. If this element is not " "provided, a Patient subject is assumed, but the subject of the measure" " can be anything." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="process | outcome | structure | patient-reported-outcome | composite", description=( "Indicates whether the measure is used to examine a process, an outcome" " over time, a patient-reported outcome, or a structure measure such as" " utilization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureGroup`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "linkId", "code", "description", "type", "subjectCodeableConcept", "subjectReference", "basis", "scoring", "scoringUnit", "rateAggregation", "improvementNotation", "library", "population", "stratifier", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureGroup`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "basis", "scoring", "scoringUnit", "rateAggregation", "improvementNotation", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"subject": ["subjectCodeableConcept", "subjectReference"]} return one_of_many_fields class MeasureGroupPopulation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Population criteria. A population criteria for the measure. """ __resource_type__ = "MeasureGroupPopulation" aggregateMethod: fhirtypes.CodeableConceptType | None = Field( default=None, alias="aggregateMethod", title=( "Aggregation method for a measure score (e.g. sum, average, median, " "minimum, maximum, count)" ), description=( "Specifies which method should be used to aggregate measure observation" " values. For most scoring types, this is implied by scoring (e.g. a " "proportion measure counts members of the populations). For continuous " "variables, however, this information must be specified to ensure " "correct calculation." ), json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title=( "initial-population | numerator | numerator-exclusion | denominator | " "denominator-exclusion | denominator-exception | measure-population | " "measure-population-exclusion | measure-observation" ), description="The type of population criteria.", json_schema_extra={ "element_property": True, }, ) criteria: fhirtypes.ExpressionType | None = Field( default=None, alias="criteria", title="The criteria that defines this population", description=( "An expression that specifies the criteria for the population, " "typically the name of an expression in a library." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="The human readable description of this population criteria", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) groupDefinition: fhirtypes.ReferenceType | None = Field( default=None, alias="groupDefinition", title="A group resource that defines this population", description=( "A Group resource that defines this population as a set of " "characteristics." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) inputPopulationId: fhirtypes.StringType | None = Field( default=None, alias="inputPopulationId", title="Which population", description=( "The id of a population element in this measure that provides the input" " for this population criteria. In most cases, the scoring structure of" " the measure implies specific relationships (e.g. the Numerator uses " "the Denominator as the source in a proportion scoring). In some cases," " however, multiple possible choices exist and must be resolved " "explicitly. For example in a ratio measure with multiple initial " "populations, the denominator must specify which population should be " "used as the starting point." ), json_schema_extra={ "element_property": True, }, ) inputPopulationId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_inputPopulationId", title="Extension field for ``inputPopulationId``.", ) linkId: fhirtypes.StringType | None = Field( default=None, alias="linkId", title="Unique id for population in measure", description=( "An identifier that is unique within the Measure allowing linkage to " "the equivalent population in a MeasureReport resource." ), json_schema_extra={ "element_property": True, }, ) linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureGroupPopulation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "linkId", "code", "description", "criteria", "groupDefinition", "inputPopulationId", "aggregateMethod", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureGroupPopulation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MeasureGroupStratifier(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Stratifier criteria for the measure. The stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a referenced library or a valid FHIR Resource Path. """ __resource_type__ = "MeasureGroupStratifier" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Meaning of the stratifier", description=( "Indicates a meaning for the stratifier. This can be as simple as a " "unique identifier, or it can establish meaning in a broader context by" " drawing from a terminology, allowing stratifiers to be correlated " "across measures." ), json_schema_extra={ "element_property": True, }, ) component: typing.List[ fhirtypes.MeasureGroupStratifierComponentType ] | None = Field( default=None, alias="component", title="Stratifier criteria component for the measure", description=( "A component of the stratifier criteria for the measure report, " "specified as either the name of a valid CQL expression defined within " "a referenced library or a valid FHIR Resource Path." ), json_schema_extra={ "element_property": True, }, ) criteria: fhirtypes.ExpressionType | None = Field( default=None, alias="criteria", title="How the measure should be stratified", description=( "An expression that specifies the criteria for the stratifier. This is " "typically the name of an expression defined within a referenced " "library, but it may also be a path to a stratifier element." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="The human readable description of this stratifier", description="The human readable description of this stratifier criteria.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) groupDefinition: fhirtypes.ReferenceType | None = Field( default=None, alias="groupDefinition", title="A group resource that defines this population", description=( "A Group resource that defines this population as a set of " "characteristics." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) linkId: fhirtypes.StringType | None = Field( default=None, alias="linkId", title="Unique id for stratifier in measure", description=( "An identifier that is unique within the Measure allowing linkage to " "the equivalent item in a MeasureReport resource." ), json_schema_extra={ "element_property": True, }, ) linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureGroupStratifier`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "linkId", "code", "description", "criteria", "groupDefinition", "component", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureGroupStratifier`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MeasureGroupStratifierComponent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Stratifier criteria component for the measure. A component of the stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a referenced library or a valid FHIR Resource Path. """ __resource_type__ = "MeasureGroupStratifierComponent" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Meaning of the stratifier component", description=( "Indicates a meaning for the stratifier component. This can be as " "simple as a unique identifier, or it can establish meaning in a " "broader context by drawing from a terminology, allowing stratifiers to" " be correlated across measures." ), json_schema_extra={ "element_property": True, }, ) criteria: fhirtypes.ExpressionType | None = Field( default=None, alias="criteria", title="Component of how the measure should be stratified", description=( "An expression that specifies the criteria for this component of the " "stratifier. This is typically the name of an expression defined within" " a referenced library, but it may also be a path to a stratifier " "element." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="The human readable description of this stratifier component", description="The human readable description of this stratifier criteria component.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) groupDefinition: fhirtypes.ReferenceType | None = Field( default=None, alias="groupDefinition", title="A group resource that defines this population", description=( "A Group resource that defines this population as a set of " "characteristics." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) linkId: fhirtypes.StringType | None = Field( default=None, alias="linkId", title="Unique id for stratifier component in measure", description=( "An identifier that is unique within the Measure allowing linkage to " "the equivalent item in a MeasureReport resource." ), json_schema_extra={ "element_property": True, }, ) linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureGroupStratifierComponent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "linkId", "code", "description", "criteria", "groupDefinition", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureGroupStratifierComponent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MeasureSupplementalData(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What other data should be reported with the measure. The supplemental data criteria for the measure report, specified as either the name of a valid CQL expression within a referenced library, or a valid FHIR Resource Path. """ __resource_type__ = "MeasureSupplementalData" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Meaning of the supplemental data", description=( "Indicates a meaning for the supplemental data. This can be as simple " "as a unique identifier, or it can establish meaning in a broader " "context by drawing from a terminology, allowing supplemental data to " "be correlated across measures." ), json_schema_extra={ "element_property": True, }, ) criteria: fhirtypes.ExpressionType = Field( default=..., alias="criteria", title="Expression describing additional data to be reported", description=( "The criteria for the supplemental data. This is typically the name of " "a valid expression defined within a referenced library, but it may " "also be a path to a specific data element. The criteria defines the " "data to be returned for this element." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="The human readable description of this supplemental data", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) linkId: fhirtypes.StringType | None = Field( default=None, alias="linkId", title="Unique id for supplementalData in measure", description=( "An identifier that is unique within the Measure allowing linkage to " "the equivalent item in a MeasureReport resource." ), json_schema_extra={ "element_property": True, }, ) linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) usage: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="usage", title="supplemental-data | risk-adjustment-factor", description=( "An indicator of the intended usage for the supplemental data element. " "Supplemental data indicates the data is additional information " "requested to augment the measure information. Risk adjustment factor " "indicates the data is additional information used to calculate risk " "adjustment factors when applying a risk model to the measure " "calculation." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureSupplementalData`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "linkId", "code", "usage", "description", "criteria", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureSupplementalData`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MeasureTerm(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Defined terms used in the measure documentation. Provides a description of an individual term used within the measure. """ __resource_type__ = "MeasureTerm" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="What term?", description="A codeable representation of the defined term.", json_schema_extra={ "element_property": True, }, ) definition: fhirtypes.MarkdownType | None = Field( default=None, alias="definition", title="Meaning of the term", description="Provides a definition for the term as used within the measure.", json_schema_extra={ "element_property": True, }, ) definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureTerm`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "definition"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureTerm`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/measurereport.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MeasureReport Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MeasureReport(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Results of a measure evaluation. The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation. """ __resource_type__ = "MeasureReport" dataUpdateType: fhirtypes.CodeType | None = Field( default=None, alias="dataUpdateType", title="incremental | snapshot", description=( "Indicates whether the data submitted in a data-exchange report " "represents a snapshot or incremental update. A snapshot update " "replaces all previously submitted data for the receiver, whereas an " "incremental update represents only updated and/or changed data and " "should be applied as a differential update to the existing submitted " "data for the receiver." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["incremental", "snapshot"], }, ) dataUpdateType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dataUpdateType", title="Extension field for ``dataUpdateType``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="When the measure was calculated", description="The date this measure was calculated.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) evaluatedResource: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="evaluatedResource", title="What data was used to calculate the measure score", description=( "Evaluated resources are used to capture what data was involved in the " "calculation of a measure. This usage is only allowed for individual " "reports to ensure that the size of the MeasureReport resource is " "bounded." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) group: typing.List[fhirtypes.MeasureReportGroupType] | None = Field( default=None, alias="group", title="Measure results for each group", description=( "The results of the calculation, one for each population group in the " "measure." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the MeasureReport", description=( "A formal identifier that is used to identify this MeasureReport when " "it is represented in other formats or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) improvementNotation: fhirtypes.CodeableConceptType | None = Field( default=None, alias="improvementNotation", title="increase | decrease", description=( "Whether improvement in the measure is noted by an increase or decrease" " in the measure score." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) inputParameters: fhirtypes.ReferenceType | None = Field( default=None, alias="inputParameters", title="What parameters were provided to the report", description=( "A reference to a Parameters resource (typically represented using a " "contained resource) that represents any input parameters that were " "provided to the operation that generated the report." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Parameters"], }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where the reported data is from", description="A reference to the location for which the data is being reported.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) measure: fhirtypes.CanonicalType | None = Field( default=None, alias="measure", title="What measure was calculated", description="A reference to the Measure that was calculated to produce this report.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Measure"], }, ) measure__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_measure", title="Extension field for ``measure``." ) period: fhirtypes.PeriodType = Field( default=..., alias="period", title="What period the report covers", description="The reporting period for which the report was calculated.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reporter: fhirtypes.ReferenceType | None = Field( default=None, alias="reporter", title="Who is reporting the data", description="The individual or organization that is reporting the data.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Group", ], }, ) reportingVendor: fhirtypes.ReferenceType | None = Field( default=None, alias="reportingVendor", title="What vendor prepared the data", description=( "A reference to the vendor who queried the data, calculated results " "and/or generated the report. The \u2018reporting vendor\u2019 is intended to " "represent the submitting entity when it is not the same as the " "reporting entity. This extension is used when the Receiver is " "interested in getting vendor information in the report." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) scoring: fhirtypes.CodeableConceptType | None = Field( default=None, alias="scoring", title="What scoring method (e.g. proportion, ratio, continuous-variable)", description=( "Indicates how the calculation is performed for the measure, including " "proportion, ratio, continuous-variable, and cohort. The value set is " "extensible, allowing additional measure scoring types to be " "represented. It is expected to be the same as the scoring element on " "the referenced Measure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="complete | pending | error", description=( "The MeasureReport status. No data will be available until the " "MeasureReport status is complete." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["complete", "pending", "error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="What individual(s) the report is for", description=( "Optional subject identifying the individual or individuals the report " "is for." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CareTeam", "Device", "Group", "HealthcareService", "Location", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", ], }, ) supplementalData: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supplementalData", title="Additional information collected for the report", description=( "A reference to a Resource that represents additional information " "collected for the report. If the value of the supplemental data is not" " a Resource (i.e. evaluating the supplementalData expression for this " "case in the measure results in a value that is not a FHIR Resource), " "it is reported as a reference to a contained Observation resource." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="individual | subject-list | summary | data-exchange", description=( "The type of measure report. This may be an individual report, which " "provides the score for the measure for an individual member of the " "population; a subject-listing, which returns the list of members that " "meet the various criteria in the measure; a summary report, which " "returns a population count for each of the criteria in the measure; or" " a data-collection, which enables the MeasureReport to be used to " "exchange the data-of-interest for a quality measure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["individual", "subject-list", "summary", "data-exchange"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureReport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "type", "dataUpdateType", "measure", "subject", "date", "reporter", "reportingVendor", "location", "period", "inputParameters", "scoring", "improvementNotation", "group", "supplementalData", "evaluatedResource", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureReport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "type", "dataUpdateType", "measure", "subject", "date", "reporter", "period", "scoring", "improvementNotation", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext"), ("type", "type__ext")] return required_fields class MeasureReportGroup(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Measure results for each group. The results of the calculation, one for each population group in the measure. """ __resource_type__ = "MeasureReportGroup" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Meaning of the group", description=( "The meaning of the population group as defined in the measure " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) linkId: fhirtypes.StringType | None = Field( default=None, alias="linkId", title="Pointer to specific group from Measure", description=( "The group from the Measure that corresponds to this group in the " "MeasureReport resource." ), json_schema_extra={ "element_property": True, }, ) linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) measureScoreCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="measureScoreCodeableConcept", title="What score this group achieved", description=( "The measure score for this population group, calculated as appropriate" " for the measure type and scoring method, and based on the contents of" " the populations defined in the group." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e measureScore[x] "one_of_many": "measureScore", "one_of_many_required": False, }, ) measureScoreDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="measureScoreDateTime", title="What score this group achieved", description=( "The measure score for this population group, calculated as appropriate" " for the measure type and scoring method, and based on the contents of" " the populations defined in the group." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e measureScore[x] "one_of_many": "measureScore", "one_of_many_required": False, }, ) measureScoreDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_measureScoreDateTime", title="Extension field for ``measureScoreDateTime``.", ) measureScoreDuration: fhirtypes.DurationType | None = Field( default=None, alias="measureScoreDuration", title="What score this group achieved", description=( "The measure score for this population group, calculated as appropriate" " for the measure type and scoring method, and based on the contents of" " the populations defined in the group." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e measureScore[x] "one_of_many": "measureScore", "one_of_many_required": False, }, ) measureScorePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="measureScorePeriod", title="What score this group achieved", description=( "The measure score for this population group, calculated as appropriate" " for the measure type and scoring method, and based on the contents of" " the populations defined in the group." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e measureScore[x] "one_of_many": "measureScore", "one_of_many_required": False, }, ) measureScoreQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="measureScoreQuantity", title="What score this group achieved", description=( "The measure score for this population group, calculated as appropriate" " for the measure type and scoring method, and based on the contents of" " the populations defined in the group." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e measureScore[x] "one_of_many": "measureScore", "one_of_many_required": False, }, ) measureScoreRange: fhirtypes.RangeType | None = Field( default=None, alias="measureScoreRange", title="What score this group achieved", description=( "The measure score for this population group, calculated as appropriate" " for the measure type and scoring method, and based on the contents of" " the populations defined in the group." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e measureScore[x] "one_of_many": "measureScore", "one_of_many_required": False, }, ) population: typing.List[fhirtypes.MeasureReportGroupPopulationType] | None = Field( default=None, alias="population", title="The populations in the group", description=( "The populations that make up the population group, one for each type " "of population appropriate for the measure." ), json_schema_extra={ "element_property": True, }, ) stratifier: typing.List[fhirtypes.MeasureReportGroupStratifierType] | None = Field( default=None, alias="stratifier", title="Stratification results", description=( "When a measure includes multiple stratifiers, there will be a " "stratifier group for each stratifier defined by the measure." ), json_schema_extra={ "element_property": True, }, ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="What individual(s) the report is for", description=( "Optional subject identifying the individual or individuals the report " "is for." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CareTeam", "Device", "Group", "HealthcareService", "Location", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureReportGroup`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "linkId", "code", "subject", "population", "measureScoreQuantity", "measureScoreDateTime", "measureScoreCodeableConcept", "measureScorePeriod", "measureScoreRange", "measureScoreDuration", "stratifier", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureReportGroup`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "code", "subject", "measureScoreQuantity", "measureScoreDateTime", "measureScoreCodeableConcept", "measureScorePeriod", "measureScoreRange", "measureScoreDuration", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "measureScore": [ "measureScoreCodeableConcept", "measureScoreDateTime", "measureScoreDuration", "measureScorePeriod", "measureScoreQuantity", "measureScoreRange", ] } return one_of_many_fields class MeasureReportGroupPopulation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The populations in the group. The populations that make up the population group, one for each type of population appropriate for the measure. """ __resource_type__ = "MeasureReportGroupPopulation" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title=( "initial-population | numerator | numerator-exclusion | denominator | " "denominator-exclusion | denominator-exception | measure-population | " "measure-population-exclusion | measure-observation" ), description="The type of the population.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) count: fhirtypes.IntegerType | None = Field( default=None, alias="count", title="Size of the population", description="The number of members of the population.", json_schema_extra={ "element_property": True, }, ) count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_count", title="Extension field for ``count``." ) linkId: fhirtypes.StringType | None = Field( default=None, alias="linkId", title="Pointer to specific population from Measure", description=( "The population from the Measure that corresponds to this population in" " the MeasureReport resource." ), json_schema_extra={ "element_property": True, }, ) linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) subjectReport: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="subjectReport", title="For subject-list reports, a subject result in this population", description=( "A reference to an individual level MeasureReport resource for a member" " of the population." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MeasureReport"], }, ) subjectResults: fhirtypes.ReferenceType | None = Field( default=None, alias="subjectResults", title="For subject-list reports, the subject results in this population", description=( "This element refers to a List of individual level MeasureReport " "resources, one for each subject in this population." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["List"], }, ) subjects: fhirtypes.ReferenceType | None = Field( default=None, alias="subjects", title="What individual(s) in the population", description=( "Optional Group identifying the individuals that make up the " "population." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureReportGroupPopulation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "linkId", "code", "count", "subjectResults", "subjectReport", "subjects", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureReportGroupPopulation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code"] class MeasureReportGroupStratifier(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Stratification results. When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure. """ __resource_type__ = "MeasureReportGroupStratifier" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="What stratifier of the group", description="The meaning of this stratifier, as defined in the measure definition.", json_schema_extra={ "element_property": True, }, ) linkId: fhirtypes.StringType | None = Field( default=None, alias="linkId", title="Pointer to specific stratifier from Measure", description=( "The stratifier from the Measure that corresponds to this stratifier in" " the MeasureReport resource." ), json_schema_extra={ "element_property": True, }, ) linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) stratum: typing.List[ fhirtypes.MeasureReportGroupStratifierStratumType ] | None = Field( default=None, alias="stratum", title=( "Stratum results, one for each unique value, or set of values, in the " "stratifier, or stratifier components" ), description=( "This element contains the results for a single stratum within the " "stratifier. For example, when stratifying on administrative gender, " "there will be four strata, one for each possible gender value." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureReportGroupStratifier`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "linkId", "code", "stratum"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureReportGroupStratifier`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MeasureReportGroupStratifierStratum(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Stratum results, one for each unique value, or set of values, in the stratifier, or stratifier components. This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value. """ __resource_type__ = "MeasureReportGroupStratifierStratum" component: typing.List[ fhirtypes.MeasureReportGroupStratifierStratumComponentType ] | None = Field( default=None, alias="component", title="Stratifier component values", description="A stratifier component value.", json_schema_extra={ "element_property": True, }, ) measureScoreCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="measureScoreCodeableConcept", title="What score this stratum achieved", description=( "The measure score for this stratum, calculated as appropriate for the " "measure type and scoring method, and based on only the members of this" " stratum." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e measureScore[x] "one_of_many": "measureScore", "one_of_many_required": False, }, ) measureScoreDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="measureScoreDateTime", title="What score this stratum achieved", description=( "The measure score for this stratum, calculated as appropriate for the " "measure type and scoring method, and based on only the members of this" " stratum." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e measureScore[x] "one_of_many": "measureScore", "one_of_many_required": False, }, ) measureScoreDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_measureScoreDateTime", title="Extension field for ``measureScoreDateTime``.", ) measureScoreDuration: fhirtypes.DurationType | None = Field( default=None, alias="measureScoreDuration", title="What score this stratum achieved", description=( "The measure score for this stratum, calculated as appropriate for the " "measure type and scoring method, and based on only the members of this" " stratum." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e measureScore[x] "one_of_many": "measureScore", "one_of_many_required": False, }, ) measureScorePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="measureScorePeriod", title="What score this stratum achieved", description=( "The measure score for this stratum, calculated as appropriate for the " "measure type and scoring method, and based on only the members of this" " stratum." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e measureScore[x] "one_of_many": "measureScore", "one_of_many_required": False, }, ) measureScoreQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="measureScoreQuantity", title="What score this stratum achieved", description=( "The measure score for this stratum, calculated as appropriate for the " "measure type and scoring method, and based on only the members of this" " stratum." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e measureScore[x] "one_of_many": "measureScore", "one_of_many_required": False, }, ) measureScoreRange: fhirtypes.RangeType | None = Field( default=None, alias="measureScoreRange", title="What score this stratum achieved", description=( "The measure score for this stratum, calculated as appropriate for the " "measure type and scoring method, and based on only the members of this" " stratum." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e measureScore[x] "one_of_many": "measureScore", "one_of_many_required": False, }, ) population: typing.List[ fhirtypes.MeasureReportGroupStratifierStratumPopulationType ] | None = Field( default=None, alias="population", title="Population results in this stratum", description=( "The populations that make up the stratum, one for each type of " "population appropriate to the measure." ), json_schema_extra={ "element_property": True, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="The stratum value, e.g. male", description=( "The value for this stratum, expressed as a CodeableConcept. When " "defining stratifiers on complex values, the value must be rendered " "such that the value for each stratum within the stratifier is unique." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="The stratum value, e.g. male", description=( "The value for this stratum, expressed as a CodeableConcept. When " "defining stratifiers on complex values, the value must be rendered " "such that the value for each stratum within the stratifier is unique." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="The stratum value, e.g. male", description=( "The value for this stratum, expressed as a CodeableConcept. When " "defining stratifiers on complex values, the value must be rendered " "such that the value for each stratum within the stratifier is unique." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="The stratum value, e.g. male", description=( "The value for this stratum, expressed as a CodeableConcept. When " "defining stratifiers on complex values, the value must be rendered " "such that the value for each stratum within the stratifier is unique." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="The stratum value, e.g. male", description=( "The value for this stratum, expressed as a CodeableConcept. When " "defining stratifiers on complex values, the value must be rendered " "such that the value for each stratum within the stratifier is unique." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureReportGroupStratifierStratum`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "valueCodeableConcept", "valueBoolean", "valueQuantity", "valueRange", "valueReference", "component", "population", "measureScoreQuantity", "measureScoreDateTime", "measureScoreCodeableConcept", "measureScorePeriod", "measureScoreRange", "measureScoreDuration", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureReportGroupStratifierStratum`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "measureScore": [ "measureScoreCodeableConcept", "measureScoreDateTime", "measureScoreDuration", "measureScorePeriod", "measureScoreQuantity", "measureScoreRange", ], "value": [ "valueBoolean", "valueCodeableConcept", "valueQuantity", "valueRange", "valueReference", ], } return one_of_many_fields class MeasureReportGroupStratifierStratumComponent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Stratifier component values. A stratifier component value. """ __resource_type__ = "MeasureReportGroupStratifierStratumComponent" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="What stratifier component of the group", description="The code for the stratum component value.", json_schema_extra={ "element_property": True, }, ) linkId: fhirtypes.StringType | None = Field( default=None, alias="linkId", title="Pointer to specific stratifier component from Measure", description=( "The stratifier component from the Measure that corresponds to this " "stratifier component in the MeasureReport resource." ), json_schema_extra={ "element_property": True, }, ) linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="The stratum component value, e.g. male", description="The stratum component value.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="The stratum component value, e.g. male", description="The stratum component value.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="The stratum component value, e.g. male", description="The stratum component value.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="The stratum component value, e.g. male", description="The stratum component value.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="The stratum component value, e.g. male", description="The stratum component value.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureReportGroupStratifierStratumComponent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "linkId", "code", "valueCodeableConcept", "valueBoolean", "valueQuantity", "valueRange", "valueReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureReportGroupStratifierStratumComponent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueCodeableConcept", "valueQuantity", "valueRange", "valueReference", ] } return one_of_many_fields class MeasureReportGroupStratifierStratumPopulation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Population results in this stratum. The populations that make up the stratum, one for each type of population appropriate to the measure. """ __resource_type__ = "MeasureReportGroupStratifierStratumPopulation" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title=( "initial-population | numerator | numerator-exclusion | denominator | " "denominator-exclusion | denominator-exception | measure-population | " "measure-population-exclusion | measure-observation" ), description="The type of the population.", json_schema_extra={ "element_property": True, }, ) count: fhirtypes.IntegerType | None = Field( default=None, alias="count", title="Size of the population", description="The number of members of the population in this stratum.", json_schema_extra={ "element_property": True, }, ) count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_count", title="Extension field for ``count``." ) linkId: fhirtypes.StringType | None = Field( default=None, alias="linkId", title="Pointer to specific population from Measure", description=( "The population from the Measure that corresponds to this population in" " the MeasureReport resource." ), json_schema_extra={ "element_property": True, }, ) linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) subjectReport: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="subjectReport", title="For subject-list reports, a subject result in this population", description=( "A reference to an individual level MeasureReport resource for a member" " of the population." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MeasureReport"], }, ) subjectResults: fhirtypes.ReferenceType | None = Field( default=None, alias="subjectResults", title="For subject-list reports, the subject results in this population", description=( "This element refers to a List of individual level MeasureReport " "resources, one for each subject in this population in this stratum." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["List"], }, ) subjects: fhirtypes.ReferenceType | None = Field( default=None, alias="subjects", title="What individual(s) in the population", description=( "Optional Group identifying the individuals that make up the " "population." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MeasureReportGroupStratifierStratumPopulation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "linkId", "code", "count", "subjectResults", "subjectReport", "subjects", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MeasureReportGroupStratifierStratumPopulation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/medication.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Medication Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Medication(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of a Medication. This resource is primarily used for the identification and definition of a medication, including ingredients, for the purposes of prescribing, dispensing, and administering a medication as well as for making statements about medication use. """ __resource_type__ = "Medication" batch: fhirtypes.MedicationBatchType | None = Field( default=None, alias="batch", title="Details about packaged medications", description="Information that only applies to packages (not products).", json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Codes that identify this medication", description=( "A code (or set of codes) that specify this medication, or a textual " "description if no code is available. Usage note: This could be a " "standard medication code such as a code from RxNorm, SNOMED CT, IDMP " "etc. It could also be a national or local formulary code, optionally " "with translations to other code systems." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) definition: fhirtypes.ReferenceType | None = Field( default=None, alias="definition", title="Knowledge about this medication", description=( "A reference to a knowledge resource that provides more information " "about this medication." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicationKnowledge"], }, ) doseForm: fhirtypes.CodeableConceptType | None = Field( default=None, alias="doseForm", title="powder | tablets | capsule +", description="Describes the form of the item. Powder; tablets; capsule.", json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier for this medication", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ingredient: typing.List[fhirtypes.MedicationIngredientType] | None = Field( default=None, alias="ingredient", title="Active or inactive ingredient", description="Identifies a particular constituent of interest in the product.", json_schema_extra={ "element_property": True, }, ) marketingAuthorizationHolder: fhirtypes.ReferenceType | None = Field( default=None, alias="marketingAuthorizationHolder", title="Organization that has authorization to market medication", description=( "The company or other legal entity that has authorization, from the " "appropriate drug regulatory authority, to market a medicine in one or" " more jurisdictions. Typically abbreviated MAH.Note: The MAH may " "manufacture the product and may also contract the manufacturing of the" " product to one or more companies (organizations)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | inactive | entered-in-error", description="A code to indicate if the medication is in active use.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "inactive", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) totalVolume: fhirtypes.QuantityType | None = Field( default=None, alias="totalVolume", title=( "When the specified product code does not infer a package size, this is" " the specific amount of drug in the product" ), description=( "When the specified product code does not infer a package size, this is" " the specific amount of drug in the product. For example, when " "specifying a product that has the same strength (For example, Insulin " "glargine 100 unit per mL solution for injection), this attribute " "provides additional clarification of the package amount (For example, " "3 mL, 10mL, etc.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Medication`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "code", "status", "marketingAuthorizationHolder", "doseForm", "totalVolume", "ingredient", "batch", "definition", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Medication`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "code", "status", "marketingAuthorizationHolder", "totalVolume", ] class MedicationBatch(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details about packaged medications. Information that only applies to packages (not products). """ __resource_type__ = "MedicationBatch" expirationDate: fhirtypes.DateTimeType | None = Field( default=None, alias="expirationDate", title="When batch will expire", description="When this specific batch of product will expire.", json_schema_extra={ "element_property": True, }, ) expirationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expirationDate", title="Extension field for ``expirationDate``.", ) lotNumber: fhirtypes.StringType | None = Field( default=None, alias="lotNumber", title="Identifier assigned to batch", description="The assigned lot number of a batch of the specified product.", json_schema_extra={ "element_property": True, }, ) lotNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lotNumber", title="Extension field for ``lotNumber``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationBatch`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "lotNumber", "expirationDate"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationBatch`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationIngredient(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Active or inactive ingredient. Identifies a particular constituent of interest in the product. """ __resource_type__ = "MedicationIngredient" isActive: bool | None = Field( default=None, alias="isActive", title="Active ingredient indicator", description=( "Indication of whether this ingredient affects the therapeutic action " "of the drug." ), json_schema_extra={ "element_property": True, }, ) isActive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isActive", title="Extension field for ``isActive``." ) item: fhirtypes.CodeableReferenceType = Field( default=..., alias="item", title=( "The ingredient (substance or medication) that the ingredient.strength " "relates to" ), description=( "The ingredient (substance or medication) that the ingredient.strength " "relates to. This is represented as a concept from a code system or " "described in another resource (Substance or Medication)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Substance", "Medication"], }, ) strengthCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="strengthCodeableConcept", title="Quantity of ingredient present", description=( "Specifies how many (or how much) of the items there are in this " "Medication. For example, 250 mg per tablet. This is expressed as a " "ratio where the numerator is 250mg and the denominator is 1 tablet but" " can also be expressed a quantity when the denominator is assumed to " "be 1 tablet." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e strength[x] "one_of_many": "strength", "one_of_many_required": False, }, ) strengthQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="strengthQuantity", title="Quantity of ingredient present", description=( "Specifies how many (or how much) of the items there are in this " "Medication. For example, 250 mg per tablet. This is expressed as a " "ratio where the numerator is 250mg and the denominator is 1 tablet but" " can also be expressed a quantity when the denominator is assumed to " "be 1 tablet." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e strength[x] "one_of_many": "strength", "one_of_many_required": False, }, ) strengthRatio: fhirtypes.RatioType | None = Field( default=None, alias="strengthRatio", title="Quantity of ingredient present", description=( "Specifies how many (or how much) of the items there are in this " "Medication. For example, 250 mg per tablet. This is expressed as a " "ratio where the numerator is 250mg and the denominator is 1 tablet but" " can also be expressed a quantity when the denominator is assumed to " "be 1 tablet." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e strength[x] "one_of_many": "strength", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationIngredient`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "item", "isActive", "strengthRatio", "strengthCodeableConcept", "strengthQuantity", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationIngredient`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "strength": ["strengthCodeableConcept", "strengthQuantity", "strengthRatio"] } return one_of_many_fields ================================================ FILE: fhir/resources/medicationadministration.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MedicationAdministration Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MedicationAdministration(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Administration of medication to a patient. Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner. """ __resource_type__ = "MedicationAdministration" basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Plan this is fulfilled by this administration", description=( "A plan that is fulfilled in whole or in part by this " "MedicationAdministration." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CarePlan"], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Type of medication administration", description=( "The type of medication administration (for example, drug " "classification like ATC, where meds would be administered, legal " "category of the medication)." ), json_schema_extra={ "element_property": True, }, ) device: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="device", title="Device used to administer", description=( "The device that is to be used for the administration of the medication" " (for example, PCA Pump)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) dosage: fhirtypes.MedicationAdministrationDosageType | None = Field( default=None, alias="dosage", title="Details of how medication was taken", description=( "Describes the medication dosage information details e.g. dose, rate, " "site, route, etc." ), json_schema_extra={ "element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter administered as part of", description=( "The visit, admission, or other contact between patient and health care" " provider during which the medication administration was performed." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) eventHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="eventHistory", title="A list of events of interest in the lifecycle", description=( "A summary of the events of interest that have occurred, such as when " "the administration was verified." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Provenance"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External identifier", description=( "Identifiers associated with this Medication Administration that are " "defined by business processes and/or used to refer to it when a direct" " URL reference to the resource itself is not appropriate. They are " "business identifiers assigned to this resource by the performer or " "other systems and remain constant as the resource is updated and " "propagates from server to server." ), json_schema_extra={ "element_property": True, }, ) isSubPotent: bool | None = Field( default=None, alias="isSubPotent", title="Full dose was not administered", description="An indication that the full dose was not administered.", json_schema_extra={ "element_property": True, }, ) isSubPotent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isSubPotent", title="Extension field for ``isSubPotent``." ) medication: fhirtypes.CodeableReferenceType = Field( default=..., alias="medication", title="What was administered", description=( "Identifies the medication that was administered. This is either a link" " to a resource representing the details of the medication or a simple " "attribute carrying a code that identifies the medication from a known " "list of medications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Information about the administration", description=( "Extra information about the medication administration that is not " "conveyed by the other attributes." ), json_schema_extra={ "element_property": True, }, ) occurenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurenceDateTime", title=( "Specific date/time or interval of time during which the administration" " took place (or did not take place)" ), description=( "A specific date/time or interval of time during which the " "administration took place (or did not take place). For many " "administrations, such as swallowing a tablet the use of dateTime is " "more appropriate." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurence[x] "one_of_many": "occurence", "one_of_many_required": True, }, ) occurenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurenceDateTime", title="Extension field for ``occurenceDateTime``.", ) occurencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurencePeriod", title=( "Specific date/time or interval of time during which the administration" " took place (or did not take place)" ), description=( "A specific date/time or interval of time during which the " "administration took place (or did not take place). For many " "administrations, such as swallowing a tablet the use of dateTime is " "more appropriate." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurence[x] "one_of_many": "occurence", "one_of_many_required": True, }, ) occurenceTiming: fhirtypes.TimingType | None = Field( default=None, alias="occurenceTiming", title=( "Specific date/time or interval of time during which the administration" " took place (or did not take place)" ), description=( "A specific date/time or interval of time during which the " "administration took place (or did not take place). For many " "administrations, such as swallowing a tablet the use of dateTime is " "more appropriate." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurence[x] "one_of_many": "occurence", "one_of_many_required": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced event", description="A larger event of which this particular event is a component or step.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "MedicationAdministration", "Procedure", "MedicationDispense", ], }, ) performer: typing.List[ fhirtypes.MedicationAdministrationPerformerType ] | None = Field( default=None, alias="performer", title=( "Who or what performed the medication administration and what type of " "performance they did" ), description=( "The performer of the medication treatment. For devices this is the " "device that performed the administration of the medication. An IV " "Pump would be an example of a device that is performing the " "administration. Both the IV Pump and the practitioner that set the " "rate or bolus on the pump can be listed as performers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="reason", title=( "Concept, condition or observation that supports why the medication was" " administered" ), description=( "A code, Condition or observation that supports why the medication was " "administered." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "Observation", "DiagnosticReport"], }, ) recorded: fhirtypes.DateTimeType | None = Field( default=None, alias="recorded", title=( "When the MedicationAdministration was first captured in the subject's " "record" ), description=( "The date the occurrence of the MedicationAdministration was first " "captured in the record - potentially significantly after the " "occurrence of the event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) recorded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recorded", title="Extension field for ``recorded``." ) request: fhirtypes.ReferenceType | None = Field( default=None, alias="request", title="Request administration performed against", description=( "The original request, instruction or authority to perform the " "administration." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicationRequest"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "in-progress | not-done | on-hold | completed | entered-in-error | " "stopped | unknown" ), description=( "Will generally be set to show that the administration has been " "completed. For some long running administrations such as infusions, " "it is possible for an administration to be started but not completed " "or it may be paused while some other process is under way." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "in-progress", "not-done", "on-hold", "completed", "entered-in-error", "stopped", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusReason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="statusReason", title="Reason administration not performed", description="A code indicating why the administration was not performed.", json_schema_extra={ "element_property": True, }, ) subPotentReason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="subPotentReason", title="Reason full dose was not administered", description="The reason or reasons why the full dose was not administered.", json_schema_extra={ "element_property": True, }, ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who received medication", description="The person or animal or group receiving the medication.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInformation", title="Additional information to support administration", description=( "Additional information (for example, patient height and weight) that " "supports the administration of the medication. This attribute can be " "used to provide documentation of specific characteristics of the " "patient present at the time of administration. For example, if the " 'dose says "give "x" if the heartrate exceeds "y"", then the heart rate' " can be included using this attribute." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationAdministration`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "partOf", "status", "statusReason", "category", "medication", "subject", "encounter", "supportingInformation", "occurenceDateTime", "occurencePeriod", "occurenceTiming", "recorded", "isSubPotent", "subPotentReason", "performer", "reason", "request", "device", "note", "dosage", "eventHistory", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationAdministration`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "partOf", "status", "medication", "subject", "occurenceDateTime", "occurencePeriod", "occurenceTiming", "recorded", "performer", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "occurence": ["occurenceDateTime", "occurencePeriod", "occurenceTiming"] } return one_of_many_fields class MedicationAdministrationDosage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details of how medication was taken. Describes the medication dosage information details e.g. dose, rate, site, route, etc. """ __resource_type__ = "MedicationAdministrationDosage" dose: fhirtypes.QuantityType | None = Field( default=None, alias="dose", title="Amount of medication per dose", description=( "The amount of the medication given at one administration event. Use " "this value when the administration is essentially an instantaneous " "event such as a swallowing a tablet or giving an injection." ), json_schema_extra={ "element_property": True, }, ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="How drug was administered", description=( "A coded value indicating the method by which the medication is " "intended to be or was introduced into or on the body. This attribute " "will most often NOT be populated. It is most commonly used for " "injections. For example, Slow Push, Deep IV." ), json_schema_extra={ "element_property": True, }, ) rateQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="rateQuantity", title="Dose quantity per unit of time", description=( "Identifies the speed with which the medication was or will be " "introduced into the patient. Typically, the rate for an infusion e.g." " 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per " "unit of time, e.g. 500 ml per 2 hours. Other examples: 200 mcg/min " "or 200 mcg/1 minute; 1 liter/8 hours." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e rate[x] "one_of_many": "rate", "one_of_many_required": False, }, ) rateRatio: fhirtypes.RatioType | None = Field( default=None, alias="rateRatio", title="Dose quantity per unit of time", description=( "Identifies the speed with which the medication was or will be " "introduced into the patient. Typically, the rate for an infusion e.g." " 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per " "unit of time, e.g. 500 ml per 2 hours. Other examples: 200 mcg/min " "or 200 mcg/1 minute; 1 liter/8 hours." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e rate[x] "one_of_many": "rate", "one_of_many_required": False, }, ) route: fhirtypes.CodeableConceptType | None = Field( default=None, alias="route", title="Path of substance into body", description=( "A code specifying the route or physiological path of administration of" " a therapeutic agent into or onto the patient. For example, topical, " "intravenous, etc." ), json_schema_extra={ "element_property": True, }, ) site: fhirtypes.CodeableConceptType | None = Field( default=None, alias="site", title="Body site administered to", description=( "A coded specification of the anatomic site where the medication first " 'entered the body. For example, "left arm".' ), json_schema_extra={ "element_property": True, }, ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Free text dosage instructions e.g. SIG", description=( "Free text dosage can be used for cases where the dosage administered " "is too complex to code. When coded dosage is present, the free text " "dosage may still be present for display to humans. The dosage " "instructions should reflect the dosage of the medication that was " "administered." ), json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationAdministrationDosage`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "text", "site", "route", "method", "dose", "rateRatio", "rateQuantity", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationAdministrationDosage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"rate": ["rateQuantity", "rateRatio"]} return one_of_many_fields class MedicationAdministrationPerformer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who or what performed the medication administration and what type of performance they did. The performer of the medication treatment. For devices this is the device that performed the administration of the medication. An IV Pump would be an example of a device that is performing the administration. Both the IV Pump and the practitioner that set the rate or bolus on the pump can be listed as performers. """ __resource_type__ = "MedicationAdministrationPerformer" actor: fhirtypes.CodeableReferenceType = Field( default=..., alias="actor", title="Who or what performed the medication administration", description="Indicates who or what performed the medication administration.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Patient", "RelatedPerson", "Device", ], }, ) function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="Type of performance", description=( "Distinguishes the type of involvement of the performer in the " "medication administration." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationAdministrationPerformer`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "function", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationAdministrationPerformer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "actor"] ================================================ FILE: fhir/resources/medicationdispense.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MedicationDispense Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MedicationDispense(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Dispensing a medication to a named patient. Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order. """ __resource_type__ = "MedicationDispense" authorizingPrescription: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="authorizingPrescription", title="Medication order that authorizes the dispense", description="Indicates the medication order that is being dispensed against.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicationRequest"], }, ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Plan that is fulfilled by this dispense", description=( "A plan that is fulfilled in whole or in part by this " "MedicationDispense." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CarePlan"], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Type of medication dispense", description=( "Indicates the type of medication dispense (for example, drug " "classification like ATC, where meds would be administered, legal " "category of the medication.)." ), json_schema_extra={ "element_property": True, }, ) daysSupply: fhirtypes.QuantityType | None = Field( default=None, alias="daysSupply", title="Amount of medication expressed as a timing amount", description="The amount of medication expressed as a timing amount.", json_schema_extra={ "element_property": True, }, ) destination: fhirtypes.ReferenceType | None = Field( default=None, alias="destination", title="Where the medication was/will be sent", description=( "Identification of the facility/location where the medication was/will " "be shipped to, as part of the dispense event." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) dosageInstruction: typing.List[fhirtypes.DosageType] | None = Field( default=None, alias="dosageInstruction", title=( "How the medication is to be used by the patient or administered by the" " caregiver" ), description="Indicates how the medication is to be used by the patient.", json_schema_extra={ "element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter associated with event", description="The encounter that establishes the context for this event.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) eventHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="eventHistory", title="A list of relevant lifecycle events", description=( "A summary of the events of interest that have occurred, such as when " "the dispense was verified." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Provenance"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External identifier", description=( "Identifiers associated with this Medication Dispense that are defined " "by business processes and/or used to refer to it when a direct URL " "reference to the resource itself is not appropriate. They are business" " identifiers assigned to this resource by the performer or other " "systems and remain constant as the resource is updated and propagates " "from server to server." ), json_schema_extra={ "element_property": True, }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where the dispense occurred", description="The principal physical location where the dispense was performed.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) medication: fhirtypes.CodeableReferenceType = Field( default=..., alias="medication", title="What medication was supplied", description=( "Identifies the medication supplied. This is either a link to a " "resource representing the details of the medication or a simple " "attribute carrying a code that identifies the medication from a known " "list of medications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication"], }, ) notPerformedReason: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="notPerformedReason", title="Why a dispense was not performed", description="Indicates the reason why a dispense was not performed.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DetectedIssue"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Information about the dispense", description=( "Extra information about the dispense that could not be conveyed in the" " other attributes." ), json_schema_extra={ "element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Event that dispense is part of", description=( "The procedure or medication administration that triggered the " "dispense." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Procedure", "MedicationAdministration"], }, ) performer: typing.List[fhirtypes.MedicationDispensePerformerType] | None = Field( default=None, alias="performer", title="Who performed event", description="Indicates who or what performed the event.", json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Amount dispensed", description=( "The amount of medication that has been dispensed. Includes unit of " "measure." ), json_schema_extra={ "element_property": True, }, ) receiver: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="receiver", title="Who collected the medication or where the medication was delivered", description=( "Identifies the person who picked up the medication or the location of " "where the medication was delivered. This will usually be a patient or" " their caregiver, but some cases exist where it can be a healthcare " "professional or a location." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "RelatedPerson", "Location", "PractitionerRole", ], }, ) recorded: fhirtypes.DateTimeType | None = Field( default=None, alias="recorded", title="When the recording of the dispense started", description=( "The date (and maybe time) when the dispense activity started if " "whenPrepared or whenHandedOver is not populated." ), json_schema_extra={ "element_property": True, }, ) recorded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recorded", title="Extension field for ``recorded``." ) renderedDosageInstruction: fhirtypes.MarkdownType | None = Field( default=None, alias="renderedDosageInstruction", title="Full representation of the dosage instructions", description=( "The full representation of the dose of the medication included in all " "dosage instructions. To be used when multiple dosage instructions are" " included to represent complex dosing such as increasing or tapering " "doses." ), json_schema_extra={ "element_property": True, }, ) renderedDosageInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_renderedDosageInstruction", title="Extension field for ``renderedDosageInstruction``.", ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "preparation | in-progress | cancelled | on-hold | completed | entered-" "in-error | stopped | declined | unknown" ), description="A code specifying the state of the set of dispense events.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "preparation", "in-progress", "cancelled", "on-hold", "completed", "entered-in-error", "stopped", "declined", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusChanged: fhirtypes.DateTimeType | None = Field( default=None, alias="statusChanged", title="When the status changed", description=( "The date (and maybe time) when the status of the dispense record " "changed." ), json_schema_extra={ "element_property": True, }, ) statusChanged__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_statusChanged", title="Extension field for ``statusChanged``.", ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who the dispense is for", description=( "A link to a resource representing the person or the group to whom the " "medication will be given." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) substitution: fhirtypes.MedicationDispenseSubstitutionType | None = Field( default=None, alias="substitution", title="Whether a substitution was performed on the dispense", description=( "Indicates whether or not substitution was made as part of the " "dispense. In some cases, substitution will be expected but does not " "happen, in other cases substitution is not expected but does happen. " "This block explains what substitution did or did not happen and why. " "If nothing is specified, substitution was not done." ), json_schema_extra={ "element_property": True, }, ) supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInformation", title="Information that supports the dispensing of the medication", description=( "Additional information that supports the medication being dispensed. " "For example, there may be requirements that a specific lab test has " "been completed prior to dispensing or the patient's weight at the time" " of dispensing is documented." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Trial fill, partial fill, emergency fill, etc", description=( "Indicates the type of dispensing event that is performed. For example," " Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, " "Samples, etc." ), json_schema_extra={ "element_property": True, }, ) whenHandedOver: fhirtypes.DateTimeType | None = Field( default=None, alias="whenHandedOver", title="When product was given out", description=( "The time the dispensed product was provided to the patient or their " "representative." ), json_schema_extra={ "element_property": True, }, ) whenHandedOver__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_whenHandedOver", title="Extension field for ``whenHandedOver``.", ) whenPrepared: fhirtypes.DateTimeType | None = Field( default=None, alias="whenPrepared", title="When product was packaged and reviewed", description="The time when the dispensed product was packaged and reviewed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) whenPrepared__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_whenPrepared", title="Extension field for ``whenPrepared``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationDispense`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "partOf", "status", "notPerformedReason", "statusChanged", "category", "medication", "subject", "encounter", "supportingInformation", "performer", "location", "authorizingPrescription", "type", "quantity", "daysSupply", "recorded", "whenPrepared", "whenHandedOver", "destination", "receiver", "note", "renderedDosageInstruction", "dosageInstruction", "substitution", "eventHistory", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationDispense`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "status", "medication", "subject", "whenPrepared", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class MedicationDispensePerformer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who performed event. Indicates who or what performed the event. """ __resource_type__ = "MedicationDispensePerformer" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Individual who was performing", description=( "The device, practitioner, etc. who performed the action. It should be" " assumed that the actor is the dispenser of the medication." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Patient", "Device", "RelatedPerson", "CareTeam", ], }, ) function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="Who performed the dispense and what they did", description=( "Distinguishes the type of performer in the dispense. For example, " "date enterer, packager, final checker." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationDispensePerformer`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "function", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationDispensePerformer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationDispenseSubstitution(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Whether a substitution was performed on the dispense. Indicates whether or not substitution was made as part of the dispense. In some cases, substitution will be expected but does not happen, in other cases substitution is not expected but does happen. This block explains what substitution did or did not happen and why. If nothing is specified, substitution was not done. """ __resource_type__ = "MedicationDispenseSubstitution" reason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reason", title="Why was substitution made", description=( "Indicates the reason for the substitution (or lack of substitution) " "from what was prescribed." ), json_schema_extra={ "element_property": True, }, ) responsibleParty: fhirtypes.ReferenceType | None = Field( default=None, alias="responsibleParty", title="Who is responsible for the substitution", description=( "The person or organization that has primary responsibility for the " "substitution." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title=( "Code signifying whether a different drug was dispensed from what was " "prescribed" ), description=( "A code signifying whether a different drug was dispensed from what was" " prescribed." ), json_schema_extra={ "element_property": True, }, ) wasSubstituted: bool | None = Field( default=None, alias="wasSubstituted", title="Whether a substitution was or was not performed on the dispense", description=( "True if the dispenser dispensed a different drug or product from what " "was prescribed." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) wasSubstituted__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_wasSubstituted", title="Extension field for ``wasSubstituted``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationDispenseSubstitution`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "wasSubstituted", "type", "reason", "responsibleParty", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationDispenseSubstitution`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("wasSubstituted", "wasSubstituted__ext")] return required_fields ================================================ FILE: fhir/resources/medicationknowledge.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MedicationKnowledge Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MedicationKnowledge(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of Medication Knowledge. Information about a medication that is used to support knowledge. """ __resource_type__ = "MedicationKnowledge" associatedMedication: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="associatedMedication", title=( "The set of medication resources that are associated with this " "medication" ), description=( "Links to associated medications that could be prescribed, dispensed or" " administered." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication"], }, ) author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="Creator or owner of the knowledge or information about the medication", description=( "The creator or owner of the knowledge or information about the " "medication." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) clinicalUseIssue: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="clinicalUseIssue", title="Potential clinical issue with or between medication(s)", description=( "Potential clinical issue with or between medication(s) (for example, " "drug-drug interaction, drug-disease contraindication, drug-allergy " "interaction, etc.)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ClinicalUseDefinition"], }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Code that identifies this medication", description=( "A code that specifies this medication, or a textual description if no " "code is available. Usage note: This could be a standard medication " "code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be" " a national or local formulary code, optionally with translations to " "other code systems." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) cost: typing.List[fhirtypes.MedicationKnowledgeCostType] | None = Field( default=None, alias="cost", title="The pricing of the medication", description="The price of the medication.", json_schema_extra={ "element_property": True, }, ) definitional: fhirtypes.MedicationKnowledgeDefinitionalType | None = Field( default=None, alias="definitional", title="Minimal definition information about the medication", description=( "Along with the link to a Medicinal Product Definition resource, this " "information provides common definitional elements that are needed to " "understand the specific medication that is being described." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier for this medication", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) indicationGuideline: typing.List[ fhirtypes.MedicationKnowledgeIndicationGuidelineType ] | None = Field( default=None, alias="indicationGuideline", title=( "Guidelines or protocols for administration of the medication for an " "indication" ), description=( "Guidelines or protocols that are applicable for the administration of " "the medication based on indication." ), json_schema_extra={ "element_property": True, }, ) intendedJurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="intendedJurisdiction", title=( "Codes that identify the different jurisdictions for which the " "information of this resource was created" ), description=( "Lists the jurisdictions that this medication knowledge was written " "for." ), json_schema_extra={ "element_property": True, }, ) medicineClassification: typing.List[ fhirtypes.MedicationKnowledgeMedicineClassificationType ] | None = Field( default=None, alias="medicineClassification", title=( "Categorization of the medication within a formulary or classification " "system" ), description=None, json_schema_extra={ "element_property": True, }, ) monitoringProgram: typing.List[ fhirtypes.MedicationKnowledgeMonitoringProgramType ] | None = Field( default=None, alias="monitoringProgram", title="Program under which a medication is reviewed", description="The program under which the medication is reviewed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) monograph: typing.List[fhirtypes.MedicationKnowledgeMonographType] | None = Field( default=None, alias="monograph", title="Associated documentation about the medication", description=None, json_schema_extra={ "element_property": True, }, ) name: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="name", title="A name associated with the medication being described", description=( "All of the names for a medication, for example, the name(s) given to a" " medication in different countries. For example, acetaminophen and " "paracetamol or salbutamol and albuterol." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) packaging: typing.List[fhirtypes.MedicationKnowledgePackagingType] | None = Field( default=None, alias="packaging", title="Details about packaged medications", description="Information that only applies to packages (not products).", json_schema_extra={ "element_property": True, }, ) preparationInstruction: fhirtypes.MarkdownType | None = Field( default=None, alias="preparationInstruction", title="The instructions for preparing the medication", description=None, json_schema_extra={ "element_property": True, }, ) preparationInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preparationInstruction", title="Extension field for ``preparationInstruction``.", ) productType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="productType", title="Category of the medication or product", description=( "Category of the medication or product (e.g. branded product, " "therapeutic moeity, generic product, innovator product, etc.)." ), json_schema_extra={ "element_property": True, }, ) regulatory: typing.List[fhirtypes.MedicationKnowledgeRegulatoryType] | None = Field( default=None, alias="regulatory", title="Regulatory information about a medication", description=None, json_schema_extra={ "element_property": True, }, ) relatedMedicationKnowledge: typing.List[ fhirtypes.MedicationKnowledgeRelatedMedicationKnowledgeType ] | None = Field( default=None, alias="relatedMedicationKnowledge", title="Associated or related medication information", description=( "Associated or related medications. For example, if the medication is a" " branded product (e.g. Crestor), this is the Therapeutic Moeity (e.g. " "Rosuvastatin) or if this is a generic medication (e.g. Rosuvastatin), " "this would link to a branded product (e.g. Crestor." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | entered-in-error | inactive", description=( "A code to indicate if the medication referred to by this " "MedicationKnowledge is in active use within the drug database or " "inventory system. The status refers to the validity about the " "information of the medication and not to its medicinal properties." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "entered-in-error", "inactive"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) storageGuideline: typing.List[ fhirtypes.MedicationKnowledgeStorageGuidelineType ] | None = Field( default=None, alias="storageGuideline", title="How the medication should be stored", description=( "Information on how the medication should be stored, for example, " "refrigeration temperatures and length of stability at a given " "temperature." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledge`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "code", "status", "author", "intendedJurisdiction", "name", "relatedMedicationKnowledge", "associatedMedication", "productType", "monograph", "preparationInstruction", "cost", "monitoringProgram", "indicationGuideline", "medicineClassification", "packaging", "clinicalUseIssue", "storageGuideline", "regulatory", "definitional", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledge`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "code", "status", "name", "monitoringProgram", ] class MedicationKnowledgeCost(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The pricing of the medication. The price of the medication. """ __resource_type__ = "MedicationKnowledgeCost" costCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="costCodeableConcept", title="The price or category of the cost of the medication", description=( "The price or representation of the cost (for example, Band A, Band B " "or $, $$) of the medication." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e cost[x] "one_of_many": "cost", "one_of_many_required": True, }, ) costMoney: fhirtypes.MoneyType | None = Field( default=None, alias="costMoney", title="The price or category of the cost of the medication", description=( "The price or representation of the cost (for example, Band A, Band B " "or $, $$) of the medication." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e cost[x] "one_of_many": "cost", "one_of_many_required": True, }, ) effectiveDate: typing.List[fhirtypes.PeriodType] | None = Field( default=None, alias="effectiveDate", title="The date range for which the cost is effective", description=( "The date range for which the cost information of the medication is " "effective." ), json_schema_extra={ "element_property": True, }, ) source: fhirtypes.StringType | None = Field( default=None, alias="source", title="The source or owner for the price information", description="The source or owner that assigns the price to the medication.", json_schema_extra={ "element_property": True, }, ) source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_source", title="Extension field for ``source``." ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="The category of the cost information", description=( "The category of the cost information. For example, manufacturers' " "cost, patient cost, claim reimbursement cost, actual acquisition cost." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeCost`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "effectiveDate", "type", "source", "costMoney", "costCodeableConcept", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeCost`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"cost": ["costCodeableConcept", "costMoney"]} return one_of_many_fields class MedicationKnowledgeDefinitional(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Minimal definition information about the medication. Along with the link to a Medicinal Product Definition resource, this information provides common definitional elements that are needed to understand the specific medication that is being described. """ __resource_type__ = "MedicationKnowledgeDefinitional" definition: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="definition", title=( "Definitional resources that provide more information about this " "medication" ), description="Associated definitions for this medication.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicinalProductDefinition"], }, ) doseForm: fhirtypes.CodeableConceptType | None = Field( default=None, alias="doseForm", title="powder | tablets | capsule +", description="Describes the form of the item. Powder; tablets; capsule.", json_schema_extra={ "element_property": True, }, ) drugCharacteristic: typing.List[ fhirtypes.MedicationKnowledgeDefinitionalDrugCharacteristicType ] | None = Field( default=None, alias="drugCharacteristic", title="Specifies descriptive properties of the medicine", description=( "Specifies descriptive properties of the medicine, such as color, " "shape, imprints, etc." ), json_schema_extra={ "element_property": True, }, ) ingredient: typing.List[ fhirtypes.MedicationKnowledgeDefinitionalIngredientType ] | None = Field( default=None, alias="ingredient", title="Active or inactive ingredient", description="Identifies a particular constituent of interest in the product.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) intendedRoute: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="intendedRoute", title="The intended or approved route of administration", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeDefinitional`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "definition", "doseForm", "intendedRoute", "ingredient", "drugCharacteristic", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeDefinitional`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "ingredient"] class MedicationKnowledgeDefinitionalDrugCharacteristic( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specifies descriptive properties of the medicine. Specifies descriptive properties of the medicine, such as color, shape, imprints, etc. """ __resource_type__ = "MedicationKnowledgeDefinitionalDrugCharacteristic" type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Code specifying the type of characteristic of medication", description=( "A code specifying which characteristic of the medicine is being " "described (for example, colour, shape, imprint)." ), json_schema_extra={ "element_property": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Description of the characteristic", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="valueBase64Binary", title="Description of the characteristic", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBase64Binary", title="Extension field for ``valueBase64Binary``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Description of the characteristic", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Description of the characteristic", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Description of the characteristic", description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeDefinitionalDrugCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueCodeableConcept", "valueString", "valueQuantity", "valueBase64Binary", "valueAttachment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeDefinitionalDrugCharacteristic`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueBase64Binary", "valueCodeableConcept", "valueQuantity", "valueString", ] } return one_of_many_fields class MedicationKnowledgeDefinitionalIngredient(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Active or inactive ingredient. Identifies a particular constituent of interest in the product. """ __resource_type__ = "MedicationKnowledgeDefinitionalIngredient" item: fhirtypes.CodeableReferenceType = Field( default=..., alias="item", title="Substances contained in the medication", description=( "A reference to the resource that provides information about the " "ingredient." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Substance"], }, ) strengthCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="strengthCodeableConcept", title="Quantity of ingredient present", description=( "Specifies how many (or how much) of the items there are in this " "Medication. For example, 250 mg per tablet. This is expressed as a " "ratio where the numerator is 250mg and the denominator is 1 tablet but" " can also be expressed a quantity when the denominator is assumed to " "be 1 tablet." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e strength[x] "one_of_many": "strength", "one_of_many_required": False, }, ) strengthQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="strengthQuantity", title="Quantity of ingredient present", description=( "Specifies how many (or how much) of the items there are in this " "Medication. For example, 250 mg per tablet. This is expressed as a " "ratio where the numerator is 250mg and the denominator is 1 tablet but" " can also be expressed a quantity when the denominator is assumed to " "be 1 tablet." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e strength[x] "one_of_many": "strength", "one_of_many_required": False, }, ) strengthRatio: fhirtypes.RatioType | None = Field( default=None, alias="strengthRatio", title="Quantity of ingredient present", description=( "Specifies how many (or how much) of the items there are in this " "Medication. For example, 250 mg per tablet. This is expressed as a " "ratio where the numerator is 250mg and the denominator is 1 tablet but" " can also be expressed a quantity when the denominator is assumed to " "be 1 tablet." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e strength[x] "one_of_many": "strength", "one_of_many_required": False, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="A code that defines the type of ingredient, active, base, etc", description=( "Indication of whether this ingredient affects the therapeutic action " "of the drug." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeDefinitionalIngredient`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "item", "type", "strengthRatio", "strengthCodeableConcept", "strengthQuantity", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeDefinitionalIngredient`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "item"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "strength": ["strengthCodeableConcept", "strengthQuantity", "strengthRatio"] } return one_of_many_fields class MedicationKnowledgeIndicationGuideline(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Guidelines or protocols for administration of the medication for an indication. Guidelines or protocols that are applicable for the administration of the medication based on indication. """ __resource_type__ = "MedicationKnowledgeIndicationGuideline" dosingGuideline: typing.List[ fhirtypes.MedicationKnowledgeIndicationGuidelineDosingGuidelineType ] | None = Field( default=None, alias="dosingGuideline", title="Guidelines for dosage of the medication", description="The guidelines for the dosage of the medication for the indication.", json_schema_extra={ "element_property": True, }, ) indication: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="indication", title=( "Indication for use that applies to the specific administration " "guideline" ), description=( "Indication or reason for use of the medication that applies to the " "specific administration guideline." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ClinicalUseDefinition"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeIndicationGuideline`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "indication", "dosingGuideline"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeIndicationGuideline`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationKnowledgeIndicationGuidelineDosingGuideline( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Guidelines for dosage of the medication. The guidelines for the dosage of the medication for the indication. """ __resource_type__ = "MedicationKnowledgeIndicationGuidelineDosingGuideline" administrationTreatment: fhirtypes.CodeableConceptType | None = Field( default=None, alias="administrationTreatment", title="Type of treatment the guideline applies to", description=( "The type of the treatment that the guideline applies to, for example, " "long term therapy, first line treatment, etc." ), json_schema_extra={ "element_property": True, }, ) dosage: typing.List[ fhirtypes.MedicationKnowledgeIndicationGuidelineDosingGuidelineDosageType ] | None = Field( default=None, alias="dosage", title="Dosage for the medication for the specific guidelines", description=None, json_schema_extra={ "element_property": True, }, ) patientCharacteristic: typing.List[ fhirtypes.MedicationKnowledgeIndicationGuidelineDosingGuidelinePatientCharacteristicType ] | None = Field( default=None, alias="patientCharacteristic", title=( "Characteristics of the patient that are relevant to the administration" " guidelines" ), description=( "Characteristics of the patient that are relevant to the administration" " guidelines (for example, height, weight, gender, etc.)." ), json_schema_extra={ "element_property": True, }, ) treatmentIntent: fhirtypes.CodeableConceptType | None = Field( default=None, alias="treatmentIntent", title="Intention of the treatment", description=( "The overall intention of the treatment, for example, prophylactic, " "supporative, curative, etc." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeIndicationGuidelineDosingGuideline`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "treatmentIntent", "dosage", "administrationTreatment", "patientCharacteristic", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeIndicationGuidelineDosingGuideline`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationKnowledgeIndicationGuidelineDosingGuidelineDosage( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Dosage for the medication for the specific guidelines. """ __resource_type__ = "MedicationKnowledgeIndicationGuidelineDosingGuidelineDosage" dosage: typing.List[fhirtypes.DosageType] = Field( default=..., alias="dosage", title="Dosage for the medication for the specific guidelines", description=None, json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Category of dosage for a medication", description=( "The type or category of dosage for a given medication (for example, " "prophylaxis, maintenance, therapeutic, etc.)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeIndicationGuidelineDosingGuidelineDosage`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "dosage"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeIndicationGuidelineDosingGuidelineDosage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationKnowledgeIndicationGuidelineDosingGuidelinePatientCharacteristic( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Characteristics of the patient that are relevant to the administration guidelines. Characteristics of the patient that are relevant to the administration guidelines (for example, height, weight, gender, etc.). """ __resource_type__ = ( "MedicationKnowledgeIndicationGuidelineDosingGuidelinePatientCharacteristic" ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title=( "Categorization of specific characteristic that is relevant to the " "administration guideline" ), description=( "The categorization of the specific characteristic that is relevant to " "the administration guideline (e.g. height, weight, gender)." ), json_schema_extra={ "element_property": True, }, ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="The specific characteristic", description="The specific characteristic (e.g. height, weight, gender, etc.).", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="The specific characteristic", description="The specific characteristic (e.g. height, weight, gender, etc.).", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="The specific characteristic", description="The specific characteristic (e.g. height, weight, gender, etc.).", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeIndicationGuidelineDosingGuidelinePatientCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueCodeableConcept", "valueQuantity", "valueRange", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeIndicationGuidelineDosingGuidelinePatientCharacteristic`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": ["valueCodeableConcept", "valueQuantity", "valueRange"] } return one_of_many_fields class MedicationKnowledgeMedicineClassification(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Categorization of the medication within a formulary or classification system. """ __resource_type__ = "MedicationKnowledgeMedicineClassification" classification: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="classification", title="Specific category assigned to the medication", description=( "Specific category assigned to the medication (e.g. anti-infective, " "anti-hypertensive, antibiotic, etc.)." ), json_schema_extra={ "element_property": True, }, ) sourceString: fhirtypes.StringType | None = Field( default=None, alias="sourceString", title="The source of the classification", description=( "Either a textual source of the classification or a reference to an " "online source." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e source[x] "one_of_many": "source", "one_of_many_required": False, }, ) sourceString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceString", title="Extension field for ``sourceString``.", ) sourceUri: fhirtypes.UriType | None = Field( default=None, alias="sourceUri", title="The source of the classification", description=( "Either a textual source of the classification or a reference to an " "online source." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e source[x] "one_of_many": "source", "one_of_many_required": False, }, ) sourceUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceUri", title="Extension field for ``sourceUri``." ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title=( "The type of category for the medication (for example, therapeutic " "classification, therapeutic sub-classification)" ), description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeMedicineClassification`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "sourceString", "sourceUri", "classification", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeMedicineClassification`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"source": ["sourceString", "sourceUri"]} return one_of_many_fields class MedicationKnowledgeMonitoringProgram(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Program under which a medication is reviewed. The program under which the medication is reviewed. """ __resource_type__ = "MedicationKnowledgeMonitoringProgram" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name of the reviewing program", description=None, json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Type of program under which the medication is monitored", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeMonitoringProgram`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "name"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeMonitoringProgram`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationKnowledgeMonograph(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Associated documentation about the medication. """ __resource_type__ = "MedicationKnowledgeMonograph" source: fhirtypes.ReferenceType | None = Field( default=None, alias="source", title="Associated documentation about the medication", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The category of medication document", description=( "The category of documentation about the medication. (e.g. professional" " monograph, patient education monograph)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeMonograph`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "source"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeMonograph`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationKnowledgePackaging(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details about packaged medications. Information that only applies to packages (not products). """ __resource_type__ = "MedicationKnowledgePackaging" cost: typing.List[fhirtypes.MedicationKnowledgeCostType] | None = Field( default=None, alias="cost", title="Cost of the packaged medication", description="The cost of the packaged medication.", json_schema_extra={ "element_property": True, }, ) packagedProduct: fhirtypes.ReferenceType | None = Field( default=None, alias="packagedProduct", title="The packaged medication that is being priced", description=( "A reference to a PackagedProductDefinition that provides the details " "of the product that is in the packaging and is being priced." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["PackagedProductDefinition"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgePackaging`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "cost", "packagedProduct"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgePackaging`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationKnowledgeRegulatory(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Regulatory information about a medication. """ __resource_type__ = "MedicationKnowledgeRegulatory" maxDispense: fhirtypes.MedicationKnowledgeRegulatoryMaxDispenseType | None = Field( default=None, alias="maxDispense", title=( "The maximum number of units of the medication that can be dispensed in" " a period" ), description=None, json_schema_extra={ "element_property": True, }, ) regulatoryAuthority: fhirtypes.ReferenceType = Field( default=..., alias="regulatoryAuthority", title="Specifies the authority of the regulation", description="The authority that is specifying the regulations.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) schedule: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="schedule", title="Specifies the schedule of a medication in jurisdiction", description=None, json_schema_extra={ "element_property": True, }, ) substitution: typing.List[ fhirtypes.MedicationKnowledgeRegulatorySubstitutionType ] | None = Field( default=None, alias="substitution", title=( "Specifies if changes are allowed when dispensing a medication from a " "regulatory perspective" ), description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeRegulatory`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "regulatoryAuthority", "substitution", "schedule", "maxDispense", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeRegulatory`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationKnowledgeRegulatoryMaxDispense(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The maximum number of units of the medication that can be dispensed in a period. """ __resource_type__ = "MedicationKnowledgeRegulatoryMaxDispense" period: fhirtypes.DurationType | None = Field( default=None, alias="period", title="The period that applies to the maximum number of units", description=None, json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType = Field( default=..., alias="quantity", title="The maximum number of units of the medication that can be dispensed", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeRegulatoryMaxDispense`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "quantity", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeRegulatoryMaxDispense`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationKnowledgeRegulatorySubstitution(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specifies if changes are allowed when dispensing a medication from a regulatory perspective. """ __resource_type__ = "MedicationKnowledgeRegulatorySubstitution" allowed: bool | None = Field( default=None, alias="allowed", title=( "Specifies if regulation allows for changes in the medication when " "dispensing" ), description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) allowed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allowed", title="Extension field for ``allowed``." ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Specifies the type of substitution allowed", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeRegulatorySubstitution`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "allowed"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeRegulatorySubstitution`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("allowed", "allowed__ext")] return required_fields class MedicationKnowledgeRelatedMedicationKnowledge(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Associated or related medication information. Associated or related medications. For example, if the medication is a branded product (e.g. Crestor), this is the Therapeutic Moeity (e.g. Rosuvastatin) or if this is a generic medication (e.g. Rosuvastatin), this would link to a branded product (e.g. Crestor. """ __resource_type__ = "MedicationKnowledgeRelatedMedicationKnowledge" reference: typing.List[fhirtypes.ReferenceType] = Field( default=..., alias="reference", title="Associated documentation about the associated medication knowledge", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicationKnowledge"], }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Category of medicationKnowledge", description="The category of the associated medication knowledge reference.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeRelatedMedicationKnowledge`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "reference"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeRelatedMedicationKnowledge`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationKnowledgeStorageGuideline(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. How the medication should be stored. Information on how the medication should be stored, for example, refrigeration temperatures and length of stability at a given temperature. """ __resource_type__ = "MedicationKnowledgeStorageGuideline" environmentalSetting: typing.List[ fhirtypes.MedicationKnowledgeStorageGuidelineEnvironmentalSettingType ] | None = Field( default=None, alias="environmentalSetting", title="Setting or value of environment for adequate storage", description=( "Describes a setting/value on the environment for the adequate storage " "of the medication and other substances. Environment settings may " "involve temperature, humidity, or exposure to light." ), json_schema_extra={ "element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Additional storage notes", description="Additional notes about the storage.", json_schema_extra={ "element_property": True, }, ) reference: fhirtypes.UriType | None = Field( default=None, alias="reference", title="Reference to additional information", description="Reference to additional information about the storage guidelines.", json_schema_extra={ "element_property": True, }, ) reference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reference", title="Extension field for ``reference``." ) stabilityDuration: fhirtypes.DurationType | None = Field( default=None, alias="stabilityDuration", title="Duration remains stable", description=( "Duration that the medication remains stable if the " "environmentalSetting is respected." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeStorageGuideline`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "reference", "note", "stabilityDuration", "environmentalSetting", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeStorageGuideline`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationKnowledgeStorageGuidelineEnvironmentalSetting( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Setting or value of environment for adequate storage. Describes a setting/value on the environment for the adequate storage of the medication and other substances. Environment settings may involve temperature, humidity, or exposure to light. """ __resource_type__ = "MedicationKnowledgeStorageGuidelineEnvironmentalSetting" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Categorization of the setting", description=( "Identifies the category or type of setting (e.g., type of location, " "temperature, humidity)." ), json_schema_extra={ "element_property": True, }, ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Value of the setting", description="Value associated to the setting. E.g., 40\u00b0 \u2013 50\u00b0F for temperature.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Value of the setting", description="Value associated to the setting. E.g., 40\u00b0 \u2013 50\u00b0F for temperature.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Value of the setting", description="Value associated to the setting. E.g., 40\u00b0 \u2013 50\u00b0F for temperature.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationKnowledgeStorageGuidelineEnvironmentalSetting`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueQuantity", "valueRange", "valueCodeableConcept", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeStorageGuidelineEnvironmentalSetting`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": ["valueCodeableConcept", "valueQuantity", "valueRange"] } return one_of_many_fields ================================================ FILE: fhir/resources/medicationrequest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MedicationRequest Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MedicationRequest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Ordering of medication for patient or group. An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationRequest" rather than "MedicationPrescription" or "MedicationOrder" to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns. """ __resource_type__ = "MedicationRequest" authoredOn: fhirtypes.DateTimeType | None = Field( default=None, alias="authoredOn", title="When request was initially authored", description=( "The date (and perhaps time) when the prescription was initially " "written or authored on." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoredOn", title="Extension field for ``authoredOn``." ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title=( "A plan or request that is fulfilled in whole or in part by this " "medication request" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CarePlan", "MedicationRequest", "ServiceRequest", "ImmunizationRecommendation", ], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Grouping or category of medication request", description=( "An arbitrary categorization or grouping of the medication request. It" " could be used for indicating where meds are intended to be " "administered, eg. in an inpatient setting or in a patient's home, or a" " legal category of the medication." ), json_schema_extra={ "element_property": True, }, ) courseOfTherapyType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="courseOfTherapyType", title="Overall pattern of medication administration", description=( "The description of the overall pattern of the administration of the " "medication to the patient." ), json_schema_extra={ "element_property": True, }, ) device: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="device", title="Intended type of device for the administration", description=( "The intended type of device that is to be used for the administration " "of the medication (for example, PCA Pump)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DeviceDefinition"], }, ) dispenseRequest: fhirtypes.MedicationRequestDispenseRequestType | None = Field( default=None, alias="dispenseRequest", title="Medication supply authorization", description=( "Indicates the specific details for the dispense or medication supply " "part of a medication request (also known as a Medication Prescription " "or Medication Order). Note that this information is not always sent " "with the order. There may be in some settings (e.g. hospitals) " "institutional or system support for completing the dispense details in" " the pharmacy department." ), json_schema_extra={ "element_property": True, }, ) doNotPerform: bool | None = Field( default=None, alias="doNotPerform", title=( "True if patient is to stop taking or not to start taking the " "medication" ), description=( "If true, indicates that the provider is asking for the patient to " "either stop taking or to not start taking the specified medication. " "For example, the patient is taking an existing medication and the " "provider is changing their medication. They want to create two " "seperate requests: one to stop using the current medication and " "another to start the new medication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doNotPerform", title="Extension field for ``doNotPerform``.", ) dosageInstruction: typing.List[fhirtypes.DosageType] | None = Field( default=None, alias="dosageInstruction", title="Specific instructions for how the medication should be taken", description=( "Specific instructions for how the medication is to be used by the " "patient." ), json_schema_extra={ "element_property": True, }, ) effectiveDosePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectiveDosePeriod", title="Period over which the medication is to be taken", description=( "The period over which the medication is to be taken. Where there are " "multiple dosageInstruction lines (for example, tapering doses), this " "is the earliest date and the latest end date of the " "dosageInstructions." ), json_schema_extra={ "element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter created as part of encounter/admission/stay", description=( "The Encounter during which this [x] was created or to which the " "creation of this record is tightly associated." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) eventHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="eventHistory", title="A list of events of interest in the lifecycle", description=( "Links to Provenance records for past versions of this resource or " "fulfilling request or event resources that identify key state " "transitions or updates that are likely to be relevant to a user " "looking at the current version of the resource." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Provenance"], }, ) groupIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="groupIdentifier", title="Composite request this is part of", description=( "A shared identifier common to multiple independent Request instances " "that were activated/authorized more or less simultaneously by a single" " author. The presence of the same identifier on each request ties " "those requests together and may have business ramifications in terms " "of reporting of results, billing, etc. E.g. a requisition number " "shared by a set of lab tests ordered together, or a prescription " "number shared by all meds ordered at one time." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External ids for this request", description=( "Identifiers associated with this medication request that are defined " "by business processes and/or used to refer to it when a direct URL " "reference to the resource itself is not appropriate. They are business" " identifiers assigned to this resource by the performer or other " "systems and remain constant as the resource is updated and propagates " "from server to server." ), json_schema_extra={ "element_property": True, }, ) informationSource: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="informationSource", title=( "The person or organization who provided the information about this " "request, if the source is someone other than the requestor" ), description=( "The person or organization who provided the information about this " "request, if the source is someone other than the requestor. This is " "often used when the MedicationRequest is reported by another person." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Organization", ], }, ) insurance: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="insurance", title="Associated insurance coverage", description=( "Insurance plans, coverage extensions, pre-authorizations and/or pre-" "determinations that may be required for delivering the requested " "service." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage", "ClaimResponse"], }, ) intent: fhirtypes.CodeType | None = Field( default=None, alias="intent", title=( "proposal | plan | order | original-order | reflex-order | filler-order" " | instance-order | option" ), description="Whether the request is a proposal, plan, or an original order.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "proposal", "plan", "order", "original-order", "reflex-order", "filler-order", "instance-order", "option", ], }, ) intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intent", title="Extension field for ``intent``." ) medication: fhirtypes.CodeableReferenceType = Field( default=..., alias="medication", title="Medication to be taken", description=( "Identifies the medication being requested. This is a link to a " "resource that represents the medication which may be the details of " "the medication or simply an attribute carrying a code that identifies " "the medication from a known list of medications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Information about the prescription", description=( "Extra information about the prescription that could not be conveyed by" " the other attributes." ), json_schema_extra={ "element_property": True, }, ) performer: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="performer", title="Intended performer of administration", description=( "The specified desired performer of the medication treatment (e.g. the " "performer of the medication administration). For devices, this is the" " device that is intended to perform the administration of the " "medication. An IV Pump would be an example of a device that is " "performing the administration. Both the IV Pump and the practitioner " "that set the rate or bolus on the pump can be listed as performers." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Patient", "DeviceDefinition", "RelatedPerson", "CareTeam", "HealthcareService", ], }, ) performerType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="performerType", title="Desired kind of performer of the medication administration", description=( "Indicates the type of performer of the administration of the " "medication." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) priorPrescription: fhirtypes.ReferenceType | None = Field( default=None, alias="priorPrescription", title=( "Reference to an order/prescription that is being replaced by this " "MedicationRequest" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicationRequest"], }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Indicates how quickly the Medication Request should be addressed with " "respect to other requests." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="reason", title="Reason or indication for ordering or not ordering the medication", description=( "The reason or the indication for ordering or not ordering the " "medication." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "Observation"], }, ) recorder: fhirtypes.ReferenceType | None = Field( default=None, alias="recorder", title="Person who entered the request", description=( "The person who entered the order on behalf of another individual for " "example in the case of a verbal or a telephone order." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) renderedDosageInstruction: fhirtypes.MarkdownType | None = Field( default=None, alias="renderedDosageInstruction", title="Full representation of the dosage instructions", description=( "The full representation of the dose of the medication included in all " "dosage instructions. To be used when multiple dosage instructions are" " included to represent complex dosing such as increasing or tapering " "doses." ), json_schema_extra={ "element_property": True, }, ) renderedDosageInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_renderedDosageInstruction", title="Extension field for ``renderedDosageInstruction``.", ) reported: bool | None = Field( default=None, alias="reported", title="Reported rather than primary record", description=( "Indicates if this record was captured as a secondary 'reported' record" " rather than as an original primary source-of-truth record. It may " "also indicate the source of the report." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reported__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reported", title="Extension field for ``reported``." ) requester: fhirtypes.ReferenceType | None = Field( default=None, alias="requester", title="Who/What requested the Request", description=( "The individual, organization, or device that initiated the request and" " has responsibility for its activation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Patient", "RelatedPerson", "Device", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "active | on-hold | ended | stopped | completed | cancelled | entered-" "in-error | draft | unknown" ), description=( "A code specifying the current state of the order. Generally, this " "will be active or completed state." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "active", "on-hold", "ended", "stopped", "completed", "cancelled", "entered-in-error", "draft", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusChanged: fhirtypes.DateTimeType | None = Field( default=None, alias="statusChanged", title="When the status was changed", description="The date (and perhaps time) when the status was changed.", json_schema_extra={ "element_property": True, }, ) statusChanged__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_statusChanged", title="Extension field for ``statusChanged``.", ) statusReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="statusReason", title="Reason for current status", description="Captures the reason for the current state of the MedicationRequest.", json_schema_extra={ "element_property": True, }, ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Individual or group for whom the medication has been requested", description="The individual or group for whom the medication has been requested.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) substitution: fhirtypes.MedicationRequestSubstitutionType | None = Field( default=None, alias="substitution", title="Any restrictions on medication substitution", description=( "Indicates whether or not substitution can or should be part of the " "dispense. In some cases, substitution must happen, in other cases " "substitution must not happen. This block explains the prescriber's " "intent. If nothing is specified substitution may be done." ), json_schema_extra={ "element_property": True, }, ) supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInformation", title="Information to support fulfilling of the medication", description=( "Information to support fulfilling (i.e. dispensing or administering) " "of the medication, for example, patient height and weight, a " "MedicationStatement for the patient)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "priorPrescription", "groupIdentifier", "status", "statusReason", "statusChanged", "intent", "category", "priority", "doNotPerform", "medication", "subject", "informationSource", "encounter", "supportingInformation", "authoredOn", "requester", "reported", "performerType", "performer", "device", "recorder", "reason", "courseOfTherapyType", "insurance", "note", "renderedDosageInstruction", "effectiveDosePeriod", "dosageInstruction", "dispenseRequest", "substitution", "eventHistory", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "basedOn", "groupIdentifier", "status", "intent", "priority", "doNotPerform", "medication", "subject", "authoredOn", "requester", "reported", "performerType", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("intent", "intent__ext"), ("status", "status__ext")] return required_fields class MedicationRequestDispenseRequest(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Medication supply authorization. Indicates the specific details for the dispense or medication supply part of a medication request (also known as a Medication Prescription or Medication Order). Note that this information is not always sent with the order. There may be in some settings (e.g. hospitals) institutional or system support for completing the dispense details in the pharmacy department. """ __resource_type__ = "MedicationRequestDispenseRequest" dispenseInterval: fhirtypes.DurationType | None = Field( default=None, alias="dispenseInterval", title="Minimum period of time between dispenses", description=( "The minimum period of time that must occur between dispenses of the " "medication." ), json_schema_extra={ "element_property": True, }, ) dispenser: fhirtypes.ReferenceType | None = Field( default=None, alias="dispenser", title="Intended performer of dispense", description=( "Indicates the intended performing Organization that will dispense the " "medication as specified by the prescriber." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) dispenserInstruction: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="dispenserInstruction", title="Additional information for the dispenser", description=( "Provides additional information to the dispenser, for example, " "counselling to be provided to the patient." ), json_schema_extra={ "element_property": True, }, ) doseAdministrationAid: fhirtypes.CodeableConceptType | None = Field( default=None, alias="doseAdministrationAid", title="Type of adherence packaging to use for the dispense", description=( "Provides information about the type of adherence packaging to be " "supplied for the medication dispense." ), json_schema_extra={ "element_property": True, }, ) expectedSupplyDuration: fhirtypes.DurationType | None = Field( default=None, alias="expectedSupplyDuration", title="Number of days supply per dispense", description=( "Identifies the period time over which the supplied product is expected" " to be used, or the length of time the dispense is expected to last." ), json_schema_extra={ "element_property": True, }, ) initialFill: fhirtypes.MedicationRequestDispenseRequestInitialFillType | None = ( Field( default=None, alias="initialFill", title="First fill details", description=( "Indicates the quantity or duration for the first dispense of the " "medication." ), json_schema_extra={ "element_property": True, }, ) ) numberOfRepeatsAllowed: fhirtypes.UnsignedIntType | None = Field( default=None, alias="numberOfRepeatsAllowed", title="Number of refills authorized", description=( "An integer indicating the number of times, in addition to the original" " dispense, (aka refills or repeats) that the patient can receive the " "prescribed medication. Usage Notes: This integer does not include the " "original order dispense. This means that if an order indicates " 'dispense 30 tablets plus "3 repeats", then the order can be dispensed ' "a total of 4 times and the patient can receive a total of 120 tablets." " A prescriber may explicitly say that zero refills are permitted " "after the initial dispense." ), json_schema_extra={ "element_property": True, }, ) numberOfRepeatsAllowed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_numberOfRepeatsAllowed", title="Extension field for ``numberOfRepeatsAllowed``.", ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Amount of medication to supply per dispense", description="The amount that is to be dispensed for one fill.", json_schema_extra={ "element_property": True, }, ) validityPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="validityPeriod", title="Time period supply is authorized for", description=( "This indicates the validity period of a prescription (stale dating the" " Prescription)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationRequestDispenseRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "initialFill", "dispenseInterval", "validityPeriod", "numberOfRepeatsAllowed", "quantity", "expectedSupplyDuration", "dispenser", "dispenserInstruction", "doseAdministrationAid", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationRequestDispenseRequest`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationRequestDispenseRequestInitialFill(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. First fill details. Indicates the quantity or duration for the first dispense of the medication. """ __resource_type__ = "MedicationRequestDispenseRequestInitialFill" duration: fhirtypes.DurationType | None = Field( default=None, alias="duration", title="First fill duration", description="The length of time that the first dispense is expected to last.", json_schema_extra={ "element_property": True, }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="First fill quantity", description="The amount or quantity to provide as part of the first dispense.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationRequestDispenseRequestInitialFill`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "quantity", "duration"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationRequestDispenseRequestInitialFill`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class MedicationRequestSubstitution(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Any restrictions on medication substitution. Indicates whether or not substitution can or should be part of the dispense. In some cases, substitution must happen, in other cases substitution must not happen. This block explains the prescriber's intent. If nothing is specified substitution may be done. """ __resource_type__ = "MedicationRequestSubstitution" allowedBoolean: bool | None = Field( default=None, alias="allowedBoolean", title="Whether substitution is allowed or not", description=( "True if the prescriber allows a different drug to be dispensed from " "what was prescribed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e allowed[x] "one_of_many": "allowed", "one_of_many_required": True, }, ) allowedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_allowedBoolean", title="Extension field for ``allowedBoolean``.", ) allowedCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="allowedCodeableConcept", title="Whether substitution is allowed or not", description=( "True if the prescriber allows a different drug to be dispensed from " "what was prescribed." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e allowed[x] "one_of_many": "allowed", "one_of_many_required": True, }, ) reason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reason", title="Why should (not) substitution be made", description=( "Indicates the reason for the substitution, or why substitution must or" " must not be performed." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationRequestSubstitution`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "allowedBoolean", "allowedCodeableConcept", "reason", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationRequestSubstitution`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"allowed": ["allowedBoolean", "allowedCodeableConcept"]} return one_of_many_fields ================================================ FILE: fhir/resources/medicationstatement.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MedicationStatement Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MedicationStatement(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Record of medication being taken by a patient. A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from sources such as the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains. The primary difference between a medicationstatement and a medicationadministration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medicationstatement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the Medication Statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information. The MedicationStatement resource was previously called MedicationStatement. """ __resource_type__ = "MedicationStatement" adherence: fhirtypes.MedicationStatementAdherenceType | None = Field( default=None, alias="adherence", title=( "Indicates whether the medication is or is not being consumed or " "administered" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Type of medication statement", description=( "Type of medication statement (for example, drug classification like " "ATC, where meds would be administered, legal category of the " "medication.)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dateAsserted: fhirtypes.DateTimeType | None = Field( default=None, alias="dateAsserted", title="When the usage was asserted?", description=( "The date when the Medication Statement was asserted by the information" " source." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dateAsserted__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dateAsserted", title="Extension field for ``dateAsserted``.", ) derivedFrom: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="derivedFrom", title="Link to information used to derive the MedicationStatement", description=( "Allows linking the MedicationStatement to the underlying " "MedicationRequest, or to other information that supports or is used to" " derive the MedicationStatement." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) dosage: typing.List[fhirtypes.DosageType] | None = Field( default=None, alias="dosage", title="Details of how medication is/was taken or should be taken", description="Indicates how the medication is/was or should be taken by the patient.", json_schema_extra={ "element_property": True, }, ) effectiveDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="effectiveDateTime", title="The date/time or interval when the medication is/was/will be taken", description=( "The interval of time during which it is being asserted that the " "patient is/was/will be taking the medication (or was not taking, when " "the MedicationStatement.adherence element is Not Taking)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_effectiveDateTime", title="Extension field for ``effectiveDateTime``.", ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="The date/time or interval when the medication is/was/will be taken", description=( "The interval of time during which it is being asserted that the " "patient is/was/will be taking the medication (or was not taking, when " "the MedicationStatement.adherence element is Not Taking)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) effectiveTiming: fhirtypes.TimingType | None = Field( default=None, alias="effectiveTiming", title="The date/time or interval when the medication is/was/will be taken", description=( "The interval of time during which it is being asserted that the " "patient is/was/will be taking the medication (or was not taking, when " "the MedicationStatement.adherence element is Not Taking)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter associated with MedicationStatement", description=( "The encounter that establishes the context for this " "MedicationStatement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External identifier", description=( "Identifiers associated with this Medication Statement that are defined" " by business processes and/or used to refer to it when a direct URL " "reference to the resource itself is not appropriate. They are business" " identifiers assigned to this resource by the performer or other " "systems and remain constant as the resource is updated and propagates " "from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) informationSource: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="informationSource", title=( "Person or organization that provided the information about the taking " "of this medication" ), description=( "The person or organization that provided the information about the " "taking of this medication. Note: Use derivedFrom when a " "MedicationStatement is derived from other resources, e.g. Claim or " "MedicationRequest." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Organization", ], }, ) medication: fhirtypes.CodeableReferenceType = Field( default=..., alias="medication", title="What medication was taken", description=( "Identifies the medication being administered. This is either a link to" " a resource representing the details of the medication or a simple " "attribute carrying a code that identifies the medication from a known " "list of medications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Medication"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Further information about the usage", description=( "Provides extra information about the Medication Statement that is not " "conveyed by the other attributes." ), json_schema_extra={ "element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced event", description=( "A larger event of which this particular MedicationStatement is a " "component or step." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Procedure", "MedicationStatement"], }, ) reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="reason", title="Reason for why the medication is being/was taken", description=( "A concept, Condition or observation that supports why the medication " "is being/was taken." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition", "Observation", "DiagnosticReport"], }, ) relatedClinicalInformation: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="relatedClinicalInformation", title="Link to information relevant to the usage of a medication", description=( "Link to information that is relevant to a medication statement, for " "example, illicit drug use, gestational age, etc." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Observation", "Condition"], }, ) renderedDosageInstruction: fhirtypes.MarkdownType | None = Field( default=None, alias="renderedDosageInstruction", title="Full representation of the dosage instructions", description=( "The full representation of the dose of the medication included in all " "dosage instructions. To be used when multiple dosage instructions are" " included to represent complex dosing such as increasing or tapering " "doses." ), json_schema_extra={ "element_property": True, }, ) renderedDosageInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_renderedDosageInstruction", title="Extension field for ``renderedDosageInstruction``.", ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="recorded | entered-in-error | draft", description="A code representing the status of recording the medication statement.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["recorded", "entered-in-error", "draft"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who is/was taking the medication", description="The person, animal or group who is/was taking the medication.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationStatement`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "partOf", "status", "category", "medication", "subject", "encounter", "effectiveDateTime", "effectivePeriod", "effectiveTiming", "dateAsserted", "informationSource", "derivedFrom", "reason", "note", "relatedClinicalInformation", "renderedDosageInstruction", "dosage", "adherence", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationStatement`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "category", "medication", "subject", "encounter", "effectiveDateTime", "effectivePeriod", "effectiveTiming", "dateAsserted", "adherence", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "effective": ["effectiveDateTime", "effectivePeriod", "effectiveTiming"] } return one_of_many_fields class MedicationStatementAdherence(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Indicates whether the medication is or is not being consumed or administered. """ __resource_type__ = "MedicationStatementAdherence" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Type of adherence", description="Type of the adherence for the medication.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reason", title="Details of the reason for the current use of the medication", description="Captures the reason for the current use or adherence of a medication.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicationStatementAdherence`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "reason"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicationStatementAdherence`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code"] ================================================ FILE: fhir/resources/medicinalproductdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MedicinalProductDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MedicinalProductDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Detailed definition of a medicinal product. A medicinal product, being a substance or combination of substances that is intended to treat, prevent or diagnose a disease, or to restore, correct or modify physiological functions by exerting a pharmacological, immunological or metabolic action. This resource is intended to define and detail such products and their properties, for uses other than direct patient care (e.g. regulatory use, or drug catalogs). """ __resource_type__ = "MedicinalProductDefinition" additionalMonitoringIndicator: fhirtypes.CodeableConceptType | None = Field( default=None, alias="additionalMonitoringIndicator", title=( "Whether the Medicinal Product is subject to additional monitoring for " "regulatory reasons" ), description=( "Whether the Medicinal Product is subject to additional monitoring for " "regulatory reasons, such as heightened reporting requirements." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) attachedDocument: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="attachedDocument", title="Additional documentation about the medicinal product", description=( "Additional information or supporting documentation about the medicinal" " product." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) characteristic: typing.List[ fhirtypes.MedicinalProductDefinitionCharacteristicType ] | None = Field( default=None, alias="characteristic", title='Key product features such as "sugar free", "modified release"', description=( 'Allows the key product features to be recorded, such as "sugar free", ' '"modified release", "parallel import".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) classification: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="classification", title="Allows the product to be classified by various systems", description=( "Allows the product to be classified by various systems, commonly WHO " "ATC." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) clinicalTrial: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="clinicalTrial", title="Clinical trials or studies that this product is involved in", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ResearchStudy"], }, ) code: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="code", title="A code that this product is known by, within some formal terminology", description=( "A code that this product is known by, usually within some formal " "terminology, perhaps assigned by a third party (i.e. not the " "manufacturer or regulator). Products (types of medications) tend to be" " known by identifiers during development and within regulatory " "process. However when they are prescribed they tend to be identified " "by codes. The same product may be have multiple codes, applied to it " "by multiple organizations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) combinedPharmaceuticalDoseForm: fhirtypes.CodeableConceptType | None = Field( default=None, alias="combinedPharmaceuticalDoseForm", title=( "The dose form for a single part product, or combined form of a " "multiple part product" ), description=( "The dose form for a single part product, or combined form of a " "multiple part product. This is one concept that describes all the " "components. It does not represent the form with components physically " "mixed, if that might be necessary, for which see " "(AdministrableProductDefinition.administrableDoseForm)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comprisedOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="comprisedOf", title=( "Types of medicinal manufactured items and/or devices that this product" " consists of, such as tablets, capsule, or syringes" ), description=( "Types of medicinal manufactured items and/or devices that this product" " consists of, such as tablets, capsule, or syringes. Used as a direct " "link when the item's packaging is not being recorded (see also " "PackagedProductDefinition.package.containedItem.item)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ManufacturedItemDefinition", "DeviceDefinition"], }, ) contact: typing.List[ fhirtypes.MedicinalProductDefinitionContactType ] | None = Field( default=None, alias="contact", title="A product specific contact, person (in a role), or an organization", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) crossReference: typing.List[ fhirtypes.MedicinalProductDefinitionCrossReferenceType ] | None = Field( default=None, alias="crossReference", title=( "Reference to another product, e.g. for linking authorised to " "investigational product" ), description=( "Reference to another product, e.g. for linking authorised to " "investigational product, or a virtual product." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="General description of this product", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) domain: fhirtypes.CodeableConceptType | None = Field( default=None, alias="domain", title="If this medicine applies to human or veterinary uses", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier for this product. Could be an MPID", description=( "Business identifier for this product. Could be an MPID. When in " "development or being regulated, products are typically referenced by " "official identifiers, assigned by a manufacturer or regulator, and " "unique to a product (which, when compared to a product instance being " "prescribed, is actually a product type). See also " "MedicinalProductDefinition.code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) impurity: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="impurity", title=( "Any component of the drug product which is not the chemical entity " "defined as the drug substance, or an excipient in the drug product" ), description=( "Any component of the drug product which is not the chemical entity " "defined as the drug substance, or an excipient in the drug product. " "This includes process-related impurities and contaminants, product-" "related impurities including degradation products." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SubstanceDefinition"], }, ) indication: fhirtypes.MarkdownType | None = Field( default=None, alias="indication", title=( "Description of indication(s) for this product, used when structured " "indications are not required" ), description=( "Description of indication(s) for this product, used when structured " "indications are not required. In cases where structured indications " "are required, they are captured using the ClinicalUseDefinition " "resource. An indication is a medical situation for which using the " "product is appropriate." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) indication__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_indication", title="Extension field for ``indication``." ) ingredient: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="ingredient", title=( "The ingredients of this medicinal product - when not detailed in other" " resources" ), description=( "The ingredients of this medicinal product - when not detailed in other" " resources. This is only needed if the ingredients are not specified " "by incoming references from the Ingredient resource, or indirectly via" " incoming AdministrableProductDefinition, PackagedProductDefinition or" " ManufacturedItemDefinition references. In cases where those levels of" " detail are not used, the ingredients may be specified directly here " "as codes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) legalStatusOfSupply: fhirtypes.CodeableConceptType | None = Field( default=None, alias="legalStatusOfSupply", title=( "The legal status of supply of the medicinal product as classified by " "the regulator" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) marketingStatus: typing.List[fhirtypes.MarketingStatusType] | None = Field( default=None, alias="marketingStatus", title=( "Marketing status of the medicinal product, in contrast to marketing " "authorization" ), description=( "Marketing status of the medicinal product, in contrast to marketing " "authorization. This refers to the product being actually 'on the " "market' as opposed to being allowed to be on the market (which is an " "authorization)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) masterFile: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="masterFile", title=( "A master file for the medicinal product (e.g. Pharmacovigilance System" " Master File)" ), description=( "A master file for the medicinal product (e.g. Pharmacovigilance System" " Master File). Drug master files (DMFs) are documents submitted to " "regulatory agencies to provide confidential detailed information about" " facilities, processes or articles used in the manufacturing, " "processing, packaging and storing of drug products." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) name: typing.List[fhirtypes.MedicinalProductDefinitionNameType] = Field( default=..., alias="name", title="The product's name, including full name and possibly coded parts", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) operation: typing.List[ fhirtypes.MedicinalProductDefinitionOperationType ] | None = Field( default=None, alias="operation", title="A manufacturing or administrative process for the medicinal product", description=( "A manufacturing or administrative process or step associated with (or " "performed on) the medicinal product." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) packagedMedicinalProduct: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="packagedMedicinalProduct", title="Package type for the product", description=( "Package type for the product. See also the PackagedProductDefinition " "resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) pediatricUseIndicator: fhirtypes.CodeableConceptType | None = Field( default=None, alias="pediatricUseIndicator", title="If authorised for use in children", description="If authorised for use in children, or infants, neonates etc.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) route: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="route", title=( "The path by which the product is taken into or makes contact with the " "body" ), description=( "The path by which the product is taken into or makes contact with the " "body. In some regions this is referred to as the licenced or approved " "route. See also AdministrableProductDefinition resource. " "MedicinalProductDefinition.route is the same concept as " "AdministrableProductDefinition.routeOfAdministration.code, and they " "cannot be used together." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) specialMeasures: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialMeasures", title=( "Whether the Medicinal Product is subject to special measures for " "regulatory reasons" ), description=( "Whether the Medicinal Product is subject to special measures for " "regulatory reasons, such as a requirement to conduct post-" "authorization studies." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeableConceptType | None = Field( default=None, alias="status", title="The status within the lifecycle of this product record", description=( "The status within the lifecycle of this product record. A high-level " "status, this is not intended to duplicate details carried elsewhere " "such as legal status, or authorization status." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) statusDate: fhirtypes.DateTimeType | None = Field( default=None, alias="statusDate", title="The date at which the given status became applicable", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_statusDate", title="Extension field for ``statusDate``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Regulatory type, e.g. Investigational or Authorized", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="A business identifier relating to a specific version of the product", description=( "A business identifier relating to a specific version of the product, " "this is commonly used to support revisions to an existing product." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicinalProductDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "type", "domain", "version", "status", "statusDate", "description", "combinedPharmaceuticalDoseForm", "route", "indication", "legalStatusOfSupply", "additionalMonitoringIndicator", "specialMeasures", "pediatricUseIndicator", "classification", "marketingStatus", "packagedMedicinalProduct", "comprisedOf", "ingredient", "impurity", "attachedDocument", "masterFile", "contact", "clinicalTrial", "code", "name", "crossReference", "operation", "characteristic", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "type", "domain", "version", "status", "statusDate", "description", "combinedPharmaceuticalDoseForm", "route", "indication", "legalStatusOfSupply", "additionalMonitoringIndicator", "specialMeasures", "pediatricUseIndicator", "classification", "marketingStatus", "packagedMedicinalProduct", "comprisedOf", "ingredient", "impurity", "attachedDocument", "masterFile", "contact", "clinicalTrial", "code", "name", "crossReference", "operation", "characteristic", ] class MedicinalProductDefinitionCharacteristic(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Key product features such as "sugar free", "modified release". Allows the key product features to be recorded, such as "sugar free", "modified release", "parallel import". """ __resource_type__ = "MedicinalProductDefinitionCharacteristic" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="A code expressing the type of characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="A value for the characteristic", description="A value for the characteristic.text.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="A value for the characteristic", description="A value for the characteristic.text.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="A value for the characteristic", description="A value for the characteristic.text.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="A value for the characteristic", description="A value for the characteristic.text.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="A value for the characteristic", description="A value for the characteristic.text.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="valueMarkdown", title="A value for the characteristic", description="A value for the characteristic.text.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueMarkdown", title="Extension field for ``valueMarkdown``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="A value for the characteristic", description="A value for the characteristic.text.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicinalProductDefinitionCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueCodeableConcept", "valueMarkdown", "valueQuantity", "valueInteger", "valueDate", "valueBoolean", "valueAttachment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "valueCodeableConcept", "valueMarkdown", "valueQuantity", "valueInteger", "valueDate", "valueBoolean", "valueAttachment", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueBoolean", "valueCodeableConcept", "valueDate", "valueInteger", "valueMarkdown", "valueQuantity", ] } return one_of_many_fields class MedicinalProductDefinitionContact(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A product specific contact, person (in a role), or an organization. """ __resource_type__ = "MedicinalProductDefinitionContact" contact: fhirtypes.ReferenceType = Field( default=..., alias="contact", title="A product specific contact, person (in a role), or an organization", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization", "PractitionerRole"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title=( "Allows the contact to be classified, for example QPPV, " "Pharmacovigilance Enquiry Information" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicinalProductDefinitionContact`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "contact"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionContact`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "contact"] class MedicinalProductDefinitionCrossReference(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Reference to another product, e.g. for linking authorised to investigational product. Reference to another product, e.g. for linking authorised to investigational product, or a virtual product. """ __resource_type__ = "MedicinalProductDefinitionCrossReference" product: fhirtypes.CodeableReferenceType = Field( default=..., alias="product", title=( "Reference to another product, e.g. for linking authorised to " "investigational product" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicinalProductDefinition"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title=( "The type of relationship, for instance branded to generic or virtual " "to actual product" ), description=( "The type of relationship, for instance branded to generic, virtual to " "actual product, product to development product (investigational), " "parallel import version." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicinalProductDefinitionCrossReference`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "product", "type"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionCrossReference`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "product", "type"] class MedicinalProductDefinitionName(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The product's name, including full name and possibly coded parts. """ __resource_type__ = "MedicinalProductDefinitionName" part: typing.List[fhirtypes.MedicinalProductDefinitionNamePartType] | None = Field( default=None, alias="part", title="Coding words or phrases of the name", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) productName: fhirtypes.StringType | None = Field( default=None, alias="productName", title="The full product name", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) productName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_productName", title="Extension field for ``productName``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Type of product name, such as rINN, BAN, Proprietary, Non-Proprietary", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) usage: typing.List[ fhirtypes.MedicinalProductDefinitionNameUsageType ] | None = Field( default=None, alias="usage", title="Country and jurisdiction where the name applies", description=( "Country and jurisdiction where the name applies, and associated " "language." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicinalProductDefinitionName`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "productName", "type", "part", "usage", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionName`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "productName", "type", "part", "usage"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("productName", "productName__ext")] return required_fields class MedicinalProductDefinitionNamePart(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Coding words or phrases of the name. """ __resource_type__ = "MedicinalProductDefinitionNamePart" part: fhirtypes.StringType | None = Field( default=None, alias="part", title="A fragment of a product name", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) part__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_part", title="Extension field for ``part``." ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Identifying type for this part of the name (e.g. strength part)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicinalProductDefinitionNamePart`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "part", "type"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionNamePart`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "part", "type"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("part", "part__ext")] return required_fields class MedicinalProductDefinitionNameUsage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Country and jurisdiction where the name applies. Country and jurisdiction where the name applies, and associated language. """ __resource_type__ = "MedicinalProductDefinitionNameUsage" country: fhirtypes.CodeableConceptType = Field( default=..., alias="country", title="Country code for where this name applies", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: fhirtypes.CodeableConceptType | None = Field( default=None, alias="jurisdiction", title="Jurisdiction code for where this name applies", description=( "Jurisdiction code for where this name applies. A jurisdiction may be a" " sub- or supra-national entity (e.g. a state or a geographic region)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) language: fhirtypes.CodeableConceptType = Field( default=..., alias="language", title="Language code for this name", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicinalProductDefinitionNameUsage`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "country", "jurisdiction", "language", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionNameUsage`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "country", "jurisdiction", "language"] class MedicinalProductDefinitionOperation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A manufacturing or administrative process for the medicinal product. A manufacturing or administrative process or step associated with (or performed on) the medicinal product. """ __resource_type__ = "MedicinalProductDefinitionOperation" confidentialityIndicator: fhirtypes.CodeableConceptType | None = Field( default=None, alias="confidentialityIndicator", title=( "Specifies whether this process is considered proprietary or " "confidential" ), description=( "Specifies whether this particular business or manufacturing process is" " considered proprietary or confidential." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) effectiveDate: fhirtypes.PeriodType | None = Field( default=None, alias="effectiveDate", title="Date range of applicability", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) organization: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="organization", title=( "The organization responsible for the particular process, e.g. the " "manufacturer or importer" ), description=( "The organization or establishment responsible for (or associated with)" " the particular process or step, examples include the manufacturer, " "importer, agent." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) type: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="type", title=( "The type of manufacturing operation e.g. manufacturing itself, re-" "packaging" ), description=( "The type of manufacturing operation e.g. manufacturing itself, re-" "packaging. For the authorization of this, a RegulatedAuthorization " "would point to the same plan or activity referenced here." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ActivityDefinition", "PlanDefinition"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MedicinalProductDefinitionOperation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "effectiveDate", "organization", "confidentialityIndicator", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionOperation`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "effectiveDate", "organization", "confidentialityIndicator", ] ================================================ FILE: fhir/resources/messagedefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MessageDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MessageDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A resource that defines a type of message that can be exchanged between systems. Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted. """ __resource_type__ = "MessageDefinition" allowedResponse: typing.List[ fhirtypes.MessageDefinitionAllowedResponseType ] | None = Field( default=None, alias="allowedResponse", title="Responses to this message", description=( "Indicates what types of messages may be sent as an application-level " "response to this message." ), json_schema_extra={ "element_property": True, }, ) base: fhirtypes.CanonicalType | None = Field( default=None, alias="base", title="Definition this one is based on", description=( "The MessageDefinition that is the basis for the contents of this " "resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MessageDefinition"], }, ) base__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_base", title="Extension field for ``base``." ) category: fhirtypes.CodeType | None = Field( default=None, alias="category", title="consequence | currency | notification", description="The impact of the content of the message.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["consequence", "currency", "notification"], }, ) category__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_category", title="Extension field for ``category``." ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the message definition and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the message definition." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the message definition was last " "significantly changed. The date must change when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the message definition " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the message definition", description=( "A free text natural language description of the message definition " "from a consumer's perspective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) eventCoding: fhirtypes.CodingType | None = Field( default=None, alias="eventCoding", title="Event code or link to the EventDefinition", description="Event code or link to the EventDefinition.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e event[x] "one_of_many": "event", "one_of_many_required": True, }, ) eventUri: fhirtypes.UriType | None = Field( default=None, alias="eventUri", title="Event code or link to the EventDefinition", description="Event code or link to the EventDefinition.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e event[x] "one_of_many": "event", "one_of_many_required": True, }, ) eventUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_eventUri", title="Extension field for ``eventUri``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this message definition is authored " "for testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) focus: typing.List[fhirtypes.MessageDefinitionFocusType] | None = Field( default=None, alias="focus", title="Resource(s) that are the subject of the event", description=( "Identifies the resource (or resources) that are being addressed by the" " event. For example, the Encounter for an admit message or two " "Account records for a merge." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) graph: fhirtypes.CanonicalType | None = Field( default=None, alias="graph", title="Canonical reference to a GraphDefinition", description=( "Graph is Canonical reference to a GraphDefinition. If a URL is " "provided, it is the canonical reference to a GraphDefinition that it " "controls what additional resources are to be added to the Bundle when " "building the message. The GraphDefinition can also specify profiles " "that apply to the various resources." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["GraphDefinition"], }, ) graph__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_graph", title="Extension field for ``graph``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for a given MessageDefinition", description=( "A formal identifier that is used to identify this message definition " "when it is represented in other formats, or referenced in a " "specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for message definition (if applicable)", description=( "A legal or geographic region in which the message definition is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this message definition (computer friendly)", description=( "A natural language name identifying the message definition. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) parent: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="parent", title="Protocol/workflow this is part of", description=( "Identifies a protocol or workflow that this MessageDefinition " "represents a step in." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ActivityDefinition", "PlanDefinition"], }, ) parent__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_parent", title="Extension field for ``parent``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the message definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this message definition is defined", description=( "Explanation of why this message definition is needed and why it has " "been designed as it has." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) replaces: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="replaces", title="Takes the place of", description="A MessageDefinition that is superseded by this definition.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MessageDefinition"], }, ) replaces__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_replaces", title="Extension field for ``replaces``." ) responseRequired: fhirtypes.CodeType | None = Field( default=None, alias="responseRequired", title="always | on-error | never | on-success", description=( "Declare at a message definition level whether a response is required " "or only upon error or success, or never." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["always", "on-error", "never", "on-success"], }, ) responseRequired__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_responseRequired", title="Extension field for ``responseRequired``.", ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this message definition. Enables tracking the life-cycle" " of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this message definition (human friendly)", description="A short, descriptive, user-friendly title for the message definition.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="The cannonical URL for a given MessageDefinition", description=( "The business identifier that is used to reference the " "MessageDefinition and *is* expected to be consistent from server to " "server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate message definition instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the message definition", description=( "The identifier that is used to identify this version of the message " "definition when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the message definition" " author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MessageDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "replaces", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "copyrightLabel", "base", "parent", "eventCoding", "eventUri", "category", "focus", "responseRequired", "allowedResponse", "graph", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MessageDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "replaces", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "base", "parent", "eventCoding", "eventUri", "category", "focus", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("date", "date__ext"), ("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "event": ["eventCoding", "eventUri"], "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"], } return one_of_many_fields class MessageDefinitionAllowedResponse(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Responses to this message. Indicates what types of messages may be sent as an application-level response to this message. """ __resource_type__ = "MessageDefinitionAllowedResponse" message: fhirtypes.CanonicalType | None = Field( default=None, alias="message", title="Reference to allowed message definition response", description=( "A reference to the message definition that must be adhered to by this " "supported response." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MessageDefinition"], }, ) message__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_message", title="Extension field for ``message``." ) situation: fhirtypes.MarkdownType | None = Field( default=None, alias="situation", title="When should this response be used", description=( "Provides a description of the circumstances in which this response " "should be used (as opposed to one of the alternative responses)." ), json_schema_extra={ "element_property": True, }, ) situation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_situation", title="Extension field for ``situation``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MessageDefinitionAllowedResponse`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "message", "situation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MessageDefinitionAllowedResponse`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("message", "message__ext")] return required_fields class MessageDefinitionFocus(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Resource(s) that are the subject of the event. Identifies the resource (or resources) that are being addressed by the event. For example, the Encounter for an admit message or two Account records for a merge. """ __resource_type__ = "MessageDefinitionFocus" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Type of resource", description="The kind of resource that must be the focus for this message.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) max: fhirtypes.StringType | None = Field( default=None, alias="max", title="Maximum number of focuses of this type", description=( "Identifies the maximum number of resources of this type that must be " "pointed to by a message in order for it to be valid against this " "MessageDefinition." ), json_schema_extra={ "element_property": True, }, ) max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_max", title="Extension field for ``max``." ) min: fhirtypes.UnsignedIntType | None = Field( default=None, alias="min", title="Minimum number of focuses of this type", description=( "Identifies the minimum number of resources of this type that must be " "pointed to by a message in order for it to be valid against this " "MessageDefinition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_min", title="Extension field for ``min``." ) profile: fhirtypes.CanonicalType | None = Field( default=None, alias="profile", title="Profile that must be adhered to by focus", description=( "A profile that reflects constraints for the focal resource (and " "potentially for related resources)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MessageDefinitionFocus`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "profile", "min", "max"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MessageDefinitionFocus`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "min"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext"), ("min", "min__ext")] return required_fields ================================================ FILE: fhir/resources/messageheader.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MessageHeader Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MessageHeader(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A resource that describes a message that is exchanged between systems. The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. """ __resource_type__ = "MessageHeader" author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="The source of the decision", description=( "The logical author of the message - the personor device that decided " "the described event should happen. When there is more than one " "candidate, pick the most proximal to the MessageHeader. Can provide " "other authors in extensions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Device", "Organization", ], }, ) definition: fhirtypes.CanonicalType | None = Field( default=None, alias="definition", title="Link to the definition for this message", description="Permanent link to the MessageDefinition for this message.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MessageDefinition"], }, ) definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) destination: typing.List[fhirtypes.MessageHeaderDestinationType] | None = Field( default=None, alias="destination", title="Message destination application(s)", description="The destination application which the message is intended for.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) eventCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="eventCanonical", title="Event code or link to EventDefinition", description=( "Code that identifies the event this message represents and connects it" " with its definition. Events defined as part of the FHIR specification" " are defined by the implementation. Alternatively a canonical uri to " "the EventDefinition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e event[x] "one_of_many": "event", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["EventDefinition"], }, ) eventCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_eventCanonical", title="Extension field for ``eventCanonical``.", ) eventCoding: fhirtypes.CodingType | None = Field( default=None, alias="eventCoding", title="Event code or link to EventDefinition", description=( "Code that identifies the event this message represents and connects it" " with its definition. Events defined as part of the FHIR specification" " are defined by the implementation. Alternatively a canonical uri to " "the EventDefinition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e event[x] "one_of_many": "event", "one_of_many_required": True, }, ) focus: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="focus", title="The actual content of the message", description=( "The actual data of the message - a reference to the root/focus class " "of the event. This is allowed to be a Parameters resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) reason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reason", title="Cause of event", description=( "Coded indication of the cause for the event - indicates a reason for " "the occurrence of the event that is a focus of this message." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) response: fhirtypes.MessageHeaderResponseType | None = Field( default=None, alias="response", title="If this is a reply to prior message", description=( "Information about the message that this message is a response to. " "Only present if this message is a response." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) responsible: fhirtypes.ReferenceType | None = Field( default=None, alias="responsible", title="Final responsibility for event", description=( "The person or organization that accepts overall responsibility for the" " contents of the message. The implication is that the message event " "happened under the policies of the responsible party." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) sender: fhirtypes.ReferenceType | None = Field( default=None, alias="sender", title="Real world sender of the message", description=( "Identifies the sending system to allow the use of a trust " "relationship." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Device", "Organization", ], }, ) source: fhirtypes.MessageHeaderSourceType = Field( default=..., alias="source", title="Message source application", description="The source application from which this message originated.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MessageHeader`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "eventCoding", "eventCanonical", "destination", "sender", "author", "source", "responsible", "reason", "response", "focus", "definition", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MessageHeader`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "eventCoding", "eventCanonical", "destination", "sender", "author", "source", "responsible", "reason", "response", "focus", "definition", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"event": ["eventCanonical", "eventCoding"]} return one_of_many_fields class MessageHeaderDestination(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Message destination application(s). The destination application which the message is intended for. """ __resource_type__ = "MessageHeaderDestination" endpointReference: fhirtypes.ReferenceType | None = Field( default=None, alias="endpointReference", title="Actual destination address or Endpoint resource", description="Indicates where the message should be routed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e endpoint[x] "one_of_many": "endpoint", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) endpointUrl: fhirtypes.UrlType | None = Field( default=None, alias="endpointUrl", title="Actual destination address or Endpoint resource", description="Indicates where the message should be routed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e endpoint[x] "one_of_many": "endpoint", "one_of_many_required": False, }, ) endpointUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_endpointUrl", title="Extension field for ``endpointUrl``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name of system", description="Human-readable name for the target system.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) receiver: fhirtypes.ReferenceType | None = Field( default=None, alias="receiver", title='Intended "real-world" recipient for the data', description=( "Allows data conveyed by a message to be addressed to a particular " "person or department when routing to a specific application isn't " "sufficient." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) target: fhirtypes.ReferenceType | None = Field( default=None, alias="target", title="Particular delivery destination within the destination", description=( "Identifies the target end system in situations where the initial " "message transmission is to an intermediary system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MessageHeaderDestination`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "endpointUrl", "endpointReference", "name", "target", "receiver", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MessageHeaderDestination`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "endpointUrl", "endpointReference", "name", "target", "receiver", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"endpoint": ["endpointReference", "endpointUrl"]} return one_of_many_fields class MessageHeaderResponse(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. If this is a reply to prior message. Information about the message that this message is a response to. Only present if this message is a response. """ __resource_type__ = "MessageHeaderResponse" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="ok | transient-error | fatal-error", description=( "Code that identifies the type of response to the message - whether it " "was successful or not, and whether it should be resent or not." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["ok", "transient-error", "fatal-error"], }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) details: fhirtypes.ReferenceType | None = Field( default=None, alias="details", title="Specific list of hints/warnings/errors", description="Full details of any issues found in the message.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["OperationOutcome"], }, ) identifier: fhirtypes.IdentifierType = Field( default=..., alias="identifier", title="Bundle.identifier of original message", description=( "The Bundle.identifier of the message to which this message is a " "response." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MessageHeaderResponse`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "identifier", "code", "details"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MessageHeaderResponse`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "identifier", "code", "details"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields class MessageHeaderSource(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Message source application. The source application from which this message originated. """ __resource_type__ = "MessageHeaderSource" contact: fhirtypes.ContactPointType | None = Field( default=None, alias="contact", title="Human contact for problems", description=( "An e-mail, phone, website or other contact point to use to resolve " "issues with message communications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endpointReference: fhirtypes.ReferenceType | None = Field( default=None, alias="endpointReference", title="Actual source address or Endpoint resource", description="Identifies the routing target to send acknowledgements to.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e endpoint[x] "one_of_many": "endpoint", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) endpointUrl: fhirtypes.UrlType | None = Field( default=None, alias="endpointUrl", title="Actual source address or Endpoint resource", description="Identifies the routing target to send acknowledgements to.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e endpoint[x] "one_of_many": "endpoint", "one_of_many_required": False, }, ) endpointUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_endpointUrl", title="Extension field for ``endpointUrl``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name of system", description="Human-readable name for the source system.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) software: fhirtypes.StringType | None = Field( default=None, alias="software", title="Name of software running the system", description="May include configuration or other information useful in debugging.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) software__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_software", title="Extension field for ``software``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Version of software running", description=( "Can convey versions of multiple systems in situations where a message " "passes through multiple hands." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MessageHeaderSource`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "endpointUrl", "endpointReference", "name", "software", "version", "contact", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MessageHeaderSource`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "endpointUrl", "endpointReference", "name", "software", "version", "contact", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"endpoint": ["endpointReference", "endpointUrl"]} return one_of_many_fields ================================================ FILE: fhir/resources/meta.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Meta Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class Meta(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Metadata about a resource. The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource. """ __resource_type__ = "Meta" lastUpdated: fhirtypes.InstantType | None = Field( default=None, alias="lastUpdated", title="When the resource version last changed", description="When the resource last changed - e.g. when the version changed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastUpdated__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastUpdated", title="Extension field for ``lastUpdated``." ) profile: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="profile", title="Profiles this resource claims to conform to", description=( "A list of profiles (references to " "[StructureDefinition](structuredefinition.html#) resources) that this " "resource claims to conform to. The URL is a reference to " "[StructureDefinition.url](structuredefinition-" "definitions.html#StructureDefinition.url)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) profile__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) security: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="security", title="Security Labels applied to this resource", description=( "Security labels applied to this resource. These tags connect specific " "resources to the overall security policy and infrastructure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) source: fhirtypes.UriType | None = Field( default=None, alias="source", title="Identifies where the resource comes from", description=( "A uri that identifies the source system of the resource. This provides" " a minimal amount of [Provenance](provenance.html#) information that " "can be used to track or differentiate the source of information in the" " resource. The source may identify another FHIR server, document, " "message, database, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_source", title="Extension field for ``source``." ) tag: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="tag", title="Tags applied to this resource", description=( "Tags applied to this resource. Tags are intended to be used to " "identify and relate resources to process and workflow, and " "applications are not required to consider the tags when interpreting " "the meaning of a resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) versionId: fhirtypes.IdType | None = Field( default=None, alias="versionId", title="Version specific identifier", description=( "The version specific identifier, as it appears in the version portion " "of the URL. This value changes when the resource is created, updated, " "or deleted." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) versionId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionId", title="Extension field for ``versionId``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Meta`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "versionId", "lastUpdated", "source", "profile", "security", "tag", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Meta`` according to specification, with preserving the original sequence order. """ return ["versionId", "lastUpdated", "source", "profile", "security", "tag"] ================================================ FILE: fhir/resources/metadataresource.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MetadataResource Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class MetadataResource(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Common Interface declaration for definitional resources. Common Interface declaration for conformance and knowledge artifact resources. """ __resource_type__ = "MetadataResource" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the {{title}} was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the {{title}}", description=( "An individiual or organization primarily involved in the creation and " "maintenance of the {{title}}." ), json_schema_extra={ "element_property": True, }, ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the {{title}}", description=( "An individual or organization primarily responsible for internal " "coherence of the {{title}}." ), json_schema_extra={ "element_property": True, }, ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the {{title}} is expected to be used", description=( "The period during which the {{title}} content was or is planned to be " "in active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the {{title}}", description=( "An individual or organization asserted by the publisher to be " "responsible for officially endorsing the {{title}} for use in some " "setting." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the {{title}} was last reviewed by the publisher", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Additional documentation, citations, etc", description=( "Related artifacts such as additional documentation, justification, " "dependencies, bibliographic references, and predecessor and successor " "artifacts." ), json_schema_extra={ "element_property": True, }, ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the {{title}}", description=( "An individual or organization asserted by the publisher to be " "primarily responsible for review of some aspect of the {{title}}." ), json_schema_extra={ "element_property": True, }, ) topic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="topic", title="E.g. Education, Treatment, Assessment, etc", description=( "Descriptive topics related to the content of the {{title}}. Topics " "provide a high-level categorization as well as keywords for the " "{{title}} that can be useful for filtering and searching." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MetadataResource`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "approvalDate", "lastReviewDate", "effectivePeriod", "topic", "author", "editor", "reviewer", "endorser", "relatedArtifact", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MetadataResource`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "modifierExtension", "effectivePeriod"] ================================================ FILE: fhir/resources/molecularsequence.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MolecularSequence Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class MolecularSequence(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Representation of a molecular sequence. """ __resource_type__ = "MolecularSequence" device: fhirtypes.ReferenceType | None = Field( default=None, alias="device", title="The method for sequencing", description="The method for sequencing, for example, chip information.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) focus: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="focus", title=( "What the molecular sequence is about, when it is not about the subject" " of record" ), description=( "The actual focus of a molecular sequence when it is not the patient of" " record representing something or someone associated with the patient " "such as a spouse, parent, child, or sibling. For example, in trio " "testing, the subject would be the child (proband) and the focus would " "be the parent." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) formatted: typing.List[fhirtypes.AttachmentType] | None = Field( default=None, alias="formatted", title=( "Embedded file or a link (URL) which contains content to represent the " "sequence" ), description=( "Sequence that was observed as file content. Can be an actual file " "contents, or referenced by a URL to an external system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique ID for this particular sequence", description="A unique identifier for this particular sequence instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) literal: fhirtypes.StringType | None = Field( default=None, alias="literal", title="Sequence that was observed", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) literal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_literal", title="Extension field for ``literal``." ) performer: fhirtypes.ReferenceType | None = Field( default=None, alias="performer", title="Who should be responsible for test result", description="The organization or lab that should be responsible for this result.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) relative: typing.List[fhirtypes.MolecularSequenceRelativeType] | None = Field( default=None, alias="relative", title="A sequence defined relative to another sequence", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) specimen: fhirtypes.ReferenceType | None = Field( default=None, alias="specimen", title="Specimen used for sequencing", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Specimen"], }, ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Subject this sequence is associated too", description="Indicates the subject this sequence is associated too.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Group", "Substance", "BiologicallyDerivedProduct", "NutritionProduct", ], }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="aa | dna | rna", description="Amino Acid Sequence/ DNA Sequence / RNA Sequence.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["aa", "dna", "rna"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MolecularSequence`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "type", "subject", "focus", "specimen", "device", "performer", "literal", "formatted", "relative", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MolecularSequence`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "type", "subject", "focus", "specimen", "device", "performer", "literal", "formatted", "relative", ] class MolecularSequenceRelative(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A sequence defined relative to another sequence. """ __resource_type__ = "MolecularSequenceRelative" coordinateSystem: fhirtypes.CodeableConceptType = Field( default=..., alias="coordinateSystem", title="Ways of identifying nucleotides or amino acids within a sequence", description=( "These are different ways of identifying nucleotides or amino acids " "within a sequence. Different databases and file types may use " "different systems. For detail definitions, see " "https://loinc.org/92822-6/ for more detail." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) edit: typing.List[fhirtypes.MolecularSequenceRelativeEditType] | None = Field( default=None, alias="edit", title="Changes in sequence from the starting sequence", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ordinalPosition: fhirtypes.IntegerType | None = Field( default=None, alias="ordinalPosition", title=( "Indicates the order in which the sequence should be considered when " "putting multiple 'relative' elements together" ), description=None, json_schema_extra={ "element_property": True, }, ) ordinalPosition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_ordinalPosition", title="Extension field for ``ordinalPosition``.", ) sequenceRange: fhirtypes.RangeType | None = Field( default=None, alias="sequenceRange", title=( "Indicates the nucleotide range in the composed sequence when multiple " "'relative' elements are used together" ), description=None, json_schema_extra={ "element_property": True, }, ) startingSequence: fhirtypes.MolecularSequenceRelativeStartingSequenceType | None = ( Field( default=None, alias="startingSequence", title="A sequence used as starting sequence", description=( "A sequence that is used as a starting sequence to describe variants " "that are present in a sequence analyzed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MolecularSequenceRelative`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "coordinateSystem", "ordinalPosition", "sequenceRange", "startingSequence", "edit", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MolecularSequenceRelative`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "coordinateSystem", "startingSequence", "edit"] class MolecularSequenceRelativeEdit(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Changes in sequence from the starting sequence. """ __resource_type__ = "MolecularSequenceRelativeEdit" end: fhirtypes.IntegerType | None = Field( default=None, alias="end", title="End position of the edit on the starting sequence", description=( "End position of the edit on the starting sequence. If the coordinate " "system is 0-based then end is exclusive and does not include the last " "position. If the coordinate system is 1-base, then end is inclusive " "and includes the last position." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_end", title="Extension field for ``end``." ) replacedSequence: fhirtypes.StringType | None = Field( default=None, alias="replacedSequence", title="Allele in the starting sequence", description=( "Allele in the starting sequence. Nucleotide(s)/amino acids from start " "position of sequence to stop position of sequence on the positive (+) " "strand of the starting sequence. When the sequence type is DNA, it " "should be the sequence on the positive (+) strand. This will lay in " "the range between variant.start and variant.end." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) replacedSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_replacedSequence", title="Extension field for ``replacedSequence``.", ) replacementSequence: fhirtypes.StringType | None = Field( default=None, alias="replacementSequence", title="Allele that was observed", description=( "Allele that was observed. Nucleotide(s)/amino acids from start " "position of sequence to stop position of sequence on the positive (+) " "strand of the observed sequence. When the sequence type is DNA, it " "should be the sequence on the positive (+) strand. This will lay in " "the range between variant.start and variant.end." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) replacementSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_replacementSequence", title="Extension field for ``replacementSequence``.", ) start: fhirtypes.IntegerType | None = Field( default=None, alias="start", title="Start position of the edit on the starting sequence", description=( "Start position of the edit on the starting sequence. If the coordinate" " system is either 0-based or 1-based, then start position is " "inclusive." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_start", title="Extension field for ``start``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MolecularSequenceRelativeEdit`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "start", "end", "replacementSequence", "replacedSequence", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MolecularSequenceRelativeEdit`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "start", "end", "replacementSequence", "replacedSequence", ] class MolecularSequenceRelativeStartingSequence(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A sequence used as starting sequence. A sequence that is used as a starting sequence to describe variants that are present in a sequence analyzed. """ __resource_type__ = "MolecularSequenceRelativeStartingSequence" chromosome: fhirtypes.CodeableConceptType | None = Field( default=None, alias="chromosome", title="Chromosome Identifier", description=( "Structural unit composed of a nucleic acid molecule which controls its" " own replication through the interaction of specific proteins at one " "or more origins of replication ([SO:0000340](http://www.sequenceontolo" "gy.org/browser/current_svn/term/SO:0000340))." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) genomeAssembly: fhirtypes.CodeableConceptType | None = Field( default=None, alias="genomeAssembly", title="The genome assembly used for starting sequence, e.g. GRCh38", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) orientation: fhirtypes.CodeType | None = Field( default=None, alias="orientation", title="sense | antisense", description=( "A relative reference to a DNA strand based on gene orientation. The " 'strand that contains the open reading frame of the gene is the "sense"' ' strand, and the opposite complementary strand is the "antisense" ' "strand." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["sense", "antisense"], }, ) orientation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_orientation", title="Extension field for ``orientation``." ) sequenceCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="sequenceCodeableConcept", title="The reference sequence that represents the starting sequence", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e sequence[x] "one_of_many": "sequence", "one_of_many_required": False, }, ) sequenceReference: fhirtypes.ReferenceType | None = Field( default=None, alias="sequenceReference", title="The reference sequence that represents the starting sequence", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e sequence[x] "one_of_many": "sequence", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MolecularSequence"], }, ) sequenceString: fhirtypes.StringType | None = Field( default=None, alias="sequenceString", title="The reference sequence that represents the starting sequence", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e sequence[x] "one_of_many": "sequence", "one_of_many_required": False, }, ) sequenceString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequenceString", title="Extension field for ``sequenceString``.", ) strand: fhirtypes.CodeType | None = Field( default=None, alias="strand", title="watson | crick", description=( "An absolute reference to a strand. The Watson strand is the strand " "whose 5'-end is on the short arm of the chromosome, and the Crick " "strand as the one whose 5'-end is on the long arm." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["watson", "crick"], }, ) strand__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_strand", title="Extension field for ``strand``." ) windowEnd: fhirtypes.IntegerType | None = Field( default=None, alias="windowEnd", title="End position of the window on the starting sequence", description=( "End position of the window on the starting sequence. This value should" " honor the rules of the coordinateSystem." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) windowEnd__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_windowEnd", title="Extension field for ``windowEnd``." ) windowStart: fhirtypes.IntegerType | None = Field( default=None, alias="windowStart", title="Start position of the window on the starting sequence", description=( "Start position of the window on the starting sequence. This value " "should honor the rules of the coordinateSystem." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) windowStart__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_windowStart", title="Extension field for ``windowStart``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MolecularSequenceRelativeStartingSequence`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "genomeAssembly", "chromosome", "sequenceCodeableConcept", "sequenceString", "sequenceReference", "windowStart", "windowEnd", "orientation", "strand", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MolecularSequenceRelativeStartingSequence`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "genomeAssembly", "chromosome", "sequenceCodeableConcept", "sequenceString", "sequenceReference", "windowStart", "windowEnd", "orientation", "strand", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "sequence": [ "sequenceCodeableConcept", "sequenceReference", "sequenceString", ] } return one_of_many_fields ================================================ FILE: fhir/resources/monetarycomponent.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/MonetaryComponent Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class MonetaryComponent(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Availability data for an {item}. """ __resource_type__ = "MonetaryComponent" amount: fhirtypes.MoneyType | None = Field( default=None, alias="amount", title="Explicit value amount to be used", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title=( "Codes may be used to differentiate between kinds of taxes, surcharges," " discounts etc." ), description=( "Codes may be used to differentiate between kinds of taxes, surcharges," " discounts etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Factor used for calculating this component", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="base | surcharge | deduction | discount | tax | informational", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "base", "surcharge", "deduction", "discount", "tax", "informational", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``MonetaryComponent`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "type", "code", "factor", "amount"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``MonetaryComponent`` according to specification, with preserving the original sequence order. """ return ["type", "code", "factor", "amount"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields ================================================ FILE: fhir/resources/money.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Money Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class Money(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An amount of economic utility in some recognized currency. """ __resource_type__ = "Money" currency: fhirtypes.CodeType | None = Field( default=None, alias="currency", title="ISO 4217 Currency Code", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) currency__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_currency", title="Extension field for ``currency``." ) value: fhirtypes.DecimalType | None = Field( default=None, alias="value", title="Numerical value (with implicit precision)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Money`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "value", "currency"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Money`` according to specification, with preserving the original sequence order. """ return ["value", "currency"] ================================================ FILE: fhir/resources/namingsystem.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/NamingSystem Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class NamingSystem(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. System of unique identification. A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. """ __resource_type__ = "NamingSystem" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the NamingSystem was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the CodeSystem", description=( "An individiual or organization primarily involved in the creation and " "maintenance of the NamingSystem." ), json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the naming system and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the naming system." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the naming system was last " "significantly changed. The date must change when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the naming system " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the naming system", description=( "A free text natural language description of the naming system from a " "consumer's perspective. Details about what the namespace identifies " "including scope, granularity, version labeling, etc." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the NamingSystem", description=( "An individual or organization primarily responsible for internal " "coherence of the NamingSystem." ), json_schema_extra={ "element_property": True, }, ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the NamingSystem is expected to be used", description=( "The period during which the NamingSystem content was or is planned to " "be in active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the NamingSystem", description=( "An individual or organization asserted by the publisher to be " "responsible for officially endorsing the NamingSystem for use in some " "setting." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this naming system is authored for " "testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the naming system (business identifier)", description=( "A formal identifier that is used to identify this naming system when " "it is represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for naming system (if applicable)", description=( "A legal or geographic region in which the naming system is intended to" " be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title="codesystem | identifier | root", description=( "Indicates the purpose for the naming system - what kinds of things " "does it make unique?" ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["codesystem", "identifier", "root"], }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the NamingSystem was last reviewed by the publisher", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this naming system (computer friendly)", description=( "A natural language name identifying the naming system. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the naming system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this naming system is defined", description=( "Explanation of why this naming system is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Additional documentation, citations, etc", description=( "Related artifacts such as additional documentation, justification, " "dependencies, bibliographic references, and predecessor and successor " "artifacts." ), json_schema_extra={ "element_property": True, }, ) responsible: fhirtypes.StringType | None = Field( default=None, alias="responsible", title="Who maintains system namespace?", description=( "The name of the organization that is responsible for issuing " "identifiers or codes for this namespace and ensuring their non-" "collision." ), json_schema_extra={ "element_property": True, }, ) responsible__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_responsible", title="Extension field for ``responsible``." ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the NamingSystem", description=( "An individual or organization asserted by the publisher to be " "primarily responsible for review of some aspect of the NamingSystem." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this naming system. Enables tracking the life-cycle of " "the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Title for this naming system (human friendly)", description="A short, descriptive, user-friendly title for the naming system.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) topic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="topic", title="E.g. Education, Treatment, Assessment, etc", description=( "Descriptions related to the content of the NamingSystem. Topics " "provide a high-level categorization as well as keywords for the " "NamingSystem that can be useful for filtering and searching." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="e.g. driver, provider, patient, bank etc", description=( "Categorizes a naming system for easier search by grouping related " "naming systems." ), json_schema_extra={ "element_property": True, }, ) uniqueId: typing.List[fhirtypes.NamingSystemUniqueIdType] = Field( default=..., alias="uniqueId", title="Unique identifiers used for system", description=( "Indicates how the system may be identified when referenced in " "electronic exchange." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this naming system, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this naming system when it is" " referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which an authoritative instance of this" " naming system is (or will be) published. This URL can be the target " "of a canonical reference. It SHALL remain the same when the naming " "system is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) usage: fhirtypes.StringType | None = Field( default=None, alias="usage", title="How/where is it used", description=( "Provides guidance on the use of the namespace, including the handling " "of formatting characters, use of upper vs. lower case, etc." ), json_schema_extra={ "element_property": True, }, ) usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usage", title="Extension field for ``usage``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate naming system instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the naming system", description=( "The identifier that is used to identify this version of the naming " "system when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the naming system " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which " "NamingSystem is more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which " "NamingSystem is more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NamingSystem`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "kind", "experimental", "date", "publisher", "contact", "responsible", "type", "description", "useContext", "jurisdiction", "purpose", "copyright", "copyrightLabel", "approvalDate", "lastReviewDate", "effectivePeriod", "topic", "author", "editor", "reviewer", "endorser", "relatedArtifact", "usage", "uniqueId", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NamingSystem`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "kind", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "effectivePeriod", "uniqueId", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("date", "date__ext"), ("kind", "kind__ext"), ("name", "name__ext"), ("status", "status__ext"), ] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields class NamingSystemUniqueId(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Unique identifiers used for system. Indicates how the system may be identified when referenced in electronic exchange. """ __resource_type__ = "NamingSystemUniqueId" authoritative: bool | None = Field( default=None, alias="authoritative", title="Whether the identifier is authoritative", description=( "Indicates whether this identifier ie endorsed by the official owner of" " the associated naming system." ), json_schema_extra={ "element_property": True, }, ) authoritative__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoritative", title="Extension field for ``authoritative``.", ) comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Notes about identifier usage", description="Notes about the past or intended usage of this identifier.", json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="When is identifier valid?", description=( "Identifies the period of time over which this identifier is considered" " appropriate to refer to the naming system. Outside of this window, " "the identifier might be non-deterministic." ), json_schema_extra={ "element_property": True, }, ) preferred: bool | None = Field( default=None, alias="preferred", title="Is this the id that should be used for this type", description=( 'Indicates whether this identifier is the "preferred" identifier of ' "this type." ), json_schema_extra={ "element_property": True, }, ) preferred__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preferred", title="Extension field for ``preferred``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="oid | uuid | uri | iri-stem | v2csmnemonic | other", description=( "Identifies the unique identifier scheme used for this particular " "identifier." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["oid", "uuid", "uri", "iri-stem", "v2csmnemonic", "other"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The unique identifier", description=( "The string that should be sent over the wire to identify the code " "system or identifier system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NamingSystemUniqueId`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "value", "preferred", "comment", "period", "authoritative", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NamingSystemUniqueId`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "value"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext"), ("value", "value__ext")] return required_fields ================================================ FILE: fhir/resources/narrative.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Narrative Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class Narrative(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Human-readable summary of the resource (essential clinical and business information). A human-readable summary of the resource conveying the essential clinical and business information for the resource. """ __resource_type__ = "Narrative" div: fhirtypes.XhtmlType | None = Field( default=None, alias="div", title="Limited xhtml content", description="The actual narrative content, a stripped down version of XHTML.", json_schema_extra={ "element_property": True, "element_required": True, }, ) div__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_div", title="Extension field for ``div``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="generated | extensions | additional | empty", description=( "The status of the narrative - whether it's entirely generated (from " "just the defined data or the extensions too), or whether a human " "authored it and it may contain additional data." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["generated", "extensions", "additional", "empty"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Narrative`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "status", "div"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Narrative`` according to specification, with preserving the original sequence order. """ return [] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("div", "div__ext"), ("status", "status__ext")] return required_fields ================================================ FILE: fhir/resources/nutritionintake.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/NutritionIntake Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class NutritionIntake(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Record of food or fluid being taken by a patient. A record of food or fluid that is being consumed by a patient. A NutritionIntake may indicate that the patient may be consuming the food or fluid now or has consumed the food or fluid in the past. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay or through an app that tracks food or fluids consumed. The consumption information may come from sources such as the patient's memory, from a nutrition label, or from a clinician documenting observed intake. """ __resource_type__ = "NutritionIntake" basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Fulfils plan, proposal or order", description=( "A plan, proposal or order that is fulfilled in whole or in part by " "this event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["NutritionOrder", "CarePlan", "ServiceRequest"], }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Code representing an overall type of nutrition intake", description="Overall type of nutrition intake.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) consumedItem: typing.List[fhirtypes.NutritionIntakeConsumedItemType] = Field( default=..., alias="consumedItem", title="What food or fluid product or item was consumed", description=None, json_schema_extra={ "element_property": True, }, ) derivedFrom: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="derivedFrom", title="Additional supporting information", description=( "Allows linking the NutritionIntake to the underlying NutritionOrder, " "or to other information, such as AllergyIntolerance, that supports or " "is used to derive the NutritionIntake." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter associated with NutritionIntake", description="The encounter that establishes the context for this NutritionIntake.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External identifier", description=( "Identifiers associated with this Nutrition Intake that are defined by " "business processes and/or used to refer to it when a direct URL " "reference to the resource itself is not appropriate. They are business" " identifiers assigned to this resource by the performer or other " "systems and remain constant as the resource is updated and propagates " "from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ingredientLabel: typing.List[ fhirtypes.NutritionIntakeIngredientLabelType ] | None = Field( default=None, alias="ingredientLabel", title="Total nutrient for the whole meal, product, serving", description="Total nutrient amounts for the whole meal, product, serving, etc.", json_schema_extra={ "element_property": True, }, ) instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="instantiatesCanonical", title="Instantiates FHIR protocol or definition", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "ActivityDefinition", "ChargeItemDefinition", "ClinicalUseDefinition", "EventDefinition", "Measure", "MessageDefinition", "ObservationDefinition", "OperationDefinition", "PlanDefinition", "Questionnaire", "Requirements", "SubscriptionTopic", "TestPlan", "TestScript", ], }, ) instantiatesCanonical__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="instantiatesUri", title="Instantiates external protocol or definition", description=None, json_schema_extra={ "element_property": True, }, ) instantiatesUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where the intake occurred", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Further information about the consumption", description=( "Provides extra information about the Nutrition Intake that is not " "conveyed by the other attributes." ), json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="The date/time or interval when the food or fluid is/was consumed", description=( "The interval of time during which it is being asserted that the " "patient is/was consuming the food or fluid." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="The date/time or interval when the food or fluid is/was consumed", description=( "The interval of time during which it is being asserted that the " "patient is/was consuming the food or fluid." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced event", description="A larger event of which this particular event is a component or step.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["NutritionIntake", "Procedure", "Observation"], }, ) performer: typing.List[fhirtypes.NutritionIntakePerformerType] | None = Field( default=None, alias="performer", title="Who was performed in the intake", description="Who performed the intake and how they were involved.", json_schema_extra={ "element_property": True, }, ) reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="reason", title="Reason for why the food or fluid is /was consumed", description=( "A reason, Condition or observation for why the food or fluid is /was " "consumed." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "DiagnosticReport", "DocumentReference", ], }, ) recorded: fhirtypes.DateTimeType | None = Field( default=None, alias="recorded", title="When the intake was recorded", description=( "The date when the Nutrition Intake was asserted by the information " "source." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) recorded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recorded", title="Extension field for ``recorded``." ) reportedBoolean: bool | None = Field( default=None, alias="reportedBoolean", title=( "Person or organization that provided the information about the " "consumption of this food or fluid" ), description=( "The person or organization that provided the information about the " "consumption of this food or fluid. Note: Use derivedFrom when a " "NutritionIntake is derived from other resources." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e reported[x] "one_of_many": "reported", "one_of_many_required": False, }, ) reportedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reportedBoolean", title="Extension field for ``reportedBoolean``.", ) reportedReference: fhirtypes.ReferenceType | None = Field( default=None, alias="reportedReference", title=( "Person or organization that provided the information about the " "consumption of this food or fluid" ), description=( "The person or organization that provided the information about the " "consumption of this food or fluid. Note: Use derivedFrom when a " "NutritionIntake is derived from other resources." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e reported[x] "one_of_many": "reported", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "RelatedPerson", "Practitioner", "PractitionerRole", "Organization", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "preparation | in-progress | not-done | on-hold | stopped | completed |" " entered-in-error | unknown" ), description=( "A code representing the patient or other source's judgment about the " "state of the intake that this assertion is about. Generally, this " "will be active or completed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "preparation", "in-progress", "not-done", "on-hold", "stopped", "completed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusReason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="statusReason", title="Reason for current status", description="Captures the reason for the current state of the NutritionIntake.", json_schema_extra={ "element_property": True, }, ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who is/was consuming the food or fluid", description="The person, animal or group who is/was consuming the food or fluid.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionIntake`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "partOf", "status", "statusReason", "code", "subject", "encounter", "occurrenceDateTime", "occurrencePeriod", "recorded", "reportedBoolean", "reportedReference", "consumedItem", "ingredientLabel", "performer", "location", "derivedFrom", "reason", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionIntake`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "basedOn", "partOf", "status", "code", "subject", "encounter", "occurrenceDateTime", "occurrencePeriod", "recorded", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "occurrence": ["occurrenceDateTime", "occurrencePeriod"], "reported": ["reportedBoolean", "reportedReference"], } return one_of_many_fields class NutritionIntakeConsumedItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What food or fluid product or item was consumed. """ __resource_type__ = "NutritionIntakeConsumedItem" amount: fhirtypes.QuantityType | None = Field( default=None, alias="amount", title="Quantity of the specified food", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) notConsumed: bool | None = Field( default=None, alias="notConsumed", title=( "Flag to indicate if the food or fluid item was refused or otherwise " "not consumed" ), description=( "Indicator when a patient is in a setting where it is helpful to know " "if food was not consumed, such as it was refused, held (as in tube " "feedings), or otherwise not provided. If a consumption is being " "recorded from an app, such as MyFitnessPal, this indicator will likely" " not be used." ), json_schema_extra={ "element_property": True, }, ) notConsumed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_notConsumed", title="Extension field for ``notConsumed``." ) notConsumedReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="notConsumedReason", title="Reason food or fluid was not consumed", description=( "Document the reason the food or fluid was not consumed, such as " "refused, held, etc." ), json_schema_extra={ "element_property": True, }, ) nutritionProduct: fhirtypes.CodeableReferenceType = Field( default=..., alias="nutritionProduct", title="Code that identifies the food or fluid product that was consumed", description=( "Identifies the food or fluid product that was consumed. This is " "potentially a link to a resource representing the details of the food " "product (TBD) or a simple attribute carrying a code that identifies " "the food from a known list of foods." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["NutritionProduct"], }, ) rate: fhirtypes.QuantityType | None = Field( default=None, alias="rate", title="Rate at which enteral feeding was administered", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) schedule: fhirtypes.TimingType | None = Field( default=None, alias="schedule", title="Scheduled frequency of consumption", description=None, json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="The type of food or fluid product", description=( "Indicates what a category of item that was consumed: e.g., food, " "fluid, enteral, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionIntakeConsumedItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "nutritionProduct", "schedule", "amount", "rate", "notConsumed", "notConsumedReason", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionIntakeConsumedItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "nutritionProduct", "amount", "rate"] class NutritionIntakeIngredientLabel(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Total nutrient for the whole meal, product, serving. Total nutrient amounts for the whole meal, product, serving, etc. """ __resource_type__ = "NutritionIntakeIngredientLabel" amount: fhirtypes.QuantityType = Field( default=..., alias="amount", title="Total amount of nutrient consumed", description=None, json_schema_extra={ "element_property": True, }, ) nutrient: fhirtypes.CodeableReferenceType = Field( default=..., alias="nutrient", title="Total nutrient consumed", description=( "Total nutrient consumed. This could be a macronutrient (protein, fat, " "carbohydrate), or a vitamin and mineral." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Substance"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionIntakeIngredientLabel`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "nutrient", "amount"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionIntakeIngredientLabel`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class NutritionIntakePerformer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who was performed in the intake. Who performed the intake and how they were involved. """ __resource_type__ = "NutritionIntakePerformer" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Who performed the intake", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", "Patient", "Device", "RelatedPerson", ], }, ) function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="Type of performer", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionIntakePerformer`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "function", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionIntakePerformer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/nutritionorder.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/NutritionOrder Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class NutritionOrder(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Diet, formula or nutritional supplement request. A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. """ __resource_type__ = "NutritionOrder" allergyIntolerance: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="allergyIntolerance", title=( "List of the patient's food and nutrition-related allergies and " "intolerances" ), description=( "A link to a record of allergies or intolerances which should be " "included in the nutrition order." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["AllergyIntolerance"], }, ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="What this order fulfills", description=( "A plan or request that is fulfilled in whole or in part by this " "nutrition order." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CarePlan", "NutritionOrder", "ServiceRequest"], }, ) dateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="dateTime", title="Date and time the nutrition order was requested", description="The date and time that this nutrition order was requested.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) dateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dateTime", title="Extension field for ``dateTime``." ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="The encounter associated with this nutrition order", description=( "An encounter that provides additional information about the healthcare" " context in which this request is made." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) enteralFormula: fhirtypes.NutritionOrderEnteralFormulaType | None = Field( default=None, alias="enteralFormula", title="Enteral formula components", description=( "Feeding provided through the gastrointestinal tract via a tube, " "catheter, or stoma that delivers nutrition distal to the oral cavity." ), json_schema_extra={ "element_property": True, }, ) excludeFoodModifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="excludeFoodModifier", title=( "Order-specific modifier about the type of food that should not be " "given" ), description=( "This modifier is used to convey Order-specific modifier about the type" " of oral food or oral fluids that should not be given. These can be " "derived from patient allergies, intolerances, or preferences such as " "No Red Meat, No Soy or No Wheat or Gluten-Free. While it should not " "be necessary to repeat allergy or intolerance information captured in " "the referenced AllergyIntolerance resource in the excludeFoodModifier," " this element may be used to convey additional specificity related to " "foods that should be eliminated from the patient\u2019s diet for any " "reason. This modifier applies to the entire nutrition order inclusive" " of the oral diet, nutritional supplements and enteral formula " "feedings." ), json_schema_extra={ "element_property": True, }, ) foodPreferenceModifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="foodPreferenceModifier", title="Order-specific modifier about the type of food that should be given", description=( "This modifier is used to convey order-specific modifiers about the " "type of food that should be given. These can be derived from patient " "allergies, intolerances, or preferences such as Halal, Vegan or " "Kosher. This modifier applies to the entire nutrition order inclusive " "of the oral diet, nutritional supplements and enteral formula " "feedings." ), json_schema_extra={ "element_property": True, }, ) groupIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="groupIdentifier", title="Composite Request ID", description=( "A shared identifier common to all nutrition orders that were " "authorized more or less simultaneously by a single author, " "representing the composite or group identifier." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifiers assigned to this order", description=( "Identifiers assigned to this order by the order sender or by the order" " receiver." ), json_schema_extra={ "element_property": True, }, ) instantiates: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="instantiates", title="Instantiates protocol or definition", description=( "The URL pointing to a protocol, guideline, orderset or other " "definition that is adhered to in whole or in part by this " "NutritionOrder." ), json_schema_extra={ "element_property": True, }, ) instantiates__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiates", title="Extension field for ``instantiates``.", ) instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="instantiatesCanonical", title="Instantiates FHIR protocol or definition", description=( "The URL pointing to a FHIR-defined protocol, guideline, orderset or " "other definition that is adhered to in whole or in part by this " "NutritionOrder." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ActivityDefinition", "PlanDefinition"], }, ) instantiatesCanonical__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="instantiatesUri", title="Instantiates external protocol or definition", description=( "The URL pointing to an externally maintained protocol, guideline, " "orderset or other definition that is adhered to in whole or in part by" " this NutritionOrder." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) intent: fhirtypes.CodeType | None = Field( default=None, alias="intent", title=( "proposal | plan | directive | order | original-order | reflex-order | " "filler-order | instance-order | option" ), description=( "Indicates the level of authority/intentionality associated with the " "NutrionOrder and where the request fits into the workflow chain." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "proposal", "plan", "directive", "order", "original-order", "reflex-order", "filler-order", "instance-order", "option", ], }, ) intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intent", title="Extension field for ``intent``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments", description=( "Comments made about the {{title}} by the requester, performer, subject" " or other participants." ), json_schema_extra={ "element_property": True, }, ) oralDiet: fhirtypes.NutritionOrderOralDietType | None = Field( default=None, alias="oralDiet", title="Oral diet components", description="Diet given orally in contrast to enteral (tube) feeding.", json_schema_extra={ "element_property": True, }, ) orderer: fhirtypes.ReferenceType | None = Field( default=None, alias="orderer", title="Who ordered the diet, formula or nutritional supplement", description=( "The practitioner that holds legal responsibility for ordering the " "diet, nutritional supplement, or formula feedings." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) outsideFoodAllowed: bool | None = Field( default=None, alias="outsideFoodAllowed", title="Capture when a food item is brought in by the patient and/or family", description=( "This modifier is used to convey whether a food item is allowed to be " "brought in by the patient and/or family. If set to true, indicates " "that the receiving system does not need to supply the food item." ), json_schema_extra={ "element_property": True, }, ) outsideFoodAllowed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_outsideFoodAllowed", title="Extension field for ``outsideFoodAllowed``.", ) performer: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="performer", title="Who is desired to perform the administration of what is being ordered", description="The specified desired performer of the nutrition order.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CareTeam", "Practitioner", "PractitionerRole", "RelatedPerson", "Patient", "Organization", ], }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Indicates how quickly the Nutrition Order should be addressed with " "respect to other requests." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "draft | active | on-hold | revoked | completed | entered-in-error | " "unknown" ), description="The workflow status of the nutrition order/request.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "draft", "active", "on-hold", "revoked", "completed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who requires the diet, formula or nutritional supplement", description=( "The person or set of individuals who needs the nutrition order for an " "oral diet, nutritional supplement and/or enteral or formula feeding." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) supplement: typing.List[fhirtypes.NutritionOrderSupplementType] | None = Field( default=None, alias="supplement", title="Supplement components", description=( "Oral nutritional products given in order to add further nutritional " "value to the patient's diet." ), json_schema_extra={ "element_property": True, }, ) supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInformation", title="Information to support fulfilling of the nutrition order", description=( "Information to support fulfilling (i.e. dispensing or administering) " "of the nutrition, for example, patient height and weight)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrder`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "instantiates", "basedOn", "groupIdentifier", "status", "intent", "priority", "subject", "encounter", "supportingInformation", "dateTime", "orderer", "performer", "allergyIntolerance", "foodPreferenceModifier", "excludeFoodModifier", "outsideFoodAllowed", "oralDiet", "supplement", "enteralFormula", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrder`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "instantiatesCanonical", "instantiatesUri", "groupIdentifier", "status", "intent", "subject", "dateTime", "orderer", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("dateTime", "dateTime__ext"), ("intent", "intent__ext"), ("status", "status__ext"), ] return required_fields class NutritionOrderEnteralFormula(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Enteral formula components. Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity. """ __resource_type__ = "NutritionOrderEnteralFormula" additive: typing.List[ fhirtypes.NutritionOrderEnteralFormulaAdditiveType ] | None = Field( default=None, alias="additive", title="Components to add to the feeding", description=( "Indicates modular components to be provided in addition or mixed with " "the base formula." ), json_schema_extra={ "element_property": True, }, ) administration: typing.List[ fhirtypes.NutritionOrderEnteralFormulaAdministrationType ] | None = Field( default=None, alias="administration", title="Formula feeding instruction as structured data", description=( "Formula administration instructions as structured data. This " "repeating structure allows for changing the administration rate or " "volume over time for both bolus and continuous feeding. An example of" " this would be an instruction to increase the rate of continuous " "feeding every 2 hours." ), json_schema_extra={ "element_property": True, }, ) administrationInstruction: fhirtypes.MarkdownType | None = Field( default=None, alias="administrationInstruction", title="Formula feeding instructions expressed as text", description=( "Free text formula administration, feeding instructions or additional " "instructions or information." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) administrationInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_administrationInstruction", title="Extension field for ``administrationInstruction``.", ) baseFormulaProductName: fhirtypes.StringType | None = Field( default=None, alias="baseFormulaProductName", title="Product or brand name of the enteral or infant formula", description=( "The product or brand name of the enteral or infant formula product " 'such as "ACME Adult Standard Formula".' ), json_schema_extra={ "element_property": True, }, ) baseFormulaProductName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_baseFormulaProductName", title="Extension field for ``baseFormulaProductName``.", ) baseFormulaType: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="baseFormulaType", title="Type of enteral or infant formula", description=( "The type of enteral or infant formula such as an adult standard " "formula with fiber or a soy-based infant formula." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["NutritionProduct"], }, ) caloricDensity: fhirtypes.QuantityType | None = Field( default=None, alias="caloricDensity", title="Amount of energy per specified volume that is required", description=( "The amount of energy (calories) that the formula should provide per " "specified volume, typically per mL or fluid oz. For example, an " "infant may require a formula that provides 24 calories per fluid ounce" " or an adult may require an enteral formula that provides 1.5 " "calorie/mL." ), json_schema_extra={ "element_property": True, }, ) deliveryDevice: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="deliveryDevice", title="Intended type of device for the administration", description=( "The intended type of device that is to be used for the administration " "of the enteral formula." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DeviceDefinition"], }, ) maxVolumeToDeliver: fhirtypes.QuantityType | None = Field( default=None, alias="maxVolumeToDeliver", title="Upper limit on formula volume per unit of time", description=( "The maximum total quantity of formula that may be administered to a " "subject over the period of time, e.g. 1440 mL over 24 hours." ), json_schema_extra={ "element_property": True, }, ) routeOfAdministration: fhirtypes.CodeableConceptType | None = Field( default=None, alias="routeOfAdministration", title="How the formula should enter the patient's gastrointestinal tract", description=( "The route or physiological path of administration into the patient's " "gastrointestinal tract for purposes of providing the formula feeding," " e.g. nasogastric tube." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrderEnteralFormula`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "baseFormulaType", "baseFormulaProductName", "deliveryDevice", "additive", "caloricDensity", "routeOfAdministration", "administration", "maxVolumeToDeliver", "administrationInstruction", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrderEnteralFormula`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "baseFormulaType", "administrationInstruction"] class NutritionOrderEnteralFormulaAdditive(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Components to add to the feeding. Indicates modular components to be provided in addition or mixed with the base formula. """ __resource_type__ = "NutritionOrderEnteralFormulaAdditive" productName: fhirtypes.StringType | None = Field( default=None, alias="productName", title="Product or brand name of the modular additive", description=( "The product or brand name of the type of modular component to be added" " to the formula." ), json_schema_extra={ "element_property": True, }, ) productName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_productName", title="Extension field for ``productName``." ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Amount of additive to be given or mixed in", description=( "The amount of additive to be given in addition or to be mixed in with " "the base formula." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="type", title="Type of modular component to add to the feeding", description=( "Indicates the type of modular component such as protein, carbohydrate," " fat or fiber to be provided in addition to or mixed with the base " "formula." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["NutritionProduct"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrderEnteralFormulaAdditive`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "productName", "quantity", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrderEnteralFormulaAdditive`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class NutritionOrderEnteralFormulaAdministration(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Formula feeding instruction as structured data. Formula administration instructions as structured data. This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding. An example of this would be an instruction to increase the rate of continuous feeding every 2 hours. """ __resource_type__ = "NutritionOrderEnteralFormulaAdministration" quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="The volume of formula to provide", description=( "The volume of formula to provide to the patient per the specified " "administration schedule." ), json_schema_extra={ "element_property": True, }, ) rateQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="rateQuantity", title="Speed with which the formula is provided per period of time", description=( "The rate of administration of formula via a feeding pump, e.g. 60 mL " "per hour, according to the specified schedule." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e rate[x] "one_of_many": "rate", "one_of_many_required": False, }, ) rateRatio: fhirtypes.RatioType | None = Field( default=None, alias="rateRatio", title="Speed with which the formula is provided per period of time", description=( "The rate of administration of formula via a feeding pump, e.g. 60 mL " "per hour, according to the specified schedule." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e rate[x] "one_of_many": "rate", "one_of_many_required": False, }, ) schedule: fhirtypes.NutritionOrderEnteralFormulaAdministrationScheduleType | None = Field( default=None, alias="schedule", title="Scheduling information for enteral formula products", description="Schedule information for an enteral formula.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrderEnteralFormulaAdministration`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "schedule", "quantity", "rateQuantity", "rateRatio", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrderEnteralFormulaAdministration`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"rate": ["rateQuantity", "rateRatio"]} return one_of_many_fields class NutritionOrderEnteralFormulaAdministrationSchedule( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Scheduling information for enteral formula products. Schedule information for an enteral formula. """ __resource_type__ = "NutritionOrderEnteralFormulaAdministrationSchedule" asNeeded: bool | None = Field( default=None, alias="asNeeded", title="Take 'as needed'", description=( "Indicates whether the enteral formula is only taken when needed within" " a specific dosing schedule." ), json_schema_extra={ "element_property": True, }, ) asNeeded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_asNeeded", title="Extension field for ``asNeeded``." ) asNeededFor: fhirtypes.CodeableConceptType | None = Field( default=None, alias="asNeededFor", title="Take 'as needed' for x", description=( "Indicates whether the enteral formula is only taken based on a " "precondition for taking the enteral formula." ), json_schema_extra={ "element_property": True, }, ) timing: typing.List[fhirtypes.TimingType] | None = Field( default=None, alias="timing", title="Scheduled frequency of enteral formula", description=( "The time period and frequency at which the enteral formula should be " "given. The enteral formula should be given for the combination of all" " schedules if more than one schedule is present." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrderEnteralFormulaAdministrationSchedule`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "timing", "asNeeded", "asNeededFor", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrderEnteralFormulaAdministrationSchedule`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class NutritionOrderOralDiet(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Oral diet components. Diet given orally in contrast to enteral (tube) feeding. """ __resource_type__ = "NutritionOrderOralDiet" fluidConsistencyType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="fluidConsistencyType", title="The required consistency of fluids and liquids provided to the patient", description=( "The required consistency (e.g. honey-thick, nectar-thick, thin, " "thickened.) of liquids or fluids served to the patient." ), json_schema_extra={ "element_property": True, }, ) instruction: fhirtypes.StringType | None = Field( default=None, alias="instruction", title="Instructions or additional information about the oral diet", description=( "Free text or additional instructions or information pertaining to the " "oral diet." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instruction", title="Extension field for ``instruction``." ) nutrient: typing.List[fhirtypes.NutritionOrderOralDietNutrientType] | None = Field( default=None, alias="nutrient", title="Required nutrient modifications", description=( "Class that defines the quantity and type of nutrient modifications " "(for example carbohydrate, fiber or sodium) required for the oral " "diet." ), json_schema_extra={ "element_property": True, }, ) schedule: fhirtypes.NutritionOrderOralDietScheduleType | None = Field( default=None, alias="schedule", title="Scheduling information for oral diets", description="Schedule information for an oral diet.", json_schema_extra={ "element_property": True, }, ) texture: typing.List[fhirtypes.NutritionOrderOralDietTextureType] | None = Field( default=None, alias="texture", title="Required texture modifications", description=( "Class that describes any texture modifications required for the " "patient to safely consume various types of solid foods." ), json_schema_extra={ "element_property": True, }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title=( "Type of oral diet or diet restrictions that describe what can be " "consumed orally" ), description=( "The kind of diet or dietary restriction such as fiber restricted diet " "or diabetic diet." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrderOralDiet`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "schedule", "nutrient", "texture", "fluidConsistencyType", "instruction", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrderOralDiet`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "instruction"] class NutritionOrderOralDietNutrient(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Required nutrient modifications. Class that defines the quantity and type of nutrient modifications (for example carbohydrate, fiber or sodium) required for the oral diet. """ __resource_type__ = "NutritionOrderOralDietNutrient" amount: fhirtypes.QuantityType | None = Field( default=None, alias="amount", title="Quantity of the specified nutrient", description="The quantity of the specified nutrient to include in diet.", json_schema_extra={ "element_property": True, }, ) modifier: fhirtypes.CodeableConceptType | None = Field( default=None, alias="modifier", title="Type of nutrient that is being modified", description="The nutrient that is being modified such as carbohydrate or sodium.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrderOralDietNutrient`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "modifier", "amount"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrderOralDietNutrient`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class NutritionOrderOralDietSchedule(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Scheduling information for oral diets. Schedule information for an oral diet. """ __resource_type__ = "NutritionOrderOralDietSchedule" asNeeded: bool | None = Field( default=None, alias="asNeeded", title="Take 'as needed'", description=( "Indicates whether the product is only taken when needed within a " "specific dosing schedule." ), json_schema_extra={ "element_property": True, }, ) asNeeded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_asNeeded", title="Extension field for ``asNeeded``." ) asNeededFor: fhirtypes.CodeableConceptType | None = Field( default=None, alias="asNeededFor", title="Take 'as needed' for x", description=( "Indicates whether the product is only taken based on a precondition " "for taking the product." ), json_schema_extra={ "element_property": True, }, ) timing: typing.List[fhirtypes.TimingType] | None = Field( default=None, alias="timing", title="Scheduled frequency of diet", description=( "The time period and frequency at which the diet should be given. The " "diet should be given for the combination of all schedules if more than" " one schedule is present." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrderOralDietSchedule`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "timing", "asNeeded", "asNeededFor", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrderOralDietSchedule`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class NutritionOrderOralDietTexture(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Required texture modifications. Class that describes any texture modifications required for the patient to safely consume various types of solid foods. """ __resource_type__ = "NutritionOrderOralDietTexture" foodType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="foodType", title=( "Concepts that are used to identify an entity that is ingested for " "nutritional purposes" ), description=( "The food type(s) (e.g. meats, all foods) that the texture " "modification applies to. This could be all foods types." ), json_schema_extra={ "element_property": True, }, ) modifier: fhirtypes.CodeableConceptType | None = Field( default=None, alias="modifier", title="Code to indicate how to alter the texture of the foods, e.g. pureed", description=( "Any texture modifications (for solid foods) that should be made, e.g. " "easy to chew, chopped, ground, and pureed." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrderOralDietTexture`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "modifier", "foodType"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrderOralDietTexture`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class NutritionOrderSupplement(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Supplement components. Oral nutritional products given in order to add further nutritional value to the patient's diet. """ __resource_type__ = "NutritionOrderSupplement" instruction: fhirtypes.StringType | None = Field( default=None, alias="instruction", title="Instructions or additional information about the oral supplement", description=( "Free text or additional instructions or information pertaining to the " "oral supplement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instruction", title="Extension field for ``instruction``." ) productName: fhirtypes.StringType | None = Field( default=None, alias="productName", title="Product or brand name of the nutritional supplement", description=( 'The product or brand name of the nutritional supplement such as "Acme ' 'Protein Shake".' ), json_schema_extra={ "element_property": True, }, ) productName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_productName", title="Extension field for ``productName``." ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Amount of the nutritional supplement", description="The amount of the nutritional supplement to be given.", json_schema_extra={ "element_property": True, }, ) schedule: fhirtypes.NutritionOrderSupplementScheduleType | None = Field( default=None, alias="schedule", title="Scheduling information for supplements", description="Schedule information for a supplement.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="type", title="Type of supplement product requested", description=( "The kind of nutritional supplement product required such as a high " "protein or pediatric clear liquid supplement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["NutritionProduct"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrderSupplement`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "productName", "schedule", "quantity", "instruction", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrderSupplement`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "instruction"] class NutritionOrderSupplementSchedule(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Scheduling information for supplements. Schedule information for a supplement. """ __resource_type__ = "NutritionOrderSupplementSchedule" asNeeded: bool | None = Field( default=None, alias="asNeeded", title="Take 'as needed'", description=( "Indicates whether the supplement is only taken when needed within a " "specific dosing schedule." ), json_schema_extra={ "element_property": True, }, ) asNeeded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_asNeeded", title="Extension field for ``asNeeded``." ) asNeededFor: fhirtypes.CodeableConceptType | None = Field( default=None, alias="asNeededFor", title="Take 'as needed' for x", description=( "Indicates whether the supplement is only taken based on a precondition" " for taking the supplement." ), json_schema_extra={ "element_property": True, }, ) timing: typing.List[fhirtypes.TimingType] | None = Field( default=None, alias="timing", title="Scheduled frequency of diet", description=( "The time period and frequency at which the supplement should be given." " The supplement should be given for the combination of all schedules " "if more than one schedule is present." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionOrderSupplementSchedule`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "timing", "asNeeded", "asNeededFor", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionOrderSupplementSchedule`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/nutritionproduct.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/NutritionProduct Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class NutritionProduct(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A product used for nutritional purposes (i.e. food or supplement). A food or supplement that is consumed by patients. """ __resource_type__ = "NutritionProduct" category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title=( "Broad product groups or categories used to classify the product, such " "as Legume and Legume Products, Beverages, or Beef Products" ), description=( "Nutrition products can have different classifications - according to " "its nutritional properties, preparation methods, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) characteristic: typing.List[ fhirtypes.NutritionProductCharacteristicType ] | None = Field( default=None, alias="characteristic", title="Specifies descriptive properties of the nutrition product", description=None, json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title=( "A code that can identify the detailed nutrients and ingredients in a " "specific food product" ), description=( "The code assigned to the product, for example a USDA NDB number, a " "USDA FDC ID number, or a Langual code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ingredient: typing.List[fhirtypes.NutritionProductIngredientType] | None = Field( default=None, alias="ingredient", title="Ingredients contained in this product", description=None, json_schema_extra={ "element_property": True, }, ) instance: typing.List[fhirtypes.NutritionProductInstanceType] | None = Field( default=None, alias="instance", title=( "One or several physical instances or occurrences of the nutrition " "product" ), description=( "Conveys instance-level information about this product item. One or " "several physical, countable instances or occurrences of the product." ), json_schema_extra={ "element_property": True, }, ) knownAllergen: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="knownAllergen", title="Known or suspected allergens that are a part of this product", description=( "Allergens that are known or suspected to be a part of this nutrition " "product." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Substance"], }, ) manufacturer: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="manufacturer", title="Manufacturer, representative or officially responsible for the product", description=( "The organisation (manufacturer, representative or legal authorization " "holder) that is responsible for the device." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the product", description=None, json_schema_extra={ "element_property": True, }, ) nutrient: typing.List[fhirtypes.NutritionProductNutrientType] | None = Field( default=None, alias="nutrient", title="The product's nutritional information expressed by the nutrients", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | inactive | entered-in-error", description="The current state of the product.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "inactive", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionProduct`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "code", "status", "category", "manufacturer", "nutrient", "ingredient", "knownAllergen", "characteristic", "instance", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionProduct`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "code", "status", "category", "manufacturer", "nutrient", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class NutritionProductCharacteristic(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specifies descriptive properties of the nutrition product. """ __resource_type__ = "NutritionProductCharacteristic" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Code specifying the type of characteristic", description=( "A code specifying which characteristic of the product is being " "described (for example, colour, shape)." ), json_schema_extra={ "element_property": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="The value of the characteristic", description="The actual characteristic value corresponding to the type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="valueBase64Binary", title="The value of the characteristic", description="The actual characteristic value corresponding to the type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBase64Binary", title="Extension field for ``valueBase64Binary``.", ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="The value of the characteristic", description="The actual characteristic value corresponding to the type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="The value of the characteristic", description="The actual characteristic value corresponding to the type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="The value of the characteristic", description="The actual characteristic value corresponding to the type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="The value of the characteristic", description="The actual characteristic value corresponding to the type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionProductCharacteristic`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueCodeableConcept", "valueString", "valueQuantity", "valueBase64Binary", "valueAttachment", "valueBoolean", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionProductCharacteristic`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueBase64Binary", "valueBoolean", "valueCodeableConcept", "valueQuantity", "valueString", ] } return one_of_many_fields class NutritionProductIngredient(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Ingredients contained in this product. """ __resource_type__ = "NutritionProductIngredient" amount: typing.List[fhirtypes.RatioType] | None = Field( default=None, alias="amount", title="The amount of ingredient that is in the product", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) item: fhirtypes.CodeableReferenceType = Field( default=..., alias="item", title="The ingredient contained in the product", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["NutritionProduct"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionProductIngredient`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "item", "amount"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionProductIngredient`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "item", "amount"] class NutritionProductInstance(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. One or several physical instances or occurrences of the nutrition product. Conveys instance-level information about this product item. One or several physical, countable instances or occurrences of the product. """ __resource_type__ = "NutritionProductInstance" biologicalSourceEvent: fhirtypes.IdentifierType | None = Field( default=None, alias="biologicalSourceEvent", title=( "An identifier that supports traceability to the event during which " "material in this product from one or more biological entities was " "obtained or pooled" ), description=None, json_schema_extra={ "element_property": True, }, ) expiry: fhirtypes.DateTimeType | None = Field( default=None, alias="expiry", title="The expiry date or date and time for the product", description=( "The time after which the product is no longer expected to be in proper" " condition, or its use is not advised or not allowed." ), json_schema_extra={ "element_property": True, }, ) expiry__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expiry", title="Extension field for ``expiry``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title=( "The identifier for the physical instance, typically a serial number or" " manufacturer number" ), description=None, json_schema_extra={ "element_property": True, }, ) lotNumber: fhirtypes.StringType | None = Field( default=None, alias="lotNumber", title="The identification of the batch or lot of the product", description=None, json_schema_extra={ "element_property": True, }, ) lotNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lotNumber", title="Extension field for ``lotNumber``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="The name for the specific product", description=None, json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="The amount of items or instances", description=( "The amount of items or instances that the resource considers, for " "instance when referring to 2 identical units together." ), json_schema_extra={ "element_property": True, }, ) useBy: fhirtypes.DateTimeType | None = Field( default=None, alias="useBy", title=( "The date until which the product is expected to be good for " "consumption" ), description=( "The time after which the product is no longer expected to be in proper" " condition, or its use is not advised or not allowed." ), json_schema_extra={ "element_property": True, }, ) useBy__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_useBy", title="Extension field for ``useBy``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionProductInstance`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "quantity", "identifier", "name", "lotNumber", "expiry", "useBy", "biologicalSourceEvent", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionProductInstance`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class NutritionProductNutrient(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The product's nutritional information expressed by the nutrients. """ __resource_type__ = "NutritionProductNutrient" amount: typing.List[fhirtypes.RatioType] | None = Field( default=None, alias="amount", title=( "The amount of nutrient expressed in one or more units: X per pack / " "per serving / per dose" ), description=None, json_schema_extra={ "element_property": True, }, ) item: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="item", title="The (relevant) nutrients in the product", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Substance"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``NutritionProductNutrient`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "item", "amount"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``NutritionProductNutrient`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/observation.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Observation Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Observation(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Measurements and simple assertions. Measurements and simple assertions made about a patient, device or other subject. """ __resource_type__ = "Observation" basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Fulfills plan, proposal or order", description=( "A plan, proposal or order that is fulfilled in whole or in part by " "this event. For example, a MedicationRequest may require a patient to" " have laboratory test performed before it is dispensed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CarePlan", "DeviceRequest", "ImmunizationRecommendation", "MedicationRequest", "NutritionOrder", "ServiceRequest", ], }, ) bodySite: fhirtypes.CodeableConceptType | None = Field( default=None, alias="bodySite", title="Observed body part", description=( "Indicates the site on the subject's body where the observation was " "made (i.e. the target site)." ), json_schema_extra={ "element_property": True, }, ) bodyStructure: fhirtypes.ReferenceType | None = Field( default=None, alias="bodyStructure", title="Observed body structure", description=( "Indicates the body structure on the subject's body where the " "observation was made (i.e. the target site)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["BodyStructure"], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Classification of type of observation", description="A code that classifies the general type of observation being made.", json_schema_extra={ "element_property": True, }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Type of observation (code / type)", description=( "Describes what was observed. Sometimes this is called the observation " '"name".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) component: typing.List[fhirtypes.ObservationComponentType] | None = Field( default=None, alias="component", title="Component results", description=( "Some observations have multiple component observations. These " "component observations are expressed as separate code value pairs that" " share the same attributes. Examples include systolic and diastolic " "component observations for blood pressure measurement and multiple " "component observations for genetics observations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dataAbsentReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="dataAbsentReason", title="Why the result is missing", description=( "Provides a reason why the expected value in the element " "Observation.value[x] is missing." ), json_schema_extra={ "element_property": True, }, ) derivedFrom: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="derivedFrom", title="Related resource from which the observation is made", description=( "The target resource that represents a measurement from which this " "observation value is derived. For example, a calculated anion gap or a" " fetal measurement based on an ultrasound image." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "DocumentReference", "ImagingStudy", "ImagingSelection", "QuestionnaireResponse", "Observation", "MolecularSequence", "GenomicStudy", ], }, ) device: fhirtypes.ReferenceType | None = Field( default=None, alias="device", title=( "A reference to the device that generates the measurements or the " "device settings for the device" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device", "DeviceMetric"], }, ) effectiveDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="effectiveDateTime", title="Clinically relevant time/time-period for observation", description=( "The time or time-period the observed value is asserted as being true. " "For biological subjects - e.g. human patients - this is usually called" ' the "physiologically relevant time". This is usually either the time ' "of the procedure or of specimen collection, but very often the source " "of the date/time is not known, only the date/time itself." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_effectiveDateTime", title="Extension field for ``effectiveDateTime``.", ) effectiveInstant: fhirtypes.InstantType | None = Field( default=None, alias="effectiveInstant", title="Clinically relevant time/time-period for observation", description=( "The time or time-period the observed value is asserted as being true. " "For biological subjects - e.g. human patients - this is usually called" ' the "physiologically relevant time". This is usually either the time ' "of the procedure or of specimen collection, but very often the source " "of the date/time is not known, only the date/time itself." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) effectiveInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_effectiveInstant", title="Extension field for ``effectiveInstant``.", ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="Clinically relevant time/time-period for observation", description=( "The time or time-period the observed value is asserted as being true. " "For biological subjects - e.g. human patients - this is usually called" ' the "physiologically relevant time". This is usually either the time ' "of the procedure or of specimen collection, but very often the source " "of the date/time is not known, only the date/time itself." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) effectiveTiming: fhirtypes.TimingType | None = Field( default=None, alias="effectiveTiming", title="Clinically relevant time/time-period for observation", description=( "The time or time-period the observed value is asserted as being true. " "For biological subjects - e.g. human patients - this is usually called" ' the "physiologically relevant time". This is usually either the time ' "of the procedure or of specimen collection, but very often the source " "of the date/time is not known, only the date/time itself." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e effective[x] "one_of_many": "effective", "one_of_many_required": False, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Healthcare event during which this observation is made", description=( "The healthcare event (e.g. a patient and healthcare provider " "interaction) during which this observation is made." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) focus: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="focus", title=( "What the observation is about, when it is not about the subject of " "record" ), description=( "The actual focus of an observation when it is not the patient of " "record representing something or someone associated with the patient " "such as a spouse, parent, fetus, or donor. For example, fetus " "observations in a mother's record. The focus of an observation could " "also be an existing condition, an intervention, the subject's diet, " "another observation of the subject, or a body structure such as tumor" " or implanted device. An example use case would be using the " "Observation resource to capture whether the mother is trained to " "change her child's tracheostomy tube. In this example, the child is " "the patient of record and the mother is the focus." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) hasMember: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="hasMember", title="Related resource that belongs to the Observation group", description=( "This observation is a group observation (e.g. a battery, a panel of " "tests, a set of vital sign measurements) that includes the target as a" " member of the group." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Observation", "QuestionnaireResponse", "MolecularSequence", ], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for observation", description="A unique identifier assigned to this observation.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="instantiatesCanonical", title="Instantiates FHIR ObservationDefinition", description=( "The reference to a FHIR ObservationDefinition resource that provides " "the definition that is adhered to in whole or in part by this " "Observation instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e instantiates[x] "one_of_many": "instantiates", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) instantiatesCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesReference: fhirtypes.ReferenceType | None = Field( default=None, alias="instantiatesReference", title="Instantiates FHIR ObservationDefinition", description=( "The reference to a FHIR ObservationDefinition resource that provides " "the definition that is adhered to in whole or in part by this " "Observation instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e instantiates[x] "one_of_many": "instantiates", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) interpretation: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="interpretation", title="High, low, normal, etc", description=( "A categorical assessment of an observation value. For example, high, " "low, normal." ), json_schema_extra={ "element_property": True, }, ) issued: fhirtypes.InstantType | None = Field( default=None, alias="issued", title="Date/Time this version was made available", description=( "The date and time this version of the observation was made available " "to providers, typically after the results have been reviewed and " "verified." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issued", title="Extension field for ``issued``." ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="How it was done", description="Indicates the mechanism used to perform the observation.", json_schema_extra={ "element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments about the observation", description="Comments about the observation or the results.", json_schema_extra={ "element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced event", description=( "A larger event of which this particular Observation is a component or " "step. For example, an observation as part of a procedure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "MedicationAdministration", "MedicationDispense", "MedicationStatement", "Procedure", "Immunization", "ImagingStudy", "GenomicStudy", ], }, ) performer: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="performer", title="Who is responsible for the observation", description='Who was responsible for asserting the observed value as "true".', json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", "Patient", "RelatedPerson", ], }, ) referenceRange: typing.List[fhirtypes.ObservationReferenceRangeType] | None = Field( default=None, alias="referenceRange", title="Provides guide for interpretation", description=( "Guidance on how to interpret the value by comparison to a normal or " "recommended range. Multiple reference ranges are interpreted as an " '"OR". In other words, to represent two distinct target populations, ' "two `referenceRange` elements would be used." ), json_schema_extra={ "element_property": True, }, ) specimen: fhirtypes.ReferenceType | None = Field( default=None, alias="specimen", title="Specimen used for this observation", description="The specimen that was used when this observation was made.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Specimen", "Group"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="registered | preliminary | final | amended +", description="The status of the result value.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["registered", "preliminary", "final", "amended", "+"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Who and/or what the observation is about", description=( "The patient, or group of patients, location, device, organization, " "procedure or practitioner this observation is about and into whose or " "what record the observation is placed. If the actual focus of the " "observation is different from the subject (or a sample of, part, or " "region of the subject), the `focus` element or the `code` itself " "specifies the actual focus of the observation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Group", "Device", "Location", "Organization", "Procedure", "Practitioner", "Medication", "Substance", "BiologicallyDerivedProduct", "NutritionProduct", ], }, ) triggeredBy: typing.List[fhirtypes.ObservationTriggeredByType] | None = Field( default=None, alias="triggeredBy", title="Triggering observation(s)", description=( "Identifies the observation(s) that triggered the performance of this " "observation." ), json_schema_extra={ "element_property": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MolecularSequence"], }, ) valueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="valueSampledData", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Actual result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Observation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesReference", "basedOn", "triggeredBy", "partOf", "status", "category", "code", "subject", "focus", "encounter", "effectiveDateTime", "effectivePeriod", "effectiveTiming", "effectiveInstant", "issued", "performer", "valueQuantity", "valueCodeableConcept", "valueString", "valueBoolean", "valueInteger", "valueRange", "valueRatio", "valueSampledData", "valueTime", "valueDateTime", "valuePeriod", "valueAttachment", "valueReference", "dataAbsentReason", "interpretation", "note", "bodySite", "bodyStructure", "method", "specimen", "device", "referenceRange", "hasMember", "derivedFrom", "component", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Observation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesReference", "basedOn", "partOf", "status", "code", "subject", "focus", "encounter", "effectiveDateTime", "effectivePeriod", "effectiveTiming", "effectiveInstant", "issued", "performer", "valueQuantity", "valueCodeableConcept", "valueString", "valueBoolean", "valueInteger", "valueRange", "valueRatio", "valueSampledData", "valueTime", "valueDateTime", "valuePeriod", "valueAttachment", "valueReference", "hasMember", "derivedFrom", "component", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "effective": [ "effectiveDateTime", "effectiveInstant", "effectivePeriod", "effectiveTiming", ], "instantiates": ["instantiatesCanonical", "instantiatesReference"], "value": [ "valueAttachment", "valueBoolean", "valueCodeableConcept", "valueDateTime", "valueInteger", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueReference", "valueSampledData", "valueString", "valueTime", ], } return one_of_many_fields class ObservationComponent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Component results. Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same attributes. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations. """ __resource_type__ = "ObservationComponent" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Type of component observation (code / type)", description=( "Describes what was observed. Sometimes this is called the observation " '"code".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dataAbsentReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="dataAbsentReason", title="Why the component result is missing", description=( "Provides a reason why the expected value in the element " "Observation.component.value[x] is missing." ), json_schema_extra={ "element_property": True, }, ) interpretation: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="interpretation", title="High, low, normal, etc", description=( "A categorical assessment of an observation value. For example, high, " "low, normal." ), json_schema_extra={ "element_property": True, }, ) referenceRange: typing.List[fhirtypes.ObservationReferenceRangeType] | None = Field( default=None, alias="referenceRange", title="Provides guide for interpretation of component result", description=( "Guidance on how to interpret the value by comparison to a normal or " "recommended range." ), json_schema_extra={ "element_property": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MolecularSequence"], }, ) valueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="valueSampledData", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Actual component result", description=( "The information determined as a result of making the observation, if " "the information has a simple value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ObservationComponent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "valueQuantity", "valueCodeableConcept", "valueString", "valueBoolean", "valueInteger", "valueRange", "valueRatio", "valueSampledData", "valueTime", "valueDateTime", "valuePeriod", "valueAttachment", "valueReference", "dataAbsentReason", "interpretation", "referenceRange", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ObservationComponent`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "code", "valueQuantity", "valueCodeableConcept", "valueString", "valueBoolean", "valueInteger", "valueRange", "valueRatio", "valueSampledData", "valueTime", "valueDateTime", "valuePeriod", "valueAttachment", "valueReference", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueBoolean", "valueCodeableConcept", "valueDateTime", "valueInteger", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueReference", "valueSampledData", "valueString", "valueTime", ] } return one_of_many_fields class ObservationReferenceRange(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Provides guide for interpretation. Guidance on how to interpret the value by comparison to a normal or recommended range. Multiple reference ranges are interpreted as an "OR". In other words, to represent two distinct target populations, two `referenceRange` elements would be used. """ __resource_type__ = "ObservationReferenceRange" age: fhirtypes.RangeType | None = Field( default=None, alias="age", title="Applicable age range, if relevant", description=( "The age at which this reference range is applicable. This is a " "neonatal age (e.g. number of weeks at term) if the meaning says so." ), json_schema_extra={ "element_property": True, }, ) appliesTo: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="appliesTo", title="Reference range population", description=( "Codes to indicate the target population this reference range applies " "to. For example, a reference range may be based on the normal " "population or a particular sex or race. Multiple `appliesTo` are " 'interpreted as an "AND" of the target populations. For example, to ' "represent a target population of African American females, both a code" " of female and a code for African American would be used." ), json_schema_extra={ "element_property": True, }, ) high: fhirtypes.QuantityType | None = Field( default=None, alias="high", title="High Range, if relevant", description=( "The value of the high bound of the reference range. The high bound of" " the reference range endpoint is inclusive of the value (e.g. " "reference range is >=5 - <=9). If the high bound is omitted, it is " "assumed to be meaningless (e.g. reference range is >= 2.3)." ), json_schema_extra={ "element_property": True, }, ) low: fhirtypes.QuantityType | None = Field( default=None, alias="low", title="Low Range, if relevant", description=( "The value of the low bound of the reference range. The low bound of " "the reference range endpoint is inclusive of the value (e.g. " "reference range is >=5 - <=9). If the low bound is omitted, it is " "assumed to be meaningless (e.g. reference range is <=2.3)." ), json_schema_extra={ "element_property": True, }, ) normalValue: fhirtypes.CodeableConceptType | None = Field( default=None, alias="normalValue", title="Normal value, if relevant", description="The value of the normal value of the reference range.", json_schema_extra={ "element_property": True, }, ) text: fhirtypes.MarkdownType | None = Field( default=None, alias="text", title="Text based reference range in an observation", description=( "Text based reference range in an observation which may be used when a " "quantitative range is not appropriate for an observation. An example " 'would be a reference value of "Negative" or a list or table of ' '"normals".' ), json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Reference range qualifier", description=( "Codes to indicate the what part of the targeted reference population " "it applies to. For example, the normal or therapeutic range." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ObservationReferenceRange`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "low", "high", "normalValue", "type", "appliesTo", "age", "text", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ObservationReferenceRange`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ObservationTriggeredBy(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Triggering observation(s). Identifies the observation(s) that triggered the performance of this observation. """ __resource_type__ = "ObservationTriggeredBy" observation: fhirtypes.ReferenceType = Field( default=..., alias="observation", title="Triggering observation", description="Reference to the triggering observation.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Observation"], }, ) reason: fhirtypes.StringType | None = Field( default=None, alias="reason", title="Reason that the observation was triggered", description=( "Provides the reason why this observation was performed as a result of " "the observation(s) referenced." ), json_schema_extra={ "element_property": True, }, ) reason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reason", title="Extension field for ``reason``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="reflex | repeat | re-run", description="The type of trigger. Reflex | Repeat | Re-run.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["reflex", "repeat", "re-run"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ObservationTriggeredBy`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "observation", "type", "reason"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ObservationTriggeredBy`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "observation", "type"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields ================================================ FILE: fhir/resources/observationdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ObservationDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ObservationDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of an observation. Set of definitional characteristics for a kind of observation or measurement produced or consumed by an orderable health care service. """ __resource_type__ = "ObservationDefinition" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When ObservationDefinition was approved by publisher", description=( "The date on which the asset content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) bodySite: fhirtypes.CodeableConceptType | None = Field( default=None, alias="bodySite", title="Body part to be observed", description="The site on the subject's body where the observation is to be made.", json_schema_extra={ "element_property": True, }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="General type of observation", description="A code that classifies the general type of observation.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Type of observation", description=( "Describes what will be observed. Sometimes this is called the " 'observation "name".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) component: typing.List[fhirtypes.ObservationDefinitionComponentType] | None = Field( default=None, alias="component", title="Component results", description=( "Some observations have multiple component observations, expressed as " "separate code value pairs." ), json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "Copyright statement relating to the ObservationDefinition and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the ObservationDefinition." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the ObservationDefinition was last" " significantly changed. The date must change when the business version" " changes and it must change if the status code changes. In addition, " "it should change when the substantive content of the " "ObservationDefinition changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) derivedFromCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="derivedFromCanonical", title="Based on FHIR definition of another observation", description=( "The canonical URL pointing to another FHIR-defined " "ObservationDefinition that is adhered to in whole or in part by this " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition"], }, ) derivedFromCanonical__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_derivedFromCanonical", title="Extension field for ``derivedFromCanonical``.", ) derivedFromUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="derivedFromUri", title="Based on external definition", description=( "The URL pointing to an externally-defined observation definition, " "guideline or other definition that is adhered to in whole or in part " "by this definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) derivedFromUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_derivedFromUri", title="Extension field for ``derivedFromUri``.", ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the ObservationDefinition", description=( "A free text natural language description of the ObservationDefinition " "from the consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) device: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="device", title="Measurement device or model of device", description=( "The measurement model of device or actual device used to produce " "observations of this type." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DeviceDefinition", "Device"], }, ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="The effective date range for the ObservationDefinition", description=( "The period during which the ObservationDefinition content was or is " "planned to be effective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="If for testing purposes, not real usage", description=( "A flag to indicate that this ObservationDefinition is authored for " "testing purposes (or education/evaluation/marketing), and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) hasMember: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="hasMember", title=( "Definitions of related resources belonging to this kind of observation" " group" ), description=( "This ObservationDefinition defines a group observation (e.g. a " "battery, a panel of tests, a set of vital sign measurements) that " "includes the target as a member of the group." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ObservationDefinition", "Questionnaire"], }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Business identifier of the ObservationDefinition", description=( "Business identifiers assigned to this ObservationDefinition. by the " "performer and/or other systems. These identifiers remain constant as " "the resource is updated and propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for this ObservationDefinition (if applicable)", description=( "A jurisdiction in which the ObservationDefinition is intended to be " "used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="Date on which the asset content was last reviewed by the publisher", description=( "The date on which the asset content was last reviewed. Review happens " "periodically after that, but doesn't change the original approval " "date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="Method used to produce the observation", description="The method or technique used to perform the observation.", json_schema_extra={ "element_property": True, }, ) multipleResultsAllowed: bool | None = Field( default=None, alias="multipleResultsAllowed", title="Multiple results allowed for conforming observations", description=( "Multiple results allowed for observations conforming to this " "ObservationDefinition." ), json_schema_extra={ "element_property": True, }, ) multipleResultsAllowed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_multipleResultsAllowed", title="Extension field for ``multipleResultsAllowed``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this ObservationDefinition (computer friendly)", description=( "A natural language name identifying the ObservationDefinition. This " "name should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) performerType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="performerType", title="Desired kind of performer for such kind of observation", description=( "The type of individual/organization/device that is expected to act " "upon instances of this definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) permittedDataType: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="permittedDataType", title=( "Quantity | CodeableConcept | string | boolean | integer | Range | " "Ratio | SampledData | time | dateTime | Period" ), description=( "The data types allowed for the value element of the instance " "observations conforming to this ObservationDefinition." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "Quantity", "CodeableConcept", "string", "boolean", "integer", "Range", "Ratio", "SampledData", "time", "dateTime", "Period", ], }, ) permittedDataType__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_permittedDataType", title="Extension field for ``permittedDataType``.", ) permittedUnit: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="permittedUnit", title="Unit for quantitative results", description=( "Units allowed for the valueQuantity element in the instance " "observations conforming to this ObservationDefinition." ), json_schema_extra={ "element_property": True, }, ) preferredReportName: fhirtypes.StringType | None = Field( default=None, alias="preferredReportName", title="The preferred name to be used when reporting the observation results", description=( "The preferred name to be used when reporting the results of " "observations conforming to this ObservationDefinition." ), json_schema_extra={ "element_property": True, }, ) preferredReportName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preferredReportName", title="Extension field for ``preferredReportName``.", ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title=( "The name of the individual or organization that published the " "ObservationDefinition" ), description=( 'Helps establish the "authority/credibility" of the ' "ObservationDefinition. May also allow for contact." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this ObservationDefinition is defined", description=( "Explains why this ObservationDefinition is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) qualifiedValue: typing.List[ fhirtypes.ObservationDefinitionQualifiedValueType ] | None = Field( default=None, alias="qualifiedValue", title="Set of qualified values for observation results", description=( "A set of qualified values associated with a context and a set of " "conditions - provides a range for quantitative and ordinal " "observations and a collection of value sets for qualitative " "observations." ), json_schema_extra={ "element_property": True, }, ) specimen: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="specimen", title="Kind of specimen used by this type of observation", description="The kind of specimen that this type of observation is produced on.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SpecimenDefinition"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description="The current state of the ObservationDefinition.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="subject", title="Type of subject for the defined observation", description=( "A code that describes the intended kind of subject of Observation " "instances conforming to this ObservationDefinition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this ObservationDefinition (human friendly)", description=( "A short, descriptive, user-friendly title for the " "ObservationDefinition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Logical canonical URL to reference this ObservationDefinition " "(globally unique)" ), description=( "An absolute URL that is used to identify this ObservationDefinition " "when it is referenced in a specification, model, design or an " "instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD " "be an address at which this ObservationDefinition is (or will be) " "published. The URL SHOULD include the major version of the " "ObservationDefinition. For more information see Technical and Business" " Versions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Content intends to support these contexts", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate ObservationDefinition " "instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the ObservationDefinition", description=( "The identifier that is used to identify this version of the " "ObservationDefinition when it is referenced in a specification, model," " design or instance. This is an arbitrary value managed by the " "ObservationDefinition author and is not expected to be globally " "unique. For example, it might be a timestamp (e.g. yyyymmdd) if a " "managed version is not available. There is also no expectation that " "versions are orderable." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ObservationDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "copyrightLabel", "approvalDate", "lastReviewDate", "effectivePeriod", "derivedFromCanonical", "derivedFromUri", "subject", "performerType", "category", "code", "permittedDataType", "multipleResultsAllowed", "bodySite", "method", "specimen", "device", "preferredReportName", "permittedUnit", "qualifiedValue", "hasMember", "component", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ObservationDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "effectivePeriod", "derivedFromCanonical", "derivedFromUri", "subject", "performerType", "category", "code", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields class ObservationDefinitionComponent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Component results. Some observations have multiple component observations, expressed as separate code value pairs. """ __resource_type__ = "ObservationDefinitionComponent" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Type of observation", description="Describes what will be observed.", json_schema_extra={ "element_property": True, }, ) permittedDataType: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="permittedDataType", title=( "Quantity | CodeableConcept | string | boolean | integer | Range | " "Ratio | SampledData | time | dateTime | Period" ), description=( "The data types allowed for the value element of the instance of this " "component observations." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "Quantity", "CodeableConcept", "string", "boolean", "integer", "Range", "Ratio", "SampledData", "time", "dateTime", "Period", ], }, ) permittedDataType__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_permittedDataType", title="Extension field for ``permittedDataType``.", ) permittedUnit: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="permittedUnit", title="Unit for quantitative results", description=( "Units allowed for the valueQuantity element in the instance " "observations conforming to this ObservationDefinition." ), json_schema_extra={ "element_property": True, }, ) qualifiedValue: typing.List[ fhirtypes.ObservationDefinitionQualifiedValueType ] | None = Field( default=None, alias="qualifiedValue", title="Set of qualified values for observation results", description=( "A set of qualified values associated with a context and a set of " "conditions - provides a range for quantitative and ordinal " "observations and a collection of value sets for qualitative " "observations." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ObservationDefinitionComponent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "permittedDataType", "permittedUnit", "qualifiedValue", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ObservationDefinitionComponent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ObservationDefinitionQualifiedValue(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Set of qualified values for observation results. A set of qualified values associated with a context and a set of conditions - provides a range for quantitative and ordinal observations and a collection of value sets for qualitative observations. """ __resource_type__ = "ObservationDefinitionQualifiedValue" abnormalCodedValueSet: fhirtypes.CanonicalType | None = Field( default=None, alias="abnormalCodedValueSet", title=( "Value set of abnormal coded values as part of this set of qualified " "values" ), description=( "The set of abnormal coded results for qualitative observations that " "match the criteria of this set of qualified values." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) abnormalCodedValueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_abnormalCodedValueSet", title="Extension field for ``abnormalCodedValueSet``.", ) age: fhirtypes.RangeType | None = Field( default=None, alias="age", title="Applicable age range for the set of qualified values", description="The age range this set of qualified values applies to.", json_schema_extra={ "element_property": True, }, ) appliesTo: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="appliesTo", title="Targetted population for the set of qualified values", description="The target population this set of qualified values applies to.", json_schema_extra={ "element_property": True, }, ) condition: fhirtypes.StringType | None = Field( default=None, alias="condition", title="Condition associated with the set of qualified values", description=( "Text based condition for which the the set of qualified values is " "valid." ), json_schema_extra={ "element_property": True, }, ) condition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_condition", title="Extension field for ``condition``." ) context: fhirtypes.CodeableConceptType | None = Field( default=None, alias="context", title="Context qualifier for the set of qualified values", description="A concept defining the context for this set of qualified values.", json_schema_extra={ "element_property": True, }, ) criticalCodedValueSet: fhirtypes.CanonicalType | None = Field( default=None, alias="criticalCodedValueSet", title=( "Value set of critical coded values as part of this set of qualified " "values" ), description=( "The set of critical coded results for qualitative observations that " "match the criteria of this set of qualified values." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) criticalCodedValueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_criticalCodedValueSet", title="Extension field for ``criticalCodedValueSet``.", ) gender: fhirtypes.CodeType | None = Field( default=None, alias="gender", title="male | female | other | unknown", description="The gender this set of qualified values applies to.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["male", "female", "other", "unknown"], }, ) gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_gender", title="Extension field for ``gender``." ) gestationalAge: fhirtypes.RangeType | None = Field( default=None, alias="gestationalAge", title="Applicable gestational age range for the set of qualified values", description="The gestational age this set of qualified values applies to.", json_schema_extra={ "element_property": True, }, ) normalCodedValueSet: fhirtypes.CanonicalType | None = Field( default=None, alias="normalCodedValueSet", title=( "Value set of normal coded values as part of this set of qualified " "values" ), description=( "The set of normal coded results for qualitative observations that " "match the criteria of this set of qualified values." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) normalCodedValueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_normalCodedValueSet", title="Extension field for ``normalCodedValueSet``.", ) range: fhirtypes.RangeType | None = Field( default=None, alias="range", title="The range for continuous or ordinal observations", description=( "The range of values defined for continuous or ordinal observations " "that match the criteria of this set of qualified values." ), json_schema_extra={ "element_property": True, }, ) rangeCategory: fhirtypes.CodeType | None = Field( default=None, alias="rangeCategory", title="reference | critical | absolute", description=( "The category of range of values for continuous or ordinal observations" " that match the criteria of this set of qualified values." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["reference", "critical", "absolute"], }, ) rangeCategory__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rangeCategory", title="Extension field for ``rangeCategory``.", ) validCodedValueSet: fhirtypes.CanonicalType | None = Field( default=None, alias="validCodedValueSet", title=( "Value set of valid coded values as part of this set of qualified " "values" ), description=( "The set of valid coded results for qualitative observations that " "match the criteria of this set of qualified values." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) validCodedValueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_validCodedValueSet", title="Extension field for ``validCodedValueSet``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ObservationDefinitionQualifiedValue`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "context", "appliesTo", "gender", "age", "gestationalAge", "condition", "rangeCategory", "range", "validCodedValueSet", "normalCodedValueSet", "abnormalCodedValueSet", "criticalCodedValueSet", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ObservationDefinitionQualifiedValue`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/operationdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/OperationDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class OperationDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of an operation or a named query. A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). """ __resource_type__ = "OperationDefinition" affectsState: bool | None = Field( default=None, alias="affectsState", title="Whether content is changed by the operation", description=( "Whether the operation affects state. Side effects such as producing " "audit trail entries do not count as 'affecting state'." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) affectsState__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_affectsState", title="Extension field for ``affectsState``.", ) base: fhirtypes.CanonicalType | None = Field( default=None, alias="base", title="Marks this as a profile of the base", description=( "Indicates that this operation definition is a constraining profile on " "the base." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["OperationDefinition"], }, ) base__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_base", title="Extension field for ``base``." ) code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Recommended name for operation in search url", description=( "The label that is recommended to be used in the URL for this " "operation. In some cases, servers may need to use a different " "CapabilityStatement operation.name to differentiate between multiple " "SearchParameters that happen to have the same code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) comment: fhirtypes.MarkdownType | None = Field( default=None, alias="comment", title="Additional information about use", description="Additional information about how to use this operation or named query.", json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the operation definition and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the operation definition." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the operation definition was last" " significantly changed. The date must change when the business version" " changes and it must change if the status code changes. In addition, " "it should change when the substantive content of the operation " "definition changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the operation definition", description=( "A free text natural language description of the operation definition " "from a consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this operation definition is authored" " for testing purposes (or education/evaluation/marketing) and is not " "intended for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title=( "Additional identifier for the implementation guide (business " "identifier)" ), description=( "A formal identifier that is used to identify this implementation guide" " when it is represented in other formats, or referenced in a " "specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) inputProfile: fhirtypes.CanonicalType | None = Field( default=None, alias="inputProfile", title="Validation information for in parameters", description=( "Additional validation information for the in parameters - a single " "profile that covers all the parameters. The profile is a constraint on" " the parameters resource as a whole." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) inputProfile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_inputProfile", title="Extension field for ``inputProfile``.", ) instance: bool | None = Field( default=None, alias="instance", title="Invoke on an instance?", description=( "Indicates whether this operation can be invoked on a particular " "instance of one of the given types." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) instance__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instance", title="Extension field for ``instance``." ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for operation definition (if applicable)", description=( "A legal or geographic region in which the operation definition is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title="operation | query", description="Whether this is an operation or a named query.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["operation", "query"], }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this operation definition (computer friendly)", description=( "A natural language name identifying the operation definition. This " "name should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) outputProfile: fhirtypes.CanonicalType | None = Field( default=None, alias="outputProfile", title="Validation information for out parameters", description=( "Additional validation information for the out parameters - a single " "profile that covers all the parameters. The profile is a constraint on" " the parameters resource." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) outputProfile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_outputProfile", title="Extension field for ``outputProfile``.", ) overload: typing.List[fhirtypes.OperationDefinitionOverloadType] | None = Field( default=None, alias="overload", title="Define overloaded variants for when generating code", description=( "Defines an appropriate combination of parameters to use when invoking " "this operation, to help code generators when generating overloaded " "parameter sets for this operation." ), json_schema_extra={ "element_property": True, }, ) parameter: typing.List[fhirtypes.OperationDefinitionParameterType] | None = Field( default=None, alias="parameter", title="Parameters for the operation/query", description="The parameters for the operation/query.", json_schema_extra={ "element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the operation definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this operation definition is defined", description=( "Explanation of why this operation definition is needed and why it has " "been designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) resource: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="resource", title="Types this operation applies to", description="The types on which this operation can be executed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) resource__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_resource", title="Extension field for ``resource``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description="The current state of this operation definition.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) system: bool | None = Field( default=None, alias="system", title="Invoke at the system level?", description=( "Indicates whether this operation or named query can be invoked at the " "system level (e.g. without needing to choose a resource type for the " "context)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this operation definition (human friendly)", description=( "A short, descriptive, user-friendly title for the operation " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) type: bool | None = Field( default=None, alias="type", title="Invoke at the type level?", description=( "Indicates whether this operation or named query can be invoked at the " "resource type level for any given resource type level (e.g. without " "needing to choose a specific resource id for the context)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this operation definition, represented as an " "absolute URI (globally unique)" ), description=( "An absolute URI that is used to identify this operation definition " "when it is referenced in a specification, model, design or an " "instance; also called its canonical identifier. This SHOULD be " "globally unique and SHOULD be a literal address at which an " "authoritative instance of this operation definition is (or will be) " "published. This URL can be the target of a canonical reference. It " "SHALL remain the same when the operation definition is stored on " "different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate operation definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the operation definition", description=( "The identifier that is used to identify this version of the operation " "definition when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the operation " "definition author and is not expected to be globally unique. For " "example, it might be a timestamp (e.g. yyyymmdd) if a managed version " "is not available. There is also no expectation that versions can be " "placed in a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OperationDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "kind", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "copyrightLabel", "affectsState", "code", "comment", "base", "resource", "system", "type", "instance", "inputProfile", "outputProfile", "parameter", "overload", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OperationDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "kind", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "affectsState", "code", "base", "resource", "system", "type", "instance", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("code", "code__ext"), ("instance", "instance__ext"), ("kind", "kind__ext"), ("name", "name__ext"), ("status", "status__ext"), ("system", "system__ext"), ("type", "type__ext"), ] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields class OperationDefinitionOverload(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Define overloaded variants for when generating code. Defines an appropriate combination of parameters to use when invoking this operation, to help code generators when generating overloaded parameter sets for this operation. """ __resource_type__ = "OperationDefinitionOverload" comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Comments to go on overload", description=None, json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) parameterName: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="parameterName", title="Name of parameter to include in overload", description=None, json_schema_extra={ "element_property": True, }, ) parameterName__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_parameterName", title="Extension field for ``parameterName``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OperationDefinitionOverload`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "parameterName", "comment"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OperationDefinitionOverload`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class OperationDefinitionParameter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Parameters for the operation/query. The parameters for the operation/query. """ __resource_type__ = "OperationDefinitionParameter" allowedType: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="allowedType", title="Allowed sub-type this parameter can have (if type is abstract)", description=( "Support for polymorphic types. If the parameter type is abstract, this" " element lists allowed sub-types for the parameter." ), json_schema_extra={ "element_property": True, }, ) allowedType__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_allowedType", title="Extension field for ``allowedType``." ) binding: fhirtypes.OperationDefinitionParameterBindingType | None = Field( default=None, alias="binding", title="ValueSet details if this is coded", description=( "Binds to a value set if this parameter is coded (code, Coding, " "CodeableConcept)." ), json_schema_extra={ "element_property": True, }, ) documentation: fhirtypes.MarkdownType | None = Field( default=None, alias="documentation", title="Description of meaning/use", description="Describes the meaning or use of this parameter.", json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) max: fhirtypes.StringType | None = Field( default=None, alias="max", title="Maximum Cardinality (a number or *)", description=( "The maximum number of times this element is permitted to appear in the" " request or response." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_max", title="Extension field for ``max``." ) min: fhirtypes.IntegerType | None = Field( default=None, alias="min", title="Minimum Cardinality", description=( "The minimum number of times this parameter SHALL appear in the request" " or response." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_min", title="Extension field for ``min``." ) name: fhirtypes.CodeType | None = Field( default=None, alias="name", title="Name in Parameters.parameter.name or in URL", description="The name of used to identify the parameter.", json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) part: typing.List[fhirtypes.OperationDefinitionParameterType] | None = Field( default=None, alias="part", title="Parts of a nested Parameter", description="The parts of a nested Parameter.", json_schema_extra={ "element_property": True, }, ) referencedFrom: typing.List[ fhirtypes.OperationDefinitionParameterReferencedFromType ] | None = Field( default=None, alias="referencedFrom", title="References to this parameter", description=( "Identifies other resource parameters within the operation invocation " "that are expected to resolve to this resource." ), json_schema_extra={ "element_property": True, }, ) scope: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="scope", title="instance | type | system", description=( "If present, indicates that the parameter applies when the operation is" " being invoked at the specified level." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["instance", "type", "system"], }, ) scope__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_scope", title="Extension field for ``scope``." ) searchType: fhirtypes.CodeType | None = Field( default=None, alias="searchType", title=( "number | date | string | token | reference | composite | quantity | " "uri | special" ), description=( "How the parameter is understood if/when it used as search parameter. " "This is only used if the parameter is a string." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "number", "date", "string", "token", "reference", "composite", "quantity", "uri", "special", ], }, ) searchType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_searchType", title="Extension field for ``searchType``." ) targetProfile: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="targetProfile", title=( "If type is Reference | canonical, allowed targets. If type is " "'Resource', then this constrains the allowed resource types" ), description=( 'Used when the type is "Reference" or "canonical", and identifies a ' "profile structure or implementation Guide that applies to the target " "of the reference this parameter refers to. If any profiles are " "specified, then the content must conform to at least one of them. The " "URL can be a local reference - to a contained StructureDefinition, or " "a reference to another StructureDefinition or Implementation Guide by " "a canonical URL. When an implementation guide is specified, the target" " resource SHALL conform to at least one profile defined in the " "implementation guide." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) targetProfile__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_targetProfile", title="Extension field for ``targetProfile``.", ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="What type this parameter has", description="The type for this parameter.", json_schema_extra={ "element_property": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="in | out", description="Whether this is an input or an output parameter.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["in", "out"], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OperationDefinitionParameter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "use", "scope", "min", "max", "documentation", "type", "allowedType", "targetProfile", "searchType", "binding", "referencedFrom", "part", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OperationDefinitionParameter`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("max", "max__ext"), ("min", "min__ext"), ("name", "name__ext"), ("use", "use__ext"), ] return required_fields class OperationDefinitionParameterBinding(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. ValueSet details if this is coded. Binds to a value set if this parameter is coded (code, Coding, CodeableConcept). """ __resource_type__ = "OperationDefinitionParameterBinding" strength: fhirtypes.CodeType | None = Field( default=None, alias="strength", title="required | extensible | preferred | example", description=( "Indicates the degree of conformance expectations associated with this " "binding - that is, the degree to which the provided value set must be " "adhered to in the instances." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["required", "extensible", "preferred", "example"], }, ) strength__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_strength", title="Extension field for ``strength``." ) valueSet: fhirtypes.CanonicalType | None = Field( default=None, alias="valueSet", title="Source of value set", description=( "Points to the value set or external definition (e.g. implicit value " "set) that identifies the set of codes to be used." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueSet", title="Extension field for ``valueSet``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OperationDefinitionParameterBinding`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "strength", "valueSet"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OperationDefinitionParameterBinding`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("strength", "strength__ext"), ("valueSet", "valueSet__ext")] return required_fields class OperationDefinitionParameterReferencedFrom(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. References to this parameter. Identifies other resource parameters within the operation invocation that are expected to resolve to this resource. """ __resource_type__ = "OperationDefinitionParameterReferencedFrom" source: fhirtypes.StringType | None = Field( default=None, alias="source", title="Referencing parameter", description=( "The name of the parameter or dot-separated path of parameter names " "pointing to the resource parameter that is expected to contain a " "reference to this resource." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_source", title="Extension field for ``source``." ) sourceId: fhirtypes.StringType | None = Field( default=None, alias="sourceId", title="Element id of reference", description=( "The id of the element in the referencing resource that is expected to " "resolve to this resource." ), json_schema_extra={ "element_property": True, }, ) sourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceId", title="Extension field for ``sourceId``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OperationDefinitionParameterReferencedFrom`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "source", "sourceId"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OperationDefinitionParameterReferencedFrom`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("source", "source__ext")] return required_fields ================================================ FILE: fhir/resources/operationoutcome.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/OperationOutcome Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class OperationOutcome(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about the success/failure of an action. A collection of error, warning, or information messages that result from a system action. """ __resource_type__ = "OperationOutcome" issue: typing.List[fhirtypes.OperationOutcomeIssueType] = Field( default=..., alias="issue", title="A single issue associated with the action", description=( "An error, warning, or information message that results from a system " "action." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OperationOutcome`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "issue", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OperationOutcome`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "modifierExtension", "issue"] class OperationOutcomeIssue(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A single issue associated with the action. An error, warning, or information message that results from a system action. """ __resource_type__ = "OperationOutcomeIssue" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Error or warning code", description=( "Describes the type of the issue. The system that creates an " "OperationOutcome SHALL choose the most applicable code from the " "IssueType value set, and may additional provide its own code for the " "error in the details element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) details: fhirtypes.CodeableConceptType | None = Field( default=None, alias="details", title="Additional details about the error", description=( "Additional details about the error. This may be a text description of " "the error or a system code that identifies the error." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) diagnostics: fhirtypes.StringType | None = Field( default=None, alias="diagnostics", title="Additional diagnostic information about the issue", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) diagnostics__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_diagnostics", title="Extension field for ``diagnostics``." ) expression: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="expression", title="FHIRPath of element(s) related to issue", description=( "A [simple subset of FHIRPath](fhirpath.html#simple) limited to element" " names, repetition indicators and the default child accessor that " "identifies one of the elements in the resource that caused this issue " "to be raised." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) expression__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) location: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="location", title="Deprecated: Path of element(s) related to issue", description=( "This element is deprecated because it is XML specific. It is replaced " "by issue.expression, which is format independent, and simpler to " "parse. For resource issues, this will be a simple XPath limited to " "element names, repetition indicators and the default child accessor " "that identifies one of the elements in the resource that caused this " 'issue to be raised. For HTTP errors, will be "http." + the parameter ' "name." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) location__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_location", title="Extension field for ``location``." ) severity: fhirtypes.CodeType | None = Field( default=None, alias="severity", title="fatal | error | warning | information | success", description=( "Indicates whether the issue indicates a variation from successful " "processing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["fatal", "error", "warning", "information", "success"], }, ) severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_severity", title="Extension field for ``severity``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OperationOutcomeIssue`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "severity", "code", "details", "diagnostics", "location", "expression", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OperationOutcomeIssue`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "severity", "code", "details", "diagnostics", "location", "expression", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext"), ("severity", "severity__ext")] return required_fields ================================================ FILE: fhir/resources/organization.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Organization Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Organization(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A grouping of people or organizations with a common purpose. A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, payer/insurer, etc. """ __resource_type__ = "Organization" active: bool | None = Field( default=None, alias="active", title="Whether the organization's record is still in active use", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) alias: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="alias", title=( "A list of alternate names that the organization is known as, or was " "known as in the past" ), description=None, json_schema_extra={ "element_property": True, }, ) alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_alias", title="Extension field for ``alias``." ) contact: typing.List[fhirtypes.ExtendedContactDetailType] | None = Field( default=None, alias="contact", title="Official contact details for the Organization", description=( "The contact details of communication devices available relevant to the" " specific Organization. This can include addresses, phone numbers, fax" " numbers, mobile numbers, email addresses and web sites." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title=( "Additional details about the Organization that could be displayed as " "further information to identify the Organization beyond its name" ), description=( "Description of the organization, which helps provide additional " "general context on the organization to ensure that the correct " "organization is selected." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title=( "Technical endpoints providing access to services operated for the " "organization" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifies this organization across multiple systems", description=( "Identifier for the organization that is used to identify the " "organization across multiple disparate systems." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name used for the organization", description="A name associated with the organization.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) partOf: fhirtypes.ReferenceType | None = Field( default=None, alias="partOf", title="The organization of which this organization forms a part", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) qualification: typing.List[fhirtypes.OrganizationQualificationType] | None = Field( default=None, alias="qualification", title=( "Qualifications, certifications, accreditations, licenses, training, " "etc. pertaining to the provision of care" ), description=( "The official certifications, accreditations, training, designations " "and licenses that authorize and/or otherwise endorse the provision of " "care by the organization. For example, an approval to provide a type " "of services issued by a certifying body (such as the US Joint " "Commission) to an organization." ), json_schema_extra={ "element_property": True, }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Kind of organization", description="The kind(s) of organization that this is.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Organization`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "type", "name", "alias", "description", "contact", "partOf", "endpoint", "qualification", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Organization`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "active", "type", "name", "description", "partOf", ] class OrganizationQualification(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Qualifications, certifications, accreditations, licenses, training, etc. pertaining to the provision of care. The official certifications, accreditations, training, designations and licenses that authorize and/or otherwise endorse the provision of care by the organization. For example, an approval to provide a type of services issued by a certifying body (such as the US Joint Commission) to an organization. """ __resource_type__ = "OrganizationQualification" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Coded representation of the qualification", description=None, json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="An identifier for this qualification for the organization", description="An identifier allocated to this qualification for this organization.", json_schema_extra={ "element_property": True, }, ) issuer: fhirtypes.ReferenceType | None = Field( default=None, alias="issuer", title="Organization that regulates and issues the qualification", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Period during which the qualification is valid", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OrganizationQualification`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "code", "period", "issuer", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OrganizationQualification`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/organizationaffiliation.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/OrganizationAffiliation Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class OrganizationAffiliation(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Defines an affiliation/association/relationship between 2 distinct organizations, that is not a part-of relationship/sub-division relationship. """ __resource_type__ = "OrganizationAffiliation" active: bool | None = Field( default=None, alias="active", title="Whether this organization affiliation record is in active use", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) code: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="code", title="Definition of the role the participatingOrganization plays", description=( "Definition of the role the participatingOrganization plays in the " "association." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ExtendedContactDetailType] | None = Field( default=None, alias="contact", title=( "Official contact details at the participatingOrganization relevant to " "this Affiliation" ), description=( "The contact details of communication devices available at the " "participatingOrganization relevant to this Affiliation." ), json_schema_extra={ "element_property": True, }, ) endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title=( "Technical endpoints providing access to services operated for this " "role" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) healthcareService: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="healthcareService", title="Healthcare services provided through the role", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["HealthcareService"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifiers that are specific to this role", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) location: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="location", title="The location(s) at which the role occurs", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) network: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="network", title=( "The network in which the participatingOrganization provides the role's" " services (if defined) at the indicated locations (if defined)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) organization: fhirtypes.ReferenceType | None = Field( default=None, alias="organization", title="Organization where the role is available", description=( "Organization where the role is available (primary organization/has " "members)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) participatingOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="participatingOrganization", title=( "Organization that provides/performs the role (e.g. providing services " "or is a member of)" ), description=( "The Participating Organization provides/performs the role(s) defined " "by the code to the Primary Organization (e.g. providing services or is" " a member of)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title=( "The period during which the participatingOrganization is affiliated " "with the primary organization" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialty", title=( "Specific specialty of the participatingOrganization in the context of " "the role" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``OrganizationAffiliation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "period", "organization", "participatingOrganization", "network", "code", "specialty", "location", "healthcareService", "contact", "endpoint", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``OrganizationAffiliation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "active", "period", "organization", "participatingOrganization", "network", "code", "specialty", "location", ] ================================================ FILE: fhir/resources/packagedproductdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/PackagedProductDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class PackagedProductDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A medically related item or items, in a container or package. """ __resource_type__ = "PackagedProductDefinition" attachedDocument: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="attachedDocument", title=( "Additional information or supporting documentation about the packaged " "product" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) characteristic: typing.List[ fhirtypes.PackagedProductDefinitionPackagingPropertyType ] | None = Field( default=None, alias="characteristic", title=( 'Allows the key features to be recorded, such as "hospital pack", ' '"nurse prescribable"' ), description=( 'Allows the key features to be recorded, such as "hospital pack", ' '"nurse prescribable", "calendar pack".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) containedItemQuantity: typing.List[fhirtypes.QuantityType] | None = Field( default=None, alias="containedItemQuantity", title=( "A total of the complete count of contained items of a particular " "type/form, independent of sub-packaging or organization. This can be " "considered as the pack size. See also packaging.containedItem.amount " "(especially the long definition)" ), description=( "A total of the complete count of contained items of a particular " "type/form, independent of sub-packaging or organization. This can be " "considered as the pack size. This attribute differs from " "containedItem.amount in that it can give a single aggregated count of " "all tablet types in a pack, even when these are different manufactured" " items. For example a pill pack of 21 tablets plus 7 sugar tablets, " "can be denoted here as '28 tablets'. This attribute is repeatable so " "that the different item types in one pack type can be counted (e.g. a " "count of vials and count of syringes). Each repeat must have different" " units, so that it is clear what the different sets of counted items " "are, and it is not intended to allow different counts of similar items" " (e.g. not '2 tubes and 3 tubes'). Repeats are not to be used to " "represent different pack sizes (e.g. 20 pack vs. 50 pack) - which " "would be different instances of this resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copackagedIndicator: bool | None = Field( default=None, alias="copackagedIndicator", title=( "Identifies if the drug product is supplied with another item such as a" " diluent or adjuvant" ), description=( "Identifies if the package contains different items, such as when a " "drug product is supplied with another item e.g. a diluent or adjuvant." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copackagedIndicator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copackagedIndicator", title="Extension field for ``copackagedIndicator``.", ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title=( "Textual description. Note that this is not the name of the package or " "product" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title=( "A unique identifier for this package as whole - not for the content of" " the package" ), description=( "A unique identifier for this package as whole - not the the content of" " the package. Unique instance identifiers assigned to a package by " "manufacturers, regulators, drug catalogue custodians or other " "organizations." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) legalStatusOfSupply: typing.List[ fhirtypes.PackagedProductDefinitionLegalStatusOfSupplyType ] | None = Field( default=None, alias="legalStatusOfSupply", title=( "The legal status of supply of the packaged item as classified by the " "regulator" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) manufacturer: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="manufacturer", title=( "Manufacturer of this package type (multiple means these are all " "possible manufacturers)" ), description=( "Manufacturer of this package type. When there are multiple it means " "these are all possible manufacturers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) marketingStatus: typing.List[fhirtypes.MarketingStatusType] | None = Field( default=None, alias="marketingStatus", title=( "Allows specifying that an item is on the market for sale, or that it " "is not available, and the dates and locations associated" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title=( "A name for this package. Typically as listed in a drug formulary, " "catalogue, inventory etc" ), description=( "A name for this package. Typically what it would be listed as in a " "drug formulary or catalogue, inventory etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) packageFor: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="packageFor", title="The product that this is a pack for", description=( "The product this package model relates to, not the contents of the " "package (for which see package.containedItem)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["MedicinalProductDefinition"], }, ) packaging: fhirtypes.PackagedProductDefinitionPackagingType | None = Field( default=None, alias="packaging", title=( "A packaging item, as a container for medically related items, possibly" " with other packaging items within, or a packaging component, such as " "bottle cap" ), description=( "A packaging item, as a container for medically related items, possibly" " with other packaging items within, or a packaging component, such as " "bottle cap (which is not a device or a medication manufactured item)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeableConceptType | None = Field( default=None, alias="status", title=( "The status within the lifecycle of this item. High level - not " "intended to duplicate details elsewhere e.g. legal status, or " "authorization/marketing status" ), description=( "The status within the lifecycle of this item. A high level status, " "this is not intended to duplicate details carried elsewhere such as " "legal status, or authorization or marketing status." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) statusDate: fhirtypes.DateTimeType | None = Field( default=None, alias="statusDate", title="The date at which the given status became applicable", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_statusDate", title="Extension field for ``statusDate``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title=( "A high level category e.g. medicinal product, raw material, shipping " "container etc" ), description=( "A high level category e.g. medicinal product, raw material, " "shipping/transport container, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PackagedProductDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "name", "type", "packageFor", "status", "statusDate", "containedItemQuantity", "description", "legalStatusOfSupply", "marketingStatus", "copackagedIndicator", "manufacturer", "attachedDocument", "packaging", "characteristic", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PackagedProductDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "name", "type", "packageFor", "status", "statusDate", "containedItemQuantity", "description", "legalStatusOfSupply", "marketingStatus", "copackagedIndicator", "manufacturer", "attachedDocument", "packaging", "characteristic", ] class PackagedProductDefinitionLegalStatusOfSupply(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The legal status of supply of the packaged item as classified by the regulator. """ __resource_type__ = "PackagedProductDefinitionLegalStatusOfSupply" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title=( "The actual status of supply. In what situation this package type may " "be supplied for use" ), description=( "The actual status of supply. Conveys in what situation this package " "type may be supplied for use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: fhirtypes.CodeableConceptType | None = Field( default=None, alias="jurisdiction", title="The place where the legal status of supply applies", description=( "The place where the legal status of supply applies. When not " "specified, this indicates it is unknown in this context." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PackagedProductDefinitionLegalStatusOfSupply`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "jurisdiction"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PackagedProductDefinitionLegalStatusOfSupply`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "jurisdiction"] class PackagedProductDefinitionPackaging(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A packaging item, as a container for medically related items, possibly with other packaging items within, or a packaging component, such as bottle cap. A packaging item, as a container for medically related items, possibly with other packaging items within, or a packaging component, such as bottle cap (which is not a device or a medication manufactured item). """ __resource_type__ = "PackagedProductDefinitionPackaging" alternateMaterial: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="alternateMaterial", title=( "A possible alternate material for this part of the packaging, that is " "allowed to be used instead of the usual material" ), description=( "A possible alternate material for this part of the packaging, that is " "allowed to be used instead of the usual material (e.g. different types" " of plastic for a blister sleeve)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) componentPart: bool | None = Field( default=None, alias="componentPart", title=( "Is this a part of the packaging (e.g. a cap or bottle stopper), rather" " than the packaging itself (e.g. a bottle or vial)" ), description=( "Is this a part of the packaging (e.g. a cap or bottle stopper), rather" " than the packaging itself (e.g. a bottle or vial). The latter type " "are designed be a container, but the former are not." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) componentPart__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_componentPart", title="Extension field for ``componentPart``.", ) containedItem: typing.List[ fhirtypes.PackagedProductDefinitionPackagingContainedItemType ] | None = Field( default=None, alias="containedItem", title="The item(s) within the packaging", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title=( "An identifier that is specific to this particular part of the " "packaging. Including possibly a Data Carrier Identifier" ), description=( "A business identifier that is specific to this particular part of the " "packaging, often assigned by the manufacturer. Including possibly Data" " Carrier Identifier (a GS1 barcode)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) manufacturer: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="manufacturer", title=( "Manufacturer of this packaging item (multiple means these are all " "potential manufacturers)" ), description=( "Manufacturer of this packaging item. When there are multiple values " "each one is a potential manufacturer of this packaging item." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) material: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="material", title="Material type of the package item", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) packaging: typing.List[ fhirtypes.PackagedProductDefinitionPackagingType ] | None = Field( default=None, alias="packaging", title=( "Allows containers (and parts of containers) within containers, still " "as a part of single packaged product" ), description=( "Allows containers (and parts of containers) within containers, still " "as a part of a single packaged product. See also PackagedProductDefini" "tion.packaging.containedItem.item(PackagedProductDefinition)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) property: typing.List[ fhirtypes.PackagedProductDefinitionPackagingPropertyType ] | None = Field( default=None, alias="property", title="General characteristics of this item", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) quantity: fhirtypes.IntegerType | None = Field( default=None, alias="quantity", title=( "The quantity of this level of packaging in the package that contains " "it (with the outermost level being 1)" ), description=( "The quantity of packaging items contained at this layer of the " "package. This does not relate to the number of contained items but " "relates solely to the number of packaging items. When looking at the " "outermost layer it is always 1. If there are two boxes within, at the " "next layer it would be 2." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) quantity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_quantity", title="Extension field for ``quantity``." ) shelfLifeStorage: typing.List[fhirtypes.ProductShelfLifeType] | None = Field( default=None, alias="shelfLifeStorage", title="Shelf Life and storage information", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The physical type of the container of the items", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PackagedProductDefinitionPackaging`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "type", "componentPart", "quantity", "material", "alternateMaterial", "shelfLifeStorage", "manufacturer", "property", "containedItem", "packaging", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PackagedProductDefinitionPackaging`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "identifier", "type", "componentPart", "quantity", "material", "alternateMaterial", "shelfLifeStorage", "manufacturer", "property", "containedItem", "packaging", ] class PackagedProductDefinitionPackagingContainedItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The item(s) within the packaging. """ __resource_type__ = "PackagedProductDefinitionPackagingContainedItem" amount: fhirtypes.QuantityType | None = Field( default=None, alias="amount", title=( "The number of this type of item within this packaging or for " "continuous items such as liquids it is the quantity (for example " "25ml). See also PackagedProductDefinition.containedItemQuantity " "(especially the long definition)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) item: fhirtypes.CodeableReferenceType = Field( default=..., alias="item", title=( "The actual item(s) of medication, as manufactured, or a device, or " "other medically related item (food, biologicals, raw materials, " "medical fluids, gases etc.), as contained in the package" ), description=( "The actual item(s) of medication, as manufactured, or a device " "(typically, but not necessarily, a co-packaged one), or other " "medically related item (such as food, biologicals, raw materials, " "medical fluids, gases etc.), as contained in the package. This also " "allows another whole packaged product to be included, which is solely " "for the case where a package of other entire packages is wanted - such" " as a wholesale or distribution pack (for layers within one package, " "use PackagedProductDefinition.packaging.packaging)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "ManufacturedItemDefinition", "DeviceDefinition", "PackagedProductDefinition", "BiologicallyDerivedProduct", "NutritionProduct", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PackagedProductDefinitionPackagingContainedItem`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "item", "amount"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PackagedProductDefinitionPackagingContainedItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "item", "amount"] class PackagedProductDefinitionPackagingProperty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. General characteristics of this item. """ __resource_type__ = "PackagedProductDefinitionPackagingProperty" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="A code expressing the type of characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="A value for the characteristic", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PackagedProductDefinitionPackagingProperty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueCodeableConcept", "valueQuantity", "valueDate", "valueBoolean", "valueAttachment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PackagedProductDefinitionPackagingProperty`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "valueCodeableConcept", "valueQuantity", "valueDate", "valueBoolean", "valueAttachment", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueBoolean", "valueCodeableConcept", "valueDate", "valueQuantity", ] } return one_of_many_fields ================================================ FILE: fhir/resources/parameterdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ParameterDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class ParameterDefinition(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of a parameter to a module. The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse. """ __resource_type__ = "ParameterDefinition" documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="A brief description of the parameter", description=( "A brief discussion of what the parameter is for and how it is used by " "the module." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) max: fhirtypes.StringType | None = Field( default=None, alias="max", title="Maximum cardinality (a number of *)", description=( "The maximum number of times this element is permitted to appear in the" " request or response." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_max", title="Extension field for ``max``." ) min: fhirtypes.IntegerType | None = Field( default=None, alias="min", title="Minimum cardinality", description=( "The minimum number of times this parameter SHALL appear in the request" " or response." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_min", title="Extension field for ``min``." ) name: fhirtypes.CodeType | None = Field( default=None, alias="name", title="Name used to access the parameter value", description=( "The name of the parameter used to allow access to the value of the " "parameter in evaluation contexts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) profile: fhirtypes.CanonicalType | None = Field( default=None, alias="profile", title="What profile the value is expected to be", description=( "If specified, this indicates a profile that the input data must " "conform to, or that the output data will conform to." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="What type of value", description="The type of the parameter.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) use: fhirtypes.CodeType | None = Field( default=None, alias="use", title="in | out", description="Whether the parameter is input or output for the module.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["in", "out"], }, ) use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_use", title="Extension field for ``use``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ParameterDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "name", "use", "min", "max", "documentation", "type", "profile", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ParameterDefinition`` according to specification, with preserving the original sequence order. """ return ["name", "use", "min", "max", "documentation", "type", "profile"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext"), ("use", "use__ext")] return required_fields ================================================ FILE: fhir/resources/parameters.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Parameters Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, fhirtypes, resource class Parameters(resource.Resource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Operation Request or Response. This resource is used to pass information into and back from an operation (whether invoked directly from REST or within a messaging environment). It is not persisted or allowed to be referenced by other resources. """ __resource_type__ = "Parameters" parameter: typing.List[fhirtypes.ParametersParameterType] | None = Field( default=None, alias="parameter", title="Operation Parameter", description="A parameter passed to or received from the operation.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Parameters`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "language", "parameter"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Parameters`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "parameter"] class ParametersParameter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Operation Parameter. A parameter passed to or received from the operation. """ __resource_type__ = "ParametersParameter" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name from the definition", description="The name of the parameter (reference to the operation definition).", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) part: typing.List[fhirtypes.ParametersParameterType] | None = Field( default=None, alias="part", title="Named part of a multi-part parameter", description="A named part of a multi-part parameter.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) resource: fhirtypes.ResourceType | None = Field( default=None, alias="resource", title="If parameter is a whole resource", description="Conveys the content if the parameter is a whole resource.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueAddress: fhirtypes.AddressType | None = Field( default=None, alias="valueAddress", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueAge: fhirtypes.AgeType | None = Field( default=None, alias="valueAge", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="valueAnnotation", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueAvailability: fhirtypes.AvailabilityType | None = Field( default=None, alias="valueAvailability", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="valueBase64Binary", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBase64Binary", title="Extension field for ``valueBase64Binary``.", ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="valueCanonical", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCanonical", title="Extension field for ``valueCanonical``.", ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCodeableReference: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="valueCodeableReference", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueContactDetail: fhirtypes.ContactDetailType | None = Field( default=None, alias="valueContactDetail", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="valueContactPoint", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCount: fhirtypes.CountType | None = Field( default=None, alias="valueCount", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDataRequirement: fhirtypes.DataRequirementType | None = Field( default=None, alias="valueDataRequirement", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueDistance: fhirtypes.DistanceType | None = Field( default=None, alias="valueDistance", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDosage: fhirtypes.DosageType | None = Field( default=None, alias="valueDosage", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDuration: fhirtypes.DurationType | None = Field( default=None, alias="valueDuration", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueExpression: fhirtypes.ExpressionType | None = Field( default=None, alias="valueExpression", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueExtendedContactDetail: fhirtypes.ExtendedContactDetailType | None = Field( default=None, alias="valueExtendedContactDetail", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="valueHumanName", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueId: fhirtypes.IdType | None = Field( default=None, alias="valueId", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueId", title="Extension field for ``valueId``." ) valueIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="valueIdentifier", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInstant: fhirtypes.InstantType | None = Field( default=None, alias="valueInstant", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInstant", title="Extension field for ``valueInstant``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueInteger64: fhirtypes.Integer64Type | None = Field( default=None, alias="valueInteger64", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInteger64__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger64", title="Extension field for ``valueInteger64``.", ) valueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="valueMarkdown", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueMarkdown", title="Extension field for ``valueMarkdown``.", ) valueMeta: fhirtypes.MetaType | None = Field( default=None, alias="valueMeta", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueMoney: fhirtypes.MoneyType | None = Field( default=None, alias="valueMoney", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueOid: fhirtypes.OidType | None = Field( default=None, alias="valueOid", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueOid", title="Extension field for ``valueOid``." ) valueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field( default=None, alias="valueParameterDefinition", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="valuePositiveInt", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valuePositiveInt", title="Extension field for ``valuePositiveInt``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRatioRange: fhirtypes.RatioRangeType | None = Field( default=None, alias="valueRatioRange", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field( default=None, alias="valueRelatedArtifact", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="valueSampledData", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueSignature: fhirtypes.SignatureType | None = Field( default=None, alias="valueSignature", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) valueTiming: fhirtypes.TimingType | None = Field( default=None, alias="valueTiming", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field( default=None, alias="valueTriggerDefinition", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="valueUnsignedInt", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUnsignedInt", title="Extension field for ``valueUnsignedInt``.", ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) valueUrl: fhirtypes.UrlType | None = Field( default=None, alias="valueUrl", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUrl", title="Extension field for ``valueUrl``." ) valueUsageContext: fhirtypes.UsageContextType | None = Field( default=None, alias="valueUsageContext", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUuid: fhirtypes.UuidType | None = Field( default=None, alias="valueUuid", title="If parameter is a data type", description="Conveys the content if the parameter is a data type.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUuid", title="Extension field for ``valueUuid``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ParametersParameter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInstant", "valueInteger", "valueInteger64", "valueMarkdown", "valueOid", "valuePositiveInt", "valueString", "valueTime", "valueUnsignedInt", "valueUri", "valueUrl", "valueUuid", "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueCodeableConcept", "valueCodeableReference", "valueCoding", "valueContactPoint", "valueCount", "valueDistance", "valueDuration", "valueHumanName", "valueIdentifier", "valueMoney", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueRatioRange", "valueReference", "valueSampledData", "valueSignature", "valueTiming", "valueContactDetail", "valueDataRequirement", "valueExpression", "valueParameterDefinition", "valueRelatedArtifact", "valueTriggerDefinition", "valueUsageContext", "valueAvailability", "valueExtendedContactDetail", "valueDosage", "valueMeta", "resource", "part", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ParametersParameter`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "name", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInstant", "valueInteger", "valueInteger64", "valueMarkdown", "valueOid", "valuePositiveInt", "valueString", "valueTime", "valueUnsignedInt", "valueUri", "valueUrl", "valueUuid", "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueCodeableConcept", "valueCodeableReference", "valueCoding", "valueContactPoint", "valueCount", "valueDistance", "valueDuration", "valueHumanName", "valueIdentifier", "valueMoney", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueRatioRange", "valueReference", "valueSampledData", "valueSignature", "valueTiming", "valueContactDetail", "valueDataRequirement", "valueExpression", "valueParameterDefinition", "valueRelatedArtifact", "valueTriggerDefinition", "valueUsageContext", "valueAvailability", "valueExtendedContactDetail", "valueDosage", "valueMeta", "resource", "part", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueAvailability", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueCodeableConcept", "valueCodeableReference", "valueCoding", "valueContactDetail", "valueContactPoint", "valueCount", "valueDataRequirement", "valueDate", "valueDateTime", "valueDecimal", "valueDistance", "valueDosage", "valueDuration", "valueExpression", "valueExtendedContactDetail", "valueHumanName", "valueId", "valueIdentifier", "valueInstant", "valueInteger", "valueInteger64", "valueMarkdown", "valueMeta", "valueMoney", "valueOid", "valueParameterDefinition", "valuePeriod", "valuePositiveInt", "valueQuantity", "valueRange", "valueRatio", "valueRatioRange", "valueReference", "valueRelatedArtifact", "valueSampledData", "valueSignature", "valueString", "valueTime", "valueTiming", "valueTriggerDefinition", "valueUnsignedInt", "valueUri", "valueUrl", "valueUsageContext", "valueUuid", ] } return one_of_many_fields ================================================ FILE: fhir/resources/patient.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Patient Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Patient(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about an individual or animal receiving health care services. Demographics and other administrative information about an individual or animal receiving care or other health-related services. """ __resource_type__ = "Patient" active: bool | None = Field( default=None, alias="active", title="Whether this patient's record is in active use", description=( "Whether this patient record is in active use. Many systems use this " "property to mark as non-current patients, such as those that have not " "been seen for a period of time based on an organization's business " "rules. It is often used to filter patient lists to exclude inactive " "patients Deceased patients may also be marked as inactive for the " "same reasons, but may be active for some time after death." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) address: typing.List[fhirtypes.AddressType] | None = Field( default=None, alias="address", title="An address for the individual", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) birthDate: fhirtypes.DateType | None = Field( default=None, alias="birthDate", title="The date of birth for the individual", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) birthDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_birthDate", title="Extension field for ``birthDate``." ) communication: typing.List[fhirtypes.PatientCommunicationType] | None = Field( default=None, alias="communication", title=( "A language which may be used to communicate with the patient about his" " or her health" ), description=None, json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.PatientContactType] | None = Field( default=None, alias="contact", title="A contact party (e.g. guardian, partner, friend) for the patient", description=None, json_schema_extra={ "element_property": True, }, ) deceasedBoolean: bool | None = Field( default=None, alias="deceasedBoolean", title="Indicates if the individual is deceased or not", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deceasedBoolean", title="Extension field for ``deceasedBoolean``.", ) deceasedDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="deceasedDateTime", title="Indicates if the individual is deceased or not", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deceasedDateTime", title="Extension field for ``deceasedDateTime``.", ) gender: fhirtypes.CodeType | None = Field( default=None, alias="gender", title="male | female | other | unknown", description=( "Administrative Gender - the gender that the patient is considered to " "have for administration and record keeping purposes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["male", "female", "other", "unknown"], }, ) gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_gender", title="Extension field for ``gender``." ) generalPractitioner: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="generalPractitioner", title="Patient's nominated primary care provider", description="Patient's nominated care provider.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Organization", "Practitioner", "PractitionerRole", ], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="An identifier for this patient", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) link: typing.List[fhirtypes.PatientLinkType] | None = Field( default=None, alias="link", title=( "Link to a Patient or RelatedPerson resource that concerns the same " "actual individual" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) managingOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="managingOrganization", title="Organization that is the custodian of the patient record", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) maritalStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="maritalStatus", title="Marital (civil) status of a patient", description="This field contains a patient's most recent marital (civil) status.", json_schema_extra={ "element_property": True, }, ) multipleBirthBoolean: bool | None = Field( default=None, alias="multipleBirthBoolean", title="Whether patient is part of a multiple birth", description=( "Indicates whether the patient is part of a multiple (boolean) or " "indicates the actual birth order (integer)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e multipleBirth[x] "one_of_many": "multipleBirth", "one_of_many_required": False, }, ) multipleBirthBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_multipleBirthBoolean", title="Extension field for ``multipleBirthBoolean``.", ) multipleBirthInteger: fhirtypes.IntegerType | None = Field( default=None, alias="multipleBirthInteger", title="Whether patient is part of a multiple birth", description=( "Indicates whether the patient is part of a multiple (boolean) or " "indicates the actual birth order (integer)." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e multipleBirth[x] "one_of_many": "multipleBirth", "one_of_many_required": False, }, ) multipleBirthInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_multipleBirthInteger", title="Extension field for ``multipleBirthInteger``.", ) name: typing.List[fhirtypes.HumanNameType] | None = Field( default=None, alias="name", title="A name associated with the patient", description="A name associated with the individual.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) photo: typing.List[fhirtypes.AttachmentType] | None = Field( default=None, alias="photo", title="Image of the patient", description=None, json_schema_extra={ "element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="A contact detail for the individual", description=( "A contact detail (e.g. a telephone number or an email address) by " "which the individual may be contacted." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Patient`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "name", "telecom", "gender", "birthDate", "deceasedBoolean", "deceasedDateTime", "address", "maritalStatus", "multipleBirthBoolean", "multipleBirthInteger", "photo", "contact", "communication", "generalPractitioner", "managingOrganization", "link", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Patient`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "active", "name", "telecom", "gender", "birthDate", "deceasedBoolean", "deceasedDateTime", "address", "managingOrganization", "link", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "deceased": ["deceasedBoolean", "deceasedDateTime"], "multipleBirth": ["multipleBirthBoolean", "multipleBirthInteger"], } return one_of_many_fields class PatientCommunication(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A language which may be used to communicate with the patient about his or her health. """ __resource_type__ = "PatientCommunication" language: fhirtypes.CodeableConceptType = Field( default=..., alias="language", title=( "The language which can be used to communicate with the patient about " "his or her health" ), description=( "The ISO-639-1 alpha 2 code in lower case for the language, optionally " "followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in" ' upper case; e.g. "en" for English, or "en-US" for American English ' 'versus "en-AU" for Australian English.' ), json_schema_extra={ "element_property": True, }, ) preferred: bool | None = Field( default=None, alias="preferred", title="Language preference indicator", description=( "Indicates whether or not the patient prefers this language (over other" " languages he masters up a certain level)." ), json_schema_extra={ "element_property": True, }, ) preferred__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preferred", title="Extension field for ``preferred``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PatientCommunication`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "language", "preferred"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PatientCommunication`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class PatientContact(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A contact party (e.g. guardian, partner, friend) for the patient. """ __resource_type__ = "PatientContact" address: fhirtypes.AddressType | None = Field( default=None, alias="address", title="Address for the contact person", description=None, json_schema_extra={ "element_property": True, }, ) gender: fhirtypes.CodeType | None = Field( default=None, alias="gender", title="male | female | other | unknown", description=( "Administrative Gender - the gender that the contact person is " "considered to have for administration and record keeping purposes." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["male", "female", "other", "unknown"], }, ) gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_gender", title="Extension field for ``gender``." ) name: fhirtypes.HumanNameType | None = Field( default=None, alias="name", title="A name associated with the contact person", description=None, json_schema_extra={ "element_property": True, }, ) organization: fhirtypes.ReferenceType | None = Field( default=None, alias="organization", title="Organization that is associated with the contact", description=( "Organization on behalf of which the contact is acting or for which the" " contact is working." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title=( "The period during which this contact person or organization is valid " "to be contacted relating to this patient" ), description=None, json_schema_extra={ "element_property": True, }, ) relationship: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="relationship", title="The kind of relationship", description=( "The nature of the relationship between the patient and the contact " "person." ), json_schema_extra={ "element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="A contact detail for the person", description=( "A contact detail for the person, e.g. a telephone number or an email " "address." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PatientContact`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "relationship", "name", "telecom", "address", "gender", "organization", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PatientContact`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class PatientLink(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Link to a Patient or RelatedPerson resource that concerns the same actual individual. """ __resource_type__ = "PatientLink" other: fhirtypes.ReferenceType = Field( default=..., alias="other", title="The other patient or related person resource that the link refers to", description=( "Link to a Patient or RelatedPerson resource that concerns the same " "actual individual." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "RelatedPerson"], }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="replaced-by | replaces | refer | seealso", description=( "The type of link between this patient resource and another patient " "resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["replaced-by", "replaces", "refer", "seealso"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PatientLink`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "other", "type"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PatientLink`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "other", "type"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields ================================================ FILE: fhir/resources/paymentnotice.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/PaymentNotice Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class PaymentNotice(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. PaymentNotice request. This resource provides the status of the payment for goods and services rendered, and the request and response resource references. """ __resource_type__ = "PaymentNotice" amount: fhirtypes.MoneyType = Field( default=..., alias="amount", title="Monetary amount of the payment", description="The amount sent to the payee.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Creation date", description="The date when this resource was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for the payment notice", description="A unique identifier assigned to this payment notice.", json_schema_extra={ "element_property": True, }, ) payee: fhirtypes.ReferenceType | None = Field( default=None, alias="payee", title="Party being paid", description=( "The party who will receive or has received payment that is the subject" " of this notification." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) payment: fhirtypes.ReferenceType | None = Field( default=None, alias="payment", title="Payment reference", description="A reference to the payment which is the subject of this notice.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["PaymentReconciliation"], }, ) paymentDate: fhirtypes.DateType | None = Field( default=None, alias="paymentDate", title="Payment or clearing date", description="The date when the above payment action occurred.", json_schema_extra={ "element_property": True, }, ) paymentDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_paymentDate", title="Extension field for ``paymentDate``." ) paymentStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="paymentStatus", title="Issued or cleared Status of the payment", description="A code indicating whether payment has been sent or cleared.", json_schema_extra={ "element_property": True, }, ) recipient: fhirtypes.ReferenceType = Field( default=..., alias="recipient", title="Party being notified", description="The party who is notified of the payment status.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) reporter: fhirtypes.ReferenceType | None = Field( default=None, alias="reporter", title="Responsible practitioner", description="The party who reports the payment notice.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) request: fhirtypes.ReferenceType | None = Field( default=None, alias="request", title="Request reference", description="Reference of resource for which payment is being made.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) response: fhirtypes.ReferenceType | None = Field( default=None, alias="response", title="Response reference", description="Reference of response to resource for which payment is being made.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PaymentNotice`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "request", "response", "created", "reporter", "payment", "paymentDate", "payee", "recipient", "amount", "paymentStatus", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PaymentNotice`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "status", "created", "payment", "recipient", "amount", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("created", "created__ext"), ("status", "status__ext")] return required_fields ================================================ FILE: fhir/resources/paymentreconciliation.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/PaymentReconciliation Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class PaymentReconciliation(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. PaymentReconciliation resource. This resource provides the details including amount of a payment and allocates the payment items being paid. """ __resource_type__ = "PaymentReconciliation" accountNumber: fhirtypes.StringType | None = Field( default=None, alias="accountNumber", title="Digits for verification", description=( "A portion of the account number, often the last 4 digits, used for " "verification not charging purposes." ), json_schema_extra={ "element_property": True, }, ) accountNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_accountNumber", title="Extension field for ``accountNumber``.", ) allocation: typing.List[ fhirtypes.PaymentReconciliationAllocationType ] | None = Field( default=None, alias="allocation", title="Settlement particulars", description=( "Distribution of the payment amount for a previously acknowledged " "payable." ), json_schema_extra={ "element_property": True, }, ) amount: fhirtypes.MoneyType = Field( default=..., alias="amount", title="Total amount of Payment", description="Total payment amount as indicated on the financial instrument.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authorization: fhirtypes.StringType | None = Field( default=None, alias="authorization", title="Authorization number", description=( "An alphanumeric issued by the processor to confirm the successful " "issuance of payment." ), json_schema_extra={ "element_property": True, }, ) authorization__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authorization", title="Extension field for ``authorization``.", ) cardBrand: fhirtypes.StringType | None = Field( default=None, alias="cardBrand", title="Type of card", description=( "The card brand such as debit, Visa, Amex etc. used if a card is the " "method of payment." ), json_schema_extra={ "element_property": True, }, ) cardBrand__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_cardBrand", title="Extension field for ``cardBrand``." ) created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Creation date", description="The date when the resource was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) date: fhirtypes.DateType | None = Field( default=None, alias="date", title="When payment issued", description="The date of payment as indicated on the financial instrument.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) disposition: fhirtypes.StringType | None = Field( default=None, alias="disposition", title="Disposition message", description=( "A human readable description of the status of the request for the " "reconciliation." ), json_schema_extra={ "element_property": True, }, ) disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_disposition", title="Extension field for ``disposition``." ) enterer: fhirtypes.ReferenceType | None = Field( default=None, alias="enterer", title="Who entered the payment", description="Payment enterer if not the actual payment issuer.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) expirationDate: fhirtypes.DateType | None = Field( default=None, alias="expirationDate", title="Expiration year-month", description=( "The year and month (YYYY-MM) when the instrument, typically card, " "expires." ), json_schema_extra={ "element_property": True, }, ) expirationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expirationDate", title="Extension field for ``expirationDate``.", ) formCode: fhirtypes.CodeableConceptType | None = Field( default=None, alias="formCode", title="Printed form identifier", description="A code for the form to be used for printing the content.", json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for a payment reconciliation", description="A unique identifier assigned to this payment reconciliation.", json_schema_extra={ "element_property": True, }, ) issuerType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="issuerType", title="Nature of the source", description="The type of the source such as patient or insurance.", json_schema_extra={ "element_property": True, }, ) kind: fhirtypes.CodeableConceptType | None = Field( default=None, alias="kind", title="Workflow originating payment", description=( "The workflow or activity which gave rise to or during which the " "payment ocurred such as a kiosk, deposit on account, periodic payment " "etc." ), json_schema_extra={ "element_property": True, }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where payment collected", description=( "The location of the site or device for electronic transfers or " "physical location for cash payments." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="Payment instrument", description=( "The means of payment such as check, card cash, or electronic funds " "transfer." ), json_schema_extra={ "element_property": True, }, ) outcome: fhirtypes.CodeType | None = Field( default=None, alias="outcome", title="queued | complete | error | partial", description="The outcome of a request for a reconciliation.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["queued", "complete", "error", "partial"], }, ) outcome__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_outcome", title="Extension field for ``outcome``." ) paymentIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="paymentIdentifier", title="Business identifier for the payment", description="Issuer's unique identifier for the payment instrument.", json_schema_extra={ "element_property": True, }, ) paymentIssuer: fhirtypes.ReferenceType | None = Field( default=None, alias="paymentIssuer", title="Party generating payment", description="The party who generated the payment.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization", "Patient", "RelatedPerson"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Period covered", description=( "The period of time for which payments have been gathered into this " "bulk payment for settlement." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) processNote: typing.List[ fhirtypes.PaymentReconciliationProcessNoteType ] | None = Field( default=None, alias="processNote", title="Note concerning processing", description=( "A note that describes or explains the processing in a human readable " "form." ), json_schema_extra={ "element_property": True, }, ) processor: fhirtypes.StringType | None = Field( default=None, alias="processor", title="Processor name", description="The name of the card processor, etf processor, bank for checks.", json_schema_extra={ "element_property": True, }, ) processor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_processor", title="Extension field for ``processor``." ) referenceNumber: fhirtypes.StringType | None = Field( default=None, alias="referenceNumber", title="Check number or payment reference", description="The check number, eft reference, car processor reference.", json_schema_extra={ "element_property": True, }, ) referenceNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_referenceNumber", title="Extension field for ``referenceNumber``.", ) request: fhirtypes.ReferenceType | None = Field( default=None, alias="request", title="Reference to requesting resource", description="Original request resource reference.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Task"], }, ) requestor: fhirtypes.ReferenceType | None = Field( default=None, alias="requestor", title="Responsible practitioner", description=( "The practitioner who is responsible for the services rendered to the " "patient." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) returnedAmount: fhirtypes.MoneyType | None = Field( default=None, alias="returnedAmount", title="Amount returned by the receiver", description=( "The amount returned by the receiver which is excess to the amount " "payable, often referred to as 'change'." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) tenderedAmount: fhirtypes.MoneyType | None = Field( default=None, alias="tenderedAmount", title="Amount offered by the issuer", description=( "The amount offered by the issuer, typically applies to cash when the " "issuer provides an amount in bank note denominations equal to or " "excess of the amount actually being paid." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Category of payment", description=( "Code to indicate the nature of the payment such as payment, " "adjustment." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PaymentReconciliation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "type", "status", "kind", "period", "created", "enterer", "issuerType", "paymentIssuer", "request", "requestor", "outcome", "disposition", "date", "location", "method", "cardBrand", "accountNumber", "expirationDate", "processor", "referenceNumber", "authorization", "tenderedAmount", "returnedAmount", "amount", "paymentIdentifier", "allocation", "formCode", "processNote", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PaymentReconciliation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "type", "status", "period", "created", "paymentIssuer", "date", "amount", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("created", "created__ext"), ("date", "date__ext"), ("status", "status__ext"), ] return required_fields class PaymentReconciliationAllocation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Settlement particulars. Distribution of the payment amount for a previously acknowledged payable. """ __resource_type__ = "PaymentReconciliationAllocation" account: fhirtypes.ReferenceType | None = Field( default=None, alias="account", title="Applied-to account", description=( "The Account to which this payment applies, may be completed by the " "receiver, used for search." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Account"], }, ) amount: fhirtypes.MoneyType | None = Field( default=None, alias="amount", title="Amount allocated to this payable", description="The monetary amount allocated from the total payment to the payable.", json_schema_extra={ "element_property": True, }, ) date: fhirtypes.DateType | None = Field( default=None, alias="date", title="Date of commitment to pay", description="The date from the response resource containing a commitment to pay.", json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Applied-to encounter", description=( "The Encounter to which this payment applies, may be completed by the " "receiver, used for search." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Business identifier of the payment detail", description=( "Unique identifier for the current payment item for the referenced " "payable." ), json_schema_extra={ "element_property": True, }, ) payee: fhirtypes.ReferenceType | None = Field( default=None, alias="payee", title="Recipient of the payment", description="The party which is receiving the payment.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) predecessor: fhirtypes.IdentifierType | None = Field( default=None, alias="predecessor", title="Business identifier of the prior payment detail", description=( "Unique identifier for the prior payment item for the referenced " "payable." ), json_schema_extra={ "element_property": True, }, ) response: fhirtypes.ReferenceType | None = Field( default=None, alias="response", title="Response committing to a payment", description=( "A resource, such as a ClaimResponse, which contains a commitment to " "payment." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ClaimResponse"], }, ) responsible: fhirtypes.ReferenceType | None = Field( default=None, alias="responsible", title="Contact for the response", description=( "A reference to the individual who is responsible for inquiries " "regarding the response and its payment." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["PractitionerRole"], }, ) submitter: fhirtypes.ReferenceType | None = Field( default=None, alias="submitter", title="Submitter of the request", description="The party which submitted the claim or financial transaction.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) target: fhirtypes.ReferenceType | None = Field( default=None, alias="target", title="Subject of the payment", description="Specific resource to which the payment/adjustment/advance applies.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Claim", "Account", "Invoice", "ChargeItem", "Encounter", "Contract", ], }, ) targetItemIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="targetItemIdentifier", title="Sub-element of the subject", description=( " Identifies the claim line item, encounter or other sub-element being " "paid. Note payment may be partial, that is not match the then " "outstanding balance or amount incurred." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e targetItem[x] "one_of_many": "targetItem", "one_of_many_required": False, }, ) targetItemPositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="targetItemPositiveInt", title="Sub-element of the subject", description=( " Identifies the claim line item, encounter or other sub-element being " "paid. Note payment may be partial, that is not match the then " "outstanding balance or amount incurred." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e targetItem[x] "one_of_many": "targetItem", "one_of_many_required": False, }, ) targetItemPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_targetItemPositiveInt", title="Extension field for ``targetItemPositiveInt``.", ) targetItemString: fhirtypes.StringType | None = Field( default=None, alias="targetItemString", title="Sub-element of the subject", description=( " Identifies the claim line item, encounter or other sub-element being " "paid. Note payment may be partial, that is not match the then " "outstanding balance or amount incurred." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e targetItem[x] "one_of_many": "targetItem", "one_of_many_required": False, }, ) targetItemString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_targetItemString", title="Extension field for ``targetItemString``.", ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Category of payment", description="Code to indicate the nature of the payment.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PaymentReconciliationAllocation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "predecessor", "target", "targetItemString", "targetItemIdentifier", "targetItemPositiveInt", "encounter", "account", "type", "submitter", "response", "date", "responsible", "payee", "amount", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PaymentReconciliationAllocation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "targetItem": [ "targetItemIdentifier", "targetItemPositiveInt", "targetItemString", ] } return one_of_many_fields class PaymentReconciliationProcessNote(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Note concerning processing. A note that describes or explains the processing in a human readable form. """ __resource_type__ = "PaymentReconciliationProcessNote" text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Note explanatory text", description="The explanation or description associated with the processing.", json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="display | print | printoper", description="The business purpose of the note text.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["display", "print", "printoper"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PaymentReconciliationProcessNote`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "text"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PaymentReconciliationProcessNote`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/period.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Period Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class Period(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Time range defined by start and end date/time. A time period defined by a start and end date and optionally time. """ __resource_type__ = "Period" end: fhirtypes.DateTimeType | None = Field( default=None, alias="end", title="End time with inclusive boundary, if not ongoing", description=( "The end of the period. If the end of the period is missing, it means " "no end was known or planned at the time the instance was created. The " "start may be in the past, and the end date in the future, which means " "that period is expected/planned to end at that time." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_end", title="Extension field for ``end``." ) start: fhirtypes.DateTimeType | None = Field( default=None, alias="start", title="Starting time with inclusive boundary", description="The start of the period. The boundary is inclusive.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_start", title="Extension field for ``start``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Period`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "start", "end"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Period`` according to specification, with preserving the original sequence order. """ return ["start", "end"] ================================================ FILE: fhir/resources/permission.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Permission Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Permission(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Access Rules. Permission resource holds access rules for a given data and context. """ __resource_type__ = "Permission" asserter: fhirtypes.ReferenceType | None = Field( default=None, alias="asserter", title="The person or entity that asserts the permission", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", "Patient", "RelatedPerson", "HealthcareService", ], }, ) combining: fhirtypes.CodeType | None = Field( default=None, alias="combining", title=( "deny-overrides | permit-overrides | ordered-deny-overrides | ordered-" "permit-overrides | deny-unless-permit | permit-unless-deny" ), description=( "Defines a procedure for arriving at an access decision given the set " "of rules." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "deny-overrides", "permit-overrides", "ordered-deny-overrides", "ordered-permit-overrides", "deny-unless-permit", "permit-unless-deny", ], }, ) combining__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_combining", title="Extension field for ``combining``." ) date: typing.List[fhirtypes.DateTimeType | None] | None = Field( default=None, alias="date", title="The date that permission was asserted", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) justification: fhirtypes.PermissionJustificationType | None = Field( default=None, alias="justification", title="The asserted justification for using the data", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) rule: typing.List[fhirtypes.PermissionRuleType] | None = Field( default=None, alias="rule", title="Constraints to the Permission", description="A set of rules.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | entered-in-error | draft | rejected", description="Status.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "entered-in-error", "draft", "rejected"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) validity: fhirtypes.PeriodType | None = Field( default=None, alias="validity", title="The period in which the permission is active", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Permission`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "status", "asserter", "date", "validity", "justification", "combining", "rule", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Permission`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "status", "asserter", "date", "validity", "justification", "combining", "rule", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("combining", "combining__ext"), ("status", "status__ext")] return required_fields class PermissionJustification(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The asserted justification for using the data. """ __resource_type__ = "PermissionJustification" basis: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="basis", title="The regulatory grounds upon which this Permission builds", description=( "This would be a codeableconcept, or a coding, which can be constrained" " to , for example, the 6 grounds for processing in GDPR." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) evidence: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="evidence", title="Justifing rational", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PermissionJustification`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "basis", "evidence"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PermissionJustification`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "basis", "evidence"] class PermissionRule(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Constraints to the Permission. A set of rules. """ __resource_type__ = "PermissionRule" activity: typing.List[fhirtypes.PermissionRuleActivityType] | None = Field( default=None, alias="activity", title=( "A description or definition of which activities are allowed to be done" " on the data" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) data: typing.List[fhirtypes.PermissionRuleDataType] | None = Field( default=None, alias="data", title=( "The selection criteria to identify data that is within scope of this " "provision" ), description=( "A description or definition of which activities are allowed to be done" " on the data." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) limit: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="limit", title="What limits apply to the use of the data", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="deny | permit", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["deny", "permit"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PermissionRule`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "data", "activity", "limit", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PermissionRule`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "data", "activity", "limit"] class PermissionRuleActivity(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A description or definition of which activities are allowed to be done on the data. """ __resource_type__ = "PermissionRuleActivity" action: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="action", title="Actions controlled by this rule", description="Actions controlled by this Rule.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) actor: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="actor", title="Authorized actor(s)", description="The actor(s) authorized for the defined activity.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Group", "CareTeam", "Organization", "Patient", "Practitioner", "RelatedPerson", "PractitionerRole", ], }, ) purpose: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="purpose", title="The purpose for which the permission is given", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PermissionRuleActivity`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "actor", "action", "purpose"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PermissionRuleActivity`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "actor", "action", "purpose"] class PermissionRuleData(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The selection criteria to identify data that is within scope of this provision. A description or definition of which activities are allowed to be done on the data. """ __resource_type__ = "PermissionRuleData" expression: fhirtypes.ExpressionType | None = Field( default=None, alias="expression", title="Expression identifying the data", description="Used when other data selection elements are insufficient.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) period: typing.List[fhirtypes.PeriodType] | None = Field( default=None, alias="period", title="Timeframe encompasing data create/update", description=( "Clinical or Operational Relevant period of time that bounds the data " "controlled by this rule." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) resource: typing.List[fhirtypes.PermissionRuleDataResourceType] | None = Field( default=None, alias="resource", title="Explicit FHIR Resource references", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) security: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="security", title="Security tag code on .meta.security", description=( "The data in scope are those with the given codes present in that data " ".meta.security element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PermissionRuleData`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "resource", "security", "period", "expression", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PermissionRuleData`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "resource", "security", "period", "expression"] class PermissionRuleDataResource(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Explicit FHIR Resource references. """ __resource_type__ = "PermissionRuleDataResource" meaning: fhirtypes.CodeType | None = Field( default=None, alias="meaning", title="instance | related | dependents | authoredby", description=( "How the resource reference is interpreted when testing consent " "restrictions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["instance", "related", "dependents", "authoredby"], }, ) meaning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_meaning", title="Extension field for ``meaning``." ) reference: fhirtypes.ReferenceType = Field( default=..., alias="reference", title="The actual data reference", description=( "A reference to a specific resource that defines which resources are " "covered by this consent." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PermissionRuleDataResource`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "meaning", "reference"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PermissionRuleDataResource`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "meaning", "reference"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("meaning", "meaning__ext")] return required_fields ================================================ FILE: fhir/resources/person.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Person Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Person(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A generic person record. Demographics and administrative information about a person independent of a specific health-related context. """ __resource_type__ = "Person" active: bool | None = Field( default=None, alias="active", title="This person's record is in active use", description="Whether this person's record is in active use.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) address: typing.List[fhirtypes.AddressType] | None = Field( default=None, alias="address", title="One or more addresses for the person", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) birthDate: fhirtypes.DateType | None = Field( default=None, alias="birthDate", title="The date on which the person was born", description="The birth date for the person.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) birthDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_birthDate", title="Extension field for ``birthDate``." ) communication: typing.List[fhirtypes.PersonCommunicationType] | None = Field( default=None, alias="communication", title=( "A language which may be used to communicate with the person about his " "or her health" ), description=None, json_schema_extra={ "element_property": True, }, ) deceasedBoolean: bool | None = Field( default=None, alias="deceasedBoolean", title="Indicates if the individual is deceased or not", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deceasedBoolean", title="Extension field for ``deceasedBoolean``.", ) deceasedDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="deceasedDateTime", title="Indicates if the individual is deceased or not", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deceasedDateTime", title="Extension field for ``deceasedDateTime``.", ) gender: fhirtypes.CodeType | None = Field( default=None, alias="gender", title="male | female | other | unknown", description="Administrative Gender.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["male", "female", "other", "unknown"], }, ) gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_gender", title="Extension field for ``gender``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="A human identifier for this person", description="Identifier for a person within a particular scope.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) link: typing.List[fhirtypes.PersonLinkType] | None = Field( default=None, alias="link", title="Link to a resource that concerns the same actual person", description=None, json_schema_extra={ "element_property": True, }, ) managingOrganization: fhirtypes.ReferenceType | None = Field( default=None, alias="managingOrganization", title="The organization that is the custodian of the person record", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) maritalStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="maritalStatus", title="Marital (civil) status of a person", description="This field contains a person's most recent marital (civil) status.", json_schema_extra={ "element_property": True, }, ) name: typing.List[fhirtypes.HumanNameType] | None = Field( default=None, alias="name", title="A name associated with the person", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) photo: typing.List[fhirtypes.AttachmentType] | None = Field( default=None, alias="photo", title="Image of the person", description=( "An image that can be displayed as a thumbnail of the person to enhance" " the identification of the individual." ), json_schema_extra={ "element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="A contact detail for the person", description=( "A contact detail for the person, e.g. a telephone number or an email " "address." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Person`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "name", "telecom", "gender", "birthDate", "deceasedBoolean", "deceasedDateTime", "address", "maritalStatus", "photo", "communication", "managingOrganization", "link", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Person`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "active", "name", "telecom", "gender", "birthDate", "deceasedBoolean", "deceasedDateTime", "address", "managingOrganization", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"deceased": ["deceasedBoolean", "deceasedDateTime"]} return one_of_many_fields class PersonCommunication(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A language which may be used to communicate with the person about his or her health. """ __resource_type__ = "PersonCommunication" language: fhirtypes.CodeableConceptType = Field( default=..., alias="language", title=( "The language which can be used to communicate with the person about " "his or her health" ), description=( "The ISO-639-1 alpha 2 code in lower case for the language, optionally " "followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in" ' upper case; e.g. "en" for English, or "en-US" for American English ' 'versus "en-AU" for Australian English.' ), json_schema_extra={ "element_property": True, }, ) preferred: bool | None = Field( default=None, alias="preferred", title="Language preference indicator", description=( "Indicates whether or not the person prefers this language (over other " "languages he masters up a certain level)." ), json_schema_extra={ "element_property": True, }, ) preferred__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preferred", title="Extension field for ``preferred``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PersonCommunication`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "language", "preferred"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PersonCommunication`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class PersonLink(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Link to a resource that concerns the same actual person. """ __resource_type__ = "PersonLink" assurance: fhirtypes.CodeType | None = Field( default=None, alias="assurance", title="level1 | level2 | level3 | level4", description=( "Level of assurance that this link is associated with the target " "resource." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["level1", "level2", "level3", "level4"], }, ) assurance__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_assurance", title="Extension field for ``assurance``." ) target: fhirtypes.ReferenceType = Field( default=..., alias="target", title="The resource to which this actual person is associated", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "RelatedPerson", "Person", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PersonLink`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "target", "assurance"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PersonLink`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/plandefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/PlanDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class PlanDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The definition of a plan for a series of actions, independent of any specific patient or context. This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical and non- clinical artifacts such as clinical decision support rules, order sets, protocols, and drug quality specifications. """ __resource_type__ = "PlanDefinition" action: typing.List[fhirtypes.PlanDefinitionActionType] | None = Field( default=None, alias="action", title="Action defined by the plan", description=( "An action or group of actions to be taken as part of the plan. For " "example, in clinical care, an action would be to prescribe a " "particular indicated medication, or perform a particular test as " "appropriate. In pharmaceutical quality, an action would be the test " "that needs to be performed on a drug product as defined in the quality" " specification." ), json_schema_extra={ "element_property": True, }, ) actor: typing.List[fhirtypes.PlanDefinitionActorType] | None = Field( default=None, alias="actor", title="Actors within the plan", description=( "Actors represent the individuals or groups involved in the execution " "of the defined set of activities." ), json_schema_extra={ "element_property": True, }, ) approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the plan definition was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) asNeededBoolean: bool | None = Field( default=None, alias="asNeededBoolean", title="Preconditions for service", description=( "If a CodeableConcept is present, it indicates the pre-condition for " 'performing the service. For example "pain", "on flare-up", etc.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e asNeeded[x] "one_of_many": "asNeeded", "one_of_many_required": False, }, ) asNeededBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_asNeededBoolean", title="Extension field for ``asNeededBoolean``.", ) asNeededCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="asNeededCodeableConcept", title="Preconditions for service", description=( "If a CodeableConcept is present, it indicates the pre-condition for " 'performing the service. For example "pain", "on flare-up", etc.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e asNeeded[x] "one_of_many": "asNeeded", "one_of_many_required": False, }, ) author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the content", description=( "An individiual or organization primarily involved in the creation and " "maintenance of the content." ), json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the plan definition and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the plan definition." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the plan definition was last " "significantly changed. The date must change when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the plan definition " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the plan definition", description=( "A free text natural language description of the plan definition from a" " consumer's perspective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the content", description=( "An individual or organization primarily responsible for internal " "coherence of the content." ), json_schema_extra={ "element_property": True, }, ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the plan definition is expected to be used", description=( "The period during which the plan definition content was or is planned " "to be in active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the content", description=( "An individual or organization asserted by the publisher to be " "responsible for officially endorsing the content for use in some " "setting." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this plan definition is authored for " "testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) goal: typing.List[fhirtypes.PlanDefinitionGoalType] | None = Field( default=None, alias="goal", title="What the plan is trying to accomplish", description=( "A goal describes an expected outcome that activities within the plan " "are intended to achieve. For example, weight loss, restoring an " "activity of daily living, obtaining herd immunity via immunization, " "meeting a process improvement objective, meeting the acceptance " "criteria for a test as specified by a quality specification, etc." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the plan definition", description=( "A formal identifier that is used to identify this plan definition when" " it is represented in other formats, or referenced in a specification," " model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for plan definition (if applicable)", description=( "A legal or geographic region in which the plan definition is intended " "to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the plan definition was last reviewed by the publisher", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) library: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="library", title="Logic used by the plan definition", description=( "A reference to a Library resource containing any formal logic used by " "the plan definition." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Library"], }, ) library__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_library", title="Extension field for ``library``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this plan definition (computer friendly)", description=( "A natural language name identifying the plan definition. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the plan definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this plan definition is defined", description=( "Explanation of why this plan definition is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Additional documentation, citations", description=( "Related artifacts such as additional documentation, justification, or " "bibliographic references." ), json_schema_extra={ "element_property": True, }, ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the content", description=( "An individual or organization asserted by the publisher to be " "primarily responsible for review of some aspect of the content." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this plan definition. Enables tracking the life-cycle of" " the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subjectCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="subjectCanonical", title="Type of individual the plan definition is focused on", description=( "A code, group definition, or canonical reference that describes or " "identifies the intended subject of the plan definition. Canonical " "references are allowed to support the definition of protocols for drug" " and substance quality specifications, and is allowed to reference a " "MedicinalProductDefinition, SubstanceDefinition, " "AdministrableProductDefinition, ManufacturedItemDefinition, or " "PackagedProductDefinition resource." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["EvidenceVariable"], }, ) subjectCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subjectCanonical", title="Extension field for ``subjectCanonical``.", ) subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subjectCodeableConcept", title="Type of individual the plan definition is focused on", description=( "A code, group definition, or canonical reference that describes or " "identifies the intended subject of the plan definition. Canonical " "references are allowed to support the definition of protocols for drug" " and substance quality specifications, and is allowed to reference a " "MedicinalProductDefinition, SubstanceDefinition, " "AdministrableProductDefinition, ManufacturedItemDefinition, or " "PackagedProductDefinition resource." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, }, ) subjectReference: fhirtypes.ReferenceType | None = Field( default=None, alias="subjectReference", title="Type of individual the plan definition is focused on", description=( "A code, group definition, or canonical reference that describes or " "identifies the intended subject of the plan definition. Canonical " "references are allowed to support the definition of protocols for drug" " and substance quality specifications, and is allowed to reference a " "MedicinalProductDefinition, SubstanceDefinition, " "AdministrableProductDefinition, ManufacturedItemDefinition, or " "PackagedProductDefinition resource." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Group", "MedicinalProductDefinition", "SubstanceDefinition", "AdministrableProductDefinition", "ManufacturedItemDefinition", "PackagedProductDefinition", ], }, ) subtitle: fhirtypes.StringType | None = Field( default=None, alias="subtitle", title="Subordinate title of the plan definition", description=( "An explanatory or alternate title for the plan definition giving " "additional information about its content." ), json_schema_extra={ "element_property": True, }, ) subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subtitle", title="Extension field for ``subtitle``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this plan definition (human friendly)", description="A short, descriptive, user-friendly title for the plan definition.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) topic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="topic", title="E.g. Education, Treatment, Assessment", description=( "Descriptive topics related to the content of the plan definition. " "Topics provide a high-level categorization of the definition that can " "be useful for filtering and searching." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="order-set | clinical-protocol | eca-rule | workflow-definition", description=( "A high-level category for the plan definition that distinguishes the " "kinds of systems that would be interested in the plan definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this plan definition, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this plan definition when it " "is referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which an authoritative instance of this" " plan definition is (or will be) published. This URL can be the target" " of a canonical reference. It SHALL remain the same when the plan " "definition is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) usage: fhirtypes.MarkdownType | None = Field( default=None, alias="usage", title="Describes the clinical usage of the plan", description=( "A detailed description of how the plan definition is used from a " "clinical perspective." ), json_schema_extra={ "element_property": True, }, ) usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_usage", title="Extension field for ``usage``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate plan definition instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the plan definition", description=( "The identifier that is used to identify this version of the plan " "definition when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the plan definition " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence. To provide a version consistent with the " "Decision Support Service specification, use the format " "Major.Minor.Revision (e.g. 1.0.0). For more information on versioning " "knowledge assets, refer to the Decision Support Service specification." " Note that a version is required for non-experimental active " "artifacts." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "subtitle", "type", "status", "experimental", "subjectCodeableConcept", "subjectReference", "subjectCanonical", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "usage", "copyright", "copyrightLabel", "approvalDate", "lastReviewDate", "effectivePeriod", "topic", "author", "editor", "reviewer", "endorser", "relatedArtifact", "library", "goal", "actor", "action", "asNeededBoolean", "asNeededCodeableConcept", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "type", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "effectivePeriod", "asNeededBoolean", "asNeededCodeableConcept", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "asNeeded": ["asNeededBoolean", "asNeededCodeableConcept"], "subject": [ "subjectCanonical", "subjectCodeableConcept", "subjectReference", ], "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"], } return one_of_many_fields class PlanDefinitionAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Action defined by the plan. An action or group of actions to be taken as part of the plan. For example, in clinical care, an action would be to prescribe a particular indicated medication, or perform a particular test as appropriate. In pharmaceutical quality, an action would be the test that needs to be performed on a drug product as defined in the quality specification. """ __resource_type__ = "PlanDefinitionAction" action: typing.List[fhirtypes.PlanDefinitionActionType] | None = Field( default=None, alias="action", title="A sub-action", description=( "Sub actions that are contained within the action. The behavior of this" " action determines the functionality of the sub-actions. For example, " "a selection behavior of at-most-one indicates that of the sub-actions," " at most one may be chosen as part of realizing the action definition." ), json_schema_extra={ "element_property": True, }, ) cardinalityBehavior: fhirtypes.CodeType | None = Field( default=None, alias="cardinalityBehavior", title="single | multiple", description="Defines whether the action can be selected multiple times.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["single", "multiple"], }, ) cardinalityBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_cardinalityBehavior", title="Extension field for ``cardinalityBehavior``.", ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Code representing the meaning of the action or sub-actions", description=( "A code that provides a meaning, grouping, or classification for the " "action or action group. For example, a section may have a LOINC code " "for the section of a documentation template. In pharmaceutical " "quality, an action (Test) such as pH could be classified as a physical" " property." ), json_schema_extra={ "element_property": True, }, ) condition: typing.List[fhirtypes.PlanDefinitionActionConditionType] | None = Field( default=None, alias="condition", title="Whether or not the action is applicable", description=( "An expression that describes applicability criteria or start/stop " "conditions for the action." ), json_schema_extra={ "element_property": True, }, ) definitionCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="definitionCanonical", title="Description of the activity to be performed", description=( "A reference to an ActivityDefinition that describes the action to be " "taken in detail, a MessageDefinition describing a message to be snet, " "a PlanDefinition that describes a series of actions to be taken, a " "Questionnaire that should be filled out, a SpecimenDefinition " "describing a specimen to be collected, or an ObservationDefinition " "that specifies what observation should be captured." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e definition[x] "one_of_many": "definition", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "ActivityDefinition", "MessageDefinition", "ObservationDefinition", "PlanDefinition", "Questionnaire", "SpecimenDefinition", ], }, ) definitionCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definitionCanonical", title="Extension field for ``definitionCanonical``.", ) definitionUri: fhirtypes.UriType | None = Field( default=None, alias="definitionUri", title="Description of the activity to be performed", description=( "A reference to an ActivityDefinition that describes the action to be " "taken in detail, a MessageDefinition describing a message to be snet, " "a PlanDefinition that describes a series of actions to be taken, a " "Questionnaire that should be filled out, a SpecimenDefinition " "describing a specimen to be collected, or an ObservationDefinition " "that specifies what observation should be captured." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e definition[x] "one_of_many": "definition", "one_of_many_required": False, }, ) definitionUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definitionUri", title="Extension field for ``definitionUri``.", ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Brief description of the action", description=( "A brief description of the action used to provide a summary to display" " to the user." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) documentation: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="documentation", title="Supporting documentation for the intended performer of the action", description=( "Didactic or other informational resources associated with the action " "that can be provided to the CDS recipient. Information resources can " "include inline text commentary and links to web resources." ), json_schema_extra={ "element_property": True, }, ) dynamicValue: typing.List[ fhirtypes.PlanDefinitionActionDynamicValueType ] | None = Field( default=None, alias="dynamicValue", title="Dynamic aspects of the definition", description=( "Customizations that should be applied to the statically defined " "resource. For example, if the dosage of a medication must be computed " "based on the patient's weight, a customization would be used to " "specify an expression that calculated the weight, and the path on the " "resource that would contain the result." ), json_schema_extra={ "element_property": True, }, ) goalId: typing.List[fhirtypes.IdType | None] | None = Field( default=None, alias="goalId", title="What goals this action supports", description=( "Identifies goals that this action supports. The reference must be to a" " goal element defined within this plan definition. In pharmaceutical " "quality, a goal represents acceptance criteria (Goal) for a given " "action (Test), so the goalId would be the unique id of a defined goal " "element establishing the acceptance criteria for the action." ), json_schema_extra={ "element_property": True, }, ) goalId__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_goalId", title="Extension field for ``goalId``." ) groupingBehavior: fhirtypes.CodeType | None = Field( default=None, alias="groupingBehavior", title="visual-group | logical-group | sentence-group", description="Defines the grouping behavior for the action and its children.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["visual-group", "logical-group", "sentence-group"], }, ) groupingBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_groupingBehavior", title="Extension field for ``groupingBehavior``.", ) input: typing.List[fhirtypes.PlanDefinitionActionInputType] | None = Field( default=None, alias="input", title="Input data requirements", description="Defines input data requirements for the action.", json_schema_extra={ "element_property": True, }, ) linkId: fhirtypes.StringType | None = Field( default=None, alias="linkId", title="Unique id for the action in the PlanDefinition", description=( "An identifier that is unique within the PlanDefinition to allow " "linkage within the realized CarePlan and/or RequestOrchestration." ), json_schema_extra={ "element_property": True, }, ) linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) location: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="location", title="Where it should happen", description=( "Identifies the facility where the action will occur; e.g. home, " "hospital, specific clinic, etc." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) output: typing.List[fhirtypes.PlanDefinitionActionOutputType] | None = Field( default=None, alias="output", title="Output data definition", description="Defines the outputs of the action, if any.", json_schema_extra={ "element_property": True, }, ) participant: typing.List[ fhirtypes.PlanDefinitionActionParticipantType ] | None = Field( default=None, alias="participant", title="Who should participate in the action", description="Indicates who should participate in performing the action described.", json_schema_extra={ "element_property": True, }, ) precheckBehavior: fhirtypes.CodeType | None = Field( default=None, alias="precheckBehavior", title="yes | no", description="Defines whether the action should usually be preselected.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["yes", "no"], }, ) precheckBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_precheckBehavior", title="Extension field for ``precheckBehavior``.", ) prefix: fhirtypes.StringType | None = Field( default=None, alias="prefix", title="User-visible prefix for the action (e.g. 1. or A.)", description=( "A user-visible prefix for the action. For example a section or item " "numbering such as 1. or A." ), json_schema_extra={ "element_property": True, }, ) prefix__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_prefix", title="Extension field for ``prefix``." ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Indicates how quickly the action should be addressed with respect to " "other actions." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) reason: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="reason", title="Why the action should be performed", description="A description of why this action is necessary or appropriate.", json_schema_extra={ "element_property": True, }, ) relatedAction: typing.List[ fhirtypes.PlanDefinitionActionRelatedActionType ] | None = Field( default=None, alias="relatedAction", title="Relationship to another action", description=( 'A relationship to another action such as "before" or "30-60 minutes ' 'after start of".' ), json_schema_extra={ "element_property": True, }, ) requiredBehavior: fhirtypes.CodeType | None = Field( default=None, alias="requiredBehavior", title="must | could | must-unless-documented", description="Defines the required behavior for the action.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["must", "could", "must-unless-documented"], }, ) requiredBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requiredBehavior", title="Extension field for ``requiredBehavior``.", ) selectionBehavior: fhirtypes.CodeType | None = Field( default=None, alias="selectionBehavior", title="any | all | all-or-none | exactly-one | at-most-one | one-or-more", description="Defines the selection behavior for the action and its children.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "any", "all", "all-or-none", "exactly-one", "at-most-one", "one-or-more", ], }, ) selectionBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_selectionBehavior", title="Extension field for ``selectionBehavior``.", ) subjectCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="subjectCanonical", title="Type of individual the action is focused on", description=( "A code, group definition, or canonical reference that describes the " "intended subject of the action and its children, if any. Canonical " "references are allowed to support the definition of protocols for drug" " and substance quality specifications, and is allowed to reference a " "MedicinalProductDefinition, SubstanceDefinition, " "AdministrableProductDefinition, ManufacturedItemDefinition, or " "PackagedProductDefinition resource." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, }, ) subjectCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subjectCanonical", title="Extension field for ``subjectCanonical``.", ) subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subjectCodeableConcept", title="Type of individual the action is focused on", description=( "A code, group definition, or canonical reference that describes the " "intended subject of the action and its children, if any. Canonical " "references are allowed to support the definition of protocols for drug" " and substance quality specifications, and is allowed to reference a " "MedicinalProductDefinition, SubstanceDefinition, " "AdministrableProductDefinition, ManufacturedItemDefinition, or " "PackagedProductDefinition resource." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, }, ) subjectReference: fhirtypes.ReferenceType | None = Field( default=None, alias="subjectReference", title="Type of individual the action is focused on", description=( "A code, group definition, or canonical reference that describes the " "intended subject of the action and its children, if any. Canonical " "references are allowed to support the definition of protocols for drug" " and substance quality specifications, and is allowed to reference a " "MedicinalProductDefinition, SubstanceDefinition, " "AdministrableProductDefinition, ManufacturedItemDefinition, or " "PackagedProductDefinition resource." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) textEquivalent: fhirtypes.MarkdownType | None = Field( default=None, alias="textEquivalent", title=( "Static text equivalent of the action, used if the dynamic aspects " "cannot be interpreted by the receiving system" ), description=( "A text equivalent of the action to be performed. This provides a " "human-interpretable description of the action when the definition is " "consumed by a system that might not be capable of interpreting it " "dynamically." ), json_schema_extra={ "element_property": True, }, ) textEquivalent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_textEquivalent", title="Extension field for ``textEquivalent``.", ) timingAge: fhirtypes.AgeType | None = Field( default=None, alias="timingAge", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDuration: fhirtypes.DurationType | None = Field( default=None, alias="timingDuration", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingRange: fhirtypes.RangeType | None = Field( default=None, alias="timingRange", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingTiming: fhirtypes.TimingType | None = Field( default=None, alias="timingTiming", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="User-visible title", description=( "The textual description of the action displayed to a user. For " "example, when the action is a test to be performed, the title would be" " the title of the test such as Assay by HPLC." ), json_schema_extra={ "element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) transform: fhirtypes.CanonicalType | None = Field( default=None, alias="transform", title="Transform to apply the template", description=( "A reference to a StructureMap resource that defines a transform that " "can be executed to produce the intent resource using the " "ActivityDefinition instance as the input." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureMap"], }, ) transform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_transform", title="Extension field for ``transform``." ) trigger: typing.List[fhirtypes.TriggerDefinitionType] | None = Field( default=None, alias="trigger", title="When the action should be triggered", description=( "A description of when the action should be triggered. When multiple " "triggers are specified on an action, any triggering event invokes the " "action." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="create | update | remove | fire-event", description="The type of action to perform (create, update, remove).", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionAction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "linkId", "prefix", "title", "description", "textEquivalent", "priority", "code", "reason", "documentation", "goalId", "subjectCodeableConcept", "subjectReference", "subjectCanonical", "trigger", "condition", "input", "output", "relatedAction", "timingAge", "timingDuration", "timingRange", "timingTiming", "location", "participant", "type", "groupingBehavior", "selectionBehavior", "requiredBehavior", "precheckBehavior", "cardinalityBehavior", "definitionCanonical", "definitionUri", "transform", "dynamicValue", "action", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "definition": ["definitionCanonical", "definitionUri"], "subject": [ "subjectCanonical", "subjectCodeableConcept", "subjectReference", ], "timing": ["timingAge", "timingDuration", "timingRange", "timingTiming"], } return one_of_many_fields class PlanDefinitionActionCondition(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Whether or not the action is applicable. An expression that describes applicability criteria or start/stop conditions for the action. """ __resource_type__ = "PlanDefinitionActionCondition" expression: fhirtypes.ExpressionType | None = Field( default=None, alias="expression", title="Boolean-valued expression", description=( "An expression that returns true or false, indicating whether the " "condition is satisfied." ), json_schema_extra={ "element_property": True, }, ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title="applicability | start | stop", description="The kind of condition.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["applicability", "start", "stop"], }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionActionCondition`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "kind", "expression"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionCondition`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("kind", "kind__ext")] return required_fields class PlanDefinitionActionDynamicValue(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Dynamic aspects of the definition. Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result. """ __resource_type__ = "PlanDefinitionActionDynamicValue" expression: fhirtypes.ExpressionType | None = Field( default=None, alias="expression", title="An expression that provides the dynamic value for the customization", description="An expression specifying the value of the customized element.", json_schema_extra={ "element_property": True, }, ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="The path to the element to be set dynamically", description=( "The path to the element to be customized. This is the path on the " "resource that will hold the result of the calculation defined by the " "expression. The specified path SHALL be a FHIRPath resolvable on the " "specified target type of the ActivityDefinition, and SHALL consist " "only of identifiers, constant indexers, and a restricted subset of " "functions. The path is allowed to contain qualifiers (.) to traverse " "sub-elements, as well as indexers ([x]) to traverse multiple-" "cardinality sub-elements (see the [Simple FHIRPath " "Profile](fhirpath.html#simple) for full details)." ), json_schema_extra={ "element_property": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionActionDynamicValue`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "path", "expression"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionDynamicValue`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class PlanDefinitionActionInput(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Input data requirements. Defines input data requirements for the action. """ __resource_type__ = "PlanDefinitionActionInput" relatedData: fhirtypes.IdType | None = Field( default=None, alias="relatedData", title="What data is provided", description=( "Points to an existing input or output element that provides data to " "this input." ), json_schema_extra={ "element_property": True, }, ) relatedData__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_relatedData", title="Extension field for ``relatedData``." ) requirement: fhirtypes.DataRequirementType | None = Field( default=None, alias="requirement", title="What data is provided", description="Defines the data that is to be provided as input to the action.", json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="User-visible title", description=( "A human-readable label for the data requirement used to label data " "flows in BPMN or similar diagrams. Also provides a human readable " "label when rendering the data requirement that conveys its purpose to " "human readers." ), json_schema_extra={ "element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionActionInput`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "title", "requirement", "relatedData", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionInput`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class PlanDefinitionActionOutput(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Output data definition. Defines the outputs of the action, if any. """ __resource_type__ = "PlanDefinitionActionOutput" relatedData: fhirtypes.StringType | None = Field( default=None, alias="relatedData", title="What data is provided", description=( "Points to an existing input or output element that is results as " "output from the action." ), json_schema_extra={ "element_property": True, }, ) relatedData__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_relatedData", title="Extension field for ``relatedData``." ) requirement: fhirtypes.DataRequirementType | None = Field( default=None, alias="requirement", title="What data is provided", description="Defines the data that results as output from the action.", json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="User-visible title", description=( "A human-readable label for the data requirement used to label data " "flows in BPMN or similar diagrams. Also provides a human readable " "label when rendering the data requirement that conveys its purpose to " "human readers." ), json_schema_extra={ "element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionActionOutput`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "title", "requirement", "relatedData", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionOutput`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class PlanDefinitionActionParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who should participate in the action. Indicates who should participate in performing the action described. """ __resource_type__ = "PlanDefinitionActionParticipant" actorId: fhirtypes.StringType | None = Field( default=None, alias="actorId", title="What actor", description=( "A reference to the id element of the actor who will participate in " "this action." ), json_schema_extra={ "element_property": True, }, ) actorId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_actorId", title="Extension field for ``actorId``." ) function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="E.g. Author, Reviewer, Witness, etc", description=( "Indicates how the actor will be involved in the action - author, " "reviewer, witness, etc." ), json_schema_extra={ "element_property": True, }, ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="E.g. Nurse, Surgeon, Parent", description=( "The role the participant should play in performing the described " "action." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "careteam | device | group | healthcareservice | location | " "organization | patient | practitioner | practitionerrole | " "relatedperson" ), description="The type of participant in the action.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "careteam", "device", "group", "healthcareservice", "location", "organization", "patient", "practitioner", "practitionerrole", "relatedperson", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) typeCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="typeCanonical", title="Who or what can participate", description="The type of participant in the action.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CapabilityStatement"], }, ) typeCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_typeCanonical", title="Extension field for ``typeCanonical``.", ) typeReference: fhirtypes.ReferenceType | None = Field( default=None, alias="typeReference", title="Who or what can participate", description="The type of participant in the action.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CareTeam", "Device", "DeviceDefinition", "Endpoint", "Group", "HealthcareService", "Location", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionActionParticipant`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "actorId", "type", "typeCanonical", "typeReference", "role", "function", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class PlanDefinitionActionRelatedAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Relationship to another action. A relationship to another action such as "before" or "30-60 minutes after start of". """ __resource_type__ = "PlanDefinitionActionRelatedAction" endRelationship: fhirtypes.CodeType | None = Field( default=None, alias="endRelationship", title=( "before | before-start | before-end | concurrent | concurrent-with-" "start | concurrent-with-end | after | after-start | after-end" ), description="The relationship of the end of this action to the related action.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "before", "before-start", "before-end", "concurrent", "concurrent-with-start", "concurrent-with-end", "after", "after-start", "after-end", ], }, ) endRelationship__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_endRelationship", title="Extension field for ``endRelationship``.", ) offsetDuration: fhirtypes.DurationType | None = Field( default=None, alias="offsetDuration", title="Time offset for the relationship", description=( "A duration or range of durations to apply to the relationship. For " "example, 30-60 minutes before." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e offset[x] "one_of_many": "offset", "one_of_many_required": False, }, ) offsetRange: fhirtypes.RangeType | None = Field( default=None, alias="offsetRange", title="Time offset for the relationship", description=( "A duration or range of durations to apply to the relationship. For " "example, 30-60 minutes before." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e offset[x] "one_of_many": "offset", "one_of_many_required": False, }, ) relationship: fhirtypes.CodeType | None = Field( default=None, alias="relationship", title=( "before | before-start | before-end | concurrent | concurrent-with-" "start | concurrent-with-end | after | after-start | after-end" ), description="The relationship of the start of this action to the related action.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "before", "before-start", "before-end", "concurrent", "concurrent-with-start", "concurrent-with-end", "after", "after-start", "after-end", ], }, ) relationship__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_relationship", title="Extension field for ``relationship``.", ) targetId: fhirtypes.IdType | None = Field( default=None, alias="targetId", title="What action is this related to", description="The element id of the target related action.", json_schema_extra={ "element_property": True, "element_required": True, }, ) targetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_targetId", title="Extension field for ``targetId``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionActionRelatedAction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "targetId", "relationship", "endRelationship", "offsetDuration", "offsetRange", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionRelatedAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("relationship", "relationship__ext"), ("targetId", "targetId__ext"), ] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"offset": ["offsetDuration", "offsetRange"]} return one_of_many_fields class PlanDefinitionActor(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Actors within the plan. Actors represent the individuals or groups involved in the execution of the defined set of activities. """ __resource_type__ = "PlanDefinitionActor" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Describes the actor", description=( "A description of how the actor fits into the overall actions of the " "plan definition." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) option: typing.List[fhirtypes.PlanDefinitionActorOptionType] = Field( default=..., alias="option", title="Who or what can be this actor", description="The characteristics of the candidates that could serve as the actor.", json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="User-visible title", description="A descriptive label for the actor.", json_schema_extra={ "element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionActor`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "title", "description", "option", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionActor`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class PlanDefinitionActorOption(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who or what can be this actor. The characteristics of the candidates that could serve as the actor. """ __resource_type__ = "PlanDefinitionActorOption" role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="E.g. Nurse, Surgeon, Parent", description=( "The role the participant should play in performing the described " "action." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "careteam | device | group | healthcareservice | location | " "organization | patient | practitioner | practitionerrole | " "relatedperson" ), description="The type of participant in the action.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "careteam", "device", "group", "healthcareservice", "location", "organization", "patient", "practitioner", "practitionerrole", "relatedperson", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) typeCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="typeCanonical", title="Who or what can participate", description="The type of participant in the action.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CapabilityStatement"], }, ) typeCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_typeCanonical", title="Extension field for ``typeCanonical``.", ) typeReference: fhirtypes.ReferenceType | None = Field( default=None, alias="typeReference", title="Who or what can participate", description="The type of participant in the action.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CareTeam", "Device", "DeviceDefinition", "Endpoint", "Group", "HealthcareService", "Location", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionActorOption`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "typeCanonical", "typeReference", "role", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionActorOption`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class PlanDefinitionGoal(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. What the plan is trying to accomplish. A goal describes an expected outcome that activities within the plan are intended to achieve. For example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, meeting the acceptance criteria for a test as specified by a quality specification, etc. """ __resource_type__ = "PlanDefinitionGoal" addresses: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="addresses", title="What does the goal address", description=( "Identifies problems, conditions, issues, or concerns the goal is " "intended to address." ), json_schema_extra={ "element_property": True, }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="E.g. Treatment, dietary, behavioral", description="Indicates a category the goal falls within.", json_schema_extra={ "element_property": True, }, ) description: fhirtypes.CodeableConceptType = Field( default=..., alias="description", title="Code or text describing the goal", description=( "Human-readable and/or coded description of a specific desired " 'objective of care, such as "control blood pressure" or "negotiate an ' 'obstacle course" or "dance with child at wedding".' ), json_schema_extra={ "element_property": True, }, ) documentation: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="documentation", title="Supporting documentation for the goal", description=( "Didactic or other informational resources associated with the goal " "that provide further supporting information about the goal. " "Information resources can include inline text commentary and links to " "web resources." ), json_schema_extra={ "element_property": True, }, ) priority: fhirtypes.CodeableConceptType | None = Field( default=None, alias="priority", title="high-priority | medium-priority | low-priority", description=( "Identifies the expected level of importance associated with " "reaching/sustaining the defined goal." ), json_schema_extra={ "element_property": True, }, ) start: fhirtypes.CodeableConceptType | None = Field( default=None, alias="start", title="When goal pursuit begins", description="The event after which the goal should begin being pursued.", json_schema_extra={ "element_property": True, }, ) target: typing.List[fhirtypes.PlanDefinitionGoalTargetType] | None = Field( default=None, alias="target", title="Target outcome for the goal", description="Indicates what should be done and within what timeframe.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionGoal`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "category", "description", "priority", "start", "addresses", "documentation", "target", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionGoal`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class PlanDefinitionGoalTarget(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Target outcome for the goal. Indicates what should be done and within what timeframe. """ __resource_type__ = "PlanDefinitionGoalTarget" detailBoolean: bool | None = Field( default=None, alias="detailBoolean", title="The target value to be achieved", description=( "The target value of the measure to be achieved to signify fulfillment " "of the goal, e.g. 150 pounds or 7.0%, or in the case of pharmaceutical" " quality - NMT 0.6%, Clear solution, etc. Either the high or low or " "both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any value at or " "below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any value at or above the low " "value." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detailBoolean", title="Extension field for ``detailBoolean``.", ) detailCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="detailCodeableConcept", title="The target value to be achieved", description=( "The target value of the measure to be achieved to signify fulfillment " "of the goal, e.g. 150 pounds or 7.0%, or in the case of pharmaceutical" " quality - NMT 0.6%, Clear solution, etc. Either the high or low or " "both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any value at or " "below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any value at or above the low " "value." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailInteger: fhirtypes.IntegerType | None = Field( default=None, alias="detailInteger", title="The target value to be achieved", description=( "The target value of the measure to be achieved to signify fulfillment " "of the goal, e.g. 150 pounds or 7.0%, or in the case of pharmaceutical" " quality - NMT 0.6%, Clear solution, etc. Either the high or low or " "both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any value at or " "below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any value at or above the low " "value." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detailInteger", title="Extension field for ``detailInteger``.", ) detailQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="detailQuantity", title="The target value to be achieved", description=( "The target value of the measure to be achieved to signify fulfillment " "of the goal, e.g. 150 pounds or 7.0%, or in the case of pharmaceutical" " quality - NMT 0.6%, Clear solution, etc. Either the high or low or " "both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any value at or " "below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any value at or above the low " "value." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailRange: fhirtypes.RangeType | None = Field( default=None, alias="detailRange", title="The target value to be achieved", description=( "The target value of the measure to be achieved to signify fulfillment " "of the goal, e.g. 150 pounds or 7.0%, or in the case of pharmaceutical" " quality - NMT 0.6%, Clear solution, etc. Either the high or low or " "both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any value at or " "below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any value at or above the low " "value." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailRatio: fhirtypes.RatioType | None = Field( default=None, alias="detailRatio", title="The target value to be achieved", description=( "The target value of the measure to be achieved to signify fulfillment " "of the goal, e.g. 150 pounds or 7.0%, or in the case of pharmaceutical" " quality - NMT 0.6%, Clear solution, etc. Either the high or low or " "both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any value at or " "below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any value at or above the low " "value." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailString: fhirtypes.StringType | None = Field( default=None, alias="detailString", title="The target value to be achieved", description=( "The target value of the measure to be achieved to signify fulfillment " "of the goal, e.g. 150 pounds or 7.0%, or in the case of pharmaceutical" " quality - NMT 0.6%, Clear solution, etc. Either the high or low or " "both values of the range can be specified. When a low value is " "missing, it indicates that the goal is achieved at any value at or " "below the high value. Similarly, if the high value is missing, it " "indicates that the goal is achieved at any value at or above the low " "value." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e detail[x] "one_of_many": "detail", "one_of_many_required": False, }, ) detailString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detailString", title="Extension field for ``detailString``.", ) due: fhirtypes.DurationType | None = Field( default=None, alias="due", title="Reach goal within", description=( "Indicates the timeframe after the start of the goal in which the goal " "should be met." ), json_schema_extra={ "element_property": True, }, ) measure: fhirtypes.CodeableConceptType | None = Field( default=None, alias="measure", title="The parameter whose value is to be tracked", description=( "The parameter whose value is to be tracked, e.g. body weight, blood " "pressure, or hemoglobin A1c level." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PlanDefinitionGoalTarget`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "measure", "detailQuantity", "detailRange", "detailCodeableConcept", "detailString", "detailBoolean", "detailInteger", "detailRatio", "due", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PlanDefinitionGoalTarget`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "detail": [ "detailBoolean", "detailCodeableConcept", "detailInteger", "detailQuantity", "detailRange", "detailRatio", "detailString", ] } return one_of_many_fields ================================================ FILE: fhir/resources/practitioner.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Practitioner Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Practitioner(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A person with a formal responsibility in the provisioning of healthcare or related services. A person who is directly or indirectly involved in the provisioning of healthcare or related services. """ __resource_type__ = "Practitioner" active: bool | None = Field( default=None, alias="active", title="Whether this practitioner's record is in active use", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) address: typing.List[fhirtypes.AddressType] | None = Field( default=None, alias="address", title=( "Address(es) of the practitioner that are not role specific (typically " "home address)" ), description=( "Address(es) of the practitioner that are not role specific (typically " "home address). Work addresses are not typically entered in this " "property as they are usually role dependent." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) birthDate: fhirtypes.DateType | None = Field( default=None, alias="birthDate", title="The date on which the practitioner was born", description="The date of birth for the practitioner.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) birthDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_birthDate", title="Extension field for ``birthDate``." ) communication: typing.List[fhirtypes.PractitionerCommunicationType] | None = Field( default=None, alias="communication", title="A language which may be used to communicate with the practitioner", description=( "A language which may be used to communicate with the practitioner, " "often for correspondence/administrative purposes. The " "`PractitionerRole.communication` property should be used for " "publishing the languages that a practitioner is able to communicate " "with patients (on a per Organization/Role basis)." ), json_schema_extra={ "element_property": True, }, ) deceasedBoolean: bool | None = Field( default=None, alias="deceasedBoolean", title="Indicates if the practitioner is deceased or not", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deceasedBoolean", title="Extension field for ``deceasedBoolean``.", ) deceasedDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="deceasedDateTime", title="Indicates if the practitioner is deceased or not", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e deceased[x] "one_of_many": "deceased", "one_of_many_required": False, }, ) deceasedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_deceasedDateTime", title="Extension field for ``deceasedDateTime``.", ) gender: fhirtypes.CodeType | None = Field( default=None, alias="gender", title="male | female | other | unknown", description=( "Administrative Gender - the gender that the person is considered to " "have for administration and record keeping purposes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["male", "female", "other", "unknown"], }, ) gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_gender", title="Extension field for ``gender``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="An identifier for the person as this agent", description="An identifier that applies to this person in this role.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: typing.List[fhirtypes.HumanNameType] | None = Field( default=None, alias="name", title="The name(s) associated with the practitioner", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) photo: typing.List[fhirtypes.AttachmentType] | None = Field( default=None, alias="photo", title="Image of the person", description=None, json_schema_extra={ "element_property": True, }, ) qualification: typing.List[fhirtypes.PractitionerQualificationType] | None = Field( default=None, alias="qualification", title=( "Qualifications, certifications, accreditations, licenses, training, " "etc. pertaining to the provision of care" ), description=( "The official qualifications, certifications, accreditations, training," " licenses (and other types of educations/skills/capabilities) that " "authorize or otherwise pertain to the provision of care by the " "practitioner. For example, a medical license issued by a medical " "board of licensure authorizing the practitioner to practice medicine " "within a certain locality." ), json_schema_extra={ "element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="A contact detail for the practitioner (that apply to all roles)", description=( "A contact detail for the practitioner, e.g. a telephone number or an " "email address." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Practitioner`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "name", "telecom", "gender", "birthDate", "deceasedBoolean", "deceasedDateTime", "address", "photo", "qualification", "communication", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Practitioner`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "active", "name", "telecom", "gender", "birthDate", "deceasedBoolean", "deceasedDateTime", "address", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"deceased": ["deceasedBoolean", "deceasedDateTime"]} return one_of_many_fields class PractitionerCommunication(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A language which may be used to communicate with the practitioner. A language which may be used to communicate with the practitioner, often for correspondence/administrative purposes. The `PractitionerRole.communication` property should be used for publishing the languages that a practitioner is able to communicate with patients (on a per Organization/Role basis). """ __resource_type__ = "PractitionerCommunication" language: fhirtypes.CodeableConceptType = Field( default=..., alias="language", title="The language code used to communicate with the practitioner", description=( "The ISO-639-1 alpha 2 code in lower case for the language, optionally " "followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in" ' upper case; e.g. "en" for English, or "en-US" for American English ' 'versus "en-AU" for Australian English.' ), json_schema_extra={ "element_property": True, }, ) preferred: bool | None = Field( default=None, alias="preferred", title="Language preference indicator", description=( "Indicates whether or not the person prefers this language (over other " "languages he masters up a certain level)." ), json_schema_extra={ "element_property": True, }, ) preferred__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preferred", title="Extension field for ``preferred``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PractitionerCommunication`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "language", "preferred"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PractitionerCommunication`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class PractitionerQualification(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Qualifications, certifications, accreditations, licenses, training, etc. pertaining to the provision of care. The official qualifications, certifications, accreditations, training, licenses (and other types of educations/skills/capabilities) that authorize or otherwise pertain to the provision of care by the practitioner. For example, a medical license issued by a medical board of licensure authorizing the practitioner to practice medicine within a certain locality. """ __resource_type__ = "PractitionerQualification" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="Coded representation of the qualification", description=None, json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="An identifier for this qualification for the practitioner", description="An identifier that applies to this person's qualification.", json_schema_extra={ "element_property": True, }, ) issuer: fhirtypes.ReferenceType | None = Field( default=None, alias="issuer", title="Organization that regulates and issues the qualification", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Period during which the qualification is valid", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PractitionerQualification`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "code", "period", "issuer", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PractitionerQualification`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/practitionerrole.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/PractitionerRole Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class PractitionerRole(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Roles/organizations the practitioner is associated with. A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time. """ __resource_type__ = "PractitionerRole" active: bool | None = Field( default=None, alias="active", title="Whether this practitioner role record is in active use", description=( " Whether this practitioner role record is in active use. Some systems " "may use this property to mark non-active practitioners, such as those " "that are not currently employed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) availability: typing.List[fhirtypes.AvailabilityType] | None = Field( default=None, alias="availability", title=( "Times the Practitioner is available at this location and/or healthcare" " service (including exceptions)" ), description=( "A collection of times the practitioner is available or performing this" " role at the location and/or healthcareservice." ), json_schema_extra={ "element_property": True, }, ) characteristic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="characteristic", title="Collection of characteristics (attributes)", description=None, json_schema_extra={ "element_property": True, }, ) code: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="code", title="Roles which this practitioner may perform", description=( "Roles which this practitioner is authorized to perform for the " "organization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) communication: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="communication", title=( "A language the practitioner (in this role) can use in patient " "communication" ), description=( "A language the practitioner can use in patient communication. The " "practitioner may know several languages (listed in " "practitioner.communication), however these are the languages that " "could be advertised in a directory for a patient to search." ), json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ExtendedContactDetailType] | None = Field( default=None, alias="contact", title="Official contact details relating to this PractitionerRole", description=( "The contact details of communication devices available relevant to the" " specific PractitionerRole. This can include addresses, phone numbers," " fax numbers, mobile numbers, email addresses and web sites." ), json_schema_extra={ "element_property": True, }, ) endpoint: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="endpoint", title="Endpoints for interacting with the practitioner in this role", description=( " Technical endpoints providing access to services operated for the " "practitioner with this role. Commonly used for locating scheduling " "services, or identifying where to send referrals electronically." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Endpoint"], }, ) healthcareService: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="healthcareService", title="Healthcare services provided for this role's Organization/Location(s)", description=( "The list of healthcare services that this worker provides for this " "role's Organization/Location(s)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["HealthcareService"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifiers for a role/location", description="Business Identifiers that are specific to a role/location.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) location: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="location", title="Location(s) where the practitioner provides care", description="The location(s) at which this practitioner provides care.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) organization: fhirtypes.ReferenceType | None = Field( default=None, alias="organization", title="Organization where the roles are available", description="The organization where the Practitioner performs the roles associated.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title=( "The period during which the practitioner is authorized to perform in " "these role(s)" ), description=( "The period during which the person is authorized to act as a " "practitioner in these role(s) for the organization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) practitioner: fhirtypes.ReferenceType | None = Field( default=None, alias="practitioner", title="Practitioner that provides services for the organization", description=( "Practitioner that is able to provide the defined services for the " "organization." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner"], }, ) specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialty", title="Specific specialty of the practitioner", description=( "The specialty of a practitioner that describes the functional role " "they are practicing at a given organization or location." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PractitionerRole`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "period", "practitioner", "organization", "code", "specialty", "location", "healthcareService", "contact", "characteristic", "communication", "availability", "endpoint", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PractitionerRole`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "active", "period", "practitioner", "organization", "code", "specialty", "location", ] ================================================ FILE: fhir/resources/primitivetype.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/PrimitiveType Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from . import datatype class PrimitiveType(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Parent type for DataTypes with a simple value. The base type for all re-useable types defined that have a simple property. """ __resource_type__ = "PrimitiveType" @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``PrimitiveType`` according to specification, with preserving the original sequence order. """ return ["id", "extension"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``PrimitiveType`` according to specification, with preserving the original sequence order. """ return [] ================================================ FILE: fhir/resources/procedure.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Procedure Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Procedure(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An action that is being or was performed on an individual or entity. An action that is or was performed on or for a patient, practitioner, device, organization, or location. For example, this can be a physical intervention on a patient like an operation, or less invasive like long term services, counseling, or hypnotherapy. This can be a quality or safety inspection for a location, organization, or device. This can be an accreditation procedure on a practitioner for licensing. """ __resource_type__ = "Procedure" basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="A request for this procedure", description=( "A reference to a resource that contains details of the request for " "this procedure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CarePlan", "ServiceRequest"], }, ) bodySite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="bodySite", title="Target body sites", description=( "Detailed and structured anatomical location information. Multiple " "locations are allowed - e.g. multiple punch biopsies of a lesion." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Classification of the procedure", description=( "A code that classifies the procedure for searching, sorting and " 'display purposes (e.g. "Surgical Procedure").' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Identification of the procedure", description=( "The specific procedure that is performed. Use text if the exact nature" ' of the procedure cannot be coded (e.g. "Laparoscopic Appendectomy").' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) complication: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="complication", title="Complication following the procedure", description=( "Any complications that occurred during the procedure, or in the " "immediate post-performance period. These are generally tracked " "separately from the notes, which will typically describe the procedure" " itself rather than any 'post procedure' issues." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="The Encounter during which this Procedure was created", description=( "The Encounter during which this Procedure was created or performed or " "to which the creation of this record is tightly associated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) focalDevice: typing.List[fhirtypes.ProcedureFocalDeviceType] | None = Field( default=None, alias="focalDevice", title="Manipulated, implanted, or removed device", description=( "A device that is implanted, removed or otherwise manipulated " "(calibration, battery replacement, fitting a prosthesis, attaching a " "wound-vac, etc.) as a focal portion of the Procedure." ), json_schema_extra={ "element_property": True, }, ) focus: fhirtypes.ReferenceType | None = Field( default=None, alias="focus", title=( "Who is the target of the procedure when it is not the subject of " "record only" ), description=( "Who is the target of the procedure when it is not the subject of " "record only. If focus is not present, then subject is the focus. If " "focus is present and the subject is one of the targets of the " "procedure, include subject as a focus as well. If focus is present and" " the subject is not included in focus, it implies that the procedure " "was only targeted on the focus. For example, when a caregiver is given" " education for a patient, the caregiver would be the focus and the " "procedure record is associated with the subject (e.g. patient). For " "example, use focus when recording the target of the education, " "training, or counseling is the parent or relative of a patient." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Group", "RelatedPerson", "Practitioner", "Organization", "CareTeam", "PractitionerRole", "Specimen", ], }, ) followUp: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="followUp", title="Instructions for follow up", description=( "If the procedure required specific follow up - e.g. removal of " "sutures. The follow up may be represented as a simple note or could " "potentially be more complex, in which case the CarePlan resource can " "be used." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Identifiers for this procedure", description=( "Business identifiers assigned to this procedure by the performer or " "other systems which remain constant as the resource is updated and is " "propagated from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="instantiatesCanonical", title="Instantiates FHIR protocol or definition", description=( "The URL pointing to a FHIR-defined protocol, guideline, order set or " "other definition that is adhered to in whole or in part by this " "Procedure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "PlanDefinition", "ActivityDefinition", "Measure", "OperationDefinition", "Questionnaire", ], }, ) instantiatesCanonical__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="instantiatesUri", title="Instantiates external protocol or definition", description=( "The URL pointing to an externally maintained protocol, guideline, " "order set or other definition that is adhered to in whole or in part " "by this Procedure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where the procedure happened", description=( "The location where the procedure actually happened. E.g. a newborn at" " home, a tracheostomy at a restaurant." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Additional information about the procedure", description="Any other notes and comments about the procedure.", json_schema_extra={ "element_property": True, }, ) occurrenceAge: fhirtypes.AgeType | None = Field( default=None, alias="occurrenceAge", title="When the procedure occurred or is occurring", description=( "Estimated or actual date, date-time, period, or age when the procedure" " did occur or is occurring. Allows a period to support complex " "procedures that span more than one date, and also allows for the " "length of the procedure to be captured." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When the procedure occurred or is occurring", description=( "Estimated or actual date, date-time, period, or age when the procedure" " did occur or is occurring. Allows a period to support complex " "procedures that span more than one date, and also allows for the " "length of the procedure to be captured." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="When the procedure occurred or is occurring", description=( "Estimated or actual date, date-time, period, or age when the procedure" " did occur or is occurring. Allows a period to support complex " "procedures that span more than one date, and also allows for the " "length of the procedure to be captured." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceRange: fhirtypes.RangeType | None = Field( default=None, alias="occurrenceRange", title="When the procedure occurred or is occurring", description=( "Estimated or actual date, date-time, period, or age when the procedure" " did occur or is occurring. Allows a period to support complex " "procedures that span more than one date, and also allows for the " "length of the procedure to be captured." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceString: fhirtypes.StringType | None = Field( default=None, alias="occurrenceString", title="When the procedure occurred or is occurring", description=( "Estimated or actual date, date-time, period, or age when the procedure" " did occur or is occurring. Allows a period to support complex " "procedures that span more than one date, and also allows for the " "length of the procedure to be captured." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceString", title="Extension field for ``occurrenceString``.", ) occurrenceTiming: fhirtypes.TimingType | None = Field( default=None, alias="occurrenceTiming", title="When the procedure occurred or is occurring", description=( "Estimated or actual date, date-time, period, or age when the procedure" " did occur or is occurring. Allows a period to support complex " "procedures that span more than one date, and also allows for the " "length of the procedure to be captured." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) outcome: fhirtypes.CodeableConceptType | None = Field( default=None, alias="outcome", title="The result of procedure", description=( "The outcome of the procedure - did it resolve the reasons for the " "procedure being performed?" ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced event", description=( "A larger event of which this particular procedure is a component or " "step." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Procedure", "Observation", "MedicationAdministration", ], }, ) performer: typing.List[fhirtypes.ProcedurePerformerType] | None = Field( default=None, alias="performer", title="Who performed the procedure and what they did", description=( "Indicates who or what performed the procedure and how they were " "involved." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="reason", title="The justification that the procedure was performed", description=( "The coded reason or reference why the procedure was performed. This " "may be a coded entity of some type, be present as text, or be a " "reference to one of several resources that justify the procedure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "Procedure", "DiagnosticReport", "DocumentReference", ], }, ) recorded: fhirtypes.DateTimeType | None = Field( default=None, alias="recorded", title="When the procedure was first captured in the subject's record", description=( "The date the occurrence of the procedure was first captured in the " "record regardless of Procedure.status (potentially after the " "occurrence of the event)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) recorded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recorded", title="Extension field for ``recorded``." ) recorder: fhirtypes.ReferenceType | None = Field( default=None, alias="recorder", title="Who recorded the procedure", description=( "Individual who recorded the record and takes responsibility for its " "content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "RelatedPerson", "Practitioner", "PractitionerRole", ], }, ) report: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="report", title="Any report resulting from the procedure", description=( "This could be a histology result, pathology report, surgical report, " "etc." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "DiagnosticReport", "DocumentReference", "Composition", ], }, ) reportedBoolean: bool | None = Field( default=None, alias="reportedBoolean", title="Reported rather than primary record", description=( "Indicates if this record was captured as a secondary 'reported' record" " rather than as an original primary source-of-truth record. It may " "also indicate the source of the report." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e reported[x] "one_of_many": "reported", "one_of_many_required": False, }, ) reportedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reportedBoolean", title="Extension field for ``reportedBoolean``.", ) reportedReference: fhirtypes.ReferenceType | None = Field( default=None, alias="reportedReference", title="Reported rather than primary record", description=( "Indicates if this record was captured as a secondary 'reported' record" " rather than as an original primary source-of-truth record. It may " "also indicate the source of the report." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e reported[x] "one_of_many": "reported", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "RelatedPerson", "Practitioner", "PractitionerRole", "Organization", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "preparation | in-progress | not-done | on-hold | stopped | completed |" " entered-in-error | unknown" ), description=( "A code specifying the state of the procedure. Generally, this will be " "the in-progress or completed state." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "preparation", "in-progress", "not-done", "on-hold", "stopped", "completed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="statusReason", title="Reason for current status", description="Captures the reason for the current state of the procedure.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Individual or entity the procedure was performed on", description=( "On whom or on what the procedure was performed. This is usually an " "individual human, but can also be performed on animals, groups of " "humans or animals, organizations or practitioners (for licensing), " "locations or devices (for safety inspections or regulatory " "authorizations). If the actual focus of the procedure is different " "from the subject, the focus element specifies the actual focus of the " "procedure." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Group", "Device", "Practitioner", "Organization", "Location", ], }, ) supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supportingInfo", title="Extra information relevant to the procedure", description=( "Other resources from the patient record that may be relevant to the " "procedure. The information from these resources was either used to " "create the instance or is provided to help with its interpretation. " "This extension should not be used if more specific inline elements or " "extensions are available." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) used: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="used", title="Items used during procedure", description=( "Identifies medications, devices and any other substance used as part " "of the procedure." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Medication", "Substance", "BiologicallyDerivedProduct", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Procedure`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "partOf", "status", "statusReason", "category", "code", "subject", "focus", "encounter", "occurrenceDateTime", "occurrencePeriod", "occurrenceString", "occurrenceAge", "occurrenceRange", "occurrenceTiming", "recorded", "recorder", "reportedBoolean", "reportedReference", "performer", "location", "reason", "bodySite", "outcome", "report", "complication", "followUp", "note", "focalDevice", "used", "supportingInfo", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Procedure`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "partOf", "status", "statusReason", "category", "code", "subject", "focus", "encounter", "occurrenceDateTime", "occurrencePeriod", "occurrenceString", "occurrenceAge", "occurrenceRange", "occurrenceTiming", "recorded", "recorder", "reportedBoolean", "reportedReference", "performer", "location", "reason", "bodySite", "outcome", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "occurrence": [ "occurrenceAge", "occurrenceDateTime", "occurrencePeriod", "occurrenceRange", "occurrenceString", "occurrenceTiming", ], "reported": ["reportedBoolean", "reportedReference"], } return one_of_many_fields class ProcedureFocalDevice(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Manipulated, implanted, or removed device. A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure. """ __resource_type__ = "ProcedureFocalDevice" action: fhirtypes.CodeableConceptType | None = Field( default=None, alias="action", title="Kind of change to device", description="The kind of change that happened to the device during the procedure.", json_schema_extra={ "element_property": True, }, ) manipulated: fhirtypes.ReferenceType = Field( default=..., alias="manipulated", title="Device that was changed", description="The device that was manipulated (changed) during the procedure.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ProcedureFocalDevice`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "action", "manipulated"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ProcedureFocalDevice`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ProcedurePerformer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who performed the procedure and what they did. Indicates who or what performed the procedure and how they were involved. """ __resource_type__ = "ProcedurePerformer" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Who performed the procedure", description="Indicates who or what performed the procedure.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Patient", "RelatedPerson", "Device", "CareTeam", "HealthcareService", ], }, ) function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="Type of performance", description=( "Distinguishes the type of involvement of the performer in the " "procedure. For example, surgeon, anaesthetist, endoscopist." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) onBehalfOf: fhirtypes.ReferenceType | None = Field( default=None, alias="onBehalfOf", title="Organization the device or practitioner was acting for", description=( "The Organization the Patient, RelatedPerson, Device, CareTeam, and " "HealthcareService was acting on behalf of." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="When the performer performed the procedure", description="Time period during which the performer performed the procedure.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ProcedurePerformer`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "function", "actor", "onBehalfOf", "period", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ProcedurePerformer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "function", "actor"] ================================================ FILE: fhir/resources/productshelflife.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ProductShelfLife Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backbonetype, fhirtypes class ProductShelfLife(backbonetype.BackboneType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The shelf-life and storage information for a medicinal product item or container can be described using this class. """ __resource_type__ = "ProductShelfLife" periodDuration: fhirtypes.DurationType | None = Field( default=None, alias="periodDuration", title=( "The shelf life time period can be specified using a numerical value " "for the period of time and its unit of time measurement The unit of " "measurement shall be specified in accordance with ISO 11240 and the " "resulting terminology The symbol and the symbol identifier shall be " "used" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e period[x] "one_of_many": "period", "one_of_many_required": False, }, ) periodString: fhirtypes.StringType | None = Field( default=None, alias="periodString", title=( "The shelf life time period can be specified using a numerical value " "for the period of time and its unit of time measurement The unit of " "measurement shall be specified in accordance with ISO 11240 and the " "resulting terminology The symbol and the symbol identifier shall be " "used" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e period[x] "one_of_many": "period", "one_of_many_required": False, }, ) periodString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_periodString", title="Extension field for ``periodString``.", ) specialPrecautionsForStorage: typing.List[ fhirtypes.CodeableConceptType ] | None = Field( default=None, alias="specialPrecautionsForStorage", title=( "Special precautions for storage, if any, can be specified using an " "appropriate controlled vocabulary The controlled term and the " "controlled term identifier shall be specified" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title=( "This describes the shelf life, taking into account various scenarios " "such as shelf life of the packaged Medicinal Product itself, shelf " "life after transformation where necessary and shelf life after the " "first opening of a bottle, etc. The shelf life type shall be specified" " using an appropriate controlled vocabulary The controlled term and " "the controlled term identifier shall be specified" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ProductShelfLife`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "periodDuration", "periodString", "specialPrecautionsForStorage", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ProductShelfLife`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "periodDuration", "periodString", "specialPrecautionsForStorage", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"period": ["periodDuration", "periodString"]} return one_of_many_fields ================================================ FILE: fhir/resources/provenance.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Provenance Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Provenance(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who, What, When for a set of resources. Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies. """ __resource_type__ = "Provenance" activity: fhirtypes.CodeableConceptType | None = Field( default=None, alias="activity", title="Activity that occurred", description=( "An activity is something that occurs over a period of time and acts " "upon or with entities; it may include consuming, processing, " "transforming, modifying, relocating, using, or generating entities." ), json_schema_extra={ "element_property": True, }, ) agent: typing.List[fhirtypes.ProvenanceAgentType] = Field( default=..., alias="agent", title="Actor involved", description=( "An actor taking a role in an activity for which it can be assigned " "some degree of responsibility for the activity taking place." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authorization: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="authorization", title="Authorization (purposeOfUse) related to the event", description=( "The authorization (e.g., PurposeOfUse) that was used during the event " "being recorded." ), json_schema_extra={ "element_property": True, }, ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Workflow authorization within which this event occurred", description=( "Allows tracing of authorizatino for the events and tracking whether " "proposals/recommendations were acted upon." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CarePlan", "DeviceRequest", "ImmunizationRecommendation", "MedicationRequest", "NutritionOrder", "ServiceRequest", "Task", ], }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title=( "Encounter within which this event occurred or which the event is " "tightly associated" ), description=( "This will typically be the encounter the event occurred, but some " "events may be initiated prior to or after the official completion of " "an encounter but still be tied to the context of the encounter (e.g. " "pre-admission lab tests)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) entity: typing.List[fhirtypes.ProvenanceEntityType] | None = Field( default=None, alias="entity", title="An entity used in this activity", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where the activity occurred, if relevant", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) occurredDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurredDateTime", title="When the activity occurred", description="The period during which the activity occurred.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e occurred[x] "one_of_many": "occurred", "one_of_many_required": False, }, ) occurredDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurredDateTime", title="Extension field for ``occurredDateTime``.", ) occurredPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurredPeriod", title="When the activity occurred", description="The period during which the activity occurred.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e occurred[x] "one_of_many": "occurred", "one_of_many_required": False, }, ) patient: fhirtypes.ReferenceType | None = Field( default=None, alias="patient", title=( "The patient is the subject of the data created/updated (.target) by " "the activity" ), description=( "The patient element is available to enable deterministic tracking of " "activities that involve the patient as the subject of the data used in" " an activity." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) policy: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="policy", title="Policy or plan the activity was defined by", description=( "Policy or plan the activity was defined by. Typically, a single " "activity may have multiple applicable policy documents, such as " "patient consent, guarantor funding, etc." ), json_schema_extra={ "element_property": True, }, ) policy__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_policy", title="Extension field for ``policy``." ) recorded: fhirtypes.InstantType | None = Field( default=None, alias="recorded", title="When the activity was recorded / updated", description="The instant of time at which the activity was recorded.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) recorded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_recorded", title="Extension field for ``recorded``." ) signature: typing.List[fhirtypes.SignatureType] | None = Field( default=None, alias="signature", title="Signature on target", description=( "A digital signature on the target Reference(s). The signer should " "match a Provenance.agent. The purpose of the signature is indicated." ), json_schema_extra={ "element_property": True, }, ) target: typing.List[fhirtypes.ReferenceType] = Field( default=..., alias="target", title="Target Reference(s) (usually version specific)", description=( "The Reference(s) that were generated or updated by the activity " "described in this resource. A provenance can point to more than one " "target if multiple resources were created/updated by the same " "activity." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Provenance`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "target", "occurredPeriod", "occurredDateTime", "recorded", "policy", "location", "authorization", "activity", "basedOn", "patient", "encounter", "agent", "entity", "signature", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Provenance`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "target", "recorded", "agent", "entity", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"occurred": ["occurredDateTime", "occurredPeriod"]} return one_of_many_fields class ProvenanceAgent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Actor involved. An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place. """ __resource_type__ = "ProvenanceAgent" onBehalfOf: fhirtypes.ReferenceType | None = Field( default=None, alias="onBehalfOf", title="The agent that delegated", description=( "The agent that delegated authority to perform the activity performed " "by the agent.who element." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", "Patient", ], }, ) role: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="role", title="What the agents role was", description=( "The structural roles of the agent indicating the agent's competency. " "The security role enabling the agent with respect to the activity." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="How the agent participated", description="The Functional Role of the agent with respect to the activity.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) who: fhirtypes.ReferenceType = Field( default=..., alias="who", title="The agent that participated in the event", description="Indicates who or what performed in the event.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", "Patient", "Device", "RelatedPerson", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ProvenanceAgent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "role", "who", "onBehalfOf", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ProvenanceAgent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "who"] class ProvenanceEntity(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An entity used in this activity. """ __resource_type__ = "ProvenanceEntity" agent: typing.List[fhirtypes.ProvenanceAgentType] | None = Field( default=None, alias="agent", title="Entity is attributed to this agent", description=( "The entity is attributed to an agent to express the agent's " "responsibility for that entity, possibly along with other agents. This" " description can be understood as shorthand for saying that the agent " "was responsible for the activity which used the entity." ), json_schema_extra={ "element_property": True, }, ) role: fhirtypes.CodeType | None = Field( default=None, alias="role", title="revision | quotation | source | instantiates | removal", description="How the entity was used during the activity.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "revision", "quotation", "source", "instantiates", "removal", ], }, ) role__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_role", title="Extension field for ``role``." ) what: fhirtypes.ReferenceType = Field( default=..., alias="what", title="Identity of entity", description=( "Identity of the Entity used. May be a logical or physical uri and " "maybe absolute or relative." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ProvenanceEntity`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "role", "what", "agent"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ProvenanceEntity`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "role", "what"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("role", "role__ext")] return required_fields ================================================ FILE: fhir/resources/py.typed ================================================ ================================================ FILE: fhir/resources/quantity.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SimpleQuantity Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class Quantity(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A measured or measurable amount. A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. """ __resource_type__ = "Quantity" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Coded form of the unit", description=( "A computer processable form of the unit in some unit representation " "system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) comparator: fhirtypes.CodeType | None = Field( default=None, alias="comparator", title="< | <= | >= | > | ad - how to understand the value", description=( "How the value should be understood and represented - whether the " "actual value is greater or less than the stated value due to " 'measurement issues; e.g. if the comparator is "<" , then the real ' "value is < stated value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comparator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comparator", title="Extension field for ``comparator``." ) system: fhirtypes.UriType | None = Field( default=None, alias="system", title="System that defines coded unit form", description=( "The identification of the system that provides the coded form of the " "unit." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) unit: fhirtypes.StringType | None = Field( default=None, alias="unit", title="Unit representation", description="A human-readable form of the unit.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) unit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_unit", title="Extension field for ``unit``." ) value: fhirtypes.DecimalType | None = Field( default=None, alias="value", title="Numerical value (with implicit precision)", description=( "The value of the measured amount. The value includes an implicit " "precision in the presentation of the value." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Quantity`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "value", "comparator", "unit", "system", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Quantity`` according to specification, with preserving the original sequence order. """ return ["value", "comparator", "unit", "system", "code"] ================================================ FILE: fhir/resources/questionnaire.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Questionnaire Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Questionnaire(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A structured set of questions. A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection. """ __resource_type__ = "Questionnaire" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the questionnaire was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) code: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="code", title="Concept that represents the overall questionnaire", description=( "An identifier for this collection of questions in a particular " "terminology such as LOINC." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the questionnaire and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the questionnaire." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the questionnaire was last " "significantly changed. The date must change when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the questionnaire " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) derivedFrom: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="derivedFrom", title="Based on Questionnaire", description="The URL of a Questionnaire that this Questionnaire is based on.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Questionnaire"], }, ) derivedFrom__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_derivedFrom", title="Extension field for ``derivedFrom``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the questionnaire", description=( "A free text natural language description of the questionnaire from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the questionnaire is expected to be used", description=( "The period during which the questionnaire content was or is planned to" " be in active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this questionnaire is authored for " "testing purposes (or education/evaluation/marketing) and is not " "intended for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier for questionnaire", description=( "A formal identifier that is used to identify this questionnaire when " "it is represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) item: typing.List[fhirtypes.QuestionnaireItemType] | None = Field( default=None, alias="item", title="Questions and sections within the Questionnaire", description=( "A particular question, question grouping or display text that is part " "of the questionnaire." ), json_schema_extra={ "element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for questionnaire (if applicable)", description=( "A legal or geographic region in which the questionnaire is intended to" " be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the questionnaire was last reviewed by the publisher", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this questionnaire (computer friendly)", description=( "A natural language name identifying the questionnaire. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the questionnaire." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this questionnaire is defined", description=( "Explanation of why this questionnaire is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description="The current state of this questionnaire.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subjectType: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="subjectType", title="Resource that can be subject of QuestionnaireResponse", description=( "The types of subjects that can be the subject of responses created for" " the questionnaire." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subjectType__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_subjectType", title="Extension field for ``subjectType``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this questionnaire (human friendly)", description="A short, descriptive, user-friendly title for the questionnaire.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this questionnaire, represented as an " "absolute URI (globally unique)" ), description=( "An absolute URI that is used to identify this questionnaire when it is" " referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which an authoritative instance of this" " questionnaire is (or will be) published. This URL can be the target " "of a canonical reference. It SHALL remain the same when the " "questionnaire is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate questionnaires." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the questionnaire", description=( "The identifier that is used to identify this version of the " "questionnaire when it is referenced in a specification, model, design " "or instance. This is an arbitrary value managed by the questionnaire " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Questionnaire`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "derivedFrom", "status", "experimental", "subjectType", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "copyrightLabel", "approvalDate", "lastReviewDate", "effectivePeriod", "code", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Questionnaire`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "derivedFrom", "status", "experimental", "subjectType", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "effectivePeriod", "code", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields class QuestionnaireItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Questions and sections within the Questionnaire. A particular question, question grouping or display text that is part of the questionnaire. """ __resource_type__ = "QuestionnaireItem" answerConstraint: fhirtypes.CodeType | None = Field( default=None, alias="answerConstraint", title="optionsOnly | optionsOrType | optionsOrString", description=( "For items that have a defined set of allowed answers (via answerOption" " or answerValueSet), indicates whether values *other* than those " "specified can be selected." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["optionsOnly", "optionsOrType", "optionsOrString"], }, ) answerConstraint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerConstraint", title="Extension field for ``answerConstraint``.", ) answerOption: typing.List[ fhirtypes.QuestionnaireItemAnswerOptionType ] | None = Field( default=None, alias="answerOption", title="Permitted answer", description="One of the permitted answers for the question.", json_schema_extra={ "element_property": True, }, ) answerValueSet: fhirtypes.CanonicalType | None = Field( default=None, alias="answerValueSet", title="ValueSet containing permitted answers", description=( "A reference to a value set containing a list of values representing " "permitted answers for a question." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) answerValueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerValueSet", title="Extension field for ``answerValueSet``.", ) code: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="code", title="Corresponding concept for this item in a terminology", description=( "A terminology code that corresponds to this group or question (e.g. a " "code from LOINC, which defines many questions and answers)." ), json_schema_extra={ "element_property": True, }, ) definition: fhirtypes.UriType | None = Field( default=None, alias="definition", title="ElementDefinition - details for the item", description=( "This element is a URI that refers to an " "[ElementDefinition](elementdefinition.html) or to an " "[ObservationDefinition](observationdefinition.html) that provides " "information about this item, including information that might " "otherwise be included in the instance of the Questionnaire resource. A" " detailed description of the construction of the URI is shown in " "[Comments](questionnaire.html#definition), below." ), json_schema_extra={ "element_property": True, }, ) definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) disabledDisplay: fhirtypes.CodeType | None = Field( default=None, alias="disabledDisplay", title="hidden | protected", description=( "Indicates if and how items that are disabled (because enableWhen " "evaluates to 'false') should be displayed." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["hidden", "protected"], }, ) disabledDisplay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_disabledDisplay", title="Extension field for ``disabledDisplay``.", ) enableBehavior: fhirtypes.CodeType | None = Field( default=None, alias="enableBehavior", title="all | any", description=( "Controls how multiple enableWhen values are interpreted - whether all" " or any must be true." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["all", "any"], }, ) enableBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_enableBehavior", title="Extension field for ``enableBehavior``.", ) enableWhen: typing.List[fhirtypes.QuestionnaireItemEnableWhenType] | None = Field( default=None, alias="enableWhen", title="Only allow data when", description=( "A constraint indicating that this item should only be enabled " "(displayed/allow answers to be captured) when the specified condition " "is true." ), json_schema_extra={ "element_property": True, }, ) initial: typing.List[fhirtypes.QuestionnaireItemInitialType] | None = Field( default=None, alias="initial", title="Initial value(s) when item is first rendered", description=( "One or more values that should be pre-populated in the answer when " "initially rendering the questionnaire for user input." ), json_schema_extra={ "element_property": True, }, ) item: typing.List[fhirtypes.QuestionnaireItemType] | None = Field( default=None, alias="item", title="Nested questionnaire items", description=( "Text, questions and other groups to be nested beneath a question or " "group." ), json_schema_extra={ "element_property": True, }, ) linkId: fhirtypes.StringType | None = Field( default=None, alias="linkId", title="Unique id for item in questionnaire", description=( "An identifier that is unique within the Questionnaire allowing linkage" " to the equivalent item in a QuestionnaireResponse resource." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) maxLength: fhirtypes.IntegerType | None = Field( default=None, alias="maxLength", title="No more than these many characters", description=( "The maximum number of characters that are permitted in the answer to " 'be considered a "valid" QuestionnaireResponse.' ), json_schema_extra={ "element_property": True, }, ) maxLength__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxLength", title="Extension field for ``maxLength``." ) prefix: fhirtypes.StringType | None = Field( default=None, alias="prefix", title='E.g. "1(a)", "2.5.3"', description=( "A short label for a particular group, question or set of display text " "within the questionnaire used for reference by the individual " "completing the questionnaire." ), json_schema_extra={ "element_property": True, }, ) prefix__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_prefix", title="Extension field for ``prefix``." ) readOnly: bool | None = Field( default=None, alias="readOnly", title="Don't allow human editing", description=( "An indication, when true, that the value cannot be changed by a human " "respondent to the Questionnaire." ), json_schema_extra={ "element_property": True, }, ) readOnly__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_readOnly", title="Extension field for ``readOnly``." ) repeats: bool | None = Field( default=None, alias="repeats", title="Whether the item may repeat", description=( "An indication, if true, that a QuestionnaireResponse for this item may" " include multiple answers associated with a single instance of this " "item (for question-type items) or multiple repetitions of the item " "(for group-type items)." ), json_schema_extra={ "element_property": True, }, ) repeats__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_repeats", title="Extension field for ``repeats``." ) required: bool | None = Field( default=None, alias="required", title="Whether the item must be included in data results", description=( 'An indication, if true, that the item must be present in a "completed"' " QuestionnaireResponse. If false, the item may be skipped when " "answering the questionnaire." ), json_schema_extra={ "element_property": True, }, ) required__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_required", title="Extension field for ``required``." ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Primary text for the item", description=( "The name of a section, the text of a question or text content for a " "display item." ), json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="group | display | boolean | decimal | integer | date | dateTime +", description=( "The type of questionnaire item this is - whether text for display, a " "grouping of other items or a particular type of data to be captured " "(string, integer, Coding, etc.)." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "group", "display", "boolean", "decimal", "integer", "date", "dateTime", "+", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``QuestionnaireItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "linkId", "definition", "code", "prefix", "text", "type", "enableWhen", "enableBehavior", "disabledDisplay", "required", "repeats", "readOnly", "maxLength", "answerConstraint", "answerValueSet", "answerOption", "initial", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``QuestionnaireItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("linkId", "linkId__ext"), ("type", "type__ext")] return required_fields class QuestionnaireItemAnswerOption(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Permitted answer. One of the permitted answers for the question. """ __resource_type__ = "QuestionnaireItemAnswerOption" initialSelected: bool | None = Field( default=None, alias="initialSelected", title="Whether option is selected by default", description=( "Indicates whether the answer value is selected when the list of " "possible answers is initially shown." ), json_schema_extra={ "element_property": True, }, ) initialSelected__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_initialSelected", title="Extension field for ``initialSelected``.", ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Answer value", description="A potential answer that's allowed as the answer to this question.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="Answer value", description="A potential answer that's allowed as the answer to this question.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Answer value", description="A potential answer that's allowed as the answer to this question.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Answer value", description="A potential answer that's allowed as the answer to this question.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Answer value", description="A potential answer that's allowed as the answer to this question.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Answer value", description="A potential answer that's allowed as the answer to this question.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``QuestionnaireItemAnswerOption`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "valueInteger", "valueDate", "valueTime", "valueString", "valueCoding", "valueReference", "initialSelected", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``QuestionnaireItemAnswerOption`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueCoding", "valueDate", "valueInteger", "valueReference", "valueString", "valueTime", ] } return one_of_many_fields class QuestionnaireItemEnableWhen(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Only allow data when. A constraint indicating that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true. """ __resource_type__ = "QuestionnaireItemEnableWhen" answerBoolean: bool | None = Field( default=None, alias="answerBoolean", title="Value for question comparison based on operator", description=( "A value that the referenced question is tested using the specified " "operator in order for the item to be enabled. If there are multiple " "answers, a match on any of the answers suffices. If different " "behavior is desired (all must match, at least 2 must match, etc.), " "consider using the enableWhenExpression extension." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": True, }, ) answerBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerBoolean", title="Extension field for ``answerBoolean``.", ) answerCoding: fhirtypes.CodingType | None = Field( default=None, alias="answerCoding", title="Value for question comparison based on operator", description=( "A value that the referenced question is tested using the specified " "operator in order for the item to be enabled. If there are multiple " "answers, a match on any of the answers suffices. If different " "behavior is desired (all must match, at least 2 must match, etc.), " "consider using the enableWhenExpression extension." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": True, }, ) answerDate: fhirtypes.DateType | None = Field( default=None, alias="answerDate", title="Value for question comparison based on operator", description=( "A value that the referenced question is tested using the specified " "operator in order for the item to be enabled. If there are multiple " "answers, a match on any of the answers suffices. If different " "behavior is desired (all must match, at least 2 must match, etc.), " "consider using the enableWhenExpression extension." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": True, }, ) answerDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerDate", title="Extension field for ``answerDate``." ) answerDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="answerDateTime", title="Value for question comparison based on operator", description=( "A value that the referenced question is tested using the specified " "operator in order for the item to be enabled. If there are multiple " "answers, a match on any of the answers suffices. If different " "behavior is desired (all must match, at least 2 must match, etc.), " "consider using the enableWhenExpression extension." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": True, }, ) answerDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerDateTime", title="Extension field for ``answerDateTime``.", ) answerDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="answerDecimal", title="Value for question comparison based on operator", description=( "A value that the referenced question is tested using the specified " "operator in order for the item to be enabled. If there are multiple " "answers, a match on any of the answers suffices. If different " "behavior is desired (all must match, at least 2 must match, etc.), " "consider using the enableWhenExpression extension." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": True, }, ) answerDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerDecimal", title="Extension field for ``answerDecimal``.", ) answerInteger: fhirtypes.IntegerType | None = Field( default=None, alias="answerInteger", title="Value for question comparison based on operator", description=( "A value that the referenced question is tested using the specified " "operator in order for the item to be enabled. If there are multiple " "answers, a match on any of the answers suffices. If different " "behavior is desired (all must match, at least 2 must match, etc.), " "consider using the enableWhenExpression extension." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": True, }, ) answerInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerInteger", title="Extension field for ``answerInteger``.", ) answerQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="answerQuantity", title="Value for question comparison based on operator", description=( "A value that the referenced question is tested using the specified " "operator in order for the item to be enabled. If there are multiple " "answers, a match on any of the answers suffices. If different " "behavior is desired (all must match, at least 2 must match, etc.), " "consider using the enableWhenExpression extension." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": True, }, ) answerReference: fhirtypes.ReferenceType | None = Field( default=None, alias="answerReference", title="Value for question comparison based on operator", description=( "A value that the referenced question is tested using the specified " "operator in order for the item to be enabled. If there are multiple " "answers, a match on any of the answers suffices. If different " "behavior is desired (all must match, at least 2 must match, etc.), " "consider using the enableWhenExpression extension." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) answerString: fhirtypes.StringType | None = Field( default=None, alias="answerString", title="Value for question comparison based on operator", description=( "A value that the referenced question is tested using the specified " "operator in order for the item to be enabled. If there are multiple " "answers, a match on any of the answers suffices. If different " "behavior is desired (all must match, at least 2 must match, etc.), " "consider using the enableWhenExpression extension." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": True, }, ) answerString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerString", title="Extension field for ``answerString``.", ) answerTime: fhirtypes.TimeType | None = Field( default=None, alias="answerTime", title="Value for question comparison based on operator", description=( "A value that the referenced question is tested using the specified " "operator in order for the item to be enabled. If there are multiple " "answers, a match on any of the answers suffices. If different " "behavior is desired (all must match, at least 2 must match, etc.), " "consider using the enableWhenExpression extension." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e answer[x] "one_of_many": "answer", "one_of_many_required": True, }, ) answerTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_answerTime", title="Extension field for ``answerTime``." ) operator: fhirtypes.CodeType | None = Field( default=None, alias="operator", title="exists | = | != | > | < | >= | <=", description="Specifies the criteria by which the question is enabled.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "exists", "=", "!=", "\u003e", "\u003c", "\u003e=", "\u003c=", ], }, ) operator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_operator", title="Extension field for ``operator``." ) question: fhirtypes.StringType | None = Field( default=None, alias="question", title=( "The linkId of question that determines whether item is " "enabled/disabled" ), description=( "The linkId for the question whose answer (or lack of answer) governs " "whether this item is enabled." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) question__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_question", title="Extension field for ``question``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``QuestionnaireItemEnableWhen`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "question", "operator", "answerBoolean", "answerDecimal", "answerInteger", "answerDate", "answerDateTime", "answerTime", "answerString", "answerCoding", "answerQuantity", "answerReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``QuestionnaireItemEnableWhen`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("operator", "operator__ext"), ("question", "question__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "answer": [ "answerBoolean", "answerCoding", "answerDate", "answerDateTime", "answerDecimal", "answerInteger", "answerQuantity", "answerReference", "answerString", "answerTime", ] } return one_of_many_fields class QuestionnaireItemInitial(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Initial value(s) when item is first rendered. One or more values that should be pre-populated in the answer when initially rendering the questionnaire for user input. """ __resource_type__ = "QuestionnaireItemInitial" valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Actual value for initializing the question", description="The actual value to for an initial answer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Actual value for initializing the question", description="The actual value to for an initial answer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Actual value for initializing the question", description="The actual value to for an initial answer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="Actual value for initializing the question", description="The actual value to for an initial answer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Actual value for initializing the question", description="The actual value to for an initial answer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Actual value for initializing the question", description="The actual value to for an initial answer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Actual value for initializing the question", description="The actual value to for an initial answer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Actual value for initializing the question", description="The actual value to for an initial answer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Actual value for initializing the question", description="The actual value to for an initial answer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Actual value for initializing the question", description="The actual value to for an initial answer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Actual value for initializing the question", description="The actual value to for an initial answer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="Actual value for initializing the question", description="The actual value to for an initial answer.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``QuestionnaireItemInitial`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "valueBoolean", "valueDecimal", "valueInteger", "valueDate", "valueDateTime", "valueTime", "valueString", "valueUri", "valueAttachment", "valueCoding", "valueQuantity", "valueReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``QuestionnaireItemInitial`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueBoolean", "valueCoding", "valueDate", "valueDateTime", "valueDecimal", "valueInteger", "valueQuantity", "valueReference", "valueString", "valueTime", "valueUri", ] } return one_of_many_fields ================================================ FILE: fhir/resources/questionnaireresponse.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class QuestionnaireResponse(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A structured set of questions and their answers. A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to. """ __resource_type__ = "QuestionnaireResponse" author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="The individual or device that received and recorded the answers", description=( "The individual or device that received the answers to the questions in" " the QuestionnaireResponse and recorded them in the system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Practitioner", "PractitionerRole", "Patient", "RelatedPerson", "Organization", ], }, ) authored: fhirtypes.DateTimeType | None = Field( default=None, alias="authored", title="Date the answers were gathered", description=( "The date and/or time that this questionnaire response was last " "modified by the user - e.g. changing answers or revising status." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authored__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authored", title="Extension field for ``authored``." ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Request fulfilled by this QuestionnaireResponse", description=( "A plan, proposal or order that is fulfilled in whole or in part by " "this questionnaire response. For example, a ServiceRequest seeking an" " intake assessment or a decision support recommendation to assess for " "post-partum depression." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CarePlan", "ServiceRequest"], }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter the questionnaire response is part of", description=( "The Encounter during which this questionnaire response was created or " "to which the creation of this record is tightly associated." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier for this set of answers", description=( "Business identifiers assigned to this questionnaire response by the " "performer and/or other systems. These identifiers remain constant as " "the resource is updated and propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) item: typing.List[fhirtypes.QuestionnaireResponseItemType] | None = Field( default=None, alias="item", title="Groups and questions", description=( "A group or question item from the original questionnaire for which " "answers are provided." ), json_schema_extra={ "element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced event", description=( "A procedure or observation that this questionnaire was performed as " "part of the execution of. For example, the surgery a checklist was " "executed as part of." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Observation", "Procedure"], }, ) questionnaire: fhirtypes.CanonicalType | None = Field( default=None, alias="questionnaire", title="Canonical URL of Questionnaire being answered", description=( "The Questionnaire that defines and organizes the questions for which " "answers are being provided." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Questionnaire"], }, ) questionnaire__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_questionnaire", title="Extension field for ``questionnaire``.", ) source: fhirtypes.ReferenceType | None = Field( default=None, alias="source", title="The individual or device that answered the questions", description=( "The individual or device that answered the questions about the " "subject." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="in-progress | completed | amended | entered-in-error | stopped", description="The current state of the questionnaire response.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "in-progress", "completed", "amended", "entered-in-error", "stopped", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="The subject of the questions", description=( "The subject of the questionnaire response. This could be a patient, " "organization, practitioner, device, etc. This is who/what the answers" " apply to, but is not necessarily the source of information." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``QuestionnaireResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "partOf", "questionnaire", "status", "subject", "encounter", "authored", "author", "source", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``QuestionnaireResponse`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "basedOn", "partOf", "questionnaire", "status", "subject", "encounter", "authored", "author", "source", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("questionnaire", "questionnaire__ext"), ("status", "status__ext"), ] return required_fields class QuestionnaireResponseItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Groups and questions. A group or question item from the original questionnaire for which answers are provided. """ __resource_type__ = "QuestionnaireResponseItem" answer: typing.List[fhirtypes.QuestionnaireResponseItemAnswerType] | None = Field( default=None, alias="answer", title="The response(s) to the question", description="The respondent's answer(s) to the question.", json_schema_extra={ "element_property": True, }, ) definition: fhirtypes.UriType | None = Field( default=None, alias="definition", title="ElementDefinition - details for the item", description=( "A reference to an [ElementDefinition](elementdefinition.html) that " "provides the details for the item." ), json_schema_extra={ "element_property": True, }, ) definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) item: typing.List[fhirtypes.QuestionnaireResponseItemType] | None = Field( default=None, alias="item", title="Child items of group item", description="Sub-questions, sub-groups or display items nested beneath a group.", json_schema_extra={ "element_property": True, }, ) linkId: fhirtypes.StringType | None = Field( default=None, alias="linkId", title="Pointer to specific item from Questionnaire", description=( "The item from the Questionnaire that corresponds to this item in the " "QuestionnaireResponse resource." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) text: fhirtypes.StringType | None = Field( default=None, alias="text", title="Name for group or question text", description=( "Text that is displayed above the contents of the group or as the text " "of the question being answered." ), json_schema_extra={ "element_property": True, }, ) text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_text", title="Extension field for ``text``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``QuestionnaireResponseItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "linkId", "definition", "text", "answer", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``QuestionnaireResponseItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("linkId", "linkId__ext")] return required_fields class QuestionnaireResponseItemAnswer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The response(s) to the question. The respondent's answer(s) to the question. """ __resource_type__ = "QuestionnaireResponseItemAnswer" item: typing.List[fhirtypes.QuestionnaireResponseItemType] | None = Field( default=None, alias="item", title="Child items of question", description="Nested groups and/or questions found within this particular answer.", json_schema_extra={ "element_property": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="Single-valued answer to the question", description=( "The answer (or one of the answers) provided by the respondent to the " "question." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``QuestionnaireResponseItemAnswer`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "valueBoolean", "valueDecimal", "valueInteger", "valueDate", "valueDateTime", "valueTime", "valueString", "valueUri", "valueAttachment", "valueCoding", "valueQuantity", "valueReference", "item", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``QuestionnaireResponseItemAnswer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueBoolean", "valueCoding", "valueDate", "valueDateTime", "valueDecimal", "valueInteger", "valueQuantity", "valueReference", "valueString", "valueTime", "valueUri", ] } return one_of_many_fields ================================================ FILE: fhir/resources/range.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Range Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class Range(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Set of values bounded by low and high. A set of ordered Quantities defined by a low and high limit. """ __resource_type__ = "Range" high: fhirtypes.QuantityType | None = Field( default=None, alias="high", title="High limit", description="The high limit. The boundary is inclusive.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) low: fhirtypes.QuantityType | None = Field( default=None, alias="low", title="Low limit", description="The low limit. The boundary is inclusive.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Range`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "low", "high"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Range`` according to specification, with preserving the original sequence order. """ return ["low", "high"] ================================================ FILE: fhir/resources/ratio.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Ratio Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class Ratio(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A ratio of two Quantity values - a numerator and a denominator. A relationship of two Quantity values - expressed as a numerator and a denominator. """ __resource_type__ = "Ratio" denominator: fhirtypes.QuantityType | None = Field( default=None, alias="denominator", title="Denominator value", description="The value of the denominator.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) numerator: fhirtypes.QuantityType | None = Field( default=None, alias="numerator", title="Numerator value", description="The value of the numerator.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Ratio`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "numerator", "denominator"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Ratio`` according to specification, with preserving the original sequence order. """ return ["numerator", "denominator"] ================================================ FILE: fhir/resources/ratiorange.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/RatioRange Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class RatioRange(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Range of ratio values. A range of ratios expressed as a low and high numerator and a denominator. """ __resource_type__ = "RatioRange" denominator: fhirtypes.QuantityType | None = Field( default=None, alias="denominator", title="Denominator value", description="The value of the denominator.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) highNumerator: fhirtypes.QuantityType | None = Field( default=None, alias="highNumerator", title="High Numerator limit", description="The value of the high limit numerator.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lowNumerator: fhirtypes.QuantityType | None = Field( default=None, alias="lowNumerator", title="Low Numerator limit", description="The value of the low limit numerator.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RatioRange`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "lowNumerator", "highNumerator", "denominator"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RatioRange`` according to specification, with preserving the original sequence order. """ return ["lowNumerator", "highNumerator", "denominator"] ================================================ FILE: fhir/resources/reference.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Reference Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class Reference(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A reference from one resource to another. """ __resource_type__ = "Reference" display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Text alternative for the resource", description=( "Plain text narrative that identifies the resource in addition to the " "resource reference." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Logical reference, when literal reference is not known", description=( "An identifier for the target resource. This is used when there is no " "way to reference the other resource directly, either because the " "entity it represents is not available through a FHIR server, or " "because there is no way for the author of the resource to convert a " "known identifier to an actual location. There is no requirement that a" " Reference.identifier point to something that is actually exposed as a" " FHIR instance, but it SHALL point to a business concept that would be" " expected to be exposed as a FHIR instance, and that instance would " "need to be of a FHIR resource type allowed by the reference." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reference: fhirtypes.StringType | None = Field( default=None, alias="reference", title="Literal reference, Relative, internal or absolute URL", description=( "A reference to a location at which the other resource is found. The " "reference may be a relative reference, in which case it is relative to" " the service base URL, or an absolute URL that resolves to the " "location where the resource is found. The reference may be version " "specific or not. If the reference is not to a FHIR RESTful server, " "then it should be assumed to be version specific. Internal fragment " "references (start with '#') refer to contained resources." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reference", title="Extension field for ``reference``." ) type: fhirtypes.UriType | None = Field( default=None, alias="type", title=( 'Type the reference refers to (e.g. "Patient") - must be a resource in ' "resources" ), description=( "The expected type of the target of the reference. If both " "Reference.type and Reference.reference are populated and " "Reference.reference is a FHIR URL, both SHALL be consistent. The type" " is the Canonical URL of Resource Definition that is the type this " "reference refers to. References are URLs that are relative to " 'http://hl7.org/fhir/StructureDefinition/ e.g. "Patient" is a reference' " to http://hl7.org/fhir/StructureDefinition/Patient. Absolute URLs are" " only allowed for logical models (and can only be used in references " "in logical models, not resources)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Reference`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "reference", "type", "identifier", "display"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Reference`` according to specification, with preserving the original sequence order. """ return ["reference", "type", "identifier", "display"] ================================================ FILE: fhir/resources/regulatedauthorization.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/RegulatedAuthorization Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class RegulatedAuthorization(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Regulatory approval, clearance or licencing related to a regulated product, treatment, facility or activity e.g. Market Authorization for a Medicinal Product. Regulatory approval, clearance or licencing related to a regulated product, treatment, facility or activity that is cited in a guidance, regulation, rule or legislative act. An example is Market Authorization relating to a Medicinal Product. """ __resource_type__ = "RegulatedAuthorization" attachedDocument: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="attachedDocument", title=( "Additional information or supporting documentation about the " "authorization" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) basis: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="basis", title=( "The legal/regulatory framework or reasons under which this " "authorization is granted" ), description=( "The legal or regulatory framework against which this authorization is " "granted, or other reasons for it." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) case: fhirtypes.RegulatedAuthorizationCaseType | None = Field( default=None, alias="case", title=( "The case or regulatory procedure for granting or amending a regulated " "authorization. Note: This area is subject to ongoing review and the " "workgroup is seeking implementer feedback on its use (see link at " "bottom of page)" ), description=( "The case or regulatory procedure for granting or amending a regulated " "authorization. An authorization is granted in response to " "submissions/applications by those seeking authorization. A case is the" " administrative process that deals with the application(s) that relate" " to this and assesses them. Note: This area is subject to ongoing " "review and the workgroup is seeking implementer feedback on its use " "(see link at bottom of page)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="General textual supporting information", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) holder: fhirtypes.ReferenceType | None = Field( default=None, alias="holder", title=( "The organization that has been granted this authorization, by the " "regulator" ), description=( "The organization that has been granted this authorization, by some " "authoritative body (the 'regulator')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title=( "Business identifier for the authorization, typically assigned by the " "authorizing body" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) indication: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="indication", title="Condition for which the use of the regulated product applies", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ClinicalUseDefinition"], }, ) intendedUse: fhirtypes.CodeableConceptType | None = Field( default=None, alias="intendedUse", title="The intended use of the product, e.g. prevention, treatment", description=( "The intended use of the product, e.g. prevention, treatment, " "diagnosis." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) region: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="region", title="The territory in which the authorization has been granted", description=( "The territory (e.g., country, jurisdiction etc.) in which the " "authorization has been granted." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) regulator: fhirtypes.ReferenceType | None = Field( default=None, alias="regulator", title=( "The regulatory authority or authorizing body granting the " "authorization" ), description=( "The regulatory authority or authorizing body granting the " "authorization. For example, European Medicines Agency (EMA), Food and " "Drug Administration (FDA), Health Canada (HC), etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) status: fhirtypes.CodeableConceptType | None = Field( default=None, alias="status", title=( "The status that is authorised e.g. approved. Intermediate states can " "be tracked with cases and applications" ), description=( "The status that is authorised e.g. approved. Intermediate states and " "actions can be tracked with cases and applications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) statusDate: fhirtypes.DateTimeType | None = Field( default=None, alias="statusDate", title="The date at which the current status was assigned", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_statusDate", title="Extension field for ``statusDate``." ) subject: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="subject", title=( "The product type, treatment, facility or activity that is being " "authorized" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "MedicinalProductDefinition", "BiologicallyDerivedProduct", "NutritionProduct", "PackagedProductDefinition", "ManufacturedItemDefinition", "Ingredient", "SubstanceDefinition", "DeviceDefinition", "ResearchStudy", "ActivityDefinition", "PlanDefinition", "ObservationDefinition", "Practitioner", "Organization", "Location", ], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title=( "Overall type of this authorization, for example drug marketing " "approval, orphan drug designation" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) validityPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="validityPeriod", title=( "The time period in which the regulatory approval etc. is in effect, " "e.g. a Marketing Authorization includes the date of authorization " "and/or expiration date" ), description=( "The time period in which the regulatory approval, clearance or " "licencing is in effect. As an example, a Marketing Authorization " "includes the date of authorization and/or an expiration date." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RegulatedAuthorization`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "subject", "type", "description", "region", "status", "statusDate", "validityPeriod", "indication", "intendedUse", "basis", "holder", "regulator", "attachedDocument", "case", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RegulatedAuthorization`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "subject", "type", "description", "region", "status", "statusDate", "validityPeriod", "indication", "intendedUse", "basis", "holder", "regulator", "attachedDocument", "case", ] class RegulatedAuthorizationCase(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The case or regulatory procedure for granting or amending a regulated authorization. Note: This area is subject to ongoing review and the workgroup is seeking implementer feedback on its use (see link at bottom of page). The case or regulatory procedure for granting or amending a regulated authorization. An authorization is granted in response to submissions/applications by those seeking authorization. A case is the administrative process that deals with the application(s) that relate to this and assesses them. Note: This area is subject to ongoing review and the workgroup is seeking implementer feedback on its use (see link at bottom of page). """ __resource_type__ = "RegulatedAuthorizationCase" application: typing.List[fhirtypes.RegulatedAuthorizationCaseType] | None = Field( default=None, alias="application", title=( "Applications submitted to obtain a regulated authorization. Steps " "within the longer running case or procedure" ), description=( "A regulatory submission from an organization to a regulator, as part " "of an assessing case. Multiple applications may occur over time, with " "more or different information to support or modify the submission or " "the authorization. The applications can be considered as steps within " "the longer running case or procedure for this authorization process." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) dateDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="dateDateTime", title="Relevant date for this case", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e date[x] "one_of_many": "date", "one_of_many_required": False, }, ) dateDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dateDateTime", title="Extension field for ``dateDateTime``.", ) datePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="datePeriod", title="Relevant date for this case", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e date[x] "one_of_many": "date", "one_of_many_required": False, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Identifier by which this case can be referenced", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeableConceptType | None = Field( default=None, alias="status", title="The status associated with the case", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The defining type of case", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RegulatedAuthorizationCase`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "type", "status", "datePeriod", "dateDateTime", "application", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RegulatedAuthorizationCase`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "identifier", "type", "status", "datePeriod", "dateDateTime", "application", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"date": ["dateDateTime", "datePeriod"]} return one_of_many_fields ================================================ FILE: fhir/resources/relatedartifact.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/RelatedArtifact Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class RelatedArtifact(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Related artifacts for a knowledge resource. Related artifacts such as additional documentation, justification, or bibliographic references. """ __resource_type__ = "RelatedArtifact" citation: fhirtypes.MarkdownType | None = Field( default=None, alias="citation", title="Bibliographic citation for the artifact", description=( "A bibliographic citation for the related artifact. This text SHOULD be" " formatted according to an accepted citation format." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) citation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_citation", title="Extension field for ``citation``." ) classifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="classifier", title="Additional classifiers", description="Provides additional classifiers of the related artifact.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Brief description of the related artifact", description=( "A brief description of the document or knowledge resource being " "referenced, suitable for display to a consumer." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) document: fhirtypes.AttachmentType | None = Field( default=None, alias="document", title="What document is being referenced", description=( "The document being referenced, represented as an attachment. This is " "exclusive with the resource element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) label: fhirtypes.StringType | None = Field( default=None, alias="label", title="Short label", description=( "A short label that can be used to reference the citation from " "elsewhere in the containing artifact, such as a footnote index." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_label", title="Extension field for ``label``." ) publicationDate: fhirtypes.DateType | None = Field( default=None, alias="publicationDate", title="Date of publication of the artifact being referred to", description="The date of publication of the artifact being referred to.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publicationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publicationDate", title="Extension field for ``publicationDate``.", ) publicationStatus: fhirtypes.CodeType | None = Field( default=None, alias="publicationStatus", title="draft | active | retired | unknown", description="The publication status of the artifact being referred to.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) publicationStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publicationStatus", title="Extension field for ``publicationStatus``.", ) resource: fhirtypes.CanonicalType | None = Field( default=None, alias="resource", title="What artifact is being referenced", description=( "The related artifact, such as a library, value set, profile, or other " "knowledge resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resource", title="Extension field for ``resource``." ) resourceReference: fhirtypes.ReferenceType | None = Field( default=None, alias="resourceReference", title="What artifact, if not a conformance resource", description=( "The related artifact, if the artifact is not a canonical resource, or " "a resource reference to a canonical resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "documentation | justification | citation | predecessor | successor | " "derived-from | depends-on | composed-of | part-of | amends | amended-" "with | appends | appended-with | cites | cited-by | comments-on | " "comment-in | contains | contained-in | corrects | correction-in | " "replaces | replaced-with | retracts | retracted-by | signs | similar-" "to | supports | supported-with | transforms | transformed-into | " "transformed-with | documents | specification-of | created-with | cite-" "as" ), description="The type of relationship to the related artifact.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "documentation", "justification", "citation", "predecessor", "successor", "derived-from", "depends-on", "composed-of", "part-of", "amends", "amended-with", "appends", "appended-with", "cites", "cited-by", "comments-on", "comment-in", "contains", "contained-in", "corrects", "correction-in", "replaces", "replaced-with", "retracts", "retracted-by", "signs", "similar-to", "supports", "supported-with", "transforms", "transformed-into", "transformed-with", "documents", "specification-of", "created-with", "cite-as", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RelatedArtifact`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "type", "classifier", "label", "display", "citation", "document", "resource", "resourceReference", "publicationStatus", "publicationDate", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RelatedArtifact`` according to specification, with preserving the original sequence order. """ return [ "type", "classifier", "label", "display", "citation", "document", "resource", "resourceReference", "publicationStatus", "publicationDate", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields ================================================ FILE: fhir/resources/relatedperson.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/RelatedPerson Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class RelatedPerson(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A person that is related to a patient, but who is not a direct target of care. Information about a person that is involved in a patient's health or the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process. """ __resource_type__ = "RelatedPerson" active: bool | None = Field( default=None, alias="active", title="Whether this related person's record is in active use", description="Whether this related person record is in active use.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) address: typing.List[fhirtypes.AddressType] | None = Field( default=None, alias="address", title="Address where the related person can be contacted or visited", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) birthDate: fhirtypes.DateType | None = Field( default=None, alias="birthDate", title="The date on which the related person was born", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) birthDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_birthDate", title="Extension field for ``birthDate``." ) communication: typing.List[fhirtypes.RelatedPersonCommunicationType] | None = Field( default=None, alias="communication", title=( "A language which may be used to communicate with the related person " "about the patient's health" ), description=None, json_schema_extra={ "element_property": True, }, ) gender: fhirtypes.CodeType | None = Field( default=None, alias="gender", title="male | female | other | unknown", description=( "Administrative Gender - the gender that the person is considered to " "have for administration and record keeping purposes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["male", "female", "other", "unknown"], }, ) gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_gender", title="Extension field for ``gender``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="A human identifier for this person", description="Identifier for a person within a particular scope.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: typing.List[fhirtypes.HumanNameType] | None = Field( default=None, alias="name", title="A name associated with the person", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="The patient this person is related to", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Period of time that this relationship is considered valid", description=( "The period of time during which this relationship is or was active. If" " there are no dates defined, then the interval is unknown." ), json_schema_extra={ "element_property": True, }, ) photo: typing.List[fhirtypes.AttachmentType] | None = Field( default=None, alias="photo", title="Image of the person", description=None, json_schema_extra={ "element_property": True, }, ) relationship: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="relationship", title="The relationship of the related person to the patient", description=( "The nature of the relationship between the related person and the " "patient." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) telecom: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="telecom", title="A contact detail for the person", description=( "A contact detail for the person, e.g. a telephone number or an email " "address." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RelatedPerson`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "patient", "relationship", "name", "telecom", "gender", "birthDate", "address", "photo", "period", "communication", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RelatedPerson`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "active", "patient", "relationship", "name", "telecom", "gender", "birthDate", "address", ] class RelatedPersonCommunication(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A language which may be used to communicate with the related person about the patient's health. """ __resource_type__ = "RelatedPersonCommunication" language: fhirtypes.CodeableConceptType = Field( default=..., alias="language", title=( "The language which can be used to communicate with the related person " "about the patient's health" ), description=( "The ISO-639-1 alpha 2 code in lower case for the language, optionally " "followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in" ' upper case; e.g. "en" for English, or "en-US" for American English ' 'versus "en-AU" for Australian English.' ), json_schema_extra={ "element_property": True, }, ) preferred: bool | None = Field( default=None, alias="preferred", title="Language preference indicator", description=( "Indicates whether or not the related person prefers this language " "(over other languages he or she masters up a certain level)." ), json_schema_extra={ "element_property": True, }, ) preferred__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preferred", title="Extension field for ``preferred``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RelatedPersonCommunication`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "language", "preferred"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RelatedPersonCommunication`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/requestorchestration.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/RequestOrchestration Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class RequestOrchestration(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A set of related requests. A set of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one". """ __resource_type__ = "RequestOrchestration" action: typing.List[fhirtypes.RequestOrchestrationActionType] | None = Field( default=None, alias="action", title="Proposed actions, if any", description="The actions, if any, produced by the evaluation of the artifact.", json_schema_extra={ "element_property": True, }, ) author: fhirtypes.ReferenceType | None = Field( default=None, alias="author", title="Device or practitioner that authored the request orchestration", description="Provides a reference to the author of the request orchestration.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device", "Practitioner", "PractitionerRole"], }, ) authoredOn: fhirtypes.DateTimeType | None = Field( default=None, alias="authoredOn", title="When the request orchestration was authored", description="Indicates when the request orchestration was created.", json_schema_extra={ "element_property": True, }, ) authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoredOn", title="Extension field for ``authoredOn``." ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Fulfills plan, proposal, or order", description=( "A plan, proposal or order that is fulfilled in whole or in part by " "this request." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="What's being requested/ordered", description="A code that identifies what the overall request orchestration is.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Created as part of", description="Describes the context of the request orchestration, if any.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) goal: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="goal", title="What goals", description=( "Goals that are intended to be achieved by following the requests in " "this RequestOrchestration." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Goal"], }, ) groupIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="groupIdentifier", title="Composite request this is part of", description=( "A shared identifier common to multiple independent Request instances " "that were activated/authorized more or less simultaneously by a single" " author. The presence of the same identifier on each request ties " "those requests together and may have business ramifications in terms " "of reporting of results, billing, etc. E.g. a requisition number " "shared by a set of lab tests ordered together, or a prescription " "number shared by all meds ordered at one time." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier", description=( "Allows a service to provide a unique, business identifier for the " "request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="instantiatesCanonical", title="Instantiates FHIR protocol or definition", description=( "A canonical URL referencing a FHIR-defined protocol, guideline, " "orderset or other definition that is adhered to in whole or in part by" " this request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesCanonical__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="instantiatesUri", title="Instantiates external protocol or definition", description=( "A URL referencing an externally defined protocol, guideline, orderset " "or other definition that is adhered to in whole or in part by this " "request." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) intent: fhirtypes.CodeType | None = Field( default=None, alias="intent", title=( "proposal | plan | directive | order | original-order | reflex-order | " "filler-order | instance-order | option" ), description=( "Indicates the level of authority/intentionality associated with the " "request and where the request fits into the workflow chain." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "proposal", "plan", "directive", "order", "original-order", "reflex-order", "filler-order", "instance-order", "option", ], }, ) intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intent", title="Extension field for ``intent``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Additional notes about the response", description=( "Provides a mechanism to communicate additional information about the " "response." ), json_schema_extra={ "element_property": True, }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Indicates how quickly the request should be addressed with respect to " "other requests." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="reason", title="Why the request orchestration is needed", description=( "Describes the reason for the request orchestration in coded or textual" " form." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "DiagnosticReport", "DocumentReference", ], }, ) replaces: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="replaces", title="Request(s) replaced by this request", description=( "Completed or terminated request(s) whose function is taken by this new" " request." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "draft | active | on-hold | revoked | completed | entered-in-error | " "unknown" ), description=( "The current state of the request. For request orchestrations, the " "status reflects the status of all the requests in the orchestration." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "draft", "active", "on-hold", "revoked", "completed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title="Who the request orchestration is about", description="The subject for which the request orchestration was created.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CareTeam", "Device", "Group", "HealthcareService", "Location", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RequestOrchestration`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "replaces", "groupIdentifier", "status", "intent", "priority", "code", "subject", "encounter", "authoredOn", "author", "reason", "goal", "note", "action", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RequestOrchestration`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "groupIdentifier", "status", "intent", "priority", "code", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("intent", "intent__ext"), ("status", "status__ext")] return required_fields class RequestOrchestrationAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Proposed actions, if any. The actions, if any, produced by the evaluation of the artifact. """ __resource_type__ = "RequestOrchestrationAction" action: typing.List[fhirtypes.RequestOrchestrationActionType] | None = Field( default=None, alias="action", title="Sub action", description="Sub actions.", json_schema_extra={ "element_property": True, }, ) cardinalityBehavior: fhirtypes.CodeType | None = Field( default=None, alias="cardinalityBehavior", title="single | multiple", description="Defines whether the action can be selected multiple times.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["single", "multiple"], }, ) cardinalityBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_cardinalityBehavior", title="Extension field for ``cardinalityBehavior``.", ) code: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="code", title="Code representing the meaning of the action or sub-actions", description=( "A code that provides meaning for the action or action group. For " "example, a section may have a LOINC code for a section of a " "documentation template." ), json_schema_extra={ "element_property": True, }, ) condition: typing.List[ fhirtypes.RequestOrchestrationActionConditionType ] | None = Field( default=None, alias="condition", title="Whether or not the action is applicable", description=( "An expression that describes applicability criteria, or start/stop " "conditions for the action." ), json_schema_extra={ "element_property": True, }, ) definitionCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="definitionCanonical", title="Description of the activity to be performed", description=( "A reference to an ActivityDefinition that describes the action to be " "taken in detail, a PlanDefinition that describes a series of actions " "to be taken, a Questionnaire that should be filled out, a " "SpecimenDefinition describing a specimen to be collected, or an " "ObservationDefinition that specifies what observation should be " "captured." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e definition[x] "one_of_many": "definition", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "ActivityDefinition", "ObservationDefinition", "PlanDefinition", "Questionnaire", "SpecimenDefinition", ], }, ) definitionCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definitionCanonical", title="Extension field for ``definitionCanonical``.", ) definitionUri: fhirtypes.UriType | None = Field( default=None, alias="definitionUri", title="Description of the activity to be performed", description=( "A reference to an ActivityDefinition that describes the action to be " "taken in detail, a PlanDefinition that describes a series of actions " "to be taken, a Questionnaire that should be filled out, a " "SpecimenDefinition describing a specimen to be collected, or an " "ObservationDefinition that specifies what observation should be " "captured." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e definition[x] "one_of_many": "definition", "one_of_many_required": False, }, ) definitionUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definitionUri", title="Extension field for ``definitionUri``.", ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Short description of the action", description=( "A short description of the action used to provide a summary to display" " to the user." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) documentation: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="documentation", title="Supporting documentation for the intended performer of the action", description=( "Didactic or other informational resources associated with the action " "that can be provided to the CDS recipient. Information resources can " "include inline text commentary and links to web resources." ), json_schema_extra={ "element_property": True, }, ) dynamicValue: typing.List[ fhirtypes.RequestOrchestrationActionDynamicValueType ] | None = Field( default=None, alias="dynamicValue", title="Dynamic aspects of the definition", description=( "Customizations that should be applied to the statically defined " "resource. For example, if the dosage of a medication must be computed " "based on the patient's weight, a customization would be used to " "specify an expression that calculated the weight, and the path on the " "resource that would contain the result." ), json_schema_extra={ "element_property": True, }, ) goal: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="goal", title="What goals", description=( "Goals that are intended to be achieved by following the requests in " "this action." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Goal"], }, ) groupingBehavior: fhirtypes.CodeType | None = Field( default=None, alias="groupingBehavior", title="visual-group | logical-group | sentence-group", description="Defines the grouping behavior for the action and its children.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["visual-group", "logical-group", "sentence-group"], }, ) groupingBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_groupingBehavior", title="Extension field for ``groupingBehavior``.", ) input: typing.List[fhirtypes.RequestOrchestrationActionInputType] | None = Field( default=None, alias="input", title="Input data requirements", description="Defines input data requirements for the action.", json_schema_extra={ "element_property": True, }, ) linkId: fhirtypes.StringType | None = Field( default=None, alias="linkId", title="Pointer to specific item from the PlanDefinition", description=( "The linkId of the action from the PlanDefinition that corresponds to " "this action in the RequestOrchestration resource." ), json_schema_extra={ "element_property": True, }, ) linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) location: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="location", title="Where it should happen", description=( "Identifies the facility where the action will occur; e.g. home, " "hospital, specific clinic, etc." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) output: typing.List[fhirtypes.RequestOrchestrationActionOutputType] | None = Field( default=None, alias="output", title="Output data definition", description="Defines the outputs of the action, if any.", json_schema_extra={ "element_property": True, }, ) participant: typing.List[ fhirtypes.RequestOrchestrationActionParticipantType ] | None = Field( default=None, alias="participant", title="Who should perform the action", description="The participant that should perform or be responsible for this action.", json_schema_extra={ "element_property": True, }, ) precheckBehavior: fhirtypes.CodeType | None = Field( default=None, alias="precheckBehavior", title="yes | no", description="Defines whether the action should usually be preselected.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["yes", "no"], }, ) precheckBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_precheckBehavior", title="Extension field for ``precheckBehavior``.", ) prefix: fhirtypes.StringType | None = Field( default=None, alias="prefix", title="User-visible prefix for the action (e.g. 1. or A.)", description=( "A user-visible prefix for the action. For example a section or item " "numbering such as 1. or A." ), json_schema_extra={ "element_property": True, }, ) prefix__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_prefix", title="Extension field for ``prefix``." ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Indicates how quickly the action should be addressed with respect to " "other actions." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) relatedAction: typing.List[ fhirtypes.RequestOrchestrationActionRelatedActionType ] | None = Field( default=None, alias="relatedAction", title="Relationship to another action", description=( 'A relationship to another action such as "before" or "30-60 minutes ' 'after start of".' ), json_schema_extra={ "element_property": True, }, ) requiredBehavior: fhirtypes.CodeType | None = Field( default=None, alias="requiredBehavior", title="must | could | must-unless-documented", description="Defines expectations around whether an action is required.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["must", "could", "must-unless-documented"], }, ) requiredBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requiredBehavior", title="Extension field for ``requiredBehavior``.", ) resource: fhirtypes.ReferenceType | None = Field( default=None, alias="resource", title="The target of the action", description=( "The resource that is the target of the action (e.g. " "CommunicationRequest)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) selectionBehavior: fhirtypes.CodeType | None = Field( default=None, alias="selectionBehavior", title="any | all | all-or-none | exactly-one | at-most-one | one-or-more", description="Defines the selection behavior for the action and its children.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "any", "all", "all-or-none", "exactly-one", "at-most-one", "one-or-more", ], }, ) selectionBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_selectionBehavior", title="Extension field for ``selectionBehavior``.", ) textEquivalent: fhirtypes.MarkdownType | None = Field( default=None, alias="textEquivalent", title=( "Static text equivalent of the action, used if the dynamic aspects " "cannot be interpreted by the receiving system" ), description=( "A text equivalent of the action to be performed. This provides a " "human-interpretable description of the action when the definition is " "consumed by a system that might not be capable of interpreting it " "dynamically." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) textEquivalent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_textEquivalent", title="Extension field for ``textEquivalent``.", ) timingAge: fhirtypes.AgeType | None = Field( default=None, alias="timingAge", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="timingDateTime", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timingDateTime", title="Extension field for ``timingDateTime``.", ) timingDuration: fhirtypes.DurationType | None = Field( default=None, alias="timingDuration", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="timingPeriod", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingRange: fhirtypes.RangeType | None = Field( default=None, alias="timingRange", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingTiming: fhirtypes.TimingType | None = Field( default=None, alias="timingTiming", title="When the action should take place", description="An optional value describing when the action should be performed.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="User-visible title", description="The title of the action displayed to a user.", json_schema_extra={ "element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) transform: fhirtypes.CanonicalType | None = Field( default=None, alias="transform", title="Transform to apply the template", description=( "A reference to a StructureMap resource that defines a transform that " "can be executed to produce the intent resource using the " "ActivityDefinition instance as the input." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureMap"], }, ) transform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_transform", title="Extension field for ``transform``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="create | update | remove | fire-event", description="The type of action to perform (create, update, remove).", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RequestOrchestrationAction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "linkId", "prefix", "title", "description", "textEquivalent", "priority", "code", "documentation", "goal", "condition", "input", "output", "relatedAction", "timingDateTime", "timingAge", "timingPeriod", "timingDuration", "timingRange", "timingTiming", "location", "participant", "type", "groupingBehavior", "selectionBehavior", "requiredBehavior", "precheckBehavior", "cardinalityBehavior", "resource", "definitionCanonical", "definitionUri", "transform", "dynamicValue", "action", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RequestOrchestrationAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "description", "textEquivalent"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "definition": ["definitionCanonical", "definitionUri"], "timing": [ "timingAge", "timingDateTime", "timingDuration", "timingPeriod", "timingRange", "timingTiming", ], } return one_of_many_fields class RequestOrchestrationActionCondition(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Whether or not the action is applicable. An expression that describes applicability criteria, or start/stop conditions for the action. """ __resource_type__ = "RequestOrchestrationActionCondition" expression: fhirtypes.ExpressionType | None = Field( default=None, alias="expression", title="Boolean-valued expression", description=( "An expression that returns true or false, indicating whether or not " "the condition is satisfied." ), json_schema_extra={ "element_property": True, }, ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title="applicability | start | stop", description="The kind of condition.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["applicability", "start", "stop"], }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RequestOrchestrationActionCondition`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "kind", "expression"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RequestOrchestrationActionCondition`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("kind", "kind__ext")] return required_fields class RequestOrchestrationActionDynamicValue(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Dynamic aspects of the definition. Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result. """ __resource_type__ = "RequestOrchestrationActionDynamicValue" expression: fhirtypes.ExpressionType | None = Field( default=None, alias="expression", title="An expression that provides the dynamic value for the customization", description="An expression specifying the value of the customized element.", json_schema_extra={ "element_property": True, }, ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="The path to the element to be set dynamically", description=( "The path to the element to be customized. This is the path on the " "resource that will hold the result of the calculation defined by the " "expression. The specified path SHALL be a FHIRPath resolvable on the " "specified target type of the ActivityDefinition, and SHALL consist " "only of identifiers, constant indexers, and a restricted subset of " "functions. The path is allowed to contain qualifiers (.) to traverse " "sub-elements, as well as indexers ([x]) to traverse multiple-" "cardinality sub-elements (see the [Simple FHIRPath " "Profile](fhirpath.html#simple) for full details)." ), json_schema_extra={ "element_property": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RequestOrchestrationActionDynamicValue`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "path", "expression"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RequestOrchestrationActionDynamicValue`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class RequestOrchestrationActionInput(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Input data requirements. Defines input data requirements for the action. """ __resource_type__ = "RequestOrchestrationActionInput" relatedData: fhirtypes.IdType | None = Field( default=None, alias="relatedData", title="What data is provided", description=( "Points to an existing input or output element that provides data to " "this input." ), json_schema_extra={ "element_property": True, }, ) relatedData__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_relatedData", title="Extension field for ``relatedData``." ) requirement: fhirtypes.DataRequirementType | None = Field( default=None, alias="requirement", title="What data is provided", description="Defines the data that is to be provided as input to the action.", json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="User-visible title", description=( "A human-readable label for the data requirement used to label data " "flows in BPMN or similar diagrams. Also provides a human readable " "label when rendering the data requirement that conveys its purpose to " "human readers." ), json_schema_extra={ "element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RequestOrchestrationActionInput`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "title", "requirement", "relatedData", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RequestOrchestrationActionInput`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class RequestOrchestrationActionOutput(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Output data definition. Defines the outputs of the action, if any. """ __resource_type__ = "RequestOrchestrationActionOutput" relatedData: fhirtypes.StringType | None = Field( default=None, alias="relatedData", title="What data is provided", description=( "Points to an existing input or output element that is results as " "output from the action." ), json_schema_extra={ "element_property": True, }, ) relatedData__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_relatedData", title="Extension field for ``relatedData``." ) requirement: fhirtypes.DataRequirementType | None = Field( default=None, alias="requirement", title="What data is provided", description="Defines the data that results as output from the action.", json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="User-visible title", description=( "A human-readable label for the data requirement used to label data " "flows in BPMN or similar diagrams. Also provides a human readable " "label when rendering the data requirement that conveys its purpose to " "human readers." ), json_schema_extra={ "element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RequestOrchestrationActionOutput`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "title", "requirement", "relatedData", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RequestOrchestrationActionOutput`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class RequestOrchestrationActionParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who should perform the action. The participant that should perform or be responsible for this action. """ __resource_type__ = "RequestOrchestrationActionParticipant" actorCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="actorCanonical", title="Who/what is participating?", description="A reference to the actual participant.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e actor[x] "one_of_many": "actor", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CapabilityStatement"], }, ) actorCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_actorCanonical", title="Extension field for ``actorCanonical``.", ) actorReference: fhirtypes.ReferenceType | None = Field( default=None, alias="actorReference", title="Who/what is participating?", description="A reference to the actual participant.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e actor[x] "one_of_many": "actor", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CareTeam", "Device", "DeviceDefinition", "Endpoint", "Group", "HealthcareService", "Location", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", ], }, ) function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="E.g. Author, Reviewer, Witness, etc", description=( "Indicates how the actor will be involved in the action - author, " "reviewer, witness, etc." ), json_schema_extra={ "element_property": True, }, ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="E.g. Nurse, Surgeon, Parent, etc", description=( "The role the participant should play in performing the described " "action." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "careteam | device | group | healthcareservice | location | " "organization | patient | practitioner | practitionerrole | " "relatedperson" ), description="The type of participant in the action.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "careteam", "device", "group", "healthcareservice", "location", "organization", "patient", "practitioner", "practitionerrole", "relatedperson", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) typeCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="typeCanonical", title="Who or what can participate", description="The type of participant in the action.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CapabilityStatement"], }, ) typeCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_typeCanonical", title="Extension field for ``typeCanonical``.", ) typeReference: fhirtypes.ReferenceType | None = Field( default=None, alias="typeReference", title="Who or what can participate", description="The type of participant in the action.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CareTeam", "Device", "DeviceDefinition", "Endpoint", "Group", "HealthcareService", "Location", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RequestOrchestrationActionParticipant`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "typeCanonical", "typeReference", "role", "function", "actorCanonical", "actorReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RequestOrchestrationActionParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"actor": ["actorCanonical", "actorReference"]} return one_of_many_fields class RequestOrchestrationActionRelatedAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Relationship to another action. A relationship to another action such as "before" or "30-60 minutes after start of". """ __resource_type__ = "RequestOrchestrationActionRelatedAction" endRelationship: fhirtypes.CodeType | None = Field( default=None, alias="endRelationship", title=( "before | before-start | before-end | concurrent | concurrent-with-" "start | concurrent-with-end | after | after-start | after-end" ), description="The relationship of the end of this action to the related action.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "before", "before-start", "before-end", "concurrent", "concurrent-with-start", "concurrent-with-end", "after", "after-start", "after-end", ], }, ) endRelationship__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_endRelationship", title="Extension field for ``endRelationship``.", ) offsetDuration: fhirtypes.DurationType | None = Field( default=None, alias="offsetDuration", title="Time offset for the relationship", description=( "A duration or range of durations to apply to the relationship. For " "example, 30-60 minutes before." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e offset[x] "one_of_many": "offset", "one_of_many_required": False, }, ) offsetRange: fhirtypes.RangeType | None = Field( default=None, alias="offsetRange", title="Time offset for the relationship", description=( "A duration or range of durations to apply to the relationship. For " "example, 30-60 minutes before." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e offset[x] "one_of_many": "offset", "one_of_many_required": False, }, ) relationship: fhirtypes.CodeType | None = Field( default=None, alias="relationship", title=( "before | before-start | before-end | concurrent | concurrent-with-" "start | concurrent-with-end | after | after-start | after-end" ), description="The relationship of this action to the related action.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "before", "before-start", "before-end", "concurrent", "concurrent-with-start", "concurrent-with-end", "after", "after-start", "after-end", ], }, ) relationship__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_relationship", title="Extension field for ``relationship``.", ) targetId: fhirtypes.IdType | None = Field( default=None, alias="targetId", title="What action this is related to", description="The element id of the target related action.", json_schema_extra={ "element_property": True, "element_required": True, }, ) targetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_targetId", title="Extension field for ``targetId``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RequestOrchestrationActionRelatedAction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "targetId", "relationship", "endRelationship", "offsetDuration", "offsetRange", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RequestOrchestrationActionRelatedAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("relationship", "relationship__ext"), ("targetId", "targetId__ext"), ] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"offset": ["offsetDuration", "offsetRange"]} return one_of_many_fields ================================================ FILE: fhir/resources/requirements.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Requirements Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Requirements(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A set of requirements - features of systems that are necessary. A set of requirements - a list of features or behaviors of designed systems that are necessary to achieve organizational or regulatory goals. """ __resource_type__ = "Requirements" actor: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="actor", title="Actor for these requirements", description="An actor these requirements are in regard to.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ActorDefinition"], }, ) actor__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_actor", title="Extension field for ``actor``." ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the Requirements and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the Requirements." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the Requirements was published. " "The date must change when the business version changes and it must " "change if the status code changes. In addition, it should change when " "the substantive content of the Requirements changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) derivedFrom: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="derivedFrom", title="Other set of Requirements this builds on", description=( "Another set of Requirements that this set of Requirements builds on " "and updates." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Requirements"], }, ) derivedFrom__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_derivedFrom", title="Extension field for ``derivedFrom``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the requirements", description="A free text natural language description of the requirements.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this Requirements is authored for " "testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the Requirements (business identifier)", description=( "A formal identifier that is used to identify this Requirements when it" " is represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for Requirements (if applicable)", description=( "A legal or geographic region in which the Requirements is intended to " "be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this Requirements (computer friendly)", description=( "A natural language name identifying the Requirements. This name should" " be usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the Requirements." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this Requirements is defined", description=( "Explanation of why this Requirements is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) reference: typing.List[fhirtypes.UrlType | None] | None = Field( default=None, alias="reference", title=( "External artifact (rule/document etc. that) created this set of " "requirements" ), description=( "A reference to another artifact that created this set of requirements." " This could be a Profile, etc., or external regulation, or business " "requirements expressed elsewhere." ), json_schema_extra={ "element_property": True, }, ) reference__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_reference", title="Extension field for ``reference``." ) statement: typing.List[fhirtypes.RequirementsStatementType] | None = Field( default=None, alias="statement", title="Actual statement as markdown", description="The actual statement of requirement, in markdown format.", json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this Requirements. Enables tracking the life-cycle of " "the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this Requirements (human friendly)", description="A short, descriptive, user-friendly title for the Requirements.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this Requirements, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this Requirements when it is " "referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which an authoritative instance of this" " Requirements is (or will be) published. This URL can be the target of" " a canonical reference. It SHALL remain the same when the Requirements" " is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate Requirements instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the Requirements", description=( "The identifier that is used to identify this version of the " "Requirements when it is referenced in a specification, model, design " "or instance. This is an arbitrary value managed by the Requirements " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Requirements`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "copyrightLabel", "derivedFrom", "reference", "actor", "statement", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Requirements`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "derivedFrom", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields class RequirementsStatement(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Actual statement as markdown. The actual statement of requirement, in markdown format. """ __resource_type__ = "RequirementsStatement" conditionality: bool | None = Field( default=None, alias="conditionality", title="Set to true if requirements statement is conditional", description=( "This boolean flag is set to true of the text of the requirement is " "conditional on something e.g. it includes lanauage like 'if x then y'." " This conditionality flag is introduced for purposes of filtering and " "colour highlighting etc." ), json_schema_extra={ "element_property": True, }, ) conditionality__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_conditionality", title="Extension field for ``conditionality``.", ) conformance: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="conformance", title="SHALL | SHOULD | MAY | SHOULD-NOT", description="A short human usable label for this statement.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["SHALL", "SHOULD", "MAY", "SHOULD-NOT"], }, ) conformance__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_conformance", title="Extension field for ``conformance``." ) derivedFrom: fhirtypes.StringType | None = Field( default=None, alias="derivedFrom", title="Another statement this clarifies/restricts ([url#]key)", description=( "Another statement on one of the requirements that this requirement " "clarifies or restricts." ), json_schema_extra={ "element_property": True, }, ) derivedFrom__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_derivedFrom", title="Extension field for ``derivedFrom``." ) key: fhirtypes.IdType | None = Field( default=None, alias="key", title="Key that identifies this statement", description="Key that identifies this statement (unique within this resource).", json_schema_extra={ "element_property": True, "element_required": True, }, ) key__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_key", title="Extension field for ``key``." ) label: fhirtypes.StringType | None = Field( default=None, alias="label", title="Short Human label for this statement", description="A short human usable label for this statement.", json_schema_extra={ "element_property": True, }, ) label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_label", title="Extension field for ``label``." ) parent: fhirtypes.StringType | None = Field( default=None, alias="parent", title="A larger requirement that this requirement helps to refine and enable", description=None, json_schema_extra={ "element_property": True, }, ) parent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_parent", title="Extension field for ``parent``." ) reference: typing.List[fhirtypes.UrlType | None] | None = Field( default=None, alias="reference", title="External artifact (rule/document etc. that) created this requirement", description=( "A reference to another artifact that created this requirement. This " "could be a Profile, etc., or external regulation, or business " "requirements expressed elsewhere." ), json_schema_extra={ "element_property": True, }, ) reference__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_reference", title="Extension field for ``reference``." ) requirement: fhirtypes.MarkdownType | None = Field( default=None, alias="requirement", title="The actual requirement", description="The actual requirement for human consumption.", json_schema_extra={ "element_property": True, "element_required": True, }, ) requirement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requirement", title="Extension field for ``requirement``." ) satisfiedBy: typing.List[fhirtypes.UrlType | None] | None = Field( default=None, alias="satisfiedBy", title="Design artifact that satisfies this requirement", description=( "A reference to another artifact that satisfies this requirement. This " "could be a Profile, extension, or an element in one of those, or a " "CapabilityStatement, OperationDefinition, SearchParameter, " "CodeSystem(/code), ValueSet, Libary etc." ), json_schema_extra={ "element_property": True, }, ) satisfiedBy__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_satisfiedBy", title="Extension field for ``satisfiedBy``." ) source: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="source", title="Who asked for this statement", description=( "Who asked for this statement to be a requirement. By default, it's " "assumed that the publisher knows who it is if it matters." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CareTeam", "Device", "Group", "HealthcareService", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RequirementsStatement`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "key", "label", "conformance", "conditionality", "requirement", "derivedFrom", "parent", "satisfiedBy", "reference", "source", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RequirementsStatement`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("key", "key__ext"), ("requirement", "requirement__ext")] return required_fields ================================================ FILE: fhir/resources/researchstudy.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ResearchStudy Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ResearchStudy(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Investigation to increase healthcare-related patient-independent knowledge. A scientific study of nature that sometimes includes processes involved in health and disease. For example, clinical trials are research studies that involve people. These studies may be related to new ways to screen, prevent, diagnose, and treat disease. They may also study certain outcomes and certain groups of people by looking at data collected in the past or future. """ __resource_type__ = "ResearchStudy" associatedParty: typing.List[ fhirtypes.ResearchStudyAssociatedPartyType ] | None = Field( default=None, alias="associatedParty", title="Sponsors, collaborators, and other parties", description=None, json_schema_extra={ "element_property": True, }, ) classifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="classifier", title="Classification for the study", description=( "Additional grouping mechanism or categorization of a research study. " "Example: FDA regulated device, FDA regulated drug, MPG Paragraph 23b " "(a German legal requirement), IRB-exempt, etc. Implementation Note: do" " not use the classifier element to support existing semantics that are" " already supported thru explicit elements in the resource." ), json_schema_extra={ "element_property": True, }, ) comparisonGroup: typing.List[ fhirtypes.ResearchStudyComparisonGroupType ] | None = Field( default=None, alias="comparisonGroup", title="Defined path through the study for a subject", description=( "Describes an expected event or sequence of events for one of the " "subjects of a study. E.g. for a living subject: exposure to drug A, " "wash-out, exposure to drug B, wash-out, follow-up. E.g. for a " "stability study: {store sample from lot A at 25 degrees for 1 month}, " "{store sample from lot A at 40 degrees for 1 month}." ), json_schema_extra={ "element_property": True, }, ) condition: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="condition", title="Condition being studied", description=( "The condition that is the focus of the study. For example, In a study" " to examine risk factors for Lupus, might have as an inclusion " 'criterion "healthy volunteer", but the target condition code would be ' "a Lupus SNOMED code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date the resource last changed", description=( "The date (and optionally time) when the ResearchStudy Resource was " "last significantly changed. The date must change when the business " "version changes and it must change if the status code changes. In " "addition, it should change when the substantive content of the " "ResearchStudy Resource changes." ), json_schema_extra={ "element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Detailed narrative of the study", description=( "A detailed and human-readable narrative of the study. E.g., study " "abstract." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) descriptionSummary: fhirtypes.MarkdownType | None = Field( default=None, alias="descriptionSummary", title="Brief text explaining the study", description="A brief text for explaining the study.", json_schema_extra={ "element_property": True, }, ) descriptionSummary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_descriptionSummary", title="Extension field for ``descriptionSummary``.", ) focus: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="focus", title="Drugs, devices, etc. under study", description=( "The medication(s), food(s), therapy(ies), device(s) or other concerns " "or interventions that the study is seeking to gain more information " "about." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Medication", "MedicinalProductDefinition", "SubstanceDefinition", "EvidenceVariable", ], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for study", description=( "Identifiers assigned to this research study by the sponsor or other " "systems." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) keyword: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="keyword", title="Used to search for the study", description="Key terms to aid in searching for or filtering the study.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) label: typing.List[fhirtypes.ResearchStudyLabelType] | None = Field( default=None, alias="label", title="Additional names for the study", description=None, json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this study (computer friendly)", description=None, json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the study", description=( "Comments made about the study by the performer, subject or other " "participants." ), json_schema_extra={ "element_property": True, }, ) objective: typing.List[fhirtypes.ResearchStudyObjectiveType] | None = Field( default=None, alias="objective", title="A goal for the study", description=( "A goal that the study is aiming to achieve in terms of a scientific " "question to be answered by the analysis of data collected during the " "study." ), json_schema_extra={ "element_property": True, }, ) outcomeMeasure: typing.List[ fhirtypes.ResearchStudyOutcomeMeasureType ] | None = Field( default=None, alias="outcomeMeasure", title="A variable measured during the study", description=( 'An "outcome measure", "endpoint", "effect measure" or "measure of ' 'effect" is a specific measurement or observation used to quantify the ' "effect of experimental variables on the participants in a study, or " "for observational studies, to describe patterns of diseases or traits " "or associations with exposures, risk factors or treatment." ), json_schema_extra={ "element_property": True, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of larger study", description=( "A larger research study of which this particular study is a component " "or step." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ResearchStudy"], }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="When the study began and ended", description=( "Identifies the start date and the expected (or actual, depending on " "status) end date for the study." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) phase: fhirtypes.CodeableConceptType | None = Field( default=None, alias="phase", title=( "n-a | early-phase-1 | phase-1 | phase-1-phase-2 | phase-2 | " "phase-2-phase-3 | phase-3 | phase-4" ), description=( "The stage in the progression of a therapy from initial experimental " "use in humans in clinical trials to post-market evaluation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) primaryPurposeType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="primaryPurposeType", title=( "treatment | prevention | diagnostic | supportive-care | screening | " "health-services-research | basic-science | device-feasibility" ), description=( "The type of study based upon the intent of the study activities. A " "classification of the intent of the study." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) progressStatus: typing.List[ fhirtypes.ResearchStudyProgressStatusType ] | None = Field( default=None, alias="progressStatus", title="Status of study with time for that status", description=None, json_schema_extra={ "element_property": True, }, ) protocol: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="protocol", title="Steps followed in executing study", description=( "The set of steps expected to be performed as part of the execution of " "the study." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["PlanDefinition"], }, ) recruitment: fhirtypes.ResearchStudyRecruitmentType | None = Field( default=None, alias="recruitment", title="Target or actual group of participants enrolled in study", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) region: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="region", title="Geographic area for the study", description=( "A country, state or other area where the study is taking place rather " "than its precise geographic location or address." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="References, URLs, and attachments", description=( "Citations, references, URLs and other related documents. When using " "relatedArtifact to share URLs, the relatedArtifact.type will often be " 'set to one of "documentation" or "supported-with" and the URL value ' "will often be in relatedArtifact.document.url but another possible " "location is relatedArtifact.resource when it is a canonical URL." ), json_schema_extra={ "element_property": True, }, ) result: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="result", title="Link to results generated during the study", description=( "Link to one or more sets of results generated by the study. Could " "also link to a research registry holding the results such as " "ClinicalTrials.gov." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["EvidenceReport", "Citation", "DiagnosticReport"], }, ) site: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="site", title="Facility where study activities are conducted", description="A facility in which study activities are conducted.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location", "ResearchStudy", "Organization"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description="The publication state of the resource (not of the study).", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) studyDesign: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="studyDesign", title="Classifications of the study design characteristics", description=( "Codes categorizing the type of study such as investigational vs. " "observational, type of blinding, type of randomization, safety vs. " "efficacy, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Human readable name of the study", description="The human readable name of the research study.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="Canonical identifier for this study resource", description=( "Canonical identifier for this study resource, represented as a " "globally unique URI." ), json_schema_extra={ "element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="The business version for the study record", description=None, json_schema_extra={ "element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) whyStopped: fhirtypes.CodeableConceptType | None = Field( default=None, alias="whyStopped", title=( "accrual-goal-met | closed-due-to-toxicity | closed-due-to-lack-of-" "study-progress | temporarily-closed-per-study-design" ), description=( "A description and/or code explaining the premature termination of the " "study." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ResearchStudy`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "name", "title", "label", "protocol", "partOf", "relatedArtifact", "date", "status", "primaryPurposeType", "phase", "studyDesign", "focus", "condition", "keyword", "region", "descriptionSummary", "description", "period", "site", "note", "classifier", "associatedParty", "progressStatus", "whyStopped", "recruitment", "comparisonGroup", "objective", "outcomeMeasure", "result", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ResearchStudy`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "title", "protocol", "partOf", "status", "primaryPurposeType", "phase", "studyDesign", "condition", "keyword", "region", "period", "site", "whyStopped", "recruitment", "result", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class ResearchStudyAssociatedParty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Sponsors, collaborators, and other parties. """ __resource_type__ = "ResearchStudyAssociatedParty" classifier: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="classifier", title="nih | fda | government | nonprofit | academic | industry", description="A categorization other than role for the associated party.", json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name of associated party", description=None, json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) party: fhirtypes.ReferenceType | None = Field( default=None, alias="party", title=( "Individual or organization associated with study (use practitionerRole" " to specify their organisation)" ), description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) period: typing.List[fhirtypes.PeriodType] | None = Field( default=None, alias="period", title="When active in the role", description=( "Identifies the start date and the end date of the associated party in " "the role." ), json_schema_extra={ "element_property": True, }, ) role: fhirtypes.CodeableConceptType = Field( default=..., alias="role", title=( "sponsor | lead-sponsor | sponsor-investigator | primary-investigator |" " collaborator | funding-source | general-contact | recruitment-contact" " | sub-investigator | study-director | study-chair" ), description="Type of association.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ResearchStudyAssociatedParty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "role", "period", "classifier", "party", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ResearchStudyAssociatedParty`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ResearchStudyComparisonGroup(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Defined path through the study for a subject. Describes an expected event or sequence of events for one of the subjects of a study. E.g. for a living subject: exposure to drug A, wash-out, exposure to drug B, wash-out, follow-up. E.g. for a stability study: {store sample from lot A at 25 degrees for 1 month}, {store sample from lot A at 40 degrees for 1 month}. """ __resource_type__ = "ResearchStudyComparisonGroup" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Short explanation of study path", description=( "A succinct description of the path through the study that would be " "followed by a subject adhering to this comparisonGroup." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) intendedExposure: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="intendedExposure", title="Interventions or exposures in this comparisonGroup or cohort", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["EvidenceVariable"], }, ) linkId: fhirtypes.IdType | None = Field( default=None, alias="linkId", title=( "Allows the comparisonGroup for the study and the comparisonGroup for " "the subject to be linked easily" ), description=None, json_schema_extra={ "element_property": True, }, ) linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_linkId", title="Extension field for ``linkId``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Label for study comparisonGroup", description="Unique, human-readable label for this comparisonGroup of the study.", json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) observedGroup: fhirtypes.ReferenceType | None = Field( default=None, alias="observedGroup", title="Group of participants who were enrolled in study comparisonGroup", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Categorization of study comparisonGroup", description=( "Categorization of study comparisonGroup, e.g. experimental, active " "comparator, placebo comparater." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ResearchStudyComparisonGroup`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "linkId", "name", "type", "description", "intendedExposure", "observedGroup", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ResearchStudyComparisonGroup`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields class ResearchStudyLabel(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional names for the study. """ __resource_type__ = "ResearchStudyLabel" type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title=( "primary | official | scientific | plain-language | subtitle | short-" "title | acronym | earlier-title | language | auto-translated | human-" "use | machine-use | duplicate-uid" ), description="Kind of name.", json_schema_extra={ "element_property": True, }, ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The name", description=None, json_schema_extra={ "element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ResearchStudyLabel`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ResearchStudyLabel`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ResearchStudyObjective(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A goal for the study. A goal that the study is aiming to achieve in terms of a scientific question to be answered by the analysis of data collected during the study. """ __resource_type__ = "ResearchStudyObjective" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Description of the objective", description=( "Free text description of the objective of the study. This is what the" " study is trying to achieve rather than how it is going to achieve it " "(see ResearchStudy.description)." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Label for the objective", description="Unique, human-readable label for this objective of the study.", json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="primary | secondary | exploratory", description="The kind of study objective.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ResearchStudyObjective`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "type", "description"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ResearchStudyObjective`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ResearchStudyOutcomeMeasure(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A variable measured during the study. An "outcome measure", "endpoint", "effect measure" or "measure of effect" is a specific measurement or observation used to quantify the effect of experimental variables on the participants in a study, or for observational studies, to describe patterns of diseases or traits or associations with exposures, risk factors or treatment. """ __resource_type__ = "ResearchStudyOutcomeMeasure" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Description of the outcome", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Label for the outcome", description=None, json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) reference: fhirtypes.ReferenceType | None = Field( default=None, alias="reference", title="Structured outcome definition", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["EvidenceVariable"], }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="primary | secondary | exploratory", description=( "The parameter or characteristic being assessed as one of the values by" " which the study is assessed." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ResearchStudyOutcomeMeasure`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "type", "description", "reference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ResearchStudyOutcomeMeasure`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ResearchStudyProgressStatus(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Status of study with time for that status. """ __resource_type__ = "ResearchStudyProgressStatus" actual: bool | None = Field( default=None, alias="actual", title="Actual if true else anticipated", description=( "An indication of whether or not the date is a known date when the " "state changed or will change. A value of true indicates a known date. " "A value of false indicates an estimated date." ), json_schema_extra={ "element_property": True, }, ) actual__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_actual", title="Extension field for ``actual``." ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Date range", description=None, json_schema_extra={ "element_property": True, }, ) state: fhirtypes.CodeableConceptType = Field( default=..., alias="state", title="Label for status or state (e.g. recruitment status)", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ResearchStudyProgressStatus`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "state", "actual", "period"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ResearchStudyProgressStatus`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ResearchStudyRecruitment(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Target or actual group of participants enrolled in study. """ __resource_type__ = "ResearchStudyRecruitment" actualGroup: fhirtypes.ReferenceType | None = Field( default=None, alias="actualGroup", title="Group of participants who were enrolled in study", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) actualNumber: fhirtypes.UnsignedIntType | None = Field( default=None, alias="actualNumber", title="Actual total number of participants enrolled in study", description=None, json_schema_extra={ "element_property": True, }, ) actualNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_actualNumber", title="Extension field for ``actualNumber``.", ) eligibility: fhirtypes.ReferenceType | None = Field( default=None, alias="eligibility", title="Inclusion and exclusion criteria", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group", "EvidenceVariable"], }, ) targetNumber: fhirtypes.UnsignedIntType | None = Field( default=None, alias="targetNumber", title="Estimated total number of participants to be enrolled", description=None, json_schema_extra={ "element_property": True, }, ) targetNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_targetNumber", title="Extension field for ``targetNumber``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ResearchStudyRecruitment`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "targetNumber", "actualNumber", "eligibility", "actualGroup", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ResearchStudyRecruitment`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "actualGroup"] ================================================ FILE: fhir/resources/researchsubject.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ResearchSubject Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ResearchSubject(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Participant or object which is the recipient of investigative activities in a study. A ResearchSubject is a participant or object which is the recipient of investigative activities in a research study. """ __resource_type__ = "ResearchSubject" actualComparisonGroup: fhirtypes.IdType | None = Field( default=None, alias="actualComparisonGroup", title="What path was followed", description=( "The name of the arm in the study the subject actually followed as part" " of this study." ), json_schema_extra={ "element_property": True, }, ) actualComparisonGroup__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_actualComparisonGroup", title="Extension field for ``actualComparisonGroup``.", ) assignedComparisonGroup: fhirtypes.IdType | None = Field( default=None, alias="assignedComparisonGroup", title="What path should be followed", description=( "The name of the arm in the study the subject is expected to follow as " "part of this study." ), json_schema_extra={ "element_property": True, }, ) assignedComparisonGroup__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_assignedComparisonGroup", title="Extension field for ``assignedComparisonGroup``.", ) consent: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="consent", title="Agreement to participate in study", description=( "A record of the patient's informed agreement to participate in the " "study." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Consent"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for research subject in a study", description="Identifiers assigned to this research subject for a study.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="Start and end of participation", description=( "The dates the subject began and ended their participation in the " "study." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) progress: typing.List[fhirtypes.ResearchSubjectProgressType] | None = Field( default=None, alias="progress", title="Subject status", description=( "The current state (status) of the subject and resons for status change" " where appropriate." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description="The publication state of the resource (not of the subject).", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) study: fhirtypes.ReferenceType = Field( default=..., alias="study", title="Study subject is part of", description="Reference to the study the subject is participating in.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ResearchStudy"], }, ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who or what is part of study", description=( "The record of the person, animal or other entity involved in the " "study." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Group", "Specimen", "Device", "Medication", "Substance", "BiologicallyDerivedProduct", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ResearchSubject`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "progress", "period", "study", "subject", "assignedComparisonGroup", "actualComparisonGroup", "consent", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ResearchSubject`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "period", "study", "subject", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class ResearchSubjectProgress(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Subject status. The current state (status) of the subject and resons for status change where appropriate. """ __resource_type__ = "ResearchSubjectProgress" endDate: fhirtypes.DateTimeType | None = Field( default=None, alias="endDate", title="State change date", description="The date when the state ended.", json_schema_extra={ "element_property": True, }, ) endDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_endDate", title="Extension field for ``endDate``." ) milestone: fhirtypes.CodeableConceptType | None = Field( default=None, alias="milestone", title="SignedUp | Screened | Randomized", description="The milestones the subject has passed through.", json_schema_extra={ "element_property": True, }, ) reason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="reason", title="State change reason", description=( "The reason for the state change. If coded it should follow the formal" " subject state model." ), json_schema_extra={ "element_property": True, }, ) startDate: fhirtypes.DateTimeType | None = Field( default=None, alias="startDate", title="State change date", description="The date when the new status started.", json_schema_extra={ "element_property": True, }, ) startDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_startDate", title="Extension field for ``startDate``." ) subjectState: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subjectState", title=( "candidate | eligible | follow-up | ineligible | not-registered | off-" "study | on-study | on-study-intervention | on-study-observation | " "pending-on-study | potential-candidate | screening | withdrawn" ), description="The current state of the subject.", json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="state | milestone", description=( "Identifies the aspect of the subject's journey that the state refers " "to." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ResearchSubjectProgress`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "subjectState", "milestone", "reason", "startDate", "endDate", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ResearchSubjectProgress`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/resource.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Resource Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import base, fhirtypes class Resource(base.Base): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Base Resource. This is the base resource type for everything. """ __resource_type__ = "Resource" id: fhirtypes.IdType | None = Field( default=None, alias="id", title="Logical id of this artifact", description=( "The logical id of the resource, as used in the URL for the resource. " "Once assigned, this value never changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) implicitRules: fhirtypes.UriType | None = Field( default=None, alias="implicitRules", title="A set of rules under which this content was created", description=( "A reference to a set of rules that were followed when the resource was" " constructed, and which must be understood when processing the " "content. Often, this is a reference to an implementation guide that " "defines the special rules along with other profiles etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) implicitRules__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_implicitRules", title="Extension field for ``implicitRules``.", ) language: fhirtypes.CodeType | None = Field( default=None, alias="language", title="Language of the resource content", description="The base language in which the resource is written.", json_schema_extra={ "element_property": True, }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) meta: fhirtypes.MetaType | None = Field( default=None, alias="meta", title="Metadata about the resource", description=( "The metadata about the resource. This is content that is maintained by" " the infrastructure. Changes to the content might not always be " "associated with version changes to the resource." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Resource`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules", "language"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Resource`` according to specification, with preserving the original sequence order. """ return ["id", "meta", "implicitRules"] ================================================ FILE: fhir/resources/riskassessment.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/RiskAssessment Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class RiskAssessment(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Potential outcomes for a subject with likelihood. An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. """ __resource_type__ = "RiskAssessment" basedOn: fhirtypes.ReferenceType | None = Field( default=None, alias="basedOn", title="Request fulfilled by this assessment", description="A reference to the request that is fulfilled by this risk assessment.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) basis: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basis", title="Information used in assessment", description=( "Indicates the source data considered as part of the assessment (for " "example, FamilyHistory, Observations, Procedures, Conditions, etc.)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Type of assessment", description="The type of the risk assessment performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) condition: fhirtypes.ReferenceType | None = Field( default=None, alias="condition", title="Condition assessed", description=( "For assessments or prognosis specific to a particular condition, " "indicates the condition being assessed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Condition"], }, ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Where was assessment performed?", description="The encounter where the assessment was performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique identifier for the assessment", description="Business identifier assigned to the risk assessment.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="Evaluation mechanism", description="The algorithm, process or mechanism used to evaluate the risk.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) mitigation: fhirtypes.StringType | None = Field( default=None, alias="mitigation", title="How to reduce risk", description=( "A description of the steps that might be taken to reduce the " "identified risk(s)." ), json_schema_extra={ "element_property": True, }, ) mitigation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mitigation", title="Extension field for ``mitigation``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments on the risk assessment", description="Additional comments about the risk assessment.", json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When was assessment made?", description="The date (and possibly time) the risk assessment was performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="When was assessment made?", description="The date (and possibly time) the risk assessment was performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) parent: fhirtypes.ReferenceType | None = Field( default=None, alias="parent", title="Part of this occurrence", description=( "A reference to a resource that this risk assessment is part of, such " "as a Procedure." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) performer: fhirtypes.ReferenceType | None = Field( default=None, alias="performer", title="Who did assessment?", description=( "The provider, patient, related person, or software application that " "performed the assessment." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Device", ], }, ) prediction: typing.List[fhirtypes.RiskAssessmentPredictionType] | None = Field( default=None, alias="prediction", title="Outcome predicted", description="Describes the expected outcome for the subject.", json_schema_extra={ "element_property": True, }, ) reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="reason", title="Why the assessment was necessary?", description="The reason the risk assessment was performed.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "DiagnosticReport", "DocumentReference", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="registered | preliminary | final | amended +", description=( "The status of the RiskAssessment, using the same statuses as an " "Observation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["registered", "preliminary", "final", "amended", "+"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Who/what does assessment apply to?", description="The patient or group the risk assessment applies to.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RiskAssessment`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "parent", "status", "method", "code", "subject", "encounter", "occurrenceDateTime", "occurrencePeriod", "condition", "performer", "reason", "basis", "prediction", "mitigation", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RiskAssessment`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "method", "code", "subject", "encounter", "occurrenceDateTime", "occurrencePeriod", "condition", "performer", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"occurrence": ["occurrenceDateTime", "occurrencePeriod"]} return one_of_many_fields class RiskAssessmentPrediction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Outcome predicted. Describes the expected outcome for the subject. """ __resource_type__ = "RiskAssessmentPrediction" outcome: fhirtypes.CodeableConceptType | None = Field( default=None, alias="outcome", title="Possible outcome for the subject", description=( "One of the potential outcomes for the patient (e.g. remission, death," " a particular condition)." ), json_schema_extra={ "element_property": True, }, ) probabilityDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="probabilityDecimal", title="Likelihood of specified outcome", description="Indicates how likely the outcome is (in the specified timeframe).", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e probability[x] "one_of_many": "probability", "one_of_many_required": False, }, ) probabilityDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_probabilityDecimal", title="Extension field for ``probabilityDecimal``.", ) probabilityRange: fhirtypes.RangeType | None = Field( default=None, alias="probabilityRange", title="Likelihood of specified outcome", description="Indicates how likely the outcome is (in the specified timeframe).", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e probability[x] "one_of_many": "probability", "one_of_many_required": False, }, ) qualitativeRisk: fhirtypes.CodeableConceptType | None = Field( default=None, alias="qualitativeRisk", title="Likelihood of specified outcome as a qualitative value", description=( "Indicates how likely the outcome is (in the specified timeframe), " "expressed as a qualitative value (e.g. low, medium, or high)." ), json_schema_extra={ "element_property": True, }, ) rationale: fhirtypes.StringType | None = Field( default=None, alias="rationale", title="Explanation of prediction", description="Additional information explaining the basis for the prediction.", json_schema_extra={ "element_property": True, }, ) rationale__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_rationale", title="Extension field for ``rationale``." ) relativeRisk: fhirtypes.DecimalType | None = Field( default=None, alias="relativeRisk", title="Relative likelihood", description=( "Indicates the risk for this particular subject (with their specific " "characteristics) divided by the risk of the population in general. " "(Numbers greater than 1 = higher risk than the population, numbers " "less than 1 = lower risk.)." ), json_schema_extra={ "element_property": True, }, ) relativeRisk__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_relativeRisk", title="Extension field for ``relativeRisk``.", ) whenPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="whenPeriod", title="Timeframe or age range", description=( "Indicates the period of time or age range of the subject to which the " "specified probability applies." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e when[x] "one_of_many": "when", "one_of_many_required": False, }, ) whenRange: fhirtypes.RangeType | None = Field( default=None, alias="whenRange", title="Timeframe or age range", description=( "Indicates the period of time or age range of the subject to which the " "specified probability applies." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e when[x] "one_of_many": "when", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``RiskAssessmentPrediction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "outcome", "probabilityDecimal", "probabilityRange", "qualitativeRisk", "relativeRisk", "whenPeriod", "whenRange", "rationale", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``RiskAssessmentPrediction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "probability": ["probabilityDecimal", "probabilityRange"], "when": ["whenPeriod", "whenRange"], } return one_of_many_fields ================================================ FILE: fhir/resources/sampleddata.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SampledData Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class SampledData(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A series of measurements taken by a device. A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data. """ __resource_type__ = "SampledData" codeMap: fhirtypes.CanonicalType | None = Field( default=None, alias="codeMap", title="Defines the codes used in the data", description="Reference to ConceptMap that defines the codes used in the data.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ConceptMap"], }, ) codeMap__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_codeMap", title="Extension field for ``codeMap``." ) data: fhirtypes.StringType | None = Field( default=None, alias="data", title='Decimal values with spaces, or "E" | "U" | "L", or another code', description=( "A series of data points which are decimal values or codes separated by" ' a single space (character u20). The special codes "E" (error), "L" ' '(below detection limit) and "U" (above detection limit) are also ' "defined for used in place of decimal values." ), json_schema_extra={ "element_property": True, }, ) data__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_data", title="Extension field for ``data``." ) dimensions: fhirtypes.PositiveIntType | None = Field( default=None, alias="dimensions", title="Number of sample points at each time point", description=( "The number of sample points at each time point. If this value is " "greater than one, then the dimensions will be interlaced - all the " "sample points for a point in time will be recorded at once." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) dimensions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dimensions", title="Extension field for ``dimensions``." ) factor: fhirtypes.DecimalType | None = Field( default=None, alias="factor", title="Multiply data by this before adding to origin", description=( "A correction factor that is applied to the sampled data points before " "they are added to the origin." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_factor", title="Extension field for ``factor``." ) interval: fhirtypes.DecimalType | None = Field( default=None, alias="interval", title="Number of intervalUnits between samples", description=( "Amount of intervalUnits between samples, e.g. milliseconds for time-" "based sampling." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) interval__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_interval", title="Extension field for ``interval``." ) intervalUnit: fhirtypes.CodeType | None = Field( default=None, alias="intervalUnit", title="The measurement unit of the interval between samples", description="The measurement unit in which the sample interval is expressed.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) intervalUnit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intervalUnit", title="Extension field for ``intervalUnit``.", ) lowerLimit: fhirtypes.DecimalType | None = Field( default=None, alias="lowerLimit", title="Lower limit of detection", description=( "The lower limit of detection of the measured points. This is needed if" ' any of the data points have the value "L" (lower than detection ' "limit)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lowerLimit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lowerLimit", title="Extension field for ``lowerLimit``." ) offsets: fhirtypes.StringType | None = Field( default=None, alias="offsets", title="Offsets, typically in time, at which data values were taken", description=( "A series of data points which are decimal values separated by a single" " space (character u20). The units in which the offsets are expressed " "are found in intervalUnit. The absolute point at which the " "measurements begin SHALL be conveyed outside the scope of this " "datatype, e.g. Observation.effectiveDateTime for a timing offset." ), json_schema_extra={ "element_property": True, }, ) offsets__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_offsets", title="Extension field for ``offsets``." ) origin: fhirtypes.QuantityType = Field( default=..., alias="origin", title="Zero value and units", description=( "The base quantity that a measured value of zero represents. In " "addition, this provides the units of the entire measurement series." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) upperLimit: fhirtypes.DecimalType | None = Field( default=None, alias="upperLimit", title="Upper limit of detection", description=( "The upper limit of detection of the measured points. This is needed if" ' any of the data points have the value "U" (higher than detection ' "limit)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) upperLimit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_upperLimit", title="Extension field for ``upperLimit``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SampledData`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "origin", "interval", "intervalUnit", "factor", "lowerLimit", "upperLimit", "dimensions", "codeMap", "offsets", "data", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SampledData`` according to specification, with preserving the original sequence order. """ return [ "origin", "interval", "intervalUnit", "factor", "lowerLimit", "upperLimit", "dimensions", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("dimensions", "dimensions__ext"), ("intervalUnit", "intervalUnit__ext"), ] return required_fields ================================================ FILE: fhir/resources/schedule.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Schedule Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class Schedule(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A container for slots of time that may be available for booking appointments. """ __resource_type__ = "Schedule" active: bool | None = Field( default=None, alias="active", title="Whether this schedule is in active use", description=( "Whether this schedule record is in active use or should not be used " "(such as was entered in error)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_active", title="Extension field for ``active``." ) actor: typing.List[fhirtypes.ReferenceType] = Field( default=..., alias="actor", title="Resource(s) that availability information is being provided for", description=( "Slots that reference this schedule resource provide the availability " "details to these referenced resource(s)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "CareTeam", "RelatedPerson", "Device", "HealthcareService", "Location", ], }, ) comment: fhirtypes.MarkdownType | None = Field( default=None, alias="comment", title="Comments on availability", description=( "Comments on the availability to describe any extended information. " "Such as custom constraints on the slots that may be associated." ), json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Ids for this item", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Human-readable label", description=( "Further description of the schedule as it would be presented to a " "consumer while searching." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) planningHorizon: fhirtypes.PeriodType | None = Field( default=None, alias="planningHorizon", title="Period of time covered by schedule", description=( "The period of time that the slots that reference this Schedule " "resource cover (even if none exist). These cover the amount of time " "that an organization's planning horizon; the interval for which they " "are currently accepting appointments. This does not define a " '"template" for planning outside these dates.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) serviceCategory: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="serviceCategory", title="High-level category", description=( "A broad categorization of the service that is to be performed during " "this appointment." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) serviceType: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="serviceType", title="Specific service", description="The specific service that is to be performed during this appointment.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["HealthcareService"], }, ) specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialty", title="Type of specialty needed", description=( "The specialty of a practitioner that would be required to perform the " "service requested in this appointment." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Schedule`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "active", "serviceCategory", "serviceType", "specialty", "name", "actor", "planningHorizon", "comment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Schedule`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "active", "serviceCategory", "serviceType", "specialty", "name", "actor", "planningHorizon", ] ================================================ FILE: fhir/resources/searchparameter.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SearchParameter Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class SearchParameter(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Search parameter for a resource. A search parameter that defines a named search item that can be used to search/filter on a resource. """ __resource_type__ = "SearchParameter" base: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="base", title="The resource type(s) this search parameter applies to", description=( "The base resource type(s) that this search parameter can be used " "against." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) base__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_base", title="Extension field for ``base``." ) chain: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="chain", title="Chained names supported", description=( "Contains the names of any search parameters which may be chained to " "the containing search parameter. Chained parameters may be added to " "search parameters of type reference and specify that resources will " "only be returned if they contain a reference to a resource which " "matches the chained parameter value. Values for this field should be " "drawn from SearchParameter.code for a parameter on the target resource" " type." ), json_schema_extra={ "element_property": True, }, ) chain__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_chain", title="Extension field for ``chain``." ) code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Recommended name for parameter in search url", description=( "The label that is recommended to be used in the URL or the parameter " "name in a parameters resource for this search parameter. In some " "cases, servers may need to use a different CapabilityStatement " "searchParam.name to differentiate between multiple SearchParameters " "that happen to have the same code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) comparator: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="comparator", title="eq | ne | gt | lt | ge | le | sa | eb | ap", description="Comparators supported for the search parameter.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["eq", "ne", "gt", "lt", "ge", "le", "sa", "eb", "ap"], }, ) comparator__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_comparator", title="Extension field for ``comparator``." ) component: typing.List[fhirtypes.SearchParameterComponentType] | None = Field( default=None, alias="component", title="For Composite resources to define the parts", description="Used to define the parts of a composite search parameter.", json_schema_extra={ "element_property": True, }, ) constraint: fhirtypes.StringType | None = Field( default=None, alias="constraint", title="FHIRPath expression that constraints the usage of this SearchParamete", description=( "FHIRPath expression that defines/sets a complex constraint for when " "this SearchParameter is applicable." ), json_schema_extra={ "element_property": True, }, ) constraint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_constraint", title="Extension field for ``constraint``." ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the search parameter and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the search parameter." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the search parameter was last " "significantly changed. The date must change when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the search parameter " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) derivedFrom: fhirtypes.CanonicalType | None = Field( default=None, alias="derivedFrom", title="Original definition for the search parameter", description=( "Where this search parameter is originally defined. If a derivedFrom is" " provided, then the details in the search parameter must be consistent" " with the definition from which it is defined. i.e. the parameter " "should have the same meaning, and (usually) the functionality should " "be a proper subset of the underlying search parameter." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SearchParameter"], }, ) derivedFrom__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_derivedFrom", title="Extension field for ``derivedFrom``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the search parameter", description="And how it used.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this search parameter is authored for" " testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="FHIRPath expression that extracts the values", description=( "A FHIRPath expression that returns a set of elements for the search " "parameter." ), json_schema_extra={ "element_property": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the search parameter (business identifier)", description=( "A formal identifier that is used to identify this search parameter " "when it is represented in other formats, or referenced in a " "specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for search parameter (if applicable)", description=( "A legal or geographic region in which the search parameter is intended" " to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) modifier: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="modifier", title=( "missing | exact | contains | not | text | in | not-in | below | above " "| type | identifier | of-type | code-text | text-advanced | iterate" ), description="A modifier supported for the search parameter.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "missing", "exact", "contains", "not", "text", "in", "not-in", "below", "above", "type", "identifier", "of-type", "code-text", "text-advanced", "iterate", ], }, ) modifier__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_modifier", title="Extension field for ``modifier``." ) multipleAnd: bool | None = Field( default=None, alias="multipleAnd", title="Allow multiple parameters (and)", description=( "Whether multiple parameters are allowed - e.g. more than one parameter" " with the same name. The search matches if all the parameters match." ), json_schema_extra={ "element_property": True, }, ) multipleAnd__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_multipleAnd", title="Extension field for ``multipleAnd``." ) multipleOr: bool | None = Field( default=None, alias="multipleOr", title="Allow multiple values per parameter (or)", description=( "Whether multiple values are allowed for each time the parameter " "exists. Values are separated by commas, and the parameter matches if " "any of the values match." ), json_schema_extra={ "element_property": True, }, ) multipleOr__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_multipleOr", title="Extension field for ``multipleOr``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this search parameter (computer friendly)", description=( "A natural language name identifying the search parameter. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) processingMode: fhirtypes.CodeType | None = Field( default=None, alias="processingMode", title="normal | phonetic | other", description=( "How the search parameter relates to the set of elements returned by " "evaluating the expression query." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["normal", "phonetic", "other"], }, ) processingMode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_processingMode", title="Extension field for ``processingMode``.", ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual tresponsible for the " "release and ongoing maintenance of the search parameter." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this search parameter is defined", description=( "Explanation of why this search parameter is needed and why it has been" " designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this search parameter. Enables tracking the life-cycle " "of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) target: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="target", title="Types of resource (if a resource reference)", description="Types of resource (if a resource is referenced).", json_schema_extra={ "element_property": True, }, ) target__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_target", title="Extension field for ``target``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this search parameter (human friendly)", description="A short, descriptive, user-friendly title for the search parameter.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "number | date | string | token | reference | composite | quantity | " "uri | special" ), description=( "The type of value that a search parameter may contain, and how the " "content is interpreted." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "number", "date", "string", "token", "reference", "composite", "quantity", "uri", "special", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this search parameter, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this search parameter when it" " is referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which an authoritative instance of this" " search parameter is (or will be) published. This URL can be the " "target of a canonical reference. It SHALL remain the same when the " "search parameter is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate search parameter instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the search parameter", description=( "The identifier that is used to identify this version of the search " "parameter when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the search parameter " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SearchParameter`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "derivedFrom", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "copyrightLabel", "code", "base", "type", "expression", "processingMode", "constraint", "target", "multipleOr", "multipleAnd", "comparator", "modifier", "chain", "component", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SearchParameter`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "code", "base", "type", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("base", "base__ext"), ("code", "code__ext"), ("description", "description__ext"), ("name", "name__ext"), ("status", "status__ext"), ("type", "type__ext"), ("url", "url__ext"), ] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields class SearchParameterComponent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. For Composite resources to define the parts. Used to define the parts of a composite search parameter. """ __resource_type__ = "SearchParameterComponent" definition: fhirtypes.CanonicalType | None = Field( default=None, alias="definition", title="Defines how the part works", description="The definition of the search parameter that describes this part.", json_schema_extra={ "element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SearchParameter"], }, ) definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_definition", title="Extension field for ``definition``." ) expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="Subexpression relative to main expression", description=( "A sub-expression that defines how to extract values for this component" " from the output of the main SearchParameter.expression." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SearchParameterComponent`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "definition", "expression"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SearchParameterComponent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("definition", "definition__ext"), ("expression", "expression__ext"), ] return required_fields ================================================ FILE: fhir/resources/servicerequest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ServiceRequest Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ServiceRequest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A request for a service to be performed. A record of a request for service such as diagnostic investigations, treatments, or operations to be performed. """ __resource_type__ = "ServiceRequest" asNeededBoolean: bool | None = Field( default=None, alias="asNeededBoolean", title="Preconditions for service", description=( "If a CodeableConcept is present, it indicates the pre-condition for " 'performing the service. For example "pain", "on flare-up", etc.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e asNeeded[x] "one_of_many": "asNeeded", "one_of_many_required": False, }, ) asNeededBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_asNeededBoolean", title="Extension field for ``asNeededBoolean``.", ) asNeededCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="asNeededCodeableConcept", title="Preconditions for service", description=( "If a CodeableConcept is present, it indicates the pre-condition for " 'performing the service. For example "pain", "on flare-up", etc.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e asNeeded[x] "one_of_many": "asNeeded", "one_of_many_required": False, }, ) authoredOn: fhirtypes.DateTimeType | None = Field( default=None, alias="authoredOn", title="Date request signed", description="When the request transitioned to being actionable.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoredOn", title="Extension field for ``authoredOn``." ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="What request fulfills", description="Plan/proposal/order fulfilled by this request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CarePlan", "ServiceRequest", "MedicationRequest"], }, ) bodySite: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="bodySite", title="Coded location on Body", description=( "Anatomic location where the procedure should be performed. This is the" " target site." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) bodyStructure: fhirtypes.ReferenceType | None = Field( default=None, alias="bodyStructure", title="BodyStructure-based location on the body", description=( "Anatomic location where the procedure should be performed. This is the" " target site." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["BodyStructure"], }, ) category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="Classification of service", description=( "A code that classifies the service for searching, sorting and display " 'purposes (e.g. "Surgical Procedure").' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="code", title="What is being requested/ordered", description=( "A code or reference that identifies a particular service (i.e., " "procedure, diagnostic investigation, or panel of investigations) that " "have been requested." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ActivityDefinition", "PlanDefinition"], }, ) doNotPerform: bool | None = Field( default=None, alias="doNotPerform", title="True if service/procedure should not be performed", description=( "Set this to true if the record is saying that the service/procedure " "should NOT be performed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doNotPerform", title="Extension field for ``doNotPerform``.", ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Encounter in which the request was created", description=( "An encounter that provides additional information about the healthcare" " context in which this request is made." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) focus: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="focus", title=( "What the service request is about, when it is not about the subject of" " record" ), description=( "The actual focus of a service request when it is not the subject of " "record representing something or someone associated with the subject " "such as a spouse, parent, fetus, or donor. The focus of a service " "request could also be an existing condition, an intervention, the " "subject's diet, another service request on the subject, or a body " "structure such as tumor or implanted device." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifiers assigned to this order", description=( "Identifiers assigned to this order instance by the orderer and/or the " "receiver and/or order fulfiller." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="instantiatesCanonical", title="Instantiates FHIR protocol or definition", description=( "The URL pointing to a FHIR-defined protocol, guideline, orderset or " "other definition that is adhered to in whole or in part by this " "ServiceRequest." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ActivityDefinition", "PlanDefinition"], }, ) instantiatesCanonical__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="instantiatesUri", title="Instantiates external protocol or definition", description=( "The URL pointing to an externally maintained protocol, guideline, " "orderset or other definition that is adhered to in whole or in part by" " this ServiceRequest." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) insurance: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="insurance", title="Associated insurance coverage", description=( "Insurance plans, coverage extensions, pre-authorizations and/or pre-" "determinations that may be needed for delivering the requested " "service." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage", "ClaimResponse"], }, ) intent: fhirtypes.CodeType | None = Field( default=None, alias="intent", title="proposal | plan | directive | order +", description=( "Whether the request is a proposal, plan, an original order or a reflex" " order." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["proposal", "plan", "directive", "order", "+"], }, ) intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intent", title="Extension field for ``intent``." ) location: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="location", title="Requested location", description=( "The preferred location(s) where the procedure should actually happen " "in coded or free text form. E.g. at home or nursing day care center." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments", description=( "Any other notes and comments made about the service request. For " "example, internal billing notes." ), json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When service should occur", description="The date/time at which the requested service should occur.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="When service should occur", description="The date/time at which the requested service should occur.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceTiming: fhirtypes.TimingType | None = Field( default=None, alias="occurrenceTiming", title="When service should occur", description="The date/time at which the requested service should occur.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) orderDetail: typing.List[fhirtypes.ServiceRequestOrderDetailType] | None = Field( default=None, alias="orderDetail", title="Additional order information", description=( "Additional details and instructions about the how the services are to " "be delivered. For example, and order for a urinary catheter may have" " an order detail for an external or indwelling catheter, or an order " "for a bandage may require additional instructions specifying how the " "bandage should be applied." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patientInstruction: typing.List[ fhirtypes.ServiceRequestPatientInstructionType ] | None = Field( default=None, alias="patientInstruction", title="Patient or consumer-oriented instructions", description="Instructions in terms that are understood by the patient or consumer.", json_schema_extra={ "element_property": True, }, ) performer: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="performer", title="Requested performer", description=( "The desired performer for doing the requested service. For example, " "the surgeon, dermatopathologist, endoscopist, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", "HealthcareService", "Patient", "Device", "RelatedPerson", ], }, ) performerType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="performerType", title="Performer role", description="Desired type of performer for doing the requested service.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Indicates how quickly the ServiceRequest should be addressed with " "respect to other requests." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) quantityQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantityQuantity", title="Service amount", description=( "An amount of service being requested which can be a quantity ( for " "example $1,500 home modification), a ratio ( for example, 20 half day " "visits per month), or a range (2.0 to 1.8 Gy per fraction)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e quantity[x] "one_of_many": "quantity", "one_of_many_required": False, }, ) quantityRange: fhirtypes.RangeType | None = Field( default=None, alias="quantityRange", title="Service amount", description=( "An amount of service being requested which can be a quantity ( for " "example $1,500 home modification), a ratio ( for example, 20 half day " "visits per month), or a range (2.0 to 1.8 Gy per fraction)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e quantity[x] "one_of_many": "quantity", "one_of_many_required": False, }, ) quantityRatio: fhirtypes.RatioType | None = Field( default=None, alias="quantityRatio", title="Service amount", description=( "An amount of service being requested which can be a quantity ( for " "example $1,500 home modification), a ratio ( for example, 20 half day " "visits per month), or a range (2.0 to 1.8 Gy per fraction)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e quantity[x] "one_of_many": "quantity", "one_of_many_required": False, }, ) reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="reason", title="Explanation/Justification for procedure or service", description=( "An explanation or justification for why this service is being " "requested in coded or textual form. This is often for billing " "purposes. May relate to the resources referred to in " "`supportingInfo`." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "DiagnosticReport", "DocumentReference", "DetectedIssue", ], }, ) relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="relevantHistory", title="Request provenance", description="Key events in the history of the request.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Provenance"], }, ) replaces: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="replaces", title="What request replaces", description=( "The request takes the place of the referenced completed or terminated " "request(s)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ServiceRequest"], }, ) requester: fhirtypes.ReferenceType | None = Field( default=None, alias="requester", title="Who/what is requesting service", description=( "The individual who initiated the request and has responsibility for " "its activation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Patient", "RelatedPerson", "Device", ], }, ) requisition: fhirtypes.IdentifierType | None = Field( default=None, alias="requisition", title="Composite Request ID", description=( "A shared identifier common to all service requests that were " "authorized more or less simultaneously by a single author, " "representing the composite or group identifier." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) specimen: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="specimen", title="Procedure Samples", description="One or more specimens that the laboratory procedure will use.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Specimen"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "draft | active | on-hold | revoked | completed | entered-in-error | " "unknown" ), description="The status of the order.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "draft", "active", "on-hold", "revoked", "completed", "entered-in-error", "unknown", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType = Field( default=..., alias="subject", title="Individual or Entity the service is ordered for", description=( "On whom or what the service is to be performed. This is usually a " "human patient, but can also be requested on animals, groups of humans " "or animals, devices such as dialysis machines, or even locations " "(typically for environmental scans)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient", "Group", "Location", "Device"], }, ) supportingInfo: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="supportingInfo", title="Additional clinical information", description=( "Additional clinical information about the patient or specimen that may" " influence the services or their interpretations. This information" " includes diagnosis, clinical findings and other observations. In " 'laboratory ordering these are typically referred to as "ask at order ' 'entry questions (AOEs)". This includes observations explicitly ' "requested by the producer (filler) to provide context or supporting " "information needed to complete the order. For example, reporting the " "amount of inspired oxygen for blood gas measurements." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ServiceRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "replaces", "requisition", "status", "intent", "category", "priority", "doNotPerform", "code", "orderDetail", "quantityQuantity", "quantityRatio", "quantityRange", "subject", "focus", "encounter", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "asNeededBoolean", "asNeededCodeableConcept", "authoredOn", "requester", "performerType", "performer", "location", "reason", "insurance", "supportingInfo", "specimen", "bodySite", "bodyStructure", "note", "patientInstruction", "relevantHistory", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ServiceRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "replaces", "requisition", "status", "intent", "category", "priority", "doNotPerform", "code", "orderDetail", "quantityQuantity", "quantityRatio", "quantityRange", "subject", "focus", "encounter", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "asNeededBoolean", "asNeededCodeableConcept", "authoredOn", "requester", "performerType", "performer", "location", "reason", "specimen", "bodySite", "bodyStructure", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("intent", "intent__ext"), ("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "asNeeded": ["asNeededBoolean", "asNeededCodeableConcept"], "occurrence": [ "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", ], "quantity": ["quantityQuantity", "quantityRange", "quantityRatio"], } return one_of_many_fields class ServiceRequestOrderDetail(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional order information. Additional details and instructions about the how the services are to be delivered. For example, and order for a urinary catheter may have an order detail for an external or indwelling catheter, or an order for a bandage may require additional instructions specifying how the bandage should be applied. """ __resource_type__ = "ServiceRequestOrderDetail" parameter: typing.List[fhirtypes.ServiceRequestOrderDetailParameterType] = Field( default=..., alias="parameter", title="The parameter details for the service being requested", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) parameterFocus: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="parameterFocus", title="The context of the order details by reference", description="Indicates the context of the order details by reference.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "DeviceDefinition", "DeviceRequest", "SupplyRequest", "Medication", "MedicationRequest", "BiologicallyDerivedProduct", "Substance", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ServiceRequestOrderDetail`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "parameterFocus", "parameter"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ServiceRequestOrderDetail`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "parameter"] class ServiceRequestOrderDetailParameter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The parameter details for the service being requested. """ __resource_type__ = "ServiceRequestOrderDetailParameter" code: fhirtypes.CodeableConceptType = Field( default=..., alias="code", title="The detail of the order being requested", description=( "A value representing the additional detail or instructions for the " "order (e.g., catheter insertion, body elevation, descriptive device " "configuration and/or setting instructions)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="The value for the order detail", description="Indicates a value for the order detail.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="The value for the order detail", description="Indicates a value for the order detail.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="The value for the order detail", description="Indicates a value for the order detail.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="The value for the order detail", description="Indicates a value for the order detail.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="The value for the order detail", description="Indicates a value for the order detail.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="The value for the order detail", description="Indicates a value for the order detail.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="The value for the order detail", description="Indicates a value for the order detail.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ServiceRequestOrderDetailParameter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "valueQuantity", "valueRatio", "valueRange", "valueBoolean", "valueCodeableConcept", "valueString", "valuePeriod", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ServiceRequestOrderDetailParameter`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "code", "valueQuantity", "valueRatio", "valueRange", "valueBoolean", "valueCodeableConcept", "valueString", "valuePeriod", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueCodeableConcept", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueString", ] } return one_of_many_fields class ServiceRequestPatientInstruction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Patient or consumer-oriented instructions. Instructions in terms that are understood by the patient or consumer. """ __resource_type__ = "ServiceRequestPatientInstruction" instructionMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="instructionMarkdown", title="Patient or consumer-oriented instructions", description="Instructions in terms that are understood by the patient or consumer.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e instruction[x] "one_of_many": "instruction", "one_of_many_required": False, }, ) instructionMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instructionMarkdown", title="Extension field for ``instructionMarkdown``.", ) instructionReference: fhirtypes.ReferenceType | None = Field( default=None, alias="instructionReference", title="Patient or consumer-oriented instructions", description="Instructions in terms that are understood by the patient or consumer.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e instruction[x] "one_of_many": "instruction", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ServiceRequestPatientInstruction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "instructionMarkdown", "instructionReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ServiceRequestPatientInstruction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "instructionMarkdown", "instructionReference"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "instruction": ["instructionMarkdown", "instructionReference"] } return one_of_many_fields ================================================ FILE: fhir/resources/signature.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Signature Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class Signature(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A Signature - XML DigSig, JWS, Graphical image of signature, etc.. A signature along with supporting context. The signature may be a digital signature that is cryptographic in nature, or some other signature acceptable to the domain. This other signature may be as simple as a graphical image representing a hand-written signature, or a signature ceremony Different signature approaches have different utilities. """ __resource_type__ = "Signature" data: fhirtypes.Base64BinaryType | None = Field( default=None, alias="data", title="The actual signature content (XML DigSig. JWS, picture, etc.)", description=( "The base64 encoding of the Signature content. When signature is not " "recorded electronically this element would be empty." ), json_schema_extra={ "element_property": True, }, ) data__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_data", title="Extension field for ``data``." ) onBehalfOf: fhirtypes.ReferenceType | None = Field( default=None, alias="onBehalfOf", title="The party represented", description=( "A reference to an application-usable description of the identity that " "is represented by the signature." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "RelatedPerson", "Patient", "Device", "Organization", ], }, ) sigFormat: fhirtypes.CodeType | None = Field( default=None, alias="sigFormat", title="The technical format of the signature", description=( "A mime type that indicates the technical format of the signature. " "Important mime types are application/signature+xml for X ML DigSig, " "application/jose for JWS, and image/* for a graphical image of a " "signature, etc." ), json_schema_extra={ "element_property": True, }, ) sigFormat__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sigFormat", title="Extension field for ``sigFormat``." ) targetFormat: fhirtypes.CodeType | None = Field( default=None, alias="targetFormat", title="The technical format of the signed resources", description=( "A mime type that indicates the technical format of the target " "resources signed by the signature." ), json_schema_extra={ "element_property": True, }, ) targetFormat__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_targetFormat", title="Extension field for ``targetFormat``.", ) type: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="type", title="Indication of the reason the entity signed the object(s)", description=( "An indication of the reason that the entity signed this document. This" " may be explicitly included as part of the signature information and " "can be used when determining accountability for various actions " "concerning the document." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) when: fhirtypes.InstantType | None = Field( default=None, alias="when", title="When the signature was created", description="When the digital signature was signed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) when__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_when", title="Extension field for ``when``." ) who: fhirtypes.ReferenceType | None = Field( default=None, alias="who", title="Who signed", description=( "A reference to an application-usable description of the identity that " "signed (e.g. the signature used their private key)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "RelatedPerson", "Patient", "Device", "Organization", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Signature`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "type", "when", "who", "onBehalfOf", "targetFormat", "sigFormat", "data", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Signature`` according to specification, with preserving the original sequence order. """ return ["type", "when", "who", "onBehalfOf"] ================================================ FILE: fhir/resources/slot.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Slot Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import domainresource, fhirtypes class Slot(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A slot of time on a schedule that may be available for booking appointments. """ __resource_type__ = "Slot" appointmentType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="appointmentType", title=( "The style of appointment or patient that may be booked in the slot " "(not service type)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title=( "Comments on the slot to describe any extended information. Such as " "custom constraints on the slot" ), description=None, json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) end: fhirtypes.InstantType | None = Field( default=None, alias="end", title="Date/Time that the slot is to conclude", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_end", title="Extension field for ``end``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Ids for this item", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) overbooked: bool | None = Field( default=None, alias="overbooked", title=( "This slot has already been overbooked, appointments are unlikely to be" " accepted for this time" ), description=None, json_schema_extra={ "element_property": True, }, ) overbooked__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_overbooked", title="Extension field for ``overbooked``." ) schedule: fhirtypes.ReferenceType = Field( default=..., alias="schedule", title=( "The schedule resource that this slot defines an interval of status " "information" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Schedule"], }, ) serviceCategory: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="serviceCategory", title=( "A broad categorization of the service that is to be performed during " "this appointment" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) serviceType: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="serviceType", title=( "The type of appointments that can be booked into this slot (ideally " "this would be an identifiable service - which is at a location, rather" " than the location itself). If provided then this overrides the value " "provided on the Schedule resource" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["HealthcareService"], }, ) specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="specialty", title=( "The specialty of a practitioner that would be required to perform the " "service requested in this appointment" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) start: fhirtypes.InstantType | None = Field( default=None, alias="start", title="Date/Time that the slot is to begin", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_start", title="Extension field for ``start``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="busy | free | busy-unavailable | busy-tentative | entered-in-error", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "busy", "free", "busy-unavailable", "busy-tentative", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Slot`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "serviceCategory", "serviceType", "specialty", "appointmentType", "schedule", "status", "start", "end", "overbooked", "comment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Slot`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "serviceCategory", "serviceType", "specialty", "appointmentType", "schedule", "status", "start", "end", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("end", "end__ext"), ("start", "start__ext"), ("status", "status__ext"), ] return required_fields ================================================ FILE: fhir/resources/specimen.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Specimen Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Specimen(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Sample for analysis. A sample to be used for analysis. """ __resource_type__ = "Specimen" accessionIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="accessionIdentifier", title="Identifier assigned by the lab", description=( "The identifier assigned by the lab when accessioning specimen(s). This" " is not necessarily the same as the specimen identifier, depending on " "local lab procedures." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) collection: fhirtypes.SpecimenCollectionType | None = Field( default=None, alias="collection", title="Collection details", description="Details concerning the specimen collection.", json_schema_extra={ "element_property": True, }, ) combined: fhirtypes.CodeType | None = Field( default=None, alias="combined", title="grouped | pooled", description="This element signifies if the specimen is part of a group or pooled.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["grouped", "pooled"], }, ) combined__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_combined", title="Extension field for ``combined``." ) condition: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="condition", title="State of the specimen", description="A mode or state of being that describes the nature of the specimen.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) container: typing.List[fhirtypes.SpecimenContainerType] | None = Field( default=None, alias="container", title="Direct container of specimen (tube/slide, etc.)", description=( "The container holding the specimen. The recursive nature of " "containers; i.e. blood in tube in tray in rack is not addressed here." ), json_schema_extra={ "element_property": True, }, ) feature: typing.List[fhirtypes.SpecimenFeatureType] | None = Field( default=None, alias="feature", title="The physical feature of a specimen", description=( "A physical feature or landmark on a specimen, highlighted for context " "by the collector of the specimen (e.g. surgeon), that identifies the " "type of feature as well as its meaning (e.g. the red ink indicating " "the resection margin of the right lobe of the excised prostate tissue " "or wire loop at radiologically suspected tumor location)." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External Identifier", description="Id for specimen.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments", description=( "To communicate any details or issues about the specimen or during the " "specimen collection. (for example: broken vial, sent with patient, " "frozen)." ), json_schema_extra={ "element_property": True, }, ) parent: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="parent", title="Specimen from which this specimen originated", description=( "Reference to the parent (source) specimen which is used when the " "specimen was either derived from or a component of another specimen." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Specimen"], }, ) processing: typing.List[fhirtypes.SpecimenProcessingType] | None = Field( default=None, alias="processing", title="Processing and processing step details", description="Details concerning processing and processing steps for the specimen.", json_schema_extra={ "element_property": True, }, ) receivedTime: fhirtypes.DateTimeType | None = Field( default=None, alias="receivedTime", title="The time when specimen is received by the testing laboratory", description=( "Time when specimen is received by the testing laboratory for " "processing or testing." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) receivedTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_receivedTime", title="Extension field for ``receivedTime``.", ) request: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="request", title="Why the specimen was collected", description=( "Details concerning a service request that required a specimen to be " "collected." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ServiceRequest"], }, ) role: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="role", title="The role the specimen serves", description="The role or reason for the specimen in the testing workflow.", json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="available | unavailable | unsatisfactory | entered-in-error", description="The availability of the specimen.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "available", "unavailable", "unsatisfactory", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subject: fhirtypes.ReferenceType | None = Field( default=None, alias="subject", title=( "Where the specimen came from. This may be from patient(s), from a " "location (e.g., the source of an environmental sample), or a sampling " "of a substance, a biologically-derived product, or a device" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Group", "Device", "BiologicallyDerivedProduct", "Substance", "Location", ], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Kind of material that forms the specimen", description="The kind of material that forms the specimen.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Specimen`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "accessionIdentifier", "status", "type", "subject", "receivedTime", "parent", "request", "combined", "role", "feature", "collection", "processing", "container", "condition", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Specimen`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "accessionIdentifier", "status", "type", "subject", "receivedTime", "combined", "condition", ] class SpecimenCollection(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Collection details. Details concerning the specimen collection. """ __resource_type__ = "SpecimenCollection" bodySite: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="bodySite", title="Anatomical collection site", description=( "Anatomical location from which the specimen was collected (if subject " "is a patient). This is the target site. This element is not used for " "environmental specimens." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["BodyStructure"], }, ) collectedDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="collectedDateTime", title="Collection time", description=( "Time when specimen was collected from subject - the physiologically " "relevant time." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e collected[x] "one_of_many": "collected", "one_of_many_required": False, }, ) collectedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_collectedDateTime", title="Extension field for ``collectedDateTime``.", ) collectedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="collectedPeriod", title="Collection time", description=( "Time when specimen was collected from subject - the physiologically " "relevant time." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e collected[x] "one_of_many": "collected", "one_of_many_required": False, }, ) collector: fhirtypes.ReferenceType | None = Field( default=None, alias="collector", title="Who collected the specimen", description="Person who collected the specimen.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Patient", "RelatedPerson", ], }, ) device: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="device", title="Device used to perform collection", description=( "A coded value specifying the technique that is used to perform the " "procedure." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) duration: fhirtypes.DurationType | None = Field( default=None, alias="duration", title="How long it took to collect specimen", description="The span of time over which the collection of a specimen occurred.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) fastingStatusCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="fastingStatusCodeableConcept", title="Whether or how long patient abstained from food and/or drink", description=( "Abstinence or reduction from some or all food, drink, or both, for a " "period of time prior to sample collection." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fastingStatus[x] "one_of_many": "fastingStatus", "one_of_many_required": False, }, ) fastingStatusDuration: fhirtypes.DurationType | None = Field( default=None, alias="fastingStatusDuration", title="Whether or how long patient abstained from food and/or drink", description=( "Abstinence or reduction from some or all food, drink, or both, for a " "period of time prior to sample collection." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e fastingStatus[x] "one_of_many": "fastingStatus", "one_of_many_required": False, }, ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="Technique used to perform collection", description=( "A coded value specifying the technique that is used to perform the " "procedure." ), json_schema_extra={ "element_property": True, }, ) procedure: fhirtypes.ReferenceType | None = Field( default=None, alias="procedure", title="The procedure that collects the specimen", description=( "The procedure event during which the specimen was collected (e.g. the " "surgery leading to the collection of a pathology sample)." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Procedure"], }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="The quantity of specimen collected", description=( "The quantity of specimen collected; for instance the volume of a blood" " sample, or the physical measurement of an anatomic pathology sample." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SpecimenCollection`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "collector", "collectedDateTime", "collectedPeriod", "duration", "quantity", "method", "device", "procedure", "bodySite", "fastingStatusCodeableConcept", "fastingStatusDuration", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SpecimenCollection`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "collector", "collectedDateTime", "collectedPeriod", "duration", "fastingStatusCodeableConcept", "fastingStatusDuration", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "collected": ["collectedDateTime", "collectedPeriod"], "fastingStatus": ["fastingStatusCodeableConcept", "fastingStatusDuration"], } return one_of_many_fields class SpecimenContainer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Direct container of specimen (tube/slide, etc.). The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here. """ __resource_type__ = "SpecimenContainer" device: fhirtypes.ReferenceType = Field( default=..., alias="device", title="Device resource for the container", description=( "The device resource for the the container holding the specimen. If the" " container is in a holder then the referenced device will point to a " "parent device." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Device"], }, ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where the container is", description="The location of the container holding the specimen.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) specimenQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="specimenQuantity", title="Quantity of specimen within container", description=( "The quantity of specimen in the container; may be volume, dimensions, " "or other appropriate measurements, depending on the specimen type." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SpecimenContainer`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "device", "location", "specimenQuantity", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SpecimenContainer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class SpecimenFeature(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The physical feature of a specimen. A physical feature or landmark on a specimen, highlighted for context by the collector of the specimen (e.g. surgeon), that identifies the type of feature as well as its meaning (e.g. the red ink indicating the resection margin of the right lobe of the excised prostate tissue or wire loop at radiologically suspected tumor location). """ __resource_type__ = "SpecimenFeature" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Information about the feature", description="Description of the feature of the specimen.", json_schema_extra={ "element_property": True, "element_required": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Highlighted feature", description="The landmark or feature being highlighted.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SpecimenFeature`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "description"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SpecimenFeature`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("description", "description__ext")] return required_fields class SpecimenProcessing(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Processing and processing step details. Details concerning processing and processing steps for the specimen. """ __resource_type__ = "SpecimenProcessing" additive: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="additive", title="Material used in the processing step", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Substance"], }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Textual description of procedure", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="Indicates the treatment step applied to the specimen", description="A coded value specifying the method used to process the specimen.", json_schema_extra={ "element_property": True, }, ) timeDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="timeDateTime", title="Date and time of specimen processing", description=( "A record of the time or period when the specimen processing occurred." " For example the time of sample fixation or the period of time the " "sample was in formalin." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e time[x] "one_of_many": "time", "one_of_many_required": False, }, ) timeDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timeDateTime", title="Extension field for ``timeDateTime``.", ) timePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="timePeriod", title="Date and time of specimen processing", description=( "A record of the time or period when the specimen processing occurred." " For example the time of sample fixation or the period of time the " "sample was in formalin." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e time[x] "one_of_many": "time", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SpecimenProcessing`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "method", "additive", "timeDateTime", "timePeriod", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SpecimenProcessing`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"time": ["timeDateTime", "timePeriod"]} return one_of_many_fields ================================================ FILE: fhir/resources/specimendefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SpecimenDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class SpecimenDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Kind of specimen. A kind of specimen with associated set of requirements. """ __resource_type__ = "SpecimenDefinition" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When SpecimenDefinition was approved by publisher", description=( "The date on which the asset content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) collection: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="collection", title="Specimen collection procedure", description="The action to be performed for collecting the specimen.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "Copyright statement relating to the SpecimenDefinition and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the SpecimenDefinition." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date status first applied", description=( "For draft definitions, indicates the date of initial creation. For " "active definitions, represents the date of activation. For withdrawn " "definitions, indicates the date of withdrawal." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) derivedFromCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="derivedFromCanonical", title="Based on FHIR definition of another SpecimenDefinition", description=( "The canonical URL pointing to another FHIR-defined SpecimenDefinition " "that is adhered to in whole or in part by this definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SpecimenDefinition"], }, ) derivedFromCanonical__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_derivedFromCanonical", title="Extension field for ``derivedFromCanonical``.", ) derivedFromUri: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="derivedFromUri", title="Based on external definition", description=( "The URL pointing to an externally-defined type of specimen, guideline " "or other definition that is adhered to in whole or in part by this " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) derivedFromUri__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_derivedFromUri", title="Extension field for ``derivedFromUri``.", ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the SpecimenDefinition", description=( "A free text natural language description of the SpecimenDefinition " "from the consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="The effective date range for the SpecimenDefinition", description=( "The period during which the SpecimenDefinition content was or is " "planned to be effective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="If this SpecimenDefinition is not for real usage", description=( "A flag to indicate that this SpecimenDefinition is not authored for " "genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Business identifier", description="A business identifier assigned to this SpecimenDefinition.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for this SpecimenDefinition (if applicable)", description="A jurisdiction in which the SpecimenDefinition is intended to be used.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="The date on which the asset content was last reviewed by the publisher", description=( "The date on which the asset content was last reviewed. Review happens " "periodically after that, but doesn't change the original approval " "date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this {{title}} (computer friendly)", description=( "A natural language name identifying the {{title}}. This name should be" " usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) patientPreparation: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="patientPreparation", title="Patient preparation for collection", description="Preparation of the patient for specimen collection.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title=( "The name of the individual or organization that published the " "SpecimenDefinition" ), description=( 'Helps establish the "authority/credibility" of the SpecimenDefinition.' " May also allow for contact." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this SpecimenDefinition is defined", description=( "Explains why this SpecimeDefinition is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description="The current state of theSpecimenDefinition.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="subjectCodeableConcept", title="Type of subject for specimen collection", description=( "A code or group definition that describes the intended subject from " "which this kind of specimen is to be collected." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, }, ) subjectReference: fhirtypes.ReferenceType | None = Field( default=None, alias="subjectReference", title="Type of subject for specimen collection", description=( "A code or group definition that describes the intended subject from " "which this kind of specimen is to be collected." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e subject[x] "one_of_many": "subject", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Group"], }, ) timeAspect: fhirtypes.StringType | None = Field( default=None, alias="timeAspect", title="Time aspect for collection", description="Time aspect of specimen collection (duration or offset).", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) timeAspect__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timeAspect", title="Extension field for ``timeAspect``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this SpecimenDefinition (Human friendly)", description="A short, descriptive, user-friendly title for the SpecimenDefinition.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) typeCollected: fhirtypes.CodeableConceptType | None = Field( default=None, alias="typeCollected", title="Kind of material to collect", description="The kind of material to be collected.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) typeTested: typing.List[fhirtypes.SpecimenDefinitionTypeTestedType] | None = Field( default=None, alias="typeTested", title="Specimen in container intended for testing by lab", description=( "Specimen conditioned in a container as expected by the testing " "laboratory." ), json_schema_extra={ "element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Logical canonical URL to reference this SpecimenDefinition (globally " "unique)" ), description=( "An absolute URL that is used to identify this SpecimenDefinition when " "it is referenced in a specification, model, design or an instance. " "This SHALL be a URL, SHOULD be globally unique, and SHOULD be an " "address at which this SpecimenDefinition is (or will be) published. " "The URL SHOULD include the major version of the SpecimenDefinition. " "For more information see Technical and Business Versions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Content intends to support these contexts", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching of specimen definitions." ), json_schema_extra={ "element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the SpecimenDefinition", description=( "The identifier that is used to identify this version of the " "SpecimenDefinition when it is referenced in a specification, model, " "design or instance. This is an arbitrary value managed by the " "SpecimenDefinition author and is not expected to be globally unique." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SpecimenDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "derivedFromCanonical", "derivedFromUri", "status", "experimental", "subjectCodeableConcept", "subjectReference", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "copyrightLabel", "approvalDate", "lastReviewDate", "effectivePeriod", "typeCollected", "patientPreparation", "timeAspect", "collection", "typeTested", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SpecimenDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "derivedFromCanonical", "derivedFromUri", "status", "experimental", "subjectCodeableConcept", "subjectReference", "date", "publisher", "contact", "jurisdiction", "effectivePeriod", "typeCollected", "patientPreparation", "timeAspect", "collection", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "subject": ["subjectCodeableConcept", "subjectReference"], "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"], } return one_of_many_fields class SpecimenDefinitionTypeTested(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specimen in container intended for testing by lab. Specimen conditioned in a container as expected by the testing laboratory. """ __resource_type__ = "SpecimenDefinitionTypeTested" container: fhirtypes.SpecimenDefinitionTypeTestedContainerType | None = Field( default=None, alias="container", title="The specimen's container", description=None, json_schema_extra={ "element_property": True, }, ) handling: typing.List[ fhirtypes.SpecimenDefinitionTypeTestedHandlingType ] | None = Field( default=None, alias="handling", title="Specimen handling before testing", description=( "Set of instructions for preservation/transport of the specimen at a " "defined temperature interval, prior the testing process." ), json_schema_extra={ "element_property": True, }, ) isDerived: bool | None = Field( default=None, alias="isDerived", title="Primary or secondary specimen", description="Primary of secondary specimen.", json_schema_extra={ "element_property": True, }, ) isDerived__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isDerived", title="Extension field for ``isDerived``." ) preference: fhirtypes.CodeType | None = Field( default=None, alias="preference", title="preferred | alternate", description="The preference for this type of conditioned specimen.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["preferred", "alternate"], }, ) preference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preference", title="Extension field for ``preference``." ) rejectionCriterion: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="rejectionCriterion", title="Criterion specified for specimen rejection", description=( "Criterion for rejection of the specimen in its container by the " "laboratory." ), json_schema_extra={ "element_property": True, }, ) requirement: fhirtypes.MarkdownType | None = Field( default=None, alias="requirement", title="Requirements for specimen delivery and special handling", description=( "Requirements for delivery and special handling of this kind of " "conditioned specimen." ), json_schema_extra={ "element_property": True, }, ) requirement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requirement", title="Extension field for ``requirement``." ) retentionTime: fhirtypes.DurationType | None = Field( default=None, alias="retentionTime", title="The usual time for retaining this kind of specimen", description=( "The usual time that a specimen of this kind is retained after the " "ordered tests are completed, for the purpose of additional testing." ), json_schema_extra={ "element_property": True, }, ) singleUse: bool | None = Field( default=None, alias="singleUse", title="Specimen for single use only", description='Specimen can be used by only one test or panel if the value is "true".', json_schema_extra={ "element_property": True, }, ) singleUse__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_singleUse", title="Extension field for ``singleUse``." ) testingDestination: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="testingDestination", title="Where the specimen will be tested", description=( "Where the specimen will be tested: e.g., lab, sector, device or any " "combination of these." ), json_schema_extra={ "element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Type of intended specimen", description="The kind of specimen conditioned for testing expected by lab.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SpecimenDefinitionTypeTested`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "isDerived", "type", "preference", "container", "requirement", "retentionTime", "singleUse", "rejectionCriterion", "handling", "testingDestination", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SpecimenDefinitionTypeTested`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("preference", "preference__ext")] return required_fields class SpecimenDefinitionTypeTestedContainer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The specimen's container. """ __resource_type__ = "SpecimenDefinitionTypeTestedContainer" additive: typing.List[ fhirtypes.SpecimenDefinitionTypeTestedContainerAdditiveType ] | None = Field( default=None, alias="additive", title="Additive associated with container", description=( "Substance introduced in the kind of container to preserve, maintain or" " enhance the specimen. Examples: Formalin, Citrate, EDTA." ), json_schema_extra={ "element_property": True, }, ) cap: fhirtypes.CodeableConceptType | None = Field( default=None, alias="cap", title="Color of container cap", description=None, json_schema_extra={ "element_property": True, }, ) capacity: fhirtypes.QuantityType | None = Field( default=None, alias="capacity", title="The capacity of this kind of container", description="The capacity (volume or other measure) of this kind of container.", json_schema_extra={ "element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="The description of the kind of container", description="The textual description of the kind of container.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) material: fhirtypes.CodeableConceptType | None = Field( default=None, alias="material", title="The material type used for the container", description="The type of material of the container.", json_schema_extra={ "element_property": True, }, ) minimumVolumeQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="minimumVolumeQuantity", title="Minimum volume", description="The minimum volume to be conditioned in the container.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e minimumVolume[x] "one_of_many": "minimumVolume", "one_of_many_required": False, }, ) minimumVolumeString: fhirtypes.StringType | None = Field( default=None, alias="minimumVolumeString", title="Minimum volume", description="The minimum volume to be conditioned in the container.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e minimumVolume[x] "one_of_many": "minimumVolume", "one_of_many_required": False, }, ) minimumVolumeString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minimumVolumeString", title="Extension field for ``minimumVolumeString``.", ) preparation: fhirtypes.MarkdownType | None = Field( default=None, alias="preparation", title="Special processing applied to the container for this specimen type", description=( "Special processing that should be applied to the container for this " "kind of specimen." ), json_schema_extra={ "element_property": True, }, ) preparation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preparation", title="Extension field for ``preparation``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Kind of container associated with the kind of specimen", description="The type of container used to contain this kind of specimen.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SpecimenDefinitionTypeTestedContainer`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "material", "type", "cap", "description", "capacity", "minimumVolumeQuantity", "minimumVolumeString", "additive", "preparation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SpecimenDefinitionTypeTestedContainer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "minimumVolume": ["minimumVolumeQuantity", "minimumVolumeString"] } return one_of_many_fields class SpecimenDefinitionTypeTestedContainerAdditive(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additive associated with container. Substance introduced in the kind of container to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA. """ __resource_type__ = "SpecimenDefinitionTypeTestedContainerAdditive" additiveCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="additiveCodeableConcept", title="Additive associated with container", description=( "Substance introduced in the kind of container to preserve, maintain or" " enhance the specimen. Examples: Formalin, Citrate, EDTA." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e additive[x] "one_of_many": "additive", "one_of_many_required": True, }, ) additiveReference: fhirtypes.ReferenceType | None = Field( default=None, alias="additiveReference", title="Additive associated with container", description=( "Substance introduced in the kind of container to preserve, maintain or" " enhance the specimen. Examples: Formalin, Citrate, EDTA." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e additive[x] "one_of_many": "additive", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SubstanceDefinition"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SpecimenDefinitionTypeTestedContainerAdditive`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "additiveCodeableConcept", "additiveReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SpecimenDefinitionTypeTestedContainerAdditive`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "additive": ["additiveCodeableConcept", "additiveReference"] } return one_of_many_fields class SpecimenDefinitionTypeTestedHandling(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specimen handling before testing. Set of instructions for preservation/transport of the specimen at a defined temperature interval, prior the testing process. """ __resource_type__ = "SpecimenDefinitionTypeTestedHandling" instruction: fhirtypes.MarkdownType | None = Field( default=None, alias="instruction", title="Preservation instruction", description=( "Additional textual instructions for the preservation or transport of " "the specimen. For instance, 'Protect from light exposure'." ), json_schema_extra={ "element_property": True, }, ) instruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instruction", title="Extension field for ``instruction``." ) maxDuration: fhirtypes.DurationType | None = Field( default=None, alias="maxDuration", title="Maximum preservation time", description=( "The maximum time interval of preservation of the specimen with these " "conditions." ), json_schema_extra={ "element_property": True, }, ) temperatureQualifier: fhirtypes.CodeableConceptType | None = Field( default=None, alias="temperatureQualifier", title="Qualifies the interval of temperature", description=( "It qualifies the interval of temperature, which characterizes an " "occurrence of handling. Conditions that are not related to temperature" " may be handled in the instruction element." ), json_schema_extra={ "element_property": True, }, ) temperatureRange: fhirtypes.RangeType | None = Field( default=None, alias="temperatureRange", title="Temperature range for these handling instructions", description="The temperature interval for this set of handling instructions.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SpecimenDefinitionTypeTestedHandling`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "temperatureQualifier", "temperatureRange", "maxDuration", "instruction", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SpecimenDefinitionTypeTestedHandling`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/structuredefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/StructureDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class StructureDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Structural Definition. A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types. """ __resource_type__ = "StructureDefinition" abstract: bool | None = Field( default=None, alias="abstract", title="Whether the structure is abstract", description=( "Whether structure this definition describes is abstract or not - that" " is, whether the structure is not intended to be instantiated. For " "Resources and Data types, abstract types will never be exchanged " "between systems." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) abstract__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_abstract", title="Extension field for ``abstract``." ) baseDefinition: fhirtypes.CanonicalType | None = Field( default=None, alias="baseDefinition", title="Definition that this type is constrained/specialized from", description=( "An absolute URI that is the base structure from which this type is " "derived, either by specialization or constraint." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) baseDefinition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_baseDefinition", title="Extension field for ``baseDefinition``.", ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) context: typing.List[fhirtypes.StructureDefinitionContextType] | None = Field( default=None, alias="context", title="If an extension, where it can be used in instances", description=( "Identifies the types of resource or data type elements to which the " "extension can be applied. For more guidance on using the 'context' " "element, see the [defining extensions page](defining-" "extensions.html#context)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contextInvariant: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="contextInvariant", title="FHIRPath invariants - when the extension can be used", description=( "A set of rules as FHIRPath Invariants about when the extension can be " "used (e.g. co-occurrence variants for the extension). All the rules " "must be true." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contextInvariant__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_contextInvariant", title="Extension field for ``contextInvariant``.", ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the structure definition and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the structure definition. The short copyright " "declaration (e.g. (c) '2015+ xyz organization' should be sent in the " "copyrightLabel element." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the structure definition was last" " significantly changed. The date must change when the business version" " changes and it must change if the status code changes. In addition, " "it should change when the substantive content of the structure " "definition changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) derivation: fhirtypes.CodeType | None = Field( default=None, alias="derivation", title="specialization | constraint - How relates to base definition", description="How the type relates to the baseDefinition.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["specialization", "constraint"], }, ) derivation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_derivation", title="Extension field for ``derivation``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the structure definition", description=( "A free text natural language description of the structure definition " "from a consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) differential: fhirtypes.StructureDefinitionDifferentialType | None = Field( default=None, alias="differential", title="Differential view of the structure", description=( "A differential view is expressed relative to the base " "StructureDefinition - a statement of differences that it applies." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this structure definition is authored" " for testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) fhirVersion: fhirtypes.CodeType | None = Field( default=None, alias="fhirVersion", title="FHIR Version this StructureDefinition targets", description=( "The version of the FHIR specification on which this " "StructureDefinition is based - this is the formal version of the " "specification, without the revision number, e.g. " "[publication].[major].[minor], which is 4.6.0. for this version." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) fhirVersion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fhirVersion", title="Extension field for ``fhirVersion``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the structure definition", description=( "A formal identifier that is used to identify this structure definition" " when it is represented in other formats, or referenced in a " "specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for structure definition (if applicable)", description=( "A legal or geographic region in which the structure definition is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) keyword: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="keyword", title="Assist with indexing and finding", description=( "(DEPRECATED) A set of key words or terms from external terminologies " "that may be used to assist with indexing and searching of templates " "nby describing the use of this structure definition, or the content it" " describes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title="primitive-type | complex-type | resource | logical", description="Defines the kind of structure that this definition is describing.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["primitive-type", "complex-type", "resource", "logical"], }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) mapping: typing.List[fhirtypes.StructureDefinitionMappingType] | None = Field( default=None, alias="mapping", title="External specification that the content is mapped to", description="An external specification that the content is mapped to.", json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this structure definition (computer friendly)", description=( "A natural language name identifying the structure definition. This " "name should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the structure definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this structure definition is defined", description=( "Explanation of why this structure definition is needed and why it has " "been designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) snapshot: fhirtypes.StructureDefinitionSnapshotType | None = Field( default=None, alias="snapshot", title="Snapshot view of the structure", description=( "A snapshot view is expressed in a standalone form that can be used and" " interpreted without considering the base StructureDefinition." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this structure definition. Enables tracking the life-" "cycle of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this structure definition (human friendly)", description=( "A short, descriptive, user-friendly title for the structure " "definition." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) type: fhirtypes.UriType | None = Field( default=None, alias="type", title="Type defined or constrained by this structure", description=( "The type this structure describes. If the derivation kind is " "'specialization' then this is the master definition for a type, and " "there is always one of these (a data type, an extension, a resource, " "including abstract ones). Otherwise the structure definition is a " "constraint on the stated type (and in this case, the type cannot be an" " abstract type). References are URLs that are relative to " 'http://hl7.org/fhir/StructureDefinition e.g. "string" is a reference ' "to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are " "only allowed in logical models, where they are required." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this structure definition, represented as a " "URI (globally unique)" ), description=( "An absolute URI that is used to identify this structure definition " "when it is referenced in a specification, model, design or an " "instance; also called its canonical identifier. This SHOULD be " "globally unique and SHOULD be a literal address at which an " "authoritative instance of this structure definition is (or will be) " "published. This URL can be the target of a canonical reference. It " "SHALL remain the same when the structure definition is stored on " "different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate structure definition instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the structure definition", description=( "The identifier that is used to identify this version of the structure " "definition when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the structure " "definition author and is not expected to be globally unique. There is " "no expectation that versions can be placed in a lexicographical " "sequence, so authors are encouraged to populate the " "StructureDefinition.versionAlgorithm[x] element to enable comparisons." " If there is no managed version available, authors can consider using " "ISO date/time syntax (e.g., '2023-01-01')." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "copyrightLabel", "keyword", "fhirVersion", "mapping", "kind", "abstract", "context", "contextInvariant", "type", "baseDefinition", "derivation", "snapshot", "differential", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "keyword", "fhirVersion", "kind", "abstract", "context", "contextInvariant", "type", "baseDefinition", "derivation", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("abstract", "abstract__ext"), ("kind", "kind__ext"), ("name", "name__ext"), ("status", "status__ext"), ("type", "type__ext"), ("url", "url__ext"), ] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields class StructureDefinitionContext(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. If an extension, where it can be used in instances. Identifies the types of resource or data type elements to which the extension can be applied. For more guidance on using the 'context' element, see the [defining extensions page](defining-extensions.html#context). """ __resource_type__ = "StructureDefinitionContext" expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="Where the extension can be used in instances", description=( "An expression that defines where an extension can be used in " "resources." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="fhirpath | element | extension", description=( "Defines how to interpret the expression that defines what the context " "of the extension is." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["fhirpath", "element", "extension"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureDefinitionContext`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "expression"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureDefinitionContext`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "expression"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("expression", "expression__ext"), ("type", "type__ext")] return required_fields class StructureDefinitionDifferential(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Differential view of the structure. A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies. """ __resource_type__ = "StructureDefinitionDifferential" element: typing.List[fhirtypes.ElementDefinitionType] = Field( default=..., alias="element", title="Definition of elements in the resource (if no StructureDefinition)", description="Captures constraints on each element within the resource.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureDefinitionDifferential`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "element"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureDefinitionDifferential`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class StructureDefinitionMapping(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. External specification that the content is mapped to. An external specification that the content is mapped to. """ __resource_type__ = "StructureDefinitionMapping" comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Versions, Issues, Scope limitations etc", description=( "Comments about this mapping, including version notes, issues, scope " "limitations, and other important notes for usage." ), json_schema_extra={ "element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) identity: fhirtypes.IdType | None = Field( default=None, alias="identity", title="Internal id when this mapping is used", description=( "An Internal id that is used to identify this mapping set when specific" " mappings are made." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) identity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_identity", title="Extension field for ``identity``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Names what this mapping refers to", description="A name for the specification that is being mapped to.", json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) uri: fhirtypes.UriType | None = Field( default=None, alias="uri", title="Identifies what this mapping refers to", description=( "An absolute URI that identifies the specification that this mapping is" " expressed to." ), json_schema_extra={ "element_property": True, }, ) uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uri", title="Extension field for ``uri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureDefinitionMapping`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identity", "uri", "name", "comment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureDefinitionMapping`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("identity", "identity__ext")] return required_fields class StructureDefinitionSnapshot(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Snapshot view of the structure. A snapshot view is expressed in a standalone form that can be used and interpreted without considering the base StructureDefinition. """ __resource_type__ = "StructureDefinitionSnapshot" element: typing.List[fhirtypes.ElementDefinitionType] = Field( default=..., alias="element", title="Definition of elements in the resource (if no StructureDefinition)", description="Captures constraints on each element within the resource.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureDefinitionSnapshot`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "element"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureDefinitionSnapshot`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/structuremap.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/StructureMap Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class StructureMap(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A Map of relationships between 2 structures that can be used to transform data. """ __resource_type__ = "StructureMap" const: typing.List[fhirtypes.StructureMapConstType] | None = Field( default=None, alias="const", title="Definition of the constant value used in the map rules", description="Definition of a constant value used in the map rules.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the structure map and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the structure map." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the structure map was last " "significantly changed. The date must change when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the structure map " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the structure map", description=( "A free text natural language description of the structure map from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this structure map is authored for " "testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) group: typing.List[fhirtypes.StructureMapGroupType] = Field( default=..., alias="group", title="Named sections for reader convenience", description=( "Organizes the mapping into managable chunks for human review/ease of " "maintenance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the structure map", description=( "A formal identifier that is used to identify this structure map when " "it is represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) import_fhir: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="import", title="Other maps used by this map (canonical URLs)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureMap"], }, ) import__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_import", title="Extension field for ``import_fhir``." ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for structure map (if applicable)", description=( "A legal or geographic region in which the structure map is intended to" " be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this structure map (computer friendly)", description=( "A natural language name identifying the structure map. This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the structure map." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this structure map is defined", description=( "Explanation of why this structure map is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this structure map. Enables tracking the life-cycle of " "the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) structure: typing.List[fhirtypes.StructureMapStructureType] | None = Field( default=None, alias="structure", title="Structure Definition used by this map", description=( "A structure definition used by this map. The structure definition may " "describe instances that are converted, or the instances that are " "produced." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this structure map (human friendly)", description="A short, descriptive, user-friendly title for the structure map.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this structure map, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this structure map when it is" " referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which an authoritative instance of this" " structure map is (or will be) published. This URL can be the target " "of a canonical reference. It SHALL remain the same when the structure " "map is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate structure map instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the structure map", description=( "The identifier that is used to identify this version of the structure " "map when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the structure map " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions can be placed in" " a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMap`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "copyrightLabel", "structure", "import", "const", "group", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMap`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "structure", "import", "const", "group", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("name", "name__ext"), ("status", "status__ext"), ("url", "url__ext"), ] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields class StructureMapConst(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of the constant value used in the map rules. Definition of a constant value used in the map rules. """ __resource_type__ = "StructureMapConst" name: fhirtypes.IdType | None = Field( default=None, alias="name", title="Constant name", description="Other maps used by this map (canonical URLs).", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="FHIRPath exression - value of the constant", description="A FHIRPath expression that is the value of this variable.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapConst`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapConst`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "name", "value"] class StructureMapGroup(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Named sections for reader convenience. Organizes the mapping into managable chunks for human review/ease of maintenance. """ __resource_type__ = "StructureMapGroup" documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Additional description/explanation for group", description=( "Additional supporting documentation that explains the purpose of the " "group and the types of mappings within it." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) extends: fhirtypes.IdType | None = Field( default=None, alias="extends", title="Another group that this group adds rules to", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) extends__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_extends", title="Extension field for ``extends``." ) input: typing.List[fhirtypes.StructureMapGroupInputType] = Field( default=..., alias="input", title="Named instance provided when invoking the map", description=( "A name assigned to an instance of data. The instance must be provided " "when the mapping is invoked." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.IdType | None = Field( default=None, alias="name", title="Human-readable label", description="A unique name for the group for the convenience of human readers.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) rule: typing.List[fhirtypes.StructureMapGroupRuleType] | None = Field( default=None, alias="rule", title="Transform Rule from source to target", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) typeMode: fhirtypes.CodeType | None = Field( default=None, alias="typeMode", title="types | type-and-types", description=( "If this is the default rule set to apply for the source type or this " "combination of types." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["types", "type-and-types"], }, ) typeMode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_typeMode", title="Extension field for ``typeMode``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapGroup`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "extends", "typeMode", "documentation", "input", "rule", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapGroup`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "name", "extends", "typeMode", "documentation", "input", "rule", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields class StructureMapGroupInput(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Named instance provided when invoking the map. A name assigned to an instance of data. The instance must be provided when the mapping is invoked. """ __resource_type__ = "StructureMapGroupInput" documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Documentation for this instance of data", description=None, json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="source | target", description="Mode for this instance of data.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["source", "target"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) name: fhirtypes.IdType | None = Field( default=None, alias="name", title="Name for this instance of data", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) type: fhirtypes.StringType | None = Field( default=None, alias="type", title="Type for this instance of data", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapGroupInput`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "type", "mode", "documentation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapGroupInput`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "name", "type", "mode"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("mode", "mode__ext"), ("name", "name__ext")] return required_fields class StructureMapGroupRule(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Transform Rule from source to target. """ __resource_type__ = "StructureMapGroupRule" dependent: typing.List[fhirtypes.StructureMapGroupRuleDependentType] | None = Field( default=None, alias="dependent", title="Which other rules to apply in the context of this rule", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Documentation for this instance of data", description=None, json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) name: fhirtypes.IdType | None = Field( default=None, alias="name", title="Name of the rule for internal references", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) rule: typing.List[fhirtypes.StructureMapGroupRuleType] | None = Field( default=None, alias="rule", title="Rules contained in this rule", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) source: typing.List[fhirtypes.StructureMapGroupRuleSourceType] = Field( default=..., alias="source", title="Source inputs to the mapping", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) target: typing.List[fhirtypes.StructureMapGroupRuleTargetType] | None = Field( default=None, alias="target", title="Content to create because of this mapping rule", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapGroupRule`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "source", "target", "rule", "dependent", "documentation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapGroupRule`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "name", "source", "target", "rule", "dependent"] class StructureMapGroupRuleDependent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Which other rules to apply in the context of this rule. """ __resource_type__ = "StructureMapGroupRuleDependent" name: fhirtypes.IdType | None = Field( default=None, alias="name", title="Name of a rule or group to apply", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) parameter: typing.List[fhirtypes.StructureMapGroupRuleTargetParameterType] = Field( default=..., alias="parameter", title="Parameter to pass to the rule or group", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapGroupRuleDependent`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "parameter"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapGroupRuleDependent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "name", "parameter"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields class StructureMapGroupRuleSource(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Source inputs to the mapping. """ __resource_type__ = "StructureMapGroupRuleSource" check: fhirtypes.StringType | None = Field( default=None, alias="check", title=( "FHIRPath expression - must be true or the mapping engine throws an " "error instead of completing" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) check__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_check", title="Extension field for ``check``." ) condition: fhirtypes.StringType | None = Field( default=None, alias="condition", title="FHIRPath expression - must be true or the rule does not apply", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) condition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_condition", title="Extension field for ``condition``." ) context: fhirtypes.IdType | None = Field( default=None, alias="context", title="Type or variable this rule applies to", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) context__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_context", title="Extension field for ``context``." ) defaultValue: fhirtypes.StringType | None = Field( default=None, alias="defaultValue", title="Default value if no value exists", description="A value to use if there is no existing value in the source object.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) defaultValue__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValue", title="Extension field for ``defaultValue``.", ) element: fhirtypes.StringType | None = Field( default=None, alias="element", title="Optional field for this source", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) element__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_element", title="Extension field for ``element``." ) listMode: fhirtypes.CodeType | None = Field( default=None, alias="listMode", title="first | not_first | last | not_last | only_one", description="How to handle the list mode for this element.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["first", "not_first", "last", "not_last", "only_one"], }, ) listMode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_listMode", title="Extension field for ``listMode``." ) logMessage: fhirtypes.StringType | None = Field( default=None, alias="logMessage", title="Message to put in log if source exists (FHIRPath)", description=( "A FHIRPath expression which specifies a message to put in the " "transform log when content matching the source rule is found." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) logMessage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_logMessage", title="Extension field for ``logMessage``." ) max: fhirtypes.StringType | None = Field( default=None, alias="max", title="Specified maximum cardinality (number or *)", description=( 'Specified maximum cardinality for the element - a number or a "*". ' "This is optional; if present, it acts an implicit check on the input " "content (* just serves as documentation; it's the default value)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_max", title="Extension field for ``max``." ) min: fhirtypes.IntegerType | None = Field( default=None, alias="min", title="Specified minimum cardinality", description=( "Specified minimum cardinality for the element. This is optional; if " "present, it acts an implicit check on the input content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_min", title="Extension field for ``min``." ) type: fhirtypes.StringType | None = Field( default=None, alias="type", title="Rule only applies if source has this type", description=( "Specified type for the element. This works as a condition on the " "mapping - use for polymorphic elements." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) variable: fhirtypes.IdType | None = Field( default=None, alias="variable", title="Named context for field, if a field is specified", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) variable__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_variable", title="Extension field for ``variable``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapGroupRuleSource`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "context", "min", "max", "type", "defaultValue", "element", "listMode", "variable", "condition", "check", "logMessage", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapGroupRuleSource`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "context", "min", "max", "type", "defaultValue", "element", "listMode", "variable", "condition", "check", "logMessage", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("context", "context__ext")] return required_fields class StructureMapGroupRuleTarget(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Content to create because of this mapping rule. """ __resource_type__ = "StructureMapGroupRuleTarget" context: fhirtypes.StringType | None = Field( default=None, alias="context", title="Variable this rule applies to", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) context__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_context", title="Extension field for ``context``." ) element: fhirtypes.StringType | None = Field( default=None, alias="element", title="Field to create in the context", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) element__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_element", title="Extension field for ``element``." ) listMode: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="listMode", title="first | share | last | single", description="If field is a list, how to manage the list.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["first", "share", "last", "single"], }, ) listMode__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_listMode", title="Extension field for ``listMode``." ) listRuleId: fhirtypes.IdType | None = Field( default=None, alias="listRuleId", title="Internal rule reference for shared list items", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) listRuleId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_listRuleId", title="Extension field for ``listRuleId``." ) parameter: typing.List[ fhirtypes.StructureMapGroupRuleTargetParameterType ] | None = Field( default=None, alias="parameter", title="Parameters to the transform", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) transform: fhirtypes.CodeType | None = Field( default=None, alias="transform", title="create | copy +", description="How the data is copied / created.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["create", "copy", "+"], }, ) transform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_transform", title="Extension field for ``transform``." ) variable: fhirtypes.IdType | None = Field( default=None, alias="variable", title="Named context for field, if desired, and a field is specified", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) variable__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_variable", title="Extension field for ``variable``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapGroupRuleTarget`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "context", "element", "variable", "listMode", "listRuleId", "transform", "parameter", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapGroupRuleTarget`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "context", "element", "variable", "listMode", "listRuleId", "transform", "parameter", ] class StructureMapGroupRuleTargetParameter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Parameters to the transform. """ __resource_type__ = "StructureMapGroupRuleTargetParameter" valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Parameter value - variable or literal", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="Parameter value - variable or literal", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Parameter value - variable or literal", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Parameter value - variable or literal", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueId: fhirtypes.IdType | None = Field( default=None, alias="valueId", title="Parameter value - variable or literal", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueId", title="Extension field for ``valueId``." ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Parameter value - variable or literal", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Parameter value - variable or literal", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Parameter value - variable or literal", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapGroupRuleTargetParameter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "valueId", "valueString", "valueBoolean", "valueInteger", "valueDecimal", "valueDate", "valueTime", "valueDateTime", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapGroupRuleTargetParameter`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "valueId", "valueString", "valueBoolean", "valueInteger", "valueDecimal", "valueDate", "valueTime", "valueDateTime", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInteger", "valueString", "valueTime", ] } return one_of_many_fields class StructureMapStructure(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Structure Definition used by this map. A structure definition used by this map. The structure definition may describe instances that are converted, or the instances that are produced. """ __resource_type__ = "StructureMapStructure" alias: fhirtypes.StringType | None = Field( default=None, alias="alias", title="Name for type in this map", description="The name used for this type in the map.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) alias__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_alias", title="Extension field for ``alias``." ) documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Documentation on use of structure", description="Documentation that describes how the structure is used in the mapping.", json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) mode: fhirtypes.CodeType | None = Field( default=None, alias="mode", title="source | queried | target | produced", description="How the referenced structure is used in this mapping.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["source", "queried", "target", "produced"], }, ) mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_mode", title="Extension field for ``mode``." ) url: fhirtypes.CanonicalType | None = Field( default=None, alias="url", title="Canonical reference to structure definition", description="The canonical reference to the structure.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``StructureMapStructure`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "url", "mode", "alias", "documentation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``StructureMapStructure`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "url", "mode", "alias"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("mode", "mode__ext"), ("url", "url__ext")] return required_fields ================================================ FILE: fhir/resources/subscription.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Subscription Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Subscription(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Notification about a SubscriptionTopic. The subscription resource describes a particular client's request to be notified about a SubscriptionTopic. """ __resource_type__ = "Subscription" channelType: fhirtypes.CodingType = Field( default=..., alias="channelType", title="Channel type for notifications", description="The type of channel to send notifications on.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactPointType] | None = Field( default=None, alias="contact", title="Contact details for source (e.g. troubleshooting)", description=( "Contact details for a human to contact about the subscription. The " "primary use of this for system administrator troubleshooting." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) content: fhirtypes.CodeType | None = Field( default=None, alias="content", title="empty | id-only | full-resource", description=( "How much of the resource content to deliver in the notification " "payload. The choices are an empty payload, only the resource id, or " "the full resource content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["empty", "id-only", "full-resource"], }, ) content__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_content", title="Extension field for ``content``." ) contentType: fhirtypes.CodeType | None = Field( default=None, alias="contentType", title="MIME type to send, or omit for no payload", description=( "The MIME type to send the payload in - e.g., `application/fhir+xml` or" " `application/fhir+json`. Note that: * clients may request " "notifications in a specific FHIR version by using the [FHIR Version " "Parameter](http.html#version-parameter) - e.g., " "`application/fhir+json; fhirVersion=4.0`. * additional MIME types can" " be allowed by channels - e.g., `text/plain` and `text/html` are " "defined by the Email channel." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contentType", title="Extension field for ``contentType``." ) end: fhirtypes.InstantType | None = Field( default=None, alias="end", title="When to automatically delete the subscription", description="The time for the server to turn the subscription off.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_end", title="Extension field for ``end``." ) endpoint: fhirtypes.UrlType | None = Field( default=None, alias="endpoint", title="Where the channel points to", description="The url that describes the actual end-point to send notifications to.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endpoint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_endpoint", title="Extension field for ``endpoint``." ) filterBy: typing.List[fhirtypes.SubscriptionFilterByType] | None = Field( default=None, alias="filterBy", title="Criteria for narrowing the subscription topic stream", description=( "The filter properties to be applied to narrow the subscription topic " "stream. When multiple filters are applied, evaluates to true if all " "the conditions applicable to that resource are met; otherwise it " "returns false (i.e., logical AND)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) heartbeatPeriod: fhirtypes.UnsignedIntType | None = Field( default=None, alias="heartbeatPeriod", title="Interval in seconds to send 'heartbeat' notification", description=( "If present, a 'heartbeat' notification (keep-alive) is sent via this " "channel with an interval period equal to this elements integer value " "in seconds. If not present, a heartbeat notification is not sent." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) heartbeatPeriod__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_heartbeatPeriod", title="Extension field for ``heartbeatPeriod``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifiers (business identifier)", description=( "A formal identifier that is used to identify this code system when it " "is represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) managingEntity: fhirtypes.ReferenceType | None = Field( default=None, alias="managingEntity", title="Entity responsible for Subscription changes", description=( "Entity with authorization to make subsequent revisions to the " "Subscription and also determines what data the subscription is " "authorized to disclose." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "CareTeam", "HealthcareService", "Organization", "RelatedPerson", "Patient", "Practitioner", "PractitionerRole", ], }, ) maxCount: fhirtypes.PositiveIntType | None = Field( default=None, alias="maxCount", title="Maximum number of events that can be combined in a single notification", description=( "If present, the maximum number of events that will be included in a " "notification bundle. Note that this is not a strict limit on the " "number of entries in a bundle, as dependent resources can be included." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maxCount__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxCount", title="Extension field for ``maxCount``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Human readable name for this subscription", description="A natural language name identifying the subscription.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) parameter: typing.List[fhirtypes.SubscriptionParameterType] | None = Field( default=None, alias="parameter", title="Channel type", description=( "Channel-dependent information to send as part of the notification " "(e.g., HTTP Headers)." ), json_schema_extra={ "element_property": True, }, ) reason: fhirtypes.StringType | None = Field( default=None, alias="reason", title="Description of why this subscription was created", description="A description of why this subscription is defined.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_reason", title="Extension field for ``reason``." ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="requested | active | error | off | entered-in-error", description=( "The status of the subscription, which marks the server state for " "managing the subscription." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["requested", "active", "error", "off", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) timeout: fhirtypes.UnsignedIntType | None = Field( default=None, alias="timeout", title="Timeout in seconds to attempt notification delivery", description=( "If present, the maximum amount of time a server will allow before " "failing a notification attempt." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) timeout__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timeout", title="Extension field for ``timeout``." ) topic: fhirtypes.CanonicalType | None = Field( default=None, alias="topic", title="Reference to the subscription topic being subscribed to", description="The reference to the subscription topic to be notified about.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SubscriptionTopic"], }, ) topic__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_topic", title="Extension field for ``topic``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Subscription`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "name", "status", "topic", "contact", "end", "managingEntity", "reason", "filterBy", "channelType", "endpoint", "parameter", "heartbeatPeriod", "timeout", "contentType", "content", "maxCount", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Subscription`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "name", "status", "topic", "contact", "end", "managingEntity", "reason", "filterBy", "channelType", "endpoint", "heartbeatPeriod", "timeout", "contentType", "content", "maxCount", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext"), ("topic", "topic__ext")] return required_fields class SubscriptionFilterBy(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Criteria for narrowing the subscription topic stream. The filter properties to be applied to narrow the subscription topic stream. When multiple filters are applied, evaluates to true if all the conditions applicable to that resource are met; otherwise it returns false (i.e., logical AND). """ __resource_type__ = "SubscriptionFilterBy" comparator: fhirtypes.CodeType | None = Field( default=None, alias="comparator", title="eq | ne | gt | lt | ge | le | sa | eb | ap", description="Comparator applied to this filter parameter.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["eq", "ne", "gt", "lt", "ge", "le", "sa", "eb", "ap"], }, ) comparator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comparator", title="Extension field for ``comparator``." ) filterParameter: fhirtypes.StringType | None = Field( default=None, alias="filterParameter", title="Filter label defined in SubscriptionTopic", description=( "The filter as defined in the " "`SubscriptionTopic.canFilterBy.filterParameter` element." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) filterParameter__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_filterParameter", title="Extension field for ``filterParameter``.", ) modifier: fhirtypes.CodeType | None = Field( default=None, alias="modifier", title=( "missing | exact | contains | not | text | in | not-in | below | above " "| type | identifier | of-type | code-text | text-advanced | iterate" ), description="Modifier applied to this filter parameter.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "missing", "exact", "contains", "not", "text", "in", "not-in", "below", "above", "type", "identifier", "of-type", "code-text", "text-advanced", "iterate", ], }, ) modifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_modifier", title="Extension field for ``modifier``." ) resourceType: fhirtypes.UriType | None = Field( default=None, alias="resourceType", title=( "Allowed Resource (reference to definition) for this Subscription " "filter" ), description=( "A resource listed in the `SubscriptionTopic` this `Subscription` " "references (`SubscriptionTopic.canFilterBy.resource`). This element " "can be used to differentiate filters for topics that include more than" " one resource type." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) resourceType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resourceType", title="Extension field for ``resourceType``.", ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="Literal value or resource path", description=( "The literal value or resource path as is legal in search - for " "example, `Patient/123` or `le1950`." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubscriptionFilterBy`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "resourceType", "filterParameter", "comparator", "modifier", "value", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubscriptionFilterBy`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "resourceType", "filterParameter", "value"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("filterParameter", "filterParameter__ext"), ("value", "value__ext"), ] return required_fields class SubscriptionParameter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Channel type. Channel-dependent information to send as part of the notification (e.g., HTTP Headers). """ __resource_type__ = "SubscriptionParameter" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name (key) of the parameter", description=( "Parameter name for information passed to the channel for " "notifications, for example in the case of a REST hook wanting to pass " "through an authorization header, the name would be Authorization." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="Value of the parameter to use or pass through", description=( "Parameter value for information passed to the channel for " "notifications, for example in the case of a REST hook wanting to pass " "through an authorization header, the value would be `Bearer 0193...`." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubscriptionParameter`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubscriptionParameter`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext"), ("value", "value__ext")] return required_fields ================================================ FILE: fhir/resources/subscriptionstatus.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SubscriptionStatus Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class SubscriptionStatus(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Status information about a Subscription provided during event notification. The SubscriptionStatus resource describes the state of a Subscription during notifications. """ __resource_type__ = "SubscriptionStatus" error: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="error", title="List of errors on the subscription", description=( "A record of errors that occurred when the server processed a " "notification." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) eventsSinceSubscriptionStart: fhirtypes.Integer64Type | None = Field( default=None, alias="eventsSinceSubscriptionStart", title="Events since the Subscription was created", description=( "The total number of actual events which have been generated since the " "Subscription was created (inclusive of this notification) - regardless" " of how many have been successfully communicated. This number is NOT " "incremented for handshake and heartbeat notifications." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) eventsSinceSubscriptionStart__ext: fhirtypes.FHIRPrimitiveExtensionType | None = ( Field( default=None, alias="_eventsSinceSubscriptionStart", title="Extension field for ``eventsSinceSubscriptionStart``.", ) ) notificationEvent: typing.List[ fhirtypes.SubscriptionStatusNotificationEventType ] | None = Field( default=None, alias="notificationEvent", title="Detailed information about any events relevant to this notification", description=( "Detailed information about events relevant to this subscription " "notification." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="requested | active | error | off | entered-in-error", description=( "The status of the subscription, which marks the server state for " "managing the subscription." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["requested", "active", "error", "off", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) subscription: fhirtypes.ReferenceType = Field( default=..., alias="subscription", title="Reference to the Subscription responsible for this notification", description="The reference to the Subscription which generated this notification.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Subscription"], }, ) topic: fhirtypes.CanonicalType | None = Field( default=None, alias="topic", title="Reference to the SubscriptionTopic this notification relates to", description=( "The reference to the SubscriptionTopic for the Subscription which " "generated this notification." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SubscriptionTopic"], }, ) topic__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_topic", title="Extension field for ``topic``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "handshake | heartbeat | event-notification | query-status | query-" "event" ), description="The type of event being conveyed with this notification.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "handshake", "heartbeat", "event-notification", "query-status", "query-event", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubscriptionStatus`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "status", "type", "eventsSinceSubscriptionStart", "notificationEvent", "subscription", "topic", "error", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubscriptionStatus`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "status", "type", "eventsSinceSubscriptionStart", "subscription", "topic", "error", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields class SubscriptionStatusNotificationEvent(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Detailed information about any events relevant to this notification. Detailed information about events relevant to this subscription notification. """ __resource_type__ = "SubscriptionStatusNotificationEvent" additionalContext: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="additionalContext", title="References related to the focus resource and/or context of this event", description=( "Additional context information for this event. Generally, this will " "contain references to additional resources included with the event " "(e.g., the Patient relevant to an Encounter), however it MAY refer to " "non-FHIR objects." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) eventNumber: fhirtypes.Integer64Type | None = Field( default=None, alias="eventNumber", title="Sequencing index of this event", description=( "Either the sequential number of this event in this subscription " "context or a relative event number for this notification." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) eventNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_eventNumber", title="Extension field for ``eventNumber``." ) focus: fhirtypes.ReferenceType | None = Field( default=None, alias="focus", title="Reference to the primary resource or information of this event", description=( "The focus of this event. While this will usually be a reference to the" " focus resource of the event, it MAY contain a reference to a non-FHIR" " object." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) timestamp: fhirtypes.InstantType | None = Field( default=None, alias="timestamp", title="The instant this event occurred", description="The actual time this event occurred on the server.", json_schema_extra={ "element_property": True, }, ) timestamp__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timestamp", title="Extension field for ``timestamp``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubscriptionStatusNotificationEvent`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "eventNumber", "timestamp", "focus", "additionalContext", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubscriptionStatusNotificationEvent`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("eventNumber", "eventNumber__ext")] return required_fields ================================================ FILE: fhir/resources/subscriptiontopic.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SubscriptionTopic Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class SubscriptionTopic(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The definition of a specific topic for triggering events within the Subscriptions framework. Describes a stream of resource state changes or events and annotated with labels useful to filter projections from this topic. """ __resource_type__ = "SubscriptionTopic" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When SubscriptionTopic is/was approved by publisher", description=( "The date on which the asset content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) canFilterBy: typing.List[fhirtypes.SubscriptionTopicCanFilterByType] | None = Field( default=None, alias="canFilterBy", title=( "Properties by which a Subscription can filter notifications from the " "SubscriptionTopic" ), description=( "List of properties by which Subscriptions on the SubscriptionTopic can" " be filtered. May be defined Search Parameters (e.g., " "Encounter.patient) or parameters defined within this SubscriptionTopic" " context (e.g., hub.event)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the SubscriptionTopic and/or its " "contents. Copyright statements are generally legal restrictions on the" " use and publishing of the SubscriptionTopic." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date status first applied", description=( "The date (and optionally time) when the subscription topic was last " "significantly changed. The date must change when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the subscription topic " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) derivedFrom: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="derivedFrom", title="Based on FHIR protocol or definition", description=( "The canonical URL pointing to another FHIR-defined SubscriptionTopic " "that is adhered to in whole or in part by this SubscriptionTopic." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SubscriptionTopic"], }, ) derivedFrom__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_derivedFrom", title="Extension field for ``derivedFrom``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the SubscriptionTopic", description=( "A free text natural language description of the Topic from the " "consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="The effective date range for the SubscriptionTopic", description=( "The period during which the SubscriptionTopic content was or is " "planned to be effective." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) eventTrigger: typing.List[ fhirtypes.SubscriptionTopicEventTriggerType ] | None = Field( default=None, alias="eventTrigger", title="Event definitions the SubscriptionTopic", description="Event definition which can be used to trigger the SubscriptionTopic.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="If for testing purposes, not real usage", description=( "A flag to indicate that this TopSubscriptionTopicic is authored for " "testing purposes (or education/evaluation/marketing), and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier for subscription topic", description=( "Business identifiers assigned to this subscription topic by the " "performer and/or other systems. These identifiers remain constant as " "the resource is updated and propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction of the SubscriptionTopic (if applicable)", description="A jurisdiction in which the Topic is intended to be used.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="Date the Subscription Topic was last reviewed by the publisher", description=( "The date on which the asset content was last reviewed. Review happens " "periodically after that, but doesn't change the original approval " "date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this subscription topic (computer friendly)", description=( "A natural language name identifying the subscription topic This name " "should be usable as an identifier for the module by machine processing" " applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) notificationShape: typing.List[ fhirtypes.SubscriptionTopicNotificationShapeType ] | None = Field( default=None, alias="notificationShape", title=( "Properties for describing the shape of notifications generated by this" " topic" ), description=( "List of properties to describe the shape (e.g., resources) included in" " notifications from this Subscription Topic." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title=( "The name of the individual or organization that published the " "SubscriptionTopic" ), description=( 'Helps establish the "authority/credibility" of the SubscriptionTopic.' " May also allow for contact." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this SubscriptionTopic is defined", description=( "Explains why this Topic is needed and why it has been designed as it " "has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) resourceTrigger: typing.List[ fhirtypes.SubscriptionTopicResourceTriggerType ] | None = Field( default=None, alias="resourceTrigger", title="Definition of a resource-based trigger for the subscription topic", description=( "A definition of a resource-based event that triggers a notification " "based on the SubscriptionTopic. The criteria may be just a human " "readable description and/or a full FHIR search string or FHIRPath " "expression. Multiple triggers are considered OR joined (e.g., a " "resource update matching ANY of the definitions will trigger a " "notification)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description="The current state of the SubscriptionTopic.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this subscription topic (human friendly)", description=( "A short, descriptive, user-friendly title for the subscription topic." ' For example, "admission".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this subscription topic, represented as an " "absolute URI (globally unique)" ), description=( "An absolute URI that is used to identify this subscription topic when " "it is referenced in a specification, model, design or an instance; " "also called its canonical identifier. This SHOULD be globally unique " "and SHOULD be a literal address at which an authoritative instance of " "this subscription topic is (or will be) published. This URL can be the" " target of a canonical reference. It SHALL remain the same when the " "subscription topic is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="Content intends to support these contexts", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These terms may be used to assist with " "indexing and searching of code system definitions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the subscription topic", description=( "The identifier that is used to identify this version of the " "subscription topic when it is referenced in a specification, model, " "design or instance. This is an arbitrary value managed by the Topic " "author and is not expected to be globally unique. For example, it " "might be a timestamp (e.g. yyyymmdd) if a managed version is not " "available. There is also no expectation that versions are orderable." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubscriptionTopic`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "derivedFrom", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "copyrightLabel", "approvalDate", "lastReviewDate", "effectivePeriod", "resourceTrigger", "eventTrigger", "canFilterBy", "notificationShape", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubscriptionTopic`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "derivedFrom", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "effectivePeriod", "resourceTrigger", "eventTrigger", "canFilterBy", "notificationShape", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext"), ("url", "url__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields class SubscriptionTopicCanFilterBy(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Properties by which a Subscription can filter notifications from the SubscriptionTopic. List of properties by which Subscriptions on the SubscriptionTopic can be filtered. May be defined Search Parameters (e.g., Encounter.patient) or parameters defined within this SubscriptionTopic context (e.g., hub.event). """ __resource_type__ = "SubscriptionTopicCanFilterBy" comparator: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="comparator", title="eq | ne | gt | lt | ge | le | sa | eb | ap", description="Comparators allowed for the filter parameter.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["eq", "ne", "gt", "lt", "ge", "le", "sa", "eb", "ap"], }, ) comparator__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_comparator", title="Extension field for ``comparator``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Description of this filter parameter", description="Description of how this filtering parameter is intended to be used.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) filterDefinition: fhirtypes.UriType | None = Field( default=None, alias="filterDefinition", title="Canonical URL for a filterParameter definition", description=( "Either the canonical URL to a search parameter (like " '"http://hl7.org/fhir/SearchParameter/encounter-patient") or the ' "officially-defined URI for a shared filter concept (like " '"http://example.org/concepts/shared-common-event").' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) filterDefinition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_filterDefinition", title="Extension field for ``filterDefinition``.", ) filterParameter: fhirtypes.StringType | None = Field( default=None, alias="filterParameter", title=( "Human-readable and computation-friendly name for a filter parameter " "usable by subscriptions on this topic, via " "Subscription.filterBy.filterParameter" ), description=( "Either the canonical URL to a search parameter (like " '"http://hl7.org/fhir/SearchParameter/encounter-patient") or topic-' 'defined parameter (like "hub.event") which is a label for the filter.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) filterParameter__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_filterParameter", title="Extension field for ``filterParameter``.", ) modifier: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="modifier", title=( "missing | exact | contains | not | text | in | not-in | below | above " "| type | identifier | of-type | code-text | text-advanced | iterate" ), description="Modifiers allowed for the filter parameter.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "missing", "exact", "contains", "not", "text", "in", "not-in", "below", "above", "type", "identifier", "of-type", "code-text", "text-advanced", "iterate", ], }, ) modifier__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_modifier", title="Extension field for ``modifier``." ) resource: fhirtypes.UriType | None = Field( default=None, alias="resource", title="URL of the triggering Resource that this filter applies to", description=( "URL of the Resource that is the type used in this filter. This is the " '"focus" of the topic (or one of them if there are more than one). It ' "will be the same, a generality, or a specificity of " "SubscriptionTopic.resourceTrigger.resource or " "SubscriptionTopic.eventTrigger.resource when they are present." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resource", title="Extension field for ``resource``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubscriptionTopicCanFilterBy`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "resource", "filterParameter", "filterDefinition", "comparator", "modifier", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubscriptionTopicCanFilterBy`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "description", "resource", "filterParameter", "filterDefinition", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("filterParameter", "filterParameter__ext")] return required_fields class SubscriptionTopicEventTrigger(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Event definitions the SubscriptionTopic. Event definition which can be used to trigger the SubscriptionTopic. """ __resource_type__ = "SubscriptionTopicEventTrigger" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Text representation of the event trigger", description=( "The human readable description of an event to trigger a notification " 'for the SubscriptionTopic - for example, "Patient Admission, as ' 'defined in HL7v2 via message ADT^A01". Multiple values are considered ' "OR joined (e.g., matching any single event listed)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) event: fhirtypes.CodeableConceptType = Field( default=..., alias="event", title="Event which can trigger a notification from the SubscriptionTopic", description=( "A well-defined event which can be used to trigger notifications from " "the SubscriptionTopic." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) resource: fhirtypes.UriType | None = Field( default=None, alias="resource", title=( "Data Type or Resource (reference to definition) for this trigger " "definition" ), description=( "URL of the Resource that is the focus type used in this event trigger." " Relative URLs are relative to the StructureDefinition root of the " "implemented FHIR version (e.g., " 'http://hl7.org/fhir/StructureDefinition). For example, "Patient" maps ' "to http://hl7.org/fhir/StructureDefinition/Patient. For more " 'information, see ElementDefinition.type.code.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resource", title="Extension field for ``resource``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubscriptionTopicEventTrigger`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "event", "resource", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubscriptionTopicEventTrigger`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "description", "event", "resource"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("resource", "resource__ext")] return required_fields class SubscriptionTopicNotificationShape(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Properties for describing the shape of notifications generated by this topic. List of properties to describe the shape (e.g., resources) included in notifications from this Subscription Topic. """ __resource_type__ = "SubscriptionTopicNotificationShape" include: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="include", title="Include directives, rooted in the resource for this shape", description=( "Search-style _include directives, rooted in the resource for this " "shape. Servers SHOULD include resources listed here, if they exist and" " the user is authorized to receive them. Clients SHOULD be prepared " "to receive these additional resources, but SHALL function properly " "without them." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) include__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_include", title="Extension field for ``include``." ) resource: fhirtypes.UriType | None = Field( default=None, alias="resource", title=( "URL of the Resource that is the focus (main) resource in a " "notification shape" ), description=( "URL of the Resource that is the type used in this shape. This is the " "'focus' resource of the topic (or one of them if there are more than " "one) and the root resource for this shape definition. It will be the " "same, a generality, or a specificity of " "SubscriptionTopic.resourceTrigger.resource or " "SubscriptionTopic.eventTrigger.resource when they are present." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resource", title="Extension field for ``resource``." ) revInclude: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="revInclude", title="Reverse include directives, rooted in the resource for this shape", description=( "Search-style _revinclude directives, rooted in the resource for this " "shape. Servers SHOULD include resources listed here, if they exist and" " the user is authorized to receive them. Clients SHOULD be prepared " "to receive these additional resources, but SHALL function properly " "without them." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) revInclude__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_revInclude", title="Extension field for ``revInclude``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubscriptionTopicNotificationShape`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "resource", "include", "revInclude", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubscriptionTopicNotificationShape`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "resource", "include", "revInclude"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("resource", "resource__ext")] return required_fields class SubscriptionTopicResourceTrigger(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Definition of a resource-based trigger for the subscription topic. A definition of a resource-based event that triggers a notification based on the SubscriptionTopic. The criteria may be just a human readable description and/or a full FHIR search string or FHIRPath expression. Multiple triggers are considered OR joined (e.g., a resource update matching ANY of the definitions will trigger a notification). """ __resource_type__ = "SubscriptionTopicResourceTrigger" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Text representation of the resource trigger", description=( "The human readable description of this resource trigger for the " "SubscriptionTopic - for example, \"An Encounter enters the 'in-" "progress' state\"." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) fhirPathCriteria: fhirtypes.StringType | None = Field( default=None, alias="fhirPathCriteria", title="FHIRPath based trigger rule", description=( "The FHIRPath based rules that the server should use to determine when " "to trigger a notification for this topic." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) fhirPathCriteria__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fhirPathCriteria", title="Extension field for ``fhirPathCriteria``.", ) queryCriteria: fhirtypes.SubscriptionTopicResourceTriggerQueryCriteriaType | None = Field( default=None, alias="queryCriteria", title="Query based trigger rule", description=( "The FHIR query based rules that the server should use to determine " "when to trigger a notification for this subscription topic." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) resource: fhirtypes.UriType | None = Field( default=None, alias="resource", title=( "Data Type or Resource (reference to definition) for this trigger " "definition" ), description=( "URL of the Resource that is the type used in this resource trigger. " "Relative URLs are relative to the StructureDefinition root of the " "implemented FHIR version (e.g., " 'http://hl7.org/fhir/StructureDefinition). For example, "Patient" maps ' "to http://hl7.org/fhir/StructureDefinition/Patient. For more " 'information, see ElementDefinition.type.code.' ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resource", title="Extension field for ``resource``." ) supportedInteraction: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="supportedInteraction", title="create | update | delete", description=( "The FHIR RESTful interaction which can be used to trigger a " "notification for the SubscriptionTopic. Multiple values are considered" " OR joined (e.g., CREATE or UPDATE). If not present, all supported " "interactions are assumed." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["create", "update", "delete"], }, ) supportedInteraction__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_supportedInteraction", title="Extension field for ``supportedInteraction``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubscriptionTopicResourceTrigger`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "description", "resource", "supportedInteraction", "queryCriteria", "fhirPathCriteria", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubscriptionTopicResourceTrigger`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "description", "resource", "supportedInteraction", "queryCriteria", "fhirPathCriteria", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("resource", "resource__ext")] return required_fields class SubscriptionTopicResourceTriggerQueryCriteria(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Query based trigger rule. The FHIR query based rules that the server should use to determine when to trigger a notification for this subscription topic. """ __resource_type__ = "SubscriptionTopicResourceTriggerQueryCriteria" current: fhirtypes.StringType | None = Field( default=None, alias="current", title="Rule applied to current resource state", description=( "The FHIR query based rules are applied to the current resource state " "(e.g., state after an update)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) current__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_current", title="Extension field for ``current``." ) previous: fhirtypes.StringType | None = Field( default=None, alias="previous", title="Rule applied to previous resource state", description=( "The FHIR query based rules are applied to the previous resource state " "(e.g., state before an update)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) previous__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_previous", title="Extension field for ``previous``." ) requireBoth: bool | None = Field( default=None, alias="requireBoth", title="Both must be true flag", description=( "If set to `true`, both the `current` and `previous` query criteria " "must evaluate `true` to trigger a notification for this topic. If set" " to `false` or not present, a notification for this topic will be " "triggered if either the `current` or `previous` tests evaluate to " "`true`." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) requireBoth__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requireBoth", title="Extension field for ``requireBoth``." ) resultForCreate: fhirtypes.CodeType | None = Field( default=None, alias="resultForCreate", title="test-passes | test-fails", description=( "For `create` interactions, should the `previous` criteria count as an " "automatic pass or an automatic fail. If not present, the testing " "behavior during `create` interactions is unspecified (server " "discretion)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["test-passes", "test-fails"], }, ) resultForCreate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resultForCreate", title="Extension field for ``resultForCreate``.", ) resultForDelete: fhirtypes.CodeType | None = Field( default=None, alias="resultForDelete", title="test-passes | test-fails", description=( "For 'delete' interactions, should the 'current' query criteria count " "as an automatic pass or an automatic fail. If not present, the testing" " behavior during `delete` interactions is unspecified (server " "discretion)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["test-passes", "test-fails"], }, ) resultForDelete__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resultForDelete", title="Extension field for ``resultForDelete``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubscriptionTopicResourceTriggerQueryCriteria`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "previous", "resultForCreate", "current", "resultForDelete", "requireBoth", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubscriptionTopicResourceTriggerQueryCriteria`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "previous", "resultForCreate", "current", "resultForDelete", "requireBoth", ] ================================================ FILE: fhir/resources/substance.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Substance Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Substance(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A homogeneous material with a definite composition. """ __resource_type__ = "Substance" category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="What class/type of substance this is", description=( "A code that classifies the general type of substance. This is used " "for searching, sorting and display purposes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableReferenceType = Field( default=..., alias="code", title="What substance this is", description="A code (or set of codes) that identify this substance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SubstanceDefinition"], }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Textual description of the substance, comments", description=( "A description of the substance - its appearance, handling " "requirements, and other usage notes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) expiry: fhirtypes.DateTimeType | None = Field( default=None, alias="expiry", title="When no longer valid to use", description=( "When the substance is no longer valid to use. For some substances, a " "single arbitrary date is used for expiry." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) expiry__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expiry", title="Extension field for ``expiry``." ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Unique identifier", description=( "Unique identifier for the substance. For an instance, an identifier " "associated with the package/container (usually a label affixed " "directly)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) ingredient: typing.List[fhirtypes.SubstanceIngredientType] | None = Field( default=None, alias="ingredient", title="Composition information about the substance", description="A substance can be composed of other substances.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instance: bool | None = Field( default=None, alias="instance", title="Is this an instance of a substance or a kind of one", description=( "A boolean to indicate if this an instance of a substance or a kind of " "one (a definition)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) instance__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instance", title="Extension field for ``instance``." ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Amount of substance in the package", description="The amount of the substance.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | inactive | entered-in-error", description="A code to indicate if the substance is actively used.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "inactive", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Substance`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "instance", "status", "category", "code", "description", "expiry", "quantity", "ingredient", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Substance`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "instance", "status", "category", "code", "description", "expiry", "quantity", "ingredient", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("instance", "instance__ext")] return required_fields class SubstanceIngredient(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Composition information about the substance. A substance can be composed of other substances. """ __resource_type__ = "SubstanceIngredient" quantity: fhirtypes.RatioType | None = Field( default=None, alias="quantity", title="Optional amount (concentration)", description="The amount of the ingredient in the substance - a concentration ratio.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) substanceCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="substanceCodeableConcept", title="A component of the substance", description="Another substance that is a component of this substance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e substance[x] "one_of_many": "substance", "one_of_many_required": True, }, ) substanceReference: fhirtypes.ReferenceType | None = Field( default=None, alias="substanceReference", title="A component of the substance", description="Another substance that is a component of this substance.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e substance[x] "one_of_many": "substance", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Substance"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceIngredient`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "quantity", "substanceCodeableConcept", "substanceReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceIngredient`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "quantity", "substanceCodeableConcept", "substanceReference", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "substance": ["substanceCodeableConcept", "substanceReference"] } return one_of_many_fields ================================================ FILE: fhir/resources/substancedefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SubstanceDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class SubstanceDefinition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The detailed description of a substance, typically at a level beyond what is used for prescribing. """ __resource_type__ = "SubstanceDefinition" characterization: typing.List[ fhirtypes.SubstanceDefinitionCharacterizationType ] | None = Field( default=None, alias="characterization", title="General specifications for this substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) classification: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="classification", title=( "A categorization, high level e.g. polymer or nucleic acid, or food, " "chemical, biological, or lower e.g. polymer linear or branch chain, or" " type of impurity" ), description=( "A high level categorization, e.g. polymer or nucleic acid, or food, " "chemical, biological, or a lower level such as the general types of " "polymer (linear or branch chain) or type of impurity (process related " "or contaminant)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: typing.List[fhirtypes.SubstanceDefinitionCodeType] | None = Field( default=None, alias="code", title="Codes associated with the substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Textual description of the substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) domain: fhirtypes.CodeableConceptType | None = Field( default=None, alias="domain", title="If the substance applies to human or veterinary use", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) grade: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="grade", title=( "The quality standard, established benchmark, to which substance " "complies (e.g. USP/NF, BP)" ), description=( "The quality standard, established benchmark, to which substance " "complies (e.g. USP/NF, Ph. Eur, JP, BP, Company Standard)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Identifier by which this substance is known", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) informationSource: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="informationSource", title="Supporting literature", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Citation"], }, ) manufacturer: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="manufacturer", title="The entity that creates, makes, produces or fabricates the substance", description=( "The entity that creates, makes, produces or fabricates the substance. " "This is a set of potential manufacturers but is not necessarily " "comprehensive." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) moiety: typing.List[fhirtypes.SubstanceDefinitionMoietyType] | None = Field( default=None, alias="moiety", title="Moiety, for structural modifications", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) molecularWeight: typing.List[ fhirtypes.SubstanceDefinitionMolecularWeightType ] | None = Field( default=None, alias="molecularWeight", title="The average mass of a molecule of a compound", description=( "The average mass of a molecule of a compound compared to 1/12 the mass" " of carbon 12 and calculated as the sum of the atomic weights of the " "constituent atoms." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: typing.List[fhirtypes.SubstanceDefinitionNameType] | None = Field( default=None, alias="name", title="Names applicable to this substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Textual comment about the substance's catalogue or registry record", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) nucleicAcid: fhirtypes.ReferenceType | None = Field( default=None, alias="nucleicAcid", title="Data items specific to nucleic acids", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SubstanceNucleicAcid"], }, ) polymer: fhirtypes.ReferenceType | None = Field( default=None, alias="polymer", title="Data items specific to polymers", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SubstancePolymer"], }, ) property: typing.List[fhirtypes.SubstanceDefinitionPropertyType] | None = Field( default=None, alias="property", title="General specifications for this substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) protein: fhirtypes.ReferenceType | None = Field( default=None, alias="protein", title="Data items specific to proteins", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SubstanceProtein"], }, ) referenceInformation: fhirtypes.ReferenceType | None = Field( default=None, alias="referenceInformation", title="General information detailing this substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SubstanceReferenceInformation"], }, ) relationship: typing.List[ fhirtypes.SubstanceDefinitionRelationshipType ] | None = Field( default=None, alias="relationship", title="A link between this substance and another", description=( "A link between this substance and another, with details of the " "relationship." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sourceMaterial: fhirtypes.SubstanceDefinitionSourceMaterialType | None = Field( default=None, alias="sourceMaterial", title="Material or taxonomic/anatomical source", description="Material or taxonomic/anatomical source for the substance.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeableConceptType | None = Field( default=None, alias="status", title="Status of substance within the catalogue e.g. active, retired", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) structure: fhirtypes.SubstanceDefinitionStructureType | None = Field( default=None, alias="structure", title="Structural information", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) supplier: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supplier", title=( "An entity that is the source for the substance. It may be different " "from the manufacturer" ), description=( "An entity that is the source for the substance. It may be different " "from the manufacturer. Supplier is synonymous to a distributor." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="A business level version identifier of the substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "version", "status", "classification", "domain", "grade", "description", "informationSource", "note", "manufacturer", "supplier", "moiety", "characterization", "property", "referenceInformation", "molecularWeight", "structure", "code", "name", "relationship", "nucleicAcid", "polymer", "protein", "sourceMaterial", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "version", "status", "classification", "domain", "grade", "description", "informationSource", "note", "manufacturer", "supplier", "moiety", "characterization", "property", "referenceInformation", "molecularWeight", "structure", "code", "name", "relationship", "nucleicAcid", "polymer", "protein", "sourceMaterial", ] class SubstanceDefinitionCharacterization(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. General specifications for this substance. """ __resource_type__ = "SubstanceDefinitionCharacterization" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title=( "The description or justification in support of the interpretation of " "the data file" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) file: typing.List[fhirtypes.AttachmentType] | None = Field( default=None, alias="file", title=( "The data produced by the analytical instrument or a pictorial " "representation of that data. Examples: a JCAMP, JDX, or ADX file, or a" " chromatogram or spectrum analysis" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) form: fhirtypes.CodeableConceptType | None = Field( default=None, alias="form", title=( "Describes the nature of the chemical entity and explains, for " "instance, whether this is a base or a salt form" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) technique: fhirtypes.CodeableConceptType | None = Field( default=None, alias="technique", title="The method used to find the characterization e.g. HPLC", description=( "The method used to elucidate the characterization of the drug " "substance. Example: HPLC." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceDefinitionCharacterization`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "technique", "form", "description", "file", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionCharacterization`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "technique", "form", "description", "file"] class SubstanceDefinitionCode(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Codes associated with the substance. """ __resource_type__ = "SubstanceDefinitionCode" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="The specific code", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Any comment can be provided in this field", description="Any comment can be provided in this field, if necessary.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) source: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="source", title="Supporting literature", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) status: fhirtypes.CodeableConceptType | None = Field( default=None, alias="status", title="Status of the code assignment, for example 'provisional', 'approved'", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) statusDate: fhirtypes.DateTimeType | None = Field( default=None, alias="statusDate", title="The date at which the code status was changed", description=( "The date at which the code status was changed as part of the " "terminology maintenance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_statusDate", title="Extension field for ``statusDate``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceDefinitionCode`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "status", "statusDate", "note", "source", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionCode`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "status", "statusDate", "note", "source"] class SubstanceDefinitionMoiety(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Moiety, for structural modifications. """ __resource_type__ = "SubstanceDefinitionMoiety" amountQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="amountQuantity", title="Quantitative value for this moiety", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e amount[x] "one_of_many": "amount", "one_of_many_required": False, }, ) amountString: fhirtypes.StringType | None = Field( default=None, alias="amountString", title="Quantitative value for this moiety", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e amount[x] "one_of_many": "amount", "one_of_many_required": False, }, ) amountString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_amountString", title="Extension field for ``amountString``.", ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Identifier by which this moiety substance is known", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) measurementType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="measurementType", title="The measurement type of the quantitative value", description=( "The measurement type of the quantitative value. In capturing the " "actual relative amounts of substances or molecular fragments it may be" " necessary to indicate whether the amount refers to, for example, a " "mole ratio or weight ratio." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) molecularFormula: fhirtypes.StringType | None = Field( default=None, alias="molecularFormula", title="Molecular formula for this moiety (e.g. with the Hill system)", description=( "Molecular formula for this moiety of this substance, typically using " "the Hill system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) molecularFormula__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_molecularFormula", title="Extension field for ``molecularFormula``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Textual name for this moiety substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) opticalActivity: fhirtypes.CodeableConceptType | None = Field( default=None, alias="opticalActivity", title="Optical activity type", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) role: fhirtypes.CodeableConceptType | None = Field( default=None, alias="role", title="Role that the moiety is playing", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) stereochemistry: fhirtypes.CodeableConceptType | None = Field( default=None, alias="stereochemistry", title="Stereochemistry type", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceDefinitionMoiety`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "role", "identifier", "name", "stereochemistry", "opticalActivity", "molecularFormula", "amountQuantity", "amountString", "measurementType", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionMoiety`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "role", "identifier", "name", "stereochemistry", "opticalActivity", "molecularFormula", "amountQuantity", "amountString", "measurementType", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"amount": ["amountQuantity", "amountString"]} return one_of_many_fields class SubstanceDefinitionMolecularWeight(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The average mass of a molecule of a compound. The average mass of a molecule of a compound compared to 1/12 the mass of carbon 12 and calculated as the sum of the atomic weights of the constituent atoms. """ __resource_type__ = "SubstanceDefinitionMolecularWeight" amount: fhirtypes.QuantityType = Field( default=..., alias="amount", title="Used to capture quantitative values for a variety of elements", description=( "Used to capture quantitative values for a variety of elements. If only" " limits are given, the arithmetic mean would be the average. If only a" " single definite value for a given element is given, it would be " "captured in this field." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) method: fhirtypes.CodeableConceptType | None = Field( default=None, alias="method", title="The method by which the weight was determined", description="The method by which the molecular weight was determined.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Type of molecular weight e.g. exact, average, weight average", description=( "Type of molecular weight such as exact, average (also known as. number" " average), weight average." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceDefinitionMolecularWeight`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "method", "type", "amount"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionMolecularWeight`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "method", "type", "amount"] class SubstanceDefinitionName(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Names applicable to this substance. """ __resource_type__ = "SubstanceDefinitionName" domain: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="domain", title=( "The use context of this name e.g. as an active ingredient or as a food" " colour additive" ), description=( "The use context of this name for example if there is a different name " "a drug active ingredient as opposed to a food colour additive." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="The jurisdiction where this name applies", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) language: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="language", title="Human language that the name is written in", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="The actual name", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) official: typing.List[fhirtypes.SubstanceDefinitionNameOfficialType] | None = Field( default=None, alias="official", title="Details of the official nature of this name", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) preferred: bool | None = Field( default=None, alias="preferred", title="If this is the preferred name for this substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) preferred__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_preferred", title="Extension field for ``preferred``." ) source: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="source", title="Supporting literature", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) status: fhirtypes.CodeableConceptType | None = Field( default=None, alias="status", title="The status of the name e.g. 'current', 'proposed'", description="The status of the name, for example 'current', 'proposed'.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) synonym: typing.List[fhirtypes.SubstanceDefinitionNameType] | None = Field( default=None, alias="synonym", title=( "A synonym of this particular name, by which the substance is also " "known" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) translation: typing.List[fhirtypes.SubstanceDefinitionNameType] | None = Field( default=None, alias="translation", title="A translation for this name into another human language", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Name type e.g. 'systematic', 'scientific, 'brand'", description="Name type, for example 'systematic', 'scientific, 'brand'.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceDefinitionName`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "type", "status", "preferred", "language", "domain", "jurisdiction", "synonym", "translation", "official", "source", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionName`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "name", "type", "status", "preferred", "language", "domain", "jurisdiction", "synonym", "translation", "official", "source", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields class SubstanceDefinitionNameOfficial(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Details of the official nature of this name. """ __resource_type__ = "SubstanceDefinitionNameOfficial" authority: fhirtypes.CodeableConceptType | None = Field( default=None, alias="authority", title="Which authority uses this official name", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date of official name change", description="Date of the official name change.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) status: fhirtypes.CodeableConceptType | None = Field( default=None, alias="status", title="The status of the official name, for example 'draft', 'active'", description=( "The status of the official name, for example 'draft', 'active', " "'retired'." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceDefinitionNameOfficial`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "authority", "status", "date"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionNameOfficial`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "authority", "status", "date"] class SubstanceDefinitionProperty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. General specifications for this substance. """ __resource_type__ = "SubstanceDefinitionProperty" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="A code expressing the type of property", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="A value for the property", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="A value for the property", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="A value for the property", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="A value for the property", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="A value for the property", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceDefinitionProperty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueCodeableConcept", "valueQuantity", "valueDate", "valueBoolean", "valueAttachment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionProperty`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "valueCodeableConcept", "valueQuantity", "valueDate", "valueBoolean", "valueAttachment", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAttachment", "valueBoolean", "valueCodeableConcept", "valueDate", "valueQuantity", ] } return one_of_many_fields class SubstanceDefinitionRelationship(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A link between this substance and another. A link between this substance and another, with details of the relationship. """ __resource_type__ = "SubstanceDefinitionRelationship" amountQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="amountQuantity", title=( "A numeric factor for the relationship, e.g. that a substance salt has " "some percentage of active substance in relation to some other" ), description=( "A numeric factor for the relationship, for instance to express that " "the salt of a substance has some percentage of the active substance in" " relation to some other." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e amount[x] "one_of_many": "amount", "one_of_many_required": False, }, ) amountRatio: fhirtypes.RatioType | None = Field( default=None, alias="amountRatio", title=( "A numeric factor for the relationship, e.g. that a substance salt has " "some percentage of active substance in relation to some other" ), description=( "A numeric factor for the relationship, for instance to express that " "the salt of a substance has some percentage of the active substance in" " relation to some other." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e amount[x] "one_of_many": "amount", "one_of_many_required": False, }, ) amountString: fhirtypes.StringType | None = Field( default=None, alias="amountString", title=( "A numeric factor for the relationship, e.g. that a substance salt has " "some percentage of active substance in relation to some other" ), description=( "A numeric factor for the relationship, for instance to express that " "the salt of a substance has some percentage of the active substance in" " relation to some other." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e amount[x] "one_of_many": "amount", "one_of_many_required": False, }, ) amountString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_amountString", title="Extension field for ``amountString``.", ) comparator: fhirtypes.CodeableConceptType | None = Field( default=None, alias="comparator", title=( 'An operator for the amount, for example "average", "approximately", ' '"less than"' ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) isDefining: bool | None = Field( default=None, alias="isDefining", title=( "For example where an enzyme strongly bonds with a particular " "substance, this is a defining relationship for that enzyme, out of " "several possible relationships" ), description=( "For example where an enzyme strongly bonds with a particular " "substance, this is a defining relationship for that enzyme, out of " "several possible substance relationships." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) isDefining__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isDefining", title="Extension field for ``isDefining``." ) ratioHighLimitAmount: fhirtypes.RatioType | None = Field( default=None, alias="ratioHighLimitAmount", title="For use when the numeric has an uncertain range", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) source: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="source", title="Supporting literature", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) substanceDefinitionCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="substanceDefinitionCodeableConcept", title=( "A pointer to another substance, as a resource or a representational " "code" ), description=( "A pointer to another substance, as a resource or just a " "representational code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e substanceDefinition[x] "one_of_many": "substanceDefinition", "one_of_many_required": False, }, ) substanceDefinitionReference: fhirtypes.ReferenceType | None = Field( default=None, alias="substanceDefinitionReference", title=( "A pointer to another substance, as a resource or a representational " "code" ), description=( "A pointer to another substance, as a resource or just a " "representational code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e substanceDefinition[x] "one_of_many": "substanceDefinition", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SubstanceDefinition"], }, ) type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title='For example "salt to parent", "active moiety"', description=( 'For example "salt to parent", "active moiety", "starting material", ' '"polymorph", "impurity of".' ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceDefinitionRelationship`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "substanceDefinitionReference", "substanceDefinitionCodeableConcept", "type", "isDefining", "amountQuantity", "amountRatio", "amountString", "ratioHighLimitAmount", "comparator", "source", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionRelationship`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "substanceDefinitionReference", "substanceDefinitionCodeableConcept", "type", "isDefining", "amountQuantity", "amountRatio", "amountString", "ratioHighLimitAmount", "comparator", "source", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "amount": ["amountQuantity", "amountRatio", "amountString"], "substanceDefinition": [ "substanceDefinitionCodeableConcept", "substanceDefinitionReference", ], } return one_of_many_fields class SubstanceDefinitionSourceMaterial(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Material or taxonomic/anatomical source. Material or taxonomic/anatomical source for the substance. """ __resource_type__ = "SubstanceDefinitionSourceMaterial" countryOfOrigin: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="countryOfOrigin", title="The country or countries where the material is harvested", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) genus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="genus", title=( "The genus of an organism e.g. the Latin epithet of the plant/animal " "scientific name" ), description=( "The genus of an organism, typically referring to the Latin epithet of " "the genus element of the plant/animal scientific name." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) part: fhirtypes.CodeableConceptType | None = Field( default=None, alias="part", title="An anatomical origin of the source material within an organism", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) species: fhirtypes.CodeableConceptType | None = Field( default=None, alias="species", title=( "The species of an organism e.g. the Latin epithet of the species of " "the plant/animal" ), description=( "The species of an organism, typically referring to the Latin epithet " "of the species of the plant/animal." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title=( "Classification of the origin of the raw material. e.g. cat hair is an " "Animal source type" ), description=( "A classification that provides the origin of the raw material. " "Example: cat hair would be an Animal source type." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceDefinitionSourceMaterial`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "genus", "species", "part", "countryOfOrigin", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionSourceMaterial`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "type", "genus", "species", "part", "countryOfOrigin", ] class SubstanceDefinitionStructure(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Structural information. """ __resource_type__ = "SubstanceDefinitionStructure" molecularFormula: fhirtypes.StringType | None = Field( default=None, alias="molecularFormula", title=( "An expression which states the number and type of atoms present in a " "molecule of a substance" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) molecularFormula__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_molecularFormula", title="Extension field for ``molecularFormula``.", ) molecularFormulaByMoiety: fhirtypes.StringType | None = Field( default=None, alias="molecularFormulaByMoiety", title="Specified per moiety according to the Hill system", description=( "Specified per moiety according to the Hill system, i.e. first C, then " "H, then alphabetical, each moiety separated by a dot." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) molecularFormulaByMoiety__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_molecularFormulaByMoiety", title="Extension field for ``molecularFormulaByMoiety``.", ) molecularWeight: fhirtypes.SubstanceDefinitionMolecularWeightType | None = Field( default=None, alias="molecularWeight", title="The molecular weight or weight range", description=( "The molecular weight or weight range (for proteins, polymers or " "nucleic acids)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) opticalActivity: fhirtypes.CodeableConceptType | None = Field( default=None, alias="opticalActivity", title="Optical activity type", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) representation: typing.List[ fhirtypes.SubstanceDefinitionStructureRepresentationType ] | None = Field( default=None, alias="representation", title="A depiction of the structure of the substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sourceDocument: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="sourceDocument", title="Source of information for the structure", description="The source of information about the structure.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) stereochemistry: fhirtypes.CodeableConceptType | None = Field( default=None, alias="stereochemistry", title="Stereochemistry type", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) technique: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="technique", title="The method used to find the structure e.g. X-ray, NMR", description=( "The method used to elucidate the structure of the drug substance. " "Examples: X-ray, NMR, Peptide mapping, Ligand binding assay." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceDefinitionStructure`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "stereochemistry", "opticalActivity", "molecularFormula", "molecularFormulaByMoiety", "molecularWeight", "technique", "sourceDocument", "representation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionStructure`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "stereochemistry", "opticalActivity", "molecularFormula", "molecularFormulaByMoiety", "molecularWeight", "technique", "sourceDocument", "representation", ] class SubstanceDefinitionStructureRepresentation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A depiction of the structure of the substance. """ __resource_type__ = "SubstanceDefinitionStructureRepresentation" document: fhirtypes.ReferenceType | None = Field( default=None, alias="document", title=( "An attachment with the structural representation e.g. a structure " "graphic or AnIML file" ), description=( "An attached file with the structural representation e.g. a molecular " "structure graphic of the substance, a JCAMP or AnIML file." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) format: fhirtypes.CodeableConceptType | None = Field( default=None, alias="format", title=( "The format of the representation e.g. InChI, SMILES, MOLFILE (note: " "not the physical file format)" ), description=( "The format of the representation e.g. InChI, SMILES, MOLFILE, CDX, " "SDF, PDB, mmCIF. The logical content type rather than the physical " "file format of a document." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) representation: fhirtypes.StringType | None = Field( default=None, alias="representation", title="The structural representation as a text string in a standard format", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) representation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_representation", title="Extension field for ``representation``.", ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The kind of structural representation (e.g. full, partial)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceDefinitionStructureRepresentation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "representation", "format", "document", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionStructureRepresentation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "representation", "format", "document"] ================================================ FILE: fhir/resources/substancenucleicacid.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SubstanceNucleicAcid Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class SubstanceNucleicAcid(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Nucleic acids are defined by three distinct elements: the base, sugar and linkage. Individual substance/moiety IDs will be created for each of these elements. The nucleotide sequence will be always entered in the 5’-3’ direction. """ __resource_type__ = "SubstanceNucleicAcid" areaOfHybridisation: fhirtypes.StringType | None = Field( default=None, alias="areaOfHybridisation", title=( "The area of hybridisation shall be described if applicable for double " "stranded RNA or DNA. The number associated with the subunit followed " "by the number associated to the residue shall be specified in " "increasing order. The underscore \u201c\u201d shall be used as separator as " "follows: \u201cSubunitnumber Residue\u201d" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) areaOfHybridisation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_areaOfHybridisation", title="Extension field for ``areaOfHybridisation``.", ) numberOfSubunits: fhirtypes.IntegerType | None = Field( default=None, alias="numberOfSubunits", title=( "The number of linear sequences of nucleotides linked through " "phosphodiester bonds shall be described. Subunits would be strands of " "nucleic acids that are tightly associated typically through Watson-" "Crick base pairing. NOTE: If not specified in the reference source, " "the assumption is that there is 1 subunit" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) numberOfSubunits__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_numberOfSubunits", title="Extension field for ``numberOfSubunits``.", ) oligoNucleotideType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="oligoNucleotideType", title="(TBC)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sequenceType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="sequenceType", title=( "The type of the sequence shall be specified based on a controlled " "vocabulary" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subunit: typing.List[fhirtypes.SubstanceNucleicAcidSubunitType] | None = Field( default=None, alias="subunit", title=( "Subunits are listed in order of decreasing length; sequences of the " "same length will be ordered by molecular weight; subunits that have " "identical sequences will be repeated multiple times" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceNucleicAcid`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "sequenceType", "numberOfSubunits", "areaOfHybridisation", "oligoNucleotideType", "subunit", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceNucleicAcid`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "sequenceType", "numberOfSubunits", "areaOfHybridisation", "oligoNucleotideType", "subunit", ] class SubstanceNucleicAcidSubunit(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Subunits are listed in order of decreasing length; sequences of the same length will be ordered by molecular weight; subunits that have identical sequences will be repeated multiple times. """ __resource_type__ = "SubstanceNucleicAcidSubunit" fivePrime: fhirtypes.CodeableConceptType | None = Field( default=None, alias="fivePrime", title=( "The nucleotide present at the 5\u2019 terminal shall be specified based on " "a controlled vocabulary. Since the sequence is represented from the 5'" " to the 3' end, the 5\u2019 prime nucleotide is the letter at the first " "position in the sequence. A separate representation would be redundant" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) length: fhirtypes.IntegerType | None = Field( default=None, alias="length", title="The length of the sequence shall be captured", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) length__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_length", title="Extension field for ``length``." ) linkage: typing.List[ fhirtypes.SubstanceNucleicAcidSubunitLinkageType ] | None = Field( default=None, alias="linkage", title="The linkages between sugar residues will also be captured", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sequence: fhirtypes.StringType | None = Field( default=None, alias="sequence", title=( "Actual nucleotide sequence notation from 5' to 3' end using standard " "single letter codes. In addition to the base sequence, sugar and type " "of phosphate or non-phosphate linkage should also be captured" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) sequenceAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="sequenceAttachment", title="(TBC)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subunit: fhirtypes.IntegerType | None = Field( default=None, alias="subunit", title=( "Index of linear sequences of nucleic acids in order of decreasing " "length. Sequences of the same length will be ordered by molecular " "weight. Subunits that have identical sequences will be repeated and " "have sequential subscripts" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subunit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subunit", title="Extension field for ``subunit``." ) sugar: typing.List[fhirtypes.SubstanceNucleicAcidSubunitSugarType] | None = Field( default=None, alias="sugar", title="5.3.6.8.1 Sugar ID (Mandatory)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) threePrime: fhirtypes.CodeableConceptType | None = Field( default=None, alias="threePrime", title=( "The nucleotide present at the 3\u2019 terminal shall be specified based on " "a controlled vocabulary. Since the sequence is represented from the 5'" " to the 3' end, the 5\u2019 prime nucleotide is the letter at the last " "position in the sequence. A separate representation would be redundant" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceNucleicAcidSubunit`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "subunit", "sequence", "length", "sequenceAttachment", "fivePrime", "threePrime", "linkage", "sugar", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceNucleicAcidSubunit`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "subunit", "sequence", "length", "sequenceAttachment", "fivePrime", "threePrime", "linkage", "sugar", ] class SubstanceNucleicAcidSubunitLinkage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The linkages between sugar residues will also be captured. """ __resource_type__ = "SubstanceNucleicAcidSubunitLinkage" connectivity: fhirtypes.StringType | None = Field( default=None, alias="connectivity", title=( "The entity that links the sugar residues together should also be " "captured for nearly all naturally occurring nucleic acid the linkage " "is a phosphate group. For many synthetic oligonucleotides " "phosphorothioate linkages are often seen. Linkage connectivity is " "assumed to be 3\u2019-5\u2019. If the linkage is either 3\u2019-3\u2019 or 5\u2019-5\u2019 this " "should be specified" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) connectivity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_connectivity", title="Extension field for ``connectivity``.", ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="Each linkage will be registered as a fragment and have an ID", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title=( "Each linkage will be registered as a fragment and have at least one " "name. A single name shall be assigned to each linkage" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) residueSite: fhirtypes.StringType | None = Field( default=None, alias="residueSite", title="Residues shall be captured as described in 5.3.6.8.3", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) residueSite__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_residueSite", title="Extension field for ``residueSite``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceNucleicAcidSubunitLinkage`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "connectivity", "identifier", "name", "residueSite", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceNucleicAcidSubunitLinkage`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "connectivity", "identifier", "name", "residueSite", ] class SubstanceNucleicAcidSubunitSugar(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. 5.3.6.8.1 Sugar ID (Mandatory). """ __resource_type__ = "SubstanceNucleicAcidSubunitSugar" identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title=( "The Substance ID of the sugar or sugar-like component that make up the" " nucleotide" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title=( "The name of the sugar or sugar-like component that make up the " "nucleotide" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) residueSite: fhirtypes.StringType | None = Field( default=None, alias="residueSite", title=( "The residues that contain a given sugar will be captured. The order of" " given residues will be captured in the 5\u2018-3\u2018direction consistent with" " the base sequences listed above" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) residueSite__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_residueSite", title="Extension field for ``residueSite``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceNucleicAcidSubunitSugar`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "name", "residueSite", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceNucleicAcidSubunitSugar`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "identifier", "name", "residueSite"] ================================================ FILE: fhir/resources/substancepolymer.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SubstancePolymer Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class SubstancePolymer(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Properties of a substance specific to it being a polymer. """ __resource_type__ = "SubstancePolymer" class_fhir: fhirtypes.CodeableConceptType | None = Field( default=None, alias="class", title="Overall type of the polymer", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copolymerConnectivity: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="copolymerConnectivity", title="Descrtibes the copolymer sequence type (polymer connectivity)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) geometry: fhirtypes.CodeableConceptType | None = Field( default=None, alias="geometry", title=( "Polymer geometry, e.g. linear, branched, cross-linked, network or " "dendritic" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title=( "A business idenfier for this polymer, but typically this is handled by" " a SubstanceDefinition identifier" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) modification: fhirtypes.StringType | None = Field( default=None, alias="modification", title=( "Todo - this is intended to connect to a repeating full modification " "structure, also used by Protein and Nucleic Acid . String is just a " "placeholder" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) modification__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_modification", title="Extension field for ``modification``.", ) monomerSet: typing.List[fhirtypes.SubstancePolymerMonomerSetType] | None = Field( default=None, alias="monomerSet", title="Todo", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) repeat: typing.List[fhirtypes.SubstancePolymerRepeatType] | None = Field( default=None, alias="repeat", title="Specifies and quantifies the repeated units and their configuration", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstancePolymer`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "class", "geometry", "copolymerConnectivity", "modification", "monomerSet", "repeat", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstancePolymer`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "class", "geometry", "copolymerConnectivity", "modification", "monomerSet", "repeat", ] class SubstancePolymerMonomerSet(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Todo. """ __resource_type__ = "SubstancePolymerMonomerSet" ratioType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="ratioType", title=( "Captures the type of ratio to the entire polymer, e.g. Monomer/Polymer" " ratio, SRU/Polymer Ratio" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) startingMaterial: typing.List[ fhirtypes.SubstancePolymerMonomerSetStartingMaterialType ] | None = Field( default=None, alias="startingMaterial", title=( "The starting materials - monomer(s) used in the synthesis of the " "polymer" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstancePolymerMonomerSet`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "ratioType", "startingMaterial"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstancePolymerMonomerSet`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "ratioType", "startingMaterial"] class SubstancePolymerMonomerSetStartingMaterial(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The starting materials - monomer(s) used in the synthesis of the polymer. """ __resource_type__ = "SubstancePolymerMonomerSetStartingMaterial" amount: fhirtypes.QuantityType | None = Field( default=None, alias="amount", title="A percentage", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="Substance high level category, e.g. chemical substance", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="The type of substance for this starting material", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) isDefining: bool | None = Field( default=None, alias="isDefining", title=( "Used to specify whether the attribute described is a defining element " "for the unique identification of the polymer" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) isDefining__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isDefining", title="Extension field for ``isDefining``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstancePolymerMonomerSetStartingMaterial`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "category", "isDefining", "amount", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstancePolymerMonomerSetStartingMaterial`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "category", "isDefining", "amount"] class SubstancePolymerRepeat(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Specifies and quantifies the repeated units and their configuration. """ __resource_type__ = "SubstancePolymerRepeat" averageMolecularFormula: fhirtypes.StringType | None = Field( default=None, alias="averageMolecularFormula", title="A representation of an (average) molecular formula from a polymer", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) averageMolecularFormula__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_averageMolecularFormula", title="Extension field for ``averageMolecularFormula``.", ) repeatUnit: typing.List[ fhirtypes.SubstancePolymerRepeatRepeatUnitType ] | None = Field( default=None, alias="repeatUnit", title="An SRU - Structural Repeat Unit", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) repeatUnitAmountType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="repeatUnitAmountType", title=( "How the quantitative amount of Structural Repeat Units is captured " "(e.g. Exact, Numeric, Average)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstancePolymerRepeat`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "averageMolecularFormula", "repeatUnitAmountType", "repeatUnit", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstancePolymerRepeat`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "averageMolecularFormula", "repeatUnitAmountType", "repeatUnit", ] class SubstancePolymerRepeatRepeatUnit(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An SRU - Structural Repeat Unit. """ __resource_type__ = "SubstancePolymerRepeatRepeatUnit" amount: fhirtypes.IntegerType | None = Field( default=None, alias="amount", title="Number of repeats of this unit", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) amount__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_amount", title="Extension field for ``amount``." ) degreeOfPolymerisation: typing.List[ fhirtypes.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationType ] | None = Field( default=None, alias="degreeOfPolymerisation", title=( "Applies to homopolymer and block co-polymers where the degree of " "polymerisation within a block can be described" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) orientation: fhirtypes.CodeableConceptType | None = Field( default=None, alias="orientation", title=( "The orientation of the polymerisation, e.g. head-tail, head-head, " "random" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) structuralRepresentation: typing.List[ fhirtypes.SubstancePolymerRepeatRepeatUnitStructuralRepresentationType ] | None = Field( default=None, alias="structuralRepresentation", title="A graphical structure for this SRU", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) unit: fhirtypes.StringType | None = Field( default=None, alias="unit", title="Structural repeat units are essential elements for defining polymers", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) unit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_unit", title="Extension field for ``unit``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstancePolymerRepeatRepeatUnit`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "unit", "orientation", "amount", "degreeOfPolymerisation", "structuralRepresentation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstancePolymerRepeatRepeatUnit`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "unit", "orientation", "amount", "degreeOfPolymerisation", "structuralRepresentation", ] class SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisation( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Applies to homopolymer and block co-polymers where the degree of polymerisation within a block can be described. """ __resource_type__ = "SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisation" average: fhirtypes.IntegerType | None = Field( default=None, alias="average", title="An average amount of polymerisation", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) average__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_average", title="Extension field for ``average``." ) high: fhirtypes.IntegerType | None = Field( default=None, alias="high", title="A high expected limit of the amount", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) high__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_high", title="Extension field for ``high``." ) low: fhirtypes.IntegerType | None = Field( default=None, alias="low", title="A low expected limit of the amount", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) low__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_low", title="Extension field for ``low``." ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title=( "The type of the degree of polymerisation shall be described, e.g. " "SRU/Polymer Ratio" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "average", "low", "high", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "average", "low", "high"] class SubstancePolymerRepeatRepeatUnitStructuralRepresentation( backboneelement.BackboneElement ): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A graphical structure for this SRU. """ __resource_type__ = "SubstancePolymerRepeatRepeatUnitStructuralRepresentation" attachment: fhirtypes.AttachmentType | None = Field( default=None, alias="attachment", title="An attached file with the structural representation", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) format: fhirtypes.CodeableConceptType | None = Field( default=None, alias="format", title=( "The format of the representation e.g. InChI, SMILES, MOLFILE, CDX, " "SDF, PDB, mmCIF" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) representation: fhirtypes.StringType | None = Field( default=None, alias="representation", title=( "The structural representation as text string in a standard format e.g." " InChI, SMILES, MOLFILE, CDX, SDF, PDB, mmCIF" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) representation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_representation", title="Extension field for ``representation``.", ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="The type of structure (e.g. Full, Partial, Representative)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstancePolymerRepeatRepeatUnitStructuralRepresentation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "representation", "format", "attachment", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstancePolymerRepeatRepeatUnitStructuralRepresentation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "representation", "format", "attachment"] ================================================ FILE: fhir/resources/substanceprotein.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SubstanceProtein Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class SubstanceProtein(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A SubstanceProtein is defined as a single unit of a linear amino acid sequence, or a combination of subunits that are either covalently linked or have a defined invariant stoichiometric relationship. This includes all synthetic, recombinant and purified SubstanceProteins of defined sequence, whether the use is therapeutic or prophylactic. This set of elements will be used to describe albumins, coagulation factors, cytokines, growth factors, peptide/SubstanceProtein hormones, enzymes, toxins, toxoids, recombinant vaccines, and immunomodulators. """ __resource_type__ = "SubstanceProtein" disulfideLinkage: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="disulfideLinkage", title=( "The disulphide bond between two cysteine residues either on the same " "subunit or on two different subunits shall be described. The position " "of the disulfide bonds in the SubstanceProtein shall be listed in " "increasing order of subunit number and position within subunit " "followed by the abbreviation of the amino acids involved. The " "disulfide linkage positions shall actually contain the amino acid " "Cysteine at the respective positions" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) disulfideLinkage__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_disulfideLinkage", title="Extension field for ``disulfideLinkage``.", ) numberOfSubunits: fhirtypes.IntegerType | None = Field( default=None, alias="numberOfSubunits", title=( "Number of linear sequences of amino acids linked through peptide " "bonds. The number of subunits constituting the SubstanceProtein shall " "be described. It is possible that the number of subunits can be " "variable" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) numberOfSubunits__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_numberOfSubunits", title="Extension field for ``numberOfSubunits``.", ) sequenceType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="sequenceType", title=( "The SubstanceProtein descriptive elements will only be used when a " "complete or partial amino acid sequence is available or derivable from" " a nucleic acid sequence" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subunit: typing.List[fhirtypes.SubstanceProteinSubunitType] | None = Field( default=None, alias="subunit", title=( "This subclause refers to the description of each subunit constituting " "the SubstanceProtein. A subunit is a linear sequence of amino acids " "linked through peptide bonds. The Subunit information shall be " "provided when the finished SubstanceProtein is a complex of multiple " "sequences; subunits are not used to delineate domains within a single " "sequence. Subunits are listed in order of decreasing length; sequences" " of the same length will be ordered by decreasing molecular weight; " "subunits that have identical sequences will be repeated multiple times" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceProtein`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "sequenceType", "numberOfSubunits", "disulfideLinkage", "subunit", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceProtein`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "sequenceType", "numberOfSubunits", "disulfideLinkage", "subunit", ] class SubstanceProteinSubunit(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. This subclause refers to the description of each subunit constituting the SubstanceProtein. A subunit is a linear sequence of amino acids linked through peptide bonds. The Subunit information shall be provided when the finished SubstanceProtein is a complex of multiple sequences; subunits are not used to delineate domains within a single sequence. Subunits are listed in order of decreasing length; sequences of the same length will be ordered by decreasing molecular weight; subunits that have identical sequences will be repeated multiple times. """ __resource_type__ = "SubstanceProteinSubunit" cTerminalModification: fhirtypes.StringType | None = Field( default=None, alias="cTerminalModification", title="The modification at the C-terminal shall be specified", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) cTerminalModification__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_cTerminalModification", title="Extension field for ``cTerminalModification``.", ) cTerminalModificationId: fhirtypes.IdentifierType | None = Field( default=None, alias="cTerminalModificationId", title=( "Unique identifier for molecular fragment modification based on the ISO" " 11238 Substance ID" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) length: fhirtypes.IntegerType | None = Field( default=None, alias="length", title="Length of linear sequences of amino acids contained in the subunit", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) length__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_length", title="Extension field for ``length``." ) nTerminalModification: fhirtypes.StringType | None = Field( default=None, alias="nTerminalModification", title=( "The name of the fragment modified at the N-terminal of the " "SubstanceProtein shall be specified" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) nTerminalModification__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_nTerminalModification", title="Extension field for ``nTerminalModification``.", ) nTerminalModificationId: fhirtypes.IdentifierType | None = Field( default=None, alias="nTerminalModificationId", title=( "Unique identifier for molecular fragment modification based on the ISO" " 11238 Substance ID" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sequence: fhirtypes.StringType | None = Field( default=None, alias="sequence", title=( "The sequence information shall be provided enumerating the amino acids" " from N- to C-terminal end using standard single-letter amino acid " "codes. Uppercase shall be used for L-amino acids and lowercase for " "D-amino acids. Transcribed SubstanceProteins will always be described " "using the translated sequence; for synthetic peptide containing amino " "acids that are not represented with a single letter code an X should " "be used within the sequence. The modified amino acids will be " "distinguished by their position in the sequence" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) sequenceAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="sequenceAttachment", title=( "The sequence information shall be provided enumerating the amino acids" " from N- to C-terminal end using standard single-letter amino acid " "codes. Uppercase shall be used for L-amino acids and lowercase for " "D-amino acids. Transcribed SubstanceProteins will always be described " "using the translated sequence; for synthetic peptide containing amino " "acids that are not represented with a single letter code an X should " "be used within the sequence. The modified amino acids will be " "distinguished by their position in the sequence" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subunit: fhirtypes.IntegerType | None = Field( default=None, alias="subunit", title=( "Index of primary sequences of amino acids linked through peptide bonds" " in order of decreasing length. Sequences of the same length will be " "ordered by molecular weight. Subunits that have identical sequences " "will be repeated and have sequential subscripts" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) subunit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subunit", title="Extension field for ``subunit``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceProteinSubunit`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "subunit", "sequence", "length", "sequenceAttachment", "nTerminalModificationId", "nTerminalModification", "cTerminalModificationId", "cTerminalModification", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceProteinSubunit`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "subunit", "sequence", "length", "sequenceAttachment", "nTerminalModificationId", "nTerminalModification", "cTerminalModificationId", "cTerminalModification", ] ================================================ FILE: fhir/resources/substancereferenceinformation.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SubstanceReferenceInformation Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class SubstanceReferenceInformation(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Todo. """ __resource_type__ = "SubstanceReferenceInformation" comment: fhirtypes.StringType | None = Field( default=None, alias="comment", title="Todo", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_comment", title="Extension field for ``comment``." ) gene: typing.List[fhirtypes.SubstanceReferenceInformationGeneType] | None = Field( default=None, alias="gene", title="Todo", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) geneElement: typing.List[ fhirtypes.SubstanceReferenceInformationGeneElementType ] | None = Field( default=None, alias="geneElement", title="Todo", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) target: typing.List[ fhirtypes.SubstanceReferenceInformationTargetType ] | None = Field( default=None, alias="target", title="Todo", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceReferenceInformation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "comment", "gene", "geneElement", "target", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceReferenceInformation`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "comment", "gene", "geneElement", "target", ] class SubstanceReferenceInformationGene(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Todo. """ __resource_type__ = "SubstanceReferenceInformationGene" gene: fhirtypes.CodeableConceptType | None = Field( default=None, alias="gene", title="Todo", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) geneSequenceOrigin: fhirtypes.CodeableConceptType | None = Field( default=None, alias="geneSequenceOrigin", title="Todo", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) source: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="source", title="Todo", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceReferenceInformationGene`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "geneSequenceOrigin", "gene", "source", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceReferenceInformationGene`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "geneSequenceOrigin", "gene", "source"] class SubstanceReferenceInformationGeneElement(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Todo. """ __resource_type__ = "SubstanceReferenceInformationGeneElement" element: fhirtypes.IdentifierType | None = Field( default=None, alias="element", title="Todo", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) source: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="source", title="Todo", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Todo", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceReferenceInformationGeneElement`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "element", "source"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceReferenceInformationGeneElement`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "element", "source"] class SubstanceReferenceInformationTarget(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Todo. """ __resource_type__ = "SubstanceReferenceInformationTarget" amountQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="amountQuantity", title="Todo", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e amount[x] "one_of_many": "amount", "one_of_many_required": False, }, ) amountRange: fhirtypes.RangeType | None = Field( default=None, alias="amountRange", title="Todo", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e amount[x] "one_of_many": "amount", "one_of_many_required": False, }, ) amountString: fhirtypes.StringType | None = Field( default=None, alias="amountString", title="Todo", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e amount[x] "one_of_many": "amount", "one_of_many_required": False, }, ) amountString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_amountString", title="Extension field for ``amountString``.", ) amountType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="amountType", title="Todo", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) interaction: fhirtypes.CodeableConceptType | None = Field( default=None, alias="interaction", title="Todo", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) organism: fhirtypes.CodeableConceptType | None = Field( default=None, alias="organism", title="Todo", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) organismType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="organismType", title="Todo", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) source: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="source", title="Todo", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["DocumentReference"], }, ) target: fhirtypes.IdentifierType | None = Field( default=None, alias="target", title="Todo", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Todo", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceReferenceInformationTarget`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "target", "type", "interaction", "organism", "organismType", "amountQuantity", "amountRange", "amountString", "amountType", "source", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceReferenceInformationTarget`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "target", "type", "interaction", "organism", "organismType", "amountQuantity", "amountRange", "amountString", "amountType", "source", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "amount": ["amountQuantity", "amountRange", "amountString"] } return one_of_many_fields ================================================ FILE: fhir/resources/substancesourcematerial.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SubstanceSourceMaterial Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class SubstanceSourceMaterial(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex. """ __resource_type__ = "SubstanceSourceMaterial" countryOfOrigin: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="countryOfOrigin", title=( "The country where the plant material is harvested or the countries " "where the plasma is sourced from as laid down in accordance with the " "Plasma Master File. For \u201cPlasma-derived substances\u201d the attribute " "country of origin provides information about the countries used for " "the manufacturing of the Cryopoor plama or Crioprecipitate" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) developmentStage: fhirtypes.CodeableConceptType | None = Field( default=None, alias="developmentStage", title=( "Stage of life for animals, plants, insects and microorganisms. This " "information shall be provided only when the substance is significantly" " different in these stages (e.g. foetal bovine serum)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) fractionDescription: typing.List[ fhirtypes.SubstanceSourceMaterialFractionDescriptionType ] | None = Field( default=None, alias="fractionDescription", title=( "Many complex materials are fractions of parts of plants, animals, or " "minerals. Fraction elements are often necessary to define both " "Substances and Specified Group 1 Substances. For substances derived " "from Plants, fraction information will be captured at the Substance " "information level ( . Oils, Juices and Exudates). Additional " "information for Extracts, such as extraction solvent composition, will" " be captured at the Specified Substance Group 1 information level. For" " plasma-derived products fraction information will be captured at the " "Substance and the Specified Substance Group 1 levels" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) geographicalLocation: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="geographicalLocation", title=( "The place/region where the plant is harvested or the places/regions " "where the animal source material has its habitat" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) geographicalLocation__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_geographicalLocation", title="Extension field for ``geographicalLocation``.", ) organism: fhirtypes.SubstanceSourceMaterialOrganismType | None = Field( default=None, alias="organism", title=( "This subclause describes the organism which the substance is derived " "from. For vaccines, the parent organism shall be specified based on " "these subclause elements. As an example, full taxonomy will be " "described for the Substance Name: ., Leaf" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) organismId: fhirtypes.IdentifierType | None = Field( default=None, alias="organismId", title=( "The unique identifier associated with the source material parent " "organism shall be specified" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) organismName: fhirtypes.StringType | None = Field( default=None, alias="organismName", title=( "The organism accepted Scientific name shall be provided based on the " "organism taxonomy" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) organismName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_organismName", title="Extension field for ``organismName``.", ) parentSubstanceId: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="parentSubstanceId", title=( "The parent of the herbal drug Ginkgo biloba, Leaf is the substance ID " "of the substance (fresh) of Ginkgo biloba L. or Ginkgo biloba L. " "(Whole plant)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) parentSubstanceName: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="parentSubstanceName", title="The parent substance of the Herbal Drug, or Herbal preparation", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) parentSubstanceName__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_parentSubstanceName", title="Extension field for ``parentSubstanceName``.", ) partDescription: typing.List[ fhirtypes.SubstanceSourceMaterialPartDescriptionType ] | None = Field( default=None, alias="partDescription", title="To do", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sourceMaterialClass: fhirtypes.CodeableConceptType | None = Field( default=None, alias="sourceMaterialClass", title=( "General high level classification of the source material specific to " "the origin of the material" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sourceMaterialState: fhirtypes.CodeableConceptType | None = Field( default=None, alias="sourceMaterialState", title="The state of the source material when extracted", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sourceMaterialType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="sourceMaterialType", title=( "The type of the source material shall be specified based on a " "controlled vocabulary. For vaccines, this subclause refers to the " "class of infectious agent" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceSourceMaterial`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "sourceMaterialClass", "sourceMaterialType", "sourceMaterialState", "organismId", "organismName", "parentSubstanceId", "parentSubstanceName", "countryOfOrigin", "geographicalLocation", "developmentStage", "fractionDescription", "organism", "partDescription", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceSourceMaterial`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "sourceMaterialClass", "sourceMaterialType", "sourceMaterialState", "organismId", "organismName", "parentSubstanceId", "parentSubstanceName", "countryOfOrigin", "geographicalLocation", "developmentStage", "fractionDescription", "organism", "partDescription", ] class SubstanceSourceMaterialFractionDescription(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Many complex materials are fractions of parts of plants, animals, or minerals. Fraction elements are often necessary to define both Substances and Specified Group 1 Substances. For substances derived from Plants, fraction information will be captured at the Substance information level ( . Oils, Juices and Exudates). Additional information for Extracts, such as extraction solvent composition, will be captured at the Specified Substance Group 1 information level. For plasma-derived products fraction information will be captured at the Substance and the Specified Substance Group 1 levels. """ __resource_type__ = "SubstanceSourceMaterialFractionDescription" fraction: fhirtypes.StringType | None = Field( default=None, alias="fraction", title=( "This element is capturing information about the fraction of a plant " "part, or human plasma for fractionation" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) fraction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_fraction", title="Extension field for ``fraction``." ) materialType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="materialType", title=( "The specific type of the material constituting the component. For " "Herbal preparations the particulars of the extracts (liquid/dry) is " "described in Specified Substance Group 1" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceSourceMaterialFractionDescription`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "fraction", "materialType"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceSourceMaterialFractionDescription`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "fraction", "materialType"] class SubstanceSourceMaterialOrganism(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. This subclause describes the organism which the substance is derived from. For vaccines, the parent organism shall be specified based on these subclause elements. As an example, full taxonomy will be described for the Substance Name: ., Leaf. """ __resource_type__ = "SubstanceSourceMaterialOrganism" author: typing.List[ fhirtypes.SubstanceSourceMaterialOrganismAuthorType ] | None = Field( default=None, alias="author", title="4.9.13.6.1 Author type (Conditional)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) family: fhirtypes.CodeableConceptType | None = Field( default=None, alias="family", title="The family of an organism shall be specified", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) genus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="genus", title=( "The genus of an organism shall be specified; refers to the Latin " "epithet of the genus element of the plant/animal scientific name; it " "is present in names for genera, species and infraspecies" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) hybrid: fhirtypes.SubstanceSourceMaterialOrganismHybridType | None = Field( default=None, alias="hybrid", title="4.9.13.8.1 Hybrid species maternal organism ID (Optional)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) intraspecificDescription: fhirtypes.StringType | None = Field( default=None, alias="intraspecificDescription", title=( "The intraspecific description of an organism shall be specified based " "on a controlled vocabulary. For Influenza Vaccine, the intraspecific " "description shall contain the syntax of the antigen in line with the " "WHO convention" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) intraspecificDescription__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intraspecificDescription", title="Extension field for ``intraspecificDescription``.", ) intraspecificType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="intraspecificType", title="The Intraspecific type of an organism shall be specified", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) organismGeneral: fhirtypes.SubstanceSourceMaterialOrganismOrganismGeneralType | None = Field( default=None, alias="organismGeneral", title="4.9.13.7.1 Kingdom (Conditional)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) species: fhirtypes.CodeableConceptType | None = Field( default=None, alias="species", title=( "The species of an organism shall be specified; refers to the Latin " "epithet of the species of the plant/animal; it is present in names for" " species and infraspecies" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceSourceMaterialOrganism`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "family", "genus", "species", "intraspecificType", "intraspecificDescription", "author", "hybrid", "organismGeneral", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceSourceMaterialOrganism`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "family", "genus", "species", "intraspecificType", "intraspecificDescription", "author", "hybrid", "organismGeneral", ] class SubstanceSourceMaterialOrganismAuthor(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. 4.9.13.6.1 Author type (Conditional). """ __resource_type__ = "SubstanceSourceMaterialOrganismAuthor" authorDescription: fhirtypes.StringType | None = Field( default=None, alias="authorDescription", title=( "The author of an organism species shall be specified. The author year " "of an organism shall also be specified when applicable; refers to the " "year in which the first author(s) published the infraspecific " "plant/animal name (of any rank)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authorDescription__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authorDescription", title="Extension field for ``authorDescription``.", ) authorType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="authorType", title=( "The type of author of an organism species shall be specified. The " "parenthetical author of an organism species refers to the first author" " who published the plant/animal name (of any rank). The primary author" " of an organism species refers to the first author(s), who validly " "published the plant/animal name" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceSourceMaterialOrganismAuthor`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "authorType", "authorDescription", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceSourceMaterialOrganismAuthor`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "authorType", "authorDescription"] class SubstanceSourceMaterialOrganismHybrid(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. 4.9.13.8.1 Hybrid species maternal organism ID (Optional). """ __resource_type__ = "SubstanceSourceMaterialOrganismHybrid" hybridType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="hybridType", title="The hybrid type of an organism shall be specified", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maternalOrganismId: fhirtypes.StringType | None = Field( default=None, alias="maternalOrganismId", title=( "The identifier of the maternal species constituting the hybrid " "organism shall be specified based on a controlled vocabulary. For " "plants, the parents aren\u2019t always known, and it is unlikely that it " "will be known which is maternal and which is paternal" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maternalOrganismId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maternalOrganismId", title="Extension field for ``maternalOrganismId``.", ) maternalOrganismName: fhirtypes.StringType | None = Field( default=None, alias="maternalOrganismName", title=( "The name of the maternal species constituting the hybrid organism " "shall be specified. For plants, the parents aren\u2019t always known, and " "it is unlikely that it will be known which is maternal and which is " "paternal" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maternalOrganismName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maternalOrganismName", title="Extension field for ``maternalOrganismName``.", ) paternalOrganismId: fhirtypes.StringType | None = Field( default=None, alias="paternalOrganismId", title=( "The identifier of the paternal species constituting the hybrid " "organism shall be specified based on a controlled vocabulary" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) paternalOrganismId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_paternalOrganismId", title="Extension field for ``paternalOrganismId``.", ) paternalOrganismName: fhirtypes.StringType | None = Field( default=None, alias="paternalOrganismName", title=( "The name of the paternal species constituting the hybrid organism " "shall be specified" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) paternalOrganismName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_paternalOrganismName", title="Extension field for ``paternalOrganismName``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceSourceMaterialOrganismHybrid`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "maternalOrganismId", "maternalOrganismName", "paternalOrganismId", "paternalOrganismName", "hybridType", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceSourceMaterialOrganismHybrid`` according to specification, with preserving the original sequence order. """ return [ "modifierExtension", "maternalOrganismId", "maternalOrganismName", "paternalOrganismId", "paternalOrganismName", "hybridType", ] class SubstanceSourceMaterialOrganismOrganismGeneral(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. 4.9.13.7.1 Kingdom (Conditional). """ __resource_type__ = "SubstanceSourceMaterialOrganismOrganismGeneral" class_fhir: fhirtypes.CodeableConceptType | None = Field( default=None, alias="class", title="The class of an organism shall be specified", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) kingdom: fhirtypes.CodeableConceptType | None = Field( default=None, alias="kingdom", title="The kingdom of an organism shall be specified", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) order: fhirtypes.CodeableConceptType | None = Field( default=None, alias="order", title="The order of an organism shall be specified,", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) phylum: fhirtypes.CodeableConceptType | None = Field( default=None, alias="phylum", title="The phylum of an organism shall be specified", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceSourceMaterialOrganismOrganismGeneral`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "kingdom", "phylum", "class", "order", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceSourceMaterialOrganismOrganismGeneral`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "kingdom", "phylum", "class", "order"] class SubstanceSourceMaterialPartDescription(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. To do. """ __resource_type__ = "SubstanceSourceMaterialPartDescription" part: fhirtypes.CodeableConceptType | None = Field( default=None, alias="part", title="Entity of anatomical origin of source material within an organism", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) partLocation: fhirtypes.CodeableConceptType | None = Field( default=None, alias="partLocation", title=( "The detailed anatomic location when the part can be extracted from " "different anatomical locations of the organism. Multiple alternative " "locations may apply" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SubstanceSourceMaterialPartDescription`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "part", "partLocation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SubstanceSourceMaterialPartDescription`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "part", "partLocation"] ================================================ FILE: fhir/resources/supplydelivery.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SupplyDelivery Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class SupplyDelivery(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Delivery of bulk Supplies. Record of delivery of what is supplied. """ __resource_type__ = "SupplyDelivery" basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Fulfills plan, proposal or order", description=( "A plan, proposal or order that is fulfilled in whole or in part by " "this event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SupplyRequest"], }, ) destination: fhirtypes.ReferenceType | None = Field( default=None, alias="destination", title="Where the delivery was sent", description=( "Identification of the facility/location where the delivery was shipped" " to." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External identifier", description=( "Identifier for the supply delivery event that is used to identify it " "across multiple disparate systems." ), json_schema_extra={ "element_property": True, }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When event occurred", description="The date or time(s) the activity occurred.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="When event occurred", description="The date or time(s) the activity occurred.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceTiming: fhirtypes.TimingType | None = Field( default=None, alias="occurrenceTiming", title="When event occurred", description="The date or time(s) the activity occurred.", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced event", description="A larger event of which this particular event is a component or step.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SupplyDelivery", "Contract"], }, ) patient: fhirtypes.ReferenceType | None = Field( default=None, alias="patient", title="Patient for whom the item is supplied", description=( "A link to a resource representing the person whom the delivered item " "is for." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) receiver: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="receiver", title="Who received the delivery", description="Identifies the individual or organization that received the delivery.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="in-progress | completed | abandoned | entered-in-error", description="A code specifying the state of the dispense event.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "in-progress", "completed", "abandoned", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) suppliedItem: typing.List[fhirtypes.SupplyDeliverySuppliedItemType] | None = Field( default=None, alias="suppliedItem", title="The item that is delivered or supplied", description="The item that is being delivered or has been supplied.", json_schema_extra={ "element_property": True, }, ) supplier: fhirtypes.ReferenceType | None = Field( default=None, alias="supplier", title="The item supplier", description="The individual or organization responsible for supplying the delivery.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) type: fhirtypes.CodeableConceptType | None = Field( default=None, alias="type", title="Category of supply event", description=( "Indicates the type of supply being provided. Examples include: " "Medication, Device, Biologically Derived Product." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SupplyDelivery`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "basedOn", "partOf", "status", "patient", "type", "suppliedItem", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "supplier", "destination", "receiver", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SupplyDelivery`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "basedOn", "partOf", "status", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "occurrence": ["occurrenceDateTime", "occurrencePeriod", "occurrenceTiming"] } return one_of_many_fields class SupplyDeliverySuppliedItem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The item that is delivered or supplied. The item that is being delivered or has been supplied. """ __resource_type__ = "SupplyDeliverySuppliedItem" itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="itemCodeableConcept", title="Medication, Substance, Device or Biologically Derived Product supplied", description=( "Identifies the medication, substance, device or biologically derived " "product being supplied. This is either a link to a resource " "representing the details of the item or a code that identifies the " "item from a known list." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": False, }, ) itemReference: fhirtypes.ReferenceType | None = Field( default=None, alias="itemReference", title="Medication, Substance, Device or Biologically Derived Product supplied", description=( "Identifies the medication, substance, device or biologically derived " "product being supplied. This is either a link to a resource " "representing the details of the item or a code that identifies the " "item from a known list." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e item[x] "one_of_many": "item", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Medication", "Substance", "Device", "BiologicallyDerivedProduct", "NutritionProduct", "InventoryItem", ], }, ) quantity: fhirtypes.QuantityType | None = Field( default=None, alias="quantity", title="Amount supplied", description=( "The amount of the item that has been supplied. Unit of measure may be" " included." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SupplyDeliverySuppliedItem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "quantity", "itemCodeableConcept", "itemReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SupplyDeliverySuppliedItem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"item": ["itemCodeableConcept", "itemReference"]} return one_of_many_fields ================================================ FILE: fhir/resources/supplyrequest.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/SupplyRequest Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class SupplyRequest(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Request for a medication, substance or device. A record of a request to deliver a medication, substance or device used in the healthcare setting to a particular destination for a particular person or organization. """ __resource_type__ = "SupplyRequest" authoredOn: fhirtypes.DateTimeType | None = Field( default=None, alias="authoredOn", title="When the request was made", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoredOn", title="Extension field for ``authoredOn``." ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="What other request is fulfilled by this supply request", description="Plan/proposal/order fulfilled by this request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) category: fhirtypes.CodeableConceptType | None = Field( default=None, alias="category", title="The kind of supply (central, non-stock, etc.)", description=( "Category of supply, e.g. central, non-stock, etc. This is used to " "support work flows associated with the supply process." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) deliverFor: fhirtypes.ReferenceType | None = Field( default=None, alias="deliverFor", title="The patient for who the supply request is for", description=( "The patient to whom the supply will be given or for whom they will be " "used." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) deliverFrom: fhirtypes.ReferenceType | None = Field( default=None, alias="deliverFrom", title="The origin of the supply", description="Where the supply is expected to come from.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization", "Location"], }, ) deliverTo: fhirtypes.ReferenceType | None = Field( default=None, alias="deliverTo", title="The destination of the supply", description="Where the supply is destined to go.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Organization", "Location", "Patient", "RelatedPerson", ], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for SupplyRequest", description=( "Business identifiers assigned to this SupplyRequest by the author " "and/or other systems. These identifiers remain constant as the " "resource is updated and propagates from server to server." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) item: fhirtypes.CodeableReferenceType = Field( default=..., alias="item", title="Medication, Substance, or Device requested to be supplied", description=( "The item that is requested to be supplied. This is either a link to a " "resource representing the details of the item or a code that " "identifies the item from a known list." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Medication", "Substance", "Device", "DeviceDefinition", "BiologicallyDerivedProduct", "NutritionProduct", "InventoryItem", ], }, ) occurrenceDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="occurrenceDateTime", title="When the request should be fulfilled", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_occurrenceDateTime", title="Extension field for ``occurrenceDateTime``.", ) occurrencePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="occurrencePeriod", title="When the request should be fulfilled", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) occurrenceTiming: fhirtypes.TimingType | None = Field( default=None, alias="occurrenceTiming", title="When the request should be fulfilled", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e occurrence[x] "one_of_many": "occurrence", "one_of_many_required": False, }, ) parameter: typing.List[fhirtypes.SupplyRequestParameterType] | None = Field( default=None, alias="parameter", title="Ordered item details", description=( "Specific parameters for the ordered item. For example, the size of " "the indicated item." ), json_schema_extra={ "element_property": True, }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Indicates how quickly this SupplyRequest should be addressed with " "respect to other requests." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) quantity: fhirtypes.QuantityType = Field( default=..., alias="quantity", title="The requested amount of the item indicated", description="The amount that is being ordered of the indicated item.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="reason", title="The reason why the supply item was requested", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Condition", "Observation", "DiagnosticReport", "DocumentReference", ], }, ) requester: fhirtypes.ReferenceType | None = Field( default=None, alias="requester", title="Individual making the request", description="The device, practitioner, etc. who initiated the request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "Patient", "RelatedPerson", "Device", "CareTeam", ], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | suspended +", description="Status of the supply request.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "suspended", "+"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) supplier: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="supplier", title="Who is intended to fulfill the request", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization", "HealthcareService"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SupplyRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "basedOn", "category", "priority", "deliverFor", "item", "quantity", "parameter", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "authoredOn", "requester", "supplier", "reason", "deliverFrom", "deliverTo", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SupplyRequest`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "status", "basedOn", "category", "priority", "item", "quantity", "occurrenceDateTime", "occurrencePeriod", "occurrenceTiming", "authoredOn", "requester", "supplier", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "occurrence": ["occurrenceDateTime", "occurrencePeriod", "occurrenceTiming"] } return one_of_many_fields class SupplyRequestParameter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Ordered item details. Specific parameters for the ordered item. For example, the size of the indicated item. """ __resource_type__ = "SupplyRequestParameter" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Item detail", description="A code or string that identifies the device detail being asserted.", json_schema_extra={ "element_property": True, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value of detail", description="The value of the device detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Value of detail", description="The value of the device detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Value of detail", description="The value of the device detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Value of detail", description="The value of the device detail.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``SupplyRequestParameter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "valueCodeableConcept", "valueQuantity", "valueRange", "valueBoolean", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``SupplyRequestParameter`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueCodeableConcept", "valueQuantity", "valueRange", ] } return one_of_many_fields ================================================ FILE: fhir/resources/task.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Task Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Task(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A task to be performed. """ __resource_type__ = "Task" authoredOn: fhirtypes.DateTimeType | None = Field( default=None, alias="authoredOn", title="Task Creation Date", description="The date and time this task was created.", json_schema_extra={ "element_property": True, }, ) authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoredOn", title="Extension field for ``authoredOn``." ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Request fulfilled by this task", description=( "BasedOn refers to a higher-level authorization that triggered the " 'creation of the task. It references a "request" resource such as a ' "ServiceRequest, MedicationRequest, CarePlan, etc. which is distinct " 'from the "request" resource the task is seeking to fulfill. This ' "latter resource is referenced by focus. For example, based on a " "CarePlan (= basedOn), a task is created to fulfill a ServiceRequest ( " "= focus ) to collect a specimen from a patient." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) businessStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="businessStatus", title='E.g. "Specimen collected", "IV prepped"', description="Contains business-specific nuances of the business state.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Task Type", description="A name or code (or both) briefly describing what the task involves.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Human-readable explanation of task", description="A free-text description of what is to be performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) doNotPerform: bool | None = Field( default=None, alias="doNotPerform", title="True if Task is prohibiting action", description=( "If true indicates that the Task is asking for the specified action to " "*not* occur." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_doNotPerform", title="Extension field for ``doNotPerform``.", ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Healthcare event during which this task originated", description=( "The healthcare event (e.g. a patient and healthcare provider " "interaction) during which this task was created." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) executionPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="executionPeriod", title="Start and end time of execution", description=( "Identifies the time action was first taken against the task (start) " "and/or the time final action was taken against the task prior to " "marking it as completed (end)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) focus: fhirtypes.ReferenceType | None = Field( default=None, alias="focus", title="What task is acting on", description=( "The request being fulfilled or the resource being manipulated " "(changed, suspended, etc.) by this task." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) for_fhir: fhirtypes.ReferenceType | None = Field( default=None, alias="for", title="Beneficiary of the Task", description=( "The entity who benefits from the performance of the service specified " "in the task (e.g., the patient)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) groupIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="groupIdentifier", title="Requisition or grouper id", description=( "A shared identifier common to multiple independent Task and Request " "instances that were activated/authorized more or less simultaneously " "by a single author. The presence of the same identifier on each " "request ties those requests together and may have business " "ramifications in terms of reporting of results, billing, etc. E.g. a " "requisition number shared by a set of lab tests ordered together, or a" " prescription number shared by all meds ordered at one time." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Task Instance Identifier", description="The business identifier for this task.", json_schema_extra={ "element_property": True, }, ) input: typing.List[fhirtypes.TaskInputType] | None = Field( default=None, alias="input", title="Information used to perform task", description=( "Additional information that may be needed in the execution of the " "task." ), json_schema_extra={ "element_property": True, }, ) instantiatesCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="instantiatesCanonical", title="Formal definition of task", description=( "The URL pointing to a *FHIR*-defined protocol, guideline, orderset or " "other definition that is adhered to in whole or in part by this Task." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ActivityDefinition"], }, ) instantiatesCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesUri: fhirtypes.UriType | None = Field( default=None, alias="instantiatesUri", title="Formal definition of task", description=( "The URL pointing to an *externally* maintained protocol, guideline, " "orderset or other definition that is adhered to in whole or in part by" " this Task." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) insurance: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="insurance", title="Associated insurance coverage", description=( "Insurance plans, coverage extensions, pre-authorizations and/or pre-" "determinations that may be relevant to the Task." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage", "ClaimResponse"], }, ) intent: fhirtypes.CodeType | None = Field( default=None, alias="intent", title=( "unknown | proposal | plan | order | original-order | reflex-order | " "filler-order | instance-order | option" ), description=( 'Indicates the "level" of actionability associated with the Task, i.e. ' "i+R[9]Cs this a proposed task, a planned task, an actionable task, " "etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "unknown", "proposal", "plan", "order", "original-order", "reflex-order", "filler-order", "instance-order", "option", ], }, ) intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intent", title="Extension field for ``intent``." ) lastModified: fhirtypes.DateTimeType | None = Field( default=None, alias="lastModified", title="Task Last Modified Date", description="The date and time of last modification to this task.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastModified__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastModified", title="Extension field for ``lastModified``.", ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where task occurs", description="Principal physical location where this task is performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the task", description="Free-text information captured about the task as it progresses.", json_schema_extra={ "element_property": True, }, ) output: typing.List[fhirtypes.TaskOutputType] | None = Field( default=None, alias="output", title="Information produced as part of task", description="Outputs produced by the Task.", json_schema_extra={ "element_property": True, }, ) owner: fhirtypes.ReferenceType | None = Field( default=None, alias="owner", title="Responsible individual", description="Party responsible for managing task execution.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", "Patient", "RelatedPerson", ], }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Composite task", description="Task that this particular task is part of.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Task"], }, ) performer: typing.List[fhirtypes.TaskPerformerType] | None = Field( default=None, alias="performer", title="Who or what performed the task", description="The entity who performed the requested task.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Indicates how quickly the Task should be addressed with respect to " "other requests." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="reason", title="Why task is needed", description=( "A description, code, or reference indicating why this task needs to be" " performed." ), json_schema_extra={ "element_property": True, }, ) relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="relevantHistory", title="Key events in history of the Task", description=( "Links to Provenance records for past versions of this Task that " "identify key state transitions or updates that are likely to be " "relevant to a user looking at the current version of the task." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Provenance"], }, ) requestedPerformer: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="requestedPerformer", title="Who should perform Task", description=( "The kind of participant or specific participant that should perform " "the task." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", "HealthcareService", "Patient", "Device", "RelatedPerson", ], }, ) requestedPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="requestedPeriod", title="When the task should be performed", description=( "Indicates the start and/or end of the period of time when completion " "of the task is desired to take place." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) requester: fhirtypes.ReferenceType | None = Field( default=None, alias="requester", title="Who is asking for task to be done", description="The creator of the task.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", ], }, ) restriction: fhirtypes.TaskRestrictionType | None = Field( default=None, alias="restriction", title="Constraints on fulfillment tasks", description=( "If the Task.focus is a request resource and the task is seeking " "fulfillment (i.e. is asking for the request to be actioned), this " "element identifies any limitations on what parts of the referenced " "request should be actioned." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | requested | received | accepted | +", description="The current status of the task.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "requested", "received", "accepted", "+"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusReason: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="statusReason", title="Reason for current status", description="An explanation as to why this task is held, failed, was refused, etc.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Task`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "groupIdentifier", "partOf", "status", "statusReason", "businessStatus", "intent", "priority", "doNotPerform", "code", "description", "focus", "for", "encounter", "requestedPeriod", "executionPeriod", "authoredOn", "lastModified", "requester", "requestedPerformer", "owner", "performer", "location", "reason", "insurance", "note", "relevantHistory", "restriction", "input", "output", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Task`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "instantiatesCanonical", "instantiatesUri", "basedOn", "groupIdentifier", "partOf", "status", "statusReason", "businessStatus", "intent", "doNotPerform", "code", "description", "focus", "for", "encounter", "requestedPeriod", "executionPeriod", "lastModified", "requester", "owner", "performer", "location", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("intent", "intent__ext"), ("status", "status__ext")] return required_fields class TaskInput(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information used to perform task. Additional information that may be needed in the execution of the task. """ __resource_type__ = "TaskInput" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Label for the input", description=( "A code or description indicating how the input is intended to be used " "as part of the task execution." ), json_schema_extra={ "element_property": True, }, ) valueAddress: fhirtypes.AddressType | None = Field( default=None, alias="valueAddress", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAge: fhirtypes.AgeType | None = Field( default=None, alias="valueAge", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="valueAnnotation", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAvailability: fhirtypes.AvailabilityType | None = Field( default=None, alias="valueAvailability", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="valueBase64Binary", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBase64Binary", title="Extension field for ``valueBase64Binary``.", ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="valueCanonical", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCanonical", title="Extension field for ``valueCanonical``.", ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCodeableReference: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="valueCodeableReference", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueContactDetail: fhirtypes.ContactDetailType | None = Field( default=None, alias="valueContactDetail", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="valueContactPoint", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCount: fhirtypes.CountType | None = Field( default=None, alias="valueCount", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDataRequirement: fhirtypes.DataRequirementType | None = Field( default=None, alias="valueDataRequirement", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueDistance: fhirtypes.DistanceType | None = Field( default=None, alias="valueDistance", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDosage: fhirtypes.DosageType | None = Field( default=None, alias="valueDosage", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDuration: fhirtypes.DurationType | None = Field( default=None, alias="valueDuration", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueExpression: fhirtypes.ExpressionType | None = Field( default=None, alias="valueExpression", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueExtendedContactDetail: fhirtypes.ExtendedContactDetailType | None = Field( default=None, alias="valueExtendedContactDetail", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="valueHumanName", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId: fhirtypes.IdType | None = Field( default=None, alias="valueId", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueId", title="Extension field for ``valueId``." ) valueIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="valueIdentifier", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInstant: fhirtypes.InstantType | None = Field( default=None, alias="valueInstant", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInstant", title="Extension field for ``valueInstant``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueInteger64: fhirtypes.Integer64Type | None = Field( default=None, alias="valueInteger64", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger64__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger64", title="Extension field for ``valueInteger64``.", ) valueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="valueMarkdown", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueMarkdown", title="Extension field for ``valueMarkdown``.", ) valueMeta: fhirtypes.MetaType | None = Field( default=None, alias="valueMeta", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueMoney: fhirtypes.MoneyType | None = Field( default=None, alias="valueMoney", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueOid: fhirtypes.OidType | None = Field( default=None, alias="valueOid", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueOid", title="Extension field for ``valueOid``." ) valueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field( default=None, alias="valueParameterDefinition", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="valuePositiveInt", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valuePositiveInt", title="Extension field for ``valuePositiveInt``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRatioRange: fhirtypes.RatioRangeType | None = Field( default=None, alias="valueRatioRange", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field( default=None, alias="valueRelatedArtifact", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="valueSampledData", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueSignature: fhirtypes.SignatureType | None = Field( default=None, alias="valueSignature", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) valueTiming: fhirtypes.TimingType | None = Field( default=None, alias="valueTiming", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field( default=None, alias="valueTriggerDefinition", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="valueUnsignedInt", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUnsignedInt", title="Extension field for ``valueUnsignedInt``.", ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) valueUrl: fhirtypes.UrlType | None = Field( default=None, alias="valueUrl", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUrl", title="Extension field for ``valueUrl``." ) valueUsageContext: fhirtypes.UsageContextType | None = Field( default=None, alias="valueUsageContext", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUuid: fhirtypes.UuidType | None = Field( default=None, alias="valueUuid", title="Content to use in performing the task", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUuid", title="Extension field for ``valueUuid``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TaskInput`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInstant", "valueInteger", "valueInteger64", "valueMarkdown", "valueOid", "valuePositiveInt", "valueString", "valueTime", "valueUnsignedInt", "valueUri", "valueUrl", "valueUuid", "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueCodeableConcept", "valueCodeableReference", "valueCoding", "valueContactPoint", "valueCount", "valueDistance", "valueDuration", "valueHumanName", "valueIdentifier", "valueMoney", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueRatioRange", "valueReference", "valueSampledData", "valueSignature", "valueTiming", "valueContactDetail", "valueDataRequirement", "valueExpression", "valueParameterDefinition", "valueRelatedArtifact", "valueTriggerDefinition", "valueUsageContext", "valueAvailability", "valueExtendedContactDetail", "valueDosage", "valueMeta", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TaskInput`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueAvailability", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueCodeableConcept", "valueCodeableReference", "valueCoding", "valueContactDetail", "valueContactPoint", "valueCount", "valueDataRequirement", "valueDate", "valueDateTime", "valueDecimal", "valueDistance", "valueDosage", "valueDuration", "valueExpression", "valueExtendedContactDetail", "valueHumanName", "valueId", "valueIdentifier", "valueInstant", "valueInteger", "valueInteger64", "valueMarkdown", "valueMeta", "valueMoney", "valueOid", "valueParameterDefinition", "valuePeriod", "valuePositiveInt", "valueQuantity", "valueRange", "valueRatio", "valueRatioRange", "valueReference", "valueRelatedArtifact", "valueSampledData", "valueSignature", "valueString", "valueTime", "valueTiming", "valueTriggerDefinition", "valueUnsignedInt", "valueUri", "valueUrl", "valueUsageContext", "valueUuid", ] } return one_of_many_fields class TaskOutput(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information produced as part of task. Outputs produced by the Task. """ __resource_type__ = "TaskOutput" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Label for output", description="The name of the Output parameter.", json_schema_extra={ "element_property": True, }, ) valueAddress: fhirtypes.AddressType | None = Field( default=None, alias="valueAddress", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAge: fhirtypes.AgeType | None = Field( default=None, alias="valueAge", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="valueAnnotation", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAvailability: fhirtypes.AvailabilityType | None = Field( default=None, alias="valueAvailability", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="valueBase64Binary", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBase64Binary", title="Extension field for ``valueBase64Binary``.", ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="valueCanonical", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCanonical", title="Extension field for ``valueCanonical``.", ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCodeableReference: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="valueCodeableReference", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueContactDetail: fhirtypes.ContactDetailType | None = Field( default=None, alias="valueContactDetail", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="valueContactPoint", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCount: fhirtypes.CountType | None = Field( default=None, alias="valueCount", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDataRequirement: fhirtypes.DataRequirementType | None = Field( default=None, alias="valueDataRequirement", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueDistance: fhirtypes.DistanceType | None = Field( default=None, alias="valueDistance", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDosage: fhirtypes.DosageType | None = Field( default=None, alias="valueDosage", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDuration: fhirtypes.DurationType | None = Field( default=None, alias="valueDuration", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueExpression: fhirtypes.ExpressionType | None = Field( default=None, alias="valueExpression", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueExtendedContactDetail: fhirtypes.ExtendedContactDetailType | None = Field( default=None, alias="valueExtendedContactDetail", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="valueHumanName", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId: fhirtypes.IdType | None = Field( default=None, alias="valueId", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueId", title="Extension field for ``valueId``." ) valueIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="valueIdentifier", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInstant: fhirtypes.InstantType | None = Field( default=None, alias="valueInstant", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInstant", title="Extension field for ``valueInstant``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueInteger64: fhirtypes.Integer64Type | None = Field( default=None, alias="valueInteger64", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger64__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger64", title="Extension field for ``valueInteger64``.", ) valueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="valueMarkdown", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueMarkdown", title="Extension field for ``valueMarkdown``.", ) valueMeta: fhirtypes.MetaType | None = Field( default=None, alias="valueMeta", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueMoney: fhirtypes.MoneyType | None = Field( default=None, alias="valueMoney", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueOid: fhirtypes.OidType | None = Field( default=None, alias="valueOid", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueOid", title="Extension field for ``valueOid``." ) valueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field( default=None, alias="valueParameterDefinition", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="valuePositiveInt", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valuePositiveInt", title="Extension field for ``valuePositiveInt``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRatioRange: fhirtypes.RatioRangeType | None = Field( default=None, alias="valueRatioRange", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field( default=None, alias="valueRelatedArtifact", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="valueSampledData", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueSignature: fhirtypes.SignatureType | None = Field( default=None, alias="valueSignature", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) valueTiming: fhirtypes.TimingType | None = Field( default=None, alias="valueTiming", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field( default=None, alias="valueTriggerDefinition", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="valueUnsignedInt", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUnsignedInt", title="Extension field for ``valueUnsignedInt``.", ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) valueUrl: fhirtypes.UrlType | None = Field( default=None, alias="valueUrl", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUrl", title="Extension field for ``valueUrl``." ) valueUsageContext: fhirtypes.UsageContextType | None = Field( default=None, alias="valueUsageContext", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUuid: fhirtypes.UuidType | None = Field( default=None, alias="valueUuid", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUuid", title="Extension field for ``valueUuid``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TaskOutput`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInstant", "valueInteger", "valueInteger64", "valueMarkdown", "valueOid", "valuePositiveInt", "valueString", "valueTime", "valueUnsignedInt", "valueUri", "valueUrl", "valueUuid", "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueCodeableConcept", "valueCodeableReference", "valueCoding", "valueContactPoint", "valueCount", "valueDistance", "valueDuration", "valueHumanName", "valueIdentifier", "valueMoney", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueRatioRange", "valueReference", "valueSampledData", "valueSignature", "valueTiming", "valueContactDetail", "valueDataRequirement", "valueExpression", "valueParameterDefinition", "valueRelatedArtifact", "valueTriggerDefinition", "valueUsageContext", "valueAvailability", "valueExtendedContactDetail", "valueDosage", "valueMeta", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TaskOutput`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueAvailability", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueCodeableConcept", "valueCodeableReference", "valueCoding", "valueContactDetail", "valueContactPoint", "valueCount", "valueDataRequirement", "valueDate", "valueDateTime", "valueDecimal", "valueDistance", "valueDosage", "valueDuration", "valueExpression", "valueExtendedContactDetail", "valueHumanName", "valueId", "valueIdentifier", "valueInstant", "valueInteger", "valueInteger64", "valueMarkdown", "valueMeta", "valueMoney", "valueOid", "valueParameterDefinition", "valuePeriod", "valuePositiveInt", "valueQuantity", "valueRange", "valueRatio", "valueRatioRange", "valueReference", "valueRelatedArtifact", "valueSampledData", "valueSignature", "valueString", "valueTime", "valueTiming", "valueTriggerDefinition", "valueUnsignedInt", "valueUri", "valueUrl", "valueUsageContext", "valueUuid", ] } return one_of_many_fields class TaskPerformer(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Who or what performed the task. The entity who performed the requested task. """ __resource_type__ = "TaskPerformer" actor: fhirtypes.ReferenceType = Field( default=..., alias="actor", title="Who performed the task", description="The actor or entity who performed the task.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", "Patient", "RelatedPerson", ], }, ) function: fhirtypes.CodeableConceptType | None = Field( default=None, alias="function", title="Type of performance", description="A code or description of the performer of the task.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TaskPerformer`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "function", "actor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TaskPerformer`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "function", "actor"] class TaskRestriction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Constraints on fulfillment tasks. If the Task.focus is a request resource and the task is seeking fulfillment (i.e. is asking for the request to be actioned), this element identifies any limitations on what parts of the referenced request should be actioned. """ __resource_type__ = "TaskRestriction" period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="When fulfillment is sought", description=( "The time-period for which fulfillment is sought. This must fall within" " the overall time period authorized in the referenced request. E.g. " "ServiceRequest.occurance[x]." ), json_schema_extra={ "element_property": True, }, ) recipient: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="recipient", title="For whom is fulfillment sought?", description=( "For requests that are targeted to more than one potential " "recipient/target, to identify who is fulfillment is sought for." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Group", "Organization", ], }, ) repetitions: fhirtypes.PositiveIntType | None = Field( default=None, alias="repetitions", title="How many times to repeat", description="Indicates the number of times the requested action should occur.", json_schema_extra={ "element_property": True, }, ) repetitions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_repetitions", title="Extension field for ``repetitions``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TaskRestriction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "repetitions", "period", "recipient", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TaskRestriction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/terminologycapabilities.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/TerminologyCapabilities Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class TerminologyCapabilities(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A statement of system capabilities. A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. """ __resource_type__ = "TerminologyCapabilities" closure: fhirtypes.TerminologyCapabilitiesClosureType | None = Field( default=None, alias="closure", title=( "Information about the [ConceptMap/$closure](conceptmap-operation-" "closure.html) operation" ), description="Whether the $closure operation is supported.", json_schema_extra={ "element_property": True, }, ) codeSearch: fhirtypes.CodeType | None = Field( default=None, alias="codeSearch", title="in-compose | in-expansion | in-compose-or-expansion", description=( "The degree to which the server supports the code search parameter on " "ValueSet, if it is supported." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["in-compose", "in-expansion", "in-compose-or-expansion"], }, ) codeSearch__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_codeSearch", title="Extension field for ``codeSearch``." ) codeSystem: typing.List[ fhirtypes.TerminologyCapabilitiesCodeSystemType ] | None = Field( default=None, alias="codeSystem", title="A code system supported by the server", description=( "Identifies a code system that is supported by the server. If there is " "a no code system URL, then this declares the general assumptions a " "client can make about support for any CodeSystem resource." ), json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the terminology capabilities and/or " "its contents. Copyright statements are generally legal restrictions on" " the use and publishing of the terminology capabilities." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the terminology capabilities was " "last significantly changed. The date must change when the business " "version changes and it must change if the status code changes. In " "addition, it should change when the substantive content of the " "terminology capabilities changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the terminology capabilities", description=( "A free text natural language description of the terminology " "capabilities from a consumer's perspective. Typically, this is used " "when the capability statement describes a desired rather than an " "actual solution, for example as a formal expression of requirements as" " part of an RFP." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) expansion: fhirtypes.TerminologyCapabilitiesExpansionType | None = Field( default=None, alias="expansion", title=( "Information about the [ValueSet/$expand](valueset-operation-" "expand.html) operation" ), description=None, json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this terminology capabilities is " "authored for testing purposes (or education/evaluation/marketing) and " "is not intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the terminology capabilities", description=( "A formal identifier that is used to identify this terminology " "capabilities when it is represented in other formats, or referenced in" " a specification, model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) implementation: fhirtypes.TerminologyCapabilitiesImplementationType | None = Field( default=None, alias="implementation", title="If this describes a specific instance", description=( "Identifies a specific implementation instance that is described by the" " terminology capability statement - i.e. a particular installation, " "rather than the capabilities of a software program." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for terminology capabilities (if applicable)", description=( "A legal or geographic region in which the terminology capabilities is " "intended to be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) kind: fhirtypes.CodeType | None = Field( default=None, alias="kind", title="instance | capability | requirements", description=( "The way that this statement is intended to be used, to describe an " "actual running instance of software, a particular product (kind, not " "instance of software) or a class of implementation (e.g. a desired " "purchase)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["instance", "capability", "requirements"], }, ) kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_kind", title="Extension field for ``kind``." ) lockedDate: bool | None = Field( default=None, alias="lockedDate", title="Whether lockedDate is supported", description="Whether the server supports lockedDate.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lockedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lockedDate", title="Extension field for ``lockedDate``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this terminology capabilities (computer friendly)", description=( "A natural language name identifying the terminology capabilities. This" " name should be usable as an identifier for the module by machine " "processing applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the terminology capabilities." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this terminology capabilities is defined", description=( "Explanation of why this terminology capabilities is needed and why it " "has been designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) software: fhirtypes.TerminologyCapabilitiesSoftwareType | None = Field( default=None, alias="software", title="Software that is covered by this terminology capability statement", description=( "Software that is covered by this terminology capability statement. It" " is used when the statement describes the capabilities of a particular" " software version, independent of an installation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this terminology capabilities. Enables tracking the " "life-cycle of the content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this terminology capabilities (human friendly)", description=( "A short, descriptive, user-friendly title for the terminology " "capabilities." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) translation: fhirtypes.TerminologyCapabilitiesTranslationType | None = Field( default=None, alias="translation", title=( "Information about the [ConceptMap/$translate](conceptmap-operation-" "translate.html) operation" ), description=None, json_schema_extra={ "element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this terminology capabilities, represented as" " a URI (globally unique)" ), description=( "An absolute URI that is used to identify this terminology capabilities" " when it is referenced in a specification, model, design or an " "instance; also called its canonical identifier. This SHOULD be " "globally unique and SHOULD be a literal address at which an " "authoritative instance of this terminology capabilities is (or will " "be) published. This URL can be the target of a canonical reference. It" " SHALL remain the same when the terminology capabilities is stored on " "different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate terminology capabilities " "instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) validateCode: fhirtypes.TerminologyCapabilitiesValidateCodeType | None = Field( default=None, alias="validateCode", title=( "Information about the [ValueSet/$validate-code](valueset-operation-" "validate-code.html) operation" ), description=None, json_schema_extra={ "element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the terminology capabilities", description=( "The identifier that is used to identify this version of the " "terminology capabilities when it is referenced in a specification, " "model, design or instance. This is an arbitrary value managed by the " "terminology capabilities author and is not expected to be globally " "unique. For example, it might be a timestamp (e.g. yyyymmdd) if a " "managed version is not available. There is also no expectation that " "versions can be placed in a lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TerminologyCapabilities`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "copyrightLabel", "kind", "software", "implementation", "lockedDate", "codeSystem", "expansion", "codeSearch", "validateCode", "translation", "closure", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TerminologyCapabilities`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "copyright", "kind", "software", "implementation", "lockedDate", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("date", "date__ext"), ("kind", "kind__ext"), ("status", "status__ext"), ] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields class TerminologyCapabilitiesClosure(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about the [ConceptMap/$closure](conceptmap-operation- closure.html) operation. Whether the $closure operation is supported. """ __resource_type__ = "TerminologyCapabilitiesClosure" translation: bool | None = Field( default=None, alias="translation", title="If cross-system closure is supported", description=None, json_schema_extra={ "element_property": True, }, ) translation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_translation", title="Extension field for ``translation``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TerminologyCapabilitiesClosure`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "translation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesClosure`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TerminologyCapabilitiesCodeSystem(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A code system supported by the server. Identifies a code system that is supported by the server. If there is a no code system URL, then this declares the general assumptions a client can make about support for any CodeSystem resource. """ __resource_type__ = "TerminologyCapabilitiesCodeSystem" content: fhirtypes.CodeType | None = Field( default=None, alias="content", title="not-present | example | fragment | complete | supplement", description=( "The extent of the content of the code system (the concepts and codes " "it defines) are represented in this resource instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "not-present", "example", "fragment", "complete", "supplement", ], }, ) content__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_content", title="Extension field for ``content``." ) subsumption: bool | None = Field( default=None, alias="subsumption", title="Whether subsumption is supported", description="True if subsumption is supported for this version of the code system.", json_schema_extra={ "element_property": True, }, ) subsumption__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subsumption", title="Extension field for ``subsumption``." ) uri: fhirtypes.CanonicalType | None = Field( default=None, alias="uri", title="Canonical identifier for the code system, represented as a URI", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CodeSystem"], }, ) uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uri", title="Extension field for ``uri``." ) version: typing.List[ fhirtypes.TerminologyCapabilitiesCodeSystemVersionType ] | None = Field( default=None, alias="version", title="Version of Code System supported", description=( "For the code system, a list of versions that are supported by the " "server." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TerminologyCapabilitiesCodeSystem`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "uri", "version", "content", "subsumption", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesCodeSystem`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "content"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("content", "content__ext")] return required_fields class TerminologyCapabilitiesCodeSystemVersion(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Version of Code System supported. For the code system, a list of versions that are supported by the server. """ __resource_type__ = "TerminologyCapabilitiesCodeSystemVersion" code: fhirtypes.StringType | None = Field( default=None, alias="code", title="Version identifier for this version", description=( "For version-less code systems, there should be a single version with " "no identifier." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) compositional: bool | None = Field( default=None, alias="compositional", title="If compositional grammar is supported", description="If the compositional grammar defined by the code system is supported.", json_schema_extra={ "element_property": True, }, ) compositional__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_compositional", title="Extension field for ``compositional``.", ) filter: typing.List[ fhirtypes.TerminologyCapabilitiesCodeSystemVersionFilterType ] | None = Field( default=None, alias="filter", title="Filter Properties supported", description=None, json_schema_extra={ "element_property": True, }, ) isDefault: bool | None = Field( default=None, alias="isDefault", title="If this is the default version for this code system", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) isDefault__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_isDefault", title="Extension field for ``isDefault``." ) language: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="language", title="Language Displays supported", description=None, json_schema_extra={ "element_property": True, }, ) language__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) property: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="property", title="Properties supported for $lookup", description=None, json_schema_extra={ "element_property": True, }, ) property__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_property", title="Extension field for ``property``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TerminologyCapabilitiesCodeSystemVersion`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "isDefault", "compositional", "language", "filter", "property", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesCodeSystemVersion`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "code", "isDefault"] class TerminologyCapabilitiesCodeSystemVersionFilter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Filter Properties supported. """ __resource_type__ = "TerminologyCapabilitiesCodeSystemVersionFilter" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Code of the property supported", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) op: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="op", title="Operations supported for the property", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) op__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_op", title="Extension field for ``op``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TerminologyCapabilitiesCodeSystemVersionFilter`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "op"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesCodeSystemVersionFilter`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext"), ("op", "op__ext")] return required_fields class TerminologyCapabilitiesExpansion(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about the [ValueSet/$expand](valueset-operation-expand.html) operation. """ __resource_type__ = "TerminologyCapabilitiesExpansion" hierarchical: bool | None = Field( default=None, alias="hierarchical", title="Whether the server can return nested value sets", description=None, json_schema_extra={ "element_property": True, }, ) hierarchical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_hierarchical", title="Extension field for ``hierarchical``.", ) incomplete: bool | None = Field( default=None, alias="incomplete", title="Allow request for incomplete expansions?", description="True if requests for incomplete expansions are allowed.", json_schema_extra={ "element_property": True, }, ) incomplete__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_incomplete", title="Extension field for ``incomplete``." ) paging: bool | None = Field( default=None, alias="paging", title="Whether the server supports paging on expansion", description=None, json_schema_extra={ "element_property": True, }, ) paging__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_paging", title="Extension field for ``paging``." ) parameter: typing.List[ fhirtypes.TerminologyCapabilitiesExpansionParameterType ] | None = Field( default=None, alias="parameter", title="Supported expansion parameter", description=None, json_schema_extra={ "element_property": True, }, ) textFilter: fhirtypes.MarkdownType | None = Field( default=None, alias="textFilter", title="Documentation about text searching works", description=None, json_schema_extra={ "element_property": True, }, ) textFilter__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_textFilter", title="Extension field for ``textFilter``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TerminologyCapabilitiesExpansion`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "hierarchical", "paging", "incomplete", "parameter", "textFilter", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesExpansion`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TerminologyCapabilitiesExpansionParameter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Supported expansion parameter. """ __resource_type__ = "TerminologyCapabilitiesExpansionParameter" documentation: fhirtypes.StringType | None = Field( default=None, alias="documentation", title="Description of support for parameter", description=None, json_schema_extra={ "element_property": True, }, ) documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_documentation", title="Extension field for ``documentation``.", ) name: fhirtypes.CodeType | None = Field( default=None, alias="name", title="Name of the supported expansion parameter", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TerminologyCapabilitiesExpansionParameter`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "documentation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesExpansionParameter`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields class TerminologyCapabilitiesImplementation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. If this describes a specific instance. Identifies a specific implementation instance that is described by the terminology capability statement - i.e. a particular installation, rather than the capabilities of a software program. """ __resource_type__ = "TerminologyCapabilitiesImplementation" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Describes this specific instance", description=( "Information about the specific installation that this terminology " "capability statement relates to." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) url: fhirtypes.UrlType | None = Field( default=None, alias="url", title="Base URL for the implementation", description="An absolute base URL for the implementation.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TerminologyCapabilitiesImplementation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "description", "url"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesImplementation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "description", "url"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("description", "description__ext")] return required_fields class TerminologyCapabilitiesSoftware(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Software that is covered by this terminology capability statement. Software that is covered by this terminology capability statement. It is used when the statement describes the capabilities of a particular software version, independent of an installation. """ __resource_type__ = "TerminologyCapabilitiesSoftware" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="A name the software is known by", description="Name the software is known by.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Version covered by this statement", description="The version identifier for the software covered by this statement.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TerminologyCapabilitiesSoftware`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "version"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesSoftware`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "name", "version"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields class TerminologyCapabilitiesTranslation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about the [ConceptMap/$translate](conceptmap-operation- translate.html) operation. """ __resource_type__ = "TerminologyCapabilitiesTranslation" needsMap: bool | None = Field( default=None, alias="needsMap", title="Whether the client must identify the map", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) needsMap__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_needsMap", title="Extension field for ``needsMap``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TerminologyCapabilitiesTranslation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "needsMap"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesTranslation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("needsMap", "needsMap__ext")] return required_fields class TerminologyCapabilitiesValidateCode(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about the [ValueSet/$validate-code](valueset-operation- validate-code.html) operation. """ __resource_type__ = "TerminologyCapabilitiesValidateCode" translations: bool | None = Field( default=None, alias="translations", title="Whether translations are validated", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) translations__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_translations", title="Extension field for ``translations``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TerminologyCapabilitiesValidateCode`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "translations"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesValidateCode`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("translations", "translations__ext")] return required_fields ================================================ FILE: fhir/resources/testplan.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/TestPlan Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class TestPlan(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Description of intented testing. A plan for executing testing on an artifact or specifications. """ __resource_type__ = "TestPlan" category: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="category", title="The category of the Test Plan - can be acceptance, unit, performance", description=( "The category of the Test Plan - can be acceptance, unit, performance, " "etc." ), json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the test plan and/or its contents. " "Copyright statements are generally legal restrictions on the use and " "publishing of the test plan. The short copyright declaration (e.g. (c)" " '2015+ xyz organization' should be sent in the copyrightLabel " "element." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the test plan was last " "significantly changed. The date must change when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the test plan changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) dependency: typing.List[fhirtypes.TestPlanDependencyType] | None = Field( default=None, alias="dependency", title=( "The required criteria to execute the test plan - e.g. preconditions, " "previous tests" ), description=( "The required criteria to execute the test plan - e.g. preconditions, " "previous tests..." ), json_schema_extra={ "element_property": True, }, ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the test plan", description=( "A free text natural language description of the test plan from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) exitCriteria: fhirtypes.MarkdownType | None = Field( default=None, alias="exitCriteria", title=( "The threshold or criteria for the test plan to be considered " "successfully executed - narrative" ), description=None, json_schema_extra={ "element_property": True, }, ) exitCriteria__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_exitCriteria", title="Extension field for ``exitCriteria``.", ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this test plan is authored for " "testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business identifier identifier for the test plan", description=( "A formal identifier that is used to identify this test plan when it is" " represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction where the test plan applies (if applicable)", description=( "A legal or geographic region in which the test plan is intended to be " "used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this test plan (computer friendly)", description=( "A natural language name identifying the test plan. This name should be" " usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the test plan." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this test plan is defined", description=( "Explanation of why this test plan is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) scope: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="scope", title=( "What is being tested with this Test Plan - a conformance resource, or " "narrative criteria, or an external reference" ), description=( "What is being tested with this Test Plan - a conformance resource, or " "narrative criteria, or an external reference..." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this test plan. Enables tracking the life-cycle of the " "content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) testCase: typing.List[fhirtypes.TestPlanTestCaseType] | None = Field( default=None, alias="testCase", title="The test cases that constitute this plan", description=( "The individual test cases that are part of this plan, when they they " "are made explicit." ), json_schema_extra={ "element_property": True, }, ) testTools: fhirtypes.MarkdownType | None = Field( default=None, alias="testTools", title=( "A description of test tools to be used in the test plan - narrative " "for now" ), description="A description of test tools to be used in the test plan.", json_schema_extra={ "element_property": True, }, ) testTools__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_testTools", title="Extension field for ``testTools``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this test plan (human friendly)", description="A short, descriptive, user-friendly title for the test plan.", json_schema_extra={ "element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this test plan, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this test plan when it is " "referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which an authoritative instance of this" " test plan is (or will be) published. This URL can be the target of a " "canonical reference. It SHALL remain the same when the test plan is " "stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate test plan instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the test plan", description=( "The identifier that is used to identify this version of the test plan " "when it is referenced in a specification, model, design or instance. " "This is an arbitrary value managed by the test plan author and is not " "expected to be globally unique. For example, it might be a timestamp " "(e.g. yyyymmdd) if a managed version is not available. There is also " "no expectation that versions can be placed in a lexicographical " "sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestPlan`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "copyrightLabel", "category", "scope", "testTools", "dependency", "exitCriteria", "testCase", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestPlan`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields class TestPlanDependency(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The required criteria to execute the test plan - e.g. preconditions, previous tests. The required criteria to execute the test plan - e.g. preconditions, previous tests... """ __resource_type__ = "TestPlanDependency" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Description of the dependency criterium", description=( "A textual description of the criterium - what is needed for the " "dependency to be considered met." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) predecessor: fhirtypes.ReferenceType | None = Field( default=None, alias="predecessor", title="Link to predecessor test plans", description=( "Predecessor test plans - those that are expected to be successfully " "performed as a dependency for the execution of this test plan." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestPlanDependency`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "description", "predecessor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestPlanDependency`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestPlanTestCase(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The test cases that constitute this plan. The individual test cases that are part of this plan, when they they are made explicit. """ __resource_type__ = "TestPlanTestCase" assertion: typing.List[fhirtypes.TestPlanTestCaseAssertionType] | None = Field( default=None, alias="assertion", title="Test assertions or expectations", description=( "The test assertions - the expectations of test results from the " "execution of the test case." ), json_schema_extra={ "element_property": True, }, ) dependency: typing.List[fhirtypes.TestPlanTestCaseDependencyType] | None = Field( default=None, alias="dependency", title="Required criteria to execute the test case", description=( "The required criteria to execute the test case - e.g. preconditions, " "previous tests." ), json_schema_extra={ "element_property": True, }, ) scope: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="scope", title="The scope or artifact covered by the case", description=( "The scope or artifact covered by the case, when the individual test " "case is associated with a testable artifact." ), json_schema_extra={ "element_property": True, }, ) sequence: fhirtypes.IntegerType | None = Field( default=None, alias="sequence", title="Sequence of test case in the test plan", description=( "Sequence of test case - an ordinal number that indicates the order for" " the present test case in the test plan." ), json_schema_extra={ "element_property": True, }, ) sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sequence", title="Extension field for ``sequence``." ) testData: typing.List[fhirtypes.TestPlanTestCaseTestDataType] | None = Field( default=None, alias="testData", title="The test data used in the test case", description=None, json_schema_extra={ "element_property": True, }, ) testRun: typing.List[fhirtypes.TestPlanTestCaseTestRunType] | None = Field( default=None, alias="testRun", title="The actual test to be executed", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestPlanTestCase`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "sequence", "scope", "dependency", "testRun", "testData", "assertion", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestPlanTestCase`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestPlanTestCaseAssertion(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Test assertions or expectations. The test assertions - the expectations of test results from the execution of the test case. """ __resource_type__ = "TestPlanTestCaseAssertion" object: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="object", title="The focus or object of the assertion", description="The focus or object of the assertion i.e. a resource.", json_schema_extra={ "element_property": True, }, ) result: typing.List[fhirtypes.CodeableReferenceType] | None = Field( default=None, alias="result", title="The actual result assertion", description=( "The test assertion - the expected outcome from the test case " "execution." ), json_schema_extra={ "element_property": True, }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title="Assertion type - for example 'informative' or 'required' ", description=( "The test assertion type - this can be used to group assertions as " "'required' or 'optional', or can be used for other classification of " "the assertion." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestPlanTestCaseAssertion`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "object", "result"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestPlanTestCaseAssertion`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestPlanTestCaseDependency(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Required criteria to execute the test case. The required criteria to execute the test case - e.g. preconditions, previous tests. """ __resource_type__ = "TestPlanTestCaseDependency" description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Description of the criteria", description=None, json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) predecessor: fhirtypes.ReferenceType | None = Field( default=None, alias="predecessor", title="Link to predecessor test plans", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestPlanTestCaseDependency`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "description", "predecessor"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestPlanTestCaseDependency`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestPlanTestCaseTestData(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The test data used in the test case. """ __resource_type__ = "TestPlanTestCaseTestData" content: fhirtypes.ReferenceType | None = Field( default=None, alias="content", title="The actual test resources when they exist", description=None, json_schema_extra={ "element_property": True, }, ) sourceReference: fhirtypes.ReferenceType | None = Field( default=None, alias="sourceReference", title=( "Pointer to a definition of test resources - narrative or structured " "e.g. synthetic data generation, etc" ), description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e source[x] "one_of_many": "source", "one_of_many_required": False, }, ) sourceString: fhirtypes.StringType | None = Field( default=None, alias="sourceString", title=( "Pointer to a definition of test resources - narrative or structured " "e.g. synthetic data generation, etc" ), description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e source[x] "one_of_many": "source", "one_of_many_required": False, }, ) sourceString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceString", title="Extension field for ``sourceString``.", ) type: fhirtypes.CodingType = Field( default=..., alias="type", title="The type of test data description, e.g. 'synthea'", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestPlanTestCaseTestData`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "content", "sourceString", "sourceReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestPlanTestCaseTestData`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"source": ["sourceReference", "sourceString"]} return one_of_many_fields class TestPlanTestCaseTestRun(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The actual test to be executed. """ __resource_type__ = "TestPlanTestCaseTestRun" narrative: fhirtypes.MarkdownType | None = Field( default=None, alias="narrative", title="The narrative description of the tests", description=None, json_schema_extra={ "element_property": True, }, ) narrative__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_narrative", title="Extension field for ``narrative``." ) script: fhirtypes.TestPlanTestCaseTestRunScriptType | None = Field( default=None, alias="script", title=( "The test cases in a structured language e.g. gherkin, Postman, or FHIR" " TestScript" ), description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestPlanTestCaseTestRun`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "narrative", "script"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestPlanTestCaseTestRun`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestPlanTestCaseTestRunScript(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The test cases in a structured language e.g. gherkin, Postman, or FHIR TestScript. """ __resource_type__ = "TestPlanTestCaseTestRunScript" language: fhirtypes.CodeableConceptType | None = Field( default=None, alias="language", title="The language for the test cases e.g. 'gherkin', 'testscript'", description=None, json_schema_extra={ "element_property": True, }, ) sourceReference: fhirtypes.ReferenceType | None = Field( default=None, alias="sourceReference", title=( "The actual content of the cases - references to TestScripts or " "externally defined content" ), description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e source[x] "one_of_many": "source", "one_of_many_required": False, }, ) sourceString: fhirtypes.StringType | None = Field( default=None, alias="sourceString", title=( "The actual content of the cases - references to TestScripts or " "externally defined content" ), description=None, json_schema_extra={ "element_property": True, # Choice of Data Types. i.e source[x] "one_of_many": "source", "one_of_many_required": False, }, ) sourceString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceString", title="Extension field for ``sourceString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestPlanTestCaseTestRunScript`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "language", "sourceString", "sourceReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestPlanTestCaseTestRunScript`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"source": ["sourceReference", "sourceString"]} return one_of_many_fields ================================================ FILE: fhir/resources/testreport.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/TestReport Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class TestReport(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Describes the results of a TestScript execution. A summary of information based on the results of executing a TestScript. """ __resource_type__ = "TestReport" identifier: fhirtypes.IdentifierType | None = Field( default=None, alias="identifier", title="External identifier", description=( "Identifier for the TestReport assigned for external purposes outside " "the context of FHIR." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued: fhirtypes.DateTimeType | None = Field( default=None, alias="issued", title="When the TestScript was executed and this TestReport was generated", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_issued", title="Extension field for ``issued``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Informal name of the executed TestReport", description="A free text natural language name identifying the executed TestReport.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) participant: typing.List[fhirtypes.TestReportParticipantType] | None = Field( default=None, alias="participant", title=( "A participant in the test execution, either the execution engine, a " "client, or a server" ), description=None, json_schema_extra={ "element_property": True, }, ) result: fhirtypes.CodeType | None = Field( default=None, alias="result", title="pass | fail | pending", description="The overall result from the execution of the TestScript.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["pass", "fail", "pending"], }, ) result__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_result", title="Extension field for ``result``." ) score: fhirtypes.DecimalType | None = Field( default=None, alias="score", title=( "The final score (percentage of tests passed) resulting from the " "execution of the TestScript" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) score__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_score", title="Extension field for ``score``." ) setup: fhirtypes.TestReportSetupType | None = Field( default=None, alias="setup", title=( "The results of the series of required setup operations before the " "tests were executed" ), description=None, json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="completed | in-progress | waiting | stopped | entered-in-error", description="The current state of this test report.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "completed", "in-progress", "waiting", "stopped", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) teardown: fhirtypes.TestReportTeardownType | None = Field( default=None, alias="teardown", title="The results of running the series of required clean up steps", description=( "The results of the series of operations required to clean up after all" " the tests were executed (successfully or otherwise)." ), json_schema_extra={ "element_property": True, }, ) test: typing.List[fhirtypes.TestReportTestType] | None = Field( default=None, alias="test", title="A test executed from the test script", description=None, json_schema_extra={ "element_property": True, }, ) testScript: fhirtypes.CanonicalType | None = Field( default=None, alias="testScript", title=( "Canonical URL to the version-specific TestScript that was executed to" " produce this TestReport" ), description=( "Ideally this is an absolute URL that is used to identify the version-" "specific TestScript that was executed, matching the `TestScript.url`." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["TestScript"], }, ) testScript__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_testScript", title="Extension field for ``testScript``." ) tester: fhirtypes.StringType | None = Field( default=None, alias="tester", title="Name of the tester producing this report (Organization or individual)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) tester__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_tester", title="Extension field for ``tester``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "name", "status", "testScript", "result", "score", "tester", "issued", "participant", "setup", "test", "teardown", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "identifier", "name", "status", "testScript", "result", "score", "tester", "issued", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("result", "result__ext"), ("status", "status__ext"), ("testScript", "testScript__ext"), ] return required_fields class TestReportParticipant(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A participant in the test execution, either the execution engine, a client, or a server. """ __resource_type__ = "TestReportParticipant" display: fhirtypes.StringType | None = Field( default=None, alias="display", title="The display name of the participant", description=None, json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title="test-engine | client | server", description="The type of participant.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["test-engine", "client", "server"], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) uri: fhirtypes.UriType | None = Field( default=None, alias="uri", title="The uri of the participant. An absolute URL is preferred", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uri", title="Extension field for ``uri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportParticipant`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "type", "uri", "display"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportParticipant`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext"), ("uri", "uri__ext")] return required_fields class TestReportSetup(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The results of the series of required setup operations before the tests were executed. """ __resource_type__ = "TestReportSetup" action: typing.List[fhirtypes.TestReportSetupActionType] = Field( default=..., alias="action", title="A setup operation or assert that was executed", description="Action would contain either an operation or an assertion.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportSetup`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "action"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportSetup`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestReportSetupAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A setup operation or assert that was executed. Action would contain either an operation or an assertion. """ __resource_type__ = "TestReportSetupAction" assert_fhir: fhirtypes.TestReportSetupActionAssertType | None = Field( default=None, alias="assert", title="The assertion to perform", description="The results of the assertion performed on the previous operations.", json_schema_extra={ "element_property": True, }, ) operation: fhirtypes.TestReportSetupActionOperationType | None = Field( default=None, alias="operation", title="The operation to perform", description="The operation performed.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportSetupAction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "operation", "assert"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportSetupAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestReportSetupActionAssert(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The assertion to perform. The results of the assertion performed on the previous operations. """ __resource_type__ = "TestReportSetupActionAssert" detail: fhirtypes.StringType | None = Field( default=None, alias="detail", title="A link to further details on the result", description=None, json_schema_extra={ "element_property": True, }, ) detail__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detail", title="Extension field for ``detail``." ) message: fhirtypes.MarkdownType | None = Field( default=None, alias="message", title="A message associated with the result", description="An explanatory message associated with the result.", json_schema_extra={ "element_property": True, }, ) message__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_message", title="Extension field for ``message``." ) requirement: typing.List[ fhirtypes.TestReportSetupActionAssertRequirementType ] | None = Field( default=None, alias="requirement", title="Links or references to the testing requirements", description=( "Links or references providing traceability to the testing requirements" " for this assert." ), json_schema_extra={ "element_property": True, }, ) result: fhirtypes.CodeType | None = Field( default=None, alias="result", title="pass | skip | fail | warning | error", description="The result of this assertion.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["pass", "skip", "fail", "warning", "error"], }, ) result__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_result", title="Extension field for ``result``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportSetupActionAssert`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "result", "message", "detail", "requirement", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportSetupActionAssert`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("result", "result__ext")] return required_fields class TestReportSetupActionAssertRequirement(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Links or references to the testing requirements. Links or references providing traceability to the testing requirements for this assert. """ __resource_type__ = "TestReportSetupActionAssertRequirement" linkCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="linkCanonical", title="Link or reference to the testing requirement", description=( "Link or reference providing traceability to the testing requirement " "for this test." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e link[x] "one_of_many": "link", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Requirements"], }, ) linkCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_linkCanonical", title="Extension field for ``linkCanonical``.", ) linkUri: fhirtypes.UriType | None = Field( default=None, alias="linkUri", title="Link or reference to the testing requirement", description=( "Link or reference providing traceability to the testing requirement " "for this test." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e link[x] "one_of_many": "link", "one_of_many_required": False, }, ) linkUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_linkUri", title="Extension field for ``linkUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportSetupActionAssertRequirement`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "linkUri", "linkCanonical"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportSetupActionAssertRequirement`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"link": ["linkCanonical", "linkUri"]} return one_of_many_fields class TestReportSetupActionOperation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The operation to perform. The operation performed. """ __resource_type__ = "TestReportSetupActionOperation" detail: fhirtypes.UriType | None = Field( default=None, alias="detail", title="A link to further details on the result", description=None, json_schema_extra={ "element_property": True, }, ) detail__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_detail", title="Extension field for ``detail``." ) message: fhirtypes.MarkdownType | None = Field( default=None, alias="message", title="A message associated with the result", description="An explanatory message associated with the result.", json_schema_extra={ "element_property": True, }, ) message__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_message", title="Extension field for ``message``." ) result: fhirtypes.CodeType | None = Field( default=None, alias="result", title="pass | skip | fail | warning | error", description="The result of this operation.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["pass", "skip", "fail", "warning", "error"], }, ) result__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_result", title="Extension field for ``result``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportSetupActionOperation`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "result", "message", "detail"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportSetupActionOperation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("result", "result__ext")] return required_fields class TestReportTeardown(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The results of running the series of required clean up steps. The results of the series of operations required to clean up after all the tests were executed (successfully or otherwise). """ __resource_type__ = "TestReportTeardown" action: typing.List[fhirtypes.TestReportTeardownActionType] = Field( default=..., alias="action", title="One or more teardown operations performed", description="The teardown action will only contain an operation.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportTeardown`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "action"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportTeardown`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestReportTeardownAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. One or more teardown operations performed. The teardown action will only contain an operation. """ __resource_type__ = "TestReportTeardownAction" operation: fhirtypes.TestReportSetupActionOperationType = Field( default=..., alias="operation", title="The teardown operation performed", description="An operation would involve a REST request to a server.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportTeardownAction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "operation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportTeardownAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestReportTest(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A test executed from the test script. """ __resource_type__ = "TestReportTest" action: typing.List[fhirtypes.TestReportTestActionType] = Field( default=..., alias="action", title="A test operation or assert that was performed", description="Action would contain either an operation or an assertion.", json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Tracking/reporting short description of the test", description=( "A short description of the test used by test engines for tracking and " "reporting purposes." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Tracking/logging name of this test", description=( "The name of this test used for tracking/logging purposes by test " "engines." ), json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportTest`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "description", "action"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportTest`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestReportTestAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A test operation or assert that was performed. Action would contain either an operation or an assertion. """ __resource_type__ = "TestReportTestAction" assert_fhir: fhirtypes.TestReportSetupActionAssertType | None = Field( default=None, alias="assert", title="The assertion performed", description="The results of the assertion performed on the previous operations.", json_schema_extra={ "element_property": True, }, ) operation: fhirtypes.TestReportSetupActionOperationType | None = Field( default=None, alias="operation", title="The operation performed", description="An operation would involve a REST request to a server.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestReportTestAction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "operation", "assert"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestReportTestAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/tests/__init__.py ================================================ __author__ = "Md Nazrul Islam" __email__ = "email2nazrul@gmail.com" __fhir_version__ = "5.0.0" ================================================ FILE: fhir/resources/tests/conftest.py ================================================ import hashlib import io import os import pathlib import shutil import sys import tempfile import zipfile from os.path import dirname import pytest from fhir_core.types import ( Base64BinaryType, DateTimeType, DateType, InstantType, TimeType, UriType, UrlType, ) from pydantic import BaseModel, Field EXAMPLE_RESOURCES_URL = ( "https://github.com/nazrulworld/hl7-archives/raw/" "0.4.0/FHIR/R5/" "5.0.0-examples-json.zip" ) ROOT_PATH = dirname(dirname(dirname(dirname(os.path.abspath(__file__))))) CACHE_PATH = os.path.join(ROOT_PATH, ".cache") def download_and_store(url, path): """ """ import requests try: sys.stdout.write("Attempting to download from {0}\n".format(url)) ret = requests.get(url) except requests.HTTPError as exc: # pragma: no cover raise LookupError("Failed to download. Full error: {0!s}".format(exc)) else: if not ret.ok: # pragma: no cover raise Exception("Failed to download {0}".format(url)) with io.open(path, "wb") as handle: for chunk in ret.iter_content(): handle.write(chunk) sys.stdout.write( "Download has been completed, now saved to {0}\n".format(path) ) def expand(self, local): # pragma: no cover """Expand the ZIP file at the given path to the cache directory.""" path = os.path.join(self.cache, local) assert os.path.exists(path) import zipfile # import here as we can bypass its use with a manual unzip with zipfile.ZipFile(path) as z: z.extractall(self.cache) @pytest.fixture(scope="session") def base_settings(): if not os.path.exists(CACHE_PATH): # pragma: no cover os.makedirs(CACHE_PATH) settings = {} example_data_file_uri = EXAMPLE_RESOURCES_URL example_data_file_id = hashlib.md5(example_data_file_uri.encode()).hexdigest() example_data_file_location = os.path.join( CACHE_PATH, (example_data_file_id + ".zip") ) if not os.path.exists(example_data_file_location): download_and_store(example_data_file_uri, example_data_file_location) temp_data_dir = tempfile.mkdtemp() # extract all files from archive and put into temp dir with zipfile.ZipFile(example_data_file_location) as z: z.extractall(temp_data_dir) zip_dir_name = pathlib.Path(EXAMPLE_RESOURCES_URL).name[:-4] if "FHIR_UNITTEST_DATADIR" not in os.environ: os.environ.setdefault( "FHIR_UNITTEST_DATADIR", os.path.join(temp_data_dir, zip_dir_name) ) settings["unittest_data_dir"] = pathlib.Path(os.environ["FHIR_UNITTEST_DATADIR"]) yield settings os.environ.pop("FHIR_UNITTEST_DATADIR") shutil.rmtree(temp_data_dir) class ExternalValidatorModel(BaseModel): """This model is used to validate datetime objects against in the tests""" valueDate: DateType = Field(None, title="Date") valueTime: TimeType = Field(None, title="Time") valueDateTime: DateTimeType = Field(None, title="DateTime") valueInstant: InstantType = Field(None, title="Instant") valueUri: UriType = Field(None, title="Uri") valueUrl: UrlType = Field(None, title="Url") valueBase64Binary: Base64BinaryType = Field(None, title="Base64Binary") ================================================ FILE: fhir/resources/tests/test_account.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Account Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import account from .conftest import ExternalValidatorModel def impl_account_1(inst): assert inst.coverage[0].coverage.reference == "Coverage/7546D" assert inst.coverage[0].priority == 1 assert inst.description == "Hospital charges" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:0.1.2.3.4.5.6.7"} ).valueUri ) assert inst.identifier[0].value == "654321" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "HACC Funded Billing for Peter James Chalmers" assert inst.owner.reference == "Organization/hl7" assert inst.relatedAccount[0].account.reference == "Account/ewg" assert inst.relatedAccount[0].relationship.coding[0].code == "guarantor" assert ( inst.relatedAccount[0].relationship.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/account-relationship"} ).valueUri ) assert ( inst.servicePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-06-30"} ).valueDateTime ) assert ( inst.servicePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-01"} ).valueDateTime ) assert inst.status == "active" assert inst.subject[0].display == "Peter James Chalmers" assert inst.subject[0].reference == "Patient/example" assert inst.text.div == ( '
HACC Funded ' "Billing for Peter James Chalmers
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "PBILLACCT" assert inst.type.coding[0].display == "patient billing account" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.type.text == "patient" def test_account_1(base_settings): """No. 1 tests collection for Account. Test File: account-example.json """ filename = base_settings["unittest_data_dir"] / "account-example.json" inst = account.Account.model_validate_json(filename.read_bytes()) assert "Account" == inst.get_resource_type() impl_account_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Account" == data["resourceType"] inst2 = account.Account(**data) impl_account_1(inst2) def impl_account_2(inst): assert inst.coverage[0].coverage.reference == "Coverage/9876B1" assert inst.coverage[0].priority == 1 assert inst.coverage[1].coverage.reference == "Coverage/7546D" assert inst.coverage[1].priority == 2 assert inst.description == "Hospital charges" assert inst.guarantor[0].onHold is False assert inst.guarantor[0].party.display == "Bénédicte du Marché" assert inst.guarantor[0].party.reference == "RelatedPerson/benedicte" assert ( inst.guarantor[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-01"} ).valueDateTime ) assert inst.id == "ewg" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:0.1.2.3.4.5.6.7"} ).valueUri ) assert inst.identifier[0].value == "654321" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Inpatient: Peter James Chalmers" assert inst.owner.display == "Burgers University Medical Center" assert inst.owner.reference == "Organization/f001" assert ( inst.servicePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-06-30"} ).valueDateTime ) assert ( inst.servicePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-01"} ).valueDateTime ) assert inst.status == "active" assert inst.subject[0].display == "Peter James Chalmers" assert inst.subject[0].reference == "Patient/example" assert inst.text.div == ( '
Inpatient ' "Admission for Peter James Chalmers Account
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "PBILLACCT" assert inst.type.coding[0].display == "patient billing account" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.type.text == "patient" def test_account_2(base_settings): """No. 2 tests collection for Account. Test File: account-example-with-guarantor.json """ filename = ( base_settings["unittest_data_dir"] / "account-example-with-guarantor.json" ) inst = account.Account.model_validate_json(filename.read_bytes()) assert "Account" == inst.get_resource_type() impl_account_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Account" == data["resourceType"] inst2 = account.Account(**data) impl_account_2(inst2) ================================================ FILE: fhir/resources/tests/test_activitydefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ActivityDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import activitydefinition from .conftest import ExternalValidatorModel def impl_activitydefinition_1(inst): assert inst.code.coding[0].code == "zika-virus-exposure-assessment" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/questionnaires"} ).valueUri ) assert inst.description == "Administer Zika Virus Exposure Assessment" assert inst.id == "administer-zika-virus-exposure-assessment" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.19.4" assert inst.kind == "ServiceRequest" assert inst.library[0] == ( "http://example.org/fhir/Library/zika-virus-intervention-" "logic" ) assert inst.participant[0].type == "practitioner" assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "https://www.cdc.gov/zika/hc-providers/pregnant-woman.html"} ).valueUrl ) assert inst.relatedArtifact[0].type == "derived-from" assert inst.relatedArtifact[1].resource == ( "http://hl7.org/fhir/Questionnaire/zika-virus-exposure-" "assessment" ) assert inst.relatedArtifact[1].type == "depends-on" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/ActivityDefinition/administer-zika-virus-exposure-assessment" } ).valueUri ) assert inst.useContext[0].code.code == "age" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueRange.low.unit == "a" assert float(inst.useContext[0].valueRange.low.value) == float(12) def test_activitydefinition_1(base_settings): """No. 1 tests collection for ActivityDefinition. Test File: activitydefinition-administer-zika-virus-exposure-assessment.json """ filename = ( base_settings["unittest_data_dir"] / "activitydefinition-administer-zika-virus-exposure-assessment.json" ) inst = activitydefinition.ActivityDefinition.model_validate_json( filename.read_bytes() ) assert "ActivityDefinition" == inst.get_resource_type() impl_activitydefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ActivityDefinition" == data["resourceType"] inst2 = activitydefinition.ActivityDefinition(**data) impl_activitydefinition_1(inst2) def impl_activitydefinition_2(inst): assert inst.code.text == "Provide Mosquito Prevention Advice" assert inst.description == "Provide mosquito prevention advice" assert inst.id == "provide-mosquito-prevention-advice" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.19.1" assert inst.kind == "CommunicationRequest" assert inst.library[0] == ( "http://example.org/fhir/Library/zika-virus-intervention-" "logic" ) assert inst.participant[0].type == "practitioner" assert ( inst.relatedArtifact[0].display == "Advice for patients about how to avoid Mosquito bites." ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://www.cdc.gov/zika/prevention/index.html"} ).valueUrl ) assert inst.relatedArtifact[0].type == "documentation" assert inst.relatedArtifact[1].display == ( "Advice for patients about which mosquito repellents are " "effective and safe to use in pregnancy. [DEET, IF3535 and " "Picardin are safe during]" ) assert ( inst.relatedArtifact[1].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://www.epa.gov/insect-repellents/find-insect-repellent-right-you" } ).valueUrl ) assert inst.relatedArtifact[1].type == "documentation" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/ActivityDefinition/provide-mosquito-prevention-advice" } ).valueUri ) def test_activitydefinition_2(base_settings): """No. 2 tests collection for ActivityDefinition. Test File: activitydefinition-provide-mosquito-prevention-advice.json """ filename = ( base_settings["unittest_data_dir"] / "activitydefinition-provide-mosquito-prevention-advice.json" ) inst = activitydefinition.ActivityDefinition.model_validate_json( filename.read_bytes() ) assert "ActivityDefinition" == inst.get_resource_type() impl_activitydefinition_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ActivityDefinition" == data["resourceType"] inst2 = activitydefinition.ActivityDefinition(**data) impl_activitydefinition_2(inst2) def impl_activitydefinition_3(inst): assert ( inst.approvalDate == ExternalValidatorModel.model_validate({"valueDate": "2016-03-12"}).valueDate ) assert inst.author[0].name == "Motive Medical Intelligence" assert inst.author[0].telecom[0].system == "phone" assert inst.author[0].telecom[0].use == "work" assert inst.author[0].telecom[0].value == "415-362-4007" assert inst.author[0].telecom[1].system == "email" assert inst.author[0].telecom[1].use == "work" assert inst.author[0].telecom[1].value == "info@motivemi.com" assert inst.code.coding[0].code == "306206005" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Referral to service (procedure)" assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "415-362-4007" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].use == "work" assert inst.contact[0].telecom[1].value == "info@motivemi.com" assert inst.copyright == ( "© Copyright 2016 Motive Medical Intelligence. All rights " "reserved." ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-03T14:06:00Z"} ).valueDateTime ) assert inst.description == ( "refer to primary care mental-health integrated care program " "for evaluation and treatment of mental health conditions now" ) assert ( inst.effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-12-31"} ).valueDateTime ) assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-01"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "referralPrimaryCareMentalHealth-initial" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.19.5" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://motivemi.com/artifacts"} ).valueUri ) assert inst.identifier[1].use == "official" assert inst.identifier[1].value == "referralPrimaryCareMentalHealth" assert inst.jurisdiction[0].coding[0].code == "US" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.kind == "ServiceRequest" assert ( inst.lastReviewDate == ExternalValidatorModel.model_validate({"valueDate": "2016-08-15"}).valueDate ) assert inst.name == "ReferralPrimaryCareMentalHealth" assert inst.participant[0].type == "practitioner" assert inst.publisher == "Motive Medical Intelligence" assert inst.relatedArtifact[0].display == ( "Practice Guideline for the Treatment of Patients with Major " "Depressive Disorder" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf" } ).valueUrl ) assert inst.relatedArtifact[0].type == "citation" assert inst.relatedArtifact[1].resource == ( "http://example.org/fhir/ActivityDefinition/referralPrimaryCa" "reMentalHealth" ) assert inst.relatedArtifact[1].type == "successor" assert inst.status == "retired" assert inst.text.status == "generated" assert inst.title == "Referral to Primary Care Mental Health" assert inst.topic[0].text == "Mental Health Referral" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://motivemi.com/artifacts/ActivityDefinition/referralPrimaryCareMentalHealth" } ).valueUri ) assert inst.useContext[0].code.code == "age" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "D000328" assert inst.useContext[0].valueCodeableConcept.coding[0].display == "Adult" assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://meshb.nlm.nih.gov"} ).valueUri ) assert inst.useContext[1].code.code == "focus" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueCodeableConcept.coding[0].code == "87512008" assert ( inst.useContext[1].valueCodeableConcept.coding[0].display == "Mild major depression" ) assert ( inst.useContext[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[2].code.code == "focus" assert ( inst.useContext[2].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[2].valueCodeableConcept.coding[0].code == "40379007" assert ( inst.useContext[2].valueCodeableConcept.coding[0].display == "Major depression, recurrent, mild" ) assert ( inst.useContext[2].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[3].code.code == "focus" assert ( inst.useContext[3].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[3].valueCodeableConcept.coding[0].code == "225444004" assert ( inst.useContext[3].valueCodeableConcept.coding[0].display == "At risk for suicide (finding)" ) assert ( inst.useContext[3].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[4].code.code == "focus" assert ( inst.useContext[4].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[4].valueCodeableConcept.coding[0].code == "306206005" assert ( inst.useContext[4].valueCodeableConcept.coding[0].display == "Referral to service (procedure)" ) assert ( inst.useContext[4].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[5].code.code == "user" assert ( inst.useContext[5].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[5].valueCodeableConcept.coding[0].code == "309343006" assert inst.useContext[5].valueCodeableConcept.coding[0].display == "Physician" assert ( inst.useContext[5].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[6].code.code == "venue" assert ( inst.useContext[6].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[6].valueCodeableConcept.coding[0].code == "440655000" assert ( inst.useContext[6].valueCodeableConcept.coding[0].display == "Outpatient environment" ) assert ( inst.useContext[6].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version == "1.0.0" def test_activitydefinition_3(base_settings): """No. 3 tests collection for ActivityDefinition. Test File: activitydefinition-predecessor-example.json """ filename = ( base_settings["unittest_data_dir"] / "activitydefinition-predecessor-example.json" ) inst = activitydefinition.ActivityDefinition.model_validate_json( filename.read_bytes() ) assert "ActivityDefinition" == inst.get_resource_type() impl_activitydefinition_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ActivityDefinition" == data["resourceType"] inst2 = activitydefinition.ActivityDefinition(**data) impl_activitydefinition_3(inst2) def impl_activitydefinition_4(inst): assert inst.code.text == "Serum Zika and Dengue Virus IgM" assert inst.description == "Order Serum Zika and Dengue Virus IgM" assert inst.id == "serum-zika-dengue-virus-igm" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.19.2" assert inst.kind == "ServiceRequest" assert inst.library[0] == ( "http://example.org/fhir/Library/zika-virus-intervention-" "logic" ) assert inst.participant[0].type == "practitioner" assert inst.relatedArtifact[0].display == ( "Explanation of diagnostic tests for Zika virus and which to " "use based on the patient’s clinical and exposure history." ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://www.cdc.gov/zika/hc-providers/diagnostic.html"} ).valueUrl ) assert inst.relatedArtifact[0].type == "documentation" assert inst.relatedArtifact[1].resource == ( "http://example.org/fhir/ActivityDefinition/serum-dengue-" "virus-igm" ) assert inst.relatedArtifact[1].type == "derived-from" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/ActivityDefinition/serum-zika-dengue-virus-igm" } ).valueUri ) def test_activitydefinition_4(base_settings): """No. 4 tests collection for ActivityDefinition. Test File: activitydefinition-order-serum-zika-dengue-virus-igm.json """ filename = ( base_settings["unittest_data_dir"] / "activitydefinition-order-serum-zika-dengue-virus-igm.json" ) inst = activitydefinition.ActivityDefinition.model_validate_json( filename.read_bytes() ) assert "ActivityDefinition" == inst.get_resource_type() impl_activitydefinition_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ActivityDefinition" == data["resourceType"] inst2 = activitydefinition.ActivityDefinition(**data) impl_activitydefinition_4(inst2) def impl_activitydefinition_5(inst): assert ( inst.approvalDate == ExternalValidatorModel.model_validate({"valueDate": "2016-03-12"}).valueDate ) assert inst.author[0].name == "Motive Medical Intelligence" assert inst.author[0].telecom[0].system == "phone" assert inst.author[0].telecom[0].use == "work" assert inst.author[0].telecom[0].value == "415-362-4007" assert inst.author[0].telecom[1].system == "email" assert inst.author[0].telecom[1].use == "work" assert inst.author[0].telecom[1].value == "info@motivemi.com" assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "415-362-4007" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].use == "work" assert inst.contact[0].telecom[1].value == "info@motivemi.com" assert inst.contained[0].id == "citalopramMedication" assert inst.contained[1].id == "citalopramSubstance" assert inst.copyright == ( "© Copyright 2016 Motive Medical Intelligence. All rights " "reserved." ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-15"} ).valueDateTime ) assert inst.description == ( "Citalopram 20 mg tablet 1 tablet oral 1 time daily now (30 " "table; 3 refills" ) assert inst.dosage[0].doseAndRate[0].doseQuantity.unit == "{tbl}" assert float(inst.dosage[0].doseAndRate[0].doseQuantity.value) == float(1) assert inst.dosage[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosage[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosage[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosage[0].route.coding[0].code == "26643006" assert inst.dosage[0].route.coding[0].display == "Oral route (qualifier value)" assert inst.dosage[0].route.text == "Oral route (qualifier value)" assert inst.dosage[0].text == "1 tablet oral 1 time daily" assert inst.dosage[0].timing.repeat.frequency == 1 assert float(inst.dosage[0].timing.repeat.period) == float(1) assert inst.dosage[0].timing.repeat.periodUnit == "d" assert ( inst.dynamicValue[0].expression.description == "dispenseRequest.numberOfRepeatsAllowed is three (3)" ) assert inst.dynamicValue[0].expression.expression == "3" assert inst.dynamicValue[0].expression.language == "text/cql" assert inst.dynamicValue[0].path == "dispenseRequest.numberOfRepeatsAllowed" assert ( inst.dynamicValue[1].expression.description == "dispenseRequest.quantity is thirty (30) tablets" ) assert inst.dynamicValue[1].expression.expression == "30 '{tbl}'" assert inst.dynamicValue[1].expression.language == "text/cql" assert inst.dynamicValue[1].path == "dispenseRequest.quantity" assert ( inst.effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-12-31"} ).valueDateTime ) assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-01"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "citalopramPrescription" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.19.6" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://motivemi.com"} ).valueUri ) assert inst.identifier[1].use == "official" assert inst.identifier[1].value == "citalopramPrescription" assert inst.jurisdiction[0].coding[0].code == "US" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.kind == "MedicationRequest" assert ( inst.lastReviewDate == ExternalValidatorModel.model_validate({"valueDate": "2016-08-15"}).valueDate ) assert inst.name == "CitalopramPrescription" assert inst.productReference.reference == "#citalopramMedication" assert inst.publisher == "Motive Medical Intelligence" assert inst.purpose == ( "Defines a guideline supported prescription for the treatment" " of depressive disorders" ) assert inst.relatedArtifact[0].display == ( "Practice Guideline for the Treatment of Patients with Major " "Depressive Disorder" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf" } ).valueUrl ) assert inst.relatedArtifact[0].type == "citation" assert inst.relatedArtifact[1].resource == "#citalopramMedication" assert inst.relatedArtifact[1].type == "composed-of" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Citalopram Prescription" assert inst.topic[0].text == "Mental Health Treatment" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://motivemi.com/artifacts/ActivityDefinition/citalopramPrescription" } ).valueUri ) assert inst.usage == ( "This activity definition is used as part of various suicide " "risk order sets" ) assert inst.useContext[0].code.code == "age" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "D000328" assert inst.useContext[0].valueCodeableConcept.coding[0].display == "Adult" assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://meshb.nlm.nih.gov"} ).valueUri ) assert inst.useContext[1].code.code == "focus" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueCodeableConcept.coding[0].code == "87512008" assert ( inst.useContext[1].valueCodeableConcept.coding[0].display == "Mild major depression" ) assert ( inst.useContext[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[2].code.code == "focus" assert ( inst.useContext[2].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[2].valueCodeableConcept.coding[0].code == "40379007" assert ( inst.useContext[2].valueCodeableConcept.coding[0].display == "Major depression, recurrent, mild" ) assert ( inst.useContext[2].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[3].code.code == "focus" assert ( inst.useContext[3].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[3].valueCodeableConcept.coding[0].code == "225444004" assert ( inst.useContext[3].valueCodeableConcept.coding[0].display == "At risk for suicide (finding)" ) assert ( inst.useContext[3].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[4].code.code == "focus" assert ( inst.useContext[4].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[4].valueCodeableConcept.coding[0].code == "306206005" assert ( inst.useContext[4].valueCodeableConcept.coding[0].display == "Referral to service (procedure)" ) assert ( inst.useContext[4].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[5].code.code == "user" assert ( inst.useContext[5].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[5].valueCodeableConcept.coding[0].code == "309343006" assert inst.useContext[5].valueCodeableConcept.coding[0].display == "Physician" assert ( inst.useContext[5].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[6].code.code == "venue" assert ( inst.useContext[6].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[6].valueCodeableConcept.coding[0].code == "440655000" assert ( inst.useContext[6].valueCodeableConcept.coding[0].display == "Outpatient environment" ) assert ( inst.useContext[6].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version == "1.0.0" def test_activitydefinition_5(base_settings): """No. 5 tests collection for ActivityDefinition. Test File: activitydefinition-medicationorder-example.json """ filename = ( base_settings["unittest_data_dir"] / "activitydefinition-medicationorder-example.json" ) inst = activitydefinition.ActivityDefinition.model_validate_json( filename.read_bytes() ) assert "ActivityDefinition" == inst.get_resource_type() impl_activitydefinition_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ActivityDefinition" == data["resourceType"] inst2 = activitydefinition.ActivityDefinition(**data) impl_activitydefinition_5(inst2) def impl_activitydefinition_6(inst): assert inst.code.coding[0].code == "1155608" assert inst.code.coding[0].display == "alteplase injectable product" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.description == "Alteplase Dosing for Stroke" assert inst.dosage[0].doseAndRate[0].doseQuantity.code == "mg/kg" assert ( inst.dosage[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.dosage[0].doseAndRate[0].doseQuantity.value) == float(0.9) assert inst.dosage[0].doseAndRate[0].type.coding[0].code == "calculated" assert inst.dosage[0].doseAndRate[0].type.coding[0].display == "Calculated" assert ( inst.dosage[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosage[0].maxDosePerAdministration.code == "mg" assert ( inst.dosage[0].maxDosePerAdministration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.dosage[0].maxDosePerAdministration.value) == float(90) assert inst.dosage[0].route.coding[0].code == "47625008" assert inst.dosage[0].route.coding[0].display == "Intravenous use" assert ( inst.dosage[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage[0].sequence == 1 assert inst.dosage[0].text == "give 10% of dose over 1 minute" assert inst.dosage[1].doseAndRate[0].doseQuantity.code == "mg/kg" assert ( inst.dosage[1].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.dosage[1].doseAndRate[0].doseQuantity.value) == float(0.9) assert inst.dosage[1].doseAndRate[0].type.coding[0].code == "calculated" assert inst.dosage[1].doseAndRate[0].type.coding[0].display == "Calculated" assert ( inst.dosage[1].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosage[1].maxDosePerAdministration.code == "mg" assert ( inst.dosage[1].maxDosePerAdministration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.dosage[1].maxDosePerAdministration.value) == float(90) assert inst.dosage[1].route.coding[0].code == "47625008" assert inst.dosage[1].route.coding[0].display == "Intravenous use" assert ( inst.dosage[1].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage[1].sequence == 2 assert inst.dosage[1].text == "give remaining 90% of dose over 1 hour" assert inst.id == "example-alteplase-dosing" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.19.3" assert inst.intent == "order" assert inst.kind == "MedicationRequest" assert inst.name == "AlteplaseDosingForStroke" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Alteplase Dosing for Stroke" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/fhir/ActivityDefinition/example-alteplase-dosing" } ).valueUri ) def test_activitydefinition_6(base_settings): """No. 6 tests collection for ActivityDefinition. Test File: activitydefinition-example-alteplase-dosing.json """ filename = ( base_settings["unittest_data_dir"] / "activitydefinition-example-alteplase-dosing.json" ) inst = activitydefinition.ActivityDefinition.model_validate_json( filename.read_bytes() ) assert "ActivityDefinition" == inst.get_resource_type() impl_activitydefinition_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ActivityDefinition" == data["resourceType"] inst2 = activitydefinition.ActivityDefinition(**data) impl_activitydefinition_6(inst2) def impl_activitydefinition_7(inst): assert ( inst.approvalDate == ExternalValidatorModel.model_validate({"valueDate": "2017-03-01"}).valueDate ) assert inst.author[0].name == "Motive Medical Intelligence" assert inst.author[0].telecom[0].system == "phone" assert inst.author[0].telecom[0].use == "work" assert inst.author[0].telecom[0].value == "415-362-4007" assert inst.author[0].telecom[1].system == "email" assert inst.author[0].telecom[1].use == "work" assert inst.author[0].telecom[1].value == "info@motivemi.com" assert inst.code.coding[0].code == "306206005" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Referral to service (procedure)" assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "415-362-4007" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].use == "work" assert inst.contact[0].telecom[1].value == "info@motivemi.com" assert inst.copyright == ( "© Copyright 2016 Motive Medical Intelligence. All rights " "reserved." ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-03T14:06:00Z"} ).valueDateTime ) assert inst.description == ( "refer to primary care mental-health integrated care program " "for evaluation and treatment of mental health conditions now" ) assert ( inst.effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-12-31"} ).valueDateTime ) assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-01"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "referralPrimaryCareMentalHealthEx" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.19.8" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://motivemi.com/artifacts"} ).valueUri ) assert inst.identifier[1].use == "official" assert inst.identifier[1].value == "referralPrimaryCareMentalHealth" assert inst.jurisdiction[0].coding[0].code == "US" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.kind == "ServiceRequest" assert ( inst.lastReviewDate == ExternalValidatorModel.model_validate({"valueDate": "2017-03-01"}).valueDate ) assert inst.name == "ReferralPrimaryCareMentalHealth" assert inst.participant[0].type == "practitioner" assert inst.publisher == "Motive Medical Intelligence" assert inst.relatedArtifact[0].display == ( "Practice Guideline for the Treatment of Patients with Major " "Depressive Disorder" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf" } ).valueUrl ) assert inst.relatedArtifact[0].type == "citation" assert inst.relatedArtifact[1].resource == ( "http://example.org/fhir/ActivityDefinition/referralPrimaryCa" "reMentalHealth-initial" ) assert inst.relatedArtifact[1].type == "predecessor" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Referral to Primary Care Mental Health" assert inst.topic[0].text == "Mental Health Referral" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://motivemi.com/artifacts/ActivityDefinition/referralPrimaryCareMentalHealthEx" } ).valueUri ) assert inst.useContext[0].code.code == "age" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "D000328" assert inst.useContext[0].valueCodeableConcept.coding[0].display == "Adult" assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://meshb.nlm.nih.gov"} ).valueUri ) assert inst.useContext[1].code.code == "focus" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueCodeableConcept.coding[0].code == "87512008" assert ( inst.useContext[1].valueCodeableConcept.coding[0].display == "Mild major depression" ) assert ( inst.useContext[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[2].code.code == "focus" assert ( inst.useContext[2].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[2].valueCodeableConcept.coding[0].code == "40379007" assert ( inst.useContext[2].valueCodeableConcept.coding[0].display == "Major depression, recurrent, mild" ) assert ( inst.useContext[2].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[3].code.code == "focus" assert ( inst.useContext[3].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[3].valueCodeableConcept.coding[0].code == "225444004" assert ( inst.useContext[3].valueCodeableConcept.coding[0].display == "At risk for suicide (finding)" ) assert ( inst.useContext[3].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[4].code.code == "focus" assert ( inst.useContext[4].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[4].valueCodeableConcept.coding[0].code == "306206005" assert ( inst.useContext[4].valueCodeableConcept.coding[0].display == "Referral to service (procedure)" ) assert ( inst.useContext[4].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[5].code.code == "user" assert ( inst.useContext[5].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[5].valueCodeableConcept.coding[0].code == "309343006" assert inst.useContext[5].valueCodeableConcept.coding[0].display == "Physician" assert ( inst.useContext[5].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[6].code.code == "venue" assert ( inst.useContext[6].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[6].valueCodeableConcept.coding[0].code == "440655000" assert ( inst.useContext[6].valueCodeableConcept.coding[0].display == "Outpatient environment" ) assert ( inst.useContext[6].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version == "1.1.0" def test_activitydefinition_7(base_settings): """No. 7 tests collection for ActivityDefinition. Test File: activitydefinition-example.json """ filename = base_settings["unittest_data_dir"] / "activitydefinition-example.json" inst = activitydefinition.ActivityDefinition.model_validate_json( filename.read_bytes() ) assert "ActivityDefinition" == inst.get_resource_type() impl_activitydefinition_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ActivityDefinition" == data["resourceType"] inst2 = activitydefinition.ActivityDefinition(**data) impl_activitydefinition_7(inst2) def impl_activitydefinition_8(inst): assert inst.code.text == "Serum Dengue Virus IgM" assert inst.description == "Order Serum Dengue Virus IgM" assert inst.id == "serum-dengue-virus-igm" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.19.7" assert inst.kind == "ServiceRequest" assert inst.participant[0].type == "practitioner" assert inst.relatedArtifact[0].display == ( "Explanation of diagnostic tests for Dengue virus and which " "to use based on the patient’s clinical and exposure history." ) assert inst.relatedArtifact[0].type == "documentation" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/ActivityDefinition/serum-dengue-virus-igm"} ).valueUri ) def test_activitydefinition_8(base_settings): """No. 8 tests collection for ActivityDefinition. Test File: activitydefinition-order-serum-dengue-virus-igm.json """ filename = ( base_settings["unittest_data_dir"] / "activitydefinition-order-serum-dengue-virus-igm.json" ) inst = activitydefinition.ActivityDefinition.model_validate_json( filename.read_bytes() ) assert "ActivityDefinition" == inst.get_resource_type() impl_activitydefinition_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ActivityDefinition" == data["resourceType"] inst2 = activitydefinition.ActivityDefinition(**data) impl_activitydefinition_8(inst2) def impl_activitydefinition_9(inst): assert inst.bodySite[0].coding[0].code == "17401000" assert inst.bodySite[0].coding[0].display == "Heart valve structure" assert ( inst.bodySite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.coding[0].code == "34068001" assert inst.code.coding[0].display == "Heart valve replacement" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.description == "Heart valve replacement" assert inst.id == "heart-valve-replacement" assert inst.kind == "ServiceRequest" assert inst.location.reference.reference == "Location/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].role.coding[0].code == "207RI0011X" assert inst.participant[0].role.coding[0].display == "Interventional Cardiology" assert ( inst.participant[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://nucc.org/provider-taxonomy"} ).valueUri ) assert inst.participant[0].role.text == "Interventional Cardiology" assert inst.participant[0].type == "practitioner" assert ( inst.purpose == "Describes the proposal to perform a Heart Valve replacement." ) assert inst.status == "draft" assert inst.text.status == "generated" assert inst.topic[0].coding[0].code == "34068001" assert inst.topic[0].coding[0].display == "Heart valve replacement" assert ( inst.topic[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[0].code.code == "age" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "D000328" assert inst.useContext[0].valueCodeableConcept.coding[0].display == "Adult" assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://meshb.nlm.nih.gov"} ).valueUri ) assert inst.useContext[1].code.code == "user" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueCodeableConcept.coding[0].code == "309343006" assert inst.useContext[1].valueCodeableConcept.coding[0].display == "Physician" assert ( inst.useContext[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_activitydefinition_9(base_settings): """No. 9 tests collection for ActivityDefinition. Test File: activitydefinition-servicerequest-example.json """ filename = ( base_settings["unittest_data_dir"] / "activitydefinition-servicerequest-example.json" ) inst = activitydefinition.ActivityDefinition.model_validate_json( filename.read_bytes() ) assert "ActivityDefinition" == inst.get_resource_type() impl_activitydefinition_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ActivityDefinition" == data["resourceType"] inst2 = activitydefinition.ActivityDefinition(**data) impl_activitydefinition_9(inst2) def impl_activitydefinition_10(inst): assert inst.code.coding[0].code == "BlueTubes" assert inst.code.coding[0].display == "Blood collect tubes blue cap" assert inst.description == "10 Blood collect tubes blue cap" assert inst.id == "blood-tubes-supply" assert inst.kind == "SupplyRequest" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.purpose == ( "Describes a request for 10 Blood collection tubes with blue " "caps." ) assert float(inst.quantity.value) == float(10) assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.transform == "http://example.org/fhir/StructureMap/supplyrequest-transform" ) def test_activitydefinition_10(base_settings): """No. 10 tests collection for ActivityDefinition. Test File: activitydefinition-supplyrequest-example.json """ filename = ( base_settings["unittest_data_dir"] / "activitydefinition-supplyrequest-example.json" ) inst = activitydefinition.ActivityDefinition.model_validate_json( filename.read_bytes() ) assert "ActivityDefinition" == inst.get_resource_type() impl_activitydefinition_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ActivityDefinition" == data["resourceType"] inst2 = activitydefinition.ActivityDefinition(**data) impl_activitydefinition_10(inst2) ================================================ FILE: fhir/resources/tests/test_actordefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ActorDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import actordefinition from .conftest import ExternalValidatorModel def impl_actordefinition_1(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-11-02T14:31:30.239Z"} ).valueDateTime ) assert inst.description == "Server Actor" assert inst.id == "server" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.27.1" assert inst.name == "ServerActor" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Server Actor" assert inst.type == "system" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ActorDefinition/server"} ).valueUri ) def test_actordefinition_1(base_settings): """No. 1 tests collection for ActorDefinition. Test File: actordefinition-server.json """ filename = base_settings["unittest_data_dir"] / "actordefinition-server.json" inst = actordefinition.ActorDefinition.model_validate_json(filename.read_bytes()) assert "ActorDefinition" == inst.get_resource_type() impl_actordefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ActorDefinition" == data["resourceType"] inst2 = actordefinition.ActorDefinition(**data) impl_actordefinition_1(inst2) def impl_actordefinition_2(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-11-02T14:31:30.239Z"} ).valueDateTime ) assert inst.description == "Client Actor" assert inst.id == "client" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.27.2" assert inst.name == "ClientActor" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Client Actor" assert inst.type == "system" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ActorDefinition/client"} ).valueUri ) def test_actordefinition_2(base_settings): """No. 2 tests collection for ActorDefinition. Test File: actordefinition-client.json """ filename = base_settings["unittest_data_dir"] / "actordefinition-client.json" inst = actordefinition.ActorDefinition.model_validate_json(filename.read_bytes()) assert "ActorDefinition" == inst.get_resource_type() impl_actordefinition_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ActorDefinition" == data["resourceType"] inst2 = actordefinition.ActorDefinition(**data) impl_actordefinition_2(inst2) ================================================ FILE: fhir/resources/tests/test_administrableproductdefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/AdministrableProductDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import administrableproductdefinition from .conftest import ExternalValidatorModel def impl_administrableproductdefinition_1(inst): assert inst.administrableDoseForm.coding[0].code == "Film-coatedtablet" assert ( inst.administrableDoseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/administrabledoseform"} ).valueUri ) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/phpididentifiersets"} ).valueUri ) assert inst.identifier[0].value == "{PhPID}" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.routeOfAdministration[0].code.coding[0].code == "OralUse" assert ( inst.routeOfAdministration[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/routeofadministration"} ).valueUri ) assert inst.status == "active" assert inst.text.status == "generated" assert inst.unitOfPresentation.coding[0].code == "Tablet" assert ( inst.unitOfPresentation.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/unitofpresentation"} ).valueUri ) def test_administrableproductdefinition_1(base_settings): """No. 1 tests collection for AdministrableProductDefinition. Test File: administrableproductdefinition-example.json """ filename = ( base_settings["unittest_data_dir"] / "administrableproductdefinition-example.json" ) inst = administrableproductdefinition.AdministrableProductDefinition.model_validate_json( filename.read_bytes() ) assert "AdministrableProductDefinition" == inst.get_resource_type() impl_administrableproductdefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AdministrableProductDefinition" == data["resourceType"] inst2 = administrableproductdefinition.AdministrableProductDefinition(**data) impl_administrableproductdefinition_1(inst2) ================================================ FILE: fhir/resources/tests/test_allergyintolerance.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/AllergyIntolerance Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import allergyintolerance from .conftest import ExternalValidatorModel def impl_allergyintolerance_1(inst): assert inst.code.coding[0].code == "716184000" assert inst.code.coding[0].display == "No Known Latex Allergy (situation)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "No Known Latex Allergy" assert inst.id == "nkla" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].actor.reference == "Practitioner/example" assert inst.participant[0].function.coding[0].code == "author" assert inst.participant[0].function.coding[0].display == "Author" assert ( inst.participant[0].function.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/provenance-participant-type" } ).valueUri ) assert inst.patient.reference == "Patient/example" assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-06T15:37:31-06:00"} ).valueDateTime ) assert inst.text.status == "generated" def test_allergyintolerance_1(base_settings): """No. 1 tests collection for AllergyIntolerance. Test File: allergyintolerance-nkla.json """ filename = base_settings["unittest_data_dir"] / "allergyintolerance-nkla.json" inst = allergyintolerance.AllergyIntolerance.model_validate_json( filename.read_bytes() ) assert "AllergyIntolerance" == inst.get_resource_type() impl_allergyintolerance_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AllergyIntolerance" == data["resourceType"] inst2 = allergyintolerance.AllergyIntolerance(**data) impl_allergyintolerance_1(inst2) def impl_allergyintolerance_2(inst): assert inst.category[0] == "food" assert inst.clinicalStatus.coding[0].code == "active" assert inst.clinicalStatus.coding[0].display == "Active" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical" } ).valueUri ) assert inst.code.coding[0].code == "227493005" assert inst.code.coding[0].display == "Cashew nuts" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.criticality == "high" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/ids/patients/risks"} ).valueUri ) assert inst.identifier[0].value == "49476534" assert ( inst.lastOccurrence == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-06"} ).valueDateTime ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == ( "The criticality is high becasue of the observed anaphylactic" " reaction when challenged with cashew extract." ) assert ( inst.onsetDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2004"} ).valueDateTime ) assert inst.participant[0].actor.reference == "Practitioner/example" assert inst.participant[0].function.coding[0].code == "author" assert inst.participant[0].function.coding[0].display == "Author" assert ( inst.participant[0].function.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/provenance-participant-type" } ).valueUri ) assert inst.participant[1].actor.reference == "Patient/example" assert inst.participant[1].function.coding[0].code == "informant" assert inst.participant[1].function.coding[0].display == "Informant" assert ( inst.participant[1].function.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/provenance-participant-type" } ).valueUri ) assert inst.patient.reference == "Patient/example" assert inst.reaction[0].description == ( "Challenge Protocol. Severe reaction to subcutaneous cashew " "extract. Epinephrine administered" ) assert inst.reaction[0].exposureRoute.coding[0].code == "34206005" assert inst.reaction[0].exposureRoute.coding[0].display == "Subcutaneous route" assert ( inst.reaction[0].exposureRoute.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.reaction[0].manifestation[0].concept.coding[0].code == "39579001" assert ( inst.reaction[0].manifestation[0].concept.coding[0].display == "Anaphylactic reaction" ) assert ( inst.reaction[0].manifestation[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.reaction[0].onset == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-06-12"} ).valueDateTime ) assert inst.reaction[0].severity == "severe" assert inst.reaction[0].substance.coding[0].code == "1160593" assert ( inst.reaction[0].substance.coding[0].display == "cashew nut allergenic extract Injectable Product" ) assert ( inst.reaction[0].substance.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.reaction[1].manifestation[0].concept.coding[0].code == "64305001" assert inst.reaction[1].manifestation[0].concept.coding[0].display == "Urticaria" assert ( inst.reaction[1].manifestation[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.reaction[1].note[0].text == ( "The patient reports that the onset of urticaria was within " "15 minutes of eating cashews." ) assert ( inst.reaction[1].onset == ExternalValidatorModel.model_validate( {"valueDateTime": "2004"} ).valueDateTime ) assert inst.reaction[1].severity == "moderate" assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-10-09T14:58:00+11:00"} ).valueDateTime ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "allergy" assert inst.type.coding[0].display == "Allergy" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/allergy-intolerance-type"} ).valueUri ) assert inst.verificationStatus.coding[0].code == "confirmed" assert inst.verificationStatus.coding[0].display == "Confirmed" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification" } ).valueUri ) def test_allergyintolerance_2(base_settings): """No. 2 tests collection for AllergyIntolerance. Test File: allergyintolerance-example.json """ filename = base_settings["unittest_data_dir"] / "allergyintolerance-example.json" inst = allergyintolerance.AllergyIntolerance.model_validate_json( filename.read_bytes() ) assert "AllergyIntolerance" == inst.get_resource_type() impl_allergyintolerance_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AllergyIntolerance" == data["resourceType"] inst2 = allergyintolerance.AllergyIntolerance(**data) impl_allergyintolerance_2(inst2) def impl_allergyintolerance_3(inst): assert inst.code.coding[0].code == "716186003" assert inst.code.coding[0].display == "No Known Allergy (situation)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "NKA" assert inst.id == "nka" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].actor.reference == "Practitioner/example" assert inst.participant[0].function.coding[0].code == "author" assert inst.participant[0].function.coding[0].display == "Author" assert ( inst.participant[0].function.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/provenance-participant-type" } ).valueUri ) assert inst.patient.reference == "Patient/mom" assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-06T15:37:31-06:00"} ).valueDateTime ) assert inst.text.status == "generated" def test_allergyintolerance_3(base_settings): """No. 3 tests collection for AllergyIntolerance. Test File: allergyintolerance-nka.json """ filename = base_settings["unittest_data_dir"] / "allergyintolerance-nka.json" inst = allergyintolerance.AllergyIntolerance.model_validate_json( filename.read_bytes() ) assert "AllergyIntolerance" == inst.get_resource_type() impl_allergyintolerance_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AllergyIntolerance" == data["resourceType"] inst2 = allergyintolerance.AllergyIntolerance(**data) impl_allergyintolerance_3(inst2) def impl_allergyintolerance_4(inst): assert inst.category[0] == "medication" assert inst.clinicalStatus.coding[0].code == "active" assert inst.clinicalStatus.coding[0].display == "Active" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical" } ).valueUri ) assert inst.code.coding[0].code == "7980" assert inst.code.coding[0].display == "Penicillin G" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.criticality == "high" assert inst.id == "medication" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].actor.reference == "Practitioner/example" assert inst.participant[0].function.coding[0].code == "author" assert inst.participant[0].function.coding[0].display == "Author" assert ( inst.participant[0].function.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/provenance-participant-type" } ).valueUri ) assert inst.patient.reference == "Patient/example" assert inst.reaction[0].manifestation[0].concept.coding[0].code == "247472004" assert inst.reaction[0].manifestation[0].concept.coding[0].display == "Hives" assert ( inst.reaction[0].manifestation[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2010-03-01"} ).valueDateTime ) assert inst.text.status == "generated" assert inst.verificationStatus.coding[0].code == "unconfirmed" assert inst.verificationStatus.coding[0].display == "Unconfirmed" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification" } ).valueUri ) def test_allergyintolerance_4(base_settings): """No. 4 tests collection for AllergyIntolerance. Test File: allergyintolerance-medication.json """ filename = base_settings["unittest_data_dir"] / "allergyintolerance-medication.json" inst = allergyintolerance.AllergyIntolerance.model_validate_json( filename.read_bytes() ) assert "AllergyIntolerance" == inst.get_resource_type() impl_allergyintolerance_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AllergyIntolerance" == data["resourceType"] inst2 = allergyintolerance.AllergyIntolerance(**data) impl_allergyintolerance_4(inst2) def impl_allergyintolerance_5(inst): assert inst.category[0] == "food" assert inst.clinicalStatus.coding[0].code == "active" assert inst.clinicalStatus.coding[0].display == "Active" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical" } ).valueUri ) assert inst.code.coding[0].code == "227037002" assert inst.code.coding[0].display == "Fish - dietary (substance)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Allergic to fresh fish. Tolerates canned fish" assert inst.id == "fishallergy" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/ids/patients/risks"} ).valueUri ) assert inst.identifier[0].value == "49476535" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].actor.reference == "Practitioner/example" assert inst.participant[0].function.coding[0].code == "author" assert inst.participant[0].function.coding[0].display == "Author" assert ( inst.participant[0].function.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/provenance-participant-type" } ).valueUri ) assert inst.patient.reference == "Patient/example" assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-06T15:37:31-06:00"} ).valueDateTime ) assert inst.text.status == "additional" assert inst.verificationStatus.coding[0].code == "confirmed" assert inst.verificationStatus.coding[0].display == "Confirmed" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification" } ).valueUri ) def test_allergyintolerance_5(base_settings): """No. 5 tests collection for AllergyIntolerance. Test File: allergyintolerance-fishallergy.json """ filename = ( base_settings["unittest_data_dir"] / "allergyintolerance-fishallergy.json" ) inst = allergyintolerance.AllergyIntolerance.model_validate_json( filename.read_bytes() ) assert "AllergyIntolerance" == inst.get_resource_type() impl_allergyintolerance_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AllergyIntolerance" == data["resourceType"] inst2 = allergyintolerance.AllergyIntolerance(**data) impl_allergyintolerance_5(inst2) def impl_allergyintolerance_6(inst): assert inst.code.coding[0].code == "409137002" assert inst.code.coding[0].display == "No Known Drug Allergy (situation)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "NKDA" assert inst.id == "nkda" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].actor.reference == "Practitioner/example" assert inst.participant[0].function.coding[0].code == "author" assert inst.participant[0].function.coding[0].display == "Author" assert ( inst.participant[0].function.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/provenance-participant-type" } ).valueUri ) assert inst.patient.reference == "Patient/mom" assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-06T15:37:31-06:00"} ).valueDateTime ) assert inst.text.status == "generated" def test_allergyintolerance_6(base_settings): """No. 6 tests collection for AllergyIntolerance. Test File: allergyintolerance-nkda.json """ filename = base_settings["unittest_data_dir"] / "allergyintolerance-nkda.json" inst = allergyintolerance.AllergyIntolerance.model_validate_json( filename.read_bytes() ) assert "AllergyIntolerance" == inst.get_resource_type() impl_allergyintolerance_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AllergyIntolerance" == data["resourceType"] inst2 = allergyintolerance.AllergyIntolerance(**data) impl_allergyintolerance_6(inst2) ================================================ FILE: fhir/resources/tests/test_appointment.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Appointment Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import appointment from .conftest import ExternalValidatorModel def impl_appointment_1(inst): assert inst.appointmentType.coding[0].code == "FOLLOWUP" assert ( inst.appointmentType.coding[0].display == "A follow up visit from a previous appointment" ) assert ( inst.appointmentType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0276"} ).valueUri ) assert inst.basedOn[0].reference == "ServiceRequest/myringotomy" assert inst.class_fhir[0].coding[0].code == "AMB" assert inst.class_fhir[0].coding[0].display == "ambulatory" assert ( inst.class_fhir[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-10-10"} ).valueDateTime ) assert inst.description == "Discussion on the results of your recent MRI" assert ( inst.end == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-10T11:00:00Z"} ).valueInstant ) assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == ( "Further expand on the results of the MRI and determine the " "next actions that may be appropriate." ) assert inst.participant[0].actor.display == "Peter James Chalmers" assert inst.participant[0].actor.reference == "Patient/example" assert inst.participant[0].required is True assert inst.participant[0].status == "accepted" assert inst.participant[1].actor.display == "Dr Adam Careful" assert inst.participant[1].actor.reference == "Practitioner/example" assert inst.participant[1].required is True assert inst.participant[1].status == "accepted" assert inst.participant[1].type[0].coding[0].code == "ATND" assert ( inst.participant[1].type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.participant[2].actor.display == "South Wing, second floor" assert inst.participant[2].actor.reference == "Location/1" assert inst.participant[2].required is True assert inst.participant[2].status == "accepted" assert inst.patientInstruction[0].concept.text == ( "Please avoid excessive travel (specifically flying) before " "this appointment" ) assert inst.reason[0].reference.display == "Severe burn of left ear" assert inst.reason[0].reference.reference == "Condition/example" assert inst.serviceCategory[0].coding[0].code == "gp" assert inst.serviceCategory[0].coding[0].display == "General Practice" assert ( inst.serviceCategory[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/service-category"} ).valueUri ) assert inst.serviceType[0].concept.coding[0].code == "52" assert inst.serviceType[0].concept.coding[0].display == "General Discussion" assert inst.specialty[0].coding[0].code == "394814009" assert inst.specialty[0].coding[0].display == "General practice" assert ( inst.specialty[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.start == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-10T09:00:00Z"} ).valueInstant ) assert inst.status == "booked" assert inst.subject.display == "Peter James Chalmers" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Brian MRI ' "results discussion
" ) assert inst.text.status == "generated" def test_appointment_1(base_settings): """No. 1 tests collection for Appointment. Test File: appointment-example.json """ filename = base_settings["unittest_data_dir"] / "appointment-example.json" inst = appointment.Appointment.model_validate_json(filename.read_bytes()) assert "Appointment" == inst.get_resource_type() impl_appointment_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Appointment" == data["resourceType"] inst2 = appointment.Appointment(**data) impl_appointment_1(inst2) def impl_appointment_2(inst): assert inst.appointmentType.coding[0].code == "WALKIN" assert ( inst.appointmentType.coding[0].display == "A previously unscheduled walk-in visit" ) assert ( inst.appointmentType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0276"} ).valueUri ) assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-12-02"} ).valueDateTime ) assert inst.description == "Discussion on the results of your recent MRI" assert inst.id == "examplereq" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/sampleappointment-identifier"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.minutesDuration == 15 assert inst.note[0].text == ( "Further expand on the results of the MRI and determine the " "next actions that may be appropriate." ) assert inst.participant[0].actor.display == "Peter James Chalmers" assert inst.participant[0].actor.reference == "Patient/example" assert inst.participant[0].required is True assert inst.participant[0].status == "needs-action" assert inst.participant[1].required is True assert inst.participant[1].status == "needs-action" assert inst.participant[1].type[0].coding[0].code == "ATND" assert ( inst.participant[1].type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.participant[2].actor.display == "South Wing, second floor" assert inst.participant[2].actor.reference == "Location/1" assert inst.participant[2].required is True assert inst.participant[2].status == "accepted" assert inst.reason[0].concept.coding[0].code == "413095006" assert ( inst.reason[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.reason[0].concept.text == "Clinical Review" assert ( inst.requestedPeriod[0].end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-06-09"} ).valueDateTime ) assert ( inst.requestedPeriod[0].start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-06-02"} ).valueDateTime ) assert inst.serviceCategory[0].coding[0].code == "gp" assert inst.serviceCategory[0].coding[0].display == "General Practice" assert ( inst.serviceCategory[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/service-category"} ).valueUri ) assert inst.slot[0].reference == "Slot/example" assert inst.specialty[0].coding[0].code == "394814009" assert inst.specialty[0].coding[0].display == "General practice" assert ( inst.specialty[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.status == "proposed" assert inst.subject.display == "Peter James Chalmers" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Brian MRI ' "results discussion
" ) assert inst.text.status == "generated" def test_appointment_2(base_settings): """No. 2 tests collection for Appointment. Test File: appointment-example-request.json """ filename = base_settings["unittest_data_dir"] / "appointment-example-request.json" inst = appointment.Appointment.model_validate_json(filename.read_bytes()) assert "Appointment" == inst.get_resource_type() impl_appointment_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Appointment" == data["resourceType"] inst2 = appointment.Appointment(**data) impl_appointment_2(inst2) def impl_appointment_3(inst): assert inst.appointmentType.coding[0].code == "FOLLOWUP" assert ( inst.appointmentType.coding[0].display == "A follow up visit from a previous appointment" ) assert ( inst.appointmentType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0276"} ).valueUri ) assert inst.description == "Discussion about Peter Chalmers ultrasound results" assert ( inst.end == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-09T11:00:00Z"} ).valueInstant ) assert inst.id == "2docs" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == ( "Clarify the results of the ultrasound to ensure context of " "test was correct" ) assert inst.participant[0].actor.display == "Dr Adam Careful" assert inst.participant[0].actor.reference == "Practitioner/example" assert inst.participant[0].required is True assert inst.participant[0].status == "accepted" assert inst.participant[1].actor.display == "Luigi Maas" assert inst.participant[1].actor.reference == "Practitioner/f202" assert inst.participant[1].required is True assert inst.participant[1].status == "accepted" assert inst.serviceCategory[0].coding[0].code == "gp" assert inst.serviceCategory[0].coding[0].display == "General Practice" assert ( inst.serviceCategory[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/service-category"} ).valueUri ) assert inst.serviceType[0].concept.coding[0].code == "52" assert inst.serviceType[0].concept.coding[0].display == "General Discussion" assert inst.specialty[0].coding[0].code == "394814009" assert inst.specialty[0].coding[0].display == "General practice" assert ( inst.specialty[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.start == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-09T09:00:00Z"} ).valueInstant ) assert inst.status == "booked" assert inst.subject.display == "Peter James Chalmers" assert inst.subject.reference == "Patient/example" assert inst.supportingInformation[0].reference == "DiagnosticReport/ultrasound" assert inst.text.div == ( '
Discussion of ' "Peter's ultrasound results to plan ongoing treatment " "options
" ) assert inst.text.status == "generated" def test_appointment_3(base_settings): """No. 3 tests collection for Appointment. Test File: appointment-example2doctors.json """ filename = base_settings["unittest_data_dir"] / "appointment-example2doctors.json" inst = appointment.Appointment.model_validate_json(filename.read_bytes()) assert "Appointment" == inst.get_resource_type() impl_appointment_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Appointment" == data["resourceType"] inst2 = appointment.Appointment(**data) impl_appointment_3(inst2) ================================================ FILE: fhir/resources/tests/test_appointmentresponse.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/AppointmentResponse Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import appointmentresponse from .conftest import ExternalValidatorModel def impl_appointmentresponse_1(inst): assert inst.actor.display == "Dr Adam Careful" assert inst.actor.reference == "Practitioner/example" assert inst.appointment.display == "Brian MRI results discussion" assert inst.appointment.reference == "Appointment/examplereq" assert inst.comment == "can't we try for this time, can't do mornings" assert ( inst.end == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-25T13:30:00Z"} ).valueInstant ) assert inst.id == "exampleresp" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/sampleappointmentresponse-identifier"} ).valueUri ) assert inst.identifier[0].value == "response123" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participantStatus == "tentative" assert inst.participantType[0].coding[0].code == "ATND" assert ( inst.participantType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert ( inst.start == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-25T13:15:00Z"} ).valueInstant ) assert inst.text.div == ( '
Accept Brian MRI' " results discussion
" ) assert inst.text.status == "generated" def test_appointmentresponse_1(base_settings): """No. 1 tests collection for AppointmentResponse. Test File: appointmentresponse-example-req.json """ filename = ( base_settings["unittest_data_dir"] / "appointmentresponse-example-req.json" ) inst = appointmentresponse.AppointmentResponse.model_validate_json( filename.read_bytes() ) assert "AppointmentResponse" == inst.get_resource_type() impl_appointmentresponse_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AppointmentResponse" == data["resourceType"] inst2 = appointmentresponse.AppointmentResponse(**data) impl_appointmentresponse_1(inst2) def impl_appointmentresponse_2(inst): assert inst.actor.display == "Peter James Chalmers" assert inst.actor.reference == "Patient/example" assert inst.appointment.display == "Brian MRI results discussion" assert inst.appointment.reference == "Appointment/example" assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participantStatus == "accepted" assert inst.text.div == ( '
Accept Brian MRI' " results discussion
" ) assert inst.text.status == "generated" def test_appointmentresponse_2(base_settings): """No. 2 tests collection for AppointmentResponse. Test File: appointmentresponse-example.json """ filename = base_settings["unittest_data_dir"] / "appointmentresponse-example.json" inst = appointmentresponse.AppointmentResponse.model_validate_json( filename.read_bytes() ) assert "AppointmentResponse" == inst.get_resource_type() impl_appointmentresponse_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AppointmentResponse" == data["resourceType"] inst2 = appointmentresponse.AppointmentResponse(**data) impl_appointmentresponse_2(inst2) def impl_appointmentresponse_3(inst): assert inst.actor.display == "South Wing, second floor" assert inst.actor.reference == "Location/1" assert inst.appointment.display == "Brian MRI results discussion" assert inst.appointment.reference == "Appointment/example" assert inst.id == "example-loc" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participantStatus == "accepted" assert inst.text.div == ( '
Auto-Accept ' "Brian MRI results discussion
" ) assert inst.text.status == "generated" def test_appointmentresponse_3(base_settings): """No. 3 tests collection for AppointmentResponse. Test File: appointmentresponse-example-loc.json """ filename = ( base_settings["unittest_data_dir"] / "appointmentresponse-example-loc.json" ) inst = appointmentresponse.AppointmentResponse.model_validate_json( filename.read_bytes() ) assert "AppointmentResponse" == inst.get_resource_type() impl_appointmentresponse_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AppointmentResponse" == data["resourceType"] inst2 = appointmentresponse.AppointmentResponse(**data) impl_appointmentresponse_3(inst2) ================================================ FILE: fhir/resources/tests/test_artifactassessment.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ArtifactAssessment Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import artifactassessment from .conftest import ExternalValidatorModel def impl_artifactassessment_1(inst): assert inst.artifactCanonical == "http://fevir.net/resources/Evidence/7637" assert inst.content[0].author.display == ( "COVID-19 Knowledge Accelerator Evidence 7637 Authors (Brian " "S. Alper, Harold Lehmann, Ahmad Sofi-Mahmudi, Joanne " "Dehnbostel, Ilkka Kunnamo)" ) assert inst.content[0].classifier[0].coding[0].code == "extremely-serious-concern" assert ( inst.content[0].classifier[0].coding[0].display == "extremely serious concern" ) assert ( inst.content[0].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.content[0].classifier[0].coding[0].userSelected is True assert inst.content[0].classifier[0].coding[0].version == "5.0.0" assert ( inst.content[0].component[0].author.display == "Brian S. Alper, Joanne Dehnbostel, Muhammad Afzal" ) assert inst.content[0].component[0].classifier[0].coding[0].code == "no-concern" assert ( inst.content[0].component[0].classifier[0].coding[0].display == "no serious concern" ) assert ( inst.content[0].component[0].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.content[0].component[0].classifier[0].coding[0].userSelected is True assert inst.content[0].component[0].classifier[0].coding[0].version == "5.0.0" assert inst.content[0].component[0].summary == ( "Inclusion of suspected COVID-19 in 1 of 3 trials may " "introduce selection bias, but the impact appears limited." ) assert inst.content[0].component[0].type.text == "Selection Bias" assert inst.content[0].component[1].author.display == ( "Brian S. Alper, Ilkka Kunnamo, Alfonso Iorio, Joanne " "Dehnbostel, Harold Lehmann, Kenneth Wilkins; clarifying " "explanation reviewed by Janice Tufte" ) assert ( inst.content[0].component[1].classifier[0].coding[0].code == "serious-concern" ) assert ( inst.content[0].component[1].classifier[0].coding[0].display == "serious concern" ) assert ( inst.content[0].component[1].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.content[0].component[1].classifier[0].coding[0].userSelected is True assert inst.content[0].component[1].classifier[0].coding[0].version == "5.0.0" assert inst.content[0].component[1].component[3].author.display == ( "Brian S. Alper, Joanne Dehnbostel, Harold Lehmann, Kenneth " "Wilkins" ) assert inst.content[0].component[1].component[3].classifier[0].text == ( "Adaptive randomization is not a concern by itself, only if " "it results in a confounding difference." ) assert inst.content[0].component[1].component[3].component[0].summary == ( "Definition of Allocation Bias = A confounding covariate bias" " resulting from methods for assignment of the independent " "variable by the investigator to evaluate a response or " "outcome." ) assert inst.content[0].component[1].component[3].component[1].summary == ( "ATTACC implemented response-adaptive randomization on " "December 15, 2020, which led to imbalanced randomization." ) assert inst.content[0].component[1].component[3].summary == ( "Response-adaptive randomization led to imbalanced " "randomization." ) assert inst.content[0].component[1].component[3].type.text == "Allocation Bias" assert inst.content[0].component[1].component[4].author.display == ( "Brian S. Alper, Joanne Dehnbostel, Harold Lehmann, Kenneth " "Wilkins" ) assert ( inst.content[0].component[1].component[4].classifier[0].coding[0].code == "serious-concern" ) assert ( inst.content[0].component[1].component[4].classifier[0].coding[0].display == "serious concern" ) assert ( inst.content[0].component[1].component[4].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert ( inst.content[0].component[1].component[4].classifier[0].coding[0].userSelected is True ) assert ( inst.content[0].component[1].component[4].classifier[0].coding[0].version == "5.0.0" ) assert inst.content[0].component[1].component[4].component[0].summary == ( "Definition of Confounding difference = A confounding " "covariate bias in which the unequal distribution of a " "potentially distorting variable is recognized." ) assert inst.content[0].component[1].component[4].component[1].summary == ( "Incomplete reporting limits the determination of the " "potential degree of influence of calendar time." ) assert inst.content[0].component[1].component[4].summary == ( "There is an unequal distribution of calendar time between " "the groups being compared." ) assert ( inst.content[0].component[1].component[4].type.text == "Confounding difference" ) assert inst.content[0].component[1].type.text == "Confounding Covariate Bias" assert inst.content[0].component[2].author.display == ( "Brian S. Alper, Joanne Dehnbostel, Harold Lehmann, Muhammad " "Afzal" ) assert ( inst.content[0].component[2].classifier[0].coding[0].code == "very-serious-concern" ) assert ( inst.content[0].component[2].classifier[0].coding[0].display == "very serious concern" ) assert ( inst.content[0].component[2].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.content[0].component[2].classifier[0].coding[0].userSelected is True assert inst.content[0].component[2].classifier[0].coding[0].version == "5.0.0" assert inst.content[0].component[2].component[0].summary == ( "Definition of Performance Bias = A bias resulting from " "differences between the received exposure and the intended " "exposure." ) assert inst.content[0].component[2].component[1].author.display == ( "Brian S. Alper; clarifying explanation reviewed by Janice " "Tufte" ) assert ( inst.content[0].component[2].component[1].classifier[0].coding[0].code == "very-serious-concern" ) assert ( inst.content[0].component[2].component[1].classifier[0].coding[0].display == "very serious concern" ) assert ( inst.content[0].component[2].component[1].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert ( inst.content[0].component[2].component[1].classifier[0].coding[0].userSelected is True ) assert ( inst.content[0].component[2].component[1].classifier[0].coding[0].version == "5.0.0" ) assert inst.content[0].component[2].component[1].component[0].summary == ( "The absolute difference in survival without intubation was " "1%, so 3% of the 4% absolute difference in the primary " 'outcome can be considered "organ support without ' 'intubation".' ) assert inst.content[0].component[2].component[1].component[2].summary == ( "Awareness of treatment assignment may reduce clinical " 'decision to initiate "organ support without intubation" in' " patients with higher risk of major bleeding." ) assert inst.content[0].component[2].component[1].component[3].summary == ( "Definition of Inadequate blinding of intervention deliverers" " = A performance bias due to awareness of the allocated " "intervention by individuals providing or delivering the " "intervention." ) assert inst.content[0].component[2].component[1].summary == ( "Lack of blinding may explain reported differences in the " "primary outcome." ) assert ( inst.content[0].component[2].component[1].type.text == "Inadequate blinding of intervention deliverers" ) assert ( inst.content[0].component[2].component[2].author.display == "Surbhi Shah, Brian S. Alper" ) assert ( inst.content[0].component[2].component[2].classifier[0].text == "degree of concern unclear" ) assert inst.content[0].component[2].component[2].component[0].summary == ( "Therapeutic dose anticoagulation (in the first 24-48 hours " "following randomization) was reported in 79.6% of the " "therapeutic arm and 0.9% of the usual care arm. (Table S3)" ) assert inst.content[0].component[2].component[2].component[1].summary == ( "Definition of Deviation from study intervention protocol = A" " performance bias in which the intervention received differs" " from the intervention specified in the study protocol." ) assert ( inst.content[0].component[2].component[2].summary == "Crossover to other intervention in 20%" ) assert ( inst.content[0].component[2].component[2].type.text == "Deviation from study intervention protocol" ) assert inst.content[0].component[2].component[3].author.display == ( "COVID-19 Knowledge Accelerator Working Group discussion with" " Brian S. Alper, Ilkka Kunnamo, Joanne Dehnbostel; " "Performance Bias concern initially suggested by Harold " "Lehmann" ) assert ( inst.content[0].component[2].component[3].classifier[0].text == "limited concern" ) assert inst.content[0].component[2].component[3].component[0].summary == ( "Initial adherence to the protocol-assigned anticoagulation " "dose after randomization was 88.3% in the therapeutic-dose " "anticoagulation group and 98.3% in the thromboprophylaxis " "group (Table S3)." ) assert inst.content[0].component[2].component[3].component[1].summary == ( "Definition of Nonadherence of implementation = A performance" " bias in which the intervention deliverers do not completely" " adhere to the expected intervention." ) assert ( inst.content[0].component[2].component[3].type.text == "Nonadherence of implementation" ) assert inst.content[0].component[2].summary == ( "Awareness of treatment assignment may reduce clinical " 'decision to initiate some types of "organ support" in ' "patients with higher risk of major bleeding." ) assert inst.content[0].component[2].type.text == "Performance Bias" assert ( inst.content[0].component[3].author.display == "Brian S. Alper, Joanne Dehnbostel, Muhammad Afzal" ) assert inst.content[0].component[3].classifier[0].coding[0].code == "no-concern" assert ( inst.content[0].component[3].classifier[0].coding[0].display == "no serious concern" ) assert ( inst.content[0].component[3].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.content[0].component[3].classifier[0].coding[0].userSelected is True assert inst.content[0].component[3].classifier[0].coding[0].version == "5.0.0" assert inst.content[0].component[3].component[0].summary == ( "Definition of Detection Bias = A bias due to distortions in " "how variable values (data) are determined." ) assert inst.content[0].component[3].type.text == "Detection Bias" assert ( inst.content[0].component[4].author.display == "Brian S. Alper, Joanne Dehnbostel, Muhammad Afzal" ) assert inst.content[0].component[4].classifier[0].coding[0].code == "no-concern" assert ( inst.content[0].component[4].classifier[0].coding[0].display == "no serious concern" ) assert ( inst.content[0].component[4].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.content[0].component[4].classifier[0].coding[0].userSelected is True assert inst.content[0].component[4].classifier[0].coding[0].version == "5.0.0" assert inst.content[0].component[4].component[0].summary == ( "Definition of Attrition Bias = A bias due to absence of " "expected participation or data collection after selection " "for study inclusion." ) assert inst.content[0].component[4].summary == ( "Only 19 of 1190 (1.6%) therapeutic group and 6 of 1054 (0.6)" " prophylactic group were excluded after randomization." ) assert inst.content[0].component[4].type.text == "Attrition Bias" assert inst.content[0].component[5].author.display == ( "Brian S. Alper, Joanne Dehnbostel, Muhammad Afzal, Janice " "Tufte" ) assert ( inst.content[0].component[5].classifier[0].coding[0].code == "very-serious-concern" ) assert ( inst.content[0].component[5].classifier[0].coding[0].display == "very serious concern" ) assert ( inst.content[0].component[5].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.content[0].component[5].classifier[0].coding[0].userSelected is True assert inst.content[0].component[5].classifier[0].coding[0].version == "5.0.0" assert inst.content[0].component[5].component[0].summary == ( "Definition of Analysis Bias = A bias related to the analytic" " process applied to the data." ) assert inst.content[0].component[5].component[1].author.display == ( "Brian S. Alper, Joanne Dehnbostel, Muhammad Afzal, Janice " "Tufte" ) assert ( inst.content[0].component[5].component[1].classifier[0].coding[0].code == "very-serious-concern" ) assert ( inst.content[0].component[5].component[1].classifier[0].coding[0].display == "very serious concern" ) assert ( inst.content[0].component[5].component[1].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert ( inst.content[0].component[5].component[1].classifier[0].coding[0].userSelected is True ) assert ( inst.content[0].component[5].component[1].classifier[0].coding[0].version == "5.0.0" ) assert inst.content[0].component[5].component[1].component[0].summary == ( "Definition of Bias related to selection of the analysis = An" " analysis bias due to inappropriate choice of analysis " "methods before the analysis is applied." ) assert inst.content[0].component[5].component[1].component[1].summary == ( "There was no pre-specified frequentist analysis. There was " "no posthoc frequentist analysis reported." ) assert inst.content[0].component[5].component[1].component[2].summary == ( "It is uncertain what a frequentist analysis would show and " "uncertain whether the choice of Bayesian analysis or " "frequentist analysis has a substantial influence on the " "results." ) assert inst.content[0].component[5].component[1].summary == ( "A frequentist analysis is not reported so we cannot " "determine if the results are sensitive to the analytic " "method" ) assert ( inst.content[0].component[5].component[1].type.text == "Bias related to selection of the analysis" ) assert inst.content[0].component[5].component[2].author.display == ( "Brian S. Alper, Joanne Dehnbostel, Muhammad Afzal, Janice " "Tufte" ) assert ( inst.content[0].component[5].component[2].classifier[0].coding[0].code == "very-serious-concern" ) assert ( inst.content[0].component[5].component[2].classifier[0].coding[0].display == "very serious concern" ) assert ( inst.content[0].component[5].component[2].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert ( inst.content[0].component[5].component[2].classifier[0].coding[0].userSelected is True ) assert ( inst.content[0].component[5].component[2].classifier[0].coding[0].version == "5.0.0" ) assert inst.content[0].component[5].component[2].component[0].summary == ( "There was no “minimally important difference”. So a 99% " "probability of having an odds ratio > 1 (even if the " "magnitude of effect is infinitesimal) was used to decide it " "was time to stop the trial." ) assert inst.content[0].component[5].component[2].summary == ( "The stopping criteria were based on statistical significance" " and not magnitude of effect." ) assert ( inst.content[0].component[5].component[2].type.text == "Early trial termination" ) assert inst.content[0].component[5].summary == ( "It is unknown if the results are sensitive to the analytic " "method, and the stopping criteria were based on statistical " "significance and not magnitude of effect." ) assert inst.content[0].component[5].type.text == "Analysis Bias" assert inst.content[0].freeToShare is True assert inst.content[0].informationType == "rating" assert inst.content[0].type.coding[0].code == "RiskOfBias" assert inst.content[0].type.coding[0].display == "Risk of bias" assert ( inst.content[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.content[0].type.coding[0].userSelected is True assert inst.content[0].type.coding[0].version == "5.0.0" assert inst.content[1].author.display == "Ilkka Kunnamo" assert inst.content[1].informationType == "comment" assert ( inst.content[1].summary == "Results not consistent with critically ill cohort." ) assert inst.content[1].type.coding[0].code == "Inconsistency" assert inst.content[1].type.coding[0].display == "Inconsistency" assert ( inst.content[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.content[1].type.coding[0].userSelected is True assert inst.content[1].type.coding[0].version == "5.0.0" assert inst.copyright == "https://creativecommons.org/licenses/by-nc-sa/4.0/" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-11-02T14:31:30.239Z"} ).valueDateTime ) assert inst.id == "risk-of-bias-example" assert inst.identifier[0].assigner.display == "Computable Publishing LLC" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://fevir.net"} ).valueUri ) assert inst.identifier[0].type.text == "FEvIR Object Identifier" assert inst.identifier[0].value == "27751" assert ( inst.lastReviewDate == ExternalValidatorModel.model_validate({"valueDate": "2021-08-11"}).valueDate ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_artifactassessment_1(base_settings): """No. 1 tests collection for ArtifactAssessment. Test File: artifactassessment-risk-of-bias-example.json """ filename = ( base_settings["unittest_data_dir"] / "artifactassessment-risk-of-bias-example.json" ) inst = artifactassessment.ArtifactAssessment.model_validate_json( filename.read_bytes() ) assert "ArtifactAssessment" == inst.get_resource_type() impl_artifactassessment_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ArtifactAssessment" == data["resourceType"] inst2 = artifactassessment.ArtifactAssessment(**data) impl_artifactassessment_1(inst2) def impl_artifactassessment_2(inst): assert inst.artifactReference.display == ( "Critically appraised summary of all-cause mortality in meta-" "analysis of RCTs of heparin for moderately ill patients with" " COVID-19" ) assert inst.artifactReference.reference == "Evidence/18812" assert ( inst.artifactReference.type == ExternalValidatorModel.model_validate({"valueUri": "Evidence"}).valueUri ) assert inst.content[0].author.display == "Brian S. Alper" assert inst.content[0].classifier[0].coding[0].code == "very-low" assert inst.content[0].classifier[0].coding[0].display == "Very low quality" assert ( inst.content[0].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.content[0].component[0].author.display == "Brian S. Alper" assert ( inst.content[0].component[0].classifier[0].coding[0].code == "serious-concern" ) assert ( inst.content[0].component[0].classifier[0].coding[0].display == "serious concern" ) assert ( inst.content[0].component[0].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.content[0].component[0].informationType == "rating" assert ( inst.content[0].component[0].summary == "risk of bias in both included trials" ) assert inst.content[0].component[0].type.coding[0].code == "RiskOfBias" assert inst.content[0].component[0].type.coding[0].display == "Risk of bias" assert ( inst.content[0].component[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.content[0].component[1].author.display == "Brian S. Alper" assert ( inst.content[0].component[1].classifier[0].coding[0].code == "serious-concern" ) assert ( inst.content[0].component[1].classifier[0].coding[0].display == "serious concern" ) assert ( inst.content[0].component[1].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.content[0].component[1].informationType == "rating" assert inst.content[0].component[1].summary == ( "high degree of heterogeneity (I-squared 80.7%) with " "confidence intervals of 2 trial effect estimates barely " "overlapping" ) assert inst.content[0].component[1].type.coding[0].code == "Inconsistency" assert inst.content[0].component[1].type.coding[0].display == "Inconsistency" assert ( inst.content[0].component[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.content[0].component[2].author.display == "Brian S. Alper" assert inst.content[0].component[2].classifier[0].coding[0].code == "no-concern" assert ( inst.content[0].component[2].classifier[0].coding[0].display == "no serious concern" ) assert ( inst.content[0].component[2].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.content[0].component[2].informationType == "rating" assert inst.content[0].component[2].type.coding[0].code == "Indirectness" assert inst.content[0].component[2].type.coding[0].display == "Indirectness" assert ( inst.content[0].component[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.content[0].component[3].author.display == "Brian S. Alper" assert ( inst.content[0].component[3].classifier[0].coding[0].code == "serious-concern" ) assert ( inst.content[0].component[3].classifier[0].coding[0].display == "serious concern" ) assert ( inst.content[0].component[3].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.content[0].component[3].informationType == "rating" assert inst.content[0].component[3].summary == ( "95% confidence interval includes both large effects and no " "effects" ) assert inst.content[0].component[3].type.coding[0].code == "Imprecision" assert inst.content[0].component[3].type.coding[0].display == "Imprecision" assert ( inst.content[0].component[3].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.content[0].component[4].author.display == "Brian S. Alper" assert inst.content[0].component[4].classifier[0].coding[0].code == "no-concern" assert ( inst.content[0].component[4].classifier[0].coding[0].display == "no serious concern" ) assert ( inst.content[0].component[4].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.content[0].component[4].informationType == "rating" assert inst.content[0].component[4].type.coding[0].code == "PublicationBias" assert inst.content[0].component[4].type.coding[0].display == "Publication bias" assert ( inst.content[0].component[4].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.content[0].freeToShare is True assert inst.content[0].informationType == "rating" assert inst.content[0].summary == ( "serious concerns with risk of bias, inconsistency, and " "imprecision" ) assert inst.content[0].type.coding[0].code == "Overall" assert inst.content[0].type.coding[0].display == "Overall certainty" assert ( inst.content[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.copyright == "https://creativecommons.org/licenses/by-nc-sa/4.0/" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-11-02T14:48:59.890Z"} ).valueDateTime ) assert inst.id == "example-certainty-rating" assert inst.identifier[0].assigner.display == "Computable Publishing LLC" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://fevir.net"} ).valueUri ) assert inst.identifier[0].type.text == "FEvIR Object Identifier" assert inst.identifier[0].value == "27756" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_artifactassessment_2(base_settings): """No. 2 tests collection for ArtifactAssessment. Test File: artifactassessment-example-certainty-rating.json """ filename = ( base_settings["unittest_data_dir"] / "artifactassessment-example-certainty-rating.json" ) inst = artifactassessment.ArtifactAssessment.model_validate_json( filename.read_bytes() ) assert "ArtifactAssessment" == inst.get_resource_type() impl_artifactassessment_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ArtifactAssessment" == data["resourceType"] inst2 = artifactassessment.ArtifactAssessment(**data) impl_artifactassessment_2(inst2) ================================================ FILE: fhir/resources/tests/test_auditevent.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/AuditEvent Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import auditevent from .conftest import ExternalValidatorModel def impl_auditevent_1(inst): assert inst.action == "E" 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 == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/extra-security-role-type" } ).valueUri ) assert inst.agent[0].who.display == "Grahame Grieve" assert inst.agent[0].who.identifier.value == "95" assert ( inst.agent[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/auditevent-AlternativeUserID" } ).valueUri ) assert inst.agent[1].extension[0].valueIdentifier.type.text == "process ID" assert inst.agent[1].extension[0].valueIdentifier.value == "6580" assert inst.agent[1].networkString == "Workstation1.ehr.familyclinic.com" 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert ( inst.agent[1].who.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.4.2"} ).valueUri ) assert inst.agent[1].who.identifier.value == "2.16.840.1.113883.4.2" assert inst.category[0].coding[0].code == "rest" assert inst.category[0].coding[0].display == "Restful Operation" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-event-type"} ).valueUri ) assert inst.code.coding[0].code == "search" assert inst.code.coding[0].display == "search" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert ( inst.entity[0].query == ExternalValidatorModel.model_validate( { "valueBase64Binary": ( "aHR0cDovL2ZoaXItZGV2LmhlYWx0aGludGVyc2VjdGlvbnMuY29tLmF1L29w" "ZW4vRW5jb3VudGVyP3BhcnRpY2lwYW50PTEz" ) } ).valueBase64Binary ) assert inst.entity[0].role.coding[0].code == "24" assert inst.entity[0].role.coding[0].display == "Query" assert ( inst.entity[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/object-role"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome.code.code == "0" assert inst.outcome.code.display == "Success" assert ( inst.outcome.code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-event-outcome"} ).valueUri ) assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2015-08-22T23:42:24Z"} ).valueInstant ) assert inst.source.observer.display == "hl7connect.healthintersections.com.au" assert inst.source.type[0].coding[0].code == "3" assert inst.source.type[0].coding[0].display == "Web Server" assert ( inst.source.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/security-source-type"} ).valueUri ) assert inst.text.status == "extensions" def test_auditevent_1(base_settings): """No. 1 tests collection for AuditEvent. Test File: audit-event-example-search.json """ filename = base_settings["unittest_data_dir"] / "audit-event-example-search.json" inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes()) assert "AuditEvent" == inst.get_resource_type() impl_auditevent_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AuditEvent" == data["resourceType"] inst2 = auditevent.AuditEvent(**data) impl_auditevent_1(inst2) def impl_auditevent_2(inst): assert inst.action == "E" assert inst.agent[0].networkString == "127.0.0.1" 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 == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/extra-security-role-type" } ).valueUri ) assert inst.agent[0].who.display == "Grahame Grieve" assert inst.agent[0].who.identifier.value == "95" assert ( inst.agent[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/auditevent-AlternativeUserID" } ).valueUri ) assert inst.agent[1].extension[0].valueIdentifier.type.text == "process ID" assert inst.agent[1].extension[0].valueIdentifier.value == "6580" assert inst.agent[1].networkString == "Workstation1.ehr.familyclinic.com" 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert ( inst.agent[1].who.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.4.2"} ).valueUri ) assert inst.agent[1].who.identifier.value == "2.16.840.1.113883.4.2" assert inst.category[0].coding[0].code == "110114" assert inst.category[0].coding[0].display == "User Authentication" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.code.coding[0].code == "110123" assert inst.code.coding[0].display == "Logout" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.id == "example-logout" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome.code.code == "0" assert inst.outcome.code.display == "Success" assert ( inst.outcome.code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-event-outcome"} ).valueUri ) assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2013-06-20T23:46:41Z"} ).valueInstant ) assert inst.source.observer.display == "Cloud" assert ( inst.source.observer.identifier.value == "hl7connect.healthintersections.com.au" ) assert inst.source.type[0].coding[0].code == "3" assert inst.source.type[0].coding[0].display == "Web Server" assert ( inst.source.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/security-source-type"} ).valueUri ) assert inst.text.status == "extensions" def test_auditevent_2(base_settings): """No. 2 tests collection for AuditEvent. Test File: audit-event-example-logout.json """ filename = base_settings["unittest_data_dir"] / "audit-event-example-logout.json" inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes()) assert "AuditEvent" == inst.get_resource_type() impl_auditevent_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AuditEvent" == data["resourceType"] inst2 = auditevent.AuditEvent(**data) impl_auditevent_2(inst2) def impl_auditevent_3(inst): assert inst.action == "R" 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 == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/extra-security-role-type" } ).valueUri ) assert inst.agent[0].who.identifier.value == "95" assert ( inst.agent[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/auditevent-AlternativeUserID" } ).valueUri ) assert inst.agent[1].extension[0].valueIdentifier.type.text == "process ID" assert inst.agent[1].extension[0].valueIdentifier.value == "6580" assert inst.agent[1].networkString == "Workstation1.ehr.familyclinic.com" 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert ( inst.agent[1].who.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.4.2"} ).valueUri ) assert inst.agent[1].who.identifier.value == "2.16.840.1.113883.4.2" assert inst.category[0].coding[0].code == "rest" assert inst.category[0].coding[0].display == "Restful Operation" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-event-type"} ).valueUri ) assert inst.code.coding[0].code == "vread" assert inst.code.coding[0].display == "vread" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert inst.entity[0].role.coding[0].code == "1" assert inst.entity[0].role.coding[0].display == "Patient" assert ( inst.entity[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/object-role"} ).valueUri ) assert inst.entity[0].what.reference == "Patient/example/_history/1" assert inst.id == "example-rest" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome.code.code == "0" assert inst.outcome.code.display == "Success" assert ( inst.outcome.code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-event-outcome"} ).valueUri ) assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2013-06-20T23:42:24Z"} ).valueInstant ) assert ( inst.source.observer.identifier.value == "hl7connect.healthintersections.com.au" ) assert inst.source.type[0].coding[0].code == "3" assert inst.source.type[0].coding[0].display == "Web Server" assert ( inst.source.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/security-source-type"} ).valueUri ) assert inst.text.status == "extensions" def test_auditevent_3(base_settings): """No. 3 tests collection for AuditEvent. Test File: audit-event-example-vread.json """ filename = base_settings["unittest_data_dir"] / "audit-event-example-vread.json" inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes()) assert "AuditEvent" == inst.get_resource_type() impl_auditevent_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AuditEvent" == data["resourceType"] inst2 = auditevent.AuditEvent(**data) impl_auditevent_3(inst2) def impl_auditevent_4(inst): assert inst.action == "C" assert ( inst.agent[0].networkUri == ExternalValidatorModel.model_validate( {"valueUri": "urn:ipv6:2001:0db8:85a3:0000:0000:8a2e:0370:7334"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.agent[0].who.display == "myMachine.example.org" assert ( inst.agent[1].networkUri == ExternalValidatorModel.model_validate( {"valueUri": "http://server.example.com/fhir"} ).valueUri ) assert inst.agent[1].requestor is False assert inst.agent[1].type.coding[0].code == "110152" assert inst.agent[1].type.coding[0].display == "Destination Role ID" assert ( inst.agent[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.agent[1].who.reference == "Device/example" assert inst.agent[2].requestor is True assert inst.agent[2].type.coding[0].code == "INF" assert inst.agent[2].type.coding[0].display == "Informant" assert ( inst.agent[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.agent[2].who.display == "Betty Jones" assert inst.authorization[0].coding[0].code == "TREAT" assert ( inst.authorization[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.basedOn[0].reference == "CarePlan/example" assert inst.category[0].coding[0].code == "create" assert inst.category[0].coding[0].display == "create" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert inst.code.coding[0].code == "rest" assert inst.code.coding[0].display == "Restful Operation" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-event-type"} ).valueUri ) assert inst.encounter.reference == "Encounter/home" assert inst.entity[0].role.coding[0].code == "4" assert inst.entity[0].role.coding[0].display == "Domain Resource" assert ( inst.entity[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/object-role"} ).valueUri ) assert inst.entity[0].what.reference == "List/example" assert inst.id == "example-advanced-create" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurredDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2020-04-29T09:49:00.000Z"} ).valueDateTime ) assert inst.outcome.code.code == "0" assert inst.outcome.code.display == "Success" assert ( inst.outcome.code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-event-outcome"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2020-04-29T09:49:00.000Z"} ).valueInstant ) assert inst.severity == "informational" assert inst.source.observer.reference == "Device/example" assert inst.source.site.identifier.value == "http://server.example.com" assert inst.source.type[0].coding[0].code == "4" assert inst.source.type[0].coding[0].display == "Application Server" assert ( inst.source.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/security-source-type"} ).valueUri ) assert inst.text.status == "generated" def test_auditevent_4(base_settings): """No. 4 tests collection for AuditEvent. Test File: auditevent-example-advanced-create.json """ filename = ( base_settings["unittest_data_dir"] / "auditevent-example-advanced-create.json" ) inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes()) assert "AuditEvent" == inst.get_resource_type() impl_auditevent_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AuditEvent" == data["resourceType"] inst2 = auditevent.AuditEvent(**data) impl_auditevent_4(inst2) def impl_auditevent_5(inst): assert inst.action == "R" 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.agent[0].who.display == "ExportToMedia.app" 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 == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/extra-security-role-type" } ).valueUri ) assert inst.agent[1].who.display == "Grahame Grieve" assert inst.agent[1].who.identifier.value == "95" assert inst.agent[2].requestor is False assert inst.agent[2].type.coding[0].code == "110154" assert inst.agent[2].type.coding[0].display == "Destination Media" assert ( inst.agent[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.agent[2].who.display == "Media title: Hello World" assert inst.category[0].coding[0].code == "110106" assert inst.category[0].coding[0].display == "Export" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.code.coding[0].code == "ITI-32" assert inst.code.coding[0].display == "Distribute Document Set on Media" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ihe:event-type-code"} ).valueUri ) assert inst.entity[0].role.coding[0].code == "1" assert inst.entity[0].role.coding[0].display == "Patient" assert ( inst.entity[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/object-role"} ).valueUri ) assert ( inst.entity[0].what.identifier.value == "e3cdfc81a0d24bd^^^&2.16.840.1.113883.4.2&ISO" ) assert inst.entity[1].role.coding[0].code == "20" assert inst.entity[1].role.coding[0].display == "Job" assert ( inst.entity[1].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/object-role"} ).valueUri ) assert inst.entity[1].what.identifier.type.coding[0].code == "IHE XDS Metadata" assert ( inst.entity[1].what.identifier.type.coding[0].display == "submission set classificationNode" ) assert ( inst.entity[1].what.identifier.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:uuid:a54d6aa5-d40d-43f9-88c5-b4633d873bdd"} ).valueUri ) assert ( inst.entity[1].what.identifier.value == "e3cdfc81a0d24bd^^^&2.16.840.1.113883.4.2&ISO" ) assert inst.entity[2].what.reference == "DocumentReference/example" assert inst.id == "example-media" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome.code.code == "0" assert inst.outcome.code.display == "Success" assert ( inst.outcome.code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-event-outcome"} ).valueUri ) assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2015-08-27T23:42:24Z"} ).valueInstant ) assert inst.source.observer.display == "Cloud" assert ( inst.source.observer.identifier.value == "hl7connect.healthintersections.com.au" ) assert inst.text.status == "generated" def test_auditevent_5(base_settings): """No. 5 tests collection for AuditEvent. Test File: audit-event-example-media.json """ filename = base_settings["unittest_data_dir"] / "audit-event-example-media.json" inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes()) assert "AuditEvent" == inst.get_resource_type() impl_auditevent_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AuditEvent" == data["resourceType"] inst2 = auditevent.AuditEvent(**data) impl_auditevent_5(inst2) def impl_auditevent_6(inst): assert inst.action == "C" 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 == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/extra-security-role-type" } ).valueUri ) assert inst.agent[0].who.identifier.value == "95" assert ( inst.agent[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/auditevent-AlternativeUserID" } ).valueUri ) assert inst.agent[1].extension[0].valueIdentifier.type.text == "process ID" assert inst.agent[1].extension[0].valueIdentifier.value == "6580" assert inst.agent[1].networkString == "Workstation1.ehr.familyclinic.com" 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert ( inst.agent[1].who.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.4.2"} ).valueUri ) assert inst.agent[1].who.identifier.value == "2.16.840.1.113883.4.2" assert inst.category[0].coding[0].code == "rest" assert inst.category[0].coding[0].display == "Restful Operation" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-event-type"} ).valueUri ) assert inst.code.coding[0].code == "create" assert inst.code.coding[0].display == "create" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert inst.entity[0].role.coding[0].code == "1" assert inst.entity[0].role.coding[0].display == "Patient" assert ( inst.entity[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/object-role"} ).valueUri ) assert inst.entity[0].what.reference == "Patient/example/_history/1" assert inst.entity[1].role.coding[0].code == "21" assert inst.entity[1].role.coding[0].display == "Job Stream" assert ( inst.entity[1].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/object-role"} ).valueUri ) assert ( inst.entity[1].what.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.com/server"} ).valueUri ) assert inst.entity[1].what.identifier.type.text == "TraceID" assert inst.entity[1].what.identifier.value == "6b507ee2d716780372c255df69ece653" assert inst.id == "example-rest-create-traceID" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome.code.code == "0" assert inst.outcome.code.display == "Success" assert ( inst.outcome.code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-event-outcome"} ).valueUri ) assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2019-12-04T11:59:28.646+00:00"} ).valueInstant ) assert ( inst.source.observer.identifier.value == "hl7connect.healthintersections.com.au" ) assert inst.source.type[0].coding[0].code == "3" assert inst.source.type[0].coding[0].display == "Web Server" assert ( inst.source.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/security-source-type"} ).valueUri ) assert inst.text.status == "extensions" def test_auditevent_6(base_settings): """No. 6 tests collection for AuditEvent. Test File: audit-event-example-create-traceID.json """ filename = ( base_settings["unittest_data_dir"] / "audit-event-example-create-traceID.json" ) inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes()) assert "AuditEvent" == inst.get_resource_type() impl_auditevent_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AuditEvent" == data["resourceType"] inst2 = auditevent.AuditEvent(**data) impl_auditevent_6(inst2) def impl_auditevent_7(inst): assert inst.action == "E" 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 == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/extra-security-role-type" } ).valueUri ) assert inst.agent[0].who.display == "Grahame Grieve" assert inst.agent[0].who.identifier.value == "95" assert ( inst.agent[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/auditevent-AlternativeUserID" } ).valueUri ) assert inst.agent[1].extension[0].valueIdentifier.type.text == "process ID" assert inst.agent[1].extension[0].valueIdentifier.value == "6580" assert inst.agent[1].networkString == "Workstation1.ehr.familyclinic.com" 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert ( inst.agent[1].who.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.4.2"} ).valueUri ) assert inst.agent[1].who.identifier.value == "2.16.840.1.113883.4.2" assert inst.category[0].coding[0].code == "110114" assert inst.category[0].coding[0].display == "User Authentication" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.code.coding[0].code == "110122" assert inst.code.coding[0].display == "Login" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.id == "example-login" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome.code.code == "0" assert inst.outcome.code.display == "Success" assert ( inst.outcome.code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-event-outcome"} ).valueUri ) assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2013-06-20T23:41:23Z"} ).valueInstant ) assert inst.source.observer.display == "Cloud" assert ( inst.source.observer.identifier.value == "hl7connect.healthintersections.com.au" ) assert inst.source.type[0].coding[0].code == "3" assert inst.source.type[0].coding[0].display == "Web Server" assert ( inst.source.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/security-source-type"} ).valueUri ) assert inst.text.status == "extensions" def test_auditevent_7(base_settings): """No. 7 tests collection for AuditEvent. Test File: audit-event-example-login.json """ filename = base_settings["unittest_data_dir"] / "audit-event-example-login.json" inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes()) assert "AuditEvent" == inst.get_resource_type() impl_auditevent_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AuditEvent" == data["resourceType"] inst2 = auditevent.AuditEvent(**data) impl_auditevent_7(inst2) def impl_auditevent_8(inst): assert inst.action == "E" assert ( inst.agent[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/auditevent-AlternativeUserID" } ).valueUri ) assert inst.agent[0].extension[0].valueIdentifier.type.text == "process ID" assert inst.agent[0].extension[0].valueIdentifier.value == "6580" assert inst.agent[0].networkString == "Workstation1.ehr.familyclinic.com" 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert ( inst.agent[0].who.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.4.2"} ).valueUri ) assert inst.agent[0].who.identifier.value == "2.16.840.1.113883.4.2" 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 == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/extra-security-role-type" } ).valueUri ) assert inst.agent[1].who.display == "Grahame Grieve" assert inst.agent[1].who.identifier.value == "95" assert inst.category[0].coding[0].code == "110112" assert inst.category[0].coding[0].display == "Query" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.code.coding[0].code == "ITI-9" assert inst.code.coding[0].display == "PIX Query" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.3.6.1.4.1.19376.1.2"} ).valueUri ) assert inst.entity[0].role.coding[0].code == "1" assert inst.entity[0].role.coding[0].display == "Patient" assert ( inst.entity[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/object-role"} ).valueUri ) assert ( inst.entity[0].what.identifier.value == "e3cdfc81a0d24bd^^^&2.16.840.1.113883.4.2&ISO" ) assert inst.entity[1].detail[0].type.coding[0].code == "MSH-10" assert ( inst.entity[1].detail[0].valueBase64Binary == ExternalValidatorModel.model_validate( {"valueBase64Binary": "MS4yLjg0MC4xMTQzNTAuMS4xMy4wLjEuNy4xLjE="} ).valueBase64Binary ) assert inst.entity[1].role.coding[0].code == "24" assert inst.entity[1].role.coding[0].display == "Query" assert ( inst.entity[1].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/object-role"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome.code.code == "0" assert inst.outcome.code.display == "Success" assert ( inst.outcome.code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-event-outcome"} ).valueUri ) assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2015-08-26T23:42:24Z"} ).valueInstant ) assert inst.source.observer.display == "hl7connect.healthintersections.com.au" assert inst.text.status == "extensions" def test_auditevent_8(base_settings): """No. 8 tests collection for AuditEvent. Test File: audit-event-example-pixQuery.json """ filename = base_settings["unittest_data_dir"] / "audit-event-example-pixQuery.json" inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes()) assert "AuditEvent" == inst.get_resource_type() impl_auditevent_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AuditEvent" == data["resourceType"] inst2 = auditevent.AuditEvent(**data) impl_auditevent_8(inst2) def impl_auditevent_9(inst): assert inst.action == "E" assert inst.agent[0].requestor is False assert inst.agent[0].role[0].text == "Service User (Logon)" assert inst.agent[0].who.identifier.value == "Grahame" assert ( inst.agent[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/auditevent-AlternativeUserID" } ).valueUri ) assert inst.agent[1].extension[0].valueIdentifier.type.text == "process ID" assert inst.agent[1].extension[0].valueIdentifier.value == "6580" assert inst.agent[1].networkString == "Workstation1.ehr.familyclinic.com" assert inst.agent[1].requestor is False assert ( inst.agent[1].who.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.4.2"} ).valueUri ) assert inst.agent[1].who.identifier.value == "2.16.840.1.113883.4.2" assert inst.category[0].coding[0].code == "110100" assert inst.category[0].coding[0].display == "Application Activity" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.code.coding[0].code == "110120" assert inst.code.coding[0].display == "Application Start" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.entity[0].role.coding[0].code == "4" assert inst.entity[0].role.coding[0].display == "Domain Resource" assert ( inst.entity[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/object-role"} ).valueUri ) assert inst.entity[0].what.identifier.type.coding[0].code == "SNO" assert ( inst.entity[0].what.identifier.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.entity[0].what.identifier.type.text == "Dell Serial Number" assert inst.entity[0].what.identifier.value == "ABCDEF" assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome.code.code == "0" assert inst.outcome.code.display == "Success" assert ( inst.outcome.code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-event-outcome"} ).valueUri ) assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2012-10-25T22:04:27+11:00"} ).valueInstant ) assert inst.source.observer.display == "Grahame's Laptop" assert inst.source.type[0].coding[0].code == "110122" assert inst.source.type[0].coding[0].display == "Login" assert ( inst.source.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.text.div == ( '
Application ' "Start for under service login "Grahame" (id: " "Grahame's Test HL7Connect)
" ) assert inst.text.status == "generated" def test_auditevent_9(base_settings): """No. 9 tests collection for AuditEvent. Test File: auditevent-example.json """ filename = base_settings["unittest_data_dir"] / "auditevent-example.json" inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes()) assert "AuditEvent" == inst.get_resource_type() impl_auditevent_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AuditEvent" == data["resourceType"] inst2 = auditevent.AuditEvent(**data) impl_auditevent_9(inst2) def impl_auditevent_10(inst): assert inst.action == "E" assert inst.agent[0].authorization[0].coding[0].code == "TREAT" assert ( inst.agent[0].authorization[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.agent[0].requestor is True assert inst.agent[0].type.coding[0].code == "110152" assert inst.agent[0].type.coding[0].display == "Destination Role ID" assert ( inst.agent[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert ( inst.agent[0].who.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "https://github.com/synthetichealth/synthea"} ).valueUri ) assert inst.agent[0].who.identifier.value == "Org1" assert inst.code.coding[0].code == "110112" assert inst.code.coding[0].display == "Query" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.entity[0].role.coding[0].code == "4" assert inst.entity[0].role.coding[0].display == "Domain Resource" assert ( inst.entity[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/object-role"} ).valueUri ) assert inst.entity[0].what.reference == "Consent/consent-example-basic" assert inst.id == "example-consent-permit-authz" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome.code.code == "0" assert inst.outcome.code.display == "Success" assert ( inst.outcome.code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/audit-event-outcome"} ).valueUri ) assert inst.outcome.detail[0].text == "CONSENT_PERMIT" assert inst.patient.reference == "Patient/example" assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2021-09-08T21:51:59.932Z"} ).valueInstant ) assert inst.source.observer.display == "LEAP Consent Decision Service" assert inst.source.type[0].coding[0].code == "4" assert inst.source.type[0].coding[0].display == "Application Server" assert ( inst.source.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/security-source-type"} ).valueUri ) assert inst.text.status == "generated" def test_auditevent_10(base_settings): """No. 10 tests collection for AuditEvent. Test File: auditevent-example-consent-authz.json """ filename = ( base_settings["unittest_data_dir"] / "auditevent-example-consent-authz.json" ) inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes()) assert "AuditEvent" == inst.get_resource_type() impl_auditevent_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "AuditEvent" == data["resourceType"] inst2 = auditevent.AuditEvent(**data) impl_auditevent_10(inst2) ================================================ FILE: fhir/resources/tests/test_basic.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Basic Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import basic from .conftest import ExternalValidatorModel def impl_basic_1(inst): assert inst.code.coding[0].code == "UMLCLASSMODEL" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/do-not-use/fhir-codes#resourceTypes"} ).valueUri ) assert ( inst.extension[0].extension[0].url == ExternalValidatorModel.model_validate({"valueUri": "name"}).valueUri ) assert inst.extension[0].extension[0].valueString == "Class1" assert ( inst.extension[0].extension[1].extension[0].url == ExternalValidatorModel.model_validate({"valueUri": "name"}).valueUri ) assert inst.extension[0].extension[1].extension[0].valueString == "attribute1" assert ( inst.extension[0].extension[1].extension[1].url == ExternalValidatorModel.model_validate({"valueUri": "minOccurs"}).valueUri ) assert inst.extension[0].extension[1].extension[1].valueInteger == 1 assert ( inst.extension[0].extension[1].extension[2].url == ExternalValidatorModel.model_validate({"valueUri": "maxOccurs"}).valueUri ) assert inst.extension[0].extension[1].extension[2].valueCode == "*" assert ( inst.extension[0].extension[1].url == ExternalValidatorModel.model_validate({"valueUri": "attribute"}).valueUri ) assert ( inst.extension[0].extension[2].extension[0].url == ExternalValidatorModel.model_validate({"valueUri": "name"}).valueUri ) assert inst.extension[0].extension[2].extension[0].valueString == "attribute2" assert ( inst.extension[0].extension[2].extension[1].url == ExternalValidatorModel.model_validate({"valueUri": "minOccurs"}).valueUri ) assert inst.extension[0].extension[2].extension[1].valueInteger == 0 assert ( inst.extension[0].extension[2].extension[2].url == ExternalValidatorModel.model_validate({"valueUri": "maxOccurs"}).valueUri ) assert inst.extension[0].extension[2].extension[2].valueInteger == 1 assert ( inst.extension[0].extension[2].url == ExternalValidatorModel.model_validate({"valueUri": "attribute"}).valueUri ) assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/do-not-use/fhir-extensions/UMLclass"} ).valueUri ) assert inst.id == "classModel" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_basic_1(base_settings): """No. 1 tests collection for Basic. Test File: basic-example2.json """ filename = base_settings["unittest_data_dir"] / "basic-example2.json" inst = basic.Basic.model_validate_json(filename.read_bytes()) assert "Basic" == inst.get_resource_type() impl_basic_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Basic" == data["resourceType"] inst2 = basic.Basic(**data) impl_basic_1(inst2) def impl_basic_2(inst): assert inst.code.text == "Example Narrative Tester" assert inst.id == "basic-example-narrative" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "additional" def test_basic_2(base_settings): """No. 2 tests collection for Basic. Test File: basic-example-narrative.json """ filename = base_settings["unittest_data_dir"] / "basic-example-narrative.json" inst = basic.Basic.model_validate_json(filename.read_bytes()) assert "Basic" == inst.get_resource_type() impl_basic_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Basic" == data["resourceType"] inst2 = basic.Basic(**data) impl_basic_2(inst2) def impl_basic_3(inst): assert inst.author.reference == "Practitioner/example" assert inst.code.coding[0].code == "referral" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/basic-resource-type"} ).valueUri ) assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-05-14"} ).valueDateTime ) assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/do-not-use/fhir-extensions/referral#requestingPractitioner" } ).valueUri ) assert inst.extension[0].valueReference.display == "Dokter Bronsig" assert inst.extension[0].valueReference.reference == "Practitioner/f201" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/do-not-use/fhir-extensions/referral#notes"} ).valueUri ) assert inst.extension[1].valueString == ( "The patient had fever peaks over the last couple of days. He" " is worried about these peaks." ) assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/do-not-use/fhir-extensions/referral#fulfillingEncounter" } ).valueUri ) assert inst.extension[2].valueReference.reference == "Encounter/f201" assert inst.id == "referral" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealth.org/basic/identifiers"} ).valueUri ) assert inst.identifier[0].value == "19283746" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.modifierExtension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/do-not-use/fhir-extensions/referral#referredForService" } ).valueUri ) assert inst.modifierExtension[0].valueCodeableConcept.coding[0].code == "11429006" assert ( inst.modifierExtension[0].valueCodeableConcept.coding[0].display == "Consultation" ) assert ( inst.modifierExtension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.modifierExtension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/do-not-use/fhir-extensions/referral#targetDate" } ).valueUri ) assert ( inst.modifierExtension[1].valuePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-04-15"} ).valueDateTime ) assert ( inst.modifierExtension[1].valuePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-04-01"} ).valueDateTime ) assert ( inst.modifierExtension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/do-not-use/fhir-extensions/referral#status" } ).valueUri ) assert inst.modifierExtension[2].valueCode == "complete" assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" def test_basic_3(base_settings): """No. 3 tests collection for Basic. Test File: basic-example.json """ filename = base_settings["unittest_data_dir"] / "basic-example.json" inst = basic.Basic.model_validate_json(filename.read_bytes()) assert "Basic" == inst.get_resource_type() impl_basic_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Basic" == data["resourceType"] inst2 = basic.Basic(**data) impl_basic_3(inst2) ================================================ FILE: fhir/resources/tests/test_binary.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Binary Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import binary from .conftest import ExternalValidatorModel def impl_binary_1(inst): assert inst.contentType == "application/pdf" assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.securityContext.reference == "DocumentReference/example" def test_binary_1(base_settings): """No. 1 tests collection for Binary. Test File: binary-example.json """ filename = base_settings["unittest_data_dir"] / "binary-example.json" inst = binary.Binary.model_validate_json(filename.read_bytes()) assert "Binary" == inst.get_resource_type() impl_binary_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Binary" == data["resourceType"] inst2 = binary.Binary(**data) impl_binary_1(inst2) def impl_binary_2(inst): assert inst.contentType == "image/jpeg" assert inst.id == "f006" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) def test_binary_2(base_settings): """No. 2 tests collection for Binary. Test File: binary-f006.json """ filename = base_settings["unittest_data_dir"] / "binary-f006.json" inst = binary.Binary.model_validate_json(filename.read_bytes()) assert "Binary" == inst.get_resource_type() impl_binary_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Binary" == data["resourceType"] inst2 = binary.Binary(**data) impl_binary_2(inst2) ================================================ FILE: fhir/resources/tests/test_biologicallyderivedproduct.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/BiologicallyDerivedProduct Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import biologicallyderivedproduct from .conftest import ExternalValidatorModel def impl_biologicallyderivedproduct_1(inst): assert ( inst.biologicalSourceEvent.system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.isbt128.org/uri/DonationIdentificationNumber"} ).valueUri ) assert inst.biologicalSourceEvent.value == "A999921123456" assert inst.division == "A00000" assert ( inst.expirationDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-08-02T23:59:00-05:00"} ).valueDateTime ) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.isbt128.org/uri/MPHOUniqueIdentifier"} ).valueUri ) assert inst.identifier[0].value == "A9999E0398A999921123456A00000" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.processingFacility[0].reference == "Organization/A9999" assert inst.productCode.coding[0].code == "E0398" assert inst.productStatus.code == "available" assert inst.property[0].type.coding[0].code == "ABORhD" assert inst.property[0].valueCodeableConcept.coding[0].code == "62" assert inst.property[0].valueCodeableConcept.coding[0].display == "A RhD Positive" assert ( inst.property[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.isbt128.org/uri/ABORhD"} ).valueUri ) assert inst.property[1].type.coding[0].code == "Donor" assert inst.property[1].valueCodeableConcept.coding[0].code == "V" assert inst.property[1].valueCodeableConcept.coding[0].display == "Volunteer" assert ( inst.property[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.isbt128.org/uri/CollectionType"} ).valueUri ) assert ( inst.storageTempRequirements.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.storageTempRequirements.high.unit == "degrees C" assert float(inst.storageTempRequirements.high.value) == float(6) assert ( inst.storageTempRequirements.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.storageTempRequirements.low.unit == "degrees C" assert float(inst.storageTempRequirements.low.value) == float(1) assert inst.text.status == "generated" def test_biologicallyderivedproduct_1(base_settings): """No. 1 tests collection for BiologicallyDerivedProduct. Test File: biologicallyderivedproduct-example.json """ filename = ( base_settings["unittest_data_dir"] / "biologicallyderivedproduct-example.json" ) inst = biologicallyderivedproduct.BiologicallyDerivedProduct.model_validate_json( filename.read_bytes() ) assert "BiologicallyDerivedProduct" == inst.get_resource_type() impl_biologicallyderivedproduct_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "BiologicallyDerivedProduct" == data["resourceType"] inst2 = biologicallyderivedproduct.BiologicallyDerivedProduct(**data) impl_biologicallyderivedproduct_1(inst2) def impl_biologicallyderivedproduct_2(inst): assert inst.collection.source.display == "HCT Donor" assert inst.collection.source.reference == "Patient/example-b" assert inst.id == "allogeneicHCT" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.request[0].display == "Service Request for HCT Collection" assert ( inst.request[0].reference == "BiologicallyDerivedProduct/HCTcollection-servicerequest" ) assert inst.text.status == "generated" def test_biologicallyderivedproduct_2(base_settings): """No. 2 tests collection for BiologicallyDerivedProduct. Test File: biologicallyderivedproduct-example-allogeneicHCT.json """ filename = ( base_settings["unittest_data_dir"] / "biologicallyderivedproduct-example-allogeneicHCT.json" ) inst = biologicallyderivedproduct.BiologicallyDerivedProduct.model_validate_json( filename.read_bytes() ) assert "BiologicallyDerivedProduct" == inst.get_resource_type() impl_biologicallyderivedproduct_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "BiologicallyDerivedProduct" == data["resourceType"] inst2 = biologicallyderivedproduct.BiologicallyDerivedProduct(**data) impl_biologicallyderivedproduct_2(inst2) def impl_biologicallyderivedproduct_3(inst): assert ( inst.biologicalSourceEvent.system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.isbt128.org/uri/DonationIdentificationNumber"} ).valueUri ) assert inst.biologicalSourceEvent.value == "W000022000687" assert inst.collection.source.display == "HCT Collection" assert inst.collection.source.reference == "Patient/example-a" assert inst.division == "A00000" assert ( inst.expirationDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2028-08-02T23:59:00-05:00"} ).valueDateTime ) assert inst.id == "autologousHCT" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.isbt128.org/uri/SingleEuropeanCode"} ).valueUri ) assert inst.identifier[0].value == "PL001499Z549917123456 A00T041600320171231" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.processingFacility[0].reference == "Organization/Example" assert inst.productCategory.code == "cells" assert inst.productCode.coding[0].code == "S1128" assert inst.productStatus.code == "available" assert inst.property[0].type.coding[0].code == "ABORhD" assert inst.property[0].valueCodeableConcept.coding[0].code == "62" assert inst.property[0].valueCodeableConcept.coding[0].display == "A RhD Positive" assert ( inst.property[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.isbt128.org/uri/ABORhD"} ).valueUri ) assert inst.property[1].type.coding[0].code == "CollectionType" assert inst.property[1].valueCodeableConcept.coding[0].code == "1" assert ( inst.property[1].valueCodeableConcept.coding[0].display == "For Autologous Use Only" ) assert ( inst.property[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.isbt128.org/uri/CollectionType"} ).valueUri ) assert inst.property[2].type.coding[0].code == "BagVolume" assert ( inst.property[2].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.property[2].valueQuantity.unit == "mL" assert float(inst.property[2].valueQuantity.value) == float(50) assert inst.property[3].type.coding[0].code == "74838-4" assert ( inst.property[3].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "https://ucum.org/"} ).valueUri ) assert inst.property[3].valueQuantity.unit == "10*6/mL" assert float(inst.property[3].valueQuantity.value) == float(2.6) assert inst.request[0].display == "Service Request for HCT Collection" assert ( inst.request[0].reference == "BiologicallyDerivedProduct/HCTcollection-servicerequest" ) assert ( inst.storageTempRequirements.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.storageTempRequirements.high.unit == "degrees C" assert float(inst.storageTempRequirements.high.value) == float(-120) assert inst.text.status == "generated" def test_biologicallyderivedproduct_3(base_settings): """No. 3 tests collection for BiologicallyDerivedProduct. Test File: biologicallyderivedproduct-example-autologousHCT.json """ filename = ( base_settings["unittest_data_dir"] / "biologicallyderivedproduct-example-autologousHCT.json" ) inst = biologicallyderivedproduct.BiologicallyDerivedProduct.model_validate_json( filename.read_bytes() ) assert "BiologicallyDerivedProduct" == inst.get_resource_type() impl_biologicallyderivedproduct_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "BiologicallyDerivedProduct" == data["resourceType"] inst2 = biologicallyderivedproduct.BiologicallyDerivedProduct(**data) impl_biologicallyderivedproduct_3(inst2) ================================================ FILE: fhir/resources/tests/test_biologicallyderivedproductdispense.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/BiologicallyDerivedProductDispense Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import biologicallyderivedproductdispense from .conftest import ExternalValidatorModel def impl_biologicallyderivedproductdispense_1(inst): assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.display == "Donald Duck" assert inst.patient.reference == "Patient/pat1" assert inst.product.reference == "BiologicallyDerivedProduct/prod1" assert inst.status == "allocated" assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" def test_biologicallyderivedproductdispense_1(base_settings): """No. 1 tests collection for BiologicallyDerivedProductDispense. Test File: biologicallyderivedproductdispense-example.json """ filename = ( base_settings["unittest_data_dir"] / "biologicallyderivedproductdispense-example.json" ) inst = biologicallyderivedproductdispense.BiologicallyDerivedProductDispense.model_validate_json( filename.read_bytes() ) assert "BiologicallyDerivedProductDispense" == inst.get_resource_type() impl_biologicallyderivedproductdispense_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "BiologicallyDerivedProductDispense" == data["resourceType"] inst2 = biologicallyderivedproductdispense.BiologicallyDerivedProductDispense( **data ) impl_biologicallyderivedproductdispense_1(inst2) ================================================ FILE: fhir/resources/tests/test_bodystructure.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/BodyStructure Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import bodystructure from .conftest import ExternalValidatorModel def impl_bodystructure_1(inst): assert inst.description == "EDD 1/1/2017 confirmation by LMP" assert inst.id == "fetus" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealth.org/bodystructure/identifiers"} ).valueUri ) assert inst.identifier[0].value == "12345" assert inst.includedStructure[0].structure.coding[0].code == "83418008" assert ( inst.includedStructure[0].structure.coding[0].display == "Entire fetus (body structure)" ) assert ( inst.includedStructure[0].structure.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.includedStructure[0].structure.text == "Fetus" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert inst.text.status == "generated" def test_bodystructure_1(base_settings): """No. 1 tests collection for BodyStructure. Test File: bodystructure-example-fetus.json """ filename = base_settings["unittest_data_dir"] / "bodystructure-example-fetus.json" inst = bodystructure.BodyStructure.model_validate_json(filename.read_bytes()) assert "BodyStructure" == inst.get_resource_type() impl_bodystructure_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "BodyStructure" == data["resourceType"] inst2 = bodystructure.BodyStructure(**data) impl_bodystructure_1(inst2) def impl_bodystructure_2(inst): assert inst.description == "7 cm maximum diameter" assert inst.id == "tumor" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealth.org/bodystructure/identifiers"} ).valueUri ) assert inst.identifier[0].value == "12345" assert inst.image[0].contentType == "application/dicom" assert ( inst.image[0].url == ExternalValidatorModel.model_validate( { "valueUrl": "http://imaging.acme.com/wado/server?requestType=WADO&wado_details" } ).valueUrl ) assert inst.includedStructure[0].structure.coding[0].code == "78961009" assert ( inst.includedStructure[0].structure.coding[0].display == "Splenic structure (body structure)" ) assert ( inst.includedStructure[0].structure.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.includedStructure[0].structure.text == "Spleen" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.morphology.coding[0].code == "4147007" assert inst.morphology.coding[0].display == "Mass (morphologic abnormality)" assert ( inst.morphology.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.morphology.text == "Splenic mass" assert inst.patient.reference == "Patient/example" assert inst.text.status == "generated" def test_bodystructure_2(base_settings): """No. 2 tests collection for BodyStructure. Test File: bodystructure-example-tumor.json """ filename = base_settings["unittest_data_dir"] / "bodystructure-example-tumor.json" inst = bodystructure.BodyStructure.model_validate_json(filename.read_bytes()) assert "BodyStructure" == inst.get_resource_type() impl_bodystructure_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "BodyStructure" == data["resourceType"] inst2 = bodystructure.BodyStructure(**data) impl_bodystructure_2(inst2) def impl_bodystructure_3(inst): assert inst.active is False assert inst.description == "inner surface (volar) of the left forearm" assert inst.id == "skin-patch" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealth.org/bodystructure/identifiers"} ).valueUri ) assert inst.identifier[0].value == "12345" assert inst.includedStructure[0].laterality.coding[0].code == "419161000" assert inst.includedStructure[0].laterality.coding[0].display == "Unilateral left" assert ( inst.includedStructure[0].laterality.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.includedStructure[0].laterality.text == "Left" assert inst.includedStructure[0].qualifier[0].coding[0].code == "263929005" assert inst.includedStructure[0].qualifier[0].coding[0].display == "Volar" assert ( inst.includedStructure[0].qualifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.includedStructure[0].qualifier[0].text == "Volar" assert inst.includedStructure[0].structure.coding[0].code == "14975008" assert inst.includedStructure[0].structure.coding[0].display == "Forearm" assert ( inst.includedStructure[0].structure.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.includedStructure[0].structure.text == "Forearm" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.morphology.text == "Skin patch" assert inst.patient.reference == "Patient/example" assert inst.text.status == "generated" def test_bodystructure_3(base_settings): """No. 3 tests collection for BodyStructure. Test File: bodystructure-example-skin-patch.json """ filename = ( base_settings["unittest_data_dir"] / "bodystructure-example-skin-patch.json" ) inst = bodystructure.BodyStructure.model_validate_json(filename.read_bytes()) assert "BodyStructure" == inst.get_resource_type() impl_bodystructure_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "BodyStructure" == data["resourceType"] inst2 = bodystructure.BodyStructure(**data) impl_bodystructure_3(inst2) ================================================ FILE: fhir/resources/tests/test_bundle.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Bundle Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import bundle from .conftest import ExternalValidatorModel def impl_bundle_1(inst): assert ( inst.entry[0].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "urn:uuid:d195d9b8-6f78-4d71-9d22-3c1a923bfea5"} ).valueUri ) assert inst.entry[0].resource.id == "d195d9b8-6f78-4d71-9d22-3c1a923bfea5" assert ( inst.entry[1].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "https://example.org/FHIR/R5/Encounter/2"} ).valueUri ) assert inst.entry[1].request.method == "PUT" assert ( inst.entry[1].request.url == ExternalValidatorModel.model_validate({"valueUri": "Encounter/2"}).valueUri ) assert inst.entry[1].resource.id == "2" assert ( inst.entry[1].resource.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2019-08-07T10:49:22Z"} ).valueInstant ) assert inst.entry[1].resource.meta.versionId == "1" assert inst.entry[1].response.status == "201" assert inst.id == "00b99077-2bda-436e-98cc-a4f65d6c2fe0" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.timestamp == ExternalValidatorModel.model_validate( {"valueInstant": "2020-04-17T10:24:13.1882432-05:00"} ).valueInstant ) assert inst.type == "subscription-notification" def test_bundle_1(base_settings): """No. 1 tests collection for Bundle. Test File: notification-full-resource.json """ filename = base_settings["unittest_data_dir"] / "notification-full-resource.json" inst = bundle.Bundle.model_validate_json(filename.read_bytes()) assert "Bundle" == inst.get_resource_type() impl_bundle_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Bundle" == data["resourceType"] inst2 = bundle.Bundle(**data) impl_bundle_1(inst2) def impl_bundle_2(inst): assert ( inst.entry[0].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "urn:uuid:2866af9c-137d-4458-a8a9-eeeec0ce5583"} ).valueUri ) assert inst.entry[0].resource.id == "warning" assert inst.entry[0].search.mode == "outcome" assert inst.id == "bundle-search-warning" assert inst.link[0].relation == "self" assert ( inst.link[0].url == ExternalValidatorModel.model_validate( { "valueUri": "https://example.org/fhir/Observation?patient.identifier=http://example.com/fhir/identifier/mrn|123456" } ).valueUri ) assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2017-03-14T08:23:30+11:00"} ).valueInstant ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.total == 0 assert inst.type == "searchset" def test_bundle_2(base_settings): """No. 2 tests collection for Bundle. Test File: bundle-search-warning.json """ filename = base_settings["unittest_data_dir"] / "bundle-search-warning.json" inst = bundle.Bundle.model_validate_json(filename.read_bytes()) assert "Bundle" == inst.get_resource_type() impl_bundle_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Bundle" == data["resourceType"] inst2 = bundle.Bundle(**data) impl_bundle_2(inst2) def impl_bundle_3(inst): assert ( inst.entry[0].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "https://example.com/base/DiagnosticReport/f202"} ).valueUri ) assert inst.entry[0].resource.id == "f202" assert ( inst.entry[1].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "https://example.com/base/ServiceRequest/req"} ).valueUri ) assert inst.entry[1].resource.id == "req" assert inst.id == "f202" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.type == "collection" def test_bundle_3(base_settings): """No. 3 tests collection for Bundle. Test File: diagnosticreport-example-f202-bloodculture.json """ filename = ( base_settings["unittest_data_dir"] / "diagnosticreport-example-f202-bloodculture.json" ) inst = bundle.Bundle.model_validate_json(filename.read_bytes()) assert "Bundle" == inst.get_resource_type() impl_bundle_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Bundle" == data["resourceType"] inst2 = bundle.Bundle(**data) impl_bundle_3(inst2) def impl_bundle_4(inst): assert ( inst.entry[0].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "urn:uuid:a5b053d4-2603-446f-ae86-f5853ac09334"} ).valueUri ) assert inst.entry[0].resource.id == "a5b053d4-2603-446f-ae86-f5853ac09334" assert inst.id == "3d20ea4b-90dc-4d0d-b15a-c7a893389401" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.timestamp == ExternalValidatorModel.model_validate( {"valueInstant": "2020-04-17T10:24:13.1882432-05:00"} ).valueInstant ) assert inst.type == "subscription-notification" def test_bundle_4(base_settings): """No. 4 tests collection for Bundle. Test File: notification-heartbeat.json """ filename = base_settings["unittest_data_dir"] / "notification-heartbeat.json" inst = bundle.Bundle.model_validate_json(filename.read_bytes()) assert "Bundle" == inst.get_resource_type() impl_bundle_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Bundle" == data["resourceType"] inst2 = bundle.Bundle(**data) impl_bundle_4(inst2) def impl_bundle_5(inst): assert ( inst.entry[0].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "urn:uuid:d9d296d8-5afd-42e1-a0ce-3344e0e003ed"} ).valueUri ) assert inst.entry[0].resource.id == "d9d296d8-5afd-42e1-a0ce-3344e0e003ed" assert ( inst.entry[1].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "urn:uuid:03f9aa7d-b395-47b9-84e0-053678b6e4e3"} ).valueUri ) assert inst.entry[1].resource.id == "03f9aa7d-b395-47b9-84e0-053678b6e4e3" assert ( inst.entry[2].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/ehr/fhir/Patient/pat1"} ).valueUri ) assert inst.entry[2].resource.id == "pat1" assert ( inst.entry[3].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/ehr/fhir/Patient/pat12"} ).valueUri ) assert inst.entry[3].resource.id == "pat2" assert inst.id == "3a0707d3-549e-4467-b8b8-5a2ab3800efe" assert ( inst.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:example-org:receiver.identifiers"} ).valueUri ) assert inst.identifier.value == "35f23e97-328c-4eb7-8e94-34f478983e89" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.timestamp == ExternalValidatorModel.model_validate( {"valueInstant": "2015-07-14T11:15:33+10:00"} ).valueInstant ) assert inst.type == "message" def test_bundle_5(base_settings): """No. 5 tests collection for Bundle. Test File: message-response-link.json """ filename = base_settings["unittest_data_dir"] / "message-response-link.json" inst = bundle.Bundle.model_validate_json(filename.read_bytes()) assert "Bundle" == inst.get_resource_type() impl_bundle_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Bundle" == data["resourceType"] inst2 = bundle.Bundle(**data) impl_bundle_5(inst2) def impl_bundle_6(inst): assert ( inst.entry[0].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "urn:uuid:3fdc72f4-a11d-4a9d-9260-a9f745779e1d"} ).valueUri ) assert inst.entry[0].request.method == "POST" assert ( inst.entry[0].request.url == ExternalValidatorModel.model_validate( {"valueUri": "DocumentReference"} ).valueUri ) assert ( inst.entry[0].resource.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2013-07-01T13:11:33Z"} ).valueInstant ) assert ( inst.entry[1].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://localhost:9556/svc/fhir/Patient/a2"} ).valueUri ) assert ( inst.entry[1].request.ifNoneExist == "Patient?identifier=http://acme.org/xds/patients!89765a87b" ) assert inst.entry[1].request.method == "POST" assert ( inst.entry[1].request.url == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.entry[1].resource.id == "a2" assert ( inst.entry[1].resource.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2013-07-01T13:11:33Z"} ).valueInstant ) assert ( inst.entry[2].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://localhost:9556/svc/fhir/Practitioner/a3"} ).valueUri ) assert inst.entry[2].request.method == "POST" assert ( inst.entry[2].request.url == ExternalValidatorModel.model_validate({"valueUri": "Practitioner"}).valueUri ) assert inst.entry[2].resource.id == "a3" assert ( inst.entry[2].resource.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2013-07-01T13:11:33Z"} ).valueInstant ) assert ( inst.entry[3].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://localhost:9556/svc/fhir/Practitioner/a4"} ).valueUri ) assert inst.entry[3].request.method == "POST" assert ( inst.entry[3].request.url == ExternalValidatorModel.model_validate({"valueUri": "Practitioner"}).valueUri ) assert inst.entry[3].resource.id == "a4" assert ( inst.entry[3].resource.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2013-07-01T13:11:33Z"} ).valueInstant ) assert ( inst.entry[4].fullUrl == ExternalValidatorModel.model_validate( { "valueUri": "http://localhost:9556/svc/fhir/Binary/1e404af3-077f-4bee-b7a6-a9be97e1ce32" } ).valueUri ) assert inst.entry[4].request.method == "POST" assert ( inst.entry[4].request.url == ExternalValidatorModel.model_validate({"valueUri": "Binary"}).valueUri ) assert inst.entry[4].resource.id == "1e404af3-077f-4bee-b7a6-a9be97e1ce32" assert ( inst.entry[4].resource.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2013-07-01T13:11:33Z"} ).valueInstant ) assert inst.id == "xds" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2013-07-01T13:11:33Z"} ).valueInstant ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.type == "transaction" def test_bundle_6(base_settings): """No. 6 tests collection for Bundle. Test File: xds-example.json """ filename = base_settings["unittest_data_dir"] / "xds-example.json" inst = bundle.Bundle.model_validate_json(filename.read_bytes()) assert "Bundle" == inst.get_resource_type() impl_bundle_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Bundle" == data["resourceType"] inst2 = bundle.Bundle(**data) impl_bundle_6(inst2) def impl_bundle_7(inst): assert ( inst.entry[0].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/DomainResource-text"} ).valueUri ) assert inst.entry[0].resource.id == "DomainResource-text" assert ( inst.entry[1].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-content"} ).valueUri ) assert inst.entry[1].resource.id == "Resource-content" assert ( inst.entry[2].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-filter"} ).valueUri ) assert inst.entry[2].resource.id == "Resource-filter" assert ( inst.entry[3].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-has"} ).valueUri ) assert inst.entry[3].resource.id == "Resource-has" assert ( inst.entry[4].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-id"} ).valueUri ) assert inst.entry[4].resource.id == "Resource-id" assert ( inst.entry[5].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-in"} ).valueUri ) assert inst.entry[5].resource.id == "Resource-in" assert ( inst.entry[6].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-language"} ).valueUri ) assert inst.entry[6].resource.id == "Resource-language" assert ( inst.entry[7].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-lastUpdated"} ).valueUri ) assert inst.entry[7].resource.id == "Resource-lastUpdated" assert ( inst.entry[8].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-list"} ).valueUri ) assert inst.entry[8].resource.id == "Resource-list" assert ( inst.entry[9].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/Resource-profile"} ).valueUri ) assert inst.entry[9].resource.id == "Resource-profile" assert inst.id == "searchParams" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2023-03-26T15:21:02.749+11:00"} ).valueInstant ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.type == "collection" def test_bundle_7(base_settings): """No. 7 tests collection for Bundle. Test File: search-parameters.json """ filename = base_settings["unittest_data_dir"] / "search-parameters.json" inst = bundle.Bundle.model_validate_json(filename.read_bytes()) assert "Bundle" == inst.get_resource_type() impl_bundle_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Bundle" == data["resourceType"] inst2 = bundle.Bundle(**data) impl_bundle_7(inst2) def impl_bundle_8(inst): assert ( inst.entry[0].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "urn:uuid:267b18ce-3d37-4581-9baa-6fada338038b"} ).valueUri ) assert inst.entry[0].resource.id == "267b18ce-3d37-4581-9baa-6fada338038b" assert ( inst.entry[1].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/ehr/fhir/Patient/pat1"} ).valueUri ) assert inst.entry[1].resource.id == "pat1" assert ( inst.entry[2].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/ehr/fhir/Patient/pat12"} ).valueUri ) assert inst.entry[2].resource.id == "pat2" assert inst.id == "10bb101f-a121-4264-a920-67be9cb82c74" assert ( inst.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:example-org:sender.identifiers"} ).valueUri ) assert inst.identifier.value == "efdd254b-0e09-4164-883e-35cf3871715f" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.timestamp == ExternalValidatorModel.model_validate( {"valueInstant": "2015-07-14T11:15:33+10:00"} ).valueInstant ) assert inst.type == "message" def test_bundle_8(base_settings): """No. 8 tests collection for Bundle. Test File: message-request-link.json """ filename = base_settings["unittest_data_dir"] / "message-request-link.json" inst = bundle.Bundle.model_validate_json(filename.read_bytes()) assert "Bundle" == inst.get_resource_type() impl_bundle_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Bundle" == data["resourceType"] inst2 = bundle.Bundle(**data) impl_bundle_8(inst2) def impl_bundle_9(inst): assert ( inst.entry[0].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/product-status"} ).valueUri ) assert inst.entry[0].resource.id == "product-status" assert ( inst.entry[1].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/publication-status"} ).valueUri ) assert inst.entry[1].resource.id == "publication-status" assert ( inst.entry[2].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/address-use"} ).valueUri ) assert inst.entry[2].resource.id == "address-use" assert ( inst.entry[3].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/FHIR-version"} ).valueUri ) assert inst.entry[3].resource.id == "FHIR-version" assert ( inst.entry[4].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/administrative-gender"} ).valueUri ) assert inst.entry[4].resource.id == "administrative-gender" assert ( inst.entry[5].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/property-representation"} ).valueUri ) assert inst.entry[5].resource.id == "property-representation" assert ( inst.entry[6].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/request-status"} ).valueUri ) assert inst.entry[6].resource.id == "request-status" assert ( inst.entry[7].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/reference-version-rules"} ).valueUri ) assert inst.entry[7].resource.id == "reference-version-rules" assert ( inst.entry[8].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/narrative-status"} ).valueUri ) assert inst.entry[8].resource.id == "narrative-status" assert ( inst.entry[9].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/contact-point-use"} ).valueUri ) assert inst.entry[9].resource.id == "contact-point-use" assert inst.id == "terminologies" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.type == "collection" def test_bundle_9(base_settings): """No. 9 tests collection for Bundle. Test File: namingsystem-terminologies.json """ filename = base_settings["unittest_data_dir"] / "namingsystem-terminologies.json" inst = bundle.Bundle.model_validate_json(filename.read_bytes()) assert "Bundle" == inst.get_resource_type() impl_bundle_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Bundle" == data["resourceType"] inst2 = bundle.Bundle(**data) impl_bundle_9(inst2) def impl_bundle_10(inst): assert ( inst.entry[0].fullUrl == ExternalValidatorModel.model_validate( {"valueUri": "urn:uuid:231e7f38-2dd1-45ac-9161-d7bd87c403bd"} ).valueUri ) assert inst.entry[0].resource.id == "231e7f38-2dd1-45ac-9161-d7bd87c403bd" assert inst.id == "54f808cf-d159-4c9b-accb-c33eb20f0ecc" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.timestamp == ExternalValidatorModel.model_validate( {"valueInstant": "2020-04-17T10:24:13.1882432-05:00"} ).valueInstant ) assert inst.type == "subscription-notification" def test_bundle_10(base_settings): """No. 10 tests collection for Bundle. Test File: notification-handshake.json """ filename = base_settings["unittest_data_dir"] / "notification-handshake.json" inst = bundle.Bundle.model_validate_json(filename.read_bytes()) assert "Bundle" == inst.get_resource_type() impl_bundle_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Bundle" == data["resourceType"] inst2 = bundle.Bundle(**data) impl_bundle_10(inst2) ================================================ FILE: fhir/resources/tests/test_capabilitystatement.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/CapabilityStatement Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import capabilitystatement from .conftest import ExternalValidatorModel def impl_capabilitystatement_1(inst): assert inst.contact[0].name == "System Administrator" assert inst.contact[0].telecom[0].system == "email" assert inst.contact[0].telecom[0].value == "wile@acme.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-01-04"} ).valueDateTime ) assert inst.description == ( "Sample capability statement showing new MessageDefinition " "structure" ) assert inst.experimental is True assert inst.fhirVersion == "5.0.0" assert inst.format[0] == "xml" assert inst.format[1] == "json" assert inst.id == "messagedefinition" assert inst.implementation.description == "Acme Message endpoint" assert ( inst.implementation.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://acem.com/fhir/message-drop"} ).valueUrl ) assert inst.kind == "instance" assert ( inst.messaging[0].documentation == "ADT A08 equivalent for external system notifications" ) assert ( inst.messaging[0].endpoint[0].address == ExternalValidatorModel.model_validate( {"valueUrl": "mllp:10.1.1.10:9234"} ).valueUrl ) assert inst.messaging[0].endpoint[0].protocol.code == "mllp" assert ( inst.messaging[0].endpoint[0].protocol.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/message-transport"} ).valueUri ) assert inst.messaging[0].reliableCache == 30 assert ( inst.messaging[0].supportedMessage[0].definition == "http://hl7.org/fhir/MessageDefinition/example" ) assert inst.messaging[0].supportedMessage[0].mode == "receiver" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.publisher == "ACME Corporation" assert inst.software.name == "EHR" assert inst.status == "draft" def test_capabilitystatement_1(base_settings): """No. 1 tests collection for CapabilityStatement. Test File: capabilitystatement-messagedefinition.json """ filename = ( base_settings["unittest_data_dir"] / "capabilitystatement-messagedefinition.json" ) inst = capabilitystatement.CapabilityStatement.model_validate_json( filename.read_bytes() ) assert "CapabilityStatement" == inst.get_resource_type() impl_capabilitystatement_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CapabilityStatement" == data["resourceType"] inst2 = capabilitystatement.CapabilityStatement(**data) impl_capabilitystatement_1(inst2) def impl_capabilitystatement_2(inst): assert inst.acceptLanguage[0] == "en" assert inst.acceptLanguage[1] == "es" assert inst.contact[0].name == "System Administrator" assert inst.contact[0].telecom[0].system == "email" assert inst.contact[0].telecom[0].value == "wile@acme.org" assert inst.copyright == "Copyright © Acme Healthcare and GoodCorp EHR Systems" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-01-04"} ).valueDateTime ) assert inst.description == ( "This is the FHIR capability statement for the main EHR at " "ACME for the private interface - it does not describe the " "public interface" ) assert ( inst.document[0].documentation == "Basic rules for all documents in the EHR system" ) assert inst.document[0].mode == "consumer" assert inst.document[0].profile == ( "http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-" "838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796" ) assert inst.experimental is True assert inst.fhirVersion == "5.0.0" assert inst.format[0] == "xml" assert inst.format[1] == "json" assert inst.id == "example" assert inst.implementation.description == "main EHR at ACME" assert ( inst.implementation.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://10.2.3.4/fhir"} ).valueUrl ) assert inst.implementationGuide[0] == "http://example.org/fhir/us/lab" assert inst.instantiates[0] == "http://ihe.org/fhir/CapabilityStatement/pixm-client" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America (the)" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.kind == "instance" assert ( inst.messaging[0].documentation == "ADT A08 equivalent for external system notifications" ) assert ( inst.messaging[0].endpoint[0].address == ExternalValidatorModel.model_validate( {"valueUrl": "mllp:10.1.1.10:9234"} ).valueUrl ) assert inst.messaging[0].endpoint[0].protocol.code == "mllp" assert ( inst.messaging[0].endpoint[0].protocol.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/message-transport"} ).valueUri ) assert inst.messaging[0].reliableCache == 30 assert ( inst.messaging[0].supportedMessage[0].definition == "http://hl7.org/fhir/MessageDefinition/example" ) assert inst.messaging[0].supportedMessage[0].mode == "receiver" assert inst.name == "ACMEEHR" assert inst.patchFormat[0] == "application/xml-patch+xml" assert inst.patchFormat[1] == "application/json-patch+json" assert inst.publisher == "ACME Corporation" assert inst.purpose == ( "Main EHR capability statement, published for contracting and" " operational support" ) assert ( inst.rest[0].compartment[0] == "http://hl7.org/fhir/CompartmentDefinition/patient" ) assert inst.rest[0].documentation == "Main FHIR endpoint for acem health" assert inst.rest[0].interaction[0].code == "transaction" assert inst.rest[0].interaction[1].code == "history-system" assert inst.rest[0].mode == "server" assert inst.rest[0].resource[0].conditionalCreate is True assert inst.rest[0].resource[0].conditionalDelete == "not-supported" assert inst.rest[0].resource[0].conditionalPatch is False assert inst.rest[0].resource[0].conditionalRead == "full-support" assert inst.rest[0].resource[0].conditionalUpdate is False assert ( inst.rest[0].resource[0].documentation == "This server does not let the clients create identities." ) assert inst.rest[0].resource[0].interaction[0].code == "read" assert inst.rest[0].resource[0].interaction[1].code == "vread" assert ( inst.rest[0].resource[0].interaction[1].documentation == "Only supported for patient records since 12-Dec 2012" ) assert inst.rest[0].resource[0].interaction[2].code == "update" assert inst.rest[0].resource[0].interaction[3].code == "history-instance" assert inst.rest[0].resource[0].interaction[4].code == "create" assert inst.rest[0].resource[0].interaction[5].code == "history-type" assert inst.rest[0].resource[0].profile == ( "http://registry.fhir.org/r5/StructureDefinition/7896271d-" "57f6-4231-89dc-dcc91eab2416" ) assert inst.rest[0].resource[0].readHistory is True assert inst.rest[0].resource[0].searchInclude[0] == "Patient:organization" assert ( inst.rest[0].resource[0].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/Patient-identifier" ) assert ( inst.rest[0].resource[0].searchParam[0].documentation == "Only supports search by institution MRN" ) assert inst.rest[0].resource[0].searchParam[0].name == "identifier" assert inst.rest[0].resource[0].searchParam[0].type == "token" assert inst.rest[0].resource[0].searchParam[1].definition == ( "http://hl7.org/fhir/SearchParameter/Patient-general-" "practitioner" ) assert inst.rest[0].resource[0].searchParam[1].name == "general-practitioner" assert inst.rest[0].resource[0].searchParam[1].type == "reference" assert inst.rest[0].resource[0].searchRevInclude[0] == "Person:patient" assert inst.rest[0].resource[0].supportedProfile[0] == ( "http://registry.fhir.org/r5/StructureDefinition/00ab9e7a-" "06c7-4f77-9234-4154ca1e3347" ) assert inst.rest[0].resource[0].type == "Patient" assert inst.rest[0].resource[0].updateCreate is False assert inst.rest[0].resource[0].versioning == "versioned-update" assert inst.rest[0].security.cors is True assert inst.rest[0].security.description == "See Smart on FHIR documentation" assert inst.rest[0].security.service[0].coding[0].code == "SMART-on-FHIR" assert ( inst.rest[0].security.service[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-security-service"} ).valueUri ) assert inst.software.name == "EHR" assert ( inst.software.releaseDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-01-04"} ).valueDateTime ) assert inst.software.version == "0.00.020.2134" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "ACME EHR capability statement" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "urn:uuid:68d043b5-9ecf-4559-a57a-396e0d452311"} ).valueUri ) assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "positive" assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variant-state"} ).valueUri ) assert inst.version == "20130510" def test_capabilitystatement_2(base_settings): """No. 2 tests collection for CapabilityStatement. Test File: capabilitystatement-example.json """ filename = base_settings["unittest_data_dir"] / "capabilitystatement-example.json" inst = capabilitystatement.CapabilityStatement.model_validate_json( filename.read_bytes() ) assert "CapabilityStatement" == inst.get_resource_type() impl_capabilitystatement_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CapabilityStatement" == data["resourceType"] inst2 = capabilitystatement.CapabilityStatement(**data) impl_capabilitystatement_2(inst2) def impl_capabilitystatement_3(inst): assert inst.contact[0].name == "FHIR Project" assert inst.contact[0].telecom[0].system == "other" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-09-16"} ).valueDateTime ) assert inst.description == ( "Basic conformance statement for a Measure Processor Service." " A server can support more functionality than defined " "here, but this is the minimum amount" ) assert inst.fhirVersion == "5.0.0" assert inst.format[0] == "json" assert inst.format[1] == "xml" assert inst.id == "measure-processor" assert inst.kind == "capability" assert inst.name == "MeasureProcessorServiceConformanceStatement" assert inst.publisher == "HL7, Inc" assert inst.rest[0].documentation == "RESTful Measure Processor Service" assert inst.rest[0].mode == "server" assert inst.rest[0].operation[0].definition == ( "http://hl7.org/fhir/OperationDefinition/Measure-evaluate-" "measure" ) assert inst.rest[0].operation[0].name == "evaluate-measure" assert inst.rest[0].operation[1].definition == ( "http://hl7.org/fhir/OperationDefinition/Measure-data-" "requirements" ) assert inst.rest[0].operation[1].name == "data-requirements" assert inst.rest[0].resource[0].interaction[0].code == "read" assert inst.rest[0].resource[0].interaction[0].documentation == ( "Read allows clients to get the logical definitions of the " "measures" ) assert inst.rest[0].resource[0].interaction[1].code == "search-type" assert inst.rest[0].resource[0].interaction[1].documentation == ( "Search allows clients to filter measures based on a provided" " search parameter" ) assert ( inst.rest[0].resource[0].profile == "http://hl7.org/fhir/StructureDefinition/Measure" ) assert ( inst.rest[0].resource[0].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/Measure-identifier" ) assert inst.rest[0].resource[0].searchParam[0].name == "identifier" assert inst.rest[0].resource[0].searchParam[0].type == "token" assert ( inst.rest[0].resource[0].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/Measure-status" ) assert inst.rest[0].resource[0].searchParam[1].name == "status" assert inst.rest[0].resource[0].searchParam[1].type == "token" assert ( inst.rest[0].resource[0].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/Measure-version" ) assert inst.rest[0].resource[0].searchParam[2].name == "version" assert inst.rest[0].resource[0].searchParam[2].type == "token" assert inst.rest[0].resource[0].type == "Measure" assert inst.rest[0].security.cors is True assert inst.rest[0].security.service[0].coding[0].code == "Certificates" assert ( inst.rest[0].security.service[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-security-service"} ).valueUri ) assert inst.software.name == "ACME Measure Processor Service" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Measure Processor Service Conformance Statement" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/measure-processor"} ).valueUri ) def test_capabilitystatement_3(base_settings): """No. 3 tests collection for CapabilityStatement. Test File: capabilitystatement-measure-processor.json """ filename = ( base_settings["unittest_data_dir"] / "capabilitystatement-measure-processor.json" ) inst = capabilitystatement.CapabilityStatement.model_validate_json( filename.read_bytes() ) assert "CapabilityStatement" == inst.get_resource_type() impl_capabilitystatement_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CapabilityStatement" == data["resourceType"] inst2 = capabilitystatement.CapabilityStatement(**data) impl_capabilitystatement_3(inst2) def impl_capabilitystatement_4(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-09-01"} ).valueDateTime ) assert inst.description == ( "Example capability statement for a Terminology Server. A " "server can support more fucntionality than defined here, but" " this is the minimum amount" ) assert inst.experimental is True assert inst.fhirVersion == "5.0.0" assert inst.format[0] == "json" assert inst.format[1] == "xml" assert inst.id == "example-terminology-server" assert inst.implementation.description == "The ACME FHIR Terminology Server" assert inst.kind == "instance" assert inst.name == "ACMETerminologyServiceCapabilityStatement" assert inst.rest[0].mode == "server" assert inst.rest[0].resource[0].interaction[0].code == "read" assert ( inst.rest[0].resource[0].interaction[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation" } ).valueUri ) assert inst.rest[0].resource[0].interaction[0].extension[0].valueCode == "SHALL" assert inst.rest[0].resource[0].interaction[1].code == "search-type" assert ( inst.rest[0].resource[0].interaction[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation" } ).valueUri ) assert inst.rest[0].resource[0].interaction[1].extension[0].valueCode == "SHALL" assert ( inst.rest[0].resource[0].operation[0].definition == "http://hl7.org/fhir/OperationDefinition/CodeSystem-lookup" ) assert ( inst.rest[0].resource[0].operation[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation" } ).valueUri ) assert inst.rest[0].resource[0].operation[0].extension[0].valueCode == "SHALL" assert inst.rest[0].resource[0].operation[0].name == "expand" assert inst.rest[0].resource[0].operation[1].definition == ( "http://hl7.org/fhir/OperationDefinition/CodeSystem-validate-" "code" ) assert ( inst.rest[0].resource[0].operation[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation" } ).valueUri ) assert inst.rest[0].resource[0].operation[1].extension[0].valueCode == "SHALL" assert inst.rest[0].resource[0].operation[1].name == "expand" assert ( inst.rest[0].resource[0].operation[2].definition == "http://hl7.org/fhir/OperationDefinition/CodeSystem-subsumes" ) assert ( inst.rest[0].resource[0].operation[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation" } ).valueUri ) assert inst.rest[0].resource[0].operation[2].extension[0].valueCode == "SHALL" assert inst.rest[0].resource[0].operation[2].name == "expand" assert ( inst.rest[0].resource[0].profile == "http://hl7.org/fhir/StructureDefinition/CodeSystem" ) assert ( inst.rest[0].resource[0].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/CodeSystem-url" ) assert inst.rest[0].resource[0].searchParam[0].name == "url" assert inst.rest[0].resource[0].searchParam[0].type == "uri" assert ( inst.rest[0].resource[0].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/CodeSystem-version" ) assert inst.rest[0].resource[0].searchParam[1].name == "version" assert inst.rest[0].resource[0].searchParam[1].type == "token" assert ( inst.rest[0].resource[0].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/CodeSystem-name" ) assert inst.rest[0].resource[0].searchParam[2].name == "name" assert inst.rest[0].resource[0].searchParam[2].type == "string" assert ( inst.rest[0].resource[0].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/CodeSystem-title" ) assert inst.rest[0].resource[0].searchParam[3].name == "title" assert inst.rest[0].resource[0].searchParam[3].type == "string" assert ( inst.rest[0].resource[0].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/CodeSystem-status" ) assert inst.rest[0].resource[0].searchParam[4].name == "status" assert inst.rest[0].resource[0].searchParam[4].type == "token" assert inst.rest[0].resource[0].type == "CodeSystem" assert inst.rest[0].resource[1].interaction[0].code == "read" assert ( inst.rest[0].resource[1].interaction[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation" } ).valueUri ) assert inst.rest[0].resource[1].interaction[0].extension[0].valueCode == "SHALL" assert inst.rest[0].resource[1].interaction[1].code == "search-type" assert ( inst.rest[0].resource[1].interaction[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation" } ).valueUri ) assert inst.rest[0].resource[1].interaction[1].extension[0].valueCode == "SHALL" assert ( inst.rest[0].resource[1].operation[0].definition == "http://hl7.org/fhir/OperationDefinition/ValueSet-expand" ) assert ( inst.rest[0].resource[1].operation[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation" } ).valueUri ) assert inst.rest[0].resource[1].operation[0].extension[0].valueCode == "SHALL" assert inst.rest[0].resource[1].operation[0].name == "expand" assert inst.rest[0].resource[1].operation[1].definition == ( "http://hl7.org/fhir/OperationDefinition/ValueSet-validate-" "code" ) assert ( inst.rest[0].resource[1].operation[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation" } ).valueUri ) assert inst.rest[0].resource[1].operation[1].extension[0].valueCode == "SHALL" assert inst.rest[0].resource[1].operation[1].name == "expand" assert ( inst.rest[0].resource[1].profile == "http://hl7.org/fhir/StructureDefinition/ValueSet" ) assert ( inst.rest[0].resource[1].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/ValueSet-url" ) assert inst.rest[0].resource[1].searchParam[0].name == "url" assert inst.rest[0].resource[1].searchParam[0].type == "uri" assert ( inst.rest[0].resource[1].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/ValueSet-version" ) assert inst.rest[0].resource[1].searchParam[1].name == "version" assert inst.rest[0].resource[1].searchParam[1].type == "token" assert ( inst.rest[0].resource[1].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/ValueSet-name" ) assert inst.rest[0].resource[1].searchParam[2].name == "name" assert inst.rest[0].resource[1].searchParam[2].type == "string" assert ( inst.rest[0].resource[1].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/ValueSet-title" ) assert inst.rest[0].resource[1].searchParam[3].name == "title" assert inst.rest[0].resource[1].searchParam[3].type == "string" assert ( inst.rest[0].resource[1].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/ValueSet-status" ) assert inst.rest[0].resource[1].searchParam[4].name == "status" assert inst.rest[0].resource[1].searchParam[4].type == "token" assert inst.rest[0].resource[1].type == "ValueSet" assert inst.rest[0].resource[2].interaction[0].code == "read" assert ( inst.rest[0].resource[2].interaction[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation" } ).valueUri ) assert inst.rest[0].resource[2].interaction[0].extension[0].valueCode == "SHALL" assert inst.rest[0].resource[2].interaction[1].code == "search-type" assert ( inst.rest[0].resource[2].interaction[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation" } ).valueUri ) assert inst.rest[0].resource[2].interaction[1].extension[0].valueCode == "SHALL" assert ( inst.rest[0].resource[2].operation[0].definition == "http://hl7.org/fhir/OperationDefinition/ConceptMap-translate" ) assert ( inst.rest[0].resource[2].operation[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation" } ).valueUri ) assert inst.rest[0].resource[2].operation[0].extension[0].valueCode == "SHALL" assert inst.rest[0].resource[2].operation[0].name == "expand" assert ( inst.rest[0].resource[2].profile == "http://hl7.org/fhir/StructureDefinition/ConceptMap" ) assert ( inst.rest[0].resource[2].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/ConceptMap-url" ) assert inst.rest[0].resource[2].searchParam[0].name == "url" assert inst.rest[0].resource[2].searchParam[0].type == "uri" assert ( inst.rest[0].resource[2].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/ConceptMap-version" ) assert inst.rest[0].resource[2].searchParam[1].name == "version" assert inst.rest[0].resource[2].searchParam[1].type == "token" assert ( inst.rest[0].resource[2].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/ConceptMap-name" ) assert inst.rest[0].resource[2].searchParam[2].name == "name" assert inst.rest[0].resource[2].searchParam[2].type == "string" assert ( inst.rest[0].resource[2].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/ConceptMap-title" ) assert inst.rest[0].resource[2].searchParam[3].name == "title" assert inst.rest[0].resource[2].searchParam[3].type == "string" assert ( inst.rest[0].resource[2].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/ConceptMap-status" ) assert inst.rest[0].resource[2].searchParam[4].name == "status" assert inst.rest[0].resource[2].searchParam[4].type == "token" assert inst.rest[0].resource[2].type == "ConceptMap" assert inst.status == "draft" assert inst.text.status == "extensions" assert inst.title == "ACME Terminology Service — Capability Statement" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CapabilityStatement/terminology-server"} ).valueUri ) assert inst.version == "5.0.0" def test_capabilitystatement_4(base_settings): """No. 4 tests collection for CapabilityStatement. Test File: capabilitystatement-terminology-server.json """ filename = ( base_settings["unittest_data_dir"] / "capabilitystatement-terminology-server.json" ) inst = capabilitystatement.CapabilityStatement.model_validate_json( filename.read_bytes() ) assert "CapabilityStatement" == inst.get_resource_type() impl_capabilitystatement_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CapabilityStatement" == data["resourceType"] inst2 = capabilitystatement.CapabilityStatement(**data) impl_capabilitystatement_4(inst2) def impl_capabilitystatement_5(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.experimental is True assert inst.fhirVersion == "5.0.0" assert inst.format[0] == "xml" assert inst.format[1] == "json" assert inst.id == "base2" assert inst.kind == "capability" assert inst.name == "Base FHIR Capability Statement (Empty)" assert inst.publisher == "FHIR Project Team" assert inst.rest[0].documentation == "An empty Capability Statement" assert inst.rest[0].mode == "server" assert inst.rest[0].security.cors is True assert inst.rest[0].security.description == ( "This is the Capability Statement to declare that the server " "supports SMART-on-FHIR. See the SMART-on-FHIR docs for the " "extension that would go with such a server" ) assert inst.rest[0].security.service[0].coding[0].code == "SMART-on-FHIR" assert inst.rest[0].security.service[0].coding[0].display == "SMART-on-FHIR" assert ( inst.rest[0].security.service[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/restful-security-service" } ).valueUri ) assert inst.rest[0].security.service[0].text == "See http://docs.smarthealthit.org/" assert inst.software.name == "Insert your software name here..." assert inst.status == "draft" assert inst.text.status == "extensions" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CapabilityStatement/base2"} ).valueUri ) assert inst.version == "5.0.0" def test_capabilitystatement_5(base_settings): """No. 5 tests collection for CapabilityStatement. Test File: capabilitystatement-base2.json """ filename = base_settings["unittest_data_dir"] / "capabilitystatement-base2.json" inst = capabilitystatement.CapabilityStatement.model_validate_json( filename.read_bytes() ) assert "CapabilityStatement" == inst.get_resource_type() impl_capabilitystatement_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CapabilityStatement" == data["resourceType"] inst2 = capabilitystatement.CapabilityStatement(**data) impl_capabilitystatement_5(inst2) def impl_capabilitystatement_6(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-06-18"} ).valueDateTime ) assert inst.description == ( "Prototype Capability Statement for September 2013 " "Connectathon" ) assert inst.fhirVersion == "5.0.0" assert inst.format[0] == "json" assert inst.format[1] == "xml" assert inst.id == "phr" assert inst.kind == "capability" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "PHRTemplate" assert inst.publisher == "FHIR Project" assert inst.rest[0].documentation == ( "Protoype server Capability Statement for September 2013 " "Connectathon" ) assert inst.rest[0].mode == "server" assert inst.rest[0].resource[0].interaction[0].code == "read" assert inst.rest[0].resource[0].interaction[1].code == "search-type" assert inst.rest[0].resource[0].interaction[1].documentation == ( "When a client searches patients with no search criteria, " "they get a list of all patients they have access too. " "Servers may elect to offer additional search parameters, but" " this is not required" ) assert inst.rest[0].resource[0].type == "Patient" assert inst.rest[0].resource[1].interaction[0].code == "read" assert inst.rest[0].resource[1].interaction[1].code == "search-type" assert inst.rest[0].resource[1].searchParam[0].documentation == ( "_id parameter always supported. For the connectathon, " "servers may elect which search parameters are supported" ) assert inst.rest[0].resource[1].searchParam[0].name == "_id" assert inst.rest[0].resource[1].searchParam[0].type == "token" assert inst.rest[0].resource[1].type == "DocumentReference" assert inst.rest[0].resource[2].interaction[0].code == "read" assert inst.rest[0].resource[2].interaction[1].code == "search-type" assert ( inst.rest[0].resource[2].searchParam[0].documentation == "Standard _id parameter" ) assert inst.rest[0].resource[2].searchParam[0].name == "_id" assert inst.rest[0].resource[2].searchParam[0].type == "token" assert inst.rest[0].resource[2].type == "Condition" assert inst.rest[0].resource[3].interaction[0].code == "read" assert inst.rest[0].resource[3].interaction[1].code == "search-type" assert ( inst.rest[0].resource[3].searchParam[0].documentation == "Standard _id parameter" ) assert inst.rest[0].resource[3].searchParam[0].name == "_id" assert inst.rest[0].resource[3].searchParam[0].type == "token" assert ( inst.rest[0].resource[3].searchParam[1].documentation == "which diagnostic discipline/department created the report" ) assert inst.rest[0].resource[3].searchParam[1].name == "service" assert inst.rest[0].resource[3].searchParam[1].type == "token" assert inst.rest[0].resource[3].type == "DiagnosticReport" assert inst.rest[0].security.service[0].text == "OAuth" assert inst.software.name == "ACME PHR Server" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "PHR Template" def test_capabilitystatement_6(base_settings): """No. 6 tests collection for CapabilityStatement. Test File: capabilitystatement-phr-example.json """ filename = ( base_settings["unittest_data_dir"] / "capabilitystatement-phr-example.json" ) inst = capabilitystatement.CapabilityStatement.model_validate_json( filename.read_bytes() ) assert "CapabilityStatement" == inst.get_resource_type() impl_capabilitystatement_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CapabilityStatement" == data["resourceType"] inst2 = capabilitystatement.CapabilityStatement(**data) impl_capabilitystatement_6(inst2) def impl_capabilitystatement_7(inst): assert inst.contact[0].name == "FHIR Project" assert inst.contact[0].telecom[0].system == "other" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-25"} ).valueDateTime ) assert inst.description == ( "Basic conformance statement for a Knowledge Repository " "Service. A server can support more functionality than " "defined here, but this is the minimum amount" ) assert inst.fhirVersion == "5.0.0" assert inst.format[0] == "json" assert inst.format[1] == "xml" assert inst.id == "knowledge-repository" assert inst.kind == "capability" assert inst.name == "KnowledgeRepositoryServiceConformanceStatement" assert inst.publisher == "HL7, Inc" assert inst.rest[0].documentation == "RESTful Knowledge Repository Service" assert inst.rest[0].mode == "server" assert inst.rest[0].operation[0].definition == ( "http://hl7.org/fhir/OperationDefinition/Library-data-" "requirements" ) assert inst.rest[0].operation[0].name == "data-requirements" assert inst.rest[0].resource[0].interaction[0].code == "read" assert inst.rest[0].resource[0].interaction[0].documentation == ( "Read allows clients to get the logical definitions of the " "libraries" ) assert inst.rest[0].resource[0].interaction[1].code == "search-type" assert inst.rest[0].resource[0].interaction[1].documentation == ( "Search allows clients to filter libraries based on a " "provided search parameter" ) assert ( inst.rest[0].resource[0].profile == "http://hl7.org/fhir/StructureDefinition/Library" ) assert ( inst.rest[0].resource[0].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/Library-description" ) assert inst.rest[0].resource[0].searchParam[0].name == "description" assert inst.rest[0].resource[0].searchParam[0].type == "string" assert ( inst.rest[0].resource[0].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/Library-identifier" ) assert inst.rest[0].resource[0].searchParam[1].name == "identifier" assert inst.rest[0].resource[0].searchParam[1].type == "token" assert ( inst.rest[0].resource[0].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/Library-status" ) assert inst.rest[0].resource[0].searchParam[2].name == "status" assert inst.rest[0].resource[0].searchParam[2].type == "token" assert ( inst.rest[0].resource[0].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/Library-title" ) assert inst.rest[0].resource[0].searchParam[3].name == "title" assert inst.rest[0].resource[0].searchParam[3].type == "string" assert ( inst.rest[0].resource[0].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/Library-topic" ) assert inst.rest[0].resource[0].searchParam[4].name == "topic" assert inst.rest[0].resource[0].searchParam[4].type == "token" assert ( inst.rest[0].resource[0].searchParam[5].definition == "http://hl7.org/fhir/SearchParameter/Library-version" ) assert inst.rest[0].resource[0].searchParam[5].name == "version" assert inst.rest[0].resource[0].searchParam[5].type == "token" assert ( inst.rest[0].resource[0].searchParam[6].definition == "http://hl7.org/fhir/SearchParameter/Library-composed-of" ) assert inst.rest[0].resource[0].searchParam[6].name == "composed-of" assert inst.rest[0].resource[0].searchParam[6].type == "reference" assert ( inst.rest[0].resource[0].searchParam[7].definition == "http://hl7.org/fhir/SearchParameter/Library-depends-on" ) assert inst.rest[0].resource[0].searchParam[7].name == "depends-on" assert inst.rest[0].resource[0].searchParam[7].type == "reference" assert ( inst.rest[0].resource[0].searchParam[8].definition == "http://hl7.org/fhir/SearchParameter/Library-derived-from" ) assert inst.rest[0].resource[0].searchParam[8].name == "derived-from" assert inst.rest[0].resource[0].searchParam[8].type == "reference" assert ( inst.rest[0].resource[0].searchParam[9].definition == "http://hl7.org/fhir/SearchParameter/Library-predecessor" ) assert inst.rest[0].resource[0].searchParam[9].name == "predecessor" assert inst.rest[0].resource[0].searchParam[9].type == "reference" assert inst.rest[0].resource[0].type == "Library" assert inst.rest[0].resource[1].interaction[0].code == "read" assert inst.rest[0].resource[1].interaction[0].documentation == ( "Read allows clients to get the logical definitions of the " "plan definitions" ) assert inst.rest[0].resource[1].interaction[1].code == "search-type" assert inst.rest[0].resource[1].interaction[1].documentation == ( "Search allows clients to filter plan definitions based on a " "provided search parameter" ) assert ( inst.rest[0].resource[1].profile == "http://hl7.org/fhir/StructureDefinition/PlanDefinition" ) assert inst.rest[0].resource[1].searchParam[0].definition == ( "http://hl7.org/fhir/SearchParameter/PlanDefinition-" "description" ) assert inst.rest[0].resource[1].searchParam[0].name == "description" assert inst.rest[0].resource[1].searchParam[0].type == "string" assert inst.rest[0].resource[1].searchParam[1].definition == ( "http://hl7.org/fhir/SearchParameter/PlanDefinition-" "identifier" ) assert inst.rest[0].resource[1].searchParam[1].name == "identifier" assert inst.rest[0].resource[1].searchParam[1].type == "token" assert ( inst.rest[0].resource[1].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/PlanDefinition-status" ) assert inst.rest[0].resource[1].searchParam[2].name == "status" assert inst.rest[0].resource[1].searchParam[2].type == "token" assert ( inst.rest[0].resource[1].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/PlanDefinition-title" ) assert inst.rest[0].resource[1].searchParam[3].name == "title" assert inst.rest[0].resource[1].searchParam[3].type == "string" assert ( inst.rest[0].resource[1].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/PlanDefinition-topic" ) assert inst.rest[0].resource[1].searchParam[4].name == "topic" assert inst.rest[0].resource[1].searchParam[4].type == "token" assert ( inst.rest[0].resource[1].searchParam[5].definition == "http://hl7.org/fhir/SearchParameter/PlanDefinition-version" ) assert inst.rest[0].resource[1].searchParam[5].name == "version" assert inst.rest[0].resource[1].searchParam[5].type == "token" assert inst.rest[0].resource[1].searchParam[6].definition == ( "http://hl7.org/fhir/SearchParameter/PlanDefinition-composed-" "of" ) assert inst.rest[0].resource[1].searchParam[6].name == "composed-of" assert inst.rest[0].resource[1].searchParam[6].type == "reference" assert inst.rest[0].resource[1].searchParam[7].definition == ( "http://hl7.org/fhir/SearchParameter/PlanDefinition-depends-" "on" ) assert inst.rest[0].resource[1].searchParam[7].name == "depends-on" assert inst.rest[0].resource[1].searchParam[7].type == "reference" assert inst.rest[0].resource[1].searchParam[8].definition == ( "http://hl7.org/fhir/SearchParameter/PlanDefinition-derived-" "from" ) assert inst.rest[0].resource[1].searchParam[8].name == "derived-from" assert inst.rest[0].resource[1].searchParam[8].type == "reference" assert inst.rest[0].resource[1].searchParam[9].definition == ( "http://hl7.org/fhir/SearchParameter/PlanDefinition-" "predecessor" ) assert inst.rest[0].resource[1].searchParam[9].name == "predecessor" assert inst.rest[0].resource[1].searchParam[9].type == "reference" assert inst.rest[0].resource[1].type == "PlanDefinition" assert inst.rest[0].resource[2].interaction[0].code == "read" assert inst.rest[0].resource[2].interaction[0].documentation == ( "Read allows clients to get the logical definitions of the " "activity definitions" ) assert inst.rest[0].resource[2].interaction[1].code == "search-type" assert inst.rest[0].resource[2].interaction[1].documentation == ( "Search allows clients to filter activity definitions based " "on a provided search parameter" ) assert ( inst.rest[0].resource[2].profile == "http://hl7.org/fhir/StructureDefinition/ActivityDefinition" ) assert inst.rest[0].resource[2].searchParam[0].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "description" ) assert inst.rest[0].resource[2].searchParam[0].name == "description" assert inst.rest[0].resource[2].searchParam[0].type == "string" assert inst.rest[0].resource[2].searchParam[1].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "identifier" ) assert inst.rest[0].resource[2].searchParam[1].name == "identifier" assert inst.rest[0].resource[2].searchParam[1].type == "token" assert inst.rest[0].resource[2].searchParam[2].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "status" ) assert inst.rest[0].resource[2].searchParam[2].name == "status" assert inst.rest[0].resource[2].searchParam[2].type == "token" assert ( inst.rest[0].resource[2].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/ActivityDefinition-title" ) assert inst.rest[0].resource[2].searchParam[3].name == "title" assert inst.rest[0].resource[2].searchParam[3].type == "string" assert ( inst.rest[0].resource[2].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/ActivityDefinition-topic" ) assert inst.rest[0].resource[2].searchParam[4].name == "topic" assert inst.rest[0].resource[2].searchParam[4].type == "token" assert inst.rest[0].resource[2].searchParam[5].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "version" ) assert inst.rest[0].resource[2].searchParam[5].name == "version" assert inst.rest[0].resource[2].searchParam[5].type == "token" assert inst.rest[0].resource[2].searchParam[6].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "composed-of" ) assert inst.rest[0].resource[2].searchParam[6].name == "composed-of" assert inst.rest[0].resource[2].searchParam[6].type == "reference" assert inst.rest[0].resource[2].searchParam[7].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "depends-on" ) assert inst.rest[0].resource[2].searchParam[7].name == "depends-on" assert inst.rest[0].resource[2].searchParam[7].type == "reference" assert inst.rest[0].resource[2].searchParam[8].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "derived-from" ) assert inst.rest[0].resource[2].searchParam[8].name == "derived-from" assert inst.rest[0].resource[2].searchParam[8].type == "reference" assert inst.rest[0].resource[2].searchParam[9].definition == ( "http://hl7.org/fhir/SearchParameter/ActivityDefinition-" "predecessor" ) assert inst.rest[0].resource[2].searchParam[9].name == "predecessor" assert inst.rest[0].resource[2].searchParam[9].type == "reference" assert inst.rest[0].resource[2].type == "ActivityDefinition" assert inst.rest[0].resource[3].interaction[0].code == "read" assert inst.rest[0].resource[3].interaction[0].documentation == ( "Read allows clients to get the logical definitions of the " "measures" ) assert inst.rest[0].resource[3].interaction[1].code == "search-type" assert inst.rest[0].resource[3].interaction[1].documentation == ( "Search allows clients to filter measures based on a provided" " search parameter" ) assert ( inst.rest[0].resource[3].profile == "http://hl7.org/fhir/StructureDefinition/Measure" ) assert ( inst.rest[0].resource[3].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/Measure-description" ) assert inst.rest[0].resource[3].searchParam[0].name == "description" assert inst.rest[0].resource[3].searchParam[0].type == "string" assert ( inst.rest[0].resource[3].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/Measure-identifier" ) assert inst.rest[0].resource[3].searchParam[1].name == "identifier" assert inst.rest[0].resource[3].searchParam[1].type == "token" assert ( inst.rest[0].resource[3].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/Measure-status" ) assert inst.rest[0].resource[3].searchParam[2].name == "status" assert inst.rest[0].resource[3].searchParam[2].type == "token" assert ( inst.rest[0].resource[3].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/Measure-title" ) assert inst.rest[0].resource[3].searchParam[3].name == "title" assert inst.rest[0].resource[3].searchParam[3].type == "string" assert ( inst.rest[0].resource[3].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/Measure-topic" ) assert inst.rest[0].resource[3].searchParam[4].name == "topic" assert inst.rest[0].resource[3].searchParam[4].type == "token" assert ( inst.rest[0].resource[3].searchParam[5].definition == "http://hl7.org/fhir/SearchParameter/Measure-version" ) assert inst.rest[0].resource[3].searchParam[5].name == "version" assert inst.rest[0].resource[3].searchParam[5].type == "token" assert ( inst.rest[0].resource[3].searchParam[6].definition == "http://hl7.org/fhir/SearchParameter/Measure-composed-of" ) assert inst.rest[0].resource[3].searchParam[6].name == "composed-of" assert inst.rest[0].resource[3].searchParam[6].type == "reference" assert ( inst.rest[0].resource[3].searchParam[7].definition == "http://hl7.org/fhir/SearchParameter/Measure-depends-on" ) assert inst.rest[0].resource[3].searchParam[7].name == "depends-on" assert inst.rest[0].resource[3].searchParam[7].type == "reference" assert ( inst.rest[0].resource[3].searchParam[8].definition == "http://hl7.org/fhir/SearchParameter/Measure-derived-from" ) assert inst.rest[0].resource[3].searchParam[8].name == "derived-from" assert inst.rest[0].resource[3].searchParam[8].type == "reference" assert ( inst.rest[0].resource[3].searchParam[9].definition == "http://hl7.org/fhir/SearchParameter/Measure-predecessor" ) assert inst.rest[0].resource[3].searchParam[9].name == "predecessor" assert inst.rest[0].resource[3].searchParam[9].type == "reference" assert inst.rest[0].resource[3].type == "Measure" assert inst.rest[0].resource[4].interaction[0].code == "read" assert inst.rest[0].resource[4].interaction[0].documentation == ( "Read allows clients to get the logical definitions of the " "measures" ) assert inst.rest[0].resource[4].interaction[1].code == "search-type" assert inst.rest[0].resource[4].interaction[1].documentation == ( "Search allows clients to filter measures based on a provided" " search parameter" ) assert ( inst.rest[0].resource[4].profile == "http://hl7.org/fhir/StructureDefinition/Questionnaire" ) assert ( inst.rest[0].resource[4].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/Questionnaire-code" ) assert inst.rest[0].resource[4].searchParam[0].name == "code" assert inst.rest[0].resource[4].searchParam[0].type == "token" assert ( inst.rest[0].resource[4].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/Questionnaire-context" ) assert inst.rest[0].resource[4].searchParam[1].name == "context" assert inst.rest[0].resource[4].searchParam[1].type == "token" assert ( inst.rest[0].resource[4].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/Questionnaire-date" ) assert inst.rest[0].resource[4].searchParam[2].name == "date" assert inst.rest[0].resource[4].searchParam[2].type == "date" assert ( inst.rest[0].resource[4].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/Questionnaire-identifier" ) assert inst.rest[0].resource[4].searchParam[3].name == "identifier" assert inst.rest[0].resource[4].searchParam[3].type == "token" assert ( inst.rest[0].resource[4].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/Questionnaire-publisher" ) assert inst.rest[0].resource[4].searchParam[4].name == "publisher" assert inst.rest[0].resource[4].searchParam[4].type == "string" assert ( inst.rest[0].resource[4].searchParam[5].definition == "http://hl7.org/fhir/SearchParameter/Questionnaire-status" ) assert inst.rest[0].resource[4].searchParam[5].name == "status" assert inst.rest[0].resource[4].searchParam[5].type == "token" assert ( inst.rest[0].resource[4].searchParam[6].definition == "http://hl7.org/fhir/SearchParameter/Questionnaire-title" ) assert inst.rest[0].resource[4].searchParam[6].name == "title" assert inst.rest[0].resource[4].searchParam[6].type == "string" assert ( inst.rest[0].resource[4].searchParam[7].definition == "http://hl7.org/fhir/SearchParameter/Questionnaire-version" ) assert inst.rest[0].resource[4].searchParam[7].name == "version" assert inst.rest[0].resource[4].searchParam[7].type == "token" assert inst.rest[0].resource[4].type == "Questionnaire" assert inst.rest[0].security.cors is True assert inst.rest[0].security.service[0].coding[0].code == "Certificates" assert ( inst.rest[0].security.service[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-security-service"} ).valueUri ) assert inst.software.name == "ACME Knowledge Repository Service" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Knowledge Repository Service Conformance Statement" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/knowledge-repository"} ).valueUri ) def test_capabilitystatement_7(base_settings): """No. 7 tests collection for CapabilityStatement. Test File: capabilitystatement-knowledge-repository.json """ filename = ( base_settings["unittest_data_dir"] / "capabilitystatement-knowledge-repository.json" ) inst = capabilitystatement.CapabilityStatement.model_validate_json( filename.read_bytes() ) assert "CapabilityStatement" == inst.get_resource_type() impl_capabilitystatement_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CapabilityStatement" == data["resourceType"] inst2 = capabilitystatement.CapabilityStatement(**data) impl_capabilitystatement_7(inst2) def impl_capabilitystatement_8(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.experimental is True assert inst.fhirVersion == "5.0.0" assert inst.format[0] == "xml" assert inst.format[1] == "json" assert inst.id == "base" assert inst.kind == "capability" assert inst.name == "Base FHIR Capability Statement (Full)" assert inst.publisher == "FHIR Project Team" assert inst.rest[0].documentation == "All the functionality defined in FHIR" assert inst.rest[0].interaction[0].code == "transaction" assert inst.rest[0].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].interaction[1].code == "batch" assert inst.rest[0].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].interaction[2].code == "history-system" assert inst.rest[0].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].interaction[3].code == "search-system" assert inst.rest[0].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].mode == "server" assert ( inst.rest[0].operation[0].definition == "http://hl7.org/fhir/OperationDefinition/resource-validate" ) assert inst.rest[0].operation[0].name == "validate" assert ( inst.rest[0].operation[1].definition == "http://hl7.org/fhir/OperationDefinition/resource-meta" ) assert inst.rest[0].operation[1].name == "meta" assert ( inst.rest[0].operation[2].definition == "http://hl7.org/fhir/OperationDefinition/resource-meta-add" ) assert inst.rest[0].operation[2].name == "meta-add" assert ( inst.rest[0].operation[3].definition == "http://hl7.org/fhir/OperationDefinition/resource-meta-delete" ) assert inst.rest[0].operation[3].name == "meta-delete" assert ( inst.rest[0].operation[4].definition == "http://hl7.org/fhir/OperationDefinition/resource-convert" ) assert inst.rest[0].operation[4].name == "convert" assert ( inst.rest[0].operation[5].definition == "http://hl7.org/fhir/OperationDefinition/resource-graphql" ) assert inst.rest[0].operation[5].name == "graphql" assert ( inst.rest[0].operation[6].definition == "http://hl7.org/fhir/OperationDefinition/resource-graph" ) assert inst.rest[0].operation[6].name == "graph" assert ( inst.rest[0].operation[7].definition == "http://hl7.org/fhir/OperationDefinition/resource-add" ) assert inst.rest[0].operation[7].name == "add" assert ( inst.rest[0].operation[8].definition == "http://hl7.org/fhir/OperationDefinition/resource-remove" ) assert inst.rest[0].operation[8].name == "remove" assert ( inst.rest[0].operation[9].definition == "http://hl7.org/fhir/OperationDefinition/resource-filter" ) assert inst.rest[0].operation[9].name == "filter" assert inst.rest[0].resource[0].conditionalCreate is True assert inst.rest[0].resource[0].conditionalDelete == "multiple" assert inst.rest[0].resource[0].conditionalUpdate is True assert inst.rest[0].resource[0].interaction[0].code == "read" assert inst.rest[0].resource[0].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[0].interaction[1].code == "vread" assert inst.rest[0].resource[0].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[0].interaction[2].code == "update" assert inst.rest[0].resource[0].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[0].interaction[3].code == "delete" assert inst.rest[0].resource[0].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[0].interaction[4].code == "history-instance" assert inst.rest[0].resource[0].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[0].interaction[5].code == "history-type" assert inst.rest[0].resource[0].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[0].interaction[6].code == "create" assert inst.rest[0].resource[0].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[0].interaction[7].code == "search-type" assert inst.rest[0].resource[0].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[0].profile == "http://hl7.org/fhir/StructureDefinition/Account" ) assert inst.rest[0].resource[0].referencePolicy[0] == "literal" assert inst.rest[0].resource[0].referencePolicy[1] == "logical" assert inst.rest[0].resource[0].searchInclude[0] == "Account.owner" assert inst.rest[0].resource[0].searchInclude[1] == "Account.patient" assert inst.rest[0].resource[0].searchInclude[2] == "Account.subject" assert inst.rest[0].resource[0].searchInclude[3] == "Account.guarantor" assert inst.rest[0].resource[0].searchInclude[4] == "Account.relatedaccount" assert ( inst.rest[0].resource[0].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/Account-owner" ) assert ( inst.rest[0].resource[0].searchParam[0].documentation == "Entity managing the Account" ) assert inst.rest[0].resource[0].searchParam[0].name == "owner" assert inst.rest[0].resource[0].searchParam[0].type == "reference" assert ( inst.rest[0].resource[0].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/clinical-identifier" ) assert inst.rest[0].resource[0].searchParam[1].documentation == "Account number" assert inst.rest[0].resource[0].searchParam[1].name == "identifier" assert inst.rest[0].resource[0].searchParam[1].type == "token" assert ( inst.rest[0].resource[0].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/Account-period" ) assert inst.rest[0].resource[0].searchParam[2].documentation == "Transaction window" assert inst.rest[0].resource[0].searchParam[2].name == "period" assert inst.rest[0].resource[0].searchParam[2].type == "date" assert ( inst.rest[0].resource[0].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/clinical-patient" ) assert ( inst.rest[0].resource[0].searchParam[3].documentation == "The entity that caused the expenses" ) assert inst.rest[0].resource[0].searchParam[3].name == "patient" assert inst.rest[0].resource[0].searchParam[3].type == "reference" assert ( inst.rest[0].resource[0].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/Account-subject" ) assert ( inst.rest[0].resource[0].searchParam[4].documentation == "The entity that caused the expenses" ) assert inst.rest[0].resource[0].searchParam[4].name == "subject" assert inst.rest[0].resource[0].searchParam[4].type == "reference" assert ( inst.rest[0].resource[0].searchParam[5].definition == "http://hl7.org/fhir/SearchParameter/Account-name" ) assert ( inst.rest[0].resource[0].searchParam[5].documentation == "Human-readable label" ) assert inst.rest[0].resource[0].searchParam[5].name == "name" assert inst.rest[0].resource[0].searchParam[5].type == "string" assert ( inst.rest[0].resource[0].searchParam[6].definition == "http://hl7.org/fhir/SearchParameter/Account-guarantor" ) assert ( inst.rest[0].resource[0].searchParam[6].documentation == "The parties ultimately responsible for balancing the Account" ) assert inst.rest[0].resource[0].searchParam[6].name == "guarantor" assert inst.rest[0].resource[0].searchParam[6].type == "reference" assert ( inst.rest[0].resource[0].searchParam[7].definition == "http://hl7.org/fhir/SearchParameter/clinical-type" ) assert ( inst.rest[0].resource[0].searchParam[7].documentation == "E.g. patient, expense, depreciation" ) assert inst.rest[0].resource[0].searchParam[7].name == "type" assert inst.rest[0].resource[0].searchParam[7].type == "token" assert ( inst.rest[0].resource[0].searchParam[8].definition == "http://hl7.org/fhir/SearchParameter/Account-relatedaccount" ) assert ( inst.rest[0].resource[0].searchParam[8].documentation == "Parent and other related accounts" ) assert inst.rest[0].resource[0].searchParam[8].name == "relatedaccount" assert inst.rest[0].resource[0].searchParam[8].type == "reference" assert ( inst.rest[0].resource[0].searchParam[9].definition == "http://hl7.org/fhir/SearchParameter/Account-status" ) assert ( inst.rest[0].resource[0].searchParam[9].documentation == "active | inactive | entered-in-error | on-hold | unknown" ) assert inst.rest[0].resource[0].searchParam[9].name == "status" assert inst.rest[0].resource[0].searchParam[9].type == "token" assert inst.rest[0].resource[0].searchRevInclude[0] == "Account.relatedaccount" assert inst.rest[0].resource[0].searchRevInclude[1] == "ChargeItem.account" assert inst.rest[0].resource[0].searchRevInclude[2] == "Encounter.account" assert inst.rest[0].resource[0].searchRevInclude[3] == "Invoice.account" assert ( inst.rest[0].resource[0].searchRevInclude[4] == "PaymentReconciliation.allocation-account" ) assert inst.rest[0].resource[0].type == "Account" assert inst.rest[0].resource[1].conditionalCreate is True assert inst.rest[0].resource[1].conditionalDelete == "multiple" assert inst.rest[0].resource[1].conditionalUpdate is True assert inst.rest[0].resource[1].interaction[0].code == "read" assert inst.rest[0].resource[1].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[1].interaction[1].code == "vread" assert inst.rest[0].resource[1].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[1].interaction[2].code == "update" assert inst.rest[0].resource[1].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[1].interaction[3].code == "delete" assert inst.rest[0].resource[1].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[1].interaction[4].code == "history-instance" assert inst.rest[0].resource[1].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[1].interaction[5].code == "history-type" assert inst.rest[0].resource[1].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[1].interaction[6].code == "create" assert inst.rest[0].resource[1].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[1].interaction[7].code == "search-type" assert inst.rest[0].resource[1].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[1].profile == "http://hl7.org/fhir/StructureDefinition/ActivityDefinition" ) assert inst.rest[0].resource[1].referencePolicy[0] == "literal" assert inst.rest[0].resource[1].referencePolicy[1] == "logical" assert inst.rest[0].resource[1].searchInclude[0] == "ActivityDefinition.successor" assert ( inst.rest[0].resource[1].searchInclude[1] == "ActivityDefinition.derived-from" ) assert inst.rest[0].resource[1].searchInclude[2] == "ActivityDefinition.predecessor" assert inst.rest[0].resource[1].searchInclude[3] == "ActivityDefinition.composed-of" assert inst.rest[0].resource[1].searchInclude[4] == "ActivityDefinition.depends-on" assert ( inst.rest[0].resource[1].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/CanonicalResource-date" ) assert ( inst.rest[0].resource[1].searchParam[0].documentation == "The activity definition publication date" ) assert inst.rest[0].resource[1].searchParam[0].name == "date" assert inst.rest[0].resource[1].searchParam[0].type == "date" assert inst.rest[0].resource[1].searchParam[1].definition == ( "http://hl7.org/fhir/SearchParameter/CanonicalResource-" "identifier" ) assert ( inst.rest[0].resource[1].searchParam[1].documentation == "External identifier for the activity definition" ) assert inst.rest[0].resource[1].searchParam[1].name == "identifier" assert inst.rest[0].resource[1].searchParam[1].type == "token" assert inst.rest[0].resource[1].searchParam[2].definition == ( "http://hl7.org/fhir/SearchParameter/MetadataResource-" "successor" ) assert ( inst.rest[0].resource[1].searchParam[2].documentation == "What resource is being referenced" ) assert inst.rest[0].resource[1].searchParam[2].name == "successor" assert inst.rest[0].resource[1].searchParam[2].type == "reference" assert inst.rest[0].resource[1].searchParam[3].definition == ( "http://hl7.org/fhir/SearchParameter/CanonicalResource-" "context-type-value" ) assert inst.rest[0].resource[1].searchParam[3].documentation == ( "A use context type and value assigned to the activity " "definition" ) assert inst.rest[0].resource[1].searchParam[3].name == "context-type-value" assert inst.rest[0].resource[1].searchParam[3].type == "composite" assert ( inst.rest[0].resource[1].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/ActivityDefinition-kind" ) assert ( inst.rest[0].resource[1].searchParam[4].documentation == "The kind of activity definition" ) assert inst.rest[0].resource[1].searchParam[4].name == "kind" assert inst.rest[0].resource[1].searchParam[4].type == "token" assert inst.rest[0].resource[1].searchParam[5].definition == ( "http://hl7.org/fhir/SearchParameter/CanonicalResource-" "jurisdiction" ) assert ( inst.rest[0].resource[1].searchParam[5].documentation == "Intended jurisdiction for the activity definition" ) assert inst.rest[0].resource[1].searchParam[5].name == "jurisdiction" assert inst.rest[0].resource[1].searchParam[5].type == "token" assert inst.rest[0].resource[1].searchParam[6].definition == ( "http://hl7.org/fhir/SearchParameter/MetadataResource-" "derived-from" ) assert ( inst.rest[0].resource[1].searchParam[6].documentation == "What resource is being referenced" ) assert inst.rest[0].resource[1].searchParam[6].name == "derived-from" assert inst.rest[0].resource[1].searchParam[6].type == "reference" assert inst.rest[0].resource[1].searchParam[7].definition == ( "http://hl7.org/fhir/SearchParameter/CanonicalResource-" "description" ) assert ( inst.rest[0].resource[1].searchParam[7].documentation == "The description of the activity definition" ) assert inst.rest[0].resource[1].searchParam[7].name == "description" assert inst.rest[0].resource[1].searchParam[7].type == "string" assert inst.rest[0].resource[1].searchParam[8].definition == ( "http://hl7.org/fhir/SearchParameter/CanonicalResource-" "context-type" ) assert ( inst.rest[0].resource[1].searchParam[8].documentation == "A type of use context assigned to the activity definition" ) assert inst.rest[0].resource[1].searchParam[8].name == "context-type" assert inst.rest[0].resource[1].searchParam[8].type == "token" assert inst.rest[0].resource[1].searchParam[9].definition == ( "http://hl7.org/fhir/SearchParameter/MetadataResource-" "predecessor" ) assert ( inst.rest[0].resource[1].searchParam[9].documentation == "What resource is being referenced" ) assert inst.rest[0].resource[1].searchParam[9].name == "predecessor" assert inst.rest[0].resource[1].searchParam[9].type == "reference" assert ( inst.rest[0].resource[1].searchRevInclude[0] == "CarePlan.instantiates-canonical" ) assert ( inst.rest[0].resource[1].searchRevInclude[1] == "ClinicalUseDefinition.product" ) assert ( inst.rest[0].resource[1].searchRevInclude[2] == "ClinicalUseDefinition.subject" ) assert ( inst.rest[0].resource[1].searchRevInclude[3] == "Communication.instantiates-canonical" ) assert ( inst.rest[0].resource[1].searchRevInclude[4] == "DeviceRequest.instantiates-canonical" ) assert ( inst.rest[0].resource[1].searchRevInclude[5] == "FamilyMemberHistory.instantiates-canonical" ) assert inst.rest[0].resource[1].searchRevInclude[6] == "MessageDefinition.parent" assert inst.rest[0].resource[1].searchRevInclude[7] == "PlanDefinition.definition" assert ( inst.rest[0].resource[1].searchRevInclude[8] == "Procedure.instantiates-canonical" ) assert ( inst.rest[0].resource[1].searchRevInclude[9] == "RegulatedAuthorization.subject" ) assert inst.rest[0].resource[1].type == "ActivityDefinition" assert inst.rest[0].resource[2].conditionalCreate is True assert inst.rest[0].resource[2].conditionalDelete == "multiple" assert inst.rest[0].resource[2].conditionalUpdate is True assert inst.rest[0].resource[2].interaction[0].code == "read" assert inst.rest[0].resource[2].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[2].interaction[1].code == "vread" assert inst.rest[0].resource[2].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[2].interaction[2].code == "update" assert inst.rest[0].resource[2].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[2].interaction[3].code == "delete" assert inst.rest[0].resource[2].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[2].interaction[4].code == "history-instance" assert inst.rest[0].resource[2].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[2].interaction[5].code == "history-type" assert inst.rest[0].resource[2].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[2].interaction[6].code == "create" assert inst.rest[0].resource[2].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[2].interaction[7].code == "search-type" assert inst.rest[0].resource[2].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[2].profile == "http://hl7.org/fhir/StructureDefinition/ActorDefinition" ) assert inst.rest[0].resource[2].referencePolicy[0] == "literal" assert inst.rest[0].resource[2].referencePolicy[1] == "logical" assert ( inst.rest[0].resource[2].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/CanonicalResource-date" ) assert ( inst.rest[0].resource[2].searchParam[0].documentation == "The Actor Definition publication date" ) assert inst.rest[0].resource[2].searchParam[0].name == "date" assert inst.rest[0].resource[2].searchParam[0].type == "date" assert inst.rest[0].resource[2].searchParam[1].definition == ( "http://hl7.org/fhir/SearchParameter/CanonicalResource-" "identifier" ) assert ( inst.rest[0].resource[2].searchParam[1].documentation == "External identifier for the Actor Definition" ) assert inst.rest[0].resource[2].searchParam[1].name == "identifier" assert inst.rest[0].resource[2].searchParam[1].type == "token" assert inst.rest[0].resource[2].searchParam[2].definition == ( "http://hl7.org/fhir/SearchParameter/CanonicalResource-" "context-type-value" ) assert inst.rest[0].resource[2].searchParam[2].documentation == ( "A use context type and value assigned to the Actor " "Definition" ) assert inst.rest[0].resource[2].searchParam[2].name == "context-type-value" assert inst.rest[0].resource[2].searchParam[2].type == "composite" assert inst.rest[0].resource[2].searchParam[3].definition == ( "http://hl7.org/fhir/SearchParameter/CanonicalResource-" "jurisdiction" ) assert ( inst.rest[0].resource[2].searchParam[3].documentation == "Intended jurisdiction for the Actor Definition" ) assert inst.rest[0].resource[2].searchParam[3].name == "jurisdiction" assert inst.rest[0].resource[2].searchParam[3].type == "token" assert inst.rest[0].resource[2].searchParam[4].definition == ( "http://hl7.org/fhir/SearchParameter/CanonicalResource-" "description" ) assert ( inst.rest[0].resource[2].searchParam[4].documentation == "The description of the Actor Definition" ) assert inst.rest[0].resource[2].searchParam[4].name == "description" assert inst.rest[0].resource[2].searchParam[4].type == "string" assert inst.rest[0].resource[2].searchParam[5].definition == ( "http://hl7.org/fhir/SearchParameter/CanonicalResource-" "context-type" ) assert ( inst.rest[0].resource[2].searchParam[5].documentation == "A type of use context assigned to the Actor Definition" ) assert inst.rest[0].resource[2].searchParam[5].name == "context-type" assert inst.rest[0].resource[2].searchParam[5].type == "token" assert ( inst.rest[0].resource[2].searchParam[6].definition == "http://hl7.org/fhir/SearchParameter/CanonicalResource-title" ) assert ( inst.rest[0].resource[2].searchParam[6].documentation == "The human-friendly name of the Actor Definition" ) assert inst.rest[0].resource[2].searchParam[6].name == "title" assert inst.rest[0].resource[2].searchParam[6].type == "string" assert ( inst.rest[0].resource[2].searchParam[7].definition == "http://hl7.org/fhir/SearchParameter/ActorDefinition-type" ) assert inst.rest[0].resource[2].searchParam[7].documentation == "The type of actor" assert inst.rest[0].resource[2].searchParam[7].name == "type" assert inst.rest[0].resource[2].searchParam[7].type == "token" assert inst.rest[0].resource[2].searchParam[8].definition == ( "http://hl7.org/fhir/SearchParameter/CanonicalResource-" "version" ) assert ( inst.rest[0].resource[2].searchParam[8].documentation == "The business version of the Actor Definition" ) assert inst.rest[0].resource[2].searchParam[8].name == "version" assert inst.rest[0].resource[2].searchParam[8].type == "token" assert ( inst.rest[0].resource[2].searchParam[9].definition == "http://hl7.org/fhir/SearchParameter/CanonicalResource-url" ) assert ( inst.rest[0].resource[2].searchParam[9].documentation == "The uri that identifies the Actor Definition" ) assert inst.rest[0].resource[2].searchParam[9].name == "url" assert inst.rest[0].resource[2].searchParam[9].type == "uri" assert inst.rest[0].resource[2].searchRevInclude[0] == "Requirements.actor" assert inst.rest[0].resource[2].type == "ActorDefinition" assert inst.rest[0].resource[3].conditionalCreate is True assert inst.rest[0].resource[3].conditionalDelete == "multiple" assert inst.rest[0].resource[3].conditionalUpdate is True assert inst.rest[0].resource[3].interaction[0].code == "read" assert inst.rest[0].resource[3].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[3].interaction[1].code == "vread" assert inst.rest[0].resource[3].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[3].interaction[2].code == "update" assert inst.rest[0].resource[3].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[3].interaction[3].code == "delete" assert inst.rest[0].resource[3].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[3].interaction[4].code == "history-instance" assert inst.rest[0].resource[3].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[3].interaction[5].code == "history-type" assert inst.rest[0].resource[3].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[3].interaction[6].code == "create" assert inst.rest[0].resource[3].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[3].interaction[7].code == "search-type" assert inst.rest[0].resource[3].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[3].profile == ( "http://hl7.org/fhir/StructureDefinition/AdministrableProduct" "Definition" ) assert inst.rest[0].resource[3].referencePolicy[0] == "literal" assert inst.rest[0].resource[3].referencePolicy[1] == "logical" assert ( inst.rest[0].resource[3].searchInclude[0] == "AdministrableProductDefinition.manufactured-item" ) assert ( inst.rest[0].resource[3].searchInclude[1] == "AdministrableProductDefinition.device" ) assert ( inst.rest[0].resource[3].searchInclude[2] == "AdministrableProductDefinition.form-of" ) assert inst.rest[0].resource[3].searchParam[0].definition == ( "http://hl7.org/fhir/SearchParameter/AdministrableProductDefi" "nition-identifier" ) assert ( inst.rest[0].resource[3].searchParam[0].documentation == "An identifier for the administrable product" ) assert inst.rest[0].resource[3].searchParam[0].name == "identifier" assert inst.rest[0].resource[3].searchParam[0].type == "token" assert inst.rest[0].resource[3].searchParam[1].definition == ( "http://hl7.org/fhir/SearchParameter/AdministrableProductDefi" "nition-manufactured-item" ) assert inst.rest[0].resource[3].searchParam[1].name == "manufactured-item" assert inst.rest[0].resource[3].searchParam[1].type == "reference" assert inst.rest[0].resource[3].searchParam[2].definition == ( "http://hl7.org/fhir/SearchParameter/AdministrableProductDefi" "nition-ingredient" ) assert ( inst.rest[0].resource[3].searchParam[2].documentation == "The ingredients of this administrable medicinal product" ) assert inst.rest[0].resource[3].searchParam[2].name == "ingredient" assert inst.rest[0].resource[3].searchParam[2].type == "token" assert inst.rest[0].resource[3].searchParam[3].definition == ( "http://hl7.org/fhir/SearchParameter/AdministrableProductDefi" "nition-route" ) assert ( inst.rest[0].resource[3].searchParam[3].documentation == "Coded expression for the route" ) assert inst.rest[0].resource[3].searchParam[3].name == "route" assert inst.rest[0].resource[3].searchParam[3].type == "token" assert inst.rest[0].resource[3].searchParam[4].definition == ( "http://hl7.org/fhir/SearchParameter/AdministrableProductDefi" "nition-dose-form" ) assert inst.rest[0].resource[3].searchParam[4].documentation == ( "The administrable dose form, i.e. the dose form of the final" " product after necessary reconstitution or processing" ) assert inst.rest[0].resource[3].searchParam[4].name == "dose-form" assert inst.rest[0].resource[3].searchParam[4].type == "token" assert inst.rest[0].resource[3].searchParam[5].definition == ( "http://hl7.org/fhir/SearchParameter/AdministrableProductDefi" "nition-device" ) assert inst.rest[0].resource[3].searchParam[5].documentation == ( "A device that is integral to the medicinal product, in " 'effect being considered as an "ingredient" of the ' "medicinal product. This is not intended for devices that are" " just co-packaged" ) assert inst.rest[0].resource[3].searchParam[5].name == "device" assert inst.rest[0].resource[3].searchParam[5].type == "reference" assert inst.rest[0].resource[3].searchParam[6].definition == ( "http://hl7.org/fhir/SearchParameter/AdministrableProductDefi" "nition-form-of" ) assert inst.rest[0].resource[3].searchParam[6].documentation == ( "The medicinal product that this is an administrable form of." " This is not a reference to the item(s) that make up this " "administrable form - it is the whole product" ) assert inst.rest[0].resource[3].searchParam[6].name == "form-of" assert inst.rest[0].resource[3].searchParam[6].type == "reference" assert inst.rest[0].resource[3].searchParam[7].definition == ( "http://hl7.org/fhir/SearchParameter/AdministrableProductDefi" "nition-target-species" ) assert ( inst.rest[0].resource[3].searchParam[7].documentation == "Coded expression for the species" ) assert inst.rest[0].resource[3].searchParam[7].name == "target-species" assert inst.rest[0].resource[3].searchParam[7].type == "token" assert inst.rest[0].resource[3].searchParam[8].definition == ( "http://hl7.org/fhir/SearchParameter/AdministrableProductDefi" "nition-status" ) assert inst.rest[0].resource[3].searchParam[8].documentation == ( "The status of this administrable product. Enables tracking " "the life-cycle of the content." ) assert inst.rest[0].resource[3].searchParam[8].name == "status" assert inst.rest[0].resource[3].searchParam[8].type == "token" assert inst.rest[0].resource[3].searchRevInclude[0] == "Ingredient.for" assert inst.rest[0].resource[3].type == "AdministrableProductDefinition" assert inst.rest[0].resource[4].conditionalCreate is True assert inst.rest[0].resource[4].conditionalDelete == "multiple" assert inst.rest[0].resource[4].conditionalUpdate is True assert inst.rest[0].resource[4].interaction[0].code == "read" assert inst.rest[0].resource[4].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[4].interaction[1].code == "vread" assert inst.rest[0].resource[4].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[4].interaction[2].code == "update" assert inst.rest[0].resource[4].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[4].interaction[3].code == "delete" assert inst.rest[0].resource[4].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[4].interaction[4].code == "history-instance" assert inst.rest[0].resource[4].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[4].interaction[5].code == "history-type" assert inst.rest[0].resource[4].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[4].interaction[6].code == "create" assert inst.rest[0].resource[4].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[4].interaction[7].code == "search-type" assert inst.rest[0].resource[4].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[4].profile == "http://hl7.org/fhir/StructureDefinition/AdverseEvent" ) assert inst.rest[0].resource[4].referencePolicy[0] == "literal" assert inst.rest[0].resource[4].referencePolicy[1] == "logical" assert inst.rest[0].resource[4].searchInclude[0] == "AdverseEvent.recorder" assert inst.rest[0].resource[4].searchInclude[1] == "AdverseEvent.study" assert inst.rest[0].resource[4].searchInclude[2] == "AdverseEvent.subject" assert inst.rest[0].resource[4].searchInclude[3] == "AdverseEvent.substance" assert inst.rest[0].resource[4].searchInclude[4] == "AdverseEvent.patient" assert inst.rest[0].resource[4].searchInclude[5] == "AdverseEvent.resultingeffect" assert inst.rest[0].resource[4].searchInclude[6] == "AdverseEvent.location" assert ( inst.rest[0].resource[4].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/clinical-date" ) assert ( inst.rest[0].resource[4].searchParam[0].documentation == "When the event occurred" ) assert inst.rest[0].resource[4].searchParam[0].name == "date" assert inst.rest[0].resource[4].searchParam[0].type == "date" assert ( inst.rest[0].resource[4].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/clinical-identifier" ) assert ( inst.rest[0].resource[4].searchParam[1].documentation == "Business identifier for the event" ) assert inst.rest[0].resource[4].searchParam[1].name == "identifier" assert inst.rest[0].resource[4].searchParam[1].type == "token" assert ( inst.rest[0].resource[4].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/AdverseEvent-recorder" ) assert ( inst.rest[0].resource[4].searchParam[2].documentation == "Who recorded the adverse event" ) assert inst.rest[0].resource[4].searchParam[2].name == "recorder" assert inst.rest[0].resource[4].searchParam[2].type == "reference" assert ( inst.rest[0].resource[4].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/AdverseEvent-study" ) assert ( inst.rest[0].resource[4].searchParam[3].documentation == "Research study that the subject is enrolled in" ) assert inst.rest[0].resource[4].searchParam[3].name == "study" assert inst.rest[0].resource[4].searchParam[3].type == "reference" assert ( inst.rest[0].resource[4].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/clinical-code" ) assert ( inst.rest[0].resource[4].searchParam[4].documentation == "Event or incident that occurred or was averted" ) assert inst.rest[0].resource[4].searchParam[4].name == "code" assert inst.rest[0].resource[4].searchParam[4].type == "token" assert ( inst.rest[0].resource[4].searchParam[5].definition == "http://hl7.org/fhir/SearchParameter/AdverseEvent-actuality" ) assert inst.rest[0].resource[4].searchParam[5].documentation == "actual | potential" assert inst.rest[0].resource[4].searchParam[5].name == "actuality" assert inst.rest[0].resource[4].searchParam[5].type == "token" assert ( inst.rest[0].resource[4].searchParam[6].definition == "http://hl7.org/fhir/SearchParameter/AdverseEvent-subject" ) assert ( inst.rest[0].resource[4].searchParam[6].documentation == "Subject impacted by event" ) assert inst.rest[0].resource[4].searchParam[6].name == "subject" assert inst.rest[0].resource[4].searchParam[6].type == "reference" assert ( inst.rest[0].resource[4].searchParam[7].definition == "http://hl7.org/fhir/SearchParameter/AdverseEvent-substance" ) assert ( inst.rest[0].resource[4].searchParam[7].documentation == "Refers to the specific entity that caused the adverse event" ) assert inst.rest[0].resource[4].searchParam[7].name == "substance" assert inst.rest[0].resource[4].searchParam[7].type == "reference" assert ( inst.rest[0].resource[4].searchParam[8].definition == "http://hl7.org/fhir/SearchParameter/clinical-patient" ) assert ( inst.rest[0].resource[4].searchParam[8].documentation == "Subject impacted by event" ) assert inst.rest[0].resource[4].searchParam[8].name == "patient" assert inst.rest[0].resource[4].searchParam[8].type == "reference" assert inst.rest[0].resource[4].searchParam[9].definition == ( "http://hl7.org/fhir/SearchParameter/AdverseEvent-" "resultingeffect" ) assert ( inst.rest[0].resource[4].searchParam[9].documentation == "Effect on the subject due to this event" ) assert inst.rest[0].resource[4].searchParam[9].name == "resultingeffect" assert inst.rest[0].resource[4].searchParam[9].type == "reference" assert inst.rest[0].resource[4].type == "AdverseEvent" assert inst.rest[0].resource[5].conditionalCreate is True assert inst.rest[0].resource[5].conditionalDelete == "multiple" assert inst.rest[0].resource[5].conditionalUpdate is True assert inst.rest[0].resource[5].interaction[0].code == "read" assert inst.rest[0].resource[5].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[5].interaction[1].code == "vread" assert inst.rest[0].resource[5].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[5].interaction[2].code == "update" assert inst.rest[0].resource[5].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[5].interaction[3].code == "delete" assert inst.rest[0].resource[5].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[5].interaction[4].code == "history-instance" assert inst.rest[0].resource[5].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[5].interaction[5].code == "history-type" assert inst.rest[0].resource[5].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[5].interaction[6].code == "create" assert inst.rest[0].resource[5].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[5].interaction[7].code == "search-type" assert inst.rest[0].resource[5].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[5].profile == "http://hl7.org/fhir/StructureDefinition/AllergyIntolerance" ) assert inst.rest[0].resource[5].referencePolicy[0] == "literal" assert inst.rest[0].resource[5].referencePolicy[1] == "logical" assert ( inst.rest[0].resource[5].searchInclude[0] == "AllergyIntolerance.manifestation-reference" ) assert inst.rest[0].resource[5].searchInclude[1] == "AllergyIntolerance.participant" assert inst.rest[0].resource[5].searchInclude[2] == "AllergyIntolerance.patient" assert ( inst.rest[0].resource[5].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/clinical-date" ) assert ( inst.rest[0].resource[5].searchParam[0].documentation == "Date first version of the resource instance was recorded" ) assert inst.rest[0].resource[5].searchParam[0].name == "date" assert inst.rest[0].resource[5].searchParam[0].type == "date" assert inst.rest[0].resource[5].searchParam[1].definition == ( "http://hl7.org/fhir/SearchParameter/AllergyIntolerance-" "severity" ) assert ( inst.rest[0].resource[5].searchParam[1].documentation == "mild | moderate | severe (of event as a whole)" ) assert inst.rest[0].resource[5].searchParam[1].name == "severity" assert inst.rest[0].resource[5].searchParam[1].type == "token" assert ( inst.rest[0].resource[5].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/clinical-identifier" ) assert ( inst.rest[0].resource[5].searchParam[2].documentation == "External ids for this item" ) assert inst.rest[0].resource[5].searchParam[2].name == "identifier" assert inst.rest[0].resource[5].searchParam[2].type == "token" assert ( inst.rest[0].resource[5].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/clinical-code" ) assert ( inst.rest[0].resource[5].searchParam[3].documentation == "Code that identifies the allergy or intolerance" ) assert inst.rest[0].resource[5].searchParam[3].name == "code" assert inst.rest[0].resource[5].searchParam[3].type == "token" assert inst.rest[0].resource[5].searchParam[4].definition == ( "http://hl7.org/fhir/SearchParameter/AllergyIntolerance-" "verification-status" ) assert inst.rest[0].resource[5].searchParam[4].documentation == ( "unconfirmed | presumed | confirmed | refuted | entered-in-" "error" ) assert inst.rest[0].resource[5].searchParam[4].name == "verification-status" assert inst.rest[0].resource[5].searchParam[4].type == "token" assert inst.rest[0].resource[5].searchParam[5].definition == ( "http://hl7.org/fhir/SearchParameter/AllergyIntolerance-" "criticality" ) assert ( inst.rest[0].resource[5].searchParam[5].documentation == "low | high | unable-to-assess" ) assert inst.rest[0].resource[5].searchParam[5].name == "criticality" assert inst.rest[0].resource[5].searchParam[5].type == "token" assert inst.rest[0].resource[5].searchParam[6].definition == ( "http://hl7.org/fhir/SearchParameter/AllergyIntolerance-" "manifestation-reference" ) assert ( inst.rest[0].resource[5].searchParam[6].documentation == "Clinical symptoms/signs associated with the Event" ) assert inst.rest[0].resource[5].searchParam[6].name == "manifestation-reference" assert inst.rest[0].resource[5].searchParam[6].type == "reference" assert inst.rest[0].resource[5].searchParam[7].definition == ( "http://hl7.org/fhir/SearchParameter/AllergyIntolerance-" "clinical-status" ) assert ( inst.rest[0].resource[5].searchParam[7].documentation == "active | inactive | resolved" ) assert inst.rest[0].resource[5].searchParam[7].name == "clinical-status" assert inst.rest[0].resource[5].searchParam[7].type == "token" assert ( inst.rest[0].resource[5].searchParam[8].definition == "http://hl7.org/fhir/SearchParameter/clinical-type" ) assert ( inst.rest[0].resource[5].searchParam[8].documentation == "allergy | intolerance - Underlying mechanism (if known)" ) assert inst.rest[0].resource[5].searchParam[8].name == "type" assert inst.rest[0].resource[5].searchParam[8].type == "token" assert inst.rest[0].resource[5].searchParam[9].definition == ( "http://hl7.org/fhir/SearchParameter/AllergyIntolerance-" "participant" ) assert inst.rest[0].resource[5].searchParam[9].documentation == ( "Who or what participated in the activities related to the " "allergy or intolerance" ) assert inst.rest[0].resource[5].searchParam[9].name == "participant" assert inst.rest[0].resource[5].searchParam[9].type == "reference" assert inst.rest[0].resource[5].searchRevInclude[0] == "ClinicalImpression.problem" assert inst.rest[0].resource[5].type == "AllergyIntolerance" assert inst.rest[0].resource[6].conditionalCreate is True assert inst.rest[0].resource[6].conditionalDelete == "multiple" assert inst.rest[0].resource[6].conditionalUpdate is True assert inst.rest[0].resource[6].interaction[0].code == "read" assert inst.rest[0].resource[6].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[6].interaction[1].code == "vread" assert inst.rest[0].resource[6].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[6].interaction[2].code == "update" assert inst.rest[0].resource[6].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[6].interaction[3].code == "delete" assert inst.rest[0].resource[6].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[6].interaction[4].code == "history-instance" assert inst.rest[0].resource[6].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[6].interaction[5].code == "history-type" assert inst.rest[0].resource[6].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[6].interaction[6].code == "create" assert inst.rest[0].resource[6].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[6].interaction[7].code == "search-type" assert inst.rest[0].resource[6].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[6].profile == "http://hl7.org/fhir/StructureDefinition/Appointment" ) assert inst.rest[0].resource[6].referencePolicy[0] == "literal" assert inst.rest[0].resource[6].referencePolicy[1] == "logical" assert inst.rest[0].resource[6].searchInclude[0] == "Appointment.practitioner" assert inst.rest[0].resource[6].searchInclude[1] == "Appointment.subject" assert inst.rest[0].resource[6].searchInclude[2] == "Appointment.slot" assert inst.rest[0].resource[6].searchInclude[3] == "Appointment.actor" assert inst.rest[0].resource[6].searchInclude[4] == "Appointment.based-on" assert inst.rest[0].resource[6].searchInclude[5] == "Appointment.patient" assert inst.rest[0].resource[6].searchInclude[6] == "Appointment.reason-reference" assert inst.rest[0].resource[6].searchInclude[7] == "Appointment.supporting-info" assert inst.rest[0].resource[6].searchInclude[8] == "Appointment.location" assert inst.rest[0].resource[6].searchInclude[9] == "Appointment.group" assert ( inst.rest[0].resource[6].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/clinical-date" ) assert ( inst.rest[0].resource[6].searchParam[0].documentation == "Appointment date/time." ) assert inst.rest[0].resource[6].searchParam[0].name == "date" assert inst.rest[0].resource[6].searchParam[0].type == "date" assert ( inst.rest[0].resource[6].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/clinical-identifier" ) assert ( inst.rest[0].resource[6].searchParam[1].documentation == "An Identifier of the Appointment" ) assert inst.rest[0].resource[6].searchParam[1].name == "identifier" assert inst.rest[0].resource[6].searchParam[1].type == "token" assert ( inst.rest[0].resource[6].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/Appointment-specialty" ) assert inst.rest[0].resource[6].searchParam[2].documentation == ( "The specialty of a practitioner that would be required to " "perform the service requested in this appointment" ) assert inst.rest[0].resource[6].searchParam[2].name == "specialty" assert inst.rest[0].resource[6].searchParam[2].type == "token" assert inst.rest[0].resource[6].searchParam[3].definition == ( "http://hl7.org/fhir/SearchParameter/Appointment-service-" "category" ) assert inst.rest[0].resource[6].searchParam[3].documentation == ( "A broad categorization of the service that is to be " "performed during this appointment" ) assert inst.rest[0].resource[6].searchParam[3].name == "service-category" assert inst.rest[0].resource[6].searchParam[3].type == "token" assert ( inst.rest[0].resource[6].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/Appointment-practitioner" ) assert inst.rest[0].resource[6].searchParam[4].documentation == ( "One of the individuals of the appointment is this " "practitioner" ) assert inst.rest[0].resource[6].searchParam[4].name == "practitioner" assert inst.rest[0].resource[6].searchParam[4].type == "reference" assert inst.rest[0].resource[6].searchParam[5].definition == ( "http://hl7.org/fhir/SearchParameter/Appointment-appointment-" "type" ) assert inst.rest[0].resource[6].searchParam[5].documentation == ( "The style of appointment or patient that has been booked in " "the slot (not service type)" ) assert inst.rest[0].resource[6].searchParam[5].name == "appointment-type" assert inst.rest[0].resource[6].searchParam[5].type == "token" assert ( inst.rest[0].resource[6].searchParam[6].definition == "http://hl7.org/fhir/SearchParameter/Appointment-part-status" ) assert inst.rest[0].resource[6].searchParam[6].documentation == ( "The Participation status of the subject, or other " "participant on the appointment. Can be used to locate " "participants that have not responded to meeting requests." ) assert inst.rest[0].resource[6].searchParam[6].name == "part-status" assert inst.rest[0].resource[6].searchParam[6].type == "token" assert ( inst.rest[0].resource[6].searchParam[7].definition == "http://hl7.org/fhir/SearchParameter/Appointment-subject" ) assert ( inst.rest[0].resource[6].searchParam[7].documentation == "One of the individuals of the appointment is this patient" ) assert inst.rest[0].resource[6].searchParam[7].name == "subject" assert inst.rest[0].resource[6].searchParam[7].type == "reference" assert ( inst.rest[0].resource[6].searchParam[8].definition == "http://hl7.org/fhir/SearchParameter/Appointment-service-type" ) assert inst.rest[0].resource[6].searchParam[8].documentation == ( "The specific service (by coding) that is to be performed " "during this appointment" ) assert inst.rest[0].resource[6].searchParam[8].name == "service-type" assert inst.rest[0].resource[6].searchParam[8].type == "token" assert ( inst.rest[0].resource[6].searchParam[9].definition == "http://hl7.org/fhir/SearchParameter/Appointment-slot" ) assert ( inst.rest[0].resource[6].searchParam[9].documentation == "The slots that this appointment is filling" ) assert inst.rest[0].resource[6].searchParam[9].name == "slot" assert inst.rest[0].resource[6].searchParam[9].type == "reference" assert ( inst.rest[0].resource[6].searchRevInclude[0] == "AppointmentResponse.appointment" ) assert inst.rest[0].resource[6].searchRevInclude[1] == "CarePlan.activity-reference" assert inst.rest[0].resource[6].searchRevInclude[2] == "DocumentReference.based-on" assert inst.rest[0].resource[6].searchRevInclude[3] == "DocumentReference.context" assert inst.rest[0].resource[6].searchRevInclude[4] == "Encounter.appointment" assert inst.rest[0].resource[6].searchRevInclude[5] == "ImagingSelection.based-on" assert inst.rest[0].resource[6].searchRevInclude[6] == "ImagingStudy.based-on" assert inst.rest[0].resource[6].type == "Appointment" assert inst.rest[0].resource[7].conditionalCreate is True assert inst.rest[0].resource[7].conditionalDelete == "multiple" assert inst.rest[0].resource[7].conditionalUpdate is True assert inst.rest[0].resource[7].interaction[0].code == "read" assert inst.rest[0].resource[7].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[7].interaction[1].code == "vread" assert inst.rest[0].resource[7].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[7].interaction[2].code == "update" assert inst.rest[0].resource[7].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[7].interaction[3].code == "delete" assert inst.rest[0].resource[7].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[7].interaction[4].code == "history-instance" assert inst.rest[0].resource[7].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[7].interaction[5].code == "history-type" assert inst.rest[0].resource[7].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[7].interaction[6].code == "create" assert inst.rest[0].resource[7].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[7].interaction[7].code == "search-type" assert inst.rest[0].resource[7].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[7].profile == "http://hl7.org/fhir/StructureDefinition/AppointmentResponse" ) assert inst.rest[0].resource[7].referencePolicy[0] == "literal" assert inst.rest[0].resource[7].referencePolicy[1] == "logical" assert inst.rest[0].resource[7].searchInclude[0] == "AppointmentResponse.actor" assert ( inst.rest[0].resource[7].searchInclude[1] == "AppointmentResponse.practitioner" ) assert inst.rest[0].resource[7].searchInclude[2] == "AppointmentResponse.patient" assert ( inst.rest[0].resource[7].searchInclude[3] == "AppointmentResponse.appointment" ) assert inst.rest[0].resource[7].searchInclude[4] == "AppointmentResponse.location" assert inst.rest[0].resource[7].searchInclude[5] == "AppointmentResponse.group" assert inst.rest[0].resource[7].searchParam[0].definition == ( "http://hl7.org/fhir/SearchParameter/AppointmentResponse-" "actor" ) assert inst.rest[0].resource[7].searchParam[0].documentation == ( "The Person, Location/HealthcareService or Device that this " "appointment response replies for" ) assert inst.rest[0].resource[7].searchParam[0].name == "actor" assert inst.rest[0].resource[7].searchParam[0].type == "reference" assert ( inst.rest[0].resource[7].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/clinical-identifier" ) assert ( inst.rest[0].resource[7].searchParam[1].documentation == "An Identifier in this appointment response" ) assert inst.rest[0].resource[7].searchParam[1].name == "identifier" assert inst.rest[0].resource[7].searchParam[1].type == "token" assert inst.rest[0].resource[7].searchParam[2].definition == ( "http://hl7.org/fhir/SearchParameter/AppointmentResponse-" "practitioner" ) assert ( inst.rest[0].resource[7].searchParam[2].documentation == "This Response is for this Practitioner" ) assert inst.rest[0].resource[7].searchParam[2].name == "practitioner" assert inst.rest[0].resource[7].searchParam[2].type == "reference" assert inst.rest[0].resource[7].searchParam[3].definition == ( "http://hl7.org/fhir/SearchParameter/AppointmentResponse-" "part-status" ) assert ( inst.rest[0].resource[7].searchParam[3].documentation == "The participants acceptance status for this appointment" ) assert inst.rest[0].resource[7].searchParam[3].name == "part-status" assert inst.rest[0].resource[7].searchParam[3].type == "token" assert ( inst.rest[0].resource[7].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/clinical-patient" ) assert ( inst.rest[0].resource[7].searchParam[4].documentation == "This Response is for this Patient" ) assert inst.rest[0].resource[7].searchParam[4].name == "patient" assert inst.rest[0].resource[7].searchParam[4].type == "reference" assert inst.rest[0].resource[7].searchParam[5].definition == ( "http://hl7.org/fhir/SearchParameter/AppointmentResponse-" "appointment" ) assert ( inst.rest[0].resource[7].searchParam[5].documentation == "The appointment that the response is attached to" ) assert inst.rest[0].resource[7].searchParam[5].name == "appointment" assert inst.rest[0].resource[7].searchParam[5].type == "reference" assert inst.rest[0].resource[7].searchParam[6].definition == ( "http://hl7.org/fhir/SearchParameter/AppointmentResponse-" "location" ) assert ( inst.rest[0].resource[7].searchParam[6].documentation == "This Response is for this Location" ) assert inst.rest[0].resource[7].searchParam[6].name == "location" assert inst.rest[0].resource[7].searchParam[6].type == "reference" assert inst.rest[0].resource[7].searchParam[7].definition == ( "http://hl7.org/fhir/SearchParameter/AppointmentResponse-" "group" ) assert ( inst.rest[0].resource[7].searchParam[7].documentation == "This Response is for this Group" ) assert inst.rest[0].resource[7].searchParam[7].name == "group" assert inst.rest[0].resource[7].searchParam[7].type == "reference" assert inst.rest[0].resource[7].searchRevInclude[0] == "DocumentReference.based-on" assert inst.rest[0].resource[7].searchRevInclude[1] == "ImagingSelection.based-on" assert inst.rest[0].resource[7].searchRevInclude[2] == "ImagingStudy.based-on" assert inst.rest[0].resource[7].type == "AppointmentResponse" assert inst.rest[0].resource[8].conditionalCreate is True assert inst.rest[0].resource[8].conditionalDelete == "multiple" assert inst.rest[0].resource[8].conditionalUpdate is True assert inst.rest[0].resource[8].interaction[0].code == "read" assert inst.rest[0].resource[8].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[8].interaction[1].code == "vread" assert inst.rest[0].resource[8].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[8].interaction[2].code == "update" assert inst.rest[0].resource[8].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[8].interaction[3].code == "delete" assert inst.rest[0].resource[8].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[8].interaction[4].code == "history-instance" assert inst.rest[0].resource[8].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[8].interaction[5].code == "history-type" assert inst.rest[0].resource[8].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[8].interaction[6].code == "create" assert inst.rest[0].resource[8].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[8].interaction[7].code == "search-type" assert inst.rest[0].resource[8].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[8].profile == "http://hl7.org/fhir/StructureDefinition/ArtifactAssessment" ) assert inst.rest[0].resource[8].referencePolicy[0] == "literal" assert inst.rest[0].resource[8].referencePolicy[1] == "logical" assert ( inst.rest[0].resource[8].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/ArtifactAssessment-date" ) assert ( inst.rest[0].resource[8].searchParam[0].documentation == "The artifact assessment publication date" ) assert inst.rest[0].resource[8].searchParam[0].name == "date" assert inst.rest[0].resource[8].searchParam[0].type == "date" assert inst.rest[0].resource[8].searchParam[1].definition == ( "http://hl7.org/fhir/SearchParameter/ArtifactAssessment-" "identifier" ) assert ( inst.rest[0].resource[8].searchParam[1].documentation == "The artifact assessment identifier" ) assert inst.rest[0].resource[8].searchParam[1].name == "identifier" assert inst.rest[0].resource[8].searchParam[1].type == "token" assert inst.rest[0].resource[8].type == "ArtifactAssessment" assert inst.rest[0].resource[9].conditionalCreate is True assert inst.rest[0].resource[9].conditionalDelete == "multiple" assert inst.rest[0].resource[9].conditionalUpdate is True assert inst.rest[0].resource[9].interaction[0].code == "read" assert inst.rest[0].resource[9].interaction[0].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[9].interaction[1].code == "vread" assert inst.rest[0].resource[9].interaction[1].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[9].interaction[2].code == "update" assert inst.rest[0].resource[9].interaction[2].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[9].interaction[3].code == "delete" assert inst.rest[0].resource[9].interaction[3].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[9].interaction[4].code == "history-instance" assert inst.rest[0].resource[9].interaction[4].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[9].interaction[5].code == "history-type" assert inst.rest[0].resource[9].interaction[5].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[9].interaction[6].code == "create" assert inst.rest[0].resource[9].interaction[6].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert inst.rest[0].resource[9].interaction[7].code == "search-type" assert inst.rest[0].resource[9].interaction[7].documentation == ( "Implemented per the specification (or Insert other doco " "here)" ) assert ( inst.rest[0].resource[9].profile == "http://hl7.org/fhir/StructureDefinition/AuditEvent" ) assert inst.rest[0].resource[9].referencePolicy[0] == "literal" assert inst.rest[0].resource[9].referencePolicy[1] == "logical" assert inst.rest[0].resource[9].searchInclude[0] == "AuditEvent.agent" assert inst.rest[0].resource[9].searchInclude[1] == "AuditEvent.encounter" assert inst.rest[0].resource[9].searchInclude[2] == "AuditEvent.source" assert inst.rest[0].resource[9].searchInclude[3] == "AuditEvent.based-on" assert inst.rest[0].resource[9].searchInclude[4] == "AuditEvent.patient" assert inst.rest[0].resource[9].searchInclude[5] == "AuditEvent.entity" assert ( inst.rest[0].resource[9].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/clinical-date" ) assert ( inst.rest[0].resource[9].searchParam[0].documentation == "Time when the event was recorded" ) assert inst.rest[0].resource[9].searchParam[0].name == "date" assert inst.rest[0].resource[9].searchParam[0].type == "date" assert ( inst.rest[0].resource[9].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/AuditEvent-agent" ) assert inst.rest[0].resource[9].searchParam[1].documentation == "Identifier of who" assert inst.rest[0].resource[9].searchParam[1].name == "agent" assert inst.rest[0].resource[9].searchParam[1].type == "reference" assert ( inst.rest[0].resource[9].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/AuditEvent-entity-role" ) assert ( inst.rest[0].resource[9].searchParam[2].documentation == "What role the entity played" ) assert inst.rest[0].resource[9].searchParam[2].name == "entity-role" assert inst.rest[0].resource[9].searchParam[2].type == "token" assert ( inst.rest[0].resource[9].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/clinical-code" ) assert ( inst.rest[0].resource[9].searchParam[3].documentation == "More specific code for the event" ) assert inst.rest[0].resource[9].searchParam[3].name == "code" assert inst.rest[0].resource[9].searchParam[3].type == "token" assert ( inst.rest[0].resource[9].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/AuditEvent-purpose" ) assert ( inst.rest[0].resource[9].searchParam[4].documentation == "The authorization (purposeOfUse) of the event" ) assert inst.rest[0].resource[9].searchParam[4].name == "purpose" assert inst.rest[0].resource[9].searchParam[4].type == "token" assert ( inst.rest[0].resource[9].searchParam[5].definition == "http://hl7.org/fhir/SearchParameter/clinical-encounter" ) assert ( inst.rest[0].resource[9].searchParam[5].documentation == "Encounter related to the activity recorded in the AuditEvent" ) assert inst.rest[0].resource[9].searchParam[5].name == "encounter" assert inst.rest[0].resource[9].searchParam[5].type == "reference" assert ( inst.rest[0].resource[9].searchParam[6].definition == "http://hl7.org/fhir/SearchParameter/AuditEvent-source" ) assert ( inst.rest[0].resource[9].searchParam[6].documentation == "The identity of source detecting the event" ) assert inst.rest[0].resource[9].searchParam[6].name == "source" assert inst.rest[0].resource[9].searchParam[6].type == "reference" assert ( inst.rest[0].resource[9].searchParam[7].definition == "http://hl7.org/fhir/SearchParameter/AuditEvent-based-on" ) assert ( inst.rest[0].resource[9].searchParam[7].documentation == "Reference to the service request." ) assert inst.rest[0].resource[9].searchParam[7].name == "based-on" assert inst.rest[0].resource[9].searchParam[7].type == "reference" assert ( inst.rest[0].resource[9].searchParam[8].definition == "http://hl7.org/fhir/SearchParameter/clinical-patient" ) assert ( inst.rest[0].resource[9].searchParam[8].documentation == "Where the activity involved patient data" ) assert inst.rest[0].resource[9].searchParam[8].name == "patient" assert inst.rest[0].resource[9].searchParam[8].type == "reference" assert ( inst.rest[0].resource[9].searchParam[9].definition == "http://hl7.org/fhir/SearchParameter/AuditEvent-action" ) assert ( inst.rest[0].resource[9].searchParam[9].documentation == "Type of action performed during the event" ) assert inst.rest[0].resource[9].searchParam[9].name == "action" assert inst.rest[0].resource[9].searchParam[9].type == "token" assert inst.rest[0].resource[9].type == "AuditEvent" assert ( inst.rest[0].searchParam[0].definition == "http://hl7.org/fhir/SearchParameter/DomainResource-text" ) assert ( inst.rest[0].searchParam[0].documentation == "Search on the narrative of the resource" ) assert inst.rest[0].searchParam[0].name == "_text" assert inst.rest[0].searchParam[0].type == "special" assert ( inst.rest[0].searchParam[1].definition == "http://hl7.org/fhir/SearchParameter/id" ) assert inst.rest[0].searchParam[1].documentation == "some doco" assert inst.rest[0].searchParam[1].name == "_id" assert inst.rest[0].searchParam[1].type == "string" assert ( inst.rest[0].searchParam[2].definition == "http://hl7.org/fhir/SearchParameter/Resource-list" ) assert inst.rest[0].searchParam[2].documentation == ( "Retrieval of resources that are referenced by a List " "resource" ) assert inst.rest[0].searchParam[2].name == "_list" assert inst.rest[0].searchParam[2].type == "token" assert ( inst.rest[0].searchParam[3].definition == "http://hl7.org/fhir/SearchParameter/Resource-has" ) assert ( inst.rest[0].searchParam[3].documentation == "Provides support for reverse chaining" ) assert inst.rest[0].searchParam[3].name == "_has" assert inst.rest[0].searchParam[3].type == "composite" assert ( inst.rest[0].searchParam[4].definition == "http://hl7.org/fhir/SearchParameter/Resource-type" ) assert ( inst.rest[0].searchParam[4].documentation == "Type of resource (when doing cross-resource search" ) assert inst.rest[0].searchParam[4].name == "_type" assert inst.rest[0].searchParam[4].type == "token" assert ( inst.rest[0].searchParam[5].definition == "http://hl7.org/fhir/SearchParameter/Resource-source" ) assert ( inst.rest[0].searchParam[5].documentation == "How to sort the resources when returning" ) assert inst.rest[0].searchParam[5].name == "_sort" assert inst.rest[0].searchParam[5].type == "token" assert ( inst.rest[0].searchParam[6].definition == "http://hl7.org/fhir/SearchParameter/Resource-count" ) assert inst.rest[0].searchParam[6].documentation == "How many resources to return" assert inst.rest[0].searchParam[6].name == "_count" assert inst.rest[0].searchParam[6].type == "number" assert ( inst.rest[0].searchParam[7].definition == "http://hl7.org/fhir/SearchParameter/Resource-include" ) assert ( inst.rest[0].searchParam[7].documentation == "Control over returning additional resources (see spec)" ) assert inst.rest[0].searchParam[7].name == "_include" assert inst.rest[0].searchParam[7].type == "token" assert ( inst.rest[0].searchParam[8].definition == "http://hl7.org/fhir/SearchParameter/Resource-revinclude" ) assert ( inst.rest[0].searchParam[8].documentation == "Control over returning additional resources (see spec)" ) assert inst.rest[0].searchParam[8].name == "_revinclude" assert inst.rest[0].searchParam[8].type == "token" assert ( inst.rest[0].searchParam[9].definition == "http://hl7.org/fhir/SearchParameter/Resource-summary" ) assert ( inst.rest[0].searchParam[9].documentation == "What kind of information to return" ) assert inst.rest[0].searchParam[9].name == "_summary" assert inst.rest[0].searchParam[9].type == "token" assert inst.rest[0].security.cors is True assert inst.rest[0].security.description == ( "This is the Capability Statement to declare that the server " "supports SMART-on-FHIR. See the SMART-on-FHIR docs for the " "extension that would go with such a server" ) assert inst.rest[0].security.service[0].coding[0].code == "SMART-on-FHIR" assert inst.rest[0].security.service[0].coding[0].display == "SMART-on-FHIR" assert ( inst.rest[0].security.service[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/restful-security-service" } ).valueUri ) assert inst.rest[0].security.service[0].text == "See http://docs.smarthealthit.org/" assert inst.software.name == "Insert your software name here..." assert inst.status == "draft" assert inst.text.status == "extensions" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CapabilityStatement/base"} ).valueUri ) assert inst.version == "5.0.0" def test_capabilitystatement_8(base_settings): """No. 8 tests collection for CapabilityStatement. Test File: capabilitystatement-base.json """ filename = base_settings["unittest_data_dir"] / "capabilitystatement-base.json" inst = capabilitystatement.CapabilityStatement.model_validate_json( filename.read_bytes() ) assert "CapabilityStatement" == inst.get_resource_type() impl_capabilitystatement_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CapabilityStatement" == data["resourceType"] inst2 = capabilitystatement.CapabilityStatement(**data) impl_capabilitystatement_8(inst2) ================================================ FILE: fhir/resources/tests/test_careplan.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/CarePlan Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import careplan from .conftest import ExternalValidatorModel def impl_careplan_1(inst): assert inst.activity[0].plannedActivityReference.reference == "#activity" assert inst.addresses[0].reference.display == "?????" assert inst.addresses[0].reference.reference == "Condition/f201" assert inst.careTeam[0].reference == "#careteam" assert inst.contained[0].id == "careteam" assert inst.contained[1].id == "goal" assert inst.contained[2].id == "activity" assert inst.goal[0].reference == "#goal" assert inst.id == "f002" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/zorgportal/identifiers/careplans"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "CP2934" assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-07-07"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2011-07-06"} ).valueDateTime ) assert inst.status == "completed" assert inst.subject.display == "P. van de Heuvel" assert inst.subject.reference == "Patient/f001" assert inst.text.status == "generated" def test_careplan_1(base_settings): """No. 1 tests collection for CarePlan. Test File: careplan-example-f002-lung.json """ filename = base_settings["unittest_data_dir"] / "careplan-example-f002-lung.json" inst = careplan.CarePlan.model_validate_json(filename.read_bytes()) assert "CarePlan" == inst.get_resource_type() impl_careplan_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CarePlan" == data["resourceType"] inst2 = careplan.CarePlan(**data) impl_careplan_1(inst2) def impl_careplan_2(inst): assert ( inst.activity[0].performedActivity[0].reference.display == "Roel's Chemotherapy" ) assert inst.activity[0].performedActivity[0].reference.reference == "Procedure/f201" assert ( inst.activity[0].plannedActivityReference.reference == "RequestOrchestration/example" ) assert inst.addresses[0].reference.display == "Roel's head-neck tumor" assert inst.addresses[0].reference.reference == "Condition/f202" assert inst.careTeam[0].reference == "#careteam" assert inst.contained[0].id == "careteam" assert inst.contained[1].id == "goal" assert inst.goal[0].reference == "#goal" assert inst.id == "f202" assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "active" assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" def test_careplan_2(base_settings): """No. 2 tests collection for CarePlan. Test File: careplan-example-f202-malignancy.json """ filename = ( base_settings["unittest_data_dir"] / "careplan-example-f202-malignancy.json" ) inst = careplan.CarePlan.model_validate_json(filename.read_bytes()) assert "CarePlan" == inst.get_resource_type() impl_careplan_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CarePlan" == data["resourceType"] inst2 = careplan.CarePlan(**data) impl_careplan_2(inst2) def impl_careplan_3(inst): assert inst.id == "obesity-narrative" assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "active" assert inst.subject.display == "Peter James Chalmers" assert inst.subject.reference == "Patient/example" assert inst.text.status == "additional" def test_careplan_3(base_settings): """No. 3 tests collection for CarePlan. Test File: careplan-example-obesity-narrative.json """ filename = ( base_settings["unittest_data_dir"] / "careplan-example-obesity-narrative.json" ) inst = careplan.CarePlan.model_validate_json(filename.read_bytes()) assert "CarePlan" == inst.get_resource_type() impl_careplan_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CarePlan" == data["resourceType"] inst2 = careplan.CarePlan(**data) impl_careplan_3(inst2) def impl_careplan_4(inst): assert inst.activity[0].performedActivity[0].concept.coding[0].code == "6397004" assert ( inst.activity[0].performedActivity[0].concept.coding[0].display == "Muscular strength development exercise" ) assert ( inst.activity[0].performedActivity[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.activity[0].plannedActivityReference.reference == "ServiceRequest/benchpress" ) assert inst.addresses[0].reference.display == "obesity" assert inst.addresses[0].reference.reference == "#p1" assert inst.basedOn[0].display == "Management of Type 2 Diabetes" assert inst.careTeam[0].reference == "CareTeam/example" assert inst.category[0].text == "Weight management plan" assert inst.contained[0].id == "p1" assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-01"} ).valueDateTime ) assert inst.custodian.display == "Dr Adam Careful" assert inst.custodian.reference == "Practitioner/example" assert inst.description == "Manage obesity and weight loss" assert inst.encounter.reference == "Encounter/home" assert inst.goal[0].reference == "Goal/example" assert inst.id == "example" assert inst.identifier[0].value == "12345" assert ( inst.instantiatesUri[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/protocol-for-obesity"} ).valueUri ) assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.partOf[0].display == "Overall wellness plan" assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-06-01"} ).valueDateTime ) assert inst.replaces[0].display == "Plan from urgent care clinic" assert inst.status == "active" assert inst.subject.display == "Peter James Chalmers" assert inst.subject.reference == "Patient/example" assert inst.text.status == "additional" def test_careplan_4(base_settings): """No. 4 tests collection for CarePlan. Test File: careplan-example.json """ filename = base_settings["unittest_data_dir"] / "careplan-example.json" inst = careplan.CarePlan.model_validate_json(filename.read_bytes()) assert "CarePlan" == inst.get_resource_type() impl_careplan_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CarePlan" == data["resourceType"] inst2 = careplan.CarePlan(**data) impl_careplan_4(inst2) def impl_careplan_5(inst): assert ( inst.activity[0].plannedActivityReference.reference == "NutritionOrder/renaldiet" ) assert inst.activity[1].plannedActivityReference.reference == "#activity" assert inst.addresses[0].reference.display == "Roel's renal insufficiency" assert inst.addresses[0].reference.reference == "Condition/f204" assert inst.careTeam[0].reference == "#careteam" assert inst.contained[0].id == "careteam" assert inst.contained[1].id == "goal" assert inst.contained[2].id == "activity" assert inst.goal[0].reference == "#goal" assert inst.id == "f201" assert inst.intent == "proposal" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-13"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-11"} ).valueDateTime ) assert inst.status == "draft" assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" def test_careplan_5(base_settings): """No. 5 tests collection for CarePlan. Test File: careplan-example-f201-renal.json """ filename = base_settings["unittest_data_dir"] / "careplan-example-f201-renal.json" inst = careplan.CarePlan.model_validate_json(filename.read_bytes()) assert "CarePlan" == inst.get_resource_type() impl_careplan_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CarePlan" == data["resourceType"] inst2 = careplan.CarePlan(**data) impl_careplan_5(inst2) def impl_careplan_6(inst): assert ( inst.activity[0].performedActivity[0].reference.reference == "Encounter/example" ) assert inst.activity[0].plannedActivityReference.reference == "#activity-1" assert inst.activity[1].plannedActivityReference.reference == "#activity-2" assert inst.addresses[0].reference.display == "obesity" assert inst.addresses[0].reference.reference == "#p1" assert inst.careTeam[0].reference == "#careteam" assert inst.contained[0].id == "p1" assert inst.contained[1].id == "careteam" assert inst.contained[2].id == "goal" assert inst.contained[3].id == "activity-1" assert inst.contained[4].id == "activity-2" assert inst.goal[0].reference == "#goal" assert inst.id == "gpvisit" assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-01T10:30:00+00:00"} ).valueDateTime ) assert inst.status == "active" assert inst.subject.display == "Peter James Chalmers" assert inst.subject.reference == "Patient/100" assert inst.text.status == "additional" def test_careplan_6(base_settings): """No. 6 tests collection for CarePlan. Test File: careplan-example-GPVisit.json """ filename = base_settings["unittest_data_dir"] / "careplan-example-GPVisit.json" inst = careplan.CarePlan.model_validate_json(filename.read_bytes()) assert "CarePlan" == inst.get_resource_type() impl_careplan_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CarePlan" == data["resourceType"] inst2 = careplan.CarePlan(**data) impl_careplan_6(inst2) def impl_careplan_7(inst): assert ( inst.activity[0].plannedActivityReference.reference == "ServiceRequest/activity-1" ) assert ( inst.activity[0].progress[0].text == "Eve eats one meal a day with her parents" ) assert ( inst.activity[0].progress[0].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-09-10"} ).valueDateTime ) assert ( inst.activity[1].plannedActivityReference.reference == "ServiceRequest/activity-2" ) assert ( inst.activity[2].plannedActivityReference.reference == "NutritionOrder/activity-3" ) assert ( inst.activity[3].plannedActivityReference.reference == "ServiceRequest/activity-4" ) assert ( inst.activity[3].progress[0].text == "Eve would like to try for 5 days a week." ) assert ( inst.activity[3].progress[0].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-08-27"} ).valueDateTime ) assert inst.activity[3].progress[1].text == "Eve is still walking the dogs." assert ( inst.activity[3].progress[1].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-09-10"} ).valueDateTime ) assert ( inst.activity[4].plannedActivityReference.reference == "ServiceRequest/activity-5" ) assert inst.activity[4].progress[0].text == "Eve walked 4 times the last week." assert ( inst.activity[4].progress[0].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-08-13"} ).valueDateTime ) assert inst.activity[4].progress[1].text == ( "Eve did not walk to her parents the last week, but has plans" " to start again" ) assert ( inst.activity[4].progress[1].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-09-10"} ).valueDateTime ) assert ( inst.activity[5].plannedActivityReference.reference == "ServiceRequest/activity-6" ) assert ( inst.activity[6].plannedActivityReference.reference == "ServiceRequest/activity-7" ) assert inst.activity[6].progress[0].text == ( "After restarting the vinegar soaks the psoriasis is improved" " and Eve plans to treat the remainder with light treatments." " She plans to start this week." ) assert ( inst.activity[6].progress[0].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-08-13"} ).valueDateTime ) assert inst.activity[6].progress[1].text == ( "Since her skin is improved Eve has not been using the light " "treatment as often, maybe once a week. She would like to " "increase to 3 times a week again" ) assert ( inst.activity[6].progress[1].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-08-27"} ).valueDateTime ) assert ( inst.activity[7].plannedActivityReference.reference == "ServiceRequest/activity-8" ) assert inst.activity[7].progress[0].text == ( "Eve created a chart as a reminer to take the medications " "that do not fit in her pill box" ) assert ( inst.activity[7].progress[0].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-07-23"} ).valueDateTime ) assert ( inst.activity[8].plannedActivityReference.reference == "ServiceRequest/activity-9" ) assert inst.activity[8].progress[0].text == "Will be able to esume exercise." assert ( inst.activity[8].progress[0].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-07-30"} ).valueDateTime ) assert ( inst.activity[8].progress[1].text == "Eve prefers to focus on walking at this time" ) assert ( inst.activity[8].progress[1].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-08-13"} ).valueDateTime ) assert ( inst.activity[9].plannedActivityReference.reference == "ServiceRequest/activity-10" ) assert inst.addresses[0].reference.display == "GERDS" assert inst.addresses[0].reference.reference == "#p1" assert inst.addresses[1].reference.display == "Obesity" assert inst.addresses[1].reference.reference == "#p2" assert inst.addresses[2].reference.display == "Psoriasis" assert inst.addresses[2].reference.reference == "#p3" assert inst.contained[0].id == "p1" assert inst.contained[1].id == "p2" assert inst.contained[2].id == "p3" assert inst.contained[3].id == "g1" assert inst.contained[4].id == "g2" assert inst.contained[5].id == "g3" assert inst.contained[6].id == "g4" assert inst.contained[7].id == "g5" assert inst.goal[0].reference == "#g1" assert inst.goal[1].reference == "#g2" assert inst.goal[2].reference == "#g3" assert inst.goal[3].reference == "#g4" assert inst.goal[4].reference == "#g5" assert inst.id == "integrate" assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == ( "Patient family is not ready to commit to goal setting at " "this time. Goal setting will be addressed in the future" ) assert inst.status == "active" assert inst.subject.display == "Eve Everywoman" assert inst.subject.reference == "Patient/1" assert inst.text.status == "generated" def test_careplan_7(base_settings): """No. 7 tests collection for CarePlan. Test File: careplan-example-integrated.json """ filename = base_settings["unittest_data_dir"] / "careplan-example-integrated.json" inst = careplan.CarePlan.model_validate_json(filename.read_bytes()) assert "CarePlan" == inst.get_resource_type() impl_careplan_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CarePlan" == data["resourceType"] inst2 = careplan.CarePlan(**data) impl_careplan_7(inst2) def impl_careplan_8(inst): assert inst.activity[0].plannedActivityReference.reference == "#activity" assert inst.addresses[0].reference.display == "?????" assert inst.addresses[0].reference.reference == "Condition/f201" assert inst.careTeam[0].reference == "#careteam" assert inst.contained[0].id == "careteam" assert inst.contained[1].id == "goal" assert inst.contained[2].id == "activity" assert inst.goal[0].reference == "#goal" assert inst.id == "f003" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/zorgportal/identifiers/careplans"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "CP3953" assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-08T09:30:10+01:00"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-08T09:00:10+01:00"} ).valueDateTime ) assert inst.status == "completed" assert inst.subject.display == "P. van de Heuvel" assert inst.subject.reference == "Patient/f001" assert inst.text.status == "generated" def test_careplan_8(base_settings): """No. 8 tests collection for CarePlan. Test File: careplan-example-f003-pharynx.json """ filename = base_settings["unittest_data_dir"] / "careplan-example-f003-pharynx.json" inst = careplan.CarePlan.model_validate_json(filename.read_bytes()) assert "CarePlan" == inst.get_resource_type() impl_careplan_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CarePlan" == data["resourceType"] inst2 = careplan.CarePlan(**data) impl_careplan_8(inst2) def impl_careplan_9(inst): assert inst.activity[0].plannedActivityReference.reference == "#activity" assert inst.addresses[0].reference.display == "?????" assert inst.addresses[0].reference.reference == "Condition/f201" assert inst.careTeam[0].reference == "#careteam" assert inst.contained[0].id == "careteam" assert inst.contained[1].id == "goal" assert inst.contained[2].id == "activity" assert inst.goal[0].reference == "#goal" assert inst.id == "f001" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/zorgportal/identifiers/careplans"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "CP2903" assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2011-06-27"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2011-06-26"} ).valueDateTime ) assert inst.status == "completed" assert inst.subject.display == "P. van de Heuvel" assert inst.subject.reference == "Patient/f001" assert inst.text.status == "generated" def test_careplan_9(base_settings): """No. 9 tests collection for CarePlan. Test File: careplan-example-f001-heart.json """ filename = base_settings["unittest_data_dir"] / "careplan-example-f001-heart.json" inst = careplan.CarePlan.model_validate_json(filename.read_bytes()) assert "CarePlan" == inst.get_resource_type() impl_careplan_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CarePlan" == data["resourceType"] inst2 = careplan.CarePlan(**data) impl_careplan_9(inst2) def impl_careplan_10(inst): assert ( inst.activity[0].plannedActivityReference.display == "Prenatal vitamin MedicationRequest" ) assert ( inst.activity[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/fhir/StructureDefinition/careplan#andetails" } ).valueUri ) assert ( inst.activity[1].extension[0].valueUri == ExternalValidatorModel.model_validate( {"valueUri": "http://orionhealth.com/fhir/careplan/1andetails"} ).valueUri ) assert inst.activity[1].plannedActivityReference.reference == "#activity-1" assert inst.activity[2].plannedActivityReference.reference == "#activity-2" assert inst.activity[3].plannedActivityReference.reference == "#activity-3" assert inst.addresses[0].reference.display == "pregnancy" assert inst.addresses[0].reference.reference == "#p1" assert inst.careTeam[0].reference == "#careteam" assert inst.contained[0].id == "p1" assert inst.contained[1].id == "pr1" assert inst.contained[2].id == "pr2" assert inst.contained[3].id == "careteam" assert inst.contained[4].id == "goal" assert inst.contained[5].id == "activity-1" assert inst.contained[6].id == "activity-2" assert inst.contained[7].id == "activity-3" assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/StructureDefinition/careplan#lmp"} ).valueUri ) assert ( inst.extension[0].valueDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-01"} ).valueDateTime ) assert inst.goal[0].reference == "#goal" assert inst.id == "preg" assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-10-01"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-01"} ).valueDateTime ) assert inst.status == "active" assert inst.subject.display == "Eve Everywoman" assert inst.subject.reference == "Patient/1" assert inst.text.status == "additional" def test_careplan_10(base_settings): """No. 10 tests collection for CarePlan. Test File: careplan-example-pregnancy.json """ filename = base_settings["unittest_data_dir"] / "careplan-example-pregnancy.json" inst = careplan.CarePlan.model_validate_json(filename.read_bytes()) assert "CarePlan" == inst.get_resource_type() impl_careplan_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CarePlan" == data["resourceType"] inst2 = careplan.CarePlan(**data) impl_careplan_10(inst2) ================================================ FILE: fhir/resources/tests/test_careteam.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/CareTeam Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import careteam from .conftest import ExternalValidatorModel def impl_careteam_1(inst): assert inst.category[0].coding[0].code == "LA27976-2" assert inst.category[0].coding[0].display == "Encounter-focused care team" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.contained[0].id == "pr1" assert inst.id == "example" assert inst.identifier[0].value == "12345" assert inst.managingOrganization[0].reference == "Organization/f001" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Peter James Charlmers Care Team for Inpatient Encounter" assert inst.participant[0].member.display == "Peter James Chalmers" assert inst.participant[0].member.reference == "Patient/example" assert inst.participant[0].role.text == "responsiblePerson" assert ( inst.participant[1].coverageTiming.repeat.boundsPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-01"} ).valueDateTime ) assert ( inst.participant[1].coverageTiming.repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2010-12-23"} ).valueDateTime ) assert inst.participant[1].coverageTiming.repeat.dayOfWeek[0] == "mon" assert inst.participant[1].coverageTiming.repeat.frequency == 1 assert float(inst.participant[1].coverageTiming.repeat.period) == float(1) assert inst.participant[1].coverageTiming.repeat.periodUnit == "d" assert inst.participant[1].coverageTiming.repeat.when[0] == "MORN" assert inst.participant[1].member.display == "Dorothy Dietition" assert inst.participant[1].member.reference == "#pr1" assert inst.participant[1].onBehalfOf.reference == "Organization/f001" assert inst.participant[1].role.text == "adviser" assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-01"} ).valueDateTime ) assert inst.status == "active" assert inst.subject.display == "Peter James Chalmers" assert inst.subject.reference == "Patient/example" assert inst.text.div == '
Care Team
' assert inst.text.status == "generated" def test_careteam_1(base_settings): """No. 1 tests collection for CareTeam. Test File: careteam-example.json """ filename = base_settings["unittest_data_dir"] / "careteam-example.json" inst = careteam.CareTeam.model_validate_json(filename.read_bytes()) assert "CareTeam" == inst.get_resource_type() impl_careteam_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CareTeam" == data["resourceType"] inst2 = careteam.CareTeam(**data) impl_careteam_1(inst2) ================================================ FILE: fhir/resources/tests/test_chargeitem.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ChargeItem Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import chargeitem from .conftest import ExternalValidatorModel def impl_chargeitem_1(inst): assert inst.account[0].reference == "Account/example" assert inst.code.coding[0].code == "01510" assert inst.code.coding[0].display == ( "Zusatzpauschale für Beobachtung nach diagnostischer " "Koronarangiografie" ) assert ( inst.definitionUri[0] == ExternalValidatorModel.model_validate( { "valueUri": "http://www.kbv.de/tools/ebm/html/01520_2904360860826220813632.html" } ).valueUri ) assert inst.encounter.reference == "Encounter/example" assert ( inst.enteredDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-25T23:55:04+01:00"} ).valueDateTime ) assert inst.enterer.reference == "Practitioner/example" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://myHospital.org/ChargeItems"} ).valueUri ) assert inst.identifier[0].value == "654321" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].authorReference.reference == "Practitioner/example" assert inst.note[0].text == "The code is only applicable for periods longer than 4h" assert ( inst.note[0].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-25T23:55:04+01:00"} ).valueDateTime ) assert ( inst.occurrencePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-25T12:35:00+01:00"} ).valueDateTime ) assert ( inst.occurrencePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-25T08:00:00+01:00"} ).valueDateTime ) assert inst.overrideReason.text == ( "Patient is Cardiologist's golf buddy, so he gets a 20% " "discount!" ) assert inst.performer[0].actor.reference == "Practitioner/example" assert inst.performer[0].function.coding[0].code == "17561000" assert inst.performer[0].function.coding[0].display == "Cardiologist" assert ( inst.performer[0].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.performer[1].actor.reference == "Practitioner/example" assert inst.performer[1].function.coding[0].code == "224542009" assert inst.performer[1].function.coding[0].display == "Coronary Care Nurse" assert ( inst.performer[1].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.performingOrganization.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://myhospital/NamingSystem/departments"} ).valueUri ) assert inst.performingOrganization.identifier.value == "CARD_INTERMEDIATE_CARE" assert float(inst.quantity.value) == float(1) assert inst.reason[0].coding[0].code == "I51.6" assert inst.reason[0].coding[0].display == "Cardiovascular disease, unspecified" assert ( inst.reason[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/icd-10"} ).valueUri ) assert ( inst.requestingOrganization.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://myhospital/NamingSystem/departments"} ).valueUri ) assert inst.requestingOrganization.identifier.value == "CARD_U1" assert inst.service[0].reference.reference == "Procedure/example" assert inst.status == "billable" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Example of ' "ChargeItem Usage in Context of the German EBM Billing code " "system
" ) assert inst.text.status == "generated" assert inst.totalPriceComponent.amount.currency == "EUR" assert float(inst.totalPriceComponent.amount.value) == float(40) assert float(inst.totalPriceComponent.factor) == float(0.8) assert inst.totalPriceComponent.type == "base" def test_chargeitem_1(base_settings): """No. 1 tests collection for ChargeItem. Test File: chargeitem-example.json """ filename = base_settings["unittest_data_dir"] / "chargeitem-example.json" inst = chargeitem.ChargeItem.model_validate_json(filename.read_bytes()) assert "ChargeItem" == inst.get_resource_type() impl_chargeitem_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ChargeItem" == data["resourceType"] inst2 = chargeitem.ChargeItem(**data) impl_chargeitem_1(inst2) ================================================ FILE: fhir/resources/tests/test_chargeitemdefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ChargeItemDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import chargeitemdefinition from .conftest import ExternalValidatorModel def impl_chargeitemdefinition_1(inst): assert ( inst.applicability[0].condition.description == "Verify ChargeItem pertains to Device 12345" ) assert ( inst.applicability[0].condition.expression == "%context.service.suppliedItem.reference='Device/12345'" ) assert inst.applicability[0].condition.language == "text/fhirpath" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-02"} ).valueDateTime ) assert inst.description == "Financial details for custom made device" assert inst.id == "device" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.29.2" assert inst.instance[0].reference == "Device/example" assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert inst.name == "CustomDevice345675" assert inst.propertyGroup[0].priceComponent[0].amount.currency == "EUR" assert float(inst.propertyGroup[0].priceComponent[0].amount.value) == float(67.44) assert inst.propertyGroup[0].priceComponent[0].code.coding[0].code == "VK" assert ( inst.propertyGroup[0].priceComponent[0].code.coding[0].display == "Verkaufspreis (netto)" ) assert ( inst.propertyGroup[0].priceComponent[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://fhir.de/CodeSystem/billing-attributes"} ).valueUri ) assert inst.propertyGroup[0].priceComponent[0].type == "base" assert ( inst.propertyGroup[1].applicability[0].condition.description == "Gültigkeit Steuersatz" ) assert ( inst.propertyGroup[1].applicability[0].condition.expression == "%context.occurenceDateTime > '2018-04-01'" ) assert inst.propertyGroup[1].applicability[0].condition.language == "text/fhirpath" assert inst.propertyGroup[1].priceComponent[0].code.coding[0].code == "MWST" assert ( inst.propertyGroup[1].priceComponent[0].code.coding[0].display == "Mehrwersteuersatz" ) assert ( inst.propertyGroup[1].priceComponent[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://fhir.de/CodeSystem/billing-attributes"} ).valueUri ) assert float(inst.propertyGroup[1].priceComponent[0].factor) == float(1.19) assert inst.propertyGroup[1].priceComponent[0].type == "tax" assert ( inst.propertyGroup[2].applicability[0].condition.description == "Gültigkeit Steuersatz" ) assert ( inst.propertyGroup[2].applicability[0].condition.expression == "%context.occurenceDateTime <= '2018-04-01'" ) assert inst.propertyGroup[2].applicability[0].condition.language == "text/fhirpath" assert inst.propertyGroup[2].priceComponent[0].code.coding[0].code == "MWST" assert ( inst.propertyGroup[2].priceComponent[0].code.coding[0].display == "Mehrwersteuersatz" ) assert ( inst.propertyGroup[2].priceComponent[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://fhir.de/CodeSystem/billing-attributes"} ).valueUri ) assert float(inst.propertyGroup[2].priceComponent[0].factor) == float(1.07) assert inst.propertyGroup[2].priceComponent[0].type == "tax" assert inst.publisher == "Example Publisher" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Financial details for custom made device (345675)" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://sap.org/ChargeItemDefinition/device-123"} ).valueUri ) assert inst.useContext[0].code.code == "venue" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "440655000" assert ( inst.useContext[0].valueCodeableConcept.coding[0].display == "Outpatient environment" ) assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[1].code.code == "age" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueQuantity.code == "a" assert inst.useContext[1].valueQuantity.comparator == ">" assert ( inst.useContext[1].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.useContext[1].valueQuantity.unit == "yrs" assert float(inst.useContext[1].valueQuantity.value) == float(18) def test_chargeitemdefinition_1(base_settings): """No. 1 tests collection for ChargeItemDefinition. Test File: chargeitemdefinition-device-example.json """ filename = ( base_settings["unittest_data_dir"] / "chargeitemdefinition-device-example.json" ) inst = chargeitemdefinition.ChargeItemDefinition.model_validate_json( filename.read_bytes() ) assert "ChargeItemDefinition" == inst.get_resource_type() impl_chargeitemdefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ChargeItemDefinition" == data["resourceType"] inst2 = chargeitemdefinition.ChargeItemDefinition(**data) impl_chargeitemdefinition_1(inst2) def impl_chargeitemdefinition_2(inst): assert ( inst.applicability[0].condition.description == "Excludes billing code 13250 for same Encounter" ) assert inst.applicability[0].condition.expression == "[some CQL expression]" assert inst.applicability[0].condition.language == "text/cql" assert ( inst.applicability[0].effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-06-30"} ).valueDateTime ) assert ( inst.applicability[0].effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-04-01"} ).valueDateTime ) assert ( inst.applicability[1].condition.description == "Applies only once per Encounter" ) assert inst.applicability[1].condition.expression == "[some CQL expression]" assert inst.applicability[1].condition.language == "text/CQL" assert ( inst.applicability[1].effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-06-30"} ).valueDateTime ) assert ( inst.applicability[1].effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-04-01"} ).valueDateTime ) assert inst.code.coding[0].code == "30110" assert inst.code.coding[0].display == "Allergologiediagnostik I" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://fhir.de/CodingSystem/kbv/ebm"} ).valueUri ) assert inst.description == ( "Allergologisch-diagnostischer Komplex zur Diagnostik " "und/oder zum Ausschluss einer (Kontakt-)Allergie vom Spättyp" " (Typ IV), einschl. Kosten" ) assert inst.id == "ebm" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.29.1" assert inst.propertyGroup[0].priceComponent[0].amount.currency == "EUR" assert float(inst.propertyGroup[0].priceComponent[0].amount.value) == float(67.44) assert inst.propertyGroup[0].priceComponent[0].code.coding[0].code == "gesamt-euro" assert ( inst.propertyGroup[0].priceComponent[0].code.coding[0].display == "Gesamt (Euro)" ) assert ( inst.propertyGroup[0].priceComponent[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://fhir.de/CodeSystem/kbv/ebm-attribute"} ).valueUri ) assert inst.propertyGroup[0].priceComponent[0].type == "base" assert ( inst.propertyGroup[0].priceComponent[1].code.coding[0].code == "gesamt-punkte" ) assert ( inst.propertyGroup[0].priceComponent[1].code.coding[0].display == "Gesamt (Punkte)" ) assert ( inst.propertyGroup[0].priceComponent[1].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://fhir.de/CodeSystem/kbv/ebm-attribute"} ).valueUri ) assert float(inst.propertyGroup[0].priceComponent[1].factor) == float(633) assert inst.propertyGroup[0].priceComponent[1].type == "informational" assert inst.status == "active" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://fhir.de/ChargeItemDefinition/kbv/ebm-30110"} ).valueUri ) assert inst.version == "2-2018" def test_chargeitemdefinition_2(base_settings): """No. 2 tests collection for ChargeItemDefinition. Test File: chargeitemdefinition-ebm-example.json """ filename = ( base_settings["unittest_data_dir"] / "chargeitemdefinition-ebm-example.json" ) inst = chargeitemdefinition.ChargeItemDefinition.model_validate_json( filename.read_bytes() ) assert "ChargeItemDefinition" == inst.get_resource_type() impl_chargeitemdefinition_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ChargeItemDefinition" == data["resourceType"] inst2 = chargeitemdefinition.ChargeItemDefinition(**data) impl_chargeitemdefinition_2(inst2) ================================================ FILE: fhir/resources/tests/test_citation.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Citation Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import citation from .conftest import ExternalValidatorModel def impl_citation_1(inst): assert inst.citedArtifact.abstract[0].language.coding[0].code == "en" assert inst.citedArtifact.abstract[0].language.coding[0].display == "English" assert ( inst.citedArtifact.abstract[0].language.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:47"} ).valueUri ) assert inst.citedArtifact.abstract[0].type.coding[0].code == "primary-human-use" assert inst.citedArtifact.abstract[0].type.coding[0].display == "Primary human use" assert ( inst.citedArtifact.abstract[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/cited-artifact-abstract-type"} ).valueUri ) assert ( inst.citedArtifact.classification[0].classifier[0].coding[0].code == "knowledge-artifact-type" ) assert ( inst.citedArtifact.classification[0].classifier[0].coding[0].display == "Knowledge Artifact Type" ) assert ( inst.citedArtifact.classification[0].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/cited-artifact-classification-type"} ).valueUri ) assert ( inst.citedArtifact.classification[0].classifier[1].coding[0].code == "D064886" ) assert ( inst.citedArtifact.classification[0].classifier[1].coding[0].display == "Dataset" ) assert ( inst.citedArtifact.classification[0].classifier[1].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/citation-artifact-classifier"} ).valueUri ) assert ( inst.citedArtifact.classification[0].classifier[1].coding[0].version == "5.0.0" ) assert ( inst.citedArtifact.classification[1].classifier[0].coding[0].code == "EFO_0004327" ) assert ( inst.citedArtifact.classification[1].classifier[0].coding[0].display == "electrocardiography" ) assert ( inst.citedArtifact.classification[1].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.ebi.ac.uk/efo"} ).valueUri ) assert inst.citedArtifact.classification[1].classifier[0].text == "ecg" assert inst.citedArtifact.classification[1].type.text == "topic" assert ( inst.citedArtifact.classification[2].classifier[0].coding[0].code == "FMA_63919" ) assert ( inst.citedArtifact.classification[2].classifier[0].coding[0].display == "foetus" ) assert ( inst.citedArtifact.classification[2].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://purl.obolibrary.org/obo"} ).valueUri ) assert inst.citedArtifact.classification[2].classifier[0].text == "foetus" assert inst.citedArtifact.classification[2].type.text == "topic" assert inst.citedArtifact.classification[3].classifier[0].text == "pwd" assert inst.citedArtifact.classification[3].type.text == "topic" assert inst.citedArtifact.classification[4].classifier[0].text == "doppler" assert inst.citedArtifact.classification[4].type.text == "topic" assert inst.citedArtifact.classification[5].classifier[0].text == "foetal ecg" assert inst.citedArtifact.classification[5].type.text == "topic" assert inst.citedArtifact.classification[6].classifier[0].text == "maternal ecg" assert inst.citedArtifact.classification[6].type.text == "topic" assert inst.citedArtifact.classification[7].classifier[0].text == "pwd envelope" assert inst.citedArtifact.classification[7].type.text == "topic" assert inst.citedArtifact.classification[8].classifier[0].text == "non-invasive" assert inst.citedArtifact.classification[8].type.text == "topic" assert ( inst.citedArtifact.classification[9].classifier[0].coding[0].code == "394579002" ) assert ( inst.citedArtifact.classification[9].classifier[0].coding[0].display == "Cardiology (qualifier value)" ) assert ( inst.citedArtifact.classification[9].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.citedArtifact.classification[9].classifier[0].text == "cardiology" assert inst.citedArtifact.classification[9].type.text == "topic" assert ( inst.citedArtifact.contributorship.summary[0].source.text == "copied-from-article" ) assert ( inst.citedArtifact.contributorship.summary[0].type.coding[0].code == "author-string" ) assert ( inst.citedArtifact.contributorship.summary[0].type.coding[0].display == "Author string" ) assert ( inst.citedArtifact.contributorship.summary[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/contributor-summary-type"} ).valueUri ) assert ( inst.citedArtifact.contributorship.summary[0].type.coding[0].version == "5.0.0" ) assert inst.citedArtifact.contributorship.summary[0].value == ( "Danilo Pani, Eleonora Sulas, Monica Urru, Reza Sameni, Luigi" " Raffo, Roberto Tumbarello" ) assert ( inst.citedArtifact.contributorship.summary[1].source.text == "copied-from-article" ) assert inst.citedArtifact.contributorship.summary[1].type.text == "acknowledgements" assert ( inst.citedArtifact.dateAccessed == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-03-17"} ).valueDateTime ) assert ( inst.citedArtifact.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://doi.org"} ).valueUri ) assert inst.citedArtifact.identifier[0].value == "10.13026/c4n5-3b04" assert ( inst.citedArtifact.publicationForm[0].articleDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2020-11-12"} ).valueDateTime ) assert inst.citedArtifact.publicationForm[0].copyright == ( "https://physionet.org/content/ninfea/view-license/1.0.0/ and" " https://physionet.org/content/ninfea/1.0.0/LICENSE.txt" ) assert inst.citedArtifact.publicationForm[0].language[0].coding[0].code == "en" assert ( inst.citedArtifact.publicationForm[0].language[0].coding[0].display == "English" ) assert ( inst.citedArtifact.publicationForm[0].language[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:47"} ).valueUri ) assert ( inst.citedArtifact.publicationForm[0].language[0].coding[0].version == "4.0.1" ) assert ( inst.citedArtifact.publicationForm[0].publishedIn.publisher.display == "MIT Laboratory for Computational Physiology" ) assert inst.citedArtifact.publicationForm[0].publishedIn.title == "PhysioNet" assert ( inst.citedArtifact.publicationForm[0].publishedIn.type.coding[0].code == "D019991" ) assert ( inst.citedArtifact.publicationForm[0].publishedIn.type.coding[0].display == "Database" ) assert ( inst.citedArtifact.publicationForm[0].publishedIn.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/published-in-type"} ).valueUri ) assert ( inst.citedArtifact.publicationForm[0].publishedIn.type.coding[0].version == "5.0.0" ) assert ( inst.citedArtifact.relatedIdentifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://doi.org"} ).valueUri ) assert inst.citedArtifact.relatedIdentifier[0].value == "10.1038/s41597-021-00811-3" assert inst.citedArtifact.relatesTo[0].classifier[0].text == "original publication" assert ( inst.citedArtifact.relatesTo[0].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "https://doi.org/10.1038/s41597-021-00811-3"} ).valueUrl ) assert inst.citedArtifact.relatesTo[0].type == "derived-from" assert inst.citedArtifact.relatesTo[1].classifier[0].text == "ontology" assert inst.citedArtifact.relatesTo[1].display == "Experimental Factor Ontology" assert ( inst.citedArtifact.relatesTo[1].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://data.bioontology.org/ontologies/EFO"} ).valueUrl ) assert inst.citedArtifact.relatesTo[1].type == "depends-on" assert inst.citedArtifact.title[0].language.coding[0].code == "en" assert inst.citedArtifact.title[0].language.coding[0].display == "English" assert ( inst.citedArtifact.title[0].language.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:47"} ).valueUri ) assert inst.citedArtifact.title[0].language.coding[0].version == "4.0.1" assert inst.citedArtifact.title[0].text == ( "NInFEA: Non-Invasive Multimodal Foetal ECG-Doppler Dataset " "for Antenatal Cardiology Research" ) assert inst.citedArtifact.title[0].type[0].text == "primary-human-use" assert inst.citedArtifact.version.value == "1.0.0" assert inst.citedArtifact.webLocation[0].classifier[0].coding[0].code == "webpage" assert ( inst.citedArtifact.webLocation[0].classifier[0].coding[0].display == "Webpage" ) assert ( inst.citedArtifact.webLocation[0].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/artifact-url-classifier"} ).valueUri ) assert inst.citedArtifact.webLocation[0].classifier[0].coding[0].version == "5.0.0" assert ( inst.citedArtifact.webLocation[0].url == ExternalValidatorModel.model_validate( {"valueUri": "https://physionet.org/content/ninfea/1.0.0/"} ).valueUri ) assert inst.citedArtifact.webLocation[1].classifier[0].coding[0].code == "doi-based" assert ( inst.citedArtifact.webLocation[1].classifier[0].coding[0].display == "DOI Based" ) assert ( inst.citedArtifact.webLocation[1].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/artifact-url-classifier"} ).valueUri ) assert inst.citedArtifact.webLocation[1].classifier[0].coding[0].version == "5.0.0" assert ( inst.citedArtifact.webLocation[1].url == ExternalValidatorModel.model_validate( {"valueUri": "https://doi.org/10.13026/c4n5-3b04"} ).valueUri ) assert inst.citedArtifact.webLocation[2].classifier[0].coding[0].code == "doi-based" assert ( inst.citedArtifact.webLocation[2].classifier[0].coding[0].display == "DOI Based" ) assert ( inst.citedArtifact.webLocation[2].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/artifact-url-classifier"} ).valueUri ) assert inst.citedArtifact.webLocation[2].classifier[0].coding[0].version == "5.0.0" assert ( inst.citedArtifact.webLocation[2].classifier[0].text == "original publication" ) assert ( inst.citedArtifact.webLocation[2].url == ExternalValidatorModel.model_validate( {"valueUri": "https://doi.org/10.1038/s41597-021-00811-3"} ).valueUri ) assert ( inst.citedArtifact.webLocation[3].classifier[0].coding[0].code == "compressed-file" ) assert ( inst.citedArtifact.webLocation[3].classifier[0].coding[0].display == "Compressed file" ) assert ( inst.citedArtifact.webLocation[3].classifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/artifact-url-classifier"} ).valueUri ) assert inst.citedArtifact.webLocation[3].classifier[0].coding[0].version == "5.0.0" assert ( inst.citedArtifact.webLocation[3].url == ExternalValidatorModel.model_validate( { "valueUri": "https://physionet.org/static/published-projects/ninfea/ninfea-non-invasive-multimodal-foetal-ecg-doppler-dataset-for-antenatal-cardiology-research-1.0.0.zip" } ).valueUri ) assert inst.citedArtifact.webLocation[4].classifier[0].text == "DOI-for-metadata" assert ( inst.citedArtifact.webLocation[4].url == ExternalValidatorModel.model_validate( {"valueUri": "https://doi.org/10.6084/m9.figshare.13283492"} ).valueUri ) assert inst.contact[0].telecom[0].system == "email" assert inst.contact[0].telecom[0].value == "support@computablepublishing.com" assert inst.copyright == "https://creativecommons.org/licenses/by-nc-sa/4.0/" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-09-24T10:41:01.740Z"} ).valueDateTime ) assert inst.description == "A citation of a dataset" assert inst.id == "citation-example-research-doi" assert inst.identifier[0].assigner.display == "Computable Publishing LLC" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://fevir.net"} ).valueUri ) assert inst.identifier[0].type.text == "FEvIR Object Identifier" assert inst.identifier[0].value == "60" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "NInFEACitation" assert inst.publisher == "Computable Publishing LLC" assert inst.status == "active" assert inst.summary[0].style.text == "as reported on PhysioNet" assert inst.summary[1].style.coding[0].code == "comppub" assert inst.summary[1].style.coding[0].display == "Computable Publishing" assert ( inst.summary[1].style.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/ValueSet/citation-summary-style"} ).valueUri ) assert inst.text.status == "generated" assert inst.title == "NInFEA Citation" def test_citation_1(base_settings): """No. 1 tests collection for Citation. Test File: citation-example-research-doi.json """ filename = base_settings["unittest_data_dir"] / "citation-example-research-doi.json" inst = citation.Citation.model_validate_json(filename.read_bytes()) assert "Citation" == inst.get_resource_type() impl_citation_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Citation" == data["resourceType"] inst2 = citation.Citation(**data) impl_citation_1(inst2) ================================================ FILE: fhir/resources/tests/test_claim.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Claim Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import claim from .conftest import ExternalValidatorModel def impl_claim_1(inst): assert ( inst.accident.date == ExternalValidatorModel.model_validate({"valueDate": "2014-07-09"}).valueDate ) assert inst.accident.locationAddress.text == "Grouse Mountain Ski Hill" assert inst.accident.type.coding[0].code == "SPT" assert inst.accident.type.coding[0].display == "Sporting Accident" assert ( inst.accident.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActIncidentCode"} ).valueUri ) assert ( inst.billablePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert ( inst.billablePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-15"} ).valueDateTime ) assert inst.careTeam[0].provider.reference == "Practitioner/example" assert inst.careTeam[0].responsible is True assert inst.careTeam[0].role.coding[0].code == "primary" assert ( inst.careTeam[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/claim-careteamrole"} ).valueUri ) assert inst.careTeam[0].sequence == 1 assert inst.careTeam[0].specialty.coding[0].code == "physician" assert ( inst.careTeam[0].specialty.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/provider-qualification"} ).valueUri ) assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.diagnosisRelatedGroup.coding[0].code == "400" assert inst.diagnosisRelatedGroup.coding[0].display == "Head trauma - concussion" assert ( inst.diagnosisRelatedGroup.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/ex-diagnosisrelatedgroup" } ).valueUri ) assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == "654456" assert inst.diagnosis[0].sequence == 1 assert inst.diagnosis[0].type[0].coding[0].code == "admitting" assert ( inst.diagnosis[0].type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-diagnosistype"} ).valueUri ) assert ( inst.enterer.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://jurisdiction.org/facilities/HOSP1234/users"} ).valueUri ) assert inst.enterer.identifier.value == "UC1234" assert ( inst.facility.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://jurisdiction.org/facilities"} ).valueUri ) assert inst.facility.identifier.value == "HOSP1234" assert inst.id == "960151" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyhospital.com/claim"} ).valueUri ) assert inst.identifier[0].value == "96123451" assert inst.insurance[0].businessArrangement == "BA987123" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].focal is True assert inst.insurance[0].preAuthRef[0] == "PA2014G56473" assert inst.insurance[0].sequence == 1 assert inst.insurer.reference == "Organization/2" assert inst.item[0].careTeamSequence[0] == 1 assert inst.item[0].net.currency == "USD" assert float(inst.item[0].net.value) == float(125.0) assert inst.item[0].productOrService.coding[0].code == "exam" assert ( inst.item[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ex-serviceproduct"} ).valueUri ) assert inst.item[0].sequence == 1 assert ( inst.item[0].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert inst.item[0].unitPrice.currency == "USD" assert float(inst.item[0].unitPrice.value) == float(125.0) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/1" assert inst.payee.type.coding[0].code == "provider" assert inst.priority.coding[0].code == "normal" assert ( inst.provider.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://npid.org/providerid"} ).valueUri ) assert inst.provider.identifier.value == "NJ12345" assert inst.status == "active" assert inst.supportingInfo[0].category.coding[0].code == "employmentimpacted" assert ( inst.supportingInfo[0].category.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/claiminformationcategory" } ).valueUri ) assert inst.supportingInfo[0].sequence == 1 assert ( inst.supportingInfo[0].timingPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert ( inst.supportingInfo[0].timingPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.supportingInfo[1].category.coding[0].code == "hospitalized" assert ( inst.supportingInfo[1].category.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/claiminformationcategory" } ).valueUri ) assert inst.supportingInfo[1].sequence == 2 assert ( inst.supportingInfo[1].timingPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert ( inst.supportingInfo[1].timingPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-15"} ).valueDateTime ) assert inst.text.div == ( '
A human-readable' " rendering of the Claim
" ) assert inst.text.status == "generated" assert inst.total.currency == "USD" assert float(inst.total.value) == float(125.0) assert inst.type.coding[0].code == "institutional" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claim_1(base_settings): """No. 1 tests collection for Claim. Test File: claim-example-institutional-rich.json """ filename = ( base_settings["unittest_data_dir"] / "claim-example-institutional-rich.json" ) inst = claim.Claim.model_validate_json(filename.read_bytes()) assert "Claim" == inst.get_resource_type() impl_claim_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Claim" == data["resourceType"] inst2 = claim.Claim(**data) impl_claim_1(inst2) def impl_claim_2(inst): assert inst.careTeam[0].provider.reference == "Practitioner/example" assert inst.careTeam[0].sequence == 1 assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == "654456" assert inst.diagnosis[0].sequence == 1 assert inst.id == "860150" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happypdocs.com/claim"} ).valueUri ) assert inst.identifier[0].value == "8612345" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].focal is True assert inst.insurance[0].sequence == 1 assert inst.insurer.reference == "Organization/2" assert inst.item[0].careTeamSequence[0] == 1 assert inst.item[0].net.currency == "USD" assert float(inst.item[0].net.value) == float(75.0) assert inst.item[0].productOrService.coding[0].code == "exam" assert ( inst.item[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ex-serviceproduct"} ).valueUri ) assert inst.item[0].sequence == 1 assert ( inst.item[0].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert inst.item[0].unitPrice.currency == "USD" assert float(inst.item[0].unitPrice.value) == float(75.0) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/1" assert inst.payee.type.coding[0].code == "provider" assert inst.priority.coding[0].code == "normal" assert inst.provider.reference == "Organization/1" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the Claim
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "professional" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claim_2(base_settings): """No. 2 tests collection for Claim. Test File: claim-example-professional.json """ filename = base_settings["unittest_data_dir"] / "claim-example-professional.json" inst = claim.Claim.model_validate_json(filename.read_bytes()) assert "Claim" == inst.get_resource_type() impl_claim_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Claim" == data["resourceType"] inst2 = claim.Claim(**data) impl_claim_2(inst2) def impl_claim_3(inst): assert inst.careTeam[0].provider.reference == "Practitioner/example" assert inst.careTeam[0].sequence == 1 assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == "123456" assert inst.diagnosis[0].sequence == 1 assert inst.id == "100150" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/claim"} ).valueUri ) assert inst.identifier[0].value == "12345" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].focal is True assert ( inst.insurance[0].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/claim"} ).valueUri ) assert inst.insurance[0].identifier.value == "12345" assert inst.insurance[0].sequence == 1 assert inst.insurer.reference == "Organization/2" assert inst.item[0].careTeamSequence[0] == 1 assert inst.item[0].net.currency == "USD" assert float(inst.item[0].net.value) == float(135.57) assert inst.item[0].productOrService.coding[0].code == "1200" assert inst.item[0].sequence == 1 assert ( inst.item[0].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert inst.item[0].unitPrice.currency == "USD" assert float(inst.item[0].unitPrice.value) == float(135.57) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/1" assert inst.payee.type.coding[0].code == "provider" assert inst.priority.coding[0].code == "normal" assert inst.provider.reference == "Organization/1" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the Oral Health Claim
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "oral" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claim_3(base_settings): """No. 3 tests collection for Claim. Test File: claim-example.json """ filename = base_settings["unittest_data_dir"] / "claim-example.json" inst = claim.Claim.model_validate_json(filename.read_bytes()) assert "Claim" == inst.get_resource_type() impl_claim_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Claim" == data["resourceType"] inst2 = claim.Claim(**data) impl_claim_3(inst2) def impl_claim_4(inst): assert inst.careTeam[0].provider.reference == "Practitioner/example" assert inst.careTeam[0].sequence == 1 assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == "654321" assert inst.diagnosis[0].sequence == 1 assert inst.id == "660150" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happysight.com/claim"} ).valueUri ) assert inst.identifier[0].value == "6612345" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].focal is True assert inst.insurance[0].sequence == 1 assert inst.insurer.reference == "Organization/2" assert inst.item[0].careTeamSequence[0] == 1 assert inst.item[0].net.currency == "USD" assert float(inst.item[0].net.value) == float(80.0) assert inst.item[0].productOrService.coding[0].code == "exam" assert ( inst.item[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/ex-visionservice"} ).valueUri ) assert inst.item[0].sequence == 1 assert ( inst.item[0].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert inst.item[0].unitPrice.currency == "USD" assert float(inst.item[0].unitPrice.value) == float(80.0) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/1" assert inst.payee.type.coding[0].code == "provider" assert inst.priority.coding[0].code == "normal" assert inst.provider.reference == "Organization/1" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the Vision Claim
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "vision" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claim_4(base_settings): """No. 4 tests collection for Claim. Test File: claim-example-vision.json """ filename = base_settings["unittest_data_dir"] / "claim-example-vision.json" inst = claim.Claim.model_validate_json(filename.read_bytes()) assert "Claim" == inst.get_resource_type() impl_claim_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Claim" == data["resourceType"] inst2 = claim.Claim(**data) impl_claim_4(inst2) def impl_claim_5(inst): assert inst.careTeam[0].provider.reference == "Practitioner/example" assert inst.careTeam[0].sequence == 1 assert inst.contained[0].id == "device-frame" assert inst.contained[1].id == "device-lens" assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == "654321" assert inst.diagnosis[0].sequence == 1 assert inst.id == "660152" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happysight.com/claim"} ).valueUri ) assert inst.identifier[0].value == "6612347" assert inst.insurance[0].claimResponse.reference == "ClaimResponse/R3500" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].focal is False assert inst.insurance[0].preAuthRef[0] == "PR7652387237" assert inst.insurance[0].sequence == 1 assert inst.insurance[1].coverage.reference == "Coverage/9876B1" assert inst.insurance[1].focal is True assert inst.insurance[1].preAuthRef[0] == "AB543GTD7567" assert inst.insurance[1].sequence == 2 assert inst.insurer.reference == "Organization/2" assert inst.item[0].careTeamSequence[0] == 1 assert inst.item[0].category.coding[0].code == "F6" assert inst.item[0].category.coding[0].display == "Vision Coverage" assert ( inst.item[0].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/benefit-subcategory"} ).valueUri ) assert inst.item[0].detail[0].category.coding[0].code == "F6" assert inst.item[0].detail[0].category.coding[0].display == "Vision Coverage" assert ( inst.item[0].detail[0].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/benefit-subcategory"} ).valueUri ) assert float(inst.item[0].detail[0].factor) == float(1.1) assert inst.item[0].detail[0].modifier[0].coding[0].code == "rooh" assert ( inst.item[0].detail[0].modifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/modifiers"} ).valueUri ) assert inst.item[0].detail[0].net.currency == "USD" assert float(inst.item[0].detail[0].net.value) == float(110.0) assert inst.item[0].detail[0].productOrService.coding[0].code == "frame" assert ( inst.item[0].detail[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/ex-visionservice"} ).valueUri ) assert inst.item[0].detail[0].revenue.coding[0].code == "0010" assert inst.item[0].detail[0].revenue.coding[0].display == "Vision Clinic" assert ( inst.item[0].detail[0].revenue.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-revenue-center"} ).valueUri ) assert inst.item[0].detail[0].sequence == 1 assert inst.item[0].detail[0].udi[0].reference == "#device-frame" assert inst.item[0].detail[0].unitPrice.currency == "USD" assert float(inst.item[0].detail[0].unitPrice.value) == float(100.0) assert inst.item[0].detail[1].category.coding[0].code == "F6" assert inst.item[0].detail[1].category.coding[0].display == "Vision Coverage" assert ( inst.item[0].detail[1].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/benefit-subcategory"} ).valueUri ) assert inst.item[0].detail[1].net.currency == "USD" assert float(inst.item[0].detail[1].net.value) == float(110.0) assert inst.item[0].detail[1].productOrService.coding[0].code == "lens" assert ( inst.item[0].detail[1].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/ex-visionservice"} ).valueUri ) assert inst.item[0].detail[1].programCode[0].coding[0].code == "none" assert ( inst.item[0].detail[1].programCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-programcode"} ).valueUri ) assert float(inst.item[0].detail[1].quantity.value) == float(2) assert inst.item[0].detail[1].revenue.coding[0].code == "0010" assert inst.item[0].detail[1].revenue.coding[0].display == "Vision Clinic" assert ( inst.item[0].detail[1].revenue.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-revenue-center"} ).valueUri ) assert inst.item[0].detail[1].sequence == 2 assert inst.item[0].detail[1].subDetail[0].category.coding[0].code == "F6" assert ( inst.item[0].detail[1].subDetail[0].category.coding[0].display == "Vision Coverage" ) assert ( inst.item[0].detail[1].subDetail[0].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/benefit-subcategory"} ).valueUri ) assert float(inst.item[0].detail[1].subDetail[0].factor) == float(1.1) assert inst.item[0].detail[1].subDetail[0].modifier[0].coding[0].code == "rooh" assert ( inst.item[0].detail[1].subDetail[0].modifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/modifiers"} ).valueUri ) assert inst.item[0].detail[1].subDetail[0].net.currency == "USD" assert float(inst.item[0].detail[1].subDetail[0].net.value) == float(66.0) assert inst.item[0].detail[1].subDetail[0].productOrService.coding[0].code == "lens" assert ( inst.item[0].detail[1].subDetail[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/ex-visionservice"} ).valueUri ) assert inst.item[0].detail[1].subDetail[0].programCode[0].coding[0].code == "none" assert ( inst.item[0].detail[1].subDetail[0].programCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-programcode"} ).valueUri ) assert float(inst.item[0].detail[1].subDetail[0].quantity.value) == float(2) assert inst.item[0].detail[1].subDetail[0].revenue.coding[0].code == "0010" assert ( inst.item[0].detail[1].subDetail[0].revenue.coding[0].display == "Vision Clinic" ) assert ( inst.item[0].detail[1].subDetail[0].revenue.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-revenue-center"} ).valueUri ) assert inst.item[0].detail[1].subDetail[0].sequence == 1 assert inst.item[0].detail[1].subDetail[0].udi[0].reference == "#device-lens" assert inst.item[0].detail[1].subDetail[0].unitPrice.currency == "USD" assert float(inst.item[0].detail[1].subDetail[0].unitPrice.value) == float(30.0) assert inst.item[0].detail[1].subDetail[1].category.coding[0].code == "F6" assert ( inst.item[0].detail[1].subDetail[1].category.coding[0].display == "Vision Coverage" ) assert ( inst.item[0].detail[1].subDetail[1].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/benefit-subcategory"} ).valueUri ) assert float(inst.item[0].detail[1].subDetail[1].factor) == float(1.1) assert inst.item[0].detail[1].subDetail[1].modifier[0].coding[0].code == "rooh" assert ( inst.item[0].detail[1].subDetail[1].modifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/modifiers"} ).valueUri ) assert inst.item[0].detail[1].subDetail[1].net.currency == "USD" assert float(inst.item[0].detail[1].subDetail[1].net.value) == float(33.0) assert ( inst.item[0].detail[1].subDetail[1].productOrService.coding[0].code == "hardening" ) assert ( inst.item[0].detail[1].subDetail[1].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/ex-visionservice"} ).valueUri ) assert float(inst.item[0].detail[1].subDetail[1].quantity.value) == float(2) assert inst.item[0].detail[1].subDetail[1].revenue.coding[0].code == "0010" assert ( inst.item[0].detail[1].subDetail[1].revenue.coding[0].display == "Vision Clinic" ) assert ( inst.item[0].detail[1].subDetail[1].revenue.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-revenue-center"} ).valueUri ) assert inst.item[0].detail[1].subDetail[1].sequence == 2 assert inst.item[0].detail[1].subDetail[1].unitPrice.currency == "USD" assert float(inst.item[0].detail[1].subDetail[1].unitPrice.value) == float(15.0) assert inst.item[0].detail[1].subDetail[2].category.coding[0].code == "F6" assert ( inst.item[0].detail[1].subDetail[2].category.coding[0].display == "Vision Coverage" ) assert ( inst.item[0].detail[1].subDetail[2].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/benefit-subcategory"} ).valueUri ) assert float(inst.item[0].detail[1].subDetail[2].factor) == float(1.1) assert inst.item[0].detail[1].subDetail[2].modifier[0].coding[0].code == "rooh" assert ( inst.item[0].detail[1].subDetail[2].modifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/modifiers"} ).valueUri ) assert inst.item[0].detail[1].subDetail[2].net.currency == "USD" assert float(inst.item[0].detail[1].subDetail[2].net.value) == float(11.0) assert ( inst.item[0].detail[1].subDetail[2].productOrService.coding[0].code == "UV coating" ) assert ( inst.item[0].detail[1].subDetail[2].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/ex-visionservice"} ).valueUri ) assert float(inst.item[0].detail[1].subDetail[2].quantity.value) == float(2) assert inst.item[0].detail[1].subDetail[2].revenue.coding[0].code == "0010" assert ( inst.item[0].detail[1].subDetail[2].revenue.coding[0].display == "Vision Clinic" ) assert ( inst.item[0].detail[1].subDetail[2].revenue.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-revenue-center"} ).valueUri ) assert inst.item[0].detail[1].subDetail[2].sequence == 3 assert inst.item[0].detail[1].subDetail[2].unitPrice.currency == "USD" assert float(inst.item[0].detail[1].subDetail[2].unitPrice.value) == float(5.0) assert inst.item[0].detail[1].unitPrice.currency == "USD" assert float(inst.item[0].detail[1].unitPrice.value) == float(55.0) assert inst.item[0].detail[2].category.coding[0].code == "F6" assert inst.item[0].detail[2].category.coding[0].display == "Vision Coverage" assert ( inst.item[0].detail[2].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/benefit-subcategory"} ).valueUri ) assert float(inst.item[0].detail[2].factor) == float(0.07) assert inst.item[0].detail[2].net.currency == "USD" assert float(inst.item[0].detail[2].net.value) == float(15.4) assert inst.item[0].detail[2].productOrService.coding[0].code == "fst" assert ( inst.item[0].detail[2].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/ex-visionservice"} ).valueUri ) assert inst.item[0].detail[2].revenue.coding[0].code == "0010" assert inst.item[0].detail[2].revenue.coding[0].display == "Vision Clinic" assert ( inst.item[0].detail[2].revenue.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-revenue-center"} ).valueUri ) assert inst.item[0].detail[2].sequence == 3 assert inst.item[0].detail[2].unitPrice.currency == "USD" assert float(inst.item[0].detail[2].unitPrice.value) == float(220.0) assert inst.item[0].modifier[0].coding[0].code == "rooh" assert ( inst.item[0].modifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/modifiers"} ).valueUri ) assert inst.item[0].net.currency == "USD" assert float(inst.item[0].net.value) == float(235.4) assert inst.item[0].productOrService.coding[0].code == "glasses" assert ( inst.item[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/ex-visionservice"} ).valueUri ) assert inst.item[0].programCode[0].coding[0].code == "none" assert ( inst.item[0].programCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-programcode"} ).valueUri ) assert inst.item[0].revenue.coding[0].code == "0010" assert inst.item[0].revenue.coding[0].display == "Vision Clinic" assert ( inst.item[0].revenue.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-revenue-center"} ).valueUri ) assert inst.item[0].sequence == 1 assert ( inst.item[0].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert inst.item[0].unitPrice.currency == "USD" assert float(inst.item[0].unitPrice.value) == float(235.4) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/1" assert inst.payee.type.coding[0].code == "provider" assert inst.prescription.reference == "http://www.optdocs.com/prescription/12345" assert inst.priority.coding[0].code == "normal" assert inst.provider.reference == "Organization/1" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the Vision Claim for Glasses
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "vision" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claim_5(base_settings): """No. 5 tests collection for Claim. Test File: claim-example-vision-glasses-3tier.json """ filename = ( base_settings["unittest_data_dir"] / "claim-example-vision-glasses-3tier.json" ) inst = claim.Claim.model_validate_json(filename.read_bytes()) assert "Claim" == inst.get_resource_type() impl_claim_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Claim" == data["resourceType"] inst2 = claim.Claim(**data) impl_claim_5(inst2) def impl_claim_6(inst): assert inst.careTeam[0].provider.reference == "Practitioner/example" assert inst.careTeam[0].sequence == 1 assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == "654456" assert inst.diagnosis[0].sequence == 1 assert ( inst.enterer.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://jurisdiction.org/facilities/HOSP1234/users"} ).valueUri ) assert inst.enterer.identifier.value == "UC1234" assert ( inst.facility.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://jurisdiction.org/facilities"} ).valueUri ) assert inst.facility.identifier.value == "HOSP1234" assert inst.id == "960150" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyhospital.com/claim"} ).valueUri ) assert inst.identifier[0].value == "9612345" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].focal is True assert inst.insurance[0].sequence == 1 assert inst.insurer.reference == "Organization/2" assert inst.item[0].careTeamSequence[0] == 1 assert inst.item[0].encounter[0].reference == "Encounter/example" assert inst.item[0].net.currency == "USD" assert float(inst.item[0].net.value) == float(125.0) assert inst.item[0].productOrService.coding[0].code == "exam" assert ( inst.item[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ex-serviceproduct"} ).valueUri ) assert inst.item[0].sequence == 1 assert ( inst.item[0].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert inst.item[0].unitPrice.currency == "USD" assert float(inst.item[0].unitPrice.value) == float(125.0) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/1" assert inst.payee.type.coding[0].code == "provider" assert inst.priority.coding[0].code == "normal" assert ( inst.procedure[0].date == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.procedure[0].procedureCodeableConcept.coding[0].code == "SDI9901" assert ( inst.procedure[0].procedureCodeableConcept.text == "Subcutaneous diagnostic implant" ) assert inst.procedure[0].sequence == 1 assert inst.procedure[0].type[0].coding[0].code == "primary" assert inst.procedure[0].udi[0].reference == "Device/example" assert inst.provider.reference == "Organization/1" assert inst.status == "active" assert inst.subType.coding[0].code == "emergency" assert ( inst.subType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-claimsubtype"} ).valueUri ) assert inst.text.div == ( '
A human-readable' " rendering of the Claim
" ) assert inst.text.status == "generated" assert inst.total.currency == "USD" assert float(inst.total.value) == float(125.0) assert inst.type.coding[0].code == "institutional" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claim_6(base_settings): """No. 6 tests collection for Claim. Test File: claim-example-institutional.json """ filename = base_settings["unittest_data_dir"] / "claim-example-institutional.json" inst = claim.Claim.model_validate_json(filename.read_bytes()) assert "Claim" == inst.get_resource_type() impl_claim_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Claim" == data["resourceType"] inst2 = claim.Claim(**data) impl_claim_6(inst2) def impl_claim_7(inst): assert inst.careTeam[0].provider.reference == "#provider-1" assert inst.careTeam[0].sequence == 1 assert inst.contained[0].id == "org-insurer" assert inst.contained[1].id == "org-org" assert inst.contained[2].id == "provider-1" assert inst.contained[3].id == "patient-1" assert inst.contained[4].id == "coverage-1" assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == "123456" assert inst.diagnosis[0].sequence == 1 assert inst.id == "100152" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/claim"} ).valueUri ) assert inst.identifier[0].value == "12347" assert inst.insurance[0].coverage.reference == "#coverage-1" assert inst.insurance[0].focal is True assert inst.insurance[0].sequence == 1 assert inst.insurer.reference == "#org-insurer" assert inst.item[0].careTeamSequence[0] == 1 assert inst.item[0].net.currency == "USD" assert float(inst.item[0].net.value) == float(135.57) assert inst.item[0].productOrService.coding[0].code == "1200" assert inst.item[0].sequence == 1 assert ( inst.item[0].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert inst.item[0].unitPrice.currency == "USD" assert float(inst.item[0].unitPrice.value) == float(135.57) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "#patient-1" assert inst.payee.type.coding[0].code == "provider" assert inst.priority.coding[0].code == "normal" assert inst.provider.reference == "#org-org" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the Oral Health Claim
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "oral" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claim_7(base_settings): """No. 7 tests collection for Claim. Test File: claim-example-oral-contained.json """ filename = base_settings["unittest_data_dir"] / "claim-example-oral-contained.json" inst = claim.Claim.model_validate_json(filename.read_bytes()) assert "Claim" == inst.get_resource_type() impl_claim_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Claim" == data["resourceType"] inst2 = claim.Claim(**data) impl_claim_7(inst2) def impl_claim_8(inst): assert inst.careTeam[0].provider.reference == "Practitioner/example" assert inst.careTeam[0].sequence == 1 assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == "654456" assert inst.diagnosis[0].sequence == 1 assert inst.id == "760151" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happypharma.com/claim"} ).valueUri ) assert inst.identifier[0].value == "7612345" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].focal is True assert inst.insurance[0].sequence == 1 assert inst.insurer.reference == "Organization/2" assert inst.item[0].careTeamSequence[0] == 1 assert inst.item[0].detail[0].net.currency == "USD" assert float(inst.item[0].detail[0].net.value) == float(45.0) assert inst.item[0].detail[0].productOrService.coding[0].code == "drugcost" assert ( inst.item[0].detail[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ex-pharmaservice"} ).valueUri ) assert inst.item[0].detail[0].sequence == 1 assert inst.item[0].detail[1].net.currency == "USD" assert float(inst.item[0].detail[1].net.value) == float(9.0) assert inst.item[0].detail[1].productOrService.coding[0].code == "markup" assert ( inst.item[0].detail[1].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ex-pharmaservice"} ).valueUri ) assert inst.item[0].detail[1].sequence == 2 assert inst.item[0].detail[2].net.currency == "USD" assert float(inst.item[0].detail[2].net.value) == float(36.0) assert inst.item[0].detail[2].productOrService.coding[0].code == "dispensefee" assert ( inst.item[0].detail[2].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ex-pharmaservice"} ).valueUri ) assert inst.item[0].detail[2].sequence == 3 assert inst.item[0].informationSequence[0] == 1 assert inst.item[0].informationSequence[1] == 2 assert inst.item[0].informationSequence[2] == 3 assert inst.item[0].net.currency == "USD" assert float(inst.item[0].net.value) == float(90.0) assert inst.item[0].productOrService.coding[0].code == "562721" assert ( inst.item[0].productOrService.coding[0].display == "Alprazolam 0.25mg (Xanax)" ) assert ( inst.item[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.item[0].quantity.code == "TAB" assert ( inst.item[0].quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.item[0].quantity.unit == "TAB" assert float(inst.item[0].quantity.value) == float(90) assert inst.item[0].sequence == 1 assert ( inst.item[0].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.originalPrescription.reference == "http://pharmacy.org/MedicationRequest/AB1202B" ) assert inst.patient.reference == "Patient/1" assert inst.payee.type.coding[0].code == "provider" assert ( inst.prescription.reference == "http://pharmacy.org/MedicationRequest/AB1234G" ) assert inst.priority.coding[0].code == "stat" assert inst.provider.reference == "Organization/1" assert inst.status == "active" assert inst.supportingInfo[0].category.coding[0].code == "pharmacyrefill" assert inst.supportingInfo[0].code.coding[0].code == "new" assert ( inst.supportingInfo[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/pharmacy-refill"} ).valueUri ) assert inst.supportingInfo[0].sequence == 1 assert inst.supportingInfo[1].category.coding[0].code == "pharmacyinformation" assert inst.supportingInfo[1].code.coding[0].code == "refillsremaining" assert ( inst.supportingInfo[1].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/pharmacy-information"} ).valueUri ) assert inst.supportingInfo[1].sequence == 2 assert float(inst.supportingInfo[1].valueQuantity.value) == float(2) assert inst.supportingInfo[2].category.coding[0].code == "pharmacyinformation" assert inst.supportingInfo[2].code.coding[0].code == "dayssupply" assert ( inst.supportingInfo[2].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/pharmacy-information"} ).valueUri ) assert inst.supportingInfo[2].sequence == 3 assert float(inst.supportingInfo[2].valueQuantity.value) == float(90) assert inst.text.div == ( '
A human-readable' " rendering of the Pharmacy Claim
" ) assert inst.text.status == "generated" assert inst.total.currency == "USD" assert float(inst.total.value) == float(90.0) assert inst.type.coding[0].code == "pharmacy" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claim_8(base_settings): """No. 8 tests collection for Claim. Test File: claim-example-pharmacy-medication.json """ filename = ( base_settings["unittest_data_dir"] / "claim-example-pharmacy-medication.json" ) inst = claim.Claim.model_validate_json(filename.read_bytes()) assert "Claim" == inst.get_resource_type() impl_claim_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Claim" == data["resourceType"] inst2 = claim.Claim(**data) impl_claim_8(inst2) def impl_claim_9(inst): assert inst.careTeam[0].provider.reference == "Practitioner/example" assert inst.careTeam[0].sequence == 1 assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-03-16"} ).valueDateTime ) assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == "K07.3" assert ( inst.diagnosis[0].diagnosisCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/icd-10"} ).valueUri ) assert inst.diagnosis[0].sequence == 1 assert inst.fundsReserve.coding[0].code == "provider" assert inst.id == "100153" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/claim"} ).valueUri ) assert inst.identifier[0].value == "12355" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].focal is True assert inst.insurance[0].sequence == 1 assert inst.insurer.reference == "Organization/2" assert inst.item[0].careTeamSequence[0] == 1 assert inst.item[0].detail[0].net.currency == "USD" assert float(inst.item[0].detail[0].net.value) == float(1000.0) assert inst.item[0].detail[0].productOrService.coding[0].code == "ORTHOEXAM" assert ( inst.item[0].detail[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert inst.item[0].detail[0].sequence == 1 assert inst.item[0].detail[0].unitPrice.currency == "USD" assert float(inst.item[0].detail[0].unitPrice.value) == float(1000.0) assert inst.item[0].detail[1].net.currency == "USD" assert float(inst.item[0].detail[1].net.value) == float(1500.0) assert inst.item[0].detail[1].productOrService.coding[0].code == "ORTHODIAG" assert ( inst.item[0].detail[1].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert inst.item[0].detail[1].sequence == 2 assert inst.item[0].detail[1].unitPrice.currency == "USD" assert float(inst.item[0].detail[1].unitPrice.value) == float(1500.0) assert inst.item[0].detail[2].net.currency == "USD" assert float(inst.item[0].detail[2].net.value) == float(500.0) assert inst.item[0].detail[2].productOrService.coding[0].code == "ORTHOINITIAL" assert ( inst.item[0].detail[2].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert inst.item[0].detail[2].sequence == 3 assert inst.item[0].detail[2].unitPrice.currency == "USD" assert float(inst.item[0].detail[2].unitPrice.value) == float(500.0) assert inst.item[0].detail[3].productOrService.coding[0].code == "ORTHOMONTHS" assert ( inst.item[0].detail[3].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert float(inst.item[0].detail[3].quantity.value) == float(24) assert inst.item[0].detail[3].sequence == 4 assert inst.item[0].detail[4].net.currency == "USD" assert float(inst.item[0].detail[4].net.value) == float(250.0) assert inst.item[0].detail[4].productOrService.coding[0].code == "ORTHOPERIODIC" assert ( inst.item[0].detail[4].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert float(inst.item[0].detail[4].quantity.value) == float(24) assert inst.item[0].detail[4].sequence == 5 assert inst.item[0].detail[4].unitPrice.currency == "USD" assert float(inst.item[0].detail[4].unitPrice.value) == float(250.0) assert inst.item[0].diagnosisSequence[0] == 1 assert inst.item[0].net.currency == "USD" assert float(inst.item[0].net.value) == float(9000.0) assert inst.item[0].productOrService.coding[0].code == "ORTHPLAN" assert ( inst.item[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert inst.item[0].sequence == 1 assert ( inst.item[0].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2015-05-16"}).valueDate ) assert inst.item[0].unitPrice.currency == "USD" assert float(inst.item[0].unitPrice.value) == float(9000.0) assert inst.item[1].bodySite[0].site[0].concept.coding[0].code == "21" assert ( inst.item[1].bodySite[0].site[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://fdi.org/fhir/oraltoothcodes"} ).valueUri ) assert inst.item[1].bodySite[0].subSite[0].coding[0].code == "L" assert ( inst.item[1].bodySite[0].subSite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://fdi.org/fhir/oralsurfacecodes"} ).valueUri ) assert inst.item[1].careTeamSequence[0] == 1 assert inst.item[1].net.currency == "USD" assert float(inst.item[1].net.value) == float(105.0) assert inst.item[1].productOrService.coding[0].code == "21211" assert ( inst.item[1].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert inst.item[1].sequence == 2 assert ( inst.item[1].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert inst.item[1].unitPrice.currency == "USD" assert float(inst.item[1].unitPrice.value) == float(105.0) assert inst.item[2].bodySite[0].site[0].concept.coding[0].code == "36" assert ( inst.item[2].bodySite[0].site[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://fdi.org/fhir/oraltoothcodes"} ).valueUri ) assert inst.item[2].careTeamSequence[0] == 1 assert inst.item[2].detail[0].net.currency == "USD" assert float(inst.item[2].detail[0].net.value) == float(750.0) assert inst.item[2].detail[0].productOrService.coding[0].code == "27211" assert ( inst.item[2].detail[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert inst.item[2].detail[0].sequence == 1 assert inst.item[2].detail[0].unitPrice.currency == "USD" assert float(inst.item[2].detail[0].unitPrice.value) == float(750.0) assert inst.item[2].detail[1].net.currency == "USD" assert float(inst.item[2].detail[1].net.value) == float(350.0) assert inst.item[2].detail[1].productOrService.coding[0].code == "lab" assert ( inst.item[2].detail[1].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert inst.item[2].detail[1].sequence == 2 assert inst.item[2].detail[1].unitPrice.currency == "USD" assert float(inst.item[2].detail[1].unitPrice.value) == float(350.0) assert inst.item[2].net.currency == "USD" assert float(inst.item[2].net.value) == float(1100.0) assert inst.item[2].productOrService.coding[0].code == "27211" assert ( inst.item[2].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert inst.item[2].sequence == 3 assert ( inst.item[2].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert inst.item[2].unitPrice.currency == "USD" assert float(inst.item[2].unitPrice.value) == float(1100.0) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/1" assert inst.payee.type.coding[0].code == "provider" assert inst.priority.coding[0].code == "normal" assert inst.provider.reference == "Organization/1" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the Oral Health Claim
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "oral" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "preauthorization" def test_claim_9(base_settings): """No. 9 tests collection for Claim. Test File: claim-example-oral-orthoplan.json """ filename = base_settings["unittest_data_dir"] / "claim-example-oral-orthoplan.json" inst = claim.Claim.model_validate_json(filename.read_bytes()) assert "Claim" == inst.get_resource_type() impl_claim_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Claim" == data["resourceType"] inst2 = claim.Claim(**data) impl_claim_9(inst2) def impl_claim_10(inst): assert inst.careTeam[0].provider.reference == "Practitioner/example" assert inst.careTeam[0].sequence == 1 assert inst.contained[0].id == "patient-1" assert inst.contained[1].id == "coverage-1" assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-10-16T00:00:00-07:00"} ).valueDateTime ) assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == "M96.1" assert ( inst.diagnosis[0].diagnosisCodeableConcept.coding[0].display == "Postlaminectomy syndrome, not elsewhere classified" ) assert ( inst.diagnosis[0].diagnosisCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/icd-10-cm"} ).valueUri ) assert inst.diagnosis[0].sequence == 1 assert inst.diagnosis[1].diagnosisCodeableConcept.coding[0].code == "G89.4" assert ( inst.diagnosis[1].diagnosisCodeableConcept.coding[0].display == "Chronic pain syndrome" ) assert ( inst.diagnosis[1].diagnosisCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/icd-10-cm"} ).valueUri ) assert inst.diagnosis[1].sequence == 2 assert inst.diagnosis[2].diagnosisCodeableConcept.coding[0].code == "M53.88" assert inst.diagnosis[2].diagnosisCodeableConcept.coding[0].display == ( "Other specified dorsopathies, sacral and sacrococcygeal " "region" ) assert ( inst.diagnosis[2].diagnosisCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/icd-10-cm"} ).valueUri ) assert inst.diagnosis[2].sequence == 3 assert inst.diagnosis[3].diagnosisCodeableConcept.coding[0].code == "M47.816" assert inst.diagnosis[3].diagnosisCodeableConcept.coding[0].display == ( "Spondylosis without myelopathy or radiculopathy, lumbar " "region" ) assert ( inst.diagnosis[3].diagnosisCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/icd-10-cm"} ).valueUri ) assert inst.diagnosis[3].sequence == 4 assert inst.id == "MED-00050" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://CedarArmsMedicalCenter.com/claim"} ).valueUri ) assert inst.identifier[0].value == "MED-00050" assert inst.insurance[0].coverage.reference == "#coverage-1" assert inst.insurance[0].focal is True assert ( inst.insurance[0].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://CedarArmsMedicalCenter.com/claim"} ).valueUri ) assert inst.insurance[0].identifier.value == "MED-00050" assert inst.insurance[0].sequence == 1 assert inst.insurer.display == "Humana Inc." assert ( inst.insurer.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bindb.com/bin"} ).valueUri ) assert inst.insurer.identifier.value == "123456" assert inst.item[0].careTeamSequence[0] == 1 assert inst.item[0].diagnosisSequence[0] == 2 assert inst.item[0].diagnosisSequence[1] == 4 assert inst.item[0].informationSequence[0] == 1 assert inst.item[0].locationCodeableConcept.coding[0].code == "24" assert ( inst.item[0].locationCodeableConcept.coding[0].display == "Ambulatory Surgical Center" ) assert ( inst.item[0].locationCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "https://www.cms.gov/medicare/coding/place-of-service-codes/place_of_service_code_set.html" } ).valueUri ) assert inst.item[0].net.currency == "USD" assert float(inst.item[0].net.value) == float(12500.0) assert inst.item[0].productOrService.coding[0].code == "62264" assert ( inst.item[0].productOrService.coding[0].display == "Surgical Procedures on the Spine and Spinal Cord" ) assert ( inst.item[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.ama-assn.org/go/cpt"} ).valueUri ) assert inst.item[0].sequence == 1 assert ( inst.item[0].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2015-10-13"}).valueDate ) assert inst.item[0].unitPrice.currency == "USD" assert float(inst.item[0].unitPrice.value) == float(12500.0) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "#patient-1" assert inst.payee.party.reference == "Organization/1" assert inst.payee.type.coding[0].code == "provider" assert ( inst.payee.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/payeetype"} ).valueUri ) assert inst.priority.coding[0].code == "normal" assert inst.provider.reference == "Organization/1" assert inst.status == "active" assert inst.subType.coding[0].code == "831" assert ( inst.subType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.cms.gov/codes/billtype"} ).valueUri ) assert inst.supportingInfo[0].category.coding[0].code == "hospitalized" assert ( inst.supportingInfo[0].category.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/claiminformationcategory" } ).valueUri ) assert inst.supportingInfo[0].sequence == 1 assert ( inst.supportingInfo[0].timingPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-10-05T00:00:00-07:00"} ).valueDateTime ) assert ( inst.supportingInfo[0].timingPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-10-01T00:00:00-07:00"} ).valueDateTime ) assert inst.supportingInfo[1].category.coding[0].code == "discharge" assert ( inst.supportingInfo[1].category.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/claiminformationcategory" } ).valueUri ) assert inst.supportingInfo[1].code.coding[0].code == "01" assert ( inst.supportingInfo[1].code.coding[0].display == "Discharge to Home or Self Care" ) assert ( inst.supportingInfo[1].code.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "https://www.cms.gov/Outreach-and-Education/Medicare-Learning-Network-MLN/MLNMattersArticles/downloads/SE0801.pdf" } ).valueUri ) assert inst.supportingInfo[1].sequence == 2 assert inst.text.div == ( '
A human-readable' " rendering of a CMS 1500 Claim
" ) assert inst.text.status == "generated" assert inst.total.currency == "USD" assert float(inst.total.value) == float(12500.0) assert inst.type.coding[0].code == "institutional" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claim_10(base_settings): """No. 10 tests collection for Claim. Test File: claim-example-cms1500-medical.json """ filename = base_settings["unittest_data_dir"] / "claim-example-cms1500-medical.json" inst = claim.Claim.model_validate_json(filename.read_bytes()) assert "Claim" == inst.get_resource_type() impl_claim_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Claim" == data["resourceType"] inst2 = claim.Claim(**data) impl_claim_10(inst2) ================================================ FILE: fhir/resources/tests/test_claimresponse.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ClaimResponse Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import claimresponse from .conftest import ExternalValidatorModel def impl_claimresponse_1(inst): assert inst.addItem[0].adjudication[0].amount.currency == "USD" assert float(inst.addItem[0].adjudication[0].amount.value) == float(250.0) assert inst.addItem[0].adjudication[0].category.coding[0].code == "eligible" assert inst.addItem[0].adjudication[1].amount.currency == "USD" assert float(inst.addItem[0].adjudication[1].amount.value) == float(10.0) assert inst.addItem[0].adjudication[1].category.coding[0].code == "copay" assert inst.addItem[0].adjudication[2].category.coding[0].code == "eligpercent" assert float(inst.addItem[0].adjudication[2].quantity.value) == float(100.0) assert inst.addItem[0].adjudication[3].amount.currency == "USD" assert float(inst.addItem[0].adjudication[3].amount.value) == float(240.0) assert inst.addItem[0].adjudication[3].category.coding[0].code == "benefit" assert inst.addItem[0].itemSequence[0] == 1 assert inst.addItem[0].modifier[0].coding[0].code == "x" assert inst.addItem[0].modifier[0].coding[0].display == "None" assert ( inst.addItem[0].modifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/modifiers"} ).valueUri ) assert inst.addItem[0].net.currency == "USD" assert float(inst.addItem[0].net.value) == float(250.0) assert inst.addItem[0].noteNumber[0] == 101 assert inst.addItem[0].productOrService.coding[0].code == "1101" assert ( inst.addItem[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert inst.addItem[1].adjudication[0].amount.currency == "USD" assert float(inst.addItem[1].adjudication[0].amount.value) == float(800.0) assert inst.addItem[1].adjudication[0].category.coding[0].code == "eligible" assert inst.addItem[1].adjudication[1].category.coding[0].code == "eligpercent" assert float(inst.addItem[1].adjudication[1].quantity.value) == float(100.0) assert inst.addItem[1].adjudication[2].amount.currency == "USD" assert float(inst.addItem[1].adjudication[2].amount.value) == float(800.0) assert inst.addItem[1].adjudication[2].category.coding[0].code == "benefit" assert inst.addItem[1].itemSequence[0] == 1 assert inst.addItem[1].net.currency == "USD" assert float(inst.addItem[1].net.value) == float(800.0) assert inst.addItem[1].productOrService.coding[0].code == "2101" assert ( inst.addItem[1].productOrService.coding[0].display == "Radiograph, series (12)" ) assert ( inst.addItem[1].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.disposition == ( "The enclosed services are authorized for your provision " "within 30 days of this notice." ) assert inst.id == "UR3503" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.SocialBenefitsInc.com/fhir/ClaimResponse"} ).valueUri ) assert inst.identifier[0].value == "UR3503" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].focal is True assert inst.insurance[0].sequence == 1 assert ( inst.insurer.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.jurisdiction.org/insurers"} ).valueUri ) assert inst.insurer.identifier.value == "444123" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "complete" assert inst.patient.reference == "Patient/1" assert inst.payeeType.coding[0].code == "provider" assert ( inst.payeeType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/payeetype"} ).valueUri ) assert inst.preAuthRef == "18SS12345" assert inst.processNote[0].language.coding[0].code == "en-CA" assert ( inst.processNote[0].language.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:47"} ).valueUri ) assert inst.processNote[0].number == 101 assert inst.processNote[0].text == ( "Please submit a Pre-Authorization request if a more " "extensive examination or urgent services are required." ) assert inst.processNote[0].type.coding[0].code == "print" assert ( inst.processNote[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/note-type"} ).valueUri ) assert inst.requestor.reference == "Organization/1" assert inst.status == "active" assert inst.text.div == ( '
A sample ' "unsolicited pre-authorization response which authorizes " "basic dental services to be performed for a patient.
" ) assert inst.text.status == "generated" assert inst.total[0].amount.currency == "USD" assert float(inst.total[0].amount.value) == float(1050.0) assert inst.total[0].category.coding[0].code == "submitted" assert inst.total[1].amount.currency == "USD" assert float(inst.total[1].amount.value) == float(1040.0) assert inst.total[1].category.coding[0].code == "benefit" assert inst.type.coding[0].code == "oral" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "preauthorization" def test_claimresponse_1(base_settings): """No. 1 tests collection for ClaimResponse. Test File: claimresponse-example-unsolicited-preauth.json """ filename = ( base_settings["unittest_data_dir"] / "claimresponse-example-unsolicited-preauth.json" ) inst = claimresponse.ClaimResponse.model_validate_json(filename.read_bytes()) assert "ClaimResponse" == inst.get_resource_type() impl_claimresponse_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ClaimResponse" == data["resourceType"] inst2 = claimresponse.ClaimResponse(**data) impl_claimresponse_1(inst2) def impl_claimresponse_2(inst): assert inst.addItem[0].adjudication[0].amount.currency == "USD" assert float(inst.addItem[0].adjudication[0].amount.value) == float(100.0) assert inst.addItem[0].adjudication[0].category.coding[0].code == "eligible" assert inst.addItem[0].adjudication[1].amount.currency == "USD" assert float(inst.addItem[0].adjudication[1].amount.value) == float(10.0) assert inst.addItem[0].adjudication[1].category.coding[0].code == "copay" assert inst.addItem[0].adjudication[2].category.coding[0].code == "eligpercent" assert float(inst.addItem[0].adjudication[2].quantity.value) == float(80.0) assert inst.addItem[0].adjudication[3].amount.currency == "USD" assert float(inst.addItem[0].adjudication[3].amount.value) == float(72.0) assert inst.addItem[0].adjudication[3].category.coding[0].code == "benefit" assert inst.addItem[0].adjudication[3].reason.coding[0].code == "ar002" assert ( inst.addItem[0].adjudication[3].reason.coding[0].display == "Plan Limit Reached" ) assert ( inst.addItem[0].adjudication[3].reason.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/adjudication-reason"} ).valueUri ) assert inst.addItem[0].itemSequence[0] == 1 assert inst.addItem[0].modifier[0].coding[0].code == "x" assert inst.addItem[0].modifier[0].coding[0].display == "None" assert ( inst.addItem[0].modifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/modifiers"} ).valueUri ) assert inst.addItem[0].net.currency == "USD" assert float(inst.addItem[0].net.value) == float(135.57) assert inst.addItem[0].noteNumber[0] == 101 assert inst.addItem[0].productOrService.coding[0].code == "1101" assert ( inst.addItem[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert inst.addItem[1].adjudication[0].amount.currency == "USD" assert float(inst.addItem[1].adjudication[0].amount.value) == float(35.57) assert inst.addItem[1].adjudication[0].category.coding[0].code == "eligible" assert inst.addItem[1].adjudication[1].category.coding[0].code == "eligpercent" assert float(inst.addItem[1].adjudication[1].quantity.value) == float(80.0) assert inst.addItem[1].adjudication[2].amount.currency == "USD" assert float(inst.addItem[1].adjudication[2].amount.value) == float(28.47) assert inst.addItem[1].adjudication[2].category.coding[0].code == "benefit" assert inst.addItem[1].itemSequence[0] == 1 assert inst.addItem[1].net.currency == "USD" assert float(inst.addItem[1].net.value) == float(35.57) assert inst.addItem[1].productOrService.coding[0].code == "2141" assert inst.addItem[1].productOrService.coding[0].display == "Radiograph, bytewing" assert ( inst.addItem[1].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert inst.addItem[2].adjudication[0].amount.currency == "USD" assert float(inst.addItem[2].adjudication[0].amount.value) == float(350.0) assert inst.addItem[2].adjudication[0].category.coding[0].code == "eligible" assert inst.addItem[2].adjudication[1].category.coding[0].code == "eligpercent" assert float(inst.addItem[2].adjudication[1].quantity.value) == float(80.0) assert inst.addItem[2].adjudication[2].amount.currency == "USD" assert float(inst.addItem[2].adjudication[2].amount.value) == float(270.0) assert inst.addItem[2].adjudication[2].category.coding[0].code == "benefit" assert inst.addItem[2].detailSequence[0] == 2 assert inst.addItem[2].itemSequence[0] == 3 assert inst.addItem[2].modifier[0].coding[0].code == "x" assert inst.addItem[2].modifier[0].coding[0].display == "None" assert ( inst.addItem[2].modifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/modifiers"} ).valueUri ) assert inst.addItem[2].net.currency == "USD" assert float(inst.addItem[2].net.value) == float(350.0) assert inst.addItem[2].noteNumber[0] == 101 assert inst.addItem[2].productOrService.coding[0].code == "expense" assert ( inst.addItem[2].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/oralservicecodes"} ).valueUri ) assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.disposition == "Claim settled as per contract." assert inst.id == "R3503" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/remittance"} ).valueUri ) assert inst.identifier[0].value == "R3503" assert ( inst.insurer.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.jurisdiction.org/insurers"} ).valueUri ) assert inst.insurer.identifier.value == "555123" assert inst.item[0].adjudication[0].amount.currency == "USD" assert float(inst.item[0].adjudication[0].amount.value) == float(0.0) assert inst.item[0].adjudication[0].category.coding[0].code == "eligible" assert inst.item[0].adjudication[1].amount.currency == "USD" assert float(inst.item[0].adjudication[1].amount.value) == float(0.0) assert inst.item[0].adjudication[1].category.coding[0].code == "benefit" assert inst.item[0].itemSequence == 1 assert inst.item[1].adjudication[0].amount.currency == "USD" assert float(inst.item[1].adjudication[0].amount.value) == float(105.0) assert inst.item[1].adjudication[0].category.coding[0].code == "eligible" assert inst.item[1].adjudication[1].category.coding[0].code == "eligpercent" assert float(inst.item[1].adjudication[1].quantity.value) == float(80.0) assert inst.item[1].adjudication[2].amount.currency == "USD" assert float(inst.item[1].adjudication[2].amount.value) == float(84.0) assert inst.item[1].adjudication[2].category.coding[0].code == "benefit" assert inst.item[1].itemSequence == 2 assert inst.item[2].adjudication[0].amount.currency == "USD" assert float(inst.item[2].adjudication[0].amount.value) == float(750.0) assert inst.item[2].adjudication[0].category.coding[0].code == "eligible" assert inst.item[2].adjudication[1].category.coding[0].code == "eligpercent" assert float(inst.item[2].adjudication[1].quantity.value) == float(80.0) assert inst.item[2].adjudication[2].amount.currency == "USD" assert float(inst.item[2].adjudication[2].amount.value) == float(600.0) assert inst.item[2].adjudication[2].category.coding[0].code == "benefit" assert inst.item[2].detail[0].adjudication[0].amount.currency == "USD" assert float(inst.item[2].detail[0].adjudication[0].amount.value) == float(750.0) assert inst.item[2].detail[0].adjudication[0].category.coding[0].code == "eligible" assert ( inst.item[2].detail[0].adjudication[1].category.coding[0].code == "eligpercent" ) assert float(inst.item[2].detail[0].adjudication[1].quantity.value) == float(80.0) assert inst.item[2].detail[0].adjudication[2].amount.currency == "USD" assert float(inst.item[2].detail[0].adjudication[2].amount.value) == float(600.0) assert inst.item[2].detail[0].adjudication[2].category.coding[0].code == "benefit" assert inst.item[2].detail[0].detailSequence == 1 assert inst.item[2].detail[1].adjudication[0].amount.currency == "USD" assert float(inst.item[2].detail[1].adjudication[0].amount.value) == float(0.0) assert inst.item[2].detail[1].adjudication[0].category.coding[0].code == "eligible" assert inst.item[2].detail[1].adjudication[1].amount.currency == "USD" assert float(inst.item[2].detail[1].adjudication[1].amount.value) == float(0.0) assert inst.item[2].detail[1].adjudication[1].category.coding[0].code == "benefit" assert inst.item[2].detail[1].detailSequence == 2 assert inst.item[2].itemSequence == 3 assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "complete" assert inst.patient.reference == "Patient/1" assert inst.payeeType.coding[0].code == "provider" assert ( inst.payeeType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/payeetype"} ).valueUri ) assert inst.payment.amount.currency == "USD" assert float(inst.payment.amount.value) == float(100.47) assert ( inst.payment.date == ExternalValidatorModel.model_validate({"valueDate": "2014-08-31"}).valueDate ) assert ( inst.payment.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/paymentidentifier"} ).valueUri ) assert inst.payment.identifier.value == "201408-2-15507" assert inst.payment.type.coding[0].code == "complete" assert ( inst.payment.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-paymenttype"} ).valueUri ) assert inst.processNote[0].language.coding[0].code == "en-CA" assert ( inst.processNote[0].language.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:47"} ).valueUri ) assert inst.processNote[0].number == 101 assert ( inst.processNote[0].text == "Package codes are not permitted. Codes replaced by Insurer." ) assert inst.processNote[0].type.coding[0].code == "print" assert ( inst.processNote[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/note-type"} ).valueUri ) assert ( inst.request.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/claim"} ).valueUri ) assert inst.request.identifier.value == "12346" assert inst.requestor.reference == "Organization/1" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the ClaimResponse to Claim Oral Average with " "additional items
" ) assert inst.text.status == "generated" assert inst.total[0].amount.currency == "USD" assert float(inst.total[0].amount.value) == float(1340.57) assert inst.total[0].category.coding[0].code == "submitted" assert inst.total[1].amount.currency == "USD" assert float(inst.total[1].amount.value) == float(1054.47) assert inst.total[1].category.coding[0].code == "benefit" assert inst.type.coding[0].code == "oral" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claimresponse_2(base_settings): """No. 2 tests collection for ClaimResponse. Test File: claimresponse-example-additem.json """ filename = base_settings["unittest_data_dir"] / "claimresponse-example-additem.json" inst = claimresponse.ClaimResponse.model_validate_json(filename.read_bytes()) assert "ClaimResponse" == inst.get_resource_type() impl_claimresponse_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ClaimResponse" == data["resourceType"] inst2 = claimresponse.ClaimResponse(**data) impl_claimresponse_2(inst2) def impl_claimresponse_3(inst): assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.disposition == "Claim settled as per contract." assert inst.id == "R3500" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/remittance"} ).valueUri ) assert inst.identifier[0].value == "R3500" assert ( inst.insurer.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.jurisdiction.org/insurers"} ).valueUri ) assert inst.insurer.identifier.value == "555123" assert inst.item[0].adjudication[0].amount.currency == "USD" assert float(inst.item[0].adjudication[0].amount.value) == float(135.57) assert inst.item[0].adjudication[0].category.coding[0].code == "eligible" assert inst.item[0].adjudication[1].amount.currency == "USD" assert float(inst.item[0].adjudication[1].amount.value) == float(10.0) assert inst.item[0].adjudication[1].category.coding[0].code == "copay" assert inst.item[0].adjudication[2].category.coding[0].code == "eligpercent" assert float(inst.item[0].adjudication[2].quantity.value) == float(80.0) assert inst.item[0].adjudication[3].amount.currency == "USD" assert float(inst.item[0].adjudication[3].amount.value) == float(90.47) assert inst.item[0].adjudication[3].category.coding[0].code == "benefit" assert inst.item[0].adjudication[3].reason.coding[0].code == "ar002" assert inst.item[0].adjudication[3].reason.coding[0].display == "Plan Limit Reached" assert ( inst.item[0].adjudication[3].reason.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/adjudication-reason"} ).valueUri ) assert inst.item[0].itemSequence == 1 assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "complete" assert inst.patient.reference == "Patient/1" assert inst.payeeType.coding[0].code == "provider" assert ( inst.payeeType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/payeetype"} ).valueUri ) assert inst.payment.amount.currency == "USD" assert float(inst.payment.amount.value) == float(100.47) assert ( inst.payment.date == ExternalValidatorModel.model_validate({"valueDate": "2014-08-31"}).valueDate ) assert ( inst.payment.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/paymentidentifier"} ).valueUri ) assert inst.payment.identifier.value == "201408-2-1569478" assert inst.payment.type.coding[0].code == "complete" assert ( inst.payment.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-paymenttype"} ).valueUri ) assert ( inst.request.reference == "http://www.BenefitsInc.com/fhir/oralhealthclaim/15476332402" ) assert inst.requestor.reference == "Organization/1" assert inst.status == "active" assert inst.subType.coding[0].code == "emergency" assert ( inst.subType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-claimsubtype"} ).valueUri ) assert inst.text.div == ( '
A human-readable' " rendering of the ClaimResponse
" ) assert inst.text.status == "generated" assert inst.total[0].amount.currency == "USD" assert float(inst.total[0].amount.value) == float(135.57) assert inst.total[0].category.coding[0].code == "submitted" assert inst.total[1].amount.currency == "USD" assert float(inst.total[1].amount.value) == float(90.47) assert inst.total[1].category.coding[0].code == "benefit" assert inst.type.coding[0].code == "oral" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claimresponse_3(base_settings): """No. 3 tests collection for ClaimResponse. Test File: claimresponse-example.json """ filename = base_settings["unittest_data_dir"] / "claimresponse-example.json" inst = claimresponse.ClaimResponse.model_validate_json(filename.read_bytes()) assert "ClaimResponse" == inst.get_resource_type() impl_claimresponse_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ClaimResponse" == data["resourceType"] inst2 = claimresponse.ClaimResponse(**data) impl_claimresponse_3(inst2) def impl_claimresponse_4(inst): assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.disposition == "Claim settled as per contract." assert inst.id == "R3502" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://thebenefitcompany.com/claimresponse"} ).valueUri ) assert inst.identifier[0].value == "CR6532875367" assert inst.insurer.reference == "Organization/2" assert inst.item[0].adjudication[0].amount.currency == "USD" assert float(inst.item[0].adjudication[0].amount.value) == float(235.4) assert inst.item[0].adjudication[0].category.coding[0].code == "eligible" assert inst.item[0].adjudication[1].amount.currency == "USD" assert float(inst.item[0].adjudication[1].amount.value) == float(20.0) assert inst.item[0].adjudication[1].category.coding[0].code == "copay" assert inst.item[0].adjudication[2].category.coding[0].code == "eligpercent" assert float(inst.item[0].adjudication[2].quantity.value) == float(80.0) assert inst.item[0].adjudication[3].amount.currency == "USD" assert float(inst.item[0].adjudication[3].amount.value) == float(172.32) assert inst.item[0].adjudication[3].category.coding[0].code == "benefit" assert inst.item[0].detail[0].adjudication[0].amount.currency == "USD" assert float(inst.item[0].detail[0].adjudication[0].amount.value) == float(100.0) assert inst.item[0].detail[0].adjudication[0].category.coding[0].code == "eligible" assert inst.item[0].detail[0].adjudication[1].amount.currency == "USD" assert float(inst.item[0].detail[0].adjudication[1].amount.value) == float(20.0) assert inst.item[0].detail[0].adjudication[1].category.coding[0].code == "copay" assert ( inst.item[0].detail[0].adjudication[2].category.coding[0].code == "eligpercent" ) assert float(inst.item[0].detail[0].adjudication[2].quantity.value) == float(80.0) assert inst.item[0].detail[0].adjudication[3].amount.currency == "USD" assert float(inst.item[0].detail[0].adjudication[3].amount.value) == float(80.0) assert inst.item[0].detail[0].adjudication[3].category.coding[0].code == "benefit" assert inst.item[0].detail[0].detailSequence == 1 assert inst.item[0].detail[0].noteNumber[0] == 1 assert inst.item[0].detail[1].adjudication[0].amount.currency == "USD" assert float(inst.item[0].detail[1].adjudication[0].amount.value) == float(110.0) assert inst.item[0].detail[1].adjudication[0].category.coding[0].code == "eligible" assert ( inst.item[0].detail[1].adjudication[1].category.coding[0].code == "eligpercent" ) assert float(inst.item[0].detail[1].adjudication[1].quantity.value) == float(80.0) assert inst.item[0].detail[1].adjudication[2].amount.currency == "USD" assert float(inst.item[0].detail[1].adjudication[2].amount.value) == float(88.0) assert inst.item[0].detail[1].adjudication[2].category.coding[0].code == "benefit" assert inst.item[0].detail[1].detailSequence == 2 assert inst.item[0].detail[1].noteNumber[0] == 1 assert inst.item[0].detail[1].subDetail[0].adjudication[0].amount.currency == "USD" assert float( inst.item[0].detail[1].subDetail[0].adjudication[0].amount.value ) == float(60.0) assert ( inst.item[0].detail[1].subDetail[0].adjudication[0].category.coding[0].code == "eligible" ) assert ( inst.item[0].detail[1].subDetail[0].adjudication[1].category.coding[0].code == "eligpercent" ) assert float( inst.item[0].detail[1].subDetail[0].adjudication[1].quantity.value ) == float(80.0) assert inst.item[0].detail[1].subDetail[0].adjudication[2].amount.currency == "USD" assert float( inst.item[0].detail[1].subDetail[0].adjudication[2].amount.value ) == float(48.0) assert ( inst.item[0].detail[1].subDetail[0].adjudication[2].category.coding[0].code == "benefit" ) assert inst.item[0].detail[1].subDetail[0].noteNumber[0] == 1 assert inst.item[0].detail[1].subDetail[0].subDetailSequence == 1 assert inst.item[0].detail[1].subDetail[1].adjudication[0].amount.currency == "USD" assert float( inst.item[0].detail[1].subDetail[1].adjudication[0].amount.value ) == float(30.0) assert ( inst.item[0].detail[1].subDetail[1].adjudication[0].category.coding[0].code == "eligible" ) assert ( inst.item[0].detail[1].subDetail[1].adjudication[1].category.coding[0].code == "eligpercent" ) assert float( inst.item[0].detail[1].subDetail[1].adjudication[1].quantity.value ) == float(80.0) assert inst.item[0].detail[1].subDetail[1].adjudication[2].amount.currency == "USD" assert float( inst.item[0].detail[1].subDetail[1].adjudication[2].amount.value ) == float(24.0) assert ( inst.item[0].detail[1].subDetail[1].adjudication[2].category.coding[0].code == "benefit" ) assert inst.item[0].detail[1].subDetail[1].subDetailSequence == 2 assert inst.item[0].detail[1].subDetail[2].adjudication[0].amount.currency == "USD" assert float( inst.item[0].detail[1].subDetail[2].adjudication[0].amount.value ) == float(10.0) assert ( inst.item[0].detail[1].subDetail[2].adjudication[0].category.coding[0].code == "eligible" ) assert ( inst.item[0].detail[1].subDetail[2].adjudication[1].category.coding[0].code == "eligpercent" ) assert float( inst.item[0].detail[1].subDetail[2].adjudication[1].quantity.value ) == float(80.0) assert inst.item[0].detail[1].subDetail[2].adjudication[2].amount.currency == "USD" assert float( inst.item[0].detail[1].subDetail[2].adjudication[2].amount.value ) == float(8.0) assert ( inst.item[0].detail[1].subDetail[2].adjudication[2].category.coding[0].code == "benefit" ) assert inst.item[0].detail[1].subDetail[2].noteNumber[0] == 1 assert inst.item[0].detail[1].subDetail[2].subDetailSequence == 3 assert inst.item[0].detail[2].adjudication[0].amount.currency == "USD" assert float(inst.item[0].detail[2].adjudication[0].amount.value) == float(200.0) assert inst.item[0].detail[2].adjudication[0].category.coding[0].code == "eligible" assert ( inst.item[0].detail[2].adjudication[1].category.coding[0].code == "eligpercent" ) assert float(inst.item[0].detail[2].adjudication[1].quantity.value) == float(80.0) assert inst.item[0].detail[2].adjudication[2].amount.currency == "USD" assert float(inst.item[0].detail[2].adjudication[2].amount.value) == float(14.0) assert inst.item[0].detail[2].adjudication[2].category.coding[0].code == "benefit" assert inst.item[0].detail[2].detailSequence == 3 assert inst.item[0].detail[2].noteNumber[0] == 1 assert inst.item[0].itemSequence == 1 assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "complete" assert inst.patient.reference == "Patient/1" assert inst.payeeType.coding[0].code == "provider" assert ( inst.payeeType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/payeetype"} ).valueUri ) assert inst.payment.adjustment.currency == "USD" assert float(inst.payment.adjustment.value) == float(75.0) assert inst.payment.adjustmentReason.coding[0].code == "a002" assert inst.payment.adjustmentReason.coding[0].display == "Prior Overpayment" assert ( inst.payment.adjustmentReason.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/payment-adjustment-reason" } ).valueUri ) assert inst.payment.amount.currency == "USD" assert float(inst.payment.amount.value) == float(107.0) assert ( inst.payment.date == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert ( inst.payment.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://thebenefitcompany.com/paymentidentifier"} ).valueUri ) assert inst.payment.identifier.value == "201416-123456" assert inst.payment.type.coding[0].code == "complete" assert ( inst.payment.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-paymenttype"} ).valueUri ) assert inst.processNote[0].language.coding[0].code == "en-CA" assert ( inst.processNote[0].language.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:47"} ).valueUri ) assert inst.processNote[0].number == 1 assert inst.processNote[0].text == "After hours surcharge declined" assert inst.processNote[0].type.coding[0].code == "display" assert ( inst.processNote[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/note-type"} ).valueUri ) assert ( inst.request.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://happysight.com/claim"} ).valueUri ) assert inst.request.identifier.value == "6612346" assert inst.requestor.reference == "Organization/1" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the ClaimResponse
" ) assert inst.text.status == "generated" assert inst.total[0].amount.currency == "USD" assert float(inst.total[0].amount.value) == float(235.4) assert inst.total[0].category.coding[0].code == "submitted" assert inst.total[1].amount.currency == "USD" assert float(inst.total[1].amount.value) == float(182.0) assert inst.total[1].category.coding[0].code == "benefit" assert inst.type.coding[0].code == "vision" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claimresponse_4(base_settings): """No. 4 tests collection for ClaimResponse. Test File: claimresponse-example-vision-3tier.json """ filename = ( base_settings["unittest_data_dir"] / "claimresponse-example-vision-3tier.json" ) inst = claimresponse.ClaimResponse.model_validate_json(filename.read_bytes()) assert "ClaimResponse" == inst.get_resource_type() impl_claimresponse_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ClaimResponse" == data["resourceType"] inst2 = claimresponse.ClaimResponse(**data) impl_claimresponse_4(inst2) def impl_claimresponse_5(inst): assert inst.communicationRequest[0].reference == "CommunicationRequest/fm-solicit" assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.disposition == "Claim could not be processed" assert inst.error[0].code.coding[0].code == "a002" assert ( inst.error[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/adjudication-error"} ).valueUri ) assert inst.error[0].detailSequence == 2 assert inst.error[0].itemSequence == 3 assert inst.formCode.coding[0].code == "2" assert ( inst.formCode.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/forms-codes"} ).valueUri ) assert inst.id == "R3501" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/remittance"} ).valueUri ) assert inst.identifier[0].value == "R3501" assert ( inst.insurer.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.jurisdiction.org/insurers"} ).valueUri ) assert inst.insurer.identifier.value == "555123" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "error" assert inst.patient.reference == "Patient/1" assert inst.processNote[0].language.coding[0].code == "en-CA" assert ( inst.processNote[0].language.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:47"} ).valueUri ) assert inst.processNote[0].number == 1 assert inst.processNote[0].text == "Invalid claim" assert inst.processNote[0].type.coding[0].code == "display" assert ( inst.processNote[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/note-type"} ).valueUri ) assert inst.request.reference == "Claim/100156" assert inst.requestor.reference == "Practitioner/1" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the ClaimResponse that demonstrates returning " "errors
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "oral" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_claimresponse_5(base_settings): """No. 5 tests collection for ClaimResponse. Test File: claimresponse-example-2.json """ filename = base_settings["unittest_data_dir"] / "claimresponse-example-2.json" inst = claimresponse.ClaimResponse.model_validate_json(filename.read_bytes()) assert "ClaimResponse" == inst.get_resource_type() impl_claimresponse_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ClaimResponse" == data["resourceType"] inst2 = claimresponse.ClaimResponse(**data) impl_claimresponse_5(inst2) ================================================ FILE: fhir/resources/tests/test_clinicalimpression.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ClinicalImpression Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import clinicalimpression from .conftest import ExternalValidatorModel def impl_clinicalimpression_1(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-12-06T22:33:00+11:00"} ).valueDateTime ) assert inst.description == ( "This 26 yo male patient is brought into ER by ambulance " "after being involved in a motor vehicle accident" ) assert ( inst.effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-12-06T22:33:00+11:00"} ).valueDateTime ) assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-12-06T20:00:00+11:00"} ).valueDateTime ) assert inst.encounter.reference == "Encounter/example" assert inst.finding[0].item.concept.coding[0].code == "850.0" assert ( inst.finding[0].item.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/icd-9"} ).valueUri ) assert inst.id == "example" 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer.reference == "Practitioner/example" assert inst.problem[0].display == "MVA" assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.summary == ( "provisional diagnoses of laceration of head and traumatic " "brain injury (TBI)" ) assert inst.text.status == "generated" def test_clinicalimpression_1(base_settings): """No. 1 tests collection for ClinicalImpression. Test File: clinicalimpression-example.json """ filename = base_settings["unittest_data_dir"] / "clinicalimpression-example.json" inst = clinicalimpression.ClinicalImpression.model_validate_json( filename.read_bytes() ) assert "ClinicalImpression" == inst.get_resource_type() impl_clinicalimpression_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ClinicalImpression" == data["resourceType"] inst2 = clinicalimpression.ClinicalImpression(**data) impl_clinicalimpression_1(inst2) ================================================ FILE: fhir/resources/tests/test_clinicalusedefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ClinicalUseDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import clinicalusedefinition from .conftest import ExternalValidatorModel def impl_clinicalusedefinition_1(inst): assert ( inst.contraindication.comorbidity[0].concept.coding[0].code == "Hepaticdisease" ) assert ( inst.contraindication.comorbidity[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/comorbidity"} ).valueUri ) assert ( inst.contraindication.diseaseSymptomProcedure.concept.coding[0].code == "Coagulopathiesandbleedingdiatheses(exclthrombocytopenic)" ) assert ( inst.contraindication.diseaseSymptomProcedure.concept.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://ema.europa.eu/example/contraindicationsasdisease-symptom-procedure" } ).valueUri ) assert inst.contraindication.diseaseSymptomProcedure.concept.text == ( "Hepatic disease associated with coagulopathy and clinically " "relevant bleeding risk" ) assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" assert inst.type == "contraindication" def test_clinicalusedefinition_1(base_settings): """No. 1 tests collection for ClinicalUseDefinition. Test File: clinicalusedefinition-example.json """ filename = base_settings["unittest_data_dir"] / "clinicalusedefinition-example.json" inst = clinicalusedefinition.ClinicalUseDefinition.model_validate_json( filename.read_bytes() ) assert "ClinicalUseDefinition" == inst.get_resource_type() impl_clinicalusedefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ClinicalUseDefinition" == data["resourceType"] inst2 = clinicalusedefinition.ClinicalUseDefinition(**data) impl_clinicalusedefinition_1(inst2) ================================================ FILE: fhir/resources/tests/test_codesystem.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/CodeSystem Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import codesystem from .conftest import ExternalValidatorModel def impl_codesystem_1(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "source" assert inst.concept[0].definition == ( "This structure describes an instance passed to the mapping " "engine that is used a source of data." ) assert inst.concept[0].display == "Source Structure Definition" assert inst.concept[1].code == "queried" assert inst.concept[1].definition == ( "This structure describes an instance that the mapping engine" " may ask for that is used a source of data." ) assert inst.concept[1].display == "Queried Structure Definition" assert inst.concept[2].code == "target" assert inst.concept[2].definition == ( "This structure describes an instance passed to the mapping " "engine that is used a target of data." ) assert inst.concept[2].display == "Target Structure Definition" assert inst.concept[3].code == "produced" assert inst.concept[3].definition == ( "This structure describes an instance that the mapping engine" " may ask to create that is used a target of data." ) assert inst.concept[3].display == "Produced Structure Definition" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert inst.content == "complete" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-05T10:01:24+11:00"} ).valueDateTime ) assert inst.description == "How the referenced structure is used in this mapping." assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "fhir" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 2 assert inst.id == "map-model-mode" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.4.676" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[1].use == "old" assert inst.identifier[1].value == "urn:oid:2.16.840.1.113883.4.642.1.662" assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2023-03-26T15:21:02.749+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablecodesystem" ) assert inst.name == "StructureMapModelMode" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Structure Map Model Mode" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/map-model-mode"} ).valueUri ) assert inst.valueSet == "http://hl7.org/fhir/ValueSet/map-model-mode" assert inst.version == "5.0.0" def test_codesystem_1(base_settings): """No. 1 tests collection for CodeSystem. Test File: codesystem-map-model-mode.json """ filename = base_settings["unittest_data_dir"] / "codesystem-map-model-mode.json" inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_1(inst2) def impl_codesystem_2(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "medication" assert inst.concept[0].display == "Medication" assert inst.concept[1].code == "device" assert inst.concept[1].display == "Device" assert inst.concept[2].code == "intervention" assert inst.concept[2].display == "Intervention" assert inst.concept[3].code == "factor" assert inst.concept[3].display == "Factor" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert inst.content == "complete" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-15T16:55:11.085+11:00"} ).valueDateTime ) assert inst.description == "Codes for the main intent of the study." assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "brr" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 0 assert inst.id == "research-study-focus-type" assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2023-03-26T15:21:02.749+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablecodesystem" ) assert inst.name == "ResearchStudyFocusType" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "ResearchStudy Focus Type Code System" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/research-study-focus-type"} ).valueUri ) assert inst.valueSet == "http://hl7.org/fhir/ValueSet/research-study-focus-type" assert inst.version == "5.0.0" def test_codesystem_2(base_settings): """No. 2 tests collection for CodeSystem. Test File: codesystem-research-study-focus-type.json """ filename = ( base_settings["unittest_data_dir"] / "codesystem-research-study-focus-type.json" ) inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_2(inst2) def impl_codesystem_3(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "grouped-by" assert inst.concept[0].display == "Grouped By" assert inst.concept[1].code == "is-a" assert inst.concept[1].display == "Is-A" assert inst.concept[2].code == "part-of" assert inst.concept[2].definition == ( "Child elements list the individual parts of a composite " "whole (e.g. body site)." ) assert inst.concept[2].display == "Part Of" assert inst.concept[3].code == "classified-with" assert inst.concept[3].display == "Classified With" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert inst.content == "complete" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-05T10:01:24+11:00"} ).valueDateTime ) assert ( inst.description == "The meaning of the hierarchy of concepts in a code system." ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "vocab" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "normative" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version" } ).valueUri ) assert inst.extension[2].valueCode == "4.0.0" assert ( inst.extension[3].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[3].valueInteger == 5 assert inst.id == "codesystem-hierarchy-meaning" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.4.785" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[1].use == "old" assert inst.identifier[1].value == "urn:oid:2.16.840.1.113883.4.642.1.768" assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2023-03-26T15:21:02.749+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablecodesystem" ) assert inst.name == "CodeSystemHierarchyMeaning" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Code System Hierarchy Meaning" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/codesystem-hierarchy-meaning"} ).valueUri ) assert inst.valueSet == "http://hl7.org/fhir/ValueSet/codesystem-hierarchy-meaning" assert inst.version == "5.0.0" def test_codesystem_3(base_settings): """No. 3 tests collection for CodeSystem. Test File: codesystem-codesystem-hierarchy-meaning.json """ filename = ( base_settings["unittest_data_dir"] / "codesystem-codesystem-hierarchy-meaning.json" ) inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_3(inst2) def impl_codesystem_4(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "create" assert inst.concept[0].definition == ( "create(type : string) - type is passed through to the " "application on the standard API, and must be known by it." ) assert inst.concept[0].display == "create" assert inst.concept[0].property[0].code == "fhirpath" assert inst.concept[0].property[0].valueString == "n/a" assert inst.concept[1].code == "copy" assert inst.concept[1].definition == "copy(source)." assert inst.concept[1].display == "copy" assert inst.concept[1].property[0].code == "fhirpath" assert inst.concept[1].property[0].valueString == "n/a" assert inst.concept[2].code == "truncate" assert ( inst.concept[2].definition == "truncate(source, length) - source must be stringy type." ) assert inst.concept[2].display == "truncate" assert inst.concept[2].property[0].code == "fhirpath" assert inst.concept[2].property[0].valueString == "substring" assert inst.concept[3].code == "escape" assert inst.concept[3].definition == ( "escape(source, fmt1, fmt2) - change source from one kind of " "escaping to another (plain, java, xml, json). note that this" " is for when the string itself is escaped." ) assert inst.concept[3].display == "escape" assert inst.concept[3].property[0].code == "fhirpath" assert inst.concept[3].property[0].valueString == "n/a" assert inst.concept[4].code == "cast" assert inst.concept[4].display == "cast" assert inst.concept[4].property[0].code == "fhirpath" assert inst.concept[4].property[0].valueString == "n/a" assert inst.concept[5].code == "append" assert ( inst.concept[5].definition == "append(source...) - source is element or string." ) assert inst.concept[5].display == "append" assert inst.concept[5].property[0].code == "fhirpath" assert inst.concept[5].property[0].valueString == "& (String concatenation)" assert inst.concept[6].code == "translate" assert ( inst.concept[6].definition == "translate(source, uri_of_map) - use the translate operation." ) assert inst.concept[6].display == "translate" assert inst.concept[6].property[0].code == "fhirpath" assert inst.concept[6].property[0].valueString == "%terminologies.translate()" assert inst.concept[7].code == "reference" assert inst.concept[7].definition == ( "reference(source : object) - return a string that references" " the provided tree properly." ) assert inst.concept[7].display == "reference" assert inst.concept[7].property[0].code == "fhirpath" assert ( inst.concept[7].property[0].valueString == "related to resolve() but returns the string pointer" ) assert inst.concept[8].code == "dateOp" assert ( inst.concept[8].definition == "Perform a date operation. *Parameters to be documented*." ) assert inst.concept[8].display == "dateOp" assert inst.concept[8].property[0].code == "fhirpath" assert inst.concept[8].property[0].valueString == "n/a" assert inst.concept[9].code == "uuid" assert ( inst.concept[9].definition == "Generate a random UUID (in lowercase). No Parameters." ) assert inst.concept[9].display == "uuid" assert inst.concept[9].property[0].code == "fhirpath" assert inst.concept[9].property[0].valueString == "n/a" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert inst.content == "complete" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-05T10:01:24+11:00"} ).valueDateTime ) assert inst.description == "How data is copied/created." assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "fhir" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 2 assert inst.id == "map-transform" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.4.682" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[1].use == "old" assert inst.identifier[1].value == "urn:oid:2.16.840.1.113883.4.642.1.668" assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2023-03-26T15:21:02.749+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablecodesystem" ) assert inst.name == "StructureMapTransform" assert inst.property[0].code == "fhirpath" assert inst.property[0].description == "FHIRPath equivalent for transform function" assert inst.property[0].type == "string" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Structure Map Transform" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/map-transform"} ).valueUri ) assert inst.valueSet == "http://hl7.org/fhir/ValueSet/map-transform" assert inst.version == "5.0.0" def test_codesystem_4(base_settings): """No. 4 tests collection for CodeSystem. Test File: codesystem-map-transform.json """ filename = base_settings["unittest_data_dir"] / "codesystem-map-transform.json" inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_4(inst2) def impl_codesystem_5(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "contraindicated-only-with" assert ( inst.concept[0].definition == "Only contraindicated if the other therapy is given" ) assert ( inst.concept[0].display == "Only contraindicated if the other therapy is given" ) assert inst.concept[1].code == "contraindicated-except-with" assert ( inst.concept[1].definition == "Contraindicated unless the other therapy is given" ) assert ( inst.concept[1].display == "Contraindicated unless the other therapy is given" ) assert inst.concept[2].code == "indicated-only-with" assert inst.concept[2].definition == ( "Indicated only when the other therapy is given (co-" "occurrent)" ) assert inst.concept[2].display == ( "Indicated only when the other therapy is given (co-" "occurrent)" ) assert inst.concept[3].code == "indicated-except-with" assert ( inst.concept[3].definition == "Indicated except when the other therapy is given" ) assert inst.concept[3].display == "Indicated except when the other therapy is given" assert inst.concept[4].code == "indicated-only-after" assert inst.concept[4].definition == ( "Indicated only if the other therapy is planned to be given " "afterwards (prep)" ) assert inst.concept[4].display == ( "Indicated only if the other therapy is planned to be given " "afterwards (prep)" ) assert inst.concept[5].code == "indicated-only-before" assert inst.concept[5].definition == ( "Indicated only if the other therapy was given before " "(follow-up)" ) assert inst.concept[5].display == ( "Indicated only if the other therapy was given before " "(follow-up)" ) assert inst.concept[6].code == "replace-other-therapy" assert inst.concept[6].definition == "Indicated to replace the other therapy" assert inst.concept[6].display == "Indicated to replace the other therapy" assert inst.concept[7].code == "replace-other-therapy-contraindicated" assert ( inst.concept[7].definition == "Indicated to replace the other contraindicated therapy." ) assert ( inst.concept[7].display == "Indicated to replace the other contraindicated therapy" ) assert inst.concept[8].code == "replace-other-therapy-not-tolerated" assert inst.concept[8].definition == ( "Indicated to replace the other therapy not well tolerated by" " patient" ) assert inst.concept[8].display == ( "Indicated to replace the other therapy not well tolerated by" " patient" ) assert inst.concept[9].code == "replace-other-therapy-not-effective" assert inst.concept[9].definition == ( "Indicated to replace the other therapy not effective on " "patient" ) assert inst.concept[9].display == ( "Indicated to replace the other therapy not effective on " "patient" ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert inst.content == "complete" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-08-15T16:55:11+11:00"} ).valueDateTime ) assert inst.description == ( "Classification of relationship between a therapy and a " "contraindication or an indication." ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "brr" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 1 assert inst.id == "therapy-relationship-type" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.4.1994" assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2023-03-26T15:21:02.749+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablecodesystem" ) assert inst.name == "TherapyRelationshipType" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Therapy Relationship Type" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/therapy-relationship-type"} ).valueUri ) assert inst.valueSet == "http://hl7.org/fhir/ValueSet/therapy-relationship-type" assert inst.version == "5.0.0" def test_codesystem_5(base_settings): """No. 5 tests collection for CodeSystem. Test File: codesystem-therapy-relationship-type.json """ filename = ( base_settings["unittest_data_dir"] / "codesystem-therapy-relationship-type.json" ) inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_5(inst2) def impl_codesystem_6(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "registered" assert inst.concept[0].definition == ( "The existence of the imaging study is registered, but there " "is nothing yet available." ) assert inst.concept[0].display == "Registered" assert inst.concept[1].code == "available" assert inst.concept[1].definition == ( "At least one instance has been associated with this imaging " "study." ) assert inst.concept[1].display == "Available" assert inst.concept[2].code == "cancelled" assert inst.concept[2].definition == ( "The imaging study is unavailable because the imaging study " "was not started or not completed (also sometimes called " '"aborted").' ) assert inst.concept[2].display == "Cancelled" assert inst.concept[3].code == "entered-in-error" assert inst.concept[3].display == "Entered in Error" assert inst.concept[4].code == "unknown" assert inst.concept[4].display == "Unknown" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert inst.content == "complete" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-05T10:01:24+11:00"} ).valueDateTime ) assert inst.description == "The status of the ImagingStudy." assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "ii" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 4 assert inst.id == "imagingstudy-status" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.4.991" assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2023-03-26T15:21:02.749+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablecodesystem" ) assert inst.name == "ImagingStudyStatus" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Imaging Study Status" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/imagingstudy-status"} ).valueUri ) assert inst.valueSet == "http://hl7.org/fhir/ValueSet/imagingstudy-status" assert inst.version == "5.0.0" def test_codesystem_6(base_settings): """No. 6 tests collection for CodeSystem. Test File: codesystem-imagingstudy-status.json """ filename = ( base_settings["unittest_data_dir"] / "codesystem-imagingstudy-status.json" ) inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_6(inst2) def impl_codesystem_7(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "medication" assert inst.concept[0].definition == "Medication Catalog." assert inst.concept[0].display == "Medication Catalog" assert inst.concept[1].code == "device" assert inst.concept[1].definition == "Device Catalog." assert inst.concept[1].display == "Device Catalog" assert inst.concept[2].code == "protocol" assert inst.concept[2].definition == "Protocol List." assert inst.concept[2].display == "Protocol List" assert inst.content == "complete" assert inst.description == "CatalogType" assert inst.experimental is True assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "sd" assert inst.id == "catalogType" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.4.2013" assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2023-03-26T15:21:02.749+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablecodesystem" ) assert inst.name == "CatalogType" assert inst.publisher == "HL7 International" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Catalog Type" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/catalogType"} ).valueUri ) assert inst.version == "5.0.0" def test_codesystem_7(base_settings): """No. 7 tests collection for CodeSystem. Test File: codesystem-catalogType.json """ filename = base_settings["unittest_data_dir"] / "codesystem-catalogType.json" inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_7(inst2) def impl_codesystem_8(inst): assert inst.caseSensitive is True assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert inst.content == "complete" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.description == ( "One of the message events defined as part of this version of" " FHIR." ) assert inst.experimental is True assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/valueset-special-status" } ).valueUri ) assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[1].valueCode == "inm" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[2].valueCode == "draft" assert ( inst.extension[3].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[3].valueInteger == 1 assert inst.id == "message-events" assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2023-03-26T15:21:02.749+11:00"} ).valueInstant ) assert inst.name == "MessageEvent" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "MessageEvent" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/message-events"} ).valueUri ) assert inst.version == "5.0.0" def test_codesystem_8(base_settings): """No. 8 tests collection for CodeSystem. Test File: codesystem-message-events.json """ filename = base_settings["unittest_data_dir"] / "codesystem-message-events.json" inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_8(inst2) def impl_codesystem_9(inst): assert inst.caseSensitive is True assert inst.concept[0].code == "100000072072" assert inst.concept[0].display == "Active" assert inst.concept[1].code == "100000072073" assert inst.concept[1].display == "Adjuvant" assert inst.concept[2].code == "100000072082" assert inst.concept[2].display == "Excipient" assert inst.concept[3].code == "100000136065" assert inst.concept[3].display == "Starting material for excipient" assert inst.concept[4].code == "100000136066" assert inst.concept[4].display == "Solvent / Diluent" assert inst.concept[5].code == "100000136178" assert ( inst.concept[5].display == "Raw materials used in the manufacture of the product" ) assert inst.concept[6].code == "100000136179" assert inst.concept[6].display == "Starting material for active substance" assert inst.concept[7].code == "100000136561" assert inst.concept[7].display == "Overage" assert inst.concept[8].code == "200000003427" assert inst.concept[8].display == "bioenhancer" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert inst.content == "complete" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-05T10:01:24+11:00"} ).valueDateTime ) assert inst.description == ( "A classification of the ingredient identifying its purpose " "within the product, e.g. active, inactive." ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "brr" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 1 assert inst.id == "ingredient-role" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.4.2080" assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2023-03-26T15:21:02.749+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablecodesystem" ) assert inst.name == "IngredientRole" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Ingredient Role" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ingredient-role"} ).valueUri ) assert inst.valueSet == "http://hl7.org/fhir/ValueSet/ingredient-role" assert inst.version == "5.0.0" def test_codesystem_9(base_settings): """No. 9 tests collection for CodeSystem. Test File: codesystem-ingredient-role.json """ filename = base_settings["unittest_data_dir"] / "codesystem-ingredient-role.json" inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_9(inst2) def impl_codesystem_10(inst): assert inst.caseSensitive is False assert inst.concept[0].code == "aliceblue" assert inst.concept[0].display == "aliceblue" assert inst.concept[0].property[0].code == "rgb" assert inst.concept[0].property[0].valueString == "#F0F8FF" assert inst.concept[1].code == "antiquewhite" assert inst.concept[1].display == "antiquewhite" assert inst.concept[1].property[0].code == "rgb" assert inst.concept[1].property[0].valueString == "#FAEBD7" assert inst.concept[2].code == "aqua" assert inst.concept[2].display == "aqua" assert inst.concept[2].property[0].code == "rgb" assert inst.concept[2].property[0].valueString == "#00FFFF" assert inst.concept[3].code == "aquamarine" assert inst.concept[3].display == "aquamarine" assert inst.concept[3].property[0].code == "rgb" assert inst.concept[3].property[0].valueString == "#7FFFD4" assert inst.concept[4].code == "azure" assert inst.concept[4].display == "azure" assert inst.concept[4].property[0].code == "rgb" assert inst.concept[4].property[0].valueString == "#F0FFFF" assert inst.concept[5].code == "beige" assert inst.concept[5].display == "beige" assert inst.concept[5].property[0].code == "rgb" assert inst.concept[5].property[0].valueString == "#F5F5DC" assert inst.concept[6].code == "bisque" assert inst.concept[6].display == "bisque" assert inst.concept[6].property[0].code == "rgb" assert inst.concept[6].property[0].valueString == "#FFE4C4" assert inst.concept[7].code == "black" assert inst.concept[7].display == "black" assert inst.concept[7].property[0].code == "rgb" assert inst.concept[7].property[0].valueString == "#000000" assert inst.concept[8].code == "blanchedalmond" assert inst.concept[8].display == "blanchedalmond" assert inst.concept[8].property[0].code == "rgb" assert inst.concept[8].property[0].valueString == "#FFEBCD" assert inst.concept[9].code == "blue" assert inst.concept[9].display == "blue" assert inst.concept[9].property[0].code == "rgb" assert inst.concept[9].property[0].valueString == "#0000FF" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.content == "complete" assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "fhir" assert inst.id == "color-names" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.4.2120" assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2023-03-26T15:21:02.749+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablecodesystem" ) assert inst.name == "ColorCodes" assert inst.property[0].code == "rgb" assert inst.property[0].description == ( "The RGB color that matches the named color (as defined in " "CSS4 specification)" ) assert inst.property[0].type == "string" assert inst.publisher == "FHIR Infrastructure" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Codes for Colors" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/color-names"} ).valueUri ) assert inst.version == "5.0.0" def test_codesystem_10(base_settings): """No. 10 tests collection for CodeSystem. Test File: codesystem-color-names.json """ filename = base_settings["unittest_data_dir"] / "codesystem-color-names.json" inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes()) assert "CodeSystem" == inst.get_resource_type() impl_codesystem_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CodeSystem" == data["resourceType"] inst2 = codesystem.CodeSystem(**data) impl_codesystem_10(inst2) ================================================ FILE: fhir/resources/tests/test_communication.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Communication Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import communication from .conftest import ExternalValidatorModel def impl_communication_1(inst): assert ( inst.about[0].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/claim"} ).valueUri ) assert inst.about[0].identifier.value == "12345" assert ( inst.about[1].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/claimresponse"} ).valueUri ) assert inst.about[1].identifier.value == "R3500" assert inst.category[0].coding[0].code == "SolicitedAttachment" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org/messagetypes"} ).valueUri ) assert inst.id == "fm-attachment" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.providerco.com/communication"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.payload[0].contentAttachment.contentType == "application/pdf" assert ( inst.payload[0].contentAttachment.creation == ExternalValidatorModel.model_validate( {"valueDateTime": "2010-02-01T11:50:23-05:00"} ).valueDateTime ) assert ( inst.payload[0].contentAttachment.data == ExternalValidatorModel.model_validate( {"valueBase64Binary": "SGVsbG8="} ).valueBase64Binary ) assert inst.payload[0].contentAttachment.title == "accident notes 20100201.pdf" assert inst.payload[1].contentAttachment.contentType == "application/pdf" assert ( inst.payload[1].contentAttachment.creation == ExternalValidatorModel.model_validate( {"valueDateTime": "2010-02-01T10:57:34+01:00"} ).valueDateTime ) assert ( inst.payload[1].contentAttachment.hash == ExternalValidatorModel.model_validate( {"valueBase64Binary": "SGVsbG8gdGhlcmU="} ).valueBase64Binary ) # Don't know how to create unit test # for "payload[1].contentAttachment.size", # which is a Integer64 assert ( inst.payload[1].contentAttachment.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://example.org/docs/AB12345"} ).valueUrl ) assert ( inst.recipient[0].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.jurisdiction.com/insurer"} ).valueUri ) assert inst.recipient[0].identifier.value == "123456" assert ( inst.sender.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.jurisdiction.com/provideroffices"} ).valueUri ) assert inst.sender.identifier.value == "3456" assert ( inst.sent == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-06-12T18:01:10-08:00"} ).valueDateTime ) assert inst.status == "completed" assert inst.subject.reference == "Patient/1" assert inst.text.div == ( '
Attachment which' " is unsolicited
" ) assert inst.text.status == "generated" def test_communication_1(base_settings): """No. 1 tests collection for Communication. Test File: communication-example-fm-attachment.json """ filename = ( base_settings["unittest_data_dir"] / "communication-example-fm-attachment.json" ) inst = communication.Communication.model_validate_json(filename.read_bytes()) assert "Communication" == inst.get_resource_type() impl_communication_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Communication" == data["resourceType"] inst2 = communication.Communication(**data) impl_communication_1(inst2) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org/messagetypes"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://www.providerco.com/communication"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.payload[0].contentAttachment.contentType == "application/pdf" assert ( inst.payload[0].contentAttachment.creation == ExternalValidatorModel.model_validate( {"valueDateTime": "2010-02-01T11:50:23-05:00"} ).valueDateTime ) assert ( inst.payload[0].contentAttachment.data == ExternalValidatorModel.model_validate( {"valueBase64Binary": "SGVsbG8="} ).valueBase64Binary ) assert inst.payload[0].contentAttachment.title == "accident notes 20100201.pdf" assert inst.payload[1].contentAttachment.contentType == "application/pdf" assert ( inst.payload[1].contentAttachment.creation == ExternalValidatorModel.model_validate( {"valueDateTime": "2010-02-01T10:57:34+01:00"} ).valueDateTime ) assert ( inst.payload[1].contentAttachment.hash == ExternalValidatorModel.model_validate( {"valueBase64Binary": "SGVsbG8gdGhlcmU="} ).valueBase64Binary ) # Don't know how to create unit test # for "payload[1].contentAttachment.size", # which is a Integer64 assert ( inst.payload[1].contentAttachment.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://happyvalley.com/docs/AB12345"} ).valueUrl ) assert inst.recipient[0].reference == "#payor" assert inst.sender.reference == "#provider" assert ( inst.sent == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-06-12T18:01:10-08:00"} ).valueDateTime ) assert inst.status == "completed" assert inst.subject.reference == "Patient/1" assert inst.text.div == ( '
Attachment in ' "response to a Request
" ) assert inst.text.status == "generated" def test_communication_2(base_settings): """No. 2 tests collection for Communication. Test File: communication-example-fm-solicited-attachment.json """ filename = ( base_settings["unittest_data_dir"] / "communication-example-fm-solicited-attachment.json" ) inst = communication.Communication.model_validate_json(filename.read_bytes()) assert "Communication" == inst.get_resource_type() impl_communication_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Communication" == data["resourceType"] inst2 = communication.Communication(**data) impl_communication_2(inst2) def impl_communication_3(inst): assert inst.category[0].coding[0].code == "Alert" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org/messagetypes"} ).valueUri ) assert inst.category[0].text == "Alert" assert inst.encounter.reference == "Encounter/example" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.3.4.5.6.7"} ).valueUri ) assert inst.identifier[0].type.text == "Paging System" assert inst.identifier[0].value == "2345678901" assert ( inst.instantiatesUri[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/hyperkalemia"} ).valueUri ) assert inst.medium[0].coding[0].code == "WRITTEN" assert inst.medium[0].coding[0].display == "written" assert ( inst.medium[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationMode"} ).valueUri ) assert inst.medium[0].text == "written" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.partOf[0].display == "Serum Potassium Observation" assert inst.payload[0].contentCodeableConcept.text == ( "Patient 1 has a very high serum potassium value (7.2 mmol/L " "on 2014-Dec-12 at 5:55 pm)" ) assert inst.payload[1].contentReference.display == "Serum Potassium Observation" assert ( inst.received == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-12-12T18:01:11-08:00"} ).valueDateTime ) assert inst.recipient[0].reference == "Practitioner/example" assert inst.sender.reference == "Device/f001" assert ( inst.sent == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-12-12T18:01:10-08:00"} ).valueDateTime ) assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Patient has very' " high serum potassium
" ) assert inst.text.status == "generated" def test_communication_3(base_settings): """No. 3 tests collection for Communication. Test File: communication-example.json """ filename = base_settings["unittest_data_dir"] / "communication-example.json" inst = communication.Communication.model_validate_json(filename.read_bytes()) assert "Communication" == inst.get_resource_type() impl_communication_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Communication" == data["resourceType"] inst2 = communication.Communication(**data) impl_communication_3(inst2) ================================================ FILE: fhir/resources/tests/test_communicationrequest.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/CommunicationRequest Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import communicationrequest from .conftest import ExternalValidatorModel def impl_communicationrequest_1(inst): assert inst.encounter.reference == "Encounter/example" assert inst.id == "example" assert inst.intent == "proposal" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "active" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
To be filled out' " at a later time
" ) assert inst.text.status == "generated" def test_communicationrequest_1(base_settings): """No. 1 tests collection for CommunicationRequest. Test File: communicationrequest-example.json """ filename = base_settings["unittest_data_dir"] / "communicationrequest-example.json" inst = communicationrequest.CommunicationRequest.model_validate_json( filename.read_bytes() ) assert "CommunicationRequest" == inst.get_resource_type() impl_communicationrequest_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CommunicationRequest" == data["resourceType"] inst2 = communicationrequest.CommunicationRequest(**data) impl_communicationrequest_1(inst2) def impl_communicationrequest_2(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-06-10T11:01:10-08:00"} ).valueDateTime ) assert inst.basedOn[0].display == "EligibilityRequest" assert inst.category[0].coding[0].code == "SolicitedAttachmentRequest" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org/messagetypes"} ).valueUri ) assert inst.contained[0].id == "provider" assert inst.contained[1].id == "payor" assert inst.contained[2].id == "requester" assert inst.encounter.reference == "Encounter/example" assert inst.groupIdentifier.value == "12345" assert inst.id == "fm-solicit" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.jurisdiction.com/insurer/123456"} ).valueUri ) assert inst.identifier[0].value == "ABC123" assert inst.informationProvider[0].reference == "#payor" assert inst.intent == "proposal" assert inst.medium[0].coding[0].code == "WRITTEN" assert inst.medium[0].coding[0].display == "written" assert ( inst.medium[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationMode"} ).valueUri ) assert inst.medium[0].text == "written" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-06-10T11:01:10-08:00"} ).valueDateTime ) assert inst.payload[0].contentCodeableConcept.text == ( "Please provide the accident report and any associated " "pictures to support your Claim# DEF5647." ) assert inst.priority == "routine" assert inst.recipient[0].reference == "#provider" assert inst.replaces[0].display == "prior CommunicationRequest" assert inst.requester.reference == "#requester" assert inst.status == "active" assert inst.text.div == ( '
Request for ' "Accident Report
" ) assert inst.text.status == "generated" def test_communicationrequest_2(base_settings): """No. 2 tests collection for CommunicationRequest. Test File: communicationrequest-example-fm-solicit-attachment.json """ filename = ( base_settings["unittest_data_dir"] / "communicationrequest-example-fm-solicit-attachment.json" ) inst = communicationrequest.CommunicationRequest.model_validate_json( filename.read_bytes() ) assert "CommunicationRequest" == inst.get_resource_type() impl_communicationrequest_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CommunicationRequest" == data["resourceType"] inst2 = communicationrequest.CommunicationRequest(**data) impl_communicationrequest_2(inst2) ================================================ FILE: fhir/resources/tests/test_compartmentdefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/CompartmentDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import compartmentdefinition from .conftest import ExternalValidatorModel def impl_compartmentdefinition_1(inst): assert inst.code == "Device" assert inst.contact[0].name == "[string]" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-24"} ).valueDateTime ) assert inst.description == ( "The set of resources associated with a particular Device " "(example with Communication and CommunicationRequest " "resourses only)." ) assert inst.experimental is True assert inst.id == "example" assert inst.name == "EXAMPLE" assert inst.publisher == "Health Level Seven International (FHIR Infrastructure)" assert inst.purpose == ( "Provides an example of a FHIR compartment definition based " "on the Device resource type." ) assert inst.resource[0].code == "Communication" assert ( inst.resource[0].documentation == "The device used as the message sender and recipient" ) assert inst.resource[0].param[0] == "sender" assert inst.resource[0].param[1] == "recipient" assert inst.resource[1].code == "CommunicationRequest" assert ( inst.resource[1].documentation == "The device used as the message sender and recipient" ) assert inst.resource[1].param[0] == "sender" assert inst.resource[1].param[1] == "recipient" assert inst.search is True assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "E X A M P L E" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CompartmentDefinition/example"} ).valueUri ) assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "Device" assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/fhir-types"} ).valueUri ) def test_compartmentdefinition_1(base_settings): """No. 1 tests collection for CompartmentDefinition. Test File: compartmentdefinition-example.json """ filename = base_settings["unittest_data_dir"] / "compartmentdefinition-example.json" inst = compartmentdefinition.CompartmentDefinition.model_validate_json( filename.read_bytes() ) assert "CompartmentDefinition" == inst.get_resource_type() impl_compartmentdefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CompartmentDefinition" == data["resourceType"] inst2 = compartmentdefinition.CompartmentDefinition(**data) impl_compartmentdefinition_1(inst2) def impl_compartmentdefinition_2(inst): assert inst.code == "RelatedPerson" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "relatedPerson" assert inst.name == "Base FHIR compartment definition for RelatedPerson" assert inst.publisher == "FHIR Project Team" assert inst.resource[0].code == "Account" assert inst.resource[1].code == "ActivityDefinition" assert inst.resource[2].code == "ActorDefinition" assert inst.resource[3].code == "AdministrableProductDefinition" assert inst.resource[4].code == "AdverseEvent" assert inst.resource[4].param[0] == "recorder" assert inst.resource[5].code == "AllergyIntolerance" assert inst.resource[5].param[0] == "participant" assert inst.resource[6].code == "Appointment" assert inst.resource[6].param[0] == "actor" assert inst.resource[7].code == "AppointmentResponse" assert inst.resource[7].param[0] == "actor" assert inst.resource[8].code == "ArtifactAssessment" assert inst.resource[9].code == "AuditEvent" assert inst.search is True assert inst.status == "draft" assert inst.text.status == "extensions" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CompartmentDefinition/relatedPerson"} ).valueUri ) assert inst.version == "5.0.0" def test_compartmentdefinition_2(base_settings): """No. 2 tests collection for CompartmentDefinition. Test File: compartmentdefinition-relatedperson.json """ filename = ( base_settings["unittest_data_dir"] / "compartmentdefinition-relatedperson.json" ) inst = compartmentdefinition.CompartmentDefinition.model_validate_json( filename.read_bytes() ) assert "CompartmentDefinition" == inst.get_resource_type() impl_compartmentdefinition_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CompartmentDefinition" == data["resourceType"] inst2 = compartmentdefinition.CompartmentDefinition(**data) impl_compartmentdefinition_2(inst2) def impl_compartmentdefinition_3(inst): assert inst.code == "Patient" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "patient" assert inst.name == "Base FHIR compartment definition for Patient" assert inst.publisher == "FHIR Project Team" assert inst.resource[0].code == "Account" assert inst.resource[0].param[0] == "subject" assert inst.resource[1].code == "ActivityDefinition" assert inst.resource[2].code == "ActorDefinition" assert inst.resource[3].code == "AdministrableProductDefinition" assert inst.resource[4].code == "AdverseEvent" assert inst.resource[4].param[0] == "subject" assert inst.resource[5].code == "AllergyIntolerance" assert inst.resource[5].param[0] == "patient" assert inst.resource[5].param[1] == "participant" assert inst.resource[6].code == "Appointment" assert inst.resource[6].param[0] == "actor" assert inst.resource[7].code == "AppointmentResponse" assert inst.resource[7].param[0] == "actor" assert inst.resource[8].code == "ArtifactAssessment" assert inst.resource[9].code == "AuditEvent" assert inst.resource[9].param[0] == "patient" assert inst.search is True assert inst.status == "draft" assert inst.text.status == "extensions" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CompartmentDefinition/patient"} ).valueUri ) assert inst.version == "5.0.0" def test_compartmentdefinition_3(base_settings): """No. 3 tests collection for CompartmentDefinition. Test File: compartmentdefinition-patient.json """ filename = base_settings["unittest_data_dir"] / "compartmentdefinition-patient.json" inst = compartmentdefinition.CompartmentDefinition.model_validate_json( filename.read_bytes() ) assert "CompartmentDefinition" == inst.get_resource_type() impl_compartmentdefinition_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CompartmentDefinition" == data["resourceType"] inst2 = compartmentdefinition.CompartmentDefinition(**data) impl_compartmentdefinition_3(inst2) def impl_compartmentdefinition_4(inst): assert inst.code == "Practitioner" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "practitioner" assert inst.name == "Base FHIR compartment definition for Practitioner" assert inst.publisher == "FHIR Project Team" assert inst.resource[0].code == "Account" assert inst.resource[0].param[0] == "subject" assert inst.resource[1].code == "ActivityDefinition" assert inst.resource[2].code == "ActorDefinition" assert inst.resource[3].code == "AdministrableProductDefinition" assert inst.resource[4].code == "AdverseEvent" assert inst.resource[4].param[0] == "recorder" assert inst.resource[5].code == "AllergyIntolerance" assert inst.resource[5].param[0] == "participant" assert inst.resource[6].code == "Appointment" assert inst.resource[6].param[0] == "actor" assert inst.resource[7].code == "AppointmentResponse" assert inst.resource[7].param[0] == "actor" assert inst.resource[8].code == "ArtifactAssessment" assert inst.resource[9].code == "AuditEvent" assert inst.resource[9].param[0] == "agent" assert inst.search is True assert inst.status == "draft" assert inst.text.status == "extensions" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CompartmentDefinition/practitioner"} ).valueUri ) assert inst.version == "5.0.0" def test_compartmentdefinition_4(base_settings): """No. 4 tests collection for CompartmentDefinition. Test File: compartmentdefinition-practitioner.json """ filename = ( base_settings["unittest_data_dir"] / "compartmentdefinition-practitioner.json" ) inst = compartmentdefinition.CompartmentDefinition.model_validate_json( filename.read_bytes() ) assert "CompartmentDefinition" == inst.get_resource_type() impl_compartmentdefinition_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CompartmentDefinition" == data["resourceType"] inst2 = compartmentdefinition.CompartmentDefinition(**data) impl_compartmentdefinition_4(inst2) def impl_compartmentdefinition_5(inst): assert inst.code == "Encounter" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "encounter" assert inst.name == "Base FHIR compartment definition for Encounter" assert inst.publisher == "FHIR Project Team" assert inst.resource[0].code == "Account" assert inst.resource[1].code == "ActivityDefinition" assert inst.resource[2].code == "ActorDefinition" assert inst.resource[3].code == "AdministrableProductDefinition" assert inst.resource[4].code == "AdverseEvent" assert inst.resource[5].code == "AllergyIntolerance" assert inst.resource[6].code == "Appointment" assert inst.resource[7].code == "AppointmentResponse" assert inst.resource[8].code == "ArtifactAssessment" assert inst.resource[9].code == "AuditEvent" assert inst.search is True assert inst.status == "draft" assert inst.text.status == "extensions" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CompartmentDefinition/encounter"} ).valueUri ) assert inst.version == "5.0.0" def test_compartmentdefinition_5(base_settings): """No. 5 tests collection for CompartmentDefinition. Test File: compartmentdefinition-encounter.json """ filename = ( base_settings["unittest_data_dir"] / "compartmentdefinition-encounter.json" ) inst = compartmentdefinition.CompartmentDefinition.model_validate_json( filename.read_bytes() ) assert "CompartmentDefinition" == inst.get_resource_type() impl_compartmentdefinition_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CompartmentDefinition" == data["resourceType"] inst2 = compartmentdefinition.CompartmentDefinition(**data) impl_compartmentdefinition_5(inst2) def impl_compartmentdefinition_6(inst): assert inst.code == "Device" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.description == ( "There is an instance of the device compartment for each " "Device resource, and the identity of the compartment is the " "same as the Device. The set of resources associated with a " "particular device" ) assert inst.experimental is True assert inst.id == "device" assert inst.name == "Base FHIR compartment definition for Device" assert inst.publisher == "FHIR Project Team" assert inst.resource[0].code == "Account" assert inst.resource[0].param[0] == "subject" assert inst.resource[1].code == "ActivityDefinition" assert inst.resource[2].code == "ActorDefinition" assert inst.resource[3].code == "AdministrableProductDefinition" assert inst.resource[4].code == "AdverseEvent" assert inst.resource[5].code == "AllergyIntolerance" assert inst.resource[6].code == "Appointment" assert inst.resource[6].param[0] == "actor" assert inst.resource[7].code == "AppointmentResponse" assert inst.resource[7].param[0] == "actor" assert inst.resource[8].code == "ArtifactAssessment" assert inst.resource[9].code == "AuditEvent" assert inst.resource[9].param[0] == "agent" assert inst.search is True assert inst.status == "draft" assert inst.text.status == "extensions" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CompartmentDefinition/device"} ).valueUri ) assert inst.version == "5.0.0" def test_compartmentdefinition_6(base_settings): """No. 6 tests collection for CompartmentDefinition. Test File: compartmentdefinition-device.json """ filename = base_settings["unittest_data_dir"] / "compartmentdefinition-device.json" inst = compartmentdefinition.CompartmentDefinition.model_validate_json( filename.read_bytes() ) assert "CompartmentDefinition" == inst.get_resource_type() impl_compartmentdefinition_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CompartmentDefinition" == data["resourceType"] inst2 = compartmentdefinition.CompartmentDefinition(**data) impl_compartmentdefinition_6(inst2) ================================================ FILE: fhir/resources/tests/test_composition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Composition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import composition from .conftest import ExternalValidatorModel def impl_composition_1(inst): assert inst.attester[0].mode.coding[0].code == "legal" assert inst.attester[0].mode.coding[0].display == "Legal" assert ( inst.attester[0].mode.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/composition-attestation-mode"} ).valueUri ) assert inst.attester[0].party.display == "Harold Hippocrates, MD" assert inst.attester[0].party.reference == "Practitioner/xcda-author" assert ( inst.attester[0].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-01-04T09:10:14Z"} ).valueDateTime ) assert inst.author[0].display == "Harold Hippocrates, MD" assert inst.author[0].reference == "Practitioner/xcda-author" assert inst.category[0].coding[0].code == "LP173421-1" assert inst.category[0].coding[0].display == "Report" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.custodian.display == "Good Health Clinic" assert inst.custodian.reference == "Organization/2.16.840.1.113883.19.5" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-30T16:56:04+11:00"} ).valueDateTime ) assert inst.id == "example-mixed" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.section[0].code.coding[0].code == "newborn" assert inst.section[0].code.coding[0].display == "New Born Details" assert ( inst.section[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org/codes/SectionType"} ).valueUri ) assert inst.section[0].text.status == "generated" assert inst.section[0].title == "Child's Details" assert inst.section[1].code.coding[0].code == "mother" assert inst.section[1].code.coding[0].display == "Mother's Details" assert ( inst.section[1].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org/codes/SectionType"} ).valueUri ) assert inst.section[1].text.status == "generated" assert inst.section[1].title == "Mpther's Details" assert inst.status == "final" assert inst.subject[0].display == "Tahlia Smith" assert inst.subject[0].reference == "Patient/newborn" assert inst.text.status == "generated" assert inst.title == "Discharge Summary (Neonatal Service)" assert inst.type.coding[0].code == "78418-1" assert ( inst.type.coding[0].display == "Neonatal perinatal medicine Discharge summary" ) assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) def test_composition_1(base_settings): """No. 1 tests collection for Composition. Test File: composition-example-mixed.json """ filename = base_settings["unittest_data_dir"] / "composition-example-mixed.json" inst = composition.Composition.model_validate_json(filename.read_bytes()) assert "Composition" == inst.get_resource_type() impl_composition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Composition" == data["resourceType"] inst2 = composition.Composition(**data) impl_composition_1(inst2) def impl_composition_2(inst): assert inst.attester[0].mode.coding[0].code == "legal" assert inst.attester[0].mode.coding[0].display == "Legal" assert ( inst.attester[0].mode.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/composition-attestation-mode"} ).valueUri ) assert inst.attester[0].party.display == "Harold Hippocrates, MD" assert inst.attester[0].party.reference == "Practitioner/xcda-author" assert ( inst.attester[0].time == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-01-04T09:10:14Z"} ).valueDateTime ) assert inst.author[0].display == "Harold Hippocrates, MD" assert inst.author[0].reference == "Practitioner/xcda-author" assert inst.category[0].coding[0].code == "LP173421-1" assert inst.category[0].coding[0].display == "Report" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.custodian.display == "Good Health Clinic" assert inst.custodian.reference == "Organization/2.16.840.1.113883.19.5" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-01-04T09:10:14Z"} ).valueDateTime ) assert inst.encounter.reference == "Encounter/xcda" assert inst.event[0].detail[0].concept.coding[0].code == "HEALTHREC" assert inst.event[0].detail[0].concept.coding[0].display == "health record" assert ( inst.event[0].detail[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.event[0].detail[0].reference.reference == "Observation/example" assert ( inst.event[0].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-11-12"} ).valueDateTime ) assert ( inst.event[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2010-07-18"} ).valueDateTime ) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://healthintersections.com.au/test"} ).valueUri ) assert inst.identifier[0].value == "1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.relatesTo[0].resourceReference.reference == "Composition/old-example" assert inst.relatesTo[0].type == "replaces" assert ( inst.relatesTo[1].resourceReference.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/NamingSystem/document-ids"} ).valueUri ) assert inst.relatesTo[1].resourceReference.identifier.value == "ABC123" assert inst.relatesTo[1].type == "appends" assert inst.section[0].code.coding[0].code == "11348-0" assert inst.section[0].code.coding[0].display == "History of past illness Narrative" assert ( inst.section[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.section[0].entry[0].reference == "Condition/stroke" assert inst.section[0].entry[1].reference == "Condition/example" assert inst.section[0].entry[2].reference == "Condition/example2" assert inst.section[0].orderedBy.coding[0].code == "event-date" assert inst.section[0].orderedBy.coding[0].display == "Sorted by Event Date" assert ( inst.section[0].orderedBy.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/list-order"} ).valueUri ) assert inst.section[0].text.status == "generated" assert inst.section[0].title == "History of present illness" assert inst.section[1].code.coding[0].code == "10157-6" assert ( inst.section[1].code.coding[0].display == "History of family member diseases Narrative" ) assert ( inst.section[1].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.section[1].emptyReason.coding[0].code == "withheld" assert inst.section[1].emptyReason.coding[0].display == "Information Withheld" assert ( inst.section[1].emptyReason.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/list-empty-reason"} ).valueUri ) assert inst.section[1].text.status == "generated" assert inst.section[1].title == "History of family member diseases" assert inst.status == "final" assert inst.subject[0].display == "Henry Levin the 7th" assert inst.subject[0].reference == "Patient/xcda" assert inst.text.status == "generated" assert inst.title == "Consultation Note" assert inst.type.coding[0].code == "11488-4" assert inst.type.coding[0].display == "Consult note" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) def test_composition_2(base_settings): """No. 2 tests collection for Composition. Test File: composition-example.json """ filename = base_settings["unittest_data_dir"] / "composition-example.json" inst = composition.Composition.model_validate_json(filename.read_bytes()) assert "Composition" == inst.get_resource_type() impl_composition_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Composition" == data["resourceType"] inst2 = composition.Composition(**data) impl_composition_2(inst2) ================================================ FILE: fhir/resources/tests/test_conceptmap.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ConceptMap Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import conceptmap from .conftest import ExternalValidatorModel def impl_conceptmap_1(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.description == ( 'Canonical Mapping for "The lifecycle status of an ' 'artifact."' ) assert inst.experimental is False assert inst.group[0].element[0].code == "draft" assert inst.group[0].element[0].target[0].code == "draft" assert inst.group[0].element[0].target[0].relationship == "equivalent" assert inst.group[0].element[1].code == "active" assert inst.group[0].element[1].target[0].code == "active" assert inst.group[0].element[1].target[0].relationship == "equivalent" assert inst.group[0].element[2].code == "retired" assert inst.group[0].element[2].target[0].code == "inactive" assert inst.group[0].element[2].target[0].relationship == "equivalent" assert inst.group[0].element[3].code == "unknown" assert inst.group[0].element[3].target[0].code == "unknown" assert inst.group[0].element[3].target[0].relationship == "equivalent" assert inst.group[0].source == "http://hl7.org/fhir/publication-status" assert inst.group[0].target == "http://hl7.org/fhir/resource-status" assert inst.id == "sc-publication-status" assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert inst.name == "PublicationStatusCanonicalMap" assert inst.publisher == "HL7 (FHIR Project)" assert ( inst.sourceScopeCanonical == "http://hl7.org/fhir/ValueSet/publication-status" ) assert inst.status == "draft" assert inst.targetScopeCanonical == "http://hl7.org/fhir/ValueSet/resource-status" assert inst.text.status == "extensions" assert inst.title == 'Canonical Mapping for "PublicationStatus"' assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/sc-publication-status"} ).valueUri ) assert inst.version == "5.0.0" def test_conceptmap_1(base_settings): """No. 1 tests collection for ConceptMap. Test File: sc-valueset-publication-status.json """ filename = ( base_settings["unittest_data_dir"] / "sc-valueset-publication-status.json" ) inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_1(inst2) def impl_conceptmap_2(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.experimental is False assert inst.group[0].element[0].code == "home" assert inst.group[0].element[0].target[0].code == "H" assert inst.group[0].element[0].target[0].relationship == "equivalent" assert inst.group[0].element[1].code == "work" assert inst.group[0].element[1].target[0].code == "WP" assert inst.group[0].element[1].target[0].relationship == "equivalent" assert inst.group[0].element[2].code == "temp" assert inst.group[0].element[2].target[0].code == "TMP" assert inst.group[0].element[2].target[0].relationship == "equivalent" assert inst.group[0].element[3].code == "old" assert inst.group[0].element[3].target[0].code == "OLD" assert inst.group[0].element[3].target[0].comment == "Bad or Old" assert ( inst.group[0].element[3].target[0].relationship == "source-is-broader-than-target" ) assert inst.group[0].element[3].target[1].code == "BAD" assert inst.group[0].element[3].target[1].comment == "Bad or Old" assert ( inst.group[0].element[3].target[1].relationship == "source-is-broader-than-target" ) assert inst.group[0].source == "http://hl7.org/fhir/address-use" assert inst.group[0].target == "http://terminology.hl7.org/CodeSystem/v3-AddressUse" assert inst.id == "cm-address-use-v3" assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert inst.name == "v3.AddressUse" assert inst.publisher == "HL7 (FHIR Project)" assert inst.sourceScopeCanonical == "http://hl7.org/fhir/ValueSet/address-use" assert inst.status == "draft" assert ( inst.targetScopeCanonical == "http://terminology.hl7.org/ValueSet/v3-AddressUse" ) assert inst.text.status == "extensions" assert inst.title == "v3 map for AddressUse" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/cm-address-use-v3"} ).valueUri ) assert inst.version == "5.0.0" def test_conceptmap_2(base_settings): """No. 2 tests collection for ConceptMap. Test File: cm-address-use-v3.json """ filename = base_settings["unittest_data_dir"] / "cm-address-use-v3.json" inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_2(inst2) def impl_conceptmap_3(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.description == ( 'Canonical Mapping for "This value set includes Status ' 'codes."' ) assert inst.experimental is False assert inst.group[0].element[0].code == "entered-in-error" assert inst.group[0].element[0].target[0].code == "error" assert inst.group[0].element[0].target[0].relationship == "equivalent" assert inst.group[0].element[1].code == "draft" assert inst.group[0].element[1].target[0].code == "draft" assert inst.group[0].element[1].target[0].relationship == "equivalent" assert inst.group[0].element[2].code == "active" assert inst.group[0].element[2].target[0].code == "active" assert inst.group[0].element[2].target[0].relationship == "equivalent" assert inst.group[0].element[3].code == "cancelled" assert inst.group[0].element[3].target[0].code == "abandoned" assert inst.group[0].element[3].target[0].relationship == "equivalent" assert inst.group[0].source == "http://hl7.org/fhir/fm-status" assert inst.group[0].target == "http://hl7.org/fhir/resource-status" assert inst.id == "sc-fm-status" assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert inst.name == "FinancialResourceStatusCodesCanonicalMap" assert inst.publisher == "Financial Management" assert inst.sourceScopeCanonical == "http://hl7.org/fhir/ValueSet/fm-status" assert inst.status == "draft" assert inst.targetScopeCanonical == "http://hl7.org/fhir/ValueSet/resource-status" assert inst.text.status == "extensions" assert inst.title == 'Canonical Mapping for "Financial Resource Status Codes"' assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/sc-fm-status"} ).valueUri ) assert inst.version == "5.0.0" def test_conceptmap_3(base_settings): """No. 3 tests collection for ConceptMap. Test File: sc-valueset-fm-status.json """ filename = base_settings["unittest_data_dir"] / "sc-valueset-fm-status.json" inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_3(inst2) def impl_conceptmap_4(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.description == 'Canonical Mapping for "FormularyItem Status Codes"' assert inst.experimental is False assert inst.group[0].element[0].code == "entered-in-error" assert inst.group[0].element[0].target[0].code == "error" assert inst.group[0].element[0].target[0].relationship == "equivalent" assert inst.group[0].element[1].code == "active" assert inst.group[0].element[1].target[0].code == "active" assert inst.group[0].element[1].target[0].relationship == "equivalent" assert inst.group[0].element[2].code == "inactive" assert inst.group[0].element[2].target[0].code == "inactive" assert inst.group[0].element[2].target[0].relationship == "equivalent" assert inst.group[0].source == "http://hl7.org/fhir/CodeSystem/formularyitem-status" assert inst.group[0].target == "http://hl7.org/fhir/resource-status" assert inst.id == "sc-formularyitem-status" assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert inst.name == "FormularyItemStatusCodesCanonicalMap" assert inst.publisher == "FHIR Project team" assert ( inst.sourceScopeCanonical == "http://hl7.org/fhir/ValueSet/formularyitem-status" ) assert inst.status == "draft" assert inst.targetScopeCanonical == "http://hl7.org/fhir/ValueSet/resource-status" assert inst.text.status == "extensions" assert inst.title == 'Canonical Mapping for "FormularyItem Status Codes"' assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/sc-formularyitem-status"} ).valueUri ) assert inst.version == "5.0.0" def test_conceptmap_4(base_settings): """No. 4 tests collection for ConceptMap. Test File: sc-valueset-formularyitem-status.json """ filename = ( base_settings["unittest_data_dir"] / "sc-valueset-formularyitem-status.json" ) inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_4(inst2) def impl_conceptmap_5(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2020-12-24T21:13:15+00:00"} ).valueDateTime ) assert inst.description == "v3 map for CompositionStatus" assert inst.experimental is False assert inst.group[0].element[0].code == "preliminary" assert inst.group[0].element[0].target[0].code == "active" assert inst.group[0].element[0].target[0].relationship == "equivalent" assert inst.group[0].element[1].code == "final" assert inst.group[0].element[1].target[0].code == "completed" assert ( inst.group[0].element[1].target[0].relationship == "source-is-narrower-than-target" ) assert inst.group[0].element[2].code == "amended" assert inst.group[0].element[2].target[0].code == "completed" assert ( inst.group[0].element[2].target[0].relationship == "source-is-narrower-than-target" ) assert inst.group[0].element[3].code == "entered-in-error" assert inst.group[0].element[3].target[0].code == "nullified" assert inst.group[0].element[3].target[0].relationship == "equivalent" assert inst.group[0].source == "http://hl7.org/fhir/composition-status" assert inst.group[0].target == "http://terminology.hl7.org/CodeSystem/v3-ActStatus" assert inst.id == "cm-composition-status-v3" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.14.9" assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareableconceptmap" ) assert inst.name == "V3CompositionStatus" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.status == "extensions" assert inst.title == "v3 map for CompositionStatus" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/cm-composition-status-v3"} ).valueUri ) assert inst.version == "5.0.0" def test_conceptmap_5(base_settings): """No. 5 tests collection for ConceptMap. Test File: cm-composition-status-v3.json """ filename = base_settings["unittest_data_dir"] / "cm-composition-status-v3.json" inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_5(inst2) def impl_conceptmap_6(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2020-12-28T16:55:11+11:00"} ).valueDateTime ) assert inst.description == ( 'Canonical Mapping for "Indicates whether this flag is ' "active and needs to be displayed to a user, or whether it is" ' no longer needed or was entered in error."' ) assert inst.experimental is False assert inst.group[0].element[0].code == "entered-in-error" assert inst.group[0].element[0].target[0].code == "error" assert inst.group[0].element[0].target[0].relationship == "equivalent" assert inst.group[0].element[1].code == "active" assert inst.group[0].element[1].target[0].code == "active" assert inst.group[0].element[1].target[0].relationship == "equivalent" assert inst.group[0].element[2].code == "inactive" assert inst.group[0].element[2].target[0].code == "inactive" assert inst.group[0].element[2].target[0].relationship == "equivalent" assert inst.group[0].source == "http://hl7.org/fhir/flag-status" assert inst.group[0].target == "http://hl7.org/fhir/resource-status" assert inst.id == "sc-flag-status" assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert inst.name == "FlagStatusCanonicalMap" assert inst.publisher == "HL7 (FHIR Project)" assert inst.sourceScopeCanonical == "http://hl7.org/fhir/ValueSet/flag-status" assert inst.status == "draft" assert inst.targetScopeCanonical == "http://hl7.org/fhir/ValueSet/resource-status" assert inst.text.status == "extensions" assert inst.title == 'Canonical Mapping for "Flag Status"' assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/sc-flag-status"} ).valueUri ) assert inst.version == "5.0.0" def test_conceptmap_6(base_settings): """No. 6 tests collection for ConceptMap. Test File: sc-valueset-flag-status.json """ filename = base_settings["unittest_data_dir"] / "sc-valueset-flag-status.json" inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_6(inst2) def impl_conceptmap_7(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2020-12-28T16:55:11+11:00"} ).valueDateTime ) assert ( inst.description == 'Canonical Mapping for "The status of the Device record."' ) assert inst.experimental is False assert inst.group[0].element[0].code == "entered-in-error" assert inst.group[0].element[0].target[0].code == "error" assert inst.group[0].element[0].target[0].relationship == "equivalent" assert inst.group[0].element[1].code == "active" assert inst.group[0].element[1].target[0].code == "active" assert inst.group[0].element[1].target[0].relationship == "equivalent" assert inst.group[0].element[2].code == "inactive" assert inst.group[0].element[2].target[0].code == "inactive" assert inst.group[0].element[2].target[0].relationship == "equivalent" assert inst.group[0].source == "http://hl7.org/fhir/device-status" assert inst.group[0].target == "http://hl7.org/fhir/resource-status" assert inst.id == "sc-device-status" assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert inst.name == "FHIRDeviceStatusCanonicalMap" assert inst.publisher == "HL7 (FHIR Project)" assert inst.sourceScopeCanonical == "http://hl7.org/fhir/ValueSet/device-status" assert inst.status == "draft" assert inst.targetScopeCanonical == "http://hl7.org/fhir/ValueSet/resource-status" assert inst.text.status == "extensions" assert inst.title == 'Canonical Mapping for "FHIR Device Status"' assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/sc-device-status"} ).valueUri ) assert inst.version == "5.0.0" def test_conceptmap_7(base_settings): """No. 7 tests collection for ConceptMap. Test File: sc-valueset-device-status.json """ filename = base_settings["unittest_data_dir"] / "sc-valueset-device-status.json" inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_7(inst2) def impl_conceptmap_8(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.experimental is False assert inst.group[0].element[0].code == "home" assert inst.group[0].element[0].target[0].code == "PRN" assert ( inst.group[0].element[0].target[0].comment == "FHIR doesn't distinguish types of homes for contacts" ) assert ( inst.group[0].element[0].target[0].relationship == "source-is-broader-than-target" ) assert inst.group[0].element[0].target[1].code == "ORN" assert ( inst.group[0].element[0].target[1].comment == "FHIR doesn't distinguish types of homes for contacts" ) assert ( inst.group[0].element[0].target[1].relationship == "source-is-broader-than-target" ) assert inst.group[0].element[0].target[2].code == "VHN" assert ( inst.group[0].element[0].target[2].comment == "FHIR doesn't distinguish types of homes for contacts" ) assert ( inst.group[0].element[0].target[2].relationship == "source-is-broader-than-target" ) assert inst.group[0].element[1].code == "work" assert inst.group[0].element[1].target[0].code == "WPN" assert inst.group[0].element[1].target[0].relationship == "equivalent" assert inst.group[0].element[2].code == "mobile" assert inst.group[0].element[2].target[0].code == "PRS" assert inst.group[0].element[2].target[0].relationship == "equivalent" assert inst.group[0].source == "http://hl7.org/fhir/contact-point-use" assert inst.group[0].target == "http://terminology.hl7.org/CodeSystem/v2-0201" assert inst.id == "cm-contact-point-use-v2" assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert inst.name == "v2.ContactPointUse" assert inst.publisher == "HL7 (FHIR Project)" assert inst.sourceScopeCanonical == "http://hl7.org/fhir/ValueSet/contact-point-use" assert inst.status == "draft" assert inst.targetScopeCanonical == "http://terminology.hl7.org/ValueSet/v2-0201" assert inst.text.status == "extensions" assert inst.title == "v2 map for ContactPointUse" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/cm-contact-point-use-v2"} ).valueUri ) assert inst.version == "5.0.0" def test_conceptmap_8(base_settings): """No. 8 tests collection for ConceptMap. Test File: cm-contact-point-use-v2.json """ filename = base_settings["unittest_data_dir"] / "cm-contact-point-use-v2.json" inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_8(inst2) def impl_conceptmap_9(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.description == ( 'Canonical Mapping for "Preferred value set for ' 'AllergyIntolerance Clinical Status."' ) assert inst.experimental is False assert inst.group[0].element[0].code == "active" assert inst.group[0].element[0].target[0].code == "active" assert inst.group[0].element[0].target[0].relationship == "equivalent" assert inst.group[0].element[1].code == "inactive" assert inst.group[0].element[1].target[0].code == "inactive" assert inst.group[0].element[1].target[0].relationship == "equivalent" assert inst.group[0].element[2].code == "resolved" assert inst.group[0].element[2].target[0].code == "resolved" assert inst.group[0].element[2].target[0].relationship == "equivalent" assert inst.group[0].source == ( "http://terminology.hl7.org/CodeSystem/allergyintolerance-" "clinical" ) assert inst.group[0].target == "http://hl7.org/fhir/resource-status" assert inst.id == "sc-allergyintolerance-clinical" assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert inst.name == "AllergyIntoleranceClinicalStatusCodesCanonicalMap" assert inst.publisher == "FHIR Project team" assert ( inst.sourceScopeCanonical == "http://hl7.org/fhir/ValueSet/allergyintolerance-clinical" ) assert inst.status == "draft" assert inst.targetScopeCanonical == "http://hl7.org/fhir/ValueSet/resource-status" assert inst.text.status == "extensions" assert inst.title == ( 'Canonical Mapping for "AllergyIntolerance Clinical Status ' 'Codes"' ) assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/ConceptMap/sc-allergyintolerance-clinical" } ).valueUri ) assert inst.version == "5.0.0" def test_conceptmap_9(base_settings): """No. 9 tests collection for ConceptMap. Test File: sc-valueset-allergyintolerance-clinical.json """ filename = ( base_settings["unittest_data_dir"] / "sc-valueset-allergyintolerance-clinical.json" ) inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_9(inst2) def impl_conceptmap_10(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.description == 'Canonical Mapping for "Medication Status Codes"' assert inst.experimental is False assert inst.group[0].element[0].code == "entered-in-error" assert inst.group[0].element[0].target[0].code == "error" assert inst.group[0].element[0].target[0].relationship == "equivalent" assert inst.group[0].element[1].code == "active" assert inst.group[0].element[1].target[0].code == "active" assert inst.group[0].element[1].target[0].relationship == "equivalent" assert inst.group[0].element[2].code == "inactive" assert inst.group[0].element[2].target[0].code == "inactive" assert inst.group[0].element[2].target[0].relationship == "equivalent" assert inst.group[0].source == "http://hl7.org/fhir/CodeSystem/medication-status" assert inst.group[0].target == "http://hl7.org/fhir/resource-status" assert inst.id == "sc-medication-status" assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert inst.name == "MedicationStatusCodesCanonicalMap" assert inst.publisher == "FHIR Project team" assert inst.sourceScopeCanonical == "http://hl7.org/fhir/ValueSet/medication-status" assert inst.status == "draft" assert inst.targetScopeCanonical == "http://hl7.org/fhir/ValueSet/resource-status" assert inst.text.status == "extensions" assert inst.title == 'Canonical Mapping for "Medication Status Codes"' assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConceptMap/sc-medication-status"} ).valueUri ) assert inst.version == "5.0.0" def test_conceptmap_10(base_settings): """No. 10 tests collection for ConceptMap. Test File: sc-valueset-medication-status.json """ filename = base_settings["unittest_data_dir"] / "sc-valueset-medication-status.json" inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes()) assert "ConceptMap" == inst.get_resource_type() impl_conceptmap_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConceptMap" == data["resourceType"] inst2 = conceptmap.ConceptMap(**data) impl_conceptmap_10(inst2) ================================================ FILE: fhir/resources/tests/test_condition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Condition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import condition from .conftest import ExternalValidatorModel def impl_condition_1(inst): assert inst.bodySite[0].coding[0].code == "280193007" assert inst.bodySite[0].coding[0].display == "Entire retropharyngeal area" assert ( inst.bodySite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].coding[0].code == "439401001" assert inst.category[0].coding[0].display == "diagnosis" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.clinicalStatus.coding[0].code == "active" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-clinical"} ).valueUri ) assert inst.code.coding[0].code == "18099001" assert inst.code.coding[0].display == "Retropharyngeal abscess" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.encounter.reference == "Encounter/f003" assert inst.evidence[0].concept.coding[0].code == "169068008" assert inst.evidence[0].concept.coding[0].display == "CT of neck" assert ( inst.evidence[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "f003" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.onsetDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-02-27"} ).valueDateTime ) assert inst.participant[0].actor.display == "P. van de Heuvel" assert inst.participant[0].actor.reference == "Patient/f001" assert inst.participant[0].function.coding[0].code == "informant" assert inst.participant[0].function.coding[0].display == "Informant" assert ( inst.participant[0].function.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/provenance-participant-type" } ).valueUri ) assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-02-20"} ).valueDateTime ) assert inst.severity.coding[0].code == "371923003" assert inst.severity.coding[0].display == "Mild to moderate" assert ( inst.severity.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.subject.display == "P. van de Heuvel" assert inst.subject.reference == "Patient/f001" assert inst.text.status == "generated" assert inst.verificationStatus.coding[0].code == "confirmed" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-ver-status"} ).valueUri ) def test_condition_1(base_settings): """No. 1 tests collection for Condition. Test File: condition-example-f003-abscess.json """ filename = ( base_settings["unittest_data_dir"] / "condition-example-f003-abscess.json" ) inst = condition.Condition.model_validate_json(filename.read_bytes()) assert "Condition" == inst.get_resource_type() impl_condition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Condition" == data["resourceType"] inst2 = condition.Condition(**data) impl_condition_1(inst2) def impl_condition_2(inst): assert inst.bodySite[0].coding[0].code == "281158006" assert inst.bodySite[0].coding[0].display == "Pulmonary vascular structure" assert ( inst.bodySite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].coding[0].code == "55607006" assert inst.category[0].coding[0].display == "Problem" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].coding[1].code == "problem-list-item" assert ( inst.category[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-category"} ).valueUri ) assert inst.clinicalStatus.coding[0].code == "active" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-clinical"} ).valueUri ) assert inst.code.coding[0].code == "10001005" assert inst.code.coding[0].display == "Bacterial sepsis" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.encounter.display == "Roel's encounter on March elevanth" assert inst.encounter.reference == "Encounter/f203" assert inst.evidence[0].reference.display == "Diagnostic report for Roel's sepsis" assert inst.evidence[0].reference.reference == "DiagnosticReport/f202" assert inst.id == "f203" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.onsetDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-08"} ).valueDateTime ) assert inst.participant[0].actor.reference == "Practitioner/f201" assert inst.participant[0].function.coding[0].code == "author" assert inst.participant[0].function.coding[0].display == "Author" assert ( inst.participant[0].function.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/provenance-participant-type" } ).valueUri ) assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-11"} ).valueDateTime ) assert inst.severity.coding[0].code == "371924009" assert inst.severity.coding[0].display == "Moderate to severe" assert ( inst.severity.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" assert inst.verificationStatus.coding[0].code == "confirmed" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-ver-status"} ).valueUri ) def test_condition_2(base_settings): """No. 2 tests collection for Condition. Test File: condition-example-f203-sepsis.json """ filename = base_settings["unittest_data_dir"] / "condition-example-f203-sepsis.json" inst = condition.Condition.model_validate_json(filename.read_bytes()) assert "Condition" == inst.get_resource_type() impl_condition_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Condition" == data["resourceType"] inst2 = condition.Condition(**data) impl_condition_2(inst2) def impl_condition_3(inst): assert inst.category[0].coding[0].code == "encounter-diagnosis" assert inst.category[0].coding[0].display == "Encounter Diagnosis" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-category"} ).valueUri ) assert inst.clinicalStatus.coding[0].code == "active" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-clinical"} ).valueUri ) assert inst.code.coding[0].code == "422504002" assert inst.code.coding[0].display == "Ischemic stroke (disorder)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Stroke" assert inst.id == "stroke" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.onsetDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2010-07-18"} ).valueDateTime ) assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Ischemic stroke,' " July 18, 2010
" ) assert inst.text.status == "generated" assert inst.verificationStatus.coding[0].code == "confirmed" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-ver-status"} ).valueUri ) def test_condition_3(base_settings): """No. 3 tests collection for Condition. Test File: condition-example-stroke.json """ filename = base_settings["unittest_data_dir"] / "condition-example-stroke.json" inst = condition.Condition.model_validate_json(filename.read_bytes()) assert "Condition" == inst.get_resource_type() impl_condition_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Condition" == data["resourceType"] inst2 = condition.Condition(**data) impl_condition_3(inst2) def impl_condition_4(inst): assert inst.category[0].coding[0].code == "problem-list-item" assert inst.category[0].coding[0].display == "Problem List Item" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-category"} ).valueUri ) assert inst.clinicalStatus.coding[0].code == "active" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-clinical"} ).valueUri ) assert inst.code.coding[0].code == "312824007" assert inst.code.coding[0].display == "Family history of cancer of colon" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "family-history" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Family history ' "of cancer of colon
" ) assert inst.text.status == "generated" def test_condition_4(base_settings): """No. 4 tests collection for Condition. Test File: condition-example-family-history.json """ filename = ( base_settings["unittest_data_dir"] / "condition-example-family-history.json" ) inst = condition.Condition.model_validate_json(filename.read_bytes()) assert "Condition" == inst.get_resource_type() impl_condition_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Condition" == data["resourceType"] inst2 = condition.Condition(**data) impl_condition_4(inst2) def impl_condition_5(inst): assert inst.bodySite[0].coding[0].code == "51185008" assert inst.bodySite[0].coding[0].display == "Thorax" assert ( inst.bodySite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].coding[0].code == "439401001" assert inst.category[0].coding[0].display == "diagnosis" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.clinicalStatus.coding[0].code == "active" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-clinical"} ).valueUri ) assert inst.code.coding[0].code == "254637007" assert inst.code.coding[0].display == "NSCLC - Non-small cell lung cancer" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.encounter.reference == "Encounter/f002" assert inst.evidence[0].concept.coding[0].code == "169069000" assert inst.evidence[0].concept.coding[0].display == "CT of thorax" assert ( inst.evidence[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "f002" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.onsetDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2011-05-05"} ).valueDateTime ) assert inst.participant[0].actor.display == "P. van de Heuvel" assert inst.participant[0].actor.reference == "Patient/f001" assert inst.participant[0].function.coding[0].code == "informant" assert inst.participant[0].function.coding[0].display == "Informant" assert ( inst.participant[0].function.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/provenance-participant-type" } ).valueUri ) assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-06-03"} ).valueDateTime ) assert inst.severity.coding[0].code == "24484000" assert inst.severity.coding[0].display == "Severe" assert ( inst.severity.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.stage[0].summary.coding[0].code == "258219007" assert inst.stage[0].summary.coding[0].display == "stage II" assert ( inst.stage[0].summary.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.stage[0].type.coding[0].code == "260998006" assert inst.stage[0].type.coding[0].display == "Clinical staging (qualifier value)" assert ( inst.stage[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.subject.display == "P. van de Heuvel" assert inst.subject.reference == "Patient/f001" assert inst.text.status == "generated" assert inst.verificationStatus.coding[0].code == "confirmed" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-ver-status"} ).valueUri ) def test_condition_5(base_settings): """No. 5 tests collection for Condition. Test File: condition-example-f002-lung.json """ filename = base_settings["unittest_data_dir"] / "condition-example-f002-lung.json" inst = condition.Condition.model_validate_json(filename.read_bytes()) assert "Condition" == inst.get_resource_type() impl_condition_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Condition" == data["resourceType"] inst2 = condition.Condition(**data) impl_condition_5(inst2) def impl_condition_6(inst): assert inst.clinicalStatus.coding[0].code == "active" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-clinical"} ).valueUri ) assert inst.code.coding[0].code == "87628006" assert inst.code.coding[0].display == "Bacterial infectious disease" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "f205" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].actor.reference == "Practitioner/f201" assert inst.participant[0].function.coding[0].code == "author" assert inst.participant[0].function.coding[0].display == "Author" assert ( inst.participant[0].function.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/provenance-participant-type" } ).valueUri ) assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-04-04"} ).valueDateTime ) assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" assert inst.verificationStatus.coding[0].code == "differential" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-ver-status"} ).valueUri ) def test_condition_6(base_settings): """No. 6 tests collection for Condition. Test File: condition-example-f205-infection.json """ filename = ( base_settings["unittest_data_dir"] / "condition-example-f205-infection.json" ) inst = condition.Condition.model_validate_json(filename.read_bytes()) assert "Condition" == inst.get_resource_type() impl_condition_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Condition" == data["resourceType"] inst2 = condition.Condition(**data) impl_condition_6(inst2) def impl_condition_7(inst): assert ( inst.abatementDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-20"} ).valueDateTime ) assert inst.bodySite[0].coding[0].code == "181414000" assert inst.bodySite[0].coding[0].display == "Kidney" assert ( inst.bodySite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].coding[0].code == "55607006" assert inst.category[0].coding[0].display == "Problem" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].coding[1].code == "problem-list-item" assert ( inst.category[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-category"} ).valueUri ) assert inst.clinicalStatus.coding[0].code == "inactive" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-clinical"} ).valueUri ) assert inst.code.coding[0].code == "36225005" assert ( inst.code.coding[0].display == "Acute renal insufficiency specified as due to procedure" ) assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.encounter.display == "Roel's encounter on March elevanth" assert inst.encounter.reference == "Encounter/f203" assert inst.id == "f204" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "The patient is anuric." assert ( inst.onsetDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-11"} ).valueDateTime ) assert inst.participant[0].actor.reference == "Practitioner/f201" assert inst.participant[0].function.coding[0].code == "author" assert inst.participant[0].function.coding[0].display == "Author" assert ( inst.participant[0].function.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/provenance-participant-type" } ).valueUri ) assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-11"} ).valueDateTime ) assert inst.severity.coding[0].code == "24484000" assert inst.severity.coding[0].display == "Severe" assert ( inst.severity.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.stage[0].assessment[0].display == "Genetic analysis master panel" assert inst.stage[0].summary.coding[0].code == "14803004" assert inst.stage[0].summary.coding[0].display == "Temporary" assert ( inst.stage[0].summary.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" assert inst.verificationStatus.coding[0].code == "differential" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-ver-status"} ).valueUri ) def test_condition_7(base_settings): """No. 7 tests collection for Condition. Test File: condition-example-f204-renal.json """ filename = base_settings["unittest_data_dir"] / "condition-example-f204-renal.json" inst = condition.Condition.model_validate_json(filename.read_bytes()) assert "Condition" == inst.get_resource_type() impl_condition_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Condition" == data["resourceType"] inst2 = condition.Condition(**data) impl_condition_7(inst2) def impl_condition_8(inst): assert inst.category[0].coding[0].code == "problem-list-item" assert inst.category[0].coding[0].display == "Problem List Item" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-category"} ).valueUri ) assert inst.clinicalStatus.coding[0].code == "active" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-clinical"} ).valueUri ) assert inst.code.text == "Asthma" assert inst.id == "example2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.onsetString == "approximately November 2012" assert inst.severity.coding[0].code == "255604002" assert inst.severity.coding[0].display == "Mild" assert ( inst.severity.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Mild Asthma ' "(Date: 12-Nov 2012)
" ) assert inst.text.status == "generated" assert inst.verificationStatus.coding[0].code == "confirmed" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-ver-status"} ).valueUri ) def test_condition_8(base_settings): """No. 8 tests collection for Condition. Test File: condition-example2.json """ filename = base_settings["unittest_data_dir"] / "condition-example2.json" inst = condition.Condition.model_validate_json(filename.read_bytes()) assert "Condition" == inst.get_resource_type() impl_condition_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Condition" == data["resourceType"] inst2 = condition.Condition(**data) impl_condition_8(inst2) def impl_condition_9(inst): assert inst.abatementAge.code == "a" assert ( inst.abatementAge.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.abatementAge.unit == "years" assert float(inst.abatementAge.value) == float(54) assert inst.bodySite[0].coding[0].code == "361355005" assert inst.bodySite[0].coding[0].display == "Entire head and neck" assert ( inst.bodySite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].coding[0].code == "encounter-diagnosis" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-category"} ).valueUri ) assert inst.clinicalStatus.coding[0].code == "resolved" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-clinical"} ).valueUri ) assert inst.code.coding[0].code == "363346000" assert inst.code.coding[0].display == "Malignant neoplastic disease" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.evidence[0].reference.display == "Erasmus' diagnostic report of Roel's tumor" ) assert inst.evidence[0].reference.reference == "DiagnosticReport/f201" assert inst.id == "f202" assert inst.meta.security[0].code == "TBOO" assert inst.meta.security[0].display == "taboo" assert ( inst.meta.security[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.onsetAge.code == "a" assert ( inst.onsetAge.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.onsetAge.unit == "years" assert float(inst.onsetAge.value) == float(52) assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-12-01"} ).valueDateTime ) assert inst.severity.coding[0].code == "24484000" assert inst.severity.coding[0].display == "Severe" assert ( inst.severity.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" assert inst.verificationStatus.coding[0].code == "confirmed" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-ver-status"} ).valueUri ) def test_condition_9(base_settings): """No. 9 tests collection for Condition. Test File: condition-example-f202-malignancy.json """ filename = ( base_settings["unittest_data_dir"] / "condition-example-f202-malignancy.json" ) inst = condition.Condition.model_validate_json(filename.read_bytes()) assert "Condition" == inst.get_resource_type() impl_condition_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Condition" == data["resourceType"] inst2 = condition.Condition(**data) impl_condition_9(inst2) def impl_condition_10(inst): assert inst.abatementString == "around April 9, 2013" assert inst.bodySite[0].coding[0].code == "38266002" assert inst.bodySite[0].coding[0].display == "Entire body as a whole" assert ( inst.bodySite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].coding[0].code == "55607006" assert inst.category[0].coding[0].display == "Problem" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].coding[1].code == "problem-list-item" assert ( inst.category[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-category"} ).valueUri ) assert inst.clinicalStatus.coding[0].code == "resolved" assert ( inst.clinicalStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-clinical"} ).valueUri ) assert inst.code.coding[0].code == "386661006" assert inst.code.coding[0].display == "Fever" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.encounter.reference == "Encounter/f201" assert inst.evidence[0].concept.coding[0].code == "258710007" assert inst.evidence[0].concept.coding[0].display == "degrees C" assert ( inst.evidence[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.evidence[0].reference.display == "Temperature" assert inst.evidence[0].reference.reference == "Observation/f202" assert inst.id == "f201" 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.onsetDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-04-02"} ).valueDateTime ) assert inst.participant[0].actor.reference == "Practitioner/f201" assert inst.participant[0].function.coding[0].code == "enterer" assert inst.participant[0].function.coding[0].display == "Enterer" assert ( inst.participant[0].function.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/provenance-participant-type" } ).valueUri ) assert inst.participant[1].actor.reference == "Practitioner/f201" assert inst.participant[1].function.coding[0].code == "verifier" assert inst.participant[1].function.coding[0].display == "Verifier" assert ( inst.participant[1].function.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/provenance-participant-type" } ).valueUri ) assert ( inst.recordedDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-04-04"} ).valueDateTime ) assert inst.severity.coding[0].code == "255604002" assert inst.severity.coding[0].display == "Mild" assert ( inst.severity.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" assert inst.verificationStatus.coding[0].code == "confirmed" assert ( inst.verificationStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/condition-ver-status"} ).valueUri ) def test_condition_10(base_settings): """No. 10 tests collection for Condition. Test File: condition-example-f201-fever.json """ filename = base_settings["unittest_data_dir"] / "condition-example-f201-fever.json" inst = condition.Condition.model_validate_json(filename.read_bytes()) assert "Condition" == inst.get_resource_type() impl_condition_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Condition" == data["resourceType"] inst2 = condition.Condition(**data) impl_condition_10(inst2) ================================================ FILE: fhir/resources/tests/test_conditiondefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ConditionDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import conditiondefinition from .conftest import ExternalValidatorModel def impl_conditiondefinition_1(inst): assert inst.code.coding[0].code == "55822004" assert inst.code.coding[0].display == "Hyperlipidemia (disorder)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-05-26T10:44:00+10:00"} ).valueDateTime ) assert ( inst.definition[0] == ExternalValidatorModel.model_validate( { "valueUri": "https://med.stanford.edu/content/dam/sm/cerc/documents/Hyperlipidemia%20Management%20Protocol.pdf" } ).valueUri ) assert inst.description == "Hyperlipidemia Status" assert inst.hasBodySite is False assert inst.hasSeverity is False assert inst.hasStage is False assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.25.1" assert inst.medication[0].code.coding[0].code == "203151" assert inst.medication[0].code.coding[0].display == "Gemfibrozil" assert ( inst.medication[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.name == "Hyperlipidemia" assert inst.observation[0].code.coding[0].code == "24331-1" assert ( inst.observation[0].code.coding[0].display == "Lipid 1996 panel - Serum or Plasma" ) assert ( inst.observation[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.observation[0].code.text == "Lipid Panel" assert inst.observation[1].code.coding[0].code == "35200-5" assert ( inst.observation[1].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.observation[1].code.text == "Cholesterol" assert inst.observation[2].code.coding[0].code == "35217-9" assert ( inst.observation[2].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.observation[2].code.text == "Triglyceride" assert inst.observation[3].code.coding[0].code == "2085-9" assert inst.observation[3].code.coding[0].display == "HDL Cholesterol" assert ( inst.observation[3].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.observation[3].code.text == "Cholesterol in HDL" assert inst.observation[4].code.coding[0].code == "13457-7" assert inst.observation[4].code.coding[0].display == ( "Cholesterol in LDL [Mass/volume] in Serum or Plasma by " "calculation" ) assert ( inst.observation[4].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.observation[4].code.text == "LDL Chol. (Calc)" assert inst.plan[0].reference.reference == ( "http://acme.com/fhir/PlanDefinition/fd0e32d8-2ebd-4211-9e50-" "8983efddc2c6" ) assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Hyperlipidemia Status" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ConditionDefinition/example"} ).valueUri ) def test_conditiondefinition_1(base_settings): """No. 1 tests collection for ConditionDefinition. Test File: conditiondefinition-example.json """ filename = base_settings["unittest_data_dir"] / "conditiondefinition-example.json" inst = conditiondefinition.ConditionDefinition.model_validate_json( filename.read_bytes() ) assert "ConditionDefinition" == inst.get_resource_type() impl_conditiondefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ConditionDefinition" == data["resourceType"] inst2 = conditiondefinition.ConditionDefinition(**data) impl_conditiondefinition_1(inst2) ================================================ FILE: fhir/resources/tests/test_consent.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Consent Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import consent from .conftest import ExternalValidatorModel def impl_consent_1(inst): assert inst.category[0].coding[0].code == "59284-0" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.controller[0].reference == "Organization/f001" assert ( inst.date == ExternalValidatorModel.model_validate({"valueDate": "2018-12-28"}).valueDate ) assert inst.decision == "permit" assert inst.id == "consent-example-notThis" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.provision[0].data[0].meaning == "related" assert ( inst.provision[0].data[0].reference.reference == "MedicationRequest/medrx0305" ) assert inst.regulatoryBasis[0].coding[0].code == "INFA" assert ( inst.regulatoryBasis[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.sourceAttachment[0].title == "The terms of the consent in lawyer speak." assert inst.status == "active" assert inst.subject.display == "P. van de Heuvel" assert inst.subject.reference == "Patient/f001" assert inst.text.status == "generated" def test_consent_1(base_settings): """No. 1 tests collection for Consent. Test File: consent-example-notThis.json """ filename = base_settings["unittest_data_dir"] / "consent-example-notThis.json" inst = consent.Consent.model_validate_json(filename.read_bytes()) assert "Consent" == inst.get_resource_type() impl_consent_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Consent" == data["resourceType"] inst2 = consent.Consent(**data) impl_consent_1(inst2) def impl_consent_2(inst): assert inst.category[0].coding[0].code == "59284-0" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.controller[0].reference == "Organization/f001" assert ( inst.date == ExternalValidatorModel.model_validate({"valueDate": "2016-06-23"}).valueDate ) assert inst.decision == "permit" assert inst.grantor[0].reference == "RelatedPerson/peter" assert inst.id == "consent-example-smartonfhir" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.provision[0].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-06-23T17:32:33+10:00"} ).valueDateTime ) assert ( inst.provision[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-06-23T17:02:33+10:00"} ).valueDateTime ) assert inst.provision[0].provision[0].action[0].coding[0].code == "access" assert ( inst.provision[0].provision[0].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert inst.provision[0].provision[0].action[1].coding[0].code == "correct" assert ( inst.provision[0].provision[0].action[1].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert inst.regulatoryBasis[0].coding[0].code == "INFA" assert ( inst.regulatoryBasis[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.status == "active" assert inst.subject.reference == "Patient/xcda" assert inst.text.status == "generated" def test_consent_2(base_settings): """No. 2 tests collection for Consent. Test File: consent-example-smartonfhir.json """ filename = base_settings["unittest_data_dir"] / "consent-example-smartonfhir.json" inst = consent.Consent.model_validate_json(filename.read_bytes()) assert "Consent" == inst.get_resource_type() impl_consent_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Consent" == data["resourceType"] inst2 = consent.Consent(**data) impl_consent_2(inst2) def impl_consent_3(inst): assert inst.category[0].coding[0].code == "npp" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentcategorycodes"} ).valueUri ) assert inst.controller[0].reference == "Organization/f001" assert ( inst.date == ExternalValidatorModel.model_validate({"valueDate": "2018-12-28"}).valueDate ) assert inst.decision == "permit" assert inst.grantee[0].reference == "Patient/pat2" assert inst.id == "consent-example-CDA" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.3.72.5.9.1"} ).valueUri ) assert inst.identifier[0].value == "494e0c7a-a69e-4fb4-9d02-6aae747790d7" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.provision[0].actor[0].reference.reference == "Practitioner/f001" assert inst.provision[0].actor[0].role.coding[0].code == "PRCP" assert ( inst.provision[0].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert ( inst.provision[0].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-10"} ).valueDateTime ) assert ( inst.provision[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-10"} ).valueDateTime ) assert ( inst.provision[0].provision[0].actor[0].reference.reference == "Practitioner/xcda-author" ) assert inst.provision[0].provision[0].actor[0].role.coding[0].code == "AUT" assert ( inst.provision[0].provision[0].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision[0].provision[0].code[0].coding[0].code == "34133-9" assert ( inst.provision[0].provision[0].code[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.provision[0].provision[0].code[1].coding[0].code == "18842-5" assert ( inst.provision[0].provision[0].code[1].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.provision[0].provision[0].documentType[0].code == "application/hl7-cda+xml" ) assert ( inst.provision[0].provision[0].documentType[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:13"} ).valueUri ) assert inst.regulatoryBasis[0].coding[0].code == "INFA" assert ( inst.regulatoryBasis[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.sourceReference[0].reference == "Contract/pcd-example-notAuthor" assert inst.status == "active" assert inst.subject.reference == "Patient/pat2" assert inst.text.status == "generated" def test_consent_3(base_settings): """No. 3 tests collection for Consent. Test File: consent-example-CDA.json """ filename = base_settings["unittest_data_dir"] / "consent-example-CDA.json" inst = consent.Consent.model_validate_json(filename.read_bytes()) assert "Consent" == inst.get_resource_type() impl_consent_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Consent" == data["resourceType"] inst2 = consent.Consent(**data) impl_consent_3(inst2) def impl_consent_4(inst): assert inst.category[0].coding[0].code == "59284-0" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.controller[0].reference == "Organization/f001" assert ( inst.date == ExternalValidatorModel.model_validate({"valueDate": "2015-11-18"}).valueDate ) assert inst.decision == "permit" assert inst.id == "consent-example-notAuthor" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.provision[0].actor[0].reference.reference == "Organization/f001" assert inst.provision[0].actor[0].role.coding[0].code == "CST" assert ( inst.provision[0].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.regulatoryBasis[0].coding[0].code == "INFA" assert ( inst.regulatoryBasis[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.sourceAttachment[0].title == "The terms of the consent in lawyer speak." assert inst.status == "active" assert inst.subject.display == "P. van de Heuvel" assert inst.subject.reference == "Patient/f001" assert inst.text.status == "generated" def test_consent_4(base_settings): """No. 4 tests collection for Consent. Test File: consent-example-notAuthor.json """ filename = base_settings["unittest_data_dir"] / "consent-example-notAuthor.json" inst = consent.Consent.model_validate_json(filename.read_bytes()) assert "Consent" == inst.get_resource_type() impl_consent_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Consent" == data["resourceType"] inst2 = consent.Consent(**data) impl_consent_4(inst2) def impl_consent_5(inst): assert inst.category[0].coding[0].code == "59284-0" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.controller[0].reference == "Organization/f001" assert ( inst.date == ExternalValidatorModel.model_validate({"valueDate": "2018-12-28"}).valueDate ) assert inst.decision == "permit" assert inst.id == "consent-example-notTime" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.provision[0].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-01"} ).valueDateTime ) assert ( inst.provision[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-01"} ).valueDateTime ) assert inst.regulatoryBasis[0].coding[0].code == "INFA" assert ( inst.regulatoryBasis[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.sourceAttachment[0].title == "The terms of the consent in lawyer speak." assert inst.status == "active" assert inst.subject.display == "P. van de Heuvel" assert inst.subject.reference == "Patient/f001" assert inst.text.status == "generated" def test_consent_5(base_settings): """No. 5 tests collection for Consent. Test File: consent-example-notTime.json """ filename = base_settings["unittest_data_dir"] / "consent-example-notTime.json" inst = consent.Consent.model_validate_json(filename.read_bytes()) assert "Consent" == inst.get_resource_type() impl_consent_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Consent" == data["resourceType"] inst2 = consent.Consent(**data) impl_consent_5(inst2) def impl_consent_6(inst): assert inst.category[0].coding[0].code == "59284-0" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.controller[0].reference == "Organization/f001" assert ( inst.date == ExternalValidatorModel.model_validate({"valueDate": "2018-12-24"}).valueDate ) assert inst.decision == "permit" assert inst.id == "consent-example-notThem" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.provision[0].action[0].coding[0].code == "access" assert ( inst.provision[0].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert inst.provision[0].action[1].coding[0].code == "correct" assert ( inst.provision[0].action[1].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert inst.provision[0].actor[0].reference.display == "Carla Espinosa" assert inst.provision[0].actor[0].reference.reference == "Practitioner/f204" assert inst.provision[0].actor[0].role.coding[0].code == "PRCP" assert ( inst.provision[0].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.regulatoryBasis[0].coding[0].code == "INFA" assert ( inst.regulatoryBasis[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.sourceAttachment[0].title == "The terms of the consent in lawyer speak." assert inst.status == "active" assert inst.subject.display == "Eve Everywoman" assert inst.subject.reference == "Patient/mom" assert inst.text.status == "generated" assert ( inst.verification[0].verificationDate[0] == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-11-11"} ).valueDateTime ) assert inst.verification[0].verified is True assert inst.verification[0].verifiedBy.reference == "Organization/f001" assert inst.verification[0].verifiedWith.reference == "RelatedPerson/benedicte" def test_consent_6(base_settings): """No. 6 tests collection for Consent. Test File: consent-example-notThem.json """ filename = base_settings["unittest_data_dir"] / "consent-example-notThem.json" inst = consent.Consent.model_validate_json(filename.read_bytes()) assert "Consent" == inst.get_resource_type() impl_consent_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Consent" == data["resourceType"] inst2 = consent.Consent(**data) impl_consent_6(inst2) def impl_consent_7(inst): assert inst.category[0].coding[0].code == "INFAO" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.controller[0].reference == "Organization/f203" assert ( inst.date == ExternalValidatorModel.model_validate({"valueDate": "2018-12-24"}).valueDate ) assert inst.decision == "deny" assert inst.grantee[0].display == "Simone Heps" assert inst.grantee[0].reference == "Practitioner/f007" assert inst.grantor[0].reference == "Patient/pat1" assert inst.id == "consent-example-grantor" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.provision[0].action[0].coding[0].code == "access" assert ( inst.provision[0].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert inst.provision[0].actor[0].reference.reference == "Organization/f203" assert inst.provision[0].actor[0].role.coding[0].code == "CST" assert ( inst.provision[0].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision[0].actor[1].reference.display == "Simone Heps" assert inst.provision[0].actor[1].reference.reference == "Practitioner/f007" assert inst.provision[0].actor[1].role.coding[0].code == "PRCP" assert ( inst.provision[0].actor[1].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.regulatoryBasis[0].coding[0].code == "INFAO" assert ( inst.regulatoryBasis[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.sourceAttachment[0].title == "The terms of the consent in lawyer speak." assert inst.status == "active" assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" def test_consent_7(base_settings): """No. 7 tests collection for Consent. Test File: consent-example-grantor.json """ filename = base_settings["unittest_data_dir"] / "consent-example-grantor.json" inst = consent.Consent.model_validate_json(filename.read_bytes()) assert "Consent" == inst.get_resource_type() impl_consent_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Consent" == data["resourceType"] inst2 = consent.Consent(**data) impl_consent_7(inst2) def impl_consent_8(inst): assert inst.category[0].coding[0].code == "59284-0" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.controller[0].reference == "Organization/2.16.840.1.113883.19.5" assert ( inst.date == ExternalValidatorModel.model_validate({"valueDate": "2018-12-24"}).valueDate ) assert inst.decision == "permit" assert inst.id == "consent-example-notOrg" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.provision[0].action[0].coding[0].code == "access" assert ( inst.provision[0].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert inst.provision[0].action[1].coding[0].code == "correct" assert ( inst.provision[0].action[1].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert inst.provision[0].actor[0].reference.reference == "Organization/f001" assert inst.provision[0].actor[0].role.coding[0].code == "PRCP" assert ( inst.provision[0].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.regulatoryBasis[0].coding[0].code == "INFA" assert ( inst.regulatoryBasis[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.sourceAttachment[0].title == "The terms of the consent in lawyer speak." assert inst.status == "active" assert inst.subject.display == "P. van de Heuvel" assert inst.subject.reference == "Patient/f001" assert inst.text.status == "generated" def test_consent_8(base_settings): """No. 8 tests collection for Consent. Test File: consent-example-notOrg.json """ filename = base_settings["unittest_data_dir"] / "consent-example-notOrg.json" inst = consent.Consent.model_validate_json(filename.read_bytes()) assert "Consent" == inst.get_resource_type() impl_consent_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Consent" == data["resourceType"] inst2 = consent.Consent(**data) impl_consent_8(inst2) def impl_consent_9(inst): assert inst.category[0].coding[0].code == "59284-0" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.controller[0].reference == "Organization/f001" assert ( inst.date == ExternalValidatorModel.model_validate({"valueDate": "2018-12-28"}).valueDate ) assert inst.decision == "deny" assert inst.id == "consent-example-pkb" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.provision[0].action[0].coding[0].code == "access" assert ( inst.provision[0].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert inst.provision[0].actor[0].reference.reference == "Organization/f001" assert inst.provision[0].actor[0].role.coding[0].code == "PRCP" assert ( inst.provision[0].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision[0].provision[0].action[0].coding[0].code == "access" assert ( inst.provision[0].provision[0].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert ( inst.provision[0].provision[0].actor[0].reference.reference == "Organization/f001" ) assert inst.provision[0].provision[0].actor[0].role.coding[0].code == "PRCP" assert ( inst.provision[0].provision[0].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision[0].provision[0].securityLabel[0].code == "PSY" assert ( inst.provision[0].provision[0].securityLabel[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.provision[0].provision[1].action[0].coding[0].code == "access" assert ( inst.provision[0].provision[1].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert ( inst.provision[0].provision[1].actor[0].reference.reference == "Organization/f001" ) assert inst.provision[0].provision[1].actor[0].role.coding[0].code == "PRCP" assert ( inst.provision[0].provision[1].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision[0].provision[1].securityLabel[0].code == "SPI" assert ( inst.provision[0].provision[1].securityLabel[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.provision[0].provision[2].action[0].coding[0].code == "access" assert ( inst.provision[0].provision[2].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert ( inst.provision[0].provision[2].actor[0].reference.reference == "Organization/f001" ) assert inst.provision[0].provision[2].actor[0].role.coding[0].code == "PRCP" assert ( inst.provision[0].provision[2].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision[0].provision[2].securityLabel[0].code == "N" assert ( inst.provision[0].provision[2].securityLabel[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-Confidentiality"} ).valueUri ) assert inst.provision[0].provision[3].action[0].coding[0].code == "access" assert ( inst.provision[0].provision[3].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert ( inst.provision[0].provision[3].actor[0].reference.reference == "Organization/f001" ) assert inst.provision[0].provision[3].actor[0].role.coding[0].code == "PRCP" assert ( inst.provision[0].provision[3].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision[0].provision[3].securityLabel[0].code == "PSY" assert ( inst.provision[0].provision[3].securityLabel[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.provision[0].provision[4].action[0].coding[0].code == "access" assert ( inst.provision[0].provision[4].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert ( inst.provision[0].provision[4].actor[0].reference.reference == "Organization/f001" ) assert inst.provision[0].provision[4].actor[0].role.coding[0].code == "PRCP" assert ( inst.provision[0].provision[4].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision[0].provision[4].securityLabel[0].code == "SPI" assert ( inst.provision[0].provision[4].securityLabel[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.provision[0].provision[5].action[0].coding[0].code == "access" assert ( inst.provision[0].provision[5].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert ( inst.provision[0].provision[5].actor[0].reference.reference == "Organization/f001" ) assert inst.provision[0].provision[5].actor[0].role.coding[0].code == "PRCP" assert ( inst.provision[0].provision[5].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision[0].provision[5].securityLabel[0].code == "SEX" assert ( inst.provision[0].provision[5].securityLabel[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.provision[0].provision[6].action[0].coding[0].code == "access" assert ( inst.provision[0].provision[6].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert ( inst.provision[0].provision[6].actor[0].reference.reference == "Organization/f001" ) assert inst.provision[0].provision[6].actor[0].role.coding[0].code == "PRCP" assert ( inst.provision[0].provision[6].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision[0].provision[6].securityLabel[0].code == "N" assert ( inst.provision[0].provision[6].securityLabel[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-Confidentiality"} ).valueUri ) assert inst.provision[0].provision[7].action[0].coding[0].code == "access" assert ( inst.provision[0].provision[7].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert ( inst.provision[0].provision[7].actor[0].reference.reference == "Organization/f001" ) assert inst.provision[0].provision[7].actor[0].role.coding[0].code == "PRCP" assert ( inst.provision[0].provision[7].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision[0].provision[7].securityLabel[0].code == "PSY" assert ( inst.provision[0].provision[7].securityLabel[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.provision[0].provision[8].action[0].coding[0].code == "access" assert ( inst.provision[0].provision[8].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert ( inst.provision[0].provision[8].actor[0].reference.reference == "Organization/f001" ) assert inst.provision[0].provision[8].actor[0].role.coding[0].code == "PRCP" assert ( inst.provision[0].provision[8].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision[0].provision[8].securityLabel[0].code == "SPI" assert ( inst.provision[0].provision[8].securityLabel[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.provision[0].provision[9].action[0].coding[0].code == "access" assert ( inst.provision[0].provision[9].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert ( inst.provision[0].provision[9].actor[0].reference.reference == "Organization/f001" ) assert inst.provision[0].provision[9].actor[0].role.coding[0].code == "PRCP" assert ( inst.provision[0].provision[9].actor[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.provision[0].provision[9].securityLabel[0].code == "SEX" assert ( inst.provision[0].provision[9].securityLabel[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.provision[0].securityLabel[0].code == "N" assert ( inst.provision[0].securityLabel[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-Confidentiality"} ).valueUri ) assert inst.regulatoryBasis[0].coding[0].code == "INFA" assert ( inst.regulatoryBasis[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.status == "active" assert inst.subject.display == "Peter James Chalmers" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_consent_9(base_settings): """No. 9 tests collection for Consent. Test File: consent-example-pkb.json """ filename = base_settings["unittest_data_dir"] / "consent-example-pkb.json" inst = consent.Consent.model_validate_json(filename.read_bytes()) assert "Consent" == inst.get_resource_type() impl_consent_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Consent" == data["resourceType"] inst2 = consent.Consent(**data) impl_consent_9(inst2) def impl_consent_10(inst): assert inst.category[0].coding[0].code == "59284-0" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.controller[0].reference == "Organization/f001" assert ( inst.date == ExternalValidatorModel.model_validate({"valueDate": "2018-12-28"}).valueDate ) assert inst.decision == "deny" assert inst.id == "consent-example-basic" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.provision[0].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-01-01"} ).valueDateTime ) assert ( inst.provision[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "1964-01-01"} ).valueDateTime ) assert inst.regulatoryBasis[0].coding[0].code == "INFA" assert ( inst.regulatoryBasis[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.sourceAttachment[0].title == "The terms of the consent in lawyer speak." assert inst.status == "active" assert inst.subject.display == "Peter James Chalmers" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_consent_10(base_settings): """No. 10 tests collection for Consent. Test File: consent-example.json """ filename = base_settings["unittest_data_dir"] / "consent-example.json" inst = consent.Consent.model_validate_json(filename.read_bytes()) assert "Consent" == inst.get_resource_type() impl_consent_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Consent" == data["resourceType"] inst2 = consent.Consent(**data) impl_consent_10(inst2) ================================================ FILE: fhir/resources/tests/test_contract.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Contract Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import contract from .conftest import ExternalValidatorModel def impl_contract_1(inst): assert inst.authority[0].display == "Michigan Health" assert inst.authority[0].reference == "Organization/3" assert inst.domain[0].display == "UK Pharmacies" assert inst.domain[0].reference == "Location/ukp" assert ( inst.friendly[0].contentAttachment.title == "The terms of the consent in friendly consumer speak." ) assert inst.id == "pcd-example-notOrg" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-11-18"} ).valueDateTime ) assert ( inst.legal[0].contentAttachment.title == "The terms of the consent in lawyer speak." ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.subType[0].coding[0].code == "Opt-In" assert inst.subType[0].coding[0].display == "Default Authorization with exceptions." assert ( inst.subType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.infoway-inforoute.ca.org/Consent-subtype-codes"} ).valueUri ) assert inst.subject[0].display == "P. van de Heuvel" assert inst.subject[0].reference == "Patient/f001" assert inst.term[0].offer.text == ( "Withhold this order and any results or related objects from " "any provider." ) assert inst.term[0].offer.topic.display == "Good Health Clinic" assert inst.term[0].offer.topic.reference == "Organization/2.16.840.1.113883.19.5" assert inst.term[0].type.coding[0].code == "withhold-from" assert ( inst.term[0].type.coding[0].display == "Withhold all data from specified actor entity." ) assert ( inst.term[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/consent-term-type-codes"} ).valueUri ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "57016-8" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) def test_contract_1(base_settings): """No. 1 tests collection for Contract. Test File: pcd-example-notOrg.json """ filename = base_settings["unittest_data_dir"] / "pcd-example-notOrg.json" inst = contract.Contract.model_validate_json(filename.read_bytes()) assert "Contract" == inst.get_resource_type() impl_contract_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Contract" == data["resourceType"] inst2 = contract.Contract(**data) impl_contract_1(inst2) def impl_contract_2(inst): assert ( inst.applies.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-01"} ).valueDateTime ) assert inst.id == "INS-101" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://xyz-insurance.com/forms"} ).valueUri ) assert inst.identifier[0].value == "YCSCWLN(01-2017)" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.subject[0].reference == "Patient/1" assert ( inst.term[0].asset[0].period[0].start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-06-01"} ).valueDateTime ) assert inst.term[0].asset[0].subtype[0].text == "sample" assert ( inst.term[0].asset[0].type[0].coding[0].code == "urn:uuid:3a48c68c-318d-4c68-8471-4a3c10fcb41b" ) assert inst.term[0].asset[0].type[0].coding[0].display == "RicardianContract" assert ( inst.term[0].asset[0].type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.term[0].asset[0].valuedItem[0].effectiveTime == ExternalValidatorModel.model_validate( {"valueDateTime": "1995"} ).valueDateTime ) assert ( inst.term[0].asset[0].valuedItem[0].entityCodeableConcept.text == "Ford Bobcat" ) assert float(inst.term[0].asset[0].valuedItem[0].factor) == float(1.0) assert ( inst.term[0].asset[0].valuedItem[0].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://somewhere.motor-vehicle.com/vin"} ).valueUri ) assert inst.term[0].asset[0].valuedItem[0].identifier.value == "XXSVT34-7665t952236" assert inst.term[0].asset[0].valuedItem[0].net.currency == "CAD" assert float(inst.term[0].asset[0].valuedItem[0].net.value) == float(200.0) assert float(inst.term[0].asset[0].valuedItem[0].points) == float(1.0) assert float(inst.term[0].asset[0].valuedItem[0].quantity.value) == float(1) assert inst.term[0].asset[0].valuedItem[0].unitPrice.currency == "CAD" assert float(inst.term[0].asset[0].valuedItem[0].unitPrice.value) == float(200.0) assert inst.term[0].group[0].offer.text == "Eligible Providers" assert inst.term[0].group[1].offer.text == "Responsibility for Payment" assert inst.term[0].group[2].group[0].group[0].offer.text == "Emergency Room Copay" assert ( inst.term[0].group[2].group[0].group[1].offer.text == "Professional Visit Copay" ) assert inst.term[0].group[2].group[0].offer.text == "Copays" assert inst.term[0].group[2].group[1].offer.text == "Calendar Year Deductible" assert inst.term[0].group[2].group[2].offer.text == "Out-Of-Pocket Maximum" assert inst.term[0].group[2].group[3].group[0].offer.text == "Ambulance Services" assert inst.term[0].group[2].group[3].group[1].offer.text == "Dental Services" assert inst.term[0].group[2].group[3].group[2].offer.text == "Diagnostic Services" assert ( inst.term[0].group[2].group[3].group[3].offer.text == "Emergency Room Services" ) assert ( inst.term[0].group[2].group[3].group[4].offer.text == "Hospital Inpatient Care" ) assert inst.term[0].group[2].group[3].offer.text == "Medical Services" assert inst.term[0].group[2].offer.text == "List of Benefits" assert inst.text.status == "generated" assert inst.type.coding[0].code == "healthinsurance" assert inst.type.coding[0].display == "Health Insurance" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/contract-type"} ).valueUri ) def test_contract_2(base_settings): """No. 2 tests collection for Contract. Test File: contract-example-ins-policy.json """ filename = base_settings["unittest_data_dir"] / "contract-example-ins-policy.json" inst = contract.Contract.model_validate_json(filename.read_bytes()) assert "Contract" == inst.get_resource_type() impl_contract_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Contract" == data["resourceType"] inst2 = contract.Contract(**data) impl_contract_2(inst2) def impl_contract_3(inst): assert ( inst.applies.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-11-01T21:18:27-04:00"} ).valueDateTime ) assert inst.contentDerivative.coding[0].code == "registration" assert ( inst.contentDerivative.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/contract-content-derivative" } ).valueUri ) assert inst.id == "C-2121" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-11-01T21:18:27-04:00"} ).valueDateTime ) assert inst.legal[0].contentAttachment.contentType == "application/pdf" assert inst.legal[0].contentAttachment.language == "en-US" assert ( inst.legal[0].contentAttachment.title == "MDHHS-5515 Consent To Share Your Health Information" ) assert ( inst.legal[0].contentAttachment.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://org.mihin.ecms/ConsentDirective-2121"} ).valueUrl ) assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2016-07-19T18:18:42.108-04:00"} ).valueInstant ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.meta.versionId == "1" assert inst.signer[0].party.display == "Alice Recruit" assert inst.signer[0].party.reference == "Patient/f201" assert inst.signer[0].signature[0].type[0].code == "1.2.840.10065.1.12.1.1" assert ( inst.signer[0].signature[0].type[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso-astm:E1762-95:2013"} ).valueUri ) assert ( inst.signer[0].signature[0].when == ExternalValidatorModel.model_validate( {"valueInstant": "2017-02-08T10:57:34+01:00"} ).valueInstant ) assert inst.signer[0].signature[0].who.reference == "Patient/f201" assert inst.signer[0].type.code == "SELF" assert ( inst.signer[0].type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://mdhhs.org/fhir/consent-signer-type"} ).valueUri ) assert inst.status == "executed" assert inst.subType[0].coding[0].code == "hcd" assert ( inst.subType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentcategorycodes"} ).valueUri ) assert inst.subject[0].reference == "Patient/f201" assert inst.term[0].action[0].intent.coding[0].code == "HPRGRP" assert ( inst.term[0].action[0].intent.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.term[0].action[0].status.text == "Sample" assert ( inst.term[0].action[0].subject[0].reference[0].display == "VA Ann Arbor Healthcare System" ) assert ( inst.term[0].action[0].subject[0].reference[0].reference == "Organization/f001" ) assert inst.term[0].action[0].subject[0].role.coding[0].code == "IR" assert inst.term[0].action[0].subject[0].role.coding[0].display == "Recipient" assert ( inst.term[0].action[0].subject[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://mdhhs.org/fhir/consent-actor-type"} ).valueUri ) assert ( inst.term[0].action[0].subject[0].role.text == "Recipient of restricted health information" ) assert ( inst.term[0].action[0].subject[1].reference[0].display == "Community Mental Health Clinic" ) assert inst.term[0].action[0].subject[1].reference[0].reference == "Organization/2" assert inst.term[0].action[0].subject[1].role.coding[0].code == "IS" assert inst.term[0].action[0].subject[1].role.coding[0].display == "Sender" assert ( inst.term[0].action[0].subject[1].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://mdhhs.org/fhir/consent-actor-type"} ).valueUri ) assert ( inst.term[0].action[0].subject[1].role.text == "Sender of restricted health information" ) assert inst.term[0].action[0].type.coding[0].code == "action-a" assert ( inst.term[0].action[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/contractaction"} ).valueUri ) assert ( inst.term[0].asset[0].period[0].end == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-11-01T21:18:27-04:00"} ).valueDateTime ) assert ( inst.term[0].asset[0].period[0].start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-11-01T21:18:27-04:00"} ).valueDateTime ) assert inst.term[0].offer.decision.coding[0].code == "OPTIN" assert ( inst.term[0].offer.decision.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.term[0].offer.text == "Can't refuse" assert inst.term[0].offer.type.coding[0].code == "statutory" assert ( inst.term[0].offer.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/contracttermtypecodes"} ).valueUri ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "OPTIN" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://mdhhs.org/fhir/consentdirective-type"} ).valueUri ) assert inst.type.text == "Opt-in consent directive" def test_contract_3(base_settings): """No. 3 tests collection for Contract. Test File: contract-example-42cfr-part2.json """ filename = base_settings["unittest_data_dir"] / "contract-example-42cfr-part2.json" inst = contract.Contract.model_validate_json(filename.read_bytes()) assert "Contract" == inst.get_resource_type() impl_contract_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Contract" == data["resourceType"] inst2 = contract.Contract(**data) impl_contract_3(inst2) def impl_contract_4(inst): assert inst.authority[0].display == "Michigan Health" assert inst.authority[0].reference == "Organization/3" assert inst.domain[0].display == "UK Pharmacies" assert inst.domain[0].reference == "Location/ukp" assert ( inst.friendly[0].contentAttachment.title == "The terms of the consent in friendly consumer speak." ) assert inst.id == "pcd-example-notLabs" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-17"} ).valueDateTime ) assert ( inst.legal[0].contentAttachment.title == "The terms of the consent in lawyer speak." ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.subType[0].coding[0].code == "Opt-In" assert inst.subType[0].coding[0].display == "Default Authorization with exceptions." assert ( inst.subType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.infoway-inforoute.ca.org/Consent-subtype-codes"} ).valueUri ) assert inst.subject[0].display == "P. van de Heuvel" assert inst.subject[0].reference == "Patient/f001" assert inst.term[0].group[0].offer.text == "Withhold orders from any provider." assert inst.term[0].group[0].subType.coding[0].code == "ServiceRequest" assert ( inst.term[0].group[0].subType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/fhir-types"} ).valueUri ) assert inst.term[0].group[0].type.coding[0].code == "withhold-object-type" assert ( inst.term[0].group[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/consent-term-type-codes"} ).valueUri ) assert ( inst.term[0].group[1].offer.text == "Withhold order results from any provider." ) assert inst.term[0].group[1].subType.coding[0].code == "DiagnosticReport" assert ( inst.term[0].group[1].subType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/fhir-types"} ).valueUri ) assert inst.term[0].group[1].type.coding[0].code == "withhold-object-type" assert ( inst.term[0].group[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/consent-term-type-codes"} ).valueUri ) assert inst.term[0].offer.text == "sample" assert inst.text.status == "generated" assert inst.type.coding[0].code == "57016-8" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) def test_contract_4(base_settings): """No. 4 tests collection for Contract. Test File: pcd-example-notLabs.json """ filename = base_settings["unittest_data_dir"] / "pcd-example-notLabs.json" inst = contract.Contract.model_validate_json(filename.read_bytes()) assert "Contract" == inst.get_resource_type() impl_contract_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Contract" == data["resourceType"] inst2 = contract.Contract(**data) impl_contract_4(inst2) def impl_contract_5(inst): assert inst.authority[0].display == "Michigan Health" assert inst.authority[0].reference == "Organization/3" assert inst.domain[0].display == "UK Pharmacies" assert inst.domain[0].reference == "Location/ukp" assert ( inst.friendly[0].contentAttachment.title == "The terms of the consent in friendly consumer speak." ) assert inst.id == "pcd-example-notThem" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-11-18"} ).valueDateTime ) assert ( inst.legal[0].contentAttachment.title == "The terms of the consent in lawyer speak." ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.signer[0].party.reference == "Patient/f001" assert inst.signer[0].signature[0].type[0].code == "1.2.840.10065.1.12.1.1" assert ( inst.signer[0].signature[0].type[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso-astm:E1762-95:2013"} ).valueUri ) assert ( inst.signer[0].signature[0].when == ExternalValidatorModel.model_validate( {"valueInstant": "2013-06-08T10:57:34-07:00"} ).valueInstant ) assert inst.signer[0].signature[0].who.reference == "Patient/f001" assert inst.signer[0].type.code == "COVPTY" assert ( inst.signer[0].type.system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/contractsignertypecodes" } ).valueUri ) assert inst.subType[0].coding[0].code == "Opt-In" assert inst.subType[0].coding[0].display == "Default Authorization with exceptions." assert ( inst.subType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.infoway-inforoute.ca.org/Consent-subtype-codes"} ).valueUri ) assert inst.subject[0].display == "P. van de Heuvel" assert inst.subject[0].reference == "Patient/f001" assert inst.term[0].offer.text == ( "Withhold this order and any results or related objects from " "specified nurse provider." ) assert inst.term[0].offer.topic.display == "Fictive Nurse" assert inst.term[0].offer.topic.reference == "Practitioner/f204" assert inst.term[0].type.coding[0].code == "withhold-from" assert ( inst.term[0].type.coding[0].display == "Withhold all data from specified actor entity." ) assert ( inst.term[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/consent-term-type-codes"} ).valueUri ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "57016-8" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) def test_contract_5(base_settings): """No. 5 tests collection for Contract. Test File: pcd-example-notThem.json """ filename = base_settings["unittest_data_dir"] / "pcd-example-notThem.json" inst = contract.Contract.model_validate_json(filename.read_bytes()) assert "Contract" == inst.get_resource_type() impl_contract_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Contract" == data["resourceType"] inst2 = contract.Contract(**data) impl_contract_5(inst2) def impl_contract_6(inst): assert inst.authority[0].display == "Michigan Health" assert inst.authority[0].reference == "Organization/3" assert inst.domain[0].display == "UK Pharmacies" assert inst.domain[0].reference == "Location/ukp" assert ( inst.friendly[0].contentAttachment.title == "The terms of the consent in friendly consumer speak." ) assert inst.id == "pcd-example-notAuthor" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-11-18"} ).valueDateTime ) assert ( inst.legal[0].contentAttachment.title == "The terms of the consent in lawyer speak." ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.subType[0].coding[0].code == "Opt-In" assert inst.subType[0].coding[0].display == "Default Authorization with exceptions." assert ( inst.subType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.infoway-inforoute.ca.org/Consent-subtype-codes"} ).valueUri ) assert inst.subject[0].display == "P. van de Heuvel" assert inst.subject[0].reference == "Patient/f001" assert ( inst.term[0].offer.text == "Withhold all data authored by Good Health provider." ) assert inst.term[0].offer.topic.display == "Good Health Clinic" assert inst.term[0].offer.topic.reference == "Organization/2.16.840.1.113883.19.5" assert inst.term[0].type.coding[0].code == "withhold-authored-by" assert ( inst.term[0].type.coding[0].display == "Withhold all data authored by specified actor entity." ) assert ( inst.term[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/consent-term-type-codes"} ).valueUri ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "57016-8" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) def test_contract_6(base_settings): """No. 6 tests collection for Contract. Test File: pcd-example-notAuthor.json """ filename = base_settings["unittest_data_dir"] / "pcd-example-notAuthor.json" inst = contract.Contract.model_validate_json(filename.read_bytes()) assert "Contract" == inst.get_resource_type() impl_contract_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Contract" == data["resourceType"] inst2 = contract.Contract(**data) impl_contract_6(inst2) def impl_contract_7(inst): assert inst.id == "C-123" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/contract"} ).valueUri ) assert inst.identifier[0].value == "12347" assert inst.legallyBindingAttachment.contentType == "application/pdf" assert ( inst.legallyBindingAttachment.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://www.aws3.com/storage/doc.pdf"} ).valueUrl ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.rule[0].contentAttachment.contentType == "application/txt" assert ( inst.rule[0].contentAttachment.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://www.rfc-editor.org/bcp/bcp13.txt"} ).valueUrl ) assert ( inst.term[0].asset[0].period[0].start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-06-01"} ).valueDateTime ) assert inst.term[0].asset[0].subtype[0].text == "sample" assert ( inst.term[0].asset[0].type[0].coding[0].code == "urn:uuid:3a48c68c-318d-4c68-8471-4a3c10fcb41b" ) assert inst.term[0].asset[0].type[0].coding[0].display == "RicardianContract" assert ( inst.term[0].asset[0].type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.term[0].asset[0].valuedItem[0].effectiveTime == ExternalValidatorModel.model_validate( {"valueDateTime": "1995"} ).valueDateTime ) assert ( inst.term[0].asset[0].valuedItem[0].entityCodeableConcept.text == "Ford Bobcat" ) assert float(inst.term[0].asset[0].valuedItem[0].factor) == float(1.0) assert ( inst.term[0].asset[0].valuedItem[0].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://somewhere.motor-vehicle.com/vin"} ).valueUri ) assert inst.term[0].asset[0].valuedItem[0].identifier.value == "XXSVT34-7665t952236" assert inst.term[0].asset[0].valuedItem[0].net.currency == "CAD" assert float(inst.term[0].asset[0].valuedItem[0].net.value) == float(200.0) assert float(inst.term[0].asset[0].valuedItem[0].points) == float(1.0) assert float(inst.term[0].asset[0].valuedItem[0].quantity.value) == float(1) assert inst.term[0].asset[0].valuedItem[0].unitPrice.currency == "CAD" assert float(inst.term[0].asset[0].valuedItem[0].unitPrice.value) == float(200.0) assert inst.term[0].offer.text == "Can't refuse" assert inst.text.div == ( '
A human-readable' " rendering of the contract
" ) assert inst.text.status == "generated" def test_contract_7(base_settings): """No. 7 tests collection for Contract. Test File: contract-example.json """ filename = base_settings["unittest_data_dir"] / "contract-example.json" inst = contract.Contract.model_validate_json(filename.read_bytes()) assert "Contract" == inst.get_resource_type() impl_contract_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Contract" == data["resourceType"] inst2 = contract.Contract(**data) impl_contract_7(inst2) def impl_contract_8(inst): assert inst.authority[0].display == "Michigan Health" assert inst.authority[0].reference == "Organization/3" assert inst.domain[0].display == "UK Pharmacies" assert inst.domain[0].reference == "Location/ukp" assert ( inst.friendly[0].contentAttachment.title == "The terms of the consent in friendly consumer speak." ) assert inst.id == "pcd-example-notThis" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-11-18"} ).valueDateTime ) assert ( inst.legal[0].contentAttachment.title == "The terms of the consent in lawyer speak." ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.subType[0].coding[0].code == "Opt-In" assert inst.subType[0].coding[0].display == "Default Authorization with exceptions." assert ( inst.subType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.infoway-inforoute.ca.org/Consent-subtype-codes"} ).valueUri ) assert inst.subject[0].display == "P. van de Heuvel" assert inst.subject[0].reference == "Patient/f001" assert ( inst.term[0].applies.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-11-18"} ).valueDateTime ) assert ( inst.term[0].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/term-items"} ).valueUri ) assert inst.term[0].identifier.value == "3347689" assert ( inst.term[0].issued == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-11-01"} ).valueDateTime ) assert inst.term[0].offer.text == ( "Withhold this order and any results or related objects from " "any provider." ) assert inst.term[0].offer.topic.reference == "ServiceRequest/lipid" assert inst.term[0].type.coding[0].code == "withhold-identified-object-and-related" assert inst.term[0].type.coding[0].display == ( "Withhold the identified object and any other resources that " "are related to this object." ) assert ( inst.term[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/consent-term-type-codes"} ).valueUri ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "57016-8" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) def test_contract_8(base_settings): """No. 8 tests collection for Contract. Test File: pcd-example-notThis.json """ filename = base_settings["unittest_data_dir"] / "pcd-example-notThis.json" inst = contract.Contract.model_validate_json(filename.read_bytes()) assert "Contract" == inst.get_resource_type() impl_contract_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Contract" == data["resourceType"] inst2 = contract.Contract(**data) impl_contract_8(inst2) ================================================ FILE: fhir/resources/tests/test_coverage.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Coverage Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import coverage from .conftest import ExternalValidatorModel def impl_coverage_1(inst): assert inst.beneficiary.reference == "Patient/5" assert inst.class_fhir[0].name == "Western Airlines" assert inst.class_fhir[0].type.coding[0].code == "group" assert ( inst.class_fhir[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[0].value.value == "WESTAIR" assert ( inst.class_fhir[1].name == "Full Coverage: Medical, Dental, Pharmacy, Vision, EHC" ) assert inst.class_fhir[1].type.coding[0].code == "plan" assert ( inst.class_fhir[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[1].value.value == "BG4352" assert inst.class_fhir[2].name == "Platinum" assert inst.class_fhir[2].type.coding[0].code == "subplan" assert ( inst.class_fhir[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[2].value.value == "D15C9" assert inst.contract[0].reference == "Contract/INS-101" assert ( inst.costToBeneficiary[0].exception[0].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-12-31"} ).valueDateTime ) assert ( inst.costToBeneficiary[0].exception[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-01-01"} ).valueDateTime ) assert inst.costToBeneficiary[0].exception[0].type.coding[0].code == "retired" assert ( inst.costToBeneficiary[0].exception[0].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/ex-coverage-financial-exception" } ).valueUri ) assert inst.costToBeneficiary[0].type.coding[0].code == "gpvisit" assert ( inst.costToBeneficiary[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-copay-type"} ).valueUri ) assert inst.costToBeneficiary[0].valueMoney.currency == "USD" assert float(inst.costToBeneficiary[0].valueMoney.value) == float(20.0) assert inst.dependent == "1" assert inst.id == "7546D" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://xyz.com/codes/identifier"} ).valueUri ) assert inst.identifier[0].value == "AB98761" assert inst.insurer.reference == "Organization/2" assert inst.kind == "insurance" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.network == "5" assert inst.order == 2 assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-03-17"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2011-03-17"} ).valueDateTime ) assert inst.relationship.coding[0].code == "self" assert inst.status == "active" assert inst.subscriber.reference == "Patient/5" assert inst.subscriberId[0].value == "AB9876" assert inst.text.div == ( '
A human-readable' " rendering of the coverage
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "EHCPOL" assert inst.type.coding[0].display == "extended healthcare" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) def test_coverage_1(base_settings): """No. 1 tests collection for Coverage. Test File: coverage-example-2.json """ filename = base_settings["unittest_data_dir"] / "coverage-example-2.json" inst = coverage.Coverage.model_validate_json(filename.read_bytes()) assert "Coverage" == inst.get_resource_type() impl_coverage_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Coverage" == data["resourceType"] inst2 = coverage.Coverage(**data) impl_coverage_1(inst2) def impl_coverage_2(inst): assert inst.beneficiary.reference == "Patient/5" assert inst.id == "SP1234" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hospitalx.com/selfpayagreement"} ).valueUri ) assert inst.identifier[0].value == "SP12345678" assert inst.kind == "self-pay" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.paymentBy[0].party.reference == "Patient/5" assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-03-17"} ).valueDateTime ) assert inst.relationship.coding[0].code == "self" assert inst.status == "active" assert inst.subscriber.reference == "Patient/5" assert inst.text.div == ( '
A human-readable' " rendering of a Self Pay Agreement.
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "pay" assert inst.type.coding[0].display == "PAY" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-selfpay"} ).valueUri ) def test_coverage_2(base_settings): """No. 2 tests collection for Coverage. Test File: coverage-example-selfpay.json """ filename = base_settings["unittest_data_dir"] / "coverage-example-selfpay.json" inst = coverage.Coverage.model_validate_json(filename.read_bytes()) assert "Coverage" == inst.get_resource_type() impl_coverage_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Coverage" == data["resourceType"] inst2 = coverage.Coverage(**data) impl_coverage_2(inst2) def impl_coverage_3(inst): assert inst.beneficiary.reference == "Patient/5" assert inst.id == "7547E" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ehic.com/insurer/123456789/member"} ).valueUri ) assert inst.identifier[0].value == "A123456780" assert ( inst.insurer.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://ehic.com/insurer"} ).valueUri ) assert inst.insurer.identifier.value == "123456789" assert inst.kind == "insurance" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-03-17"} ).valueDateTime ) assert inst.relationship.coding[0].code == "self" assert inst.status == "active" assert inst.subscriber.reference == "Patient/5" assert inst.text.div == ( '
A human-readable' " rendering of the European Health Insurance Card
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "EHCPOL" assert inst.type.coding[0].display == "extended healthcare" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) def test_coverage_3(base_settings): """No. 3 tests collection for Coverage. Test File: coverage-example-ehic.json """ filename = base_settings["unittest_data_dir"] / "coverage-example-ehic.json" inst = coverage.Coverage.model_validate_json(filename.read_bytes()) assert "Coverage" == inst.get_resource_type() impl_coverage_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Coverage" == data["resourceType"] inst2 = coverage.Coverage(**data) impl_coverage_3(inst2) def impl_coverage_4(inst): assert inst.beneficiary.reference == "Patient/4" assert inst.class_fhir[0].name == "Corporate Baker's Inc. Local #35" assert inst.class_fhir[0].type.coding[0].code == "group" assert ( inst.class_fhir[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[0].value.value == "CB135" assert inst.class_fhir[1].name == "Trainee Part-time Benefits" assert inst.class_fhir[1].type.coding[0].code == "subgroup" assert ( inst.class_fhir[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[1].value.value == "123" assert ( inst.class_fhir[2].name == "Full Coverage: Medical, Dental, Pharmacy, Vision, EHC" ) assert inst.class_fhir[2].type.coding[0].code == "plan" assert ( inst.class_fhir[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[2].value.value == "B37FC" assert inst.class_fhir[3].name == "Includes afterlife benefits" assert inst.class_fhir[3].type.coding[0].code == "subplan" assert ( inst.class_fhir[3].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[3].value.value == "P7" assert inst.class_fhir[4].name == "Silver: Family Plan spouse only" assert inst.class_fhir[4].type.coding[0].code == "class" assert ( inst.class_fhir[4].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[4].value.value == "SILVER" assert inst.class_fhir[5].name == "Low deductable, max $20 copay" assert inst.class_fhir[5].type.coding[0].code == "subclass" assert ( inst.class_fhir[5].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[5].value.value == "Tier2" assert inst.class_fhir[6].type.coding[0].code == "sequence" assert ( inst.class_fhir[6].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[6].value.value == "9" assert inst.class_fhir[7].type.coding[0].code == "rxid" assert ( inst.class_fhir[7].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[7].value.value == "MDF12345" assert inst.class_fhir[8].type.coding[0].code == "rxbin" assert ( inst.class_fhir[8].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[8].value.value == "987654" assert inst.class_fhir[9].type.coding[0].code == "rxgroup" assert ( inst.class_fhir[9].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/coverage-class"} ).valueUri ) assert inst.class_fhir[9].value.value == "M35PT" assert inst.dependent == "0" assert inst.id == "9876B1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://benefitsinc.com/certificate"} ).valueUri ) assert inst.identifier[0].value == "12345" assert inst.insurer.reference == "Organization/2" assert inst.kind == "insurance" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-05-23"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2011-05-23"} ).valueDateTime ) assert ( inst.policyHolder.reference == "http://benefitsinc.com/FHIR/Organization/CBI35" ) assert inst.relationship.coding[0].code == "self" assert inst.status == "active" assert inst.subscriber.reference == "Patient/4" assert inst.text.div == ( '
A human-readable' " rendering of the coverage
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "EHCPOL" assert inst.type.coding[0].display == "extended healthcare" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) def test_coverage_4(base_settings): """No. 4 tests collection for Coverage. Test File: coverage-example.json """ filename = base_settings["unittest_data_dir"] / "coverage-example.json" inst = coverage.Coverage.model_validate_json(filename.read_bytes()) assert "Coverage" == inst.get_resource_type() impl_coverage_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Coverage" == data["resourceType"] inst2 = coverage.Coverage(**data) impl_coverage_4(inst2) ================================================ FILE: fhir/resources/tests/test_coverageeligibilityrequest.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/CoverageEligibilityRequest Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import coverageeligibilityrequest from .conftest import ExternalValidatorModel def impl_coverageeligibilityrequest_1(inst): assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.id == "52345" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/coverageelegibilityrequest"} ).valueUri ) assert inst.identifier[0].value == "52345" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].focal is True assert inst.insurer.reference == "Organization/2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/pat1" assert inst.priority.coding[0].code == "normal" assert inst.provider.reference == "Organization/1" assert inst.purpose[0] == "validation" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the CoverageEligibilityRequest
" ) assert inst.text.status == "generated" def test_coverageeligibilityrequest_1(base_settings): """No. 1 tests collection for CoverageEligibilityRequest. Test File: coverageeligibilityrequest-example.json """ filename = ( base_settings["unittest_data_dir"] / "coverageeligibilityrequest-example.json" ) inst = coverageeligibilityrequest.CoverageEligibilityRequest.model_validate_json( filename.read_bytes() ) assert "CoverageEligibilityRequest" == inst.get_resource_type() impl_coverageeligibilityrequest_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CoverageEligibilityRequest" == data["resourceType"] inst2 = coverageeligibilityrequest.CoverageEligibilityRequest(**data) impl_coverageeligibilityrequest_1(inst2) def impl_coverageeligibilityrequest_2(inst): assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert ( inst.enterer.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalleyclinic.com/staff"} ).valueUri ) assert inst.enterer.identifier.value == "14" assert ( inst.facility.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://statecliniclicensor.com/clinicid"} ).valueUri ) assert inst.facility.identifier.value == "G35B9" assert inst.id == "52346" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/coverageelegibilityrequest"} ).valueUri ) assert inst.identifier[0].value == "52346" assert inst.insurance[0].businessArrangement == "NB8742" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurer.reference == "Organization/2" assert inst.item[0].category.coding[0].code == "69" assert inst.item[0].category.coding[0].display == "Maternity" assert ( inst.item[0].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-benefitcategory"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/pat1" assert inst.priority.coding[0].code == "normal" assert inst.provider.reference == "Organization/1" assert inst.purpose[0] == "validation" assert inst.purpose[1] == "benefits" assert ( inst.servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-09-17"}).valueDate ) assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the CoverageEligibilityRequest
" ) assert inst.text.status == "generated" def test_coverageeligibilityrequest_2(base_settings): """No. 2 tests collection for CoverageEligibilityRequest. Test File: coverageeligibilityrequest-example-2.json """ filename = ( base_settings["unittest_data_dir"] / "coverageeligibilityrequest-example-2.json" ) inst = coverageeligibilityrequest.CoverageEligibilityRequest.model_validate_json( filename.read_bytes() ) assert "CoverageEligibilityRequest" == inst.get_resource_type() impl_coverageeligibilityrequest_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CoverageEligibilityRequest" == data["resourceType"] inst2 = coverageeligibilityrequest.CoverageEligibilityRequest(**data) impl_coverageeligibilityrequest_2(inst2) ================================================ FILE: fhir/resources/tests/test_coverageeligibilityresponse.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/CoverageEligibilityResponse Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import coverageeligibilityresponse from .conftest import ExternalValidatorModel def impl_coverageeligibilityresponse_1(inst): assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.disposition == "Policy is currently in-force." assert inst.id == "E2500" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/coverageeligibilityresponse"} ).valueUri ) assert inst.identifier[0].value == "881234" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].inforce is True assert inst.insurer.reference == "Organization/2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "complete" assert inst.patient.reference == "Patient/pat1" assert inst.purpose[0] == "validation" assert inst.request.reference == ( "http://www.BenefitsInc.com/fhir/coverageeligibilityrequest/2" "25476332402" ) assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the CoverageEligibilityResponse.
" ) assert inst.text.status == "generated" def test_coverageeligibilityresponse_1(base_settings): """No. 1 tests collection for CoverageEligibilityResponse. Test File: coverageeligibilityresponse-example.json """ filename = ( base_settings["unittest_data_dir"] / "coverageeligibilityresponse-example.json" ) inst = coverageeligibilityresponse.CoverageEligibilityResponse.model_validate_json( filename.read_bytes() ) assert "CoverageEligibilityResponse" == inst.get_resource_type() impl_coverageeligibilityresponse_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CoverageEligibilityResponse" == data["resourceType"] inst2 = coverageeligibilityresponse.CoverageEligibilityResponse(**data) impl_coverageeligibilityresponse_1(inst2) def impl_coverageeligibilityresponse_2(inst): assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-16"} ).valueDateTime ) assert inst.disposition == ( "Eligibiliy request could not be processed, please address " "errors before submitting." ) assert inst.error[0].code.coding[0].code == "a001" assert ( inst.error[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/adjudication-error"} ).valueUri ) assert inst.form.coding[0].code == "ELRSP/2017/01" assert ( inst.form.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://national.org/form"} ).valueUri ) assert inst.id == "E2503" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/coverageeligibilityresponse"} ).valueUri ) assert inst.identifier[0].value == "8812343" assert inst.insurer.reference == "Organization/2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "error" assert inst.patient.reference == "Patient/f201" assert inst.purpose[0] == "validation" assert inst.request.reference == ( "http://www.BenefitsInc.com/fhir/coverageeligibilityresponse/" "225476332406" ) assert ( inst.requestor.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://national.org/clinic"} ).valueUri ) assert inst.requestor.identifier.value == "OR1234" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the CoverageEligibilityResponse.
" ) assert inst.text.status == "generated" def test_coverageeligibilityresponse_2(base_settings): """No. 2 tests collection for CoverageEligibilityResponse. Test File: coverageeligibilityresponse-example-error.json """ filename = ( base_settings["unittest_data_dir"] / "coverageeligibilityresponse-example-error.json" ) inst = coverageeligibilityresponse.CoverageEligibilityResponse.model_validate_json( filename.read_bytes() ) assert "CoverageEligibilityResponse" == inst.get_resource_type() impl_coverageeligibilityresponse_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CoverageEligibilityResponse" == data["resourceType"] inst2 = coverageeligibilityresponse.CoverageEligibilityResponse(**data) impl_coverageeligibilityresponse_2(inst2) def impl_coverageeligibilityresponse_3(inst): assert inst.contained[0].id == "coverage-1" assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-16"} ).valueDateTime ) assert inst.disposition == "Policy is currently in-force." assert inst.form.coding[0].code == "ELRSP/2017/01" assert ( inst.form.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://national.org/form"} ).valueUri ) assert inst.id == "E2502" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/coverageeligibilityresponse"} ).valueUri ) assert inst.identifier[0].value == "8812342" assert inst.insurance[0].coverage.reference == "#coverage-1" assert inst.insurance[0].inforce is True assert inst.insurance[0].item[0].benefit[0].allowedMoney.currency == "USD" assert float(inst.insurance[0].item[0].benefit[0].allowedMoney.value) == float( 500000 ) assert inst.insurance[0].item[0].benefit[0].type.coding[0].code == "benefit" assert inst.insurance[0].item[0].benefit[0].usedMoney.currency == "USD" assert float(inst.insurance[0].item[0].benefit[0].usedMoney.value) == float(3748.0) assert inst.insurance[0].item[0].benefit[1].allowedMoney.currency == "USD" assert float(inst.insurance[0].item[0].benefit[1].allowedMoney.value) == float(100) assert inst.insurance[0].item[0].benefit[1].type.coding[0].code == "copay-maximum" assert inst.insurance[0].item[0].benefit[2].allowedUnsignedInt == 20 assert inst.insurance[0].item[0].benefit[2].type.coding[0].code == "copay-percent" assert inst.insurance[0].item[0].category.coding[0].code == "30" assert ( inst.insurance[0].item[0].category.coding[0].display == "Health Benefit Plan Coverage" ) assert ( inst.insurance[0].item[0].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-benefitcategory"} ).valueUri ) assert inst.insurance[0].item[0].network.coding[0].code == "in" assert ( inst.insurance[0].item[0].network.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-network"} ).valueUri ) assert inst.insurance[0].item[0].term.coding[0].code == "annual" assert ( inst.insurance[0].item[0].term.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-term"} ).valueUri ) assert inst.insurance[0].item[0].unit.coding[0].code == "individual" assert ( inst.insurance[0].item[0].unit.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-unit"} ).valueUri ) assert inst.insurance[0].item[1].benefit[0].allowedMoney.currency == "USD" assert float(inst.insurance[0].item[1].benefit[0].allowedMoney.value) == float( 15000 ) assert inst.insurance[0].item[1].benefit[0].type.coding[0].code == "benefit" assert inst.insurance[0].item[1].category.coding[0].code == "69" assert inst.insurance[0].item[1].category.coding[0].display == "Maternity" assert ( inst.insurance[0].item[1].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-benefitcategory"} ).valueUri ) assert inst.insurance[0].item[1].network.coding[0].code == "in" assert ( inst.insurance[0].item[1].network.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-network"} ).valueUri ) assert inst.insurance[0].item[1].term.coding[0].code == "annual" assert ( inst.insurance[0].item[1].term.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-term"} ).valueUri ) assert inst.insurance[0].item[1].unit.coding[0].code == "individual" assert ( inst.insurance[0].item[1].unit.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-unit"} ).valueUri ) assert inst.insurance[0].item[2].benefit[0].allowedMoney.currency == "USD" assert float(inst.insurance[0].item[2].benefit[0].allowedMoney.value) == float(2000) assert inst.insurance[0].item[2].benefit[0].type.coding[0].code == "benefit" assert inst.insurance[0].item[2].category.coding[0].code == "F3" assert inst.insurance[0].item[2].category.coding[0].display == "Dental Coverage" assert ( inst.insurance[0].item[2].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-benefitcategory"} ).valueUri ) assert inst.insurance[0].item[2].network.coding[0].code == "in" assert ( inst.insurance[0].item[2].network.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-network"} ).valueUri ) assert inst.insurance[0].item[2].term.coding[0].code == "annual" assert ( inst.insurance[0].item[2].term.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-term"} ).valueUri ) assert inst.insurance[0].item[2].unit.coding[0].code == "individual" assert ( inst.insurance[0].item[2].unit.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-unit"} ).valueUri ) assert inst.insurance[0].item[3].category.coding[0].code == "F6" assert inst.insurance[0].item[3].category.coding[0].display == "Vision Coverage" assert ( inst.insurance[0].item[3].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-benefitcategory"} ).valueUri ) assert inst.insurance[0].item[3].description == ( "Vision products and services such as exams, glasses and " "contact lenses." ) assert inst.insurance[0].item[3].excluded is True assert inst.insurance[0].item[3].name == "Vision" assert inst.insurer.reference == "Organization/2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "complete" assert inst.patient.reference == "Patient/f201" assert inst.purpose[0] == "validation" assert inst.purpose[1] == "benefits" assert inst.request.reference == ( "http://www.BenefitsInc.com/fhir/coverageeligibilityrequest/2" "25476332405" ) assert ( inst.requestor.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://national.org/clinic"} ).valueUri ) assert inst.requestor.identifier.value == "OR1234" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the CoverageEligibilityResponse.
" ) assert inst.text.status == "generated" def test_coverageeligibilityresponse_3(base_settings): """No. 3 tests collection for CoverageEligibilityResponse. Test File: coverageeligibilityresponse-example-benefits-2.json """ filename = ( base_settings["unittest_data_dir"] / "coverageeligibilityresponse-example-benefits-2.json" ) inst = coverageeligibilityresponse.CoverageEligibilityResponse.model_validate_json( filename.read_bytes() ) assert "CoverageEligibilityResponse" == inst.get_resource_type() impl_coverageeligibilityresponse_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CoverageEligibilityResponse" == data["resourceType"] inst2 = coverageeligibilityresponse.CoverageEligibilityResponse(**data) impl_coverageeligibilityresponse_3(inst2) def impl_coverageeligibilityresponse_4(inst): assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.disposition == "Policy is currently in-force." assert inst.id == "E2501" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/coverageeligibilityresponse"} ).valueUri ) assert inst.identifier[0].value == "881234" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].inforce is True assert inst.insurance[0].item[0].benefit[0].allowedMoney.currency == "SAR" assert float(inst.insurance[0].item[0].benefit[0].allowedMoney.value) == float( 500000 ) assert inst.insurance[0].item[0].benefit[0].type.coding[0].code == "benefit" assert inst.insurance[0].item[0].benefit[1].allowedMoney.currency == "SAR" assert float(inst.insurance[0].item[0].benefit[1].allowedMoney.value) == float(100) assert inst.insurance[0].item[0].benefit[1].type.coding[0].code == "copay-maximum" assert inst.insurance[0].item[0].benefit[2].allowedUnsignedInt == 20 assert inst.insurance[0].item[0].benefit[2].type.coding[0].code == "copay-percent" assert inst.insurance[0].item[0].category.coding[0].code == "30" assert ( inst.insurance[0].item[0].category.coding[0].display == "Health Benefit Plan Coverage" ) assert ( inst.insurance[0].item[0].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-benefitcategory"} ).valueUri ) assert inst.insurance[0].item[0].network.coding[0].code == "in" assert ( inst.insurance[0].item[0].network.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-network"} ).valueUri ) assert inst.insurance[0].item[0].term.coding[0].code == "annual" assert ( inst.insurance[0].item[0].term.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-term"} ).valueUri ) assert inst.insurance[0].item[0].unit.coding[0].code == "individual" assert ( inst.insurance[0].item[0].unit.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-unit"} ).valueUri ) assert inst.insurance[0].item[1].benefit[0].allowedMoney.currency == "SAR" assert float(inst.insurance[0].item[1].benefit[0].allowedMoney.value) == float( 15000 ) assert inst.insurance[0].item[1].benefit[0].type.coding[0].code == "benefit" assert inst.insurance[0].item[1].category.coding[0].code == "69" assert inst.insurance[0].item[1].category.coding[0].display == "Maternity" assert ( inst.insurance[0].item[1].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-benefitcategory"} ).valueUri ) assert inst.insurance[0].item[1].network.coding[0].code == "in" assert ( inst.insurance[0].item[1].network.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-network"} ).valueUri ) assert inst.insurance[0].item[1].term.coding[0].code == "annual" assert ( inst.insurance[0].item[1].term.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-term"} ).valueUri ) assert inst.insurance[0].item[1].unit.coding[0].code == "individual" assert ( inst.insurance[0].item[1].unit.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-unit"} ).valueUri ) assert inst.insurance[0].item[2].benefit[0].allowedMoney.currency == "SAR" assert float(inst.insurance[0].item[2].benefit[0].allowedMoney.value) == float(2000) assert inst.insurance[0].item[2].benefit[0].type.coding[0].code == "benefit" assert inst.insurance[0].item[2].category.coding[0].code == "F3" assert inst.insurance[0].item[2].category.coding[0].display == "Dental Coverage" assert ( inst.insurance[0].item[2].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-benefitcategory"} ).valueUri ) assert inst.insurance[0].item[2].network.coding[0].code == "in" assert ( inst.insurance[0].item[2].network.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-network"} ).valueUri ) assert inst.insurance[0].item[2].term.coding[0].code == "annual" assert ( inst.insurance[0].item[2].term.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-term"} ).valueUri ) assert inst.insurance[0].item[2].unit.coding[0].code == "individual" assert ( inst.insurance[0].item[2].unit.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-unit"} ).valueUri ) assert inst.insurance[0].item[3].benefit[0].allowedMoney.currency == "SAR" assert float(inst.insurance[0].item[3].benefit[0].allowedMoney.value) == float(400) assert inst.insurance[0].item[3].benefit[0].type.coding[0].code == "benefit" assert inst.insurance[0].item[3].category.coding[0].code == "F6" assert inst.insurance[0].item[3].category.coding[0].display == "Vision Coverage" assert ( inst.insurance[0].item[3].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-benefitcategory"} ).valueUri ) assert inst.insurance[0].item[3].network.coding[0].code == "in" assert ( inst.insurance[0].item[3].network.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-network"} ).valueUri ) assert inst.insurance[0].item[3].term.coding[0].code == "annual" assert ( inst.insurance[0].item[3].term.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-term"} ).valueUri ) assert inst.insurance[0].item[3].unit.coding[0].code == "individual" assert ( inst.insurance[0].item[3].unit.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-unit"} ).valueUri ) assert inst.insurance[0].item[4].benefit[0].allowedString == "shared" assert inst.insurance[0].item[4].benefit[0].type.coding[0].code == "room" assert inst.insurance[0].item[4].benefit[1].allowedMoney.currency == "SAR" assert float(inst.insurance[0].item[4].benefit[1].allowedMoney.value) == float(600) assert inst.insurance[0].item[4].benefit[1].type.coding[0].code == "benefit" assert inst.insurance[0].item[4].category.coding[0].code == "49" assert ( inst.insurance[0].item[4].category.coding[0].display == "Hospital Room and Board" ) assert ( inst.insurance[0].item[4].category.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-benefitcategory"} ).valueUri ) assert inst.insurance[0].item[4].network.coding[0].code == "in" assert ( inst.insurance[0].item[4].network.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-network"} ).valueUri ) assert inst.insurance[0].item[4].term.coding[0].code == "day" assert ( inst.insurance[0].item[4].term.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-term"} ).valueUri ) assert inst.insurance[0].item[4].unit.coding[0].code == "individual" assert ( inst.insurance[0].item[4].unit.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/benefit-unit"} ).valueUri ) assert inst.insurer.reference == "Organization/2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "complete" assert inst.patient.reference == "Patient/pat1" assert inst.purpose[0] == "validation" assert inst.purpose[1] == "benefits" assert inst.request.reference == ( "http://www.BenefitsInc.com/fhir/coverageeligibilityresponse/" "225476332402" ) assert ( inst.servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-09-17"}).valueDate ) assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the CoverageEligibilityResponse.
" ) assert inst.text.status == "generated" def test_coverageeligibilityresponse_4(base_settings): """No. 4 tests collection for CoverageEligibilityResponse. Test File: coverageeligibilityresponse-example-benefits.json """ filename = ( base_settings["unittest_data_dir"] / "coverageeligibilityresponse-example-benefits.json" ) inst = coverageeligibilityresponse.CoverageEligibilityResponse.model_validate_json( filename.read_bytes() ) assert "CoverageEligibilityResponse" == inst.get_resource_type() impl_coverageeligibilityresponse_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "CoverageEligibilityResponse" == data["resourceType"] inst2 = coverageeligibilityresponse.CoverageEligibilityResponse(**data) impl_coverageeligibilityresponse_4(inst2) ================================================ FILE: fhir/resources/tests/test_detectedissue.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/DetectedIssue Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import detectedissue from .conftest import ExternalValidatorModel def impl_detectedissue_1(inst): assert inst.id == "allergy" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "final" assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" def test_detectedissue_1(base_settings): """No. 1 tests collection for DetectedIssue. Test File: detectedissue-example-allergy.json """ filename = base_settings["unittest_data_dir"] / "detectedissue-example-allergy.json" inst = detectedissue.DetectedIssue.model_validate_json(filename.read_bytes()) assert "DetectedIssue" == inst.get_resource_type() impl_detectedissue_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DetectedIssue" == data["resourceType"] inst2 = detectedissue.DetectedIssue(**data) impl_detectedissue_1(inst2) def impl_detectedissue_2(inst): assert inst.author.reference == "Device/example" assert inst.code.coding[0].code == "DUPTHPY" assert inst.code.coding[0].display == "Duplicate Therapy Alert" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.detail == "Similar test was performed within the past 14 days" assert inst.id == "duplicate" assert ( inst.identifiedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-05-08"} ).valueDateTime ) assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345" assert ( inst.implicated[0].display == "Chest CT - ordered May 8, 2013 by Dr. Adam Careful" ) assert inst.implicated[0].reference == "ServiceRequest/di" assert inst.implicated[1].display == ( "Image 1 from Series 3: CT Images on Patient MINT (MINT1234) " "taken at 1-Jan 2011 01:20 AM" ) assert inst.implicated[1].reference == "ImagingStudy/example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.reference == ExternalValidatorModel.model_validate( { "valueUri": "http://www.tmhp.com/RadiologyClinicalDecisionSupport/2011/CHEST%20IMAGING%20GUIDELINES%202011.pdf" } ).valueUri ) assert inst.status == "final" assert inst.subject.reference == "Patient/dicom" assert inst.text.status == "generated" def test_detectedissue_2(base_settings): """No. 2 tests collection for DetectedIssue. Test File: detectedissue-example-dup.json """ filename = base_settings["unittest_data_dir"] / "detectedissue-example-dup.json" inst = detectedissue.DetectedIssue.model_validate_json(filename.read_bytes()) assert "DetectedIssue" == inst.get_resource_type() impl_detectedissue_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DetectedIssue" == data["resourceType"] inst2 = detectedissue.DetectedIssue(**data) impl_detectedissue_2(inst2) def impl_detectedissue_3(inst): assert inst.category[0].coding[0].code == "DRG" assert inst.category[0].coding[0].display == "Drug Interaction Alert" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.code.coding[0].code == "DRG" assert inst.code.coding[0].display == "Drug Interaction Alert" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.id == "ddi" assert ( inst.identifiedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-01-05"} ).valueDateTime ) assert ( inst.implicated[0].display == "500 mg Acetaminophen tablet 1/day, PRN since 2010" ) assert inst.implicated[0].reference == "MedicationStatement/example001" assert inst.implicated[1].display == "Warfarin 1 MG TAB prescribed Jan. 15, 2015" assert inst.implicated[1].reference == "MedicationRequest/medrx0331" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mitigation[0].action.coding[0].code == "13" assert inst.mitigation[0].action.coding[0].display == "Stopped Concurrent Therapy" assert ( inst.mitigation[0].action.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.mitigation[0].action.text == ( "Asked patient to discontinue regular use of Tylenol and to " "consult with clinician if they need to resume to allow " "appropriate INR monitoring" ) assert inst.mitigation[0].author.display == "Dr. Adam Careful" assert inst.mitigation[0].author.reference == "Practitioner/example" assert ( inst.mitigation[0].date == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-01-05"} ).valueDateTime ) assert inst.severity == "high" assert inst.status == "final" assert inst.subject.reference == "Device/example" assert inst.text.status == "generated" def test_detectedissue_3(base_settings): """No. 3 tests collection for DetectedIssue. Test File: detectedissue-example.json """ filename = base_settings["unittest_data_dir"] / "detectedissue-example.json" inst = detectedissue.DetectedIssue.model_validate_json(filename.read_bytes()) assert "DetectedIssue" == inst.get_resource_type() impl_detectedissue_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DetectedIssue" == data["resourceType"] inst2 = detectedissue.DetectedIssue(**data) impl_detectedissue_3(inst2) def impl_detectedissue_4(inst): assert inst.id == "lab" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "final" assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" def test_detectedissue_4(base_settings): """No. 4 tests collection for DetectedIssue. Test File: detectedissue-example-lab.json """ filename = base_settings["unittest_data_dir"] / "detectedissue-example-lab.json" inst = detectedissue.DetectedIssue.model_validate_json(filename.read_bytes()) assert "DetectedIssue" == inst.get_resource_type() impl_detectedissue_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DetectedIssue" == data["resourceType"] inst2 = detectedissue.DetectedIssue(**data) impl_detectedissue_4(inst2) ================================================ FILE: fhir/resources/tests/test_device.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Device Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import device from .conftest import ExternalValidatorModel def impl_device_1(inst): assert inst.contact[0].system == "url" assert inst.contact[0].value == "http://acme.com" assert inst.id == "example-software" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/ehr/client-ids"} ).valueUri ) assert inst.identifier[0].value == "goodhealth" assert inst.manufacturer == "Acme Devices, Inc" assert inst.text.status == "generated" assert inst.type[0].text == "EHR" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/goodhealth/ehr/"} ).valueUri ) assert inst.version[0].value == "10.23-23423" def test_device_1(base_settings): """No. 1 tests collection for Device. Test File: device-example-software.json """ filename = base_settings["unittest_data_dir"] / "device-example-software.json" inst = device.Device.model_validate_json(filename.read_bytes()) assert "Device" == inst.get_resource_type() impl_device_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Device" == data["resourceType"] inst2 = device.Device(**data) impl_device_1(inst2) def impl_device_2(inst): assert ( inst.expirationDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2020-02-02"} ).valueDateTime ) assert inst.id == "example-udi3" assert inst.identifier[0].type.coding[0].code == "SNO" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].value == "XYZ456789012345678" assert inst.lotNumber == "LOT123456789012345" assert ( inst.manufactureDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-02-02"} ).valueDateTime ) assert inst.manufacturer == "GlobalMed, Inc" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].type == "user-friendly-name" assert inst.name[0].value == "Ultra Implantable" assert inst.status == "inactive" assert inst.text.status == "generated" assert inst.udiCarrier[0].carrierHRF == ( "+H123PARTNO1234567890120/$$420020216LOT123456789012345/SXYZ4" "56789012345678/16D20130202C" ) assert inst.udiCarrier[0].deviceIdentifier == "007444534255003288" assert inst.udiCarrier[0].entryType == "manual" assert ( inst.udiCarrier[0].issuer == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/hibcc"} ).valueUri ) assert ( inst.udiCarrier[0].jurisdiction == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/fda-udi"} ).valueUri ) def test_device_2(base_settings): """No. 2 tests collection for Device. Test File: device-example-udi3.json """ filename = base_settings["unittest_data_dir"] / "device-example-udi3.json" inst = device.Device.model_validate_json(filename.read_bytes()) assert "Device" == inst.get_resource_type() impl_device_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Device" == data["resourceType"] inst2 = device.Device(**data) impl_device_2(inst2) def impl_device_3(inst): assert inst.conformsTo[0].specification.coding[0].code == "528388" assert ( inst.conformsTo[0].specification.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert ( inst.conformsTo[0].specification.text == "MDC_DEV_SPEC_PROFILE_PULS_OXIM: Pulse Oximeter" ) assert inst.conformsTo[0].version == "1" assert inst.id == "NoninBlePulseOx" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.2.840.10004.1.1.1.0.0.1.0.0.1.2680"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "SYSID" assert inst.identifier[0].type.coding[0].display == "System Identifier" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/ContinuaDeviceIdentifiers" } ).valueUri ) assert inst.identifier[0].value == "74-E8-FF-FE-FF-05-1C-00" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/eui-48"} ).valueUri ) assert inst.identifier[1].type.coding[0].code == "BTMAC" assert inst.identifier[1].type.coding[0].display == "Bluetooth Address" assert ( inst.identifier[1].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/ContinuaDeviceIdentifiers" } ).valueUri ) assert inst.identifier[1].value == "00-1C-05-FF-E8-74" assert inst.manufacturer == "Nonin_Medical_Inc." assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.modelNumber == "Model 3230" assert inst.name[0].type == "user-friendly-name" assert inst.name[0].value == "Nonin3230_501900083" assert inst.property[0].type.coding[0].code == "532353" assert ( inst.property[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert inst.property[0].type.text == ( "MDC_REG_CERT_DATA_CONTINUA_CERT_DEV_LIST: Continua certified" " device list" ) assert inst.property[0].valueCodeableConcept.coding[0].code == "4" assert ( inst.property[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ContinuaPAN"} ).valueUri ) assert inst.property[1].type.coding[0].code == "532354.0" assert ( inst.property[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ASN1ToHL7"} ).valueUri ) assert inst.property[1].type.text == "regulation-status" assert inst.property[1].valueCodeableConcept.coding[0].code == "N" assert ( inst.property[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0136"} ).valueUri ) assert inst.property[1].valueCodeableConcept.text == "Device is Regulated" assert inst.property[2].type.coding[0].code == "68220" assert ( inst.property[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert ( inst.property[2].type.text == "MDC_TIME_SYNC_PROTOCOL: Time synchronization protocol" ) assert inst.property[2].valueCodeableConcept.coding[0].code == "532224" assert ( inst.property[2].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert ( inst.property[2].valueCodeableConcept.text == "MDC_TIME_SYNC_NONE: No time synchronization" ) assert inst.property[3].type.coding[0].code == "68219.0" assert ( inst.property[3].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ASN1ToHL7"} ).valueUri ) assert inst.property[3].type.text == "mds-time-capab-real-time-clock" assert inst.property[3].valueCodeableConcept.coding[0].code == "Y" assert ( inst.property[3].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0136"} ).valueUri ) assert inst.property[3].valueCodeableConcept.text == "real time clock supported" assert inst.property[4].type.coding[0].code == "68219.1" assert ( inst.property[4].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ASN1ToHL7"} ).valueUri ) assert inst.property[4].type.text == "mds-time-capab-set-clock" assert inst.property[4].valueCodeableConcept.coding[0].code == "Y" assert ( inst.property[4].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0136"} ).valueUri ) assert inst.property[4].valueCodeableConcept.text == "setting the time supported" assert inst.serialNumber == "501900083" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "65573" assert inst.type[0].coding[0].display == "MDC_MOC_VMS_MDS_SIMP" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert inst.type[0].text == "MDC_MOC_VMS_MDS_SIMP: Personal Health Device" assert inst.udiCarrier[0].carrierHRF == "(01)120359741556(21)501900083" assert inst.udiCarrier[0].deviceIdentifier == "120359741556" assert inst.udiCarrier[0].entryType == "unknown" assert ( inst.udiCarrier[0].issuer == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/gs1-di"} ).valueUri ) assert ( inst.udiCarrier[0].jurisdiction == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/fda-udi"} ).valueUri ) assert inst.version[0].type.coding[0].code == "531976" assert ( inst.version[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert inst.version[0].type.text == "MDC_ID_PROD_SPEC_FW: Firmware revision" assert inst.version[0].value == "r2.1" assert inst.version[1].type.coding[0].code == "531975" assert ( inst.version[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert inst.version[1].type.text == "MDC_ID_PROD_SPEC_SW: Software revision" assert inst.version[1].value == "r1.5 9.7" assert inst.version[2].type.coding[0].code == "531974" assert ( inst.version[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert inst.version[2].type.text == "MDC_ID_PROD_SPEC_HW: Hardware revision" assert inst.version[2].value == "r1.0" assert inst.version[3].type.coding[0].code == "532352" assert ( inst.version[3].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert ( inst.version[3].type.text == "MDC_REG_CERT_DATA_CONTINUA_VERSION: Continua version" ) assert inst.version[3].value == "6.0" def test_device_3(base_settings): """No. 3 tests collection for Device. Test File: device-example-NoninBlePulseOx.json """ filename = ( base_settings["unittest_data_dir"] / "device-example-NoninBlePulseOx.json" ) inst = device.Device.model_validate_json(filename.read_bytes()) assert "Device" == inst.get_resource_type() impl_device_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Device" == data["resourceType"] inst2 = device.Device(**data) impl_device_3(inst2) def impl_device_4(inst): assert ( inst.expirationDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-02-01"} ).valueDateTime ) assert inst.id == "example-udi2" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/iccbba-din"} ).valueUri ) assert inst.identifier[0].value == "A99971312345600" assert ( inst.manufactureDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-02-01"} ).valueDateTime ) assert inst.manufacturer == "Acme Devices, Inc" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "inactive" assert inst.text.status == "generated" assert inst.udiCarrier[0].deviceIdentifier == "A9999XYZ100T0474" assert ( inst.udiCarrier[0].issuer == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/iccbba-other"} ).valueUri ) assert ( inst.udiCarrier[0].jurisdiction == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/fda-udi"} ).valueUri ) def test_device_4(base_settings): """No. 4 tests collection for Device. Test File: device-example-udi2.json """ filename = base_settings["unittest_data_dir"] / "device-example-udi2.json" inst = device.Device.model_validate_json(filename.read_bytes()) assert "Device" == inst.get_resource_type() impl_device_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Device" == data["resourceType"] inst2 = device.Device(**data) impl_device_4(inst2) def impl_device_5(inst): assert inst.conformsTo[0].specification.coding[0].code == "528392" assert ( inst.conformsTo[0].specification.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert ( inst.conformsTo[0].specification.text == "MDC_DEV_SPEC_PROFILE_TEMP: Thermometer" ) assert inst.conformsTo[0].version == "1" assert inst.id == "PhilipsThermometer" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.2.840.10004.1.1.1.0.0.1.0.0.1.2680"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "SYSID" assert inst.identifier[0].type.coding[0].display == "System Identifier" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/ContinuaDeviceIdentifiers" } ).valueUri ) assert inst.identifier[0].value == "1C-87-74-FF-FE-00-EC-20" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/eui-48"} ).valueUri ) assert inst.identifier[1].type.coding[0].code == "BTMAC" assert inst.identifier[1].type.coding[0].display == "Bluetooth Address" assert ( inst.identifier[1].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/ContinuaDeviceIdentifiers" } ).valueUri ) assert inst.identifier[1].value == "1C-87-74-00-EC-20" assert inst.manufacturer == "Philips" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.modelNumber == "DL8740" assert inst.name[0].type == "user-friendly-name" assert inst.name[0].value == "Philips ear thermometer" assert inst.property[0].type.coding[0].code == "532353" assert ( inst.property[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert inst.property[0].type.text == ( "MDC_REG_CERT_DATA_CONTINUA_CERT_DEV_LIST: Continua certified" " device list" ) assert inst.property[0].valueCodeableConcept.coding[0].code == "32776" assert ( inst.property[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ContinuaPAN"} ).valueUri ) assert inst.property[1].type.coding[0].code == "532354.0" assert ( inst.property[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ASN1ToHL7"} ).valueUri ) assert inst.property[1].type.text == "regulation-status" assert inst.property[1].valueCodeableConcept.coding[0].code == "N" assert ( inst.property[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0136"} ).valueUri ) assert inst.property[1].valueCodeableConcept.text == "Device is Regulated" assert inst.property[2].type.coding[0].code == "68220" assert ( inst.property[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert ( inst.property[2].type.text == "MDC_TIME_SYNC_PROTOCOL: Time synchronization protocol" ) assert inst.property[2].valueCodeableConcept.coding[0].code == "532224" assert ( inst.property[2].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert ( inst.property[2].valueCodeableConcept.text == "MDC_TIME_SYNC_NONE: No time synchronization" ) assert inst.property[3].type.coding[0].code == "68219.0" assert ( inst.property[3].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ASN1ToHL7"} ).valueUri ) assert inst.property[3].type.text == "mds-time-capab-real-time-clock" assert inst.property[3].valueCodeableConcept.coding[0].code == "Y" assert ( inst.property[3].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0136"} ).valueUri ) assert inst.property[3].valueCodeableConcept.text == "real time clock supported" assert inst.property[4].type.coding[0].code == "68219.1" assert ( inst.property[4].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ASN1ToHL7"} ).valueUri ) assert inst.property[4].type.text == "mds-time-capab-set-clock" assert inst.property[4].valueCodeableConcept.coding[0].code == "Y" assert ( inst.property[4].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0136"} ).valueUri ) assert inst.property[4].valueCodeableConcept.text == "setting the time supported" assert inst.serialNumber == "162502000528" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "65573" assert inst.type[0].coding[0].display == "MDC_MOC_VMS_MDS_SIMP" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert inst.type[0].text == "MDC_MOC_VMS_MDS_SIMP: Personal Health Device" assert inst.udiCarrier[0].carrierHRF == "(01)31368092380192(21)162502000528" assert inst.udiCarrier[0].deviceIdentifier == "31368092380192" assert inst.udiCarrier[0].entryType == "unknown" assert ( inst.udiCarrier[0].issuer == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/gs1-di"} ).valueUri ) assert ( inst.udiCarrier[0].jurisdiction == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/fda-udi"} ).valueUri ) assert inst.version[0].type.coding[0].code == "531976" assert ( inst.version[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert inst.version[0].type.text == "MDC_ID_PROD_SPEC_FW: Firmware revision" assert inst.version[0].value == "1.60" assert inst.version[1].type.coding[0].code == "531975" assert ( inst.version[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert inst.version[1].type.text == "MDC_ID_PROD_SPEC_SW: Software revision" assert inst.version[1].value == "1.50" assert inst.version[2].type.coding[0].code == "531974" assert ( inst.version[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert inst.version[2].type.text == "MDC_ID_PROD_SPEC_SW: Hardware revision" assert inst.version[2].value == "1.40" assert inst.version[3].type.coding[0].code == "532352" assert ( inst.version[3].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert ( inst.version[3].type.text == "MDC_REG_CERT_DATA_CONTINUA_VERSION: Continua version" ) assert inst.version[3].value == "5.1" def test_device_5(base_settings): """No. 5 tests collection for Device. Test File: device-example-PhilipsThermometer.json """ filename = ( base_settings["unittest_data_dir"] / "device-example-PhilipsThermometer.json" ) inst = device.Device.model_validate_json(filename.read_bytes()) assert "Device" == inst.get_resource_type() impl_device_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Device" == data["resourceType"] inst2 = device.Device(**data) impl_device_5(inst2) def impl_device_6(inst): assert inst.displayName == "Lavender Tube" assert inst.id == "device-example-specimen-container-lavender-vacutainer" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/containers/id"} ).valueUri ) assert inst.identifier[0].value == "345675" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.property[0].type.coding[0].code == "tube-type" assert inst.property[0].type.coding[0].display == "Tube Type" assert ( inst.property[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/containers/codes"} ).valueUri ) assert inst.property[0].valueCodeableConcept.coding[0].code == "lavender" assert inst.property[0].valueCodeableConcept.coding[0].display == "lavender-tube" assert ( inst.property[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/containers/types"} ).valueUri ) assert inst.property[1].type.coding[0].code == "amount" assert inst.property[1].type.coding[0].display == "Amount" assert ( inst.property[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/containers/codes"} ).valueUri ) assert inst.property[1].valueCodeableConcept.coding[0].code == "4.5mL" assert inst.property[1].valueCodeableConcept.coding[0].display == "4.5 mL" assert ( inst.property[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/containers/capacities"} ).valueUri ) assert inst.property[2].type.coding[0].code == "additive" assert inst.property[2].type.coding[0].display == "Additive" assert ( inst.property[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/containers/codes"} ).valueUri ) assert inst.property[2].valueCodeableConcept.coding[0].code == "EDTA" assert inst.property[2].valueCodeableConcept.coding[0].display == "EDTA" assert ( inst.property[2].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/containers/additive"} ).valueUri ) assert inst.text.status == "generated" def test_device_6(base_settings): """No. 6 tests collection for Device. Test File: device-example-specimen-container-lavender-vacutainer.json """ filename = ( base_settings["unittest_data_dir"] / "device-example-specimen-container-lavender-vacutainer.json" ) inst = device.Device.model_validate_json(filename.read_bytes()) assert "Device" == inst.get_resource_type() impl_device_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Device" == data["resourceType"] inst2 = device.Device(**data) impl_device_6(inst2) def impl_device_7(inst): assert inst.conformsTo[0].specification.coding[0].code == "528392" assert ( inst.conformsTo[0].specification.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert ( inst.conformsTo[0].specification.text == "MDC_DEV_SPEC_PROFILE_TEMP: Thermometer" ) assert inst.conformsTo[0].version == "1" assert inst.id == "KinsaThermometer" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.2.840.10004.1.1.1.0.0.1.0.0.1.2680"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "SYSID" assert inst.identifier[0].type.coding[0].display == "System Identifier" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/ContinuaDeviceIdentifiers" } ).valueUri ) assert inst.identifier[0].value == "00-00-52-49-20-45-4C-42" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/eui-48"} ).valueUri ) assert inst.identifier[1].type.coding[0].code == "BTMAC" assert inst.identifier[1].type.coding[0].display == "Bluetooth Address" assert ( inst.identifier[1].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/ContinuaDeviceIdentifiers" } ).valueUri ) assert inst.identifier[1].value == "10-CE-A9-80-14-66" assert inst.manufacturer == "Kinsa" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.modelNumber == "KS_1i9JfKh" assert inst.name[0].type == "user-friendly-name" assert inst.name[0].value == "KS_1i9JfKh" assert inst.property[0].type.coding[0].code == "68220" assert ( inst.property[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert ( inst.property[0].type.text == "MDC_TIME_SYNC_PROTOCOL: Time synchronization protocol" ) assert inst.property[0].valueCodeableConcept.coding[0].code == "532224" assert ( inst.property[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert ( inst.property[0].valueCodeableConcept.text == "MDC_TIME_SYNC_NONE: No time synchronization" ) assert inst.serialNumber == "1i9JfKh" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "65573" assert inst.type[0].coding[0].display == "MDC_MOC_VMS_MDS_SIMP" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert inst.type[0].text == "MDC_MOC_VMS_MDS_SIMP: Personal Health Device" assert inst.udiCarrier[0].carrierHRF == "(01)18479793050726(21)1i9JfKh" assert inst.udiCarrier[0].deviceIdentifier == "18479793050726" assert inst.udiCarrier[0].entryType == "unknown" assert ( inst.udiCarrier[0].issuer == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/gs1-di"} ).valueUri ) assert ( inst.udiCarrier[0].jurisdiction == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/fda-udi"} ).valueUri ) assert inst.version[0].type.coding[0].code == "531976" assert ( inst.version[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert inst.version[0].type.text == "MDC_ID_PROD_SPEC_FW: Firmware revision" assert inst.version[0].value == "1.00" assert inst.version[1].type.coding[0].code == "531975" assert ( inst.version[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert inst.version[1].type.text == "MDC_ID_PROD_SPEC_SW: Software revision" assert inst.version[1].value == "V2.19" assert inst.version[2].type.coding[0].code == "531974" assert ( inst.version[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert inst.version[2].type.text == "MDC_ID_PROD_SPEC_SW: Hardware revision" assert inst.version[2].value == "1.00" def test_device_7(base_settings): """No. 7 tests collection for Device. Test File: device-example-KinsaThermometer.json """ filename = ( base_settings["unittest_data_dir"] / "device-example-KinsaThermometer.json" ) inst = device.Device.model_validate_json(filename.read_bytes()) assert "Device" == inst.get_resource_type() impl_device_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Device" == data["resourceType"] inst2 = device.Device(**data) impl_device_7(inst2) def impl_device_8(inst): assert inst.id == "f001" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http:/goodhealthhospital/identifier/devices"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "active" assert inst.text.status == "generated" def test_device_8(base_settings): """No. 8 tests collection for Device. Test File: device-example-f001-feedingtube.json """ filename = ( base_settings["unittest_data_dir"] / "device-example-f001-feedingtube.json" ) inst = device.Device.model_validate_json(filename.read_bytes()) assert "Device" == inst.get_resource_type() impl_device_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Device" == data["resourceType"] inst2 = device.Device(**data) impl_device_8(inst2) def impl_device_9(inst): assert inst.id == "NGS-device" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/devices"} ).valueUri ) assert inst.identifier[0].value == "11111" assert inst.manufacturer == "Illumina" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].type == "user-friendly-name" assert inst.name[0].value == "NextSeq 550 Instrument" assert inst.status == "active" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "49062001" assert inst.type[0].coding[0].display == "Device (physical object)" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_device_9(base_settings): """No. 9 tests collection for Device. Test File: Device-NGS-device.json """ filename = base_settings["unittest_data_dir"] / "Device-NGS-device.json" inst = device.Device.model_validate_json(filename.read_bytes()) assert "Device" == inst.get_resource_type() impl_device_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Device" == data["resourceType"] inst2 = device.Device(**data) impl_device_9(inst2) def impl_device_10(inst): assert inst.id == "Triodenovo-SW" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/devices"} ).valueUri ) assert inst.identifier[0].value == "11112" assert inst.manufacturer == "Vanderbilt Genetics Institute" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].type == "user-friendly-name" assert inst.name[0].value == "Triodenovo Software" assert inst.status == "active" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "706687001" assert inst.type[0].coding[0].display == "Software (physical object)" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version[0].value == "0.06" def test_device_10(base_settings): """No. 10 tests collection for Device. Test File: Device-Triodenovo-SW.json """ filename = base_settings["unittest_data_dir"] / "Device-Triodenovo-SW.json" inst = device.Device.model_validate_json(filename.read_bytes()) assert "Device" == inst.get_resource_type() impl_device_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Device" == data["resourceType"] inst2 = device.Device(**data) impl_device_10(inst2) ================================================ FILE: fhir/resources/tests/test_deviceassociation.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/DeviceAssociation Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import deviceassociation from .conftest import ExternalValidatorModel def impl_deviceassociation_1(inst): assert inst.device.reference == "Device/prod1" assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status.coding[0].code == "implanted" assert ( inst.status.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/deviceassociation-status"} ).valueUri ) assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" def test_deviceassociation_1(base_settings): """No. 1 tests collection for DeviceAssociation. Test File: deviceassociation-example.json """ filename = base_settings["unittest_data_dir"] / "deviceassociation-example.json" inst = deviceassociation.DeviceAssociation.model_validate_json( filename.read_bytes() ) assert "DeviceAssociation" == inst.get_resource_type() impl_deviceassociation_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DeviceAssociation" == data["resourceType"] inst2 = deviceassociation.DeviceAssociation(**data) impl_deviceassociation_1(inst2) ================================================ FILE: fhir/resources/tests/test_devicedefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/DeviceDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import devicedefinition from .conftest import ExternalValidatorModel def impl_devicedefinition_1(inst): assert inst.id == "example" assert inst.identifier[0].value == "0" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_devicedefinition_1(base_settings): """No. 1 tests collection for DeviceDefinition. Test File: devicedefinition-example.json """ filename = base_settings["unittest_data_dir"] / "devicedefinition-example.json" inst = devicedefinition.DeviceDefinition.model_validate_json(filename.read_bytes()) assert "DeviceDefinition" == inst.get_resource_type() impl_devicedefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DeviceDefinition" == data["resourceType"] inst2 = devicedefinition.DeviceDefinition(**data) impl_devicedefinition_1(inst2) ================================================ FILE: fhir/resources/tests/test_devicedispense.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/DeviceDispense Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import devicedispense from .conftest import ExternalValidatorModel def impl_devicedispense_1(inst): assert inst.device.concept.coding[0].code == "00613994223838" assert inst.device.concept.coding[0].display == "ADAPTA (TM) Pacemaker" assert ( inst.device.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.gs1.org/gtin"} ).valueUri ) assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" def test_devicedispense_1(base_settings): """No. 1 tests collection for DeviceDispense. Test File: devicedispense-example.json """ filename = base_settings["unittest_data_dir"] / "devicedispense-example.json" inst = devicedispense.DeviceDispense.model_validate_json(filename.read_bytes()) assert "DeviceDispense" == inst.get_resource_type() impl_devicedispense_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DeviceDispense" == data["resourceType"] inst2 = devicedispense.DeviceDispense(**data) impl_devicedispense_1(inst2) ================================================ FILE: fhir/resources/tests/test_devicemetric.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/DeviceMetric Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import devicemetric from .conftest import ExternalValidatorModel def impl_devicemetric_1(inst): assert inst.calibration[0].state == "calibrated" assert ( inst.calibration[0].time == ExternalValidatorModel.model_validate( {"valueInstant": "2016-12-28T09:03:04-05:00"} ).valueInstant ) assert inst.calibration[0].type == "two-point" assert inst.category == "measurement" assert inst.color == "blue" assert inst.device.reference == "Device/dev1" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodcare.org/devicemetric/id"} ).valueUri ) assert inst.identifier[0].value == "345675" assert inst.measurementFrequency.code == "Hz" assert ( inst.measurementFrequency.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.measurementFrequency.unit == "Hertz" assert float(inst.measurementFrequency.value) == float(1) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.operationalStatus == "on" assert inst.text.status == "generated" assert inst.type.coding[0].code == "150456" assert inst.type.coding[0].display == "MDC_PULS_OXIM_SAT_O2" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) assert inst.unit.coding[0].code == "262688" assert inst.unit.coding[0].display == "MDC_DIM_PERCENT" assert ( inst.unit.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:11073:10101"} ).valueUri ) def test_devicemetric_1(base_settings): """No. 1 tests collection for DeviceMetric. Test File: devicemetric-example.json """ filename = base_settings["unittest_data_dir"] / "devicemetric-example.json" inst = devicemetric.DeviceMetric.model_validate_json(filename.read_bytes()) assert "DeviceMetric" == inst.get_resource_type() impl_devicemetric_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DeviceMetric" == data["resourceType"] inst2 = devicemetric.DeviceMetric(**data) impl_devicemetric_1(inst2) ================================================ FILE: fhir/resources/tests/test_devicerequest.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/DeviceRequest Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import devicerequest from .conftest import ExternalValidatorModel def impl_devicerequest_1(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-05-08T09:33:27+07:00"} ).valueDateTime ) assert inst.basedOn[0].display == "Homecare - DM follow-up" assert inst.code.concept.coding[0].code == "43148-6" assert ( inst.code.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.code.concept.text == "Insulin delivery device panel" assert inst.encounter.display == "Encounter 1" assert inst.groupIdentifier.value == "ip_request1" assert inst.id == "insulinpump" assert inst.identifier[0].value == "ip_request1.1" assert inst.instantiatesCanonical[0] == ( "http://motivemi.com/artifacts/PlanDefinition/low-suicide-" "risk-order-set" ) assert inst.intent == "instance-order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "this is the right device brand and model" assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-05-08T09:33:27+07:00"} ).valueDateTime ) assert inst.performer.reference.display == "Nurse Rossignol" assert inst.priority == "routine" assert inst.reason[0].concept.text == "gastroparesis" assert inst.reason[1].reference.display == "Gastroparesis" assert inst.relevantHistory[0].display == "Request for unspecified device" assert inst.replaces[0].display == "CGM ambulatory" assert inst.requester.display == "Dr. Adam Careful" assert inst.requester.reference == "Practitioner/example" assert inst.status == "active" assert inst.subject.reference == "Patient/dicom" assert inst.supportingInfo[0].display == "Previous results" assert inst.text.status == "generated" def test_devicerequest_1(base_settings): """No. 1 tests collection for DeviceRequest. Test File: devicerequest-example-insulinpump.json """ filename = ( base_settings["unittest_data_dir"] / "devicerequest-example-insulinpump.json" ) inst = devicerequest.DeviceRequest.model_validate_json(filename.read_bytes()) assert "DeviceRequest" == inst.get_resource_type() impl_devicerequest_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DeviceRequest" == data["resourceType"] inst2 = devicerequest.DeviceRequest(**data) impl_devicerequest_1(inst2) def impl_devicerequest_2(inst): assert inst.code.concept.coding[0].code == "lens" assert ( inst.code.concept.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct" } ).valueUri ) assert ( inst.groupIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org"} ).valueUri ) assert inst.groupIdentifier.value == "15013" assert inst.id == "left-lens" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.happysight.com/prescription"} ).valueUri ) assert inst.identifier[0].value == "15013L" assert inst.intent == "original-order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-06-15"} ).valueDateTime ) assert inst.parameter[0].code.coding[0].code == "28842-3" assert ( inst.parameter[0].code.coding[0].display == "Sphere distance Glasses prescription.lens - left" ) assert ( inst.parameter[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.parameter[0].code.text == "sphere, left lens" assert inst.parameter[0].valueQuantity.code == "[diop]" assert ( inst.parameter[0].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.parameter[0].valueQuantity.unit == "Diopter" assert float(inst.parameter[0].valueQuantity.value) == float(-1.0) assert inst.parameter[1].code.coding[0].code == "28843-1" assert ( inst.parameter[1].code.coding[0].display == "Cylinder base distance Glasses prescription.lens - left" ) assert ( inst.parameter[1].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.parameter[1].code.text == "cylinder, left lens" assert inst.parameter[1].valueQuantity.code == "[diop]" assert ( inst.parameter[1].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.parameter[1].valueQuantity.unit == "Diopter" assert float(inst.parameter[1].valueQuantity.value) == float(-0.5) assert inst.parameter[2].code.coding[0].code == "28844-9" assert ( inst.parameter[2].code.coding[0].display == " Axis distance Glasses prescription.lens - left" ) assert ( inst.parameter[2].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.parameter[2].code.text == "axis, left lens" assert inst.parameter[2].valueQuantity.code == "deg" assert ( inst.parameter[2].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.parameter[2].valueQuantity.unit == "Degrees" assert float(inst.parameter[2].valueQuantity.value) == float(180) assert inst.requester.reference == "Practitioner/example" assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_devicerequest_2(base_settings): """No. 2 tests collection for DeviceRequest. Test File: devicerequest-left-lens.json """ filename = base_settings["unittest_data_dir"] / "devicerequest-left-lens.json" inst = devicerequest.DeviceRequest.model_validate_json(filename.read_bytes()) assert "DeviceRequest" == inst.get_resource_type() impl_devicerequest_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DeviceRequest" == data["resourceType"] inst2 = devicerequest.DeviceRequest(**data) impl_devicerequest_2(inst2) def impl_devicerequest_3(inst): assert inst.code.concept.coding[0].code == "lens" assert ( inst.code.concept.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct" } ).valueUri ) assert ( inst.groupIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org"} ).valueUri ) assert inst.groupIdentifier.value == "15013" assert inst.id == "right-lens" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.happysight.com/prescription"} ).valueUri ) assert inst.identifier[0].value == "15013R" assert inst.intent == "original-order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-06-15"} ).valueDateTime ) assert inst.parameter[0].code.coding[0].code == "28826-6" assert ( inst.parameter[0].code.coding[0].display == "Sphere distance Glasses prescription.lens - right" ) assert ( inst.parameter[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.parameter[0].code.text == "sphere, right lens" assert inst.parameter[0].valueQuantity.code == "[diop]" assert ( inst.parameter[0].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.parameter[0].valueQuantity.unit == "Diopter" assert float(inst.parameter[0].valueQuantity.value) == float(-2.0) assert inst.parameter[1].code.coding[0].code == "28829-0" assert ( inst.parameter[1].code.coding[0].display == "Prism base distance Glasses prescription.lens - right" ) assert ( inst.parameter[1].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.parameter[1].code.text == "prisms, right lens" assert inst.parameter[1].valueQuantity.code == "[diop]" assert ( inst.parameter[1].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.parameter[1].valueQuantity.unit == "Diopter" assert float(inst.parameter[1].valueQuantity.value) == float(-2.0) assert inst.parameter[2].code.coding[0].code == "28810-0" assert inst.parameter[2].code.coding[0].display == "Add 1 LM glasses lens - right" assert ( inst.parameter[2].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.parameter[2].code.text == "add, right lens" assert inst.parameter[2].valueQuantity.code == "[diop]" assert ( inst.parameter[2].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.parameter[2].valueQuantity.unit == "Diopter" assert float(inst.parameter[2].valueQuantity.value) == float(2.0) assert inst.requester.reference == "Practitioner/example" assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_devicerequest_3(base_settings): """No. 3 tests collection for DeviceRequest. Test File: devicerequest-right-lens.json """ filename = base_settings["unittest_data_dir"] / "devicerequest-right-lens.json" inst = devicerequest.DeviceRequest.model_validate_json(filename.read_bytes()) assert "DeviceRequest" == inst.get_resource_type() impl_devicerequest_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DeviceRequest" == data["resourceType"] inst2 = devicerequest.DeviceRequest(**data) impl_devicerequest_3(inst2) def impl_devicerequest_4(inst): assert inst.code.reference.reference == "Device/example" assert inst.id == "example" assert inst.intent == "original-order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_devicerequest_4(base_settings): """No. 4 tests collection for DeviceRequest. Test File: devicerequest-example.json """ filename = base_settings["unittest_data_dir"] / "devicerequest-example.json" inst = devicerequest.DeviceRequest.model_validate_json(filename.read_bytes()) assert "DeviceRequest" == inst.get_resource_type() impl_devicerequest_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DeviceRequest" == data["resourceType"] inst2 = devicerequest.DeviceRequest(**data) impl_devicerequest_4(inst2) ================================================ FILE: fhir/resources/tests/test_deviceusage.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/DeviceUsage Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import deviceusage from .conftest import ExternalValidatorModel def impl_deviceusage_1(inst): assert inst.device.concept.text == "ACME defribillator" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http:goodhealth.org/identifiers"} ).valueUri ) assert inst.identifier[0].value == "51ebb7a9-4e3a-4360-9a05-0cc2d869086f" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert inst.reason[0].reference.display == "PHx of Appendectomy (surgery)" assert inst.reason[0].reference.reference == "Condition/example" assert inst.status == "active" assert inst.text.status == "generated" def test_deviceusage_1(base_settings): """No. 1 tests collection for DeviceUsage. Test File: deviceusage-example.json """ filename = base_settings["unittest_data_dir"] / "deviceusage-example.json" inst = deviceusage.DeviceUsage.model_validate_json(filename.read_bytes()) assert "DeviceUsage" == inst.get_resource_type() impl_deviceusage_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DeviceUsage" == data["resourceType"] inst2 = deviceusage.DeviceUsage(**data) impl_deviceusage_1(inst2) ================================================ FILE: fhir/resources/tests/test_diagnosticreport.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/DiagnosticReport Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import diagnosticreport from .conftest import ExternalValidatorModel def impl_diagnosticreport_1(inst): assert inst.category[0].coding[0].code == "394914008" assert inst.category[0].coding[0].display == "Radiology" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].coding[1].code == "RAD" assert ( inst.category[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0074"} ).valueUri ) assert inst.code.coding[0].code == "45036003" assert inst.code.coding[0].display == "Ultrasonography of abdomen" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Abdominal Ultrasound" assert inst.conclusion == "Unremarkable study" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-12-01T12:00:00+01:00"} ).valueDateTime ) assert inst.id == "ultrasound" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueInstant": "2012-12-01T12:00:00+01:00"} ).valueInstant ) assert inst.media[0].comment == "A comment about the image" assert inst.media[0].link.display == "WADO example image" assert inst.media[0].link.reference == ( "DocumentReference/1.2.840.11361907579238403408700.3.1.04.199" "70327150033" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].reference == "Practitioner/example" assert inst.status == "final" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_diagnosticreport_1(base_settings): """No. 1 tests collection for DiagnosticReport. Test File: diagnosticreport-example-ultrasound.json """ filename = ( base_settings["unittest_data_dir"] / "diagnosticreport-example-ultrasound.json" ) inst = diagnosticreport.DiagnosticReport.model_validate_json(filename.read_bytes()) assert "DiagnosticReport" == inst.get_resource_type() impl_diagnosticreport_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DiagnosticReport" == data["resourceType"] inst2 = diagnosticreport.DiagnosticReport(**data) impl_diagnosticreport_1(inst2) def impl_diagnosticreport_2(inst): assert inst.category[0].coding[0].code == "PAT" assert ( inst.category[0].coding[0].display == "Pathology (gross & histopath, not surgical)" ) assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0074"} ).valueUri ) assert inst.category[0].text == "Pathology" assert inst.code.coding[0].code == "4503" assert inst.code.coding[0].display == ( "Biopsy without Microscopic Description (1 " "Site/Lesion)-Standard" ) assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.acmeonline.com"} ).valueUri ) assert inst.code.text == ( "Biopsy without Microscopic Description (1 " "Site/Lesion)-Standard" ) assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-03-02"} ).valueDateTime ) assert inst.id == "gingival-biopsy" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.acmeonline.com"} ).valueUri ) assert inst.identifier[0].value == "P73456090" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueInstant": "2018-03-15T08:13:08Z"} ).valueInstant ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].display == "Acme Animal Labs" assert inst.presentedForm[0].contentType == "application/pdf" assert inst.presentedForm[0].language == "en" assert inst.presentedForm[0].title == ( "LAB ID: P73456090 MAX JONES Biopsy without Microscopic " "Description (1 Site/Lesion)-Standard" ) assert inst.status == "final" assert inst.subject.display == "Max Jones" assert ( inst.supportingInfo[0].reference.reference == "DiagnosticReport/gingival-mass" ) assert inst.supportingInfo[0].type.coding[0].code == "historical" assert inst.text.status == "generated" def test_diagnosticreport_2(base_settings): """No. 2 tests collection for DiagnosticReport. Test File: diagnosticreport-example-gingival-biopsy.json """ filename = ( base_settings["unittest_data_dir"] / "diagnosticreport-example-gingival-biopsy.json" ) inst = diagnosticreport.DiagnosticReport.model_validate_json(filename.read_bytes()) assert "DiagnosticReport" == inst.get_resource_type() impl_diagnosticreport_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DiagnosticReport" == data["resourceType"] inst2 = diagnosticreport.DiagnosticReport(**data) impl_diagnosticreport_2(inst2) def impl_diagnosticreport_3(inst): assert inst.category[0].coding[0].code == "394914008" assert inst.category[0].coding[0].display == "Radiology" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].coding[1].code == "RAD" assert ( inst.category[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0074"} ).valueUri ) assert inst.code.coding[0].code == "429858000" assert inst.code.coding[0].display == "Computed tomography (CT) of head and neck" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "CT of head-neck" assert inst.conclusion == "CT brains: large tumor sphenoid/clivus." assert inst.conclusionCode[0].coding[0].code == "188340000" assert ( inst.conclusionCode[0].coding[0].display == "Malignant tumor of craniopharyngeal duct" ) assert ( inst.conclusionCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.contained[0].id == "is1" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-12-01T12:00:00+01:00"} ).valueDateTime ) assert inst.id == "f201" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueInstant": "2012-12-01T12:00:00+01:00"} ).valueInstant ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].display == "Blijdorp MC" assert inst.performer[0].reference == "Organization/f203" assert inst.status == "final" assert inst.study[0].reference == "#is1" assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" def test_diagnosticreport_3(base_settings): """No. 3 tests collection for DiagnosticReport. Test File: diagnosticreport-example-f201-brainct.json """ filename = ( base_settings["unittest_data_dir"] / "diagnosticreport-example-f201-brainct.json" ) inst = diagnosticreport.DiagnosticReport.model_validate_json(filename.read_bytes()) assert "DiagnosticReport" == inst.get_resource_type() impl_diagnosticreport_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DiagnosticReport" == data["resourceType"] inst2 = diagnosticreport.DiagnosticReport(**data) impl_diagnosticreport_3(inst2) def impl_diagnosticreport_4(inst): assert inst.code.coding[0].code == "47527-7" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-02-11T10:33:33+11:00"} ).valueDateTime ) assert inst.id == "pap" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueInstant": "2013-02-13T11:45:33+11:00"} ).valueInstant ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].reference == "Practitioner/example" assert inst.status == "final" assert inst.subject.reference == "Patient/b248b1b2-1686-4b94-9936-37d7a5f94b51" assert inst.text.status == "additional" def test_diagnosticreport_4(base_settings): """No. 4 tests collection for DiagnosticReport. Test File: diagnosticreport-example-papsmear.json """ filename = ( base_settings["unittest_data_dir"] / "diagnosticreport-example-papsmear.json" ) inst = diagnosticreport.DiagnosticReport.model_validate_json(filename.read_bytes()) assert "DiagnosticReport" == inst.get_resource_type() impl_diagnosticreport_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DiagnosticReport" == data["resourceType"] inst2 = diagnosticreport.DiagnosticReport(**data) impl_diagnosticreport_4(inst2) def impl_diagnosticreport_5(inst): assert inst.category[0].coding[0].code == "PAT" assert ( inst.category[0].coding[0].display == "Pathology (gross & histopath, not surgical)" ) assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0074"} ).valueUri ) assert inst.category[0].text == "Pathology" assert inst.code.coding[0].code == "4503" assert inst.code.coding[0].display == ( "Biopsy without Microscopic Description (1 " "Site/Lesion)-Standard" ) assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.acmeonline.com"} ).valueUri ) assert inst.code.text == ( "Biopsy without Microscopic Description (1 " "Site/Lesion)-Standard" ) assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-02"} ).valueDateTime ) assert inst.id == "gingival-mass" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.acmeonline.com"} ).valueUri ) assert inst.identifier[0].value == "P73456090" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueInstant": "2017-03-15T08:13:08Z"} ).valueInstant ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].display == "Acme Animal Labs" assert inst.presentedForm[0].contentType == "application/pdf" assert inst.presentedForm[0].language == "en" assert inst.presentedForm[0].title == ( "LAB ID: P73456090 MAX JONES Biopsy without Microscopic " "Description (1 Site/Lesion)-Standard" ) assert inst.status == "final" assert inst.subject.display == "Max Jones" assert inst.text.status == "generated" def test_diagnosticreport_5(base_settings): """No. 5 tests collection for DiagnosticReport. Test File: diagnosticreport-example-gingival-mass.json """ filename = ( base_settings["unittest_data_dir"] / "diagnosticreport-example-gingival-mass.json" ) inst = diagnosticreport.DiagnosticReport.model_validate_json(filename.read_bytes()) assert "DiagnosticReport" == inst.get_resource_type() impl_diagnosticreport_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DiagnosticReport" == data["resourceType"] inst2 = diagnosticreport.DiagnosticReport(**data) impl_diagnosticreport_5(inst2) def impl_diagnosticreport_6(inst): assert inst.code.coding[0].code == "38269-7" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.code.text == "DXA BONE DENSITOMETRY" assert inst.conclusionCode[0].coding[0].code == "391040000" assert ( inst.conclusionCode[0].coding[0].display == "At risk of osteoporotic fracture" ) assert ( inst.conclusionCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2008-06-17"} ).valueDateTime ) assert inst.id == "102" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueInstant": "2008-06-18T09:23:00+10:00"} ).valueInstant ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].display == "Dr Henry Seven" assert ( inst.performer[0].reference == "Practitioner/3ad0687e-f477-468c-afd5-fcc2bf897809" ) assert inst.result[0].reference == "Observation/bmd" assert inst.status == "final" assert inst.subject.reference == "Patient/pat2" assert inst.text.status == "generated" def test_diagnosticreport_6(base_settings): """No. 6 tests collection for DiagnosticReport. Test File: diagnosticreport-example-dxa.json """ filename = base_settings["unittest_data_dir"] / "diagnosticreport-example-dxa.json" inst = diagnosticreport.DiagnosticReport.model_validate_json(filename.read_bytes()) assert "DiagnosticReport" == inst.get_resource_type() impl_diagnosticreport_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DiagnosticReport" == data["resourceType"] inst2 = diagnosticreport.DiagnosticReport(**data) impl_diagnosticreport_6(inst2) ================================================ FILE: fhir/resources/tests/test_documentreference.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/DocumentReference Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import documentreference from .conftest import ExternalValidatorModel def impl_documentreference_1(inst): assert ( inst.content[0].attachment.creation == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01T01:02:01+01:00"} ).valueDateTime ) assert inst.content[0].attachment.title == "Sample Genomic File" assert ( inst.content[0].attachment.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://www.somesystemabc.net/identifiers/files/11114"} ).valueUrl ) assert inst.description == ( "A sample Document Reference instance representing a generic " "genomic file that may ber used as input or output of a " "genomic analysis pipeline." ) assert inst.docStatus == "preliminary" assert inst.id == "genomicFile4" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/files"} ).valueUri ) assert inst.identifier[0].value == "11114" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.securityLabel[0].coding[0].code == "R" assert inst.securityLabel[0].coding[0].display == "Restricted" assert ( inst.securityLabel[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-Confidentiality"} ).valueUri ) assert inst.status == "current" assert inst.subject.display == "Child Junior Doe" assert inst.subject.reference == "Patient/denovoChild" assert inst.text.status == "generated" def test_documentreference_1(base_settings): """No. 1 tests collection for DocumentReference. Test File: DocumentReference-genomicFile4.json """ filename = ( base_settings["unittest_data_dir"] / "DocumentReference-genomicFile4.json" ) inst = documentreference.DocumentReference.model_validate_json( filename.read_bytes() ) assert "DocumentReference" == inst.get_resource_type() impl_documentreference_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DocumentReference" == data["resourceType"] inst2 = documentreference.DocumentReference(**data) impl_documentreference_1(inst2) def impl_documentreference_2(inst): assert inst.author[0].display == "G.E. Medical Systems" assert inst.bodySite[0].concept.coding[0].code == "67734004" assert inst.bodySite[0].concept.coding[0].display == "Upper Trunk Structure" assert ( inst.bodySite[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.content[0].attachment.contentType == "application/dicom" assert inst.content[0].attachment.height == 480 assert inst.content[0].attachment.width == 640 assert inst.event[0].concept.coding[0].code == "399067008" assert inst.event[0].concept.coding[0].display == "Lateral projection" assert ( inst.event[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://nema.org/fhir/extensions#0002-0010"} ).valueUri ) assert ( inst.extension[0].valueUri == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.2.840.10008.1.2.1"} ).valueUri ) assert inst.id == "1.2.840.11361907579238403408700.3.1.04.19970327150033" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme-imaging.com/accession/2012"} ).valueUri ) assert inst.identifier[0].type.text == "accessionNo" assert inst.identifier[0].value == "1234567" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate({"valueUri": "urn:dicom:uid"}).valueUri ) assert inst.identifier[1].type.text == "studyId" assert ( inst.identifier[1].value == "urn:oid:1.2.840.113619.2.21.848.34082.0.538976288.3" ) assert ( inst.identifier[2].system == ExternalValidatorModel.model_validate({"valueUri": "urn:dicom:uid"}).valueUri ) assert inst.identifier[2].type.text == "seriesId" assert ( inst.identifier[2].value == "urn:oid:1.2.840.113619.2.21.3408.700.0.757923840.3.0" ) assert ( inst.identifier[3].system == ExternalValidatorModel.model_validate({"valueUri": "urn:dicom:uid"}).valueUri ) assert inst.identifier[3].type.text == "InstanceUID" assert inst.identifier[3].use == "official" assert inst.identifier[3].value == ( "urn:oid:1.2.840.11361907579238403408700.3.1.04.1997032715003" "3" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.modality[0].coding[0].code == "US" assert ( inst.modality[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.status == "current" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_documentreference_2(base_settings): """No. 2 tests collection for DocumentReference. Test File: documentreference-example-dicom.json """ filename = ( base_settings["unittest_data_dir"] / "documentreference-example-dicom.json" ) inst = documentreference.DocumentReference.model_validate_json( filename.read_bytes() ) assert "DocumentReference" == inst.get_resource_type() impl_documentreference_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DocumentReference" == data["resourceType"] inst2 = documentreference.DocumentReference(**data) impl_documentreference_2(inst2) def impl_documentreference_3(inst): assert ( inst.content[0].attachment.creation == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-03-01T01:02:01+01:00"} ).valueDateTime ) assert inst.content[0].attachment.title == "CNVAnalysis_called" assert ( inst.content[0].attachment.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://chat.fhir.org/user_uploads/10155/Hnv3LtumKn-1QjeyS2KVuw4R/CNVAnalysis_called.bed" } ).valueUrl ) assert inst.description == ( "CNVAnalysis_called: A sample Document Reference instance " "representing a BED file that may be used as input or output " "of a genomic analysis pipeline." ) assert inst.docStatus == "preliminary" assert inst.id == "CNVAnalysis-called" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/files"} ).valueUri ) assert inst.identifier[0].value == "11120" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.securityLabel[0].coding[0].code == "R" assert inst.securityLabel[0].coding[0].display == "Restricted" assert ( inst.securityLabel[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-Confidentiality"} ).valueUri ) assert inst.status == "current" assert inst.text.status == "generated" def test_documentreference_3(base_settings): """No. 3 tests collection for DocumentReference. Test File: DocumentReference-CNVAnalysis_called.json """ filename = ( base_settings["unittest_data_dir"] / "DocumentReference-CNVAnalysis_called.json" ) inst = documentreference.DocumentReference.model_validate_json( filename.read_bytes() ) assert "DocumentReference" == inst.get_resource_type() impl_documentreference_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DocumentReference" == data["resourceType"] inst2 = documentreference.DocumentReference(**data) impl_documentreference_3(inst2) def impl_documentreference_4(inst): assert ( inst.content[0].attachment.creation == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01T01:01:01+01:00"} ).valueDateTime ) assert inst.content[0].attachment.title == "Sample Genomic File" assert ( inst.content[0].attachment.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://www.somesystemabc.net/identifiers/files/11113"} ).valueUrl ) assert inst.description == ( "A sample Document Reference instance representing a generic " "genomic file that may ber used as input or output of a " "genomic analysis pipeline." ) assert inst.docStatus == "preliminary" assert inst.id == "genomicFileFather" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/files"} ).valueUri ) assert inst.identifier[0].value == "111110" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.securityLabel[0].coding[0].code == "R" assert inst.securityLabel[0].coding[0].display == "Restricted" assert ( inst.securityLabel[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-Confidentiality"} ).valueUri ) assert inst.status == "current" assert inst.subject.display == "John Doe" assert inst.subject.reference == "Patient/father" assert inst.text.status == "generated" def test_documentreference_4(base_settings): """No. 4 tests collection for DocumentReference. Test File: DocumentReference-genomicFileFather.json """ filename = ( base_settings["unittest_data_dir"] / "DocumentReference-genomicFileFather.json" ) inst = documentreference.DocumentReference.model_validate_json( filename.read_bytes() ) assert "DocumentReference" == inst.get_resource_type() impl_documentreference_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DocumentReference" == data["resourceType"] inst2 = documentreference.DocumentReference(**data) impl_documentreference_4(inst2) def impl_documentreference_5(inst): assert inst.attester[0].mode.coding[0].code == "professional" assert ( inst.attester[0].mode.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/composition-attestation-mode"} ).valueUri ) assert inst.attester[0].party.reference == "#in-author" assert inst.author[0].reference == "#in-author" assert inst.category[0].coding[0].code == "11369-6" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.contained[0].id == "in-author" assert inst.contained[1].id == "in-patient" assert inst.content[0].attachment.contentType == "text/plain" assert ( inst.content[0].attachment.creation == ExternalValidatorModel.model_validate( {"valueDateTime": "2020-12-31T23:50:50-05:00"} ).valueDateTime ) assert ( inst.content[0].attachment.hash == ExternalValidatorModel.model_validate( { "valueBase64Binary": "OGEzOGYyNjMzMDA2ZmQ1MzUxNDljNDRhM2E3M2YzMTI0MzdiMzQ3OA==" } ).valueBase64Binary ) assert inst.content[0].attachment.language == "en" # Don't know how to create unit test # for "content[0].attachment.size", # which is a Integer64 assert ( inst.content[0].attachment.title == "DocumentReference for Comprehensive fully filled metadata" ) assert ( inst.content[0].attachment.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://example.com/nowhere.txt"} ).valueUrl ) assert inst.content[0].profile[0].valueCoding.code == "urn:ihe:iti:xds-sd:text:2008" assert ( inst.content[0].profile[0].valueCoding.system == ExternalValidatorModel.model_validate( { "valueUri": "http://ihe.net/fhir/ihe.formatcode.fhir/CodeSystem/formatcode" } ).valueUri ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueInstant": "2020-12-31T23:50:50-05:00"} ).valueInstant ) assert inst.description == ( "Example of a Comprehensive DocumentReference resource. This " "is fully filled for all mandatory elements and all optional " "elements." ) assert inst.event[0].concept.coding[0].code == "ACCTRECEIVABLE" assert ( inst.event[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.event[1].reference.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.event[1].reference.identifier.value == ( "urn:oid:1.2.840.113556.1.8000.2554.17917.46600.21181.17878.3" "3419.62048.57128.2759" ) assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/documentreference-sourcepatient" } ).valueUri ) assert inst.extension[0].valueReference.reference == "#in-patient" assert inst.facilityType.coding[0].code == "82242000" assert ( inst.facilityType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "example-comprehensive" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == ( "urn:oid:1.2.840.113556.1.8000.2554.58783.21864.3474.19410.44" "358.58254.41281.46340" ) assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[1].value == "urn:uuid:0c287d32-01e3-4d87-9953-9fcc9404eb21" assert inst.meta.security[0].code == "HTEST" assert ( inst.meta.security[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2020-12-31T23:50:50-05:00"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2020-12-31T23:50:50-05:00"} ).valueDateTime ) assert inst.practiceSetting.coding[0].code == "408467006" assert ( inst.practiceSetting.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.relatesTo[0].code.coding[0].code == "appends" assert ( inst.relatesTo[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/document-relationship-type"} ).valueUri ) assert inst.relatesTo[0].target.reference == "DocumentReference/example" assert inst.securityLabel[0].coding[0].code == "N" assert ( inst.securityLabel[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-Confidentiality"} ).valueUri ) assert inst.status == "current" assert inst.subject.reference == "Patient/xcda" assert inst.text.status == "extensions" assert inst.type.coding[0].code == "55107-7" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.version == "urn:uuid:0c287d32-01e3-4d87-9953-9fcc9404eb21" def test_documentreference_5(base_settings): """No. 5 tests collection for DocumentReference. Test File: documentreference-example-comprehensive.json """ filename = ( base_settings["unittest_data_dir"] / "documentreference-example-comprehensive.json" ) inst = documentreference.DocumentReference.model_validate_json( filename.read_bytes() ) assert "DocumentReference" == inst.get_resource_type() impl_documentreference_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DocumentReference" == data["resourceType"] inst2 = documentreference.DocumentReference(**data) impl_documentreference_5(inst2) def impl_documentreference_6(inst): assert ( inst.content[0].attachment.creation == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-03-01T01:02:01+01:00"} ).valueDateTime ) assert inst.content[0].attachment.title == "Sample Genomic VCF File" assert ( inst.content[0].attachment.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://www.somesystemabc.net/identifiers/files/11114"} ).valueUrl ) assert inst.description == ( "A sample Document Reference instance representing a VCF file" " that may be used as input or output of a genomic analysis " "pipeline." ) assert inst.docStatus == "preliminary" assert inst.id == "genomicVCFfile" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/files"} ).valueUri ) assert inst.identifier[0].value == "11116" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.securityLabel[0].coding[0].code == "R" assert inst.securityLabel[0].coding[0].display == "Restricted" assert ( inst.securityLabel[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-Confidentiality"} ).valueUri ) assert inst.status == "current" assert inst.text.status == "generated" def test_documentreference_6(base_settings): """No. 6 tests collection for DocumentReference. Test File: DocumentReference-genomicVCFfile.json """ filename = ( base_settings["unittest_data_dir"] / "DocumentReference-genomicVCFfile.json" ) inst = documentreference.DocumentReference.model_validate_json( filename.read_bytes() ) assert "DocumentReference" == inst.get_resource_type() impl_documentreference_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DocumentReference" == data["resourceType"] inst2 = documentreference.DocumentReference(**data) impl_documentreference_6(inst2) def impl_documentreference_7(inst): assert ( inst.content[0].attachment.creation == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-03-01T01:02:01+01:00"} ).valueDateTime ) assert inst.content[0].attachment.title == "WES_FullSequencedRegion_GRCh38" assert ( inst.content[0].attachment.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://chat.fhir.org/user_uploads/10155/BILYJerATC59WlG15J316BEf/WES_FullSequencedRegion_GRCh38.bed" } ).valueUrl ) assert inst.description == ( "WES_FullSequencedRegion_GRCh38: A sample Document Reference " "instance representing a BED file that may be used as input " "or output of a genomic analysis pipeline." ) assert inst.docStatus == "preliminary" assert inst.id == "WES-FullSequencedRegion-GRCh38" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/files"} ).valueUri ) assert inst.identifier[0].value == "11117" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.securityLabel[0].coding[0].code == "R" assert inst.securityLabel[0].coding[0].display == "Restricted" assert ( inst.securityLabel[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-Confidentiality"} ).valueUri ) assert inst.status == "current" assert inst.text.status == "generated" def test_documentreference_7(base_settings): """No. 7 tests collection for DocumentReference. Test File: DocumentReference-WES_FullSequencedRegion_GRCh38.json """ filename = ( base_settings["unittest_data_dir"] / "DocumentReference-WES_FullSequencedRegion_GRCh38.json" ) inst = documentreference.DocumentReference.model_validate_json( filename.read_bytes() ) assert "DocumentReference" == inst.get_resource_type() impl_documentreference_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DocumentReference" == data["resourceType"] inst2 = documentreference.DocumentReference(**data) impl_documentreference_7(inst2) def impl_documentreference_8(inst): assert ( inst.content[0].attachment.creation == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-03-01T01:02:01+01:00"} ).valueDateTime ) assert inst.content[0].attachment.title == "SimpleVariantAnalysis_called" assert ( inst.content[0].attachment.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://chat.fhir.org/user_uploads/10155/jQZWWKs4JO8ZfhfrbsCbbMUA/SimpleVariantAnalysis_called.bed" } ).valueUrl ) assert inst.description == ( "SimpleVariantAnalysis_called: A sample Document Reference " "instance representing a BED file that may be used as input " "or output of a genomic analysis pipeline." ) assert inst.docStatus == "preliminary" assert inst.id == "SimpleVariantAnalysis-called" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/files"} ).valueUri ) assert inst.identifier[0].value == "11118" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.securityLabel[0].coding[0].code == "R" assert inst.securityLabel[0].coding[0].display == "Restricted" assert ( inst.securityLabel[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-Confidentiality"} ).valueUri ) assert inst.status == "current" assert inst.text.status == "generated" def test_documentreference_8(base_settings): """No. 8 tests collection for DocumentReference. Test File: DocumentReference-SimpleVariantAnalysis_called.json """ filename = ( base_settings["unittest_data_dir"] / "DocumentReference-SimpleVariantAnalysis_called.json" ) inst = documentreference.DocumentReference.model_validate_json( filename.read_bytes() ) assert "DocumentReference" == inst.get_resource_type() impl_documentreference_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DocumentReference" == data["resourceType"] inst2 = documentreference.DocumentReference(**data) impl_documentreference_8(inst2) def impl_documentreference_9(inst): assert ( inst.content[0].attachment.creation == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-03-01T01:02:01+01:00"} ).valueDateTime ) assert inst.content[0].attachment.title == "genomicVCFfile_simple" assert ( inst.content[0].attachment.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://chat.fhir.org/user_uploads/10155/gdL90-np7lJjGwUxeARapUHB/genomicVCFFile_simple.vcf" } ).valueUrl ) assert inst.description == ( "genomicVCFfile_simple: A sample Document Reference instance " "representing a VCF file that may be used as input or output " "of a genomic analysis pipeline." ) assert inst.docStatus == "preliminary" assert inst.id == "genomicVCFfile-simple" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/files"} ).valueUri ) assert inst.identifier[0].value == "11119" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.securityLabel[0].coding[0].code == "R" assert inst.securityLabel[0].coding[0].display == "Restricted" assert ( inst.securityLabel[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-Confidentiality"} ).valueUri ) assert inst.status == "current" assert inst.text.status == "generated" def test_documentreference_9(base_settings): """No. 9 tests collection for DocumentReference. Test File: DocumentReference-genomicVCFfile_simple.json """ filename = ( base_settings["unittest_data_dir"] / "DocumentReference-genomicVCFfile_simple.json" ) inst = documentreference.DocumentReference.model_validate_json( filename.read_bytes() ) assert "DocumentReference" == inst.get_resource_type() impl_documentreference_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DocumentReference" == data["resourceType"] inst2 = documentreference.DocumentReference(**data) impl_documentreference_9(inst2) def impl_documentreference_10(inst): assert ( inst.content[0].attachment.creation == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01T01:01:01+01:00"} ).valueDateTime ) assert inst.content[0].attachment.title == "Sample Genomic File" assert ( inst.content[0].attachment.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://www.somesystemabc.net/identifiers/files/11112"} ).valueUrl ) assert inst.description == ( "A sample Document Reference instance representing a generic " "genomic file that may ber used as input or output of a " "genomic analysis pipeline." ) assert inst.docStatus == "preliminary" assert inst.id == "genomicFile2" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/files"} ).valueUri ) assert inst.identifier[0].value == "11112" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.securityLabel[0].coding[0].code == "R" assert inst.securityLabel[0].coding[0].display == "Restricted" assert ( inst.securityLabel[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-Confidentiality"} ).valueUri ) assert inst.status == "current" assert inst.subject.display == "Jane Doe" assert inst.subject.reference == "Patient/denovoMother" assert inst.text.status == "generated" def test_documentreference_10(base_settings): """No. 10 tests collection for DocumentReference. Test File: DocumentReference-genomicFile2.json """ filename = ( base_settings["unittest_data_dir"] / "DocumentReference-genomicFile2.json" ) inst = documentreference.DocumentReference.model_validate_json( filename.read_bytes() ) assert "DocumentReference" == inst.get_resource_type() impl_documentreference_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "DocumentReference" == data["resourceType"] inst2 = documentreference.DocumentReference(**data) impl_documentreference_10(inst2) ================================================ FILE: fhir/resources/tests/test_encounter.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Encounter Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import encounter from .conftest import ExternalValidatorModel def impl_encounter_1(inst): assert ( inst.actualPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-17T16:30:00+10:00"} ).valueDateTime ) assert ( inst.actualPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-17T16:00:00+10:00"} ).valueDateTime ) assert inst.class_fhir[0].coding[0].code == "HH" assert inst.class_fhir[0].coding[0].display == "home health" assert ( inst.class_fhir[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.contained[0].id == "home" assert inst.id == "home" assert inst.location[0].location.display == "Client's home" assert inst.location[0].location.reference == "#home" assert ( inst.location[0].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-17T16:30:00+10:00"} ).valueDateTime ) assert ( inst.location[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-17T16:00:00+10:00"} ).valueDateTime ) assert inst.location[0].status == "completed" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].actor.display == "Dr Adam Careful" assert inst.participant[0].actor.reference == "Practitioner/example" assert ( inst.participant[0].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-17T16:30:00+10:00"} ).valueDateTime ) assert ( inst.participant[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-17T16:00:00+10:00"} ).valueDateTime ) assert inst.participant[0].type[0].coding[0].code == "PPRF" assert ( inst.participant[0].type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.participant[1].actor.reference == "Patient/example" assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Encounter with ' "patient @example who is at home
" ) assert inst.text.status == "generated" def test_encounter_1(base_settings): """No. 1 tests collection for Encounter. Test File: encounter-example-home.json """ filename = base_settings["unittest_data_dir"] / "encounter-example-home.json" inst = encounter.Encounter.model_validate_json(filename.read_bytes()) assert "Encounter" == inst.get_resource_type() impl_encounter_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Encounter" == data["resourceType"] inst2 = encounter.Encounter(**data) impl_encounter_1(inst2) def impl_encounter_2(inst): assert inst.class_fhir[0].coding[0].code == "AMB" assert inst.class_fhir[0].coding[0].display == "ambulatory" assert ( inst.class_fhir[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.id == "f201" assert inst.identifier[0].use == "temp" assert inst.identifier[0].value == "Encounter_Roel_20130404" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].actor.reference == "Practitioner/f201" assert inst.priority.coding[0].code == "17621005" assert inst.priority.coding[0].display == "Normal" assert ( inst.priority.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.reason[0].value[0].concept.text == ( "The patient had fever peaks over the last couple of days. He" " is worried about these peaks." ) assert inst.serviceProvider.reference == "Organization/f201" assert inst.status == "completed" assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "11429006" assert inst.type[0].coding[0].display == "Consultation" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_encounter_2(base_settings): """No. 2 tests collection for Encounter. Test File: encounter-example-f201-20130404.json """ filename = ( base_settings["unittest_data_dir"] / "encounter-example-f201-20130404.json" ) inst = encounter.Encounter.model_validate_json(filename.read_bytes()) assert "Encounter" == inst.get_resource_type() impl_encounter_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Encounter" == data["resourceType"] inst2 = encounter.Encounter(**data) impl_encounter_2(inst2) def impl_encounter_3(inst): assert inst.admission.admitSource.coding[0].code == "305956004" assert inst.admission.admitSource.coding[0].display == "Referral by physician" assert ( inst.admission.admitSource.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.admission.dischargeDisposition.coding[0].code == "306689006" assert inst.admission.dischargeDisposition.coding[0].display == "Discharge to home" assert ( inst.admission.dischargeDisposition.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.admission.preAdmissionIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/zorgportal/identifiers/pre-admissions"} ).valueUri ) assert inst.admission.preAdmissionIdentifier.use == "official" assert inst.admission.preAdmissionIdentifier.value == "93042" assert inst.class_fhir[0].coding[0].code == "AMB" assert inst.class_fhir[0].coding[0].display == "ambulatory" assert ( inst.class_fhir[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.id == "f003" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/zorgportal/identifiers/encounters"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "v6751" assert inst.length.code == "min" assert ( inst.length.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.length.unit == "min" assert float(inst.length.value) == float(90) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].actor.display == "E.M. van den Broek" assert inst.participant[0].actor.reference == "Practitioner/f001" assert inst.priority.coding[0].code == "103391001" assert ( inst.priority.coding[0].display == "Non-urgent ear, nose and throat admission" ) assert ( inst.priority.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.reason[0].value[0].concept.coding[0].code == "18099001" assert ( inst.reason[0].value[0].concept.coding[0].display == "Retropharyngeal abscess" ) assert ( inst.reason[0].value[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.serviceProvider.reference == "Organization/f001" assert inst.status == "completed" assert inst.subject.display == "P. van de Heuvel" assert inst.subject.reference == "Patient/f001" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "270427003" assert inst.type[0].coding[0].display == "Patient-initiated encounter" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_encounter_3(base_settings): """No. 3 tests collection for Encounter. Test File: encounter-example-f003-abscess.json """ filename = ( base_settings["unittest_data_dir"] / "encounter-example-f003-abscess.json" ) inst = encounter.Encounter.model_validate_json(filename.read_bytes()) assert "Encounter" == inst.get_resource_type() impl_encounter_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Encounter" == data["resourceType"] inst2 = encounter.Encounter(**data) impl_encounter_3(inst2) def impl_encounter_4(inst): assert inst.careTeam[0].reference == "Encounter/example" assert inst.class_fhir[0].coding[0].code == "IMP" assert inst.class_fhir[0].coding[0].display == "inpatient encounter" assert ( inst.class_fhir[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "in-progress" assert inst.subject.reference == "Patient/example" assert inst.subjectStatus.coding[0].code == "receiving-care" assert ( inst.subjectStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/encounter-subject-status" } ).valueUri ) assert inst.text.div == ( '
Encounter with ' "patient @example
" ) assert inst.text.status == "generated" def test_encounter_4(base_settings): """No. 4 tests collection for Encounter. Test File: encounter-example.json """ filename = base_settings["unittest_data_dir"] / "encounter-example.json" inst = encounter.Encounter.model_validate_json(filename.read_bytes()) assert "Encounter" == inst.get_resource_type() impl_encounter_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Encounter" == data["resourceType"] inst2 = encounter.Encounter(**data) impl_encounter_4(inst2) def impl_encounter_5(inst): assert inst.class_fhir[0].coding[0].code == "IMP" assert inst.class_fhir[0].coding[0].display == "inpatient encounter" assert ( inst.class_fhir[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.id == "genomicEncounter" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "in-progress" assert inst.subject.reference == "Patient/genomicPatient" assert inst.text.status == "generated" def test_encounter_5(base_settings): """No. 5 tests collection for Encounter. Test File: Encounter-genomicEncounter.json """ filename = base_settings["unittest_data_dir"] / "Encounter-genomicEncounter.json" inst = encounter.Encounter.model_validate_json(filename.read_bytes()) assert "Encounter" == inst.get_resource_type() impl_encounter_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Encounter" == data["resourceType"] inst2 = encounter.Encounter(**data) impl_encounter_5(inst2) def impl_encounter_6(inst): assert ( inst.actualPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-20"} ).valueDateTime ) assert ( inst.actualPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-11"} ).valueDateTime ) assert inst.class_fhir[0].coding[0].code == "IMP" assert inst.class_fhir[0].coding[0].display == "inpatient encounter" assert ( inst.class_fhir[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.id == "colonoscopy" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].actor.display == "Dr Adam Careful" assert inst.participant[0].actor.reference == "Practitioner/example" assert inst.participant[0].type[0].coding[0].code == "PART" assert ( inst.participant[0].type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.reason[0].value[0].concept.text == "Routine investigation" assert inst.serviceProvider.display == "Gastroenterology @ Acme Hospital" assert inst.serviceProvider.reference == "Organization/1" assert inst.status == "completed" assert inst.subject.display == "Henry Levin the 7th" assert inst.subject.reference == "Patient/glossy" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "73761001" assert inst.type[0].coding[0].display == "Colonoscopy (procedure)" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.type[0].text == "Colonoscopy" def test_encounter_6(base_settings): """No. 6 tests collection for Encounter. Test File: encounter-example-colonoscopy.json """ filename = base_settings["unittest_data_dir"] / "encounter-example-colonoscopy.json" inst = encounter.Encounter.model_validate_json(filename.read_bytes()) assert "Encounter" == inst.get_resource_type() impl_encounter_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Encounter" == data["resourceType"] inst2 = encounter.Encounter(**data) impl_encounter_6(inst2) def impl_encounter_7(inst): assert inst.admission.admitSource.coding[0].code == "305997006" assert inst.admission.admitSource.coding[0].display == "Referral by radiologist" assert ( inst.admission.admitSource.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.admission.dischargeDisposition.coding[0].code == "306689006" assert inst.admission.dischargeDisposition.coding[0].display == "Discharge to home" assert ( inst.admission.dischargeDisposition.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.admission.preAdmissionIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/zorgportal/identifiers/pre-admissions"} ).valueUri ) assert inst.admission.preAdmissionIdentifier.use == "official" assert inst.admission.preAdmissionIdentifier.value == "98682" assert inst.class_fhir[0].coding[0].code == "AMB" assert inst.class_fhir[0].coding[0].display == "ambulatory" assert ( inst.class_fhir[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.id == "f002" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/zorgportal/identifiers/encounters"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "v3251" assert inst.length.code == "min" assert ( inst.length.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.length.unit == "min" assert float(inst.length.value) == float(140) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].actor.display == "M.I.M Versteegh" assert inst.participant[0].actor.reference == "Practitioner/f003" assert inst.priority.coding[0].code == "103391001" assert inst.priority.coding[0].display == "Urgent" assert ( inst.priority.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.reason[0].value[0].concept.coding[0].code == "34068001" assert ( inst.reason[0].value[0].concept.coding[0].display == "Partial lobectomy of lung" ) assert ( inst.reason[0].value[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.serviceProvider.display == "BMC" assert inst.serviceProvider.reference == "Organization/f001" assert inst.status == "completed" assert inst.subject.display == "P. van de Heuvel" assert inst.subject.reference == "Patient/f001" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "270427003" assert inst.type[0].coding[0].display == "Patient-initiated encounter" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_encounter_7(base_settings): """No. 7 tests collection for Encounter. Test File: encounter-example-f002-lung.json """ filename = base_settings["unittest_data_dir"] / "encounter-example-f002-lung.json" inst = encounter.Encounter.model_validate_json(filename.read_bytes()) assert "Encounter" == inst.get_resource_type() impl_encounter_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Encounter" == data["resourceType"] inst2 = encounter.Encounter(**data) impl_encounter_7(inst2) def impl_encounter_8(inst): assert inst.account[0].reference == "Account/example" assert ( inst.actualPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-20"} ).valueDateTime ) assert ( inst.actualPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-11"} ).valueDateTime ) assert inst.admission.admitSource.coding[0].code == "309902002" assert ( inst.admission.admitSource.coding[0].display == "Clinical Oncology Department" ) assert ( inst.admission.admitSource.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.admission.destination.reference == "Location/2" assert inst.admission.origin.reference == "Location/2" assert inst.admission.reAdmission.coding[0].display == "readmitted" assert inst.appointment[0].reference == "Appointment/example" assert inst.basedOn[0].reference == "ServiceRequest/myringotomy" assert inst.class_fhir[0].coding[0].code == "IMP" assert inst.class_fhir[0].coding[0].display == "inpatient encounter" assert ( inst.class_fhir[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.diagnosis[0].condition[0].reference.reference == "Condition/stroke" assert inst.diagnosis[0].use[0].coding[0].code == "AD" assert inst.diagnosis[0].use[0].coding[0].display == "Admission diagnosis" assert ( inst.diagnosis[0].use[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/diagnosis-role"} ).valueUri ) assert inst.diagnosis[1].condition[0].reference.reference == "Condition/f201" assert inst.diagnosis[1].use[0].coding[0].code == "DD" assert inst.diagnosis[1].use[0].coding[0].display == "Discharge diagnosis" assert ( inst.diagnosis[1].use[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/diagnosis-role"} ).valueUri ) assert inst.dietPreference[0].coding[0].code == "276026009" assert inst.dietPreference[0].coding[0].display == "Fluid balance regulation" assert ( inst.dietPreference[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.episodeOfCare[0].reference == "EpisodeOfCare/example" assert inst.id == "f203" assert inst.identifier[0].use == "temp" assert inst.identifier[0].value == "Encounter_Roel_20130311" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.partOf.reference == "Encounter/f203" assert inst.participant[0].actor.reference == "Practitioner/f201" assert inst.participant[0].type[0].coding[0].code == "PART" assert ( inst.participant[0].type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.priority.coding[0].code == "394849002" assert inst.priority.coding[0].display == "High priority" assert ( inst.priority.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.reason[0].value[0].concept.text == ( "The patient seems to suffer from bilateral pneumonia and " "renal insufficiency, most likely due to chemotherapy." ) assert inst.serviceProvider.reference == "Organization/2" assert inst.specialArrangement[0].coding[0].code == "wheel" assert inst.specialArrangement[0].coding[0].display == "Wheelchair" assert ( inst.specialArrangement[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/encounter-special-arrangements" } ).valueUri ) assert inst.specialCourtesy[0].coding[0].code == "NRM" assert inst.specialCourtesy[0].coding[0].display == "normal courtesy" assert ( inst.specialCourtesy[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/v3-EncounterSpecialCourtesy" } ).valueUri ) assert inst.status == "completed" assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "183807002" assert inst.type[0].coding[0].display == "Inpatient stay for nine days" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_encounter_8(base_settings): """No. 8 tests collection for Encounter. Test File: encounter-example-f203-20130311.json """ filename = ( base_settings["unittest_data_dir"] / "encounter-example-f203-20130311.json" ) inst = encounter.Encounter.model_validate_json(filename.read_bytes()) assert "Encounter" == inst.get_resource_type() impl_encounter_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Encounter" == data["resourceType"] inst2 = encounter.Encounter(**data) impl_encounter_8(inst2) def impl_encounter_9(inst): assert inst.class_fhir[0].coding[0].code == "AMB" assert inst.class_fhir[0].coding[0].display == "ambulatory" assert ( inst.class_fhir[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.id == "xcda" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://healthcare.example.org/identifiers/enocunter"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "1234213.52345873" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].actor.reference == "Practitioner/xcda1" assert inst.reason[0].value[0].concept.coding[0].code == "T-D8200" assert inst.reason[0].value[0].concept.coding[0].display == "Arm" assert ( inst.reason[0].value[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/xds/connectathon/eventCodes"} ).valueUri ) assert inst.status == "completed" assert inst.subject.reference == "Patient/xcda" assert inst.text.status == "generated" def test_encounter_9(base_settings): """No. 9 tests collection for Encounter. Test File: encounter-example-xcda.json """ filename = base_settings["unittest_data_dir"] / "encounter-example-xcda.json" inst = encounter.Encounter.model_validate_json(filename.read_bytes()) assert "Encounter" == inst.get_resource_type() impl_encounter_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Encounter" == data["resourceType"] inst2 = encounter.Encounter(**data) impl_encounter_9(inst2) def impl_encounter_10(inst): assert inst.class_fhir[0].coding[0].code == "AMB" assert inst.class_fhir[0].coding[0].display == "ambulatory" assert ( inst.class_fhir[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.diagnosis[0].condition[0].concept.text == ( "Complications from Roel's TPF chemotherapy on January 28th, " "2013" ) assert inst.diagnosis[0].use[0].coding[0].code == "AD" assert inst.diagnosis[0].use[0].coding[0].display == "Admission diagnosis" assert ( inst.diagnosis[0].use[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/diagnosis-role"} ).valueUri ) assert ( inst.diagnosis[1].condition[0].concept.text == "The patient is treated for a tumor" ) assert inst.diagnosis[1].use[0].coding[0].code == "CC" assert inst.diagnosis[1].use[0].coding[0].display == "Chief complaint" assert ( inst.diagnosis[1].use[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/diagnosis-role"} ).valueUri ) assert inst.id == "f202" assert inst.identifier[0].use == "temp" assert inst.identifier[0].value == "Encounter_Roel_20130128" assert inst.length.code == "min" assert ( inst.length.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.length.unit == "minutes" assert float(inst.length.value) == float(56) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].actor.reference == "Practitioner/f201" assert inst.priority.coding[0].code == "103391001" assert inst.priority.coding[0].display == "Urgent" assert ( inst.priority.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.reason[0].value[0].concept.text == "The patient is treated for a tumor." assert inst.serviceProvider.reference == "Organization/f201" assert inst.status == "completed" assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "367336001" assert inst.type[0].coding[0].display == "Chemotherapy" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_encounter_10(base_settings): """No. 10 tests collection for Encounter. Test File: encounter-example-f202-20130128.json """ filename = ( base_settings["unittest_data_dir"] / "encounter-example-f202-20130128.json" ) inst = encounter.Encounter.model_validate_json(filename.read_bytes()) assert "Encounter" == inst.get_resource_type() impl_encounter_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Encounter" == data["resourceType"] inst2 = encounter.Encounter(**data) impl_encounter_10(inst2) ================================================ FILE: fhir/resources/tests/test_encounterhistory.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/EncounterHistory Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import encounterhistory from .conftest import ExternalValidatorModel def impl_encounterhistory_1(inst): assert inst.class_fhir.coding[0].code == "IMP" assert inst.class_fhir.coding[0].display == "inpatient encounter" assert ( inst.class_fhir.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.encounter.reference == "Encounter/example" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.amc.nl/zorgportal/identifiers/visits"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "v2452" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "in-progress" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Encounter with ' "patient @example
" ) assert inst.text.status == "generated" def test_encounterhistory_1(base_settings): """No. 1 tests collection for EncounterHistory. Test File: encounterhistory-example.json """ filename = base_settings["unittest_data_dir"] / "encounterhistory-example.json" inst = encounterhistory.EncounterHistory.model_validate_json(filename.read_bytes()) assert "EncounterHistory" == inst.get_resource_type() impl_encounterhistory_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EncounterHistory" == data["resourceType"] inst2 = encounterhistory.EncounterHistory(**data) impl_encounterhistory_1(inst2) ================================================ FILE: fhir/resources/tests/test_endpoint.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Endpoint Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import endpoint from .conftest import ExternalValidatorModel def impl_endpoint_1(inst): assert ( inst.address == ExternalValidatorModel.model_validate( {"valueUrl": "mailto:MARTIN.SMIETANKA@directnppes.com"} ).valueUrl ) assert inst.connectionType[0].coding[0].code == "direct-project" assert inst.id == "direct-endpoint" assert inst.managingOrganization.reference == "Organization/f201" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "MARTIN SMIETANKA" assert inst.payload[0].mimeType[0] == "text/x-hl7-text+xml" assert inst.payload[0].mimeType[1] == "application/fhir+xml" assert inst.payload[0].mimeType[2] == "application/fhir+json" assert ( inst.payload[0].type[0].coding[0].code == "urn:hl7-org:sdwg:ccda-structuredBody:1.1" ) assert ( inst.payload[0].type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.3.6.1.4.1.19376.1.2.3"} ).valueUri ) assert inst.status == "active" assert inst.text.status == "generated" def test_endpoint_1(base_settings): """No. 1 tests collection for Endpoint. Test File: endpoint-example-direct.json """ filename = base_settings["unittest_data_dir"] / "endpoint-example-direct.json" inst = endpoint.Endpoint.model_validate_json(filename.read_bytes()) assert "Endpoint" == inst.get_resource_type() impl_endpoint_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Endpoint" == data["resourceType"] inst2 = endpoint.Endpoint(**data) impl_endpoint_1(inst2) def impl_endpoint_2(inst): assert ( inst.address == ExternalValidatorModel.model_validate( {"valueUrl": "https://pacs.hospital.org/wado-rs"} ).valueUrl ) assert inst.connectionType[0].coding[0].code == "dicom-wado-rs" assert ( inst.connectionType[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/endpoint-connection-type" } ).valueUri ) assert inst.id == "example-wadors" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "PACS Hospital DICOM WADO-RS endpoint" assert inst.payload[0].mimeType[0] == "application/dicom" assert inst.payload[0].type[0].text == "DICOM WADO-RS" assert inst.status == "active" assert inst.text.status == "generated" def test_endpoint_2(base_settings): """No. 2 tests collection for Endpoint. Test File: endpoint-example-wadors.json """ filename = base_settings["unittest_data_dir"] / "endpoint-example-wadors.json" inst = endpoint.Endpoint.model_validate_json(filename.read_bytes()) assert "Endpoint" == inst.get_resource_type() impl_endpoint_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Endpoint" == data["resourceType"] inst2 = endpoint.Endpoint(**data) impl_endpoint_2(inst2) def impl_endpoint_3(inst): assert ( inst.address == ExternalValidatorModel.model_validate( {"valueUrl": "http://fhir3.healthintersections.com.au/open/CarePlan"} ).valueUrl ) assert inst.connectionType[0].coding[0].code == "hl7-fhir-rest" assert ( inst.connectionType[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/endpoint-connection-type" } ).valueUri ) assert inst.contact[0].system == "email" assert inst.contact[0].use == "work" assert inst.contact[0].value == "endpointmanager@example.org" assert inst.description == ( "The CarePlan hub provides a test/dev environment for testing" " submissions" ) assert inst.environmentType[0].coding[0].code == "test" assert ( inst.environmentType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/endpoint-environment"} ).valueUri ) assert inst.environmentType[1].coding[0].code == "dev" assert ( inst.environmentType[1].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/endpoint-environment"} ).valueUri ) assert inst.header[0] == "bearer-code BASGS534s4" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/enpoint-identifier"} ).valueUri ) assert inst.identifier[0].value == "epcp12" assert inst.managingOrganization.reference == "Organization/hl7" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Health Intersections CarePlan Hub" assert inst.payload[0].mimeType[0] == "application/fhir+xml" assert inst.payload[0].type[0].coding[0].code == "CarePlan" assert ( inst.payload[0].type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/fhir-types"} ).valueUri ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-01"} ).valueDateTime ) assert inst.status == "active" assert inst.text.status == "generated" def test_endpoint_3(base_settings): """No. 3 tests collection for Endpoint. Test File: endpoint-example.json """ filename = base_settings["unittest_data_dir"] / "endpoint-example.json" inst = endpoint.Endpoint.model_validate_json(filename.read_bytes()) assert "Endpoint" == inst.get_resource_type() impl_endpoint_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Endpoint" == data["resourceType"] inst2 = endpoint.Endpoint(**data) impl_endpoint_3(inst2) ================================================ FILE: fhir/resources/tests/test_enrollmentrequest.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/EnrollmentRequest Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import enrollmentrequest from .conftest import ExternalValidatorModel def impl_enrollmentrequest_1(inst): assert inst.candidate.reference == "Patient/1" assert inst.coverage.reference == "Coverage/9876B1" assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.id == "22345" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/enrollmentrequest"} ).valueUri ) assert inst.identifier[0].value == "EN22345" assert inst.insurer.reference == "Organization/2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.provider.reference == "Organization/1" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the EnrollmentRequest.
" ) assert inst.text.status == "generated" def test_enrollmentrequest_1(base_settings): """No. 1 tests collection for EnrollmentRequest. Test File: enrollmentrequest-example.json """ filename = base_settings["unittest_data_dir"] / "enrollmentrequest-example.json" inst = enrollmentrequest.EnrollmentRequest.model_validate_json( filename.read_bytes() ) assert "EnrollmentRequest" == inst.get_resource_type() impl_enrollmentrequest_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EnrollmentRequest" == data["resourceType"] inst2 = enrollmentrequest.EnrollmentRequest(**data) impl_enrollmentrequest_1(inst2) ================================================ FILE: fhir/resources/tests/test_enrollmentresponse.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/EnrollmentResponse Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import enrollmentresponse from .conftest import ExternalValidatorModel def impl_enrollmentresponse_1(inst): assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.disposition == "Dependant added to policy." assert inst.id == "ER2500" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/enrollmentresponse"} ).valueUri ) assert inst.identifier[0].value == "781234" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.organization.reference == "Organization/2" assert inst.outcome == "complete" assert ( inst.request.reference == "http://www.BenefitsInc.com/fhir/eligibility/225476332402" ) assert inst.requestProvider.reference == "Organization/1" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the EnrollmentResponse
" ) assert inst.text.status == "generated" def test_enrollmentresponse_1(base_settings): """No. 1 tests collection for EnrollmentResponse. Test File: enrollmentresponse-example.json """ filename = base_settings["unittest_data_dir"] / "enrollmentresponse-example.json" inst = enrollmentresponse.EnrollmentResponse.model_validate_json( filename.read_bytes() ) assert "EnrollmentResponse" == inst.get_resource_type() impl_enrollmentresponse_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EnrollmentResponse" == data["resourceType"] inst2 = enrollmentresponse.EnrollmentResponse(**data) impl_enrollmentresponse_1(inst2) ================================================ FILE: fhir/resources/tests/test_episodeofcare.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/EpisodeOfCare Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import episodeofcare from .conftest import ExternalValidatorModel def impl_episodeofcare_1(inst): assert inst.account[0].display == "example account" assert inst.account[0].reference == "Account/example" assert inst.careManager.display == "Carla Espinosa" assert inst.careManager.reference == "Practitioner/f204" assert inst.careTeam[0].display == "example care team" assert inst.careTeam[0].reference == "CareTeam/example" assert inst.diagnosis[0].condition[0].reference.reference == "Condition/stroke" assert inst.diagnosis[0].use.coding[0].code == "CC" assert inst.diagnosis[0].use.coding[0].display == "Chief complaint" assert ( inst.diagnosis[0].use.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/diagnosis-role"} ).valueUri ) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/sampleepisodeofcare-identifier"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.managingOrganization.reference == "Organization/hl7" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-01"} ).valueDateTime ) assert inst.referralRequest[0].display == "Referral from Example Aged Care Services" assert inst.status == "active" assert ( inst.statusHistory[0].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-14"} ).valueDateTime ) assert ( inst.statusHistory[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-01"} ).valueDateTime ) assert inst.statusHistory[0].status == "planned" assert ( inst.statusHistory[1].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-21"} ).valueDateTime ) assert ( inst.statusHistory[1].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-15"} ).valueDateTime ) assert inst.statusHistory[1].status == "active" assert ( inst.statusHistory[2].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-24"} ).valueDateTime ) assert ( inst.statusHistory[2].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-22"} ).valueDateTime ) assert inst.statusHistory[2].status == "onhold" assert ( inst.statusHistory[3].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-25"} ).valueDateTime ) assert inst.statusHistory[3].status == "active" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "hacc" assert inst.type[0].coding[0].display == "Home and Community Care" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/episodeofcare-type"} ).valueUri ) def test_episodeofcare_1(base_settings): """No. 1 tests collection for EpisodeOfCare. Test File: episodeofcare-example.json """ filename = base_settings["unittest_data_dir"] / "episodeofcare-example.json" inst = episodeofcare.EpisodeOfCare.model_validate_json(filename.read_bytes()) assert "EpisodeOfCare" == inst.get_resource_type() impl_episodeofcare_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EpisodeOfCare" == data["resourceType"] inst2 = episodeofcare.EpisodeOfCare(**data) impl_episodeofcare_1(inst2) ================================================ FILE: fhir/resources/tests/test_eventdefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/EventDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import eventdefinition from .conftest import ExternalValidatorModel def impl_eventdefinition_1(inst): assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.purpose == "Monitor all admissions to Emergency" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.trigger[0].condition.description == ( "Encounter Location = emergency (active/completed encounters," " current or previous)" ) assert inst.trigger[0].condition.expression == ( "(%current | %previous).location.where(location = " "'Location/emergency' and status in {'active', " "'completed'}).exists()" ) assert inst.trigger[0].condition.language == "text/fhirpath" assert inst.trigger[0].data[0].type == "Encounter" assert inst.trigger[0].name == "monitor-emergency-admissions" assert inst.trigger[0].type == "named-event" def test_eventdefinition_1(base_settings): """No. 1 tests collection for EventDefinition. Test File: eventdefinition-example.json """ filename = base_settings["unittest_data_dir"] / "eventdefinition-example.json" inst = eventdefinition.EventDefinition.model_validate_json(filename.read_bytes()) assert "EventDefinition" == inst.get_resource_type() impl_eventdefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EventDefinition" == data["resourceType"] inst2 = eventdefinition.EventDefinition(**data) impl_eventdefinition_1(inst2) ================================================ FILE: fhir/resources/tests/test_evidence.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Evidence Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import evidence from .conftest import ExternalValidatorModel def impl_evidence_1(inst): assert inst.description == ( "0.4% incidence of fatal intracranial hemorrhage within 7 " "days without alteplase in patients with acute ischemic " "stroke" ) assert inst.id == "example-stroke-no-alteplase-fatalICH" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.10.4" assert inst.name == "RiskOfFatalICHWithoutAlteplaseForStroke" assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "https://doi.org/10.1016/S0140-6736(14)60584-5"} ).valueUrl ) assert inst.relatedArtifact[0].label == "Emberson 2014" assert inst.relatedArtifact[0].type == "citation" assert inst.statistic[0].numberOfEvents == 13 assert float(inst.statistic[0].quantity.value) == float(0.00386298627) assert inst.statistic[0].sampleSize.numberOfParticipants == 3365 assert inst.statistic[0].sampleSize.numberOfStudies == 9 assert inst.statistic[0].statisticType.coding[0].code == "C44256" assert inst.statistic[0].statisticType.coding[0].display == "Proportion" assert ( inst.statistic[0].statisticType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/statistic-type"} ).valueUri ) assert inst.status == "draft" assert inst.studyDesign[0].coding[0].code == "SEVCO:01003" assert inst.studyDesign[0].coding[0].display == "randomized assignment" assert ( inst.studyDesign[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/study-design"} ).valueUri ) assert inst.synthesisType.coding[0].code == "IPD-MA" assert ( inst.synthesisType.coding[0].display == "individual patient data meta-analysis" ) assert ( inst.synthesisType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/synthesis-type"} ).valueUri ) assert inst.text.status == "generated" assert inst.title == "Risk of fatal ICH without alteplase for stroke" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/Evidence/example-stroke-no-alteplase-fatalICH" } ).valueUri ) assert ( inst.variableDefinition[0].intended.display == "adults with acute ischemic stroke" ) assert inst.variableDefinition[0].intended.reference == "Group/AcuteIschemicStroke" assert ( inst.variableDefinition[0].intended.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert ( inst.variableDefinition[0].observed.display == "adults with acute ischemic stroke" ) assert inst.variableDefinition[0].observed.reference == "Group/AcuteIschemicStroke" assert ( inst.variableDefinition[0].observed.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert inst.variableDefinition[0].variableRole.coding[0].code == "population" assert inst.variableDefinition[0].variableRole.coding[0].display == "population" assert ( inst.variableDefinition[0].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) assert ( inst.variableDefinition[1].intended.display == "adults with acute ischemic stroke treated without alteplase" ) assert ( inst.variableDefinition[1].intended.reference == "Group/AcuteIschemicStrokeTreatedWithoutAlteplase" ) assert ( inst.variableDefinition[1].intended.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert ( inst.variableDefinition[1].observed.display == "Emberson 2014 IPD-MA No Alteplase Cohort" ) assert ( inst.variableDefinition[1].observed.reference == "Group/Emberson-2014-IPD-MA-No-Alteplase-Cohort" ) assert ( inst.variableDefinition[1].observed.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert inst.variableDefinition[1].variableRole.coding[0].code == "population" assert inst.variableDefinition[1].variableRole.coding[0].display == "population" assert ( inst.variableDefinition[1].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) assert inst.variableDefinition[2].intended.display == "fatal ICH" assert ( inst.variableDefinition[2].intended.reference == "EvidenceVariable/example-fatal-ICH-in-7-days" ) assert ( inst.variableDefinition[2].intended.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[2].observed.display == "fatal ICH" assert ( inst.variableDefinition[2].observed.reference == "EvidenceVariable/example-fatal-ICH-in-7-days" ) assert ( inst.variableDefinition[2].observed.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[2].variableRole.coding[0].code == "measuredVariable" assert ( inst.variableDefinition[2].variableRole.coding[0].display == "measured variable" ) assert ( inst.variableDefinition[2].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) def test_evidence_1(base_settings): """No. 1 tests collection for Evidence. Test File: evidence-example-stroke-no-alteplase-fatalICH.json """ filename = ( base_settings["unittest_data_dir"] / "evidence-example-stroke-no-alteplase-fatalICH.json" ) inst = evidence.Evidence.model_validate_json(filename.read_bytes()) assert "Evidence" == inst.get_resource_type() impl_evidence_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Evidence" == data["resourceType"] inst2 = evidence.Evidence(**data) impl_evidence_1(inst2) def impl_evidence_2(inst): assert inst.certainty[0].description == ( "Very low certainty due to risk of bias, inconsistency, " "imprecision, and indirectness" ) assert inst.certainty[0].rating.coding[0].code == "very-low" assert inst.certainty[0].rating.coding[0].display == "Very low quality" assert ( inst.certainty[0].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[0].rating.coding[0].code == "no-concern" assert ( inst.certainty[0].subcomponent[0].rating.coding[0].display == "no serious concern" ) assert ( inst.certainty[0].subcomponent[0].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[0].type.coding[0].code == "PublicationBias" assert ( inst.certainty[0].subcomponent[0].type.coding[0].display == "Publication bias" ) assert ( inst.certainty[0].subcomponent[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.certainty[0].subcomponent[1].note[0].text == ( "IST-3 had inconsistent results and contributed large " "proportion of data" ) assert inst.certainty[0].subcomponent[1].rating.coding[0].code == "serious-concern" assert ( inst.certainty[0].subcomponent[1].rating.coding[0].display == "serious concern" ) assert ( inst.certainty[0].subcomponent[1].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[1].type.coding[0].code == "Inconsistency" assert inst.certainty[0].subcomponent[1].type.coding[0].display == "Inconsistency" assert ( inst.certainty[0].subcomponent[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.certainty[0].subcomponent[2].rating.coding[0].code == "serious-concern" assert ( inst.certainty[0].subcomponent[2].rating.coding[0].display == "serious concern" ) assert ( inst.certainty[0].subcomponent[2].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[2].type.coding[0].code == "Imprecision" assert inst.certainty[0].subcomponent[2].type.coding[0].display == "Imprecision" assert ( inst.certainty[0].subcomponent[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.certainty[0].subcomponent[3].note[0].text == ( "resuts derived for 3 - 4.5 hours assume data from 0 - 6 " "hours is informative" ) assert inst.certainty[0].subcomponent[3].rating.coding[0].code == "serious-concern" assert ( inst.certainty[0].subcomponent[3].rating.coding[0].display == "serious concern" ) assert ( inst.certainty[0].subcomponent[3].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[3].type.coding[0].code == "Indirectness" assert inst.certainty[0].subcomponent[3].type.coding[0].display == "Indirectness" assert ( inst.certainty[0].subcomponent[3].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.certainty[0].subcomponent[4].note[0].text == ( "results largely influenced by IST-3 trial which was " "unblinded and ECASS III which had baseline imbalances" ) assert inst.certainty[0].subcomponent[4].rating.coding[0].code == "serious-concern" assert ( inst.certainty[0].subcomponent[4].rating.coding[0].display == "serious concern" ) assert ( inst.certainty[0].subcomponent[4].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[4].type.coding[0].code == "RiskOfBias" assert inst.certainty[0].subcomponent[4].type.coding[0].display == "Risk of bias" assert ( inst.certainty[0].subcomponent[4].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.certainty[0].type.coding[0].code == "Overall" assert inst.certainty[0].type.coding[0].display == "Overall quality" assert ( inst.certainty[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.description == ( "mRS 0-2 at 90 days Odds Ratio 1.2 for Alteplase vs. No " "Alteplase in patients with acute ischemic stroke 3-4.5 hours" " prior" ) assert inst.id == "example-stroke-3-4half-alteplase-vs-no-alteplase-mRS0-2" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.10.3" assert inst.name == ( "EffectOfAlteplaseVsNoAlteplaseOnMRS02At90DaysInStroke345Hour" "sPrior" ) assert inst.relatedArtifact[0].display == "Figure 2 Lees 2016" assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "https://doi.org/10.1161/STROKEAHA.116.013644"} ).valueUrl ) assert inst.relatedArtifact[0].label == "Lees 2016" assert inst.relatedArtifact[0].type == "citation" assert inst.statistic[0].attributeEstimate[0].description == "95% CI 1.06 to 1.3" assert float(inst.statistic[0].attributeEstimate[0].level) == float(0.95) assert float(inst.statistic[0].attributeEstimate[0].range.high.value) == float(1.3) assert float(inst.statistic[0].attributeEstimate[0].range.low.value) == float(1.06) assert inst.statistic[0].attributeEstimate[0].type.coding[0].code == "C53324" assert ( inst.statistic[0].attributeEstimate[0].type.coding[0].display == "Confidence interval" ) assert ( inst.statistic[0].attributeEstimate[0].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/attribute-estimate-type" } ).valueUri ) assert float(inst.statistic[0].quantity.value) == float(1.2) assert inst.statistic[0].sampleSize.numberOfStudies == 9 assert inst.statistic[0].statisticType.coding[0].code == "C16932" assert inst.statistic[0].statisticType.coding[0].display == "Odds Ratio" assert ( inst.statistic[0].statisticType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/statistic-type"} ).valueUri ) assert inst.status == "draft" assert inst.studyDesign[0].coding[0].code == "SEVCO:01003" assert inst.studyDesign[0].coding[0].display == "randomized assignment" assert ( inst.studyDesign[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/study-design"} ).valueUri ) assert inst.synthesisType.coding[0].code == "IPD-MA" assert ( inst.synthesisType.coding[0].display == "individual patient data meta-analysis" ) assert ( inst.synthesisType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/synthesis-type"} ).valueUri ) assert inst.text.status == "generated" assert inst.title == ( "Effect of Alteplase vs No alteplase on mRS 0-2 at 90 days in" " Stroke 3-4.5 hours prior" ) assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/Evidence/example-stroke-3-4half-alteplase-vs-no-alteplase-mRS0-2" } ).valueUri ) assert inst.variableDefinition[0].directnessMatch.coding[0].code == "moderate" assert ( inst.variableDefinition[0].directnessMatch.coding[0].display == "Moderate quality match" ) assert ( inst.variableDefinition[0].directnessMatch.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/directness"} ).valueUri ) assert inst.variableDefinition[0].intended.display == "stroke at 3-4.5 hours" assert ( inst.variableDefinition[0].intended.reference == "Group/AcuteIschemicStroke3-4halfHours" ) assert ( inst.variableDefinition[0].intended.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert ( inst.variableDefinition[0].observed.display == "Stroke Thrombolysis Trialists’ 2014-2016 IPD-MA Cohort" ) assert inst.variableDefinition[0].observed.reference == ( "EvidenceVariable/Stroke-Thrombolysis-" "Trialists-2014-2016-IPD-MA-Cohort" ) assert ( inst.variableDefinition[0].observed.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[0].variableRole.coding[0].code == "population" assert inst.variableDefinition[0].variableRole.coding[0].display == "population" assert ( inst.variableDefinition[0].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) assert ( inst.variableDefinition[1].intended.display == "Alive and not functionally dependent at 90 days" ) assert ( inst.variableDefinition[1].intended.reference == "EvidenceVariable/example-alive-independent-90day" ) assert ( inst.variableDefinition[1].intended.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[1].observed.display == "mRS 0-2 at 90 days" assert ( inst.variableDefinition[1].observed.reference == "EvidenceVariable/example-mRS0-2-at-90days" ) assert ( inst.variableDefinition[1].observed.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[1].variableRole.coding[0].code == "measuredVariable" assert ( inst.variableDefinition[1].variableRole.coding[0].display == "measured variable" ) assert ( inst.variableDefinition[1].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) assert inst.variableDefinition[2].intended.display == "Alteplase for Stroke" assert ( inst.variableDefinition[2].intended.reference == "EvidenceVariable/example-alteplase-for-stroke" ) assert ( inst.variableDefinition[2].intended.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[2].observed.display == "Alteplase for Stroke" assert ( inst.variableDefinition[2].observed.reference == "EvidenceVariable/example-alteplase-for-stroke" ) assert ( inst.variableDefinition[2].observed.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[2].variableRole.coding[0].code == "exposure" assert inst.variableDefinition[2].variableRole.coding[0].display == "exposure" assert ( inst.variableDefinition[2].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) assert inst.variableDefinition[3].intended.display == "no alteplase" assert ( inst.variableDefinition[3].intended.reference == "EvidenceVariable/example-no-alteplase" ) assert ( inst.variableDefinition[3].intended.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[3].observed.display == "no alteplase" assert ( inst.variableDefinition[3].observed.reference == "EvidenceVariable/example-no-alteplase" ) assert ( inst.variableDefinition[3].observed.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[3].variableRole.coding[0].code == "referenceExposure" assert ( inst.variableDefinition[3].variableRole.coding[0].display == "reference exposure" ) assert ( inst.variableDefinition[3].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) def test_evidence_2(base_settings): """No. 2 tests collection for Evidence. Test File: evidence-example-stroke-3-4half-alteplase-vs-no-alteplase-mRS0-2.json """ filename = ( base_settings["unittest_data_dir"] / "evidence-example-stroke-3-4half-alteplase-vs-no-alteplase-mRS0-2.json" ) inst = evidence.Evidence.model_validate_json(filename.read_bytes()) assert "Evidence" == inst.get_resource_type() impl_evidence_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Evidence" == data["resourceType"] inst2 = evidence.Evidence(**data) impl_evidence_2(inst2) def impl_evidence_3(inst): assert inst.certainty[0].description == "Moderate certainty due to risk of bias" assert inst.certainty[0].rating.coding[0].code == "moderate" assert inst.certainty[0].rating.coding[0].display == "Moderate" assert ( inst.certainty[0].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[0].rating.coding[0].code == "no-concern" assert ( inst.certainty[0].subcomponent[0].rating.coding[0].display == "no serious concern" ) assert ( inst.certainty[0].subcomponent[0].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[0].type.coding[0].code == "PublicationBias" assert ( inst.certainty[0].subcomponent[0].type.coding[0].display == "Publication bias" ) assert ( inst.certainty[0].subcomponent[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.certainty[0].subcomponent[1].rating.coding[0].code == "no-concern" assert ( inst.certainty[0].subcomponent[1].rating.coding[0].display == "no serious concern" ) assert ( inst.certainty[0].subcomponent[1].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[1].type.coding[0].code == "Inconsistency" assert inst.certainty[0].subcomponent[1].type.coding[0].display == "Inconsistency" assert ( inst.certainty[0].subcomponent[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.certainty[0].subcomponent[2].rating.coding[0].code == "no-concern" assert ( inst.certainty[0].subcomponent[2].rating.coding[0].display == "no serious concern" ) assert ( inst.certainty[0].subcomponent[2].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[2].type.coding[0].code == "Imprecision" assert inst.certainty[0].subcomponent[2].type.coding[0].display == "Imprecision" assert ( inst.certainty[0].subcomponent[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.certainty[0].subcomponent[3].rating.coding[0].code == "no-concern" assert ( inst.certainty[0].subcomponent[3].rating.coding[0].display == "no serious concern" ) assert ( inst.certainty[0].subcomponent[3].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[3].type.coding[0].code == "Indirectness" assert inst.certainty[0].subcomponent[3].type.coding[0].display == "Indirectness" assert ( inst.certainty[0].subcomponent[3].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.certainty[0].subcomponent[4].note[0].text == ( "results largely influenced by IST-3 trial which was " "unblinded and NINDS trial which had allocation concealment " "not stated and baseline imbalances" ) assert inst.certainty[0].subcomponent[4].rating.coding[0].code == "serious-concern" assert ( inst.certainty[0].subcomponent[4].rating.coding[0].display == "serious concern" ) assert ( inst.certainty[0].subcomponent[4].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[4].type.coding[0].code == "RiskOfBias" assert inst.certainty[0].subcomponent[4].type.coding[0].display == "Risk of bias" assert ( inst.certainty[0].subcomponent[4].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.certainty[0].type.coding[0].code == "Overall" assert inst.certainty[0].type.coding[0].display == "Overall quality" assert ( inst.certainty[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.description == ( "mRS 3-6 at 90 days Odds Ratio 0.65 for Alteplase vs. No " "Alteplase in patients with acute ischemic stroke 0-3 hours " "prior" ) assert inst.id == "example-stroke-0-3-alteplase-vs-no-alteplase-mRS3-6" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.10.5" assert inst.name == ( "EffectOfAlteplaseVsNoAlteplaseOnMRS36At90DaysInStroke03Hours" "Prior" ) assert inst.relatedArtifact[0].citation == ( "Wardlaw JM, Murray V, Berge E, del Zoppo GJ. Thrombolysis " "for acute ischaemic stroke. Cochrane Database Syst Rev. 2014" " Jul 29(7):CD000213. PMID 25072528" ) assert inst.relatedArtifact[0].display == "Analysis 1.16 from Wardlaw 2014" assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "https://doi.org/10.1002/14651858.CD000213.pub3"} ).valueUrl ) assert inst.relatedArtifact[0].label == "Wardlaw 2014" assert inst.relatedArtifact[0].type == "citation" assert inst.statistic[0].attributeEstimate[0].description == "95% CI 0.54 to 0.80" assert float(inst.statistic[0].attributeEstimate[0].level) == float(0.95) assert float(inst.statistic[0].attributeEstimate[0].range.high.value) == float(0.8) assert float(inst.statistic[0].attributeEstimate[0].range.low.value) == float(0.54) assert inst.statistic[0].attributeEstimate[0].type.coding[0].code == "C53324" assert ( inst.statistic[0].attributeEstimate[0].type.coding[0].display == "Confidence interval" ) assert ( inst.statistic[0].attributeEstimate[0].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/attribute-estimate-type" } ).valueUri ) assert inst.statistic[0].attributeEstimate[1].description == "P-value = 0.000023" assert float(inst.statistic[0].attributeEstimate[1].quantity.value) == float( 2.3e-05 ) assert inst.statistic[0].attributeEstimate[1].type.coding[0].code == "C44185" assert inst.statistic[0].attributeEstimate[1].type.coding[0].display == "P-value" assert ( inst.statistic[0].attributeEstimate[1].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/attribute-estimate-type" } ).valueUri ) assert ( inst.statistic[0].attributeEstimate[2].description == "Heterogeneity I-sq = 0.0%" ) assert inst.statistic[0].attributeEstimate[2].quantity.code == "%" assert ( inst.statistic[0].attributeEstimate[2].quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.statistic[0].attributeEstimate[2].quantity.unit == "%" assert float(inst.statistic[0].attributeEstimate[2].quantity.value) == float(0) assert inst.statistic[0].attributeEstimate[2].type.coding[0].code == "0000420" assert inst.statistic[0].attributeEstimate[2].type.coding[0].display == "I-squared" assert ( inst.statistic[0].attributeEstimate[2].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/attribute-estimate-type" } ).valueUri ) assert inst.statistic[0].numberOfEvents == 1137 assert float(inst.statistic[0].quantity.value) == float(0.65) assert inst.statistic[0].sampleSize.numberOfParticipants == 1779 assert inst.statistic[0].sampleSize.numberOfStudies == 6 assert inst.statistic[0].statisticType.coding[0].code == "C16932" assert inst.statistic[0].statisticType.coding[0].display == "Odds Ratio" assert ( inst.statistic[0].statisticType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/statistic-type"} ).valueUri ) assert inst.status == "draft" assert inst.studyDesign[0].coding[0].code == "SEVCO:01003" assert inst.studyDesign[0].coding[0].display == "randomized assignment" assert ( inst.studyDesign[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/study-design"} ).valueUri ) assert inst.synthesisType.coding[0].code == "std-MA" assert inst.synthesisType.coding[0].display == "summary data meta-analysis" assert ( inst.synthesisType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/synthesis-type"} ).valueUri ) assert inst.text.status == "generated" assert inst.title == ( "Effect of Alteplase vs No alteplase on mRS 3-6 at 90 days in" " Stroke 0-3 hours prior" ) assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/Evidence/example-stroke-0-3-alteplase-vs-no-alteplase-mRS3-6" } ).valueUri ) assert inst.variableDefinition[0].intended.display == "stroke at 0-3 hours" assert ( inst.variableDefinition[0].intended.reference == "Group/AcuteIschemicStroke0-3Hours" ) assert ( inst.variableDefinition[0].intended.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert ( inst.variableDefinition[0].observed.display == "Wardlaw 2014 Analysis 1.16.3 Evidence set" ) assert ( inst.variableDefinition[0].observed.reference == "EvidenceVariable/Wardlaw2014Analysis1.16.3EvidenceSet" ) assert ( inst.variableDefinition[0].observed.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[0].variableRole.coding[0].code == "population" assert inst.variableDefinition[0].variableRole.coding[0].display == "population" assert ( inst.variableDefinition[0].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) assert ( inst.variableDefinition[1].intended.display == "Dead or functionally dependent at 90 days" ) assert ( inst.variableDefinition[1].intended.reference == "EvidenceVariable/example-dead-or-dependent-90day" ) assert ( inst.variableDefinition[1].intended.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[1].observed.display == "mRS 3-6 at 90 days" assert ( inst.variableDefinition[1].observed.reference == "EvidenceVariable/example-mRS3-6-at-90days" ) assert ( inst.variableDefinition[1].observed.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[1].variableRole.coding[0].code == "measuredVariable" assert ( inst.variableDefinition[1].variableRole.coding[0].display == "measured variable" ) assert ( inst.variableDefinition[1].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) assert inst.variableDefinition[2].intended.display == "Alteplase for Stroke" assert ( inst.variableDefinition[2].intended.reference == "EvidenceVariable/example-alteplase-for-stroke" ) assert ( inst.variableDefinition[2].intended.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[2].observed.display == "Alteplase for Stroke" assert ( inst.variableDefinition[2].observed.reference == "EvidenceVariable/example-alteplase-for-stroke" ) assert ( inst.variableDefinition[2].observed.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[2].variableRole.coding[0].code == "exposure" assert inst.variableDefinition[2].variableRole.coding[0].display == "exposure" assert ( inst.variableDefinition[2].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) assert inst.variableDefinition[3].intended.display == "no alteplase" assert ( inst.variableDefinition[3].intended.reference == "EvidenceVariable/example-no-alteplase" ) assert ( inst.variableDefinition[3].intended.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[3].observed.display == "no alteplase" assert ( inst.variableDefinition[3].observed.reference == "EvidenceVariable/example-no-alteplase" ) assert ( inst.variableDefinition[3].observed.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[3].variableRole.coding[0].code == "referenceExposure" assert ( inst.variableDefinition[3].variableRole.coding[0].display == "reference exposure" ) assert ( inst.variableDefinition[3].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) def test_evidence_3(base_settings): """No. 3 tests collection for Evidence. Test File: evidence-example-stroke-0-3-alteplase-vs-no-alteplase-mRS3-6.json """ filename = ( base_settings["unittest_data_dir"] / "evidence-example-stroke-0-3-alteplase-vs-no-alteplase-mRS3-6.json" ) inst = evidence.Evidence.model_validate_json(filename.read_bytes()) assert "Evidence" == inst.get_resource_type() impl_evidence_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Evidence" == data["resourceType"] inst2 = evidence.Evidence(**data) impl_evidence_3(inst2) def impl_evidence_4(inst): assert inst.description == ( "2.7% incidence of fatal intracranial hemorrhage within 7 " "days with alteplase in patients with acute ischemic stroke" ) assert inst.id == "example-stroke-alteplase-fatalICH" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.10.1" assert inst.name == "RiskOfFatalICHWithAlteplaseForStroke" assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "https://doi.org/10.1016/S0140-6736(14)60584-5"} ).valueUrl ) assert inst.relatedArtifact[0].label == "Emberson 2014" assert inst.relatedArtifact[0].type == "citation" assert inst.statistic[0].numberOfEvents == 91 assert float(inst.statistic[0].quantity.value) == float(0.026835741669) assert inst.statistic[0].sampleSize.numberOfParticipants == 3391 assert inst.statistic[0].sampleSize.numberOfStudies == 9 assert inst.statistic[0].statisticType.coding[0].code == "C44256" assert inst.statistic[0].statisticType.coding[0].display == "Proportion" assert ( inst.statistic[0].statisticType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/statistic-type"} ).valueUri ) assert inst.status == "draft" assert inst.studyDesign[0].coding[0].code == "SEVCO:01003" assert inst.studyDesign[0].coding[0].display == "randomized assignment" assert ( inst.studyDesign[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/study-design"} ).valueUri ) assert inst.synthesisType.coding[0].code == "IPD-MA" assert ( inst.synthesisType.coding[0].display == "individual patient data meta-analysis" ) assert ( inst.synthesisType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/synthesis-type"} ).valueUri ) assert inst.text.status == "generated" assert inst.title == "Risk of fatal ICH with alteplase for stroke" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/Evidence/example-stroke-alteplase-fatalICH" } ).valueUri ) assert ( inst.variableDefinition[0].intended.display == "adults with acute ischemic stroke" ) assert inst.variableDefinition[0].intended.reference == "Group/AcuteIschemicStroke" assert ( inst.variableDefinition[0].intended.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert ( inst.variableDefinition[0].observed.display == "adults with acute ischemic stroke" ) assert inst.variableDefinition[0].observed.reference == "Group/AcuteIschemicStroke" assert ( inst.variableDefinition[0].observed.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert inst.variableDefinition[0].variableRole.coding[0].code == "population" assert inst.variableDefinition[0].variableRole.coding[0].display == "population" assert ( inst.variableDefinition[0].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) assert ( inst.variableDefinition[1].intended.display == "adults with acute ischemic stroke treated with alteplase" ) assert ( inst.variableDefinition[1].intended.reference == "Group/AcuteIschemicStrokeTreatedWithAlteplase" ) assert ( inst.variableDefinition[1].intended.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert ( inst.variableDefinition[1].observed.display == "Emberson 2014 IPD-MA Alteplase Cohort" ) assert ( inst.variableDefinition[1].observed.reference == "Group/Emberson-2014-IPD-MA-Alteplase-Cohort" ) assert ( inst.variableDefinition[1].observed.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert inst.variableDefinition[1].variableRole.coding[0].code == "population" assert inst.variableDefinition[1].variableRole.coding[0].display == "population" assert ( inst.variableDefinition[1].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) assert inst.variableDefinition[2].intended.display == "fatal ICH" assert ( inst.variableDefinition[2].intended.reference == "EvidenceVariable/example-fatal-ICH-in-7-days" ) assert ( inst.variableDefinition[2].intended.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[2].observed.display == "fatal ICH" assert ( inst.variableDefinition[2].observed.reference == "EvidenceVariable/example-fatal-ICH-in-7-days" ) assert ( inst.variableDefinition[2].observed.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[2].variableRole.coding[0].code == "measuredVariable" assert ( inst.variableDefinition[2].variableRole.coding[0].display == "measured variable" ) assert ( inst.variableDefinition[2].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) def test_evidence_4(base_settings): """No. 4 tests collection for Evidence. Test File: evidence-example-stroke-alteplase-fatalICH.json """ filename = ( base_settings["unittest_data_dir"] / "evidence-example-stroke-alteplase-fatalICH.json" ) inst = evidence.Evidence.model_validate_json(filename.read_bytes()) assert "Evidence" == inst.get_resource_type() impl_evidence_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Evidence" == data["resourceType"] inst2 = evidence.Evidence(**data) impl_evidence_4(inst2) def impl_evidence_5(inst): assert inst.certainty[0].rating.coding[0].code == "high" assert inst.certainty[0].rating.coding[0].display == "High quality" assert ( inst.certainty[0].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[0].rating.coding[0].code == "no-concern" assert ( inst.certainty[0].subcomponent[0].rating.coding[0].display == "no serious concern" ) assert ( inst.certainty[0].subcomponent[0].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[0].type.coding[0].code == "RiskOfBias" assert inst.certainty[0].subcomponent[0].type.coding[0].display == "Risk of bias" assert ( inst.certainty[0].subcomponent[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.certainty[0].subcomponent[1].description == ( "Estimated risk from validation calibration plot consistent " "with predicted risk; observed risk in subgroup with ASTRAL " "score = 12 consistent with validation calibration plot" ) assert inst.certainty[0].subcomponent[1].rating.coding[0].code == "no-concern" assert ( inst.certainty[0].subcomponent[1].rating.coding[0].display == "no serious concern" ) assert ( inst.certainty[0].subcomponent[1].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[1].type.coding[0].code == "Inconsistency" assert inst.certainty[0].subcomponent[1].type.coding[0].display == "Inconsistency" assert ( inst.certainty[0].subcomponent[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.certainty[0].subcomponent[2].rating.coding[0].code == "no-concern" assert ( inst.certainty[0].subcomponent[2].rating.coding[0].display == "no serious concern" ) assert ( inst.certainty[0].subcomponent[2].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[2].type.coding[0].code == "Indirectness" assert inst.certainty[0].subcomponent[2].type.coding[0].display == "Indirectness" assert ( inst.certainty[0].subcomponent[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.certainty[0].subcomponent[3].description == "Narrow confidence interval" assert inst.certainty[0].subcomponent[3].rating.coding[0].code == "no-concern" assert ( inst.certainty[0].subcomponent[3].rating.coding[0].display == "no serious concern" ) assert ( inst.certainty[0].subcomponent[3].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[3].type.coding[0].code == "Imprecision" assert inst.certainty[0].subcomponent[3].type.coding[0].display == "Imprecision" assert ( inst.certainty[0].subcomponent[3].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.certainty[0].subcomponent[4].rating.coding[0].code == "no-concern" assert ( inst.certainty[0].subcomponent[4].rating.coding[0].display == "no serious concern" ) assert ( inst.certainty[0].subcomponent[4].rating.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-rating"} ).valueUri ) assert inst.certainty[0].subcomponent[4].type.coding[0].code == "PublicationBias" assert ( inst.certainty[0].subcomponent[4].type.coding[0].display == "Publication bias" ) assert ( inst.certainty[0].subcomponent[4].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.certainty[0].type.coding[0].code == "Overall" assert inst.certainty[0].type.coding[0].display == "Overall quality" assert ( inst.certainty[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/certainty-type"} ).valueUri ) assert inst.description == "5.3% risk of mRS 3-6 at 90 days" assert inst.id == "example-ASTRAL-12-alteplase-mRS3-6" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.10.2" assert inst.name == "RiskOfMRS36At90DaysAfterAlteplaseForStrokeIfASTRALScore12" assert inst.relatedArtifact[0].display == ( "External Validation of the ASTRAL and DRAGON Scores for " "Prediction of Functional Outcome in Stroke." ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "https://doi.org/10.1161/STROKEAHA.116.012802"} ).valueUrl ) assert inst.relatedArtifact[0].label == "Cooray 2016 Validation Study" assert inst.relatedArtifact[0].type == "citation" assert inst.statistic[0].description == "5.3% risk" assert float(inst.statistic[0].quantity.value) == float(0.0525) assert inst.statistic[0].sampleSize.numberOfParticipants == 36131 assert inst.statistic[0].statisticType.coding[0].code == "C44256" assert inst.statistic[0].statisticType.coding[0].display == "Proportion" assert ( inst.statistic[0].statisticType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/statistic-type"} ).valueUri ) assert inst.statistic[0].statisticType.text == "derived proportion" assert inst.status == "draft" assert inst.studyDesign[0].coding[0].code == "SEVCO:01016" assert inst.studyDesign[0].coding[0].display == "Uncontrolled cohort design" assert ( inst.studyDesign[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/study-design"} ).valueUri ) assert inst.text.status == "generated" assert inst.title == ( "Risk of mRS3-6 at 90 days after Alteplase for Stroke if " "ASTRAL score 12" ) assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/Evidence/example-ASTRAL-12-alteplase-mRS3-6" } ).valueUri ) assert inst.variableDefinition[0].intended.display == ( "patients 0-4.5 hours after acute ischemic stroke onset with " "ASTRAL score = 12" ) assert inst.variableDefinition[0].intended.reference == "Group/ASTRAL-12" assert ( inst.variableDefinition[0].intended.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert inst.variableDefinition[0].observed.display == "ASTRAL validation cohort" assert ( inst.variableDefinition[0].observed.reference == "Group/ASTRAL-Cooray-validation-cohort" ) assert ( inst.variableDefinition[0].observed.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert inst.variableDefinition[0].variableRole.coding[0].code == "population" assert inst.variableDefinition[0].variableRole.coding[0].display == "population" assert ( inst.variableDefinition[0].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) assert ( inst.variableDefinition[1].description == "functionally dependent or dead at 3 months" ) assert inst.variableDefinition[1].directnessMatch.coding[0].code == "high" assert ( inst.variableDefinition[1].directnessMatch.coding[0].display == "High quality match" ) assert ( inst.variableDefinition[1].directnessMatch.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/directness"} ).valueUri ) assert ( inst.variableDefinition[1].intended.display == "Dead or functionally dependent at 90 days" ) assert ( inst.variableDefinition[1].intended.reference == "EvidenceVariable/example-dead-or-dependent-90day" ) assert ( inst.variableDefinition[1].intended.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[1].observed.display == "mRS 3-6 at 90 days" assert ( inst.variableDefinition[1].observed.reference == "EvidenceVariable/example-mRS3-6-at-90days" ) assert ( inst.variableDefinition[1].observed.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[1].variableRole.coding[0].code == "measuredVariable" assert ( inst.variableDefinition[1].variableRole.coding[0].display == "measured variable" ) assert ( inst.variableDefinition[1].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) assert inst.variableDefinition[2].directnessMatch.coding[0].code == "exact" assert inst.variableDefinition[2].directnessMatch.coding[0].display == "Exact match" assert ( inst.variableDefinition[2].directnessMatch.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/directness"} ).valueUri ) assert inst.variableDefinition[2].intended.display == "Alteplase for Stroke" assert ( inst.variableDefinition[2].intended.reference == "EvidenceVariable/example-alteplase-for-stroke" ) assert ( inst.variableDefinition[2].intended.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[2].observed.display == "Alteplase for Stroke" assert ( inst.variableDefinition[2].observed.reference == "EvidenceVariable/example-alteplase-for-stroke" ) assert ( inst.variableDefinition[2].observed.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.variableDefinition[2].variableRole.coding[0].code == "exposure" assert inst.variableDefinition[2].variableRole.coding[0].display == "exposure" assert ( inst.variableDefinition[2].variableRole.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variable-role"} ).valueUri ) def test_evidence_5(base_settings): """No. 5 tests collection for Evidence. Test File: evidence-example-ASTRAL-12-alteplase-mRS3-6.json """ filename = ( base_settings["unittest_data_dir"] / "evidence-example-ASTRAL-12-alteplase-mRS3-6.json" ) inst = evidence.Evidence.model_validate_json(filename.read_bytes()) assert "Evidence" == inst.get_resource_type() impl_evidence_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Evidence" == data["resourceType"] inst2 = evidence.Evidence(**data) impl_evidence_5(inst2) ================================================ FILE: fhir/resources/tests/test_evidencereport.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/EvidenceReport Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import evidencereport from .conftest import ExternalValidatorModel def impl_evidencereport_1(inst): assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "draft" assert inst.subject.note[0].text == "This is just an example." assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" def test_evidencereport_1(base_settings): """No. 1 tests collection for EvidenceReport. Test File: evidencereport-example.json """ filename = base_settings["unittest_data_dir"] / "evidencereport-example.json" inst = evidencereport.EvidenceReport.model_validate_json(filename.read_bytes()) assert "EvidenceReport" == inst.get_resource_type() impl_evidencereport_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EvidenceReport" == data["resourceType"] inst2 = evidencereport.EvidenceReport(**data) impl_evidencereport_1(inst2) ================================================ FILE: fhir/resources/tests/test_evidencevariable.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/EvidenceVariable Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import evidencevariable from .conftest import ExternalValidatorModel def impl_evidencevariable_1(inst): assert inst.actual is True assert ( inst.characteristic[0].definitionCodeableConcept.coding[0].code == "182886004" ) assert ( inst.characteristic[0].definitionCodeableConcept.coding[0].display == "Placebo given (situation)" ) assert ( inst.characteristic[0].definitionCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.characteristic[0].description == "placebo" assert inst.description == "placebo" assert inst.id == "example-placebo" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Placebo" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "placebo" def test_evidencevariable_1(base_settings): """No. 1 tests collection for EvidenceVariable. Test File: evidencevariable-example-placebo.json """ filename = ( base_settings["unittest_data_dir"] / "evidencevariable-example-placebo.json" ) inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes()) assert "EvidenceVariable" == inst.get_resource_type() impl_evidencevariable_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EvidenceVariable" == data["resourceType"] inst2 = evidencevariable.EvidenceVariable(**data) impl_evidencevariable_1(inst2) def impl_evidencevariable_2(inst): assert inst.actual is True assert inst.characteristic[0].definitionExpression.description == "mRS 0-2" assert inst.characteristic[0].definitionExpression.expression == ( '["Observation": code in "75859-9|LOINC"] mRS where ' "mRS.value between 0 and 2" ) assert inst.characteristic[0].definitionExpression.language == "text/cql" assert inst.characteristic[0].description == "mRS 0-2 at 90 days" assert ( inst.characteristic[0].timeFromEvent[0].eventCodeableConcept.coding[0].code == "study-start" ) assert ( inst.characteristic[0].timeFromEvent[0].eventCodeableConcept.coding[0].display == "Study Start" ) assert ( inst.characteristic[0].timeFromEvent[0].eventCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/evidence-variable-event"} ).valueUri ) assert inst.characteristic[0].timeFromEvent[0].quantity.code == "d" assert ( inst.characteristic[0].timeFromEvent[0].quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[0].timeFromEvent[0].quantity.unit == "day" assert float(inst.characteristic[0].timeFromEvent[0].quantity.value) == float(90) assert ( inst.description == "Modified Rankin Scale score 0-2 at 90 days after treatment" ) assert inst.handling == "dichotomous" assert inst.id == "example-mRS0-2-at-90days" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "ModifiedRankinScaleScore02At90DaysAfterTreatment" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Modified Rankin Scale score 0-2 at 90 days after treatment" def test_evidencevariable_2(base_settings): """No. 2 tests collection for EvidenceVariable. Test File: evidencevariable-example-mRS0-2-at-90days.json """ filename = ( base_settings["unittest_data_dir"] / "evidencevariable-example-mRS0-2-at-90days.json" ) inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes()) assert "EvidenceVariable" == inst.get_resource_type() impl_evidencevariable_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EvidenceVariable" == data["resourceType"] inst2 = evidencevariable.EvidenceVariable(**data) impl_evidencevariable_2(inst2) def impl_evidencevariable_3(inst): assert inst.actual is True assert inst.characteristic[0].definitionCanonical == ( "http://example.org/fhir/ActivityDefinition/example-" "alteplase-dosing" ) assert inst.characteristic[0].description == ( "IV alteplase 0.9 mg/kg (maximum 90 mg) as 10% of dose over 1" " minute and 90% over 1 hour" ) assert inst.description == "Alteplase for Stroke" assert inst.id == "example-alteplase-for-stroke" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "AlteplaseForStroke" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Alteplase for Stroke" def test_evidencevariable_3(base_settings): """No. 3 tests collection for EvidenceVariable. Test File: evidencevariable-example-alteplase-for-stroke.json """ filename = ( base_settings["unittest_data_dir"] / "evidencevariable-example-alteplase-for-stroke.json" ) inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes()) assert "EvidenceVariable" == inst.get_resource_type() impl_evidencevariable_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EvidenceVariable" == data["resourceType"] inst2 = evidencevariable.EvidenceVariable(**data) impl_evidencevariable_3(inst2) def impl_evidencevariable_4(inst): assert inst.actual is False assert inst.characteristic[0].definitionCodeableConcept.coding[0].code == "8410" assert ( inst.characteristic[0].definitionCodeableConcept.coding[0].display == "alteplase" ) assert ( inst.characteristic[0].definitionCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.characteristic[0].description == "no alteplase" assert inst.characteristic[0].exclude is True assert inst.description == "no alteplase" assert inst.id == "example-no-alteplase" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "NoAlteplase" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "no alteplase" def test_evidencevariable_4(base_settings): """No. 4 tests collection for EvidenceVariable. Test File: evidencevariable-example-no-alteplase.json """ filename = ( base_settings["unittest_data_dir"] / "evidencevariable-example-no-alteplase.json" ) inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes()) assert "EvidenceVariable" == inst.get_resource_type() impl_evidencevariable_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EvidenceVariable" == data["resourceType"] inst2 = evidencevariable.EvidenceVariable(**data) impl_evidencevariable_4(inst2) def impl_evidencevariable_5(inst): assert inst.actual is False assert ( inst.characteristic[0] .definitionByCombination.characteristic[0] .definitionCodeableConcept.coding[0] .code == "718705001" ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[0] .definitionCodeableConcept.coding[0] .display == "Functionally dependent (finding)" ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[0] .definitionCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.characteristic[0].definitionByCombination.characteristic[0].description == "functionally dependent at 90 days" ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[0] .timeFromEvent[0] .eventCodeableConcept.coding[0] .code == "study-start" ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[0] .timeFromEvent[0] .eventCodeableConcept.coding[0] .display == "Study Start" ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[0] .timeFromEvent[0] .eventCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/evidence-variable-event"} ).valueUri ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[0] .timeFromEvent[0] .quantity.code == "d" ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[0] .timeFromEvent[0] .quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[0] .timeFromEvent[0] .quantity.unit == "day" ) assert float( inst.characteristic[0] .definitionByCombination.characteristic[0] .timeFromEvent[0] .quantity.value ) == float(90) assert ( inst.characteristic[0] .definitionByCombination.characteristic[1] .definitionCodeableConcept.coding[0] .code == "419099009" ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[1] .definitionCodeableConcept.coding[0] .display == "Dead (finding)" ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[1] .definitionCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.characteristic[0].definitionByCombination.characteristic[1].description == "dead at 90 days" ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[1] .timeFromEvent[0] .quantity.code == "d" ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[1] .timeFromEvent[0] .quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[1] .timeFromEvent[0] .quantity.unit == "day" ) assert float( inst.characteristic[0] .definitionByCombination.characteristic[1] .timeFromEvent[0] .quantity.value ) == float(90) assert inst.characteristic[0].definitionByCombination.code == "any-of" assert ( inst.characteristic[0].description == "Dead or functionally dependent at 90 days" ) assert inst.description == "Dead or functionally dependent at 90 days" assert inst.handling == "dichotomous" assert inst.id == "example-dead-or-dependent-90day" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "DeadOrFunctionallyDependentAt90Days" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Dead or functionally dependent at 90 days" def test_evidencevariable_5(base_settings): """No. 5 tests collection for EvidenceVariable. Test File: evidencevariable-example-dead-or-dependent-90day.json """ filename = ( base_settings["unittest_data_dir"] / "evidencevariable-example-dead-or-dependent-90day.json" ) inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes()) assert "EvidenceVariable" == inst.get_resource_type() impl_evidencevariable_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EvidenceVariable" == data["resourceType"] inst2 = evidencevariable.EvidenceVariable(**data) impl_evidencevariable_5(inst2) def impl_evidencevariable_6(inst): assert inst.actual is True assert inst.author[0].name == "Brian S. Alper" assert ( inst.characteristic[0].definitionByTypeAndValue.type.coding[0].code == "424144002" ) assert ( inst.characteristic[0].definitionByTypeAndValue.type.coding[0].display == "Current chronological age" ) assert ( inst.characteristic[0].definitionByTypeAndValue.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.characteristic[0].definitionByTypeAndValue.valueQuantity.code == "a" assert ( inst.characteristic[0].definitionByTypeAndValue.valueQuantity.comparator == ">=" ) assert ( inst.characteristic[0].definitionByTypeAndValue.valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[0].definitionByTypeAndValue.valueQuantity.unit == "year" assert float( inst.characteristic[0].definitionByTypeAndValue.valueQuantity.value ) == float(18) assert inst.characteristic[0].description == "adult (age ≥18 years old)" assert inst.characteristic[0].exclude is False assert ( inst.characteristic[1].definitionByTypeAndValue.type.coding[0].code == "39156-5" ) assert ( inst.characteristic[1].definitionByTypeAndValue.type.coding[0].display == "Body mass index (BMI) [Ratio]" ) assert ( inst.characteristic[1].definitionByTypeAndValue.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.characteristic[1].definitionByTypeAndValue.valueQuantity.code == "kg/m2" assert ( inst.characteristic[1].definitionByTypeAndValue.valueQuantity.comparator == ">=" ) assert ( inst.characteristic[1].definitionByTypeAndValue.valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[1].definitionByTypeAndValue.valueQuantity.unit == "kg/m2" assert float( inst.characteristic[1].definitionByTypeAndValue.valueQuantity.value ) == float(30) assert inst.characteristic[1].description == "obese (Body mass index >= 30 kg/m2)" assert inst.characteristic[1].exclude is False assert inst.contact[0].telecom[0].system == "email" assert inst.contact[0].telecom[0].value == "support@computablepublishing.com" assert inst.copyright == "https://creativecommons.org/licenses/by-nc-sa/4.0/" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-07-24T21:00:00.088Z"} ).valueDateTime ) assert inst.description == "obese, adult (age ≥18 years old) patients" assert inst.id == "example-eligibility-criteria-adults-with-obesity" assert inst.identifier[0].assigner.display == "Computable Publishing LLC" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://fevir.net"} ).valueUri ) assert inst.identifier[0].type.text == "FEvIR Object Identifier" assert inst.identifier[0].value == "49218" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "StudyEligibilityCriteriaObesePatients18YearsOld" assert inst.publisher == "Computable Publishing LLC" assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://academic.oup.com/eurheartj/article/43/20/1955/6542137" } ).valueUrl ) assert inst.relatedArtifact[0].label == "data source" assert inst.relatedArtifact[0].type == "derived-from" assert ( inst.relatedArtifact[1].classifier[0].text == "Citation Resource for the original article" ) assert inst.relatedArtifact[1].display == ( "Citation Resource for 2022 Systematic Review of bariatric " "surgery mortality effect - PMID 35243488" ) assert inst.relatedArtifact[1].resourceReference.display == ( "StudyCitation: 2022 Systematic Review of bariatric surgery " "mortality effect 35243488" ) assert inst.relatedArtifact[1].resourceReference.reference == "Citation/33400" assert ( inst.relatedArtifact[1].resourceReference.type == ExternalValidatorModel.model_validate({"valueUri": "Citation"}).valueUri ) assert inst.relatedArtifact[1].type == "supported-with" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "StudyEligibilityCriteria: Obese patients ≥ 18 years old" def test_evidencevariable_6(base_settings): """No. 6 tests collection for EvidenceVariable. Test File: evidencevariable-example-eligibility-criteria-adults-with-obesity.json """ filename = ( base_settings["unittest_data_dir"] / "evidencevariable-example-eligibility-criteria-adults-with-obesity.json" ) inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes()) assert "EvidenceVariable" == inst.get_resource_type() impl_evidencevariable_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EvidenceVariable" == data["resourceType"] inst2 = evidencevariable.EvidenceVariable(**data) impl_evidencevariable_6(inst2) def impl_evidencevariable_7(inst): assert inst.actual is True assert ( inst.characteristic[0] .definitionByCombination.characteristic[0] .definitionReference.display == "ECASS III Trial Cohort" ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[0] .definitionReference.reference == "Group/ECASSIII-Trial-Cohort" ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[0] .definitionReference.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[1] .definitionReference.display == "IST3 Trial Cohort" ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[1] .definitionReference.reference == "Group/IST3-Trial-Cohort" ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[1] .definitionReference.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[2] .definitionReference.display == "ECASS Trial Cohort" ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[2] .definitionReference.reference == "Group/ECASS-Trial-Cohort" ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[2] .definitionReference.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[3] .definitionReference.display == "ECASSII Trial Cohort" ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[3] .definitionReference.reference == "Group/ECASSII-Trial-Cohort" ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[3] .definitionReference.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[4] .definitionReference.display == "EPITHET Trial Cohort" ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[4] .definitionReference.reference == "Group/EPITHET-Trial-Cohort" ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[4] .definitionReference.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[5] .definitionReference.display == "ATLANTIS Trial Cohort" ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[5] .definitionReference.reference == "Group/ATLANTIS-Trial-Cohort" ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[5] .definitionReference.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[6] .definitionReference.display == "NINDS Trial Cohort" ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[6] .definitionReference.reference == "Group/NINDS-Trial-Cohort" ) assert ( inst.characteristic[0] .definitionByCombination.characteristic[6] .definitionReference.type == ExternalValidatorModel.model_validate({"valueUri": "Group"}).valueUri ) assert inst.characteristic[0].definitionByCombination.code == "any-of" assert inst.characteristic[0].description == ( "Stroke Thrombolysis Trialists’ Collaborators Group " "collection used for individual patient data meta-analysis" ) assert inst.description == ( "Stroke Thrombolysis Trialists’ Collaborators Group " "collection used for individual patient data meta-analysis" ) assert inst.id == ( "example-Stroke-Thrombolysis-Trialists-2014-2016-IPD-MA-" "Cohort" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "StrokeThrombolysisTrialists20142016IPDMACohort" assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "https://doi.org/10.1016/S0140-6736(14)60584-5"} ).valueUrl ) assert inst.relatedArtifact[0].label == "Emberson 2014" assert inst.relatedArtifact[0].type == "citation" assert inst.relatedArtifact[1].display == "Figure 2 Lees 2016" assert ( inst.relatedArtifact[1].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "https://doi.org/10.1161/STROKEAHA.116.013644"} ).valueUrl ) assert inst.relatedArtifact[1].label == "Lees 2016" assert inst.relatedArtifact[1].type == "citation" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == ( "Stroke Thrombolysis Trialists’ Collaborators Group " "collection used for individual patient data meta-analysis" ) def test_evidencevariable_7(base_settings): """No. 7 tests collection for EvidenceVariable. Test File: evidencevariable-example-Stroke-Thrombolysis-Trialists-2014-2016-IPD-MA-Cohort.json """ filename = ( base_settings["unittest_data_dir"] / "evidencevariable-example-Stroke-Thrombolysis-Trialists-2014-2016-IPD-MA-Cohort.json" ) inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes()) assert "EvidenceVariable" == inst.get_resource_type() impl_evidencevariable_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EvidenceVariable" == data["resourceType"] inst2 = evidencevariable.EvidenceVariable(**data) impl_evidencevariable_7(inst2) def impl_evidencevariable_8(inst): assert inst.actual is True assert inst.characteristic[0].definitionCodeableConcept.coding[0].code == "1386000" assert ( inst.characteristic[0].definitionCodeableConcept.coding[0].display == "Intracranial hemorrhage (disorder)" ) assert ( inst.characteristic[0].definitionCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.characteristic[0].description == "intracranial hemorrhage within 7 days" assert inst.characteristic[0].timeFromEvent[0].description == "within 7 days" assert ( inst.characteristic[0].timeFromEvent[0].eventCodeableConcept.coding[0].code == "study-start" ) assert ( inst.characteristic[0].timeFromEvent[0].eventCodeableConcept.coding[0].display == "Study Start" ) assert ( inst.characteristic[0].timeFromEvent[0].eventCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/evidence-variable-event"} ).valueUri ) assert inst.characteristic[0].timeFromEvent[0].range.high.code == "d" assert ( inst.characteristic[0].timeFromEvent[0].range.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[0].timeFromEvent[0].range.high.unit == "day" assert float(inst.characteristic[0].timeFromEvent[0].range.high.value) == float(7) assert inst.characteristic[0].timeFromEvent[0].range.low.code == "d" assert ( inst.characteristic[0].timeFromEvent[0].range.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[0].timeFromEvent[0].range.low.unit == "day" assert float(inst.characteristic[0].timeFromEvent[0].range.low.value) == float(0) assert ( inst.characteristic[1].definitionCodeableConcept.coding[0].code == "419620001" ) assert ( inst.characteristic[1].definitionCodeableConcept.coding[0].display == "Death (event)" ) assert ( inst.characteristic[1].definitionCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.characteristic[1].description == "death within 7 days" assert inst.characteristic[1].timeFromEvent[0].description == "within 7 days" assert inst.characteristic[1].timeFromEvent[0].range.high.code == "d" assert ( inst.characteristic[1].timeFromEvent[0].range.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[1].timeFromEvent[0].range.high.unit == "day" assert float(inst.characteristic[1].timeFromEvent[0].range.high.value) == float(7) assert inst.characteristic[1].timeFromEvent[0].range.low.code == "d" assert ( inst.characteristic[1].timeFromEvent[0].range.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[1].timeFromEvent[0].range.low.unit == "day" assert float(inst.characteristic[1].timeFromEvent[0].range.low.value) == float(0) assert inst.description == "Fatal Intracranial Hemorrhage Within Seven Days" assert inst.handling == "dichotomous" assert inst.id == "example-fatal-ICH-in-7-days" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "FatalIntracranialHemorrhageWithinSevenDays" assert inst.note[0].text == "Death must be due to intracranial hemorrhage" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Fatal Intracranial Hemorrhage Within Seven Days" def test_evidencevariable_8(base_settings): """No. 8 tests collection for EvidenceVariable. Test File: evidencevariable-example-fatal-ICH-in-7-days.json """ filename = ( base_settings["unittest_data_dir"] / "evidencevariable-example-fatal-ICH-in-7-days.json" ) inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes()) assert "EvidenceVariable" == inst.get_resource_type() impl_evidencevariable_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EvidenceVariable" == data["resourceType"] inst2 = evidencevariable.EvidenceVariable(**data) impl_evidencevariable_8(inst2) def impl_evidencevariable_9(inst): assert inst.actual is False assert inst.author[0].name == "Brian S. Alper" assert ( inst.characteristic[0].definitionByTypeAndValue.type.coding[0].code == "397669002" ) assert ( inst.characteristic[0].definitionByTypeAndValue.type.coding[0].display == "Age" ) assert ( inst.characteristic[0].definitionByTypeAndValue.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.characteristic[0].definitionByTypeAndValue.valueQuantity.code == "a" assert ( inst.characteristic[0].definitionByTypeAndValue.valueQuantity.comparator == ">=" ) assert ( inst.characteristic[0].definitionByTypeAndValue.valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[0].definitionByTypeAndValue.valueQuantity.unit == "years" assert float( inst.characteristic[0].definitionByTypeAndValue.valueQuantity.value ) == float(18) assert inst.characteristic[0].description == "Adult." assert inst.characteristic[0].exclude is False assert ( inst.characteristic[1].definitionByTypeAndValue.type.coding[0].code == "64572001" ) assert ( inst.characteristic[1].definitionByTypeAndValue.type.coding[0].display == "Disease (disorder)" ) assert ( inst.characteristic[1].definitionByTypeAndValue.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.characteristic[1].definitionByTypeAndValue.type.coding[1].code == "Condition" ) assert ( inst.characteristic[1].definitionByTypeAndValue.type.coding[1].display == "Condition" ) assert ( inst.characteristic[1].definitionByTypeAndValue.type.coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/resource-types"} ).valueUri ) assert ( inst.characteristic[1] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .code == "44054006" ) assert ( inst.characteristic[1] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .display == "Diabetes mellitus type 2 (disorder)" ) assert ( inst.characteristic[1] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.characteristic[1].description == "Diagnosed with type 2 diabetes." assert inst.characteristic[1].exclude is False assert ( inst.characteristic[2] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.type.coding[0] .code == "39156-5" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.type.coding[0] .display == "Body mass index (BMI) [Ratio]" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.type.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueQuantity.code == "kg/m2" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueQuantity.comparator == ">=" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueQuantity.unit == "kg/m2" ) assert float( inst.characteristic[2] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueQuantity.value ) == float(40) assert ( inst.characteristic[2].definitionByCombination.characteristic[0].description == "Body Mass Index (BMI) ≥ 40.0 kg/m2" ) assert ( inst.characteristic[2].definitionByCombination.characteristic[0].exclude is False ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[1] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.type.coding[0] .code == "39156-5" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[1] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.type.coding[0] .display == "Body mass index (BMI) [Ratio]" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[1] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.type.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[1] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueQuantity.code == "kg/m2" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[1] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueQuantity.comparator == ">=" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[1] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[1] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueQuantity.unit == "kg/m2" ) assert float( inst.characteristic[2] .definitionByCombination.characteristic[1] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueQuantity.value ) == float(37.5) assert ( inst.characteristic[2] .definitionByCombination.characteristic[1] .definitionByCombination.characteristic[0] .description == "BMI ≥ 37.5 kg/m2" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[1] .definitionByCombination.characteristic[0] .exclude is False ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[1] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.type.coding[0] .code == "103579009" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[1] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.type.coding[0] .display == "Race (observable entity)" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[1] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.type.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[1] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .code == "2028-9" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[1] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .display == "Asian" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[1] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.6.238"} ).valueUri ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[1] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.valueCodeableConcept.text == "Asian American" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[1] .definitionByCombination.characteristic[1] .description == "Asian American" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[1] .definitionByCombination.characteristic[1] .linkId == "AsianAmerican" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[1] .definitionByCombination.code == "all-of" ) assert ( inst.characteristic[2].definitionByCombination.characteristic[1].description == "BMI ≥ 37.5 kg/m2 in Asian Americans" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[2] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.type.coding[0] .code == "39156-5" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[2] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.type.coding[0] .display == "Body mass index (BMI) [Ratio]" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[2] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.type.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[2] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueRange.high.code == "kg/m2" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[2] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[2] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueRange.high.unit == "kg/m2" ) assert float( inst.characteristic[2] .definitionByCombination.characteristic[2] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueRange.high.value ) == float(39.9) assert ( inst.characteristic[2] .definitionByCombination.characteristic[2] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueRange.low.code == "kg/m2" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[2] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[2] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueRange.low.unit == "kg/m2" ) assert float( inst.characteristic[2] .definitionByCombination.characteristic[2] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueRange.low.value ) == float(35) assert ( inst.characteristic[2] .definitionByCombination.characteristic[2] .definitionByCombination.characteristic[0] .description == "BMI ≥ 35.0 kg/m2 and ≤ 39.9 kg/m2" ) assert inst.characteristic[2].definitionByCombination.characteristic[ 2 ].definitionByCombination.characteristic[1].definitionCodeableConcept.text == ( "achieving durable weight loss and improvement in " "comorbidities (including hyperglycemia) with nonsurgical " "methods" ) assert inst.characteristic[2].definitionByCombination.characteristic[ 2 ].definitionByCombination.characteristic[1].description == ( "who do not achieve durable weight loss and improvement in " "comorbidities (including hyperglycemia) with nonsurgical " "methods." ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[2] .definitionByCombination.characteristic[1] .exclude is True ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[2] .definitionByCombination.code == "all-of" ) assert inst.characteristic[2].definitionByCombination.characteristic[ 2 ].description == ( "BMI ≥ 35.0 kg/m2 and ≤ 39.9 kg/m2 who do not achieve durable" " weight loss and improvement in comorbidities (including " "hyperglycemia) with nonsurgical methods." ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[3] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.type.coding[0] .code == "39156-5" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[3] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.type.coding[0] .display == "Body mass index (BMI) [Ratio]" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[3] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.type.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[3] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueRange.high.code == "kg/m2" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[3] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[3] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueRange.high.unit == "kg/m2" ) assert float( inst.characteristic[2] .definitionByCombination.characteristic[3] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueRange.high.value ) == float(37.4) assert ( inst.characteristic[2] .definitionByCombination.characteristic[3] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueRange.low.code == "kg/m2" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[3] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[3] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueRange.low.unit == "kg/m2" ) assert float( inst.characteristic[2] .definitionByCombination.characteristic[3] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueRange.low.value ) == float(32.5) assert ( inst.characteristic[2] .definitionByCombination.characteristic[3] .definitionByCombination.characteristic[0] .description == "BMI ≥ 32.5 kg/m2 and ≤ 37.4 kg/m2" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[3] .definitionByCombination.characteristic[1] .definitionId == "AsianAmerican" ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[3] .definitionByCombination.characteristic[1] .description == "Asian American" ) assert inst.characteristic[2].definitionByCombination.characteristic[ 3 ].definitionByCombination.characteristic[2].definitionCodeableConcept.text == ( "achieving durable weight loss and improvement in " "comorbidities (including hyperglycemia) with nonsurgical " "methods" ) assert inst.characteristic[2].definitionByCombination.characteristic[ 3 ].definitionByCombination.characteristic[2].description == ( "who do not achieve durable weight loss and improvement in " "comorbidities (including hyperglycemia) with nonsurgical " "methods." ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[3] .definitionByCombination.characteristic[2] .exclude is True ) assert ( inst.characteristic[2] .definitionByCombination.characteristic[3] .definitionByCombination.code == "all-of" ) assert inst.characteristic[2].definitionByCombination.characteristic[ 3 ].description == ( "BMI ≥ 32.5 kg/m2 and ≤ 37.4 kg/m2 in Asian Americans who do " "not achieve durable weight loss and improvement in " "comorbidities (including hyperglycemia) with nonsurgical " "methods." ) assert inst.characteristic[2].definitionByCombination.code == "any-of" assert ( inst.characteristic[3] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.type.coding[0] .code == "64572001" ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.type.coding[0] .display == "Disease (disorder)" ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.type.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.type.coding[1] .code == "Condition" ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.type.coding[1] .display == "Condition" ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.type.coding[1] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/resource-types"} ).valueUri ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueReference.display == "Acute Coronary Heart Disease Value Set" ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueReference.reference == "ValueSet/32152" ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueReference.type == ExternalValidatorModel.model_validate({"valueUri": "ValueSet"}).valueUri ) assert inst.characteristic[3].definitionByCombination.characteristic[ 0 ].description == ( "acute coronary heart disease (a value set covering many " "forms)" ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.type.coding[0] .code == "71388002" ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.type.coding[0] .display == "Procedure (procedure)" ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.type.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.type.coding[1] .code == "Procedure" ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.type.coding[1] .display == "Procedure" ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.type.coding[1] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/resource-types"} ).valueUri ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .code == "81266008" ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .display == "Heart revascularization (procedure)" ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.characteristic[3].definitionByCombination.characteristic[1].description == "coronary artery angioplasty or bypass" ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[2] .definitionByTypeAndValue.type.coding[0] .code == "64572001" ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[2] .definitionByTypeAndValue.type.coding[0] .display == "Disease (disorder)" ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[2] .definitionByTypeAndValue.type.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[2] .definitionByTypeAndValue.type.coding[1] .code == "Condition" ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[2] .definitionByTypeAndValue.type.coding[1] .display == "Condition" ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[2] .definitionByTypeAndValue.type.coding[1] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/resource-types"} ).valueUri ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[2] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .code == "230690007" ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[2] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .display == "Cerebrovascular accident (disorder)" ) assert ( inst.characteristic[3] .definitionByCombination.characteristic[2] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.characteristic[3].definitionByCombination.characteristic[2].description == "stroke" ) assert inst.characteristic[3].definitionByCombination.code == "any-of" assert inst.characteristic[3].description == ( "Cardiovascular event (myocardial infarction, acute coronary " "syndrome, coronary artery angioplasty or bypass, stroke) in " "the past six months." ) assert inst.characteristic[3].exclude is True assert inst.characteristic[3].note[0].text == ( "placeholder for now to represent 'screened surgical " "candidate'" ) assert ( inst.characteristic[3].timeFromEvent[0].description == "in the past six months" ) assert inst.characteristic[3].timeFromEvent[0].note[0].text == ( "occurrence within the range is equivalent to 'in the past " "six months'" ) assert inst.characteristic[3].timeFromEvent[0].range.high.code == "mo" assert ( inst.characteristic[3].timeFromEvent[0].range.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[3].timeFromEvent[0].range.high.unit == "months" assert float(inst.characteristic[3].timeFromEvent[0].range.high.value) == float(0) assert inst.characteristic[3].timeFromEvent[0].range.low.code == "mo" assert ( inst.characteristic[3].timeFromEvent[0].range.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[3].timeFromEvent[0].range.low.unit == "months" assert float(inst.characteristic[3].timeFromEvent[0].range.low.value) == float(-6) assert inst.characteristic[4].definitionCodeableConcept.text == ( "Current evidence of congestive heart failure, angina " "pectoris, or symptomatic peripheral vascular disease." ) assert inst.characteristic[4].description == ( "Current evidence of congestive heart failure, angina " "pectoris, or symptomatic peripheral vascular disease." ) assert inst.characteristic[4].exclude is True assert inst.characteristic[4].note[0].text == ( "This may be possible to encode as presence of " "Disease(disorder) without 'in remission'" ) assert inst.characteristic[4].note[1].text == ( "placeholder for now to represent 'screened surgical " "candidate'" ) assert inst.characteristic[5].definitionCodeableConcept.text == ( "Cardiac stress test indicating that surgery or IMM would not" " be safe." ) assert inst.characteristic[5].description == ( "Cardiac stress test indicating that surgery or IMM would not" " be safe." ) assert inst.characteristic[5].exclude is True assert inst.characteristic[5].note[0].text == ( "placeholder for now to represent 'screened surgical " "candidate'" ) assert ( inst.characteristic[6].definitionByTypeAndValue.type.coding[0].code == "64572001" ) assert ( inst.characteristic[6].definitionByTypeAndValue.type.coding[0].display == "Disease (disorder)" ) assert ( inst.characteristic[6].definitionByTypeAndValue.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.characteristic[6].definitionByTypeAndValue.type.coding[1].code == "Condition" ) assert ( inst.characteristic[6].definitionByTypeAndValue.type.coding[1].display == "Condition" ) assert ( inst.characteristic[6].definitionByTypeAndValue.type.coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/resource-types"} ).valueUri ) assert ( inst.characteristic[6] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .code == "59282003" ) assert ( inst.characteristic[6] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .display == "Pulmonary embolism (disorder)" ) assert ( inst.characteristic[6] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.characteristic[6].description == "Pulmonary embolus in the past six months." ) assert inst.characteristic[6].exclude is True assert inst.characteristic[6].note[0].text == ( "placeholder for now to represent 'screened surgical " "candidate'" ) assert ( inst.characteristic[6].timeFromEvent[0].description == "in the past six months" ) assert inst.characteristic[6].timeFromEvent[0].note[0].text == ( "occurrence within the range is equivalent to 'in the past " "six months'" ) assert inst.characteristic[6].timeFromEvent[0].range.high.code == "mo" assert ( inst.characteristic[6].timeFromEvent[0].range.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[6].timeFromEvent[0].range.high.unit == "months" assert float(inst.characteristic[6].timeFromEvent[0].range.high.value) == float(0) assert inst.characteristic[6].timeFromEvent[0].range.low.code == "mo" assert ( inst.characteristic[6].timeFromEvent[0].range.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[6].timeFromEvent[0].range.low.unit == "months" assert float(inst.characteristic[6].timeFromEvent[0].range.low.value) == float(-6) assert ( inst.characteristic[7].definitionByTypeAndValue.type.coding[0].code == "64572001" ) assert ( inst.characteristic[7].definitionByTypeAndValue.type.coding[0].display == "Disease (disorder)" ) assert ( inst.characteristic[7].definitionByTypeAndValue.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.characteristic[7].definitionByTypeAndValue.type.coding[1].code == "Condition" ) assert ( inst.characteristic[7].definitionByTypeAndValue.type.coding[1].display == "Condition" ) assert ( inst.characteristic[7].definitionByTypeAndValue.type.coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/resource-types"} ).valueUri ) assert ( inst.characteristic[7] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .code == "64156001" ) assert ( inst.characteristic[7] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .display == "Thrombophlebitis (disorder)" ) assert ( inst.characteristic[7] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.characteristic[7].description == "Thrombophlebitis in the past six months." ) assert inst.characteristic[7].exclude is True assert inst.characteristic[7].note[0].text == ( "placeholder for now to represent 'screened surgical " "candidate'" ) assert ( inst.characteristic[7].timeFromEvent[0].description == "in the past six months" ) assert inst.characteristic[7].timeFromEvent[0].note[0].text == ( "occurrence within the range is equivalent to 'in the past " "six months'" ) assert inst.characteristic[7].timeFromEvent[0].range.high.code == "mo" assert ( inst.characteristic[7].timeFromEvent[0].range.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[7].timeFromEvent[0].range.high.unit == "months" assert float(inst.characteristic[7].timeFromEvent[0].range.high.value) == float(0) assert inst.characteristic[7].timeFromEvent[0].range.low.code == "mo" assert ( inst.characteristic[7].timeFromEvent[0].range.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[7].timeFromEvent[0].range.low.unit == "months" assert float(inst.characteristic[7].timeFromEvent[0].range.low.value) == float(-6) assert ( inst.characteristic[8] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.type.coding[0] .code == "64572001" ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.type.coding[0] .display == "Disease (disorder)" ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.type.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.type.coding[1] .code == "Condition" ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.type.coding[1] .display == "Condition" ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.type.coding[1] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/resource-types"} ).valueUri ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .code == "363346000" ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .display == "Malignant neoplastic disease (disorder)" ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[0] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.characteristic[8].definitionByCombination.characteristic[0].description == "Cancer of any kind" ) assert ( inst.characteristic[8].definitionByCombination.characteristic[0].exclude is False ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.type.coding[0] .code == "64572001" ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.type.coding[0] .display == "Disease (disorder)" ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.type.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.type.coding[1] .code == "Condition" ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.type.coding[1] .display == "Condition" ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.type.coding[1] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/resource-types"} ).valueUri ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .code == "254701007" ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .display == "Basal cell carcinoma of skin (disorder)" ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[1] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.characteristic[8].definitionByCombination.characteristic[1].description == "(except basal cell skin cancer)" ) assert ( inst.characteristic[8].definitionByCombination.characteristic[1].exclude is True ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[2] .definitionByTypeAndValue.type.coding[0] .code == "64572001" ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[2] .definitionByTypeAndValue.type.coding[0] .display == "Disease (disorder)" ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[2] .definitionByTypeAndValue.type.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[2] .definitionByTypeAndValue.type.coding[1] .code == "Condition" ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[2] .definitionByTypeAndValue.type.coding[1] .display == "Condition" ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[2] .definitionByTypeAndValue.type.coding[1] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/resource-types"} ).valueUri ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[2] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .code == "109355002" ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[2] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .display == "Carcinoma in situ (disorder)" ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[2] .definitionByTypeAndValue.valueCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.characteristic[8].definitionByCombination.characteristic[2].description == "(except cancer in situ)" ) assert ( inst.characteristic[8].definitionByCombination.characteristic[2].exclude is True ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[3] .definitionCodeableConcept.coding[0] .code == "395100000" ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[3] .definitionCodeableConcept.coding[0] .display == "No evidence of cancer found (situation)" ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[3] .definitionCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.characteristic[8].definitionByCombination.characteristic[3].description == "unless documented to be disease-free for five years" ) assert ( inst.characteristic[8].definitionByCombination.characteristic[3].exclude is True ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[3] .timeFromEvent[0] .description == "for five years" ) assert inst.characteristic[8].definitionByCombination.characteristic[ 3 ].timeFromEvent[0].note[0].text == ( "presence throughout the range is equivalent to 'for five " "years'" ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[3] .timeFromEvent[0] .range.high.code == "a" ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[3] .timeFromEvent[0] .range.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[3] .timeFromEvent[0] .range.high.unit == "years" ) assert float( inst.characteristic[8] .definitionByCombination.characteristic[3] .timeFromEvent[0] .range.high.value ) == float(0) assert ( inst.characteristic[8] .definitionByCombination.characteristic[3] .timeFromEvent[0] .range.low.code == "a" ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[3] .timeFromEvent[0] .range.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert ( inst.characteristic[8] .definitionByCombination.characteristic[3] .timeFromEvent[0] .range.low.unit == "years" ) assert float( inst.characteristic[8] .definitionByCombination.characteristic[3] .timeFromEvent[0] .range.low.value ) == float(-5) assert inst.characteristic[8].definitionByCombination.code == "all-of" assert inst.characteristic[8].description == ( "Cancer of any kind (except basal cell skin cancer or cancer " "in situ) unless documented to be disease-free for five " "years." ) assert inst.characteristic[8].exclude is True assert inst.characteristic[8].note[0].text == ( "This combination logic fails if the patient has both a basal" " cell skin cancer or cancer in situ and a cancer of another " "kind." ) assert inst.characteristic[8].note[1].text == ( "placeholder for now to represent 'screened surgical " "candidate'" ) assert ( inst.characteristic[9].definitionCodeableConcept.text == "history of coagulopathy" ) assert inst.characteristic[9].description == "History of coagulopathy" assert inst.characteristic[9].exclude is True assert inst.characteristic[9].note[0].text == ( "placeholder for now to represent 'screened surgical " "candidate'" ) assert inst.contact[0].telecom[0].system == "email" assert inst.contact[0].telecom[0].value == "support@computablepublishing.com" assert inst.copyright == "https://creativecommons.org/licenses/by-nc-sa/4.0/" assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01"} ).valueDateTime ) assert inst.id == "example-eligibility-criteria-ada-rec-bariatric" assert inst.identifier[0].assigner.display == "Computable Publishing LLC" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://fevir.net"} ).valueUri ) assert inst.identifier[0].type.text == "FEvIR Object Identifier" assert inst.identifier[0].value == "32140" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == ( "RecommendationEligibilityCriteriaEligibilityCriteriaForBaria" "tricSurgeryADARecommendation816" ) assert inst.publisher == "Computable Publishing LLC" assert inst.shortTitle == "Recommend bariatric surgery if BMI 35 or higher" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == ( "RecommendationEligibilityCriteria: Eligibility Criteria for " "Bariatric Surgery (ADA Recommendation 8.16)" ) def test_evidencevariable_9(base_settings): """No. 9 tests collection for EvidenceVariable. Test File: evidencevariable-example-eligibility-criteria-ada-rec-bariatric.json """ filename = ( base_settings["unittest_data_dir"] / "evidencevariable-example-eligibility-criteria-ada-rec-bariatric.json" ) inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes()) assert "EvidenceVariable" == inst.get_resource_type() impl_evidencevariable_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EvidenceVariable" == data["resourceType"] inst2 = evidencevariable.EvidenceVariable(**data) impl_evidencevariable_9(inst2) def impl_evidencevariable_10(inst): assert inst.actual is False assert ( inst.characteristic[0].definitionCodeableConcept.coding[0].code == "718705001" ) assert ( inst.characteristic[0].definitionCodeableConcept.coding[0].display == "Functionally dependent (finding)" ) assert ( inst.characteristic[0].definitionCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.characteristic[0].description == "not functionally dependent at 90 days" assert inst.characteristic[0].exclude is True assert ( inst.characteristic[0].timeFromEvent[0].eventCodeableConcept.coding[0].code == "study-start" ) assert ( inst.characteristic[0].timeFromEvent[0].eventCodeableConcept.coding[0].display == "Study Start" ) assert ( inst.characteristic[0].timeFromEvent[0].eventCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/evidence-variable-event"} ).valueUri ) assert inst.characteristic[0].timeFromEvent[0].quantity.code == "d" assert ( inst.characteristic[0].timeFromEvent[0].quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[0].timeFromEvent[0].quantity.unit == "day" assert float(inst.characteristic[0].timeFromEvent[0].quantity.value) == float(90) assert ( inst.characteristic[1].definitionCodeableConcept.coding[0].code == "419099009" ) assert ( inst.characteristic[1].definitionCodeableConcept.coding[0].display == "Dead (finding)" ) assert ( inst.characteristic[1].definitionCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.characteristic[1].description == "alive at 90 days" assert inst.characteristic[1].exclude is True assert ( inst.characteristic[1].timeFromEvent[0].eventCodeableConcept.coding[0].code == "study-start" ) assert ( inst.characteristic[1].timeFromEvent[0].eventCodeableConcept.coding[0].display == "Study Start" ) assert ( inst.characteristic[1].timeFromEvent[0].eventCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/evidence-variable-event"} ).valueUri ) assert inst.characteristic[1].timeFromEvent[0].quantity.code == "d" assert ( inst.characteristic[1].timeFromEvent[0].quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.characteristic[1].timeFromEvent[0].quantity.unit == "day" assert float(inst.characteristic[1].timeFromEvent[0].quantity.value) == float(90) assert inst.description == "Alive and not functionally dependent at 90 days" assert inst.handling == "dichotomous" assert inst.id == "example-alive-independent-90day" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "AliveAndNotFunctionallyDependentAt90Days" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Alive and not functionally dependent at 90 days" def test_evidencevariable_10(base_settings): """No. 10 tests collection for EvidenceVariable. Test File: evidencevariable-example-alive-independent-90day.json """ filename = ( base_settings["unittest_data_dir"] / "evidencevariable-example-alive-independent-90day.json" ) inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes()) assert "EvidenceVariable" == inst.get_resource_type() impl_evidencevariable_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "EvidenceVariable" == data["resourceType"] inst2 = evidencevariable.EvidenceVariable(**data) impl_evidencevariable_10(inst2) ================================================ FILE: fhir/resources/tests/test_examplescenario.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ExampleScenario Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import examplescenario from .conftest import ExternalValidatorModel def impl_examplescenario_1(inst): assert inst.actor[0].description == "The Nurse" assert inst.actor[0].key == "Nurse" assert inst.actor[0].title == "Nurse" assert inst.actor[0].type == "person" assert inst.actor[1].description == ( "The entity that receives the Administration Requests to show" " the nurse to perform them" ) assert inst.actor[1].key == "MAP" assert inst.actor[1].title == "Nurse's Tablet" assert inst.actor[1].type == "system" assert inst.actor[2].description == "The Medication Administration Order Placer" assert inst.actor[2].key == "OP" assert inst.actor[2].title == "MAR / Scheduler" assert inst.actor[2].type == "system" assert inst.actor[3].description == ( "The entity that receives the Medication Administration " "reports" ) assert inst.actor[3].key == "MAC" assert inst.actor[3].title == "MAR / EHR" assert inst.actor[3].type == "system" assert inst.id == "example" assert inst.instance[0].description == ( 'The initial prescription which describes "medication X, 3 ' 'times per day" - the exact scheduling is not in the ' "initial prescription (it is left for the care teams to " "decide on the schedule)." ) assert inst.instance[0].key == "iherx001" assert inst.instance[0].structureType.code == "MedicationRequest" assert ( inst.instance[0].structureType.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/fhir-types"} ).valueUri ) assert inst.instance[0].title == "Initial Prescription" assert ( inst.instance[1].description == "The administration request for day 1, morning" ) assert inst.instance[1].key == "iherx001.001" assert inst.instance[1].structureType.code == "MedicationRequest" assert ( inst.instance[1].structureType.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/fhir-types"} ).valueUri ) assert inst.instance[1].title == "Request for day 1, morning" assert inst.instance[2].description == "The administration request for day 1, lunch" assert inst.instance[2].key == "iherx001.002" assert inst.instance[2].structureType.code == "MedicationRequest" assert ( inst.instance[2].structureType.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/fhir-types"} ).valueUri ) assert inst.instance[2].title == "Request for day 1, lunch" assert ( inst.instance[3].description == "The administration request for day 1, evening" ) assert inst.instance[3].key == "iherx001.003" assert inst.instance[3].structureType.code == "MedicationRequest" assert ( inst.instance[3].structureType.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/fhir-types"} ).valueUri ) assert inst.instance[3].title == "Request for day 1, evening" assert ( inst.instance[4].description == "The administration request for day 2, morning" ) assert inst.instance[4].key == "iherx001.004" assert inst.instance[4].structureType.code == "MedicationRequest" assert ( inst.instance[4].structureType.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/fhir-types"} ).valueUri ) assert inst.instance[4].title == "Request for day 2, morning" assert inst.instance[5].description == "The administration request for day 2, lunch" assert inst.instance[5].key == "iherx001.005" assert inst.instance[5].structureType.code == "MedicationRequest" assert ( inst.instance[5].structureType.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/fhir-types"} ).valueUri ) assert inst.instance[5].title == "Request for day 2, lunch" assert ( inst.instance[6].description == "The administration request for day 2, evening" ) assert inst.instance[6].key == "iherx001.006" assert inst.instance[6].structureType.code == "MedicationRequest" assert ( inst.instance[6].structureType.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/fhir-types"} ).valueUri ) assert inst.instance[6].title == "Request for day 2, evening" assert ( inst.instance[7].description == "Administration report for day 1, morning: Taken" ) assert inst.instance[7].key == "iheadm001a" assert inst.instance[7].structureType.code == "MedicationAdministration" assert ( inst.instance[7].structureType.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/fhir-types"} ).valueUri ) assert inst.instance[7].title == "Morning meds - taken" assert ( inst.instance[8].description == "Administration report for day 1, morning: NOT Taken" ) assert inst.instance[8].key == "iheadm001b" assert inst.instance[8].structureType.code == "MedicationAdministration" assert ( inst.instance[8].structureType.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/fhir-types"} ).valueUri ) assert inst.instance[8].title == "Morning meds - not taken" assert inst.instance[9].containedInstance[0].instanceReference == "iherx001.001" assert inst.instance[9].containedInstance[1].instanceReference == "iherx001.002" assert inst.instance[9].containedInstance[2].instanceReference == "iherx001.003" assert inst.instance[9].containedInstance[3].instanceReference == "iherx001.004" assert inst.instance[9].containedInstance[4].instanceReference == "iherx001.005" assert inst.instance[9].containedInstance[5].instanceReference == "iherx001.006" assert inst.instance[9].description == "All the medication Requests for Day 1" assert inst.instance[9].key == "iherx001bundle" assert inst.instance[9].structureType.code == "MedicationRequest" assert ( inst.instance[9].structureType.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/fhir-types"} ).valueUri ) assert inst.instance[9].title == "Bundle of Medication Requests" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.process[0].postConditions == ( "Medication administration Reports are submitted, EHR is " "updated." ) assert inst.process[0].preConditions == ( "Medication administration requests are in the EHR / MAR, " "scheduled for each individual intake." ) assert inst.process[0].step[0].number == "1" assert inst.process[0].step[0].operation.initiator == "Nurse" assert inst.process[0].step[0].operation.receiver == "MAP" assert inst.process[0].step[0].operation.title == "Get today's schedule" assert inst.process[0].step[1].number == "2" assert inst.process[0].step[1].operation.description == ( "Query for medication administration orders,\\n- For today's " "shifts\\n- For today's patients" ) assert inst.process[0].step[1].operation.initiator == "MAP" assert inst.process[0].step[1].operation.receiver == "OP" assert inst.process[0].step[1].operation.request.instanceReference == "iherxqry" assert ( inst.process[0].step[1].operation.response.instanceReference == "iherx001bundle" ) assert inst.process[0].step[1].operation.title == "Query administration orders" assert inst.process[0].step[1].pause is True assert inst.process[0].step[2].number == "3" assert inst.process[0].step[2].operation.initiator == "MAP" assert inst.process[0].step[2].operation.receiver == "Nurse" assert inst.process[0].step[2].operation.title == "Notify (alert)" assert inst.process[0].step[3].number == "4" assert inst.process[0].step[3].operation.initiator == "Nurse" assert inst.process[0].step[3].operation.receiver == "MAP" assert inst.process[0].step[3].operation.title == "Read orders" assert inst.process[0].step[3].pause is True assert inst.process[0].step[4].number == "5" assert inst.process[0].step[4].operation.initiator == "Nurse" assert inst.process[0].step[4].operation.receiver == "Nurse" assert inst.process[0].step[4].operation.title == "Ask if patient took meds" assert ( inst.process[0].step[5].alternative[0].description == "Invoke if patient took medications" ) assert inst.process[0].step[5].alternative[0].step[0].number == "6a" assert inst.process[0].step[5].alternative[0].step[0].operation.initiator == "Nurse" assert ( inst.process[0].step[5].alternative[0].step[0].operation.initiatorActive is True ) assert inst.process[0].step[5].alternative[0].step[0].operation.receiver == "MAP" assert ( inst.process[0].step[5].alternative[0].step[0].operation.title == "Register meds taken" ) assert inst.process[0].step[5].alternative[0].title == "Patient took meds" assert ( inst.process[0].step[5].alternative[1].description == "No, patient did not take meds" ) assert inst.process[0].step[5].alternative[1].step[0].number == "6b" assert inst.process[0].step[5].alternative[1].step[0].operation.initiator == "Nurse" assert ( inst.process[0].step[5].alternative[1].step[0].operation.initiatorActive is True ) assert inst.process[0].step[5].alternative[1].step[0].operation.receiver == "MAP" assert ( inst.process[0].step[5].alternative[1].step[0].operation.title == "Register meds NOT taken" ) assert inst.process[0].step[5].alternative[1].title == "No drugs" assert ( inst.process[0].step[5].alternative[2].description == "Unknown whether patient took medications or not" ) assert inst.process[0].step[5].alternative[2].title == "Not clear" assert inst.process[0].step[5].pause is True assert inst.process[0].step[6].number == "7" assert inst.process[0].step[6].operation.initiator == "Nurse" assert inst.process[0].step[6].operation.receiver == "Nurse" assert inst.process[0].step[6].operation.title == "Administer drug" assert inst.process[0].step[7].number == "8" assert inst.process[0].step[7].operation.initiator == "Nurse" assert inst.process[0].step[7].operation.initiatorActive is True assert inst.process[0].step[7].operation.receiver == "MAP" assert inst.process[0].step[7].operation.title == "Record administration" assert inst.process[0].step[7].pause is True assert inst.process[0].step[8].number == "9" assert inst.process[0].step[8].operation.initiator == "Nurse" assert inst.process[0].step[8].operation.initiatorActive is True assert inst.process[0].step[8].operation.receiver == "MAP" assert inst.process[0].step[8].operation.request.instanceReference == "iheadm002" assert inst.process[0].step[8].operation.request.versionReference == "iheadm002v1" assert inst.process[0].step[8].operation.title == "Upload administration reports" assert inst.process[0].step[8].pause is True assert inst.process[0].step[9].number == "10" assert inst.process[0].step[9].operation.description == ( "The nurse's system uploads the administration results to the" " server" ) assert inst.process[0].step[9].operation.initiator == "MAP" assert inst.process[0].step[9].operation.receiver == "MAC" assert inst.process[0].step[9].operation.request.instanceReference == "iheadm001a" assert inst.process[0].step[9].operation.title == "Upload administration reports" assert inst.process[0].title == "Mobile Medication Administration" assert inst.status == "draft" assert inst.text.status == "additional" def test_examplescenario_1(base_settings): """No. 1 tests collection for ExampleScenario. Test File: examplescenario-example.json """ filename = base_settings["unittest_data_dir"] / "examplescenario-example.json" inst = examplescenario.ExampleScenario.model_validate_json(filename.read_bytes()) assert "ExampleScenario" == inst.get_resource_type() impl_examplescenario_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ExampleScenario" == data["resourceType"] inst2 = examplescenario.ExampleScenario(**data) impl_examplescenario_1(inst2) def impl_examplescenario_2(inst): assert inst.actor[0].description == "Clinician" assert inst.actor[0].key == "Clin" assert inst.actor[0].title == "Clinician" assert inst.actor[0].type == "person" assert inst.actor[1].description == "CPOE" assert inst.actor[1].key == "CPOE" assert inst.actor[1].title == "CPOE" assert inst.actor[1].type == "system" assert inst.actor[2].description == "EMR" assert inst.actor[2].key == "EMR" assert inst.actor[2].title == "EMR" assert inst.actor[2].type == "system" assert inst.actor[3].description == "Lab Person" assert inst.actor[3].key == "LabMan" assert inst.actor[3].title == "Lab Man" assert inst.actor[3].type == "person" assert inst.actor[4].description == "Lab" assert inst.actor[4].key == "Lab" assert inst.actor[4].title == "Lab" assert inst.actor[4].type == "system" assert inst.description == ( "In this example, the clinician creates an order in the CPOE." " Then a Task is created and updated by both the CPOE and the" " Lab system..." ) assert inst.id == "example-laborder" assert inst.instance[0].description == "Bla" assert inst.instance[0].key == "req1" assert inst.instance[0].structureType.code == "ServiceRequest" assert ( inst.instance[0].structureType.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/fhir-types"} ).valueUri ) assert inst.instance[0].title == "Request for a lab procedure" assert inst.instance[0].version[0].description == "Initial order" assert inst.instance[0].version[0].key == "req1-v1" assert inst.instance[0].version[0].title == "v1- initial" assert inst.instance[0].version[1].description == "Order in progress" assert inst.instance[0].version[1].key == "req1-v2" assert inst.instance[0].version[1].title == "v2 - in progress" assert inst.instance[0].version[2].description == "Order completed" assert inst.instance[0].version[2].key == "req1-v3" assert inst.instance[0].version[2].title == "v3 - completed" assert inst.instance[1].description == "The task that handles the status updates..." assert inst.instance[1].key == "task1" assert inst.instance[1].structureType.code == "Task" assert ( inst.instance[1].structureType.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/fhir-types"} ).valueUri ) assert inst.instance[1].title == "Task" assert inst.instance[1].version[0].description == "Initially created" assert inst.instance[1].version[0].key == "task1-v1" assert inst.instance[1].version[0].title == "v1 - created" assert inst.instance[1].version[1].description == "Accepted" assert inst.instance[1].version[1].key == "task1-v2" assert inst.instance[1].version[1].title == "v2 - accepted" assert inst.instance[1].version[2].description == "In progress" assert inst.instance[1].version[2].key == "task1-v3" assert inst.instance[1].version[2].title == "v3 - in progress" assert inst.instance[1].version[3].description == "Completed" assert inst.instance[1].version[3].key == "task1-v4" assert inst.instance[1].version[3].title == "v4 - completed" assert inst.instance[2].description == "Lab's internal request for the procedure" assert inst.instance[2].key == "req.lab1" assert inst.instance[2].structureType.code == "ServiceRequest" assert ( inst.instance[2].structureType.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/fhir-types"} ).valueUri ) assert inst.instance[2].title == "Internal lab request" assert inst.instance[2].version[0].description == "Order in progress" assert inst.instance[2].version[0].key == "req.lab1-v1" assert inst.instance[2].version[0].title == "v1 - created" assert inst.instance[2].version[1].description == "Order in progress" assert inst.instance[2].version[1].key == "req.lab1-v2" assert inst.instance[2].version[1].title == "v2 - in progress" assert inst.instance[2].version[2].description == "Order completed" assert inst.instance[2].version[2].key == "req.lab1-v3" assert inst.instance[2].version[2].title == "v3 - completed" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "LabOrderTrackingWithTask" assert inst.process[0].description == ( "Lab order, status updates handled with Task between CPOE, " "EMR and Lab systems" ) assert inst.process[0].step[0].number == "1" assert inst.process[0].step[0].pause is True assert inst.process[0].step[0].process.description == "New lab order" assert inst.process[0].step[0].process.step[0].number == "1.1" assert inst.process[0].step[0].process.step[0].operation.initiator == "Clin" assert inst.process[0].step[0].process.step[0].operation.receiver == "LabMan" assert inst.process[0].step[0].process.step[0].operation.title == "Make a call" assert inst.process[0].step[0].process.step[1].number == "1.2" assert inst.process[0].step[0].process.step[1].operation.initiator == "Clin" assert inst.process[0].step[0].process.step[1].operation.receiver == "CPOE" assert ( inst.process[0].step[0].process.step[1].operation.title == "Create new EMR order" ) assert inst.process[0].step[0].process.step[2].number == "1.3" assert inst.process[0].step[0].process.step[2].operation.initiator == "CPOE" assert inst.process[0].step[0].process.step[2].operation.receiver == "EMR" assert ( inst.process[0].step[0].process.step[2].operation.request.instanceReference == "req1" ) assert ( inst.process[0].step[0].process.step[2].operation.request.versionReference == "req1-v1" ) assert ( inst.process[0].step[0].process.step[2].operation.title == "Submit order to EMR" ) assert inst.process[0].step[0].process.step[3].number == "1.3" assert inst.process[0].step[0].process.step[3].operation.initiator == "EMR" assert inst.process[0].step[0].process.step[3].operation.receiver == "EMR" assert ( inst.process[0].step[0].process.step[3].operation.request.instanceReference == "task1" ) assert ( inst.process[0].step[0].process.step[3].operation.request.versionReference == "task1-v1" ) assert inst.process[0].step[0].process.step[3].operation.title == "Create new task " assert inst.process[0].step[0].process.step[4].number == "1.4" assert inst.process[0].step[0].process.step[4].operation.initiator == "EMR" assert inst.process[0].step[0].process.step[4].operation.receiver == "Lab" assert ( inst.process[0].step[0].process.step[4].operation.request.instanceReference == "task1" ) assert ( inst.process[0].step[0].process.step[4].operation.request.versionReference == "task1-v1" ) assert inst.process[0].step[0].process.step[4].operation.title == "Send task to Lab" assert inst.process[0].step[0].process.title == "Create order" assert inst.process[0].step[1].number == "2" assert ( inst.process[0].step[1].process.description == "New task for handling order tracking" ) assert inst.process[0].step[1].process.step[0].number == "2.1" assert inst.process[0].step[1].process.step[0].operation.initiator == "LabMan" assert inst.process[0].step[1].process.step[0].operation.receiver == "Lab" assert inst.process[0].step[1].process.step[0].operation.title == "Accept task" assert inst.process[0].step[1].process.step[1].number == "2.2" assert inst.process[0].step[1].process.step[1].operation.initiator == "Lab" assert inst.process[0].step[1].process.step[1].operation.receiver == "Lab" assert ( inst.process[0].step[1].process.step[1].operation.request.instanceReference == "task1" ) assert ( inst.process[0].step[1].process.step[1].operation.request.versionReference == "task1-v2" ) assert ( inst.process[0].step[1].process.step[1].operation.title == "Task status = accepted" ) assert inst.process[0].step[1].process.step[2].number == "2.3" assert inst.process[0].step[1].process.step[2].operation.initiator == "Lab" assert inst.process[0].step[1].process.step[2].operation.receiver == "Lab" assert ( inst.process[0].step[1].process.step[2].operation.request.instanceReference == "req.lab1" ) assert ( inst.process[0].step[1].process.step[2].operation.request.versionReference == "req.lab1-v1" ) assert ( inst.process[0].step[1].process.step[2].operation.title == "Create internal lab request" ) assert inst.process[0].step[1].process.step[3].number == "2.4" assert inst.process[0].step[1].process.step[3].operation.initiator == "Lab" assert inst.process[0].step[1].process.step[3].operation.receiver == "EMR" assert ( inst.process[0].step[1].process.step[3].operation.request.instanceReference == "task1" ) assert ( inst.process[0].step[1].process.step[3].operation.request.versionReference == "task1-v2" ) assert inst.process[0].step[1].process.step[3].operation.title == "Send Task to EMR" assert inst.process[0].step[1].process.step[4].number == "2.5" assert inst.process[0].step[1].process.step[4].operation.initiator == "EMR" assert inst.process[0].step[1].process.step[4].operation.receiver == "CPOE" assert ( inst.process[0].step[1].process.step[4].operation.request.instanceReference == "task1" ) assert ( inst.process[0].step[1].process.step[4].operation.request.versionReference == "task1-v2" ) assert ( inst.process[0].step[1].process.step[4].operation.title == "Inform CPOE of Task status" ) assert inst.process[0].step[1].process.title == "Accept order" assert inst.process[0].step[2].number == "3" assert ( inst.process[0].step[2].process.description == "Procedure is initiated at the lab" ) assert inst.process[0].step[2].process.step[0].number == "3.1" assert inst.process[0].step[2].process.step[0].operation.initiator == "LabMan" assert inst.process[0].step[2].process.step[0].operation.receiver == "Lab" assert inst.process[0].step[2].process.step[0].operation.title == "Begin procedure" assert inst.process[0].step[2].process.step[1].number == "3.2" assert inst.process[0].step[2].process.step[1].operation.initiator == "Lab" assert inst.process[0].step[2].process.step[1].operation.receiver == "Lab" assert ( inst.process[0].step[2].process.step[1].operation.request.instanceReference == "task1" ) assert ( inst.process[0].step[2].process.step[1].operation.request.versionReference == "task1-v3" ) assert ( inst.process[0].step[2].process.step[1].operation.title == "Task status: in-progress" ) assert inst.process[0].step[2].process.step[2].number == "4.3" assert inst.process[0].step[2].process.step[2].operation.initiator == "Lab" assert inst.process[0].step[2].process.step[2].operation.receiver == "Lab" assert ( inst.process[0].step[2].process.step[2].operation.request.instanceReference == "req.lab1" ) assert ( inst.process[0].step[2].process.step[2].operation.request.versionReference == "req.lab1-v2" ) assert ( inst.process[0].step[2].process.step[2].operation.title == "Internal lab request: in-progress" ) assert inst.process[0].step[2].process.step[3].number == "4.4" assert inst.process[0].step[2].process.step[3].operation.initiator == "Lab" assert inst.process[0].step[2].process.step[3].operation.receiver == "EMR" assert ( inst.process[0].step[2].process.step[3].operation.request.instanceReference == "task1" ) assert ( inst.process[0].step[2].process.step[3].operation.request.versionReference == "task1-v3" ) assert ( inst.process[0].step[2].process.step[3].operation.title == "Send updated Task to EMR" ) assert inst.process[0].step[2].process.step[4].number == "4.5" assert inst.process[0].step[2].process.step[4].operation.initiator == "EMR" assert inst.process[0].step[2].process.step[4].operation.receiver == "CPOE" assert ( inst.process[0].step[2].process.step[4].operation.request.instanceReference == "task1" ) assert ( inst.process[0].step[2].process.step[4].operation.request.versionReference == "task1-v4" ) assert ( inst.process[0].step[2].process.step[4].operation.title == "Inform CPOE of Task status" ) assert inst.process[0].step[2].process.step[5].number == "4.5" assert inst.process[0].step[2].process.step[5].operation.initiator == "CPOE" assert inst.process[0].step[2].process.step[5].operation.receiver == "CPOE" assert ( inst.process[0].step[2].process.step[5].operation.request.instanceReference == "req1" ) assert ( inst.process[0].step[2].process.step[5].operation.request.versionReference == "req1-v2" ) assert ( inst.process[0].step[2].process.step[5].operation.title == "Order status: in-progress" ) assert inst.process[0].step[2].process.title == "Initiate procedure" assert inst.process[0].step[3].number == "4" assert inst.process[0].step[3].process.description == "Procedure is finished" assert inst.process[0].step[3].process.step[0].number == "4.1" assert inst.process[0].step[3].process.step[0].operation.initiator == "LabMan" assert inst.process[0].step[3].process.step[0].operation.receiver == "Lab" assert inst.process[0].step[3].process.step[0].operation.title == "Finish procedure" assert inst.process[0].step[3].process.step[1].number == "4.2" assert inst.process[0].step[3].process.step[1].operation.initiator == "Lab" assert inst.process[0].step[3].process.step[1].operation.receiver == "Lab" assert ( inst.process[0].step[3].process.step[1].operation.request.instanceReference == "task1" ) assert ( inst.process[0].step[3].process.step[1].operation.request.versionReference == "task1-v2" ) assert ( inst.process[0].step[3].process.step[1].operation.title == "Task status = completed" ) assert inst.process[0].step[3].process.step[2].number == "4.3" assert inst.process[0].step[3].process.step[2].operation.initiator == "Lab" assert inst.process[0].step[3].process.step[2].operation.receiver == "Lab" assert ( inst.process[0].step[3].process.step[2].operation.request.instanceReference == "req.lab1" ) assert ( inst.process[0].step[3].process.step[2].operation.request.versionReference == "req.lab1-v2" ) assert ( inst.process[0].step[3].process.step[2].operation.title == "Internal lab request: complete" ) assert inst.process[0].step[3].process.step[3].number == "4.4" assert inst.process[0].step[3].process.step[3].operation.initiator == "Lab" assert inst.process[0].step[3].process.step[3].operation.receiver == "EMR" assert ( inst.process[0].step[3].process.step[3].operation.request.instanceReference == "task1" ) assert ( inst.process[0].step[3].process.step[3].operation.request.versionReference == "task1-v4" ) assert ( inst.process[0].step[3].process.step[3].operation.title == "Send updated Task to EMR" ) assert inst.process[0].step[3].process.step[4].number == "4.5" assert inst.process[0].step[3].process.step[4].operation.initiator == "EMR" assert inst.process[0].step[3].process.step[4].operation.receiver == "CPOE" assert ( inst.process[0].step[3].process.step[4].operation.request.instanceReference == "task1" ) assert ( inst.process[0].step[3].process.step[4].operation.request.versionReference == "task1-v4" ) assert ( inst.process[0].step[3].process.step[4].operation.title == "Inform CPOE of Task status" ) assert inst.process[0].step[3].process.step[5].number == "4.5" assert inst.process[0].step[3].process.step[5].operation.initiator == "CPOE" assert inst.process[0].step[3].process.step[5].operation.receiver == "CPOE" assert ( inst.process[0].step[3].process.step[5].operation.request.instanceReference == "req1" ) assert ( inst.process[0].step[3].process.step[5].operation.request.versionReference == "req1-v3" ) assert ( inst.process[0].step[3].process.step[5].operation.title == "Order status = completed" ) assert inst.process[0].step[3].process.title == "Finish procedure" assert inst.process[0].title == "Lab order tracking with Task" assert inst.purpose == ( "Purpose: this serves to demonstrate a scenario that uses " "service requests and Task resources to establish a handshake" " for order tracking." ) assert inst.status == "draft" assert inst.text.status == "additional" assert inst.title == "Lab order tracking with Task" def test_examplescenario_2(base_settings): """No. 2 tests collection for ExampleScenario. Test File: examplescenario-example-laborder.json """ filename = ( base_settings["unittest_data_dir"] / "examplescenario-example-laborder.json" ) inst = examplescenario.ExampleScenario.model_validate_json(filename.read_bytes()) assert "ExampleScenario" == inst.get_resource_type() impl_examplescenario_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ExampleScenario" == data["resourceType"] inst2 = examplescenario.ExampleScenario(**data) impl_examplescenario_2(inst2) ================================================ FILE: fhir/resources/tests/test_explanationofbenefit.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ExplanationOfBenefit Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import explanationofbenefit from .conftest import ExternalValidatorModel def impl_explanationofbenefit_1(inst): assert inst.careTeam[0].provider.reference == "Practitioner/example" assert inst.careTeam[0].sequence == 1 assert inst.claim.reference == "Claim/100150" assert inst.claimResponse.reference == "ClaimResponse/R3500" assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.disposition == "Claim settled as per contract." assert inst.enterer.reference == "Practitioner/1" assert inst.facility.reference == "Location/1" assert inst.id == "EB3500" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/explanationofbenefit"} ).valueUri ) assert inst.identifier[0].value == "987654321" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].focal is True assert inst.insurer.reference == "Organization/3" assert inst.item[0].adjudication[0].amount.currency == "USD" assert float(inst.item[0].adjudication[0].amount.value) == float(120.0) assert inst.item[0].adjudication[0].category.coding[0].code == "eligible" assert inst.item[0].adjudication[1].category.coding[0].code == "eligpercent" assert float(inst.item[0].adjudication[1].quantity.value) == float(0.8) assert inst.item[0].adjudication[2].amount.currency == "USD" assert float(inst.item[0].adjudication[2].amount.value) == float(96.0) assert inst.item[0].adjudication[2].category.coding[0].code == "benefit" assert inst.item[0].careTeamSequence[0] == 1 assert inst.item[0].encounter[0].reference == "Encounter/example" assert inst.item[0].net.currency == "USD" assert float(inst.item[0].net.value) == float(135.57) assert inst.item[0].productOrService.coding[0].code == "1205" assert ( inst.item[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-USCLS"} ).valueUri ) assert inst.item[0].sequence == 1 assert ( inst.item[0].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert inst.item[0].udi[0].reference == "Device/example" assert inst.item[0].unitPrice.currency == "USD" assert float(inst.item[0].unitPrice.value) == float(135.57) assert inst.item[1].adjudication[0].amount.currency == "USD" assert float(inst.item[1].adjudication[0].amount.value) == float(180.0) assert inst.item[1].adjudication[0].category.coding[0].code == "benefit" assert inst.item[1].careTeamSequence[0] == 1 assert inst.item[1].detail[0].adjudication[0].amount.currency == "USD" assert float(inst.item[1].detail[0].adjudication[0].amount.value) == float(180.0) assert inst.item[1].detail[0].adjudication[0].category.coding[0].code == "benefit" assert inst.item[1].detail[0].net.currency == "USD" assert float(inst.item[1].detail[0].net.value) == float(200.0) assert inst.item[1].detail[0].productOrService.coding[0].code == "group" assert inst.item[1].detail[0].sequence == 1 assert inst.item[1].detail[0].subDetail[0].adjudication[0].amount.currency == "USD" assert float( inst.item[1].detail[0].subDetail[0].adjudication[0].amount.value ) == float(200.0) assert ( inst.item[1].detail[0].subDetail[0].adjudication[0].category.coding[0].code == "eligible" ) assert ( inst.item[1].detail[0].subDetail[0].adjudication[1].category.coding[0].code == "eligpercent" ) assert float( inst.item[1].detail[0].subDetail[0].adjudication[1].quantity.value ) == float(0.9) assert inst.item[1].detail[0].subDetail[0].adjudication[2].amount.currency == "USD" assert float( inst.item[1].detail[0].subDetail[0].adjudication[2].amount.value ) == float(180.0) assert ( inst.item[1].detail[0].subDetail[0].adjudication[2].category.coding[0].code == "benefit" ) assert inst.item[1].detail[0].subDetail[0].net.currency == "USD" assert float(inst.item[1].detail[0].subDetail[0].net.value) == float(200.0) assert inst.item[1].detail[0].subDetail[0].productOrService.coding[0].code == "1205" assert ( inst.item[1].detail[0].subDetail[0].productOrService.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-USCLS"} ).valueUri ) assert inst.item[1].detail[0].subDetail[0].sequence == 1 assert inst.item[1].detail[0].subDetail[0].udi[0].reference == "Device/example" assert inst.item[1].detail[0].subDetail[0].unitPrice.currency == "USD" assert float(inst.item[1].detail[0].subDetail[0].unitPrice.value) == float(200.0) assert inst.item[1].detail[0].udi[0].reference == "Device/example" assert inst.item[1].net.currency == "USD" assert float(inst.item[1].net.value) == float(200.0) assert inst.item[1].productOrService.coding[0].code == "group" assert inst.item[1].sequence == 2 assert ( inst.item[1].servicedDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "complete" assert inst.patient.reference == "Patient/pat1" assert inst.payee.party.reference == "Organization/2" assert inst.payee.type.coding[0].code == "provider" assert ( inst.payee.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/payeetype"} ).valueUri ) assert inst.provider.reference == "Practitioner/1" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the ExplanationOfBenefit
" ) assert inst.text.status == "generated" assert inst.total[0].amount.currency == "USD" assert float(inst.total[0].amount.value) == float(135.57) assert inst.total[0].category.coding[0].code == "submitted" assert inst.total[1].amount.currency == "USD" assert float(inst.total[1].amount.value) == float(96.0) assert inst.total[1].category.coding[0].code == "benefit" assert inst.type.coding[0].code == "oral" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_explanationofbenefit_1(base_settings): """No. 1 tests collection for ExplanationOfBenefit. Test File: explanationofbenefit-example.json """ filename = base_settings["unittest_data_dir"] / "explanationofbenefit-example.json" inst = explanationofbenefit.ExplanationOfBenefit.model_validate_json( filename.read_bytes() ) assert "ExplanationOfBenefit" == inst.get_resource_type() impl_explanationofbenefit_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ExplanationOfBenefit" == data["resourceType"] inst2 = explanationofbenefit.ExplanationOfBenefit(**data) impl_explanationofbenefit_1(inst2) def impl_explanationofbenefit_2(inst): assert ( inst.accident.date == ExternalValidatorModel.model_validate({"valueDate": "2014-02-14"}).valueDate ) assert inst.accident.locationReference.reference == "Location/ph" assert inst.accident.type.coding[0].code == "SPT" assert ( inst.accident.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.billablePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-03-01"} ).valueDateTime ) assert ( inst.billablePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-02-01"} ).valueDateTime ) assert inst.claim.reference == "Claim/100150" assert inst.claimResponse.reference == "ClaimResponse/R3500" assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.disposition == "Could not process." assert inst.enterer.reference == "Practitioner/1" assert inst.facility.reference == "Location/1" assert inst.formCode.coding[0].code == "2" assert ( inst.formCode.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/forms-codes"} ).valueUri ) assert inst.id == "EB3501" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/explanationofbenefit"} ).valueUri ) assert inst.identifier[0].value == "error-1" assert inst.insurance[0].coverage.reference == "Coverage/9876B1" assert inst.insurance[0].focal is True assert inst.insurer.reference == "Organization/2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.originalPrescription.reference == "MedicationRequest/medrx0301" assert inst.outcome == "error" assert inst.patient.reference == "Patient/pat1" assert inst.precedence == 2 assert inst.prescription.reference == "MedicationRequest/medrx002" assert ( inst.procedure[0].date == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-02-14"} ).valueDateTime ) assert inst.procedure[0].procedureCodeableConcept.coding[0].code == "123001" assert ( inst.procedure[0].procedureCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/ex-icd-10-procedures"} ).valueUri ) assert inst.procedure[0].sequence == 1 assert inst.procedure[0].udi[0].reference == "Device/example" assert inst.processNote[0].language.coding[0].code == "en-CA" assert ( inst.processNote[0].language.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:47"} ).valueUri ) assert inst.processNote[0].number == 1 assert inst.processNote[0].text == "Invalid claim" assert inst.processNote[0].type.coding[0].code == "display" assert ( inst.processNote[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/note-type"} ).valueUri ) assert inst.provider.reference == "Organization/2" assert ( inst.related[0].reference.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/case-number"} ).valueUri ) assert inst.related[0].reference.value == "23-56Tu-XX-47-20150M14" assert inst.status == "active" assert inst.subType.coding[0].code == "emergency" assert ( inst.subType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/ex-claimsubtype"} ).valueUri ) assert inst.supportingInfo[0].category.coding[0].code == "employmentimpacted" assert ( inst.supportingInfo[0].category.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/claiminformationcategory" } ).valueUri ) assert inst.supportingInfo[0].sequence == 1 assert ( inst.supportingInfo[0].timingPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-02-28"} ).valueDateTime ) assert ( inst.supportingInfo[0].timingPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-02-14"} ).valueDateTime ) assert inst.supportingInfo[1].category.coding[0].code == "hospitalized" assert ( inst.supportingInfo[1].category.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/claiminformationcategory" } ).valueUri ) assert inst.supportingInfo[1].sequence == 2 assert ( inst.supportingInfo[1].timingPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-02-16"} ).valueDateTime ) assert ( inst.supportingInfo[1].timingPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-02-14"} ).valueDateTime ) assert inst.text.status == "generated" assert inst.total[0].amount.currency == "USD" assert float(inst.total[0].amount.value) == float(2478.57) assert inst.total[0].category.coding[0].code == "submitted" assert inst.total[1].amount.currency == "USD" assert float(inst.total[1].amount.value) == float(0.0) assert inst.total[1].category.coding[0].code == "benefit" assert inst.type.coding[0].code == "oral" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/claim-type"} ).valueUri ) assert inst.use == "claim" def test_explanationofbenefit_2(base_settings): """No. 2 tests collection for ExplanationOfBenefit. Test File: explanationofbenefit-example-2.json """ filename = ( base_settings["unittest_data_dir"] / "explanationofbenefit-example-2.json" ) inst = explanationofbenefit.ExplanationOfBenefit.model_validate_json( filename.read_bytes() ) assert "ExplanationOfBenefit" == inst.get_resource_type() impl_explanationofbenefit_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ExplanationOfBenefit" == data["resourceType"] inst2 = explanationofbenefit.ExplanationOfBenefit(**data) impl_explanationofbenefit_2(inst2) ================================================ FILE: fhir/resources/tests/test_familymemberhistory.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/FamilyMemberHistory Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import familymemberhistory from .conftest import ExternalValidatorModel def impl_familymemberhistory_1(inst): assert inst.condition[0].code.coding[0].code == "315619001" assert inst.condition[0].code.coding[0].display == "Myocardial Infarction" assert ( inst.condition[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.condition[0].code.text == "Heart Attack" assert inst.condition[0].contributedToDeath is True assert inst.condition[0].note[0].text == ( "Was fishing at the time. At least he went doing someting he " "loved." ) assert inst.condition[0].onsetAge.code == "a" assert ( inst.condition[0].onsetAge.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.condition[0].onsetAge.unit == "yr" assert float(inst.condition[0].onsetAge.value) == float(74) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2011-03-18"} ).valueDateTime ) assert inst.id == "father" assert inst.identifier[0].value == "12345" assert ( inst.instantiatesUri[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/family-member-history-questionnaire"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].actor.reference == "Practitioner/f201" assert inst.participant[0].function.coding[0].code == "verifier" assert inst.participant[0].function.coding[0].display == "Verifier" assert ( inst.participant[0].function.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/provenance-participant-type" } ).valueUri ) assert inst.patient.display == "Peter Patient" assert inst.patient.reference == "Patient/example" assert inst.relationship.coding[0].code == "FTH" assert inst.relationship.coding[0].display == "father" assert ( inst.relationship.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) assert inst.sex.coding[0].code == "male" assert inst.sex.coding[0].display == "Male" assert ( inst.sex.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/administrative-gender"} ).valueUri ) assert inst.status == "completed" assert inst.text.div == ( '
Father died of a' " heart attack aged 74
" ) assert inst.text.status == "generated" def test_familymemberhistory_1(base_settings): """No. 1 tests collection for FamilyMemberHistory. Test File: familymemberhistory-example.json """ filename = base_settings["unittest_data_dir"] / "familymemberhistory-example.json" inst = familymemberhistory.FamilyMemberHistory.model_validate_json( filename.read_bytes() ) assert "FamilyMemberHistory" == inst.get_resource_type() impl_familymemberhistory_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "FamilyMemberHistory" == data["resourceType"] inst2 = familymemberhistory.FamilyMemberHistory(**data) impl_familymemberhistory_1(inst2) def impl_familymemberhistory_2(inst): assert inst.condition[0].code.coding[0].code == "700146008" assert ( inst.condition[0].code.coding[0].display == "No history of malignant neoplasm of breast" ) assert ( inst.condition[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.condition[0].code.text == "No history of malignant tumor of breast" assert inst.id == "negation" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.display == "Peter Patient" assert inst.patient.reference == "Patient/100" assert inst.relationship.coding[0].code == "MTH" assert inst.relationship.coding[0].display == "mother" assert ( inst.relationship.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) assert inst.status == "completed" assert inst.text.div == ( '
Mother has no ' "history of malignant tumor of breast
" ) assert inst.text.status == "generated" def test_familymemberhistory_2(base_settings): """No. 2 tests collection for FamilyMemberHistory. Test File: familymemberhistory-example-negation.json """ filename = ( base_settings["unittest_data_dir"] / "familymemberhistory-example-negation.json" ) inst = familymemberhistory.FamilyMemberHistory.model_validate_json( filename.read_bytes() ) assert "FamilyMemberHistory" == inst.get_resource_type() impl_familymemberhistory_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "FamilyMemberHistory" == data["resourceType"] inst2 = familymemberhistory.FamilyMemberHistory(**data) impl_familymemberhistory_2(inst2) def impl_familymemberhistory_3(inst): assert inst.condition[0].code.coding[0].code == "371041009" assert inst.condition[0].code.coding[0].display == "Embolic Stroke" assert ( inst.condition[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.condition[0].code.text == "Stroke" assert inst.condition[0].onsetAge.code == "a" assert ( inst.condition[0].onsetAge.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.condition[0].onsetAge.unit == "yr" assert float(inst.condition[0].onsetAge.value) == float(56) assert inst.id == "mother" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.display == "Peter Patient" assert inst.patient.reference == "Patient/100" assert inst.relationship.coding[0].code == "MTH" assert inst.relationship.coding[0].display == "mother" assert ( inst.relationship.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) assert inst.status == "completed" assert inst.text.div == ( '
Mother died of a' " stroke aged 56
" ) assert inst.text.status == "generated" def test_familymemberhistory_3(base_settings): """No. 3 tests collection for FamilyMemberHistory. Test File: familymemberhistory-example-mother.json """ filename = ( base_settings["unittest_data_dir"] / "familymemberhistory-example-mother.json" ) inst = familymemberhistory.FamilyMemberHistory.model_validate_json( filename.read_bytes() ) assert "FamilyMemberHistory" == inst.get_resource_type() impl_familymemberhistory_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "FamilyMemberHistory" == data["resourceType"] inst2 = familymemberhistory.FamilyMemberHistory(**data) impl_familymemberhistory_3(inst2) ================================================ FILE: fhir/resources/tests/test_flag.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Flag Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import flag from .conftest import ExternalValidatorModel def impl_flag_1(inst): assert inst.author.display == "Nancy Nurse" assert inst.author.reference == "Practitioner/example" assert inst.category[0].coding[0].code == "safety" assert inst.category[0].coding[0].display == "Safety" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/flag-category"} ).valueUri ) assert inst.category[0].text == "Safety" assert inst.code.coding[0].code == "bigdog" assert inst.code.coding[0].display == "Big dog" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/local"} ).valueUri ) assert inst.code.text == ( "Patient has a big dog at his home. Always always wear a suit" " of armor or take other active counter-measures" ) assert inst.id == "example" 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-12-01"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-17"} ).valueDateTime ) assert inst.status == "inactive" assert inst.subject.display == "Peter Patient" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Large Dog ' "warning for Peter Patient
" ) assert inst.text.status == "generated" def test_flag_1(base_settings): """No. 1 tests collection for Flag. Test File: flag-example.json """ filename = base_settings["unittest_data_dir"] / "flag-example.json" inst = flag.Flag.model_validate_json(filename.read_bytes()) assert "Flag" == inst.get_resource_type() impl_flag_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Flag" == data["resourceType"] inst2 = flag.Flag(**data) impl_flag_1(inst2) def impl_flag_2(inst): assert inst.category[0].coding[0].code == "infection" assert inst.category[0].coding[0].display == "Infection Control Level" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/local"} ).valueUri ) assert inst.code.coding[0].code == "l3" assert inst.code.coding[0].display == "Follow Level 3 Protocol" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/local/if1"} ).valueUri ) assert inst.encounter.reference == "Encounter/example" assert inst.id == "example-encounter" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "active" assert inst.subject.display == "Peter Patient" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Follow Infection' " Control Level 3 Protocol
" ) assert inst.text.status == "generated" def test_flag_2(base_settings): """No. 2 tests collection for Flag. Test File: flag-example-encounter.json """ filename = base_settings["unittest_data_dir"] / "flag-example-encounter.json" inst = flag.Flag.model_validate_json(filename.read_bytes()) assert "Flag" == inst.get_resource_type() impl_flag_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Flag" == data["resourceType"] inst2 = flag.Flag(**data) impl_flag_2(inst2) ================================================ FILE: fhir/resources/tests/test_formularyitem.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/FormularyItem Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import formularyitem from .conftest import ExternalValidatorModel def impl_formularyitem_1(inst): assert inst.code.coding[0].code == "323418000" assert ( inst.code.coding[0].display == "Phenoxymethylpenicillin 125mg/5mL oral solution (product)" ) assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.coding[1].code == "22571011000036102" assert inst.code.coding[1].display == ( "phenoxymethylpenicillin 125 mg / 5 mL oral liquid, 5 mL " "measure" ) assert ( inst.code.coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://nehta.gov.au/amt/v2"} ).valueUri ) assert inst.id == "formularyitemexample01" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_formularyitem_1(base_settings): """No. 1 tests collection for FormularyItem. Test File: formularyitemexample01.json """ filename = base_settings["unittest_data_dir"] / "formularyitemexample01.json" inst = formularyitem.FormularyItem.model_validate_json(filename.read_bytes()) assert "FormularyItem" == inst.get_resource_type() impl_formularyitem_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "FormularyItem" == data["resourceType"] inst2 = formularyitem.FormularyItem(**data) impl_formularyitem_1(inst2) ================================================ FILE: fhir/resources/tests/test_genomicstudy.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/GenomicStudy Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import genomicstudy from .conftest import ExternalValidatorModel def impl_genomicstudy_1(inst): assert ( inst.analysis[0].date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01T01:01:10-06:00"} ).valueDateTime ) assert inst.analysis[0].device[0].device.reference == "Device/NGS-device" assert ( inst.analysis[0].device[0].function.coding[0].display == "Next Generation Sequencing" ) assert ( inst.analysis[0].identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/genomicAnalyses"} ).valueUri ) assert inst.analysis[0].identifier[0].use == "temp" assert inst.analysis[0].identifier[0].value == "urn:uuid:1111-1111-1111-1111" assert inst.analysis[0].input[0].file.reference == "DocumentReference/genomicFile1" assert inst.analysis[0].input[0].type.coding[0].code == "vcf" assert inst.analysis[0].input[0].type.coding[0].display == "VCF" assert ( inst.analysis[0].instantiatesUri == ExternalValidatorModel.model_validate( {"valueUri": "https://pubmed.ncbi.nlm.nih.gov/33927380/"} ).valueUri ) assert ( inst.analysis[0].note[0].text == "This is a next generation sequencing analysis of a proband." ) assert ( inst.analysis[0].performer[0].actor.reference == "Practitioner/practitioner02" ) assert inst.analysis[0].performer[0].role.coding[0].code == "PRF" assert inst.analysis[0].performer[0].role.coding[0].display == "Performer" assert ( inst.analysis[0].performer[0].role.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/3.1.0/CodeSystem-v3-ParticipationType.html" } ).valueUri ) assert inst.analysis[0].specimen[0].reference == "Specimen/denovo-1" assert inst.analysis[0].title == ( "Proband Sequence Variation Detection Using Next Generation " "Sequencing" ) assert ( inst.analysis[1].date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01T01:01:10-06:00"} ).valueDateTime ) assert inst.analysis[1].device[0].device.reference == "Device/NGS-device" assert inst.analysis[1].focus[0].reference == "Patient/denovoMother" assert ( inst.analysis[1].identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/genomicAnalyses"} ).valueUri ) assert inst.analysis[1].identifier[0].use == "temp" assert inst.analysis[1].identifier[0].value == "urn:uuid:1111-1111-1111-1112" assert inst.analysis[1].input[0].file.reference == "DocumentReference/genomicFile2" assert inst.analysis[1].input[0].type.coding[0].code == "vcf" assert inst.analysis[1].input[0].type.coding[0].display == "VCF" assert ( inst.analysis[1].instantiatesUri == ExternalValidatorModel.model_validate( {"valueUri": "https://pubmed.ncbi.nlm.nih.gov/33927380/"} ).valueUri ) assert inst.analysis[1].note[0].text == ( "This is a next generation sequencing analysis of a mother of" " a proband." ) assert ( inst.analysis[1].performer[0].actor.reference == "Practitioner/practitioner02" ) assert inst.analysis[1].performer[0].role.coding[0].code == "PRF" assert inst.analysis[1].performer[0].role.coding[0].display == "Performer" assert ( inst.analysis[1].performer[0].role.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/3.1.0/CodeSystem-v3-ParticipationType.html" } ).valueUri ) assert inst.analysis[1].specimen[0].reference == "Specimen/denovo-2" assert inst.analysis[1].title == ( "Maternal Sequence Variation Detection Using Next Generation " "Sequencing" ) assert ( inst.analysis[2].date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01T01:01:10-06:00"} ).valueDateTime ) assert inst.analysis[2].device[0].device.reference == "Device/NGS-device" assert inst.analysis[2].focus[0].reference == "Patient/denovoFather" assert ( inst.analysis[2].identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/genomicAnalyses"} ).valueUri ) assert inst.analysis[2].identifier[0].use == "temp" assert inst.analysis[2].identifier[0].value == "urn:uuid:1111-1111-1111-1113" assert inst.analysis[2].input[0].file.reference == "DocumentReference/genomicFile3" assert inst.analysis[2].input[0].type.coding[0].code == "vcf" assert inst.analysis[2].input[0].type.coding[0].display == "VCF" assert ( inst.analysis[2].instantiatesUri == ExternalValidatorModel.model_validate( {"valueUri": "https://pubmed.ncbi.nlm.nih.gov/33927380/"} ).valueUri ) assert inst.analysis[2].note[0].text == ( "This is a next generation sequencing analysis of a father of" " a proband." ) assert ( inst.analysis[2].performer[0].actor.reference == "Practitioner/practitioner02" ) assert inst.analysis[2].performer[0].role.coding[0].code == "PRF" assert inst.analysis[2].performer[0].role.coding[0].display == "Performer" assert ( inst.analysis[2].performer[0].role.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/3.1.0/CodeSystem-v3-ParticipationType.html" } ).valueUri ) assert inst.analysis[2].specimen[0].reference == "Specimen/denovo-3" assert inst.analysis[2].title == ( "Paternal Sequence Variation Detection Using Next Generation " "Sequencing" ) assert ( inst.analysis[3].date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01T03:01:10-06:00"} ).valueDateTime ) assert inst.analysis[3].device[0].device.reference == "Device/Triodenovo-SW" assert ( inst.analysis[3].identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/genomicAnalyses"} ).valueUri ) assert inst.analysis[3].identifier[0].use == "temp" assert inst.analysis[3].identifier[0].value == "urn:uuid:1111-1111-1111-1114" assert inst.analysis[3].input[0].file.reference == "DocumentReference/genomicFile1" assert inst.analysis[3].input[0].type.coding[0].code == "vcf" assert inst.analysis[3].input[0].type.coding[0].display == "VCF" assert inst.analysis[3].input[1].file.reference == "DocumentReference/genomicFile2" assert inst.analysis[3].input[1].type.coding[0].code == "vcf" assert inst.analysis[3].input[1].type.coding[0].display == "VCF" assert inst.analysis[3].input[2].file.reference == "DocumentReference/genomicFile3" assert inst.analysis[3].input[2].type.coding[0].code == "vcf" assert inst.analysis[3].input[2].type.coding[0].display == "VCF" assert ( inst.analysis[3].instantiatesUri == ExternalValidatorModel.model_validate( {"valueUri": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6885382/"} ).valueUri ) assert inst.analysis[3].note[0].text == ( "This is a next generation sequencing analysis of the " "comparison analysis of proband and parents sequences." ) assert ( inst.analysis[3].performer[0].actor.reference == "Practitioner/practitioner02" ) assert inst.analysis[3].performer[0].role.coding[0].code == "PRF" assert inst.analysis[3].performer[0].role.coding[0].display == "Performer" assert ( inst.analysis[3].performer[0].role.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/3.1.0/CodeSystem-v3-ParticipationType.html" } ).valueUri ) assert inst.analysis[3].title == "De Novo Mutation Detection and Interpretation" assert inst.basedOn[0].reference == "ServiceRequest/genomicServiceRequest" assert inst.description == "De novo mutation study of the patient." assert inst.encounter.reference == "Encounter/denovoEncounter" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/genomicstudies"} ).valueUri ) assert inst.identifier[0].use == "temp" assert inst.identifier[0].value == "urn:uuid:1111-1111-1111-1111" assert inst.interpreter[0].reference == "Practitioner/practitioner02" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == ( "This de novo mutation is urgent and important for " "establishing the treatment plan." ) assert inst.reason[0].concept.coding[0].code == "267431006" assert ( inst.reason[0].concept.coding[0].display == "Disorder of lipid metabolism (disorder)" ) assert ( inst.reason[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.referrer.reference == "Practitioner/practitioner01" assert ( inst.startDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01"} ).valueDateTime ) assert inst.status == "unknown" assert inst.subject.reference == "Patient/denovoChild" assert inst.text.status == "additional" assert inst.type[0].coding[0].code == "fam-var-segr" assert inst.type[0].coding[0].display == "Familial variant segregation" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/genomicstudy-type"} ).valueUri ) def test_genomicstudy_1(base_settings): """No. 1 tests collection for GenomicStudy. Test File: genomicstudy-example.json """ filename = base_settings["unittest_data_dir"] / "genomicstudy-example.json" inst = genomicstudy.GenomicStudy.model_validate_json(filename.read_bytes()) assert "GenomicStudy" == inst.get_resource_type() impl_genomicstudy_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "GenomicStudy" == data["resourceType"] inst2 = genomicstudy.GenomicStudy(**data) impl_genomicstudy_1(inst2) def impl_genomicstudy_2(inst): assert ( inst.analysis[0].date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-07-01T01:01:10-06:00"} ).valueDateTime ) assert inst.analysis[0].device[0].device.reference == "Device/NGS-device" assert inst.analysis[0].focus[0].reference == "Patient/mother" assert ( inst.analysis[0].identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/genomicAnalyses"} ).valueUri ) assert inst.analysis[0].identifier[0].use == "temp" assert inst.analysis[0].identifier[0].value == "urn:uuid:1111-1111-1111-1112" assert ( inst.analysis[0].instantiatesUri == ExternalValidatorModel.model_validate( {"valueUri": "https://pubmed.ncbi.nlm.nih.gov/33927380/"} ).valueUri ) assert inst.analysis[0].note[0].text == ( "This is a next generation sequencing analysis of a mother of" " a proband." ) assert ( inst.analysis[0].performer[0].actor.reference == "Practitioner/practitioner02" ) assert inst.analysis[0].performer[0].role.coding[0].code == "PRF" assert inst.analysis[0].performer[0].role.coding[0].display == "Performer" assert ( inst.analysis[0].performer[0].role.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/3.1.0/CodeSystem-v3-ParticipationType.html" } ).valueUri ) assert inst.analysis[0].specimen[0].reference == "Specimen/specimenMother" assert inst.analysis[0].title == ( "Maternal Sequence Variation Detection Using Next Generation " "Sequencing" ) assert ( inst.analysis[1].date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-07-01T01:01:10-06:00"} ).valueDateTime ) assert inst.analysis[1].device[0].device.reference == "Device/NGS-device" assert inst.analysis[1].focus[0].reference == "Patient/father" assert ( inst.analysis[1].identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/genomicAnalyses"} ).valueUri ) assert inst.analysis[1].identifier[0].use == "temp" assert inst.analysis[1].identifier[0].value == "urn:uuid:1111-1111-1111-1113" assert ( inst.analysis[1].instantiatesUri == ExternalValidatorModel.model_validate( {"valueUri": "https://pubmed.ncbi.nlm.nih.gov/33927380/"} ).valueUri ) assert inst.analysis[1].note[0].text == ( "This is a next generation sequencing analysis of a father of" " a proband." ) assert ( inst.analysis[1].performer[0].actor.reference == "Practitioner/practitioner02" ) assert inst.analysis[1].performer[0].role.coding[0].code == "PRF" assert inst.analysis[1].performer[0].role.coding[0].display == "Performer" assert ( inst.analysis[1].performer[0].role.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/3.1.0/CodeSystem-v3-ParticipationType.html" } ).valueUri ) assert inst.analysis[1].specimen[0].reference == "Specimen/specimenFather" assert inst.analysis[1].title == ( "Paternal Sequence Variation Detection Using Next Generation " "Sequencing" ) assert ( inst.analysis[2].date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-07-01T03:01:10-06:00"} ).valueDateTime ) assert inst.analysis[2].device[0].device.reference == "Device/Triodenovo-SW" assert inst.analysis[2].focus[0].reference == "Patient/denovoChild" assert ( inst.analysis[2].focus[1].reference == "RelatedPerson/relatedPersonDenovoFather" ) assert ( inst.analysis[2].focus[2].reference == "RelatedPerson/relatedPersonDenovoMother" ) assert ( inst.analysis[2].identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/genomicAnalyses"} ).valueUri ) assert inst.analysis[2].identifier[0].use == "temp" assert inst.analysis[2].identifier[0].value == "urn:uuid:1111-1111-1111-1114" assert ( inst.analysis[2].input[0].file.reference == "DocumentReference/genomicFileProband" ) assert inst.analysis[2].input[0].type.coding[0].code == "bam" assert inst.analysis[2].input[0].type.coding[0].display == "BAM" assert ( inst.analysis[2].input[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/genomicstudy-dataformat"} ).valueUri ) assert ( inst.analysis[2].input[1].file.reference == "DocumentReference/genomicFileMother" ) assert inst.analysis[2].input[1].type.coding[0].code == "bam" assert inst.analysis[2].input[1].type.coding[0].display == "BAM" assert ( inst.analysis[2].input[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/genomicstudy-dataformat"} ).valueUri ) assert ( inst.analysis[2].input[2].file.reference == "DocumentReference/genomicFileFather" ) assert inst.analysis[2].input[2].type.coding[0].code == "bam" assert inst.analysis[2].input[2].type.coding[0].display == "BAM" assert ( inst.analysis[2].input[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/genomicstudy-dataformat"} ).valueUri ) assert ( inst.analysis[2].instantiatesUri == ExternalValidatorModel.model_validate( {"valueUri": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6885382/"} ).valueUri ) assert inst.analysis[2].note[0].text == ( "This is a next generation sequencing analysis of the " "comparison analysis of proband and parents sequences." ) assert ( inst.analysis[2].output[0].file.reference == "DocumentReference/genomicFileGroupAsSubject" ) assert inst.analysis[2].output[0].type.coding[0].code == "vcf" assert inst.analysis[2].output[0].type.coding[0].display == "VCF" assert ( inst.analysis[2].output[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/genomicstudy-dataformat"} ).valueUri ) assert ( inst.analysis[2].performer[0].actor.reference == "Practitioner/practitioner02" ) assert inst.analysis[2].performer[0].role.coding[0].code == "PRF" assert inst.analysis[2].performer[0].role.coding[0].display == "Performer" assert ( inst.analysis[2].performer[0].role.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/3.1.0/CodeSystem-v3-ParticipationType.html" } ).valueUri ) assert inst.analysis[2].title == "De Novo Mutation Detection and Interpretation" assert inst.basedOn[0].reference == "ServiceRequest/genomicSRProband" assert inst.basedOn[1].reference == "ServiceRequest/genomicSRMother" assert inst.basedOn[2].reference == "ServiceRequest/genomicSRFather" assert inst.encounter.reference == "Encounter/denovoEncounter" assert inst.id == "example-trio2" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/genomicstudies"} ).valueUri ) assert inst.identifier[0].use == "temp" assert inst.identifier[0].value == "urn:uuid:1111-1111-1111-1113" assert inst.interpreter[0].reference == "Practitioner/practitioner02" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == ( "This de novo mutation is urgent and important for " "establishing the treatment plan." ) assert inst.reason[0].concept.coding[0].code == "67799006" assert ( inst.reason[0].concept.coding[0].display == "Cystic fibrosis, prenatal detection (procedure) |" ) assert ( inst.reason[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.referrer.reference == "Practitioner/practitioner01" assert ( inst.startDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-05-01"} ).valueDateTime ) assert inst.status == "available" assert inst.subject.reference == "Patient/proband" assert inst.text.status == "additional" assert inst.type[0].coding[0].code == "trio" assert inst.type[0].coding[0].display == "Trio-analysis" def test_genomicstudy_2(base_settings): """No. 2 tests collection for GenomicStudy. Test File: genomicstudy-example-trio2.json """ filename = base_settings["unittest_data_dir"] / "genomicstudy-example-trio2.json" inst = genomicstudy.GenomicStudy.model_validate_json(filename.read_bytes()) assert "GenomicStudy" == inst.get_resource_type() impl_genomicstudy_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "GenomicStudy" == data["resourceType"] inst2 = genomicstudy.GenomicStudy(**data) impl_genomicstudy_2(inst2) def impl_genomicstudy_3(inst): assert inst.analysis[0].changeType[0].coding[0].code == "SO:0001483" assert inst.analysis[0].changeType[0].coding[0].display == "SNV" assert ( inst.analysis[0].changeType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://sequenceontology.org"} ).valueUri ) assert inst.analysis[0].changeType[1].coding[0].code == "SO:0002007" assert inst.analysis[0].changeType[1].coding[0].display == "MNV" assert ( inst.analysis[0].changeType[1].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://sequenceontology.org"} ).valueUri ) assert inst.analysis[0].changeType[2].coding[0].code == "SO:1000032" assert inst.analysis[0].changeType[2].coding[0].display == "delins" assert ( inst.analysis[0].changeType[2].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://sequenceontology.org"} ).valueUri ) assert ( inst.analysis[0].date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-03-01T01:01:10-06:00"} ).valueDateTime ) assert inst.analysis[0].device[0].device.reference == "Device/NGS-device" assert ( inst.analysis[0].device[0].function.coding[0].display == "Next Generation Sequencing" ) assert inst.analysis[0].genomeBuild.coding[0].code == "LA26806-2" assert inst.analysis[0].genomeBuild.coding[0].display == "GRCh38" assert ( inst.analysis[0].genomeBuild.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.analysis[0].identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/genomicAnalyses"} ).valueUri ) assert inst.analysis[0].identifier[0].use == "official" assert inst.analysis[0].identifier[0].value == "urn:uuid:1111-1111-1111-1112" assert inst.analysis[0].methodType[0].coding[0].code == "117040002" assert ( inst.analysis[0].methodType[0].coding[0].display == "Nucleic acid sequencing (procedure)" ) assert ( inst.analysis[0].methodType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.analysis[0].note[0].text == ( "For technical reasons, PIK3CB was deemed uncallable using " "this method." ) assert ( inst.analysis[0].output[0].file.reference == "DocumentReference/genomicVCFfile_simple" ) assert inst.analysis[0].output[0].type.coding[0].code == "vcf" assert inst.analysis[0].output[0].type.coding[0].display == "VCF" assert ( inst.analysis[0].performer[0].actor.reference == "Practitioner/practitioner02" ) assert inst.analysis[0].performer[0].role.coding[0].code == "PRF" assert inst.analysis[0].performer[0].role.coding[0].display == "Performer" assert ( inst.analysis[0].performer[0].role.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/3.1.0/CodeSystem-v3-ParticipationType.html" } ).valueUri ) assert ( inst.analysis[0].regionsCalled[0].reference == "DocumentReference/SimpleVariantAnalysis_called" ) assert ( inst.analysis[0].regionsStudied[0].reference == "DocumentReference/WES_FullSequencedRegion_GRCh38" ) assert inst.analysis[0].specimen[0].reference == "Specimen/genomicSpecimen" assert inst.analysis[0].title == "Simple variant analysis" assert inst.analysis[1].changeType[0].coding[0].code == "SO:0001019" assert inst.analysis[1].changeType[0].coding[0].display == "CNV" assert ( inst.analysis[1].changeType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://sequenceontology.org"} ).valueUri ) assert ( inst.analysis[1].date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-03-01T01:01:10-06:00"} ).valueDateTime ) assert inst.analysis[1].genomeBuild.coding[0].code == "LA26806-2" assert inst.analysis[1].genomeBuild.coding[0].display == "GRCh38" assert ( inst.analysis[1].genomeBuild.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.analysis[1].identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/genomicAnalyses"} ).valueUri ) assert inst.analysis[1].identifier[0].use == "official" assert inst.analysis[1].identifier[0].value == "urn:uuid:1111-1111-1111-1115" assert inst.analysis[1].methodType[0].coding[0].code == "117040002" assert ( inst.analysis[1].methodType[0].coding[0].display == "Nucleic acid sequencing (procedure)" ) assert ( inst.analysis[1].methodType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.analysis[1].note[0].text == ( "For technical reasons, PIK3CB was deemed uncallable using " "this method." ) assert ( inst.analysis[1].output[0].file.reference == "DocumentReference/genomicVCFfile_cnv" ) assert inst.analysis[1].output[0].type.coding[0].code == "vcf" assert inst.analysis[1].output[0].type.coding[0].display == "VCF" assert ( inst.analysis[1].performer[0].actor.reference == "Practitioner/practitioner02" ) assert inst.analysis[1].performer[0].role.coding[0].code == "PRF" assert inst.analysis[1].performer[0].role.coding[0].display == "Performer" assert ( inst.analysis[1].performer[0].role.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/3.1.0/CodeSystem-v3-ParticipationType.html" } ).valueUri ) assert ( inst.analysis[1].regionsCalled[0].reference == "DocumentReference/CNVAnalysis_called" ) assert ( inst.analysis[1].regionsStudied[0].reference == "DocumentReference/WES_FullSequencedRegion_GRCh38" ) assert inst.analysis[1].specimen[0].reference == "Specimen/genomicSpecimen" assert inst.analysis[1].title == "CNV analysis" assert inst.basedOn[0].reference == "ServiceRequest/genomicServiceRequest2" assert inst.description == ( "Whole exome sequencing of lung biopsy. 300 genes are " "examined for simple variants (SNV, MNV, InDel), and 170 " "genes are also examined for CNVs. For technical reasons, " "PIK3CB was deemed uncallable." ) assert inst.encounter.reference == "Encounter/genomicEncounter" assert inst.id == "example-lungMass" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/genomicstudies"} ).valueUri ) assert inst.identifier[0].use == "temp" assert inst.identifier[0].value == "urn:uuid:1111-1111-1111-1112" assert inst.interpreter[0].reference == "Practitioner/practitioner02" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "For technical reasons, PIK3CB was deemed uncallable." assert inst.reason[0].concept.coding[0].code == "309529002" assert inst.reason[0].concept.coding[0].display == "Lung mass (finding) " assert ( inst.reason[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.referrer.reference == "Practitioner/practitioner01" assert ( inst.startDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-03-01"} ).valueDateTime ) assert inst.status == "registered" assert inst.subject.reference == "Patient/genomicPatient" assert inst.text.status == "additional" assert inst.type[0].coding[0].code == "443968007" assert inst.type[0].coding[0].display == ( "Whole Exome Sequencing - Sequencing of entire coding region " "of gene (procedure)" ) assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_genomicstudy_3(base_settings): """No. 3 tests collection for GenomicStudy. Test File: genomicstudy-example-lungMass.json """ filename = base_settings["unittest_data_dir"] / "genomicstudy-example-lungMass.json" inst = genomicstudy.GenomicStudy.model_validate_json(filename.read_bytes()) assert "GenomicStudy" == inst.get_resource_type() impl_genomicstudy_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "GenomicStudy" == data["resourceType"] inst2 = genomicstudy.GenomicStudy(**data) impl_genomicstudy_3(inst2) ================================================ FILE: fhir/resources/tests/test_goal.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Goal Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import goal from .conftest import ExternalValidatorModel def impl_goal_1(inst): assert inst.addresses[0].display == "obesity condition" assert inst.category[0].coding[0].code == "dietary" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/goal-category"} ).valueUri ) assert inst.continuous is True assert inst.description.text == "Target weight is 160 to 180 lbs." assert inst.id == "example" assert inst.identifier[0].value == "123" assert inst.lifecycleStatus == "on-hold" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome[0].reference.display == "Body Weight Measured" assert inst.outcome[0].reference.reference == "Observation/example" assert inst.priority.coding[0].code == "high-priority" assert inst.priority.coding[0].display == "High Priority" assert ( inst.priority.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/goal-priority"} ).valueUri ) assert inst.priority.text == "high" assert inst.source.display == "Peter James Chalmers" assert inst.source.reference == "Patient/example" assert ( inst.startDate == ExternalValidatorModel.model_validate({"valueDate": "2015-04-05"}).valueDate ) assert ( inst.statusDate == ExternalValidatorModel.model_validate({"valueDate": "2016-02-14"}).valueDate ) assert ( inst.statusReason == "Patient wants to defer weight loss until after honeymoon." ) assert inst.subject.display == "Peter James Chalmers" assert inst.subject.reference == "Patient/example" assert inst.target[0].detailRange.high.code == "[lb_av]" assert ( inst.target[0].detailRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.target[0].detailRange.high.unit == "lbs" assert float(inst.target[0].detailRange.high.value) == float(180) assert inst.target[0].detailRange.low.code == "[lb_av]" assert ( inst.target[0].detailRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.target[0].detailRange.low.unit == "lbs" assert float(inst.target[0].detailRange.low.value) == float(160) assert ( inst.target[0].dueDate == ExternalValidatorModel.model_validate({"valueDate": "2016-04-05"}).valueDate ) assert inst.target[0].measure.coding[0].code == "3141-9" assert inst.target[0].measure.coding[0].display == "Weight Measured" assert ( inst.target[0].measure.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.text.status == "additional" def test_goal_1(base_settings): """No. 1 tests collection for Goal. Test File: goal-example.json """ filename = base_settings["unittest_data_dir"] / "goal-example.json" inst = goal.Goal.model_validate_json(filename.read_bytes()) assert "Goal" == inst.get_resource_type() impl_goal_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Goal" == data["resourceType"] inst2 = goal.Goal(**data) impl_goal_1(inst2) def impl_goal_2(inst): assert inst.achievementStatus.coding[0].code == "achieved" assert inst.achievementStatus.coding[0].display == "Achieved" assert ( inst.achievementStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/goal-achievement"} ).valueUri ) assert inst.achievementStatus.text == "Achieved" assert inst.description.text == "Stop smoking" assert inst.id == "stop-smoking" assert inst.identifier[0].value == "123" assert inst.lifecycleStatus == "completed" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome[0].concept.coding[0].code == "8517006" assert inst.outcome[0].concept.coding[0].display == "Ex-smoker (finding)" assert ( inst.outcome[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.outcome[0].concept.text == "Former smoker" assert ( inst.startDate == ExternalValidatorModel.model_validate({"valueDate": "2015-04-05"}).valueDate ) assert inst.subject.display == "Peter James Chalmers" assert inst.subject.reference == "Patient/example" assert inst.text.status == "additional" def test_goal_2(base_settings): """No. 2 tests collection for Goal. Test File: goal-example-stop-smoking.json """ filename = base_settings["unittest_data_dir"] / "goal-example-stop-smoking.json" inst = goal.Goal.model_validate_json(filename.read_bytes()) assert "Goal" == inst.get_resource_type() impl_goal_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Goal" == data["resourceType"] inst2 = goal.Goal(**data) impl_goal_2(inst2) ================================================ FILE: fhir/resources/tests/test_graphdefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/GraphDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import graphdefinition from .conftest import ExternalValidatorModel def impl_graphdefinition_1(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-04"} ).valueDateTime ) assert inst.description == ( "Specify to include list references when generating a " "document using the $document operation" ) assert inst.id == "example" assert inst.link[0].compartment[0].code == "Patient" assert inst.link[0].compartment[0].rule == "identical" assert inst.link[0].compartment[0].use == "requires" assert inst.link[0].description == "Link from Composition.section to list" assert inst.link[0].path == "Composition.section.entry" assert inst.link[0].sourceId == "comp1" assert inst.link[0].targetId == "list1" assert inst.link[1].compartment[0].code == "Patient" assert inst.link[1].compartment[0].rule == "identical" assert inst.link[1].compartment[0].use == "requires" assert inst.link[1].description == "Include any list entries" assert inst.link[1].path == "List.entry.item" assert inst.link[1].sourceId == "list1" assert inst.link[1].targetId == "resN" assert inst.name == "DocumentGenerationTemplate" assert inst.node[0].description == "The base composition" assert inst.node[0].nodeId == "comp1" assert ( inst.node[0].profile == "http://hl7.org/fhir/StructureDefinition/clinicaldocument" ) assert inst.node[0].type == "Composition" assert ( inst.node[1].description == "A list resource that a section entry reference points to" ) assert inst.node[1].nodeId == "list1" assert inst.node[1].type == "List" assert ( inst.node[2].description == "Generic resource that's the target of a list reference" ) assert inst.node[2].nodeId == "resN" assert inst.node[2].type == "Resource" assert inst.publisher == "FHIR Project" assert inst.start == "comp1" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Document Generation Template" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://h7.org/fhir/GraphDefinition/example"} ).valueUri ) def test_graphdefinition_1(base_settings): """No. 1 tests collection for GraphDefinition. Test File: graphdefinition-example.json """ filename = base_settings["unittest_data_dir"] / "graphdefinition-example.json" inst = graphdefinition.GraphDefinition.model_validate_json(filename.read_bytes()) assert "GraphDefinition" == inst.get_resource_type() impl_graphdefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "GraphDefinition" == data["resourceType"] inst2 = graphdefinition.GraphDefinition(**data) impl_graphdefinition_1(inst2) ================================================ FILE: fhir/resources/tests/test_group.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Group Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import group from .conftest import ExternalValidatorModel def impl_group_1(inst): assert inst.characteristic[0].code.text == "gender" assert inst.characteristic[0].exclude is False assert inst.characteristic[0].valueCodeableConcept.text == "mixed" assert inst.characteristic[1].code.text == "owner" assert inst.characteristic[1].exclude is False assert inst.characteristic[1].valueCodeableConcept.text == "John Smith" assert inst.code.text == "Horse" assert inst.id == "101" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://someveterinarianclinic.org/fhir/NamingSystem/herds"} ).valueUri ) assert inst.identifier[0].value == "12345" assert inst.membership == "enumerated" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "John's herd" assert inst.quantity == 25 assert inst.text.status == "additional" assert inst.type == "animal" def test_group_1(base_settings): """No. 1 tests collection for Group. Test File: group-example.json """ filename = base_settings["unittest_data_dir"] / "group-example.json" inst = group.Group.model_validate_json(filename.read_bytes()) assert "Group" == inst.get_resource_type() impl_group_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Group" == data["resourceType"] inst2 = group.Group(**data) impl_group_1(inst2) def impl_group_2(inst): assert inst.id == "102" assert inst.member[0].entity.reference == "Patient/pat1" assert ( inst.member[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-10-08"} ).valueDateTime ) assert inst.member[1].entity.reference == "Patient/pat2" assert inst.member[1].inactive is True assert ( inst.member[1].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-04-02"} ).valueDateTime ) assert inst.member[2].entity.reference == "Patient/pat3" assert ( inst.member[2].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-06"} ).valueDateTime ) assert inst.member[3].entity.reference == "Patient/pat4" assert ( inst.member[3].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-06"} ).valueDateTime ) assert inst.membership == "enumerated" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "additional" assert inst.type == "person" def test_group_2(base_settings): """No. 2 tests collection for Group. Test File: group-example-member.json """ filename = base_settings["unittest_data_dir"] / "group-example-member.json" inst = group.Group.model_validate_json(filename.read_bytes()) assert "Group" == inst.get_resource_type() impl_group_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Group" == data["resourceType"] inst2 = group.Group(**data) impl_group_2(inst2) def impl_group_3(inst): assert inst.characteristic[0].code.coding[0].code == "attributed-to" assert ( inst.characteristic[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org"} ).valueUri ) assert inst.characteristic[0].code.text == "Patients primarily attributed to" assert inst.characteristic[0].exclude is False assert inst.characteristic[0].valueReference.reference == "Practitioner/123" assert inst.id == "example-patientlist" assert inst.membership == "enumerated" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "additional" assert inst.type == "person" def test_group_3(base_settings): """No. 3 tests collection for Group. Test File: group-example-patientlist.json """ filename = base_settings["unittest_data_dir"] / "group-example-patientlist.json" inst = group.Group.model_validate_json(filename.read_bytes()) assert "Group" == inst.get_resource_type() impl_group_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Group" == data["resourceType"] inst2 = group.Group(**data) impl_group_3(inst2) def impl_group_4(inst): assert inst.active is True assert inst.characteristic[0].code.text == "gender" assert inst.characteristic[0].exclude is False assert inst.characteristic[0].valueCodeableConcept.text == "female" assert inst.code.coding[0].code == "388393002" assert inst.code.coding[0].display == "Genus Sus (organism)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.coding[1].code == "POR" assert inst.code.coding[1].display == "porcine" assert ( inst.code.coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.aphis.usda.gov"} ).valueUri ) assert inst.code.text == "Porcine" assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/StructureDefinition/owner"} ).valueUri ) assert inst.extension[0].valueReference.display == "Peter Chalmers" assert inst.extension[0].valueReference.reference == "RelatedPerson/peter" assert inst.id == "herd1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://vetmed.iastate.edu/vdl"} ).valueUri ) assert inst.identifier[0].value == "20171120-1234" assert inst.membership == "enumerated" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Breeding herd" assert inst.quantity == 2500 assert inst.text.status == "generated" assert inst.type == "animal" def test_group_4(base_settings): """No. 4 tests collection for Group. Test File: group-example-herd1.json """ filename = base_settings["unittest_data_dir"] / "group-example-herd1.json" inst = group.Group.model_validate_json(filename.read_bytes()) assert "Group" == inst.get_resource_type() impl_group_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Group" == data["resourceType"] inst2 = group.Group(**data) impl_group_4(inst2) def impl_group_5(inst): assert inst.active is True assert inst.description == "[markdown]" assert inst.id == "groupDenovoFamily" assert inst.identifier[0].assigner.display == "Child Hospital" assert ( inst.identifier[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01"} ).valueDateTime ) assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/groups"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "MR" assert inst.identifier[0].type.coding[0].display == "Medical record number" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].use == "temp" assert inst.identifier[0].value == "11111" assert inst.managingEntity.reference == "Practitioner/practitioner02" assert inst.member[0].entity.reference == "Patient/proband" assert inst.member[0].inactive is False assert ( inst.member[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01T01:01:10-06:00"} ).valueDateTime ) assert inst.member[1].entity.reference == "RelatedPerson/relatedPersonDenovoMother" assert inst.member[1].inactive is False assert ( inst.member[1].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01T01:01:10-06:00"} ).valueDateTime ) assert inst.member[2].entity.reference == "RelatedPerson/relatedPersonDenovoFather" assert inst.member[2].inactive is False assert ( inst.member[2].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01T01:01:10-06:00"} ).valueDateTime ) assert inst.membership == "enumerated" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Denovo Mutation Example Group" assert inst.quantity == 3 assert inst.text.status == "additional" assert inst.type == "person" def test_group_5(base_settings): """No. 5 tests collection for Group. Test File: Group-denovoFamily.json """ filename = base_settings["unittest_data_dir"] / "Group-denovoFamily.json" inst = group.Group.model_validate_json(filename.read_bytes()) assert "Group" == inst.get_resource_type() impl_group_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Group" == data["resourceType"] inst2 = group.Group(**data) impl_group_5(inst2) ================================================ FILE: fhir/resources/tests/test_guidanceresponse.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/GuidanceResponse Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import guidanceresponse from .conftest import ExternalValidatorModel def impl_guidanceresponse_1(inst): assert inst.dataRequirement[0].codeFilter[0].code[0].code == "4548-4" assert ( inst.dataRequirement[0].codeFilter[0].code[0].display == "Hemoglobin A1c/Hemoglobin.total in Blood" ) assert ( inst.dataRequirement[0].codeFilter[0].code[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.dataRequirement[0].codeFilter[0].path == "code" assert inst.dataRequirement[0].mustSupport[0] == "value" assert inst.dataRequirement[0].type == "Observation" assert inst.encounter.reference == "Encounter/example" assert inst.id == "additional-data-example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org"} ).valueUri ) assert inst.identifier[0].value == "guidanceResponse2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.moduleUri == ExternalValidatorModel.model_validate( {"valueUri": "http://someguidelineprovider.org/diabetes-guidelines.html"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-10T16:02:00Z"} ).valueDateTime ) assert inst.performer.reference == "Device/software" assert inst.reason[0].concept.text == "Diabetes Guideline" assert ( inst.requestIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org"} ).valueUri ) assert inst.requestIdentifier.value == "guidanceRequest2" assert inst.status == "data-required" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_guidanceresponse_1(base_settings): """No. 1 tests collection for GuidanceResponse. Test File: guidanceresponse-additional-data-example.json """ filename = ( base_settings["unittest_data_dir"] / "guidanceresponse-additional-data-example.json" ) inst = guidanceresponse.GuidanceResponse.model_validate_json(filename.read_bytes()) assert "GuidanceResponse" == inst.get_resource_type() impl_guidanceresponse_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "GuidanceResponse" == data["resourceType"] inst2 = guidanceresponse.GuidanceResponse(**data) impl_guidanceresponse_1(inst2) def impl_guidanceresponse_2(inst): assert inst.contained[0].id == "outputParameters1" assert inst.encounter.reference == "Encounter/example" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org"} ).valueUri ) assert inst.identifier[0].value == "guidanceResponse1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.moduleUri == ExternalValidatorModel.model_validate( { "valueUri": "http://someguidelineprovider.org/radiology-appropriateness-guidelines.html" } ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-10T16:02:00Z"} ).valueDateTime ) assert inst.outputParameters.reference == "#outputParameters1" assert inst.performer.reference == "Device/software" assert inst.reason[0].concept.text == "Guideline Appropriate Ordering Assessment" assert ( inst.requestIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org"} ).valueUri ) assert inst.requestIdentifier.value == "guidanceRequest1" assert inst.status == "success" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_guidanceresponse_2(base_settings): """No. 2 tests collection for GuidanceResponse. Test File: guidanceresponse-example.json """ filename = base_settings["unittest_data_dir"] / "guidanceresponse-example.json" inst = guidanceresponse.GuidanceResponse.model_validate_json(filename.read_bytes()) assert "GuidanceResponse" == inst.get_resource_type() impl_guidanceresponse_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "GuidanceResponse" == data["resourceType"] inst2 = guidanceresponse.GuidanceResponse(**data) impl_guidanceresponse_2(inst2) ================================================ FILE: fhir/resources/tests/test_healthcareservice.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/HealthcareService Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import healthcareservice from .conftest import ExternalValidatorModel def impl_healthcareservice_1(inst): assert inst.active is True assert inst.appointmentRequired is False assert inst.availability[0].availableTime[0].allDay is True assert inst.availability[0].availableTime[0].daysOfWeek[0] == "wed" assert ( inst.availability[0].availableTime[1].availableEndTime == ExternalValidatorModel.model_validate({"valueTime": "05:30:00"}).valueTime ) assert ( inst.availability[0].availableTime[1].availableStartTime == ExternalValidatorModel.model_validate({"valueTime": "08:30:00"}).valueTime ) assert inst.availability[0].availableTime[1].daysOfWeek[0] == "mon" assert inst.availability[0].availableTime[1].daysOfWeek[1] == "tue" assert inst.availability[0].availableTime[1].daysOfWeek[2] == "thu" assert inst.availability[0].availableTime[1].daysOfWeek[3] == "fri" assert ( inst.availability[0].availableTime[2].availableEndTime == ExternalValidatorModel.model_validate({"valueTime": "04:30:00"}).valueTime ) assert ( inst.availability[0].availableTime[2].availableStartTime == ExternalValidatorModel.model_validate({"valueTime": "09:30:00"}).valueTime ) assert inst.availability[0].availableTime[2].daysOfWeek[0] == "sat" assert inst.availability[0].availableTime[2].daysOfWeek[1] == "fri" assert inst.availability[0].notAvailableTime[0].description == ( "Christmas/Boxing Day, Reduced capacity is available during " "the Christmas period" ) assert ( inst.availability[0].notAvailableTime[0].during.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-12-26"} ).valueDateTime ) assert ( inst.availability[0].notAvailableTime[0].during.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-12-25"} ).valueDateTime ) assert inst.availability[0].notAvailableTime[1].description == "New Years Day" assert ( inst.availability[0].notAvailableTime[1].during.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-01"} ).valueDateTime ) assert ( inst.availability[0].notAvailableTime[1].during.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-01"} ).valueDateTime ) assert inst.category[0].coding[0].code == "8" assert inst.category[0].coding[0].display == "Counselling" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/service-category"} ).valueUri ) assert inst.category[0].text == "Counselling" assert inst.characteristic[0].coding[0].display == "Wheelchair access" assert inst.comment == ( "Providing Specialist psychology services to the greater Den " "Burg area, many years of experience dealing with PTSD issues" ) assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "(555) silent" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].use == "work" assert inst.contact[0].telecom[1].value == "directaddress@example.com" assert inst.contained[0].id == "DenBurg" assert inst.coverageArea[0].display == "Greater Denburg area" assert inst.coverageArea[0].reference == "#DenBurg" assert inst.eligibility[0].code.coding[0].display == "DVA Required" assert inst.eligibility[0].comment == ( "Evidence of application for DVA status may be sufficient for" " commencing assessment" ) assert inst.endpoint[0].reference == "Endpoint/example" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/shared-ids"} ).valueUri ) assert inst.identifier[0].value == "HS-12" assert inst.location[0].reference == "Location/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Consulting psychologists and/or psychology services" assert inst.program[0].text == "PTSD outreach" assert inst.providedBy.display == "Burgers University Medical Center" assert inst.providedBy.reference == "Organization/f001" assert inst.referralMethod[0].coding[0].code == "phone" assert inst.referralMethod[0].coding[0].display == "Phone" assert inst.referralMethod[1].coding[0].code == "fax" assert inst.referralMethod[1].coding[0].display == "Fax" assert inst.referralMethod[2].coding[0].code == "elec" assert inst.referralMethod[2].coding[0].display == "Secure Messaging" assert inst.referralMethod[3].coding[0].code == "semail" assert inst.referralMethod[3].coding[0].display == "Secure Email" assert inst.serviceProvisionCode[0].coding[0].code == "cost" assert inst.serviceProvisionCode[0].coding[0].display == "Fees apply" assert ( inst.serviceProvisionCode[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/service-provision-conditions" } ).valueUri ) assert inst.specialty[0].coding[0].code == "47505003" assert inst.specialty[0].coding[0].display == "Posttraumatic stress disorder" assert ( inst.specialty[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "394913002" assert inst.type[0].coding[0].display == "Psychotherapy" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.type[1].coding[0].code == "394587001" assert inst.type[1].coding[0].display == "Psychiatry" assert ( inst.type[1].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_healthcareservice_1(base_settings): """No. 1 tests collection for HealthcareService. Test File: healthcareservice-example.json """ filename = base_settings["unittest_data_dir"] / "healthcareservice-example.json" inst = healthcareservice.HealthcareService.model_validate_json( filename.read_bytes() ) assert "HealthcareService" == inst.get_resource_type() impl_healthcareservice_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "HealthcareService" == data["resourceType"] inst2 = healthcareservice.HealthcareService(**data) impl_healthcareservice_1(inst2) ================================================ FILE: fhir/resources/tests/test_imagingselection.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ImagingSelection Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import imagingselection from .conftest import ExternalValidatorModel def impl_imagingselection_1(inst): assert inst.code.text == "Observation within a DICOM SR" assert ( inst.derivedFrom[0].identifier.system == ExternalValidatorModel.model_validate({"valueUri": "urn:dicom:uid"}).valueUri ) assert ( inst.derivedFrom[0].identifier.value == "urn:oid:1.2.840.113747.20080222.95946072916364657859950275" ) assert ( inst.derivedFrom[0].type == ExternalValidatorModel.model_validate({"valueUri": "ImagingStudy"}).valueUri ) assert inst.focus[0].reference == "ImagingSelection/example-basic-image-selection" assert ( inst.frameOfReferenceUid == "1.2.840.113747.20080222.95946058736364657859950275.0" ) assert inst.id == "example-dicom-sr-selection" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate({"valueUri": "urn:dicom:uid"}).valueUri ) assert inst.identifier[0].value == ( "urn:oid:1.2.840.113747.20080222.95946059916364657859950275.2" ".1" ) assert inst.instance[0].sopClass.code == "urn:oid:1.2.840.10008.5.1.4.1.1.88.22" assert ( inst.instance[0].sopClass.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.instance[0].subset[0] == ( "1.2.840.113747.20080222.95946058738699434572916359950275.10." "1" ) assert ( inst.instance[0].uid == "1.2.840.113747.20080222.95946058738699434359950275.1.0" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.seriesUid == "1.2.840.113747.20080222.95946058738664657859950275.1" assert inst.status == "available" assert inst.studyUid == "1.2.840.113747.20080222.95946058738694657859950275" assert ( inst.subject.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "https://fhirhospital.org"} ).valueUri ) assert inst.subject.identifier.value == "RNKZPSBNZLNADAZV" assert ( inst.subject.type == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.text.status == "generated" def test_imagingselection_1(base_settings): """No. 1 tests collection for ImagingSelection. Test File: imagingselection-example-dicom-sr-selection.json """ filename = ( base_settings["unittest_data_dir"] / "imagingselection-example-dicom-sr-selection.json" ) inst = imagingselection.ImagingSelection.model_validate_json(filename.read_bytes()) assert "ImagingSelection" == inst.get_resource_type() impl_imagingselection_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ImagingSelection" == data["resourceType"] inst2 = imagingselection.ImagingSelection(**data) impl_imagingselection_1(inst2) def impl_imagingselection_2(inst): assert inst.code.text == "Key Frames" assert ( inst.derivedFrom[0].identifier.system == ExternalValidatorModel.model_validate({"valueUri": "urn:dicom:uid"}).valueUri ) assert inst.derivedFrom[0].identifier.value == ( "urn:oid:1.2.840.113747.20080222.3077658758893509802450245542" "21747" ) assert ( inst.derivedFrom[0].type == ExternalValidatorModel.model_validate({"valueUri": "ImagingStudy"}).valueUri ) assert ( inst.frameOfReferenceUid == "1.2.840.113747.20080222.307765875869350980245024554221747.0" ) assert inst.id == "example-multiframe-image-selection" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate({"valueUri": "urn:dicom:uid"}).valueUri ) assert inst.identifier[0].value == ( "urn:oid:1.2.840.113747.20080222.3077658758693009802450245542" "21747.2.1" ) assert inst.instance[0].sopClass.code == "urn:oid:1.2.840.10008.5.1.4.1.1.2.1" assert ( inst.instance[0].sopClass.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.instance[0].subset[0] == "1" assert inst.instance[0].subset[1] == "2" assert inst.instance[0].subset[2] == "3" assert inst.instance[0].subset[3] == "4" assert inst.instance[0].uid == ( "1.2.840.113747.20080222.307765875869300489355024554221747.1." "0" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.seriesUid == "1.2.840.113747.20080222.307765875869300489245024554221747.1" ) assert inst.status == "available" assert inst.studyUid == "1.2.840.113747.20080222.307765875869300489345024554221747" assert ( inst.subject.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "https://fhirhospital.org"} ).valueUri ) assert inst.subject.identifier.value == "MNSOIISABIDCHRCY" assert ( inst.subject.type == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.text.status == "generated" def test_imagingselection_2(base_settings): """No. 2 tests collection for ImagingSelection. Test File: imagingselection-example-multiframe-image-selection.json """ filename = ( base_settings["unittest_data_dir"] / "imagingselection-example-multiframe-image-selection.json" ) inst = imagingselection.ImagingSelection.model_validate_json(filename.read_bytes()) assert "ImagingSelection" == inst.get_resource_type() impl_imagingselection_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ImagingSelection" == data["resourceType"] inst2 = imagingselection.ImagingSelection(**data) impl_imagingselection_2(inst2) def impl_imagingselection_3(inst): assert inst.code.text == "Segment within a DICOM Segmentation instance" assert ( inst.derivedFrom[0].identifier.system == ExternalValidatorModel.model_validate({"valueUri": "urn:dicom:uid"}).valueUri ) assert inst.derivedFrom[0].identifier.value == ( "urn:oid:1.2.840.113747.20080222.2340823325925226669316502208" "11572" ) assert ( inst.derivedFrom[0].type == ExternalValidatorModel.model_validate({"valueUri": "ImagingStudy"}).valueUri ) assert ( inst.frameOfReferenceUid == "1.2.840.113747.20080222.234082332589842666931650220811572.0" ) assert inst.id == "example-segmentation-image-selection" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate({"valueUri": "urn:dicom:uid"}).valueUri ) assert inst.identifier[0].value == ( "urn:oid:1.2.840.113747.20080222.2340823325898426669316502208" "11572.2.1" ) assert inst.instance[0].sopClass.code == "urn:oid:1.2.840.10008.5.1.4.1.1.66.4" assert ( inst.instance[0].sopClass.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.instance[0].subset[0] == "1" assert inst.instance[0].uid == ( "1.2.840.113747.20080222.234082332589846992522666220811572.1." "0" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.seriesUid == "1.2.840.113747.20080222.234082332589846992931650220811572.1" ) assert inst.status == "available" assert inst.studyUid == "1.2.840.113747.20080222.234082332589846966931650220811572" assert ( inst.subject.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "https://fhirhospital.org"} ).valueUri ) assert inst.subject.identifier.value == "ISRNEJAWJHZOTNBS" assert ( inst.subject.type == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.text.status == "generated" def test_imagingselection_3(base_settings): """No. 3 tests collection for ImagingSelection. Test File: imagingselection-example-segmentation-image-selection.json """ filename = ( base_settings["unittest_data_dir"] / "imagingselection-example-segmentation-image-selection.json" ) inst = imagingselection.ImagingSelection.model_validate_json(filename.read_bytes()) assert "ImagingSelection" == inst.get_resource_type() impl_imagingselection_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ImagingSelection" == data["resourceType"] inst2 = imagingselection.ImagingSelection(**data) impl_imagingselection_3(inst2) def impl_imagingselection_4(inst): assert inst.code.text == "Key Images" assert ( inst.derivedFrom[0].identifier.system == ExternalValidatorModel.model_validate({"valueUri": "urn:dicom:uid"}).valueUri ) assert inst.derivedFrom[0].identifier.value == ( "urn:oid:1.2.840.113747.20080222.3573835837292430627041253878" "3781" ) assert ( inst.derivedFrom[0].type == ExternalValidatorModel.model_validate({"valueUri": "ImagingStudy"}).valueUri ) assert ( inst.frameOfReferenceUid == "1.2.840.113747.20080222.35738168372924306270412538783781.0" ) assert inst.id == "example-basic-image-selection" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate({"valueUri": "urn:dicom:uid"}).valueUri ) assert inst.identifier[0].value == ( "urn:oid:1.2.840.113747.20080222.3573816737292430627041253878" "3781.2.1" ) assert inst.instance[0].sopClass.code == "urn:oid:1.2.840.10008.5.1.4.1.1.2" assert ( inst.instance[0].sopClass.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.instance[0].uid == "1.2.840.113747.20080222.35738167368358372924412538783781.1.0" ) assert inst.instance[1].sopClass.code == "urn:oid:1.2.840.10008.5.1.4.1.1.2" assert ( inst.instance[1].sopClass.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.instance[1].uid == "1.2.840.113747.20080222.35738167368358372920412538783781.1.1" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.seriesUid == "1.2.840.113747.20080222.35738167368358376270412538783781.1" ) assert inst.status == "available" assert inst.studyUid == "1.2.840.113747.20080222.35738167368354306270412538783781" assert ( inst.subject.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "https://fhirhospital.org"} ).valueUri ) assert inst.subject.identifier.value == "KUTGIQCVCDRHVBUK" assert ( inst.subject.type == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.text.status == "generated" def test_imagingselection_4(base_settings): """No. 4 tests collection for ImagingSelection. Test File: imagingselection-example-basic-image-selection.json """ filename = ( base_settings["unittest_data_dir"] / "imagingselection-example-basic-image-selection.json" ) inst = imagingselection.ImagingSelection.model_validate_json(filename.read_bytes()) assert "ImagingSelection" == inst.get_resource_type() impl_imagingselection_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ImagingSelection" == data["resourceType"] inst2 = imagingselection.ImagingSelection(**data) impl_imagingselection_4(inst2) def impl_imagingselection_5(inst): assert inst.code.text == "Referenced DICOM Grayscale Softcopy Presentation State" assert ( inst.derivedFrom[0].identifier.system == ExternalValidatorModel.model_validate({"valueUri": "urn:dicom:uid"}).valueUri ) assert inst.derivedFrom[0].identifier.value == ( "urn:oid:1.2.840.113747.20080222.1041207392912890031639036314" "39818" ) assert ( inst.derivedFrom[0].type == ExternalValidatorModel.model_validate({"valueUri": "ImagingStudy"}).valueUri ) assert inst.focus[0].reference == "ImagingSelection/example-basic-image-selection" assert ( inst.frameOfReferenceUid == "1.2.840.113747.20080222.104120739293289003163903631439818.0" ) assert inst.id == "example-presentation-state-selection" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate({"valueUri": "urn:dicom:uid"}).valueUri ) assert inst.identifier[0].value == ( "urn:oid:1.2.840.113747.20080222.1041207392938361511639036314" "39818.2.1" ) assert inst.instance[0].sopClass.code == "urn:oid:1.2.840.10008.5.1.4.1.1.11.1" assert ( inst.instance[0].sopClass.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.instance[0].uid == ( "1.2.840.113747.20080222.104120739293836151289903631439818.1." "0" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.seriesUid == "1.2.840.113747.20080222.104120739293836151283903631439818.1" ) assert inst.status == "available" assert inst.studyUid == "1.2.840.113747.20080222.104120739293836153163903631439818" assert ( inst.subject.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "https://fhirhospital.org"} ).valueUri ) assert inst.subject.identifier.value == "WMQVWGBPNPQHAWCO" assert ( inst.subject.type == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.text.status == "generated" def test_imagingselection_5(base_settings): """No. 5 tests collection for ImagingSelection. Test File: imagingselection-example-presentation-state-selection.json """ filename = ( base_settings["unittest_data_dir"] / "imagingselection-example-presentation-state-selection.json" ) inst = imagingselection.ImagingSelection.model_validate_json(filename.read_bytes()) assert "ImagingSelection" == inst.get_resource_type() impl_imagingselection_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ImagingSelection" == data["resourceType"] inst2 = imagingselection.ImagingSelection(**data) impl_imagingselection_5(inst2) def impl_imagingselection_6(inst): assert inst.code.text == "Region selected from multiframe CT volume" assert ( inst.derivedFrom[0].identifier.system == ExternalValidatorModel.model_validate({"valueUri": "urn:dicom:uid"}).valueUri ) assert inst.derivedFrom[0].identifier.value == ( "urn:oid:1.2.840.113747.20080222.1899142719569233292660249885" "86343" ) assert ( inst.derivedFrom[0].type == ExternalValidatorModel.model_validate({"valueUri": "ImagingStudy"}).valueUri ) assert ( inst.frameOfReferenceUid == "1.2.840.113747.20080222.189914270656923329266024988586343.0" ) assert inst.id == "example-3d-image-region-selection" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate({"valueUri": "urn:dicom:uid"}).valueUri ) assert inst.identifier[0].value == ( "urn:oid:1.2.840.113747.20080222.1899142719348233292660249885" "86343.2.1" ) assert float(inst.instance[0].imageRegion3D[0].coordinate[0]) == float(-50.0) assert float(inst.instance[0].imageRegion3D[0].coordinate[1]) == float(-50.0) assert float(inst.instance[0].imageRegion3D[0].coordinate[2]) == float(-50.0) assert float(inst.instance[0].imageRegion3D[0].coordinate[3]) == float(50.0) assert float(inst.instance[0].imageRegion3D[0].coordinate[4]) == float(50.0) assert float(inst.instance[0].imageRegion3D[0].coordinate[5]) == float(50.0) assert float(inst.instance[0].imageRegion3D[0].coordinate[6]) == float(25.0) assert float(inst.instance[0].imageRegion3D[0].coordinate[7]) == float(-25.0) assert float(inst.instance[0].imageRegion3D[0].coordinate[8]) == float(0.0) assert float(inst.instance[0].imageRegion3D[0].coordinate[9]) == float(-25.0) assert inst.instance[0].imageRegion3D[0].regionType == "ellipse" assert inst.instance[0].sopClass.code == "urn:oid:1.2.840.10008.5.1.4.1.1.2.1" assert ( inst.instance[0].sopClass.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.instance[0].uid == ( "1.2.840.113747.20080222.189914271934870656923024988586343.1." "0" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.seriesUid == "1.2.840.113747.20080222.189914271934870659266024988586343.1" ) assert inst.status == "available" assert inst.studyUid == "1.2.840.113747.20080222.189914271934870656966024988586343" assert ( inst.subject.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "https://fhirhospital.org"} ).valueUri ) assert inst.subject.identifier.value == "PNWYPXNBXMPGMTWX" assert ( inst.subject.type == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.text.status == "generated" def test_imagingselection_6(base_settings): """No. 6 tests collection for ImagingSelection. Test File: imagingselection-example-3d-image-region-selection.json """ filename = ( base_settings["unittest_data_dir"] / "imagingselection-example-3d-image-region-selection.json" ) inst = imagingselection.ImagingSelection.model_validate_json(filename.read_bytes()) assert "ImagingSelection" == inst.get_resource_type() impl_imagingselection_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ImagingSelection" == data["resourceType"] inst2 = imagingselection.ImagingSelection(**data) impl_imagingselection_6(inst2) def impl_imagingselection_7(inst): assert inst.code.text == "Region selected from image" assert ( inst.derivedFrom[0].identifier.system == ExternalValidatorModel.model_validate({"valueUri": "urn:dicom:uid"}).valueUri ) assert ( inst.derivedFrom[0].identifier.value == "1.2.840.113747.20080222.324856729726954657132726086516575" ) assert ( inst.derivedFrom[0].type == ExternalValidatorModel.model_validate({"valueUri": "ImagingStudy"}).valueUri ) assert ( inst.frameOfReferenceUid == "1.2.840.113747.20080222.324856823100954657132726086516575.0" ) assert inst.id == "example-2d-image-region-selection" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate({"valueUri": "urn:dicom:uid"}).valueUri ) assert inst.identifier[0].value == ( "urn:oid:1.2.840.113747.20080222.3248567223100954657132726086" "516575.2.1" ) assert float(inst.instance[0].imageRegion2D[0].coordinate[0]) == float(0.25) assert float(inst.instance[0].imageRegion2D[0].coordinate[1]) == float(0.25) assert float(inst.instance[0].imageRegion2D[0].coordinate[2]) == float(0.75) assert float(inst.instance[0].imageRegion2D[0].coordinate[3]) == float(0.25) assert float(inst.instance[0].imageRegion2D[0].coordinate[4]) == float(0.75) assert float(inst.instance[0].imageRegion2D[0].coordinate[5]) == float(0.75) assert float(inst.instance[0].imageRegion2D[0].coordinate[6]) == float(0.25) assert float(inst.instance[0].imageRegion2D[0].coordinate[7]) == float(0.75) assert inst.instance[0].imageRegion2D[0].regionType == "polyline" assert inst.instance[0].sopClass.code == "urn:oid:1.2.840.10008.5.1.4.1.1.2" assert ( inst.instance[0].sopClass.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.instance[0].uid == ( "1.2.840.113747.20080222.324856729726823100132726086516575.1." "0" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.seriesUid == "1.2.840.113747.20080222.324856729726954657132726086516575.1" ) assert inst.status == "available" assert inst.studyUid == "1.2.840.113747.20080222.324856729726854657132726086516575" assert ( inst.subject.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "https://fhirhospital.org"} ).valueUri ) assert inst.subject.identifier.value == "NTCGFHHKYUYKDPQX" assert ( inst.subject.type == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.text.status == "generated" def test_imagingselection_7(base_settings): """No. 7 tests collection for ImagingSelection. Test File: imagingselection-example-2d-image-region-selection.json """ filename = ( base_settings["unittest_data_dir"] / "imagingselection-example-2d-image-region-selection.json" ) inst = imagingselection.ImagingSelection.model_validate_json(filename.read_bytes()) assert "ImagingSelection" == inst.get_resource_type() impl_imagingselection_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ImagingSelection" == data["resourceType"] inst2 = imagingselection.ImagingSelection(**data) impl_imagingselection_7(inst2) ================================================ FILE: fhir/resources/tests/test_imagingstudy.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ImagingStudy Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import imagingstudy from .conftest import ExternalValidatorModel def impl_imagingstudy_1(inst): assert ( inst.basedOn[0].identifier.assigner.reference == "Organization/dicom-organization" ) assert inst.basedOn[0].identifier.type.coding[0].code == "ACSN" assert ( inst.basedOn[0].identifier.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.basedOn[0].identifier.value == "W12342398" assert ( inst.basedOn[0].type == ExternalValidatorModel.model_validate( {"valueUri": "ServiceRequest"} ).valueUri ) assert inst.basedOn[1].reference == "ServiceRequest/example" assert inst.encounter.reference == "Encounter/example" assert inst.endpoint[0].reference == "Endpoint/example-wadors" assert inst.id == "example-xr" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate({"valueUri": "urn:dicom:uid"}).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == ( "urn:oid:2.16.124.113543.6003.1154777499.30246.19789.35034300" "46" ) assert inst.identifier[1].assigner.reference == "Organization/dicom-organization" assert inst.identifier[1].use == "secondary" assert inst.identifier[1].value == "55551234" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.modality[0].coding[0].code == "DX" assert ( inst.modality[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.note[0].text == "XR Wrist 3+ Views" assert inst.numberOfInstances == 2 assert inst.numberOfSeries == 1 assert inst.procedure[0].reference.reference == "Procedure/example" assert inst.procedure[1].concept.coding[0].code == "RPID2589" assert inst.procedure[1].concept.coding[0].display == "XR Wrist 3+ Views" assert ( inst.procedure[1].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.radlex.org"} ).valueUri ) assert inst.procedure[1].concept.text == "XR Wrist 3+ Views" assert inst.reason[0].concept.coding[0].code == "357009" assert ( inst.reason[0].concept.coding[0].display == "Closed fracture of trapezoidal bone of wrist" ) assert ( inst.reason[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.referrer.reference == "Practitioner/example" assert inst.series[0].bodySite.concept.coding[0].code == "T-15460" assert inst.series[0].bodySite.concept.coding[0].display == "Wrist Joint" assert ( inst.series[0].bodySite.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.series[0].description == "XR Wrist 3+ Views" assert inst.series[0].endpoint[0].reference == "Endpoint/example-wadors" assert inst.series[0].instance[0].number == 1 assert ( inst.series[0].instance[0].sopClass.code == "urn:oid:1.2.840.10008.5.1.4.1.1.2" ) assert ( inst.series[0].instance[0].sopClass.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.series[0].instance[0].title == "PA VIEW" assert ( inst.series[0].instance[0].uid == "2.16.124.113543.6003.1154777499.30246.19789.3503430045.1.1" ) assert inst.series[0].instance[1].number == 2 assert ( inst.series[0].instance[1].sopClass.code == "urn:oid:1.2.840.10008.5.1.4.1.1.2" ) assert ( inst.series[0].instance[1].sopClass.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.series[0].instance[1].title == "LL VIEW" assert ( inst.series[0].instance[1].uid == "2.16.124.113543.6003.1154777499.30246.19789.3503430045.1.2" ) assert inst.series[0].laterality.coding[0].code == "419161000" assert inst.series[0].laterality.coding[0].display == "Unilateral left" assert ( inst.series[0].laterality.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.series[0].modality.coding[0].code == "DX" assert ( inst.series[0].modality.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.series[0].number == 3 assert inst.series[0].numberOfInstances == 2 assert inst.series[0].performer[0].actor.reference == "Practitioner/example" assert inst.series[0].performer[0].function.coding[0].code == "PRF" assert ( inst.series[0].performer[0].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert ( inst.series[0].started == ExternalValidatorModel.model_validate( {"valueDateTime": "2011-01-01T11:01:20+03:00"} ).valueDateTime ) assert ( inst.series[0].uid == "2.16.124.113543.6003.1154777499.30246.19789.3503430045.1" ) assert ( inst.started == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-01T11:01:20+03:00"} ).valueDateTime ) assert inst.status == "available" assert inst.subject.reference == "Patient/dicom" assert inst.text.status == "generated" def test_imagingstudy_1(base_settings): """No. 1 tests collection for ImagingStudy. Test File: imagingstudy-example-xr.json """ filename = base_settings["unittest_data_dir"] / "imagingstudy-example-xr.json" inst = imagingstudy.ImagingStudy.model_validate_json(filename.read_bytes()) assert "ImagingStudy" == inst.get_resource_type() impl_imagingstudy_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ImagingStudy" == data["resourceType"] inst2 = imagingstudy.ImagingStudy(**data) impl_imagingstudy_1(inst2) def impl_imagingstudy_2(inst): assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate({"valueUri": "urn:dicom:uid"}).valueUri ) assert inst.identifier[0].value == ( "urn:oid:2.16.124.113543.6003.1154777499.30246.19789.35034300" "45" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.numberOfInstances == 1 assert inst.numberOfSeries == 1 assert inst.series[0].bodySite.concept.coding[0].code == "67734004" assert inst.series[0].bodySite.concept.coding[0].display == "Upper Trunk Structure" assert ( inst.series[0].bodySite.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.series[0].description == "CT Surview 180" assert inst.series[0].instance[0].number == 1 assert ( inst.series[0].instance[0].sopClass.code == "urn:oid:1.2.840.10008.5.1.4.1.1.2" ) assert ( inst.series[0].instance[0].sopClass.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.series[0].instance[0].uid == "2.16.124.113543.6003.189642796.63084.16748.2599092903" ) assert inst.series[0].modality.coding[0].code == "CT" assert ( inst.series[0].modality.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.series[0].number == 3 assert inst.series[0].numberOfInstances == 1 assert ( inst.series[0].uid == "2.16.124.113543.6003.2588828330.45298.17418.2723805630" ) assert ( inst.started == ExternalValidatorModel.model_validate( {"valueDateTime": "2011-01-01T11:01:20+03:00"} ).valueDateTime ) assert inst.status == "available" assert inst.subject.reference == "Patient/dicom" assert inst.text.div == ( '
CT Chest. John ' "Smith (MRN: 09236). Accession: W12342398. Performed: " "2011-01-01. 3 series, 12 images.
" ) assert inst.text.status == "generated" def test_imagingstudy_2(base_settings): """No. 2 tests collection for ImagingStudy. Test File: imagingstudy-example.json """ filename = base_settings["unittest_data_dir"] / "imagingstudy-example.json" inst = imagingstudy.ImagingStudy.model_validate_json(filename.read_bytes()) assert "ImagingStudy" == inst.get_resource_type() impl_imagingstudy_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ImagingStudy" == data["resourceType"] inst2 = imagingstudy.ImagingStudy(**data) impl_imagingstudy_2(inst2) ================================================ FILE: fhir/resources/tests/test_immunization.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Immunization Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import immunization from .conftest import ExternalValidatorModel def impl_immunization_1(inst): assert inst.administeredProduct.concept.coding[0].code == "70461-0321-03" assert ( inst.administeredProduct.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.6.69"} ).valueUri ) assert inst.administeredProduct.concept.text == ( "Flucelvax (Influenza, injectable, MDCK, preservative free, " "quadrivalent)" ) assert inst.doseQuantity.code == "mg" assert ( inst.doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.doseQuantity.value) == float(5) assert inst.encounter.reference == "Encounter/example" assert ( inst.expirationDate == ExternalValidatorModel.model_validate({"valueDate": "2015-02-15"}).valueDate ) assert inst.fundingSource.coding[0].code == "private" assert ( inst.fundingSource.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/immunization-funding-source" } ).valueUri ) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234" assert inst.isSubpotent is True assert inst.location.reference == "Location/1" assert inst.lotNumber == "AAJN11K" assert inst.manufacturer.reference.reference == "Organization/hl7" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "Notes on adminstration of vaccine" assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-10"} ).valueDateTime ) assert inst.patient.reference == "Patient/example" assert inst.performer[0].actor.reference == "Practitioner/example" assert inst.performer[0].function.coding[0].code == "OP" assert ( inst.performer[0].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0443"} ).valueUri ) assert inst.performer[1].actor.reference == "Practitioner/example" assert inst.performer[1].function.coding[0].code == "AP" assert ( inst.performer[1].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0443"} ).valueUri ) assert inst.primarySource is True assert inst.programEligibility[0].program.text == "VFC" assert inst.programEligibility[0].programStatus.coding[0].code == "uninsured" assert ( inst.programEligibility[0].programStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/immunization-program-eligibility" } ).valueUri ) assert inst.reason[0].concept.coding[0].code == "429060002" assert ( inst.reason[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.route.coding[0].code == "IM" assert inst.route.coding[0].display == "Injection, intramuscular" assert ( inst.route.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration" } ).valueUri ) assert inst.site.coding[0].code == "LA" assert inst.site.coding[0].display == "left arm" assert ( inst.site.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActSite"} ).valueUri ) assert inst.status == "completed" assert inst.text.status == "generated" assert inst.vaccineCode.coding[0].code == "FLUCEL VAX" assert ( inst.vaccineCode.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.2.36.1.2001.1005.17"} ).valueUri ) assert inst.vaccineCode.text == "Flucelvax (Influenza)" def test_immunization_1(base_settings): """No. 1 tests collection for Immunization. Test File: immunization-example.json """ filename = base_settings["unittest_data_dir"] / "immunization-example.json" inst = immunization.Immunization.model_validate_json(filename.read_bytes()) assert "Immunization" == inst.get_resource_type() impl_immunization_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Immunization" == data["resourceType"] inst2 = immunization.Immunization(**data) impl_immunization_1(inst2) def impl_immunization_2(inst): assert inst.id == "historical" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234" assert inst.informationSource.concept.coding[0].code == "record" assert ( inst.informationSource.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/immunization-origin"} ).valueUri ) assert inst.informationSource.concept.text == "Written Record" assert inst.location.reference == "Location/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "Notes on adminstration of a historical vaccine" assert inst.occurrenceString == "January 2012" assert inst.patient.reference == "Patient/example" assert inst.primarySource is False assert inst.status == "completed" assert inst.text.status == "generated" assert inst.vaccineCode.coding[0].code == "GNFLU" assert ( inst.vaccineCode.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.2.36.1.2001.1005.17"} ).valueUri ) assert inst.vaccineCode.text == "Influenza" def test_immunization_2(base_settings): """No. 2 tests collection for Immunization. Test File: immunization-example-historical.json """ filename = ( base_settings["unittest_data_dir"] / "immunization-example-historical.json" ) inst = immunization.Immunization.model_validate_json(filename.read_bytes()) assert "Immunization" == inst.get_resource_type() impl_immunization_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Immunization" == data["resourceType"] inst2 = immunization.Immunization(**data) impl_immunization_2(inst2) def impl_immunization_3(inst): assert inst.doseQuantity.code == "mg" assert ( inst.doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.doseQuantity.value) == float(5) assert inst.encounter.reference == "Encounter/example" assert ( inst.expirationDate == ExternalValidatorModel.model_validate({"valueDate": "2023-01-21"}).valueDate ) assert inst.id == "reaction" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234" assert inst.isSubpotent is False assert inst.location.reference == "Location/1" assert inst.lotNumber == "PPL909K" assert inst.manufacturer.reference.reference == "Organization/hl7" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "Notes on adminstration of vaccine" assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-09-12"} ).valueDateTime ) assert inst.patient.reference == "Patient/example" assert inst.performer[0].actor.reference == "Practitioner/example" assert inst.performer[0].function.coding[0].code == "OP" assert ( inst.performer[0].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0443"} ).valueUri ) assert inst.performer[1].actor.reference == "Practitioner/example" assert inst.performer[1].function.coding[0].code == "AP" assert ( inst.performer[1].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0443"} ).valueUri ) assert inst.primarySource is True assert ( inst.reaction[0].date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-09-12"} ).valueDateTime ) assert inst.reaction[0].manifestation.reference.reference == "Observation/example2" assert inst.reaction[0].reported is False assert inst.reason[0].reference.reference == "Observation/example" assert inst.route.coding[0].code == "IM" assert inst.route.coding[0].display == "Injection, intramuscular" assert ( inst.route.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration" } ).valueUri ) assert inst.site.coding[0].code == "LA" assert inst.site.coding[0].display == "left arm" assert ( inst.site.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActSite"} ).valueUri ) assert inst.status == "completed" assert inst.text.status == "generated" assert inst.vaccineCode.coding[0].code == "175" assert ( inst.vaccineCode.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/cvx"} ).valueUri ) assert inst.vaccineCode.text == "Rabies - IM Diploid cell culture" def test_immunization_3(base_settings): """No. 3 tests collection for Immunization. Test File: immunization-example-reaction.json """ filename = base_settings["unittest_data_dir"] / "immunization-example-reaction.json" inst = immunization.Immunization.model_validate_json(filename.read_bytes()) assert "Immunization" == inst.get_resource_type() impl_immunization_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Immunization" == data["resourceType"] inst2 = immunization.Immunization(**data) impl_immunization_3(inst2) def impl_immunization_4(inst): assert inst.doseQuantity.code == "mg" assert ( inst.doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.doseQuantity.value) == float(5) assert inst.encounter.reference == "Encounter/example" assert ( inst.expirationDate == ExternalValidatorModel.model_validate({"valueDate": "2018-12-15"}).valueDate ) assert inst.fundingSource.coding[0].code == "private" assert ( inst.fundingSource.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/immunization-funding-source" } ).valueUri ) assert inst.id == "protocol" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234" assert inst.isSubpotent is False assert inst.location.reference == "Location/1" assert inst.lotNumber == "PT123F" assert inst.manufacturer.reference.reference == "Organization/hl7" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-06-18"} ).valueDateTime ) assert inst.patient.reference == "Patient/example" assert inst.performer[0].actor.reference == "Practitioner/example" assert inst.performer[0].function.coding[0].code == "OP" assert ( inst.performer[0].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0443"} ).valueUri ) assert inst.performer[1].actor.reference == "Practitioner/example" assert inst.performer[1].function.coding[0].code == "AP" assert ( inst.performer[1].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0443"} ).valueUri ) assert inst.primarySource is True assert inst.programEligibility[0].program.text == "VFC" assert inst.programEligibility[0].programStatus.coding[0].code == "ineligible" assert ( inst.programEligibility[0].programStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/immunization-program-eligibility" } ).valueUri ) assert inst.protocolApplied[0].doseNumber == "1" assert inst.protocolApplied[0].series == "2-dose" assert inst.protocolApplied[0].targetDisease[0].coding[0].code == "40468003" assert ( inst.protocolApplied[0].targetDisease[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.protocolApplied[1].doseNumber == "2" assert inst.protocolApplied[1].series == "3-dose" assert inst.protocolApplied[1].seriesDoses == "3" assert inst.protocolApplied[1].targetDisease[0].coding[0].code == "66071002" assert ( inst.protocolApplied[1].targetDisease[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.route.coding[0].code == "IM" assert inst.route.coding[0].display == "Injection, intramuscular" assert ( inst.route.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration" } ).valueUri ) assert inst.site.coding[0].code == "LA" assert inst.site.coding[0].display == "left arm" assert ( inst.site.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActSite"} ).valueUri ) assert inst.status == "completed" assert inst.text.status == "generated" assert inst.vaccineCode.coding[0].code == "104" assert ( inst.vaccineCode.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/cvx"} ).valueUri ) assert inst.vaccineCode.text == "Twinrix (HepA/HepB)" def test_immunization_4(base_settings): """No. 4 tests collection for Immunization. Test File: immunization-example-protocol.json """ filename = base_settings["unittest_data_dir"] / "immunization-example-protocol.json" inst = immunization.Immunization.model_validate_json(filename.read_bytes()) assert "Immunization" == inst.get_resource_type() impl_immunization_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Immunization" == data["resourceType"] inst2 = immunization.Immunization(**data) impl_immunization_4(inst2) def impl_immunization_5(inst): assert inst.id == "notGiven" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-10"} ).valueDateTime ) assert inst.patient.reference == "Patient/example" assert inst.primarySource is True assert inst.status == "not-done" assert inst.statusReason.coding[0].code == "MEDPREC" assert inst.statusReason.coding[0].display == "medical precaution" assert ( inst.statusReason.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" assert inst.vaccineCode.coding[0].code == "01" assert inst.vaccineCode.coding[0].display == "DTP" assert ( inst.vaccineCode.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/cvx"} ).valueUri ) def test_immunization_5(base_settings): """No. 5 tests collection for Immunization. Test File: immunization-example-refused.json """ filename = base_settings["unittest_data_dir"] / "immunization-example-refused.json" inst = immunization.Immunization.model_validate_json(filename.read_bytes()) assert "Immunization" == inst.get_resource_type() impl_immunization_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Immunization" == data["resourceType"] inst2 = immunization.Immunization(**data) impl_immunization_5(inst2) def impl_immunization_6(inst): assert inst.doseQuantity.code == "ml" assert ( inst.doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.doseQuantity.value) == float(0.5) assert inst.encounter.reference == "Encounter/example" assert ( inst.expirationDate == ExternalValidatorModel.model_validate({"valueDate": "2015-02-28"}).valueDate ) assert inst.fundingSource.coding[0].code == "private" assert ( inst.fundingSource.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/immunization-funding-source" } ).valueUri ) assert inst.id == "subpotent" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234" assert inst.isSubpotent is True assert inst.location.reference == "Location/1" assert inst.lotNumber == "AAJN11K" assert inst.manufacturer.reference.reference == "Organization/hl7" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "Notes on adminstration of vaccine" assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.patient.reference == "Patient/example" assert inst.performer[0].actor.reference == "Practitioner/example" assert inst.performer[0].function.coding[0].code == "OP" assert ( inst.performer[0].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0443"} ).valueUri ) assert inst.performer[1].actor.reference == "Practitioner/example" assert inst.performer[1].function.coding[0].code == "AP" assert ( inst.performer[1].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0443"} ).valueUri ) assert inst.primarySource is True assert inst.programEligibility[0].program.text == "VFC" assert inst.programEligibility[0].programStatus.coding[0].code == "uninsured" assert ( inst.programEligibility[0].programStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/immunization-program-eligibility" } ).valueUri ) assert inst.route.coding[0].code == "IM" assert inst.route.coding[0].display == "Injection, intramuscular" assert ( inst.route.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration" } ).valueUri ) assert inst.site.coding[0].code == "LT" assert inst.site.coding[0].display == "left thigh" assert ( inst.site.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActSite"} ).valueUri ) assert inst.status == "completed" assert inst.subpotentReason[0].coding[0].code == "partialdose" assert ( inst.subpotentReason[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/immunization-subpotent-reason" } ).valueUri ) assert inst.text.status == "generated" assert inst.vaccineCode.coding[0].code == "GNHEP" assert ( inst.vaccineCode.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.2.36.1.2001.1005.17"} ).valueUri ) assert inst.vaccineCode.text == "Hepatitis B" def test_immunization_6(base_settings): """No. 6 tests collection for Immunization. Test File: immunization-example-subpotent.json """ filename = ( base_settings["unittest_data_dir"] / "immunization-example-subpotent.json" ) inst = immunization.Immunization.model_validate_json(filename.read_bytes()) assert "Immunization" == inst.get_resource_type() impl_immunization_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Immunization" == data["resourceType"] inst2 = immunization.Immunization(**data) impl_immunization_6(inst2) ================================================ FILE: fhir/resources/tests/test_immunizationevaluation.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ImmunizationEvaluation Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import immunizationevaluation from .conftest import ExternalValidatorModel def impl_immunizationevaluation_1(inst): assert inst.authority.reference == "Organization/hl7" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-10"} ).valueDateTime ) assert inst.doseNumber == "1" assert inst.doseStatus.coding[0].code == "valid" assert inst.doseStatus.coding[0].display == "Valid" assert ( inst.doseStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/immunization-evaluation-dose-status" } ).valueUri ) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234" assert inst.immunizationEvent.reference == "Immunization/example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert inst.series == "Vaccination Series 1" assert inst.seriesDoses == "3" assert inst.status == "completed" assert inst.targetDisease.coding[0].code == "1857005" assert ( inst.targetDisease.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.text.status == "generated" def test_immunizationevaluation_1(base_settings): """No. 1 tests collection for ImmunizationEvaluation. Test File: immunizationevaluation-example.json """ filename = ( base_settings["unittest_data_dir"] / "immunizationevaluation-example.json" ) inst = immunizationevaluation.ImmunizationEvaluation.model_validate_json( filename.read_bytes() ) assert "ImmunizationEvaluation" == inst.get_resource_type() impl_immunizationevaluation_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ImmunizationEvaluation" == data["resourceType"] inst2 = immunizationevaluation.ImmunizationEvaluation(**data) impl_immunizationevaluation_1(inst2) def impl_immunizationevaluation_2(inst): assert inst.authority.reference == "Organization/hl7" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-10"} ).valueDateTime ) assert inst.doseStatus.coding[0].code == "notvalid" assert inst.doseStatus.coding[0].display == "Not Valid" assert ( inst.doseStatus.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/immunization-evaluation-dose-status" } ).valueUri ) assert inst.doseStatusReason[0].coding[0].code == "outsideschedule" assert inst.doseStatusReason[0].coding[0].display == "Outside Schedule" assert ( inst.doseStatusReason[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/immunization-evaluation-dose-status-reason" } ).valueUri ) assert inst.id == "notValid" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234" assert inst.immunizationEvent.reference == "Immunization/example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert inst.series == "Vaccination Series 1" assert inst.status == "completed" assert inst.targetDisease.coding[0].code == "1857005" assert ( inst.targetDisease.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.text.status == "generated" def test_immunizationevaluation_2(base_settings): """No. 2 tests collection for ImmunizationEvaluation. Test File: immunizationevaluation-example-notvalid.json """ filename = ( base_settings["unittest_data_dir"] / "immunizationevaluation-example-notvalid.json" ) inst = immunizationevaluation.ImmunizationEvaluation.model_validate_json( filename.read_bytes() ) assert "ImmunizationEvaluation" == inst.get_resource_type() impl_immunizationevaluation_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ImmunizationEvaluation" == data["resourceType"] inst2 = immunizationevaluation.ImmunizationEvaluation(**data) impl_immunizationevaluation_2(inst2) ================================================ FILE: fhir/resources/tests/test_immunizationrecommendation.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import immunizationrecommendation from .conftest import ExternalValidatorModel def impl_immunizationrecommendation_1(inst): assert inst.authority.reference == "Organization/hl7" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-09T11:04:15.817-05:00"} ).valueDateTime ) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1235" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert inst.recommendation[0].dateCriterion[0].code.coding[0].code == "earliest" assert ( inst.recommendation[0].dateCriterion[0].code.coding[0].display == "Earliest Date" ) assert ( inst.recommendation[0].dateCriterion[0].code.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion" } ).valueUri ) assert ( inst.recommendation[0].dateCriterion[0].value == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-12-01T00:00:00-05:00"} ).valueDateTime ) assert inst.recommendation[0].dateCriterion[1].code.coding[0].code == "recommended" assert ( inst.recommendation[0].dateCriterion[1].code.coding[0].display == "Recommended" ) assert ( inst.recommendation[0].dateCriterion[1].code.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion" } ).valueUri ) assert ( inst.recommendation[0].dateCriterion[1].value == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-12-01T00:00:00-05:00"} ).valueDateTime ) assert inst.recommendation[0].dateCriterion[2].code.coding[0].code == "overdue" assert ( inst.recommendation[0].dateCriterion[2].code.coding[0].display == "Past Due Date" ) assert ( inst.recommendation[0].dateCriterion[2].code.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion" } ).valueUri ) assert ( inst.recommendation[0].dateCriterion[2].value == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-12-28T00:00:00-05:00"} ).valueDateTime ) assert inst.recommendation[0].description == "First sequence in protocol" assert inst.recommendation[0].doseNumber == "1" assert inst.recommendation[0].forecastStatus.text == "Not Complete" assert inst.recommendation[0].series == "Vaccination Series 1" assert inst.recommendation[0].seriesDoses == "3" assert ( inst.recommendation[0].supportingImmunization[0].reference == "Immunization/example" ) assert ( inst.recommendation[0].supportingPatientInformation[0].reference == "Observation/example" ) assert inst.recommendation[0].vaccineCode[0].coding[0].code == "14745005" assert ( inst.recommendation[0].vaccineCode[0].coding[0].display == "Hepatitis A vaccine" ) assert ( inst.recommendation[0].vaccineCode[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.text.div == ( '
Authored by ' "Joginder Madra
" ) assert inst.text.status == "generated" def test_immunizationrecommendation_1(base_settings): """No. 1 tests collection for ImmunizationRecommendation. Test File: immunizationrecommendation-example.json """ filename = ( base_settings["unittest_data_dir"] / "immunizationrecommendation-example.json" ) inst = immunizationrecommendation.ImmunizationRecommendation.model_validate_json( filename.read_bytes() ) assert "ImmunizationRecommendation" == inst.get_resource_type() impl_immunizationrecommendation_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ImmunizationRecommendation" == data["resourceType"] inst2 = immunizationrecommendation.ImmunizationRecommendation(**data) impl_immunizationrecommendation_1(inst2) def impl_immunizationrecommendation_2(inst): assert inst.authority.reference == "Organization/hl7" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-09T11:04:15.817-05:00"} ).valueDateTime ) assert inst.id == "example-target-disease" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1235" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert inst.recommendation[0].dateCriterion[0].code.coding[0].code == "30981-5" assert ( inst.recommendation[0].dateCriterion[0].code.coding[0].display == "Earliest date to give" ) assert ( inst.recommendation[0].dateCriterion[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.recommendation[0].dateCriterion[0].value == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-12-01T00:00:00-05:00"} ).valueDateTime ) assert inst.recommendation[0].dateCriterion[1].code.coding[0].code == "recommended" assert ( inst.recommendation[0].dateCriterion[1].code.coding[0].display == "Recommended" ) assert ( inst.recommendation[0].dateCriterion[1].code.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion" } ).valueUri ) assert ( inst.recommendation[0].dateCriterion[1].value == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-12-01T00:00:00-05:00"} ).valueDateTime ) assert inst.recommendation[0].dateCriterion[2].code.coding[0].code == "overdue" assert ( inst.recommendation[0].dateCriterion[2].code.coding[0].display == "Past Due Date" ) assert ( inst.recommendation[0].dateCriterion[2].code.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion" } ).valueUri ) assert ( inst.recommendation[0].dateCriterion[2].value == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-12-28T00:00:00-05:00"} ).valueDateTime ) assert inst.recommendation[0].description == "First sequence in protocol" assert inst.recommendation[0].doseNumber == "1" assert inst.recommendation[0].forecastStatus.text == "Not Complete" assert inst.recommendation[0].series == "Vaccination Series 1" assert inst.recommendation[0].seriesDoses == "3" assert ( inst.recommendation[0].supportingImmunization[0].reference == "Immunization/example" ) assert ( inst.recommendation[0].supportingPatientInformation[0].reference == "Observation/example" ) assert inst.recommendation[0].targetDisease[0].coding[0].code == "40468003" assert ( inst.recommendation[0].targetDisease[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.text.div == ( '
Authored by ' "Joginder Madra
" ) assert inst.text.status == "generated" def test_immunizationrecommendation_2(base_settings): """No. 2 tests collection for ImmunizationRecommendation. Test File: immunizationrecommendation-example-target-disease.json """ filename = ( base_settings["unittest_data_dir"] / "immunizationrecommendation-example-target-disease.json" ) inst = immunizationrecommendation.ImmunizationRecommendation.model_validate_json( filename.read_bytes() ) assert "ImmunizationRecommendation" == inst.get_resource_type() impl_immunizationrecommendation_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ImmunizationRecommendation" == data["resourceType"] inst2 = immunizationrecommendation.ImmunizationRecommendation(**data) impl_immunizationrecommendation_2(inst2) ================================================ FILE: fhir/resources/tests/test_implementationguide.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ImplementationGuide Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import implementationguide from .conftest import ExternalValidatorModel def impl_implementationguide_1(inst): assert inst.contact[0].name == "ONC" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://www.healthit.gov" assert inst.contact[1].name == "HL7" assert inst.contact[1].telecom[0].system == "url" assert inst.contact[1].telecom[0].value == "http://hl7.org/fhir" assert inst.copyright == "Published by ONC under the standard FHIR license (CC0)" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-01"} ).valueDateTime ) assert ( inst.definition.grouping[0].description == "Base package (not broken up into multiple packages)" ) assert inst.definition.grouping[0].name == "test" assert inst.definition.page.generation == "html" assert ( inst.definition.page.name == ExternalValidatorModel.model_validate( {"valueUrl": "patient-example.html"} ).valueUrl ) assert inst.definition.page.page[0].generation == "html" assert ( inst.definition.page.page[0].name == ExternalValidatorModel.model_validate({"valueUrl": "list.html"}).valueUrl ) assert inst.definition.page.page[0].title == "Value Set Page" assert inst.definition.page.title == "Example Patient Page" assert inst.definition.parameter[0].code.code == "apply" assert ( inst.definition.parameter[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/guide-parameter-code"} ).valueUri ) assert inst.definition.parameter[0].value == "version" assert ( inst.definition.resource[0].description == "A test example to show how an implementation guide works" ) assert inst.definition.resource[0].name == "Test Example" assert ( inst.definition.resource[0].profile[0] == "http://hl7.org/fhir/us/core/StructureDefinition/patient" ) assert inst.definition.resource[0].reference.reference == "Patient/test" assert inst.dependsOn[0].uri == "http://hl7.org/fhir/ImplementationGuide/uscore" assert inst.experimental is False assert inst.fhirVersion[0] == "5.0.0" assert ( inst.global_fhir[0].profile == "http://hl7.org/fhir/us/core/StructureDefinition/patient" ) assert inst.global_fhir[0].type == "Patient" assert inst.id == "example" assert inst.jurisdiction[0].coding[0].code == "US" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.license == "CC0-1.0" assert inst.manifest.image[0] == "fhir.png" assert inst.manifest.other[0] == "fhir.css" assert inst.manifest.page[0].anchor[0] == "patient-example" assert inst.manifest.page[0].anchor[1] == "tx" assert inst.manifest.page[0].anchor[2] == "uml" assert inst.manifest.page[0].name == "patient-example.html" assert inst.manifest.page[0].title == "Test Patient Example" assert ( inst.manifest.rendering == ExternalValidatorModel.model_validate( {"valueUrl": "http://hl7.org/fhir/us/daf"} ).valueUrl ) assert ( inst.manifest.resource[0].profile[0] == "http://hl7.org/fhir/us/core/StructureDefinition/patient" ) assert inst.manifest.resource[0].reference.reference == "Patient/test" assert ( inst.manifest.resource[0].relativePath == ExternalValidatorModel.model_validate( {"valueUrl": "patient-example.html"} ).valueUrl ) assert inst.name == "DataAccessFrameworkDAF" assert inst.packageId == "hl7.fhir.us.daf" assert inst.publisher == "ONC / HL7 Joint project" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Data Access Framework (DAF)" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/us/daf"} ).valueUri ) assert inst.version == "0" def test_implementationguide_1(base_settings): """No. 1 tests collection for ImplementationGuide. Test File: implementationguide-example.json """ filename = base_settings["unittest_data_dir"] / "implementationguide-example.json" inst = implementationguide.ImplementationGuide.model_validate_json( filename.read_bytes() ) assert "ImplementationGuide" == inst.get_resource_type() impl_implementationguide_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ImplementationGuide" == data["resourceType"] inst2 = implementationguide.ImplementationGuide(**data) impl_implementationguide_1(inst2) ================================================ FILE: fhir/resources/tests/test_ingredient.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Ingredient Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import ingredient from .conftest import ExternalValidatorModel def impl_ingredient_1(inst): assert inst.id == "example" assert inst.manufacturer[0].manufacturer.reference == "Organization/example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.role.coding[0].code == "ActiveBase" assert ( inst.role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/ingredientRole"} ).valueUri ) assert inst.status == "active" assert inst.substance.code.concept.coding[0].code == "Wizzohaler" assert ( inst.substance.code.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/substance"} ).valueUri ) assert inst.substance.strength[0].measurementPoint == "2cm" assert ( inst.substance.strength[0].presentationRatio.denominator.code == "{delivered dose}" ) assert ( inst.substance.strength[0].presentationRatio.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert ( inst.substance.strength[0].presentationRatio.denominator.unit == "delivered dose" ) assert float( inst.substance.strength[0].presentationRatio.denominator.value ) == float(1) assert inst.substance.strength[0].presentationRatio.numerator.code == "ug" assert ( inst.substance.strength[0].presentationRatio.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.substance.strength[0].presentationRatio.numerator.unit == "mcg" assert float(inst.substance.strength[0].presentationRatio.numerator.value) == float( 730 ) assert inst.substance.strength[1].measurementPoint == "5cm" assert ( inst.substance.strength[1].presentationRatio.denominator.code == "{delivered dose}" ) assert ( inst.substance.strength[1].presentationRatio.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert ( inst.substance.strength[1].presentationRatio.denominator.unit == "delivered dose" ) assert float( inst.substance.strength[1].presentationRatio.denominator.value ) == float(1) assert inst.substance.strength[1].presentationRatio.numerator.code == "ug" assert ( inst.substance.strength[1].presentationRatio.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.substance.strength[1].presentationRatio.numerator.unit == "mcg" assert float(inst.substance.strength[1].presentationRatio.numerator.value) == float( 460 ) assert inst.text.status == "generated" def test_ingredient_1(base_settings): """No. 1 tests collection for Ingredient. Test File: ingredient-example-strength-repeat.json """ filename = ( base_settings["unittest_data_dir"] / "ingredient-example-strength-repeat.json" ) inst = ingredient.Ingredient.model_validate_json(filename.read_bytes()) assert "Ingredient" == inst.get_resource_type() impl_ingredient_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Ingredient" == data["resourceType"] inst2 = ingredient.Ingredient(**data) impl_ingredient_1(inst2) def impl_ingredient_2(inst): assert inst.id == "example" assert inst.manufacturer[0].manufacturer.reference == "Organization/example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.role.coding[0].code == "ActiveBase" assert ( inst.role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/ingredientRole"} ).valueUri ) assert inst.status == "active" assert inst.substance.code.concept.coding[0].code == "EQUIXABAN" assert ( inst.substance.code.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/substance"} ).valueUri ) assert inst.substance.strength[0].concentrationRatio.denominator.code == "mg" assert ( inst.substance.strength[0].concentrationRatio.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.substance.strength[0].concentrationRatio.denominator.unit == "mg" assert float( inst.substance.strength[0].concentrationRatio.denominator.value ) == float(1) assert inst.substance.strength[0].concentrationRatio.numerator.code == "mg" assert ( inst.substance.strength[0].concentrationRatio.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.substance.strength[0].concentrationRatio.numerator.unit == "mg" assert float( inst.substance.strength[0].concentrationRatio.numerator.value ) == float(5) assert inst.substance.strength[0].presentationRatio.denominator.code == "{tablet}" assert ( inst.substance.strength[0].presentationRatio.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.substance.strength[0].presentationRatio.denominator.unit == "tablet" assert float( inst.substance.strength[0].presentationRatio.denominator.value ) == float(1) assert inst.substance.strength[0].presentationRatio.numerator.code == "mg" assert ( inst.substance.strength[0].presentationRatio.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.substance.strength[0].presentationRatio.numerator.unit == "mg" assert float(inst.substance.strength[0].presentationRatio.numerator.value) == float( 50 ) assert ( inst.substance.strength[0].referenceStrength[0].strengthRatio.denominator.code == "mg" ) assert ( inst.substance.strength[0].referenceStrength[0].strengthRatio.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert ( inst.substance.strength[0].referenceStrength[0].strengthRatio.denominator.unit == "mg" ) assert float( inst.substance.strength[0].referenceStrength[0].strengthRatio.denominator.value ) == float(1) assert ( inst.substance.strength[0].referenceStrength[0].strengthRatio.numerator.code == "mg" ) assert ( inst.substance.strength[0].referenceStrength[0].strengthRatio.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert ( inst.substance.strength[0].referenceStrength[0].strengthRatio.numerator.unit == "mg" ) assert float( inst.substance.strength[0].referenceStrength[0].strengthRatio.numerator.value ) == float(5.03) assert ( inst.substance.strength[0].referenceStrength[0].substance.concept.coding[0].code == "EQUIXABAN-SULPHATE" ) assert ( inst.substance.strength[0] .referenceStrength[0] .substance.concept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/substance"} ).valueUri ) assert inst.text.status == "generated" def test_ingredient_2(base_settings): """No. 2 tests collection for Ingredient. Test File: ingredient-example.json """ filename = base_settings["unittest_data_dir"] / "ingredient-example.json" inst = ingredient.Ingredient.model_validate_json(filename.read_bytes()) assert "Ingredient" == inst.get_resource_type() impl_ingredient_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Ingredient" == data["resourceType"] inst2 = ingredient.Ingredient(**data) impl_ingredient_2(inst2) ================================================ FILE: fhir/resources/tests/test_insuranceplan.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/InsurancePlan Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import insuranceplan from .conftest import ExternalValidatorModel def impl_insuranceplan_1(inst): assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "foo" assert inst.text.status == "generated" def test_insuranceplan_1(base_settings): """No. 1 tests collection for InsurancePlan. Test File: insuranceplan-example.json """ filename = base_settings["unittest_data_dir"] / "insuranceplan-example.json" inst = insuranceplan.InsurancePlan.model_validate_json(filename.read_bytes()) assert "InsurancePlan" == inst.get_resource_type() impl_insuranceplan_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "InsurancePlan" == data["resourceType"] inst2 = insuranceplan.InsurancePlan(**data) impl_insuranceplan_1(inst2) ================================================ FILE: fhir/resources/tests/test_inventoryitem.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/InventoryItem Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import inventoryitem from .conftest import ExternalValidatorModel def impl_inventoryitem_1(inst): assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "active" assert inst.text.status == "generated" def test_inventoryitem_1(base_settings): """No. 1 tests collection for InventoryItem. Test File: inventoryitem-example.json """ filename = base_settings["unittest_data_dir"] / "inventoryitem-example.json" inst = inventoryitem.InventoryItem.model_validate_json(filename.read_bytes()) assert "InventoryItem" == inst.get_resource_type() impl_inventoryitem_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "InventoryItem" == data["resourceType"] inst2 = inventoryitem.InventoryItem(**data) impl_inventoryitem_1(inst2) ================================================ FILE: fhir/resources/tests/test_inventoryreport.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/InventoryReport Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import inventoryreport from .conftest import ExternalValidatorModel def impl_inventoryreport_1(inst): assert inst.countType == "snapshot" assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.reportedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2020-09-22"} ).valueDateTime ) assert inst.status == "draft" assert inst.text.status == "generated" def test_inventoryreport_1(base_settings): """No. 1 tests collection for InventoryReport. Test File: inventoryreport-example.json """ filename = base_settings["unittest_data_dir"] / "inventoryreport-example.json" inst = inventoryreport.InventoryReport.model_validate_json(filename.read_bytes()) assert "InventoryReport" == inst.get_resource_type() impl_inventoryreport_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "InventoryReport" == data["resourceType"] inst2 = inventoryreport.InventoryReport(**data) impl_inventoryreport_1(inst2) ================================================ FILE: fhir/resources/tests/test_invoice.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Invoice Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import invoice from .conftest import ExternalValidatorModel def impl_invoice_1(inst): assert inst.account.reference == "Account/example" assert ( inst.creation == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-25T08:00:00+01:00"} ).valueDateTime ) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://myHospital.org/Invoices"} ).valueUri ) assert inst.identifier[0].value == "654321" assert ( inst.issuer.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://myhospital/NamingSystem/departments"} ).valueUri ) assert inst.issuer.identifier.value == "CARD_INTERMEDIATE_CARE" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.participant[0].actor.reference == "Practitioner/example" assert inst.participant[0].role.coding[0].code == "17561000" assert inst.participant[0].role.coding[0].display == "Cardiologist" assert ( inst.participant[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.periodDate == ExternalValidatorModel.model_validate({"valueDate": "2017-01-25"}).valueDate ) assert inst.status == "issued" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Example of ' "Invoice
" ) assert inst.text.status == "generated" assert inst.totalGross.currency == "EUR" assert float(inst.totalGross.value) == float(48) assert inst.totalNet.currency == "EUR" assert float(inst.totalNet.value) == float(40) def test_invoice_1(base_settings): """No. 1 tests collection for Invoice. Test File: invoice-example.json """ filename = base_settings["unittest_data_dir"] / "invoice-example.json" inst = invoice.Invoice.model_validate_json(filename.read_bytes()) assert "Invoice" == inst.get_resource_type() impl_invoice_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Invoice" == data["resourceType"] inst2 = invoice.Invoice(**data) impl_invoice_1(inst2) ================================================ FILE: fhir/resources/tests/test_library.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Library Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import library from .conftest import ExternalValidatorModel def impl_library_1(inst): assert inst.author[0].name == "Kensaku Kawamoto, MD, PhD, MHS" assert inst.author[1].name == "Bryn Rhodes" assert inst.author[2].name == "Floyd Eisenberg, MD, MPH" assert inst.author[3].name == "Robert McClure, MD, MPH" assert inst.content[0].contentType == "application/xml" assert ( inst.content[0].url == ExternalValidatorModel.model_validate( {"valueUrl": "elm/OMTK-modelinfo-0.1.0.xml"} ).valueUrl ) assert inst.copyright == "© CDC 2016+." assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-05-05"} ).valueDateTime ) assert inst.description == ( "Opioid Management Terminology Knowledge Base Model " "Definition for use in implementing CDC Opioid Prescribing " "Guidelines." ) assert inst.experimental is True assert inst.id == "omtk-modelinfo" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "OMTKModelInfo" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "OMTKModelInfo" assert inst.publisher == "Centers for Disease Control and Prevention (CDC)" assert inst.purpose == ( "This library defines the Opioid Management Terminology " "Knowledge Base model" ) assert inst.status == "active" assert inst.title == "OMTK Model Info" assert inst.topic[0].text == "Opioid Prescribing" assert inst.type.coding[0].code == "model-definition" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/library-type"} ).valueUri ) assert inst.usage == ( "This library is used to resolve data elements in the Opioid " "Management Terminology Knowledge Base model" ) assert inst.useContext[0].code.code == "focus" assert inst.useContext[0].code.display == "Clinical Focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "182888003" assert ( inst.useContext[0].valueCodeableConcept.coding[0].display == "Medication requested (situation)" ) assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[1].code.code == "focus" assert inst.useContext[1].code.display == "Clinical Focus" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueCodeableConcept.coding[0].code == "82423001" assert ( inst.useContext[1].valueCodeableConcept.coding[0].display == "Chronic pain (finding)" ) assert ( inst.useContext[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version == "0.1.0" def test_library_1(base_settings): """No. 1 tests collection for Library. Test File: library-omtk-modelinfo.json """ filename = base_settings["unittest_data_dir"] / "library-omtk-modelinfo.json" inst = library.Library.model_validate_json(filename.read_bytes()) assert "Library" == inst.get_resource_type() impl_library_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Library" == data["resourceType"] inst2 = library.Library(**data) impl_library_1(inst2) def impl_library_2(inst): assert inst.content[0].contentType == "text/cql" assert ( inst.content[0].url == ExternalValidatorModel.model_validate( {"valueUrl": "library-hiv-indicators-content.cql"} ).valueUrl ) assert inst.content[1].contentType == "application/elm+xml" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-08-03"} ).valueDateTime ) assert inst.description == "HIV Indicators Reporting Example" assert inst.experimental is True assert inst.id == "hiv-indicators" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.17.1" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ohie.org/Library/"} ).valueUri ) assert inst.identifier[1].value == "hiv-indicators" assert inst.name == "HIVIndicators" assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://wiki.ihe.net/index.php/Aggregate_Data_Exchange_-_HIV"} ).valueUrl ) assert inst.relatedArtifact[0].type == "derived-from" assert inst.status == "draft" assert inst.title == "HIV Indicators" assert inst.type.coding[0].code == "logic-library" assert inst.type.coding[0].display == "Logic Library" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/library-type"} ).valueUri ) assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://ohie.org/Library/hiv-indicators"} ).valueUri ) assert inst.version == "0.0.0" def test_library_2(base_settings): """No. 2 tests collection for Library. Test File: library-hiv-indicators.json """ filename = base_settings["unittest_data_dir"] / "library-hiv-indicators.json" inst = library.Library.model_validate_json(filename.read_bytes()) assert "Library" == inst.get_resource_type() impl_library_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Library" == data["resourceType"] inst2 = library.Library(**data) impl_library_2(inst2) def impl_library_3(inst): assert inst.content[0].contentType == "application/xml" assert ( inst.content[0].url == ExternalValidatorModel.model_validate( {"valueUrl": "http://cqlrepository.org/quick-modelinfo.xml"} ).valueUrl ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-07-08"} ).valueDateTime ) assert inst.description == "Model definition for the QUICK Logical Model" assert inst.id == "library-quick-model-definition" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "QUICK" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "QUICKModelDefinition" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "QUICK Model Definition" assert inst.topic[0].text == "QUICK" assert inst.type.coding[0].code == "model-definition" assert inst.version == "1.0.0" def test_library_3(base_settings): """No. 3 tests collection for Library. Test File: library-quick-model-definition.json """ filename = ( base_settings["unittest_data_dir"] / "library-quick-model-definition.json" ) inst = library.Library.model_validate_json(filename.read_bytes()) assert "Library" == inst.get_resource_type() impl_library_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Library" == data["resourceType"] inst2 = library.Library(**data) impl_library_3(inst2) def impl_library_4(inst): assert inst.author[0].name == "Kensaku Kawamoto, MD, PhD, MHS" assert inst.author[1].name == "Bryn Rhodes" assert inst.author[2].name == "Floyd Eisenberg, MD, MPH" assert inst.author[3].name == "Robert McClure, MD, MPH" assert inst.content[0].contentType == "application/elm+xml" assert inst.copyright == "© CDC 2016+." assert inst.dataRequirement[0].codeFilter[0].path == "medicationCodeableConcept" assert ( inst.dataRequirement[0].codeFilter[0].valueSet == "http://example.org/fhir/ValueSet/benzodiazepines" ) assert inst.dataRequirement[0].type == "MedicationRequest" assert inst.dataRequirement[1].codeFilter[0].path == "medicationCodeableConcept" assert inst.dataRequirement[1].codeFilter[0].valueSet == ( "http://example.org/fhir/ValueSet/opioids-abused-in-" "ambulatory-care" ) assert inst.dataRequirement[1].type == "MedicationRequest" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-03-25T13:49:09-06:00"} ).valueDateTime ) assert inst.description == ( "Opioid decision support logic to avoid prescribing opioid " "pain medication and benzodiazepines concurrently whenever " "possible." ) assert inst.experimental is False assert inst.id == "opioidcds-recommendation-11" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "OpioidCDS_REC_11" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "OpioidCDSLogicForRecommendation11" assert inst.publisher == "Centers for Disease Control and Prevention (CDC)" assert inst.purpose == ( "The purpose of this library is to determine whether opioid " "pain medication and benzodiazepines have been prescribed " "concurrently." ) assert ( inst.relatedArtifact[0].display == "CDC guideline for prescribing opioids for chronic pain" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420" } ).valueUrl ) assert inst.relatedArtifact[0].type == "documentation" assert ( inst.relatedArtifact[1].resource == "http://example.org/fhir/Library/opioidcds-common" ) assert inst.relatedArtifact[1].type == "depends-on" assert inst.status == "active" assert inst.title == "Opioid CDS Logic for recommendation #11" assert inst.topic[0].text == "Opioid Prescribing" assert inst.type.coding[0].code == "logic-library" assert inst.type.coding[0].display == "Logic Library" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/library-type"} ).valueUri ) assert inst.usage == ( "This library is used to notify the prescriber/user to avoid " "prescribing opioid pain medication and benzodiazepines " "concurrently." ) assert inst.useContext[0].code.code == "focus" assert inst.useContext[0].code.display == "Clinical Focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "182888003" assert ( inst.useContext[0].valueCodeableConcept.coding[0].display == "Medication requested (situation)" ) assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[1].code.code == "focus" assert inst.useContext[1].code.display == "Clinical Focus" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueCodeableConcept.coding[0].code == "82423001" assert ( inst.useContext[1].valueCodeableConcept.coding[0].display == "Chronic pain (finding)" ) assert ( inst.useContext[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version == "0.1.0" def test_library_4(base_settings): """No. 4 tests collection for Library. Test File: library-opioidcds-recommendation-11.json """ filename = ( base_settings["unittest_data_dir"] / "library-opioidcds-recommendation-11.json" ) inst = library.Library.model_validate_json(filename.read_bytes()) assert "Library" == inst.get_resource_type() impl_library_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Library" == data["resourceType"] inst2 = library.Library(**data) impl_library_4(inst2) def impl_library_5(inst): assert inst.author[0].name == "Kensaku Kawamoto, MD, PhD, MHS" assert inst.author[1].name == "Bryn Rhodes" assert inst.author[2].name == "Floyd Eisenberg, MD, MPH" assert inst.author[3].name == "Robert McClure, MD, MPH" assert inst.content[0].contentType == "application/elm+xml" assert inst.copyright == "© CDC 2016+." assert inst.dataRequirement[0].codeFilter[0].path == "medicationCodeableConcept" assert inst.dataRequirement[0].codeFilter[0].valueSet == ( "http://example.org/fhir/ValueSet/opioids-indicating-end-of-" "life" ) assert inst.dataRequirement[0].type == "MedicationRequest" assert inst.dataRequirement[1].codeFilter[0].path == "code" assert inst.dataRequirement[1].type == "Procedure" assert inst.dataRequirement[2].codeFilter[0].path == "code" assert inst.dataRequirement[2].type == "Procedure" assert inst.dataRequirement[3].codeFilter[0].path == "medicationCodeableConcept" assert inst.dataRequirement[3].codeFilter[0].valueSet == ( "http://example.org/fhir/ValueSet/opioids-abused-in-" "ambulatory-care" ) assert inst.dataRequirement[3].type == "MedicationRequest" assert inst.dataRequirement[4].type == "Encounter" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-03-25T13:49:09-06:00"} ).valueDateTime ) assert inst.experimental is False assert inst.id == "opioidcds-recommendation-07" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "OpioidCDS_REC_07" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "OpioidCDSLogicForRecommendation7" assert inst.publisher == "Centers for Disease Control and Prevention (CDC)" assert inst.purpose == ( "The purpose of this library is to determine whether the " "patient has been evaluated for benefits and harms within 1 " "to 4 weeks of starting opioid therapy and every 3 months or " "more subsequently." ) assert ( inst.relatedArtifact[0].display == "CDC guideline for prescribing opioids for chronic pain" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420" } ).valueUrl ) assert inst.relatedArtifact[0].type == "documentation" assert ( inst.relatedArtifact[1].resource == "http://example.org/fhir/Library/opioidcds-common" ) assert inst.relatedArtifact[1].type == "depends-on" assert inst.status == "active" assert inst.title == "Opioid CDS Logic for recommendation #7" assert inst.topic[0].text == "Opioid Prescribing" assert inst.type.coding[0].code == "logic-library" assert inst.type.coding[0].display == "Logic Library" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/library-type"} ).valueUri ) assert inst.usage == ( "This library is used to notify the prescriber/user whether " "an evaluation for benefits and harms associated with opioid " "therapy is recommended for the patient." ) assert inst.useContext[0].code.code == "focus" assert inst.useContext[0].code.display == "Clinical Focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "182888003" assert ( inst.useContext[0].valueCodeableConcept.coding[0].display == "Medication requested (situation)" ) assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[1].code.code == "focus" assert inst.useContext[1].code.display == "Clinical Focus" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueCodeableConcept.coding[0].code == "82423001" assert ( inst.useContext[1].valueCodeableConcept.coding[0].display == "Chronic pain (finding)" ) assert ( inst.useContext[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version == "0.1.0" def test_library_5(base_settings): """No. 5 tests collection for Library. Test File: library-opioidcds-recommendation-07.json """ filename = ( base_settings["unittest_data_dir"] / "library-opioidcds-recommendation-07.json" ) inst = library.Library.model_validate_json(filename.read_bytes()) assert "Library" == inst.get_resource_type() impl_library_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Library" == data["resourceType"] inst2 = library.Library(**data) impl_library_5(inst2) def impl_library_6(inst): assert inst.content[0].contentType == "application/xml" assert ( inst.content[0].url == ExternalValidatorModel.model_validate( {"valueUrl": "http://cqlrepository.org/fhirmodel-modelinfo.xml"} ).valueUrl ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-07-08"} ).valueDateTime ) assert inst.description == "Model definition for the FHIR Model" assert inst.id == "library-fhir-model-definition" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "FHIR" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "FHIRModelDefinition" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "FHIR Model Definition" assert inst.topic[0].text == "FHIR" assert inst.type.coding[0].code == "model-definition" assert inst.version == "5.0.0" def test_library_6(base_settings): """No. 6 tests collection for Library. Test File: library-fhir-model-definition.json """ filename = base_settings["unittest_data_dir"] / "library-fhir-model-definition.json" inst = library.Library.model_validate_json(filename.read_bytes()) assert "Library" == inst.get_resource_type() impl_library_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Library" == data["resourceType"] inst2 = library.Library(**data) impl_library_6(inst2) def impl_library_7(inst): assert inst.content[0].contentType == "text/cql" assert inst.content[0].title == "FHIR Helpers" assert ( inst.content[0].url == ExternalValidatorModel.model_validate( {"valueUrl": "library-fhir-helpers-content.cql"} ).valueUrl ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-11-14"} ).valueDateTime ) assert inst.description == "FHIR Helpers" assert inst.experimental is True assert inst.id == "library-fhir-helpers-predecessor" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "FHIRHelpers" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "FHIRHelpers" assert ( inst.relatedArtifact[0].resource == "http://example.org/fhir/Library/fhir-model-definition" ) assert inst.relatedArtifact[0].type == "depends-on" assert ( inst.relatedArtifact[1].resource == "http://example.org/fhir/Library/library-fhir-helpers" ) assert inst.relatedArtifact[1].type == "successor" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "FHIR Helpers" assert inst.topic[0].text == "FHIR Helpers" assert inst.type.coding[0].code == "logic-library" assert inst.version == "1.6" def test_library_7(base_settings): """No. 7 tests collection for Library. Test File: library-predecessor-example.json """ filename = base_settings["unittest_data_dir"] / "library-predecessor-example.json" inst = library.Library.model_validate_json(filename.read_bytes()) assert "Library" == inst.get_resource_type() impl_library_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Library" == data["resourceType"] inst2 = library.Library(**data) impl_library_7(inst2) def impl_library_8(inst): assert inst.author[0].name == "Kensaku Kawamoto, MD, PhD, MHS" assert inst.author[1].name == "Bryn Rhodes" assert inst.author[2].name == "Floyd Eisenberg, MD, MPH" assert inst.author[3].name == "Robert McClure, MD, MPH" assert inst.content[0].contentType == "application/elm+xml" assert inst.copyright == "© CDC 2016+." assert inst.dataRequirement[0].codeFilter[0].path == "medicationCodeableConcept" assert inst.dataRequirement[0].codeFilter[0].valueSet == ( "http://example.org/fhir/ValueSet/opioids-indicating-end-of-" "life" ) assert inst.dataRequirement[0].type == "MedicationRequest" assert inst.dataRequirement[1].codeFilter[0].path == "medicationCodeableConcept" assert inst.dataRequirement[1].codeFilter[0].valueSet == ( "http://example.org/fhir/ValueSet/opioids-abused-in-" "ambulatory-care" ) assert inst.dataRequirement[1].type == "MedicationRequest" assert inst.dataRequirement[2].codeFilter[0].path == "combo-code" assert inst.dataRequirement[2].codeFilter[0].valueSet == ( "http://example.org/fhir/ValueSet/illicit-drug-urine-" "screening" ) assert inst.dataRequirement[2].type == "Observation" assert inst.dataRequirement[3].codeFilter[0].path == "combo-code" assert ( inst.dataRequirement[3].codeFilter[0].valueSet == "http://example.org/fhir/ValueSet/opioid-urine-screening" ) assert inst.dataRequirement[3].type == "Observation" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-03-25T13:49:09-06:00"} ).valueDateTime ) assert inst.description == ( "Opioid decision support logic to evaluate whether the " "patient has had a urine screening in the past 12 months and " "provide analysis." ) assert inst.experimental is False assert inst.id == "opioidcds-recommendation-10" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "OpioidCDS_REC_10" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "OpioidCDSLogicForRecommendation10" assert inst.publisher == "Centers for Disease Control and Prevention (CDC)" assert ( inst.relatedArtifact[0].display == "CDC guideline for prescribing opioids for chronic pain" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420" } ).valueUrl ) assert inst.relatedArtifact[0].type == "documentation" assert ( inst.relatedArtifact[1].resource == "http://example.org/fhir/Library/opioidcds-common" ) assert inst.relatedArtifact[1].type == "depends-on" assert inst.status == "active" assert inst.title == "Opioid CDS Logic for recommendation #10" assert inst.topic[0].text == "Opioid Prescribing" assert inst.type.coding[0].code == "logic-library" assert inst.type.coding[0].display == "Logic Library" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/library-type"} ).valueUri ) assert inst.usage == ( "This library is used to notify the prescriber/user whether " "the patient has had a urine screening in the past 12 months " "and to provide analysis if true." ) assert inst.useContext[0].code.code == "focus" assert inst.useContext[0].code.display == "Clinical Focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "182888003" assert ( inst.useContext[0].valueCodeableConcept.coding[0].display == "Medication requested (situation)" ) assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[1].code.code == "focus" assert inst.useContext[1].code.display == "Clinical Focus" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueCodeableConcept.coding[0].code == "82423001" assert ( inst.useContext[1].valueCodeableConcept.coding[0].display == "Chronic pain (finding)" ) assert ( inst.useContext[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version == "0.1.0" def test_library_8(base_settings): """No. 8 tests collection for Library. Test File: library-opioidcds-recommendation-10.json """ filename = ( base_settings["unittest_data_dir"] / "library-opioidcds-recommendation-10.json" ) inst = library.Library.model_validate_json(filename.read_bytes()) assert "Library" == inst.get_resource_type() impl_library_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Library" == data["resourceType"] inst2 = library.Library(**data) impl_library_8(inst2) def impl_library_9(inst): assert inst.content[0].contentType == "text/cql" assert inst.content[1].contentType == "application/elm+xml" assert inst.dataRequirement[0].type == "Patient" assert inst.dataRequirement[1].codeFilter[0].code[0].code == "diagnosis" assert inst.dataRequirement[1].codeFilter[0].path == "category" assert inst.dataRequirement[1].codeFilter[1].code[0].code == "confirmed" assert inst.dataRequirement[1].codeFilter[1].path == "clinicalStatus" assert inst.dataRequirement[1].codeFilter[2].path == "code" assert ( inst.dataRequirement[1].codeFilter[2].valueSet == "urn:oid:2.16.840.1.113883.3.464.1003.102.12.1011" ) assert inst.dataRequirement[1].type == "Condition" assert inst.dataRequirement[2].codeFilter[0].code[0].code == "diagnosis" assert inst.dataRequirement[2].codeFilter[0].path == "category" assert inst.dataRequirement[2].codeFilter[1].code[0].code == "confirmed" assert inst.dataRequirement[2].codeFilter[1].path == "clinicalStatus" assert inst.dataRequirement[2].codeFilter[2].path == "code" assert ( inst.dataRequirement[2].codeFilter[2].valueSet == "urn:oid:2.16.840.1.113883.3.464.1003.102.12.1012" ) assert inst.dataRequirement[2].type == "Condition" assert inst.dataRequirement[3].codeFilter[0].code[0].code == "finished" assert inst.dataRequirement[3].codeFilter[0].path == "status" assert inst.dataRequirement[3].codeFilter[1].code[0].code == "ambulatory" assert inst.dataRequirement[3].codeFilter[1].path == "class" assert inst.dataRequirement[3].codeFilter[2].path == "type" assert ( inst.dataRequirement[3].codeFilter[2].valueSet == "urn:oid:2.16.840.1.113883.3.464.1003.101.12.1061" ) assert inst.dataRequirement[3].type == "Encounter" assert inst.dataRequirement[4].codeFilter[0].path == "diagnosis" assert ( inst.dataRequirement[4].codeFilter[0].valueSet == "urn:oid:2.16.840.1.113883.3.464.1003.198.12.1012" ) assert inst.dataRequirement[4].type == "DiagnosticReport" assert inst.dataRequirement[5].codeFilter[0].path == "code" assert ( inst.dataRequirement[5].codeFilter[0].valueSet == "urn:oid:2.16.840.1.113883.3.464.1003.196.12.1001" ) assert inst.dataRequirement[5].type == "Medication" assert inst.dataRequirement[6].codeFilter[0].code[0].code == "active" assert inst.dataRequirement[6].codeFilter[0].path == "status" assert inst.dataRequirement[6].codeFilter[1].path == "medication.code" assert ( inst.dataRequirement[6].codeFilter[1].valueSet == "urn:oid:2.16.840.1.113883.3.464.1003.196.12.1001" ) assert inst.dataRequirement[6].type == "MedicationRequest" assert inst.dataRequirement[7].codeFilter[0].code[0].code == "completed" assert inst.dataRequirement[7].codeFilter[0].path == "status" assert inst.dataRequirement[7].codeFilter[1].path == "medication.code" assert ( inst.dataRequirement[7].codeFilter[1].valueSet == "urn:oid:2.16.840.1.113883.3.464.1003.196.12.1001" ) assert inst.dataRequirement[7].type == "MedicationStatement" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-07-22"} ).valueDateTime ) assert inst.description == ( "Logic for CMS 146: Appropriate Testing for Children with " "Pharyngitis" ) assert inst.experimental is True assert inst.id == "library-cms146-example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.17.2" assert inst.identifier[1].use == "official" assert inst.identifier[1].value == "CMS146" assert inst.name == "CMS146" assert ( inst.relatedArtifact[0].resource == "http://hl7.org/fhir/Library/library-quick-model-definition" ) assert inst.relatedArtifact[0].type == "depends-on" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "CMS146: Appropriate Testing for Children with Pharyngitis" assert inst.type.coding[0].code == "logic-library" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/Library/library-cms146-example"} ).valueUri ) assert inst.version == "5.0.0" def test_library_9(base_settings): """No. 9 tests collection for Library. Test File: library-cms146-example.json """ filename = base_settings["unittest_data_dir"] / "library-cms146-example.json" inst = library.Library.model_validate_json(filename.read_bytes()) assert "Library" == inst.get_resource_type() impl_library_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Library" == data["resourceType"] inst2 = library.Library(**data) impl_library_9(inst2) def impl_library_10(inst): assert inst.author[0].name == "Kensaku Kawamoto, MD, PhD, MHS" assert inst.author[1].name == "Bryn Rhodes" assert inst.author[2].name == "Floyd Eisenberg, MD, MPH" assert inst.author[3].name == "Robert McClure, MD, MPH" assert inst.content[0].contentType == "application/elm+xml" assert inst.copyright == "© CDC 2016+." assert inst.dataRequirement[0].codeFilter[0].code[0].code == "active" assert inst.dataRequirement[0].codeFilter[0].path == "status" assert inst.dataRequirement[0].codeFilter[1].code[0].code == "outpatient" assert ( inst.dataRequirement[0].codeFilter[1].code[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/medicationrequest-category" } ).valueUri ) assert inst.dataRequirement[0].codeFilter[1].path == "category" assert inst.dataRequirement[0].id == "medications" assert inst.dataRequirement[0].type == "MedicationRequest" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-03-25T13:49:09-06:00"} ).valueDateTime ) assert inst.description == ( "Opioid Decision Support Logic for use in implementing CDC " "Opioid Prescribing Guidelines." ) assert inst.experimental is False assert inst.id == "opioidcds-recommendation-05" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "OpioidCDS_REC_05" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "OpioidCDSLogicForRecommendation5" assert inst.publisher == "Centers for Disease Control and Prevention (CDC)" assert inst.purpose == ( "This library works in concert with the OMTK logic library to" " provide decision support for Morphine Milligram Equivalence" " calculations and dynamic value resolution." ) assert ( inst.relatedArtifact[0].display == "CDC guideline for prescribing opioids for chronic pain" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420" } ).valueUrl ) assert inst.relatedArtifact[0].type == "documentation" assert ( inst.relatedArtifact[1].resource == "http://example.org/fhir/Library/opioidcds-common" ) assert inst.relatedArtifact[1].type == "depends-on" assert inst.relatedArtifact[2].display == "MME Conversion Tables" assert ( inst.relatedArtifact[2].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf" } ).valueUrl ) assert inst.relatedArtifact[2].type == "documentation" assert inst.status == "active" assert inst.title == "Opioid CDS Logic for recommendation #5" assert inst.topic[0].text == "Opioid Prescribing" assert inst.type.coding[0].code == "logic-library" assert inst.type.coding[0].display == "Logic Library" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/library-type"} ).valueUri ) assert inst.usage == ( "This library is to notify the prescriber/user whether the " "current prescription exceeds the recommended MME." ) assert inst.useContext[0].code.code == "focus" assert inst.useContext[0].code.display == "Clinical Focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "182888003" assert ( inst.useContext[0].valueCodeableConcept.coding[0].display == "Medication requested (situation)" ) assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[1].code.code == "focus" assert inst.useContext[1].code.display == "Clinical Focus" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueCodeableConcept.coding[0].code == "82423001" assert ( inst.useContext[1].valueCodeableConcept.coding[0].display == "Chronic pain (finding)" ) assert ( inst.useContext[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version == "0.1.0" def test_library_10(base_settings): """No. 10 tests collection for Library. Test File: library-opioidcds-recommendation-05.json """ filename = ( base_settings["unittest_data_dir"] / "library-opioidcds-recommendation-05.json" ) inst = library.Library.model_validate_json(filename.read_bytes()) assert "Library" == inst.get_resource_type() impl_library_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Library" == data["resourceType"] inst2 = library.Library(**data) impl_library_10(inst2) ================================================ FILE: fhir/resources/tests/test_linkage.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Linkage Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import linkage from .conftest import ExternalValidatorModel def impl_linkage_1(inst): assert inst.author.reference == "Practitioner/f201" assert inst.id == "example" assert ( inst.item[0].resource.display == "Severe burn of left ear (Date: 24-May 2012)" ) assert inst.item[0].resource.reference == "Condition/example" assert inst.item[0].type == "source" assert ( inst.item[1].resource.display == "Severe burn of left ear (Date: 24-May 2012)" ) assert inst.item[1].resource.reference == "Condition/example-linkage" assert inst.item[1].type == "alternate" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "extensions" def test_linkage_1(base_settings): """No. 1 tests collection for Linkage. Test File: linkage-example.json """ filename = base_settings["unittest_data_dir"] / "linkage-example.json" inst = linkage.Linkage.model_validate_json(filename.read_bytes()) assert "Linkage" == inst.get_resource_type() impl_linkage_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Linkage" == data["resourceType"] inst2 = linkage.Linkage(**data) impl_linkage_1(inst2) ================================================ FILE: fhir/resources/tests/test_list.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/List Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import list from .conftest import ExternalValidatorModel def impl_list_1(inst): assert inst.code.coding[0].code == "182836005" assert inst.code.coding[0].display == "Review of medication" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Medication Review" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-11-20T23:10:23+11:00"} ).valueDateTime ) assert inst.entry[0].flag.coding[0].code == "01" assert inst.entry[0].flag.coding[0].display == "Prescribed" assert ( inst.entry[0].flag.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://nehta.gov.au/codes/medications/changetype"} ).valueUri ) assert inst.entry[0].item.display == "hydroxocobalamin" assert inst.entry[1].deleted is True assert inst.entry[1].flag.coding[0].code == "02" assert inst.entry[1].flag.coding[0].display == "Cancelled" assert ( inst.entry[1].flag.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://nehta.gov.au/codes/medications/changetype"} ).valueUri ) assert inst.entry[1].item.display == "Morphine Sulfate" assert inst.id == "med-list" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "changes" assert inst.source.reference == "Patient/example" assert inst.status == "current" assert inst.text.status == "generated" def test_list_1(base_settings): """No. 1 tests collection for List. Test File: list-example-medlist.json """ filename = base_settings["unittest_data_dir"] / "list-example-medlist.json" inst = list.List.model_validate_json(filename.read_bytes()) assert "List" == inst.get_resource_type() impl_list_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "List" == data["resourceType"] inst2 = list.List(**data) impl_list_1(inst2) def impl_list_2(inst): assert inst.code.text == "History and Physical" assert inst.contained[0].id == "a1" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2004-12-25T23:50:50-05:00"} ).valueDateTime ) assert inst.entry[0].item.reference == "DocumentReference/example" assert inst.id == "example-xds" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/documents"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "master" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/fhir/CodeSystem/identifier-type"} ).valueUri ) assert inst.identifier[0].value == "23425234234-2346" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/documents"} ).valueUri ) assert inst.identifier[1].type.coding[0].code == "set" assert ( inst.identifier[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/fhir/CodeSystem/identifier-type"} ).valueUri ) assert inst.identifier[1].value == "23425234234-2347" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "working" assert inst.source.reference == "#a1" assert inst.status == "current" assert inst.subject[0].reference == "Patient/xcda" assert inst.text.status == "generated" assert inst.title == "Physical" def test_list_2(base_settings): """No. 2 tests collection for List. Test File: list-example-xds.json """ filename = base_settings["unittest_data_dir"] / "list-example-xds.json" inst = list.List.model_validate_json(filename.read_bytes()) assert "List" == inst.get_resource_type() impl_list_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "List" == data["resourceType"] inst2 = list.List(**data) impl_list_2(inst2) def impl_list_3(inst): assert inst.code.coding[0].code == "8670-2" assert inst.code.coding[0].display == "History of family member diseases" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.contained[0].id == "image" assert inst.contained[1].id == "1" assert inst.contained[2].id == "2" assert inst.contained[3].id == "3" assert inst.contained[4].id == "4" assert inst.contained[5].id == "5" assert inst.contained[6].id == "6" assert inst.contained[7].id == "7" assert inst.contained[8].id == "8" assert inst.contained[9].id == "9" assert inst.entry[0].item.reference == "#image" assert inst.entry[1].item.reference == "#2" assert inst.entry[2].item.reference == "#3" assert inst.entry[3].item.reference == "#4" assert inst.entry[4].item.reference == "#5" assert inst.entry[5].item.reference == "#6" assert inst.entry[6].item.reference == "#7" assert inst.entry[7].item.reference == "#8" assert inst.entry[8].item.reference == "#9" assert inst.entry[9].item.reference == "#10" assert inst.id == "prognosis" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "snapshot" assert inst.status == "current" assert inst.subject[0].display == "Annie Proband, female, born 1966" assert inst.subject[0].reference == "Patient/proband" assert inst.text.status == "generated" def test_list_3(base_settings): """No. 3 tests collection for List. Test File: list-example-familyhistory-genetics-profile-annie.json """ filename = ( base_settings["unittest_data_dir"] / "list-example-familyhistory-genetics-profile-annie.json" ) inst = list.List.model_validate_json(filename.read_bytes()) assert "List" == inst.get_resource_type() impl_list_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "List" == data["resourceType"] inst2 = list.List(**data) impl_list_3(inst2) def impl_list_4(inst): assert inst.code.coding[0].code == "346638" assert inst.code.coding[0].display == "Patient Admission List" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.com/list-codes"} ).valueUri ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-07-14T11:54:05+10:00"} ).valueDateTime ) assert inst.id == "example-simple-empty" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "snapshot" assert inst.status == "current" assert inst.text.status == "generated" def test_list_4(base_settings): """No. 4 tests collection for List. Test File: list-example-simple-empty.json """ filename = base_settings["unittest_data_dir"] / "list-example-simple-empty.json" inst = list.List.model_validate_json(filename.read_bytes()) assert "List" == inst.get_resource_type() impl_list_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "List" == data["resourceType"] inst2 = list.List(**data) impl_list_4(inst2) def impl_list_5(inst): assert inst.code.coding[0].code == "182836005" assert inst.code.coding[0].display == "Review of medication" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Medication Review" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-11-26T07:30:23+11:00"} ).valueDateTime ) assert inst.emptyReason.coding[0].code == "nilknown" assert inst.emptyReason.coding[0].display == "Nil Known" assert ( inst.emptyReason.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/list-empty-reason"} ).valueUri ) assert inst.emptyReason.text == "The patient is not on any medications" assert inst.id == "example-empty" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "snapshot" assert inst.source.reference == "Patient/example" assert inst.status == "current" assert inst.text.status == "generated" def test_list_5(base_settings): """No. 5 tests collection for List. Test File: list-example-empty.json """ filename = base_settings["unittest_data_dir"] / "list-example-empty.json" inst = list.List.model_validate_json(filename.read_bytes()) assert "List" == inst.get_resource_type() impl_list_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "List" == data["resourceType"] inst2 = list.List(**data) impl_list_5(inst2) def impl_list_6(inst): assert inst.code.coding[0].code == "8670-2" assert inst.code.coding[0].display == "History of family member diseases" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.contained[0].id == "1" assert inst.contained[1].id == "2" assert inst.contained[2].id == "3" assert inst.contained[3].id == "4" assert inst.contained[4].id == "5" assert inst.contained[5].id == "6" assert inst.contained[6].id == "7" assert inst.contained[7].id == "8" assert inst.entry[0].item.reference == "#1" assert inst.entry[1].item.reference == "#2" assert inst.entry[2].item.reference == "#3" assert inst.entry[3].item.reference == "#4" assert inst.entry[4].item.reference == "#5" assert inst.entry[5].item.reference == "#6" assert inst.entry[6].item.reference == "#7" assert inst.entry[7].item.reference == "#8" assert inst.entry[8].item.display == "Family history of cancer of colon" assert inst.entry[8].item.reference == "Condition/family-history" assert inst.id == "genetic" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "snapshot" assert inst.status == "current" assert inst.subject[0].display == "Peter Patient" assert inst.subject[0].reference == "Patient/example" assert inst.text.status == "generated" def test_list_6(base_settings): """No. 6 tests collection for List. Test File: list-example-familyhistory-genetics-profile.json """ filename = ( base_settings["unittest_data_dir"] / "list-example-familyhistory-genetics-profile.json" ) inst = list.List.model_validate_json(filename.read_bytes()) assert "List" == inst.get_resource_type() impl_list_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "List" == data["resourceType"] inst2 = list.List(**data) impl_list_6(inst2) def impl_list_7(inst): assert inst.code.coding[0].code == "8670-2" assert inst.code.coding[0].display == "History of family member diseases" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.contained[0].id == "fmh-1" assert inst.contained[1].id == "fmh-2" assert inst.entry[0].item.reference == "#fmh-1" assert inst.entry[1].item.reference == "#fmh-2" assert inst.id == "f201" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "snapshot" assert inst.note[0].text == ( "Both parents, both brothers and both children (twin) are " "still alive." ) assert inst.status == "current" assert inst.subject[0].display == "Roel" assert inst.subject[0].reference == "Patient/f201" assert inst.text.status == "generated" def test_list_7(base_settings): """No. 7 tests collection for List. Test File: list-example-familyhistory-f201-roel.json """ filename = ( base_settings["unittest_data_dir"] / "list-example-familyhistory-f201-roel.json" ) inst = list.List.model_validate_json(filename.read_bytes()) assert "List" == inst.get_resource_type() impl_list_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "List" == data["resourceType"] inst2 = list.List(**data) impl_list_7(inst2) def impl_list_8(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-11-25T22:17:00+11:00"} ).valueDateTime ) assert inst.encounter.reference == "Encounter/example" assert inst.entry[0].deleted is True assert inst.entry[0].flag.text == "Deleted due to error" assert inst.entry[0].item.reference == "Condition/example" assert inst.entry[1].flag.text == "Added" assert inst.entry[1].item.reference == "Condition/example2" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:uuid:a9fcea7c-fcdf-4d17-a5e0-f26dda030b59"} ).valueUri ) assert inst.identifier[0].value == "23974652" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "changes" assert inst.source.reference == "Patient/example" assert inst.status == "current" assert inst.subject[0].reference == "Patient/example" assert inst.text.status == "generated" def test_list_8(base_settings): """No. 8 tests collection for List. Test File: list-example.json """ filename = base_settings["unittest_data_dir"] / "list-example.json" inst = list.List.model_validate_json(filename.read_bytes()) assert "List" == inst.get_resource_type() impl_list_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "List" == data["resourceType"] inst2 = list.List(**data) impl_list_8(inst2) def impl_list_9(inst): assert inst.code.coding[0].code == "52472-8" assert inst.code.coding[0].display == "Allergies and Adverse Drug Reactions" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.code.text == "Current Allergy List" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-07-14T23:10:23+11:00"} ).valueDateTime ) assert inst.entry[0].item.reference == "AllergyIntolerance/example" assert inst.entry[1].item.reference == "AllergyIntolerance/medication" assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/list-for"} ).valueUri ) assert inst.extension[0].valueReference.display == "Dr Adam Careful" assert inst.extension[0].valueReference.reference == "Patient/example" assert inst.id == "current-allergies" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "working" assert inst.orderedBy.coding[0].code == "entry-date" assert ( inst.orderedBy.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/list-order"} ).valueUri ) assert inst.source.reference == "Patient/example" assert inst.status == "current" assert inst.text.status == "generated" assert inst.title == "Current Allergy List" def test_list_9(base_settings): """No. 9 tests collection for List. Test File: list-example-allergies.json """ filename = base_settings["unittest_data_dir"] / "list-example-allergies.json" inst = list.List.model_validate_json(filename.read_bytes()) assert "List" == inst.get_resource_type() impl_list_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "List" == data["resourceType"] inst2 = list.List(**data) impl_list_9(inst2) def impl_list_10(inst): assert inst.code.coding[0].code == "80738-8" assert inst.code.coding[0].display == ( "TPMT gene mutations found [Identifier] in Blood or Tissue by" " Sequencing Nominal" ) assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.code.text == ( "TPMT gene mutations found [Identifier] in Blood or Tissue by" " Sequencing Nominal" ) assert inst.contained[0].id == "1" assert inst.contained[1].id == "2" assert inst.contained[2].id == "3" assert inst.contained[3].id == "4" assert inst.contained[4].id == "5" assert inst.contained[5].id == "6" assert inst.entry[0].item.reference == "#1" assert inst.entry[1].item.reference == "#2" assert inst.entry[2].item.reference == "#3" assert inst.entry[3].item.reference == "#4" assert inst.entry[4].item.reference == "#5" assert inst.entry[5].item.reference == "#6" assert inst.id == "example-double-cousin-relationship" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "snapshot" assert inst.status == "current" assert inst.subject[0].display == "Pam Taylor" assert inst.subject[0].reference == "Patient/example" assert inst.text.status == "generated" def test_list_10(base_settings): """No. 10 tests collection for List. Test File: list-example-double-cousin-relationship-pedigree.json """ filename = ( base_settings["unittest_data_dir"] / "list-example-double-cousin-relationship-pedigree.json" ) inst = list.List.model_validate_json(filename.read_bytes()) assert "List" == inst.get_resource_type() impl_list_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "List" == data["resourceType"] inst2 = list.List(**data) impl_list_10(inst2) ================================================ FILE: fhir/resources/tests/test_location.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Location Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import location from .conftest import ExternalValidatorModel def impl_location_1(inst): assert inst.address.city == "Den Burg" assert inst.address.country == "NLD" assert inst.address.line[0] == "Galapagosweg 91, Building A" assert inst.address.postalCode == "9105 PZ" assert inst.address.use == "work" assert inst.alias[0] == "BU MC, SW, F2" assert ( inst.alias[1] == "Burgers University Medical Center, South Wing, second floor" ) assert inst.characteristic[0].coding[0].code == "wheelchair" assert inst.characteristic[0].coding[0].display == "Wheelchair accessible" assert ( inst.characteristic[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/location-characteristic"} ).valueUri ) assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "2328" assert inst.contact[0].telecom[1].system == "fax" assert inst.contact[0].telecom[1].use == "work" assert inst.contact[0].telecom[1].value == "2329" assert inst.contact[0].telecom[2].system == "email" assert inst.contact[0].telecom[2].value == "second wing admissions" assert inst.contact[1].telecom[0].system == "url" assert inst.contact[1].telecom[0].use == "work" assert inst.contact[1].telecom[0].value == "http://sampleorg.com/southwing" assert inst.description == ( "Second floor of the Old South Wing, formerly in use by " "Psychiatry" ) assert inst.endpoint[0].reference == "Endpoint/example" assert inst.form.coding[0].code == "wi" assert inst.form.coding[0].display == "Wing" assert ( inst.form.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/location-physical-type"} ).valueUri ) assert inst.id == "1" assert inst.identifier[0].value == "B1-S.F2" assert inst.managingOrganization.reference == "Organization/f001" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "instance" assert inst.name == "South Wing, second floor" assert float(inst.position.altitude) == float(0) assert float(inst.position.latitude) == float(42.25475478) assert float(inst.position.longitude) == float(-83.6945691) assert inst.status == "active" assert inst.text.div == ( '
Burgers UMC, ' "South Wing, second floor
" ) assert inst.text.status == "generated" def test_location_1(base_settings): """No. 1 tests collection for Location. Test File: location-example.json """ filename = base_settings["unittest_data_dir"] / "location-example.json" inst = location.Location.model_validate_json(filename.read_bytes()) assert "Location" == inst.get_resource_type() impl_location_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Location" == data["resourceType"] inst2 = location.Location(**data) impl_location_1(inst2) def impl_location_2(inst): assert inst.alias[0] == "South Wing OR 5" assert inst.alias[1] == "Main Wing OR 2" assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].value == "2329" assert inst.description == ( "Old South Wing, Neuro Radiology Operation Room 1 on second " "floor" ) assert inst.form.coding[0].code == "ro" assert inst.form.coding[0].display == "Room" assert ( inst.form.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/location-physical-type"} ).valueUri ) assert inst.id == "2" assert inst.identifier[0].value == "B1-S.F2.1.00" assert inst.managingOrganization.reference == "Organization/f001" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "instance" assert inst.name == "South Wing Neuro OR 1" assert inst.operationalStatus.code == "H" assert inst.operationalStatus.display == "Housekeeping" assert ( inst.operationalStatus.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0116"} ).valueUri ) assert inst.partOf.reference == "Location/1" assert inst.status == "suspended" assert inst.text.div == ( '
Burgers UMC, ' "South Wing, second floor, Neuro Radiology Operation Room " "1
" ) assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "RNEU" assert inst.type[0].coding[0].display == "Neuroradiology unit" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) def test_location_2(base_settings): """No. 2 tests collection for Location. Test File: location-example-room.json """ filename = base_settings["unittest_data_dir"] / "location-example-room.json" inst = location.Location.model_validate_json(filename.read_bytes()) assert "Location" == inst.get_resource_type() impl_location_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Location" == data["resourceType"] inst2 = location.Location(**data) impl_location_2(inst2) def impl_location_3(inst): assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].use == "mobile" assert inst.contact[0].telecom[0].value == "2329" assert inst.description == "Ambulance provided by Burgers University Medical Center" assert inst.form.coding[0].code == "ve" assert inst.form.coding[0].display == "Vehicle" assert ( inst.form.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/location-physical-type"} ).valueUri ) assert inst.id == "amb" assert inst.managingOrganization.reference == "Organization/f001" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "kind" assert inst.name == "BUMC Ambulance" assert inst.status == "active" assert inst.text.div == ( '
Mobile ' "Clinic
" ) assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "AMB" assert inst.type[0].coding[0].display == "Ambulance" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) def test_location_3(base_settings): """No. 3 tests collection for Location. Test File: location-example-ambulance.json """ filename = base_settings["unittest_data_dir"] / "location-example-ambulance.json" inst = location.Location.model_validate_json(filename.read_bytes()) assert "Location" == inst.get_resource_type() impl_location_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Location" == data["resourceType"] inst2 = location.Location(**data) impl_location_3(inst2) def impl_location_4(inst): assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/location-boundary-geojson" } ).valueUri ) assert inst.extension[0].valueAttachment.contentType == "application/geo+json" # Don't know how to create unit test # for "extension[0].valueAttachment.size", # which is a Integer64 assert ( inst.extension[0].valueAttachment.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://github.com/OpenDataDE/State-zip-code-GeoJSON/raw/master/dc_district_of_columbia_zip_codes_geo.min.json" } ).valueUrl ) assert inst.form.coding[0].code == "area" assert inst.form.coding[0].display == "Area" assert ( inst.form.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/location-physical-type"} ).valueUri ) assert inst.id == "wash-dc-metro" assert inst.meta.profile[0] == ( "http://hl7.org/fhir/uv/vhdir/StructureDefinition/vhdir-" "location" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Washington, DC metro area" assert inst.status == "active" assert inst.text.status == "extensions" def test_location_4(base_settings): """No. 4 tests collection for Location. Test File: location-wash-dc-metro.json """ filename = base_settings["unittest_data_dir"] / "location-wash-dc-metro.json" inst = location.Location.model_validate_json(filename.read_bytes()) assert "Location" == inst.get_resource_type() impl_location_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Location" == data["resourceType"] inst2 = location.Location(**data) impl_location_4(inst2) def impl_location_5(inst): assert inst.description == ( "All Pharmacies in the United Kingdom covered by the National" " Pharmacy Association" ) assert inst.form.coding[0].code == "jdn" assert inst.form.coding[0].display == "Jurisdiction" assert ( inst.form.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/location-physical-type"} ).valueUri ) assert inst.id == "ukp" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "kind" assert inst.name == "UK Pharmacies" assert inst.status == "active" assert inst.text.div == ( '
UK ' "Pharmacies
" ) assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "PHARM" assert inst.type[0].coding[0].display == "Pharmacy" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) def test_location_5(base_settings): """No. 5 tests collection for Location. Test File: location-example-ukpharmacy.json """ filename = base_settings["unittest_data_dir"] / "location-example-ukpharmacy.json" inst = location.Location.model_validate_json(filename.read_bytes()) assert "Location" == inst.get_resource_type() impl_location_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Location" == data["resourceType"] inst2 = location.Location(**data) impl_location_5(inst2) def impl_location_6(inst): assert inst.description == "Patient's Home" assert inst.form.coding[0].code == "ho" assert inst.form.coding[0].display == "House" assert ( inst.form.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/location-physical-type"} ).valueUri ) assert inst.id == "ph" assert inst.managingOrganization.reference == "Organization/f001" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "kind" assert inst.name == "Patient's Home" assert inst.status == "active" assert inst.text.div == ( '
Patient\'s ' "Home
" ) assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "PTRES" assert inst.type[0].coding[0].display == "Patient's Residence" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) def test_location_6(base_settings): """No. 6 tests collection for Location. Test File: location-example-patients-home.json """ filename = ( base_settings["unittest_data_dir"] / "location-example-patients-home.json" ) inst = location.Location.model_validate_json(filename.read_bytes()) assert "Location" == inst.get_resource_type() impl_location_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Location" == data["resourceType"] inst2 = location.Location(**data) impl_location_6(inst2) def impl_location_7(inst): assert inst.address.city == "Ann Arbor" assert inst.address.country == "USA" assert inst.address.line[0] == "3300 Washtenaw Avenue, Suite 227" assert inst.address.postalCode == "48104" assert inst.address.state == "MI" assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].value == "(+1) 734-677-7777" assert inst.contact[0].telecom[1].system == "fax" assert inst.contact[0].telecom[1].value == "(+1) 734-677-6622" assert inst.contact[0].telecom[2].system == "email" assert inst.contact[0].telecom[2].value == "hq@HL7.org" assert inst.description == "HL7 Headquarters" assert inst.form.coding[0].code == "bu" assert inst.form.coding[0].display == "Building" assert ( inst.form.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/location-physical-type"} ).valueUri ) assert inst.id == "hl7" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.mode == "instance" assert inst.name == "Health Level Seven International" assert float(inst.position.latitude) == float(-83.69471) assert float(inst.position.longitude) == float(42.2565) assert inst.status == "active" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "SLEEP" assert inst.type[0].coding[0].display == "Sleep disorders unit" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) def test_location_7(base_settings): """No. 7 tests collection for Location. Test File: location-example-hl7hq.json """ filename = base_settings["unittest_data_dir"] / "location-example-hl7hq.json" inst = location.Location.model_validate_json(filename.read_bytes()) assert "Location" == inst.get_resource_type() impl_location_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Location" == data["resourceType"] inst2 = location.Location(**data) impl_location_7(inst2) ================================================ FILE: fhir/resources/tests/test_manufactureditemdefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ManufacturedItemDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import manufactureditemdefinition from .conftest import ExternalValidatorModel def impl_manufactureditemdefinition_1(inst): assert inst.id == "example" assert inst.manufacturedDoseForm.coding[0].code == "Film-coatedtablet" assert ( inst.manufacturedDoseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/manufactureddoseform"} ).valueUri ) assert inst.manufacturer[0].reference == "Organization/example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.property[0].type.coding[0].code == "shape" assert inst.property[0].valueCodeableConcept.text == "Oval" assert inst.property[1].type.coding[0].code == "color" assert inst.property[1].valueCodeableConcept.text == "pink" assert inst.property[2].type.coding[0].code == "imprint" assert inst.property[2].valueCodeableConcept.text == "894" assert inst.status == "active" assert inst.text.status == "generated" assert inst.unitOfPresentation.coding[0].code == "Tablet" assert ( inst.unitOfPresentation.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/unitofpresentation"} ).valueUri ) def test_manufactureditemdefinition_1(base_settings): """No. 1 tests collection for ManufacturedItemDefinition. Test File: manufactureditemdefinition-example.json """ filename = ( base_settings["unittest_data_dir"] / "manufactureditemdefinition-example.json" ) inst = manufactureditemdefinition.ManufacturedItemDefinition.model_validate_json( filename.read_bytes() ) assert "ManufacturedItemDefinition" == inst.get_resource_type() impl_manufactureditemdefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ManufacturedItemDefinition" == data["resourceType"] inst2 = manufactureditemdefinition.ManufacturedItemDefinition(**data) impl_manufactureditemdefinition_1(inst2) ================================================ FILE: fhir/resources/tests/test_measure.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Measure Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import measure from .conftest import ExternalValidatorModel def impl_measure_1(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-03-08"} ).valueDateTime ) assert inst.description == ( "Exclusive breastfeeding measure of outcomes for exclusive " "breastmilk feeding of newborns." ) assert inst.group[0].id == "PopulationGroup1" assert inst.group[0].population[0].code.coding[0].code == "initial-population" assert inst.group[0].population[0].criteria.expression == "InitialPopulation1" assert inst.group[0].population[0].criteria.language == "text/cql" assert inst.group[0].population[1].code.coding[0].code == "denominator" assert inst.group[0].population[1].criteria.expression == "Denominator1" assert inst.group[0].population[1].criteria.language == "text/cql" assert inst.group[0].population[2].code.coding[0].code == "denominator-exclusions" assert inst.group[0].population[2].criteria.expression == "DenominatorExclusions1" assert inst.group[0].population[2].criteria.language == "text/cql" assert inst.group[0].population[3].code.coding[0].code == "numerator" assert inst.group[0].population[3].criteria.expression == "Numerator1" assert inst.group[0].population[3].criteria.language == "text/cql" assert inst.group[1].id == "PopulationGroup2" assert inst.group[1].population[0].code.coding[0].code == "initial-population" assert inst.group[1].population[0].criteria.expression == "InitialPopulation2" assert inst.group[1].population[0].criteria.language == "text/cql" assert inst.group[1].population[1].code.coding[0].code == "denominator" assert inst.group[1].population[1].criteria.expression == "Denominator2" assert inst.group[1].population[1].criteria.language == "text/cql" assert inst.group[1].population[2].code.coding[0].code == "denominator-exclusion" assert inst.group[1].population[2].criteria.expression == "DenominatorExclusions2" assert inst.group[1].population[2].criteria.language == "text/cql" assert inst.group[1].population[3].code.coding[0].code == "numerator" assert inst.group[1].population[3].criteria.expression == "Numerator2" assert inst.group[1].population[3].criteria.language == "text/cql" assert inst.id == "measure-exclusive-breastfeeding" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "exclusive-breastfeeding-measure" assert inst.improvementNotation.coding[0].code == "increase" assert ( inst.improvementNotation.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/measure-improvement-notation" } ).valueUri ) assert inst.library[0] == ( "http://example.org/fhir/Library/library-exclusive-" "breastfeeding-cqm-logic" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "ExclusiveBreastfeedingMeasure" assert inst.purpose == ( "Measure of newborns who were fed breast milk only since " "birth" ) assert inst.relatedArtifact[0].citation == ( "American Academy of Pediatrics. (2005). Section on " "Breastfeeding. Policy Statement:Breastfeeding and the Use of" " Human Milk. Pediatrics.115:496-506." ) assert inst.relatedArtifact[0].type == "documentation" assert inst.relatedArtifact[1].type == "documentation" assert inst.relatedArtifact[2].type == "documentation" assert inst.relatedArtifact[3].type == "documentation" assert inst.relatedArtifact[4].type == "documentation" assert inst.relatedArtifact[5].type == "documentation" assert inst.relatedArtifact[6].citation == ( "Kramer, M.S. & Kakuma, R. (2002).Optimal duration of " "exclusive breastfeeding. [107 refs] Cochrane Database of " "Systematic Reviews. (1):CD003517." ) assert inst.relatedArtifact[6].type == "documentation" assert inst.relatedArtifact[7].citation == ( "Petrova, A., Hegyi, T., & Mehta, R. (2007). Maternal " "race/ethnicity and one-month exclusive breastfeeding in " "association with the in-hospital feeding modality. " "Breastfeeding Medicine. 2(2):92-8." ) assert inst.relatedArtifact[7].type == "documentation" assert inst.relatedArtifact[8].type == "documentation" assert inst.relatedArtifact[9].type == "documentation" assert inst.scoring.coding[0].code == "proportion" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Exclusive Breastfeeding Measure" assert inst.topic[0].text == "Exclusive Breastfeeding" assert inst.type[0].coding[0].code == "process" assert inst.version == "5.0.0" def test_measure_1(base_settings): """No. 1 tests collection for Measure. Test File: measure-exclusive-breastfeeding.json """ filename = ( base_settings["unittest_data_dir"] / "measure-exclusive-breastfeeding.json" ) inst = measure.Measure.model_validate_json(filename.read_bytes()) assert "Measure" == inst.get_resource_type() impl_measure_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Measure" == data["resourceType"] inst2 = measure.Measure(**data) impl_measure_1(inst2) def impl_measure_2(inst): assert inst.description == "Screening for Depression" assert inst.group[0].id == "Main" assert inst.group[0].population[0].code.coding[0].code == "initial-population" assert inst.group[0].population[0].criteria.expression == "Initial Population" assert inst.group[0].population[0].criteria.language == "text/cql" assert inst.group[0].population[1].code.coding[0].code == "denominator" assert inst.group[0].population[1].criteria.expression == "Denominator" assert inst.group[0].population[1].criteria.language == "text/cql" assert inst.group[0].population[2].code.coding[0].code == "numerator" assert inst.group[0].population[2].criteria.expression == "Numerator" assert inst.group[0].population[2].criteria.language == "text/cql" assert inst.id == "component-b-example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "ScreeningForDepression" assert inst.scoring.coding[0].code == "proportion" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Screening for Depression" def test_measure_2(base_settings): """No. 2 tests collection for Measure. Test File: measure-component-b-example.json """ filename = base_settings["unittest_data_dir"] / "measure-component-b-example.json" inst = measure.Measure.model_validate_json(filename.read_bytes()) assert "Measure" == inst.get_resource_type() impl_measure_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Measure" == data["resourceType"] inst2 = measure.Measure(**data) impl_measure_2(inst2) def impl_measure_3(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-03-08"} ).valueDateTime ) assert inst.description == ( "Exclusive breastfeeding measure of outcomes for exclusive " "breastmilk feeding of newborns." ) assert inst.group[0].id == "PopulationGroup1" assert inst.group[0].population[0].code.coding[0].code == "initial-population" assert inst.group[0].population[0].criteria.expression == "InitialPopulation1" assert inst.group[0].population[0].criteria.language == "text/cql" assert inst.group[0].population[1].code.coding[0].code == "denominator" assert inst.group[0].population[1].criteria.expression == "Denominator1" assert inst.group[0].population[1].criteria.language == "text/cql" assert inst.group[0].population[2].code.coding[0].code == "denominator-exclusions" assert inst.group[0].population[2].criteria.expression == "DenominatorExclusions1" assert inst.group[0].population[2].criteria.language == "text/cql" assert inst.group[0].population[3].code.coding[0].code == "numerator" assert inst.group[0].population[3].criteria.expression == "Numerator1" assert inst.group[0].population[3].criteria.language == "text/cql" assert inst.group[1].id == "PopulationGroup2" assert inst.group[1].population[0].code.coding[0].code == "initial-population" assert inst.group[1].population[0].criteria.expression == "InitialPopulation2" assert inst.group[1].population[0].criteria.language == "text/cql" assert inst.group[1].population[1].code.coding[0].code == "denominator" assert inst.group[1].population[1].criteria.expression == "Denominator2" assert inst.group[1].population[1].criteria.language == "text/cql" assert inst.group[1].population[2].code.coding[0].code == "denominator-exclusion" assert inst.group[1].population[2].criteria.expression == "DenominatorExclusions2" assert inst.group[1].population[2].criteria.language == "text/cql" assert inst.group[1].population[3].code.coding[0].code == "numerator" assert inst.group[1].population[3].criteria.expression == "Numerator2" assert inst.group[1].population[3].criteria.language == "text/cql" assert inst.id == "measure-predecessor-example" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "exclusive-breastfeeding-measure" assert inst.improvementNotation.coding[0].code == "increase" assert ( inst.improvementNotation.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/measure-improvement-notation" } ).valueUri ) assert inst.library[0] == ( "http://example.org/fhir/Library/library-exclusive-" "breastfeeding-cqm-logic" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "ExclusiveBreastfeedingMeasure" assert inst.purpose == ( "Measure of newborns who were fed breast milk only since " "birth" ) assert inst.relatedArtifact[0].citation == ( "American Academy of Pediatrics. (2005). Section on " "Breastfeeding. Policy Statement:Breastfeeding and the Use of" " Human Milk. Pediatrics.115:496-506." ) assert inst.relatedArtifact[0].type == "documentation" assert inst.relatedArtifact[1].type == "documentation" assert inst.relatedArtifact[2].type == "documentation" assert inst.relatedArtifact[3].type == "documentation" assert inst.relatedArtifact[4].type == "documentation" assert inst.relatedArtifact[5].type == "documentation" assert inst.relatedArtifact[6].citation == ( "Kramer, M.S. & Kakuma, R. (2002).Optimal duration of " "exclusive breastfeeding. [107 refs] Cochrane Database of " "Systematic Reviews. (1):CD003517." ) assert inst.relatedArtifact[6].type == "documentation" assert inst.relatedArtifact[7].citation == ( "Petrova, A., Hegyi, T., & Mehta, R. (2007). Maternal " "race/ethnicity and one-month exclusive breastfeeding in " "association with the in-hospital feeding modality. " "Breastfeeding Medicine. 2(2):92-8." ) assert inst.relatedArtifact[7].type == "documentation" assert inst.relatedArtifact[8].type == "documentation" assert inst.relatedArtifact[9].type == "documentation" assert inst.scoring.coding[0].code == "proportion" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Exclusive Breastfeeding Measure" assert inst.topic[0].text == "Exclusive Breastfeeding" assert inst.type[0].coding[0].code == "process" assert inst.version == "5.0.0" def test_measure_3(base_settings): """No. 3 tests collection for Measure. Test File: measure-predecessor-example.json """ filename = base_settings["unittest_data_dir"] / "measure-predecessor-example.json" inst = measure.Measure.model_validate_json(filename.read_bytes()) assert "Measure" == inst.get_resource_type() impl_measure_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Measure" == data["resourceType"] inst2 = measure.Measure(**data) impl_measure_3(inst2) def impl_measure_4(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-03-08"} ).valueDateTime ) assert inst.experimental is True assert inst.group[0].code.coding[0].code == "QRPH_ADX_ART1_N" assert ( inst.group[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[0].description == ( "Number of adults and children newly enrolled on " "antiretroviral therapy (ART) in the reporting period" ) assert inst.group[0].population[0].code.text == "cohort" assert inst.group[0].population[0].criteria.expression == ( "Newly enrolled on antiretroviral therapy (ART) during " "measurement period" ) assert inst.group[0].population[0].criteria.language == "text/cql" assert inst.group[0].stratifier[0].code.coding[0].code == "AGE_GROUP:SEX" assert ( inst.group[0].stratifier[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[0].stratifier[0].criteria.expression == "Age Group/Sex" assert inst.group[0].stratifier[0].criteria.language == "text/cql" assert inst.group[1].code.coding[0].code == "QRPH_ADX_ART1_N_PREG_BF" assert ( inst.group[1].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[1].description == ( "Number of adults and children newly enrolled on ART in the " "reporting period_pregnant and breastfeeding" ) assert inst.group[1].population[0].code.text == "cohort" assert inst.group[1].population[0].criteria.expression == ( "Newly enrolled on antiretroviral therapy (ART) during " "measurement period (pregnant and breastfeeding)" ) assert inst.group[1].population[0].criteria.language == "text/cql" assert inst.group[1].stratifier[0].code.coding[0].code == "PREG_BF" assert ( inst.group[1].stratifier[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[1].stratifier[0].criteria.expression == "Pregnant/Breastfeeding" assert inst.group[1].stratifier[0].criteria.language == "text/cql" assert inst.group[2].code.coding[0].code == "QRPH_ADX_ART3_N" assert ( inst.group[2].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[2].description == ( "Number of adults and children currently receiving " "antiretroviral therapy (ART)" ) assert inst.group[2].population[0].code.text == "cohort" assert inst.group[2].population[0].criteria.expression == ( "Receiving antiretroviral therapy (ART) during measurement " "period" ) assert inst.group[2].population[0].criteria.language == "text/cql" assert inst.group[3].code.coding[0].code == "QRPH_ADX_ART5_N" assert ( inst.group[3].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[3].description == ( "Number of adults and children who are still on treatment at " "12 months after initiating ART" ) assert inst.group[3].population[0].code.text == "cohort" assert inst.group[3].population[0].criteria.expression == ( "Receiving antiretroviral therapy (ART) at 12 months after " "initiating" ) assert inst.group[3].population[0].criteria.language == "text/cql" assert inst.group[3].stratifier[0].component[0].code.coding[0].code == "AGE_GROUP" assert ( inst.group[3].stratifier[0].component[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[3].stratifier[0].component[0].criteria.expression == "Age Group" assert inst.group[3].stratifier[0].component[0].criteria.language == "text/cql" assert inst.group[3].stratifier[0].component[1].code.coding[0].code == "SEX" assert ( inst.group[3].stratifier[0].component[1].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[3].stratifier[0].component[1].criteria.expression == "Sex" assert inst.group[3].stratifier[0].component[1].criteria.language == "text/cql" assert inst.group[4].code.coding[0].code == "QRPH_ADX_ART5_N_PREG_BF" assert ( inst.group[4].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[4].description == ( "Number of adults and children who are still on treatment at " "12 months after initiating ART-pregnant and breastfeeding" ) assert inst.group[4].population[0].code.text == "cohort" assert inst.group[4].population[0].criteria.expression == ( "Receiving antiretroviral therapy (ART) at 12 months after " "initiating (pregnant and breastfeeding)" ) assert inst.group[4].population[0].criteria.language == "text/cql" assert inst.group[4].stratifier[0].code.coding[0].code == "PREG_BF" assert ( inst.group[4].stratifier[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[4].stratifier[0].criteria.expression == "Pregnant/Breastfeeding" assert inst.group[4].stratifier[0].criteria.language == "text/cql" assert inst.group[5].code.coding[0].code == "QRPH_ADX_ART5_D" assert ( inst.group[5].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[5].description == ( "Number of adults and children who initiated ART in the 12 " "months prior to the beginning of the reporting period" ) assert inst.group[5].population[0].code.text == "cohort" assert inst.group[5].population[0].criteria.expression == ( "Initiated antiretroviral therapy (ART) in the 12 months " "prior to measurement period" ) assert inst.group[5].population[0].criteria.language == "text/cql" assert inst.group[5].stratifier[0].code.coding[0].code == "AGE_GROUP:SEX" assert ( inst.group[5].stratifier[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[5].stratifier[0].criteria.expression == "Age Group/Sex" assert inst.group[5].stratifier[0].criteria.language == "text/cql" assert inst.group[6].code.coding[0].code == "QRPH_ADX_MTCT1_D" assert ( inst.group[6].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[6].description == ( "Number of pregnant women who attended ANC or had a facility-" "based delivery in the reporting period" ) assert inst.group[6].population[0].code.text == "cohort" assert inst.group[6].population[0].criteria.expression == ( "Antenatal Care Visit or Live Birth during the Measurement " "Period" ) assert inst.group[6].population[0].criteria.language == "text/cql" assert inst.group[6].stratifier[0].code.coding[0].code == "PMTCT_HIV_STATUS" assert ( inst.group[6].stratifier[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[6].stratifier[0].criteria.expression == "PMTCT HIV Status" assert inst.group[6].stratifier[0].criteria.language == "text/cql" assert inst.group[7].code.coding[0].code == "QRPH_ADX_MTCT2_D" assert ( inst.group[7].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[7].description == ( "Number of HIV positive pregnant women who attended ANC or " "had a facility-based delivery within the reporting period" ) assert inst.group[7].population[0].code.text == "cohort" assert inst.group[7].population[0].criteria.expression == ( "Antenatal Care Visit or Live Birth during Measurement Period" " (HIV Positive)" ) assert inst.group[7].population[0].criteria.language == "text/cql" assert inst.group[8].code.coding[0].code == "QRPH_ADX_MTCT2_N" assert ( inst.group[8].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[8].description == ( "Number of HIV-positive pregnant women who received ART to " "reduce the risk of mother-to-child-transmission during " "pregnancy" ) assert inst.group[8].population[0].code.text == "cohort" assert inst.group[8].population[0].criteria.expression == ( "HIV-positive, pregnant, and receiving antiretroviral therapy" " (ART) to reduce the risk of mother-to-child-transmission " "during pregnancy" ) assert inst.group[8].population[0].criteria.language == "text/cql" assert inst.group[8].stratifier[0].code.coding[0].code == "PMTCT_ART_STATUS" assert ( inst.group[8].stratifier[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[8].stratifier[0].criteria.expression == "PMTCT ART Status" assert inst.group[8].stratifier[0].criteria.language == "text/cql" assert inst.group[9].code.coding[0].code == "QRPH_ADX_VLS3_N" assert ( inst.group[9].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[9].description == ( "Number of people living with HIV and on ART who have a " "suppressed viral load results (<1000 copies/mL)" ) assert inst.group[9].population[0].code.text == "cohort" assert inst.group[9].population[0].criteria.expression == ( "Living with HIV and on ART with suppressed viral load " "results (<1000 copies/mL)" ) assert inst.group[9].population[0].criteria.language == "text/cql" assert inst.group[9].stratifier[0].code.coding[0].code == "AGE_GROUP:SEX" assert ( inst.group[9].stratifier[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ihe.net/qrph/adx/"} ).valueUri ) assert inst.group[9].stratifier[0].criteria.expression == "Age Group/Sex" assert inst.group[9].stratifier[0].criteria.language == "text/cql" assert inst.id == "hiv-indicators" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.28.2" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ohie.org/Measure/"} ).valueUri ) assert inst.identifier[1].value == "hiv-indicators" assert inst.library[0] == "http://ohie.org/Library/hiv-indicators" assert inst.name == "HIV" assert inst.publisher == "Open HIE" assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://wiki.ihe.net/index.php/Aggregate_Data_Exchange_-_HIV"} ).valueUrl ) assert inst.relatedArtifact[0].type == "derived-from" assert inst.scoring.coding[0].code == "cohort" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "HIV Indicators" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://ohie.org/Measure/hiv-indicators"} ).valueUri ) assert inst.version == "0.0.0" def test_measure_4(base_settings): """No. 4 tests collection for Measure. Test File: measure-hiv-indicators.json """ filename = base_settings["unittest_data_dir"] / "measure-hiv-indicators.json" inst = measure.Measure.model_validate_json(filename.read_bytes()) assert "Measure" == inst.get_resource_type() impl_measure_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Measure" == data["resourceType"] inst2 = measure.Measure(**data) impl_measure_4(inst2) def impl_measure_5(inst): assert ( inst.approvalDate == ExternalValidatorModel.model_validate({"valueDate": "2016-01-01"}).valueDate ) assert inst.author[0].name == "National Committee for Quality Assurance" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://www.ncqa.org/" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-10"} ).valueDateTime ) assert inst.description == ( "Percentage of children 3-18 years of age who were diagnosed " "with pharyngitis, ordered an antibiotic and received a group" " A streptococcus (strep) test for the episode." ) assert ( inst.effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-12-31"} ).valueDateTime ) assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-01"} ).valueDateTime ) assert inst.experimental is True assert inst.group[0].id == "CMS146-group-1" assert inst.group[0].population[0].code.coding[0].code == "initial-population" assert ( inst.group[0].population[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/measure-population"} ).valueUri ) assert inst.group[0].population[0].criteria.expression == "CMS146.InitialPopulation" assert inst.group[0].population[0].criteria.language == "text/cql" assert inst.group[0].population[1].code.coding[0].code == "numerator" assert ( inst.group[0].population[1].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/measure-population"} ).valueUri ) assert inst.group[0].population[1].criteria.expression == "CMS146.Numerator" assert inst.group[0].population[1].criteria.language == "text/cql" assert inst.group[0].population[2].code.coding[0].code == "denominator" assert ( inst.group[0].population[2].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/measure-population"} ).valueUri ) assert inst.group[0].population[2].criteria.expression == "CMS146.Denominator" assert inst.group[0].population[2].criteria.language == "text/cql" assert inst.group[0].population[3].code.coding[0].code == "denominator-exclusion" assert ( inst.group[0].population[3].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/measure-population"} ).valueUri ) assert ( inst.group[0].population[3].criteria.expression == "CMS146.DenominatorExclusion" ) assert inst.group[0].population[3].criteria.language == "text/cql" assert inst.group[0].stratifier[0].code.text == "stratifier-ages-up-to-9" assert inst.group[0].stratifier[0].criteria.expression == "CMS146.AgesUpToNine" assert inst.group[0].stratifier[0].criteria.language == "text/cql" assert inst.group[0].stratifier[1].code.text == "stratifier-ages-10-plus" assert inst.group[0].stratifier[1].criteria.expression == "CMS146.AgesTenPlus" assert inst.group[0].stratifier[1].criteria.language == "text/cql" assert inst.group[0].stratifier[2].code.text == "stratifier-gender" assert inst.group[0].stratifier[2].criteria.expression == "Patient.gender" assert inst.group[0].stratifier[2].criteria.language == "text/fhirpath" assert inst.guidance == ( "This is an episode of care measure that examines all " "eligible episodes for the patient during the measurement " "period. If the patient has more than one episode, include " "all episodes in the measure" ) assert inst.id == "measure-cms146-example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.28.1" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/cqi/ecqm/Measure/Identifier/cms"} ).valueUri ) assert inst.identifier[1].use == "official" assert inst.identifier[1].value == "146" assert ( inst.identifier[2].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/cqi/ecqm/Measure/Identifier/nqf"} ).valueUri ) assert inst.identifier[2].use == "official" assert inst.identifier[2].value == "0002" assert inst.improvementNotation.coding[0].code == "increase" assert ( inst.improvementNotation.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/measure-improvement-notation" } ).valueUri ) assert inst.jurisdiction[0].coding[0].code == "US" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert ( inst.lastReviewDate == ExternalValidatorModel.model_validate({"valueDate": "2016-09-01"}).valueDate ) assert inst.library[0] == "http://hl7.org/fhir/Library/library-cms146-example" assert inst.name == "CMS146" assert inst.publisher == "National Committee for Quality Assurance" assert inst.purpose == ( "Measure of children with a group A streptococcus test in the" " 7-day period from 3 days prior through 3 days after the " "diagnosis of pharyngitis" ) assert inst.relatedArtifact[0].citation == ( "Linder, J.A., D.W. Bates, G.M. Lee, J.A. Finkelstein. 2005. " "_Antibiotic treatment of children with sore throat._ JAMA " "294(18):2315-2322. " ) assert inst.relatedArtifact[0].type == "documentation" assert inst.relatedArtifact[1].citation == ( "Infectious Diseases Society of America. 2012. _Clinical " "Practice Guideline for the Diagnosis and Management of Group" " A Streptococcal Pharyngitis: 2012 Update._ " ) assert inst.relatedArtifact[1].type == "documentation" assert inst.relatedArtifact[2].type == "documentation" assert inst.scoring.coding[0].code == "proportion" assert ( inst.scoring.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/measure-scoring"} ).valueUri ) assert inst.status == "active" assert inst.supplementalData[0].code.text == "supplemental-data-gender" assert inst.supplementalData[0].criteria.expression == "Patient.gender" assert inst.supplementalData[0].criteria.language == "text/fhirpath" assert inst.supplementalData[1].code.text == "supplemental-data-deceased" assert inst.supplementalData[1].criteria.expression == "deceasedBoolean" assert inst.supplementalData[1].criteria.language == "text/fhirpath" assert inst.text.status == "additional" assert inst.title == "Appropriate Testing for Children with Pharyngitis" assert inst.topic[0].coding[0].code == "57024-2" assert ( inst.topic[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.type[0].coding[0].code == "process" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/measure-type"} ).valueUri ) assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/Measure/measure-cms146-example"} ).valueUri ) assert inst.useContext[0].code.code == "program" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.text == "eligibile-provider" assert inst.useContext[1].code.code == "age" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueRange.high.unit == "a" assert float(inst.useContext[1].valueRange.high.value) == float(18) assert inst.useContext[1].valueRange.low.unit == "a" assert float(inst.useContext[1].valueRange.low.value) == float(3) assert inst.version == "1.0.0" def test_measure_5(base_settings): """No. 5 tests collection for Measure. Test File: measure-cms146-example.json """ filename = base_settings["unittest_data_dir"] / "measure-cms146-example.json" inst = measure.Measure.model_validate_json(filename.read_bytes()) assert "Measure" == inst.get_resource_type() impl_measure_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Measure" == data["resourceType"] inst2 = measure.Measure(**data) impl_measure_5(inst2) def impl_measure_6(inst): assert inst.description == "Screening for Alcohol Misuse" assert inst.group[0].id == "Main" assert inst.group[0].population[0].code.coding[0].code == "initial-population" assert inst.group[0].population[0].criteria.expression == "Initial Population" assert inst.group[0].population[0].criteria.language == "text/cql" assert inst.group[0].population[1].code.coding[0].code == "denominator" assert inst.group[0].population[1].criteria.expression == "Denominator" assert inst.group[0].population[1].criteria.language == "text/cql" assert inst.group[0].population[2].code.coding[0].code == "numerator" assert inst.group[0].population[2].criteria.expression == "Numerator" assert inst.group[0].population[2].criteria.language == "text/cql" assert inst.id == "component-a-example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "ScreeningForAlcoholMisuse" assert inst.scoring.coding[0].code == "proportion" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Screening for Alcohol Misuse" def test_measure_6(base_settings): """No. 6 tests collection for Measure. Test File: measure-component-a-example.json """ filename = base_settings["unittest_data_dir"] / "measure-component-a-example.json" inst = measure.Measure.model_validate_json(filename.read_bytes()) assert "Measure" == inst.get_resource_type() impl_measure_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Measure" == data["resourceType"] inst2 = measure.Measure(**data) impl_measure_6(inst2) def impl_measure_7(inst): assert inst.compositeScoring.coding[0].code == "opportunity" assert inst.description == "Behavioral Assessment Composite Measure" assert inst.id == "composite-example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "BehavioralAssessmentCompositeMeasure" assert ( inst.relatedArtifact[0].resource == "http://example.org/fhir/Measure/component-a-example" ) assert inst.relatedArtifact[0].type == "composed-of" assert ( inst.relatedArtifact[1].resource == "http://example.org/fhir/Measure/component-b-example" ) assert inst.relatedArtifact[1].type == "composed-of" assert inst.scoring.coding[0].code == "proportion" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Behavioral Assessment Composite Measure" def test_measure_7(base_settings): """No. 7 tests collection for Measure. Test File: measure-composite-example.json """ filename = base_settings["unittest_data_dir"] / "measure-composite-example.json" inst = measure.Measure.model_validate_json(filename.read_bytes()) assert "Measure" == inst.get_resource_type() impl_measure_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Measure" == data["resourceType"] inst2 = measure.Measure(**data) impl_measure_7(inst2) ================================================ FILE: fhir/resources/tests/test_measurereport.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/MeasureReport Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import measurereport from .conftest import ExternalValidatorModel def impl_measurereport_1(inst): assert inst.contained[0].id == "reporter" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-04-01"} ).valueDateTime ) assert inst.evaluatedResource[0].reference == "Condition/example" assert inst.group[0].id == "CMS146-group-1" assert inst.group[0].population[0].code.coding[0].code == "initial-population" assert inst.group[0].population[0].count == 1 assert inst.group[0].population[1].code.coding[0].code == "numerator" assert inst.group[0].population[1].count == 1 assert inst.group[0].population[2].code.coding[0].code == "denominator" assert inst.group[0].population[2].count == 1 assert inst.group[0].population[3].code.coding[0].code == "denominator-exclusion" assert inst.group[0].population[3].count == 0 assert inst.group[0].stratifier[0].code.text == "stratifier-ages-up-to-9" assert ( inst.group[0].stratifier[0].stratum[0].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[0].stratum[0].population[0].count == 1 assert ( inst.group[0].stratifier[0].stratum[0].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[0].stratum[0].population[1].count == 1 assert ( inst.group[0].stratifier[0].stratum[0].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[0].stratum[0].population[2].count == 1 assert ( inst.group[0].stratifier[0].stratum[0].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[0].stratum[0].population[3].count == 0 assert inst.group[0].stratifier[0].stratum[0].valueBoolean is True assert ( inst.group[0].stratifier[0].stratum[1].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[0].stratum[1].population[0].count == 0 assert ( inst.group[0].stratifier[0].stratum[1].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[0].stratum[1].population[1].count == 0 assert ( inst.group[0].stratifier[0].stratum[1].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[0].stratum[1].population[2].count == 0 assert ( inst.group[0].stratifier[0].stratum[1].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[0].stratum[1].population[3].count == 0 assert inst.group[0].stratifier[0].stratum[1].valueBoolean is False assert inst.group[0].stratifier[1].code.text == "stratifier-ages-10-plus" assert ( inst.group[0].stratifier[1].stratum[0].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[1].stratum[0].population[0].count == 0 assert ( inst.group[0].stratifier[1].stratum[0].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[1].stratum[0].population[1].count == 0 assert ( inst.group[0].stratifier[1].stratum[0].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[1].stratum[0].population[2].count == 0 assert ( inst.group[0].stratifier[1].stratum[0].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[1].stratum[0].population[3].count == 0 assert inst.group[0].stratifier[1].stratum[0].valueBoolean is True assert ( inst.group[0].stratifier[1].stratum[1].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[1].stratum[1].population[0].count == 1 assert ( inst.group[0].stratifier[1].stratum[1].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[1].stratum[1].population[1].count == 1 assert ( inst.group[0].stratifier[1].stratum[1].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[1].stratum[1].population[2].count == 1 assert ( inst.group[0].stratifier[1].stratum[1].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[1].stratum[1].population[3].count == 0 assert inst.group[0].stratifier[1].stratum[1].valueBoolean is True assert inst.group[0].stratifier[2].code.text == "stratifier-gender" assert ( inst.group[0].stratifier[2].stratum[0].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[2].stratum[0].population[0].count == 1 assert ( inst.group[0].stratifier[2].stratum[0].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[2].stratum[0].population[1].count == 1 assert ( inst.group[0].stratifier[2].stratum[0].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[2].stratum[0].population[2].count == 1 assert ( inst.group[0].stratifier[2].stratum[0].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[2].stratum[0].population[3].count == 0 assert inst.group[0].stratifier[2].stratum[0].valueCodeableConcept.text == "male" assert ( inst.group[0].stratifier[2].stratum[1].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[2].stratum[1].population[0].count == 0 assert ( inst.group[0].stratifier[2].stratum[1].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[2].stratum[1].population[1].count == 0 assert ( inst.group[0].stratifier[2].stratum[1].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[2].stratum[1].population[2].count == 0 assert ( inst.group[0].stratifier[2].stratum[1].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[2].stratum[1].population[3].count == 0 assert inst.group[0].stratifier[2].stratum[1].valueCodeableConcept.text == "female" assert ( inst.group[0].stratifier[2].stratum[2].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[2].stratum[2].population[0].count == 0 assert ( inst.group[0].stratifier[2].stratum[2].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[2].stratum[2].population[1].count == 0 assert ( inst.group[0].stratifier[2].stratum[2].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[2].stratum[2].population[2].count == 0 assert ( inst.group[0].stratifier[2].stratum[2].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[2].stratum[2].population[3].count == 0 assert inst.group[0].stratifier[2].stratum[2].valueCodeableConcept.text == "other" assert ( inst.group[0].stratifier[2].stratum[3].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[2].stratum[3].population[0].count == 0 assert ( inst.group[0].stratifier[2].stratum[3].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[2].stratum[3].population[1].count == 0 assert ( inst.group[0].stratifier[2].stratum[3].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[2].stratum[3].population[2].count == 0 assert ( inst.group[0].stratifier[2].stratum[3].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[2].stratum[3].population[3].count == 0 assert inst.group[0].stratifier[2].stratum[3].valueCodeableConcept.text == "unknown" assert inst.id == "measurereport-cms146-cat1-example" assert inst.identifier[0].value == "measurereport-cms146-cat1-example-2017-03-13" assert inst.measure == "http://example.org/fhir/Measure/CMS146" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-03-31"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-01-01"} ).valueDateTime ) assert inst.reporter.reference == "#reporter" assert inst.status == "complete" assert inst.subject.reference == "Patient/123" assert inst.text.status == "generated" assert inst.type == "individual" def test_measurereport_1(base_settings): """No. 1 tests collection for MeasureReport. Test File: measurereport-cms146-cat1-example.json """ filename = ( base_settings["unittest_data_dir"] / "measurereport-cms146-cat1-example.json" ) inst = measurereport.MeasureReport.model_validate_json(filename.read_bytes()) assert "MeasureReport" == inst.get_resource_type() impl_measurereport_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MeasureReport" == data["resourceType"] inst2 = measurereport.MeasureReport(**data) impl_measurereport_1(inst2) def impl_measurereport_2(inst): assert inst.contained[0].id == "patient-new" assert inst.group[0].code.coding[0].code == "QRPH_ADX_ART5_N" assert float(inst.group[0].measureScoreQuantity.value) == float(1) assert inst.group[0].stratifier[0].code.coding[0].code == "AGE_GROUP:SEX" assert float( inst.group[0].stratifier[0].stratum[0].measureScoreQuantity.value ) == float(0) assert ( inst.group[0].stratifier[0].stratum[0].valueCodeableConcept.coding[0].code == "P0Y--P20Y:F" ) assert float( inst.group[0].stratifier[0].stratum[1].measureScoreQuantity.value ) == float(0) assert ( inst.group[0].stratifier[0].stratum[1].valueCodeableConcept.coding[0].code == "P0Y--P20Y:M" ) assert float( inst.group[0].stratifier[0].stratum[2].measureScoreQuantity.value ) == float(0) assert ( inst.group[0].stratifier[0].stratum[2].valueCodeableConcept.coding[0].code == "P20Y--P40Y:F" ) assert float( inst.group[0].stratifier[0].stratum[3].measureScoreQuantity.value ) == float(0) assert ( inst.group[0].stratifier[0].stratum[3].valueCodeableConcept.coding[0].code == "P20Y--P40Y:M" ) assert float( inst.group[0].stratifier[0].stratum[4].measureScoreQuantity.value ) == float(0) assert ( inst.group[0].stratifier[0].stratum[4].valueCodeableConcept.coding[0].code == "P40Y--P65Y:F" ) assert float( inst.group[0].stratifier[0].stratum[5].measureScoreQuantity.value ) == float(1) assert ( inst.group[0].stratifier[0].stratum[5].valueCodeableConcept.coding[0].code == "P40Y--P65Y:M" ) assert inst.id == "general-example-of-report" assert inst.measure == "http://ohie.org/Measure/hiv-indicators" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-12-31"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-01-01"} ).valueDateTime ) assert inst.status == "complete" assert inst.subject.reference == "#patient-new" assert inst.text.status == "generated" assert inst.type == "individual" def test_measurereport_2(base_settings): """No. 2 tests collection for MeasureReport. Test File: measurereport-general-example.json """ filename = base_settings["unittest_data_dir"] / "measurereport-general-example.json" inst = measurereport.MeasureReport.model_validate_json(filename.read_bytes()) assert "MeasureReport" == inst.get_resource_type() impl_measurereport_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MeasureReport" == data["resourceType"] inst2 = measurereport.MeasureReport(**data) impl_measurereport_2(inst2) def impl_measurereport_3(inst): assert inst.contained[0].id == "1" assert inst.group[0].population[0].code.coding[0].code == "initial-population" assert inst.group[0].population[0].code.coding[0].display == "Initial Population" assert ( inst.group[0].population[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/measure-population"} ).valueUri ) assert inst.group[0].population[0].count == 2 assert inst.group[0].population[0].subjectResults.reference == "#1" assert inst.id == "788ca455-e11b1a59" assert inst.measure == ( "http://lantanagroup.com/fhir/nhsn-measures/Measure/NHSNGlyce" "micControlHypoglycemicInitialPopulation" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-08-31T23:59:59+00:00"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-08-01T00:00:00+00:00"} ).valueDateTime ) assert ( inst.reporter.reference == "Organization/aa389ad5-e6fe-4030-88ce-010ab96e4ac4" ) assert inst.status == "complete" assert inst.text.status == "generated" assert inst.type == "subject-list" def test_measurereport_3(base_settings): """No. 3 tests collection for MeasureReport. Test File: measurereport-788ca455-e11b1a59.json """ filename = ( base_settings["unittest_data_dir"] / "measurereport-788ca455-e11b1a59.json" ) inst = measurereport.MeasureReport.model_validate_json(filename.read_bytes()) assert "MeasureReport" == inst.get_resource_type() impl_measurereport_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MeasureReport" == data["resourceType"] inst2 = measurereport.MeasureReport(**data) impl_measurereport_3(inst2) def impl_measurereport_4(inst): assert inst.group[0].code.coding[0].code == "QRPH_ADX_ART1_N" assert float(inst.group[0].measureScoreQuantity.value) == float(0) assert inst.group[0].stratifier[0].code.coding[0].code == "AGE_GROUP:SEX" assert float( inst.group[0].stratifier[0].stratum[0].measureScoreQuantity.value ) == float(0) assert ( inst.group[0].stratifier[0].stratum[0].valueCodeableConcept.coding[0].code == "P0Y--P1Y:F" ) assert float( inst.group[0].stratifier[0].stratum[1].measureScoreQuantity.value ) == float(0) assert ( inst.group[0].stratifier[0].stratum[1].valueCodeableConcept.coding[0].code == "P0Y--P1Y:M" ) assert float( inst.group[0].stratifier[0].stratum[2].measureScoreQuantity.value ) == float(0) assert ( inst.group[0].stratifier[0].stratum[2].valueCodeableConcept.coding[0].code == "P1Y--P5Y:F" ) assert float( inst.group[0].stratifier[0].stratum[3].measureScoreQuantity.value ) == float(0) assert ( inst.group[0].stratifier[0].stratum[3].valueCodeableConcept.coding[0].code == "P1Y--P5Y:M" ) assert float( inst.group[0].stratifier[0].stratum[4].measureScoreQuantity.value ) == float(0) assert ( inst.group[0].stratifier[0].stratum[4].valueCodeableConcept.coding[0].code == "P10Y--P15Y:F" ) assert float( inst.group[0].stratifier[0].stratum[5].measureScoreQuantity.value ) == float(0) assert ( inst.group[0].stratifier[0].stratum[5].valueCodeableConcept.coding[0].code == "P10Y--P15Y:M" ) assert inst.group[1].code.coding[0].code == "QRPH_ADX_ART1_N" assert float(inst.group[1].measureScoreQuantity.value) == float(0) assert inst.group[1].stratifier[0].code.coding[0].code == "AGE_GROUP:SEX" assert float( inst.group[1].stratifier[0].stratum[0].measureScoreQuantity.value ) == float(0) assert ( inst.group[1].stratifier[0].stratum[0].valueCodeableConcept.coding[0].code == "P0Y--P1Y:F" ) assert float( inst.group[1].stratifier[0].stratum[1].measureScoreQuantity.value ) == float(0) assert ( inst.group[1].stratifier[0].stratum[1].valueCodeableConcept.coding[0].code == "P0Y--P1Y:M" ) assert float( inst.group[1].stratifier[0].stratum[2].measureScoreQuantity.value ) == float(0) assert ( inst.group[1].stratifier[0].stratum[2].valueCodeableConcept.coding[0].code == "P1Y--P5Y:F" ) assert float( inst.group[1].stratifier[0].stratum[3].measureScoreQuantity.value ) == float(0) assert ( inst.group[1].stratifier[0].stratum[3].valueCodeableConcept.coding[0].code == "P1Y--P5Y:M" ) assert float( inst.group[1].stratifier[0].stratum[4].measureScoreQuantity.value ) == float(0) assert ( inst.group[1].stratifier[0].stratum[4].valueCodeableConcept.coding[0].code == "P10Y--P15Y:F" ) assert float( inst.group[1].stratifier[0].stratum[5].measureScoreQuantity.value ) == float(0) assert ( inst.group[1].stratifier[0].stratum[5].valueCodeableConcept.coding[0].code == "P10Y--P15Y:M" ) assert inst.group[2].code.coding[0].code == "QRPH_ADX_ART1_N" assert float(inst.group[2].measureScoreQuantity.value) == float(0) assert ( inst.group[2].stratifier[0].stratum[0].component[0].code.coding[0].code == "AGE_GROUP" ) assert ( inst.group[2] .stratifier[0] .stratum[0] .component[0] .valueCodeableConcept.coding[0] .code == "P0Y--P1Y" ) assert ( inst.group[2].stratifier[0].stratum[0].component[1].code.coding[0].code == "SEX" ) assert ( inst.group[2] .stratifier[0] .stratum[0] .component[1] .valueCodeableConcept.coding[0] .code == "F" ) assert float( inst.group[2].stratifier[0].stratum[0].measureScoreQuantity.value ) == float(0) assert ( inst.group[2].stratifier[0].stratum[1].component[0].code.coding[0].code == "AGE_GROUP" ) assert ( inst.group[2] .stratifier[0] .stratum[1] .component[0] .valueCodeableConcept.coding[0] .code == "P0Y--P1Y" ) assert ( inst.group[2].stratifier[0].stratum[1].component[1].code.coding[0].code == "SEX" ) assert ( inst.group[2] .stratifier[0] .stratum[1] .component[1] .valueCodeableConcept.coding[0] .code == "M" ) assert float( inst.group[2].stratifier[0].stratum[1].measureScoreQuantity.value ) == float(0) assert ( inst.group[2].stratifier[0].stratum[2].component[0].code.coding[0].code == "AGE_GROUP" ) assert ( inst.group[2] .stratifier[0] .stratum[2] .component[0] .valueCodeableConcept.coding[0] .code == "P1Y--P5Y" ) assert ( inst.group[2].stratifier[0].stratum[2].component[1].code.coding[0].code == "SEX" ) assert ( inst.group[2] .stratifier[0] .stratum[2] .component[1] .valueCodeableConcept.coding[0] .code == "F" ) assert float( inst.group[2].stratifier[0].stratum[2].measureScoreQuantity.value ) == float(0) assert ( inst.group[2].stratifier[0].stratum[3].component[0].code.coding[0].code == "AGE_GROUP" ) assert ( inst.group[2] .stratifier[0] .stratum[3] .component[0] .valueCodeableConcept.coding[0] .code == "P1Y--P5Y" ) assert ( inst.group[2].stratifier[0].stratum[3].component[1].code.coding[0].code == "SEX" ) assert ( inst.group[2] .stratifier[0] .stratum[3] .component[1] .valueCodeableConcept.coding[0] .code == "F" ) assert float( inst.group[2].stratifier[0].stratum[3].measureScoreQuantity.value ) == float(0) assert inst.id == "hiv-indicators" assert inst.measure == "http://ohie.org/Measure/hiv-indicators" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-01-31"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-01-01"} ).valueDateTime ) assert inst.reporter.reference == "Organization/hl7" assert inst.status == "complete" assert inst.text.status == "generated" assert inst.type == "summary" def test_measurereport_4(base_settings): """No. 4 tests collection for MeasureReport. Test File: measurereport-hiv-indicators.json """ filename = base_settings["unittest_data_dir"] / "measurereport-hiv-indicators.json" inst = measurereport.MeasureReport.model_validate_json(filename.read_bytes()) assert "MeasureReport" == inst.get_resource_type() impl_measurereport_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MeasureReport" == data["resourceType"] inst2 = measurereport.MeasureReport(**data) impl_measurereport_4(inst2) def impl_measurereport_5(inst): assert inst.contained[0].id == "reporter" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-04-01"} ).valueDateTime ) assert inst.group[0].id == "CMS146-group-1" assert inst.group[0].population[0].code.coding[0].code == "initial-population" assert inst.group[0].population[0].count == 500 assert inst.group[0].population[1].code.coding[0].code == "numerator" assert inst.group[0].population[1].count == 200 assert inst.group[0].population[2].code.coding[0].code == "denominator" assert inst.group[0].population[2].count == 500 assert inst.group[0].population[3].code.coding[0].code == "denominator-exclusion" assert inst.group[0].population[3].count == 100 assert inst.group[0].stratifier[0].code.text == "stratifier-ages-up-to-9" assert ( inst.group[0].stratifier[0].stratum[0].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[0].stratum[0].population[0].count == 250 assert ( inst.group[0].stratifier[0].stratum[0].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[0].stratum[0].population[1].count == 100 assert ( inst.group[0].stratifier[0].stratum[0].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[0].stratum[0].population[2].count == 250 assert ( inst.group[0].stratifier[0].stratum[0].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[0].stratum[0].population[3].count == 50 assert inst.group[0].stratifier[0].stratum[0].valueBoolean is True assert ( inst.group[0].stratifier[0].stratum[1].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[0].stratum[1].population[0].count == 250 assert ( inst.group[0].stratifier[0].stratum[1].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[0].stratum[1].population[1].count == 100 assert ( inst.group[0].stratifier[0].stratum[1].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[0].stratum[1].population[2].count == 250 assert ( inst.group[0].stratifier[0].stratum[1].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[0].stratum[1].population[3].count == 50 assert inst.group[0].stratifier[0].stratum[1].valueBoolean is False assert inst.group[0].stratifier[1].code.text == "stratifier-ages-10-plus" assert ( inst.group[0].stratifier[1].stratum[0].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[1].stratum[0].population[0].count == 250 assert ( inst.group[0].stratifier[1].stratum[0].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[1].stratum[0].population[1].count == 100 assert ( inst.group[0].stratifier[1].stratum[0].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[1].stratum[0].population[2].count == 250 assert ( inst.group[0].stratifier[1].stratum[0].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[1].stratum[0].population[3].count == 50 assert inst.group[0].stratifier[1].stratum[0].valueBoolean is True assert ( inst.group[0].stratifier[1].stratum[1].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[1].stratum[1].population[0].count == 250 assert ( inst.group[0].stratifier[1].stratum[1].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[1].stratum[1].population[1].count == 100 assert ( inst.group[0].stratifier[1].stratum[1].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[1].stratum[1].population[2].count == 250 assert ( inst.group[0].stratifier[1].stratum[1].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[1].stratum[1].population[3].count == 50 assert inst.group[0].stratifier[1].stratum[1].valueBoolean is False assert inst.group[0].stratifier[2].code.text == "stratifier-gender" assert ( inst.group[0].stratifier[2].stratum[0].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[2].stratum[0].population[0].count == 250 assert ( inst.group[0].stratifier[2].stratum[0].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[2].stratum[0].population[1].count == 100 assert ( inst.group[0].stratifier[2].stratum[0].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[2].stratum[0].population[2].count == 250 assert ( inst.group[0].stratifier[2].stratum[0].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[2].stratum[0].population[3].count == 50 assert inst.group[0].stratifier[2].stratum[0].valueCodeableConcept.text == "male" assert ( inst.group[0].stratifier[2].stratum[1].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[2].stratum[1].population[0].count == 250 assert ( inst.group[0].stratifier[2].stratum[1].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[2].stratum[1].population[1].count == 100 assert ( inst.group[0].stratifier[2].stratum[1].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[2].stratum[1].population[2].count == 250 assert ( inst.group[0].stratifier[2].stratum[1].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[2].stratum[1].population[3].count == 50 assert inst.group[0].stratifier[2].stratum[1].valueCodeableConcept.text == "female" assert ( inst.group[0].stratifier[2].stratum[2].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[2].stratum[2].population[0].count == 0 assert ( inst.group[0].stratifier[2].stratum[2].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[2].stratum[2].population[1].count == 0 assert ( inst.group[0].stratifier[2].stratum[2].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[2].stratum[2].population[2].count == 0 assert ( inst.group[0].stratifier[2].stratum[2].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[2].stratum[2].population[3].count == 0 assert inst.group[0].stratifier[2].stratum[2].valueCodeableConcept.text == "other" assert ( inst.group[0].stratifier[2].stratum[3].population[0].code.coding[0].code == "initial-population" ) assert inst.group[0].stratifier[2].stratum[3].population[0].count == 0 assert ( inst.group[0].stratifier[2].stratum[3].population[1].code.coding[0].code == "numerator" ) assert inst.group[0].stratifier[2].stratum[3].population[1].count == 0 assert ( inst.group[0].stratifier[2].stratum[3].population[2].code.coding[0].code == "denominator" ) assert inst.group[0].stratifier[2].stratum[3].population[2].count == 0 assert ( inst.group[0].stratifier[2].stratum[3].population[3].code.coding[0].code == "denominator-exclusion" ) assert inst.group[0].stratifier[2].stratum[3].population[3].count == 0 assert inst.group[0].stratifier[2].stratum[3].valueCodeableConcept.text == "unknown" assert inst.id == "measurereport-cms146-cat3-example" assert inst.identifier[0].value == "measurereport-cms146-cat3-example-2017-03-13" assert inst.measure == "http://example.org/fhir/Measure/CMS146" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-03-31"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-01-01"} ).valueDateTime ) assert inst.reporter.reference == "#reporter" assert inst.status == "complete" assert inst.text.status == "generated" assert inst.type == "summary" def test_measurereport_5(base_settings): """No. 5 tests collection for MeasureReport. Test File: measurereport-cms146-cat3-example.json """ filename = ( base_settings["unittest_data_dir"] / "measurereport-cms146-cat3-example.json" ) inst = measurereport.MeasureReport.model_validate_json(filename.read_bytes()) assert "MeasureReport" == inst.get_resource_type() impl_measurereport_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MeasureReport" == data["resourceType"] inst2 = measurereport.MeasureReport(**data) impl_measurereport_5(inst2) ================================================ FILE: fhir/resources/tests/test_medication.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Medication Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import medication from .conftest import ExternalValidatorModel def impl_medication_1(inst): assert ( inst.batch.expirationDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-31"} ).valueDateTime ) assert inst.batch.lotNumber == "12345" assert inst.code.coding[0].code == "0169-7501-11" assert inst.code.coding[0].display == "Novolog 100u/ml" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/ndc"} ).valueUri ) assert inst.contained[0].id == "mmanu" assert inst.doseForm.coding[0].code == "385219001" assert inst.doseForm.coding[0].display == "Injection solution (qualifier value)" assert ( inst.doseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "med0307" assert inst.ingredient[0].item.concept.coding[0].code == "325072002" assert ( inst.ingredient[0].item.concept.coding[0].display == "Insulin Aspart (substance)" ) assert ( inst.ingredient[0].item.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.ingredient[0].strengthRatio.denominator.code == "mL" assert ( inst.ingredient[0].strengthRatio.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[0].strengthRatio.denominator.value) == float(1) assert inst.ingredient[0].strengthRatio.numerator.code == "U" assert ( inst.ingredient[0].strengthRatio.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[0].strengthRatio.numerator.value) == float(100) assert inst.marketingAuthorizationHolder.reference == "#mmanu" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_medication_1(base_settings): """No. 1 tests collection for Medication. Test File: medicationexample0307.json """ filename = base_settings["unittest_data_dir"] / "medicationexample0307.json" inst = medication.Medication.model_validate_json(filename.read_bytes()) assert "Medication" == inst.get_resource_type() impl_medication_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Medication" == data["resourceType"] inst2 = medication.Medication(**data) impl_medication_1(inst2) def impl_medication_2(inst): assert inst.code.coding[0].code == "373994007" assert inst.code.coding[0].display == "Prednisone 5mg tablet (Product)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.contained[0].id == "sub03" assert inst.doseForm.coding[0].code == "385055001" assert inst.doseForm.coding[0].display == "Tablet dose form (qualifier value)" assert ( inst.doseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "med0311" assert inst.ingredient[0].item.reference.reference == "#sub03" assert inst.ingredient[0].strengthRatio.denominator.code == "TAB" assert ( inst.ingredient[0].strengthRatio.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert float(inst.ingredient[0].strengthRatio.denominator.value) == float(1) assert inst.ingredient[0].strengthRatio.numerator.code == "mg" assert ( inst.ingredient[0].strengthRatio.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[0].strengthRatio.numerator.value) == float(5) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_medication_2(base_settings): """No. 2 tests collection for Medication. Test File: medicationexample0311.json """ filename = base_settings["unittest_data_dir"] / "medicationexample0311.json" inst = medication.Medication.model_validate_json(filename.read_bytes()) assert "Medication" == inst.get_resource_type() impl_medication_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Medication" == data["resourceType"] inst2 = medication.Medication(**data) impl_medication_2(inst2) def impl_medication_3(inst): assert inst.code.coding[0].code == "430127000" assert inst.code.coding[0].display == "Oral Form Oxycodone (product)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.contained[0].id == "sub03" assert inst.doseForm.coding[0].code == "385055001" assert inst.doseForm.coding[0].display == "Tablet dose form (qualifier value)" assert ( inst.doseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "med0310" assert inst.ingredient[0].item.reference.reference == "#sub03" assert inst.ingredient[0].strengthRatio.denominator.code == "TAB" assert ( inst.ingredient[0].strengthRatio.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert float(inst.ingredient[0].strengthRatio.denominator.value) == float(1) assert inst.ingredient[0].strengthRatio.numerator.code == "mg" assert ( inst.ingredient[0].strengthRatio.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[0].strengthRatio.numerator.value) == float(5) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_medication_3(base_settings): """No. 3 tests collection for Medication. Test File: medicationexample0310.json """ filename = base_settings["unittest_data_dir"] / "medicationexample0310.json" inst = medication.Medication.model_validate_json(filename.read_bytes()) assert "Medication" == inst.get_resource_type() impl_medication_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Medication" == data["resourceType"] inst2 = medication.Medication(**data) impl_medication_3(inst2) def impl_medication_4(inst): assert ( inst.batch.expirationDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-10-31"} ).valueDateTime ) assert inst.batch.lotNumber == "12345" assert inst.code.coding[0].code == "51144-050-01" assert inst.code.coding[0].display == "Adcetris" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/ndc"} ).valueUri ) assert inst.contained[0].id == "mmanu" assert inst.doseForm.coding[0].code == "421637006" assert inst.doseForm.coding[0].display == ( "Lyophilized powder for injectable solution (qualifier value)" " " ) assert ( inst.doseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "med0306" assert inst.marketingAuthorizationHolder.reference == "#mmanu" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_medication_4(base_settings): """No. 4 tests collection for Medication. Test File: medicationexample0306.json """ filename = base_settings["unittest_data_dir"] / "medicationexample0306.json" inst = medication.Medication.model_validate_json(filename.read_bytes()) assert "Medication" == inst.get_resource_type() impl_medication_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Medication" == data["resourceType"] inst2 = medication.Medication(**data) impl_medication_4(inst2) def impl_medication_5(inst): assert ( inst.batch.expirationDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-05-22"} ).valueDateTime ) assert inst.batch.lotNumber == "9494788" assert inst.code.coding[0].code == "0409-6531-02" assert ( inst.code.coding[0].display == "Vancomycin Hydrochloride (VANCOMYCIN HYDROCHLORIDE)" ) assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/ndc"} ).valueUri ) assert inst.contained[0].id == "mmanu" assert inst.doseForm.coding[0].code == "385219001" assert inst.doseForm.coding[0].display == "Injection Solution (qualifier value)" assert ( inst.doseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "med0301" assert inst.identifier[0].id == "123456789" assert inst.ingredient[0].isActive is True assert inst.ingredient[0].item.concept.coding[0].code == "66955" assert ( inst.ingredient[0].item.concept.coding[0].display == "Vancomycin Hydrochloride" ) assert ( inst.ingredient[0].item.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.ingredient[0].strengthRatio.denominator.code == "mL" assert ( inst.ingredient[0].strengthRatio.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[0].strengthRatio.denominator.value) == float(10) assert inst.ingredient[0].strengthRatio.numerator.code == "mg" assert ( inst.ingredient[0].strengthRatio.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[0].strengthRatio.numerator.value) == float(500) assert inst.marketingAuthorizationHolder.reference == "#mmanu" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "active" assert inst.text.status == "generated" def test_medication_5(base_settings): """No. 5 tests collection for Medication. Test File: medicationexample0301.json """ filename = base_settings["unittest_data_dir"] / "medicationexample0301.json" inst = medication.Medication.model_validate_json(filename.read_bytes()) assert "Medication" == inst.get_resource_type() impl_medication_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Medication" == data["resourceType"] inst2 = medication.Medication(**data) impl_medication_5(inst2) def impl_medication_6(inst): assert inst.doseForm.coding[0].code == "385219001" assert inst.doseForm.coding[0].display == "Injection Solution (qualifier value)" assert ( inst.doseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.doseForm.text == "Injection Solution (qualifier value)" assert inst.id == "med0317" assert inst.ingredient[0].item.concept.coding[0].code == "8591" assert inst.ingredient[0].item.concept.coding[0].display == "Potassium Chloride" assert ( inst.ingredient[0].item.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.ingredient[0].strengthRatio.denominator.code == "mL" assert ( inst.ingredient[0].strengthRatio.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[0].strengthRatio.denominator.value) == float(1000) assert inst.ingredient[0].strengthRatio.numerator.code == "meq" assert ( inst.ingredient[0].strengthRatio.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[0].strengthRatio.numerator.value) == float(20) assert inst.ingredient[1].item.concept.coding[0].code == "313002" assert ( inst.ingredient[1].item.concept.coding[0].display == "1000 ml glucost 50mg/ml Injection" ) assert ( inst.ingredient[1].item.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.ingredient[1].strengthRatio.denominator.code == "mL" assert ( inst.ingredient[1].strengthRatio.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[1].strengthRatio.denominator.value) == float(100) assert inst.ingredient[1].strengthRatio.numerator.code == "g" assert ( inst.ingredient[1].strengthRatio.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[1].strengthRatio.numerator.value) == float(5) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_medication_6(base_settings): """No. 6 tests collection for Medication. Test File: medicationexample0317.json """ filename = base_settings["unittest_data_dir"] / "medicationexample0317.json" inst = medication.Medication.model_validate_json(filename.read_bytes()) assert "Medication" == inst.get_resource_type() impl_medication_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Medication" == data["resourceType"] inst2 = medication.Medication(**data) impl_medication_6(inst2) def impl_medication_7(inst): assert inst.code.text == "Amoxicillin 250mg/5ml Suspension" assert inst.id == "medicationexample1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.div == ( '
Amoxicillin ' "250mg/5ml Suspension
" ) assert inst.text.status == "generated" def test_medication_7(base_settings): """No. 7 tests collection for Medication. Test File: medicationexample1.json """ filename = base_settings["unittest_data_dir"] / "medicationexample1.json" inst = medication.Medication.model_validate_json(filename.read_bytes()) assert "Medication" == inst.get_resource_type() impl_medication_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Medication" == data["resourceType"] inst2 = medication.Medication(**data) impl_medication_7(inst2) def impl_medication_8(inst): assert ( inst.batch.expirationDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-05-22"} ).valueDateTime ) assert inst.batch.lotNumber == "9494788" assert inst.code.coding[0].code == "213293" assert inst.code.coding[0].display == "Capecitabine 500mg oral tablet (Xeloda)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.contained[0].id == "mmanu" assert inst.contained[1].id == "sub04" assert inst.doseForm.coding[0].code == "385055001" assert inst.doseForm.coding[0].display == "Tablet dose form (qualifier value)" assert ( inst.doseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "medexample015" assert inst.ingredient[0].item.reference.reference == "#sub04" assert inst.ingredient[0].strengthRatio.denominator.code == "TAB" assert ( inst.ingredient[0].strengthRatio.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert float(inst.ingredient[0].strengthRatio.denominator.value) == float(1) assert inst.ingredient[0].strengthRatio.numerator.code == "mg" assert ( inst.ingredient[0].strengthRatio.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[0].strengthRatio.numerator.value) == float(500) assert inst.marketingAuthorizationHolder.reference == "#mmanu" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_medication_8(base_settings): """No. 8 tests collection for Medication. Test File: medicationexample15.json """ filename = base_settings["unittest_data_dir"] / "medicationexample15.json" inst = medication.Medication.model_validate_json(filename.read_bytes()) assert "Medication" == inst.get_resource_type() impl_medication_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Medication" == data["resourceType"] inst2 = medication.Medication(**data) impl_medication_8(inst2) def impl_medication_9(inst): assert inst.code.coding[0].code == "108761006" assert inst.code.coding[0].display == "Capecitabine (product)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.contained[0].id == "sub03" assert inst.doseForm.coding[0].code == "385055001" assert inst.doseForm.coding[0].display == "Tablet dose form (qualifier value)" assert ( inst.doseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "med0321" assert inst.ingredient[0].item.reference.reference == "#sub03" assert inst.ingredient[0].strengthRatio.denominator.code == "385055001" assert ( inst.ingredient[0].strengthRatio.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.ingredient[0].strengthRatio.denominator.unit == "Tablet" assert float(inst.ingredient[0].strengthRatio.denominator.value) == float(1) assert inst.ingredient[0].strengthRatio.numerator.code == "mg" assert ( inst.ingredient[0].strengthRatio.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[0].strengthRatio.numerator.value) == float(500) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_medication_9(base_settings): """No. 9 tests collection for Medication. Test File: medicationexample0321.json """ filename = base_settings["unittest_data_dir"] / "medicationexample0321.json" inst = medication.Medication.model_validate_json(filename.read_bytes()) assert "Medication" == inst.get_resource_type() impl_medication_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Medication" == data["resourceType"] inst2 = medication.Medication(**data) impl_medication_9(inst2) def impl_medication_10(inst): assert inst.code.coding[0].code == "324252006" assert inst.code.coding[0].display == "Azithromycin 250mg capsule (product)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.contained[0].id == "sub03" assert inst.doseForm.coding[0].code == "385055001" assert inst.doseForm.coding[0].display == "Tablet dose form (qualifier value)" assert ( inst.doseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "med0320" assert inst.ingredient[0].item.reference.reference == "#sub03" assert inst.ingredient[0].strengthRatio.denominator.code == "TAB" assert ( inst.ingredient[0].strengthRatio.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert float(inst.ingredient[0].strengthRatio.denominator.value) == float(1) assert inst.ingredient[0].strengthRatio.numerator.code == "mg" assert ( inst.ingredient[0].strengthRatio.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.ingredient[0].strengthRatio.numerator.value) == float(250) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_medication_10(base_settings): """No. 10 tests collection for Medication. Test File: medicationexample0320.json """ filename = base_settings["unittest_data_dir"] / "medicationexample0320.json" inst = medication.Medication.model_validate_json(filename.read_bytes()) assert "Medication" == inst.get_resource_type() impl_medication_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Medication" == data["resourceType"] inst2 = medication.Medication(**data) impl_medication_10(inst2) ================================================ FILE: fhir/resources/tests/test_medicationadministration.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/MedicationAdministration Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import medicationadministration from .conftest import ExternalValidatorModel def impl_medicationadministration_1(inst): assert inst.contained[0].id == "med0301" assert inst.contained[1].id == "signature" assert inst.dosage.dose.code == "mg" assert ( inst.dosage.dose.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage.dose.unit == "mg" assert float(inst.dosage.dose.value) == float(500) assert inst.dosage.method.text == "IV Push" assert inst.dosage.route.coding[0].code == "47625008" assert inst.dosage.route.coding[0].display == "Intravenous route (qualifier value)" assert ( inst.dosage.route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage.text == "500mg IV q6h x 3 days" assert inst.encounter.display == "encounter who leads to this prescription" assert inst.encounter.reference == "Encounter/f001" assert inst.eventHistory[0].display == "Author's Signature" assert inst.eventHistory[0].reference == "#signature" assert inst.id == "medadmin0301" assert inst.medication.reference.reference == "#med0301" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurencePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T14:30:00+01:00"} ).valueDateTime ) assert inst.performer[0].actor.reference.display == "Patrick Pump" assert inst.performer[0].actor.reference.reference == "Practitioner/f007" assert inst.reason[0].concept.coding[0].code == "b" assert inst.reason[0].concept.coding[0].display == "Given as Ordered" assert ( inst.reason[0].concept.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/reason-medication-given" } ).valueUri ) assert inst.request.reference == "MedicationRequest/medrx0318" assert inst.status == "in-progress" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationadministration_1(base_settings): """No. 1 tests collection for MedicationAdministration. Test File: medicationadministration0301.json """ filename = base_settings["unittest_data_dir"] / "medicationadministration0301.json" inst = medicationadministration.MedicationAdministration.model_validate_json( filename.read_bytes() ) assert "MedicationAdministration" == inst.get_resource_type() impl_medicationadministration_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationAdministration" == data["resourceType"] inst2 = medicationadministration.MedicationAdministration(**data) impl_medicationadministration_1(inst2) def impl_medicationadministration_2(inst): assert inst.contained[0].id == "med0303" assert inst.encounter.reference == "Encounter/f001" assert inst.id == "medadminexample03" assert inst.medication.reference.reference == "#med0303" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == ( "Patient started Bupropion this morning - will administer in " "a reduced dose tomorrow" ) assert ( inst.occurencePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T14:30:00+01:00"} ).valueDateTime ) assert ( inst.occurencePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T14:30:00+01:00"} ).valueDateTime ) assert inst.request.reference == "MedicationRequest/medrx0317" assert inst.status == "on-hold" assert inst.statusReason[0].coding[0].code == "373147003" assert inst.statusReason[0].coding[0].display == ( "Administration of medication not done due to a " "contraindication (situation)" ) assert ( inst.statusReason[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.supportingInformation[0].reference == "Condition/f204" assert inst.text.status == "generated" def test_medicationadministration_2(base_settings): """No. 2 tests collection for MedicationAdministration. Test File: medicationadministrationexample3.json """ filename = ( base_settings["unittest_data_dir"] / "medicationadministrationexample3.json" ) inst = medicationadministration.MedicationAdministration.model_validate_json( filename.read_bytes() ) assert "MedicationAdministration" == inst.get_resource_type() impl_medicationadministration_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationAdministration" == data["resourceType"] inst2 = medicationadministration.MedicationAdministration(**data) impl_medicationadministration_2(inst2) def impl_medicationadministration_3(inst): assert inst.contained[0].id == "med0313" assert inst.device[0].reference.reference == "Device/f001" assert inst.dosage.dose.code == "mg" assert ( inst.dosage.dose.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage.dose.unit == "mg" assert float(inst.dosage.dose.value) == float(7) assert inst.dosage.method.coding[0].code == "420620005" assert ( inst.dosage.method.coding[0].display == "Push - dosing instruction imperative (qualifier value)" ) assert ( inst.dosage.method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage.rateQuantity.code == "min" assert ( inst.dosage.rateQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage.rateQuantity.unit == "min" assert float(inst.dosage.rateQuantity.value) == float(4) assert inst.dosage.route.coding[0].code == "255560000" assert inst.dosage.route.coding[0].display == "Intravenous" assert ( inst.dosage.route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage.text == ( "0.05 - 0.1mg/kg IV over 2-5 minutes every 15 minutes as " "needed" ) assert inst.encounter.display == "encounter who leads to this prescription" assert inst.encounter.reference == "Encounter/f001" assert inst.id == "medadmin0307" assert inst.medication.reference.reference == "#med0313" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurencePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T14:30:00+01:00"} ).valueDateTime ) assert ( inst.occurencePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T04:30:00+01:00"} ).valueDateTime ) assert inst.performer[0].actor.reference.display == "Patrick Pump" assert inst.performer[0].actor.reference.reference == "Practitioner/f007" assert inst.performer[0].function.coding[0].code == "performer" assert inst.performer[0].function.coding[0].display == "Performer" assert ( inst.performer[0].function.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/med-admin-perform-function" } ).valueUri ) assert inst.request.reference == "MedicationRequest/medrx0315" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationadministration_3(base_settings): """No. 3 tests collection for MedicationAdministration. Test File: medicationadministration0307.json """ filename = base_settings["unittest_data_dir"] / "medicationadministration0307.json" inst = medicationadministration.MedicationAdministration.model_validate_json( filename.read_bytes() ) assert "MedicationAdministration" == inst.get_resource_type() impl_medicationadministration_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationAdministration" == data["resourceType"] inst2 = medicationadministration.MedicationAdministration(**data) impl_medicationadministration_3(inst2) def impl_medicationadministration_4(inst): assert inst.contained[0].id == "med0304" assert inst.dosage.dose.code == "TAB" assert ( inst.dosage.dose.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosage.dose.unit == "TAB" assert float(inst.dosage.dose.value) == float(1) assert inst.dosage.route.coding[0].code == "26643006" assert inst.dosage.route.coding[0].display == "Oral Route" assert ( inst.dosage.route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage.text == ( "0.25mg PO every 6-12 hours as needed for menses from Jan " "15-20, 2015. Do not exceed more than 4mg per day" ) assert inst.id == "medadmin0311" assert inst.medication.reference.reference == "#med0304" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurencePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-16T02:03:00+01:00"} ).valueDateTime ) assert ( inst.occurencePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T22:03:00+01:00"} ).valueDateTime ) assert inst.performer[0].actor.reference.display == "Patrick Pump" assert inst.performer[0].actor.reference.reference == "Practitioner/f007" assert inst.reason[0].concept.coding[0].code == "266599000" assert inst.reason[0].concept.coding[0].display == "Dysmenorrhea" assert ( inst.reason[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.request.reference == "MedicationRequest/medrx0305" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationadministration_4(base_settings): """No. 4 tests collection for MedicationAdministration. Test File: medicationadministration0311.json """ filename = base_settings["unittest_data_dir"] / "medicationadministration0311.json" inst = medicationadministration.MedicationAdministration.model_validate_json( filename.read_bytes() ) assert "MedicationAdministration" == inst.get_resource_type() impl_medicationadministration_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationAdministration" == data["resourceType"] inst2 = medicationadministration.MedicationAdministration(**data) impl_medicationadministration_4(inst2) def impl_medicationadministration_5(inst): assert inst.contained[0].id == "med0304" assert inst.dosage.dose.code == "mg" assert ( inst.dosage.dose.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage.dose.unit == "mg" assert float(inst.dosage.dose.value) == float(6) assert inst.dosage.route.coding[0].code == "26643006" assert inst.dosage.route.coding[0].display == "Oral route (qualifier value)" assert ( inst.dosage.route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage.text == ( "6 mg PO daily for remission induction; adjust dosage to " "white blood cell (WBC) count. With hold treatment if WBC is" " less than 15,000/µL; resume when WBC is greater than " "50,000/µL" ) assert inst.id == "medadmin0310" assert inst.medication.reference.reference == "#med0304" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurencePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-16T02:03:00+01:00"} ).valueDateTime ) assert ( inst.occurencePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T22:03:00+01:00"} ).valueDateTime ) assert inst.performer[0].actor.reference.display == "Patrick Pump" assert inst.performer[0].actor.reference.reference == "Practitioner/f007" assert inst.request.reference == "MedicationRequest/medrx0306" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationadministration_5(base_settings): """No. 5 tests collection for MedicationAdministration. Test File: medicationadministration0310.json """ filename = base_settings["unittest_data_dir"] / "medicationadministration0310.json" inst = medicationadministration.MedicationAdministration.model_validate_json( filename.read_bytes() ) assert "MedicationAdministration" == inst.get_resource_type() impl_medicationadministration_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationAdministration" == data["resourceType"] inst2 = medicationadministration.MedicationAdministration(**data) impl_medicationadministration_5(inst2) def impl_medicationadministration_6(inst): assert inst.contained[0].id == "med0306" assert inst.dosage.dose.code == "TAB" assert ( inst.dosage.dose.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosage.dose.unit == "TAB" assert float(inst.dosage.dose.value) == float(2) assert inst.dosage.method.coding[0].code == "421521009" assert ( inst.dosage.method.coding[0].display == "Swallow - dosing instruction imperative (qualifier value)" ) assert ( inst.dosage.method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage.route.coding[0].code == "26643006" assert inst.dosage.route.coding[0].display == "Oral Route" assert ( inst.dosage.route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage.text == "Two tablets at once" assert inst.encounter.display == "encounter who leads to this prescription" assert inst.encounter.reference == "Encounter/f001" assert inst.id == "medadmin0306" assert inst.medication.reference.reference == "#med0306" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurencePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T14:30:00+01:00"} ).valueDateTime ) assert ( inst.occurencePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T04:30:00+01:00"} ).valueDateTime ) assert inst.performer[0].actor.reference.display == "Patrick Pump" assert inst.performer[0].actor.reference.reference == "Practitioner/f007" assert inst.performer[0].function.coding[0].code == "performer" assert inst.performer[0].function.coding[0].display == "Performer" assert ( inst.performer[0].function.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/med-admin-perform-function" } ).valueUri ) assert inst.request.reference == "MedicationRequest/medrx0302" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationadministration_6(base_settings): """No. 6 tests collection for MedicationAdministration. Test File: medicationadministration0306.json """ filename = base_settings["unittest_data_dir"] / "medicationadministration0306.json" inst = medicationadministration.MedicationAdministration.model_validate_json( filename.read_bytes() ) assert "MedicationAdministration" == inst.get_resource_type() impl_medicationadministration_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationAdministration" == data["resourceType"] inst2 = medicationadministration.MedicationAdministration(**data) impl_medicationadministration_6(inst2) def impl_medicationadministration_7(inst): assert inst.contained[0].id == "med0318" assert inst.device[0].reference.reference == "Device/f001" assert inst.dosage.dose.code == "mL" assert ( inst.dosage.dose.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage.dose.unit == "mL" assert float(inst.dosage.dose.value) == float(1000) assert inst.dosage.method.text == "PICC line" assert inst.dosage.rateRatio.denominator.code == "h" assert ( inst.dosage.rateRatio.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage.rateRatio.denominator.unit == "h" assert float(inst.dosage.rateRatio.denominator.value) == float(1) assert inst.dosage.rateRatio.numerator.code == "mL" assert ( inst.dosage.rateRatio.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage.rateRatio.numerator.unit == "mL" assert float(inst.dosage.rateRatio.numerator.value) == float(50) assert inst.dosage.route.coding[0].code == "255560000" assert inst.dosage.route.coding[0].display == "Intravenous" assert ( inst.dosage.route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage.site.coding[0].code == "6073002" assert ( inst.dosage.site.coding[0].display == "Structure of ligament of left superior vena cava" ) assert ( inst.dosage.site.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.dosage.text == "1000mL infused at 50ml/hour for 4 hours - hung at 2200 hours" ) assert inst.id == "medadmin0309" assert inst.medication.reference.reference == "#med0318" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurencePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-16T02:03:00+01:00"} ).valueDateTime ) assert ( inst.occurencePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T22:03:00+01:00"} ).valueDateTime ) assert inst.performer[0].actor.reference.display == "Patrick Pump" assert inst.performer[0].actor.reference.reference == "Practitioner/f007" assert inst.performer[0].function.coding[0].code == "performer" assert inst.performer[0].function.coding[0].display == "Performer" assert ( inst.performer[0].function.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/med-admin-perform-function" } ).valueUri ) assert inst.request.reference == "MedicationRequest/medrx0323" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationadministration_7(base_settings): """No. 7 tests collection for MedicationAdministration. Test File: medicationadministration0309.json """ filename = base_settings["unittest_data_dir"] / "medicationadministration0309.json" inst = medicationadministration.MedicationAdministration.model_validate_json( filename.read_bytes() ) assert "MedicationAdministration" == inst.get_resource_type() impl_medicationadministration_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationAdministration" == data["resourceType"] inst2 = medicationadministration.MedicationAdministration(**data) impl_medicationadministration_7(inst2) def impl_medicationadministration_8(inst): assert inst.dosage.dose.code == "mg" assert ( inst.dosage.dose.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage.dose.unit == "mg" assert float(inst.dosage.dose.value) == float(240) assert inst.dosage.site.coding[0].code == "34402009" assert inst.dosage.site.coding[0].display == "Rectum structure" assert ( inst.dosage.site.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage.text == ( "Insert one suppository rectally twice daily as needed for " "fever to a maximim of 3 per day" ) assert inst.id == "medadmin0313" assert inst.medication.concept.coding[0].code == "322254008" assert ( inst.medication.concept.coding[0].display == "Paracetamol 240mg suppository (product)" ) assert ( inst.medication.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurencePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-16T02:03:00+01:00"} ).valueDateTime ) assert ( inst.occurencePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T22:03:00+01:00"} ).valueDateTime ) assert inst.performer[0].actor.reference.display == "Patrick Pump" assert inst.performer[0].actor.reference.reference == "Practitioner/f007" assert inst.reason[0].concept.coding[0].code == "c" assert inst.reason[0].concept.coding[0].display == "Emergency" assert ( inst.reason[0].concept.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/reason-medication-given" } ).valueUri ) assert inst.request.reference == "MedicationRequest/medrx0324" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationadministration_8(base_settings): """No. 8 tests collection for MedicationAdministration. Test File: medicationadministration0313.json """ filename = base_settings["unittest_data_dir"] / "medicationadministration0313.json" inst = medicationadministration.MedicationAdministration.model_validate_json( filename.read_bytes() ) assert "MedicationAdministration" == inst.get_resource_type() impl_medicationadministration_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationAdministration" == data["resourceType"] inst2 = medicationadministration.MedicationAdministration(**data) impl_medicationadministration_8(inst2) def impl_medicationadministration_9(inst): assert inst.contained[0].id == "med0306" assert inst.dosage.dose.code == "mg/kg" assert ( inst.dosage.dose.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage.dose.unit == "mg/kg" assert float(inst.dosage.dose.value) == float(1.8) assert ( inst.dosage.rateRatio.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage.rateRatio.denominator.unit == "min" assert float(inst.dosage.rateRatio.denominator.value) == float(30) assert ( inst.dosage.rateRatio.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage.rateRatio.numerator.unit == "ml" assert float(inst.dosage.rateRatio.numerator.value) == float(250) assert inst.dosage.route.coding[0].code == "255560000" assert inst.dosage.route.coding[0].display == "Intravenous" assert ( inst.dosage.route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage.text == "1.8 mg/kg IV infusion over 30 minutes" assert inst.encounter.display == "encounter who leads to this prescription" assert inst.encounter.reference == "Encounter/f001" assert inst.id == "medadmin0305" assert inst.medication.reference.reference == "#med0306" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurencePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T14:30:00+01:00"} ).valueDateTime ) assert ( inst.occurencePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T04:30:00+01:00"} ).valueDateTime ) assert inst.performer[0].actor.reference.display == "Patrick Pump" assert inst.performer[0].actor.reference.reference == "Practitioner/f007" assert inst.request.reference == "MedicationRequest/medrx0316" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationadministration_9(base_settings): """No. 9 tests collection for MedicationAdministration. Test File: medicationadministration0305.json """ filename = base_settings["unittest_data_dir"] / "medicationadministration0305.json" inst = medicationadministration.MedicationAdministration.model_validate_json( filename.read_bytes() ) assert "MedicationAdministration" == inst.get_resource_type() impl_medicationadministration_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationAdministration" == data["resourceType"] inst2 = medicationadministration.MedicationAdministration(**data) impl_medicationadministration_9(inst2) def impl_medicationadministration_10(inst): assert inst.contained[0].id == "med0303" assert inst.dosage.dose.code == "mg" assert ( inst.dosage.dose.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage.dose.unit == "mg" assert float(inst.dosage.dose.value) == float(3) assert inst.dosage.method.coding[0].code == "422145002" assert ( inst.dosage.method.coding[0].display == "Inject - dosing instruction imperative (qualifier value)" ) assert ( inst.dosage.method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage.route.coding[0].code == "47625008" assert inst.dosage.route.coding[0].display == "Intravenous route (qualifier value)" assert ( inst.dosage.route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage.text == ( "Rapid daily-dose escalation, until tolerated, from 3 mg/d, " "and then 10 mg/d, to the recommended maintenance dose of 30 " "mg IV over 120 min, 3 times per wk on alternate days for up " "to 12 wk" ) assert inst.encounter.display == "encounter who leads to this prescription" assert inst.encounter.reference == "Encounter/f001" assert inst.id == "medadmin0304" assert inst.medication.reference.reference == "#med0303" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurencePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T14:30:00+01:00"} ).valueDateTime ) assert ( inst.occurencePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T04:30:00+01:00"} ).valueDateTime ) assert inst.performer[0].actor.reference.display == "Patrick Pump" assert inst.performer[0].actor.reference.reference == "Practitioner/f007" assert inst.reason[0].reference.reference == "Condition/f202" assert inst.request.reference == "MedicationRequest/medrx0319" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationadministration_10(base_settings): """No. 10 tests collection for MedicationAdministration. Test File: medicationadministration0304.json """ filename = base_settings["unittest_data_dir"] / "medicationadministration0304.json" inst = medicationadministration.MedicationAdministration.model_validate_json( filename.read_bytes() ) assert "MedicationAdministration" == inst.get_resource_type() impl_medicationadministration_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationAdministration" == data["resourceType"] inst2 = medicationadministration.MedicationAdministration(**data) impl_medicationadministration_10(inst2) ================================================ FILE: fhir/resources/tests/test_medicationdispense.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/MedicationDispense Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import medicationdispense from .conftest import ExternalValidatorModel def impl_medicationdispense_1(inst): assert inst.authorizingPrescription[0].reference == "MedicationRequest/medrx0316" assert inst.contained[0].id == "med0306" assert inst.daysSupply.code == "d" assert ( inst.daysSupply.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.daysSupply.unit == "Day" assert float(inst.daysSupply.value) == float(1) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "mg/kg" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "mg/kg" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 1.8 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].route.coding[0].code == "255560000" assert inst.dosageInstruction[0].route.coding[0].display == "Intravenous" assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == ( "1.8 mg/kg IV infusion over 30 minutes every 3 weeks for 16 " "cycles" ) assert inst.dosageInstruction[0].timing.repeat.count == 16 assert inst.dosageInstruction[0].timing.repeat.frequency == 1 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(3) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "wk" assert inst.id == "meddisp0317" assert inst.medication.reference.display == "Brentixumab Vedotin (Adcetris)" assert inst.medication.reference.reference == "#med0306" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.reference == "Practitioner/f006" assert inst.quantity.code == "415818005" assert ( inst.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert float(inst.quantity.value) == float(3) assert inst.status == "stopped" assert inst.subject.display == "Donald Duck " assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" assert inst.type.coding[0].code == "TF" assert inst.type.coding[0].display == "Trial Fill" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.whenHandedOver == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-06-26T07:13:00+05:00"} ).valueDateTime ) assert ( inst.whenPrepared == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-06-25T07:13:00+05:00"} ).valueDateTime ) def test_medicationdispense_1(base_settings): """No. 1 tests collection for MedicationDispense. Test File: medicationdispense0317.json """ filename = base_settings["unittest_data_dir"] / "medicationdispense0317.json" inst = medicationdispense.MedicationDispense.model_validate_json( filename.read_bytes() ) assert "MedicationDispense" == inst.get_resource_type() impl_medicationdispense_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationDispense" == data["resourceType"] inst2 = medicationdispense.MedicationDispense(**data) impl_medicationdispense_1(inst2) def impl_medicationdispense_2(inst): assert inst.authorizingPrescription[0].reference == "MedicationRequest/medrx0318" assert inst.contained[0].id == "med0301" assert inst.daysSupply.code == "d" assert ( inst.daysSupply.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.daysSupply.unit == "Day" assert float(inst.daysSupply.value) == float(3) assert inst.destination.reference == "Location/ph" assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "mg" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "mg" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 500 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].method.coding[0].code == "420620005" assert ( inst.dosageInstruction[0].method.coding[0].display == "Push - dosing instruction imperative (qualifier value)" ) assert ( inst.dosageInstruction[0].method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].route.coding[0].code == "255560000" assert inst.dosageInstruction[0].route.coding[0].display == "Intravenous" assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == "500mg IV q6h x 3 days" assert inst.dosageInstruction[0].timing.repeat.frequency == 1 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(6) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "h" assert inst.id == "meddisp0301" assert inst.location.display == "Pharmacy" assert inst.location.reference == "Location/ukp" assert inst.medication.reference.display == "Vancomycin Hydrochloride" assert inst.medication.reference.reference == "#med0301" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.reference == "Practitioner/f006" assert inst.quantity.code == "733026001" assert ( inst.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info.sct"} ).valueUri ) assert inst.quantity.unit == "Vial" assert float(inst.quantity.value) == float(12) assert inst.receiver[0].display == "Donald Duck" assert inst.receiver[0].reference == "Patient/pat1" assert inst.status == "in-progress" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.supportingInformation[0].reference == "Condition/f203" assert inst.text.status == "generated" assert inst.type.coding[0].code == "EM" assert inst.type.coding[0].display == "Emergency Supply" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.whenPrepared == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T10:20:00Z"} ).valueDateTime ) def test_medicationdispense_2(base_settings): """No. 2 tests collection for MedicationDispense. Test File: medicationdispense0301.json """ filename = base_settings["unittest_data_dir"] / "medicationdispense0301.json" inst = medicationdispense.MedicationDispense.model_validate_json( filename.read_bytes() ) assert "MedicationDispense" == inst.get_resource_type() impl_medicationdispense_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationDispense" == data["resourceType"] inst2 = medicationdispense.MedicationDispense(**data) impl_medicationdispense_2(inst2) def impl_medicationdispense_3(inst): assert inst.authorizingPrescription[0].reference == "MedicationRequest/medrx0321" assert inst.daysSupply.code == "d" assert ( inst.daysSupply.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.daysSupply.unit == "Day" assert float(inst.daysSupply.value) == float(10) assert ( inst.dosageInstruction[0].additionalInstruction[0].coding[0].code == "418914006" ) assert inst.dosageInstruction[0].additionalInstruction[0].coding[0].display == ( "Warning. May cause drowsiness. If affected do not drive or " "operate machinery. Avoid alcoholic drink (qualifier value)" ) assert ( inst.dosageInstruction[0].additionalInstruction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].asNeededFor[0].coding[0].code == "203082005" assert ( inst.dosageInstruction[0].asNeededFor[0].coding[0].display == "Fibromyalgia (disorder)" ) assert ( inst.dosageInstruction[0].asNeededFor[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "TAB" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "TAB" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 1 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].route.coding[0].code == "26643006" assert inst.dosageInstruction[0].route.coding[0].display == "Oral Route" assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert ( inst.dosageInstruction[0].text == "1 tablet every four hours as needed for pain" ) assert inst.dosageInstruction[0].timing.repeat.frequency == 1 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(4) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "h" assert inst.id == "meddisp0321" assert inst.medication.concept.coding[0].code == "0074-3043-13" assert ( inst.medication.concept.coding[0].display == "Vicodin 5mg Hydrocodone, 500mg Acetaminophen tablet " ) assert ( inst.medication.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/ndc"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.reference == "Practitioner/f006" assert inst.quantity.code == "TAB" assert ( inst.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert float(inst.quantity.value) == float(30) assert inst.status == "in-progress" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" assert inst.type.coding[0].code == "RFP" assert inst.type.coding[0].display == "Refill - Part Fill" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.whenPrepared == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T10:20:00Z"} ).valueDateTime ) def test_medicationdispense_3(base_settings): """No. 3 tests collection for MedicationDispense. Test File: medicationdispense0321.json """ filename = base_settings["unittest_data_dir"] / "medicationdispense0321.json" inst = medicationdispense.MedicationDispense.model_validate_json( filename.read_bytes() ) assert "MedicationDispense" == inst.get_resource_type() impl_medicationdispense_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationDispense" == data["resourceType"] inst2 = medicationdispense.MedicationDispense(**data) impl_medicationdispense_3(inst2) def impl_medicationdispense_4(inst): assert inst.authorizingPrescription[0].reference == "MedicationRequest/medrx0323" assert inst.contained[0].id == "med0318" assert inst.daysSupply.code == "d" assert ( inst.daysSupply.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.daysSupply.unit == "Day" assert float(inst.daysSupply.value) == float(1) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "mL" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "mL" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 1000 ) assert inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.code == "h" assert ( inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.unit == "h" assert float( inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.value ) == float(1) assert inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.code == "mL" assert ( inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.unit == "mL" assert float( inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.value ) == float(50) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].route.coding[0].code == "255560000" assert inst.dosageInstruction[0].route.coding[0].display == "Intravenous" assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert ( inst.dosageInstruction[0].text == "1000mL infused at 50ml/hour for 4 hours - hang at 2200 hours" ) assert ( inst.dosageInstruction[0].timing.event[0] == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T22:00:00+11:00"} ).valueDateTime ) assert inst.dosageInstruction[0].timing.repeat.frequency == 1 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(24) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "h" assert inst.id == "meddisp0320" assert inst.medication.reference.display == "TPN Solution" assert inst.medication.reference.reference == "#med0318" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.reference == "Practitioner/f006" assert inst.quantity.code == "ml" assert ( inst.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.quantity.value) == float(1000) assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" assert ( inst.whenHandedOver == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-03-17T17:13:00+05:00"} ).valueDateTime ) assert ( inst.whenPrepared == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-03-16T17:13:00+05:00"} ).valueDateTime ) def test_medicationdispense_4(base_settings): """No. 4 tests collection for MedicationDispense. Test File: medicationdispense0320.json """ filename = base_settings["unittest_data_dir"] / "medicationdispense0320.json" inst = medicationdispense.MedicationDispense.model_validate_json( filename.read_bytes() ) assert "MedicationDispense" == inst.get_resource_type() impl_medicationdispense_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationDispense" == data["resourceType"] inst2 = medicationdispense.MedicationDispense(**data) impl_medicationdispense_4(inst2) def impl_medicationdispense_5(inst): assert inst.authorizingPrescription[0].reference == "MedicationRequest/medrx0320" assert inst.daysSupply.code == "d" assert ( inst.daysSupply.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.daysSupply.unit == "Day" assert float(inst.daysSupply.value) == float(30) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "U" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "U" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 20 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].route.coding[0].code == "263887005" assert ( inst.dosageInstruction[0].route.coding[0].display == "Subcutaneous (qualifier value)" ) assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == "20 Units SC three times daily" assert inst.dosageInstruction[0].timing.repeat.frequency == 3 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert inst.id == "meddisp0316" assert inst.medication.concept.coding[0].code == "285018" assert ( inst.medication.concept.coding[0].display == "Lantus 100 unit/ml injectable solution" ) assert ( inst.medication.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.reference == "Practitioner/f006" assert inst.quantity.code == "ml" assert ( inst.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.quantity.value) == float(10) assert inst.status == "in-progress" assert inst.subject.display == "Donald Duck " assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" assert inst.type.coding[0].code == "RFP" assert inst.type.coding[0].display == "Refill - Part Fill" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.whenPrepared == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-06-25T07:13:00+05:00"} ).valueDateTime ) def test_medicationdispense_5(base_settings): """No. 5 tests collection for MedicationDispense. Test File: medicationdispense0316.json """ filename = base_settings["unittest_data_dir"] / "medicationdispense0316.json" inst = medicationdispense.MedicationDispense.model_validate_json( filename.read_bytes() ) assert "MedicationDispense" == inst.get_resource_type() impl_medicationdispense_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationDispense" == data["resourceType"] inst2 = medicationdispense.MedicationDispense(**data) impl_medicationdispense_5(inst2) def impl_medicationdispense_6(inst): assert inst.authorizingPrescription[0].reference == "MedicationRequest/medrx0321" assert inst.daysSupply.code == "d" assert ( inst.daysSupply.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.daysSupply.unit == "Day" assert float(inst.daysSupply.value) == float(30) assert inst.dosageInstruction[0].additionalInstruction[0].text == "Shake Well" assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "ORINHL" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "ea" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 1 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == "Use two sprays twice daily" assert inst.dosageInstruction[0].timing.repeat.frequency == 2 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert inst.id == "meddisp0327" assert inst.medication.concept.coding[0].code == "746763" assert inst.medication.concept.coding[0].display == ( "Proventil 0.09mg/actuat (Albuterol sulfate 0.108mg/actuat " "from mouthpiece)" ) assert ( inst.medication.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.reference == "Practitioner/f006" assert inst.quantity.code == "ml" assert ( inst.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.quantity.value) == float(30) assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" assert inst.type.coding[0].code == "TF" assert inst.type.coding[0].display == "Trial Fill" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.whenHandedOver == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T16:20:00Z"} ).valueDateTime ) assert ( inst.whenPrepared == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T10:20:00Z"} ).valueDateTime ) def test_medicationdispense_6(base_settings): """No. 6 tests collection for MedicationDispense. Test File: medicationdispense0327.json """ filename = base_settings["unittest_data_dir"] / "medicationdispense0327.json" inst = medicationdispense.MedicationDispense.model_validate_json( filename.read_bytes() ) assert "MedicationDispense" == inst.get_resource_type() impl_medicationdispense_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationDispense" == data["resourceType"] inst2 = medicationdispense.MedicationDispense(**data) impl_medicationdispense_6(inst2) def impl_medicationdispense_7(inst): assert inst.authorizingPrescription[0].reference == "MedicationRequest/medrx0309" assert inst.contained[0].id == "medexample015" assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "mg" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "mg" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 500 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].route.coding[0].code == "394899003" assert ( inst.dosageInstruction[0].route.coding[0].display == "oral administration of treatment" ) assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].timing.repeat.frequency == 2 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(21) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert inst.id == "meddisp008" assert inst.medication.reference.reference == "#medexample015" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.reference == "Practitioner/f006" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationdispense_7(base_settings): """No. 7 tests collection for MedicationDispense. Test File: medicationdispenseexample8.json """ filename = base_settings["unittest_data_dir"] / "medicationdispenseexample8.json" inst = medicationdispense.MedicationDispense.model_validate_json( filename.read_bytes() ) assert "MedicationDispense" == inst.get_resource_type() impl_medicationdispense_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationDispense" == data["resourceType"] inst2 = medicationdispense.MedicationDispense(**data) impl_medicationdispense_7(inst2) def impl_medicationdispense_8(inst): assert inst.authorizingPrescription[0].reference == "MedicationRequest/medrx0331" assert inst.contained[0].id == "med0352" assert inst.daysSupply.code == "d" assert ( inst.daysSupply.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.daysSupply.unit == "Day" assert float(inst.daysSupply.value) == float(1) assert inst.dosageInstruction[0].additionalInstruction[0].text == ( "Take along with one 2mg Coumadin tablet for a total daily " "dose of 7mg as prescribed by physician" ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "mg" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "mg" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 2 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert ( inst.dosageInstruction[0].text == "7mg (=one 5mg tablet PLUS one 2mg tablet) once daily" ) assert inst.dosageInstruction[0].timing.repeat.frequency == 1 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert inst.id == "meddisp0331" assert inst.medication.reference.display == "Coumadin 2mg tablet" assert inst.medication.reference.reference == "#med0352" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.reference == "Practitioner/f006" assert inst.quantity.code == "415818006" assert ( inst.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert float(inst.quantity.value) == float(1) assert inst.status == "in-progress" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" assert inst.type.coding[0].code == "DF" assert inst.type.coding[0].display == "Daily Fill" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.whenPrepared == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T10:20:00Z"} ).valueDateTime ) def test_medicationdispense_8(base_settings): """No. 8 tests collection for MedicationDispense. Test File: medicationdispense0331.json """ filename = base_settings["unittest_data_dir"] / "medicationdispense0331.json" inst = medicationdispense.MedicationDispense.model_validate_json( filename.read_bytes() ) assert "MedicationDispense" == inst.get_resource_type() impl_medicationdispense_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationDispense" == data["resourceType"] inst2 = medicationdispense.MedicationDispense(**data) impl_medicationdispense_8(inst2) def impl_medicationdispense_9(inst): assert inst.authorizingPrescription[0].reference == "MedicationRequest/medrx0324" assert inst.daysSupply.code == "d" assert ( inst.daysSupply.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.daysSupply.unit == "Day" assert float(inst.daysSupply.value) == float(10) assert ( inst.dosageInstruction[0].additionalInstruction[0].coding[0].code == "418637003" ) assert inst.dosageInstruction[0].additionalInstruction[0].coding[0].display == ( "Do not take with any other paracetamol products (qualifier " "value)" ) assert ( inst.dosageInstruction[0].additionalInstruction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].asNeededFor[0].coding[0].code == "386661006" assert ( inst.dosageInstruction[0].asNeededFor[0].coding[0].display == "Fever (finding)" ) assert ( inst.dosageInstruction[0].asNeededFor[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "mg" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "mg" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 240 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].maxDosePerPeriod[0].denominator.code == "d" assert ( inst.dosageInstruction[0].maxDosePerPeriod[0].denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float( inst.dosageInstruction[0].maxDosePerPeriod[0].denominator.value ) == float(1) assert inst.dosageInstruction[0].maxDosePerPeriod[0].numerator.code == "mg" assert ( inst.dosageInstruction[0].maxDosePerPeriod[0].numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float( inst.dosageInstruction[0].maxDosePerPeriod[0].numerator.value ) == float(720) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == ( "Insert two suppositories (240mg) rectally twice daily as " "needed for fever to a maximim of 6 per day" ) assert inst.dosageInstruction[0].timing.repeat.frequency == 2 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert inst.id == "meddisp0311" assert inst.medication.concept.coding[0].code == "0713-0118" assert ( inst.medication.concept.coding[0].display == "Acetaminophen 120mg Suppository" ) assert ( inst.medication.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/ndc"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.reference == "Practitioner/f006" assert inst.quantity.code == "RECSUPP" assert ( inst.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert float(inst.quantity.value) == float(60) assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" assert inst.type.coding[0].code == "RFP" assert inst.type.coding[0].display == "Refill - Part Fill" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.whenHandedOver == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T16:20:00Z"} ).valueDateTime ) assert ( inst.whenPrepared == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T10:20:00Z"} ).valueDateTime ) def test_medicationdispense_9(base_settings): """No. 9 tests collection for MedicationDispense. Test File: medicationdispense0311.json """ filename = base_settings["unittest_data_dir"] / "medicationdispense0311.json" inst = medicationdispense.MedicationDispense.model_validate_json( filename.read_bytes() ) assert "MedicationDispense" == inst.get_resource_type() impl_medicationdispense_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationDispense" == data["resourceType"] inst2 = medicationdispense.MedicationDispense(**data) impl_medicationdispense_9(inst2) def impl_medicationdispense_10(inst): assert inst.authorizingPrescription[0].reference == "MedicationRequest/medrx0306" assert inst.daysSupply.code == "d" assert ( inst.daysSupply.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.daysSupply.unit == "Day" assert float(inst.daysSupply.value) == float(30) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "mg" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "mg" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 6 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "calculated" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Calculated" ) assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == "Take 3 tablets (6mg) once daily" assert inst.dosageInstruction[0].timing.repeat.frequency == 1 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert inst.id == "meddisp0307" assert inst.medication.concept.coding[0].code == "76388-713-25" assert ( inst.medication.concept.coding[0].display == "Myleran 2mg tablet, film coated" ) assert ( inst.medication.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/ndc"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.reference == "Practitioner/f006" assert inst.quantity.code == "TAB" assert ( inst.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert float(inst.quantity.value) == float(90) assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" assert inst.type.coding[0].code == "RFP" assert inst.type.coding[0].display == "Refill - Part Fill" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert ( inst.whenHandedOver == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T16:20:00Z"} ).valueDateTime ) assert ( inst.whenPrepared == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15T10:20:00Z"} ).valueDateTime ) def test_medicationdispense_10(base_settings): """No. 10 tests collection for MedicationDispense. Test File: medicationdispense0307.json """ filename = base_settings["unittest_data_dir"] / "medicationdispense0307.json" inst = medicationdispense.MedicationDispense.model_validate_json( filename.read_bytes() ) assert "MedicationDispense" == inst.get_resource_type() impl_medicationdispense_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationDispense" == data["resourceType"] inst2 = medicationdispense.MedicationDispense(**data) impl_medicationdispense_10(inst2) ================================================ FILE: fhir/resources/tests/test_medicationknowledge.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/MedicationKnowledge Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import medicationknowledge from .conftest import ExternalValidatorModel def impl_medicationknowledge_1(inst): assert inst.code.coding[0].code == "0409-6531-02" assert ( inst.code.coding[0].display == "Vancomycin Hydrochloride (VANCOMYCIN HYDROCHLORIDE)" ) assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/ndc"} ).valueUri ) assert inst.definitional.doseForm.coding[0].code == "385268001" assert ( inst.definitional.doseForm.coding[0].display == "Oral Dose Form (qualifier value)" ) assert ( inst.definitional.doseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0] == "Vancomycin Hydrochloride (VANCOMYCIN HYDROCHLORIDE)" assert inst.status == "active" assert inst.text.status == "generated" def test_medicationknowledge_1(base_settings): """No. 1 tests collection for MedicationKnowledge. Test File: medicationknowledge-example.json """ filename = base_settings["unittest_data_dir"] / "medicationknowledge-example.json" inst = medicationknowledge.MedicationKnowledge.model_validate_json( filename.read_bytes() ) assert "MedicationKnowledge" == inst.get_resource_type() impl_medicationknowledge_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationKnowledge" == data["resourceType"] inst2 = medicationknowledge.MedicationKnowledge(**data) impl_medicationknowledge_1(inst2) ================================================ FILE: fhir/resources/tests/test_medicationrequest.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/MedicationRequest Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import medicationrequest from .conftest import ExternalValidatorModel def impl_medicationrequest_1(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.dispenseRequest.expectedSupplyDuration.code == "d" assert ( inst.dispenseRequest.expectedSupplyDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dispenseRequest.expectedSupplyDuration.unit == "days" assert float(inst.dispenseRequest.expectedSupplyDuration.value) == float(30) assert inst.dispenseRequest.numberOfRepeatsAllowed == 3 assert inst.dispenseRequest.quantity.code == "mL" assert ( inst.dispenseRequest.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dispenseRequest.quantity.unit == "mL" assert float(inst.dispenseRequest.quantity.value) == float(30) assert ( inst.dispenseRequest.validityPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-15"} ).valueDateTime ) assert ( inst.dispenseRequest.validityPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.dosageInstruction[0].additionalInstruction[0].text == "Shake Well" assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "ORINHL" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "ea" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 1 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == "Use two sprays twice daily" assert inst.dosageInstruction[0].timing.repeat.frequency == 2 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert inst.id == "medrx0326" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/portal/prescriptions"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345689" assert inst.intent == "order" assert inst.medication.concept.coding[0].code == "746763" assert ( inst.medication.concept.coding[0].display == "Proventil HFA 90mcg/actuat metered dose inhaler, 200 actuat" ) assert ( inst.medication.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.requester.display == "Patrick Pump" assert inst.requester.reference == "Practitioner/f007" assert inst.status == "on-hold" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.substitution.allowedBoolean is True assert inst.substitution.reason.coding[0].code == "FP" assert inst.substitution.reason.coding[0].display == "formulary policy" assert ( inst.substitution.reason.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_medicationrequest_1(base_settings): """No. 1 tests collection for MedicationRequest. Test File: medicationrequest0326.json """ filename = base_settings["unittest_data_dir"] / "medicationrequest0326.json" inst = medicationrequest.MedicationRequest.model_validate_json( filename.read_bytes() ) assert "MedicationRequest" == inst.get_resource_type() impl_medicationrequest_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationRequest" == data["resourceType"] inst2 = medicationrequest.MedicationRequest(**data) impl_medicationrequest_1(inst2) def impl_medicationrequest_2(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.contained[0].id == "med0305" assert inst.dispenseRequest.expectedSupplyDuration.code == "d" assert ( inst.dispenseRequest.expectedSupplyDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dispenseRequest.expectedSupplyDuration.unit == "days" assert float(inst.dispenseRequest.expectedSupplyDuration.value) == float(30) assert inst.dispenseRequest.numberOfRepeatsAllowed == 1 assert inst.dispenseRequest.quantity.code == "mL" assert ( inst.dispenseRequest.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dispenseRequest.quantity.unit == "mL" assert float(inst.dispenseRequest.quantity.value) == float(10) assert ( inst.dispenseRequest.validityPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-15"} ).valueDateTime ) assert ( inst.dispenseRequest.validityPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "OPDROP" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "OPDROP" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 1 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].method.coding[0].code == "421538008" assert ( inst.dosageInstruction[0].method.coding[0].display == "Instill - dosing instruction imperative (qualifier value)" ) assert ( inst.dosageInstruction[0].method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].route.coding[0].code == "54485002" assert ( inst.dosageInstruction[0].route.coding[0].display == "Ophthalmic route (qualifier value)" ) assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == "Instil one drop in each eye twice daily" assert inst.dosageInstruction[0].timing.repeat.frequency == 2 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert inst.encounter.display == "encounter who leads to this prescription" assert inst.encounter.reference == "Encounter/f002" assert inst.id == "medrx0330" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/portal/prescriptions"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345689" assert inst.intent == "order" assert inst.medication.reference.reference == "#med0305" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.requester.display == "Patrick Pump" assert inst.requester.reference == "Practitioner/f007" assert inst.status == "active" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.substitution.allowedBoolean is False assert inst.substitution.reason.coding[0].code == "FP" assert inst.substitution.reason.coding[0].display == "formulary policy" assert ( inst.substitution.reason.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_medicationrequest_2(base_settings): """No. 2 tests collection for MedicationRequest. Test File: medicationrequest0330.json """ filename = base_settings["unittest_data_dir"] / "medicationrequest0330.json" inst = medicationrequest.MedicationRequest.model_validate_json( filename.read_bytes() ) assert "MedicationRequest" == inst.get_resource_type() impl_medicationrequest_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationRequest" == data["resourceType"] inst2 = medicationrequest.MedicationRequest(**data) impl_medicationrequest_2(inst2) def impl_medicationrequest_3(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.contained[0].id == "med0309" assert inst.dosageInstruction[0].additionalInstruction[0].text == "Take at bedtime" assert inst.dosageInstruction[0].asNeededFor[0].coding[0].code == "32914008" assert inst.dosageInstruction[0].asNeededFor[0].coding[0].display == "Restless Legs" assert ( inst.dosageInstruction[0].asNeededFor[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseRange.high.code == "TAB" assert ( inst.dosageInstruction[0].doseAndRate[0].doseRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseRange.high.unit == "TAB" assert float( inst.dosageInstruction[0].doseAndRate[0].doseRange.high.value ) == float(2) assert inst.dosageInstruction[0].doseAndRate[0].doseRange.low.code == "TAB" assert ( inst.dosageInstruction[0].doseAndRate[0].doseRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseRange.low.unit == "TAB" assert float(inst.dosageInstruction[0].doseAndRate[0].doseRange.low.value) == float( 1 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].route.coding[0].code == "26643006" assert inst.dosageInstruction[0].route.coding[0].display == "Oral Route" assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == ( "Take 1-2 tablets once daily at bedtime as needed for " "restless legs" ) assert inst.dosageInstruction[0].timing.repeat.frequency == 1 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert inst.encounter.display == "encounter who leads to this prescription" assert inst.encounter.reference == "Encounter/f001" assert inst.id == "medrx0310" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/portal/prescriptions"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345689" assert inst.intent == "order" assert inst.medication.reference.reference == "#med0309" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.requester.display == "Patrick Pump" assert inst.requester.reference == "Practitioner/f007" assert inst.status == "active" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationrequest_3(base_settings): """No. 3 tests collection for MedicationRequest. Test File: medicationrequest0310.json """ filename = base_settings["unittest_data_dir"] / "medicationrequest0310.json" inst = medicationrequest.MedicationRequest.model_validate_json( filename.read_bytes() ) assert "MedicationRequest" == inst.get_resource_type() impl_medicationrequest_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationRequest" == data["resourceType"] inst2 = medicationrequest.MedicationRequest(**data) impl_medicationrequest_3(inst2) def impl_medicationrequest_4(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.contained[0].id == "med0343b" assert inst.dosageInstruction[0].asNeededFor[0].coding[0].code == "16932000" assert ( inst.dosageInstruction[0].asNeededFor[0].coding[0].display == "Nausea and Vomiting" ) assert ( inst.dosageInstruction[0].asNeededFor[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "mg" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "mg" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 4 ) assert inst.dosageInstruction[0].route.coding[0].code == "78421000" assert inst.dosageInstruction[0].route.coding[0].display == "Intramuscular Route" assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == "4mg IM twice daily as needed for nausea" assert inst.dosageInstruction[0].timing.repeat.frequency == 2 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert ( inst.groupIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/portal/prescriptions"} ).valueUri ) assert inst.groupIdentifier.use == "official" assert inst.groupIdentifier.value == "9898" assert inst.id == "medrx0343b" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/portal/prescriptions"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "98765" assert inst.intent == "option" assert inst.medication.reference.display == "Ondansetron 2mg/ml Injection" assert inst.medication.reference.reference == "#med0343b" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.requester.display == "Patrick Pump" assert inst.requester.reference == "Practitioner/f007" assert inst.status == "active" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationrequest_4(base_settings): """No. 4 tests collection for MedicationRequest. Test File: medicationrequest0343b.json """ filename = base_settings["unittest_data_dir"] / "medicationrequest0343b.json" inst = medicationrequest.MedicationRequest.model_validate_json( filename.read_bytes() ) assert "MedicationRequest" == inst.get_resource_type() impl_medicationrequest_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationRequest" == data["resourceType"] inst2 = medicationrequest.MedicationRequest(**data) impl_medicationrequest_4(inst2) def impl_medicationrequest_5(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.contained[0].id == "med0304" assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "mg" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "mg" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 6 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].route.coding[0].code == "26643006" assert ( inst.dosageInstruction[0].route.coding[0].display == "Oral route (qualifier value)" ) assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == ( "6 mg PO daily for remission induction; adjust dosage to " "white blood cell (WBC) count. With hold treatment if WBC is" " less than 15,000/µL; resume when WBC is greater than " "50,000/µL" ) assert inst.dosageInstruction[0].timing.repeat.frequency == 1 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert inst.id == "medrx0306" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/portal/prescriptions"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345689" assert inst.intent == "order" assert inst.medication.reference.display == "Myleran 2mg tablet" assert inst.medication.reference.reference == "#med0304" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.reason[0].concept.coding[0].code == "92818009" assert ( inst.reason[0].concept.coding[0].display == "Chronic myeloid Leukemia (disorder)" ) assert ( inst.reason[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.requester.display == "Patrick Pump" assert inst.requester.reference == "Practitioner/f007" assert inst.status == "active" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationrequest_5(base_settings): """No. 5 tests collection for MedicationRequest. Test File: medicationrequest0306.json """ filename = base_settings["unittest_data_dir"] / "medicationrequest0306.json" inst = medicationrequest.MedicationRequest.model_validate_json( filename.read_bytes() ) assert "MedicationRequest" == inst.get_resource_type() impl_medicationrequest_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationRequest" == data["resourceType"] inst2 = medicationrequest.MedicationRequest(**data) impl_medicationrequest_5(inst2) def impl_medicationrequest_6(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.contained[0].id == "med0308" assert inst.dispenseRequest.expectedSupplyDuration.code == "d" assert ( inst.dispenseRequest.expectedSupplyDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dispenseRequest.expectedSupplyDuration.unit == "days" assert float(inst.dispenseRequest.expectedSupplyDuration.value) == float(10) assert inst.dispenseRequest.quantity.code == "TAB" assert ( inst.dispenseRequest.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dispenseRequest.quantity.unit == "TAB" assert float(inst.dispenseRequest.quantity.value) == float(30) assert ( inst.dispenseRequest.validityPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-15"} ).valueDateTime ) assert ( inst.dispenseRequest.validityPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert ( inst.dosageInstruction[0].additionalInstruction[0].coding[0].code == "418914006" ) assert inst.dosageInstruction[0].additionalInstruction[0].coding[0].display == ( "Warning. May cause drowsiness. If affected do not drive or " "operate machinery. Avoid alcoholic drink (qualifier value)" ) assert ( inst.dosageInstruction[0].additionalInstruction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].asNeededFor[0].coding[0].code == "203082005" assert ( inst.dosageInstruction[0].asNeededFor[0].coding[0].display == "Fibromyalgia (disorder)" ) assert ( inst.dosageInstruction[0].asNeededFor[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "TAB" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "TAB" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 1 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].route.coding[0].code == "26643006" assert inst.dosageInstruction[0].route.coding[0].display == "Oral Route" assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert ( inst.dosageInstruction[0].text == "1 tablet every four hours as needed for pain" ) assert inst.dosageInstruction[0].timing.repeat.frequency == 1 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(4) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "h" assert inst.encounter.display == "encounter who leads to this prescription" assert inst.encounter.reference == "Encounter/f001" assert inst.id == "medrx0307" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/portal/prescriptions"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345689" assert inst.intent == "order" assert inst.medication.reference.reference == "#med0308" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.requester.display == "Patrick Pump" assert inst.requester.reference == "Practitioner/f007" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.substitution.allowedBoolean is True assert inst.substitution.reason.coding[0].code == "FP" assert inst.substitution.reason.coding[0].display == "formulary policy" assert ( inst.substitution.reason.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_medicationrequest_6(base_settings): """No. 6 tests collection for MedicationRequest. Test File: medicationrequest0307.json """ filename = base_settings["unittest_data_dir"] / "medicationrequest0307.json" inst = medicationrequest.MedicationRequest.model_validate_json( filename.read_bytes() ) assert "MedicationRequest" == inst.get_resource_type() impl_medicationrequest_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationRequest" == data["resourceType"] inst2 = medicationrequest.MedicationRequest(**data) impl_medicationrequest_6(inst2) def impl_medicationrequest_7(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.contained[0].id == "med0350" assert inst.dispenseRequest.expectedSupplyDuration.code == "d" assert ( inst.dispenseRequest.expectedSupplyDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dispenseRequest.expectedSupplyDuration.unit == "days" assert float(inst.dispenseRequest.expectedSupplyDuration.value) == float(30) assert inst.dispenseRequest.numberOfRepeatsAllowed == 3 assert inst.dispenseRequest.quantity.code == "TAB" assert ( inst.dispenseRequest.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dispenseRequest.quantity.unit == "TAB" assert float(inst.dispenseRequest.quantity.value) == float(30) assert ( inst.dispenseRequest.validityPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-15"} ).valueDateTime ) assert ( inst.dispenseRequest.validityPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "mg" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "mg" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 7 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == "7mg once daily" assert inst.dosageInstruction[0].timing.repeat.frequency == 1 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert inst.id == "medrx0331" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/portal/prescriptions"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345689" assert inst.intent == "order" assert inst.medication.reference.reference == "#med0350" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.requester.display == "Patrick Pump" assert inst.requester.reference == "Practitioner/f007" assert inst.status == "active" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.substitution.allowedBoolean is True assert inst.substitution.reason.coding[0].code == "FP" assert inst.substitution.reason.coding[0].display == "formulary policy" assert ( inst.substitution.reason.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_medicationrequest_7(base_settings): """No. 7 tests collection for MedicationRequest. Test File: medicationrequest0331.json """ filename = base_settings["unittest_data_dir"] / "medicationrequest0331.json" inst = medicationrequest.MedicationRequest.model_validate_json( filename.read_bytes() ) assert "MedicationRequest" == inst.get_resource_type() impl_medicationrequest_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationRequest" == data["resourceType"] inst2 = medicationrequest.MedicationRequest(**data) impl_medicationrequest_7(inst2) def impl_medicationrequest_8(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.dispenseRequest.expectedSupplyDuration.code == "d" assert ( inst.dispenseRequest.expectedSupplyDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dispenseRequest.expectedSupplyDuration.unit == "days" assert float(inst.dispenseRequest.expectedSupplyDuration.value) == float(14) assert inst.dispenseRequest.quantity.code == "PATCH" assert ( inst.dispenseRequest.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dispenseRequest.quantity.unit == "patch" assert float(inst.dispenseRequest.quantity.value) == float(6) assert ( inst.dispenseRequest.validityPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-15"} ).valueDateTime ) assert ( inst.dispenseRequest.validityPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "PATCH" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "patch" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 1 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == "apply one patch three times per week" assert inst.dosageInstruction[0].timing.repeat.frequency == 3 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "wk" assert inst.id == "medrx0327" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/portal/prescriptions"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345689" assert inst.intent == "order" assert inst.medication.concept.coding[0].code == "333919005" assert ( inst.medication.concept.coding[0].display == "Fentanyl 25micrograms/hour patch (product)" ) assert ( inst.medication.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.requester.display == "Patrick Pump" assert inst.requester.reference == "Practitioner/f007" assert inst.status == "active" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationrequest_8(base_settings): """No. 8 tests collection for MedicationRequest. Test File: medicationrequest0327.json """ filename = base_settings["unittest_data_dir"] / "medicationrequest0327.json" inst = medicationrequest.MedicationRequest.model_validate_json( filename.read_bytes() ) assert "MedicationRequest" == inst.get_resource_type() impl_medicationrequest_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationRequest" == data["resourceType"] inst2 = medicationrequest.MedicationRequest(**data) impl_medicationrequest_8(inst2) def impl_medicationrequest_9(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.contained[0].id == "med0306" assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "mg/kg" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "mg/kg" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 1.8 ) assert inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.code == "min" assert ( inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float( inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.value ) == float(20) assert inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.code == "mg/kg" assert ( inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float( inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.value ) == float(1.8) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].maxDosePerLifetime.code == "mg" assert ( inst.dosageInstruction[0].maxDosePerLifetime.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].maxDosePerLifetime.unit == "mg" assert float(inst.dosageInstruction[0].maxDosePerLifetime.value) == float(400) assert inst.dosageInstruction[0].route.coding[0].code == "255560000" assert inst.dosageInstruction[0].route.coding[0].display == "Intravenous" assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == ( "1.8 mg/kg IV infusion over 20 minutes every 3 weeks for 16 " "cycles" ) assert inst.dosageInstruction[0].timing.repeat.count == 16 assert inst.dosageInstruction[0].timing.repeat.frequency == 1 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(3) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "wk" assert inst.encounter.display == "encounter who leads to this prescription" assert inst.encounter.reference == "Encounter/f001" assert inst.id == "medrx0316" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/portal/prescriptions"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345689" assert inst.intent == "order" assert inst.medication.reference.reference == "#med0306" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.requester.display == "Patrick Pump" assert inst.requester.reference == "Practitioner/f007" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationrequest_9(base_settings): """No. 9 tests collection for MedicationRequest. Test File: medicationrequest0316.json """ filename = base_settings["unittest_data_dir"] / "medicationrequest0316.json" inst = medicationrequest.MedicationRequest.model_validate_json( filename.read_bytes() ) assert "MedicationRequest" == inst.get_resource_type() impl_medicationrequest_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationRequest" == data["resourceType"] inst2 = medicationrequest.MedicationRequest(**data) impl_medicationrequest_9(inst2) def impl_medicationrequest_10(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.dispenseRequest.expectedSupplyDuration.code == "d" assert ( inst.dispenseRequest.expectedSupplyDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dispenseRequest.expectedSupplyDuration.unit == "days" assert float(inst.dispenseRequest.expectedSupplyDuration.value) == float(30) assert inst.dispenseRequest.numberOfRepeatsAllowed == 6 assert inst.dispenseRequest.quantity.code == "mL" assert ( inst.dispenseRequest.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dispenseRequest.quantity.unit == "mL" assert float(inst.dispenseRequest.quantity.value) == float(10) assert ( inst.dispenseRequest.validityPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-15"} ).valueDateTime ) assert ( inst.dispenseRequest.validityPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-15"} ).valueDateTime ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == "U" assert ( inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == "U" assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float( 20 ) assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosageInstruction[0].route.coding[0].code == "263887005" assert ( inst.dosageInstruction[0].route.coding[0].display == "Subcutaneous (qualifier value)" ) assert ( inst.dosageInstruction[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosageInstruction[0].sequence == 1 assert inst.dosageInstruction[0].text == "20 Units SC three times daily" assert inst.dosageInstruction[0].timing.repeat.frequency == 3 assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1) assert inst.dosageInstruction[0].timing.repeat.periodUnit == "d" assert inst.id == "medrx0320" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/portal/prescriptions"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345689" assert inst.intent == "order" assert inst.medication.concept.coding[0].code == "285018" assert ( inst.medication.concept.coding[0].display == "Lantus 100 unit/ml injectable solution" ) assert ( inst.medication.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.nlm.nih.gov/research/umls/rxnorm"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.reason[0].concept.coding[0].code == "473189005" assert ( inst.reason[0].concept.coding[0].display == "On subcutaneous insulin for diabetes mellitus (finding)" ) assert ( inst.reason[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.requester.display == "Patrick Pump" assert inst.requester.reference == "Practitioner/f007" assert inst.status == "completed" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationrequest_10(base_settings): """No. 10 tests collection for MedicationRequest. Test File: medicationrequest0320.json """ filename = base_settings["unittest_data_dir"] / "medicationrequest0320.json" inst = medicationrequest.MedicationRequest.model_validate_json( filename.read_bytes() ) assert "MedicationRequest" == inst.get_resource_type() impl_medicationrequest_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationRequest" == data["resourceType"] inst2 = medicationrequest.MedicationRequest(**data) impl_medicationrequest_10(inst2) ================================================ FILE: fhir/resources/tests/test_medicationstatement.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/MedicationStatement Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import medicationstatement from .conftest import ExternalValidatorModel def impl_medicationstatement_1(inst): assert ( inst.dateAsserted == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-22"} ).valueDateTime ) assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-01-23"} ).valueDateTime ) assert inst.encounter.reference == "Encounter/f203" assert inst.id == "example005" assert inst.informationSource[0].display == "Donald Duck" assert inst.informationSource[0].reference == "Patient/pat1" assert inst.medication.concept.coding[0].code == "27658006" assert inst.medication.concept.coding[0].display == "Amoxicillin (product)" assert ( inst.medication.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == ( "Patient indicated that they thought it was Amoxicillin they " "were taking but it was really Erythromycin" ) assert inst.status == "entered-in-error" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationstatement_1(base_settings): """No. 1 tests collection for MedicationStatement. Test File: medicationstatementexample5.json """ filename = base_settings["unittest_data_dir"] / "medicationstatementexample5.json" inst = medicationstatement.MedicationStatement.model_validate_json( filename.read_bytes() ) assert "MedicationStatement" == inst.get_resource_type() impl_medicationstatement_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationStatement" == data["resourceType"] inst2 = medicationstatement.MedicationStatement(**data) impl_medicationstatement_1(inst2) def impl_medicationstatement_2(inst): assert inst.contained[0].id == "med0315" assert ( inst.dateAsserted == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-22"} ).valueDateTime ) assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-23"} ).valueDateTime ) assert inst.id == "example009" assert inst.informationSource[0].display == "Donald Duck" assert inst.informationSource[0].reference == "Patient/pat1" assert inst.medication.reference.reference == "#med0315" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.note[0].text == "Patient reports they used the medication patch on this day." ) assert inst.partOf[0].reference == "MedicationStatement/example008" assert inst.status == "recorded" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationstatement_2(base_settings): """No. 2 tests collection for MedicationStatement. Test File: medicationstatementexample9.json """ filename = base_settings["unittest_data_dir"] / "medicationstatementexample9.json" inst = medicationstatement.MedicationStatement.model_validate_json( filename.read_bytes() ) assert "MedicationStatement" == inst.get_resource_type() impl_medicationstatement_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationStatement" == data["resourceType"] inst2 = medicationstatement.MedicationStatement(**data) impl_medicationstatement_2(inst2) def impl_medicationstatement_3(inst): assert inst.contained[0].id == "med0309" assert inst.dosage[0].doseAndRate[0].doseQuantity.code == "TPATH24" assert ( inst.dosage[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosage[0].doseAndRate[0].doseQuantity.unit == "patch" assert float(inst.dosage[0].doseAndRate[0].doseQuantity.value) == float(1) assert inst.id == "example008" assert inst.medication.reference.reference == "#med0309" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == ( "Patient reports they used the given patches over the last 30" " days" ) assert inst.status == "recorded" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationstatement_3(base_settings): """No. 3 tests collection for MedicationStatement. Test File: medicationstatementexample8.json """ filename = base_settings["unittest_data_dir"] / "medicationstatementexample8.json" inst = medicationstatement.MedicationStatement.model_validate_json( filename.read_bytes() ) assert "MedicationStatement" == inst.get_resource_type() impl_medicationstatement_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationStatement" == data["resourceType"] inst2 = medicationstatement.MedicationStatement(**data) impl_medicationstatement_3(inst2) def impl_medicationstatement_4(inst): assert inst.adherence.code.coding[0].code == "not-taking" assert inst.adherence.code.coding[0].display == "Not Taking" assert ( inst.adherence.code.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/CodeSystem/medication-statement-adherence" } ).valueUri ) assert inst.adherence.reason.coding[0].code == "266710000" assert inst.adherence.reason.coding[0].display == "Drugs not taken/completed" assert ( inst.adherence.reason.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.dateAsserted == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-22"} ).valueDateTime ) assert inst.dosage[0].asNeeded is False assert inst.dosage[0].maxDosePerPeriod[0].denominator.code == "d" assert ( inst.dosage[0].maxDosePerPeriod[0].denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.dosage[0].maxDosePerPeriod[0].denominator.value) == float(1) assert inst.dosage[0].maxDosePerPeriod[0].numerator.code == "385055001" assert ( inst.dosage[0].maxDosePerPeriod[0].numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage[0].maxDosePerPeriod[0].numerator.unit == "capsules" assert float(inst.dosage[0].maxDosePerPeriod[0].numerator.value) == float(3) assert inst.dosage[0].route.coding[0].code == "260548002" assert inst.dosage[0].route.coding[0].display == "Oral" assert ( inst.dosage[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage[0].text == "one capsule three times daily" assert inst.dosage[0].timing.repeat.frequency == 3 assert float(inst.dosage[0].timing.repeat.period) == float(1) assert inst.dosage[0].timing.repeat.periodUnit == "d" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-01-23"} ).valueDateTime ) assert inst.id == "example004" assert inst.informationSource[0].display == "Donald Duck" assert inst.informationSource[0].reference == "Patient/pat1" assert inst.medication.concept.coding[0].code == "27658006" assert inst.medication.concept.coding[0].display == "Amoxicillin (product)" assert ( inst.medication.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "Patient indicates they miss the occasional dose" assert inst.status == "recorded" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationstatement_4(base_settings): """No. 4 tests collection for MedicationStatement. Test File: medicationstatementexample4.json """ filename = base_settings["unittest_data_dir"] / "medicationstatementexample4.json" inst = medicationstatement.MedicationStatement.model_validate_json( filename.read_bytes() ) assert "MedicationStatement" == inst.get_resource_type() impl_medicationstatement_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationStatement" == data["resourceType"] inst2 = medicationstatement.MedicationStatement(**data) impl_medicationstatement_4(inst2) def impl_medicationstatement_5(inst): assert ( inst.dateAsserted == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-02-22"} ).valueDateTime ) assert inst.dosage[0].asNeeded is False assert inst.dosage[0].doseAndRate[0].doseQuantity.code == "TAB" assert ( inst.dosage[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosage[0].doseAndRate[0].doseQuantity.unit == "tab" assert float(inst.dosage[0].doseAndRate[0].doseQuantity.value) == float(1) assert inst.dosage[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosage[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosage[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosage[0].maxDosePerPeriod[0].denominator.code == "d" assert ( inst.dosage[0].maxDosePerPeriod[0].denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.dosage[0].maxDosePerPeriod[0].denominator.value) == float(1) assert float(inst.dosage[0].maxDosePerPeriod[0].numerator.value) == float(1) assert inst.dosage[0].route.coding[0].code == "260548002" assert inst.dosage[0].route.coding[0].display == "Oral" assert ( inst.dosage[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage[0].sequence == 1 assert inst.dosage[0].text == "1 tablet per day" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-02-01"} ).valueDateTime ) assert inst.id == "example003" assert inst.informationSource[0].display == "Donald Duck" assert inst.informationSource[0].reference == "Patient/pat1" assert inst.medication.concept.text == "Little Pink Pill for water retention" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == ( "Patient cannot remember the name of the tablet, but takes it" " every day in the morning for water retention" ) assert inst.reason[0].reference.reference == "Observation/blood-pressure" assert inst.status == "recorded" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationstatement_5(base_settings): """No. 5 tests collection for MedicationStatement. Test File: medicationstatementexample3.json """ filename = base_settings["unittest_data_dir"] / "medicationstatementexample3.json" inst = medicationstatement.MedicationStatement.model_validate_json( filename.read_bytes() ) assert "MedicationStatement" == inst.get_resource_type() impl_medicationstatement_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationStatement" == data["resourceType"] inst2 = medicationstatement.MedicationStatement(**data) impl_medicationstatement_5(inst2) def impl_medicationstatement_6(inst): assert inst.adherence.code.coding[0].code == "not-taking" assert inst.adherence.code.coding[0].display == "Not Taking" assert ( inst.adherence.code.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/CodeSystem/medication-statement-adherence" } ).valueUri ) assert inst.adherence.reason.coding[0].code == "266710000" assert inst.adherence.reason.coding[0].display == "Drugs not taken/completed" assert ( inst.adherence.reason.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.contained[0].id == "med0309" assert ( inst.dateAsserted == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-22"} ).valueDateTime ) assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-23"} ).valueDateTime ) assert inst.id == "example002" assert inst.informationSource[0].display == "Donald Duck" assert inst.informationSource[0].reference == "Patient/pat1" assert inst.medication.reference.reference == "#med0309" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.note[0].text == "Patient cannot take acetaminophen as per Dr instructions" ) assert inst.reason[0].concept.coding[0].code == "166643006" assert inst.reason[0].concept.coding[0].display == "Liver enzymes abnormal" assert ( inst.reason[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.status == "recorded" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationstatement_6(base_settings): """No. 6 tests collection for MedicationStatement. Test File: medicationstatementexample2.json """ filename = base_settings["unittest_data_dir"] / "medicationstatementexample2.json" inst = medicationstatement.MedicationStatement.model_validate_json( filename.read_bytes() ) assert "MedicationStatement" == inst.get_resource_type() impl_medicationstatement_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationStatement" == data["resourceType"] inst2 = medicationstatement.MedicationStatement(**data) impl_medicationstatement_6(inst2) def impl_medicationstatement_7(inst): assert inst.category[0].coding[0].code == "inpatient" assert inst.category[0].coding[0].display == "Inpatient" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/medication-statement-category" } ).valueUri ) assert inst.contained[0].id == "med0309" assert ( inst.dateAsserted == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-22"} ).valueDateTime ) assert inst.derivedFrom[0].reference == "MedicationRequest/medrx002" assert inst.dosage[0].additionalInstruction[0].text == "Taking at bedtime" assert inst.dosage[0].asNeededFor[0].coding[0].code == "32914008" assert inst.dosage[0].asNeededFor[0].coding[0].display == "Restless Legs" assert ( inst.dosage[0].asNeededFor[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage[0].doseAndRate[0].doseRange.high.code == "TAB" assert ( inst.dosage[0].doseAndRate[0].doseRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosage[0].doseAndRate[0].doseRange.high.unit == "TAB" assert float(inst.dosage[0].doseAndRate[0].doseRange.high.value) == float(2) assert inst.dosage[0].doseAndRate[0].doseRange.low.code == "TAB" assert ( inst.dosage[0].doseAndRate[0].doseRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm"} ).valueUri ) assert inst.dosage[0].doseAndRate[0].doseRange.low.unit == "TAB" assert float(inst.dosage[0].doseAndRate[0].doseRange.low.value) == float(1) assert inst.dosage[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosage[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosage[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosage[0].route.coding[0].code == "26643006" assert inst.dosage[0].route.coding[0].display == "Oral Route" assert ( inst.dosage[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage[0].sequence == 1 assert inst.dosage[0].text == ( "1-2 tablets once daily at bedtime as needed for restless " "legs" ) assert inst.dosage[0].timing.repeat.frequency == 1 assert float(inst.dosage[0].timing.repeat.period) == float(1) assert inst.dosage[0].timing.repeat.periodUnit == "d" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-23"} ).valueDateTime ) assert inst.id == "example001" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/portal/medstatements"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345689" assert inst.informationSource[0].display == "Donald Duck" assert inst.informationSource[0].reference == "Patient/pat1" assert inst.medication.reference.reference == "#med0309" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "Patient indicates they miss the occasional dose" assert inst.reason[0].concept.coding[0].code == "32914008" assert inst.reason[0].concept.coding[0].display == "Restless Legs" assert ( inst.reason[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.status == "recorded" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationstatement_7(base_settings): """No. 7 tests collection for MedicationStatement. Test File: medicationstatementexample1.json """ filename = base_settings["unittest_data_dir"] / "medicationstatementexample1.json" inst = medicationstatement.MedicationStatement.model_validate_json( filename.read_bytes() ) assert "MedicationStatement" == inst.get_resource_type() impl_medicationstatement_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationStatement" == data["resourceType"] inst2 = medicationstatement.MedicationStatement(**data) impl_medicationstatement_7(inst2) def impl_medicationstatement_8(inst): assert inst.contained[0].id == "med0315" assert inst.id == "example007" assert inst.informationSource[0].display == "Donald Duck" assert inst.informationSource[0].reference == "Patient/pat1" assert inst.medication.reference.reference == "#med0315" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == ( "patient plans to start using for seasonal allergies in the " "Spring when pollen is in the air" ) assert inst.status == "recorded" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationstatement_8(base_settings): """No. 8 tests collection for MedicationStatement. Test File: medicationstatementexample7.json """ filename = base_settings["unittest_data_dir"] / "medicationstatementexample7.json" inst = medicationstatement.MedicationStatement.model_validate_json( filename.read_bytes() ) assert "MedicationStatement" == inst.get_resource_type() impl_medicationstatement_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationStatement" == data["resourceType"] inst2 = medicationstatement.MedicationStatement(**data) impl_medicationstatement_8(inst2) def impl_medicationstatement_9(inst): assert ( inst.dateAsserted == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-02-22"} ).valueDateTime ) assert inst.dosage[0].asNeeded is False assert inst.dosage[0].doseAndRate[0].doseQuantity.code == "mL" assert ( inst.dosage[0].doseAndRate[0].doseQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.dosage[0].doseAndRate[0].doseQuantity.unit == "mL" assert float(inst.dosage[0].doseAndRate[0].doseQuantity.value) == float(5) assert inst.dosage[0].doseAndRate[0].type.coding[0].code == "ordered" assert inst.dosage[0].doseAndRate[0].type.coding[0].display == "Ordered" assert ( inst.dosage[0].doseAndRate[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/dose-rate-type"} ).valueUri ) assert inst.dosage[0].maxDosePerPeriod[0].denominator.code == "d" assert ( inst.dosage[0].maxDosePerPeriod[0].denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.dosage[0].maxDosePerPeriod[0].denominator.value) == float(1) assert float(inst.dosage[0].maxDosePerPeriod[0].numerator.value) == float(3) assert inst.dosage[0].route.coding[0].code == "260548002" assert inst.dosage[0].route.coding[0].display == "Oral" assert ( inst.dosage[0].route.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.dosage[0].sequence == 1 assert inst.dosage[0].text == "5ml three times daily" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-02-01"} ).valueDateTime ) assert inst.id == "example006" assert inst.informationSource[0].display == "Peter Chalmers" assert inst.informationSource[0].reference == "RelatedPerson/peter" assert inst.medication.concept.coding[0].code == "27658006" assert inst.medication.concept.coding[0].display == "Amoxicillin (product)" assert ( inst.medication.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "Father indicates they miss the occasional dose" assert inst.status == "recorded" assert inst.subject.display == "Donald Duck" assert inst.subject.reference == "Patient/pat1" assert inst.text.status == "generated" def test_medicationstatement_9(base_settings): """No. 9 tests collection for MedicationStatement. Test File: medicationstatementexample6.json """ filename = base_settings["unittest_data_dir"] / "medicationstatementexample6.json" inst = medicationstatement.MedicationStatement.model_validate_json( filename.read_bytes() ) assert "MedicationStatement" == inst.get_resource_type() impl_medicationstatement_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicationStatement" == data["resourceType"] inst2 = medicationstatement.MedicationStatement(**data) impl_medicationstatement_9(inst2) ================================================ FILE: fhir/resources/tests/test_medicinalproductdefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/MedicinalProductDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import medicinalproductdefinition from .conftest import ExternalValidatorModel def impl_medicinalproductdefinition_1(inst): assert inst.id == "product-with-contained-package-and-ingredient" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].productName == "Exampleocillin" assert inst.text.status == "generated" def test_medicinalproductdefinition_1(base_settings): """No. 1 tests collection for MedicinalProductDefinition. Test File: medicinalproductdefinition-with-contained-package-and-ingredient.json """ filename = ( base_settings["unittest_data_dir"] / "medicinalproductdefinition-with-contained-package-and-ingredient.json" ) inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json( filename.read_bytes() ) assert "MedicinalProductDefinition" == inst.get_resource_type() impl_medicinalproductdefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicinalProductDefinition" == data["resourceType"] inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data) impl_medicinalproductdefinition_1(inst2) def impl_medicinalproductdefinition_2(inst): assert inst.classification[0].coding[0].code == "B01A" assert ( inst.classification[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.whocc.no/atc/example"} ).valueUri ) assert inst.combinedPharmaceuticalDoseForm.coding[0].code == "tablet" assert ( inst.combinedPharmaceuticalDoseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org.uk/fhir/dosefom"} ).valueUri ) assert ( inst.crossReference[0].product.reference.reference == "MedicinalProductDefinition/genericEquilidonium" ) assert inst.id == "equilidem-basics" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org.uk/fhir/product"} ).valueUri ) assert inst.identifier[0].value == "Equilidem25" assert inst.ingredient[0].text == "Equilidonium Phosphate" assert inst.ingredient[1].text == "Calcium Carbonate" assert inst.legalStatusOfSupply.coding[0].code == "POM" assert inst.legalStatusOfSupply.coding[0].display == "Prescription only medicine" assert ( inst.legalStatusOfSupply.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org.uk/fhir/legalstatusofsupply"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].productName == "Equilidem 2.5 mg film-coated tablets" assert inst.operation[0].organization[0].display == "EquiliDrugCo Inc." assert inst.text.status == "generated" def test_medicinalproductdefinition_2(base_settings): """No. 2 tests collection for MedicinalProductDefinition. Test File: medicinalproductdefinition-example-equilidem-basics.json """ filename = ( base_settings["unittest_data_dir"] / "medicinalproductdefinition-example-equilidem-basics.json" ) inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json( filename.read_bytes() ) assert "MedicinalProductDefinition" == inst.get_resource_type() impl_medicinalproductdefinition_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicinalProductDefinition" == data["resourceType"] inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data) impl_medicinalproductdefinition_2(inst2) def impl_medicinalproductdefinition_3(inst): assert inst.classification[0].coding[0].code == "B01A" assert ( inst.classification[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.whocc.no/atc/example"} ).valueUri ) assert inst.combinedPharmaceuticalDoseForm.coding[0].code == "tablet" assert ( inst.combinedPharmaceuticalDoseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org.uk/fhir/dosefom"} ).valueUri ) assert inst.contained[0].id == "EquilidoniumPhosphate" assert inst.contained[1].id == "CalciumCarbonate" assert ( inst.crossReference[0].product.reference.reference == "MedicinalProductDefinition/genericEquilidonium" ) assert inst.id == "equilidem-with-ing-and-auth" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org.uk/fhir/product"} ).valueUri ) assert inst.identifier[0].value == "Equilidem25" assert inst.legalStatusOfSupply.coding[0].code == "POM" assert inst.legalStatusOfSupply.coding[0].display == "Prescription only medicine" assert ( inst.legalStatusOfSupply.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org.uk/fhir/legalstatusofsupply"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].productName == "Equilidem 2.5 mg film-coated tablets" assert inst.operation[0].organization[0].display == "EquiliDrugCo Processing Inc." assert inst.text.status == "generated" def test_medicinalproductdefinition_3(base_settings): """No. 3 tests collection for MedicinalProductDefinition. Test File: medicinalproductdefinition-example-equilidem-using-ingredient-and-auth.json """ filename = ( base_settings["unittest_data_dir"] / "medicinalproductdefinition-example-equilidem-using-ingredient-and-auth.json" ) inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json( filename.read_bytes() ) assert "MedicinalProductDefinition" == inst.get_resource_type() impl_medicinalproductdefinition_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicinalProductDefinition" == data["resourceType"] inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data) impl_medicinalproductdefinition_3(inst2) def impl_medicinalproductdefinition_4(inst): assert ( inst.combinedPharmaceuticalDoseForm.coding[0].code == "solution for injection" ) assert ( inst.combinedPharmaceuticalDoseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org.uk/fhir/doseform"} ).valueUri ) assert inst.contained[0].id == "package" assert inst.contained[1].id == "syringeDevice" assert inst.contained[2].id == "liquidItem" assert inst.id == "drug-and-device" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org.uk/fhir/product"} ).valueUri ) assert inst.identifier[0].value == "Wonderdrug+" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].productName == "Wonderdrug+ liquid 20ml" assert inst.text.status == "generated" def test_medicinalproductdefinition_4(base_settings): """No. 4 tests collection for MedicinalProductDefinition. Test File: medicinalproductdefinition-example-co-packaged-liquid-and-syringe.json """ filename = ( base_settings["unittest_data_dir"] / "medicinalproductdefinition-example-co-packaged-liquid-and-syringe.json" ) inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json( filename.read_bytes() ) assert "MedicinalProductDefinition" == inst.get_resource_type() impl_medicinalproductdefinition_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicinalProductDefinition" == data["resourceType"] inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data) impl_medicinalproductdefinition_4(inst2) def impl_medicinalproductdefinition_5(inst): assert ( inst.combinedPharmaceuticalDoseForm.coding[0].code == "Powder and solution for injection with itegral syringe" ) assert ( inst.combinedPharmaceuticalDoseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org.uk/fhir/doseform"} ).valueUri ) assert inst.contained[0].id == "package" assert inst.contained[1].id == "solventItem" assert inst.contained[2].id == "powderItem" assert inst.contained[3].id == "syringeDevice" assert inst.contained[4].id == "administrable-form" assert inst.id == "drug-and-device-complete" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org.uk/fhir/product"} ).valueUri ) assert inst.identifier[0].value == "Wonderdrug+" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].productName == "Wonderdrug liquid 20ml (integral syringe)" assert inst.text.status == "generated" def test_medicinalproductdefinition_5(base_settings): """No. 5 tests collection for MedicinalProductDefinition. Test File: medicinalproductdefinition-example-co-packaged-liquid-and-syringe-complete.json """ filename = ( base_settings["unittest_data_dir"] / "medicinalproductdefinition-example-co-packaged-liquid-and-syringe-complete.json" ) inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json( filename.read_bytes() ) assert "MedicinalProductDefinition" == inst.get_resource_type() impl_medicinalproductdefinition_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicinalProductDefinition" == data["resourceType"] inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data) impl_medicinalproductdefinition_5(inst2) def impl_medicinalproductdefinition_6(inst): assert ( inst.combinedPharmaceuticalDoseForm.coding[0].code == "Tablet and Cream for topical application" ) assert ( inst.combinedPharmaceuticalDoseForm.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org.uk/fhir/doseform"} ).valueUri ) assert inst.contained[0].id == "packageCombo" assert inst.contained[1].id == "tabletItem" assert inst.contained[2].id == "creamItem" assert inst.id == "drug-combo-product" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org.uk/fhir/product"} ).valueUri ) assert inst.identifier[0].value == "ThrushTreatCombo" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].productName == "ThrushTreat Combo" assert inst.text.status == "generated" def test_medicinalproductdefinition_6(base_settings): """No. 6 tests collection for MedicinalProductDefinition. Test File: medicinalproductdefinition-example-combo-product.json """ filename = ( base_settings["unittest_data_dir"] / "medicinalproductdefinition-example-combo-product.json" ) inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json( filename.read_bytes() ) assert "MedicinalProductDefinition" == inst.get_resource_type() impl_medicinalproductdefinition_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicinalProductDefinition" == data["resourceType"] inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data) impl_medicinalproductdefinition_6(inst2) def impl_medicinalproductdefinition_7(inst): assert inst.contained[0].id == "Acetamin-pack-20" assert inst.contained[1].id == "Acetamin-tab-500" assert inst.id == "Acetamin-500-20-generic" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.nation.org/drugs"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].productName == "Acetaminophen 500 mg tablets [generic]" assert inst.text.status == "generated" def test_medicinalproductdefinition_7(base_settings): """No. 7 tests collection for MedicinalProductDefinition. Test File: medicinalproductdefinition-acetaminophen-500mg-tablets-box-of-20.json """ filename = ( base_settings["unittest_data_dir"] / "medicinalproductdefinition-acetaminophen-500mg-tablets-box-of-20.json" ) inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json( filename.read_bytes() ) assert "MedicinalProductDefinition" == inst.get_resource_type() impl_medicinalproductdefinition_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicinalProductDefinition" == data["resourceType"] inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data) impl_medicinalproductdefinition_7(inst2) def impl_medicinalproductdefinition_8(inst): assert inst.attachedDocument[0].reference == "DocumentReference/example" assert inst.classification[0].coding[0].code == "B01AF02" assert ( inst.classification[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://ema.europa.eu/example/WHOAnatomicalTherapeuticChemicalATCClassificationSystem" } ).valueUri ) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/MPID"} ).valueUri ) assert inst.identifier[0].value == "{mpid}" assert inst.masterFile[0].reference == "DocumentReference/example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].part[0].part == "Equilidem" assert inst.name[0].part[0].type.coding[0].code == "INV" assert inst.name[0].part[1].part == "2.5 mg" assert inst.name[0].part[1].type.coding[0].code == "STR" assert inst.name[0].part[2].part == "film-coated tablets" assert inst.name[0].part[2].type.coding[0].code == "FRM" assert inst.name[0].productName == "Equilidem 2.5 mg film-coated tablets" assert inst.name[0].usage[0].country.coding[0].code == "EU" assert ( inst.name[0].usage[0].country.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/countryCode"} ).valueUri ) assert inst.name[0].usage[0].jurisdiction.coding[0].code == "EU" assert ( inst.name[0].usage[0].jurisdiction.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/jurisdictionCode"} ).valueUri ) assert inst.name[0].usage[0].language.coding[0].code == "en" assert ( inst.name[0].usage[0].language.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:47"} ).valueUri ) assert ( inst.operation[0].effectiveDate.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-15"} ).valueDateTime ) assert inst.operation[0].type.concept.coding[0].code == "Batchrelease" assert ( inst.operation[0].type.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/manufacturingOperationType"} ).valueUri ) assert inst.text.status == "generated" def test_medicinalproductdefinition_8(base_settings): """No. 8 tests collection for MedicinalProductDefinition. Test File: medicinalproductdefinition-example.json """ filename = ( base_settings["unittest_data_dir"] / "medicinalproductdefinition-example.json" ) inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json( filename.read_bytes() ) assert "MedicinalProductDefinition" == inst.get_resource_type() impl_medicinalproductdefinition_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MedicinalProductDefinition" == data["resourceType"] inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data) impl_medicinalproductdefinition_8(inst2) ================================================ FILE: fhir/resources/tests/test_messagedefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/MessageDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import messagedefinition from .conftest import ExternalValidatorModel def impl_messagedefinition_1(inst): assert inst.category == "notification" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-11-09"} ).valueDateTime ) assert inst.description == "Message definition base example" assert inst.eventCoding.code == "admin-notify" assert ( inst.eventCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/message-events"} ).valueUri ) assert inst.experimental is True assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.15.3" assert inst.name == "EXAMPLE" assert inst.publisher == "Health Level Seven, Int'l" assert inst.purpose == ( "Defines a base example for other MessageDefinition " "instances." ) assert inst.status == "draft" assert inst.text.div == ( '
Message ' "definition base example
" ) assert inst.text.status == "generated" assert inst.title == "Message definition base example" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/MessageDefinition/example"} ).valueUri ) def test_messagedefinition_1(base_settings): """No. 1 tests collection for MessageDefinition. Test File: messagedefinition-example.json """ filename = base_settings["unittest_data_dir"] / "messagedefinition-example.json" inst = messagedefinition.MessageDefinition.model_validate_json( filename.read_bytes() ) assert "MessageDefinition" == inst.get_resource_type() impl_messagedefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MessageDefinition" == data["resourceType"] inst2 = messagedefinition.MessageDefinition(**data) impl_messagedefinition_1(inst2) def impl_messagedefinition_2(inst): assert ( inst.allowedResponse[0].message == "http://hl7.org/fhir/MessageDefinition/patient-link-response" ) assert inst.allowedResponse[0].situation == ( "Optional response message that may provide additional " "information" ) assert inst.base == "http://hl7.org/fhir/MessageDefinition/example" assert inst.category == "notification" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org" assert inst.copyright == "� HL7.org 2011+" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-03"} ).valueDateTime ) assert inst.description == ( "Notification of two patient records that represent the same " "individual that require an established linkage." ) assert inst.eventCoding.code == "admin-notify" assert ( inst.eventCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/message-events"} ).valueUri ) assert inst.experimental is True assert inst.focus[0].code == "Patient" assert inst.focus[0].max == "2" assert inst.focus[0].min == 2 assert inst.focus[0].profile == "http://hl7.org/fhir/StructureDefinition/example" assert inst.id == "patient-link-notification" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.15.2" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America (the)" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.name == "PATIENTLINKNOTIFICATION" assert inst.publisher == "Health Level Seven, Int'l" assert inst.purpose == ( "Notifies recipient systems that two patients have been " "'linked' - meaning they represent the same individual" ) assert inst.status == "draft" assert inst.text.div == ( '
Link Patients ' "Notification
" ) assert inst.text.status == "generated" assert inst.title == "Link Patients Notification" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/MessageDefinition/patient-link-notification" } ).valueUri ) assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "positive" assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variant-state"} ).valueUri ) assert inst.version == "1" def test_messagedefinition_2(base_settings): """No. 2 tests collection for MessageDefinition. Test File: messagedefinition-patient-link-notification.json """ filename = ( base_settings["unittest_data_dir"] / "messagedefinition-patient-link-notification.json" ) inst = messagedefinition.MessageDefinition.model_validate_json( filename.read_bytes() ) assert "MessageDefinition" == inst.get_resource_type() impl_messagedefinition_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MessageDefinition" == data["resourceType"] inst2 = messagedefinition.MessageDefinition(**data) impl_messagedefinition_2(inst2) def impl_messagedefinition_3(inst): assert inst.base == "http://hl7.org/fhir/MessageDefinition/example" assert inst.category == "consequence" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org" assert inst.copyright == "� HL7.org 2011+" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-03"} ).valueDateTime ) assert inst.description == "Optional response to a patient link notification." assert inst.eventCoding.code == "admin-notify" assert ( inst.eventCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/message-events"} ).valueUri ) assert inst.experimental is True assert inst.focus[0].code == "Patient" assert inst.focus[0].max == "2" assert inst.focus[0].min == 2 assert inst.focus[0].profile == "http://hl7.org/fhir/StructureDefinition/example" assert inst.id == "patient-link-response" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.15.1" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America (the)" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.name == "PATIENTLINKRESPONSE" assert inst.publisher == "Health Level Seven, Int'l" assert inst.purpose == ( "Optional response message that may provide additional " "information on the outcome of the patient link operation." ) assert inst.status == "draft" assert inst.text.div == ( '
Link Patients ' "Response
" ) assert inst.text.status == "generated" assert inst.title == "Link Patients Response" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/MessageDefinition/patient-link-response"} ).valueUri ) assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "positive" assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variant-state"} ).valueUri ) assert inst.version == "1" def test_messagedefinition_3(base_settings): """No. 3 tests collection for MessageDefinition. Test File: messagedefinition-patient-link-response.json """ filename = ( base_settings["unittest_data_dir"] / "messagedefinition-patient-link-response.json" ) inst = messagedefinition.MessageDefinition.model_validate_json( filename.read_bytes() ) assert "MessageDefinition" == inst.get_resource_type() impl_messagedefinition_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MessageDefinition" == data["resourceType"] inst2 = messagedefinition.MessageDefinition(**data) impl_messagedefinition_3(inst2) ================================================ FILE: fhir/resources/tests/test_messageheader.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/MessageHeader Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import messageheader from .conftest import ExternalValidatorModel def impl_messageheader_1(inst): assert inst.author.reference == "Practitioner/example" assert ( inst.definition == "http:////acme.com/ehr/fhir/messagedefinition/patientrequest" ) assert ( inst.destination[0].endpointUrl == ExternalValidatorModel.model_validate( {"valueUrl": "llp:10.11.12.14:5432"} ).valueUrl ) assert inst.destination[0].name == "Acme Message Gateway" assert ( inst.destination[0].receiver.reference == "http://acme.com/ehr/fhir/Practitioner/2323-33-4" ) assert inst.destination[0].target.reference == "Device/example" assert inst.eventCoding.code == "admin-notify" assert ( inst.eventCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/message-events"} ).valueUri ) assert inst.focus[0].reference == "Patient/example" assert inst.id == "1cbdfb97-5859-48a4-8301-d54eab818d68" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.reason.coding[0].code == "admit" assert ( inst.reason.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/message-reasons-encounter" } ).valueUri ) assert inst.response.code == "ok" assert inst.response.identifier.value == "5015fe84-8e76-4526-89d8-44b322e8d4fb" assert inst.sender.reference == "Organization/1" assert inst.source.contact.system == "phone" assert inst.source.contact.value == "+1 (555) 123 4567" assert ( inst.source.endpointUrl == ExternalValidatorModel.model_validate( {"valueUrl": "llp:10.11.12.13:5432"} ).valueUrl ) assert inst.source.name == "Acme Central Patient Registry" assert inst.source.software == "FooBar Patient Manager" assert inst.source.version == "3.1.45.AABB" assert inst.text.status == "generated" def test_messageheader_1(base_settings): """No. 1 tests collection for MessageHeader. Test File: messageheader-example.json """ filename = base_settings["unittest_data_dir"] / "messageheader-example.json" inst = messageheader.MessageHeader.model_validate_json(filename.read_bytes()) assert "MessageHeader" == inst.get_resource_type() impl_messageheader_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MessageHeader" == data["resourceType"] inst2 = messageheader.MessageHeader(**data) impl_messageheader_1(inst2) ================================================ FILE: fhir/resources/tests/test_molecularsequence.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/MolecularSequence Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import molecularsequence from .conftest import ExternalValidatorModel def impl_molecularsequence_1(inst): assert inst.id == "breastcancer" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.relative[0].coordinateSystem.coding[0].code == "LA30100-4" assert ( inst.relative[0].coordinateSystem.coding[0].display == "0-based interval counting" ) assert ( inst.relative[0].coordinateSystem.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.relative[0].edit[0].end == 32316187 assert inst.relative[0].edit[0].replacedSequence == "C" assert inst.relative[0].edit[0].replacementSequence == "A" assert inst.relative[0].edit[0].start == 32316186 assert ( inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].code == "NM_000059.3" ) assert ( inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].display == "Homo sapiens BRCA2, DNA repair associated (BRCA2), mRNA" ) assert ( inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.ncbi.nlm.nih.gov/nuccore/"} ).valueUri ) assert inst.relative[0].startingSequence.windowEnd == 101499444 assert inst.relative[0].startingSequence.windowStart == 101488058 assert inst.subject.reference == "Patient/brcapat" assert inst.text.status == "generated" assert inst.type == "rna" def test_molecularsequence_1(base_settings): """No. 1 tests collection for MolecularSequence. Test File: sequence-genetics-example-breastcancer.json """ filename = ( base_settings["unittest_data_dir"] / "sequence-genetics-example-breastcancer.json" ) inst = molecularsequence.MolecularSequence.model_validate_json( filename.read_bytes() ) assert "MolecularSequence" == inst.get_resource_type() impl_molecularsequence_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MolecularSequence" == data["resourceType"] inst2 = molecularsequence.MolecularSequence(**data) impl_molecularsequence_1(inst2) def impl_molecularsequence_2(inst): assert inst.device.display == "12 lead EKG Device Metric" assert inst.id == "sequence-complex-variant" assert inst.identifier[0].use == "official" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer.display == "HL7" assert inst.performer.reference == "Organization/hl7" assert inst.relative[0].coordinateSystem.coding[0].code == "LA30100-4" assert ( inst.relative[0].coordinateSystem.coding[0].display == "0-based interval counting" ) assert ( inst.relative[0].coordinateSystem.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.relative[0].edit[0].end == 128273736 assert inst.relative[0].edit[0].replacedSequence == "CTCCATTGCATGCGTT" assert inst.relative[0].edit[0].replacementSequence == "CTCATTGT" assert inst.relative[0].edit[0].start == 128273724 assert ( inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].code == "NC_000002.12" ) assert ( inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.ncbi.nlm.nih.gov/nuccore"} ).valueUri ) assert inst.relative[0].startingSequence.strand == "watson" assert inst.relative[0].startingSequence.windowEnd == 128273754 assert inst.relative[0].startingSequence.windowStart == 128273724 assert inst.specimen.display == "Molecular Specimen ID: MLD45-Z4-1234" assert inst.specimen.reference == "Specimen/genetics-example1-somatic" assert inst.text.status == "generated" assert inst.type == "dna" def test_molecularsequence_2(base_settings): """No. 2 tests collection for MolecularSequence. Test File: sequence-complex-variant.json """ filename = base_settings["unittest_data_dir"] / "sequence-complex-variant.json" inst = molecularsequence.MolecularSequence.model_validate_json( filename.read_bytes() ) assert "MolecularSequence" == inst.get_resource_type() impl_molecularsequence_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MolecularSequence" == data["resourceType"] inst2 = molecularsequence.MolecularSequence(**data) impl_molecularsequence_2(inst2) def impl_molecularsequence_3(inst): assert inst.id == "example-TPMT-one" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.relative[0].coordinateSystem.coding[0].code == "LA30102-0" assert ( inst.relative[0].coordinateSystem.coding[0].display == "1-based character counting" ) assert ( inst.relative[0].coordinateSystem.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.relative[0].edit[0].end == 18139214 assert inst.relative[0].edit[0].replacedSequence == "G" assert inst.relative[0].edit[0].replacementSequence == "A" assert inst.relative[0].edit[0].start == 18139214 assert ( inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].code == "NT_007592.15" ) assert ( inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.ncbi.nlm.nih.gov/nuccore"} ).valueUri ) assert inst.relative[0].startingSequence.strand == "watson" assert inst.relative[0].startingSequence.windowEnd == 18143955 assert inst.relative[0].startingSequence.windowStart == 18130918 assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" assert inst.type == "dna" def test_molecularsequence_3(base_settings): """No. 3 tests collection for MolecularSequence. Test File: sequence-example-TPMT-one.json """ filename = base_settings["unittest_data_dir"] / "sequence-example-TPMT-one.json" inst = molecularsequence.MolecularSequence.model_validate_json( filename.read_bytes() ) assert "MolecularSequence" == inst.get_resource_type() impl_molecularsequence_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MolecularSequence" == data["resourceType"] inst2 = molecularsequence.MolecularSequence(**data) impl_molecularsequence_3(inst2) def impl_molecularsequence_4(inst): assert inst.id == "example-pgx-2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.relative[0].coordinateSystem.coding[0].code == "LA30100-4" assert ( inst.relative[0].coordinateSystem.coding[0].display == "0-based interval counting" ) assert ( inst.relative[0].coordinateSystem.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.relative[0].edit[0].end == 55227979 assert inst.relative[0].edit[0].replacedSequence == "T" assert inst.relative[0].edit[0].replacementSequence == "G" assert inst.relative[0].edit[0].start == 55227978 assert inst.relative[0].startingSequence.orientation == "sense" assert ( inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].code == "NG_007726.3" ) assert ( inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.ncbi.nlm.nih.gov/nuccore"} ).valueUri ) assert inst.relative[0].startingSequence.strand == "watson" assert inst.relative[0].startingSequence.windowEnd == 55227980 assert inst.relative[0].startingSequence.windowStart == 55227970 assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" assert inst.type == "dna" def test_molecularsequence_4(base_settings): """No. 4 tests collection for MolecularSequence. Test File: sequence-example-pgx-2.json """ filename = base_settings["unittest_data_dir"] / "sequence-example-pgx-2.json" inst = molecularsequence.MolecularSequence.model_validate_json( filename.read_bytes() ) assert "MolecularSequence" == inst.get_resource_type() impl_molecularsequence_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MolecularSequence" == data["resourceType"] inst2 = molecularsequence.MolecularSequence(**data) impl_molecularsequence_4(inst2) def impl_molecularsequence_5(inst): assert inst.formatted[0].contentType == "application/json" assert inst.formatted[0].title == "GA4GH API" assert ( inst.formatted[0].url == ExternalValidatorModel.model_validate( { "valueUrl": "http://grch37.rest.ensembl.org/ga4gh/variants/3:rs1333049?content-type=application/json" } ).valueUrl ) assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" assert inst.type == "dna" def test_molecularsequence_5(base_settings): """No. 5 tests collection for MolecularSequence. Test File: molecularsequence-example.json """ filename = base_settings["unittest_data_dir"] / "molecularsequence-example.json" inst = molecularsequence.MolecularSequence.model_validate_json( filename.read_bytes() ) assert "MolecularSequence" == inst.get_resource_type() impl_molecularsequence_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MolecularSequence" == data["resourceType"] inst2 = molecularsequence.MolecularSequence(**data) impl_molecularsequence_5(inst2) def impl_molecularsequence_6(inst): assert inst.id == "coord-1-base" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.relative[0].coordinateSystem.coding[0].code == "LA30102-0" assert ( inst.relative[0].coordinateSystem.coding[0].display == "1-based character counting" ) assert ( inst.relative[0].coordinateSystem.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.relative[0].edit[0].end == 3 assert inst.relative[0].edit[0].replacedSequence == "-" assert inst.relative[0].edit[0].replacementSequence == "ATG" assert inst.relative[0].edit[0].start == 2 assert inst.relative[0].edit[1].end == 5 assert inst.relative[0].edit[1].replacedSequence == "A" assert inst.relative[0].edit[1].replacementSequence == "T" assert inst.relative[0].edit[1].start == 5 assert inst.relative[0].edit[2].end == 7 assert inst.relative[0].edit[2].replacedSequence == "T" assert inst.relative[0].edit[2].replacementSequence == "-" assert inst.relative[0].edit[2].start == 7 assert inst.relative[0].startingSequence.sequenceString == "ACGTAGTC" assert inst.relative[0].startingSequence.strand == "watson" assert inst.relative[0].startingSequence.windowEnd == 8 assert inst.relative[0].startingSequence.windowStart == 1 assert inst.text.status == "generated" assert inst.type == "dna" def test_molecularsequence_6(base_settings): """No. 6 tests collection for MolecularSequence. Test File: coord-1base-example.json """ filename = base_settings["unittest_data_dir"] / "coord-1base-example.json" inst = molecularsequence.MolecularSequence.model_validate_json( filename.read_bytes() ) assert "MolecularSequence" == inst.get_resource_type() impl_molecularsequence_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MolecularSequence" == data["resourceType"] inst2 = molecularsequence.MolecularSequence(**data) impl_molecularsequence_6(inst2) def impl_molecularsequence_7(inst): assert inst.id == "example-TPMT-two" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.relative[0].coordinateSystem.coding[0].code == "LA30102-0" assert ( inst.relative[0].coordinateSystem.coding[0].display == "1-based character counting" ) assert ( inst.relative[0].coordinateSystem.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.relative[0].edit[0].end == 18131012 assert inst.relative[0].edit[0].replacedSequence == "C" assert inst.relative[0].edit[0].replacementSequence == "T" assert inst.relative[0].edit[0].start == 18131012 assert ( inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].code == "NT_007592.15" ) assert ( inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.ncbi.nlm.nih.gov/nuccore"} ).valueUri ) assert inst.relative[0].startingSequence.strand == "watson" assert inst.relative[0].startingSequence.windowEnd == 18143955 assert inst.relative[0].startingSequence.windowStart == 18130918 assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" assert inst.type == "dna" def test_molecularsequence_7(base_settings): """No. 7 tests collection for MolecularSequence. Test File: sequence-example-TPMT-two.json """ filename = base_settings["unittest_data_dir"] / "sequence-example-TPMT-two.json" inst = molecularsequence.MolecularSequence.model_validate_json( filename.read_bytes() ) assert "MolecularSequence" == inst.get_resource_type() impl_molecularsequence_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MolecularSequence" == data["resourceType"] inst2 = molecularsequence.MolecularSequence(**data) impl_molecularsequence_7(inst2) def impl_molecularsequence_8(inst): assert inst.id == "example-pgx-1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.relative[0].coordinateSystem.coding[0].code == "LA30100-4" assert ( inst.relative[0].coordinateSystem.coding[0].display == "0-based interval counting" ) assert ( inst.relative[0].coordinateSystem.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.relative[0].edit[0].end == 55227977 assert inst.relative[0].edit[0].replacedSequence == "T" assert inst.relative[0].edit[0].replacementSequence == "G" assert inst.relative[0].edit[0].start == 55227976 assert inst.relative[0].startingSequence.orientation == "sense" assert ( inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].code == "NG_007726.3" ) assert ( inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.ncbi.nlm.nih.gov/nuccore"} ).valueUri ) assert inst.relative[0].startingSequence.strand == "watson" assert inst.relative[0].startingSequence.windowEnd == 55227980 assert inst.relative[0].startingSequence.windowStart == 55227970 assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" assert inst.type == "dna" def test_molecularsequence_8(base_settings): """No. 8 tests collection for MolecularSequence. Test File: sequence-example-pgx-1.json """ filename = base_settings["unittest_data_dir"] / "sequence-example-pgx-1.json" inst = molecularsequence.MolecularSequence.model_validate_json( filename.read_bytes() ) assert "MolecularSequence" == inst.get_resource_type() impl_molecularsequence_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MolecularSequence" == data["resourceType"] inst2 = molecularsequence.MolecularSequence(**data) impl_molecularsequence_8(inst2) def impl_molecularsequence_9(inst): assert inst.id == "coord-0-base" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.relative[0].coordinateSystem.coding[0].code == "LA30101-2" assert ( inst.relative[0].coordinateSystem.coding[0].display == "0-based character counting" ) assert ( inst.relative[0].coordinateSystem.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.relative[0].edit[0].end == 2 assert inst.relative[0].edit[0].replacedSequence == "-" assert inst.relative[0].edit[0].replacementSequence == "ATG" assert inst.relative[0].edit[0].start == 2 assert inst.relative[0].edit[1].end == 5 assert inst.relative[0].edit[1].replacedSequence == "A" assert inst.relative[0].edit[1].replacementSequence == "T" assert inst.relative[0].edit[1].start == 4 assert inst.relative[0].edit[2].end == 7 assert inst.relative[0].edit[2].replacedSequence == "T" assert inst.relative[0].edit[2].replacementSequence == "-" assert inst.relative[0].edit[2].start == 6 assert inst.relative[0].startingSequence.sequenceString == "ACGTAGTC" assert inst.relative[0].startingSequence.strand == "watson" assert inst.relative[0].startingSequence.windowEnd == 8 assert inst.relative[0].startingSequence.windowStart == 0 assert inst.text.status == "generated" assert inst.type == "dna" def test_molecularsequence_9(base_settings): """No. 9 tests collection for MolecularSequence. Test File: coord-0base-example.json """ filename = base_settings["unittest_data_dir"] / "coord-0base-example.json" inst = molecularsequence.MolecularSequence.model_validate_json( filename.read_bytes() ) assert "MolecularSequence" == inst.get_resource_type() impl_molecularsequence_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MolecularSequence" == data["resourceType"] inst2 = molecularsequence.MolecularSequence(**data) impl_molecularsequence_9(inst2) def impl_molecularsequence_10(inst): assert inst.id == "seq-ordinal" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.relative[0].coordinateSystem.coding[0].code == "LA30102-0" assert ( inst.relative[0].coordinateSystem.coding[0].display == "1-based character counting" ) assert ( inst.relative[0].coordinateSystem.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.relative[0].ordinalPosition == 1 assert float(inst.relative[0].sequenceRange.high.value) == float(2194) assert float(inst.relative[0].sequenceRange.low.value) == float(1) assert ( inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].code == "NM_000141.5" ) assert ( inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.ncbi.nlm.nih.gov/nuccore/"} ).valueUri ) assert inst.relative[0].startingSequence.windowEnd == 2194 assert inst.relative[0].startingSequence.windowStart == 1 assert inst.relative[1].coordinateSystem.coding[0].code == "LA30102-0" assert ( inst.relative[1].coordinateSystem.coding[0].display == "1-based character counting" ) assert ( inst.relative[1].coordinateSystem.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.relative[1].ordinalPosition == 2 assert float(inst.relative[1].sequenceRange.high.value) == float(4899) assert float(inst.relative[1].sequenceRange.low.value) == float(2194) assert ( inst.relative[1].startingSequence.sequenceCodeableConcept.coding[0].code == "NM_000245.4" ) assert ( inst.relative[1].startingSequence.sequenceCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.ncbi.nlm.nih.gov/nuccore/"} ).valueUri ) assert inst.relative[1].startingSequence.windowEnd == 6822 assert inst.relative[1].startingSequence.windowStart == 1923 assert inst.text.status == "generated" assert inst.type == "rna" def test_molecularsequence_10(base_settings): """No. 10 tests collection for MolecularSequence. Test File: sequence-example-ordinal.json """ filename = base_settings["unittest_data_dir"] / "sequence-example-ordinal.json" inst = molecularsequence.MolecularSequence.model_validate_json( filename.read_bytes() ) assert "MolecularSequence" == inst.get_resource_type() impl_molecularsequence_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "MolecularSequence" == data["resourceType"] inst2 = molecularsequence.MolecularSequence(**data) impl_molecularsequence_10(inst2) ================================================ FILE: fhir/resources/tests/test_namingsystem.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/NamingSystem Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import namingsystem from .conftest import ExternalValidatorModel def impl_namingsystem_1(inst): assert inst.contact[0].name == "HL7 Australia FHIR Team" assert inst.contact[0].telecom[0].system == "url" assert ( inst.contact[0].telecom[0].value == "http://hl7-australia.wikispaces.com/FHIR+Australia" ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-31"} ).valueDateTime ) assert inst.description == ( "Australian HI Identifier as established by relevant " "regulations etc." ) assert inst.id == "example-id" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.22.3" assert inst.jurisdiction[0].coding[0].code == "AU" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.kind == "identifier" assert inst.name == "AustalianHealthcareIdentifierIndividual" assert inst.publisher == "HL7 Australia on behalf of NEHTA" assert inst.responsible == "HI Service Operator / NEHTA" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Austalian Healthcare Identifier - Individual" assert inst.type.coding[0].code == "NI" assert inst.type.coding[0].display == "National unique individual identifier" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.type.text == "IHI" assert inst.uniqueId[0].comment == "This value is used in Australian CDA documents" assert inst.uniqueId[0].type == "oid" assert inst.uniqueId[0].value == "1.2.36.1.2001.1003.0" assert ( inst.uniqueId[1].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-21"} ).valueDateTime ) assert inst.uniqueId[1].preferred is True assert inst.uniqueId[1].type == "uri" assert inst.uniqueId[1].value == "http://ns.electronichealth.net.au/id/hi/ihi/1.0" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/example-id"} ).valueUri ) assert inst.usage == "Used in Australia for identifying patients" def test_namingsystem_1(base_settings): """No. 1 tests collection for NamingSystem. Test File: namingsystem-example-id.json """ filename = base_settings["unittest_data_dir"] / "namingsystem-example-id.json" inst = namingsystem.NamingSystem.model_validate_json(filename.read_bytes()) assert "NamingSystem" == inst.get_resource_type() impl_namingsystem_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NamingSystem" == data["resourceType"] inst2 = namingsystem.NamingSystem(**data) impl_namingsystem_1(inst2) def impl_namingsystem_2(inst): assert ( inst.approvalDate == ExternalValidatorModel.model_validate({"valueDate": "2021-07-21"}).valueDate ) assert inst.author[0].name == "ACME NamingSystem Development" assert inst.author[0].telecom[0].system == "url" assert inst.author[0].telecom[0].value == "http://acme.org/development" assert inst.contact[0].name == "FHIR project team" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-07-21"} ).valueDateTime ) assert inst.description == ( "This is an example naming system that illustrates usage of " "the metadata resource elements introduced in R5" ) assert inst.editor[0].name == "ACME NamingSystem Management" assert inst.editor[0].telecom[0].system == "url" assert inst.editor[0].telecom[0].value == "http://acme.org/management" assert ( inst.effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-07-31"} ).valueDateTime ) assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-08-01"} ).valueDateTime ) assert inst.endorser[0].name == "National Foundation for NamingSystem Quality" assert inst.endorser[0].telecom[0].system == "url" assert inst.endorser[0].telecom[0].value == "http://example.org/nfnq" assert inst.experimental is True assert inst.id == "example-metadata" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.22.5" assert inst.kind == "identifier" assert ( inst.lastReviewDate == ExternalValidatorModel.model_validate({"valueDate": "2022-07-21"}).valueDate ) assert inst.meta.profile[0] == ( "http://hl7.org/fhir/StructureDefinition/shareablenamingsyste" "m" ) assert inst.name == "ExampleMetadata" assert inst.publisher == "FHIR (Example)" assert ( inst.relatedArtifact[0].resource == "http://hl7.org/fhir/NamingSystem/example" ) assert inst.relatedArtifact[0].type == "derived-from" assert inst.reviewer[0].name == "Society for Creative NamingSystem Review" assert inst.reviewer[0].telecom[0].system == "url" assert inst.reviewer[0].telecom[0].value == "http://example.org/scnr" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Metadata Example" assert inst.topic[0].coding[0].code == "treatment" assert inst.topic[0].coding[0].display == "Treatment" assert ( inst.topic[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/definition-topic"} ).valueUri ) assert inst.uniqueId[0].type == "oid" assert inst.uniqueId[0].value == "1.2.3.4.5.6.7" assert inst.uniqueId[1].preferred is True assert inst.uniqueId[1].type == "uri" assert inst.uniqueId[1].value == "http://example.com/identifiers" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/example-metadata"} ).valueUri ) assert inst.version == "20210721" def test_namingsystem_2(base_settings): """No. 2 tests collection for NamingSystem. Test File: namingsystem-example-metadata.json """ filename = base_settings["unittest_data_dir"] / "namingsystem-example-metadata.json" inst = namingsystem.NamingSystem.model_validate_json(filename.read_bytes()) assert "NamingSystem" == inst.get_resource_type() impl_namingsystem_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NamingSystem" == data["resourceType"] inst2 = namingsystem.NamingSystem(**data) impl_namingsystem_2(inst2) def impl_namingsystem_3(inst): assert ( inst.approvalDate == ExternalValidatorModel.model_validate({"valueDate": "2021-07-21"}).valueDate ) assert inst.author[0].name == "ACME NamingSystem Development" assert inst.author[0].telecom[0].system == "url" assert inst.author[0].telecom[0].value == "http://acme.org/development" assert inst.contact[0].name == "FHIR project team" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-07-21"} ).valueDateTime ) assert inst.description == ( "This is an example naming system that illustrates usage of " "the metadata resource elements introduced in R5" ) assert inst.editor[0].name == "ACME NamingSystem Management" assert inst.editor[0].telecom[0].system == "url" assert inst.editor[0].telecom[0].value == "http://acme.org/management" assert ( inst.effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-07-31"} ).valueDateTime ) assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-08-01"} ).valueDateTime ) assert inst.endorser[0].name == "National Foundation for NamingSystem Quality" assert inst.endorser[0].telecom[0].system == "url" assert inst.endorser[0].telecom[0].value == "http://example.org/nfnq" assert inst.experimental is True assert inst.id == "example-metadata-2" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.22.4" assert inst.kind == "identifier" assert ( inst.lastReviewDate == ExternalValidatorModel.model_validate({"valueDate": "2022-07-21"}).valueDate ) assert inst.meta.profile[0] == ( "http://hl7.org/fhir/StructureDefinition/shareablenamingsyste" "m" ) assert inst.name == "ExampleMetadata" assert inst.publisher == "FHIR (Example)" assert ( inst.relatedArtifact[0].resource == "http://hl7.org/fhir/NamingSystem/example" ) assert inst.relatedArtifact[0].type == "derived-from" assert ( inst.relatedArtifact[1].resource == "http://hl7.org/fhir/NamingSystem/example-metadata|20210701" ) assert inst.relatedArtifact[1].type == "predecessor" assert inst.reviewer[0].name == "Society for Creative NamingSystem Review" assert inst.reviewer[0].telecom[0].system == "url" assert inst.reviewer[0].telecom[0].value == "http://example.org/scnr" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Metadata Example" assert inst.topic[0].coding[0].code == "treatment" assert inst.topic[0].coding[0].display == "Treatment" assert ( inst.topic[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/definition-topic"} ).valueUri ) assert inst.uniqueId[0].type == "oid" assert inst.uniqueId[0].value == "1.2.3.4.5.6.7" assert inst.uniqueId[1].preferred is True assert inst.uniqueId[1].type == "uri" assert inst.uniqueId[1].value == "http://example.com/identifiers" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/example-metadata-2"} ).valueUri ) assert inst.version == "20220721" def test_namingsystem_3(base_settings): """No. 3 tests collection for NamingSystem. Test File: namingsystem-example-metadata-2.json """ filename = ( base_settings["unittest_data_dir"] / "namingsystem-example-metadata-2.json" ) inst = namingsystem.NamingSystem.model_validate_json(filename.read_bytes()) assert "NamingSystem" == inst.get_resource_type() impl_namingsystem_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NamingSystem" == data["resourceType"] inst2 = namingsystem.NamingSystem(**data) impl_namingsystem_3(inst2) def impl_namingsystem_4(inst): assert inst.contact[0].name == "FHIR project team" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-12-13"} ).valueDateTime ) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.22.1" assert inst.kind == "codesystem" assert inst.name == "SNOMEDCT" assert inst.publisher == "HL7 International on behalf of IHTSDO" assert inst.responsible == "IHTSDO & affiliates" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "SNOMED CT" assert inst.uniqueId[0].type == "oid" assert inst.uniqueId[0].value == "2.16.840.1.113883.6.96" assert inst.uniqueId[1].preferred is True assert inst.uniqueId[1].type == "uri" assert inst.uniqueId[1].value == "http://snomed.info/sct" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/NamingSystem/example"} ).valueUri ) def test_namingsystem_4(base_settings): """No. 4 tests collection for NamingSystem. Test File: namingsystem-example.json """ filename = base_settings["unittest_data_dir"] / "namingsystem-example.json" inst = namingsystem.NamingSystem.model_validate_json(filename.read_bytes()) assert "NamingSystem" == inst.get_resource_type() impl_namingsystem_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NamingSystem" == data["resourceType"] inst2 = namingsystem.NamingSystem(**data) impl_namingsystem_4(inst2) ================================================ FILE: fhir/resources/tests/test_nutritionintake.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/NutritionIntake Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import nutritionintake from .conftest import ExternalValidatorModel def impl_nutritionintake_1(inst): assert inst.code.text == "Inpatient" assert inst.consumedItem[0].amount.code == "%" assert ( inst.consumedItem[0].amount.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.consumedItem[0].amount.unit == "percent" assert float(inst.consumedItem[0].amount.value) == float(100) assert inst.consumedItem[0].nutritionProduct.concept.text == "Grill Sandwich" assert inst.consumedItem[0].type.text == "food" assert inst.consumedItem[1].amount.code == "%" assert ( inst.consumedItem[1].amount.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.consumedItem[1].amount.unit == "percent" assert float(inst.consumedItem[1].amount.value) == float(100) assert ( inst.consumedItem[1].nutritionProduct.concept.text == "French Fries Spiral Battered" ) assert inst.consumedItem[1].type.text == "food" assert inst.consumedItem[2].amount.code == "%" assert ( inst.consumedItem[2].amount.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.consumedItem[2].amount.unit == "percent" assert float(inst.consumedItem[2].amount.value) == float(50) assert ( inst.consumedItem[2].nutritionProduct.concept.text == "Tomato Soup Healthy Request" ) assert inst.consumedItem[2].type.text == "food" assert inst.consumedItem[3].amount.code == "%" assert ( inst.consumedItem[3].amount.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.consumedItem[3].amount.unit == "percent" assert float(inst.consumedItem[3].amount.value) == float(50) assert inst.consumedItem[3].nutritionProduct.concept.text == "Side Garden Salad" assert inst.consumedItem[3].type.text == "food" assert inst.consumedItem[4].amount.code == "%" assert ( inst.consumedItem[4].amount.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.consumedItem[4].amount.unit == "percent" assert float(inst.consumedItem[4].amount.value) == float(100) assert inst.consumedItem[4].nutritionProduct.concept.text == "Ice Tea Unsweetened" assert inst.consumedItem[4].type.text == "fluid" assert inst.encounter.reference == "Encounter/example" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org"} ).valueUri ) assert inst.identifier[0].value == "1144223344" assert inst.ingredientLabel[0].amount.code == "kcal" assert ( inst.ingredientLabel[0].amount.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.ingredientLabel[0].amount.unit == "kilocalorie" assert float(inst.ingredientLabel[0].amount.value) == float(313) assert inst.ingredientLabel[0].nutrient.concept.text == "Total Calories" assert inst.ingredientLabel[1].amount.code == "g" assert ( inst.ingredientLabel[1].amount.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.ingredientLabel[1].amount.unit == "grams" assert float(inst.ingredientLabel[1].amount.value) == float(10.4) assert inst.ingredientLabel[1].nutrient.concept.text == "Protein" assert inst.ingredientLabel[2].amount.code == "g" assert ( inst.ingredientLabel[2].amount.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.ingredientLabel[2].amount.unit == "grams" assert float(inst.ingredientLabel[2].amount.value) == float(18.0) assert inst.ingredientLabel[2].nutrient.concept.text == "Fat (Total)" assert inst.ingredientLabel[3].amount.code == "g" assert ( inst.ingredientLabel[3].amount.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.ingredientLabel[3].amount.unit == "grams" assert float(inst.ingredientLabel[3].amount.value) == float(26.47) assert inst.ingredientLabel[3].nutrient.concept.text == "Carbohydrate" assert inst.ingredientLabel[4].amount.code == "mg" assert ( inst.ingredientLabel[4].amount.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.ingredientLabel[4].amount.unit == "Milligrams" assert float(inst.ingredientLabel[4].amount.value) == float(770) assert inst.ingredientLabel[4].nutrient.concept.text == "Sodium" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-08-02T12:45:18+04:00"} ).valueDateTime ) assert inst.reportedReference.reference == "PractitionerRole/example" assert inst.status == "completed" assert inst.subject.display == "Paula Patient Chalmers" assert inst.text.status == "generated" def test_nutritionintake_1(base_settings): """No. 1 tests collection for NutritionIntake. Test File: nutritionintake-example.json """ filename = base_settings["unittest_data_dir"] / "nutritionintake-example.json" inst = nutritionintake.NutritionIntake.model_validate_json(filename.read_bytes()) assert "NutritionIntake" == inst.get_resource_type() impl_nutritionintake_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NutritionIntake" == data["resourceType"] inst2 = nutritionintake.NutritionIntake(**data) impl_nutritionintake_1(inst2) ================================================ FILE: fhir/resources/tests/test_nutritionorder.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/NutritionOrder Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import nutritionorder from .conftest import ExternalValidatorModel def impl_nutritionorder_1(inst): assert inst.allergyIntolerance[0].display == "Cashew Nuts" assert inst.allergyIntolerance[0].reference == "AllergyIntolerance/example" assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17"} ).valueDateTime ) assert inst.encounter.display == "Inpatient" assert inst.encounter.reference == "Encounter/example" assert inst.excludeFoodModifier[0].coding[0].code == "227493005" assert inst.excludeFoodModifier[0].coding[0].display == "Cashew Nut" assert ( inst.excludeFoodModifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.excludeFoodModifier[0].coding[0].version == "20140730" assert inst.foodPreferenceModifier[0].coding[0].code == "kosher" assert ( inst.foodPreferenceModifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/diet"} ).valueUri ) assert inst.id == "diabeticsupplement" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/nutrition-requests"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.orderer.display == "Dr Adam Careful" assert inst.orderer.reference == "Practitioner/example" assert inst.status == "active" assert inst.subject.display == "Peter Chalmers" assert inst.subject.reference == "Patient/example" assert inst.supplement[0].productName == "Glucerna" assert inst.supplement[0].quantity.unit == "8 oz bottle" assert float(inst.supplement[0].quantity.value) == float(1) assert ( inst.supplement[0].schedule.timing[0].repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-10T15:00:00Z"} ).valueDateTime ) assert inst.supplement[0].schedule.timing[0].repeat.frequency == 1 assert float(inst.supplement[0].schedule.timing[0].repeat.period) == float(24) assert inst.supplement[0].schedule.timing[0].repeat.periodUnit == "h" assert float(inst.supplement[0].schedule.timing[1].repeat.duration) == float(1) assert inst.supplement[0].schedule.timing[1].repeat.durationUnit == "h" assert inst.supplement[0].schedule.timing[1].repeat.when[0] == "HS" assert inst.supplement[0].type.concept.coding[0].code == "443051000124104" assert ( inst.supplement[0].type.concept.coding[0].display == "Adult diabetes specialty formula" ) assert ( inst.supplement[0].type.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.supplement[0].type.concept.coding[1].code == "1010" assert inst.supplement[0].type.concept.coding[1].display == "Adult diabetic formula" assert ( inst.supplement[0].type.concept.coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/supplement-type-codes"} ).valueUri ) assert inst.supplement[0].type.concept.text == "Adult diabetic formula" assert inst.text.status == "generated" def test_nutritionorder_1(base_settings): """No. 1 tests collection for NutritionOrder. Test File: nutritionorder-example-diabeticsupplement.json """ filename = ( base_settings["unittest_data_dir"] / "nutritionorder-example-diabeticsupplement.json" ) inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes()) assert "NutritionOrder" == inst.get_resource_type() impl_nutritionorder_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NutritionOrder" == data["resourceType"] inst2 = nutritionorder.NutritionOrder(**data) impl_nutritionorder_1(inst2) def impl_nutritionorder_2(inst): assert inst.allergyIntolerance[0].display == "Cashew Nuts" assert inst.allergyIntolerance[0].reference == "AllergyIntolerance/example" assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17"} ).valueDateTime ) assert inst.encounter.display == "Inpatient" assert inst.encounter.reference == "Encounter/example" assert inst.enteralFormula.additive[0].productName == "Acme Lipid Additive" assert inst.enteralFormula.additive[0].type.concept.coding[0].code == "lipid" assert inst.enteralFormula.additive[0].type.concept.coding[0].display == "Lipid" assert ( inst.enteralFormula.additive[0].type.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/entformula-additive"} ).valueUri ) assert inst.enteralFormula.administrationInstruction == "240 mls every 4hrs" assert inst.enteralFormula.administration[0].quantity.code == "mL" assert ( inst.enteralFormula.administration[0].quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.enteralFormula.administration[0].quantity.unit == "milliliters" assert float(inst.enteralFormula.administration[0].quantity.value) == float(240) assert ( inst.enteralFormula.administration[0] .schedule.timing[0] .repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17T16:00:00Z"} ).valueDateTime ) assert ( inst.enteralFormula.administration[0].schedule.timing[0].repeat.frequency == 1 ) assert float( inst.enteralFormula.administration[0].schedule.timing[0].repeat.period ) == float(4) assert ( inst.enteralFormula.administration[0].schedule.timing[0].repeat.periodUnit == "h" ) assert inst.enteralFormula.baseFormulaProductName == "Acme High Protein Formula" assert ( inst.enteralFormula.baseFormulaType.concept.coding[0].code == "442991000124104" ) assert ( inst.enteralFormula.baseFormulaType.concept.coding[0].display == "Adult high protein formula" ) assert ( inst.enteralFormula.baseFormulaType.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.enteralFormula.caloricDensity.code == "cal/mL" assert ( inst.enteralFormula.caloricDensity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.enteralFormula.caloricDensity.unit == "calories per milliliter" assert float(inst.enteralFormula.caloricDensity.value) == float(1.5) assert inst.enteralFormula.maxVolumeToDeliver.code == "mL/d" assert ( inst.enteralFormula.maxVolumeToDeliver.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.enteralFormula.maxVolumeToDeliver.unit == "milliliter/day" assert float(inst.enteralFormula.maxVolumeToDeliver.value) == float(1440) assert inst.enteralFormula.routeOfAdministration.coding[0].code == "GT" assert ( inst.enteralFormula.routeOfAdministration.coding[0].display == "Instillation, gastrostomy tube" ) assert ( inst.enteralFormula.routeOfAdministration.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration" } ).valueUri ) assert inst.excludeFoodModifier[0].coding[0].code == "227493005" assert inst.excludeFoodModifier[0].coding[0].display == "Cashew Nut" assert ( inst.excludeFoodModifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.excludeFoodModifier[0].coding[0].version == "20140730" assert inst.foodPreferenceModifier[0].coding[0].code == "dairy-free" assert ( inst.foodPreferenceModifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/diet"} ).valueUri ) assert inst.id == "enteralbolus" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.acme.org/nutritionorders"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.orderer.display == "Dr Adam Careful" assert inst.orderer.reference == "Practitioner/example" assert inst.status == "active" assert inst.subject.display == "Peter Chalmers" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_nutritionorder_2(base_settings): """No. 2 tests collection for NutritionOrder. Test File: nutritionorder-example-enteralbolus.json """ filename = ( base_settings["unittest_data_dir"] / "nutritionorder-example-enteralbolus.json" ) inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes()) assert "NutritionOrder" == inst.get_resource_type() impl_nutritionorder_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NutritionOrder" == data["resourceType"] inst2 = nutritionorder.NutritionOrder(**data) impl_nutritionorder_2(inst2) def impl_nutritionorder_3(inst): assert inst.allergyIntolerance[0].display == "Cashew Nuts" assert inst.allergyIntolerance[0].reference == "AllergyIntolerance/example" assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17"} ).valueDateTime ) assert inst.encounter.display == "Inpatient" assert inst.encounter.reference == "Encounter/example" assert inst.excludeFoodModifier[0].coding[0].code == "227493005" assert inst.excludeFoodModifier[0].coding[0].display == "Cashew Nut" assert ( inst.excludeFoodModifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.excludeFoodModifier[0].coding[0].version == "20140730" assert inst.foodPreferenceModifier[0].coding[0].code == "dairy-free" assert ( inst.foodPreferenceModifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/diet"} ).valueUri ) assert inst.id == "fiberrestricteddiet" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/nutrition-requests"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.oralDiet.nutrient[0].amount.code == "g" assert ( inst.oralDiet.nutrient[0].amount.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.oralDiet.nutrient[0].amount.unit == "grams" assert float(inst.oralDiet.nutrient[0].amount.value) == float(50) assert inst.oralDiet.nutrient[0].modifier.coding[0].code == "256674009" assert inst.oralDiet.nutrient[0].modifier.coding[0].display == "Fat" assert ( inst.oralDiet.nutrient[0].modifier.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.oralDiet.schedule.timing[0].repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-10"} ).valueDateTime ) assert inst.oralDiet.schedule.timing[0].repeat.frequency == 3 assert float(inst.oralDiet.schedule.timing[0].repeat.period) == float(1) assert inst.oralDiet.schedule.timing[0].repeat.periodUnit == "d" assert inst.oralDiet.type[0].coding[0].code == "15108003" assert inst.oralDiet.type[0].coding[0].display == "Restricted fiber diet" assert ( inst.oralDiet.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.type[0].coding[1].code == "1000" assert inst.oralDiet.type[0].coding[1].display == "Fiber restricted" assert ( inst.oralDiet.type[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/diet-type-codes"} ).valueUri ) assert inst.oralDiet.type[0].text == "Fiber restricted diet" assert inst.oralDiet.type[1].coding[0].code == "16208003" assert inst.oralDiet.type[1].coding[0].display == "Low fat diet" assert ( inst.oralDiet.type[1].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.type[1].coding[1].code == "1100" assert inst.oralDiet.type[1].coding[1].display == "Low Fat" assert ( inst.oralDiet.type[1].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/diet-type-codes"} ).valueUri ) assert inst.oralDiet.type[1].text == "Low fat diet" assert inst.orderer.display == "Dr Adam Careful" assert inst.orderer.reference == "Practitioner/example" assert inst.status == "active" assert inst.subject.display == "Peter Chalmers" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_nutritionorder_3(base_settings): """No. 3 tests collection for NutritionOrder. Test File: nutritionorder-example-fiberrestricteddiet.json """ filename = ( base_settings["unittest_data_dir"] / "nutritionorder-example-fiberrestricteddiet.json" ) inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes()) assert "NutritionOrder" == inst.get_resource_type() impl_nutritionorder_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NutritionOrder" == data["resourceType"] inst2 = nutritionorder.NutritionOrder(**data) impl_nutritionorder_3(inst2) def impl_nutritionorder_4(inst): assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17"} ).valueDateTime ) assert inst.id == "texturemodified" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/nutrition-requests"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.oralDiet.schedule.timing[0].repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-10"} ).valueDateTime ) assert inst.oralDiet.schedule.timing[0].repeat.frequency == 3 assert float(inst.oralDiet.schedule.timing[0].repeat.period) == float(1) assert inst.oralDiet.schedule.timing[0].repeat.periodUnit == "d" assert inst.oralDiet.texture[0].foodType.coding[0].code == "28647000" assert inst.oralDiet.texture[0].foodType.coding[0].display == "Meat" assert ( inst.oralDiet.texture[0].foodType.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.texture[0].foodType.text == "Regular, Chopped Meat" assert inst.oralDiet.texture[0].modifier.coding[0].code == "228049004" assert inst.oralDiet.texture[0].modifier.coding[0].display == "Chopped food" assert ( inst.oralDiet.texture[0].modifier.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.texture[0].modifier.text == "Regular, Chopped Meat" assert inst.oralDiet.type[0].coding[0].code == "435801000124108" assert inst.oralDiet.type[0].coding[0].display == "Texture modified diet" assert ( inst.oralDiet.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.type[0].coding[1].code == "1010" assert inst.oralDiet.type[0].coding[1].display == "Texture modified diet" assert ( inst.oralDiet.type[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/diet-type-codes"} ).valueUri ) assert inst.oralDiet.type[0].text == "Texture modified diet" assert inst.orderer.display == "Dr Adam Careful" assert inst.orderer.reference == "Practitioner/example" assert inst.status == "active" assert inst.subject.display == "Peter Chalmers" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_nutritionorder_4(base_settings): """No. 4 tests collection for NutritionOrder. Test File: nutritionorder-example-texture-modified.json """ filename = ( base_settings["unittest_data_dir"] / "nutritionorder-example-texture-modified.json" ) inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes()) assert "NutritionOrder" == inst.get_resource_type() impl_nutritionorder_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NutritionOrder" == data["resourceType"] inst2 = nutritionorder.NutritionOrder(**data) impl_nutritionorder_4(inst2) def impl_nutritionorder_5(inst): assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17"} ).valueDateTime ) assert inst.id == "pureeddiet-simple" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/nutrition-requests"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.oralDiet.fluidConsistencyType[0].coding[0].code == "439021000124105" assert ( inst.oralDiet.fluidConsistencyType[0].coding[0].display == "Dietary liquid consistency - nectar thick liquid" ) assert ( inst.oralDiet.fluidConsistencyType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.fluidConsistencyType[0].text == "Nectar thick liquids" assert ( inst.oralDiet.schedule.timing[0].repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-10"} ).valueDateTime ) assert inst.oralDiet.schedule.timing[0].repeat.frequency == 3 assert float(inst.oralDiet.schedule.timing[0].repeat.period) == float(1) assert inst.oralDiet.schedule.timing[0].repeat.periodUnit == "d" assert inst.oralDiet.texture[0].modifier.coding[0].code == "228055009" assert inst.oralDiet.texture[0].modifier.coding[0].display == "Liquidized food" assert ( inst.oralDiet.texture[0].modifier.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.texture[0].modifier.text == "Pureed" assert inst.oralDiet.type[0].coding[0].code == "226211001" assert inst.oralDiet.type[0].coding[0].display == "Pureed diet" assert ( inst.oralDiet.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.type[0].coding[1].code == "1010" assert inst.oralDiet.type[0].coding[1].display == "Pureed diet" assert ( inst.oralDiet.type[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/diet-type-codes"} ).valueUri ) assert inst.oralDiet.type[0].text == "Pureed diet" assert inst.orderer.display == "Dr Adam Careful" assert inst.orderer.reference == "Practitioner/example" assert inst.status == "active" assert inst.subject.display == "Peter Chalmers" assert inst.subject.reference == "Patient/example" assert ( inst.supplement[0].instruction == "Ensure Pudding at breakfast, lunch, supper" ) assert inst.supplement[0].productName == "Ensure Pudding 4 oz container" assert inst.supplement[0].type.concept.coding[0].code == "442971000124100" assert ( inst.supplement[0].type.concept.coding[0].display == "Adult high energy formula" ) assert ( inst.supplement[0].type.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.supplement[0].type.concept.coding[1].code == "1040" assert ( inst.supplement[0].type.concept.coding[1].display == "Adult high energy pudding" ) assert ( inst.supplement[0].type.concept.coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/supplement-type-codes"} ).valueUri ) assert inst.supplement[0].type.concept.text == "Adult high energy pudding" assert inst.text.status == "generated" def test_nutritionorder_5(base_settings): """No. 5 tests collection for NutritionOrder. Test File: nutritionorder-example-pureeddiet-simple.json """ filename = ( base_settings["unittest_data_dir"] / "nutritionorder-example-pureeddiet-simple.json" ) inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes()) assert "NutritionOrder" == inst.get_resource_type() impl_nutritionorder_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NutritionOrder" == data["resourceType"] inst2 = nutritionorder.NutritionOrder(**data) impl_nutritionorder_5(inst2) def impl_nutritionorder_6(inst): assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17"} ).valueDateTime ) assert inst.encounter.display == "Inpatient" assert inst.encounter.reference == "Encounter/example" assert ( inst.enteralFormula.additive[0].productName == "Acme High Carbohydrate Additive" ) assert inst.enteralFormula.additive[0].type.concept.coding[0].code == "carbohydrate" assert ( inst.enteralFormula.additive[0].type.concept.coding[0].display == "Carbohydrate" ) assert ( inst.enteralFormula.additive[0].type.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/entformula-additive"} ).valueUri ) assert inst.enteralFormula.administrationInstruction == ( "Add high calorie high carbohydrate additive to increase " "cal/oz from 24 cal/oz to 27 cal/oz." ) assert inst.enteralFormula.administration[0].quantity.code == "[foz_us]" assert ( inst.enteralFormula.administration[0].quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.enteralFormula.administration[0].quantity.unit == "ounces" assert float(inst.enteralFormula.administration[0].quantity.value) == float(4) assert ( inst.enteralFormula.administration[0] .schedule.timing[0] .repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17"} ).valueDateTime ) assert ( inst.enteralFormula.administration[0].schedule.timing[0].repeat.frequency == 1 ) assert float( inst.enteralFormula.administration[0].schedule.timing[0].repeat.period ) == float(3) assert ( inst.enteralFormula.administration[0].schedule.timing[0].repeat.periodUnit == "h" ) assert inst.enteralFormula.baseFormulaProductName == "Acme Infant Formula + Iron" assert inst.enteralFormula.baseFormulaType.concept.coding[0].code == "412414007" assert ( inst.enteralFormula.baseFormulaType.concept.coding[0].display == "infant formula + iron" ) assert ( inst.enteralFormula.baseFormulaType.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.enteralFormula.caloricDensity.code == "cal/[foz_us]" assert ( inst.enteralFormula.caloricDensity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.enteralFormula.caloricDensity.unit == "calories per ounce" assert float(inst.enteralFormula.caloricDensity.value) == float(20) assert inst.enteralFormula.maxVolumeToDeliver.code == "[foz_us]" assert ( inst.enteralFormula.maxVolumeToDeliver.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.enteralFormula.maxVolumeToDeliver.unit == "ounces" assert float(inst.enteralFormula.maxVolumeToDeliver.value) == float(32) assert inst.enteralFormula.routeOfAdministration.coding[0].code == "PO" assert ( inst.enteralFormula.routeOfAdministration.coding[0].display == "Swallow, oral" ) assert ( inst.enteralFormula.routeOfAdministration.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration" } ).valueUri ) assert inst.enteralFormula.routeOfAdministration.coding[0].userSelected is True assert inst.id == "infantenteral" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.acme.org/nutritionorders"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.orderer.display == "Dr Adam Careful" assert inst.orderer.reference == "Practitioner/example" assert inst.status == "active" assert inst.subject.display == "Peter Chalmers" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_nutritionorder_6(base_settings): """No. 6 tests collection for NutritionOrder. Test File: nutritionorder-example-infantenteral.json """ filename = ( base_settings["unittest_data_dir"] / "nutritionorder-example-infantenteral.json" ) inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes()) assert "NutritionOrder" == inst.get_resource_type() impl_nutritionorder_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NutritionOrder" == data["resourceType"] inst2 = nutritionorder.NutritionOrder(**data) impl_nutritionorder_6(inst2) def impl_nutritionorder_7(inst): assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17"} ).valueDateTime ) assert inst.encounter.display == "Inpatient" assert inst.encounter.reference == "Encounter/example" assert inst.enteralFormula.administrationInstruction == ( "Hold feedings from 7 pm to 7 am. Add MCT oil to increase " "calories from 1.0 cal/mL to 1.5 cal/mL" ) assert inst.enteralFormula.administration[0].rateQuantity.code == "mL/h" assert ( inst.enteralFormula.administration[0].rateQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.enteralFormula.administration[0].rateQuantity.unit == "ml/hr" assert float(inst.enteralFormula.administration[0].rateQuantity.value) == float(60) assert ( inst.enteralFormula.administration[0] .schedule.timing[0] .repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17T07:00:00Z"} ).valueDateTime ) assert inst.enteralFormula.administration[1].rateQuantity.code == "mL/h" assert ( inst.enteralFormula.administration[1].rateQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.enteralFormula.administration[1].rateQuantity.unit == "ml/hr" assert float(inst.enteralFormula.administration[1].rateQuantity.value) == float(80) assert ( inst.enteralFormula.administration[1] .schedule.timing[0] .repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17T11:00:00Z"} ).valueDateTime ) assert inst.enteralFormula.administration[2].rateQuantity.code == "mL/h" assert ( inst.enteralFormula.administration[2].rateQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.enteralFormula.administration[2].rateQuantity.unit == "ml/hr" assert float(inst.enteralFormula.administration[2].rateQuantity.value) == float(100) assert ( inst.enteralFormula.administration[2] .schedule.timing[0] .repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17T15:00:00Z"} ).valueDateTime ) assert inst.enteralFormula.baseFormulaProductName == "Acme Diabetes Formula" assert ( inst.enteralFormula.baseFormulaType.concept.coding[0].code == "6547210000124112" ) assert ( inst.enteralFormula.baseFormulaType.concept.coding[0].display == "Diabetic specialty enteral formula" ) assert ( inst.enteralFormula.baseFormulaType.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.enteralFormula.caloricDensity.code == "cal/mL" assert ( inst.enteralFormula.caloricDensity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.enteralFormula.caloricDensity.unit == "calories per milliliter" assert float(inst.enteralFormula.caloricDensity.value) == float(1) assert inst.enteralFormula.maxVolumeToDeliver.code == "mL/d" assert ( inst.enteralFormula.maxVolumeToDeliver.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.enteralFormula.maxVolumeToDeliver.unit == "milliliter/day" assert float(inst.enteralFormula.maxVolumeToDeliver.value) == float(880) assert inst.enteralFormula.routeOfAdministration.coding[0].code == "NGT" assert ( inst.enteralFormula.routeOfAdministration.coding[0].display == "Instillation, nasogastric tube" ) assert ( inst.enteralFormula.routeOfAdministration.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration" } ).valueUri ) assert inst.id == "enteralcontinuous" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.acme.org/nutritionorders"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.orderer.display == "Dr Adam Careful" assert inst.orderer.reference == "Practitioner/example" assert inst.status == "active" assert inst.subject.display == "Peter Chalmers" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_nutritionorder_7(base_settings): """No. 7 tests collection for NutritionOrder. Test File: nutritionorder-example-enteralcontinuous.json """ filename = ( base_settings["unittest_data_dir"] / "nutritionorder-example-enteralcontinuous.json" ) inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes()) assert "NutritionOrder" == inst.get_resource_type() impl_nutritionorder_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NutritionOrder" == data["resourceType"] inst2 = nutritionorder.NutritionOrder(**data) impl_nutritionorder_7(inst2) def impl_nutritionorder_8(inst): assert inst.allergyIntolerance[0].display == "Cashew Nuts" assert inst.allergyIntolerance[0].reference == "AllergyIntolerance/example" assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17"} ).valueDateTime ) assert inst.encounter.display == "Inpatient" assert inst.encounter.reference == "Encounter/example" assert inst.excludeFoodModifier[0].coding[0].code == "227493005" assert inst.excludeFoodModifier[0].coding[0].display == "Cashew Nut" assert ( inst.excludeFoodModifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.excludeFoodModifier[0].coding[0].version == "20140730" assert inst.foodPreferenceModifier[0].coding[0].code == "dairy-free" assert ( inst.foodPreferenceModifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/diet"} ).valueUri ) assert inst.id == "cardiacdiet" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/nutrition-requests"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.oralDiet.instruction == "Starting on 2/10 breakfast, maximum 400 ml fluids per meal" ) assert inst.oralDiet.nutrient[0].amount.code == "g" assert ( inst.oralDiet.nutrient[0].amount.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.oralDiet.nutrient[0].amount.unit == "grams" assert float(inst.oralDiet.nutrient[0].amount.value) == float(2) assert inst.oralDiet.nutrient[0].modifier.coding[0].code == "39972003" assert inst.oralDiet.nutrient[0].modifier.coding[0].display == "Sodium" assert ( inst.oralDiet.nutrient[0].modifier.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.nutrient[1].amount.code == "mL" assert ( inst.oralDiet.nutrient[1].amount.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.oralDiet.nutrient[1].amount.unit == "milliliter" assert float(inst.oralDiet.nutrient[1].amount.value) == float(1500) assert inst.oralDiet.nutrient[1].modifier.coding[0].code == "33463005" assert inst.oralDiet.nutrient[1].modifier.coding[0].display == "Fluid" assert ( inst.oralDiet.nutrient[1].modifier.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.type[0].coding[0].code == "386619000" assert inst.oralDiet.type[0].coding[0].display == "Low sodium diet" assert ( inst.oralDiet.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.type[0].coding[1].code == "1040" assert inst.oralDiet.type[0].coding[1].display == "Low Sodium Diet" assert ( inst.oralDiet.type[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/diet-type-codes"} ).valueUri ) assert inst.oralDiet.type[0].text == "Low sodium diet" assert inst.oralDiet.type[1].coding[0].code == "226208002" assert inst.oralDiet.type[1].coding[0].display == "Fluid restricted diet" assert ( inst.oralDiet.type[1].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.type[1].coding[1].code == "1040" assert inst.oralDiet.type[1].coding[1].display == "Fluid restricted diet" assert ( inst.oralDiet.type[1].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/diet-type-codes"} ).valueUri ) assert inst.oralDiet.type[1].text == "Fluid restricted diet" assert inst.orderer.display == "Dr Adam Careful" assert inst.orderer.reference == "Practitioner/example" assert inst.status == "active" assert inst.subject.display == "Peter Chalmers" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_nutritionorder_8(base_settings): """No. 8 tests collection for NutritionOrder. Test File: nutritionorder-example-cardiacdiet.json """ filename = ( base_settings["unittest_data_dir"] / "nutritionorder-example-cardiacdiet.json" ) inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes()) assert "NutritionOrder" == inst.get_resource_type() impl_nutritionorder_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NutritionOrder" == data["resourceType"] inst2 = nutritionorder.NutritionOrder(**data) impl_nutritionorder_8(inst2) def impl_nutritionorder_9(inst): assert inst.allergyIntolerance[0].display == "Cashew Nuts" assert inst.allergyIntolerance[0].reference == "AllergyIntolerance/example" assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17"} ).valueDateTime ) assert inst.encounter.display == "Inpatient" assert inst.encounter.reference == "Encounter/example" assert inst.excludeFoodModifier[0].coding[0].code == "227493005" assert inst.excludeFoodModifier[0].coding[0].display == "Cashew Nut" assert ( inst.excludeFoodModifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.excludeFoodModifier[0].coding[0].version == "20140730" assert inst.foodPreferenceModifier[0].coding[0].code == "dairy-free" assert ( inst.foodPreferenceModifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/diet"} ).valueUri ) assert inst.id == "pureeddiet" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/nutrition-requests"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.oralDiet.fluidConsistencyType[0].coding[0].code == "439021000124105" assert ( inst.oralDiet.fluidConsistencyType[0].coding[0].display == "Dietary liquid consistency - nectar thick liquid" ) assert ( inst.oralDiet.fluidConsistencyType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.fluidConsistencyType[0].text == "Nectar thick liquids" assert ( inst.oralDiet.schedule.timing[0].repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-10"} ).valueDateTime ) assert inst.oralDiet.schedule.timing[0].repeat.frequency == 3 assert float(inst.oralDiet.schedule.timing[0].repeat.period) == float(1) assert inst.oralDiet.schedule.timing[0].repeat.periodUnit == "d" assert inst.oralDiet.texture[0].modifier.coding[0].code == "228055009" assert inst.oralDiet.texture[0].modifier.coding[0].display == "Liquidized food" assert ( inst.oralDiet.texture[0].modifier.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.texture[0].modifier.text == "Pureed" assert inst.oralDiet.type[0].coding[0].code == "226211001" assert inst.oralDiet.type[0].coding[0].display == "Pureed diet" assert ( inst.oralDiet.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.type[0].coding[1].code == "1010" assert inst.oralDiet.type[0].coding[1].display == "Pureed diet" assert ( inst.oralDiet.type[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/diet-type-codes"} ).valueUri ) assert inst.oralDiet.type[0].text == "Pureed diet" assert inst.orderer.display == "Dr Adam Careful" assert inst.orderer.reference == "Practitioner/example" assert inst.status == "active" assert inst.subject.display == "Peter Chalmers" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_nutritionorder_9(base_settings): """No. 9 tests collection for NutritionOrder. Test File: nutritionorder-example-pureeddiet.json """ filename = ( base_settings["unittest_data_dir"] / "nutritionorder-example-pureeddiet.json" ) inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes()) assert "NutritionOrder" == inst.get_resource_type() impl_nutritionorder_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NutritionOrder" == data["resourceType"] inst2 = nutritionorder.NutritionOrder(**data) impl_nutritionorder_9(inst2) def impl_nutritionorder_10(inst): assert inst.allergyIntolerance[0].display == "Cashew Nuts" assert inst.allergyIntolerance[0].reference == "AllergyIntolerance/example" assert ( inst.dateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-17"} ).valueDateTime ) assert inst.encounter.display == "Inpatient" assert inst.encounter.reference == "Encounter/example" assert inst.excludeFoodModifier[0].coding[0].code == "227493005" assert inst.excludeFoodModifier[0].coding[0].display == "Cashew Nut" assert ( inst.excludeFoodModifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.excludeFoodModifier[0].coding[0].version == "20140730" assert inst.foodPreferenceModifier[0].coding[0].code == "dairy-free" assert ( inst.foodPreferenceModifier[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/diet"} ).valueUri ) assert inst.id == "diabeticdiet" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/nutrition-requests"} ).valueUri ) assert inst.identifier[0].value == "123" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.oralDiet.nutrient[0].amount.code == "g" assert ( inst.oralDiet.nutrient[0].amount.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.oralDiet.nutrient[0].amount.unit == "grams" assert float(inst.oralDiet.nutrient[0].amount.value) == float(75) assert inst.oralDiet.nutrient[0].modifier.coding[0].code == "2331003" assert inst.oralDiet.nutrient[0].modifier.coding[0].display == "Carbohydrate" assert ( inst.oralDiet.nutrient[0].modifier.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.oralDiet.schedule.timing[0].repeat.boundsPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-02-10"} ).valueDateTime ) assert inst.oralDiet.schedule.timing[0].repeat.frequency == 3 assert float(inst.oralDiet.schedule.timing[0].repeat.period) == float(1) assert inst.oralDiet.schedule.timing[0].repeat.periodUnit == "d" assert inst.oralDiet.type[0].coding[0].code == "160670007" assert inst.oralDiet.type[0].coding[0].display == "Diabetic diet" assert ( inst.oralDiet.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.oralDiet.type[0].coding[1].code == "1030" assert inst.oralDiet.type[0].coding[1].display == "DD - Diabetic diet" assert ( inst.oralDiet.type[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealthhospital.org/diet-type-codes"} ).valueUri ) assert inst.oralDiet.type[0].text == "DD - Diabetic diet" assert inst.orderer.display == "Dr Adam Careful" assert inst.orderer.reference == "Practitioner/example" assert inst.status == "active" assert inst.subject.display == "Peter Chalmers" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_nutritionorder_10(base_settings): """No. 10 tests collection for NutritionOrder. Test File: nutritionorder-example-diabeticdiet.json """ filename = ( base_settings["unittest_data_dir"] / "nutritionorder-example-diabeticdiet.json" ) inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes()) assert "NutritionOrder" == inst.get_resource_type() impl_nutritionorder_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NutritionOrder" == data["resourceType"] inst2 = nutritionorder.NutritionOrder(**data) impl_nutritionorder_10(inst2) ================================================ FILE: fhir/resources/tests/test_nutritionproduct.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/NutritionProduct Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import nutritionproduct from .conftest import ExternalValidatorModel def impl_nutritionproduct_1(inst): assert inst.category[0].coding[0].code == "227313005" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.coding[0].code == "227507002" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "example" assert ( inst.instance[0].identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/foodserials"} ).valueUri ) assert inst.instance[0].identifier[0].value == "77239487" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "active" assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" def test_nutritionproduct_1(base_settings): """No. 1 tests collection for NutritionProduct. Test File: nutritionproduct-example.json """ filename = base_settings["unittest_data_dir"] / "nutritionproduct-example.json" inst = nutritionproduct.NutritionProduct.model_validate_json(filename.read_bytes()) assert "NutritionProduct" == inst.get_resource_type() impl_nutritionproduct_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "NutritionProduct" == data["resourceType"] inst2 = nutritionproduct.NutritionProduct(**data) impl_nutritionproduct_1(inst2) ================================================ FILE: fhir/resources/tests/test_observation.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Observation Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import observation from .conftest import ExternalValidatorModel def impl_observation_1(inst): assert inst.bodySite.coding[0].code == "71341001:272741003=7771000" assert ( inst.bodySite.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.bodySite.text == "Left Femur" assert inst.code.coding[0].code == "24701-5" assert inst.code.coding[0].display == "Femur DXA Bone density" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.code.text == "BMD - Left Femur" assert inst.id == "bmd" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].display == "Acme Imaging Diagnostics" assert ( inst.performer[0].reference == "Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" ) assert inst.status == "final" assert inst.subject.reference == "Patient/pat2" assert inst.text.status == "generated" assert inst.valueQuantity.code == "g/cm-2" assert ( inst.valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.valueQuantity.unit == "g/cm²" assert float(inst.valueQuantity.value) == float(0.887) def test_observation_1(base_settings): """No. 1 tests collection for Observation. Test File: observation-example-bmd.json """ filename = base_settings["unittest_data_dir"] / "observation-example-bmd.json" inst = observation.Observation.model_validate_json(filename.read_bytes()) assert "Observation" == inst.get_resource_type() impl_observation_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Observation" == data["resourceType"] inst2 = observation.Observation(**data) impl_observation_1(inst2) def impl_observation_2(inst): assert inst.category[0].coding[0].code == "vital-signs" assert inst.category[0].coding[0].display == "Vital Signs" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/observation-category"} ).valueUri ) assert inst.category[0].text == "Vital Signs" assert inst.code.coding[0].code == "9279-1" assert inst.code.coding[0].display == "Respiratory rate" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.code.text == "Respiratory rate" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "1999-07-02"} ).valueDateTime ) assert inst.id == "respiratory-rate" assert inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/vitalsigns" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "final" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" assert inst.valueQuantity.code == "/min" assert ( inst.valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.valueQuantity.unit == "breaths/minute" assert float(inst.valueQuantity.value) == float(26) def test_observation_2(base_settings): """No. 2 tests collection for Observation. Test File: observation-example-respiratory-rate.json """ filename = ( base_settings["unittest_data_dir"] / "observation-example-respiratory-rate.json" ) inst = observation.Observation.model_validate_json(filename.read_bytes()) assert "Observation" == inst.get_resource_type() impl_observation_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Observation" == data["resourceType"] inst2 = observation.Observation(**data) impl_observation_2(inst2) def impl_observation_3(inst): assert inst.category[0].coding[0].code == "vital-signs" assert inst.category[0].coding[0].display == "Vital Signs" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/observation-category"} ).valueUri ) assert inst.code.coding[0].code == "29463-7" assert inst.code.coding[0].display == "Body Weight" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.code.coding[1].code == "3141-9" assert inst.code.coding[1].display == "Body weight Measured" assert ( inst.code.coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.code.coding[2].code == "27113001" assert inst.code.coding[2].display == "Body weight" assert ( inst.code.coding[2].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.coding[3].code == "body-weight" assert inst.code.coding[3].display == "Body Weight" assert ( inst.code.coding[3].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org/devices/clinical-codes"} ).valueUri ) assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-03-28"} ).valueDateTime ) assert inst.encounter.reference == "Encounter/example" assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "final" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" assert inst.valueQuantity.code == "[lb_av]" assert ( inst.valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.valueQuantity.unit == "lbs" assert float(inst.valueQuantity.value) == float(185) def test_observation_3(base_settings): """No. 3 tests collection for Observation. Test File: observation-example.json """ filename = base_settings["unittest_data_dir"] / "observation-example.json" inst = observation.Observation.model_validate_json(filename.read_bytes()) assert "Observation" == inst.get_resource_type() impl_observation_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Observation" == data["resourceType"] inst2 = observation.Observation(**data) impl_observation_3(inst2) def impl_observation_4(inst): assert inst.category[0].coding[0].code == "vital-signs" assert inst.category[0].coding[0].display == "Vital Signs" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/observation-category"} ).valueUri ) assert inst.category[0].text == "Vital Signs" assert inst.code.coding[0].code == "8478-0" assert inst.code.coding[0].display == "Mean blood pressure" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.code.text == "Mean blood pressure" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "1999-07-02"} ).valueDateTime ) assert inst.id == "mbp" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "final" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" assert inst.valueQuantity.code == "mm[Hg]" assert ( inst.valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.valueQuantity.unit == "mm[Hg]" assert float(inst.valueQuantity.value) == float(80) def test_observation_4(base_settings): """No. 4 tests collection for Observation. Test File: observation-example-mbp.json """ filename = base_settings["unittest_data_dir"] / "observation-example-mbp.json" inst = observation.Observation.model_validate_json(filename.read_bytes()) assert "Observation" == inst.get_resource_type() impl_observation_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Observation" == data["resourceType"] inst2 = observation.Observation(**data) impl_observation_4(inst2) def impl_observation_5(inst): assert inst.category[0].coding[0].code == "vital-signs" assert inst.category[0].coding[0].display == "Vital Signs" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/observation-category"} ).valueUri ) assert inst.category[0].text == "Vital Signs" assert inst.code.coding[0].code == "39156-5" assert inst.code.coding[0].display == "Body mass index (BMI) [Ratio]" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.code.text == "BMI" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "1999-07-02"} ).valueDateTime ) assert inst.id == "bmi" assert inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/vitalsigns" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "final" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" assert inst.valueQuantity.code == "kg/m2" assert ( inst.valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.valueQuantity.unit == "kg/m2" assert float(inst.valueQuantity.value) == float(16.2) def test_observation_5(base_settings): """No. 5 tests collection for Observation. Test File: observation-example-bmi.json """ filename = base_settings["unittest_data_dir"] / "observation-example-bmi.json" inst = observation.Observation.model_validate_json(filename.read_bytes()) assert "Observation" == inst.get_resource_type() impl_observation_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Observation" == data["resourceType"] inst2 = observation.Observation(**data) impl_observation_5(inst2) def impl_observation_6(inst): assert inst.category[0].coding[0].code == "vital-signs" assert inst.category[0].coding[0].display == "Vital Signs" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/observation-category"} ).valueUri ) assert inst.category[0].text == "Vital Signs" assert inst.code.coding[0].code == "8302-2" assert inst.code.coding[0].display == "Body height" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.code.text == "Body height" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "1999-07-02"} ).valueDateTime ) assert inst.id == "body-height" assert inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/vitalsigns" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "final" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" assert inst.valueQuantity.code == "[in_i]" assert ( inst.valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.valueQuantity.unit == "in" assert float(inst.valueQuantity.value) == float(66.89999999999999) def test_observation_6(base_settings): """No. 6 tests collection for Observation. Test File: observation-example-body-height.json """ filename = ( base_settings["unittest_data_dir"] / "observation-example-body-height.json" ) inst = observation.Observation.model_validate_json(filename.read_bytes()) assert "Observation" == inst.get_resource_type() impl_observation_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Observation" == data["resourceType"] inst2 = observation.Observation(**data) impl_observation_6(inst2) def impl_observation_7(inst): assert inst.code.text == "eye color" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-05-18"} ).valueDateTime ) assert inst.id == "eye-color" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "final" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" assert inst.valueString == "blue" def test_observation_7(base_settings): """No. 7 tests collection for Observation. Test File: observation-example-eye-color.json """ filename = base_settings["unittest_data_dir"] / "observation-example-eye-color.json" inst = observation.Observation.model_validate_json(filename.read_bytes()) assert "Observation" == inst.get_resource_type() impl_observation_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Observation" == data["resourceType"] inst2 = observation.Observation(**data) impl_observation_7(inst2) def impl_observation_8(inst): assert inst.category[0].coding[0].code == "vital-signs" assert inst.category[0].coding[0].display == "Vital Signs" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/observation-category"} ).valueUri ) assert inst.category[0].text == "Vital Signs" assert inst.code.coding[0].code == "8310-5" assert inst.code.coding[0].display == "Body temperature" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.code.text == "Body temperature" assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "1999-07-02"} ).valueDateTime ) assert inst.id == "body-temperature" assert inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/vitalsigns" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "final" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" assert inst.valueQuantity.code == "Cel" assert ( inst.valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.valueQuantity.unit == "C" assert float(inst.valueQuantity.value) == float(36.5) def test_observation_8(base_settings): """No. 8 tests collection for Observation. Test File: observation-example-body-temperature.json """ filename = ( base_settings["unittest_data_dir"] / "observation-example-body-temperature.json" ) inst = observation.Observation.model_validate_json(filename.read_bytes()) assert "Observation" == inst.get_resource_type() impl_observation_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Observation" == data["resourceType"] inst2 = observation.Observation(**data) impl_observation_8(inst2) def impl_observation_9(inst): assert inst.category[0].coding[0].code == "exam" assert inst.category[0].coding[0].display == "Exam" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/observation-category"} ).valueUri ) assert inst.category[0].text == "Exam" assert inst.code.coding[0].code == "410211008" assert inst.code.coding[0].display == "Tracheostomy care assessment (procedure)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-03-11T16:07:54+00:00"} ).valueDateTime ) assert inst.focus[0].reference == "Patient/infant-mom" assert inst.id == "trachcare" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "final" assert inst.subject.reference == "Patient/infant" assert inst.text.status == "generated" assert ( inst.valueString == "Mother is trained to change her child's tracheostomy tube" ) def test_observation_9(base_settings): """No. 9 tests collection for Observation. Test File: observation-example-trachcare.json """ filename = base_settings["unittest_data_dir"] / "observation-example-trachcare.json" inst = observation.Observation.model_validate_json(filename.read_bytes()) assert "Observation" == inst.get_resource_type() impl_observation_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Observation" == data["resourceType"] inst2 = observation.Observation(**data) impl_observation_9(inst2) def impl_observation_10(inst): assert inst.code.coding[0].code == "11555-0" assert inst.code.coding[0].display == "Base excess in Blood by calculation" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.effectiveDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-04-02T10:30:10+01:00"} ).valueDateTime ) assert inst.id == "f002" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.bmc.nl/zorgportal/identifiers/observations"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "6324" assert inst.interpretation[0].coding[0].code == "H" assert inst.interpretation[0].coding[0].display == "High" assert ( inst.interpretation[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation" } ).valueUri ) assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueInstant": "2013-04-03T15:30:10+01:00"} ).valueInstant ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].display == "A. Langeveld" assert inst.performer[0].reference == "Practitioner/f005" assert inst.referenceRange[0].high.code == "mmol/L" assert ( inst.referenceRange[0].high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.referenceRange[0].high.unit == "mmol/l" assert float(inst.referenceRange[0].high.value) == float(11.2) assert inst.referenceRange[0].low.code == "mmol/L" assert ( inst.referenceRange[0].low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.referenceRange[0].low.unit == "mmol/l" assert float(inst.referenceRange[0].low.value) == float(7.1) assert inst.status == "final" assert inst.subject.display == "P. van de Heuvel" assert inst.subject.reference == "Patient/f001" assert inst.text.status == "generated" assert inst.valueQuantity.code == "mmol/L" assert ( inst.valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.valueQuantity.unit == "mmol/l" assert float(inst.valueQuantity.value) == float(12.6) def test_observation_10(base_settings): """No. 10 tests collection for Observation. Test File: observation-example-f002-excess.json """ filename = ( base_settings["unittest_data_dir"] / "observation-example-f002-excess.json" ) inst = observation.Observation.model_validate_json(filename.read_bytes()) assert "Observation" == inst.get_resource_type() impl_observation_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Observation" == data["resourceType"] inst2 = observation.Observation(**data) impl_observation_10(inst2) ================================================ FILE: fhir/resources/tests/test_observationdefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ObservationDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import observationdefinition from .conftest import ExternalValidatorModel def impl_observationdefinition_1(inst): assert inst.category[0].coding[0].code == "laboratory" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/observation-category"} ).valueUri ) assert inst.code.coding[0].code == "13980-8" assert ( inst.code.coding[0].display == "Albumin/Protein.total in Serum or Plasma by Electrophoresis" ) assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.method.coding[0].code == "115341008" assert inst.method.coding[0].display == "Total measurement" assert ( inst.method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.multipleResultsAllowed is False assert inst.permittedDataType[0] == "Quantity" assert inst.permittedUnit[0].code == "%" assert inst.permittedUnit[0].display == "%" assert ( inst.permittedUnit[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.qualifiedValue[0].context.coding[0].code == "normal" assert inst.qualifiedValue[0].context.coding[0].display == "Normal Range" assert ( inst.qualifiedValue[0].context.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/referencerange-meaning"} ).valueUri ) assert float(inst.qualifiedValue[0].range.low.value) == float(50) assert inst.qualifiedValue[0].rangeCategory == "reference" assert inst.qualifiedValue[1].context.coding[0].code == "normal" assert inst.qualifiedValue[1].context.coding[0].display == "Normal Range" assert ( inst.qualifiedValue[1].context.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/referencerange-meaning"} ).valueUri ) assert float(inst.qualifiedValue[1].range.high.value) == float(40) assert inst.qualifiedValue[1].rangeCategory == "critical" assert inst.status == "active" assert inst.text.status == "generated" def test_observationdefinition_1(base_settings): """No. 1 tests collection for ObservationDefinition. Test File: observationdefinition-example.json """ filename = base_settings["unittest_data_dir"] / "observationdefinition-example.json" inst = observationdefinition.ObservationDefinition.model_validate_json( filename.read_bytes() ) assert "ObservationDefinition" == inst.get_resource_type() impl_observationdefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ObservationDefinition" == data["resourceType"] inst2 = observationdefinition.ObservationDefinition(**data) impl_observationdefinition_1(inst2) ================================================ FILE: fhir/resources/tests/test_operationdefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/OperationDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import operationdefinition from .conftest import ExternalValidatorModel def impl_operationdefinition_1(inst): assert inst.affectsState is False assert inst.code == "translate-id" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[0].valueInteger == 1 assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert inst.id == "NamingSystem-translate-id" assert inst.instance is False assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert inst.kind == "operation" assert inst.name == "TranslateId" assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 1 assert inst.parameter[0].name == "id" assert inst.parameter[0].type == "string" assert inst.parameter[0].use == "in" assert ( inst.parameter[1].binding.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName" } ).valueUri ) assert ( inst.parameter[1].binding.extension[0].valueString == "NamingSystemIdentifierType" ) assert inst.parameter[1].binding.strength == "required" assert inst.parameter[1].binding.valueSet == ( "http://hl7.org/fhir/ValueSet/namingsystem-identifier-" "type|5.0.0" ) assert inst.parameter[1].max == "1" assert inst.parameter[1].min == 1 assert inst.parameter[1].name == "sourceType" assert inst.parameter[1].type == "code" assert inst.parameter[1].use == "in" assert ( inst.parameter[2].binding.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName" } ).valueUri ) assert ( inst.parameter[2].binding.extension[0].valueString == "NamingSystemIdentifierType" ) assert inst.parameter[2].binding.strength == "required" assert inst.parameter[2].binding.valueSet == ( "http://hl7.org/fhir/ValueSet/namingsystem-identifier-" "type|5.0.0" ) assert inst.parameter[2].max == "1" assert inst.parameter[2].min == 1 assert inst.parameter[2].name == "targetType" assert inst.parameter[2].type == "code" assert inst.parameter[2].use == "in" assert inst.parameter[3].documentation == ( "If preferredOnly = true then return only the preferred " "identifier, or if preferredOnly = false then return all " "available ids." ) assert inst.parameter[3].max == "1" assert inst.parameter[3].min == 0 assert inst.parameter[3].name == "preferredOnly" assert inst.parameter[3].type == "boolean" assert inst.parameter[3].use == "in" assert inst.parameter[4].documentation == ( "If 'date' is supplied return only ids that have a validity " "period that includes that date." ) assert inst.parameter[4].max == "1" assert inst.parameter[4].min == 0 assert inst.parameter[4].name == "date" assert inst.parameter[4].type == "dateTime" assert inst.parameter[4].use == "in" assert ( inst.parameter[5].documentation == "True if the identifier could be translated successfully." ) assert inst.parameter[5].max == "1" assert inst.parameter[5].min == 1 assert inst.parameter[5].name == "result" assert inst.parameter[5].type == "boolean" assert inst.parameter[5].use == "out" assert ( inst.parameter[6].documentation == "The target identifer(s) of the requested type" ) assert inst.parameter[6].max == "*" assert inst.parameter[6].min == 0 assert inst.parameter[6].name == "targetIdentifier" assert inst.parameter[6].type == "string" assert inst.parameter[6].use == "out" assert ( inst.parameter[7].documentation == "Whether the target identifier is preferred." ) assert inst.parameter[7].max == "1" assert inst.parameter[7].min == 0 assert inst.parameter[7].name == "targetIdentifer.preferred" assert inst.parameter[7].type == "boolean" assert inst.parameter[7].use == "out" assert ( inst.parameter[8].documentation == "The perioid when the target identifier is valid." ) assert inst.parameter[8].max == "1" assert inst.parameter[8].min == 0 assert inst.parameter[8].name == "targetIdentifier.period" assert inst.parameter[8].type == "Period" assert inst.parameter[8].use == "out" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "NamingSystem" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "extensions" assert inst.title == "Translate id" assert inst.type is True assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/OperationDefinition/NamingSystem-translate-id" } ).valueUri ) assert inst.version == "5.0.0" def test_operationdefinition_1(base_settings): """No. 1 tests collection for OperationDefinition. Test File: operation-namingsystem-translate-id.json """ filename = ( base_settings["unittest_data_dir"] / "operation-namingsystem-translate-id.json" ) inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_1(inst2) def impl_operationdefinition_2(inst): assert inst.affectsState is True assert inst.code == "docref" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[0].valueInteger == 3 assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert inst.id == "DocumentReference-docref" assert inst.instance is False assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert inst.kind == "operation" assert inst.name == "Docref" assert inst.parameter[0].documentation == ( "The id of the patient resource located on the server on " "which this operation is executed. If there is no match, an " "empty Bundle is returned" ) assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 1 assert inst.parameter[0].name == "patient" assert inst.parameter[0].type == "id" assert inst.parameter[0].use == "in" assert inst.parameter[1].max == "1" assert inst.parameter[1].min == 0 assert inst.parameter[1].name == "start" assert inst.parameter[1].type == "dateTime" assert inst.parameter[1].use == "in" assert inst.parameter[2].max == "1" assert inst.parameter[2].min == 0 assert inst.parameter[2].name == "end" assert inst.parameter[2].type == "dateTime" assert inst.parameter[2].use == "in" assert inst.parameter[3].binding.strength == "required" assert ( inst.parameter[3].binding.valueSet == "http://hl7.org/fhir/ValueSet/doc-typecodes|5.0.0" ) assert inst.parameter[3].max == "1" assert inst.parameter[3].min == 0 assert inst.parameter[3].name == "type" assert inst.parameter[3].type == "CodeableConcept" assert inst.parameter[3].use == "in" assert inst.parameter[4].documentation == ( "This on-demand parameter allows client to dictate whether " "they are requesting only 'on-demand' or both 'on-demand' and" " 'stable' documents (or delayed/deferred assembly) that meet" " the query parameters" ) assert inst.parameter[4].max == "1" assert inst.parameter[4].min == 0 assert inst.parameter[4].name == "on-demand" assert inst.parameter[4].type == "boolean" assert inst.parameter[4].use == "in" assert inst.parameter[5].documentation == ( 'The bundle type is "searchset"containing ' "[DocumentReference](documentreference.html) resources." ) assert inst.parameter[5].max == "1" assert inst.parameter[5].min == 1 assert inst.parameter[5].name == "return" assert inst.parameter[5].type == "Bundle" assert inst.parameter[5].use == "out" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "DocumentReference" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "extensions" assert inst.title == "Fetch DocumentReference" assert inst.type is True assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/OperationDefinition/DocumentReference-docref" } ).valueUri ) assert inst.version == "5.0.0" def test_operationdefinition_2(base_settings): """No. 2 tests collection for OperationDefinition. Test File: operation-documentreference-docref.json """ filename = ( base_settings["unittest_data_dir"] / "operation-documentreference-docref.json" ) inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_2(inst2) def impl_operationdefinition_3(inst): assert inst.affectsState is False assert inst.code == "status" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.description == ( "This operation is used to return the current status " "information about one or more topic-based Subscriptions." ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[0].valueInteger == 2 assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert inst.id == "Subscription-status" assert inst.instance is True assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert inst.kind == "operation" assert inst.name == "Status" assert inst.parameter[0].max == "*" assert inst.parameter[0].min == 0 assert inst.parameter[0].name == "id" assert inst.parameter[0].scope[0] == "type" assert inst.parameter[0].type == "id" assert inst.parameter[0].use == "in" assert inst.parameter[1].binding.strength == "required" assert ( inst.parameter[1].binding.valueSet == "http://hl7.org/fhir/ValueSet/subscription-status|5.0.0" ) assert inst.parameter[1].max == "*" assert inst.parameter[1].min == 0 assert inst.parameter[1].name == "status" assert inst.parameter[1].scope[0] == "type" assert inst.parameter[1].type == "code" assert inst.parameter[1].use == "in" assert inst.parameter[2].documentation == ( "The operation returns a bundle containing zero or more " "SubscriptionStatus resources, one per Subscription in the " 'request that was found. The Bundle type is "searchset".' ) assert inst.parameter[2].max == "1" assert inst.parameter[2].min == 1 assert inst.parameter[2].name == "return" assert inst.parameter[2].type == "Bundle" assert inst.parameter[2].use == "out" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "Subscription" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "extensions" assert inst.title == ( "Get Current Subscription Status for One or More " "Subscriptions" ) assert inst.type is True assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/OperationDefinition/Subscription-status"} ).valueUri ) assert inst.version == "5.0.0" def test_operationdefinition_3(base_settings): """No. 3 tests collection for OperationDefinition. Test File: operation-subscription-status.json """ filename = base_settings["unittest_data_dir"] / "operation-subscription-status.json" inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_3(inst2) def impl_operationdefinition_4(inst): assert inst.affectsState is False assert inst.code == "data-requirements" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.description == ( "The data-requirements operation aggregates and returns the " "parameters and data requirements for the measure and all its" " dependencies as a single module definition" ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[0].valueInteger == 3 assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert inst.id == "Measure-data-requirements" assert inst.instance is True assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert inst.kind == "operation" assert inst.name == "DataRequirements" assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 1 assert inst.parameter[0].name == "periodStart" assert inst.parameter[0].type == "date" assert inst.parameter[0].use == "in" assert inst.parameter[1].documentation == ( "The end of the measurement period. The period will end at " "the end of the period implied by the supplied timestamp. " "E.g. a value of 2014 would set the period end to be " "2014-12-31T23:59:59 inclusive" ) assert inst.parameter[1].max == "1" assert inst.parameter[1].min == 1 assert inst.parameter[1].name == "periodEnd" assert inst.parameter[1].type == "date" assert inst.parameter[1].use == "in" assert inst.parameter[2].documentation == ( "The result of the requirements gathering is a module-" "definition Library that describes the aggregate parameters, " "data requirements, and dependencies of the measure" ) assert inst.parameter[2].max == "1" assert inst.parameter[2].min == 1 assert inst.parameter[2].name == "return" assert inst.parameter[2].type == "Library" assert inst.parameter[2].use == "out" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "Measure" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "extensions" assert inst.title == "Data Requirements" assert inst.type is False assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/OperationDefinition/Measure-data-requirements" } ).valueUri ) assert inst.version == "5.0.0" def test_operationdefinition_4(base_settings): """No. 4 tests collection for OperationDefinition. Test File: operation-measure-data-requirements.json """ filename = ( base_settings["unittest_data_dir"] / "operation-measure-data-requirements.json" ) inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_4(inst2) def impl_operationdefinition_5(inst): assert inst.affectsState is False assert inst.code == "translate" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[0].valueInteger == 1 assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert inst.id == "ConceptMap-translate" assert inst.instance is True assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert inst.kind == "operation" assert inst.name == "Translate" assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 0 assert inst.parameter[0].name == "url" assert inst.parameter[0].scope[0] == "type" assert inst.parameter[0].type == "uri" assert inst.parameter[0].use == "in" assert inst.parameter[1].documentation == ( "The concept map is provided directly as part of the request." " Servers may choose not to accept concept maps in this " "fashion." ) assert inst.parameter[1].max == "1" assert inst.parameter[1].min == 0 assert inst.parameter[1].name == "conceptMap" assert inst.parameter[1].scope[0] == "type" assert inst.parameter[1].type == "ConceptMap" assert inst.parameter[1].use == "in" assert inst.parameter[2].max == "1" assert inst.parameter[2].min == 0 assert inst.parameter[2].name == "conceptMapVersion" assert inst.parameter[2].scope[0] == "type" assert inst.parameter[2].type == "string" assert inst.parameter[2].use == "in" assert inst.parameter[3].documentation == ( "The code that is to be translated. If a code is provided, a " "system must be provided" ) assert inst.parameter[3].max == "1" assert inst.parameter[3].min == 0 assert inst.parameter[3].name == "sourceCode" assert inst.parameter[3].type == "code" assert inst.parameter[3].use == "in" assert ( inst.parameter[4].documentation == "The system for the code that is to be translated" ) assert inst.parameter[4].max == "1" assert inst.parameter[4].min == 0 assert inst.parameter[4].name == "system" assert inst.parameter[4].type == "uri" assert inst.parameter[4].use == "in" assert inst.parameter[5].documentation == ( "The version of the system, if one was provided in the source" " data" ) assert inst.parameter[5].max == "1" assert inst.parameter[5].min == 0 assert inst.parameter[5].name == "version" assert inst.parameter[5].type == "string" assert inst.parameter[5].use == "in" assert inst.parameter[6].documentation == ( "Limits the scope of the $translate operation to source codes" " (ConceptMap.group.element.code) that are members of this " "value set." ) assert inst.parameter[6].max == "1" assert inst.parameter[6].min == 0 assert inst.parameter[6].name == "sourceScope" assert inst.parameter[6].type == "uri" assert inst.parameter[6].use == "in" assert inst.parameter[7].documentation == "A coding to translate" assert inst.parameter[7].max == "1" assert inst.parameter[7].min == 0 assert inst.parameter[7].name == "sourceCoding" assert inst.parameter[7].type == "Coding" assert inst.parameter[7].use == "in" assert inst.parameter[8].documentation == ( "A full codeableConcept to validate. The server can translate" " any of the coding values (e.g. existing translations) as it" " chooses" ) assert inst.parameter[8].max == "1" assert inst.parameter[8].min == 0 assert inst.parameter[8].name == "sourceCodeableConcept" assert inst.parameter[8].type == "CodeableConcept" assert inst.parameter[8].use == "in" assert inst.parameter[9].documentation == ( "The target code that is to be translated to. If a code is " "provided, a system must be provided" ) assert inst.parameter[9].max == "1" assert inst.parameter[9].min == 0 assert inst.parameter[9].name == "targetCode" assert inst.parameter[9].type == "uri" assert inst.parameter[9].use == "in" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "ConceptMap" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "extensions" assert inst.title == "Concept Translation" assert inst.type is True assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/OperationDefinition/ConceptMap-translate"} ).valueUri ) assert inst.version == "5.0.0" def test_operationdefinition_5(base_settings): """No. 5 tests collection for OperationDefinition. Test File: operation-conceptmap-translate.json """ filename = ( base_settings["unittest_data_dir"] / "operation-conceptmap-translate.json" ) inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_5(inst2) def impl_operationdefinition_6(inst): assert inst.affectsState is True assert inst.code == "add" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.description == ( "Add content to an array in a large resource such as List or " "Group. See [Operations for Large Resources](operations-for-" "large-resources.html)." ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[0].valueInteger == 0 assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert inst.id == "Resource-add" assert inst.instance is True assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert inst.kind == "operation" assert inst.name == "Add" assert inst.parameter[0].documentation == ( "Resource containing content to add. See [Operations for " "Large Resources](operations-for-large-resources.html)." ) assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 1 assert inst.parameter[0].name == "additions" assert inst.parameter[0].type == "Resource" assert inst.parameter[0].use == "in" assert inst.parameter[1].documentation == ( "Resource containing content added. See [Operations for Large" " Resources](operations-for-large-resources.html)." ) assert inst.parameter[1].max == "1" assert inst.parameter[1].min == 0 assert inst.parameter[1].name == "return" assert inst.parameter[1].type == "Resource" assert inst.parameter[1].use == "out" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "Resource" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "extensions" assert inst.title == "Add to an array in a large resource" assert inst.type is False assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/OperationDefinition/Resource-add"} ).valueUri ) assert inst.version == "5.0.0" def test_operationdefinition_6(base_settings): """No. 6 tests collection for OperationDefinition. Test File: operation-resource-add.json """ filename = base_settings["unittest_data_dir"] / "operation-resource-add.json" inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_6(inst2) def impl_operationdefinition_7(inst): assert inst.affectsState is False assert inst.code == "apply" assert inst.comment == ( "The result of this operation is a Specimen resource based on" " the definition of the specimen as described in the " "SpecimenDefinition resource and the supplied parameters." ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.description == ( "The apply operation applies a SpecimenDefinition in a given " "context to create a Specimen resource instance" ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[0].valueInteger == 1 assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert inst.id == "SpecimenDefinition-apply" assert inst.instance is True assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert inst.kind == "operation" assert inst.name == "Apply" assert inst.parameter[0].documentation == ( "The specimen definition to be applied. If the operation is " "invoked at the instance level, this parameter is not " "allowed; if the operation is invoked at the type level, this" " parameter is required" ) assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 0 assert inst.parameter[0].name == "specimenDefinition" assert inst.parameter[0].scope[0] == "type" assert inst.parameter[0].type == "SpecimenDefinition" assert inst.parameter[0].use == "in" assert inst.parameter[1].max == "*" assert inst.parameter[1].min == 1 assert inst.parameter[1].name == "subject" assert inst.parameter[1].searchType == "reference" assert inst.parameter[1].type == "string" assert inst.parameter[1].use == "in" assert inst.parameter[2].documentation == ( "The practitioner (or practitioner role) that is collecting " "the specimen" ) assert inst.parameter[2].max == "1" assert inst.parameter[2].min == 0 assert inst.parameter[2].name == "collector" assert inst.parameter[2].searchType == "reference" assert inst.parameter[2].type == "string" assert inst.parameter[2].use == "in" assert inst.parameter[3].documentation == ( "The type of user initiating the request, e.g. patient, " "healthcare provider, or specific type of healthcare provider" " (physician, nurse, etc.)" ) assert inst.parameter[3].max == "1" assert inst.parameter[3].min == 0 assert inst.parameter[3].name == "userType" assert inst.parameter[3].type == "CodeableConcept" assert inst.parameter[3].use == "in" assert ( inst.parameter[4].documentation == "Preferred language of the person using the system" ) assert inst.parameter[4].max == "1" assert inst.parameter[4].min == 0 assert inst.parameter[4].name == "userLanguage" assert inst.parameter[4].type == "CodeableConcept" assert inst.parameter[4].use == "in" assert inst.parameter[5].max == "1" assert inst.parameter[5].min == 0 assert inst.parameter[5].name == "userTaskContext" assert inst.parameter[5].type == "CodeableConcept" assert inst.parameter[5].use == "in" assert inst.parameter[6].documentation == ( "The current setting of the request (inpatient, outpatient, " "etc.)" ) assert inst.parameter[6].max == "1" assert inst.parameter[6].min == 0 assert inst.parameter[6].name == "setting" assert inst.parameter[6].type == "CodeableConcept" assert inst.parameter[6].use == "in" assert ( inst.parameter[7].documentation == "Additional detail about the setting of the request, if any" ) assert inst.parameter[7].max == "1" assert inst.parameter[7].min == 0 assert inst.parameter[7].name == "settingContext" assert inst.parameter[7].type == "CodeableConcept" assert inst.parameter[7].use == "in" assert inst.parameter[8].documentation == ( "The Specimen resource that is the result of applying the " "specimen definition" ) assert inst.parameter[8].max == "1" assert inst.parameter[8].min == 1 assert inst.parameter[8].name == "return" assert inst.parameter[8].type == "Specimen" assert inst.parameter[8].use == "out" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "SpecimenDefinition" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "extensions" assert inst.title == "Apply" assert inst.type is True assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/OperationDefinition/SpecimenDefinition-apply" } ).valueUri ) assert inst.version == "5.0.0" def test_operationdefinition_7(base_settings): """No. 7 tests collection for OperationDefinition. Test File: operation-specimendefinition-apply.json """ filename = ( base_settings["unittest_data_dir"] / "operation-specimendefinition-apply.json" ) inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_7(inst2) def impl_operationdefinition_8(inst): assert inst.affectsState is False assert inst.code == "expand" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[0].valueInteger == 5 assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "normative" assert inst.id == "ValueSet-expand" assert inst.instance is True assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert inst.kind == "operation" assert inst.name == "Expand" assert inst.parameter[0].documentation == ( "A canonical reference to a value set. The server must know " "the value set (e.g. it is defined explicitly in the server's" " value sets, or it is defined implicitly by some code system" " known to the server" ) assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 0 assert inst.parameter[0].name == "url" assert inst.parameter[0].scope[0] == "type" assert inst.parameter[0].type == "uri" assert inst.parameter[0].use == "in" assert inst.parameter[1].documentation == ( "The value set is provided directly as part of the request. " "Servers may choose not to accept value sets in this fashion" ) assert inst.parameter[1].max == "1" assert inst.parameter[1].min == 0 assert inst.parameter[1].name == "valueSet" assert inst.parameter[1].scope[0] == "type" assert inst.parameter[1].type == "ValueSet" assert inst.parameter[1].use == "in" assert inst.parameter[2].max == "1" assert inst.parameter[2].min == 0 assert inst.parameter[2].name == "valueSetVersion" assert inst.parameter[2].scope[0] == "type" assert inst.parameter[2].type == "string" assert inst.parameter[2].use == "in" assert inst.parameter[3].max == "1" assert inst.parameter[3].min == 0 assert inst.parameter[3].name == "context" assert inst.parameter[3].type == "uri" assert inst.parameter[3].use == "in" assert inst.parameter[4].max == "1" assert inst.parameter[4].min == 0 assert inst.parameter[4].name == "contextDirection" assert inst.parameter[4].type == "code" assert inst.parameter[4].use == "in" assert inst.parameter[5].max == "1" assert inst.parameter[5].min == 0 assert inst.parameter[5].name == "filter" assert inst.parameter[5].type == "string" assert inst.parameter[5].use == "in" assert inst.parameter[6].max == "1" assert inst.parameter[6].min == 0 assert inst.parameter[6].name == "date" assert inst.parameter[6].type == "dateTime" assert inst.parameter[6].use == "in" assert inst.parameter[7].documentation == ( "Paging support - where to start if a subset is desired " "(default = 0). Offset is number of records (not number of " "pages)" ) assert inst.parameter[7].max == "1" assert inst.parameter[7].min == 0 assert inst.parameter[7].name == "offset" assert inst.parameter[7].type == "integer" assert inst.parameter[7].use == "in" assert inst.parameter[8].max == "1" assert inst.parameter[8].min == 0 assert inst.parameter[8].name == "count" assert inst.parameter[8].type == "integer" assert inst.parameter[8].use == "in" assert inst.parameter[9].documentation == ( "Controls whether concept designations are to be included or " "excluded in value set expansions" ) assert inst.parameter[9].max == "1" assert inst.parameter[9].min == 0 assert inst.parameter[9].name == "includeDesignations" assert inst.parameter[9].type == "boolean" assert inst.parameter[9].use == "in" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "ValueSet" assert inst.status == "active" assert inst.system is False assert inst.text.status == "extensions" assert inst.title == "Value Set Expansion" assert inst.type is True assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/OperationDefinition/ValueSet-expand"} ).valueUri ) assert inst.version == "5.0.0" def test_operationdefinition_8(base_settings): """No. 8 tests collection for OperationDefinition. Test File: operation-valueset-expand.json """ filename = base_settings["unittest_data_dir"] / "operation-valueset-expand.json" inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_8(inst2) def impl_operationdefinition_9(inst): assert inst.affectsState is True assert inst.code == "meta-add" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.description == ( "This operation takes a meta, and adds the profiles, tags, " "and security labels found in it to the nominated resource" ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[0].valueInteger == 3 assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert inst.id == "Resource-meta-add" assert inst.instance is True assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert inst.kind == "operation" assert inst.name == "MetaAdd" assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 1 assert inst.parameter[0].name == "meta" assert inst.parameter[0].type == "Meta" assert inst.parameter[0].use == "in" assert inst.parameter[1].documentation == "Resulting meta for the resource" assert inst.parameter[1].max == "1" assert inst.parameter[1].min == 1 assert inst.parameter[1].name == "return" assert inst.parameter[1].type == "Meta" assert inst.parameter[1].use == "out" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "Resource" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "extensions" assert inst.title == "Add profiles, tags, and security labels to a resource" assert inst.type is False assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/OperationDefinition/Resource-meta-add"} ).valueUri ) assert inst.version == "5.0.0" def test_operationdefinition_9(base_settings): """No. 9 tests collection for OperationDefinition. Test File: operation-resource-meta-add.json """ filename = base_settings["unittest_data_dir"] / "operation-resource-meta-add.json" inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_9(inst2) def impl_operationdefinition_10(inst): assert inst.affectsState is False assert inst.code == "everything" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[0].valueInteger == 2 assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert inst.id == "Encounter-everything" assert inst.instance is True assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert inst.kind == "operation" assert inst.name == "Everything" assert inst.parameter[0].max == "1" assert inst.parameter[0].min == 0 assert inst.parameter[0].name == "_since" assert inst.parameter[0].type == "instant" assert inst.parameter[0].use == "in" assert inst.parameter[1].documentation == ( "One or more parameters, each containing one or more comma-" "delimited FHIR resource types to include in the return " "resources. In the absense of any specified types, the server" " returns all resource types" ) assert inst.parameter[1].max == "*" assert inst.parameter[1].min == 0 assert inst.parameter[1].name == "_type" assert inst.parameter[1].type == "code" assert inst.parameter[1].use == "in" assert inst.parameter[2].documentation == ( "See discussion below on the utility of paging through the " "results of the $everything operation" ) assert inst.parameter[2].max == "1" assert inst.parameter[2].min == 0 assert inst.parameter[2].name == "_count" assert inst.parameter[2].type == "integer" assert inst.parameter[2].use == "in" assert inst.parameter[3].documentation == 'The bundle type is "searchset"' assert inst.parameter[3].max == "1" assert inst.parameter[3].min == 1 assert inst.parameter[3].name == "return" assert inst.parameter[3].type == "Bundle" assert inst.parameter[3].use == "out" assert inst.publisher == "HL7 (FHIR Project)" assert inst.resource[0] == "Encounter" assert inst.status == "draft" assert inst.system is False assert inst.text.status == "extensions" assert inst.title == "Fetch Encounter Record" assert inst.type is False assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/OperationDefinition/Encounter-everything"} ).valueUri ) assert inst.version == "5.0.0" def test_operationdefinition_10(base_settings): """No. 10 tests collection for OperationDefinition. Test File: operation-encounter-everything.json """ filename = ( base_settings["unittest_data_dir"] / "operation-encounter-everything.json" ) inst = operationdefinition.OperationDefinition.model_validate_json( filename.read_bytes() ) assert "OperationDefinition" == inst.get_resource_type() impl_operationdefinition_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationDefinition" == data["resourceType"] inst2 = operationdefinition.OperationDefinition(**data) impl_operationdefinition_10(inst2) ================================================ FILE: fhir/resources/tests/test_operationoutcome.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/OperationOutcome Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import operationoutcome from .conftest import ExternalValidatorModel def impl_operationoutcome_1(inst): assert inst.id == "validationfail" assert inst.issue[0].code == "structure" assert ( inst.issue[0].details.text == 'Error parsing resource XML (Unknown Content "label"' ) assert inst.issue[0].expression[0] == "Patient.identifier" assert inst.issue[0].location[0] == "/f:Patient/f:identifier" assert inst.issue[0].severity == "error" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_operationoutcome_1(base_settings): """No. 1 tests collection for OperationOutcome. Test File: operationoutcome-example-validationfail.json """ filename = ( base_settings["unittest_data_dir"] / "operationoutcome-example-validationfail.json" ) inst = operationoutcome.OperationOutcome.model_validate_json(filename.read_bytes()) assert "OperationOutcome" == inst.get_resource_type() impl_operationoutcome_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationOutcome" == data["resourceType"] inst2 = operationoutcome.OperationOutcome(**data) impl_operationoutcome_1(inst2) def impl_operationoutcome_2(inst): assert inst.id == "break-the-glass" assert inst.issue[0].code == "suppressed" assert inst.issue[0].details.coding[0].code == "BTG" assert inst.issue[0].details.coding[0].display == "Break the glass" assert ( inst.issue[0].details.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.issue[0].details.text == ( "Additional information may be available using the Break-The-" "Glass Protocol" ) assert inst.issue[0].severity == "information" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_operationoutcome_2(base_settings): """No. 2 tests collection for OperationOutcome. Test File: operationoutcome-example-break-the-glass.json """ filename = ( base_settings["unittest_data_dir"] / "operationoutcome-example-break-the-glass.json" ) inst = operationoutcome.OperationOutcome.model_validate_json(filename.read_bytes()) assert "OperationOutcome" == inst.get_resource_type() impl_operationoutcome_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationOutcome" == data["resourceType"] inst2 = operationoutcome.OperationOutcome(**data) impl_operationoutcome_2(inst2) def impl_operationoutcome_3(inst): assert inst.id == "searchfail" assert inst.issue[0].code == "code-invalid" assert inst.issue[0].details.text == ( 'The "name" parameter has the modifier "exact" which is ' "not supported by this server" ) assert inst.issue[0].location[0] == "http.name:exact" assert inst.issue[0].severity == "fatal" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_operationoutcome_3(base_settings): """No. 3 tests collection for OperationOutcome. Test File: operationoutcome-example-searchfail.json """ filename = ( base_settings["unittest_data_dir"] / "operationoutcome-example-searchfail.json" ) inst = operationoutcome.OperationOutcome.model_validate_json(filename.read_bytes()) assert "OperationOutcome" == inst.get_resource_type() impl_operationoutcome_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationOutcome" == data["resourceType"] inst2 = operationoutcome.OperationOutcome(**data) impl_operationoutcome_3(inst2) def impl_operationoutcome_4(inst): assert inst.id == "exception" assert inst.issue[0].code == "exception" assert inst.issue[0].details.text == "SQL Link Communication Error (dbx = 34234)" assert inst.issue[0].severity == "error" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_operationoutcome_4(base_settings): """No. 4 tests collection for OperationOutcome. Test File: operationoutcome-example-exception.json """ filename = ( base_settings["unittest_data_dir"] / "operationoutcome-example-exception.json" ) inst = operationoutcome.OperationOutcome.model_validate_json(filename.read_bytes()) assert "OperationOutcome" == inst.get_resource_type() impl_operationoutcome_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationOutcome" == data["resourceType"] inst2 = operationoutcome.OperationOutcome(**data) impl_operationoutcome_4(inst2) def impl_operationoutcome_5(inst): assert inst.id == "101" assert inst.issue[0].code == "code-invalid" assert ( inst.issue[0].details.text == 'The code "W" is not known and not legal in this context' ) assert ( inst.issue[0].diagnostics == "Acme.Interop.FHIRProcessors.Patient.processGender line 2453" ) assert inst.issue[0].expression[0] == "Patient.gender" assert inst.issue[0].location[0] == "/f:Patient/f:gender" assert inst.issue[0].severity == "error" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_operationoutcome_5(base_settings): """No. 5 tests collection for OperationOutcome. Test File: operationoutcome-example.json """ filename = base_settings["unittest_data_dir"] / "operationoutcome-example.json" inst = operationoutcome.OperationOutcome.model_validate_json(filename.read_bytes()) assert "OperationOutcome" == inst.get_resource_type() impl_operationoutcome_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationOutcome" == data["resourceType"] inst2 = operationoutcome.OperationOutcome(**data) impl_operationoutcome_5(inst2) def impl_operationoutcome_6(inst): assert inst.id == "allok" assert inst.issue[0].code == "informational" assert inst.issue[0].details.text == "All OK" assert inst.issue[0].severity == "information" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_operationoutcome_6(base_settings): """No. 6 tests collection for OperationOutcome. Test File: operationoutcome-example-allok.json """ filename = ( base_settings["unittest_data_dir"] / "operationoutcome-example-allok.json" ) inst = operationoutcome.OperationOutcome.model_validate_json(filename.read_bytes()) assert "OperationOutcome" == inst.get_resource_type() impl_operationoutcome_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OperationOutcome" == data["resourceType"] inst2 = operationoutcome.OperationOutcome(**data) impl_operationoutcome_6(inst2) ================================================ FILE: fhir/resources/tests/test_organization.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Organization Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import organization from .conftest import ExternalValidatorModel def impl_organization_1(inst): assert inst.alias[0] == "HL7 International" assert inst.contact[0].address.city == "Ann Arbor" assert inst.contact[0].address.country == "USA" assert inst.contact[0].address.line[0] == "3300 Washtenaw Avenue, Suite 227" assert inst.contact[0].address.postalCode == "48104" assert inst.contact[0].address.state == "MI" assert ( inst.contact[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/extended-contact-availability" } ).valueUri ) assert ( inst.contact[0].extension[0].valueAvailability.availableTime[0].availableEndTime == ExternalValidatorModel.model_validate({"valueTime": "07:00:00"}).valueTime ) assert ( inst.contact[0] .extension[0] .valueAvailability.availableTime[0] .availableStartTime == ExternalValidatorModel.model_validate({"valueTime": "09:00:00"}).valueTime ) assert ( inst.contact[0].extension[0].valueAvailability.availableTime[0].daysOfWeek[0] == "mon" ) assert ( inst.contact[0].extension[0].valueAvailability.availableTime[0].daysOfWeek[1] == "tue" ) assert ( inst.contact[0].extension[0].valueAvailability.availableTime[0].daysOfWeek[2] == "wed" ) assert ( inst.contact[0].extension[0].valueAvailability.availableTime[0].daysOfWeek[3] == "thu" ) assert ( inst.contact[0].extension[0].valueAvailability.availableTime[0].daysOfWeek[4] == "fri" ) assert ( inst.contact[0].extension[0].valueAvailability.notAvailableTime[0].description == "Public holidays" ) assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].value == "(+1) 734-677-7777" assert inst.contact[0].telecom[1].system == "fax" assert inst.contact[0].telecom[1].value == "(+1) 734-677-6622" assert inst.contact[0].telecom[2].system == "email" assert inst.contact[0].telecom[2].value == "hq@HL7.org" assert inst.endpoint[0].reference == "Endpoint/example" assert inst.id == "hl7" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Health Level Seven International" assert inst.text.status == "generated" def test_organization_1(base_settings): """No. 1 tests collection for Organization. Test File: organization-example.json """ filename = base_settings["unittest_data_dir"] / "organization-example.json" inst = organization.Organization.model_validate_json(filename.read_bytes()) assert "Organization" == inst.get_resource_type() impl_organization_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Organization" == data["resourceType"] inst2 = organization.Organization(**data) impl_organization_1(inst2) def impl_organization_2(inst): assert inst.active is True assert inst.contact[0].address.country == "Swizterland" assert inst.id == "mmanu" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Acme Corporation" assert inst.text.status == "generated" def test_organization_2(base_settings): """No. 2 tests collection for Organization. Test File: organization-example-mmanu.json """ filename = base_settings["unittest_data_dir"] / "organization-example-mmanu.json" inst = organization.Organization.model_validate_json(filename.read_bytes()) assert "Organization" == inst.get_resource_type() impl_organization_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Organization" == data["resourceType"] inst2 = organization.Organization(**data) impl_organization_2(inst2) def impl_organization_3(inst): assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].use == "mobile" assert inst.contact[0].telecom[0].value == "+1 555 234 3523" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].use == "work" assert inst.contact[0].telecom[1].value == "gastro@acme.org" assert inst.id == "1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.acme.org.au/units"} ).valueUri ) assert inst.identifier[0].value == "Gastro" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Gastroenterology" assert inst.text.status == "generated" def test_organization_3(base_settings): """No. 3 tests collection for Organization. Test File: organization-example-gastro.json """ filename = base_settings["unittest_data_dir"] / "organization-example-gastro.json" inst = organization.Organization.model_validate_json(filename.read_bytes()) assert "Organization" == inst.get_resource_type() impl_organization_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Organization" == data["resourceType"] inst2 = organization.Organization(**data) impl_organization_3(inst2) def impl_organization_4(inst): assert inst.alias[0] == "Michigan State Department of Health" assert inst.id == "3" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://michigan.gov/state-dept-ids"} ).valueUri ) assert inst.identifier[0].value == "25" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Michigan Health" assert inst.text.status == "generated" def test_organization_4(base_settings): """No. 4 tests collection for Organization. Test File: organization-example-mihealth.json """ filename = base_settings["unittest_data_dir"] / "organization-example-mihealth.json" inst = organization.Organization.model_validate_json(filename.read_bytes()) assert "Organization" == inst.get_resource_type() impl_organization_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Organization" == data["resourceType"] inst2 = organization.Organization(**data) impl_organization_4(inst2) def impl_organization_5(inst): assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "+1 555 234 1234" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].use == "work" assert inst.contact[0].telecom[1].value == "contact@labs.acme.org" assert inst.id == "1832473e-2fe0-452d-abe9-3cdb9879522f" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.acme.org.au/units"} ).valueUri ) assert inst.identifier[0].value == "ClinLab" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Clinical Lab" assert inst.text.status == "generated" def test_organization_5(base_settings): """No. 5 tests collection for Organization. Test File: organization-example-lab.json """ filename = base_settings["unittest_data_dir"] / "organization-example-lab.json" inst = organization.Organization.model_validate_json(filename.read_bytes()) assert "Organization" == inst.get_resource_type() impl_organization_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Organization" == data["resourceType"] inst2 = organization.Organization(**data) impl_organization_5(inst2) def impl_organization_6(inst): assert inst.active is True assert inst.contact[0].address.line[0] == "South Wing, floor 2" assert inst.contact[0].name[0].text == "mevr. D. de Haan" assert inst.contact[0].purpose.coding[0].code == "ADMIN" assert ( inst.contact[0].purpose.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/contactentity-type"} ).valueUri ) assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].value == "022-655 2321" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "cardio@burgersumc.nl" assert inst.contact[0].telecom[2].system == "fax" assert inst.contact[0].telecom[2].value == "022-655 2322" assert inst.id == "f002" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Burgers UMC Cardiology unit" assert inst.partOf.reference == "Organization/f001" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "dept" assert inst.type[0].coding[0].display == "Hospital Department" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/organization-type"} ).valueUri ) def test_organization_6(base_settings): """No. 6 tests collection for Organization. Test File: organization-example-f002-burgers-card.json """ filename = ( base_settings["unittest_data_dir"] / "organization-example-f002-burgers-card.json" ) inst = organization.Organization.model_validate_json(filename.read_bytes()) assert "Organization" == inst.get_resource_type() impl_organization_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Organization" == data["resourceType"] inst2 = organization.Organization(**data) impl_organization_6(inst2) def impl_organization_7(inst): assert inst.active is True assert inst.contact[0].address.city == "Den Helder" assert inst.contact[0].address.country == "NLD" assert inst.contact[0].address.line[0] == "Walvisbaai 3" assert inst.contact[0].address.postalCode == "2333ZA" assert inst.contact[0].address.use == "work" assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "+31715269111" assert inst.contact[1].address.city == "Den helder" assert inst.contact[1].address.country == "NLD" assert inst.contact[1].address.line[0] == "Walvisbaai 3" assert inst.contact[1].address.line[1] == "Gebouw 2" assert inst.contact[1].address.postalCode == "2333ZA" assert inst.contact[1].name[0].family == "Brand" assert inst.contact[1].name[0].given[0] == "Ronald" assert inst.contact[1].name[0].prefix[0] == "Prof.Dr." assert inst.contact[1].name[0].text == "Professor Brand" assert inst.contact[1].name[0].use == "official" assert inst.contact[1].telecom[0].system == "phone" assert inst.contact[1].telecom[0].use == "work" assert inst.contact[1].telecom[0].value == "+31715269702" assert inst.id == "f201" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.zorgkaartnederland.nl/"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "Artis University Medical Center" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Artis University Medical Center (AUMC)" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "405608006" assert inst.type[0].coding[0].display == "Academic Medical Center" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.type[0].coding[1].code == "V6" assert inst.type[0].coding[1].display == "University Medical Hospital" assert ( inst.type[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.2.4.15.1060"} ).valueUri ) assert inst.type[0].coding[2].code == "prov" assert inst.type[0].coding[2].display == "Healthcare Provider" assert ( inst.type[0].coding[2].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/organization-type"} ).valueUri ) def test_organization_7(base_settings): """No. 7 tests collection for Organization. Test File: organization-example-f201-aumc.json """ filename = ( base_settings["unittest_data_dir"] / "organization-example-f201-aumc.json" ) inst = organization.Organization.model_validate_json(filename.read_bytes()) assert "Organization" == inst.get_resource_type() impl_organization_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Organization" == data["resourceType"] inst2 = organization.Organization(**data) impl_organization_7(inst2) def impl_organization_8(inst): assert inst.id == "2.16.840.1.113883.19.5" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.19.5" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Good Health Clinic" assert inst.text.status == "generated" def test_organization_8(base_settings): """No. 8 tests collection for Organization. Test File: organization-example-good-health-care.json """ filename = ( base_settings["unittest_data_dir"] / "organization-example-good-health-care.json" ) inst = organization.Organization.model_validate_json(filename.read_bytes()) assert "Organization" == inst.get_resource_type() impl_organization_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Organization" == data["resourceType"] inst2 = organization.Organization(**data) impl_organization_8(inst2) def impl_organization_9(inst): assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "022-655 2300" assert inst.contact[1].address.city == "Den Burg" assert inst.contact[1].address.country == "NLD" assert inst.contact[1].address.line[0] == "Galapagosweg 91" assert inst.contact[1].address.postalCode == "9105 PZ" assert inst.contact[1].address.use == "work" assert inst.contact[2].address.city == "Den Burg" assert inst.contact[2].address.country == "NLD" assert inst.contact[2].address.line[0] == "PO Box 2311" assert inst.contact[2].address.postalCode == "9100 AA" assert inst.contact[2].address.use == "work" assert inst.contact[3].purpose.coding[0].code == "PRESS" assert ( inst.contact[3].purpose.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/contactentity-type"} ).valueUri ) assert inst.contact[3].telecom[0].system == "phone" assert inst.contact[3].telecom[0].value == "022-655 2334" assert inst.contact[4].purpose.coding[0].code == "PATINF" assert ( inst.contact[4].purpose.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/contactentity-type"} ).valueUri ) assert inst.contact[4].telecom[0].system == "phone" assert inst.contact[4].telecom[0].value == "022-655 2335" assert inst.id == "f001" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.528.1"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "91654" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.2.4.6.1"} ).valueUri ) assert inst.identifier[1].use == "usual" assert inst.identifier[1].value == "17-0112278" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Burgers University Medical Center" assert inst.text.status == "generated" assert inst.type[0].coding[0].code == "V6" assert inst.type[0].coding[0].display == "University Medical Hospital" assert ( inst.type[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.2.4.15.1060"} ).valueUri ) assert inst.type[0].coding[1].code == "prov" assert inst.type[0].coding[1].display == "Healthcare Provider" assert ( inst.type[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/organization-type"} ).valueUri ) def test_organization_9(base_settings): """No. 9 tests collection for Organization. Test File: organization-example-f001-burgers.json """ filename = ( base_settings["unittest_data_dir"] / "organization-example-f001-burgers.json" ) inst = organization.Organization.model_validate_json(filename.read_bytes()) assert "Organization" == inst.get_resource_type() impl_organization_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Organization" == data["resourceType"] inst2 = organization.Organization(**data) impl_organization_9(inst2) def impl_organization_10(inst): assert inst.alias[0] == "ABC Insurance" assert inst.id == "2" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.3.19.2.3"} ).valueUri ) assert inst.identifier[0].value == "666666" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "XYZ Insurance" assert inst.text.status == "generated" def test_organization_10(base_settings): """No. 10 tests collection for Organization. Test File: organization-example-insurer.json """ filename = base_settings["unittest_data_dir"] / "organization-example-insurer.json" inst = organization.Organization.model_validate_json(filename.read_bytes()) assert "Organization" == inst.get_resource_type() impl_organization_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Organization" == data["resourceType"] inst2 = organization.Organization(**data) impl_organization_10(inst2) ================================================ FILE: fhir/resources/tests/test_organizationaffiliation.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/OrganizationAffiliation Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import organizationaffiliation from .conftest import ExternalValidatorModel def impl_organizationaffiliation_1(inst): assert inst.active is True assert inst.code[0].coding[0].code == "provider" assert ( inst.code[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/organization-role"} ).valueUri ) assert inst.contact[0].telecom[0].system == "email" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "general.practice@example.org" assert inst.endpoint[0].reference == "Endpoint/example" assert inst.healthcareService[0].reference == "HealthcareService/example" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.acme.org/practitioners"} ).valueUri ) assert inst.identifier[0].value == "23" assert inst.location[0].display == "South Wing, second floor" assert inst.location[0].reference == "Location/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.network[0].display == "HL7 Payer Network" assert inst.network[0].reference == "Organization/hl7pay" assert inst.organization.reference == "Organization/hl7pay" assert inst.participatingOrganization.reference == "Organization/f001" assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-03-31"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-01-01"} ).valueDateTime ) assert inst.specialty[0].coding[0].code == "408443003" assert inst.specialty[0].coding[0].display == "General medical practice" assert ( inst.specialty[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.text.status == "generated" def test_organizationaffiliation_1(base_settings): """No. 1 tests collection for OrganizationAffiliation. Test File: organizationaffiliation-example.json """ filename = ( base_settings["unittest_data_dir"] / "organizationaffiliation-example.json" ) inst = organizationaffiliation.OrganizationAffiliation.model_validate_json( filename.read_bytes() ) assert "OrganizationAffiliation" == inst.get_resource_type() impl_organizationaffiliation_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OrganizationAffiliation" == data["resourceType"] inst2 = organizationaffiliation.OrganizationAffiliation(**data) impl_organizationaffiliation_1(inst2) def impl_organizationaffiliation_2(inst): assert inst.active is True assert inst.code[0].coding[0].code == "member" assert inst.code[0].coding[0].display == "Member" assert ( inst.code[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/organization-role"} ).valueUri ) assert inst.code[0].text == "Hospital member" assert inst.endpoint[0].display == "Founding Fathers Memorial Hospital HIE endpoint" assert inst.id == "orgrole2" assert inst.identifier[0].assigner.display == "Monument Health Information Exchange" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/www.monumentHIE.com"} ).valueUri ) assert inst.identifier[0].type.text == "member hospital" assert inst.identifier[0].use == "secondary" assert inst.identifier[0].value == "hosp32" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.organization.display == "Monument Health Information Exchange" assert ( inst.participatingOrganization.display == "Founding Fathers Memorial Hospital" ) assert inst.text.status == "generated" def test_organizationaffiliation_2(base_settings): """No. 2 tests collection for OrganizationAffiliation. Test File: orgrole-example-hie.json """ filename = base_settings["unittest_data_dir"] / "orgrole-example-hie.json" inst = organizationaffiliation.OrganizationAffiliation.model_validate_json( filename.read_bytes() ) assert "OrganizationAffiliation" == inst.get_resource_type() impl_organizationaffiliation_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OrganizationAffiliation" == data["resourceType"] inst2 = organizationaffiliation.OrganizationAffiliation(**data) impl_organizationaffiliation_2(inst2) def impl_organizationaffiliation_3(inst): assert inst.active is True assert inst.code[0].coding[0].code == "provider" assert inst.code[0].coding[0].display == "Provider" assert ( inst.code[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/organization-role"} ).valueUri ) assert inst.code[0].coding[0].userSelected is True assert inst.code[0].text == "Provider of rehabilitation services" assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "202-109-8765" assert inst.healthcareService[0].display == "Inpatient rehabilitation services" assert inst.healthcareService[1].display == "Outpatient rehabilitation services" assert inst.id == "orgrole1" assert inst.identifier[0].assigner.display == "Founding Fathers Memorial Hospital" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/www.foundingfathersmemorial.com"} ).valueUri ) assert inst.identifier[0].use == "secondary" assert inst.identifier[0].value == "service002" assert inst.location[0].display == "Founding Fathers Memorial Hospital" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.network[0].display == "Patriot Preferred Provider Network" assert inst.organization.display == "Founding Fathers Memorial Hospital" assert ( inst.participatingOrganization.display == "Independence Rehabilitation Services, Inc." ) assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-02-01"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-02-09"} ).valueDateTime ) assert inst.specialty[0].coding[0].code == "394602003" assert inst.specialty[0].coding[0].display == "Rehabilitation - specialty" assert ( inst.specialty[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.specialty[0].text == "Rehabilitation" assert inst.text.status == "generated" def test_organizationaffiliation_3(base_settings): """No. 3 tests collection for OrganizationAffiliation. Test File: orgrole-example-services.json """ filename = base_settings["unittest_data_dir"] / "orgrole-example-services.json" inst = organizationaffiliation.OrganizationAffiliation.model_validate_json( filename.read_bytes() ) assert "OrganizationAffiliation" == inst.get_resource_type() impl_organizationaffiliation_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "OrganizationAffiliation" == data["resourceType"] inst2 = organizationaffiliation.OrganizationAffiliation(**data) impl_organizationaffiliation_3(inst2) ================================================ FILE: fhir/resources/tests/test_packagedproductdefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/PackagedProductDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import packagedproductdefinition from .conftest import ExternalValidatorModel def impl_packagedproductdefinition_1(inst): assert ( inst.description == "ALU-PVC/PVDC BLISTERS. CARTONS OF 10 FILM-COATED TABLETS." ) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/pcid"} ).valueUri ) assert inst.identifier[0].value == "{PCID}" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.packaging.manufacturer[0].reference == "Organization/example" assert inst.packaging.material[0].coding[0].code == "Paperboard" assert ( inst.packaging.material[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/packageItemContainerMaterial"} ).valueUri ) assert float(inst.packaging.packaging[0].containedItem[0].amount.value) == float(10) assert ( inst.packaging.packaging[0].containedItem[0].item.reference.reference == "ManufacturedItemDefinition/tablet" ) assert ( inst.packaging.packaging[0].manufacturer[0].reference == "Organization/example" ) assert inst.packaging.packaging[0].material[0].coding[0].code == "PVC" assert ( inst.packaging.packaging[0].material[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/packageItemContainerMaterial"} ).valueUri ) assert inst.packaging.packaging[0].material[1].coding[0].code == "PVDC" assert ( inst.packaging.packaging[0].material[1].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/packageItemContainerMaterial"} ).valueUri ) assert inst.packaging.packaging[0].material[2].coding[0].code == "alu" assert ( inst.packaging.packaging[0].material[2].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/packageItemContainerMaterial"} ).valueUri ) assert inst.packaging.packaging[0].property[0].type.coding[0].code == "height" assert inst.packaging.packaging[0].property[0].valueQuantity.code == "mm" assert ( inst.packaging.packaging[0].property[0].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.packaging.packaging[0].property[0].valueQuantity.unit == "mm" assert float(inst.packaging.packaging[0].property[0].valueQuantity.value) == float( 45 ) assert inst.packaging.packaging[0].property[1].type.coding[0].code == "width" assert inst.packaging.packaging[0].property[1].valueQuantity.code == "mm" assert ( inst.packaging.packaging[0].property[1].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.packaging.packaging[0].property[1].valueQuantity.unit == "mm" assert float(inst.packaging.packaging[0].property[1].valueQuantity.value) == float( 35 ) assert inst.packaging.packaging[0].quantity == 1 assert inst.packaging.packaging[0].shelfLifeStorage[0].periodDuration.code == "a" assert ( inst.packaging.packaging[0].shelfLifeStorage[0].periodDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.packaging.packaging[0].shelfLifeStorage[0].periodDuration.unit == "year" assert float( inst.packaging.packaging[0].shelfLifeStorage[0].periodDuration.value ) == float(3) assert ( inst.packaging.packaging[0] .shelfLifeStorage[0] .specialPrecautionsForStorage[0] .coding[0] .code == "none" ) assert ( inst.packaging.packaging[0] .shelfLifeStorage[0] .specialPrecautionsForStorage[0] .coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/specialprecautionsforstorage"} ).valueUri ) assert ( inst.packaging.packaging[0].shelfLifeStorage[0].type.coding[0].code == "ShelfLifeofPackagedMedicinalProduct" ) assert ( inst.packaging.packaging[0].shelfLifeStorage[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/shelfLifeTypePlaceHolder"} ).valueUri ) assert inst.packaging.packaging[0].type.coding[0].code == "Blister" assert ( inst.packaging.packaging[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/packageitemcontainertype"} ).valueUri ) assert inst.packaging.property[0].type.coding[0].code == "height" assert inst.packaging.property[0].valueQuantity.code == "mm" assert ( inst.packaging.property[0].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.packaging.property[0].valueQuantity.unit == "mm" assert float(inst.packaging.property[0].valueQuantity.value) == float(50) assert inst.packaging.property[1].type.coding[0].code == "width" assert inst.packaging.property[1].valueQuantity.code == "mm" assert ( inst.packaging.property[1].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.packaging.property[1].valueQuantity.unit == "mm" assert float(inst.packaging.property[1].valueQuantity.value) == float(45) assert inst.packaging.property[2].type.coding[0].code == "depth" assert inst.packaging.property[2].valueQuantity.code == "mm" assert ( inst.packaging.property[2].valueQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.packaging.property[2].valueQuantity.unit == "mm" assert float(inst.packaging.property[2].valueQuantity.value) == float(23.5) assert inst.packaging.quantity == 1 assert inst.packaging.type.coding[0].code == "Carton" assert ( inst.packaging.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/packageitemcontainertype"} ).valueUri ) assert inst.text.status == "generated" def test_packagedproductdefinition_1(base_settings): """No. 1 tests collection for PackagedProductDefinition. Test File: packagedproductdefinition-example.json """ filename = ( base_settings["unittest_data_dir"] / "packagedproductdefinition-example.json" ) inst = packagedproductdefinition.PackagedProductDefinition.model_validate_json( filename.read_bytes() ) assert "PackagedProductDefinition" == inst.get_resource_type() impl_packagedproductdefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PackagedProductDefinition" == data["resourceType"] inst2 = packagedproductdefinition.PackagedProductDefinition(**data) impl_packagedproductdefinition_1(inst2) def impl_packagedproductdefinition_2(inst): assert inst.contained[0].id == "syringeDevice" assert inst.contained[1].id == "liquidItem" assert inst.id == "package-with-liquid-and-syringe" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.packageFor[0].reference == "MedicinalProductDefinition/ProductThatHasThisPackType" ) assert inst.packaging.containedItem[0].amount.code == "mL" assert ( inst.packaging.containedItem[0].amount.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.packaging.containedItem[0].amount.unit == "ml" assert float(inst.packaging.containedItem[0].amount.value) == float(20) assert inst.packaging.containedItem[0].item.reference.reference == "#liquidItem" assert inst.packaging.containedItem[1].item.reference.reference == "#syringeDevice" assert inst.text.status == "generated" def test_packagedproductdefinition_2(base_settings): """No. 2 tests collection for PackagedProductDefinition. Test File: packagedproductdefinition-example-co-packaged-liquid-and-syringe.json """ filename = ( base_settings["unittest_data_dir"] / "packagedproductdefinition-example-co-packaged-liquid-and-syringe.json" ) inst = packagedproductdefinition.PackagedProductDefinition.model_validate_json( filename.read_bytes() ) assert "PackagedProductDefinition" == inst.get_resource_type() impl_packagedproductdefinition_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PackagedProductDefinition" == data["resourceType"] inst2 = packagedproductdefinition.PackagedProductDefinition(**data) impl_packagedproductdefinition_2(inst2) ================================================ FILE: fhir/resources/tests/test_parameters.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Parameters Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import parameters from .conftest import ExternalValidatorModel def impl_parameters_1(inst): assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.parameter[0].name == "exact" assert inst.parameter[0].valueBoolean is True assert inst.parameter[1].name == "property" assert inst.parameter[1].part[0].name == "code" assert inst.parameter[1].part[0].valueCode == "focus" assert inst.parameter[1].part[1].name == "value" assert inst.parameter[1].part[1].valueCode == "top" assert inst.parameter[2].name == "patient" assert inst.parameter[2].resource.id == "example" def test_parameters_1(base_settings): """No. 1 tests collection for Parameters. Test File: parameters-example.json """ filename = base_settings["unittest_data_dir"] / "parameters-example.json" inst = parameters.Parameters.model_validate_json(filename.read_bytes()) assert "Parameters" == inst.get_resource_type() impl_parameters_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Parameters" == data["resourceType"] inst2 = parameters.Parameters(**data) impl_parameters_1(inst2) ================================================ FILE: fhir/resources/tests/test_patient.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Patient Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import patient from .conftest import ExternalValidatorModel def impl_patient_1(inst): assert inst.active is True assert inst.address[0].city == "Metropolis" assert inst.address[0].country == "USA" assert inst.address[0].line[0] == "100 Main St" assert inst.address[0].postalCode == "44130" assert inst.address[0].state == "Il" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1956-05-27"}).valueDate ) assert inst.gender == "male" assert inst.id == "xds" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.2.3.4.5"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "MR" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].use == "usual" assert inst.identifier[0].value == "89765a87b" assert inst.managingOrganization.reference == "Organization/2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Doe" assert inst.name[0].given[0] == "John" assert inst.text.status == "generated" def test_patient_1(base_settings): """No. 1 tests collection for Patient. Test File: patient-example-xds.json """ filename = base_settings["unittest_data_dir"] / "patient-example-xds.json" inst = patient.Patient.model_validate_json(filename.read_bytes()) assert "Patient" == inst.get_resource_type() impl_patient_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Patient" == data["resourceType"] inst2 = patient.Patient(**data) impl_patient_1(inst2) def impl_patient_2(inst): assert inst.active is True assert inst.address[0].city == "Amsterdam" assert inst.address[0].country == "NLD" assert inst.address[0].line[0] == "Van Egmondkade 23" assert inst.address[0].postalCode == "1024 RJ" assert inst.address[0].use == "home" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1944-11-17"}).valueDate ) assert inst.communication[0].language.coding[0].code == "nl" assert inst.communication[0].language.coding[0].display == "Dutch" assert ( inst.communication[0].language.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:47"} ).valueUri ) assert inst.communication[0].language.text == "Nederlands" assert inst.communication[0].preferred is True assert inst.contact[0].name.family == "Abels" assert inst.contact[0].name.given[0] == "Sarah" assert inst.contact[0].name.use == "usual" assert inst.contact[0].relationship[0].coding[0].code == "C" assert ( inst.contact[0].relationship[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0131"} ).valueUri ) assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].use == "mobile" assert inst.contact[0].telecom[0].value == "0690383372" assert inst.deceasedBoolean is False assert inst.gender == "male" assert inst.id == "f001" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.2.4.6.3"} ).valueUri ) assert inst.identifier[0].use == "usual" assert inst.identifier[0].value == "738472983" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.2.4.6.3"} ).valueUri ) assert inst.identifier[1].use == "usual" assert inst.managingOrganization.display == "Burgers University Medical Centre" assert inst.managingOrganization.reference == "Organization/f001" assert inst.maritalStatus.coding[0].code == "M" assert inst.maritalStatus.coding[0].display == "Married" assert ( inst.maritalStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus"} ).valueUri ) assert inst.maritalStatus.text == "Getrouwd" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.multipleBirthBoolean is True assert inst.name[0].family == "van de Heuvel" assert inst.name[0].given[0] == "Pieter" assert inst.name[0].suffix[0] == "MSc" assert inst.name[0].use == "usual" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "mobile" assert inst.telecom[0].value == "0648352638" assert inst.telecom[1].system == "email" assert inst.telecom[1].use == "home" assert inst.telecom[1].value == "p.heuvel@gmail.com" assert inst.text.status == "generated" def test_patient_2(base_settings): """No. 2 tests collection for Patient. Test File: patient-example-f001-pieter.json """ filename = base_settings["unittest_data_dir"] / "patient-example-f001-pieter.json" inst = patient.Patient.model_validate_json(filename.read_bytes()) assert "Patient" == inst.get_resource_type() impl_patient_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Patient" == data["resourceType"] inst2 = patient.Patient(**data) impl_patient_2(inst2) def impl_patient_3(inst): assert inst.active is True assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1982-08-02"}).valueDate ) assert inst.deceasedBoolean is True assert inst.gender == "female" assert inst.id == "pat4" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:0.1.2.3.4.5.6.7"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "MR" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].use == "usual" assert inst.identifier[0].value == "123458" assert inst.managingOrganization.display == "ACME Healthcare, Inc" assert inst.managingOrganization.reference == "Organization/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Notsowell" assert inst.name[0].given[0] == "Sandy" assert inst.name[0].use == "official" assert inst.text.status == "generated" def test_patient_3(base_settings): """No. 3 tests collection for Patient. Test File: patient-example-d.json """ filename = base_settings["unittest_data_dir"] / "patient-example-d.json" inst = patient.Patient.model_validate_json(filename.read_bytes()) assert "Patient" == inst.get_resource_type() impl_patient_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Patient" == data["resourceType"] inst2 = patient.Patient(**data) impl_patient_3(inst2) def impl_patient_4(inst): assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "2017-05-15"}).valueDate ) assert inst.contact[0].name.family == "Organa" assert inst.contact[0].name.given[0] == "Leia" assert inst.contact[0].name.use == "maiden" assert inst.contact[0].relationship[0].coding[0].code == "72705000" assert inst.contact[0].relationship[0].coding[0].display == "Mother" assert ( inst.contact[0].relationship[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.contact[0].relationship[0].coding[1].code == "N" assert ( inst.contact[0].relationship[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0131"} ).valueUri ) assert inst.contact[0].relationship[0].coding[2].code == "MTH" assert ( inst.contact[0].relationship[0].coding[2].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].use == "mobile" assert inst.contact[0].telecom[0].value == "+31201234567" assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName" } ).valueUri ) assert inst.extension[0].valueString == "Organa" assert inst.gender == "female" assert inst.id == "infant-twin-1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://coruscanthealth.org/main-hospital/patient-identifier"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "MR" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].value == "MRN7465737865" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://new-republic.gov/galactic-citizen-identifier"} ).valueUri ) assert inst.identifier[1].value == "7465737865" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.multipleBirthInteger == 1 assert inst.name[0].family == "Solo" assert inst.name[0].given[0] == "Jaina" assert inst.name[0].use == "official" assert inst.text.status == "generated" def test_patient_4(base_settings): """No. 4 tests collection for Patient. Test File: patient-example-infant-twin-1.json """ filename = base_settings["unittest_data_dir"] / "patient-example-infant-twin-1.json" inst = patient.Patient.model_validate_json(filename.read_bytes()) assert "Patient" == inst.get_resource_type() impl_patient_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Patient" == data["resourceType"] inst2 = patient.Patient(**data) impl_patient_4(inst2) def impl_patient_5(inst): assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1995-10-12"}).valueDate ) assert inst.gender == "female" assert inst.generalPractitioner[0].display == "Luigi Maas" assert inst.generalPractitioner[0].reference == "Practitioner/f202" assert inst.id == "infant-mom" assert inst.maritalStatus.coding[0].code == "M" assert inst.maritalStatus.coding[0].display == "Married" assert ( inst.maritalStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus"} ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Solo" assert inst.name[0].given[0] == "Leia" assert inst.name[0].use == "official" assert inst.name[1].family == "Organa" assert inst.name[1].given[0] == "Leia" assert inst.name[1].use == "maiden" assert inst.text.status == "generated" def test_patient_5(base_settings): """No. 5 tests collection for Patient. Test File: patient-example-infant-mom.json """ filename = base_settings["unittest_data_dir"] / "patient-example-infant-mom.json" inst = patient.Patient.model_validate_json(filename.read_bytes()) assert "Patient" == inst.get_resource_type() impl_patient_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Patient" == data["resourceType"] inst2 = patient.Patient(**data) impl_patient_5(inst2) def impl_patient_6(inst): assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "2017-09-05"}).valueDate ) assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName" } ).valueUri ) assert inst.extension[0].valueString == "Everywoman" assert inst.gender == "male" assert inst.id == "newborn" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.multipleBirthInteger == 2 assert inst.text.status == "generated" def test_patient_6(base_settings): """No. 6 tests collection for Patient. Test File: patient-example-newborn.json """ filename = base_settings["unittest_data_dir"] / "patient-example-newborn.json" inst = patient.Patient.model_validate_json(filename.read_bytes()) assert "Patient" == inst.get_resource_type() impl_patient_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Patient" == data["resourceType"] inst2 = patient.Patient(**data) impl_patient_6(inst2) def impl_patient_7(inst): assert inst.contact[0].name.family == "Organa" assert inst.contact[0].name.given[0] == "Leia" assert inst.contact[0].name.use == "maiden" assert inst.contact[0].relationship[0].coding[0].code == "72705000" assert inst.contact[0].relationship[0].coding[0].display == "Mother" assert ( inst.contact[0].relationship[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.contact[0].relationship[0].coding[1].code == "N" assert ( inst.contact[0].relationship[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0131"} ).valueUri ) assert inst.contact[0].relationship[0].coding[2].code == "MTH" assert ( inst.contact[0].relationship[0].coding[2].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].use == "mobile" assert inst.contact[0].telecom[0].value == "+31201234567" assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName" } ).valueUri ) assert inst.extension[0].valueString == "Organa" assert inst.gender == "male" assert inst.id == "infant-fetal" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://coruscanthealth.org/main-hospital/patient-identifier"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "MR" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].value == "MRN657865757378" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_patient_7(base_settings): """No. 7 tests collection for Patient. Test File: patient-example-infant-fetal.json """ filename = base_settings["unittest_data_dir"] / "patient-example-infant-fetal.json" inst = patient.Patient.model_validate_json(filename.read_bytes()) assert "Patient" == inst.get_resource_type() impl_patient_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Patient" == data["resourceType"] inst2 = patient.Patient(**data) impl_patient_7(inst2) def impl_patient_8(inst): assert inst.active is True assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "2021-01-01"}).valueDate ) assert inst.gender == "unknown" assert inst.id == "denovoChild" assert inst.identifier[0].assigner.display == "Child Hospital" assert ( inst.identifier[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01"} ).valueDateTime ) assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/persons"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "MR" assert inst.identifier[0].type.coding[0].display == "Medical record number" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].use == "temp" assert inst.identifier[0].value == "11111" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Doe" assert inst.name[0].given[0] == "Child" assert inst.name[0].given[1] == "Junior" assert inst.name[0].use == "official" assert inst.text.div == ( '

Child ' "Junior Doe (OFFICIAL) (no stated gender) 2021-01-01 ( " "Medical record number: 11111 (TEMP))

" ) assert inst.text.status == "generated" def test_patient_8(base_settings): """No. 8 tests collection for Patient. Test File: Patient-denovoChild.json """ filename = base_settings["unittest_data_dir"] / "Patient-denovoChild.json" inst = patient.Patient.model_validate_json(filename.read_bytes()) assert "Patient" == inst.get_resource_type() impl_patient_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Patient" == data["resourceType"] inst2 = patient.Patient(**data) impl_patient_8(inst2) def impl_patient_9(inst): assert inst.active is True assert inst.address[0].line[0] == "2222 Home Street" assert inst.address[0].use == "home" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1973-05-31"}).valueDate ) assert inst.gender == "female" assert inst.id == "genetics-example1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/us-ssn"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "SS" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].value == "444222222" assert inst.managingOrganization.reference == "Organization/hl7" assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2012-05-29T23:45:32Z"} ).valueInstant ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Everywoman" assert inst.name[0].given[0] == "Eve" assert inst.name[0].use == "official" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "555-555-2003" assert inst.text.status == "generated" def test_patient_9(base_settings): """No. 9 tests collection for Patient. Test File: patient-genetics-example1.json """ filename = base_settings["unittest_data_dir"] / "patient-genetics-example1.json" inst = patient.Patient.model_validate_json(filename.read_bytes()) assert "Patient" == inst.get_resource_type() impl_patient_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Patient" == data["resourceType"] inst2 = patient.Patient(**data) impl_patient_9(inst2) def impl_patient_10(inst): assert inst.active is True assert inst.gender == "other" assert inst.id == "pat2" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:0.1.2.3.4.5.6.7"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "MR" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].use == "usual" assert inst.identifier[0].value == "123456" assert inst.link[0].other.reference == "Patient/pat1" assert inst.link[0].type == "seealso" assert inst.managingOrganization.display == "ACME Healthcare, Inc" assert inst.managingOrganization.reference == "Organization/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Donald" assert inst.name[0].given[0] == "Duck" assert inst.name[0].given[1] == "D" assert inst.name[0].use == "official" assert inst.photo[0].contentType == "image/gif" assert inst.text.status == "generated" def test_patient_10(base_settings): """No. 10 tests collection for Patient. Test File: patient-example-b.json """ filename = base_settings["unittest_data_dir"] / "patient-example-b.json" inst = patient.Patient.model_validate_json(filename.read_bytes()) assert "Patient" == inst.get_resource_type() impl_patient_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Patient" == data["resourceType"] inst2 = patient.Patient(**data) impl_patient_10(inst2) ================================================ FILE: fhir/resources/tests/test_paymentnotice.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/PaymentNotice Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import paymentnotice from .conftest import ExternalValidatorModel def impl_paymentnotice_1(inst): assert inst.amount.currency == "USD" assert float(inst.amount.value) == float(12500.0) assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.id == "77654" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://benefitsinc.com/paymentnotice"} ).valueUri ) assert inst.identifier[0].value == "776543" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.payee.reference == "Organization/1" assert inst.payment.reference == "PaymentReconciliation/ER2500" assert ( inst.paymentDate == ExternalValidatorModel.model_validate({"valueDate": "2014-08-15"}).valueDate ) assert inst.paymentStatus.coding[0].code == "paid" assert ( inst.paymentStatus.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/paymentstatus"} ).valueUri ) assert ( inst.recipient.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://regulators.gov"} ).valueUri ) assert inst.recipient.identifier.value == "AB123" assert inst.reporter.reference == "Organization/1" assert inst.request.reference == "http://benefitsinc.com/fhir/claim/12345" assert ( inst.response.reference == "http://benefitsinc.com/fhir/claimresponse/CR12345" ) assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the PaymentNotice
" ) assert inst.text.status == "generated" def test_paymentnotice_1(base_settings): """No. 1 tests collection for PaymentNotice. Test File: paymentnotice-example.json """ filename = base_settings["unittest_data_dir"] / "paymentnotice-example.json" inst = paymentnotice.PaymentNotice.model_validate_json(filename.read_bytes()) assert "PaymentNotice" == inst.get_resource_type() impl_paymentnotice_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PaymentNotice" == data["resourceType"] inst2 = paymentnotice.PaymentNotice(**data) impl_paymentnotice_1(inst2) ================================================ FILE: fhir/resources/tests/test_paymentreconciliation.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/PaymentReconciliation Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import paymentreconciliation from .conftest import ExternalValidatorModel def impl_paymentreconciliation_1(inst): assert inst.allocation[0].amount.currency == "USD" assert float(inst.allocation[0].amount.value) == float(3500.0) assert ( inst.allocation[0].date == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert ( inst.allocation[0].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/payment/2018/detail"} ).valueUri ) assert inst.allocation[0].identifier.value == "10-12345-001" assert inst.allocation[0].payee.reference == "Organization/1" assert ( inst.allocation[0].response.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/claimresponse"} ).valueUri ) assert inst.allocation[0].response.identifier.value == "CR20140815-AB12345" assert inst.allocation[0].submitter.reference == "Organization/1" assert ( inst.allocation[0].target.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalleyclinic.com/claim"} ).valueUri ) assert inst.allocation[0].target.identifier.value == "AB12345" assert inst.allocation[0].type.coding[0].code == "payment" assert ( inst.allocation[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/payment-type"} ).valueUri ) assert inst.allocation[1].amount.currency == "USD" assert float(inst.allocation[1].amount.value) == float(4000.0) assert ( inst.allocation[1].date == ExternalValidatorModel.model_validate({"valueDate": "2014-08-12"}).valueDate ) assert ( inst.allocation[1].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/payment/2018/detail"} ).valueUri ) assert inst.allocation[1].identifier.value == "10-12345-002" assert ( inst.allocation[1].target.reference == "http://www.BenefitsInc.com/fhir/oralhealthclaim/225476332699" ) assert inst.allocation[1].type.coding[0].code == "payment" assert ( inst.allocation[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/payment-type"} ).valueUri ) assert inst.allocation[2].amount.currency == "USD" assert float(inst.allocation[2].amount.value) == float(-1500.0) assert ( inst.allocation[2].date == ExternalValidatorModel.model_validate({"valueDate": "2014-08-16"}).valueDate ) assert ( inst.allocation[2].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/payment/2018/detail"} ).valueUri ) assert inst.allocation[2].identifier.value == "10-12345-003" assert inst.allocation[2].type.coding[0].code == "advance" assert ( inst.allocation[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/payment-type"} ).valueUri ) assert inst.amount.currency == "USD" assert float(inst.amount.value) == float(7000.0) assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert ( inst.date == ExternalValidatorModel.model_validate({"valueDate": "2014-08-01"}).valueDate ) assert inst.disposition == "2014 August mid-month settlement." assert inst.formCode.coding[0].code == "PAYREC/2016/01B" assert ( inst.formCode.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ncforms.org/formid"} ).valueUri ) assert inst.id == "ER2500" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/fhir/enrollmentresponse"} ).valueUri ) assert inst.identifier[0].value == "781234" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.outcome == "complete" assert ( inst.paymentIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.BenefitsInc.com/payment/2018"} ).valueUri ) assert inst.paymentIdentifier.value == "10-12345" assert inst.paymentIssuer.reference == "Organization/2" assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-31"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.processNote[0].text == ( "Due to the year end holiday the cutoff for submissions for " "December will be the 28th." ) assert inst.processNote[0].type == "display" assert ( inst.request.reference == "http://www.BenefitsInc.com/fhir/eligibility/225476332402" ) assert inst.requestor.reference == "Organization/1" assert inst.status == "active" assert inst.text.div == ( '
A human-readable' " rendering of the PaymentReconciliation
" ) assert inst.text.status == "generated" assert inst.type.coding[0].code == "payment" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/payment-type"} ).valueUri ) def test_paymentreconciliation_1(base_settings): """No. 1 tests collection for PaymentReconciliation. Test File: paymentreconciliation-example.json """ filename = base_settings["unittest_data_dir"] / "paymentreconciliation-example.json" inst = paymentreconciliation.PaymentReconciliation.model_validate_json( filename.read_bytes() ) assert "PaymentReconciliation" == inst.get_resource_type() impl_paymentreconciliation_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PaymentReconciliation" == data["resourceType"] inst2 = paymentreconciliation.PaymentReconciliation(**data) impl_paymentreconciliation_1(inst2) ================================================ FILE: fhir/resources/tests/test_permission.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Permission Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import permission from .conftest import ExternalValidatorModel def impl_permission_1(inst): assert inst.combining == "deny-overrides" assert ( inst.date[0] == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-08-04"} ).valueDateTime ) assert inst.id == "example-vhdir" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.rule[0].activity[0].action[0].coding[0].code == "access" assert ( inst.rule[0].activity[0].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert inst.rule[0].activity[0].actor[0].reference == "CareTeam/example" assert inst.rule[0].activity[0].purpose[0].coding[0].code == "HOPERAT" assert ( inst.rule[0].activity[0].purpose[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.rule[0].data[0].security[0].code == "WSHELTER" assert ( inst.rule[0].data[0].security[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://example.org"} ).valueUri ) assert inst.rule[0].type == "permit" assert inst.status == "active" assert inst.text.status == "generated" def test_permission_1(base_settings): """No. 1 tests collection for Permission. Test File: permission-example-vhdir.json """ filename = base_settings["unittest_data_dir"] / "permission-example-vhdir.json" inst = permission.Permission.model_validate_json(filename.read_bytes()) assert "Permission" == inst.get_resource_type() impl_permission_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Permission" == data["resourceType"] inst2 = permission.Permission(**data) impl_permission_1(inst2) def impl_permission_2(inst): assert inst.combining == "deny-overrides" assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "active" assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" def test_permission_2(base_settings): """No. 2 tests collection for Permission. Test File: permission-example.json """ filename = base_settings["unittest_data_dir"] / "permission-example.json" inst = permission.Permission.model_validate_json(filename.read_bytes()) assert "Permission" == inst.get_resource_type() impl_permission_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Permission" == data["resourceType"] inst2 = permission.Permission(**data) impl_permission_2(inst2) def impl_permission_3(inst): assert inst.asserter.reference == "Organization/f203" assert inst.combining == "deny-overrides" assert ( inst.date[0] == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-12-24"} ).valueDateTime ) assert inst.id == "example-saner" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.rule[0].activity[0].action[0].coding[0].code == "access" assert ( inst.rule[0].activity[0].action[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/consentaction"} ).valueUri ) assert inst.rule[0].activity[0].actor[0].reference == "Organization/f203" assert inst.rule[0].activity[0].purpose[0].coding[0].code == "HCOMPL" assert ( inst.rule[0].activity[0].purpose[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.rule[0].data[0].expression.expression == ( "http://hl7.org/fhir/uv/saner/Measure/CDCHealthcareSupplyPath" "way" ) assert inst.rule[0].data[0].expression.language == "text/fhirpath" assert inst.rule[0].limit[0].coding[0].code == "AUDIT" assert ( inst.rule[0].limit[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"} ).valueUri ) assert inst.rule[0].type == "permit" assert inst.status == "active" assert inst.text.status == "generated" def test_permission_3(base_settings): """No. 3 tests collection for Permission. Test File: permission-example-saner.json """ filename = base_settings["unittest_data_dir"] / "permission-example-saner.json" inst = permission.Permission.model_validate_json(filename.read_bytes()) assert "Permission" == inst.get_resource_type() impl_permission_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Permission" == data["resourceType"] inst2 = permission.Permission(**data) impl_permission_3(inst2) ================================================ FILE: fhir/resources/tests/test_person.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Person Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import person from .conftest import ExternalValidatorModel def impl_person_1(inst): assert inst.active is True assert inst.address[0].city == "Sandusky" assert inst.address[0].country == "USA" assert inst.address[0].line[0] == "2086 College St" assert inst.address[0].postalCode == "44870" assert inst.address[0].state == "OH" assert inst.address[0].use == "home" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1974-03-07"}).valueDate ) assert inst.gender == "female" assert inst.id == "pp" assert inst.identifier[0].assigner.display == "Ohio Bureau of Motor Vehicles" assert ( inst.identifier[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2041-09-23"} ).valueDateTime ) assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.4.3.39"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "DL" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].type.text == "Ohio driver license" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "TL545786" assert inst.link[0].assurance == "level3" assert inst.link[0].target.display == "Eve Everywoman" assert inst.link[0].target.reference == "http://www.goodhealth.com/Patient/98574" assert inst.link[1].assurance == "level2" assert inst.link[1].target.display == "Eve Marie Everywoman" assert inst.link[1].target.reference == "http://www.acme-medical.com/Patient/ab34d" assert inst.managingOrganization.display == "Goodhealth Patient Portal" assert ( inst.managingOrganization.reference == "http://www.goodhealth.com/Organization/12" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Everywoman" assert inst.name[0].given[0] == "Eve" assert inst.name[0].given[1] == "Marie" assert inst.name[0].use == "official" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "home" assert inst.telecom[0].value == "(621)-479-9743" assert inst.text.status == "generated" def test_person_1(base_settings): """No. 1 tests collection for Person. Test File: person-patient-portal.json """ filename = base_settings["unittest_data_dir"] / "person-patient-portal.json" inst = person.Person.model_validate_json(filename.read_bytes()) assert "Person" == inst.get_resource_type() impl_person_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Person" == data["resourceType"] inst2 = person.Person(**data) impl_person_1(inst2) def impl_person_2(inst): assert inst.active is True assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1963"}).valueDate ) assert inst.gender == "female" assert inst.id == "f002" assert inst.link[0].target.display == "Ariadne Bor-Jansma" assert inst.link[0].target.reference == "RelatedPerson/f002" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].text == "Ariadne Bor-Jansma" assert inst.name[0].use == "usual" assert inst.photo[0].contentType == "image/jpeg" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "home" assert inst.telecom[0].value == "+31201234567" assert inst.text.status == "generated" def test_person_2(base_settings): """No. 2 tests collection for Person. Test File: person-example-f002-ariadne.json """ filename = base_settings["unittest_data_dir"] / "person-example-f002-ariadne.json" inst = person.Person.model_validate_json(filename.read_bytes()) assert "Person" == inst.get_resource_type() impl_person_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Person" == data["resourceType"] inst2 = person.Person(**data) impl_person_2(inst2) def impl_person_3(inst): assert inst.active is True assert inst.address[0].city == "Northfield" assert inst.address[0].line[0] == "1003 Healthcare Drive" assert inst.address[0].state == "MN" assert inst.address[0].use == "home" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1959-04-22"}).valueDate ) assert inst.gender == "male" assert inst.id == "pd" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/us-ssn"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "SS" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "444444444" assert inst.link[0].assurance == "level2" assert inst.link[0].target.display == "Dr. Harold Hippocrates" assert ( inst.link[0].target.reference == "http://www.goodhealth.com/Practitioner/98574" ) assert inst.link[1].assurance == "level2" assert inst.link[1].target.display == "Harold Hippocrates, MD" assert ( inst.link[1].target.reference == "http://www.acme-medical.com/Practitioner/ab34d" ) assert ( inst.managingOrganization.display == "Northfield Regional Physician Directory" ) assert ( inst.managingOrganization.reference == "http://www.northfield-regional.com/Organization/2" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Hippocrates" assert inst.name[0].given[0] == "Harold" assert inst.name[0].use == "official" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "555-555-1003" assert inst.text.status == "generated" def test_person_3(base_settings): """No. 3 tests collection for Person. Test File: person-provider-directory.json """ filename = base_settings["unittest_data_dir"] / "person-provider-directory.json" inst = person.Person.model_validate_json(filename.read_bytes()) assert "Person" == inst.get_resource_type() impl_person_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Person" == data["resourceType"] inst2 = person.Person(**data) impl_person_3(inst2) def impl_person_4(inst): assert inst.active is True assert inst.address[0].city == "PleasantVille" assert inst.address[0].line[0] == "534 Erewhon St" assert inst.address[0].postalCode == "3999" assert inst.address[0].state == "Vic" assert inst.address[0].use == "home" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1974-12-25"}).valueDate ) assert inst.gender == "male" assert inst.id == "example" assert inst.identifier[0].assigner.display == "Acme Healthcare" assert ( inst.identifier[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2001-05-06"} ).valueDateTime ) assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.2.36.146.595.217.0.1"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "MR" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].use == "usual" assert inst.identifier[0].value == "12345" assert inst.link[0].target.display == "Peter Chalmers" assert inst.link[0].target.reference == "RelatedPerson/peter" assert inst.link[1].target.display == "Peter Chalmers" assert inst.link[1].target.reference == "Patient/example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Chalmers" assert inst.name[0].given[0] == "Peter" assert inst.name[0].given[1] == "James" assert inst.name[0].use == "official" assert inst.name[1].given[0] == "Jim" assert inst.name[1].use == "usual" assert inst.telecom[0].use == "home" assert inst.telecom[1].system == "phone" assert inst.telecom[1].use == "work" assert inst.telecom[1].value == "(03) 5555 6473" assert inst.telecom[2].system == "email" assert inst.telecom[2].use == "home" assert inst.telecom[2].value == "Jim@example.org" assert inst.text.status == "generated" def test_person_4(base_settings): """No. 4 tests collection for Person. Test File: person-example.json """ filename = base_settings["unittest_data_dir"] / "person-example.json" inst = person.Person.model_validate_json(filename.read_bytes()) assert "Person" == inst.get_resource_type() impl_person_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Person" == data["resourceType"] inst2 = person.Person(**data) impl_person_4(inst2) def impl_person_5(inst): assert inst.active is True assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1982-08-02"}).valueDate ) assert ( inst.deceasedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-12-12"} ).valueDateTime ) assert inst.gender == "female" assert inst.id == "per4" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:0.1.2.3.4.5.6.7"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "MR" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].use == "usual" assert inst.identifier[0].value == "123458" assert inst.link[0].target.reference == "Patient/pat4" assert inst.link[1].target.reference == "Practitioner/prac4" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Notsowell" assert inst.name[0].given[0] == "Sandy" assert inst.name[0].use == "official" assert inst.text.status == "generated" def test_person_5(base_settings): """No. 5 tests collection for Person. Test File: person-example-per4.json """ filename = base_settings["unittest_data_dir"] / "person-example-per4.json" inst = person.Person.model_validate_json(filename.read_bytes()) assert "Person" == inst.get_resource_type() impl_person_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Person" == data["resourceType"] inst2 = person.Person(**data) impl_person_5(inst2) def impl_person_6(inst): assert inst.active is True assert inst.address[0].city == "PleasantVille" assert inst.address[0].line[0] == "534 Erewhon St" assert inst.address[0].postalCode == "3999" assert inst.address[0].state == "Vic" assert inst.address[0].use == "home" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1974-12-25"}).valueDate ) assert inst.gender == "male" assert inst.id == "grahame" assert inst.identifier[0].assigner.display == "Acme Healthcare" assert ( inst.identifier[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2001-05-06"} ).valueDateTime ) assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.2.36.146.595.217.0.1"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "MR" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].use == "usual" assert inst.identifier[0].value == "12345" assert inst.managingOrganization.reference == "Organization/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Chalmers" assert inst.name[0].given[0] == "Peter" assert inst.name[0].given[1] == "James" assert inst.name[0].use == "official" assert inst.name[1].given[0] == "Jim" assert inst.name[1].use == "usual" assert inst.telecom[0].use == "home" assert inst.telecom[1].system == "phone" assert inst.telecom[1].use == "work" assert inst.telecom[1].value == "(03) 5555 6473" assert inst.text.status == "generated" def test_person_6(base_settings): """No. 6 tests collection for Person. Test File: person-grahame.json """ filename = base_settings["unittest_data_dir"] / "person-grahame.json" inst = person.Person.model_validate_json(filename.read_bytes()) assert "Person" == inst.get_resource_type() impl_person_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Person" == data["resourceType"] inst2 = person.Person(**data) impl_person_6(inst2) ================================================ FILE: fhir/resources/tests/test_plandefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/PlanDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import plandefinition from .conftest import ExternalValidatorModel def impl_plandefinition_1(inst): assert ( inst.action[0].action[0].action[0].action[0].action[0].definitionCanonical == "#1111" ) assert ( inst.action[0] .action[0] .action[0] .action[0] .action[0] .extension[0] .extension[0] .url == ExternalValidatorModel.model_validate({"valueUri": "day"}).valueUri ) assert ( inst.action[0] .action[0] .action[0] .action[0] .action[0] .extension[0] .extension[0] .valueInteger == 1 ) assert ( inst.action[0] .action[0] .action[0] .action[0] .action[0] .extension[0] .extension[1] .url == ExternalValidatorModel.model_validate({"valueUri": "day"}).valueUri ) assert ( inst.action[0] .action[0] .action[0] .action[0] .action[0] .extension[0] .extension[1] .valueInteger == 8 ) assert ( inst.action[0].action[0].action[0].action[0].action[0].extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/timing-daysOfCycle"} ).valueUri ) assert inst.action[0].action[0].action[0].action[0].action[0].id == "action-1" assert ( inst.action[0].action[0].action[0].action[0].action[0].textEquivalent == "Gemcitabine 1250 mg/m² IV over 30 minutes on days 1 and 8" ) assert ( inst.action[0].action[0].action[0].action[0].action[1].definitionCanonical == "#2222" ) assert ( inst.action[0] .action[0] .action[0] .action[0] .action[1] .extension[0] .extension[0] .url == ExternalValidatorModel.model_validate({"valueUri": "day"}).valueUri ) assert ( inst.action[0] .action[0] .action[0] .action[0] .action[1] .extension[0] .extension[0] .valueInteger == 1 ) assert ( inst.action[0].action[0].action[0].action[0].action[1].extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/timing-daysOfCycle"} ).valueUri ) assert inst.action[0].action[0].action[0].action[0].action[1].id == "action-2" assert ( inst.action[0] .action[0] .action[0] .action[0] .action[1] .relatedAction[0] .relationship == "concurrent-with-start" ) assert ( inst.action[0].action[0].action[0].action[0].action[1].relatedAction[0].targetId == "action-1" ) assert ( inst.action[0].action[0].action[0].action[0].action[1].textEquivalent == "CARBOplatin AUC 5 IV over 30 minutes on Day 1" ) assert inst.action[0].action[0].action[0].action[0].id == "cycle-definition-1" assert ( inst.action[0].action[0].action[0].action[0].textEquivalent == "21-day cycle for 6 cycles" ) assert inst.action[0].action[0].action[0].action[0].timingTiming.repeat.count == 6 assert float( inst.action[0].action[0].action[0].action[0].timingTiming.repeat.duration ) == float(21) assert ( inst.action[0].action[0].action[0].action[0].timingTiming.repeat.durationUnit == "d" ) assert inst.action[0].action[0].action[0].groupingBehavior == "sentence-group" assert inst.action[0].action[0].action[0].selectionBehavior == "exactly-one" assert inst.action[0].action[0].selectionBehavior == "all" assert inst.action[0].selectionBehavior == "exactly-one" assert ( inst.approvalDate == ExternalValidatorModel.model_validate({"valueDate": "2016-07-27"}).valueDate ) assert inst.author[0].name == "Lee Surprenant" assert inst.contained[0].id == "1111" assert inst.contained[1].id == "2222" assert inst.copyright == "All rights reserved." assert inst.description == "Gemcitabine/CARBOplatin" assert inst.experimental is True assert inst.id == "KDN5" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/ordertemplates"} ).valueUri ) assert inst.identifier[0].value == "KDN5" assert ( inst.lastReviewDate == ExternalValidatorModel.model_validate({"valueDate": "2016-07-27"}).valueDate ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "GemcitabineCARBOplatin" assert inst.publisher == "National Comprehensive Cancer Network, Inc." assert ( inst.relatedArtifact[0].display == "NCCN Guidelines for Kidney Cancer. V.2.2016" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "http://www.example.org/professionals/physician_gls/PDF/kidney.pdf" } ).valueUrl ) assert inst.relatedArtifact[0].type == "derived-from" assert ( inst.relatedArtifact[1].citation == "Oudard S, et al. J Urol. 2007;177(5):1698-702" ) assert ( inst.relatedArtifact[1].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://www.ncbi.nlm.nih.gov/pubmed/17437788"} ).valueUrl ) assert inst.relatedArtifact[1].type == "citation" assert inst.status == "draft" assert inst.text.status == "additional" assert inst.title == "Gemcitabine/CARBOplatin" assert inst.type.text == "Chemotherapy Order Template" assert inst.useContext[0].code.code == "treamentSetting-or-diseaseStatus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/indications"} ).valueUri ) assert ( inst.useContext[0].extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/usagecontext-group"} ).valueUri ) assert inst.useContext[0].extension[0].valueString == "A" assert inst.useContext[0].valueCodeableConcept.text == "Metastatic" assert inst.useContext[1].code.code == "disease-or-histology" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/indications"} ).valueUri ) assert ( inst.useContext[1].extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/usagecontext-group"} ).valueUri ) assert inst.useContext[1].extension[0].valueString == "A" assert ( inst.useContext[1].valueCodeableConcept.text == "Collecting Duct/Medullary Subtypes" ) assert inst.useContext[2].code.code == "focus" assert ( inst.useContext[2].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert ( inst.useContext[2].extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/usagecontext-group"} ).valueUri ) assert inst.useContext[2].extension[0].valueString == "A" assert inst.useContext[2].valueCodeableConcept.text == "Kidney Cancer" assert inst.useContext[3].code.code == "treatmentSetting-or-diseaseStatus" assert ( inst.useContext[3].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/indications"} ).valueUri ) assert ( inst.useContext[3].extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/usagecontext-group"} ).valueUri ) assert inst.useContext[3].extension[0].valueString == "B" assert inst.useContext[3].valueCodeableConcept.text == "Relapsed" assert inst.useContext[4].code.code == "disease-or-histology" assert ( inst.useContext[4].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/CodeSystem/indications"} ).valueUri ) assert ( inst.useContext[4].extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/usagecontext-group"} ).valueUri ) assert inst.useContext[4].extension[0].valueString == "B" assert ( inst.useContext[4].valueCodeableConcept.text == "Collecting Duct/Medullary Subtypes" ) assert inst.useContext[5].code.code == "focus" assert ( inst.useContext[5].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert ( inst.useContext[5].extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/usagecontext-group"} ).valueUri ) assert inst.useContext[5].extension[0].valueString == "B" assert inst.useContext[5].valueCodeableConcept.text == ( "Kidney Cancer – Collecting Duct/Medullary Subtypes - " "Metastatic" ) assert inst.version == "1" def test_plandefinition_1(base_settings): """No. 1 tests collection for PlanDefinition. Test File: plandefinition-example-kdn5-simplified.json """ filename = ( base_settings["unittest_data_dir"] / "plandefinition-example-kdn5-simplified.json" ) inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes()) assert "PlanDefinition" == inst.get_resource_type() impl_plandefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PlanDefinition" == data["resourceType"] inst2 = plandefinition.PlanDefinition(**data) impl_plandefinition_1(inst2) def impl_plandefinition_2(inst): assert ( inst.action[0].action[0].definitionCanonical == "#activitydefinition-medicationrequest-1" ) assert inst.action[0].action[0].id == "medication-action-1" assert inst.action[0].action[0].title == "Administer Medication 1" assert ( inst.action[0].action[1].definitionCanonical == "#activitydefinition-medicationrequest-2" ) assert inst.action[0].action[1].id == "medication-action-2" assert inst.action[0].action[1].relatedAction[0].offsetDuration.unit == "h" assert float( inst.action[0].action[1].relatedAction[0].offsetDuration.value ) == float(1) assert inst.action[0].action[1].relatedAction[0].relationship == "after-end" assert inst.action[0].action[1].relatedAction[0].targetId == "medication-action-1" assert inst.action[0].action[1].title == "Administer Medication 2" assert inst.action[0].groupingBehavior == "logical-group" assert inst.action[0].selectionBehavior == "all" assert inst.contained[0].id == "activitydefinition-medicationrequest-1" assert inst.contained[1].id == "activitydefinition-medicationrequest-2" assert inst.description == "This example illustrates relationships between actions." assert inst.id == "options-example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "ThisExampleIllustratesRelationshipsBetweenActions" assert inst.status == "draft" assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" assert inst.title == "This example illustrates relationships between actions." def test_plandefinition_2(base_settings): """No. 2 tests collection for PlanDefinition. Test File: plandefinition-options-example.json """ filename = ( base_settings["unittest_data_dir"] / "plandefinition-options-example.json" ) inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes()) assert "PlanDefinition" == inst.get_resource_type() impl_plandefinition_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PlanDefinition" == data["resourceType"] inst2 = plandefinition.PlanDefinition(**data) impl_plandefinition_2(inst2) def impl_plandefinition_3(inst): assert ( inst.action[0].action[0].dynamicValue[0].expression.expression == "Communication Request to Provider" ) assert inst.action[0].action[0].dynamicValue[0].expression.language == "text/cql" assert inst.action[0].action[0].dynamicValue[0].path == "/" assert inst.action[0].action[0].textEquivalent == ( "A Breastfeeding Readiness Assessment is recommended, please " "authorize or reject the order." ) assert inst.action[0].action[0].title == "Notify the provider to sign the order." assert inst.action[0].action[0].type.coding[0].code == "create" assert ( inst.action[0].condition[0].expression.expression == "Should Notify Provider to Sign Assessment Order" ) assert inst.action[0].condition[0].expression.language == "text/cql" assert inst.action[0].condition[0].kind == "applicability" assert inst.action[0].title == ( "Mother should be administered a breastfeeding readiness " "assessment." ) assert inst.action[0].trigger[0].name == "Admission" assert inst.action[0].trigger[0].type == "named-event" assert inst.action[0].trigger[1].name == "Birth" assert inst.action[0].trigger[1].type == "named-event" assert inst.action[0].trigger[2].name == "Infant Transfer to Recovery" assert inst.action[0].trigger[2].type == "named-event" assert inst.action[0].trigger[3].name == "Transfer to Post-Partum" assert inst.action[0].trigger[3].type == "named-event" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-03-08"} ).valueDateTime ) assert inst.id == "exclusive-breastfeeding-intervention-02" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "exclusive-breastfeeding-intervention-02" assert inst.library[0] == ( "http://example.org/fhir/Library/library-exclusive-" "breastfeeding-cds-logic" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "ExclusiveBreastfeedingIntervention02" assert inst.relatedArtifact[0].resource == ( "http://example.org/fhir/Measure/measure-exclusive-" "breastfeeding" ) assert inst.relatedArtifact[0].type == "derived-from" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Exclusive Breastfeeding Intervention-02" assert inst.topic[0].text == "Exclusive Breastfeeding" assert inst.version == "1.0.0" def test_plandefinition_3(base_settings): """No. 3 tests collection for PlanDefinition. Test File: plandefinition-exclusive-breastfeeding-intervention-02.json """ filename = ( base_settings["unittest_data_dir"] / "plandefinition-exclusive-breastfeeding-intervention-02.json" ) inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes()) assert "PlanDefinition" == inst.get_resource_type() impl_plandefinition_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PlanDefinition" == data["resourceType"] inst2 = plandefinition.PlanDefinition(**data) impl_plandefinition_3(inst2) def impl_plandefinition_4(inst): assert ( inst.action[0].action[0].dynamicValue[0].expression.expression == "Communication Request to Charge Nurse" ) assert inst.action[0].action[0].dynamicValue[0].expression.language == "text/cql" assert inst.action[0].action[0].dynamicValue[0].path == "/" assert inst.action[0].action[0].textEquivalent == ( "A Breastfeeding Readiness Assessment is recommended, please " "administer the assessment." ) assert ( inst.action[0].action[0].title == "Notify the charge nurse to perform the assessment." ) assert inst.action[0].action[0].type.coding[0].code == "create" assert ( inst.action[0].action[1].dynamicValue[0].expression.expression == "Communication Request to Bedside Nurse" ) assert inst.action[0].action[1].dynamicValue[0].expression.language == "text/cql" assert inst.action[0].action[1].dynamicValue[0].path == "/" assert inst.action[0].action[1].textEquivalent == ( "A Breastfeeding Readiness Assessment is recommended, please " "administer the assessment." ) assert ( inst.action[0].action[1].title == "Notify the bedside nurse to perform the assessment." ) assert inst.action[0].action[1].type.coding[0].code == "create" assert ( inst.action[0].condition[0].expression.expression == "Should Notify Nurse to Perform Assessment" ) assert inst.action[0].condition[0].expression.language == "text/cql" assert inst.action[0].condition[0].kind == "applicability" assert inst.action[0].title == ( "Mother should be administered a breastfeeding readiness " "assessment." ) assert inst.action[0].trigger[0].name == "Admission" assert inst.action[0].trigger[0].type == "named-event" assert inst.action[0].trigger[1].name == "Birth" assert inst.action[0].trigger[1].type == "named-event" assert inst.action[0].trigger[2].name == "Infant Transfer to Recovery" assert inst.action[0].trigger[2].type == "named-event" assert inst.action[0].trigger[3].name == "Transfer to Post-Partum" assert inst.action[0].trigger[3].type == "named-event" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-03-08"} ).valueDateTime ) assert inst.id == "exclusive-breastfeeding-intervention-03" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "exclusive-breastfeeding-intervention-03" assert inst.library[0] == ( "http://example.org/fhir/Library/library-exclusive-" "breastfeeding-cds-logic" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "ExclusiveBreastfeedingIntervention03" assert inst.relatedArtifact[0].resource == ( "http://example.org/fhir/Measure/measure-exclusive-" "breastfeeding" ) assert inst.relatedArtifact[0].type == "derived-from" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Exclusive Breastfeeding Intervention-03" assert inst.topic[0].text == "Exclusive Breastfeeding" assert inst.version == "1.0.0" def test_plandefinition_4(base_settings): """No. 4 tests collection for PlanDefinition. Test File: plandefinition-exclusive-breastfeeding-intervention-03.json """ filename = ( base_settings["unittest_data_dir"] / "plandefinition-exclusive-breastfeeding-intervention-03.json" ) inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes()) assert "PlanDefinition" == inst.get_resource_type() impl_plandefinition_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PlanDefinition" == data["resourceType"] inst2 = plandefinition.PlanDefinition(**data) impl_plandefinition_4(inst2) def impl_plandefinition_5(inst): assert ( inst.action[0].action[0].action[0].definitionCanonical == "#referralToCardiologyConsult" ) assert ( inst.action[0].action[0].action[0].dynamicValue[0].expression.expression == "Now()" ) assert ( inst.action[0].action[0].action[0].dynamicValue[0].expression.language == "text/cql" ) assert inst.action[0].action[0].action[0].dynamicValue[0].path == "timing.event" assert inst.action[0].action[0].action[0].dynamicValue[1].expression.expression == ( "Code '261QM0850X' from CardiologyChestPainLogic.\"NUCC " "Provider Taxonomy\" display 'Adult Mental Health'" ) assert ( inst.action[0].action[0].action[0].dynamicValue[1].expression.language == "text/cql" ) assert inst.action[0].action[0].action[0].dynamicValue[1].path == "specialty" assert ( inst.action[0].action[0].action[0].dynamicValue[2].expression.expression == "CardiologyChestPainLogic.ServiceRequestFulfillmentTime" ) assert ( inst.action[0].action[0].action[0].dynamicValue[2].expression.language == "text/cql" ) assert ( inst.action[0].action[0].action[0].dynamicValue[2].path == "occurrenceDateTime" ) assert ( inst.action[0].action[0].action[0].dynamicValue[3].expression.expression == "CardiologyChestPainLogic.Patient" ) assert ( inst.action[0].action[0].action[0].dynamicValue[3].expression.language == "text/cql" ) assert inst.action[0].action[0].action[0].dynamicValue[3].path == "subject" assert ( inst.action[0].action[0].action[0].dynamicValue[4].expression.expression == "CardiologyChestPainLogic.Practitioner" ) assert ( inst.action[0].action[0].action[0].dynamicValue[4].expression.language == "text/cql" ) assert inst.action[0].action[0].action[0].dynamicValue[4].path == "requester.agent" assert ( inst.action[0].action[0].action[0].dynamicValue[5].expression.expression == "CardiologyChestPainLogic.CardiologyReferralReason" ) assert ( inst.action[0].action[0].action[0].dynamicValue[5].expression.language == "text/cql" ) assert inst.action[0].action[0].action[0].dynamicValue[5].path == "reasonCode" assert ( inst.action[0].action[0].action[0].dynamicValue[6].expression.expression == "CardiologyChestPainLogic.RiskAssessment" ) assert ( inst.action[0].action[0].action[0].dynamicValue[6].expression.language == "text/cql" ) assert inst.action[0].action[0].action[0].dynamicValue[6].path == "reasonReference" assert ( inst.action[0].action[0].action[0].textEquivalent == "Referral to cardiology to evaluate chest pain (routine)" ) assert ( inst.action[0].action[0].action[1].definitionCanonical == "#CollectReferralReason" ) assert ( inst.action[0].action[0].action[1].title == "Reason for cardiology consultation" ) assert ( inst.action[0].action[0].action[2].definitionCanonical == "#CardiologyConsultationGoal" ) assert inst.action[0].action[0].action[2].title == "Goal of cardiology consultation" assert inst.action[0].action[0].groupingBehavior == "logical-group" assert inst.action[0].action[0].selectionBehavior == "any" assert inst.action[0].action[0].title == "Consults and Referrals" assert inst.action[0].action[1].action[0].groupingBehavior == "logical-group" assert inst.action[0].action[1].action[0].selectionBehavior == "at-most-one" assert ( inst.action[0].action[1].action[1].action[0].definitionCanonical == "#metoprololTartrate25Prescription" ) assert ( inst.action[0] .action[1] .action[1] .action[0] .dynamicValue[0] .expression.expression == "'draft'" ) assert ( inst.action[0].action[1].action[1].action[0].dynamicValue[0].expression.language == "text/cql" ) assert inst.action[0].action[1].action[1].action[0].dynamicValue[0].path == "status" assert ( inst.action[0] .action[1] .action[1] .action[0] .dynamicValue[1] .expression.expression == "CardiologyChestPainLogic.Patient" ) assert ( inst.action[0].action[1].action[1].action[0].dynamicValue[1].expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[1].action[0].dynamicValue[1].path == "patient" ) assert ( inst.action[0] .action[1] .action[1] .action[0] .dynamicValue[2] .expression.expression == "CardiologyChestPainLogic.Practitioner" ) assert ( inst.action[0].action[1].action[1].action[0].dynamicValue[2].expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[1].action[0].dynamicValue[2].path == "prescriber" ) assert ( inst.action[0].action[1].action[1].action[0].textEquivalent == "metoprolol tartrate 25 mg tablet 1 tablet oral 2 time daily" ) assert ( inst.action[0].action[1].action[1].action[1].definitionCanonical == "#metoprololTartrate50Prescription" ) assert ( inst.action[0] .action[1] .action[1] .action[1] .dynamicValue[0] .expression.expression == "'draft'" ) assert ( inst.action[0].action[1].action[1].action[1].dynamicValue[0].expression.language == "text/cql" ) assert inst.action[0].action[1].action[1].action[1].dynamicValue[0].path == "status" assert ( inst.action[0] .action[1] .action[1] .action[1] .dynamicValue[1] .expression.expression == "CardiologyChestPainLogic.Patient" ) assert ( inst.action[0].action[1].action[1].action[1].dynamicValue[1].expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[1].action[1].dynamicValue[1].path == "patient" ) assert ( inst.action[0] .action[1] .action[1] .action[1] .dynamicValue[2] .expression.expression == "CardiologyChestPainLogic.Practitioner" ) assert ( inst.action[0].action[1].action[1].action[1].dynamicValue[2].expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[1].action[1].dynamicValue[2].path == "prescriber" ) assert ( inst.action[0].action[1].action[1].action[1].textEquivalent == "metoprolol tartrate 50 mg tablet 1 tablet oral 2 time daily" ) assert ( inst.action[0].action[1].action[1].action[2].definitionCanonical == "#amlodipinePrescription" ) assert ( inst.action[0] .action[1] .action[1] .action[2] .dynamicValue[0] .expression.expression == "'draft'" ) assert ( inst.action[0].action[1].action[1].action[2].dynamicValue[0].expression.language == "text/cql" ) assert inst.action[0].action[1].action[1].action[2].dynamicValue[0].path == "status" assert ( inst.action[0] .action[1] .action[1] .action[2] .dynamicValue[1] .expression.expression == "CardiologyChestPainLogic.Patient" ) assert ( inst.action[0].action[1].action[1].action[2].dynamicValue[1].expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[1].action[2].dynamicValue[1].path == "patient" ) assert ( inst.action[0] .action[1] .action[1] .action[2] .dynamicValue[2] .expression.expression == "CardiologyChestPainLogic.Practitioner" ) assert ( inst.action[0].action[1].action[1].action[2].dynamicValue[2].expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[1].action[2].dynamicValue[2].path == "prescriber" ) assert ( inst.action[0].action[1].action[1].action[2].textEquivalent == "amlodipine 5 tablet 1 tablet oral daily" ) assert inst.action[0].action[1].action[1].groupingBehavior == "logical-group" assert inst.action[0].action[1].action[1].selectionBehavior == "at-most-one" assert inst.action[0].action[1].action[1].title == "Antianginal Therapy" assert ( inst.action[0].action[1].action[2].action[0].definitionCanonical == "#nitroglycerinPrescription" ) assert ( inst.action[0] .action[1] .action[2] .action[0] .dynamicValue[0] .expression.expression == "'draft'" ) assert ( inst.action[0].action[1].action[2].action[0].dynamicValue[0].expression.language == "text/cql" ) assert inst.action[0].action[1].action[2].action[0].dynamicValue[0].path == "status" assert ( inst.action[0] .action[1] .action[2] .action[0] .dynamicValue[1] .expression.expression == "CardiologyChestPainLogic.Patient" ) assert ( inst.action[0].action[1].action[2].action[0].dynamicValue[1].expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[2].action[0].dynamicValue[1].path == "patient" ) assert ( inst.action[0] .action[1] .action[2] .action[0] .dynamicValue[2] .expression.expression == "CardiologyChestPainLogic.Practitioner" ) assert ( inst.action[0].action[1].action[2].action[0].dynamicValue[2].expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[2].action[0].dynamicValue[2].path == "prescriber" ) assert inst.action[0].action[1].action[2].action[0].textEquivalent == ( "nitroglycerin 0.4 mg tablet sub-lingual every 5 minutes as " "needed for chest pain; maximum 3 tablets" ) assert inst.action[0].action[1].action[2].groupingBehavior == "logical-group" assert inst.action[0].action[1].action[2].selectionBehavior == "at-most-one" assert inst.action[0].action[1].action[2].title == "Nitroglycerin" assert inst.action[0].action[1].description == ( "Consider the following medications for stable patients to be" " initiated prior to the cardiology consultation." ) assert inst.action[0].action[1].title == "Medications" assert inst.author[0].name == "Bruce Bray MD" assert inst.author[1].name == "Scott Wall MD" assert inst.author[2].name == "Aiden Abidov MD, PhD" assert inst.contained[0].id == "cardiology-chestPain-logic" assert inst.contained[1].id == "referralToCardiologyConsult" assert inst.contained[2].id == "metoprololTartrate25Prescription" assert inst.contained[3].id == "metoprololTartrate25Medication" assert inst.contained[4].id == "metoprololTartrate25Substance" assert inst.contained[5].id == "metoprololTartrate50Prescription" assert inst.contained[6].id == "metoprololTartrate50Medication" assert inst.contained[7].id == "metoprololTartrate50Substance" assert inst.contained[8].id == "nitroglycerinPrescription" assert inst.contained[9].id == "nitroglycerinMedication" assert inst.copyright == ( "© Copyright Cognitive Medical Systems, Inc. 9444 Waples " "Street Suite 300 San Diego, CA 92121" ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-08-29"} ).valueDateTime ) assert inst.id == "example-cardiology-os" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.11.8" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:va.gov:kbs:knart:artifact:r1"} ).valueUri ) assert inst.identifier[1].use == "official" assert inst.identifier[1].value == "bb7ccea6-9744-4743-854a-bcffd87191f6" assert ( inst.identifier[2].system == ExternalValidatorModel.model_validate( { "valueUri": "urn:va.gov:kbs:contract:VA118-16-D-1008:to:VA-118-16-F-1008-0007" } ).valueUri ) assert inst.identifier[2].value == "CLIN0004AG" assert ( inst.identifier[3].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:cognitivemedicine.com:lab:jira"} ).valueUri ) assert inst.identifier[3].value == "KP-914" assert inst.library[0] == "#cardiology-chestPain-logic" assert inst.name == "ChestPainCoronaryArteryDiseaseOrderSetKNART" assert inst.publisher == "Department of Veterans Affairs" assert inst.relatedArtifact[0].display == ( "Cardiology: Chest Pain (CP) / Coronary Artery Disease (CAD) " "Clinical Content White Paper" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "NEED-A-URL-HERE"} ).valueUrl ) assert inst.relatedArtifact[0].type == "derived-from" assert inst.relatedArtifact[1].display == ( "Outcome CVD (coronary death, myocardial infarction, coronary" " insufficiency, angina, ischemic stroke, hemorrhagic stroke," " transient ischemic attack, peripheral artery disease, heart" " failure)" ) assert ( inst.relatedArtifact[1].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://www.framinghamheartstudy.org/risk-functions/cardiovascular-disease/10-year-risk.php" } ).valueUrl ) assert inst.relatedArtifact[1].type == "justification" assert inst.relatedArtifact[2].display == ( "General cardiovascular risk profile for use in primary care:" " the Framingham Heart Study" ) assert ( inst.relatedArtifact[2].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://www.framinghamheartstudy.org/risk-functions/cardiovascular-disease/10-year-risk.php" } ).valueUrl ) assert inst.relatedArtifact[2].type == "justification" assert ( inst.relatedArtifact[3].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "NEED-A-URL-HERE"} ).valueUrl ) assert inst.relatedArtifact[3].type == "justification" assert ( inst.relatedArtifact[4].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "NEED-A-URL-HERE"} ).valueUrl ) assert inst.relatedArtifact[4].type == "justification" assert ( inst.relatedArtifact[5].display == "LABEL: ASPIRIN 81 MG- aspirin tablet, coated" ) assert ( inst.relatedArtifact[5].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=b4064039-2345-4227-b83d-54dc13a838d3" } ).valueUrl ) assert inst.relatedArtifact[5].type == "justification" assert inst.relatedArtifact[6].display == ( "LABEL: CLOPIDOGREL- clopidogrel bisulfate tablet, film " "coated" ) assert ( inst.relatedArtifact[6].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=7fe85155-bc00-406b-b097-e8aece187a8a" } ).valueUrl ) assert inst.relatedArtifact[6].type == "justification" assert ( inst.relatedArtifact[7].display == "LABEL: LIPITOR- atorvastatin calcium tablet, film coated" ) assert ( inst.relatedArtifact[7].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=7fe85155-bc00-406b-b097-e8aece187a8a" } ).valueUrl ) assert inst.relatedArtifact[7].type == "justification" assert inst.relatedArtifact[8].display == ( "LABEL: METOPROLOL SUCCINATE EXTENDED-RELEASE - metoprolol " "succinate tablet, film coated, extended release" ) assert ( inst.relatedArtifact[8].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=2d948600-35d8-4490-983b-918bdce488c8" } ).valueUrl ) assert inst.relatedArtifact[8].type == "justification" assert ( inst.relatedArtifact[9].display == "LABEL: NITROGLYCERIN- nitroglycerin tablet" ) assert ( inst.relatedArtifact[9].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=67bf2a15-b115-47ac-ae28-ce2dafd6b5c9" } ).valueUrl ) assert inst.relatedArtifact[9].type == "justification" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == ( "Chest Pain (CP) - Coronary Artery Disease (CAD) Order Set " "KNART" ) assert inst.type.coding[0].code == "order-set" assert inst.type.coding[0].display == "Order Set" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/plan-definition-type"} ).valueUri ) assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://va.gov/kas/orderset/B5-Cardiology-ChestPainCAD-OS"} ).valueUri ) assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "look up value" assert ( inst.useContext[0].valueCodeableConcept.coding[0].display == "appropriate snomed condition" ) assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version == "0.1" def test_plandefinition_5(base_settings): """No. 5 tests collection for PlanDefinition. Test File: plandefinition-example-cardiology-os.json """ filename = ( base_settings["unittest_data_dir"] / "plandefinition-example-cardiology-os.json" ) inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes()) assert "PlanDefinition" == inst.get_resource_type() impl_plandefinition_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PlanDefinition" == data["resourceType"] inst2 = plandefinition.PlanDefinition(**data) impl_plandefinition_5(inst2) def impl_plandefinition_6(inst): assert inst.action[0].cardinalityBehavior == "single" assert inst.action[0].condition[0].expression.expression == ( "exists ([Condition: Obesity]) or not exists ([Observation: " "BMI] O where O.effectiveDateTime 2 years or less before " "Today())" ) assert inst.action[0].condition[0].expression.language == "text/cql" assert inst.action[0].condition[0].kind == "applicability" assert inst.action[0].definitionCanonical == "#procedure" assert ( inst.action[0].description == "Measure, Weight, Height, Waist, Circumference; Calculate BMI" ) assert inst.action[0].goalId[0] == "reduce-bmi-ratio" assert inst.action[0].requiredBehavior == "must-unless-documented" assert inst.action[0].title == "Measure BMI" assert inst.author[0].name == "National Heart, Lung, and Blood Institute" assert inst.author[0].telecom[0].system == "url" assert ( inst.author[0].telecom[0].value == "https://www.nhlbi.nih.gov/health-pro/guidelines" ) assert inst.contained[0].id == "procedure" assert inst.description == "Obesity Assessment Protocol" assert inst.goal[0].addresses[0].coding[0].code == "414916001" assert inst.goal[0].addresses[0].coding[0].display == "Obesity (disorder)" assert ( inst.goal[0].addresses[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.goal[0].category.text == "Treatment" assert inst.goal[0].description.text == "Reduce BMI to below 25" assert inst.goal[0].documentation[0].display == "Evaluation and Treatment Strategy" assert ( inst.goal[0].documentation[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://www.nhlbi.nih.gov/health-pro/guidelines/current/obesity-guidelines/e_textbook/txgd/42.htm" } ).valueUrl ) assert inst.goal[0].documentation[0].type == "justification" assert inst.goal[0].id == "reduce-bmi-ratio" assert inst.goal[0].priority.text == "medium-priority" assert inst.goal[0].start.text == "When the patient's BMI Ratio is at or above 25" assert inst.goal[0].target[0].detailRange.high.unit == "kg/m2" assert float(inst.goal[0].target[0].detailRange.high.value) == float(24.9) assert inst.goal[0].target[0].due.unit == "a" assert float(inst.goal[0].target[0].due.value) == float(1) assert inst.goal[0].target[0].measure.coding[0].code == "39156-5" assert ( inst.goal[0].target[0].measure.coding[0].display == "Body mass index (BMI) [Ratio]" ) assert ( inst.goal[0].target[0].measure.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.id == "protocol-example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org"} ).valueUri ) assert inst.identifier[0].value == "example-1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "ObesityAssessmentProtocol" assert inst.purpose == ( "Example of A medical algorithm for assessment and treatment " "of overweight and obesity" ) assert ( inst.relatedArtifact[0].display == "Overweight and Obesity Treatment Guidelines" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "http://www.nhlbi.nih.gov/health-pro/guidelines/current/obesity-guidelines/e_textbook/txgd/algorthm/algorthm.htm" } ).valueUrl ) assert inst.relatedArtifact[0].type == "derived-from" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Obesity Assessment Protocol" assert inst.type.coding[0].code == "clinical-protocol" assert inst.useContext[0].code.code == "focus" assert inst.useContext[0].valueCodeableConcept.coding[0].code == "414916001" assert ( inst.useContext[0].valueCodeableConcept.coding[0].display == "Obesity (disorder)" ) assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_plandefinition_6(base_settings): """No. 6 tests collection for PlanDefinition. Test File: plandefinition-protocol-example.json """ filename = ( base_settings["unittest_data_dir"] / "plandefinition-protocol-example.json" ) inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes()) assert "PlanDefinition" == inst.get_resource_type() impl_plandefinition_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PlanDefinition" == data["resourceType"] inst2 = plandefinition.PlanDefinition(**data) impl_plandefinition_6(inst2) def impl_plandefinition_7(inst): assert ( inst.action[0].action[0].action[0].definitionCanonical == "#referralToMentalHealthCare" ) assert ( inst.action[0].action[0].action[0].dynamicValue[0].expression.expression == "Now()" ) assert ( inst.action[0].action[0].action[0].dynamicValue[0].expression.language == "text/cql" ) assert inst.action[0].action[0].action[0].dynamicValue[0].path == "timing.event" assert inst.action[0].action[0].action[0].dynamicValue[1].expression.expression == ( "Code '261QM0850X' from SuicideRiskLogic.\"NUCC Provider " "Taxonomy\" display 'Adult Mental Health'" ) assert ( inst.action[0].action[0].action[0].dynamicValue[1].expression.language == "text/cql" ) assert inst.action[0].action[0].action[0].dynamicValue[1].path == "specialty" assert ( inst.action[0].action[0].action[0].dynamicValue[2].expression.expression == "SuicideRiskLogic.ServiceRequestFulfillmentTime" ) assert ( inst.action[0].action[0].action[0].dynamicValue[2].expression.language == "text/cql" ) assert ( inst.action[0].action[0].action[0].dynamicValue[2].path == "occurrenceDateTime" ) assert ( inst.action[0].action[0].action[0].dynamicValue[3].expression.expression == "SuicideRiskLogic.Patient" ) assert ( inst.action[0].action[0].action[0].dynamicValue[3].expression.language == "text/cql" ) assert inst.action[0].action[0].action[0].dynamicValue[3].path == "subject" assert ( inst.action[0].action[0].action[0].dynamicValue[4].expression.expression == "SuicideRiskLogic.Practitioner" ) assert ( inst.action[0].action[0].action[0].dynamicValue[4].expression.language == "text/cql" ) assert inst.action[0].action[0].action[0].dynamicValue[4].path == "requester.agent" assert ( inst.action[0].action[0].action[0].dynamicValue[5].expression.expression == "SuicideRiskLogic.RiskAssessmentScore" ) assert ( inst.action[0].action[0].action[0].dynamicValue[5].expression.language == "text/cql" ) assert inst.action[0].action[0].action[0].dynamicValue[5].path == "reasonCode" assert ( inst.action[0].action[0].action[0].dynamicValue[6].expression.expression == "SuicideRiskLogic.RiskAssessment" ) assert ( inst.action[0].action[0].action[0].dynamicValue[6].expression.language == "text/cql" ) assert inst.action[0].action[0].action[0].dynamicValue[6].path == "reasonReference" assert inst.action[0].action[0].action[0].textEquivalent == ( "Refer to outpatient mental health program for evaluation and" " treatment of mental health conditions now" ) assert inst.action[0].action[0].groupingBehavior == "logical-group" assert inst.action[0].action[0].selectionBehavior == "any" assert inst.action[0].action[0].title == "Consults and Referrals" assert ( inst.action[0].action[1].action[0].action[0].action[0].definitionCanonical == "#citalopramPrescription" ) assert ( inst.action[0] .action[1] .action[0] .action[0] .action[0] .dynamicValue[0] .expression.expression == "'draft'" ) assert ( inst.action[0] .action[1] .action[0] .action[0] .action[0] .dynamicValue[0] .expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[0].path == "status" ) assert ( inst.action[0] .action[1] .action[0] .action[0] .action[0] .dynamicValue[1] .expression.expression == "SuicideRiskLogic.Patient" ) assert ( inst.action[0] .action[1] .action[0] .action[0] .action[0] .dynamicValue[1] .expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[1].path == "patient" ) assert ( inst.action[0] .action[1] .action[0] .action[0] .action[0] .dynamicValue[2] .expression.expression == "SuicideRiskLogic.Practitioner" ) assert ( inst.action[0] .action[1] .action[0] .action[0] .action[0] .dynamicValue[2] .expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[2].path == "prescriber" ) assert ( inst.action[0] .action[1] .action[0] .action[0] .action[0] .dynamicValue[3] .expression.expression == "SuicideRiskLogic.RiskAssessmentScore" ) assert ( inst.action[0] .action[1] .action[0] .action[0] .action[0] .dynamicValue[3] .expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[3].path == "reasonCode" ) assert ( inst.action[0] .action[1] .action[0] .action[0] .action[0] .dynamicValue[4] .expression.expression == "SuicideRiskLogic.RiskAssessment" ) assert ( inst.action[0] .action[1] .action[0] .action[0] .action[0] .dynamicValue[4] .expression.language == "text/cql" ) assert ( inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[4].path == "reasonReference" ) assert inst.action[0].action[1].action[0].action[0].action[0].textEquivalent == ( "citalopram 20 mg tablet 1 tablet oral 1 time daily now (30 " "table; 3 refills)" ) assert inst.action[0].action[1].action[0].action[0].action[1].textEquivalent == ( "escitalopram 10 mg tablet 1 tablet oral 1 time daily now (30" " tablet; 3 refills)" ) assert inst.action[0].action[1].action[0].action[0].action[2].textEquivalent == ( "fluoxetine 20 mg capsule 1 capsule oral 1 time daily now (30" " tablet; 3 refills)" ) assert inst.action[0].action[1].action[0].action[0].action[3].textEquivalent == ( "paroxetine 20 mg tablet 1 tablet oral 1 time daily now (30 " "tablet; 3 refills)" ) assert inst.action[0].action[1].action[0].action[0].action[4].textEquivalent == ( "sertraline 50 mg tablet 1 tablet oral 1 time daily now (30 " "tablet; 3 refills)" ) assert ( inst.action[0] .action[1] .action[0] .action[0] .documentation[0] .document.contentType == "text/html" ) assert inst.action[0].action[1].action[0].action[0].documentation[ 0 ].document.title == ( "National Library of Medicine. DailyMed website. CITALOPRAM- " "citalopram hydrobromide tablet, film coated." ) assert ( inst.action[0].action[1].action[0].action[0].documentation[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "http://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=6daeb45c-451d-b135-bf8f-2d6dff4b6b01" } ).valueUrl ) assert ( inst.action[0].action[1].action[0].action[0].documentation[0].type == "citation" ) assert ( inst.action[0].action[1].action[0].action[0].groupingBehavior == "logical-group" ) assert ( inst.action[0].action[1].action[0].action[0].selectionBehavior == "at-most-one" ) assert inst.action[0].action[1].action[0].action[0].title == ( "Selective Serotonin Reuptake Inhibitors (Choose a mazimum of" " one or document reasons for exception)" ) assert inst.action[0].action[1].action[0].action[1].textEquivalent == ( "Dopamine Norepinephrine Reuptake Inhibitors (Choose a " "maximum of one or document reasons for exception)" ) assert inst.action[0].action[1].action[0].action[2].textEquivalent == ( "Serotonin Norepinephrine Reuptake Inhibitors (Choose a " "maximum of one or doument reasons for exception)" ) assert inst.action[0].action[1].action[0].action[3].textEquivalent == ( "Norepinephrine-Serotonin Modulators (Choose a maximum of one" " or document reasons for exception)" ) assert ( inst.action[0].action[1].action[0].documentation[0].document.contentType == "text/html" ) assert ( inst.action[0].action[1].action[0].documentation[0].document.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/cqf-qualityOfEvidence" } ).valueUri ) assert ( inst.action[0] .action[1] .action[0] .documentation[0] .document.extension[0] .valueCodeableConcept.coding[0] .code == "high" ) assert ( inst.action[0] .action[1] .action[0] .documentation[0] .document.extension[0] .valueCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/evidence-quality"} ).valueUri ) assert ( inst.action[0] .action[1] .action[0] .documentation[0] .document.extension[0] .valueCodeableConcept.text == "High Quality" ) assert inst.action[0].action[1].action[0].documentation[0].document.title == ( "Practice Guideline for the Treatment of Patients with Major " "Depressive Disorder" ) assert ( inst.action[0].action[1].action[0].documentation[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf" } ).valueUrl ) assert inst.action[0].action[1].action[0].documentation[0].type == "citation" assert inst.action[0].action[1].action[0].groupingBehavior == "logical-group" assert inst.action[0].action[1].action[0].selectionBehavior == "at-most-one" assert inst.action[0].action[1].action[0].title == "First-Line Antidepressants" assert inst.action[0].action[1].groupingBehavior == "logical-group" assert inst.action[0].action[1].selectionBehavior == "at-most-one" assert inst.action[0].action[1].title == "Medications" assert inst.action[0].title == "Suicide Risk Assessment and Outpatient Management" assert ( inst.approvalDate == ExternalValidatorModel.model_validate({"valueDate": "2016-03-12"}).valueDate ) assert inst.author[0].name == "Motive Medical Intelligence" assert inst.author[0].telecom[0].system == "phone" assert inst.author[0].telecom[0].use == "work" assert inst.author[0].telecom[0].value == "415-362-4007" assert inst.author[0].telecom[1].system == "email" assert inst.author[0].telecom[1].use == "work" assert inst.author[0].telecom[1].value == "info@motivemi.com" assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "415-362-4007" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].use == "work" assert inst.contact[0].telecom[1].value == "info@motivemi.com" assert inst.contained[0].id == "referralToMentalHealthCare" assert inst.contained[1].id == "citalopramPrescription" assert inst.contained[2].id == "citalopramMedication" assert inst.contained[3].id == "citalopramSubstance" assert inst.copyright == ( "© Copyright 2016 Motive Medical Intelligence. All rights " "reserved." ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-15"} ).valueDateTime ) assert inst.description == ( "Orders to be applied to a patient characterized as low " "suicide risk." ) assert ( inst.effectivePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-12-31"} ).valueDateTime ) assert ( inst.effectivePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-01"} ).valueDateTime ) assert inst.experimental is True assert inst.id == "low-suicide-risk-order-set" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.11.7" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://motivemi.com/artifacts"} ).valueUri ) assert inst.identifier[1].use == "official" assert inst.identifier[1].value == "mmi:low-suicide-risk-order-set" assert inst.jurisdiction[0].coding[0].code == "US" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert ( inst.lastReviewDate == ExternalValidatorModel.model_validate({"valueDate": "2016-08-15"}).valueDate ) assert ( inst.library[0] == "http://example.org/fhir/Library/suiciderisk-orderset-logic" ) assert inst.name == "LowSuicideRiskOrderSet" assert inst.publisher == "Motive Medical Intelligence" assert inst.purpose == ( "This order set helps ensure consistent application of " "appropriate orders for the care of low suicide risk " "patients." ) assert inst.relatedArtifact[0].display == ( "Practice Guideline for the Treatment of Patients with Major " "Depressive Disorder" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf" } ).valueUrl ) assert inst.relatedArtifact[0].type == "derived-from" assert inst.relatedArtifact[1].resource == ( "http://example.org/fhir/ActivityDefinition/referralPrimaryCa" "reMentalHealth" ) assert inst.relatedArtifact[1].type == "composed-of" assert inst.relatedArtifact[2].resource == ( "http://example.org/fhir/ActivityDefinition/citalopramPrescri" "ption" ) assert inst.relatedArtifact[2].type == "composed-of" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Low Suicide Risk Order Set" assert inst.topic[0].text == "Suicide risk assessment" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://motivemi.com/artifacts/PlanDefinition/low-suicide-risk-order-set" } ).valueUri ) assert inst.usage == ( "This order set should be applied after assessing a patient " "for suicide risk, when the findings of that assessment " "indicate the patient has low suicide risk." ) assert inst.useContext[0].code.code == "age" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "D000328" assert inst.useContext[0].valueCodeableConcept.coding[0].display == "Adult" assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://meshb.nlm.nih.gov"} ).valueUri ) assert inst.useContext[1].code.code == "focus" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueCodeableConcept.coding[0].code == "87512008" assert ( inst.useContext[1].valueCodeableConcept.coding[0].display == "Mild major depression" ) assert ( inst.useContext[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[2].code.code == "focus" assert ( inst.useContext[2].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[2].valueCodeableConcept.coding[0].code == "40379007" assert ( inst.useContext[2].valueCodeableConcept.coding[0].display == "Major depression, recurrent, mild" ) assert ( inst.useContext[2].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[3].code.code == "focus" assert ( inst.useContext[3].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[3].valueCodeableConcept.coding[0].code == "394687007" assert ( inst.useContext[3].valueCodeableConcept.coding[0].display == "Low suicide risk" ) assert ( inst.useContext[3].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[4].code.code == "focus" assert ( inst.useContext[4].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[4].valueCodeableConcept.coding[0].code == "225337009" assert ( inst.useContext[4].valueCodeableConcept.coding[0].display == "Suicide risk assessment" ) assert ( inst.useContext[4].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[5].code.code == "user" assert ( inst.useContext[5].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[5].valueCodeableConcept.coding[0].code == "309343006" assert inst.useContext[5].valueCodeableConcept.coding[0].display == "Physician" assert ( inst.useContext[5].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[6].code.code == "venue" assert ( inst.useContext[6].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[6].valueCodeableConcept.coding[0].code == "440655000" assert ( inst.useContext[6].valueCodeableConcept.coding[0].display == "Outpatient environment" ) assert ( inst.useContext[6].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version == "1.0.0" def test_plandefinition_7(base_settings): """No. 7 tests collection for PlanDefinition. Test File: plandefinition-example.json """ filename = base_settings["unittest_data_dir"] / "plandefinition-example.json" inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes()) assert "PlanDefinition" == inst.get_resource_type() impl_plandefinition_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PlanDefinition" == data["resourceType"] inst2 = plandefinition.PlanDefinition(**data) impl_plandefinition_7(inst2) def impl_plandefinition_8(inst): assert inst.action[0].action[0].description == "Will offer Naloxone instead" assert inst.action[0].action[1].description == ( "Risk of overdose carefully considered and outweighed by " "benefit; snooze 3 mo" ) assert inst.action[0].action[2].description == "N/A - see comment; snooze 3 mo" assert inst.action[0].condition[0].expression.expression == "Inclusion Criteria" assert inst.action[0].condition[0].expression.language == "text/cql" assert inst.action[0].condition[0].kind == "applicability" assert inst.action[0].description == ( "Checking if the trigger prescription meets the inclusion " "criteria for recommendation #8 workflow." ) assert ( inst.action[0].documentation[0].document.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/cqf-strengthOfRecommendation" } ).valueUri ) assert ( inst.action[0] .documentation[0] .document.extension[0] .valueCodeableConcept.coding[0] .code == "strong" ) assert ( inst.action[0] .documentation[0] .document.extension[0] .valueCodeableConcept.coding[0] .display == "Strong" ) assert ( inst.action[0] .documentation[0] .document.extension[0] .valueCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/recommendation-strength" } ).valueUri ) assert ( inst.action[0].documentation[0].document.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/cqf-qualityOfEvidence" } ).valueUri ) assert ( inst.action[0] .documentation[0] .document.extension[1] .valueCodeableConcept.coding[0] .code == "low" ) assert ( inst.action[0] .documentation[0] .document.extension[1] .valueCodeableConcept.coding[0] .display == "Low quality" ) assert ( inst.action[0] .documentation[0] .document.extension[1] .valueCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/evidence-quality"} ).valueUri ) assert inst.action[0].documentation[0].type == "documentation" assert inst.action[0].dynamicValue[0].expression.expression == "Get Detail" assert inst.action[0].dynamicValue[0].expression.language == "text/cql" assert inst.action[0].dynamicValue[0].path == "action.description" assert inst.action[0].dynamicValue[1].expression.expression == "Get Summary" assert inst.action[0].dynamicValue[1].expression.language == "text/cql" assert inst.action[0].dynamicValue[1].path == "action.title" assert inst.action[0].dynamicValue[2].expression.expression == "Get Indicator" assert inst.action[0].dynamicValue[2].expression.language == "text/cql" assert inst.action[0].dynamicValue[2].path == "action.extension" assert inst.action[0].groupingBehavior == "visual-group" assert inst.action[0].selectionBehavior == "exactly-one" assert inst.action[0].title == ( "Existing patient exhibits risk factors for opioid-related " "harms." ) assert inst.action[0].trigger[0].name == "medication-prescribe" assert inst.action[0].trigger[0].type == "named-event" assert inst.author[0].name == "Kensaku Kawamoto, MD, PhD, MHS" assert inst.author[1].name == "Bryn Rhodes" assert inst.author[2].name == "Floyd Eisenberg, MD, MPH" assert inst.author[3].name == "Robert McClure, MD, MPH" assert inst.copyright == "© CDC 2016+." assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-03-19"} ).valueDateTime ) assert inst.id == "opioidcds-08" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.11.10" assert inst.identifier[1].use == "official" assert inst.identifier[1].value == "cdc-opioid-guidance" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert ( inst.library[0] == "http://example.org/fhir/Library/opioidcds-recommendation-08" ) assert inst.name == "Cdcopioid08" assert inst.publisher == "Centers for Disease Control and Prevention (CDC)" assert ( inst.relatedArtifact[0].display == "CDC guideline for prescribing opioids for chronic pain" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420" } ).valueUrl ) assert inst.relatedArtifact[0].type == "documentation" assert inst.relatedArtifact[1].display == "MME Conversion Tables" assert ( inst.relatedArtifact[1].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf" } ).valueUrl ) assert inst.relatedArtifact[1].type == "documentation" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "CDC Opioid Prescribing Guideline Recommendation #8" assert inst.topic[0].text == "Opioid Prescribing" assert inst.type.coding[0].code == "eca-rule" assert inst.type.coding[0].display == "ECA Rule" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/plan-definition-type"} ).valueUri ) assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/ig/opioid-cds/PlanDefinition/opioidcds-08" } ).valueUri ) assert inst.usage == ( "Before starting and periodically during continuation of " "opioid therapy, clinicians should evaluate risk factors for " "opioid-related harms." ) assert inst.useContext[0].code.code == "focus" assert inst.useContext[0].code.display == "Clinical Focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "182888003" assert ( inst.useContext[0].valueCodeableConcept.coding[0].display == "Medication requested (situation)" ) assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[1].code.code == "focus" assert inst.useContext[1].code.display == "Clinical Focus" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueCodeableConcept.coding[0].code == "82423001" assert ( inst.useContext[1].valueCodeableConcept.coding[0].display == "Chronic pain (finding)" ) assert ( inst.useContext[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version == "0.1.0" def test_plandefinition_8(base_settings): """No. 8 tests collection for PlanDefinition. Test File: plandefinition-opioidcds-08.json """ filename = base_settings["unittest_data_dir"] / "plandefinition-opioidcds-08.json" inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes()) assert "PlanDefinition" == inst.get_resource_type() impl_plandefinition_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PlanDefinition" == data["resourceType"] inst2 = plandefinition.PlanDefinition(**data) impl_plandefinition_8(inst2) def impl_plandefinition_9(inst): assert ( inst.action[0].action[0].dynamicValue[0].expression.expression == "Create Lactation Consult Request" ) assert inst.action[0].action[0].dynamicValue[0].expression.language == "text/cql" assert inst.action[0].action[0].dynamicValue[0].path == "/" assert ( inst.action[0].action[0].textEquivalent == "Create a lactation consult request" ) assert inst.action[0].action[0].title == "Create a lactation consult request." assert inst.action[0].action[0].type.coding[0].code == "create" assert ( inst.action[0].condition[0].expression.expression == "Should Create Lactation Consult" ) assert inst.action[0].condition[0].expression.language == "text/cql" assert inst.action[0].condition[0].kind == "applicability" assert inst.action[0].title == ( "Mother should be referred to a lactation specialist for " "consultation." ) assert inst.action[0].trigger[0].name == "Admission" assert inst.action[0].trigger[0].type == "named-event" assert inst.action[0].trigger[1].name == "Birth" assert inst.action[0].trigger[1].type == "named-event" assert inst.action[0].trigger[2].name == "Infant Transfer to Recovery" assert inst.action[0].trigger[2].type == "named-event" assert inst.action[0].trigger[3].name == "Transfer to Post-Partum" assert inst.action[0].trigger[3].type == "named-event" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-03-08"} ).valueDateTime ) assert inst.description == ( "Exclusive breastfeeding intervention intended to improve " "outcomes for exclusive breastmilk feeding of newborns by " "creating a lactation consult for the mother if appropriate." ) assert inst.id == "exclusive-breastfeeding-intervention-04" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "exclusive-breastfeeding-intervention-04" assert inst.library[0] == ( "http://example.org/fhir/Library/library-exclusive-" "breastfeeding-cds-logic" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "ExclusiveBreastfeedingIntervention04" assert inst.relatedArtifact[0].resource == ( "http://example.org/fhir/Measure/measure-exclusive-" "breastfeeding" ) assert inst.relatedArtifact[0].type == "derived-from" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Exclusive Breastfeeding Intervention-04" assert inst.topic[0].text == "Exclusive Breastfeeding" assert inst.version == "1.0.0" def test_plandefinition_9(base_settings): """No. 9 tests collection for PlanDefinition. Test File: plandefinition-exclusive-breastfeeding-intervention-04.json """ filename = ( base_settings["unittest_data_dir"] / "plandefinition-exclusive-breastfeeding-intervention-04.json" ) inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes()) assert "PlanDefinition" == inst.get_resource_type() impl_plandefinition_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PlanDefinition" == data["resourceType"] inst2 = plandefinition.PlanDefinition(**data) impl_plandefinition_9(inst2) def impl_plandefinition_10(inst): assert inst.action[0].action[0].description == "Will precribe immediate release" assert inst.action[0].action[1].description == ( "Risk of overdose carefully considered and outweighed by " "benefit; snooze 3 mo" ) assert inst.action[0].action[2].description == "N/A - see comment; snooze 3 mo" assert inst.action[0].condition[0].expression.description == ( "Check whether the opioid prescription for the existing " "patient is extended-release without any opioids-with-abuse-" "potential prescribed in the past 90 days." ) assert inst.action[0].condition[0].expression.expression == "Inclusion Criteria" assert inst.action[0].condition[0].expression.language == "text/cql" assert inst.action[0].condition[0].kind == "applicability" assert inst.action[0].description == ( "Checking if the trigger prescription meets the inclusion " "criteria for recommendation #4 workflow." ) assert ( inst.action[0].documentation[0].document.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/cqf-strengthOfRecommendation" } ).valueUri ) assert ( inst.action[0] .documentation[0] .document.extension[0] .valueCodeableConcept.coding[0] .code == "strong" ) assert ( inst.action[0] .documentation[0] .document.extension[0] .valueCodeableConcept.coding[0] .display == "Strong" ) assert ( inst.action[0] .documentation[0] .document.extension[0] .valueCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/recommendation-strength" } ).valueUri ) assert ( inst.action[0].documentation[0].document.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/cqf-qualityOfEvidence" } ).valueUri ) assert ( inst.action[0] .documentation[0] .document.extension[1] .valueCodeableConcept.coding[0] .code == "low" ) assert ( inst.action[0] .documentation[0] .document.extension[1] .valueCodeableConcept.coding[0] .display == "Low quality" ) assert ( inst.action[0] .documentation[0] .document.extension[1] .valueCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/evidence-quality"} ).valueUri ) assert inst.action[0].documentation[0].type == "documentation" assert inst.action[0].dynamicValue[0].expression.expression == "Get Summary" assert inst.action[0].dynamicValue[0].expression.language == "text/cql" assert inst.action[0].dynamicValue[0].path == "action.title" assert inst.action[0].dynamicValue[1].expression.expression == "Get Detail" assert inst.action[0].dynamicValue[1].expression.language == "text/cql" assert inst.action[0].dynamicValue[1].path == "action.description" assert inst.action[0].dynamicValue[2].expression.expression == "Get Indicator" assert inst.action[0].dynamicValue[2].expression.language == "text/cql" assert inst.action[0].dynamicValue[2].path == "activity.extension" assert inst.action[0].groupingBehavior == "visual-group" assert inst.action[0].selectionBehavior == "exactly-one" assert inst.action[0].title == "Extended-release opioid prescription triggered." assert inst.action[0].trigger[0].name == "medication-prescribe" assert inst.action[0].trigger[0].type == "named-event" assert inst.author[0].name == "Kensaku Kawamoto, MD, PhD, MHS" assert inst.author[1].name == "Bryn Rhodes" assert inst.author[2].name == "Floyd Eisenberg, MD, MPH" assert inst.author[3].name == "Robert McClure, MD, MPH" assert inst.copyright == "© CDC 2016+." assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-03-19"} ).valueDateTime ) assert inst.description == ( "When starting opioid therapy for chronic pain, clinicians " "should prescribe immediate-release opioids instead of " "extended-release/long-acting (ER/LA) opioids." ) assert inst.id == "opioidcds-04" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.11.4" assert inst.identifier[1].use == "official" assert inst.identifier[1].value == "cdc-opioid-guidance" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert ( inst.library[0] == "http://example.org/fhir/Library/opioidcds-recommendation-04" ) assert inst.name == "Cdcopioid04" assert inst.publisher == "Centers for Disease Control and Prevention (CDC)" assert ( inst.relatedArtifact[0].display == "CDC guideline for prescribing opioids for chronic pain" ) assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420" } ).valueUrl ) assert inst.relatedArtifact[0].type == "documentation" assert inst.relatedArtifact[1].display == "MME Conversion Tables" assert ( inst.relatedArtifact[1].document.url == ExternalValidatorModel.model_validate( { "valueUrl": "https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf" } ).valueUrl ) assert inst.relatedArtifact[1].type == "documentation" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "CDC Opioid Prescribing Guideline Recommendation #4" assert inst.topic[0].text == "Opioid Prescribing" assert inst.type.coding[0].code == "eca-rule" assert inst.type.coding[0].display == "ECA Rule" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/plan-definition-type"} ).valueUri ) assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/ig/opioid-cds/PlanDefinition/opioidcds-04" } ).valueUri ) assert inst.usage == ( "Providers should use caution when prescribing extended-" "release/long-acting (ER/LA) opioids as they carry a higher " "risk and negligible benefit compared to immediate-release " "opioids." ) assert inst.useContext[0].code.code == "focus" assert inst.useContext[0].code.display == "Clinical Focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "182888003" assert ( inst.useContext[0].valueCodeableConcept.coding[0].display == "Medication requested (situation)" ) assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.useContext[1].code.code == "focus" assert inst.useContext[1].code.display == "Clinical Focus" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueCodeableConcept.coding[0].code == "82423001" assert ( inst.useContext[1].valueCodeableConcept.coding[0].display == "Chronic pain (finding)" ) assert ( inst.useContext[1].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.version == "0.1.0" def test_plandefinition_10(base_settings): """No. 10 tests collection for PlanDefinition. Test File: plandefinition-opioidcds-04.json """ filename = base_settings["unittest_data_dir"] / "plandefinition-opioidcds-04.json" inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes()) assert "PlanDefinition" == inst.get_resource_type() impl_plandefinition_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PlanDefinition" == data["resourceType"] inst2 = plandefinition.PlanDefinition(**data) impl_plandefinition_10(inst2) ================================================ FILE: fhir/resources/tests/test_practitioner.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Practitioner Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import practitioner from .conftest import ExternalValidatorModel def impl_practitioner_1(inst): assert inst.active is True assert inst.address[0].city == "Den helder" assert inst.address[0].country == "NLD" assert inst.address[0].line[0] == "Walvisbaai 3" assert inst.address[0].postalCode == "2333ZA" assert inst.address[0].use == "work" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1983-04-20"}).valueDate ) assert inst.gender == "male" assert inst.id == "f203" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.528.1.1007.3.1"} ).valueUri ) assert inst.identifier[0].type.text == "UZI-nummer" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345678903" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.bigregister.nl/"} ).valueUri ) assert inst.identifier[1].type.text == "BIG-nummer" assert inst.identifier[1].use == "official" assert inst.identifier[1].value == "12345678903" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].text == "Juri van Gelder" assert inst.name[0].use == "official" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "+31715269111" assert inst.text.status == "generated" def test_practitioner_1(base_settings): """No. 1 tests collection for Practitioner. Test File: practitioner-example-f203-jvg.json """ filename = base_settings["unittest_data_dir"] / "practitioner-example-f203-jvg.json" inst = practitioner.Practitioner.model_validate_json(filename.read_bytes()) assert "Practitioner" == inst.get_resource_type() impl_practitioner_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Practitioner" == data["resourceType"] inst2 = practitioner.Practitioner(**data) impl_practitioner_1(inst2) def impl_practitioner_2(inst): assert inst.active is True assert inst.address[0].city == "Den helder" assert inst.address[0].country == "NLD" assert inst.address[0].line[0] == "Walvisbaai 3" assert inst.address[0].line[1] == "C4 - Automatisering" assert inst.address[0].postalCode == "2333ZA" assert inst.address[0].use == "work" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1956-12-24"}).valueDate ) assert inst.gender == "male" assert inst.id == "f201" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.528.1.1007.3.1"} ).valueUri ) assert inst.identifier[0].type.text == "UZI-nummer" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345678901" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Bronsig" assert inst.name[0].given[0] == "Arend" assert inst.name[0].prefix[0] == "Dr." assert inst.name[0].text == "Dokter Bronsig" assert inst.name[0].use == "official" assert inst.qualification[0].code.coding[0].code == "41672002" assert inst.qualification[0].code.coding[0].display == "Pulmonologist" assert ( inst.qualification[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "+31715269111" assert inst.text.status == "generated" def test_practitioner_2(base_settings): """No. 2 tests collection for Practitioner. Test File: practitioner-example-f201-ab.json """ filename = base_settings["unittest_data_dir"] / "practitioner-example-f201-ab.json" inst = practitioner.Practitioner.model_validate_json(filename.read_bytes()) assert "Practitioner" == inst.get_resource_type() impl_practitioner_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Practitioner" == data["resourceType"] inst2 = practitioner.Practitioner(**data) impl_practitioner_2(inst2) def impl_practitioner_3(inst): assert inst.active is True assert inst.id == "practitioner01" assert inst.identifier[0].assigner.display == "Child Hospital" assert ( inst.identifier[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01"} ).valueDateTime ) assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/persons"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "PRN" assert inst.identifier[0].type.coding[0].display == "Provider number" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].use == "temp" assert inst.identifier[0].value == "11115" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Doel" assert inst.name[0].given[0] == "John" assert inst.name[0].prefix[0] == "Dr" assert inst.text.status == "generated" def test_practitioner_3(base_settings): """No. 3 tests collection for Practitioner. Test File: Practitioner-practitioner01.json """ filename = base_settings["unittest_data_dir"] / "Practitioner-practitioner01.json" inst = practitioner.Practitioner.model_validate_json(filename.read_bytes()) assert "Practitioner" == inst.get_resource_type() impl_practitioner_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Practitioner" == data["resourceType"] inst2 = practitioner.Practitioner(**data) impl_practitioner_3(inst2) def impl_practitioner_4(inst): assert inst.active is True assert inst.address[0].city == "Den helder" assert inst.address[0].country == "NLD" assert inst.address[0].line[0] == "Walvisbaai 3" assert inst.address[0].line[1] == "C4 - Automatisering" assert inst.address[0].postalCode == "2333ZA" assert inst.address[0].use == "work" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1960-06-12"}).valueDate ) assert inst.gender == "male" assert inst.id == "f202" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.528.1.1007.3.1"} ).valueUri ) assert inst.identifier[0].type.text == "UZI-nummer" assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "12345678902" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.bigregister.nl/"} ).valueUri ) assert inst.identifier[1].type.text == "BIG-nummer" assert inst.identifier[1].use == "official" assert inst.identifier[1].value == "12345678902" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Maas" assert inst.name[0].given[0] == "Luigi" assert inst.name[0].prefix[0] == "Dr." assert inst.name[0].text == "Luigi Maas" assert inst.name[0].use == "official" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "+31715269111" assert inst.text.status == "generated" def test_practitioner_4(base_settings): """No. 4 tests collection for Practitioner. Test File: practitioner-example-f202-lm.json """ filename = base_settings["unittest_data_dir"] / "practitioner-example-f202-lm.json" inst = practitioner.Practitioner.model_validate_json(filename.read_bytes()) assert "Practitioner" == inst.get_resource_type() impl_practitioner_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Practitioner" == data["resourceType"] inst2 = practitioner.Practitioner(**data) impl_practitioner_4(inst2) def impl_practitioner_5(inst): assert inst.id == "xcda-author" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Hippocrates" assert inst.name[0].given[0] == "Harold" assert inst.name[0].suffix[0] == "MD" assert inst.text.status == "generated" def test_practitioner_5(base_settings): """No. 5 tests collection for Practitioner. Test File: practitioner-example-xcda-author.json """ filename = ( base_settings["unittest_data_dir"] / "practitioner-example-xcda-author.json" ) inst = practitioner.Practitioner.model_validate_json(filename.read_bytes()) assert "Practitioner" == inst.get_resource_type() impl_practitioner_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Practitioner" == data["resourceType"] inst2 = practitioner.Practitioner(**data) impl_practitioner_5(inst2) def impl_practitioner_6(inst): assert inst.address[0].city == "Amsterdam" assert inst.address[0].country == "NLD" assert inst.address[0].line[0] == "Galapagosweg 91" assert inst.address[0].postalCode == "1105 AZ" assert inst.address[0].use == "work" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1963-07-01"}).valueDate ) assert inst.communication[0].language.coding[0].code == "nl" assert inst.communication[0].language.coding[0].display == "Dutch" assert ( inst.communication[0].language.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:47"} ).valueUri ) assert inst.gender == "male" assert inst.id == "f003" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.528.1.1007.3.1"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "846100293" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.2.4.6.3"} ).valueUri ) assert inst.identifier[1].use == "usual" assert inst.identifier[1].value == "243HID3RT938" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Versteegh" assert inst.name[0].given[0] == "Marc" assert inst.name[0].suffix[0] == "MD" assert inst.name[0].use == "official" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "0205562431" assert inst.telecom[1].system == "email" assert inst.telecom[1].use == "work" assert inst.telecom[1].value == "m.versteegh@bmc.nl" assert inst.telecom[2].system == "fax" assert inst.telecom[2].use == "work" assert inst.telecom[2].value == "0205662948" assert inst.text.status == "generated" def test_practitioner_6(base_settings): """No. 6 tests collection for Practitioner. Test File: practitioner-example-f003-mv.json """ filename = base_settings["unittest_data_dir"] / "practitioner-example-f003-mv.json" inst = practitioner.Practitioner.model_validate_json(filename.read_bytes()) assert "Practitioner" == inst.get_resource_type() impl_practitioner_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Practitioner" == data["resourceType"] inst2 = practitioner.Practitioner(**data) impl_practitioner_6(inst2) def impl_practitioner_7(inst): assert inst.address[0].city == "Den Burg" assert inst.address[0].country == "NLD" assert inst.address[0].line[0] == "Galapagosweg 91" assert inst.address[0].postalCode == "9105 PZ" assert inst.address[0].use == "work" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1979-04-29"}).valueDate ) assert inst.gender == "male" assert inst.id == "f002" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.528.1.1007.3.1"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "730291637" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.2.4.6.3"} ).valueUri ) assert inst.identifier[1].use == "usual" assert inst.identifier[1].value == "174BIP3JH438" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Voigt" assert inst.name[0].given[0] == "Pieter" assert inst.name[0].suffix[0] == "MD" assert inst.name[0].use == "official" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "0205569336" assert inst.telecom[1].system == "email" assert inst.telecom[1].use == "work" assert inst.telecom[1].value == "p.voigt@bmc.nl" assert inst.telecom[2].system == "fax" assert inst.telecom[2].use == "work" assert inst.telecom[2].value == "0205669382" assert inst.text.status == "generated" def test_practitioner_7(base_settings): """No. 7 tests collection for Practitioner. Test File: practitioner-example-f002-pv.json """ filename = base_settings["unittest_data_dir"] / "practitioner-example-f002-pv.json" inst = practitioner.Practitioner.model_validate_json(filename.read_bytes()) assert "Practitioner" == inst.get_resource_type() impl_practitioner_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Practitioner" == data["resourceType"] inst2 = practitioner.Practitioner(**data) impl_practitioner_7(inst2) def impl_practitioner_8(inst): assert inst.active is True assert inst.address[0].city == "PleasantVille" assert inst.address[0].line[0] == "534 Erewhon St" assert inst.address[0].postalCode == "3999" assert inst.address[0].state == "Vic" assert inst.address[0].use == "home" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.acme.org/practitioners"} ).valueUri ) assert inst.identifier[0].value == "23" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Careful" assert inst.name[0].given[0] == "Adam" assert inst.name[0].prefix[0] == "Dr" assert inst.qualification[0].code.coding[0].code == "BS" assert inst.qualification[0].code.coding[0].display == "Bachelor of Science" assert ( inst.qualification[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0360/2.7"} ).valueUri ) assert inst.qualification[0].code.text == "Bachelor of Science" assert ( inst.qualification[0].identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/UniversityIdentifier"} ).valueUri ) assert inst.qualification[0].identifier[0].value == "12345" assert inst.qualification[0].issuer.display == "Example University" assert ( inst.qualification[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "1995"} ).valueDateTime ) assert inst.text.status == "generated" def test_practitioner_8(base_settings): """No. 8 tests collection for Practitioner. Test File: practitioner-example.json """ filename = base_settings["unittest_data_dir"] / "practitioner-example.json" inst = practitioner.Practitioner.model_validate_json(filename.read_bytes()) assert "Practitioner" == inst.get_resource_type() impl_practitioner_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Practitioner" == data["resourceType"] inst2 = practitioner.Practitioner(**data) impl_practitioner_8(inst2) def impl_practitioner_9(inst): assert inst.address[0].city == "Den Burg" assert inst.address[0].country == "NLD" assert inst.address[0].line[0] == "Galapagosweg 91" assert inst.address[0].postalCode == "9105 PZ" assert inst.address[0].use == "work" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1971-11-07"}).valueDate ) assert inst.gender == "female" assert inst.id == "f007" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.528.1.1007.3.1"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "874635264" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.2.4.6.3"} ).valueUri ) assert inst.identifier[1].use == "usual" assert inst.identifier[1].value == "567IUI51C154" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Heps" assert inst.name[0].given[0] == "Simone" assert inst.name[0].suffix[0] == "MD" assert inst.name[0].use == "official" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "020556936" assert inst.telecom[1].system == "email" assert inst.telecom[1].use == "work" assert inst.telecom[1].value == "S.M.Heps@bmc.nl" assert inst.telecom[2].system == "fax" assert inst.telecom[2].use == "work" assert inst.telecom[2].value == "0205669283" assert inst.text.status == "generated" def test_practitioner_9(base_settings): """No. 9 tests collection for Practitioner. Test File: practitioner-example-f007-sh.json """ filename = base_settings["unittest_data_dir"] / "practitioner-example-f007-sh.json" inst = practitioner.Practitioner.model_validate_json(filename.read_bytes()) assert "Practitioner" == inst.get_resource_type() impl_practitioner_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Practitioner" == data["resourceType"] inst2 = practitioner.Practitioner(**data) impl_practitioner_9(inst2) def impl_practitioner_10(inst): assert inst.active is True assert inst.id == "practitioner02" assert inst.identifier[0].assigner.display == "Child Hospital" assert ( inst.identifier[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01"} ).valueDateTime ) assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/persons"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "PRN" assert inst.identifier[0].type.coding[0].display == "Provider number" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].use == "temp" assert inst.identifier[0].value == "11116" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Doel" assert inst.name[0].given[0] == "Jane" assert inst.name[0].prefix[0] == "Dr" assert inst.text.status == "generated" def test_practitioner_10(base_settings): """No. 10 tests collection for Practitioner. Test File: Practitioner-practitioner02.json """ filename = base_settings["unittest_data_dir"] / "Practitioner-practitioner02.json" inst = practitioner.Practitioner.model_validate_json(filename.read_bytes()) assert "Practitioner" == inst.get_resource_type() impl_practitioner_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Practitioner" == data["resourceType"] inst2 = practitioner.Practitioner(**data) impl_practitioner_10(inst2) ================================================ FILE: fhir/resources/tests/test_practitionerrole.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/PractitionerRole Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import practitionerrole from .conftest import ExternalValidatorModel def impl_practitionerrole_1(inst): assert inst.active is True assert ( inst.availability[0].availableTime[0].availableEndTime == ExternalValidatorModel.model_validate({"valueTime": "16:30:00"}).valueTime ) assert ( inst.availability[0].availableTime[0].availableStartTime == ExternalValidatorModel.model_validate({"valueTime": "09:00:00"}).valueTime ) assert inst.availability[0].availableTime[0].daysOfWeek[0] == "mon" assert inst.availability[0].availableTime[0].daysOfWeek[1] == "tue" assert inst.availability[0].availableTime[0].daysOfWeek[2] == "wed" assert ( inst.availability[0].availableTime[1].availableEndTime == ExternalValidatorModel.model_validate({"valueTime": "12:00:00"}).valueTime ) assert ( inst.availability[0].availableTime[1].availableStartTime == ExternalValidatorModel.model_validate({"valueTime": "09:00:00"}).valueTime ) assert inst.availability[0].availableTime[1].daysOfWeek[0] == "thu" assert inst.availability[0].availableTime[1].daysOfWeek[1] == "fri" assert ( inst.availability[0].notAvailableTime[0].description == "Adam will be on extended leave during May 2017" ) assert ( inst.availability[0].notAvailableTime[0].during.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-05-20"} ).valueDateTime ) assert ( inst.availability[0].notAvailableTime[0].during.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-05-01"} ).valueDateTime ) assert inst.availability[0].notAvailableTime[1].description == ( "Adam is generally unavailable on public holidays and during " "the Christmas/New Year break" ) assert inst.characteristic[0].coding[0].code == "in-person" assert inst.characteristic[0].coding[0].display == "In Person" assert ( inst.characteristic[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/service-mode"} ).valueUri ) assert inst.characteristic[0].coding[1].code == "videoconference" assert inst.characteristic[0].coding[1].display == "Video Conference" assert ( inst.characteristic[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/service-mode"} ).valueUri ) assert inst.code[0].coding[0].code == "RP" assert ( inst.code[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0286"} ).valueUri ) assert inst.communication[0].coding[0].code == "en" assert ( inst.communication[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:47"} ).valueUri ) assert inst.contact[0].telecom[0].system == "phone" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "(03) 5555 6473" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].use == "work" assert inst.contact[0].telecom[1].value == "adam.southern@example.org" assert inst.endpoint[0].reference == "Endpoint/example" assert inst.healthcareService[0].reference == "HealthcareService/example" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.acme.org/practitioners"} ).valueUri ) assert inst.identifier[0].value == "23" assert inst.location[0].display == "South Wing, second floor" assert inst.location[0].reference == "Location/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.organization.reference == "Organization/f001" assert ( inst.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-03-31"} ).valueDateTime ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-01-01"} ).valueDateTime ) assert inst.practitioner.display == "Dr Adam Careful" assert inst.practitioner.reference == "Practitioner/example" assert inst.specialty[0].coding[0].code == "408443003" assert inst.specialty[0].coding[0].display == "General medical practice" assert ( inst.specialty[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.text.status == "generated" def test_practitionerrole_1(base_settings): """No. 1 tests collection for PractitionerRole. Test File: practitionerrole-example.json """ filename = base_settings["unittest_data_dir"] / "practitionerrole-example.json" inst = practitionerrole.PractitionerRole.model_validate_json(filename.read_bytes()) assert "PractitionerRole" == inst.get_resource_type() impl_practitionerrole_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "PractitionerRole" == data["resourceType"] inst2 = practitionerrole.PractitionerRole(**data) impl_practitionerrole_1(inst2) ================================================ FILE: fhir/resources/tests/test_procedure.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Procedure Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import procedure from .conftest import ExternalValidatorModel def impl_procedure_1(inst): assert inst.bodySite[0].coding[0].code == "272676008" assert inst.bodySite[0].coding[0].display == "Sphenoid bone" assert ( inst.bodySite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.coding[0].code == "367336001" assert inst.code.coding[0].display == "Chemotherapy" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.encounter.display == "Roel's encounter on January 28th, 2013" assert inst.encounter.reference == "Encounter/f202" assert inst.id == "f201" assert ( inst.instantiatesCanonical[0] == "http://example.org/fhir/PlanDefinition/KDN5" ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == ( "Eerste neo-adjuvante TPF-kuur bij groot proces in sphenoid " "met intracraniale uitbreiding." ) assert ( inst.occurrencePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-28T14:27:00+01:00"} ).valueDateTime ) assert ( inst.occurrencePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-01-28T13:31:00+01:00"} ).valueDateTime ) assert inst.performer[0].actor.display == "Dokter Bronsig" assert inst.performer[0].actor.reference == "Practitioner/f201" assert inst.performer[0].function.coding[0].code == "310512001" assert inst.performer[0].function.coding[0].display == "Medical oncologist" assert ( inst.performer[0].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.reason[0].concept.text == "DiagnosticReport/f201" assert inst.status == "completed" assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" def test_procedure_1(base_settings): """No. 1 tests collection for Procedure. Test File: procedure-example-f201-tpf.json """ filename = base_settings["unittest_data_dir"] / "procedure-example-f201-tpf.json" inst = procedure.Procedure.model_validate_json(filename.read_bytes()) assert "Procedure" == inst.get_resource_type() impl_procedure_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Procedure" == data["resourceType"] inst2 = procedure.Procedure(**data) impl_procedure_1(inst2) def impl_procedure_2(inst): assert inst.basedOn[0].display == "Maternity care plan" assert inst.basedOn[0].reference == "CarePlan/preg" assert inst.code.coding[0].code == "62013009" assert inst.code.coding[0].display == "Ambulating patient (procedure)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Ambulation" assert inst.id == "ambulation" assert inst.identifier[0].value == "12345" assert ( inst.instantiatesUri[0] == ExternalValidatorModel.model_validate( { "valueUri": "http://example.org/protocol-for-hypertension-during-pregnancy" } ).valueUri ) assert ( inst.location.display == "Burgers University Medical Center, South Wing, second floor" ) assert inst.location.reference == "Location/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.display == "Maternity CareTeam" assert inst.performer[0].actor.reference == "CareTeam/example" assert inst.performer[0].onBehalfOf.display == "University Medical Hospital" assert inst.performer[0].onBehalfOf.reference == "Organization/f001" assert inst.reason[0].reference.display == "Blood Pressure" assert inst.reason[0].reference.reference == "Observation/blood-pressure" assert inst.status == "not-done" assert inst.statusReason.coding[0].code == "398254007" assert inst.statusReason.coding[0].display == " Pre-eclampsia (disorder)" assert ( inst.statusReason.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.statusReason.text == "Pre-eclampsia" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Ambulation ' "procedure was not done
" ) assert inst.text.status == "generated" def test_procedure_2(base_settings): """No. 2 tests collection for Procedure. Test File: procedure-example-ambulation.json """ filename = base_settings["unittest_data_dir"] / "procedure-example-ambulation.json" inst = procedure.Procedure.model_validate_json(filename.read_bytes()) assert "Procedure" == inst.get_resource_type() impl_procedure_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Procedure" == data["resourceType"] inst2 = procedure.Procedure(**data) impl_procedure_2(inst2) def impl_procedure_3(inst): assert inst.code.coding[0].code == "25267002" assert ( inst.code.coding[0].display == "Insertion of intracardiac pacemaker (procedure)" ) assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Implant Pacemaker" assert inst.contained[0].id == "example-pacemaker" assert inst.focalDevice[0].action.coding[0].code == "implanted" assert ( inst.focalDevice[0].action.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/device-action"} ).valueUri ) assert inst.focalDevice[0].manipulated.reference == "#example-pacemaker" assert inst.followUp[0].text == "ROS 5 days - 2013-04-10" assert inst.id == "example-implant" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == ( "Routine Appendectomy. Appendix was inflamed and in retro-" "caecal position" ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-04-05"} ).valueDateTime ) assert inst.performer[0].actor.display == "Dr Cecil Surgeon" assert inst.performer[0].actor.reference == "Practitioner/example" assert inst.reason[0].concept.text == "Bradycardia" assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_procedure_3(base_settings): """No. 3 tests collection for Procedure. Test File: procedure-example-implant.json """ filename = base_settings["unittest_data_dir"] / "procedure-example-implant.json" inst = procedure.Procedure.model_validate_json(filename.read_bytes()) assert "Procedure" == inst.get_resource_type() impl_procedure_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Procedure" == data["resourceType"] inst2 = procedure.Procedure(**data) impl_procedure_3(inst2) def impl_procedure_4(inst): assert inst.code.coding[0].code == "76164006" assert inst.code.coding[0].display == "Biopsy of colon (procedure)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Biopsy of colon" assert inst.id == "colon-biopsy" assert inst.identifier[0].value == "12345" assert ( inst.location.display == "Burgers University Medical Center, South Wing, second floor" ) assert inst.location.reference == "Location/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.partOf[0].display == "Colonoscopy" assert inst.partOf[0].reference == "Procedure/colonoscopy" assert inst.performer[0].actor.display == "Dr Adam Careful" assert inst.performer[0].actor.reference == "Practitioner/example" assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Biopsy of colon,' " which was part of colonoscopy
" ) assert inst.text.status == "generated" def test_procedure_4(base_settings): """No. 4 tests collection for Procedure. Test File: procedure-example-colon-biopsy.json """ filename = ( base_settings["unittest_data_dir"] / "procedure-example-colon-biopsy.json" ) inst = procedure.Procedure.model_validate_json(filename.read_bytes()) assert "Procedure" == inst.get_resource_type() impl_procedure_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Procedure" == data["resourceType"] inst2 = procedure.Procedure(**data) impl_procedure_4(inst2) def impl_procedure_5(inst): assert inst.bodySite[0].coding[0].code == "83030008" assert inst.bodySite[0].coding[0].display == "Retropharyngeal area" assert ( inst.bodySite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.coding[0].code == "48387007" assert inst.code.coding[0].display == "Tracheotomy" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.encounter.reference == "Encounter/f003" assert inst.followUp[0].text == "described in care plan" assert inst.id == "f004" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrencePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-22T10:30:10+01:00"} ).valueDateTime ) assert ( inst.occurrencePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-22T09:30:10+01:00"} ).valueDateTime ) assert inst.outcome.text == "removal of the retropharyngeal abscess" assert inst.performer[0].actor.display == "A. Langeveld" assert inst.performer[0].actor.reference == "Practitioner/f005" assert inst.performer[0].function.coding[0].code == "01.000" assert inst.performer[0].function.coding[0].display == "Arts" assert ( inst.performer[0].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.2.4.15.111"} ).valueUri ) assert inst.performer[0].function.text == "Care role" assert inst.reason[0].concept.text == "ensure breathing during surgery" assert inst.report[0].display == "???????????" assert inst.report[0].reference == "DiagnosticReport/f001" assert inst.status == "completed" assert inst.subject.display == "P. van de Heuvel" assert inst.subject.reference == "Patient/f001" assert inst.text.status == "generated" def test_procedure_5(base_settings): """No. 5 tests collection for Procedure. Test File: procedure-example-f004-tracheotomy.json """ filename = ( base_settings["unittest_data_dir"] / "procedure-example-f004-tracheotomy.json" ) inst = procedure.Procedure.model_validate_json(filename.read_bytes()) assert "Procedure" == inst.get_resource_type() impl_procedure_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Procedure" == data["resourceType"] inst2 = procedure.Procedure(**data) impl_procedure_5(inst2) def impl_procedure_6(inst): assert inst.basedOn[0].display == "Order for health education" assert inst.basedOn[0].reference == "ServiceRequest/education" assert inst.category[0].coding[0].code == "311401005" assert inst.category[0].coding[0].display == "Patient education (procedure)" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].text == "Education" assert inst.code.coding[0].code == "48023004" assert ( inst.code.coding[0].display == "Breast self-examination technique education (procedure)" ) assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Health education - breast examination" assert inst.id == "education" assert inst.location.display == "Southside Community Health Center" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.performer[0].actor.display == "Pamela Educator, RN" assert inst.reason[0].concept.text == "early detection of breast mass" assert inst.status == "completed" assert inst.subject.display == "Jane Doe" assert inst.text.div == ( '
Health education' " - breast examination for early detection of breast " "mass
" ) assert inst.text.status == "generated" def test_procedure_6(base_settings): """No. 6 tests collection for Procedure. Test File: procedure-example-education.json """ filename = base_settings["unittest_data_dir"] / "procedure-example-education.json" inst = procedure.Procedure.model_validate_json(filename.read_bytes()) assert "Procedure" == inst.get_resource_type() impl_procedure_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Procedure" == data["resourceType"] inst2 = procedure.Procedure(**data) impl_procedure_6(inst2) def impl_procedure_7(inst): assert inst.code.coding[0].code == "73761001" assert inst.code.coding[0].display == "Colonoscopy (procedure)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Colonoscopy" assert inst.complication[0].reference.display == "Perforated intestine condition" assert inst.id == "colonoscopy" assert inst.identifier[0].value == "12345" assert ( inst.location.display == "Burgers University Medical Center, South Wing, second floor" ) assert inst.location.reference == "Location/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].actor.display == "Dr Adam Careful" assert inst.performer[0].actor.reference == "Practitioner/example" assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Colonoscopy with' " complication
" ) assert inst.text.status == "generated" assert inst.used[0].reference.display == "Colonoscope device" def test_procedure_7(base_settings): """No. 7 tests collection for Procedure. Test File: procedure-example-colonoscopy.json """ filename = base_settings["unittest_data_dir"] / "procedure-example-colonoscopy.json" inst = procedure.Procedure.model_validate_json(filename.read_bytes()) assert "Procedure" == inst.get_resource_type() impl_procedure_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Procedure" == data["resourceType"] inst2 = procedure.Procedure(**data) impl_procedure_7(inst2) def impl_procedure_8(inst): assert ( inst.basedOn[0].display == "Order for the assessment of passive range of motion" ) assert inst.basedOn[0].reference == "ServiceRequest/physical-therapy" assert inst.bodySite[0].coding[0].code == "36701003" assert inst.bodySite[0].coding[0].display == "Both knees (body structure)" assert ( inst.bodySite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.bodySite[0].text == "Both knees" assert inst.category[0].coding[0].code == "386053000" assert inst.category[0].coding[0].display == "Evaluation procedure (procedure)" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].text == "Evaluation" assert inst.code.coding[0].code == "710830005" assert ( inst.code.coding[0].display == "Assessment of passive range of motion (procedure)" ) assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Assessment of passive range of motion" assert inst.id == "physical-therapy" assert inst.location.display == "Sawbones Orthopedic Clinic" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-09-27"} ).valueDateTime ) assert inst.performer[0].actor.display == "Paul Therapist, PT" assert ( inst.reason[0].concept.text == "assessment of mobility limitations due to osteoarthritis" ) assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Assessment of ' "passive range of motion for both knees on Sept 27, 2016 due " "to osteoarthritis
" ) assert inst.text.status == "generated" def test_procedure_8(base_settings): """No. 8 tests collection for Procedure. Test File: procedure-example-physical-therapy.json """ filename = ( base_settings["unittest_data_dir"] / "procedure-example-physical-therapy.json" ) inst = procedure.Procedure.model_validate_json(filename.read_bytes()) assert "Procedure" == inst.get_resource_type() impl_procedure_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Procedure" == data["resourceType"] inst2 = procedure.Procedure(**data) impl_procedure_8(inst2) def impl_procedure_9(inst): assert inst.bodySite[0].coding[0].code == "83030008" assert inst.bodySite[0].coding[0].display == "Retropharyngeal area" assert ( inst.bodySite[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.coding[0].code == "172960003" assert inst.code.coding[0].display == "Incision of retropharyngeal abscess" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.encounter.reference == "Encounter/f003" assert inst.followUp[0].text == "described in care plan" assert inst.id == "f003" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrencePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-24T10:30:10+01:00"} ).valueDateTime ) assert ( inst.occurrencePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-03-24T09:30:10+01:00"} ).valueDateTime ) assert inst.outcome.text == "removal of the retropharyngeal abscess" assert inst.performer[0].actor.display == "E.M.J.M. van den broek" assert inst.performer[0].actor.reference == "Practitioner/f001" assert inst.performer[0].function.coding[0].code == "01.000" assert inst.performer[0].function.coding[0].display == "Arts" assert ( inst.performer[0].function.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.2.4.15.111"} ).valueUri ) assert inst.performer[0].function.text == "Care role" assert inst.reason[0].concept.text == "abcess in retropharyngeal area" assert inst.report[0].display == "Lab results blood test" assert inst.report[0].reference == "DiagnosticReport/f001" assert inst.status == "completed" assert inst.subject.display == "P. van de Heuvel" assert inst.subject.reference == "Patient/f001" assert inst.text.status == "generated" def test_procedure_9(base_settings): """No. 9 tests collection for Procedure. Test File: procedure-example-f003-abscess.json """ filename = ( base_settings["unittest_data_dir"] / "procedure-example-f003-abscess.json" ) inst = procedure.Procedure.model_validate_json(filename.read_bytes()) assert "Procedure" == inst.get_resource_type() impl_procedure_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Procedure" == data["resourceType"] inst2 = procedure.Procedure(**data) impl_procedure_9(inst2) def impl_procedure_10(inst): assert inst.code.coding[0].code == "80146002" assert inst.code.coding[0].display == "Appendectomy (Procedure)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.text == "Appendectomy" assert inst.followUp[0].text == "ROS 5 days - 2013-04-10" assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.meta.versionId == "1" assert inst.note[0].text == ( "Routine Appendectomy. Appendix was inflamed and in retro-" "caecal position" ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-04-05"} ).valueDateTime ) assert inst.performer[0].actor.display == "Dr Cecil Surgeon" assert inst.performer[0].actor.reference == "Practitioner/example" assert inst.reason[0].concept.text == ( "Generalized abdominal pain 24 hours. Localized in RIF with " "rebound and guarding" ) assert inst.recorder.display == "Dr Cecil Surgeon" assert inst.recorder.reference == "Practitioner/example" assert inst.reportedReference.display == "Dr Cecil Surgeon" assert inst.reportedReference.reference == "Practitioner/example" assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.supportingInfo[0].reference == "ImagingStudy/example" assert inst.text.div == ( '
Routine ' "Appendectomy
" ) assert inst.text.status == "generated" def test_procedure_10(base_settings): """No. 10 tests collection for Procedure. Test File: procedure-example.json """ filename = base_settings["unittest_data_dir"] / "procedure-example.json" inst = procedure.Procedure.model_validate_json(filename.read_bytes()) assert "Procedure" == inst.get_resource_type() impl_procedure_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Procedure" == data["resourceType"] inst2 = procedure.Procedure(**data) impl_procedure_10(inst2) ================================================ FILE: fhir/resources/tests/test_provenance.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Provenance Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import provenance from .conftest import ExternalValidatorModel 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-DocumentCompletion"} ).valueUri ) assert inst.agent[0].type.coding[0].code == "VERF" assert ( inst.agent[0].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/contractsignertypecodes" } ).valueUri ) assert ( inst.agent[0].who.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.agent[0].who.identifier.value == "mailto://hhd@ssa.gov" assert inst.authorization[0].concept.coding[0].code == "TREAT" assert inst.authorization[0].concept.coding[0].display == "treatment" assert ( inst.authorization[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2015-08-27T08:39:24+10:00"} ).valueInstant ) assert ( inst.signature[0].data == ExternalValidatorModel.model_validate( {"valueBase64Binary": "Li4u"} ).valueBase64Binary ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso-astm:E1762-95:2013"} ).valueUri ) assert ( inst.signature[0].when == ExternalValidatorModel.model_validate( {"valueInstant": "2015-08-27T08:39:24+10:00"} ).valueInstant ) assert inst.signature[0].who.reference == "Practitioner/xcda-author" assert inst.target[0].reference == "DocumentReference/example/_history/4" assert inst.text.status == "generated" def test_provenance_1(base_settings): """No. 1 tests collection for Provenance. Test File: provenance-example-sig.json """ filename = base_settings["unittest_data_dir"] / "provenance-example-sig.json" inst = provenance.Provenance.model_validate_json(filename.read_bytes()) assert "Provenance" == inst.get_resource_type() impl_provenance_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Provenance" == data["resourceType"] inst2 = provenance.Provenance(**data) impl_provenance_1(inst2) def impl_provenance_2(inst): assert inst.activity.coding[0].code == "originate" assert ( inst.activity.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/iso-21089-lifecycle"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.agent[0].who.display == "myMachine.example.org" assert inst.agent[1].type.coding[0].code == "110152" assert inst.agent[1].type.coding[0].display == "Destination Role ID" assert ( inst.agent[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://dicom.nema.org/resources/ontology/DCM"} ).valueUri ) assert inst.agent[1].who.reference == "Device/example" assert inst.agent[2].type.coding[0].code == "INF" assert inst.agent[2].type.coding[0].display == "Informant" assert ( inst.agent[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.agent[2].who.display == "Betty Jones" assert inst.authorization[0].concept.coding[0].code == "TREAT" assert ( inst.authorization[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.basedOn[0].reference == "CarePlan/example" assert inst.encounter.reference == "Encounter/home" assert inst.id == "example-advanced" assert inst.location.reference == "Location/1/_history/1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurredDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2020-04-29T09:49:00.000Z"} ).valueDateTime ) assert inst.patient.reference == "Patient/example" assert ( inst.policy[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/policy/1234"} ).valueUri ) assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2020-04-29T09:49:00.000Z"} ).valueInstant ) assert inst.signature[0].sigFormat == "image/jpeg" 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 == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso-astm:E1762-95:2013"} ).valueUri ) assert ( inst.signature[0].when == ExternalValidatorModel.model_validate( {"valueInstant": "2020-04-29T09:49:00.000Z"} ).valueInstant ) assert inst.signature[0].who.display == "Betty Jones" assert inst.target[0].reference == "List/example" assert inst.text.status == "generated" def test_provenance_2(base_settings): """No. 2 tests collection for Provenance. Test File: provenance-example-advanced.json """ filename = base_settings["unittest_data_dir"] / "provenance-example-advanced.json" inst = provenance.Provenance.model_validate_json(filename.read_bytes()) assert "Provenance" == inst.get_resource_type() impl_provenance_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Provenance" == data["resourceType"] inst2 = provenance.Provenance(**data) impl_provenance_2(inst2) def impl_provenance_3(inst): assert inst.agent[0].type.coding[0].code == "INF" assert ( inst.agent[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.agent[0].who.reference == "Patient/pat3" assert inst.id == "example1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2021-12-07T12:23:45+11:00"} ).valueInstant ) assert ( inst.target[0].extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/targetElement"} ).valueUri ) assert ( inst.target[0].extension[0].valueUri == ExternalValidatorModel.model_validate({"valueUri": "n1"}).valueUri ) assert inst.target[0].reference == "Patient/pat3/_history/1" assert inst.text.status == "generated" def test_provenance_3(base_settings): """No. 3 tests collection for Provenance. Test File: provenance-example1.json """ filename = base_settings["unittest_data_dir"] / "provenance-example1.json" inst = provenance.Provenance.model_validate_json(filename.read_bytes()) assert "Provenance" == inst.get_resource_type() impl_provenance_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Provenance" == data["resourceType"] inst2 = provenance.Provenance(**data) impl_provenance_3(inst2) def impl_provenance_4(inst): assert inst.activity.coding[0].code == "AU" assert inst.activity.coding[0].display == "authenticated" assert ( inst.activity.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-DocumentCompletion"} ).valueUri ) assert inst.agent[0].role[0].coding[0].code == "AUT" assert ( inst.agent[0].role[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2016-05-26T00:41:10-04:00"} ).valueInstant ) assert ( inst.signature[0].data == ExternalValidatorModel.model_validate( {"valueBase64Binary": "dGhpcyBibG9iIGlzIHNuaXBwZWQ="} ).valueBase64Binary ) 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 == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso-astm:E1762-95:2013"} ).valueUri ) assert ( inst.signature[0].when == ExternalValidatorModel.model_validate( {"valueInstant": "2016-05-26T00:41:10-04:00"} ).valueInstant ) assert inst.signature[0].who.reference == "Patient/72" assert inst.target[0].reference == "Consent/consent-example-basic/_history/1" assert inst.text.status == "generated" def test_provenance_4(base_settings): """No. 4 tests collection for Provenance. Test File: provenance-consent-signature.json """ filename = base_settings["unittest_data_dir"] / "provenance-consent-signature.json" inst = provenance.Provenance.model_validate_json(filename.read_bytes()) assert "Provenance" == inst.get_resource_type() impl_provenance_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Provenance" == data["resourceType"] inst2 = provenance.Provenance(**data) impl_provenance_4(inst2) def impl_provenance_5(inst): assert inst.activity.coding[0].code == "CREATE" assert inst.activity.coding[0].display == "create" assert ( inst.activity.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-DataOperation"} ).valueUri ) assert inst.activity.text == ( "profiling Short Tandem Repeats (STRs) from high throughput " "sequencing data." ) assert inst.agent[0].type.coding[0].code == "AUT" assert ( inst.agent[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.agent[0].who.reference == "Patient/example" assert inst.entity[0].role == "source" assert inst.entity[0].what.identifier.type.coding[0].code == "CWL" assert inst.entity[0].what.identifier.type.coding[0].display == "lobSTR" assert ( inst.entity[0].what.identifier.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://github.com/common-workflow-language/workflows"} ).valueUri ) assert inst.entity[0].what.identifier.value == ( "https://github.com/common-workflow-" "language/workflows/blob/master/workflows/lobSTR/lobSTR-" "workflow.cwl" ) assert inst.id == "example-cwl" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurredPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-11-30"} ).valueDateTime ) assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2016-12-01T08:12:14+10:00"} ).valueInstant ) assert inst.target[0].reference == "MolecularSequence/example-pgx-1/_history/1" assert inst.text.status == "generated" def test_provenance_5(base_settings): """No. 5 tests collection for Provenance. Test File: provenance-example-cwl.json """ filename = base_settings["unittest_data_dir"] / "provenance-example-cwl.json" inst = provenance.Provenance.model_validate_json(filename.read_bytes()) assert "Provenance" == inst.get_resource_type() impl_provenance_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Provenance" == data["resourceType"] inst2 = provenance.Provenance(**data) impl_provenance_5(inst2) def impl_provenance_6(inst): assert inst.activity.coding[0].code == "CREATE" assert inst.activity.coding[0].display == "create" assert ( inst.activity.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-DataOperation"} ).valueUri ) assert inst.agent[0].type.coding[0].code == "assembler" assert inst.agent[0].type.coding[0].display == "Assembler" assert ( inst.agent[0].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/provenance-participant-type" } ).valueUri ) assert inst.agent[0].who.display == "LEAP Consent Management Service" assert inst.entity[0].role == "source" assert inst.entity[0].what.reference == ( "http://example.org/fhir/QuestionnaireResponse/some-" "questionnaire-response" ) assert inst.id == "example-create-consent" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2021-09-10T07:08:21.722+00:00"} ).valueInstant ) assert inst.target[0].reference == "Consent/consent-example-basic/_history/1" assert inst.text.status == "generated" def test_provenance_6(base_settings): """No. 6 tests collection for Provenance. Test File: provenance-example-create-consent.json """ filename = ( base_settings["unittest_data_dir"] / "provenance-example-create-consent.json" ) inst = provenance.Provenance.model_validate_json(filename.read_bytes()) assert "Provenance" == inst.get_resource_type() impl_provenance_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Provenance" == data["resourceType"] inst2 = provenance.Provenance(**data) impl_provenance_6(inst2) def impl_provenance_7(inst): assert inst.activity.coding[0].code == "DELETE" assert ( inst.activity.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-DataOperation"} ).valueUri ) assert inst.agent[0].type.coding[0].code == "author" assert ( inst.agent[0].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/provenance-participant-type" } ).valueUri ) assert inst.agent[0].who.display == "Brian Postlethwaite" assert inst.authorization[0].concept.coding[0].code == "METAMGT" assert ( inst.authorization[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.entity[0].role == "source" assert inst.entity[0].what.reference == ( "http://terminology.hl7.org/CodeSystem/location-physical-" "type/_history/3" ) assert inst.id == "example-delete" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2015-06-27T08:39:24+10:00"} ).valueInstant ) assert inst.target[0].reference == ( "http://terminology.hl7.org/CodeSystem/location-physical-" "type/_history/3" ) assert inst.text.status == "generated" def test_provenance_7(base_settings): """No. 7 tests collection for Provenance. Test File: provenance-example-delete.json """ filename = base_settings["unittest_data_dir"] / "provenance-example-delete.json" inst = provenance.Provenance.model_validate_json(filename.read_bytes()) assert "Provenance" == inst.get_resource_type() impl_provenance_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Provenance" == data["resourceType"] inst2 = provenance.Provenance(**data) impl_provenance_7(inst2) def impl_provenance_8(inst): assert inst.agent[0].type.coding[0].code == "INF" assert ( inst.agent[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.agent[0].who.reference == "RelatedPerson/f001" assert inst.id == "example2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2021-12-08T16:54:24+11:00"} ).valueInstant ) assert ( inst.target[0].extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/targetElement"} ).valueUri ) assert ( inst.target[0].extension[0].valueUri == ExternalValidatorModel.model_validate({"valueUri": "n2"}).valueUri ) assert inst.target[0].reference == "Patient/pat3/_history/1" assert inst.text.status == "generated" def test_provenance_8(base_settings): """No. 8 tests collection for Provenance. Test File: provenance-example2.json """ filename = base_settings["unittest_data_dir"] / "provenance-example2.json" inst = provenance.Provenance.model_validate_json(filename.read_bytes()) assert "Provenance" == inst.get_resource_type() impl_provenance_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Provenance" == data["resourceType"] inst2 = provenance.Provenance(**data) impl_provenance_8(inst2) def impl_provenance_9(inst): assert inst.activity.coding[0].code == "CREATE" assert inst.activity.coding[0].display == "create" assert ( inst.activity.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-DataOperation"} ).valueUri ) assert inst.activity.text == "antiviral resistance detection" assert inst.agent[0].type.coding[0].code == "AUT" assert ( inst.agent[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"} ).valueUri ) assert inst.agent[0].who.reference == "Practitioner/example" assert inst.entity[0].role == "source" assert inst.entity[0].what.identifier.type.coding[0].code == "biocompute" assert inst.entity[0].what.identifier.type.coding[0].display == "obj.1001" assert ( inst.entity[0].what.identifier.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://hive.biochemistry.gwu.edu"} ).valueUri ) assert inst.entity[0].what.identifier.value == ( "https://hive.biochemistry.gwu.edu/cgi-" "bin/prd/htscsrs/servlet.cgi?pageid=bcoexample_1" ) assert inst.id == "example-biocompute-object" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurredPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-06-06"} ).valueDateTime ) assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2016-06-09T08:12:14+10:00"} ).valueInstant ) assert inst.target[0].reference == "MolecularSequence/example/_history/1" assert inst.text.status == "generated" def test_provenance_9(base_settings): """No. 9 tests collection for Provenance. Test File: provenance-example-biocompute-object.json """ filename = ( base_settings["unittest_data_dir"] / "provenance-example-biocompute-object.json" ) inst = provenance.Provenance.model_validate_json(filename.read_bytes()) assert "Provenance" == inst.get_resource_type() impl_provenance_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Provenance" == data["resourceType"] inst2 = provenance.Provenance(**data) impl_provenance_9(inst2) def impl_provenance_10(inst): assert inst.activity.coding[0].code == "verify" assert ( inst.activity.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/iso-21089-lifecycle"} ).valueUri ) assert inst.agent[0].type.coding[0].code == "verifier" assert inst.agent[0].type.coding[0].display == "Verifier" assert ( inst.agent[0].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/provenance-participant-type" } ).valueUri ) assert ( inst.agent[0].who.reference == "Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" ) assert inst.id == "example-diagnosticreport-sig" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/pat2" assert ( inst.policy[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/policy/Reviewed"} ).valueUri ) assert ( inst.recorded == ExternalValidatorModel.model_validate( {"valueInstant": "2011-03-04T08:30:00+11:00"} ).valueInstant ) assert inst.signature[0].type[0].code == "ProofOfapproval" assert inst.signature[0].type[0].display == "Proof of approval" assert ( inst.signature[0].type[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://uri.etsi.org/01903/v1.2.2"} ).valueUri ) assert ( inst.signature[0].when == ExternalValidatorModel.model_validate( {"valueInstant": "2011-03-04T08:30:00+11:00"} ).valueInstant ) assert ( inst.signature[0].who.reference == "Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" ) assert inst.target[0].reference == "DiagnosticReport/101" assert inst.text.status == "generated" def test_provenance_10(base_settings): """No. 10 tests collection for Provenance. Test File: provenance-example-diagnosticreport-sig.json """ filename = ( base_settings["unittest_data_dir"] / "provenance-example-diagnosticreport-sig.json" ) inst = provenance.Provenance.model_validate_json(filename.read_bytes()) assert "Provenance" == inst.get_resource_type() impl_provenance_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Provenance" == data["resourceType"] inst2 = provenance.Provenance(**data) impl_provenance_10(inst2) ================================================ FILE: fhir/resources/tests/test_questionnaire.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Questionnaire Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import questionnaire from .conftest import ExternalValidatorModel def impl_questionnaire_1(inst): assert inst.contained[0].id == "vs2" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.experimental is False assert inst.id == "qgen-Person1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.item[0].item[0].linkId == "Person-display" assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].linkId == "Person-flyover" assert inst.item[0].item[1].text == ( "Demographics and administrative information about a person " "independent of a specific health-related context." ) assert inst.item[0].item[1].type == "display" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[2].extension[1].valueString == "string" assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].linkId == "Person.id-flyover" assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].item[1].linkId == "Person.id.value" assert inst.item[0].item[2].item[1].repeats is False assert inst.item[0].item[2].item[1].required is False assert inst.item[0].item[2].item[1].text == "Logical id of this artifact" assert inst.item[0].item[2].item[1].type == "string" assert inst.item[0].item[2].linkId == "Person.id" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[3].item[0].linkId == "Person.meta-flyover" assert inst.item[0].item[3].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content " "might not always be associated with version changes to the " "resource." ) assert inst.item[0].item[3].item[0].type == "display" assert inst.item[0].item[3].linkId == "Person.meta" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].text == "Metadata about the resource" assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "uri" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[4].item[0].linkId == "Person.implicitRules-flyover" assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].linkId == "Person.implicitRules.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert ( inst.item[0].item[4].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[4].item[1].type == "string" assert inst.item[0].item[4].linkId == "Person.implicitRules" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[5].extension[1].valueString == "code" assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].linkId == "Person.language-flyover" assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].item[1].answerConstraint == "optionsOrType" assert inst.item[0].item[5].item[1].linkId == "Person.language.value" assert inst.item[0].item[5].item[1].repeats is False assert inst.item[0].item[5].item[1].required is False assert inst.item[0].item[5].item[1].text == "language" assert inst.item[0].item[5].item[1].type == "coding" assert inst.item[0].item[5].linkId == "Person.language" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[6].extension[0].valueInteger == 1 assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[6].item[0].linkId == "Person.text-flyover" assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "Person.text" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert ( inst.item[0].item[6].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[7].item[0].linkId == "Person.contained-flyover" assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "Person.contained" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Contained, inline Resources" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[8].item[0].linkId == "Person.extension-flyover" assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "Person.extension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Additional content defined by implementations" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[9].item[0].linkId == "Person.modifierExtension-flyover" assert inst.item[0].item[9].item[0].type == "display" assert inst.item[0].item[9].linkId == "Person.modifierExtension" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].text == "Extensions that cannot be ignored" assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "Person" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == "A generic person record" assert inst.item[0].type == "group" assert inst.publisher == "Health Level Seven International (Patient Administration)" assert inst.status == "draft" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/Questionnaire/qgen-Person1"} ).valueUri ) assert inst.version == "5.0.0" def test_questionnaire_1(base_settings): """No. 1 tests collection for Questionnaire. Test File: person-questionnaire.json """ filename = base_settings["unittest_data_dir"] / "person-questionnaire.json" inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_1(inst2) def impl_questionnaire_2(inst): assert inst.contained[0].id == "vs2" assert inst.contained[1].id == "vs3" assert inst.contained[2].id == "vs4" assert inst.contained[3].id == "vs5" assert inst.contained[4].id == "vs6" assert inst.contained[5].id == "vs7" assert inst.contained[6].id == "vs8" assert inst.contained[7].id == "vs9" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.experimental is False assert inst.id == "qgen-RequestOrchestration1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.item[0].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[0].linkId == "RequestOrchestration-flyover" assert inst.item[0].item[0].text == ( "A set of related requests that can be used to capture " "intended activities that have inter-dependencies such as " '"give this medication after that one".' ) assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[1].extension[0].valueInteger == 1 assert ( inst.item[0].item[1].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[1].extension[1].valueString == "string" assert ( inst.item[0].item[1].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].item[0].linkId == "RequestOrchestration.id-flyover" assert inst.item[0].item[1].item[0].type == "display" assert inst.item[0].item[1].item[1].linkId == "RequestOrchestration.id.value" assert inst.item[0].item[1].item[1].repeats is False assert inst.item[0].item[1].item[1].required is False assert inst.item[0].item[1].item[1].text == "Logical id of this artifact" assert inst.item[0].item[1].item[1].type == "string" assert inst.item[0].item[1].linkId == "RequestOrchestration.id" assert inst.item[0].item[1].repeats is True assert inst.item[0].item[1].required is False assert inst.item[0].item[1].type == "group" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].linkId == "RequestOrchestration.meta-flyover" assert inst.item[0].item[2].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content " "might not always be associated with version changes to the " "resource." ) assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].linkId == "RequestOrchestration.meta" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].text == "Metadata about the resource" assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[3].extension[1].valueString == "uri" assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[3].item[0].linkId == "RequestOrchestration.implicitRules-flyover" ) assert inst.item[0].item[3].item[0].type == "display" assert ( inst.item[0].item[3].item[1].linkId == "RequestOrchestration.implicitRules.value" ) assert inst.item[0].item[3].item[1].repeats is False assert inst.item[0].item[3].item[1].required is False assert ( inst.item[0].item[3].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[3].item[1].type == "string" assert inst.item[0].item[3].linkId == "RequestOrchestration.implicitRules" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "code" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[4].item[0].linkId == "RequestOrchestration.language-flyover" ) assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].answerConstraint == "optionsOrType" assert inst.item[0].item[4].item[1].linkId == "RequestOrchestration.language.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert inst.item[0].item[4].item[1].text == "language" assert inst.item[0].item[4].item[1].type == "coding" assert inst.item[0].item[4].linkId == "RequestOrchestration.language" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].linkId == "RequestOrchestration.text-flyover" assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].linkId == "RequestOrchestration.text" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert ( inst.item[0].item[5].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[6].item[0].linkId == "RequestOrchestration.contained-flyover" ) assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "RequestOrchestration.contained" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert inst.item[0].item[6].text == "Contained, inline Resources" assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[7].item[0].linkId == "RequestOrchestration.extension-flyover" ) assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "RequestOrchestration.extension" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Additional content defined by implementations" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[8].item[0].linkId == "RequestOrchestration.modifierExtension-flyover" ) assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "RequestOrchestration.modifierExtension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Extensions that cannot be ignored" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[9].extension[0].valueString == "Identifier" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[9].item[0].linkId == "RequestOrchestration.identifier-flyover" ) assert inst.item[0].item[9].item[0].text == ( "Allows a service to provide a unique, business identifier " "for the request." ) assert inst.item[0].item[9].item[0].type == "display" assert ( inst.item[0].item[9].item[1].linkId == "RequestOrchestration.identifier.label" ) assert inst.item[0].item[9].item[1].repeats is False assert inst.item[0].item[9].item[1].required is False assert inst.item[0].item[9].item[1].text == "label:" assert inst.item[0].item[9].item[1].type == "string" assert ( inst.item[0].item[9].item[2].linkId == "RequestOrchestration.identifier.system" ) assert inst.item[0].item[9].item[2].repeats is False assert inst.item[0].item[9].item[2].required is False assert inst.item[0].item[9].item[2].text == "system:" assert inst.item[0].item[9].item[2].type == "string" assert ( inst.item[0].item[9].item[3].linkId == "RequestOrchestration.identifier.value" ) assert inst.item[0].item[9].item[3].repeats is False assert inst.item[0].item[9].item[3].required is False assert inst.item[0].item[9].item[3].text == "value:" assert inst.item[0].item[9].item[3].type == "string" assert inst.item[0].item[9].linkId == "RequestOrchestration.identifier" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].text == "Business identifier" assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "RequestOrchestration" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == "A set of related requests" assert inst.item[0].type == "group" assert ( inst.publisher == "Health Level Seven International (Clinical Decision Support)" ) assert inst.status == "draft" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/Questionnaire/qgen-RequestOrchestration1"} ).valueUri ) assert inst.version == "5.0.0" def test_questionnaire_2(base_settings): """No. 2 tests collection for Questionnaire. Test File: requestorchestration-questionnaire.json """ filename = ( base_settings["unittest_data_dir"] / "requestorchestration-questionnaire.json" ) inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_2(inst2) def impl_questionnaire_3(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.experimental is False assert inst.id == "qgen-OperationOutcome1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.item[0].item[0].linkId == "OperationOutcome-display" assert inst.item[0].item[0].text == ( "Can result from the failure of a REST call or be part of the" " response message returned from a request message." ) assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].linkId == "OperationOutcome-flyover" assert inst.item[0].item[1].text == ( "A collection of error, warning, or information messages that" " result from a system action." ) assert inst.item[0].item[1].type == "display" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[2].extension[1].valueString == "string" assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].linkId == "OperationOutcome.id-flyover" assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].item[1].linkId == "OperationOutcome.id.value" assert inst.item[0].item[2].item[1].repeats is False assert inst.item[0].item[2].item[1].required is False assert inst.item[0].item[2].item[1].text == "Logical id of this artifact" assert inst.item[0].item[2].item[1].type == "string" assert inst.item[0].item[2].linkId == "OperationOutcome.id" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[3].item[0].linkId == "OperationOutcome.meta-flyover" assert inst.item[0].item[3].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content " "might not always be associated with version changes to the " "resource." ) assert inst.item[0].item[3].item[0].type == "display" assert inst.item[0].item[3].linkId == "OperationOutcome.meta" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].text == "Metadata about the resource" assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "uri" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[4].item[0].linkId == "OperationOutcome.implicitRules-flyover" ) assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].linkId == "OperationOutcome.implicitRules.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert ( inst.item[0].item[4].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[4].item[1].type == "string" assert inst.item[0].item[4].linkId == "OperationOutcome.implicitRules" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[5].extension[1].valueString == "code" assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].linkId == "OperationOutcome.language-flyover" assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].item[1].answerConstraint == "optionsOrType" assert inst.item[0].item[5].item[1].linkId == "OperationOutcome.language.value" assert inst.item[0].item[5].item[1].repeats is False assert inst.item[0].item[5].item[1].required is False assert inst.item[0].item[5].item[1].text == "language" assert inst.item[0].item[5].item[1].type == "coding" assert inst.item[0].item[5].linkId == "OperationOutcome.language" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[6].extension[0].valueInteger == 1 assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[6].item[0].linkId == "OperationOutcome.text-flyover" assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "OperationOutcome.text" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert ( inst.item[0].item[6].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[7].item[0].linkId == "OperationOutcome.contained-flyover" assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "OperationOutcome.contained" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Contained, inline Resources" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[8].item[0].linkId == "OperationOutcome.extension-flyover" assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "OperationOutcome.extension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Additional content defined by implementations" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[9].item[0].linkId == "OperationOutcome.modifierExtension-flyover" ) assert inst.item[0].item[9].item[0].type == "display" assert inst.item[0].item[9].linkId == "OperationOutcome.modifierExtension" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].text == "Extensions that cannot be ignored" assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "OperationOutcome" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == "Information about the success/failure of an action" assert inst.item[0].type == "group" assert inst.publisher == "Health Level Seven International (FHIR Infrastructure)" assert inst.status == "active" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/Questionnaire/qgen-OperationOutcome1"} ).valueUri ) assert inst.version == "5.0.0" def test_questionnaire_3(base_settings): """No. 3 tests collection for Questionnaire. Test File: operationoutcome-questionnaire.json """ filename = ( base_settings["unittest_data_dir"] / "operationoutcome-questionnaire.json" ) inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_3(inst2) def impl_questionnaire_4(inst): assert inst.contained[0].id == "vs2" assert inst.contained[1].id == "vs3" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.experimental is False assert inst.id == "qgen-EventDefinition1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.item[0].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[0].linkId == "EventDefinition-flyover" assert inst.item[0].item[0].text == ( "The EventDefinition resource provides a reusable description" " of when a particular event can occur." ) assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[1].extension[0].valueInteger == 1 assert ( inst.item[0].item[1].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[1].extension[1].valueString == "string" assert ( inst.item[0].item[1].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].item[0].linkId == "EventDefinition.id-flyover" assert inst.item[0].item[1].item[0].type == "display" assert inst.item[0].item[1].item[1].linkId == "EventDefinition.id.value" assert inst.item[0].item[1].item[1].repeats is False assert inst.item[0].item[1].item[1].required is False assert inst.item[0].item[1].item[1].text == "Logical id of this artifact" assert inst.item[0].item[1].item[1].type == "string" assert inst.item[0].item[1].linkId == "EventDefinition.id" assert inst.item[0].item[1].repeats is True assert inst.item[0].item[1].required is False assert inst.item[0].item[1].type == "group" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].linkId == "EventDefinition.meta-flyover" assert inst.item[0].item[2].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content " "might not always be associated with version changes to the " "resource." ) assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].linkId == "EventDefinition.meta" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].text == "Metadata about the resource" assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[3].extension[1].valueString == "uri" assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[3].item[0].linkId == "EventDefinition.implicitRules-flyover" ) assert inst.item[0].item[3].item[0].type == "display" assert inst.item[0].item[3].item[1].linkId == "EventDefinition.implicitRules.value" assert inst.item[0].item[3].item[1].repeats is False assert inst.item[0].item[3].item[1].required is False assert ( inst.item[0].item[3].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[3].item[1].type == "string" assert inst.item[0].item[3].linkId == "EventDefinition.implicitRules" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "code" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[4].item[0].linkId == "EventDefinition.language-flyover" assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].answerConstraint == "optionsOrType" assert inst.item[0].item[4].item[1].linkId == "EventDefinition.language.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert inst.item[0].item[4].item[1].text == "language" assert inst.item[0].item[4].item[1].type == "coding" assert inst.item[0].item[4].linkId == "EventDefinition.language" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].linkId == "EventDefinition.text-flyover" assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].linkId == "EventDefinition.text" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert ( inst.item[0].item[5].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[6].item[0].linkId == "EventDefinition.contained-flyover" assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "EventDefinition.contained" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert inst.item[0].item[6].text == "Contained, inline Resources" assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[7].item[0].linkId == "EventDefinition.extension-flyover" assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "EventDefinition.extension" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Additional content defined by implementations" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[8].item[0].linkId == "EventDefinition.modifierExtension-flyover" ) assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "EventDefinition.modifierExtension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Extensions that cannot be ignored" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[9].extension[0].valueInteger == 1 assert ( inst.item[0].item[9].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[9].extension[1].valueString == "uri" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[9].item[0].linkId == "EventDefinition.url-flyover" assert inst.item[0].item[9].item[0].type == "display" assert inst.item[0].item[9].item[1].linkId == "EventDefinition.url.value" assert inst.item[0].item[9].item[1].repeats is False assert inst.item[0].item[9].item[1].required is False assert inst.item[0].item[9].item[1].text == ( "Canonical identifier for this event definition, represented " "as a URI (globally unique)" ) assert inst.item[0].item[9].item[1].type == "string" assert inst.item[0].item[9].linkId == "EventDefinition.url" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "EventDefinition" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == "A description of when an event can occur" assert inst.item[0].type == "group" assert ( inst.publisher == "Health Level Seven International (Clinical Decision Support)" ) assert inst.status == "draft" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/Questionnaire/qgen-EventDefinition1"} ).valueUri ) assert inst.version == "5.0.0" def test_questionnaire_4(base_settings): """No. 4 tests collection for Questionnaire. Test File: eventdefinition-questionnaire.json """ filename = base_settings["unittest_data_dir"] / "eventdefinition-questionnaire.json" inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_4(inst2) def impl_questionnaire_5(inst): assert inst.contained[0].id == "vs2" assert inst.contained[1].id == "vs3" assert inst.contained[2].id == "vs4" assert inst.contained[3].id == "vs5" assert inst.contained[4].id == "vs6" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.experimental is False assert inst.id == "qgen-ActivityDefinition1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.item[0].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[0].linkId == "ActivityDefinition-flyover" assert inst.item[0].item[0].text == ( "This resource allows for the definition of some activity to " "be performed, independent of a particular patient, " "practitioner, or other performance context." ) assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[1].extension[0].valueInteger == 1 assert ( inst.item[0].item[1].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[1].extension[1].valueString == "string" assert ( inst.item[0].item[1].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].item[0].linkId == "ActivityDefinition.id-flyover" assert inst.item[0].item[1].item[0].type == "display" assert inst.item[0].item[1].item[1].linkId == "ActivityDefinition.id.value" assert inst.item[0].item[1].item[1].repeats is False assert inst.item[0].item[1].item[1].required is False assert inst.item[0].item[1].item[1].text == "Logical id of this artifact" assert inst.item[0].item[1].item[1].type == "string" assert inst.item[0].item[1].linkId == "ActivityDefinition.id" assert inst.item[0].item[1].repeats is True assert inst.item[0].item[1].required is False assert inst.item[0].item[1].type == "group" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].linkId == "ActivityDefinition.meta-flyover" assert inst.item[0].item[2].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content " "might not always be associated with version changes to the " "resource." ) assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].linkId == "ActivityDefinition.meta" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].text == "Metadata about the resource" assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[3].extension[1].valueString == "uri" assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[3].item[0].linkId == "ActivityDefinition.implicitRules-flyover" ) assert inst.item[0].item[3].item[0].type == "display" assert ( inst.item[0].item[3].item[1].linkId == "ActivityDefinition.implicitRules.value" ) assert inst.item[0].item[3].item[1].repeats is False assert inst.item[0].item[3].item[1].required is False assert ( inst.item[0].item[3].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[3].item[1].type == "string" assert inst.item[0].item[3].linkId == "ActivityDefinition.implicitRules" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "code" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[4].item[0].linkId == "ActivityDefinition.language-flyover" assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].answerConstraint == "optionsOrType" assert inst.item[0].item[4].item[1].linkId == "ActivityDefinition.language.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert inst.item[0].item[4].item[1].text == "language" assert inst.item[0].item[4].item[1].type == "coding" assert inst.item[0].item[4].linkId == "ActivityDefinition.language" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].linkId == "ActivityDefinition.text-flyover" assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].linkId == "ActivityDefinition.text" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert ( inst.item[0].item[5].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[6].item[0].linkId == "ActivityDefinition.contained-flyover" assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "ActivityDefinition.contained" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert inst.item[0].item[6].text == "Contained, inline Resources" assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[7].item[0].linkId == "ActivityDefinition.extension-flyover" assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "ActivityDefinition.extension" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Additional content defined by implementations" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[8].item[0].linkId == "ActivityDefinition.modifierExtension-flyover" ) assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "ActivityDefinition.modifierExtension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Extensions that cannot be ignored" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[9].extension[0].valueInteger == 1 assert ( inst.item[0].item[9].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[9].extension[1].valueString == "uri" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[9].item[0].linkId == "ActivityDefinition.url-flyover" assert inst.item[0].item[9].item[0].type == "display" assert inst.item[0].item[9].item[1].linkId == "ActivityDefinition.url.value" assert inst.item[0].item[9].item[1].repeats is False assert inst.item[0].item[9].item[1].required is False assert inst.item[0].item[9].item[1].text == ( "Canonical identifier for this activity definition, " "represented as a URI (globally unique)" ) assert inst.item[0].item[9].item[1].type == "string" assert inst.item[0].item[9].linkId == "ActivityDefinition.url" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "ActivityDefinition" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == ( "The definition of a specific activity to be taken, " "independent of any particular patient or context" ) assert inst.item[0].type == "group" assert ( inst.publisher == "Health Level Seven International (Clinical Decision Support)" ) assert inst.status == "draft" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/Questionnaire/qgen-ActivityDefinition1"} ).valueUri ) assert inst.version == "5.0.0" def test_questionnaire_5(base_settings): """No. 5 tests collection for Questionnaire. Test File: activitydefinition-questionnaire.json """ filename = ( base_settings["unittest_data_dir"] / "activitydefinition-questionnaire.json" ) inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_5(inst2) def impl_questionnaire_6(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2020-12-28T16:55:11+11:00"} ).valueDateTime ) assert inst.experimental is False assert inst.id == "qgen-cdshooksguidanceresponse1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs" } ).valueUri ) assert inst.item[0].extension[0].valueInteger == 1 assert ( inst.item[0].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].extension[1].valueInteger == 1 assert ( inst.item[0].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[0].linkId == "GuidanceResponse-flyover" assert inst.item[0].item[0].text == ( "A guidance response is the formal response to a guidance " "request, including any output parameters returned by the " "evaluation, as well as the description of any proposed " "actions to be taken." ) assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[1].extension[0].valueInteger == 1 assert ( inst.item[0].item[1].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[1].extension[1].valueString == "string" assert ( inst.item[0].item[1].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].item[0].linkId == "GuidanceResponse.id-flyover" assert inst.item[0].item[1].item[0].type == "display" assert inst.item[0].item[1].item[1].linkId == "GuidanceResponse.id.value" assert inst.item[0].item[1].item[1].repeats is False assert inst.item[0].item[1].item[1].required is False assert inst.item[0].item[1].item[1].text == "Logical id of this artifact" assert inst.item[0].item[1].item[1].type == "string" assert inst.item[0].item[1].linkId == "GuidanceResponse.id" assert inst.item[0].item[1].repeats is True assert inst.item[0].item[1].required is False assert inst.item[0].item[1].type == "group" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].linkId == "GuidanceResponse.meta-flyover" assert inst.item[0].item[2].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content " "might not always be associated with version changes to the " "resource." ) assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].linkId == "GuidanceResponse.meta" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].text == "Metadata about the resource" assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[3].extension[1].valueString == "uri" assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[3].item[0].linkId == "GuidanceResponse.implicitRules-flyover" ) assert inst.item[0].item[3].item[0].type == "display" assert inst.item[0].item[3].item[1].linkId == "GuidanceResponse.implicitRules.value" assert inst.item[0].item[3].item[1].repeats is False assert inst.item[0].item[3].item[1].required is False assert ( inst.item[0].item[3].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[3].item[1].type == "string" assert inst.item[0].item[3].linkId == "GuidanceResponse.implicitRules" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "code" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[4].item[0].linkId == "GuidanceResponse.language-flyover" assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].answerConstraint == "optionsOrType" assert inst.item[0].item[4].item[1].linkId == "GuidanceResponse.language.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert inst.item[0].item[4].item[1].text == "language" assert inst.item[0].item[4].item[1].type == "coding" assert inst.item[0].item[4].linkId == "GuidanceResponse.language" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].linkId == "GuidanceResponse.text-flyover" assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].linkId == "GuidanceResponse.text" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert ( inst.item[0].item[5].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[6].item[0].linkId == "GuidanceResponse.contained-flyover" assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "GuidanceResponse.contained" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert inst.item[0].item[6].text == "Contained, inline Resources" assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[7].item[0].linkId == "GuidanceResponse.extension-flyover" assert inst.item[0].item[7].item[0].text == "An Extension" assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "GuidanceResponse.extension" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Extension" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[8].item[0].linkId == "GuidanceResponse.modifierExtension-flyover" ) assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "GuidanceResponse.modifierExtension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Extensions that cannot be ignored" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs" } ).valueUri ) assert inst.item[0].item[9].extension[0].valueInteger == 1 assert ( inst.item[0].item[9].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[9].extension[1].valueInteger == 1 assert ( inst.item[0].item[9].extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[9].extension[2].valueString == "Identifier" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[9].item[0].linkId == "GuidanceResponse.requestIdentifier-flyover" ) assert inst.item[0].item[9].item[0].type == "display" assert ( inst.item[0].item[9].item[1].linkId == "GuidanceResponse.requestIdentifier.label" ) assert inst.item[0].item[9].item[1].repeats is False assert inst.item[0].item[9].item[1].required is False assert inst.item[0].item[9].item[1].text == "label:" assert inst.item[0].item[9].item[1].type == "string" assert ( inst.item[0].item[9].item[2].linkId == "GuidanceResponse.requestIdentifier.system" ) assert inst.item[0].item[9].item[2].repeats is False assert inst.item[0].item[9].item[2].required is False assert inst.item[0].item[9].item[2].text == "system:" assert inst.item[0].item[9].item[2].type == "string" assert ( inst.item[0].item[9].item[3].linkId == "GuidanceResponse.requestIdentifier.value" ) assert inst.item[0].item[9].item[3].repeats is False assert inst.item[0].item[9].item[3].required is False assert inst.item[0].item[9].item[3].text == "value:" assert inst.item[0].item[9].item[3].type == "string" assert inst.item[0].item[9].linkId == "GuidanceResponse.requestIdentifier" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is True assert inst.item[0].item[9].text == ( "The identifier of the request associated with this response," " if any" ) assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "GuidanceResponse" assert inst.item[0].repeats is False assert inst.item[0].required is True assert inst.item[0].text == "The formal response to a guidance request" assert inst.item[0].type == "group" assert inst.publisher == "HL7" assert inst.status == "draft" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/Questionnaire/qgen-cdshooksguidanceresponse1" } ).valueUri ) assert inst.version == "5.0.0" def test_questionnaire_6(base_settings): """No. 6 tests collection for Questionnaire. Test File: cdshooksguidanceresponse-questionnaire.json """ filename = ( base_settings["unittest_data_dir"] / "cdshooksguidanceresponse-questionnaire.json" ) inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_6(inst2) def impl_questionnaire_7(inst): assert inst.contained[0].id == "vs2" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.experimental is False assert inst.id == "qgen-SearchParameter1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.item[0].item[0].linkId == "SearchParameter-display" assert inst.item[0].item[0].text == ( "In FHIR, search is not performed directly on a resource (by " "XML or JSON path), but on a named parameter that maps into " "the resource content." ) assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].linkId == "SearchParameter-flyover" assert inst.item[0].item[1].text == ( "A search parameter that defines a named search item that can" " be used to search/filter on a resource." ) assert inst.item[0].item[1].type == "display" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[2].extension[1].valueString == "string" assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].linkId == "SearchParameter.id-flyover" assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].item[1].linkId == "SearchParameter.id.value" assert inst.item[0].item[2].item[1].repeats is False assert inst.item[0].item[2].item[1].required is False assert inst.item[0].item[2].item[1].text == "Logical id of this artifact" assert inst.item[0].item[2].item[1].type == "string" assert inst.item[0].item[2].linkId == "SearchParameter.id" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[3].item[0].linkId == "SearchParameter.meta-flyover" assert inst.item[0].item[3].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content " "might not always be associated with version changes to the " "resource." ) assert inst.item[0].item[3].item[0].type == "display" assert inst.item[0].item[3].linkId == "SearchParameter.meta" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].text == "Metadata about the resource" assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "uri" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[4].item[0].linkId == "SearchParameter.implicitRules-flyover" ) assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].linkId == "SearchParameter.implicitRules.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert ( inst.item[0].item[4].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[4].item[1].type == "string" assert inst.item[0].item[4].linkId == "SearchParameter.implicitRules" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[5].extension[1].valueString == "code" assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].linkId == "SearchParameter.language-flyover" assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].item[1].answerConstraint == "optionsOrType" assert inst.item[0].item[5].item[1].linkId == "SearchParameter.language.value" assert inst.item[0].item[5].item[1].repeats is False assert inst.item[0].item[5].item[1].required is False assert inst.item[0].item[5].item[1].text == "language" assert inst.item[0].item[5].item[1].type == "coding" assert inst.item[0].item[5].linkId == "SearchParameter.language" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[6].extension[0].valueInteger == 1 assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[6].item[0].linkId == "SearchParameter.text-flyover" assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "SearchParameter.text" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert ( inst.item[0].item[6].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[7].item[0].linkId == "SearchParameter.contained-flyover" assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "SearchParameter.contained" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Contained, inline Resources" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[8].item[0].linkId == "SearchParameter.extension-flyover" assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "SearchParameter.extension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Additional content defined by implementations" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[9].item[0].linkId == "SearchParameter.modifierExtension-flyover" ) assert inst.item[0].item[9].item[0].type == "display" assert inst.item[0].item[9].linkId == "SearchParameter.modifierExtension" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].text == "Extensions that cannot be ignored" assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "SearchParameter" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == "Search parameter for a resource" assert inst.item[0].type == "group" assert inst.publisher == "Health Level Seven International (FHIR Infrastructure)" assert inst.status == "draft" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/Questionnaire/qgen-SearchParameter1"} ).valueUri ) assert inst.version == "5.0.0" def test_questionnaire_7(base_settings): """No. 7 tests collection for Questionnaire. Test File: searchparameter-questionnaire.json """ filename = base_settings["unittest_data_dir"] / "searchparameter-questionnaire.json" inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_7(inst2) def impl_questionnaire_8(inst): assert inst.contained[0].id == "vs2" assert inst.contained[1].id == "vs3" assert inst.contained[2].id == "vs4" assert inst.contained[3].id == "vs5" assert inst.contained[4].id == "vs6" assert inst.contained[5].id == "vs7" assert inst.contained[6].id == "vs8" assert inst.contained[7].id == "vs9" assert inst.contained[8].id == "vs10" assert inst.contained[9].id == "vs11" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.experimental is False assert inst.id == "qgen-ExplanationOfBenefit1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.item[0].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[0].linkId == "ExplanationOfBenefit-flyover" assert inst.item[0].item[0].text == ( "This resource provides: the claim details; adjudication " "details from the processing of a Claim; and optionally " "account balance information, for informing the subscriber of" " the benefits provided." ) assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[1].extension[0].valueInteger == 1 assert ( inst.item[0].item[1].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[1].extension[1].valueString == "string" assert ( inst.item[0].item[1].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].item[0].linkId == "ExplanationOfBenefit.id-flyover" assert inst.item[0].item[1].item[0].type == "display" assert inst.item[0].item[1].item[1].linkId == "ExplanationOfBenefit.id.value" assert inst.item[0].item[1].item[1].repeats is False assert inst.item[0].item[1].item[1].required is False assert inst.item[0].item[1].item[1].text == "Logical id of this artifact" assert inst.item[0].item[1].item[1].type == "string" assert inst.item[0].item[1].linkId == "ExplanationOfBenefit.id" assert inst.item[0].item[1].repeats is True assert inst.item[0].item[1].required is False assert inst.item[0].item[1].type == "group" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].linkId == "ExplanationOfBenefit.meta-flyover" assert inst.item[0].item[2].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content " "might not always be associated with version changes to the " "resource." ) assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].linkId == "ExplanationOfBenefit.meta" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].text == "Metadata about the resource" assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[3].extension[1].valueString == "uri" assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[3].item[0].linkId == "ExplanationOfBenefit.implicitRules-flyover" ) assert inst.item[0].item[3].item[0].type == "display" assert ( inst.item[0].item[3].item[1].linkId == "ExplanationOfBenefit.implicitRules.value" ) assert inst.item[0].item[3].item[1].repeats is False assert inst.item[0].item[3].item[1].required is False assert ( inst.item[0].item[3].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[3].item[1].type == "string" assert inst.item[0].item[3].linkId == "ExplanationOfBenefit.implicitRules" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "code" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[4].item[0].linkId == "ExplanationOfBenefit.language-flyover" ) assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].answerConstraint == "optionsOrType" assert inst.item[0].item[4].item[1].linkId == "ExplanationOfBenefit.language.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert inst.item[0].item[4].item[1].text == "language" assert inst.item[0].item[4].item[1].type == "coding" assert inst.item[0].item[4].linkId == "ExplanationOfBenefit.language" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].linkId == "ExplanationOfBenefit.text-flyover" assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].linkId == "ExplanationOfBenefit.text" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert ( inst.item[0].item[5].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[6].item[0].linkId == "ExplanationOfBenefit.contained-flyover" ) assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "ExplanationOfBenefit.contained" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert inst.item[0].item[6].text == "Contained, inline Resources" assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[7].item[0].linkId == "ExplanationOfBenefit.extension-flyover" ) assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "ExplanationOfBenefit.extension" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Additional content defined by implementations" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[8].item[0].linkId == "ExplanationOfBenefit.modifierExtension-flyover" ) assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "ExplanationOfBenefit.modifierExtension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Extensions that cannot be ignored" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[9].extension[0].valueString == "Identifier" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[9].item[0].linkId == "ExplanationOfBenefit.identifier-flyover" ) assert ( inst.item[0].item[9].item[0].text == "A unique identifier assigned to this explanation of benefit." ) assert inst.item[0].item[9].item[0].type == "display" assert ( inst.item[0].item[9].item[1].linkId == "ExplanationOfBenefit.identifier.label" ) assert inst.item[0].item[9].item[1].repeats is False assert inst.item[0].item[9].item[1].required is False assert inst.item[0].item[9].item[1].text == "label:" assert inst.item[0].item[9].item[1].type == "string" assert ( inst.item[0].item[9].item[2].linkId == "ExplanationOfBenefit.identifier.system" ) assert inst.item[0].item[9].item[2].repeats is False assert inst.item[0].item[9].item[2].required is False assert inst.item[0].item[9].item[2].text == "system:" assert inst.item[0].item[9].item[2].type == "string" assert ( inst.item[0].item[9].item[3].linkId == "ExplanationOfBenefit.identifier.value" ) assert inst.item[0].item[9].item[3].repeats is False assert inst.item[0].item[9].item[3].required is False assert inst.item[0].item[9].item[3].text == "value:" assert inst.item[0].item[9].item[3].type == "string" assert inst.item[0].item[9].linkId == "ExplanationOfBenefit.identifier" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].text == "Business Identifier for the resource" assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "ExplanationOfBenefit" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == "Explanation of Benefit resource" assert inst.item[0].type == "group" assert inst.publisher == "Health Level Seven International (Financial Management)" assert inst.status == "draft" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/Questionnaire/qgen-ExplanationOfBenefit1"} ).valueUri ) assert inst.version == "5.0.0" def test_questionnaire_8(base_settings): """No. 8 tests collection for Questionnaire. Test File: explanationofbenefit-questionnaire.json """ filename = ( base_settings["unittest_data_dir"] / "explanationofbenefit-questionnaire.json" ) inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_8(inst2) def impl_questionnaire_9(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.experimental is False assert inst.id == "qgen-ImmunizationEvaluation1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.item[0].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[0].linkId == "ImmunizationEvaluation-flyover" assert inst.item[0].item[0].text == ( "Describes a comparison of an immunization event against " "published recommendations to determine if the administration" ' is "valid" in relation to those recommendations.' ) assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[1].extension[0].valueInteger == 1 assert ( inst.item[0].item[1].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[1].extension[1].valueString == "string" assert ( inst.item[0].item[1].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].item[0].linkId == "ImmunizationEvaluation.id-flyover" assert inst.item[0].item[1].item[0].type == "display" assert inst.item[0].item[1].item[1].linkId == "ImmunizationEvaluation.id.value" assert inst.item[0].item[1].item[1].repeats is False assert inst.item[0].item[1].item[1].required is False assert inst.item[0].item[1].item[1].text == "Logical id of this artifact" assert inst.item[0].item[1].item[1].type == "string" assert inst.item[0].item[1].linkId == "ImmunizationEvaluation.id" assert inst.item[0].item[1].repeats is True assert inst.item[0].item[1].required is False assert inst.item[0].item[1].type == "group" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].linkId == "ImmunizationEvaluation.meta-flyover" assert inst.item[0].item[2].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content " "might not always be associated with version changes to the " "resource." ) assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].linkId == "ImmunizationEvaluation.meta" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].text == "Metadata about the resource" assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[3].extension[1].valueString == "uri" assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[3].item[0].linkId == "ImmunizationEvaluation.implicitRules-flyover" ) assert inst.item[0].item[3].item[0].type == "display" assert ( inst.item[0].item[3].item[1].linkId == "ImmunizationEvaluation.implicitRules.value" ) assert inst.item[0].item[3].item[1].repeats is False assert inst.item[0].item[3].item[1].required is False assert ( inst.item[0].item[3].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[3].item[1].type == "string" assert inst.item[0].item[3].linkId == "ImmunizationEvaluation.implicitRules" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "code" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[4].item[0].linkId == "ImmunizationEvaluation.language-flyover" ) assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].answerConstraint == "optionsOrType" assert ( inst.item[0].item[4].item[1].linkId == "ImmunizationEvaluation.language.value" ) assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert inst.item[0].item[4].item[1].text == "language" assert inst.item[0].item[4].item[1].type == "coding" assert inst.item[0].item[4].linkId == "ImmunizationEvaluation.language" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].linkId == "ImmunizationEvaluation.text-flyover" assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].linkId == "ImmunizationEvaluation.text" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is False assert ( inst.item[0].item[5].text == "Text summary of the resource, for human interpretation" ) assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[6].item[0].linkId == "ImmunizationEvaluation.contained-flyover" ) assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].linkId == "ImmunizationEvaluation.contained" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is False assert inst.item[0].item[6].text == "Contained, inline Resources" assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[7].item[0].linkId == "ImmunizationEvaluation.extension-flyover" ) assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].linkId == "ImmunizationEvaluation.extension" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is False assert inst.item[0].item[7].text == "Additional content defined by implementations" assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[8].item[0].linkId == "ImmunizationEvaluation.modifierExtension-flyover" ) assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].linkId == "ImmunizationEvaluation.modifierExtension" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].text == "Extensions that cannot be ignored" assert inst.item[0].item[8].type == "group" assert ( inst.item[0].item[9].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[9].extension[0].valueString == "Identifier" assert ( inst.item[0].item[9].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[9].item[0].linkId == "ImmunizationEvaluation.identifier-flyover" ) assert inst.item[0].item[9].item[0].text == ( "A unique identifier assigned to this immunization evaluation" " record." ) assert inst.item[0].item[9].item[0].type == "display" assert ( inst.item[0].item[9].item[1].linkId == "ImmunizationEvaluation.identifier.label" ) assert inst.item[0].item[9].item[1].repeats is False assert inst.item[0].item[9].item[1].required is False assert inst.item[0].item[9].item[1].text == "label:" assert inst.item[0].item[9].item[1].type == "string" assert ( inst.item[0].item[9].item[2].linkId == "ImmunizationEvaluation.identifier.system" ) assert inst.item[0].item[9].item[2].repeats is False assert inst.item[0].item[9].item[2].required is False assert inst.item[0].item[9].item[2].text == "system:" assert inst.item[0].item[9].item[2].type == "string" assert ( inst.item[0].item[9].item[3].linkId == "ImmunizationEvaluation.identifier.value" ) assert inst.item[0].item[9].item[3].repeats is False assert inst.item[0].item[9].item[3].required is False assert inst.item[0].item[9].item[3].text == "value:" assert inst.item[0].item[9].item[3].type == "string" assert inst.item[0].item[9].linkId == "ImmunizationEvaluation.identifier" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].text == "Business identifier" assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "ImmunizationEvaluation" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == "Immunization evaluation information" assert inst.item[0].type == "group" assert inst.publisher == ( "Health Level Seven International (Public Health and " "Emergency Response)" ) assert inst.status == "draft" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/Questionnaire/qgen-ImmunizationEvaluation1" } ).valueUri ) assert inst.version == "5.0.0" def test_questionnaire_9(base_settings): """No. 9 tests collection for Questionnaire. Test File: immunizationevaluation-questionnaire.json """ filename = ( base_settings["unittest_data_dir"] / "immunizationevaluation-questionnaire.json" ) inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_9(inst2) def impl_questionnaire_10(inst): assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.experimental is False assert inst.id == "qgen-document-bundle1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert ( inst.item[0].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[0].linkId == "Bundle-flyover" assert inst.item[0].item[0].text == "A container the resources of a FHIR document." assert inst.item[0].item[0].type == "display" assert ( inst.item[0].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[1].extension[0].valueInteger == 1 assert ( inst.item[0].item[1].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[1].extension[1].valueString == "string" assert ( inst.item[0].item[1].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[1].item[0].linkId == "Bundle.id-flyover" assert inst.item[0].item[1].item[0].type == "display" assert inst.item[0].item[1].item[1].linkId == "Bundle.id.value" assert inst.item[0].item[1].item[1].repeats is False assert inst.item[0].item[1].item[1].required is False assert inst.item[0].item[1].item[1].text == "Logical id of this artifact" assert inst.item[0].item[1].item[1].type == "string" assert inst.item[0].item[1].linkId == "Bundle.id" assert inst.item[0].item[1].repeats is True assert inst.item[0].item[1].required is False assert inst.item[0].item[1].type == "group" assert ( inst.item[0].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[2].item[0].linkId == "Bundle.meta-flyover" assert inst.item[0].item[2].item[0].text == ( "The metadata about the resource. This is content that is " "maintained by the infrastructure. Changes to the content " "might not always be associated with version changes to the " "resource." ) assert inst.item[0].item[2].item[0].type == "display" assert inst.item[0].item[2].linkId == "Bundle.meta" assert inst.item[0].item[2].repeats is True assert inst.item[0].item[2].required is False assert inst.item[0].item[2].text == "Metadata about the resource" assert inst.item[0].item[2].type == "group" assert ( inst.item[0].item[3].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[3].extension[0].valueInteger == 1 assert ( inst.item[0].item[3].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[3].extension[1].valueString == "uri" assert ( inst.item[0].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[3].item[0].linkId == "Bundle.implicitRules-flyover" assert inst.item[0].item[3].item[0].type == "display" assert inst.item[0].item[3].item[1].linkId == "Bundle.implicitRules.value" assert inst.item[0].item[3].item[1].repeats is False assert inst.item[0].item[3].item[1].required is False assert ( inst.item[0].item[3].item[1].text == "A set of rules under which this content was created" ) assert inst.item[0].item[3].item[1].type == "string" assert inst.item[0].item[3].linkId == "Bundle.implicitRules" assert inst.item[0].item[3].repeats is True assert inst.item[0].item[3].required is False assert inst.item[0].item[3].type == "group" assert ( inst.item[0].item[4].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[4].extension[0].valueInteger == 1 assert ( inst.item[0].item[4].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[4].extension[1].valueString == "code" assert ( inst.item[0].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[4].item[0].linkId == "Bundle.language-flyover" assert inst.item[0].item[4].item[0].type == "display" assert inst.item[0].item[4].item[1].answerConstraint == "optionsOrType" assert inst.item[0].item[4].item[1].linkId == "Bundle.language.value" assert inst.item[0].item[4].item[1].repeats is False assert inst.item[0].item[4].item[1].required is False assert inst.item[0].item[4].item[1].text == "language" assert inst.item[0].item[4].item[1].type == "coding" assert inst.item[0].item[4].linkId == "Bundle.language" assert inst.item[0].item[4].repeats is True assert inst.item[0].item[4].required is False assert inst.item[0].item[4].type == "group" assert ( inst.item[0].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[5].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[5].extension[1].valueInteger == 1 assert ( inst.item[0].item[5].extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[5].extension[2].valueString == "Identifier" assert ( inst.item[0].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[5].item[0].linkId == "Bundle.identifier-flyover" assert inst.item[0].item[5].item[0].type == "display" assert inst.item[0].item[5].item[1].linkId == "Bundle.identifier.label" assert inst.item[0].item[5].item[1].repeats is False assert inst.item[0].item[5].item[1].required is False assert inst.item[0].item[5].item[1].text == "label:" assert inst.item[0].item[5].item[1].type == "string" assert inst.item[0].item[5].item[2].linkId == "Bundle.identifier.system" assert inst.item[0].item[5].item[2].repeats is False assert inst.item[0].item[5].item[2].required is False assert inst.item[0].item[5].item[2].text == "system:" assert inst.item[0].item[5].item[2].type == "string" assert inst.item[0].item[5].item[3].linkId == "Bundle.identifier.value" assert inst.item[0].item[5].item[3].repeats is False assert inst.item[0].item[5].item[3].required is False assert inst.item[0].item[5].item[3].text == "value:" assert inst.item[0].item[5].item[3].type == "string" assert inst.item[0].item[5].linkId == "Bundle.identifier" assert inst.item[0].item[5].repeats is True assert inst.item[0].item[5].required is True assert inst.item[0].item[5].text == "Persistent identifier for the bundle" assert inst.item[0].item[5].type == "group" assert ( inst.item[0].item[6].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs" } ).valueUri ) assert inst.item[0].item[6].extension[0].valueInteger == 1 assert ( inst.item[0].item[6].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[6].extension[1].valueInteger == 1 assert ( inst.item[0].item[6].extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[6].extension[2].valueString == "code" assert ( inst.item[0].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[6].item[0].linkId == "Bundle.type-flyover" assert inst.item[0].item[6].item[0].type == "display" assert inst.item[0].item[6].item[1].answerConstraint == "optionsOrType" assert inst.item[0].item[6].item[1].linkId == "Bundle.type.value" assert inst.item[0].item[6].item[1].repeats is False assert inst.item[0].item[6].item[1].required is False assert inst.item[0].item[6].item[1].text == "type" assert inst.item[0].item[6].item[1].type == "coding" assert inst.item[0].item[6].linkId == "Bundle.type" assert inst.item[0].item[6].repeats is True assert inst.item[0].item[6].required is True assert inst.item[0].item[6].type == "group" assert ( inst.item[0].item[7].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs" } ).valueUri ) assert inst.item[0].item[7].extension[0].valueInteger == 1 assert ( inst.item[0].item[7].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[7].extension[1].valueInteger == 1 assert ( inst.item[0].item[7].extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[7].extension[2].valueString == "instant" assert ( inst.item[0].item[7].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[7].item[0].linkId == "Bundle.timestamp-flyover" assert inst.item[0].item[7].item[0].type == "display" assert inst.item[0].item[7].item[1].linkId == "Bundle.timestamp.value" assert inst.item[0].item[7].item[1].repeats is False assert inst.item[0].item[7].item[1].required is False assert inst.item[0].item[7].item[1].text == "When the bundle was assembled" assert inst.item[0].item[7].item[1].type == "dateTime" assert inst.item[0].item[7].linkId == "Bundle.timestamp" assert inst.item[0].item[7].repeats is True assert inst.item[0].item[7].required is True assert inst.item[0].item[7].type == "group" assert ( inst.item[0].item[8].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[8].extension[0].valueInteger == 0 assert ( inst.item[0].item[8].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[8].extension[1].valueString == "integer" assert ( inst.item[0].item[8].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[8].item[0].linkId == "Bundle.total-flyover" assert inst.item[0].item[8].item[0].type == "display" assert inst.item[0].item[8].item[1].linkId == "Bundle.total.value" assert inst.item[0].item[8].item[1].repeats is False assert inst.item[0].item[8].item[1].required is False assert inst.item[0].item[8].item[1].text == "If search, the total number of matches" assert inst.item[0].item[8].item[1].type == "integer" assert inst.item[0].item[8].linkId == "Bundle.total" assert inst.item[0].item[8].repeats is True assert inst.item[0].item[8].required is False assert inst.item[0].item[8].type == "group" assert inst.item[0].item[9].item[0].linkId == "Bundle.link-display" assert inst.item[0].item[9].item[0].type == "display" assert ( inst.item[0].item[9].item[1].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0].item[9].item[1].extension[0].valueCodeableConcept.coding[0].code == "flyover" ) assert ( inst.item[0].item[9].item[1].extension[0].valueCodeableConcept.coding[0].display == "Fly-over" ) assert ( inst.item[0].item[9].item[1].extension[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[9].item[1].linkId == "Bundle.link-flyover" assert ( inst.item[0].item[9].item[1].text == "A series of links that provide context to this bundle." ) assert inst.item[0].item[9].item[1].type == "display" assert ( inst.item[0].item[9].item[2].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[9].item[2].extension[0].valueInteger == 1 assert ( inst.item[0].item[9].item[2].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[9].item[2].extension[1].valueString == "string" assert ( inst.item[0].item[9].item[2].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0] .item[9] .item[2] .item[0] .extension[0] .valueCodeableConcept.coding[0] .code == "flyover" ) assert ( inst.item[0] .item[9] .item[2] .item[0] .extension[0] .valueCodeableConcept.coding[0] .display == "Fly-over" ) assert ( inst.item[0] .item[9] .item[2] .item[0] .extension[0] .valueCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[9].item[2].item[0].linkId == "Bundle.link.id-flyover" assert inst.item[0].item[9].item[2].item[0].text == ( "Unique id for the element within a resource (for internal " "references). This may be any string value that does not " "contain spaces." ) assert inst.item[0].item[9].item[2].item[0].type == "display" assert inst.item[0].item[9].item[2].item[1].linkId == "Bundle.link.id.value" assert inst.item[0].item[9].item[2].item[1].repeats is False assert inst.item[0].item[9].item[2].item[1].required is False assert ( inst.item[0].item[9].item[2].item[1].text == "Unique id for inter-element referencing" ) assert inst.item[0].item[9].item[2].item[1].type == "string" assert inst.item[0].item[9].item[2].linkId == "Bundle.link.id" assert inst.item[0].item[9].item[2].repeats is True assert inst.item[0].item[9].item[2].required is False assert inst.item[0].item[9].item[2].type == "group" assert ( inst.item[0].item[9].item[3].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0] .item[9] .item[3] .item[0] .extension[0] .valueCodeableConcept.coding[0] .code == "flyover" ) assert ( inst.item[0] .item[9] .item[3] .item[0] .extension[0] .valueCodeableConcept.coding[0] .display == "Fly-over" ) assert ( inst.item[0] .item[9] .item[3] .item[0] .extension[0] .valueCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[9].item[3].item[0].linkId == "Bundle.link.extension-flyover" ) assert inst.item[0].item[9].item[3].item[0].type == "display" assert inst.item[0].item[9].item[3].linkId == "Bundle.link.extension" assert inst.item[0].item[9].item[3].repeats is True assert inst.item[0].item[9].item[3].required is False assert ( inst.item[0].item[9].item[3].text == "Additional content defined by implementations" ) assert inst.item[0].item[9].item[3].type == "group" assert ( inst.item[0].item[9].item[4].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0] .item[9] .item[4] .item[0] .extension[0] .valueCodeableConcept.coding[0] .code == "flyover" ) assert ( inst.item[0] .item[9] .item[4] .item[0] .extension[0] .valueCodeableConcept.coding[0] .display == "Fly-over" ) assert ( inst.item[0] .item[9] .item[4] .item[0] .extension[0] .valueCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert ( inst.item[0].item[9].item[4].item[0].linkId == "Bundle.link.modifierExtension-flyover" ) assert inst.item[0].item[9].item[4].item[0].type == "display" assert inst.item[0].item[9].item[4].linkId == "Bundle.link.modifierExtension" assert inst.item[0].item[9].item[4].repeats is True assert inst.item[0].item[9].item[4].required is False assert ( inst.item[0].item[9].item[4].text == "Extensions that cannot be ignored even if unrecognized" ) assert inst.item[0].item[9].item[4].type == "group" assert ( inst.item[0].item[9].item[5].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs" } ).valueUri ) assert inst.item[0].item[9].item[5].extension[0].valueInteger == 1 assert ( inst.item[0].item[9].item[5].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[9].item[5].extension[1].valueInteger == 1 assert ( inst.item[0].item[9].item[5].extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[9].item[5].extension[2].valueString == "code" assert ( inst.item[0].item[9].item[5].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0] .item[9] .item[5] .item[0] .extension[0] .valueCodeableConcept.coding[0] .code == "flyover" ) assert ( inst.item[0] .item[9] .item[5] .item[0] .extension[0] .valueCodeableConcept.coding[0] .display == "Fly-over" ) assert ( inst.item[0] .item[9] .item[5] .item[0] .extension[0] .valueCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[9].item[5].item[0].linkId == "Bundle.link.relation-flyover" assert inst.item[0].item[9].item[5].item[0].type == "display" assert inst.item[0].item[9].item[5].item[1].answerConstraint == "optionsOrType" assert inst.item[0].item[9].item[5].item[1].linkId == "Bundle.link.relation.value" assert inst.item[0].item[9].item[5].item[1].repeats is False assert inst.item[0].item[9].item[5].item[1].required is False assert inst.item[0].item[9].item[5].item[1].text == "relation" assert inst.item[0].item[9].item[5].item[1].type == "coding" assert inst.item[0].item[9].item[5].linkId == "Bundle.link.relation" assert inst.item[0].item[9].item[5].repeats is True assert inst.item[0].item[9].item[5].required is True assert inst.item[0].item[9].item[5].type == "group" assert ( inst.item[0].item[9].item[6].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs" } ).valueUri ) assert inst.item[0].item[9].item[6].extension[0].valueInteger == 1 assert ( inst.item[0].item[9].item[6].extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" } ).valueUri ) assert inst.item[0].item[9].item[6].extension[1].valueInteger == 1 assert ( inst.item[0].item[9].item[6].extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" } ).valueUri ) assert inst.item[0].item[9].item[6].extension[2].valueString == "uri" assert ( inst.item[0].item[9].item[6].item[0].extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" } ).valueUri ) assert ( inst.item[0] .item[9] .item[6] .item[0] .extension[0] .valueCodeableConcept.coding[0] .code == "flyover" ) assert ( inst.item[0] .item[9] .item[6] .item[0] .extension[0] .valueCodeableConcept.coding[0] .display == "Fly-over" ) assert ( inst.item[0] .item[9] .item[6] .item[0] .extension[0] .valueCodeableConcept.coding[0] .system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/questionnaire-item-control"} ).valueUri ) assert inst.item[0].item[9].item[6].item[0].linkId == "Bundle.link.url-flyover" assert ( inst.item[0].item[9].item[6].item[0].text == "The reference details for the link." ) assert inst.item[0].item[9].item[6].item[0].type == "display" assert inst.item[0].item[9].item[6].item[1].linkId == "Bundle.link.url.value" assert inst.item[0].item[9].item[6].item[1].repeats is False assert inst.item[0].item[9].item[6].item[1].required is False assert inst.item[0].item[9].item[6].item[1].text == "Reference details for the link" assert inst.item[0].item[9].item[6].item[1].type == "string" assert inst.item[0].item[9].item[6].linkId == "Bundle.link.url" assert inst.item[0].item[9].item[6].repeats is True assert inst.item[0].item[9].item[6].required is True assert inst.item[0].item[9].item[6].type == "group" assert inst.item[0].item[9].linkId == "Bundle.link" assert inst.item[0].item[9].repeats is True assert inst.item[0].item[9].required is False assert inst.item[0].item[9].text == "Links related to this Bundle" assert inst.item[0].item[9].type == "group" assert inst.item[0].linkId == "Bundle" assert inst.item[0].repeats is True assert inst.item[0].required is False assert inst.item[0].text == "Represents a FHIR document" assert inst.item[0].type == "group" assert inst.status == "active" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/Questionnaire/qgen-document-bundle1"} ).valueUri ) assert inst.version == "5.0.0" def test_questionnaire_10(base_settings): """No. 10 tests collection for Questionnaire. Test File: document-bundle-questionnaire.json """ filename = base_settings["unittest_data_dir"] / "document-bundle-questionnaire.json" inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes()) assert "Questionnaire" == inst.get_resource_type() impl_questionnaire_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Questionnaire" == data["resourceType"] inst2 = questionnaire.Questionnaire(**data) impl_questionnaire_10(inst2) ================================================ FILE: fhir/resources/tests/test_questionnaireresponse.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import questionnaireresponse from .conftest import ExternalValidatorModel def impl_questionnaireresponse_1(inst): assert inst.author.reference == "#questauth" assert ( inst.authored == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-02-19T14:15:00-05:00"} ).valueDateTime ) assert inst.basedOn[0].reference == "#order" assert inst.contained[0].id == "patsub" assert inst.contained[1].id == "order" assert inst.contained[2].id == "questauth" assert inst.encounter.reference == "Encounter/example" assert inst.id == "3141" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/fhir/NamingSystem/questionnaire-ids"} ).valueUri ) assert inst.identifier[0].value == "Q12349876" assert ( inst.item[0].item[0].answer[0].item[0].item[0].answer[0].valueCoding.code == "1" ) assert ( inst.item[0].item[0].answer[0].item[0].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://cancer.questionnaire.org/system/code/yesno"} ).valueUri ) assert inst.item[0].item[0].answer[0].item[0].item[0].linkId == "1.1.1.1" assert ( inst.item[0].item[0].answer[0].item[0].item[1].answer[0].valueCoding.code == "1" ) assert ( inst.item[0].item[0].answer[0].item[0].item[1].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://cancer.questionnaire.org/system/code/yesno"} ).valueUri ) assert inst.item[0].item[0].answer[0].item[0].item[1].linkId == "1.1.1.2" assert ( inst.item[0].item[0].answer[0].item[0].item[2].answer[0].valueCoding.code == "0" ) assert ( inst.item[0].item[0].answer[0].item[0].item[2].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://cancer.questionnaire.org/system/code/yesno"} ).valueUri ) assert inst.item[0].item[0].answer[0].item[0].item[2].linkId == "1.1.1.3" assert inst.item[0].item[0].answer[0].item[0].linkId == "1.1.1" assert inst.item[0].item[0].answer[0].valueCoding.code == "1" assert inst.item[0].item[0].answer[0].valueCoding.display == "Yes" assert ( inst.item[0].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://cancer.questionnaire.org/system/code/yesno"} ).valueUri ) assert inst.item[0].item[0].linkId == "1.1" assert inst.item[0].linkId == "1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.partOf[0].reference == "Procedure/f201" assert inst.questionnaire == "urn:uuid:95eaedf7-8a24-478a-8300-39acc44c746b" assert inst.status == "completed" assert inst.subject.reference == "#patsub" assert inst.text.status == "generated" def test_questionnaireresponse_1(base_settings): """No. 1 tests collection for QuestionnaireResponse. Test File: questionnaireresponse-example.json """ filename = base_settings["unittest_data_dir"] / "questionnaireresponse-example.json" inst = questionnaireresponse.QuestionnaireResponse.model_validate_json( filename.read_bytes() ) assert "QuestionnaireResponse" == inst.get_resource_type() impl_questionnaireresponse_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "QuestionnaireResponse" == data["resourceType"] inst2 = questionnaireresponse.QuestionnaireResponse(**data) impl_questionnaireresponse_1(inst2) def impl_questionnaireresponse_2(inst): assert ( inst.authored == ExternalValidatorModel.model_validate( {"valueDateTime": "2008-01-17"} ).valueDateTime ) assert inst.id == "ussg-fht-answers" assert ( inst.item[0].item[0].answer[0].valueDate == ExternalValidatorModel.model_validate({"valueDate": "2008-01-17"}).valueDate ) assert inst.item[0].item[0].linkId == "0.1" assert inst.item[0].item[0].text == "Date Done" assert inst.item[0].linkId == "0" assert ( inst.item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54126-8"} ).valueUri ) assert inst.item[1].item[0].item[0].answer[0].valueString == "Annie Proband" assert ( inst.item[1].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54125-0"} ).valueUri ) assert inst.item[1].item[0].item[0].linkId == "1.1.1" assert inst.item[1].item[0].item[0].text == "Name" assert inst.item[1].item[0].item[1].answer[0].valueCoding.code == "LA3-6" assert inst.item[1].item[0].item[1].answer[0].valueCoding.display == "Female" assert ( inst.item[1].item[0].item[1].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[1].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54131-8"} ).valueUri ) assert inst.item[1].item[0].item[1].linkId == "1.1.2" assert inst.item[1].item[0].item[1].text == "Gender" assert ( inst.item[1].item[0].item[2].answer[0].valueDate == ExternalValidatorModel.model_validate({"valueDate": "1966-04-04"}).valueDate ) assert ( inst.item[1].item[0].item[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/21112-8"} ).valueUri ) assert inst.item[1].item[0].item[2].linkId == "1.1.3" assert inst.item[1].item[0].item[2].text == "Date of Birth" assert inst.item[1].item[0].item[3].answer[0].valueCoding.code == "LA32-8" assert inst.item[1].item[0].item[3].answer[0].valueCoding.display == "No" assert ( inst.item[1].item[0].item[3].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[1].item[0].item[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54132-6"} ).valueUri ) assert inst.item[1].item[0].item[3].linkId == "1.1.4" assert inst.item[1].item[0].item[3].text == "Were you born a twin?" assert inst.item[1].item[0].item[4].answer[0].valueCoding.code == "LA32-8" assert inst.item[1].item[0].item[4].answer[0].valueCoding.display == "No" assert ( inst.item[1].item[0].item[4].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[1].item[0].item[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54128-4"} ).valueUri ) assert inst.item[1].item[0].item[4].linkId == "1.1.5" assert inst.item[1].item[0].item[4].text == "Were you adopted?" assert inst.item[1].item[0].item[5].answer[0].valueCoding.code == "LA32-8" assert inst.item[1].item[0].item[5].answer[0].valueCoding.display == "No" assert ( inst.item[1].item[0].item[5].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[1].item[0].item[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54135-9"} ).valueUri ) assert inst.item[1].item[0].item[5].linkId == "1.1.6" assert inst.item[1].item[0].item[5].text == ( "Are your parents related to each other in any way other than" " marriage?" ) assert ( inst.item[1] .item[0] .item[6] .answer[0] .item[0] .item[0] .answer[0] .valueCoding.code == "[in_i]" ) assert ( inst.item[1] .item[0] .item[6] .answer[0] .item[0] .item[0] .answer[0] .valueCoding.display == "inches" ) assert ( inst.item[1] .item[0] .item[6] .answer[0] .item[0] .item[0] .answer[0] .valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.item[1].item[0].item[6].answer[0].item[0].item[0].linkId == "1.1.7.1.1" assert inst.item[1].item[0].item[6].answer[0].item[0].item[0].text == "Units" assert inst.item[1].item[0].item[6].answer[0].item[0].linkId == "1.1.7.1" assert float(inst.item[1].item[0].item[6].answer[0].valueDecimal) == float(63) assert ( inst.item[1].item[0].item[6].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/8302-2"} ).valueUri ) assert inst.item[1].item[0].item[6].linkId == "1.1.7" assert inst.item[1].item[0].item[6].text == "Height" assert ( inst.item[1] .item[0] .item[7] .answer[0] .item[0] .item[0] .answer[0] .valueCoding.code == "[lb_av]" ) assert ( inst.item[1] .item[0] .item[7] .answer[0] .item[0] .item[0] .answer[0] .valueCoding.display == "pounds" ) assert ( inst.item[1] .item[0] .item[7] .answer[0] .item[0] .item[0] .answer[0] .valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.item[1].item[0].item[7].answer[0].item[0].item[0].linkId == "1.1.8.1.1" assert inst.item[1].item[0].item[7].answer[0].item[0].item[0].text == "Units" assert inst.item[1].item[0].item[7].answer[0].item[0].linkId == "1.1.8.1" assert float(inst.item[1].item[0].item[7].answer[0].valueDecimal) == float(127) assert ( inst.item[1].item[0].item[7].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/29463-7"} ).valueUri ) assert inst.item[1].item[0].item[7].linkId == "1.1.8" assert inst.item[1].item[0].item[7].text == "Weight" assert float(inst.item[1].item[0].item[8].answer[0].valueDecimal) == float(22.5) assert ( inst.item[1].item[0].item[8].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/39156-5"} ).valueUri ) assert inst.item[1].item[0].item[8].linkId == "1.1.9" assert inst.item[1].item[0].item[8].text == "Body mass index (BMI) [Ratio]" assert inst.item[1].item[0].item[9].answer[0].valueCoding.code == "LA4457-3" assert inst.item[1].item[0].item[9].answer[0].valueCoding.display == "White" assert ( inst.item[1].item[0].item[9].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[1].item[0].item[9].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54134-2"} ).valueUri ) assert inst.item[1].item[0].item[9].linkId == "1.1.10" assert inst.item[1].item[0].item[9].text == "Race" assert inst.item[1].item[0].linkId == "1.1" assert inst.item[1].linkId == "1" assert inst.item[1].text == "Your health information" assert ( inst.item[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54114-4"} ).valueUri ) assert inst.item[2].item[0].item[0].answer[0].valueCoding.code == "LA10405-1" assert inst.item[2].item[0].item[0].answer[0].valueCoding.display == "Daughter" assert ( inst.item[2].item[0].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54136-7"} ).valueUri ) assert inst.item[2].item[0].item[0].linkId == "2.1.1.1" assert inst.item[2].item[0].item[0].text == "Relationship to you" assert inst.item[2].item[0].item[1].answer[0].valueString == "Susan" assert ( inst.item[2].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54138-3"} ).valueUri ) assert inst.item[2].item[0].item[1].linkId == "2.1.1.2" assert inst.item[2].item[0].item[1].text == "Name" assert inst.item[2].item[0].item[2].answer[0].valueCoding.code == "LA3-6" assert inst.item[2].item[0].item[2].answer[0].valueCoding.display == "Female" assert ( inst.item[2].item[0].item[2].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[0].item[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54123-5"} ).valueUri ) assert inst.item[2].item[0].item[2].linkId == "2.1.1.3" assert inst.item[2].item[0].item[2].text == "Gender" assert float( inst.item[2].item[0].item[3].answer[0].item[0].item[0].answer[0].valueDecimal ) == float(17) assert ( inst.item[2].item[0].item[3].answer[0].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54141-7"} ).valueUri ) assert ( inst.item[2].item[0].item[3].answer[0].item[0].item[0].linkId == "2.1.1.4.2.2" ) assert inst.item[2].item[0].item[3].answer[0].item[0].item[0].text == "Age" assert inst.item[2].item[0].item[3].answer[0].item[0].linkId == "2.1.1.4.2" assert inst.item[2].item[0].item[3].answer[0].valueCoding.code == "LA33-6" assert inst.item[2].item[0].item[3].answer[0].valueCoding.display == "Yes" assert ( inst.item[2].item[0].item[3].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[0].item[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54139-1"} ).valueUri ) assert inst.item[2].item[0].item[3].linkId == "2.1.1.4" assert inst.item[2].item[0].item[3].text == "Living?" assert inst.item[2].item[0].item[4].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[0].item[4].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[0].item[4].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[0].item[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54121-9"} ).valueUri ) assert inst.item[2].item[0].item[4].linkId == "2.1.1.5" assert inst.item[2].item[0].item[4].text == "Was this person born a twin?" assert inst.item[2].item[0].item[5].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[0].item[5].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[0].item[5].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[0].item[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54122-7"} ).valueUri ) assert inst.item[2].item[0].item[5].linkId == "2.1.1.6" assert inst.item[2].item[0].item[5].text == "Was this person adopted?" assert inst.item[2].item[0].linkId == "2.1" assert ( inst.item[2].item[1].item[0].item[0].answer[0].valueCoding.code == "LA10415-0" ) assert ( inst.item[2].item[1].item[0].item[0].answer[0].valueCoding.display == "Brother" ) assert ( inst.item[2].item[1].item[0].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[1].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54136-7"} ).valueUri ) assert inst.item[2].item[1].item[0].item[0].linkId == "2.1.1.1" assert inst.item[2].item[1].item[0].item[0].text == "Relationship to you" assert inst.item[2].item[1].item[0].item[1].answer[0].valueString == "Brian" assert ( inst.item[2].item[1].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54138-3"} ).valueUri ) assert inst.item[2].item[1].item[0].item[1].linkId == "2.1.1.2" assert inst.item[2].item[1].item[0].item[1].text == "Name" assert inst.item[2].item[1].item[0].item[2].answer[0].valueCoding.code == "LA2-8" assert inst.item[2].item[1].item[0].item[2].answer[0].valueCoding.display == "Male" assert ( inst.item[2].item[1].item[0].item[2].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[1].item[0].item[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54123-5"} ).valueUri ) assert inst.item[2].item[1].item[0].item[2].linkId == "2.1.1.3" assert inst.item[2].item[1].item[0].item[2].text == "Gender" assert float( inst.item[2] .item[1] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueDecimal ) == float(32) assert ( inst.item[2].item[1].item[0].item[3].answer[0].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54141-7"} ).valueUri ) assert ( inst.item[2].item[1].item[0].item[3].answer[0].item[0].item[0].linkId == "2.1.1.4.2.2" ) assert inst.item[2].item[1].item[0].item[3].answer[0].item[0].item[0].text == "Age" assert inst.item[2].item[1].item[0].item[3].answer[0].item[0].linkId == "2.1.1.4.2" assert inst.item[2].item[1].item[0].item[3].answer[0].valueCoding.code == "LA33-6" assert inst.item[2].item[1].item[0].item[3].answer[0].valueCoding.display == "Yes" assert ( inst.item[2].item[1].item[0].item[3].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[1].item[0].item[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54139-1"} ).valueUri ) assert inst.item[2].item[1].item[0].item[3].linkId == "2.1.1.4" assert inst.item[2].item[1].item[0].item[3].text == "Living?" assert inst.item[2].item[1].item[0].item[4].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[1].item[0].item[4].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[1].item[0].item[4].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[1].item[0].item[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54121-9"} ).valueUri ) assert inst.item[2].item[1].item[0].item[4].linkId == "2.1.1.5" assert inst.item[2].item[1].item[0].item[4].text == "Was this person born a twin?" assert inst.item[2].item[1].item[0].item[5].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[1].item[0].item[5].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[1].item[0].item[5].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[1].item[0].item[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54122-7"} ).valueUri ) assert inst.item[2].item[1].item[0].item[5].linkId == "2.1.1.6" assert inst.item[2].item[1].item[0].item[5].text == "Was this person adopted?" assert inst.item[2].item[1].item[0].linkId == "2.1.1" assert ( inst.item[2].item[1].item[1].item[0].answer[0].valueCoding.code == "LA10550-4" ) assert ( inst.item[2].item[1].item[1].item[0].answer[0].valueCoding.display == "-- Other Cancer" ) assert ( inst.item[2].item[1].item[1].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.item[2].item[1].item[1].item[0].linkId == "2.1.2.1" assert inst.item[2].item[1].item[1].item[0].text == "Disease or Condition" assert ( inst.item[2].item[1].item[1].item[1].answer[0].valueCoding.code == "LA10397-0" ) assert inst.item[2].item[1].item[1].item[1].answer[0].valueCoding.display == "30-39" assert ( inst.item[2].item[1].item[1].item[1].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.item[2].item[1].item[1].item[1].linkId == "2.1.2.2" assert inst.item[2].item[1].item[1].item[1].text == "Age at Diagnosis" assert inst.item[2].item[1].item[1].linkId == "2.1.2" assert ( inst.item[2].item[1].item[1].text == "This family member's history of disease" ) assert inst.item[2].item[1].linkId == "2.1" assert ( inst.item[2].item[2].item[0].item[0].answer[0].valueCoding.code == "LA10418-4" ) assert ( inst.item[2].item[2].item[0].item[0].answer[0].valueCoding.display == "Sister" ) assert ( inst.item[2].item[2].item[0].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[2].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54136-7"} ).valueUri ) assert inst.item[2].item[2].item[0].item[0].linkId == "2.1.1.1" assert inst.item[2].item[2].item[0].item[0].text == "Relationship to you" assert inst.item[2].item[2].item[0].item[1].answer[0].valueString == "Janet" assert ( inst.item[2].item[2].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54138-3"} ).valueUri ) assert inst.item[2].item[2].item[0].item[1].linkId == "2.1.1.2" assert inst.item[2].item[2].item[0].item[1].text == "Name" assert inst.item[2].item[2].item[0].item[2].answer[0].valueCoding.code == "LA3-6" assert ( inst.item[2].item[2].item[0].item[2].answer[0].valueCoding.display == "Female" ) assert ( inst.item[2].item[2].item[0].item[2].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[2].item[0].item[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54123-5"} ).valueUri ) assert inst.item[2].item[2].item[0].item[2].linkId == "2.1.1.3" assert inst.item[2].item[2].item[0].item[2].text == "Gender" assert float( inst.item[2] .item[2] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueDecimal ) == float(36) assert ( inst.item[2].item[2].item[0].item[3].answer[0].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54141-7"} ).valueUri ) assert ( inst.item[2].item[2].item[0].item[3].answer[0].item[0].item[0].linkId == "2.1.1.4.2.2" ) assert inst.item[2].item[2].item[0].item[3].answer[0].item[0].item[0].text == "Age" assert inst.item[2].item[2].item[0].item[3].answer[0].item[0].linkId == "2.1.1.4.2" assert inst.item[2].item[2].item[0].item[3].answer[0].valueCoding.code == "LA33-6" assert inst.item[2].item[2].item[0].item[3].answer[0].valueCoding.display == "Yes" assert ( inst.item[2].item[2].item[0].item[3].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[2].item[0].item[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54139-1"} ).valueUri ) assert inst.item[2].item[2].item[0].item[3].linkId == "2.1.1.4" assert inst.item[2].item[2].item[0].item[3].text == "Living?" assert inst.item[2].item[2].item[0].item[4].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[2].item[0].item[4].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[2].item[0].item[4].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[2].item[0].item[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54121-9"} ).valueUri ) assert inst.item[2].item[2].item[0].item[4].linkId == "2.1.1.5" assert inst.item[2].item[2].item[0].item[4].text == "Was this person born a twin?" assert inst.item[2].item[2].item[0].item[5].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[2].item[0].item[5].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[2].item[0].item[5].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[2].item[0].item[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54122-7"} ).valueUri ) assert inst.item[2].item[2].item[0].item[5].linkId == "2.1.1.6" assert inst.item[2].item[2].item[0].item[5].text == "Was this person adopted?" assert inst.item[2].item[2].item[0].linkId == "2.1.1" assert ( inst.item[2].item[2].item[1].item[0].answer[0].valueCoding.code == "LA10536-3" ) assert ( inst.item[2].item[2].item[1].item[0].answer[0].valueCoding.display == "-- Breast Cancer" ) assert ( inst.item[2].item[2].item[1].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.item[2].item[2].item[1].item[0].linkId == "2.1.2.1" assert inst.item[2].item[2].item[1].item[0].text == "Disease or Condition" assert ( inst.item[2].item[2].item[1].item[1].answer[0].valueCoding.code == "LA10397-0" ) assert inst.item[2].item[2].item[1].item[1].answer[0].valueCoding.display == "30-39" assert ( inst.item[2].item[2].item[1].item[1].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.item[2].item[2].item[1].item[1].linkId == "2.1.2.2" assert inst.item[2].item[2].item[1].item[1].text == "Age at Diagnosis" assert inst.item[2].item[2].item[1].linkId == "2.1.2" assert ( inst.item[2].item[2].item[1].text == "This family member's history of disease" ) assert inst.item[2].item[2].linkId == "2.1" assert ( inst.item[2].item[3].item[0].item[0].answer[0].valueCoding.code == "LA10419-2" ) assert ( inst.item[2].item[3].item[0].item[0].answer[0].valueCoding.display == "Nephew" ) assert ( inst.item[2].item[3].item[0].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[3].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54136-7"} ).valueUri ) assert inst.item[2].item[3].item[0].item[0].linkId == "2.1.1.1" assert inst.item[2].item[3].item[0].item[0].text == "Relationship to you" assert inst.item[2].item[3].item[0].item[1].answer[0].valueString == "Ian" assert ( inst.item[2].item[3].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54138-3"} ).valueUri ) assert inst.item[2].item[3].item[0].item[1].linkId == "2.1.1.2" assert inst.item[2].item[3].item[0].item[1].text == "Name" assert inst.item[2].item[3].item[0].item[2].answer[0].valueCoding.code == "LA2-8" assert inst.item[2].item[3].item[0].item[2].answer[0].valueCoding.display == "Male" assert ( inst.item[2].item[3].item[0].item[2].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[3].item[0].item[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54123-5"} ).valueUri ) assert inst.item[2].item[3].item[0].item[2].linkId == "2.1.1.3" assert inst.item[2].item[3].item[0].item[2].text == "Gender" assert float( inst.item[2] .item[3] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueDecimal ) == float(16) assert ( inst.item[2].item[3].item[0].item[3].answer[0].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54141-7"} ).valueUri ) assert ( inst.item[2].item[3].item[0].item[3].answer[0].item[0].item[0].linkId == "2.1.1.4.2.2" ) assert inst.item[2].item[3].item[0].item[3].answer[0].item[0].item[0].text == "Age" assert inst.item[2].item[3].item[0].item[3].answer[0].item[0].linkId == "2.1.1.4.2" assert inst.item[2].item[3].item[0].item[3].answer[0].valueCoding.code == "LA33-6" assert inst.item[2].item[3].item[0].item[3].answer[0].valueCoding.display == "Yes" assert ( inst.item[2].item[3].item[0].item[3].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[3].item[0].item[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54139-1"} ).valueUri ) assert inst.item[2].item[3].item[0].item[3].linkId == "2.1.1.4" assert inst.item[2].item[3].item[0].item[3].text == "Living?" assert inst.item[2].item[3].item[0].item[4].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[3].item[0].item[4].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[3].item[0].item[4].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[3].item[0].item[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54121-9"} ).valueUri ) assert inst.item[2].item[3].item[0].item[4].linkId == "2.1.1.5" assert inst.item[2].item[3].item[0].item[4].text == "Was this person born a twin?" assert inst.item[2].item[3].item[0].item[5].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[3].item[0].item[5].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[3].item[0].item[5].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[3].item[0].item[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54122-7"} ).valueUri ) assert inst.item[2].item[3].item[0].item[5].linkId == "2.1.1.6" assert inst.item[2].item[3].item[0].item[5].text == "Was this person adopted?" assert inst.item[2].item[3].item[0].linkId == "2.1.1" assert inst.item[2].item[3].linkId == "2.1" assert ( inst.item[2].item[4].item[0].item[0].answer[0].valueCoding.code == "LA10420-0" ) assert inst.item[2].item[4].item[0].item[0].answer[0].valueCoding.display == "Niece" assert ( inst.item[2].item[4].item[0].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[4].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54136-7"} ).valueUri ) assert inst.item[2].item[4].item[0].item[0].linkId == "2.1.1.1" assert inst.item[2].item[4].item[0].item[0].text == "Relationship to you" assert inst.item[2].item[4].item[0].item[1].answer[0].valueString == "Helen" assert ( inst.item[2].item[4].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54138-3"} ).valueUri ) assert inst.item[2].item[4].item[0].item[1].linkId == "2.1.1.2" assert inst.item[2].item[4].item[0].item[1].text == "Name" assert inst.item[2].item[4].item[0].item[2].answer[0].valueCoding.code == "LA3-6" assert ( inst.item[2].item[4].item[0].item[2].answer[0].valueCoding.display == "Female" ) assert ( inst.item[2].item[4].item[0].item[2].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[4].item[0].item[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54123-5"} ).valueUri ) assert inst.item[2].item[4].item[0].item[2].linkId == "2.1.1.3" assert inst.item[2].item[4].item[0].item[2].text == "Gender" assert float( inst.item[2] .item[4] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueDecimal ) == float(15) assert ( inst.item[2].item[4].item[0].item[3].answer[0].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54141-7"} ).valueUri ) assert ( inst.item[2].item[4].item[0].item[3].answer[0].item[0].item[0].linkId == "2.1.1.4.2.2" ) assert inst.item[2].item[4].item[0].item[3].answer[0].item[0].item[0].text == "Age" assert inst.item[2].item[4].item[0].item[3].answer[0].item[0].linkId == "2.1.1.4.2" assert inst.item[2].item[4].item[0].item[3].answer[0].valueCoding.code == "LA33-6" assert inst.item[2].item[4].item[0].item[3].answer[0].valueCoding.display == "Yes" assert ( inst.item[2].item[4].item[0].item[3].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[4].item[0].item[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54139-1"} ).valueUri ) assert inst.item[2].item[4].item[0].item[3].linkId == "2.1.1.4" assert inst.item[2].item[4].item[0].item[3].text == "Living?" assert inst.item[2].item[4].item[0].item[4].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[4].item[0].item[4].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[4].item[0].item[4].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[4].item[0].item[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54121-9"} ).valueUri ) assert inst.item[2].item[4].item[0].item[4].linkId == "2.1.1.5" assert inst.item[2].item[4].item[0].item[4].text == "Was this person born a twin?" assert inst.item[2].item[4].item[0].item[5].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[4].item[0].item[5].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[4].item[0].item[5].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[4].item[0].item[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54122-7"} ).valueUri ) assert inst.item[2].item[4].item[0].item[5].linkId == "2.1.1.6" assert inst.item[2].item[4].item[0].item[5].text == "Was this person adopted?" assert inst.item[2].item[4].item[0].linkId == "2.1.1" assert inst.item[2].item[4].linkId == "2.1" assert ( inst.item[2].item[5].item[0].item[0].answer[0].valueCoding.code == "LA10416-8" ) assert ( inst.item[2].item[5].item[0].item[0].answer[0].valueCoding.display == "Father" ) assert ( inst.item[2].item[5].item[0].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[5].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54136-7"} ).valueUri ) assert inst.item[2].item[5].item[0].item[0].linkId == "2.1.1.1" assert inst.item[2].item[5].item[0].item[0].text == "Relationship to you" assert inst.item[2].item[5].item[0].item[1].answer[0].valueString == "Donald" assert ( inst.item[2].item[5].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54138-3"} ).valueUri ) assert inst.item[2].item[5].item[0].item[1].linkId == "2.1.1.2" assert inst.item[2].item[5].item[0].item[1].text == "Name" assert inst.item[2].item[5].item[0].item[2].answer[0].valueCoding.code == "LA2-8" assert inst.item[2].item[5].item[0].item[2].answer[0].valueCoding.display == "Male" assert ( inst.item[2].item[5].item[0].item[2].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[5].item[0].item[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54123-5"} ).valueUri ) assert inst.item[2].item[5].item[0].item[2].linkId == "2.1.1.3" assert inst.item[2].item[5].item[0].item[2].text == "Gender" assert float( inst.item[2] .item[5] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueDecimal ) == float(52) assert ( inst.item[2].item[5].item[0].item[3].answer[0].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54141-7"} ).valueUri ) assert ( inst.item[2].item[5].item[0].item[3].answer[0].item[0].item[0].linkId == "2.1.1.4.2.2" ) assert inst.item[2].item[5].item[0].item[3].answer[0].item[0].item[0].text == "Age" assert inst.item[2].item[5].item[0].item[3].answer[0].item[0].linkId == "2.1.1.4.2" assert inst.item[2].item[5].item[0].item[3].answer[0].valueCoding.code == "LA33-6" assert inst.item[2].item[5].item[0].item[3].answer[0].valueCoding.display == "Yes" assert ( inst.item[2].item[5].item[0].item[3].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[5].item[0].item[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54139-1"} ).valueUri ) assert inst.item[2].item[5].item[0].item[3].linkId == "2.1.1.4" assert inst.item[2].item[5].item[0].item[3].text == "Living?" assert inst.item[2].item[5].item[0].item[4].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[5].item[0].item[4].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[5].item[0].item[4].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[5].item[0].item[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54121-9"} ).valueUri ) assert inst.item[2].item[5].item[0].item[4].linkId == "2.1.1.5" assert inst.item[2].item[5].item[0].item[4].text == "Was this person born a twin?" assert inst.item[2].item[5].item[0].item[5].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[5].item[0].item[5].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[5].item[0].item[5].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[5].item[0].item[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54122-7"} ).valueUri ) assert inst.item[2].item[5].item[0].item[5].linkId == "2.1.1.6" assert inst.item[2].item[5].item[0].item[5].text == "Was this person adopted?" assert inst.item[2].item[5].item[0].linkId == "2.1.1" assert inst.item[2].item[5].linkId == "2.1" assert ( inst.item[2].item[6].item[0].item[0].answer[0].valueCoding.code == "LA10425-9" ) assert ( inst.item[2].item[6].item[0].item[0].answer[0].valueCoding.display == "Paternal Uncle" ) assert ( inst.item[2].item[6].item[0].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[6].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54136-7"} ).valueUri ) assert inst.item[2].item[6].item[0].item[0].linkId == "2.1.1.1" assert inst.item[2].item[6].item[0].item[0].text == "Relationship to you" assert inst.item[2].item[6].item[0].item[1].answer[0].valueString == "Eric" assert ( inst.item[2].item[6].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54138-3"} ).valueUri ) assert inst.item[2].item[6].item[0].item[1].linkId == "2.1.1.2" assert inst.item[2].item[6].item[0].item[1].text == "Name" assert inst.item[2].item[6].item[0].item[2].answer[0].valueCoding.code == "LA2-8" assert inst.item[2].item[6].item[0].item[2].answer[0].valueCoding.display == "Male" assert ( inst.item[2].item[6].item[0].item[2].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[6].item[0].item[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54123-5"} ).valueUri ) assert inst.item[2].item[6].item[0].item[2].linkId == "2.1.1.3" assert inst.item[2].item[6].item[0].item[2].text == "Gender" assert float( inst.item[2] .item[6] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueDecimal ) == float(56) assert ( inst.item[2].item[6].item[0].item[3].answer[0].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54141-7"} ).valueUri ) assert ( inst.item[2].item[6].item[0].item[3].answer[0].item[0].item[0].linkId == "2.1.1.4.2.2" ) assert inst.item[2].item[6].item[0].item[3].answer[0].item[0].item[0].text == "Age" assert inst.item[2].item[6].item[0].item[3].answer[0].item[0].linkId == "2.1.1.4.2" assert inst.item[2].item[6].item[0].item[3].answer[0].valueCoding.code == "LA33-6" assert inst.item[2].item[6].item[0].item[3].answer[0].valueCoding.display == "Yes" assert ( inst.item[2].item[6].item[0].item[3].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[6].item[0].item[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54139-1"} ).valueUri ) assert inst.item[2].item[6].item[0].item[3].linkId == "2.1.1.4" assert inst.item[2].item[6].item[0].item[3].text == "Living?" assert inst.item[2].item[6].item[0].item[4].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[6].item[0].item[4].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[6].item[0].item[4].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[6].item[0].item[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54121-9"} ).valueUri ) assert inst.item[2].item[6].item[0].item[4].linkId == "2.1.1.5" assert inst.item[2].item[6].item[0].item[4].text == "Was this person born a twin?" assert inst.item[2].item[6].item[0].item[5].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[6].item[0].item[5].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[6].item[0].item[5].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[6].item[0].item[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54122-7"} ).valueUri ) assert inst.item[2].item[6].item[0].item[5].linkId == "2.1.1.6" assert inst.item[2].item[6].item[0].item[5].text == "Was this person adopted?" assert inst.item[2].item[6].item[0].linkId == "2.1.1" assert inst.item[2].item[6].linkId == "2.1" assert ( inst.item[2].item[7].item[0].item[0].answer[0].valueCoding.code == "LA10421-8" ) assert ( inst.item[2].item[7].item[0].item[0].answer[0].valueCoding.display == "Paternal Aunt" ) assert ( inst.item[2].item[7].item[0].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[7].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54136-7"} ).valueUri ) assert inst.item[2].item[7].item[0].item[0].linkId == "2.1.1.1" assert inst.item[2].item[7].item[0].item[0].text == "Relationship to you" assert inst.item[2].item[7].item[0].item[1].answer[0].valueString == "Fiona" assert ( inst.item[2].item[7].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54138-3"} ).valueUri ) assert inst.item[2].item[7].item[0].item[1].linkId == "2.1.1.2" assert inst.item[2].item[7].item[0].item[1].text == "Name" assert inst.item[2].item[7].item[0].item[2].answer[0].valueCoding.code == "LA3-6" assert ( inst.item[2].item[7].item[0].item[2].answer[0].valueCoding.display == "Female" ) assert ( inst.item[2].item[7].item[0].item[2].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[7].item[0].item[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54123-5"} ).valueUri ) assert inst.item[2].item[7].item[0].item[2].linkId == "2.1.1.3" assert inst.item[2].item[7].item[0].item[2].text == "Gender" assert float( inst.item[2] .item[7] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueDecimal ) == float(57) assert ( inst.item[2].item[7].item[0].item[3].answer[0].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54141-7"} ).valueUri ) assert ( inst.item[2].item[7].item[0].item[3].answer[0].item[0].item[0].linkId == "2.1.1.4.2.2" ) assert inst.item[2].item[7].item[0].item[3].answer[0].item[0].item[0].text == "Age" assert inst.item[2].item[7].item[0].item[3].answer[0].item[0].linkId == "2.1.1.4.2" assert inst.item[2].item[7].item[0].item[3].answer[0].valueCoding.code == "LA33-6" assert inst.item[2].item[7].item[0].item[3].answer[0].valueCoding.display == "Yes" assert ( inst.item[2].item[7].item[0].item[3].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[7].item[0].item[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54139-1"} ).valueUri ) assert inst.item[2].item[7].item[0].item[3].linkId == "2.1.1.4" assert inst.item[2].item[7].item[0].item[3].text == "Living?" assert inst.item[2].item[7].item[0].item[4].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[7].item[0].item[4].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[7].item[0].item[4].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[7].item[0].item[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54121-9"} ).valueUri ) assert inst.item[2].item[7].item[0].item[4].linkId == "2.1.1.5" assert inst.item[2].item[7].item[0].item[4].text == "Was this person born a twin?" assert inst.item[2].item[7].item[0].item[5].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[7].item[0].item[5].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[7].item[0].item[5].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[7].item[0].item[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54122-7"} ).valueUri ) assert inst.item[2].item[7].item[0].item[5].linkId == "2.1.1.6" assert inst.item[2].item[7].item[0].item[5].text == "Was this person adopted?" assert inst.item[2].item[7].item[0].linkId == "2.1.1" assert ( inst.item[2].item[7].item[1].item[0].answer[0].valueCoding.code == "LA10543-9" ) assert ( inst.item[2].item[7].item[1].item[0].answer[0].valueCoding.display == "-- Skin Cancer" ) assert ( inst.item[2].item[7].item[1].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.item[2].item[7].item[1].item[0].linkId == "2.1.2.1" assert inst.item[2].item[7].item[1].item[0].text == "Disease or Condition" assert inst.item[2].item[7].item[1].linkId == "2.1.2" assert ( inst.item[2].item[7].item[1].text == "This family member's history of disease" ) assert inst.item[2].item[7].linkId == "2.1" assert ( inst.item[2].item[8].item[0].item[0].answer[0].valueCoding.code == "LA10423-4" ) assert ( inst.item[2].item[8].item[0].item[0].answer[0].valueCoding.display == "Paternal Grandfather" ) assert ( inst.item[2].item[8].item[0].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[8].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54136-7"} ).valueUri ) assert inst.item[2].item[8].item[0].item[0].linkId == "2.1.1.1" assert inst.item[2].item[8].item[0].item[0].text == "Relationship to you" assert inst.item[2].item[8].item[0].item[1].answer[0].valueString == "Bob" assert ( inst.item[2].item[8].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54138-3"} ).valueUri ) assert inst.item[2].item[8].item[0].item[1].linkId == "2.1.1.2" assert inst.item[2].item[8].item[0].item[1].text == "Name" assert inst.item[2].item[8].item[0].item[2].answer[0].valueCoding.code == "LA2-8" assert inst.item[2].item[8].item[0].item[2].answer[0].valueCoding.display == "Male" assert ( inst.item[2].item[8].item[0].item[2].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[8].item[0].item[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54123-5"} ).valueUri ) assert inst.item[2].item[8].item[0].item[2].linkId == "2.1.1.3" assert inst.item[2].item[8].item[0].item[2].text == "Gender" assert ( inst.item[2] .item[8] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueCoding.code == "LA10537-1" ) assert ( inst.item[2] .item[8] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueCoding.display == "-- Colon Cancer" ) assert ( inst.item[2] .item[8] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[8].item[0].item[3].answer[0].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54112-8"} ).valueUri ) assert ( inst.item[2].item[8].item[0].item[3].answer[0].item[0].item[0].linkId == "2.1.1.4.1.1" ) assert ( inst.item[2].item[8].item[0].item[3].answer[0].item[0].item[0].text == "Cause of Death" ) assert ( inst.item[2] .item[8] .item[0] .item[3] .answer[0] .item[0] .item[1] .answer[0] .valueCoding.code == "LA10400-2" ) assert ( inst.item[2] .item[8] .item[0] .item[3] .answer[0] .item[0] .item[1] .answer[0] .valueCoding.display == "OVER 60" ) assert ( inst.item[2] .item[8] .item[0] .item[3] .answer[0] .item[0] .item[1] .answer[0] .valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[8].item[0].item[3].answer[0].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54113-6"} ).valueUri ) assert ( inst.item[2].item[8].item[0].item[3].answer[0].item[0].item[1].linkId == "2.1.1.4.1.2" ) assert ( inst.item[2].item[8].item[0].item[3].answer[0].item[0].item[1].text == "Age at Death" ) assert inst.item[2].item[8].item[0].item[3].answer[0].item[0].linkId == "2.1.1.4.1" assert inst.item[2].item[8].item[0].item[3].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[8].item[0].item[3].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[8].item[0].item[3].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[8].item[0].item[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54139-1"} ).valueUri ) assert inst.item[2].item[8].item[0].item[3].linkId == "2.1.1.4" assert inst.item[2].item[8].item[0].item[3].text == "Living?" assert inst.item[2].item[8].item[0].item[4].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[8].item[0].item[4].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[8].item[0].item[4].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[8].item[0].item[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54121-9"} ).valueUri ) assert inst.item[2].item[8].item[0].item[4].linkId == "2.1.1.5" assert inst.item[2].item[8].item[0].item[4].text == "Was this person born a twin?" assert inst.item[2].item[8].item[0].item[5].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[8].item[0].item[5].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[8].item[0].item[5].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[8].item[0].item[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54122-7"} ).valueUri ) assert inst.item[2].item[8].item[0].item[5].linkId == "2.1.1.6" assert inst.item[2].item[8].item[0].item[5].text == "Was this person adopted?" assert inst.item[2].item[8].item[0].linkId == "2.1.1" assert ( inst.item[2].item[8].item[1].item[0].answer[0].valueCoding.code == "LA10537-1" ) assert ( inst.item[2].item[8].item[1].item[0].answer[0].valueCoding.display == "-- Colon Cancer" ) assert ( inst.item[2].item[8].item[1].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.item[2].item[8].item[1].item[0].linkId == "2.1.2.1" assert inst.item[2].item[8].item[1].item[0].text == "Disease or Condition" assert ( inst.item[2].item[8].item[1].item[1].answer[0].valueCoding.code == "LA10400-2" ) assert ( inst.item[2].item[8].item[1].item[1].answer[0].valueCoding.display == "OVER 60" ) assert ( inst.item[2].item[8].item[1].item[1].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.item[2].item[8].item[1].item[1].linkId == "2.1.2.2" assert inst.item[2].item[8].item[1].item[1].text == "Age at Diagnosis" assert inst.item[2].item[8].item[1].linkId == "2.1.2" assert ( inst.item[2].item[8].item[1].text == "This family member's history of disease" ) assert inst.item[2].item[8].linkId == "2.1" assert ( inst.item[2].item[9].item[0].item[0].answer[0].valueCoding.code == "LA10424-2" ) assert ( inst.item[2].item[9].item[0].item[0].answer[0].valueCoding.display == "Paternal Grandmother" ) assert ( inst.item[2].item[9].item[0].item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[9].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54136-7"} ).valueUri ) assert inst.item[2].item[9].item[0].item[0].linkId == "2.1.1.1" assert inst.item[2].item[9].item[0].item[0].text == "Relationship to you" assert inst.item[2].item[9].item[0].item[1].answer[0].valueString == "Claire" assert ( inst.item[2].item[9].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54138-3"} ).valueUri ) assert inst.item[2].item[9].item[0].item[1].linkId == "2.1.1.2" assert inst.item[2].item[9].item[0].item[1].text == "Name" assert inst.item[2].item[9].item[0].item[2].answer[0].valueCoding.code == "LA3-6" assert ( inst.item[2].item[9].item[0].item[2].answer[0].valueCoding.display == "Female" ) assert ( inst.item[2].item[9].item[0].item[2].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[9].item[0].item[2].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54123-5"} ).valueUri ) assert inst.item[2].item[9].item[0].item[2].linkId == "2.1.1.3" assert inst.item[2].item[9].item[0].item[2].text == "Gender" assert ( inst.item[2] .item[9] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .item[0] .answer[0] .valueString == "Lou Gehrigs" ) assert ( inst.item[2] .item[9] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .item[0] .linkId == "2.1.1.4.1.1.1" ) assert ( inst.item[2] .item[9] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .item[0] .text == "Please specify" ) assert ( inst.item[2] .item[9] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueCoding.code == "LA10589-2" ) assert ( inst.item[2] .item[9] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueCoding.display == "-- Other/Unexpected" ) assert ( inst.item[2] .item[9] .item[0] .item[3] .answer[0] .item[0] .item[0] .answer[0] .valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[9].item[0].item[3].answer[0].item[0].item[0].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54112-8"} ).valueUri ) assert ( inst.item[2].item[9].item[0].item[3].answer[0].item[0].item[0].linkId == "2.1.1.4.1.1" ) assert ( inst.item[2].item[9].item[0].item[3].answer[0].item[0].item[0].text == "Cause of Death" ) assert ( inst.item[2] .item[9] .item[0] .item[3] .answer[0] .item[0] .item[1] .answer[0] .valueCoding.code == "LA10400-2" ) assert ( inst.item[2] .item[9] .item[0] .item[3] .answer[0] .item[0] .item[1] .answer[0] .valueCoding.display == "OVER 60" ) assert ( inst.item[2] .item[9] .item[0] .item[3] .answer[0] .item[0] .item[1] .answer[0] .valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[9].item[0].item[3].answer[0].item[0].item[1].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54113-6"} ).valueUri ) assert ( inst.item[2].item[9].item[0].item[3].answer[0].item[0].item[1].linkId == "2.1.1.4.1.2" ) assert ( inst.item[2].item[9].item[0].item[3].answer[0].item[0].item[1].text == "Age at Death" ) assert inst.item[2].item[9].item[0].item[3].answer[0].item[0].linkId == "2.1.1.4.1" assert inst.item[2].item[9].item[0].item[3].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[9].item[0].item[3].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[9].item[0].item[3].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[9].item[0].item[3].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54139-1"} ).valueUri ) assert inst.item[2].item[9].item[0].item[3].linkId == "2.1.1.4" assert inst.item[2].item[9].item[0].item[3].text == "Living?" assert inst.item[2].item[9].item[0].item[4].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[9].item[0].item[4].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[9].item[0].item[4].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[9].item[0].item[4].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54121-9"} ).valueUri ) assert inst.item[2].item[9].item[0].item[4].linkId == "2.1.1.5" assert inst.item[2].item[9].item[0].item[4].text == "Was this person born a twin?" assert inst.item[2].item[9].item[0].item[5].answer[0].valueCoding.code == "LA32-8" assert inst.item[2].item[9].item[0].item[5].answer[0].valueCoding.display == "No" assert ( inst.item[2].item[9].item[0].item[5].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert ( inst.item[2].item[9].item[0].item[5].definition == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org/fhir/DataElement/54122-7"} ).valueUri ) assert inst.item[2].item[9].item[0].item[5].linkId == "2.1.1.6" assert inst.item[2].item[9].item[0].item[5].text == "Was this person adopted?" assert inst.item[2].item[9].item[0].linkId == "2.1.1" assert inst.item[2].item[9].linkId == "2.1" assert inst.item[2].linkId == "2" assert inst.item[2].text == "Family member health information" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.questionnaire == "http://hl7.org/fhir/Questionnaire/ussg-fht" assert inst.status == "in-progress" assert inst.subject.reference == "http://hl7.org/fhir/Patient/proband" assert ( inst.subject.type == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.text.status == "generated" def test_questionnaireresponse_2(base_settings): """No. 2 tests collection for QuestionnaireResponse. Test File: questionnaireresponse-example-ussg-fht-answers.json """ filename = ( base_settings["unittest_data_dir"] / "questionnaireresponse-example-ussg-fht-answers.json" ) inst = questionnaireresponse.QuestionnaireResponse.model_validate_json( filename.read_bytes() ) assert "QuestionnaireResponse" == inst.get_resource_type() impl_questionnaireresponse_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "QuestionnaireResponse" == data["resourceType"] inst2 = questionnaireresponse.QuestionnaireResponse(**data) impl_questionnaireresponse_2(inst2) def impl_questionnaireresponse_3(inst): assert inst.author.reference == "Practitioner/f201" assert ( inst.authored == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-06-18T00:00:00+01:00"} ).valueDateTime ) assert inst.id == "f201" assert inst.item[0].answer[0].valueBoolean is True assert inst.item[0].linkId == "1" assert inst.item[0].text == "Do you have allergies?" assert inst.item[1].item[0].answer[0].valueString == "Male" assert inst.item[1].item[0].linkId == "2.1" assert inst.item[1].item[0].text == "What is your gender?" assert ( inst.item[1].item[1].answer[0].valueDate == ExternalValidatorModel.model_validate({"valueDate": "1960-03-13"}).valueDate ) assert inst.item[1].item[1].linkId == "2.2" assert inst.item[1].item[1].text == "What is your date of birth?" assert inst.item[1].item[2].answer[0].valueString == "The Netherlands" assert inst.item[1].item[2].linkId == "2.3" assert inst.item[1].item[2].text == "What is your country of birth?" assert inst.item[1].item[3].answer[0].valueString == "married" assert inst.item[1].item[3].linkId == "2.4" assert inst.item[1].item[3].text == "What is your marital status?" assert inst.item[1].linkId == "2" assert inst.item[1].text == "General questions" assert inst.item[2].item[0].answer[0].valueBoolean is False assert inst.item[2].item[0].linkId == "3.1" assert inst.item[2].item[0].text == "Do you smoke?" assert inst.item[2].item[1].answer[0].valueBoolean is False assert inst.item[2].item[1].linkId == "3.2" assert inst.item[2].item[1].text == "Do you drink alchohol?" assert inst.item[2].linkId == "3" assert inst.item[2].text == "Intoxications" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.source.reference == "Practitioner/f201" assert inst.status == "completed" assert inst.subject.display == "Roel" assert inst.subject.reference == "Patient/f201" assert inst.text.status == "generated" def test_questionnaireresponse_3(base_settings): """No. 3 tests collection for QuestionnaireResponse. Test File: questionnaireresponse-example-f201-lifelines.json """ filename = ( base_settings["unittest_data_dir"] / "questionnaireresponse-example-f201-lifelines.json" ) inst = questionnaireresponse.QuestionnaireResponse.model_validate_json( filename.read_bytes() ) assert "QuestionnaireResponse" == inst.get_resource_type() impl_questionnaireresponse_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "QuestionnaireResponse" == data["resourceType"] inst2 = questionnaireresponse.QuestionnaireResponse(**data) impl_questionnaireresponse_3(inst2) def impl_questionnaireresponse_4(inst): assert inst.author.reference == "http://hl7.org/fhir/Practitioner/example" assert ( inst.author.type == ExternalValidatorModel.model_validate({"valueUri": "Practitioner"}).valueUri ) assert ( inst.authored == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-02-19T14:15:00+10:00"} ).valueDateTime ) assert inst.id == "bb" assert inst.item[0].item[0].item[0].answer[0].valueString == "Cathy Jones" assert inst.item[0].item[0].item[0].linkId == "nameOfChild" assert inst.item[0].item[0].item[0].text == "Name of child" assert inst.item[0].item[0].item[1].answer[0].valueCoding.code == "F" assert inst.item[0].item[0].item[1].linkId == "sex" assert inst.item[0].item[0].item[1].text == "Sex" assert inst.item[0].item[0].linkId == "group" assert float(inst.item[0].item[1].item[0].answer[0].valueDecimal) == float(3.25) assert inst.item[0].item[1].item[0].linkId == "birthWeight" assert inst.item[0].item[1].item[0].text == "Birth weight (kg)" assert float(inst.item[0].item[1].item[1].answer[0].valueDecimal) == float(44.3) assert inst.item[0].item[1].item[1].linkId == "birthLength" assert inst.item[0].item[1].item[1].text == "Birth length (cm)" assert ( inst.item[0].item[1].item[2].answer[0].item[0].item[0].answer[0].valueDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "1972-11-30"} ).valueDateTime ) assert ( inst.item[0].item[1].item[2].answer[0].item[0].item[0].linkId == "vitaminKDose1" ) assert inst.item[0].item[1].item[2].answer[0].item[0].item[0].text == "1st dose" assert ( inst.item[0].item[1].item[2].answer[0].item[0].item[1].answer[0].valueDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "1972-12-11"} ).valueDateTime ) assert ( inst.item[0].item[1].item[2].answer[0].item[0].item[1].linkId == "vitaminKDose2" ) assert inst.item[0].item[1].item[2].answer[0].item[0].item[1].text == "2nd dose" assert inst.item[0].item[1].item[2].answer[0].item[0].linkId == "vitaminKgivenDoses" assert inst.item[0].item[1].item[2].answer[0].valueCoding.code == "INJECTION" assert inst.item[0].item[1].item[2].linkId == "vitaminKgiven" assert inst.item[0].item[1].item[2].text == "Vitamin K given" assert ( inst.item[0].item[1].item[3].answer[0].item[0].answer[0].valueDate == ExternalValidatorModel.model_validate({"valueDate": "1972-12-04"}).valueDate ) assert inst.item[0].item[1].item[3].answer[0].item[0].linkId == "hepBgivenDate" assert inst.item[0].item[1].item[3].answer[0].item[0].text == "Date given" assert inst.item[0].item[1].item[3].answer[0].valueBoolean is True assert inst.item[0].item[1].item[3].linkId == "hepBgiven" assert inst.item[0].item[1].item[3].text == "Hep B given y / n" assert ( inst.item[0].item[1].item[4].answer[0].valueString == "Already able to speak Chinese" ) assert inst.item[0].item[1].item[4].linkId == "abnormalitiesAtBirth" assert inst.item[0].item[1].item[4].text == "Abnormalities noted at birth" assert inst.item[0].item[1].linkId == "neonatalInformation" assert inst.item[0].item[1].text == "Neonatal Information" assert inst.item[0].linkId == "birthDetails" assert inst.item[0].text == "Birth details - To be completed by health professional" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.questionnaire == "http://hl7.org/fhir/Questionnaire/bb" assert inst.status == "completed" assert inst.subject.reference == "http://hl7.org/fhir/Patient/1" assert ( inst.subject.type == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.text.status == "generated" def test_questionnaireresponse_4(base_settings): """No. 4 tests collection for QuestionnaireResponse. Test File: questionnaireresponse-example-bluebook.json """ filename = ( base_settings["unittest_data_dir"] / "questionnaireresponse-example-bluebook.json" ) inst = questionnaireresponse.QuestionnaireResponse.model_validate_json( filename.read_bytes() ) assert "QuestionnaireResponse" == inst.get_resource_type() impl_questionnaireresponse_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "QuestionnaireResponse" == data["resourceType"] inst2 = questionnaireresponse.QuestionnaireResponse(**data) impl_questionnaireresponse_4(inst2) def impl_questionnaireresponse_5(inst): assert ( inst.authored == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-12-11T04:44:16Z"} ).valueDateTime ) assert inst.id == "gcs" assert inst.item[0].answer[0].valueCoding.code == "LA6560-2" assert inst.item[0].answer[0].valueCoding.display == "Confused" assert ( inst.item[0].answer[0].valueCoding.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/itemWeight"} ).valueUri ) assert float(inst.item[0].answer[0].valueCoding.extension[0].valueDecimal) == float( 4 ) assert ( inst.item[0].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.item[0].linkId == "1.1" assert inst.item[1].answer[0].valueCoding.code == "LA6566-9" assert inst.item[1].answer[0].valueCoding.display == "Localizing pain" assert ( inst.item[1].answer[0].valueCoding.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/itemWeight"} ).valueUri ) assert float(inst.item[1].answer[0].valueCoding.extension[0].valueDecimal) == float( 5 ) assert ( inst.item[1].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.item[1].linkId == "1.2" assert inst.item[2].answer[0].valueCoding.code == "LA6556-0" assert inst.item[2].answer[0].valueCoding.display == "Eyes open spontaneously" assert ( inst.item[2].answer[0].valueCoding.extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/itemWeight"} ).valueUri ) assert float(inst.item[2].answer[0].valueCoding.extension[0].valueDecimal) == float( 4 ) assert ( inst.item[2].answer[0].valueCoding.system == ExternalValidatorModel.model_validate( {"valueUri": "http://loinc.org"} ).valueUri ) assert inst.item[2].linkId == "1.3" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.questionnaire == "http://hl7.org/fhir/Questionnaire/gcs" assert inst.source.reference == "Practitioner/f007" assert inst.status == "completed" assert inst.subject.display == "Peter James Chalmers" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_questionnaireresponse_5(base_settings): """No. 5 tests collection for QuestionnaireResponse. Test File: questionnaireresponse-example-gcs.json """ filename = ( base_settings["unittest_data_dir"] / "questionnaireresponse-example-gcs.json" ) inst = questionnaireresponse.QuestionnaireResponse.model_validate_json( filename.read_bytes() ) assert "QuestionnaireResponse" == inst.get_resource_type() impl_questionnaireresponse_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "QuestionnaireResponse" == data["resourceType"] inst2 = questionnaireresponse.QuestionnaireResponse(**data) impl_questionnaireresponse_5(inst2) ================================================ FILE: fhir/resources/tests/test_regulatedauthorization.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/RegulatedAuthorization Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import regulatedauthorization from .conftest import ExternalValidatorModel def impl_regulatedauthorization_1(inst): assert inst.holder.display == "EquiliDrugCo Holdings Inc." assert inst.holder.reference == "Organization/EqlidrugCo" assert inst.id == "basic-drug-auth" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.regulator.display == "FDA" assert inst.regulator.reference == "Organization/FDA" assert inst.status.coding[0].code == "active" assert ( inst.statusDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-01-01"} ).valueDateTime ) assert inst.subject[0].reference == "MedicinalProductDefinition/equilidem" assert inst.text.status == "generated" assert inst.type.text == "Regulatory Drug Marketing Approval" def test_regulatedauthorization_1(base_settings): """No. 1 tests collection for RegulatedAuthorization. Test File: regulatedauthorization-example-basic-drug-auth.json """ filename = ( base_settings["unittest_data_dir"] / "regulatedauthorization-example-basic-drug-auth.json" ) inst = regulatedauthorization.RegulatedAuthorization.model_validate_json( filename.read_bytes() ) assert "RegulatedAuthorization" == inst.get_resource_type() impl_regulatedauthorization_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RegulatedAuthorization" == data["resourceType"] inst2 = regulatedauthorization.RegulatedAuthorization(**data) impl_regulatedauthorization_1(inst2) def impl_regulatedauthorization_2(inst): assert ( inst.case.application[0].dateDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-01"} ).valueDateTime ) assert ( inst.case.application[0].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/applicationidentifier-number"} ).valueUri ) assert inst.case.application[0].identifier.value == "IA38G" assert ( inst.case.application[0].type.coding[0].code == "GroupTypeIAVariationNotification" ) assert ( inst.case.application[0].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://ema.europa.eu/example/marketingAuthorizationApplicationType" } ).valueUri ) assert ( inst.case.application[1].dateDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-01"} ).valueDateTime ) assert ( inst.case.application[1].identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/applicationidentifier-number"} ).valueUri ) assert inst.case.application[1].identifier.value == "IA38F" assert ( inst.case.application[1].type.coding[0].code == "GroupTypeIAVariationNotification" ) assert ( inst.case.application[1].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://ema.europa.eu/example/marketingAuthorizationApplicationType" } ).valueUri ) assert ( inst.case.datePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-21"} ).valueDateTime ) assert ( inst.case.datePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-02"} ).valueDateTime ) assert ( inst.case.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/procedureidentifier-number"} ).valueUri ) assert inst.case.identifier.value == "EMEA/H/C/009999/IA/0099/G" assert inst.case.type.coding[0].code == "VariationTypeIA" assert ( inst.case.type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://ema.europa.eu/example/marketingAuthorizationProcedureType" } ).valueUri ) assert inst.holder.reference == "Organization/example" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/marketingAuthorizationNumber"} ).valueUri ) assert inst.identifier[0].value == "EU/1/11/999/001" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.region[0].coding[0].code == "EU" assert ( inst.region[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/country"} ).valueUri ) assert inst.regulator.reference == "Organization/example" assert inst.status.coding[0].code == "active" assert ( inst.status.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://ema.europa.eu/example/authorizationstatus"} ).valueUri ) assert ( inst.statusDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-01-14"} ).valueDateTime ) assert inst.text.status == "generated" assert ( inst.validityPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2020-05-20"} ).valueDateTime ) assert ( inst.validityPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-09-03"} ).valueDateTime ) def test_regulatedauthorization_2(base_settings): """No. 2 tests collection for RegulatedAuthorization. Test File: regulatedauthorization-example.json """ filename = ( base_settings["unittest_data_dir"] / "regulatedauthorization-example.json" ) inst = regulatedauthorization.RegulatedAuthorization.model_validate_json( filename.read_bytes() ) assert "RegulatedAuthorization" == inst.get_resource_type() impl_regulatedauthorization_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RegulatedAuthorization" == data["resourceType"] inst2 = regulatedauthorization.RegulatedAuthorization(**data) impl_regulatedauthorization_2(inst2) ================================================ FILE: fhir/resources/tests/test_relatedperson.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/RelatedPerson Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import relatedperson from .conftest import ExternalValidatorModel def impl_relatedperson_1(inst): assert inst.active is True assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "2000-01-01"}).valueDate ) assert inst.gender == "female" assert inst.id == "relatedPersonDenovoMother" assert inst.identifier[0].assigner.display == "Child Hospital" assert ( inst.identifier[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01"} ).valueDateTime ) assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/persons"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "MR" assert inst.identifier[0].type.coding[0].display == "Medical record number" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].use == "temp" assert inst.identifier[0].value == "11112" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Doe" assert inst.name[0].given[0] == "Jane" assert inst.name[0].given[1] == "Mother" assert inst.name[0].use == "official" assert inst.patient.reference == "Patient/denovoChild" assert inst.relationship[0].coding[0].code == "NMTH" assert inst.relationship[0].coding[0].display == "natural mother" assert ( inst.relationship[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) assert inst.text.status == "generated" def test_relatedperson_1(base_settings): """No. 1 tests collection for RelatedPerson. Test File: RelatedPerson-denovoMother.json """ filename = base_settings["unittest_data_dir"] / "RelatedPerson-denovoMother.json" inst = relatedperson.RelatedPerson.model_validate_json(filename.read_bytes()) assert "RelatedPerson" == inst.get_resource_type() impl_relatedperson_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RelatedPerson" == data["resourceType"] inst2 = relatedperson.RelatedPerson(**data) impl_relatedperson_1(inst2) def impl_relatedperson_2(inst): assert inst.address[0].city == "PleasantVille" assert inst.address[0].line[0] == "534 Erewhon St" assert inst.address[0].postalCode == "3999" assert inst.address[0].state == "Vic" assert inst.address[0].use == "home" assert inst.gender == "male" assert inst.id == "peter" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Chalmers" assert inst.name[0].given[0] == "Peter" assert inst.name[0].given[1] == "James" assert inst.name[0].use == "official" assert inst.patient.reference == "Patient/animal" assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-03-11"} ).valueDateTime ) assert inst.photo[0].contentType == "image/jpeg" assert ( inst.photo[0].url == ExternalValidatorModel.model_validate({"valueUrl": "Binary/f012"}).valueUrl ) assert inst.relationship[0].coding[0].code == "C" assert ( inst.relationship[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0131"} ).valueUri ) assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "(03) 5555 6473" assert inst.text.status == "generated" def test_relatedperson_2(base_settings): """No. 2 tests collection for RelatedPerson. Test File: relatedperson-example-peter.json """ filename = base_settings["unittest_data_dir"] / "relatedperson-example-peter.json" inst = relatedperson.RelatedPerson.model_validate_json(filename.read_bytes()) assert "RelatedPerson" == inst.get_resource_type() impl_relatedperson_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RelatedPerson" == data["resourceType"] inst2 = relatedperson.RelatedPerson(**data) impl_relatedperson_2(inst2) def impl_relatedperson_3(inst): assert inst.gender == "female" assert inst.id == "f001" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:2.16.840.1.113883.2.4.6.3"} ).valueUri ) assert inst.identifier[0].type.text == "BSN" assert inst.identifier[0].use == "official" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Abels" assert inst.name[0].given[0] == "Sarah" assert inst.name[0].use == "usual" assert inst.patient.reference == "Patient/f001" assert inst.relationship[0].coding[0].code == "SIGOTHR" assert ( inst.relationship[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "mobile" assert inst.telecom[0].value == "0690383372" assert inst.telecom[1].system == "email" assert inst.telecom[1].use == "home" assert inst.telecom[1].value == "s.abels@kpn.nl" assert inst.text.status == "generated" def test_relatedperson_3(base_settings): """No. 3 tests collection for RelatedPerson. Test File: relatedperson-example-f001-sarah.json """ filename = ( base_settings["unittest_data_dir"] / "relatedperson-example-f001-sarah.json" ) inst = relatedperson.RelatedPerson.model_validate_json(filename.read_bytes()) assert "RelatedPerson" == inst.get_resource_type() impl_relatedperson_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RelatedPerson" == data["resourceType"] inst2 = relatedperson.RelatedPerson(**data) impl_relatedperson_3(inst2) def impl_relatedperson_4(inst): assert inst.active is True assert inst.address[0].line[0] == "2222 Home Street" assert inst.address[0].use == "home" assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1973-05-31"}).valueDate ) assert inst.gender == "female" assert inst.id == "newborn-mom" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/us-ssn"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "SS" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].value == "444222222" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Everywoman" assert inst.name[0].given[0] == "Eve" assert inst.name[0].use == "official" assert inst.patient.reference == "Patient/newborn" assert inst.relationship[0].coding[0].code == "NMTH" assert inst.relationship[0].coding[0].display == "natural mother" assert ( inst.relationship[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) assert inst.relationship[0].text == "Natural Mother" assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "work" assert inst.telecom[0].value == "555-555-2003" assert inst.text.status == "generated" def test_relatedperson_4(base_settings): """No. 4 tests collection for RelatedPerson. Test File: relatedperson-example-newborn-mom.json """ filename = ( base_settings["unittest_data_dir"] / "relatedperson-example-newborn-mom.json" ) inst = relatedperson.RelatedPerson.model_validate_json(filename.read_bytes()) assert "RelatedPerson" == inst.get_resource_type() impl_relatedperson_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RelatedPerson" == data["resourceType"] inst2 = relatedperson.RelatedPerson(**data) impl_relatedperson_4(inst2) def impl_relatedperson_5(inst): assert inst.active is True assert inst.address[0].city == "Paris" assert inst.address[0].country == "FRA" assert inst.address[0].line[0] == "43, Place du Marché Sainte Catherine" assert inst.address[0].postalCode == "75004" assert inst.gender == "female" assert inst.id == "benedicte" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.2.250.1.61"} ).valueUri ) assert inst.identifier[0].type.text == "INSEE" assert inst.identifier[0].use == "usual" assert inst.identifier[0].value == "272117510400399" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "du Marché" assert inst.name[0].given[0] == "Bénédicte" assert inst.patient.reference == "Patient/example" assert inst.photo[0].contentType == "image/jpeg" assert ( inst.photo[0].url == ExternalValidatorModel.model_validate({"valueUrl": "Binary/f016"}).valueUrl ) assert inst.relationship[0].coding[0].code == "N" assert ( inst.relationship[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0131"} ).valueUri ) assert inst.relationship[0].coding[1].code == "WIFE" assert ( inst.relationship[0].coding[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) assert inst.telecom[0].system == "phone" assert inst.telecom[0].value == "+33 (237) 998327" assert inst.text.status == "generated" def test_relatedperson_5(base_settings): """No. 5 tests collection for RelatedPerson. Test File: relatedperson-example.json """ filename = base_settings["unittest_data_dir"] / "relatedperson-example.json" inst = relatedperson.RelatedPerson.model_validate_json(filename.read_bytes()) assert "RelatedPerson" == inst.get_resource_type() impl_relatedperson_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RelatedPerson" == data["resourceType"] inst2 = relatedperson.RelatedPerson(**data) impl_relatedperson_5(inst2) def impl_relatedperson_6(inst): assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "1963"}).valueDate ) assert inst.gender == "female" assert inst.id == "f002" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].text == "Ariadne Bor-Jansma" assert inst.name[0].use == "usual" assert inst.patient.reference == "Patient/f201" assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "1975"} ).valueDateTime ) assert inst.photo[0].contentType == "image/jpeg" assert inst.relationship[0].coding[0].code == "SIGOTHR" assert ( inst.relationship[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) assert inst.telecom[0].system == "phone" assert inst.telecom[0].use == "home" assert inst.telecom[0].value == "+31201234567" assert inst.text.status == "generated" def test_relatedperson_6(base_settings): """No. 6 tests collection for RelatedPerson. Test File: relatedperson-example-f002-ariadne.json """ filename = ( base_settings["unittest_data_dir"] / "relatedperson-example-f002-ariadne.json" ) inst = relatedperson.RelatedPerson.model_validate_json(filename.read_bytes()) assert "RelatedPerson" == inst.get_resource_type() impl_relatedperson_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RelatedPerson" == data["resourceType"] inst2 = relatedperson.RelatedPerson(**data) impl_relatedperson_6(inst2) def impl_relatedperson_7(inst): assert inst.active is True assert ( inst.birthDate == ExternalValidatorModel.model_validate({"valueDate": "2000-01-01"}).valueDate ) assert inst.gender == "male" assert inst.id == "relatedPersonDenovoFather" assert inst.identifier[0].assigner.display == "Child Hospital" assert ( inst.identifier[0].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01"} ).valueDateTime ) assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/persons"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "MR" assert inst.identifier[0].type.coding[0].display == "Medical record number" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].use == "temp" assert inst.identifier[0].value == "11113" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].family == "Doe" assert inst.name[0].given[0] == "John" assert inst.name[0].given[1] == "Father" assert inst.name[0].use == "official" assert inst.patient.reference == "Patient/denovoChild" assert inst.relationship[0].coding[0].code == "NFTH" assert inst.relationship[0].coding[0].display == "natural Father" assert ( inst.relationship[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-RoleCode"} ).valueUri ) assert inst.text.status == "generated" def test_relatedperson_7(base_settings): """No. 7 tests collection for RelatedPerson. Test File: RelatedPerson-denovoFather.json """ filename = base_settings["unittest_data_dir"] / "RelatedPerson-denovoFather.json" inst = relatedperson.RelatedPerson.model_validate_json(filename.read_bytes()) assert "RelatedPerson" == inst.get_resource_type() impl_relatedperson_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RelatedPerson" == data["resourceType"] inst2 = relatedperson.RelatedPerson(**data) impl_relatedperson_7(inst2) ================================================ FILE: fhir/resources/tests/test_requestorchestration.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/RequestOrchestration Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import requestorchestration from .conftest import ExternalValidatorModel def impl_requestorchestration_1(inst): assert ( inst.action[0] .action[0] .action[0] .action[0] .action[0] .extension[0] .extension[0] .url == ExternalValidatorModel.model_validate({"valueUri": "day"}).valueUri ) assert ( inst.action[0] .action[0] .action[0] .action[0] .action[0] .extension[0] .extension[0] .valueInteger == 1 ) assert ( inst.action[0] .action[0] .action[0] .action[0] .action[0] .extension[0] .extension[1] .url == ExternalValidatorModel.model_validate({"valueUri": "day"}).valueUri ) assert ( inst.action[0] .action[0] .action[0] .action[0] .action[0] .extension[0] .extension[1] .valueInteger == 8 ) assert ( inst.action[0].action[0].action[0].action[0].action[0].extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/timing-daysOfCycle"} ).valueUri ) assert inst.action[0].action[0].action[0].action[0].action[0].id == "action-1" assert ( inst.action[0].action[0].action[0].action[0].action[0].resource.reference == "#1111" ) assert ( inst.action[0].action[0].action[0].action[0].action[0].textEquivalent == "Gemcitabine 1250 mg/m² IV over 30 minutes on days 1 and 8" ) assert ( inst.action[0] .action[0] .action[0] .action[0] .action[1] .extension[0] .extension[0] .url == ExternalValidatorModel.model_validate({"valueUri": "day"}).valueUri ) assert ( inst.action[0] .action[0] .action[0] .action[0] .action[1] .extension[0] .extension[0] .valueInteger == 1 ) assert ( inst.action[0].action[0].action[0].action[0].action[1].extension[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/timing-daysOfCycle"} ).valueUri ) assert inst.action[0].action[0].action[0].action[0].action[1].id == "action-2" assert ( inst.action[0] .action[0] .action[0] .action[0] .action[1] .relatedAction[0] .relationship == "concurrent-with-start" ) assert ( inst.action[0].action[0].action[0].action[0].action[1].relatedAction[0].targetId == "action-1" ) assert ( inst.action[0].action[0].action[0].action[0].action[1].resource.reference == "#2222" ) assert ( inst.action[0].action[0].action[0].action[0].action[1].textEquivalent == "CARBOplatin AUC 5 IV over 30 minutes on Day 1" ) assert inst.action[0].action[0].action[0].action[0].id == "cycle-definition-1" assert ( inst.action[0].action[0].action[0].action[0].textEquivalent == "21-day cycle for 6 cycles" ) assert inst.action[0].action[0].action[0].action[0].timingTiming.repeat.count == 6 assert float( inst.action[0].action[0].action[0].action[0].timingTiming.repeat.duration ) == float(21) assert ( inst.action[0].action[0].action[0].action[0].timingTiming.repeat.durationUnit == "d" ) assert inst.action[0].action[0].action[0].groupingBehavior == "sentence-group" assert inst.action[0].action[0].action[0].selectionBehavior == "exactly-one" assert inst.action[0].action[0].selectionBehavior == "all" assert inst.action[0].selectionBehavior == "exactly-one" assert inst.author.reference == "Practitioner/1" assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-06T17:31:00Z"} ).valueDateTime ) assert inst.contained[0].id == "1111" assert inst.contained[1].id == "2222" assert inst.encounter.reference == "Encounter/example" assert inst.id == "kdn5-example" assert inst.identifier[0].value == "requestorchestration-kdn5" assert ( inst.instantiatesCanonical[0] == "http://example.org/fhir/PlanDefinition/KDN5" ) assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.priority == "routine" assert inst.status == "draft" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Administer ' "gemcitabine and carboplatin.
" ) assert inst.text.status == "generated" def test_requestorchestration_1(base_settings): """No. 1 tests collection for RequestOrchestration. Test File: requestorchestration-kdn5-example.json """ filename = ( base_settings["unittest_data_dir"] / "requestorchestration-kdn5-example.json" ) inst = requestorchestration.RequestOrchestration.model_validate_json( filename.read_bytes() ) assert "RequestOrchestration" == inst.get_resource_type() impl_requestorchestration_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RequestOrchestration" == data["resourceType"] inst2 = requestorchestration.RequestOrchestration(**data) impl_requestorchestration_1(inst2) def impl_requestorchestration_2(inst): assert inst.action[0].action[0].description == "Administer medication 1" assert inst.action[0].action[0].id == "medication-action-1" assert inst.action[0].action[0].resource.reference == "#medicationrequest-1" assert inst.action[0].action[0].type.coding[0].code == "create" assert inst.action[0].action[1].description == "Administer medication 2" assert inst.action[0].action[1].id == "medication-action-2" assert inst.action[0].action[1].relatedAction[0].offsetDuration.unit == "h" assert float( inst.action[0].action[1].relatedAction[0].offsetDuration.value ) == float(1) assert inst.action[0].action[1].relatedAction[0].relationship == "after-end" assert inst.action[0].action[1].relatedAction[0].targetId == "medication-action-1" assert inst.action[0].action[1].resource.reference == "#medicationrequest-2" assert inst.action[0].action[1].type.coding[0].code == "create" assert inst.action[0].cardinalityBehavior == "single" assert ( inst.action[0].description == "Administer medications at the appropriate time" ) assert inst.action[0].groupingBehavior == "logical-group" assert inst.action[0].participant[0].actorReference.reference == "Practitioner/1" assert inst.action[0].precheckBehavior == "yes" assert inst.action[0].prefix == "1" assert inst.action[0].requiredBehavior == "must" assert inst.action[0].selectionBehavior == "all" assert inst.action[0].textEquivalent == ( "Administer medication 1, followed an hour later by " "medication 2" ) assert ( inst.action[0].timingDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-06T19:00:00Z"} ).valueDateTime ) assert inst.action[0].title == "Administer Medications" assert inst.author.reference == "Practitioner/1" assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-06T17:31:00Z"} ).valueDateTime ) assert inst.contained[0].id == "medicationrequest-1" assert inst.contained[1].id == "medicationrequest-2" assert inst.encounter.reference == "Encounter/example" assert ( inst.groupIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/treatment-group"} ).valueUri ) assert inst.groupIdentifier.value == "00001" assert inst.id == "example" assert inst.identifier[0].value == "requestorchestration-1" assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "Additional notes about the request group" assert inst.priority == "routine" assert inst.reason[0].concept.text == "Treatment" assert inst.status == "draft" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Example ' "RequestOrchestration illustrating related actions to " "administer medications in sequence with time delay.
" ) assert inst.text.status == "generated" def test_requestorchestration_2(base_settings): """No. 2 tests collection for RequestOrchestration. Test File: requestorchestration-example.json """ filename = base_settings["unittest_data_dir"] / "requestorchestration-example.json" inst = requestorchestration.RequestOrchestration.model_validate_json( filename.read_bytes() ) assert "RequestOrchestration" == inst.get_resource_type() impl_requestorchestration_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RequestOrchestration" == data["resourceType"] inst2 = requestorchestration.RequestOrchestration(**data) impl_requestorchestration_2(inst2) ================================================ FILE: fhir/resources/tests/test_requirements.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Requirements Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import requirements from .conftest import ExternalValidatorModel def impl_requirements_1(inst): assert inst.actor[0] == "http://hl7.org/fhir/ActorDefinition/server" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-11-02T14:31:30.239Z"} ).valueDateTime ) assert inst.derivedFrom[0] == "http://hl7.org/fhir/Requirements/example2" assert inst.description == "Example Requirements Set 2" assert inst.id == "example2" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.18.2" assert inst.name == "ExampleRequirements2" assert inst.statement[0].conformance[0] == "SHOULD" assert inst.statement[0].key == "44595579-fa13-42a5-bd24-0515cde96963" assert inst.statement[0].label == "requirement-B1" assert inst.statement[0].requirement == ( "Operations based on the SNOMED-CT should use the current " "version within 24 hours of each release" ) assert inst.statement[0].source[0].display == "Lloyd Mackenzie" assert inst.statement[1].conformance[0] == "SHALL" assert inst.statement[1].key == "46f77dcd-d51e-4738-b61f-22506d0cb0ac" assert inst.statement[1].label == "requirement-2/a" assert inst.statement[1].source[0].display == "Robert Hausam" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Example Requirements Set 2" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/Requirements/example2"} ).valueUri ) def test_requirements_1(base_settings): """No. 1 tests collection for Requirements. Test File: Requirements-example2.json """ filename = base_settings["unittest_data_dir"] / "Requirements-example2.json" inst = requirements.Requirements.model_validate_json(filename.read_bytes()) assert "Requirements" == inst.get_resource_type() impl_requirements_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Requirements" == data["resourceType"] inst2 = requirements.Requirements(**data) impl_requirements_1(inst2) def impl_requirements_2(inst): assert inst.actor[0] == "http://hl7.org/fhir/ActorDefinition/server" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-11-02T14:31:30.239Z"} ).valueDateTime ) assert inst.description == "Example Requirements Set 1" assert inst.id == "example1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.18.1" assert inst.name == "ExampleRequirements1" assert inst.statement[0].conformance[0] == "SHALL" assert inst.statement[0].key == "req-1" assert ( inst.statement[0].requirement == "The server SHALL support expanding value sets" ) assert ( inst.statement[0].satisfiedBy[0] == ExternalValidatorModel.model_validate( {"valueUrl": "http://hl7.org/fhir/terminology-service.html#expand"} ).valueUrl ) assert inst.statement[0].source[0].display == "Grahame Grieve" assert inst.statement[1].conformance[0] == "SHALL" assert inst.statement[1].key == "46f77dcd-d51e-4738-b61f-22506d0cb0ac" assert inst.statement[1].label == "requirement-2" assert inst.statement[1].requirement == ( "Operations based on the codeSystem resource SHALL have the " "same result whether or not the relationships are represented" " explicitly as properties or implicitly using the CodeSystem" " resource hierarchy" ) assert inst.statement[1].source[0].display == "Jose Costa Teixeira" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Example Requirements Set 1" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/Requirements/example1"} ).valueUri ) def test_requirements_2(base_settings): """No. 2 tests collection for Requirements. Test File: Requirements-example1.json """ filename = base_settings["unittest_data_dir"] / "Requirements-example1.json" inst = requirements.Requirements.model_validate_json(filename.read_bytes()) assert "Requirements" == inst.get_resource_type() impl_requirements_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Requirements" == data["resourceType"] inst2 = requirements.Requirements(**data) impl_requirements_2(inst2) ================================================ FILE: fhir/resources/tests/test_researchstudy.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ResearchStudy Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import researchstudy from .conftest import ExternalValidatorModel def impl_researchstudy_1(inst): assert inst.associatedParty[0].classifier[0].text == "INDUSTRY" assert inst.associatedParty[0].name == "Alebund Pharmaceuticals" assert inst.associatedParty[0].role.coding[0].code == "sponsor" assert inst.associatedParty[0].role.coding[0].display == "Sponsor" assert ( inst.associatedParty[0].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/research-study-party-role"} ).valueUri ) assert inst.associatedParty[1].classifier[0].text == "INDUSTRY" assert inst.associatedParty[1].name == "Alebund Pty Ltd" assert inst.associatedParty[1].role.coding[0].code == "lead-sponsor" assert inst.associatedParty[1].role.coding[0].display == "Lead Sponsor" assert ( inst.associatedParty[1].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/research-study-party-role"} ).valueUri ) assert inst.associatedParty[2].classifier[0].text == "Contact" assert inst.associatedParty[2].name == "Zhen LIU" assert inst.associatedParty[2].party.reference == "#NCT05503693-CentralContact-0" assert ( inst.associatedParty[2].party.type == ExternalValidatorModel.model_validate({"valueUri": "Practitioner"}).valueUri ) assert inst.associatedParty[2].role.coding[0].code == "recruitment-contact" assert inst.associatedParty[2].role.coding[0].display == "Recruitment Contact" assert ( inst.associatedParty[2].role.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/research-study-party-role"} ).valueUri ) assert inst.associatedParty[3].name == "Sam Francis, Doctor" assert inst.associatedParty[3].party.display == "Nucleus Network" assert inst.associatedParty[3].role.text == "Principal Investigator" assert inst.classifier[0].text == "Has Results: False" assert inst.classifier[1].text == "Oversight Classifier: oversightHasDmc Yes" assert inst.classifier[2].text == "Oversight Classifier: isFdaRegulatedDrug No" assert inst.classifier[3].text == "Oversight Classifier: isFdaRegulatedDevice No" assert inst.comparisonGroup[0].description == "AP303" assert inst.comparisonGroup[0].intendedExposure[0].display == "Drug: AP303 50 μg" assert ( inst.comparisonGroup[0].intendedExposure[0].reference == "#NCT05503693-drug------ap303-50-g" ) assert ( inst.comparisonGroup[0].intendedExposure[0].type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.comparisonGroup[0].intendedExposure[1].display == "Drug: AP303 150 μg" assert ( inst.comparisonGroup[0].intendedExposure[1].reference == "#NCT05503693-drug------ap303-150-g" ) assert ( inst.comparisonGroup[0].intendedExposure[1].type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.comparisonGroup[0].intendedExposure[2].display == "Drug: AP303 300 μg" assert ( inst.comparisonGroup[0].intendedExposure[2].reference == "#NCT05503693-drug------ap303-300-g" ) assert ( inst.comparisonGroup[0].intendedExposure[2].type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.comparisonGroup[0].intendedExposure[3].display == "Drug: AP303 600 μg" assert ( inst.comparisonGroup[0].intendedExposure[3].reference == "#NCT05503693-drug------ap303-600-g" ) assert ( inst.comparisonGroup[0].intendedExposure[3].type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.comparisonGroup[0].linkId == "ap303" assert inst.comparisonGroup[0].name == "AP303" assert inst.comparisonGroup[0].type.text == "Experimental" assert inst.comparisonGroup[1].description == "Placebo" assert inst.comparisonGroup[1].intendedExposure[0].display == "Drug: Placebo 50 μg" assert ( inst.comparisonGroup[1].intendedExposure[0].reference == "#NCT05503693-drug------placebo-50-g" ) assert ( inst.comparisonGroup[1].intendedExposure[0].type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.comparisonGroup[1].intendedExposure[1].display == "Drug: Placebo 150 μg" assert ( inst.comparisonGroup[1].intendedExposure[1].reference == "#NCT05503693-drug------placebo-150-g" ) assert ( inst.comparisonGroup[1].intendedExposure[1].type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.comparisonGroup[1].intendedExposure[2].display == "Drug: Placebo 300 μg" assert ( inst.comparisonGroup[1].intendedExposure[2].reference == "#NCT05503693-drug------placebo-300-g" ) assert ( inst.comparisonGroup[1].intendedExposure[2].type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.comparisonGroup[1].intendedExposure[3].display == "Drug: Placebo 600 μg" assert ( inst.comparisonGroup[1].intendedExposure[3].reference == "#NCT05503693-drug------placebo-600-g" ) assert ( inst.comparisonGroup[1].intendedExposure[3].type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.comparisonGroup[1].linkId == "placebo" assert inst.comparisonGroup[1].name == "Placebo" assert inst.comparisonGroup[1].type.text == "Placebo Comparator" assert inst.condition[0].text == "Healthy Subjects" assert inst.contained[0].id == "NCT05503693-drug------ap303-50-g" assert inst.contained[1].id == "NCT05503693-drug------ap303-150-g" assert inst.contained[2].id == "NCT05503693-drug------ap303-300-g" assert inst.contained[3].id == "NCT05503693-drug------ap303-600-g" assert inst.contained[4].id == "NCT05503693-drug------placebo-50-g" assert inst.contained[5].id == "NCT05503693-drug------placebo-150-g" assert inst.contained[6].id == "NCT05503693-drug------placebo-300-g" assert inst.contained[7].id == "NCT05503693-drug------placebo-600-g" assert inst.contained[8].id == "NCT05503693-CentralContact-0" assert inst.contained[9].id == "NCT05503693-Location-0-ResearchStudy" assert inst.id == "example-ctgov-study-record" assert inst.identifier[0].assigner.display == "Computable Publishing LLC" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://fevir.net"} ).valueUri ) assert inst.identifier[0].type.text == "FEvIR Object Identifier" assert inst.identifier[0].value == "112103" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "https://clinicaltrials.gov"} ).valueUri ) assert inst.identifier[1].use == "official" assert inst.identifier[1].value == "NCT05503693" assert inst.identifier[2].assigner.display == "Alebund Pharmaceuticals" assert inst.identifier[2].value == "AP303-PK-01" assert inst.keyword[0].text == ( "Safety, Tolerability, Pharmacokinetics, AP303, Healthy " "Subjects" ) assert inst.label[0].type.text == "Official Title" assert inst.name == "NCT05503693_FHIR_Transform" assert inst.outcomeMeasure[0].description == ( "Incidence and severity of adverse events (AEs), laboratory, " "ECG, and vital sign changes" ) assert ( inst.outcomeMeasure[0].name == "Single Dose and Food Effect Safety Outcome Measures" ) assert ( inst.outcomeMeasure[0].reference.identifier.assigner.display == "Computable Publishing LLC" ) assert ( inst.outcomeMeasure[0].reference.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "https://fevir.net/FLI"} ).valueUri ) assert ( inst.outcomeMeasure[0].reference.identifier.type.text == "FEvIR Linking Identifier" ) assert ( inst.outcomeMeasure[0].reference.identifier.value == "NCT05503693-primaryOutcome-0" ) assert ( inst.outcomeMeasure[0].reference.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.outcomeMeasure[0].type[0].coding[0].code == "primary" assert inst.outcomeMeasure[0].type[0].coding[0].display == "Primary" assert ( inst.outcomeMeasure[0].type[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/research-study-objective-type" } ).valueUri ) assert inst.outcomeMeasure[1].description == ( "Incidence and severity of AEs, laboratory, ECG, and vital " "sign changes." ) assert inst.outcomeMeasure[1].name == "Multiple Dose Safety Outcome Measures" assert ( inst.outcomeMeasure[1].reference.identifier.assigner.display == "Computable Publishing LLC" ) assert ( inst.outcomeMeasure[1].reference.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "https://fevir.net/FLI"} ).valueUri ) assert ( inst.outcomeMeasure[1].reference.identifier.type.text == "FEvIR Linking Identifier" ) assert ( inst.outcomeMeasure[1].reference.identifier.value == "NCT05503693-primaryOutcome-1" ) assert ( inst.outcomeMeasure[1].reference.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.outcomeMeasure[1].type[0].coding[0].code == "primary" assert inst.outcomeMeasure[1].type[0].coding[0].display == "Primary" assert ( inst.outcomeMeasure[1].type[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/research-study-objective-type" } ).valueUri ) assert inst.outcomeMeasure[2].description == "PK characteristics after single dose" assert inst.outcomeMeasure[2].name == "Cmax after single dose" assert ( inst.outcomeMeasure[2].reference.identifier.assigner.display == "Computable Publishing LLC" ) assert ( inst.outcomeMeasure[2].reference.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "https://fevir.net/FLI"} ).valueUri ) assert ( inst.outcomeMeasure[2].reference.identifier.type.text == "FEvIR Linking Identifier" ) assert ( inst.outcomeMeasure[2].reference.identifier.value == "NCT05503693-primaryOutcome-2" ) assert ( inst.outcomeMeasure[2].reference.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.outcomeMeasure[2].type[0].coding[0].code == "primary" assert inst.outcomeMeasure[2].type[0].coding[0].display == "Primary" assert ( inst.outcomeMeasure[2].type[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/research-study-objective-type" } ).valueUri ) assert inst.outcomeMeasure[3].description == "PK characteristics after single dose" assert inst.outcomeMeasure[3].name == "Tmax after single dose" assert ( inst.outcomeMeasure[3].reference.identifier.assigner.display == "Computable Publishing LLC" ) assert ( inst.outcomeMeasure[3].reference.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "https://fevir.net/FLI"} ).valueUri ) assert ( inst.outcomeMeasure[3].reference.identifier.type.text == "FEvIR Linking Identifier" ) assert ( inst.outcomeMeasure[3].reference.identifier.value == "NCT05503693-primaryOutcome-3" ) assert ( inst.outcomeMeasure[3].reference.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.outcomeMeasure[3].type[0].coding[0].code == "primary" assert inst.outcomeMeasure[3].type[0].coding[0].display == "Primary" assert ( inst.outcomeMeasure[3].type[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/research-study-objective-type" } ).valueUri ) assert inst.outcomeMeasure[4].description == "PK characteristics after single dose" assert inst.outcomeMeasure[4].name == "AUC0-last after single dose" assert ( inst.outcomeMeasure[4].reference.identifier.assigner.display == "Computable Publishing LLC" ) assert ( inst.outcomeMeasure[4].reference.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "https://fevir.net/FLI"} ).valueUri ) assert ( inst.outcomeMeasure[4].reference.identifier.type.text == "FEvIR Linking Identifier" ) assert ( inst.outcomeMeasure[4].reference.identifier.value == "NCT05503693-primaryOutcome-4" ) assert ( inst.outcomeMeasure[4].reference.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.outcomeMeasure[4].type[0].coding[0].code == "primary" assert inst.outcomeMeasure[4].type[0].coding[0].display == "Primary" assert ( inst.outcomeMeasure[4].type[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/research-study-objective-type" } ).valueUri ) assert inst.outcomeMeasure[5].description == "PK characteristics after single dose" assert inst.outcomeMeasure[5].name == "AUC0-inf after single dose" assert ( inst.outcomeMeasure[5].reference.identifier.assigner.display == "Computable Publishing LLC" ) assert ( inst.outcomeMeasure[5].reference.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "https://fevir.net/FLI"} ).valueUri ) assert ( inst.outcomeMeasure[5].reference.identifier.type.text == "FEvIR Linking Identifier" ) assert ( inst.outcomeMeasure[5].reference.identifier.value == "NCT05503693-primaryOutcome-5" ) assert ( inst.outcomeMeasure[5].reference.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.outcomeMeasure[5].type[0].coding[0].code == "primary" assert inst.outcomeMeasure[5].type[0].coding[0].display == "Primary" assert ( inst.outcomeMeasure[5].type[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/research-study-objective-type" } ).valueUri ) assert inst.outcomeMeasure[6].description == "PK characteristics after single dose" assert inst.outcomeMeasure[6].name == "t1/2 after single dose" assert ( inst.outcomeMeasure[6].reference.identifier.assigner.display == "Computable Publishing LLC" ) assert ( inst.outcomeMeasure[6].reference.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "https://fevir.net/FLI"} ).valueUri ) assert ( inst.outcomeMeasure[6].reference.identifier.type.text == "FEvIR Linking Identifier" ) assert ( inst.outcomeMeasure[6].reference.identifier.value == "NCT05503693-primaryOutcome-6" ) assert ( inst.outcomeMeasure[6].reference.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.outcomeMeasure[6].type[0].coding[0].code == "primary" assert inst.outcomeMeasure[6].type[0].coding[0].display == "Primary" assert ( inst.outcomeMeasure[6].type[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/research-study-objective-type" } ).valueUri ) assert inst.outcomeMeasure[7].description == "PK characteristics after single dose" assert inst.outcomeMeasure[7].name == "CL/F after single dose" assert ( inst.outcomeMeasure[7].reference.identifier.assigner.display == "Computable Publishing LLC" ) assert ( inst.outcomeMeasure[7].reference.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "https://fevir.net/FLI"} ).valueUri ) assert ( inst.outcomeMeasure[7].reference.identifier.type.text == "FEvIR Linking Identifier" ) assert ( inst.outcomeMeasure[7].reference.identifier.value == "NCT05503693-primaryOutcome-7" ) assert ( inst.outcomeMeasure[7].reference.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.outcomeMeasure[7].type[0].coding[0].code == "primary" assert inst.outcomeMeasure[7].type[0].coding[0].display == "Primary" assert ( inst.outcomeMeasure[7].type[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/research-study-objective-type" } ).valueUri ) assert inst.outcomeMeasure[8].description == "PK characteristics after single dose" assert inst.outcomeMeasure[8].name == "Ae and CLR (if warranted) after single dose" assert ( inst.outcomeMeasure[8].reference.identifier.assigner.display == "Computable Publishing LLC" ) assert ( inst.outcomeMeasure[8].reference.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "https://fevir.net/FLI"} ).valueUri ) assert ( inst.outcomeMeasure[8].reference.identifier.type.text == "FEvIR Linking Identifier" ) assert ( inst.outcomeMeasure[8].reference.identifier.value == "NCT05503693-primaryOutcome-8" ) assert ( inst.outcomeMeasure[8].reference.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.outcomeMeasure[8].type[0].coding[0].code == "primary" assert inst.outcomeMeasure[8].type[0].coding[0].display == "Primary" assert ( inst.outcomeMeasure[8].type[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/research-study-objective-type" } ).valueUri ) assert inst.outcomeMeasure[9].description == "PK characteristics after single dose" assert inst.outcomeMeasure[9].name == "V/F after single dose" assert ( inst.outcomeMeasure[9].reference.identifier.assigner.display == "Computable Publishing LLC" ) assert ( inst.outcomeMeasure[9].reference.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "https://fevir.net/FLI"} ).valueUri ) assert ( inst.outcomeMeasure[9].reference.identifier.type.text == "FEvIR Linking Identifier" ) assert ( inst.outcomeMeasure[9].reference.identifier.value == "NCT05503693-primaryOutcome-9" ) assert ( inst.outcomeMeasure[9].reference.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.outcomeMeasure[9].type[0].coding[0].code == "primary" assert inst.outcomeMeasure[9].type[0].coding[0].display == "Primary" assert ( inst.outcomeMeasure[9].type[0].coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/research-study-objective-type" } ).valueUri ) assert inst.phase.coding[0].code == "phase-1" assert inst.phase.coding[0].display == "Phase 1" assert ( inst.phase.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/research-study-phase"} ).valueUri ) assert inst.primaryPurposeType.coding[0].code == "treatment" assert inst.primaryPurposeType.coding[0].display == "Treatment" assert ( inst.primaryPurposeType.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/research-study-prim-purp-type" } ).valueUri ) assert inst.progressStatus[0].state.coding[0].code == "recruiting" assert inst.progressStatus[0].state.coding[0].display == "Recruiting" assert ( inst.progressStatus[0].state.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/research-study-status"} ).valueUri ) assert inst.progressStatus[1].actual is False assert ( inst.progressStatus[1].period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-06"} ).valueDateTime ) assert ( inst.progressStatus[1].period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-12-06"} ).valueDateTime ) assert inst.progressStatus[1].state.coding[0].code == "overall-study" assert inst.progressStatus[1].state.coding[0].display == "Overall Study" assert ( inst.progressStatus[1].state.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/research-study-status"} ).valueUri ) assert ( inst.recruitment.eligibility.identifier.assigner.display == "Computable Publishing LLC" ) assert ( inst.recruitment.eligibility.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "https://fevir.net/FLI"} ).valueUri ) assert ( inst.recruitment.eligibility.identifier.type.text == "FEvIR Linking Identifier" ) assert ( inst.recruitment.eligibility.identifier.value == "NCT05503693 Eligibility Criteria" ) assert ( inst.recruitment.eligibility.reference == "https://fevir.net/resources/EvidenceVariable/112075" ) assert ( inst.recruitment.eligibility.type == ExternalValidatorModel.model_validate( {"valueUri": "EvidenceVariable"} ).valueUri ) assert inst.recruitment.targetNumber == 62 assert ( inst.relatedArtifact[0].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "https://beta.clinicaltrials.gov/api/v2/studies/NCT05503693"} ).valueUrl ) assert inst.relatedArtifact[0].type == "transforms" assert inst.relatedArtifact[1].display == ( "Computable Publishing®: ClinicalTrials.gov-to-FEvIR " "Converter" ) assert ( inst.relatedArtifact[1].document.url == ExternalValidatorModel.model_validate( {"valueUrl": "https://fevir.net/resources/Project/29885"} ).valueUrl ) assert inst.relatedArtifact[1].type == "transformed-with" assert inst.site[0].reference == "#NCT05503693-Location-0-ResearchStudy" assert ( inst.site[0].type == ExternalValidatorModel.model_validate({"valueUri": "ResearchStudy"}).valueUri ) assert inst.status == "active" assert inst.studyDesign[0].text == "Design Masking: Quadruple" assert inst.studyDesign[1].text == "Design Who Masked: Participant" assert inst.studyDesign[2].text == "Design Who Masked: Care Provider" assert inst.studyDesign[3].text == "Design Who Masked: Investigator" assert inst.studyDesign[4].text == "Design Who Masked: Outcomes Assessor" assert inst.studyDesign[5].text == "Design Allocation: Randomized" assert ( inst.studyDesign[6].text == "Design Intervention Model: Sequential Assignment" ) assert inst.studyDesign[7].text == "CT.gov StudyType: INTERVENTIONAL" assert inst.text.status == "generated" assert inst.title == ( "A Safety, Tolerability, and Pharmacokinetics Study of AP303 " "in Healthy Subjects" ) assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "https://fevir.net/resources/ResearchStudy/112103"} ).valueUri ) def test_researchstudy_1(base_settings): """No. 1 tests collection for ResearchStudy. Test File: researchstudy-example-ctgov-study-record.json """ filename = ( base_settings["unittest_data_dir"] / "researchstudy-example-ctgov-study-record.json" ) inst = researchstudy.ResearchStudy.model_validate_json(filename.read_bytes()) assert "ResearchStudy" == inst.get_resource_type() impl_researchstudy_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ResearchStudy" == data["resourceType"] inst2 = researchstudy.ResearchStudy(**data) impl_researchstudy_1(inst2) ================================================ FILE: fhir/resources/tests/test_researchsubject.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ResearchSubject Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import researchsubject from .conftest import ExternalValidatorModel def impl_researchsubject_1(inst): assert inst.actualComparisonGroup == "ap303" assert inst.assignedComparisonGroup == "placebo" assert inst.id == "example-crossover-placebo-to-drug" assert inst.identifier[0].value == "ecsr45" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.period.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-06-10"} ).valueDateTime ) assert inst.progress[0].type.coding[0].code == "Enrollment" assert ( inst.progress[0].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/research-subject-state-type" } ).valueUri ) assert inst.progress[0].type.text == "Enrollment status" assert inst.progress[1].reason.coding[0].code == "informedConsentSigned" assert inst.progress[1].reason.text == "Informed consent signed" assert ( inst.progress[1].startDate == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-06-10"} ).valueDateTime ) assert inst.progress[1].subjectState.coding[0].code == "on-study" assert ( inst.progress[1].subjectState.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/research-subject-state"} ).valueUri ) assert inst.progress[1].subjectState.text == "On-study" assert inst.progress[1].type.coding[0].code == "Enrollment" assert ( inst.progress[1].type.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/research-subject-state-type" } ).valueUri ) assert inst.progress[1].type.text == "Enrollment status" assert inst.status == "active" assert inst.study.reference == "example-ctgov-study-record" assert inst.subject.reference == "cfsb1676546565857" assert inst.text.status == "generated" def test_researchsubject_1(base_settings): """No. 1 tests collection for ResearchSubject. Test File: researchsubject-example-crossover-placebo-to-drug.json """ filename = ( base_settings["unittest_data_dir"] / "researchsubject-example-crossover-placebo-to-drug.json" ) inst = researchsubject.ResearchSubject.model_validate_json(filename.read_bytes()) assert "ResearchSubject" == inst.get_resource_type() impl_researchsubject_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ResearchSubject" == data["resourceType"] inst2 = researchsubject.ResearchSubject(**data) impl_researchsubject_1(inst2) ================================================ FILE: fhir/resources/tests/test_riskassessment.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/RiskAssessment Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import riskassessment from .conftest import ExternalValidatorModel def impl_riskassessment_1(inst): assert inst.contained[0].id == "group1" assert inst.id == "population" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "final" assert inst.subject.reference == "#group1" assert inst.text.status == "generated" def test_riskassessment_1(base_settings): """No. 1 tests collection for RiskAssessment. Test File: riskassessment-example-population.json """ filename = ( base_settings["unittest_data_dir"] / "riskassessment-example-population.json" ) inst = riskassessment.RiskAssessment.model_validate_json(filename.read_bytes()) assert "RiskAssessment" == inst.get_resource_type() impl_riskassessment_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RiskAssessment" == data["resourceType"] inst2 = riskassessment.RiskAssessment(**data) impl_riskassessment_1(inst2) def impl_riskassessment_2(inst): assert inst.basis[0].reference == "Patient/pat2" assert inst.basis[1].reference == "DiagnosticReport/lipids" assert inst.basis[2].reference == "Observation/blood-pressure" assert inst.encounter.reference == "Encounter/example" assert inst.id == "cardiac" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "risk-assessment-cardiac" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-07-19T16:04:00Z"} ).valueDateTime ) assert inst.performer.display == "http://cvdrisk.nhlbi.nih.gov/#cholesterol" assert inst.prediction[0].outcome.text == "Heart Attack" assert float(inst.prediction[0].probabilityDecimal) == float(0.02) assert inst.prediction[0].whenRange.high.code == "a" assert ( inst.prediction[0].whenRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[0].whenRange.high.unit == "years" assert float(inst.prediction[0].whenRange.high.value) == float(49) assert inst.prediction[0].whenRange.low.code == "a" assert ( inst.prediction[0].whenRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[0].whenRange.low.unit == "years" assert float(inst.prediction[0].whenRange.low.value) == float(39) assert inst.status == "final" assert inst.subject.reference == "Patient/pat2" assert inst.text.status == "additional" def test_riskassessment_2(base_settings): """No. 2 tests collection for RiskAssessment. Test File: riskassessment-example-cardiac.json """ filename = ( base_settings["unittest_data_dir"] / "riskassessment-example-cardiac.json" ) inst = riskassessment.RiskAssessment.model_validate_json(filename.read_bytes()) assert "RiskAssessment" == inst.get_resource_type() impl_riskassessment_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RiskAssessment" == data["resourceType"] inst2 = riskassessment.RiskAssessment(**data) impl_riskassessment_2(inst2) def impl_riskassessment_3(inst): assert inst.basis[0].reference == "List/prognosis" assert inst.id == "genetic" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.method.coding[0].code == "BRCAPRO" assert inst.note[0].text == "High degree of certainty" assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2006-01-13T23:01:00Z"} ).valueDateTime ) assert inst.prediction[0].outcome.text == "Breast Cancer" assert float(inst.prediction[0].probabilityDecimal) == float(0.000168) assert inst.prediction[0].whenRange.high.code == "a" assert ( inst.prediction[0].whenRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[0].whenRange.high.unit == "years" assert float(inst.prediction[0].whenRange.high.value) == float(53) assert inst.prediction[1].outcome.text == "Breast Cancer" assert float(inst.prediction[1].probabilityDecimal) == float(0.000368) assert inst.prediction[1].whenRange.high.code == "a" assert ( inst.prediction[1].whenRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[1].whenRange.high.unit == "years" assert float(inst.prediction[1].whenRange.high.value) == float(57) assert inst.prediction[1].whenRange.low.code == "a" assert ( inst.prediction[1].whenRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[1].whenRange.low.unit == "years" assert float(inst.prediction[1].whenRange.low.value) == float(54) assert inst.prediction[2].outcome.text == "Breast Cancer" assert float(inst.prediction[2].probabilityDecimal) == float(0.000594) assert inst.prediction[2].whenRange.high.code == "a" assert ( inst.prediction[2].whenRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[2].whenRange.high.unit == "years" assert float(inst.prediction[2].whenRange.high.value) == float(62) assert inst.prediction[2].whenRange.low.code == "a" assert ( inst.prediction[2].whenRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[2].whenRange.low.unit == "years" assert float(inst.prediction[2].whenRange.low.value) == float(58) assert inst.prediction[3].outcome.text == "Breast Cancer" assert float(inst.prediction[3].probabilityDecimal) == float(0.000838) assert inst.prediction[3].whenRange.high.code == "a" assert ( inst.prediction[3].whenRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[3].whenRange.high.unit == "years" assert float(inst.prediction[3].whenRange.high.value) == float(67) assert inst.prediction[3].whenRange.low.code == "a" assert ( inst.prediction[3].whenRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[3].whenRange.low.unit == "years" assert float(inst.prediction[3].whenRange.low.value) == float(63) assert inst.prediction[4].outcome.text == "Breast Cancer" assert float(inst.prediction[4].probabilityDecimal) == float(0.001089) assert inst.prediction[4].whenRange.high.code == "a" assert ( inst.prediction[4].whenRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[4].whenRange.high.unit == "years" assert float(inst.prediction[4].whenRange.high.value) == float(72) assert inst.prediction[4].whenRange.low.code == "a" assert ( inst.prediction[4].whenRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[4].whenRange.low.unit == "years" assert float(inst.prediction[4].whenRange.low.value) == float(68) assert inst.prediction[5].outcome.text == "Breast Cancer" assert float(inst.prediction[5].probabilityDecimal) == float(0.001327) assert inst.prediction[5].whenRange.high.code == "a" assert ( inst.prediction[5].whenRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[5].whenRange.high.unit == "years" assert float(inst.prediction[5].whenRange.high.value) == float(77) assert inst.prediction[5].whenRange.low.code == "a" assert ( inst.prediction[5].whenRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[5].whenRange.low.unit == "years" assert float(inst.prediction[5].whenRange.low.value) == float(73) assert inst.prediction[6].outcome.text == "Breast Cancer" assert float(inst.prediction[6].probabilityDecimal) == float(0.00153) assert inst.prediction[6].whenRange.high.code == "a" assert ( inst.prediction[6].whenRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[6].whenRange.high.unit == "years" assert float(inst.prediction[6].whenRange.high.value) == float(82) assert inst.prediction[6].whenRange.low.code == "a" assert ( inst.prediction[6].whenRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[6].whenRange.low.unit == "years" assert float(inst.prediction[6].whenRange.low.value) == float(78) assert inst.prediction[7].outcome.text == "Breast Cancer" assert float(inst.prediction[7].probabilityDecimal) == float(0.001663) assert inst.prediction[7].whenRange.high.code == "a" assert ( inst.prediction[7].whenRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[7].whenRange.high.unit == "years" assert float(inst.prediction[7].whenRange.high.value) == float(88) assert inst.prediction[7].whenRange.low.code == "a" assert ( inst.prediction[7].whenRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[7].whenRange.low.unit == "years" assert float(inst.prediction[7].whenRange.low.value) == float(83) assert inst.status == "final" assert inst.subject.reference == "Patient/b248b1b2-1686-4b94-9936-37d7a5f94b51" assert inst.text.status == "generated" def test_riskassessment_3(base_settings): """No. 3 tests collection for RiskAssessment. Test File: riskassessment-example.json """ filename = base_settings["unittest_data_dir"] / "riskassessment-example.json" inst = riskassessment.RiskAssessment.model_validate_json(filename.read_bytes()) assert "RiskAssessment" == inst.get_resource_type() impl_riskassessment_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RiskAssessment" == data["resourceType"] inst2 = riskassessment.RiskAssessment(**data) impl_riskassessment_3(inst2) def impl_riskassessment_4(inst): assert inst.basedOn.reference == "ImmunizationRecommendation/example" assert inst.basis[0].reference == "DiagnosticReport/example" assert inst.basis[1].reference == "Observation/example" assert inst.code.coding[0].code == "709510001" assert inst.code.coding[0].display == "Assessment of risk for disease (procedure)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://browser.ihtsdotools.org/"} ).valueUri ) assert inst.condition.reference == "Condition/example" assert inst.encounter.display == "Encounter with patient @example" assert inst.encounter.reference == "Encounter/example" assert inst.id == "riskexample" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "risk-assessment-breastcancer1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "This risk assessment is for reference only" assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-10-10"} ).valueDateTime ) assert inst.parent.reference == "DiagnosticReport/example" assert inst.performer.reference == "Practitioner/example" assert inst.prediction[0].outcome.text == "Breast Cancer" assert float(inst.prediction[0].probabilityDecimal) == float(0.000368) assert inst.prediction[0].whenRange.high.code == "a" assert ( inst.prediction[0].whenRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[0].whenRange.high.unit == "years" assert float(inst.prediction[0].whenRange.high.value) == float(57) assert inst.prediction[0].whenRange.low.code == "a" assert ( inst.prediction[0].whenRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.prediction[0].whenRange.low.unit == "years" assert float(inst.prediction[0].whenRange.low.value) == float(54) assert inst.status == "final" assert inst.subject.reference == "Patient/example" assert inst.text.div == ( '
Risk assessment ' "for reference only
" ) assert inst.text.status == "generated" def test_riskassessment_4(base_settings): """No. 4 tests collection for RiskAssessment. Test File: riskassessment-riskexample.json """ filename = base_settings["unittest_data_dir"] / "riskassessment-riskexample.json" inst = riskassessment.RiskAssessment.model_validate_json(filename.read_bytes()) assert "RiskAssessment" == inst.get_resource_type() impl_riskassessment_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RiskAssessment" == data["resourceType"] inst2 = riskassessment.RiskAssessment(**data) impl_riskassessment_4(inst2) def impl_riskassessment_5(inst): assert inst.basis[0].reference == "Observation/example-genetics-brcapat" assert inst.code.coding[0].code == "709510001" assert inst.code.coding[0].display == "Assessment of risk for disease (procedure)" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://browser.ihtsdotools.org/"} ).valueUri ) assert inst.id == "breastcancer-risk" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "risk-assessment-breastcancer1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == ( "This risk assessment is based on BRCA1 and BRCA2 genetic " "mutation test" ) assert inst.performer.reference == "Practitioner/example" assert inst.prediction[0].outcome.text == "Unknown risk of developing breast cancer" assert inst.status == "final" assert inst.subject.reference == "Patient/example" assert inst.text.status == "additional" def test_riskassessment_5(base_settings): """No. 5 tests collection for RiskAssessment. Test File: riskassessment-example-breastcancer.json """ filename = ( base_settings["unittest_data_dir"] / "riskassessment-example-breastcancer.json" ) inst = riskassessment.RiskAssessment.model_validate_json(filename.read_bytes()) assert "RiskAssessment" == inst.get_resource_type() impl_riskassessment_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RiskAssessment" == data["resourceType"] inst2 = riskassessment.RiskAssessment(**data) impl_riskassessment_5(inst2) def impl_riskassessment_6(inst): assert inst.condition.display == "Ischemic Stroke" assert inst.condition.reference == "Condition/stroke" assert inst.id == "prognosis" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2010-11-22"} ).valueDateTime ) assert ( inst.prediction[0].outcome.coding[0].code == "249943000:363698007=72098002,260868000=6934004" ) assert ( inst.prediction[0].outcome.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.prediction[0].outcome.text == "permanent weakness of the left arm" assert inst.prediction[0].qualitativeRisk.coding[0].code == "moderate" assert inst.prediction[0].qualitativeRisk.coding[0].display == "moderate likelihood" assert ( inst.prediction[0].qualitativeRisk.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/risk-probability"} ).valueUri ) assert inst.status == "final" assert inst.subject.reference == "Patient/example" assert inst.text.status == "additional" def test_riskassessment_6(base_settings): """No. 6 tests collection for RiskAssessment. Test File: riskassessment-example-prognosis.json """ filename = ( base_settings["unittest_data_dir"] / "riskassessment-example-prognosis.json" ) inst = riskassessment.RiskAssessment.model_validate_json(filename.read_bytes()) assert "RiskAssessment" == inst.get_resource_type() impl_riskassessment_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "RiskAssessment" == data["resourceType"] inst2 = riskassessment.RiskAssessment(**data) impl_riskassessment_6(inst2) ================================================ FILE: fhir/resources/tests/test_schedule.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Schedule Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import schedule from .conftest import ExternalValidatorModel def impl_schedule_1(inst): assert inst.active is True assert inst.actor[0].display == "Dr. Beverly Crusher" assert inst.actor[0].reference == "Practitioner/1" assert inst.actor[1].display == "USS Enterprise-D Sickbay" assert inst.actor[1].reference == "Location/3" assert inst.comment == ( "The slots attached to this schedule are for genetic " "counselling in the USS Enterprise-D Sickbay." ) assert inst.id == "exampleloc1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/scheduleid"} ).valueUri ) assert inst.identifier[0].use == "usual" assert inst.identifier[0].value == "46" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.planningHorizon.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-12-25T09:30:00Z"} ).valueDateTime ) assert ( inst.planningHorizon.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-12-25T09:15:00Z"} ).valueDateTime ) assert inst.serviceCategory[0].coding[0].code == "17" assert inst.serviceCategory[0].coding[0].display == "General Practice" assert ( inst.serviceCategory[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/service-category"} ).valueUri ) assert inst.serviceType[0].concept.coding[0].code == "75" assert inst.serviceType[0].concept.coding[0].display == "Genetic Counselling" assert ( inst.serviceType[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/service-type"} ).valueUri ) assert inst.specialty[0].coding[0].code == "394580004" assert inst.specialty[0].coding[0].display == "Clinical genetics" assert ( inst.specialty[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.text.status == "generated" def test_schedule_1(base_settings): """No. 1 tests collection for Schedule. Test File: schedule-provider-location1-example.json """ filename = ( base_settings["unittest_data_dir"] / "schedule-provider-location1-example.json" ) inst = schedule.Schedule.model_validate_json(filename.read_bytes()) assert "Schedule" == inst.get_resource_type() impl_schedule_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Schedule" == data["resourceType"] inst2 = schedule.Schedule(**data) impl_schedule_1(inst2) def impl_schedule_2(inst): assert inst.active is True assert inst.actor[0].display == "Burgers UMC, South Wing, second floor" assert inst.actor[0].reference == "Location/1" assert inst.comment == ( "The slots attached to this schedule should be specialized to" " cover immunizations within the clinic" ) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/scheduleid"} ).valueUri ) assert inst.identifier[0].use == "usual" assert inst.identifier[0].value == "45" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Burgers UMC, South Wing - Immunizations" assert ( inst.planningHorizon.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-12-25T09:30:00Z"} ).valueDateTime ) assert ( inst.planningHorizon.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-12-25T09:15:00Z"} ).valueDateTime ) assert inst.serviceCategory[0].coding[0].code == "17" assert inst.serviceCategory[0].coding[0].display == "General Practice" assert ( inst.serviceCategory[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/service-category"} ).valueUri ) assert inst.serviceType[0].concept.coding[0].code == "57" assert inst.serviceType[0].concept.coding[0].display == "Immunization" assert ( inst.serviceType[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/service-type"} ).valueUri ) assert inst.specialty[0].coding[0].code == "408480009" assert inst.specialty[0].coding[0].display == "Clinical immunology" assert ( inst.specialty[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.text.status == "generated" def test_schedule_2(base_settings): """No. 2 tests collection for Schedule. Test File: schedule-example.json """ filename = base_settings["unittest_data_dir"] / "schedule-example.json" inst = schedule.Schedule.model_validate_json(filename.read_bytes()) assert "Schedule" == inst.get_resource_type() impl_schedule_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Schedule" == data["resourceType"] inst2 = schedule.Schedule(**data) impl_schedule_2(inst2) def impl_schedule_3(inst): assert inst.active is True assert inst.actor[0].display == "Burgers UMC, South Wing, second floor" assert inst.actor[0].reference == "Location/1" assert inst.id == "example-hcs" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Burgers UMC, Posttraumatic Stress Disorder counselling" assert ( inst.planningHorizon.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-12-25T09:30:00Z"} ).valueDateTime ) assert ( inst.planningHorizon.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-12-25T09:15:00Z"} ).valueDateTime ) assert inst.serviceCategory[0].coding[0].code == "8" assert inst.serviceCategory[0].coding[0].display == "Counselling" assert ( inst.serviceCategory[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/service-category"} ).valueUri ) assert ( inst.serviceType[0].reference.display == "Burgers UMC, Posttraumatic Stress Disorder Clinic" ) assert inst.serviceType[0].reference.reference == "HealthcareService/example" assert inst.specialty[0].coding[0].code == "47505003" assert inst.specialty[0].coding[0].display == "Posttraumatic stress disorder" assert ( inst.specialty[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.text.status == "generated" def test_schedule_3(base_settings): """No. 3 tests collection for Schedule. Test File: schedule-example-hcs.json """ filename = base_settings["unittest_data_dir"] / "schedule-example-hcs.json" inst = schedule.Schedule.model_validate_json(filename.read_bytes()) assert "Schedule" == inst.get_resource_type() impl_schedule_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Schedule" == data["resourceType"] inst2 = schedule.Schedule(**data) impl_schedule_3(inst2) def impl_schedule_4(inst): assert inst.active is True assert inst.actor[0].display == "Dr. Beverly Crusher" assert inst.actor[0].reference == "Practitioner/1" assert inst.actor[1].display == "Starfleet HQ Sickbay" assert inst.actor[1].reference == "Location/2" assert inst.comment == ( "The slots attached to this schedule are for neurosurgery " "operations at Starfleet HQ only." ) assert inst.id == "exampleloc2" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/scheduleid"} ).valueUri ) assert inst.identifier[0].use == "usual" assert inst.identifier[0].value == "47" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.planningHorizon.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-12-25T09:30:00Z"} ).valueDateTime ) assert ( inst.planningHorizon.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-12-25T09:15:00Z"} ).valueDateTime ) assert inst.serviceCategory[0].coding[0].code == "31" assert inst.serviceCategory[0].coding[0].display == "Specialist Surgical" assert ( inst.serviceCategory[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/service-category"} ).valueUri ) assert inst.serviceType[0].concept.coding[0].code == "221" assert inst.serviceType[0].concept.coding[0].display == "Surgery - General" assert ( inst.serviceType[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/service-type"} ).valueUri ) assert inst.specialty[0].coding[0].code == "394610002" assert inst.specialty[0].coding[0].display == "Surgery-Neurosurgery" assert ( inst.specialty[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.text.status == "generated" def test_schedule_4(base_settings): """No. 4 tests collection for Schedule. Test File: schedule-provider-location2-example.json """ filename = ( base_settings["unittest_data_dir"] / "schedule-provider-location2-example.json" ) inst = schedule.Schedule.model_validate_json(filename.read_bytes()) assert "Schedule" == inst.get_resource_type() impl_schedule_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Schedule" == data["resourceType"] inst2 = schedule.Schedule(**data) impl_schedule_4(inst2) ================================================ FILE: fhir/resources/tests/test_searchparameter.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/SearchParameter Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import searchparameter from .conftest import ExternalValidatorModel def impl_searchparameter_1(inst): assert inst.base[0] == "Patient" assert inst.code == "part-agree" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.description == ( "Search by url for a participation agreement, which is stored" " as an extension referencing a DocumentReference" ) assert inst.experimental is True assert inst.expression == ( "Patient.extension('http://example.org/fhir/StructureDefiniti" "on/participation-agreement').value" ) assert inst.id == "example-extension" assert inst.name == "ExampleSearchParameterOnAnExtension" assert inst.processingMode == "normal" assert inst.publisher == "Health Level Seven International (FHIR Infrastructure)" assert inst.status == "draft" assert inst.target[0] == "DocumentReference" assert inst.text.status == "generated" assert inst.title == "Example Search Parameter on an extension" assert inst.type == "reference" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/example-extension"} ).valueUri ) def test_searchparameter_1(base_settings): """No. 1 tests collection for SearchParameter. Test File: searchparameter-example-extension.json """ filename = ( base_settings["unittest_data_dir"] / "searchparameter-example-extension.json" ) inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_1(inst2) def impl_searchparameter_2(inst): assert inst.base[0] == "Resource" assert inst.code == "_filter" assert inst.contact[0].name == "FHIR Project" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-07-26"} ).valueDateTime ) assert inst.description == ( "This is the formal declaration for the _filter parameter, " "documented at [http://hl7.org/fhir/search_filter.html](http:" "//hl7.org/fhir/search_filter.html)" ) assert inst.experimental is False assert inst.id == "filter" assert inst.name == "FilterSearchParameter" assert inst.publisher == "Health Level Seven International (FHIR Infrastructure)" assert inst.purpose == ( "Support combination searches when the simple name=value " "basis of search cannot express what is required" ) assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Filter Search Parameter" assert inst.type == "special" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/filter"} ).valueUri ) assert inst.version == "1" def test_searchparameter_2(base_settings): """No. 2 tests collection for SearchParameter. Test File: searchparameter-filter.json """ filename = base_settings["unittest_data_dir"] / "searchparameter-filter.json" inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_2(inst2) def impl_searchparameter_3(inst): assert inst.base[0] == "Bundle" assert inst.code == "example-constraint" assert inst.constraint == ( "Bundle.type = 'document' and Bundle.entry[0].resource is " "Composition" ) assert inst.description == "Search Composition Bundle" assert inst.experimental is True assert inst.expression == "Bundle.entry[0].resource" assert inst.id == "example-constraint" assert inst.name == "Exampleconstraint" assert inst.processingMode == "normal" assert inst.publisher == "Health Level Seven International (FHIR Infrastructure)" assert inst.status == "draft" assert inst.target[0] == "Composition" assert inst.text.status == "generated" assert inst.title == "example-constraint" assert inst.type == "reference" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/example-constraint"} ).valueUri ) def test_searchparameter_3(base_settings): """No. 3 tests collection for SearchParameter. Test File: searchparameter-example-constraint.json """ filename = ( base_settings["unittest_data_dir"] / "searchparameter-example-constraint.json" ) inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_3(inst2) def impl_searchparameter_4(inst): assert inst.base[0] == "Condition" assert inst.chain[0] == "name" assert inst.chain[1] == "identifier" assert inst.code == "subject" assert inst.contact[0].name == "[string]" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-10-23"} ).valueDateTime ) assert inst.description == "Search by condition subject" assert inst.experimental is True assert inst.expression == "Condition.subject" assert inst.id == "example-reference" assert inst.modifier[0] == "missing" assert inst.name == "ExampleSearchParameter" assert inst.processingMode == "normal" assert inst.publisher == "Health Level Seven International (FHIR Infrastructure)" assert inst.purpose == "Need to search Condition by subject" assert inst.status == "draft" assert inst.target[0] == "Organization" assert inst.text.status == "generated" assert inst.title == "Example Search Parameter" assert inst.type == "reference" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/example-reference"} ).valueUri ) def test_searchparameter_4(base_settings): """No. 4 tests collection for SearchParameter. Test File: searchparameter-example-reference.json """ filename = ( base_settings["unittest_data_dir"] / "searchparameter-example-reference.json" ) inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_4(inst2) def impl_searchparameter_5(inst): assert inst.base[0] == "Resource" assert inst.code == "_id" assert inst.contact[0].name == "[string]" assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-10-23"} ).valueDateTime ) assert inst.derivedFrom == "http://hl7.org/fhir/SearchParameter/Resource-id" assert inst.description == ( "Search by resource identifier - e.g. same as the read " "interaction, but can return included resources" ) assert inst.experimental is True assert inst.expression == "id" assert inst.id == "example" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America (the)" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert inst.name == "IDSEARCHPARAMETER" assert inst.processingMode == "normal" assert inst.publisher == "Health Level Seven International (FHIR Infrastructure)" assert inst.purpose == ( "Need to search by identifier for various infrastructural " "cases - mainly retrieving packages, and matching as part of " "a chain" ) assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "I D- S E A R C H- P A R A M E T E R" assert inst.type == "token" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/SearchParameter/example"} ).valueUri ) assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "positive" assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variant-state"} ).valueUri ) assert inst.version == "1" def test_searchparameter_5(base_settings): """No. 5 tests collection for SearchParameter. Test File: searchparameter-example.json """ filename = base_settings["unittest_data_dir"] / "searchparameter-example.json" inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes()) assert "SearchParameter" == inst.get_resource_type() impl_searchparameter_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SearchParameter" == data["resourceType"] inst2 = searchparameter.SearchParameter(**data) impl_searchparameter_5(inst2) ================================================ FILE: fhir/resources/tests/test_servicerequest.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ServiceRequest Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import servicerequest from .conftest import ExternalValidatorModel def impl_servicerequest_1(inst): assert inst.code.concept.coding[0].code == "3981005" assert ( inst.code.concept.coding[0].display == "Carrier detection, molecular genetics (procedure)" ) assert ( inst.code.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.encounter.reference == "Encounter/denovoEncounter" assert inst.id == "genomicServiceRequest" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/serviceRequests"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "LACSN" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].type.text == "Laboratory Accession ID" assert inst.identifier[0].value == "111111111" assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "active" assert inst.subject.reference == "Patient/denovoChild" assert inst.text.status == "generated" def test_servicerequest_1(base_settings): """No. 1 tests collection for ServiceRequest. Test File: ServiceRequest-genomicServiceRequest.json """ filename = ( base_settings["unittest_data_dir"] / "ServiceRequest-genomicServiceRequest.json" ) inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes()) assert "ServiceRequest" == inst.get_resource_type() impl_servicerequest_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ServiceRequest" == data["resourceType"] inst2 = servicerequest.ServiceRequest(**data) impl_servicerequest_1(inst2) def impl_servicerequest_2(inst): assert inst.asNeededCodeableConcept.text == "as needed to clear mucus" assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T17:23:07Z"} ).valueDateTime ) assert inst.basedOn[0].reference == "CarePlan/gpvisit" assert inst.code.concept.coding[0].code == "34431008" assert ( inst.code.concept.coding[0].display == "Physiotherapy of chest (regime/therapy)" ) assert ( inst.code.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.contained[0].id == "signature" assert inst.contained[1].id == "cystic-fibrosis" assert inst.id == "physiotherapy" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealth.org/placer-ids"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "PLAC" assert inst.identifier[0].type.coding[0].display == "Placer Identifier" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].type.text == "Placer" assert inst.identifier[0].value == "20170201-0001" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert float(inst.occurrenceTiming.repeat.duration) == float(15) assert float(inst.occurrenceTiming.repeat.durationMax) == float(25) assert inst.occurrenceTiming.repeat.durationUnit == "min" assert inst.occurrenceTiming.repeat.frequency == 1 assert inst.occurrenceTiming.repeat.frequencyMax == 4 assert float(inst.occurrenceTiming.repeat.period) == float(1) assert inst.occurrenceTiming.repeat.periodUnit == "d" assert inst.reason[0].reference.reference == "#cystic-fibrosis" assert inst.relevantHistory[0].display == "Author's Signature" assert inst.relevantHistory[0].reference == "#signature" assert inst.requester.display == "Dr Adam Careful" assert inst.requester.reference == "Practitioner/example" assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_servicerequest_2(base_settings): """No. 2 tests collection for ServiceRequest. Test File: servicerequest-example2.json """ filename = base_settings["unittest_data_dir"] / "servicerequest-example2.json" inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes()) assert "ServiceRequest" == inst.get_resource_type() impl_servicerequest_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ServiceRequest" == data["resourceType"] inst2 = servicerequest.ServiceRequest(**data) impl_servicerequest_2(inst2) def impl_servicerequest_3(inst): assert inst.code.concept.coding[0].code == "3981005" assert ( inst.code.concept.coding[0].display == "Carrier detection, molecular genetics (procedure)" ) assert ( inst.code.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.encounter.reference == "Encounter/denovoEncounter" assert inst.id == "genomicSRMother" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/serviceRequests"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "LACSN" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].type.text == "Laboratory Accession ID" assert inst.identifier[0].value == "111111116" assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "active" assert inst.subject.reference == "Patient/mother" assert inst.text.status == "generated" def test_servicerequest_3(base_settings): """No. 3 tests collection for ServiceRequest. Test File: ServiceRequest-genomicSRMother.json """ filename = ( base_settings["unittest_data_dir"] / "ServiceRequest-genomicSRMother.json" ) inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes()) assert "ServiceRequest" == inst.get_resource_type() impl_servicerequest_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ServiceRequest" == data["resourceType"] inst2 = servicerequest.ServiceRequest(**data) impl_servicerequest_3(inst2) def impl_servicerequest_4(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-02-01T17:23:07Z"} ).valueDateTime ) assert inst.code.concept.coding[0].code == "359962006" assert inst.code.concept.coding[0].display == "Turning patient in bed (procedure)" assert ( inst.code.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.doNotPerform is True assert inst.id == "do-not-turn" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://goodhealth.org/placer-ids"} ).valueUri ) assert inst.identifier[0].value == "20170201-0002" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.priority == "stat" assert inst.reason[0].reference.display == "Patient has a spinal fracture" assert inst.requester.display == "Dr Adam Careful" assert inst.requester.reference == "Practitioner/example" assert inst.status == "active" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_servicerequest_4(base_settings): """No. 4 tests collection for ServiceRequest. Test File: servicerequest-example3.json """ filename = base_settings["unittest_data_dir"] / "servicerequest-example3.json" inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes()) assert "ServiceRequest" == inst.get_resource_type() impl_servicerequest_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ServiceRequest" == data["resourceType"] inst2 = servicerequest.ServiceRequest(**data) impl_servicerequest_4(inst2) def impl_servicerequest_5(inst): assert inst.code.concept.coding[0].code == "LIPID" assert ( inst.code.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org/tests"} ).valueUri ) assert inst.code.concept.text == "Lipid Panel" assert inst.contained[0].id == "fasting" assert inst.contained[1].id == "serum" assert inst.encounter.reference == "Encounter/example" assert inst.id == "lipid" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:oid:1.3.4.5.6.7"} ).valueUri ) assert inst.identifier[0].type.coding[0].code == "PLAC" assert ( inst.identifier[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0203"} ).valueUri ) assert inst.identifier[0].type.text == "Placer" assert inst.identifier[0].value == "2345234234234" assert inst.intent == "original-order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "patient is afraid of needles" assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2013-05-02T16:16:00-07:00"} ).valueDateTime ) assert inst.performer[0].reference == "Practitioner/f202" assert inst.reason[0].concept.coding[0].code == "V173" assert inst.reason[0].concept.coding[0].display == "Fam hx-ischem heart dis" assert ( inst.reason[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/sid/icd-9"} ).valueUri ) assert inst.requester.reference == "Practitioner/example" assert inst.specimen[0].display == "Serum specimen" assert inst.specimen[0].reference == "#serum" assert inst.status == "active" assert inst.subject.reference == "Patient/example" assert inst.supportingInfo[0].reference.display == "Fasting status" assert inst.supportingInfo[0].reference.reference == "#fasting" assert inst.text.status == "generated" def test_servicerequest_5(base_settings): """No. 5 tests collection for ServiceRequest. Test File: servicerequest-example-lipid.json """ filename = base_settings["unittest_data_dir"] / "servicerequest-example-lipid.json" inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes()) assert "ServiceRequest" == inst.get_resource_type() impl_servicerequest_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ServiceRequest" == data["resourceType"] inst2 = servicerequest.ServiceRequest(**data) impl_servicerequest_5(inst2) def impl_servicerequest_6(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-05"} ).valueDateTime ) assert inst.code.concept.coding[0].code == "76164006" assert inst.code.concept.coding[0].display == "Biopsy of colon (procedure)" assert ( inst.code.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.concept.text == "Biopsy of colon" assert inst.id == "colon-biopsy" assert inst.identifier[0].value == "12345" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].display == "Dr Adam Careful" assert inst.performer[0].reference == "Practitioner/example" assert inst.requester.display == "Dr. Beverly Crusher" assert ( inst.requester.reference == "Practitioner/3ad0687e-f477-468c-afd5-fcc2bf897809" ) assert ( inst.requisition.system == ExternalValidatorModel.model_validate( {"valueUri": "http://bumc.org/requisitions"} ).valueUri ) assert inst.requisition.value == "req12345" assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_servicerequest_6(base_settings): """No. 6 tests collection for ServiceRequest. Test File: servicerequest-example-colonoscopy-bx.json """ filename = ( base_settings["unittest_data_dir"] / "servicerequest-example-colonoscopy-bx.json" ) inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes()) assert "ServiceRequest" == inst.get_resource_type() impl_servicerequest_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ServiceRequest" == data["resourceType"] inst2 = servicerequest.ServiceRequest(**data) impl_servicerequest_6(inst2) def impl_servicerequest_7(inst): assert inst.code.concept.coding[0].code == "229115003" assert inst.code.concept.coding[0].display == "Bench Press (regime/therapy)" assert ( inst.code.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "benchpress" assert inst.intent == "plan" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.occurrenceTiming.repeat.count == 20 assert inst.occurrenceTiming.repeat.countMax == 30 assert inst.occurrenceTiming.repeat.frequency == 3 assert float(inst.occurrenceTiming.repeat.period) == float(1) assert inst.occurrenceTiming.repeat.periodUnit == "wk" assert inst.patientInstruction[0].instructionMarkdown == ( "Start with 30kg 10-15 repetitions for three sets and " "increase in increments of 5kg when you feel ready" ) assert inst.status == "active" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_servicerequest_7(base_settings): """No. 7 tests collection for ServiceRequest. Test File: servicerequest-example4.json """ filename = base_settings["unittest_data_dir"] / "servicerequest-example4.json" inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes()) assert "ServiceRequest" == inst.get_resource_type() impl_servicerequest_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ServiceRequest" == data["resourceType"] inst2 = servicerequest.ServiceRequest(**data) impl_servicerequest_7(inst2) def impl_servicerequest_8(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-08-16"} ).valueDateTime ) assert inst.category[0].coding[0].code == "311401005" assert inst.category[0].coding[0].display == "Patient education (procedure)" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.category[0].text == "Education" assert inst.code.concept.coding[0].code == "48023004" assert ( inst.code.concept.coding[0].display == "Breast self-examination technique education (procedure)" ) assert ( inst.code.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.concept.text == "Health education - breast examination" assert inst.id == "education" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-08-16"} ).valueDateTime ) assert inst.performer[0].display == "Pamela Educator, RN" assert inst.reason[0].concept.text == "early detection of breast mass" assert inst.requester.display == "Angela Care, MD" assert inst.status == "completed" assert inst.subject.display == "Jane Doe" assert inst.text.status == "generated" def test_servicerequest_8(base_settings): """No. 8 tests collection for ServiceRequest. Test File: servicerequest-example-edu.json """ filename = base_settings["unittest_data_dir"] / "servicerequest-example-edu.json" inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes()) assert "ServiceRequest" == inst.get_resource_type() impl_servicerequest_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ServiceRequest" == data["resourceType"] inst2 = servicerequest.ServiceRequest(**data) impl_servicerequest_8(inst2) def impl_servicerequest_9(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-02-20"} ).valueDateTime ) assert inst.code.concept.coding[0].code == "40617009" assert inst.code.concept.coding[0].display == "Artificial respiration (procedure)" assert ( inst.code.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.concept.text == "Mechanical Ventilation" assert inst.id == "vent" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.performer[0].display == "Dr Cecil Surgeon" assert inst.performer[0].reference == "Practitioner/example" assert inst.reason[0].concept.text == "chronic obstructive lung disease (COLD)" assert inst.requester.display == "Dr. Beverly Crusher" assert ( inst.requester.reference == "Practitioner/3ad0687e-f477-468c-afd5-fcc2bf897809" ) assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_servicerequest_9(base_settings): """No. 9 tests collection for ServiceRequest. Test File: servicerequest-example-ventilation.json """ filename = ( base_settings["unittest_data_dir"] / "servicerequest-example-ventilation.json" ) inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes()) assert "ServiceRequest" == inst.get_resource_type() impl_servicerequest_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ServiceRequest" == data["resourceType"] inst2 = servicerequest.ServiceRequest(**data) impl_servicerequest_9(inst2) def impl_servicerequest_10(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-05"} ).valueDateTime ) assert inst.basedOn[0].display == "Maternity care plan" assert inst.basedOn[0].reference == "CarePlan/preg" assert inst.code.concept.coding[0].code == "62013009" assert inst.code.concept.coding[0].display == "Ambulating patient (procedure)" assert ( inst.code.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.code.concept.text == "Ambulation" assert inst.id == "ambulation" assert inst.identifier[0].value == "45678" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.reason[0].reference.display == "Blood Pressure" assert inst.reason[0].reference.reference == "Observation/blood-pressure" assert inst.requester.display == "Dr. Beverly Crusher" assert ( inst.requester.reference == "Practitioner/3ad0687e-f477-468c-afd5-fcc2bf897809" ) assert inst.status == "completed" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" def test_servicerequest_10(base_settings): """No. 10 tests collection for ServiceRequest. Test File: servicerequest-example-ambulation.json """ filename = ( base_settings["unittest_data_dir"] / "servicerequest-example-ambulation.json" ) inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes()) assert "ServiceRequest" == inst.get_resource_type() impl_servicerequest_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ServiceRequest" == data["resourceType"] inst2 = servicerequest.ServiceRequest(**data) impl_servicerequest_10(inst2) ================================================ FILE: fhir/resources/tests/test_slot.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Slot Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import slot from .conftest import ExternalValidatorModel def impl_slot_1(inst): assert inst.comment == ( "Assessments should be performed before requesting " "appointments in this slot." ) assert ( inst.end == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-25T09:15:00Z"} ).valueInstant ) assert inst.id == "1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/identifiers/slots"} ).valueUri ) assert inst.identifier[0].value == "123132" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.overbooked is True assert inst.schedule.reference == "Schedule/example" assert inst.serviceCategory[0].coding[0].code == "17" assert inst.serviceCategory[0].coding[0].display == "General Practice" assert ( inst.start == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-25T09:00:00Z"} ).valueInstant ) assert inst.status == "busy" assert inst.text.status == "generated" def test_slot_1(base_settings): """No. 1 tests collection for Slot. Test File: slot-example-busy.json """ filename = base_settings["unittest_data_dir"] / "slot-example-busy.json" inst = slot.Slot.model_validate_json(filename.read_bytes()) assert "Slot" == inst.get_resource_type() impl_slot_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Slot" == data["resourceType"] inst2 = slot.Slot(**data) impl_slot_1(inst2) def impl_slot_2(inst): assert inst.appointmentType[0].coding[0].code == "WALKIN" assert ( inst.appointmentType[0].coding[0].display == "A previously unscheduled walk-in visit" ) assert ( inst.appointmentType[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0276"} ).valueUri ) assert inst.comment == ( "Assessments should be performed before requesting " "appointments in this slot." ) assert ( inst.end == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-25T09:30:00Z"} ).valueInstant ) assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.schedule.reference == "Schedule/example" assert inst.serviceCategory[0].coding[0].code == "17" assert inst.serviceCategory[0].coding[0].display == "General Practice" assert inst.serviceType[0].concept.coding[0].code == "57" assert inst.serviceType[0].concept.coding[0].display == "Immunization" assert inst.specialty[0].coding[0].code == "408480009" assert inst.specialty[0].coding[0].display == "Clinical immunology" assert ( inst.start == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-25T09:15:00Z"} ).valueInstant ) assert inst.status == "free" assert inst.text.status == "generated" def test_slot_2(base_settings): """No. 2 tests collection for Slot. Test File: slot-example.json """ filename = base_settings["unittest_data_dir"] / "slot-example.json" inst = slot.Slot.model_validate_json(filename.read_bytes()) assert "Slot" == inst.get_resource_type() impl_slot_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Slot" == data["resourceType"] inst2 = slot.Slot(**data) impl_slot_2(inst2) def impl_slot_3(inst): assert inst.comment == ( "Assessments should be performed before requesting " "appointments in this slot." ) assert ( inst.end == ExternalValidatorModel.model_validate( {"valueInstant": "2023-12-25T09:30:00Z"} ).valueInstant ) assert inst.id == "example-hcs" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.schedule.reference == "Schedule/example-hcs" assert ( inst.serviceType[0].reference.display == "Burgers UMC, Posttraumatic Stress Disorder Clinic" ) assert inst.serviceType[0].reference.reference == "HealthcareService/example" assert ( inst.start == ExternalValidatorModel.model_validate( {"valueInstant": "2023-12-25T09:15:00Z"} ).valueInstant ) assert inst.status == "free" assert inst.text.status == "generated" def test_slot_3(base_settings): """No. 3 tests collection for Slot. Test File: slot-example-hcs.json """ filename = base_settings["unittest_data_dir"] / "slot-example-hcs.json" inst = slot.Slot.model_validate_json(filename.read_bytes()) assert "Slot" == inst.get_resource_type() impl_slot_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Slot" == data["resourceType"] inst2 = slot.Slot(**data) impl_slot_3(inst2) def impl_slot_4(inst): assert inst.comment == "Dr Careful is out of the office" assert ( inst.end == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-25T09:45:00Z"} ).valueInstant ) assert inst.id == "3" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.schedule.reference == "Schedule/example" assert inst.serviceCategory[0].coding[0].code == "17" assert inst.serviceCategory[0].coding[0].display == "General Practice" assert ( inst.start == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-25T09:30:00Z"} ).valueInstant ) assert inst.status == "busy-unavailable" assert inst.text.status == "generated" def test_slot_4(base_settings): """No. 4 tests collection for Slot. Test File: slot-example-unavailable.json """ filename = base_settings["unittest_data_dir"] / "slot-example-unavailable.json" inst = slot.Slot.model_validate_json(filename.read_bytes()) assert "Slot" == inst.get_resource_type() impl_slot_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Slot" == data["resourceType"] inst2 = slot.Slot(**data) impl_slot_4(inst2) def impl_slot_5(inst): assert inst.comment == "Dr Careful is out of the office" assert ( inst.end == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-25T10:00:00Z"} ).valueInstant ) assert inst.id == "2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.schedule.reference == "Schedule/example" assert inst.serviceCategory[0].coding[0].code == "17" assert inst.serviceCategory[0].coding[0].display == "General Practice" assert ( inst.start == ExternalValidatorModel.model_validate( {"valueInstant": "2013-12-25T09:45:00Z"} ).valueInstant ) assert inst.status == "busy-tentative" assert inst.text.status == "generated" def test_slot_5(base_settings): """No. 5 tests collection for Slot. Test File: slot-example-tentative.json """ filename = base_settings["unittest_data_dir"] / "slot-example-tentative.json" inst = slot.Slot.model_validate_json(filename.read_bytes()) assert "Slot" == inst.get_resource_type() impl_slot_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Slot" == data["resourceType"] inst2 = slot.Slot(**data) impl_slot_5(inst2) ================================================ FILE: fhir/resources/tests/test_specimen.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Specimen Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import specimen from .conftest import ExternalValidatorModel def impl_specimen_1(inst): assert ( inst.collection.collectedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01T01:01:00Z"} ).valueDateTime ) assert inst.collection.collector.reference == "Practitioner/practitioner01" assert inst.collection.method.coding[0].code == "LNV" assert ( inst.collection.method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0488"} ).valueUri ) assert inst.collection.quantity.unit == "mL" assert float(inst.collection.quantity.value) == float(1) assert inst.id == "denovo-2" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/specimens"} ).valueUri ) assert inst.identifier[0].value == "2" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.receivedTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01T01:01:01Z"} ).valueDateTime ) assert inst.request[0].reference == "ServiceRequest/genomicServiceRequest" assert inst.status == "available" assert inst.subject.display == "Jane Doe" assert inst.subject.reference == "Patient/denovoMother" assert inst.text.status == "generated" assert inst.type.coding[0].code == "122555007" assert inst.type.coding[0].display == "Venous blood specimen" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_specimen_1(base_settings): """No. 1 tests collection for Specimen. Test File: Specimen-denovo-2.json """ filename = base_settings["unittest_data_dir"] / "Specimen-denovo-2.json" inst = specimen.Specimen.model_validate_json(filename.read_bytes()) assert "Specimen" == inst.get_resource_type() impl_specimen_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Specimen" == data["resourceType"] inst2 = specimen.Specimen(**data) impl_specimen_1(inst2) def impl_specimen_2(inst): assert ( inst.collection.collectedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01T01:01:00Z"} ).valueDateTime ) assert inst.collection.collector.reference == "Practitioner/practitioner01" assert inst.collection.method.coding[0].code == "LNV" assert ( inst.collection.method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0488"} ).valueUri ) assert inst.collection.quantity.unit == "mL" assert float(inst.collection.quantity.value) == float(1) assert inst.id == "denovo-3" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/specimens"} ).valueUri ) assert inst.identifier[0].value == "3" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.receivedTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01T01:01:01Z"} ).valueDateTime ) assert inst.request[0].reference == "ServiceRequest/genomicServiceRequest" assert inst.status == "available" assert inst.subject.display == "John Doe" assert inst.subject.reference == "Patient/denovoFather" assert inst.text.status == "generated" assert inst.type.coding[0].code == "122555007" assert inst.type.coding[0].display == "Venous blood specimen" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_specimen_2(base_settings): """No. 2 tests collection for Specimen. Test File: Specimen-denovo-3.json """ filename = base_settings["unittest_data_dir"] / "Specimen-denovo-3.json" inst = specimen.Specimen.model_validate_json(filename.read_bytes()) assert "Specimen" == inst.get_resource_type() impl_specimen_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Specimen" == data["resourceType"] inst2 = specimen.Specimen(**data) impl_specimen_2(inst2) def impl_specimen_3(inst): assert ( inst.accessionIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://lab.acme.org/specimens/2011"} ).valueUri ) assert inst.accessionIdentifier.value == "X352356-ISO1" assert ( inst.collection.collectedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-16T07:03:00Z"} ).valueDateTime ) assert inst.collection.collector.reference == "Practitioner/f202" assert inst.collection.method.coding[0].code == "BAP" assert ( inst.collection.method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0488"} ).valueUri ) assert inst.contained[0].id == "stool" assert inst.id == "isolate" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "Patient dropped off specimen" assert inst.parent[0].reference == "#stool" assert ( inst.receivedTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-18T07:03:00Z"} ).valueDateTime ) assert inst.role[0].coding[0].code == "p" assert inst.role[0].coding[0].display == "Patient" assert inst.status == "available" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" assert inst.type.coding[0].code == "429951000124103" assert inst.type.coding[0].display == "Bacterial isolate specimen" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_specimen_3(base_settings): """No. 3 tests collection for Specimen. Test File: specimen-example-isolate.json """ filename = base_settings["unittest_data_dir"] / "specimen-example-isolate.json" inst = specimen.Specimen.model_validate_json(filename.read_bytes()) assert "Specimen" == inst.get_resource_type() impl_specimen_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Specimen" == data["resourceType"] inst2 = specimen.Specimen(**data) impl_specimen_3(inst2) def impl_specimen_4(inst): assert ( inst.collection.collectedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01T01:01:00Z"} ).valueDateTime ) assert inst.collection.collector.reference == "Practitioner/practitioner01" assert inst.collection.method.coding[0].code == "LNV" assert ( inst.collection.method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0488"} ).valueUri ) assert inst.collection.quantity.unit == "mL" assert float(inst.collection.quantity.value) == float(1) assert inst.id == "specimenMother" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/specimens"} ).valueUri ) assert inst.identifier[0].value == "6" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.receivedTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01T01:01:01Z"} ).valueDateTime ) assert inst.request[0].reference == "ServiceRequest/genomicServiceRequest" assert inst.status == "available" assert inst.subject.display == "Jane Doe" assert inst.subject.reference == "Patient/mother" assert inst.text.status == "generated" assert inst.type.coding[0].code == "122555007" assert inst.type.coding[0].display == "Venous blood specimen" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_specimen_4(base_settings): """No. 4 tests collection for Specimen. Test File: Specimen-specimenMother.json """ filename = base_settings["unittest_data_dir"] / "Specimen-specimenMother.json" inst = specimen.Specimen.model_validate_json(filename.read_bytes()) assert "Specimen" == inst.get_resource_type() impl_specimen_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Specimen" == data["resourceType"] inst2 = specimen.Specimen(**data) impl_specimen_4(inst2) def impl_specimen_5(inst): assert ( inst.collection.collectedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01T01:01:00Z"} ).valueDateTime ) assert inst.collection.collector.reference == "Practitioner/practitioner01" assert inst.collection.method.coding[0].code == "LNV" assert ( inst.collection.method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0488"} ).valueUri ) assert inst.collection.quantity.unit == "mL" assert float(inst.collection.quantity.value) == float(1) assert inst.id == "specimenProband" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/specimens"} ).valueUri ) assert inst.identifier[0].value == "5" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.receivedTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01T01:01:01Z"} ).valueDateTime ) assert inst.request[0].reference == "ServiceRequest/genomicServiceRequest" assert inst.status == "available" assert inst.subject.display == "Child Junior Doe" assert inst.subject.reference == "Patient/proband" assert inst.text.status == "generated" assert inst.type.coding[0].code == "122555007" assert inst.type.coding[0].display == "Venous blood specimen" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_specimen_5(base_settings): """No. 5 tests collection for Specimen. Test File: Specimen-specimenProband.json """ filename = base_settings["unittest_data_dir"] / "Specimen-specimenProband.json" inst = specimen.Specimen.model_validate_json(filename.read_bytes()) assert "Specimen" == inst.get_resource_type() impl_specimen_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Specimen" == data["resourceType"] inst2 = specimen.Specimen(**data) impl_specimen_5(inst2) def impl_specimen_6(inst): assert ( inst.collection.collectedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01T01:01:00Z"} ).valueDateTime ) assert inst.collection.collector.reference == "Practitioner/practitioner01" assert inst.collection.method.coding[0].code == "LNV" assert ( inst.collection.method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0488"} ).valueUri ) assert inst.collection.quantity.unit == "mL" assert float(inst.collection.quantity.value) == float(1) assert inst.id == "specimenFather" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/specimens"} ).valueUri ) assert inst.identifier[0].value == "7" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.receivedTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01T01:01:01Z"} ).valueDateTime ) assert inst.request[0].reference == "ServiceRequest/genomicServiceRequest" assert inst.status == "available" assert inst.subject.display == "John Doe" assert inst.subject.reference == "Patient/father" assert inst.text.status == "generated" assert inst.type.coding[0].code == "122555007" assert inst.type.coding[0].display == "Venous blood specimen" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_specimen_6(base_settings): """No. 6 tests collection for Specimen. Test File: Specimen-specimenFather.json """ filename = base_settings["unittest_data_dir"] / "Specimen-specimenFather.json" inst = specimen.Specimen.model_validate_json(filename.read_bytes()) assert "Specimen" == inst.get_resource_type() impl_specimen_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Specimen" == data["resourceType"] inst2 = specimen.Specimen(**data) impl_specimen_6(inst2) def impl_specimen_7(inst): assert ( inst.collection.collectedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-03-01T01:01:00Z"} ).valueDateTime ) assert inst.collection.collector.reference == "Practitioner/practitioner01" assert inst.collection.method.coding[0].code == "129314006" assert inst.collection.method.coding[0].display == "Biopsy - action" assert ( inst.collection.method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.collection.quantity.unit == "mm2" assert float(inst.collection.quantity.value) == float(1) assert inst.id == "genomicSpecimen" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/specimens"} ).valueUri ) assert inst.identifier[0].value == "4" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.receivedTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-03-01T01:01:01Z"} ).valueDateTime ) assert inst.request[0].reference == "ServiceRequest/genomicServiceRequest" assert inst.status == "available" assert inst.subject.display == "John Doe" assert inst.subject.reference == "Patient/genomicPatient" assert inst.text.status == "generated" assert inst.type.coding[0].code == "122610009" assert ( inst.type.coding[0].display == "Specimen from lung obtained by biopsy (specimen)" ) assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_specimen_7(base_settings): """No. 7 tests collection for Specimen. Test File: Specimen-genomicSpecimen.json """ filename = base_settings["unittest_data_dir"] / "Specimen-genomicSpecimen.json" inst = specimen.Specimen.model_validate_json(filename.read_bytes()) assert "Specimen" == inst.get_resource_type() impl_specimen_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Specimen" == data["resourceType"] inst2 = specimen.Specimen(**data) impl_specimen_7(inst2) def impl_specimen_8(inst): assert ( inst.accessionIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "https://vetmed.iastate.edu/vdl"} ).valueUri ) assert inst.accessionIdentifier.value == "20171120-1234" assert ( inst.collection.collectedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-11-14"} ).valueDateTime ) assert inst.collection.collector.display == "James Herriot, FRCVS" assert inst.combined == "pooled" assert ( inst.container[0].device.reference == "Device/device-example-specimen-container-red-top-vacutainer" ) assert inst.id == "pooled-serum" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.note[0].text == "Pooled serum sample from 30 individuals" assert inst.subject.reference == "Group/herd1" assert inst.text.status == "generated" assert inst.type.coding[0].code == "Serum sample, pooled" assert inst.type.coding[0].display == "Serum sample, pooled" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://vetmed.iastate.edu/vdl"} ).valueUri ) assert inst.type.text == "Pooled serum sample" def test_specimen_8(base_settings): """No. 8 tests collection for Specimen. Test File: specimen-example-pooled-serum.json """ filename = base_settings["unittest_data_dir"] / "specimen-example-pooled-serum.json" inst = specimen.Specimen.model_validate_json(filename.read_bytes()) assert "Specimen" == inst.get_resource_type() impl_specimen_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Specimen" == data["resourceType"] inst2 = specimen.Specimen(**data) impl_specimen_8(inst2) def impl_specimen_9(inst): assert ( inst.accessionIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://lab.acme.org/specimens/2015"} ).valueUri ) assert inst.accessionIdentifier.value == "X352356" assert ( inst.collection.collectedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-18T07:03:00Z"} ).valueDateTime ) assert inst.collection.collector.reference == "Practitioner/f202" assert ( inst.container[0].device.reference == "Device/device-example-specimen-container-polycup" ) assert inst.container[0].specimenQuantity.unit == "mls" assert float(inst.container[0].specimenQuantity.value) == float(10) assert inst.id == "vma-urine" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.processing[0].additive[0].display == "6 N HCl" assert inst.processing[0].description == "Acidify to pH < 3.0 with 6 N HCl." assert inst.processing[0].method.coding[0].code == "ACID" assert ( inst.processing[0].method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0373"} ).valueUri ) assert ( inst.processing[0].timeDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-18T08:10:00Z"} ).valueDateTime ) assert ( inst.receivedTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2015-08-18T07:03:00Z"} ).valueDateTime ) assert inst.status == "available" assert inst.subject.reference == "Patient/example" assert inst.text.status == "generated" assert inst.type.coding[0].code == "RANDU" assert inst.type.coding[0].display == "Urine, Random" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0487"} ).valueUri ) def test_specimen_9(base_settings): """No. 9 tests collection for Specimen. Test File: specimen-example-urine.json """ filename = base_settings["unittest_data_dir"] / "specimen-example-urine.json" inst = specimen.Specimen.model_validate_json(filename.read_bytes()) assert "Specimen" == inst.get_resource_type() impl_specimen_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Specimen" == data["resourceType"] inst2 = specimen.Specimen(**data) impl_specimen_9(inst2) def impl_specimen_10(inst): assert ( inst.collection.collectedDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01T01:01:00Z"} ).valueDateTime ) assert inst.collection.collector.reference == "Practitioner/practitioner01" assert inst.collection.method.coding[0].code == "LNV" assert ( inst.collection.method.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0488"} ).valueUri ) assert inst.collection.quantity.unit == "mL" assert float(inst.collection.quantity.value) == float(1) assert inst.id == "denovo-1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.somesystemabc.net/identifiers/specimens"} ).valueUri ) assert inst.identifier[0].value == "1" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.receivedTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2021-01-01T01:01:01Z"} ).valueDateTime ) assert inst.request[0].reference == "ServiceRequest/genomicServiceRequest" assert inst.status == "available" assert inst.subject.display == "Child Junior Doe" assert inst.subject.reference == "Patient/denovoChild" assert inst.text.status == "generated" assert inst.type.coding[0].code == "122555007" assert inst.type.coding[0].display == "Venous blood specimen" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) def test_specimen_10(base_settings): """No. 10 tests collection for Specimen. Test File: Specimen-denovo-1.json """ filename = base_settings["unittest_data_dir"] / "Specimen-denovo-1.json" inst = specimen.Specimen.model_validate_json(filename.read_bytes()) assert "Specimen" == inst.get_resource_type() impl_specimen_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Specimen" == data["resourceType"] inst2 = specimen.Specimen(**data) impl_specimen_10(inst2) ================================================ FILE: fhir/resources/tests/test_specimendefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/SpecimenDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import specimendefinition from .conftest import ExternalValidatorModel def impl_specimendefinition_1(inst): assert inst.experimental is False assert inst.id == "2364" assert inst.identifier.value == "12345" assert inst.patientPreparation[0].text == "12 hour fasting" assert inst.patientPreparation[1].coding[0].code == "263678003" assert inst.patientPreparation[1].coding[0].display == "At rest" assert ( inst.patientPreparation[1].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.status == "active" assert inst.text.status == "generated" assert inst.timeAspect == "preferrably morning time" assert inst.title == "Example Specimen Definition for Testing" assert inst.typeCollected.coding[0].code == "122555007" assert inst.typeCollected.coding[0].display == "Venous blood specimen" assert ( inst.typeCollected.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.typeTested[0].container.cap.coding[0].code == "yellow" assert inst.typeTested[0].container.cap.coding[0].display == "yellow cap" assert ( inst.typeTested[0].container.cap.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:6710:2017"} ).valueUri ) assert inst.typeTested[0].container.material.coding[0].code == "61088005" assert inst.typeTested[0].container.material.coding[0].display == "plastic" assert ( inst.typeTested[0].container.material.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.typeTested[0].container.minimumVolumeQuantity.code == "mL" assert ( inst.typeTested[0].container.minimumVolumeQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[0].container.minimumVolumeQuantity.unit == "ml" assert float(inst.typeTested[0].container.minimumVolumeQuantity.value) == float(2) assert inst.typeTested[0].container.type.coding[0].code == "702281005" assert inst.typeTested[0].container.type.coding[0].display == ( "Evacuated blood collection tube, thrombin/clot activator/gel" " separator" ) assert ( inst.typeTested[0].container.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.typeTested[0].handling[0].maxDuration.code == "min" assert ( inst.typeTested[0].handling[0].maxDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[0].handling[0].maxDuration.unit == "minute" assert float(inst.typeTested[0].handling[0].maxDuration.value) == float(60) assert ( inst.typeTested[0].handling[0].temperatureQualifier.text == "Ambient temperature" ) assert inst.typeTested[0].handling[0].temperatureRange.high.code == "Cel" assert ( inst.typeTested[0].handling[0].temperatureRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[0].handling[0].temperatureRange.high.unit == "°C" assert float(inst.typeTested[0].handling[0].temperatureRange.high.value) == float( 25 ) assert inst.typeTested[0].handling[0].temperatureRange.low.code == "Cel" assert ( inst.typeTested[0].handling[0].temperatureRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[0].handling[0].temperatureRange.low.unit == "°C" assert float(inst.typeTested[0].handling[0].temperatureRange.low.value) == float(15) assert inst.typeTested[0].handling[1].maxDuration.code == "h" assert ( inst.typeTested[0].handling[1].maxDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[0].handling[1].maxDuration.unit == "hour" assert float(inst.typeTested[0].handling[1].maxDuration.value) == float(8) assert ( inst.typeTested[0].handling[1].temperatureQualifier.text == "Refrigerated temperature" ) assert inst.typeTested[0].handling[1].temperatureRange.high.code == "Cel" assert ( inst.typeTested[0].handling[1].temperatureRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[0].handling[1].temperatureRange.high.unit == "°C" assert float(inst.typeTested[0].handling[1].temperatureRange.high.value) == float(8) assert inst.typeTested[0].handling[1].temperatureRange.low.code == "Cel" assert ( inst.typeTested[0].handling[1].temperatureRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[0].handling[1].temperatureRange.low.unit == "°C" assert float(inst.typeTested[0].handling[1].temperatureRange.low.value) == float(2) assert inst.typeTested[0].isDerived is False assert inst.typeTested[0].preference == "preferred" assert inst.typeTested[0].type.coding[0].code == "119364003" assert inst.typeTested[0].type.coding[0].display == "Serum specimen" assert ( inst.typeTested[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.typeTested[1].container.cap.coding[0].code == "green" assert inst.typeTested[1].container.cap.coding[0].display == "green cap" assert ( inst.typeTested[1].container.cap.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:6710:2017"} ).valueUri ) assert inst.typeTested[1].container.material.coding[0].code == "32039001" assert inst.typeTested[1].container.material.coding[0].display == "glass" assert ( inst.typeTested[1].container.material.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.typeTested[1].container.minimumVolumeQuantity.code == "mL" assert ( inst.typeTested[1].container.minimumVolumeQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[1].container.minimumVolumeQuantity.unit == "ml" assert float(inst.typeTested[1].container.minimumVolumeQuantity.value) == float(2) assert inst.typeTested[1].container.type.coding[0].code == "702281005" assert inst.typeTested[1].container.type.coding[0].display == ( "Evacuated blood collection tube, thrombin/clot activator/gel" " separator" ) assert ( inst.typeTested[1].container.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.typeTested[1].handling[0].maxDuration.code == "min" assert ( inst.typeTested[1].handling[0].maxDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[1].handling[0].maxDuration.unit == "minute" assert float(inst.typeTested[1].handling[0].maxDuration.value) == float(60) assert ( inst.typeTested[1].handling[0].temperatureQualifier.text == "Ambient temperature" ) assert inst.typeTested[1].handling[0].temperatureRange.high.code == "Cel" assert ( inst.typeTested[1].handling[0].temperatureRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[1].handling[0].temperatureRange.high.unit == "°C" assert float(inst.typeTested[1].handling[0].temperatureRange.high.value) == float( 25 ) assert inst.typeTested[1].handling[0].temperatureRange.low.code == "Cel" assert ( inst.typeTested[1].handling[0].temperatureRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[1].handling[0].temperatureRange.low.unit == "°C" assert float(inst.typeTested[1].handling[0].temperatureRange.low.value) == float(15) assert inst.typeTested[1].handling[1].maxDuration.code == "h" assert ( inst.typeTested[1].handling[1].maxDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[1].handling[1].maxDuration.unit == "hour" assert float(inst.typeTested[1].handling[1].maxDuration.value) == float(8) assert ( inst.typeTested[1].handling[1].temperatureQualifier.text == "Refrigerated temperature" ) assert inst.typeTested[1].handling[1].temperatureRange.high.code == "Cel" assert ( inst.typeTested[1].handling[1].temperatureRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[1].handling[1].temperatureRange.high.unit == "°C" assert float(inst.typeTested[1].handling[1].temperatureRange.high.value) == float(8) assert inst.typeTested[1].handling[1].temperatureRange.low.code == "Cel" assert ( inst.typeTested[1].handling[1].temperatureRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[1].handling[1].temperatureRange.low.unit == "°C" assert float(inst.typeTested[1].handling[1].temperatureRange.low.value) == float(2) assert inst.typeTested[1].preference == "alternate" assert inst.typeTested[1].rejectionCriterion[0].coding[0].code == "insufficient" assert ( inst.typeTested[1].rejectionCriterion[0].coding[0].display == "insufficient specimen volume" ) assert ( inst.typeTested[1].rejectionCriterion[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/rejection-criteria"} ).valueUri ) assert inst.typeTested[1].rejectionCriterion[1].coding[0].code == "hemolized" assert ( inst.typeTested[1].rejectionCriterion[1].coding[0].display == "hemolized specimen" ) assert ( inst.typeTested[1].rejectionCriterion[1].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/rejection-criteria"} ).valueUri ) assert inst.typeTested[1].type.coding[0].code == "119361006" assert inst.typeTested[1].type.coding[0].display == "Plasma specimen" assert ( inst.typeTested[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://example.com/specdef/v1/12345"} ).valueUri ) def test_specimendefinition_1(base_settings): """No. 1 tests collection for SpecimenDefinition. Test File: specimendefinition-example-serum-plasma.json """ filename = ( base_settings["unittest_data_dir"] / "specimendefinition-example-serum-plasma.json" ) inst = specimendefinition.SpecimenDefinition.model_validate_json( filename.read_bytes() ) assert "SpecimenDefinition" == inst.get_resource_type() impl_specimendefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SpecimenDefinition" == data["resourceType"] inst2 = specimendefinition.SpecimenDefinition(**data) impl_specimendefinition_1(inst2) def impl_specimendefinition_2(inst): assert inst.experimental is True assert inst.id == "7" assert inst.identifier.value == "123455" assert inst.patientPreparation[0].text == "no strict fasting" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "Venous blood specimen" assert inst.typeCollected.coding[0].code == "122555007" assert ( inst.typeCollected.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.typeCollected.text == "Venous blood specimen (specimen)" assert inst.typeTested[0].container.cap.coding[0].code == "yellow" assert inst.typeTested[0].container.cap.coding[0].display == "yellow cap" assert ( inst.typeTested[0].container.cap.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/5.1.0/CodeSystem-container-cap.html" } ).valueUri ) assert inst.typeTested[0].container.material.text == "glass" assert inst.typeTested[0].container.minimumVolumeQuantity.code == "mL" assert ( inst.typeTested[0].container.minimumVolumeQuantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[0].container.minimumVolumeQuantity.unit == "ml" assert float(inst.typeTested[0].container.minimumVolumeQuantity.value) == float(2) assert inst.typeTested[0].container.type.coding[0].code == "702281005" assert inst.typeTested[0].container.type.coding[0].display == ( "Evacuated blood collection tube with thrombin and clot " "activator and gel separator" ) assert ( inst.typeTested[0].container.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.typeTested[0].handling[0].maxDuration.code == "h" assert ( inst.typeTested[0].handling[0].maxDuration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert float(inst.typeTested[0].handling[0].maxDuration.value) == float(12) assert inst.typeTested[0].handling[0].temperatureQualifier.coding[0].code == "room" assert ( inst.typeTested[0].handling[0].temperatureQualifier.coding[0].display == "room temperature" ) assert inst.typeTested[0].handling[0].temperatureRange.high.code == "Cel" assert ( inst.typeTested[0].handling[0].temperatureRange.high.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[0].handling[0].temperatureRange.high.unit == "°C" assert float(inst.typeTested[0].handling[0].temperatureRange.high.value) == float( 25 ) assert inst.typeTested[0].handling[0].temperatureRange.low.code == "Cel" assert ( inst.typeTested[0].handling[0].temperatureRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.typeTested[0].handling[0].temperatureRange.low.unit == "°C" assert float(inst.typeTested[0].handling[0].temperatureRange.low.value) == float(15) assert inst.typeTested[0].isDerived is True assert inst.typeTested[0].preference == "preferred" assert inst.typeTested[0].type.coding[0].code == "119364003" assert ( inst.typeTested[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.typeTested[0].type.text == "Serum specimen (specimen)" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://example-lab.com/specdef/123455"} ).valueUri ) def test_specimendefinition_2(base_settings): """No. 2 tests collection for SpecimenDefinition. Test File: specimendefinition-example.json """ filename = base_settings["unittest_data_dir"] / "specimendefinition-example.json" inst = specimendefinition.SpecimenDefinition.model_validate_json( filename.read_bytes() ) assert "SpecimenDefinition" == inst.get_resource_type() impl_specimendefinition_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SpecimenDefinition" == data["resourceType"] inst2 = specimendefinition.SpecimenDefinition(**data) impl_specimendefinition_2(inst2) ================================================ FILE: fhir/resources/tests/test_structuremap.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/StructureMap Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import structuremap from .conftest import ExternalValidatorModel def impl_structuremap_1(inst): assert inst.description == "Transform from an ActivityDefinition to a SupplyRequest" assert inst.experimental is True assert inst.group[0].input[0].mode == "source" assert inst.group[0].input[0].name == "source" assert inst.group[0].input[0].type == "ActivityDefinition" assert inst.group[0].input[1].mode == "target" assert inst.group[0].input[1].name == "target" assert inst.group[0].input[1].type == "SupplyRequest" assert inst.group[0].name == "main" assert inst.group[0].rule[0].name == "status" assert inst.group[0].rule[0].source[0].context == "source" assert inst.group[0].rule[0].source[0].element == "id" assert inst.group[0].rule[0].source[0].variable == "a" assert inst.group[0].rule[0].target[0].context == "target" assert inst.group[0].rule[0].target[0].element == "status" assert inst.group[0].rule[0].target[0].parameter[0].valueString == "'draft'" assert inst.group[0].rule[0].target[0].transform == "evaluate" assert inst.group[0].rule[1].name == "category" assert inst.group[0].rule[1].source[0].context == "source" assert inst.group[0].rule[1].source[0].element == "id" assert inst.group[0].rule[1].source[0].variable == "a" assert inst.group[0].rule[1].target[0].context == "target" assert inst.group[0].rule[1].target[0].element == "category" assert inst.group[0].rule[1].target[0].parameter[0].valueString == "'non-stock'" assert inst.group[0].rule[1].target[0].transform == "evaluate" assert inst.group[0].rule[2].name == "priority" assert inst.group[0].rule[2].source[0].context == "source" assert inst.group[0].rule[2].source[0].element == "id" assert inst.group[0].rule[2].source[0].variable == "a" assert inst.group[0].rule[2].target[0].context == "target" assert inst.group[0].rule[2].target[0].element == "priority" assert inst.group[0].rule[2].target[0].parameter[0].valueString == "'routine'" assert inst.group[0].rule[2].target[0].transform == "evaluate" assert inst.group[0].rule[3].name == "quantity" assert inst.group[0].rule[3].source[0].context == "source" assert inst.group[0].rule[3].source[0].element == "quantity" assert inst.group[0].rule[3].source[0].variable == "a" assert inst.group[0].rule[3].target[0].context == "target" assert inst.group[0].rule[3].target[0].element == "category" assert inst.group[0].rule[3].target[0].transform == "copy" assert inst.group[0].rule[4].name == "item" assert inst.group[0].rule[4].source[0].context == "source" assert inst.group[0].rule[4].source[0].element == "code" assert inst.group[0].rule[4].source[0].variable == "a" assert inst.group[0].rule[4].target[0].context == "target" assert inst.group[0].rule[4].target[0].element == "item" assert inst.group[0].rule[4].target[0].transform == "create" assert inst.group[0].rule[4].target[0].variable == "b" assert inst.group[0].rule[4].target[1].context == "b" assert inst.group[0].rule[4].target[1].element == "concept" assert inst.group[0].rule[4].target[1].transform == "copy" assert inst.group[0].rule[5].name == "when" assert inst.group[0].rule[5].source[0].context == "source" assert inst.group[0].rule[5].source[0].element == "id" assert inst.group[0].rule[5].source[0].variable == "a" assert inst.group[0].rule[5].target[0].context == "target" assert inst.group[0].rule[5].target[0].element == "occurrence" assert inst.group[0].rule[5].target[0].parameter[0].valueString == "now()" assert inst.group[0].rule[5].target[0].transform == "evaluate" assert inst.group[0].rule[6].name == "authoredOn" assert inst.group[0].rule[6].source[0].context == "source" assert inst.group[0].rule[6].source[0].element == "id" assert inst.group[0].rule[6].source[0].variable == "a" assert inst.group[0].rule[6].target[0].context == "target" assert inst.group[0].rule[6].target[0].element == "authoredOn" assert inst.group[0].rule[6].target[0].parameter[0].valueString == "now()" assert inst.group[0].rule[6].target[0].transform == "evaluate" assert inst.id == "supplyrequest-transform" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.13.1" assert inst.name == "TransformFromAnActivityDefinitionToASupplyRequest" assert inst.status == "draft" assert inst.structure[0].mode == "source" assert ( inst.structure[0].url == "http://hl7.org/fhir/StructureDefinition/ActivityDefinition" ) assert inst.structure[1].mode == "target" assert ( inst.structure[1].url == "http://hl7.org/fhir/StructureDefinition/SupplyRequest" ) assert inst.text.status == "generated" assert inst.title == "Transform from an ActivityDefinition to a SupplyRequest" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureMap/supplyrequest-transform"} ).valueUri ) assert inst.version == "5.0.0" def test_structuremap_1(base_settings): """No. 1 tests collection for StructureMap. Test File: structuremap-supplyrequest-transform.json """ filename = ( base_settings["unittest_data_dir"] / "structuremap-supplyrequest-transform.json" ) inst = structuremap.StructureMap.model_validate_json(filename.read_bytes()) assert "StructureMap" == inst.get_resource_type() impl_structuremap_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "StructureMap" == data["resourceType"] inst2 = structuremap.StructureMap(**data) impl_structuremap_1(inst2) def impl_structuremap_2(inst): assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-03-09"} ).valueDateTime ) assert inst.description == "Example Structure Map" assert inst.experimental is True assert inst.group[0].documentation == "test -> testValue" assert inst.group[0].input[0].mode == "source" assert inst.group[0].input[0].name == "testSrc" assert inst.group[0].input[1].mode == "target" assert inst.group[0].input[1].name == "testTgt" assert inst.group[0].name == "Examples" assert inst.group[0].rule[0].name == "rule1" assert inst.group[0].rule[0].source[0].context == "testSrc" assert inst.group[0].rule[0].source[0].element == "test" assert inst.group[0].rule[0].source[0].type == "SourceClassA" assert inst.group[0].rule[0].source[0].variable == "t" assert inst.group[0].rule[0].target[0].context == "testTgt" assert inst.group[0].rule[0].target[0].element == "testValue" assert inst.group[0].rule[0].target[0].transform == "copy" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.13.2" assert inst.jurisdiction[0].coding[0].code == "009" assert inst.jurisdiction[0].coding[0].display == "Oceania" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert inst.name == "ExampleMap" assert inst.publisher == "HL7 FHIR Standard" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Example Map" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureMap/example"} ).valueUri ) assert inst.version == "5.0.0" def test_structuremap_2(base_settings): """No. 2 tests collection for StructureMap. Test File: structuremap-example.json """ filename = base_settings["unittest_data_dir"] / "structuremap-example.json" inst = structuremap.StructureMap.model_validate_json(filename.read_bytes()) assert "StructureMap" == inst.get_resource_type() impl_structuremap_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "StructureMap" == data["resourceType"] inst2 = structuremap.StructureMap(**data) impl_structuremap_2(inst2) ================================================ FILE: fhir/resources/tests/test_subscription.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Subscription Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import subscription from .conftest import ExternalValidatorModel def impl_subscription_1(inst): assert inst.channelType.code == "rest-hook" assert inst.content == "id-only" assert inst.contentType == "application/fhir+json" assert ( inst.end == ExternalValidatorModel.model_validate( {"valueInstant": "2019-08-07T11:15:18Z"} ).valueInstant ) assert ( inst.endpoint == ExternalValidatorModel.model_validate( {"valueUrl": "https://example.org/Endpoints/P123"} ).valueUrl ) assert inst.filterBy[0].filterParameter == "patient" assert inst.filterBy[0].value == "Patient/123" assert inst.heartbeatPeriod == 60 assert inst.id == "admission" assert inst.maxCount == 100 assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "AdmissionExample" assert inst.parameter[0].name == "Authorization" assert inst.parameter[0].value == "Bearer secret-token-abc-123" assert inst.reason == ( "subscription for beginning of a clinical encounter for " "patient 123" ) assert inst.status == "active" assert inst.text.status == "generated" assert inst.timeout == 5 assert inst.topic == "http://example.org/R5/SubscriptionTopic/admission" def test_subscription_1(base_settings): """No. 1 tests collection for Subscription. Test File: subscription-admission.json """ filename = base_settings["unittest_data_dir"] / "subscription-admission.json" inst = subscription.Subscription.model_validate_json(filename.read_bytes()) assert "Subscription" == inst.get_resource_type() impl_subscription_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Subscription" == data["resourceType"] inst2 = subscription.Subscription(**data) impl_subscription_1(inst2) def impl_subscription_2(inst): assert inst.channelType.code == "rest-hook" assert inst.contact[0].system == "phone" assert inst.contact[0].use == "work" assert inst.contact[0].value == "(555) 555-1212" assert inst.filterBy[0].filterParameter == "patient" assert inst.filterBy[0].value == "Patient/123" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:uuid:97e5aa1e-5916-4512-a36e-24eef784e3cc" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "Example" assert inst.reason == "Example subscription for example topic" assert inst.status == "active" assert inst.text.status == "generated" assert inst.topic == "http://example.org/R5/SubscriptionTopic/example" def test_subscription_2(base_settings): """No. 2 tests collection for Subscription. Test File: subscription-example.json """ filename = base_settings["unittest_data_dir"] / "subscription-example.json" inst = subscription.Subscription.model_validate_json(filename.read_bytes()) assert "Subscription" == inst.get_resource_type() impl_subscription_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Subscription" == data["resourceType"] inst2 = subscription.Subscription(**data) impl_subscription_2(inst2) ================================================ FILE: fhir/resources/tests/test_subscriptionstatus.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/SubscriptionStatus Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import subscriptionstatus from .conftest import ExternalValidatorModel def impl_subscriptionstatus_1(inst): # Don't know how to create unit test # for "eventsSinceSubscriptionStart", # which is a Integer64 assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) # Don't know how to create unit test # for "notificationEvent[0].eventNumber", # which is a Integer64 assert inst.status == "active" assert inst.subscription.reference == "http://example.org/FHIR/R5/Subscription/123" assert inst.text.status == "generated" assert inst.topic == "http://example.org/FHIR/R5/SubscriptionTopic/admission" assert inst.type == "event-notification" def test_subscriptionstatus_1(base_settings): """No. 1 tests collection for SubscriptionStatus. Test File: subscriptionstatus-example.json """ filename = base_settings["unittest_data_dir"] / "subscriptionstatus-example.json" inst = subscriptionstatus.SubscriptionStatus.model_validate_json( filename.read_bytes() ) assert "SubscriptionStatus" == inst.get_resource_type() impl_subscriptionstatus_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SubscriptionStatus" == data["resourceType"] inst2 = subscriptionstatus.SubscriptionStatus(**data) impl_subscriptionstatus_1(inst2) ================================================ FILE: fhir/resources/tests/test_subscriptiontopic.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/SubscriptionTopic Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import subscriptiontopic from .conftest import ExternalValidatorModel def impl_subscriptiontopic_1(inst): assert inst.canFilterBy[0].description == ( "Matching based on the Patient (subject) of an Encounter or " "based on the Patient's group membership (in/not-in)." ) assert inst.canFilterBy[0].filterParameter == "patient" assert inst.canFilterBy[0].modifier[0] == "in" assert inst.canFilterBy[0].modifier[1] == "not-in" assert ( inst.canFilterBy[0].resource == ExternalValidatorModel.model_validate({"valueUri": "Encounter"}).valueUri ) assert inst.description == "Example admission topic" assert ( inst.eventTrigger[0].description == "Patient admission is covered by HL7v2 ADT^A01" ) assert inst.eventTrigger[0].event.coding[0].code == "A01" assert ( inst.eventTrigger[0].event.coding[0].display == "ADT/ACK - Admit/visit notification" ) assert ( inst.eventTrigger[0].event.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v2-0003"} ).valueUri ) assert ( inst.eventTrigger[0].resource == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/Encounter"} ).valueUri ) assert inst.id == "admission" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:uuid:915c2040-b0a8-4935-adf8-94d6e1a74052" assert inst.notificationShape[0].include[0] == "Encounter:patient" assert inst.notificationShape[0].include[1] == "Encounter:practitioner" assert inst.notificationShape[0].include[2] == "Encounter:service-provider" assert inst.notificationShape[0].include[3] == "Encounter:account" assert inst.notificationShape[0].include[4] == "Encounter:diagnosis" assert inst.notificationShape[0].include[5] == "Encounter:observation" assert inst.notificationShape[0].include[6] == "Encounter:location" assert ( inst.notificationShape[0].resource == ExternalValidatorModel.model_validate({"valueUri": "Encounter"}).valueUri ) assert ( inst.resourceTrigger[0].description == "Encounter resource moving to state 'in-progress'" ) assert inst.resourceTrigger[0].fhirPathCriteria == ( "%previous.status!='in-progress' and %current.status='in-" "progress'" ) assert inst.resourceTrigger[0].queryCriteria.current == "status=in-progress" assert inst.resourceTrigger[0].queryCriteria.previous == "status:not=in-progress" assert inst.resourceTrigger[0].queryCriteria.requireBoth is True assert inst.resourceTrigger[0].queryCriteria.resultForCreate == "test-passes" assert inst.resourceTrigger[0].queryCriteria.resultForDelete == "test-fails" assert ( inst.resourceTrigger[0].resource == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/Encounter"} ).valueUri ) assert inst.resourceTrigger[0].supportedInteraction[0] == "create" assert inst.resourceTrigger[0].supportedInteraction[1] == "update" assert inst.status == "active" assert inst.text.status == "generated" assert inst.title == "admission" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/FHIR/R5/SubscriptionTopic/admission"} ).valueUri ) def test_subscriptiontopic_1(base_settings): """No. 1 tests collection for SubscriptionTopic. Test File: subscriptiontopic-example-admission.json """ filename = ( base_settings["unittest_data_dir"] / "subscriptiontopic-example-admission.json" ) inst = subscriptiontopic.SubscriptionTopic.model_validate_json( filename.read_bytes() ) assert "SubscriptionTopic" == inst.get_resource_type() impl_subscriptiontopic_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SubscriptionTopic" == data["resourceType"] inst2 = subscriptiontopic.SubscriptionTopic(**data) impl_subscriptiontopic_1(inst2) def impl_subscriptiontopic_2(inst): assert ( inst.canFilterBy[0].description == "Filter based on the subject of an encounter." ) assert inst.canFilterBy[0].filterParameter == "subject" assert ( inst.canFilterBy[0].resource == ExternalValidatorModel.model_validate({"valueUri": "Encounter"}).valueUri ) assert inst.canFilterBy[1].description == ( "Filter based on the group membership of the subject of an " "encounter." ) assert inst.canFilterBy[1].filterParameter == "_in" assert ( inst.canFilterBy[1].resource == ExternalValidatorModel.model_validate({"valueUri": "Encounter"}).valueUri ) assert inst.canFilterBy[2].comparator[0] == "gt" assert inst.canFilterBy[2].comparator[1] == "lt" assert inst.canFilterBy[2].comparator[2] == "ge" assert inst.canFilterBy[2].comparator[3] == "le" assert ( inst.canFilterBy[2].description == "Filter based on the length of an encounter." ) assert inst.canFilterBy[2].filterParameter == "length" assert ( inst.canFilterBy[2].resource == ExternalValidatorModel.model_validate({"valueUri": "Encounter"}).valueUri ) assert ( inst.canFilterBy[3].description == "Filter based on the account for billing an encounter." ) assert inst.canFilterBy[3].filterParameter == "account" assert inst.canFilterBy[3].modifier[0] == "missing" assert inst.canFilterBy[3].modifier[1] == "not" assert inst.canFilterBy[3].modifier[2] == "identifier" assert ( inst.canFilterBy[3].resource == ExternalValidatorModel.model_validate({"valueUri": "Encounter"}).valueUri ) assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2019-01-01"} ).valueDateTime ) assert inst.description == "Example topic for completed encounters" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:uuid:1caa02ba-051b-4602-8856-65921748ae76" assert ( inst.notificationShape[0].include[0] == "Encounter:patient&iterate=Patient.link" ) assert inst.notificationShape[0].include[1] == "Encounter:practitioner" assert inst.notificationShape[0].include[2] == "Encounter:service-provider" assert inst.notificationShape[0].include[3] == "Encounter:account" assert inst.notificationShape[0].include[4] == "Encounter:diagnosis" assert inst.notificationShape[0].include[5] == "Encounter:observation" assert inst.notificationShape[0].include[6] == "Encounter:location" assert ( inst.notificationShape[0].resource == ExternalValidatorModel.model_validate({"valueUri": "Encounter"}).valueUri ) assert inst.resourceTrigger[0].description == "An Encounter has been completed" assert inst.resourceTrigger[0].fhirPathCriteria == ( "(%previous.empty() | (%previous.status != 'completed')) and " "(%current.status = 'completed')" ) assert inst.resourceTrigger[0].queryCriteria.current == "status=completed" assert inst.resourceTrigger[0].queryCriteria.previous == "status:not=completed" assert inst.resourceTrigger[0].queryCriteria.requireBoth is True assert inst.resourceTrigger[0].queryCriteria.resultForCreate == "test-passes" assert inst.resourceTrigger[0].queryCriteria.resultForDelete == "test-fails" assert ( inst.resourceTrigger[0].resource == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/StructureDefinition/Encounter"} ).valueUri ) assert inst.resourceTrigger[0].supportedInteraction[0] == "update" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "example" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://example.org/FHIR/R5/SubscriptionTopic/example"} ).valueUri ) assert inst.version == "1.0.0-beta.1" def test_subscriptiontopic_2(base_settings): """No. 2 tests collection for SubscriptionTopic. Test File: subscriptiontopic-example.json """ filename = base_settings["unittest_data_dir"] / "subscriptiontopic-example.json" inst = subscriptiontopic.SubscriptionTopic.model_validate_json( filename.read_bytes() ) assert "SubscriptionTopic" == inst.get_resource_type() impl_subscriptiontopic_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SubscriptionTopic" == data["resourceType"] inst2 = subscriptiontopic.SubscriptionTopic(**data) impl_subscriptiontopic_2(inst2) ================================================ FILE: fhir/resources/tests/test_substance.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Substance Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import substance from .conftest import ExternalValidatorModel def impl_substance_1(inst): assert inst.category[0].coding[0].code == "chemical" assert inst.category[0].coding[0].display == "Chemical" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/substance-category"} ).valueUri ) assert inst.code.concept.coding[0].code == "333346007" assert ( inst.code.concept.coding[0].display == "Silver nitrate 20% solution (product)" ) assert ( inst.code.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.description == "Solution for silver nitrate stain" assert ( inst.expiry == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-01-01"} ).valueDateTime ) assert inst.id == "f204" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org/identifiers/substances/lot"} ).valueUri ) assert inst.identifier[0].value == "AB94687" assert inst.instance is True assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.quantity.code == "mL" assert ( inst.quantity.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.quantity.unit == "mL" assert float(inst.quantity.value) == float(100) assert inst.text.status == "generated" def test_substance_1(base_settings): """No. 1 tests collection for Substance. Test File: substance-example-silver-nitrate-product.json """ filename = ( base_settings["unittest_data_dir"] / "substance-example-silver-nitrate-product.json" ) inst = substance.Substance.model_validate_json(filename.read_bytes()) assert "Substance" == inst.get_resource_type() impl_substance_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Substance" == data["resourceType"] inst2 = substance.Substance(**data) impl_substance_1(inst2) def impl_substance_2(inst): assert inst.category[0].coding[0].code == "drug" assert inst.category[0].coding[0].display == "Drug or Medicament" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/substance-category"} ).valueUri ) assert inst.code.concept.coding[0].code == "392259005" assert inst.code.concept.coding[0].display == ( "Amoxicillin + clavulanate potassium 875mg/125mg tablet " "(product)" ) assert ( inst.code.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.contained[0].id == "ingr1" assert inst.contained[1].id == "ingr2" assert inst.description == "Augmentin 875" assert inst.id == "f205" assert inst.ingredient[0].quantity.denominator.code == "mg" assert ( inst.ingredient[0].quantity.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.ingredient[0].quantity.denominator.unit == "mg" assert float(inst.ingredient[0].quantity.denominator.value) == float(1000) assert inst.ingredient[0].quantity.numerator.code == "mg" assert ( inst.ingredient[0].quantity.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.ingredient[0].quantity.numerator.unit == "mg" assert float(inst.ingredient[0].quantity.numerator.value) == float(875) assert inst.ingredient[0].substanceReference.reference == "#ingr1" assert inst.ingredient[1].quantity.denominator.code == "mg" assert ( inst.ingredient[1].quantity.denominator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.ingredient[1].quantity.denominator.unit == "mg" assert float(inst.ingredient[1].quantity.denominator.value) == float(1000) assert inst.ingredient[1].quantity.numerator.code == "mg" assert ( inst.ingredient[1].quantity.numerator.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.ingredient[1].quantity.numerator.unit == "mg" assert float(inst.ingredient[1].quantity.numerator.value) == float(125) assert inst.ingredient[1].substanceReference.reference == "#ingr2" assert inst.instance is False assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_substance_2(base_settings): """No. 2 tests collection for Substance. Test File: substance-example-amoxicillin-clavulanate.json """ filename = ( base_settings["unittest_data_dir"] / "substance-example-amoxicillin-clavulanate.json" ) inst = substance.Substance.model_validate_json(filename.read_bytes()) assert "Substance" == inst.get_resource_type() impl_substance_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Substance" == data["resourceType"] inst2 = substance.Substance(**data) impl_substance_2(inst2) def impl_substance_3(inst): assert inst.category[0].coding[0].code == "chemical" assert inst.category[0].coding[0].display == "Chemical" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/substance-category"} ).valueUri ) assert inst.code.concept.coding[0].code == "88480006" assert inst.code.concept.coding[0].display == "Potassium" assert ( inst.code.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "f203" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org/identifiers/substances"} ).valueUri ) assert inst.identifier[0].value == "1234" assert inst.instance is False assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_substance_3(base_settings): """No. 3 tests collection for Substance. Test File: substance-example-f203-potassium.json """ filename = ( base_settings["unittest_data_dir"] / "substance-example-f203-potassium.json" ) inst = substance.Substance.model_validate_json(filename.read_bytes()) assert "Substance" == inst.get_resource_type() impl_substance_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Substance" == data["resourceType"] inst2 = substance.Substance(**data) impl_substance_3(inst2) def impl_substance_4(inst): assert inst.code.concept.coding[0].code == "406466009" assert inst.code.concept.coding[0].display == "House dust allergen" assert ( inst.code.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "f201" assert inst.instance is False assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_substance_4(base_settings): """No. 4 tests collection for Substance. Test File: substance-example-f201-dust.json """ filename = base_settings["unittest_data_dir"] / "substance-example-f201-dust.json" inst = substance.Substance.model_validate_json(filename.read_bytes()) assert "Substance" == inst.get_resource_type() impl_substance_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Substance" == data["resourceType"] inst2 = substance.Substance(**data) impl_substance_4(inst2) def impl_substance_5(inst): assert inst.category[0].coding[0].code == "allergen" assert inst.category[0].coding[0].display == "Allergen" assert ( inst.category[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/substance-category"} ).valueUri ) assert inst.code.concept.text == "apitoxin (Honey Bee Venom)" assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://acme.org/identifiers/substances"} ).valueUri ) assert inst.identifier[0].value == "1463" assert inst.instance is False assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "active" assert inst.text.status == "generated" def test_substance_5(base_settings): """No. 5 tests collection for Substance. Test File: substance-example.json """ filename = base_settings["unittest_data_dir"] / "substance-example.json" inst = substance.Substance.model_validate_json(filename.read_bytes()) assert "Substance" == inst.get_resource_type() impl_substance_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Substance" == data["resourceType"] inst2 = substance.Substance(**data) impl_substance_5(inst2) def impl_substance_6(inst): assert inst.code.concept.coding[0].code == "3092008" assert inst.code.concept.coding[0].display == "Staphylococcus Aureus" assert ( inst.code.concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.id == "f202" assert inst.instance is False assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_substance_6(base_settings): """No. 6 tests collection for Substance. Test File: substance-example-f202-staphylococcus.json """ filename = ( base_settings["unittest_data_dir"] / "substance-example-f202-staphylococcus.json" ) inst = substance.Substance.model_validate_json(filename.read_bytes()) assert "Substance" == inst.get_resource_type() impl_substance_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Substance" == data["resourceType"] inst2 = substance.Substance(**data) impl_substance_6(inst2) ================================================ FILE: fhir/resources/tests/test_substancedefinition.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/SubstanceDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import substancedefinition from .conftest import ExternalValidatorModel def impl_substancedefinition_1(inst): assert inst.classification[0].coding[0].code == "100000075670" assert inst.classification[0].coding[0].display == "Chemical" assert ( inst.classification[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.europa.eu/fhir/SubstanceType"} ).valueUri ) assert inst.code[0].code.coding[0].code == "SUB99611MIG" assert ( inst.code[0].code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.europa.eu/fhir/Substance"} ).valueUri ) assert inst.domain.coding[0].code == "100000000012" assert inst.domain.coding[0].display == "Human use" assert ( inst.domain.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.europa.eu/fhir/Domain"} ).valueUri ) assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.europa.eu/fhir/SMSId"} ).valueUri ) assert inst.identifier[0].value == "100000099270" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name[0].language[0].coding[0].code == "en" assert inst.name[0].language[0].coding[0].display == "English" assert ( inst.name[0].language[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:47"} ).valueUri ) assert inst.name[0].name == "PARACETAMOL" assert inst.name[0].preferred is True assert inst.name[0].status.coding[0].code == "200000005004" assert inst.name[0].status.coding[0].display == "Current" assert ( inst.name[0].status.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.europa.eu/fhir/Status"} ).valueUri ) assert inst.name[1].language[0].coding[0].code == "el" assert inst.name[1].language[0].coding[0].display == "Greek" assert ( inst.name[1].language[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:47"} ).valueUri ) assert inst.name[1].name == "ΠΑΡΑΚΕΤΑΜΌΛΗ" assert inst.name[1].preferred is False assert inst.name[1].status.coding[0].code == "200000005004" assert inst.name[1].status.coding[0].display == "Current" assert ( inst.name[1].status.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.europa.eu/fhir/Status"} ).valueUri ) assert inst.name[2].language[0].coding[0].code == "bg" assert inst.name[2].language[0].coding[0].display == "Bulgarian" assert ( inst.name[2].language[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:47"} ).valueUri ) assert inst.name[2].name == "ПАРАЦЕТАМОЛ" assert inst.name[2].preferred is False assert inst.name[2].status.coding[0].code == "200000005004" assert inst.name[2].status.coding[0].display == "Current" assert ( inst.name[2].status.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.europa.eu/fhir/Status"} ).valueUri ) assert inst.name[3].language[0].coding[0].code == "en" assert inst.name[3].language[0].coding[0].display == "English" assert ( inst.name[3].language[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:bcp:47"} ).valueUri ) assert inst.name[3].name == "ACETAMINOPHEN" assert inst.name[3].preferred is False assert inst.name[3].status.coding[0].code == "200000005004" assert inst.name[3].status.coding[0].display == "Current" assert ( inst.name[3].status.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.europa.eu/fhir/Status"} ).valueUri ) assert inst.status.coding[0].code == "200000005004" assert inst.status.coding[0].display == "Current" assert ( inst.status.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://example.europa.eu/fhir/Status"} ).valueUri ) assert inst.text.status == "generated" def test_substancedefinition_1(base_settings): """No. 1 tests collection for SubstanceDefinition. Test File: substancedefinition-example.json """ filename = base_settings["unittest_data_dir"] / "substancedefinition-example.json" inst = substancedefinition.SubstanceDefinition.model_validate_json( filename.read_bytes() ) assert "SubstanceDefinition" == inst.get_resource_type() impl_substancedefinition_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SubstanceDefinition" == data["resourceType"] inst2 = substancedefinition.SubstanceDefinition(**data) impl_substancedefinition_1(inst2) ================================================ FILE: fhir/resources/tests/test_substancenucleicacid.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/SubstanceNucleicAcid Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import substancenucleicacid from .conftest import ExternalValidatorModel def impl_substancenucleicacid_1(inst): assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_substancenucleicacid_1(base_settings): """No. 1 tests collection for SubstanceNucleicAcid. Test File: substancenucleicacid-example.json """ filename = base_settings["unittest_data_dir"] / "substancenucleicacid-example.json" inst = substancenucleicacid.SubstanceNucleicAcid.model_validate_json( filename.read_bytes() ) assert "SubstanceNucleicAcid" == inst.get_resource_type() impl_substancenucleicacid_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SubstanceNucleicAcid" == data["resourceType"] inst2 = substancenucleicacid.SubstanceNucleicAcid(**data) impl_substancenucleicacid_1(inst2) ================================================ FILE: fhir/resources/tests/test_substancepolymer.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/SubstancePolymer Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import substancepolymer from .conftest import ExternalValidatorModel def impl_substancepolymer_1(inst): assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_substancepolymer_1(base_settings): """No. 1 tests collection for SubstancePolymer. Test File: substancepolymer-example.json """ filename = base_settings["unittest_data_dir"] / "substancepolymer-example.json" inst = substancepolymer.SubstancePolymer.model_validate_json(filename.read_bytes()) assert "SubstancePolymer" == inst.get_resource_type() impl_substancepolymer_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SubstancePolymer" == data["resourceType"] inst2 = substancepolymer.SubstancePolymer(**data) impl_substancepolymer_1(inst2) ================================================ FILE: fhir/resources/tests/test_substanceprotein.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/SubstanceProtein Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import substanceprotein from .conftest import ExternalValidatorModel def impl_substanceprotein_1(inst): assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_substanceprotein_1(base_settings): """No. 1 tests collection for SubstanceProtein. Test File: substanceprotein-example.json """ filename = base_settings["unittest_data_dir"] / "substanceprotein-example.json" inst = substanceprotein.SubstanceProtein.model_validate_json(filename.read_bytes()) assert "SubstanceProtein" == inst.get_resource_type() impl_substanceprotein_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SubstanceProtein" == data["resourceType"] inst2 = substanceprotein.SubstanceProtein(**data) impl_substanceprotein_1(inst2) ================================================ FILE: fhir/resources/tests/test_substancereferenceinformation.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/SubstanceReferenceInformation Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import substancereferenceinformation from .conftest import ExternalValidatorModel def impl_substancereferenceinformation_1(inst): assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_substancereferenceinformation_1(base_settings): """No. 1 tests collection for SubstanceReferenceInformation. Test File: substancereferenceinformation-example.json """ filename = ( base_settings["unittest_data_dir"] / "substancereferenceinformation-example.json" ) inst = ( substancereferenceinformation.SubstanceReferenceInformation.model_validate_json( filename.read_bytes() ) ) assert "SubstanceReferenceInformation" == inst.get_resource_type() impl_substancereferenceinformation_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SubstanceReferenceInformation" == data["resourceType"] inst2 = substancereferenceinformation.SubstanceReferenceInformation(**data) impl_substancereferenceinformation_1(inst2) ================================================ FILE: fhir/resources/tests/test_substancesourcematerial.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/SubstanceSourceMaterial Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import substancesourcematerial from .conftest import ExternalValidatorModel def impl_substancesourcematerial_1(inst): assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.text.status == "generated" def test_substancesourcematerial_1(base_settings): """No. 1 tests collection for SubstanceSourceMaterial. Test File: substancesourcematerial-example.json """ filename = ( base_settings["unittest_data_dir"] / "substancesourcematerial-example.json" ) inst = substancesourcematerial.SubstanceSourceMaterial.model_validate_json( filename.read_bytes() ) assert "SubstanceSourceMaterial" == inst.get_resource_type() impl_substancesourcematerial_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SubstanceSourceMaterial" == data["resourceType"] inst2 = substancesourcematerial.SubstanceSourceMaterial(**data) impl_substancesourcematerial_1(inst2) ================================================ FILE: fhir/resources/tests/test_supplydelivery.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/SupplyDelivery Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import supplydelivery from .conftest import ExternalValidatorModel def impl_supplydelivery_1(inst): assert inst.contained[0].id == "Item1" assert inst.contained[1].id == "Item2" assert inst.contained[2].id == "Item3" assert inst.destination.display == "St Johns Hospital, Anytown, AnyState" assert inst.id == "ISBT128" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.isbt128.org/uri/ProductConsignment"} ).valueUri ) assert inst.identifier[0].value == "A999922123450101" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.suppliedItem[0].itemReference.reference == "#Item1" assert inst.suppliedItem[1].itemReference.reference == "#Item2" assert inst.suppliedItem[2].itemReference.reference == "#Item3" assert inst.supplier.display == "Community Blood Center" assert ( inst.supplier.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.isbt128.org/uri/ProcessorFIN"} ).valueUri ) assert inst.supplier.identifier.value == "A9999" assert inst.text.status == "generated" assert inst.type.coding[0].code == "biologicallyderivedproduct" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/supplydelivery-supplyitemtype"} ).valueUri ) assert inst.type.text == "Blood Dispatch" def test_supplydelivery_1(base_settings): """No. 1 tests collection for SupplyDelivery. Test File: supplydelivery-example-ISBT128.json """ filename = ( base_settings["unittest_data_dir"] / "supplydelivery-example-ISBT128.json" ) inst = supplydelivery.SupplyDelivery.model_validate_json(filename.read_bytes()) assert "SupplyDelivery" == inst.get_resource_type() impl_supplydelivery_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SupplyDelivery" == data["resourceType"] inst2 = supplydelivery.SupplyDelivery(**data) impl_supplydelivery_1(inst2) def impl_supplydelivery_2(inst): assert inst.contained[0].id == "Item1" assert inst.contained[1].id == "Item2" assert inst.contained[2].id == "Item3" assert inst.id == "mphodelivery" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "https://www.isbt128.org/uri/ProductConsignment"} ).valueUri ) assert inst.identifier[0].value == "A999922123450101" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.suppliedItem[0].itemReference.reference == "#Item1" assert float(inst.suppliedItem[0].quantity.value) == float(3) assert inst.suppliedItem[1].itemReference.reference == "#Item2" assert inst.suppliedItem[2].itemReference.reference == "#Item3" assert inst.text.status == "generated" assert inst.type.coding[0].code == "biologicallyderivedproduct" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/supplydelivery-supplyitemtype"} ).valueUri ) assert inst.type.text == "Blood Dispatch" def test_supplydelivery_2(base_settings): """No. 2 tests collection for SupplyDelivery. Test File: supplydelivery-example-mphodelivery.json """ filename = ( base_settings["unittest_data_dir"] / "supplydelivery-example-mphodelivery.json" ) inst = supplydelivery.SupplyDelivery.model_validate_json(filename.read_bytes()) assert "SupplyDelivery" == inst.get_resource_type() impl_supplydelivery_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SupplyDelivery" == data["resourceType"] inst2 = supplydelivery.SupplyDelivery(**data) impl_supplydelivery_2(inst2) def impl_supplydelivery_3(inst): assert inst.basedOn[0].reference == "SupplyRequest/simpleorder" assert inst.destination.display == "Location 1" assert inst.id == "simpledelivery" assert inst.identifier[0].value == "Order10284" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-12-31"} ).valueDateTime ) assert inst.partOf[0].display == "Central Supply Restock" assert inst.status == "completed" assert inst.suppliedItem[0].itemCodeableConcept.coding[0].code == "BlueTubes" assert ( inst.suppliedItem[0].itemCodeableConcept.coding[0].display == "Blood collect tubes blue cap" ) assert float(inst.suppliedItem[0].quantity.value) == float(10) assert inst.supplier.display == "Vendor1" assert inst.text.status == "generated" assert inst.type.coding[0].code == "device" assert ( inst.type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/supplydelivery-supplyitemtype"} ).valueUri ) assert inst.type.text == "Blood collect tubes blue cap" def test_supplydelivery_3(base_settings): """No. 3 tests collection for SupplyDelivery. Test File: supplydelivery-example.json """ filename = base_settings["unittest_data_dir"] / "supplydelivery-example.json" inst = supplydelivery.SupplyDelivery.model_validate_json(filename.read_bytes()) assert "SupplyDelivery" == inst.get_resource_type() impl_supplydelivery_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SupplyDelivery" == data["resourceType"] inst2 = supplydelivery.SupplyDelivery(**data) impl_supplydelivery_3(inst2) def impl_supplydelivery_4(inst): assert inst.destination.display == "Home care dept" assert inst.id == "pumpdelivery" assert inst.identifier[0].assigner.display == "SupplierDeliveryNr" assert inst.identifier[0].value == "98398459409" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.display == "Mr. Belpit" assert inst.receiver[0].display == "Nurse Smith" assert inst.status == "in-progress" assert inst.supplier.display == "ACME distribution" assert inst.text.div == ( '
[Put rendering ' "here]
" ) assert inst.text.status == "generated" def test_supplydelivery_4(base_settings): """No. 4 tests collection for SupplyDelivery. Test File: supplydelivery-example-pumpdelivery.json """ filename = ( base_settings["unittest_data_dir"] / "supplydelivery-example-pumpdelivery.json" ) inst = supplydelivery.SupplyDelivery.model_validate_json(filename.read_bytes()) assert "SupplyDelivery" == inst.get_resource_type() impl_supplydelivery_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SupplyDelivery" == data["resourceType"] inst2 = supplydelivery.SupplyDelivery(**data) impl_supplydelivery_4(inst2) ================================================ FILE: fhir/resources/tests/test_supplyrequest.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/SupplyRequest Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import supplyrequest from .conftest import ExternalValidatorModel def impl_supplyrequest_1(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-12-31"} ).valueDateTime ) assert inst.category.coding[0].code == "central" assert inst.category.coding[0].display == "Central Stock Resupply" assert inst.deliverFrom.display == "Location 1" assert inst.deliverTo.display == "GoodHealth Clinic Receiving" assert inst.id == "simpleorder" assert inst.identifier[0].value == "Order10284" assert inst.item.concept.coding[0].code == "BlueTubes" assert inst.item.concept.coding[0].display == "Blood collect tubes blue cap" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.occurrenceDateTime == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-12-31"} ).valueDateTime ) assert inst.priority == "asap" assert float(inst.quantity.value) == float(10) assert inst.reason[0].concept.coding[0].code == "stock_low" assert inst.reason[0].concept.coding[0].display == "Refill due to low stock" assert inst.requester.display == "Henry Seven" assert inst.status == "active" assert inst.supplier[0].display == "Vendor1" assert inst.text.status == "generated" def test_supplyrequest_1(base_settings): """No. 1 tests collection for SupplyRequest. Test File: supplyrequest-example-simpleorder.json """ filename = ( base_settings["unittest_data_dir"] / "supplyrequest-example-simpleorder.json" ) inst = supplyrequest.SupplyRequest.model_validate_json(filename.read_bytes()) assert "SupplyRequest" == inst.get_resource_type() impl_supplyrequest_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "SupplyRequest" == data["resourceType"] inst2 = supplyrequest.SupplyRequest(**data) impl_supplyrequest_1(inst2) ================================================ FILE: fhir/resources/tests/test_task.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Task Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import task from .conftest import ExternalValidatorModel def impl_task_1(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-31T08:25:05+10:00"} ).valueDateTime ) assert inst.basedOn[0].display == "General Wellness Careplan" assert inst.businessStatus.text == "test completed and posted" assert inst.code.coding[0].code == "fulfill" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CodeSystem/task-code"} ).valueUri ) assert inst.description == ( "Create order for getting specimen, Set up inhouse testing, " "generate order for any sendouts and submit with specimen" ) assert inst.encounter.display == "Example In-Patient Encounter" assert inst.encounter.reference == "Encounter/example" assert ( inst.executionPeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-31T18:45:05+10:00"} ).valueDateTime ) assert ( inst.executionPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-31T08:25:05+10:00"} ).valueDateTime ) assert inst.focus.display == "Lipid Panel Request" assert inst.focus.reference == "ServiceRequest/lipid" assert inst.for_fhir.display == "Peter James Chalmers" assert inst.for_fhir.reference == "Patient/example" assert ( inst.groupIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http:/goodhealth.org/accession/identifiers"} ).valueUri ) assert inst.groupIdentifier.use == "official" assert inst.groupIdentifier.value == "G20170201-001" assert inst.id == "example6" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http:/goodhealth.org/identifiers"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "20170201-001" assert inst.intent == "order" assert ( inst.lastModified == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-31T18:45:05+10:00"} ).valueDateTime ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.output[0].type.text == "DiagnosticReport generated" assert inst.output[0].valueReference.reference == "DiagnosticReport/lipids" assert inst.output[1].type.text == "collected specimen" assert inst.output[1].valueReference.reference == "Specimen/101" assert inst.owner.display == "Clinical Laboratory @ Acme Hospital" assert inst.owner.reference == "Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" assert inst.priority == "routine" assert inst.reason[0].concept.text == ( "The Task.reason should only be included if there is no " "Task.focus or if it differs from the reason indicated on the" " focus" ) assert inst.requestedPerformer[0].reference.reference == "PractitionerRole/f202" assert inst.requester.display == "Dr Adam Careful" assert inst.requester.reference == "Practitioner/example" assert ( inst.restriction.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-11-02T09:45:05+10:00"} ).valueDateTime ) assert inst.restriction.repetitions == 1 assert inst.status == "completed" assert inst.text.status == "generated" def test_task_1(base_settings): """No. 1 tests collection for Task. Test File: task-example6.json """ filename = base_settings["unittest_data_dir"] / "task-example6.json" inst = task.Task.model_validate_json(filename.read_bytes()) assert "Task" == inst.get_resource_type() impl_task_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Task" == data["resourceType"] inst2 = task.Task(**data) impl_task_1(inst2) def impl_task_2(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-12T08:25:05+10:00"} ).valueDateTime ) assert inst.code.coding[0].code == "poll" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/financialtaskcode"} ).valueUri ) assert inst.id == "fm-example2" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http:/happyvalley.com/task"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "20181012-005" assert inst.input[0].type.coding[0].code == "include" assert ( inst.input[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/financialtaskinputtype"} ).valueUri ) assert inst.input[0].valueCode == "ClaimResponse" assert inst.input[1].type.coding[0].code == "period" assert ( inst.input[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/financialtaskinputtype"} ).valueUri ) assert ( inst.input[1].valuePeriod.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-12"} ).valueDateTime ) assert ( inst.input[1].valuePeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-01"} ).valueDateTime ) assert inst.intent == "order" assert ( inst.lastModified == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-12T08:25:05+10:00"} ).valueDateTime ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.owner.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://nationalinsurers.com/identifiers"} ).valueUri ) assert inst.owner.identifier.value == "12345" assert inst.priority == "stat" assert inst.requester.display == "Happy Valley Clinic" assert inst.requester.reference == "Organization/example" assert inst.status == "requested" assert inst.text.status == "generated" def test_task_2(base_settings): """No. 2 tests collection for Task. Test File: task-example-fm-poll.json """ filename = base_settings["unittest_data_dir"] / "task-example-fm-poll.json" inst = task.Task.model_validate_json(filename.read_bytes()) assert "Task" == inst.get_resource_type() impl_task_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Task" == data["resourceType"] inst2 = task.Task(**data) impl_task_2(inst2) def impl_task_3(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-31T08:25:05+10:00"} ).valueDateTime ) assert inst.basedOn[0].display == "General Wellness Careplan" assert inst.businessStatus.text == "waiting for specimen" assert inst.code.coding[0].code == "fulfill" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CodeSystem/task-code"} ).valueUri ) assert inst.code.text == "Lipid Panel" assert inst.contained[0].id == "signature" assert inst.description == ( "Create order for getting specimen, Set up inhouse testing, " "generate order for any sendouts and submit with specimen" ) assert inst.encounter.display == "Example In-Patient Encounter" assert inst.encounter.reference == "Encounter/example" assert ( inst.executionPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-31T08:25:05+10:00"} ).valueDateTime ) assert inst.focus.display == "Lipid Panel Request" assert inst.focus.reference == "ServiceRequest/lipid" assert inst.for_fhir.display == "Peter James Chalmers" assert inst.for_fhir.reference == "Patient/example" assert ( inst.groupIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http:/goodhealth.org/accession/identifiers"} ).valueUri ) assert inst.groupIdentifier.use == "official" assert inst.groupIdentifier.value == "G20170201-001" assert inst.id == "example1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http:/goodhealth.org/identifiers"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "20170201-001" assert inst.intent == "order" assert ( inst.lastModified == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-31T09:45:05+10:00"} ).valueDateTime ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.owner.display == "Clinical Laboratory @ Acme Hospital" assert inst.owner.reference == "Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" assert inst.priority == "routine" assert inst.reason[0].concept.text == ( "The Task.reason should only be included if there is no " "Task.focus or if it differs from the reason indicated on the" " focus" ) assert inst.relevantHistory[0].display == "Author's Signature" assert inst.relevantHistory[0].reference == "#signature" assert inst.requestedPerformer[0].concept.coding[0].code == "18850004" assert ( inst.requestedPerformer[0].concept.coding[0].display == "Laboratory hematologist" ) assert ( inst.requestedPerformer[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.requestedPerformer[0].concept.text == "Performer" assert inst.requester.display == "Dr Adam Careful" assert inst.requester.reference == "Practitioner/example" assert ( inst.restriction.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-11-02T09:45:05+10:00"} ).valueDateTime ) assert inst.restriction.repetitions == 1 assert inst.status == "in-progress" assert inst.text.status == "generated" def test_task_3(base_settings): """No. 3 tests collection for Task. Test File: task-example1.json """ filename = base_settings["unittest_data_dir"] / "task-example1.json" inst = task.Task.model_validate_json(filename.read_bytes()) assert "Task" == inst.get_resource_type() impl_task_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Task" == data["resourceType"] inst2 = task.Task(**data) impl_task_3(inst2) def impl_task_4(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-04T08:25:05+10:00"} ).valueDateTime ) assert inst.code.coding[0].code == "reprocess" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/financialtaskcode"} ).valueUri ) assert ( inst.focus.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/claim"} ).valueUri ) assert inst.focus.identifier.value == "1501" assert inst.id == "fm-example4" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http:/happyvalley.com/task"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "20181012-006" assert inst.input[0].type.coding[0].code == "origresponse" assert ( inst.input[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/financialtaskinputtype"} ).valueUri ) assert ( inst.input[0].valueReference.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://nationalinsurers.com/claimresponse"} ).valueUri ) assert inst.input[0].valueReference.identifier.value == "CR201810040001234" assert inst.input[1].type.coding[0].code == "reference" assert ( inst.input[1].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/financialtaskinputtype"} ).valueUri ) assert inst.input[1].valueString == "BR12345" assert inst.input[2].type.coding[0].code == "item" assert ( inst.input[2].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/financialtaskinputtype"} ).valueUri ) assert inst.input[2].valuePositiveInt == 2 assert inst.input[3].type.coding[0].code == "item" assert ( inst.input[3].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/financialtaskinputtype"} ).valueUri ) assert inst.input[3].valuePositiveInt == 3 assert inst.intent == "order" assert ( inst.lastModified == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-04T08:25:05+10:00"} ).valueDateTime ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.owner.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://nationalinsurers.com/identifiers"} ).valueUri ) assert inst.owner.identifier.value == "12345" assert inst.priority == "stat" assert inst.requester.display == "Happy Valley Clinic" assert inst.requester.reference == "Organization/example" assert inst.status == "requested" assert inst.text.status == "generated" def test_task_4(base_settings): """No. 4 tests collection for Task. Test File: task-example-fm-reprocess.json """ filename = base_settings["unittest_data_dir"] / "task-example-fm-reprocess.json" inst = task.Task.model_validate_json(filename.read_bytes()) assert "Task" == inst.get_resource_type() impl_task_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Task" == data["resourceType"] inst2 = task.Task(**data) impl_task_4(inst2) def impl_task_5(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-03-10T22:39:32-04:00"} ).valueDateTime ) assert inst.code.text == "Refill Request" assert inst.focus.reference == "MedicationRequest/medrx002" assert inst.for_fhir.reference == "Patient/f001" assert inst.id == "example3" assert inst.intent == "order" assert ( inst.lastModified == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-03-10T22:39:32-04:00"} ).valueDateTime ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.owner.reference == "Practitioner/example" assert inst.requester.reference == "Patient/example" assert inst.status == "draft" assert inst.text.status == "generated" def test_task_5(base_settings): """No. 5 tests collection for Task. Test File: task-example3.json """ filename = base_settings["unittest_data_dir"] / "task-example3.json" inst = task.Task.model_validate_json(filename.read_bytes()) assert "Task" == inst.get_resource_type() impl_task_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Task" == data["resourceType"] inst2 = task.Task(**data) impl_task_5(inst2) def impl_task_6(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-04T08:25:05+10:00"} ).valueDateTime ) assert inst.code.coding[0].code == "status" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/financialtaskcode"} ).valueUri ) assert ( inst.focus.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/claim"} ).valueUri ) assert inst.focus.identifier.value == "1500" assert inst.id == "fm-example6" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http:/happyvalley.com/task"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "20181012-001" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "http://nationalinsurers.com/identifiers/12345"} ).valueUri ) assert inst.identifier[1].use == "official" assert inst.identifier[1].value == "123GB5674" assert inst.intent == "order" assert ( inst.lastModified == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-04T08:25:05+10:00"} ).valueDateTime ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.output[0].type.coding[0].code == "status" assert ( inst.output[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/financial-taskoutputtype"} ).valueUri ) assert inst.output[0].valueCode == "complete" assert ( inst.owner.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://nationalinsurers.com/identifiers"} ).valueUri ) assert inst.owner.identifier.value == "12345" assert inst.priority == "stat" assert inst.requester.display == "Happy Valley Clinic" assert inst.requester.reference == "Organization/example" assert inst.status == "completed" assert inst.text.status == "generated" def test_task_6(base_settings): """No. 6 tests collection for Task. Test File: task-example-fm-status-resp.json """ filename = base_settings["unittest_data_dir"] / "task-example-fm-status-resp.json" inst = task.Task.model_validate_json(filename.read_bytes()) assert "Task" == inst.get_resource_type() impl_task_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Task" == data["resourceType"] inst2 = task.Task(**data) impl_task_6(inst2) def impl_task_7(inst): assert inst.code.text == "Collect information" assert inst.doNotPerform is True assert inst.for_fhir.reference == "Patient/example" assert inst.id == "cpg-example-1" assert inst.input[0].type.text == "Collect information" assert inst.input[0].valueCanonical == "http://hl7.org/fhir/Questionnaire/f201" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "ready" assert inst.text.status == "generated" def test_task_7(base_settings): """No. 7 tests collection for Task. Test File: task-cpg-example-1.json """ filename = base_settings["unittest_data_dir"] / "task-cpg-example-1.json" inst = task.Task.model_validate_json(filename.read_bytes()) assert "Task" == inst.get_resource_type() impl_task_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Task" == data["resourceType"] inst2 = task.Task(**data) impl_task_7(inst2) def impl_task_8(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-31T08:45:05+10:00"} ).valueDateTime ) assert inst.businessStatus.text == "waiting for patient" assert inst.code.coding[0].code == "fulfill" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/CodeSystem/task-code"} ).valueUri ) assert inst.encounter.display == "Example In-Patient Encounter" assert inst.encounter.reference == "Encounter/example" assert ( inst.executionPeriod.start == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-31T08:45:05+10:00"} ).valueDateTime ) assert inst.focus.display == "BloodDraw ServiceRequest" assert inst.for_fhir.display == "Peter James Chalmers" assert inst.for_fhir.reference == "Patient/example" assert ( inst.groupIdentifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http:/goodhealth.org/accession/identifiers"} ).valueUri ) assert inst.groupIdentifier.use == "official" assert inst.groupIdentifier.value == "G20170201-001" assert inst.id == "example2" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http:/goodhealth.org/identifiers"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "20170201-002" assert inst.intent == "filler-order" assert ( inst.lastModified == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-31T09:45:05+10:00"} ).valueDateTime ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.owner.display == "Clinical Laboratory @ Acme Hospital" assert inst.owner.reference == "Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" assert inst.partOf[0].display == "Lipid Panel" assert inst.partOf[0].reference == "Task/example1" assert inst.priority == "routine" assert inst.requestedPerformer[0].concept.coding[0].code == "18850004" assert ( inst.requestedPerformer[0].concept.coding[0].display == "Laboratory hematologist" ) assert ( inst.requestedPerformer[0].concept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.requestedPerformer[0].concept.text == "Performer" assert inst.requester.display == "Clinical Laboratory @ Acme Hospital" assert ( inst.requester.reference == "Organization/1832473e-2fe0-452d-abe9-3cdb9879522f" ) assert ( inst.restriction.period.end == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-11-01T09:45:05+10:00"} ).valueDateTime ) assert inst.restriction.repetitions == 1 assert inst.status == "accepted" assert inst.text.status == "generated" def test_task_8(base_settings): """No. 8 tests collection for Task. Test File: task-example2.json """ filename = base_settings["unittest_data_dir"] / "task-example2.json" inst = task.Task.model_validate_json(filename.read_bytes()) assert "Task" == inst.get_resource_type() impl_task_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Task" == data["resourceType"] inst2 = task.Task(**data) impl_task_8(inst2) def impl_task_9(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-04T08:25:05+10:00"} ).valueDateTime ) assert inst.code.coding[0].code == "release" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/financialtaskcode"} ).valueUri ) assert ( inst.focus.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/claim"} ).valueUri ) assert inst.focus.identifier.value == "1501" assert inst.id == "fm-example3" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http:/happyvalley.com/task"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "20181012-001" assert inst.input[0].type.coding[0].code == "origresponse" assert ( inst.input[0].type.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/financial-taskinputtype"} ).valueUri ) assert ( inst.input[0].valueReference.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://nationalinsurers.com/claimresponse"} ).valueUri ) assert inst.input[0].valueReference.identifier.value == "CR201810040001234" assert inst.intent == "order" assert ( inst.lastModified == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-04T08:25:05+10:00"} ).valueDateTime ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.owner.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://nationalinsurers.com/identifiers"} ).valueUri ) assert inst.owner.identifier.value == "12345" assert inst.priority == "stat" assert inst.requester.display == "Happy Valley Clinic" assert inst.requester.reference == "Organization/example" assert inst.status == "requested" assert inst.text.status == "generated" def test_task_9(base_settings): """No. 9 tests collection for Task. Test File: task-example-fm-release.json """ filename = base_settings["unittest_data_dir"] / "task-example-fm-release.json" inst = task.Task.model_validate_json(filename.read_bytes()) assert "Task" == inst.get_resource_type() impl_task_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Task" == data["resourceType"] inst2 = task.Task(**data) impl_task_9(inst2) def impl_task_10(inst): assert ( inst.authoredOn == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-04T08:25:05+10:00"} ).valueDateTime ) assert inst.code.coding[0].code == "cancel" assert ( inst.code.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/financialtaskcode"} ).valueUri ) assert ( inst.focus.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://happyvalley.com/claim"} ).valueUri ) assert inst.focus.identifier.value == "1500" assert inst.id == "fm-example1" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http:/happyvalley.com/task"} ).valueUri ) assert inst.identifier[0].use == "official" assert inst.identifier[0].value == "20181012-001" assert inst.intent == "order" assert ( inst.lastModified == ExternalValidatorModel.model_validate( {"valueDateTime": "2018-10-04T08:25:05+10:00"} ).valueDateTime ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert ( inst.owner.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "http://nationalinsurers.com/identifiers"} ).valueUri ) assert inst.owner.identifier.value == "12345" assert inst.priority == "stat" assert inst.requester.display == "Happy Valley Clinic" assert inst.requester.reference == "Organization/example" assert inst.status == "requested" assert inst.text.status == "generated" def test_task_10(base_settings): """No. 10 tests collection for Task. Test File: task-example-fm-cancel.json """ filename = base_settings["unittest_data_dir"] / "task-example-fm-cancel.json" inst = task.Task.model_validate_json(filename.read_bytes()) assert "Task" == inst.get_resource_type() impl_task_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Task" == data["resourceType"] inst2 = task.Task(**data) impl_task_10(inst2) ================================================ FILE: fhir/resources/tests/test_terminologycapabilities.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/TerminologyCapabilities Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import terminologycapabilities from .conftest import ExternalValidatorModel def impl_terminologycapabilities_1(inst): assert inst.codeSystem[0].content == "complete" assert inst.codeSystem[0].uri == "http://snomed.info/sct" assert ( inst.codeSystem[0].version[0].code == "http://snomed.info/sct/32506021000036107/version/20220831" ) assert inst.codeSystem[1].content == "complete" assert inst.codeSystem[1].uri == "http://loinc.org" assert inst.codeSystem[1].version[0].code == "2.73" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2022-09-01"} ).valueDateTime ) assert inst.id == "example-terminology-server" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.6.1" assert inst.implementation.description == "The ACME FHIR Terminology Server" assert inst.kind == "instance" assert inst.name == "ACMETerminologyServiceTerminologyCapabilities" assert inst.status == "draft" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/TerminologyCapabilities/terminology-server" } ).valueUri ) def test_terminologycapabilities_1(base_settings): """No. 1 tests collection for TerminologyCapabilities. Test File: terminologycapabilities-terminology-server.json """ filename = ( base_settings["unittest_data_dir"] / "terminologycapabilities-terminology-server.json" ) inst = terminologycapabilities.TerminologyCapabilities.model_validate_json( filename.read_bytes() ) assert "TerminologyCapabilities" == inst.get_resource_type() impl_terminologycapabilities_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "TerminologyCapabilities" == data["resourceType"] inst2 = terminologycapabilities.TerminologyCapabilities(**data) impl_terminologycapabilities_1(inst2) def impl_terminologycapabilities_2(inst): assert inst.codeSearch == "in-compose-or-expansion" assert inst.contact[0].name == "System Administrator" assert inst.contact[0].telecom[0].system == "email" assert inst.contact[0].telecom[0].value == "wile@acme.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2012-01-04"} ).valueDateTime ) assert inst.description == ( "This is the FHIR capability statement for the main EHR at " "ACME for the private interface - it does not describe the " "public interface" ) assert inst.experimental is True assert inst.id == "example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.6.2" assert inst.implementation.description == "Acme Terminology Server" assert ( inst.implementation.url == ExternalValidatorModel.model_validate( {"valueUrl": "http://example.org/tx"} ).valueUrl ) assert inst.kind == "instance" assert inst.name == "ACMEEHR" assert inst.publisher == "ACME Corporation" assert inst.software.name == "TxServer" assert inst.software.version == "0.1.2" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "ACME EHR capability statement" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "urn:uuid:68d043b5-9ecf-4559-a57a-396e0d452311"} ).valueUri ) assert inst.version == "20130510" def test_terminologycapabilities_2(base_settings): """No. 2 tests collection for TerminologyCapabilities. Test File: terminologycapabilities-example.json """ filename = ( base_settings["unittest_data_dir"] / "terminologycapabilities-example.json" ) inst = terminologycapabilities.TerminologyCapabilities.model_validate_json( filename.read_bytes() ) assert "TerminologyCapabilities" == inst.get_resource_type() impl_terminologycapabilities_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "TerminologyCapabilities" == data["resourceType"] inst2 = terminologycapabilities.TerminologyCapabilities(**data) impl_terminologycapabilities_2(inst2) ================================================ FILE: fhir/resources/tests/test_testplan.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/TestPlan Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import testplan from .conftest import ExternalValidatorModel def impl_testplan_1(inst): assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "draft" assert inst.text.status == "generated" def test_testplan_1(base_settings): """No. 1 tests collection for TestPlan. Test File: testplan-example.json """ filename = base_settings["unittest_data_dir"] / "testplan-example.json" inst = testplan.TestPlan.model_validate_json(filename.read_bytes()) assert "TestPlan" == inst.get_resource_type() impl_testplan_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "TestPlan" == data["resourceType"] inst2 = testplan.TestPlan(**data) impl_testplan_1(inst2) ================================================ FILE: fhir/resources/tests/test_testreport.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/TestReport Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import testreport from .conftest import ExternalValidatorModel def impl_testreport_1(inst): assert inst.id == "testreport-example" assert ( inst.identifier.system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier.value == "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9878" assert ( inst.issued == ExternalValidatorModel.model_validate( {"valueDateTime": "2016-10-07T08:25:34-05:00"} ).valueDateTime ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.name == "TestReport Example for TestScript Example" assert inst.participant[0].display == "Crucible" assert inst.participant[0].type == "test-engine" assert ( inst.participant[0].uri == ExternalValidatorModel.model_validate( {"valueUri": "http://projectcrucible.org"} ).valueUri ) assert inst.participant[1].display == "HealthIntersections STU3" assert inst.participant[1].type == "server" assert ( inst.participant[1].uri == ExternalValidatorModel.model_validate( {"valueUri": "http://fhir3.healthintersections.com.au/open"} ).valueUri ) assert inst.result == "pass" assert float(inst.score) == float(100.0) assert ( inst.setup.action[0].operation.detail == ExternalValidatorModel.model_validate( {"valueUri": "http://projectcrucible.org/permalink/1"} ).valueUri ) assert inst.setup.action[0].operation.message == "DELETE Patient" assert inst.setup.action[0].operation.result == "pass" assert ( inst.setup.action[1].assert_fhir.detail == "http://projectcrucible.org/permalink/1" ) assert inst.setup.action[1].assert_fhir.message == "HTTP 204" assert inst.setup.action[1].assert_fhir.result == "pass" assert ( inst.setup.action[2].operation.detail == ExternalValidatorModel.model_validate( {"valueUri": "http://projectcrucible.org/permalink/1"} ).valueUri ) assert ( inst.setup.action[2].operation.message == "POST Patient/fixture-patient-create" ) assert inst.setup.action[2].operation.result == "pass" assert ( inst.setup.action[3].assert_fhir.detail == "http://projectcrucible.org/permalink/1" ) assert inst.setup.action[3].assert_fhir.message == "HTTP 201" assert inst.setup.action[3].assert_fhir.result == "pass" assert inst.status == "completed" assert ( inst.teardown.action[0].operation.detail == ExternalValidatorModel.model_validate( {"valueUri": "http://projectcrucible.org/permalink/3"} ).valueUri ) assert ( inst.teardown.action[0].operation.message == "DELETE Patient/fixture-patient-create." ) assert inst.teardown.action[0].operation.result == "pass" assert inst.testScript == "http://example.com/TestScript/testscript-example" assert ( inst.test[0].action[0].operation.detail == ExternalValidatorModel.model_validate( {"valueUri": "http://projectcrucible.org/permalink/2"} ).valueUri ) assert ( inst.test[0].action[0].operation.message == "GET Patient/fixture-patient-create" ) assert inst.test[0].action[0].operation.result == "pass" assert ( inst.test[0].action[1].assert_fhir.detail == "http://projectcrucible.org/permalink/2" ) assert inst.test[0].action[1].assert_fhir.message == "HTTP 200" assert inst.test[0].action[1].assert_fhir.result == "pass" assert ( inst.test[0].action[2].assert_fhir.detail == "http://projectcrucible.org/permalink/2" ) assert inst.test[0].action[2].assert_fhir.message == "Last-Modified Present" assert inst.test[0].action[2].assert_fhir.result == "pass" assert ( inst.test[0].action[3].assert_fhir.detail == "http://projectcrucible.org/permalink/2" ) assert inst.test[0].action[3].assert_fhir.message == "Response is Patient" assert inst.test[0].action[3].assert_fhir.result == "pass" assert ( inst.test[0].action[4].assert_fhir.detail == "http://projectcrucible.org/permalink/2" ) assert inst.test[0].action[4].assert_fhir.message == "Response validates" assert inst.test[0].action[4].assert_fhir.result == "pass" assert ( inst.test[0].action[5].assert_fhir.detail == "http://projectcrucible.org/permalink/2" ) assert ( inst.test[0].action[5].assert_fhir.message == "Patient.name.family 'Chalmers'" ) assert inst.test[0].action[5].assert_fhir.result == "pass" assert ( inst.test[0].action[6].assert_fhir.detail == "http://projectcrucible.org/permalink/2" ) assert inst.test[0].action[6].assert_fhir.message == "Patient.name.given 'Peter'" assert inst.test[0].action[6].assert_fhir.result == "pass" assert ( inst.test[0].action[7].assert_fhir.detail == "http://projectcrucible.org/permalink/2" ) assert ( inst.test[0].action[7].assert_fhir.message == "Patient.name.family 'Chalmers'" ) assert inst.test[0].action[7].assert_fhir.result == "pass" assert ( inst.test[0].action[8].assert_fhir.detail == "http://projectcrucible.org/permalink/2" ) assert ( inst.test[0].action[8].assert_fhir.message == "Patient.name.family 'Chalmers'" ) assert inst.test[0].action[8].assert_fhir.result == "pass" assert ( inst.test[0].action[9].assert_fhir.detail == "http://projectcrucible.org/permalink/2" ) assert inst.test[0].action[9].assert_fhir.message == "Patient expected values." assert inst.test[0].action[9].assert_fhir.result == "pass" assert inst.test[0].description == "Read a Patient and validate response." assert inst.test[0].id == "01-ReadPatient" assert inst.test[0].name == "Read Patient" assert inst.tester == "HL7 Execution Engine" assert inst.text.status == "generated" def test_testreport_1(base_settings): """No. 1 tests collection for TestReport. Test File: testreport-example.json """ filename = base_settings["unittest_data_dir"] / "testreport-example.json" inst = testreport.TestReport.model_validate_json(filename.read_bytes()) assert "TestReport" == inst.get_resource_type() impl_testreport_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "TestReport" == data["resourceType"] inst2 = testreport.TestReport(**data) impl_testreport_1(inst2) ================================================ FILE: fhir/resources/tests/test_testscript.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/TestScript Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import testscript from .conftest import ExternalValidatorModel def impl_testscript_1(inst): assert inst.contact[0].name == "Support" assert inst.contact[0].telecom[0].system == "email" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "support@HL7.org" assert inst.copyright == "© HL7.org 2011+" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-18"} ).valueDateTime ) assert inst.destination[0].index == 1 assert inst.destination[0].profile.code == "FHIR-Server" assert ( inst.destination[0].url == ExternalValidatorModel.model_validate( {"valueUrl": "http://acme.com/fhir/test"} ).valueUrl ) assert inst.destination[1].index == 2 assert inst.destination[1].profile.code == "FHIR-Server" assert inst.experimental is True assert inst.id == "testscript-example-multisystem" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.12.6" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America (the)" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert ( inst.metadata.capability[0].capabilities == "http://hl7.org/fhir/CapabilityStatement/example" ) assert inst.metadata.capability[0].description == "Patient Read Operation" assert inst.metadata.capability[0].destination == 1 assert ( inst.metadata.capability[0].link[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/http.html#read"} ).valueUri ) assert inst.metadata.capability[0].origin[0] == 1 assert inst.metadata.capability[0].required is True assert inst.metadata.capability[0].validated is False assert ( inst.metadata.capability[1].capabilities == "http://hl7.org/fhir/CapabilityStatement/example" ) assert inst.metadata.capability[1].description == "Patient Read Operation" assert inst.metadata.capability[1].destination == 2 assert ( inst.metadata.capability[1].link[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/http.html#read"} ).valueUri ) assert inst.metadata.capability[1].origin[0] == 1 assert inst.metadata.capability[1].required is True assert inst.metadata.capability[1].validated is False assert inst.metadata.link[0].description == ( "Demographics and other administrative information about an " "individual or animal receiving care or other health-related " "services." ) assert ( inst.metadata.link[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/patient.html"} ).valueUri ) assert inst.name == "Testscriptexamplemultisystem" assert inst.origin[0].index == 1 assert inst.origin[0].profile.code == "FHIR-Client" assert inst.publisher == "HL7" assert inst.purpose == "Patient Read Operation" assert inst.status == "draft" assert inst.test[0].action[0].operation.accept == "xml" assert inst.test[0].action[0].operation.contentType == "xml" assert inst.test[0].action[0].operation.description == ( "Read a Patient from the first destination test system and " "perform basic validation." ) assert inst.test[0].action[0].operation.destination == 1 assert inst.test[0].action[0].operation.encodeRequestUrl is True assert inst.test[0].action[0].operation.origin == 1 assert inst.test[0].action[0].operation.params == "/${Dest1PatientResourceId}" assert inst.test[0].action[0].operation.requestId == "request-read-patient-01" assert ( inst.test[0].action[0].operation.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.test[0].action[0].operation.type.code == "read" assert ( inst.test[0].action[0].operation.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert inst.test[0].action[1].assert_fhir.description == ( "Confirm that the request method GET was sent by the client " "system under test." ) assert inst.test[0].action[1].assert_fhir.requestMethod == "get" assert inst.test[0].action[1].assert_fhir.stopTestOnFail is False assert inst.test[0].action[1].assert_fhir.warningOnly is False assert ( inst.test[0].action[2].assert_fhir.description == "Confirm that the client requested an Accept of xml." ) assert inst.test[0].action[2].assert_fhir.direction == "request" assert inst.test[0].action[2].assert_fhir.headerField == "Accept" assert inst.test[0].action[2].assert_fhir.operator == "contains" assert inst.test[0].action[2].assert_fhir.stopTestOnFail is False assert inst.test[0].action[2].assert_fhir.value == "xml" assert inst.test[0].action[2].assert_fhir.warningOnly is False assert ( inst.test[0].action[3].assert_fhir.description == "Confirm that the returned HTTP status is 200(OK)." ) assert inst.test[0].action[3].assert_fhir.direction == "response" assert inst.test[0].action[3].assert_fhir.response == "okay" assert inst.test[0].action[3].assert_fhir.stopTestOnFail is False assert inst.test[0].action[3].assert_fhir.warningOnly is False assert inst.test[0].action[4].assert_fhir.contentType == "xml" assert ( inst.test[0].action[4].assert_fhir.description == "Confirm that the returned format is XML." ) assert inst.test[0].action[4].assert_fhir.direction == "response" assert inst.test[0].action[4].assert_fhir.stopTestOnFail is False assert inst.test[0].action[4].assert_fhir.warningOnly is False assert ( inst.test[0].action[5].assert_fhir.description == "Confirm that the returned resource type is Patient." ) assert inst.test[0].action[5].assert_fhir.direction == "response" assert ( inst.test[0].action[5].assert_fhir.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.test[0].action[5].assert_fhir.stopTestOnFail is False assert inst.test[0].action[5].assert_fhir.warningOnly is False assert inst.test[0].description == ( "Read a Patient from the first destination test system using " "the user defined dynamic variable ${Dest1PatientResourceId}." " Perform basic validation." ) assert inst.test[0].id == "01-ReadPatient-Destination1" assert inst.test[0].name == "ReadPatient-Destination1" assert inst.test[1].action[0].operation.accept == "xml" assert inst.test[1].action[0].operation.contentType == "xml" assert inst.test[1].action[0].operation.description == ( "Read a Patient from the second destination test system and " "perform basic validation." ) assert inst.test[1].action[0].operation.destination == 2 assert inst.test[1].action[0].operation.encodeRequestUrl is True assert inst.test[1].action[0].operation.origin == 1 assert inst.test[1].action[0].operation.params == "/${Dest2PatientResourceId}" assert inst.test[1].action[0].operation.requestHeader[0].field == "Accept-Charset" assert inst.test[1].action[0].operation.requestHeader[0].value == "utf-8" assert ( inst.test[1].action[0].operation.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.test[1].action[0].operation.type.code == "read" assert ( inst.test[1].action[0].operation.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert ( inst.test[1].action[1].assert_fhir.description == "Confirm that the client requested an Accept of xml." ) assert inst.test[1].action[1].assert_fhir.direction == "request" assert inst.test[1].action[1].assert_fhir.headerField == "Accept" assert inst.test[1].action[1].assert_fhir.operator == "contains" assert inst.test[1].action[1].assert_fhir.stopTestOnFail is False assert inst.test[1].action[1].assert_fhir.value == "xml" assert inst.test[1].action[1].assert_fhir.warningOnly is False assert ( inst.test[1].action[2].assert_fhir.description == "Confirm that the returned HTTP status is 200(OK)." ) assert inst.test[1].action[2].assert_fhir.direction == "response" assert inst.test[1].action[2].assert_fhir.response == "okay" assert inst.test[1].action[2].assert_fhir.stopTestOnFail is False assert inst.test[1].action[2].assert_fhir.warningOnly is False assert inst.test[1].action[3].assert_fhir.contentType == "xml" assert ( inst.test[1].action[3].assert_fhir.description == "Confirm that the returned format is XML." ) assert inst.test[1].action[3].assert_fhir.direction == "response" assert inst.test[1].action[3].assert_fhir.stopTestOnFail is False assert inst.test[1].action[3].assert_fhir.warningOnly is False assert ( inst.test[1].action[4].assert_fhir.description == "Confirm that the returned resource type is Patient." ) assert inst.test[1].action[4].assert_fhir.direction == "response" assert ( inst.test[1].action[4].assert_fhir.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.test[1].action[4].assert_fhir.stopTestOnFail is False assert inst.test[1].action[4].assert_fhir.warningOnly is False assert inst.test[1].description == ( "Read a Patient from the second destination test system using" " the user defined dynamic variable " "${Dest2PatientResourceId}. Perform basic validation." ) assert inst.test[1].id == "02-ReadPatient-Destination2" assert inst.test[1].name == "ReadPatient-Destination2" assert inst.text.status == "generated" assert inst.title == "Multisystem Test Script" assert ( inst.url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/TestScript/testscript-example-multisystem" } ).valueUri ) assert inst.variable[0].defaultValue == "example" assert inst.variable[0].name == "Dest1PatientResourceId" assert inst.variable[1].defaultValue == "example" assert inst.variable[1].name == "Dest2PatientResourceId" assert inst.version == "1.0" def test_testscript_1(base_settings): """No. 1 tests collection for TestScript. Test File: testscript-example-multisystem.json """ filename = ( base_settings["unittest_data_dir"] / "testscript-example-multisystem.json" ) inst = testscript.TestScript.model_validate_json(filename.read_bytes()) assert "TestScript" == inst.get_resource_type() impl_testscript_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "TestScript" == data["resourceType"] inst2 = testscript.TestScript(**data) impl_testscript_1(inst2) def impl_testscript_2(inst): assert inst.contact[0].name == "Support" assert inst.contact[0].telecom[0].system == "email" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "support@HL7.org" assert inst.copyright == "© HL7.org 2011+" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-18"} ).valueDateTime ) assert inst.experimental is True assert inst.fixture[0].autocreate is False assert inst.fixture[0].autodelete is False assert inst.fixture[0].id == "fixture-patient-create" assert inst.fixture[0].resource.display == "Peter Chalmers" assert inst.fixture[0].resource.reference == "Patient/example" assert inst.fixture[1].autocreate is False assert inst.fixture[1].autodelete is False assert inst.fixture[1].id == "fixture-patient-update" assert inst.fixture[1].resource.display == "Donald Duck" assert inst.fixture[1].resource.reference == "Patient/pat1" assert inst.id == "testscript-example-history" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.12.1" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America (the)" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert ( inst.metadata.capability[0].capabilities == "http://hl7.org/fhir/CapabilityStatement/example" ) assert ( inst.metadata.capability[0].description == "Patient Update, Delete and History (Instance) Operations" ) assert ( inst.metadata.capability[0].link[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/http.html#update"} ).valueUri ) assert ( inst.metadata.capability[0].link[1] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/http.html#delete"} ).valueUri ) assert ( inst.metadata.capability[0].link[2] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/http.html#history"} ).valueUri ) assert inst.metadata.capability[0].required is True assert inst.metadata.capability[0].validated is False assert inst.metadata.link[0].description == ( "Demographics and other administrative information about an " "individual or animal receiving care or other health-related " "services." ) assert ( inst.metadata.link[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/patient.html"} ).valueUri ) assert inst.name == "TestScriptExampleHistory" assert inst.profile[0] == "http://hl7.org/fhir/StructureDefinition/Bundle" assert inst.publisher == "HL7" assert inst.purpose == ( "Patient (Conditional) Create, Update, Delete and History " "(Instance) Operations" ) assert inst.setup.action[0].operation.accept == "json" assert inst.setup.action[0].operation.description == ( "Execute a delete operation to insure the patient does not " "exist on the server." ) assert inst.setup.action[0].operation.encodeRequestUrl is True assert inst.setup.action[0].operation.label == "SetupDeletePatient" assert inst.setup.action[0].operation.params == "/${createResourceId}" assert ( inst.setup.action[0].operation.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.setup.action[0].operation.type.code == "delete" assert ( inst.setup.action[0].operation.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert inst.setup.action[1].assert_fhir.description == ( "Confirm that the returned HTTP status is 200(OK) or 204(No " "Content)." ) assert inst.setup.action[1].assert_fhir.direction == "response" assert inst.setup.action[1].assert_fhir.operator == "in" assert inst.setup.action[1].assert_fhir.responseCode == "200,204" assert inst.setup.action[1].assert_fhir.stopTestOnFail is False assert inst.setup.action[1].assert_fhir.warningOnly is False assert inst.setup.action[2].operation.accept == "json" assert inst.setup.action[2].operation.contentType == "json" assert inst.setup.action[2].operation.description == ( "Create patient resource on test server using the contents of" " fixture-patient-create" ) assert inst.setup.action[2].operation.encodeRequestUrl is True assert inst.setup.action[2].operation.label == "SetupCreatePatient" assert inst.setup.action[2].operation.params == "/${createResourceId}" assert ( inst.setup.action[2].operation.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.setup.action[2].operation.sourceId == "fixture-patient-create" assert inst.setup.action[2].operation.type.code == "update" assert ( inst.setup.action[2].operation.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert ( inst.setup.action[3].assert_fhir.description == "Confirm that the returned HTTP status is 201(Created)." ) assert inst.setup.action[3].assert_fhir.direction == "response" assert inst.setup.action[3].assert_fhir.responseCode == "201" assert inst.setup.action[3].assert_fhir.stopTestOnFail is False assert inst.setup.action[3].assert_fhir.warningOnly is False assert inst.setup.action[4].operation.accept == "json" assert inst.setup.action[4].operation.contentType == "json" assert inst.setup.action[4].operation.description == ( "Update patient resource on test server using the contents of" " fixture-patient-update" ) assert inst.setup.action[4].operation.encodeRequestUrl is True assert inst.setup.action[4].operation.label == "SetupUpdatePatient" assert inst.setup.action[4].operation.params == "/${createResourceId}" assert ( inst.setup.action[4].operation.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.setup.action[4].operation.sourceId == "fixture-patient-update" assert inst.setup.action[4].operation.type.code == "update" assert ( inst.setup.action[4].operation.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert ( inst.setup.action[5].assert_fhir.description == "Confirm that the returned HTTP status is 200(OK)." ) assert inst.setup.action[5].assert_fhir.direction == "response" assert inst.setup.action[5].assert_fhir.responseCode == "200" assert inst.setup.action[5].assert_fhir.stopTestOnFail is False assert inst.setup.action[5].assert_fhir.warningOnly is False assert inst.status == "draft" assert inst.test[0].action[0].operation.accept == "json" assert inst.test[0].action[0].operation.contentType == "json" assert inst.test[0].action[0].operation.description == ( "Get the Patient history on the test server using the id from" " fixture-patient-create." ) assert inst.test[0].action[0].operation.encodeRequestUrl is True assert ( inst.test[0].action[0].operation.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.test[0].action[0].operation.targetId == "fixture-patient-create" assert inst.test[0].action[0].operation.type.code == "history" assert ( inst.test[0].action[0].operation.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert ( inst.test[0].action[1].assert_fhir.description == "Confirm that the returned HTTP status is 200(OK)." ) assert inst.test[0].action[1].assert_fhir.direction == "response" assert inst.test[0].action[1].assert_fhir.response == "okay" assert inst.test[0].action[1].assert_fhir.stopTestOnFail is False assert inst.test[0].action[1].assert_fhir.warningOnly is False assert ( inst.test[0].action[2].assert_fhir.description == "Confirm that the returned resource type is Bundle." ) assert ( inst.test[0].action[2].assert_fhir.resource == ExternalValidatorModel.model_validate({"valueUri": "Bundle"}).valueUri ) assert inst.test[0].action[2].assert_fhir.stopTestOnFail is False assert inst.test[0].action[2].assert_fhir.warningOnly is False assert inst.test[0].action[3].assert_fhir.description == ( "Confirm that the returned Bundle conforms to the base FHIR " "specification." ) assert inst.test[0].action[3].assert_fhir.stopTestOnFail is False assert inst.test[0].action[3].assert_fhir.validateProfileId == "bundle-profile" assert inst.test[0].action[3].assert_fhir.warningOnly is False assert ( inst.test[0].action[4].assert_fhir.description == "Confirm that the returned Bundle type equals 'history'." ) assert inst.test[0].action[4].assert_fhir.operator == "equals" assert inst.test[0].action[4].assert_fhir.path == "fhir:Bundle/fhir:type/@value" assert inst.test[0].action[4].assert_fhir.stopTestOnFail is False assert inst.test[0].action[4].assert_fhir.value == "history" assert inst.test[0].action[4].assert_fhir.warningOnly is False assert ( inst.test[0].description == "Get the history for a known Patient and validate response." ) assert inst.test[0].id == "01-HistoryPatient" assert inst.test[0].name == "History Patient" assert inst.text.status == "generated" assert inst.title == "TestScript Example History" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/TestScript/testscript-example-history"} ).valueUri ) assert inst.variable[0].name == "createResourceId" assert inst.variable[0].path == "Patient/id" assert inst.variable[0].sourceId == "fixture-patient-create" assert inst.version == "1.0" def test_testscript_2(base_settings): """No. 2 tests collection for TestScript. Test File: testscript-example-history.json """ filename = base_settings["unittest_data_dir"] / "testscript-example-history.json" inst = testscript.TestScript.model_validate_json(filename.read_bytes()) assert "TestScript" == inst.get_resource_type() impl_testscript_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "TestScript" == data["resourceType"] inst2 = testscript.TestScript(**data) impl_testscript_2(inst2) def impl_testscript_3(inst): assert inst.contact[0].name == "Support" assert inst.contact[0].telecom[0].system == "email" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "support@HL7.org" assert inst.copyright == "© HL7.org 2011+" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-18"} ).valueDateTime ) assert inst.description == ( "TestScript example resource with setup to delete if present " "and create a new instance of a Patient; and single test " "definition to update that Patient with various asserts." ) assert inst.experimental is True assert inst.fixture[0].autocreate is False assert inst.fixture[0].autodelete is False assert inst.fixture[0].id == "fixture-patient-create" assert inst.fixture[0].resource.display == "Peter Chalmers" assert inst.fixture[0].resource.reference == "Patient/example" assert inst.fixture[1].autocreate is False assert inst.fixture[1].autodelete is False assert inst.fixture[1].id == "fixture-patient-update" assert inst.fixture[1].resource.display == "Donald Duck" assert inst.fixture[1].resource.reference == "Patient/pat1" assert inst.id == "testscript-example-update" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.12.5" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America (the)" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert ( inst.metadata.capability[0].capabilities == "http://hl7.org/fhir/CapabilityStatement/example" ) assert ( inst.metadata.capability[0].description == "Patient Update and Delete Operations" ) assert ( inst.metadata.capability[0].link[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/http.html#update"} ).valueUri ) assert ( inst.metadata.capability[0].link[1] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/http.html#delete"} ).valueUri ) assert inst.metadata.capability[0].required is True assert inst.metadata.capability[0].validated is False assert inst.metadata.link[0].description == ( "Demographics and other administrative information about an " "individual or animal receiving care or other health-related " "services." ) assert ( inst.metadata.link[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/patient.html"} ).valueUri ) assert inst.name == "TestScriptExampleUpdate" assert inst.profile[0] == "http://hl7.org/fhir/StructureDefinition/Patient" assert inst.publisher == "HL7" assert inst.purpose == "Patient (Conditional) Create, Update, Delete Operations" assert inst.setup.action[0].operation.accept == "xml" assert inst.setup.action[0].operation.description == ( "Execute a delete operation to insure the patient does not " "exist on the server." ) assert inst.setup.action[0].operation.encodeRequestUrl is True assert inst.setup.action[0].operation.label == "SetupDeletePatient" assert inst.setup.action[0].operation.params == "/${createResourceId}" assert ( inst.setup.action[0].operation.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.setup.action[0].operation.type.code == "delete" assert ( inst.setup.action[0].operation.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert inst.setup.action[1].assert_fhir.description == ( "Confirm that the returned HTTP status is 200(OK) or 204(No " "Content)." ) assert inst.setup.action[1].assert_fhir.direction == "response" assert inst.setup.action[1].assert_fhir.operator == "in" assert inst.setup.action[1].assert_fhir.responseCode == "200,204" assert inst.setup.action[1].assert_fhir.stopTestOnFail is False assert inst.setup.action[1].assert_fhir.warningOnly is False assert inst.setup.action[2].operation.accept == "xml" assert inst.setup.action[2].operation.contentType == "xml" assert inst.setup.action[2].operation.description == ( "Create patient resource on test server using the contents of" " fixture-patient-create" ) assert inst.setup.action[2].operation.encodeRequestUrl is True assert inst.setup.action[2].operation.label == "SetupCreatePatient" assert inst.setup.action[2].operation.params == "/${createResourceId}" assert ( inst.setup.action[2].operation.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.setup.action[2].operation.sourceId == "fixture-patient-create" assert inst.setup.action[2].operation.type.code == "update" assert ( inst.setup.action[2].operation.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert ( inst.setup.action[3].assert_fhir.description == "Confirm that the returned HTTP status is 201(Created)." ) assert inst.setup.action[3].assert_fhir.direction == "response" assert inst.setup.action[3].assert_fhir.responseCode == "201" assert inst.setup.action[3].assert_fhir.stopTestOnFail is False assert inst.setup.action[3].assert_fhir.warningOnly is False assert inst.status == "draft" assert inst.test[0].action[0].operation.accept == "xml" assert inst.test[0].action[0].operation.contentType == "xml" assert inst.test[0].action[0].operation.description == ( "Update patient resource on test server using the contents of" " fixture-patient-update" ) assert inst.test[0].action[0].operation.encodeRequestUrl is True assert inst.test[0].action[0].operation.label == "SetupUpdatePatient" assert inst.test[0].action[0].operation.params == "/${createResourceId}" assert ( inst.test[0].action[0].operation.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.test[0].action[0].operation.sourceId == "fixture-patient-update" assert inst.test[0].action[0].operation.type.code == "update" assert ( inst.test[0].action[0].operation.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert ( inst.test[0].action[1].assert_fhir.description == "Confirm that the returned HTTP status is 200(OK)." ) assert inst.test[0].action[1].assert_fhir.response == "okay" assert inst.test[0].action[1].assert_fhir.stopTestOnFail is False assert inst.test[0].action[1].assert_fhir.warningOnly is False assert inst.test[0].action[2].assert_fhir.contentType == "xml" assert ( inst.test[0].action[2].assert_fhir.description == "Confirm that the returned format is XML." ) assert inst.test[0].action[2].assert_fhir.stopTestOnFail is False assert inst.test[0].action[2].assert_fhir.warningOnly is False assert inst.test[0].action[3].assert_fhir.description == ( "Confirm that the returned HTTP Header Last-Modified is " "present. Warning only as the server might not support " "versioning." ) assert inst.test[0].action[3].assert_fhir.headerField == "Last-Modified" assert inst.test[0].action[3].assert_fhir.operator == "notEmpty" assert inst.test[0].action[3].assert_fhir.stopTestOnFail is False assert inst.test[0].action[3].assert_fhir.warningOnly is True assert inst.test[0].description == "Update a Patient and validate response." assert inst.test[0].id == "01-UpdatePatient" assert inst.test[0].name == "Update Patient" assert inst.text.status == "generated" assert inst.title == "TestScript Example Update" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/TestScript/testscript-example-update"} ).valueUri ) assert inst.variable[0].name == "createResourceId" assert inst.variable[0].path == "Patient/id" assert inst.variable[0].sourceId == "fixture-patient-create" assert inst.version == "1.0" def test_testscript_3(base_settings): """No. 3 tests collection for TestScript. Test File: testscript-example-update.json """ filename = base_settings["unittest_data_dir"] / "testscript-example-update.json" inst = testscript.TestScript.model_validate_json(filename.read_bytes()) assert "TestScript" == inst.get_resource_type() impl_testscript_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "TestScript" == data["resourceType"] inst2 = testscript.TestScript(**data) impl_testscript_3(inst2) def impl_testscript_4(inst): assert inst.contact[0].name == "Support" assert inst.contact[0].telecom[0].system == "email" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "support@HL7.org" assert inst.copyright == "© HL7.org 2011+" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-18"} ).valueDateTime ) assert inst.description == ( "TestScript example resource with simple Patient search test." " The read tests will utilize user defined dynamic variables " "that will hold the Patient search parameter values." ) assert inst.experimental is True assert inst.fixture[0].autocreate is False assert inst.fixture[0].autodelete is False assert inst.fixture[0].id == "fixture-patient-create" assert inst.fixture[0].resource.display == "Peter Chalmers" assert inst.fixture[0].resource.reference == "Patient/example" assert inst.id == "testscript-example-search" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.12.3" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America (the)" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert ( inst.metadata.capability[0].capabilities == "http://hl7.org/fhir/CapabilityStatement/example" ) assert inst.metadata.capability[0].description == "Patient Search Operation" assert ( inst.metadata.capability[0].link[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/http.html#search"} ).valueUri ) assert inst.metadata.capability[0].required is True assert inst.metadata.capability[0].validated is False assert inst.metadata.link[0].description == ( "Demographics and other administrative information about an " "individual or animal receiving care or other health-related " "services." ) assert ( inst.metadata.link[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/patient.html"} ).valueUri ) assert inst.name == "TestScriptExampleSearch" assert inst.profile[0] == "http://hl7.org/fhir/StructureDefinition/Bundle" assert inst.publisher == "HL7" assert inst.purpose == "Patient Search Operation" assert inst.setup.action[0].operation.accept == "xml" assert ( inst.setup.action[0].operation.description == "Test simple search to verify server support." ) assert inst.setup.action[0].operation.encodeRequestUrl is True assert ( inst.setup.action[0].operation.params == "?family=DONTEXPECTAMATCH&given=DONTEXPECTAMATCH" ) assert ( inst.setup.action[0].operation.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.setup.action[0].operation.type.code == "search" assert ( inst.setup.action[0].operation.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert inst.setup.action[1].assert_fhir.description == ( "Confirm that the request url contains the family search " "parameter." ) assert inst.setup.action[1].assert_fhir.direction == "request" assert inst.setup.action[1].assert_fhir.operator == "contains" assert inst.setup.action[1].assert_fhir.requestURL == "family" assert inst.setup.action[1].assert_fhir.stopTestOnFail is False assert inst.setup.action[1].assert_fhir.warningOnly is False assert ( inst.setup.action[2].assert_fhir.description == "Confirm that the returned HTTP status is 200(OK)." ) assert inst.setup.action[2].assert_fhir.direction == "response" assert inst.setup.action[2].assert_fhir.responseCode == "200" assert inst.setup.action[2].assert_fhir.stopTestOnFail is False assert inst.setup.action[2].assert_fhir.warningOnly is False assert ( inst.setup.action[3].assert_fhir.description == "Confirm that the returned resource type is Bundle." ) assert ( inst.setup.action[3].assert_fhir.resource == ExternalValidatorModel.model_validate({"valueUri": "Bundle"}).valueUri ) assert inst.setup.action[3].assert_fhir.stopTestOnFail is False assert inst.setup.action[3].assert_fhir.warningOnly is False assert inst.setup.action[4].assert_fhir.description == ( "Confirm that the returned Bundle correctly defines the " "navigation links." ) assert inst.setup.action[4].assert_fhir.navigationLinks is True assert inst.setup.action[4].assert_fhir.stopTestOnFail is False assert inst.setup.action[4].assert_fhir.warningOnly is False assert inst.status == "draft" assert inst.test[0].action[0].operation.accept == "xml" assert inst.test[0].action[0].operation.contentType == "xml" assert inst.test[0].action[0].operation.description == ( "Create a Patient resource and capture the returned HTTP " "Header Location." ) assert inst.test[0].action[0].operation.encodeRequestUrl is True assert ( inst.test[0].action[0].operation.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.test[0].action[0].operation.responseId == "PatientCreateResponse" assert inst.test[0].action[0].operation.sourceId == "fixture-patient-create" assert inst.test[0].action[0].operation.type.code == "create" assert ( inst.test[0].action[0].operation.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert ( inst.test[0].action[1].assert_fhir.description == "Confirm that the returned HTTP status is 201(Created)." ) assert inst.test[0].action[1].assert_fhir.response == "created" assert inst.test[0].action[1].assert_fhir.stopTestOnFail is False assert inst.test[0].action[1].assert_fhir.warningOnly is False assert ( inst.test[0].action[2].assert_fhir.description == "Confirm that the returned HTTP Header Location is present." ) assert inst.test[0].action[2].assert_fhir.direction == "response" assert inst.test[0].action[2].assert_fhir.headerField == "Location" assert inst.test[0].action[2].assert_fhir.operator == "notEmpty" assert inst.test[0].action[2].assert_fhir.stopTestOnFail is False assert inst.test[0].action[2].assert_fhir.warningOnly is False assert inst.test[0].action[3].operation.accept == "xml" assert inst.test[0].action[3].operation.description == ( "Read the created Patient using the captured Location URL " "value." ) assert inst.test[0].action[3].operation.encodeRequestUrl is True assert inst.test[0].action[3].operation.type.code == "read" assert ( inst.test[0].action[3].operation.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert inst.test[0].action[3].operation.url == "${PatientCreateLocation}" assert ( inst.test[0].action[4].assert_fhir.description == "Confirm that the returned HTTP status is 200(OK)." ) assert inst.test[0].action[4].assert_fhir.response == "okay" assert inst.test[0].action[4].assert_fhir.stopTestOnFail is False assert inst.test[0].action[4].assert_fhir.warningOnly is False assert ( inst.test[0].action[5].assert_fhir.description == "Confirm that the returned resource type is Patient." ) assert ( inst.test[0].action[5].assert_fhir.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.test[0].action[5].assert_fhir.stopTestOnFail is False assert inst.test[0].action[5].assert_fhir.warningOnly is False assert inst.test[0].description == ( "Create a Patient resource and capture the returned HTTP " "Header Location. Then search for (read) that Patient using " "the Location URL value and validate the response." ) assert inst.test[0].id == "01-PatientCreateSearch" assert inst.test[0].name == "Patient Create Search" assert inst.test[1].action[0].operation.accept == "xml" assert ( inst.test[1].action[0].operation.description == "Search for Patient resources on the destination test system." ) assert inst.test[1].action[0].operation.encodeRequestUrl is True assert inst.test[1].action[0].operation.params == ( "?family=${PatientSearchFamilyName}&given=${PatientSearchGive" "nName}" ) assert ( inst.test[1].action[0].operation.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.test[1].action[0].operation.type.code == "search" assert ( inst.test[1].action[0].operation.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert ( inst.test[1].action[1].assert_fhir.description == "Confirm that the returned HTTP status is 200(OK)." ) assert inst.test[1].action[1].assert_fhir.response == "okay" assert inst.test[1].action[1].assert_fhir.stopTestOnFail is False assert inst.test[1].action[1].assert_fhir.warningOnly is False assert inst.test[1].action[2].assert_fhir.contentType == "xml" assert ( inst.test[1].action[2].assert_fhir.description == "Confirm that the returned format is XML." ) assert inst.test[1].action[2].assert_fhir.stopTestOnFail is False assert inst.test[1].action[2].assert_fhir.warningOnly is False assert ( inst.test[1].action[3].assert_fhir.description == "Confirm that the returned resource type is Bundle." ) assert ( inst.test[1].action[3].assert_fhir.resource == ExternalValidatorModel.model_validate({"valueUri": "Bundle"}).valueUri ) assert inst.test[1].action[3].assert_fhir.stopTestOnFail is True assert inst.test[1].action[3].assert_fhir.warningOnly is False assert inst.test[1].action[4].assert_fhir.description == ( "Confirm that the returned Bundle conforms to the base FHIR " "specification." ) assert inst.test[1].action[4].assert_fhir.stopTestOnFail is False assert inst.test[1].action[4].assert_fhir.validateProfileId == "bundle-profile" assert inst.test[1].action[4].assert_fhir.warningOnly is False assert ( inst.test[1].action[5].assert_fhir.description == "Confirm that the returned Bundle type equals 'searchset'." ) assert inst.test[1].action[5].assert_fhir.operator == "equals" assert inst.test[1].action[5].assert_fhir.path == "fhir:Bundle/fhir:type/@value" assert inst.test[1].action[5].assert_fhir.stopTestOnFail is False assert inst.test[1].action[5].assert_fhir.value == "searchset" assert inst.test[1].action[5].assert_fhir.warningOnly is False assert inst.test[1].action[6].assert_fhir.description == ( "Confirm that the returned Bundle total is greater than or " "equal to the number of returned entries." ) assert ( inst.test[1].action[6].assert_fhir.expression == "Bundle.total.toInteger() >= entry.count()" ) assert inst.test[1].action[6].assert_fhir.stopTestOnFail is False assert inst.test[1].action[6].assert_fhir.warningOnly is False assert inst.test[1].description == ( "Search for Patient resources using the user defined dynamic " "variables ${PatientSearchFamilyName} and " "${PatientSearchGivenName} and validate response." ) assert inst.test[1].id == "02-PatientSearchDynamic" assert inst.test[1].name == "Patient Search Dynamic" assert inst.text.status == "generated" assert inst.title == "TestScript Example Search" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/TestScript/testscript-example-search"} ).valueUri ) assert inst.variable[0].headerField == "Location" assert inst.variable[0].name == "PatientCreateLocation" assert inst.variable[0].sourceId == "PatientCreateResponse" assert inst.variable[1].description == ( "Enter patient search criteria for a known family name on the" " target system" ) assert inst.variable[1].hint == "[Family name]" assert inst.variable[1].name == "PatientSearchFamilyName" assert inst.variable[2].description == ( "Enter patient search criteria for a known given name on the " "target system" ) assert inst.variable[2].hint == "[Given name]" assert inst.variable[2].name == "PatientSearchGivenName" assert ( inst.variable[3].description == "Evaluate the returned Patient searchset Bundle.total value" ) assert inst.variable[3].expression == "Bundle.total.toInteger()" assert inst.variable[3].name == "PatientSearchBundleTotal" assert inst.version == "1.0" def test_testscript_4(base_settings): """No. 4 tests collection for TestScript. Test File: testscript-example-search.json """ filename = base_settings["unittest_data_dir"] / "testscript-example-search.json" inst = testscript.TestScript.model_validate_json(filename.read_bytes()) assert "TestScript" == inst.get_resource_type() impl_testscript_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "TestScript" == data["resourceType"] inst2 = testscript.TestScript(**data) impl_testscript_4(inst2) def impl_testscript_5(inst): assert inst.contact[0].name == "Support" assert inst.contact[0].telecom[0].system == "email" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "support@HL7.org" assert inst.copyright == "© HL7.org 2011+" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-18"} ).valueDateTime ) assert inst.description == ( "TestScript example resource with setup to delete if present " "and create a new instance of a Patient; and single test " "definition to read the created Patient with various asserts." ) assert inst.experimental is True assert inst.fixture[0].autocreate is False assert inst.fixture[0].autodelete is False assert inst.fixture[0].id == "fixture-patient-create" assert inst.fixture[0].resource.display == "Peter Chalmers" assert inst.fixture[0].resource.reference == "Patient/example" assert inst.fixture[1].autocreate is False assert inst.fixture[1].autodelete is False assert inst.fixture[1].id == "fixture-patient-minimum" assert inst.fixture[1].resource.display == "Peter Chalmers (minimum)" assert inst.fixture[1].resource.reference == "Patient/example" assert inst.id == "testscript-example" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.12.4" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America (the)" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert ( inst.metadata.capability[0].capabilities == "http://hl7.org/fhir/CapabilityStatement/example" ) assert ( inst.metadata.capability[0].description == "Patient Update, Read and Delete Operations" ) assert ( inst.metadata.capability[0].link[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/http.html#delete"} ).valueUri ) assert ( inst.metadata.capability[0].link[1] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/http.html#read"} ).valueUri ) assert ( inst.metadata.capability[0].link[2] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/http.html#update"} ).valueUri ) assert inst.metadata.capability[0].required is True assert inst.metadata.capability[0].validated is False assert inst.metadata.link[0].description == ( "Demographics and other administrative information about an " "individual or animal receiving care or other health-related " "services." ) assert ( inst.metadata.link[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/patient.html"} ).valueUri ) assert inst.name == "TestScriptExample" assert inst.profile[0] == "http://hl7.org/fhir/StructureDefinition/Patient" assert inst.publisher == "HL7" assert inst.purpose == ( "Patient Conditional Create (Update), Read and Delete " "Operations" ) assert inst.setup.action[0].operation.accept == "json" assert inst.setup.action[0].operation.description == ( "Execute a delete operation to insure the patient does not " "exist on the server." ) assert inst.setup.action[0].operation.encodeRequestUrl is True assert inst.setup.action[0].operation.label == "SetupDeletePatient" assert inst.setup.action[0].operation.params == "/${createResourceId}" assert ( inst.setup.action[0].operation.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.setup.action[0].operation.type.code == "delete" assert ( inst.setup.action[0].operation.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert inst.setup.action[1].assert_fhir.description == ( "Confirm that the returned HTTP status is 200(OK) or 204(No " "Content)." ) assert inst.setup.action[1].assert_fhir.direction == "response" assert inst.setup.action[1].assert_fhir.operator == "in" assert inst.setup.action[1].assert_fhir.responseCode == "200,204" assert inst.setup.action[1].assert_fhir.stopTestOnFail is False assert inst.setup.action[1].assert_fhir.warningOnly is False assert inst.setup.action[2].operation.accept == "json" assert inst.setup.action[2].operation.contentType == "json" assert inst.setup.action[2].operation.description == ( "Create patient resource on test server using the contents of" " fixture-patient-create" ) assert inst.setup.action[2].operation.encodeRequestUrl is True assert inst.setup.action[2].operation.label == "SetupCreatePatient" assert inst.setup.action[2].operation.params == "/${createResourceId}" assert ( inst.setup.action[2].operation.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.setup.action[2].operation.sourceId == "fixture-patient-create" assert inst.setup.action[2].operation.type.code == "update" assert ( inst.setup.action[2].operation.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert ( inst.setup.action[3].assert_fhir.description == "Confirm that the returned HTTP status is 201(Created)." ) assert inst.setup.action[3].assert_fhir.direction == "response" assert inst.setup.action[3].assert_fhir.responseCode == "201" assert inst.setup.action[3].assert_fhir.stopTestOnFail is False assert inst.setup.action[3].assert_fhir.warningOnly is False assert inst.setup.action[4].operation.description == ( "Read the created patient resource on the test server using " "the id from fixture-patient-create. Verify contents." ) assert inst.setup.action[4].operation.encodeRequestUrl is True assert ( inst.setup.action[4].operation.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.setup.action[4].operation.targetId == "fixture-patient-create" assert inst.setup.action[4].operation.type.code == "read" assert ( inst.setup.action[4].operation.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert ( inst.setup.action[5].assert_fhir.description == "Confirm that the returned HTTP status is 200(OK)." ) assert inst.setup.action[5].assert_fhir.direction == "response" assert inst.setup.action[5].assert_fhir.response == "okay" assert inst.setup.action[5].assert_fhir.stopTestOnFail is False assert inst.setup.action[5].assert_fhir.warningOnly is False assert ( inst.setup.action[6].assert_fhir.compareToSourceExpression == "Patient.name.first().family" ) assert ( inst.setup.action[6].assert_fhir.compareToSourceId == "fixture-patient-create" ) assert inst.setup.action[6].assert_fhir.description == ( "Confirm that the returned Patient contains the expected " "family name 'Chalmers'. Uses explicit compareToSourceId " "reference to fixture-patient-create used to create the " "Patient." ) assert inst.setup.action[6].assert_fhir.operator == "equals" assert inst.setup.action[6].assert_fhir.stopTestOnFail is False assert inst.setup.action[6].assert_fhir.warningOnly is False assert inst.status == "draft" assert inst.teardown.action[0].operation.description == ( "Delete the patient resource on the test server using the id " "from fixture-patient-create." ) assert inst.teardown.action[0].operation.encodeRequestUrl is True assert ( inst.teardown.action[0].operation.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.teardown.action[0].operation.targetId == "fixture-patient-create" assert inst.teardown.action[0].operation.type.code == "delete" assert ( inst.teardown.action[0].operation.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert inst.test[0].action[0].operation.description == ( "Read the patient resource on the test server using the id " "from fixture-patient-create. Prevent URL encoding of the " "request." ) assert inst.test[0].action[0].operation.encodeRequestUrl is False assert ( inst.test[0].action[0].operation.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.test[0].action[0].operation.responseId == "fixture-patient-read" assert inst.test[0].action[0].operation.targetId == "fixture-patient-create" assert inst.test[0].action[0].operation.type.code == "read" assert ( inst.test[0].action[0].operation.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert ( inst.test[0].action[1].assert_fhir.description == "Confirm that the returned HTTP status is 200(OK)." ) assert inst.test[0].action[1].assert_fhir.direction == "response" assert inst.test[0].action[1].assert_fhir.label == "01-ReadPatientOK" assert inst.test[0].action[1].assert_fhir.response == "okay" assert inst.test[0].action[1].assert_fhir.stopTestOnFail is False assert inst.test[0].action[1].assert_fhir.warningOnly is False assert inst.test[0].action[2].assert_fhir.description == ( "Confirm that the returned HTTP Header Last-Modified is " "present. Warning only as the server might not support " "versioning." ) assert inst.test[0].action[2].assert_fhir.direction == "response" assert inst.test[0].action[2].assert_fhir.headerField == "Last-Modified" assert inst.test[0].action[2].assert_fhir.operator == "notEmpty" assert inst.test[0].action[2].assert_fhir.stopTestOnFail is False assert inst.test[0].action[2].assert_fhir.warningOnly is True assert ( inst.test[0].action[3].assert_fhir.description == "Confirm that the returned resource type is Patient." ) assert ( inst.test[0].action[3].assert_fhir.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.test[0].action[3].assert_fhir.stopTestOnFail is False assert inst.test[0].action[3].assert_fhir.warningOnly is False assert inst.test[0].action[4].assert_fhir.description == ( "Confirm that the returned Patient conforms to the base FHIR " "specification." ) assert inst.test[0].action[4].assert_fhir.stopTestOnFail is False assert inst.test[0].action[4].assert_fhir.validateProfileId == "patient-profile" assert inst.test[0].action[4].assert_fhir.warningOnly is False assert inst.test[0].action[5].assert_fhir.description == ( "Confirm that the returned Patient contains the expected " "family name 'Chalmers'. Uses explicit sourceId reference to " "read responseId fixture." ) assert inst.test[0].action[5].assert_fhir.operator == "equals" assert ( inst.test[0].action[5].assert_fhir.path == "fhir:Patient/fhir:name/fhir:family/@value" ) assert inst.test[0].action[5].assert_fhir.sourceId == "fixture-patient-read" assert inst.test[0].action[5].assert_fhir.stopTestOnFail is False assert inst.test[0].action[5].assert_fhir.value == "Chalmers" assert inst.test[0].action[5].assert_fhir.warningOnly is False assert inst.test[0].action[6].assert_fhir.description == ( "Confirm that the returned Patient contains the expected " "given name 'Peter'. Uses explicit sourceId reference to read" " responseId fixture." ) assert inst.test[0].action[6].assert_fhir.operator == "equals" assert ( inst.test[0].action[6].assert_fhir.path == "fhir:Patient/fhir:name/fhir:given/@value" ) assert inst.test[0].action[6].assert_fhir.sourceId == "fixture-patient-read" assert inst.test[0].action[6].assert_fhir.stopTestOnFail is False assert inst.test[0].action[6].assert_fhir.value == "Peter" assert inst.test[0].action[6].assert_fhir.warningOnly is False assert ( inst.test[0].action[7].assert_fhir.compareToSourceId == "fixture-patient-create" ) assert ( inst.test[0].action[7].assert_fhir.compareToSourcePath == "fhir:Patient/fhir:name/fhir:family/@value" ) assert inst.test[0].action[7].assert_fhir.operator == "equals" assert ( inst.test[0].action[7].assert_fhir.path == "fhir:Patient/fhir:name/fhir:family/@value" ) assert inst.test[0].action[7].assert_fhir.stopTestOnFail is False assert inst.test[0].action[7].assert_fhir.warningOnly is False assert ( inst.test[0].action[8].assert_fhir.compareToSourceId == "fixture-patient-create" ) assert ( inst.test[0].action[8].assert_fhir.compareToSourcePath == "fhir:Patient/fhir:name/fhir:given/@value" ) assert ( inst.test[0].action[8].assert_fhir.path == "fhir:Patient/fhir:name/fhir:given/@value" ) assert inst.test[0].action[8].assert_fhir.sourceId == "fixture-patient-read" assert inst.test[0].action[8].assert_fhir.stopTestOnFail is False assert inst.test[0].action[8].assert_fhir.warningOnly is False assert inst.test[0].action[9].assert_fhir.description == ( "Confirm that the returned resource contains the expected " "retained elements and values. Warning only to provide users " "with reviewable results." ) assert inst.test[0].action[9].assert_fhir.minimumId == "fixture-patient-minimum" assert inst.test[0].action[9].assert_fhir.stopTestOnFail is False assert inst.test[0].action[9].assert_fhir.warningOnly is True assert inst.test[0].description == "Read a Patient and validate response." assert inst.test[0].id == "01-ReadPatient" assert inst.test[0].name == "Read Patient" assert inst.text.status == "generated" assert inst.title == "TestScript Example" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/TestScript/testscript-example"} ).valueUri ) assert inst.useContext[0].code.code == "focus" assert ( inst.useContext[0].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[0].valueCodeableConcept.coding[0].code == "positive" assert ( inst.useContext[0].valueCodeableConcept.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/variant-state"} ).valueUri ) assert inst.useContext[1].code.code == "program" assert ( inst.useContext[1].code.system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"} ).valueUri ) assert inst.useContext[1].valueRange.low.code == "a" assert ( inst.useContext[1].valueRange.low.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.useContext[1].valueRange.low.unit == "year" assert float(inst.useContext[1].valueRange.low.value) == float(2018) assert inst.variable[0].name == "createResourceId" assert inst.variable[0].path == "Patient/id" assert inst.variable[0].sourceId == "fixture-patient-create" assert inst.version == "1.0" def test_testscript_5(base_settings): """No. 5 tests collection for TestScript. Test File: testscript-example.json """ filename = base_settings["unittest_data_dir"] / "testscript-example.json" inst = testscript.TestScript.model_validate_json(filename.read_bytes()) assert "TestScript" == inst.get_resource_type() impl_testscript_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "TestScript" == data["resourceType"] inst2 = testscript.TestScript(**data) impl_testscript_5(inst2) def impl_testscript_6(inst): assert inst.contact[0].name == "Support" assert inst.contact[0].telecom[0].system == "email" assert inst.contact[0].telecom[0].use == "work" assert inst.contact[0].telecom[0].value == "support@HL7.org" assert inst.copyright == "© HL7.org 2011+" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2017-01-18"} ).valueDateTime ) assert inst.description == ( "TestScript example resource with ported Sprinkler basic read" " tests R001, R002, R003, R004. The read tests will utilize " "user defined dynamic variables that will hold the Patient " "resource id values." ) assert inst.experimental is True assert inst.id == "testscript-example-readtest" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.12.2" assert inst.jurisdiction[0].coding[0].code == "US" assert inst.jurisdiction[0].coding[0].display == "United States of America (the)" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:iso:std:iso:3166"} ).valueUri ) assert ( inst.metadata.capability[0].capabilities == "http://hl7.org/fhir/CapabilityStatement/example" ) assert inst.metadata.capability[0].description == "Patient Read Operation" assert ( inst.metadata.capability[0].link[0] == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/http.html#read"} ).valueUri ) assert inst.metadata.capability[0].required is True assert inst.metadata.capability[0].validated is False assert inst.metadata.link[0].description == ( "Demographics and other administrative information about an " "individual or animal receiving care or other health-related " "services." ) assert ( inst.metadata.link[0].url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/patient.html"} ).valueUri ) assert inst.name == "TestScript Example Read Test" assert inst.profile[0] == "http://hl7.org/fhir/StructureDefinition/Patient" assert inst.publisher == "HL7" assert inst.purpose == "Patient Read Operation" assert inst.scope[0].artifact == "http://hl7.org/fhir/StructureDefinition/Patient" assert inst.scope[0].conformance.coding[0].code == "optional" assert ( inst.scope[0].conformance.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/testscript-scope-conformance-codes"} ).valueUri ) assert inst.scope[0].phase.coding[0].code == "unit" assert ( inst.scope[0].phase.coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/testscript-scope-phase-codes"} ).valueUri ) assert inst.status == "draft" assert inst.test[0].action[0].operation.accept == "xml" assert inst.test[0].action[0].operation.description == ( "Read the known Patient resource on the destination test " "system using the user defined dynamic variable " "${KnownPatientResourceId}." ) assert inst.test[0].action[0].operation.encodeRequestUrl is True assert inst.test[0].action[0].operation.params == "/${KnownPatientResourceId}" assert ( inst.test[0].action[0].operation.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.test[0].action[0].operation.type.code == "read" assert ( inst.test[0].action[0].operation.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert ( inst.test[0].action[1].assert_fhir.description == "Confirm that the returned HTTP status is 200(OK)." ) assert inst.test[0].action[1].assert_fhir.response == "okay" assert inst.test[0].action[1].assert_fhir.stopTestOnFail is False assert inst.test[0].action[1].assert_fhir.warningOnly is False assert inst.test[0].action[2].assert_fhir.contentType == "xml" assert ( inst.test[0].action[2].assert_fhir.description == "Confirm that the returned format is XML." ) assert inst.test[0].action[2].assert_fhir.stopTestOnFail is False assert inst.test[0].action[2].assert_fhir.warningOnly is False assert inst.test[0].action[3].assert_fhir.description == ( "Confirm that the returned HTTP Header Last-Modified is " "present. Warning only as the server might not support " "versioning." ) assert inst.test[0].action[3].assert_fhir.headerField == "Last-Modified" assert inst.test[0].action[3].assert_fhir.operator == "notEmpty" assert inst.test[0].action[3].assert_fhir.stopTestOnFail is False assert inst.test[0].action[3].assert_fhir.warningOnly is True assert ( inst.test[0].action[4].assert_fhir.description == "Confirm that the returned resource type is Patient." ) assert ( inst.test[0].action[4].assert_fhir.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.test[0].action[4].assert_fhir.stopTestOnFail is False assert inst.test[0].action[4].assert_fhir.warningOnly is False assert inst.test[0].action[5].assert_fhir.description == ( "Confirm that the returned Patient conforms to the base FHIR " "specification." ) assert inst.test[0].action[5].assert_fhir.stopTestOnFail is False assert inst.test[0].action[5].assert_fhir.validateProfileId == "patient-profile" assert inst.test[0].action[5].assert_fhir.warningOnly is False assert inst.test[0].description == "Read a known Patient and validate response." assert inst.test[0].id == "R001" assert inst.test[0].name == "Sprinkler Read Test R001" assert inst.test[1].action[0].operation.accept == "xml" assert inst.test[1].action[0].operation.encodeRequestUrl is True assert inst.test[1].action[0].operation.params == "/1" assert ( inst.test[1].action[0].operation.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.test[1].action[0].operation.type.code == "read" assert ( inst.test[1].action[0].operation.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert ( inst.test[1].action[1].assert_fhir.description == "Confirm that the returned HTTP status is 404(Not Found)." ) assert inst.test[1].action[1].assert_fhir.response == "notFound" assert inst.test[1].action[1].assert_fhir.stopTestOnFail is False assert inst.test[1].action[1].assert_fhir.warningOnly is False assert ( inst.test[1].description == "Read an unknown Resource Type and validate response." ) assert inst.test[1].id == "R002" assert inst.test[1].name == "Sprinkler Read Test R002" assert inst.test[2].action[0].operation.accept == "xml" assert inst.test[2].action[0].operation.description == ( "Attempt to read the non-existing Patient resource on the " "destination test system using the user defined dynamic " "variable ${NonExistsPatientResourceId}." ) assert inst.test[2].action[0].operation.encodeRequestUrl is True assert inst.test[2].action[0].operation.params == "/${NonExistsPatientResourceId}" assert ( inst.test[2].action[0].operation.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.test[2].action[0].operation.type.code == "read" assert ( inst.test[2].action[0].operation.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert ( inst.test[2].action[1].assert_fhir.description == "Confirm that the returned HTTP status is 404(Not Found)." ) assert inst.test[2].action[1].assert_fhir.response == "notFound" assert inst.test[2].action[1].assert_fhir.stopTestOnFail is False assert inst.test[2].action[1].assert_fhir.warningOnly is False assert ( inst.test[2].description == "Read a known, non-existing Patient and validate response." ) assert inst.test[2].id == "R003" assert inst.test[2].name == "Sprinkler Read Test R003" assert inst.test[3].action[0].operation.accept == "xml" assert inst.test[3].action[0].operation.description == ( "Attempt to read a Patient resource on the destination test " "system using known bad formatted resource id." ) assert inst.test[3].action[0].operation.encodeRequestUrl is True assert inst.test[3].action[0].operation.params == "/ID-may-not-contain-CAPITALS" assert ( inst.test[3].action[0].operation.resource == ExternalValidatorModel.model_validate({"valueUri": "Patient"}).valueUri ) assert inst.test[3].action[0].operation.type.code == "read" assert ( inst.test[3].action[0].operation.type.system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/restful-interaction"} ).valueUri ) assert ( inst.test[3].action[1].assert_fhir.description == "Confirm that the returned HTTP status is 400(Bad Request)." ) assert inst.test[3].action[1].assert_fhir.response == "badRequest" assert inst.test[3].action[1].assert_fhir.stopTestOnFail is False assert inst.test[3].action[1].assert_fhir.warningOnly is False assert inst.test[3].description == ( "Read a Patient using a known bad formatted resource id and " "validate response." ) assert inst.test[3].id == "R004" assert inst.test[3].name == "Sprinkler Read Test R004" assert inst.text.status == "generated" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/TestScript/testscript-example-readtest"} ).valueUri ) assert inst.variable[0].defaultValue == "example" assert inst.variable[0].name == "KnownPatientResourceId" assert inst.variable[1].defaultValue == "does-not-exist" assert inst.variable[1].name == "NonExistsPatientResourceId" assert inst.version == "1.0" def test_testscript_6(base_settings): """No. 6 tests collection for TestScript. Test File: testscript-example-readtest.json """ filename = base_settings["unittest_data_dir"] / "testscript-example-readtest.json" inst = testscript.TestScript.model_validate_json(filename.read_bytes()) assert "TestScript" == inst.get_resource_type() impl_testscript_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "TestScript" == data["resourceType"] inst2 = testscript.TestScript(**data) impl_testscript_6(inst2) ================================================ FILE: fhir/resources/tests/test_transport.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Transport Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import transport from .conftest import ExternalValidatorModel def impl_transport_1(inst): assert inst.basedOn[0].reference == "SupplyRequest/simpleorder" assert inst.currentLocation.display == "Current location for item at Lab A" assert inst.currentLocation.reference == "Transport/location-labA" assert inst.id == "simpledelivery" assert inst.identifier[0].value == "Transport1234" assert inst.intent == "order" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.partOf[0].display == "Central Supply Restock" assert ( inst.requestedLocation.display == "Requested location for item at City Hospital Lab" ) assert inst.requestedLocation.reference == "Transport/location-hospitalLab" assert inst.status == "completed" assert inst.text.status == "generated" def test_transport_1(base_settings): """No. 1 tests collection for Transport. Test File: transport-example.json """ filename = base_settings["unittest_data_dir"] / "transport-example.json" inst = transport.Transport.model_validate_json(filename.read_bytes()) assert "Transport" == inst.get_resource_type() impl_transport_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "Transport" == data["resourceType"] inst2 = transport.Transport(**data) impl_transport_1(inst2) ================================================ FILE: fhir/resources/tests/test_valueset.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/ValueSet Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import valueset from .conftest import ExternalValidatorModel def impl_valueset_1(inst): assert inst.compose.include[0].concept[0].code == "ActivityDefinition" assert inst.compose.include[0].concept[1].code == "ChargeItemDefinition" assert inst.compose.include[0].concept[2].code == "ClinicalUseDefinition" assert inst.compose.include[0].concept[3].code == "EventDefinition" assert inst.compose.include[0].concept[4].code == "Measure" assert inst.compose.include[0].concept[5].code == "MessageDefinition" assert inst.compose.include[0].concept[6].code == "ObservationDefinition" assert inst.compose.include[0].concept[7].code == "OperationDefinition" assert inst.compose.include[0].concept[8].code == "PlanDefinition" assert inst.compose.include[0].concept[9].code == "Questionnaire" assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/fhir-types"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.description == "All Resource Types that represent definition resources" assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "fhir" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "normative" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 5 assert inst.id == "definition-resource-types" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.1056" assert inst.immutable is True assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2023-03-26T15:21:02.749+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablevalueset" ) assert inst.name == "DefinitionResourceTypes" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "active" assert inst.text.status == "extensions" assert inst.title == "Definition Resource Types" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/definition-resource-types"} ).valueUri ) assert inst.version == "5.0.0" def test_valueset_1(base_settings): """No. 1 tests collection for ValueSet. Test File: valueset-definition-resource-types.json """ filename = ( base_settings["unittest_data_dir"] / "valueset-definition-resource-types.json" ) inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_1(inst2) def impl_valueset_2(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/location-physical-type"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.description == ( "This example value set defines a set of codes that can be " "used to indicate the physical form of the Location." ) assert inst.experimental is True assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "pa" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "draft" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 1 assert inst.id == "location-form" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.328" assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2023-03-26T15:21:02.749+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablevalueset" ) assert inst.name == "LocationForm" assert inst.publisher == "FHIR Project team" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Location Form" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/location-form"} ).valueUri ) assert inst.version == "5.0.0" def test_valueset_2(base_settings): """No. 2 tests collection for ValueSet. Test File: valueset-location-form.json """ filename = base_settings["unittest_data_dir"] / "valueset-location-form.json" inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_2(inst2) def impl_valueset_3(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/genomicstudy-status"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2020-12-28T16:55:11+11:00"} ).valueDateTime ) assert inst.description == "The status of the GenomicStudy." assert inst.experimental is True assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "cg" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 1 assert inst.id == "genomicstudy-status" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.3083" assert inst.immutable is True assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2023-03-26T15:21:02.749+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablevalueset" ) assert inst.name == "GenomicStudyStatus" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.div == ( '
" ) assert inst.text.status == "generated" assert inst.title == "Genomic Study Status" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/genomicstudy-status"} ).valueUri ) assert inst.version == "5.0.0" def test_valueset_3(base_settings): """No. 3 tests collection for ValueSet. Test File: valueset-genomicstudy-status.json """ filename = base_settings["unittest_data_dir"] / "valueset-genomicstudy-status.json" inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_3(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_3(inst2) def impl_valueset_4(inst): assert inst.compose.include[0].concept[0].code == "7771000" assert inst.compose.include[0].concept[0].display == "Left (qualifier value)" assert inst.compose.include[0].concept[1].code == "24028007" assert inst.compose.include[0].concept[1].display == "Right (qualifier value)" assert inst.compose.include[0].concept[2].code == "51440002" assert inst.compose.include[0].concept[2].display == "Bilateral" assert inst.compose.include[0].concept[3].code == "46053002" assert inst.compose.include[0].concept[3].display == "Distal" assert inst.compose.include[0].concept[4].code == "255554000" assert inst.compose.include[0].concept[4].display == "Dorsal" assert inst.compose.include[0].concept[5].code == "264147007" assert inst.compose.include[0].concept[5].display == "Plantar" assert inst.compose.include[0].concept[6].code == "261183002" assert inst.compose.include[0].concept[6].display == "Upper" assert inst.compose.include[0].concept[7].code == "261122009" assert inst.compose.include[0].concept[7].display == "Lower" assert inst.compose.include[0].concept[8].code == "255561001" assert inst.compose.include[0].concept[8].display == "Medial" assert inst.compose.include[0].concept[9].code == "49370004" assert inst.compose.include[0].concept[9].display == "Lateral" assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://snomed.info/sct"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.description == "SNOMED-CT concepts modifying the anatomic location" assert inst.experimental is True assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "oo" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "draft" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 1 assert inst.id == "bodystructure-relative-location" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.140" assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2023-03-26T15:21:02.749+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablevalueset" ) assert inst.name == "BodystructureLocationQualifier" assert inst.publisher == "Order and Observation Workgroup" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Bodystructure Location Qualifier" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/bodystructure-relative-location"} ).valueUri ) assert inst.version == "5.0.0" def test_valueset_4(base_settings): """No. 4 tests collection for ValueSet. Test File: valueset-bodystructure-relative-location.json """ filename = ( base_settings["unittest_data_dir"] / "valueset-bodystructure-relative-location.json" ) inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_4(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_4(inst2) def impl_valueset_5(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/encounter-status"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2020-12-28T16:55:11+11:00"} ).valueDateTime ) assert inst.description == "Current state of the encounter." assert inst.experimental is True assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "pa" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 4 assert inst.id == "encounter-status" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.246" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[1].use == "old" assert inst.identifier[1].value == "urn:oid:2.16.840.1.113883.4.642.3.241" assert inst.immutable is True assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2023-03-26T15:21:02.749+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablevalueset" ) assert inst.name == "EncounterStatus" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.div == ( '
" ) assert inst.text.status == "generated" assert inst.title == "Encounter Status" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/encounter-status"} ).valueUri ) assert inst.version == "5.0.0" def test_valueset_5(base_settings): """No. 5 tests collection for ValueSet. Test File: valueset-encounter-status.json """ filename = base_settings["unittest_data_dir"] / "valueset-encounter-status.json" inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_5(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_5(inst2) def impl_valueset_6(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/report-status-codes"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2020-12-28T16:55:11+11:00"} ).valueDateTime ) assert inst.description == "The current status of the test report." assert inst.experimental is True assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "fhir" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 1 assert inst.id == "report-status-codes" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.724" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[1].use == "old" assert inst.identifier[1].value == "urn:oid:2.16.840.1.113883.4.642.3.712" assert inst.immutable is True assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2023-03-26T15:21:02.749+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablevalueset" ) assert inst.name == "TestReportStatus" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.div == ( '
" ) assert inst.text.status == "generated" assert inst.title == "Test Report Status" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/report-status-codes"} ).valueUri ) assert inst.version == "5.0.0" def test_valueset_6(base_settings): """No. 6 tests collection for ValueSet. Test File: valueset-report-status-codes.json """ filename = base_settings["unittest_data_dir"] / "valueset-report-status-codes.json" inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_6(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_6(inst2) def impl_valueset_7(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/note-type"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2023-03-26T15:21:02+11:00"} ).valueDateTime ) assert inst.description == "The presentation types of notes." assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "fm" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 4 assert inst.id == "note-type" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.15" assert inst.immutable is True assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2023-03-26T15:21:02.749+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablevalueset" ) assert inst.name == "NoteType" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.div == ( '
" ) assert inst.text.status == "generated" assert inst.title == "NoteType" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/note-type"} ).valueUri ) assert inst.version == "5.0.0" def test_valueset_7(base_settings): """No. 7 tests collection for ValueSet. Test File: valueset-note-type.json """ filename = base_settings["unittest_data_dir"] / "valueset-note-type.json" inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_7(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_7(inst2) def impl_valueset_8(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/issue-severity"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2020-12-28T16:55:11+11:00"} ).valueDateTime ) assert inst.description == "How the issue affects the success of the action." assert inst.experimental is False assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "fhir" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "normative" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version" } ).valueUri ) assert inst.extension[2].valueCode == "4.0.0" assert ( inst.extension[3].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[3].valueInteger == 5 assert inst.id == "issue-severity" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.408" assert ( inst.identifier[1].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[1].use == "old" assert inst.identifier[1].value == "urn:oid:2.16.840.1.113883.4.642.3.397" assert ( inst.identifier[2].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[2].use == "old" assert inst.identifier[2].value == "urn:oid:2.16.840.1.113883.4.642.2.223" assert inst.immutable is True assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2023-03-26T15:21:02.749+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablevalueset" ) assert inst.name == "IssueSeverity" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "active" assert inst.text.div == ( '
" ) assert inst.text.status == "generated" assert inst.title == "Issue Severity" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/issue-severity"} ).valueUri ) assert inst.version == "5.0.0" def test_valueset_8(base_settings): """No. 8 tests collection for ValueSet. Test File: valueset-issue-severity.json """ filename = base_settings["unittest_data_dir"] / "valueset-issue-severity.json" inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_8(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_8(inst2) def impl_valueset_9(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/substance-source-material-genus"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2020-12-28T16:55:11+11:00"} ).valueDateTime ) assert inst.description == ( "The genus of an organism, typically referring to the Latin " "epithet of the genus element of the plant/animal scientific " "name." ) assert inst.experimental is True assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "brr" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 1 assert inst.id == "substance-source-material-genus" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.3253" assert inst.immutable is True assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2023-03-26T15:21:02.749+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablevalueset" ) assert inst.name == "SourceMaterialGenus" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Source Material Genus" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/substance-source-material-genus"} ).valueUri ) assert inst.version == "5.0.0" def test_valueset_9(base_settings): """No. 9 tests collection for ValueSet. Test File: valueset-substance-source-material-genus.json """ filename = ( base_settings["unittest_data_dir"] / "valueset-substance-source-material-genus.json" ) inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_9(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_9(inst2) def impl_valueset_10(inst): assert ( inst.compose.include[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/cited-artifact-part-type"} ).valueUri ) assert inst.contact[0].telecom[0].system == "url" assert inst.contact[0].telecom[0].value == "http://hl7.org/fhir" assert inst.contact[0].telecom[1].system == "email" assert inst.contact[0].telecom[1].value == "fhir@lists.hl7.org" assert ( inst.date == ExternalValidatorModel.model_validate( {"valueDateTime": "2020-12-28T16:55:11+11:00"} ).valueDateTime ) assert inst.description == ( "To describe the reason for the variant citation, such as " "version number or subpart specification." ) assert inst.experimental is True assert ( inst.extension[0].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" } ).valueUri ) assert inst.extension[0].valueCode == "cds" assert ( inst.extension[1].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" } ).valueUri ) assert inst.extension[1].valueCode == "trial-use" assert ( inst.extension[2].url == ExternalValidatorModel.model_validate( { "valueUri": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" } ).valueUri ) assert inst.extension[2].valueInteger == 1 assert inst.id == "cited-artifact-part-type" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "urn:ietf:rfc:3986"} ).valueUri ) assert inst.identifier[0].value == "urn:oid:2.16.840.1.113883.4.642.3.2964" assert inst.immutable is True assert inst.jurisdiction[0].coding[0].code == "001" assert inst.jurisdiction[0].coding[0].display == "World" assert ( inst.jurisdiction[0].coding[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://unstats.un.org/unsd/methods/m49/m49.htm"} ).valueUri ) assert ( inst.meta.lastUpdated == ExternalValidatorModel.model_validate( {"valueInstant": "2023-03-26T15:21:02.749+11:00"} ).valueInstant ) assert ( inst.meta.profile[0] == "http://hl7.org/fhir/StructureDefinition/shareablevalueset" ) assert inst.name == "CitedArtifactPartType" assert inst.publisher == "HL7 (FHIR Project)" assert inst.status == "draft" assert inst.text.status == "generated" assert inst.title == "Cited Artifact Part Type" assert ( inst.url == ExternalValidatorModel.model_validate( {"valueUri": "http://hl7.org/fhir/ValueSet/cited-artifact-part-type"} ).valueUri ) assert inst.version == "5.0.0" def test_valueset_10(base_settings): """No. 10 tests collection for ValueSet. Test File: valueset-cited-artifact-part-type.json """ filename = ( base_settings["unittest_data_dir"] / "valueset-cited-artifact-part-type.json" ) inst = valueset.ValueSet.model_validate_json(filename.read_bytes()) assert "ValueSet" == inst.get_resource_type() impl_valueset_10(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "ValueSet" == data["resourceType"] inst2 = valueset.ValueSet(**data) impl_valueset_10(inst2) ================================================ FILE: fhir/resources/tests/test_verificationresult.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/VerificationResult Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import verificationresult from .conftest import ExternalValidatorModel def impl_verificationresult_1(inst): assert inst.id == "example" assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.status == "attested" assert inst.text.status == "generated" def test_verificationresult_1(base_settings): """No. 1 tests collection for VerificationResult. Test File: verificationresult-example.json """ filename = base_settings["unittest_data_dir"] / "verificationresult-example.json" inst = verificationresult.VerificationResult.model_validate_json( filename.read_bytes() ) assert "VerificationResult" == inst.get_resource_type() impl_verificationresult_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "VerificationResult" == data["resourceType"] inst2 = verificationresult.VerificationResult(**data) impl_verificationresult_1(inst2) ================================================ FILE: fhir/resources/tests/test_visionprescription.py ================================================ # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/VisionPrescription Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from .. import visionprescription from .conftest import ExternalValidatorModel def impl_visionprescription_1(inst): assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-06-15"} ).valueDateTime ) assert ( inst.dateWritten == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-06-15"} ).valueDateTime ) assert inst.encounter.reference == "Encounter/f001" assert inst.id == "33124" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.happysight.com/prescription"} ).valueUri ) assert inst.identifier[0].value == "15014" assert float(inst.lensSpecification[0].add) == float(1.75) assert inst.lensSpecification[0].axis == 160 assert float(inst.lensSpecification[0].backCurve) == float(8.7) assert inst.lensSpecification[0].brand == "OphthaGuard" assert inst.lensSpecification[0].color == "green" assert float(inst.lensSpecification[0].cylinder) == float(-2.25) assert float(inst.lensSpecification[0].diameter) == float(14.0) assert inst.lensSpecification[0].duration.code == "mo" assert ( inst.lensSpecification[0].duration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.lensSpecification[0].duration.unit == "mo" assert float(inst.lensSpecification[0].duration.value) == float(1) assert inst.lensSpecification[0].eye == "right" assert ( inst.lensSpecification[0].note[0].text == "Shade treatment for extreme light sensitivity" ) assert float(inst.lensSpecification[0].power) == float(-2.75) assert inst.lensSpecification[0].product.coding[0].code == "contact" assert ( inst.lensSpecification[0].product.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct" } ).valueUri ) assert float(inst.lensSpecification[1].add) == float(1.75) assert inst.lensSpecification[1].axis == 160 assert float(inst.lensSpecification[1].backCurve) == float(8.7) assert inst.lensSpecification[1].brand == "OphthaGuard" assert inst.lensSpecification[1].color == "green" assert float(inst.lensSpecification[1].cylinder) == float(-3.5) assert float(inst.lensSpecification[1].diameter) == float(14.0) assert inst.lensSpecification[1].duration.code == "mo" assert ( inst.lensSpecification[1].duration.system == ExternalValidatorModel.model_validate( {"valueUri": "http://unitsofmeasure.org"} ).valueUri ) assert inst.lensSpecification[1].duration.unit == "month" assert float(inst.lensSpecification[1].duration.value) == float(1) assert inst.lensSpecification[1].eye == "left" assert ( inst.lensSpecification[1].note[0].text == "Shade treatment for extreme light sensitivity" ) assert float(inst.lensSpecification[1].power) == float(-2.75) assert inst.lensSpecification[1].product.coding[0].code == "contact" assert ( inst.lensSpecification[1].product.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct" } ).valueUri ) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert inst.prescriber.reference == "Practitioner/example" assert inst.status == "active" assert inst.text.div == ( '
Sample Contract ' "Lens prescription
" ) assert inst.text.status == "generated" def test_visionprescription_1(base_settings): """No. 1 tests collection for VisionPrescription. Test File: visionprescription-example-1.json """ filename = base_settings["unittest_data_dir"] / "visionprescription-example-1.json" inst = visionprescription.VisionPrescription.model_validate_json( filename.read_bytes() ) assert "VisionPrescription" == inst.get_resource_type() impl_visionprescription_1(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "VisionPrescription" == data["resourceType"] inst2 = visionprescription.VisionPrescription(**data) impl_visionprescription_1(inst2) def impl_visionprescription_2(inst): assert ( inst.created == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-06-15"} ).valueDateTime ) assert ( inst.dateWritten == ExternalValidatorModel.model_validate( {"valueDateTime": "2014-06-15"} ).valueDateTime ) assert inst.id == "33123" assert ( inst.identifier[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://www.happysight.com/prescription"} ).valueUri ) assert inst.identifier[0].value == "15013" assert float(inst.lensSpecification[0].add) == float(2.0) assert inst.lensSpecification[0].eye == "right" assert float(inst.lensSpecification[0].prism[0].amount) == float(0.5) assert inst.lensSpecification[0].prism[0].base == "down" assert inst.lensSpecification[0].product.coding[0].code == "lens" assert ( inst.lensSpecification[0].product.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct" } ).valueUri ) assert float(inst.lensSpecification[0].sphere) == float(-2.0) assert float(inst.lensSpecification[1].add) == float(2.0) assert inst.lensSpecification[1].axis == 180 assert float(inst.lensSpecification[1].cylinder) == float(-0.5) assert inst.lensSpecification[1].eye == "left" assert float(inst.lensSpecification[1].prism[0].amount) == float(0.5) assert inst.lensSpecification[1].prism[0].base == "up" assert inst.lensSpecification[1].product.coding[0].code == "lens" assert ( inst.lensSpecification[1].product.coding[0].system == ExternalValidatorModel.model_validate( { "valueUri": "http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct" } ).valueUri ) assert float(inst.lensSpecification[1].sphere) == float(-1.0) assert inst.meta.tag[0].code == "HTEST" assert inst.meta.tag[0].display == "test health data" assert ( inst.meta.tag[0].system == ExternalValidatorModel.model_validate( {"valueUri": "http://terminology.hl7.org/CodeSystem/v3-ActReason"} ).valueUri ) assert inst.patient.reference == "Patient/example" assert inst.prescriber.reference == "Practitioner/example" assert inst.status == "active" assert inst.text.status == "generated" def test_visionprescription_2(base_settings): """No. 2 tests collection for VisionPrescription. Test File: visionprescription-example.json """ filename = base_settings["unittest_data_dir"] / "visionprescription-example.json" inst = visionprescription.VisionPrescription.model_validate_json( filename.read_bytes() ) assert "VisionPrescription" == inst.get_resource_type() impl_visionprescription_2(inst) # testing reverse by generating data from itself and create again. data = inst.model_dump() assert "VisionPrescription" == data["resourceType"] inst2 = visionprescription.VisionPrescription(**data) impl_visionprescription_2(inst2) ================================================ FILE: fhir/resources/testscript.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/TestScript Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class TestScript(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Describes a set of tests. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. """ __resource_type__ = "TestScript" contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the test script and/or its contents." " Copyright statements are generally legal restrictions on the use and " "publishing of the test script." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the test script was last " "significantly changed. The date must change when the business version " "changes and it must change if the status code changes. In addition, it" " should change when the substantive content of the test script " "changes." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the test script", description=( "A free text natural language description of the test script from a " "consumer's perspective." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) destination: typing.List[fhirtypes.TestScriptDestinationType] | None = Field( default=None, alias="destination", title=( "An abstract server representing a destination or receiver in a message" " exchange" ), description=( "An abstract server used in operations within this test script in the " "destination element." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this test script is authored for " "testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) fixture: typing.List[fhirtypes.TestScriptFixtureType] | None = Field( default=None, alias="fixture", title="Fixture in the test script - by reference (uri)", description=( "Fixture in the test script - by reference (uri). All fixtures are " "required for the test script to execute." ), json_schema_extra={ "element_property": True, }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the test script", description=( "A formal identifier that is used to identify this test script when it " "is represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for test script (if applicable)", description=( "A legal or geographic region in which the test script is intended to " "be used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) metadata: fhirtypes.TestScriptMetadataType | None = Field( default=None, alias="metadata", title=( "Required capability that is assumed to function correctly on the FHIR " "server being tested" ), description=( "The required capability must exist and are assumed to function " "correctly on the FHIR server being tested." ), json_schema_extra={ "element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this test script (computer friendly)", description=( "A natural language name identifying the test script. This name should " "be usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) origin: typing.List[fhirtypes.TestScriptOriginType] | None = Field( default=None, alias="origin", title=( "An abstract server representing a client or sender in a message " "exchange" ), description=( "An abstract server used in operations within this test script in the " "origin element." ), json_schema_extra={ "element_property": True, }, ) profile: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="profile", title="Reference of the validation profile", description="Reference to the profile to be used for validation.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["StructureDefinition"], }, ) profile__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_profile", title="Extension field for ``profile``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the test script." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this test script is defined", description=( "Explanation of why this test script is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) scope: typing.List[fhirtypes.TestScriptScopeType] | None = Field( default=None, alias="scope", title="Indication of the artifact(s) that are tested by this test case", description=( "The scope indicates a conformance artifact that is tested by the " "test(s) within this test case and the expectation of the test " "outcome(s) as well as the intended test phase inclusion." ), json_schema_extra={ "element_property": True, }, ) setup: fhirtypes.TestScriptSetupType | None = Field( default=None, alias="setup", title="A series of required setup operations before tests are executed", description=None, json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this test script. Enables tracking the life-cycle of the" " content." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) teardown: fhirtypes.TestScriptTeardownType | None = Field( default=None, alias="teardown", title="A series of required clean up steps", description=( "A series of operations required to clean up after all the tests are " "executed (successfully or otherwise)." ), json_schema_extra={ "element_property": True, }, ) test: typing.List[fhirtypes.TestScriptTestType] | None = Field( default=None, alias="test", title="A test in this script", description=None, json_schema_extra={ "element_property": True, }, ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this test script (human friendly)", description="A short, descriptive, user-friendly title for the test script.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this test script, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this test script when it is " "referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which an authoritative instance of this" " test script is (or will be) published. This URL can be the target of " "a canonical reference. It SHALL remain the same when the test script " "is stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate test script instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) variable: typing.List[fhirtypes.TestScriptVariableType] | None = Field( default=None, alias="variable", title="Placeholder for evaluated elements", description=( "Variable is set based either on element value in response body or on " "header field value in the response headers." ), json_schema_extra={ "element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the test script", description=( "The identifier that is used to identify this version of the test " "script when it is referenced in a specification, model, design or " "instance. This is an arbitrary value managed by the test script author" " and is not expected to be globally unique. For example, it might be a" " timestamp (e.g. yyyymmdd) if a managed version is not available. " "There is also no expectation that versions can be placed in a " "lexicographical sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which is" " more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScript`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "copyrightLabel", "origin", "destination", "metadata", "scope", "fixture", "profile", "variable", "setup", "test", "teardown", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScript`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext"), ("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields class TestScriptDestination(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An abstract server representing a destination or receiver in a message exchange. An abstract server used in operations within this test script in the destination element. """ __resource_type__ = "TestScriptDestination" index: fhirtypes.IntegerType | None = Field( default=None, alias="index", title="The index of the abstract destination server starting at 1", description=( "Abstract name given to a destination server in this test script. The " "name is provided as a number starting at 1." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) index__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_index", title="Extension field for ``index``." ) profile: fhirtypes.CodingType = Field( default=..., alias="profile", title=( "FHIR-Server | FHIR-SDC-FormManager | FHIR-SDC-FormReceiver | FHIR-SDC-" "FormProcessor" ), description="The type of destination profile the test system supports.", json_schema_extra={ "element_property": True, }, ) url: fhirtypes.UrlType | None = Field( default=None, alias="url", title="The url path of the destination server", description=( "The explicit url path of the destination server used in this test " "script." ), json_schema_extra={ "element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptDestination`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "index", "profile", "url"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptDestination`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("index", "index__ext")] return required_fields class TestScriptFixture(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Fixture in the test script - by reference (uri). Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute. """ __resource_type__ = "TestScriptFixture" autocreate: bool | None = Field( default=None, alias="autocreate", title="Whether or not to implicitly create the fixture during setup", description=( "Whether or not to implicitly create the fixture during setup. If true," " the fixture is automatically created on each server being tested " "during setup, therefore no create operation is required for this " "fixture in the TestScript.setup section." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) autocreate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_autocreate", title="Extension field for ``autocreate``." ) autodelete: bool | None = Field( default=None, alias="autodelete", title="Whether or not to implicitly delete the fixture during teardown", description=( "Whether or not to implicitly delete the fixture during teardown. If " "true, the fixture is automatically deleted on each server being tested" " during teardown, therefore no delete operation is required for this " "fixture in the TestScript.teardown section." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) autodelete__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_autodelete", title="Extension field for ``autodelete``." ) resource: fhirtypes.ReferenceType | None = Field( default=None, alias="resource", title="Reference of the resource", description=( "Reference to the resource (containing the contents of the resource " "needed for operations). This is allowed to be a Parameters resource." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptFixture`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "autocreate", "autodelete", "resource", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptFixture`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("autocreate", "autocreate__ext"), ("autodelete", "autodelete__ext"), ] return required_fields class TestScriptMetadata(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Required capability that is assumed to function correctly on the FHIR server being tested. The required capability must exist and are assumed to function correctly on the FHIR server being tested. """ __resource_type__ = "TestScriptMetadata" capability: typing.List[fhirtypes.TestScriptMetadataCapabilityType] = Field( default=..., alias="capability", title=( "Capabilities that are assumed to function correctly on the FHIR " "server being tested" ), description=( "Capabilities that must exist and are assumed to function correctly on " "the FHIR server being tested." ), json_schema_extra={ "element_property": True, }, ) link: typing.List[fhirtypes.TestScriptMetadataLinkType] | None = Field( default=None, alias="link", title="Links to the FHIR specification", description="A link to the FHIR specification that this test is covering.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptMetadata`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "link", "capability"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptMetadata`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptMetadataCapability(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Capabilities that are assumed to function correctly on the FHIR server being tested. Capabilities that must exist and are assumed to function correctly on the FHIR server being tested. """ __resource_type__ = "TestScriptMetadataCapability" capabilities: fhirtypes.CanonicalType | None = Field( default=None, alias="capabilities", title="Required Capability Statement", description=( "Minimum capabilities required of server for test script to execute " "successfully. If server does not meet at a minimum the referenced " "capability statement, then all tests in this script are skipped." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["CapabilityStatement"], }, ) capabilities__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_capabilities", title="Extension field for ``capabilities``.", ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="The expected capabilities of the server", description=( "Description of the capabilities that this test script is requiring the" " server to support." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) destination: fhirtypes.IntegerType | None = Field( default=None, alias="destination", title="Which server these requirements apply to", description=None, json_schema_extra={ "element_property": True, }, ) destination__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_destination", title="Extension field for ``destination``." ) link: typing.List[fhirtypes.UriType | None] | None = Field( default=None, alias="link", title="Links to the FHIR specification", description=( "Links to the FHIR specification that describes this interaction and " "the resources involved in more detail." ), json_schema_extra={ "element_property": True, }, ) link__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_link", title="Extension field for ``link``." ) origin: typing.List[fhirtypes.IntegerType | None] | None = Field( default=None, alias="origin", title="Which origin server these requirements apply to", description=None, json_schema_extra={ "element_property": True, }, ) origin__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_origin", title="Extension field for ``origin``." ) required: bool | None = Field( default=None, alias="required", title="Are the capabilities required?", description=( "Whether or not the test execution will require the given capabilities " "of the server in order for this test script to execute." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) required__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_required", title="Extension field for ``required``." ) validated: bool | None = Field( default=None, alias="validated", title="Are the capabilities validated?", description=( "Whether or not the test execution will validate the given capabilities" " of the server in order for this test script to execute." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) validated__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_validated", title="Extension field for ``validated``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptMetadataCapability`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "required", "validated", "description", "origin", "destination", "link", "capabilities", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptMetadataCapability`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("capabilities", "capabilities__ext"), ("required", "required__ext"), ("validated", "validated__ext"), ] return required_fields class TestScriptMetadataLink(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Links to the FHIR specification. A link to the FHIR specification that this test is covering. """ __resource_type__ = "TestScriptMetadataLink" description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Short description", description="Short description of the link.", json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title="URL to the specification", description=( "URL to a particular requirement or feature within the FHIR " "specification." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptMetadataLink`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "url", "description"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptMetadataLink`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("url", "url__ext")] return required_fields class TestScriptOrigin(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. An abstract server representing a client or sender in a message exchange. An abstract server used in operations within this test script in the origin element. """ __resource_type__ = "TestScriptOrigin" index: fhirtypes.IntegerType | None = Field( default=None, alias="index", title="The index of the abstract origin server starting at 1", description=( "Abstract name given to an origin server in this test script. The name" " is provided as a number starting at 1." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) index__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_index", title="Extension field for ``index``." ) profile: fhirtypes.CodingType = Field( default=..., alias="profile", title="FHIR-Client | FHIR-SDC-FormFiller", description="The type of origin profile the test system supports.", json_schema_extra={ "element_property": True, }, ) url: fhirtypes.UrlType | None = Field( default=None, alias="url", title="The url path of the origin server", description="The explicit url path of the origin server used in this test script.", json_schema_extra={ "element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptOrigin`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "index", "profile", "url"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptOrigin`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("index", "index__ext")] return required_fields class TestScriptScope(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Indication of the artifact(s) that are tested by this test case. The scope indicates a conformance artifact that is tested by the test(s) within this test case and the expectation of the test outcome(s) as well as the intended test phase inclusion. """ __resource_type__ = "TestScriptScope" artifact: fhirtypes.CanonicalType | None = Field( default=None, alias="artifact", title="The specific conformance artifact being tested", description=( "The specific conformance artifact being tested. The canonical " "reference can be version-specific." ), json_schema_extra={ "element_property": True, "element_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) artifact__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_artifact", title="Extension field for ``artifact``." ) conformance: fhirtypes.CodeableConceptType | None = Field( default=None, alias="conformance", title="required | optional | strict", description=( "The expectation of whether the test must pass for the system to be " "considered conformant with the artifact: required - all tests are " "expected to pass, optional - all test are expected to pass but non-" "pass status may be allowed, strict - all tests are expected to pass " "and warnings are treated as a failure." ), json_schema_extra={ "element_property": True, }, ) phase: fhirtypes.CodeableConceptType | None = Field( default=None, alias="phase", title="unit | integration | production", description=( "The phase of testing for this artifact: unit - development / " "implementation phase, integration - internal system to system phase, " "production - live system to system phase (Note, this may involve " "pii/phi data)." ), json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptScope`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "artifact", "conformance", "phase", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptScope`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("artifact", "artifact__ext")] return required_fields class TestScriptSetup(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A series of required setup operations before tests are executed. """ __resource_type__ = "TestScriptSetup" action: typing.List[fhirtypes.TestScriptSetupActionType] = Field( default=..., alias="action", title="A setup operation or assert to perform", description="Action would contain either an operation or an assertion.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptSetup`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "action"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptSetup`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptSetupAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A setup operation or assert to perform. Action would contain either an operation or an assertion. """ __resource_type__ = "TestScriptSetupAction" assert_fhir: fhirtypes.TestScriptSetupActionAssertType | None = Field( default=None, alias="assert", title="The assertion to perform", description=( "Evaluates the results of previous operations to determine if the " "server under test behaves appropriately." ), json_schema_extra={ "element_property": True, }, ) operation: fhirtypes.TestScriptSetupActionOperationType | None = Field( default=None, alias="operation", title="The setup operation to perform", description="The operation to perform.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptSetupAction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "operation", "assert"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptSetupAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptSetupActionAssert(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The assertion to perform. Evaluates the results of previous operations to determine if the server under test behaves appropriately. """ __resource_type__ = "TestScriptSetupActionAssert" compareToSourceExpression: fhirtypes.StringType | None = Field( default=None, alias="compareToSourceExpression", title="The FHIRPath expression to evaluate against the source fixture", description=( "The FHIRPath expression for a specific value to evaluate against the " "source fixture. When compareToSourceId is defined, either " "compareToSourceExpression or compareToSourcePath must be defined, but " "not both." ), json_schema_extra={ "element_property": True, }, ) compareToSourceExpression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_compareToSourceExpression", title="Extension field for ``compareToSourceExpression``.", ) compareToSourceId: fhirtypes.StringType | None = Field( default=None, alias="compareToSourceId", title="Id of the source fixture to be evaluated", description=( "Id of the source fixture used as the contents to be evaluated by " 'either the "source/expression" or "sourceId/path" definition.' ), json_schema_extra={ "element_property": True, }, ) compareToSourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_compareToSourceId", title="Extension field for ``compareToSourceId``.", ) compareToSourcePath: fhirtypes.StringType | None = Field( default=None, alias="compareToSourcePath", title="XPath or JSONPath expression to evaluate against the source fixture", description=( "XPath or JSONPath expression to evaluate against the source fixture. " "When compareToSourceId is defined, either compareToSourceExpression or" " compareToSourcePath must be defined, but not both." ), json_schema_extra={ "element_property": True, }, ) compareToSourcePath__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_compareToSourcePath", title="Extension field for ``compareToSourcePath``.", ) contentType: fhirtypes.CodeType | None = Field( default=None, alias="contentType", title="Mime type to compare against the 'Content-Type' header", description=( "The mime-type contents to compare against the request or response " "message 'Content-Type' header." ), json_schema_extra={ "element_property": True, }, ) contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contentType", title="Extension field for ``contentType``." ) defaultManualCompletion: fhirtypes.CodeType | None = Field( default=None, alias="defaultManualCompletion", title="fail | pass | skip | stop", description="The default manual completion outcome applied to this assertion.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["fail", "pass", "skip", "stop"], }, ) defaultManualCompletion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultManualCompletion", title="Extension field for ``defaultManualCompletion``.", ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Tracking/reporting assertion description", description=( "The description would be used by test engines for tracking and " "reporting purposes." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) direction: fhirtypes.CodeType | None = Field( default=None, alias="direction", title="response | request", description="The direction to use for the assertion.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["response", "request"], }, ) direction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_direction", title="Extension field for ``direction``." ) expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="The FHIRPath expression to be evaluated", description=( "The FHIRPath expression to be evaluated against the request or " "response message contents - HTTP headers and payload." ), json_schema_extra={ "element_property": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) headerField: fhirtypes.StringType | None = Field( default=None, alias="headerField", title="HTTP header field name", description="The HTTP header field name e.g. 'Location'.", json_schema_extra={ "element_property": True, }, ) headerField__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_headerField", title="Extension field for ``headerField``." ) label: fhirtypes.StringType | None = Field( default=None, alias="label", title="Tracking/logging assertion label", description="The label would be used for tracking/logging purposes by test engines.", json_schema_extra={ "element_property": True, }, ) label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_label", title="Extension field for ``label``." ) minimumId: fhirtypes.StringType | None = Field( default=None, alias="minimumId", title="Fixture Id of minimum content resource", description=( "The ID of a fixture. Asserts that the response contains at a minimum " "the fixture specified by minimumId." ), json_schema_extra={ "element_property": True, }, ) minimumId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_minimumId", title="Extension field for ``minimumId``." ) navigationLinks: bool | None = Field( default=None, alias="navigationLinks", title="Perform validation on navigation links?", description=( "Whether or not the test execution performs validation on the bundle " "navigation links." ), json_schema_extra={ "element_property": True, }, ) navigationLinks__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_navigationLinks", title="Extension field for ``navigationLinks``.", ) operator: fhirtypes.CodeType | None = Field( default=None, alias="operator", title=( "equals | notEquals | in | notIn | greaterThan | lessThan | empty | " "notEmpty | contains | notContains | eval | manualEval" ), description="The operator type defines the conditional behavior of the assert.", json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "equals", "notEquals", "in", "notIn", "greaterThan", "lessThan", "empty", "notEmpty", "contains", "notContains", "eval", "manualEval", ], }, ) operator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_operator", title="Extension field for ``operator``." ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="XPath or JSONPath expression", description=( "The XPath or JSONPath expression to be evaluated against the fixture " "representing the response received from server." ), json_schema_extra={ "element_property": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) requestMethod: fhirtypes.CodeType | None = Field( default=None, alias="requestMethod", title="delete | get | options | patch | post | put | head", description=( "The request method or HTTP operation code to compare against that used" " by the client system under test." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["delete", "get", "options", "patch", "post", "put", "head"], }, ) requestMethod__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requestMethod", title="Extension field for ``requestMethod``.", ) requestURL: fhirtypes.StringType | None = Field( default=None, alias="requestURL", title="Request URL comparison value", description="The value to use in a comparison against the request URL path string.", json_schema_extra={ "element_property": True, }, ) requestURL__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requestURL", title="Extension field for ``requestURL``." ) requirement: typing.List[ fhirtypes.TestScriptSetupActionAssertRequirementType ] | None = Field( default=None, alias="requirement", title="Links or references to the testing requirements", description=( "Links or references providing traceability to the testing requirements" " for this assert." ), json_schema_extra={ "element_property": True, }, ) resource: fhirtypes.UriType | None = Field( default=None, alias="resource", title="Resource type", description="The type of the resource. See the [resource list](resourcelist.html).", json_schema_extra={ "element_property": True, }, ) resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resource", title="Extension field for ``resource``." ) response: fhirtypes.CodeType | None = Field( default=None, alias="response", title=( "continue | switchingProtocols | okay | created | accepted | " "nonAuthoritativeInformation | noContent | resetContent | " "partialContent | multipleChoices | movedPermanently | found | seeOther" " | notModified | useProxy | temporaryRedirect | permanentRedirect | " "badRequest | unauthorized | paymentRequired | forbidden | notFound | " "methodNotAllowed | notAcceptable | proxyAuthenticationRequired | " "requestTimeout | conflict | gone | lengthRequired | preconditionFailed" " | contentTooLarge | uriTooLong | unsupportedMediaType | " "rangeNotSatisfiable | expectationFailed | misdirectedRequest | " "unprocessableContent | upgradeRequired | internalServerError | " "notImplemented | badGateway | serviceUnavailable | gatewayTimeout | " "httpVersionNotSupported" ), description=None, json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "continue", "switchingProtocols", "okay", "created", "accepted", "nonAuthoritativeInformation", "noContent", "resetContent", "partialContent", "multipleChoices", "movedPermanently", "found", "seeOther", "notModified", "useProxy", "temporaryRedirect", "permanentRedirect", "badRequest", "unauthorized", "paymentRequired", "forbidden", "notFound", "methodNotAllowed", "notAcceptable", "proxyAuthenticationRequired", "requestTimeout", "conflict", "gone", "lengthRequired", "preconditionFailed", "contentTooLarge", "uriTooLong", "unsupportedMediaType", "rangeNotSatisfiable", "expectationFailed", "misdirectedRequest", "unprocessableContent", "upgradeRequired", "internalServerError", "notImplemented", "badGateway", "serviceUnavailable", "gatewayTimeout", "httpVersionNotSupported", ], }, ) response__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_response", title="Extension field for ``response``." ) responseCode: fhirtypes.StringType | None = Field( default=None, alias="responseCode", title="HTTP response code to test", description="The value of the HTTP response code to be tested.", json_schema_extra={ "element_property": True, }, ) responseCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_responseCode", title="Extension field for ``responseCode``.", ) sourceId: fhirtypes.IdType | None = Field( default=None, alias="sourceId", title="Fixture Id of source expression or headerField", description=( "Fixture to evaluate the XPath/JSONPath expression or the headerField " "against." ), json_schema_extra={ "element_property": True, }, ) sourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceId", title="Extension field for ``sourceId``." ) stopTestOnFail: bool | None = Field( default=None, alias="stopTestOnFail", title="If this assert fails, will the current test execution stop?", description=( "Whether or not the current test execution will stop on failure for " "this assert." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) stopTestOnFail__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_stopTestOnFail", title="Extension field for ``stopTestOnFail``.", ) validateProfileId: fhirtypes.IdType | None = Field( default=None, alias="validateProfileId", title="Profile Id of validation profile reference", description="The ID of the Profile to validate against.", json_schema_extra={ "element_property": True, }, ) validateProfileId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_validateProfileId", title="Extension field for ``validateProfileId``.", ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The value to compare to", description=None, json_schema_extra={ "element_property": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) warningOnly: bool | None = Field( default=None, alias="warningOnly", title="Will this assert produce a warning only on error?", description=( "Whether or not the test execution will produce a warning only on error" " for this assert." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) warningOnly__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_warningOnly", title="Extension field for ``warningOnly``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptSetupActionAssert`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "label", "description", "direction", "compareToSourceId", "compareToSourceExpression", "compareToSourcePath", "contentType", "defaultManualCompletion", "expression", "headerField", "minimumId", "navigationLinks", "operator", "path", "requestMethod", "requestURL", "resource", "response", "responseCode", "sourceId", "stopTestOnFail", "validateProfileId", "value", "warningOnly", "requirement", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionAssert`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("stopTestOnFail", "stopTestOnFail__ext"), ("warningOnly", "warningOnly__ext"), ] return required_fields class TestScriptSetupActionAssertRequirement(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Links or references to the testing requirements. Links or references providing traceability to the testing requirements for this assert. """ __resource_type__ = "TestScriptSetupActionAssertRequirement" linkCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="linkCanonical", title="Link or reference to the testing requirement", description=( "Link or reference providing traceability to the testing requirement " "for this test." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e link[x] "one_of_many": "link", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Requirements"], }, ) linkCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_linkCanonical", title="Extension field for ``linkCanonical``.", ) linkUri: fhirtypes.UriType | None = Field( default=None, alias="linkUri", title="Link or reference to the testing requirement", description=( "Link or reference providing traceability to the testing requirement " "for this test." ), json_schema_extra={ "element_property": True, # Choice of Data Types. i.e link[x] "one_of_many": "link", "one_of_many_required": False, }, ) linkUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_linkUri", title="Extension field for ``linkUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptSetupActionAssertRequirement`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "linkUri", "linkCanonical"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionAssertRequirement`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = {"link": ["linkCanonical", "linkUri"]} return one_of_many_fields class TestScriptSetupActionOperation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. The setup operation to perform. The operation to perform. """ __resource_type__ = "TestScriptSetupActionOperation" accept: fhirtypes.CodeType | None = Field( default=None, alias="accept", title="Mime type to accept in the payload of the response, with charset etc", description="The mime-type to use for RESTful operation in the 'Accept' header.", json_schema_extra={ "element_property": True, }, ) accept__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_accept", title="Extension field for ``accept``." ) contentType: fhirtypes.CodeType | None = Field( default=None, alias="contentType", title="Mime type of the request payload contents, with charset etc", description=( "The mime-type to use for RESTful operation in the 'Content-Type' " "header." ), json_schema_extra={ "element_property": True, }, ) contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_contentType", title="Extension field for ``contentType``." ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Tracking/reporting operation description", description=( "The description would be used by test engines for tracking and " "reporting purposes." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) destination: fhirtypes.IntegerType | None = Field( default=None, alias="destination", title="Server responding to the request", description=( "The server where the request message is destined for. Must be one of " "the server numbers listed in TestScript.destination section." ), json_schema_extra={ "element_property": True, }, ) destination__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_destination", title="Extension field for ``destination``." ) encodeRequestUrl: bool | None = Field( default=None, alias="encodeRequestUrl", title="Whether or not to send the request url in encoded format", description=( "Whether or not to implicitly send the request url in encoded format. " "The default is true to match the standard RESTful client behavior. Set" " to false when communicating with a server that does not support " "encoded url paths." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) encodeRequestUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_encodeRequestUrl", title="Extension field for ``encodeRequestUrl``.", ) label: fhirtypes.StringType | None = Field( default=None, alias="label", title="Tracking/logging operation label", description="The label would be used for tracking/logging purposes by test engines.", json_schema_extra={ "element_property": True, }, ) label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_label", title="Extension field for ``label``." ) method: fhirtypes.CodeType | None = Field( default=None, alias="method", title="delete | get | options | patch | post | put | head", description=( "The HTTP method the test engine MUST use for this operation regardless" " of any other operation details." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["delete", "get", "options", "patch", "post", "put", "head"], }, ) method__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_method", title="Extension field for ``method``." ) origin: fhirtypes.IntegerType | None = Field( default=None, alias="origin", title="Server initiating the request", description=( "The server where the request message originates from. Must be one of " "the server numbers listed in TestScript.origin section." ), json_schema_extra={ "element_property": True, }, ) origin__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_origin", title="Extension field for ``origin``." ) params: fhirtypes.StringType | None = Field( default=None, alias="params", title="Explicitly defined path parameters", description=( "Path plus parameters after [type]. Used to set parts of the request " "URL explicitly." ), json_schema_extra={ "element_property": True, }, ) params__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_params", title="Extension field for ``params``." ) requestHeader: typing.List[ fhirtypes.TestScriptSetupActionOperationRequestHeaderType ] | None = Field( default=None, alias="requestHeader", title="Each operation can have one or more header elements", description="Header elements would be used to set HTTP headers.", json_schema_extra={ "element_property": True, }, ) requestId: fhirtypes.IdType | None = Field( default=None, alias="requestId", title="Fixture Id of mapped request", description="The fixture id (maybe new) to map to the request.", json_schema_extra={ "element_property": True, }, ) requestId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_requestId", title="Extension field for ``requestId``." ) resource: fhirtypes.UriType | None = Field( default=None, alias="resource", title="Resource type", description=( "The type of the FHIR resource. See the [resource " "list](resourcelist.html). Data type of uri is needed when non-HL7 " "artifacts are identified." ), json_schema_extra={ "element_property": True, }, ) resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_resource", title="Extension field for ``resource``." ) responseId: fhirtypes.IdType | None = Field( default=None, alias="responseId", title="Fixture Id of mapped response", description="The fixture id (maybe new) to map to the response.", json_schema_extra={ "element_property": True, }, ) responseId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_responseId", title="Extension field for ``responseId``." ) sourceId: fhirtypes.IdType | None = Field( default=None, alias="sourceId", title="Fixture Id of body for PUT and POST requests", description="The id of the fixture used as the body of a PUT or POST request.", json_schema_extra={ "element_property": True, }, ) sourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceId", title="Extension field for ``sourceId``." ) targetId: fhirtypes.IdType | None = Field( default=None, alias="targetId", title=( "Id of fixture used for extracting the [id], [type], and [vid] for GET" " requests" ), description=None, json_schema_extra={ "element_property": True, }, ) targetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_targetId", title="Extension field for ``targetId``." ) type: fhirtypes.CodingType | None = Field( default=None, alias="type", title="The operation code type that will be executed", description="Server interaction or operation type.", json_schema_extra={ "element_property": True, }, ) url: fhirtypes.StringType | None = Field( default=None, alias="url", title="Request URL", description="Complete request URL.", json_schema_extra={ "element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptSetupActionOperation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "resource", "label", "description", "accept", "contentType", "destination", "encodeRequestUrl", "method", "origin", "params", "requestHeader", "requestId", "responseId", "sourceId", "targetId", "url", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionOperation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("encodeRequestUrl", "encodeRequestUrl__ext")] return required_fields class TestScriptSetupActionOperationRequestHeader(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Each operation can have one or more header elements. Header elements would be used to set HTTP headers. """ __resource_type__ = "TestScriptSetupActionOperationRequestHeader" field: fhirtypes.StringType | None = Field( default=None, alias="field", title="HTTP header field name", description='The HTTP header field e.g. "Accept".', json_schema_extra={ "element_property": True, "element_required": True, }, ) field__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_field", title="Extension field for ``field``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="HTTP headerfield value", description='The value of the header e.g. "application/fhir+xml".', json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptSetupActionOperationRequestHeader`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "field", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionOperationRequestHeader`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("field", "field__ext"), ("value", "value__ext")] return required_fields class TestScriptTeardown(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A series of required clean up steps. A series of operations required to clean up after all the tests are executed (successfully or otherwise). """ __resource_type__ = "TestScriptTeardown" action: typing.List[fhirtypes.TestScriptTeardownActionType] = Field( default=..., alias="action", title="One or more teardown operations to perform", description="The teardown action will only contain an operation.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptTeardown`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "action"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptTeardown`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptTeardownAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. One or more teardown operations to perform. The teardown action will only contain an operation. """ __resource_type__ = "TestScriptTeardownAction" operation: fhirtypes.TestScriptSetupActionOperationType = Field( default=..., alias="operation", title="The teardown operation to perform", description="An operation would involve a REST request to a server.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptTeardownAction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "operation"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptTeardownAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptTest(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A test in this script. """ __resource_type__ = "TestScriptTest" action: typing.List[fhirtypes.TestScriptTestActionType] = Field( default=..., alias="action", title="A test operation or assert to perform", description="Action would contain either an operation or an assertion.", json_schema_extra={ "element_property": True, }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Tracking/reporting short description of the test", description=( "A short description of the test used by test engines for tracking and " "reporting purposes." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Tracking/logging name of this test", description=( "The name of this test used for tracking/logging purposes by test " "engines." ), json_schema_extra={ "element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptTest`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "name", "description", "action"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptTest`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptTestAction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A test operation or assert to perform. Action would contain either an operation or an assertion. """ __resource_type__ = "TestScriptTestAction" assert_fhir: fhirtypes.TestScriptSetupActionAssertType | None = Field( default=None, alias="assert", title="The setup assertion to perform", description=( "Evaluates the results of previous operations to determine if the " "server under test behaves appropriately." ), json_schema_extra={ "element_property": True, }, ) operation: fhirtypes.TestScriptSetupActionOperationType | None = Field( default=None, alias="operation", title="The setup operation to perform", description="An operation would involve a REST request to a server.", json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptTestAction`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "operation", "assert"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptTestAction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class TestScriptVariable(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Placeholder for evaluated elements. Variable is set based either on element value in response body or on header field value in the response headers. """ __resource_type__ = "TestScriptVariable" defaultValue: fhirtypes.StringType | None = Field( default=None, alias="defaultValue", title="Default, hard-coded, or user-defined value for this variable", description="A default, hard-coded, or user-defined value for this variable.", json_schema_extra={ "element_property": True, }, ) defaultValue__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_defaultValue", title="Extension field for ``defaultValue``.", ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Natural language description of the variable", description=( "A free text natural language description of the variable and its " "purpose." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) expression: fhirtypes.StringType | None = Field( default=None, alias="expression", title="The FHIRPath expression against the fixture body", description=( "The FHIRPath expression for a specific value to evaluate against the " "fixture body. When variables are defined, only one of either " "expression, headerField or path must be specified." ), json_schema_extra={ "element_property": True, }, ) expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_expression", title="Extension field for ``expression``." ) headerField: fhirtypes.StringType | None = Field( default=None, alias="headerField", title="HTTP header field name for source", description=( "Will be used to grab the HTTP header field value from the headers that" " sourceId is pointing to." ), json_schema_extra={ "element_property": True, }, ) headerField__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_headerField", title="Extension field for ``headerField``." ) hint: fhirtypes.StringType | None = Field( default=None, alias="hint", title="Hint help text for default value to enter", description=( "Displayable text string with hint help information to the user when " "entering a default value." ), json_schema_extra={ "element_property": True, }, ) hint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_hint", title="Extension field for ``hint``." ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Descriptive name for this variable", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) path: fhirtypes.StringType | None = Field( default=None, alias="path", title="XPath or JSONPath against the fixture body", description=( "XPath or JSONPath to evaluate against the fixture body. When " "variables are defined, only one of either expression, headerField or " "path must be specified." ), json_schema_extra={ "element_property": True, }, ) path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_path", title="Extension field for ``path``." ) sourceId: fhirtypes.IdType | None = Field( default=None, alias="sourceId", title="Fixture Id of source expression or headerField within this variable", description=( "Fixture to evaluate the XPath/JSONPath expression or the headerField " "against within this variable." ), json_schema_extra={ "element_property": True, }, ) sourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceId", title="Extension field for ``sourceId``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TestScriptVariable`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "defaultValue", "description", "expression", "headerField", "hint", "path", "sourceId", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TestScriptVariable`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields ================================================ FILE: fhir/resources/timing.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Timing Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backbonetype, element, fhirtypes class Timing(backbonetype.BackboneType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A timing schedule that specifies an event that may occur multiple times. Specifies an event that may occur multiple times. Timing schedules are used to record when things are planned, expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds, and may be used for reporting the schedule to which past regular activities were carried out. """ __resource_type__ = "Timing" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="C | BID | TID | QID | AM | PM | QD | QOD | +", description=( "A code for the timing schedule (or just text in code.text). Some codes" " such as BID are ubiquitous, but many institutions define their own " "additional codes. If a code is provided, the code is understood to be " "a complete statement of whatever is specified in the structured timing" " data, and either the code or the data may be used to interpret the " "Timing, with the exception that .repeat.bounds still applies over the " "code (and is not contained in the code)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) event: typing.List[fhirtypes.DateTimeType | None] | None = Field( default=None, alias="event", title="When the event occurs", description="Identifies specific times when the event occurs.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) event__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_event", title="Extension field for ``event``." ) repeat: fhirtypes.TimingRepeatType | None = Field( default=None, alias="repeat", title="When the event is to occur", description="A set of rules that describe when the event is scheduled.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Timing`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "event", "repeat", "code"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Timing`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "event", "repeat", "code"] class TimingRepeat(element.Element): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. When the event is to occur. A set of rules that describe when the event is scheduled. """ __resource_type__ = "TimingRepeat" boundsDuration: fhirtypes.DurationType | None = Field( default=None, alias="boundsDuration", title="Length/Range of lengths, or (Start and/or end) limits", description=( "Either a duration for the length of the timing schedule, a range of " "possible length, or outer bounds for start and/or end limits of the " "timing schedule." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e bounds[x] "one_of_many": "bounds", "one_of_many_required": False, }, ) boundsPeriod: fhirtypes.PeriodType | None = Field( default=None, alias="boundsPeriod", title="Length/Range of lengths, or (Start and/or end) limits", description=( "Either a duration for the length of the timing schedule, a range of " "possible length, or outer bounds for start and/or end limits of the " "timing schedule." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e bounds[x] "one_of_many": "bounds", "one_of_many_required": False, }, ) boundsRange: fhirtypes.RangeType | None = Field( default=None, alias="boundsRange", title="Length/Range of lengths, or (Start and/or end) limits", description=( "Either a duration for the length of the timing schedule, a range of " "possible length, or outer bounds for start and/or end limits of the " "timing schedule." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e bounds[x] "one_of_many": "bounds", "one_of_many_required": False, }, ) count: fhirtypes.PositiveIntType | None = Field( default=None, alias="count", title="Number of times to repeat", description=( "A total count of the desired number of repetitions across the duration" " of the entire timing specification. If countMax is present, this " "element indicates the lower bound of the allowed range of count " "values." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_count", title="Extension field for ``count``." ) countMax: fhirtypes.PositiveIntType | None = Field( default=None, alias="countMax", title="Maximum number of times to repeat", description=( "If present, indicates that the count is a range - so to perform the " "action between [count] and [countMax] times." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) countMax__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_countMax", title="Extension field for ``countMax``." ) dayOfWeek: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="dayOfWeek", title="mon | tue | wed | thu | fri | sat | sun", description=( "If one or more days of week is provided, then the action happens only " "on the specified day(s)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], }, ) dayOfWeek__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_dayOfWeek", title="Extension field for ``dayOfWeek``." ) duration: fhirtypes.DecimalType | None = Field( default=None, alias="duration", title="How long when it happens", description=( "How long this thing happens for when it happens. If durationMax is " "present, this element indicates the lower bound of the allowed range " "of the duration." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) duration__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_duration", title="Extension field for ``duration``." ) durationMax: fhirtypes.DecimalType | None = Field( default=None, alias="durationMax", title="How long when it happens (Max)", description=( "If present, indicates that the duration is a range - so to perform the" " action between [duration] and [durationMax] time length." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) durationMax__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_durationMax", title="Extension field for ``durationMax``." ) durationUnit: fhirtypes.CodeType | None = Field( default=None, alias="durationUnit", title="s | min | h | d | wk | mo | a - unit of time (UCUM)", description=( "The units of time for the duration, in UCUM units Normal practice is " "to use the 'mo' code as a calendar month when calculating the next " "occurrence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["s", "min", "h", "d", "wk", "mo", "a"], }, ) durationUnit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_durationUnit", title="Extension field for ``durationUnit``.", ) frequency: fhirtypes.PositiveIntType | None = Field( default=None, alias="frequency", title=( "Indicates the number of repetitions that should occur within a period." " I.e. Event occurs frequency times per period" ), description=( "The number of times to repeat the action within the specified period. " "If frequencyMax is present, this element indicates the lower bound of " "the allowed range of the frequency." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) frequency__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_frequency", title="Extension field for ``frequency``." ) frequencyMax: fhirtypes.PositiveIntType | None = Field( default=None, alias="frequencyMax", title="Event occurs up to frequencyMax times per period", description=( "If present, indicates that the frequency is a range - so to repeat " "between [frequency] and [frequencyMax] times within the period or " "period range." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) frequencyMax__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_frequencyMax", title="Extension field for ``frequencyMax``.", ) offset: fhirtypes.UnsignedIntType | None = Field( default=None, alias="offset", title="Minutes from event (before or after)", description=( "The number of minutes from the event. If the event code does not " "indicate whether the minutes is before or after the event, then the " "offset is assumed to be after the event." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) offset__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_offset", title="Extension field for ``offset``." ) period: fhirtypes.DecimalType | None = Field( default=None, alias="period", title=( "The duration to which the frequency applies. I.e. Event occurs " "frequency times per period" ), description=( "Indicates the duration of time over which repetitions are to occur; " 'e.g. to express "3 times per day", 3 would be the frequency and "1 ' 'day" would be the period. If periodMax is present, this element ' "indicates the lower bound of the allowed range of the period length." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) period__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_period", title="Extension field for ``period``." ) periodMax: fhirtypes.DecimalType | None = Field( default=None, alias="periodMax", title="Upper limit of period (3-4 hours)", description=( "If present, indicates that the period is a range from [period] to " '[periodMax], allowing expressing concepts such as "do this once every ' "3-5 days." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) periodMax__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_periodMax", title="Extension field for ``periodMax``." ) periodUnit: fhirtypes.CodeType | None = Field( default=None, alias="periodUnit", title="s | min | h | d | wk | mo | a - unit of time (UCUM)", description=( "The units of time for the period in UCUM units Normal practice is to " "use the 'mo' code as a calendar month when calculating the next " "occurrence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["s", "min", "h", "d", "wk", "mo", "a"], }, ) periodUnit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_periodUnit", title="Extension field for ``periodUnit``." ) timeOfDay: typing.List[fhirtypes.TimeType | None] | None = Field( default=None, alias="timeOfDay", title="Time of day for action", description="Specified time of day for action to take place.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) timeOfDay__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_timeOfDay", title="Extension field for ``timeOfDay``." ) when: typing.List[fhirtypes.CodeType | None] | None = Field( default=None, alias="when", title="Code for time period of occurrence", description=( "An approximate time period during the day, potentially linked to an " "event of daily living that indicates when the action should occur." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) when__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field( default=None, alias="_when", title="Extension field for ``when``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TimingRepeat`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "boundsDuration", "boundsRange", "boundsPeriod", "count", "countMax", "duration", "durationMax", "durationUnit", "frequency", "frequencyMax", "period", "periodMax", "periodUnit", "dayOfWeek", "timeOfDay", "when", "offset", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TimingRepeat`` according to specification, with preserving the original sequence order. """ return [ "boundsDuration", "boundsRange", "boundsPeriod", "count", "countMax", "duration", "durationMax", "durationUnit", "frequency", "frequencyMax", "period", "periodMax", "periodUnit", "dayOfWeek", "timeOfDay", "when", "offset", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "bounds": ["boundsDuration", "boundsPeriod", "boundsRange"] } return one_of_many_fields ================================================ FILE: fhir/resources/transport.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/Transport Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Transport(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Delivery of item. Record of transport of item. """ __resource_type__ = "Transport" authoredOn: fhirtypes.DateTimeType | None = Field( default=None, alias="authoredOn", title="Transport Creation Date", description="The date and time this transport was created.", json_schema_extra={ "element_property": True, }, ) authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_authoredOn", title="Extension field for ``authoredOn``." ) basedOn: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="basedOn", title="Request fulfilled by this transport", description=( "BasedOn refers to a higher-level authorization that triggered the " 'creation of the transport. It references a "request" resource such as' ' a ServiceRequest or Transport, which is distinct from the "request" ' "resource the Transport is seeking to fulfill. This latter resource is" " referenced by FocusOn. For example, based on a ServiceRequest (= " "BasedOn), a transport is created to fulfill a procedureRequest ( = " "FocusOn ) to transport a specimen to the lab." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Transport Type", description=( "A name or code (or both) briefly describing what the transport " "involves." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) completionTime: fhirtypes.DateTimeType | None = Field( default=None, alias="completionTime", title="Completion time of the event (the occurrence)", description="Identifies the completion time of the event (the occurrence).", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) completionTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_completionTime", title="Extension field for ``completionTime``.", ) currentLocation: fhirtypes.ReferenceType = Field( default=..., alias="currentLocation", title="The entity current location", description="The current location for the entity to be transported.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) description: fhirtypes.StringType | None = Field( default=None, alias="description", title="Human-readable explanation of transport", description="A free-text description of what is to be performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Healthcare event during which this transport originated", description=( "The healthcare event (e.g. a patient and healthcare provider " "interaction) during which this transport was created." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) focus: fhirtypes.ReferenceType | None = Field( default=None, alias="focus", title="What transport is acting on", description=( "The request being actioned or the resource being manipulated by this " "transport." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) for_fhir: fhirtypes.ReferenceType | None = Field( default=None, alias="for", title="Beneficiary of the Transport", description=( "The entity who benefits from the performance of the service specified " "in the transport (e.g., the patient)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) groupIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="groupIdentifier", title="Requisition or grouper id", description=( "A shared identifier common to multiple independent Request instances " "that were activated/authorized more or less simultaneously by a single" " author. The presence of the same identifier on each request ties " "those requests together and may have business ramifications in terms " "of reporting of results, billing, etc. E.g. a requisition number " "shared by a set of lab tests ordered together, or a prescription " "number shared by all meds ordered at one time." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) history: fhirtypes.ReferenceType | None = Field( default=None, alias="history", title="Parent (or preceding) transport", description="The transport event prior to this one.", json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Transport"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="External identifier", description=( "Identifier for the transport event that is used to identify it across " "multiple disparate systems." ), json_schema_extra={ "element_property": True, }, ) input: typing.List[fhirtypes.TransportInputType] | None = Field( default=None, alias="input", title="Information used to perform transport", description=( "Additional information that may be needed in the execution of the " "transport." ), json_schema_extra={ "element_property": True, }, ) instantiatesCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="instantiatesCanonical", title="Formal definition of transport", description=( "The URL pointing to a *FHIR*-defined protocol, guideline, orderset or " "other definition that is adhered to in whole or in part by this " "Transport." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ActivityDefinition"], }, ) instantiatesCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instantiatesCanonical", title="Extension field for ``instantiatesCanonical``.", ) instantiatesUri: fhirtypes.UriType | None = Field( default=None, alias="instantiatesUri", title="Formal definition of transport", description=( "The URL pointing to an *externally* maintained protocol, guideline, " "orderset or other definition that is adhered to in whole or in part by" " this Transport." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) instantiatesUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_instantiatesUri", title="Extension field for ``instantiatesUri``.", ) insurance: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="insurance", title="Associated insurance coverage", description=( "Insurance plans, coverage extensions, pre-authorizations and/or pre-" "determinations that may be relevant to the Transport." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Coverage", "ClaimResponse"], }, ) intent: fhirtypes.CodeType | None = Field( default=None, alias="intent", title=( "unknown | proposal | plan | order | original-order | reflex-order | " "filler-order | instance-order | option" ), description=( 'Indicates the "level" of actionability associated with the Transport, ' "i.e. i+R[9]Cs this a proposed transport, a planned transport, an " "actionable transport, etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "unknown", "proposal", "plan", "order", "original-order", "reflex-order", "filler-order", "instance-order", "option", ], }, ) intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_intent", title="Extension field for ``intent``." ) lastModified: fhirtypes.DateTimeType | None = Field( default=None, alias="lastModified", title="Transport Last Modified Date", description="The date and time of last modification to this transport.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastModified__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastModified", title="Extension field for ``lastModified``.", ) location: fhirtypes.ReferenceType | None = Field( default=None, alias="location", title="Where transport occurs", description="Principal physical location where this transport is performed.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Comments made about the transport", description="Free-text information captured about the transport as it progresses.", json_schema_extra={ "element_property": True, }, ) output: typing.List[fhirtypes.TransportOutputType] | None = Field( default=None, alias="output", title="Information produced as part of transport", description="Outputs produced by the Transport.", json_schema_extra={ "element_property": True, }, ) owner: fhirtypes.ReferenceType | None = Field( default=None, alias="owner", title="Responsible individual", description=( "Individual organization or Device currently responsible for transport " "execution." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", "CareTeam", "HealthcareService", "Patient", "Device", "RelatedPerson", ], }, ) partOf: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="partOf", title="Part of referenced event", description="A larger event of which this particular event is a component or step.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Transport"], }, ) performerType: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="performerType", title="Requested performer", description="The kind of participant that should perform the transport.", json_schema_extra={ "element_property": True, }, ) priority: fhirtypes.CodeType | None = Field( default=None, alias="priority", title="routine | urgent | asap | stat", description=( "Indicates how quickly the Transport should be addressed with respect " "to other requests." ), json_schema_extra={ "element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["routine", "urgent", "asap", "stat"], }, ) priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_priority", title="Extension field for ``priority``." ) reason: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="reason", title="Why transport is needed", description=( "A resource reference indicating why this transport needs to be " "performed." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="relevantHistory", title="Key events in history of the Transport", description=( "Links to Provenance records for past versions of this Transport that " "identify key state transitions or updates that are likely to be " "relevant to a user looking at the current version of the transport." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Provenance"], }, ) requestedLocation: fhirtypes.ReferenceType = Field( default=..., alias="requestedLocation", title="The desired location", description="The desired or final location for the transport.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Location"], }, ) requester: fhirtypes.ReferenceType | None = Field( default=None, alias="requester", title="Who is asking for transport to be done", description="The creator of the transport.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Device", "Organization", "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", ], }, ) restriction: fhirtypes.TransportRestrictionType | None = Field( default=None, alias="restriction", title="Constraints on fulfillment transports", description=( "If the Transport.focus is a request resource and the transport is " "seeking fulfillment (i.e. is asking for the request to be actioned), " "this element identifies any limitations on what parts of the " "referenced request should be actioned." ), json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "in-progress | completed | abandoned | cancelled | planned | entered-" "in-error" ), description="A code specifying the state of the transport event.", json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "in-progress", "completed", "abandoned", "cancelled", "planned", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusReason: fhirtypes.CodeableConceptType | None = Field( default=None, alias="statusReason", title="Reason for current status", description=( "An explanation as to why this transport is held, failed, was refused, " "etc." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``Transport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "instantiatesCanonical", "instantiatesUri", "basedOn", "groupIdentifier", "partOf", "status", "statusReason", "intent", "priority", "code", "description", "focus", "for", "encounter", "completionTime", "authoredOn", "lastModified", "requester", "performerType", "owner", "location", "insurance", "note", "relevantHistory", "restriction", "input", "output", "requestedLocation", "currentLocation", "reason", "history", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``Transport`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "instantiatesCanonical", "instantiatesUri", "basedOn", "groupIdentifier", "partOf", "status", "statusReason", "intent", "code", "description", "focus", "for", "encounter", "completionTime", "lastModified", "requester", "owner", "location", "requestedLocation", "currentLocation", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("intent", "intent__ext")] return required_fields class TransportInput(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information used to perform transport. Additional information that may be needed in the execution of the transport. """ __resource_type__ = "TransportInput" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Label for the input", description=( "A code or description indicating how the input is intended to be used " "as part of the transport execution." ), json_schema_extra={ "element_property": True, }, ) valueAddress: fhirtypes.AddressType | None = Field( default=None, alias="valueAddress", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAge: fhirtypes.AgeType | None = Field( default=None, alias="valueAge", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="valueAnnotation", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAvailability: fhirtypes.AvailabilityType | None = Field( default=None, alias="valueAvailability", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="valueBase64Binary", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBase64Binary", title="Extension field for ``valueBase64Binary``.", ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="valueCanonical", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCanonical", title="Extension field for ``valueCanonical``.", ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCodeableReference: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="valueCodeableReference", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueContactDetail: fhirtypes.ContactDetailType | None = Field( default=None, alias="valueContactDetail", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="valueContactPoint", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCount: fhirtypes.CountType | None = Field( default=None, alias="valueCount", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDataRequirement: fhirtypes.DataRequirementType | None = Field( default=None, alias="valueDataRequirement", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueDistance: fhirtypes.DistanceType | None = Field( default=None, alias="valueDistance", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDosage: fhirtypes.DosageType | None = Field( default=None, alias="valueDosage", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDuration: fhirtypes.DurationType | None = Field( default=None, alias="valueDuration", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueExpression: fhirtypes.ExpressionType | None = Field( default=None, alias="valueExpression", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueExtendedContactDetail: fhirtypes.ExtendedContactDetailType | None = Field( default=None, alias="valueExtendedContactDetail", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="valueHumanName", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId: fhirtypes.IdType | None = Field( default=None, alias="valueId", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueId", title="Extension field for ``valueId``." ) valueIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="valueIdentifier", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInstant: fhirtypes.InstantType | None = Field( default=None, alias="valueInstant", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInstant", title="Extension field for ``valueInstant``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueInteger64: fhirtypes.Integer64Type | None = Field( default=None, alias="valueInteger64", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger64__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger64", title="Extension field for ``valueInteger64``.", ) valueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="valueMarkdown", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueMarkdown", title="Extension field for ``valueMarkdown``.", ) valueMeta: fhirtypes.MetaType | None = Field( default=None, alias="valueMeta", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueMoney: fhirtypes.MoneyType | None = Field( default=None, alias="valueMoney", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueOid: fhirtypes.OidType | None = Field( default=None, alias="valueOid", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueOid", title="Extension field for ``valueOid``." ) valueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field( default=None, alias="valueParameterDefinition", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="valuePositiveInt", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valuePositiveInt", title="Extension field for ``valuePositiveInt``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRatioRange: fhirtypes.RatioRangeType | None = Field( default=None, alias="valueRatioRange", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field( default=None, alias="valueRelatedArtifact", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="valueSampledData", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueSignature: fhirtypes.SignatureType | None = Field( default=None, alias="valueSignature", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) valueTiming: fhirtypes.TimingType | None = Field( default=None, alias="valueTiming", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field( default=None, alias="valueTriggerDefinition", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="valueUnsignedInt", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUnsignedInt", title="Extension field for ``valueUnsignedInt``.", ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) valueUrl: fhirtypes.UrlType | None = Field( default=None, alias="valueUrl", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUrl", title="Extension field for ``valueUrl``." ) valueUsageContext: fhirtypes.UsageContextType | None = Field( default=None, alias="valueUsageContext", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUuid: fhirtypes.UuidType | None = Field( default=None, alias="valueUuid", title="Content to use in performing the transport", description="The value of the input parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUuid", title="Extension field for ``valueUuid``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TransportInput`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInstant", "valueInteger", "valueInteger64", "valueMarkdown", "valueOid", "valuePositiveInt", "valueString", "valueTime", "valueUnsignedInt", "valueUri", "valueUrl", "valueUuid", "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueCodeableConcept", "valueCodeableReference", "valueCoding", "valueContactPoint", "valueCount", "valueDistance", "valueDuration", "valueHumanName", "valueIdentifier", "valueMoney", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueRatioRange", "valueReference", "valueSampledData", "valueSignature", "valueTiming", "valueContactDetail", "valueDataRequirement", "valueExpression", "valueParameterDefinition", "valueRelatedArtifact", "valueTriggerDefinition", "valueUsageContext", "valueAvailability", "valueExtendedContactDetail", "valueDosage", "valueMeta", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TransportInput`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueAvailability", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueCodeableConcept", "valueCodeableReference", "valueCoding", "valueContactDetail", "valueContactPoint", "valueCount", "valueDataRequirement", "valueDate", "valueDateTime", "valueDecimal", "valueDistance", "valueDosage", "valueDuration", "valueExpression", "valueExtendedContactDetail", "valueHumanName", "valueId", "valueIdentifier", "valueInstant", "valueInteger", "valueInteger64", "valueMarkdown", "valueMeta", "valueMoney", "valueOid", "valueParameterDefinition", "valuePeriod", "valuePositiveInt", "valueQuantity", "valueRange", "valueRatio", "valueRatioRange", "valueReference", "valueRelatedArtifact", "valueSampledData", "valueSignature", "valueString", "valueTime", "valueTiming", "valueTriggerDefinition", "valueUnsignedInt", "valueUri", "valueUrl", "valueUsageContext", "valueUuid", ] } return one_of_many_fields class TransportOutput(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information produced as part of transport. Outputs produced by the Transport. """ __resource_type__ = "TransportOutput" type: fhirtypes.CodeableConceptType = Field( default=..., alias="type", title="Label for output", description="The name of the Output parameter.", json_schema_extra={ "element_property": True, }, ) valueAddress: fhirtypes.AddressType | None = Field( default=None, alias="valueAddress", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAge: fhirtypes.AgeType | None = Field( default=None, alias="valueAge", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAnnotation: fhirtypes.AnnotationType | None = Field( default=None, alias="valueAnnotation", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAttachment: fhirtypes.AttachmentType | None = Field( default=None, alias="valueAttachment", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueAvailability: fhirtypes.AvailabilityType | None = Field( default=None, alias="valueAvailability", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary: fhirtypes.Base64BinaryType | None = Field( default=None, alias="valueBase64Binary", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBase64Binary", title="Extension field for ``valueBase64Binary``.", ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCanonical: fhirtypes.CanonicalType | None = Field( default=None, alias="valueCanonical", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCanonical", title="Extension field for ``valueCanonical``.", ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCodeableReference: fhirtypes.CodeableReferenceType | None = Field( default=None, alias="valueCodeableReference", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueContactDetail: fhirtypes.ContactDetailType | None = Field( default=None, alias="valueContactDetail", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="valueContactPoint", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCount: fhirtypes.CountType | None = Field( default=None, alias="valueCount", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDataRequirement: fhirtypes.DataRequirementType | None = Field( default=None, alias="valueDataRequirement", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate: fhirtypes.DateType | None = Field( default=None, alias="valueDate", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDate", title="Extension field for ``valueDate``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueDistance: fhirtypes.DistanceType | None = Field( default=None, alias="valueDistance", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDosage: fhirtypes.DosageType | None = Field( default=None, alias="valueDosage", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDuration: fhirtypes.DurationType | None = Field( default=None, alias="valueDuration", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueExpression: fhirtypes.ExpressionType | None = Field( default=None, alias="valueExpression", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueExtendedContactDetail: fhirtypes.ExtendedContactDetailType | None = Field( default=None, alias="valueExtendedContactDetail", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueHumanName: fhirtypes.HumanNameType | None = Field( default=None, alias="valueHumanName", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId: fhirtypes.IdType | None = Field( default=None, alias="valueId", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueId", title="Extension field for ``valueId``." ) valueIdentifier: fhirtypes.IdentifierType | None = Field( default=None, alias="valueIdentifier", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInstant: fhirtypes.InstantType | None = Field( default=None, alias="valueInstant", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInstant", title="Extension field for ``valueInstant``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueInteger64: fhirtypes.Integer64Type | None = Field( default=None, alias="valueInteger64", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger64__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger64", title="Extension field for ``valueInteger64``.", ) valueMarkdown: fhirtypes.MarkdownType | None = Field( default=None, alias="valueMarkdown", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueMarkdown", title="Extension field for ``valueMarkdown``.", ) valueMeta: fhirtypes.MetaType | None = Field( default=None, alias="valueMeta", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueMoney: fhirtypes.MoneyType | None = Field( default=None, alias="valueMoney", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueOid: fhirtypes.OidType | None = Field( default=None, alias="valueOid", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueOid", title="Extension field for ``valueOid``." ) valueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field( default=None, alias="valueParameterDefinition", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="valuePeriod", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePositiveInt: fhirtypes.PositiveIntType | None = Field( default=None, alias="valuePositiveInt", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valuePositiveInt", title="Extension field for ``valuePositiveInt``.", ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRatio: fhirtypes.RatioType | None = Field( default=None, alias="valueRatio", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRatioRange: fhirtypes.RatioRangeType | None = Field( default=None, alias="valueRatioRange", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field( default=None, alias="valueRelatedArtifact", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueSampledData: fhirtypes.SampledDataType | None = Field( default=None, alias="valueSampledData", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueSignature: fhirtypes.SignatureType | None = Field( default=None, alias="valueSignature", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueTime: fhirtypes.TimeType | None = Field( default=None, alias="valueTime", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueTime", title="Extension field for ``valueTime``." ) valueTiming: fhirtypes.TimingType | None = Field( default=None, alias="valueTiming", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field( default=None, alias="valueTriggerDefinition", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field( default=None, alias="valueUnsignedInt", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUnsignedInt", title="Extension field for ``valueUnsignedInt``.", ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) valueUrl: fhirtypes.UrlType | None = Field( default=None, alias="valueUrl", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUrl", title="Extension field for ``valueUrl``." ) valueUsageContext: fhirtypes.UsageContextType | None = Field( default=None, alias="valueUsageContext", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUuid: fhirtypes.UuidType | None = Field( default=None, alias="valueUuid", title="Result of output", description="The value of the Output parameter as a basic type.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUuid", title="Extension field for ``valueUuid``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TransportOutput`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "type", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueDate", "valueDateTime", "valueDecimal", "valueId", "valueInstant", "valueInteger", "valueInteger64", "valueMarkdown", "valueOid", "valuePositiveInt", "valueString", "valueTime", "valueUnsignedInt", "valueUri", "valueUrl", "valueUuid", "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueCodeableConcept", "valueCodeableReference", "valueCoding", "valueContactPoint", "valueCount", "valueDistance", "valueDuration", "valueHumanName", "valueIdentifier", "valueMoney", "valuePeriod", "valueQuantity", "valueRange", "valueRatio", "valueRatioRange", "valueReference", "valueSampledData", "valueSignature", "valueTiming", "valueContactDetail", "valueDataRequirement", "valueExpression", "valueParameterDefinition", "valueRelatedArtifact", "valueTriggerDefinition", "valueUsageContext", "valueAvailability", "valueExtendedContactDetail", "valueDosage", "valueMeta", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TransportOutput`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueAddress", "valueAge", "valueAnnotation", "valueAttachment", "valueAvailability", "valueBase64Binary", "valueBoolean", "valueCanonical", "valueCode", "valueCodeableConcept", "valueCodeableReference", "valueCoding", "valueContactDetail", "valueContactPoint", "valueCount", "valueDataRequirement", "valueDate", "valueDateTime", "valueDecimal", "valueDistance", "valueDosage", "valueDuration", "valueExpression", "valueExtendedContactDetail", "valueHumanName", "valueId", "valueIdentifier", "valueInstant", "valueInteger", "valueInteger64", "valueMarkdown", "valueMeta", "valueMoney", "valueOid", "valueParameterDefinition", "valuePeriod", "valuePositiveInt", "valueQuantity", "valueRange", "valueRatio", "valueRatioRange", "valueReference", "valueRelatedArtifact", "valueSampledData", "valueSignature", "valueString", "valueTime", "valueTiming", "valueTriggerDefinition", "valueUnsignedInt", "valueUri", "valueUrl", "valueUsageContext", "valueUuid", ] } return one_of_many_fields class TransportRestriction(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Constraints on fulfillment transports. If the Transport.focus is a request resource and the transport is seeking fulfillment (i.e. is asking for the request to be actioned), this element identifies any limitations on what parts of the referenced request should be actioned. """ __resource_type__ = "TransportRestriction" period: fhirtypes.PeriodType | None = Field( default=None, alias="period", title="When fulfillment sought", description="Over what time-period is fulfillment sought.", json_schema_extra={ "element_property": True, }, ) recipient: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="recipient", title="For whom is fulfillment sought?", description=( "For requests that are targeted to more than one potential " "recipient/target, to identify who is fulfillment is sought for." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Group", "Organization", ], }, ) repetitions: fhirtypes.PositiveIntType | None = Field( default=None, alias="repetitions", title="How many times to repeat", description="Indicates the number of times the requested action should occur.", json_schema_extra={ "element_property": True, }, ) repetitions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_repetitions", title="Extension field for ``repetitions``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TransportRestriction`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "repetitions", "period", "recipient", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TransportRestriction`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/triggerdefinition.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/TriggerDefinition Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class TriggerDefinition(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Defines an expected trigger for a module. A description of a triggering event. Triggering events can be named events, data events, or periodic, as determined by the type element. """ __resource_type__ = "TriggerDefinition" code: fhirtypes.CodeableConceptType | None = Field( default=None, alias="code", title="Coded definition of the event", description="A code that identifies the event.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) condition: fhirtypes.ExpressionType | None = Field( default=None, alias="condition", title="Whether the event triggers (boolean expression)", description=( "A boolean-valued expression that is evaluated in the context of the " "container of the trigger definition and returns whether or not the " "trigger fires." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) data: typing.List[fhirtypes.DataRequirementType] | None = Field( default=None, alias="data", title="Triggering data of the event (multiple = 'and')", description=( "The triggering data of the event (if this is a data trigger). If more " "than one data is requirement is specified, then all the data " "requirements must be true." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name or URI that identifies the event", description=( "A formal name for the event. This may be an absolute URI that " "identifies the event formally (e.g. from a trigger registry), or a " "simple relative URI that identifies the event in a local context." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) subscriptionTopic: fhirtypes.CanonicalType | None = Field( default=None, alias="subscriptionTopic", title="What event", description=( "A reference to a SubscriptionTopic resource that defines the event. If" " this element is provided, no other information about the trigger " "definition may be supplied." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["SubscriptionTopic"], }, ) subscriptionTopic__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_subscriptionTopic", title="Extension field for ``subscriptionTopic``.", ) timingDate: fhirtypes.DateType | None = Field( default=None, alias="timingDate", title="Timing of the event", description="The timing of the event (if this is a periodic trigger).", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timingDate", title="Extension field for ``timingDate``." ) timingDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="timingDateTime", title="Timing of the event", description="The timing of the event (if this is a periodic trigger).", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) timingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timingDateTime", title="Extension field for ``timingDateTime``.", ) timingReference: fhirtypes.ReferenceType | None = Field( default=None, alias="timingReference", title="Timing of the event", description="The timing of the event (if this is a periodic trigger).", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Schedule"], }, ) timingTiming: fhirtypes.TimingType | None = Field( default=None, alias="timingTiming", title="Timing of the event", description="The timing of the event (if this is a periodic trigger).", json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e timing[x] "one_of_many": "timing", "one_of_many_required": False, }, ) type: fhirtypes.CodeType | None = Field( default=None, alias="type", title=( "named-event | periodic | data-changed | data-added | data-modified | " "data-removed | data-accessed | data-access-ended" ), description="The type of triggering event.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "named-event", "periodic", "data-changed", "data-added", "data-modified", "data-removed", "data-accessed", "data-access-ended", ], }, ) type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_type", title="Extension field for ``type``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``TriggerDefinition`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "type", "name", "code", "subscriptionTopic", "timingTiming", "timingReference", "timingDate", "timingDateTime", "data", "condition", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``TriggerDefinition`` according to specification, with preserving the original sequence order. """ return [ "type", "name", "code", "subscriptionTopic", "timingTiming", "timingReference", "timingDate", "timingDateTime", "data", "condition", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("type", "type__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "timing": [ "timingDate", "timingDateTime", "timingReference", "timingTiming", ] } return one_of_many_fields ================================================ FILE: fhir/resources/usagecontext.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/UsageContext Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class UsageContext(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Describes the context of use for a conformance or knowledge resource. Specifies clinical/business/etc. metadata that can be used to retrieve, index and/or categorize an artifact. This metadata can either be specific to the applicable population (e.g., age category, DRG) or the specific context of care (e.g., venue, care setting, provider of care). """ __resource_type__ = "UsageContext" code: fhirtypes.CodingType = Field( default=..., alias="code", title="Type of context being specified", description=( "A code that identifies the type of context being specified by this " "usage context." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field( default=None, alias="valueCodeableConcept", title="Value that defines the context", description=( "A value that defines the context specified in this context of use. The" " interpretation of the value is defined by the code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueQuantity: fhirtypes.QuantityType | None = Field( default=None, alias="valueQuantity", title="Value that defines the context", description=( "A value that defines the context specified in this context of use. The" " interpretation of the value is defined by the code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueRange: fhirtypes.RangeType | None = Field( default=None, alias="valueRange", title="Value that defines the context", description=( "A value that defines the context specified in this context of use. The" " interpretation of the value is defined by the code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueReference: fhirtypes.ReferenceType | None = Field( default=None, alias="valueReference", title="Value that defines the context", description=( "A value that defines the context specified in this context of use. The" " interpretation of the value is defined by the code." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "PlanDefinition", "ResearchStudy", "InsurancePlan", "HealthcareService", "Group", "Location", "Organization", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``UsageContext`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "code", "valueCodeableConcept", "valueQuantity", "valueRange", "valueReference", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``UsageContext`` according to specification, with preserving the original sequence order. """ return [ "code", "valueCodeableConcept", "valueQuantity", "valueRange", "valueReference", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueCodeableConcept", "valueQuantity", "valueRange", "valueReference", ] } return one_of_many_fields ================================================ FILE: fhir/resources/valueset.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/ValueSet Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class ValueSet(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A set of codes drawn from one or more code systems. A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [CodeSystem](codesystem.html) definitions and their use in [coded elements](terminologies.html). """ __resource_type__ = "ValueSet" approvalDate: fhirtypes.DateType | None = Field( default=None, alias="approvalDate", title="When the ValueSet was approved by publisher", description=( "The date on which the resource content was approved by the publisher. " "Approval happens once when the content is officially approved for " "usage." ), json_schema_extra={ "element_property": True, }, ) approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_approvalDate", title="Extension field for ``approvalDate``.", ) author: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="author", title="Who authored the ValueSet", description=( "An individiual or organization primarily involved in the creation and " "maintenance of the ValueSet." ), json_schema_extra={ "element_property": True, }, ) compose: fhirtypes.ValueSetComposeType | None = Field( default=None, alias="compose", title="Content logical definition of the value set (CLD)", description=( "A set of criteria that define the contents of the value set by " "including or excluding codes selected from the specified code " "system(s) that the value set draws from. This is also known as the " "Content Logical Definition (CLD)." ), json_schema_extra={ "element_property": True, }, ) contact: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="contact", title="Contact details for the publisher", description=( "Contact details to assist a user in finding and communicating with the" " publisher." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) copyright: fhirtypes.MarkdownType | None = Field( default=None, alias="copyright", title="Use and/or publishing restrictions", description=( "A copyright statement relating to the value set and/or its contents. " "Copyright statements are generally legal restrictions on the use and " "publishing of the value set." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) copyrightLabel: fhirtypes.StringType | None = Field( default=None, alias="copyrightLabel", title="Copyright holder and year(s)", description=( "A short string (<50 characters), suitable for inclusion in a page " "footer that identifies the copyright holder, effective period, and " "optionally whether rights are resctricted. (e.g. 'All rights " "reserved', 'Some rights reserved')." ), json_schema_extra={ "element_property": True, }, ) copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyrightLabel", title="Extension field for ``copyrightLabel``.", ) date: fhirtypes.DateTimeType | None = Field( default=None, alias="date", title="Date last changed", description=( "The date (and optionally time) when the value set metadata or content " "logical definition (.compose) was created or revised." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) description: fhirtypes.MarkdownType | None = Field( default=None, alias="description", title="Natural language description of the value set", description=( "A free text natural language description of the value set from a " "consumer's perspective. The textual description specifies the span of " "meanings for concepts to be included within the Value Set Expansion, " "and also may specify the intended use and limitations of the Value " "Set." ), json_schema_extra={ "element_property": True, }, ) description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_description", title="Extension field for ``description``." ) editor: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="editor", title="Who edited the ValueSet", description=( "An individual or organization primarily responsible for internal " "coherence of the ValueSet." ), json_schema_extra={ "element_property": True, }, ) effectivePeriod: fhirtypes.PeriodType | None = Field( default=None, alias="effectivePeriod", title="When the ValueSet is expected to be used", description=( "The period during which the ValueSet content was or is planned to be " "in active use." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) endorser: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="endorser", title="Who endorsed the ValueSet", description=( "An individual or organization asserted by the publisher to be " "responsible for officially endorsing the ValueSet for use in some " "setting." ), json_schema_extra={ "element_property": True, }, ) expansion: fhirtypes.ValueSetExpansionType | None = Field( default=None, alias="expansion", title='Used when the value set is "expanded"', description=( 'A value set can also be "expanded", where the value set is turned into' " a simple collection of enumerated codes. This element holds the " "expansion, if it has been performed." ), json_schema_extra={ "element_property": True, }, ) experimental: bool | None = Field( default=None, alias="experimental", title="For testing purposes, not real usage", description=( "A Boolean value to indicate that this value set is authored for " "testing purposes (or education/evaluation/marketing) and is not " "intended to be used for genuine usage." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_experimental", title="Extension field for ``experimental``.", ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Additional identifier for the value set (business identifier)", description=( "A formal identifier that is used to identify this value set when it is" " represented in other formats, or referenced in a specification, " "model, design or an instance." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) immutable: bool | None = Field( default=None, alias="immutable", title=( "Indicates whether or not any change to the content logical definition " "may occur" ), description=( "If this is set to 'true', then no new versions of the content logical " "definition can be created. Note: Other metadata might still change." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) immutable__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_immutable", title="Extension field for ``immutable``." ) jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="jurisdiction", title="Intended jurisdiction for value set (if applicable)", description=( "A legal or geographic region in which the value set is intended to be " "used." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lastReviewDate: fhirtypes.DateType | None = Field( default=None, alias="lastReviewDate", title="When the ValueSet was last reviewed by the publisher", description=( "The date on which the resource content was last reviewed. Review " "happens periodically after approval but does not change the original " "approval date." ), json_schema_extra={ "element_property": True, }, ) lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastReviewDate", title="Extension field for ``lastReviewDate``.", ) name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name for this value set (computer friendly)", description=( "A natural language name identifying the value set. This name should be" " usable as an identifier for the module by machine processing " "applications such as code generation." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) publisher: fhirtypes.StringType | None = Field( default=None, alias="publisher", title="Name of the publisher/steward (organization or individual)", description=( "The name of the organization or individual responsible for the release" " and ongoing maintenance of the value set." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_publisher", title="Extension field for ``publisher``." ) purpose: fhirtypes.MarkdownType | None = Field( default=None, alias="purpose", title="Why this value set is defined", description=( "Explanation of why this value set is needed and why it has been " "designed as it has." ), json_schema_extra={ "element_property": True, }, ) purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_purpose", title="Extension field for ``purpose``." ) relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field( default=None, alias="relatedArtifact", title="Additional documentation, citations, etc", description=( "Related artifacts such as additional documentation, justification, " "dependencies, bibliographic references, and predecessor and successor " "artifacts." ), json_schema_extra={ "element_property": True, }, ) reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field( default=None, alias="reviewer", title="Who reviewed the ValueSet", description=( "An individual or organization asserted by the publisher to be " "primarily responsible for review of some aspect of the ValueSet." ), json_schema_extra={ "element_property": True, }, ) scope: fhirtypes.ValueSetScopeType | None = Field( default=None, alias="scope", title=( "Description of the semantic space the Value Set Expansion is intended " "to cover and should further clarify the text in ValueSet.description" ), description=None, json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="draft | active | retired | unknown", description=( "The status of this value set. Enables tracking the life-cycle of the " "content. The status of the value set applies to the value set " "definition (ValueSet.compose) and the associated ValueSet metadata. " "Expansions do not have a state." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["draft", "active", "retired", "unknown"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) title: fhirtypes.StringType | None = Field( default=None, alias="title", title="Name for this value set (human friendly)", description="A short, descriptive, user-friendly title for the value set.", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_title", title="Extension field for ``title``." ) topic: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="topic", title="E.g. Education, Treatment, Assessment, etc", description=( "Descriptions related to the content of the ValueSet. Topics provide a " "high-level categorization as well as keywords for the ValueSet that " "can be useful for filtering and searching." ), json_schema_extra={ "element_property": True, }, ) url: fhirtypes.UriType | None = Field( default=None, alias="url", title=( "Canonical identifier for this value set, represented as a URI " "(globally unique)" ), description=( "An absolute URI that is used to identify this value set when it is " "referenced in a specification, model, design or an instance; also " "called its canonical identifier. This SHOULD be globally unique and " "SHOULD be a literal address at which an authoritative instance of this" " value set is (or will be) published. This URL can be the target of a " "canonical reference. It SHALL remain the same when the value set is " "stored on different servers." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_url", title="Extension field for ``url``." ) useContext: typing.List[fhirtypes.UsageContextType] | None = Field( default=None, alias="useContext", title="The context that the content is intended to support", description=( "The content was developed with a focus and intent of supporting the " "contexts that are listed. These contexts may be general categories " "(gender, age, ...) or may be references to specific programs " "(insurance plans, studies, ...) and may be used to assist with " "indexing and searching for appropriate value set instances." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Business version of the value set", description=( "The identifier that is used to identify this version of the value set " "when it is referenced in a specification, model, design or instance. " "This is an arbitrary value managed by the value set author and is not " "expected to be globally unique. For example, it might be a timestamp " "(e.g. yyyymmdd) if a managed version is not available. There is also " "no expectation that versions can be placed in a lexicographical " "sequence." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) versionAlgorithmCoding: fhirtypes.CodingType | None = Field( default=None, alias="versionAlgorithmCoding", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which " "ValueSet is more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString: fhirtypes.StringType | None = Field( default=None, alias="versionAlgorithmString", title="How to compare versions", description=( "Indicates the mechanism used to compare versions to determine which " "ValueSet is more current." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e versionAlgorithm[x] "one_of_many": "versionAlgorithm", "one_of_many_required": False, }, ) versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_versionAlgorithmString", title="Extension field for ``versionAlgorithmString``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSet`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "immutable", "purpose", "copyright", "copyrightLabel", "approvalDate", "lastReviewDate", "effectivePeriod", "topic", "author", "editor", "reviewer", "endorser", "relatedArtifact", "compose", "expansion", "scope", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSet`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "url", "identifier", "version", "versionAlgorithmString", "versionAlgorithmCoding", "name", "title", "status", "experimental", "date", "publisher", "contact", "useContext", "jurisdiction", "immutable", "effectivePeriod", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "versionAlgorithm": ["versionAlgorithmCoding", "versionAlgorithmString"] } return one_of_many_fields class ValueSetCompose(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Content logical definition of the value set (CLD). A set of criteria that define the contents of the value set by including or excluding codes selected from the specified code system(s) that the value set draws from. This is also known as the Content Logical Definition (CLD). """ __resource_type__ = "ValueSetCompose" exclude: typing.List[fhirtypes.ValueSetComposeIncludeType] | None = Field( default=None, alias="exclude", title="Explicitly exclude codes from a code system or other value sets", description=( "Exclude one or more codes from the value set based on code system " "filters and/or other value sets." ), json_schema_extra={ "element_property": True, }, ) inactive: bool | None = Field( default=None, alias="inactive", title="Whether inactive codes are in the value set", description=( "Whether inactive codes - codes that are not approved for current use -" " are in the value set. If inactive = true, inactive codes are to be " "included in the expansion, if inactive = false, the inactive codes " "will not be included in the expansion. If absent, the behavior is " "determined by the implementation, or by the applicable $expand " "parameters (but generally, inactive codes would be expected to be " "included)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) inactive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_inactive", title="Extension field for ``inactive``." ) include: typing.List[fhirtypes.ValueSetComposeIncludeType] = Field( default=..., alias="include", title="Include one or more codes from a code system or other value set(s)", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lockedDate: fhirtypes.DateType | None = Field( default=None, alias="lockedDate", title="Fixed date for references with no specified version (transitive)", description=( "The Locked Date is the effective date that is used to determine the " "version of all referenced Code Systems and Value Set Definitions " "included in the compose that are not already tied to a specific " "version." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) lockedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lockedDate", title="Extension field for ``lockedDate``." ) property: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="property", title="Property to return if client doesn't override", description=( "A property to return in the expansion, if the client doesn't ask for " "any particular properties. May be either a code from the code system " "definition (convenient) or a the formal URI that refers to the " "property. The special value '*' means all properties known to the " "server." ), json_schema_extra={ "element_property": True, }, ) property__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_property", title="Extension field for ``property``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetCompose`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "lockedDate", "inactive", "include", "exclude", "property", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetCompose`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "lockedDate", "inactive", "include"] class ValueSetComposeInclude(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Include one or more codes from a code system or other value set(s). """ __resource_type__ = "ValueSetComposeInclude" concept: typing.List[fhirtypes.ValueSetComposeIncludeConceptType] | None = Field( default=None, alias="concept", title="A concept defined in the system", description="Specifies a concept to be included or excluded.", json_schema_extra={ "element_property": True, }, ) copyright: fhirtypes.StringType | None = Field( default=None, alias="copyright", title=( "A copyright statement for the specific code system included in the " "value set" ), description=( "A copyright statement for the specific code system asserted by the " "containing ValueSet.compose.include element's system value (if the " "associated ValueSet.compose.include.version element is not present); " "or the code system and version combination (if the associated " "ValueSet.compose.include.version element is present)." ), json_schema_extra={ "element_property": True, }, ) copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_copyright", title="Extension field for ``copyright``." ) filter: typing.List[fhirtypes.ValueSetComposeIncludeFilterType] | None = Field( default=None, alias="filter", title="Select codes/concepts by their properties (including relationships)", description=( "Select concepts by specifying a matching criterion based on the " "properties (including relationships) defined by the system, or on " "filters defined by the system. If multiple filters are specified " "within the include, they SHALL all be true." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) system: fhirtypes.UriType | None = Field( default=None, alias="system", title="The system the codes come from", description=( "An absolute URI which is the code system from which the selected codes" " come from." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) valueSet: typing.List[fhirtypes.CanonicalType | None] | None = Field( default=None, alias="valueSet", title="Select the contents included in this value set", description=( "Selects the concepts found in this value set (based on its value set " "definition). This is an absolute URI that is a reference to " "ValueSet.url. If multiple value sets are specified this includes the " "intersection of the contents of all of the referenced value sets." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["ValueSet"], }, ) valueSet__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_valueSet", title="Extension field for ``valueSet``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Specific version of the code system referred to", description=( "The version of the code system that the codes are selected from, or " "the special version '*' for all versions." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetComposeInclude`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "system", "version", "concept", "filter", "valueSet", "copyright", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetComposeInclude`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "system", "version", "filter", "valueSet"] class ValueSetComposeIncludeConcept(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A concept defined in the system. Specifies a concept to be included or excluded. """ __resource_type__ = "ValueSetComposeIncludeConcept" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Code or expression from system", description="Specifies a code for the concept to be included or excluded.", json_schema_extra={ "element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) designation: typing.List[ fhirtypes.ValueSetComposeIncludeConceptDesignationType ] | None = Field( default=None, alias="designation", title="Additional representations for this concept", description=( "Additional representations for this concept when used in this value " "set - other languages, aliases, specialized purposes, used for " "particular purposes, etc." ), json_schema_extra={ "element_property": True, }, ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="Text to display for this code for this value set in this valueset", description=( "The text to display to the user for this concept in the context of " "this valueset. If no display is provided, then applications using the " "value set use the display specified for the code by the system." ), json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetComposeIncludeConcept`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "display", "designation", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetComposeIncludeConcept`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields class ValueSetComposeIncludeConceptDesignation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional representations for this concept. Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc. """ __resource_type__ = "ValueSetComposeIncludeConceptDesignation" additionalUse: typing.List[fhirtypes.CodingType] | None = Field( default=None, alias="additionalUse", title="Additional ways how this designation would be used", description=( "Additional codes that detail how this designation would be used, if " "there is more than one use." ), json_schema_extra={ "element_property": True, }, ) language: fhirtypes.CodeType | None = Field( default=None, alias="language", title="Human language of the designation", description="The language this designation is defined for.", json_schema_extra={ "element_property": True, }, ) language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_language", title="Extension field for ``language``." ) use: fhirtypes.CodingType | None = Field( default=None, alias="use", title="Types of uses of designations", description="A code that represents types of uses of designations.", json_schema_extra={ "element_property": True, }, ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="The text value for this designation", description=None, json_schema_extra={ "element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetComposeIncludeConceptDesignation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "language", "use", "additionalUse", "value", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetComposeIncludeConceptDesignation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("value", "value__ext")] return required_fields class ValueSetComposeIncludeFilter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Select codes/concepts by their properties (including relationships). Select concepts by specifying a matching criterion based on the properties (including relationships) defined by the system, or on filters defined by the system. If multiple filters are specified within the include, they SHALL all be true. """ __resource_type__ = "ValueSetComposeIncludeFilter" op: fhirtypes.CodeType | None = Field( default=None, alias="op", title=( "= | is-a | descendent-of | is-not-a | regex | in | not-in | " "generalizes | child-of | descendent-leaf | exists" ), description="The kind of operation to perform as a part of the filter criteria.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "=", "is-a", "descendent-of", "is-not-a", "regex", "in", "not-in", "generalizes", "child-of", "descendent-leaf", "exists", ], }, ) op__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_op", title="Extension field for ``op``." ) property: fhirtypes.CodeType | None = Field( default=None, alias="property", title="A property/filter defined by the code system", description=( "A code that identifies a property or a filter defined in the code " "system." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) property__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_property", title="Extension field for ``property``." ) value: fhirtypes.StringType | None = Field( default=None, alias="value", title="Code from the system, or regex criteria, or boolean value for exists", description=( "The match value may be either a code defined by the system, or a " "string value, which is a regex match on the literal string of the " "property value (if the filter represents a property defined in " "CodeSystem) or of the system filter value (if the filter represents a " "filter defined in CodeSystem) when the operation is 'regex', or one of" " the values (true and false), when the operation is 'exists'." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_value", title="Extension field for ``value``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetComposeIncludeFilter`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "property", "op", "value"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetComposeIncludeFilter`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "property", "op", "value"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("op", "op__ext"), ("property", "property__ext"), ("value", "value__ext"), ] return required_fields class ValueSetExpansion(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Used when the value set is "expanded". A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed. """ __resource_type__ = "ValueSetExpansion" contains: typing.List[fhirtypes.ValueSetExpansionContainsType] | None = Field( default=None, alias="contains", title="Codes in the value set", description="The codes that are contained in the value set expansion.", json_schema_extra={ "element_property": True, }, ) identifier: fhirtypes.UriType | None = Field( default=None, alias="identifier", title="Identifies the value set expansion (business identifier)", description=( "An identifier that uniquely identifies this expansion of the valueset," " based on a unique combination of the provided parameters, the system " "default parameters, and the underlying system code system versions " "etc. Systems may re-use the same identifier as long as those factors " "remain the same, and the expansion is the same, but are not required " "to do so. This is a business identifier." ), json_schema_extra={ "element_property": True, }, ) identifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_identifier", title="Extension field for ``identifier``." ) next: fhirtypes.UriType | None = Field( default=None, alias="next", title="Opaque urls for paging through expansion results", description=( "As per paging Search results, the next URLs are opaque to the client, " "have no dictated structure, and only the server understands them." ), json_schema_extra={ "element_property": True, }, ) next__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_next", title="Extension field for ``next``." ) offset: fhirtypes.IntegerType | None = Field( default=None, alias="offset", title="Offset at which this resource starts", description=( "If paging is being used, the offset at which this resource starts. " "I.e. this resource is a partial view into the expansion. If paging is " "not being used, this element SHALL NOT be present." ), json_schema_extra={ "element_property": True, }, ) offset__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_offset", title="Extension field for ``offset``." ) parameter: typing.List[fhirtypes.ValueSetExpansionParameterType] | None = Field( default=None, alias="parameter", title="Parameter that controlled the expansion process", description=( "A parameter that controlled the expansion process. These parameters " "may be used by users of expanded value sets to check whether the " "expansion is suitable for a particular purpose, or to pick the correct" " expansion." ), json_schema_extra={ "element_property": True, }, ) property: typing.List[fhirtypes.ValueSetExpansionPropertyType] | None = Field( default=None, alias="property", title="Additional information supplied about each concept", description=( "A property defines an additional slot through which additional " "information can be provided about a concept." ), json_schema_extra={ "element_property": True, }, ) timestamp: fhirtypes.DateTimeType | None = Field( default=None, alias="timestamp", title="Time ValueSet expansion happened", description="The time at which the expansion was produced by the expanding system.", json_schema_extra={ "element_property": True, "element_required": True, }, ) timestamp__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_timestamp", title="Extension field for ``timestamp``." ) total: fhirtypes.IntegerType | None = Field( default=None, alias="total", title="Total number of codes in the expansion", description=( "The total number of concepts in the expansion. If the number of " "concept nodes in this resource is less than the stated number, then " "the server can return more using the offset parameter." ), json_schema_extra={ "element_property": True, }, ) total__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_total", title="Extension field for ``total``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetExpansion`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "identifier", "next", "timestamp", "total", "offset", "parameter", "property", "contains", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetExpansion`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("timestamp", "timestamp__ext")] return required_fields class ValueSetExpansionContains(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Codes in the value set. The codes that are contained in the value set expansion. """ __resource_type__ = "ValueSetExpansionContains" abstract: bool | None = Field( default=None, alias="abstract", title="If user cannot select this entry", description=( "If true, this entry is included in the expansion for navigational " "purposes, and the user cannot select the code directly as a proper " "value." ), json_schema_extra={ "element_property": True, }, ) abstract__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_abstract", title="Extension field for ``abstract``." ) code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Code - if blank, this is not a selectable code", description=( "The code for this item in the expansion hierarchy. If this code is " "missing the entry in the hierarchy is a place holder (abstract) and " "does not represent a valid code in the value set." ), json_schema_extra={ "element_property": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) contains: typing.List[fhirtypes.ValueSetExpansionContainsType] | None = Field( default=None, alias="contains", title="Codes contained under this entry", description="Other codes and entries contained under this entry in the hierarchy.", json_schema_extra={ "element_property": True, }, ) designation: typing.List[ fhirtypes.ValueSetComposeIncludeConceptDesignationType ] | None = Field( default=None, alias="designation", title="Additional representations for this item", description=( "Additional representations for this item - other languages, aliases, " "specialized purposes, used for particular purposes, etc. These are " "relevant when the conditions of the expansion do not fix to a single " "correct representation." ), json_schema_extra={ "element_property": True, }, ) display: fhirtypes.StringType | None = Field( default=None, alias="display", title="User display for the concept", description="The recommended display for this item in the expansion.", json_schema_extra={ "element_property": True, }, ) display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_display", title="Extension field for ``display``." ) inactive: bool | None = Field( default=None, alias="inactive", title="If concept is inactive in the code system", description=( "If the concept is inactive in the code system that defines it. " "Inactive codes are those that are no longer to be used, but are " "maintained by the code system for understanding legacy data. It might " "not be known or specified whether a concept is inactive (and it may " "depend on the context of use)." ), json_schema_extra={ "element_property": True, }, ) inactive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_inactive", title="Extension field for ``inactive``." ) property: typing.List[ fhirtypes.ValueSetExpansionContainsPropertyType ] | None = Field( default=None, alias="property", title="Property value for the concept", description="A property value for this concept.", json_schema_extra={ "element_property": True, }, ) system: fhirtypes.UriType | None = Field( default=None, alias="system", title="System value for the code", description=( "An absolute URI which is the code system in which the code for this " "item in the expansion is defined." ), json_schema_extra={ "element_property": True, }, ) system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_system", title="Extension field for ``system``." ) version: fhirtypes.StringType | None = Field( default=None, alias="version", title="Version in which this code/display is defined", description=( "The version of the code system from this code was taken. Note that a " "well-maintained code system does not need the version reported, " "because the meaning of codes is consistent across versions. However " "this cannot consistently be assured, and when the meaning is not " "guaranteed to be consistent, the version SHOULD be exchanged." ), json_schema_extra={ "element_property": True, }, ) version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_version", title="Extension field for ``version``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetExpansionContains`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "system", "abstract", "inactive", "version", "code", "display", "designation", "property", "contains", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetExpansionContains`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] class ValueSetExpansionContainsProperty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Property value for the concept. A property value for this concept. """ __resource_type__ = "ValueSetExpansionContainsProperty" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Reference to ValueSet.expansion.property.code", description="A code that is a reference to ValueSet.expansion.property.code.", json_schema_extra={ "element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) subProperty: typing.List[ fhirtypes.ValueSetExpansionContainsPropertySubPropertyType ] | None = Field( default=None, alias="subProperty", title="SubProperty value for the concept", description="A subproperty value for this concept.", json_schema_extra={ "element_property": True, }, ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Value of the property for this concept", description="The value of this property.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetExpansionContainsProperty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "valueCode", "valueCoding", "valueString", "valueInteger", "valueBoolean", "valueDateTime", "valueDecimal", "subProperty", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetExpansionContainsProperty`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueCode", "valueCoding", "valueDateTime", "valueDecimal", "valueInteger", "valueString", ] } return one_of_many_fields class ValueSetExpansionContainsPropertySubProperty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. SubProperty value for the concept. A subproperty value for this concept. """ __resource_type__ = "ValueSetExpansionContainsPropertySubProperty" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title="Reference to ValueSet.expansion.property.code", description="A code that is a reference to ValueSet.expansion.property.code.", json_schema_extra={ "element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value of the subproperty for this concept", description="The value of this subproperty.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="Value of the subproperty for this concept", description="The value of this subproperty.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueCoding: fhirtypes.CodingType | None = Field( default=None, alias="valueCoding", title="Value of the subproperty for this concept", description="The value of this subproperty.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Value of the subproperty for this concept", description="The value of this subproperty.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Value of the subproperty for this concept", description="The value of this subproperty.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Value of the subproperty for this concept", description="The value of this subproperty.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Value of the subproperty for this concept", description="The value of this subproperty.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": True, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetExpansionContainsPropertySubProperty`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "code", "valueCode", "valueCoding", "valueString", "valueInteger", "valueBoolean", "valueDateTime", "valueDecimal", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetExpansionContainsPropertySubProperty`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueCode", "valueCoding", "valueDateTime", "valueDecimal", "valueInteger", "valueString", ] } return one_of_many_fields class ValueSetExpansionParameter(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Parameter that controlled the expansion process. A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion. """ __resource_type__ = "ValueSetExpansionParameter" name: fhirtypes.StringType | None = Field( default=None, alias="name", title="Name as assigned by the client or server", description=( "Name of the input parameter to the $expand operation; may be a server-" "assigned name for additional default or other server-supplied " "parameters used to control the expansion process." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_name", title="Extension field for ``name``." ) valueBoolean: bool | None = Field( default=None, alias="valueBoolean", title="Value of the named parameter", description="The value of the parameter.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueBoolean", title="Extension field for ``valueBoolean``.", ) valueCode: fhirtypes.CodeType | None = Field( default=None, alias="valueCode", title="Value of the named parameter", description="The value of the parameter.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueCode", title="Extension field for ``valueCode``." ) valueDateTime: fhirtypes.DateTimeType | None = Field( default=None, alias="valueDateTime", title="Value of the named parameter", description="The value of the parameter.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDateTime", title="Extension field for ``valueDateTime``.", ) valueDecimal: fhirtypes.DecimalType | None = Field( default=None, alias="valueDecimal", title="Value of the named parameter", description="The value of the parameter.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueDecimal", title="Extension field for ``valueDecimal``.", ) valueInteger: fhirtypes.IntegerType | None = Field( default=None, alias="valueInteger", title="Value of the named parameter", description="The value of the parameter.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueInteger", title="Extension field for ``valueInteger``.", ) valueString: fhirtypes.StringType | None = Field( default=None, alias="valueString", title="Value of the named parameter", description="The value of the parameter.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueString", title="Extension field for ``valueString``." ) valueUri: fhirtypes.UriType | None = Field( default=None, alias="valueUri", title="Value of the named parameter", description="The value of the parameter.", json_schema_extra={ "element_property": True, # Choice of Data Types. i.e value[x] "one_of_many": "value", "one_of_many_required": False, }, ) valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_valueUri", title="Extension field for ``valueUri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetExpansionParameter`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "name", "valueString", "valueBoolean", "valueInteger", "valueDecimal", "valueUri", "valueCode", "valueDateTime", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetExpansionParameter`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("name", "name__ext")] return required_fields def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "value": [ "valueBoolean", "valueCode", "valueDateTime", "valueDecimal", "valueInteger", "valueString", "valueUri", ] } return one_of_many_fields class ValueSetExpansionProperty(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Additional information supplied about each concept. A property defines an additional slot through which additional information can be provided about a concept. """ __resource_type__ = "ValueSetExpansionProperty" code: fhirtypes.CodeType | None = Field( default=None, alias="code", title=( "Identifies the property on the concepts, and when referred to in " "operations" ), description=( "A code that is used to identify the property. The code is used in " "ValueSet.expansion.contains.property.code." ), json_schema_extra={ "element_property": True, "element_required": True, }, ) code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_code", title="Extension field for ``code``." ) uri: fhirtypes.UriType | None = Field( default=None, alias="uri", title="Formal identifier for the property", description=( "Reference to the formal meaning of the property. One possible source " "of meaning is the [Concept Properties](codesystem-concept-" "properties.html) code system." ), json_schema_extra={ "element_property": True, }, ) uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_uri", title="Extension field for ``uri``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetExpansionProperty`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "code", "uri"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetExpansionProperty`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("code", "code__ext")] return required_fields class ValueSetScope(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Description of the semantic space the Value Set Expansion is intended to cover and should further clarify the text in ValueSet.description. """ __resource_type__ = "ValueSetScope" exclusionCriteria: fhirtypes.StringType | None = Field( default=None, alias="exclusionCriteria", title="Criteria describing which concepts or codes should be excluded and why", description=None, json_schema_extra={ "element_property": True, }, ) exclusionCriteria__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_exclusionCriteria", title="Extension field for ``exclusionCriteria``.", ) inclusionCriteria: fhirtypes.StringType | None = Field( default=None, alias="inclusionCriteria", title="Criteria describing which concepts or codes should be included and why", description=None, json_schema_extra={ "element_property": True, }, ) inclusionCriteria__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_inclusionCriteria", title="Extension field for ``inclusionCriteria``.", ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``ValueSetScope`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "inclusionCriteria", "exclusionCriteria", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``ValueSetScope`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/verificationresult.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/VerificationResult Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class VerificationResult(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Describes validation requirements, source(s), status and dates for one or more elements. """ __resource_type__ = "VerificationResult" attestation: fhirtypes.VerificationResultAttestationType | None = Field( default=None, alias="attestation", title="Information about the entity attesting to information", description=None, json_schema_extra={ "element_property": True, }, ) failureAction: fhirtypes.CodeableConceptType | None = Field( default=None, alias="failureAction", title="fatal | warn | rec-only | none", description="The result if validation fails (fatal; warning; record only; none).", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) frequency: fhirtypes.TimingType | None = Field( default=None, alias="frequency", title="Frequency of revalidation", description=None, json_schema_extra={ "element_property": True, }, ) lastPerformed: fhirtypes.DateTimeType | None = Field( default=None, alias="lastPerformed", title=( "The date/time validation was last completed (including failed " "validations)" ), description=None, json_schema_extra={ "element_property": True, }, ) lastPerformed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_lastPerformed", title="Extension field for ``lastPerformed``.", ) need: fhirtypes.CodeableConceptType | None = Field( default=None, alias="need", title="none | initial | periodic", description=( "The frequency with which the target must be validated (none; initial; " "periodic)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) nextScheduled: fhirtypes.DateType | None = Field( default=None, alias="nextScheduled", title="The date when target is next validated, if appropriate", description=None, json_schema_extra={ "element_property": True, }, ) nextScheduled__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_nextScheduled", title="Extension field for ``nextScheduled``.", ) primarySource: typing.List[ fhirtypes.VerificationResultPrimarySourceType ] | None = Field( default=None, alias="primarySource", title="Information about the primary source(s) involved in validation", description=None, json_schema_extra={ "element_property": True, }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title=( "attested | validated | in-process | req-revalid | val-fail | reval-" "fail | entered-in-error" ), description=( "The validation status of the target (attested; validated; in process; " "requires revalidation; validation failed; revalidation failed)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": [ "attested", "validated", "in-process", "req-revalid", "val-fail", "reval-fail", "entered-in-error", ], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) statusDate: fhirtypes.DateTimeType | None = Field( default=None, alias="statusDate", title="When the validation status was updated", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_statusDate", title="Extension field for ``statusDate``." ) target: typing.List[fhirtypes.ReferenceType] | None = Field( default=None, alias="target", title="A resource that was validated", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Resource"], }, ) targetLocation: typing.List[fhirtypes.StringType | None] | None = Field( default=None, alias="targetLocation", title="The fhirpath location(s) within the resource that was validated", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) targetLocation__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_targetLocation", title="Extension field for ``targetLocation``.", ) validationProcess: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="validationProcess", title=( "The primary process by which the target is validated (edit check; " "value set; primary source; multiple sources; standalone; in context)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) validationType: fhirtypes.CodeableConceptType | None = Field( default=None, alias="validationType", title="nothing | primary | multiple", description=( "What the target is validated against (nothing; primary source; " "multiple sources)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) validator: typing.List[fhirtypes.VerificationResultValidatorType] | None = Field( default=None, alias="validator", title="Information about the entity validating information", description=None, json_schema_extra={ "element_property": True, }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``VerificationResult`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "target", "targetLocation", "need", "status", "statusDate", "validationType", "validationProcess", "frequency", "lastPerformed", "nextScheduled", "failureAction", "primarySource", "attestation", "validator", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``VerificationResult`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "target", "targetLocation", "need", "status", "statusDate", "validationType", "validationProcess", "failureAction", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("status", "status__ext")] return required_fields class VerificationResultAttestation(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about the entity attesting to information. """ __resource_type__ = "VerificationResultAttestation" communicationMethod: fhirtypes.CodeableConceptType | None = Field( default=None, alias="communicationMethod", title="The method by which attested information was submitted/retrieved", description=( "The method by which attested information was submitted/retrieved " "(manual; API; Push)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date: fhirtypes.DateType | None = Field( default=None, alias="date", title="The date the information was attested to", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_date", title="Extension field for ``date``." ) onBehalfOf: fhirtypes.ReferenceType | None = Field( default=None, alias="onBehalfOf", title=( "When the who is asserting on behalf of another (organization or " "individual)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Organization", "Practitioner", "PractitionerRole", ], }, ) proxyIdentityCertificate: fhirtypes.StringType | None = Field( default=None, alias="proxyIdentityCertificate", title=( "A digital identity certificate associated with the proxy entity " "submitting attested information on behalf of the attestation source" ), description=None, json_schema_extra={ "element_property": True, }, ) proxyIdentityCertificate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_proxyIdentityCertificate", title="Extension field for ``proxyIdentityCertificate``.", ) proxySignature: fhirtypes.SignatureType | None = Field( default=None, alias="proxySignature", title="Proxy signature (digital or image)", description=( "Signed assertion by the proxy entity indicating that they have the " "right to submit attested information on behalf of the attestation " "source." ), json_schema_extra={ "element_property": True, }, ) sourceIdentityCertificate: fhirtypes.StringType | None = Field( default=None, alias="sourceIdentityCertificate", title="A digital identity certificate associated with the attestation source", description=None, json_schema_extra={ "element_property": True, }, ) sourceIdentityCertificate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sourceIdentityCertificate", title="Extension field for ``sourceIdentityCertificate``.", ) sourceSignature: fhirtypes.SignatureType | None = Field( default=None, alias="sourceSignature", title="Attester signature (digital or image)", description=( "Signed assertion by the attestation source that they have attested to " "the information." ), json_schema_extra={ "element_property": True, }, ) who: fhirtypes.ReferenceType | None = Field( default=None, alias="who", title="The individual or organization attesting to information", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Practitioner", "PractitionerRole", "Organization", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``VerificationResultAttestation`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "who", "onBehalfOf", "communicationMethod", "date", "sourceIdentityCertificate", "proxyIdentityCertificate", "proxySignature", "sourceSignature", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``VerificationResultAttestation`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "who", "onBehalfOf", "communicationMethod", "date"] class VerificationResultPrimarySource(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about the primary source(s) involved in validation. """ __resource_type__ = "VerificationResultPrimarySource" canPushUpdates: fhirtypes.CodeableConceptType | None = Field( default=None, alias="canPushUpdates", title="yes | no | undetermined", description=( "Ability of the primary source to push updates/alerts (yes; no; " "undetermined)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) communicationMethod: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="communicationMethod", title="Method for exchanging information with the primary source", description="Method for communicating with the primary source (manual; API; Push).", json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) pushTypeAvailable: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="pushTypeAvailable", title="specific | any | source", description=( "Type of alerts/updates the primary source can send (specific requested" " changes; any changes; as defined by source)." ), json_schema_extra={ "element_property": True, }, ) type: typing.List[fhirtypes.CodeableConceptType] | None = Field( default=None, alias="type", title=( "Type of primary source (License Board; Primary Education; Continuing " "Education; Postal Service; Relationship owner; Registration Authority;" " legal source; issuing source; authoritative source)" ), description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) validationDate: fhirtypes.DateTimeType | None = Field( default=None, alias="validationDate", title="When the target was validated against the primary source", description=None, json_schema_extra={ "element_property": True, }, ) validationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_validationDate", title="Extension field for ``validationDate``.", ) validationStatus: fhirtypes.CodeableConceptType | None = Field( default=None, alias="validationStatus", title="successful | failed | unknown", description=( "Status of the validation of the target against the primary source " "(successful; failed; unknown)." ), json_schema_extra={ "element_property": True, }, ) who: fhirtypes.ReferenceType | None = Field( default=None, alias="who", title="Reference to the primary source", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": [ "Organization", "Practitioner", "PractitionerRole", ], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``VerificationResultPrimarySource`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "who", "type", "communicationMethod", "validationStatus", "validationDate", "canPushUpdates", "pushTypeAvailable", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``VerificationResultPrimarySource`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "type", "communicationMethod", "canPushUpdates"] class VerificationResultValidator(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Information about the entity validating information. """ __resource_type__ = "VerificationResultValidator" attestationSignature: fhirtypes.SignatureType | None = Field( default=None, alias="attestationSignature", title="Validator signature (digital or image)", description=( "Signed assertion by the validator that they have validated the " "information." ), json_schema_extra={ "element_property": True, }, ) identityCertificate: fhirtypes.StringType | None = Field( default=None, alias="identityCertificate", title="A digital identity certificate associated with the validator", description=None, json_schema_extra={ "element_property": True, }, ) identityCertificate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_identityCertificate", title="Extension field for ``identityCertificate``.", ) organization: fhirtypes.ReferenceType = Field( default=..., alias="organization", title="Reference to the organization validating information", description=None, json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Organization"], }, ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``VerificationResultValidator`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "organization", "identityCertificate", "attestationSignature", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``VerificationResultValidator`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] ================================================ FILE: fhir/resources/virtualservicedetail.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/VirtualServiceDetail Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import datatype, fhirtypes class VirtualServiceDetail(datatype.DataType): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Virtual Service Contact Details. """ __resource_type__ = "VirtualServiceDetail" additionalInfo: typing.List[fhirtypes.UrlType | None] | None = Field( default=None, alias="additionalInfo", title="Address to see alternative connection details", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) additionalInfo__ext: typing.List[ fhirtypes.FHIRPrimitiveExtensionType | None ] | None = Field( default=None, alias="_additionalInfo", title="Extension field for ``additionalInfo``.", ) addressContactPoint: fhirtypes.ContactPointType | None = Field( default=None, alias="addressContactPoint", title="Contact address/number", description=( "What address or number needs to be used for a user to connect to the " "virtual service to join. The channelType informs as to which datatype " "is appropriate to use (requires knowledge of the specific type)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e address[x] "one_of_many": "address", "one_of_many_required": False, }, ) addressExtendedContactDetail: fhirtypes.ExtendedContactDetailType | None = Field( default=None, alias="addressExtendedContactDetail", title="Contact address/number", description=( "What address or number needs to be used for a user to connect to the " "virtual service to join. The channelType informs as to which datatype " "is appropriate to use (requires knowledge of the specific type)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e address[x] "one_of_many": "address", "one_of_many_required": False, }, ) addressString: fhirtypes.StringType | None = Field( default=None, alias="addressString", title="Contact address/number", description=( "What address or number needs to be used for a user to connect to the " "virtual service to join. The channelType informs as to which datatype " "is appropriate to use (requires knowledge of the specific type)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e address[x] "one_of_many": "address", "one_of_many_required": False, }, ) addressString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_addressString", title="Extension field for ``addressString``.", ) addressUrl: fhirtypes.UrlType | None = Field( default=None, alias="addressUrl", title="Contact address/number", description=( "What address or number needs to be used for a user to connect to the " "virtual service to join. The channelType informs as to which datatype " "is appropriate to use (requires knowledge of the specific type)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # Choice of Data Types. i.e address[x] "one_of_many": "address", "one_of_many_required": False, }, ) addressUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_addressUrl", title="Extension field for ``addressUrl``." ) channelType: fhirtypes.CodingType | None = Field( default=None, alias="channelType", title="Channel Type", description=( "The type of virtual service to connect to (i.e. Teams, Zoom, Specific " "VMR technology, WhatsApp)." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maxParticipants: fhirtypes.PositiveIntType | None = Field( default=None, alias="maxParticipants", title="Maximum number of participants supported by the virtual service", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) maxParticipants__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_maxParticipants", title="Extension field for ``maxParticipants``.", ) sessionKey: fhirtypes.StringType | None = Field( default=None, alias="sessionKey", title="Session Key required by the virtual service", description=None, json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sessionKey__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sessionKey", title="Extension field for ``sessionKey``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``VirtualServiceDetail`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "channelType", "addressUrl", "addressString", "addressContactPoint", "addressExtendedContactDetail", "additionalInfo", "maxParticipants", "sessionKey", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``VirtualServiceDetail`` according to specification, with preserving the original sequence order. """ return [ "channelType", "addressUrl", "addressString", "addressContactPoint", "addressExtendedContactDetail", "additionalInfo", "maxParticipants", "sessionKey", ] def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "address": [ "addressContactPoint", "addressExtendedContactDetail", "addressString", "addressUrl", ] } return one_of_many_fields ================================================ FILE: fhir/resources/visionprescription.py ================================================ """ Profile: http://hl7.org/fhir/StructureDefinition/VisionPrescription Release: R5 Version: 5.0.0 Build ID: 2aecd53 Last updated: 2023-03-26T15:21:02.749+11:00 """ from __future__ import annotations as _annotations import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class VisionPrescription(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Prescription for vision correction products for a patient. An authorization for the provision of glasses and/or contact lenses to a patient. """ __resource_type__ = "VisionPrescription" created: fhirtypes.DateTimeType | None = Field( default=None, alias="created", title="Response creation date", description="The date this resource was created.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_created", title="Extension field for ``created``." ) dateWritten: fhirtypes.DateTimeType | None = Field( default=None, alias="dateWritten", title="When prescription was authorized", description="The date (and perhaps time) when the prescription was written.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, }, ) dateWritten__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_dateWritten", title="Extension field for ``dateWritten``." ) encounter: fhirtypes.ReferenceType | None = Field( default=None, alias="encounter", title="Created during encounter / admission / stay", description=( "A reference to a resource that identifies the particular occurrence of" " contact between patient and health care provider during which the " "prescription was issued." ), json_schema_extra={ "element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Encounter"], }, ) identifier: typing.List[fhirtypes.IdentifierType] | None = Field( default=None, alias="identifier", title="Business Identifier for vision prescription", description="A unique identifier assigned to this vision prescription.", json_schema_extra={ "element_property": True, }, ) lensSpecification: typing.List[ fhirtypes.VisionPrescriptionLensSpecificationType ] = Field( default=..., alias="lensSpecification", title="Vision lens authorization", description=( "Contain the details of the individual lens specifications and serves " "as the authorization for the fullfillment by certified professionals." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) patient: fhirtypes.ReferenceType = Field( default=..., alias="patient", title="Who prescription is for", description=( "A resource reference to the person to whom the vision prescription " "applies." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Patient"], }, ) prescriber: fhirtypes.ReferenceType = Field( default=..., alias="prescriber", title="Who authorized the vision prescription", description=( "The healthcare professional responsible for authorizing the " "prescription." ), json_schema_extra={ "element_property": True, "summary_element_property": True, # note: Listed Resource Type(s) should be allowed as Reference. "enum_reference_types": ["Practitioner", "PractitionerRole"], }, ) status: fhirtypes.CodeType | None = Field( default=None, alias="status", title="active | cancelled | draft | entered-in-error", description="The status of the resource instance.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["active", "cancelled", "draft", "entered-in-error"], }, ) status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_status", title="Extension field for ``status``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``VisionPrescription`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "status", "created", "patient", "encounter", "dateWritten", "prescriber", "lensSpecification", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``VisionPrescription`` according to specification, with preserving the original sequence order. """ return [ "id", "meta", "implicitRules", "modifierExtension", "status", "created", "patient", "dateWritten", "prescriber", "lensSpecification", ] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ ("created", "created__ext"), ("dateWritten", "dateWritten__ext"), ("status", "status__ext"), ] return required_fields class VisionPrescriptionLensSpecification(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Vision lens authorization. Contain the details of the individual lens specifications and serves as the authorization for the fullfillment by certified professionals. """ __resource_type__ = "VisionPrescriptionLensSpecification" add: fhirtypes.DecimalType | None = Field( default=None, alias="add", title="Added power for multifocal levels", description=( "Power adjustment for multifocal lenses measured in dioptres (0.25 " "units)." ), json_schema_extra={ "element_property": True, }, ) add__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_add", title="Extension field for ``add``." ) axis: fhirtypes.IntegerType | None = Field( default=None, alias="axis", title="Lens meridian which contain no power for astigmatism", description="Adjustment for astigmatism measured in integer degrees.", json_schema_extra={ "element_property": True, }, ) axis__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_axis", title="Extension field for ``axis``." ) backCurve: fhirtypes.DecimalType | None = Field( default=None, alias="backCurve", title="Contact lens back curvature", description="Back curvature measured in millimetres.", json_schema_extra={ "element_property": True, }, ) backCurve__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_backCurve", title="Extension field for ``backCurve``." ) brand: fhirtypes.StringType | None = Field( default=None, alias="brand", title="Brand required", description="Brand recommendations or restrictions.", json_schema_extra={ "element_property": True, }, ) brand__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_brand", title="Extension field for ``brand``." ) color: fhirtypes.StringType | None = Field( default=None, alias="color", title="Color required", description="Special color or pattern.", json_schema_extra={ "element_property": True, }, ) color__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_color", title="Extension field for ``color``." ) cylinder: fhirtypes.DecimalType | None = Field( default=None, alias="cylinder", title="Lens power for astigmatism", description="Power adjustment for astigmatism measured in dioptres (0.25 units).", json_schema_extra={ "element_property": True, }, ) cylinder__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_cylinder", title="Extension field for ``cylinder``." ) diameter: fhirtypes.DecimalType | None = Field( default=None, alias="diameter", title="Contact lens diameter", description="Contact lens diameter measured in millimetres.", json_schema_extra={ "element_property": True, }, ) diameter__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_diameter", title="Extension field for ``diameter``." ) duration: fhirtypes.QuantityType | None = Field( default=None, alias="duration", title="Lens wear duration", description="The recommended maximum wear period for the lens.", json_schema_extra={ "element_property": True, }, ) eye: fhirtypes.CodeType | None = Field( default=None, alias="eye", title="right | left", description="The eye for which the lens specification applies.", json_schema_extra={ "element_property": True, "summary_element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["right", "left"], }, ) eye__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_eye", title="Extension field for ``eye``." ) note: typing.List[fhirtypes.AnnotationType] | None = Field( default=None, alias="note", title="Notes for coatings", description="Notes for special requirements such as coatings and lens materials.", json_schema_extra={ "element_property": True, }, ) power: fhirtypes.DecimalType | None = Field( default=None, alias="power", title="Contact lens power", description="Contact lens power measured in dioptres (0.25 units).", json_schema_extra={ "element_property": True, }, ) power__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_power", title="Extension field for ``power``." ) prism: typing.List[ fhirtypes.VisionPrescriptionLensSpecificationPrismType ] | None = Field( default=None, alias="prism", title="Eye alignment compensation", description="Allows for adjustment on two axis.", json_schema_extra={ "element_property": True, }, ) product: fhirtypes.CodeableConceptType = Field( default=..., alias="product", title="Product to be supplied", description=( "Identifies the type of vision correction product which is required for" " the patient." ), json_schema_extra={ "element_property": True, "summary_element_property": True, }, ) sphere: fhirtypes.DecimalType | None = Field( default=None, alias="sphere", title="Power of the lens", description="Lens power measured in dioptres (0.25 units).", json_schema_extra={ "element_property": True, }, ) sphere__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_sphere", title="Extension field for ``sphere``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``VisionPrescriptionLensSpecification`` according to specification, with preserving the original sequence order. """ return [ "id", "extension", "modifierExtension", "product", "eye", "sphere", "cylinder", "axis", "prism", "add", "power", "backCurve", "diameter", "duration", "color", "brand", "note", ] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``VisionPrescriptionLensSpecification`` according to specification, with preserving the original sequence order. """ return ["modifierExtension", "product", "eye"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("eye", "eye__ext")] return required_fields class VisionPrescriptionLensSpecificationPrism(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Eye alignment compensation. Allows for adjustment on two axis. """ __resource_type__ = "VisionPrescriptionLensSpecificationPrism" amount: fhirtypes.DecimalType | None = Field( default=None, alias="amount", title="Amount of adjustment", description="Amount of prism to compensate for eye alignment in fractional units.", json_schema_extra={ "element_property": True, "element_required": True, }, ) amount__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_amount", title="Extension field for ``amount``." ) base: fhirtypes.CodeType | None = Field( default=None, alias="base", title="up | down | in | out", description="The relative base, or reference lens edge, for the prism.", json_schema_extra={ "element_property": True, "element_required": True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. "enum_values": ["up", "down", "in", "out"], }, ) base__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field( default=None, alias="_base", title="Extension field for ``base``." ) @classmethod def elements_sequence(cls) -> typing.List[str]: """returning all element names from ``VisionPrescriptionLensSpecificationPrism`` according to specification, with preserving the original sequence order. """ return ["id", "extension", "modifierExtension", "amount", "base"] @classmethod def summary_elements_sequence(cls) -> typing.List[str]: """returning all element names (those have summary mode are enabled) from ``VisionPrescriptionLensSpecificationPrism`` according to specification, with preserving the original sequence order. """ return ["modifierExtension"] def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [("amount", "amount__ext"), ("base", "base__ext")] return required_fields ================================================ FILE: pyproject.toml ================================================ [build-system] # Minimum requirements for the build system to execute. requires = ["setuptools", "wheel"] # PEP 508 specifications. [tool.black] line-length = 88 target-version = ['py38'] include = '\.pyi?$' exclude = ''' /( \.git | \.hg | \.mypy_cache | \.tox | \.venv | _build | buck-out | build | dist # The following are specific to Black, you probably don't want those. | blib2to3 | tests/data )/ ''' [tool.pytest.ini_options] minversion = "7.0" ================================================ FILE: script/base_local.py ================================================ import os import pathlib RESOURCE_TARGET_DIRECTORY = ( pathlib.Path(os.path.abspath(__file__)).parents[2] / "fhir" / "resources" ) UNITTEST_TARGET_DIRECTORY = RESOURCE_TARGET_DIRECTORY / "tests" #FHIR_EXAMPLE_DIRECTORY = ( # pathlib.Path(os.path.abspath(__file__)).parents[2] # / "script" # / "static" # / "examples-json" # / "R4B" #) ================================================ FILE: script/generate.py ================================================ #!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Download and parse FHIR resource definitions # Supply "-f" to force a redownload of the spec # Supply "-c" to force using the cached spec (incompatible with "-f") # Supply "-d" to load and parse but not write resources # Supply "-l" to only download the spec import ast from distutils.version import StrictVersion import configparser import pathlib import requests import os import subprocess import shutil import sys SRC_BASE_PATH = pathlib.Path(os.path.abspath(__file__)).parents[1] / 'fhir' / 'resources' PARSER_BASE_PATH = pathlib.Path(os.path.abspath(__file__)).parents[1] / 'fhir-parser' PARSER_CACHE_DIR = PARSER_BASE_PATH / 'downloads' SCRIPT_BASE_PATH = pathlib.Path(os.path.abspath(__file__)).parents[1] / 'script' def get_current_version(): """ """ version_file = str(SRC_BASE_PATH / '__init__.py') with open(str(SRC_BASE_PATH / '__init__.py'), 'r', encoding='utf-8') as fd: for line in fd: if '__version__' in line: version = StrictVersion(ast.literal_eval(line.split('=')[1].strip())) sys.stdout.write(f'Version `{version}` at {version_file}\n') return version def get_cached_version_info(): """ """ if not PARSER_CACHE_DIR.exists(): return version_file = PARSER_CACHE_DIR / 'version.info' if not version_file.exists(): return config = configparser.ConfigParser() with open(str(version_file), 'r') as fp: txt = fp.read() config.read_string('\n'.join(txt.split('\n')[1:])) return config['FHIR']['version'], config['FHIR']['fhirversion'] def get_fhir_version_info(): """ """ try: response = requests.get(settings.specification_url + '/version.info') text = response.text config = configparser.ConfigParser() config.read_string('\r'.join(text.split('\r')[1:])) return config['FHIR']['version'], config['FHIR']['fhirversion'] except requests.HTTPError as exc: sys.stderr.write(str(exc)) return None def update_pytest_fixture(version): """ """ lines = list() fixture_file = SRC_BASE_PATH / version / 'tests' / 'fixtures.py' with open(str(fixture_file), 'r', encoding='utf-8') as fp: for line in fp: if 'ROOT_PATH =' in line: parts = list() parts.append(line.split('=')[0]) parts.append("dirname(dirname(dirname(dirname(dirname(os.path.abspath(__file__))))))\n") line = '= '.join(parts) elif 'CACHE_PATH =' in line: parts = list() parts.append(line.split('=')[0]) parts.append(f"os.path.join(ROOT_PATH, '.cache', '{version}')\n") line = '= '.join(parts) elif 'example_data_file_uri =' in line: parts = list() parts.append(line.split('=')[0]) parts.append(f"'/'.join([settings['base_url'], '{version}', 'examples-json.zip'])\n") line = '= '.join(parts) lines.append(line) # let's write fixture_file.write_text(''.join(lines)) with open(str(SRC_BASE_PATH / version / 'tests' / 'conftest.py'), 'w', encoding='utf-8') as fp: fp.write( "# _*_ coding: utf-8 _*_\n" f"pytest_plugins = ['fhir.resources.{version}.tests.fixtures']\n") def main(): """ """ if str(PARSER_BASE_PATH) not in sys.path: sys.path.append(str(PARSER_BASE_PATH)) args = [f'{PARSER_BASE_PATH}/generate.py'] + sys.argv[1:] shutil.copy(str(SCRIPT_BASE_PATH / 'base_local.py'), str(PARSER_BASE_PATH / "config" / "base_local.py")) try: subprocess.check_call(args=args, cwd=str(PARSER_BASE_PATH)) except subprocess.CalledProcessError as exc: sys.stderr.write(str(exc) + '\n') return 1 return 0 if '__main__' == __name__: """ """ try: sys.exit(main()) except KeyboardInterrupt as exc: sys.stdout.write(str(exc)) sys.exit(0) ================================================ FILE: script/static/.gitignore ================================================ * !.gitignore ================================================ FILE: setup.cfg ================================================ [bdist_wheel] universal = 1 [aliases] # Define setup.py command aliases here test = pytest [metadata] name = "fhir.resources" version = "8.2.1" license-files="LICENSE" long_description_content_type=text/x-rst [zest.releaser] create-wheel = yes register = no ================================================ FILE: setup.py ================================================ #!/usr/bin/env python # -*- coding: utf-8 -*- """The setup script.""" import platform from setuptools import find_namespace_packages, setup PY_VERSION_TUPLE = platform.python_version_tuple() PY_VERSION_9_OR_EARLIER = PY_VERSION_TUPLE[0] == "3" and int(PY_VERSION_TUPLE[1]) <= 9 PY_VERSION_10_OR_LATER = PY_VERSION_TUPLE[0] == "3" and int(PY_VERSION_TUPLE[1]) >= 10 PY_VERSION_11_OR_LATER = PY_VERSION_10_OR_LATER and int(PY_VERSION_TUPLE[1]) >= 11 with open("README.rst") as readme_file: readme = readme_file.read() with open("HISTORY.rst") as history_file: history = history_file.read() requirements = ["fhir-core>=1.1.7"] if PY_VERSION_9_OR_EARLIER: requirements.append("eval-type-backport") setup_requirements = ["pytest-runner"] yaml_requirements = ["PyYAML>=5.4.1"] xml_requirements = ["lxml"] test_requirements = [ "coverage", "pytest>5.4.0;python_version>='3.6'", "pytest-cov>=2.10.0;python_version>='3.6'", "flake8" + (PY_VERSION_10_OR_LATER and "==7.3.0" or "==5.0.4;python_version<'3.10'"), "flake8-isort" + (PY_VERSION_10_OR_LATER and ">=6.0.0" or "==4.2.0;python_version<'3.10'"), "flake8-bugbear" + (PY_VERSION_10_OR_LATER and ">=22.12.6" or "==20.1.4;python_version<'3.10'"), "requests==2.32.4", "isort" + (PY_VERSION_10_OR_LATER and ">=5.11.4" or "==4.3.21"), "black>=23.0,<24.0; python_version >= '3.7'", "mypy", "types-PyYAML", "types-simplejson", "types-requests", "setuptools==65.6.3;python_version>='3.7'", ] if PY_VERSION_10_OR_LATER: test_requirements.append("importlib-metadata>=5.2.0") development_requirements = [ "Jinja2==3.1.6", "MarkupSafe==2.1.5", "colorlog==2.10.0", "certifi", "fhirspec>=0.6.0", "zest-releaser[recommended]", "twine==6.1.0", ] setup( author="Md Nazrul Islam", author_email="email2nazrul@gmail.com", # Get more from https://pypi.org/pypi?%3Aaction=list_classifiers classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: Healthcare Industry", "Intended Audience :: Information Technology", "Intended Audience :: Science/Research", "Operating System :: OS Independent", "Typing :: Typed", ], description="FHIR Resources as Model Class", install_requires=requirements, license="BSD license", long_description=readme + "\n\n" + history, include_package_data=True, keywords="fhir, resources, python, hl7, health IT, healthcare", name="fhir.resources", packages=find_namespace_packages( include=["fhir*"], exclude=[ "ez_setup", "tests", "fhir-parser*", "fhir.resources.tests", "fhir.resources.STU3.tests", "fhir.resources.R4B.tests", ], ), package_data={"fhir.resources": ["py.typed"]}, setup_requires=setup_requirements, test_suite="tests", tests_require=test_requirements, extras_require={ "yaml": yaml_requirements, "xml": xml_requirements, "test": ( test_requirements + setup_requirements + yaml_requirements + xml_requirements ), "dev": (test_requirements + development_requirements), "all": (yaml_requirements + xml_requirements), }, url="https://github.com/nazrulworld/fhir.resources", version="8.2.1.dev0", zip_safe=False, python_requires=">=3.8", project_urls={ "CI: Travis": "https://travis-ci.org/github/nazrulworld/fhir.resources", "Coverage: codecov": "https://codecov.io/gh/nazrulworld/fhir.resources", "GitHub: issues": "https://github.com/nazrulworld/fhir.resources/issues", "GitHub: repo": "https://github.com/nazrulworld/fhir.resources", }, ) ================================================ FILE: tests/__init__.py ================================================ """Testing related to custom features""" ================================================ FILE: tests/conftest.py ================================================ import os import pathlib from os.path import dirname TESTS_ROOT_PATH = pathlib.Path(dirname(os.path.abspath(__file__))) STATIC_PATH = TESTS_ROOT_PATH / "static" FHIR_XSD_DIR = STATIC_PATH / "xsd" / "fhir" IS_TRAVIS = "TRAVIS" in os.environ ================================================ FILE: tests/patch_r4b_test.py ================================================ # -*- coding: utf-8 -*- import typing __author__ = "Md Nazrul Islam<>" __email__ = "email2nazrul@gmail.com" _APPLIED: bool = False def SearchParameter_get_required_fields(self) -> typing.List[typing.Tuple[str, str]]: """https://www.hl7.org/fhir/extensibility.html#Special-Case In some cases, implementers might find that they do not have appropriate data for an element with minimum cardinality = 1. In this case, the element must be present, but unless the resource or a profile on it has made the actual value of the primitive data type mandatory, it is possible to provide an extension that explains why the primitive value is not present. """ required_fields = [ # ("base", "base__ext"), ("code", "code__ext"), ("description", "description__ext"), ("name", "name__ext"), ("status", "status__ext"), ("type", "type__ext"), ("url", "url__ext"), ] return required_fields def apply(): global _APPLIED if _APPLIED is True: # Already applied, one time only. return # import importlib # from fhir_core import constraints # from fhir_core import types as ftypes # constraints.TYPES_ID_MAX_LENGTH = 64 # importlib.reload(ftypes) from fhir.resources.R4B.searchparameter import SearchParameter # Id.max_length = 255 # some example json file has ID value more than default 64 character # IdType.configure_constraints(min_length=1, max_length=128, regex=None) # SearchParameter.model_fields['id'].metadata[0] = Id(max_length=128, pattern="") # SearchParameter.__pydantic_core_schema__['schema']['schema']['fields']['id']['schema']['schema'].update({ # 'max_length': 255 # }) # {'type': 'str', 'pattern': '^[A-Za-z0-9\\-.]+$', 'max_length': 64, 'min_length': 1, 'metadata': {}} SearchParameter.get_required_fields = SearchParameter_get_required_fields _APPLIED = True ================================================ FILE: tests/static/R4B/Observation.json ================================================ { "resourceType": "Observation", "id": "2minute-apgar-score", "text": { "status": "generated", "div": "\u003cdiv xmlns\u003d\"http://www.w3.org/1999/xhtml\"\u003e\u003cp\u003e\u003cb\u003eGenerated Narrative with Details\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003eid\u003c/b\u003e: 2minute-apgar-score\u003c/p\u003e\u003cp\u003e\u003cb\u003econtained\u003c/b\u003e: \u003c/p\u003e\u003cp\u003e\u003cb\u003estatus\u003c/b\u003e: final\u003c/p\u003e\u003cp\u003e\u003cb\u003ecategory\u003c/b\u003e: Survey \u003cspan\u003e(Details : {http://terminology.hl7.org/CodeSystem/observation-category code \u0027survey\u0027 \u003d \u0027Survey\u0027, given as \u0027Survey\u0027})\u003c/span\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003ecode\u003c/b\u003e: 2 minute Apgar Score \u003cspan\u003e(Details : {LOINC code \u00279273-4\u0027 \u003d \u00272 minute Apgar Score\u0027, given as \u00272 minute Apgar Score\u0027})\u003c/span\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003esubject\u003c/b\u003e: id: newborn; 12345; active; Peter James Chalmers ; gender: male; birthDate: 18/05/2016\u003c/p\u003e\u003cp\u003e\u003cb\u003eeffective\u003c/b\u003e: 18/05/2016 10:33:22 PM\u003c/p\u003e\u003cp\u003e\u003cb\u003eperformer\u003c/b\u003e: \u003ca\u003ePractitioner/example\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003evalue\u003c/b\u003e: 5 {score}\u003cspan\u003e (Details: UCUM code {score} \u003d \u0027{score}\u0027)\u003c/span\u003e\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003cb\u003ecomponent\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003ecode\u003c/b\u003e: Apgar color score \u003cspan\u003e(Details : {SNOMED CT code \u0027249227004\u0027 \u003d \u0027Apgar color score\u0027, given as \u0027Apgar color score\u0027})\u003c/span\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003evalue\u003c/b\u003e: 1. Good color in body with bluish hands or feet \u003cspan\u003e(Details : {LOINC code \u0027LA6723-6\u0027 \u003d \u0027Good color in body with bluish hands or feet\u0027, given as \u0027Good color in body with bluish hands or feet\u0027}; {http://acme.ped/apgarcolor code \u00271\u0027 \u003d \u00271)\u003c/span\u003e\u003c/p\u003e\u003c/blockquote\u003e\u003cblockquote\u003e\u003cp\u003e\u003cb\u003ecomponent\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003ecode\u003c/b\u003e: Apgar respiratory effort score \u003cspan\u003e(Details : {SNOMED CT code \u0027249223000\u0027 \u003d \u0027Apgar heart rate score\u0027, given as \u0027Apgar heart rate score\u0027})\u003c/span\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003evalue\u003c/b\u003e: 1. Fewer than 100 beats per minute \u003cspan\u003e(Details : {LOINC code \u0027LA6720-2\u0027 \u003d \u0027Grimace during suctioning\u0027, given as \u0027Fewer than 100 beats per minute\u0027}; {http://acme.ped/apgarheartrate code \u00271\u0027 \u003d \u00271)\u003c/span\u003e\u003c/p\u003e\u003c/blockquote\u003e\u003cblockquote\u003e\u003cp\u003e\u003cb\u003ecomponent\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003ecode\u003c/b\u003e: Apgar response to stimulus score \u003cspan\u003e(Details : {SNOMED CT code \u0027249226008\u0027 \u003d \u0027Apgar response to stimulus score\u0027, given as \u0027Apgar response to stimulus score\u0027})\u003c/span\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003evalue\u003c/b\u003e: 1. Grimace during suctioning \u003cspan\u003e(Details : {LOINC code \u0027LA6721-0\u0027 \u003d \u0027Grimace and pulling away, cough, or sneeze during suctioning\u0027, given as \u0027Grimace during suctioning\u0027}; {http://acme.ped/apgarreflexirritability code \u00271\u0027 \u003d \u00271)\u003c/span\u003e\u003c/p\u003e\u003c/blockquote\u003e\u003cblockquote\u003e\u003cp\u003e\u003cb\u003ecomponent\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003ecode\u003c/b\u003e: Apgar muscle tone score \u003cspan\u003e(Details : {SNOMED CT code \u0027249225007\u0027 \u003d \u0027Apgar muscle tone score\u0027, given as \u0027Apgar muscle tone score\u0027})\u003c/span\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003evalue\u003c/b\u003e: 1. Some flexion of arms and legs \u003cspan\u003e(Details : {LOINC code \u0027LA6714-5\u0027 \u003d \u0027Some flexion of arms and legs\u0027, given as \u0027Some flexion of arms and legs\u0027}; {http://acme.ped/apgarmuscletone code \u00271\u0027 \u003d \u00271)\u003c/span\u003e\u003c/p\u003e\u003c/blockquote\u003e\u003cblockquote\u003e\u003cp\u003e\u003cb\u003ecomponent\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003ecode\u003c/b\u003e: Apgar respiratory effort score \u003cspan\u003e(Details : {SNOMED CT code \u0027249224006\u0027 \u003d \u0027Apgar respiratory effort score\u0027, given as \u0027Apgar respiratory effort score\u0027})\u003c/span\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003evalue\u003c/b\u003e: 1. Weak cry; may sound like whimpering, slow or irregular breathing \u003cspan\u003e(Details : {LOINC code \u0027LA6726-9\u0027 \u003d \u0027Weak cry; may sound like whimpering, slow or irregular breathing\u0027, given as \u0027Weak cry; may sound like whimpering, slow or irregular breathing\u0027}; {http://acme.ped/apgarrespiratoryeffort code \u00271\u0027 \u003d \u00271)\u003c/span\u003e\u003c/p\u003e\u003c/blockquote\u003e\u003c/div\u003e" }, "contained": [ { "resourceType": "Patient", "id": "newborn", "identifier": [ { "system": "http://acmehealthcare/org/mrns", "value": "12345" } ], "active": true, "name": [ { "family": "Chalmers", "given": [ "Peter", "James" ] } ], "gender": "male", "birthDate": "2016-05-18", "_birthDate": { "extension": [ { "url": "http://hl7.org/fhir/StructureDefinition/patient-birthTime", "valueDateTime": "2016-05-18T10:28:45Z" } ] } } ], "status": "final", "category": [ { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/observation-category", "code": "survey", "display": "Survey" } ], "text": "Survey" } ], "code": { "coding": [ { "system": "http://loinc.org", "code": "9273-4", "display": "2 minute Apgar Score" } ], "text": "2 minute Apgar Score" }, "subject": { "reference": "#newborn" }, "effectiveDateTime": "2016-05-18T22:33:22Z", "performer": [ { "reference": "Practitioner/example" } ], "valueQuantity": { "value": 5, "system": "http://unitsofmeasure.org", "code": "{score}" }, "component": [ { "code": { "coding": [ { "system": "http://snomed.info/sct", "code": "249227004", "display": "Apgar color score" } ], "text": "Apgar color score" }, "valueCodeableConcept": { "coding": [ { "extension": [ { "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue", "valueDecimal": 1 } ], "system": "http://loinc.org", "code": "LA6723-6", "display": "Good color in body with bluish hands or feet" }, { "system": "http://acme.ped/apgarcolor", "code": "1" } ], "text": "1. Good color in body with bluish hands or feet" } }, { "code": { "coding": [ { "system": "http://snomed.info/sct", "code": "249223000", "display": "Apgar heart rate score" } ], "text": "Apgar respiratory effort score" }, "valueCodeableConcept": { "coding": [ { "extension": [ { "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue", "valueDecimal": 1 } ], "system": "http://loinc.org", "code": "LA6720-2", "display": "Fewer than 100 beats per minute" }, { "system": "http://acme.ped/apgarheartrate", "code": "1" } ], "text": "1. Fewer than 100 beats per minute" } }, { "code": { "coding": [ { "system": "http://snomed.info/sct", "code": "249226008", "display": "Apgar response to stimulus score" } ], "text": "Apgar response to stimulus score" }, "valueCodeableConcept": { "coding": [ { "extension": [ { "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue", "valueDecimal": 1 } ], "system": "http://loinc.org", "code": "LA6721-0", "display": "Grimace during suctioning" }, { "system": "http://acme.ped/apgarreflexirritability", "code": "1" } ], "text": "1. Grimace during suctioning" } }, { "code": { "coding": [ { "system": "http://snomed.info/sct", "code": "249225007", "display": "Apgar muscle tone score" } ], "text": "Apgar muscle tone score" }, "valueCodeableConcept": { "coding": [ { "extension": [ { "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue", "valueDecimal": 1 } ], "system": "http://loinc.org", "code": "LA6714-5", "display": "Some flexion of arms and legs" }, { "system": "http://acme.ped/apgarmuscletone", "code": "1" } ], "text": "1. Some flexion of arms and legs" } }, { "code": { "coding": [ { "system": "http://snomed.info/sct", "code": "249224006", "display": "Apgar respiratory effort score" } ], "text": "Apgar respiratory effort score" }, "valueCodeableConcept": { "coding": [ { "extension": [ { "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue", "valueDecimal": 1 } ], "system": "http://loinc.org", "code": "LA6726-9", "display": "Weak cry; may sound like whimpering, slow or irregular breathing" }, { "system": "http://acme.ped/apgarrespiratoryeffort", "code": "1" } ], "text": "1. Weak cry; may sound like whimpering, slow or irregular breathing" } } ], "meta": { "tag": [ { "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", "code": "HTEST", "display": "test health data" } ] } } ================================================ FILE: tests/static/R4B/Patient-with-ext.json ================================================ { "resourceType": "Patient", "identifier": [ { "period": { "start": "2001-05-06" }, "assigner": { "display": "Acme Healthcare" }, "use": "usual", "system": "urn:oid:1.2.36.146.595.217.0.1", "value": "12345" } ], "managingOrganization": { "reference": "Organization/1936778" }, "_active": { "extension": [ { "url": "http://example.org/fhir/StructureDefinition/recordStatus", "valueCode": "archived" } ] }, "name": [ { "given": [ "Peter", "James" ], "use": "official", "family": "Chalmers" }, { "given": [ "Jim" ], "use": "usual" } ], "extension": [ { "url": "http://example.org/fhir/StructureDefinition/patientAvatar", "valueReference": { "reference": "#pic1", "display": "Duck image" } }, { "url": "http://example.org/fhir/StructureDefinition/complexExtensionExample", "extension": [ { "url": "nestedA", "valueCoding": { "system": "http://demo.org/id/4", "code": "AB45", "extension": [ { "url": "http://example.org/fhir/StructureDefinition/extraforcodingWithExt", "extension": [ { "url": "extra1", "valueString": "extra info" } ] }, { "url": "http://example.org/fhir/StructureDefinition/extraforcodingWithValue", "valueInteger": 45 } ] } }, { "url": "nestedB", "id": "q4", "extension": [ { "url": "nestedB1", "valueString": "hello" } ] } ] } ], "modifierExtension": [ { "url": "http://example.org/fhir/StructureDefinition/pi", "valueDecimal": 3.141592653589793 }, { "url": "http://example.org/fhir/StructureDefinition/max-decimal-precision", "valueDecimal": 1.00065022141624642 } ], "gender": "male", "_gender": { "fhir_comments": "This is comment for Gender" }, "birthDate": "1974-12", "deceasedBoolean": true, "address": [ { "fhir_comments": "This is comment for Address.No 1", "use": "home", "line": [ "534 Erewhon St" ], "city": "PleasantVille", "state": "Vic", "postalCode": "3999" } ], "maritalStatus": { "extension": [ { "url": "http://example.org/fhir/StructureDefinition/nullFlavor", "valueCode": "ASKU", "fhir_comments": "This is comment for maritalStatus. Ext 1" } ] }, "multipleBirthInteger": 3, "text": { "status": "generated", "div": "\u003cdiv xmlns\u003d\"http://www.w3.org/1999/xhtml\"\u003e\n \u003ctable\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003eName\u003c/td\u003e\n \u003ctd\u003ePeter James \u003cb\u003eChalmers\u003c/b\u003e (\u0026quot;Jim\u0026quot;)\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd\u003eAddress\u003c/td\u003e\n \u003ctd\u003e534 Erewhon, Pleasantville, Vic, 3999\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd\u003eContacts\u003c/td\u003e\n \u003ctd\u003eHome: unknown. Work: (03) 5555 6473\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd\u003eId\u003c/td\u003e\n \u003ctd\u003eMRN: 12345 (Acme Healthcare)\u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n \u003c/table\u003e\n \u003c/div\u003e" }, "contained": [ { "resourceType": "Binary", "id": "pic1", "contentType": "image/gif", "data": "R0lGODlhEwARAPcAAAAAAAAA/+9aAO+1AP/WAP/eAP/eCP/eEP/eGP/nAP/nCP/nEP/nIf/nKf/nUv/nWv/vAP/vCP/vEP/vGP/vIf/vKf/vMf/vOf/vWv/vY//va//vjP/3c//3lP/3nP//tf//vf///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH5BAEAAAEALAAAAAATABEAAAi+AAMIDDCgYMGBCBMSvMCQ4QCFCQcwDBGCA4cLDyEGECDxAoAQHjxwyKhQAMeGIUOSJJjRpIAGDS5wCDly4AALFlYOgHlBwwOSNydM0AmzwYGjBi8IHWoTgQYORg8QIGDAwAKhESI8HIDgwQaRDI1WXXAhK9MBBzZ8/XDxQoUFZC9IiCBh6wEHGz6IbNuwQoSpWxEgyLCXL8O/gAnylNlW6AUEBRIL7Og3KwQIiCXb9HsZQoIEUzUjNEiaNMKAAAA7" }, { "resourceType": "Organization", "id": "1936778", "text": { "status": "generated", "div": "\u003cdiv xmlns\u003d\"http://www.w3.org/1999/xhtml\"\u003e\n \u003cp\u003eGood Health Clinic\u003c/p\u003e\n \u003c/div\u003e" }, "identifier": [ { "system": "urn:ietf:rfc:3986", "value": "2.16.840.1.113883.19.5" } ], "name": "Good Health Clinic" } ], "contact": [ { "name": { "family": "du Marché", "_family": { "extension": [ { "url": "http://example.org/fhir/StructureDefinition/qualifier", "valueString": "VV" }, { "url": "http://hl7.org/fhir/StructureDefinitioniso-21090#nullFlavor", "valueCode": "ASKU" } ] }, "_given": [ null, { "extension": [ { "url": "http://hl7.org/fhir/StructureDefinition/qualifier", "valueCode": "MID" } ] }, null ], "given": [ "Bénédicte", "Denise", "Marie" ] }, "relationship": [ { "coding": [ { "system": "http://example.org/fhir/CodeSystem/patient-contact-relationship", "code": "partner" } ] } ], "telecom": [ { "system": "phone", "value": "+33 (237) 998327" } ] } ], "generalPractitioner": [ { "reference": "#org3141" } ], "telecom": [ { "use": "home" }, { "system": "phone", "value": "(03) 5555 6473", "use": "work" } ], "meta": { "tag": [ { "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", "code": "HTEST", "display": "test health data" } ] } } ================================================ FILE: tests/static/R4B/Patient-with-ext.xml ================================================
Name Peter James Chalmers ("Jim")
Address 534 Erewhon, Pleasantville, Vic, 3999
Contacts Home: unknown. Work: (03) 5555 6473
Id MRN: 12345 (Acme Healthcare)

Good Health Clinic

================================================ FILE: tests/static/STU3-Bundle-Issue-144.xml ================================================
================================================ FILE: tests/static/example1-Provenance.json ================================================ { "resourceType": "Provenance", "id": "example1", "text": { "status": "generated", "div": "\u003cdiv xmlns\u003d\"http://www.w3.org/1999/xhtml\"\u003e\u003cp\u003e\u003cb\u003eGenerated Narrative: Provenance\u003c/b\u003e\u003ca name\u003d\"example1\"\u003e \u003c/a\u003e\u003c/p\u003e\u003cdiv style\u003d\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"\u003e\u003cp style\u003d\"margin-bottom: 0px\"\u003eResource Provenance \u0026quot;example1\u0026quot; \u003c/p\u003e\u003c/div\u003e\u003cp\u003e\u003cb\u003etarget\u003c/b\u003e: \u003cspan title\u003d\" \n Got the patient\u0027s official name from the patient directly\n \"\u003e\u003ca href\u003d\"patient-example-c.html\"\u003ePatient/pat3/_history/1\u003c/a\u003e \u0026quot;Simon NOTSOWELL\u0026quot;(#n1)\u003c/span\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003erecorded\u003c/b\u003e: 7 Dec 2021, 12:23:45 pm\u003c/p\u003e\u003ch3\u003eAgents\u003c/h3\u003e\u003ctable class\u003d\"grid\"\u003e\u003ctr\u003e\u003ctd\u003e-\u003c/td\u003e\u003ctd\u003e\u003cb\u003eType\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003eWho\u003c/b\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e*\u003c/td\u003e\u003ctd\u003einformant \u003cspan style\u003d\"background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki\"\u003e (\u003ca href\u003d\"http://terminology.hl7.org/5.1.0/CodeSystem-v3-ParticipationType.html\"\u003eParticipationType\u003c/a\u003e#INF)\u003c/span\u003e\u003c/td\u003e\u003ctd\u003e\u003ca href\u003d\"patient-example-c.html\"\u003ePatient/pat3\u003c/a\u003e \u0026quot;Simon NOTSOWELL\u0026quot;\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\u003c/div\u003e" }, "target": [ { "extension": [ { "url": "http://hl7.org/fhir/StructureDefinition/targetElement", "valueUri": "n1" } ], "reference": "Patient/pat3/_history/1" } ], "recorded": "2021-12-07T12:23:45+11:00", "agent": [ { "type": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", "code": "INF" } ] }, "who": { "reference": "Patient/pat3" } } ], "meta": { "tag": [ { "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", "code": "HTEST", "display": "test health data" } ] } } ================================================ FILE: tests/static/patient-example-animal(animal).xml ================================================
Id Kenzi (Dog: Golden Retriever)
Owner Peter Chalmers, 534 Erewhon, Pleasantville, Vic, 3999
Contacts Work: (03) 5555 6473
Id Dog Tag: 1234123 (Maroondah City Council)
================================================ FILE: tests/static/xsd/fhir/account.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Account dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/account.xsd ================================================ A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centers, etc. A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centers, etc. If the element is present, it must have either a @value, an @id, or extensions Unique identifier used to reference the account. Might or might not be intended for human use (e.g. credit card number). Indicates whether the account is presently used/usable or not. Categorizes the account for reporting and searching purposes. Name used for the account when displaying it to humans in reports, etc. Identifies the entity which incurs the expenses. While the immediate recipients of services or goods might be entities related to the subject, the expenses were ultimately incurred by the subject of the Account. The date range of services associated with this account. The party(s) that are responsible for covering the payment of this account, and what order should they be applied to the account. Indicates the service area, hospital, department, etc. with responsibility for managing the Account. Provides additional information about what the account tracks and how it is used. The parties responsible for balancing the account if other payment options fall short. Reference to a parent Account. A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centers, etc. The party(s) that contribute to payment (or part of) of the charges applied to this account (including self-pay). A coverage may only be responsible for specific types of charges, and the sequence of the coverages in the account could be important when processing billing. The priority of the coverage in the context of this account. A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centers, etc. The entity who is responsible. A guarantor may be placed on credit hold or otherwise have their role temporarily suspended. The timeframe during which the guarantor accepts responsibility for the account. Active Inactive Entered in error On Hold Unknown Indicates whether the account is available to be used. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/activitydefinition.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children ActivityDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end age-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. If value is present, it SHALL be positive. per-1: If present, start SHALL have a lower value than end rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided exp-1: An expression or a reference must be provided ================================================ FILE: tests/static/xsd/fhir/activitydefinition.xsd ================================================ This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context. This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this activity definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this activity definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the activity definition is stored on different servers. A formal identifier that is used to identify this activity definition when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the activity definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the activity definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active assets. A natural language name identifying the activity definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the activity definition. An explanatory or alternate title for the activity definition giving additional information about its content. The status of this activity definition. Enables tracking the life-cycle of the content. A Boolean value to indicate that this activity definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. A code or group definition that describes the intended subject of the activity being defined. The date (and optionally time) when the activity definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the activity definition changes. The name of the organization or individual that published the activity definition. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the activity definition from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate activity definition instances. A legal or geographic region in which the activity definition is intended to be used. Explanation of why this activity definition is needed and why it has been designed as it has. A detailed description of how the activity definition is used from a clinical perspective. A copyright statement relating to the activity definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the activity definition. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the activity definition content was or is planned to be in active use. Descriptive topics related to the content of the activity. Topics provide a high-level categorization of the activity that can be useful for filtering and searching. An individiual or organization primarily involved in the creation and maintenance of the content. An individual or organization primarily responsible for internal coherence of the content. An individual or organization primarily responsible for review of some aspect of the content. An individual or organization responsible for officially endorsing the content for use in some setting. Related artifacts such as additional documentation, justification, or bibliographic references. A reference to a Library resource containing any formal logic used by the activity definition. A description of the kind of resource the activity definition is representing. For example, a MedicationRequest, a ServiceRequest, or a CommunicationRequest. Typically, but not always, this is a Request resource. A profile to which the target of the activity definition is expected to conform. Detailed description of the type of activity; e.g. What lab test, what procedure, what kind of encounter. Indicates the level of authority/intentionality associated with the activity and where the request should fit into the workflow chain. Indicates how quickly the activity should be addressed with respect to other requests. Set this to true if the definition is to indicate that a particular activity should NOT be performed. If true, this element should be interpreted to reinforce a negative coding. For example NPO as a code with a doNotPerform of true would still indicate to NOT perform the action. The period, timing or frequency upon which the described activity is to occur. Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc. Indicates who should participate in performing the action described. Identifies the food, drug or other product being consumed or supplied in the activity. Identifies the quantity expected to be consumed at once (per dose, per meal, etc.). Provides detailed dosage instructions in the same way that they are described for MedicationRequest resources. Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites). Defines specimen requirements for the action to be performed, such as required specimens for a lab test. Defines observation requirements for the action to be performed, such as body weight or surface area. Defines the observations that are expected to be produced by the action. A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input. Dynamic values that will be evaluated to produce values for elements of the resulting resource. For example, if the dosage of a medication must be computed based on the patient's weight, a dynamic value would be used to specify an expression that calculated the weight, and the path on the request resource that would contain the result. This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context. The type of participant in the action. The role the participant should play in performing the described action. This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context. The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolveable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details). An expression specifying the value of the customized element. Patient Practitioner Related Person Device The type of participant in the activity. If the element is present, it must have either a @value, an @id, or extensions Proposal Plan Directive Order Original Order Reflex Order Filler Order Instance Order Option Codes indicating the degree of authority/intentionality associated with a request. If the element is present, it must have either a @value, an @id, or extensions Appointment AppointmentResponse CarePlan Claim CommunicationRequest Contract DeviceRequest EnrollmentRequest ImmunizationRecommendation MedicationRequest NutritionOrder ServiceRequest SupplyRequest Task VisionPrescription The kind of activity the definition is describing. If the element is present, it must have either a @value, an @id, or extensions Routine Urgent ASAP STAT Identifies the level of importance to be assigned to actioning the request. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/adverseevent.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children AdverseEvent dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/adverseevent.xsd ================================================ Actual or potential/avoided event causing unintended physical injury resulting from or contributed to by medical care, a research study or other healthcare setting factors that requires additional monitoring, treatment, or hospitalization, or that results in death. Actual or potential/avoided event causing unintended physical injury resulting from or contributed to by medical care, a research study or other healthcare setting factors that requires additional monitoring, treatment, or hospitalization, or that results in death. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this adverse event by the performer or other systems which remain constant as the resource is updated and propagates from server to server. Whether the event actually happened, or just had the potential to. Note that this is independent of whether anyone was affected or harmed or how severely. The overall type of event, intended for search and filtering purposes. This element defines the specific type of event that occurred or that was prevented from occurring. This subject or group impacted by the event. The Encounter during which AdverseEvent was created or to which the creation of this record is tightly associated. The date (and perhaps time) when the adverse event occurred. Estimated or actual date the AdverseEvent began, in the opinion of the reporter. The date on which the existence of the AdverseEvent was first recorded. Includes information about the reaction that occurred as a result of exposure to a substance (for example, a drug or a chemical). The information about where the adverse event occurred. Assessment whether this event was of real importance. Describes the severity of the adverse event, in relation to the subject. Contrast to AdverseEvent.seriousness - a severe rash might not be serious, but a mild heart problem is. Describes the type of outcome from the adverse event. Information on who recorded the adverse event. May be the patient or a practitioner. Parties that may or should contribute or have contributed information to the adverse event, which can consist of one or more activities. Such information includes information leading to the decision to perform the activity and how to perform the activity (e.g. consultant), information that the activity itself seeks to reveal (e.g. informant of clinical history), or information about what activity was performed (e.g. informant witness). Describes the entity that is suspected to have caused the adverse event. AdverseEvent.subjectMedicalHistory. AdverseEvent.referenceDocument. AdverseEvent.study. Actual or potential/avoided event causing unintended physical injury resulting from or contributed to by medical care, a research study or other healthcare setting factors that requires additional monitoring, treatment, or hospitalization, or that results in death. Identifies the actual instance of what caused the adverse event. May be a substance, medication, medication administration, medication statement or a device. Information on the possible cause of the event. Actual or potential/avoided event causing unintended physical injury resulting from or contributed to by medical care, a research study or other healthcare setting factors that requires additional monitoring, treatment, or hospitalization, or that results in death. Assessment of if the entity caused the event. AdverseEvent.suspectEntity.causalityProductRelatedness. AdverseEvent.suspectEntity.causalityAuthor. ProbabilityScale | Bayesian | Checklist. Adverse Event Potential Adverse Event Overall nature of the adverse event, e.g. real or potential. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/allergyintolerance.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children AllergyIntolerance dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label ait-1: AllergyIntolerance.clinicalStatus SHALL be present if verificationStatus is not entered-in-error. ait-2: AllergyIntolerance.clinicalStatus SHALL NOT be present if verification Status is entered-in-error txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided age-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. If value is present, it SHALL be positive. per-1: If present, start SHALL have a lower value than end rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/allergyintolerance.xsd ================================================ Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance. Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this AllergyIntolerance by the performer or other systems which remain constant as the resource is updated and propagates from server to server. The clinical status of the allergy or intolerance. Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product). Identification of the underlying physiological mechanism for the reaction risk. Category of the identified substance. Estimate of the potential clinical harm, or seriousness, of the reaction to the identified substance. Code for an allergy or intolerance statement (either a positive or a negated/excluded statement). This may be a code for a substance or pharmaceutical product that is considered to be responsible for the adverse reaction risk (e.g., "Latex"), an allergy or intolerance condition (e.g., "Latex allergy"), or a negated/excluded code for a specific substance or class (e.g., "No latex allergy") or a general or categorical negated statement (e.g., "No known allergy", "No known drug allergies"). Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'. If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance. The patient who has the allergy or intolerance. The encounter when the allergy or intolerance was asserted. Estimated or actual date, date-time, or age when allergy or intolerance was identified. The recordedDate represents when this particular AllergyIntolerance record was created in the system, which is often a system-generated date. Individual who recorded the record and takes responsibility for its content. The source of the information about the allergy that is recorded. Represents the date and/or time of the last known occurrence of a reaction event. Additional narrative about the propensity for the Adverse Reaction, not captured in other fields. Details about each adverse reaction event linked to exposure to the identified substance. Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance. Identification of the specific substance (or pharmaceutical product) considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'. If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance. Clinical symptoms and/or signs that are observed or associated with the adverse reaction event. Text description about the reaction as a whole, including details of the manifestation if required. Record of the date and/or time of the onset of the Reaction. Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations. Identification of the route by which the subject was exposed to the substance. Additional text about the adverse reaction event not captured in other fields. Low Risk High Risk Unable to Assess Risk Estimate of the potential clinical harm, or seriousness, of a reaction to an identified substance. If the element is present, it must have either a @value, an @id, or extensions Allergy Intolerance Identification of the underlying physiological mechanism for a Reaction Risk. If the element is present, it must have either a @value, an @id, or extensions Food Medication Environment Biologic Category of an identified substance associated with allergies or intolerances. If the element is present, it must have either a @value, an @id, or extensions Mild Moderate Severe Clinical assessment of the severity of a reaction event as a whole, potentially considering multiple different manifestations. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/appointment.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Appointment dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label app-4: Cancelation reason is only used for appointments that have been cancelled, or no-show app-3: Only proposed or cancelled appointments can be missing start/end dates app-2: Either start and end are specified, or neither txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided app-1: Either the type or actor on the participant SHALL be specified ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ================================================ FILE: tests/static/xsd/fhir/appointment.xsd ================================================ A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s). A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s). If the element is present, it must have either a @value, an @id, or extensions This records identifiers associated with this appointment concern that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status. The coded reason for the appointment being cancelled. This is often used in reporting/billing/futher processing to determine if further actions are required, or specific fees apply. A broad categorization of the service that is to be performed during this appointment. The specific service that is to be performed during this appointment. The specialty of a practitioner that would be required to perform the service requested in this appointment. The style of appointment or patient that has been booked in the slot (not service type). The coded reason that this appointment is being scheduled. This is more clinical than administrative. Reason the appointment has been scheduled to take place, as specified using information from another resource. When the patient arrives and the encounter begins it may be used as the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure. The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority). The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field. Additional information to support the appointment provided when making the appointment. Date/Time that the appointment is to take place. Date/Time that the appointment is to conclude. Number of minutes that the appointment is to take. This can be less than the duration between the start and end times. For example, where the actual time of appointment is only an estimate or if a 30 minute appointment is being requested, but any time would work. Also, if there is, for example, a planned 15 minute break in the middle of a long appointment, the duration may be 15 minutes less than the difference between the start and end. The slots from the participants' schedules that will be filled by the appointment. The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment. Additional comments about the appointment. While Appointment.comment contains information for internal use, Appointment.patientInstructions is used to capture patient facing information about the Appointment (e.g. please bring your referral or fast from 8pm night before). The service request this appointment is allocated to assess (e.g. incoming referral or procedure request). List of participants involved in the appointment. A set of date ranges (potentially including times) that the appointment is preferred to be scheduled within. The duration (usually in minutes) could also be provided to indicate the length of the appointment to fill and populate the start/end times for the actual allocated time. However, in other situations the duration may be calculated by the scheduling system. A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s). Role of participant in the appointment. A Person, Location/HealthcareService or Device that is participating in the appointment. Whether this participant is required to be present at the meeting. This covers a use-case where two doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present. Participation status of the actor. Participation period of the actor. Required Optional Information Only Is the Participant required to attend the appointment. If the element is present, it must have either a @value, an @id, or extensions Proposed Pending Booked Arrived Fulfilled Cancelled No Show Entered in error Checked In Waitlisted The free/busy status of an appointment. If the element is present, it must have either a @value, an @id, or extensions Accepted Declined Tentative Needs Action The Participation status of an appointment. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/appointmentresponse.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children AppointmentResponse dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label apr-1: Either the participantType or actor must be specified txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/appointmentresponse.xsd ================================================ A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection. A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection. If the element is present, it must have either a @value, an @id, or extensions This records identifiers associated with this appointment response concern that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate. Appointment that this response is replying to. Date/Time that the appointment is to take place, or requested new start time. This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time. Role of participant in the appointment. A Person, Location, HealthcareService, or Device that is participating in the appointment. Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty. Additional comments about the appointment. ================================================ FILE: tests/static/xsd/fhir/auditevent.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children AuditEvent dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided sev-1: Either a name or a query (NOT both) ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/auditevent.xsd ================================================ A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. If the element is present, it must have either a @value, an @id, or extensions Identifier for a family of the event. For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function. Identifier for the category of event. Indicator for type of action performed during the event that generated the audit. The period during which the activity occurred. The time when the event was recorded. Indicates whether the event succeeded or failed. A free text description of the outcome of the event. The purposeOfUse (reason) that was used during the event being recorded. An actor taking an active role in the event or activity that is logged. The system that is reporting the event. Specific instances of data or objects that have been accessed. A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. Specification of the participation type the user plays when performing the event. The security role that the user was acting under, that come from local codes defined by the access control security system (e.g. RBAC, ABAC) used in the local context. Reference to who this agent is that was involved in the event. Alternative agent Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available. Human-meaningful name for the agent. Indicator that the user is or is not the requestor, or initiator, for the event being audited. Where the event occurred. The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used. Type of media involved. Used when the event is about exporting/importing onto media. Logical network location for application activity, if the activity has a network location. The reason (purpose of use), specific to this agent, that was used during the event being recorded. A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. An identifier for the network access point of the user device for the audit event. An identifier for the type of network access point that originated the audit event. A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. Logical source location within the healthcare enterprise network. For example, a hospital or other provider location within a multi-entity provider group. Identifier of the source where the event was detected. Code specifying the type of source where event originated. A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. Identifies a specific instance of the entity. The reference should be version specific. The type of the object that was involved in this audit event. Code representing the role the entity played in the event being audited. Identifier for the data life-cycle stage for the entity. Security labels for the identified entity. A name of the entity in the audit event. Text that describes the entity in more detail. The query parameters for a query-type entities. Tagged value pairs for conveying additional information about the entity. A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. The type of extra detail provided in the value. The value of the extra detail. Success Minor failure Serious failure Major failure Indicates whether the event succeeded or failed. If the element is present, it must have either a @value, an @id, or extensions Create Read/View/Print Update Delete Execute Indicator for type of action performed during the event that generated the event. If the element is present, it must have either a @value, an @id, or extensions Machine Name IP Address Telephone Number Email address URI The type of network access point of this agent in the audit event. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/basic.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Basic dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/basic.xsd ================================================ Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification. Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification. If the element is present, it must have either a @value, an @id, or extensions Identifier assigned to the resource for business purposes, outside the context of FHIR. Identifies the 'type' of resource - equivalent to the resource name for other resources. Identifies the patient, practitioner, device or any other resource that is the "focus" of this resource. Identifies when the resource was first created. Indicates who was responsible for creating the resource instance. ================================================ FILE: tests/static/xsd/fhir/binary.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Binary ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/binary.xsd ================================================ A resource that represents the data of a single raw artifact as digital content accessible in its native format. A Binary resource can contain any content, whether text, image, pdf, zip archive, etc. A resource that represents the data of a single raw artifact as digital content accessible in its native format. A Binary resource can contain any content, whether text, image, pdf, zip archive, etc. If the element is present, it must have either a @value, an @id, or extensions MimeType of the binary content represented as a standard MimeType (BCP 13). This element identifies another resource that can be used as a proxy of the security sensitivity to use when deciding and enforcing access control rules for the Binary resource. Given that the Binary resource contains very few elements that can be used to determine the sensitivity of the data and relationships to individuals, the referenced resource stands in as a proxy equivalent for this purpose. This referenced resource may be related to the Binary (e.g. Media, DocumentReference), or may be some non-related Resource purely as a security proxy. E.g. to identify that the binary resource relates to a patient, and access should only be granted to applications that have access to the patient. The actual content, base64 encoded. ================================================ FILE: tests/static/xsd/fhir/biologicallyderivedproduct.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children BiologicallyDerivedProduct dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ================================================ FILE: tests/static/xsd/fhir/biologicallyderivedproduct.xsd ================================================ A material substance originating from a biological entity intended to be transplanted or infused into another (possibly the same) biological entity. A material substance originating from a biological entity intended to be transplanted or infused into another (possibly the same) biological entity. If the element is present, it must have either a @value, an @id, or extensions This records identifiers associated with this biologically derived product instance that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). Broad category of this product. A code that identifies the kind of this biologically derived product (SNOMED Ctcode). Whether the product is currently available. Procedure request to obtain this biologically derived product. Number of discrete units within this product. Parent product (if any). How this product was collected. Any processing of the product during collection that does not change the fundamental nature of the product. For example adding anti-coagulants during the collection of Peripheral Blood Stem Cells. Any manipulation of product post-collection that is intended to alter the product. For example a buffy-coat enrichment or CD8 reduction of Peripheral Blood Stem Cells to make it more suitable for infusion. Product storage. A material substance originating from a biological entity intended to be transplanted or infused into another (possibly the same) biological entity. Healthcare professional who is performing the collection. The patient or entity, such as a hospital or vendor in the case of a processed/manipulated/manufactured product, providing the product. Time of product collection. A material substance originating from a biological entity intended to be transplanted or infused into another (possibly the same) biological entity. Description of of processing. Procesing code. Substance added during processing. Time of processing. A material substance originating from a biological entity intended to be transplanted or infused into another (possibly the same) biological entity. Description of manipulation. Time of manipulation. A material substance originating from a biological entity intended to be transplanted or infused into another (possibly the same) biological entity. Description of storage. Storage temperature. Temperature scale used. Storage timeperiod. Organ Tissue Fluid Cells BiologicalAgent Biologically Derived Product Category. If the element is present, it must have either a @value, an @id, or extensions Available Unavailable Biologically Derived Product Status. If the element is present, it must have either a @value, an @id, or extensions Fahrenheit Celsius Kelvin BiologicallyDerived Product Storage Scale. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/bodystructure.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children BodyStructure dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/bodystructure.xsd ================================================ Record details about an anatomical structure. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. Record details about an anatomical structure. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. If the element is present, it must have either a @value, an @id, or extensions Identifier for this instance of the anatomical structure. Whether this body site is in active use. The kind of structure being represented by the body structure at `BodyStructure.location`. This can define both normal and abnormal morphologies. The anatomical location or region of the specimen, lesion, or body structure. Qualifier to refine the anatomical location. These include qualifiers for laterality, relative location, directionality, number, and plane. A summary, characterization or explanation of the body structure. Image or images used to identify a location. The person to which the body site belongs. ================================================ FILE: tests/static/xsd/fhir/bundle.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Bundle bdl-7: FullUrl must be unique in a bundle, or else entries with the same fullUrl must have different meta.versionId (except in history bundles) bdl-9: A document must have an identifier with a system and a value bdl-3: entry.request mandatory for batch/transaction/history, otherwise prohibited bdl-4: entry.response mandatory for batch-response/transaction-response/history, otherwise prohibited bdl-12: A message must have a MessageHeader as the first resource bdl-1: total only when a search or history bdl-2: entry.search only when a search bdl-11: A document must have a Composition as the first resource bdl-10: A document must have a date per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided bdl-8: fullUrl cannot be a version specific reference bdl-5: must be a resource unless there's a request or response ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/bundle.xsd ================================================ A container for a collection of resources. A container for a collection of resources. If the element is present, it must have either a @value, an @id, or extensions A persistent identifier for the bundle that won't change as a bundle is copied from server to server. Indicates the purpose of this bundle - how it is intended to be used. The date/time that the bundle was assembled - i.e. when the resources were placed in the bundle. If a set of search matches, this is the total number of entries of type 'match' across all pages in the search. It does not include search.mode = 'include' or 'outcome' entries and it does not provide a count of the number of entries in the Bundle. A series of links that provide context to this bundle. An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only). Digital Signature - base64 encoded. XML-DSig or a JWT. A container for a collection of resources. A name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1). The reference details for the link. A container for a collection of resources. A series of links that provide context to this entry. The Absolute URL for the resource. The fullUrl SHALL NOT disagree with the id in the resource - i.e. if the fullUrl is not a urn:uuid, the URL shall be version-independent URL consistent with the Resource.id. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: * fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle) * Results from operations might involve resources that are not identified. The Resource for the entry. The purpose/meaning of the resource is determined by the Bundle.type. Information about the search process that lead to the creation of this entry. Additional information about how this entry should be processed as part of a transaction or batch. For history, it shows how the entry was processed to create the version contained in the entry. Indicates the results of processing the corresponding 'request' entry in the batch or transaction being responded to or what the results of an operation where when returning history. A container for a collection of resources. Why this entry is in the result set - whether it's included as a match or because of an _include requirement, or to convey information or warning information about the search process. When searching, the server's search ranking score for the entry. A container for a collection of resources. In a transaction or batch, this is the HTTP action to be executed for this entry. In a history bundle, this indicates the HTTP action that occurred. The URL for this entry, relative to the root (the address to which the request is posted). If the ETag values match, return a 304 Not Modified status. See the API documentation for ["Conditional Read"](http.html#cread). Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread). Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency). Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL - what follows the "?" (not including the "?"). A container for a collection of resources. The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code. The location header created by processing this operation, populated if the operation returns a location. The Etag for the resource, if the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency)). The date/time that the resource was modified on the server. An OperationOutcome containing hints and warnings produced as part of processing this entry in a batch or transaction. GET HEAD POST PUT DELETE PATCH HTTP verbs (in the HTTP command line). See [HTTP rfc](https://tools.ietf.org/html/rfc7231) for details. If the element is present, it must have either a @value, an @id, or extensions Document Message Transaction Transaction Response Batch Batch Response History List Search Results Collection Indicates the purpose of a bundle - how it is intended to be used. If the element is present, it must have either a @value, an @id, or extensions Match Include Outcome Why an entry is in the result set - whether it's included as a match or because of an _include requirement, or to convey information or warning information about the search process. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/capabilitystatement.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children CapabilityStatement dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label cpb-7: The set of documents must be unique by the combination of profile and mode. cpb-16: If kind = requirements, implementation and software must be absent cpb-15: If kind = capability, implementation must be absent, software must be present cpb-3: Messaging end-point is required (and is only permitted) when a statement is for an implementation. cpb-14: If kind = instance, implementation must be present and software may be present cpb-2: A Capability Statement SHALL have at least one of description, software, or implementation element. cpb-1: A Capability Statement SHALL have at least one of REST, messaging or document element. txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpb-9: A given resource can only be described once per RESTful mode. cpb-12: Search parameter names must be unique in the context of a resource. ================================================ FILE: tests/static/xsd/fhir/capabilitystatement.xsd ================================================ A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this capability statement when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this capability statement is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the capability statement is stored on different servers. The identifier that is used to identify this version of the capability statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the capability statement author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the capability statement. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the capability statement. The status of this capability statement. Enables tracking the life-cycle of the content. A Boolean value to indicate that this capability statement is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the capability statement was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the capability statement changes. The name of the organization or individual that published the capability statement. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the capability statement from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate capability statement instances. A legal or geographic region in which the capability statement is intended to be used. Explanation of why this capability statement is needed and why it has been designed as it has. A copyright statement relating to the capability statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the capability statement. The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind, not instance of software) or a class of implementation (e.g. a desired purchase). Reference to a canonical URL of another CapabilityStatement that this software implements. This capability statement is a published API description that corresponds to a business service. The server may actually implement a subset of the capability statement it claims to implement, so the capability statement must specify the full capability details. Reference to a canonical URL of another CapabilityStatement that this software adds to. The capability statement automatically includes everything in the other statement, and it is not duplicated, though the server may repeat the same resources, interactions and operations to add additional details to them. Software that is covered by this capability statement. It is used when the capability statement describes the capabilities of a particular software version, independent of an installation. Identifies a specific implementation instance that is described by the capability statement - i.e. a particular installation, rather than the capabilities of a software program. The version of the FHIR specification that this CapabilityStatement describes (which SHALL be the same as the FHIR version of the CapabilityStatement itself). There is no default value. A list of the formats supported by this implementation using their content types. A list of the patch formats supported by this implementation using their content types. A list of implementation guides that the server does (or should) support in their entirety. A definition of the restful capabilities of the solution, if any. A description of the messaging capabilities of the solution. A document definition. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Name the software is known by. The version identifier for the software covered by this statement. Date this version of the software was released. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Information about the specific installation that this capability statement relates to. An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. The organization responsible for the management of the instance and oversight of the data on the server at the specified URL. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations. Information about the system's restful capabilities that apply across all applications, such as security. Information about security implementation from an interface perspective - what a client needs to know. A specification of the restful capabilities of the solution for a specific resource type. A specification of restful operations supported by the system. Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation. Definition of an operation or a named query together with its parameters and their meaning and type. An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by its canonical URL . A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Server adds CORS headers when responding to requests - this enables Javascript applications to use the server. Types of security services that are supported/required by the system. General description of how security works. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. A type of resource exposed via the restful interface. A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles](profiling.html#profile-uses). A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles](profiling.html#profile-uses). Additional information about the resource type used by the system. Identifies a restful operation supported by the solution. This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API. A flag for whether the server is able to return past versions as part of the vRead operation. A flag to indicate that the server allows or needs to allow the client to create new identities on the server (that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server. A flag that indicates that the server supports conditional create. A code that indicates how the server supports conditional read. A flag that indicates that the server supports conditional update. A code that indicates how the server supports conditional delete. A set of flags that defines how references are supported. A list of _include values supported by the server. A list of _revinclude (reverse include) values supported by the server. Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation. Definition of an operation or a named query together with its parameters and their meaning and type. Consult the definition of the operation for details about how to invoke the operation, and the parameters. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Coded identifier of the operation, supported by the system resource. Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. The name of the search parameter used in the interface. An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]). This element SHALL be populated if the search parameter refers to a SearchParameter defined by the FHIR core specification or externally defined IGs. The type of value a search parameter refers to, and how the content is interpreted. This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. The name of the operation or query. For an operation, this is the name prefixed with $ and used in the URL. For a query, this is the name used in the _query parameter when the query is called. Where the formal definition can be found. If a server references the base definition of an Operation (i.e. from the specification itself such as ```http://hl7.org/fhir/OperationDefinition/ValueSet-expand```), that means it supports the full capabilities of the operation - e.g. both GET and POST invocation. If it only supports a subset, it must define its own custom [[[OperationDefinition]]] with a 'base' of the original OperationDefinition. The custom definition would describe the specific subset of functionality supported. Documentation that describes anything special about the operation behavior, possibly detailing different behavior for system, type and instance-level invocation of the operation. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. A coded identifier of the operation, supported by the system. Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. An endpoint (network accessible address) to which messages and/or replies are to be sent. Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender). Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the capability statement. For example, the process for becoming an authorized messaging exchange partner. References to message definitions for messages this system can send or receive. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. A list of the messaging transport protocol(s) identifiers, supported by this endpoint. The network address of the endpoint. For solutions that do not use network addresses for routing, it can be just an identifier. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. The mode of this event declaration - whether application is sender or receiver. Points to a message definition that identifies the messaging event, message structure, allowed responses, etc. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Mode of this document declaration - whether an application is a producer or consumer. A description of how the application supports or uses the specified document profile. For example, when documents are created, what action is taken with consumed documents, etc. A profile on the document Bundle that constrains which resources are present, and their contents. Instance Capability Requirements How a capability statement is intended to be used. If the element is present, it must have either a @value, an @id, or extensions Sender Receiver The mode of a message capability statement. If the element is present, it must have either a @value, an @id, or extensions No VersionId Support Versioned VersionId tracked fully How the system supports versioning for a resource. If the element is present, it must have either a @value, an @id, or extensions Producer Consumer Whether the application produces or consumes documents. If the element is present, it must have either a @value, an @id, or extensions Client Server The mode of a RESTful capability statement. If the element is present, it must have either a @value, an @id, or extensions read vread update patch delete history-instance history-type create search-type Operations supported by REST at the type or instance level. If the element is present, it must have either a @value, an @id, or extensions transaction batch search-system history-system Operations supported by REST at the system level. If the element is present, it must have either a @value, an @id, or extensions Not Supported If-Modified-Since If-None-Match Full Support A code that indicates how the server supports conditional read. If the element is present, it must have either a @value, an @id, or extensions Literal References Logical References Resolves References Reference Integrity Enforced Local References Only A set of flags that defines how references are supported. If the element is present, it must have either a @value, an @id, or extensions Not Supported Single Deletes Supported Multiple Deletes Supported A code that indicates how the server supports conditional delete. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/careplan.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children CarePlan dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpl-3: Provide a reference or detail, not both ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/careplan.xsd ================================================ Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions. Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this care plan by the performer or other systems which remain constant as the resource is updated and propagates from server to server. The URL pointing to a FHIR-defined protocol, guideline, questionnaire or other definition that is adhered to in whole or in part by this CarePlan. The URL pointing to an externally maintained protocol, guideline, questionnaire or other definition that is adhered to in whole or in part by this CarePlan. A care plan that is fulfilled in whole or in part by this care plan. Completed or terminated care plan whose function is taken by this new care plan. A larger care plan of which this particular care plan is a component or step. Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record. Indicates the level of authority/intentionality associated with the care plan and where the care plan fits into the workflow chain. Identifies what "kind" of plan this is to support differentiation between multiple co-existing plans; e.g. "Home health", "psychiatric", "asthma", "disease management", "wellness plan", etc. Human-friendly name for the care plan. A description of the scope and nature of the plan. Identifies the patient or group whose intended care is described by the plan. The Encounter during which this CarePlan was created or to which the creation of this record is tightly associated. Indicates when the plan did (or is intended to) come into effect and end. Represents when this particular CarePlan record was created in the system, which is often a system-generated date. When populated, the author is responsible for the care plan. The care plan is attributed to the author. Identifies the individual(s) or organization who provided the contents of the care plan. Identifies all people and organizations who are expected to be involved in the care envisioned by this plan. Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan. Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include comorbidities, recent procedures, limitations, recent assessments, etc. Describes the intended objective(s) of carrying out the care plan. Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc. General notes about the care plan not covered elsewhere. Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions. Identifies the outcome at the point when the status of the activity is assessed. For example, the outcome of an education activity could be patient understands (or not). Details of the outcome or action resulting from the activity. The reference to an "event" resource, such as Procedure or Encounter or Observation, is the result/outcome of the activity itself. The activity can be conveyed using CarePlan.activity.detail OR using the CarePlan.activity.reference (a reference to a “request” resource). Notes about the adherence/status/progress of the activity. The details of the proposed activity represented in a specific resource. A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc. Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions. A description of the kind of resource the in-line definition of a care plan activity is representing. The CarePlan.activity.detail is an in-line definition when a resource is not referenced using CarePlan.activity.reference. For example, a MedicationRequest, a ServiceRequest, or a CommunicationRequest. The URL pointing to a FHIR-defined protocol, guideline, questionnaire or other definition that is adhered to in whole or in part by this CarePlan activity. The URL pointing to an externally maintained protocol, guideline, questionnaire or other definition that is adhered to in whole or in part by this CarePlan activity. Detailed description of the type of planned activity; e.g. what lab test, what procedure, what kind of encounter. Provides the rationale that drove the inclusion of this particular activity as part of the plan or the reason why the activity was prohibited. Indicates another resource, such as the health condition(s), whose existence justifies this request and drove the inclusion of this particular activity as part of the plan. Internal reference that identifies the goals that this activity is intended to contribute towards meeting. Identifies what progress is being made for the specific activity. Provides reason why the activity isn't yet started, is on hold, was cancelled, etc. If true, indicates that the described activity is one that must NOT be engaged in when following the plan. If false, or missing, indicates that the described activity is one that should be engaged in when following the plan. The period, timing or frequency upon which the described activity is to occur. Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc. Identifies who's expected to be involved in the activity. Identifies the food, drug or other product to be consumed or supplied in the activity. Identifies the quantity expected to be consumed in a given day. Identifies the quantity expected to be supplied, administered or consumed by the subject. This provides a textual description of constraints on the intended activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. Appointment Appointment Appuntamento RendezVous Cita 预约 CommunicationRequest CommunicationRequest RichiestaDiComunicazione DemandeDeCommunication ComunicaciónRequerimiento 通讯请求 DeviceRequest DeviceRequest RichiestaDispositivo DemandeUtilisationDispositif SolicitudDeDispositivo 装置请求 MedicationRequest MedicationRequest PrescriptionMédicamenteuseTODO 药物请求 PrescripciónMedicaciónTODO /PrescripcionMedicamento NutritionOrder NutritionOrder OrdreNutrition OrdenNutrición 营养医嘱 Task Task Tarea 任务 ServiceRequest ServiceRequest RichiestaDiServizio DemandeService PeticiónServicio 服务项目请求 VisionPrescription VisionPrescription PrescriptionVision PrescripcionDeVision 视力处方 Resource types defined as part of FHIR that can be represented as in-line definitions of a care plan activity. If the element is present, it must have either a @value, an @id, or extensions Not Started Scheduled In Progress On Hold Completed Cancelled Stopped Unknown Entered in Error Codes that reflect the current state of a care plan activity within its overall life cycle. If the element is present, it must have either a @value, an @id, or extensions Proposal Plan Order Option Codes indicating the degree of authority/intentionality associated with a care plan. If the element is present, it must have either a @value, an @id, or extensions Draft Active On Hold Revoked Completed Entered in Error Unknown Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/careteam.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children CareTeam dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ctm-1: CareTeam.participant.onBehalfOf can only be populated when CareTeam.participant.member is a Practitioner ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/careteam.xsd ================================================ The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient. The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this care team by the performer or other systems which remain constant as the resource is updated and propagates from server to server. Indicates the current state of the care team. Identifies what kind of team. This is to support differentiation between multiple co-existing teams, such as care plan team, episode of care team, longitudinal care team. A label for human use intended to distinguish like teams. E.g. the "red" vs. "green" trauma teams. Identifies the patient or group whose intended care is handled by the team. The Encounter during which this CareTeam was created or to which the creation of this record is tightly associated. Indicates when the team did (or is intended to) come into effect and end. Identifies all people and organizations who are expected to be involved in the care team. Describes why the care team exists. Condition(s) that this care team addresses. The organization responsible for the care team. A central contact detail for the care team (that applies to all members). Comments made about the CareTeam. The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient. Indicates specific responsibility of an individual within the care team, such as "Primary care physician", "Trained social worker counselor", "Caregiver", etc. The specific person or organization who is participating/expected to participate in the care team. The organization of the practitioner. Indicates when the specific member or organization did (or is intended to) come into effect and end. Proposed Active Suspended Inactive Entered in Error Indicates the status of the care team. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/catalogentry.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children CatalogEntry dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/catalogentry.xsd ================================================ Catalog entries are wrappers that contextualize items included in a catalog. Catalog entries are wrappers that contextualize items included in a catalog. If the element is present, it must have either a @value, an @id, or extensions Used in supporting different identifiers for the same product, e.g. manufacturer code and retailer code. The type of item - medication, device, service, protocol or other. Whether the entry represents an orderable item. The item in a catalog or definition. Used in supporting related concepts, e.g. NDC to RxNorm. Classes of devices, or ATC for medication. Used to support catalog exchange even for unsupported products, e.g. getting list of medications even if not prescribable. The time period in which this catalog entry is expected to be active. The date until which this catalog entry is expected to be active. Typically date of issue is different from the beginning of the validity. This can be used to see when an item was last updated. Used for examplefor Out of Formulary, or any specifics. User for example for ATC classification, or. Used for example, to point to a substance, or to a device used to administer a medication. Catalog entries are wrappers that contextualize items included in a catalog. The type of relation to the related item: child, parent, packageContent, containerPackage, usedIn, uses, requires, etc. The reference to the related item. Triggers Replaced By The type of relations between entries. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/chargeitem.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children ChargeItem dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/chargeitem.xsd ================================================ The resource ChargeItem describes the provision of healthcare provider products for a certain patient, therefore referring not only to the product, but containing in addition details of the provision, like date, time, amounts and participating organizations and persons. Main Usage of the ChargeItem is to enable the billing process and internal cost allocation. The resource ChargeItem describes the provision of healthcare provider products for a certain patient, therefore referring not only to the product, but containing in addition details of the provision, like date, time, amounts and participating organizations and persons. Main Usage of the ChargeItem is to enable the billing process and internal cost allocation. If the element is present, it must have either a @value, an @id, or extensions Identifiers assigned to this event performer or other systems. References the (external) source of pricing information, rules of application for the code this ChargeItem uses. References the source of pricing information, rules of application for the code this ChargeItem uses. The current state of the ChargeItem. ChargeItems can be grouped to larger ChargeItems covering the whole set. A code that identifies the charge, like a billing code. The individual or set of individuals the action is being or was performed on. The encounter or episode of care that establishes the context for this event. Date/time(s) or duration when the charged service was applied. Indicates who or what performed or participated in the charged service. The organization requesting the service. The organization performing the service. The financial cost center permits the tracking of charge attribution. Quantity of which the charge item has been serviced. The anatomical location where the related service has been applied. Factor overriding the factor determined by the rules associated with the code. Total price of the charge overriding the list price associated with the code. If the list price or the rule-based factor associated with the code is overridden, this attribute can capture a text to indicate the reason for this action. The device, practitioner, etc. who entered the charge item. Date the charge item was entered. Describes why the event occurred in coded or textual form. Indicated the rendered service that caused this charge. Identifies the device, food, drug or other product being charged either by type code or reference to an instance. Account into which this ChargeItems belongs. Comments made about the event by the performer, subject or other participants. Further information supporting this charge. The resource ChargeItem describes the provision of healthcare provider products for a certain patient, therefore referring not only to the product, but containing in addition details of the provision, like date, time, amounts and participating organizations and persons. Main Usage of the ChargeItem is to enable the billing process and internal cost allocation. Describes the type of performance or participation(e.g. primary surgeon, anesthesiologiest, etc.). The device, practitioner, etc. who performed or participated in the service. Planned Billable Not billable Aborted Billed Entered in Error Unknown Codes identifying the lifecycle stage of a ChargeItem. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/chargeitemdefinition.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children ChargeItemDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/chargeitemdefinition.xsd ================================================ The ChargeItemDefinition resource provides the properties that apply to the (billing) codes necessary to calculate costs and prices. The properties may differ largely depending on type and realm, therefore this resource gives only a rough structure and requires profiling for each type of billing code system. The ChargeItemDefinition resource provides the properties that apply to the (billing) codes necessary to calculate costs and prices. The properties may differ largely depending on type and realm, therefore this resource gives only a rough structure and requires profiling for each type of billing code system. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this charge item definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this charge item definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the charge item definition is stored on different servers. A formal identifier that is used to identify this charge item definition when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the charge item definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the charge item definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active assets. A short, descriptive, user-friendly title for the charge item definition. The URL pointing to an externally-defined charge item definition that is adhered to in whole or in part by this definition. A larger definition of which this particular definition is a component or step. As new versions of a protocol or guideline are defined, allows identification of what versions are replaced by a new instance. The current state of the ChargeItemDefinition. A Boolean value to indicate that this charge item definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the charge item definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the charge item definition changes. The name of the organization or individual that published the charge item definition. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the charge item definition from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate charge item definition instances. A legal or geographic region in which the charge item definition is intended to be used. A copyright statement relating to the charge item definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the charge item definition. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the charge item definition content was or is planned to be in active use. The defined billing details in this resource pertain to the given billing code. The defined billing details in this resource pertain to the given product instance(s). Expressions that describe applicability criteria for the billing code. Group of properties which are applicable under the same conditions. If no applicability rules are established for the group, then all properties always apply. The ChargeItemDefinition resource provides the properties that apply to the (billing) codes necessary to calculate costs and prices. The properties may differ largely depending on type and realm, therefore this resource gives only a rough structure and requires profiling for each type of billing code system. A brief, natural language description of the condition that effectively communicates the intended semantics. The media type of the language for the expression, e.g. "text/cql" for Clinical Query Language expressions or "text/fhirpath" for FHIRPath expressions. An expression that returns true or false, indicating whether the condition is satisfied. When using FHIRPath expressions, the %context environment variable must be replaced at runtime with the ChargeItem resource to which this definition is applied. The ChargeItemDefinition resource provides the properties that apply to the (billing) codes necessary to calculate costs and prices. The properties may differ largely depending on type and realm, therefore this resource gives only a rough structure and requires profiling for each type of billing code system. Expressions that describe applicability criteria for the priceComponent. The price for a ChargeItem may be calculated as a base price with surcharges/deductions that apply in certain conditions. A ChargeItemDefinition resource that defines the prices, factors and conditions that apply to a billing code is currently under development. The priceComponent element can be used to offer transparency to the recipient of the Invoice of how the prices have been calculated. The ChargeItemDefinition resource provides the properties that apply to the (billing) codes necessary to calculate costs and prices. The properties may differ largely depending on type and realm, therefore this resource gives only a rough structure and requires profiling for each type of billing code system. This code identifies the type of the component. A code that identifies the component. Codes may be used to differentiate between kinds of taxes, surcharges, discounts etc. The factor that has been applied on the base price for calculating this component. The amount calculated for this component. base price surcharge deduction discount tax informational Codes indicating the kind of the price component. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/claim.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Claim dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/claim.xsd ================================================ A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this claim. The status of the resource instance. The category of claim, e.g. oral, pharmacy, vision, institutional, professional. A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service. A code to indicate whether the nature of the request is: to request adjudication of products and services previously rendered; or requesting authorization and adjudication for provision in the future; or requesting the non-binding adjudication of the listed products and services which could be provided in the future. The party to whom the professional services and/or products have been supplied or are being considered and for whom actual or forecast reimbursement is sought. The period for which charges are being submitted. The date this resource was created. Individual who created the claim, predetermination or preauthorization. The Insurer who is target of the request. The provider which is responsible for the claim, predetermination or preauthorization. The provider-required urgency of processing the request. Typical values include: stat, routine deferred. A code to indicate whether and for whom funds are to be reserved for future claims. Other claims which are related to this claim such as prior submissions or claims for related services or for the same event. Prescription to support the dispensing of pharmacy, device or vision products. Original prescription which has been superseded by this prescription to support the dispensing of pharmacy services, medications or products. The party to be reimbursed for cost of the products and services according to the terms of the policy. A reference to a referral resource. Facility where the services were provided. The members of the team who provided the products and services. Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues. Information about diagnoses relevant to the claim items. Procedures performed on the patient relevant to the billing items with the claim. Financial instruments for reimbursement for the health care products and services specified on the claim. Details of an accident which resulted in injuries which required the products and services listed in the claim. A claim line. Either a simple product or service or a 'group' of details which can each be a simple items or groups of sub-details. The total value of the all the items in the claim. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. Reference to a related claim. A code to convey how the claims are related. An alternate organizational reference to the case or file to which this particular claim pertains. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. Type of Party to be reimbursed: subscriber, provider, other. Reference to the individual or organization to whom any payment will be made. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. A number to uniquely identify care team entries. Member of the team who provided the product or service. The party who is billing and/or responsible for the claimed products or services. The lead, assisting or supervising practitioner and their discipline if a multidisciplinary team. The qualification of the practitioner which is applicable for this service. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. A number to uniquely identify supporting information entries. The general class of the information supplied: information; exception; accident, employment; onset, etc. System and code pertaining to the specific information regarding special conditions relating to the setting, treatment or patient for which care is sought. The date when or period to which this information refers. Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data. Provides the reason in the situation where a reason code is required in addition to the content. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. A number to uniquely identify diagnosis entries. The nature of illness or problem in a coded form or as a reference to an external defined Condition. When the condition was observed or the relative ranking. Indication of whether the diagnosis was present on admission to a facility. A package billing code or bundle code used to group products and services to a particular health condition (such as heart attack) which is based on a predetermined grouping code system. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. A number to uniquely identify procedure entries. When the condition was observed or the relative ranking. Date and optionally time the procedure was performed. The code or reference to a Procedure resource which identifies the clinical intervention performed. Unique Device Identifiers associated with this line item. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. A number to uniquely identify insurance entries and provide a sequence of coverages to convey coordination of benefit order. A flag to indicate that this Coverage is to be used for adjudication of this claim when set to true. The business identifier to be used when the claim is sent for adjudication against this insurance policy. Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system. A business agreement number established between the provider and the insurer for special business processing purposes. Reference numbers previously provided by the insurer to the provider to be quoted on subsequent claims containing services or products related to the prior authorization. The result of the adjudication of the line items for the Coverage specified in this insurance. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. Date of an accident event related to the products and services contained in the claim. The type or context of the accident event for the purposes of selection of potential insurance coverages and determination of coordination between insurers. The physical location of the accident event. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. A number to uniquely identify item entries. CareTeam members related to this service or product. Diagnosis applicable for this service or product. Procedures applicable for this service or product. Exceptions, special conditions and supporting information applicable for this service or product. The type of revenue or cost center providing the product and/or service. Code to identify the general type of benefits under which products and services are provided. When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. Identifies the program under which this may be recovered. The date or dates when the service or product was supplied, performed or completed. Where the product or service was provided. The number of repetitions of a service or product. If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group. A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. The quantity times the unit price for an additional service or product or charge. Unique Device Identifiers associated with this line item. Physical service site on the patient (limb, tooth, etc.). A region or surface of the bodySite, e.g. limb region or tooth surface(s). The Encounters during which this Claim was created or to which the creation of this record is tightly associated. A claim detail line. Either a simple (a product or service) or a 'group' of sub-details which are simple items. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. A number to uniquely identify item entries. The type of revenue or cost center providing the product and/or service. Code to identify the general type of benefits under which products and services are provided. When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. Identifies the program under which this may be recovered. The number of repetitions of a service or product. If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group. A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. The quantity times the unit price for an additional service or product or charge. Unique Device Identifiers associated with this line item. A claim detail line. Either a simple (a product or service) or a 'group' of sub-details which are simple items. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. A number to uniquely identify item entries. The type of revenue or cost center providing the product and/or service. Code to identify the general type of benefits under which products and services are provided. When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. Identifies the program under which this may be recovered. The number of repetitions of a service or product. If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group. A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. The quantity times the unit price for an additional service or product or charge. Unique Device Identifiers associated with this line item. Claim Preauthorization Predetermination The purpose of the Claim: predetermination, preauthorization, claim. If the element is present, it must have either a @value, an @id, or extensions Active Cancelled Draft Entered in Error A code specifying the state of the resource instance. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/claimresponse.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children ClaimResponse dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/claimresponse.xsd ================================================ This resource provides the adjudication details from the processing of a Claim resource. This resource provides the adjudication details from the processing of a Claim resource. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this claim response. The status of the resource instance. A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service. A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service. A code to indicate whether the nature of the request is: to request adjudication of products and services previously rendered; or requesting authorization and adjudication for provision in the future; or requesting the non-binding adjudication of the listed products and services which could be provided in the future. The party to whom the professional services and/or products have been supplied or are being considered and for whom actual for facast reimbursement is sought. The date this resource was created. The party responsible for authorization, adjudication and reimbursement. The provider which is responsible for the claim, predetermination or preauthorization. Original request resource reference. The outcome of the claim, predetermination, or preauthorization processing. A human readable description of the status of the adjudication. Reference from the Insurer which is used in later communications which refers to this adjudication. The time frame during which this authorization is effective. Type of Party to be reimbursed: subscriber, provider, other. A claim line. Either a simple (a product or service) or a 'group' of details which can also be a simple items or groups of sub-details. The first-tier service adjudications for payor added product or service lines. The adjudication results which are presented at the header level rather than at the line-item or add-item levels. Categorized monetary totals for the adjudication. Payment details for the adjudication of the claim. A code, used only on a response to a preauthorization, to indicate whether the benefits payable have been reserved and for whom. A code for the form to be used for printing the content. The actual form, by reference or inclusion, for printing the content or an EOB. A note that describes or explains adjudication results in a human readable form. Request for additional supporting or authorizing information. Financial instruments for reimbursement for the health care products and services specified on the claim. Errors encountered during the processing of the adjudication. This resource provides the adjudication details from the processing of a Claim resource. A number to uniquely reference the claim item entries. The numbers associated with notes below which apply to the adjudication of this item. If this item is a group then the values here are a summary of the adjudication of the detail items. If this item is a simple product or service then this is the result of the adjudication of this item. A claim detail. Either a simple (a product or service) or a 'group' of sub-details which are simple items. This resource provides the adjudication details from the processing of a Claim resource. A code to indicate the information type of this adjudication record. Information types may include the value submitted, maximum values or percentages allowed or payable under the plan, amounts that: the patient is responsible for in aggregate or pertaining to this item; amounts paid by other coverages; and, the benefit payable for this item. A code supporting the understanding of the adjudication result and explaining variance from expected amount. Monetary amount associated with the category. A non-monetary value associated with the category. Mutually exclusive to the amount element above. This resource provides the adjudication details from the processing of a Claim resource. A number to uniquely reference the claim detail entry. The numbers associated with notes below which apply to the adjudication of this item. The adjudication results. A sub-detail adjudication of a simple product or service. This resource provides the adjudication details from the processing of a Claim resource. A number to uniquely reference the claim sub-detail entry. The numbers associated with notes below which apply to the adjudication of this item. The adjudication results. This resource provides the adjudication details from the processing of a Claim resource. Claim items which this service line is intended to replace. The sequence number of the details within the claim item which this line is intended to replace. The sequence number of the sub-details within the details within the claim item which this line is intended to replace. The providers who are authorized for the services rendered to the patient. When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. Identifies the program under which this may be recovered. The date or dates when the service or product was supplied, performed or completed. Where the product or service was provided. The number of repetitions of a service or product. If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group. A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. The quantity times the unit price for an additional service or product or charge. Physical service site on the patient (limb, tooth, etc.). A region or surface of the bodySite, e.g. limb region or tooth surface(s). The numbers associated with notes below which apply to the adjudication of this item. The adjudication results. The second-tier service adjudications for payor added services. This resource provides the adjudication details from the processing of a Claim resource. When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. The number of repetitions of a service or product. If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group. A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. The quantity times the unit price for an additional service or product or charge. The numbers associated with notes below which apply to the adjudication of this item. The adjudication results. The third-tier service adjudications for payor added services. This resource provides the adjudication details from the processing of a Claim resource. When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. The number of repetitions of a service or product. If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group. A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. The quantity times the unit price for an additional service or product or charge. The numbers associated with notes below which apply to the adjudication of this item. The adjudication results. This resource provides the adjudication details from the processing of a Claim resource. A code to indicate the information type of this adjudication record. Information types may include: the value submitted, maximum values or percentages allowed or payable under the plan, amounts that the patient is responsible for in aggregate or pertaining to this item, amounts paid by other coverages, and the benefit payable for this item. Monetary total amount associated with the category. This resource provides the adjudication details from the processing of a Claim resource. Whether this represents partial or complete payment of the benefits payable. Total amount of all adjustments to this payment included in this transaction which are not related to this claim's adjudication. Reason for the payment adjustment. Estimated date the payment will be issued or the actual issue date of payment. Benefits payable less any payment adjustment. Issuer's unique identifier for the payment instrument. This resource provides the adjudication details from the processing of a Claim resource. A number to uniquely identify a note entry. The business purpose of the note text. The explanation or description associated with the processing. A code to define the language used in the text of the note. This resource provides the adjudication details from the processing of a Claim resource. A number to uniquely identify insurance entries and provide a sequence of coverages to convey coordination of benefit order. A flag to indicate that this Coverage is to be used for adjudication of this claim when set to true. Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system. A business agreement number established between the provider and the insurer for special business processing purposes. The result of the adjudication of the line items for the Coverage specified in this insurance. This resource provides the adjudication details from the processing of a Claim resource. The sequence number of the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure. The sequence number of the detail within the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure. The sequence number of the sub-detail within the detail within the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure. An error code, from a specified code system, which details why the claim could not be adjudicated. Queued Processing Complete Error Partial Processing The result of the claim processing. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/clinicalimpression.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children ClinicalImpression dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/clinicalimpression.xsd ================================================ A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this clinical impression by the performer or other systems which remain constant as the resource is updated and propagates from server to server. Identifies the workflow status of the assessment. Captures the reason for the current state of the ClinicalImpression. Categorizes the type of clinical assessment performed. A summary of the context and/or cause of the assessment - why / where it was performed, and what patient events/status prompted it. The patient or group of individuals assessed as part of this record. The Encounter during which this ClinicalImpression was created or to which the creation of this record is tightly associated. The point in time or period over which the subject was assessed. Indicates when the documentation of the assessment was complete. The clinician performing the assessment. A reference to the last assessment that was conducted on this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes. A list of the relevant problems/conditions for a patient. One or more sets of investigations (signs, symptoms, etc.). The actual grouping of investigations varies greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes. Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis. A text summary of the investigations and the diagnosis. Specific findings or diagnoses that were considered likely or relevant to ongoing treatment. Estimate of likely outcome. RiskAssessment expressing likely outcome. Information supporting the clinical impression. Commentary about the impression, typically recorded after the impression itself was made, though supplemental notes by the original author could also appear. A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutritional) history may be used. A record of a specific investigation that was undertaken. A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. Specific text or code for finding or diagnosis, which may include ruled-out or resolved conditions. Specific reference for finding or diagnosis, which may include ruled-out or resolved conditions. Which investigations support finding or diagnosis. In Progress Completed Entered in Error The workflow state of a clinical impression. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/codesystem.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children CodeSystem dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label csd-1: Within a code system definition, all the codes SHALL be unique txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/codesystem.xsd ================================================ The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content. The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this code system when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this code system is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the code system is stored on different servers. This is used in [Coding](datatypes.html#Coding).system. A formal identifier that is used to identify this code system when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the code system when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the code system author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. This is used in [Coding](datatypes.html#Coding).version. A natural language name identifying the code system. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the code system. The date (and optionally time) when the code system resource was created or revised. A Boolean value to indicate that this code system is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the code system was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the code system changes. The name of the organization or individual that published the code system. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the code system from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate code system instances. A legal or geographic region in which the code system is intended to be used. Explanation of why this code system is needed and why it has been designed as it has. A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system. If code comparison is case sensitive when codes within this system are compared to each other. Canonical reference to the value set that contains the entire code system. The meaning of the hierarchy of concepts as represented in this resource. The code system defines a compositional (post-coordination) grammar. This flag is used to signify that the code system does not commit to concept permanence across versions. If true, a version must be specified when referencing this code system. The extent of the content of the code system (the concepts and codes it defines) are represented in this resource instance. The canonical URL of the code system that this code system supplement is adding designations and properties to. The total number of concepts defined by the code system. Where the code system has a compositional grammar, the basis of this count is defined by the system steward. A filter that can be used in a value set compose statement when selecting concepts using a filter. A property defines an additional slot through which additional information can be provided about a concept. Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meanings of the hierarchical relationships are. The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content. The code that identifies this filter when it is used as a filter in [[[ValueSet]]].compose.include.filter. A description of how or why the filter is used. A list of operators that can be used with the filter. A description of what the value for the filter should be. The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content. A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters. Reference to the formal meaning of the property. One possible source of meaning is the [Concept Properties](codesystem-concept-properties.html) code system. A description of the property- why it is defined, and how its value might be used. The type of the property value. Properties of type "code" contain a code defined by the code system (e.g. a reference to another defined concept). The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content. A code - a text symbol - that uniquely identifies the concept within the code system. A human readable string that is the recommended default way to present this concept to a user. The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept. Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc. A property value for this concept. Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) - see hierarchyMeaning. The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content. The language this designation is defined for. A code that details how this designation would be used. The text value for this designation. The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content. A code that is a reference to CodeSystem.property.code. The value of this property. Equals Is A (by subsumption) Descendent Of (by subsumption) Not (Is A) (by subsumption) Regular Expression In Set Not in Set Generalizes (by Subsumption) Exists The kind of operation to perform as a part of a property based filter. If the element is present, it must have either a @value, an @id, or extensions code (internal reference) Coding (external reference) string integer boolean dateTime decimal The type of a property value. If the element is present, it must have either a @value, an @id, or extensions Grouped By Is-A Part Of Classified With The meaning of the hierarchy of concepts in a code system. If the element is present, it must have either a @value, an @id, or extensions Not Present Example Fragment Complete Supplement The extent of the content of the code system (the concepts and codes it defines) are represented in a code system resource. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/communication.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Communication dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/communication.xsd ================================================ An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency that was notified about a reportable condition. An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency that was notified about a reportable condition. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this communication by the performer or other systems which remain constant as the resource is updated and propagates from server to server. The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication. The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication. An order, proposal or plan fulfilled in whole or in part by this Communication. Part of this action. Prior communication that this communication is in response to. The status of the transmission. Captures the reason for the current state of the Communication. The type of message conveyed such as alert, notification, reminder, instruction, etc. Characterizes how quickly the planned or in progress communication must be addressed. Includes concepts such as stat, urgent, routine. A channel that was used for this communication (e.g. email, fax). The patient or group that was the focus of this communication. Description of the purpose/content, similar to a subject line in an email. Other resources that pertain to this communication and to which this communication should be associated. The Encounter during which this Communication was created or to which the creation of this record is tightly associated. The time when this communication was sent. The time when this communication arrived at the destination. The entity (e.g. person, organization, clinical information system, care team or device) which was the target of the communication. If receipts need to be tracked by an individual, a separate resource instance will need to be created for each recipient. Multiple recipient communications are intended where either receipts are not tracked (e.g. a mass mail-out) or a receipt is captured in aggregate (all emails confirmed received by a particular time). The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication. The reason or justification for the communication. Indicates another resource whose existence justifies this communication. Text, attachment(s), or resource(s) that was communicated to the recipient. Additional notes or commentary about the communication by the sender, receiver or other interested parties. An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency that was notified about a reportable condition. A communicated content (or for multi-part communications, one portion of the communication). Preparation In Progress Not Done On Hold Stopped Completed Entered in Error Unknown The status of the communication. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/communicationrequest.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children CommunicationRequest dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/communicationrequest.xsd ================================================ A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition. A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this communication request by the performer or other systems which remain constant as the resource is updated and propagates from server to server. A plan or proposal that is fulfilled in whole or in part by this request. Completed or terminated request(s) whose function is taken by this new request. A shared identifier common to all requests that were authorized more or less simultaneously by a single author, representing the identifier of the requisition, prescription or similar form. The status of the proposal or order. Captures the reason for the current state of the CommunicationRequest. The type of message to be sent such as alert, notification, reminder, instruction, etc. Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine. If true indicates that the CommunicationRequest is asking for the specified action to *not* occur. A channel that was used for this communication (e.g. email, fax). The patient or group that is the focus of this communication request. Other resources that pertain to this communication request and to which this communication request should be associated. The Encounter during which this CommunicationRequest was created or to which the creation of this record is tightly associated. Text, attachment(s), or resource(s) to be communicated to the recipient. The time when this communication is to occur. For draft requests, indicates the date of initial creation. For requests with other statuses, indicates the date of activation. The device, individual, or organization who initiated the request and has responsibility for its activation. The entity (e.g. person, organization, clinical information system, device, group, or care team) which is the intended target of the communication. The entity (e.g. person, organization, clinical information system, or device) which is to be the source of the communication. Describes why the request is being made in coded or textual form. Indicates another resource whose existence justifies this request. Comments made about the request by the requester, sender, recipient, subject or other participants. A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition. The communicated content (or for multi-part communications, one portion of the communication). ================================================ FILE: tests/static/xsd/fhir/compartmentdefinition.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children CompartmentDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/compartmentdefinition.xsd ================================================ A compartment definition that defines how resources are accessed on a server. A compartment definition that defines how resources are accessed on a server. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this compartment definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this compartment definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the compartment definition is stored on different servers. The identifier that is used to identify this version of the compartment definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the compartment definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the compartment definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. The status of this compartment definition. Enables tracking the life-cycle of the content. A Boolean value to indicate that this compartment definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the compartment definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the compartment definition changes. The name of the organization or individual that published the compartment definition. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the compartment definition from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate compartment definition instances. Explanation of why this compartment definition is needed and why it has been designed as it has. Which compartment this definition describes. Whether the search syntax is supported,. Information about how a resource is related to the compartment. A compartment definition that defines how resources are accessed on a server. The name of a resource supported by the server. The name of a search parameter that represents the link to the compartment. More than one may be listed because a resource may be linked to a compartment in more than one way,. Additional documentation about the resource and compartment. Patient Encounter RelatedPerson Practitioner Device Which type a compartment definition describes. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/composition.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Composition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cmp-1: A section must contain at least one of text, entries, or sub-sections cmp-2: A section can only have an emptyReason if it is empty ================================================ FILE: tests/static/xsd/fhir/composition.xsd ================================================ A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.). A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.). If the element is present, it must have either a @value, an @id, or extensions A version-independent identifier for the Composition. This identifier stays constant as the composition is changed over time. The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document. Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition. A categorization for the type of the composition - helps for indexing and searching. This may be implied by or derived from the code specified in the Composition Type. Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure). Describes the clinical encounter or type of care this documentation is associated with. The composition editing time, when the composition was last logically changed by the author. Identifies who is responsible for the information in the composition, not necessarily who typed it in. Official human-readable label for the composition. The code specifying the level of confidentiality of the Composition. A participant who has attested to the accuracy of the composition/document. Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information. Relationships that this composition has with other compositions or documents that already exist. The clinical service, such as a colonoscopy or an appendectomy, being documented. The root of the sections that make up the composition. A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.). The type of attestation the authenticator offers. When the composition was attested by the party. Who attested the composition in the specified way. A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.). The type of relationship that this composition has with anther composition or document. The target composition/document of this relationship. A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.). This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act. The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time. The description and/or reference of the event(s) being documented. For example, this could be used to document such a colonoscopy or an appendectomy. A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.). The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents. A code identifying the kind of content contained within the section. This must be consistent with the section title. Identifies who is responsible for the information in this section, not necessarily who typed it in. The actual focus of the section when it is not the subject of the composition, but instead represents something or someone associated with the subject such as (for a patient subject) a spouse, parent, fetus, or donor. If not focus is specified, the focus is assumed to be focus of the parent section, or, for a section in the Composition itself, the subject of the composition. Sections with a focus SHALL only include resources where the logical subject (patient, subject, focus, etc.) matches the section focus, or the resources have no logical subject (few resources). A human-readable narrative that contains the attested content of the section, used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. How the entry list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted. Specifies the order applied to the items in the section entries. A reference to the actual resource from which the narrative in the section is derived. If the section is empty, why the list is empty. An empty section typically has some text explaining the empty reason. A nested sub-section within this section. unrestricted low moderate normal restricted very restricted Codes specifying the level of confidentiality of the composition. If the element is present, it must have either a @value, an @id, or extensions Preliminary Final Amended Entered in Error The workflow/clinical status of the composition. If the element is present, it must have either a @value, an @id, or extensions Replaces Transforms Signs Appends The type of relationship between documents. If the element is present, it must have either a @value, an @id, or extensions Personal Professional Legal Official The way in which a person authenticated a composition. If the element is present, it must have either a @value, an @id, or extensions Working List Snapshot List Change List The processing mode that applies to this section. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/conceptmap.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children ConceptMap dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cmd-1: If the map is narrower or inexact, there SHALL be some comments cmd-3: If the mode is 'other-map', a url must be provided cmd-2: If the mode is 'fixed', a code must be provided ================================================ FILE: tests/static/xsd/fhir/conceptmap.xsd ================================================ A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models. A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this concept map when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this concept map is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the concept map is stored on different servers. A formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the concept map author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the concept map. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the concept map. The status of this concept map. Enables tracking the life-cycle of the content. A Boolean value to indicate that this concept map is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the concept map was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the concept map changes. The name of the organization or individual that published the concept map. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the concept map from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate concept map instances. A legal or geographic region in which the concept map is intended to be used. Explanation of why this concept map is needed and why it has been designed as it has. A copyright statement relating to the concept map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the concept map. Identifier for the source value set that contains the concepts that are being mapped and provides context for the mappings. The target value set provides context for the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made. A group of mappings that all have the same source and target system. A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models. An absolute URI that identifies the source system where the concepts to be mapped are defined. The specific version of the code system, as determined by the code system authority. An absolute URI that identifies the target system that the concepts will be mapped to. The specific version of the code system, as determined by the code system authority. Mappings for an individual concept in the source to one or more concepts in the target. What to do when there is no mapping for the source concept. "Unmapped" does not include codes that are unmatched, and the unmapped element is ignored in a code is specified to have equivalence = unmatched. A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models. Identity (code or path) or the element/item being mapped. The display for the code. The display is only provided to help editors when editing the concept map. A concept from the target value set that this concept maps to. A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models. Identity (code or path) or the element/item that the map refers to. The display for the code. The display is only provided to help editors when editing the concept map. The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from target to source (e.g. the target is 'wider' than the source). A description of status/issues in mapping that conveys additional information not represented in the structured data. A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value. A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on. A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models. A reference to an element that holds a coded value that corresponds to a code system property. The idea is that the information model carries an element somewhere that is labeled to correspond with a code system property. An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that crosses code systems). Identity (code or path) or the element/item/ValueSet/text that the map depends on / refers to. The display for the code. The display is only provided to help editors when editing the concept map. A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models. Defines which action to take if there is no match for the source concept in the target system designated for the group. One of 3 actions are possible: use the unmapped code (this is useful when doing a mapping between versions, and only a few codes have changed), use a fixed code (a default code), or alternatively, a reference to a different concept map can be provided (by canonical URL). The fixed code to use when the mode = 'fixed' - all unmapped codes are mapped to a single fixed code. The display for the code. The display is only provided to help editors when editing the concept map. The canonical reference to an additional ConceptMap resource instance to use for mapping if this ConceptMap resource contains no matching mapping for the source concept. Provided Code Fixed Code Other Map Defines which action to take if there is no match in the group. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/condition.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Condition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label con-5: Condition.clinicalStatus SHALL NOT be present if verification Status is entered-in-error con-4: If condition is abated, then clinicalStatus must be either inactive, resolved, or remission txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided age-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. If value is present, it SHALL be positive. per-1: If present, start SHALL have a lower value than end rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present age-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. If value is present, it SHALL be positive. per-1: If present, start SHALL have a lower value than end rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided con-1: Stage SHALL have summary or assessment ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided con-2: evidence SHALL have code or details ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/condition.xsd ================================================ A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern. A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this condition by the performer or other systems which remain constant as the resource is updated and propagates from server to server. The clinical status of the condition. The verification status to support the clinical status of the condition. A category assigned to the condition. A subjective assessment of the severity of the condition as evaluated by the clinician. Identification of the condition, problem or diagnosis. The anatomical location where this condition manifests itself. Indicates the patient or group who the condition record is associated with. The Encounter during which this Condition was created or to which the creation of this record is tightly associated. Estimated or actual date or date-time the condition began, in the opinion of the clinician. The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate. The recordedDate represents when this particular Condition record was created in the system, which is often a system-generated date. Individual who recorded the record and takes responsibility for its content. Individual who is making the condition statement. Clinical stage or grade of a condition. May include formal severity assessments. Supporting evidence / manifestations that are the basis of the Condition's verification status, such as evidence that confirmed or refuted the condition. Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis. A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern. A simple summary of the stage such as "Stage 3". The determination of the stage is disease-specific. Reference to a formal record of the evidence on which the staging assessment is based. The kind of staging, such as pathological or clinical staging. A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern. A manifestation or symptom that led to the recording of this condition. Links to other relevant information, including pathology reports. ================================================ FILE: tests/static/xsd/fhir/consent.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Consent dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label ppc-4: IF Scope=adr, there must be a patient ppc-5: IF Scope=treatment, there must be a patient ppc-2: IF Scope=privacy, there must be a patient ppc-3: IF Scope=research, there must be a patient ppc-1: Either a Policy or PolicyRule txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/consent.xsd ================================================ A record of a healthcare consumer’s choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time. A record of a healthcare consumer’s choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time. If the element is present, it must have either a @value, an @id, or extensions Unique identifier for this copy of the Consent Statement. Indicates the current state of this consent. A selector of the type of consent being presented: ADR, Privacy, Treatment, Research. This list is now extensible. A classification of the type of consents found in the statement. This element supports indexing and retrieval of consent statements. The patient/healthcare consumer to whom this consent applies. When this Consent was issued / created / indexed. Either the Grantor, which is the entity responsible for granting the rights listed in a Consent Directive or the Grantee, which is the entity responsible for complying with the Consent Directive, including any obligations or limitations on authorizations and enforcement of prohibitions. The organization that manages the consent, and the framework within which it is executed. The source on which this consent statement is based. The source might be a scanned original paper form, or a reference to a consent that links back to such a source, a reference to a document repository (e.g. XDS) that stores the original consent document. The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law. A reference to the specific base computable regulation or policy. Whether a treatment instruction (e.g. artificial respiration yes or no) was verified with the patient, his/her family or another authorized person. An exception to the base policy of this consent. An exception can be an addition or removal of access permissions. A record of a healthcare consumer’s choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time. Entity or Organization having regulatory jurisdiction or accountability for enforcing policies pertaining to Consent Directives. The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law. A record of a healthcare consumer’s choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time. Has the instruction been verified. Who verified the instruction (Patient, Relative or other Authorized Person). Date verification was collected. A record of a healthcare consumer’s choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time. Action to take - permit or deny - when the rule conditions are met. Not permitted in root rule, required in all nested rules. The timeframe in this rule is valid. Who or what is controlled by this rule. Use group to identify a set of actors by some property they share (e.g. 'admitting officers'). Actions controlled by this Rule. A security label, comprised of 0..* security label fields (Privacy tags), which define which resources are controlled by this exception. The context of the activities a user is taking - why the user is accessing the data - that are controlled by this rule. The class of information covered by this rule. The type can be a FHIR resource type, a profile on a type, or a CDA document, or some other type that indicates what sort of information the consent relates to. If this code is found in an instance, then the rule applies. Clinical or Operational Relevant period of time that bounds the data controlled by this rule. The resources controlled by this rule if specific resources are referenced. Rules which provide exceptions to the base rule or subrules. A record of a healthcare consumer’s choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time. How the individual is involved in the resources content that is described in the exception. The resource that identifies the actor. To identify actors by type, use group to identify a set of actors by some property they share (e.g. 'admitting officers'). A record of a healthcare consumer’s choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time. How the resource reference is interpreted when testing consent restrictions. A reference to a specific resource that defines which resources are covered by this consent. Opt Out Opt In How a rule statement is applied, such as adding additional consent or removing consent. If the element is present, it must have either a @value, an @id, or extensions Instance Related Dependents AuthoredBy How a resource reference is interpreted when testing consent restrictions. If the element is present, it must have either a @value, an @id, or extensions Pending Proposed Active Rejected Inactive Entered in Error Indicates the state of the consent. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/contract.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Contract dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/contract.xsd ================================================ Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. If the element is present, it must have either a @value, an @id, or extensions Unique identifier for this Contract or a derivative that references a Source Contract. Canonical identifier for this contract, represented as a URI (globally unique). An edition identifier used for business purposes to label business significant variants. The status of the resource instance. Legal states of the formation of a legal instrument, which is a formally executed written document that can be formally attributed to its author, records and formally expresses a legally enforceable act, process, or contractual duty, obligation, or right, and therefore evidences that act, process, or agreement. The URL pointing to a FHIR-defined Contract Definition that is adhered to in whole or part by this Contract. The URL pointing to an externally maintained definition that is adhered to in whole or in part by this Contract. The minimal content derived from the basal information source at a specific stage in its lifecycle. When this Contract was issued. Relevant time or time-period when this Contract is applicable. Event resulting in discontinuation or termination of this Contract instance by one or more parties to the contract. The target entity impacted by or of interest to parties to the agreement. A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies. Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources. Sites in which the contract is complied with, exercised, or in force. A natural language name identifying this Contract definition, derivative, or instance in any legal state. Provides additional information about its content. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content. An explanatory or alternate user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content. Alternative representation of the title for this Contract definition, derivative, or instance in any legal state., e.g., a domain specific contract number related to legislation. The individual or organization that authored the Contract definition, derivative, or instance in any legal state. A selector of legal concerns for this Contract definition, derivative, or instance in any legal state. Narrows the range of legal concerns to focus on the achievement of specific contractual objectives. A high-level category for the legal instrument, whether constructed as a Contract definition, derivative, or instance in any legal state. Provides additional information about its content within the context of the Contract's scope to distinguish the kinds of systems that would be interested in the contract. Sub-category for the Contract that distinguishes the kinds of systems that would be interested in the Contract within the context of the Contract's scope. Precusory content developed with a focus and intent of supporting the formation a Contract instance, which may be associated with and transformable into a Contract. One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups. Information that may be needed by/relevant to the performer in their execution of this term action. Links to Provenance records for past versions of this Contract definition, derivative, or instance, which identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the Contract. The Provence.entity indicates the target that was changed in the update. http://build.fhir.org/provenance-definitions.html#Provenance.entity. Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness. The "patient friendly language" versionof the Contract in whole or in parts. "Patient friendly language" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement. List of Legal expressions or representations of this Contract. List of Computable Policy Rule Language Representations of this Contract. Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Precusory content structure and use, i.e., a boilerplate, template, application for a contract such as an insurance policy or benefits under a program, e.g., workers compensation. Detailed Precusory content type. The individual or organization that published the Contract precursor content. The date (and optionally time) when the contract was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the contract changes. amended | appended | cancelled | disputed | entered-in-error | executable | executed | negotiable | offered | policy | rejected | renewed | revoked | resolved | terminated. A copyright statement relating to Contract precursor content. Copyright statements are generally legal restrictions on the use and publishing of the Contract precursor content. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Unique identifier for this particular Contract Provision. When this Contract Provision was issued. Relevant time or time-period when this Contract Provision is applicable. The entity that the term applies to. A legal clause or condition contained within a contract that requires one or both parties to perform a particular requirement by some specified time or prevents one or both parties from performing a particular requirement by some specified time. A specialized legal clause or condition based on overarching contract type. Statement of a provision in a policy or a contract. Security labels that protect the handling of information about the term and its elements, which may be specifically identified.. The matter of concern in the context of this provision of the agrement. Contract Term Asset List. An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place. Nested group of Contract Provisions. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Number used to link this term or term element to the applicable Security Label. Security label privacy tag that species the level of confidentiality protection required for this term and/or term elements. Security label privacy tag that species the applicable privacy and security policies governing this term and/or term elements. Security label privacy tag that species the manner in which term and/or term elements are to be protected. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Unique identifier for this particular Contract Provision. Offer Recipient. The owner of an asset has the residual control rights over the asset: the right to decide all usages of the asset in any way not inconsistent with a prior contract, custom, or law (Hart, 1995, p. 30). Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit. Type of choice made by accepting party with respect to an offer made by an offeror/ grantee. How the decision about a Contract was conveyed. Response to offer text. Human readable form of this Contract Offer. The id of the clause or question text of the offer in the referenced questionnaire/response. Security labels that protects the offer. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Participant in the offer. How the party participates in the offer. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Response to an offer clause or question text, which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Differentiates the kind of the asset . Target entity type about which the term may be concerned. Associated entities. May be a subtype or part of an offered asset. Specifies the applicability of the term to an asset resource instance, and instances it refers to orinstances that refer to it, and/or are owned by the offeree. Circumstance of the asset. Description of the quality and completeness of the asset that imay be a factor in its valuation. Type of Asset availability for use or ownership. Asset relevant contractual time period. Time period of asset use. Clause or question text (Prose Object) concerning the asset in a linked form, such as a QuestionnaireResponse used in the formation of the contract. Id [identifier??] of the clause or question text about the asset in the referenced form or QuestionnaireResponse. Response to assets. Security labels that protects the asset. Contract Valued Item List. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Asset context reference may include the creator, custodian, or owning Person or Organization (e.g., bank, repository), location held, e.g., building, jurisdiction. Coded representation of the context generally or of the Referenced entity, such as the asset holder type or location. Context description. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Specific type of Contract Valued Item that may be priced. Identifies a Contract Valued Item instance. Indicates the time during which this Contract ValuedItem information is effective. Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances. A Contract Valued Item unit valuation measure. A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point. Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. Terms of valuation. When payment is due. Who will make payment. Who will receive payment. Id of the clause or question text related to the context of this valuedItem in the referenced form or QuestionnaireResponse. A set of security labels that define which terms are controlled by this condition. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. True if the term prohibits the action. Activity or service obligation to be done or not done, performed or not performed, effectuated or not by this Contract term. Entity of the action. Reason or purpose for the action stipulated by this Contract Provision. Id [identifier??] of the clause or question text related to this action in the referenced form or QuestionnaireResponse. Current state of the term action. Encounter or Episode with primary association to specified term activity. Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse. When action happens. Who or what initiated the action and has responsibility for its activation. Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse. The type of individual that is desired or required to perform or not perform the action. The type of role or competency of an individual desired or required to perform or not perform the action. Indicates who or what is being asked to perform (or not perform) the ction. Id [identifier??] of the clause or question text related to the reason type or reference of this action in the referenced form or QuestionnaireResponse. Rationale for the action to be performed or not performed. Describes why the action is permitted or prohibited. Indicates another resource whose existence justifies permitting or not permitting this action. Describes why the action is to be performed or not performed in textual form. Id [identifier??] of the clause or question text related to the reason type or reference of this action in the referenced form or QuestionnaireResponse. Comments made about the term action made by the requester, performer, subject or other participants. Security labels that protects the action. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. The entity the action is performed or not performed on or for. Role type of agent assigned roles in this Contract. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Role of this Contract signer, e.g. notary, grantee. Party which is a signator to this Contract. Legally binding Contract DSIG signature contents in Base64. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Contract legal text in human renderable form. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal). Amended Appended Cancelled Disputed Entered in Error Executable Executed Negotiable Offered Policy Rejected Renewed Revoked Resolved Terminated A code specifying the state of the resource instance. If the element is present, it must have either a @value, an @id, or extensions Amended Appended Cancelled Disputed Entered in Error Executable Executed Negotiable Offered Policy Rejected Renewed Revoked Resolved Terminated Status of the publication of contract content. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/coverage.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Coverage dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/coverage.xsd ================================================ Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment. Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this coverage. The status of the resource instance. The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health or payment by an individual or organization. The party who 'owns' the insurance policy. The party who has signed-up for or 'owns' the contractual relationship to the policy or to whom the benefit of the policy for services rendered to them or their family is due. The insurer assigned ID for the Subscriber. The party who benefits from the insurance coverage; the patient when products and/or services are provided. A unique identifier for a dependent under the coverage. The relationship of beneficiary (patient) to the subscriber. Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force. The program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements. A suite of underwriter specific classifiers. The order of applicability of this coverage relative to other coverages which are currently in force. Note, there may be gaps in the numbering and this does not imply primary, secondary etc. as the specific positioning of coverages depends upon the episode of care. The insurer-specific identifier for the insurer-defined network of providers to which the beneficiary may seek treatment which will be covered at the 'in-network' rate, otherwise 'out of network' terms and conditions apply. A suite of codes indicating the cost category and associated amount which have been detailed in the policy and may have been included on the health card. When 'subrogation=true' this insurance instance has been included not for adjudication but to provide insurers with the details to recover costs. The policy(s) which constitute this insurance coverage. Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment. The type of classification for which an insurer-specific class label or number and optional name is provided, for example may be used to identify a class of coverage or employer group, Policy, Plan. The alphanumeric string value associated with the insurer issued label. A short description for the class. Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment. The category of patient centric costs associated with treatment. The amount due from the patient for the cost category. A suite of codes indicating exceptions or reductions to patient costs and their effective periods. Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment. The code for the specific exception. The timeframe during when the exception is in force. ================================================ FILE: tests/static/xsd/fhir/coverageeligibilityrequest.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children CoverageEligibilityRequest dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/coverageeligibilityrequest.xsd ================================================ The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy. The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this coverage eligiblity request. The status of the resource instance. When the requestor expects the processor to complete processing. Code to specify whether requesting: prior authorization requirements for some service categories or billing codes; benefits for coverages specified or discovered; discovery and return of coverages for the patient; and/or validation that the specified coverage is in-force at the date/period specified or 'now' if not specified. The party who is the beneficiary of the supplied coverage and for whom eligibility is sought. The date or dates when the enclosed suite of services were performed or completed. The date when this resource was created. Person who created the request. The provider which is responsible for the request. The Insurer who issued the coverage in question and is the recipient of the request. Facility where the services are intended to be provided. Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues. Financial instruments for reimbursement for the health care products and services. Service categories or billable services for which benefit details and/or an authorization prior to service delivery may be required by the payor. The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy. A number to uniquely identify supporting information entries. Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data. The supporting materials are applicable for all detail items, product/servce categories and specific billing codes. The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy. A flag to indicate that this Coverage is to be used for evaluation of this request when set to true. Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system. A business agreement number established between the provider and the insurer for special business processing purposes. The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy. Exceptions, special conditions and supporting information applicable for this service or product line. Code to identify the general type of benefits under which products and services are provided. This contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. The practitioner who is responsible for the product or service to be rendered to the patient. The number of repetitions of a service or product. The amount charged to the patient by the provider for a single unit. Facility where the services will be provided. Patient diagnosis for which care is sought. The plan/proposal/order describing the proposed service in detail. The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy. The nature of illness or problem in a coded form or as a reference to an external defined Condition. Coverage auth-requirements Coverage benefits Coverage Discovery Coverage Validation A code specifying the types of information being requested. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/coverageeligibilityresponse.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children CoverageEligibilityResponse dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ces-1: SHALL contain a category or a billcode but not both. ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/coverageeligibilityresponse.xsd ================================================ This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource. This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this coverage eligiblity request. The status of the resource instance. Code to specify whether requesting: prior authorization requirements for some service categories or billing codes; benefits for coverages specified or discovered; discovery and return of coverages for the patient; and/or validation that the specified coverage is in-force at the date/period specified or 'now' if not specified. The party who is the beneficiary of the supplied coverage and for whom eligibility is sought. The date or dates when the enclosed suite of services were performed or completed. The date this resource was created. The provider which is responsible for the request. Reference to the original request resource. The outcome of the request processing. A human readable description of the status of the adjudication. The Insurer who issued the coverage in question and is the author of the response. Financial instruments for reimbursement for the health care products and services. A reference from the Insurer to which these services pertain to be used on further communication and as proof that the request occurred. A code for the form to be used for printing the content. Errors encountered during the processing of the request. This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource. Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system. Flag indicating if the coverage provided is inforce currently if no service date(s) specified or for the whole duration of the service dates. The term of the benefits documented in this response. Benefits and optionally current balances, and authorization details by category or service. This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource. Code to identify the general type of benefits under which products and services are provided. This contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. The practitioner who is eligible for the provision of the product or service. True if the indicated class of service is excluded from the plan, missing or False indicates the product or service is included in the coverage. A short name or tag for the benefit. A richer description of the benefit or services covered. Is a flag to indicate whether the benefits refer to in-network providers or out-of-network providers. Indicates if the benefits apply to an individual or to the family. The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual visits'. Benefits used to date. A boolean flag indicating whether a preauthorization is required prior to actual service delivery. Codes or comments regarding information or actions associated with the preauthorization. A web location for obtaining requirements or descriptive information regarding the preauthorization. This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource. Classification of benefit being provided. The quantity of the benefit which is permitted under the coverage. The quantity of the benefit which have been consumed to date. This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource. An error code,from a specified code system, which details why the eligibility check could not be performed. Coverage auth-requirements Coverage benefits Coverage Discovery Coverage Validation A code specifying the types of information being requested. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/detectedissue.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children DetectedIssue dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/detectedissue.xsd ================================================ Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. If the element is present, it must have either a @value, an @id, or extensions Business identifier associated with the detected issue record. Indicates the status of the detected issue. Identifies the general type of issue identified. Indicates the degree of importance associated with the identified issue based on the potential impact on the patient. Indicates the patient whose record the detected issue is associated with. The date or period when the detected issue was initially identified. Individual or device responsible for the issue being raised. For example, a decision support application or a pharmacist conducting a medication review. Indicates the resource representing the current activity or proposed activity that is potentially problematic. Supporting evidence or manifestations that provide the basis for identifying the detected issue such as a GuidanceResponse or MeasureReport. A textual explanation of the detected issue. The literature, knowledge-base or similar reference that describes the propensity for the detected issue identified. Indicates an action that has been taken or is committed to reduce or eliminate the likelihood of the risk identified by the detected issue from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action. Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. A manifestation that led to the recording of this detected issue. Links to resources that constitute evidence for the detected issue such as a GuidanceResponse or MeasureReport. Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified issue. Indicates when the mitigating action was documented. Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring. Registered Preliminary Final Amended Corrected Cancelled Entered in Error Unknown Indicates the status of the identified issue. If the element is present, it must have either a @value, an @id, or extensions High Moderate Low Indicates the potential degree of impact of the identified issue on the patient. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/device.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Device dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/device.xsd ================================================ A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. If the element is present, it must have either a @value, an @id, or extensions Unique instance identifiers assigned to a device by manufacturers other organizations or owners. The reference to the definition for the device. Unique device identifier (UDI) assigned to device label or package. Note that the Device may include multiple udiCarriers as it either may include just the udiCarrier for the jurisdiction it is sold, or for multiple jurisdictions it could have been sold. Status of the Device availability. Reason for the dtatus of the Device availability. The distinct identification string as required by regulation for a human cell, tissue, or cellular and tissue-based product. A name of the manufacturer. The date and time when the device was manufactured. The date and time beyond which this device is no longer valid or should not be used (if applicable). Lot number assigned by the manufacturer. The serial number assigned by the organization when the device was manufactured. This represents the manufacturer's name of the device as provided by the device, from a UDI label, or by a person describing the Device. This typically would be used when a person provides the name(s) or when the device represents one of the names available from DeviceDefinition. The model number for the device. The part number of the device. The kind or type of device. The capabilities supported on a device, the standards to which the device conforms for a particular purpose, and used for the communication. The actual design of the device or software version running on the device. The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties. Patient information, If the device is affixed to a person. An organization that is responsible for the provision and ongoing maintenance of the device. Contact details for an organization or a particular human that is responsible for the device. The place where the device can be found. A network address on which the device may be contacted directly. Descriptive information, usage information or implantation information that is not captured in an existing element. Provides additional safety characteristics about a medical device. For example devices containing latex. The parent device. A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. The device identifier (DI) is a mandatory, fixed portion of a UDI that identifies the labeler and the specific version or model of a device. Organization that is charged with issuing UDIs for devices. For example, the US FDA issuers include : 1) GS1: http://hl7.org/fhir/NamingSystem/gs1-di, 2) HIBCC: http://hl7.org/fhir/NamingSystem/hibcc-dI, 3) ICCBBA for blood containers: http://hl7.org/fhir/NamingSystem/iccbba-blood-di, 4) ICCBA for other devices: http://hl7.org/fhir/NamingSystem/iccbba-other-di. The identity of the authoritative source for UDI generation within a jurisdiction. All UDIs are globally unique within a single namespace with the appropriate repository uri as the system. For example, UDIs of devices managed in the U.S. by the FDA, the value is http://hl7.org/fhir/NamingSystem/fda-udi. The full UDI carrier of the Automatic Identification and Data Capture (AIDC) technology representation of the barcode string as printed on the packaging of the device - e.g., a barcode or RFID. Because of limitations on character sets in XML and the need to round-trip JSON data through XML, AIDC Formats *SHALL* be base64 encoded. The full UDI carrier as the human readable form (HRF) representation of the barcode string as printed on the packaging of the device. A coded entry to indicate how the data was entered. A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. The name of the device. The type of deviceName. UDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName. A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. The standard that is used to operate and communicate. The version of the standard that is used to operate and communicate. A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. The type of the device version. A single component of the device version. The version text. A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. Code that specifies the property DeviceDefinitionPropetyCode (Extensible). Property value as a quantity. Property value as a code, e.g., NTP4 (synced to NTP). Active Inactive Entered in Error Unknown The availability status of the device. If the element is present, it must have either a @value, an @id, or extensions UDI Label name User Friendly name Patient Reported name Manufacturer name Model name other The type of name the device is referred by. If the element is present, it must have either a @value, an @id, or extensions Barcode RFID Manual Card Self Reported Unknown Codes to identify how UDI data was entered. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/devicedefinition.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children DeviceDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present att-1: If the Attachment has data, it SHALL have a contentType qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/devicedefinition.xsd ================================================ The characteristics, operational status and capabilities of a medical-related component of a medical device. The characteristics, operational status and capabilities of a medical-related component of a medical device. If the element is present, it must have either a @value, an @id, or extensions Unique instance identifiers assigned to a device by the software, manufacturers, other organizations or owners. For example: handle ID. Unique device identifier (UDI) assigned to device label or package. Note that the Device may include multiple udiCarriers as it either may include just the udiCarrier for the jurisdiction it is sold, or for multiple jurisdictions it could have been sold. A name of the manufacturer. A name given to the device to identify it. The model number for the device. What kind of device or device system this is. The capabilities supported on a device, the standards to which the device conforms for a particular purpose, and used for the communication. The available versions of the device, e.g., software versions. Safety characteristics of the device. Shelf Life and storage information. Dimensions, color etc. Language code for the human-readable text strings produced by the device (all supported). Device capabilities. The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties. An organization that is responsible for the provision and ongoing maintenance of the device. Contact details for an organization or a particular human that is responsible for the device. A network address on which the device may be contacted directly. Access to on-line information about the device. Descriptive information, usage information or implantation information that is not captured in an existing element. The quantity of the device present in the packaging (e.g. the number of devices present in a pack, or the number of devices in the same package of the medicinal product). The parent device it can be part of. A substance used to create the material(s) of which the device is made. The characteristics, operational status and capabilities of a medical-related component of a medical device. The identifier that is to be associated with every Device that references this DeviceDefintiion for the issuer and jurisdication porvided in the DeviceDefinition.udiDeviceIdentifier. The organization that assigns the identifier algorithm. The jurisdiction to which the deviceIdentifier applies. The characteristics, operational status and capabilities of a medical-related component of a medical device. The name of the device. The type of deviceName. UDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName. The characteristics, operational status and capabilities of a medical-related component of a medical device. The standard that is used to operate and communicate. The version of the standard that is used to operate and communicate. The characteristics, operational status and capabilities of a medical-related component of a medical device. Type of capability. Description of capability. The characteristics, operational status and capabilities of a medical-related component of a medical device. Code that specifies the property DeviceDefinitionPropetyCode (Extensible). Property value as a quantity. Property value as a code, e.g., NTP4 (synced to NTP). The characteristics, operational status and capabilities of a medical-related component of a medical device. The substance. Indicates an alternative material of the device. Whether the substance is a known or suspected allergen. ================================================ FILE: tests/static/xsd/fhir/devicemetric.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children DeviceMetric dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ================================================ FILE: tests/static/xsd/fhir/devicemetric.xsd ================================================ Describes a measurement, calculation or setting capability of a medical device. Describes a measurement, calculation or setting capability of a medical device. If the element is present, it must have either a @value, an @id, or extensions Unique instance identifiers assigned to a device by the device or gateway software, manufacturers, other organizations or owners. For example: handle ID. Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc. Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc. Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacturer, serial number, etc. Describes the link to the Device that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. An example would be a Device that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location. Indicates current operational state of the device. For example: On, Off, Standby, etc. Describes the color representation for the metric. This is often used to aid clinicians to track and identify parameter types by color. In practice, consider a Patient Monitor that has ECG/HR and Pleth for example; the parameters are displayed in different characteristic colors, such as HR-blue, BP-green, and PR and SpO2- magenta. Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation. Describes the measurement repetition time. This is not necessarily the same as the update period. The measurement repetition time can range from milliseconds up to hours. An example for a measurement repetition time in the range of milliseconds is the sampling rate of an ECG. An example for a measurement repetition time in the range of hours is a NIBP that is triggered automatically every hour. The update period may be different than the measurement repetition time, if the device does not update the published observed value with the same frequency as it was measured. Describes the calibrations that have been performed or that are required to be performed. Describes a measurement, calculation or setting capability of a medical device. Describes the type of the calibration method. Describes the state of the calibration. Describes the time last calibration has been performed. Unspecified Offset Gain Two Point Describes the type of a metric calibration. If the element is present, it must have either a @value, an @id, or extensions Color Black Color Red Color Green Color Yellow Color Blue Color Magenta Color Cyan Color White Describes the typical color of representation. If the element is present, it must have either a @value, an @id, or extensions Not Calibrated Calibration Required Calibrated Unspecified Describes the state of a metric calibration. If the element is present, it must have either a @value, an @id, or extensions On Off Standby Entered In Error Describes the operational status of the DeviceMetric. If the element is present, it must have either a @value, an @id, or extensions Measurement Setting Calculation Unspecified Describes the category of the metric. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/devicerequest.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children DeviceRequest dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/devicerequest.xsd ================================================ Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker. Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker. If the element is present, it must have either a @value, an @id, or extensions Identifiers assigned to this order by the orderer or by the receiver. The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this DeviceRequest. The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this DeviceRequest. Plan/proposal/order fulfilled by this request. The request takes the place of the referenced completed or terminated request(s). Composite request this is part of. The status of the request. Whether the request is a proposal, plan, an original order or a reflex order. Indicates how quickly the {{title}} should be addressed with respect to other requests. The details of the device to be used. Specific parameters for the ordered item. For example, the prism value for lenses. The patient who will use the device. An encounter that provides additional context in which this request is made. The timing schedule for the use of the device. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". When the request transitioned to being actionable. The individual who initiated the request and has responsibility for its activation. Desired type of performer for doing the diagnostic testing. The desired performer for doing the diagnostic testing. Reason or justification for the use of this device. Reason or justification for the use of this device. Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be required for delivering the requested service. Additional clinical information about the patient that may influence the request fulfilment. For example, this may include where on the subject's body the device will be used (i.e. the target site). Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement. Key events in the history of the request. Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker. A code or string that identifies the device detail being asserted. The value of the device detail. ================================================ FILE: tests/static/xsd/fhir/deviceusestatement.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children DeviceUseStatement dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/deviceusestatement.xsd ================================================ A record of a device being used by a patient where the record is the result of a report from the patient or another clinician. A record of a device being used by a patient where the record is the result of a report from the patient or another clinician. If the element is present, it must have either a @value, an @id, or extensions An external identifier for this statement such as an IRI. A plan, proposal or order that is fulfilled in whole or in part by this DeviceUseStatement. A code representing the patient or other source's judgment about the state of the device used that this statement is about. Generally this will be active or completed. The patient who used the device. Allows linking the DeviceUseStatement to the underlying Request, or to other information that supports or is used to derive the DeviceUseStatement. How often the device was used. The time at which the statement was made/recorded. Who reported the device was being used by the patient. The details of the device used. Reason or justification for the use of the device. Indicates another resource whose existence justifies this DeviceUseStatement. Indicates the anotomic location on the subject's body where the device was used ( i.e. the target). Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement. Active Completed Entered in Error Intended Stopped On Hold A coded concept indicating the current status of the Device Usage. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/diagnosticreport.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children DiagnosticReport dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ================================================ FILE: tests/static/xsd/fhir/diagnosticreport.xsd ================================================ The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports. The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports. If the element is present, it must have either a @value, an @id, or extensions Identifiers assigned to this report by the performer or other systems. Details concerning a service requested. The status of the diagnostic report. A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes. A code or name that describes this diagnostic report. The subject of the report. Usually, but not always, this is a patient. However, diagnostic services also perform analyses on specimens collected from a variety of other sources. The healthcare event (e.g. a patient and healthcare provider interaction) which this DiagnosticReport is about. The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself. The date and time that this version of the report was made available to providers, typically after the report was reviewed and verified. The diagnostic service that is responsible for issuing the report. The practitioner or organization that is responsible for the report's conclusions and interpretations. Details about the specimens on which this diagnostic report is based. [Observations](observation.html) that are part of this diagnostic report. One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images. A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest). Concise and clinically contextualized summary conclusion (interpretation/impression) of the diagnostic report. One or more codes that represent the summary conclusion (interpretation/impression) of the diagnostic report. Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent. The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports. A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features. Reference to the image source. Registered Partial Preliminary Final Amended Corrected Appended Cancelled Entered in Error Unknown The status of the diagnostic report. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/documentmanifest.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children DocumentManifest dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/documentmanifest.xsd ================================================ A collection of documents compiled for a purpose together with metadata that applies to the collection. A collection of documents compiled for a purpose together with metadata that applies to the collection. If the element is present, it must have either a @value, an @id, or extensions A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts. Other identifiers associated with the document manifest, including version independent identifiers. The status of this document manifest. The code specifying the type of clinical activity that resulted in placing the associated content into the DocumentManifest. Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case). When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated, etc.). Identifies who is the author of the manifest. Manifest author is not necessarly the author of the references included. A patient, practitioner, or organization for which this set of documents is intended. Identifies the source system, application, or software that produced the document manifest. Human-readable description of the source document. This is sometimes known as the "title". The list of Resources that consist of the parts of this manifest. Related identifiers or resources associated with the DocumentManifest. A collection of documents compiled for a purpose together with metadata that applies to the collection. Related identifier to this DocumentManifest. For example, Order numbers, accession numbers, XDW workflow numbers. Related Resource to this DocumentManifest. For example, Order, ServiceRequest, Procedure, EligibilityRequest, etc. ================================================ FILE: tests/static/xsd/fhir/documentreference.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children DocumentReference dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/documentreference.xsd ================================================ A reference to a document of any kind for any purpose. Provides metadata about the document so that the document can be discovered and managed. The scope of a document is any seralized object with a mime-type, so includes formal patient centric documents (CDA), cliical notes, scanned paper, and non-patient specific documents like policy text. A reference to a document of any kind for any purpose. Provides metadata about the document so that the document can be discovered and managed. The scope of a document is any seralized object with a mime-type, so includes formal patient centric documents (CDA), cliical notes, scanned paper, and non-patient specific documents like policy text. If the element is present, it must have either a @value, an @id, or extensions Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document. Other identifiers associated with the document, including version independent identifiers. The status of this document reference. The status of the underlying document. Specifies the particular kind of document referenced (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced. A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type. Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). When the document reference was created. Identifies who is responsible for adding the information to the document. Which person or organization authenticates that this document is valid. Identifies the organization or group who is responsible for ongoing maintenance of and access to the document. Relationships that this document has with other document references that already exist. Human-readable description of the source document. A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the "reference" to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to. The document and format referenced. There may be multiple content element repetitions, each with a different format. The clinical context in which the document was prepared. A reference to a document of any kind for any purpose. Provides metadata about the document so that the document can be discovered and managed. The scope of a document is any seralized object with a mime-type, so includes formal patient centric documents (CDA), cliical notes, scanned paper, and non-patient specific documents like policy text. The type of relationship that this document has with anther document. The target document of this relationship. A reference to a document of any kind for any purpose. Provides metadata about the document so that the document can be discovered and managed. The scope of a document is any seralized object with a mime-type, so includes formal patient centric documents (CDA), cliical notes, scanned paper, and non-patient specific documents like policy text. The document or URL of the document along with critical metadata to prove content has integrity. An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType. A reference to a document of any kind for any purpose. Provides metadata about the document so that the document can be discovered and managed. The scope of a document is any seralized object with a mime-type, so includes formal patient centric documents (CDA), cliical notes, scanned paper, and non-patient specific documents like policy text. Describes the clinical encounter or type of care that the document content is associated with. This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the type Code, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act. The time period over which the service that is described by the document was provided. The kind of facility where the patient was seen. This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty. The Patient Information as known when the document was published. May be a reference to a version specific, or contained. Related identifiers or resources associated with the DocumentReference. ================================================ FILE: tests/static/xsd/fhir/effectevidencesynthesis.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children EffectEvidenceSynthesis dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/effectevidencesynthesis.xsd ================================================ The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies. The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this effect evidence synthesis when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this effect evidence synthesis is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the effect evidence synthesis is stored on different servers. A formal identifier that is used to identify this effect evidence synthesis when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the effect evidence synthesis when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the effect evidence synthesis author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the effect evidence synthesis. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the effect evidence synthesis. The status of this effect evidence synthesis. Enables tracking the life-cycle of the content. The date (and optionally time) when the effect evidence synthesis was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the effect evidence synthesis changes. The name of the organization or individual that published the effect evidence synthesis. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the effect evidence synthesis from a consumer's perspective. A human-readable string to clarify or explain concepts about the resource. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate effect evidence synthesis instances. A legal or geographic region in which the effect evidence synthesis is intended to be used. A copyright statement relating to the effect evidence synthesis and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the effect evidence synthesis. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the effect evidence synthesis content was or is planned to be in active use. Descriptive topics related to the content of the EffectEvidenceSynthesis. Topics provide a high-level categorization grouping types of EffectEvidenceSynthesiss that can be useful for filtering and searching. An individiual or organization primarily involved in the creation and maintenance of the content. An individual or organization primarily responsible for internal coherence of the content. An individual or organization primarily responsible for review of some aspect of the content. An individual or organization responsible for officially endorsing the content for use in some setting. Related artifacts such as additional documentation, justification, or bibliographic references. Type of synthesis eg meta-analysis. Type of study eg randomized trial. A reference to a EvidenceVariable resource that defines the population for the research. A reference to a EvidenceVariable resource that defines the exposure for the research. A reference to a EvidenceVariable resource that defines the comparison exposure for the research. A reference to a EvidenceVariable resomece that defines the outcome for the research. A description of the size of the sample involved in the synthesis. A description of the results for each exposure considered in the effect estimate. The estimated effect of the exposure variant. A description of the certainty of the effect estimate. The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies. Human-readable summary of sample size. Number of studies included in this evidence synthesis. Number of participants included in this evidence synthesis. The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies. Human-readable summary of results by exposure state. Whether these results are for the exposure state or alternative exposure state. Used to define variant exposure states such as low-risk state. Reference to a RiskEvidenceSynthesis resource. The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies. Human-readable summary of effect estimate. Examples include relative risk and mean difference. Used to define variant exposure states such as low-risk state. The point estimate of the effect estimate. Specifies the UCUM unit for the outcome. A description of the precision of the estimate for the effect. The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies. Examples include confidence interval and interquartile range. Use 95 for a 95% confidence interval. Lower bound of confidence interval. Upper bound of confidence interval. The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies. A rating of the certainty of the effect estimate. A human-readable string to clarify or explain concepts about the resource. A description of a component of the overall certainty. The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies. Type of subcomponent of certainty rating. A rating of a subcomponent of rating certainty. A human-readable string to clarify or explain concepts about the resource. Exposure Exposure Alternative Whether the results by exposure is describing the results for the primary exposure of interest (exposure) or the alternative state (exposureAlternative). If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/encounter.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Encounter dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/encounter.xsd ================================================ An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. If the element is present, it must have either a @value, an @id, or extensions Identifier(s) by which this encounter is known. planned | arrived | triaged | in-progress | onleave | finished | cancelled +. The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them. Concepts representing classification of patient encounter such as ambulatory (outpatient), inpatient, emergency, home health or others due to local variations. The class history permits the tracking of the encounters transitions without needing to go through the resource history. This would be used for a case where an admission starts of as an emergency encounter, then transitions into an inpatient scenario. Doing this and not restarting a new encounter ensures that any lab/diagnostic results can more easily follow the patient and not require re-processing and not get lost or cancelled during a kind of discharge from emergency to inpatient. Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation). Broad categorization of the service that is to be provided (e.g. cardiology). Indicates the urgency of the encounter. The patient or group present at the encounter. Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem. The association is recorded on the encounter as these are typically created after the episode of care and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years). The request this encounter satisfies (e.g. incoming referral or procedure request). The list of people responsible for providing the service. The appointment that scheduled this encounter. The start and end time of the encounter. Quantity of time the encounter lasted. This excludes the time during leaves of absence. Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis. Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis. The list of diagnosis relevant to this encounter. The set of accounts that may be used for billing for this Encounter. Details about the admission to a healthcare service. List of locations where the patient has been during this encounter. The organization that is primarily responsible for this Encounter's services. This MAY be the same as the organization on the Patient record, however it could be different, such as if the actor performing the services was from an external organization (which may be billed seperately) for an external consultation. Refer to the example bundle showing an abbreviated set of Encounters for a colonoscopy. Another Encounter of which this encounter is a part of (administratively or in time). An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. planned | arrived | triaged | in-progress | onleave | finished | cancelled +. The time that the episode was in the specified status. An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. inpatient | outpatient | ambulatory | emergency +. The time that the episode was in the specified class. An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. Role of participant in encounter. The period of time that the specified participant participated in the encounter. These can overlap or be sub-sets of the overall encounter's period. Persons involved in the encounter other than the patient. An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure. Role that this diagnosis has within the encounter (e.g. admission, billing, discharge …). Ranking of the diagnosis (for each role type). An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. Pre-admission identifier. The location/organization from which the patient came before admission. From where patient was admitted (physician referral, transfer). Whether this hospitalization is a readmission and why if known. Diet preferences reported by the patient. Special courtesies (VIP, board member). Any special requests that have been made for this hospitalization encounter, such as the provision of specific equipment or other things. Location/organization to which the patient is discharged. Category or kind of location after discharge. An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. The location where the encounter takes place. The status of the participants' presence at the specified location during the period specified. If the participant is no longer at the location, then the period will have an end date/time. This will be used to specify the required levels (bed/ward/room/etc.) desired to be recorded to simplify either messaging or query. Time period during which the patient was present at the location. Planned Active Reserved Completed The status of the location. If the element is present, it must have either a @value, an @id, or extensions Planned Arrived Triaged In Progress On Leave Finished Cancelled Entered in Error Unknown Current state of the encounter. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/endpoint.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Endpoint dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ================================================ FILE: tests/static/xsd/fhir/endpoint.xsd ================================================ The technical details of an endpoint that can be used for electronic services, such as for web services providing XDS.b or a REST endpoint for another FHIR server. This may include any security context information. The technical details of an endpoint that can be used for electronic services, such as for web services providing XDS.b or a REST endpoint for another FHIR server. This may include any security context information. If the element is present, it must have either a @value, an @id, or extensions Identifier for the organization that is used to identify the endpoint across multiple disparate systems. active | suspended | error | off | test. A coded value that represents the technical details of the usage of this endpoint, such as what WSDLs should be used in what way. (e.g. XDS.b/DICOM/cds-hook). A friendly name that this endpoint can be referred to with. The organization that manages this endpoint (even if technically another organization is hosting this in the cloud, it is the organization associated with the data). Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting. The interval during which the endpoint is expected to be operational. The payload type describes the acceptable content that can be communicated on the endpoint. The mime type to send the payload in - e.g. application/fhir+xml, application/fhir+json. If the mime type is not specified, then the sender could send any content (including no content depending on the connectionType). The uri that describes the actual end-point to connect to. Additional headers / information to send as part of the notification. Active Suspended Error Off Entered in error Test The status of the endpoint. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/enrollmentrequest.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children EnrollmentRequest dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/enrollmentrequest.xsd ================================================ This resource provides the insurance enrollment details to the insurer regarding a specified coverage. This resource provides the insurance enrollment details to the insurer regarding a specified coverage. If the element is present, it must have either a @value, an @id, or extensions The Response business identifier. The status of the resource instance. The date when this resource was created. The Insurer who is target of the request. The practitioner who is responsible for the services rendered to the patient. Patient Resource. Reference to the program or plan identification, underwriter or payor. ================================================ FILE: tests/static/xsd/fhir/enrollmentresponse.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children EnrollmentResponse dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/enrollmentresponse.xsd ================================================ This resource provides enrollment and plan details from the processing of an EnrollmentRequest resource. This resource provides enrollment and plan details from the processing of an EnrollmentRequest resource. If the element is present, it must have either a @value, an @id, or extensions The Response business identifier. The status of the resource instance. Original request resource reference. Processing status: error, complete. A description of the status of the adjudication. The date when the enclosed suite of services were performed or completed. The Insurer who produced this adjudicated response. The practitioner who is responsible for the services rendered to the patient. ================================================ FILE: tests/static/xsd/fhir/episodeofcare.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children EpisodeOfCare dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/episodeofcare.xsd ================================================ An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. If the element is present, it must have either a @value, an @id, or extensions The EpisodeOfCare may be known by different identifiers for different contexts of use, such as when an external agency is tracking the Episode for funding purposes. planned | waitlist | active | onhold | finished | cancelled. The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource). A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care. The list of diagnosis relevant to this episode of care. The patient who is the focus of this episode of care. The organization that has assumed the specific responsibilities for the specified duration. The interval during which the managing organization assumes the defined responsibility. Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals. The practitioner that is the care manager/care coordinator for this patient. The list of practitioners that may be facilitating this episode of care for specific purposes. The set of accounts that may be used for billing for this EpisodeOfCare. An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. planned | waitlist | active | onhold | finished | cancelled. The period during this EpisodeOfCare that the specific status applied. An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for. Role that this diagnosis has within the episode of care (e.g. admission, billing, discharge …). Ranking of the diagnosis (for each role type). Planned Waitlist Active On Hold Finished Cancelled Entered in Error The status of the episode of care. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/eventdefinition.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children EventDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType trd-3: A named event requires a name, a periodic event requires timing, and a data event requires data trd-2: A condition only if there is a data requirement trd-1: Either timing, or a data requirement, but not both tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided drq-1: Either a path or a searchParam must be provided, but not both drq-2: Either a path or a searchParam must be provided, but not both per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. exp-1: An expression or a reference must be provided ================================================ FILE: tests/static/xsd/fhir/eventdefinition.xsd ================================================ The EventDefinition resource provides a reusable description of when a particular event can occur. The EventDefinition resource provides a reusable description of when a particular event can occur. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this event definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this event definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the event definition is stored on different servers. A formal identifier that is used to identify this event definition when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the event definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the event definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the event definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the event definition. An explanatory or alternate title for the event definition giving additional information about its content. The status of this event definition. Enables tracking the life-cycle of the content. A Boolean value to indicate that this event definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. A code or group definition that describes the intended subject of the event definition. The date (and optionally time) when the event definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the event definition changes. The name of the organization or individual that published the event definition. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the event definition from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate event definition instances. A legal or geographic region in which the event definition is intended to be used. Explanation of why this event definition is needed and why it has been designed as it has. A detailed description of how the event definition is used from a clinical perspective. A copyright statement relating to the event definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the event definition. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the event definition content was or is planned to be in active use. Descriptive topics related to the module. Topics provide a high-level categorization of the module that can be useful for filtering and searching. An individiual or organization primarily involved in the creation and maintenance of the content. An individual or organization primarily responsible for internal coherence of the content. An individual or organization primarily responsible for review of some aspect of the content. An individual or organization responsible for officially endorsing the content for use in some setting. Related resources such as additional documentation, justification, or bibliographic references. The trigger element defines when the event occurs. If more than one trigger condition is specified, the event fires whenever any one of the trigger conditions is met. ================================================ FILE: tests/static/xsd/fhir/evidence.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Evidence dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/evidence.xsd ================================================ The Evidence resource describes the conditional state (population and any exposures being compared within the population) and outcome (if specified) that the knowledge (evidence, assertion, recommendation) is about. The Evidence resource describes the conditional state (population and any exposures being compared within the population) and outcome (if specified) that the knowledge (evidence, assertion, recommendation) is about. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this evidence when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this evidence is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the evidence is stored on different servers. A formal identifier that is used to identify this evidence when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the evidence when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the evidence author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts. A natural language name identifying the evidence. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the evidence. The short title provides an alternate title for use in informal descriptive contexts where the full, formal title is not necessary. An explanatory or alternate title for the Evidence giving additional information about its content. The status of this evidence. Enables tracking the life-cycle of the content. The date (and optionally time) when the evidence was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the evidence changes. The name of the organization or individual that published the evidence. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the evidence from a consumer's perspective. A human-readable string to clarify or explain concepts about the resource. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate evidence instances. A legal or geographic region in which the evidence is intended to be used. A copyright statement relating to the evidence and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the evidence. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the evidence content was or is planned to be in active use. Descriptive topics related to the content of the Evidence. Topics provide a high-level categorization grouping types of Evidences that can be useful for filtering and searching. An individiual or organization primarily involved in the creation and maintenance of the content. An individual or organization primarily responsible for internal coherence of the content. An individual or organization primarily responsible for review of some aspect of the content. An individual or organization responsible for officially endorsing the content for use in some setting. Related artifacts such as additional documentation, justification, or bibliographic references. A reference to a EvidenceVariable resource that defines the population for the research. A reference to a EvidenceVariable resource that defines the exposure for the research. A reference to a EvidenceVariable resomece that defines the outcome for the research. ================================================ FILE: tests/static/xsd/fhir/evidencevariable.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children EvidenceVariable dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided exp-1: An expression or a reference must be provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided drq-1: Either a path or a searchParam must be provided, but not both drq-2: Either a path or a searchParam must be provided, but not both per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. trd-3: A named event requires a name, a periodic event requires timing, and a data event requires data trd-2: A condition only if there is a data requirement trd-1: Either timing, or a data requirement, but not both tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided drq-1: Either a path or a searchParam must be provided, but not both drq-2: Either a path or a searchParam must be provided, but not both per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. exp-1: An expression or a reference must be provided qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. ================================================ FILE: tests/static/xsd/fhir/evidencevariable.xsd ================================================ The EvidenceVariable resource describes a "PICO" element that knowledge (evidence, assertion, recommendation) is about. The EvidenceVariable resource describes a "PICO" element that knowledge (evidence, assertion, recommendation) is about. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this evidence variable when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this evidence variable is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the evidence variable is stored on different servers. A formal identifier that is used to identify this evidence variable when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the evidence variable when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the evidence variable author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts. A natural language name identifying the evidence variable. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the evidence variable. The short title provides an alternate title for use in informal descriptive contexts where the full, formal title is not necessary. An explanatory or alternate title for the EvidenceVariable giving additional information about its content. The status of this evidence variable. Enables tracking the life-cycle of the content. The date (and optionally time) when the evidence variable was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the evidence variable changes. The name of the organization or individual that published the evidence variable. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the evidence variable from a consumer's perspective. A human-readable string to clarify or explain concepts about the resource. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate evidence variable instances. A legal or geographic region in which the evidence variable is intended to be used. A copyright statement relating to the evidence variable and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the evidence variable. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the evidence variable content was or is planned to be in active use. Descriptive topics related to the content of the EvidenceVariable. Topics provide a high-level categorization grouping types of EvidenceVariables that can be useful for filtering and searching. An individiual or organization primarily involved in the creation and maintenance of the content. An individual or organization primarily responsible for internal coherence of the content. An individual or organization primarily responsible for review of some aspect of the content. An individual or organization responsible for officially endorsing the content for use in some setting. Related artifacts such as additional documentation, justification, or bibliographic references. The type of evidence element, a population, an exposure, or an outcome. A characteristic that defines the members of the evidence element. Multiple characteristics are applied with "and" semantics. The EvidenceVariable resource describes a "PICO" element that knowledge (evidence, assertion, recommendation) is about. A short, natural language description of the characteristic that could be used to communicate the criteria to an end-user. Define members of the evidence element using Codes (such as condition, medication, or observation), Expressions ( using an expression language such as FHIRPath or CQL) or DataRequirements (such as Diabetes diagnosis onset in the last year). Use UsageContext to define the members of the population, such as Age Ranges, Genders, Settings. When true, members with this characteristic are excluded from the element. Indicates what effective period the study covers. Indicates duration from the participant's study entry. Indicates how elements are aggregated within the study effective period. Dichotomous Continuous Descriptive The possible types of variables for exposures or outcomes (E.g. Dichotomous, Continuous, Descriptive). If the element is present, it must have either a @value, an @id, or extensions Mean Median Mean of Study Means Mean of Study Medins Median of Study Means Median of Study Medians Possible group measure aggregates (E.g. Mean, Median). If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/examplescenario.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children ExampleScenario dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/examplescenario.xsd ================================================ Example of workflow instance. Example of workflow instance. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this example scenario when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this example scenario is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the example scenario is stored on different servers. A formal identifier that is used to identify this example scenario when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the example scenario when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the example scenario author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the example scenario. This name should be usable as an identifier for the module by machine processing applications such as code generation. The status of this example scenario. Enables tracking the life-cycle of the content. A Boolean value to indicate that this example scenario is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the example scenario was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the example scenario changes. (e.g. the 'content logical definition'). The name of the organization or individual that published the example scenario. Contact details to assist a user in finding and communicating with the publisher. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate example scenario instances. A legal or geographic region in which the example scenario is intended to be used. A copyright statement relating to the example scenario and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the example scenario. What the example scenario resource is created for. This should not be used to show the business purpose of the scenario itself, but the purpose of documenting a scenario. Actor participating in the resource. Each resource and each version that is present in the workflow. Each major process - a group of operations. Another nested workflow. Example of workflow instance. ID or acronym of actor. The type of actor - person or system. The name of the actor as shown in the page. The description of the actor. Example of workflow instance. The id of the resource for referencing. The type of the resource. A short name for the resource instance. Human-friendly description of the resource instance. A specific version of the resource. Resources contained in the instance (e.g. the observations contained in a bundle). Example of workflow instance. The identifier of a specific version of a resource. The description of the resource version. Example of workflow instance. Each resource contained in the instance. A specific version of a resource contained in the instance. Example of workflow instance. The diagram title of the group of operations. A longer description of the group of operations. Description of initial status before the process starts. Description of final status after the process ends. Each step of the process. Example of workflow instance. Nested process. If there is a pause in the flow. Each interaction or action. Indicates an alternative step that can be taken instead of the operations on the base step in exceptional/atypical circumstances. Example of workflow instance. The sequential number of the interaction, e.g. 1.2.5. The type of operation - CRUD. The human-friendly name of the interaction. Who starts the transaction. Who receives the transaction. A comment to be inserted in the diagram. Whether the initiator is deactivated right after the transaction. Whether the receiver is deactivated right after the transaction. Each resource instance used by the initiator. Each resource instance used by the responder. Example of workflow instance. The label to display for the alternative that gives a sense of the circumstance in which the alternative should be invoked. A human-readable description of the alternative explaining when the alternative should occur rather than the base step. What happens in each alternative option. Person System The type of actor - system or human. If the element is present, it must have either a @value, an @id, or extensions Account Account Cuenta 账户 ActivityDefinition ActivityDefinition DefinizioneAttivita DefinicionDeActividad 活动定义 AdverseEvent AdverseEvent EventoAvverso EventoAdverso 不良事件 AllergyIntolerance AllergyIntolerance AllergiaIntolleranza IntoléranceAllergique AllergiaIntolerancia 变态反应与不耐性 Appointment Appointment Appuntamento RendezVous Cita 预约 AppointmentResponse AppointmentResponse RispostaAppuntamento RéponseRendezVous CitaRespuesta 预约响应 AuditEvent AuditEvent ÉvènementSécurité EventoSeguridad 审计事件 Basic Basic Basique Basico 初级资源 Binary Binary Binario Binaire Binario 二进制资源 BiologicallyDerivedProduct BiologicallyDerivedProduct BodyStructure BodyStructure StrutturaDelCorpo MorphologieDeCorps EstructuraDelCuerpo 身体结构 Bundle Bundle Paquet Paquete 捆束 CapabilityStatement CapabilityStatement DeclaracionDeCapacidad 能力声明 CarePlan CarePlan PianoDiCura PlanDeSoins PlanDeCuidado 照护计划 CareTeam CareTeam EquipoDeCuidado 照护团队 CatalogEntry CatalogEntry EntradaDeCatalogo 条目定义 ChargeItem ChargeItem CargoDeItem 收费项目 ChargeItemDefinition ChargeItemDefinition Claim Claim Réclamation Reclamación / Factura 赔单 ClaimResponse ClaimResponse RéponseARéclamation 赔单请求 ClinicalImpression ClinicalImpression ImpressioneClinica ImpressionClinique HallazgoClinico 临床印象 CodeSystem CodeSystem SistemaDiCodifica SistemaDeCodigos 代码系统 Communication Communication Comunicazione Communication Comunicación 通讯 CommunicationRequest CommunicationRequest RichiestaDiComunicazione DemandeDeCommunication ComunicaciónRequerimiento 通讯请求 CompartmentDefinition CompartmentDefinition DefinicionDeCompartimento 逻辑区块定义 Composition Composition Composizione Composition Composición 组合式文书 ConceptMap ConceptMap MappaDiConcetti CarteDeConcepts MapaDeConceptos 概念映射 Condition Condition Condizione Condition Condición 情况 Consent Consent Consenso Consentimiento 同意书 Contract Contract Contratto Contrat Contato 合同 Coverage Coverage Copertura Couverture Cobertura 保险责任 CoverageEligibilityRequest CoverageEligibilityRequest RichiestaEleggibilitaCopertura CouvertureDemandeEligibilité 资格请求 CoverageEligibilityResponse CoverageEligibilityResponse RispostaEleggibilitaCopertura RéponseEligibilitéCouverture 资格响应 DetectedIssue DetectedIssue ProblemaRilevato Problème Détecté Problema-Detectado /ProblemaDetectado 已发现问题 Device Device Dispositivo Dispositif Dispositivo 装置 DeviceDefinition DeviceDefinition DéfinitionDeDispositif DefiniciónDeDispositivo 装置组件 DeviceMetric DeviceMetric MétriqueDispositif MetricaDeDispositivo 装置指标 DeviceRequest DeviceRequest RichiestaDispositivo DemandeUtilisationDispositif SolicitudDeDispositivo 装置请求 DeviceUseStatement DeviceUseStatement 装置使用声明 DiagnosticReport DiagnosticReport RefertoDiagnostico RapportDiagnostique 诊断报告 InformeDiagnostico DocumentManifest DocumentManifest Manifeste 文档清单 ManifestoDocumento DocumentReference DocumentReference RiferimentoDocumento RéférenceDocument ReferenciaDocumento 文档引用 DomainResource DomainResource RecursoDeDominio 领域资源 EffectEvidenceSynthesis EffectEvidenceSynthesis Encounter Encounter Venue 就医过程 Encuentro Endpoint Endpoint Endpoint 端点 EnrollmentRequest EnrollmentRequest RichiestaIscrizione DemandeInscription SolicitudDeEnrolamiento 保险注册请求 EnrollmentResponse EnrollmentResponse RispostaIscrizione RéponseInscription RespuestaDeEnrolamiento 保险注册响应 EpisodeOfCare EpisodeOfCare EpisodioDiCura ÉpisodeDeSoins EpisodioDeCuidado 照护服务节段 EventDefinition EventDefinition DefinizioneEvento DefinitionDeEvento 事件定义 Evidence Evidence EvidenceVariable EvidenceVariable ExampleScenario ExampleScenario ScenarioDiEsempio EjemploDeEscenario 示例场景 ExplanationOfBenefit ExplanationOfBenefit ExplicationDuBénéfice 赔付说明 FamilyMemberHistory FamilyMemberHistory HistoireMembreFamille HistorialMiembroFamiliar 家族史 Flag Flag Drapeau Bandera 标记 Goal Goal But Objetivo 目标 GraphDefinition GraphDefinition DefinitionGrafico 图形定义 Group Group Gruppo Groupe Grupo 群组 GuidanceResponse GuidanceResponse RespuestaDeOrientacion 指导意见响应 HealthcareService HealthcareService ServizioSanitario ServiceDeSanté ServicioDeCuidado 医疗保健服务项目 ImagingStudy ImagingStudy EtudeImagerie EstudioImagen / EstudioImagen 成像检查 Immunization Immunization Immunizzazione Immunisation 免疫接种 Inmunización ImmunizationEvaluation ImmunizationEvaluation ImmunizationRecommendation ImmunizationRecommendation RecommendationImmunisation 免疫接种建议 RecomendaciónInmunización / ImplementationGuide ImplementationGuide GuiaDeImplementacion 实施指南 InsurancePlan InsurancePlan Invoice Invoice Library Library Librería Linkage Linkage Enlace / Conexión / Vinculo / Acoplamiento 链接关系 List List Lista Liste 列表 Lista Location Location Localisation 位置 Locacion Measure Measure Misura Medida 指标 MeasureReport MeasureReport ReporteMedida 指标报告 Media Media Media Média Medio 媒体 Medication Medication Médication 药物 Medicación /Medicamento MedicationAdministration MedicationAdministration AdministrationMédicaments 药物施用 AdministraciónMedicación / AdministracionMedicamento MedicationDispense MedicationDispense DispensationMédicaments 药物配发 DispensaciónMedicación /DispensacionMedicamento MedicationKnowledge MedicationKnowledge MedicationRequest MedicationRequest PrescriptionMédicamenteuseTODO 药物请求 PrescripciónMedicaciónTODO /PrescripcionMedicamento MedicationStatement MedicationStatement ÉtatMédication 药物声明 ResumenMedicación /ResumenMedicamento MedicinalProduct MedicinalProduct ProdottoMedicinale MedicinalProductAuthorization MedicinalProductAuthorization AutorizzazioneProdottoMedicinale MedicinalProductContraindication MedicinalProductContraindication MedicinalProductIndication MedicinalProductInteraction MedicinalProductIngredient MedicinalProductIngredient IngredienteProdottoMedicinale MedicinalProductInteraction MedicinalProductInteraction MedicinalProductManufactured MedicinalProductManufactured MedicinalProductPackaged MedicinalProductPackaged MedicinalProductPharmaceutical MedicinalProductPharmaceutical MedicinalProductUndesirableEffect MedicinalProductUndesirableEffect MessageDefinition MessageDefinition DefinizioneMessaggio DefinicionMensaje 消息定义 MessageHeader MessageHeader EntêteMessage 消息标头 CabeceraMensaje MolecularSequence MolecularSequence SecuenciaMolecular 分子序列 NamingSystem NamingSystem SystèmeDeNommage SistemaDeNombres 命名系统 NutritionOrder NutritionOrder OrdreNutrition OrdenNutrición 营养医嘱 Observation Observation Osservazione Observation 观察 Observación ObservationDefinition ObservationDefinition DefinizioneOsservazione DefinicionDeEspecimen 观察定义 OperationDefinition OperationDefinition DefinizioneOperazione DéfinitionOpération DefinicionDeOperacion 操作定义 OperationOutcome OperationOutcome RisultatoOperazione RésultatOpération 操作结局 ResultadoOperación Organization Organization Organizzazione Organisation 组织机构 Organización OrganizationAffiliation OrganizationAffiliation Parameters Parameters Parametros 参数 Patient Patient Paziente Patient 患者 Paciente PaymentNotice PaymentNotice AvvisoDiPagamento AvisPaiement AvisoDePago 付款通知 PaymentReconciliation PaymentReconciliation RiconciliazionePagamento RéconciliationPaiement ConciliacionDePago 付款对账 Person Person Persona Personne Persona 人员 PlanDefinition PlanDefinition DefinicionDePlan 计划定义 Practitioner Practitioner Praticien 执业人员 Practicante / Profesional PractitionerRole PractitionerRole RolProfesional 执业人员角色 Procedure Procedure Procedura Procédure 操作项目 Procedimiento Provenance Provenance Provenienza Provenance 出处 Procedencia Questionnaire Questionnaire Questionario Questionnaire 调查问卷 Cuestionario QuestionnaireResponse QuestionnaireResponse RispostaQuestionario RéponseQuestionnaire RespuestaAlCuestionario 调查问卷答复 RelatedPerson RelatedPerson PersonaCorrelata PersonneEnRelation PersonaRelacionada 相关人员 RequestGroup RequestGroup GruppoDiRichieste GrupoDeSolicitudes 请求分组 ResearchDefinition ResearchDefinition ResearchElementDefinition ResearchElementDefinition ResearchStudy ResearchStudy EstudioDeInvestigacion 调查研究 ResearchSubject ResearchSubject SujetoDeInvestigacion 研究主题 Resource Resource Recurso 资源 RiskAssessment RiskAssessment ÉvaluationRisques EvaluacionDeRiesgo 风险评估 RiskEvidenceSynthesis RiskEvidenceSynthesis Schedule Schedule Agenda 日程安排 SearchParameter SearchParameter ParametroDiRicerca ParamètreRecherche ParametroDeBusqueda 搜索参数 ServiceRequest ServiceRequest RichiestaDiServizio DemandeService PeticiónServicio 服务项目请求 Slot Slot Slot 槽位 Hueco / Zocalo / Espacio Specimen Specimen Campione Spécimen 标本 Especimen SpecimenDefinition SpecimenDefinition DefinizioneCampione DefinicionDeEspecimen 标本定义 StructureDefinition StructureDefinition DefinizioneStruttura DéfinitionStructure DefinicionDeEstructura 结构定义 StructureMap StructureMap MapaDeEstructura 结构映射 Subscription Subscription Sottoscrizione Souscription 订阅 Suscripción Substance Substance Sostanza Substance 物质 Sustancia SubstanceNucleicAcid SubstanceNucleicAcid SubstancePolymer SubstancePolymer SubstanceProtein SubstanceProtein SubstanceReferenceInformation SubstanceReferenceInformation SubstanceSourceMaterial SubstanceSourceMaterial SubstanceSpecification SubstanceSpecification SupplyDelivery SupplyDelivery Supply Livraison 供应交付 Entrega de Suministro SupplyRequest SupplyRequest Demande d'approvisionnement 供应请求 Solicitud de Suministro Task Task Tarea 任务 TerminologyCapabilities TerminologyCapabilities CapacidadTerminologica 术语服务能力 TestReport TestReport RapportTest ReporteDePrueba 测试报告 TestScript TestScript ScriptTest ScriptDePrueba 测试脚本 ValueSet ValueSet EnsembleValeurs 取值集合 ConjuntoValores / ConjuntoDeValores VerificationResult VerificationResult VisionPrescription VisionPrescription PrescriptionVision PrescripcionDeVision 视力处方 The type of resource. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/explanationofbenefit.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children ExplanationOfBenefit dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType per-1: If present, start SHALL have a lower value than end ================================================ FILE: tests/static/xsd/fhir/explanationofbenefit.xsd ================================================ This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this explanation of benefit. The status of the resource instance. The category of claim, e.g. oral, pharmacy, vision, institutional, professional. A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service. A code to indicate whether the nature of the request is: to request adjudication of products and services previously rendered; or requesting authorization and adjudication for provision in the future; or requesting the non-binding adjudication of the listed products and services which could be provided in the future. The party to whom the professional services and/or products have been supplied or are being considered and for whom actual for forecast reimbursement is sought. The period for which charges are being submitted. The date this resource was created. Individual who created the claim, predetermination or preauthorization. The party responsible for authorization, adjudication and reimbursement. The provider which is responsible for the claim, predetermination or preauthorization. The provider-required urgency of processing the request. Typical values include: stat, routine deferred. A code to indicate whether and for whom funds are to be reserved for future claims. A code, used only on a response to a preauthorization, to indicate whether the benefits payable have been reserved and for whom. Other claims which are related to this claim such as prior submissions or claims for related services or for the same event. Prescription to support the dispensing of pharmacy, device or vision products. Original prescription which has been superseded by this prescription to support the dispensing of pharmacy services, medications or products. The party to be reimbursed for cost of the products and services according to the terms of the policy. A reference to a referral resource. Facility where the services were provided. The business identifier for the instance of the adjudication request: claim predetermination or preauthorization. The business identifier for the instance of the adjudication response: claim, predetermination or preauthorization response. The outcome of the claim, predetermination, or preauthorization processing. A human readable description of the status of the adjudication. Reference from the Insurer which is used in later communications which refers to this adjudication. The timeframe during which the supplied preauthorization reference may be quoted on claims to obtain the adjudication as provided. The members of the team who provided the products and services. Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues. Information about diagnoses relevant to the claim items. Procedures performed on the patient relevant to the billing items with the claim. This indicates the relative order of a series of EOBs related to different coverages for the same suite of services. Financial instruments for reimbursement for the health care products and services specified on the claim. Details of a accident which resulted in injuries which required the products and services listed in the claim. A claim line. Either a simple (a product or service) or a 'group' of details which can also be a simple items or groups of sub-details. The first-tier service adjudications for payor added product or service lines. The adjudication results which are presented at the header level rather than at the line-item or add-item levels. Categorized monetary totals for the adjudication. Payment details for the adjudication of the claim. A code for the form to be used for printing the content. The actual form, by reference or inclusion, for printing the content or an EOB. A note that describes or explains adjudication results in a human readable form. The term of the benefits documented in this response. Balance by Benefit Category. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. Reference to a related claim. A code to convey how the claims are related. An alternate organizational reference to the case or file to which this particular claim pertains. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. Type of Party to be reimbursed: Subscriber, provider, other. Reference to the individual or organization to whom any payment will be made. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. A number to uniquely identify care team entries. Member of the team who provided the product or service. The party who is billing and/or responsible for the claimed products or services. The lead, assisting or supervising practitioner and their discipline if a multidisciplinary team. The qualification of the practitioner which is applicable for this service. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. A number to uniquely identify supporting information entries. The general class of the information supplied: information; exception; accident, employment; onset, etc. System and code pertaining to the specific information regarding special conditions relating to the setting, treatment or patient for which care is sought. The date when or period to which this information refers. Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data. Provides the reason in the situation where a reason code is required in addition to the content. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. A number to uniquely identify diagnosis entries. The nature of illness or problem in a coded form or as a reference to an external defined Condition. When the condition was observed or the relative ranking. Indication of whether the diagnosis was present on admission to a facility. A package billing code or bundle code used to group products and services to a particular health condition (such as heart attack) which is based on a predetermined grouping code system. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. A number to uniquely identify procedure entries. When the condition was observed or the relative ranking. Date and optionally time the procedure was performed. The code or reference to a Procedure resource which identifies the clinical intervention performed. Unique Device Identifiers associated with this line item. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. A flag to indicate that this Coverage is to be used for adjudication of this claim when set to true. Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system. Reference numbers previously provided by the insurer to the provider to be quoted on subsequent claims containing services or products related to the prior authorization. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. Date of an accident event related to the products and services contained in the claim. The type or context of the accident event for the purposes of selection of potential insurance coverages and determination of coordination between insurers. The physical location of the accident event. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. A number to uniquely identify item entries. Care team members related to this service or product. Diagnoses applicable for this service or product. Procedures applicable for this service or product. Exceptions, special conditions and supporting information applicable for this service or product. The type of revenue or cost center providing the product and/or service. Code to identify the general type of benefits under which products and services are provided. When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. Identifies the program under which this may be recovered. The date or dates when the service or product was supplied, performed or completed. Where the product or service was provided. The number of repetitions of a service or product. If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group. A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. The quantity times the unit price for an additional service or product or charge. Unique Device Identifiers associated with this line item. Physical service site on the patient (limb, tooth, etc.). A region or surface of the bodySite, e.g. limb region or tooth surface(s). A billed item may include goods or services provided in multiple encounters. The numbers associated with notes below which apply to the adjudication of this item. If this item is a group then the values here are a summary of the adjudication of the detail items. If this item is a simple product or service then this is the result of the adjudication of this item. Second-tier of goods and services. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. A code to indicate the information type of this adjudication record. Information types may include: the value submitted, maximum values or percentages allowed or payable under the plan, amounts that the patient is responsible for in-aggregate or pertaining to this item, amounts paid by other coverages, and the benefit payable for this item. A code supporting the understanding of the adjudication result and explaining variance from expected amount. Monetary amount associated with the category. A non-monetary value associated with the category. Mutually exclusive to the amount element above. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. A claim detail line. Either a simple (a product or service) or a 'group' of sub-details which are simple items. The type of revenue or cost center providing the product and/or service. Code to identify the general type of benefits under which products and services are provided. When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. Identifies the program under which this may be recovered. The number of repetitions of a service or product. If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group. A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. The quantity times the unit price for an additional service or product or charge. Unique Device Identifiers associated with this line item. The numbers associated with notes below which apply to the adjudication of this item. The adjudication results. Third-tier of goods and services. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. A claim detail line. Either a simple (a product or service) or a 'group' of sub-details which are simple items. The type of revenue or cost center providing the product and/or service. Code to identify the general type of benefits under which products and services are provided. When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. Identifies the program under which this may be recovered. The number of repetitions of a service or product. If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group. A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. The quantity times the unit price for an additional service or product or charge. Unique Device Identifiers associated with this line item. The numbers associated with notes below which apply to the adjudication of this item. The adjudication results. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. Claim items which this service line is intended to replace. The sequence number of the details within the claim item which this line is intended to replace. The sequence number of the sub-details woithin the details within the claim item which this line is intended to replace. The providers who are authorized for the services rendered to the patient. When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. Identifies the program under which this may be recovered. The date or dates when the service or product was supplied, performed or completed. Where the product or service was provided. The number of repetitions of a service or product. If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group. A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. The quantity times the unit price for an additional service or product or charge. Physical service site on the patient (limb, tooth, etc.). A region or surface of the bodySite, e.g. limb region or tooth surface(s). The numbers associated with notes below which apply to the adjudication of this item. The adjudication results. The second-tier service adjudications for payor added services. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. The number of repetitions of a service or product. If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group. A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. The quantity times the unit price for an additional service or product or charge. The numbers associated with notes below which apply to the adjudication of this item. The adjudication results. The third-tier service adjudications for payor added services. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. The number of repetitions of a service or product. If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group. A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. The quantity times the unit price for an additional service or product or charge. The numbers associated with notes below which apply to the adjudication of this item. The adjudication results. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. A code to indicate the information type of this adjudication record. Information types may include: the value submitted, maximum values or percentages allowed or payable under the plan, amounts that the patient is responsible for in aggregate or pertaining to this item, amounts paid by other coverages, and the benefit payable for this item. Monetary total amount associated with the category. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. Whether this represents partial or complete payment of the benefits payable. Total amount of all adjustments to this payment included in this transaction which are not related to this claim's adjudication. Reason for the payment adjustment. Estimated date the payment will be issued or the actual issue date of payment. Benefits payable less any payment adjustment. Issuer's unique identifier for the payment instrument. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. A number to uniquely identify a note entry. The business purpose of the note text. The explanation or description associated with the processing. A code to define the language used in the text of the note. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. Code to identify the general type of benefits under which products and services are provided. True if the indicated class of service is excluded from the plan, missing or False indicates the product or service is included in the coverage. A short name or tag for the benefit. A richer description of the benefit or services covered. Is a flag to indicate whether the benefits refer to in-network providers or out-of-network providers. Indicates if the benefits apply to an individual or to the family. The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual visits'. Benefits Used to date. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. Classification of benefit being provided. The quantity of the benefit which is permitted under the coverage. The quantity of the benefit which have been consumed to date. Active Cancelled Draft Entered In Error A code specifying the state of the resource instance. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/familymemberhistory.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children FamilyMemberHistory dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label fhs-2: Can only have estimatedAge if age[x] is present fhs-1: Can have age[x] or born[x], but not both txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end age-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. If value is present, it SHALL be positive. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present age-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. If value is present, it SHALL be positive. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided age-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. If value is present, it SHALL be positive. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/familymemberhistory.xsd ================================================ Significant health conditions for a person related to the patient relevant in the context of care for the patient. Significant health conditions for a person related to the patient relevant in the context of care for the patient. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this family member history by the performer or other systems which remain constant as the resource is updated and propagates from server to server. The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory. The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory. A code specifying the status of the record of the family history of a specific family member. Describes why the family member's history is not available. The person who this history concerns. The date (and possibly time) when the family member history was recorded or last updated. This will either be a name or a description; e.g. "Aunt Susan", "my cousin with the red hair". The type of relationship this person has to the patient (father, mother, brother etc.). The birth sex of the family member. The actual or approximate date of birth of the relative. The age of the relative at the time the family member history is recorded. If true, indicates that the age value specified is an estimated value. Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record. Describes why the family member history occurred in coded or textual form. Indicates a Condition, Observation, AllergyIntolerance, or QuestionnaireResponse that justifies this family member history event. This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible. The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition. Significant health conditions for a person related to the patient relevant in the context of care for the patient. The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system. Indicates what happened following the condition. If the condition resulted in death, deceased date is captured on the relation. This condition contributed to the cause of death of the related person. If contributedToDeath is not populated, then it is unknown. Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence. An area where general notes can be placed about this specific condition. Partial Completed Entered in Error Health Unknown A code that identifies the status of the family history record. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/fhir-all.xsd ================================================  ================================================ FILE: tests/static/xsd/fhir/fhir-base.xsd ================================================ A date or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date. Dates SHALL be valid dates. If the element is present, it must have either a @value, an @id, or extensions A date, date-time or partial date (e.g. just year or year + month). If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored. Dates SHALL be valid dates. If the element is present, it must have either a @value, an @id, or extensions A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions A sequence of Unicode characters Note that FHIR strings SHALL NOT exceed 1MB in size If the element is present, it must have either a @value, an @id, or extensions A whole number 32 bit number; for values larger than this, use decimal If the element is present, it must have either a @value, an @id, or extensions An OID represented as a URI RFC 3001. See also ISO/IEC 8824:1990 € If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions A URI that is a reference to a canonical URL on a FHIR resource see [Canonical References](references.html#canonical) If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions String of characters used to identify a name or a resource see http://en.wikipedia.org/wiki/Uniform_resource_identifier If the element is present, it must have either a @value, an @id, or extensions A UUID, represented as a URI See The Open Group, CDE 1.1 Remote Procedure Call specification, Appendix A. If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions A URI that is a literal reference If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions An instant in time - known at least to the second Note: This is intended for where precisely observed times are required, typically system logs etc., and not human-reported times - for them, see date and dateTime (which can be as precise as instant, but is not required to be) below. Time zone is always required If the element is present, it must have either a @value, an @id, or extensions Value of "true" or "false" If the element is present, it must have either a @value, an @id, or extensions A stream of bytes A stream of bytes, base64 encoded If the element is present, it must have either a @value, an @id, or extensions An integer with a value that is not negative (e.g. >= 0) If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions A string that may contain Github Flavored Markdown syntax for optional processing by a mark down presentation engine Systems are not required to have markdown support, so the text should be readable without markdown processing. The markdown syntax is GFM - see https://github.github.com/gfm/ If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions A time during the day, with no date specified If the element is present, it must have either a @value, an @id, or extensions Any combination of letters, numerals, "-" and ".", with a length limit of 64 characters. (This might be an integer, an unprefixed OID, UUID or any other identifier pattern that meets these constraints.) Ids are case-insensitive. RFC 4122 If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions An integer with a value that is positive (e.g. >0) If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions A rational number with implicit precision Do not use an IEEE type floating point type, instead use something that works like a true decimal, with inbuilt precision (e.g. Java BigInteger) If the element is present, it must have either a @value, an @id, or extensions Optional Extension Element - found in all resources. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Value of extension - must be one of a constrained set of the data types (see [Extensibility](extensibility.html) for a list). Base definition for all elements that are defined inside a resource - but not those in a data type. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself). A human-readable summary of the resource conveying the essential clinical and business information for the resource. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data. The actual narrative content, a stripped down version of XHTML. Generated Extensions Additional Empty The status of a resource narrative. If the element is present, it must have either a @value, an @id, or extensions Base definition for all elements in a resource. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted. When the resource last changed - e.g. when the version changed. A uri that identifies the source system of the resource. This provides a minimal amount of [[[Provenance]]] information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc. A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]]. Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure. Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource. An address expressed using postal conventions (as opposed to GPS or other location definition formats). This data type may be used to convey addresses for use in delivering mail as well as for visiting locations which might not be valid for mail delivery. There are a variety of postal address formats defined around the world. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The purpose of this address. Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both. Specifies the entire address as it should be displayed e.g. on a postal label. This may be provided instead of or as well as the specific parts. This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information. The name of the city, town, suburb, village or other community or delivery center. The name of the administrative area (county). Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (e.g. US 2 letter state codes). A postal code designating a region defined by the postal service. Country - a nation as commonly understood or generally accepted. Time period when address was/is in use. Home Work Temporary Old / Incorrect Billing The use of an address. If the element is present, it must have either a @value, an @id, or extensions Postal Physical Postal & Physical The type of an address (physical / postal). If the element is present, it must have either a @value, an @id, or extensions A contributor to the content of a knowledge asset, including authors, editors, reviewers, and endorsers. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The type of contributor. The name of the individual or organization responsible for the contribution. Contact details to assist a user in finding and communicating with the contributor. Author Editor Reviewer Endorser The type of contributor. If the element is present, it must have either a @value, an @id, or extensions For referring to data content defined in other formats. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. The human language of the content. The value can be any valid value according to BCP 47. The actual data of the attachment - a sequence of bytes, base64 encoded. A location where the data can be accessed. The number of bytes of data that make up this attachment (before base64 encoding, if that is done). The calculated hash of the data using SHA-1. Represented using base64. A label or set of text to display in place of the data. The date that the attachment was first created. A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile. The profile of the required data, specified as the uri of the profile definition. The intended subjects of the data requirement. If this element is not provided, a Patient subject is assumed. Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available. The value of mustSupport SHALL be a FHIRPath resolveable on the type of the DataRequirement. The path SHALL consist only of identifiers, constant indexers, and .resolve() (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details). Code filters specify additional constraints on the data, specifying the value set of interest for a particular element of the data. Each code filter defines an additional constraint on the data, i.e. code filters are AND'ed, not OR'ed. Date filters specify additional constraints on the data in terms of the applicable date range for specific elements. Each date filter specifies an additional constraint on the data, i.e. date filters are AND'ed, not OR'ed. Specifies a maximum number of results that are required (uses the _count search parameter). Specifies the order of the results to be returned. Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The code-valued attribute of the filter. The specified path SHALL be a FHIRPath resolveable on the specified type of the DataRequirement, and SHALL consist only of identifiers, constant indexers, and .resolve(). The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details). Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept. A token parameter that refers to a search parameter defined on the specified type of the DataRequirement, and which searches on elements of type code, Coding, or CodeableConcept. The valueset for the code filter. The valueSet and code elements are additive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset. The codes for the code filter. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codes. If codes are specified in addition to a value set, the filter returns items matching a code in the value set or one of the specified codes. Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The date-valued attribute of the filter. The specified path SHALL be a FHIRPath resolveable on the specified type of the DataRequirement, and SHALL consist only of identifiers, constant indexers, and .resolve(). The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details). Note that the index must be an integer constant. The path must resolve to an element of type date, dateTime, Period, Schedule, or Timing. A date parameter that refers to a search parameter defined on the specified type of the DataRequirement, and which searches on elements of type date, dateTime, Period, Schedule, or Timing. The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime. If a Duration is specified, the filter will return only those data items that fall within Duration before now. Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The attribute of the sort. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The direction of the sort, ascending or descending. Ascending Descending The possible sort directions, ascending or descending. If the element is present, it must have either a @value, an @id, or extensions Indicates how the medication is/was taken or should be taken by the patient. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Indicates the order in which the dosage instructions should be applied or interpreted. Free text dosage instructions e.g. SIG. Supplemental instructions to the patient on how to take the medication (e.g. "with meals" or"take half to one hour before food") or warnings for the patient about the medication (e.g. "may cause drowsiness" or "avoid exposure of skin to direct sunlight or sunlamps"). Instructions in terms that are understood by the patient or consumer. When medication should be administered. Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). Body site to administer to. How drug should enter body. Technique for administering medication. The amount of medication administered. Upper limit on medication per unit of time. Upper limit on medication per administration. Upper limit on medication per lifetime of the patient. Indicates how the medication is/was taken or should be taken by the patient. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The kind of dose or rate specified, for example, ordered or calculated. Amount of medication per dose. Amount of medication per unit of time. An amount of economic utility in some recognized currency. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Numerical value (with implicit precision). ISO 4217 Currency Code. A human's name with the ability to identify parts and usage. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Identifies the purpose for this name. Specifies the entire name as it should be displayed e.g. on an application UI. This may be provided instead of or as well as the specific parts. The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father. Given name. Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name. Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name. Indicates the period of time when this name was valid for the named person. Usual Official Temp Nickname Anonymous Old Name changed for Marriage The use of a human name. If the element is present, it must have either a @value, an @id, or extensions Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Telecommunications form for contact point - what communications system is required to make use of the contact. The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). Identifies the purpose for the contact point. Specifies a preferred order in which to use a set of contacts. ContactPoints with lower rank values are more preferred than those with higher rank values. Time period when the contact point was/is in use. Phone Fax Email Pager URL SMS Other Telecommunications form for contact point. If the element is present, it must have either a @value, an @id, or extensions Home Work Temp Old Mobile Use of contact point. If the element is present, it must have either a @value, an @id, or extensions The marketing status describes the date when a medicinal product is actually put on the market or the date as of which it is no longer available. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The country in which the marketing authorisation has been granted shall be specified It should be specified using the ISO 3166 ‑ 1 alpha-2 code elements. Where a Medicines Regulatory Agency has granted a marketing authorisation for which specific provisions within a jurisdiction apply, the jurisdiction can be specified using an appropriate controlled terminology The controlled term and the controlled term identifier shall be specified. This attribute provides information on the status of the marketing of the medicinal product See ISO/TS 20443 for more information and examples. The date when the Medicinal Product is placed on the market by the Marketing Authorisation Holder (or where applicable, the manufacturer/distributor) in a country and/or jurisdiction shall be provided A complete date consisting of day, month and year shall be specified using the ISO 8601 date format NOTE “Placed on the market” refers to the release of the Medicinal Product into the distribution chain. The date when the Medicinal Product is placed on the market by the Marketing Authorisation Holder (or where applicable, the manufacturer/distributor) in a country and/or jurisdiction shall be provided A complete date consisting of day, month and year shall be specified using the ISO 8601 date format NOTE “Placed on the market” refers to the release of the Medicinal Product into the distribution chain. An identifier - identifies some entity uniquely and unambiguously. Typically this is used for business identifiers. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The purpose of this identifier. A coded type for the identifier that can be used to determine which identifier to use for a specific purpose. Establishes the namespace for the value - that is, a URL that describes a set values that are unique. The portion of the identifier typically relevant to the user and which is unique within the context of the system. Time period during which identifier is/was valid for use. Organization that issued/manages the identifier. Usual Official Temp Secondary Old Identifies the purpose for this identifier, if known . If the element is present, it must have either a @value, an @id, or extensions Chemical substances are a single substance type whose primary defining element is the molecular structure. Chemical substances shall be defined on the basis of their complete covalent molecular structure; the presence of a salt (counter-ion) and/or solvates (water, alcohols) is also captured. Purity, grade, physical form or particle size are not taken into account in the definition of a chemical substance or in the assignment of a Substance ID. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Used to capture quantitative values for a variety of elements. If only limits are given, the arithmetic mean would be the average. If only a single definite value for a given element is given, it would be captured in this field. Most elements that require a quantitative value will also have a field called amount type. Amount type should always be specified because the actual value of the amount is often dependent on it. EXAMPLE: In capturing the actual relative amounts of substances or molecular fragments it is essential to indicate whether the amount refers to a mole ratio or weight ratio. For any given element an effort should be made to use same the amount type for all related definitional elements. A textual comment on a numeric value. Reference range of possible or expected values. Chemical substances are a single substance type whose primary defining element is the molecular structure. Chemical substances shall be defined on the basis of their complete covalent molecular structure; the presence of a salt (counter-ion) and/or solvates (water, alcohols) is also captured. Purity, grade, physical form or particle size are not taken into account in the definition of a chemical substance or in the assignment of a Substance ID. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Lower limit possible or expected. Upper limit possible or expected. A reference to a code defined by a terminology system. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The identification of the code system that defines the meaning of the symbol in the code. The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured, and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged. A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). A representation of the meaning of the code in the system, following the rules of the system. Indicates that this coding was chosen by a user directly - e.g. off a pick list of available items (codes or displays). A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series. The length of time between sampling times, measured in milliseconds. A correction factor that is applied to the sampled data points before they are added to the origin. The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once. A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value. A populatioof people with some set of grouping criteria. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The age of the specific population. The gender of the specific population. Race of the specific population. The existing physiological conditions of the specific population to which this applies. A relationship of two Quantity values - expressed as a numerator and a denominator. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The value of the numerator. The value of the denominator. A length - a value with a unit that is a physical distance. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions A duration of time during which an organism (or a process) has existed. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions A reference from one resource to another. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources. The expected type of the target of the reference. If both Reference.type and Reference.reference are populated and Reference.reference is a FHIR URL, both SHALL be consistent. The type is the Canonical URL of Resource Definition that is the type this reference refers to. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition/ e.g. "Patient" is a reference to http://hl7.org/fhir/StructureDefinition/Patient. Absolute URLs are only allowed for logical models (and can only be used in references in logical models, not resources). An identifier for the target resource. This is used when there is no way to reference the other resource directly, either because the entity it represents is not available through a FHIR server, or because there is no way for the author of the resource to convert a known identifier to an actual location. There is no requirement that a Reference.identifier point to something that is actually exposed as a FHIR instance, but it SHALL point to a business concept that would be expected to be exposed as a FHIR instance, and that instance would need to be of a FHIR resource type allowed by the reference. Plain text narrative that identifies the resource in addition to the resource reference. A description of a triggering event. Triggering events can be named events, data events, or periodic, as determined by the type element. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The type of triggering event. A formal name for the event. This may be an absolute URI that identifies the event formally (e.g. from a trigger registry), or a simple relative URI that identifies the event in a local context. The timing of the event (if this is a periodic trigger). The triggering data of the event (if this is a data trigger). If more than one data is requirement is specified, then all the data requirements must be true. A boolean-valued expression that is evaluated in the context of the container of the trigger definition and returns whether or not the trigger fires. Named Event Periodic Data Changed Data Added Data Updated Data Removed Data Accessed Data Access Ended The type of trigger. If the element is present, it must have either a @value, an @id, or extensions A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The value of the measured amount. The value includes an implicit precision in the presentation of the value. How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is "<" , then the real value is < stated value. A human-readable form of the unit. The identification of the system that provides the coded form of the unit. A computer processable form of the unit in some unit representation system. Less than Less or Equal to Greater or Equal to Greater than How the Quantity should be understood and represented. If the element is present, it must have either a @value, an @id, or extensions A time period defined by a start and end date and optionally time. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The start of the period. The boundary is inclusive. The end of the period. If the end of the period is missing, it means no end was known or planned at the time the instance was created. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time. A length of time. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions A set of ordered Quantities defined by a low and high limit. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The low limit. The boundary is inclusive. The high limit. The boundary is inclusive. Related artifacts such as additional documentation, justification, or bibliographic references. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The type of relationship to the related artifact. A short label that can be used to reference the citation from elsewhere in the containing artifact, such as a footnote index. A brief description of the document or knowledge resource being referenced, suitable for display to a consumer. A bibliographic citation for the related artifact. This text SHOULD be formatted according to an accepted citation format. A url for the artifact that can be followed to access the actual content. The document being referenced, represented as an attachment. This is exclusive with the resource element. The related resource, such as a library, value set, profile, or other knowledge resource. Documentation Justification Citation Predecessor Successor Derived From Depends On Composed Of The type of relationship to the related artifact. If the element is present, it must have either a @value, an @id, or extensions A text note which also contains information about who made the statement and when. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The individual responsible for making the annotation. Indicates when this particular annotation was made. The text of the annotation in markdown format. The shelf-life and storage information for a medicinal product item or container can be described using this class. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Unique identifier for the packaged Medicinal Product. This describes the shelf life, taking into account various scenarios such as shelf life of the packaged Medicinal Product itself, shelf life after transformation where necessary and shelf life after the first opening of a bottle, etc. The shelf life type shall be specified using an appropriate controlled vocabulary The controlled term and the controlled term identifier shall be specified. The shelf life time period can be specified using a numerical value for the period of time and its unit of time measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used. Special precautions for storage, if any, can be specified using an appropriate controlled vocabulary The controlled term and the controlled term identifier shall be specified. Specifies contact information for a person or organization. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The name of an individual to contact. The contact details for the individual (if a name was provided) or the organization. Specifies clinical/business/etc. metadata that can be used to retrieve, index and/or categorize an artifact. This metadata can either be specific to the applicable population (e.g., age category, DRG) or the specific context of care (e.g., venue, care setting, provider of care). If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions A code that identifies the type of context being specified by this usage context. A value that defines the context specified in this context of use. The interpretation of the value is defined by the code. A expression that is evaluated in a specified context and returns a value. The context of use of the expression must specify the context in which the expression is evaluated, and how the result of the expression is used. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions A brief, natural language description of the condition that effectively communicates the intended semantics. A short name assigned to the expression to allow for multiple reuse of the expression in the context where it is defined. The media type of the language for the expression. An expression in the specified language that returns a value. A URI that defines where the expression is found. CQL FHIRPath FHIR Query The media type of the expression language. If the element is present, it must have either a @value, an @id, or extensions A signature along with supporting context. The signature may be a digital signature that is cryptographic in nature, or some other signature acceptable to the domain. This other signature may be as simple as a graphical image representing a hand-written signature, or a signature ceremony Different signature approaches have different utilities. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document. When the digital signature was signed. A reference to an application-usable description of the identity that signed (e.g. the signature used their private key). A reference to an application-usable description of the identity that is represented by the signature. A mime type that indicates the technical format of the target resources signed by the signature. A mime type that indicates the technical format of the signature. Important mime types are application/signature+xml for X ML DigSig, application/jose for JWS, and image/* for a graphical image of a signature, etc. The base64 encoding of the Signature content. When signature is not recorded electronically this element would be empty. Specifies an event that may occur multiple times. Timing schedules are used to record when things are planned, expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds, and may be used for reporting the schedule to which past regular activities were carried out. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Identifies specific times when the event occurs. A set of rules that describe when the event is scheduled. A code for the timing schedule (or just text in code.text). Some codes such as BID are ubiquitous, but many institutions define their own additional codes. If a code is provided, the code is understood to be a complete statement of whatever is specified in the structured timing data, and either the code or the data may be used to interpret the Timing, with the exception that .repeat.bounds still applies over the code (and is not contained in the code). Specifies an event that may occur multiple times. Timing schedules are used to record when things are planned, expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds, and may be used for reporting the schedule to which past regular activities were carried out. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule. A total count of the desired number of repetitions across the duration of the entire timing specification. If countMax is present, this element indicates the lower bound of the allowed range of count values. If present, indicates that the count is a range - so to perform the action between [count] and [countMax] times. How long this thing happens for when it happens. If durationMax is present, this element indicates the lower bound of the allowed range of the duration. If present, indicates that the duration is a range - so to perform the action between [duration] and [durationMax] time length. The units of time for the duration, in UCUM units. The number of times to repeat the action within the specified period. If frequencyMax is present, this element indicates the lower bound of the allowed range of the frequency. If present, indicates that the frequency is a range - so to repeat between [frequency] and [frequencyMax] times within the period or period range. Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. If periodMax is present, this element indicates the lower bound of the allowed range of the period length. If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days. The units of time for the period in UCUM units. If one or more days of week is provided, then the action happens only on the specified day(s). Specified time of day for action to take place. An approximate time period during the day, potentially linked to an event of daily living that indicates when the action should occur. The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event. 分钟 小时 星期 A unit of time (units from UCUM). If the element is present, it must have either a @value, an @id, or extensions Morning Early Morning Late Morning Noon Afternoon Early Afternoon Late Afternoon Evening Early Evening Late Evening Night After Sleep HS WAKE C CM CD CV AC ACM ACD ACV PC PCM PCD PCV Real world event relating to the schedule. If the element is present, it must have either a @value, an @id, or extensions The marketing status describes the date when a medicinal product is actually put on the market or the date as of which it is no longer available. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Where applicable, the height can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used. Where applicable, the width can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used. Where applicable, the depth can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used. Where applicable, the weight can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used. Where applicable, the nominal volume can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used. Where applicable, the external diameter can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used. Where applicable, the shape can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used. Where applicable, the color can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used. Where applicable, the imprint can be specified as text. Where applicable, the image can be provided The format of the image attachment shall be specified by regional implementations. Where applicable, the scoring can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used. A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions A reference to a code defined by a terminology system. A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The name of the parameter used to allow access to the value of the parameter in evaluation contexts. Whether the parameter is input or output for the module. The minimum number of times this parameter SHALL appear in the request or response. The maximum number of times this element is permitted to appear in the request or response. A brief discussion of what the parameter is for and how it is used by the module. The type of the parameter. If specified, this indicates a profile that the input data must conform to, or that the output data will conform to. Captures constraints on each element within the resource, profile, or extension. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. Codes that define how this element is represented in instances, when the deviation varies from the normal case. The name of this element definition slice, when slicing is working. The name must be a token with no dots or spaces. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element. If true, indicates that this slice definition is constraining a slice definition with the same name in an inherited profile. If false, the slice is not overriding any slice in an inherited profile. If missing, the slice might or might not be overriding a slice in an inherited profile, depending on the sliceName. A single preferred label which is the text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form. A code that has the same meaning as the element in a particular terminology. Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set). A concise description of what this element means (e.g. for use in autogenerated summaries). Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource. (Note: The text you are reading is specified in ElementDefinition.definition). Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc. (Note: The text you are reading is specified in ElementDefinition.comment). This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element. Identifies additional names by which this element might also be known. The minimum number of times this element SHALL appear in the instance. The maximum number of times this element is permitted to appear in the instance. Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. When the element definition is not the original definition of an element - i.g. either in a constraint on another type, or for elements from a super type in a snap shot - then the information in provided in the element definition may be different to the base definition. On the original definition of the element, it will be same. Identifies an element defined elsewhere in the definition whose content rules should be applied to the current element. ContentReferences bring across all the rules that are in the ElementDefinition for the element, including definitions, cardinality constraints, bindings, invariants etc. The data type or resource that the value of this element is permitted to be. The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false'). The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'). If present, indicates that the order of the repeating element has meaning and describes what that meaning is. If absent, it means that the order of the element has no meaning. Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing. Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly. When pattern[x] is used to constrain an array, it means that each element provided in the pattern[x] array must (recursively) match at least one element from the instance array. When pattern[x] is used to constrain a complex object, it means that each property in the pattern must be present in the complex object, and its value must recursively match -- i.e., 1. If primitive: it must match exactly the pattern value 2. If a complex object: it must match (recursively) the pattern value 3. If an array: it must match (recursively) the pattern value. A sample value for this element demonstrating the type of information that would typically be found in the element. The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity. The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity. Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element. A reference to an invariant that may make additional statements about the cardinality or value in the instance. Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance. If true, implementations that produce or consume resources SHALL provide "support" for the element in some meaningful way. If false, the element may be ignored and not supported. If false, whether to populate or use the data element in any way is at the discretion of the implementation. If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system. Explains how that element affects the interpretation of the resource or element that contains it. Whether the element should be included if a client requests a search with the parameter _summary=true. Binds to a value set if this element is coded (code, Coding, CodeableConcept, Quantity), or the data types (string, uri). Identifies a concept from an external specification that roughly corresponds to this element. Captures constraints on each element within the resource, profile, or extension. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality. Description of why this constraint is necessary or appropriate. Identifies the impact constraint violation has on the conformance of the instance. Text that can be used to describe the constraint in messages identifying that the constraint has been violated. A [FHIRPath](fhirpath.html) expression of constraint that can be executed to see if this constraint is met. An XPath expression of constraint that can be executed to see if this constraint is met. A reference to the original source of the constraint, for traceability purposes. Captures constraints on each element within the resource, profile, or extension. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions An internal reference to the definition of a mapping. Identifies the computable language in which mapping.map is expressed. Expresses what part of the target specification corresponds to this element. Comments that provide information about the mapping or its use. Captures constraints on each element within the resource, profile, or extension. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base. Minimum cardinality of the base element identified by the path. Maximum cardinality of the base element identified by the path. Captures constraints on each element within the resource, profile, or extension. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions URL of Data type or Resource that is a(or the) type used for this element. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition e.g. "string" is a reference to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are only allowed in logical models. Identifies a profile structure or implementation Guide that applies to the datatype this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the type SHALL conform to at least one profile defined in the implementation guide. Used when the type is "Reference" or "canonical", and identifies a profile structure or implementation Guide that applies to the target of the reference this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the target resource SHALL conform to at least one profile defined in the implementation guide. If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle. Whether this reference needs to be version specific or version independent, or whether either can be used. Captures constraints on each element within the resource, profile, or extension. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Describes the purpose of this example amoung the set of examples. The actual value for the element, which must be one of the types allowed for this element. Captures constraints on each element within the resource, profile, or extension. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices. A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated. If the matching elements have to occur in the same order as defined in the profile. Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end. Captures constraints on each element within the resource, profile, or extension. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances. Describes the intended use of this particular set of codes. Refers to the value set that identifies the set of codes the binding refers to. Captures constraints on each element within the resource, profile, or extension. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions How the element value is interpreted when discrimination is evaluated. A FHIRPath expression, using [the simple subset of FHIRPath](fhirpath.html#simple), that is used to identify the element on which discrimination is based. XML Attribute XML Text Type Attribute CDA Text Format XHTML How a property is represented when serialized. If the element is present, it must have either a @value, an @id, or extensions Error Warning SHALL applications comply with this constraint? If the element is present, it must have either a @value, an @id, or extensions Contained Referenced Bundled How resource references can be aggregated. If the element is present, it must have either a @value, an @id, or extensions Either Specific or independent Version independent Version Specific Whether a reference needs to be version specific or version independent, or whether either can be used. If the element is present, it must have either a @value, an @id, or extensions Closed Open Open at End How slices are interpreted when evaluating an instance. If the element is present, it must have either a @value, an @id, or extensions Required Extensible Preferred Example Indication of the degree of conformance expectations associated with a binding. If the element is present, it must have either a @value, an @id, or extensions Value Exists Pattern Type Profile How an element value is interpreted when discrimination is evaluated. If the element is present, it must have either a @value, an @id, or extensions A resource that includes narrative, extensions, and contained resources. A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety. These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope. May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself). This is the base resource type for everything. The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource. A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc. The base language in which the resource is written. Draft черновик ontwerp Active активный actief Retired удалён verouderd Unknown If the element is present, it must have either a @value, an @id, or extensions Number Date/DateTime String Token Reference Composite Quantity URI Special If the element is present, it must have either a @value, an @id, or extensions Male Female Other Unknown If the element is present, it must have either a @value, an @id, or extensions 0.01 0.05 0.06 0.11 0.0.80 0.0.81 0.0.82 0.4.0 0.5.0 1.0.0 1.0.1 1.0.2 1.1.0 1.4.0 1.6.0 1.8.0 3.0.0 3.0.1 3.3.0 3.5.0 4.0.0 4.0.1 If the element is present, it must have either a @value, an @id, or extensions Display Print (Form) Print (Operator) If the element is present, it must have either a @value, an @id, or extensions Queued Processing Complete Error Partial Processing If the element is present, it must have either a @value, an @id, or extensions Related To Equivalent Equal Wider Subsumes Narrower Specializes Inexact Unmatched Disjoint If the element is present, it must have either a @value, an @id, or extensions Current Superseded Entered in Error If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/fhir-invariants.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Account dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ActivityDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end age-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. If value is present, it SHALL be positive. per-1: If present, start SHALL have a lower value than end rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided exp-1: An expression or a reference must be provided AdverseEvent dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided AllergyIntolerance dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label ait-1: AllergyIntolerance.clinicalStatus SHALL be present if verificationStatus is not entered-in-error. ait-2: AllergyIntolerance.clinicalStatus SHALL NOT be present if verification Status is entered-in-error txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided age-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. If value is present, it SHALL be positive. per-1: If present, start SHALL have a lower value than end rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Appointment dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label app-4: Cancelation reason is only used for appointments that have been cancelled, or no-show app-3: Only proposed or cancelled appointments can be missing start/end dates app-2: Either start and end are specified, or neither txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided app-1: Either the type or actor on the participant SHALL be specified ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end AppointmentResponse dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label apr-1: Either the participantType or actor must be specified txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided AuditEvent dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided sev-1: Either a name or a query (NOT both) ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Basic dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Binary ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided BiologicallyDerivedProduct dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end BodyStructure dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Bundle bdl-7: FullUrl must be unique in a bundle, or else entries with the same fullUrl must have different meta.versionId (except in history bundles) bdl-9: A document must have an identifier with a system and a value bdl-3: entry.request mandatory for batch/transaction/history, otherwise prohibited bdl-4: entry.response mandatory for batch-response/transaction-response/history, otherwise prohibited bdl-12: A message must have a MessageHeader as the first resource bdl-1: total only when a search or history bdl-2: entry.search only when a search bdl-11: A document must have a Composition as the first resource bdl-10: A document must have a date per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided bdl-8: fullUrl cannot be a version specific reference bdl-5: must be a resource unless there's a request or response ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided CapabilityStatement dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label cpb-7: The set of documents must be unique by the combination of profile and mode. cpb-16: If kind = requirements, implementation and software must be absent cpb-15: If kind = capability, implementation must be absent, software must be present cpb-3: Messaging end-point is required (and is only permitted) when a statement is for an implementation. cpb-14: If kind = instance, implementation must be present and software may be present cpb-2: A Capability Statement SHALL have at least one of description, software, or implementation element. cpb-1: A Capability Statement SHALL have at least one of REST, messaging or document element. txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpb-9: A given resource can only be described once per RESTful mode. cpb-12: Search parameter names must be unique in the context of a resource. CarePlan dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpl-3: Provide a reference or detail, not both ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided CareTeam dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ctm-1: CareTeam.participant.onBehalfOf can only be populated when CareTeam.participant.member is a Practitioner ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided CatalogEntry dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ChargeItem dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ChargeItemDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Claim dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ClaimResponse dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ClinicalImpression dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided CodeSystem dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label csd-1: Within a code system definition, all the codes SHALL be unique txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Communication dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided CommunicationRequest dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided CompartmentDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Composition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cmp-1: A section must contain at least one of text, entries, or sub-sections cmp-2: A section can only have an emptyReason if it is empty ConceptMap dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cmd-1: If the map is narrower or inexact, there SHALL be some comments cmd-3: If the mode is 'other-map', a url must be provided cmd-2: If the mode is 'fixed', a code must be provided Condition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label con-5: Condition.clinicalStatus SHALL NOT be present if verification Status is entered-in-error con-4: If condition is abated, then clinicalStatus must be either inactive, resolved, or remission txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided age-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. If value is present, it SHALL be positive. per-1: If present, start SHALL have a lower value than end rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present age-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. If value is present, it SHALL be positive. per-1: If present, start SHALL have a lower value than end rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided con-1: Stage SHALL have summary or assessment ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided con-2: evidence SHALL have code or details ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Consent dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label ppc-4: IF Scope=adr, there must be a patient ppc-5: IF Scope=treatment, there must be a patient ppc-2: IF Scope=privacy, there must be a patient ppc-3: IF Scope=research, there must be a patient ppc-1: Either a Policy or PolicyRule txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Contract dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Coverage dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided CoverageEligibilityRequest dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided CoverageEligibilityResponse dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ces-1: SHALL contain a category or a billcode but not both. ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided DetectedIssue dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Device dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided DeviceDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present att-1: If the Attachment has data, it SHALL have a contentType qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided DeviceMetric dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end DeviceRequest dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided DeviceUseStatement dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided DiagnosticReport dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType DocumentManifest dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided DocumentReference dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided EffectEvidenceSynthesis dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Encounter dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Endpoint dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end EnrollmentRequest dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided EnrollmentResponse dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided EpisodeOfCare dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided EventDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType trd-3: A named event requires a name, a periodic event requires timing, and a data event requires data trd-2: A condition only if there is a data requirement trd-1: Either timing, or a data requirement, but not both tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided drq-1: Either a path or a searchParam must be provided, but not both drq-2: Either a path or a searchParam must be provided, but not both per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. exp-1: An expression or a reference must be provided Evidence dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided EvidenceVariable dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided exp-1: An expression or a reference must be provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided drq-1: Either a path or a searchParam must be provided, but not both drq-2: Either a path or a searchParam must be provided, but not both per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. trd-3: A named event requires a name, a periodic event requires timing, and a data event requires data trd-2: A condition only if there is a data requirement trd-1: Either timing, or a data requirement, but not both tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided drq-1: Either a path or a searchParam must be provided, but not both drq-2: Either a path or a searchParam must be provided, but not both per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. exp-1: An expression or a reference must be provided qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. ExampleScenario dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ExplanationOfBenefit dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType per-1: If present, start SHALL have a lower value than end FamilyMemberHistory dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label fhs-2: Can only have estimatedAge if age[x] is present fhs-1: Can have age[x] or born[x], but not both txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end age-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. If value is present, it SHALL be positive. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present age-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. If value is present, it SHALL be positive. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided age-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. If value is present, it SHALL be positive. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Flag dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Goal dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided gol-1: Goal.target.measure is required if Goal.target.detail is populated qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided GraphDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Group dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label grp-1: Can only have members if group is "actual" txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end GuidanceResponse dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided drq-1: Either a path or a searchParam must be provided, but not both drq-2: Either a path or a searchParam must be provided, but not both per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. HealthcareService dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ImagingStudy dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Immunization dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided imm-1: One of documentType or reference SHALL be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ImmunizationEvaluation dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ImmunizationRecommendation dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided imr-1: One of vaccineCode or targetDisease SHALL be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ImplementationGuide dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label ig-2: If a resource has a fhirVersion, it must be oe of the versions defined for the Implementation Guide txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ig-1: If a resource has a groupingId, it must refer to a grouping defined in the Implementation Guide ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided InsurancePlan dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label ipn-1: The organization SHALL at least have a name or an idendtifier, and possibly more than one txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present Invoice dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Library dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided drq-1: Either a path or a searchParam must be provided, but not both drq-2: Either a path or a searchParam must be provided, but not both per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. att-1: If the Attachment has data, it SHALL have a contentType Linkage dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label lnk-1: Must have at least two items txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided List dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label lst-3: An entry date can only be used if the mode of the list is "working" lst-2: The deleted flag can only be used if the mode of the list is "changes" lst-1: A list can only have an emptyReason if it is empty txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Location dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Measure dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label mea-1: Stratifier SHALL be either a single criteria or a set of criteria components txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType exp-1: An expression or a reference must be provided exp-1: An expression or a reference must be provided exp-1: An expression or a reference must be provided exp-1: An expression or a reference must be provided MeasureReport dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label mrp-2: Stratifiers SHALL be either a single criteria or a set of criteria components mrp-1: Measure Reports used for data collection SHALL NOT communicate group and score information txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Media dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Medication dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present MedicationAdministration dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided mad-1: SHALL have at least one of dosage.dose or dosage.rate[x] qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided MedicationDispense dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label mdd-1: whenHandedOver cannot be before whenPrepared txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided MedicationKnowledge dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. MedicationRequest dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided MedicationStatement dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present MedicinalProduct dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided MedicinalProductAuthorization dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided MedicinalProductContraindication dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present MedicinalProductIndication dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present MedicinalProductIngredient dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present MedicinalProductInteraction dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided MedicinalProductManufactured dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present att-1: If the Attachment has data, it SHALL have a contentType MedicinalProductPackaged dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided MedicinalProductPharmaceutical dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. qty-3: If a code for the unit is present, the system SHALL also be present MedicinalProductUndesirableEffect dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present MessageDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided md-1: Max must be postive int or * MessageHeader dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided MolecularSequence dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label msq-3: Only 0 and 1 are valid for coordinateSystem txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present msq-6: Have and only have one of the following elements in referenceSeq : 1. genomeBuild ; 2 referenceSeqId; 3. referenceSeqPointer; 4. referenceSeqString; msq-5: GenomeBuild and chromosome must be both contained if either one of them is contained ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided NamingSystem dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label nsd-1: Root systems cannot have uuid identifiers nsd-2: Can't have more than one preferred identifier for a type txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end NutritionOrder dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Observation dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label obs-7: If Observation.code is the same as an Observation.component.code then the value element associated with the code SHALL NOT be present obs-6: dataAbsentReason SHALL only be present if Observation.value[x] is not present txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided obs-3: Must have at least a low or a high or text qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ObservationDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided OperationDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided opd-1: Either a type must be provided, or parts opd-2: A search type can only be specified for parameters of type string opd-3: A targetProfile can only be specified for parameters of type Reference or Canonical OperationOutcome dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content Organization dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label org-1: The organization SHALL at least have a name or an identifier, and possibly more than one txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided org-3: The telecom of an organization can never be of use 'home' cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end org-2: An address of an organization can never be of use 'home' per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided OrganizationAffiliation dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Patient dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType pat-1: SHALL at least contain a contact's details or a reference to an organization per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided PaymentNotice dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided PaymentReconciliation dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Person dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided PlanDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType att-1: If the Attachment has data, it SHALL have a contentType qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. Practitioner dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided PractitionerRole dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Procedure dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end age-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. If value is present, it SHALL be positive. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Provenance dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Questionnaire dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label que-2: The link ids for groups and questions must be unique within the questionnaire txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end que-9: Read-only can't be specified for "display" items que-8: Initial values can't be specified for groups or display items que-6: Required and repeat aren't permitted for display items que-5: Only 'choice' and 'open-choice' items can have answerValueSet que-4: A question cannot have both answerOption and answerValueSet que-3: Display items cannot have a "code" asserted que-10: Maximum length can only be declared for simple question types que-1: Group items must have nested items, display items cannot have nested items que-13: Can only have multiple initial values for repeating items que-11: If one or more answerOption is present, initial[x] must be missing que-12: If there are more than one enableWhen, enableBehavior must be specified QuestionnaireResponse dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qrs-1: Nested item can't be beneath both item and answer RelatedPerson dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType per-1: If present, start SHALL have a lower value than end RequestGroup dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided rqg-1: Must have resource or action but not both ResearchDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ResearchElementDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType exp-1: An expression or a reference must be provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided drq-1: Either a path or a searchParam must be provided, but not both drq-2: Either a path or a searchParam must be provided, but not both per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. ResearchStudy dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ResearchSubject dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided RiskAssessment dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ras-2: Must be <= 100 ras-1: low and high must be percentages, if present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided RiskEvidenceSynthesis dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Schedule dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end SearchParameter dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label spd-1: If an xpath is present, there SHALL be an xpathUsage spd-2: Search parameters can only have chain names when the search parameter type is 'reference' txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ServiceRequest dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label prr-1: orderDetail SHALL only be present if code is present txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Slot dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Specimen dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. qty-3: If a code for the unit is present, the system SHALL also be present drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided SpecimenDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. StructureDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label sdf-9: In any snapshot or differential, no label, code or requirements on an element without a "." in the path (e.g. the first element) sdf-15a: If the first element in a differential has no "." in the path and it's not a logical model, it has no type sdf-19: FHIR Specification models only use FHIR defined types sdf-16: All element definitions must have unique ids (snapshot) sdf-15: The first element in a snapshot has no type unless model is a logical model. sdf-18: Context Invariants can only be used for extensions sdf-17: All element definitions must have unique ids (diff) sdf-23: No slice name on root sdf-11: If there's a type, its content must match the path name in the first element of a snapshot sdf-22: FHIR Specification models never have default values sdf-14: All element definitions must have an id sdf-1: Element paths must be unique unless the structure is a constraint sdf-21: Default values can only be specified on specializations sdf-6: A structure must have either a differential, or a snapshot (or both) sdf-5: If the structure defines an extension then the structure must have context information sdf-4: If the structure is not abstract, then there SHALL be a baseDefinition txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided sdf-2: Must have at least a name or a uri (or both) sdf-8: All snapshot elements must start with the StructureDefinition's specified type for non-logical models, or with the same type name for logical models sdf-3: Each element definition in a snapshot must have a formal definition and cardinalities sdf-8b: All snapshot elements must have a base definition sdf-10: provide either a binding reference or a description (or both) eld-19: Element names cannot include some special characters eld-2: Min <= Max eld-5: if the element definition has a contentReference, it cannot have type, defaultValue, fixed, pattern, example, minValue, maxValue, maxLength, or binding eld-7: Pattern may only be specified if there is one type eld-6: Fixed value may only be specified if there is one type eld-11: Binding can only be present for coded elements, string, and uri eld-22: sliceIsConstraining can only appear if slicename is present eld-8: Pattern and fixed are mutually exclusive eld-14: Constraints must be unique by key eld-13: Types must be unique by code eld-16: sliceName must be composed of proper tokens separated by "/" eld-15: default value and meaningWhenMissing are mutually exclusive eld-18: Must have a modifier reason if isModifier = true eld-1: If there are no discriminators, there must be a definition eld-3: Max SHALL be a number or "*" eld-4: Aggregation may only be specified if one of the allowed types for the element is a reference eld-17: targetProfile is only allowed if the type is Reference or canonical qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present eld-12: ValueSet SHALL start with http:// or https:// or urn: sdf-20: No slicing on the root element sdf-8a: In any differential, all the elements must start with the StructureDefinition's specified type for non-logical models, or with the same type name for logical models eld-19: Element names cannot include some special characters eld-2: Min <= Max eld-5: if the element definition has a contentReference, it cannot have type, defaultValue, fixed, pattern, example, minValue, maxValue, maxLength, or binding eld-7: Pattern may only be specified if there is one type eld-6: Fixed value may only be specified if there is one type eld-11: Binding can only be present for coded elements, string, and uri eld-22: sliceIsConstraining can only appear if slicename is present eld-8: Pattern and fixed are mutually exclusive eld-14: Constraints must be unique by key eld-13: Types must be unique by code eld-16: sliceName must be composed of proper tokens separated by "/" eld-15: default value and meaningWhenMissing are mutually exclusive eld-18: Must have a modifier reason if isModifier = true eld-1: If there are no discriminators, there must be a definition eld-3: Max SHALL be a number or "*" eld-4: Aggregation may only be specified if one of the allowed types for the element is a reference eld-17: targetProfile is only allowed if the type is Reference or canonical qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present eld-12: ValueSet SHALL start with http:// or https:// or urn: StructureMap dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Subscription dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end Substance dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided SubstanceNucleicAcid dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content att-1: If the Attachment has data, it SHALL have a contentType per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided SubstancePolymer dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present att-1: If the Attachment has data, it SHALL have a contentType SubstanceProtein dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content att-1: If the Attachment has data, it SHALL have a contentType per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided SubstanceReferenceInformation dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided SubstanceSourceMaterial dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided SubstanceSpecification dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided SupplyDelivery dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided SupplyRequest dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Task dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label inv-1: Last modified date must be greater than or equal to authored-on date. txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided TerminologyCapabilities dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label tcp-3: If kind = instance, implementation must be present and software may be present tcp-2: A Capability Statement SHALL have at least one of description, software, or implementation element. tcp-5: If kind = requirements, implementation and software must be absent tcp-4: If kind = capability, implementation must be absent, software must be present txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided tcp-1: If there is more than one version, a version code must be defined TestReport dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided inv-1: Setup action SHALL contain either an operation or assert but not both. inv-2: Test action SHALL contain either an operation or assert but not both. TestScript dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided tst-4: TestScript metadata capability SHALL contain required or validated or both. ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided tst-3: Variable can only contain one of expression, headerField or path. tst-1: Setup action SHALL contain either an operation or assert but not both. tst-7: Setup operation SHALL contain either sourceId or targetId or params or url. tst-12: Setup action assert response and responseCode SHALL be empty when direction equals request tst-5: Only a single assertion SHALL be present within setup action assert element. tst-10: Setup action assert SHALL contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither. tst-2: Test action SHALL contain either an operation or assert but not both. tst-8: Test operation SHALL contain either sourceId or targetId or params or url. tst-11: Test action assert SHALL contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither. tst-13: Test action assert response and response and responseCode SHALL be empty when direction equals request tst-6: Only a single assertion SHALL be present within test action assert element. tst-9: Teardown operation SHALL contain either sourceId or targetId or params or url. ValueSet dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided vsd-2: A value set with concepts or filters SHALL include a system vsd-3: Cannot have both concept and filter vsd-1: A value set include/exclude SHALL have a value set or a system vsd-6: SHALL have a code or a display vsd-9: Must have a code if not abstract vsd-10: Must have a system if a code is present VerificationResult dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided VisionPrescription dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided Extension: substanceExposureRisk 1 inv-1: If the substanceExposureRisk extension element is present, the AllergyIntolerance.code element must be omitted. ================================================ FILE: tests/static/xsd/fhir/fhir-single.xsd ================================================ A date or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date. Dates SHALL be valid dates. If the element is present, it must have either a @value, an @id, or extensions A date, date-time or partial date (e.g. just year or year + month). If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored. Dates SHALL be valid dates. If the element is present, it must have either a @value, an @id, or extensions A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions A sequence of Unicode characters Note that FHIR strings SHALL NOT exceed 1MB in size If the element is present, it must have either a @value, an @id, or extensions A whole number 32 bit number; for values larger than this, use decimal If the element is present, it must have either a @value, an @id, or extensions An OID represented as a URI RFC 3001. See also ISO/IEC 8824:1990 € If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions A URI that is a reference to a canonical URL on a FHIR resource see [Canonical References](references.html#canonical) If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions String of characters used to identify a name or a resource see http://en.wikipedia.org/wiki/Uniform_resource_identifier If the element is present, it must have either a @value, an @id, or extensions A UUID, represented as a URI See The Open Group, CDE 1.1 Remote Procedure Call specification, Appendix A. If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions A URI that is a literal reference If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions An instant in time - known at least to the second Note: This is intended for where precisely observed times are required, typically system logs etc., and not human-reported times - for them, see date and dateTime (which can be as precise as instant, but is not required to be) below. Time zone is always required If the element is present, it must have either a @value, an @id, or extensions Value of "true" or "false" If the element is present, it must have either a @value, an @id, or extensions A stream of bytes A stream of bytes, base64 encoded If the element is present, it must have either a @value, an @id, or extensions An integer with a value that is not negative (e.g. >= 0) If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions A string that may contain Github Flavored Markdown syntax for optional processing by a mark down presentation engine Systems are not required to have markdown support, so the text should be readable without markdown processing. The markdown syntax is GFM - see https://github.github.com/gfm/ If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions A time during the day, with no date specified If the element is present, it must have either a @value, an @id, or extensions Any combination of letters, numerals, "-" and ".", with a length limit of 64 characters. (This might be an integer, an unprefixed OID, UUID or any other identifier pattern that meets these constraints.) Ids are case-insensitive. RFC 4122 If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions An integer with a value that is positive (e.g. >0) If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions A rational number with implicit precision Do not use an IEEE type floating point type, instead use something that works like a true decimal, with inbuilt precision (e.g. Java BigInteger) If the element is present, it must have either a @value, an @id, or extensions Optional Extension Element - found in all resources. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Value of extension - must be one of a constrained set of the data types (see [Extensibility](extensibility.html) for a list). Base definition for all elements that are defined inside a resource - but not those in a data type. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself). A human-readable summary of the resource conveying the essential clinical and business information for the resource. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data. The actual narrative content, a stripped down version of XHTML. Generated Extensions Additional Empty The status of a resource narrative. If the element is present, it must have either a @value, an @id, or extensions Base definition for all elements in a resource. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted. When the resource last changed - e.g. when the version changed. A uri that identifies the source system of the resource. This provides a minimal amount of [[[Provenance]]] information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc. A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]]. Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure. Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource. An address expressed using postal conventions (as opposed to GPS or other location definition formats). This data type may be used to convey addresses for use in delivering mail as well as for visiting locations which might not be valid for mail delivery. There are a variety of postal address formats defined around the world. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The purpose of this address. Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both. Specifies the entire address as it should be displayed e.g. on a postal label. This may be provided instead of or as well as the specific parts. This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information. The name of the city, town, suburb, village or other community or delivery center. The name of the administrative area (county). Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (e.g. US 2 letter state codes). A postal code designating a region defined by the postal service. Country - a nation as commonly understood or generally accepted. Time period when address was/is in use. Home Work Temporary Old / Incorrect Billing The use of an address. If the element is present, it must have either a @value, an @id, or extensions Postal Physical Postal & Physical The type of an address (physical / postal). If the element is present, it must have either a @value, an @id, or extensions A contributor to the content of a knowledge asset, including authors, editors, reviewers, and endorsers. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The type of contributor. The name of the individual or organization responsible for the contribution. Contact details to assist a user in finding and communicating with the contributor. Author Editor Reviewer Endorser The type of contributor. If the element is present, it must have either a @value, an @id, or extensions For referring to data content defined in other formats. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. The human language of the content. The value can be any valid value according to BCP 47. The actual data of the attachment - a sequence of bytes, base64 encoded. A location where the data can be accessed. The number of bytes of data that make up this attachment (before base64 encoding, if that is done). The calculated hash of the data using SHA-1. Represented using base64. A label or set of text to display in place of the data. The date that the attachment was first created. A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile. The profile of the required data, specified as the uri of the profile definition. The intended subjects of the data requirement. If this element is not provided, a Patient subject is assumed. Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available. The value of mustSupport SHALL be a FHIRPath resolveable on the type of the DataRequirement. The path SHALL consist only of identifiers, constant indexers, and .resolve() (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details). Code filters specify additional constraints on the data, specifying the value set of interest for a particular element of the data. Each code filter defines an additional constraint on the data, i.e. code filters are AND'ed, not OR'ed. Date filters specify additional constraints on the data in terms of the applicable date range for specific elements. Each date filter specifies an additional constraint on the data, i.e. date filters are AND'ed, not OR'ed. Specifies a maximum number of results that are required (uses the _count search parameter). Specifies the order of the results to be returned. Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The code-valued attribute of the filter. The specified path SHALL be a FHIRPath resolveable on the specified type of the DataRequirement, and SHALL consist only of identifiers, constant indexers, and .resolve(). The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details). Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept. A token parameter that refers to a search parameter defined on the specified type of the DataRequirement, and which searches on elements of type code, Coding, or CodeableConcept. The valueset for the code filter. The valueSet and code elements are additive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset. The codes for the code filter. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codes. If codes are specified in addition to a value set, the filter returns items matching a code in the value set or one of the specified codes. Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The date-valued attribute of the filter. The specified path SHALL be a FHIRPath resolveable on the specified type of the DataRequirement, and SHALL consist only of identifiers, constant indexers, and .resolve(). The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details). Note that the index must be an integer constant. The path must resolve to an element of type date, dateTime, Period, Schedule, or Timing. A date parameter that refers to a search parameter defined on the specified type of the DataRequirement, and which searches on elements of type date, dateTime, Period, Schedule, or Timing. The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime. If a Duration is specified, the filter will return only those data items that fall within Duration before now. Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The attribute of the sort. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The direction of the sort, ascending or descending. Ascending Descending The possible sort directions, ascending or descending. If the element is present, it must have either a @value, an @id, or extensions Indicates how the medication is/was taken or should be taken by the patient. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Indicates the order in which the dosage instructions should be applied or interpreted. Free text dosage instructions e.g. SIG. Supplemental instructions to the patient on how to take the medication (e.g. "with meals" or"take half to one hour before food") or warnings for the patient about the medication (e.g. "may cause drowsiness" or "avoid exposure of skin to direct sunlight or sunlamps"). Instructions in terms that are understood by the patient or consumer. When medication should be administered. Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). Body site to administer to. How drug should enter body. Technique for administering medication. The amount of medication administered. Upper limit on medication per unit of time. Upper limit on medication per administration. Upper limit on medication per lifetime of the patient. Indicates how the medication is/was taken or should be taken by the patient. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The kind of dose or rate specified, for example, ordered or calculated. Amount of medication per dose. Amount of medication per unit of time. An amount of economic utility in some recognized currency. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Numerical value (with implicit precision). ISO 4217 Currency Code. A human's name with the ability to identify parts and usage. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Identifies the purpose for this name. Specifies the entire name as it should be displayed e.g. on an application UI. This may be provided instead of or as well as the specific parts. The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father. Given name. Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name. Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name. Indicates the period of time when this name was valid for the named person. Usual Official Temp Nickname Anonymous Old Name changed for Marriage The use of a human name. If the element is present, it must have either a @value, an @id, or extensions Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Telecommunications form for contact point - what communications system is required to make use of the contact. The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). Identifies the purpose for the contact point. Specifies a preferred order in which to use a set of contacts. ContactPoints with lower rank values are more preferred than those with higher rank values. Time period when the contact point was/is in use. Phone Fax Email Pager URL SMS Other Telecommunications form for contact point. If the element is present, it must have either a @value, an @id, or extensions Home Work Temp Old Mobile Use of contact point. If the element is present, it must have either a @value, an @id, or extensions The marketing status describes the date when a medicinal product is actually put on the market or the date as of which it is no longer available. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The country in which the marketing authorisation has been granted shall be specified It should be specified using the ISO 3166 ‑ 1 alpha-2 code elements. Where a Medicines Regulatory Agency has granted a marketing authorisation for which specific provisions within a jurisdiction apply, the jurisdiction can be specified using an appropriate controlled terminology The controlled term and the controlled term identifier shall be specified. This attribute provides information on the status of the marketing of the medicinal product See ISO/TS 20443 for more information and examples. The date when the Medicinal Product is placed on the market by the Marketing Authorisation Holder (or where applicable, the manufacturer/distributor) in a country and/or jurisdiction shall be provided A complete date consisting of day, month and year shall be specified using the ISO 8601 date format NOTE “Placed on the market” refers to the release of the Medicinal Product into the distribution chain. The date when the Medicinal Product is placed on the market by the Marketing Authorisation Holder (or where applicable, the manufacturer/distributor) in a country and/or jurisdiction shall be provided A complete date consisting of day, month and year shall be specified using the ISO 8601 date format NOTE “Placed on the market” refers to the release of the Medicinal Product into the distribution chain. An identifier - identifies some entity uniquely and unambiguously. Typically this is used for business identifiers. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The purpose of this identifier. A coded type for the identifier that can be used to determine which identifier to use for a specific purpose. Establishes the namespace for the value - that is, a URL that describes a set values that are unique. The portion of the identifier typically relevant to the user and which is unique within the context of the system. Time period during which identifier is/was valid for use. Organization that issued/manages the identifier. Usual Official Temp Secondary Old Identifies the purpose for this identifier, if known . If the element is present, it must have either a @value, an @id, or extensions Chemical substances are a single substance type whose primary defining element is the molecular structure. Chemical substances shall be defined on the basis of their complete covalent molecular structure; the presence of a salt (counter-ion) and/or solvates (water, alcohols) is also captured. Purity, grade, physical form or particle size are not taken into account in the definition of a chemical substance or in the assignment of a Substance ID. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Used to capture quantitative values for a variety of elements. If only limits are given, the arithmetic mean would be the average. If only a single definite value for a given element is given, it would be captured in this field. Most elements that require a quantitative value will also have a field called amount type. Amount type should always be specified because the actual value of the amount is often dependent on it. EXAMPLE: In capturing the actual relative amounts of substances or molecular fragments it is essential to indicate whether the amount refers to a mole ratio or weight ratio. For any given element an effort should be made to use same the amount type for all related definitional elements. A textual comment on a numeric value. Reference range of possible or expected values. Chemical substances are a single substance type whose primary defining element is the molecular structure. Chemical substances shall be defined on the basis of their complete covalent molecular structure; the presence of a salt (counter-ion) and/or solvates (water, alcohols) is also captured. Purity, grade, physical form or particle size are not taken into account in the definition of a chemical substance or in the assignment of a Substance ID. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Lower limit possible or expected. Upper limit possible or expected. A reference to a code defined by a terminology system. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The identification of the code system that defines the meaning of the symbol in the code. The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured, and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged. A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). A representation of the meaning of the code in the system, following the rules of the system. Indicates that this coding was chosen by a user directly - e.g. off a pick list of available items (codes or displays). A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series. The length of time between sampling times, measured in milliseconds. A correction factor that is applied to the sampled data points before they are added to the origin. The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once. A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value. A populatioof people with some set of grouping criteria. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The age of the specific population. The gender of the specific population. Race of the specific population. The existing physiological conditions of the specific population to which this applies. A relationship of two Quantity values - expressed as a numerator and a denominator. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The value of the numerator. The value of the denominator. A length - a value with a unit that is a physical distance. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions A duration of time during which an organism (or a process) has existed. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions A reference from one resource to another. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources. The expected type of the target of the reference. If both Reference.type and Reference.reference are populated and Reference.reference is a FHIR URL, both SHALL be consistent. The type is the Canonical URL of Resource Definition that is the type this reference refers to. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition/ e.g. "Patient" is a reference to http://hl7.org/fhir/StructureDefinition/Patient. Absolute URLs are only allowed for logical models (and can only be used in references in logical models, not resources). An identifier for the target resource. This is used when there is no way to reference the other resource directly, either because the entity it represents is not available through a FHIR server, or because there is no way for the author of the resource to convert a known identifier to an actual location. There is no requirement that a Reference.identifier point to something that is actually exposed as a FHIR instance, but it SHALL point to a business concept that would be expected to be exposed as a FHIR instance, and that instance would need to be of a FHIR resource type allowed by the reference. Plain text narrative that identifies the resource in addition to the resource reference. A description of a triggering event. Triggering events can be named events, data events, or periodic, as determined by the type element. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The type of triggering event. A formal name for the event. This may be an absolute URI that identifies the event formally (e.g. from a trigger registry), or a simple relative URI that identifies the event in a local context. The timing of the event (if this is a periodic trigger). The triggering data of the event (if this is a data trigger). If more than one data is requirement is specified, then all the data requirements must be true. A boolean-valued expression that is evaluated in the context of the container of the trigger definition and returns whether or not the trigger fires. Named Event Periodic Data Changed Data Added Data Updated Data Removed Data Accessed Data Access Ended The type of trigger. If the element is present, it must have either a @value, an @id, or extensions A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The value of the measured amount. The value includes an implicit precision in the presentation of the value. How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is "<" , then the real value is < stated value. A human-readable form of the unit. The identification of the system that provides the coded form of the unit. A computer processable form of the unit in some unit representation system. Less than Less or Equal to Greater or Equal to Greater than How the Quantity should be understood and represented. If the element is present, it must have either a @value, an @id, or extensions A time period defined by a start and end date and optionally time. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The start of the period. The boundary is inclusive. The end of the period. If the end of the period is missing, it means no end was known or planned at the time the instance was created. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time. A length of time. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions A set of ordered Quantities defined by a low and high limit. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The low limit. The boundary is inclusive. The high limit. The boundary is inclusive. Related artifacts such as additional documentation, justification, or bibliographic references. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The type of relationship to the related artifact. A short label that can be used to reference the citation from elsewhere in the containing artifact, such as a footnote index. A brief description of the document or knowledge resource being referenced, suitable for display to a consumer. A bibliographic citation for the related artifact. This text SHOULD be formatted according to an accepted citation format. A url for the artifact that can be followed to access the actual content. The document being referenced, represented as an attachment. This is exclusive with the resource element. The related resource, such as a library, value set, profile, or other knowledge resource. Documentation Justification Citation Predecessor Successor Derived From Depends On Composed Of The type of relationship to the related artifact. If the element is present, it must have either a @value, an @id, or extensions A text note which also contains information about who made the statement and when. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The individual responsible for making the annotation. Indicates when this particular annotation was made. The text of the annotation in markdown format. The shelf-life and storage information for a medicinal product item or container can be described using this class. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Unique identifier for the packaged Medicinal Product. This describes the shelf life, taking into account various scenarios such as shelf life of the packaged Medicinal Product itself, shelf life after transformation where necessary and shelf life after the first opening of a bottle, etc. The shelf life type shall be specified using an appropriate controlled vocabulary The controlled term and the controlled term identifier shall be specified. The shelf life time period can be specified using a numerical value for the period of time and its unit of time measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used. Special precautions for storage, if any, can be specified using an appropriate controlled vocabulary The controlled term and the controlled term identifier shall be specified. Specifies contact information for a person or organization. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The name of an individual to contact. The contact details for the individual (if a name was provided) or the organization. Specifies clinical/business/etc. metadata that can be used to retrieve, index and/or categorize an artifact. This metadata can either be specific to the applicable population (e.g., age category, DRG) or the specific context of care (e.g., venue, care setting, provider of care). If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions A code that identifies the type of context being specified by this usage context. A value that defines the context specified in this context of use. The interpretation of the value is defined by the code. A expression that is evaluated in a specified context and returns a value. The context of use of the expression must specify the context in which the expression is evaluated, and how the result of the expression is used. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions A brief, natural language description of the condition that effectively communicates the intended semantics. A short name assigned to the expression to allow for multiple reuse of the expression in the context where it is defined. The media type of the language for the expression. An expression in the specified language that returns a value. A URI that defines where the expression is found. CQL FHIRPath FHIR Query The media type of the expression language. If the element is present, it must have either a @value, an @id, or extensions A signature along with supporting context. The signature may be a digital signature that is cryptographic in nature, or some other signature acceptable to the domain. This other signature may be as simple as a graphical image representing a hand-written signature, or a signature ceremony Different signature approaches have different utilities. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document. When the digital signature was signed. A reference to an application-usable description of the identity that signed (e.g. the signature used their private key). A reference to an application-usable description of the identity that is represented by the signature. A mime type that indicates the technical format of the target resources signed by the signature. A mime type that indicates the technical format of the signature. Important mime types are application/signature+xml for X ML DigSig, application/jose for JWS, and image/* for a graphical image of a signature, etc. The base64 encoding of the Signature content. When signature is not recorded electronically this element would be empty. Specifies an event that may occur multiple times. Timing schedules are used to record when things are planned, expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds, and may be used for reporting the schedule to which past regular activities were carried out. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Identifies specific times when the event occurs. A set of rules that describe when the event is scheduled. A code for the timing schedule (or just text in code.text). Some codes such as BID are ubiquitous, but many institutions define their own additional codes. If a code is provided, the code is understood to be a complete statement of whatever is specified in the structured timing data, and either the code or the data may be used to interpret the Timing, with the exception that .repeat.bounds still applies over the code (and is not contained in the code). Specifies an event that may occur multiple times. Timing schedules are used to record when things are planned, expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds, and may be used for reporting the schedule to which past regular activities were carried out. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule. A total count of the desired number of repetitions across the duration of the entire timing specification. If countMax is present, this element indicates the lower bound of the allowed range of count values. If present, indicates that the count is a range - so to perform the action between [count] and [countMax] times. How long this thing happens for when it happens. If durationMax is present, this element indicates the lower bound of the allowed range of the duration. If present, indicates that the duration is a range - so to perform the action between [duration] and [durationMax] time length. The units of time for the duration, in UCUM units. The number of times to repeat the action within the specified period. If frequencyMax is present, this element indicates the lower bound of the allowed range of the frequency. If present, indicates that the frequency is a range - so to repeat between [frequency] and [frequencyMax] times within the period or period range. Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. If periodMax is present, this element indicates the lower bound of the allowed range of the period length. If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days. The units of time for the period in UCUM units. If one or more days of week is provided, then the action happens only on the specified day(s). Specified time of day for action to take place. An approximate time period during the day, potentially linked to an event of daily living that indicates when the action should occur. The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event. 分钟 小时 星期 A unit of time (units from UCUM). If the element is present, it must have either a @value, an @id, or extensions Morning Early Morning Late Morning Noon Afternoon Early Afternoon Late Afternoon Evening Early Evening Late Evening Night After Sleep HS WAKE C CM CD CV AC ACM ACD ACV PC PCM PCD PCV Real world event relating to the schedule. If the element is present, it must have either a @value, an @id, or extensions The marketing status describes the date when a medicinal product is actually put on the market or the date as of which it is no longer available. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Where applicable, the height can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used. Where applicable, the width can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used. Where applicable, the depth can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used. Where applicable, the weight can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used. Where applicable, the nominal volume can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used. Where applicable, the external diameter can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used. Where applicable, the shape can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used. Where applicable, the color can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used. Where applicable, the imprint can be specified as text. Where applicable, the image can be provided The format of the image attachment shall be specified by regional implementations. Where applicable, the scoring can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used. A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions A reference to a code defined by a terminology system. A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The name of the parameter used to allow access to the value of the parameter in evaluation contexts. Whether the parameter is input or output for the module. The minimum number of times this parameter SHALL appear in the request or response. The maximum number of times this element is permitted to appear in the request or response. A brief discussion of what the parameter is for and how it is used by the module. The type of the parameter. If specified, this indicates a profile that the input data must conform to, or that the output data will conform to. Captures constraints on each element within the resource, profile, or extension. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. Codes that define how this element is represented in instances, when the deviation varies from the normal case. The name of this element definition slice, when slicing is working. The name must be a token with no dots or spaces. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element. If true, indicates that this slice definition is constraining a slice definition with the same name in an inherited profile. If false, the slice is not overriding any slice in an inherited profile. If missing, the slice might or might not be overriding a slice in an inherited profile, depending on the sliceName. A single preferred label which is the text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form. A code that has the same meaning as the element in a particular terminology. Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set). A concise description of what this element means (e.g. for use in autogenerated summaries). Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource. (Note: The text you are reading is specified in ElementDefinition.definition). Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc. (Note: The text you are reading is specified in ElementDefinition.comment). This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element. Identifies additional names by which this element might also be known. The minimum number of times this element SHALL appear in the instance. The maximum number of times this element is permitted to appear in the instance. Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. When the element definition is not the original definition of an element - i.g. either in a constraint on another type, or for elements from a super type in a snap shot - then the information in provided in the element definition may be different to the base definition. On the original definition of the element, it will be same. Identifies an element defined elsewhere in the definition whose content rules should be applied to the current element. ContentReferences bring across all the rules that are in the ElementDefinition for the element, including definitions, cardinality constraints, bindings, invariants etc. The data type or resource that the value of this element is permitted to be. The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false'). The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'). If present, indicates that the order of the repeating element has meaning and describes what that meaning is. If absent, it means that the order of the element has no meaning. Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing. Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. When pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly. When pattern[x] is used to constrain an array, it means that each element provided in the pattern[x] array must (recursively) match at least one element from the instance array. When pattern[x] is used to constrain a complex object, it means that each property in the pattern must be present in the complex object, and its value must recursively match -- i.e., 1. If primitive: it must match exactly the pattern value 2. If a complex object: it must match (recursively) the pattern value 3. If an array: it must match (recursively) the pattern value. A sample value for this element demonstrating the type of information that would typically be found in the element. The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity. The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity. Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element. A reference to an invariant that may make additional statements about the cardinality or value in the instance. Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance. If true, implementations that produce or consume resources SHALL provide "support" for the element in some meaningful way. If false, the element may be ignored and not supported. If false, whether to populate or use the data element in any way is at the discretion of the implementation. If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system. Explains how that element affects the interpretation of the resource or element that contains it. Whether the element should be included if a client requests a search with the parameter _summary=true. Binds to a value set if this element is coded (code, Coding, CodeableConcept, Quantity), or the data types (string, uri). Identifies a concept from an external specification that roughly corresponds to this element. Captures constraints on each element within the resource, profile, or extension. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality. Description of why this constraint is necessary or appropriate. Identifies the impact constraint violation has on the conformance of the instance. Text that can be used to describe the constraint in messages identifying that the constraint has been violated. A [FHIRPath](fhirpath.html) expression of constraint that can be executed to see if this constraint is met. An XPath expression of constraint that can be executed to see if this constraint is met. A reference to the original source of the constraint, for traceability purposes. Captures constraints on each element within the resource, profile, or extension. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions An internal reference to the definition of a mapping. Identifies the computable language in which mapping.map is expressed. Expresses what part of the target specification corresponds to this element. Comments that provide information about the mapping or its use. Captures constraints on each element within the resource, profile, or extension. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base. Minimum cardinality of the base element identified by the path. Maximum cardinality of the base element identified by the path. Captures constraints on each element within the resource, profile, or extension. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions URL of Data type or Resource that is a(or the) type used for this element. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition e.g. "string" is a reference to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are only allowed in logical models. Identifies a profile structure or implementation Guide that applies to the datatype this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the type SHALL conform to at least one profile defined in the implementation guide. Used when the type is "Reference" or "canonical", and identifies a profile structure or implementation Guide that applies to the target of the reference this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the target resource SHALL conform to at least one profile defined in the implementation guide. If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle. Whether this reference needs to be version specific or version independent, or whether either can be used. Captures constraints on each element within the resource, profile, or extension. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Describes the purpose of this example amoung the set of examples. The actual value for the element, which must be one of the types allowed for this element. Captures constraints on each element within the resource, profile, or extension. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices. A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated. If the matching elements have to occur in the same order as defined in the profile. Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end. Captures constraints on each element within the resource, profile, or extension. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances. Describes the intended use of this particular set of codes. Refers to the value set that identifies the set of codes the binding refers to. Captures constraints on each element within the resource, profile, or extension. If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions How the element value is interpreted when discrimination is evaluated. A FHIRPath expression, using [the simple subset of FHIRPath](fhirpath.html#simple), that is used to identify the element on which discrimination is based. XML Attribute XML Text Type Attribute CDA Text Format XHTML How a property is represented when serialized. If the element is present, it must have either a @value, an @id, or extensions Error Warning SHALL applications comply with this constraint? If the element is present, it must have either a @value, an @id, or extensions Contained Referenced Bundled How resource references can be aggregated. If the element is present, it must have either a @value, an @id, or extensions Either Specific or independent Version independent Version Specific Whether a reference needs to be version specific or version independent, or whether either can be used. If the element is present, it must have either a @value, an @id, or extensions Closed Open Open at End How slices are interpreted when evaluating an instance. If the element is present, it must have either a @value, an @id, or extensions Required Extensible Preferred Example Indication of the degree of conformance expectations associated with a binding. If the element is present, it must have either a @value, an @id, or extensions Value Exists Pattern Type Profile How an element value is interpreted when discrimination is evaluated. If the element is present, it must have either a @value, an @id, or extensions A resource that includes narrative, extensions, and contained resources. A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety. These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope. May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself). This is the base resource type for everything. The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource. A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc. The base language in which the resource is written. Draft черновик ontwerp Active активный actief Retired удалён verouderd Unknown If the element is present, it must have either a @value, an @id, or extensions Number Date/DateTime String Token Reference Composite Quantity URI Special If the element is present, it must have either a @value, an @id, or extensions Male Female Other Unknown If the element is present, it must have either a @value, an @id, or extensions 0.01 0.05 0.06 0.11 0.0.80 0.0.81 0.0.82 0.4.0 0.5.0 1.0.0 1.0.1 1.0.2 1.1.0 1.4.0 1.6.0 1.8.0 3.0.0 3.0.1 3.3.0 3.5.0 4.0.0 4.0.1 If the element is present, it must have either a @value, an @id, or extensions Display Print (Form) Print (Operator) If the element is present, it must have either a @value, an @id, or extensions Queued Processing Complete Error Partial Processing If the element is present, it must have either a @value, an @id, or extensions Related To Equivalent Equal Wider Subsumes Narrower Specializes Inexact Unmatched Disjoint If the element is present, it must have either a @value, an @id, or extensions Current Superseded Entered in Error If the element is present, it must have either a @value, an @id, or extensions A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centers, etc. A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centers, etc. If the element is present, it must have either a @value, an @id, or extensions Unique identifier used to reference the account. Might or might not be intended for human use (e.g. credit card number). Indicates whether the account is presently used/usable or not. Categorizes the account for reporting and searching purposes. Name used for the account when displaying it to humans in reports, etc. Identifies the entity which incurs the expenses. While the immediate recipients of services or goods might be entities related to the subject, the expenses were ultimately incurred by the subject of the Account. The date range of services associated with this account. The party(s) that are responsible for covering the payment of this account, and what order should they be applied to the account. Indicates the service area, hospital, department, etc. with responsibility for managing the Account. Provides additional information about what the account tracks and how it is used. The parties responsible for balancing the account if other payment options fall short. Reference to a parent Account. A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centers, etc. The party(s) that contribute to payment (or part of) of the charges applied to this account (including self-pay). A coverage may only be responsible for specific types of charges, and the sequence of the coverages in the account could be important when processing billing. The priority of the coverage in the context of this account. A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centers, etc. The entity who is responsible. A guarantor may be placed on credit hold or otherwise have their role temporarily suspended. The timeframe during which the guarantor accepts responsibility for the account. Active Inactive Entered in error On Hold Unknown Indicates whether the account is available to be used. If the element is present, it must have either a @value, an @id, or extensions This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context. This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this activity definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this activity definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the activity definition is stored on different servers. A formal identifier that is used to identify this activity definition when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the activity definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the activity definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active assets. A natural language name identifying the activity definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the activity definition. An explanatory or alternate title for the activity definition giving additional information about its content. The status of this activity definition. Enables tracking the life-cycle of the content. A Boolean value to indicate that this activity definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. A code or group definition that describes the intended subject of the activity being defined. The date (and optionally time) when the activity definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the activity definition changes. The name of the organization or individual that published the activity definition. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the activity definition from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate activity definition instances. A legal or geographic region in which the activity definition is intended to be used. Explanation of why this activity definition is needed and why it has been designed as it has. A detailed description of how the activity definition is used from a clinical perspective. A copyright statement relating to the activity definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the activity definition. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the activity definition content was or is planned to be in active use. Descriptive topics related to the content of the activity. Topics provide a high-level categorization of the activity that can be useful for filtering and searching. An individiual or organization primarily involved in the creation and maintenance of the content. An individual or organization primarily responsible for internal coherence of the content. An individual or organization primarily responsible for review of some aspect of the content. An individual or organization responsible for officially endorsing the content for use in some setting. Related artifacts such as additional documentation, justification, or bibliographic references. A reference to a Library resource containing any formal logic used by the activity definition. A description of the kind of resource the activity definition is representing. For example, a MedicationRequest, a ServiceRequest, or a CommunicationRequest. Typically, but not always, this is a Request resource. A profile to which the target of the activity definition is expected to conform. Detailed description of the type of activity; e.g. What lab test, what procedure, what kind of encounter. Indicates the level of authority/intentionality associated with the activity and where the request should fit into the workflow chain. Indicates how quickly the activity should be addressed with respect to other requests. Set this to true if the definition is to indicate that a particular activity should NOT be performed. If true, this element should be interpreted to reinforce a negative coding. For example NPO as a code with a doNotPerform of true would still indicate to NOT perform the action. The period, timing or frequency upon which the described activity is to occur. Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc. Indicates who should participate in performing the action described. Identifies the food, drug or other product being consumed or supplied in the activity. Identifies the quantity expected to be consumed at once (per dose, per meal, etc.). Provides detailed dosage instructions in the same way that they are described for MedicationRequest resources. Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites). Defines specimen requirements for the action to be performed, such as required specimens for a lab test. Defines observation requirements for the action to be performed, such as body weight or surface area. Defines the observations that are expected to be produced by the action. A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input. Dynamic values that will be evaluated to produce values for elements of the resulting resource. For example, if the dosage of a medication must be computed based on the patient's weight, a dynamic value would be used to specify an expression that calculated the weight, and the path on the request resource that would contain the result. This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context. The type of participant in the action. The role the participant should play in performing the described action. This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context. The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolveable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details). An expression specifying the value of the customized element. Patient Practitioner Related Person Device The type of participant in the activity. If the element is present, it must have either a @value, an @id, or extensions Proposal Plan Directive Order Original Order Reflex Order Filler Order Instance Order Option Codes indicating the degree of authority/intentionality associated with a request. If the element is present, it must have either a @value, an @id, or extensions Appointment AppointmentResponse CarePlan Claim CommunicationRequest Contract DeviceRequest EnrollmentRequest ImmunizationRecommendation MedicationRequest NutritionOrder ServiceRequest SupplyRequest Task VisionPrescription The kind of activity the definition is describing. If the element is present, it must have either a @value, an @id, or extensions Routine Urgent ASAP STAT Identifies the level of importance to be assigned to actioning the request. If the element is present, it must have either a @value, an @id, or extensions Actual or potential/avoided event causing unintended physical injury resulting from or contributed to by medical care, a research study or other healthcare setting factors that requires additional monitoring, treatment, or hospitalization, or that results in death. Actual or potential/avoided event causing unintended physical injury resulting from or contributed to by medical care, a research study or other healthcare setting factors that requires additional monitoring, treatment, or hospitalization, or that results in death. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this adverse event by the performer or other systems which remain constant as the resource is updated and propagates from server to server. Whether the event actually happened, or just had the potential to. Note that this is independent of whether anyone was affected or harmed or how severely. The overall type of event, intended for search and filtering purposes. This element defines the specific type of event that occurred or that was prevented from occurring. This subject or group impacted by the event. The Encounter during which AdverseEvent was created or to which the creation of this record is tightly associated. The date (and perhaps time) when the adverse event occurred. Estimated or actual date the AdverseEvent began, in the opinion of the reporter. The date on which the existence of the AdverseEvent was first recorded. Includes information about the reaction that occurred as a result of exposure to a substance (for example, a drug or a chemical). The information about where the adverse event occurred. Assessment whether this event was of real importance. Describes the severity of the adverse event, in relation to the subject. Contrast to AdverseEvent.seriousness - a severe rash might not be serious, but a mild heart problem is. Describes the type of outcome from the adverse event. Information on who recorded the adverse event. May be the patient or a practitioner. Parties that may or should contribute or have contributed information to the adverse event, which can consist of one or more activities. Such information includes information leading to the decision to perform the activity and how to perform the activity (e.g. consultant), information that the activity itself seeks to reveal (e.g. informant of clinical history), or information about what activity was performed (e.g. informant witness). Describes the entity that is suspected to have caused the adverse event. AdverseEvent.subjectMedicalHistory. AdverseEvent.referenceDocument. AdverseEvent.study. Actual or potential/avoided event causing unintended physical injury resulting from or contributed to by medical care, a research study or other healthcare setting factors that requires additional monitoring, treatment, or hospitalization, or that results in death. Identifies the actual instance of what caused the adverse event. May be a substance, medication, medication administration, medication statement or a device. Information on the possible cause of the event. Actual or potential/avoided event causing unintended physical injury resulting from or contributed to by medical care, a research study or other healthcare setting factors that requires additional monitoring, treatment, or hospitalization, or that results in death. Assessment of if the entity caused the event. AdverseEvent.suspectEntity.causalityProductRelatedness. AdverseEvent.suspectEntity.causalityAuthor. ProbabilityScale | Bayesian | Checklist. Adverse Event Potential Adverse Event Overall nature of the adverse event, e.g. real or potential. If the element is present, it must have either a @value, an @id, or extensions Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance. Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this AllergyIntolerance by the performer or other systems which remain constant as the resource is updated and propagates from server to server. The clinical status of the allergy or intolerance. Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product). Identification of the underlying physiological mechanism for the reaction risk. Category of the identified substance. Estimate of the potential clinical harm, or seriousness, of the reaction to the identified substance. Code for an allergy or intolerance statement (either a positive or a negated/excluded statement). This may be a code for a substance or pharmaceutical product that is considered to be responsible for the adverse reaction risk (e.g., "Latex"), an allergy or intolerance condition (e.g., "Latex allergy"), or a negated/excluded code for a specific substance or class (e.g., "No latex allergy") or a general or categorical negated statement (e.g., "No known allergy", "No known drug allergies"). Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'. If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance. The patient who has the allergy or intolerance. The encounter when the allergy or intolerance was asserted. Estimated or actual date, date-time, or age when allergy or intolerance was identified. The recordedDate represents when this particular AllergyIntolerance record was created in the system, which is often a system-generated date. Individual who recorded the record and takes responsibility for its content. The source of the information about the allergy that is recorded. Represents the date and/or time of the last known occurrence of a reaction event. Additional narrative about the propensity for the Adverse Reaction, not captured in other fields. Details about each adverse reaction event linked to exposure to the identified substance. Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance. Identification of the specific substance (or pharmaceutical product) considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'. If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance. Clinical symptoms and/or signs that are observed or associated with the adverse reaction event. Text description about the reaction as a whole, including details of the manifestation if required. Record of the date and/or time of the onset of the Reaction. Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations. Identification of the route by which the subject was exposed to the substance. Additional text about the adverse reaction event not captured in other fields. Low Risk High Risk Unable to Assess Risk Estimate of the potential clinical harm, or seriousness, of a reaction to an identified substance. If the element is present, it must have either a @value, an @id, or extensions Allergy Intolerance Identification of the underlying physiological mechanism for a Reaction Risk. If the element is present, it must have either a @value, an @id, or extensions Food Medication Environment Biologic Category of an identified substance associated with allergies or intolerances. If the element is present, it must have either a @value, an @id, or extensions Mild Moderate Severe Clinical assessment of the severity of a reaction event as a whole, potentially considering multiple different manifestations. If the element is present, it must have either a @value, an @id, or extensions A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s). A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s). If the element is present, it must have either a @value, an @id, or extensions This records identifiers associated with this appointment concern that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status. The coded reason for the appointment being cancelled. This is often used in reporting/billing/futher processing to determine if further actions are required, or specific fees apply. A broad categorization of the service that is to be performed during this appointment. The specific service that is to be performed during this appointment. The specialty of a practitioner that would be required to perform the service requested in this appointment. The style of appointment or patient that has been booked in the slot (not service type). The coded reason that this appointment is being scheduled. This is more clinical than administrative. Reason the appointment has been scheduled to take place, as specified using information from another resource. When the patient arrives and the encounter begins it may be used as the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure. The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority). The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field. Additional information to support the appointment provided when making the appointment. Date/Time that the appointment is to take place. Date/Time that the appointment is to conclude. Number of minutes that the appointment is to take. This can be less than the duration between the start and end times. For example, where the actual time of appointment is only an estimate or if a 30 minute appointment is being requested, but any time would work. Also, if there is, for example, a planned 15 minute break in the middle of a long appointment, the duration may be 15 minutes less than the difference between the start and end. The slots from the participants' schedules that will be filled by the appointment. The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment. Additional comments about the appointment. While Appointment.comment contains information for internal use, Appointment.patientInstructions is used to capture patient facing information about the Appointment (e.g. please bring your referral or fast from 8pm night before). The service request this appointment is allocated to assess (e.g. incoming referral or procedure request). List of participants involved in the appointment. A set of date ranges (potentially including times) that the appointment is preferred to be scheduled within. The duration (usually in minutes) could also be provided to indicate the length of the appointment to fill and populate the start/end times for the actual allocated time. However, in other situations the duration may be calculated by the scheduling system. A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s). Role of participant in the appointment. A Person, Location/HealthcareService or Device that is participating in the appointment. Whether this participant is required to be present at the meeting. This covers a use-case where two doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present. Participation status of the actor. Participation period of the actor. Required Optional Information Only Is the Participant required to attend the appointment. If the element is present, it must have either a @value, an @id, or extensions Proposed Pending Booked Arrived Fulfilled Cancelled No Show Entered in error Checked In Waitlisted The free/busy status of an appointment. If the element is present, it must have either a @value, an @id, or extensions Accepted Declined Tentative Needs Action The Participation status of an appointment. If the element is present, it must have either a @value, an @id, or extensions A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection. A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection. If the element is present, it must have either a @value, an @id, or extensions This records identifiers associated with this appointment response concern that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate. Appointment that this response is replying to. Date/Time that the appointment is to take place, or requested new start time. This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time. Role of participant in the appointment. A Person, Location, HealthcareService, or Device that is participating in the appointment. Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty. Additional comments about the appointment. A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. If the element is present, it must have either a @value, an @id, or extensions Identifier for a family of the event. For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function. Identifier for the category of event. Indicator for type of action performed during the event that generated the audit. The period during which the activity occurred. The time when the event was recorded. Indicates whether the event succeeded or failed. A free text description of the outcome of the event. The purposeOfUse (reason) that was used during the event being recorded. An actor taking an active role in the event or activity that is logged. The system that is reporting the event. Specific instances of data or objects that have been accessed. A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. Specification of the participation type the user plays when performing the event. The security role that the user was acting under, that come from local codes defined by the access control security system (e.g. RBAC, ABAC) used in the local context. Reference to who this agent is that was involved in the event. Alternative agent Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available. Human-meaningful name for the agent. Indicator that the user is or is not the requestor, or initiator, for the event being audited. Where the event occurred. The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used. Type of media involved. Used when the event is about exporting/importing onto media. Logical network location for application activity, if the activity has a network location. The reason (purpose of use), specific to this agent, that was used during the event being recorded. A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. An identifier for the network access point of the user device for the audit event. An identifier for the type of network access point that originated the audit event. A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. Logical source location within the healthcare enterprise network. For example, a hospital or other provider location within a multi-entity provider group. Identifier of the source where the event was detected. Code specifying the type of source where event originated. A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. Identifies a specific instance of the entity. The reference should be version specific. The type of the object that was involved in this audit event. Code representing the role the entity played in the event being audited. Identifier for the data life-cycle stage for the entity. Security labels for the identified entity. A name of the entity in the audit event. Text that describes the entity in more detail. The query parameters for a query-type entities. Tagged value pairs for conveying additional information about the entity. A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. The type of extra detail provided in the value. The value of the extra detail. Success Minor failure Serious failure Major failure Indicates whether the event succeeded or failed. If the element is present, it must have either a @value, an @id, or extensions Create Read/View/Print Update Delete Execute Indicator for type of action performed during the event that generated the event. If the element is present, it must have either a @value, an @id, or extensions Machine Name IP Address Telephone Number Email address URI The type of network access point of this agent in the audit event. If the element is present, it must have either a @value, an @id, or extensions Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification. Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification. If the element is present, it must have either a @value, an @id, or extensions Identifier assigned to the resource for business purposes, outside the context of FHIR. Identifies the 'type' of resource - equivalent to the resource name for other resources. Identifies the patient, practitioner, device or any other resource that is the "focus" of this resource. Identifies when the resource was first created. Indicates who was responsible for creating the resource instance. A resource that represents the data of a single raw artifact as digital content accessible in its native format. A Binary resource can contain any content, whether text, image, pdf, zip archive, etc. A resource that represents the data of a single raw artifact as digital content accessible in its native format. A Binary resource can contain any content, whether text, image, pdf, zip archive, etc. If the element is present, it must have either a @value, an @id, or extensions MimeType of the binary content represented as a standard MimeType (BCP 13). This element identifies another resource that can be used as a proxy of the security sensitivity to use when deciding and enforcing access control rules for the Binary resource. Given that the Binary resource contains very few elements that can be used to determine the sensitivity of the data and relationships to individuals, the referenced resource stands in as a proxy equivalent for this purpose. This referenced resource may be related to the Binary (e.g. Media, DocumentReference), or may be some non-related Resource purely as a security proxy. E.g. to identify that the binary resource relates to a patient, and access should only be granted to applications that have access to the patient. The actual content, base64 encoded. A material substance originating from a biological entity intended to be transplanted or infused into another (possibly the same) biological entity. A material substance originating from a biological entity intended to be transplanted or infused into another (possibly the same) biological entity. If the element is present, it must have either a @value, an @id, or extensions This records identifiers associated with this biologically derived product instance that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). Broad category of this product. A code that identifies the kind of this biologically derived product (SNOMED Ctcode). Whether the product is currently available. Procedure request to obtain this biologically derived product. Number of discrete units within this product. Parent product (if any). How this product was collected. Any processing of the product during collection that does not change the fundamental nature of the product. For example adding anti-coagulants during the collection of Peripheral Blood Stem Cells. Any manipulation of product post-collection that is intended to alter the product. For example a buffy-coat enrichment or CD8 reduction of Peripheral Blood Stem Cells to make it more suitable for infusion. Product storage. A material substance originating from a biological entity intended to be transplanted or infused into another (possibly the same) biological entity. Healthcare professional who is performing the collection. The patient or entity, such as a hospital or vendor in the case of a processed/manipulated/manufactured product, providing the product. Time of product collection. A material substance originating from a biological entity intended to be transplanted or infused into another (possibly the same) biological entity. Description of of processing. Procesing code. Substance added during processing. Time of processing. A material substance originating from a biological entity intended to be transplanted or infused into another (possibly the same) biological entity. Description of manipulation. Time of manipulation. A material substance originating from a biological entity intended to be transplanted or infused into another (possibly the same) biological entity. Description of storage. Storage temperature. Temperature scale used. Storage timeperiod. Organ Tissue Fluid Cells BiologicalAgent Biologically Derived Product Category. If the element is present, it must have either a @value, an @id, or extensions Available Unavailable Biologically Derived Product Status. If the element is present, it must have either a @value, an @id, or extensions Fahrenheit Celsius Kelvin BiologicallyDerived Product Storage Scale. If the element is present, it must have either a @value, an @id, or extensions Record details about an anatomical structure. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. Record details about an anatomical structure. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. If the element is present, it must have either a @value, an @id, or extensions Identifier for this instance of the anatomical structure. Whether this body site is in active use. The kind of structure being represented by the body structure at `BodyStructure.location`. This can define both normal and abnormal morphologies. The anatomical location or region of the specimen, lesion, or body structure. Qualifier to refine the anatomical location. These include qualifiers for laterality, relative location, directionality, number, and plane. A summary, characterization or explanation of the body structure. Image or images used to identify a location. The person to which the body site belongs. A container for a collection of resources. A container for a collection of resources. If the element is present, it must have either a @value, an @id, or extensions A persistent identifier for the bundle that won't change as a bundle is copied from server to server. Indicates the purpose of this bundle - how it is intended to be used. The date/time that the bundle was assembled - i.e. when the resources were placed in the bundle. If a set of search matches, this is the total number of entries of type 'match' across all pages in the search. It does not include search.mode = 'include' or 'outcome' entries and it does not provide a count of the number of entries in the Bundle. A series of links that provide context to this bundle. An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only). Digital Signature - base64 encoded. XML-DSig or a JWT. A container for a collection of resources. A name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1). The reference details for the link. A container for a collection of resources. A series of links that provide context to this entry. The Absolute URL for the resource. The fullUrl SHALL NOT disagree with the id in the resource - i.e. if the fullUrl is not a urn:uuid, the URL shall be version-independent URL consistent with the Resource.id. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: * fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle) * Results from operations might involve resources that are not identified. The Resource for the entry. The purpose/meaning of the resource is determined by the Bundle.type. Information about the search process that lead to the creation of this entry. Additional information about how this entry should be processed as part of a transaction or batch. For history, it shows how the entry was processed to create the version contained in the entry. Indicates the results of processing the corresponding 'request' entry in the batch or transaction being responded to or what the results of an operation where when returning history. A container for a collection of resources. Why this entry is in the result set - whether it's included as a match or because of an _include requirement, or to convey information or warning information about the search process. When searching, the server's search ranking score for the entry. A container for a collection of resources. In a transaction or batch, this is the HTTP action to be executed for this entry. In a history bundle, this indicates the HTTP action that occurred. The URL for this entry, relative to the root (the address to which the request is posted). If the ETag values match, return a 304 Not Modified status. See the API documentation for ["Conditional Read"](http.html#cread). Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread). Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency). Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL - what follows the "?" (not including the "?"). A container for a collection of resources. The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code. The location header created by processing this operation, populated if the operation returns a location. The Etag for the resource, if the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency)). The date/time that the resource was modified on the server. An OperationOutcome containing hints and warnings produced as part of processing this entry in a batch or transaction. GET HEAD POST PUT DELETE PATCH HTTP verbs (in the HTTP command line). See [HTTP rfc](https://tools.ietf.org/html/rfc7231) for details. If the element is present, it must have either a @value, an @id, or extensions Document Message Transaction Transaction Response Batch Batch Response History List Search Results Collection Indicates the purpose of a bundle - how it is intended to be used. If the element is present, it must have either a @value, an @id, or extensions Match Include Outcome Why an entry is in the result set - whether it's included as a match or because of an _include requirement, or to convey information or warning information about the search process. If the element is present, it must have either a @value, an @id, or extensions A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this capability statement when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this capability statement is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the capability statement is stored on different servers. The identifier that is used to identify this version of the capability statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the capability statement author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the capability statement. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the capability statement. The status of this capability statement. Enables tracking the life-cycle of the content. A Boolean value to indicate that this capability statement is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the capability statement was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the capability statement changes. The name of the organization or individual that published the capability statement. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the capability statement from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate capability statement instances. A legal or geographic region in which the capability statement is intended to be used. Explanation of why this capability statement is needed and why it has been designed as it has. A copyright statement relating to the capability statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the capability statement. The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind, not instance of software) or a class of implementation (e.g. a desired purchase). Reference to a canonical URL of another CapabilityStatement that this software implements. This capability statement is a published API description that corresponds to a business service. The server may actually implement a subset of the capability statement it claims to implement, so the capability statement must specify the full capability details. Reference to a canonical URL of another CapabilityStatement that this software adds to. The capability statement automatically includes everything in the other statement, and it is not duplicated, though the server may repeat the same resources, interactions and operations to add additional details to them. Software that is covered by this capability statement. It is used when the capability statement describes the capabilities of a particular software version, independent of an installation. Identifies a specific implementation instance that is described by the capability statement - i.e. a particular installation, rather than the capabilities of a software program. The version of the FHIR specification that this CapabilityStatement describes (which SHALL be the same as the FHIR version of the CapabilityStatement itself). There is no default value. A list of the formats supported by this implementation using their content types. A list of the patch formats supported by this implementation using their content types. A list of implementation guides that the server does (or should) support in their entirety. A definition of the restful capabilities of the solution, if any. A description of the messaging capabilities of the solution. A document definition. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Name the software is known by. The version identifier for the software covered by this statement. Date this version of the software was released. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Information about the specific installation that this capability statement relates to. An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. The organization responsible for the management of the instance and oversight of the data on the server at the specified URL. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations. Information about the system's restful capabilities that apply across all applications, such as security. Information about security implementation from an interface perspective - what a client needs to know. A specification of the restful capabilities of the solution for a specific resource type. A specification of restful operations supported by the system. Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation. Definition of an operation or a named query together with its parameters and their meaning and type. An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by its canonical URL . A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Server adds CORS headers when responding to requests - this enables Javascript applications to use the server. Types of security services that are supported/required by the system. General description of how security works. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. A type of resource exposed via the restful interface. A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles](profiling.html#profile-uses). A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles](profiling.html#profile-uses). Additional information about the resource type used by the system. Identifies a restful operation supported by the solution. This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API. A flag for whether the server is able to return past versions as part of the vRead operation. A flag to indicate that the server allows or needs to allow the client to create new identities on the server (that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server. A flag that indicates that the server supports conditional create. A code that indicates how the server supports conditional read. A flag that indicates that the server supports conditional update. A code that indicates how the server supports conditional delete. A set of flags that defines how references are supported. A list of _include values supported by the server. A list of _revinclude (reverse include) values supported by the server. Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation. Definition of an operation or a named query together with its parameters and their meaning and type. Consult the definition of the operation for details about how to invoke the operation, and the parameters. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Coded identifier of the operation, supported by the system resource. Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. The name of the search parameter used in the interface. An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]). This element SHALL be populated if the search parameter refers to a SearchParameter defined by the FHIR core specification or externally defined IGs. The type of value a search parameter refers to, and how the content is interpreted. This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. The name of the operation or query. For an operation, this is the name prefixed with $ and used in the URL. For a query, this is the name used in the _query parameter when the query is called. Where the formal definition can be found. If a server references the base definition of an Operation (i.e. from the specification itself such as ```http://hl7.org/fhir/OperationDefinition/ValueSet-expand```), that means it supports the full capabilities of the operation - e.g. both GET and POST invocation. If it only supports a subset, it must define its own custom [[[OperationDefinition]]] with a 'base' of the original OperationDefinition. The custom definition would describe the specific subset of functionality supported. Documentation that describes anything special about the operation behavior, possibly detailing different behavior for system, type and instance-level invocation of the operation. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. A coded identifier of the operation, supported by the system. Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. An endpoint (network accessible address) to which messages and/or replies are to be sent. Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender). Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the capability statement. For example, the process for becoming an authorized messaging exchange partner. References to message definitions for messages this system can send or receive. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. A list of the messaging transport protocol(s) identifiers, supported by this endpoint. The network address of the endpoint. For solutions that do not use network addresses for routing, it can be just an identifier. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. The mode of this event declaration - whether application is sender or receiver. Points to a message definition that identifies the messaging event, message structure, allowed responses, etc. A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Mode of this document declaration - whether an application is a producer or consumer. A description of how the application supports or uses the specified document profile. For example, when documents are created, what action is taken with consumed documents, etc. A profile on the document Bundle that constrains which resources are present, and their contents. Instance Capability Requirements How a capability statement is intended to be used. If the element is present, it must have either a @value, an @id, or extensions Sender Receiver The mode of a message capability statement. If the element is present, it must have either a @value, an @id, or extensions No VersionId Support Versioned VersionId tracked fully How the system supports versioning for a resource. If the element is present, it must have either a @value, an @id, or extensions Producer Consumer Whether the application produces or consumes documents. If the element is present, it must have either a @value, an @id, or extensions Client Server The mode of a RESTful capability statement. If the element is present, it must have either a @value, an @id, or extensions read vread update patch delete history-instance history-type create search-type Operations supported by REST at the type or instance level. If the element is present, it must have either a @value, an @id, or extensions transaction batch search-system history-system Operations supported by REST at the system level. If the element is present, it must have either a @value, an @id, or extensions Not Supported If-Modified-Since If-None-Match Full Support A code that indicates how the server supports conditional read. If the element is present, it must have either a @value, an @id, or extensions Literal References Logical References Resolves References Reference Integrity Enforced Local References Only A set of flags that defines how references are supported. If the element is present, it must have either a @value, an @id, or extensions Not Supported Single Deletes Supported Multiple Deletes Supported A code that indicates how the server supports conditional delete. If the element is present, it must have either a @value, an @id, or extensions Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions. Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this care plan by the performer or other systems which remain constant as the resource is updated and propagates from server to server. The URL pointing to a FHIR-defined protocol, guideline, questionnaire or other definition that is adhered to in whole or in part by this CarePlan. The URL pointing to an externally maintained protocol, guideline, questionnaire or other definition that is adhered to in whole or in part by this CarePlan. A care plan that is fulfilled in whole or in part by this care plan. Completed or terminated care plan whose function is taken by this new care plan. A larger care plan of which this particular care plan is a component or step. Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record. Indicates the level of authority/intentionality associated with the care plan and where the care plan fits into the workflow chain. Identifies what "kind" of plan this is to support differentiation between multiple co-existing plans; e.g. "Home health", "psychiatric", "asthma", "disease management", "wellness plan", etc. Human-friendly name for the care plan. A description of the scope and nature of the plan. Identifies the patient or group whose intended care is described by the plan. The Encounter during which this CarePlan was created or to which the creation of this record is tightly associated. Indicates when the plan did (or is intended to) come into effect and end. Represents when this particular CarePlan record was created in the system, which is often a system-generated date. When populated, the author is responsible for the care plan. The care plan is attributed to the author. Identifies the individual(s) or organization who provided the contents of the care plan. Identifies all people and organizations who are expected to be involved in the care envisioned by this plan. Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan. Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include comorbidities, recent procedures, limitations, recent assessments, etc. Describes the intended objective(s) of carrying out the care plan. Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc. General notes about the care plan not covered elsewhere. Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions. Identifies the outcome at the point when the status of the activity is assessed. For example, the outcome of an education activity could be patient understands (or not). Details of the outcome or action resulting from the activity. The reference to an "event" resource, such as Procedure or Encounter or Observation, is the result/outcome of the activity itself. The activity can be conveyed using CarePlan.activity.detail OR using the CarePlan.activity.reference (a reference to a “request” resource). Notes about the adherence/status/progress of the activity. The details of the proposed activity represented in a specific resource. A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc. Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions. A description of the kind of resource the in-line definition of a care plan activity is representing. The CarePlan.activity.detail is an in-line definition when a resource is not referenced using CarePlan.activity.reference. For example, a MedicationRequest, a ServiceRequest, or a CommunicationRequest. The URL pointing to a FHIR-defined protocol, guideline, questionnaire or other definition that is adhered to in whole or in part by this CarePlan activity. The URL pointing to an externally maintained protocol, guideline, questionnaire or other definition that is adhered to in whole or in part by this CarePlan activity. Detailed description of the type of planned activity; e.g. what lab test, what procedure, what kind of encounter. Provides the rationale that drove the inclusion of this particular activity as part of the plan or the reason why the activity was prohibited. Indicates another resource, such as the health condition(s), whose existence justifies this request and drove the inclusion of this particular activity as part of the plan. Internal reference that identifies the goals that this activity is intended to contribute towards meeting. Identifies what progress is being made for the specific activity. Provides reason why the activity isn't yet started, is on hold, was cancelled, etc. If true, indicates that the described activity is one that must NOT be engaged in when following the plan. If false, or missing, indicates that the described activity is one that should be engaged in when following the plan. The period, timing or frequency upon which the described activity is to occur. Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc. Identifies who's expected to be involved in the activity. Identifies the food, drug or other product to be consumed or supplied in the activity. Identifies the quantity expected to be consumed in a given day. Identifies the quantity expected to be supplied, administered or consumed by the subject. This provides a textual description of constraints on the intended activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. Appointment Appointment Appuntamento RendezVous Cita 预约 CommunicationRequest CommunicationRequest RichiestaDiComunicazione DemandeDeCommunication ComunicaciónRequerimiento 通讯请求 DeviceRequest DeviceRequest RichiestaDispositivo DemandeUtilisationDispositif SolicitudDeDispositivo 装置请求 MedicationRequest MedicationRequest PrescriptionMédicamenteuseTODO 药物请求 PrescripciónMedicaciónTODO /PrescripcionMedicamento NutritionOrder NutritionOrder OrdreNutrition OrdenNutrición 营养医嘱 Task Task Tarea 任务 ServiceRequest ServiceRequest RichiestaDiServizio DemandeService PeticiónServicio 服务项目请求 VisionPrescription VisionPrescription PrescriptionVision PrescripcionDeVision 视力处方 Resource types defined as part of FHIR that can be represented as in-line definitions of a care plan activity. If the element is present, it must have either a @value, an @id, or extensions Not Started Scheduled In Progress On Hold Completed Cancelled Stopped Unknown Entered in Error Codes that reflect the current state of a care plan activity within its overall life cycle. If the element is present, it must have either a @value, an @id, or extensions Proposal Plan Order Option Codes indicating the degree of authority/intentionality associated with a care plan. If the element is present, it must have either a @value, an @id, or extensions Draft Active On Hold Revoked Completed Entered in Error Unknown Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record. If the element is present, it must have either a @value, an @id, or extensions The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient. The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this care team by the performer or other systems which remain constant as the resource is updated and propagates from server to server. Indicates the current state of the care team. Identifies what kind of team. This is to support differentiation between multiple co-existing teams, such as care plan team, episode of care team, longitudinal care team. A label for human use intended to distinguish like teams. E.g. the "red" vs. "green" trauma teams. Identifies the patient or group whose intended care is handled by the team. The Encounter during which this CareTeam was created or to which the creation of this record is tightly associated. Indicates when the team did (or is intended to) come into effect and end. Identifies all people and organizations who are expected to be involved in the care team. Describes why the care team exists. Condition(s) that this care team addresses. The organization responsible for the care team. A central contact detail for the care team (that applies to all members). Comments made about the CareTeam. The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient. Indicates specific responsibility of an individual within the care team, such as "Primary care physician", "Trained social worker counselor", "Caregiver", etc. The specific person or organization who is participating/expected to participate in the care team. The organization of the practitioner. Indicates when the specific member or organization did (or is intended to) come into effect and end. Proposed Active Suspended Inactive Entered in Error Indicates the status of the care team. If the element is present, it must have either a @value, an @id, or extensions Catalog entries are wrappers that contextualize items included in a catalog. Catalog entries are wrappers that contextualize items included in a catalog. If the element is present, it must have either a @value, an @id, or extensions Used in supporting different identifiers for the same product, e.g. manufacturer code and retailer code. The type of item - medication, device, service, protocol or other. Whether the entry represents an orderable item. The item in a catalog or definition. Used in supporting related concepts, e.g. NDC to RxNorm. Classes of devices, or ATC for medication. Used to support catalog exchange even for unsupported products, e.g. getting list of medications even if not prescribable. The time period in which this catalog entry is expected to be active. The date until which this catalog entry is expected to be active. Typically date of issue is different from the beginning of the validity. This can be used to see when an item was last updated. Used for examplefor Out of Formulary, or any specifics. User for example for ATC classification, or. Used for example, to point to a substance, or to a device used to administer a medication. Catalog entries are wrappers that contextualize items included in a catalog. The type of relation to the related item: child, parent, packageContent, containerPackage, usedIn, uses, requires, etc. The reference to the related item. Triggers Replaced By The type of relations between entries. If the element is present, it must have either a @value, an @id, or extensions The resource ChargeItem describes the provision of healthcare provider products for a certain patient, therefore referring not only to the product, but containing in addition details of the provision, like date, time, amounts and participating organizations and persons. Main Usage of the ChargeItem is to enable the billing process and internal cost allocation. The resource ChargeItem describes the provision of healthcare provider products for a certain patient, therefore referring not only to the product, but containing in addition details of the provision, like date, time, amounts and participating organizations and persons. Main Usage of the ChargeItem is to enable the billing process and internal cost allocation. If the element is present, it must have either a @value, an @id, or extensions Identifiers assigned to this event performer or other systems. References the (external) source of pricing information, rules of application for the code this ChargeItem uses. References the source of pricing information, rules of application for the code this ChargeItem uses. The current state of the ChargeItem. ChargeItems can be grouped to larger ChargeItems covering the whole set. A code that identifies the charge, like a billing code. The individual or set of individuals the action is being or was performed on. The encounter or episode of care that establishes the context for this event. Date/time(s) or duration when the charged service was applied. Indicates who or what performed or participated in the charged service. The organization requesting the service. The organization performing the service. The financial cost center permits the tracking of charge attribution. Quantity of which the charge item has been serviced. The anatomical location where the related service has been applied. Factor overriding the factor determined by the rules associated with the code. Total price of the charge overriding the list price associated with the code. If the list price or the rule-based factor associated with the code is overridden, this attribute can capture a text to indicate the reason for this action. The device, practitioner, etc. who entered the charge item. Date the charge item was entered. Describes why the event occurred in coded or textual form. Indicated the rendered service that caused this charge. Identifies the device, food, drug or other product being charged either by type code or reference to an instance. Account into which this ChargeItems belongs. Comments made about the event by the performer, subject or other participants. Further information supporting this charge. The resource ChargeItem describes the provision of healthcare provider products for a certain patient, therefore referring not only to the product, but containing in addition details of the provision, like date, time, amounts and participating organizations and persons. Main Usage of the ChargeItem is to enable the billing process and internal cost allocation. Describes the type of performance or participation(e.g. primary surgeon, anesthesiologiest, etc.). The device, practitioner, etc. who performed or participated in the service. Planned Billable Not billable Aborted Billed Entered in Error Unknown Codes identifying the lifecycle stage of a ChargeItem. If the element is present, it must have either a @value, an @id, or extensions The ChargeItemDefinition resource provides the properties that apply to the (billing) codes necessary to calculate costs and prices. The properties may differ largely depending on type and realm, therefore this resource gives only a rough structure and requires profiling for each type of billing code system. The ChargeItemDefinition resource provides the properties that apply to the (billing) codes necessary to calculate costs and prices. The properties may differ largely depending on type and realm, therefore this resource gives only a rough structure and requires profiling for each type of billing code system. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this charge item definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this charge item definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the charge item definition is stored on different servers. A formal identifier that is used to identify this charge item definition when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the charge item definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the charge item definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active assets. A short, descriptive, user-friendly title for the charge item definition. The URL pointing to an externally-defined charge item definition that is adhered to in whole or in part by this definition. A larger definition of which this particular definition is a component or step. As new versions of a protocol or guideline are defined, allows identification of what versions are replaced by a new instance. The current state of the ChargeItemDefinition. A Boolean value to indicate that this charge item definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the charge item definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the charge item definition changes. The name of the organization or individual that published the charge item definition. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the charge item definition from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate charge item definition instances. A legal or geographic region in which the charge item definition is intended to be used. A copyright statement relating to the charge item definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the charge item definition. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the charge item definition content was or is planned to be in active use. The defined billing details in this resource pertain to the given billing code. The defined billing details in this resource pertain to the given product instance(s). Expressions that describe applicability criteria for the billing code. Group of properties which are applicable under the same conditions. If no applicability rules are established for the group, then all properties always apply. The ChargeItemDefinition resource provides the properties that apply to the (billing) codes necessary to calculate costs and prices. The properties may differ largely depending on type and realm, therefore this resource gives only a rough structure and requires profiling for each type of billing code system. A brief, natural language description of the condition that effectively communicates the intended semantics. The media type of the language for the expression, e.g. "text/cql" for Clinical Query Language expressions or "text/fhirpath" for FHIRPath expressions. An expression that returns true or false, indicating whether the condition is satisfied. When using FHIRPath expressions, the %context environment variable must be replaced at runtime with the ChargeItem resource to which this definition is applied. The ChargeItemDefinition resource provides the properties that apply to the (billing) codes necessary to calculate costs and prices. The properties may differ largely depending on type and realm, therefore this resource gives only a rough structure and requires profiling for each type of billing code system. Expressions that describe applicability criteria for the priceComponent. The price for a ChargeItem may be calculated as a base price with surcharges/deductions that apply in certain conditions. A ChargeItemDefinition resource that defines the prices, factors and conditions that apply to a billing code is currently under development. The priceComponent element can be used to offer transparency to the recipient of the Invoice of how the prices have been calculated. The ChargeItemDefinition resource provides the properties that apply to the (billing) codes necessary to calculate costs and prices. The properties may differ largely depending on type and realm, therefore this resource gives only a rough structure and requires profiling for each type of billing code system. This code identifies the type of the component. A code that identifies the component. Codes may be used to differentiate between kinds of taxes, surcharges, discounts etc. The factor that has been applied on the base price for calculating this component. The amount calculated for this component. base price surcharge deduction discount tax informational Codes indicating the kind of the price component. If the element is present, it must have either a @value, an @id, or extensions A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this claim. The status of the resource instance. The category of claim, e.g. oral, pharmacy, vision, institutional, professional. A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service. A code to indicate whether the nature of the request is: to request adjudication of products and services previously rendered; or requesting authorization and adjudication for provision in the future; or requesting the non-binding adjudication of the listed products and services which could be provided in the future. The party to whom the professional services and/or products have been supplied or are being considered and for whom actual or forecast reimbursement is sought. The period for which charges are being submitted. The date this resource was created. Individual who created the claim, predetermination or preauthorization. The Insurer who is target of the request. The provider which is responsible for the claim, predetermination or preauthorization. The provider-required urgency of processing the request. Typical values include: stat, routine deferred. A code to indicate whether and for whom funds are to be reserved for future claims. Other claims which are related to this claim such as prior submissions or claims for related services or for the same event. Prescription to support the dispensing of pharmacy, device or vision products. Original prescription which has been superseded by this prescription to support the dispensing of pharmacy services, medications or products. The party to be reimbursed for cost of the products and services according to the terms of the policy. A reference to a referral resource. Facility where the services were provided. The members of the team who provided the products and services. Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues. Information about diagnoses relevant to the claim items. Procedures performed on the patient relevant to the billing items with the claim. Financial instruments for reimbursement for the health care products and services specified on the claim. Details of an accident which resulted in injuries which required the products and services listed in the claim. A claim line. Either a simple product or service or a 'group' of details which can each be a simple items or groups of sub-details. The total value of the all the items in the claim. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. Reference to a related claim. A code to convey how the claims are related. An alternate organizational reference to the case or file to which this particular claim pertains. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. Type of Party to be reimbursed: subscriber, provider, other. Reference to the individual or organization to whom any payment will be made. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. A number to uniquely identify care team entries. Member of the team who provided the product or service. The party who is billing and/or responsible for the claimed products or services. The lead, assisting or supervising practitioner and their discipline if a multidisciplinary team. The qualification of the practitioner which is applicable for this service. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. A number to uniquely identify supporting information entries. The general class of the information supplied: information; exception; accident, employment; onset, etc. System and code pertaining to the specific information regarding special conditions relating to the setting, treatment or patient for which care is sought. The date when or period to which this information refers. Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data. Provides the reason in the situation where a reason code is required in addition to the content. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. A number to uniquely identify diagnosis entries. The nature of illness or problem in a coded form or as a reference to an external defined Condition. When the condition was observed or the relative ranking. Indication of whether the diagnosis was present on admission to a facility. A package billing code or bundle code used to group products and services to a particular health condition (such as heart attack) which is based on a predetermined grouping code system. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. A number to uniquely identify procedure entries. When the condition was observed or the relative ranking. Date and optionally time the procedure was performed. The code or reference to a Procedure resource which identifies the clinical intervention performed. Unique Device Identifiers associated with this line item. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. A number to uniquely identify insurance entries and provide a sequence of coverages to convey coordination of benefit order. A flag to indicate that this Coverage is to be used for adjudication of this claim when set to true. The business identifier to be used when the claim is sent for adjudication against this insurance policy. Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system. A business agreement number established between the provider and the insurer for special business processing purposes. Reference numbers previously provided by the insurer to the provider to be quoted on subsequent claims containing services or products related to the prior authorization. The result of the adjudication of the line items for the Coverage specified in this insurance. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. Date of an accident event related to the products and services contained in the claim. The type or context of the accident event for the purposes of selection of potential insurance coverages and determination of coordination between insurers. The physical location of the accident event. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. A number to uniquely identify item entries. CareTeam members related to this service or product. Diagnosis applicable for this service or product. Procedures applicable for this service or product. Exceptions, special conditions and supporting information applicable for this service or product. The type of revenue or cost center providing the product and/or service. Code to identify the general type of benefits under which products and services are provided. When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. Identifies the program under which this may be recovered. The date or dates when the service or product was supplied, performed or completed. Where the product or service was provided. The number of repetitions of a service or product. If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group. A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. The quantity times the unit price for an additional service or product or charge. Unique Device Identifiers associated with this line item. Physical service site on the patient (limb, tooth, etc.). A region or surface of the bodySite, e.g. limb region or tooth surface(s). The Encounters during which this Claim was created or to which the creation of this record is tightly associated. A claim detail line. Either a simple (a product or service) or a 'group' of sub-details which are simple items. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. A number to uniquely identify item entries. The type of revenue or cost center providing the product and/or service. Code to identify the general type of benefits under which products and services are provided. When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. Identifies the program under which this may be recovered. The number of repetitions of a service or product. If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group. A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. The quantity times the unit price for an additional service or product or charge. Unique Device Identifiers associated with this line item. A claim detail line. Either a simple (a product or service) or a 'group' of sub-details which are simple items. A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement. A number to uniquely identify item entries. The type of revenue or cost center providing the product and/or service. Code to identify the general type of benefits under which products and services are provided. When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. Identifies the program under which this may be recovered. The number of repetitions of a service or product. If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group. A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. The quantity times the unit price for an additional service or product or charge. Unique Device Identifiers associated with this line item. Claim Preauthorization Predetermination The purpose of the Claim: predetermination, preauthorization, claim. If the element is present, it must have either a @value, an @id, or extensions Active Cancelled Draft Entered in Error A code specifying the state of the resource instance. If the element is present, it must have either a @value, an @id, or extensions This resource provides the adjudication details from the processing of a Claim resource. This resource provides the adjudication details from the processing of a Claim resource. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this claim response. The status of the resource instance. A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service. A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service. A code to indicate whether the nature of the request is: to request adjudication of products and services previously rendered; or requesting authorization and adjudication for provision in the future; or requesting the non-binding adjudication of the listed products and services which could be provided in the future. The party to whom the professional services and/or products have been supplied or are being considered and for whom actual for facast reimbursement is sought. The date this resource was created. The party responsible for authorization, adjudication and reimbursement. The provider which is responsible for the claim, predetermination or preauthorization. Original request resource reference. The outcome of the claim, predetermination, or preauthorization processing. A human readable description of the status of the adjudication. Reference from the Insurer which is used in later communications which refers to this adjudication. The time frame during which this authorization is effective. Type of Party to be reimbursed: subscriber, provider, other. A claim line. Either a simple (a product or service) or a 'group' of details which can also be a simple items or groups of sub-details. The first-tier service adjudications for payor added product or service lines. The adjudication results which are presented at the header level rather than at the line-item or add-item levels. Categorized monetary totals for the adjudication. Payment details for the adjudication of the claim. A code, used only on a response to a preauthorization, to indicate whether the benefits payable have been reserved and for whom. A code for the form to be used for printing the content. The actual form, by reference or inclusion, for printing the content or an EOB. A note that describes or explains adjudication results in a human readable form. Request for additional supporting or authorizing information. Financial instruments for reimbursement for the health care products and services specified on the claim. Errors encountered during the processing of the adjudication. This resource provides the adjudication details from the processing of a Claim resource. A number to uniquely reference the claim item entries. The numbers associated with notes below which apply to the adjudication of this item. If this item is a group then the values here are a summary of the adjudication of the detail items. If this item is a simple product or service then this is the result of the adjudication of this item. A claim detail. Either a simple (a product or service) or a 'group' of sub-details which are simple items. This resource provides the adjudication details from the processing of a Claim resource. A code to indicate the information type of this adjudication record. Information types may include the value submitted, maximum values or percentages allowed or payable under the plan, amounts that: the patient is responsible for in aggregate or pertaining to this item; amounts paid by other coverages; and, the benefit payable for this item. A code supporting the understanding of the adjudication result and explaining variance from expected amount. Monetary amount associated with the category. A non-monetary value associated with the category. Mutually exclusive to the amount element above. This resource provides the adjudication details from the processing of a Claim resource. A number to uniquely reference the claim detail entry. The numbers associated with notes below which apply to the adjudication of this item. The adjudication results. A sub-detail adjudication of a simple product or service. This resource provides the adjudication details from the processing of a Claim resource. A number to uniquely reference the claim sub-detail entry. The numbers associated with notes below which apply to the adjudication of this item. The adjudication results. This resource provides the adjudication details from the processing of a Claim resource. Claim items which this service line is intended to replace. The sequence number of the details within the claim item which this line is intended to replace. The sequence number of the sub-details within the details within the claim item which this line is intended to replace. The providers who are authorized for the services rendered to the patient. When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. Identifies the program under which this may be recovered. The date or dates when the service or product was supplied, performed or completed. Where the product or service was provided. The number of repetitions of a service or product. If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group. A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. The quantity times the unit price for an additional service or product or charge. Physical service site on the patient (limb, tooth, etc.). A region or surface of the bodySite, e.g. limb region or tooth surface(s). The numbers associated with notes below which apply to the adjudication of this item. The adjudication results. The second-tier service adjudications for payor added services. This resource provides the adjudication details from the processing of a Claim resource. When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. The number of repetitions of a service or product. If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group. A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. The quantity times the unit price for an additional service or product or charge. The numbers associated with notes below which apply to the adjudication of this item. The adjudication results. The third-tier service adjudications for payor added services. This resource provides the adjudication details from the processing of a Claim resource. When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. The number of repetitions of a service or product. If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group. A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. The quantity times the unit price for an additional service or product or charge. The numbers associated with notes below which apply to the adjudication of this item. The adjudication results. This resource provides the adjudication details from the processing of a Claim resource. A code to indicate the information type of this adjudication record. Information types may include: the value submitted, maximum values or percentages allowed or payable under the plan, amounts that the patient is responsible for in aggregate or pertaining to this item, amounts paid by other coverages, and the benefit payable for this item. Monetary total amount associated with the category. This resource provides the adjudication details from the processing of a Claim resource. Whether this represents partial or complete payment of the benefits payable. Total amount of all adjustments to this payment included in this transaction which are not related to this claim's adjudication. Reason for the payment adjustment. Estimated date the payment will be issued or the actual issue date of payment. Benefits payable less any payment adjustment. Issuer's unique identifier for the payment instrument. This resource provides the adjudication details from the processing of a Claim resource. A number to uniquely identify a note entry. The business purpose of the note text. The explanation or description associated with the processing. A code to define the language used in the text of the note. This resource provides the adjudication details from the processing of a Claim resource. A number to uniquely identify insurance entries and provide a sequence of coverages to convey coordination of benefit order. A flag to indicate that this Coverage is to be used for adjudication of this claim when set to true. Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system. A business agreement number established between the provider and the insurer for special business processing purposes. The result of the adjudication of the line items for the Coverage specified in this insurance. This resource provides the adjudication details from the processing of a Claim resource. The sequence number of the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure. The sequence number of the detail within the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure. The sequence number of the sub-detail within the detail within the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure. An error code, from a specified code system, which details why the claim could not be adjudicated. Queued Processing Complete Error Partial Processing The result of the claim processing. If the element is present, it must have either a @value, an @id, or extensions A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this clinical impression by the performer or other systems which remain constant as the resource is updated and propagates from server to server. Identifies the workflow status of the assessment. Captures the reason for the current state of the ClinicalImpression. Categorizes the type of clinical assessment performed. A summary of the context and/or cause of the assessment - why / where it was performed, and what patient events/status prompted it. The patient or group of individuals assessed as part of this record. The Encounter during which this ClinicalImpression was created or to which the creation of this record is tightly associated. The point in time or period over which the subject was assessed. Indicates when the documentation of the assessment was complete. The clinician performing the assessment. A reference to the last assessment that was conducted on this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes. A list of the relevant problems/conditions for a patient. One or more sets of investigations (signs, symptoms, etc.). The actual grouping of investigations varies greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes. Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis. A text summary of the investigations and the diagnosis. Specific findings or diagnoses that were considered likely or relevant to ongoing treatment. Estimate of likely outcome. RiskAssessment expressing likely outcome. Information supporting the clinical impression. Commentary about the impression, typically recorded after the impression itself was made, though supplemental notes by the original author could also appear. A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutritional) history may be used. A record of a specific investigation that was undertaken. A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. Specific text or code for finding or diagnosis, which may include ruled-out or resolved conditions. Specific reference for finding or diagnosis, which may include ruled-out or resolved conditions. Which investigations support finding or diagnosis. In Progress Completed Entered in Error The workflow state of a clinical impression. If the element is present, it must have either a @value, an @id, or extensions The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content. The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this code system when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this code system is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the code system is stored on different servers. This is used in [Coding](datatypes.html#Coding).system. A formal identifier that is used to identify this code system when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the code system when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the code system author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. This is used in [Coding](datatypes.html#Coding).version. A natural language name identifying the code system. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the code system. The date (and optionally time) when the code system resource was created or revised. A Boolean value to indicate that this code system is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the code system was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the code system changes. The name of the organization or individual that published the code system. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the code system from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate code system instances. A legal or geographic region in which the code system is intended to be used. Explanation of why this code system is needed and why it has been designed as it has. A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system. If code comparison is case sensitive when codes within this system are compared to each other. Canonical reference to the value set that contains the entire code system. The meaning of the hierarchy of concepts as represented in this resource. The code system defines a compositional (post-coordination) grammar. This flag is used to signify that the code system does not commit to concept permanence across versions. If true, a version must be specified when referencing this code system. The extent of the content of the code system (the concepts and codes it defines) are represented in this resource instance. The canonical URL of the code system that this code system supplement is adding designations and properties to. The total number of concepts defined by the code system. Where the code system has a compositional grammar, the basis of this count is defined by the system steward. A filter that can be used in a value set compose statement when selecting concepts using a filter. A property defines an additional slot through which additional information can be provided about a concept. Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meanings of the hierarchical relationships are. The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content. The code that identifies this filter when it is used as a filter in [[[ValueSet]]].compose.include.filter. A description of how or why the filter is used. A list of operators that can be used with the filter. A description of what the value for the filter should be. The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content. A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters. Reference to the formal meaning of the property. One possible source of meaning is the [Concept Properties](codesystem-concept-properties.html) code system. A description of the property- why it is defined, and how its value might be used. The type of the property value. Properties of type "code" contain a code defined by the code system (e.g. a reference to another defined concept). The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content. A code - a text symbol - that uniquely identifies the concept within the code system. A human readable string that is the recommended default way to present this concept to a user. The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept. Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc. A property value for this concept. Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) - see hierarchyMeaning. The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content. The language this designation is defined for. A code that details how this designation would be used. The text value for this designation. The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content. A code that is a reference to CodeSystem.property.code. The value of this property. Equals Is A (by subsumption) Descendent Of (by subsumption) Not (Is A) (by subsumption) Regular Expression In Set Not in Set Generalizes (by Subsumption) Exists The kind of operation to perform as a part of a property based filter. If the element is present, it must have either a @value, an @id, or extensions code (internal reference) Coding (external reference) string integer boolean dateTime decimal The type of a property value. If the element is present, it must have either a @value, an @id, or extensions Grouped By Is-A Part Of Classified With The meaning of the hierarchy of concepts in a code system. If the element is present, it must have either a @value, an @id, or extensions Not Present Example Fragment Complete Supplement The extent of the content of the code system (the concepts and codes it defines) are represented in a code system resource. If the element is present, it must have either a @value, an @id, or extensions An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency that was notified about a reportable condition. An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency that was notified about a reportable condition. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this communication by the performer or other systems which remain constant as the resource is updated and propagates from server to server. The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication. The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication. An order, proposal or plan fulfilled in whole or in part by this Communication. Part of this action. Prior communication that this communication is in response to. The status of the transmission. Captures the reason for the current state of the Communication. The type of message conveyed such as alert, notification, reminder, instruction, etc. Characterizes how quickly the planned or in progress communication must be addressed. Includes concepts such as stat, urgent, routine. A channel that was used for this communication (e.g. email, fax). The patient or group that was the focus of this communication. Description of the purpose/content, similar to a subject line in an email. Other resources that pertain to this communication and to which this communication should be associated. The Encounter during which this Communication was created or to which the creation of this record is tightly associated. The time when this communication was sent. The time when this communication arrived at the destination. The entity (e.g. person, organization, clinical information system, care team or device) which was the target of the communication. If receipts need to be tracked by an individual, a separate resource instance will need to be created for each recipient. Multiple recipient communications are intended where either receipts are not tracked (e.g. a mass mail-out) or a receipt is captured in aggregate (all emails confirmed received by a particular time). The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication. The reason or justification for the communication. Indicates another resource whose existence justifies this communication. Text, attachment(s), or resource(s) that was communicated to the recipient. Additional notes or commentary about the communication by the sender, receiver or other interested parties. An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency that was notified about a reportable condition. A communicated content (or for multi-part communications, one portion of the communication). Preparation In Progress Not Done On Hold Stopped Completed Entered in Error Unknown The status of the communication. If the element is present, it must have either a @value, an @id, or extensions A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition. A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this communication request by the performer or other systems which remain constant as the resource is updated and propagates from server to server. A plan or proposal that is fulfilled in whole or in part by this request. Completed or terminated request(s) whose function is taken by this new request. A shared identifier common to all requests that were authorized more or less simultaneously by a single author, representing the identifier of the requisition, prescription or similar form. The status of the proposal or order. Captures the reason for the current state of the CommunicationRequest. The type of message to be sent such as alert, notification, reminder, instruction, etc. Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine. If true indicates that the CommunicationRequest is asking for the specified action to *not* occur. A channel that was used for this communication (e.g. email, fax). The patient or group that is the focus of this communication request. Other resources that pertain to this communication request and to which this communication request should be associated. The Encounter during which this CommunicationRequest was created or to which the creation of this record is tightly associated. Text, attachment(s), or resource(s) to be communicated to the recipient. The time when this communication is to occur. For draft requests, indicates the date of initial creation. For requests with other statuses, indicates the date of activation. The device, individual, or organization who initiated the request and has responsibility for its activation. The entity (e.g. person, organization, clinical information system, device, group, or care team) which is the intended target of the communication. The entity (e.g. person, organization, clinical information system, or device) which is to be the source of the communication. Describes why the request is being made in coded or textual form. Indicates another resource whose existence justifies this request. Comments made about the request by the requester, sender, recipient, subject or other participants. A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition. The communicated content (or for multi-part communications, one portion of the communication). A compartment definition that defines how resources are accessed on a server. A compartment definition that defines how resources are accessed on a server. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this compartment definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this compartment definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the compartment definition is stored on different servers. The identifier that is used to identify this version of the compartment definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the compartment definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the compartment definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. The status of this compartment definition. Enables tracking the life-cycle of the content. A Boolean value to indicate that this compartment definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the compartment definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the compartment definition changes. The name of the organization or individual that published the compartment definition. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the compartment definition from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate compartment definition instances. Explanation of why this compartment definition is needed and why it has been designed as it has. Which compartment this definition describes. Whether the search syntax is supported,. Information about how a resource is related to the compartment. A compartment definition that defines how resources are accessed on a server. The name of a resource supported by the server. The name of a search parameter that represents the link to the compartment. More than one may be listed because a resource may be linked to a compartment in more than one way,. Additional documentation about the resource and compartment. Patient Encounter RelatedPerson Practitioner Device Which type a compartment definition describes. If the element is present, it must have either a @value, an @id, or extensions A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.). A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.). If the element is present, it must have either a @value, an @id, or extensions A version-independent identifier for the Composition. This identifier stays constant as the composition is changed over time. The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document. Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition. A categorization for the type of the composition - helps for indexing and searching. This may be implied by or derived from the code specified in the Composition Type. Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure). Describes the clinical encounter or type of care this documentation is associated with. The composition editing time, when the composition was last logically changed by the author. Identifies who is responsible for the information in the composition, not necessarily who typed it in. Official human-readable label for the composition. The code specifying the level of confidentiality of the Composition. A participant who has attested to the accuracy of the composition/document. Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information. Relationships that this composition has with other compositions or documents that already exist. The clinical service, such as a colonoscopy or an appendectomy, being documented. The root of the sections that make up the composition. A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.). The type of attestation the authenticator offers. When the composition was attested by the party. Who attested the composition in the specified way. A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.). The type of relationship that this composition has with anther composition or document. The target composition/document of this relationship. A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.). This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act. The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time. The description and/or reference of the event(s) being documented. For example, this could be used to document such a colonoscopy or an appendectomy. A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.). The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents. A code identifying the kind of content contained within the section. This must be consistent with the section title. Identifies who is responsible for the information in this section, not necessarily who typed it in. The actual focus of the section when it is not the subject of the composition, but instead represents something or someone associated with the subject such as (for a patient subject) a spouse, parent, fetus, or donor. If not focus is specified, the focus is assumed to be focus of the parent section, or, for a section in the Composition itself, the subject of the composition. Sections with a focus SHALL only include resources where the logical subject (patient, subject, focus, etc.) matches the section focus, or the resources have no logical subject (few resources). A human-readable narrative that contains the attested content of the section, used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. How the entry list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted. Specifies the order applied to the items in the section entries. A reference to the actual resource from which the narrative in the section is derived. If the section is empty, why the list is empty. An empty section typically has some text explaining the empty reason. A nested sub-section within this section. unrestricted low moderate normal restricted very restricted Codes specifying the level of confidentiality of the composition. If the element is present, it must have either a @value, an @id, or extensions Preliminary Final Amended Entered in Error The workflow/clinical status of the composition. If the element is present, it must have either a @value, an @id, or extensions Replaces Transforms Signs Appends The type of relationship between documents. If the element is present, it must have either a @value, an @id, or extensions Personal Professional Legal Official The way in which a person authenticated a composition. If the element is present, it must have either a @value, an @id, or extensions Working List Snapshot List Change List The processing mode that applies to this section. If the element is present, it must have either a @value, an @id, or extensions A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models. A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this concept map when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this concept map is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the concept map is stored on different servers. A formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the concept map author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the concept map. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the concept map. The status of this concept map. Enables tracking the life-cycle of the content. A Boolean value to indicate that this concept map is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the concept map was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the concept map changes. The name of the organization or individual that published the concept map. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the concept map from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate concept map instances. A legal or geographic region in which the concept map is intended to be used. Explanation of why this concept map is needed and why it has been designed as it has. A copyright statement relating to the concept map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the concept map. Identifier for the source value set that contains the concepts that are being mapped and provides context for the mappings. The target value set provides context for the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made. A group of mappings that all have the same source and target system. A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models. An absolute URI that identifies the source system where the concepts to be mapped are defined. The specific version of the code system, as determined by the code system authority. An absolute URI that identifies the target system that the concepts will be mapped to. The specific version of the code system, as determined by the code system authority. Mappings for an individual concept in the source to one or more concepts in the target. What to do when there is no mapping for the source concept. "Unmapped" does not include codes that are unmatched, and the unmapped element is ignored in a code is specified to have equivalence = unmatched. A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models. Identity (code or path) or the element/item being mapped. The display for the code. The display is only provided to help editors when editing the concept map. A concept from the target value set that this concept maps to. A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models. Identity (code or path) or the element/item that the map refers to. The display for the code. The display is only provided to help editors when editing the concept map. The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from target to source (e.g. the target is 'wider' than the source). A description of status/issues in mapping that conveys additional information not represented in the structured data. A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value. A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on. A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models. A reference to an element that holds a coded value that corresponds to a code system property. The idea is that the information model carries an element somewhere that is labeled to correspond with a code system property. An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that crosses code systems). Identity (code or path) or the element/item/ValueSet/text that the map depends on / refers to. The display for the code. The display is only provided to help editors when editing the concept map. A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models. Defines which action to take if there is no match for the source concept in the target system designated for the group. One of 3 actions are possible: use the unmapped code (this is useful when doing a mapping between versions, and only a few codes have changed), use a fixed code (a default code), or alternatively, a reference to a different concept map can be provided (by canonical URL). The fixed code to use when the mode = 'fixed' - all unmapped codes are mapped to a single fixed code. The display for the code. The display is only provided to help editors when editing the concept map. The canonical reference to an additional ConceptMap resource instance to use for mapping if this ConceptMap resource contains no matching mapping for the source concept. Provided Code Fixed Code Other Map Defines which action to take if there is no match in the group. If the element is present, it must have either a @value, an @id, or extensions A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern. A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this condition by the performer or other systems which remain constant as the resource is updated and propagates from server to server. The clinical status of the condition. The verification status to support the clinical status of the condition. A category assigned to the condition. A subjective assessment of the severity of the condition as evaluated by the clinician. Identification of the condition, problem or diagnosis. The anatomical location where this condition manifests itself. Indicates the patient or group who the condition record is associated with. The Encounter during which this Condition was created or to which the creation of this record is tightly associated. Estimated or actual date or date-time the condition began, in the opinion of the clinician. The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate. The recordedDate represents when this particular Condition record was created in the system, which is often a system-generated date. Individual who recorded the record and takes responsibility for its content. Individual who is making the condition statement. Clinical stage or grade of a condition. May include formal severity assessments. Supporting evidence / manifestations that are the basis of the Condition's verification status, such as evidence that confirmed or refuted the condition. Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis. A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern. A simple summary of the stage such as "Stage 3". The determination of the stage is disease-specific. Reference to a formal record of the evidence on which the staging assessment is based. The kind of staging, such as pathological or clinical staging. A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern. A manifestation or symptom that led to the recording of this condition. Links to other relevant information, including pathology reports. A record of a healthcare consumer’s choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time. A record of a healthcare consumer’s choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time. If the element is present, it must have either a @value, an @id, or extensions Unique identifier for this copy of the Consent Statement. Indicates the current state of this consent. A selector of the type of consent being presented: ADR, Privacy, Treatment, Research. This list is now extensible. A classification of the type of consents found in the statement. This element supports indexing and retrieval of consent statements. The patient/healthcare consumer to whom this consent applies. When this Consent was issued / created / indexed. Either the Grantor, which is the entity responsible for granting the rights listed in a Consent Directive or the Grantee, which is the entity responsible for complying with the Consent Directive, including any obligations or limitations on authorizations and enforcement of prohibitions. The organization that manages the consent, and the framework within which it is executed. The source on which this consent statement is based. The source might be a scanned original paper form, or a reference to a consent that links back to such a source, a reference to a document repository (e.g. XDS) that stores the original consent document. The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law. A reference to the specific base computable regulation or policy. Whether a treatment instruction (e.g. artificial respiration yes or no) was verified with the patient, his/her family or another authorized person. An exception to the base policy of this consent. An exception can be an addition or removal of access permissions. A record of a healthcare consumer’s choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time. Entity or Organization having regulatory jurisdiction or accountability for enforcing policies pertaining to Consent Directives. The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law. A record of a healthcare consumer’s choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time. Has the instruction been verified. Who verified the instruction (Patient, Relative or other Authorized Person). Date verification was collected. A record of a healthcare consumer’s choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time. Action to take - permit or deny - when the rule conditions are met. Not permitted in root rule, required in all nested rules. The timeframe in this rule is valid. Who or what is controlled by this rule. Use group to identify a set of actors by some property they share (e.g. 'admitting officers'). Actions controlled by this Rule. A security label, comprised of 0..* security label fields (Privacy tags), which define which resources are controlled by this exception. The context of the activities a user is taking - why the user is accessing the data - that are controlled by this rule. The class of information covered by this rule. The type can be a FHIR resource type, a profile on a type, or a CDA document, or some other type that indicates what sort of information the consent relates to. If this code is found in an instance, then the rule applies. Clinical or Operational Relevant period of time that bounds the data controlled by this rule. The resources controlled by this rule if specific resources are referenced. Rules which provide exceptions to the base rule or subrules. A record of a healthcare consumer’s choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time. How the individual is involved in the resources content that is described in the exception. The resource that identifies the actor. To identify actors by type, use group to identify a set of actors by some property they share (e.g. 'admitting officers'). A record of a healthcare consumer’s choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time. How the resource reference is interpreted when testing consent restrictions. A reference to a specific resource that defines which resources are covered by this consent. Opt Out Opt In How a rule statement is applied, such as adding additional consent or removing consent. If the element is present, it must have either a @value, an @id, or extensions Instance Related Dependents AuthoredBy How a resource reference is interpreted when testing consent restrictions. If the element is present, it must have either a @value, an @id, or extensions Pending Proposed Active Rejected Inactive Entered in Error Indicates the state of the consent. If the element is present, it must have either a @value, an @id, or extensions Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. If the element is present, it must have either a @value, an @id, or extensions Unique identifier for this Contract or a derivative that references a Source Contract. Canonical identifier for this contract, represented as a URI (globally unique). An edition identifier used for business purposes to label business significant variants. The status of the resource instance. Legal states of the formation of a legal instrument, which is a formally executed written document that can be formally attributed to its author, records and formally expresses a legally enforceable act, process, or contractual duty, obligation, or right, and therefore evidences that act, process, or agreement. The URL pointing to a FHIR-defined Contract Definition that is adhered to in whole or part by this Contract. The URL pointing to an externally maintained definition that is adhered to in whole or in part by this Contract. The minimal content derived from the basal information source at a specific stage in its lifecycle. When this Contract was issued. Relevant time or time-period when this Contract is applicable. Event resulting in discontinuation or termination of this Contract instance by one or more parties to the contract. The target entity impacted by or of interest to parties to the agreement. A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies. Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources. Sites in which the contract is complied with, exercised, or in force. A natural language name identifying this Contract definition, derivative, or instance in any legal state. Provides additional information about its content. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content. An explanatory or alternate user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content. Alternative representation of the title for this Contract definition, derivative, or instance in any legal state., e.g., a domain specific contract number related to legislation. The individual or organization that authored the Contract definition, derivative, or instance in any legal state. A selector of legal concerns for this Contract definition, derivative, or instance in any legal state. Narrows the range of legal concerns to focus on the achievement of specific contractual objectives. A high-level category for the legal instrument, whether constructed as a Contract definition, derivative, or instance in any legal state. Provides additional information about its content within the context of the Contract's scope to distinguish the kinds of systems that would be interested in the contract. Sub-category for the Contract that distinguishes the kinds of systems that would be interested in the Contract within the context of the Contract's scope. Precusory content developed with a focus and intent of supporting the formation a Contract instance, which may be associated with and transformable into a Contract. One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups. Information that may be needed by/relevant to the performer in their execution of this term action. Links to Provenance records for past versions of this Contract definition, derivative, or instance, which identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the Contract. The Provence.entity indicates the target that was changed in the update. http://build.fhir.org/provenance-definitions.html#Provenance.entity. Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness. The "patient friendly language" versionof the Contract in whole or in parts. "Patient friendly language" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement. List of Legal expressions or representations of this Contract. List of Computable Policy Rule Language Representations of this Contract. Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Precusory content structure and use, i.e., a boilerplate, template, application for a contract such as an insurance policy or benefits under a program, e.g., workers compensation. Detailed Precusory content type. The individual or organization that published the Contract precursor content. The date (and optionally time) when the contract was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the contract changes. amended | appended | cancelled | disputed | entered-in-error | executable | executed | negotiable | offered | policy | rejected | renewed | revoked | resolved | terminated. A copyright statement relating to Contract precursor content. Copyright statements are generally legal restrictions on the use and publishing of the Contract precursor content. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Unique identifier for this particular Contract Provision. When this Contract Provision was issued. Relevant time or time-period when this Contract Provision is applicable. The entity that the term applies to. A legal clause or condition contained within a contract that requires one or both parties to perform a particular requirement by some specified time or prevents one or both parties from performing a particular requirement by some specified time. A specialized legal clause or condition based on overarching contract type. Statement of a provision in a policy or a contract. Security labels that protect the handling of information about the term and its elements, which may be specifically identified.. The matter of concern in the context of this provision of the agrement. Contract Term Asset List. An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place. Nested group of Contract Provisions. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Number used to link this term or term element to the applicable Security Label. Security label privacy tag that species the level of confidentiality protection required for this term and/or term elements. Security label privacy tag that species the applicable privacy and security policies governing this term and/or term elements. Security label privacy tag that species the manner in which term and/or term elements are to be protected. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Unique identifier for this particular Contract Provision. Offer Recipient. The owner of an asset has the residual control rights over the asset: the right to decide all usages of the asset in any way not inconsistent with a prior contract, custom, or law (Hart, 1995, p. 30). Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit. Type of choice made by accepting party with respect to an offer made by an offeror/ grantee. How the decision about a Contract was conveyed. Response to offer text. Human readable form of this Contract Offer. The id of the clause or question text of the offer in the referenced questionnaire/response. Security labels that protects the offer. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Participant in the offer. How the party participates in the offer. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Response to an offer clause or question text, which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Differentiates the kind of the asset . Target entity type about which the term may be concerned. Associated entities. May be a subtype or part of an offered asset. Specifies the applicability of the term to an asset resource instance, and instances it refers to orinstances that refer to it, and/or are owned by the offeree. Circumstance of the asset. Description of the quality and completeness of the asset that imay be a factor in its valuation. Type of Asset availability for use or ownership. Asset relevant contractual time period. Time period of asset use. Clause or question text (Prose Object) concerning the asset in a linked form, such as a QuestionnaireResponse used in the formation of the contract. Id [identifier??] of the clause or question text about the asset in the referenced form or QuestionnaireResponse. Response to assets. Security labels that protects the asset. Contract Valued Item List. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Asset context reference may include the creator, custodian, or owning Person or Organization (e.g., bank, repository), location held, e.g., building, jurisdiction. Coded representation of the context generally or of the Referenced entity, such as the asset holder type or location. Context description. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Specific type of Contract Valued Item that may be priced. Identifies a Contract Valued Item instance. Indicates the time during which this Contract ValuedItem information is effective. Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances. A Contract Valued Item unit valuation measure. A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point. Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. Terms of valuation. When payment is due. Who will make payment. Who will receive payment. Id of the clause or question text related to the context of this valuedItem in the referenced form or QuestionnaireResponse. A set of security labels that define which terms are controlled by this condition. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. True if the term prohibits the action. Activity or service obligation to be done or not done, performed or not performed, effectuated or not by this Contract term. Entity of the action. Reason or purpose for the action stipulated by this Contract Provision. Id [identifier??] of the clause or question text related to this action in the referenced form or QuestionnaireResponse. Current state of the term action. Encounter or Episode with primary association to specified term activity. Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse. When action happens. Who or what initiated the action and has responsibility for its activation. Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse. The type of individual that is desired or required to perform or not perform the action. The type of role or competency of an individual desired or required to perform or not perform the action. Indicates who or what is being asked to perform (or not perform) the ction. Id [identifier??] of the clause or question text related to the reason type or reference of this action in the referenced form or QuestionnaireResponse. Rationale for the action to be performed or not performed. Describes why the action is permitted or prohibited. Indicates another resource whose existence justifies permitting or not permitting this action. Describes why the action is to be performed or not performed in textual form. Id [identifier??] of the clause or question text related to the reason type or reference of this action in the referenced form or QuestionnaireResponse. Comments made about the term action made by the requester, performer, subject or other participants. Security labels that protects the action. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. The entity the action is performed or not performed on or for. Role type of agent assigned roles in this Contract. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Role of this Contract signer, e.g. notary, grantee. Party which is a signator to this Contract. Legally binding Contract DSIG signature contents in Base64. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Contract legal text in human renderable form. Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement. Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal). Amended Appended Cancelled Disputed Entered in Error Executable Executed Negotiable Offered Policy Rejected Renewed Revoked Resolved Terminated A code specifying the state of the resource instance. If the element is present, it must have either a @value, an @id, or extensions Amended Appended Cancelled Disputed Entered in Error Executable Executed Negotiable Offered Policy Rejected Renewed Revoked Resolved Terminated Status of the publication of contract content. If the element is present, it must have either a @value, an @id, or extensions Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment. Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this coverage. The status of the resource instance. The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health or payment by an individual or organization. The party who 'owns' the insurance policy. The party who has signed-up for or 'owns' the contractual relationship to the policy or to whom the benefit of the policy for services rendered to them or their family is due. The insurer assigned ID for the Subscriber. The party who benefits from the insurance coverage; the patient when products and/or services are provided. A unique identifier for a dependent under the coverage. The relationship of beneficiary (patient) to the subscriber. Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force. The program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements. A suite of underwriter specific classifiers. The order of applicability of this coverage relative to other coverages which are currently in force. Note, there may be gaps in the numbering and this does not imply primary, secondary etc. as the specific positioning of coverages depends upon the episode of care. The insurer-specific identifier for the insurer-defined network of providers to which the beneficiary may seek treatment which will be covered at the 'in-network' rate, otherwise 'out of network' terms and conditions apply. A suite of codes indicating the cost category and associated amount which have been detailed in the policy and may have been included on the health card. When 'subrogation=true' this insurance instance has been included not for adjudication but to provide insurers with the details to recover costs. The policy(s) which constitute this insurance coverage. Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment. The type of classification for which an insurer-specific class label or number and optional name is provided, for example may be used to identify a class of coverage or employer group, Policy, Plan. The alphanumeric string value associated with the insurer issued label. A short description for the class. Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment. The category of patient centric costs associated with treatment. The amount due from the patient for the cost category. A suite of codes indicating exceptions or reductions to patient costs and their effective periods. Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment. The code for the specific exception. The timeframe during when the exception is in force. The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy. The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this coverage eligiblity request. The status of the resource instance. When the requestor expects the processor to complete processing. Code to specify whether requesting: prior authorization requirements for some service categories or billing codes; benefits for coverages specified or discovered; discovery and return of coverages for the patient; and/or validation that the specified coverage is in-force at the date/period specified or 'now' if not specified. The party who is the beneficiary of the supplied coverage and for whom eligibility is sought. The date or dates when the enclosed suite of services were performed or completed. The date when this resource was created. Person who created the request. The provider which is responsible for the request. The Insurer who issued the coverage in question and is the recipient of the request. Facility where the services are intended to be provided. Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues. Financial instruments for reimbursement for the health care products and services. Service categories or billable services for which benefit details and/or an authorization prior to service delivery may be required by the payor. The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy. A number to uniquely identify supporting information entries. Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data. The supporting materials are applicable for all detail items, product/servce categories and specific billing codes. The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy. A flag to indicate that this Coverage is to be used for evaluation of this request when set to true. Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system. A business agreement number established between the provider and the insurer for special business processing purposes. The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy. Exceptions, special conditions and supporting information applicable for this service or product line. Code to identify the general type of benefits under which products and services are provided. This contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. The practitioner who is responsible for the product or service to be rendered to the patient. The number of repetitions of a service or product. The amount charged to the patient by the provider for a single unit. Facility where the services will be provided. Patient diagnosis for which care is sought. The plan/proposal/order describing the proposed service in detail. The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy. The nature of illness or problem in a coded form or as a reference to an external defined Condition. Coverage auth-requirements Coverage benefits Coverage Discovery Coverage Validation A code specifying the types of information being requested. If the element is present, it must have either a @value, an @id, or extensions This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource. This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this coverage eligiblity request. The status of the resource instance. Code to specify whether requesting: prior authorization requirements for some service categories or billing codes; benefits for coverages specified or discovered; discovery and return of coverages for the patient; and/or validation that the specified coverage is in-force at the date/period specified or 'now' if not specified. The party who is the beneficiary of the supplied coverage and for whom eligibility is sought. The date or dates when the enclosed suite of services were performed or completed. The date this resource was created. The provider which is responsible for the request. Reference to the original request resource. The outcome of the request processing. A human readable description of the status of the adjudication. The Insurer who issued the coverage in question and is the author of the response. Financial instruments for reimbursement for the health care products and services. A reference from the Insurer to which these services pertain to be used on further communication and as proof that the request occurred. A code for the form to be used for printing the content. Errors encountered during the processing of the request. This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource. Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system. Flag indicating if the coverage provided is inforce currently if no service date(s) specified or for the whole duration of the service dates. The term of the benefits documented in this response. Benefits and optionally current balances, and authorization details by category or service. This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource. Code to identify the general type of benefits under which products and services are provided. This contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. The practitioner who is eligible for the provision of the product or service. True if the indicated class of service is excluded from the plan, missing or False indicates the product or service is included in the coverage. A short name or tag for the benefit. A richer description of the benefit or services covered. Is a flag to indicate whether the benefits refer to in-network providers or out-of-network providers. Indicates if the benefits apply to an individual or to the family. The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual visits'. Benefits used to date. A boolean flag indicating whether a preauthorization is required prior to actual service delivery. Codes or comments regarding information or actions associated with the preauthorization. A web location for obtaining requirements or descriptive information regarding the preauthorization. This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource. Classification of benefit being provided. The quantity of the benefit which is permitted under the coverage. The quantity of the benefit which have been consumed to date. This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource. An error code,from a specified code system, which details why the eligibility check could not be performed. Coverage auth-requirements Coverage benefits Coverage Discovery Coverage Validation A code specifying the types of information being requested. If the element is present, it must have either a @value, an @id, or extensions Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. If the element is present, it must have either a @value, an @id, or extensions Business identifier associated with the detected issue record. Indicates the status of the detected issue. Identifies the general type of issue identified. Indicates the degree of importance associated with the identified issue based on the potential impact on the patient. Indicates the patient whose record the detected issue is associated with. The date or period when the detected issue was initially identified. Individual or device responsible for the issue being raised. For example, a decision support application or a pharmacist conducting a medication review. Indicates the resource representing the current activity or proposed activity that is potentially problematic. Supporting evidence or manifestations that provide the basis for identifying the detected issue such as a GuidanceResponse or MeasureReport. A textual explanation of the detected issue. The literature, knowledge-base or similar reference that describes the propensity for the detected issue identified. Indicates an action that has been taken or is committed to reduce or eliminate the likelihood of the risk identified by the detected issue from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action. Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. A manifestation that led to the recording of this detected issue. Links to resources that constitute evidence for the detected issue such as a GuidanceResponse or MeasureReport. Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified issue. Indicates when the mitigating action was documented. Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring. Registered Preliminary Final Amended Corrected Cancelled Entered in Error Unknown Indicates the status of the identified issue. If the element is present, it must have either a @value, an @id, or extensions High Moderate Low Indicates the potential degree of impact of the identified issue on the patient. If the element is present, it must have either a @value, an @id, or extensions A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. If the element is present, it must have either a @value, an @id, or extensions Unique instance identifiers assigned to a device by manufacturers other organizations or owners. The reference to the definition for the device. Unique device identifier (UDI) assigned to device label or package. Note that the Device may include multiple udiCarriers as it either may include just the udiCarrier for the jurisdiction it is sold, or for multiple jurisdictions it could have been sold. Status of the Device availability. Reason for the dtatus of the Device availability. The distinct identification string as required by regulation for a human cell, tissue, or cellular and tissue-based product. A name of the manufacturer. The date and time when the device was manufactured. The date and time beyond which this device is no longer valid or should not be used (if applicable). Lot number assigned by the manufacturer. The serial number assigned by the organization when the device was manufactured. This represents the manufacturer's name of the device as provided by the device, from a UDI label, or by a person describing the Device. This typically would be used when a person provides the name(s) or when the device represents one of the names available from DeviceDefinition. The model number for the device. The part number of the device. The kind or type of device. The capabilities supported on a device, the standards to which the device conforms for a particular purpose, and used for the communication. The actual design of the device or software version running on the device. The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties. Patient information, If the device is affixed to a person. An organization that is responsible for the provision and ongoing maintenance of the device. Contact details for an organization or a particular human that is responsible for the device. The place where the device can be found. A network address on which the device may be contacted directly. Descriptive information, usage information or implantation information that is not captured in an existing element. Provides additional safety characteristics about a medical device. For example devices containing latex. The parent device. A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. The device identifier (DI) is a mandatory, fixed portion of a UDI that identifies the labeler and the specific version or model of a device. Organization that is charged with issuing UDIs for devices. For example, the US FDA issuers include : 1) GS1: http://hl7.org/fhir/NamingSystem/gs1-di, 2) HIBCC: http://hl7.org/fhir/NamingSystem/hibcc-dI, 3) ICCBBA for blood containers: http://hl7.org/fhir/NamingSystem/iccbba-blood-di, 4) ICCBA for other devices: http://hl7.org/fhir/NamingSystem/iccbba-other-di. The identity of the authoritative source for UDI generation within a jurisdiction. All UDIs are globally unique within a single namespace with the appropriate repository uri as the system. For example, UDIs of devices managed in the U.S. by the FDA, the value is http://hl7.org/fhir/NamingSystem/fda-udi. The full UDI carrier of the Automatic Identification and Data Capture (AIDC) technology representation of the barcode string as printed on the packaging of the device - e.g., a barcode or RFID. Because of limitations on character sets in XML and the need to round-trip JSON data through XML, AIDC Formats *SHALL* be base64 encoded. The full UDI carrier as the human readable form (HRF) representation of the barcode string as printed on the packaging of the device. A coded entry to indicate how the data was entered. A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. The name of the device. The type of deviceName. UDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName. A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. The standard that is used to operate and communicate. The version of the standard that is used to operate and communicate. A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. The type of the device version. A single component of the device version. The version text. A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. Code that specifies the property DeviceDefinitionPropetyCode (Extensible). Property value as a quantity. Property value as a code, e.g., NTP4 (synced to NTP). Active Inactive Entered in Error Unknown The availability status of the device. If the element is present, it must have either a @value, an @id, or extensions UDI Label name User Friendly name Patient Reported name Manufacturer name Model name other The type of name the device is referred by. If the element is present, it must have either a @value, an @id, or extensions Barcode RFID Manual Card Self Reported Unknown Codes to identify how UDI data was entered. If the element is present, it must have either a @value, an @id, or extensions The characteristics, operational status and capabilities of a medical-related component of a medical device. The characteristics, operational status and capabilities of a medical-related component of a medical device. If the element is present, it must have either a @value, an @id, or extensions Unique instance identifiers assigned to a device by the software, manufacturers, other organizations or owners. For example: handle ID. Unique device identifier (UDI) assigned to device label or package. Note that the Device may include multiple udiCarriers as it either may include just the udiCarrier for the jurisdiction it is sold, or for multiple jurisdictions it could have been sold. A name of the manufacturer. A name given to the device to identify it. The model number for the device. What kind of device or device system this is. The capabilities supported on a device, the standards to which the device conforms for a particular purpose, and used for the communication. The available versions of the device, e.g., software versions. Safety characteristics of the device. Shelf Life and storage information. Dimensions, color etc. Language code for the human-readable text strings produced by the device (all supported). Device capabilities. The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties. An organization that is responsible for the provision and ongoing maintenance of the device. Contact details for an organization or a particular human that is responsible for the device. A network address on which the device may be contacted directly. Access to on-line information about the device. Descriptive information, usage information or implantation information that is not captured in an existing element. The quantity of the device present in the packaging (e.g. the number of devices present in a pack, or the number of devices in the same package of the medicinal product). The parent device it can be part of. A substance used to create the material(s) of which the device is made. The characteristics, operational status and capabilities of a medical-related component of a medical device. The identifier that is to be associated with every Device that references this DeviceDefintiion for the issuer and jurisdication porvided in the DeviceDefinition.udiDeviceIdentifier. The organization that assigns the identifier algorithm. The jurisdiction to which the deviceIdentifier applies. The characteristics, operational status and capabilities of a medical-related component of a medical device. The name of the device. The type of deviceName. UDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName. The characteristics, operational status and capabilities of a medical-related component of a medical device. The standard that is used to operate and communicate. The version of the standard that is used to operate and communicate. The characteristics, operational status and capabilities of a medical-related component of a medical device. Type of capability. Description of capability. The characteristics, operational status and capabilities of a medical-related component of a medical device. Code that specifies the property DeviceDefinitionPropetyCode (Extensible). Property value as a quantity. Property value as a code, e.g., NTP4 (synced to NTP). The characteristics, operational status and capabilities of a medical-related component of a medical device. The substance. Indicates an alternative material of the device. Whether the substance is a known or suspected allergen. Describes a measurement, calculation or setting capability of a medical device. Describes a measurement, calculation or setting capability of a medical device. If the element is present, it must have either a @value, an @id, or extensions Unique instance identifiers assigned to a device by the device or gateway software, manufacturers, other organizations or owners. For example: handle ID. Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc. Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc. Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacturer, serial number, etc. Describes the link to the Device that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. An example would be a Device that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location. Indicates current operational state of the device. For example: On, Off, Standby, etc. Describes the color representation for the metric. This is often used to aid clinicians to track and identify parameter types by color. In practice, consider a Patient Monitor that has ECG/HR and Pleth for example; the parameters are displayed in different characteristic colors, such as HR-blue, BP-green, and PR and SpO2- magenta. Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation. Describes the measurement repetition time. This is not necessarily the same as the update period. The measurement repetition time can range from milliseconds up to hours. An example for a measurement repetition time in the range of milliseconds is the sampling rate of an ECG. An example for a measurement repetition time in the range of hours is a NIBP that is triggered automatically every hour. The update period may be different than the measurement repetition time, if the device does not update the published observed value with the same frequency as it was measured. Describes the calibrations that have been performed or that are required to be performed. Describes a measurement, calculation or setting capability of a medical device. Describes the type of the calibration method. Describes the state of the calibration. Describes the time last calibration has been performed. Unspecified Offset Gain Two Point Describes the type of a metric calibration. If the element is present, it must have either a @value, an @id, or extensions Color Black Color Red Color Green Color Yellow Color Blue Color Magenta Color Cyan Color White Describes the typical color of representation. If the element is present, it must have either a @value, an @id, or extensions Not Calibrated Calibration Required Calibrated Unspecified Describes the state of a metric calibration. If the element is present, it must have either a @value, an @id, or extensions On Off Standby Entered In Error Describes the operational status of the DeviceMetric. If the element is present, it must have either a @value, an @id, or extensions Measurement Setting Calculation Unspecified Describes the category of the metric. If the element is present, it must have either a @value, an @id, or extensions Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker. Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker. If the element is present, it must have either a @value, an @id, or extensions Identifiers assigned to this order by the orderer or by the receiver. The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this DeviceRequest. The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this DeviceRequest. Plan/proposal/order fulfilled by this request. The request takes the place of the referenced completed or terminated request(s). Composite request this is part of. The status of the request. Whether the request is a proposal, plan, an original order or a reflex order. Indicates how quickly the {{title}} should be addressed with respect to other requests. The details of the device to be used. Specific parameters for the ordered item. For example, the prism value for lenses. The patient who will use the device. An encounter that provides additional context in which this request is made. The timing schedule for the use of the device. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". When the request transitioned to being actionable. The individual who initiated the request and has responsibility for its activation. Desired type of performer for doing the diagnostic testing. The desired performer for doing the diagnostic testing. Reason or justification for the use of this device. Reason or justification for the use of this device. Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be required for delivering the requested service. Additional clinical information about the patient that may influence the request fulfilment. For example, this may include where on the subject's body the device will be used (i.e. the target site). Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement. Key events in the history of the request. Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker. A code or string that identifies the device detail being asserted. The value of the device detail. A record of a device being used by a patient where the record is the result of a report from the patient or another clinician. A record of a device being used by a patient where the record is the result of a report from the patient or another clinician. If the element is present, it must have either a @value, an @id, or extensions An external identifier for this statement such as an IRI. A plan, proposal or order that is fulfilled in whole or in part by this DeviceUseStatement. A code representing the patient or other source's judgment about the state of the device used that this statement is about. Generally this will be active or completed. The patient who used the device. Allows linking the DeviceUseStatement to the underlying Request, or to other information that supports or is used to derive the DeviceUseStatement. How often the device was used. The time at which the statement was made/recorded. Who reported the device was being used by the patient. The details of the device used. Reason or justification for the use of the device. Indicates another resource whose existence justifies this DeviceUseStatement. Indicates the anotomic location on the subject's body where the device was used ( i.e. the target). Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement. Active Completed Entered in Error Intended Stopped On Hold A coded concept indicating the current status of the Device Usage. If the element is present, it must have either a @value, an @id, or extensions The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports. The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports. If the element is present, it must have either a @value, an @id, or extensions Identifiers assigned to this report by the performer or other systems. Details concerning a service requested. The status of the diagnostic report. A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes. A code or name that describes this diagnostic report. The subject of the report. Usually, but not always, this is a patient. However, diagnostic services also perform analyses on specimens collected from a variety of other sources. The healthcare event (e.g. a patient and healthcare provider interaction) which this DiagnosticReport is about. The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself. The date and time that this version of the report was made available to providers, typically after the report was reviewed and verified. The diagnostic service that is responsible for issuing the report. The practitioner or organization that is responsible for the report's conclusions and interpretations. Details about the specimens on which this diagnostic report is based. [Observations](observation.html) that are part of this diagnostic report. One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images. A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest). Concise and clinically contextualized summary conclusion (interpretation/impression) of the diagnostic report. One or more codes that represent the summary conclusion (interpretation/impression) of the diagnostic report. Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent. The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports. A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features. Reference to the image source. Registered Partial Preliminary Final Amended Corrected Appended Cancelled Entered in Error Unknown The status of the diagnostic report. If the element is present, it must have either a @value, an @id, or extensions A collection of documents compiled for a purpose together with metadata that applies to the collection. A collection of documents compiled for a purpose together with metadata that applies to the collection. If the element is present, it must have either a @value, an @id, or extensions A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts. Other identifiers associated with the document manifest, including version independent identifiers. The status of this document manifest. The code specifying the type of clinical activity that resulted in placing the associated content into the DocumentManifest. Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case). When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated, etc.). Identifies who is the author of the manifest. Manifest author is not necessarly the author of the references included. A patient, practitioner, or organization for which this set of documents is intended. Identifies the source system, application, or software that produced the document manifest. Human-readable description of the source document. This is sometimes known as the "title". The list of Resources that consist of the parts of this manifest. Related identifiers or resources associated with the DocumentManifest. A collection of documents compiled for a purpose together with metadata that applies to the collection. Related identifier to this DocumentManifest. For example, Order numbers, accession numbers, XDW workflow numbers. Related Resource to this DocumentManifest. For example, Order, ServiceRequest, Procedure, EligibilityRequest, etc. A reference to a document of any kind for any purpose. Provides metadata about the document so that the document can be discovered and managed. The scope of a document is any seralized object with a mime-type, so includes formal patient centric documents (CDA), cliical notes, scanned paper, and non-patient specific documents like policy text. A reference to a document of any kind for any purpose. Provides metadata about the document so that the document can be discovered and managed. The scope of a document is any seralized object with a mime-type, so includes formal patient centric documents (CDA), cliical notes, scanned paper, and non-patient specific documents like policy text. If the element is present, it must have either a @value, an @id, or extensions Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document. Other identifiers associated with the document, including version independent identifiers. The status of this document reference. The status of the underlying document. Specifies the particular kind of document referenced (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced. A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type. Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). When the document reference was created. Identifies who is responsible for adding the information to the document. Which person or organization authenticates that this document is valid. Identifies the organization or group who is responsible for ongoing maintenance of and access to the document. Relationships that this document has with other document references that already exist. Human-readable description of the source document. A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the "reference" to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to. The document and format referenced. There may be multiple content element repetitions, each with a different format. The clinical context in which the document was prepared. A reference to a document of any kind for any purpose. Provides metadata about the document so that the document can be discovered and managed. The scope of a document is any seralized object with a mime-type, so includes formal patient centric documents (CDA), cliical notes, scanned paper, and non-patient specific documents like policy text. The type of relationship that this document has with anther document. The target document of this relationship. A reference to a document of any kind for any purpose. Provides metadata about the document so that the document can be discovered and managed. The scope of a document is any seralized object with a mime-type, so includes formal patient centric documents (CDA), cliical notes, scanned paper, and non-patient specific documents like policy text. The document or URL of the document along with critical metadata to prove content has integrity. An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType. A reference to a document of any kind for any purpose. Provides metadata about the document so that the document can be discovered and managed. The scope of a document is any seralized object with a mime-type, so includes formal patient centric documents (CDA), cliical notes, scanned paper, and non-patient specific documents like policy text. Describes the clinical encounter or type of care that the document content is associated with. This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the type Code, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act. The time period over which the service that is described by the document was provided. The kind of facility where the patient was seen. This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty. The Patient Information as known when the document was published. May be a reference to a version specific, or contained. Related identifiers or resources associated with the DocumentReference. The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies. The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this effect evidence synthesis when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this effect evidence synthesis is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the effect evidence synthesis is stored on different servers. A formal identifier that is used to identify this effect evidence synthesis when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the effect evidence synthesis when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the effect evidence synthesis author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the effect evidence synthesis. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the effect evidence synthesis. The status of this effect evidence synthesis. Enables tracking the life-cycle of the content. The date (and optionally time) when the effect evidence synthesis was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the effect evidence synthesis changes. The name of the organization or individual that published the effect evidence synthesis. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the effect evidence synthesis from a consumer's perspective. A human-readable string to clarify or explain concepts about the resource. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate effect evidence synthesis instances. A legal or geographic region in which the effect evidence synthesis is intended to be used. A copyright statement relating to the effect evidence synthesis and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the effect evidence synthesis. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the effect evidence synthesis content was or is planned to be in active use. Descriptive topics related to the content of the EffectEvidenceSynthesis. Topics provide a high-level categorization grouping types of EffectEvidenceSynthesiss that can be useful for filtering and searching. An individiual or organization primarily involved in the creation and maintenance of the content. An individual or organization primarily responsible for internal coherence of the content. An individual or organization primarily responsible for review of some aspect of the content. An individual or organization responsible for officially endorsing the content for use in some setting. Related artifacts such as additional documentation, justification, or bibliographic references. Type of synthesis eg meta-analysis. Type of study eg randomized trial. A reference to a EvidenceVariable resource that defines the population for the research. A reference to a EvidenceVariable resource that defines the exposure for the research. A reference to a EvidenceVariable resource that defines the comparison exposure for the research. A reference to a EvidenceVariable resomece that defines the outcome for the research. A description of the size of the sample involved in the synthesis. A description of the results for each exposure considered in the effect estimate. The estimated effect of the exposure variant. A description of the certainty of the effect estimate. The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies. Human-readable summary of sample size. Number of studies included in this evidence synthesis. Number of participants included in this evidence synthesis. The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies. Human-readable summary of results by exposure state. Whether these results are for the exposure state or alternative exposure state. Used to define variant exposure states such as low-risk state. Reference to a RiskEvidenceSynthesis resource. The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies. Human-readable summary of effect estimate. Examples include relative risk and mean difference. Used to define variant exposure states such as low-risk state. The point estimate of the effect estimate. Specifies the UCUM unit for the outcome. A description of the precision of the estimate for the effect. The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies. Examples include confidence interval and interquartile range. Use 95 for a 95% confidence interval. Lower bound of confidence interval. Upper bound of confidence interval. The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies. A rating of the certainty of the effect estimate. A human-readable string to clarify or explain concepts about the resource. A description of a component of the overall certainty. The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies. Type of subcomponent of certainty rating. A rating of a subcomponent of rating certainty. A human-readable string to clarify or explain concepts about the resource. Exposure Exposure Alternative Whether the results by exposure is describing the results for the primary exposure of interest (exposure) or the alternative state (exposureAlternative). If the element is present, it must have either a @value, an @id, or extensions An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. If the element is present, it must have either a @value, an @id, or extensions Identifier(s) by which this encounter is known. planned | arrived | triaged | in-progress | onleave | finished | cancelled +. The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them. Concepts representing classification of patient encounter such as ambulatory (outpatient), inpatient, emergency, home health or others due to local variations. The class history permits the tracking of the encounters transitions without needing to go through the resource history. This would be used for a case where an admission starts of as an emergency encounter, then transitions into an inpatient scenario. Doing this and not restarting a new encounter ensures that any lab/diagnostic results can more easily follow the patient and not require re-processing and not get lost or cancelled during a kind of discharge from emergency to inpatient. Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation). Broad categorization of the service that is to be provided (e.g. cardiology). Indicates the urgency of the encounter. The patient or group present at the encounter. Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem. The association is recorded on the encounter as these are typically created after the episode of care and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years). The request this encounter satisfies (e.g. incoming referral or procedure request). The list of people responsible for providing the service. The appointment that scheduled this encounter. The start and end time of the encounter. Quantity of time the encounter lasted. This excludes the time during leaves of absence. Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis. Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis. The list of diagnosis relevant to this encounter. The set of accounts that may be used for billing for this Encounter. Details about the admission to a healthcare service. List of locations where the patient has been during this encounter. The organization that is primarily responsible for this Encounter's services. This MAY be the same as the organization on the Patient record, however it could be different, such as if the actor performing the services was from an external organization (which may be billed seperately) for an external consultation. Refer to the example bundle showing an abbreviated set of Encounters for a colonoscopy. Another Encounter of which this encounter is a part of (administratively or in time). An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. planned | arrived | triaged | in-progress | onleave | finished | cancelled +. The time that the episode was in the specified status. An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. inpatient | outpatient | ambulatory | emergency +. The time that the episode was in the specified class. An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. Role of participant in encounter. The period of time that the specified participant participated in the encounter. These can overlap or be sub-sets of the overall encounter's period. Persons involved in the encounter other than the patient. An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure. Role that this diagnosis has within the encounter (e.g. admission, billing, discharge …). Ranking of the diagnosis (for each role type). An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. Pre-admission identifier. The location/organization from which the patient came before admission. From where patient was admitted (physician referral, transfer). Whether this hospitalization is a readmission and why if known. Diet preferences reported by the patient. Special courtesies (VIP, board member). Any special requests that have been made for this hospitalization encounter, such as the provision of specific equipment or other things. Location/organization to which the patient is discharged. Category or kind of location after discharge. An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. The location where the encounter takes place. The status of the participants' presence at the specified location during the period specified. If the participant is no longer at the location, then the period will have an end date/time. This will be used to specify the required levels (bed/ward/room/etc.) desired to be recorded to simplify either messaging or query. Time period during which the patient was present at the location. Planned Active Reserved Completed The status of the location. If the element is present, it must have either a @value, an @id, or extensions Planned Arrived Triaged In Progress On Leave Finished Cancelled Entered in Error Unknown Current state of the encounter. If the element is present, it must have either a @value, an @id, or extensions The technical details of an endpoint that can be used for electronic services, such as for web services providing XDS.b or a REST endpoint for another FHIR server. This may include any security context information. The technical details of an endpoint that can be used for electronic services, such as for web services providing XDS.b or a REST endpoint for another FHIR server. This may include any security context information. If the element is present, it must have either a @value, an @id, or extensions Identifier for the organization that is used to identify the endpoint across multiple disparate systems. active | suspended | error | off | test. A coded value that represents the technical details of the usage of this endpoint, such as what WSDLs should be used in what way. (e.g. XDS.b/DICOM/cds-hook). A friendly name that this endpoint can be referred to with. The organization that manages this endpoint (even if technically another organization is hosting this in the cloud, it is the organization associated with the data). Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting. The interval during which the endpoint is expected to be operational. The payload type describes the acceptable content that can be communicated on the endpoint. The mime type to send the payload in - e.g. application/fhir+xml, application/fhir+json. If the mime type is not specified, then the sender could send any content (including no content depending on the connectionType). The uri that describes the actual end-point to connect to. Additional headers / information to send as part of the notification. Active Suspended Error Off Entered in error Test The status of the endpoint. If the element is present, it must have either a @value, an @id, or extensions This resource provides the insurance enrollment details to the insurer regarding a specified coverage. This resource provides the insurance enrollment details to the insurer regarding a specified coverage. If the element is present, it must have either a @value, an @id, or extensions The Response business identifier. The status of the resource instance. The date when this resource was created. The Insurer who is target of the request. The practitioner who is responsible for the services rendered to the patient. Patient Resource. Reference to the program or plan identification, underwriter or payor. This resource provides enrollment and plan details from the processing of an EnrollmentRequest resource. This resource provides enrollment and plan details from the processing of an EnrollmentRequest resource. If the element is present, it must have either a @value, an @id, or extensions The Response business identifier. The status of the resource instance. Original request resource reference. Processing status: error, complete. A description of the status of the adjudication. The date when the enclosed suite of services were performed or completed. The Insurer who produced this adjudicated response. The practitioner who is responsible for the services rendered to the patient. An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. If the element is present, it must have either a @value, an @id, or extensions The EpisodeOfCare may be known by different identifiers for different contexts of use, such as when an external agency is tracking the Episode for funding purposes. planned | waitlist | active | onhold | finished | cancelled. The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource). A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care. The list of diagnosis relevant to this episode of care. The patient who is the focus of this episode of care. The organization that has assumed the specific responsibilities for the specified duration. The interval during which the managing organization assumes the defined responsibility. Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals. The practitioner that is the care manager/care coordinator for this patient. The list of practitioners that may be facilitating this episode of care for specific purposes. The set of accounts that may be used for billing for this EpisodeOfCare. An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. planned | waitlist | active | onhold | finished | cancelled. The period during this EpisodeOfCare that the specific status applied. An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for. Role that this diagnosis has within the episode of care (e.g. admission, billing, discharge …). Ranking of the diagnosis (for each role type). Planned Waitlist Active On Hold Finished Cancelled Entered in Error The status of the episode of care. If the element is present, it must have either a @value, an @id, or extensions The EventDefinition resource provides a reusable description of when a particular event can occur. The EventDefinition resource provides a reusable description of when a particular event can occur. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this event definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this event definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the event definition is stored on different servers. A formal identifier that is used to identify this event definition when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the event definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the event definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the event definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the event definition. An explanatory or alternate title for the event definition giving additional information about its content. The status of this event definition. Enables tracking the life-cycle of the content. A Boolean value to indicate that this event definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. A code or group definition that describes the intended subject of the event definition. The date (and optionally time) when the event definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the event definition changes. The name of the organization or individual that published the event definition. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the event definition from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate event definition instances. A legal or geographic region in which the event definition is intended to be used. Explanation of why this event definition is needed and why it has been designed as it has. A detailed description of how the event definition is used from a clinical perspective. A copyright statement relating to the event definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the event definition. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the event definition content was or is planned to be in active use. Descriptive topics related to the module. Topics provide a high-level categorization of the module that can be useful for filtering and searching. An individiual or organization primarily involved in the creation and maintenance of the content. An individual or organization primarily responsible for internal coherence of the content. An individual or organization primarily responsible for review of some aspect of the content. An individual or organization responsible for officially endorsing the content for use in some setting. Related resources such as additional documentation, justification, or bibliographic references. The trigger element defines when the event occurs. If more than one trigger condition is specified, the event fires whenever any one of the trigger conditions is met. The Evidence resource describes the conditional state (population and any exposures being compared within the population) and outcome (if specified) that the knowledge (evidence, assertion, recommendation) is about. The Evidence resource describes the conditional state (population and any exposures being compared within the population) and outcome (if specified) that the knowledge (evidence, assertion, recommendation) is about. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this evidence when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this evidence is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the evidence is stored on different servers. A formal identifier that is used to identify this evidence when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the evidence when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the evidence author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts. A natural language name identifying the evidence. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the evidence. The short title provides an alternate title for use in informal descriptive contexts where the full, formal title is not necessary. An explanatory or alternate title for the Evidence giving additional information about its content. The status of this evidence. Enables tracking the life-cycle of the content. The date (and optionally time) when the evidence was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the evidence changes. The name of the organization or individual that published the evidence. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the evidence from a consumer's perspective. A human-readable string to clarify or explain concepts about the resource. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate evidence instances. A legal or geographic region in which the evidence is intended to be used. A copyright statement relating to the evidence and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the evidence. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the evidence content was or is planned to be in active use. Descriptive topics related to the content of the Evidence. Topics provide a high-level categorization grouping types of Evidences that can be useful for filtering and searching. An individiual or organization primarily involved in the creation and maintenance of the content. An individual or organization primarily responsible for internal coherence of the content. An individual or organization primarily responsible for review of some aspect of the content. An individual or organization responsible for officially endorsing the content for use in some setting. Related artifacts such as additional documentation, justification, or bibliographic references. A reference to a EvidenceVariable resource that defines the population for the research. A reference to a EvidenceVariable resource that defines the exposure for the research. A reference to a EvidenceVariable resomece that defines the outcome for the research. The EvidenceVariable resource describes a "PICO" element that knowledge (evidence, assertion, recommendation) is about. The EvidenceVariable resource describes a "PICO" element that knowledge (evidence, assertion, recommendation) is about. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this evidence variable when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this evidence variable is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the evidence variable is stored on different servers. A formal identifier that is used to identify this evidence variable when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the evidence variable when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the evidence variable author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts. A natural language name identifying the evidence variable. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the evidence variable. The short title provides an alternate title for use in informal descriptive contexts where the full, formal title is not necessary. An explanatory or alternate title for the EvidenceVariable giving additional information about its content. The status of this evidence variable. Enables tracking the life-cycle of the content. The date (and optionally time) when the evidence variable was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the evidence variable changes. The name of the organization or individual that published the evidence variable. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the evidence variable from a consumer's perspective. A human-readable string to clarify or explain concepts about the resource. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate evidence variable instances. A legal or geographic region in which the evidence variable is intended to be used. A copyright statement relating to the evidence variable and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the evidence variable. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the evidence variable content was or is planned to be in active use. Descriptive topics related to the content of the EvidenceVariable. Topics provide a high-level categorization grouping types of EvidenceVariables that can be useful for filtering and searching. An individiual or organization primarily involved in the creation and maintenance of the content. An individual or organization primarily responsible for internal coherence of the content. An individual or organization primarily responsible for review of some aspect of the content. An individual or organization responsible for officially endorsing the content for use in some setting. Related artifacts such as additional documentation, justification, or bibliographic references. The type of evidence element, a population, an exposure, or an outcome. A characteristic that defines the members of the evidence element. Multiple characteristics are applied with "and" semantics. The EvidenceVariable resource describes a "PICO" element that knowledge (evidence, assertion, recommendation) is about. A short, natural language description of the characteristic that could be used to communicate the criteria to an end-user. Define members of the evidence element using Codes (such as condition, medication, or observation), Expressions ( using an expression language such as FHIRPath or CQL) or DataRequirements (such as Diabetes diagnosis onset in the last year). Use UsageContext to define the members of the population, such as Age Ranges, Genders, Settings. When true, members with this characteristic are excluded from the element. Indicates what effective period the study covers. Indicates duration from the participant's study entry. Indicates how elements are aggregated within the study effective period. Dichotomous Continuous Descriptive The possible types of variables for exposures or outcomes (E.g. Dichotomous, Continuous, Descriptive). If the element is present, it must have either a @value, an @id, or extensions Mean Median Mean of Study Means Mean of Study Medins Median of Study Means Median of Study Medians Possible group measure aggregates (E.g. Mean, Median). If the element is present, it must have either a @value, an @id, or extensions Example of workflow instance. Example of workflow instance. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this example scenario when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this example scenario is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the example scenario is stored on different servers. A formal identifier that is used to identify this example scenario when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the example scenario when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the example scenario author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the example scenario. This name should be usable as an identifier for the module by machine processing applications such as code generation. The status of this example scenario. Enables tracking the life-cycle of the content. A Boolean value to indicate that this example scenario is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the example scenario was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the example scenario changes. (e.g. the 'content logical definition'). The name of the organization or individual that published the example scenario. Contact details to assist a user in finding and communicating with the publisher. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate example scenario instances. A legal or geographic region in which the example scenario is intended to be used. A copyright statement relating to the example scenario and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the example scenario. What the example scenario resource is created for. This should not be used to show the business purpose of the scenario itself, but the purpose of documenting a scenario. Actor participating in the resource. Each resource and each version that is present in the workflow. Each major process - a group of operations. Another nested workflow. Example of workflow instance. ID or acronym of actor. The type of actor - person or system. The name of the actor as shown in the page. The description of the actor. Example of workflow instance. The id of the resource for referencing. The type of the resource. A short name for the resource instance. Human-friendly description of the resource instance. A specific version of the resource. Resources contained in the instance (e.g. the observations contained in a bundle). Example of workflow instance. The identifier of a specific version of a resource. The description of the resource version. Example of workflow instance. Each resource contained in the instance. A specific version of a resource contained in the instance. Example of workflow instance. The diagram title of the group of operations. A longer description of the group of operations. Description of initial status before the process starts. Description of final status after the process ends. Each step of the process. Example of workflow instance. Nested process. If there is a pause in the flow. Each interaction or action. Indicates an alternative step that can be taken instead of the operations on the base step in exceptional/atypical circumstances. Example of workflow instance. The sequential number of the interaction, e.g. 1.2.5. The type of operation - CRUD. The human-friendly name of the interaction. Who starts the transaction. Who receives the transaction. A comment to be inserted in the diagram. Whether the initiator is deactivated right after the transaction. Whether the receiver is deactivated right after the transaction. Each resource instance used by the initiator. Each resource instance used by the responder. Example of workflow instance. The label to display for the alternative that gives a sense of the circumstance in which the alternative should be invoked. A human-readable description of the alternative explaining when the alternative should occur rather than the base step. What happens in each alternative option. Person System The type of actor - system or human. If the element is present, it must have either a @value, an @id, or extensions Account Account Cuenta 账户 ActivityDefinition ActivityDefinition DefinizioneAttivita DefinicionDeActividad 活动定义 AdverseEvent AdverseEvent EventoAvverso EventoAdverso 不良事件 AllergyIntolerance AllergyIntolerance AllergiaIntolleranza IntoléranceAllergique AllergiaIntolerancia 变态反应与不耐性 Appointment Appointment Appuntamento RendezVous Cita 预约 AppointmentResponse AppointmentResponse RispostaAppuntamento RéponseRendezVous CitaRespuesta 预约响应 AuditEvent AuditEvent ÉvènementSécurité EventoSeguridad 审计事件 Basic Basic Basique Basico 初级资源 Binary Binary Binario Binaire Binario 二进制资源 BiologicallyDerivedProduct BiologicallyDerivedProduct BodyStructure BodyStructure StrutturaDelCorpo MorphologieDeCorps EstructuraDelCuerpo 身体结构 Bundle Bundle Paquet Paquete 捆束 CapabilityStatement CapabilityStatement DeclaracionDeCapacidad 能力声明 CarePlan CarePlan PianoDiCura PlanDeSoins PlanDeCuidado 照护计划 CareTeam CareTeam EquipoDeCuidado 照护团队 CatalogEntry CatalogEntry EntradaDeCatalogo 条目定义 ChargeItem ChargeItem CargoDeItem 收费项目 ChargeItemDefinition ChargeItemDefinition Claim Claim Réclamation Reclamación / Factura 赔单 ClaimResponse ClaimResponse RéponseARéclamation 赔单请求 ClinicalImpression ClinicalImpression ImpressioneClinica ImpressionClinique HallazgoClinico 临床印象 CodeSystem CodeSystem SistemaDiCodifica SistemaDeCodigos 代码系统 Communication Communication Comunicazione Communication Comunicación 通讯 CommunicationRequest CommunicationRequest RichiestaDiComunicazione DemandeDeCommunication ComunicaciónRequerimiento 通讯请求 CompartmentDefinition CompartmentDefinition DefinicionDeCompartimento 逻辑区块定义 Composition Composition Composizione Composition Composición 组合式文书 ConceptMap ConceptMap MappaDiConcetti CarteDeConcepts MapaDeConceptos 概念映射 Condition Condition Condizione Condition Condición 情况 Consent Consent Consenso Consentimiento 同意书 Contract Contract Contratto Contrat Contato 合同 Coverage Coverage Copertura Couverture Cobertura 保险责任 CoverageEligibilityRequest CoverageEligibilityRequest RichiestaEleggibilitaCopertura CouvertureDemandeEligibilité 资格请求 CoverageEligibilityResponse CoverageEligibilityResponse RispostaEleggibilitaCopertura RéponseEligibilitéCouverture 资格响应 DetectedIssue DetectedIssue ProblemaRilevato Problème Détecté Problema-Detectado /ProblemaDetectado 已发现问题 Device Device Dispositivo Dispositif Dispositivo 装置 DeviceDefinition DeviceDefinition DéfinitionDeDispositif DefiniciónDeDispositivo 装置组件 DeviceMetric DeviceMetric MétriqueDispositif MetricaDeDispositivo 装置指标 DeviceRequest DeviceRequest RichiestaDispositivo DemandeUtilisationDispositif SolicitudDeDispositivo 装置请求 DeviceUseStatement DeviceUseStatement 装置使用声明 DiagnosticReport DiagnosticReport RefertoDiagnostico RapportDiagnostique 诊断报告 InformeDiagnostico DocumentManifest DocumentManifest Manifeste 文档清单 ManifestoDocumento DocumentReference DocumentReference RiferimentoDocumento RéférenceDocument ReferenciaDocumento 文档引用 DomainResource DomainResource RecursoDeDominio 领域资源 EffectEvidenceSynthesis EffectEvidenceSynthesis Encounter Encounter Venue 就医过程 Encuentro Endpoint Endpoint Endpoint 端点 EnrollmentRequest EnrollmentRequest RichiestaIscrizione DemandeInscription SolicitudDeEnrolamiento 保险注册请求 EnrollmentResponse EnrollmentResponse RispostaIscrizione RéponseInscription RespuestaDeEnrolamiento 保险注册响应 EpisodeOfCare EpisodeOfCare EpisodioDiCura ÉpisodeDeSoins EpisodioDeCuidado 照护服务节段 EventDefinition EventDefinition DefinizioneEvento DefinitionDeEvento 事件定义 Evidence Evidence EvidenceVariable EvidenceVariable ExampleScenario ExampleScenario ScenarioDiEsempio EjemploDeEscenario 示例场景 ExplanationOfBenefit ExplanationOfBenefit ExplicationDuBénéfice 赔付说明 FamilyMemberHistory FamilyMemberHistory HistoireMembreFamille HistorialMiembroFamiliar 家族史 Flag Flag Drapeau Bandera 标记 Goal Goal But Objetivo 目标 GraphDefinition GraphDefinition DefinitionGrafico 图形定义 Group Group Gruppo Groupe Grupo 群组 GuidanceResponse GuidanceResponse RespuestaDeOrientacion 指导意见响应 HealthcareService HealthcareService ServizioSanitario ServiceDeSanté ServicioDeCuidado 医疗保健服务项目 ImagingStudy ImagingStudy EtudeImagerie EstudioImagen / EstudioImagen 成像检查 Immunization Immunization Immunizzazione Immunisation 免疫接种 Inmunización ImmunizationEvaluation ImmunizationEvaluation ImmunizationRecommendation ImmunizationRecommendation RecommendationImmunisation 免疫接种建议 RecomendaciónInmunización / ImplementationGuide ImplementationGuide GuiaDeImplementacion 实施指南 InsurancePlan InsurancePlan Invoice Invoice Library Library Librería Linkage Linkage Enlace / Conexión / Vinculo / Acoplamiento 链接关系 List List Lista Liste 列表 Lista Location Location Localisation 位置 Locacion Measure Measure Misura Medida 指标 MeasureReport MeasureReport ReporteMedida 指标报告 Media Media Media Média Medio 媒体 Medication Medication Médication 药物 Medicación /Medicamento MedicationAdministration MedicationAdministration AdministrationMédicaments 药物施用 AdministraciónMedicación / AdministracionMedicamento MedicationDispense MedicationDispense DispensationMédicaments 药物配发 DispensaciónMedicación /DispensacionMedicamento MedicationKnowledge MedicationKnowledge MedicationRequest MedicationRequest PrescriptionMédicamenteuseTODO 药物请求 PrescripciónMedicaciónTODO /PrescripcionMedicamento MedicationStatement MedicationStatement ÉtatMédication 药物声明 ResumenMedicación /ResumenMedicamento MedicinalProduct MedicinalProduct ProdottoMedicinale MedicinalProductAuthorization MedicinalProductAuthorization AutorizzazioneProdottoMedicinale MedicinalProductContraindication MedicinalProductContraindication MedicinalProductIndication MedicinalProductInteraction MedicinalProductIngredient MedicinalProductIngredient IngredienteProdottoMedicinale MedicinalProductInteraction MedicinalProductInteraction MedicinalProductManufactured MedicinalProductManufactured MedicinalProductPackaged MedicinalProductPackaged MedicinalProductPharmaceutical MedicinalProductPharmaceutical MedicinalProductUndesirableEffect MedicinalProductUndesirableEffect MessageDefinition MessageDefinition DefinizioneMessaggio DefinicionMensaje 消息定义 MessageHeader MessageHeader EntêteMessage 消息标头 CabeceraMensaje MolecularSequence MolecularSequence SecuenciaMolecular 分子序列 NamingSystem NamingSystem SystèmeDeNommage SistemaDeNombres 命名系统 NutritionOrder NutritionOrder OrdreNutrition OrdenNutrición 营养医嘱 Observation Observation Osservazione Observation 观察 Observación ObservationDefinition ObservationDefinition DefinizioneOsservazione DefinicionDeEspecimen 观察定义 OperationDefinition OperationDefinition DefinizioneOperazione DéfinitionOpération DefinicionDeOperacion 操作定义 OperationOutcome OperationOutcome RisultatoOperazione RésultatOpération 操作结局 ResultadoOperación Organization Organization Organizzazione Organisation 组织机构 Organización OrganizationAffiliation OrganizationAffiliation Parameters Parameters Parametros 参数 Patient Patient Paziente Patient 患者 Paciente PaymentNotice PaymentNotice AvvisoDiPagamento AvisPaiement AvisoDePago 付款通知 PaymentReconciliation PaymentReconciliation RiconciliazionePagamento RéconciliationPaiement ConciliacionDePago 付款对账 Person Person Persona Personne Persona 人员 PlanDefinition PlanDefinition DefinicionDePlan 计划定义 Practitioner Practitioner Praticien 执业人员 Practicante / Profesional PractitionerRole PractitionerRole RolProfesional 执业人员角色 Procedure Procedure Procedura Procédure 操作项目 Procedimiento Provenance Provenance Provenienza Provenance 出处 Procedencia Questionnaire Questionnaire Questionario Questionnaire 调查问卷 Cuestionario QuestionnaireResponse QuestionnaireResponse RispostaQuestionario RéponseQuestionnaire RespuestaAlCuestionario 调查问卷答复 RelatedPerson RelatedPerson PersonaCorrelata PersonneEnRelation PersonaRelacionada 相关人员 RequestGroup RequestGroup GruppoDiRichieste GrupoDeSolicitudes 请求分组 ResearchDefinition ResearchDefinition ResearchElementDefinition ResearchElementDefinition ResearchStudy ResearchStudy EstudioDeInvestigacion 调查研究 ResearchSubject ResearchSubject SujetoDeInvestigacion 研究主题 Resource Resource Recurso 资源 RiskAssessment RiskAssessment ÉvaluationRisques EvaluacionDeRiesgo 风险评估 RiskEvidenceSynthesis RiskEvidenceSynthesis Schedule Schedule Agenda 日程安排 SearchParameter SearchParameter ParametroDiRicerca ParamètreRecherche ParametroDeBusqueda 搜索参数 ServiceRequest ServiceRequest RichiestaDiServizio DemandeService PeticiónServicio 服务项目请求 Slot Slot Slot 槽位 Hueco / Zocalo / Espacio Specimen Specimen Campione Spécimen 标本 Especimen SpecimenDefinition SpecimenDefinition DefinizioneCampione DefinicionDeEspecimen 标本定义 StructureDefinition StructureDefinition DefinizioneStruttura DéfinitionStructure DefinicionDeEstructura 结构定义 StructureMap StructureMap MapaDeEstructura 结构映射 Subscription Subscription Sottoscrizione Souscription 订阅 Suscripción Substance Substance Sostanza Substance 物质 Sustancia SubstanceNucleicAcid SubstanceNucleicAcid SubstancePolymer SubstancePolymer SubstanceProtein SubstanceProtein SubstanceReferenceInformation SubstanceReferenceInformation SubstanceSourceMaterial SubstanceSourceMaterial SubstanceSpecification SubstanceSpecification SupplyDelivery SupplyDelivery Supply Livraison 供应交付 Entrega de Suministro SupplyRequest SupplyRequest Demande d'approvisionnement 供应请求 Solicitud de Suministro Task Task Tarea 任务 TerminologyCapabilities TerminologyCapabilities CapacidadTerminologica 术语服务能力 TestReport TestReport RapportTest ReporteDePrueba 测试报告 TestScript TestScript ScriptTest ScriptDePrueba 测试脚本 ValueSet ValueSet EnsembleValeurs 取值集合 ConjuntoValores / ConjuntoDeValores VerificationResult VerificationResult VisionPrescription VisionPrescription PrescriptionVision PrescripcionDeVision 视力处方 The type of resource. If the element is present, it must have either a @value, an @id, or extensions This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this explanation of benefit. The status of the resource instance. The category of claim, e.g. oral, pharmacy, vision, institutional, professional. A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service. A code to indicate whether the nature of the request is: to request adjudication of products and services previously rendered; or requesting authorization and adjudication for provision in the future; or requesting the non-binding adjudication of the listed products and services which could be provided in the future. The party to whom the professional services and/or products have been supplied or are being considered and for whom actual for forecast reimbursement is sought. The period for which charges are being submitted. The date this resource was created. Individual who created the claim, predetermination or preauthorization. The party responsible for authorization, adjudication and reimbursement. The provider which is responsible for the claim, predetermination or preauthorization. The provider-required urgency of processing the request. Typical values include: stat, routine deferred. A code to indicate whether and for whom funds are to be reserved for future claims. A code, used only on a response to a preauthorization, to indicate whether the benefits payable have been reserved and for whom. Other claims which are related to this claim such as prior submissions or claims for related services or for the same event. Prescription to support the dispensing of pharmacy, device or vision products. Original prescription which has been superseded by this prescription to support the dispensing of pharmacy services, medications or products. The party to be reimbursed for cost of the products and services according to the terms of the policy. A reference to a referral resource. Facility where the services were provided. The business identifier for the instance of the adjudication request: claim predetermination or preauthorization. The business identifier for the instance of the adjudication response: claim, predetermination or preauthorization response. The outcome of the claim, predetermination, or preauthorization processing. A human readable description of the status of the adjudication. Reference from the Insurer which is used in later communications which refers to this adjudication. The timeframe during which the supplied preauthorization reference may be quoted on claims to obtain the adjudication as provided. The members of the team who provided the products and services. Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues. Information about diagnoses relevant to the claim items. Procedures performed on the patient relevant to the billing items with the claim. This indicates the relative order of a series of EOBs related to different coverages for the same suite of services. Financial instruments for reimbursement for the health care products and services specified on the claim. Details of a accident which resulted in injuries which required the products and services listed in the claim. A claim line. Either a simple (a product or service) or a 'group' of details which can also be a simple items or groups of sub-details. The first-tier service adjudications for payor added product or service lines. The adjudication results which are presented at the header level rather than at the line-item or add-item levels. Categorized monetary totals for the adjudication. Payment details for the adjudication of the claim. A code for the form to be used for printing the content. The actual form, by reference or inclusion, for printing the content or an EOB. A note that describes or explains adjudication results in a human readable form. The term of the benefits documented in this response. Balance by Benefit Category. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. Reference to a related claim. A code to convey how the claims are related. An alternate organizational reference to the case or file to which this particular claim pertains. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. Type of Party to be reimbursed: Subscriber, provider, other. Reference to the individual or organization to whom any payment will be made. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. A number to uniquely identify care team entries. Member of the team who provided the product or service. The party who is billing and/or responsible for the claimed products or services. The lead, assisting or supervising practitioner and their discipline if a multidisciplinary team. The qualification of the practitioner which is applicable for this service. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. A number to uniquely identify supporting information entries. The general class of the information supplied: information; exception; accident, employment; onset, etc. System and code pertaining to the specific information regarding special conditions relating to the setting, treatment or patient for which care is sought. The date when or period to which this information refers. Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data. Provides the reason in the situation where a reason code is required in addition to the content. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. A number to uniquely identify diagnosis entries. The nature of illness or problem in a coded form or as a reference to an external defined Condition. When the condition was observed or the relative ranking. Indication of whether the diagnosis was present on admission to a facility. A package billing code or bundle code used to group products and services to a particular health condition (such as heart attack) which is based on a predetermined grouping code system. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. A number to uniquely identify procedure entries. When the condition was observed or the relative ranking. Date and optionally time the procedure was performed. The code or reference to a Procedure resource which identifies the clinical intervention performed. Unique Device Identifiers associated with this line item. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. A flag to indicate that this Coverage is to be used for adjudication of this claim when set to true. Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system. Reference numbers previously provided by the insurer to the provider to be quoted on subsequent claims containing services or products related to the prior authorization. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. Date of an accident event related to the products and services contained in the claim. The type or context of the accident event for the purposes of selection of potential insurance coverages and determination of coordination between insurers. The physical location of the accident event. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. A number to uniquely identify item entries. Care team members related to this service or product. Diagnoses applicable for this service or product. Procedures applicable for this service or product. Exceptions, special conditions and supporting information applicable for this service or product. The type of revenue or cost center providing the product and/or service. Code to identify the general type of benefits under which products and services are provided. When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. Identifies the program under which this may be recovered. The date or dates when the service or product was supplied, performed or completed. Where the product or service was provided. The number of repetitions of a service or product. If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group. A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. The quantity times the unit price for an additional service or product or charge. Unique Device Identifiers associated with this line item. Physical service site on the patient (limb, tooth, etc.). A region or surface of the bodySite, e.g. limb region or tooth surface(s). A billed item may include goods or services provided in multiple encounters. The numbers associated with notes below which apply to the adjudication of this item. If this item is a group then the values here are a summary of the adjudication of the detail items. If this item is a simple product or service then this is the result of the adjudication of this item. Second-tier of goods and services. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. A code to indicate the information type of this adjudication record. Information types may include: the value submitted, maximum values or percentages allowed or payable under the plan, amounts that the patient is responsible for in-aggregate or pertaining to this item, amounts paid by other coverages, and the benefit payable for this item. A code supporting the understanding of the adjudication result and explaining variance from expected amount. Monetary amount associated with the category. A non-monetary value associated with the category. Mutually exclusive to the amount element above. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. A claim detail line. Either a simple (a product or service) or a 'group' of sub-details which are simple items. The type of revenue or cost center providing the product and/or service. Code to identify the general type of benefits under which products and services are provided. When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. Identifies the program under which this may be recovered. The number of repetitions of a service or product. If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group. A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. The quantity times the unit price for an additional service or product or charge. Unique Device Identifiers associated with this line item. The numbers associated with notes below which apply to the adjudication of this item. The adjudication results. Third-tier of goods and services. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. A claim detail line. Either a simple (a product or service) or a 'group' of sub-details which are simple items. The type of revenue or cost center providing the product and/or service. Code to identify the general type of benefits under which products and services are provided. When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. Identifies the program under which this may be recovered. The number of repetitions of a service or product. If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group. A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. The quantity times the unit price for an additional service or product or charge. Unique Device Identifiers associated with this line item. The numbers associated with notes below which apply to the adjudication of this item. The adjudication results. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. Claim items which this service line is intended to replace. The sequence number of the details within the claim item which this line is intended to replace. The sequence number of the sub-details woithin the details within the claim item which this line is intended to replace. The providers who are authorized for the services rendered to the patient. When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. Identifies the program under which this may be recovered. The date or dates when the service or product was supplied, performed or completed. Where the product or service was provided. The number of repetitions of a service or product. If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group. A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. The quantity times the unit price for an additional service or product or charge. Physical service site on the patient (limb, tooth, etc.). A region or surface of the bodySite, e.g. limb region or tooth surface(s). The numbers associated with notes below which apply to the adjudication of this item. The adjudication results. The second-tier service adjudications for payor added services. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. The number of repetitions of a service or product. If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group. A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. The quantity times the unit price for an additional service or product or charge. The numbers associated with notes below which apply to the adjudication of this item. The adjudication results. The third-tier service adjudications for payor added services. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item. Item typification or modifiers codes to convey additional context for the product or service. The number of repetitions of a service or product. If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group. A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. The quantity times the unit price for an additional service or product or charge. The numbers associated with notes below which apply to the adjudication of this item. The adjudication results. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. A code to indicate the information type of this adjudication record. Information types may include: the value submitted, maximum values or percentages allowed or payable under the plan, amounts that the patient is responsible for in aggregate or pertaining to this item, amounts paid by other coverages, and the benefit payable for this item. Monetary total amount associated with the category. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. Whether this represents partial or complete payment of the benefits payable. Total amount of all adjustments to this payment included in this transaction which are not related to this claim's adjudication. Reason for the payment adjustment. Estimated date the payment will be issued or the actual issue date of payment. Benefits payable less any payment adjustment. Issuer's unique identifier for the payment instrument. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. A number to uniquely identify a note entry. The business purpose of the note text. The explanation or description associated with the processing. A code to define the language used in the text of the note. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. Code to identify the general type of benefits under which products and services are provided. True if the indicated class of service is excluded from the plan, missing or False indicates the product or service is included in the coverage. A short name or tag for the benefit. A richer description of the benefit or services covered. Is a flag to indicate whether the benefits refer to in-network providers or out-of-network providers. Indicates if the benefits apply to an individual or to the family. The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual visits'. Benefits Used to date. This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. Classification of benefit being provided. The quantity of the benefit which is permitted under the coverage. The quantity of the benefit which have been consumed to date. Active Cancelled Draft Entered In Error A code specifying the state of the resource instance. If the element is present, it must have either a @value, an @id, or extensions Significant health conditions for a person related to the patient relevant in the context of care for the patient. Significant health conditions for a person related to the patient relevant in the context of care for the patient. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this family member history by the performer or other systems which remain constant as the resource is updated and propagates from server to server. The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory. The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory. A code specifying the status of the record of the family history of a specific family member. Describes why the family member's history is not available. The person who this history concerns. The date (and possibly time) when the family member history was recorded or last updated. This will either be a name or a description; e.g. "Aunt Susan", "my cousin with the red hair". The type of relationship this person has to the patient (father, mother, brother etc.). The birth sex of the family member. The actual or approximate date of birth of the relative. The age of the relative at the time the family member history is recorded. If true, indicates that the age value specified is an estimated value. Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record. Describes why the family member history occurred in coded or textual form. Indicates a Condition, Observation, AllergyIntolerance, or QuestionnaireResponse that justifies this family member history event. This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible. The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition. Significant health conditions for a person related to the patient relevant in the context of care for the patient. The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system. Indicates what happened following the condition. If the condition resulted in death, deceased date is captured on the relation. This condition contributed to the cause of death of the related person. If contributedToDeath is not populated, then it is unknown. Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence. An area where general notes can be placed about this specific condition. Partial Completed Entered in Error Health Unknown A code that identifies the status of the family history record. If the element is present, it must have either a @value, an @id, or extensions Prospective warnings of potential issues when providing care to the patient. Prospective warnings of potential issues when providing care to the patient. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this flag by the performer or other systems which remain constant as the resource is updated and propagates from server to server. Supports basic workflow. Allows a flag to be divided into different categories like clinical, administrative etc. Intended to be used as a means of filtering which flags are displayed to particular user or in a given context. The coded value or textual component of the flag to display to the user. The patient, location, group, organization, or practitioner etc. this is about record this flag is associated with. The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified. This alert is only relevant during the encounter. The person, organization or device that created the flag. Active Inactive Entered in Error Indicates whether this flag is active and needs to be displayed to a user, or whether it is no longer needed or was entered in error. If the element is present, it must have either a @value, an @id, or extensions Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc. Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this goal by the performer or other systems which remain constant as the resource is updated and propagates from server to server. The state of the goal throughout its lifecycle. Describes the progression, or lack thereof, towards the goal against the target. Indicates a category the goal falls within. Identifies the mutually agreed level of importance associated with reaching/sustaining the goal. Human-readable and/or coded description of a specific desired objective of care, such as "control blood pressure" or "negotiate an obstacle course" or "dance with child at wedding". Identifies the patient, group or organization for whom the goal is being established. The date or event after which the goal should begin being pursued. Indicates what should be done by when. Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc. Captures the reason for the current status. Indicates whose goal this is - patient goal, practitioner goal, etc. The identified conditions and other health record elements that are intended to be addressed by the goal. Any comments related to the goal. Identifies the change (or lack of change) at the point when the status of the goal is assessed. Details of what's changed (or not changed). Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc. The parameter whose value is being tracked, e.g. body weight, blood pressure, or hemoglobin A1c level. The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value. Indicates either the date or the duration after start by which the goal should be met. Proposed Planned Accepted Active On Hold Completed Cancelled Entered in Error Rejected Codes that reflect the current state of a goal and whether the goal is still being targeted. If the element is present, it must have either a @value, an @id, or extensions A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set. A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this graph definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this graph definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the graph definition is stored on different servers. The identifier that is used to identify this version of the graph definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the graph definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the graph definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. The status of this graph definition. Enables tracking the life-cycle of the content. A Boolean value to indicate that this graph definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the graph definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the graph definition changes. The name of the organization or individual that published the graph definition. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the graph definition from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate graph definition instances. A legal or geographic region in which the graph definition is intended to be used. Explanation of why this graph definition is needed and why it has been designed as it has. The type of FHIR resource at which instances of this graph start. The profile that describes the use of the base resource. Links this graph makes rules about. A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set. A FHIR expression that identifies one of FHIR References to other resources. Which slice (if profiled). Minimum occurrences for this link. Maximum occurrences for this link. Information about why this link is of interest in this graph definition. Potential target for the link. A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set. Type of resource this link refers to. A set of parameters to look up. Profile for the target resource. Compartment Consistency Rules. Additional links from target resource. A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set. Defines how the compartment rule is used - whether it it is used to test whether resources are subject to the rule, or whether it is a rule that must be followed. Identifies the compartment. identical | matching | different | no-rule | custom. Custom rule, as a FHIRPath expression. Documentation for FHIRPath expression. Condition Requirement Defines how a compartment rule is used. If the element is present, it must have either a @value, an @id, or extensions Identical Matching Different Custom How a compartment must be linked. If the element is present, it must have either a @value, an @id, or extensions Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively, and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization. Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively, and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization. If the element is present, it must have either a @value, an @id, or extensions A unique business identifier for this group. Indicates whether the record for the group is available for use or is merely being retained for historical purposes. Identifies the broad classification of the kind of resources the group includes. If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals. Provides a specific type of resource the group includes; e.g. "cow", "syringe", etc. A label assigned to the group for human identification and communication. A count of the number of resource instances that are part of the group. Entity responsible for defining and maintaining Group characteristics and/or registered members. Identifies traits whose presence r absence is shared by members of the group. Identifies the resource instances that are members of the group. Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively, and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization. A code that identifies the kind of trait being asserted. The value of the trait that holds (or does not hold - see 'exclude') for members of the group. If true, indicates the characteristic is one that is NOT held by members of the group. The period over which the characteristic is tested; e.g. the patient had an operation during the month of June. Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively, and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization. A reference to the entity that is a member of the group. Must be consistent with Group.type. If the entity is another group, then the type must be the same. The period that the member was in the group, if known. A flag to indicate that the member is no longer in the group, but previously may have been a member. Person Animal Practitioner Device Medication Substance Types of resources that are part of group. If the element is present, it must have either a @value, an @id, or extensions A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken. A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken. If the element is present, it must have either a @value, an @id, or extensions The identifier of the request associated with this response. If an identifier was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario. Allows a service to provide unique, business identifiers for the response. An identifier, CodeableConcept or canonical reference to the guidance that was requested. The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information. The patient for which the request was processed. The encounter during which this response was created or to which the creation of this record is tightly associated. Indicates when the guidance response was processed. Provides a reference to the device that performed the guidance. Describes the reason for the guidance response in coded or textual form. Indicates the reason the request was initiated. This is typically provided as a parameter to the evaluation and echoed by the service, although for some use cases, such as subscription- or event-based scenarios, it may provide an indication of the cause for the response. Provides a mechanism to communicate additional information about the response. Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element. The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element. The actions, if any, produced by the evaluation of the artifact. If the evaluation could not be completed due to lack of information, or additional information would potentially result in a more accurate response, this element will a description of the data required in order to proceed with the evaluation. A subsequent request to the service should include this data. Success Data Requested Data Required In Progress Failure Entered In Error The status of a guidance response. If the element is present, it must have either a @value, an @id, or extensions The details of a healthcare service available at a location. The details of a healthcare service available at a location. If the element is present, it must have either a @value, an @id, or extensions External identifiers for this item. This flag is used to mark the record to not be used. This is not used when a center is closed for maintenance, or for holidays, the notAvailable period is to be used for this. The organization that provides this healthcare service. Identifies the broad category of service being performed or delivered. The specific type of service that may be delivered or performed. Collection of specialties handled by the service site. This is more of a medical term. The location(s) where this healthcare service may be provided. Further description of the service as it would be presented to a consumer while searching. Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName. Extra details about the service that can't be placed in the other fields. If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list. List of contacts related to this specific healthcare service. The location(s) that this service is available to (not where the service is provided). The code(s) that detail the conditions under which the healthcare service is available/offered. Does this service have specific eligibility requirements that need to be met in order to use the service? Programs that this service is applicable to. Collection of characteristics (attributes). Some services are specifically made available in multiple languages, this property permits a directory to declare the languages this is offered in. Typically this is only provided where a service operates in communities with mixed languages used. Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required. Indicates whether or not a prospective consumer will require an appointment for a particular service at a site to be provided by the Organization. Indicates if an appointment is required for access to this service. A collection of times that the Service Site is available. The HealthcareService is not available during this period of time due to the provided reason. A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times. Technical endpoints providing access to services operated for the specific healthcare services defined at this resource. The details of a healthcare service available at a location. Coded value for the eligibility. Describes the eligibility conditions for the service. The details of a healthcare service available at a location. Indicates which days of the week are available between the start and end Times. Is this always available? (hence times are irrelevant) e.g. 24 hour service. The opening time of day. Note: If the AllDay flag is set, then this time is ignored. The closing time of day. Note: If the AllDay flag is set, then this time is ignored. The details of a healthcare service available at a location. The reason that can be presented to the user as to why this time is not available. Service is not available (seasonally or for a public holiday) from this date. Monday Tuesday Wednesday Thursday Friday Saturday Sunday The days of the week. If the element is present, it must have either a @value, an @id, or extensions Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities. Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities. If the element is present, it must have either a @value, an @id, or extensions Identifiers for the ImagingStudy such as DICOM Study Instance UID, and Accession Number. The current state of the ImagingStudy. A list of all the series.modality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19). The subject, typically a patient, of the imaging study. The healthcare event (e.g. a patient and healthcare provider interaction) during which this ImagingStudy is made. Date and time the study started. A list of the diagnostic requests that resulted in this imaging study being performed. The requesting/referring physician. Who read the study and interpreted the images or other content. The network service providing access (e.g., query, view, or retrieval) for the study. See implementation notes for information about using DICOM endpoints. A study-level endpoint applies to each series in the study, unless overridden by a series-level endpoint with the same Endpoint.connectionType. Number of Series in the Study. This value given may be larger than the number of series elements this Resource contains due to resource availability, security, or other factors. This element should be present if any series elements are present. Number of SOP Instances in Study. This value given may be larger than the number of instance elements this resource contains due to resource availability, security, or other factors. This element should be present if any instance elements are present. The procedure which this ImagingStudy was part of. The code for the performed procedure type. The principal physical location where the ImagingStudy was performed. Description of clinical condition indicating why the ImagingStudy was requested. Indicates another resource whose existence justifies this Study. Per the recommended DICOM mapping, this element is derived from the Study Description attribute (0008,1030). Observations or findings about the imaging study should be recorded in another resource, e.g. Observation, and not in this element. The Imaging Manager description of the study. Institution-generated description or classification of the Study (component) performed. Each study has one or more series of images or other content. Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities. The DICOM Series Instance UID for the series. The numeric identifier of this series in the study. The modality of this series sequence. A description of the series. Number of SOP Instances in the Study. The value given may be larger than the number of instance elements this resource contains due to resource availability, security, or other factors. This element should be present if any instance elements are present. The network service providing access (e.g., query, view, or retrieval) for this series. See implementation notes for information about using DICOM endpoints. A series-level endpoint, if present, has precedence over a study-level endpoint with the same Endpoint.connectionType. The anatomic structures examined. See DICOM Part 16 Annex L (http://dicom.nema.org/medical/dicom/current/output/chtml/part16/chapter_L.html) for DICOM to SNOMED-CT mappings. The bodySite may indicate the laterality of body part imaged; if so, it shall be consistent with any content of ImagingStudy.series.laterality. The laterality of the (possibly paired) anatomic structures examined. E.g., the left knee, both lungs, or unpaired abdomen. If present, shall be consistent with any laterality information indicated in ImagingStudy.series.bodySite. The specimen imaged, e.g., for whole slide imaging of a biopsy. The date and time the series was started. Indicates who or what performed the series and how they were involved. A single SOP instance within the series, e.g. an image, or presentation state. Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities. Distinguishes the type of involvement of the performer in the series. Indicates who or what performed the series. Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities. The DICOM SOP Instance UID for this image or other DICOM content. DICOM instance type. The number of instance in the series. The description of the instance. Registered Available Cancelled Entered in Error Unknown The status of the ImagingStudy. If the element is present, it must have either a @value, an @id, or extensions Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party. Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this immunization record. Indicates the current status of the immunization event. Indicates the reason the immunization event was not performed. Vaccine that was administered or was to be administered. The patient who either received or did not receive the immunization. The visit or admission or other contact between patient and health care provider the immunization was performed as part of. Date vaccine administered or was to be administered. The date the occurrence of the immunization was first captured in the record - potentially significantly after the occurrence of the event. An indication that the content of the record is based on information from the person who administered the vaccine. This reflects the context under which the data was originally recorded. The source of the data when the report of the immunization event is not based on information from the person who administered the vaccine. The service delivery location where the vaccine administration occurred. Name of vaccine manufacturer. Lot number of the vaccine product. Date vaccine batch expires. Body site where vaccine was administered. The path by which the vaccine product is taken into the body. The quantity of vaccine product that was administered. Indicates who performed the immunization event. Extra information about the immunization that is not conveyed by the other attributes. Reasons why the vaccine was administered. Condition, Observation or DiagnosticReport that supports why the immunization was administered. Indication if a dose is considered to be subpotent. By default, a dose should be considered to be potent. Reason why a dose is considered to be subpotent. Educational material presented to the patient (or guardian) at the time of vaccine administration. Indicates a patient's eligibility for a funding program. Indicates the source of the vaccine actually administered. This may be different than the patient eligibility (e.g. the patient may be eligible for a publically purchased vaccine but due to inventory issues, vaccine purchased with private funds was actually administered). Categorical data indicating that an adverse event is associated in time to an immunization. The protocol (set of recommendations) being followed by the provider who administered the dose. Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party. Describes the type of performance (e.g. ordering provider, administering provider, etc.). The practitioner or organization who performed the action. Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party. Identifier of the material presented to the patient. Reference pointer to the educational material given to the patient if the information was on line. Date the educational material was published. Date the educational material was given to the patient. Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party. Date of reaction to the immunization. Details of the reaction. Self-reported indicator. Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party. One possible path to achieve presumed immunity against a disease - within the context of an authority. Indicates the authority who published the protocol (e.g. ACIP) that is being followed. The vaccine preventable disease the dose is being administered against. Nominal position in a series. The recommended number of doses to achieve immunity. Completed Entered in Error Not Done A set of codes indicating the current status of an Immunization. If the element is present, it must have either a @value, an @id, or extensions Describes a comparison of an immunization event against published recommendations to determine if the administration is "valid" in relation to those recommendations. Describes a comparison of an immunization event against published recommendations to determine if the administration is "valid" in relation to those recommendations. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this immunization evaluation record. Indicates the current status of the evaluation of the vaccination administration event. The individual for whom the evaluation is being done. The date the evaluation of the vaccine administration event was performed. Indicates the authority who published the protocol (e.g. ACIP). The vaccine preventable disease the dose is being evaluated against. The vaccine administration event being evaluated. Indicates if the dose is valid or not valid with respect to the published recommendations. Provides an explanation as to why the vaccine administration event is valid or not relative to the published recommendations. Additional information about the evaluation. One possible path to achieve presumed immunity against a disease - within the context of an authority. Nominal position in a series. The recommended number of doses to achieve immunity. Completed Entered in Error The status of the evaluation being done. If the element is present, it must have either a @value, an @id, or extensions A patient's point-in-time set of recommendations (i.e. forecasting) according to a published schedule with optional supporting justification. A patient's point-in-time set of recommendations (i.e. forecasting) according to a published schedule with optional supporting justification. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this particular recommendation record. The patient the recommendation(s) are for. The date the immunization recommendation(s) were created. Indicates the authority who published the protocol (e.g. ACIP). Vaccine administration recommendations. A patient's point-in-time set of recommendations (i.e. forecasting) according to a published schedule with optional supporting justification. Vaccine(s) or vaccine group that pertain to the recommendation. The targeted disease for the recommendation. Vaccine(s) which should not be used to fulfill the recommendation. Indicates the patient status with respect to the path to immunity for the target disease. The reason for the assigned forecast status. Vaccine date recommendations. For example, earliest date to administer, latest date to administer, etc. Contains the description about the protocol under which the vaccine was administered. One possible path to achieve presumed immunity against a disease - within the context of an authority. Nominal position of the recommended dose in a series (e.g. dose 2 is the next recommended dose). The recommended number of doses to achieve immunity. Immunization event history and/or evaluation that supports the status and recommendation. Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information. A patient's point-in-time set of recommendations (i.e. forecasting) according to a published schedule with optional supporting justification. Date classification of recommendation. For example, earliest date to give, latest date to give, etc. The date whose meaning is specified by dateCriterion.code. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this implementation guide is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the implementation guide is stored on different servers. The identifier that is used to identify this version of the implementation guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the implementation guide author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the implementation guide. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the implementation guide. The status of this implementation guide. Enables tracking the life-cycle of the content. A Boolean value to indicate that this implementation guide is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the implementation guide was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes. The name of the organization or individual that published the implementation guide. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the implementation guide from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate implementation guide instances. A legal or geographic region in which the implementation guide is intended to be used. A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the implementation guide. The NPM package name for this Implementation Guide, used in the NPM package distribution, which is the primary mechanism by which FHIR based tooling manages IG dependencies. This value must be globally unique, and should be assigned with care. The license that applies to this Implementation Guide, using an SPDX license code, or 'not-open-source'. The version(s) of the FHIR specification that this ImplementationGuide targets - e.g. describes how to use. The value of this element is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 4.0.1. for this version. Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, profiles etc.defined in other implementation guides. A set of profiles that all resources covered by this implementation guide must conform to. The information needed by an IG publisher tool to publish the whole implementation guide. Information about an assembled implementation guide, created by the publication tooling. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. A canonical reference to the Implementation guide for the dependency. The NPM package name for the Implementation Guide that this IG depends on. The version of the IG that is depended on, when the correct version is required to understand the IG correctly. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. The type of resource that all instances must conform to. A reference to the profile that all instances must conform to. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. A logical group of resources. Logical groups can be used when building pages. A resource that is part of the implementation guide. Conformance resources (value set, structure definition, capability statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource. A page / section in the implementation guide. The root page is the implementation guide home page. Defines how IG is built by tools. A template for building resources. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. The human-readable title to display for the package of resources when rendering the implementation guide. Human readable text describing the package. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. Where this resource is found. Indicates the FHIR Version(s) this artifact is intended to apply to. If no versions are specified, the resource is assumed to apply to all the versions stated in ImplementationGuide.fhirVersion. A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name). A description of the reason that a resource has been included in the implementation guide. If true or a reference, indicates the resource is an example instance. If a reference is present, indicates that the example is an example of the specified profile. Reference to the id of the grouping this resource appears in. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. The source address for the page. A short title used to represent this page in navigational structures such as table of contents, bread crumbs, etc. A code that indicates how the page is generated. Nested Pages/Sections under this page. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. apply | path-resource | path-pages | path-tx-cache | expansion-parameter | rule-broken-links | generate-xml | generate-json | generate-turtle | html-template. Value for named type. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. Type of template specified. The source location for the template. The scope in which the template applies. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. A pointer to official web page, PDF or other rendering of the implementation guide. A resource that is part of the implementation guide. Conformance resources (value set, structure definition, capability statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource. Information about a page within the IG. Indicates a relative path to an image that exists within the IG. Indicates the relative path of an additional non-page, non-image file that is part of the IG - e.g. zip, jar and similar files that could be the target of a hyperlink in a derived IG. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. Where this resource is found. If true or a reference, indicates the resource is an example instance. If a reference is present, indicates that the example is an example of the specified profile. The relative path for primary page for this resource within the IG. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. Relative path to the page. Label for the page intended for human display. The name of an anchor available on the page. Apply Metadata Value Resource Path Pages Path Terminology Cache Path Expansion Profile Broken Links Rule Generate XML Generate JSON Generate Turtle HTML Template Code of parameter that is input to the guide. If the element is present, it must have either a @value, an @id, or extensions Not open source BSD Zero Clause License Attribution Assurance License Abstyles License Adobe Systems Incorporated Source Code License Agreement Adobe Glyph List License Amazon Digital Services License Academic Free License v1.1 Academic Free License v1.2 Academic Free License v2.0 Academic Free License v2.1 Academic Free License v3.0 Afmparse License Affero General Public License v1.0 only Affero General Public License v1.0 or later GNU Affero General Public License v3.0 only GNU Affero General Public License v3.0 or later Aladdin Free Public License AMD's plpa_map.c License Apple MIT License Academy of Motion Picture Arts and Sciences BSD ANTLR Software Rights Notice Apache License 1.0 Apache License 1.1 Apache License 2.0 Adobe Postscript AFM License Adaptive Public License 1.0 Apple Public Source License 1.0 Apple Public Source License 1.1 Apple Public Source License 1.2 Apple Public Source License 2.0 Artistic License 1.0 w/clause 8 Artistic License 1.0 (Perl) Artistic License 1.0 Artistic License 2.0 Bahyph License Barr License Beerware License BitTorrent Open Source License v1.0 BitTorrent Open Source License v1.1 Borceux license BSD 1-Clause License BSD 2-Clause FreeBSD License BSD 2-Clause NetBSD License BSD-2-Clause Plus Patent License BSD 2-Clause "Simplified" License BSD with attribution BSD 3-Clause Clear License Lawrence Berkeley National Labs BSD variant license BSD 3-Clause No Nuclear License 2014 BSD 3-Clause No Nuclear License BSD 3-Clause No Nuclear Warranty BSD 3-Clause "New" or "Revised" License BSD-4-Clause (University of California-Specific) BSD 4-Clause "Original" or "Old" License BSD Protection License BSD Source Code Attribution Boost Software License 1.0 bzip2 and libbzip2 License v1.0.5 bzip2 and libbzip2 License v1.0.6 Caldera License Computer Associates Trusted Open Source License 1.1 Creative Commons Attribution 1.0 Generic Creative Commons Attribution 2.0 Generic Creative Commons Attribution 2.5 Generic Creative Commons Attribution 3.0 Unported Creative Commons Attribution 4.0 International Creative Commons Attribution Non Commercial 1.0 Generic Creative Commons Attribution Non Commercial 2.0 Generic Creative Commons Attribution Non Commercial 2.5 Generic Creative Commons Attribution Non Commercial 3.0 Unported Creative Commons Attribution Non Commercial 4.0 International Creative Commons Attribution Non Commercial No Derivatives 1.0 Generic Creative Commons Attribution Non Commercial No Derivatives 2.0 Generic Creative Commons Attribution Non Commercial No Derivatives 2.5 Generic Creative Commons Attribution Non Commercial No Derivatives 3.0 Unported Creative Commons Attribution Non Commercial No Derivatives 4.0 International Creative Commons Attribution Non Commercial Share Alike 1.0 Generic Creative Commons Attribution Non Commercial Share Alike 2.0 Generic Creative Commons Attribution Non Commercial Share Alike 2.5 Generic Creative Commons Attribution Non Commercial Share Alike 3.0 Unported Creative Commons Attribution Non Commercial Share Alike 4.0 International Creative Commons Attribution No Derivatives 1.0 Generic Creative Commons Attribution No Derivatives 2.0 Generic Creative Commons Attribution No Derivatives 2.5 Generic Creative Commons Attribution No Derivatives 3.0 Unported Creative Commons Attribution No Derivatives 4.0 International Creative Commons Attribution Share Alike 1.0 Generic Creative Commons Attribution Share Alike 2.0 Generic Creative Commons Attribution Share Alike 2.5 Generic Creative Commons Attribution Share Alike 3.0 Unported Creative Commons Attribution Share Alike 4.0 International Creative Commons Zero v1.0 Universal Common Development and Distribution License 1.0 Common Development and Distribution License 1.1 Community Data License Agreement Permissive 1.0 Community Data License Agreement Sharing 1.0 CeCILL Free Software License Agreement v1.0 CeCILL Free Software License Agreement v1.1 CeCILL Free Software License Agreement v2.0 CeCILL Free Software License Agreement v2.1 CeCILL-B Free Software License Agreement CeCILL-C Free Software License Agreement Clarified Artistic License CNRI Jython License CNRI Python Open Source GPL Compatible License Agreement CNRI Python License Condor Public License v1.1 Common Public Attribution License 1.0 Common Public License 1.0 Code Project Open License 1.02 Crossword License CrystalStacker License CUA Office Public License v1.0 Cube License curl License Deutsche Freie Software Lizenz diffmark license DOC License Dotseqn License DSDP License dvipdfm License Educational Community License v1.0 Educational Community License v2.0 Eiffel Forum License v1.0 Eiffel Forum License v2.0 eGenix.com Public License 1.1.0 Entessa Public License v1.0 Eclipse Public License 1.0 Eclipse Public License 2.0 Erlang Public License v1.1 EU DataGrid Software License European Union Public License 1.0 European Union Public License 1.1 European Union Public License 1.2 Eurosym License Fair License Frameworx Open License 1.0 FreeImage Public License v1.0 FSF All Permissive License FSF Unlimited License FSF Unlimited License (with License Retention) Freetype Project License GNU Free Documentation License v1.1 only GNU Free Documentation License v1.1 or later GNU Free Documentation License v1.2 only GNU Free Documentation License v1.2 or later GNU Free Documentation License v1.3 only GNU Free Documentation License v1.3 or later Giftware License GL2PS License 3dfx Glide License Glulxe License gnuplot License GNU General Public License v1.0 only GNU General Public License v1.0 or later GNU General Public License v2.0 only GNU General Public License v2.0 or later GNU General Public License v3.0 only GNU General Public License v3.0 or later gSOAP Public License v1.3b Haskell Language Report License Historical Permission Notice and Disclaimer IBM PowerPC Initialization and Boot Software ICU License Independent JPEG Group License ImageMagick License iMatix Standard Function Library Agreement Imlib2 License Info-ZIP License Intel ACPI Software License Agreement Intel Open Source License Interbase Public License v1.0 IPA Font License IBM Public License v1.0 ISC License JasPer License JSON License Licence Art Libre 1.2 Licence Art Libre 1.3 Latex2e License Leptonica License GNU Library General Public License v2 only GNU Library General Public License v2 or later GNU Lesser General Public License v2.1 only GNU Lesser General Public License v2.1 or later GNU Lesser General Public License v3.0 only GNU Lesser General Public License v3.0 or later Lesser General Public License For Linguistic Resources libpng License libtiff License Licence Libre du Québec – Permissive version 1.1 Licence Libre du Québec – Réciprocité version 1.1 Licence Libre du Québec – Réciprocité forte version 1.1 Linux Kernel Variant of OpenIB.org license Lucent Public License Version 1.0 Lucent Public License v1.02 LaTeX Project Public License v1.0 LaTeX Project Public License v1.1 LaTeX Project Public License v1.2 LaTeX Project Public License v1.3a LaTeX Project Public License v1.3c MakeIndex License MirOS License MIT No Attribution Enlightenment License (e16) CMU License enna License feh License MIT License MIT +no-false-attribs license Motosoto License mpich2 License Mozilla Public License 1.0 Mozilla Public License 1.1 Mozilla Public License 2.0 (no copyleft exception) Mozilla Public License 2.0 Microsoft Public License Microsoft Reciprocal License Matrix Template Library License Multics License Mup License NASA Open Source Agreement 1.3 Naumen Public License Net Boolean Public License v1 University of Illinois/NCSA Open Source License Net-SNMP License NetCDF license Newsletr License Nethack General Public License Norwegian Licence for Open Government Data No Limit Public License Nokia Open Source License Netizen Open Source License Noweb License Netscape Public License v1.0 Netscape Public License v1.1 Non-Profit Open Software License 3.0 NRL License NTP License Open CASCADE Technology Public License OCLC Research Public License 2.0 ODC Open Database License v1.0 SIL Open Font License 1.0 SIL Open Font License 1.1 Open Group Test Suite License Open LDAP Public License v1.1 Open LDAP Public License v1.2 Open LDAP Public License v1.3 Open LDAP Public License v1.4 Open LDAP Public License v2.0.1 Open LDAP Public License v2.0 (or possibly 2.0A and 2.0B) Open LDAP Public License v2.1 Open LDAP Public License v2.2.1 Open LDAP Public License 2.2.2 Open LDAP Public License v2.2 Open LDAP Public License v2.3 Open LDAP Public License v2.4 Open LDAP Public License v2.5 Open LDAP Public License v2.6 Open LDAP Public License v2.7 Open LDAP Public License v2.8 Open Market License OpenSSL License Open Public License v1.0 OSET Public License version 2.1 Open Software License 1.0 Open Software License 1.1 Open Software License 2.0 Open Software License 2.1 Open Software License 3.0 ODC Public Domain Dedication & License 1.0 PHP License v3.0 PHP License v3.01 Plexus Classworlds License PostgreSQL License psfrag License psutils License Python License 2.0 Qhull License Q Public License 1.0 Rdisc License Red Hat eCos Public License v1.1 Reciprocal Public License 1.1 Reciprocal Public License 1.5 RealNetworks Public Source License v1.0 RSA Message-Digest License Ricoh Source Code Public License Ruby License Sax Public Domain Notice Saxpath License SCEA Shared Source License Sendmail License SGI Free Software License B v1.0 SGI Free Software License B v1.1 SGI Free Software License B v2.0 Simple Public License 2.0 Sun Industry Standards Source License v1.2 Sun Industry Standards Source License v1.1 Sleepycat License Standard ML of New Jersey License Secure Messaging Protocol Public License SNIA Public License 1.1 Spencer License 86 Spencer License 94 Spencer License 99 Sun Public License v1.0 SugarCRM Public License v1.1.3 Scheme Widget Library (SWL) Software License Agreement TCL/TK License TCP Wrappers License TMate Open Source License TORQUE v2.5+ Software License v1.1 Trusster Open Source License Unicode License Agreement - Data Files and Software (2015) Unicode License Agreement - Data Files and Software (2016) Unicode Terms of Use The Unlicense Universal Permissive License v1.0 Vim License VOSTROM Public License for Open Source Vovida Software License v1.0 W3C Software Notice and License (1998-07-20) W3C Software Notice and Document License (2015-05-13) W3C Software Notice and License (2002-12-31) Sybase Open Watcom Public License 1.0 Wsuipa License Do What The F*ck You Want To Public License X11 License Xerox License XFree86 License 1.1 xinetd License X.Net License XPP License XSkat License Yahoo! Public License v1.0 Yahoo! Public License v1.1 Zed License Zend License v2.0 Zimbra Public License v1.3 Zimbra Public License v1.4 zlib/libpng License with Acknowledgement zlib License Zope Public License 1.1 Zope Public License 2.0 Zope Public License 2.1 The license that applies to an Implementation Guide (using an SPDX license Identifiers, or 'not-open-source'). The binding is required but new SPDX license Identifiers are allowed to be used (https://spdx.org/licenses/). If the element is present, it must have either a @value, an @id, or extensions HTML Markdown XML Generated A code that indicates how the page is generated. If the element is present, it must have either a @value, an @id, or extensions Details of a Health Insurance product/plan provided by an organization. Details of a Health Insurance product/plan provided by an organization. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this health insurance product which remain constant as the resource is updated and propagates from server to server. The current state of the health insurance product. The kind of health insurance product. Official name of the health insurance product as designated by the owner. A list of alternate names that the product is known as, or was known as in the past. The period of time that the health insurance product is available. The entity that is providing the health insurance product and underwriting the risk. This is typically an insurance carriers, other third-party payers, or health plan sponsors comonly referred to as 'payers'. An organization which administer other services such as underwriting, customer service and/or claims processing on behalf of the health insurance product owner. The geographic region in which a health insurance product's benefits apply. The contact for the health insurance product for a certain purpose. The technical endpoints providing access to services operated for the health insurance product. Reference to the network included in the health insurance product. Details about the coverage offered by the insurance product. Details about an insurance plan. Details of a Health Insurance product/plan provided by an organization. Indicates a purpose for which the contact can be reached. A name associated with the contact. A contact detail (e.g. a telephone number or an email address) by which the party may be contacted. Visiting or postal addresses for the contact. Details of a Health Insurance product/plan provided by an organization. Type of coverage (Medical; Dental; Mental Health; Substance Abuse; Vision; Drug; Short Term; Long Term Care; Hospice; Home Health). Reference to the network that providing the type of coverage. Specific benefits under this type of coverage. Details of a Health Insurance product/plan provided by an organization. Type of benefit (primary care; speciality care; inpatient; outpatient). The referral requirements to have access/coverage for this benefit. The specific limits on the benefit. Details of a Health Insurance product/plan provided by an organization. The maximum amount of a service item a plan will pay for a covered benefit. For examples. wellness visits, or eyeglasses. The specific limit on the benefit. Details of a Health Insurance product/plan provided by an organization. Business identifiers assigned to this health insurance plan which remain constant as the resource is updated and propagates from server to server. Type of plan. For example, "Platinum" or "High Deductable". The geographic region in which a health insurance plan's benefits apply. Reference to the network that providing the type of coverage. Overall costs associated with the plan. Costs associated with the coverage provided by the product. Details of a Health Insurance product/plan provided by an organization. Type of cost. Number of participants enrolled in the plan. Value of the cost. Additional information about the general costs associated with this plan. Details of a Health Insurance product/plan provided by an organization. General category of benefit (Medical; Dental; Vision; Drug; Mental Health; Substance Abuse; Hospice, Home Health). List of the specific benefits under this category of benefit. Details of a Health Insurance product/plan provided by an organization. Type of specific benefit (preventative; primary care office visit; speciality office visit; hospitalization; emergency room; urgent care). List of the costs associated with a specific benefit. Details of a Health Insurance product/plan provided by an organization. Type of cost (copay; individual cap; family cap; coinsurance; deductible). Whether the cost applies to in-network or out-of-network providers (in-network; out-of-network; other). Additional information about the cost, such as information about funding sources (e.g. HSA, HRA, FSA, RRA). The actual cost value. (some of the costs may be represented as percentages rather than currency, e.g. 10% coinsurance). Invoice containing collected ChargeItems from an Account with calculated individual and total price for Billing purpose. Invoice containing collected ChargeItems from an Account with calculated individual and total price for Billing purpose. If the element is present, it must have either a @value, an @id, or extensions Identifier of this Invoice, often used for reference in correspondence about this invoice or for tracking of payments. The current state of the Invoice. In case of Invoice cancellation a reason must be given (entered in error, superseded by corrected invoice etc.). Type of Invoice depending on domain, realm an usage (e.g. internal/external, dental, preliminary). The individual or set of individuals receiving the goods and services billed in this invoice. The individual or Organization responsible for balancing of this invoice. Date/time(s) of when this Invoice was posted. Indicates who or what performed or participated in the charged service. The organizationissuing the Invoice. Account which is supposed to be balanced with this Invoice. Each line item represents one charge for goods and services rendered. Details such as date, code and amount are found in the referenced ChargeItem resource. The total amount for the Invoice may be calculated as the sum of the line items with surcharges/deductions that apply in certain conditions. The priceComponent element can be used to offer transparency to the recipient of the Invoice of how the total price was calculated. Invoice total , taxes excluded. Invoice total, tax included. Payment details such as banking details, period of payment, deductibles, methods of payment. Comments made about the invoice by the issuer, subject, or other participants. Invoice containing collected ChargeItems from an Account with calculated individual and total price for Billing purpose. Describes the type of involvement (e.g. transcriptionist, creator etc.). If the invoice has been created automatically, the Participant may be a billing engine or another kind of device. The device, practitioner, etc. who performed or participated in the service. Invoice containing collected ChargeItems from an Account with calculated individual and total price for Billing purpose. Sequence in which the items appear on the invoice. The ChargeItem contains information such as the billing code, date, amount etc. If no further details are required for the lineItem, inline billing codes can be added using the CodeableConcept data type instead of the Reference. The price for a ChargeItem may be calculated as a base price with surcharges/deductions that apply in certain conditions. A ChargeItemDefinition resource that defines the prices, factors and conditions that apply to a billing code is currently under development. The priceComponent element can be used to offer transparency to the recipient of the Invoice as to how the prices have been calculated. Invoice containing collected ChargeItems from an Account with calculated individual and total price for Billing purpose. This code identifies the type of the component. A code that identifies the component. Codes may be used to differentiate between kinds of taxes, surcharges, discounts etc. The factor that has been applied on the base price for calculating this component. The amount calculated for this component. draft issued balanced cancelled entered in error Codes identifying the lifecycle stage of an Invoice. If the element is present, it must have either a @value, an @id, or extensions The Library resource is a general-purpose container for knowledge asset definitions. It can be used to describe and expose existing knowledge assets such as logic libraries and information model descriptions, as well as to describe a collection of knowledge assets. The Library resource is a general-purpose container for knowledge asset definitions. It can be used to describe and expose existing knowledge assets such as logic libraries and information model descriptions, as well as to describe a collection of knowledge assets. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this library when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this library is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the library is stored on different servers. A formal identifier that is used to identify this library when it is represented in other formats, or referenced in a specification, model, design or an instance. e.g. CMS or NQF identifiers for a measure artifact. Note that at least one identifier is required for non-experimental active artifacts. The identifier that is used to identify this version of the library when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the library author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts. A natural language name identifying the library. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the library. An explanatory or alternate title for the library giving additional information about its content. The status of this library. Enables tracking the life-cycle of the content. A Boolean value to indicate that this library is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. Identifies the type of library such as a Logic Library, Model Definition, Asset Collection, or Module Definition. A code or group definition that describes the intended subject of the contents of the library. The date (and optionally time) when the library was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the library changes. The name of the organization or individual that published the library. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the library from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate library instances. A legal or geographic region in which the library is intended to be used. Explanation of why this library is needed and why it has been designed as it has. A detailed description of how the library is used from a clinical perspective. A copyright statement relating to the library and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the library. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the library content was or is planned to be in active use. Descriptive topics related to the content of the library. Topics provide a high-level categorization of the library that can be useful for filtering and searching. An individiual or organization primarily involved in the creation and maintenance of the content. An individual or organization primarily responsible for internal coherence of the content. An individual or organization primarily responsible for review of some aspect of the content. An individual or organization responsible for officially endorsing the content for use in some setting. Related artifacts such as additional documentation, justification, or bibliographic references. The parameter element defines parameters used by the library. Describes a set of data that must be provided in order to be able to successfully perform the computations defined by the library. The content of the library as an Attachment. The content may be a reference to a url, or may be directly embedded as a base-64 string. Either way, the contentType of the attachment determines how to interpret the content. Identifies two or more records (resource instances) that refer to the same real-world "occurrence". Identifies two or more records (resource instances) that refer to the same real-world "occurrence". If the element is present, it must have either a @value, an @id, or extensions Indicates whether the asserted set of linkages are considered to be "in effect". Identifies the user or organization responsible for asserting the linkages as well as the user or organization who establishes the context in which the nature of each linkage is evaluated. Identifies which record considered as the reference to the same real-world occurrence as well as how the items should be evaluated within the collection of linked items. Identifies two or more records (resource instances) that refer to the same real-world "occurrence". Distinguishes which item is "source of truth" (if any) and which items are no longer considered to be current representations. The resource instance being linked as part of the group. Source of Truth Alternate Record Historical/Obsolete Record Used to distinguish different roles a resource can play within a set of linked resources. If the element is present, it must have either a @value, an @id, or extensions A list is a curated collection of resources. A list is a curated collection of resources. If the element is present, it must have either a @value, an @id, or extensions Identifier for the List assigned for business purposes outside the context of FHIR. Indicates the current state of this list. How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted. A label for the list assigned by the author. This code defines the purpose of the list - why it was created. The common subject (or patient) of the resources that are in the list if there is one. The encounter that is the context in which this list was created. The date that the list was prepared. The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list. What order applies to the items in the list. Comments that apply to the overall list. Entries in this list. If the list is empty, why the list is empty. A list is a curated collection of resources. The flag allows the system constructing the list to indicate the role and significance of the item in the list. True if this item is marked as deleted in the list. When this item was added to the list. A reference to the actual resource from which data was derived. Current Retired Entered In Error The current state of the list. If the element is present, it must have either a @value, an @id, or extensions Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained, or accommodated. Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained, or accommodated. If the element is present, it must have either a @value, an @id, or extensions Unique code or number identifying the location to its users. The status property covers the general availability of the resource, not the current value which may be covered by the operationStatus, or by a schedule/slots if they are configured for the location. The operational status covers operation values most relevant to beds (but can also apply to rooms/units/chairs/etc. such as an isolation unit/dialysis chair). This typically covers concepts such as contamination, housekeeping, and other activities like maintenance. Name of the location as used by humans. Does not need to be unique. A list of alternate names that the location is known as, or was known as, in the past. Description of the Location, which helps in finding or referencing the place. Indicates whether a resource instance represents a specific location or a class of locations. Indicates the type of function performed at the location. The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites. Physical location. Physical form of the location, e.g. building, room, vehicle, road. The absolute geographic location of the Location, expressed using the WGS84 datum (This is the same co-ordinate system used in KML). The organization responsible for the provisioning and upkeep of the location. Another Location of which this Location is physically a part of. What days/times during a week is this location usually open. A description of when the locations opening ours are different to normal, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as detailed in the opening hours Times. Technical endpoints providing access to services operated for the location. Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained, or accommodated. Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained, or accommodated. Indicates which days of the week are available between the start and end Times. The Location is open all day. Time that the Location opens. Time that the Location closes. Instance Kind Indicates whether a resource instance represents a specific location or a class of locations. If the element is present, it must have either a @value, an @id, or extensions Active Suspended Inactive Indicates whether the location is still in use. If the element is present, it must have either a @value, an @id, or extensions The Measure resource provides the definition of a quality measure. The Measure resource provides the definition of a quality measure. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this measure when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this measure is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the measure is stored on different servers. A formal identifier that is used to identify this measure when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the measure when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the measure author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts. A natural language name identifying the measure. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the measure. An explanatory or alternate title for the measure giving additional information about its content. The status of this measure. Enables tracking the life-cycle of the content. A Boolean value to indicate that this measure is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The intended subjects for the measure. If this element is not provided, a Patient subject is assumed, but the subject of the measure can be anything. The date (and optionally time) when the measure was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the measure changes. The name of the organization or individual that published the measure. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the measure from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate measure instances. A legal or geographic region in which the measure is intended to be used. Explanation of why this measure is needed and why it has been designed as it has. A detailed description, from a clinical perspective, of how the measure is used. A copyright statement relating to the measure and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the measure. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the measure content was or is planned to be in active use. Descriptive topics related to the content of the measure. Topics provide a high-level categorization grouping types of measures that can be useful for filtering and searching. An individiual or organization primarily involved in the creation and maintenance of the content. An individual or organization primarily responsible for internal coherence of the content. An individual or organization primarily responsible for review of some aspect of the content. An individual or organization responsible for officially endorsing the content for use in some setting. Related artifacts such as additional documentation, justification, or bibliographic references. A reference to a Library resource containing the formal logic used by the measure. Notices and disclaimers regarding the use of the measure or related to intellectual property (such as code systems) referenced by the measure. Indicates how the calculation is performed for the measure, including proportion, ratio, continuous-variable, and cohort. The value set is extensible, allowing additional measure scoring types to be represented. If this is a composite measure, the scoring method used to combine the component measures to determine the composite score. Indicates whether the measure is used to examine a process, an outcome over time, a patient-reported outcome, or a structure measure such as utilization. A description of the risk adjustment factors that may impact the resulting score for the measure and how they may be accounted for when computing and reporting measure results. Describes how to combine the information calculated, based on logic in each of several populations, into one summarized result. Provides a succinct statement of the need for the measure. Usually includes statements pertaining to importance criterion: impact, gap in care, and evidence. Provides a summary of relevant clinical guidelines or other clinical recommendations supporting the measure. Information on whether an increase or decrease in score is the preferred result (e.g., a higher score indicates better quality OR a lower score indicates better quality OR quality is within a range). Provides a description of an individual term used within the measure. Additional guidance for the measure including how it can be used in a clinical context, and the intent of the measure. A group of population criteria for the measure. The supplemental data criteria for the measure report, specified as either the name of a valid CQL expression within a referenced library, or a valid FHIR Resource Path. The Measure resource provides the definition of a quality measure. Indicates a meaning for the group. This can be as simple as a unique identifier, or it can establish meaning in a broader context by drawing from a terminology, allowing groups to be correlated across measures. The human readable description of this population group. A population criteria for the measure. The stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a referenced library or a valid FHIR Resource Path. The Measure resource provides the definition of a quality measure. The type of population criteria. The human readable description of this population criteria. An expression that specifies the criteria for the population, typically the name of an expression in a library. The Measure resource provides the definition of a quality measure. Indicates a meaning for the stratifier. This can be as simple as a unique identifier, or it can establish meaning in a broader context by drawing from a terminology, allowing stratifiers to be correlated across measures. The human readable description of this stratifier criteria. An expression that specifies the criteria for the stratifier. This is typically the name of an expression defined within a referenced library, but it may also be a path to a stratifier element. A component of the stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a referenced library or a valid FHIR Resource Path. The Measure resource provides the definition of a quality measure. Indicates a meaning for the stratifier component. This can be as simple as a unique identifier, or it can establish meaning in a broader context by drawing from a terminology, allowing stratifiers to be correlated across measures. The human readable description of this stratifier criteria component. An expression that specifies the criteria for this component of the stratifier. This is typically the name of an expression defined within a referenced library, but it may also be a path to a stratifier element. The Measure resource provides the definition of a quality measure. Indicates a meaning for the supplemental data. This can be as simple as a unique identifier, or it can establish meaning in a broader context by drawing from a terminology, allowing supplemental data to be correlated across measures. An indicator of the intended usage for the supplemental data element. Supplemental data indicates the data is additional information requested to augment the measure information. Risk adjustment factor indicates the data is additional information used to calculate risk adjustment factors when applying a risk model to the measure calculation. The human readable description of this supplemental data. The criteria for the supplemental data. This is typically the name of a valid expression defined within a referenced library, but it may also be a path to a specific data element. The criteria defines the data to be returned for this element. The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation. The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation. If the element is present, it must have either a @value, an @id, or extensions A formal identifier that is used to identify this MeasureReport when it is represented in other formats or referenced in a specification, model, design or an instance. The MeasureReport status. No data will be available until the MeasureReport status is complete. The type of measure report. This may be an individual report, which provides the score for the measure for an individual member of the population; a subject-listing, which returns the list of members that meet the various criteria in the measure; a summary report, which returns a population count for each of the criteria in the measure; or a data-collection, which enables the MeasureReport to be used to exchange the data-of-interest for a quality measure. A reference to the Measure that was calculated to produce this report. Optional subject identifying the individual or individuals the report is for. The date this measure report was generated. The individual, location, or organization that is reporting the data. The reporting period for which the report was calculated. Whether improvement in the measure is noted by an increase or decrease in the measure score. The results of the calculation, one for each population group in the measure. A reference to a Bundle containing the Resources that were used in the calculation of this measure. The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation. The meaning of the population group as defined in the measure definition. The populations that make up the population group, one for each type of population appropriate for the measure. The measure score for this population group, calculated as appropriate for the measure type and scoring method, and based on the contents of the populations defined in the group. When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure. The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation. The type of the population. The number of members of the population. This element refers to a List of subject level MeasureReport resources, one for each subject in this population. The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation. The meaning of this stratifier, as defined in the measure definition. This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value. The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation. The value for this stratum, expressed as a CodeableConcept. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique. A stratifier component value. The populations that make up the stratum, one for each type of population appropriate to the measure. The measure score for this stratum, calculated as appropriate for the measure type and scoring method, and based on only the members of this stratum. The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation. The code for the stratum component value. The stratum component value. The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation. The type of the population. The number of members of the population in this stratum. This element refers to a List of subject level MeasureReport resources, one for each subject in this population in this stratum. Complete Pending Error The status of the measure report. If the element is present, it must have either a @value, an @id, or extensions Individual Subject List Summary Data Collection The type of the measure report. If the element is present, it must have either a @value, an @id, or extensions A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference. A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference. If the element is present, it must have either a @value, an @id, or extensions Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers. A procedure that is fulfilled in whole or in part by the creation of this media. A larger event of which this particular event is a component or step. The current state of the {{title}}. A code that classifies whether the media is an image, video or audio recording or some other media category. Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality. The name of the imaging view e.g. Lateral or Antero-posterior (AP). Who/What this Media is a record of. The encounter that establishes the context for this media. The date and time(s) at which the media was collected. The date and time this version of the media was made available to providers, typically after having been reviewed. The person who administered the collection of the image. Describes why the event occurred in coded or textual form. Indicates the site on the subject's body where the observation was made (i.e. the target site). The name of the device / manufacturer of the device that was used to make the recording. The device used to collect the media. Height of the image in pixels (photo/video). Width of the image in pixels (photo/video). The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required. The duration of the recording in seconds - for audio and video. The actual content of the media - inline or by direct reference to the media source file. Comments made about the media by the performer, subject or other participants. This resource is primarily used for the identification and definition of a medication for the purposes of prescribing, dispensing, and administering a medication as well as for making statements about medication use. This resource is primarily used for the identification and definition of a medication for the purposes of prescribing, dispensing, and administering a medication as well as for making statements about medication use. If the element is present, it must have either a @value, an @id, or extensions Business identifier for this medication. A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems. A code to indicate if the medication is in active use. Describes the details of the manufacturer of the medication product. This is not intended to represent the distributor of a medication product. Describes the form of the item. Powder; tablets; capsule. Specific amount of the drug in the packaged product. For example, when specifying a product that has the same strength (For example, Insulin glargine 100 unit per mL solution for injection), this attribute provides additional clarification of the package amount (For example, 3 mL, 10mL, etc.). Identifies a particular constituent of interest in the product. Information that only applies to packages (not products). This resource is primarily used for the identification and definition of a medication for the purposes of prescribing, dispensing, and administering a medication as well as for making statements about medication use. The actual ingredient - either a substance (simple ingredient) or another medication of a medication. Indication of whether this ingredient affects the therapeutic action of the drug. Specifies how many (or how much) of the items there are in this Medication. For example, 250 mg per tablet. This is expressed as a ratio where the numerator is 250mg and the denominator is 1 tablet. This resource is primarily used for the identification and definition of a medication for the purposes of prescribing, dispensing, and administering a medication as well as for making statements about medication use. The assigned lot number of a batch of the specified product. When this specific batch of product will expire. Active Inactive Entered in Error A coded concept defining if the medication is in active use. If the element is present, it must have either a @value, an @id, or extensions Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner. Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner. If the element is present, it must have either a @value, an @id, or extensions Identifiers associated with this Medication Administration that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server. A protocol, guideline, orderset, or other definition that was adhered to in whole or in part by this event. A larger event of which this particular event is a component or step. Will generally be set to show that the administration has been completed. For some long running administrations such as infusions, it is possible for an administration to be started but not completed or it may be paused while some other process is under way. A code indicating why the administration was not performed. Indicates where the medication is expected to be consumed or administered. Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. The person or animal or group receiving the medication. The visit, admission, or other contact between patient and health care provider during which the medication administration was performed. Additional information (for example, patient height and weight) that supports the administration of the medication. A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate. Indicates who or what performed the medication administration and how they were involved. A code indicating why the medication was given. Condition or observation that supports why the medication was administered. The original request, instruction or authority to perform the administration. The device used in administering the medication to the patient. For example, a particular infusion pump. Extra information about the medication administration that is not conveyed by the other attributes. Describes the medication dosage information details e.g. dose, rate, site, route, etc. A summary of the events of interest that have occurred, such as when the administration was verified. Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner. Distinguishes the type of involvement of the performer in the medication administration. Indicates who or what performed the medication administration. Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner. Free text dosage can be used for cases where the dosage administered is too complex to code. When coded dosage is present, the free text dosage may still be present for display to humans. The dosage instructions should reflect the dosage of the medication that was administered. A coded specification of the anatomic site where the medication first entered the body. For example, "left arm". A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. For example, topical, intravenous, etc. A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. This attribute will most often NOT be populated. It is most commonly used for injections. For example, Slow Push, Deep IV. The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection. Identifies the speed with which the medication was or will be introduced into the patient. Typically, the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time, e.g. 500 ml per 2 hours. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours. Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order. Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order. If the element is present, it must have either a @value, an @id, or extensions Identifiers associated with this Medication Dispense that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server. The procedure that trigger the dispense. A code specifying the state of the set of dispense events. Indicates the reason why a dispense was not performed. Indicates the type of medication dispense (for example, where the medication is expected to be consumed or administered (i.e. inpatient or outpatient)). Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. A link to a resource representing the person or the group to whom the medication will be given. The encounter or episode of care that establishes the context for this event. Additional information that supports the medication being dispensed. Indicates who or what performed the event. The principal physical location where the dispense was performed. Indicates the medication order that is being dispensed against. Indicates the type of dispensing event that is performed. For example, Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. The amount of medication that has been dispensed. Includes unit of measure. The amount of medication expressed as a timing amount. The time when the dispensed product was packaged and reviewed. The time the dispensed product was provided to the patient or their representative. Identification of the facility/location where the medication was shipped to, as part of the dispense event. Identifies the person who picked up the medication. This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional. Extra information about the dispense that could not be conveyed in the other attributes. Indicates how the medication is to be used by the patient. Indicates whether or not substitution was made as part of the dispense. In some cases, substitution will be expected but does not happen, in other cases substitution is not expected but does happen. This block explains what substitution did or did not happen and why. If nothing is specified, substitution was not done. Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. drug-drug interaction, duplicate therapy, dosage alert etc. A summary of the events of interest that have occurred, such as when the dispense was verified. Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order. Distinguishes the type of performer in the dispense. For example, date enterer, packager, final checker. The device, practitioner, etc. who performed the action. It should be assumed that the actor is the dispenser of the medication. Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order. True if the dispenser dispensed a different drug or product from what was prescribed. A code signifying whether a different drug was dispensed from what was prescribed. Indicates the reason for the substitution (or lack of substitution) from what was prescribed. The person or organization that has primary responsibility for the substitution. Information about a medication that is used to support knowledge. Information about a medication that is used to support knowledge. If the element is present, it must have either a @value, an @id, or extensions A code that specifies this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems. A code to indicate if the medication is in active use. The status refers to the validity about the information of the medication and not to its medicinal properties. Describes the details of the manufacturer of the medication product. This is not intended to represent the distributor of a medication product. Describes the form of the item. Powder; tablets; capsule. Specific amount of the drug in the packaged product. For example, when specifying a product that has the same strength (For example, Insulin glargine 100 unit per mL solution for injection), this attribute provides additional clarification of the package amount (For example, 3 mL, 10mL, etc.). Additional names for a medication, for example, the name(s) given to a medication in different countries. For example, acetaminophen and paracetamol or salbutamol and albuterol. Associated or related knowledge about a medication. Associated or related medications. For example, if the medication is a branded product (e.g. Crestor), this is the Therapeutic Moeity (e.g. Rosuvastatin) or if this is a generic medication (e.g. Rosuvastatin), this would link to a branded product (e.g. Crestor). Category of the medication or product (e.g. branded product, therapeutic moeity, generic product, innovator product, etc.). Associated documentation about the medication. Identifies a particular constituent of interest in the product. The instructions for preparing the medication. The intended or approved route of administration. The price of the medication. The program under which the medication is reviewed. Guidelines for the administration of the medication. Categorization of the medication within a formulary or classification system. Information that only applies to packages (not products). Specifies descriptive properties of the medicine, such as color, shape, imprints, etc. Potential clinical issue with or between medication(s) (for example, drug-drug interaction, drug-disease contraindication, drug-allergy interaction, etc.). Regulatory information about a medication. The time course of drug absorption, distribution, metabolism and excretion of a medication from the body. Information about a medication that is used to support knowledge. The category of the associated medication knowledge reference. Associated documentation about the associated medication knowledge. Information about a medication that is used to support knowledge. The category of documentation about the medication. (e.g. professional monograph, patient education monograph). Associated documentation about the medication. Information about a medication that is used to support knowledge. The actual ingredient - either a substance (simple ingredient) or another medication. Indication of whether this ingredient affects the therapeutic action of the drug. Specifies how many (or how much) of the items there are in this Medication. For example, 250 mg per tablet. This is expressed as a ratio where the numerator is 250mg and the denominator is 1 tablet. Information about a medication that is used to support knowledge. The category of the cost information. For example, manufacturers' cost, patient cost, claim reimbursement cost, actual acquisition cost. The source or owner that assigns the price to the medication. The price of the medication. Information about a medication that is used to support knowledge. Type of program under which the medication is monitored. Name of the reviewing program. Information about a medication that is used to support knowledge. Dosage for the medication for the specific guidelines. Indication for use that apply to the specific administration guidelines. Characteristics of the patient that are relevant to the administration guidelines (for example, height, weight, gender, etc.). Information about a medication that is used to support knowledge. The type of dosage (for example, prophylaxis, maintenance, therapeutic, etc.). Dosage for the medication for the specific guidelines. Information about a medication that is used to support knowledge. Specific characteristic that is relevant to the administration guideline (e.g. height, weight, gender). The specific characteristic (e.g. height, weight, gender, etc.). Information about a medication that is used to support knowledge. The type of category for the medication (for example, therapeutic classification, therapeutic sub-classification). Specific category assigned to the medication (e.g. anti-infective, anti-hypertensive, antibiotic, etc.). Information about a medication that is used to support knowledge. A code that defines the specific type of packaging that the medication can be found in (e.g. blister sleeve, tube, bottle). The number of product units the package would contain if fully loaded. Information about a medication that is used to support knowledge. A code specifying which characteristic of the medicine is being described (for example, colour, shape, imprint). Description of the characteristic. Information about a medication that is used to support knowledge. The authority that is specifying the regulations. Specifies if changes are allowed when dispensing a medication from a regulatory perspective. Specifies the schedule of a medication in jurisdiction. The maximum number of units of the medication that can be dispensed in a period. Information about a medication that is used to support knowledge. Specifies the type of substitution allowed. Specifies if regulation allows for changes in the medication when dispensing. Information about a medication that is used to support knowledge. Specifies the specific drug schedule. Information about a medication that is used to support knowledge. The maximum number of units of the medication that can be dispensed. The period that applies to the maximum number of units. Information about a medication that is used to support knowledge. The drug concentration measured at certain discrete points in time. The median lethal dose of a drug. The time required for any specified property (e.g., the concentration of a substance in the body) to decrease by half. An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationRequest" rather than "MedicationPrescription" or "MedicationOrder" to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns. An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationRequest" rather than "MedicationPrescription" or "MedicationOrder" to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns. If the element is present, it must have either a @value, an @id, or extensions Identifiers associated with this medication request that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server. A code specifying the current state of the order. Generally, this will be active or completed state. Captures the reason for the current state of the MedicationRequest. Whether the request is a proposal, plan, or an original order. Indicates the type of medication request (for example, where the medication is expected to be consumed or administered (i.e. inpatient or outpatient)). Indicates how quickly the Medication Request should be addressed with respect to other requests. If true indicates that the provider is asking for the medication request not to occur. Indicates if this record was captured as a secondary 'reported' record rather than as an original primary source-of-truth record. It may also indicate the source of the report. Identifies the medication being requested. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications. A link to a resource representing the person or set of individuals to whom the medication will be given. The Encounter during which this [x] was created or to which the creation of this record is tightly associated. Include additional information (for example, patient height and weight) that supports the ordering of the medication. The date (and perhaps time) when the prescription was initially written or authored on. The individual, organization, or device that initiated the request and has responsibility for its activation. The specified desired performer of the medication treatment (e.g. the performer of the medication administration). Indicates the type of performer of the administration of the medication. The person who entered the order on behalf of another individual for example in the case of a verbal or a telephone order. The reason or the indication for ordering or not ordering the medication. Condition or observation that supports why the medication was ordered. The URL pointing to a protocol, guideline, orderset, or other definition that is adhered to in whole or in part by this MedicationRequest. The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this MedicationRequest. A plan or request that is fulfilled in whole or in part by this medication request. A shared identifier common to all requests that were authorized more or less simultaneously by a single author, representing the identifier of the requisition or prescription. The description of the overall patte3rn of the administration of the medication to the patient. Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be required for delivering the requested service. Extra information about the prescription that could not be conveyed by the other attributes. Indicates how the medication is to be used by the patient. Indicates the specific details for the dispense or medication supply part of a medication request (also known as a Medication Prescription or Medication Order). Note that this information is not always sent with the order. There may be in some settings (e.g. hospitals) institutional or system support for completing the dispense details in the pharmacy department. Indicates whether or not substitution can or should be part of the dispense. In some cases, substitution must happen, in other cases substitution must not happen. This block explains the prescriber's intent. If nothing is specified substitution may be done. A link to a resource representing an earlier order related order or prescription. Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, duplicate therapy, dosage alert etc. Links to Provenance records for past versions of this resource or fulfilling request or event resources that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the resource. An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationRequest" rather than "MedicationPrescription" or "MedicationOrder" to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns. Indicates the quantity or duration for the first dispense of the medication. The minimum period of time that must occur between dispenses of the medication. This indicates the validity period of a prescription (stale dating the Prescription). An integer indicating the number of times, in addition to the original dispense, (aka refills or repeats) that the patient can receive the prescribed medication. Usage Notes: This integer does not include the original order dispense. This means that if an order indicates dispense 30 tablets plus "3 repeats", then the order can be dispensed a total of 4 times and the patient can receive a total of 120 tablets. A prescriber may explicitly say that zero refills are permitted after the initial dispense. The amount that is to be dispensed for one fill. Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. Indicates the intended dispensing Organization specified by the prescriber. An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationRequest" rather than "MedicationPrescription" or "MedicationOrder" to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns. The amount or quantity to provide as part of the first dispense. The length of time that the first dispense is expected to last. An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationRequest" rather than "MedicationPrescription" or "MedicationOrder" to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns. True if the prescriber allows a different drug to be dispensed from what was prescribed. Indicates the reason for the substitution, or why substitution must or must not be performed. Active On Hold Cancelled Completed Entered in Error Stopped Draft Unknown A coded concept specifying the state of the prescribing event. Describes the lifecycle of the prescription. If the element is present, it must have either a @value, an @id, or extensions Proposal Plan Order Original Order Reflex Order Filler Order Instance Order Option The kind of medication order. If the element is present, it must have either a @value, an @id, or extensions A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from sources such as the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains. The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information. A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from sources such as the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains. The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information. If the element is present, it must have either a @value, an @id, or extensions Identifiers associated with this Medication Statement that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server. A plan, proposal or order that is fulfilled in whole or in part by this event. A larger event of which this particular event is a component or step. A code representing the patient or other source's judgment about the state of the medication used that this statement is about. Generally, this will be active or completed. Captures the reason for the current state of the MedicationStatement. Indicates where the medication is expected to be consumed or administered. Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. The person, animal or group who is/was taking the medication. The encounter or episode of care that establishes the context for this MedicationStatement. The interval of time during which it is being asserted that the patient is/was/will be taking the medication (or was not taking, when the MedicationStatement.taken element is No). The date when the medication statement was asserted by the information source. The person or organization that provided the information about the taking of this medication. Note: Use derivedFrom when a MedicationStatement is derived from other resources, e.g. Claim or MedicationRequest. Allows linking the MedicationStatement to the underlying MedicationRequest, or to other information that supports or is used to derive the MedicationStatement. A reason for why the medication is being/was taken. Condition or observation that supports why the medication is being/was taken. Provides extra information about the medication statement that is not conveyed by the other attributes. Indicates how the medication is/was or should be taken by the patient. Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use). Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use). If the element is present, it must have either a @value, an @id, or extensions Business identifier for this product. Could be an MPID. Regulatory type, e.g. Investigational or Authorized. If this medicine applies to human or veterinary uses. The dose form for a single part product, or combined form of a multiple part product. The legal status of supply of the medicinal product as classified by the regulator. Whether the Medicinal Product is subject to additional monitoring for regulatory reasons. Whether the Medicinal Product is subject to special measures for regulatory reasons. If authorised for use in children. Allows the product to be classified by various systems. Marketing status of the medicinal product, in contrast to marketing authorizaton. Pharmaceutical aspects of product. Package representation for the product. Supporting documentation, typically for regulatory submission. A master file for to the medicinal product (e.g. Pharmacovigilance System Master File). A product specific contact, person (in a role), or an organization. Clinical trials or studies that this product is involved in. The product's name, including full name and possibly coded parts. Reference to another product, e.g. for linking authorised to investigational product. An operation applied to the product, for manufacturing or adminsitrative purpose. Indicates if the medicinal product has an orphan designation for the treatment of a rare disease. Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use). The full product name. Coding words or phrases of the name. Country where the name applies. Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use). A fragment of a product name. Idenifying type for this part of the name (e.g. strength part). Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use). Country code for where this name applies. Jurisdiction code for where this name applies. Language code for this name. Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use). The type of manufacturing operation. Regulatory authorization reference number. Regulatory authorization date. To indicate if this proces is commercially confidential. The manufacturer or establishment associated with the process. A regulator which oversees the operation. Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use). Identifier for the designation, or procedure number. The type of special designation, e.g. orphan drug, minor use. The intended use of the product, e.g. prevention, treatment. Condition for which the medicinal use applies. For example granted, pending, expired or withdrawn. Date when the designation was granted. Animal species for which this applies. The regulatory authorization of a medicinal product. The regulatory authorization of a medicinal product. If the element is present, it must have either a @value, an @id, or extensions Business identifier for the marketing authorization, as assigned by a regulator. The medicinal product that is being authorized. The country in which the marketing authorization has been granted. Jurisdiction within a country. The status of the marketing authorization. The date at which the given status has become applicable. The date when a suspended the marketing or the marketing authorization of the product is anticipated to be restored. The beginning of the time period in which the marketing authorization is in the specific status shall be specified A complete date consisting of day, month and year shall be specified using the ISO 8601 date format. A period of time after authorization before generic product applicatiosn can be submitted. The date when the first authorization was granted by a Medicines Regulatory Agency. Date of first marketing authorization for a company's new medicinal product in any country in the World. The legal framework against which this authorization is granted. Authorization in areas within a country. Marketing Authorization Holder. Medicines Regulatory Agency. The regulatory procedure for granting or amending a marketing authorization. The regulatory authorization of a medicinal product. The assigned number for the marketing authorization. Country of authorization. Jurisdiction within a country. The legal status of supply in a jurisdiction or region. The start and expected end date of the authorization. The regulatory authorization of a medicinal product. Identifier for this procedure. Type of procedure. Date of procedure. Applcations submitted to obtain a marketing authorization. The clinical particulars - indications, contraindications etc. of a medicinal product, including for regulatory purposes. The clinical particulars - indications, contraindications etc. of a medicinal product, including for regulatory purposes. If the element is present, it must have either a @value, an @id, or extensions The medication for which this is an indication. The disease, symptom or procedure for the contraindication. The status of the disease or symptom for the contraindication. A comorbidity (concurrent condition) or coinfection. Information about the use of the medicinal product in relation to other therapies as part of the indication. Information about the use of the medicinal product in relation to other therapies described as part of the indication. The population group to which this applies. The clinical particulars - indications, contraindications etc. of a medicinal product, including for regulatory purposes. The type of relationship between the medicinal product indication or contraindication and another therapy. Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication. Indication for the Medicinal Product. Indication for the Medicinal Product. If the element is present, it must have either a @value, an @id, or extensions The medication for which this is an indication. The disease, symptom or procedure that is the indication for treatment. The status of the disease or symptom for which the indication applies. Comorbidity (concurrent condition) or co-infection as part of the indication. The intended effect, aim or strategy to be achieved by the indication. Timing or duration information as part of the indication. Information about the use of the medicinal product in relation to other therapies described as part of the indication. Describe the undesirable effects of the medicinal product. The population group to which this applies. Indication for the Medicinal Product. The type of relationship between the medicinal product indication or contraindication and another therapy. Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication. An ingredient of a manufactured item or pharmaceutical product. An ingredient of a manufactured item or pharmaceutical product. If the element is present, it must have either a @value, an @id, or extensions The identifier(s) of this Ingredient that are assigned by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. Ingredient role e.g. Active ingredient, excipient. If the ingredient is a known or suspected allergen. Manufacturer of this Ingredient. A specified substance that comprises this ingredient. The ingredient substance. An ingredient of a manufactured item or pharmaceutical product. The specified substance. The group of specified substance, e.g. group 1 to 4. Confidentiality level of the specified substance as the ingredient. Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product. An ingredient of a manufactured item or pharmaceutical product. The quantity of substance in the unit of presentation, or in the volume (or mass) of the single pharmaceutical product or manufactured item. A lower limit for the quantity of substance in the unit of presentation. For use when there is a range of strengths, this is the lower limit, with the presentation attribute becoming the upper limit. The strength per unitary volume (or mass). A lower limit for the strength per unitary volume (or mass), for when there is a range. The concentration attribute then becomes the upper limit. For when strength is measured at a particular point or distance. The country or countries for which the strength range applies. Strength expressed in terms of a reference substance. An ingredient of a manufactured item or pharmaceutical product. Relevant reference substance. Strength expressed in terms of a reference substance. Strength expressed in terms of a reference substance. For when strength is measured at a particular point or distance. The country or countries for which the strength range applies. An ingredient of a manufactured item or pharmaceutical product. The ingredient substance. Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product. The interactions of the medicinal product with other medicinal products, or other forms of interactions. The interactions of the medicinal product with other medicinal products, or other forms of interactions. If the element is present, it must have either a @value, an @id, or extensions The medication for which this is a described interaction. The interaction described. The specific medication, food or laboratory test that interacts. The type of the interaction e.g. drug-drug interaction, drug-food interaction, drug-lab test interaction. The effect of the interaction, for example "reduced gastric absorption of primary medication". The incidence of the interaction, e.g. theoretical, observed. Actions for managing the interaction. The interactions of the medicinal product with other medicinal products, or other forms of interactions. The specific medication, food or laboratory test that interacts. The manufactured item as contained in the packaged medicinal product. The manufactured item as contained in the packaged medicinal product. If the element is present, it must have either a @value, an @id, or extensions Dose form as manufactured and before any transformation into the pharmaceutical product. The “real world” units in which the quantity of the manufactured item is described. The quantity or "count number" of the manufactured item. Manufacturer of the item (Note that this should be named "manufacturer" but it currently causes technical issues). Ingredient. Dimensions, color etc. Other codeable characteristics. A medicinal product in a container or package. A medicinal product in a container or package. If the element is present, it must have either a @value, an @id, or extensions Unique identifier. The product with this is a pack for. Textual description. The legal status of supply of the medicinal product as classified by the regulator. Marketing information. Manufacturer of this Package Item. Manufacturer of this Package Item. Batch numbering. A packaging item, as a contained for medicine, possibly with other packaging items within. A medicinal product in a container or package. A number appearing on the outer packaging of a specific batch. A number appearing on the immediate packaging (and not the outer packaging). A medicinal product in a container or package. Including possibly Data Carrier Identifier. The physical type of the container of the medicine. The quantity of this package in the medicinal product, at the current level of packaging. The outermost is always 1. Material type of the package item. A possible alternate material for the packaging. A device accompanying a medicinal product. The manufactured item as contained in the packaged medicinal product. Allows containers within containers. Dimensions, color etc. Other codeable characteristics. Shelf Life and storage information. Manufacturer of this Package Item. A pharmaceutical product described in terms of its composition and dose form. A pharmaceutical product described in terms of its composition and dose form. If the element is present, it must have either a @value, an @id, or extensions An identifier for the pharmaceutical medicinal product. The administrable dose form, after necessary reconstitution. Todo. Ingredient. Accompanying device. Characteristics e.g. a products onset of action. The path by which the pharmaceutical product is taken into or makes contact with the body. A pharmaceutical product described in terms of its composition and dose form. A coded characteristic. The status of characteristic e.g. assigned or pending. A pharmaceutical product described in terms of its composition and dose form. Coded expression for the route. The first dose (dose quantity) administered in humans can be specified, for a product under investigation, using a numerical value and its unit of measurement. The maximum single dose that can be administered as per the protocol of a clinical trial can be specified using a numerical value and its unit of measurement. The maximum dose per day (maximum dose quantity to be administered in any one 24-h period) that can be administered as per the protocol referenced in the clinical trial authorisation. The maximum dose per treatment period that can be administered as per the protocol referenced in the clinical trial authorisation. The maximum treatment period during which an Investigational Medicinal Product can be administered as per the protocol referenced in the clinical trial authorisation. A species for which this route applies. A pharmaceutical product described in terms of its composition and dose form. Coded expression for the species. A species specific time during which consumption of animal product is not appropriate. A pharmaceutical product described in terms of its composition and dose form. Coded expression for the type of tissue for which the withdrawal period applues, e.g. meat, milk. A value for the time. Extra information about the withdrawal period. Describe the undesirable effects of the medicinal product. Describe the undesirable effects of the medicinal product. If the element is present, it must have either a @value, an @id, or extensions The medication for which this is an indication. The symptom, condition or undesirable effect. Classification of the effect. The frequency of occurrence of the effect. The population group to which this applies. Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted. Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted. If the element is present, it must have either a @value, an @id, or extensions The business identifier that is used to reference the MessageDefinition and *is* expected to be consistent from server to server. A formal identifier that is used to identify this message definition when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the message definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the message definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the message definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the message definition. A MessageDefinition that is superseded by this definition. The status of this message definition. Enables tracking the life-cycle of the content. A Boolean value to indicate that this message definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the message definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the message definition changes. The name of the organization or individual that published the message definition. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the message definition from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate message definition instances. A legal or geographic region in which the message definition is intended to be used. Explanation of why this message definition is needed and why it has been designed as it has. A copyright statement relating to the message definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the message definition. The MessageDefinition that is the basis for the contents of this resource. Identifies a protocol or workflow that this MessageDefinition represents a step in. Event code or link to the EventDefinition. The impact of the content of the message. Identifies the resource (or resources) that are being addressed by the event. For example, the Encounter for an admit message or two Account records for a merge. Declare at a message definition level whether a response is required or only upon error or success, or never. Indicates what types of messages may be sent as an application-level response to this message. Canonical reference to a GraphDefinition. If a URL is provided, it is the canonical reference to a [[[GraphDefinition]]] that it controls what resources are to be added to the bundle when building the document. The GraphDefinition can also specify profiles that apply to the various resources. Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted. The kind of resource that must be the focus for this message. A profile that reflects constraints for the focal resource (and potentially for related resources). Identifies the minimum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition. Identifies the maximum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition. Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted. A reference to the message definition that must be adhered to by this supported response. Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses). Consequence Currency Notification The impact of the content of a message. If the element is present, it must have either a @value, an @id, or extensions Always Error/reject conditions only Never Successful completion only HL7-defined table of codes which identify conditions under which acknowledgments are required to be returned in response to a message. If the element is present, it must have either a @value, an @id, or extensions The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. If the element is present, it must have either a @value, an @id, or extensions Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value "http://terminology.hl7.org/CodeSystem/message-events". Alternatively uri to the EventDefinition. The destination application which the message is intended for. Identifies the sending system to allow the use of a trust relationship. The person or device that performed the data entry leading to this message. When there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions. The logical author of the message - the person or device that decided the described event should happen. When there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions. The source application from which this message originated. The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party. Coded indication of the cause for the event - indicates a reason for the occurrence of the event that is a focus of this message. Information about the message that this message is a response to. Only present if this message is a response. The actual data of the message - a reference to the root/focus class of the event. Permanent link to the MessageDefinition for this message. The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. Human-readable name for the target system. Identifies the target end system in situations where the initial message transmission is to an intermediary system. Indicates where the message should be routed to. Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient. The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. Human-readable name for the source system. May include configuration or other information useful in debugging. Can convey versions of multiple systems in situations where a message passes through multiple hands. An e-mail, phone, website or other contact point to use to resolve issues with message communications. Identifies the routing target to send acknowledgements to. The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. The MessageHeader.id of the message to which this message is a response. Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not. Full details of any issues found in the message. OK Transient Error Fatal Error The kind of response to a message. If the element is present, it must have either a @value, an @id, or extensions Raw data describing a biological sequence. Raw data describing a biological sequence. If the element is present, it must have either a @value, an @id, or extensions A unique identifier for this particular sequence instance. This is a FHIR-defined id. Amino Acid Sequence/ DNA Sequence / RNA Sequence. Whether the sequence is numbered starting at 0 (0-based numbering or coordinates, inclusive start, exclusive end) or starting at 1 (1-based numbering, inclusive start and inclusive end). The patient whose sequencing results are described by this resource. Specimen used for sequencing. The method for sequencing, for example, chip information. The organization or lab that should be responsible for this result. The number of copies of the sequence of interest. (RNASeq). A sequence that is used as a reference to describe variants that are present in a sequence analyzed. The definition of variant here originates from Sequence ontology ([variant_of](http://www.sequenceontology.org/browser/current_svn/term/variant_of)). This element can represent amino acid or nucleic sequence change(including insertion,deletion,SNP,etc.) It can represent some complex mutation or segment variation with the assist of CIGAR string. Sequence that was observed. It is the result marked by referenceSeq along with variant records on referenceSeq. This shall start from referenceSeq.windowStart and end by referenceSeq.windowEnd. An experimental feature attribute that defines the quality of the feature in a quantitative way, such as a phred quality score ([SO:0001686](http://www.sequenceontology.org/browser/current_svn/term/SO:0001686)). Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence. Configurations of the external repository. The repository shall store target's observedSeq or records related with target's observedSeq. Pointer to next atomic sequence which at most contains one variant. Information about chromosome structure variation. Raw data describing a biological sequence. Structural unit composed of a nucleic acid molecule which controls its own replication through the interaction of specific proteins at one or more origins of replication ([SO:0000340](http://www.sequenceontology.org/browser/current_svn/term/SO:0000340)). The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'. Version number must be included if a versioned release of a primary build was used. A relative reference to a DNA strand based on gene orientation. The strand that contains the open reading frame of the gene is the "sense" strand, and the opposite complementary strand is the "antisense" strand. Reference identifier of reference sequence submitted to NCBI. It must match the type in the MolecularSequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences. A pointer to another MolecularSequence entity as reference sequence. A string like "ACGT". An absolute reference to a strand. The Watson strand is the strand whose 5'-end is on the short arm of the chromosome, and the Crick strand as the one whose 5'-end is on the long arm. Start position of the window on the reference sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive. End position of the window on the reference sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. Raw data describing a biological sequence. Start position of the variant on the reference sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive. End position of the variant on the reference sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end. An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end. Extended CIGAR string for aligning the sequence with reference bases. See detailed documentation [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm). A pointer to an Observation containing variant information. Raw data describing a biological sequence. INDEL / SNP / Undefined variant. Gold standard sequence used for comparing against. Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive. End position of the sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. The score of an experimentally derived feature such as a p-value ([SO:0001685](http://www.sequenceontology.org/browser/current_svn/term/SO:0001685)). Which method is used to get sequence quality. True positives, from the perspective of the truth data, i.e. the number of sites in the Truth Call Set for which there are paths through the Query Call Set that are consistent with all of the alleles at this site, and for which there is an accurate genotype call for the event. True positives, from the perspective of the query data, i.e. the number of sites in the Query Call Set for which there are paths through the Truth Call Set that are consistent with all of the alleles at this site, and for which there is an accurate genotype call for the event. False negatives, i.e. the number of sites in the Truth Call Set for which there is no path through the Query Call Set that is consistent with all of the alleles at this site, or sites for which there is an inaccurate genotype call for the event. Sites with correct variant but incorrect genotype are counted here. False positives, i.e. the number of sites in the Query Call Set for which there is no path through the Truth Call Set that is consistent with this site. Sites with correct variant but incorrect genotype are counted here. The number of false positives where the non-REF alleles in the Truth and Query Call Sets match (i.e. cases where the truth is 1/1 and the query is 0/1 or similar). QUERY.TP / (QUERY.TP + QUERY.FP). TRUTH.TP / (TRUTH.TP + TRUTH.FN). Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall). Receiver Operator Characteristic (ROC) Curve to give sensitivity/specificity tradeoff. Raw data describing a biological sequence. Invidual data point representing the GQ (genotype quality) score threshold. The number of true positives if the GQ score threshold was set to "score" field value. The number of false positives if the GQ score threshold was set to "score" field value. The number of false negatives if the GQ score threshold was set to "score" field value. Calculated precision if the GQ score threshold was set to "score" field value. Calculated sensitivity if the GQ score threshold was set to "score" field value. Calculated fScore if the GQ score threshold was set to "score" field value. Raw data describing a biological sequence. Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource. URI of an external repository which contains further details about the genetics data. URI of an external repository which contains further details about the genetics data. Id of the variant in this external repository. The server will understand how to use this id to call for more info about datasets in external repository. Id of the variantset in this external repository. The server will understand how to use this id to call for more info about variantsets in external repository. Id of the read in this external repository. Raw data describing a biological sequence. Information about chromosome structure variation DNA change type. Used to indicate if the outer and inner start-end values have the same meaning. Length of the variant chromosome. Structural variant outer. Structural variant inner. Raw data describing a biological sequence. Structural variant outer start. If the coordinate system is either 0-based or 1-based, then start position is inclusive. Structural variant outer end. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. Raw data describing a biological sequence. Structural variant inner start. If the coordinate system is either 0-based or 1-based, then start position is inclusive. Structural variant inner end. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. Watson strand of referenceSeq Crick strand of referenceSeq Type for strand. If the element is present, it must have either a @value, an @id, or extensions Sense orientation of referenceSeq Antisense orientation of referenceSeq Type for orientation. If the element is present, it must have either a @value, an @id, or extensions Click and see The URL is the RESTful or other kind of API that can access to the result. Result cannot be access unless an account is logged in Result need to be fetched with API and need LOGIN( or cookies are required when visiting the link of resource) Some other complicated or particular way to get resource from URL. Type for access of external URI. If the element is present, it must have either a @value, an @id, or extensions INDEL Comparison SNP Comparison UNKNOWN Comparison Type for quality report. If the element is present, it must have either a @value, an @id, or extensions AA Sequence DNA Sequence RNA Sequence Type if a sequence -- DNA, RNA, or amino acid sequence. If the element is present, it must have either a @value, an @id, or extensions A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. If the element is present, it must have either a @value, an @id, or extensions A natural language name identifying the naming system. This name should be usable as an identifier for the module by machine processing applications such as code generation. The status of this naming system. Enables tracking the life-cycle of the content. Indicates the purpose for the naming system - what kinds of things does it make unique? The date (and optionally time) when the naming system was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the naming system changes. The name of the organization or individual that published the naming system. Contact details to assist a user in finding and communicating with the publisher. The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision. Categorizes a naming system for easier search by grouping related naming systems. A free text natural language description of the naming system from a consumer's perspective. Details about what the namespace identifies including scope, granularity, version labeling, etc. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate naming system instances. A legal or geographic region in which the naming system is intended to be used. Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc. Indicates how the system may be identified when referenced in electronic exchange. A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. Identifies the unique identifier scheme used for this particular identifier. The string that should be sent over the wire to identify the code system or identifier system. Indicates whether this identifier is the "preferred" identifier of this type. Notes about the past or intended usage of this identifier. Identifies the period of time over which this identifier is considered appropriate to refer to the naming system. Outside of this window, the identifier might be non-deterministic. OID UUID URI Other Identifies the style of unique identifier used to identify a namespace. If the element is present, it must have either a @value, an @id, or extensions Code System Identifier Root Identifies the purpose of the naming system. If the element is present, it must have either a @value, an @id, or extensions A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. If the element is present, it must have either a @value, an @id, or extensions Identifiers assigned to this order by the order sender or by the order receiver. The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this NutritionOrder. The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this NutritionOrder. The URL pointing to a protocol, guideline, orderset or other definition that is adhered to in whole or in part by this NutritionOrder. The workflow status of the nutrition order/request. Indicates the level of authority/intentionality associated with the NutrionOrder and where the request fits into the workflow chain. The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding. An encounter that provides additional information about the healthcare context in which this request is made. The date and time that this nutrition order was requested. The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings. A link to a record of allergies or intolerances which should be included in the nutrition order. This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings. This modifier is used to convey Order-specific modifier about the type of oral food or oral fluids that should not be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. While it should not be necessary to repeat allergy or intolerance information captured in the referenced AllergyIntolerance resource in the excludeFoodModifier, this element may be used to convey additional specificity related to foods that should be eliminated from the patient’s diet for any reason. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings. Diet given orally in contrast to enteral (tube) feeding. Oral nutritional products given in order to add further nutritional value to the patient's diet. Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity. Comments made about the {{title}} by the requester, performer, subject or other participants. A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet. The time period and frequency at which the diet should be given. The diet should be given for the combination of all schedules if more than one schedule is present. Class that defines the quantity and type of nutrient modifications (for example carbohydrate, fiber or sodium) required for the oral diet. Class that describes any texture modifications required for the patient to safely consume various types of solid foods. The required consistency (e.g. honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient. Free text or additional instructions or information pertaining to the oral diet. A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. The nutrient that is being modified such as carbohydrate or sodium. The quantity of the specified nutrient to include in diet. A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed. The food type(s) (e.g. meats, all foods) that the texture modification applies to. This could be all foods types. A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement. The product or brand name of the nutritional supplement such as "Acme Protein Shake". The time period and frequency at which the supplement(s) should be given. The supplement should be given for the combination of all schedules if more than one schedule is present. The amount of the nutritional supplement to be given. Free text or additional instructions or information pertaining to the oral supplement. A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula. The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula". Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula. The product or brand name of the type of modular component to be added to the formula. The amount of energy (calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula that provides 24 calories per fluid ounce or an adult may require an enteral formula that provides 1.5 calorie/mL. The route or physiological path of administration into the patient's gastrointestinal tract for purposes of providing the formula feeding, e.g. nasogastric tube. Formula administration instructions as structured data. This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding. An example of this would be an instruction to increase the rate of continuous feeding every 2 hours. The maximum total quantity of formula that may be administered to a subject over the period of time, e.g. 1440 mL over 24 hours. Free text formula administration, feeding instructions or additional instructions or information. A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. The time period and frequency at which the enteral formula should be delivered to the patient. The volume of formula to provide to the patient per the specified administration schedule. The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule. Measurements and simple assertions made about a patient, device or other subject. Measurements and simple assertions made about a patient, device or other subject. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this observation. A plan, proposal or order that is fulfilled in whole or in part by this event. For example, a MedicationRequest may require a patient to have laboratory test performed before it is dispensed. A larger event of which this particular Observation is a component or step. For example, an observation as part of a procedure. The status of the result value. A code that classifies the general type of observation being made. Describes what was observed. Sometimes this is called the observation "name". The patient, or group of patients, location, or device this observation is about and into whose record the observation is placed. If the actual focus of the observation is different from the subject (or a sample of, part, or region of the subject), the `focus` element or the `code` itself specifies the actual focus of the observation. The actual focus of an observation when it is not the patient of record representing something or someone associated with the patient such as a spouse, parent, fetus, or donor. For example, fetus observations in a mother's record. The focus of an observation could also be an existing condition, an intervention, the subject's diet, another observation of the subject, or a body structure such as tumor or implanted device. An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus. The healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made. The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself. The date and time this version of the observation was made available to providers, typically after the results have been reviewed and verified. Who was responsible for asserting the observed value as "true". The information determined as a result of making the observation, if the information has a simple value. Provides a reason why the expected value in the element Observation.value[x] is missing. A categorical assessment of an observation value. For example, high, low, normal. Comments about the observation or the results. Indicates the site on the subject's body where the observation was made (i.e. the target site). Indicates the mechanism used to perform the observation. The specimen that was used when this observation was made. The device used to generate the observation data. Guidance on how to interpret the value by comparison to a normal or recommended range. Multiple reference ranges are interpreted as an "OR". In other words, to represent two distinct target populations, two `referenceRange` elements would be used. This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group. The target resource that represents a measurement from which this observation value is derived. For example, a calculated anion gap or a fetal measurement based on an ultrasound image. Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same attributes. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations. Measurements and simple assertions made about a patient, device or other subject. The value of the low bound of the reference range. The low bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the low bound is omitted, it is assumed to be meaningless (e.g. reference range is <=2.3). The value of the high bound of the reference range. The high bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the high bound is omitted, it is assumed to be meaningless (e.g. reference range is >= 2.3). Codes to indicate the what part of the targeted reference population it applies to. For example, the normal or therapeutic range. Codes to indicate the target population this reference range applies to. For example, a reference range may be based on the normal population or a particular sex or race. Multiple `appliesTo` are interpreted as an "AND" of the target populations. For example, to represent a target population of African American females, both a code of female and a code for African American would be used. The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so. Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of "normals". Measurements and simple assertions made about a patient, device or other subject. Describes what was observed. Sometimes this is called the observation "code". The information determined as a result of making the observation, if the information has a simple value. Provides a reason why the expected value in the element Observation.component.value[x] is missing. A categorical assessment of an observation value. For example, high, low, normal. Guidance on how to interpret the value by comparison to a normal or recommended range. Set of definitional characteristics for a kind of observation or measurement produced or consumed by an orderable health care service. Set of definitional characteristics for a kind of observation or measurement produced or consumed by an orderable health care service. If the element is present, it must have either a @value, an @id, or extensions A code that classifies the general type of observation. Describes what will be observed. Sometimes this is called the observation "name". A unique identifier assigned to this ObservationDefinition artifact. The data types allowed for the value element of the instance observations conforming to this ObservationDefinition. Multiple results allowed for observations conforming to this ObservationDefinition. The method or technique used to perform the observation. The preferred name to be used when reporting the results of observations conforming to this ObservationDefinition. Characteristics for quantitative results of this observation. Multiple ranges of results qualified by different contexts for ordinal or continuous observations conforming to this ObservationDefinition. The set of valid coded results for the observations conforming to this ObservationDefinition. The set of normal coded results for the observations conforming to this ObservationDefinition. The set of abnormal coded results for the observation conforming to this ObservationDefinition. The set of critical coded results for the observation conforming to this ObservationDefinition. Set of definitional characteristics for a kind of observation or measurement produced or consumed by an orderable health care service. Customary unit used to report quantitative results of observations conforming to this ObservationDefinition. SI unit used to report quantitative results of observations conforming to this ObservationDefinition. Factor for converting value expressed with SI unit to value expressed with customary unit. Number of digits after decimal separator when the results of such observations are of type Quantity. Set of definitional characteristics for a kind of observation or measurement produced or consumed by an orderable health care service. The category of interval of values for continuous or ordinal observations conforming to this ObservationDefinition. The low and high values determining the interval. There may be only one of the two. Codes to indicate the health context the range applies to. For example, the normal or therapeutic range. Codes to indicate the target population this reference range applies to. Sex of the population the range applies to. The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so. The gestational age to which this reference range is applicable, in the context of pregnancy. Text based condition for which the reference range is valid. Quantity CodeableConcept string boolean integer Range Ratio SampledData time dateTime Period Permitted data type for observation value. If the element is present, it must have either a @value, an @id, or extensions reference range critical range absolute range Codes identifying the category of observation range. If the element is present, it must have either a @value, an @id, or extensions A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this operation definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this operation definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the operation definition is stored on different servers. The identifier that is used to identify this version of the operation definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the operation definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the operation definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the operation definition. The status of this operation definition. Enables tracking the life-cycle of the content. Whether this is an operation or a named query. A Boolean value to indicate that this operation definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the operation definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the operation definition changes. The name of the organization or individual that published the operation definition. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the operation definition from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate operation definition instances. A legal or geographic region in which the operation definition is intended to be used. Explanation of why this operation definition is needed and why it has been designed as it has. Whether the operation affects state. Side effects such as producing audit trail entries do not count as 'affecting state'. The name used to invoke the operation. Additional information about how to use this operation or named query. Indicates that this operation definition is a constraining profile on the base. The types on which this operation can be executed. Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context). Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a specific resource id for the context). Indicates whether this operation can be invoked on a particular instance of one of the given types. Additional validation information for the in parameters - a single profile that covers all the parameters. The profile is a constraint on the parameters resource as a whole. Additional validation information for the out parameters - a single profile that covers all the parameters. The profile is a constraint on the parameters resource. The parameters for the operation/query. Defines an appropriate combination of parameters to use when invoking this operation, to help code generators when generating overloaded parameter sets for this operation. A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). The name of used to identify the parameter. Whether this is an input or an output parameter. The minimum number of times this parameter SHALL appear in the request or response. The maximum number of times this element is permitted to appear in the request or response. Describes the meaning or use of this parameter. The type for this parameter. Used when the type is "Reference" or "canonical", and identifies a profile structure or implementation Guide that applies to the target of the reference this parameter refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the target resource SHALL conform to at least one profile defined in the implementation guide. How the parameter is understood as a search parameter. This is only used if the parameter type is 'string'. Binds to a value set if this parameter is coded (code, Coding, CodeableConcept). Identifies other resource parameters within the operation invocation that are expected to resolve to this resource. The parts of a nested Parameter. A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances. Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used. A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). The name of the parameter or dot-separated path of parameter names pointing to the resource parameter that is expected to contain a reference to this resource. The id of the element in the referencing resource that is expected to resolve to this resource. A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). Name of parameter to include in overload. Comments to go on overload. In Out Whether an operation parameter is an input or an output parameter. If the element is present, it must have either a @value, an @id, or extensions Operation Query Whether an operation is a normal operation or a query. If the element is present, it must have either a @value, an @id, or extensions A collection of error, warning, or information messages that result from a system action. A collection of error, warning, or information messages that result from a system action. If the element is present, it must have either a @value, an @id, or extensions An error, warning, or information message that results from a system action. A collection of error, warning, or information messages that result from a system action. Indicates whether the issue indicates a variation from successful processing. Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element. Additional details about the error. This may be a text description of the error or a system code that identifies the error. Additional diagnostic information about the issue. This element is deprecated because it is XML specific. It is replaced by issue.expression, which is format independent, and simpler to parse. For resource issues, this will be a simple XPath limited to element names, repetition indicators and the default child accessor that identifies one of the elements in the resource that caused this issue to be raised. For HTTP errors, will be "http." + the parameter name. A [simple subset of FHIRPath](fhirpath.html#simple) limited to element names, repetition indicators and the default child accessor that identifies one of the elements in the resource that caused this issue to be raised. Invalid Content Structural Issue Required element missing Element value invalid Validation rule failed Security Problem Login Required Unknown User Session Expired Forbidden Information Suppressed Processing Failure Content not supported Duplicate Multiple Matches Not Found Deleted Content Too Long Invalid Code Unacceptable Extension Operation Too Costly Business Rule Violation Edit Version Conflict Transient Issue Lock Error No Store Available Exception Timeout Incomplete Results Throttled Informational Note A code that describes the type of issue. If the element is present, it must have either a @value, an @id, or extensions Fatal Error Warning Information How the issue affects the success of the action. If the element is present, it must have either a @value, an @id, or extensions A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, payer/insurer, etc. A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, payer/insurer, etc. If the element is present, it must have either a @value, an @id, or extensions Identifier for the organization that is used to identify the organization across multiple disparate systems. Whether the organization's record is still in active use. The kind(s) of organization that this is. A name associated with the organization. A list of alternate names that the organization is known as, or was known as in the past. A contact detail for the organization. An address for the organization. The organization of which this organization forms a part. Contact for the organization for a certain purpose. Technical endpoints providing access to services operated for the organization. A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, payer/insurer, etc. Indicates a purpose for which the contact can be reached. A name associated with the contact. A contact detail (e.g. a telephone number or an email address) by which the party may be contacted. Visiting or postal addresses for the contact. Defines an affiliation/assotiation/relationship between 2 distinct oganizations, that is not a part-of relationship/sub-division relationship. Defines an affiliation/assotiation/relationship between 2 distinct oganizations, that is not a part-of relationship/sub-division relationship. If the element is present, it must have either a @value, an @id, or extensions Business identifiers that are specific to this role. Whether this organization affiliation record is in active use. The period during which the participatingOrganization is affiliated with the primary organization. Organization where the role is available (primary organization/has members). The Participating Organization provides/performs the role(s) defined by the code to the Primary Organization (e.g. providing services or is a member of). Health insurance provider network in which the participatingOrganization provides the role's services (if defined) at the indicated locations (if defined). Definition of the role the participatingOrganization plays in the association. Specific specialty of the participatingOrganization in the context of the role. The location(s) at which the role occurs. Healthcare services provided through the role. Contact details at the participatingOrganization relevant to this Affiliation. Technical endpoints providing access to services operated for this role. This resource is a non-persisted resource used to pass information into and back from an [operation](operations.html). It has no other use, and there is no RESTful endpoint associated with it. This resource is a non-persisted resource used to pass information into and back from an [operation](operations.html). It has no other use, and there is no RESTful endpoint associated with it. If the element is present, it must have either a @value, an @id, or extensions A parameter passed to or received from the operation. This resource is a non-persisted resource used to pass information into and back from an [operation](operations.html). It has no other use, and there is no RESTful endpoint associated with it. The name of the parameter (reference to the operation definition). If the parameter is a data type. If the parameter is a whole resource. A named part of a multi-part parameter. Demographics and other administrative information about an individual or animal receiving care or other health-related services. Demographics and other administrative information about an individual or animal receiving care or other health-related services. If the element is present, it must have either a @value, an @id, or extensions An identifier for this patient. Whether this patient record is in active use. Many systems use this property to mark as non-current patients, such as those that have not been seen for a period of time based on an organization's business rules. It is often used to filter patient lists to exclude inactive patients Deceased patients may also be marked as inactive for the same reasons, but may be active for some time after death. A name associated with the individual. A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted. Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. The date of birth for the individual. Indicates if the individual is deceased or not. An address for the individual. This field contains a patient's most recent marital (civil) status. Indicates whether the patient is part of a multiple (boolean) or indicates the actual birth order (integer). Image of the patient. A contact party (e.g. guardian, partner, friend) for the patient. A language which may be used to communicate with the patient about his or her health. Patient's nominated care provider. Organization that is the custodian of the patient record. Link to another patient resource that concerns the same actual patient. Demographics and other administrative information about an individual or animal receiving care or other health-related services. The nature of the relationship between the patient and the contact person. A name associated with the contact person. A contact detail for the person, e.g. a telephone number or an email address. Address for the contact person. Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes. Organization on behalf of which the contact is acting or for which the contact is working. The period during which this contact person or organization is valid to be contacted relating to this patient. Demographics and other administrative information about an individual or animal receiving care or other health-related services. The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English. Indicates whether or not the patient prefers this language (over other languages he masters up a certain level). Demographics and other administrative information about an individual or animal receiving care or other health-related services. The other patient resource that the link refers to. The type of link between this patient resource and another patient resource. Replaced-by Vervangen door Replaces Vervangt Refer Verwijzing See also Zie ook The type of link between this patient resource and another patient resource. If the element is present, it must have either a @value, an @id, or extensions This resource provides the status of the payment for goods and services rendered, and the request and response resource references. This resource provides the status of the payment for goods and services rendered, and the request and response resource references. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this payment notice. The status of the resource instance. Reference of resource for which payment is being made. Reference of response to resource for which payment is being made. The date when this resource was created. The practitioner who is responsible for the services rendered to the patient. A reference to the payment which is the subject of this notice. The date when the above payment action occurred. The party who will receive or has received payment that is the subject of this notification. The party who is notified of the payment status. The amount sent to the payee. A code indicating whether payment has been sent or cleared. This resource provides the details including amount of a payment and allocates the payment items being paid. This resource provides the details including amount of a payment and allocates the payment items being paid. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this payment reconciliation. The status of the resource instance. The period of time for which payments have been gathered into this bulk payment for settlement. The date when the resource was created. The party who generated the payment. Original request resource reference. The practitioner who is responsible for the services rendered to the patient. The outcome of a request for a reconciliation. A human readable description of the status of the request for the reconciliation. The date of payment as indicated on the financial instrument. Total payment amount as indicated on the financial instrument. Issuer's unique identifier for the payment instrument. Distribution of the payment amount for a previously acknowledged payable. A code for the form to be used for printing the content. A note that describes or explains the processing in a human readable form. This resource provides the details including amount of a payment and allocates the payment items being paid. Unique identifier for the current payment item for the referenced payable. Unique identifier for the prior payment item for the referenced payable. Code to indicate the nature of the payment. A resource, such as a Claim, the evaluation of which could lead to payment. The party which submitted the claim or financial transaction. A resource, such as a ClaimResponse, which contains a commitment to payment. The date from the response resource containing a commitment to pay. A reference to the individual who is responsible for inquiries regarding the response and its payment. The party which is receiving the payment. The monetary amount allocated from the total payment to the payable. This resource provides the details including amount of a payment and allocates the payment items being paid. The business purpose of the note text. The explanation or description associated with the processing. Demographics and administrative information about a person independent of a specific health-related context. Demographics and administrative information about a person independent of a specific health-related context. If the element is present, it must have either a @value, an @id, or extensions Identifier for a person within a particular scope. A name associated with the person. A contact detail for the person, e.g. a telephone number or an email address. Administrative Gender. The birth date for the person. One or more addresses for the person. An image that can be displayed as a thumbnail of the person to enhance the identification of the individual. The organization that is the custodian of the person record. Whether this person's record is in active use. Link to a resource that concerns the same actual person. Demographics and administrative information about a person independent of a specific health-related context. The resource to which this actual person is associated. Level of assurance that this link is associated with the target resource. Level 1 Level 2 Level 3 Level 4 The level of confidence that this link represents the same actual person, based on NIST Authentication Levels. If the element is present, it must have either a @value, an @id, or extensions This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols. This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this plan definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this plan definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the plan definition is stored on different servers. A formal identifier that is used to identify this plan definition when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the plan definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the plan definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts. A natural language name identifying the plan definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the plan definition. An explanatory or alternate title for the plan definition giving additional information about its content. A high-level category for the plan definition that distinguishes the kinds of systems that would be interested in the plan definition. The status of this plan definition. Enables tracking the life-cycle of the content. A Boolean value to indicate that this plan definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. A code or group definition that describes the intended subject of the plan definition. The date (and optionally time) when the plan definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the plan definition changes. The name of the organization or individual that published the plan definition. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the plan definition from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate plan definition instances. A legal or geographic region in which the plan definition is intended to be used. Explanation of why this plan definition is needed and why it has been designed as it has. A detailed description of how the plan definition is used from a clinical perspective. A copyright statement relating to the plan definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the plan definition. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the plan definition content was or is planned to be in active use. Descriptive topics related to the content of the plan definition. Topics provide a high-level categorization of the definition that can be useful for filtering and searching. An individiual or organization primarily involved in the creation and maintenance of the content. An individual or organization primarily responsible for internal coherence of the content. An individual or organization primarily responsible for review of some aspect of the content. An individual or organization responsible for officially endorsing the content for use in some setting. Related artifacts such as additional documentation, justification, or bibliographic references. A reference to a Library resource containing any formal logic used by the plan definition. Goals that describe what the activities within the plan are intended to achieve. For example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc. An action or group of actions to be taken as part of the plan. This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols. Indicates a category the goal falls within. Human-readable and/or coded description of a specific desired objective of care, such as "control blood pressure" or "negotiate an obstacle course" or "dance with child at wedding". Identifies the expected level of importance associated with reaching/sustaining the defined goal. The event after which the goal should begin being pursued. Identifies problems, conditions, issues, or concerns the goal is intended to address. Didactic or other informational resources associated with the goal that provide further supporting information about the goal. Information resources can include inline text commentary and links to web resources. Indicates what should be done and within what timeframe. This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols. The parameter whose value is to be tracked, e.g. body weight, blood pressure, or hemoglobin A1c level. The target value of the measure to be achieved to signify fulfillment of the goal, e.g. 150 pounds or 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any value at or above the low value. Indicates the timeframe after the start of the goal in which the goal should be met. This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols. A user-visible prefix for the action. The title of the action displayed to a user. A brief description of the action used to provide a summary to display to the user. A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that might not be capable of interpreting it dynamically. Indicates how quickly the action should be addressed with respect to other actions. A code that provides meaning for the action or action group. For example, a section may have a LOINC code for the section of a documentation template. A description of why this action is necessary or appropriate. Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources. Identifies goals that this action supports. The reference must be to a goal element defined within this plan definition. A code or group definition that describes the intended subject of the action and its children, if any. A description of when the action should be triggered. An expression that describes applicability criteria or start/stop conditions for the action. Defines input data requirements for the action. Defines the outputs of the action, if any. A relationship to another action such as "before" or "30-60 minutes after start of". An optional value describing when the action should be performed. Indicates who should participate in performing the action described. The type of action to perform (create, update, remove). Defines the grouping behavior for the action and its children. Defines the selection behavior for the action and its children. Defines the required behavior for the action. Defines whether the action should usually be preselected. Defines whether the action can be selected multiple times. A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken. A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input. Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result. Sub actions that are contained within the action. The behavior of this action determines the functionality of the sub-actions. For example, a selection behavior of at-most-one indicates that of the sub-actions, at most one may be chosen as part of realizing the action definition. This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols. The kind of condition. An expression that returns true or false, indicating whether the condition is satisfied. This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols. The element id of the related action. The relationship of this action to the related action. A duration or range of durations to apply to the relationship. For example, 30-60 minutes before. This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols. The type of participant in the action. The role the participant should play in performing the described action. This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols. The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolveable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details). An expression specifying the value of the customized element. Must Could Must Unless Documented Defines expectations around whether an action or action group is required. If the element is present, it must have either a @value, an @id, or extensions Before Start Before Before End Concurrent With Start Concurrent Concurrent With End After Start After After End Defines the types of relationships between actions. If the element is present, it must have either a @value, an @id, or extensions Visual Group Logical Group Sentence Group Defines organization behavior of a group. If the element is present, it must have either a @value, an @id, or extensions Any All All Or None Exactly One At Most One One Or More Defines selection behavior of a group. If the element is present, it must have either a @value, an @id, or extensions Single Multiple Defines behavior for an action or a group for how many times that item may be repeated. If the element is present, it must have either a @value, an @id, or extensions Yes No Defines selection frequency behavior for an action or group. If the element is present, it must have either a @value, an @id, or extensions Applicability Start Stop Defines the kinds of conditions that can appear on actions. If the element is present, it must have either a @value, an @id, or extensions A person who is directly or indirectly involved in the provisioning of healthcare. A person who is directly or indirectly involved in the provisioning of healthcare. If the element is present, it must have either a @value, an @id, or extensions An identifier that applies to this person in this role. Whether this practitioner's record is in active use. The name(s) associated with the practitioner. A contact detail for the practitioner, e.g. a telephone number or an email address. Address(es) of the practitioner that are not role specific (typically home address). Work addresses are not typically entered in this property as they are usually role dependent. Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. The date of birth for the practitioner. Image of the person. The official certifications, training, and licenses that authorize or otherwise pertain to the provision of care by the practitioner. For example, a medical license issued by a medical board authorizing the practitioner to practice medicine within a certian locality. A language the practitioner can use in patient communication. A person who is directly or indirectly involved in the provisioning of healthcare. An identifier that applies to this person's qualification in this role. Coded representation of the qualification. Period during which the qualification is valid. Organization that regulates and issues the qualification. A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time. A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time. If the element is present, it must have either a @value, an @id, or extensions Business Identifiers that are specific to a role/location. Whether this practitioner role record is in active use. The period during which the person is authorized to act as a practitioner in these role(s) for the organization. Practitioner that is able to provide the defined services for the organization. The organization where the Practitioner performs the roles associated. Roles which this practitioner is authorized to perform for the organization. Specific specialty of the practitioner. The location(s) at which this practitioner provides care. The list of healthcare services that this worker provides for this role's Organization/Location(s). Contact details that are specific to the role/location/service. A collection of times the practitioner is available or performing this role at the location and/or healthcareservice. The practitioner is not available or performing this role during this period of time due to the provided reason. A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times. Technical endpoints providing access to services operated for the practitioner with this role. A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time. Indicates which days of the week are available between the start and end Times. Is this always available? (hence times are irrelevant) e.g. 24 hour service. The opening time of day. Note: If the AllDay flag is set, then this time is ignored. The closing time of day. Note: If the AllDay flag is set, then this time is ignored. A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time. The reason that can be presented to the user as to why this time is not available. Service is not available (seasonally or for a public holiday) from this date. An action that is or was performed on or for a patient. This can be a physical intervention like an operation, or less invasive like long term services, counseling, or hypnotherapy. An action that is or was performed on or for a patient. This can be a physical intervention like an operation, or less invasive like long term services, counseling, or hypnotherapy. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this procedure by the performer or other systems which remain constant as the resource is updated and is propagated from server to server. The URL pointing to a FHIR-defined protocol, guideline, order set or other definition that is adhered to in whole or in part by this Procedure. The URL pointing to an externally maintained protocol, guideline, order set or other definition that is adhered to in whole or in part by this Procedure. A reference to a resource that contains details of the request for this procedure. A larger event of which this particular procedure is a component or step. A code specifying the state of the procedure. Generally, this will be the in-progress or completed state. Captures the reason for the current state of the procedure. A code that classifies the procedure for searching, sorting and display purposes (e.g. "Surgical Procedure"). The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. "Laparoscopic Appendectomy"). The person, animal or group on which the procedure was performed. The Encounter during which this Procedure was created or performed or to which the creation of this record is tightly associated. Estimated or actual date, date-time, period, or age when the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured. Individual who recorded the record and takes responsibility for its content. Individual who is making the procedure statement. Limited to "real" people rather than equipment. The location where the procedure actually happened. E.g. a newborn at home, a tracheostomy at a restaurant. The coded reason why the procedure was performed. This may be a coded entity of some type, or may simply be present as text. The justification of why the procedure was performed. Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion. The outcome of the procedure - did it resolve the reasons for the procedure being performed? This could be a histology result, pathology report, surgical report, etc. Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues. Any complications that occurred during the procedure, or in the immediate post-performance period. If the procedure required specific follow up - e.g. removal of sutures. The follow up may be represented as a simple note or could potentially be more complex, in which case the CarePlan resource can be used. Any other notes and comments about the procedure. A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure. Identifies medications, devices and any other substance used as part of the procedure. Identifies coded items that were used as part of the procedure. An action that is or was performed on or for a patient. This can be a physical intervention like an operation, or less invasive like long term services, counseling, or hypnotherapy. Distinguishes the type of involvement of the performer in the procedure. For example, surgeon, anaesthetist, endoscopist. The practitioner who was involved in the procedure. The organization the device or practitioner was acting on behalf of. An action that is or was performed on or for a patient. This can be a physical intervention like an operation, or less invasive like long term services, counseling, or hypnotherapy. The kind of change that happened to the device during the procedure. The device that was manipulated (changed) during the procedure. Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies. Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies. If the element is present, it must have either a @value, an @id, or extensions The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity. The period during which the activity occurred. The instant of time at which the activity was recorded. Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc. Where the activity occurred, if relevant. The reason that the activity was taking place. An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities. An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place. An entity used in this activity. A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated. Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies. The participation the agent had with respect to the activity. The function of the agent with respect to the activity. The security role enabling the agent with respect to the activity. The individual, device or organization that participated in the event. The individual, device, or organization for whom the change was made. Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies. How the entity was used during the activity. Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative. The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity. Derivation Revision Quotation Source Removal How an entity was used in an activity. If the element is present, it must have either a @value, an @id, or extensions A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection. A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this questionnaire is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the questionnaire is stored on different servers. A formal identifier that is used to identify this questionnaire when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the questionnaire when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the questionnaire author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the questionnaire. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the questionnaire. The URL of a Questionnaire that this Questionnaire is based on. The status of this questionnaire. Enables tracking the life-cycle of the content. A Boolean value to indicate that this questionnaire is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The types of subjects that can be the subject of responses created for the questionnaire. The date (and optionally time) when the questionnaire was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the questionnaire changes. The name of the organization or individual that published the questionnaire. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the questionnaire from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate questionnaire instances. A legal or geographic region in which the questionnaire is intended to be used. Explanation of why this questionnaire is needed and why it has been designed as it has. A copyright statement relating to the questionnaire and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the questionnaire. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the questionnaire content was or is planned to be in active use. An identifier for this question or group of questions in a particular terminology such as LOINC. A particular question, question grouping or display text that is part of the questionnaire. A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection. An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource. This element is a URI that refers to an [[[ElementDefinition]]] that provides information about this item, including information that might otherwise be included in the instance of the Questionnaire resource. A detailed description of the construction of the URI is shown in Comments, below. If this element is present then the following element values MAY be derived from the Element Definition if the corresponding elements of this Questionnaire resource instance have no value: * code (ElementDefinition.code) * type (ElementDefinition.type) * required (ElementDefinition.min) * repeats (ElementDefinition.max) * maxLength (ElementDefinition.maxLength) * answerValueSet (ElementDefinition.binding) * options (ElementDefinition.binding). A terminology code that corresponds to this group or question (e.g. a code from LOINC, which defines many questions and answers). A short label for a particular group, question or set of display text within the questionnaire used for reference by the individual completing the questionnaire. The name of a section, the text of a question or text content for a display item. The type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.). A constraint indicating that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true. Controls how multiple enableWhen values are interpreted - whether all or any must be true. An indication, if true, that the item must be present in a "completed" QuestionnaireResponse. If false, the item may be skipped when answering the questionnaire. An indication, if true, that the item may occur multiple times in the response, collecting multiple answers for questions or multiple sets of answers for groups. An indication, when true, that the value cannot be changed by a human respondent to the Questionnaire. The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponse. A reference to a value set containing a list of codes representing permitted answers for a "choice" or "open-choice" question. One of the permitted answers for a "choice" or "open-choice" question. One or more values that should be pre-populated in the answer when initially rendering the questionnaire for user input. Text, questions and other groups to be nested beneath a question or group. A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection. The linkId for the question whose answer (or lack of answer) governs whether this item is enabled. Specifies the criteria by which the question is enabled. A value that the referenced question is tested using the specified operator in order for the item to be enabled. A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection. A potential answer that's allowed as the answer to this question. Indicates whether the answer value is selected when the list of possible answers is initially shown. A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection. The actual value to for an initial answer. Group Display Boolean Decimal Integer Date Date Time Time String Text Url Choice Open Choice Attachment Reference Quantity Distinguishes groups from questions and display text and indicates data type for questions. If the element is present, it must have either a @value, an @id, or extensions All Any Controls how multiple enableWhen values are interpreted - whether all or any must be true. If the element is present, it must have either a @value, an @id, or extensions Exists Equals Not Equals Greater Than Less Than Greater or Equals Less or Equals The criteria by which a question is enabled. If the element is present, it must have either a @value, an @id, or extensions A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to. A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to. If the element is present, it must have either a @value, an @id, or extensions A business identifier assigned to a particular completed (or partially completed) questionnaire. The order, proposal or plan that is fulfilled in whole or in part by this QuestionnaireResponse. For example, a ServiceRequest seeking an intake assessment or a decision support recommendation to assess for post-partum depression. A procedure or observation that this questionnaire was performed as part of the execution of. For example, the surgery a checklist was executed as part of. The Questionnaire that defines and organizes the questions for which answers are being provided. The position of the questionnaire response within its overall lifecycle. The subject of the questionnaire response. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information. The Encounter during which this questionnaire response was created or to which the creation of this record is tightly associated. The date and/or time that this set of answers were last changed. Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system. The person who answered the questions about the subject. A group or question item from the original questionnaire for which answers are provided. A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to. The item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource. A reference to an [[[ElementDefinition]]] that provides the details for the item. Text that is displayed above the contents of the group or as the text of the question being answered. The respondent's answer(s) to the question. Questions or sub-groups nested beneath a question or group. A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to. The answer (or one of the answers) provided by the respondent to the question. Nested groups and/or questions found within this particular answer. In Progress Completed Amended Entered in Error Stopped Lifecycle status of the questionnaire response. If the element is present, it must have either a @value, an @id, or extensions Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process. Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process. If the element is present, it must have either a @value, an @id, or extensions Identifier for a person within a particular scope. Whether this related person record is in active use. The patient this person is related to. The nature of the relationship between a patient and the related person. A name associated with the person. A contact detail for the person, e.g. a telephone number or an email address. Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. The date on which the related person was born. Address where the related person can be contacted or visited. Image of the person. The period of time during which this relationship is or was active. If there are no dates defined, then the interval is unknown. A language which may be used to communicate with about the patient's health. Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process. The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English. Indicates whether or not the patient prefers this language (over other languages he masters up a certain level). A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one". A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one". If the element is present, it must have either a @value, an @id, or extensions Allows a service to provide a unique, business identifier for the request. A canonical URL referencing a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this request. A URL referencing an externally defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this request. A plan, proposal or order that is fulfilled in whole or in part by this request. Completed or terminated request(s) whose function is taken by this new request. A shared identifier common to all requests that were authorized more or less simultaneously by a single author, representing the identifier of the requisition, prescription or similar form. The current state of the request. For request groups, the status reflects the status of all the requests in the group. Indicates the level of authority/intentionality associated with the request and where the request fits into the workflow chain. Indicates how quickly the request should be addressed with respect to other requests. A code that identifies what the overall request group is. The subject for which the request group was created. Describes the context of the request group, if any. Indicates when the request group was created. Provides a reference to the author of the request group. Describes the reason for the request group in coded or textual form. Indicates another resource whose existence justifies this request group. Provides a mechanism to communicate additional information about the response. The actions, if any, produced by the evaluation of the artifact. A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one". A user-visible prefix for the action. The title of the action displayed to a user. A short description of the action used to provide a summary to display to the user. A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that might not be capable of interpreting it dynamically. Indicates how quickly the action should be addressed with respect to other actions. A code that provides meaning for the action or action group. For example, a section may have a LOINC code for a section of a documentation template. Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources. An expression that describes applicability criteria, or start/stop conditions for the action. A relationship to another action such as "before" or "30-60 minutes after start of". An optional value describing when the action should be performed. The participant that should perform or be responsible for this action. The type of action to perform (create, update, remove). Defines the grouping behavior for the action and its children. Defines the selection behavior for the action and its children. Defines expectations around whether an action is required. Defines whether the action should usually be preselected. Defines whether the action can be selected multiple times. The resource that is the target of the action (e.g. CommunicationRequest). Sub actions. A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one". The kind of condition. An expression that returns true or false, indicating whether or not the condition is satisfied. A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one". The element id of the action this is related to. The relationship of this action to the related action. A duration or range of durations to apply to the relationship. For example, 30-60 minutes before. The ResearchDefinition resource describes the conditional state (population and any exposures being compared within the population) and outcome (if specified) that the knowledge (evidence, assertion, recommendation) is about. The ResearchDefinition resource describes the conditional state (population and any exposures being compared within the population) and outcome (if specified) that the knowledge (evidence, assertion, recommendation) is about. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this research definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this research definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the research definition is stored on different servers. A formal identifier that is used to identify this research definition when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the research definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the research definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts. A natural language name identifying the research definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the research definition. The short title provides an alternate title for use in informal descriptive contexts where the full, formal title is not necessary. An explanatory or alternate title for the ResearchDefinition giving additional information about its content. The status of this research definition. Enables tracking the life-cycle of the content. A Boolean value to indicate that this research definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The intended subjects for the ResearchDefinition. If this element is not provided, a Patient subject is assumed, but the subject of the ResearchDefinition can be anything. The date (and optionally time) when the research definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the research definition changes. The name of the organization or individual that published the research definition. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the research definition from a consumer's perspective. A human-readable string to clarify or explain concepts about the resource. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate research definition instances. A legal or geographic region in which the research definition is intended to be used. Explanation of why this research definition is needed and why it has been designed as it has. A detailed description, from a clinical perspective, of how the ResearchDefinition is used. A copyright statement relating to the research definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the research definition. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the research definition content was or is planned to be in active use. Descriptive topics related to the content of the ResearchDefinition. Topics provide a high-level categorization grouping types of ResearchDefinitions that can be useful for filtering and searching. An individiual or organization primarily involved in the creation and maintenance of the content. An individual or organization primarily responsible for internal coherence of the content. An individual or organization primarily responsible for review of some aspect of the content. An individual or organization responsible for officially endorsing the content for use in some setting. Related artifacts such as additional documentation, justification, or bibliographic references. A reference to a Library resource containing the formal logic used by the ResearchDefinition. A reference to a ResearchElementDefinition resource that defines the population for the research. A reference to a ResearchElementDefinition resource that defines the exposure for the research. A reference to a ResearchElementDefinition resource that defines the exposureAlternative for the research. A reference to a ResearchElementDefinition resomece that defines the outcome for the research. The ResearchElementDefinition resource describes a "PICO" element that knowledge (evidence, assertion, recommendation) is about. The ResearchElementDefinition resource describes a "PICO" element that knowledge (evidence, assertion, recommendation) is about. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this research element definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this research element definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the research element definition is stored on different servers. A formal identifier that is used to identify this research element definition when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the research element definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the research element definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts. A natural language name identifying the research element definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the research element definition. The short title provides an alternate title for use in informal descriptive contexts where the full, formal title is not necessary. An explanatory or alternate title for the ResearchElementDefinition giving additional information about its content. The status of this research element definition. Enables tracking the life-cycle of the content. A Boolean value to indicate that this research element definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The intended subjects for the ResearchElementDefinition. If this element is not provided, a Patient subject is assumed, but the subject of the ResearchElementDefinition can be anything. The date (and optionally time) when the research element definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the research element definition changes. The name of the organization or individual that published the research element definition. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the research element definition from a consumer's perspective. A human-readable string to clarify or explain concepts about the resource. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate research element definition instances. A legal or geographic region in which the research element definition is intended to be used. Explanation of why this research element definition is needed and why it has been designed as it has. A detailed description, from a clinical perspective, of how the ResearchElementDefinition is used. A copyright statement relating to the research element definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the research element definition. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the research element definition content was or is planned to be in active use. Descriptive topics related to the content of the ResearchElementDefinition. Topics provide a high-level categorization grouping types of ResearchElementDefinitions that can be useful for filtering and searching. An individiual or organization primarily involved in the creation and maintenance of the content. An individual or organization primarily responsible for internal coherence of the content. An individual or organization primarily responsible for review of some aspect of the content. An individual or organization responsible for officially endorsing the content for use in some setting. Related artifacts such as additional documentation, justification, or bibliographic references. A reference to a Library resource containing the formal logic used by the ResearchElementDefinition. The type of research element, a population, an exposure, or an outcome. The type of the outcome (e.g. Dichotomous, Continuous, or Descriptive). A characteristic that defines the members of the research element. Multiple characteristics are applied with "and" semantics. The ResearchElementDefinition resource describes a "PICO" element that knowledge (evidence, assertion, recommendation) is about. Define members of the research element using Codes (such as condition, medication, or observation), Expressions ( using an expression language such as FHIRPath or CQL) or DataRequirements (such as Diabetes diagnosis onset in the last year). Use UsageContext to define the members of the population, such as Age Ranges, Genders, Settings. When true, members with this characteristic are excluded from the element. Specifies the UCUM unit for the outcome. A narrative description of the time period the study covers. Indicates what effective period the study covers. Indicates duration from the study initiation. Indicates how elements are aggregated within the study effective period. A narrative description of the time period the study covers. Indicates what effective period the study covers. Indicates duration from the participant's study entry. Indicates how elements are aggregated within the study effective period. Population Exposure Outcome The possible types of research elements (E.g. Population, Exposure, Outcome). If the element is present, it must have either a @value, an @id, or extensions Dichotomous Continuous Descriptive The possible types of variables for exposures or outcomes (E.g. Dichotomous, Continuous, Descriptive). If the element is present, it must have either a @value, an @id, or extensions A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. A ResearchStudy involves the gathering of information about human or animal subjects. A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. A ResearchStudy involves the gathering of information about human or animal subjects. If the element is present, it must have either a @value, an @id, or extensions Identifiers assigned to this research study by the sponsor or other systems. A short, descriptive user-friendly label for the study. The set of steps expected to be performed as part of the execution of the study. A larger research study of which this particular study is a component or step. The current state of the study. The type of study based upon the intent of the study's activities. A classification of the intent of the study. The stage in the progression of a therapy from initial experimental use in humans in clinical trials to post-market evaluation. Codes categorizing the type of study such as investigational vs. observational, type of blinding, type of randomization, safety vs. efficacy, etc. The medication(s), food(s), therapy(ies), device(s) or other concerns or interventions that the study is seeking to gain more information about. The condition that is the focus of the study. For example, In a study to examine risk factors for Lupus, might have as an inclusion criterion "healthy volunteer", but the target condition code would be a Lupus SNOMED code. Contact details to assist a user in learning more about or engaging with the study. Citations, references and other related documents. Key terms to aid in searching for or filtering the study. Indicates a country, state or other region where the study is taking place. A full description of how the study is being conducted. Reference to a Group that defines the criteria for and quantity of subjects participating in the study. E.g. " 200 female Europeans between the ages of 20 and 45 with early onset diabetes". Identifies the start date and the expected (or actual, depending on status) end date for the study. An organization that initiates the investigation and is legally responsible for the study. A researcher in a study who oversees multiple aspects of the study, such as concept development, protocol writing, protocol submission for IRB approval, participant recruitment, informed consent, data collection, analysis, interpretation and presentation. A facility in which study activities are conducted. A description and/or code explaining the premature termination of the study. Comments made about the study by the performer, subject or other participants. Describes an expected sequence of events for one of the participants of a study. E.g. Exposure to drug A, wash-out, exposure to drug B, wash-out, follow-up. A goal that the study is aiming to achieve in terms of a scientific question to be answered by the analysis of data collected during the study. A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. A ResearchStudy involves the gathering of information about human or animal subjects. Unique, human-readable label for this arm of the study. Categorization of study arm, e.g. experimental, active comparator, placebo comparater. A succinct description of the path through the study that would be followed by a subject adhering to this arm. A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. A ResearchStudy involves the gathering of information about human or animal subjects. Unique, human-readable label for this objective of the study. The kind of study objective. Active Administratively Completed Approved Closed to Accrual Closed to Accrual and Intervention Completed Disapproved In Review Temporarily Closed to Accrual Temporarily Closed to Accrual and Intervention Withdrawn Codes that convey the current status of the research study. If the element is present, it must have either a @value, an @id, or extensions A physical entity which is the primary unit of operational and/or administrative interest in a study. A physical entity which is the primary unit of operational and/or administrative interest in a study. If the element is present, it must have either a @value, an @id, or extensions Identifiers assigned to this research subject for a study. The current state of the subject. The dates the subject began and ended their participation in the study. Reference to the study the subject is participating in. The record of the person or animal who is involved in the study. The name of the arm in the study the subject is expected to follow as part of this study. The name of the arm in the study the subject actually followed as part of this study. A record of the patient's informed agreement to participate in the study. Candidate Eligible Follow-up Ineligible Not Registered Off-study On-study On-study-intervention On-study-observation Pending on-study Potential Candidate Screening Withdrawn Indicates the progression of a study subject through a study. If the element is present, it must have either a @value, an @id, or extensions An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. If the element is present, it must have either a @value, an @id, or extensions Business identifier assigned to the risk assessment. A reference to the request that is fulfilled by this risk assessment. A reference to a resource that this risk assessment is part of, such as a Procedure. The status of the RiskAssessment, using the same statuses as an Observation. The algorithm, process or mechanism used to evaluate the risk. The type of the risk assessment performed. The patient or group the risk assessment applies to. The encounter where the assessment was performed. The date (and possibly time) the risk assessment was performed. For assessments or prognosis specific to a particular condition, indicates the condition being assessed. The provider or software application that performed the assessment. The reason the risk assessment was performed. Resources supporting the reason the risk assessment was performed. Indicates the source data considered as part of the assessment (for example, FamilyHistory, Observations, Procedures, Conditions, etc.). Describes the expected outcome for the subject. A description of the steps that might be taken to reduce the identified risk(s). Additional comments about the risk assessment. An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. One of the potential outcomes for the patient (e.g. remission, death, a particular condition). Indicates how likely the outcome is (in the specified timeframe). Indicates how likely the outcome is (in the specified timeframe), expressed as a qualitative value (e.g. low, medium, or high). Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). Indicates the period of time or age range of the subject to which the specified probability applies. Additional information explaining the basis for the prediction. The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies. The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this risk evidence synthesis when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this risk evidence synthesis is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the risk evidence synthesis is stored on different servers. A formal identifier that is used to identify this risk evidence synthesis when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the risk evidence synthesis when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the risk evidence synthesis author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the risk evidence synthesis. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the risk evidence synthesis. The status of this risk evidence synthesis. Enables tracking the life-cycle of the content. The date (and optionally time) when the risk evidence synthesis was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the risk evidence synthesis changes. The name of the organization or individual that published the risk evidence synthesis. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the risk evidence synthesis from a consumer's perspective. A human-readable string to clarify or explain concepts about the resource. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate risk evidence synthesis instances. A legal or geographic region in which the risk evidence synthesis is intended to be used. A copyright statement relating to the risk evidence synthesis and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the risk evidence synthesis. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the risk evidence synthesis content was or is planned to be in active use. Descriptive topics related to the content of the RiskEvidenceSynthesis. Topics provide a high-level categorization grouping types of EffectEvidenceSynthesiss that can be useful for filtering and searching. An individiual or organization primarily involved in the creation and maintenance of the content. An individual or organization primarily responsible for internal coherence of the content. An individual or organization primarily responsible for review of some aspect of the content. An individual or organization responsible for officially endorsing the content for use in some setting. Related artifacts such as additional documentation, justification, or bibliographic references. Type of synthesis eg meta-analysis. Type of study eg randomized trial. A reference to a EvidenceVariable resource that defines the population for the research. A reference to a EvidenceVariable resource that defines the exposure for the research. A reference to a EvidenceVariable resomece that defines the outcome for the research. A description of the size of the sample involved in the synthesis. The estimated risk of the outcome. A description of the certainty of the risk estimate. The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies. Human-readable summary of sample size. Number of studies included in this evidence synthesis. Number of participants included in this evidence synthesis. The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies. Human-readable summary of risk estimate. Examples include proportion and mean. The point estimate of the risk estimate. Specifies the UCUM unit for the outcome. The sample size for the group that was measured for this risk estimate. The number of group members with the outcome of interest. A description of the precision of the estimate for the effect. The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies. Examples include confidence interval and interquartile range. Use 95 for a 95% confidence interval. Lower bound of confidence interval. Upper bound of confidence interval. The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies. A rating of the certainty of the effect estimate. A human-readable string to clarify or explain concepts about the resource. A description of a component of the overall certainty. The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies. Type of subcomponent of certainty rating. A rating of a subcomponent of rating certainty. A human-readable string to clarify or explain concepts about the resource. A container for slots of time that may be available for booking appointments. A container for slots of time that may be available for booking appointments. If the element is present, it must have either a @value, an @id, or extensions External Ids for this item. Whether this schedule record is in active use or should not be used (such as was entered in error). A broad categorization of the service that is to be performed during this appointment. The specific service that is to be performed during this appointment. The specialty of a practitioner that would be required to perform the service requested in this appointment. Slots that reference this schedule resource provide the availability details to these referenced resource(s). The period of time that the slots that reference this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a "template" for planning outside these dates. Comments on the availability to describe any extended information. Such as custom constraints on the slots that may be associated. A search parameter that defines a named search item that can be used to search/filter on a resource. A search parameter that defines a named search item that can be used to search/filter on a resource. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this search parameter when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this search parameter is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the search parameter is stored on different servers. The identifier that is used to identify this version of the search parameter when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the search parameter author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the search parameter. This name should be usable as an identifier for the module by machine processing applications such as code generation. Where this search parameter is originally defined. If a derivedFrom is provided, then the details in the search parameter must be consistent with the definition from which it is defined. i.e. the parameter should have the same meaning, and (usually) the functionality should be a proper subset of the underlying search parameter. The status of this search parameter. Enables tracking the life-cycle of the content. A Boolean value to indicate that this search parameter is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the search parameter was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes. The name of the organization or individual that published the search parameter. Contact details to assist a user in finding and communicating with the publisher. And how it used. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate search parameter instances. A legal or geographic region in which the search parameter is intended to be used. Explanation of why this search parameter is needed and why it has been designed as it has. The code used in the URL or the parameter name in a parameters resource for this search parameter. The base resource type(s) that this search parameter can be used against. The type of value that a search parameter may contain, and how the content is interpreted. A FHIRPath expression that returns a set of elements for the search parameter. An XPath expression that returns a set of elements for the search parameter. How the search parameter relates to the set of elements returned by evaluating the xpath query. Types of resource (if a resource is referenced). Whether multiple values are allowed for each time the parameter exists. Values are separated by commas, and the parameter matches if any of the values match. Whether multiple parameters are allowed - e.g. more than one parameter with the same name. The search matches if all the parameters match. Comparators supported for the search parameter. A modifier supported for the search parameter. Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from SearchParameter.code for a parameter on the target resource type. Used to define the parts of a composite search parameter. A search parameter that defines a named search item that can be used to search/filter on a resource. The definition of the search parameter that describes this part. A sub-expression that defines how to extract values for this component from the output of the main SearchParameter.expression. Normal Phonetic Nearby Distance Other How a search parameter relates to the set of elements returned by evaluating its xpath query. If the element is present, it must have either a @value, an @id, or extensions Missing Exact Contains Not Text In Not In Below Above Type Identifier Of Type A supported modifier for a search parameter. If the element is present, it must have either a @value, an @id, or extensions Equals Not Equals Greater Than Less Than Greater or Equals Less of Equal Starts After Ends Before Approximately What Search Comparator Codes are supported in search. If the element is present, it must have either a @value, an @id, or extensions A record of a request for service such as diagnostic investigations, treatments, or operations to be performed. A record of a request for service such as diagnostic investigations, treatments, or operations to be performed. If the element is present, it must have either a @value, an @id, or extensions Identifiers assigned to this order instance by the orderer and/or the receiver and/or order fulfiller. The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest. The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest. Plan/proposal/order fulfilled by this request. The request takes the place of the referenced completed or terminated request(s). A shared identifier common to all service requests that were authorized more or less simultaneously by a single author, representing the composite or group identifier. The status of the order. Whether the request is a proposal, plan, an original order or a reflex order. A code that classifies the service for searching, sorting and display purposes (e.g. "Surgical Procedure"). Indicates how quickly the ServiceRequest should be addressed with respect to other requests. Set this to true if the record is saying that the service/procedure should NOT be performed. A code that identifies a particular service (i.e., procedure, diagnostic investigation, or panel of investigations) that have been requested. Additional details and instructions about the how the services are to be delivered. For example, and order for a urinary catheter may have an order detail for an external or indwelling catheter, or an order for a bandage may require additional instructions specifying how the bandage should be applied. An amount of service being requested which can be a quantity ( for example $1,500 home modification), a ratio ( for example, 20 half day visits per month), or a range (2.0 to 1.8 Gy per fraction). On whom or what the service is to be performed. This is usually a human patient, but can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans). An encounter that provides additional information about the healthcare context in which this request is made. The date/time at which the requested service should occur. If a CodeableConcept is present, it indicates the pre-condition for performing the service. For example "pain", "on flare-up", etc. When the request transitioned to being actionable. The individual who initiated the request and has responsibility for its activation. Desired type of performer for doing the requested service. The desired performer for doing the requested service. For example, the surgeon, dermatopathologist, endoscopist, etc. The preferred location(s) where the procedure should actually happen in coded or free text form. E.g. at home or nursing day care center. A reference to the the preferred location(s) where the procedure should actually happen. E.g. at home or nursing day care center. An explanation or justification for why this service is being requested in coded or textual form. This is often for billing purposes. May relate to the resources referred to in `supportingInfo`. Indicates another resource that provides a justification for why this service is being requested. May relate to the resources referred to in `supportingInfo`. Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be needed for delivering the requested service. Additional clinical information about the patient or specimen that may influence the services or their interpretations. This information includes diagnosis, clinical findings and other observations. In laboratory ordering these are typically referred to as "ask at order entry questions (AOEs)". This includes observations explicitly requested by the producer (filler) to provide context or supporting information needed to complete the order. For example, reporting the amount of inspired oxygen for blood gas measurements. One or more specimens that the laboratory procedure will use. Anatomic location where the procedure should be performed. This is the target site. Any other notes and comments made about the service request. For example, internal billing notes. Instructions in terms that are understood by the patient or consumer. Key events in the history of the request. A slot of time on a schedule that may be available for booking appointments. A slot of time on a schedule that may be available for booking appointments. If the element is present, it must have either a @value, an @id, or extensions External Ids for this item. A broad categorization of the service that is to be performed during this appointment. The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource. The specialty of a practitioner that would be required to perform the service requested in this appointment. The style of appointment or patient that may be booked in the slot (not service type). The schedule resource that this slot defines an interval of status information. busy | free | busy-unavailable | busy-tentative | entered-in-error. Date/Time that the slot is to begin. Date/Time that the slot is to conclude. This slot has already been overbooked, appointments are unlikely to be accepted for this time. Comments on the slot to describe any extended information. Such as custom constraints on the slot. Busy Free Busy (Unavailable) Busy (Tentative) Entered in error The free/busy status of the slot. If the element is present, it must have either a @value, an @id, or extensions A sample to be used for analysis. A sample to be used for analysis. If the element is present, it must have either a @value, an @id, or extensions Id for specimen. The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures. The availability of the specimen. The kind of material that forms the specimen. Where the specimen came from. This may be from patient(s), from a location (e.g., the source of an environmental sample), or a sampling of a substance or a device. Time when specimen was received for processing or testing. Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen. Details concerning a service request that required a specimen to be collected. Details concerning the specimen collection. Details concerning processing and processing steps for the specimen. The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here. A mode or state of being that describes the nature of the specimen. To communicate any details or issues about the specimen or during the specimen collection. (for example: broken vial, sent with patient, frozen). A sample to be used for analysis. Person who collected the specimen. Time when specimen was collected from subject - the physiologically relevant time. The span of time over which the collection of a specimen occurred. The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample. A coded value specifying the technique that is used to perform the procedure. Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens. Abstinence or reduction from some or all food, drink, or both, for a period of time prior to sample collection. A sample to be used for analysis. Textual description of procedure. A coded value specifying the procedure used to process the specimen. Material used in the processing step. A record of the time or period when the specimen processing occurred. For example the time of sample fixation or the period of time the sample was in formalin. A sample to be used for analysis. Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances. Textual description of the container. The type of container associated with the specimen (e.g. slide, aliquot, etc.). The capacity (volume or other measure) the container may contain. The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type. Introduced substance to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA. Available Unavailable Unsatisfactory Entered in Error Codes providing the status/availability of a specimen. If the element is present, it must have either a @value, an @id, or extensions A kind of specimen with associated set of requirements. A kind of specimen with associated set of requirements. If the element is present, it must have either a @value, an @id, or extensions A business identifier associated with the kind of specimen. The kind of material to be collected. Preparation of the patient for specimen collection. Time aspect of specimen collection (duration or offset). The action to be performed for collecting the specimen. Specimen conditioned in a container as expected by the testing laboratory. A kind of specimen with associated set of requirements. Primary of secondary specimen. The kind of specimen conditioned for testing expected by lab. The preference for this type of conditioned specimen. The specimen's container. Requirements for delivery and special handling of this kind of conditioned specimen. The usual time that a specimen of this kind is retained after the ordered tests are completed, for the purpose of additional testing. Criterion for rejection of the specimen in its container by the laboratory. Set of instructions for preservation/transport of the specimen at a defined temperature interval, prior the testing process. A kind of specimen with associated set of requirements. The type of material of the container. The type of container used to contain this kind of specimen. Color of container cap. The textual description of the kind of container. The capacity (volume or other measure) of this kind of container. The minimum volume to be conditioned in the container. Substance introduced in the kind of container to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA. Special processing that should be applied to the container for this kind of specimen. A kind of specimen with associated set of requirements. Substance introduced in the kind of container to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA. A kind of specimen with associated set of requirements. It qualifies the interval of temperature, which characterizes an occurrence of handling. Conditions that are not related to temperature may be handled in the instruction element. The temperature interval for this set of handling instructions. The maximum time interval of preservation of the specimen with these conditions. Additional textual instructions for the preservation or transport of the specimen. For instance, 'Protect from light exposure'. Preferred Alternate Degree of preference of a type of conditioned specimen. If the element is present, it must have either a @value, an @id, or extensions A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types. A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this structure definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this structure definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the structure definition is stored on different servers. A formal identifier that is used to identify this structure definition when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the structure definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the structure definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the structure definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the structure definition. The status of this structure definition. Enables tracking the life-cycle of the content. A Boolean value to indicate that this structure definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the structure definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes. The name of the organization or individual that published the structure definition. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the structure definition from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate structure definition instances. A legal or geographic region in which the structure definition is intended to be used. Explanation of why this structure definition is needed and why it has been designed as it has. A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure definition. A set of key words or terms from external terminologies that may be used to assist with indexing and searching of templates nby describing the use of this structure definition, or the content it describes. The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 4.0.1. for this version. An external specification that the content is mapped to. Defines the kind of structure that this definition is describing. Whether structure this definition describes is abstract or not - that is, whether the structure is not intended to be instantiated. For Resources and Data types, abstract types will never be exchanged between systems. Identifies the types of resource or data type elements to which the extension can be applied. A set of rules as FHIRPath Invariants about when the extension can be used (e.g. co-occurrence variants for the extension). All the rules must be true. The type this structure describes. If the derivation kind is 'specialization' then this is the master definition for a type, and there is always one of these (a data type, an extension, a resource, including abstract ones). Otherwise the structure definition is a constraint on the stated type (and in this case, the type cannot be an abstract type). References are URLs that are relative to http://hl7.org/fhir/StructureDefinition e.g. "string" is a reference to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are only allowed in logical models. An absolute URI that is the base structure from which this type is derived, either by specialization or constraint. How the type relates to the baseDefinition. A snapshot view is expressed in a standalone form that can be used and interpreted without considering the base StructureDefinition. A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies. A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types. An Internal id that is used to identify this mapping set when specific mappings are made. An absolute URI that identifies the specification that this mapping is expressed to. A name for the specification that is being mapped to. Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types. Defines how to interpret the expression that defines what the context of the extension is. An expression that defines where an extension can be used in resources. A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types. Captures constraints on each element within the resource. A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types. Captures constraints on each element within the resource. Primitive Data Type Complex Data Type Resource Logical Defines the type of structure that a definition is describing. If the element is present, it must have either a @value, an @id, or extensions Specialization Constraint How a type relates to its baseDefinition. If the element is present, it must have either a @value, an @id, or extensions FHIRPath Element ID Extension URL How an extension context is interpreted. If the element is present, it must have either a @value, an @id, or extensions A Map of relationships between 2 structures that can be used to transform data. A Map of relationships between 2 structures that can be used to transform data. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this structure map when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this structure map is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the structure map is stored on different servers. A formal identifier that is used to identify this structure map when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the structure map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the structure map author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the structure map. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the structure map. The status of this structure map. Enables tracking the life-cycle of the content. A Boolean value to indicate that this structure map is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the structure map was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes. The name of the organization or individual that published the structure map. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the structure map from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate structure map instances. A legal or geographic region in which the structure map is intended to be used. Explanation of why this structure map is needed and why it has been designed as it has. A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure map. A structure definition used by this map. The structure definition may describe instances that are converted, or the instances that are produced. Other maps used by this map (canonical URLs). Organizes the mapping into manageable chunks for human review/ease of maintenance. A Map of relationships between 2 structures that can be used to transform data. The canonical reference to the structure. How the referenced structure is used in this mapping. The name used for this type in the map. Documentation that describes how the structure is used in the mapping. A Map of relationships between 2 structures that can be used to transform data. A unique name for the group for the convenience of human readers. Another group that this group adds rules to. If this is the default rule set to apply for the source type or this combination of types. Additional supporting documentation that explains the purpose of the group and the types of mappings within it. A name assigned to an instance of data. The instance must be provided when the mapping is invoked. Transform Rule from source to target. A Map of relationships between 2 structures that can be used to transform data. Name for this instance of data. Type for this instance of data. Mode for this instance of data. Documentation for this instance of data. A Map of relationships between 2 structures that can be used to transform data. Name of the rule for internal references. Source inputs to the mapping. Content to create because of this mapping rule. Rules contained in this rule. Which other rules to apply in the context of this rule. Documentation for this instance of data. A Map of relationships between 2 structures that can be used to transform data. Type or variable this rule applies to. Specified minimum cardinality for the element. This is optional; if present, it acts an implicit check on the input content. Specified maximum cardinality for the element - a number or a "*". This is optional; if present, it acts an implicit check on the input content (* just serves as documentation; it's the default value). Specified type for the element. This works as a condition on the mapping - use for polymorphic elements. A value to use if there is no existing value in the source object. Optional field for this source. How to handle the list mode for this element. Named context for field, if a field is specified. FHIRPath expression - must be true or the rule does not apply. FHIRPath expression - must be true or the mapping engine throws an error instead of completing. A FHIRPath expression which specifies a message to put in the transform log when content matching the source rule is found. A Map of relationships between 2 structures that can be used to transform data. Type or variable this rule applies to. How to interpret the context. Field to create in the context. Named context for field, if desired, and a field is specified. If field is a list, how to manage the list. Internal rule reference for shared list items. How the data is copied / created. Parameters to the transform. A Map of relationships between 2 structures that can be used to transform data. Parameter value - variable or literal. A Map of relationships between 2 structures that can be used to transform data. Name of a rule or group to apply. Variable to pass to the rule or group. Source Instance Target Instance Mode for this instance of data. If the element is present, it must have either a @value, an @id, or extensions Type Variable How to interpret the context. If the element is present, it must have either a @value, an @id, or extensions First Share Last Collate If field is a list, how to manage the production. If the element is present, it must have either a @value, an @id, or extensions create copy truncate escape cast append translate reference dateOp uuid pointer evaluate cc c qty id cp How data is copied/created. If the element is present, it must have either a @value, an @id, or extensions First All but the first Last All but the last Enforce only one If field is a list, how to manage the source. If the element is present, it must have either a @value, an @id, or extensions Not a Default Default for Type Combination Default for type + combination If this is the default rule set to apply for the source type, or this combination of types. If the element is present, it must have either a @value, an @id, or extensions Source Structure Definition Queried Structure Definition Target Structure Definition Produced Structure Definition How the referenced structure is used in this mapping. If the element is present, it must have either a @value, an @id, or extensions The subscription resource is used to define a push-based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system can take an appropriate action. The subscription resource is used to define a push-based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system can take an appropriate action. If the element is present, it must have either a @value, an @id, or extensions The status of the subscription, which marks the server state for managing the subscription. Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting. The time for the server to turn the subscription off. A description of why this subscription is defined. The rules that the server should use to determine when to generate notifications for this subscription. A record of the last error that occurred when the server processed a notification. Details where to send notifications when resources are received that meet the criteria. The subscription resource is used to define a push-based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system can take an appropriate action. The type of channel to send notifications on. The url that describes the actual end-point to send messages to. The mime type to send the payload in - either application/fhir+xml, or application/fhir+json. If the payload is not present, then there is no payload in the notification, just a notification. The mime type "text/plain" may also be used for Email and SMS subscriptions. Additional headers / information to send as part of the notification. Requested Active Error Off The status of a subscription. If the element is present, it must have either a @value, an @id, or extensions Rest Hook Websocket Email SMS Message The type of method used to execute a subscription. If the element is present, it must have either a @value, an @id, or extensions A homogeneous material with a definite composition. A homogeneous material with a definite composition. If the element is present, it must have either a @value, an @id, or extensions Unique identifier for the substance. A code to indicate if the substance is actively used. A code that classifies the general type of substance. This is used for searching, sorting and display purposes. A code (or set of codes) that identify this substance. A description of the substance - its appearance, handling requirements, and other usage notes. Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance. A substance can be composed of other substances. A homogeneous material with a definite composition. Identifier associated with the package/container (usually a label affixed directly). When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. The amount of the substance. A homogeneous material with a definite composition. The amount of the ingredient in the substance - a concentration ratio. Another substance that is a component of this substance. Active Inactive Entered in Error A code to indicate if the substance is actively used. If the element is present, it must have either a @value, an @id, or extensions Nucleic acids are defined by three distinct elements: the base, sugar and linkage. Individual substance/moiety IDs will be created for each of these elements. The nucleotide sequence will be always entered in the 5’-3’ direction. Nucleic acids are defined by three distinct elements: the base, sugar and linkage. Individual substance/moiety IDs will be created for each of these elements. The nucleotide sequence will be always entered in the 5’-3’ direction. If the element is present, it must have either a @value, an @id, or extensions The type of the sequence shall be specified based on a controlled vocabulary. The number of linear sequences of nucleotides linked through phosphodiester bonds shall be described. Subunits would be strands of nucleic acids that are tightly associated typically through Watson-Crick base pairing. NOTE: If not specified in the reference source, the assumption is that there is 1 subunit. The area of hybridisation shall be described if applicable for double stranded RNA or DNA. The number associated with the subunit followed by the number associated to the residue shall be specified in increasing order. The underscore “” shall be used as separator as follows: “Subunitnumber Residue”. (TBC). Subunits are listed in order of decreasing length; sequences of the same length will be ordered by molecular weight; subunits that have identical sequences will be repeated multiple times. Nucleic acids are defined by three distinct elements: the base, sugar and linkage. Individual substance/moiety IDs will be created for each of these elements. The nucleotide sequence will be always entered in the 5’-3’ direction. Index of linear sequences of nucleic acids in order of decreasing length. Sequences of the same length will be ordered by molecular weight. Subunits that have identical sequences will be repeated and have sequential subscripts. Actual nucleotide sequence notation from 5' to 3' end using standard single letter codes. In addition to the base sequence, sugar and type of phosphate or non-phosphate linkage should also be captured. The length of the sequence shall be captured. (TBC). The nucleotide present at the 5’ terminal shall be specified based on a controlled vocabulary. Since the sequence is represented from the 5' to the 3' end, the 5’ prime nucleotide is the letter at the first position in the sequence. A separate representation would be redundant. The nucleotide present at the 3’ terminal shall be specified based on a controlled vocabulary. Since the sequence is represented from the 5' to the 3' end, the 5’ prime nucleotide is the letter at the last position in the sequence. A separate representation would be redundant. The linkages between sugar residues will also be captured. 5.3.6.8.1 Sugar ID (Mandatory). Nucleic acids are defined by three distinct elements: the base, sugar and linkage. Individual substance/moiety IDs will be created for each of these elements. The nucleotide sequence will be always entered in the 5’-3’ direction. The entity that links the sugar residues together should also be captured for nearly all naturally occurring nucleic acid the linkage is a phosphate group. For many synthetic oligonucleotides phosphorothioate linkages are often seen. Linkage connectivity is assumed to be 3’-5’. If the linkage is either 3’-3’ or 5’-5’ this should be specified. Each linkage will be registered as a fragment and have an ID. Each linkage will be registered as a fragment and have at least one name. A single name shall be assigned to each linkage. Residues shall be captured as described in 5.3.6.8.3. Nucleic acids are defined by three distinct elements: the base, sugar and linkage. Individual substance/moiety IDs will be created for each of these elements. The nucleotide sequence will be always entered in the 5’-3’ direction. The Substance ID of the sugar or sugar-like component that make up the nucleotide. The name of the sugar or sugar-like component that make up the nucleotide. The residues that contain a given sugar will be captured. The order of given residues will be captured in the 5‘-3‘direction consistent with the base sequences listed above. Todo. Todo. If the element is present, it must have either a @value, an @id, or extensions Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. A SubstanceProtein is defined as a single unit of a linear amino acid sequence, or a combination of subunits that are either covalently linked or have a defined invariant stoichiometric relationship. This includes all synthetic, recombinant and purified SubstanceProteins of defined sequence, whether the use is therapeutic or prophylactic. This set of elements will be used to describe albumins, coagulation factors, cytokines, growth factors, peptide/SubstanceProtein hormones, enzymes, toxins, toxoids, recombinant vaccines, and immunomodulators. A SubstanceProtein is defined as a single unit of a linear amino acid sequence, or a combination of subunits that are either covalently linked or have a defined invariant stoichiometric relationship. This includes all synthetic, recombinant and purified SubstanceProteins of defined sequence, whether the use is therapeutic or prophylactic. This set of elements will be used to describe albumins, coagulation factors, cytokines, growth factors, peptide/SubstanceProtein hormones, enzymes, toxins, toxoids, recombinant vaccines, and immunomodulators. If the element is present, it must have either a @value, an @id, or extensions The SubstanceProtein descriptive elements will only be used when a complete or partial amino acid sequence is available or derivable from a nucleic acid sequence. Number of linear sequences of amino acids linked through peptide bonds. The number of subunits constituting the SubstanceProtein shall be described. It is possible that the number of subunits can be variable. The disulphide bond between two cysteine residues either on the same subunit or on two different subunits shall be described. The position of the disulfide bonds in the SubstanceProtein shall be listed in increasing order of subunit number and position within subunit followed by the abbreviation of the amino acids involved. The disulfide linkage positions shall actually contain the amino acid Cysteine at the respective positions. This subclause refers to the description of each subunit constituting the SubstanceProtein. A subunit is a linear sequence of amino acids linked through peptide bonds. The Subunit information shall be provided when the finished SubstanceProtein is a complex of multiple sequences; subunits are not used to delineate domains within a single sequence. Subunits are listed in order of decreasing length; sequences of the same length will be ordered by decreasing molecular weight; subunits that have identical sequences will be repeated multiple times. A SubstanceProtein is defined as a single unit of a linear amino acid sequence, or a combination of subunits that are either covalently linked or have a defined invariant stoichiometric relationship. This includes all synthetic, recombinant and purified SubstanceProteins of defined sequence, whether the use is therapeutic or prophylactic. This set of elements will be used to describe albumins, coagulation factors, cytokines, growth factors, peptide/SubstanceProtein hormones, enzymes, toxins, toxoids, recombinant vaccines, and immunomodulators. Index of primary sequences of amino acids linked through peptide bonds in order of decreasing length. Sequences of the same length will be ordered by molecular weight. Subunits that have identical sequences will be repeated and have sequential subscripts. The sequence information shall be provided enumerating the amino acids from N- to C-terminal end using standard single-letter amino acid codes. Uppercase shall be used for L-amino acids and lowercase for D-amino acids. Transcribed SubstanceProteins will always be described using the translated sequence; for synthetic peptide containing amino acids that are not represented with a single letter code an X should be used within the sequence. The modified amino acids will be distinguished by their position in the sequence. Length of linear sequences of amino acids contained in the subunit. The sequence information shall be provided enumerating the amino acids from N- to C-terminal end using standard single-letter amino acid codes. Uppercase shall be used for L-amino acids and lowercase for D-amino acids. Transcribed SubstanceProteins will always be described using the translated sequence; for synthetic peptide containing amino acids that are not represented with a single letter code an X should be used within the sequence. The modified amino acids will be distinguished by their position in the sequence. Unique identifier for molecular fragment modification based on the ISO 11238 Substance ID. The name of the fragment modified at the N-terminal of the SubstanceProtein shall be specified. Unique identifier for molecular fragment modification based on the ISO 11238 Substance ID. The modification at the C-terminal shall be specified. Todo. Todo. If the element is present, it must have either a @value, an @id, or extensions Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex. Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex. If the element is present, it must have either a @value, an @id, or extensions General high level classification of the source material specific to the origin of the material. The type of the source material shall be specified based on a controlled vocabulary. For vaccines, this subclause refers to the class of infectious agent. The state of the source material when extracted. The unique identifier associated with the source material parent organism shall be specified. The organism accepted Scientific name shall be provided based on the organism taxonomy. The parent of the herbal drug Ginkgo biloba, Leaf is the substance ID of the substance (fresh) of Ginkgo biloba L. or Ginkgo biloba L. (Whole plant). The parent substance of the Herbal Drug, or Herbal preparation. The country where the plant material is harvested or the countries where the plasma is sourced from as laid down in accordance with the Plasma Master File. For “Plasma-derived substances” the attribute country of origin provides information about the countries used for the manufacturing of the Cryopoor plama or Crioprecipitate. The place/region where the plant is harvested or the places/regions where the animal source material has its habitat. Stage of life for animals, plants, insects and microorganisms. This information shall be provided only when the substance is significantly different in these stages (e.g. foetal bovine serum). Many complex materials are fractions of parts of plants, animals, or minerals. Fraction elements are often necessary to define both Substances and Specified Group 1 Substances. For substances derived from Plants, fraction information will be captured at the Substance information level ( . Oils, Juices and Exudates). Additional information for Extracts, such as extraction solvent composition, will be captured at the Specified Substance Group 1 information level. For plasma-derived products fraction information will be captured at the Substance and the Specified Substance Group 1 levels. This subclause describes the organism which the substance is derived from. For vaccines, the parent organism shall be specified based on these subclause elements. As an example, full taxonomy will be described for the Substance Name: ., Leaf. To do. Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex. This element is capturing information about the fraction of a plant part, or human plasma for fractionation. The specific type of the material constituting the component. For Herbal preparations the particulars of the extracts (liquid/dry) is described in Specified Substance Group 1. Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex. The family of an organism shall be specified. The genus of an organism shall be specified; refers to the Latin epithet of the genus element of the plant/animal scientific name; it is present in names for genera, species and infraspecies. The species of an organism shall be specified; refers to the Latin epithet of the species of the plant/animal; it is present in names for species and infraspecies. The Intraspecific type of an organism shall be specified. The intraspecific description of an organism shall be specified based on a controlled vocabulary. For Influenza Vaccine, the intraspecific description shall contain the syntax of the antigen in line with the WHO convention. 4.9.13.6.1 Author type (Conditional). 4.9.13.8.1 Hybrid species maternal organism ID (Optional). 4.9.13.7.1 Kingdom (Conditional). Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex. The type of author of an organism species shall be specified. The parenthetical author of an organism species refers to the first author who published the plant/animal name (of any rank). The primary author of an organism species refers to the first author(s), who validly published the plant/animal name. The author of an organism species shall be specified. The author year of an organism shall also be specified when applicable; refers to the year in which the first author(s) published the infraspecific plant/animal name (of any rank). Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex. The identifier of the maternal species constituting the hybrid organism shall be specified based on a controlled vocabulary. For plants, the parents aren’t always known, and it is unlikely that it will be known which is maternal and which is paternal. The name of the maternal species constituting the hybrid organism shall be specified. For plants, the parents aren’t always known, and it is unlikely that it will be known which is maternal and which is paternal. The identifier of the paternal species constituting the hybrid organism shall be specified based on a controlled vocabulary. The name of the paternal species constituting the hybrid organism shall be specified. The hybrid type of an organism shall be specified. Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex. The kingdom of an organism shall be specified. The phylum of an organism shall be specified. The class of an organism shall be specified. The order of an organism shall be specified,. Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex. Entity of anatomical origin of source material within an organism. The detailed anatomic location when the part can be extracted from different anatomical locations of the organism. Multiple alternative locations may apply. The detailed description of a substance, typically at a level beyond what is used for prescribing. The detailed description of a substance, typically at a level beyond what is used for prescribing. If the element is present, it must have either a @value, an @id, or extensions Identifier by which this substance is known. High level categorization, e.g. polymer or nucleic acid. Status of substance within the catalogue e.g. approved. If the substance applies to only human or veterinary use. Textual description of the substance. Supporting literature. Textual comment about this record of a substance. Moiety, for structural modifications. General specifications for this substance, including how it is related to other substances. General information detailing this substance. Structural information. Codes associated with the substance. Names applicable to this substance. The molecular weight or weight range (for proteins, polymers or nucleic acids). A link between this substance and another, with details of the relationship. Data items specific to nucleic acids. Data items specific to polymers. Data items specific to proteins. Material or taxonomic/anatomical source for the substance. The detailed description of a substance, typically at a level beyond what is used for prescribing. Role that the moiety is playing. Identifier by which this moiety substance is known. Textual name for this moiety substance. Stereochemistry type. Optical activity type. Molecular formula. Quantitative value for this moiety. The detailed description of a substance, typically at a level beyond what is used for prescribing. A category for this property, e.g. Physical, Chemical, Enzymatic. Property type e.g. viscosity, pH, isoelectric point. Parameters that were used in the measurement of a property (e.g. for viscosity: measured at 20C with a pH of 7.1). A substance upon which a defining property depends (e.g. for solubility: in water, in alcohol). Quantitative value for this property. The detailed description of a substance, typically at a level beyond what is used for prescribing. Stereochemistry type. Optical activity type. Molecular formula. Specified per moiety according to the Hill system, i.e. first C, then H, then alphabetical, each moiety separated by a dot. Applicable for single substances that contain a radionuclide or a non-natural isotopic ratio. The molecular weight or weight range (for proteins, polymers or nucleic acids). Supporting literature. Molecular structural representation. The detailed description of a substance, typically at a level beyond what is used for prescribing. Substance identifier for each non-natural or radioisotope. Substance name for each non-natural or radioisotope. The type of isotopic substitution present in a single substance. Half life - for a non-natural nuclide. The molecular weight or weight range (for proteins, polymers or nucleic acids). The detailed description of a substance, typically at a level beyond what is used for prescribing. The method by which the molecular weight was determined. Type of molecular weight such as exact, average (also known as. number average), weight average. Used to capture quantitative values for a variety of elements. If only limits are given, the arithmetic mean would be the average. If only a single definite value for a given element is given, it would be captured in this field. The detailed description of a substance, typically at a level beyond what is used for prescribing. The type of structure (e.g. Full, Partial, Representative). The structural representation as text string in a format e.g. InChI, SMILES, MOLFILE, CDX. An attached file with the structural representation. The detailed description of a substance, typically at a level beyond what is used for prescribing. The specific code. Status of the code assignment. The date at which the code status is changed as part of the terminology maintenance. Any comment can be provided in this field, if necessary. Supporting literature. The detailed description of a substance, typically at a level beyond what is used for prescribing. The actual name. Name type. The status of the name. If this is the preferred name for this substance. Language of the name. The use context of this name for example if there is a different name a drug active ingredient as opposed to a food colour additive. The jurisdiction where this name applies. A synonym of this name. A translation for this name. Details of the official nature of this name. Supporting literature. The detailed description of a substance, typically at a level beyond what is used for prescribing. Which authority uses this official name. The status of the official name. Date of official name change. The detailed description of a substance, typically at a level beyond what is used for prescribing. A pointer to another substance, as a resource or just a representational code. For example "salt to parent", "active moiety", "starting material". For example where an enzyme strongly bonds with a particular substance, this is a defining relationship for that enzyme, out of several possible substance relationships. A numeric factor for the relationship, for instance to express that the salt of a substance has some percentage of the active substance in relation to some other. For use when the numeric. An operator for the amount, for example "average", "approximately", "less than". Supporting literature. Record of delivery of what is supplied. Record of delivery of what is supplied. If the element is present, it must have either a @value, an @id, or extensions Identifier for the supply delivery event that is used to identify it across multiple disparate systems. A plan, proposal or order that is fulfilled in whole or in part by this event. A larger event of which this particular event is a component or step. A code specifying the state of the dispense event. A link to a resource representing the person whom the delivered item is for. Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. The item that is being delivered or has been supplied. The date or time(s) the activity occurred. The individual responsible for dispensing the medication, supplier or device. Identification of the facility/location where the Supply was shipped to, as part of the dispense event. Identifies the person who picked up the Supply. Record of delivery of what is supplied. The amount of supply that has been dispensed. Includes unit of measure. Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a code that identifies the item from a known list. In Progress Delivered Abandoned Entered In Error Status of the supply delivery. If the element is present, it must have either a @value, an @id, or extensions A record of a request for a medication, substance or device used in the healthcare setting. A record of a request for a medication, substance or device used in the healthcare setting. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this SupplyRequest by the author and/or other systems. These identifiers remain constant as the resource is updated and propagates from server to server. Status of the supply request. Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process. Indicates how quickly this SupplyRequest should be addressed with respect to other requests. The item that is requested to be supplied. This is either a link to a resource representing the details of the item or a code that identifies the item from a known list. The amount that is being ordered of the indicated item. Specific parameters for the ordered item. For example, the size of the indicated item. When the request should be fulfilled. When the request was made. The device, practitioner, etc. who initiated the request. Who is intended to fulfill the request. The reason why the supply item was requested. The reason why the supply item was requested. Where the supply is expected to come from. Where the supply is destined to go. A record of a request for a medication, substance or device used in the healthcare setting. A code or string that identifies the device detail being asserted. The value of the device detail. Draft Active Suspended Cancelled Completed Entered in Error Unknown Status of the supply request. If the element is present, it must have either a @value, an @id, or extensions A task to be performed. A task to be performed. If the element is present, it must have either a @value, an @id, or extensions The business identifier for this task. The URL pointing to a *FHIR*-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task. The URL pointing to an *externally* maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task. BasedOn refers to a higher-level authorization that triggered the creation of the task. It references a "request" resource such as a ServiceRequest, MedicationRequest, ServiceRequest, CarePlan, etc. which is distinct from the "request" resource the task is seeking to fulfill. This latter resource is referenced by FocusOn. For example, based on a ServiceRequest (= BasedOn), a task is created to fulfill a procedureRequest ( = FocusOn ) to collect a specimen from a patient. An identifier that links together multiple tasks and other requests that were created in the same context. Task that this particular task is part of. The current status of the task. An explanation as to why this task is held, failed, was refused, etc. Contains business-specific nuances of the business state. Indicates the "level" of actionability associated with the Task, i.e. i+R[9]Cs this a proposed task, a planned task, an actionable task, etc. Indicates how quickly the Task should be addressed with respect to other requests. A name or code (or both) briefly describing what the task involves. A free-text description of what is to be performed. The request being actioned or the resource being manipulated by this task. The entity who benefits from the performance of the service specified in the task (e.g., the patient). The healthcare event (e.g. a patient and healthcare provider interaction) during which this task was created. Identifies the time action was first taken against the task (start) and/or the time final action was taken against the task prior to marking it as completed (end). The date and time this task was created. The date and time of last modification to this task. The creator of the task. The kind of participant that should perform the task. Individual organization or Device currently responsible for task execution. Principal physical location where the this task is performed. A description or code indicating why this task needs to be performed. A resource reference indicating why this task needs to be performed. Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be relevant to the Task. Free-text information captured about the task as it progresses. Links to Provenance records for past versions of this Task that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the task. If the Task.focus is a request resource and the task is seeking fulfillment (i.e. is asking for the request to be actioned), this element identifies any limitations on what parts of the referenced request should be actioned. Additional information that may be needed in the execution of the task. Outputs produced by the Task. A task to be performed. Indicates the number of times the requested action should occur. Over what time-period is fulfillment sought. For requests that are targeted to more than on potential recipient/target, for whom is fulfillment sought? A task to be performed. A code or description indicating how the input is intended to be used as part of the task execution. The value of the input parameter as a basic type. A task to be performed. The name of the Output parameter. The value of the Output parameter as a basic type. Draft Requested Received Accepted Rejected Ready Cancelled In Progress On Hold Failed Completed Entered in Error The current status of the task. If the element is present, it must have either a @value, an @id, or extensions Unknown Proposal Plan Order Original Order Reflex Order Filler Order Instance Order Option Distinguishes whether the task is a proposal, plan or full order. If the element is present, it must have either a @value, an @id, or extensions A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this terminology capabilities when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this terminology capabilities is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the terminology capabilities is stored on different servers. The identifier that is used to identify this version of the terminology capabilities when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the terminology capabilities author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the terminology capabilities. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the terminology capabilities. The status of this terminology capabilities. Enables tracking the life-cycle of the content. A Boolean value to indicate that this terminology capabilities is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the terminology capabilities was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the terminology capabilities changes. The name of the organization or individual that published the terminology capabilities. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the terminology capabilities from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate terminology capabilities instances. A legal or geographic region in which the terminology capabilities is intended to be used. Explanation of why this terminology capabilities is needed and why it has been designed as it has. A copyright statement relating to the terminology capabilities and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the terminology capabilities. The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind, not instance of software) or a class of implementation (e.g. a desired purchase). Software that is covered by this terminology capability statement. It is used when the statement describes the capabilities of a particular software version, independent of an installation. Identifies a specific implementation instance that is described by the terminology capability statement - i.e. a particular installation, rather than the capabilities of a software program. Whether the server supports lockedDate. Identifies a code system that is supported by the server. If there is a no code system URL, then this declares the general assumptions a client can make about support for any CodeSystem resource. Information about the [ValueSet/$expand](valueset-operation-expand.html) operation. The degree to which the server supports the code search parameter on ValueSet, if it is supported. Information about the [ValueSet/$validate-code](valueset-operation-validate-code.html) operation. Information about the [ConceptMap/$translate](conceptmap-operation-translate.html) operation. Whether the $closure operation is supported. A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Name the software is known by. The version identifier for the software covered by this statement. A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Information about the specific installation that this terminology capability statement relates to. An absolute base URL for the implementation. A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. URI for the Code System. For the code system, a list of versions that are supported by the server. True if subsumption is supported for this version of the code system. A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. For version-less code systems, there should be a single version with no identifier. If this is the default version for this code system. If the compositional grammar defined by the code system is supported. Language Displays supported. Filter Properties supported. Properties supported for $lookup. A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Code of the property supported. Operations supported for the property. A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Whether the server can return nested value sets. Whether the server supports paging on expansion. Allow request for incomplete expansions? Supported expansion parameter. Documentation about text searching works. A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Expansion Parameter name. Description of support for parameter. A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Whether translations are validated. A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Whether the client must identify the map. A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. If cross-system closure is supported. Explicit Codes Implicit Codes The degree to which the server supports the code search parameter on ValueSet, if it is supported. If the element is present, it must have either a @value, an @id, or extensions A summary of information based on the results of executing a TestScript. A summary of information based on the results of executing a TestScript. If the element is present, it must have either a @value, an @id, or extensions Identifier for the TestScript assigned for external purposes outside the context of FHIR. A free text natural language name identifying the executed TestScript. The current state of this test report. Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`. The overall result from the execution of the TestScript. The final score (percentage of tests passed) resulting from the execution of the TestScript. Name of the tester producing this report (Organization or individual). When the TestScript was executed and this TestReport was generated. A participant in the test execution, either the execution engine, a client, or a server. The results of the series of required setup operations before the tests were executed. A test executed from the test script. The results of the series of operations required to clean up after all the tests were executed (successfully or otherwise). A summary of information based on the results of executing a TestScript. The type of participant. The uri of the participant. An absolute URL is preferred. The display name of the participant. A summary of information based on the results of executing a TestScript. Action would contain either an operation or an assertion. A summary of information based on the results of executing a TestScript. The operation performed. The results of the assertion performed on the previous operations. A summary of information based on the results of executing a TestScript. The result of this operation. An explanatory message associated with the result. A link to further details on the result. A summary of information based on the results of executing a TestScript. The result of this assertion. An explanatory message associated with the result. A link to further details on the result. A summary of information based on the results of executing a TestScript. The name of this test used for tracking/logging purposes by test engines. A short description of the test used by test engines for tracking and reporting purposes. Action would contain either an operation or an assertion. A summary of information based on the results of executing a TestScript. An operation would involve a REST request to a server. The results of the assertion performed on the previous operations. A summary of information based on the results of executing a TestScript. The teardown action will only contain an operation. A summary of information based on the results of executing a TestScript. An operation would involve a REST request to a server. Completed In Progress Waiting Stopped Entered In Error The current status of the test report. If the element is present, it must have either a @value, an @id, or extensions Pass Skip Fail Warning Error The results of executing an action. If the element is present, it must have either a @value, an @id, or extensions Test Engine Client Server The type of participant. If the element is present, it must have either a @value, an @id, or extensions Pass Fail Pending The reported execution result. If the element is present, it must have either a @value, an @id, or extensions A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this test script when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this test script is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the test script is stored on different servers. A formal identifier that is used to identify this test script when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the test script when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the test script author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the test script. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the test script. The status of this test script. Enables tracking the life-cycle of the content. A Boolean value to indicate that this test script is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the test script was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the test script changes. The name of the organization or individual that published the test script. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the test script from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate test script instances. A legal or geographic region in which the test script is intended to be used. Explanation of why this test script is needed and why it has been designed as it has. A copyright statement relating to the test script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the test script. An abstract server used in operations within this test script in the origin element. An abstract server used in operations within this test script in the destination element. The required capability must exist and are assumed to function correctly on the FHIR server being tested. Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute. Reference to the profile to be used for validation. Variable is set based either on element value in response body or on header field value in the response headers. A series of required setup operations before tests are executed. A test in this script. A series of operations required to clean up after all the tests are executed (successfully or otherwise). A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. Abstract name given to an origin server in this test script. The name is provided as a number starting at 1. The type of origin profile the test system supports. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. Abstract name given to a destination server in this test script. The name is provided as a number starting at 1. The type of destination profile the test system supports. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. A link to the FHIR specification that this test is covering. Capabilities that must exist and are assumed to function correctly on the FHIR server being tested. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. URL to a particular requirement or feature within the FHIR specification. Short description of the link. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. Whether or not the test execution will require the given capabilities of the server in order for this test script to execute. Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute. Description of the capabilities that this test script is requiring the server to support. Which origin server these requirements apply to. Which server these requirements apply to. Links to the FHIR specification that describes this interaction and the resources involved in more detail. Minimum capabilities required of server for test script to execute successfully. If server does not meet at a minimum the referenced capability statement, then all tests in this script are skipped. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section. Whether or not to implicitly delete the fixture during teardown. If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section. Reference to the resource (containing the contents of the resource needed for operations). A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. Descriptive name for this variable. A default, hard-coded, or user-defined value for this variable. A free text natural language description of the variable and its purpose. The FHIRPath expression to evaluate against the fixture body. When variables are defined, only one of either expression, headerField or path must be specified. Will be used to grab the HTTP header field value from the headers that sourceId is pointing to. Displayable text string with hint help information to the user when entering a default value. XPath or JSONPath to evaluate against the fixture body. When variables are defined, only one of either expression, headerField or path must be specified. Fixture to evaluate the XPath/JSONPath expression or the headerField against within this variable. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. Action would contain either an operation or an assertion. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. The operation to perform. Evaluates the results of previous operations to determine if the server under test behaves appropriately. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. Server interaction or operation type. The type of the resource. See http://build.fhir.org/resourcelist.html. The label would be used for tracking/logging purposes by test engines. The description would be used by test engines for tracking and reporting purposes. The mime-type to use for RESTful operation in the 'Accept' header. The mime-type to use for RESTful operation in the 'Content-Type' header. The server where the request message is destined for. Must be one of the server numbers listed in TestScript.destination section. Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths. The HTTP method the test engine MUST use for this operation regardless of any other operation details. The server where the request message originates from. Must be one of the server numbers listed in TestScript.origin section. Path plus parameters after [type]. Used to set parts of the request URL explicitly. Header elements would be used to set HTTP headers. The fixture id (maybe new) to map to the request. The fixture id (maybe new) to map to the response. The id of the fixture used as the body of a PUT or POST request. Id of fixture used for extracting the [id], [type], and [vid] for GET requests. Complete request URL. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. The HTTP header field e.g. "Accept". The value of the header e.g. "application/fhir+xml". A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. The label would be used for tracking/logging purposes by test engines. The description would be used by test engines for tracking and reporting purposes. The direction to use for the assertion. Id of the source fixture used as the contents to be evaluated by either the "source/expression" or "sourceId/path" definition. The FHIRPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both. XPath or JSONPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both. The mime-type contents to compare against the request or response message 'Content-Type' header. The FHIRPath expression to be evaluated against the request or response message contents - HTTP headers and payload. The HTTP header field name e.g. 'Location'. The ID of a fixture. Asserts that the response contains at a minimum the fixture specified by minimumId. Whether or not the test execution performs validation on the bundle navigation links. The operator type defines the conditional behavior of the assert. If not defined, the default is equals. The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server. The request method or HTTP operation code to compare against that used by the client system under test. The value to use in a comparison against the request URL path string. The type of the resource. See http://build.fhir.org/resourcelist.html. okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable. The value of the HTTP response code to be tested. Fixture to evaluate the XPath/JSONPath expression or the headerField against. The ID of the Profile to validate against. The value to compare to. Whether or not the test execution will produce a warning only on error for this assert. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. The name of this test used for tracking/logging purposes by test engines. A short description of the test used by test engines for tracking and reporting purposes. Action would contain either an operation or an assertion. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. An operation would involve a REST request to a server. Evaluates the results of previous operations to determine if the server under test behaves appropriately. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. The teardown action will only contain an operation. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. An operation would involve a REST request to a server. response request The type of direction to use for assertion. If the element is present, it must have either a @value, an @id, or extensions equals notEquals in notIn greaterThan lessThan empty notEmpty contains notContains evaluate The type of operator to use for assertion. If the element is present, it must have either a @value, an @id, or extensions okay created noContent notModified bad forbidden notFound methodNotAllowed conflict gone preconditionFailed unprocessable The type of response code to use for assertion. If the element is present, it must have either a @value, an @id, or extensions DELETE GET OPTIONS PATCH POST PUT HEAD The allowable request method or HTTP operation codes. If the element is present, it must have either a @value, an @id, or extensions A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html). A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html). If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this value set when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this value set is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the value set is stored on different servers. A formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the value set author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the value set. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the value set. The status of this value set. Enables tracking the life-cycle of the content. The status of the value set applies to the value set definition (ValueSet.compose) and the associated ValueSet metadata. Expansions do not have a state. A Boolean value to indicate that this value set is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the value set was created or revised (e.g. the 'content logical definition'). The name of the organization or individual that published the value set. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the value set from a consumer's perspective. The textual description specifies the span of meanings for concepts to be included within the Value Set Expansion, and also may specify the intended use and limitations of the Value Set. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate value set instances. A legal or geographic region in which the value set is intended to be used. If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change. Explanation of why this value set is needed and why it has been designed as it has. A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set. A set of criteria that define the contents of the value set by including or excluding codes selected from the specified code system(s) that the value set draws from. This is also known as the Content Logical Definition (CLD). A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed. A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html). The Locked Date is the effective date that is used to determine the version of all referenced Code Systems and Value Set Definitions included in the compose that are not already tied to a specific version. Whether inactive codes - codes that are not approved for current use - are in the value set. If inactive = true, inactive codes are to be included in the expansion, if inactive = false, the inactive codes will not be included in the expansion. If absent, the behavior is determined by the implementation, or by the applicable $expand parameters (but generally, inactive codes would be expected to be included). Include one or more codes from a code system or other value set(s). Exclude one or more codes from the value set based on code system filters and/or other value sets. A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html). An absolute URI which is the code system from which the selected codes come from. The version of the code system that the codes are selected from, or the special version '*' for all versions. Specifies a concept to be included or excluded. Select concepts by specify a matching criterion based on the properties (including relationships) defined by the system, or on filters defined by the system. If multiple filters are specified, they SHALL all be true. Selects the concepts found in this value set (based on its value set definition). This is an absolute URI that is a reference to ValueSet.url. If multiple value sets are specified this includes the union of the contents of all of the referenced value sets. A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html). Specifies a code for the concept to be included or excluded. The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system. Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc. A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html). The language this designation is defined for. A code that represents types of uses of designations. The text value for this designation. A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html). A code that identifies a property or a filter defined in the code system. The kind of operation to perform as a part of the filter criteria. The match value may be either a code defined by the system, or a string value, which is a regex match on the literal string of the property value (if the filter represents a property defined in CodeSystem) or of the system filter value (if the filter represents a filter defined in CodeSystem) when the operation is 'regex', or one of the values (true and false), when the operation is 'exists'. A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html). An identifier that uniquely identifies this expansion of the valueset, based on a unique combination of the provided parameters, the system default parameters, and the underlying system code system versions etc. Systems may re-use the same identifier as long as those factors remain the same, and the expansion is the same, but are not required to do so. This is a business identifier. The time at which the expansion was produced by the expanding system. The total number of concepts in the expansion. If the number of concept nodes in this resource is less than the stated number, then the server can return more using the offset parameter. If paging is being used, the offset at which this resource starts. I.e. this resource is a partial view into the expansion. If paging is not being used, this element SHALL NOT be present. A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion. The codes that are contained in the value set expansion. A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html). Name of the input parameter to the $expand operation; may be a server-assigned name for additional default or other server-supplied parameters used to control the expansion process. The value of the parameter. A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html). An absolute URI which is the code system in which the code for this item in the expansion is defined. If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value. If the concept is inactive in the code system that defines it. Inactive codes are those that are no longer to be used, but are maintained by the code system for understanding legacy data. It might not be known or specified whether an concept is inactive (and it may depend on the context of use). The version of the code system from this code was taken. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured, and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged. The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set. The recommended display for this item in the expansion. Additional representations for this item - other languages, aliases, specialized purposes, used for particular purposes, etc. These are relevant when the conditions of the expansion do not fix to a single correct representation. Other codes and entries contained under this entry in the hierarchy. Describes validation requirements, source(s), status and dates for one or more elements. Describes validation requirements, source(s), status and dates for one or more elements. If the element is present, it must have either a @value, an @id, or extensions A resource that was validated. The fhirpath location(s) within the resource that was validated. The frequency with which the target must be validated (none; initial; periodic). The validation status of the target (attested; validated; in process; requires revalidation; validation failed; revalidation failed). When the validation status was updated. What the target is validated against (nothing; primary source; multiple sources). The primary process by which the target is validated (edit check; value set; primary source; multiple sources; standalone; in context). Frequency of revalidation. The date/time validation was last completed (including failed validations). The date when target is next validated, if appropriate. The result if validation fails (fatal; warning; record only; none). Information about the primary source(s) involved in validation. Information about the entity attesting to information. Information about the entity validating information. Describes validation requirements, source(s), status and dates for one or more elements. Reference to the primary source. Type of primary source (License Board; Primary Education; Continuing Education; Postal Service; Relationship owner; Registration Authority; legal source; issuing source; authoritative source). Method for communicating with the primary source (manual; API; Push). Status of the validation of the target against the primary source (successful; failed; unknown). When the target was validated against the primary source. Ability of the primary source to push updates/alerts (yes; no; undetermined). Type of alerts/updates the primary source can send (specific requested changes; any changes; as defined by source). Describes validation requirements, source(s), status and dates for one or more elements. The individual or organization attesting to information. When the who is asserting on behalf of another (organization or individual). The method by which attested information was submitted/retrieved (manual; API; Push). The date the information was attested to. A digital identity certificate associated with the attestation source. A digital identity certificate associated with the proxy entity submitting attested information on behalf of the attestation source. Signed assertion by the proxy entity indicating that they have the right to submit attested information on behalf of the attestation source. Signed assertion by the attestation source that they have attested to the information. Describes validation requirements, source(s), status and dates for one or more elements. Reference to the organization validating information. A digital identity certificate associated with the validator. Signed assertion by the validator that they have validated the information. Attested Validated In process Requires revalidation Validation failed Re-Validation failed The validation status of the target. If the element is present, it must have either a @value, an @id, or extensions An authorization for the provision of glasses and/or contact lenses to a patient. An authorization for the provision of glasses and/or contact lenses to a patient. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this vision prescription. The status of the resource instance. The date this resource was created. A resource reference to the person to whom the vision prescription applies. A reference to a resource that identifies the particular occurrence of contact between patient and health care provider during which the prescription was issued. The date (and perhaps time) when the prescription was written. The healthcare professional responsible for authorizing the prescription. Contain the details of the individual lens specifications and serves as the authorization for the fullfillment by certified professionals. An authorization for the provision of glasses and/or contact lenses to a patient. Identifies the type of vision correction product which is required for the patient. The eye for which the lens specification applies. Lens power measured in dioptres (0.25 units). Power adjustment for astigmatism measured in dioptres (0.25 units). Adjustment for astigmatism measured in integer degrees. Allows for adjustment on two axis. Power adjustment for multifocal lenses measured in dioptres (0.25 units). Contact lens power measured in dioptres (0.25 units). Back curvature measured in millimetres. Contact lens diameter measured in millimetres. The recommended maximum wear period for the lens. Special color or pattern. Brand recommendations or restrictions. Notes for special requirements such as coatings and lens materials. An authorization for the provision of glasses and/or contact lenses to a patient. Amount of prism to compensate for eye alignment in fractional units. The relative base, or reference lens edge, for the prism. Up Down In Out A coded concept listing the base codes. If the element is present, it must have either a @value, an @id, or extensions Right Eye Left Eye A coded concept listing the eye codes. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/fhir-xhtml.xsd ================================================  XHTML 1.0 (Second Edition) Strict in XML Schema This is the same as HTML 4 Strict except for changes due to the differences between XML and SGML. Namespace = http://www.w3.org/1999/xhtml For further information, see: http://www.w3.org/TR/xhtml1 Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio), All Rights Reserved. The DTD version is identified by the PUBLIC and SYSTEM identifiers: PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" _id: xhtml1-strict.xsd,v 1.2 2002/08/28 08:05:44 mimasa Exp $ ================ Character mnemonic entities ========================= XHTML entity sets are identified by the PUBLIC and SYSTEM identifiers: PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN" SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent" PUBLIC "-//W3C//ENTITIES Special for XHTML//EN" SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent" PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN" SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent" ================== Imported Names ==================================== media type, as per [RFC2045] comma-separated list of media types, as per [RFC2045] a character encoding, as per [RFC2045] a space separated list of character encodings, as per [RFC2045] a language code, as per [RFC3066] a single character, as per section 2.2 of [XML] one or more digits tabindex attribute specifies the position of the current element in the tabbing order for the current document. This value must be a number between 0 and 32767. User agents should ignore leading zeros. space-separated list of link types single or comma-separated list of media descriptors a Uniform Resource Identifier, see [RFC2396] a space separated list of Uniform Resource Identifiers date and time information. ISO date format script expression style sheet data used for titles etc. nn for pixels or nn% for percentage length pixel, percentage, or relative integer representing length in pixels these are used for image maps comma separated list of lengths =================== Generic Attributes =============================== core attributes common to most elements id document-wide unique id class space separated list of classes style associated style info title advisory title/amplification internationalization attributes lang language code (backwards compatible) xml:lang language code (as per XML 1.0 spec) dir direction for weak/neutral text attributes for common UI events onclick a pointer button was clicked ondblclick a pointer button was double clicked onmousedown a pointer button was pressed down onmouseup a pointer button was released onmousemove a pointer was moved onto the element onmouseout a pointer was moved away from the element onkeypress a key was pressed and released onkeydown a key was pressed down onkeyup a key was released attributes for elements that can get the focus accesskey accessibility key character tabindex position in tabbing order onfocus the element got the focus onblur the element lost the focus =================== Text Elements ==================================== "Inline" covers inline or "text-level" elements ================== Block level elements ============================== "Flow" mixes block and inline and is used for list items etc. ================== Content models for exclusions ===================== a elements use "Inline" excluding a pre uses "Inline" excluding big, small, sup or sup ================ Document Structure ================================== generic language/style container =================== Paragraphs ======================================= =================== Headings ========================================= There are six levels of headings from h1 (the most important) to h6 (the least important). =================== Lists ============================================ Unordered list Ordered (numbered) list list item definition lists - dt for term, dd for its definition =================== Address ========================================== information on author =================== Horizontal Rule ================================== =================== Preformatted Text ================================ content is "Inline" excluding "img|object|big|small|sub|sup" =================== Block-like Quotes ================================ ================== The Anchor Element ================================ content is "Inline" except that anchors shouldn't be nested ===================== Inline Elements ================================ generic language/style container I18N BiDi over-ride forced line break emphasis strong emphasis definitional program code sample something user would type variable citation abbreviation acronym inlined quote subscript superscript fixed pitch font italic font bold font bigger font smaller font =================== Images =========================================== To avoid accessibility problems for people who aren't able to see the image, you should provide a text description using the alt and longdesc attributes. In addition, avoid the use of server-side image maps. Note that in this DTD there is no name attribute. That is only available in the transitional and frameset DTD. usemap points to a map element which may be in this document or an external document, although the latter is not widely supported ================== Client-side image maps ============================ These can be placed in the same document or grouped in a separate document although this isn't yet widely supported ======================= Tables ======================================= Derived from IETF HTML table standard, see [RFC1942] The border attribute sets the thickness of the frame around the table. The default units are screen pixels. The frame attribute specifies which parts of the frame around the table should be rendered. The values are not the same as CALS to avoid a name clash with the valign attribute. The rules attribute defines which rules to draw between cells: If rules is absent then assume: "none" if border is absent or border="0" otherwise "all" horizontal alignment attributes for cell contents char alignment char, e.g. char=':' charoff offset for alignment char vertical alignment attributes for cell contents Use thead to duplicate headers when breaking table across page boundaries, or for static headers when tbody sections are rendered in scrolling panel. Use tfoot to duplicate footers when breaking table across page boundaries, or for static footers when tbody sections are rendered in scrolling panel. Use multiple tbody sections when rules are needed between groups of table rows. colgroup groups a set of col elements. It allows you to group several semantically related columns together. col elements define the alignment properties for cells in one or more columns. The width attribute specifies the width of the columns, e.g. width=64 width in screen pixels width=0.5* relative width of 0.5 The span attribute causes the attributes of one col element to apply to more than one column. Scope is simpler than headers attribute for common tables th is for headers, td for data and for cells acting as both ================================================ FILE: tests/static/xsd/fhir/flag.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Flag dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/flag.xsd ================================================ Prospective warnings of potential issues when providing care to the patient. Prospective warnings of potential issues when providing care to the patient. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this flag by the performer or other systems which remain constant as the resource is updated and propagates from server to server. Supports basic workflow. Allows a flag to be divided into different categories like clinical, administrative etc. Intended to be used as a means of filtering which flags are displayed to particular user or in a given context. The coded value or textual component of the flag to display to the user. The patient, location, group, organization, or practitioner etc. this is about record this flag is associated with. The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified. This alert is only relevant during the encounter. The person, organization or device that created the flag. Active Inactive Entered in Error Indicates whether this flag is active and needs to be displayed to a user, or whether it is no longer needed or was entered in error. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/goal.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Goal dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided gol-1: Goal.target.measure is required if Goal.target.detail is populated qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/goal.xsd ================================================ Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc. Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this goal by the performer or other systems which remain constant as the resource is updated and propagates from server to server. The state of the goal throughout its lifecycle. Describes the progression, or lack thereof, towards the goal against the target. Indicates a category the goal falls within. Identifies the mutually agreed level of importance associated with reaching/sustaining the goal. Human-readable and/or coded description of a specific desired objective of care, such as "control blood pressure" or "negotiate an obstacle course" or "dance with child at wedding". Identifies the patient, group or organization for whom the goal is being established. The date or event after which the goal should begin being pursued. Indicates what should be done by when. Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc. Captures the reason for the current status. Indicates whose goal this is - patient goal, practitioner goal, etc. The identified conditions and other health record elements that are intended to be addressed by the goal. Any comments related to the goal. Identifies the change (or lack of change) at the point when the status of the goal is assessed. Details of what's changed (or not changed). Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc. The parameter whose value is being tracked, e.g. body weight, blood pressure, or hemoglobin A1c level. The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value. Indicates either the date or the duration after start by which the goal should be met. Proposed Planned Accepted Active On Hold Completed Cancelled Entered in Error Rejected Codes that reflect the current state of a goal and whether the goal is still being targeted. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/graphdefinition.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children GraphDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/graphdefinition.xsd ================================================ A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set. A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this graph definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this graph definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the graph definition is stored on different servers. The identifier that is used to identify this version of the graph definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the graph definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the graph definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. The status of this graph definition. Enables tracking the life-cycle of the content. A Boolean value to indicate that this graph definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the graph definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the graph definition changes. The name of the organization or individual that published the graph definition. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the graph definition from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate graph definition instances. A legal or geographic region in which the graph definition is intended to be used. Explanation of why this graph definition is needed and why it has been designed as it has. The type of FHIR resource at which instances of this graph start. The profile that describes the use of the base resource. Links this graph makes rules about. A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set. A FHIR expression that identifies one of FHIR References to other resources. Which slice (if profiled). Minimum occurrences for this link. Maximum occurrences for this link. Information about why this link is of interest in this graph definition. Potential target for the link. A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set. Type of resource this link refers to. A set of parameters to look up. Profile for the target resource. Compartment Consistency Rules. Additional links from target resource. A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set. Defines how the compartment rule is used - whether it it is used to test whether resources are subject to the rule, or whether it is a rule that must be followed. Identifies the compartment. identical | matching | different | no-rule | custom. Custom rule, as a FHIRPath expression. Documentation for FHIRPath expression. Condition Requirement Defines how a compartment rule is used. If the element is present, it must have either a @value, an @id, or extensions Identical Matching Different Custom How a compartment must be linked. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/group.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Group dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label grp-1: Can only have members if group is "actual" txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ================================================ FILE: tests/static/xsd/fhir/group.xsd ================================================ Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively, and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization. Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively, and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization. If the element is present, it must have either a @value, an @id, or extensions A unique business identifier for this group. Indicates whether the record for the group is available for use or is merely being retained for historical purposes. Identifies the broad classification of the kind of resources the group includes. If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals. Provides a specific type of resource the group includes; e.g. "cow", "syringe", etc. A label assigned to the group for human identification and communication. A count of the number of resource instances that are part of the group. Entity responsible for defining and maintaining Group characteristics and/or registered members. Identifies traits whose presence r absence is shared by members of the group. Identifies the resource instances that are members of the group. Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively, and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization. A code that identifies the kind of trait being asserted. The value of the trait that holds (or does not hold - see 'exclude') for members of the group. If true, indicates the characteristic is one that is NOT held by members of the group. The period over which the characteristic is tested; e.g. the patient had an operation during the month of June. Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively, and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization. A reference to the entity that is a member of the group. Must be consistent with Group.type. If the entity is another group, then the type must be the same. The period that the member was in the group, if known. A flag to indicate that the member is no longer in the group, but previously may have been a member. Person Animal Practitioner Device Medication Substance Types of resources that are part of group. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/guidanceresponse.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children GuidanceResponse dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided drq-1: Either a path or a searchParam must be provided, but not both drq-2: Either a path or a searchParam must be provided, but not both per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. ================================================ FILE: tests/static/xsd/fhir/guidanceresponse.xsd ================================================ A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken. A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken. If the element is present, it must have either a @value, an @id, or extensions The identifier of the request associated with this response. If an identifier was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario. Allows a service to provide unique, business identifiers for the response. An identifier, CodeableConcept or canonical reference to the guidance that was requested. The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information. The patient for which the request was processed. The encounter during which this response was created or to which the creation of this record is tightly associated. Indicates when the guidance response was processed. Provides a reference to the device that performed the guidance. Describes the reason for the guidance response in coded or textual form. Indicates the reason the request was initiated. This is typically provided as a parameter to the evaluation and echoed by the service, although for some use cases, such as subscription- or event-based scenarios, it may provide an indication of the cause for the response. Provides a mechanism to communicate additional information about the response. Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element. The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element. The actions, if any, produced by the evaluation of the artifact. If the evaluation could not be completed due to lack of information, or additional information would potentially result in a more accurate response, this element will a description of the data required in order to proceed with the evaluation. A subsequent request to the service should include this data. Success Data Requested Data Required In Progress Failure Entered In Error The status of a guidance response. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/healthcareservice.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children HealthcareService dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/healthcareservice.xsd ================================================ The details of a healthcare service available at a location. The details of a healthcare service available at a location. If the element is present, it must have either a @value, an @id, or extensions External identifiers for this item. This flag is used to mark the record to not be used. This is not used when a center is closed for maintenance, or for holidays, the notAvailable period is to be used for this. The organization that provides this healthcare service. Identifies the broad category of service being performed or delivered. The specific type of service that may be delivered or performed. Collection of specialties handled by the service site. This is more of a medical term. The location(s) where this healthcare service may be provided. Further description of the service as it would be presented to a consumer while searching. Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName. Extra details about the service that can't be placed in the other fields. If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list. List of contacts related to this specific healthcare service. The location(s) that this service is available to (not where the service is provided). The code(s) that detail the conditions under which the healthcare service is available/offered. Does this service have specific eligibility requirements that need to be met in order to use the service? Programs that this service is applicable to. Collection of characteristics (attributes). Some services are specifically made available in multiple languages, this property permits a directory to declare the languages this is offered in. Typically this is only provided where a service operates in communities with mixed languages used. Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required. Indicates whether or not a prospective consumer will require an appointment for a particular service at a site to be provided by the Organization. Indicates if an appointment is required for access to this service. A collection of times that the Service Site is available. The HealthcareService is not available during this period of time due to the provided reason. A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times. Technical endpoints providing access to services operated for the specific healthcare services defined at this resource. The details of a healthcare service available at a location. Coded value for the eligibility. Describes the eligibility conditions for the service. The details of a healthcare service available at a location. Indicates which days of the week are available between the start and end Times. Is this always available? (hence times are irrelevant) e.g. 24 hour service. The opening time of day. Note: If the AllDay flag is set, then this time is ignored. The closing time of day. Note: If the AllDay flag is set, then this time is ignored. The details of a healthcare service available at a location. The reason that can be presented to the user as to why this time is not available. Service is not available (seasonally or for a public holiday) from this date. Monday Tuesday Wednesday Thursday Friday Saturday Sunday The days of the week. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/imagingstudy.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children ImagingStudy dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/imagingstudy.xsd ================================================ Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities. Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities. If the element is present, it must have either a @value, an @id, or extensions Identifiers for the ImagingStudy such as DICOM Study Instance UID, and Accession Number. The current state of the ImagingStudy. A list of all the series.modality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19). The subject, typically a patient, of the imaging study. The healthcare event (e.g. a patient and healthcare provider interaction) during which this ImagingStudy is made. Date and time the study started. A list of the diagnostic requests that resulted in this imaging study being performed. The requesting/referring physician. Who read the study and interpreted the images or other content. The network service providing access (e.g., query, view, or retrieval) for the study. See implementation notes for information about using DICOM endpoints. A study-level endpoint applies to each series in the study, unless overridden by a series-level endpoint with the same Endpoint.connectionType. Number of Series in the Study. This value given may be larger than the number of series elements this Resource contains due to resource availability, security, or other factors. This element should be present if any series elements are present. Number of SOP Instances in Study. This value given may be larger than the number of instance elements this resource contains due to resource availability, security, or other factors. This element should be present if any instance elements are present. The procedure which this ImagingStudy was part of. The code for the performed procedure type. The principal physical location where the ImagingStudy was performed. Description of clinical condition indicating why the ImagingStudy was requested. Indicates another resource whose existence justifies this Study. Per the recommended DICOM mapping, this element is derived from the Study Description attribute (0008,1030). Observations or findings about the imaging study should be recorded in another resource, e.g. Observation, and not in this element. The Imaging Manager description of the study. Institution-generated description or classification of the Study (component) performed. Each study has one or more series of images or other content. Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities. The DICOM Series Instance UID for the series. The numeric identifier of this series in the study. The modality of this series sequence. A description of the series. Number of SOP Instances in the Study. The value given may be larger than the number of instance elements this resource contains due to resource availability, security, or other factors. This element should be present if any instance elements are present. The network service providing access (e.g., query, view, or retrieval) for this series. See implementation notes for information about using DICOM endpoints. A series-level endpoint, if present, has precedence over a study-level endpoint with the same Endpoint.connectionType. The anatomic structures examined. See DICOM Part 16 Annex L (http://dicom.nema.org/medical/dicom/current/output/chtml/part16/chapter_L.html) for DICOM to SNOMED-CT mappings. The bodySite may indicate the laterality of body part imaged; if so, it shall be consistent with any content of ImagingStudy.series.laterality. The laterality of the (possibly paired) anatomic structures examined. E.g., the left knee, both lungs, or unpaired abdomen. If present, shall be consistent with any laterality information indicated in ImagingStudy.series.bodySite. The specimen imaged, e.g., for whole slide imaging of a biopsy. The date and time the series was started. Indicates who or what performed the series and how they were involved. A single SOP instance within the series, e.g. an image, or presentation state. Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities. Distinguishes the type of involvement of the performer in the series. Indicates who or what performed the series. Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities. The DICOM SOP Instance UID for this image or other DICOM content. DICOM instance type. The number of instance in the series. The description of the instance. Registered Available Cancelled Entered in Error Unknown The status of the ImagingStudy. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/immunization.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Immunization dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided imm-1: One of documentType or reference SHALL be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/immunization.xsd ================================================ Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party. Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this immunization record. Indicates the current status of the immunization event. Indicates the reason the immunization event was not performed. Vaccine that was administered or was to be administered. The patient who either received or did not receive the immunization. The visit or admission or other contact between patient and health care provider the immunization was performed as part of. Date vaccine administered or was to be administered. The date the occurrence of the immunization was first captured in the record - potentially significantly after the occurrence of the event. An indication that the content of the record is based on information from the person who administered the vaccine. This reflects the context under which the data was originally recorded. The source of the data when the report of the immunization event is not based on information from the person who administered the vaccine. The service delivery location where the vaccine administration occurred. Name of vaccine manufacturer. Lot number of the vaccine product. Date vaccine batch expires. Body site where vaccine was administered. The path by which the vaccine product is taken into the body. The quantity of vaccine product that was administered. Indicates who performed the immunization event. Extra information about the immunization that is not conveyed by the other attributes. Reasons why the vaccine was administered. Condition, Observation or DiagnosticReport that supports why the immunization was administered. Indication if a dose is considered to be subpotent. By default, a dose should be considered to be potent. Reason why a dose is considered to be subpotent. Educational material presented to the patient (or guardian) at the time of vaccine administration. Indicates a patient's eligibility for a funding program. Indicates the source of the vaccine actually administered. This may be different than the patient eligibility (e.g. the patient may be eligible for a publically purchased vaccine but due to inventory issues, vaccine purchased with private funds was actually administered). Categorical data indicating that an adverse event is associated in time to an immunization. The protocol (set of recommendations) being followed by the provider who administered the dose. Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party. Describes the type of performance (e.g. ordering provider, administering provider, etc.). The practitioner or organization who performed the action. Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party. Identifier of the material presented to the patient. Reference pointer to the educational material given to the patient if the information was on line. Date the educational material was published. Date the educational material was given to the patient. Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party. Date of reaction to the immunization. Details of the reaction. Self-reported indicator. Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party. One possible path to achieve presumed immunity against a disease - within the context of an authority. Indicates the authority who published the protocol (e.g. ACIP) that is being followed. The vaccine preventable disease the dose is being administered against. Nominal position in a series. The recommended number of doses to achieve immunity. Completed Entered in Error Not Done A set of codes indicating the current status of an Immunization. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/immunizationevaluation.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children ImmunizationEvaluation dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/immunizationevaluation.xsd ================================================ Describes a comparison of an immunization event against published recommendations to determine if the administration is "valid" in relation to those recommendations. Describes a comparison of an immunization event against published recommendations to determine if the administration is "valid" in relation to those recommendations. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this immunization evaluation record. Indicates the current status of the evaluation of the vaccination administration event. The individual for whom the evaluation is being done. The date the evaluation of the vaccine administration event was performed. Indicates the authority who published the protocol (e.g. ACIP). The vaccine preventable disease the dose is being evaluated against. The vaccine administration event being evaluated. Indicates if the dose is valid or not valid with respect to the published recommendations. Provides an explanation as to why the vaccine administration event is valid or not relative to the published recommendations. Additional information about the evaluation. One possible path to achieve presumed immunity against a disease - within the context of an authority. Nominal position in a series. The recommended number of doses to achieve immunity. Completed Entered in Error The status of the evaluation being done. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/immunizationrecommendation.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children ImmunizationRecommendation dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided imr-1: One of vaccineCode or targetDisease SHALL be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/immunizationrecommendation.xsd ================================================ A patient's point-in-time set of recommendations (i.e. forecasting) according to a published schedule with optional supporting justification. A patient's point-in-time set of recommendations (i.e. forecasting) according to a published schedule with optional supporting justification. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this particular recommendation record. The patient the recommendation(s) are for. The date the immunization recommendation(s) were created. Indicates the authority who published the protocol (e.g. ACIP). Vaccine administration recommendations. A patient's point-in-time set of recommendations (i.e. forecasting) according to a published schedule with optional supporting justification. Vaccine(s) or vaccine group that pertain to the recommendation. The targeted disease for the recommendation. Vaccine(s) which should not be used to fulfill the recommendation. Indicates the patient status with respect to the path to immunity for the target disease. The reason for the assigned forecast status. Vaccine date recommendations. For example, earliest date to administer, latest date to administer, etc. Contains the description about the protocol under which the vaccine was administered. One possible path to achieve presumed immunity against a disease - within the context of an authority. Nominal position of the recommended dose in a series (e.g. dose 2 is the next recommended dose). The recommended number of doses to achieve immunity. Immunization event history and/or evaluation that supports the status and recommendation. Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information. A patient's point-in-time set of recommendations (i.e. forecasting) according to a published schedule with optional supporting justification. Date classification of recommendation. For example, earliest date to give, latest date to give, etc. The date whose meaning is specified by dateCriterion.code. ================================================ FILE: tests/static/xsd/fhir/implementationguide.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children ImplementationGuide dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label ig-2: If a resource has a fhirVersion, it must be oe of the versions defined for the Implementation Guide txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ig-1: If a resource has a groupingId, it must refer to a grouping defined in the Implementation Guide ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/implementationguide.xsd ================================================ A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this implementation guide is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the implementation guide is stored on different servers. The identifier that is used to identify this version of the implementation guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the implementation guide author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the implementation guide. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the implementation guide. The status of this implementation guide. Enables tracking the life-cycle of the content. A Boolean value to indicate that this implementation guide is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the implementation guide was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes. The name of the organization or individual that published the implementation guide. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the implementation guide from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate implementation guide instances. A legal or geographic region in which the implementation guide is intended to be used. A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the implementation guide. The NPM package name for this Implementation Guide, used in the NPM package distribution, which is the primary mechanism by which FHIR based tooling manages IG dependencies. This value must be globally unique, and should be assigned with care. The license that applies to this Implementation Guide, using an SPDX license code, or 'not-open-source'. The version(s) of the FHIR specification that this ImplementationGuide targets - e.g. describes how to use. The value of this element is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 4.0.1. for this version. Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, profiles etc.defined in other implementation guides. A set of profiles that all resources covered by this implementation guide must conform to. The information needed by an IG publisher tool to publish the whole implementation guide. Information about an assembled implementation guide, created by the publication tooling. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. A canonical reference to the Implementation guide for the dependency. The NPM package name for the Implementation Guide that this IG depends on. The version of the IG that is depended on, when the correct version is required to understand the IG correctly. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. The type of resource that all instances must conform to. A reference to the profile that all instances must conform to. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. A logical group of resources. Logical groups can be used when building pages. A resource that is part of the implementation guide. Conformance resources (value set, structure definition, capability statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource. A page / section in the implementation guide. The root page is the implementation guide home page. Defines how IG is built by tools. A template for building resources. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. The human-readable title to display for the package of resources when rendering the implementation guide. Human readable text describing the package. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. Where this resource is found. Indicates the FHIR Version(s) this artifact is intended to apply to. If no versions are specified, the resource is assumed to apply to all the versions stated in ImplementationGuide.fhirVersion. A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name). A description of the reason that a resource has been included in the implementation guide. If true or a reference, indicates the resource is an example instance. If a reference is present, indicates that the example is an example of the specified profile. Reference to the id of the grouping this resource appears in. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. The source address for the page. A short title used to represent this page in navigational structures such as table of contents, bread crumbs, etc. A code that indicates how the page is generated. Nested Pages/Sections under this page. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. apply | path-resource | path-pages | path-tx-cache | expansion-parameter | rule-broken-links | generate-xml | generate-json | generate-turtle | html-template. Value for named type. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. Type of template specified. The source location for the template. The scope in which the template applies. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. A pointer to official web page, PDF or other rendering of the implementation guide. A resource that is part of the implementation guide. Conformance resources (value set, structure definition, capability statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource. Information about a page within the IG. Indicates a relative path to an image that exists within the IG. Indicates the relative path of an additional non-page, non-image file that is part of the IG - e.g. zip, jar and similar files that could be the target of a hyperlink in a derived IG. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. Where this resource is found. If true or a reference, indicates the resource is an example instance. If a reference is present, indicates that the example is an example of the specified profile. The relative path for primary page for this resource within the IG. A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts. Relative path to the page. Label for the page intended for human display. The name of an anchor available on the page. Apply Metadata Value Resource Path Pages Path Terminology Cache Path Expansion Profile Broken Links Rule Generate XML Generate JSON Generate Turtle HTML Template Code of parameter that is input to the guide. If the element is present, it must have either a @value, an @id, or extensions Not open source BSD Zero Clause License Attribution Assurance License Abstyles License Adobe Systems Incorporated Source Code License Agreement Adobe Glyph List License Amazon Digital Services License Academic Free License v1.1 Academic Free License v1.2 Academic Free License v2.0 Academic Free License v2.1 Academic Free License v3.0 Afmparse License Affero General Public License v1.0 only Affero General Public License v1.0 or later GNU Affero General Public License v3.0 only GNU Affero General Public License v3.0 or later Aladdin Free Public License AMD's plpa_map.c License Apple MIT License Academy of Motion Picture Arts and Sciences BSD ANTLR Software Rights Notice Apache License 1.0 Apache License 1.1 Apache License 2.0 Adobe Postscript AFM License Adaptive Public License 1.0 Apple Public Source License 1.0 Apple Public Source License 1.1 Apple Public Source License 1.2 Apple Public Source License 2.0 Artistic License 1.0 w/clause 8 Artistic License 1.0 (Perl) Artistic License 1.0 Artistic License 2.0 Bahyph License Barr License Beerware License BitTorrent Open Source License v1.0 BitTorrent Open Source License v1.1 Borceux license BSD 1-Clause License BSD 2-Clause FreeBSD License BSD 2-Clause NetBSD License BSD-2-Clause Plus Patent License BSD 2-Clause "Simplified" License BSD with attribution BSD 3-Clause Clear License Lawrence Berkeley National Labs BSD variant license BSD 3-Clause No Nuclear License 2014 BSD 3-Clause No Nuclear License BSD 3-Clause No Nuclear Warranty BSD 3-Clause "New" or "Revised" License BSD-4-Clause (University of California-Specific) BSD 4-Clause "Original" or "Old" License BSD Protection License BSD Source Code Attribution Boost Software License 1.0 bzip2 and libbzip2 License v1.0.5 bzip2 and libbzip2 License v1.0.6 Caldera License Computer Associates Trusted Open Source License 1.1 Creative Commons Attribution 1.0 Generic Creative Commons Attribution 2.0 Generic Creative Commons Attribution 2.5 Generic Creative Commons Attribution 3.0 Unported Creative Commons Attribution 4.0 International Creative Commons Attribution Non Commercial 1.0 Generic Creative Commons Attribution Non Commercial 2.0 Generic Creative Commons Attribution Non Commercial 2.5 Generic Creative Commons Attribution Non Commercial 3.0 Unported Creative Commons Attribution Non Commercial 4.0 International Creative Commons Attribution Non Commercial No Derivatives 1.0 Generic Creative Commons Attribution Non Commercial No Derivatives 2.0 Generic Creative Commons Attribution Non Commercial No Derivatives 2.5 Generic Creative Commons Attribution Non Commercial No Derivatives 3.0 Unported Creative Commons Attribution Non Commercial No Derivatives 4.0 International Creative Commons Attribution Non Commercial Share Alike 1.0 Generic Creative Commons Attribution Non Commercial Share Alike 2.0 Generic Creative Commons Attribution Non Commercial Share Alike 2.5 Generic Creative Commons Attribution Non Commercial Share Alike 3.0 Unported Creative Commons Attribution Non Commercial Share Alike 4.0 International Creative Commons Attribution No Derivatives 1.0 Generic Creative Commons Attribution No Derivatives 2.0 Generic Creative Commons Attribution No Derivatives 2.5 Generic Creative Commons Attribution No Derivatives 3.0 Unported Creative Commons Attribution No Derivatives 4.0 International Creative Commons Attribution Share Alike 1.0 Generic Creative Commons Attribution Share Alike 2.0 Generic Creative Commons Attribution Share Alike 2.5 Generic Creative Commons Attribution Share Alike 3.0 Unported Creative Commons Attribution Share Alike 4.0 International Creative Commons Zero v1.0 Universal Common Development and Distribution License 1.0 Common Development and Distribution License 1.1 Community Data License Agreement Permissive 1.0 Community Data License Agreement Sharing 1.0 CeCILL Free Software License Agreement v1.0 CeCILL Free Software License Agreement v1.1 CeCILL Free Software License Agreement v2.0 CeCILL Free Software License Agreement v2.1 CeCILL-B Free Software License Agreement CeCILL-C Free Software License Agreement Clarified Artistic License CNRI Jython License CNRI Python Open Source GPL Compatible License Agreement CNRI Python License Condor Public License v1.1 Common Public Attribution License 1.0 Common Public License 1.0 Code Project Open License 1.02 Crossword License CrystalStacker License CUA Office Public License v1.0 Cube License curl License Deutsche Freie Software Lizenz diffmark license DOC License Dotseqn License DSDP License dvipdfm License Educational Community License v1.0 Educational Community License v2.0 Eiffel Forum License v1.0 Eiffel Forum License v2.0 eGenix.com Public License 1.1.0 Entessa Public License v1.0 Eclipse Public License 1.0 Eclipse Public License 2.0 Erlang Public License v1.1 EU DataGrid Software License European Union Public License 1.0 European Union Public License 1.1 European Union Public License 1.2 Eurosym License Fair License Frameworx Open License 1.0 FreeImage Public License v1.0 FSF All Permissive License FSF Unlimited License FSF Unlimited License (with License Retention) Freetype Project License GNU Free Documentation License v1.1 only GNU Free Documentation License v1.1 or later GNU Free Documentation License v1.2 only GNU Free Documentation License v1.2 or later GNU Free Documentation License v1.3 only GNU Free Documentation License v1.3 or later Giftware License GL2PS License 3dfx Glide License Glulxe License gnuplot License GNU General Public License v1.0 only GNU General Public License v1.0 or later GNU General Public License v2.0 only GNU General Public License v2.0 or later GNU General Public License v3.0 only GNU General Public License v3.0 or later gSOAP Public License v1.3b Haskell Language Report License Historical Permission Notice and Disclaimer IBM PowerPC Initialization and Boot Software ICU License Independent JPEG Group License ImageMagick License iMatix Standard Function Library Agreement Imlib2 License Info-ZIP License Intel ACPI Software License Agreement Intel Open Source License Interbase Public License v1.0 IPA Font License IBM Public License v1.0 ISC License JasPer License JSON License Licence Art Libre 1.2 Licence Art Libre 1.3 Latex2e License Leptonica License GNU Library General Public License v2 only GNU Library General Public License v2 or later GNU Lesser General Public License v2.1 only GNU Lesser General Public License v2.1 or later GNU Lesser General Public License v3.0 only GNU Lesser General Public License v3.0 or later Lesser General Public License For Linguistic Resources libpng License libtiff License Licence Libre du Québec – Permissive version 1.1 Licence Libre du Québec – Réciprocité version 1.1 Licence Libre du Québec – Réciprocité forte version 1.1 Linux Kernel Variant of OpenIB.org license Lucent Public License Version 1.0 Lucent Public License v1.02 LaTeX Project Public License v1.0 LaTeX Project Public License v1.1 LaTeX Project Public License v1.2 LaTeX Project Public License v1.3a LaTeX Project Public License v1.3c MakeIndex License MirOS License MIT No Attribution Enlightenment License (e16) CMU License enna License feh License MIT License MIT +no-false-attribs license Motosoto License mpich2 License Mozilla Public License 1.0 Mozilla Public License 1.1 Mozilla Public License 2.0 (no copyleft exception) Mozilla Public License 2.0 Microsoft Public License Microsoft Reciprocal License Matrix Template Library License Multics License Mup License NASA Open Source Agreement 1.3 Naumen Public License Net Boolean Public License v1 University of Illinois/NCSA Open Source License Net-SNMP License NetCDF license Newsletr License Nethack General Public License Norwegian Licence for Open Government Data No Limit Public License Nokia Open Source License Netizen Open Source License Noweb License Netscape Public License v1.0 Netscape Public License v1.1 Non-Profit Open Software License 3.0 NRL License NTP License Open CASCADE Technology Public License OCLC Research Public License 2.0 ODC Open Database License v1.0 SIL Open Font License 1.0 SIL Open Font License 1.1 Open Group Test Suite License Open LDAP Public License v1.1 Open LDAP Public License v1.2 Open LDAP Public License v1.3 Open LDAP Public License v1.4 Open LDAP Public License v2.0.1 Open LDAP Public License v2.0 (or possibly 2.0A and 2.0B) Open LDAP Public License v2.1 Open LDAP Public License v2.2.1 Open LDAP Public License 2.2.2 Open LDAP Public License v2.2 Open LDAP Public License v2.3 Open LDAP Public License v2.4 Open LDAP Public License v2.5 Open LDAP Public License v2.6 Open LDAP Public License v2.7 Open LDAP Public License v2.8 Open Market License OpenSSL License Open Public License v1.0 OSET Public License version 2.1 Open Software License 1.0 Open Software License 1.1 Open Software License 2.0 Open Software License 2.1 Open Software License 3.0 ODC Public Domain Dedication & License 1.0 PHP License v3.0 PHP License v3.01 Plexus Classworlds License PostgreSQL License psfrag License psutils License Python License 2.0 Qhull License Q Public License 1.0 Rdisc License Red Hat eCos Public License v1.1 Reciprocal Public License 1.1 Reciprocal Public License 1.5 RealNetworks Public Source License v1.0 RSA Message-Digest License Ricoh Source Code Public License Ruby License Sax Public Domain Notice Saxpath License SCEA Shared Source License Sendmail License SGI Free Software License B v1.0 SGI Free Software License B v1.1 SGI Free Software License B v2.0 Simple Public License 2.0 Sun Industry Standards Source License v1.2 Sun Industry Standards Source License v1.1 Sleepycat License Standard ML of New Jersey License Secure Messaging Protocol Public License SNIA Public License 1.1 Spencer License 86 Spencer License 94 Spencer License 99 Sun Public License v1.0 SugarCRM Public License v1.1.3 Scheme Widget Library (SWL) Software License Agreement TCL/TK License TCP Wrappers License TMate Open Source License TORQUE v2.5+ Software License v1.1 Trusster Open Source License Unicode License Agreement - Data Files and Software (2015) Unicode License Agreement - Data Files and Software (2016) Unicode Terms of Use The Unlicense Universal Permissive License v1.0 Vim License VOSTROM Public License for Open Source Vovida Software License v1.0 W3C Software Notice and License (1998-07-20) W3C Software Notice and Document License (2015-05-13) W3C Software Notice and License (2002-12-31) Sybase Open Watcom Public License 1.0 Wsuipa License Do What The F*ck You Want To Public License X11 License Xerox License XFree86 License 1.1 xinetd License X.Net License XPP License XSkat License Yahoo! Public License v1.0 Yahoo! Public License v1.1 Zed License Zend License v2.0 Zimbra Public License v1.3 Zimbra Public License v1.4 zlib/libpng License with Acknowledgement zlib License Zope Public License 1.1 Zope Public License 2.0 Zope Public License 2.1 The license that applies to an Implementation Guide (using an SPDX license Identifiers, or 'not-open-source'). The binding is required but new SPDX license Identifiers are allowed to be used (https://spdx.org/licenses/). If the element is present, it must have either a @value, an @id, or extensions HTML Markdown XML Generated A code that indicates how the page is generated. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/insuranceplan.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children InsurancePlan dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label ipn-1: The organization SHALL at least have a name or an idendtifier, and possibly more than one txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ================================================ FILE: tests/static/xsd/fhir/insuranceplan.xsd ================================================ Details of a Health Insurance product/plan provided by an organization. Details of a Health Insurance product/plan provided by an organization. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this health insurance product which remain constant as the resource is updated and propagates from server to server. The current state of the health insurance product. The kind of health insurance product. Official name of the health insurance product as designated by the owner. A list of alternate names that the product is known as, or was known as in the past. The period of time that the health insurance product is available. The entity that is providing the health insurance product and underwriting the risk. This is typically an insurance carriers, other third-party payers, or health plan sponsors comonly referred to as 'payers'. An organization which administer other services such as underwriting, customer service and/or claims processing on behalf of the health insurance product owner. The geographic region in which a health insurance product's benefits apply. The contact for the health insurance product for a certain purpose. The technical endpoints providing access to services operated for the health insurance product. Reference to the network included in the health insurance product. Details about the coverage offered by the insurance product. Details about an insurance plan. Details of a Health Insurance product/plan provided by an organization. Indicates a purpose for which the contact can be reached. A name associated with the contact. A contact detail (e.g. a telephone number or an email address) by which the party may be contacted. Visiting or postal addresses for the contact. Details of a Health Insurance product/plan provided by an organization. Type of coverage (Medical; Dental; Mental Health; Substance Abuse; Vision; Drug; Short Term; Long Term Care; Hospice; Home Health). Reference to the network that providing the type of coverage. Specific benefits under this type of coverage. Details of a Health Insurance product/plan provided by an organization. Type of benefit (primary care; speciality care; inpatient; outpatient). The referral requirements to have access/coverage for this benefit. The specific limits on the benefit. Details of a Health Insurance product/plan provided by an organization. The maximum amount of a service item a plan will pay for a covered benefit. For examples. wellness visits, or eyeglasses. The specific limit on the benefit. Details of a Health Insurance product/plan provided by an organization. Business identifiers assigned to this health insurance plan which remain constant as the resource is updated and propagates from server to server. Type of plan. For example, "Platinum" or "High Deductable". The geographic region in which a health insurance plan's benefits apply. Reference to the network that providing the type of coverage. Overall costs associated with the plan. Costs associated with the coverage provided by the product. Details of a Health Insurance product/plan provided by an organization. Type of cost. Number of participants enrolled in the plan. Value of the cost. Additional information about the general costs associated with this plan. Details of a Health Insurance product/plan provided by an organization. General category of benefit (Medical; Dental; Vision; Drug; Mental Health; Substance Abuse; Hospice, Home Health). List of the specific benefits under this category of benefit. Details of a Health Insurance product/plan provided by an organization. Type of specific benefit (preventative; primary care office visit; speciality office visit; hospitalization; emergency room; urgent care). List of the costs associated with a specific benefit. Details of a Health Insurance product/plan provided by an organization. Type of cost (copay; individual cap; family cap; coinsurance; deductible). Whether the cost applies to in-network or out-of-network providers (in-network; out-of-network; other). Additional information about the cost, such as information about funding sources (e.g. HSA, HRA, FSA, RRA). The actual cost value. (some of the costs may be represented as percentages rather than currency, e.g. 10% coinsurance). ================================================ FILE: tests/static/xsd/fhir/invoice.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Invoice dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/invoice.xsd ================================================ Invoice containing collected ChargeItems from an Account with calculated individual and total price for Billing purpose. Invoice containing collected ChargeItems from an Account with calculated individual and total price for Billing purpose. If the element is present, it must have either a @value, an @id, or extensions Identifier of this Invoice, often used for reference in correspondence about this invoice or for tracking of payments. The current state of the Invoice. In case of Invoice cancellation a reason must be given (entered in error, superseded by corrected invoice etc.). Type of Invoice depending on domain, realm an usage (e.g. internal/external, dental, preliminary). The individual or set of individuals receiving the goods and services billed in this invoice. The individual or Organization responsible for balancing of this invoice. Date/time(s) of when this Invoice was posted. Indicates who or what performed or participated in the charged service. The organizationissuing the Invoice. Account which is supposed to be balanced with this Invoice. Each line item represents one charge for goods and services rendered. Details such as date, code and amount are found in the referenced ChargeItem resource. The total amount for the Invoice may be calculated as the sum of the line items with surcharges/deductions that apply in certain conditions. The priceComponent element can be used to offer transparency to the recipient of the Invoice of how the total price was calculated. Invoice total , taxes excluded. Invoice total, tax included. Payment details such as banking details, period of payment, deductibles, methods of payment. Comments made about the invoice by the issuer, subject, or other participants. Invoice containing collected ChargeItems from an Account with calculated individual and total price for Billing purpose. Describes the type of involvement (e.g. transcriptionist, creator etc.). If the invoice has been created automatically, the Participant may be a billing engine or another kind of device. The device, practitioner, etc. who performed or participated in the service. Invoice containing collected ChargeItems from an Account with calculated individual and total price for Billing purpose. Sequence in which the items appear on the invoice. The ChargeItem contains information such as the billing code, date, amount etc. If no further details are required for the lineItem, inline billing codes can be added using the CodeableConcept data type instead of the Reference. The price for a ChargeItem may be calculated as a base price with surcharges/deductions that apply in certain conditions. A ChargeItemDefinition resource that defines the prices, factors and conditions that apply to a billing code is currently under development. The priceComponent element can be used to offer transparency to the recipient of the Invoice as to how the prices have been calculated. Invoice containing collected ChargeItems from an Account with calculated individual and total price for Billing purpose. This code identifies the type of the component. A code that identifies the component. Codes may be used to differentiate between kinds of taxes, surcharges, discounts etc. The factor that has been applied on the base price for calculating this component. The amount calculated for this component. draft issued balanced cancelled entered in error Codes identifying the lifecycle stage of an Invoice. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/library.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Library dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided drq-1: Either a path or a searchParam must be provided, but not both drq-2: Either a path or a searchParam must be provided, but not both per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. att-1: If the Attachment has data, it SHALL have a contentType ================================================ FILE: tests/static/xsd/fhir/library.xsd ================================================ The Library resource is a general-purpose container for knowledge asset definitions. It can be used to describe and expose existing knowledge assets such as logic libraries and information model descriptions, as well as to describe a collection of knowledge assets. The Library resource is a general-purpose container for knowledge asset definitions. It can be used to describe and expose existing knowledge assets such as logic libraries and information model descriptions, as well as to describe a collection of knowledge assets. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this library when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this library is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the library is stored on different servers. A formal identifier that is used to identify this library when it is represented in other formats, or referenced in a specification, model, design or an instance. e.g. CMS or NQF identifiers for a measure artifact. Note that at least one identifier is required for non-experimental active artifacts. The identifier that is used to identify this version of the library when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the library author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts. A natural language name identifying the library. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the library. An explanatory or alternate title for the library giving additional information about its content. The status of this library. Enables tracking the life-cycle of the content. A Boolean value to indicate that this library is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. Identifies the type of library such as a Logic Library, Model Definition, Asset Collection, or Module Definition. A code or group definition that describes the intended subject of the contents of the library. The date (and optionally time) when the library was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the library changes. The name of the organization or individual that published the library. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the library from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate library instances. A legal or geographic region in which the library is intended to be used. Explanation of why this library is needed and why it has been designed as it has. A detailed description of how the library is used from a clinical perspective. A copyright statement relating to the library and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the library. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the library content was or is planned to be in active use. Descriptive topics related to the content of the library. Topics provide a high-level categorization of the library that can be useful for filtering and searching. An individiual or organization primarily involved in the creation and maintenance of the content. An individual or organization primarily responsible for internal coherence of the content. An individual or organization primarily responsible for review of some aspect of the content. An individual or organization responsible for officially endorsing the content for use in some setting. Related artifacts such as additional documentation, justification, or bibliographic references. The parameter element defines parameters used by the library. Describes a set of data that must be provided in order to be able to successfully perform the computations defined by the library. The content of the library as an Attachment. The content may be a reference to a url, or may be directly embedded as a base-64 string. Either way, the contentType of the attachment determines how to interpret the content. ================================================ FILE: tests/static/xsd/fhir/linkage.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Linkage dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label lnk-1: Must have at least two items txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/linkage.xsd ================================================ Identifies two or more records (resource instances) that refer to the same real-world "occurrence". Identifies two or more records (resource instances) that refer to the same real-world "occurrence". If the element is present, it must have either a @value, an @id, or extensions Indicates whether the asserted set of linkages are considered to be "in effect". Identifies the user or organization responsible for asserting the linkages as well as the user or organization who establishes the context in which the nature of each linkage is evaluated. Identifies which record considered as the reference to the same real-world occurrence as well as how the items should be evaluated within the collection of linked items. Identifies two or more records (resource instances) that refer to the same real-world "occurrence". Distinguishes which item is "source of truth" (if any) and which items are no longer considered to be current representations. The resource instance being linked as part of the group. Source of Truth Alternate Record Historical/Obsolete Record Used to distinguish different roles a resource can play within a set of linked resources. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/list.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children List dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label lst-3: An entry date can only be used if the mode of the list is "working" lst-2: The deleted flag can only be used if the mode of the list is "changes" lst-1: A list can only have an emptyReason if it is empty txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/list.xsd ================================================ A list is a curated collection of resources. A list is a curated collection of resources. If the element is present, it must have either a @value, an @id, or extensions Identifier for the List assigned for business purposes outside the context of FHIR. Indicates the current state of this list. How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted. A label for the list assigned by the author. This code defines the purpose of the list - why it was created. The common subject (or patient) of the resources that are in the list if there is one. The encounter that is the context in which this list was created. The date that the list was prepared. The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list. What order applies to the items in the list. Comments that apply to the overall list. Entries in this list. If the list is empty, why the list is empty. A list is a curated collection of resources. The flag allows the system constructing the list to indicate the role and significance of the item in the list. True if this item is marked as deleted in the list. When this item was added to the list. A reference to the actual resource from which data was derived. Current Retired Entered In Error The current state of the list. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/location.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Location dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/location.xsd ================================================ Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained, or accommodated. Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained, or accommodated. If the element is present, it must have either a @value, an @id, or extensions Unique code or number identifying the location to its users. The status property covers the general availability of the resource, not the current value which may be covered by the operationStatus, or by a schedule/slots if they are configured for the location. The operational status covers operation values most relevant to beds (but can also apply to rooms/units/chairs/etc. such as an isolation unit/dialysis chair). This typically covers concepts such as contamination, housekeeping, and other activities like maintenance. Name of the location as used by humans. Does not need to be unique. A list of alternate names that the location is known as, or was known as, in the past. Description of the Location, which helps in finding or referencing the place. Indicates whether a resource instance represents a specific location or a class of locations. Indicates the type of function performed at the location. The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites. Physical location. Physical form of the location, e.g. building, room, vehicle, road. The absolute geographic location of the Location, expressed using the WGS84 datum (This is the same co-ordinate system used in KML). The organization responsible for the provisioning and upkeep of the location. Another Location of which this Location is physically a part of. What days/times during a week is this location usually open. A description of when the locations opening ours are different to normal, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as detailed in the opening hours Times. Technical endpoints providing access to services operated for the location. Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained, or accommodated. Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained, or accommodated. Indicates which days of the week are available between the start and end Times. The Location is open all day. Time that the Location opens. Time that the Location closes. Instance Kind Indicates whether a resource instance represents a specific location or a class of locations. If the element is present, it must have either a @value, an @id, or extensions Active Suspended Inactive Indicates whether the location is still in use. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/measure.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Measure dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label mea-1: Stratifier SHALL be either a single criteria or a set of criteria components txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType exp-1: An expression or a reference must be provided exp-1: An expression or a reference must be provided exp-1: An expression or a reference must be provided exp-1: An expression or a reference must be provided ================================================ FILE: tests/static/xsd/fhir/measure.xsd ================================================ The Measure resource provides the definition of a quality measure. The Measure resource provides the definition of a quality measure. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this measure when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this measure is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the measure is stored on different servers. A formal identifier that is used to identify this measure when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the measure when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the measure author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts. A natural language name identifying the measure. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the measure. An explanatory or alternate title for the measure giving additional information about its content. The status of this measure. Enables tracking the life-cycle of the content. A Boolean value to indicate that this measure is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The intended subjects for the measure. If this element is not provided, a Patient subject is assumed, but the subject of the measure can be anything. The date (and optionally time) when the measure was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the measure changes. The name of the organization or individual that published the measure. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the measure from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate measure instances. A legal or geographic region in which the measure is intended to be used. Explanation of why this measure is needed and why it has been designed as it has. A detailed description, from a clinical perspective, of how the measure is used. A copyright statement relating to the measure and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the measure. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the measure content was or is planned to be in active use. Descriptive topics related to the content of the measure. Topics provide a high-level categorization grouping types of measures that can be useful for filtering and searching. An individiual or organization primarily involved in the creation and maintenance of the content. An individual or organization primarily responsible for internal coherence of the content. An individual or organization primarily responsible for review of some aspect of the content. An individual or organization responsible for officially endorsing the content for use in some setting. Related artifacts such as additional documentation, justification, or bibliographic references. A reference to a Library resource containing the formal logic used by the measure. Notices and disclaimers regarding the use of the measure or related to intellectual property (such as code systems) referenced by the measure. Indicates how the calculation is performed for the measure, including proportion, ratio, continuous-variable, and cohort. The value set is extensible, allowing additional measure scoring types to be represented. If this is a composite measure, the scoring method used to combine the component measures to determine the composite score. Indicates whether the measure is used to examine a process, an outcome over time, a patient-reported outcome, or a structure measure such as utilization. A description of the risk adjustment factors that may impact the resulting score for the measure and how they may be accounted for when computing and reporting measure results. Describes how to combine the information calculated, based on logic in each of several populations, into one summarized result. Provides a succinct statement of the need for the measure. Usually includes statements pertaining to importance criterion: impact, gap in care, and evidence. Provides a summary of relevant clinical guidelines or other clinical recommendations supporting the measure. Information on whether an increase or decrease in score is the preferred result (e.g., a higher score indicates better quality OR a lower score indicates better quality OR quality is within a range). Provides a description of an individual term used within the measure. Additional guidance for the measure including how it can be used in a clinical context, and the intent of the measure. A group of population criteria for the measure. The supplemental data criteria for the measure report, specified as either the name of a valid CQL expression within a referenced library, or a valid FHIR Resource Path. The Measure resource provides the definition of a quality measure. Indicates a meaning for the group. This can be as simple as a unique identifier, or it can establish meaning in a broader context by drawing from a terminology, allowing groups to be correlated across measures. The human readable description of this population group. A population criteria for the measure. The stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a referenced library or a valid FHIR Resource Path. The Measure resource provides the definition of a quality measure. The type of population criteria. The human readable description of this population criteria. An expression that specifies the criteria for the population, typically the name of an expression in a library. The Measure resource provides the definition of a quality measure. Indicates a meaning for the stratifier. This can be as simple as a unique identifier, or it can establish meaning in a broader context by drawing from a terminology, allowing stratifiers to be correlated across measures. The human readable description of this stratifier criteria. An expression that specifies the criteria for the stratifier. This is typically the name of an expression defined within a referenced library, but it may also be a path to a stratifier element. A component of the stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a referenced library or a valid FHIR Resource Path. The Measure resource provides the definition of a quality measure. Indicates a meaning for the stratifier component. This can be as simple as a unique identifier, or it can establish meaning in a broader context by drawing from a terminology, allowing stratifiers to be correlated across measures. The human readable description of this stratifier criteria component. An expression that specifies the criteria for this component of the stratifier. This is typically the name of an expression defined within a referenced library, but it may also be a path to a stratifier element. The Measure resource provides the definition of a quality measure. Indicates a meaning for the supplemental data. This can be as simple as a unique identifier, or it can establish meaning in a broader context by drawing from a terminology, allowing supplemental data to be correlated across measures. An indicator of the intended usage for the supplemental data element. Supplemental data indicates the data is additional information requested to augment the measure information. Risk adjustment factor indicates the data is additional information used to calculate risk adjustment factors when applying a risk model to the measure calculation. The human readable description of this supplemental data. The criteria for the supplemental data. This is typically the name of a valid expression defined within a referenced library, but it may also be a path to a specific data element. The criteria defines the data to be returned for this element. ================================================ FILE: tests/static/xsd/fhir/measurereport.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children MeasureReport dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label mrp-2: Stratifiers SHALL be either a single criteria or a set of criteria components mrp-1: Measure Reports used for data collection SHALL NOT communicate group and score information txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/measurereport.xsd ================================================ The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation. The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation. If the element is present, it must have either a @value, an @id, or extensions A formal identifier that is used to identify this MeasureReport when it is represented in other formats or referenced in a specification, model, design or an instance. The MeasureReport status. No data will be available until the MeasureReport status is complete. The type of measure report. This may be an individual report, which provides the score for the measure for an individual member of the population; a subject-listing, which returns the list of members that meet the various criteria in the measure; a summary report, which returns a population count for each of the criteria in the measure; or a data-collection, which enables the MeasureReport to be used to exchange the data-of-interest for a quality measure. A reference to the Measure that was calculated to produce this report. Optional subject identifying the individual or individuals the report is for. The date this measure report was generated. The individual, location, or organization that is reporting the data. The reporting period for which the report was calculated. Whether improvement in the measure is noted by an increase or decrease in the measure score. The results of the calculation, one for each population group in the measure. A reference to a Bundle containing the Resources that were used in the calculation of this measure. The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation. The meaning of the population group as defined in the measure definition. The populations that make up the population group, one for each type of population appropriate for the measure. The measure score for this population group, calculated as appropriate for the measure type and scoring method, and based on the contents of the populations defined in the group. When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure. The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation. The type of the population. The number of members of the population. This element refers to a List of subject level MeasureReport resources, one for each subject in this population. The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation. The meaning of this stratifier, as defined in the measure definition. This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value. The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation. The value for this stratum, expressed as a CodeableConcept. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique. A stratifier component value. The populations that make up the stratum, one for each type of population appropriate to the measure. The measure score for this stratum, calculated as appropriate for the measure type and scoring method, and based on only the members of this stratum. The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation. The code for the stratum component value. The stratum component value. The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation. The type of the population. The number of members of the population in this stratum. This element refers to a List of subject level MeasureReport resources, one for each subject in this population in this stratum. Complete Pending Error The status of the measure report. If the element is present, it must have either a @value, an @id, or extensions Individual Subject List Summary Data Collection The type of the measure report. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/media.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Media dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/media.xsd ================================================ A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference. A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference. If the element is present, it must have either a @value, an @id, or extensions Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers. A procedure that is fulfilled in whole or in part by the creation of this media. A larger event of which this particular event is a component or step. The current state of the {{title}}. A code that classifies whether the media is an image, video or audio recording or some other media category. Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality. The name of the imaging view e.g. Lateral or Antero-posterior (AP). Who/What this Media is a record of. The encounter that establishes the context for this media. The date and time(s) at which the media was collected. The date and time this version of the media was made available to providers, typically after having been reviewed. The person who administered the collection of the image. Describes why the event occurred in coded or textual form. Indicates the site on the subject's body where the observation was made (i.e. the target site). The name of the device / manufacturer of the device that was used to make the recording. The device used to collect the media. Height of the image in pixels (photo/video). Width of the image in pixels (photo/video). The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required. The duration of the recording in seconds - for audio and video. The actual content of the media - inline or by direct reference to the media source file. Comments made about the media by the performer, subject or other participants. ================================================ FILE: tests/static/xsd/fhir/medication.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Medication dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ================================================ FILE: tests/static/xsd/fhir/medication.xsd ================================================ This resource is primarily used for the identification and definition of a medication for the purposes of prescribing, dispensing, and administering a medication as well as for making statements about medication use. This resource is primarily used for the identification and definition of a medication for the purposes of prescribing, dispensing, and administering a medication as well as for making statements about medication use. If the element is present, it must have either a @value, an @id, or extensions Business identifier for this medication. A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems. A code to indicate if the medication is in active use. Describes the details of the manufacturer of the medication product. This is not intended to represent the distributor of a medication product. Describes the form of the item. Powder; tablets; capsule. Specific amount of the drug in the packaged product. For example, when specifying a product that has the same strength (For example, Insulin glargine 100 unit per mL solution for injection), this attribute provides additional clarification of the package amount (For example, 3 mL, 10mL, etc.). Identifies a particular constituent of interest in the product. Information that only applies to packages (not products). This resource is primarily used for the identification and definition of a medication for the purposes of prescribing, dispensing, and administering a medication as well as for making statements about medication use. The actual ingredient - either a substance (simple ingredient) or another medication of a medication. Indication of whether this ingredient affects the therapeutic action of the drug. Specifies how many (or how much) of the items there are in this Medication. For example, 250 mg per tablet. This is expressed as a ratio where the numerator is 250mg and the denominator is 1 tablet. This resource is primarily used for the identification and definition of a medication for the purposes of prescribing, dispensing, and administering a medication as well as for making statements about medication use. The assigned lot number of a batch of the specified product. When this specific batch of product will expire. Active Inactive Entered in Error A coded concept defining if the medication is in active use. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/medicationadministration.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children MedicationAdministration dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided mad-1: SHALL have at least one of dosage.dose or dosage.rate[x] qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/medicationadministration.xsd ================================================ Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner. Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner. If the element is present, it must have either a @value, an @id, or extensions Identifiers associated with this Medication Administration that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server. A protocol, guideline, orderset, or other definition that was adhered to in whole or in part by this event. A larger event of which this particular event is a component or step. Will generally be set to show that the administration has been completed. For some long running administrations such as infusions, it is possible for an administration to be started but not completed or it may be paused while some other process is under way. A code indicating why the administration was not performed. Indicates where the medication is expected to be consumed or administered. Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. The person or animal or group receiving the medication. The visit, admission, or other contact between patient and health care provider during which the medication administration was performed. Additional information (for example, patient height and weight) that supports the administration of the medication. A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate. Indicates who or what performed the medication administration and how they were involved. A code indicating why the medication was given. Condition or observation that supports why the medication was administered. The original request, instruction or authority to perform the administration. The device used in administering the medication to the patient. For example, a particular infusion pump. Extra information about the medication administration that is not conveyed by the other attributes. Describes the medication dosage information details e.g. dose, rate, site, route, etc. A summary of the events of interest that have occurred, such as when the administration was verified. Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner. Distinguishes the type of involvement of the performer in the medication administration. Indicates who or what performed the medication administration. Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner. Free text dosage can be used for cases where the dosage administered is too complex to code. When coded dosage is present, the free text dosage may still be present for display to humans. The dosage instructions should reflect the dosage of the medication that was administered. A coded specification of the anatomic site where the medication first entered the body. For example, "left arm". A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. For example, topical, intravenous, etc. A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. This attribute will most often NOT be populated. It is most commonly used for injections. For example, Slow Push, Deep IV. The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection. Identifies the speed with which the medication was or will be introduced into the patient. Typically, the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time, e.g. 500 ml per 2 hours. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours. ================================================ FILE: tests/static/xsd/fhir/medicationdispense.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children MedicationDispense dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label mdd-1: whenHandedOver cannot be before whenPrepared txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/medicationdispense.xsd ================================================ Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order. Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order. If the element is present, it must have either a @value, an @id, or extensions Identifiers associated with this Medication Dispense that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server. The procedure that trigger the dispense. A code specifying the state of the set of dispense events. Indicates the reason why a dispense was not performed. Indicates the type of medication dispense (for example, where the medication is expected to be consumed or administered (i.e. inpatient or outpatient)). Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. A link to a resource representing the person or the group to whom the medication will be given. The encounter or episode of care that establishes the context for this event. Additional information that supports the medication being dispensed. Indicates who or what performed the event. The principal physical location where the dispense was performed. Indicates the medication order that is being dispensed against. Indicates the type of dispensing event that is performed. For example, Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. The amount of medication that has been dispensed. Includes unit of measure. The amount of medication expressed as a timing amount. The time when the dispensed product was packaged and reviewed. The time the dispensed product was provided to the patient or their representative. Identification of the facility/location where the medication was shipped to, as part of the dispense event. Identifies the person who picked up the medication. This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional. Extra information about the dispense that could not be conveyed in the other attributes. Indicates how the medication is to be used by the patient. Indicates whether or not substitution was made as part of the dispense. In some cases, substitution will be expected but does not happen, in other cases substitution is not expected but does happen. This block explains what substitution did or did not happen and why. If nothing is specified, substitution was not done. Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. drug-drug interaction, duplicate therapy, dosage alert etc. A summary of the events of interest that have occurred, such as when the dispense was verified. Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order. Distinguishes the type of performer in the dispense. For example, date enterer, packager, final checker. The device, practitioner, etc. who performed the action. It should be assumed that the actor is the dispenser of the medication. Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order. True if the dispenser dispensed a different drug or product from what was prescribed. A code signifying whether a different drug was dispensed from what was prescribed. Indicates the reason for the substitution (or lack of substitution) from what was prescribed. The person or organization that has primary responsibility for the substitution. ================================================ FILE: tests/static/xsd/fhir/medicationknowledge.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children MedicationKnowledge dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. ================================================ FILE: tests/static/xsd/fhir/medicationknowledge.xsd ================================================ Information about a medication that is used to support knowledge. Information about a medication that is used to support knowledge. If the element is present, it must have either a @value, an @id, or extensions A code that specifies this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems. A code to indicate if the medication is in active use. The status refers to the validity about the information of the medication and not to its medicinal properties. Describes the details of the manufacturer of the medication product. This is not intended to represent the distributor of a medication product. Describes the form of the item. Powder; tablets; capsule. Specific amount of the drug in the packaged product. For example, when specifying a product that has the same strength (For example, Insulin glargine 100 unit per mL solution for injection), this attribute provides additional clarification of the package amount (For example, 3 mL, 10mL, etc.). Additional names for a medication, for example, the name(s) given to a medication in different countries. For example, acetaminophen and paracetamol or salbutamol and albuterol. Associated or related knowledge about a medication. Associated or related medications. For example, if the medication is a branded product (e.g. Crestor), this is the Therapeutic Moeity (e.g. Rosuvastatin) or if this is a generic medication (e.g. Rosuvastatin), this would link to a branded product (e.g. Crestor). Category of the medication or product (e.g. branded product, therapeutic moeity, generic product, innovator product, etc.). Associated documentation about the medication. Identifies a particular constituent of interest in the product. The instructions for preparing the medication. The intended or approved route of administration. The price of the medication. The program under which the medication is reviewed. Guidelines for the administration of the medication. Categorization of the medication within a formulary or classification system. Information that only applies to packages (not products). Specifies descriptive properties of the medicine, such as color, shape, imprints, etc. Potential clinical issue with or between medication(s) (for example, drug-drug interaction, drug-disease contraindication, drug-allergy interaction, etc.). Regulatory information about a medication. The time course of drug absorption, distribution, metabolism and excretion of a medication from the body. Information about a medication that is used to support knowledge. The category of the associated medication knowledge reference. Associated documentation about the associated medication knowledge. Information about a medication that is used to support knowledge. The category of documentation about the medication. (e.g. professional monograph, patient education monograph). Associated documentation about the medication. Information about a medication that is used to support knowledge. The actual ingredient - either a substance (simple ingredient) or another medication. Indication of whether this ingredient affects the therapeutic action of the drug. Specifies how many (or how much) of the items there are in this Medication. For example, 250 mg per tablet. This is expressed as a ratio where the numerator is 250mg and the denominator is 1 tablet. Information about a medication that is used to support knowledge. The category of the cost information. For example, manufacturers' cost, patient cost, claim reimbursement cost, actual acquisition cost. The source or owner that assigns the price to the medication. The price of the medication. Information about a medication that is used to support knowledge. Type of program under which the medication is monitored. Name of the reviewing program. Information about a medication that is used to support knowledge. Dosage for the medication for the specific guidelines. Indication for use that apply to the specific administration guidelines. Characteristics of the patient that are relevant to the administration guidelines (for example, height, weight, gender, etc.). Information about a medication that is used to support knowledge. The type of dosage (for example, prophylaxis, maintenance, therapeutic, etc.). Dosage for the medication for the specific guidelines. Information about a medication that is used to support knowledge. Specific characteristic that is relevant to the administration guideline (e.g. height, weight, gender). The specific characteristic (e.g. height, weight, gender, etc.). Information about a medication that is used to support knowledge. The type of category for the medication (for example, therapeutic classification, therapeutic sub-classification). Specific category assigned to the medication (e.g. anti-infective, anti-hypertensive, antibiotic, etc.). Information about a medication that is used to support knowledge. A code that defines the specific type of packaging that the medication can be found in (e.g. blister sleeve, tube, bottle). The number of product units the package would contain if fully loaded. Information about a medication that is used to support knowledge. A code specifying which characteristic of the medicine is being described (for example, colour, shape, imprint). Description of the characteristic. Information about a medication that is used to support knowledge. The authority that is specifying the regulations. Specifies if changes are allowed when dispensing a medication from a regulatory perspective. Specifies the schedule of a medication in jurisdiction. The maximum number of units of the medication that can be dispensed in a period. Information about a medication that is used to support knowledge. Specifies the type of substitution allowed. Specifies if regulation allows for changes in the medication when dispensing. Information about a medication that is used to support knowledge. Specifies the specific drug schedule. Information about a medication that is used to support knowledge. The maximum number of units of the medication that can be dispensed. The period that applies to the maximum number of units. Information about a medication that is used to support knowledge. The drug concentration measured at certain discrete points in time. The median lethal dose of a drug. The time required for any specified property (e.g., the concentration of a substance in the body) to decrease by half. ================================================ FILE: tests/static/xsd/fhir/medicationrequest.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children MedicationRequest dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/medicationrequest.xsd ================================================ An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationRequest" rather than "MedicationPrescription" or "MedicationOrder" to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns. An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationRequest" rather than "MedicationPrescription" or "MedicationOrder" to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns. If the element is present, it must have either a @value, an @id, or extensions Identifiers associated with this medication request that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server. A code specifying the current state of the order. Generally, this will be active or completed state. Captures the reason for the current state of the MedicationRequest. Whether the request is a proposal, plan, or an original order. Indicates the type of medication request (for example, where the medication is expected to be consumed or administered (i.e. inpatient or outpatient)). Indicates how quickly the Medication Request should be addressed with respect to other requests. If true indicates that the provider is asking for the medication request not to occur. Indicates if this record was captured as a secondary 'reported' record rather than as an original primary source-of-truth record. It may also indicate the source of the report. Identifies the medication being requested. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications. A link to a resource representing the person or set of individuals to whom the medication will be given. The Encounter during which this [x] was created or to which the creation of this record is tightly associated. Include additional information (for example, patient height and weight) that supports the ordering of the medication. The date (and perhaps time) when the prescription was initially written or authored on. The individual, organization, or device that initiated the request and has responsibility for its activation. The specified desired performer of the medication treatment (e.g. the performer of the medication administration). Indicates the type of performer of the administration of the medication. The person who entered the order on behalf of another individual for example in the case of a verbal or a telephone order. The reason or the indication for ordering or not ordering the medication. Condition or observation that supports why the medication was ordered. The URL pointing to a protocol, guideline, orderset, or other definition that is adhered to in whole or in part by this MedicationRequest. The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this MedicationRequest. A plan or request that is fulfilled in whole or in part by this medication request. A shared identifier common to all requests that were authorized more or less simultaneously by a single author, representing the identifier of the requisition or prescription. The description of the overall patte3rn of the administration of the medication to the patient. Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be required for delivering the requested service. Extra information about the prescription that could not be conveyed by the other attributes. Indicates how the medication is to be used by the patient. Indicates the specific details for the dispense or medication supply part of a medication request (also known as a Medication Prescription or Medication Order). Note that this information is not always sent with the order. There may be in some settings (e.g. hospitals) institutional or system support for completing the dispense details in the pharmacy department. Indicates whether or not substitution can or should be part of the dispense. In some cases, substitution must happen, in other cases substitution must not happen. This block explains the prescriber's intent. If nothing is specified substitution may be done. A link to a resource representing an earlier order related order or prescription. Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, duplicate therapy, dosage alert etc. Links to Provenance records for past versions of this resource or fulfilling request or event resources that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the resource. An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationRequest" rather than "MedicationPrescription" or "MedicationOrder" to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns. Indicates the quantity or duration for the first dispense of the medication. The minimum period of time that must occur between dispenses of the medication. This indicates the validity period of a prescription (stale dating the Prescription). An integer indicating the number of times, in addition to the original dispense, (aka refills or repeats) that the patient can receive the prescribed medication. Usage Notes: This integer does not include the original order dispense. This means that if an order indicates dispense 30 tablets plus "3 repeats", then the order can be dispensed a total of 4 times and the patient can receive a total of 120 tablets. A prescriber may explicitly say that zero refills are permitted after the initial dispense. The amount that is to be dispensed for one fill. Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. Indicates the intended dispensing Organization specified by the prescriber. An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationRequest" rather than "MedicationPrescription" or "MedicationOrder" to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns. The amount or quantity to provide as part of the first dispense. The length of time that the first dispense is expected to last. An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationRequest" rather than "MedicationPrescription" or "MedicationOrder" to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns. True if the prescriber allows a different drug to be dispensed from what was prescribed. Indicates the reason for the substitution, or why substitution must or must not be performed. Active On Hold Cancelled Completed Entered in Error Stopped Draft Unknown A coded concept specifying the state of the prescribing event. Describes the lifecycle of the prescription. If the element is present, it must have either a @value, an @id, or extensions Proposal Plan Order Original Order Reflex Order Filler Order Instance Order Option The kind of medication order. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/medicationstatement.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children MedicationStatement dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ================================================ FILE: tests/static/xsd/fhir/medicationstatement.xsd ================================================ A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from sources such as the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains. The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information. A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from sources such as the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains. The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information. If the element is present, it must have either a @value, an @id, or extensions Identifiers associated with this Medication Statement that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server. A plan, proposal or order that is fulfilled in whole or in part by this event. A larger event of which this particular event is a component or step. A code representing the patient or other source's judgment about the state of the medication used that this statement is about. Generally, this will be active or completed. Captures the reason for the current state of the MedicationStatement. Indicates where the medication is expected to be consumed or administered. Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. The person, animal or group who is/was taking the medication. The encounter or episode of care that establishes the context for this MedicationStatement. The interval of time during which it is being asserted that the patient is/was/will be taking the medication (or was not taking, when the MedicationStatement.taken element is No). The date when the medication statement was asserted by the information source. The person or organization that provided the information about the taking of this medication. Note: Use derivedFrom when a MedicationStatement is derived from other resources, e.g. Claim or MedicationRequest. Allows linking the MedicationStatement to the underlying MedicationRequest, or to other information that supports or is used to derive the MedicationStatement. A reason for why the medication is being/was taken. Condition or observation that supports why the medication is being/was taken. Provides extra information about the medication statement that is not conveyed by the other attributes. Indicates how the medication is/was or should be taken by the patient. ================================================ FILE: tests/static/xsd/fhir/medicinalproduct.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children MedicinalProduct dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/medicinalproduct.xsd ================================================ Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use). Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use). If the element is present, it must have either a @value, an @id, or extensions Business identifier for this product. Could be an MPID. Regulatory type, e.g. Investigational or Authorized. If this medicine applies to human or veterinary uses. The dose form for a single part product, or combined form of a multiple part product. The legal status of supply of the medicinal product as classified by the regulator. Whether the Medicinal Product is subject to additional monitoring for regulatory reasons. Whether the Medicinal Product is subject to special measures for regulatory reasons. If authorised for use in children. Allows the product to be classified by various systems. Marketing status of the medicinal product, in contrast to marketing authorizaton. Pharmaceutical aspects of product. Package representation for the product. Supporting documentation, typically for regulatory submission. A master file for to the medicinal product (e.g. Pharmacovigilance System Master File). A product specific contact, person (in a role), or an organization. Clinical trials or studies that this product is involved in. The product's name, including full name and possibly coded parts. Reference to another product, e.g. for linking authorised to investigational product. An operation applied to the product, for manufacturing or adminsitrative purpose. Indicates if the medicinal product has an orphan designation for the treatment of a rare disease. Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use). The full product name. Coding words or phrases of the name. Country where the name applies. Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use). A fragment of a product name. Idenifying type for this part of the name (e.g. strength part). Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use). Country code for where this name applies. Jurisdiction code for where this name applies. Language code for this name. Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use). The type of manufacturing operation. Regulatory authorization reference number. Regulatory authorization date. To indicate if this proces is commercially confidential. The manufacturer or establishment associated with the process. A regulator which oversees the operation. Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use). Identifier for the designation, or procedure number. The type of special designation, e.g. orphan drug, minor use. The intended use of the product, e.g. prevention, treatment. Condition for which the medicinal use applies. For example granted, pending, expired or withdrawn. Date when the designation was granted. Animal species for which this applies. ================================================ FILE: tests/static/xsd/fhir/medicinalproductauthorization.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children MedicinalProductAuthorization dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/medicinalproductauthorization.xsd ================================================ The regulatory authorization of a medicinal product. The regulatory authorization of a medicinal product. If the element is present, it must have either a @value, an @id, or extensions Business identifier for the marketing authorization, as assigned by a regulator. The medicinal product that is being authorized. The country in which the marketing authorization has been granted. Jurisdiction within a country. The status of the marketing authorization. The date at which the given status has become applicable. The date when a suspended the marketing or the marketing authorization of the product is anticipated to be restored. The beginning of the time period in which the marketing authorization is in the specific status shall be specified A complete date consisting of day, month and year shall be specified using the ISO 8601 date format. A period of time after authorization before generic product applicatiosn can be submitted. The date when the first authorization was granted by a Medicines Regulatory Agency. Date of first marketing authorization for a company's new medicinal product in any country in the World. The legal framework against which this authorization is granted. Authorization in areas within a country. Marketing Authorization Holder. Medicines Regulatory Agency. The regulatory procedure for granting or amending a marketing authorization. The regulatory authorization of a medicinal product. The assigned number for the marketing authorization. Country of authorization. Jurisdiction within a country. The legal status of supply in a jurisdiction or region. The start and expected end date of the authorization. The regulatory authorization of a medicinal product. Identifier for this procedure. Type of procedure. Date of procedure. Applcations submitted to obtain a marketing authorization. ================================================ FILE: tests/static/xsd/fhir/medicinalproductcontraindication.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children MedicinalProductContraindication dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ================================================ FILE: tests/static/xsd/fhir/medicinalproductcontraindication.xsd ================================================ The clinical particulars - indications, contraindications etc. of a medicinal product, including for regulatory purposes. The clinical particulars - indications, contraindications etc. of a medicinal product, including for regulatory purposes. If the element is present, it must have either a @value, an @id, or extensions The medication for which this is an indication. The disease, symptom or procedure for the contraindication. The status of the disease or symptom for the contraindication. A comorbidity (concurrent condition) or coinfection. Information about the use of the medicinal product in relation to other therapies as part of the indication. Information about the use of the medicinal product in relation to other therapies described as part of the indication. The population group to which this applies. The clinical particulars - indications, contraindications etc. of a medicinal product, including for regulatory purposes. The type of relationship between the medicinal product indication or contraindication and another therapy. Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication. ================================================ FILE: tests/static/xsd/fhir/medicinalproductindication.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children MedicinalProductIndication dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ================================================ FILE: tests/static/xsd/fhir/medicinalproductindication.xsd ================================================ Indication for the Medicinal Product. Indication for the Medicinal Product. If the element is present, it must have either a @value, an @id, or extensions The medication for which this is an indication. The disease, symptom or procedure that is the indication for treatment. The status of the disease or symptom for which the indication applies. Comorbidity (concurrent condition) or co-infection as part of the indication. The intended effect, aim or strategy to be achieved by the indication. Timing or duration information as part of the indication. Information about the use of the medicinal product in relation to other therapies described as part of the indication. Describe the undesirable effects of the medicinal product. The population group to which this applies. Indication for the Medicinal Product. The type of relationship between the medicinal product indication or contraindication and another therapy. Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication. ================================================ FILE: tests/static/xsd/fhir/medicinalproductingredient.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children MedicinalProductIngredient dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ================================================ FILE: tests/static/xsd/fhir/medicinalproductingredient.xsd ================================================ An ingredient of a manufactured item or pharmaceutical product. An ingredient of a manufactured item or pharmaceutical product. If the element is present, it must have either a @value, an @id, or extensions The identifier(s) of this Ingredient that are assigned by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. Ingredient role e.g. Active ingredient, excipient. If the ingredient is a known or suspected allergen. Manufacturer of this Ingredient. A specified substance that comprises this ingredient. The ingredient substance. An ingredient of a manufactured item or pharmaceutical product. The specified substance. The group of specified substance, e.g. group 1 to 4. Confidentiality level of the specified substance as the ingredient. Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product. An ingredient of a manufactured item or pharmaceutical product. The quantity of substance in the unit of presentation, or in the volume (or mass) of the single pharmaceutical product or manufactured item. A lower limit for the quantity of substance in the unit of presentation. For use when there is a range of strengths, this is the lower limit, with the presentation attribute becoming the upper limit. The strength per unitary volume (or mass). A lower limit for the strength per unitary volume (or mass), for when there is a range. The concentration attribute then becomes the upper limit. For when strength is measured at a particular point or distance. The country or countries for which the strength range applies. Strength expressed in terms of a reference substance. An ingredient of a manufactured item or pharmaceutical product. Relevant reference substance. Strength expressed in terms of a reference substance. Strength expressed in terms of a reference substance. For when strength is measured at a particular point or distance. The country or countries for which the strength range applies. An ingredient of a manufactured item or pharmaceutical product. The ingredient substance. Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product. ================================================ FILE: tests/static/xsd/fhir/medicinalproductinteraction.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children MedicinalProductInteraction dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/medicinalproductinteraction.xsd ================================================ The interactions of the medicinal product with other medicinal products, or other forms of interactions. The interactions of the medicinal product with other medicinal products, or other forms of interactions. If the element is present, it must have either a @value, an @id, or extensions The medication for which this is a described interaction. The interaction described. The specific medication, food or laboratory test that interacts. The type of the interaction e.g. drug-drug interaction, drug-food interaction, drug-lab test interaction. The effect of the interaction, for example "reduced gastric absorption of primary medication". The incidence of the interaction, e.g. theoretical, observed. Actions for managing the interaction. The interactions of the medicinal product with other medicinal products, or other forms of interactions. The specific medication, food or laboratory test that interacts. ================================================ FILE: tests/static/xsd/fhir/medicinalproductmanufactured.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children MedicinalProductManufactured dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present att-1: If the Attachment has data, it SHALL have a contentType ================================================ FILE: tests/static/xsd/fhir/medicinalproductmanufactured.xsd ================================================ The manufactured item as contained in the packaged medicinal product. The manufactured item as contained in the packaged medicinal product. If the element is present, it must have either a @value, an @id, or extensions Dose form as manufactured and before any transformation into the pharmaceutical product. The “real world” units in which the quantity of the manufactured item is described. The quantity or "count number" of the manufactured item. Manufacturer of the item (Note that this should be named "manufacturer" but it currently causes technical issues). Ingredient. Dimensions, color etc. Other codeable characteristics. ================================================ FILE: tests/static/xsd/fhir/medicinalproductpackaged.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children MedicinalProductPackaged dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/medicinalproductpackaged.xsd ================================================ A medicinal product in a container or package. A medicinal product in a container or package. If the element is present, it must have either a @value, an @id, or extensions Unique identifier. The product with this is a pack for. Textual description. The legal status of supply of the medicinal product as classified by the regulator. Marketing information. Manufacturer of this Package Item. Manufacturer of this Package Item. Batch numbering. A packaging item, as a contained for medicine, possibly with other packaging items within. A medicinal product in a container or package. A number appearing on the outer packaging of a specific batch. A number appearing on the immediate packaging (and not the outer packaging). A medicinal product in a container or package. Including possibly Data Carrier Identifier. The physical type of the container of the medicine. The quantity of this package in the medicinal product, at the current level of packaging. The outermost is always 1. Material type of the package item. A possible alternate material for the packaging. A device accompanying a medicinal product. The manufactured item as contained in the packaged medicinal product. Allows containers within containers. Dimensions, color etc. Other codeable characteristics. Shelf Life and storage information. Manufacturer of this Package Item. ================================================ FILE: tests/static/xsd/fhir/medicinalproductpharmaceutical.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children MedicinalProductPharmaceutical dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. qty-3: If a code for the unit is present, the system SHALL also be present ================================================ FILE: tests/static/xsd/fhir/medicinalproductpharmaceutical.xsd ================================================ A pharmaceutical product described in terms of its composition and dose form. A pharmaceutical product described in terms of its composition and dose form. If the element is present, it must have either a @value, an @id, or extensions An identifier for the pharmaceutical medicinal product. The administrable dose form, after necessary reconstitution. Todo. Ingredient. Accompanying device. Characteristics e.g. a products onset of action. The path by which the pharmaceutical product is taken into or makes contact with the body. A pharmaceutical product described in terms of its composition and dose form. A coded characteristic. The status of characteristic e.g. assigned or pending. A pharmaceutical product described in terms of its composition and dose form. Coded expression for the route. The first dose (dose quantity) administered in humans can be specified, for a product under investigation, using a numerical value and its unit of measurement. The maximum single dose that can be administered as per the protocol of a clinical trial can be specified using a numerical value and its unit of measurement. The maximum dose per day (maximum dose quantity to be administered in any one 24-h period) that can be administered as per the protocol referenced in the clinical trial authorisation. The maximum dose per treatment period that can be administered as per the protocol referenced in the clinical trial authorisation. The maximum treatment period during which an Investigational Medicinal Product can be administered as per the protocol referenced in the clinical trial authorisation. A species for which this route applies. A pharmaceutical product described in terms of its composition and dose form. Coded expression for the species. A species specific time during which consumption of animal product is not appropriate. A pharmaceutical product described in terms of its composition and dose form. Coded expression for the type of tissue for which the withdrawal period applues, e.g. meat, milk. A value for the time. Extra information about the withdrawal period. ================================================ FILE: tests/static/xsd/fhir/medicinalproductundesirableeffect.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children MedicinalProductUndesirableEffect dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ================================================ FILE: tests/static/xsd/fhir/medicinalproductundesirableeffect.xsd ================================================ Describe the undesirable effects of the medicinal product. Describe the undesirable effects of the medicinal product. If the element is present, it must have either a @value, an @id, or extensions The medication for which this is an indication. The symptom, condition or undesirable effect. Classification of the effect. The frequency of occurrence of the effect. The population group to which this applies. ================================================ FILE: tests/static/xsd/fhir/messagedefinition.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children MessageDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided md-1: Max must be postive int or * ================================================ FILE: tests/static/xsd/fhir/messagedefinition.xsd ================================================ Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted. Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted. If the element is present, it must have either a @value, an @id, or extensions The business identifier that is used to reference the MessageDefinition and *is* expected to be consistent from server to server. A formal identifier that is used to identify this message definition when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the message definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the message definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the message definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the message definition. A MessageDefinition that is superseded by this definition. The status of this message definition. Enables tracking the life-cycle of the content. A Boolean value to indicate that this message definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the message definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the message definition changes. The name of the organization or individual that published the message definition. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the message definition from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate message definition instances. A legal or geographic region in which the message definition is intended to be used. Explanation of why this message definition is needed and why it has been designed as it has. A copyright statement relating to the message definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the message definition. The MessageDefinition that is the basis for the contents of this resource. Identifies a protocol or workflow that this MessageDefinition represents a step in. Event code or link to the EventDefinition. The impact of the content of the message. Identifies the resource (or resources) that are being addressed by the event. For example, the Encounter for an admit message or two Account records for a merge. Declare at a message definition level whether a response is required or only upon error or success, or never. Indicates what types of messages may be sent as an application-level response to this message. Canonical reference to a GraphDefinition. If a URL is provided, it is the canonical reference to a [[[GraphDefinition]]] that it controls what resources are to be added to the bundle when building the document. The GraphDefinition can also specify profiles that apply to the various resources. Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted. The kind of resource that must be the focus for this message. A profile that reflects constraints for the focal resource (and potentially for related resources). Identifies the minimum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition. Identifies the maximum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition. Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted. A reference to the message definition that must be adhered to by this supported response. Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses). Consequence Currency Notification The impact of the content of a message. If the element is present, it must have either a @value, an @id, or extensions Always Error/reject conditions only Never Successful completion only HL7-defined table of codes which identify conditions under which acknowledgments are required to be returned in response to a message. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/messageheader.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children MessageHeader dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/messageheader.xsd ================================================ The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. If the element is present, it must have either a @value, an @id, or extensions Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value "http://terminology.hl7.org/CodeSystem/message-events". Alternatively uri to the EventDefinition. The destination application which the message is intended for. Identifies the sending system to allow the use of a trust relationship. The person or device that performed the data entry leading to this message. When there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions. The logical author of the message - the person or device that decided the described event should happen. When there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions. The source application from which this message originated. The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party. Coded indication of the cause for the event - indicates a reason for the occurrence of the event that is a focus of this message. Information about the message that this message is a response to. Only present if this message is a response. The actual data of the message - a reference to the root/focus class of the event. Permanent link to the MessageDefinition for this message. The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. Human-readable name for the target system. Identifies the target end system in situations where the initial message transmission is to an intermediary system. Indicates where the message should be routed to. Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient. The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. Human-readable name for the source system. May include configuration or other information useful in debugging. Can convey versions of multiple systems in situations where a message passes through multiple hands. An e-mail, phone, website or other contact point to use to resolve issues with message communications. Identifies the routing target to send acknowledgements to. The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. The MessageHeader.id of the message to which this message is a response. Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not. Full details of any issues found in the message. OK Transient Error Fatal Error The kind of response to a message. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/molecularsequence.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children MolecularSequence dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label msq-3: Only 0 and 1 are valid for coordinateSystem txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present msq-6: Have and only have one of the following elements in referenceSeq : 1. genomeBuild ; 2 referenceSeqId; 3. referenceSeqPointer; 4. referenceSeqString; msq-5: GenomeBuild and chromosome must be both contained if either one of them is contained ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/molecularsequence.xsd ================================================ Raw data describing a biological sequence. Raw data describing a biological sequence. If the element is present, it must have either a @value, an @id, or extensions A unique identifier for this particular sequence instance. This is a FHIR-defined id. Amino Acid Sequence/ DNA Sequence / RNA Sequence. Whether the sequence is numbered starting at 0 (0-based numbering or coordinates, inclusive start, exclusive end) or starting at 1 (1-based numbering, inclusive start and inclusive end). The patient whose sequencing results are described by this resource. Specimen used for sequencing. The method for sequencing, for example, chip information. The organization or lab that should be responsible for this result. The number of copies of the sequence of interest. (RNASeq). A sequence that is used as a reference to describe variants that are present in a sequence analyzed. The definition of variant here originates from Sequence ontology ([variant_of](http://www.sequenceontology.org/browser/current_svn/term/variant_of)). This element can represent amino acid or nucleic sequence change(including insertion,deletion,SNP,etc.) It can represent some complex mutation or segment variation with the assist of CIGAR string. Sequence that was observed. It is the result marked by referenceSeq along with variant records on referenceSeq. This shall start from referenceSeq.windowStart and end by referenceSeq.windowEnd. An experimental feature attribute that defines the quality of the feature in a quantitative way, such as a phred quality score ([SO:0001686](http://www.sequenceontology.org/browser/current_svn/term/SO:0001686)). Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence. Configurations of the external repository. The repository shall store target's observedSeq or records related with target's observedSeq. Pointer to next atomic sequence which at most contains one variant. Information about chromosome structure variation. Raw data describing a biological sequence. Structural unit composed of a nucleic acid molecule which controls its own replication through the interaction of specific proteins at one or more origins of replication ([SO:0000340](http://www.sequenceontology.org/browser/current_svn/term/SO:0000340)). The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'. Version number must be included if a versioned release of a primary build was used. A relative reference to a DNA strand based on gene orientation. The strand that contains the open reading frame of the gene is the "sense" strand, and the opposite complementary strand is the "antisense" strand. Reference identifier of reference sequence submitted to NCBI. It must match the type in the MolecularSequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences. A pointer to another MolecularSequence entity as reference sequence. A string like "ACGT". An absolute reference to a strand. The Watson strand is the strand whose 5'-end is on the short arm of the chromosome, and the Crick strand as the one whose 5'-end is on the long arm. Start position of the window on the reference sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive. End position of the window on the reference sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. Raw data describing a biological sequence. Start position of the variant on the reference sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive. End position of the variant on the reference sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end. An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end. Extended CIGAR string for aligning the sequence with reference bases. See detailed documentation [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm). A pointer to an Observation containing variant information. Raw data describing a biological sequence. INDEL / SNP / Undefined variant. Gold standard sequence used for comparing against. Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive. End position of the sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. The score of an experimentally derived feature such as a p-value ([SO:0001685](http://www.sequenceontology.org/browser/current_svn/term/SO:0001685)). Which method is used to get sequence quality. True positives, from the perspective of the truth data, i.e. the number of sites in the Truth Call Set for which there are paths through the Query Call Set that are consistent with all of the alleles at this site, and for which there is an accurate genotype call for the event. True positives, from the perspective of the query data, i.e. the number of sites in the Query Call Set for which there are paths through the Truth Call Set that are consistent with all of the alleles at this site, and for which there is an accurate genotype call for the event. False negatives, i.e. the number of sites in the Truth Call Set for which there is no path through the Query Call Set that is consistent with all of the alleles at this site, or sites for which there is an inaccurate genotype call for the event. Sites with correct variant but incorrect genotype are counted here. False positives, i.e. the number of sites in the Query Call Set for which there is no path through the Truth Call Set that is consistent with this site. Sites with correct variant but incorrect genotype are counted here. The number of false positives where the non-REF alleles in the Truth and Query Call Sets match (i.e. cases where the truth is 1/1 and the query is 0/1 or similar). QUERY.TP / (QUERY.TP + QUERY.FP). TRUTH.TP / (TRUTH.TP + TRUTH.FN). Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall). Receiver Operator Characteristic (ROC) Curve to give sensitivity/specificity tradeoff. Raw data describing a biological sequence. Invidual data point representing the GQ (genotype quality) score threshold. The number of true positives if the GQ score threshold was set to "score" field value. The number of false positives if the GQ score threshold was set to "score" field value. The number of false negatives if the GQ score threshold was set to "score" field value. Calculated precision if the GQ score threshold was set to "score" field value. Calculated sensitivity if the GQ score threshold was set to "score" field value. Calculated fScore if the GQ score threshold was set to "score" field value. Raw data describing a biological sequence. Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource. URI of an external repository which contains further details about the genetics data. URI of an external repository which contains further details about the genetics data. Id of the variant in this external repository. The server will understand how to use this id to call for more info about datasets in external repository. Id of the variantset in this external repository. The server will understand how to use this id to call for more info about variantsets in external repository. Id of the read in this external repository. Raw data describing a biological sequence. Information about chromosome structure variation DNA change type. Used to indicate if the outer and inner start-end values have the same meaning. Length of the variant chromosome. Structural variant outer. Structural variant inner. Raw data describing a biological sequence. Structural variant outer start. If the coordinate system is either 0-based or 1-based, then start position is inclusive. Structural variant outer end. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. Raw data describing a biological sequence. Structural variant inner start. If the coordinate system is either 0-based or 1-based, then start position is inclusive. Structural variant inner end. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position. Watson strand of referenceSeq Crick strand of referenceSeq Type for strand. If the element is present, it must have either a @value, an @id, or extensions Sense orientation of referenceSeq Antisense orientation of referenceSeq Type for orientation. If the element is present, it must have either a @value, an @id, or extensions Click and see The URL is the RESTful or other kind of API that can access to the result. Result cannot be access unless an account is logged in Result need to be fetched with API and need LOGIN( or cookies are required when visiting the link of resource) Some other complicated or particular way to get resource from URL. Type for access of external URI. If the element is present, it must have either a @value, an @id, or extensions INDEL Comparison SNP Comparison UNKNOWN Comparison Type for quality report. If the element is present, it must have either a @value, an @id, or extensions AA Sequence DNA Sequence RNA Sequence Type if a sequence -- DNA, RNA, or amino acid sequence. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/namingsystem.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children NamingSystem dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label nsd-1: Root systems cannot have uuid identifiers nsd-2: Can't have more than one preferred identifier for a type txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ================================================ FILE: tests/static/xsd/fhir/namingsystem.xsd ================================================ A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. If the element is present, it must have either a @value, an @id, or extensions A natural language name identifying the naming system. This name should be usable as an identifier for the module by machine processing applications such as code generation. The status of this naming system. Enables tracking the life-cycle of the content. Indicates the purpose for the naming system - what kinds of things does it make unique? The date (and optionally time) when the naming system was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the naming system changes. The name of the organization or individual that published the naming system. Contact details to assist a user in finding and communicating with the publisher. The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision. Categorizes a naming system for easier search by grouping related naming systems. A free text natural language description of the naming system from a consumer's perspective. Details about what the namespace identifies including scope, granularity, version labeling, etc. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate naming system instances. A legal or geographic region in which the naming system is intended to be used. Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc. Indicates how the system may be identified when referenced in electronic exchange. A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. Identifies the unique identifier scheme used for this particular identifier. The string that should be sent over the wire to identify the code system or identifier system. Indicates whether this identifier is the "preferred" identifier of this type. Notes about the past or intended usage of this identifier. Identifies the period of time over which this identifier is considered appropriate to refer to the naming system. Outside of this window, the identifier might be non-deterministic. OID UUID URI Other Identifies the style of unique identifier used to identify a namespace. If the element is present, it must have either a @value, an @id, or extensions Code System Identifier Root Identifies the purpose of the naming system. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/nutritionorder.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children NutritionOrder dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/nutritionorder.xsd ================================================ A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. If the element is present, it must have either a @value, an @id, or extensions Identifiers assigned to this order by the order sender or by the order receiver. The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this NutritionOrder. The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this NutritionOrder. The URL pointing to a protocol, guideline, orderset or other definition that is adhered to in whole or in part by this NutritionOrder. The workflow status of the nutrition order/request. Indicates the level of authority/intentionality associated with the NutrionOrder and where the request fits into the workflow chain. The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding. An encounter that provides additional information about the healthcare context in which this request is made. The date and time that this nutrition order was requested. The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings. A link to a record of allergies or intolerances which should be included in the nutrition order. This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings. This modifier is used to convey Order-specific modifier about the type of oral food or oral fluids that should not be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. While it should not be necessary to repeat allergy or intolerance information captured in the referenced AllergyIntolerance resource in the excludeFoodModifier, this element may be used to convey additional specificity related to foods that should be eliminated from the patient’s diet for any reason. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings. Diet given orally in contrast to enteral (tube) feeding. Oral nutritional products given in order to add further nutritional value to the patient's diet. Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity. Comments made about the {{title}} by the requester, performer, subject or other participants. A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet. The time period and frequency at which the diet should be given. The diet should be given for the combination of all schedules if more than one schedule is present. Class that defines the quantity and type of nutrient modifications (for example carbohydrate, fiber or sodium) required for the oral diet. Class that describes any texture modifications required for the patient to safely consume various types of solid foods. The required consistency (e.g. honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient. Free text or additional instructions or information pertaining to the oral diet. A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. The nutrient that is being modified such as carbohydrate or sodium. The quantity of the specified nutrient to include in diet. A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed. The food type(s) (e.g. meats, all foods) that the texture modification applies to. This could be all foods types. A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement. The product or brand name of the nutritional supplement such as "Acme Protein Shake". The time period and frequency at which the supplement(s) should be given. The supplement should be given for the combination of all schedules if more than one schedule is present. The amount of the nutritional supplement to be given. Free text or additional instructions or information pertaining to the oral supplement. A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula. The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula". Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula. The product or brand name of the type of modular component to be added to the formula. The amount of energy (calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula that provides 24 calories per fluid ounce or an adult may require an enteral formula that provides 1.5 calorie/mL. The route or physiological path of administration into the patient's gastrointestinal tract for purposes of providing the formula feeding, e.g. nasogastric tube. Formula administration instructions as structured data. This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding. An example of this would be an instruction to increase the rate of continuous feeding every 2 hours. The maximum total quantity of formula that may be administered to a subject over the period of time, e.g. 1440 mL over 24 hours. Free text formula administration, feeding instructions or additional instructions or information. A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. The time period and frequency at which the enteral formula should be delivered to the patient. The volume of formula to provide to the patient per the specified administration schedule. The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule. ================================================ FILE: tests/static/xsd/fhir/observation.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Observation dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label obs-7: If Observation.code is the same as an Observation.component.code then the value element associated with the code SHALL NOT be present obs-6: dataAbsentReason SHALL only be present if Observation.value[x] is not present txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided obs-3: Must have at least a low or a high or text qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ================================================ FILE: tests/static/xsd/fhir/observation.xsd ================================================ Measurements and simple assertions made about a patient, device or other subject. Measurements and simple assertions made about a patient, device or other subject. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this observation. A plan, proposal or order that is fulfilled in whole or in part by this event. For example, a MedicationRequest may require a patient to have laboratory test performed before it is dispensed. A larger event of which this particular Observation is a component or step. For example, an observation as part of a procedure. The status of the result value. A code that classifies the general type of observation being made. Describes what was observed. Sometimes this is called the observation "name". The patient, or group of patients, location, or device this observation is about and into whose record the observation is placed. If the actual focus of the observation is different from the subject (or a sample of, part, or region of the subject), the `focus` element or the `code` itself specifies the actual focus of the observation. The actual focus of an observation when it is not the patient of record representing something or someone associated with the patient such as a spouse, parent, fetus, or donor. For example, fetus observations in a mother's record. The focus of an observation could also be an existing condition, an intervention, the subject's diet, another observation of the subject, or a body structure such as tumor or implanted device. An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus. The healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made. The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself. The date and time this version of the observation was made available to providers, typically after the results have been reviewed and verified. Who was responsible for asserting the observed value as "true". The information determined as a result of making the observation, if the information has a simple value. Provides a reason why the expected value in the element Observation.value[x] is missing. A categorical assessment of an observation value. For example, high, low, normal. Comments about the observation or the results. Indicates the site on the subject's body where the observation was made (i.e. the target site). Indicates the mechanism used to perform the observation. The specimen that was used when this observation was made. The device used to generate the observation data. Guidance on how to interpret the value by comparison to a normal or recommended range. Multiple reference ranges are interpreted as an "OR". In other words, to represent two distinct target populations, two `referenceRange` elements would be used. This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group. The target resource that represents a measurement from which this observation value is derived. For example, a calculated anion gap or a fetal measurement based on an ultrasound image. Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same attributes. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations. Measurements and simple assertions made about a patient, device or other subject. The value of the low bound of the reference range. The low bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the low bound is omitted, it is assumed to be meaningless (e.g. reference range is <=2.3). The value of the high bound of the reference range. The high bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the high bound is omitted, it is assumed to be meaningless (e.g. reference range is >= 2.3). Codes to indicate the what part of the targeted reference population it applies to. For example, the normal or therapeutic range. Codes to indicate the target population this reference range applies to. For example, a reference range may be based on the normal population or a particular sex or race. Multiple `appliesTo` are interpreted as an "AND" of the target populations. For example, to represent a target population of African American females, both a code of female and a code for African American would be used. The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so. Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of "normals". Measurements and simple assertions made about a patient, device or other subject. Describes what was observed. Sometimes this is called the observation "code". The information determined as a result of making the observation, if the information has a simple value. Provides a reason why the expected value in the element Observation.component.value[x] is missing. A categorical assessment of an observation value. For example, high, low, normal. Guidance on how to interpret the value by comparison to a normal or recommended range. ================================================ FILE: tests/static/xsd/fhir/observationdefinition.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children ObservationDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/observationdefinition.xsd ================================================ Set of definitional characteristics for a kind of observation or measurement produced or consumed by an orderable health care service. Set of definitional characteristics for a kind of observation or measurement produced or consumed by an orderable health care service. If the element is present, it must have either a @value, an @id, or extensions A code that classifies the general type of observation. Describes what will be observed. Sometimes this is called the observation "name". A unique identifier assigned to this ObservationDefinition artifact. The data types allowed for the value element of the instance observations conforming to this ObservationDefinition. Multiple results allowed for observations conforming to this ObservationDefinition. The method or technique used to perform the observation. The preferred name to be used when reporting the results of observations conforming to this ObservationDefinition. Characteristics for quantitative results of this observation. Multiple ranges of results qualified by different contexts for ordinal or continuous observations conforming to this ObservationDefinition. The set of valid coded results for the observations conforming to this ObservationDefinition. The set of normal coded results for the observations conforming to this ObservationDefinition. The set of abnormal coded results for the observation conforming to this ObservationDefinition. The set of critical coded results for the observation conforming to this ObservationDefinition. Set of definitional characteristics for a kind of observation or measurement produced or consumed by an orderable health care service. Customary unit used to report quantitative results of observations conforming to this ObservationDefinition. SI unit used to report quantitative results of observations conforming to this ObservationDefinition. Factor for converting value expressed with SI unit to value expressed with customary unit. Number of digits after decimal separator when the results of such observations are of type Quantity. Set of definitional characteristics for a kind of observation or measurement produced or consumed by an orderable health care service. The category of interval of values for continuous or ordinal observations conforming to this ObservationDefinition. The low and high values determining the interval. There may be only one of the two. Codes to indicate the health context the range applies to. For example, the normal or therapeutic range. Codes to indicate the target population this reference range applies to. Sex of the population the range applies to. The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so. The gestational age to which this reference range is applicable, in the context of pregnancy. Text based condition for which the reference range is valid. Quantity CodeableConcept string boolean integer Range Ratio SampledData time dateTime Period Permitted data type for observation value. If the element is present, it must have either a @value, an @id, or extensions reference range critical range absolute range Codes identifying the category of observation range. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/operationdefinition.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children OperationDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided opd-1: Either a type must be provided, or parts opd-2: A search type can only be specified for parameters of type string opd-3: A targetProfile can only be specified for parameters of type Reference or Canonical ================================================ FILE: tests/static/xsd/fhir/operationdefinition.xsd ================================================ A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this operation definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this operation definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the operation definition is stored on different servers. The identifier that is used to identify this version of the operation definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the operation definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the operation definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the operation definition. The status of this operation definition. Enables tracking the life-cycle of the content. Whether this is an operation or a named query. A Boolean value to indicate that this operation definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the operation definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the operation definition changes. The name of the organization or individual that published the operation definition. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the operation definition from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate operation definition instances. A legal or geographic region in which the operation definition is intended to be used. Explanation of why this operation definition is needed and why it has been designed as it has. Whether the operation affects state. Side effects such as producing audit trail entries do not count as 'affecting state'. The name used to invoke the operation. Additional information about how to use this operation or named query. Indicates that this operation definition is a constraining profile on the base. The types on which this operation can be executed. Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context). Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a specific resource id for the context). Indicates whether this operation can be invoked on a particular instance of one of the given types. Additional validation information for the in parameters - a single profile that covers all the parameters. The profile is a constraint on the parameters resource as a whole. Additional validation information for the out parameters - a single profile that covers all the parameters. The profile is a constraint on the parameters resource. The parameters for the operation/query. Defines an appropriate combination of parameters to use when invoking this operation, to help code generators when generating overloaded parameter sets for this operation. A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). The name of used to identify the parameter. Whether this is an input or an output parameter. The minimum number of times this parameter SHALL appear in the request or response. The maximum number of times this element is permitted to appear in the request or response. Describes the meaning or use of this parameter. The type for this parameter. Used when the type is "Reference" or "canonical", and identifies a profile structure or implementation Guide that applies to the target of the reference this parameter refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the target resource SHALL conform to at least one profile defined in the implementation guide. How the parameter is understood as a search parameter. This is only used if the parameter type is 'string'. Binds to a value set if this parameter is coded (code, Coding, CodeableConcept). Identifies other resource parameters within the operation invocation that are expected to resolve to this resource. The parts of a nested Parameter. A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances. Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used. A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). The name of the parameter or dot-separated path of parameter names pointing to the resource parameter that is expected to contain a reference to this resource. The id of the element in the referencing resource that is expected to resolve to this resource. A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). Name of parameter to include in overload. Comments to go on overload. In Out Whether an operation parameter is an input or an output parameter. If the element is present, it must have either a @value, an @id, or extensions Operation Query Whether an operation is a normal operation or a query. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/operationoutcome.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children OperationOutcome dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content ================================================ FILE: tests/static/xsd/fhir/operationoutcome.xsd ================================================ A collection of error, warning, or information messages that result from a system action. A collection of error, warning, or information messages that result from a system action. If the element is present, it must have either a @value, an @id, or extensions An error, warning, or information message that results from a system action. A collection of error, warning, or information messages that result from a system action. Indicates whether the issue indicates a variation from successful processing. Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element. Additional details about the error. This may be a text description of the error or a system code that identifies the error. Additional diagnostic information about the issue. This element is deprecated because it is XML specific. It is replaced by issue.expression, which is format independent, and simpler to parse. For resource issues, this will be a simple XPath limited to element names, repetition indicators and the default child accessor that identifies one of the elements in the resource that caused this issue to be raised. For HTTP errors, will be "http." + the parameter name. A [simple subset of FHIRPath](fhirpath.html#simple) limited to element names, repetition indicators and the default child accessor that identifies one of the elements in the resource that caused this issue to be raised. Invalid Content Structural Issue Required element missing Element value invalid Validation rule failed Security Problem Login Required Unknown User Session Expired Forbidden Information Suppressed Processing Failure Content not supported Duplicate Multiple Matches Not Found Deleted Content Too Long Invalid Code Unacceptable Extension Operation Too Costly Business Rule Violation Edit Version Conflict Transient Issue Lock Error No Store Available Exception Timeout Incomplete Results Throttled Informational Note A code that describes the type of issue. If the element is present, it must have either a @value, an @id, or extensions Fatal Error Warning Information How the issue affects the success of the action. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/organization.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Organization dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label org-1: The organization SHALL at least have a name or an identifier, and possibly more than one txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided org-3: The telecom of an organization can never be of use 'home' cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end org-2: An address of an organization can never be of use 'home' per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/organization.xsd ================================================ A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, payer/insurer, etc. A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, payer/insurer, etc. If the element is present, it must have either a @value, an @id, or extensions Identifier for the organization that is used to identify the organization across multiple disparate systems. Whether the organization's record is still in active use. The kind(s) of organization that this is. A name associated with the organization. A list of alternate names that the organization is known as, or was known as in the past. A contact detail for the organization. An address for the organization. The organization of which this organization forms a part. Contact for the organization for a certain purpose. Technical endpoints providing access to services operated for the organization. A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, payer/insurer, etc. Indicates a purpose for which the contact can be reached. A name associated with the contact. A contact detail (e.g. a telephone number or an email address) by which the party may be contacted. Visiting or postal addresses for the contact. ================================================ FILE: tests/static/xsd/fhir/organizationaffiliation.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children OrganizationAffiliation dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/organizationaffiliation.xsd ================================================ Defines an affiliation/assotiation/relationship between 2 distinct oganizations, that is not a part-of relationship/sub-division relationship. Defines an affiliation/assotiation/relationship between 2 distinct oganizations, that is not a part-of relationship/sub-division relationship. If the element is present, it must have either a @value, an @id, or extensions Business identifiers that are specific to this role. Whether this organization affiliation record is in active use. The period during which the participatingOrganization is affiliated with the primary organization. Organization where the role is available (primary organization/has members). The Participating Organization provides/performs the role(s) defined by the code to the Primary Organization (e.g. providing services or is a member of). Health insurance provider network in which the participatingOrganization provides the role's services (if defined) at the indicated locations (if defined). Definition of the role the participatingOrganization plays in the association. Specific specialty of the participatingOrganization in the context of the role. The location(s) at which the role occurs. Healthcare services provided through the role. Contact details at the participatingOrganization relevant to this Affiliation. Technical endpoints providing access to services operated for this role. ================================================ FILE: tests/static/xsd/fhir/parameters.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Parameters inv-1: A parameter must have one and only one of (value, resource, part) ================================================ FILE: tests/static/xsd/fhir/parameters.xsd ================================================ This resource is a non-persisted resource used to pass information into and back from an [operation](operations.html). It has no other use, and there is no RESTful endpoint associated with it. This resource is a non-persisted resource used to pass information into and back from an [operation](operations.html). It has no other use, and there is no RESTful endpoint associated with it. If the element is present, it must have either a @value, an @id, or extensions A parameter passed to or received from the operation. This resource is a non-persisted resource used to pass information into and back from an [operation](operations.html). It has no other use, and there is no RESTful endpoint associated with it. The name of the parameter (reference to the operation definition). If the parameter is a data type. If the parameter is a whole resource. A named part of a multi-part parameter. ================================================ FILE: tests/static/xsd/fhir/patient.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Patient dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType pat-1: SHALL at least contain a contact's details or a reference to an organization per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/patient.xsd ================================================ Demographics and other administrative information about an individual or animal receiving care or other health-related services. Demographics and other administrative information about an individual or animal receiving care or other health-related services. If the element is present, it must have either a @value, an @id, or extensions An identifier for this patient. Whether this patient record is in active use. Many systems use this property to mark as non-current patients, such as those that have not been seen for a period of time based on an organization's business rules. It is often used to filter patient lists to exclude inactive patients Deceased patients may also be marked as inactive for the same reasons, but may be active for some time after death. A name associated with the individual. A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted. Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. The date of birth for the individual. Indicates if the individual is deceased or not. An address for the individual. This field contains a patient's most recent marital (civil) status. Indicates whether the patient is part of a multiple (boolean) or indicates the actual birth order (integer). Image of the patient. A contact party (e.g. guardian, partner, friend) for the patient. A language which may be used to communicate with the patient about his or her health. Patient's nominated care provider. Organization that is the custodian of the patient record. Link to another patient resource that concerns the same actual patient. Demographics and other administrative information about an individual or animal receiving care or other health-related services. The nature of the relationship between the patient and the contact person. A name associated with the contact person. A contact detail for the person, e.g. a telephone number or an email address. Address for the contact person. Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes. Organization on behalf of which the contact is acting or for which the contact is working. The period during which this contact person or organization is valid to be contacted relating to this patient. Demographics and other administrative information about an individual or animal receiving care or other health-related services. The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English. Indicates whether or not the patient prefers this language (over other languages he masters up a certain level). Demographics and other administrative information about an individual or animal receiving care or other health-related services. The other patient resource that the link refers to. The type of link between this patient resource and another patient resource. Replaced-by Vervangen door Replaces Vervangt Refer Verwijzing See also Zie ook The type of link between this patient resource and another patient resource. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/paymentnotice.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children PaymentNotice dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/paymentnotice.xsd ================================================ This resource provides the status of the payment for goods and services rendered, and the request and response resource references. This resource provides the status of the payment for goods and services rendered, and the request and response resource references. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this payment notice. The status of the resource instance. Reference of resource for which payment is being made. Reference of response to resource for which payment is being made. The date when this resource was created. The practitioner who is responsible for the services rendered to the patient. A reference to the payment which is the subject of this notice. The date when the above payment action occurred. The party who will receive or has received payment that is the subject of this notification. The party who is notified of the payment status. The amount sent to the payee. A code indicating whether payment has been sent or cleared. ================================================ FILE: tests/static/xsd/fhir/paymentreconciliation.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children PaymentReconciliation dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/paymentreconciliation.xsd ================================================ This resource provides the details including amount of a payment and allocates the payment items being paid. This resource provides the details including amount of a payment and allocates the payment items being paid. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this payment reconciliation. The status of the resource instance. The period of time for which payments have been gathered into this bulk payment for settlement. The date when the resource was created. The party who generated the payment. Original request resource reference. The practitioner who is responsible for the services rendered to the patient. The outcome of a request for a reconciliation. A human readable description of the status of the request for the reconciliation. The date of payment as indicated on the financial instrument. Total payment amount as indicated on the financial instrument. Issuer's unique identifier for the payment instrument. Distribution of the payment amount for a previously acknowledged payable. A code for the form to be used for printing the content. A note that describes or explains the processing in a human readable form. This resource provides the details including amount of a payment and allocates the payment items being paid. Unique identifier for the current payment item for the referenced payable. Unique identifier for the prior payment item for the referenced payable. Code to indicate the nature of the payment. A resource, such as a Claim, the evaluation of which could lead to payment. The party which submitted the claim or financial transaction. A resource, such as a ClaimResponse, which contains a commitment to payment. The date from the response resource containing a commitment to pay. A reference to the individual who is responsible for inquiries regarding the response and its payment. The party which is receiving the payment. The monetary amount allocated from the total payment to the payable. This resource provides the details including amount of a payment and allocates the payment items being paid. The business purpose of the note text. The explanation or description associated with the processing. ================================================ FILE: tests/static/xsd/fhir/person.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Person dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/person.xsd ================================================ Demographics and administrative information about a person independent of a specific health-related context. Demographics and administrative information about a person independent of a specific health-related context. If the element is present, it must have either a @value, an @id, or extensions Identifier for a person within a particular scope. A name associated with the person. A contact detail for the person, e.g. a telephone number or an email address. Administrative Gender. The birth date for the person. One or more addresses for the person. An image that can be displayed as a thumbnail of the person to enhance the identification of the individual. The organization that is the custodian of the person record. Whether this person's record is in active use. Link to a resource that concerns the same actual person. Demographics and administrative information about a person independent of a specific health-related context. The resource to which this actual person is associated. Level of assurance that this link is associated with the target resource. Level 1 Level 2 Level 3 Level 4 The level of confidence that this link represents the same actual person, based on NIST Authentication Levels. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/plandefinition.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children PlanDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType att-1: If the Attachment has data, it SHALL have a contentType qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. ================================================ FILE: tests/static/xsd/fhir/plandefinition.xsd ================================================ This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols. This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this plan definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this plan definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the plan definition is stored on different servers. A formal identifier that is used to identify this plan definition when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the plan definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the plan definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts. A natural language name identifying the plan definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the plan definition. An explanatory or alternate title for the plan definition giving additional information about its content. A high-level category for the plan definition that distinguishes the kinds of systems that would be interested in the plan definition. The status of this plan definition. Enables tracking the life-cycle of the content. A Boolean value to indicate that this plan definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. A code or group definition that describes the intended subject of the plan definition. The date (and optionally time) when the plan definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the plan definition changes. The name of the organization or individual that published the plan definition. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the plan definition from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate plan definition instances. A legal or geographic region in which the plan definition is intended to be used. Explanation of why this plan definition is needed and why it has been designed as it has. A detailed description of how the plan definition is used from a clinical perspective. A copyright statement relating to the plan definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the plan definition. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the plan definition content was or is planned to be in active use. Descriptive topics related to the content of the plan definition. Topics provide a high-level categorization of the definition that can be useful for filtering and searching. An individiual or organization primarily involved in the creation and maintenance of the content. An individual or organization primarily responsible for internal coherence of the content. An individual or organization primarily responsible for review of some aspect of the content. An individual or organization responsible for officially endorsing the content for use in some setting. Related artifacts such as additional documentation, justification, or bibliographic references. A reference to a Library resource containing any formal logic used by the plan definition. Goals that describe what the activities within the plan are intended to achieve. For example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc. An action or group of actions to be taken as part of the plan. This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols. Indicates a category the goal falls within. Human-readable and/or coded description of a specific desired objective of care, such as "control blood pressure" or "negotiate an obstacle course" or "dance with child at wedding". Identifies the expected level of importance associated with reaching/sustaining the defined goal. The event after which the goal should begin being pursued. Identifies problems, conditions, issues, or concerns the goal is intended to address. Didactic or other informational resources associated with the goal that provide further supporting information about the goal. Information resources can include inline text commentary and links to web resources. Indicates what should be done and within what timeframe. This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols. The parameter whose value is to be tracked, e.g. body weight, blood pressure, or hemoglobin A1c level. The target value of the measure to be achieved to signify fulfillment of the goal, e.g. 150 pounds or 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any value at or above the low value. Indicates the timeframe after the start of the goal in which the goal should be met. This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols. A user-visible prefix for the action. The title of the action displayed to a user. A brief description of the action used to provide a summary to display to the user. A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that might not be capable of interpreting it dynamically. Indicates how quickly the action should be addressed with respect to other actions. A code that provides meaning for the action or action group. For example, a section may have a LOINC code for the section of a documentation template. A description of why this action is necessary or appropriate. Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources. Identifies goals that this action supports. The reference must be to a goal element defined within this plan definition. A code or group definition that describes the intended subject of the action and its children, if any. A description of when the action should be triggered. An expression that describes applicability criteria or start/stop conditions for the action. Defines input data requirements for the action. Defines the outputs of the action, if any. A relationship to another action such as "before" or "30-60 minutes after start of". An optional value describing when the action should be performed. Indicates who should participate in performing the action described. The type of action to perform (create, update, remove). Defines the grouping behavior for the action and its children. Defines the selection behavior for the action and its children. Defines the required behavior for the action. Defines whether the action should usually be preselected. Defines whether the action can be selected multiple times. A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken. A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input. Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result. Sub actions that are contained within the action. The behavior of this action determines the functionality of the sub-actions. For example, a selection behavior of at-most-one indicates that of the sub-actions, at most one may be chosen as part of realizing the action definition. This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols. The kind of condition. An expression that returns true or false, indicating whether the condition is satisfied. This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols. The element id of the related action. The relationship of this action to the related action. A duration or range of durations to apply to the relationship. For example, 30-60 minutes before. This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols. The type of participant in the action. The role the participant should play in performing the described action. This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols. The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolveable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details). An expression specifying the value of the customized element. Must Could Must Unless Documented Defines expectations around whether an action or action group is required. If the element is present, it must have either a @value, an @id, or extensions Before Start Before Before End Concurrent With Start Concurrent Concurrent With End After Start After After End Defines the types of relationships between actions. If the element is present, it must have either a @value, an @id, or extensions Visual Group Logical Group Sentence Group Defines organization behavior of a group. If the element is present, it must have either a @value, an @id, or extensions Any All All Or None Exactly One At Most One One Or More Defines selection behavior of a group. If the element is present, it must have either a @value, an @id, or extensions Single Multiple Defines behavior for an action or a group for how many times that item may be repeated. If the element is present, it must have either a @value, an @id, or extensions Yes No Defines selection frequency behavior for an action or group. If the element is present, it must have either a @value, an @id, or extensions Applicability Start Stop Defines the kinds of conditions that can appear on actions. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/practitioner.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Practitioner dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/practitioner.xsd ================================================ A person who is directly or indirectly involved in the provisioning of healthcare. A person who is directly or indirectly involved in the provisioning of healthcare. If the element is present, it must have either a @value, an @id, or extensions An identifier that applies to this person in this role. Whether this practitioner's record is in active use. The name(s) associated with the practitioner. A contact detail for the practitioner, e.g. a telephone number or an email address. Address(es) of the practitioner that are not role specific (typically home address). Work addresses are not typically entered in this property as they are usually role dependent. Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. The date of birth for the practitioner. Image of the person. The official certifications, training, and licenses that authorize or otherwise pertain to the provision of care by the practitioner. For example, a medical license issued by a medical board authorizing the practitioner to practice medicine within a certian locality. A language the practitioner can use in patient communication. A person who is directly or indirectly involved in the provisioning of healthcare. An identifier that applies to this person's qualification in this role. Coded representation of the qualification. Period during which the qualification is valid. Organization that regulates and issues the qualification. ================================================ FILE: tests/static/xsd/fhir/practitionerrole.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children PractitionerRole dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/practitionerrole.xsd ================================================ A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time. A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time. If the element is present, it must have either a @value, an @id, or extensions Business Identifiers that are specific to a role/location. Whether this practitioner role record is in active use. The period during which the person is authorized to act as a practitioner in these role(s) for the organization. Practitioner that is able to provide the defined services for the organization. The organization where the Practitioner performs the roles associated. Roles which this practitioner is authorized to perform for the organization. Specific specialty of the practitioner. The location(s) at which this practitioner provides care. The list of healthcare services that this worker provides for this role's Organization/Location(s). Contact details that are specific to the role/location/service. A collection of times the practitioner is available or performing this role at the location and/or healthcareservice. The practitioner is not available or performing this role during this period of time due to the provided reason. A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times. Technical endpoints providing access to services operated for the practitioner with this role. A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time. Indicates which days of the week are available between the start and end Times. Is this always available? (hence times are irrelevant) e.g. 24 hour service. The opening time of day. Note: If the AllDay flag is set, then this time is ignored. The closing time of day. Note: If the AllDay flag is set, then this time is ignored. A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time. The reason that can be presented to the user as to why this time is not available. Service is not available (seasonally or for a public holiday) from this date. ================================================ FILE: tests/static/xsd/fhir/procedure.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Procedure dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end age-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. If value is present, it SHALL be positive. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/procedure.xsd ================================================ An action that is or was performed on or for a patient. This can be a physical intervention like an operation, or less invasive like long term services, counseling, or hypnotherapy. An action that is or was performed on or for a patient. This can be a physical intervention like an operation, or less invasive like long term services, counseling, or hypnotherapy. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this procedure by the performer or other systems which remain constant as the resource is updated and is propagated from server to server. The URL pointing to a FHIR-defined protocol, guideline, order set or other definition that is adhered to in whole or in part by this Procedure. The URL pointing to an externally maintained protocol, guideline, order set or other definition that is adhered to in whole or in part by this Procedure. A reference to a resource that contains details of the request for this procedure. A larger event of which this particular procedure is a component or step. A code specifying the state of the procedure. Generally, this will be the in-progress or completed state. Captures the reason for the current state of the procedure. A code that classifies the procedure for searching, sorting and display purposes (e.g. "Surgical Procedure"). The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. "Laparoscopic Appendectomy"). The person, animal or group on which the procedure was performed. The Encounter during which this Procedure was created or performed or to which the creation of this record is tightly associated. Estimated or actual date, date-time, period, or age when the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured. Individual who recorded the record and takes responsibility for its content. Individual who is making the procedure statement. Limited to "real" people rather than equipment. The location where the procedure actually happened. E.g. a newborn at home, a tracheostomy at a restaurant. The coded reason why the procedure was performed. This may be a coded entity of some type, or may simply be present as text. The justification of why the procedure was performed. Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion. The outcome of the procedure - did it resolve the reasons for the procedure being performed? This could be a histology result, pathology report, surgical report, etc. Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues. Any complications that occurred during the procedure, or in the immediate post-performance period. If the procedure required specific follow up - e.g. removal of sutures. The follow up may be represented as a simple note or could potentially be more complex, in which case the CarePlan resource can be used. Any other notes and comments about the procedure. A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure. Identifies medications, devices and any other substance used as part of the procedure. Identifies coded items that were used as part of the procedure. An action that is or was performed on or for a patient. This can be a physical intervention like an operation, or less invasive like long term services, counseling, or hypnotherapy. Distinguishes the type of involvement of the performer in the procedure. For example, surgeon, anaesthetist, endoscopist. The practitioner who was involved in the procedure. The organization the device or practitioner was acting on behalf of. An action that is or was performed on or for a patient. This can be a physical intervention like an operation, or less invasive like long term services, counseling, or hypnotherapy. The kind of change that happened to the device during the procedure. The device that was manipulated (changed) during the procedure. ================================================ FILE: tests/static/xsd/fhir/provenance.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Provenance dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/provenance.xsd ================================================ Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies. Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies. If the element is present, it must have either a @value, an @id, or extensions The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity. The period during which the activity occurred. The instant of time at which the activity was recorded. Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc. Where the activity occurred, if relevant. The reason that the activity was taking place. An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities. An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place. An entity used in this activity. A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated. Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies. The participation the agent had with respect to the activity. The function of the agent with respect to the activity. The security role enabling the agent with respect to the activity. The individual, device or organization that participated in the event. The individual, device, or organization for whom the change was made. Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies. How the entity was used during the activity. Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative. The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity. Derivation Revision Quotation Source Removal How an entity was used in an activity. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/questionnaire.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Questionnaire dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label que-2: The link ids for groups and questions must be unique within the questionnaire txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end que-9: Read-only can't be specified for "display" items que-8: Initial values can't be specified for groups or display items que-6: Required and repeat aren't permitted for display items que-5: Only 'choice' and 'open-choice' items can have answerValueSet que-4: A question cannot have both answerOption and answerValueSet que-3: Display items cannot have a "code" asserted que-10: Maximum length can only be declared for simple question types que-1: Group items must have nested items, display items cannot have nested items que-13: Can only have multiple initial values for repeating items que-11: If one or more answerOption is present, initial[x] must be missing que-12: If there are more than one enableWhen, enableBehavior must be specified ================================================ FILE: tests/static/xsd/fhir/questionnaire.xsd ================================================ A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection. A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this questionnaire is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the questionnaire is stored on different servers. A formal identifier that is used to identify this questionnaire when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the questionnaire when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the questionnaire author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the questionnaire. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the questionnaire. The URL of a Questionnaire that this Questionnaire is based on. The status of this questionnaire. Enables tracking the life-cycle of the content. A Boolean value to indicate that this questionnaire is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The types of subjects that can be the subject of responses created for the questionnaire. The date (and optionally time) when the questionnaire was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the questionnaire changes. The name of the organization or individual that published the questionnaire. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the questionnaire from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate questionnaire instances. A legal or geographic region in which the questionnaire is intended to be used. Explanation of why this questionnaire is needed and why it has been designed as it has. A copyright statement relating to the questionnaire and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the questionnaire. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the questionnaire content was or is planned to be in active use. An identifier for this question or group of questions in a particular terminology such as LOINC. A particular question, question grouping or display text that is part of the questionnaire. A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection. An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource. This element is a URI that refers to an [[[ElementDefinition]]] that provides information about this item, including information that might otherwise be included in the instance of the Questionnaire resource. A detailed description of the construction of the URI is shown in Comments, below. If this element is present then the following element values MAY be derived from the Element Definition if the corresponding elements of this Questionnaire resource instance have no value: * code (ElementDefinition.code) * type (ElementDefinition.type) * required (ElementDefinition.min) * repeats (ElementDefinition.max) * maxLength (ElementDefinition.maxLength) * answerValueSet (ElementDefinition.binding) * options (ElementDefinition.binding). A terminology code that corresponds to this group or question (e.g. a code from LOINC, which defines many questions and answers). A short label for a particular group, question or set of display text within the questionnaire used for reference by the individual completing the questionnaire. The name of a section, the text of a question or text content for a display item. The type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.). A constraint indicating that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true. Controls how multiple enableWhen values are interpreted - whether all or any must be true. An indication, if true, that the item must be present in a "completed" QuestionnaireResponse. If false, the item may be skipped when answering the questionnaire. An indication, if true, that the item may occur multiple times in the response, collecting multiple answers for questions or multiple sets of answers for groups. An indication, when true, that the value cannot be changed by a human respondent to the Questionnaire. The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponse. A reference to a value set containing a list of codes representing permitted answers for a "choice" or "open-choice" question. One of the permitted answers for a "choice" or "open-choice" question. One or more values that should be pre-populated in the answer when initially rendering the questionnaire for user input. Text, questions and other groups to be nested beneath a question or group. A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection. The linkId for the question whose answer (or lack of answer) governs whether this item is enabled. Specifies the criteria by which the question is enabled. A value that the referenced question is tested using the specified operator in order for the item to be enabled. A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection. A potential answer that's allowed as the answer to this question. Indicates whether the answer value is selected when the list of possible answers is initially shown. A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection. The actual value to for an initial answer. Group Display Boolean Decimal Integer Date Date Time Time String Text Url Choice Open Choice Attachment Reference Quantity Distinguishes groups from questions and display text and indicates data type for questions. If the element is present, it must have either a @value, an @id, or extensions All Any Controls how multiple enableWhen values are interpreted - whether all or any must be true. If the element is present, it must have either a @value, an @id, or extensions Exists Equals Not Equals Greater Than Less Than Greater or Equals Less or Equals The criteria by which a question is enabled. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/questionnaireresponse.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children QuestionnaireResponse dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qrs-1: Nested item can't be beneath both item and answer ================================================ FILE: tests/static/xsd/fhir/questionnaireresponse.xsd ================================================ A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to. A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to. If the element is present, it must have either a @value, an @id, or extensions A business identifier assigned to a particular completed (or partially completed) questionnaire. The order, proposal or plan that is fulfilled in whole or in part by this QuestionnaireResponse. For example, a ServiceRequest seeking an intake assessment or a decision support recommendation to assess for post-partum depression. A procedure or observation that this questionnaire was performed as part of the execution of. For example, the surgery a checklist was executed as part of. The Questionnaire that defines and organizes the questions for which answers are being provided. The position of the questionnaire response within its overall lifecycle. The subject of the questionnaire response. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information. The Encounter during which this questionnaire response was created or to which the creation of this record is tightly associated. The date and/or time that this set of answers were last changed. Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system. The person who answered the questions about the subject. A group or question item from the original questionnaire for which answers are provided. A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to. The item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource. A reference to an [[[ElementDefinition]]] that provides the details for the item. Text that is displayed above the contents of the group or as the text of the question being answered. The respondent's answer(s) to the question. Questions or sub-groups nested beneath a question or group. A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to. The answer (or one of the answers) provided by the respondent to the question. Nested groups and/or questions found within this particular answer. In Progress Completed Amended Entered in Error Stopped Lifecycle status of the questionnaire response. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/relatedperson.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children RelatedPerson dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType per-1: If present, start SHALL have a lower value than end ================================================ FILE: tests/static/xsd/fhir/relatedperson.xsd ================================================ Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process. Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process. If the element is present, it must have either a @value, an @id, or extensions Identifier for a person within a particular scope. Whether this related person record is in active use. The patient this person is related to. The nature of the relationship between a patient and the related person. A name associated with the person. A contact detail for the person, e.g. a telephone number or an email address. Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. The date on which the related person was born. Address where the related person can be contacted or visited. Image of the person. The period of time during which this relationship is or was active. If there are no dates defined, then the interval is unknown. A language which may be used to communicate with about the patient's health. Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process. The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English. Indicates whether or not the patient prefers this language (over other languages he masters up a certain level). ================================================ FILE: tests/static/xsd/fhir/requestgroup.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children RequestGroup dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided rqg-1: Must have resource or action but not both ================================================ FILE: tests/static/xsd/fhir/requestgroup.xsd ================================================ A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one". A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one". If the element is present, it must have either a @value, an @id, or extensions Allows a service to provide a unique, business identifier for the request. A canonical URL referencing a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this request. A URL referencing an externally defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this request. A plan, proposal or order that is fulfilled in whole or in part by this request. Completed or terminated request(s) whose function is taken by this new request. A shared identifier common to all requests that were authorized more or less simultaneously by a single author, representing the identifier of the requisition, prescription or similar form. The current state of the request. For request groups, the status reflects the status of all the requests in the group. Indicates the level of authority/intentionality associated with the request and where the request fits into the workflow chain. Indicates how quickly the request should be addressed with respect to other requests. A code that identifies what the overall request group is. The subject for which the request group was created. Describes the context of the request group, if any. Indicates when the request group was created. Provides a reference to the author of the request group. Describes the reason for the request group in coded or textual form. Indicates another resource whose existence justifies this request group. Provides a mechanism to communicate additional information about the response. The actions, if any, produced by the evaluation of the artifact. A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one". A user-visible prefix for the action. The title of the action displayed to a user. A short description of the action used to provide a summary to display to the user. A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that might not be capable of interpreting it dynamically. Indicates how quickly the action should be addressed with respect to other actions. A code that provides meaning for the action or action group. For example, a section may have a LOINC code for a section of a documentation template. Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources. An expression that describes applicability criteria, or start/stop conditions for the action. A relationship to another action such as "before" or "30-60 minutes after start of". An optional value describing when the action should be performed. The participant that should perform or be responsible for this action. The type of action to perform (create, update, remove). Defines the grouping behavior for the action and its children. Defines the selection behavior for the action and its children. Defines expectations around whether an action is required. Defines whether the action should usually be preselected. Defines whether the action can be selected multiple times. The resource that is the target of the action (e.g. CommunicationRequest). Sub actions. A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one". The kind of condition. An expression that returns true or false, indicating whether or not the condition is satisfied. A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give this medication after that one". The element id of the action this is related to. The relationship of this action to the related action. A duration or range of durations to apply to the relationship. For example, 30-60 minutes before. ================================================ FILE: tests/static/xsd/fhir/researchdefinition.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children ResearchDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/researchdefinition.xsd ================================================ The ResearchDefinition resource describes the conditional state (population and any exposures being compared within the population) and outcome (if specified) that the knowledge (evidence, assertion, recommendation) is about. The ResearchDefinition resource describes the conditional state (population and any exposures being compared within the population) and outcome (if specified) that the knowledge (evidence, assertion, recommendation) is about. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this research definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this research definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the research definition is stored on different servers. A formal identifier that is used to identify this research definition when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the research definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the research definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts. A natural language name identifying the research definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the research definition. The short title provides an alternate title for use in informal descriptive contexts where the full, formal title is not necessary. An explanatory or alternate title for the ResearchDefinition giving additional information about its content. The status of this research definition. Enables tracking the life-cycle of the content. A Boolean value to indicate that this research definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The intended subjects for the ResearchDefinition. If this element is not provided, a Patient subject is assumed, but the subject of the ResearchDefinition can be anything. The date (and optionally time) when the research definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the research definition changes. The name of the organization or individual that published the research definition. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the research definition from a consumer's perspective. A human-readable string to clarify or explain concepts about the resource. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate research definition instances. A legal or geographic region in which the research definition is intended to be used. Explanation of why this research definition is needed and why it has been designed as it has. A detailed description, from a clinical perspective, of how the ResearchDefinition is used. A copyright statement relating to the research definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the research definition. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the research definition content was or is planned to be in active use. Descriptive topics related to the content of the ResearchDefinition. Topics provide a high-level categorization grouping types of ResearchDefinitions that can be useful for filtering and searching. An individiual or organization primarily involved in the creation and maintenance of the content. An individual or organization primarily responsible for internal coherence of the content. An individual or organization primarily responsible for review of some aspect of the content. An individual or organization responsible for officially endorsing the content for use in some setting. Related artifacts such as additional documentation, justification, or bibliographic references. A reference to a Library resource containing the formal logic used by the ResearchDefinition. A reference to a ResearchElementDefinition resource that defines the population for the research. A reference to a ResearchElementDefinition resource that defines the exposure for the research. A reference to a ResearchElementDefinition resource that defines the exposureAlternative for the research. A reference to a ResearchElementDefinition resomece that defines the outcome for the research. ================================================ FILE: tests/static/xsd/fhir/researchelementdefinition.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children ResearchElementDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType exp-1: An expression or a reference must be provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided drq-1: Either a path or a searchParam must be provided, but not both drq-2: Either a path or a searchParam must be provided, but not both per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. ================================================ FILE: tests/static/xsd/fhir/researchelementdefinition.xsd ================================================ The ResearchElementDefinition resource describes a "PICO" element that knowledge (evidence, assertion, recommendation) is about. The ResearchElementDefinition resource describes a "PICO" element that knowledge (evidence, assertion, recommendation) is about. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this research element definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this research element definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the research element definition is stored on different servers. A formal identifier that is used to identify this research element definition when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the research element definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the research element definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts. A natural language name identifying the research element definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the research element definition. The short title provides an alternate title for use in informal descriptive contexts where the full, formal title is not necessary. An explanatory or alternate title for the ResearchElementDefinition giving additional information about its content. The status of this research element definition. Enables tracking the life-cycle of the content. A Boolean value to indicate that this research element definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The intended subjects for the ResearchElementDefinition. If this element is not provided, a Patient subject is assumed, but the subject of the ResearchElementDefinition can be anything. The date (and optionally time) when the research element definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the research element definition changes. The name of the organization or individual that published the research element definition. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the research element definition from a consumer's perspective. A human-readable string to clarify or explain concepts about the resource. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate research element definition instances. A legal or geographic region in which the research element definition is intended to be used. Explanation of why this research element definition is needed and why it has been designed as it has. A detailed description, from a clinical perspective, of how the ResearchElementDefinition is used. A copyright statement relating to the research element definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the research element definition. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the research element definition content was or is planned to be in active use. Descriptive topics related to the content of the ResearchElementDefinition. Topics provide a high-level categorization grouping types of ResearchElementDefinitions that can be useful for filtering and searching. An individiual or organization primarily involved in the creation and maintenance of the content. An individual or organization primarily responsible for internal coherence of the content. An individual or organization primarily responsible for review of some aspect of the content. An individual or organization responsible for officially endorsing the content for use in some setting. Related artifacts such as additional documentation, justification, or bibliographic references. A reference to a Library resource containing the formal logic used by the ResearchElementDefinition. The type of research element, a population, an exposure, or an outcome. The type of the outcome (e.g. Dichotomous, Continuous, or Descriptive). A characteristic that defines the members of the research element. Multiple characteristics are applied with "and" semantics. The ResearchElementDefinition resource describes a "PICO" element that knowledge (evidence, assertion, recommendation) is about. Define members of the research element using Codes (such as condition, medication, or observation), Expressions ( using an expression language such as FHIRPath or CQL) or DataRequirements (such as Diabetes diagnosis onset in the last year). Use UsageContext to define the members of the population, such as Age Ranges, Genders, Settings. When true, members with this characteristic are excluded from the element. Specifies the UCUM unit for the outcome. A narrative description of the time period the study covers. Indicates what effective period the study covers. Indicates duration from the study initiation. Indicates how elements are aggregated within the study effective period. A narrative description of the time period the study covers. Indicates what effective period the study covers. Indicates duration from the participant's study entry. Indicates how elements are aggregated within the study effective period. Population Exposure Outcome The possible types of research elements (E.g. Population, Exposure, Outcome). If the element is present, it must have either a @value, an @id, or extensions Dichotomous Continuous Descriptive The possible types of variables for exposures or outcomes (E.g. Dichotomous, Continuous, Descriptive). If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/researchstudy.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children ResearchStudy dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/researchstudy.xsd ================================================ A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. A ResearchStudy involves the gathering of information about human or animal subjects. A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. A ResearchStudy involves the gathering of information about human or animal subjects. If the element is present, it must have either a @value, an @id, or extensions Identifiers assigned to this research study by the sponsor or other systems. A short, descriptive user-friendly label for the study. The set of steps expected to be performed as part of the execution of the study. A larger research study of which this particular study is a component or step. The current state of the study. The type of study based upon the intent of the study's activities. A classification of the intent of the study. The stage in the progression of a therapy from initial experimental use in humans in clinical trials to post-market evaluation. Codes categorizing the type of study such as investigational vs. observational, type of blinding, type of randomization, safety vs. efficacy, etc. The medication(s), food(s), therapy(ies), device(s) or other concerns or interventions that the study is seeking to gain more information about. The condition that is the focus of the study. For example, In a study to examine risk factors for Lupus, might have as an inclusion criterion "healthy volunteer", but the target condition code would be a Lupus SNOMED code. Contact details to assist a user in learning more about or engaging with the study. Citations, references and other related documents. Key terms to aid in searching for or filtering the study. Indicates a country, state or other region where the study is taking place. A full description of how the study is being conducted. Reference to a Group that defines the criteria for and quantity of subjects participating in the study. E.g. " 200 female Europeans between the ages of 20 and 45 with early onset diabetes". Identifies the start date and the expected (or actual, depending on status) end date for the study. An organization that initiates the investigation and is legally responsible for the study. A researcher in a study who oversees multiple aspects of the study, such as concept development, protocol writing, protocol submission for IRB approval, participant recruitment, informed consent, data collection, analysis, interpretation and presentation. A facility in which study activities are conducted. A description and/or code explaining the premature termination of the study. Comments made about the study by the performer, subject or other participants. Describes an expected sequence of events for one of the participants of a study. E.g. Exposure to drug A, wash-out, exposure to drug B, wash-out, follow-up. A goal that the study is aiming to achieve in terms of a scientific question to be answered by the analysis of data collected during the study. A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. A ResearchStudy involves the gathering of information about human or animal subjects. Unique, human-readable label for this arm of the study. Categorization of study arm, e.g. experimental, active comparator, placebo comparater. A succinct description of the path through the study that would be followed by a subject adhering to this arm. A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. A ResearchStudy involves the gathering of information about human or animal subjects. Unique, human-readable label for this objective of the study. The kind of study objective. Active Administratively Completed Approved Closed to Accrual Closed to Accrual and Intervention Completed Disapproved In Review Temporarily Closed to Accrual Temporarily Closed to Accrual and Intervention Withdrawn Codes that convey the current status of the research study. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/researchsubject.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children ResearchSubject dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/researchsubject.xsd ================================================ A physical entity which is the primary unit of operational and/or administrative interest in a study. A physical entity which is the primary unit of operational and/or administrative interest in a study. If the element is present, it must have either a @value, an @id, or extensions Identifiers assigned to this research subject for a study. The current state of the subject. The dates the subject began and ended their participation in the study. Reference to the study the subject is participating in. The record of the person or animal who is involved in the study. The name of the arm in the study the subject is expected to follow as part of this study. The name of the arm in the study the subject actually followed as part of this study. A record of the patient's informed agreement to participate in the study. Candidate Eligible Follow-up Ineligible Not Registered Off-study On-study On-study-intervention On-study-observation Pending on-study Potential Candidate Screening Withdrawn Indicates the progression of a study subject through a study. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/riskassessment.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children RiskAssessment dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ras-2: Must be <= 100 ras-1: low and high must be percentages, if present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/riskassessment.xsd ================================================ An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. If the element is present, it must have either a @value, an @id, or extensions Business identifier assigned to the risk assessment. A reference to the request that is fulfilled by this risk assessment. A reference to a resource that this risk assessment is part of, such as a Procedure. The status of the RiskAssessment, using the same statuses as an Observation. The algorithm, process or mechanism used to evaluate the risk. The type of the risk assessment performed. The patient or group the risk assessment applies to. The encounter where the assessment was performed. The date (and possibly time) the risk assessment was performed. For assessments or prognosis specific to a particular condition, indicates the condition being assessed. The provider or software application that performed the assessment. The reason the risk assessment was performed. Resources supporting the reason the risk assessment was performed. Indicates the source data considered as part of the assessment (for example, FamilyHistory, Observations, Procedures, Conditions, etc.). Describes the expected outcome for the subject. A description of the steps that might be taken to reduce the identified risk(s). Additional comments about the risk assessment. An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. One of the potential outcomes for the patient (e.g. remission, death, a particular condition). Indicates how likely the outcome is (in the specified timeframe). Indicates how likely the outcome is (in the specified timeframe), expressed as a qualitative value (e.g. low, medium, or high). Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). Indicates the period of time or age range of the subject to which the specified probability applies. Additional information explaining the basis for the prediction. ================================================ FILE: tests/static/xsd/fhir/riskevidencesynthesis.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children RiskEvidenceSynthesis dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/riskevidencesynthesis.xsd ================================================ The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies. The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this risk evidence synthesis when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this risk evidence synthesis is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the risk evidence synthesis is stored on different servers. A formal identifier that is used to identify this risk evidence synthesis when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the risk evidence synthesis when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the risk evidence synthesis author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the risk evidence synthesis. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the risk evidence synthesis. The status of this risk evidence synthesis. Enables tracking the life-cycle of the content. The date (and optionally time) when the risk evidence synthesis was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the risk evidence synthesis changes. The name of the organization or individual that published the risk evidence synthesis. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the risk evidence synthesis from a consumer's perspective. A human-readable string to clarify or explain concepts about the resource. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate risk evidence synthesis instances. A legal or geographic region in which the risk evidence synthesis is intended to be used. A copyright statement relating to the risk evidence synthesis and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the risk evidence synthesis. The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage. The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date. The period during which the risk evidence synthesis content was or is planned to be in active use. Descriptive topics related to the content of the RiskEvidenceSynthesis. Topics provide a high-level categorization grouping types of EffectEvidenceSynthesiss that can be useful for filtering and searching. An individiual or organization primarily involved in the creation and maintenance of the content. An individual or organization primarily responsible for internal coherence of the content. An individual or organization primarily responsible for review of some aspect of the content. An individual or organization responsible for officially endorsing the content for use in some setting. Related artifacts such as additional documentation, justification, or bibliographic references. Type of synthesis eg meta-analysis. Type of study eg randomized trial. A reference to a EvidenceVariable resource that defines the population for the research. A reference to a EvidenceVariable resource that defines the exposure for the research. A reference to a EvidenceVariable resomece that defines the outcome for the research. A description of the size of the sample involved in the synthesis. The estimated risk of the outcome. A description of the certainty of the risk estimate. The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies. Human-readable summary of sample size. Number of studies included in this evidence synthesis. Number of participants included in this evidence synthesis. The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies. Human-readable summary of risk estimate. Examples include proportion and mean. The point estimate of the risk estimate. Specifies the UCUM unit for the outcome. The sample size for the group that was measured for this risk estimate. The number of group members with the outcome of interest. A description of the precision of the estimate for the effect. The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies. Examples include confidence interval and interquartile range. Use 95 for a 95% confidence interval. Lower bound of confidence interval. Upper bound of confidence interval. The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies. A rating of the certainty of the effect estimate. A human-readable string to clarify or explain concepts about the resource. A description of a component of the overall certainty. The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies. Type of subcomponent of certainty rating. A rating of a subcomponent of rating certainty. A human-readable string to clarify or explain concepts about the resource. ================================================ FILE: tests/static/xsd/fhir/schedule.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Schedule dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ================================================ FILE: tests/static/xsd/fhir/schedule.xsd ================================================ A container for slots of time that may be available for booking appointments. A container for slots of time that may be available for booking appointments. If the element is present, it must have either a @value, an @id, or extensions External Ids for this item. Whether this schedule record is in active use or should not be used (such as was entered in error). A broad categorization of the service that is to be performed during this appointment. The specific service that is to be performed during this appointment. The specialty of a practitioner that would be required to perform the service requested in this appointment. Slots that reference this schedule resource provide the availability details to these referenced resource(s). The period of time that the slots that reference this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a "template" for planning outside these dates. Comments on the availability to describe any extended information. Such as custom constraints on the slots that may be associated. ================================================ FILE: tests/static/xsd/fhir/searchparameter.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children SearchParameter dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label spd-1: If an xpath is present, there SHALL be an xpathUsage spd-2: Search parameters can only have chain names when the search parameter type is 'reference' txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/searchparameter.xsd ================================================ A search parameter that defines a named search item that can be used to search/filter on a resource. A search parameter that defines a named search item that can be used to search/filter on a resource. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this search parameter when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this search parameter is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the search parameter is stored on different servers. The identifier that is used to identify this version of the search parameter when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the search parameter author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the search parameter. This name should be usable as an identifier for the module by machine processing applications such as code generation. Where this search parameter is originally defined. If a derivedFrom is provided, then the details in the search parameter must be consistent with the definition from which it is defined. i.e. the parameter should have the same meaning, and (usually) the functionality should be a proper subset of the underlying search parameter. The status of this search parameter. Enables tracking the life-cycle of the content. A Boolean value to indicate that this search parameter is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the search parameter was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes. The name of the organization or individual that published the search parameter. Contact details to assist a user in finding and communicating with the publisher. And how it used. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate search parameter instances. A legal or geographic region in which the search parameter is intended to be used. Explanation of why this search parameter is needed and why it has been designed as it has. The code used in the URL or the parameter name in a parameters resource for this search parameter. The base resource type(s) that this search parameter can be used against. The type of value that a search parameter may contain, and how the content is interpreted. A FHIRPath expression that returns a set of elements for the search parameter. An XPath expression that returns a set of elements for the search parameter. How the search parameter relates to the set of elements returned by evaluating the xpath query. Types of resource (if a resource is referenced). Whether multiple values are allowed for each time the parameter exists. Values are separated by commas, and the parameter matches if any of the values match. Whether multiple parameters are allowed - e.g. more than one parameter with the same name. The search matches if all the parameters match. Comparators supported for the search parameter. A modifier supported for the search parameter. Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from SearchParameter.code for a parameter on the target resource type. Used to define the parts of a composite search parameter. A search parameter that defines a named search item that can be used to search/filter on a resource. The definition of the search parameter that describes this part. A sub-expression that defines how to extract values for this component from the output of the main SearchParameter.expression. Normal Phonetic Nearby Distance Other How a search parameter relates to the set of elements returned by evaluating its xpath query. If the element is present, it must have either a @value, an @id, or extensions Missing Exact Contains Not Text In Not In Below Above Type Identifier Of Type A supported modifier for a search parameter. If the element is present, it must have either a @value, an @id, or extensions Equals Not Equals Greater Than Less Than Greater or Equals Less of Equal Starts After Ends Before Approximately What Search Comparator Codes are supported in search. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/servicerequest.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children ServiceRequest dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label prr-1: orderDetail SHALL only be present if code is present txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/servicerequest.xsd ================================================ A record of a request for service such as diagnostic investigations, treatments, or operations to be performed. A record of a request for service such as diagnostic investigations, treatments, or operations to be performed. If the element is present, it must have either a @value, an @id, or extensions Identifiers assigned to this order instance by the orderer and/or the receiver and/or order fulfiller. The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest. The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest. Plan/proposal/order fulfilled by this request. The request takes the place of the referenced completed or terminated request(s). A shared identifier common to all service requests that were authorized more or less simultaneously by a single author, representing the composite or group identifier. The status of the order. Whether the request is a proposal, plan, an original order or a reflex order. A code that classifies the service for searching, sorting and display purposes (e.g. "Surgical Procedure"). Indicates how quickly the ServiceRequest should be addressed with respect to other requests. Set this to true if the record is saying that the service/procedure should NOT be performed. A code that identifies a particular service (i.e., procedure, diagnostic investigation, or panel of investigations) that have been requested. Additional details and instructions about the how the services are to be delivered. For example, and order for a urinary catheter may have an order detail for an external or indwelling catheter, or an order for a bandage may require additional instructions specifying how the bandage should be applied. An amount of service being requested which can be a quantity ( for example $1,500 home modification), a ratio ( for example, 20 half day visits per month), or a range (2.0 to 1.8 Gy per fraction). On whom or what the service is to be performed. This is usually a human patient, but can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans). An encounter that provides additional information about the healthcare context in which this request is made. The date/time at which the requested service should occur. If a CodeableConcept is present, it indicates the pre-condition for performing the service. For example "pain", "on flare-up", etc. When the request transitioned to being actionable. The individual who initiated the request and has responsibility for its activation. Desired type of performer for doing the requested service. The desired performer for doing the requested service. For example, the surgeon, dermatopathologist, endoscopist, etc. The preferred location(s) where the procedure should actually happen in coded or free text form. E.g. at home or nursing day care center. A reference to the the preferred location(s) where the procedure should actually happen. E.g. at home or nursing day care center. An explanation or justification for why this service is being requested in coded or textual form. This is often for billing purposes. May relate to the resources referred to in `supportingInfo`. Indicates another resource that provides a justification for why this service is being requested. May relate to the resources referred to in `supportingInfo`. Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be needed for delivering the requested service. Additional clinical information about the patient or specimen that may influence the services or their interpretations. This information includes diagnosis, clinical findings and other observations. In laboratory ordering these are typically referred to as "ask at order entry questions (AOEs)". This includes observations explicitly requested by the producer (filler) to provide context or supporting information needed to complete the order. For example, reporting the amount of inspired oxygen for blood gas measurements. One or more specimens that the laboratory procedure will use. Anatomic location where the procedure should be performed. This is the target site. Any other notes and comments made about the service request. For example, internal billing notes. Instructions in terms that are understood by the patient or consumer. Key events in the history of the request. ================================================ FILE: tests/static/xsd/fhir/slot.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Slot dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/slot.xsd ================================================ A slot of time on a schedule that may be available for booking appointments. A slot of time on a schedule that may be available for booking appointments. If the element is present, it must have either a @value, an @id, or extensions External Ids for this item. A broad categorization of the service that is to be performed during this appointment. The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource. The specialty of a practitioner that would be required to perform the service requested in this appointment. The style of appointment or patient that may be booked in the slot (not service type). The schedule resource that this slot defines an interval of status information. busy | free | busy-unavailable | busy-tentative | entered-in-error. Date/Time that the slot is to begin. Date/Time that the slot is to conclude. This slot has already been overbooked, appointments are unlikely to be accepted for this time. Comments on the slot to describe any extended information. Such as custom constraints on the slot. Busy Free Busy (Unavailable) Busy (Tentative) Entered in error The free/busy status of the slot. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/specimen.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Specimen dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. qty-3: If a code for the unit is present, the system SHALL also be present drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/specimen.xsd ================================================ A sample to be used for analysis. A sample to be used for analysis. If the element is present, it must have either a @value, an @id, or extensions Id for specimen. The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures. The availability of the specimen. The kind of material that forms the specimen. Where the specimen came from. This may be from patient(s), from a location (e.g., the source of an environmental sample), or a sampling of a substance or a device. Time when specimen was received for processing or testing. Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen. Details concerning a service request that required a specimen to be collected. Details concerning the specimen collection. Details concerning processing and processing steps for the specimen. The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here. A mode or state of being that describes the nature of the specimen. To communicate any details or issues about the specimen or during the specimen collection. (for example: broken vial, sent with patient, frozen). A sample to be used for analysis. Person who collected the specimen. Time when specimen was collected from subject - the physiologically relevant time. The span of time over which the collection of a specimen occurred. The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample. A coded value specifying the technique that is used to perform the procedure. Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens. Abstinence or reduction from some or all food, drink, or both, for a period of time prior to sample collection. A sample to be used for analysis. Textual description of procedure. A coded value specifying the procedure used to process the specimen. Material used in the processing step. A record of the time or period when the specimen processing occurred. For example the time of sample fixation or the period of time the sample was in formalin. A sample to be used for analysis. Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances. Textual description of the container. The type of container associated with the specimen (e.g. slide, aliquot, etc.). The capacity (volume or other measure) the container may contain. The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type. Introduced substance to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA. Available Unavailable Unsatisfactory Entered in Error Codes providing the status/availability of a specimen. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/specimendefinition.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children SpecimenDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. ================================================ FILE: tests/static/xsd/fhir/specimendefinition.xsd ================================================ A kind of specimen with associated set of requirements. A kind of specimen with associated set of requirements. If the element is present, it must have either a @value, an @id, or extensions A business identifier associated with the kind of specimen. The kind of material to be collected. Preparation of the patient for specimen collection. Time aspect of specimen collection (duration or offset). The action to be performed for collecting the specimen. Specimen conditioned in a container as expected by the testing laboratory. A kind of specimen with associated set of requirements. Primary of secondary specimen. The kind of specimen conditioned for testing expected by lab. The preference for this type of conditioned specimen. The specimen's container. Requirements for delivery and special handling of this kind of conditioned specimen. The usual time that a specimen of this kind is retained after the ordered tests are completed, for the purpose of additional testing. Criterion for rejection of the specimen in its container by the laboratory. Set of instructions for preservation/transport of the specimen at a defined temperature interval, prior the testing process. A kind of specimen with associated set of requirements. The type of material of the container. The type of container used to contain this kind of specimen. Color of container cap. The textual description of the kind of container. The capacity (volume or other measure) of this kind of container. The minimum volume to be conditioned in the container. Substance introduced in the kind of container to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA. Special processing that should be applied to the container for this kind of specimen. A kind of specimen with associated set of requirements. Substance introduced in the kind of container to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA. A kind of specimen with associated set of requirements. It qualifies the interval of temperature, which characterizes an occurrence of handling. Conditions that are not related to temperature may be handled in the instruction element. The temperature interval for this set of handling instructions. The maximum time interval of preservation of the specimen with these conditions. Additional textual instructions for the preservation or transport of the specimen. For instance, 'Protect from light exposure'. Preferred Alternate Degree of preference of a type of conditioned specimen. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/structuredefinition.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children StructureDefinition dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label sdf-9: In any snapshot or differential, no label, code or requirements on an element without a "." in the path (e.g. the first element) sdf-15a: If the first element in a differential has no "." in the path and it's not a logical model, it has no type sdf-19: FHIR Specification models only use FHIR defined types sdf-16: All element definitions must have unique ids (snapshot) sdf-15: The first element in a snapshot has no type unless model is a logical model. sdf-18: Context Invariants can only be used for extensions sdf-17: All element definitions must have unique ids (diff) sdf-23: No slice name on root sdf-11: If there's a type, its content must match the path name in the first element of a snapshot sdf-22: FHIR Specification models never have default values sdf-14: All element definitions must have an id sdf-1: Element paths must be unique unless the structure is a constraint sdf-21: Default values can only be specified on specializations sdf-6: A structure must have either a differential, or a snapshot (or both) sdf-5: If the structure defines an extension then the structure must have context information sdf-4: If the structure is not abstract, then there SHALL be a baseDefinition txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided sdf-2: Must have at least a name or a uri (or both) sdf-8: All snapshot elements must start with the StructureDefinition's specified type for non-logical models, or with the same type name for logical models sdf-3: Each element definition in a snapshot must have a formal definition and cardinalities sdf-8b: All snapshot elements must have a base definition sdf-10: provide either a binding reference or a description (or both) eld-19: Element names cannot include some special characters eld-2: Min <= Max eld-5: if the element definition has a contentReference, it cannot have type, defaultValue, fixed, pattern, example, minValue, maxValue, maxLength, or binding eld-7: Pattern may only be specified if there is one type eld-6: Fixed value may only be specified if there is one type eld-11: Binding can only be present for coded elements, string, and uri eld-22: sliceIsConstraining can only appear if slicename is present eld-8: Pattern and fixed are mutually exclusive eld-14: Constraints must be unique by key eld-13: Types must be unique by code eld-16: sliceName must be composed of proper tokens separated by "/" eld-15: default value and meaningWhenMissing are mutually exclusive eld-18: Must have a modifier reason if isModifier = true eld-1: If there are no discriminators, there must be a definition eld-3: Max SHALL be a number or "*" eld-4: Aggregation may only be specified if one of the allowed types for the element is a reference eld-17: targetProfile is only allowed if the type is Reference or canonical qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present eld-12: ValueSet SHALL start with http:// or https:// or urn: sdf-20: No slicing on the root element sdf-8a: In any differential, all the elements must start with the StructureDefinition's specified type for non-logical models, or with the same type name for logical models eld-19: Element names cannot include some special characters eld-2: Min <= Max eld-5: if the element definition has a contentReference, it cannot have type, defaultValue, fixed, pattern, example, minValue, maxValue, maxLength, or binding eld-7: Pattern may only be specified if there is one type eld-6: Fixed value may only be specified if there is one type eld-11: Binding can only be present for coded elements, string, and uri eld-22: sliceIsConstraining can only appear if slicename is present eld-8: Pattern and fixed are mutually exclusive eld-14: Constraints must be unique by key eld-13: Types must be unique by code eld-16: sliceName must be composed of proper tokens separated by "/" eld-15: default value and meaningWhenMissing are mutually exclusive eld-18: Must have a modifier reason if isModifier = true eld-1: If there are no discriminators, there must be a definition eld-3: Max SHALL be a number or "*" eld-4: Aggregation may only be specified if one of the allowed types for the element is a reference eld-17: targetProfile is only allowed if the type is Reference or canonical qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present eld-12: ValueSet SHALL start with http:// or https:// or urn: ================================================ FILE: tests/static/xsd/fhir/structuredefinition.xsd ================================================ A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types. A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this structure definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this structure definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the structure definition is stored on different servers. A formal identifier that is used to identify this structure definition when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the structure definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the structure definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the structure definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the structure definition. The status of this structure definition. Enables tracking the life-cycle of the content. A Boolean value to indicate that this structure definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the structure definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes. The name of the organization or individual that published the structure definition. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the structure definition from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate structure definition instances. A legal or geographic region in which the structure definition is intended to be used. Explanation of why this structure definition is needed and why it has been designed as it has. A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure definition. A set of key words or terms from external terminologies that may be used to assist with indexing and searching of templates nby describing the use of this structure definition, or the content it describes. The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 4.0.1. for this version. An external specification that the content is mapped to. Defines the kind of structure that this definition is describing. Whether structure this definition describes is abstract or not - that is, whether the structure is not intended to be instantiated. For Resources and Data types, abstract types will never be exchanged between systems. Identifies the types of resource or data type elements to which the extension can be applied. A set of rules as FHIRPath Invariants about when the extension can be used (e.g. co-occurrence variants for the extension). All the rules must be true. The type this structure describes. If the derivation kind is 'specialization' then this is the master definition for a type, and there is always one of these (a data type, an extension, a resource, including abstract ones). Otherwise the structure definition is a constraint on the stated type (and in this case, the type cannot be an abstract type). References are URLs that are relative to http://hl7.org/fhir/StructureDefinition e.g. "string" is a reference to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are only allowed in logical models. An absolute URI that is the base structure from which this type is derived, either by specialization or constraint. How the type relates to the baseDefinition. A snapshot view is expressed in a standalone form that can be used and interpreted without considering the base StructureDefinition. A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies. A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types. An Internal id that is used to identify this mapping set when specific mappings are made. An absolute URI that identifies the specification that this mapping is expressed to. A name for the specification that is being mapped to. Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types. Defines how to interpret the expression that defines what the context of the extension is. An expression that defines where an extension can be used in resources. A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types. Captures constraints on each element within the resource. A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types. Captures constraints on each element within the resource. Primitive Data Type Complex Data Type Resource Logical Defines the type of structure that a definition is describing. If the element is present, it must have either a @value, an @id, or extensions Specialization Constraint How a type relates to its baseDefinition. If the element is present, it must have either a @value, an @id, or extensions FHIRPath Element ID Extension URL How an extension context is interpreted. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/structuremap.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children StructureMap dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/structuremap.xsd ================================================ A Map of relationships between 2 structures that can be used to transform data. A Map of relationships between 2 structures that can be used to transform data. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this structure map when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this structure map is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the structure map is stored on different servers. A formal identifier that is used to identify this structure map when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the structure map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the structure map author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the structure map. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the structure map. The status of this structure map. Enables tracking the life-cycle of the content. A Boolean value to indicate that this structure map is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the structure map was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes. The name of the organization or individual that published the structure map. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the structure map from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate structure map instances. A legal or geographic region in which the structure map is intended to be used. Explanation of why this structure map is needed and why it has been designed as it has. A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure map. A structure definition used by this map. The structure definition may describe instances that are converted, or the instances that are produced. Other maps used by this map (canonical URLs). Organizes the mapping into manageable chunks for human review/ease of maintenance. A Map of relationships between 2 structures that can be used to transform data. The canonical reference to the structure. How the referenced structure is used in this mapping. The name used for this type in the map. Documentation that describes how the structure is used in the mapping. A Map of relationships between 2 structures that can be used to transform data. A unique name for the group for the convenience of human readers. Another group that this group adds rules to. If this is the default rule set to apply for the source type or this combination of types. Additional supporting documentation that explains the purpose of the group and the types of mappings within it. A name assigned to an instance of data. The instance must be provided when the mapping is invoked. Transform Rule from source to target. A Map of relationships between 2 structures that can be used to transform data. Name for this instance of data. Type for this instance of data. Mode for this instance of data. Documentation for this instance of data. A Map of relationships between 2 structures that can be used to transform data. Name of the rule for internal references. Source inputs to the mapping. Content to create because of this mapping rule. Rules contained in this rule. Which other rules to apply in the context of this rule. Documentation for this instance of data. A Map of relationships between 2 structures that can be used to transform data. Type or variable this rule applies to. Specified minimum cardinality for the element. This is optional; if present, it acts an implicit check on the input content. Specified maximum cardinality for the element - a number or a "*". This is optional; if present, it acts an implicit check on the input content (* just serves as documentation; it's the default value). Specified type for the element. This works as a condition on the mapping - use for polymorphic elements. A value to use if there is no existing value in the source object. Optional field for this source. How to handle the list mode for this element. Named context for field, if a field is specified. FHIRPath expression - must be true or the rule does not apply. FHIRPath expression - must be true or the mapping engine throws an error instead of completing. A FHIRPath expression which specifies a message to put in the transform log when content matching the source rule is found. A Map of relationships between 2 structures that can be used to transform data. Type or variable this rule applies to. How to interpret the context. Field to create in the context. Named context for field, if desired, and a field is specified. If field is a list, how to manage the list. Internal rule reference for shared list items. How the data is copied / created. Parameters to the transform. A Map of relationships between 2 structures that can be used to transform data. Parameter value - variable or literal. A Map of relationships between 2 structures that can be used to transform data. Name of a rule or group to apply. Variable to pass to the rule or group. Source Instance Target Instance Mode for this instance of data. If the element is present, it must have either a @value, an @id, or extensions Type Variable How to interpret the context. If the element is present, it must have either a @value, an @id, or extensions First Share Last Collate If field is a list, how to manage the production. If the element is present, it must have either a @value, an @id, or extensions create copy truncate escape cast append translate reference dateOp uuid pointer evaluate cc c qty id cp How data is copied/created. If the element is present, it must have either a @value, an @id, or extensions First All but the first Last All but the last Enforce only one If field is a list, how to manage the source. If the element is present, it must have either a @value, an @id, or extensions Not a Default Default for Type Combination Default for type + combination If this is the default rule set to apply for the source type, or this combination of types. If the element is present, it must have either a @value, an @id, or extensions Source Structure Definition Queried Structure Definition Target Structure Definition Produced Structure Definition How the referenced structure is used in this mapping. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/subscription.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Subscription dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end ================================================ FILE: tests/static/xsd/fhir/subscription.xsd ================================================ The subscription resource is used to define a push-based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system can take an appropriate action. The subscription resource is used to define a push-based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system can take an appropriate action. If the element is present, it must have either a @value, an @id, or extensions The status of the subscription, which marks the server state for managing the subscription. Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting. The time for the server to turn the subscription off. A description of why this subscription is defined. The rules that the server should use to determine when to generate notifications for this subscription. A record of the last error that occurred when the server processed a notification. Details where to send notifications when resources are received that meet the criteria. The subscription resource is used to define a push-based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system can take an appropriate action. The type of channel to send notifications on. The url that describes the actual end-point to send messages to. The mime type to send the payload in - either application/fhir+xml, or application/fhir+json. If the payload is not present, then there is no payload in the notification, just a notification. The mime type "text/plain" may also be used for Email and SMS subscriptions. Additional headers / information to send as part of the notification. Requested Active Error Off The status of a subscription. If the element is present, it must have either a @value, an @id, or extensions Rest Hook Websocket Email SMS Message The type of method used to execute a subscription. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/substance.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Substance dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/substance.xsd ================================================ A homogeneous material with a definite composition. A homogeneous material with a definite composition. If the element is present, it must have either a @value, an @id, or extensions Unique identifier for the substance. A code to indicate if the substance is actively used. A code that classifies the general type of substance. This is used for searching, sorting and display purposes. A code (or set of codes) that identify this substance. A description of the substance - its appearance, handling requirements, and other usage notes. Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance. A substance can be composed of other substances. A homogeneous material with a definite composition. Identifier associated with the package/container (usually a label affixed directly). When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. The amount of the substance. A homogeneous material with a definite composition. The amount of the ingredient in the substance - a concentration ratio. Another substance that is a component of this substance. Active Inactive Entered in Error A code to indicate if the substance is actively used. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/substancenucleicacid.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children SubstanceNucleicAcid dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content att-1: If the Attachment has data, it SHALL have a contentType per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/substancenucleicacid.xsd ================================================ Nucleic acids are defined by three distinct elements: the base, sugar and linkage. Individual substance/moiety IDs will be created for each of these elements. The nucleotide sequence will be always entered in the 5’-3’ direction. Nucleic acids are defined by three distinct elements: the base, sugar and linkage. Individual substance/moiety IDs will be created for each of these elements. The nucleotide sequence will be always entered in the 5’-3’ direction. If the element is present, it must have either a @value, an @id, or extensions The type of the sequence shall be specified based on a controlled vocabulary. The number of linear sequences of nucleotides linked through phosphodiester bonds shall be described. Subunits would be strands of nucleic acids that are tightly associated typically through Watson-Crick base pairing. NOTE: If not specified in the reference source, the assumption is that there is 1 subunit. The area of hybridisation shall be described if applicable for double stranded RNA or DNA. The number associated with the subunit followed by the number associated to the residue shall be specified in increasing order. The underscore “” shall be used as separator as follows: “Subunitnumber Residue”. (TBC). Subunits are listed in order of decreasing length; sequences of the same length will be ordered by molecular weight; subunits that have identical sequences will be repeated multiple times. Nucleic acids are defined by three distinct elements: the base, sugar and linkage. Individual substance/moiety IDs will be created for each of these elements. The nucleotide sequence will be always entered in the 5’-3’ direction. Index of linear sequences of nucleic acids in order of decreasing length. Sequences of the same length will be ordered by molecular weight. Subunits that have identical sequences will be repeated and have sequential subscripts. Actual nucleotide sequence notation from 5' to 3' end using standard single letter codes. In addition to the base sequence, sugar and type of phosphate or non-phosphate linkage should also be captured. The length of the sequence shall be captured. (TBC). The nucleotide present at the 5’ terminal shall be specified based on a controlled vocabulary. Since the sequence is represented from the 5' to the 3' end, the 5’ prime nucleotide is the letter at the first position in the sequence. A separate representation would be redundant. The nucleotide present at the 3’ terminal shall be specified based on a controlled vocabulary. Since the sequence is represented from the 5' to the 3' end, the 5’ prime nucleotide is the letter at the last position in the sequence. A separate representation would be redundant. The linkages between sugar residues will also be captured. 5.3.6.8.1 Sugar ID (Mandatory). Nucleic acids are defined by three distinct elements: the base, sugar and linkage. Individual substance/moiety IDs will be created for each of these elements. The nucleotide sequence will be always entered in the 5’-3’ direction. The entity that links the sugar residues together should also be captured for nearly all naturally occurring nucleic acid the linkage is a phosphate group. For many synthetic oligonucleotides phosphorothioate linkages are often seen. Linkage connectivity is assumed to be 3’-5’. If the linkage is either 3’-3’ or 5’-5’ this should be specified. Each linkage will be registered as a fragment and have an ID. Each linkage will be registered as a fragment and have at least one name. A single name shall be assigned to each linkage. Residues shall be captured as described in 5.3.6.8.3. Nucleic acids are defined by three distinct elements: the base, sugar and linkage. Individual substance/moiety IDs will be created for each of these elements. The nucleotide sequence will be always entered in the 5’-3’ direction. The Substance ID of the sugar or sugar-like component that make up the nucleotide. The name of the sugar or sugar-like component that make up the nucleotide. The residues that contain a given sugar will be captured. The order of given residues will be captured in the 5‘-3‘direction consistent with the base sequences listed above. ================================================ FILE: tests/static/xsd/fhir/substancepolymer.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children SubstancePolymer dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present att-1: If the Attachment has data, it SHALL have a contentType ================================================ FILE: tests/static/xsd/fhir/substancepolymer.xsd ================================================ Todo. Todo. If the element is present, it must have either a @value, an @id, or extensions Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. ================================================ FILE: tests/static/xsd/fhir/substanceprotein.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children SubstanceProtein dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content att-1: If the Attachment has data, it SHALL have a contentType per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/substanceprotein.xsd ================================================ A SubstanceProtein is defined as a single unit of a linear amino acid sequence, or a combination of subunits that are either covalently linked or have a defined invariant stoichiometric relationship. This includes all synthetic, recombinant and purified SubstanceProteins of defined sequence, whether the use is therapeutic or prophylactic. This set of elements will be used to describe albumins, coagulation factors, cytokines, growth factors, peptide/SubstanceProtein hormones, enzymes, toxins, toxoids, recombinant vaccines, and immunomodulators. A SubstanceProtein is defined as a single unit of a linear amino acid sequence, or a combination of subunits that are either covalently linked or have a defined invariant stoichiometric relationship. This includes all synthetic, recombinant and purified SubstanceProteins of defined sequence, whether the use is therapeutic or prophylactic. This set of elements will be used to describe albumins, coagulation factors, cytokines, growth factors, peptide/SubstanceProtein hormones, enzymes, toxins, toxoids, recombinant vaccines, and immunomodulators. If the element is present, it must have either a @value, an @id, or extensions The SubstanceProtein descriptive elements will only be used when a complete or partial amino acid sequence is available or derivable from a nucleic acid sequence. Number of linear sequences of amino acids linked through peptide bonds. The number of subunits constituting the SubstanceProtein shall be described. It is possible that the number of subunits can be variable. The disulphide bond between two cysteine residues either on the same subunit or on two different subunits shall be described. The position of the disulfide bonds in the SubstanceProtein shall be listed in increasing order of subunit number and position within subunit followed by the abbreviation of the amino acids involved. The disulfide linkage positions shall actually contain the amino acid Cysteine at the respective positions. This subclause refers to the description of each subunit constituting the SubstanceProtein. A subunit is a linear sequence of amino acids linked through peptide bonds. The Subunit information shall be provided when the finished SubstanceProtein is a complex of multiple sequences; subunits are not used to delineate domains within a single sequence. Subunits are listed in order of decreasing length; sequences of the same length will be ordered by decreasing molecular weight; subunits that have identical sequences will be repeated multiple times. A SubstanceProtein is defined as a single unit of a linear amino acid sequence, or a combination of subunits that are either covalently linked or have a defined invariant stoichiometric relationship. This includes all synthetic, recombinant and purified SubstanceProteins of defined sequence, whether the use is therapeutic or prophylactic. This set of elements will be used to describe albumins, coagulation factors, cytokines, growth factors, peptide/SubstanceProtein hormones, enzymes, toxins, toxoids, recombinant vaccines, and immunomodulators. Index of primary sequences of amino acids linked through peptide bonds in order of decreasing length. Sequences of the same length will be ordered by molecular weight. Subunits that have identical sequences will be repeated and have sequential subscripts. The sequence information shall be provided enumerating the amino acids from N- to C-terminal end using standard single-letter amino acid codes. Uppercase shall be used for L-amino acids and lowercase for D-amino acids. Transcribed SubstanceProteins will always be described using the translated sequence; for synthetic peptide containing amino acids that are not represented with a single letter code an X should be used within the sequence. The modified amino acids will be distinguished by their position in the sequence. Length of linear sequences of amino acids contained in the subunit. The sequence information shall be provided enumerating the amino acids from N- to C-terminal end using standard single-letter amino acid codes. Uppercase shall be used for L-amino acids and lowercase for D-amino acids. Transcribed SubstanceProteins will always be described using the translated sequence; for synthetic peptide containing amino acids that are not represented with a single letter code an X should be used within the sequence. The modified amino acids will be distinguished by their position in the sequence. Unique identifier for molecular fragment modification based on the ISO 11238 Substance ID. The name of the fragment modified at the N-terminal of the SubstanceProtein shall be specified. Unique identifier for molecular fragment modification based on the ISO 11238 Substance ID. The modification at the C-terminal shall be specified. ================================================ FILE: tests/static/xsd/fhir/substancereferenceinformation.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children SubstanceReferenceInformation dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/substancereferenceinformation.xsd ================================================ Todo. Todo. If the element is present, it must have either a @value, an @id, or extensions Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. Todo. ================================================ FILE: tests/static/xsd/fhir/substancesourcematerial.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children SubstanceSourceMaterial dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/substancesourcematerial.xsd ================================================ Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex. Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex. If the element is present, it must have either a @value, an @id, or extensions General high level classification of the source material specific to the origin of the material. The type of the source material shall be specified based on a controlled vocabulary. For vaccines, this subclause refers to the class of infectious agent. The state of the source material when extracted. The unique identifier associated with the source material parent organism shall be specified. The organism accepted Scientific name shall be provided based on the organism taxonomy. The parent of the herbal drug Ginkgo biloba, Leaf is the substance ID of the substance (fresh) of Ginkgo biloba L. or Ginkgo biloba L. (Whole plant). The parent substance of the Herbal Drug, or Herbal preparation. The country where the plant material is harvested or the countries where the plasma is sourced from as laid down in accordance with the Plasma Master File. For “Plasma-derived substances” the attribute country of origin provides information about the countries used for the manufacturing of the Cryopoor plama or Crioprecipitate. The place/region where the plant is harvested or the places/regions where the animal source material has its habitat. Stage of life for animals, plants, insects and microorganisms. This information shall be provided only when the substance is significantly different in these stages (e.g. foetal bovine serum). Many complex materials are fractions of parts of plants, animals, or minerals. Fraction elements are often necessary to define both Substances and Specified Group 1 Substances. For substances derived from Plants, fraction information will be captured at the Substance information level ( . Oils, Juices and Exudates). Additional information for Extracts, such as extraction solvent composition, will be captured at the Specified Substance Group 1 information level. For plasma-derived products fraction information will be captured at the Substance and the Specified Substance Group 1 levels. This subclause describes the organism which the substance is derived from. For vaccines, the parent organism shall be specified based on these subclause elements. As an example, full taxonomy will be described for the Substance Name: ., Leaf. To do. Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex. This element is capturing information about the fraction of a plant part, or human plasma for fractionation. The specific type of the material constituting the component. For Herbal preparations the particulars of the extracts (liquid/dry) is described in Specified Substance Group 1. Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex. The family of an organism shall be specified. The genus of an organism shall be specified; refers to the Latin epithet of the genus element of the plant/animal scientific name; it is present in names for genera, species and infraspecies. The species of an organism shall be specified; refers to the Latin epithet of the species of the plant/animal; it is present in names for species and infraspecies. The Intraspecific type of an organism shall be specified. The intraspecific description of an organism shall be specified based on a controlled vocabulary. For Influenza Vaccine, the intraspecific description shall contain the syntax of the antigen in line with the WHO convention. 4.9.13.6.1 Author type (Conditional). 4.9.13.8.1 Hybrid species maternal organism ID (Optional). 4.9.13.7.1 Kingdom (Conditional). Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex. The type of author of an organism species shall be specified. The parenthetical author of an organism species refers to the first author who published the plant/animal name (of any rank). The primary author of an organism species refers to the first author(s), who validly published the plant/animal name. The author of an organism species shall be specified. The author year of an organism shall also be specified when applicable; refers to the year in which the first author(s) published the infraspecific plant/animal name (of any rank). Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex. The identifier of the maternal species constituting the hybrid organism shall be specified based on a controlled vocabulary. For plants, the parents aren’t always known, and it is unlikely that it will be known which is maternal and which is paternal. The name of the maternal species constituting the hybrid organism shall be specified. For plants, the parents aren’t always known, and it is unlikely that it will be known which is maternal and which is paternal. The identifier of the paternal species constituting the hybrid organism shall be specified based on a controlled vocabulary. The name of the paternal species constituting the hybrid organism shall be specified. The hybrid type of an organism shall be specified. Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex. The kingdom of an organism shall be specified. The phylum of an organism shall be specified. The class of an organism shall be specified. The order of an organism shall be specified,. Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex. Entity of anatomical origin of source material within an organism. The detailed anatomic location when the part can be extracted from different anatomical locations of the organism. Multiple alternative locations may apply. ================================================ FILE: tests/static/xsd/fhir/substancespecification.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children SubstanceSpecification dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided att-1: If the Attachment has data, it SHALL have a contentType ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/substancespecification.xsd ================================================ The detailed description of a substance, typically at a level beyond what is used for prescribing. The detailed description of a substance, typically at a level beyond what is used for prescribing. If the element is present, it must have either a @value, an @id, or extensions Identifier by which this substance is known. High level categorization, e.g. polymer or nucleic acid. Status of substance within the catalogue e.g. approved. If the substance applies to only human or veterinary use. Textual description of the substance. Supporting literature. Textual comment about this record of a substance. Moiety, for structural modifications. General specifications for this substance, including how it is related to other substances. General information detailing this substance. Structural information. Codes associated with the substance. Names applicable to this substance. The molecular weight or weight range (for proteins, polymers or nucleic acids). A link between this substance and another, with details of the relationship. Data items specific to nucleic acids. Data items specific to polymers. Data items specific to proteins. Material or taxonomic/anatomical source for the substance. The detailed description of a substance, typically at a level beyond what is used for prescribing. Role that the moiety is playing. Identifier by which this moiety substance is known. Textual name for this moiety substance. Stereochemistry type. Optical activity type. Molecular formula. Quantitative value for this moiety. The detailed description of a substance, typically at a level beyond what is used for prescribing. A category for this property, e.g. Physical, Chemical, Enzymatic. Property type e.g. viscosity, pH, isoelectric point. Parameters that were used in the measurement of a property (e.g. for viscosity: measured at 20C with a pH of 7.1). A substance upon which a defining property depends (e.g. for solubility: in water, in alcohol). Quantitative value for this property. The detailed description of a substance, typically at a level beyond what is used for prescribing. Stereochemistry type. Optical activity type. Molecular formula. Specified per moiety according to the Hill system, i.e. first C, then H, then alphabetical, each moiety separated by a dot. Applicable for single substances that contain a radionuclide or a non-natural isotopic ratio. The molecular weight or weight range (for proteins, polymers or nucleic acids). Supporting literature. Molecular structural representation. The detailed description of a substance, typically at a level beyond what is used for prescribing. Substance identifier for each non-natural or radioisotope. Substance name for each non-natural or radioisotope. The type of isotopic substitution present in a single substance. Half life - for a non-natural nuclide. The molecular weight or weight range (for proteins, polymers or nucleic acids). The detailed description of a substance, typically at a level beyond what is used for prescribing. The method by which the molecular weight was determined. Type of molecular weight such as exact, average (also known as. number average), weight average. Used to capture quantitative values for a variety of elements. If only limits are given, the arithmetic mean would be the average. If only a single definite value for a given element is given, it would be captured in this field. The detailed description of a substance, typically at a level beyond what is used for prescribing. The type of structure (e.g. Full, Partial, Representative). The structural representation as text string in a format e.g. InChI, SMILES, MOLFILE, CDX. An attached file with the structural representation. The detailed description of a substance, typically at a level beyond what is used for prescribing. The specific code. Status of the code assignment. The date at which the code status is changed as part of the terminology maintenance. Any comment can be provided in this field, if necessary. Supporting literature. The detailed description of a substance, typically at a level beyond what is used for prescribing. The actual name. Name type. The status of the name. If this is the preferred name for this substance. Language of the name. The use context of this name for example if there is a different name a drug active ingredient as opposed to a food colour additive. The jurisdiction where this name applies. A synonym of this name. A translation for this name. Details of the official nature of this name. Supporting literature. The detailed description of a substance, typically at a level beyond what is used for prescribing. Which authority uses this official name. The status of the official name. Date of official name change. The detailed description of a substance, typically at a level beyond what is used for prescribing. A pointer to another substance, as a resource or just a representational code. For example "salt to parent", "active moiety", "starting material". For example where an enzyme strongly bonds with a particular substance, this is a defining relationship for that enzyme, out of several possible substance relationships. A numeric factor for the relationship, for instance to express that the salt of a substance has some percentage of the active substance in relation to some other. For use when the numeric. An operator for the amount, for example "average", "approximately", "less than". Supporting literature. ================================================ FILE: tests/static/xsd/fhir/supplydelivery.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children SupplyDelivery dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/supplydelivery.xsd ================================================ Record of delivery of what is supplied. Record of delivery of what is supplied. If the element is present, it must have either a @value, an @id, or extensions Identifier for the supply delivery event that is used to identify it across multiple disparate systems. A plan, proposal or order that is fulfilled in whole or in part by this event. A larger event of which this particular event is a component or step. A code specifying the state of the dispense event. A link to a resource representing the person whom the delivered item is for. Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. The item that is being delivered or has been supplied. The date or time(s) the activity occurred. The individual responsible for dispensing the medication, supplier or device. Identification of the facility/location where the Supply was shipped to, as part of the dispense event. Identifies the person who picked up the Supply. Record of delivery of what is supplied. The amount of supply that has been dispensed. Includes unit of measure. Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a code that identifies the item from a known list. In Progress Delivered Abandoned Entered In Error Status of the supply delivery. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/supplyrequest.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children SupplyRequest dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/supplyrequest.xsd ================================================ A record of a request for a medication, substance or device used in the healthcare setting. A record of a request for a medication, substance or device used in the healthcare setting. If the element is present, it must have either a @value, an @id, or extensions Business identifiers assigned to this SupplyRequest by the author and/or other systems. These identifiers remain constant as the resource is updated and propagates from server to server. Status of the supply request. Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process. Indicates how quickly this SupplyRequest should be addressed with respect to other requests. The item that is requested to be supplied. This is either a link to a resource representing the details of the item or a code that identifies the item from a known list. The amount that is being ordered of the indicated item. Specific parameters for the ordered item. For example, the size of the indicated item. When the request should be fulfilled. When the request was made. The device, practitioner, etc. who initiated the request. Who is intended to fulfill the request. The reason why the supply item was requested. The reason why the supply item was requested. Where the supply is expected to come from. Where the supply is destined to go. A record of a request for a medication, substance or device used in the healthcare setting. A code or string that identifies the device detail being asserted. The value of the device detail. Draft Active Suspended Cancelled Completed Entered in Error Unknown Status of the supply request. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/task.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children Task dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label inv-1: Last modified date must be greater than or equal to authored-on date. txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/task.xsd ================================================ A task to be performed. A task to be performed. If the element is present, it must have either a @value, an @id, or extensions The business identifier for this task. The URL pointing to a *FHIR*-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task. The URL pointing to an *externally* maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task. BasedOn refers to a higher-level authorization that triggered the creation of the task. It references a "request" resource such as a ServiceRequest, MedicationRequest, ServiceRequest, CarePlan, etc. which is distinct from the "request" resource the task is seeking to fulfill. This latter resource is referenced by FocusOn. For example, based on a ServiceRequest (= BasedOn), a task is created to fulfill a procedureRequest ( = FocusOn ) to collect a specimen from a patient. An identifier that links together multiple tasks and other requests that were created in the same context. Task that this particular task is part of. The current status of the task. An explanation as to why this task is held, failed, was refused, etc. Contains business-specific nuances of the business state. Indicates the "level" of actionability associated with the Task, i.e. i+R[9]Cs this a proposed task, a planned task, an actionable task, etc. Indicates how quickly the Task should be addressed with respect to other requests. A name or code (or both) briefly describing what the task involves. A free-text description of what is to be performed. The request being actioned or the resource being manipulated by this task. The entity who benefits from the performance of the service specified in the task (e.g., the patient). The healthcare event (e.g. a patient and healthcare provider interaction) during which this task was created. Identifies the time action was first taken against the task (start) and/or the time final action was taken against the task prior to marking it as completed (end). The date and time this task was created. The date and time of last modification to this task. The creator of the task. The kind of participant that should perform the task. Individual organization or Device currently responsible for task execution. Principal physical location where the this task is performed. A description or code indicating why this task needs to be performed. A resource reference indicating why this task needs to be performed. Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be relevant to the Task. Free-text information captured about the task as it progresses. Links to Provenance records for past versions of this Task that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the task. If the Task.focus is a request resource and the task is seeking fulfillment (i.e. is asking for the request to be actioned), this element identifies any limitations on what parts of the referenced request should be actioned. Additional information that may be needed in the execution of the task. Outputs produced by the Task. A task to be performed. Indicates the number of times the requested action should occur. Over what time-period is fulfillment sought. For requests that are targeted to more than on potential recipient/target, for whom is fulfillment sought? A task to be performed. A code or description indicating how the input is intended to be used as part of the task execution. The value of the input parameter as a basic type. A task to be performed. The name of the Output parameter. The value of the Output parameter as a basic type. Draft Requested Received Accepted Rejected Ready Cancelled In Progress On Hold Failed Completed Entered in Error The current status of the task. If the element is present, it must have either a @value, an @id, or extensions Unknown Proposal Plan Order Original Order Reflex Order Filler Order Instance Order Option Distinguishes whether the task is a proposal, plan or full order. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/terminologycapabilities.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children TerminologyCapabilities dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label tcp-3: If kind = instance, implementation must be present and software may be present tcp-2: A Capability Statement SHALL have at least one of description, software, or implementation element. tcp-5: If kind = requirements, implementation and software must be absent tcp-4: If kind = capability, implementation must be absent, software must be present txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided tcp-1: If there is more than one version, a version code must be defined ================================================ FILE: tests/static/xsd/fhir/terminologycapabilities.xsd ================================================ A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this terminology capabilities when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this terminology capabilities is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the terminology capabilities is stored on different servers. The identifier that is used to identify this version of the terminology capabilities when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the terminology capabilities author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the terminology capabilities. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the terminology capabilities. The status of this terminology capabilities. Enables tracking the life-cycle of the content. A Boolean value to indicate that this terminology capabilities is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the terminology capabilities was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the terminology capabilities changes. The name of the organization or individual that published the terminology capabilities. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the terminology capabilities from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate terminology capabilities instances. A legal or geographic region in which the terminology capabilities is intended to be used. Explanation of why this terminology capabilities is needed and why it has been designed as it has. A copyright statement relating to the terminology capabilities and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the terminology capabilities. The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind, not instance of software) or a class of implementation (e.g. a desired purchase). Software that is covered by this terminology capability statement. It is used when the statement describes the capabilities of a particular software version, independent of an installation. Identifies a specific implementation instance that is described by the terminology capability statement - i.e. a particular installation, rather than the capabilities of a software program. Whether the server supports lockedDate. Identifies a code system that is supported by the server. If there is a no code system URL, then this declares the general assumptions a client can make about support for any CodeSystem resource. Information about the [ValueSet/$expand](valueset-operation-expand.html) operation. The degree to which the server supports the code search parameter on ValueSet, if it is supported. Information about the [ValueSet/$validate-code](valueset-operation-validate-code.html) operation. Information about the [ConceptMap/$translate](conceptmap-operation-translate.html) operation. Whether the $closure operation is supported. A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Name the software is known by. The version identifier for the software covered by this statement. A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Information about the specific installation that this terminology capability statement relates to. An absolute base URL for the implementation. A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. URI for the Code System. For the code system, a list of versions that are supported by the server. True if subsumption is supported for this version of the code system. A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. For version-less code systems, there should be a single version with no identifier. If this is the default version for this code system. If the compositional grammar defined by the code system is supported. Language Displays supported. Filter Properties supported. Properties supported for $lookup. A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Code of the property supported. Operations supported for the property. A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Whether the server can return nested value sets. Whether the server supports paging on expansion. Allow request for incomplete expansions? Supported expansion parameter. Documentation about text searching works. A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Expansion Parameter name. Description of support for parameter. A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Whether translations are validated. A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. Whether the client must identify the map. A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. If cross-system closure is supported. Explicit Codes Implicit Codes The degree to which the server supports the code search parameter on ValueSet, if it is supported. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/testreport.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children TestReport dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided inv-1: Setup action SHALL contain either an operation or assert but not both. inv-2: Test action SHALL contain either an operation or assert but not both. ================================================ FILE: tests/static/xsd/fhir/testreport.xsd ================================================ A summary of information based on the results of executing a TestScript. A summary of information based on the results of executing a TestScript. If the element is present, it must have either a @value, an @id, or extensions Identifier for the TestScript assigned for external purposes outside the context of FHIR. A free text natural language name identifying the executed TestScript. The current state of this test report. Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`. The overall result from the execution of the TestScript. The final score (percentage of tests passed) resulting from the execution of the TestScript. Name of the tester producing this report (Organization or individual). When the TestScript was executed and this TestReport was generated. A participant in the test execution, either the execution engine, a client, or a server. The results of the series of required setup operations before the tests were executed. A test executed from the test script. The results of the series of operations required to clean up after all the tests were executed (successfully or otherwise). A summary of information based on the results of executing a TestScript. The type of participant. The uri of the participant. An absolute URL is preferred. The display name of the participant. A summary of information based on the results of executing a TestScript. Action would contain either an operation or an assertion. A summary of information based on the results of executing a TestScript. The operation performed. The results of the assertion performed on the previous operations. A summary of information based on the results of executing a TestScript. The result of this operation. An explanatory message associated with the result. A link to further details on the result. A summary of information based on the results of executing a TestScript. The result of this assertion. An explanatory message associated with the result. A link to further details on the result. A summary of information based on the results of executing a TestScript. The name of this test used for tracking/logging purposes by test engines. A short description of the test used by test engines for tracking and reporting purposes. Action would contain either an operation or an assertion. A summary of information based on the results of executing a TestScript. An operation would involve a REST request to a server. The results of the assertion performed on the previous operations. A summary of information based on the results of executing a TestScript. The teardown action will only contain an operation. A summary of information based on the results of executing a TestScript. An operation would involve a REST request to a server. Completed In Progress Waiting Stopped Entered In Error The current status of the test report. If the element is present, it must have either a @value, an @id, or extensions Pass Skip Fail Warning Error The results of executing an action. If the element is present, it must have either a @value, an @id, or extensions Test Engine Client Server The type of participant. If the element is present, it must have either a @value, an @id, or extensions Pass Fail Pending The reported execution result. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/testscript.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children TestScript dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided tst-4: TestScript metadata capability SHALL contain required or validated or both. ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided tst-3: Variable can only contain one of expression, headerField or path. tst-1: Setup action SHALL contain either an operation or assert but not both. tst-7: Setup operation SHALL contain either sourceId or targetId or params or url. tst-12: Setup action assert response and responseCode SHALL be empty when direction equals request tst-5: Only a single assertion SHALL be present within setup action assert element. tst-10: Setup action assert SHALL contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither. tst-2: Test action SHALL contain either an operation or assert but not both. tst-8: Test operation SHALL contain either sourceId or targetId or params or url. tst-11: Test action assert SHALL contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither. tst-13: Test action assert response and response and responseCode SHALL be empty when direction equals request tst-6: Only a single assertion SHALL be present within test action assert element. tst-9: Teardown operation SHALL contain either sourceId or targetId or params or url. ================================================ FILE: tests/static/xsd/fhir/testscript.xsd ================================================ A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this test script when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this test script is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the test script is stored on different servers. A formal identifier that is used to identify this test script when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the test script when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the test script author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the test script. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the test script. The status of this test script. Enables tracking the life-cycle of the content. A Boolean value to indicate that this test script is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the test script was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the test script changes. The name of the organization or individual that published the test script. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the test script from a consumer's perspective. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate test script instances. A legal or geographic region in which the test script is intended to be used. Explanation of why this test script is needed and why it has been designed as it has. A copyright statement relating to the test script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the test script. An abstract server used in operations within this test script in the origin element. An abstract server used in operations within this test script in the destination element. The required capability must exist and are assumed to function correctly on the FHIR server being tested. Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute. Reference to the profile to be used for validation. Variable is set based either on element value in response body or on header field value in the response headers. A series of required setup operations before tests are executed. A test in this script. A series of operations required to clean up after all the tests are executed (successfully or otherwise). A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. Abstract name given to an origin server in this test script. The name is provided as a number starting at 1. The type of origin profile the test system supports. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. Abstract name given to a destination server in this test script. The name is provided as a number starting at 1. The type of destination profile the test system supports. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. A link to the FHIR specification that this test is covering. Capabilities that must exist and are assumed to function correctly on the FHIR server being tested. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. URL to a particular requirement or feature within the FHIR specification. Short description of the link. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. Whether or not the test execution will require the given capabilities of the server in order for this test script to execute. Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute. Description of the capabilities that this test script is requiring the server to support. Which origin server these requirements apply to. Which server these requirements apply to. Links to the FHIR specification that describes this interaction and the resources involved in more detail. Minimum capabilities required of server for test script to execute successfully. If server does not meet at a minimum the referenced capability statement, then all tests in this script are skipped. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section. Whether or not to implicitly delete the fixture during teardown. If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section. Reference to the resource (containing the contents of the resource needed for operations). A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. Descriptive name for this variable. A default, hard-coded, or user-defined value for this variable. A free text natural language description of the variable and its purpose. The FHIRPath expression to evaluate against the fixture body. When variables are defined, only one of either expression, headerField or path must be specified. Will be used to grab the HTTP header field value from the headers that sourceId is pointing to. Displayable text string with hint help information to the user when entering a default value. XPath or JSONPath to evaluate against the fixture body. When variables are defined, only one of either expression, headerField or path must be specified. Fixture to evaluate the XPath/JSONPath expression or the headerField against within this variable. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. Action would contain either an operation or an assertion. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. The operation to perform. Evaluates the results of previous operations to determine if the server under test behaves appropriately. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. Server interaction or operation type. The type of the resource. See http://build.fhir.org/resourcelist.html. The label would be used for tracking/logging purposes by test engines. The description would be used by test engines for tracking and reporting purposes. The mime-type to use for RESTful operation in the 'Accept' header. The mime-type to use for RESTful operation in the 'Content-Type' header. The server where the request message is destined for. Must be one of the server numbers listed in TestScript.destination section. Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths. The HTTP method the test engine MUST use for this operation regardless of any other operation details. The server where the request message originates from. Must be one of the server numbers listed in TestScript.origin section. Path plus parameters after [type]. Used to set parts of the request URL explicitly. Header elements would be used to set HTTP headers. The fixture id (maybe new) to map to the request. The fixture id (maybe new) to map to the response. The id of the fixture used as the body of a PUT or POST request. Id of fixture used for extracting the [id], [type], and [vid] for GET requests. Complete request URL. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. The HTTP header field e.g. "Accept". The value of the header e.g. "application/fhir+xml". A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. The label would be used for tracking/logging purposes by test engines. The description would be used by test engines for tracking and reporting purposes. The direction to use for the assertion. Id of the source fixture used as the contents to be evaluated by either the "source/expression" or "sourceId/path" definition. The FHIRPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both. XPath or JSONPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both. The mime-type contents to compare against the request or response message 'Content-Type' header. The FHIRPath expression to be evaluated against the request or response message contents - HTTP headers and payload. The HTTP header field name e.g. 'Location'. The ID of a fixture. Asserts that the response contains at a minimum the fixture specified by minimumId. Whether or not the test execution performs validation on the bundle navigation links. The operator type defines the conditional behavior of the assert. If not defined, the default is equals. The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server. The request method or HTTP operation code to compare against that used by the client system under test. The value to use in a comparison against the request URL path string. The type of the resource. See http://build.fhir.org/resourcelist.html. okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable. The value of the HTTP response code to be tested. Fixture to evaluate the XPath/JSONPath expression or the headerField against. The ID of the Profile to validate against. The value to compare to. Whether or not the test execution will produce a warning only on error for this assert. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. The name of this test used for tracking/logging purposes by test engines. A short description of the test used by test engines for tracking and reporting purposes. Action would contain either an operation or an assertion. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. An operation would involve a REST request to a server. Evaluates the results of previous operations to determine if the server under test behaves appropriately. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. The teardown action will only contain an operation. A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification. An operation would involve a REST request to a server. response request The type of direction to use for assertion. If the element is present, it must have either a @value, an @id, or extensions equals notEquals in notIn greaterThan lessThan empty notEmpty contains notContains evaluate The type of operator to use for assertion. If the element is present, it must have either a @value, an @id, or extensions okay created noContent notModified bad forbidden notFound methodNotAllowed conflict gone preconditionFailed unprocessable The type of response code to use for assertion. If the element is present, it must have either a @value, an @id, or extensions DELETE GET OPTIONS PATCH POST PUT HEAD The allowable request method or HTTP operation codes. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/valueset.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children ValueSet dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided cpt-2: A system is required if a value is provided. per-1: If present, start SHALL have a lower value than end qty-3: If a code for the unit is present, the system SHALL also be present rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided vsd-2: A value set with concepts or filters SHALL include a system vsd-3: Cannot have both concept and filter vsd-1: A value set include/exclude SHALL have a value set or a system vsd-6: SHALL have a code or a display vsd-9: Must have a code if not abstract vsd-10: Must have a system if a code is present ================================================ FILE: tests/static/xsd/fhir/valueset.xsd ================================================ A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html). A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html). If the element is present, it must have either a @value, an @id, or extensions An absolute URI that is used to identify this value set when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this value set is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the value set is stored on different servers. A formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance. The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the value set author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. A natural language name identifying the value set. This name should be usable as an identifier for the module by machine processing applications such as code generation. A short, descriptive, user-friendly title for the value set. The status of this value set. Enables tracking the life-cycle of the content. The status of the value set applies to the value set definition (ValueSet.compose) and the associated ValueSet metadata. Expansions do not have a state. A Boolean value to indicate that this value set is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage. The date (and optionally time) when the value set was created or revised (e.g. the 'content logical definition'). The name of the organization or individual that published the value set. Contact details to assist a user in finding and communicating with the publisher. A free text natural language description of the value set from a consumer's perspective. The textual description specifies the span of meanings for concepts to be included within the Value Set Expansion, and also may specify the intended use and limitations of the Value Set. The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate value set instances. A legal or geographic region in which the value set is intended to be used. If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change. Explanation of why this value set is needed and why it has been designed as it has. A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set. A set of criteria that define the contents of the value set by including or excluding codes selected from the specified code system(s) that the value set draws from. This is also known as the Content Logical Definition (CLD). A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed. A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html). The Locked Date is the effective date that is used to determine the version of all referenced Code Systems and Value Set Definitions included in the compose that are not already tied to a specific version. Whether inactive codes - codes that are not approved for current use - are in the value set. If inactive = true, inactive codes are to be included in the expansion, if inactive = false, the inactive codes will not be included in the expansion. If absent, the behavior is determined by the implementation, or by the applicable $expand parameters (but generally, inactive codes would be expected to be included). Include one or more codes from a code system or other value set(s). Exclude one or more codes from the value set based on code system filters and/or other value sets. A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html). An absolute URI which is the code system from which the selected codes come from. The version of the code system that the codes are selected from, or the special version '*' for all versions. Specifies a concept to be included or excluded. Select concepts by specify a matching criterion based on the properties (including relationships) defined by the system, or on filters defined by the system. If multiple filters are specified, they SHALL all be true. Selects the concepts found in this value set (based on its value set definition). This is an absolute URI that is a reference to ValueSet.url. If multiple value sets are specified this includes the union of the contents of all of the referenced value sets. A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html). Specifies a code for the concept to be included or excluded. The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system. Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc. A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html). The language this designation is defined for. A code that represents types of uses of designations. The text value for this designation. A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html). A code that identifies a property or a filter defined in the code system. The kind of operation to perform as a part of the filter criteria. The match value may be either a code defined by the system, or a string value, which is a regex match on the literal string of the property value (if the filter represents a property defined in CodeSystem) or of the system filter value (if the filter represents a filter defined in CodeSystem) when the operation is 'regex', or one of the values (true and false), when the operation is 'exists'. A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html). An identifier that uniquely identifies this expansion of the valueset, based on a unique combination of the provided parameters, the system default parameters, and the underlying system code system versions etc. Systems may re-use the same identifier as long as those factors remain the same, and the expansion is the same, but are not required to do so. This is a business identifier. The time at which the expansion was produced by the expanding system. The total number of concepts in the expansion. If the number of concept nodes in this resource is less than the stated number, then the server can return more using the offset parameter. If paging is being used, the offset at which this resource starts. I.e. this resource is a partial view into the expansion. If paging is not being used, this element SHALL NOT be present. A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion. The codes that are contained in the value set expansion. A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html). Name of the input parameter to the $expand operation; may be a server-assigned name for additional default or other server-supplied parameters used to control the expansion process. The value of the parameter. A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html). An absolute URI which is the code system in which the code for this item in the expansion is defined. If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value. If the concept is inactive in the code system that defines it. Inactive codes are those that are no longer to be used, but are maintained by the code system for understanding legacy data. It might not be known or specified whether an concept is inactive (and it may depend on the context of use). The version of the code system from this code was taken. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured, and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged. The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set. The recommended display for this item in the expansion. Additional representations for this item - other languages, aliases, specialized purposes, used for particular purposes, etc. These are relevant when the conditions of the expansion do not fix to a single correct representation. Other codes and entries contained under this entry in the hierarchy. ================================================ FILE: tests/static/xsd/fhir/verificationresult.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children VerificationResult dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV) tim-5: period SHALL be a non-negative value tim-6: If there's a periodMax, there must be a period tim-7: If there's a durationMax, there must be a duration tim-8: If there's a countMax, there must be a count tim-1: if there's a duration, there needs to be duration units tim-10: If there's a timeOfDay, there cannot be a when, or vice versa tim-2: if there's a period, there needs to be period units tim-4: duration SHALL be a non-negative value drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. rng-2: If present, low SHALL have a lower value than high qty-3: If a code for the unit is present, the system SHALL also be present qty-3: If a code for the unit is present, the system SHALL also be present per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/verificationresult.xsd ================================================ Describes validation requirements, source(s), status and dates for one or more elements. Describes validation requirements, source(s), status and dates for one or more elements. If the element is present, it must have either a @value, an @id, or extensions A resource that was validated. The fhirpath location(s) within the resource that was validated. The frequency with which the target must be validated (none; initial; periodic). The validation status of the target (attested; validated; in process; requires revalidation; validation failed; revalidation failed). When the validation status was updated. What the target is validated against (nothing; primary source; multiple sources). The primary process by which the target is validated (edit check; value set; primary source; multiple sources; standalone; in context). Frequency of revalidation. The date/time validation was last completed (including failed validations). The date when target is next validated, if appropriate. The result if validation fails (fatal; warning; record only; none). Information about the primary source(s) involved in validation. Information about the entity attesting to information. Information about the entity validating information. Describes validation requirements, source(s), status and dates for one or more elements. Reference to the primary source. Type of primary source (License Board; Primary Education; Continuing Education; Postal Service; Relationship owner; Registration Authority; legal source; issuing source; authoritative source). Method for communicating with the primary source (manual; API; Push). Status of the validation of the target against the primary source (successful; failed; unknown). When the target was validated against the primary source. Ability of the primary source to push updates/alerts (yes; no; undetermined). Type of alerts/updates the primary source can send (specific requested changes; any changes; as defined by source). Describes validation requirements, source(s), status and dates for one or more elements. The individual or organization attesting to information. When the who is asserting on behalf of another (organization or individual). The method by which attested information was submitted/retrieved (manual; API; Push). The date the information was attested to. A digital identity certificate associated with the attestation source. A digital identity certificate associated with the proxy entity submitting attested information on behalf of the attestation source. Signed assertion by the proxy entity indicating that they have the right to submit attested information on behalf of the attestation source. Signed assertion by the attestation source that they have attested to the information. Describes validation requirements, source(s), status and dates for one or more elements. Reference to the organization validating information. A digital identity certificate associated with the validator. Signed assertion by the validator that they have validated the information. Attested Validated In process Requires revalidation Validation failed Re-Validation failed The validation status of the target. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/visionprescription.sch ================================================ Global ext-1: Must have either extensions or value[x], not both ext-1: Must have either extensions or value[x], not both Global 1 global-1: All FHIR elements must have a @value or children VisionPrescription dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource dom-5: If a resource is contained in another resource, it SHALL NOT have a security label txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes txt-2: The narrative SHALL have some non-whitespace content per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided qty-3: If a code for the unit is present, the system SHALL also be present ref-1: SHALL have a contained resource if a local reference is provided per-1: If present, start SHALL have a lower value than end ref-1: SHALL have a contained resource if a local reference is provided ================================================ FILE: tests/static/xsd/fhir/visionprescription.xsd ================================================ An authorization for the provision of glasses and/or contact lenses to a patient. An authorization for the provision of glasses and/or contact lenses to a patient. If the element is present, it must have either a @value, an @id, or extensions A unique identifier assigned to this vision prescription. The status of the resource instance. The date this resource was created. A resource reference to the person to whom the vision prescription applies. A reference to a resource that identifies the particular occurrence of contact between patient and health care provider during which the prescription was issued. The date (and perhaps time) when the prescription was written. The healthcare professional responsible for authorizing the prescription. Contain the details of the individual lens specifications and serves as the authorization for the fullfillment by certified professionals. An authorization for the provision of glasses and/or contact lenses to a patient. Identifies the type of vision correction product which is required for the patient. The eye for which the lens specification applies. Lens power measured in dioptres (0.25 units). Power adjustment for astigmatism measured in dioptres (0.25 units). Adjustment for astigmatism measured in integer degrees. Allows for adjustment on two axis. Power adjustment for multifocal lenses measured in dioptres (0.25 units). Contact lens power measured in dioptres (0.25 units). Back curvature measured in millimetres. Contact lens diameter measured in millimetres. The recommended maximum wear period for the lens. Special color or pattern. Brand recommendations or restrictions. Notes for special requirements such as coatings and lens materials. An authorization for the provision of glasses and/or contact lenses to a patient. Amount of prism to compensate for eye alignment in fractional units. The relative base, or reference lens edge, for the prism. Up Down In Out A coded concept listing the base codes. If the element is present, it must have either a @value, an @id, or extensions Right Eye Left Eye A coded concept listing the eye codes. If the element is present, it must have either a @value, an @id, or extensions ================================================ FILE: tests/static/xsd/fhir/xml.xsd ================================================ 

About the XML namespace

This schema document describes the XML namespace, in a form suitable for import by other schema documents.

See http://www.w3.org/XML/1998/namespace.html and http://www.w3.org/TR/REC-xml for information about this namespace.

Note that local names in this namespace are intended to be defined only by the World Wide Web Consortium or its subgroups. The names currently defined in this namespace are listed below. They should not be used with conflicting semantics by any Working Group, specification, or document instance.

See further below in this document for more information about how to refer to this schema document from your own XSD schema documents and about the namespace-versioning policy governing this schema document.

lang (as an attribute name)

denotes an attribute whose value is a language code for the natural language of the content of any element; its value is inherited. This name is reserved by virtue of its definition in the XML specification.

Notes

Attempting to install the relevant ISO 2- and 3-letter codes as the enumerated possible values is probably never going to be a realistic possibility.

See BCP 47 at http://www.rfc-editor.org/rfc/bcp/bcp47.txt and the IANA language subtag registry at http://www.iana.org/assignments/language-subtag-registry for further information.

The union allows for the 'un-declaration' of xml:lang with the empty string.

space (as an attribute name)

denotes an attribute whose value is a keyword indicating what whitespace processing discipline is intended for the content of the element; its value is inherited. This name is reserved by virtue of its definition in the XML specification.

base (as an attribute name)

denotes an attribute whose value provides a URI to be used as the base for interpreting any relative URIs in the scope of the element on which it appears; its value is inherited. This name is reserved by virtue of its definition in the XML Base specification.

See http://www.w3.org/TR/xmlbase/ for information about this attribute.

id (as an attribute name)

denotes an attribute whose value should be interpreted as if declared to be of type ID. This name is reserved by virtue of its definition in the xml:id specification.

See http://www.w3.org/TR/xml-id/ for information about this attribute.

Father (in any context at all)

denotes Jon Bosak, the chair of the original XML Working Group. This name is reserved by the following decision of the W3C XML Plenary and XML Coordination groups:

In appreciation for his vision, leadership and dedication the W3C XML Plenary on this 10th day of February, 2000, reserves for Jon Bosak in perpetuity the XML name "xml:Father".

About this schema document

This schema defines attributes and an attribute group suitable for use by schemas wishing to allow xml:base, xml:lang, xml:space or xml:id attributes on elements they define.

To enable this, such a schema must import this schema for the XML namespace, e.g. as follows:

          <schema . . .>
           . . .
           <import namespace="http://www.w3.org/XML/1998/namespace"
                      schemaLocation="http://www.w3.org/2001/xml.xsd"/>
     

or

           <import namespace="http://www.w3.org/XML/1998/namespace"
                      schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
     

Subsequently, qualified reference to any of the attributes or the group defined below will have the desired effect, e.g.

          <type . . .>
           . . .
           <attributeGroup ref="xml:specialAttrs"/>
     

will define a type which will schema-validate an instance element with any of those attributes.

Versioning policy for this schema document

In keeping with the XML Schema WG's standard versioning policy, this schema document will persist at http://www.w3.org/2009/01/xml.xsd.

At the date of issue it can also be found at http://www.w3.org/2001/xml.xsd.

The schema document at that URI may however change in the future, in order to remain compatible with the latest version of XML Schema itself, or with the XML namespace itself. In other words, if the XML Schema or XML namespaces change, the version of this document at http://www.w3.org/2001/xml.xsd will change accordingly; the version at http://www.w3.org/2009/01/xml.xsd will not change.

Previous dated (and unchanging) versions of this schema document are at:

================================================ FILE: tests/static/xsd/fhir/xmldsig-core-schema.xsd ================================================  ================================================ FILE: tests/test_summary_mode_serialization.py ================================================ from fhir.resources.R4B.patient import Patient from .conftest import STATIC_PATH __author__ = 'Md Nazrul Islam' __email__ = "email2nazrul@gmail.com" def test_summary_for_model_serialization(): """ """ patient_fhir = Patient.model_validate_json( (STATIC_PATH / "R4B" / "Patient-with-ext.json").read_bytes() ) patient_dict = patient_fhir.model_dump(summary_only=True) assert "text" not in patient_dict assert "contained" not in patient_dict assert "extension" not in patient_dict assert "identifier" in patient_dict patient_dict = patient_fhir.model_dump(summary_only=False) assert "text" in patient_dict assert "contained" in patient_dict assert "extension" in patient_dict def test_summary_for_json_serialization(): """ """ patient_fhir = Patient.model_validate_json( (STATIC_PATH / "R4B" / "Patient-with-ext.json").read_bytes() ) json_str = patient_fhir.model_dump_json(summary_only=True) assert "\"text\"" not in json_str assert "\"contained\"" not in json_str assert "\"extension\"" not in json_str assert "\"identifier\"" in json_str json_str = patient_fhir.model_dump_json(summary_only=False) assert "\"text\"" in json_str assert "\"contained\"" in json_str assert "\"extension\"" in json_str def test_summary_for_xml_serialization(): """ """ patient_fhir = Patient.model_validate_json( (STATIC_PATH / "R4B" / "Patient-with-ext.json").read_bytes() ) xml_bytes = patient_fhir.model_dump_xml(summary_only=True) assert b"" not in xml_bytes assert b"" not in xml_bytes assert b"" in xml_bytes xml_bytes = patient_fhir.model_dump_xml(summary_only=False) assert b"" in xml_bytes assert b"" in xml_bytes assert b" Optional[client.HTTPResponse]: """ """ if isinstance(resource, FHIRAbstractModel): resource_str = resource.model_dump_xml(return_bytes=True, pretty_print=False) resource_type = resource.get_resource_type() else: resource_type = resource.name resource_str = resource.to_string(pretty_print=False) try: url = f"http://hapi.fhir.org/baseR4/{resource_type}?_format=xml&_pretty=true" LOG.info(f"POST request to `{url}`") conn.request( "POST", url, body=resource_str, headers={ "Accept-Charset": "utf-8", "Accept": "application/fhir+xml;q=1.0, application/xml+fhir;q=0.9", "Content-Type": "application/fhir+xml; charset=UTF-8", }, ) response = conn.getresponse() return response except client.HTTPException as exc: sys.stderr.write(f"{exc}\n") return None ================================================ FILE: tox.ini ================================================ [tox] envlist = py38, py39, py310, py311, py312, flake8 [travis] python = 3.8: py38 3.9: py39 3.10: py310 3.11: py311 3.12: py312 [testenv:flake8] basepython = python deps = flake8 commands = flake8 fhir.resources [testenv] setenv = PYTHONPATH = {toxinidir} deps = -r{toxinidir}/requirements_dev.txt ; If you want to make tox run the tests with the same versions, create a ; requirements.txt with the pinned versions and uncomment the following line: ; -r{toxinidir}/requirements.txt commands = pip install -U pip py.test --basetemp={envtmpdir}